diff --git a/.gitattributes b/.gitattributes index dfe0770424..cbd25a6bf4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,6 @@ # Auto detect text files and perform LF normalization * text=auto +# Set browser syntax highlighting for certain files +*.inc linguist-language=gas +*.seq linguist-language=gas +include/audio/aseq.h linguist-language=gas diff --git a/.gitignore b/.gitignore index bff09b91ed..e49807cbb4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,37 +3,24 @@ __pycache__/ .pyc .DS_Store -# Text editor remnants +# IDE files .vscode/ .vs/ .idea/ -CMakeLists.txt -cmake-build-debug -venv/ -.venv/ +.cache/ +compile_commands.json # Project-specific ignores +.make_options.mk +extracted/ build/ expected/ -notes/ -baserom/ -baseroms/*/segments/ docs/doxygen/ -build/*/cache/ -*.elf -*.ram -*.sav -*.sra -*.srm *.z64 *.n64 *.v64 -*.map -*.dump *.wad *.iso -out.txt -*.ram *.bin *.blend1 F3DEX3/*.code @@ -41,33 +28,14 @@ F3DEX3/*.data wadextract/ isoextract/ -# Tool artifacts -tools/mipspro7.2_compiler/ -tools/overlayhelpers/batchdisasm/output/* -tools/overlayhelpers/batchdisasm/output2/* -tools/overlayhelpers/batchdisasm/mipsdisasm/* -tools/disasm/output/* -tools/asmsplitter/asm/* -tools/asmsplitter/c/* +# Tools +.venv/ ctx.c tools/*dSYM/ graphs/ - -# Assets -*.png -*.jpg -*.mdli -*.anmi -*.obj -*.mtl -*.fbx -!*_custom* -.extracted-assets.json -extracted/ -!mod_assets/* - -# Docs -!docs/tutorial/ +tools/Flips/**/CMakeLists.txt # Per-user configuration -.python-version +# If you want to use your own gitignore rules without modifying this file: +# - use `git config core.excludesFile path/to/my_gitignore_file` +# - or edit `.git/info/exclude` diff --git a/.make_hackeroot.mk b/.make_hackeroot.mk new file mode 100644 index 0000000000..cd7247ddeb --- /dev/null +++ b/.make_hackeroot.mk @@ -0,0 +1,63 @@ +# 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 + +# Returns the path to the command $(1) if exists. Otherwise returns an empty string. +find-command = $(shell which $(1) 2>/dev/null) + +ifneq ($(call find-command,mips-n64-ld),) + MIPS_BINUTILS_PREFIX := mips-n64- +else ifneq ($(call find-command,mips64-ld),) + MIPS_BINUTILS_PREFIX := mips64- +else ifneq ($(call find-command,mips-linux-gnu-ld),) + MIPS_BINUTILS_PREFIX := mips-linux-gnu- +else ifneq ($(call find-command,mips64-linux-gnu-ld),) + MIPS_BINUTILS_PREFIX := mips64-linux-gnu- +else ifneq ($(call find-command,mips-ld),) + MIPS_BINUTILS_PREFIX := mips- +else ifneq ($(call find-command,mips64-elf-ld),) + MIPS_BINUTILS_PREFIX := mips64-elf- +else + $(error Unable to detect a suitable MIPS toolchain installed) +endif + +# Verbose toggle +V := @ +ifeq (VERBOSE, 1) + V= +endif + +# Colors +NO_COL := \033[0m +GREEN := \033[0;32m +BLUE := \033[0;36m +YELLOW := \033[0;33m +BLINK := \033[32;5m + +PRINT := printf + +# Generic print function for make rules +define print + $(V)echo -e "$(GREEN)$(1) $(YELLOW)$(2)$(GREEN) -> $(BLUE)$(3)$(NO_COL)" +endef + +# Enable optimization flags to use GDB on Ares +ARES_GDB := 1 + +# Toggle release or debug mode. 1=Release, 0=Debug +# Note: currently only used for HackerOoT +RELEASE := 0 + +# Valid compression algorithms are 'yaz', 'lzo' and 'aplib' +COMPRESSION ?= yaz +COMPRESSION_TYPE ?= $(shell echo $(COMPRESSION) | tr '[:lower:]' '[:upper:]') + +# Platform compatibility flags +TARGET ?= + +ifeq ($(TARGET),wad) +CFLAGS := -DCONSOLE_WIIVC -fno-reorder-blocks -fno-optimize-sibling-calls +CPPFLAGS := -DCONSOLE_WIIVC +else ifeq ($(TARGET),iso) +CFLAGS := -DCONSOLE_GC -fno-reorder-blocks -fno-optimize-sibling-calls +CPPFLAGS := -DCONSOLE_GC +endif diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 14585d2a70..7659160564 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -1,13 +1,13 @@ { "configurations": [ { - "name": "N64 hackeroot-mq", - "compilerPath": "/usr/bin/gcc", // Needs to not be "" for -m32 to work + "name": "hackeroot-mq", + "compilerPath": "/usr/bin/gcc", "compilerArgs": [ - "-m32" // Removes integer truncation warnings with gbi macros + "-m32" ], - "intelliSenseMode": "gcc-x86", // Shouldn't matter - "includePath": [ // Matches makefile's includes + "intelliSenseMode": "gcc-x86", + "includePath": [ "include", "include/libc", "src", @@ -16,16 +16,144 @@ "extracted/hackeroot-mq" ], "defines": [ - "_LANGUAGE_C", // For gbi.h - "OOT_DEBUG=1", // If targeting a debug version + "_LANGUAGE_C", "ENABLE_HACKEROOT=1", "RELEASE_ROM=0", "COMPRESS_YAZ=1", - "OOT_PAL=1" + "OOT_VERSION=OOT_GC_EU_MQ_DBG", + "OOT_REGION=REGION_EU", + "OOT_PAL=1", + "OOT_MQ=1", + "OOT_DEBUG=1", + "F3DEX_GBI_2", + "F3DEX_GBI_PL", + "GBI_DOWHILE", + "GBI_DEBUG" ], - "cStandard": "gnu11", - "cppStandard": "${default}" // Only ZAPD uses C++, so doesn't really matter + "cStandard": "gnu89", + "cppStandard": "${default}" + }, + { + "name": "oot-gc-us", + "compilerArgs": [ + "-m32" + ], + "includePath": [ + "include", + "include/libc", + "src", + "build/gc-us", + ".", + "extracted/gc-us" + ], + "defines": [ + "_LANGUAGE_C", + "ENABLE_HACKEROOT=0", + "RELEASE_ROM=0", + "COMPRESS_YAZ=1", + "OOT_VERSION=OOT_GC_US", + "OOT_REGION=REGION_US", + "OOT_NTSC=1", + "OOT_MQ=0", + "OOT_DEBUG=0", + "NDEBUG", + "F3DEX_GBI_2", + "F3DEX_GBI_PL", + "GBI_DOWHILE" + ], + "cStandard": "gnu89" + }, + { + "name": "oot-gc-eu", + "compilerArgs": [ + "-m32" + ], + "includePath": [ + "include", + "include/libc", + "src", + "build/gc-eu", + ".", + "extracted/gc-eu" + ], + "defines": [ + "_LANGUAGE_C", + "ENABLE_HACKEROOT=0", + "RELEASE_ROM=0", + "COMPRESS_YAZ=1", + "OOT_VERSION=OOT_GC_EU", + "OOT_REGION=REGION_EU", + "OOT_PAL=1", + "OOT_MQ=0", + "OOT_DEBUG=0", + "NDEBUG", + "F3DEX_GBI_2", + "F3DEX_GBI_PL", + "GBI_DOWHILE" + ], + "cStandard": "gnu89" + }, + { + "name": "oot-gc-eu-mq", + "compilerArgs": [ + "-m32" + ], + "includePath": [ + "include", + "include/libc", + "src", + "build/gc-eu-mq", + ".", + "extracted/gc-eu-mq" + ], + "defines": [ + "_LANGUAGE_C", + "ENABLE_HACKEROOT=0", + "RELEASE_ROM=0", + "COMPRESS_YAZ=1", + "OOT_VERSION=OOT_GC_EU_MQ", + "OOT_REGION=REGION_EU", + "OOT_PAL=1", + "OOT_MQ=1", + "OOT_DEBUG=0", + "NDEBUG", + "F3DEX_GBI_2", + "F3DEX_GBI_PL", + "GBI_DOWHILE" + ], + "cStandard": "gnu89" + }, + { + "name": "oot-gc-eu-mq-dbg", + "compilerArgs": [ + "-m32" + ], + "includePath": [ + "include", + "include/libc", + "src", + "build/gc-eu-mq-dbg", + ".", + "extracted/gc-eu-mq-dbg" + ], + "defines": [ + "_LANGUAGE_C", + "ENABLE_HACKEROOT=0", + "RELEASE_ROM=0", + "COMPRESS_YAZ=1", + "OOT_VERSION=OOT_GC_EU_MQ_DBG", + "OOT_REGION=REGION_EU", + "OOT_PAL=1", + "OOT_MQ=1", + "OOT_DEBUG=1", + "F3DEX_GBI_2", + "F3DEX_GBI_PL", + "GBI_DOWHILE", + "GBI_DEBUG" + ], + "cStandard": "gnu89" } ], "version": 4 } + diff --git a/INSTALLATION.md b/INSTALLATION.md index e415cd31c3..2ed24c9d49 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -37,12 +37,13 @@ The build process has the following package requirements: * python3-venv * libpng-dev * gcc-mips-linux-gnu +* libxml2-dev Under Debian / Ubuntu (which we recommend using), you can install them with the following commands: ```bash sudo apt-get update -sudo apt-get install git build-essential binutils-mips-linux-gnu python3 python3-pip python3-venv libpng-dev gcc-mips-linux-gnu +sudo apt-get install git build-essential binutils-mips-linux-gnu python3 python3-pip python3-venv libpng-dev gcc-mips-linux-gnu libxml2-dev ``` #### 2. Clone the repository diff --git a/Jenkinsfile b/Jenkinsfile index f05c0808c2..38de3fab9e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,82 +20,102 @@ pipeline { } } steps { - echo 'Checking formatting on modified files...' - sh 'python3 tools/check_format.py --verbose --compare-to origin/main' + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + echo 'Checking formatting on modified files...' + sh 'python3 tools/check_format.py --verbose --compare-to origin/main' + } } } - stage('Setup gc-eu-mq-dbg') { + // The ROMs are built in an order that maximizes compiler flags coverage in a "fail fast" approach. + // Specifically we start with a retail ROM for BSS ordering, and make sure we cover all of + // N64/GC/NTSC/PAL/MQ/DEBUG as quickly as possible. + stage('Build ntsc-1.2') { steps { - sh 'cp /usr/local/etc/roms/oot-gc-eu-mq-dbg.z64 baseroms/gc-eu-mq-dbg/baserom.z64' - sh 'make -j setup' - } + script { + build('ntsc-1.2', 'oot-ntsc-1.2-us.z64') + } + } } - stage('Build gc-eu-mq-dbg (qemu-irix)') { - when { - branch 'main' - } + stage('Build gc-jp') { steps { - sh 'make -j ORIG_COMPILER=1' + script { + build('gc-jp', 'oot-gc-jp.z64') + } + } + } + stage('Build gc-eu-mq') { + steps { + script { + build('gc-eu-mq', 'oot-gc-eu-mq.z64') + } } } stage('Build gc-eu-mq-dbg') { - when { - not { - branch 'main' + steps { + script { + build('gc-eu-mq-dbg', 'oot-gc-eu-mq-dbg.z64') } } + } + stage('Build pal-1.0') { steps { - sh 'make -j RUN_CC_CHECK=0' - } + script { + build('pal-1.0', 'oot-pal-1.0.z64') + } + } } - stage('Setup gc-eu-mq') { + stage('Build gc-us') { steps { - sh 'cp /usr/local/etc/roms/oot-gc-eu-mq.z64 baseroms/gc-eu-mq/baserom.z64' - sh 'make -j setup VERSION=gc-eu-mq' + script { + build('gc-us', 'oot-gc-us.z64') + } } } - stage('Build gc-eu-mq (qemu-irix)') { - when { - branch 'main' - } + stage('Build gc-jp-ce') { steps { - sh 'make -j VERSION=gc-eu-mq ORIG_COMPILER=1' + script { + build('gc-jp-ce', 'oot-gc-jp-ce.z64') + } } } - stage('Build gc-eu-mq') { - when { - not { - branch 'main' + stage('Build gc-eu') { + steps { + script { + build('gc-eu', 'oot-gc-eu.z64') } } + } + stage('Build gc-jp-mq') { steps { - sh 'make -j VERSION=gc-eu-mq RUN_CC_CHECK=0' + script { + build('gc-jp-mq', 'oot-gc-jp-mq.z64') + } } } - stage('Report Progress') { - when { - branch 'main' - } + stage('Build pal-1.1') { steps { - sh 'mkdir reports' - sh 'python3 progress.py csv >> reports/progress-oot-nonmatching.csv' - sh 'python3 progress.py csv -m >> reports/progress-oot-matching.csv' - sh 'python3 progress.py shield-json > reports/progress-oot-shield.json' - stash includes: 'reports/*', name: 'reports' + script { + build('pal-1.1', 'oot-pal-1.1.z64') + } + } + } + stage('Build gc-us-mq') { + steps { + script { + build('gc-us-mq', 'oot-gc-us-mq.z64') + } } } - stage('Update Progress') { + stage('Generate patch') { when { - branch 'main' - } - agent { - label 'zeldaret_website' + not { + branch 'main' + } } steps { - unstash 'reports' - sh 'cat reports/progress-oot-nonmatching.csv >> /var/www/zelda64.dev/assets/csv/progress-oot-nonmatching.csv' - sh 'cat reports/progress-oot-matching.csv >> /var/www/zelda64.dev/assets/csv/progress-oot-matching.csv' - sh 'cat reports/progress-oot-shield.json > /var/www/zelda64.dev/assets/csv/progress-oot-shield.json' + sh 'git diff' + echo 'Generating patch...' + sh 'tools/generate_patch_from_jenkins.sh' } } } @@ -113,3 +133,20 @@ pipeline { } } } + +def build(String version, String rom) { + sh "ln -s /usr/local/etc/roms/${rom} baseroms/${version}/baserom.z64" + sh "make -j\$(nproc) setup VERSION=${version}" + try { + sh "make -j\$(nproc) VERSION=${version}" + } catch (e) { + echo "Build failed, attempting to fix BSS ordering..." + sh ".venv/bin/python3 tools/fix_bss.py -v ${version}" + // If fix_bss.py succeeds, continue the build, but ensure both the build and current stage are marked as failed + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + sh 'exit 1' + } + } finally { + sh "make clean assetclean VERSION=${version}" + } +} diff --git a/Makefile b/Makefile index 879272cf69..44ed14fa13 100644 --- a/Makefile +++ b/Makefile @@ -4,110 +4,142 @@ MAKEFLAGS += --no-builtin-rules --no-print-directory SHELL = /bin/bash .SHELLFLAGS = -o pipefail -c -# Build options can either be changed by modifying the makefile, or by building with 'make SETTING=value' +#### Build options #### -# currently, GCC is the only supported compiler -COMPILER := gcc +# Build options can be changed by modifying them below, or by appending 'SETTING=value' to all 'make' commands +# (e.g. 'make setup VERSION=ntsc-1.0' and 'make VERSION=ntsc-1.0' to build the NTSC 1.0 version). +# Alternatively, you can create a file called .make_options.mk (gitignored by default) and add 'SETTING=value' +# there to avoid modifying the Makefile directly. -# Target game version. Currently only the following version is supported: +-include .make_options.mk + +# HackerOoT options +-include .make_hackeroot.mk + +COMPILER ?= gcc + +# Target game version. Ensure the corresponding input ROM is placed in baseroms/$(VERSION)/baserom.z64. +# Currently the following versions are supported: +# pal-1.0 N64 PAL 1.0 (Europe) +# ntsc-1.2 N64 NTSC 1.2 (Japan/US depending on REGION) +# pal-1.1 N64 PAL 1.1 (Europe) +# gc-jp GameCube Japan +# gc-jp-mq GameCube Japan Master Quest +# gc-us GameCube US +# gc-us-mq GameCube US Master Quest +# gc-eu-mq-dbg GameCube Europe/PAL Master Quest Debug (default) # gc-eu GameCube Europe/PAL # gc-eu-mq GameCube Europe/PAL Master Quest -# gc-eu-mq-dbg GameCube Europe/PAL Master Quest Debug +# gc-jp-ce GameCube Japan (Collector's Edition disc) # hackeroot-mq HackerOoT, based on gc-eu-mq-dbg (default) -# # The following versions are work-in-progress and not yet matching: -# gc-us GameCube US +# ntsc-1.0 N64 NTSC 1.0 (Japan/US depending on REGION) +# ntsc-1.1 N64 NTSC 1.1 (Japan/US depending on REGION) # # Note: choosing hackeroot-mq will enable HackerOoT features, # if another version is chosen, this repo will be like # zeldaret/main decomp but without the disassembly, decompilation # and matching tools, including the IDO compiler -VERSION := hackeroot-mq - -# Enable optimization flags to use GDB on Ares -ARES_GDB := 1 - -# Toggle release or debug mode. 1=Release, 0=Debug -# Note: currently only used for HackerOoT -RELEASE ?= 0 - -# Valid compression algorithms are 'yaz', 'lzo' and 'aplib' -COMPRESSION ?= yaz -COMPRESSION_TYPE ?= $(shell echo $(COMPRESSION) | tr '[:lower:]' '[:upper:]') - -# Number of threads to extract and compress with -N_THREADS := $(shell nproc) -# Check code syntax with host compiler -RUN_CC_CHECK := 1 +VERSION ?= hackeroot-mq +# Number of threads to extract and compress with. +N_THREADS ?= $(shell nproc) +# Check code syntax with host compiler. +RUN_CC_CHECK ?= 1 +# 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 indicates missing dependencies. +MIPS_BINUTILS_PREFIX ?= mips-linux-gnu- +# Emulator w/ flags for 'make run'. +N64_EMULATOR ?= +# Set to override game region in the ROM header (options: JP, US, EU). This can be used to build a fake US version +# of the debug ROM for better emulator compatibility, or to build US versions of NTSC N64 ROMs. +# REGION ?= US CFLAGS ?= CPPFLAGS ?= CFLAGS_IDO ?= CPP_DEFINES ?= -TARGET ?= - -ifeq ($(TARGET),wad) -CFLAGS := -DCONSOLE_WIIVC -fno-reorder-blocks -fno-optimize-sibling-calls -CPPFLAGS := -DCONSOLE_WIIVC -else ifeq ($(TARGET),iso) -CFLAGS := -DCONSOLE_GC -fno-reorder-blocks -fno-optimize-sibling-calls -CPPFLAGS := -DCONSOLE_GC -endif - -ifeq ($(COMPILER),gcc) - CPP_DEFINES += -DCOMPILER_GCC -DNON_MATCHING -DAVOID_UB -std=gnu11 -else - $(error Unsupported compiler. Please use gcc as the COMPILER variable.) -endif - -# 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 - -# Returns the path to the command $(1) if exists. Otherwise returns an empty string. -find-command = $(shell which $(1) 2>/dev/null) - -ifneq ($(call find-command,mips-n64-ld),) - MIPS_BINUTILS_PREFIX := mips-n64- -else ifneq ($(call find-command,mips64-ld),) - MIPS_BINUTILS_PREFIX := mips64- -else ifneq ($(call find-command,mips-linux-gnu-ld),) - MIPS_BINUTILS_PREFIX := mips-linux-gnu- -else ifneq ($(call find-command,mips64-linux-gnu-ld),) - MIPS_BINUTILS_PREFIX := mips64-linux-gnu- -else ifneq ($(call find-command,mips-ld),) - MIPS_BINUTILS_PREFIX := mips- -else ifneq ($(call find-command,mips64-elf-ld),) - MIPS_BINUTILS_PREFIX := mips64-elf- -else - $(error Unable to detect a suitable MIPS toolchain installed) -endif - # Version-specific settings -ifeq ($(VERSION),gc-us) +REGIONAL_CHECKSUM := 0 +ifeq ($(VERSION),ntsc-1.0) + REGIONAL_CHECKSUM := 1 + REGION ?= JP + PLATFORM := N64 DEBUG := 0 COMPARE := 0 - CPP_DEFINES += -DOOT_NTSC=1 -DOOT_PAL=0 -DOOT_MQ=0 -else ifeq ($(VERSION),gc-eu) +else ifeq ($(VERSION),ntsc-1.1) + REGIONAL_CHECKSUM := 1 + REGION ?= JP + PLATFORM := N64 DEBUG := 0 - CPP_DEFINES += -DOOT_NTSC=0 -DOOT_PAL=1 -DOOT_MQ=0 - HACKEROOT := 0 -else ifeq ($(VERSION),gc-eu-mq) + COMPARE := 0 +else ifeq ($(VERSION),pal-1.0) + REGION ?= EU + PLATFORM := N64 + DEBUG := 0 +else ifeq ($(VERSION),ntsc-1.2) + REGIONAL_CHECKSUM := 1 + REGION ?= JP + PLATFORM := N64 + DEBUG := 0 +else ifeq ($(VERSION),pal-1.1) + REGION ?= EU + PLATFORM := N64 + DEBUG := 0 +else ifeq ($(VERSION),gc-jp) + REGION ?= JP + PLATFORM := GC + DEBUG := 0 +else ifeq ($(VERSION),gc-jp-mq) + REGION ?= JP + PLATFORM := GC + DEBUG := 0 +else ifeq ($(VERSION),gc-us) + REGION ?= US + PLATFORM := GC + DEBUG := 0 +else ifeq ($(VERSION),gc-us-mq) + REGION ?= US + PLATFORM := GC DEBUG := 0 - CPP_DEFINES += -DOOT_NTSC=0 -DOOT_PAL=1 -DOOT_MQ=1 - HACKEROOT := 0 else ifeq ($(VERSION),gc-eu-mq-dbg) + REGION ?= EU + PLATFORM := GC DEBUG := 1 - CPP_DEFINES += -DOOT_NTSC=0 -DOOT_PAL=1 -DOOT_MQ=1 - HACKEROOT := 0 +else ifeq ($(VERSION),gc-eu) + REGION ?= EU + PLATFORM := GC + DEBUG := 0 +else ifeq ($(VERSION),gc-eu-mq) + REGION ?= EU + PLATFORM := GC + DEBUG := 0 +else ifeq ($(VERSION),gc-jp-ce) + REGION ?= JP + PLATFORM := GC + DEBUG := 0 else ifeq ($(VERSION),hackeroot-mq) + REGION := NULL + PLATFORM := GC + PAL := 1 + MQ := 1 DEBUG := 1 - CPP_DEFINES += -DOOT_NTSC=0 -DOOT_PAL=1 -DOOT_MQ=1 - HACKEROOT := 1 else $(error Unsupported version $(VERSION)) endif +ifeq ($(VERSION),hackeroot-mq) + HACKEROOT := 1 +else + HACKEROOT := 0 +endif + +ifeq ($(COMPILER),gcc) + CPP_DEFINES += -DCOMPILER_GCC -DNON_MATCHING -DAVOID_UB -std=gnu11 +else + $(error Unsupported compiler. Please use gcc as the COMPILER variable.) +endif + PROJECT_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) BUILD_DIR := build/$(VERSION) EXPECTED_DIR := expected/$(BUILD_DIR) @@ -126,6 +158,23 @@ ifeq ($(origin PACKAGE_VERSION), undefined) endif endif +# Converts e.g. ntsc-1.0 to NTSC_1_0 +ifeq ($(VERSION),hackeroot-mq) +CPP_DEFINES += -DOOT_VERSION=GC_EU_MQ_DBG +else +VERSION_MACRO := $(shell echo $(VERSION) | tr a-z-. A-Z__) +CPP_DEFINES += -DOOT_VERSION=$(VERSION_MACRO) +endif +CPP_DEFINES += -DOOT_REGION=REGION_$(REGION) + +ifeq ($(PLATFORM),N64) + CPP_DEFINES += -DPLATFORM_N64=1 -DPLATFORM_GC=0 +else ifeq ($(PLATFORM),GC) + CPP_DEFINES += -DPLATFORM_N64=0 -DPLATFORM_GC=1 +else + $(error Unsupported platform $(PLATFORM)) +endif + ifeq ($(VERSION),hackeroot-mq) CPP_DEFINES += -DENABLE_HACKEROOT=1 OPTFLAGS := -Os @@ -173,26 +222,6 @@ else endif endif -# Verbose toggle -V := @ -ifeq (VERBOSE, 1) - V= -endif - -# Colors -NO_COL := \033[0m -GREEN := \033[0;32m -BLUE := \033[0;36m -YELLOW := \033[0;33m -BLINK := \033[32;5m - -PRINT := printf - -# Generic print function for make rules -define print - $(V)echo -e "$(GREEN)$(1) $(YELLOW)$(2)$(GREEN) -> $(BLUE)$(3)$(NO_COL)" -endef - #### Tools #### ifneq ($(shell type $(MIPS_BINUTILS_PREFIX)ld >/dev/null 2>/dev/null; echo $$?), 0) $(error Unable to find $(MIPS_BINUTILS_PREFIX)ld. Please install or build MIPS binutils, commonly mips-linux-gnu. (or set MIPS_BINUTILS_PREFIX if your MIPS binutils install uses another prefix)) @@ -211,13 +240,11 @@ OBJCOPY := $(MIPS_BINUTILS_PREFIX)objcopy OBJDUMP := $(MIPS_BINUTILS_PREFIX)objdump NM := $(MIPS_BINUTILS_PREFIX)nm -N64_EMULATOR ?= - INC := -Iinclude -Iinclude/libc -Isrc -I$(BUILD_DIR) -I. -I$(EXTRACTED_DIR) # Check code syntax with host compiler CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces -CHECK_WARNINGS += -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Werror=int-conversion +CHECK_WARNINGS += -Werror=implicit-int -Werror=implicit-function-declaration -Werror=int-conversion -Werror=incompatible-pointer-types # The `cpp` command behaves differently on macOS (it behaves as if # `-traditional-cpp` was passed) so we use `gcc -E` instead. @@ -232,23 +259,39 @@ FLIPS := tools/Flips/flips GZINJECT := tools/gzinject/gzinject CC_IDO := tools/ido_recomp/linux/5.3/cc -# 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' +# Command to replace $(BUILD_DIR) in some files with the build path. +# We can't use the C preprocessor for this because it won't substitute inside string literals. +BUILD_DIR_REPLACE := sed -e 's|$$(BUILD_DIR)|$(BUILD_DIR)|g' + +# Audio tools +AUDIO_EXTRACT := $(PYTHON) tools/audio_extraction.py +SAMPLECONV := tools/audio/sampleconv/sampleconv +SBC := tools/audio/sbc +SFC := tools/audio/sfc +SFPATCH := tools/audio/sfpatch +ATBLGEN := tools/audio/atblgen +# We want linemarkers in sequence assembly files for better assembler error messages +SEQ_CPP := $(CPP) -x assembler-with-cpp -fno-dollars-in-identifiers +SEQ_CPPFLAGS := -D_LANGUAGE_ASEQ -DMML_VERSION=MML_VERSION_OOT $(CPP_DEFINES) -I include -I include/audio -I include/tables/sfx -I $(BUILD_DIR)/assets/audio/soundfonts + +SBCFLAGS := --matching +SFCFLAGS := --matching CFLAGS += $(CPP_DEFINES) CPPFLAGS += $(CPP_DEFINES) CFLAGS_IDO += $(CPP_DEFINES) -# TODO PL and DOWHILE should be disabled for non-gamecube -GBI_DEFINES := -DF3DEX_GBI_2 -DF3DEX_GBI_PL -DGBI_DOWHILE +GBI_DEFINES := -DF3DEX_GBI_2 +ifeq ($(PLATFORM),GC) + GBI_DEFINES += -DF3DEX_GBI_PL -DGBI_DOWHILE +endif ifeq ($(DEBUG),1) GBI_DEFINES += -DGBI_DEBUG endif CFLAGS += $(GBI_DEFINES) -ASFLAGS := -march=vr4300 -32 -no-pad-sections -Iinclude +ASFLAGS := -march=vr4300 -32 -no-pad-sections -Iinclude -I$(EXTRACTED_DIR) ifeq ($(COMPILER),gcc) CFLAGS += -G 0 -nostdinc $(INC) -march=vr4300 -mfix4300 -mabi=32 -mno-abicalls -mdivide-breaks -fno-PIC -fno-common -ffreestanding -fbuiltin -fno-builtin-sinf -fno-builtin-cosf $(CHECK_WARNINGS) -funsigned-char @@ -284,47 +327,140 @@ ifeq ($(COMPILER),gcc) SRC_DIRS := $(shell find src -type d) endif -# create extracted directories -$(shell mkdir -p $(EXTRACTED_DIR) $(EXTRACTED_DIR)/assets $(EXTRACTED_DIR)/text) +ifneq ($(wildcard $(EXTRACTED_DIR)/assets/audio),) + SAMPLE_EXTRACT_DIRS := $(shell find $(EXTRACTED_DIR)/assets/audio/samples -type d) + SAMPLEBANK_EXTRACT_DIRS := $(shell find $(EXTRACTED_DIR)/assets/audio/samplebanks -type d) + SOUNDFONT_EXTRACT_DIRS := $(shell find $(EXTRACTED_DIR)/assets/audio/soundfonts -type d) + SEQUENCE_EXTRACT_DIRS := $(shell find $(EXTRACTED_DIR)/assets/audio/sequences -type d) +else + SAMPLE_EXTRACT_DIRS := + SAMPLEBANK_EXTRACT_DIRS := + SOUNDFONT_EXTRACT_DIRS := + SEQUENCE_EXTRACT_DIRS := +endif + +ifneq ($(wildcard assets/audio/samples),) + SAMPLE_DIRS := $(shell find assets/audio/samples -type d) +else + SAMPLE_DIRS := +endif -# create extracted directories -$(shell mkdir -p $(EXTRACTED_DIR) $(EXTRACTED_DIR)/assets $(EXTRACTED_DIR)/text) +ifneq ($(wildcard assets/audio/samplebanks),) + SAMPLEBANK_DIRS := $(shell find assets/audio/samplebanks -type d) +else + SAMPLEBANK_DIRS := +endif -ASSET_BIN_DIRS := $(shell find $(EXTRACTED_DIR)/assets -type d) -ASSET_FILES_BIN := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.bin)) -ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_BIN:.bin=.bin.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \ - $(foreach f,$(wildcard assets/text/*.c),$(BUILD_DIR)/$(f:.c=.o)) +ifneq ($(wildcard assets/audio/soundfonts),) + SOUNDFONT_DIRS := $(shell find assets/audio/soundfonts -type d) +else + SOUNDFONT_DIRS := +endif + +ifneq ($(wildcard assets/audio/sequences),) + SEQUENCE_DIRS := $(shell find assets/audio/sequences -type d) +else + SEQUENCE_DIRS := +endif + +SAMPLE_FILES := $(foreach dir,$(SAMPLE_DIRS),$(wildcard $(dir)/*.wav)) +SAMPLE_EXTRACT_FILES := $(foreach dir,$(SAMPLE_EXTRACT_DIRS),$(wildcard $(dir)/*.wav)) +AIFC_FILES := $(foreach f,$(SAMPLE_FILES),$(BUILD_DIR)/$(f:.wav=.aifc)) $(foreach f,$(SAMPLE_EXTRACT_FILES:.wav=.aifc),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) + +SAMPLEBANK_XMLS := $(foreach dir,$(SAMPLEBANK_DIRS),$(wildcard $(dir)/*.xml)) +SAMPLEBANK_EXTRACT_XMLS := $(foreach dir,$(SAMPLEBANK_EXTRACT_DIRS),$(wildcard $(dir)/*.xml)) +SAMPLEBANK_BUILD_XMLS := $(foreach f,$(SAMPLEBANK_XMLS),$(BUILD_DIR)/$f) $(foreach f,$(SAMPLEBANK_EXTRACT_XMLS),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) +SAMPLEBANK_O_FILES := $(foreach f,$(SAMPLEBANK_BUILD_XMLS),$(f:.xml=.o)) +SAMPLEBANK_DEP_FILES := $(foreach f,$(SAMPLEBANK_O_FILES),$(f:.o=.d)) + +SOUNDFONT_XMLS := $(foreach dir,$(SOUNDFONT_DIRS),$(wildcard $(dir)/*.xml)) +SOUNDFONT_EXTRACT_XMLS := $(foreach dir,$(SOUNDFONT_EXTRACT_DIRS),$(wildcard $(dir)/*.xml)) +SOUNDFONT_BUILD_XMLS := $(foreach f,$(SOUNDFONT_XMLS),$(BUILD_DIR)/$f) $(foreach f,$(SOUNDFONT_EXTRACT_XMLS),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) +SOUNDFONT_O_FILES := $(foreach f,$(SOUNDFONT_BUILD_XMLS),$(f:.xml=.o)) +SOUNDFONT_HEADERS := $(foreach f,$(SOUNDFONT_BUILD_XMLS),$(f:.xml=.h)) +SOUNDFONT_DEP_FILES := $(foreach f,$(SOUNDFONT_O_FILES),$(f:.o=.d)) + +SEQUENCE_FILES := $(foreach dir,$(SEQUENCE_DIRS),$(wildcard $(dir)/*.seq)) +SEQUENCE_EXTRACT_FILES := $(foreach dir,$(SEQUENCE_EXTRACT_DIRS),$(wildcard $(dir)/*.seq)) +SEQUENCE_O_FILES := $(foreach f,$(SEQUENCE_FILES),$(BUILD_DIR)/$(f:.seq=.o)) $(foreach f,$(SEQUENCE_EXTRACT_FILES:.seq=.o),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) +SEQUENCE_DEP_FILES := $(foreach f,$(SEQUENCE_O_FILES),$(f:.o=.d)) + +SEQUENCE_TABLE := include/tables/sequence_table.h + +# create extracted directory +$(shell mkdir -p $(EXTRACTED_DIR)) + +ifneq ($(wildcard $(EXTRACTED_DIR)/assets),) + ASSET_BIN_DIRS_EXTRACTED := $(shell find $(EXTRACTED_DIR)/assets -type d) +else + ASSET_BIN_DIRS_EXTRACTED := +endif +ASSET_BIN_DIRS_COMMITTED := $(shell find assets -type d -not -path "assets/xml*" -not -path "assets/audio*" -not -path assets/text) +ASSET_BIN_DIRS := $(ASSET_BIN_DIRS_EXTRACTED) $(ASSET_BIN_DIRS_COMMITTED) + +ASSET_FILES_BIN_EXTRACTED := $(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.bin)) +ASSET_FILES_BIN_COMMITTED := $(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.bin)) +ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_BIN_EXTRACTED:.bin=.bin.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \ + $(foreach f,$(ASSET_FILES_BIN_COMMITTED:.bin=.bin.inc.c),$(BUILD_DIR)/$f) \ + $(foreach f,$(wildcard assets/text/*.c),$(BUILD_DIR)/$(f:.c=.o)) UNDECOMPILED_DATA_DIRS := $(shell find data -type d) BASEROM_BIN_FILES := $(wildcard $(EXTRACTED_DIR)/baserom/*) # source files +ASSET_C_FILES_EXTRACTED := $(filter-out %.inc.c,$(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.c))) +ASSET_C_FILES_COMMITTED := $(filter-out %.inc.c,$(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.c))) SRC_C_FILES := $(filter-out %.inc.c,$(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c))) -ASSET_C_FILES := $(filter-out %.inc.c,$(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.c))) S_FILES := $(foreach dir,$(SRC_DIRS) $(UNDECOMPILED_DATA_DIRS),$(wildcard $(dir)/*.s)) O_FILES := $(foreach f,$(S_FILES:.s=.o),$(BUILD_DIR)/$f) \ $(foreach f,$(SRC_C_FILES:.c=.o),$(BUILD_DIR)/$f) \ - $(foreach f,$(ASSET_C_FILES:.c=.o),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \ - $(foreach f,$(BASEROM_BIN_FILES),$(BUILD_DIR)/baserom/$(notdir $f).o) + $(foreach f,$(ASSET_C_FILES_EXTRACTED:.c=.o),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \ + $(foreach f,$(ASSET_C_FILES_COMMITTED:.c=.o),$(BUILD_DIR)/$f) \ + $(foreach f,$(BASEROM_BIN_FILES),$(BUILD_DIR)/baserom/$(notdir $f).o) \ + $(BUILD_DIR)/src/code/z_message_z_game_over.o + UCODE_PATCHES := $(wildcard F3DEX3/*.bps) UCODE_FILES := $(foreach f,$(UCODE_PATCHES:.bps=),$f) UCODE_O_FILES := $(foreach f,$(UCODE_FILES),$(BUILD_DIR)/$f.o) -OVL_RELOC_FILES := $(shell $(CPP) $(CPPFLAGS) $(SPEC) | $(SPEC_REPLACE_VARS) | grep -o '[^"]*_reloc.o' ) +OVL_RELOC_FILES := $(shell $(CPP) $(CPPFLAGS) $(SPEC) | $(BUILD_DIR_REPLACE) | grep -o '[^"]*_reloc.o' ) # Automatic dependency files # (Only asm_processor dependencies and reloc dependencies are handled for now) DEP_FILES := $(O_FILES:.o=.asmproc.d) $(OVL_RELOC_FILES:.o=.d) -TEXTURE_FILES_PNG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.png)) -TEXTURE_FILES_JPG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.jpg)) -TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_PNG:.png=.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \ - $(foreach f,$(TEXTURE_FILES_JPG:.jpg=.jpg.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) +TEXTURE_FILES_PNG_EXTRACTED := $(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.png)) +TEXTURE_FILES_PNG_COMMITTED := $(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.png)) +TEXTURE_FILES_JPG_EXTRACTED := $(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.jpg)) +TEXTURE_FILES_JPG_COMMITTED := $(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.jpg)) +TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_PNG_EXTRACTED:.png=.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \ + $(foreach f,$(TEXTURE_FILES_PNG_COMMITTED:.png=.inc.c),$(BUILD_DIR)/$f) \ + $(foreach f,$(TEXTURE_FILES_JPG_EXTRACTED:.jpg=.jpg.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \ + $(foreach f,$(TEXTURE_FILES_JPG_COMMITTED:.jpg=.jpg.inc.c),$(BUILD_DIR)/$f) # create build directories -$(shell mkdir -p $(BUILD_DIR)/baserom $(BUILD_DIR)/assets/text $(foreach dir,$(SRC_DIRS) $(UNDECOMPILED_DATA_DIRS),$(BUILD_DIR)/$(dir)) $(foreach dir,$(ASSET_BIN_DIRS),$(dir:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%))) +$(shell mkdir -p $(BUILD_DIR)/baserom \ + $(BUILD_DIR)/assets/text) +$(shell mkdir -p $(foreach dir, \ + $(SRC_DIRS) \ + $(UNDECOMPILED_DATA_DIRS) \ + $(SAMPLE_DIRS) \ + $(SAMPLEBANK_DIRS) \ + $(SOUNDFONT_DIRS) \ + $(SEQUENCE_DIRS) \ + $(ASSET_BIN_DIRS_COMMITTED), \ + $(BUILD_DIR)/$(dir))) +ifneq ($(wildcard $(EXTRACTED_DIR)/assets),) +$(shell mkdir -p $(foreach dir, \ + $(SAMPLE_EXTRACT_DIRS) \ + $(SAMPLEBANK_EXTRACT_DIRS) \ + $(SOUNDFONT_EXTRACT_DIRS) \ + $(SEQUENCE_EXTRACT_DIRS) \ + $(ASSET_BIN_DIRS_EXTRACTED), \ + $(dir:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%))) +endif ifeq ($(COMPILER),gcc) # Note that if adding additional assets directories for modding reasons these flags must also be used there @@ -433,20 +569,22 @@ venv: $(V)$(PYTHON) -m pip install -U -r requirements.txt $(call print,Success!) +# TODO this is a temporary rule for testing audio, to be removed +setup-audio: + $(AUDIO_EXTRACT) -o $(EXTRACTED_DIR) -v $(VERSION) --read-xml + setup: venv $(call print,Setup in progress...) $(V)$(MAKE) -C tools $(call print,Tools: Done!) $(V)$(PYTHON) tools/decompress_baserom.py $(VERSION) $(call print,Decompressing baserom: Done!) - $(V)$(PYTHON) tools/extract_baserom.py $(BASEROM_DIR)/baserom-decompressed.z64 --oot-version $(VERSION) -o $(EXTRACTED_DIR)/baserom - $(V)$(PYTHON) tools/msgdis.py $(VERSION) - $(V)$(PYTHON) extract_assets.py -v $(VERSION) -j$(N_THREADS) + $(V)$(PYTHON) tools/extract_baserom.py $(BASEROM_DIR)/baserom-decompressed.z64 $(EXTRACTED_DIR)/baserom -v $(VERSION) + $(V)$(PYTHON) tools/extract_incbins.py $(EXTRACTED_DIR)/baserom $(EXTRACTED_DIR)/incbin -v $(VERSION) + $(V)$(PYTHON) tools/msgdis.py $(EXTRACTED_DIR)/baserom $(EXTRACTED_DIR)/text -v $(VERSION) + $(V)$(PYTHON) extract_assets.py $(EXTRACTED_DIR)/baserom $(EXTRACTED_DIR)/assets -v $(VERSION) -j$(N_THREADS) + $(V)$(AUDIO_EXTRACT) -o $(EXTRACTED_DIR) -v $(VERSION) --read-xml $(call print,Extracting files: Done!) -ifeq ($(VERSION),hackeroot-mq) -# TODO: proper fix (for .s files) - cp baseroms/hackeroot-mq/baserom-decompressed.z64 baseroms/gc-eu-mq-dbg/baserom-decompressed.z64 -endif run: rom ifeq ($(N64_EMULATOR),) @@ -505,7 +643,9 @@ else endif $(V)$(PYTHON) -m ipl3checksum sum --cic 6105 --update $@ -$(ELF): $(TEXTURE_FILES_OUT) $(ASSET_FILES_OUT) $(O_FILES) $(OVL_RELOC_FILES) $(UCODE_O_FILES) $(LDSCRIPT) $(BUILD_DIR)/undefined_syms.txt +$(ELF): $(TEXTURE_FILES_OUT) $(ASSET_FILES_OUT) $(O_FILES) $(OVL_RELOC_FILES) $(UCODE_O_FILES) $(LDSCRIPT) $(BUILD_DIR)/undefined_syms.txt \ + $(SAMPLEBANK_O_FILES) $(SOUNDFONT_O_FILES) $(SEQUENCE_O_FILES) \ + $(BUILD_DIR)/assets/audio/sequence_font_table.o $(BUILD_DIR)/assets/audio/audiobank_padding.o $(call print,Linking:,,$@) $(V)$(LD) -T $(LDSCRIPT) -T $(BUILD_DIR)/undefined_syms.txt --no-check-sections --accept-unknown-input-arch --emit-relocs -Map $(MAP) -o $@ @@ -523,7 +663,7 @@ $(O_FILES): | asset_files $(BUILD_DIR)/$(SPEC): $(SPEC) $(call print,Preprocessing:,$<,$@) - $(V)$(CPP) $(CPPFLAGS) $< | $(SPEC_REPLACE_VARS) > $@ + $(V)$(CPP) $(CPPFLAGS) $< | $(BUILD_DIR_REPLACE) > $@ $(LDSCRIPT): $(BUILD_DIR)/$(SPEC) $(call print,Creating linker script:,$<,$@) @@ -544,7 +684,7 @@ $(BUILD_DIR)/F3DEX3/%.o: F3DEX3/% $(BUILD_DIR)/data/%.o: data/%.s $(call print,Assembling:,$<,$@) - $(V)$(AS) $(ASFLAGS) $< -o $@ + $(V)$(CPP) $(CPPFLAGS) -Iinclude $< | $(AS) $(ASFLAGS) -o $@ $(BUILD_DIR)/assets/text/%.enc.jpn.h: assets/text/%.h $(EXTRACTED_DIR)/text/%.h assets/text/charmap.txt $(call print,Encoding:,$<,$@) @@ -566,7 +706,11 @@ $(BUILD_DIR)/src/code/z_message.o: assets/text/message_data.h assets/text/messag $(BUILD_DIR)/assets/text/%.o: assets/text/%.c $(call print,Compiling:,$<,$@) $(V)$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< - $(V)$(OBJCOPY) -O binary -j.rodata $@ $@.bin + $(V)$(OBJCOPY) -O binary --only-section .rodata $@ $@.bin + +$(BUILD_DIR)/assets/%.o: assets/%.c + $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< + $(OBJCOPY) -O binary $@ $@.bin $(BUILD_DIR)/assets/%.o: $(EXTRACTED_DIR)/assets/%.c $(call print,Compiling:,$<,$@) @@ -577,6 +721,10 @@ $(BUILD_DIR)/src/%.o: src/%.s $(call print,Compiling:,$<,$@) $(V)$(CPP) $(CPPFLAGS) -Iinclude $< | $(AS) $(ASFLAGS) -o $@ +# Incremental link to move z_message and z_game_over data into rodata +$(BUILD_DIR)/src/code/z_message_z_game_over.o: $(BUILD_DIR)/src/code/z_message.o $(BUILD_DIR)/src/code/z_game_over.o + $(LD) -r -T linker_scripts/data_with_rodata.ld -o $@ $^ + $(BUILD_DIR)/dmadata_table_spec.h $(BUILD_DIR)/compress_ranges.txt: $(BUILD_DIR)/$(SPEC) $(V)$(MKDMADATA) $< $(BUILD_DIR)/dmadata_table_spec.h $(BUILD_DIR)/compress_ranges.txt @@ -593,6 +741,8 @@ $(BUILD_DIR)/src/code/z_actor_dlftbls.o: include/tables/actor_table.h $(BUILD_DIR)/src/code/z_effect_soft_sprite_dlftbls.o: include/tables/effect_ss_table.h $(BUILD_DIR)/src/code/z_game_dlftbls.o: include/tables/gamestate_table.h $(BUILD_DIR)/src/code/z_scene_table.o: include/tables/scene_table.h include/tables/entrance_table.h +$(BUILD_DIR)/src/audio/general.o: $(SEQUENCE_TABLE) include/tables/sfx/*.h +$(BUILD_DIR)/src/audio/sfx_params.o: include/tables/sfx/*.h $(BUILD_DIR)/src/%.o: src/%.c ifneq ($(RUN_CC_CHECK),0) @@ -625,12 +775,21 @@ $(BUILD_DIR)/src/overlays/%_reloc.o: $(BUILD_DIR)/$(SPEC) $(V)$(FADO) $$(tools/reloc_prereq $< $(notdir $*)) -n $(notdir $*) -o $(@:.o=.s) -M $(@:.o=.d) $(V)$(AS) $(ASFLAGS) $(@:.o=.s) -o $@ +$(BUILD_DIR)/assets/%.inc.c: assets/%.png + $(ZAPD) btex -eh -tt $(subst .,,$(suffix $*)) -i $< -o $@ + $(BUILD_DIR)/assets/%.inc.c: $(EXTRACTED_DIR)/assets/%.png $(V)$(ZAPD) btex -eh -tt $(subst .,,$(suffix $*)) -i $< -o $@ +$(BUILD_DIR)/assets/%.bin.inc.c: assets/%.bin + $(ZAPD) bblb -eh -i $< -o $@ + $(BUILD_DIR)/assets/%.bin.inc.c: $(EXTRACTED_DIR)/assets/%.bin $(V)$(ZAPD) bblb -eh -i $< -o $@ +$(BUILD_DIR)/assets/%.jpg.inc.c: assets/%.jpg + $(ZAPD) bren -eh -i $< -o $@ + $(BUILD_DIR)/assets/%.jpg.inc.c: $(EXTRACTED_DIR)/assets/%.jpg $(V)$(ZAPD) bren -eh -i $< -o $@ @@ -648,6 +807,153 @@ F3DEX3/F3DEX3%.data: F3DEX3/F3DEX3%.data.bps F3DEX3/f3dzex2.data .PRECIOUS: $(UCODE_FILES) +# Audio + +AUDIO_BUILD_DEBUG ?= 0 +ifeq ($(AUDIO_BUILD_DEBUG),1) + # for debugging only, make soundfonts depend on samplebanks so they can be linked against + $(BUILD_DIR)/assets/audio/soundfonts/%.o: $(SAMPLEBANK_O_FILES) +endif + +# first build samples... + +.PRECIOUS: $(BUILD_DIR)/assets/audio/samples/%.aifc +.PRECIOUS: $(BUILD_DIR)/assets/audio/samples/%.half.aifc + +$(BUILD_DIR)/assets/audio/samples/%.half.aifc: assets/audio/samples/%.half.wav + $(call print,Building Sample:,$<,$@) + $(V)$(SAMPLECONV) vadpcm-half $< $@ + +$(BUILD_DIR)/assets/audio/samples/%.half.aifc: $(EXTRACTED_DIR)/assets/audio/samples/%.half.wav + $(call print,Building Sample:,$<,$@) + $(V)$(SAMPLECONV) vadpcm-half $< $@ +ifeq ($(AUDIO_BUILD_DEBUG),1) + @(cmp $( $@ + +$(BUILD_DIR)/assets/audio/samplebanks/%.xml: $(EXTRACTED_DIR)/assets/audio/samplebanks/%.xml + $(V)cat $< | $(BUILD_DIR_REPLACE) > $@ + +.PRECIOUS: $(BUILD_DIR)/assets/audio/samplebanks/%.s +$(BUILD_DIR)/assets/audio/samplebanks/%.s: $(BUILD_DIR)/assets/audio/samplebanks/%.xml | $(AIFC_FILES) + $(V)$(SBC) $(SBCFLAGS) --makedepend $(@:.s=.d) $< $@ + +-include $(SAMPLEBANK_DEP_FILES) + +$(BUILD_DIR)/assets/audio/samplebanks/%.o: $(BUILD_DIR)/assets/audio/samplebanks/%.s + $(call print,Assembling Samplebank:,$<,$@) + $(V)$(AS) $(ASFLAGS) $< -o $@ +ifeq ($(AUDIO_BUILD_DEBUG),1) + $(OBJCOPY) -O binary --only-section .rodata $@ $(@:.o=.bin) + @cmp $(@:.o=.bin) $(patsubst $(BUILD_DIR)/assets/audio/samplebanks/%,$(EXTRACTED_DIR)/baserom_audiotest/audiotable_files/%,$(@:.o=.bin)) && echo "$( $@ + +$(BUILD_DIR)/assets/audio/soundfonts/%.xml: $(EXTRACTED_DIR)/assets/audio/soundfonts/%.xml + cat $< | $(BUILD_DIR_REPLACE) > $@ + +.PRECIOUS: $(BUILD_DIR)/assets/audio/soundfonts/%.c $(BUILD_DIR)/assets/audio/soundfonts/%.h $(BUILD_DIR)/assets/audio/soundfonts/%.name +$(BUILD_DIR)/assets/audio/soundfonts/%.c $(BUILD_DIR)/assets/audio/soundfonts/%.h $(BUILD_DIR)/assets/audio/soundfonts/%.name: $(BUILD_DIR)/assets/audio/soundfonts/%.xml | $(SAMPLEBANK_BUILD_XMLS) $(AIFC_FILES) +# This rule can be triggered for either the .c or .h file, so $@ may refer to either the .c or .h file. A simple +# substitution $(@:.c=.h) will fail ~50% of the time with -j. Instead, don't assume anything about the suffix of $@. + $(SFC) $(SFCFLAGS) --makedepend $(basename $@).d $< $(basename $@).c $(basename $@).h $(basename $@).name + +-include $(SOUNDFONT_DEP_FILES) + +$(BUILD_DIR)/assets/audio/soundfonts/%.o: $(BUILD_DIR)/assets/audio/soundfonts/%.c $(BUILD_DIR)/assets/audio/soundfonts/%.name +# compile c to unlinked object + $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -I include/audio -o $(@:.o=.tmp) $< +# partial link + $(LD) -r -T linker_scripts/soundfont.ld $(@:.o=.tmp) -o $(@:.o=.tmp2) +# patch defined symbols to be ABS symbols so that they remain file-relative offsets forever + $(SFPATCH) $(@:.o=.tmp2) $(@:.o=.tmp2) +# write start and size symbols afterwards, filename != symbolic name so source symbolic name from the .name file written by sfc + $(OBJCOPY) --add-symbol $$(cat $(<:.c=.name))_Start=.rodata:0,global --redefine-sym __LEN__=$$(cat $(<:.c=.name))_Size $(@:.o=.tmp2) $@ +# cleanup temp files + @$(RM) $(@:.o=.tmp) $(@:.o=.tmp2) +ifeq ($(AUDIO_BUILD_DEBUG),1) + $(LD) $(foreach f,$(SAMPLEBANK_O_FILES),-R $f) -T linker_scripts/soundfont.ld $@ -o $(@:.o=.elf) + $(OBJCOPY) -O binary -j.rodata $(@:.o=.elf) $(@:.o=.bin) + @(cmp $(@:.o=.bin) $(patsubst $(BUILD_DIR)/assets/audio/soundfonts/%,$(EXTRACTED_DIR)/baserom_audiotest/audiobank_files/%,$(@:.o=.bin)) && echo "$( rodata + +$(BUILD_DIR)/src/audio/tables/samplebank_table.o: src/audio/tables/samplebank_table.c $(BUILD_DIR)/assets/audio/samplebank_table.h +$(BUILD_DIR)/src/audio/tables/soundfont_table.o: src/audio/tables/soundfont_table.c $(BUILD_DIR)/assets/audio/soundfont_table.h $(SOUNDFONT_HEADERS) +$(BUILD_DIR)/src/audio/tables/sequence_table.o: src/audio/tables/sequence_table.c $(SEQUENCE_TABLE) + +$(BUILD_DIR)/src/audio/tables/sequence_table.o: CFLAGS += -I include/tables + +$(BUILD_DIR)/src/audio/tables/%.o: src/audio/tables/%.c +ifneq ($(RUN_CC_CHECK),0) + $(V)$(CC_CHECK) $< +endif + $(V)$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $(@:.o=.tmp) $< + $(V)$(LD) -r -T linker_scripts/data_with_rodata.ld $(@:.o=.tmp) -o $@ + @$(RM) $(@:.o=.tmp) + +$(BUILD_DIR)/assets/audio/sequence_font_table.o: $(BUILD_DIR)/assets/audio/sequence_font_table.s + $(AS) $(ASFLAGS) $< -o $@ + +# Extra audiobank padding that doesn't belong to any soundfont file +$(BUILD_DIR)/assets/audio/audiobank_padding.o: + echo ".section .rodata; .fill 0x20" | $(AS) $(ASFLAGS) -o $@ + -include $(DEP_FILES) # Print target for debugging diff --git a/README.md b/README.md index ffde853ccc..4767dff524 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,23 @@ This project, based on the [Zelda: Ocarina of Time decompilation project](https://github.com/zeldaret/oot/), aims to be an easy-to-use base to make Zelda: Ocarina of Time mods. **It is not producing a PC port.** -The only build currently supported is Master Quest (Debug), but other versions are planned to be supported. - -It builds the following ROM: - -* hackeroot-mq.z64 +It builds the following versions: + +| Name | Build timestamp | Description | MD5 hash of input ROM(s) | +|--------------|-------------------|-------------------------------------------|--------------------------| +| pal-1.0 | 98-11-10 14:34:22 | PAL 1.0 (Europe) | `e040de91a74b61e3201db0e2323f768a` | +| ntsc-1.2 | 98-11-12 18:17:03 | NTSC 1.2 (Japan/US) | `2258052847bdd056c8406a9ef6427f13`
`57a9719ad547c516342e1a15d5c28c3d` | +| pal-1.1 | 98-11-18 17:36:49 | PAL 1.1 (Europe) | `d714580dd74c2c033f5e1b6dc0aeac77` | +| gc-jp | 02-10-29 23:49:53 | GameCube Japan | `33fb7852c180b18ea0b9620b630f413f` | +| gc-jp-mq | 02-10-30 00:15:15 | GameCube Japan Master Quest | `69895c5c78442260f6eafb2506dc482a` | +| gc-us | 02-12-19 13:28:09 | GameCube US | `cd09029edcfb7c097ac01986a0f83d3f` | +| gc-us-mq | 02-12-19 14:05:42 | GameCube US Master Quest | `da35577fe54579f6a266931cc75f512d` | +| gc-eu-mq-dbg | 03-02-21 00:16:31 | GameCube Europe/PAL Master Quest Debug | `75e344f41c26ec2ec5ad92caa9e25629`
`8ca71e87de4ce5e9f6ec916202a623e9`
`f751d1a097764e2337b1ac9ba1e27699`
`dde376d47187b931820d5b2957cded14` | +| gc-eu | 03-02-21 20:12:23 | GameCube Europe/PAL | `2c27b4e000e85fd78dbca551f1b1c965` | +| gc-eu-mq | 03-02-21 20:37:19 | GameCube Europe/PAL Master Quest | `1618403427e4344a57833043db5ce3c3` | +| gc-jp-ce | 03-10-08 21:53:00 | GameCube Japan (Collector's Edition Disc) | `0c13e0449a28ea5b925cdb8af8d29768` | + +The default version is `hackeroot-mq`. This project is using the following tools: - [F3DEX3](https://github.com/HackerN64/F3DEX3), *will make you want to finally ditch HLE*, by Sauraen @@ -27,9 +39,7 @@ This project is using the following tools: ## Zelda: Ocarina of Time Decompilation -**Website:** - -**Discord:** +**Website:** ## Getting Started @@ -49,6 +59,11 @@ This project includes an example scene, available if ``INCLUDE_EXAMPLE_SCENE`` i This also includes an example cutscene, playable in the example scene when holding ``L`` + ``R`` and pressing ``A``. +## Changing build options + +The project Makefile is fairly configurable and can be used to build other versions of the game or prepare the repo for modding. +See the options outlined at the top of the Makefile for more information. + ## Contributing All contributions are welcome. This is a group effort, and even small contributions can make a difference. diff --git a/assets/audio/sequences/seq_0.prg.seq b/assets/audio/sequences/seq_0.prg.seq new file mode 100644 index 0000000000..e2e51f5b7e --- /dev/null +++ b/assets/audio/sequences/seq_0.prg.seq @@ -0,0 +1,15315 @@ +#include "aseq.h" +#include "Soundfont_1.h" +#include "Soundfont_0.h" +#include "versions.h" + +#define IO_PORT_SFX_INDEX_LOBITS IO_PORT_4 +#define IO_PORT_SFX_INDEX_HIBITS IO_PORT_5 + +// Provide the sfx ids for use as constants +#define DEFINE_SFX(channel, sfxId, importance, distParam, randParam, flags) \ + .internal sfxId; \ + .set sfxId, __SFX_ID_CTR; \ + .set __SFX_ID_CTR, __SFX_ID_CTR + 1 + +.set NA_SE_NONE, 0 +.internal NA_SE_NONE + +.set __SFX_ID_CTR, 0x0800 +#include "playerbank_table.h" +.set PLAYERBANK_TABLE_SIZE, __SFX_ID_CTR - 0x0800 +.set __SFX_ID_CTR, 0x1800 +#include "itembank_table.h" +.set ITEMBANK_TABLE_SIZE, __SFX_ID_CTR - 0x1800 +.set __SFX_ID_CTR, 0x2800 +#include "environmentbank_table.h" +.set ENVIRONMENTBANK_TABLE_SIZE, __SFX_ID_CTR - 0x2800 +.set __SFX_ID_CTR, 0x3800 +#include "enemybank_table.h" +.set ENEMYBANK_TABLE_SIZE, __SFX_ID_CTR - 0x3800 +.set __SFX_ID_CTR, 0x4800 +#include "systembank_table.h" +.set SYSTEMBANK_TABLE_SIZE, __SFX_ID_CTR - 0x4800 +.set __SFX_ID_CTR, 0x5800 +#include "ocarinabank_table.h" +.set OCARINABANK_TABLE_SIZE, __SFX_ID_CTR - 0x5800 +.set __SFX_ID_CTR, 0x6800 +#include "voicebank_table.h" +.set VOICEBANK_TABLE_SIZE, __SFX_ID_CTR - 0x6800 +.internal __SFX_ID_CTR + +#undef DEFINE_SFX + +.startseq Sequence_0 + +.sequence SEQ_0000 +/* 0x0000 [0xD3 0x60 ] */ mutebhv 0x60 +/* 0x0002 [0xD5 0x00 ] */ mutescale 0 +/* 0x0004 [0xDB 0x7F ] */ vol 127 +/* 0x0006 [0xDD 0x78 ] */ tempo 120 +/* 0x0008 [0xD7 0x0F 0xFF ] */ initchan 0b0000111111111111 +/* 0x000B [0x90 0x00 0x8E ] */ ldchan 0, playerbank_handler_1 +/* 0x000E [0x91 0x00 0x93 ] */ ldchan 1, playerbank_handler_2 +/* 0x0011 [0x92 0x00 0x98 ] */ ldchan 2, playerbank_handler_3 +/* 0x0014 [0x93 0x0E 0xA0 ] */ ldchan 3, itembank_handler_1 +/* 0x0017 [0x94 0x0E 0xA5 ] */ ldchan 4, itembank_handler_2 +/* 0x001A [0x95 0x16 0x80 ] */ ldchan 5, environmentbank_handler_1 +/* 0x001D [0x96 0x16 0x85 ] */ ldchan 6, environmentbank_handler_2 +/* 0x0020 [0x97 0x16 0x8A ] */ ldchan 7, environmentbank_handler_3 +/* 0x0023 [0x98 0x30 0xF0 ] */ ldchan 8, enemybank_handler_1 +/* 0x0026 [0x99 0x30 0xF5 ] */ ldchan 9, enemybank_handler_2 +/* 0x0029 [0x9A 0x30 0xFA ] */ ldchan 10, enemybank_handler_3 +/* 0x002C [0x9B 0x56 0xF0 ] */ ldchan 11, systembank_handler_1 +/* 0x002F [0x9C 0x56 0xF0 ] */ ldchan 12, systembank_handler_1 +/* 0x0032 [0x9D 0x5E 0x9D ] */ ldchan 13, ocarinabank_handler_1 +/* 0x0035 [0x9E 0x5F 0xA0 ] */ ldchan 14, voicebank_handler_1 +/* 0x0038 [0x9F 0x5F 0xA5 ] */ ldchan 15, voicebank_handler_2 +forever: +/* 0x003B [0xFD 0xFF 0xD0 ] */ delay 32720 +/* 0x003E [0xF4 0xFB ] */ rjump forever + +.channel CHAN_0040 +/* 0x0040 [0xC7 0x00 0x00 0x45 ] */ stseq 0, STSEQ_HERE + STSEQ_LOOP_COUNT +/* 0x0044 [0xF8 0x14 ] */ loop 20 +/* 0x0046 [0xF4 0x16 ] */ rjump CHAN_005E + +.channel CHAN_0048 +/* 0x0048 [0xC7 0x00 0x00 0x4D ] */ stseq 0, STSEQ_HERE + STSEQ_LOOP_COUNT +/* 0x004C [0xF8 0x14 ] */ loop 20 +/* 0x004E [0x63 ] */ ldio IO_PORT_3 +/* 0x004F [0xC7 0x00 0x00 0x54 ] */ stseq 0, STSEQ_HERE + STSEQ_FILTER_IDX +/* 0x0053 [0xB3 0x00 ] */ filter 0, 0 +/* 0x0055 [0x62 ] */ ldio IO_PORT_2 +/* 0x0056 [0xF2 0x06 ] */ rbltz CHAN_005E +/* 0x0058 [0xC7 0x00 0x00 0x5D ] */ stseq 0, STSEQ_HERE + STSEQ_VOL +/* 0x005C [0xDF 0x7F ] */ vol 127 +CHAN_005E: +/* 0x005E [0xFE ] */ delay1 +/* 0x005F [0x60 ] */ ldio IO_PORT_0 +/* 0x0060 [0x70 ] */ stio IO_PORT_0 +/* 0x0061 [0xC8 0xFF ] */ sub 255 +/* 0x0063 [0xF3 0x02 ] */ rbeqz CHAN_0067 +/* 0x0065 [0xF4 0x02 ] */ rjump CHAN_0069 + +CHAN_0067: +/* 0x0067 [0xF7 ] */ loopend +/* 0x0068 [0xFF ] */ end + +CHAN_0069: +/* 0x0069 [0x60 ] */ ldio IO_PORT_0 +/* 0x006A [0x70 ] */ stio IO_PORT_0 +/* 0x006B [0xF6 ] */ break +/* 0x006C [0xF6 ] */ break +/* 0x006D [0x90 ] */ dellayer 0 +/* 0x006E [0x91 ] */ dellayer 1 +/* 0x006F [0x92 ] */ dellayer 2 +/* 0x0070 [0x93 ] */ dellayer 3 +/* 0x0071 [0xFF ] */ end + +.channel CHAN_0072 +/* 0x0072 [0xC4 ] */ noshort +/* 0x0073 [0xCA 0x20 ] */ mutebhv 0x20 +/* 0x0075 [0xD0 0x80 ] */ effects TRUE, 0, 0, 0, 0, 0 +/* 0x0077 [0xE9 0x0E ] */ notepri 0, 14 +/* 0x0079 [0xE5 0x01 ] */ reverbidx 1 +/* 0x007B [0xFF ] */ end + +.channel CHAN_007C +/* 0x007C [0x90 ] */ dellayer 0 +/* 0x007D [0x91 ] */ dellayer 1 +/* 0x007E [0xCC 0x00 ] */ ldi 0 +/* 0x0080 [0xED 0x00 ] */ gain 0 +/* 0x0082 [0x71 ] */ stio IO_PORT_1 +/* 0x0083 [0xFF ] */ end + +.channel CHAN_0084 +/* 0x0084 [0x62 ] */ ldio IO_PORT_2 +/* 0x0085 [0xF2 0x06 ] */ rbltz CHAN_008D +/* 0x0087 [0xC7 0x00 0x00 0x8C ] */ stseq 0, STSEQ_HERE + STSEQ_VOL +/* 0x008B [0xDF 0x7F ] */ vol 127 +CHAN_008D: +/* 0x008D [0xFF ] */ end + +.channel playerbank_handler_1 +/* 0x008E [0xB0 0x0E 0x70 ] */ ldfilter FILTER_0E70 +/* 0x0091 [0xF4 0x08 ] */ rjump playerbank_handler_impl + +.channel playerbank_handler_2 +/* 0x0093 [0xB0 0x0E 0x80 ] */ ldfilter FILTER_0E80 +/* 0x0096 [0xF4 0x03 ] */ rjump playerbank_handler_impl + +.channel playerbank_handler_3 +/* 0x0098 [0xB0 0x0E 0x90 ] */ ldfilter FILTER_0E90 +playerbank_handler_impl: +/* 0x009B [0xFC 0x00 0x72 ] */ call CHAN_0072 +/* 0x009E [0xB3 0x00 ] */ filter 0, 0 +/* 0x00A0 [0xC6 0x00 ] */ font Soundfont_0_ID +/* 0x00A2 [0xDC 0x7F ] */ panweight 127 +CHAN_00A4: +/* 0x00A4 [0xFE ] */ delay1 +/* 0x00A5 [0x60 ] */ ldio IO_PORT_0 +/* 0x00A6 [0xC8 0x01 ] */ sub 1 +/* 0x00A8 [0xFA 0x00 0xAE ] */ beqz CHAN_00AE +/* 0x00AB [0xFB 0x00 0xA4 ] */ jump CHAN_00A4 + +CHAN_00AE: +/* 0x00AE [0xFC 0x00 0x7C ] */ call CHAN_007C +/* 0x00B1 [0x92 ] */ dellayer 2 +/* 0x00B2 [0xD8 0x00 ] */ vibdepth 0 +/* 0x00B4 [0x64 ] */ ldio IO_PORT_SFX_INDEX_LOBITS +/* 0x00B5 [0xF5 0x00 0xC0 ] */ bgez CHAN_00C0 +/* 0x00B8 [0xC9 0x7F ] */ and 127 +/* 0x00BA [0xC2 0x01 0xE1 ] */ dyntbl playerbank_table + 2 * 1 * 128 +/* 0x00BD [0xFB 0x00 0xC3 ] */ jump CHAN_00C3 + +CHAN_00C0: +/* 0x00C0 [0xC2 0x00 0xE1 ] */ dyntbl playerbank_table + 2 * 0 * 128 +CHAN_00C3: +/* 0x00C3 [0xE4 ] */ dyncall +CHAN_00C4: +/* 0x00C4 [0x63 ] */ ldio IO_PORT_3 +/* 0x00C5 [0xC7 0x00 0x00 0xCA ] */ stseq 0, STSEQ_HERE + STSEQ_FILTER_IDX +/* 0x00C9 [0xB3 0x0F ] */ filter 0, 15 +/* 0x00CB [0xFC 0x00 0x84 ] */ call CHAN_0084 +/* 0x00CE [0xFE ] */ delay1 +/* 0x00CF [0x60 ] */ ldio IO_PORT_0 +/* 0x00D0 [0xF3 0x0A ] */ rbeqz CHAN_00DC +/* 0x00D2 [0xF2 0x02 ] */ rbltz CHAN_00D6 +/* 0x00D4 [0xF4 0xD8 ] */ rjump CHAN_00AE + +CHAN_00D6: +/* 0x00D6 [0x80 ] */ testlayer 0 +/* 0x00D7 [0xF3 0xEB ] */ rbeqz CHAN_00C4 +/* 0x00D9 [0xCC 0xFF ] */ ldi 255 +/* 0x00DB [0x71 ] */ stio IO_PORT_1 +CHAN_00DC: +/* 0x00DC [0x90 ] */ dellayer 0 +/* 0x00DD [0x91 ] */ dellayer 1 +/* 0x00DE [0x92 ] */ dellayer 2 +/* 0x00DF [0xF4 0xC3 ] */ rjump CHAN_00A4 + +#define DEFINE_SFX(lblName, sfxId, priority, decay, rand, flags) \ + entry lblName + +.table_unaligned playerbank_table + #include "playerbank_table.h" + +#undef DEFINE_SFX + +.channel CHAN_02A1 +/* 0x02A1 [0x88 0x02 0xA7 ] */ ldlayer 0, LAYER_02A7 +/* 0x02A4 [0xFF ] */ end + +.layer LAYER_02A5 +/* 0x02A5 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_02A7 +/* 0x02A7 [0xC6 0x00 ] */ instr SF0_INST_0 +/* 0x02A9 [0x5F 0x15 0x38 ] */ notedv PITCH_E3, 21, 56 +/* 0x02AC [0xFF ] */ end + +.layer LAYER_02AD +/* 0x02AD [0xC2 0xFA ] */ transpose -6 +/* 0x02AF [0xC0 0x0D ] */ ldelay 13 +/* 0x02B1 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x02B3 [0x29 0x04 0x24 0x7F ] */ notedvg PITCH_D4, 4, 36, 127 +/* 0x02B7 [0xC6 0x17 ] */ instr SF0_INST_23 +/* 0x02B9 [0x62 0x04 0x38 ] */ notedv PITCH_G3, 4, 56 +/* 0x02BC [0xFF ] */ end + +.channel CHAN_02BD +/* 0x02BD [0x88 0x02 0xC3 ] */ ldlayer 0, LAYER_02C3 +/* 0x02C0 [0xFF ] */ end + +.layer LAYER_02C1 +/* 0x02C1 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_02C3 +/* 0x02C3 [0xC6 0x01 ] */ instr SF0_INST_1 +/* 0x02C5 [0x64 0x15 0x38 ] */ notedv PITCH_A3, 21, 56 +/* 0x02C8 [0xFF ] */ end + +.channel CHAN_02C9 +/* 0x02C9 [0xCC 0x14 ] */ ldi 20 +/* 0x02CB [0x71 ] */ stio IO_PORT_1 +/* 0x02CC [0x88 0x02 0xD2 ] */ ldlayer 0, LAYER_02D2 +/* 0x02CF [0xFF ] */ end + +.layer LAYER_02D0 +/* 0x02D0 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_02D2 +/* 0x02D2 [0xC6 0x02 ] */ instr SF0_INST_2 +/* 0x02D4 [0x61 0x15 0x5F ] */ notedv PITCH_GF3, 21, 95 +/* 0x02D7 [0xFF ] */ end + +.channel CHAN_02D8 +/* 0x02D8 [0x88 0x02 0xDE ] */ ldlayer 0, LAYER_02DE +/* 0x02DB [0xFF ] */ end + +.layer LAYER_02DC +/* 0x02DC [0xC2 0xFE ] */ transpose -2 +.layer LAYER_02DE +/* 0x02DE [0xC6 0x03 ] */ instr SF0_INST_3 +/* 0x02E0 [0xC7 0x82 0x1F 0xFF ] */ portamento 0x82, PITCH_E3, 255 +/* 0x02E4 [0x64 0x2D 0x5D ] */ notedv PITCH_A3, 45, 93 +/* 0x02E7 [0xFF ] */ end + +.channel CHAN_02E8 +/* 0x02E8 [0x88 0x02 0xEE ] */ ldlayer 0, LAYER_02EE +/* 0x02EB [0xFF ] */ end + +.layer LAYER_02EC +/* 0x02EC [0xC2 0xFE ] */ transpose -2 +.layer LAYER_02EE +/* 0x02EE [0xC6 0x04 ] */ instr SF0_INST_4 +/* 0x02F0 [0x64 0x1E 0x38 ] */ notedv PITCH_A3, 30, 56 +/* 0x02F3 [0xFF ] */ end + +.channel CHAN_02F4 +/* 0x02F4 [0x88 0x02 0xFA ] */ ldlayer 0, LAYER_02FA +/* 0x02F7 [0xFF ] */ end + +.layer LAYER_02F8 +/* 0x02F8 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_02FA +/* 0x02FA [0xC6 0x04 ] */ instr SF0_INST_4 +/* 0x02FC [0x60 0x1E 0x38 ] */ notedv PITCH_F3, 30, 56 +/* 0x02FF [0xFF ] */ end + +.channel CHAN_0300 +/* 0x0300 [0x88 0x03 0x06 ] */ ldlayer 0, LAYER_0306 +/* 0x0303 [0xFF ] */ end + +.layer LAYER_0304 +/* 0x0304 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0306 +/* 0x0306 [0xC6 0x05 ] */ instr SF0_INST_5 +/* 0x0308 [0x60 0x06 0x50 ] */ notedv PITCH_F3, 6, 80 +/* 0x030B [0xC6 0x07 ] */ instr SF0_INST_7 +/* 0x030D [0xCF 0xEB ] */ releaserate 235 +/* 0x030F [0x66 0x30 0x50 ] */ notedv PITCH_B3, 48, 80 +/* 0x0312 [0xFF ] */ end + +.channel CHAN_0313 +/* 0x0313 [0x88 0x03 0x19 ] */ ldlayer 0, LAYER_0319 +/* 0x0316 [0xFF ] */ end + +.layer LAYER_0317 +/* 0x0317 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0319 +/* 0x0319 [0xC6 0x00 ] */ instr SF0_INST_0 +/* 0x031B [0x5B 0x04 0x2A ] */ notedv PITCH_C3, 4, 42 +/* 0x031E [0xC6 0x04 ] */ instr SF0_INST_4 +/* 0x0320 [0x55 0x06 0x38 ] */ notedv PITCH_GF2, 6, 56 +/* 0x0323 [0xC6 0x23 ] */ instr SF0_INST_35 +/* 0x0325 [0xC7 0x81 0x2C 0xFF ] */ portamento 0x81, PITCH_F4, 255 +/* 0x0329 [0x60 0x16 0x40 ] */ notedv PITCH_F3, 22, 64 +/* 0x032C [0xFF ] */ end + +.channel CHAN_032D +/* 0x032D [0x88 0x03 0x33 ] */ ldlayer 0, LAYER_0333 +/* 0x0330 [0xFF ] */ end + +.layer LAYER_0331 +/* 0x0331 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0333 +/* 0x0333 [0xC6 0x05 ] */ instr SF0_INST_5 +/* 0x0335 [0xCB 0x66 0xB0 0xFA ] */ env ENVELOPE_66B0, 250 +/* 0x0339 [0x64 0x15 0x46 ] */ notedv PITCH_A3, 21, 70 +/* 0x033C [0xFF ] */ end + +.channel CHAN_033D +/* 0x033D [0x88 0x03 0x43 ] */ ldlayer 0, LAYER_0343 +/* 0x0340 [0xFF ] */ end + +.layer LAYER_0341 +/* 0x0341 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0343 +/* 0x0343 [0xC6 0x06 ] */ instr SF0_INST_6 +/* 0x0345 [0x6D 0x00 0x50 ] */ notedv PITCH_GF4, 0, 80 +/* 0x0348 [0xFF ] */ end + +.channel CHAN_0349 +/* 0x0349 [0x88 0x03 0x4F ] */ ldlayer 0, LAYER_034F +/* 0x034C [0xFF ] */ end + +.layer LAYER_034D +/* 0x034D [0xC2 0xFE ] */ transpose -2 +.layer LAYER_034F +/* 0x034F [0xC6 0x0B ] */ instr SF0_INST_11 +/* 0x0351 [0x63 0x14 0x56 ] */ notedv PITCH_AF3, 20, 86 +/* 0x0354 [0xFF ] */ end + +.channel CHAN_0355 +/* 0x0355 [0x88 0x03 0x5B ] */ ldlayer 0, LAYER_035B +/* 0x0358 [0xFF ] */ end + +.layer LAYER_0359 +/* 0x0359 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_035B +/* 0x035B [0xC6 0x16 ] */ instr SF0_INST_22 +/* 0x035D [0x5B 0x18 0x4C ] */ notedv PITCH_C3, 24, 76 +/* 0x0360 [0xFF ] */ end + +.channel CHAN_0361 +/* 0x0361 [0x88 0x03 0x6A ] */ ldlayer 0, LAYER_036A +/* 0x0364 [0x89 0x02 0xAD ] */ ldlayer 1, LAYER_02AD +/* 0x0367 [0xFF ] */ end + +.layer LAYER_0368 +/* 0x0368 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_036A +/* 0x036A [0xC6 0x01 ] */ instr SF0_INST_1 +/* 0x036C [0x1C 0x06 0x6E 0x7F ] */ notedvg PITCH_DF3, 6, 110, 127 +/* 0x0370 [0x47 0x0A 0x6E ] */ notedv PITCH_E1, 10, 110 +/* 0x0373 [0xC0 0x05 ] */ ldelay 5 +/* 0x0375 [0xFF ] */ end + +.channel CHAN_0376 +/* 0x0376 [0xC1 0x18 ] */ instr SF0_INST_24 +/* 0x0378 [0x88 0x03 0x7C ] */ ldlayer 0, LAYER_037C +/* 0x037B [0xFF ] */ end + +.layer LAYER_037C +/* 0x037C [0x5F 0x28 0x60 ] */ notedv PITCH_E3, 40, 96 +/* 0x037F [0xFF ] */ end + +.channel CHAN_0380 +/* 0x0380 [0x88 0x03 0x84 ] */ ldlayer 0, LAYER_0384 +/* 0x0383 [0xFF ] */ end + +.layer LAYER_0384 +/* 0x0384 [0xC6 0x01 ] */ instr SF0_INST_1 +/* 0x0386 [0x58 0x2A 0x38 ] */ notedv PITCH_A2, 42, 56 +/* 0x0389 [0xFF ] */ end + +.channel CHAN_038A +/* 0x038A [0x88 0x03 0x90 ] */ ldlayer 0, LAYER_0390 +/* 0x038D [0xFF ] */ end + +.layer LAYER_038E +/* 0x038E [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0390 +/* 0x0390 [0xC6 0x19 ] */ instr SF0_INST_25 +/* 0x0392 [0x64 0x15 0x55 ] */ notedv PITCH_A3, 21, 85 +/* 0x0395 [0xFF ] */ end + +.channel CHAN_0396 +/* 0x0396 [0xC1 0x00 ] */ instr SF0_INST_0 +/* 0x0398 [0x88 0x03 0xA1 ] */ ldlayer 0, LAYER_03A1 +/* 0x039B [0x89 0x03 0xAA ] */ ldlayer 1, LAYER_03AA +/* 0x039E [0xFF ] */ end + +.layer LAYER_039F +/* 0x039F [0xC2 0xFE ] */ transpose -2 +.layer LAYER_03A1 +/* 0x03A1 [0x5F 0x0A 0x3F ] */ notedv PITCH_E3, 10, 63 +/* 0x03A4 [0x67 0x0A 0x3F ] */ notedv PITCH_C4, 10, 63 +/* 0x03A7 [0xC0 0x07 ] */ ldelay 7 +/* 0x03A9 [0xFF ] */ end + +.layer LAYER_03AA +/* 0x03AA [0xC0 0x07 ] */ ldelay 7 +/* 0x03AC [0xC6 0x20 ] */ instr SF0_INST_32 +/* 0x03AE [0xCB 0x66 0x60 0xFA ] */ env ENVELOPE_6660, 250 +/* 0x03B2 [0x33 0x06 0x3C 0x7F ] */ notedvg PITCH_C5, 6, 60, 127 +/* 0x03B6 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x03B8 [0x2C 0x04 0x30 0x7F ] */ notedvg PITCH_F4, 4, 48, 127 +/* 0x03BC [0xC6 0x17 ] */ instr SF0_INST_23 +/* 0x03BE [0x60 0x05 0x37 ] */ notedv PITCH_F3, 5, 55 +/* 0x03C1 [0x66 0x05 0x37 ] */ notedv PITCH_B3, 5, 55 +/* 0x03C4 [0xFF ] */ end + +.channel CHAN_03C5 +/* 0x03C5 [0x88 0x03 0xCE ] */ ldlayer 0, LAYER_03CE +/* 0x03C8 [0x89 0x03 0xAA ] */ ldlayer 1, LAYER_03AA +/* 0x03CB [0xFF ] */ end + +.layer LAYER_03CC +/* 0x03CC [0xC2 0xFE ] */ transpose -2 +.layer LAYER_03CE +/* 0x03CE [0xC6 0x01 ] */ instr SF0_INST_1 +/* 0x03D0 [0x64 0x0A 0x3F ] */ notedv PITCH_A3, 10, 63 +/* 0x03D3 [0x6C 0x0A 0x3F ] */ notedv PITCH_F4, 10, 63 +/* 0x03D6 [0xC0 0x07 ] */ ldelay 7 +/* 0x03D8 [0xFF ] */ end + +.channel CHAN_03D9 +/* 0x03D9 [0xCC 0x14 ] */ ldi 20 +/* 0x03DB [0x71 ] */ stio IO_PORT_1 +/* 0x03DC [0x88 0x03 0xE5 ] */ ldlayer 0, LAYER_03E5 +/* 0x03DF [0x89 0x03 0xAA ] */ ldlayer 1, LAYER_03AA +/* 0x03E2 [0xFF ] */ end + +.layer LAYER_03E3 +/* 0x03E3 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_03E5 +/* 0x03E5 [0xC6 0x02 ] */ instr SF0_INST_2 +/* 0x03E7 [0x21 0x0A 0x5F 0x7F ] */ notedvg PITCH_GF3, 10, 95, 127 +/* 0x03EB [0x26 0x0A 0x5F 0x7F ] */ notedvg PITCH_B3, 10, 95, 127 +/* 0x03EF [0xC0 0x07 ] */ ldelay 7 +/* 0x03F1 [0xFF ] */ end + +.channel CHAN_03F2 +/* 0x03F2 [0x88 0x03 0xFB ] */ ldlayer 0, LAYER_03FB +/* 0x03F5 [0x89 0x03 0xAA ] */ ldlayer 1, LAYER_03AA +/* 0x03F8 [0xFF ] */ end + +.layer LAYER_03F9 +/* 0x03F9 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_03FB +/* 0x03FB [0xC6 0x03 ] */ instr SF0_INST_3 +/* 0x03FD [0x60 0x0A 0x3F ] */ notedv PITCH_F3, 10, 63 +/* 0x0400 [0x69 0x0A 0x3F ] */ notedv PITCH_D4, 10, 63 +/* 0x0403 [0xC0 0x07 ] */ ldelay 7 +/* 0x0405 [0xFF ] */ end + +.channel CHAN_0406 +/* 0x0406 [0x88 0x04 0x0F ] */ ldlayer 0, LAYER_040F +/* 0x0409 [0x89 0x03 0xAA ] */ ldlayer 1, LAYER_03AA +/* 0x040C [0xFF ] */ end + +.layer LAYER_040D +/* 0x040D [0xC2 0xFE ] */ transpose -2 +.layer LAYER_040F +/* 0x040F [0xC6 0x04 ] */ instr SF0_INST_4 +/* 0x0411 [0x64 0x0A 0x3F ] */ notedv PITCH_A3, 10, 63 +/* 0x0414 [0x6C 0x1E 0x3F ] */ notedv PITCH_F4, 30, 63 +/* 0x0417 [0xFF ] */ end + +.channel CHAN_0418 +/* 0x0418 [0x88 0x04 0x21 ] */ ldlayer 0, LAYER_0421 +/* 0x041B [0x89 0x03 0xAA ] */ ldlayer 1, LAYER_03AA +/* 0x041E [0xFF ] */ end + +.layer LAYER_041F +/* 0x041F [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0421 +/* 0x0421 [0xC6 0x04 ] */ instr SF0_INST_4 +/* 0x0423 [0x60 0x0A 0x3F ] */ notedv PITCH_F3, 10, 63 +/* 0x0426 [0x69 0x1E 0x3F ] */ notedv PITCH_D4, 30, 63 +/* 0x0429 [0xFF ] */ end + +.channel CHAN_042A +/* 0x042A [0x88 0x04 0x33 ] */ ldlayer 0, LAYER_0433 +/* 0x042D [0x89 0x03 0xAA ] */ ldlayer 1, LAYER_03AA +/* 0x0430 [0xFF ] */ end + +.layer LAYER_0431 +/* 0x0431 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0433 +/* 0x0433 [0xC6 0x05 ] */ instr SF0_INST_5 +/* 0x0435 [0x5F 0x06 0x50 ] */ notedv PITCH_E3, 6, 80 +/* 0x0438 [0xC6 0x07 ] */ instr SF0_INST_7 +/* 0x043A [0xCF 0xE1 ] */ releaserate 225 +/* 0x043C [0x64 0x0A 0x4B ] */ notedv PITCH_A3, 10, 75 +/* 0x043F [0x6B 0x30 0x50 ] */ notedv PITCH_E4, 48, 80 +/* 0x0442 [0xFF ] */ end + +.channel CHAN_0443 +/* 0x0443 [0x88 0x04 0x4C ] */ ldlayer 0, LAYER_044C +/* 0x0446 [0x89 0x03 0xAA ] */ ldlayer 1, LAYER_03AA +/* 0x0449 [0xFF ] */ end + +.layer LAYER_044A +/* 0x044A [0xC2 0xFE ] */ transpose -2 +.layer LAYER_044C +/* 0x044C [0xC6 0x00 ] */ instr SF0_INST_0 +/* 0x044E [0x59 0x04 0x2D ] */ notedv PITCH_BF2, 4, 45 +/* 0x0451 [0xC6 0x04 ] */ instr SF0_INST_4 +/* 0x0453 [0x56 0x06 0x3F ] */ notedv PITCH_G2, 6, 63 +/* 0x0456 [0xC6 0x23 ] */ instr SF0_INST_35 +/* 0x0458 [0xC7 0x81 0x2A 0xFF ] */ portamento 0x81, PITCH_EF4, 255 +/* 0x045C [0x5F 0x0E 0x31 ] */ notedv PITCH_E3, 14, 49 +/* 0x045F [0xC6 0x04 ] */ instr SF0_INST_4 +/* 0x0461 [0x5E 0x0E 0x3F ] */ notedv PITCH_EF3, 14, 63 +/* 0x0464 [0xFF ] */ end + +.channel CHAN_0465 +/* 0x0465 [0x88 0x04 0x6E ] */ ldlayer 0, LAYER_046E +/* 0x0468 [0x89 0x03 0xAA ] */ ldlayer 1, LAYER_03AA +/* 0x046B [0xFF ] */ end + +.layer LAYER_046C +/* 0x046C [0xC2 0xFE ] */ transpose -2 +.layer LAYER_046E +/* 0x046E [0xC6 0x05 ] */ instr SF0_INST_5 +/* 0x0470 [0x62 0x0A 0x3F ] */ notedv PITCH_G3, 10, 63 +/* 0x0473 [0x6C 0x0A 0x3F ] */ notedv PITCH_F4, 10, 63 +/* 0x0476 [0xC0 0x07 ] */ ldelay 7 +/* 0x0478 [0xFF ] */ end + +.channel CHAN_0479 +/* 0x0479 [0x88 0x04 0x82 ] */ ldlayer 0, LAYER_0482 +/* 0x047C [0x89 0x03 0xAA ] */ ldlayer 1, LAYER_03AA +/* 0x047F [0xFF ] */ end + +.layer LAYER_0480 +/* 0x0480 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0482 +/* 0x0482 [0xC6 0x06 ] */ instr SF0_INST_6 +/* 0x0484 [0x67 0x0A 0x4E ] */ notedv PITCH_C4, 10, 78 +/* 0x0487 [0x70 0x0A 0x4E ] */ notedv PITCH_A4, 10, 78 +/* 0x048A [0xC0 0x07 ] */ ldelay 7 +/* 0x048C [0xFF ] */ end + +.channel CHAN_048D +/* 0x048D [0x88 0x04 0x96 ] */ ldlayer 0, LAYER_0496 +/* 0x0490 [0x89 0x03 0xAA ] */ ldlayer 1, LAYER_03AA +/* 0x0493 [0xFF ] */ end + +.layer LAYER_0494 +/* 0x0494 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0496 +/* 0x0496 [0xC6 0x0B ] */ instr SF0_INST_11 +/* 0x0498 [0x63 0x0A 0x49 ] */ notedv PITCH_AF3, 10, 73 +/* 0x049B [0x6C 0x1E 0x49 ] */ notedv PITCH_F4, 30, 73 +/* 0x049E [0xFF ] */ end + +.channel CHAN_049F +/* 0x049F [0x88 0x04 0xA8 ] */ ldlayer 0, LAYER_04A8 +/* 0x04A2 [0x89 0x03 0xAA ] */ ldlayer 1, LAYER_03AA +/* 0x04A5 [0xFF ] */ end + +.layer LAYER_04A6 +/* 0x04A6 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_04A8 +/* 0x04A8 [0xC6 0x16 ] */ instr SF0_INST_22 +/* 0x04AA [0x60 0x0A 0x3F ] */ notedv PITCH_F3, 10, 63 +/* 0x04AD [0x66 0x19 0x3F ] */ notedv PITCH_B3, 25, 63 +/* 0x04B0 [0xFF ] */ end + +.channel CHAN_04B1 +/* 0x04B1 [0xC1 0x18 ] */ instr SF0_INST_24 +/* 0x04B3 [0x88 0x04 0xB7 ] */ ldlayer 0, LAYER_04B7 +/* 0x04B6 [0xFF ] */ end + +.layer LAYER_04B7 +/* 0x04B7 [0x5E 0x0A 0x60 ] */ notedv PITCH_EF3, 10, 96 +/* 0x04BA [0x64 0x18 0x60 ] */ notedv PITCH_A3, 24, 96 +/* 0x04BD [0xFF ] */ end + +/* 0x04BE [0xC2 0x02 ] */ transpose 2 +/* 0x04C0 [0xC7 0x85 0x1A 0xFF ] */ portamento 0x85, PITCH_B2, 255 +/* 0x04C4 [0x52 0x0A 0x50 ] */ notedv PITCH_EF2, 10, 80 +/* 0x04C7 [0xC4 ] */ legato +/* 0x04C8 [0xC2 0x05 ] */ transpose 5 +/* 0x04CA [0xC7 0x85 0x1A 0xFF ] */ portamento 0x85, PITCH_B2, 255 +/* 0x04CE [0x52 0x0F 0x50 ] */ notedv PITCH_EF2, 15, 80 +/* 0x04D1 [0x52 0x12 0x50 ] */ notedv PITCH_EF2, 18, 80 +/* 0x04D4 [0x56 0x0F 0x50 ] */ notedv PITCH_G2, 15, 80 +/* 0x04D7 [0xFF ] */ end + +.channel CHAN_04D8 +/* 0x04D8 [0x88 0x04 0xDF ] */ ldlayer 0, LAYER_04DF +/* 0x04DB [0x89 0x03 0xAA ] */ ldlayer 1, LAYER_03AA +/* 0x04DE [0xFF ] */ end + +.layer LAYER_04DF +/* 0x04DF [0xC6 0x01 ] */ instr SF0_INST_1 +/* 0x04E1 [0x58 0x12 0x3F ] */ notedv PITCH_A2, 18, 63 +/* 0x04E4 [0x60 0x12 0x3F ] */ notedv PITCH_F3, 18, 63 +/* 0x04E7 [0xC0 0x07 ] */ ldelay 7 +/* 0x04E9 [0xFF ] */ end + +.channel CHAN_04EA +/* 0x04EA [0x88 0x04 0xF3 ] */ ldlayer 0, LAYER_04F3 +/* 0x04ED [0x89 0x03 0xAA ] */ ldlayer 1, LAYER_03AA +/* 0x04F0 [0xFF ] */ end + +.layer LAYER_04F1 +/* 0x04F1 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_04F3 +/* 0x04F3 [0xC6 0x19 ] */ instr SF0_INST_25 +/* 0x04F5 [0x5F 0x07 0x5F ] */ notedv PITCH_E3, 7, 95 +/* 0x04F8 [0x72 0x12 0x5F ] */ notedv PITCH_B4, 18, 95 +/* 0x04FB [0xC0 0x07 ] */ ldelay 7 +/* 0x04FD [0xFF ] */ end + +.channel CHAN_04FE +/* 0x04FE [0x88 0x05 0x07 ] */ ldlayer 0, LAYER_0507 +/* 0x0501 [0x89 0x05 0x12 ] */ ldlayer 1, LAYER_0512 +/* 0x0504 [0xFF ] */ end + +.layer LAYER_0505 +/* 0x0505 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0507 +/* 0x0507 [0xC6 0x00 ] */ instr SF0_INST_0 +/* 0x0509 [0x6B 0x0A 0x4B ] */ notedv PITCH_E4, 10, 75 +/* 0x050C [0x5F 0x0A 0x4B ] */ notedv PITCH_E3, 10, 75 +/* 0x050F [0xC0 0x07 ] */ ldelay 7 +/* 0x0511 [0xFF ] */ end + +.layer LAYER_0512 +/* 0x0512 [0xC0 0x07 ] */ ldelay 7 +/* 0x0514 [0xC6 0x20 ] */ instr SF0_INST_32 +/* 0x0516 [0xCB 0x66 0x60 0xFA ] */ env ENVELOPE_6660, 250 +/* 0x051A [0x33 0x06 0x27 0x7F ] */ notedvg PITCH_C5, 6, 39, 127 +/* 0x051E [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x0520 [0x29 0x04 0x31 0x7F ] */ notedvg PITCH_D4, 4, 49, 127 +/* 0x0524 [0xC6 0x17 ] */ instr SF0_INST_23 +/* 0x0526 [0x66 0x05 0x27 ] */ notedv PITCH_B3, 5, 39 +/* 0x0529 [0x60 0x05 0x27 ] */ notedv PITCH_F3, 5, 39 +/* 0x052C [0xFF ] */ end + +.channel CHAN_052D +/* 0x052D [0x88 0x05 0x36 ] */ ldlayer 0, LAYER_0536 +/* 0x0530 [0x89 0x05 0x12 ] */ ldlayer 1, LAYER_0512 +/* 0x0533 [0xFF ] */ end + +.layer LAYER_0534 +/* 0x0534 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0536 +/* 0x0536 [0xC6 0x01 ] */ instr SF0_INST_1 +/* 0x0538 [0x70 0x0A 0x4B ] */ notedv PITCH_A4, 10, 75 +/* 0x053B [0x64 0x0A 0x4B ] */ notedv PITCH_A3, 10, 75 +/* 0x053E [0xFF ] */ end + +.channel CHAN_053F +/* 0x053F [0xCC 0x14 ] */ ldi 20 +/* 0x0541 [0x71 ] */ stio IO_PORT_1 +/* 0x0542 [0x88 0x05 0x4B ] */ ldlayer 0, LAYER_054B +/* 0x0545 [0x89 0x05 0x12 ] */ ldlayer 1, LAYER_0512 +/* 0x0548 [0xFF ] */ end + +.layer LAYER_0549 +/* 0x0549 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_054B +/* 0x054B [0xC6 0x02 ] */ instr SF0_INST_2 +/* 0x054D [0x2D 0x0A 0x65 0x40 ] */ notedvg PITCH_GF4, 10, 101, 64 +/* 0x0551 [0x21 0x0A 0x65 0x40 ] */ notedvg PITCH_GF3, 10, 101, 64 +/* 0x0555 [0xC0 0x07 ] */ ldelay 7 +/* 0x0557 [0xFF ] */ end + +.channel CHAN_0558 +/* 0x0558 [0x88 0x05 0x61 ] */ ldlayer 0, LAYER_0561 +/* 0x055B [0x89 0x05 0x12 ] */ ldlayer 1, LAYER_0512 +/* 0x055E [0xFF ] */ end + +.layer LAYER_055F +/* 0x055F [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0561 +/* 0x0561 [0xC6 0x03 ] */ instr SF0_INST_3 +/* 0x0563 [0x6C 0x0A 0x4B ] */ notedv PITCH_F4, 10, 75 +/* 0x0566 [0x60 0x0A 0x4B ] */ notedv PITCH_F3, 10, 75 +/* 0x0569 [0xC0 0x07 ] */ ldelay 7 +/* 0x056B [0xFF ] */ end + +.channel CHAN_056C +/* 0x056C [0x88 0x05 0x75 ] */ ldlayer 0, LAYER_0575 +/* 0x056F [0x89 0x05 0x12 ] */ ldlayer 1, LAYER_0512 +/* 0x0572 [0xFF ] */ end + +.layer LAYER_0573 +/* 0x0573 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0575 +/* 0x0575 [0xC6 0x04 ] */ instr SF0_INST_4 +/* 0x0577 [0x70 0x0A 0x4B ] */ notedv PITCH_A4, 10, 75 +/* 0x057A [0x64 0x1E 0x4B ] */ notedv PITCH_A3, 30, 75 +/* 0x057D [0xFF ] */ end + +.channel CHAN_057E +/* 0x057E [0x88 0x05 0x87 ] */ ldlayer 0, LAYER_0587 +/* 0x0581 [0x89 0x05 0x12 ] */ ldlayer 1, LAYER_0512 +/* 0x0584 [0xFF ] */ end + +.layer LAYER_0585 +/* 0x0585 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0587 +/* 0x0587 [0xC6 0x04 ] */ instr SF0_INST_4 +/* 0x0589 [0x6C 0x0A 0x4B ] */ notedv PITCH_F4, 10, 75 +/* 0x058C [0x60 0x1E 0x4B ] */ notedv PITCH_F3, 30, 75 +/* 0x058F [0xFF ] */ end + +.channel CHAN_0590 +/* 0x0590 [0x88 0x05 0x99 ] */ ldlayer 0, LAYER_0599 +/* 0x0593 [0x89 0x05 0x12 ] */ ldlayer 1, LAYER_0512 +/* 0x0596 [0xFF ] */ end + +.layer LAYER_0597 +/* 0x0597 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_0599 +/* 0x0599 [0xC6 0x05 ] */ instr SF0_INST_5 +/* 0x059B [0x64 0x06 0x38 ] */ notedv PITCH_A3, 6, 56 +/* 0x059E [0xC6 0x07 ] */ instr SF0_INST_7 +/* 0x05A0 [0xCF 0xE1 ] */ releaserate 225 +/* 0x05A2 [0x6C 0x0A 0x50 ] */ notedv PITCH_F4, 10, 80 +/* 0x05A5 [0x64 0x30 0x50 ] */ notedv PITCH_A3, 48, 80 +/* 0x05A8 [0xFF ] */ end + +.channel CHAN_05A9 +/* 0x05A9 [0x88 0x05 0xB2 ] */ ldlayer 0, LAYER_05B2 +/* 0x05AC [0x89 0x05 0x12 ] */ ldlayer 1, LAYER_0512 +/* 0x05AF [0xFF ] */ end + +.layer LAYER_05B0 +/* 0x05B0 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_05B2 +/* 0x05B2 [0xC6 0x00 ] */ instr SF0_INST_0 +/* 0x05B4 [0x5A 0x04 0x44 ] */ notedv PITCH_B2, 4, 68 +/* 0x05B7 [0xC6 0x04 ] */ instr SF0_INST_4 +/* 0x05B9 [0x60 0x06 0x4B ] */ notedv PITCH_F3, 6, 75 +/* 0x05BC [0x56 0x0A 0x4B ] */ notedv PITCH_G2, 10, 75 +/* 0x05BF [0xC6 0x23 ] */ instr SF0_INST_35 +/* 0x05C1 [0xC7 0x81 0x26 0xFF ] */ portamento 0x81, PITCH_B3, 255 +/* 0x05C5 [0x5B 0x16 0x46 ] */ notedv PITCH_C3, 22, 70 +/* 0x05C8 [0xFF ] */ end + +.channel CHAN_05C9 +/* 0x05C9 [0x88 0x05 0xD2 ] */ ldlayer 0, LAYER_05D2 +/* 0x05CC [0x89 0x05 0x12 ] */ ldlayer 1, LAYER_0512 +/* 0x05CF [0xFF ] */ end + +.layer LAYER_05D0 +/* 0x05D0 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_05D2 +/* 0x05D2 [0xC6 0x05 ] */ instr SF0_INST_5 +/* 0x05D4 [0x6B 0x0A 0x4B ] */ notedv PITCH_E4, 10, 75 +/* 0x05D7 [0x62 0x0A 0x4B ] */ notedv PITCH_G3, 10, 75 +/* 0x05DA [0xC0 0x07 ] */ ldelay 7 +/* 0x05DC [0xFF ] */ end + +.channel CHAN_05DD +/* 0x05DD [0x88 0x05 0xE6 ] */ ldlayer 0, LAYER_05E6 +/* 0x05E0 [0x89 0x05 0x12 ] */ ldlayer 1, LAYER_0512 +/* 0x05E3 [0xFF ] */ end + +.layer LAYER_05E4 +/* 0x05E4 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_05E6 +/* 0x05E6 [0xC6 0x06 ] */ instr SF0_INST_6 +/* 0x05E8 [0x72 0x0A 0x5A ] */ notedv PITCH_B4, 10, 90 +/* 0x05EB [0x60 0x0A 0x5A ] */ notedv PITCH_F3, 10, 90 +/* 0x05EE [0xC0 0x07 ] */ ldelay 7 +/* 0x05F0 [0xFF ] */ end + +.channel CHAN_05F1 +/* 0x05F1 [0x88 0x05 0xFA ] */ ldlayer 0, LAYER_05FA +/* 0x05F4 [0x89 0x05 0x12 ] */ ldlayer 1, LAYER_0512 +/* 0x05F7 [0xFF ] */ end + +.layer LAYER_05F8 +/* 0x05F8 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_05FA +/* 0x05FA [0xC6 0x0B ] */ instr SF0_INST_11 +/* 0x05FC [0x6F 0x0A 0x55 ] */ notedv PITCH_AF4, 10, 85 +/* 0x05FF [0x63 0x1E 0x55 ] */ notedv PITCH_AF3, 30, 85 +/* 0x0602 [0xFF ] */ end + +.channel CHAN_0603 +/* 0x0603 [0x88 0x06 0x0C ] */ ldlayer 0, LAYER_060C +/* 0x0606 [0x89 0x05 0x12 ] */ ldlayer 1, LAYER_0512 +/* 0x0609 [0xFF ] */ end + +.layer LAYER_060A +/* 0x060A [0xC2 0xFE ] */ transpose -2 +.layer LAYER_060C +/* 0x060C [0xC6 0x16 ] */ instr SF0_INST_22 +/* 0x060E [0x6C 0x0A 0x4B ] */ notedv PITCH_F4, 10, 75 +/* 0x0611 [0x60 0x1E 0x4B ] */ notedv PITCH_F3, 30, 75 +/* 0x0614 [0xFF ] */ end + +.channel CHAN_0615 +/* 0x0615 [0xC1 0x18 ] */ instr SF0_INST_24 +/* 0x0617 [0x88 0x06 0x1B ] */ ldlayer 0, LAYER_061B +/* 0x061A [0xFF ] */ end + +.layer LAYER_061B +/* 0x061B [0x66 0x0A 0x60 ] */ notedv PITCH_B3, 10, 96 +/* 0x061E [0x60 0x18 0x60 ] */ notedv PITCH_F3, 24, 96 +/* 0x0621 [0xFF ] */ end + +.channel CHAN_0622 +/* 0x0622 [0x88 0x06 0x29 ] */ ldlayer 0, LAYER_0629 +/* 0x0625 [0x89 0x05 0x12 ] */ ldlayer 1, LAYER_0512 +/* 0x0628 [0xFF ] */ end + +.layer LAYER_0629 +/* 0x0629 [0xC6 0x01 ] */ instr SF0_INST_1 +/* 0x062B [0x64 0x12 0x4B ] */ notedv PITCH_A3, 18, 75 +/* 0x062E [0x58 0x12 0x4B ] */ notedv PITCH_A2, 18, 75 +/* 0x0631 [0xFF ] */ end + +.channel CHAN_0632 +/* 0x0632 [0x88 0x06 0x3B ] */ ldlayer 0, LAYER_063B +/* 0x0635 [0x89 0x05 0x12 ] */ ldlayer 1, LAYER_0512 +/* 0x0638 [0xFF ] */ end + +.layer LAYER_0639 +/* 0x0639 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_063B +/* 0x063B [0xC6 0x19 ] */ instr SF0_INST_25 +/* 0x063D [0x6E 0x05 0x62 ] */ notedv PITCH_G4, 5, 98 +/* 0x0640 [0x5F 0x12 0x62 ] */ notedv PITCH_E3, 18, 98 +/* 0x0643 [0xFF ] */ end + +.channel CHAN_0644 +/* 0x0644 [0xC1 0x0A ] */ instr SF0_INST_10 +/* 0x0646 [0xDA 0x66 0x7C ] */ env ENVELOPE_667C +/* 0x0649 [0x88 0x06 0x4D ] */ ldlayer 0, LAYER_064D +/* 0x064C [0xFF ] */ end + +.layer LAYER_064D +/* 0x064D [0xC7 0x01 0x30 0x10 ] */ portamento 0x01, PITCH_A4, 16 +/* 0x0651 [0x69 0x18 0x64 ] */ notedv PITCH_D4, 24, 100 +/* 0x0654 [0xFF ] */ end + +.channel CHAN_0655 +/* 0x0655 [0xC1 0x09 ] */ instr SF0_INST_9 +/* 0x0657 [0xDA 0x66 0x94 ] */ env ENVELOPE_6694 +/* 0x065A [0x88 0x06 0x5E ] */ ldlayer 0, LAYER_065E +/* 0x065D [0xFF ] */ end + +.layer LAYER_065E +/* 0x065E [0x70 0x16 0x7F ] */ notedv PITCH_A4, 22, 127 +/* 0x0661 [0xFF ] */ end + +.channel CHAN_0662 +/* 0x0662 [0xC1 0x05 ] */ instr SF0_INST_5 +/* 0x0664 [0xDA 0x66 0x74 ] */ env ENVELOPE_6674 +/* 0x0667 [0x88 0x06 0x6B ] */ ldlayer 0, LAYER_066B +/* 0x066A [0xFF ] */ end + +.layer LAYER_066B +/* 0x066B [0x58 0x0A 0x69 ] */ notedv PITCH_A2, 10, 105 +/* 0x066E [0xFF ] */ end + +.channel CHAN_066F +/* 0x066F [0xC1 0x09 ] */ instr SF0_INST_9 +/* 0x0671 [0xDA 0x66 0x94 ] */ env ENVELOPE_6694 +/* 0x0674 [0x88 0x06 0x78 ] */ ldlayer 0, LAYER_0678 +/* 0x0677 [0xFF ] */ end + +.layer LAYER_0678 +/* 0x0678 [0xC7 0x81 0x30 0xFF ] */ portamento 0x81, PITCH_A4, 255 +/* 0x067C [0x67 0x20 0x3C ] */ notedv PITCH_C4, 32, 60 +/* 0x067F [0xFF ] */ end + +.channel CHAN_0680 +/* 0x0680 [0xC1 0x09 ] */ instr SF0_INST_9 +/* 0x0682 [0xDA 0x66 0x88 ] */ env ENVELOPE_6688 +/* 0x0685 [0x88 0x06 0x93 ] */ ldlayer 0, LAYER_0693 +/* 0x0688 [0x89 0x06 0x8C ] */ ldlayer 1, LAYER_068C +/* 0x068B [0xFF ] */ end + +.layer LAYER_068C +/* 0x068C [0x54 0x06 0x73 ] */ notedv PITCH_F2, 6, 115 +/* 0x068F [0x5B 0x0C 0x73 ] */ notedv PITCH_C3, 12, 115 +/* 0x0692 [0xFF ] */ end + +.layer LAYER_0693 +/* 0x0693 [0xC6 0x1C ] */ instr SF0_INST_28 +/* 0x0695 [0xC7 0x81 0x14 0xFF ] */ portamento 0x81, PITCH_F2, 255 +/* 0x0699 [0x5F 0x19 0x5A ] */ notedv PITCH_E3, 25, 90 +/* 0x069C [0xFF ] */ end + +.channel CHAN_069D +/* 0x069D [0xC1 0x09 ] */ instr SF0_INST_9 +/* 0x069F [0xDA 0x66 0xE0 ] */ env ENVELOPE_66E0 +/* 0x06A2 [0x88 0x06 0xA9 ] */ ldlayer 0, LAYER_06A9 +/* 0x06A5 [0x89 0x06 0xB5 ] */ ldlayer 1, LAYER_06B5 +/* 0x06A8 [0xFF ] */ end + +.layer LAYER_06A9 +/* 0x06A9 [0x62 0x06 0x73 ] */ notedv PITCH_G3, 6, 115 +/* 0x06AC [0x5B 0x0C 0x73 ] */ notedv PITCH_C3, 12, 115 +/* 0x06AF [0xC6 0x1C ] */ instr SF0_INST_28 +/* 0x06B1 [0x69 0x0F 0x5A ] */ notedv PITCH_D4, 15, 90 +/* 0x06B4 [0xFF ] */ end + +.layer LAYER_06B5 +/* 0x06B5 [0xC6 0x1C ] */ instr SF0_INST_28 +/* 0x06B7 [0xC7 0x81 0x1F 0xFF ] */ portamento 0x81, PITCH_E3, 255 +/* 0x06BB [0x54 0x19 0x5A ] */ notedv PITCH_F2, 25, 90 +/* 0x06BE [0xFF ] */ end + +.channel CHAN_06BF +/* 0x06BF [0xC1 0x00 ] */ instr SF0_INST_0 +/* 0x06C1 [0x88 0x06 0xC5 ] */ ldlayer 0, LAYER_06C5 +/* 0x06C4 [0xFF ] */ end + +.layer LAYER_06C5 +/* 0x06C5 [0xC7 0x81 0x1B 0xC8 ] */ portamento 0x81, PITCH_C3, 200 +/* 0x06C9 [0x60 0x07 0x7F ] */ notedv PITCH_F3, 7, 127 +/* 0x06CC [0xFF ] */ end + +.channel CHAN_06CD +/* 0x06CD [0xC1 0x13 ] */ instr SF0_INST_19 +/* 0x06CF [0xDA 0x65 0xFC ] */ env ENVELOPE_65FC +/* 0x06D2 [0xD9 0x7F ] */ releaserate 127 +/* 0x06D4 [0x88 0x06 0xD8 ] */ ldlayer 0, LAYER_06D8 +/* 0x06D7 [0xFF ] */ end + +.layer LAYER_06D8 +/* 0x06D8 [0xC7 0x81 0x27 0xC8 ] */ portamento 0x81, PITCH_C4, 200 +/* 0x06DC [0x60 0x80 0x91 0x64 ] */ notedv PITCH_F3, 145, 100 +/* 0x06E0 [0xFF ] */ end + +.channel CHAN_06E1 +/* 0x06E1 [0xC1 0x13 ] */ instr SF0_INST_19 +/* 0x06E3 [0xDA 0x66 0x10 ] */ env ENVELOPE_6610 +/* 0x06E6 [0x88 0x06 0xEA ] */ ldlayer 0, LAYER_06EA +/* 0x06E9 [0xFF ] */ end + +.layer LAYER_06EA +/* 0x06EA [0xC7 0x81 0x22 0x30 ] */ portamento 0x81, PITCH_G3, 48 +/* 0x06EE [0x64 0x50 0x69 ] */ notedv PITCH_A3, 80, 105 +/* 0x06F1 [0xFF ] */ end + +.channel CHAN_06F2 +/* 0x06F2 [0x88 0x06 0xF8 ] */ ldlayer 0, LAYER_06F8 +/* 0x06F5 [0xFF ] */ end + +.layer LAYER_06F6 +/* 0x06F6 [0x2C 0xFA ] */ transpose -6 +.layer LAYER_06F8 +/* 0x06F8 [0xC6 0x14 ] */ instr SF0_INST_20 +/* 0x06FA [0xCB 0x66 0x24 0xFB ] */ env ENVELOPE_6624, 251 +/* 0x06FE [0xC7 0x81 0x24 0xC8 ] */ portamento 0x81, PITCH_A3, 200 +/* 0x0702 [0x5B 0x30 0x69 ] */ notedv PITCH_C3, 48, 105 +/* 0x0705 [0xFF ] */ end + +.channel CHAN_0706 +/* 0x0706 [0xC1 0x1B ] */ instr SF0_INST_27 +/* 0x0708 [0x88 0x07 0x0C ] */ ldlayer 0, LAYER_070C +/* 0x070B [0xFF ] */ end + +.layer LAYER_070C +/* 0x070C [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +/* 0x0710 [0x4F 0x18 0x64 ] */ notedv PITCH_C2, 24, 100 +/* 0x0713 [0xFF ] */ end + +.channel CHAN_0714 +/* 0x0714 [0xED 0x0F ] */ gain 15 +/* 0x0716 [0x88 0x07 0x1A ] */ ldlayer 0, LAYER_071A +/* 0x0719 [0xFF ] */ end + +.layer LAYER_071A +/* 0x071A [0xFC 0x07 0x25 ] */ call LAYER_0725 +/* 0x071D [0xC7 0x81 0x2D 0xFF ] */ portamento 0x81, PITCH_GF4, 255 +/* 0x0721 [0x5A 0x0E 0x73 ] */ notedv PITCH_B2, 14, 115 +/* 0x0724 [0xFF ] */ end + +.layer LAYER_0725 +/* 0x0725 [0xC6 0x15 ] */ instr SF0_INST_21 +/* 0x0727 [0xCB 0x66 0xB0 0xF5 ] */ env ENVELOPE_66B0, 245 +/* 0x072B [0xFF ] */ end + +/* 0x072C [0xC2 0x02 ] */ transpose 2 +/* 0x072E [0xFB 0x08 0x00 ] */ jump LAYER_0800 + +.channel CHAN_0731 +/* 0x0731 [0xC1 0x1B ] */ instr SF0_INST_27 +/* 0x0733 [0x88 0x07 0x37 ] */ ldlayer 0, LAYER_0737 +/* 0x0736 [0xFF ] */ end + +.layer LAYER_0737 +/* 0x0737 [0xC4 ] */ legato +/* 0x0738 [0xC7 0x85 0x1D 0xE1 ] */ portamento 0x85, PITCH_D3, 225 +/* 0x073C [0x51 0x08 0x64 ] */ notedv PITCH_D2, 8, 100 +/* 0x073F [0x45 0x14 0x64 ] */ notedv PITCH_D1, 20, 100 +/* 0x0742 [0xFF ] */ end + +.channel CHAN_0743 +/* 0x0743 [0x88 0x07 0x47 ] */ ldlayer 0, LAYER_0747 +/* 0x0746 [0xFF ] */ end + +.layer LAYER_0747 +/* 0x0747 [0xC6 0x1B ] */ instr SF0_INST_27 +/* 0x0749 [0xCF 0xF8 ] */ releaserate 248 +/* 0x074B [0xC7 0x81 0x1A 0xE1 ] */ portamento 0x81, PITCH_B2, 225 +/* 0x074F [0x49 0x0C 0x64 ] */ notedv PITCH_GF1, 12, 100 +/* 0x0752 [0xFF ] */ end + +.channel CHAN_0753 +/* 0x0753 [0xED 0x14 ] */ gain 20 +/* 0x0755 [0x88 0x1B 0x3F ] */ ldlayer 0, LAYER_1B3F +/* 0x0758 [0x89 0x07 0x1A ] */ ldlayer 1, LAYER_071A +/* 0x075B [0x8A 0x07 0x5F ] */ ldlayer 2, LAYER_075F +/* 0x075E [0xFF ] */ end + +.layer LAYER_075F +/* 0x075F [0xFC 0x07 0x25 ] */ call LAYER_0725 +/* 0x0762 [0xC7 0x85 0x22 0xFF ] */ portamento 0x85, PITCH_G3, 255 +/* 0x0766 [0x65 0x07 0x6E ] */ notedv PITCH_BF3, 7, 110 +/* 0x0769 [0xFF ] */ end + +.channel CHAN_076A +/* 0x076A [0xC1 0x1E ] */ instr SF0_INST_30 +/* 0x076C [0xDA 0x66 0xC8 ] */ env ENVELOPE_66C8 +/* 0x076F [0x88 0x07 0x76 ] */ ldlayer 0, LAYER_0776 +/* 0x0772 [0x89 0x07 0x85 ] */ ldlayer 1, LAYER_0785 +/* 0x0775 [0xFF ] */ end + +.layer LAYER_0776 +/* 0x0776 [0xC7 0x81 0x37 0x7F ] */ portamento 0x81, PITCH_E5, 127 +/* 0x077A [0x44 0x08 0x73 ] */ notedv PITCH_DF1, 8, 115 +/* 0x077D [0xC7 0x81 0x06 0xFF ] */ portamento 0x81, PITCH_EF1, 255 +/* 0x0781 [0x63 0x0B 0x69 ] */ notedv PITCH_AF3, 11, 105 +/* 0x0784 [0xFF ] */ end + +.layer LAYER_0785 +/* 0x0785 [0xC6 0x1F ] */ instr SF0_INST_31 +/* 0x0787 [0xC7 0x81 0x31 0xDE ] */ portamento 0x81, PITCH_BF4, 222 +/* 0x078B [0x59 0x08 0x73 ] */ notedv PITCH_BF2, 8, 115 +/* 0x078E [0xC7 0x81 0x13 0xFF ] */ portamento 0x81, PITCH_E2, 255 +/* 0x0792 [0x60 0x0C 0x73 ] */ notedv PITCH_F3, 12, 115 +/* 0x0795 [0xFF ] */ end + +.channel CHAN_0796 +/* 0x0796 [0x88 0x07 0x9D ] */ ldlayer 0, LAYER_079D +/* 0x0799 [0x89 0x0E 0x0C ] */ ldlayer 1, LAYER_0E0C +/* 0x079C [0xFF ] */ end + +.layer LAYER_079D +/* 0x079D [0xC0 0x30 ] */ ldelay 48 +/* 0x079F [0xFF ] */ end + +.channel CHAN_07A0 +/* 0x07A0 [0x88 0x07 0x9D ] */ ldlayer 0, LAYER_079D +/* 0x07A3 [0x89 0x0E 0x1C ] */ ldlayer 1, LAYER_0E1C +/* 0x07A6 [0xFF ] */ end + +.channel CHAN_07A7 +/* 0x07A7 [0x88 0x07 0x9D ] */ ldlayer 0, LAYER_079D +/* 0x07AA [0x89 0x0E 0x24 ] */ ldlayer 1, LAYER_0E24 +/* 0x07AD [0xFF ] */ end + +.channel CHAN_07AE +/* 0x07AE [0x88 0x07 0x9D ] */ ldlayer 0, LAYER_079D +/* 0x07B1 [0x89 0x0E 0x34 ] */ ldlayer 1, LAYER_0E34 +/* 0x07B4 [0xFF ] */ end + +.channel CHAN_07B5 +/* 0x07B5 [0x88 0x07 0x9D ] */ ldlayer 0, LAYER_079D +/* 0x07B8 [0x89 0x0E 0x34 ] */ ldlayer 1, LAYER_0E34 +/* 0x07BB [0xFF ] */ end + +.channel CHAN_07BC +/* 0x07BC [0x88 0x07 0x9D ] */ ldlayer 0, LAYER_079D +/* 0x07BF [0x89 0x0E 0x34 ] */ ldlayer 1, LAYER_0E34 +/* 0x07C2 [0xFF ] */ end + +.channel CHAN_07C3 +/* 0x07C3 [0x88 0x07 0x9D ] */ ldlayer 0, LAYER_079D +/* 0x07C6 [0x89 0x0E 0x3C ] */ ldlayer 1, LAYER_0E3C +/* 0x07C9 [0xFF ] */ end + +.channel CHAN_07CA +/* 0x07CA [0x88 0x07 0x9D ] */ ldlayer 0, LAYER_079D +/* 0x07CD [0x89 0x0E 0x34 ] */ ldlayer 1, LAYER_0E34 +/* 0x07D0 [0xFF ] */ end + +.channel CHAN_07D1 +/* 0x07D1 [0x88 0x07 0x9D ] */ ldlayer 0, LAYER_079D +/* 0x07D4 [0x89 0x0E 0x4C ] */ ldlayer 1, LAYER_0E4C +/* 0x07D7 [0xFF ] */ end + +.channel CHAN_07D8 +/* 0x07D8 [0x88 0x07 0x9D ] */ ldlayer 0, LAYER_079D +/* 0x07DB [0x89 0x0E 0x0C ] */ ldlayer 1, LAYER_0E0C +/* 0x07DE [0xFF ] */ end + +.channel CHAN_07DF +/* 0x07DF [0x88 0x07 0x9D ] */ ldlayer 0, LAYER_079D +/* 0x07E2 [0x89 0x0E 0x54 ] */ ldlayer 1, LAYER_0E54 +/* 0x07E5 [0xFF ] */ end + +.channel CHAN_07E6 +/* 0x07E6 [0x88 0x07 0x9D ] */ ldlayer 0, LAYER_079D +/* 0x07E9 [0x89 0x0E 0x54 ] */ ldlayer 1, LAYER_0E54 +/* 0x07EC [0xFF ] */ end + +.channel CHAN_07ED +/* 0x07ED [0x88 0x07 0x9D ] */ ldlayer 0, LAYER_079D +/* 0x07F0 [0x89 0x0E 0x64 ] */ ldlayer 1, LAYER_0E64 +/* 0x07F3 [0xFF ] */ end + +.channel CHAN_07F4 +/* 0x07F4 [0x89 0x08 0x0C ] */ ldlayer 1, LAYER_080C +CHAN_07F7: +/* 0x07F7 [0xED 0x19 ] */ gain 25 +/* 0x07F9 [0x8A 0x05 0x12 ] */ ldlayer 2, LAYER_0512 +.channel CHAN_07FC +/* 0x07FC [0x88 0x08 0x00 ] */ ldlayer 0, LAYER_0800 +/* 0x07FF [0xFF ] */ end + +.layer LAYER_0800 +/* 0x0800 [0xFC 0x07 0x25 ] */ call LAYER_0725 +/* 0x0803 [0xC7 0x81 0x26 0xC8 ] */ portamento 0x81, PITCH_B3, 200 +/* 0x0807 [0x25 0x24 0x73 0x64 ] */ notedvg PITCH_BF3, 36, 115, 100 +/* 0x080B [0xFF ] */ end + +.layer LAYER_080C +/* 0x080C [0xC2 0xFA ] */ transpose -6 +/* 0x080E [0xFB 0x05 0x07 ] */ jump LAYER_0507 + +.channel CHAN_0811 +/* 0x0811 [0x89 0x08 0x16 ] */ ldlayer 1, LAYER_0816 +/* 0x0814 [0xF4 0xE1 ] */ rjump CHAN_07F7 + +.layer LAYER_0816 +/* 0x0816 [0xC2 0xFA ] */ transpose -6 +/* 0x0818 [0xFB 0x05 0x36 ] */ jump LAYER_0536 + +.channel CHAN_081B +/* 0x081B [0x89 0x08 0x20 ] */ ldlayer 1, LAYER_0820 +/* 0x081E [0xF4 0xD7 ] */ rjump CHAN_07F7 + +.layer LAYER_0820 +/* 0x0820 [0xC2 0xFA ] */ transpose -6 +/* 0x0822 [0xFB 0x05 0x4B ] */ jump LAYER_054B + +.channel CHAN_0825 +/* 0x0825 [0x89 0x08 0x2A ] */ ldlayer 1, LAYER_082A +/* 0x0828 [0xF4 0xCD ] */ rjump CHAN_07F7 + +.layer LAYER_082A +/* 0x082A [0xC2 0xFA ] */ transpose -6 +/* 0x082C [0xFB 0x05 0x61 ] */ jump LAYER_0561 + +.channel CHAN_082F +/* 0x082F [0x89 0x08 0x34 ] */ ldlayer 1, LAYER_0834 +/* 0x0832 [0xF4 0xC3 ] */ rjump CHAN_07F7 + +.layer LAYER_0834 +/* 0x0834 [0xC2 0xFA ] */ transpose -6 +/* 0x0836 [0xFB 0x05 0x75 ] */ jump LAYER_0575 + +/* 0x0839 [0xF4 0xBC ] */ rjump CHAN_07F7 + +.channel CHAN_083B +/* 0x083B [0x89 0x08 0x40 ] */ ldlayer 1, LAYER_0840 +/* 0x083E [0xF4 0xB7 ] */ rjump CHAN_07F7 + +.layer LAYER_0840 +/* 0x0840 [0xC2 0xFA ] */ transpose -6 +/* 0x0842 [0xFB 0x05 0x87 ] */ jump LAYER_0587 + +.channel CHAN_0845 +/* 0x0845 [0x89 0x08 0x4A ] */ ldlayer 1, LAYER_084A +/* 0x0848 [0xF4 0xAD ] */ rjump CHAN_07F7 + +.layer LAYER_084A +/* 0x084A [0xC2 0xFA ] */ transpose -6 +/* 0x084C [0xFB 0x05 0x99 ] */ jump LAYER_0599 + +.channel CHAN_084F +/* 0x084F [0x89 0x08 0x54 ] */ ldlayer 1, LAYER_0854 +/* 0x0852 [0xF4 0xA3 ] */ rjump CHAN_07F7 + +.layer LAYER_0854 +/* 0x0854 [0xC2 0xFA ] */ transpose -6 +/* 0x0856 [0xFB 0x05 0xB2 ] */ jump LAYER_05B2 + +.channel CHAN_0859 +/* 0x0859 [0x89 0x08 0x5E ] */ ldlayer 1, LAYER_085E +/* 0x085C [0xF4 0x99 ] */ rjump CHAN_07F7 + +.layer LAYER_085E +/* 0x085E [0xC2 0xFA ] */ transpose -6 +/* 0x0860 [0xFB 0x05 0xD2 ] */ jump LAYER_05D2 + +.channel CHAN_0863 +/* 0x0863 [0x89 0x08 0x68 ] */ ldlayer 1, LAYER_0868 +/* 0x0866 [0xF4 0x8F ] */ rjump CHAN_07F7 + +.layer LAYER_0868 +/* 0x0868 [0xC2 0xFA ] */ transpose -6 +/* 0x086A [0xFB 0x05 0xE6 ] */ jump LAYER_05E6 + +.channel CHAN_086D +/* 0x086D [0x89 0x08 0x72 ] */ ldlayer 1, LAYER_0872 +/* 0x0870 [0xF4 0x85 ] */ rjump CHAN_07F7 + +.layer LAYER_0872 +/* 0x0872 [0xC2 0xFA ] */ transpose -6 +/* 0x0874 [0xFB 0x05 0xFA ] */ jump LAYER_05FA + +.channel CHAN_0877 +/* 0x0877 [0x89 0x08 0x7D ] */ ldlayer 1, LAYER_087D +/* 0x087A [0xFB 0x07 0xF7 ] */ jump CHAN_07F7 + +.layer LAYER_087D +/* 0x087D [0xC2 0xFA ] */ transpose -6 +/* 0x087F [0xFB 0x06 0x0C ] */ jump LAYER_060C + +.channel CHAN_0882 +/* 0x0882 [0x89 0x08 0x88 ] */ ldlayer 1, LAYER_0888 +/* 0x0885 [0xFB 0x07 0xF7 ] */ jump CHAN_07F7 + +.layer LAYER_0888 +/* 0x0888 [0xC2 0xFA ] */ transpose -6 +/* 0x088A [0xFB 0x06 0x29 ] */ jump LAYER_0629 + +.channel CHAN_088D +/* 0x088D [0x89 0x08 0x93 ] */ ldlayer 1, LAYER_0893 +/* 0x0890 [0xFB 0x07 0xF7 ] */ jump CHAN_07F7 + +.layer LAYER_0893 +/* 0x0893 [0xC2 0xFA ] */ transpose -6 +/* 0x0895 [0xFB 0x06 0x3B ] */ jump LAYER_063B + +.channel CHAN_0898 +/* 0x0898 [0x88 0x08 0x9C ] */ ldlayer 0, LAYER_089C +/* 0x089B [0xFF ] */ end + +.layer LAYER_089C +/* 0x089C [0xC6 0x3E ] */ instr SF0_INST_62 +/* 0x089E [0xCB 0x66 0xEC 0xFB ] */ env ENVELOPE_66EC, 251 +/* 0x08A2 [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x08A6 [0x73 0x18 0x64 ] */ notedv PITCH_C5, 24, 100 +/* 0x08A9 [0xC6 0x13 ] */ instr SF0_INST_19 +/* 0x08AB [0xCB 0x67 0xA4 0xDD ] */ env ENVELOPE_67A4, 221 +/* 0x08AF [0xC7 0x81 0x20 0xC8 ] */ portamento 0x81, PITCH_F3, 200 +/* 0x08B3 [0x67 0x3C 0x64 ] */ notedv PITCH_C4, 60, 100 +/* 0x08B6 [0xFF ] */ end + +.channel CHAN_08B7 +/* 0x08B7 [0x88 0x08 0xBB ] */ ldlayer 0, LAYER_08BB +/* 0x08BA [0xFF ] */ end + +.layer LAYER_08BB +/* 0x08BB [0xC6 0x48 ] */ instr SF0_INST_72 +/* 0x08BD [0xCB 0x65 0xFC 0xDD ] */ env ENVELOPE_65FC, 221 +/* 0x08C1 [0xC7 0x01 0x2E 0x48 ] */ portamento 0x01, PITCH_G4, 72 +/* 0x08C5 [0x62 0x80 0xDC 0x64 ] */ notedv PITCH_G3, 220, 100 +/* 0x08C9 [0xFF ] */ end + +.channel CHAN_08CA +/* 0x08CA [0x88 0x08 0xCE ] */ ldlayer 0, LAYER_08CE +/* 0x08CD [0xFF ] */ end + +.layer LAYER_08CE +/* 0x08CE [0xC6 0x48 ] */ instr SF0_INST_72 +/* 0x08D0 [0xCB 0x65 0xD8 0xFB ] */ env ENVELOPE_65D8, 251 +/* 0x08D4 [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x08D8 [0x6B 0x60 0x64 ] */ notedv PITCH_E4, 96, 100 +/* 0x08DB [0xFF ] */ end + +.channel CHAN_08DC +/* 0x08DC [0x88 0x02 0xAD ] */ ldlayer 0, LAYER_02AD +/* 0x08DF [0xFF ] */ end + +.channel CHAN_08E0 +/* 0x08E0 [0x88 0x0B 0x7D ] */ ldlayer 0, LAYER_0B7D +/* 0x08E3 [0xFF ] */ end + +.channel CHAN_08E4 +/* 0x08E4 [0xC1 0x46 ] */ instr SF0_INST_70 +/* 0x08E6 [0xDA 0x66 0x74 ] */ env ENVELOPE_6674 +/* 0x08E9 [0x88 0x09 0x03 ] */ ldlayer 0, LAYER_0903 +CHAN_08EC: +/* 0x08EC [0xB8 0x0A ] */ rand 10 +/* 0x08EE [0xC7 0x02 0x09 0x04 ] */ stseq 2, LAYER_0903 + STSEQ_NOTEDV_DELAY_HI +/* 0x08F2 [0xC7 0x02 0x08 0xFD ] */ stseq 2, CHAN_08FC + STSEQ_LDI_IMM +/* 0x08F6 [0xB8 0x0C ] */ rand 12 +/* 0x08F8 [0xC7 0x5C 0x09 0x03 ] */ stseq (NOTEDV_OPCODE | PITCH_DF3), LAYER_0903 + STSEQ_NOTEDV_OPCODE_PITCH +CHAN_08FC: +/* 0x08FC [0xCC 0x01 ] */ ldi 1 +/* 0x08FE [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0901 [0xF4 0xE9 ] */ rjump CHAN_08EC + +.layer LAYER_0903 +/* 0x0903 [0x5B 0x50 0x50 ] */ notedv PITCH_C3, 80, 80 +/* 0x0906 [0xC0 0x05 ] */ ldelay 5 +/* 0x0908 [0xF4 0xF9 ] */ rjump LAYER_0903 + +.channel CHAN_090A +/* 0x090A [0x89 0x09 0x36 ] */ ldlayer 1, LAYER_0936 +/* 0x090D [0x88 0x09 0x11 ] */ ldlayer 0, LAYER_0911 +/* 0x0910 [0xFF ] */ end + +.layer LAYER_0911 +/* 0x0911 [0xC6 0x00 ] */ instr SF0_INST_0 +/* 0x0913 [0x64 0x0A 0x40 ] */ notedv PITCH_A3, 10, 64 +/* 0x0916 [0xC6 0x07 ] */ instr SF0_INST_7 +/* 0x0918 [0x69 0x18 0x5A ] */ notedv PITCH_D4, 24, 90 +/* 0x091B [0xFF ] */ end + +.channel CHAN_091C +/* 0x091C [0xED 0x14 ] */ gain 20 +/* 0x091E [0x88 0x09 0x27 ] */ ldlayer 0, LAYER_0927 +/* 0x0921 [0x89 0x09 0x36 ] */ ldlayer 1, LAYER_0936 +/* 0x0924 [0xFF ] */ end + +.layer LAYER_0925 +/* 0x0925 [0xC2 0xFC ] */ transpose -4 +.layer LAYER_0927 +/* 0x0927 [0xC6 0x00 ] */ instr SF0_INST_0 +/* 0x0929 [0xC7 0x83 0x1B 0xFF ] */ portamento 0x83, PITCH_C3, 255 +/* 0x092D [0x53 0x06 0x50 ] */ notedv PITCH_E2, 6, 80 +/* 0x0930 [0xC6 0x05 ] */ instr SF0_INST_5 +/* 0x0932 [0x5F 0x0F 0x5F ] */ notedv PITCH_E3, 15, 95 +/* 0x0935 [0xFF ] */ end + +.layer LAYER_0936 +/* 0x0936 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x0938 [0xC7 0x81 0x16 0xFF ] */ portamento 0x81, PITCH_G2, 255 +/* 0x093C [0x7C 0x1E 0x32 ] */ notedv PITCH_A5, 30, 50 +/* 0x093F [0xFF ] */ end + +.channel CHAN_0940 +/* 0x0940 [0x88 0x09 0x44 ] */ ldlayer 0, LAYER_0944 +/* 0x0943 [0xFF ] */ end + +.layer LAYER_0944 +/* 0x0944 [0xC6 0x48 ] */ instr SF0_INST_72 +/* 0x0946 [0xC4 ] */ legato +LAYER_0947: +/* 0x0947 [0xC7 0x81 0x0F 0xFF ] */ portamento 0x81, PITCH_C2, 255 +/* 0x094B [0x53 0x60 0x4B ] */ notedv PITCH_E2, 96, 75 +/* 0x094E [0xF4 0xF7 ] */ rjump LAYER_0947 + +.channel CHAN_0950 +/* 0x0950 [0xED 0x14 ] */ gain 20 +/* 0x0952 [0x88 0x09 0x25 ] */ ldlayer 0, LAYER_0925 +/* 0x0955 [0x89 0x2D 0x55 ] */ ldlayer 1, LAYER_2D55 +/* 0x0958 [0xFF ] */ end + +.channel CHAN_0959 +/* 0x0959 [0xC1 0x08 ] */ instr SF0_INST_8 +/* 0x095B [0xDA 0x66 0xEC ] */ env ENVELOPE_66EC +/* 0x095E [0x88 0x09 0x62 ] */ ldlayer 0, LAYER_0962 +/* 0x0961 [0xFF ] */ end + +.layer LAYER_0962 +/* 0x0962 [0xC7 0x81 0x24 0xFF ] */ portamento 0x81, PITCH_A3, 255 +/* 0x0966 [0x67 0x64 0x5F ] */ notedv PITCH_C4, 100, 95 +/* 0x0969 [0xFF ] */ end + +.channel CHAN_096A +/* 0x096A [0xED 0x1E ] */ gain 30 +/* 0x096C [0x88 0x09 0x73 ] */ ldlayer 0, LAYER_0973 +/* 0x096F [0x89 0x09 0x7E ] */ ldlayer 1, LAYER_097E +/* 0x0972 [0xFF ] */ end + +.layer LAYER_0973 +/* 0x0973 [0xC6 0x0F ] */ instr SF0_INST_15 +/* 0x0975 [0xC7 0x81 0x2B 0xFF ] */ portamento 0x81, PITCH_E4, 255 +/* 0x0979 [0x5F 0x80 0xB4 0x69 ] */ notedv PITCH_E3, FRAMERATE_CONST(180, 216), 105 +/* 0x097D [0xFF ] */ end + +.layer LAYER_097E +/* 0x097E [0xC6 0x50 ] */ instr SF0_INST_80 +/* 0x0980 [0xC7 0x81 0x14 0xFF ] */ portamento 0x81, PITCH_F2, 255 +/* 0x0984 [0x4E 0x80 0xB4 0x58 ] */ notedv PITCH_B1, FRAMERATE_CONST(180, 216), 88 +/* 0x0988 [0xFF ] */ end + +.channel CHAN_0989 +/* 0x0989 [0x88 0x09 0x90 ] */ ldlayer 0, LAYER_0990 +/* 0x098C [0x89 0x09 0x9A ] */ ldlayer 1, LAYER_099A +/* 0x098F [0xFF ] */ end + +.layer LAYER_0990 +/* 0x0990 [0xC2 0x32 ] */ transpose 50 +LAYER_0992: +/* 0x0992 [0xC6 0x46 ] */ instr SF0_INST_70 +/* 0x0994 [0x4F 0x06 0x48 ] */ notedv PITCH_C2, 6, 72 +/* 0x0997 [0xFF ] */ end + +.layer LAYER_0998 +/* 0x0998 [0xC2 0xFC ] */ transpose -4 +.layer LAYER_099A +/* 0x099A [0xC6 0x18 ] */ instr SF0_INST_24 +/* 0x099C [0x66 0x03 0x6E ] */ notedv PITCH_B3, 3, 110 +/* 0x099F [0xFF ] */ end + +.channel CHAN_09A0 +/* 0x09A0 [0x88 0x09 0xA4 ] */ ldlayer 0, LAYER_09A4 +/* 0x09A3 [0xFF ] */ end + +.layer LAYER_09A4 +/* 0x09A4 [0xC6 0x15 ] */ instr SF0_INST_21 +/* 0x09A6 [0xCB 0x66 0x4C 0xFD ] */ env ENVELOPE_664C, 253 +/* 0x09AA [0x65 0x05 0x64 ] */ notedv PITCH_BF3, 5, 100 +/* 0x09AD [0xFF ] */ end + +.channel CHAN_09AE +/* 0x09AE [0x88 0x09 0xB2 ] */ ldlayer 0, LAYER_09B2 +/* 0x09B1 [0xFF ] */ end + +.layer LAYER_09B2 +/* 0x09B2 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x09B4 [0xCB 0x66 0xE0 0xFB ] */ env ENVELOPE_66E0, 251 +/* 0x09B8 [0x5E 0x0A 0x50 ] */ notedv PITCH_EF3, 10, 80 +/* 0x09BB [0xFF ] */ end + +.channel CHAN_09BC +/* 0x09BC [0x88 0x09 0xC0 ] */ ldlayer 0, LAYER_09C0 +/* 0x09BF [0xFF ] */ end + +.layer LAYER_09C0 +/* 0x09C0 [0xC6 0x13 ] */ instr SF0_INST_19 +/* 0x09C2 [0xCB 0x66 0xE0 0xFB ] */ env ENVELOPE_66E0, 251 +/* 0x09C6 [0x5B 0x15 0x50 ] */ notedv PITCH_C3, 21, 80 +/* 0x09C9 [0xFF ] */ end + +.channel CHAN_09CA +/* 0x09CA [0x88 0x09 0xCE ] */ ldlayer 0, LAYER_09CE +/* 0x09CD [0xFF ] */ end + +.layer LAYER_09CE +/* 0x09CE [0xC6 0x3E ] */ instr SF0_INST_62 +/* 0x09D0 [0xCB 0x66 0xEC 0xFB ] */ env ENVELOPE_66EC, 251 +/* 0x09D4 [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x09D8 [0x5B 0x0C 0x64 ] */ notedv PITCH_C3, 12, 100 +/* 0x09DB [0xC6 0x13 ] */ instr SF0_INST_19 +/* 0x09DD [0xCB 0x67 0xA4 0xDD ] */ env ENVELOPE_67A4, 221 +/* 0x09E1 [0xC7 0x81 0x24 0xC8 ] */ portamento 0x81, PITCH_A3, 200 +/* 0x09E5 [0x5B 0x3C 0x64 ] */ notedv PITCH_C3, 60, 100 +/* 0x09E8 [0xFF ] */ end + +.channel CHAN_09E9 +/* 0x09E9 [0xED 0x1E ] */ gain 30 +/* 0x09EB [0x88 0x09 0xF2 ] */ ldlayer 0, LAYER_09F2 +/* 0x09EE [0x89 0x09 0xFC ] */ ldlayer 1, LAYER_09FC +/* 0x09F1 [0xFF ] */ end + +.layer LAYER_09F2 +/* 0x09F2 [0xC6 0x0F ] */ instr SF0_INST_15 +/* 0x09F4 [0xC7 0x81 0x2B 0xFF ] */ portamento 0x81, PITCH_E4, 255 +/* 0x09F8 [0x5F 0x1C 0x69 ] */ notedv PITCH_E3, 28, 105 +/* 0x09FB [0xFF ] */ end + +.layer LAYER_09FC +/* 0x09FC [0xC6 0x50 ] */ instr SF0_INST_80 +/* 0x09FE [0xC7 0x81 0x14 0xFF ] */ portamento 0x81, PITCH_F2, 255 +/* 0x0A02 [0x4E 0x1C 0x58 ] */ notedv PITCH_B1, 28, 88 +/* 0x0A05 [0xFF ] */ end + +.channel CHAN_0A06 +/* 0x0A06 [0x88 0x0A 0x0A ] */ ldlayer 0, LAYER_0A0A +/* 0x0A09 [0xFF ] */ end + +.layer LAYER_0A0A +/* 0x0A0A [0xC6 0x4F ] */ instr SF0_INST_79 +/* 0x0A0C [0xC2 0x30 ] */ transpose 48 +/* 0x0A0E [0x60 0x14 0x64 ] */ notedv PITCH_F3, 20, 100 +/* 0x0A11 [0x64 0x00 0x69 ] */ notedv PITCH_A3, 0, 105 +/* 0x0A14 [0xFF ] */ end + +.channel CHAN_0A15 +/* 0x0A15 [0xC1 0x0E ] */ instr SF0_INST_14 +/* 0x0A17 [0xDA 0x66 0xFC ] */ env ENVELOPE_66FC +/* 0x0A1A [0x88 0x0A 0x1E ] */ ldlayer 0, LAYER_0A1E +/* 0x0A1D [0xFF ] */ end + +.layer LAYER_0A1E +/* 0x0A1E [0x68 0xFD 0x00 0x40 ] */ notedv PITCH_DF4, 32000, 64 +/* 0x0A22 [0xFF ] */ end + +.channel CHAN_0A23 +/* 0x0A23 [0xC1 0x09 ] */ instr SF0_INST_9 +/* 0x0A25 [0xDA 0x66 0xEC ] */ env ENVELOPE_66EC +/* 0x0A28 [0x88 0x0A 0x2C ] */ ldlayer 0, LAYER_0A2C +/* 0x0A2B [0xFF ] */ end + +.layer LAYER_0A2C +/* 0x0A2C [0x60 0x05 0x4B ] */ notedv PITCH_F3, 5, 75 +/* 0x0A2F [0x59 0x0A 0x4B ] */ notedv PITCH_BF2, 10, 75 +/* 0x0A32 [0x59 0x11 0x4B ] */ notedv PITCH_BF2, 17, 75 +/* 0x0A35 [0xFF ] */ end + +.channel CHAN_0A36 +/* 0x0A36 [0x88 0x0A 0x3A ] */ ldlayer 0, LAYER_0A3A +/* 0x0A39 [0xFF ] */ end + +.layer LAYER_0A3A +/* 0x0A3A [0xC6 0x3F ] */ instr SF0_INST_63 +/* 0x0A3C [0x58 0x06 0x64 ] */ notedv PITCH_A2, 6, 100 +/* 0x0A3F [0xFF ] */ end + +.channel CHAN_0A40 +/* 0x0A40 [0x88 0x0A 0x4C ] */ ldlayer 0, LAYER_0A4C +/* 0x0A43 [0x89 0x0A 0x5D ] */ ldlayer 1, LAYER_0A5D +/* 0x0A46 [0x8A 0x0A 0x6E ] */ ldlayer 2, LAYER_0A6E +/* 0x0A49 [0xFB 0x11 0x8F ] */ jump CHAN_118F + +.layer LAYER_0A4C +/* 0x0A4C [0xC6 0x4A ] */ instr SF0_INST_74 +/* 0x0A4E [0xCF 0xDD ] */ releaserate 221 +/* 0x0A50 [0xC4 ] */ legato +/* 0x0A51 [0xC7 0x85 0x00 0xFF ] */ portamento 0x85, PITCH_A0, 255 +/* 0x0A55 [0x58 0x80 0xFA 0x4A ] */ notedv PITCH_A2, FRAMERATE_CONST(250, 300), 74 +/* 0x0A59 [0x70 0x64 0x4A ] */ notedv PITCH_A4, FRAMERATE_CONST(100, 120), 74 +/* 0x0A5C [0xFF ] */ end + +.layer LAYER_0A5D +/* 0x0A5D [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x0A5F [0xCF 0xDD ] */ releaserate 221 +/* 0x0A61 [0x64 0x80 0x1E 0x64 ] */ noteldv PITCH_A3, FRAMERATE_CONST(30, 36), 100 +/* 0x0A65 [0xC7 0x81 0x00 0xFF ] */ portamento 0x81, PITCH_A0, 255 +/* 0x0A69 [0x64 0x81 0x40 0x55 ] */ notedv PITCH_A3, FRAMERATE_CONST(320, 384), 85 +/* 0x0A6D [0xFF ] */ end + +.layer LAYER_0A6E +/* 0x0A6E [0xC6 0x45 ] */ instr SF0_INST_69 +/* 0x0A70 [0xCF 0xDD ] */ releaserate 221 +/* 0x0A72 [0xC7 0x81 0x00 0xFF ] */ portamento 0x81, PITCH_A0, 255 +/* 0x0A76 [0x70 0x81 0x5E 0x50 ] */ notedv PITCH_A4, FRAMERATE_CONST(350, 420), 80 +/* 0x0A7A [0xFF ] */ end + +.channel CHAN_0A7B +/* 0x0A7B [0x88 0x0A 0x85 ] */ ldlayer 0, LAYER_0A85 +/* 0x0A7E [0x89 0x0A 0x9E ] */ ldlayer 1, LAYER_0A9E +/* 0x0A81 [0x8A 0x0A 0xAF ] */ ldlayer 2, LAYER_0AAF +/* 0x0A84 [0xFF ] */ end + +.layer LAYER_0A85 +/* 0x0A85 [0xFC 0x0A 0x95 ] */ call LAYER_0A95 +/* 0x0A88 [0xC4 ] */ legato +/* 0x0A89 [0xC7 0x85 0x3E 0xFF ] */ portamento 0x85, PITCH_B5, 255 +/* 0x0A8D [0x67 0x3C 0x55 ] */ notedv PITCH_C4, FRAMERATE_CONST(60, 66), 85 +/* 0x0A90 [0x78 0x81 0xF4 0x55 ] */ notedv PITCH_F5, FRAMERATE_CONST(500, 550), 85 +/* 0x0A94 [0xFF ] */ end + +.layer LAYER_0A95 +/* 0x0A95 [0xC6 0x3C ] */ instr SF0_INST_60 +/* 0x0A97 [0xCB 0x68 0x08 0xC8 ] */ env ENVELOPE_6808, 200 +/* 0x0A9B [0xC2 0x0C ] */ transpose 12 +/* 0x0A9D [0xFF ] */ end + +.layer LAYER_0A9E +/* 0x0A9E [0xC7 0x81 0x20 0xFF ] */ portamento 0x81, PITCH_F3, 255 +/* 0x0AA2 [0xC6 0x0D ] */ instr SF0_INST_13 +/* 0x0AA4 [0xC2 0x18 ] */ transpose 24 +/* 0x0AA6 [0xCB 0x66 0xF4 0xC8 ] */ env ENVELOPE_66F4, 200 +/* 0x0AAA [0x78 0x82 0x30 0x28 ] */ notedv PITCH_F5, FRAMERATE_CONST(560, 616), 40 +/* 0x0AAE [0xFF ] */ end + +.layer LAYER_0AAF +/* 0x0AAF [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x0AB1 [0xC2 0x0C ] */ transpose 12 +/* 0x0AB3 [0xCB 0x67 0xD8 0xC8 ] */ env ENVELOPE_67D8, 200 +/* 0x0AB7 [0x78 0x82 0x30 0x46 ] */ notedv PITCH_F5, FRAMERATE_CONST(560, 616), 70 +/* 0x0ABB [0xFF ] */ end + +.channel CHAN_0ABC +/* 0x0ABC [0xC1 0x44 ] */ instr SF0_INST_68 +/* 0x0ABE [0xED 0x0F ] */ gain 15 +/* 0x0AC0 [0x88 0x21 0x30 ] */ ldlayer 0, LAYER_2130 +/* 0x0AC3 [0x89 0x21 0x24 ] */ ldlayer 1, LAYER_2124 +/* 0x0AC6 [0x8A 0x2D 0x3A ] */ ldlayer 2, LAYER_2D3A +/* 0x0AC9 [0xCC 0x50 ] */ ldi 80 +/* 0x0ACB [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0ACE [0x88 0x0A 0xD5 ] */ ldlayer 0, LAYER_0AD5 +/* 0x0AD1 [0x8A 0x21 0x0B ] */ ldlayer 2, LAYER_210B +/* 0x0AD4 [0xFF ] */ end + +.layer LAYER_0AD5 +/* 0x0AD5 [0xC0 0x30 ] */ ldelay 48 +/* 0x0AD7 [0xFF ] */ end + +.channel CHAN_0AD8 +/* 0x0AD8 [0xCC 0x00 ] */ ldi 0 +CHAN_0ADA: +/* 0x0ADA [0xC7 0xF4 0x0A 0xFE ] */ stseq 244, LAYER_0AFD + STSEQ_TRANSPOSITION +/* 0x0ADE [0xC7 0x0C 0x0A 0xF3 ] */ stseq 12, LAYER_0AF2 + STSEQ_TRANSPOSITION +/* 0x0AE2 [0xD7 0xFF ] */ vibfreq 255 +/* 0x0AE4 [0xC1 0x44 ] */ instr SF0_INST_68 +/* 0x0AE6 [0xDA 0x68 0x18 ] */ env ENVELOPE_6818 +/* 0x0AE9 [0xD9 0xEB ] */ releaserate 235 +/* 0x0AEB [0x88 0x0A 0xFD ] */ ldlayer 0, LAYER_0AFD +/* 0x0AEE [0x89 0x0A 0xF2 ] */ ldlayer 1, LAYER_0AF2 +/* 0x0AF1 [0xFF ] */ end + +.layer LAYER_0AF2 +/* 0x0AF2 [0xC2 0x24 ] */ transpose 36 +/* 0x0AF4 [0xC7 0x83 0x2C 0x7F ] */ portamento 0x83, PITCH_F4, 127 +LAYER_0AF8: +/* 0x0AF8 [0x70 0x60 0x40 ] */ notedv PITCH_A4, FRAMERATE_CONST(96, 115), 64 +/* 0x0AFB [0xF4 0xFB ] */ rjump LAYER_0AF8 + +.layer LAYER_0AFD +/* 0x0AFD [0xC2 0x0C ] */ transpose 12 +/* 0x0AFF [0xC7 0x83 0x2C 0x7F ] */ portamento 0x83, PITCH_F4, 127 +LAYER_0B03: +/* 0x0B03 [0x70 0x60 0x40 ] */ notedv PITCH_A4, FRAMERATE_CONST(96, 115), 64 +/* 0x0B06 [0xF4 0xFB ] */ rjump LAYER_0B03 + +.channel CHAN_0B08 +/* 0x0B08 [0x88 0x0B 0x23 ] */ ldlayer 0, LAYER_0B23 +/* 0x0B0B [0x8A 0x0B 0x1D ] */ ldlayer 2, LAYER_0B1D +/* 0x0B0E [0xCC 0x01 ] */ ldi 1 +/* 0x0B10 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0B13 [0x89 0x0B 0x2F ] */ ldlayer 1, LAYER_0B2F +/* 0x0B16 [0xD7 0x60 ] */ vibfreq 96 +/* 0x0B18 [0xE2 0x80 0x80 0x00 ] */ vibdepthgrad 128, 128, 0 +/* 0x0B1C [0xFF ] */ end + +.layer LAYER_0B1D +/* 0x0B1D [0xC6 0x43 ] */ instr SF0_INST_67 +/* 0x0B1F [0x64 0x00 0x6E ] */ notedv PITCH_A3, 0, 110 +/* 0x0B22 [0xFF ] */ end + +.layer LAYER_0B23 +/* 0x0B23 [0xC6 0x3C ] */ instr SF0_INST_60 +/* 0x0B25 [0xCB 0x66 0xFC 0xF5 ] */ env ENVELOPE_66FC, 245 +/* 0x0B29 [0xC4 ] */ legato +LAYER_0B2A: +/* 0x0B2A [0x64 0x64 0x4A ] */ notedv PITCH_A3, 100, 74 +/* 0x0B2D [0xF4 0xFB ] */ rjump LAYER_0B2A + +.layer LAYER_0B2F +/* 0x0B2F [0xC6 0x45 ] */ instr SF0_INST_69 +/* 0x0B31 [0xC4 ] */ legato +LAYER_0B32: +/* 0x0B32 [0x5D 0x00 0x23 ] */ notedv PITCH_D3, 0, 35 +/* 0x0B35 [0xF4 0xFB ] */ rjump LAYER_0B32 + +.channel CHAN_0B37 +/* 0x0B37 [0x88 0x0B 0x47 ] */ ldlayer 0, LAYER_0B47 +/* 0x0B3A [0x89 0x0B 0x41 ] */ ldlayer 1, LAYER_0B41 +/* 0x0B3D [0x8A 0x0B 0x57 ] */ ldlayer 2, LAYER_0B57 +/* 0x0B40 [0xFF ] */ end + +.layer LAYER_0B41 +/* 0x0B41 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x0B43 [0xC2 0x10 ] */ transpose 16 +/* 0x0B45 [0xF4 0x02 ] */ rjump LAYER_0B49 + +.layer LAYER_0B47 +/* 0x0B47 [0xC6 0x2E ] */ instr SF0_INST_46 +LAYER_0B49: +/* 0x0B49 [0xCB 0x68 0x18 0xF5 ] */ env ENVELOPE_6818, 245 +/* 0x0B4D [0xC4 ] */ legato +/* 0x0B4E [0xC7 0x81 0x27 0xC8 ] */ portamento 0x81, PITCH_C4, 200 +LAYER_0B52: +/* 0x0B52 [0x6B 0x3C 0x3C ] */ notedv PITCH_E4, 60, 60 +/* 0x0B55 [0xF4 0xFB ] */ rjump LAYER_0B52 + +.layer LAYER_0B57 +/* 0x0B57 [0xC6 0x43 ] */ instr SF0_INST_67 +/* 0x0B59 [0x6C 0x00 0x6E ] */ notedv PITCH_F4, 0, 110 +/* 0x0B5C [0xFF ] */ end + +.channel CHAN_0B5D +/* 0x0B5D [0x88 0x0B 0x6D ] */ ldlayer 0, LAYER_0B6D +/* 0x0B60 [0x89 0x0B 0x67 ] */ ldlayer 1, LAYER_0B67 +/* 0x0B63 [0x8A 0x0B 0x57 ] */ ldlayer 2, LAYER_0B57 +/* 0x0B66 [0xFF ] */ end + +.layer LAYER_0B67 +/* 0x0B67 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x0B69 [0xC2 0x10 ] */ transpose 16 +/* 0x0B6B [0xF4 0x02 ] */ rjump LAYER_0B6F + +.layer LAYER_0B6D +/* 0x0B6D [0xC6 0x40 ] */ instr SF0_INST_64 +LAYER_0B6F: +/* 0x0B6F [0xCB 0x66 0xC8 0xF0 ] */ env ENVELOPE_66C8, 240 +/* 0x0B73 [0xC4 ] */ legato +LAYER_0B74: +/* 0x0B74 [0x6E 0x51 0x2A ] */ notedv PITCH_G4, 81, 42 +/* 0x0B77 [0xF4 0xFB ] */ rjump LAYER_0B74 + +.channel CHAN_0B79 +/* 0x0B79 [0x88 0x02 0xA5 ] */ ldlayer 0, LAYER_02A5 +/* 0x0B7C [0xFF ] */ end + +.layer LAYER_0B7D +/* 0x0B7D [0xC0 0x08 ] */ ldelay 8 +/* 0x0B7F [0xC2 0xFA ] */ transpose -6 +/* 0x0B81 [0xC6 0x1C ] */ instr SF0_INST_28 +/* 0x0B83 [0xCF 0xFF ] */ releaserate 255 +/* 0x0B85 [0x25 0x04 0x40 0x40 ] */ notedvg PITCH_BF3, 4, 64, 64 +/* 0x0B89 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x0B8B [0x5C 0x05 0x18 ] */ notedv PITCH_DF3, 5, 24 +/* 0x0B8E [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x0B90 [0xC2 0x30 ] */ transpose 48 +/* 0x0B92 [0x63 0x04 0x26 ] */ notedv PITCH_AF3, 4, 38 +/* 0x0B95 [0xFF ] */ end + +.channel CHAN_0B96 +/* 0x0B96 [0x88 0x02 0xC1 ] */ ldlayer 0, LAYER_02C1 +/* 0x0B99 [0xFF ] */ end + +.channel CHAN_0B9A +/* 0x0B9A [0x88 0x02 0xD0 ] */ ldlayer 0, LAYER_02D0 +/* 0x0B9D [0xFF ] */ end + +.channel CHAN_0B9E +/* 0x0B9E [0x88 0x02 0xDC ] */ ldlayer 0, LAYER_02DC +/* 0x0BA1 [0xFF ] */ end + +.channel CHAN_0BA2 +/* 0x0BA2 [0x88 0x02 0xEC ] */ ldlayer 0, LAYER_02EC +/* 0x0BA5 [0xFF ] */ end + +.channel CHAN_0BA6 +/* 0x0BA6 [0x88 0x02 0xF8 ] */ ldlayer 0, LAYER_02F8 +/* 0x0BA9 [0xFF ] */ end + +.channel CHAN_0BAA +/* 0x0BAA [0x88 0x03 0x04 ] */ ldlayer 0, LAYER_0304 +/* 0x0BAD [0xFF ] */ end + +.channel CHAN_0BAE +/* 0x0BAE [0x88 0x03 0x17 ] */ ldlayer 0, LAYER_0317 +/* 0x0BB1 [0xFF ] */ end + +.channel CHAN_0BB2 +/* 0x0BB2 [0x88 0x03 0x31 ] */ ldlayer 0, LAYER_0331 +/* 0x0BB5 [0xFF ] */ end + +.channel CHAN_0BB6 +/* 0x0BB6 [0x88 0x03 0x41 ] */ ldlayer 0, LAYER_0341 +/* 0x0BB9 [0xFF ] */ end + +.channel CHAN_0BBA +/* 0x0BBA [0x88 0x03 0x4D ] */ ldlayer 0, LAYER_034D +/* 0x0BBD [0xFF ] */ end + +.channel CHAN_0BBE +/* 0x0BBE [0x88 0x03 0x59 ] */ ldlayer 0, LAYER_0359 +/* 0x0BC1 [0xFF ] */ end + +.channel CHAN_0BC2 +/* 0x0BC2 [0x88 0x03 0x68 ] */ ldlayer 0, LAYER_0368 +/* 0x0BC5 [0x89 0x0B 0x7D ] */ ldlayer 1, LAYER_0B7D +/* 0x0BC8 [0xFF ] */ end + +.channel CHAN_0BC9 +/* 0x0BC9 [0x88 0x03 0x8E ] */ ldlayer 0, LAYER_038E +/* 0x0BCC [0xFF ] */ end + +.channel CHAN_0BCD +/* 0x0BCD [0xC1 0x00 ] */ instr SF0_INST_0 +/* 0x0BCF [0x88 0x03 0x9F ] */ ldlayer 0, LAYER_039F +/* 0x0BD2 [0x89 0x0B 0xD6 ] */ ldlayer 1, LAYER_0BD6 +/* 0x0BD5 [0xFF ] */ end + +.layer LAYER_0BD6 +/* 0x0BD6 [0xC0 0x08 ] */ ldelay 8 +/* 0x0BD8 [0xC6 0x1C ] */ instr SF0_INST_28 +/* 0x0BDA [0xCF 0xFF ] */ releaserate 255 +/* 0x0BDC [0x27 0x04 0x5A 0x40 ] */ notedvg PITCH_C4, 4, 90, 64 +/* 0x0BE0 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x0BE2 [0x5F 0x05 0x26 ] */ notedv PITCH_E3, 5, 38 +/* 0x0BE5 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x0BE7 [0xC2 0x30 ] */ transpose 48 +/* 0x0BE9 [0x67 0x04 0x37 ] */ notedv PITCH_C4, 4, 55 +/* 0x0BEC [0xFF ] */ end + +.channel CHAN_0BED +/* 0x0BED [0x88 0x03 0xCC ] */ ldlayer 0, LAYER_03CC +/* 0x0BF0 [0x89 0x0B 0xD6 ] */ ldlayer 1, LAYER_0BD6 +/* 0x0BF3 [0xFF ] */ end + +.channel CHAN_0BF4 +/* 0x0BF4 [0x88 0x03 0xE3 ] */ ldlayer 0, LAYER_03E3 +/* 0x0BF7 [0x89 0x0B 0xD6 ] */ ldlayer 1, LAYER_0BD6 +/* 0x0BFA [0xFF ] */ end + +.channel CHAN_0BFB +/* 0x0BFB [0x88 0x03 0xF9 ] */ ldlayer 0, LAYER_03F9 +/* 0x0BFE [0x89 0x0B 0xD6 ] */ ldlayer 1, LAYER_0BD6 +/* 0x0C01 [0xFF ] */ end + +.channel CHAN_0C02 +/* 0x0C02 [0x88 0x04 0x0D ] */ ldlayer 0, LAYER_040D +/* 0x0C05 [0x89 0x0B 0xD6 ] */ ldlayer 1, LAYER_0BD6 +/* 0x0C08 [0xFF ] */ end + +.channel CHAN_0C09 +/* 0x0C09 [0x88 0x04 0x1F ] */ ldlayer 0, LAYER_041F +/* 0x0C0C [0xFF ] */ end + +.channel CHAN_0C0D +/* 0x0C0D [0x88 0x04 0x31 ] */ ldlayer 0, LAYER_0431 +/* 0x0C10 [0x89 0x0B 0xD6 ] */ ldlayer 1, LAYER_0BD6 +/* 0x0C13 [0xFF ] */ end + +.channel CHAN_0C14 +/* 0x0C14 [0x88 0x04 0x4A ] */ ldlayer 0, LAYER_044A +/* 0x0C17 [0x89 0x0B 0xD6 ] */ ldlayer 1, LAYER_0BD6 +/* 0x0C1A [0xFF ] */ end + +.channel CHAN_0C1B +/* 0x0C1B [0x88 0x04 0x6C ] */ ldlayer 0, LAYER_046C +/* 0x0C1E [0x89 0x0B 0xD6 ] */ ldlayer 1, LAYER_0BD6 +/* 0x0C21 [0xFF ] */ end + +.channel CHAN_0C22 +/* 0x0C22 [0x88 0x04 0x80 ] */ ldlayer 0, LAYER_0480 +/* 0x0C25 [0x89 0x0B 0xD6 ] */ ldlayer 1, LAYER_0BD6 +/* 0x0C28 [0xFF ] */ end + +.channel CHAN_0C29 +/* 0x0C29 [0x88 0x04 0x94 ] */ ldlayer 0, LAYER_0494 +/* 0x0C2C [0x89 0x0B 0xD6 ] */ ldlayer 1, LAYER_0BD6 +/* 0x0C2F [0xFF ] */ end + +.channel CHAN_0C30 +/* 0x0C30 [0x88 0x04 0xA6 ] */ ldlayer 0, LAYER_04A6 +/* 0x0C33 [0x89 0x0B 0xD6 ] */ ldlayer 1, LAYER_0BD6 +/* 0x0C36 [0xFF ] */ end + +.channel CHAN_0C37 +/* 0x0C37 [0x88 0x04 0xF1 ] */ ldlayer 0, LAYER_04F1 +/* 0x0C3A [0x89 0x0B 0xD6 ] */ ldlayer 1, LAYER_0BD6 +/* 0x0C3D [0xFF ] */ end + +.channel CHAN_0C3E +/* 0x0C3E [0x88 0x05 0x05 ] */ ldlayer 0, LAYER_0505 +/* 0x0C41 [0x89 0x0C 0x45 ] */ ldlayer 1, LAYER_0C45 +/* 0x0C44 [0xFF ] */ end + +.layer LAYER_0C45 +/* 0x0C45 [0xC0 0x08 ] */ ldelay 8 +/* 0x0C47 [0xC6 0x1C ] */ instr SF0_INST_28 +/* 0x0C49 [0xCF 0xFF ] */ releaserate 255 +/* 0x0C4B [0x29 0x04 0x5A 0x40 ] */ notedvg PITCH_D4, 4, 90, 64 +/* 0x0C4F [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x0C51 [0x5D 0x05 0x26 ] */ notedv PITCH_D3, 5, 38 +/* 0x0C54 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x0C56 [0xC2 0x30 ] */ transpose 48 +/* 0x0C58 [0x65 0x04 0x37 ] */ notedv PITCH_BF3, 4, 55 +/* 0x0C5B [0xFF ] */ end + +.channel CHAN_0C5C +/* 0x0C5C [0x88 0x05 0x34 ] */ ldlayer 0, LAYER_0534 +/* 0x0C5F [0x89 0x0C 0x45 ] */ ldlayer 1, LAYER_0C45 +/* 0x0C62 [0xFF ] */ end + +.channel CHAN_0C63 +/* 0x0C63 [0x88 0x05 0x49 ] */ ldlayer 0, LAYER_0549 +/* 0x0C66 [0x89 0x0C 0x45 ] */ ldlayer 1, LAYER_0C45 +/* 0x0C69 [0xFF ] */ end + +.channel CHAN_0C6A +/* 0x0C6A [0x88 0x05 0x5F ] */ ldlayer 0, LAYER_055F +/* 0x0C6D [0x89 0x0C 0x45 ] */ ldlayer 1, LAYER_0C45 +/* 0x0C70 [0xFF ] */ end + +.channel CHAN_0C71 +/* 0x0C71 [0x88 0x05 0x73 ] */ ldlayer 0, LAYER_0573 +/* 0x0C74 [0x89 0x0C 0x45 ] */ ldlayer 1, LAYER_0C45 +/* 0x0C77 [0xFF ] */ end + +.channel CHAN_0C78 +/* 0x0C78 [0x88 0x05 0x85 ] */ ldlayer 0, LAYER_0585 +/* 0x0C7B [0xFF ] */ end + +.channel CHAN_0C7C +/* 0x0C7C [0x88 0x05 0x97 ] */ ldlayer 0, LAYER_0597 +/* 0x0C7F [0x89 0x0C 0x45 ] */ ldlayer 1, LAYER_0C45 +/* 0x0C82 [0xFF ] */ end + +.channel CHAN_0C83 +/* 0x0C83 [0x88 0x05 0xB0 ] */ ldlayer 0, LAYER_05B0 +/* 0x0C86 [0x89 0x0C 0x45 ] */ ldlayer 1, LAYER_0C45 +/* 0x0C89 [0xFF ] */ end + +.channel CHAN_0C8A +/* 0x0C8A [0x88 0x05 0xD0 ] */ ldlayer 0, LAYER_05D0 +/* 0x0C8D [0x89 0x0C 0x45 ] */ ldlayer 1, LAYER_0C45 +/* 0x0C90 [0xFF ] */ end + +.channel CHAN_0C91 +/* 0x0C91 [0x88 0x05 0xE4 ] */ ldlayer 0, LAYER_05E4 +/* 0x0C94 [0x89 0x0C 0x45 ] */ ldlayer 1, LAYER_0C45 +/* 0x0C97 [0xFF ] */ end + +.channel CHAN_0C98 +/* 0x0C98 [0x88 0x05 0xF8 ] */ ldlayer 0, LAYER_05F8 +/* 0x0C9B [0x89 0x0C 0x45 ] */ ldlayer 1, LAYER_0C45 +/* 0x0C9E [0xFF ] */ end + +.channel CHAN_0C9F +/* 0x0C9F [0x88 0x06 0x0A ] */ ldlayer 0, LAYER_060A +/* 0x0CA2 [0x89 0x0C 0x45 ] */ ldlayer 1, LAYER_0C45 +/* 0x0CA5 [0xFF ] */ end + +.channel CHAN_0CA6 +/* 0x0CA6 [0x88 0x06 0x39 ] */ ldlayer 0, LAYER_0639 +/* 0x0CA9 [0x89 0x0C 0x45 ] */ ldlayer 1, LAYER_0C45 +/* 0x0CAC [0xFF ] */ end + +.channel CHAN_0CAD +/* 0x0CAD [0x88 0x02 0xA5 ] */ ldlayer 0, LAYER_02A5 +/* 0x0CB0 [0xCC 0x02 ] */ ldi 2 +/* 0x0CB2 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0CB5 [0xFB 0x07 0x96 ] */ jump CHAN_0796 + +.channel CHAN_0CB8 +/* 0x0CB8 [0x88 0x02 0xC1 ] */ ldlayer 0, LAYER_02C1 +/* 0x0CBB [0xCC 0x05 ] */ ldi 5 +/* 0x0CBD [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0CC0 [0xFB 0x07 0xA0 ] */ jump CHAN_07A0 + +.channel CHAN_0CC3 +/* 0x0CC3 [0x88 0x02 0xD0 ] */ ldlayer 0, LAYER_02D0 +/* 0x0CC6 [0xCC 0x02 ] */ ldi 2 +/* 0x0CC8 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0CCB [0xFB 0x07 0xA7 ] */ jump CHAN_07A7 + +.channel CHAN_0CCE +/* 0x0CCE [0x88 0x02 0xDC ] */ ldlayer 0, LAYER_02DC +/* 0x0CD1 [0xCC 0x05 ] */ ldi 5 +/* 0x0CD3 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0CD6 [0xFB 0x07 0xAE ] */ jump CHAN_07AE + +.channel CHAN_0CD9 +/* 0x0CD9 [0x88 0x02 0xEC ] */ ldlayer 0, LAYER_02EC +/* 0x0CDC [0xCC 0x05 ] */ ldi 5 +/* 0x0CDE [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0CE1 [0xFB 0x07 0xB5 ] */ jump CHAN_07B5 + +.channel CHAN_0CE4 +/* 0x0CE4 [0x88 0x02 0xF8 ] */ ldlayer 0, LAYER_02F8 +/* 0x0CE7 [0xCC 0x05 ] */ ldi 5 +/* 0x0CE9 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0CEC [0xFB 0x07 0xBC ] */ jump CHAN_07BC + +.channel CHAN_0CEF +/* 0x0CEF [0x88 0x03 0x04 ] */ ldlayer 0, LAYER_0304 +/* 0x0CF2 [0xCC 0x05 ] */ ldi 5 +/* 0x0CF4 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0CF7 [0xFB 0x07 0xC3 ] */ jump CHAN_07C3 + +.channel CHAN_0CFA +/* 0x0CFA [0x88 0x03 0x17 ] */ ldlayer 0, LAYER_0317 +/* 0x0CFD [0xCC 0x05 ] */ ldi 5 +/* 0x0CFF [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0D02 [0xFB 0x07 0xCA ] */ jump CHAN_07CA + +.channel CHAN_0D05 +/* 0x0D05 [0x88 0x03 0x31 ] */ ldlayer 0, LAYER_0331 +/* 0x0D08 [0xCC 0x05 ] */ ldi 5 +/* 0x0D0A [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0D0D [0xFB 0x07 0xD1 ] */ jump CHAN_07D1 + +.channel CHAN_0D10 +/* 0x0D10 [0x88 0x03 0x41 ] */ ldlayer 0, LAYER_0341 +/* 0x0D13 [0xCC 0x05 ] */ ldi 5 +/* 0x0D15 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0D18 [0xFB 0x07 0xD8 ] */ jump CHAN_07D8 + +.channel CHAN_0D1B +/* 0x0D1B [0x88 0x03 0x4D ] */ ldlayer 0, LAYER_034D +/* 0x0D1E [0xCC 0x05 ] */ ldi 5 +/* 0x0D20 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0D23 [0xFB 0x07 0xDF ] */ jump CHAN_07DF + +.channel CHAN_0D26 +/* 0x0D26 [0x88 0x03 0x59 ] */ ldlayer 0, LAYER_0359 +/* 0x0D29 [0xCC 0x01 ] */ ldi 1 +/* 0x0D2B [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0D2E [0xFB 0x07 0xE6 ] */ jump CHAN_07E6 + +.channel CHAN_0D31 +/* 0x0D31 [0x88 0x03 0x8E ] */ ldlayer 0, LAYER_038E +/* 0x0D34 [0xCC 0x05 ] */ ldi 5 +/* 0x0D36 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x0D39 [0xFB 0x07 0xA7 ] */ jump CHAN_07A7 + +.channel CHAN_0D3C +/* 0x0D3C [0xD8 0x14 ] */ vibdepth 20 +/* 0x0D3E [0xCC 0x04 ] */ ldi 4 +/* 0x0D40 [0xFB 0x0A 0xDA ] */ jump CHAN_0ADA + +.channel CHAN_0D43 +/* 0x0D43 [0x88 0x0D 0x47 ] */ ldlayer 0, LAYER_0D47 +/* 0x0D46 [0xFF ] */ end + +.layer LAYER_0D47 +/* 0x0D47 [0xC6 0x0C ] */ instr SF0_INST_12 +/* 0x0D49 [0xCB 0x66 0xA0 0xEB ] */ env ENVELOPE_66A0, 235 +/* 0x0D4D [0x6C 0x0A 0x5A ] */ notedv PITCH_F4, 10, 90 +/* 0x0D50 [0x6E 0x0E 0x5A ] */ notedv PITCH_G4, 14, 90 +/* 0x0D53 [0x72 0x7F 0x4B ] */ notedv PITCH_B4, 127, 75 +/* 0x0D56 [0xFF ] */ end + +.channel CHAN_0D57 +/* 0x0D57 [0x88 0x0D 0x5E ] */ ldlayer 0, LAYER_0D5E +/* 0x0D5A [0x89 0x1B 0x3F ] */ ldlayer 1, LAYER_1B3F +/* 0x0D5D [0xFF ] */ end + +.layer LAYER_0D5E +/* 0x0D5E [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x0D60 [0xCB 0x65 0xD8 0xE4 ] */ env ENVELOPE_65D8, 228 +/* 0x0D64 [0x73 0x64 0x64 ] */ notedv PITCH_C5, 100, 100 +/* 0x0D67 [0xFF ] */ end + +.channel CHAN_0D68 +/* 0x0D68 [0xC1 0x44 ] */ instr SF0_INST_68 +/* 0x0D6A [0x88 0x0D 0x74 ] */ ldlayer 0, LAYER_0D74 +/* 0x0D6D [0x89 0x29 0xFC ] */ ldlayer 1, LAYER_29FC +/* 0x0D70 [0x8A 0x2A 0x01 ] */ ldlayer 2, LAYER_2A01 +/* 0x0D73 [0xFF ] */ end + +.layer LAYER_0D74 +/* 0x0D74 [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x0D76 [0xC7 0x81 0x27 0x2D ] */ portamento 0x81, PITCH_C4, 45 +/* 0x0D7A [0x6B 0x81 0x18 0x3C ] */ notedv PITCH_E4, FRAMERATE_CONST(280, 336), 60 +/* 0x0D7E [0xFF ] */ end + +.channel CHAN_0D7F +/* 0x0D7F [0x88 0x0D 0x8A ] */ ldlayer 0, LAYER_0D8A +/* 0x0D82 [0x89 0x0D 0x9A ] */ ldlayer 1, LAYER_0D9A +/* 0x0D85 [0xD7 0xC0 ] */ vibfreq 192 +/* 0x0D87 [0xD8 0x20 ] */ vibdepth 32 +/* 0x0D89 [0xFF ] */ end + +.layer LAYER_0D8A +/* 0x0D8A [0xC6 0x83 ] */ instr FONTANY_INSTR_SQUARE +/* 0x0D8C [0xCB 0x68 0x18 0xDD ] */ env ENVELOPE_6818, 221 +/* 0x0D90 [0xC4 ] */ legato +/* 0x0D91 [0xC7 0x81 0x24 0x40 ] */ portamento 0x81, PITCH_A3, 64 +LAYER_0D95: +/* 0x0D95 [0x70 0x78 0x22 ] */ notedv PITCH_A4, 120, 34 +/* 0x0D98 [0xF4 0xFB ] */ rjump LAYER_0D95 + +.layer LAYER_0D9A +/* 0x0D9A [0xC6 0x40 ] */ instr SF0_INST_64 +/* 0x0D9C [0xCB 0x66 0xFC 0xED ] */ env ENVELOPE_66FC, 237 +/* 0x0DA0 [0xC7 0x83 0x24 0xFF ] */ portamento 0x83, PITCH_A3, 255 +LAYER_0DA4: +/* 0x0DA4 [0x67 0x14 0x55 ] */ notedv PITCH_C4, 20, 85 +/* 0x0DA7 [0xF4 0xFB ] */ rjump LAYER_0DA4 + +.channel CHAN_0DA9 +/* 0x0DA9 [0x88 0x0D 0xB8 ] */ ldlayer 0, LAYER_0DB8 +/* 0x0DAC [0x89 0x0D 0xB6 ] */ ldlayer 1, LAYER_0DB6 +CHAN_0DAF: +/* 0x0DAF [0xE1 0x0A 0x64 0x08 ] */ vibfreqgrad 10, 100, 8 +/* 0x0DB3 [0xD8 0x0F ] */ vibdepth 15 +/* 0x0DB5 [0xFF ] */ end + +.layer LAYER_0DB6 +/* 0x0DB6 [0xC2 0x18 ] */ transpose 24 +.layer LAYER_0DB8 +/* 0x0DB8 [0xC7 0x81 0x0F 0xFF ] */ portamento 0x81, PITCH_C2, 255 +.layer LAYER_0DBC +/* 0x0DBC [0xC6 0x87 ] */ instr FONTANY_INSTR_4PULSE +/* 0x0DBE [0xCB 0x66 0x74 0xFB ] */ env ENVELOPE_6674, 251 +/* 0x0DC2 [0xC4 ] */ legato +LAYER_0DC3: +/* 0x0DC3 [0x67 0x81 0xF4 0x23 ] */ notedv PITCH_C4, FRAMERATE_CONST(500, 600), 35 +/* 0x0DC7 [0xF4 0xFA ] */ rjump LAYER_0DC3 + +.channel CHAN_0DC9 +/* 0x0DC9 [0x88 0x0D 0xB6 ] */ ldlayer 0, LAYER_0DB6 +/* 0x0DCC [0xF4 0xE1 ] */ rjump CHAN_0DAF + +.channel CHAN_0DCE +/* 0x0DCE [0xC1 0x44 ] */ instr SF0_INST_68 +/* 0x0DD0 [0x88 0x0D 0xD7 ] */ ldlayer 0, LAYER_0DD7 +/* 0x0DD3 [0x89 0x2A 0x01 ] */ ldlayer 1, LAYER_2A01 +/* 0x0DD6 [0xFF ] */ end + +.layer LAYER_0DD7 +/* 0x0DD7 [0xC2 0x1E ] */ transpose 30 +/* 0x0DD9 [0xC4 ] */ legato +/* 0x0DDA [0xC7 0x81 0x2B 0x40 ] */ portamento 0x81, PITCH_E4, 64 +/* 0x0DDE [0x69 0x80 0xAA 0x50 ] */ notedv PITCH_D4, FRAMERATE_CONST(170, 204), 80 +/* 0x0DE2 [0xFF ] */ end + +.channel CHAN_0DE3 +/* 0x0DE3 [0xC1 0x44 ] */ instr SF0_INST_68 +/* 0x0DE5 [0xD8 0x09 ] */ vibdepth 9 +/* 0x0DE7 [0xD7 0x80 ] */ vibfreq 128 +/* 0x0DE9 [0xDA 0x68 0x18 ] */ env ENVELOPE_6818 +/* 0x0DEC [0xD9 0xEB ] */ releaserate 235 +/* 0x0DEE [0x88 0x0D 0xF2 ] */ ldlayer 0, LAYER_0DF2 +/* 0x0DF1 [0xFF ] */ end + +.layer LAYER_0DF2 +/* 0x0DF2 [0xC4 ] */ legato +LAYER_0DF3: +/* 0x0DF3 [0x77 0xFD 0x00 0x5F ] */ notedv PITCH_E5, 32000, 95 +/* 0x0DF7 [0xF4 0xFA ] */ rjump LAYER_0DF3 + +.channel CHAN_0DF9 +/* 0x0DF9 [0x88 0x0D 0xBC ] */ ldlayer 0, LAYER_0DBC +/* 0x0DFC [0x89 0x0E 0x04 ] */ ldlayer 1, LAYER_0E04 +/* 0x0DFF [0xD7 0x64 ] */ vibfreq 100 +/* 0x0E01 [0xD8 0x0F ] */ vibdepth 15 +/* 0x0E03 [0xFF ] */ end + +.layer LAYER_0E04 +/* 0x0E04 [0xC2 0x18 ] */ transpose 24 +/* 0x0E06 [0xF4 0xB4 ] */ rjump LAYER_0DBC + +.channel CHAN_0E08 +/* 0x0E08 [0x88 0x0E 0x0C ] */ ldlayer 0, LAYER_0E0C +/* 0x0E0B [0xFF ] */ end + +.layer LAYER_0E0C +/* 0x0E0C [0xC6 0x0C ] */ instr SF0_INST_12 +LAYER_0E0E: +/* 0x0E0E [0xCB 0x67 0x04 0xFB ] */ env ENVELOPE_6704, 251 +/* 0x0E12 [0xC4 ] */ legato +LAYER_0E13: +/* 0x0E13 [0x67 0x7F 0x58 ] */ notedv PITCH_C4, 127, 88 +/* 0x0E16 [0xF4 0xFB ] */ rjump LAYER_0E13 + +.channel CHAN_0E18 +/* 0x0E18 [0x88 0x0E 0x1C ] */ ldlayer 0, LAYER_0E1C +/* 0x0E1B [0xFF ] */ end + +.layer LAYER_0E1C +/* 0x0E1C [0xC6 0x0D ] */ instr SF0_INST_13 +/* 0x0E1E [0xF4 0xEE ] */ rjump LAYER_0E0E + +.channel CHAN_0E20 +/* 0x0E20 [0x88 0x0E 0x24 ] */ ldlayer 0, LAYER_0E24 +/* 0x0E23 [0xFF ] */ end + +.layer LAYER_0E24 +/* 0x0E24 [0xC6 0x0E ] */ instr SF0_INST_14 +/* 0x0E26 [0xCB 0x67 0x04 0xFB ] */ env ENVELOPE_6704, 251 +/* 0x0E2A [0xC4 ] */ legato +LAYER_0E2B: +/* 0x0E2B [0x6C 0x7F 0x50 ] */ notedv PITCH_F4, 127, 80 +/* 0x0E2E [0xF4 0xFB ] */ rjump LAYER_0E2B + +.channel CHAN_0E30 +/* 0x0E30 [0x88 0x0E 0x34 ] */ ldlayer 0, LAYER_0E34 +/* 0x0E33 [0xFF ] */ end + +.layer LAYER_0E34 +/* 0x0E34 [0xC6 0x10 ] */ instr SF0_INST_16 +/* 0x0E36 [0xF4 0xD6 ] */ rjump LAYER_0E0E + +.channel CHAN_0E38 +/* 0x0E38 [0x88 0x0E 0x3C ] */ ldlayer 0, LAYER_0E3C +/* 0x0E3B [0xFF ] */ end + +.layer LAYER_0E3C +/* 0x0E3C [0xC6 0x10 ] */ instr SF0_INST_16 +/* 0x0E3E [0xCB 0x67 0x04 0xFB ] */ env ENVELOPE_6704, 251 +/* 0x0E42 [0xC4 ] */ legato +LAYER_0E43: +/* 0x0E43 [0x67 0x7F 0x56 ] */ notedv PITCH_C4, 127, 86 +/* 0x0E46 [0xF4 0xFB ] */ rjump LAYER_0E43 + +.channel CHAN_0E48 +/* 0x0E48 [0x88 0x0E 0x4C ] */ ldlayer 0, LAYER_0E4C +/* 0x0E4B [0xFF ] */ end + +.layer LAYER_0E4C +/* 0x0E4C [0xC6 0x11 ] */ instr SF0_INST_17 +/* 0x0E4E [0xF4 0xBE ] */ rjump LAYER_0E0E + +.channel CHAN_0E50 +/* 0x0E50 [0x88 0x0E 0x54 ] */ ldlayer 0, LAYER_0E54 +/* 0x0E53 [0xFF ] */ end + +.layer LAYER_0E54 +/* 0x0E54 [0xC6 0x0E ] */ instr SF0_INST_14 +/* 0x0E56 [0xCB 0x67 0x04 0xFB ] */ env ENVELOPE_6704, 251 +/* 0x0E5A [0xC4 ] */ legato +LAYER_0E5B: +/* 0x0E5B [0x63 0x7F 0x50 ] */ notedv PITCH_AF3, 127, 80 +/* 0x0E5E [0xF4 0xFB ] */ rjump LAYER_0E5B + +.channel CHAN_0E60 +/* 0x0E60 [0x88 0x0E 0x64 ] */ ldlayer 0, LAYER_0E64 +/* 0x0E63 [0xFF ] */ end + +.layer LAYER_0E64 +/* 0x0E64 [0xC6 0x0D ] */ instr SF0_INST_13 +/* 0x0E66 [0xCB 0x67 0x04 0xFB ] */ env ENVELOPE_6704, 251 +/* 0x0E6A [0xC4 ] */ legato +LAYER_0E6B: +/* 0x0E6B [0x5C 0x7F 0x5F ] */ notedv PITCH_DF3, 127, 95 +/* 0x0E6E [0xF4 0xFB ] */ rjump LAYER_0E6B + +.filter FILTER_0E70 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.filter FILTER_0E80 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.filter FILTER_0E90 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.channel itembank_handler_1 +/* 0x0EA0 [0xB0 0x16 0x60 ] */ ldfilter FILTER_1660 +/* 0x0EA3 [0xF4 0x03 ] */ rjump CHAN_0EA8 + +.channel itembank_handler_2 +/* 0x0EA5 [0xB0 0x16 0x70 ] */ ldfilter FILTER_1670 +CHAN_0EA8: +/* 0x0EA8 [0xC2 0x0E 0xE3 ] */ dyntbl itembank_table +/* 0x0EAB [0xFC 0x00 0x72 ] */ call CHAN_0072 +/* 0x0EAE [0xC6 0x00 ] */ font Soundfont_0_ID +/* 0x0EB0 [0xDC 0x7F ] */ panweight 127 +/* 0x0EB2 [0xB3 0x00 ] */ filter 0, 0 +CHAN_0EB4: +/* 0x0EB4 [0xFE ] */ delay1 +/* 0x0EB5 [0x60 ] */ ldio IO_PORT_0 +/* 0x0EB6 [0xC8 0x01 ] */ sub 1 +/* 0x0EB8 [0xF3 0x02 ] */ rbeqz CHAN_0EBC +/* 0x0EBA [0xF4 0xF8 ] */ rjump CHAN_0EB4 + +CHAN_0EBC: +/* 0x0EBC [0xFC 0x00 0x7C ] */ call CHAN_007C +/* 0x0EBF [0x92 ] */ dellayer 2 +/* 0x0EC0 [0xD8 0x00 ] */ vibdepth 0 +/* 0x0EC2 [0x64 ] */ ldio IO_PORT_SFX_INDEX_LOBITS +/* 0x0EC3 [0xE4 ] */ dyncall +CHAN_0EC4: +/* 0x0EC4 [0x63 ] */ ldio IO_PORT_3 +/* 0x0EC5 [0xC7 0x00 0x0E 0xCA ] */ stseq 0, STSEQ_HERE + STSEQ_FILTER_IDX +CHAN_0EC9: +/* 0x0EC9 [0xB3 0x0F ] */ filter 0, 15 +/* 0x0ECB [0xFC 0x00 0x84 ] */ call CHAN_0084 +/* 0x0ECE [0xFE ] */ delay1 +/* 0x0ECF [0x60 ] */ ldio IO_PORT_0 +/* 0x0ED0 [0xF3 0x0A ] */ rbeqz CHAN_0EDC +/* 0x0ED2 [0xF2 0x02 ] */ rbltz CHAN_0ED6 +/* 0x0ED4 [0xF4 0xE6 ] */ rjump CHAN_0EBC + +CHAN_0ED6: +/* 0x0ED6 [0x80 ] */ testlayer 0 +/* 0x0ED7 [0xF3 0xEB ] */ rbeqz CHAN_0EC4 +/* 0x0ED9 [0xCC 0xFF ] */ ldi 255 +/* 0x0EDB [0x71 ] */ stio IO_PORT_1 +CHAN_0EDC: +/* 0x0EDC [0x90 ] */ dellayer 0 +/* 0x0EDD [0x91 ] */ dellayer 1 +/* 0x0EDE [0x92 ] */ dellayer 2 +/* 0x0EDF [0xCC 0x00 ] */ ldi 0 +/* 0x0EE1 [0xF4 0xD1 ] */ rjump CHAN_0EB4 + +#define DEFINE_SFX(lblName, sfxId, priority, decay, rand, flags) \ + entry lblName + +.table_unaligned itembank_table + #include "itembank_table.h" + +#undef DEFINE_SFX + +.channel CHAN_0F83 +/* 0x0F83 [0xC1 0x1A ] */ instr SF0_INST_26 +/* 0x0F85 [0x88 0x0F 0x89 ] */ ldlayer 0, LAYER_0F89 +/* 0x0F88 [0xFF ] */ end + +.layer LAYER_0F89 +/* 0x0F89 [0x6C 0x18 0x6E ] */ notedv PITCH_F4, 24, 110 +/* 0x0F8C [0xFF ] */ end + +.channel CHAN_0F8D +/* 0x0F8D [0x88 0x0F 0x91 ] */ ldlayer 0, LAYER_0F91 +/* 0x0F90 [0xFF ] */ end + +.layer LAYER_0F91 +/* 0x0F91 [0xC6 0x1B ] */ instr SF0_INST_27 +/* 0x0F93 [0xC7 0x81 0x1D 0xFF ] */ portamento 0x81, PITCH_D3, 255 +/* 0x0F97 [0x51 0x2A 0x64 ] */ notedv PITCH_D2, 42, 100 +/* 0x0F9A [0xFF ] */ end + +.channel CHAN_0F9B +/* 0x0F9B [0xC1 0x1C ] */ instr SF0_INST_28 +/* 0x0F9D [0x88 0x0F 0xA1 ] */ ldlayer 0, LAYER_0FA1 +/* 0x0FA0 [0xFF ] */ end + +.layer LAYER_0FA1 +/* 0x0FA1 [0x64 0x30 0x64 ] */ notedv PITCH_A3, 48, 100 +/* 0x0FA4 [0xFF ] */ end + +.channel CHAN_0FA5 +/* 0x0FA5 [0xC1 0x1D ] */ instr SF0_INST_29 +/* 0x0FA7 [0x88 0x0F 0xAB ] */ ldlayer 0, LAYER_0FAB +/* 0x0FAA [0xFF ] */ end + +.layer LAYER_0FAB +/* 0x0FAB [0x64 0x30 0x64 ] */ notedv PITCH_A3, 48, 100 +/* 0x0FAE [0xFF ] */ end + +.channel CHAN_0FAF +/* 0x0FAF [0x88 0x0F 0xB3 ] */ ldlayer 0, LAYER_0FB3 +/* 0x0FB2 [0xFF ] */ end + +.layer LAYER_0FB3 +/* 0x0FB3 [0xC6 0x1E ] */ instr SF0_INST_30 +/* 0x0FB5 [0x64 0x30 0x64 ] */ notedv PITCH_A3, 48, 100 +/* 0x0FB8 [0xFF ] */ end + +.channel CHAN_0FB9 +/* 0x0FB9 [0xC1 0x1F ] */ instr SF0_INST_31 +/* 0x0FBB [0x88 0x0F 0xBF ] */ ldlayer 0, LAYER_0FBF +/* 0x0FBE [0xFF ] */ end + +.layer LAYER_0FBF +/* 0x0FBF [0xC4 ] */ legato +/* 0x0FC0 [0xC7 0x85 0x00 0xFF ] */ portamento 0x85, PITCH_A0, 255 +/* 0x0FC4 [0x64 0x0C 0x50 ] */ notedv PITCH_A3, 12, 80 +/* 0x0FC7 [0x54 0x19 0x50 ] */ notedv PITCH_F2, 25, 80 +/* 0x0FCA [0xFF ] */ end + +.channel CHAN_0FCB +/* 0x0FCB [0xC1 0x20 ] */ instr SF0_INST_32 +/* 0x0FCD [0xDA 0x66 0x4C ] */ env ENVELOPE_664C +/* 0x0FD0 [0x88 0x0F 0xD4 ] */ ldlayer 0, LAYER_0FD4 +/* 0x0FD3 [0xFF ] */ end + +.layer LAYER_0FD4 +/* 0x0FD4 [0x66 0x06 0x52 ] */ notedv PITCH_B3, 6, 82 +/* 0x0FD7 [0x5F 0x00 0x52 ] */ notedv PITCH_E3, 0, 82 +/* 0x0FDA [0xFF ] */ end + +.channel CHAN_0FDB +/* 0x0FDB [0xC1 0x21 ] */ instr SF0_INST_33 +/* 0x0FDD [0x88 0x0F 0xE1 ] */ ldlayer 0, LAYER_0FE1 +/* 0x0FE0 [0xFF ] */ end + +.layer LAYER_0FE1 +/* 0x0FE1 [0xC7 0x81 0x2B 0xFF ] */ portamento 0x81, PITCH_E4, 255 +/* 0x0FE5 [0x6D 0x0E 0x6E ] */ notedv PITCH_GF4, 14, 110 +/* 0x0FE8 [0xFF ] */ end + +.channel CHAN_0FE9 +/* 0x0FE9 [0xC1 0x20 ] */ instr SF0_INST_32 +/* 0x0FEB [0xDA 0x65 0xE8 ] */ env ENVELOPE_65E8 +/* 0x0FEE [0x88 0x0F 0xF5 ] */ ldlayer 0, LAYER_0FF5 +/* 0x0FF1 [0x89 0x0F 0xF9 ] */ ldlayer 1, LAYER_0FF9 +/* 0x0FF4 [0xFF ] */ end + +.layer LAYER_0FF5 +/* 0x0FF5 [0x67 0x24 0x69 ] */ notedv PITCH_C4, 36, 105 +/* 0x0FF8 [0xFF ] */ end + +.layer LAYER_0FF9 +/* 0x0FF9 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x0FFB [0xC2 0x30 ] */ transpose 48 +/* 0x0FFD [0x5C 0x00 0x64 ] */ notedv PITCH_DF3, 0, 100 +/* 0x1000 [0xFF ] */ end + +.channel CHAN_1001 +/* 0x1001 [0xC1 0x26 ] */ instr SF0_INST_38 +/* 0x1003 [0x88 0x10 0x07 ] */ ldlayer 0, LAYER_1007 +/* 0x1006 [0xFF ] */ end + +.layer LAYER_1007 +/* 0x1007 [0x67 0x45 0x64 ] */ notedv PITCH_C4, 69, 100 +/* 0x100A [0xFF ] */ end + +.channel CHAN_100B +/* 0x100B [0xED 0x14 ] */ gain 20 +/* 0x100D [0x88 0x10 0x11 ] */ ldlayer 0, LAYER_1011 +/* 0x1010 [0xFF ] */ end + +.layer LAYER_1011 +/* 0x1011 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x1013 [0xCF 0xEC ] */ releaserate 236 +/* 0x1015 [0x44 0x06 0x4C ] */ notedv PITCH_DF1, 6, 76 +/* 0x1018 [0xC6 0x24 ] */ instr SF0_INST_36 +/* 0x101A [0xCB 0x65 0xE8 0xF0 ] */ env ENVELOPE_65E8, 240 +/* 0x101E [0x66 0x24 0x6E ] */ notedv PITCH_B3, 36, 110 +/* 0x1021 [0xFF ] */ end + +.channel CHAN_1022 +/* 0x1022 [0x88 0x10 0x33 ] */ ldlayer 0, LAYER_1033 +/* 0x1025 [0x89 0x10 0x29 ] */ ldlayer 1, LAYER_1029 +/* 0x1028 [0xFF ] */ end + +.layer LAYER_1029 +/* 0x1029 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x102B [0xCB 0x66 0x4C 0xFF ] */ env ENVELOPE_664C, 255 +/* 0x102F [0x7E 0x0C 0x6C ] */ notedv PITCH_B5, FRAMERATE_CONST(12, 15), 108 +/* 0x1032 [0xFF ] */ end + +.layer LAYER_1033 +/* 0x1033 [0xC6 0x22 ] */ instr SF0_INST_34 +LAYER_1035: +/* 0x1035 [0x72 0x07 0x5D ] */ notedv PITCH_B4, 7, 93 +/* 0x1038 [0xF4 0xFB ] */ rjump LAYER_1035 + +.channel CHAN_103A +/* 0x103A [0xED 0x0F ] */ gain 15 +/* 0x103C [0x88 0x10 0x45 ] */ ldlayer 0, LAYER_1045 +/* 0x103F [0x89 0x10 0x5C ] */ ldlayer 1, LAYER_105C +/* 0x1042 [0xFF ] */ end + +.layer LAYER_1043 +/* 0x1043 [0xC2 0xF7 ] */ transpose -9 +.layer LAYER_1045 +/* 0x1045 [0xC6 0x20 ] */ instr SF0_INST_32 +/* 0x1047 [0xCB 0x65 0xE8 0xFB ] */ env ENVELOPE_65E8, 251 +/* 0x104B [0xC7 0x81 0x10 0x64 ] */ portamento 0x81, PITCH_DF2, 100 +/* 0x104F [0x6C 0x06 0x66 ] */ notedv PITCH_F4, 6, 102 +/* 0x1052 [0xC7 0x81 0x14 0x64 ] */ portamento 0x81, PITCH_F2, 100 +/* 0x1056 [0x77 0x28 0x6E ] */ notedv PITCH_E5, 40, 110 +/* 0x1059 [0xFF ] */ end + +.layer LAYER_105A +/* 0x105A [0xC2 0xF7 ] */ transpose -9 +.layer LAYER_105C +/* 0x105C [0xC6 0x2A ] */ instr SF0_INST_42 +/* 0x105E [0xCB 0x66 0x10 0xFB ] */ env ENVELOPE_6610, 251 +/* 0x1062 [0xC7 0x81 0x20 0xD0 ] */ portamento 0x81, PITCH_F3, 208 +/* 0x1066 [0x7E 0x28 0x50 ] */ notedv PITCH_B5, 40, 80 +/* 0x1069 [0xFF ] */ end + +.channel CHAN_106A +/* 0x106A [0xC1 0x23 ] */ instr SF0_INST_35 +/* 0x106C [0x88 0x10 0x70 ] */ ldlayer 0, LAYER_1070 +/* 0x106F [0xFF ] */ end + +.layer LAYER_1070 +/* 0x1070 [0xC4 ] */ legato +LAYER_1071: +/* 0x1071 [0x64 0x30 0x50 ] */ notedv PITCH_A3, 48, 80 +/* 0x1074 [0xF4 0xFB ] */ rjump LAYER_1071 + +.channel CHAN_1076 +/* 0x1076 [0x88 0x10 0x7A ] */ ldlayer 0, LAYER_107A +/* 0x1079 [0xFF ] */ end + +.layer LAYER_107A +/* 0x107A [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x107C [0xCB 0x66 0xD0 0xE1 ] */ env ENVELOPE_66D0, 225 +/* 0x1080 [0x6C 0x80 0xA0 0x6E ] */ notedv PITCH_F4, 160, 110 +/* 0x1084 [0xFF ] */ end + +.channel CHAN_1085 +/* 0x1085 [0x88 0x10 0x89 ] */ ldlayer 0, LAYER_1089 +/* 0x1088 [0xFF ] */ end + +.layer LAYER_1089 +/* 0x1089 [0xC6 0x23 ] */ instr SF0_INST_35 +/* 0x108B [0xCB 0x65 0xE8 0xF5 ] */ env ENVELOPE_65E8, 245 +/* 0x108F [0xC7 0x85 0x22 0xFF ] */ portamento 0x85, PITCH_G3, 255 +/* 0x1093 [0x6B 0x08 0x69 ] */ notedv PITCH_E4, 8, 105 +/* 0x1096 [0x60 0x18 0x69 ] */ notedv PITCH_F3, 24, 105 +/* 0x1099 [0xFF ] */ end + +/* 0x109A [0xC7 0x81 0x20 0xFF ] */ portamento 0x81, PITCH_F3, 255 +/* 0x109E [0x54 0x1E 0x69 ] */ notedv PITCH_F2, 30, 105 +/* 0x10A1 [0xFF ] */ end + +.channel CHAN_10A2 +/* 0x10A2 [0xC1 0x1E ] */ instr SF0_INST_30 +/* 0x10A4 [0xDA 0x66 0x88 ] */ env ENVELOPE_6688 +/* 0x10A7 [0x88 0x10 0xAB ] */ ldlayer 0, LAYER_10AB +/* 0x10AA [0xFF ] */ end + +.layer LAYER_10AB +/* 0x10AB [0xC4 ] */ legato +/* 0x10AC [0xC7 0x85 0x08 0xFF ] */ portamento 0x85, PITCH_F1, 255 +/* 0x10B0 [0x54 0x18 0x5A ] */ notedv PITCH_F2, 24, 90 +/* 0x10B3 [0x66 0x0E 0x5A ] */ notedv PITCH_B3, 14, 90 +/* 0x10B6 [0xC5 ] */ nolegato +/* 0x10B7 [0xC4 ] */ legato +/* 0x10B8 [0xC7 0x85 0x0A 0xFF ] */ portamento 0x85, PITCH_G1, 255 +/* 0x10BC [0x56 0x14 0x5A ] */ notedv PITCH_G2, 20, 90 +/* 0x10BF [0x67 0x0C 0x5A ] */ notedv PITCH_C4, 12, 90 +/* 0x10C2 [0xC5 ] */ nolegato +LAYER_10C3: +/* 0x10C3 [0xC4 ] */ legato +/* 0x10C4 [0xC7 0x85 0x0C 0xFF ] */ portamento 0x85, PITCH_A1, 255 +/* 0x10C8 [0x58 0x11 0x5A ] */ notedv PITCH_A2, 17, 90 +/* 0x10CB [0x69 0x0A 0x5A ] */ notedv PITCH_D4, 10, 90 +/* 0x10CE [0xC5 ] */ nolegato +/* 0x10CF [0xFB 0x10 0xC3 ] */ jump LAYER_10C3 + +.channel CHAN_10D2 +/* 0x10D2 [0xC1 0x2B ] */ instr SF0_INST_43 +/* 0x10D4 [0xDA 0x66 0xC8 ] */ env ENVELOPE_66C8 +/* 0x10D7 [0x88 0x10 0xDB ] */ ldlayer 0, LAYER_10DB +/* 0x10DA [0xFF ] */ end + +.layer LAYER_10DB +/* 0x10DB [0x55 0x03 0x6E ] */ notedv PITCH_GF2, 3, 110 +/* 0x10DE [0xC7 0x02 0x0B 0x0C ] */ portamento 0x02, PITCH_AF1, 12 +/* 0x10E2 [0x63 0x06 0x6E ] */ notedv PITCH_AF3, 6, 110 +/* 0x10E5 [0xFF ] */ end + +.channel CHAN_10E6 +/* 0x10E6 [0x88 0x10 0xEA ] */ ldlayer 0, LAYER_10EA +/* 0x10E9 [0xFF ] */ end + +.layer LAYER_10EA +/* 0x10EA [0xC6 0x1B ] */ instr SF0_INST_27 +/* 0x10EC [0xC7 0x81 0x13 0xFF ] */ portamento 0x81, PITCH_E2, 255 +/* 0x10F0 [0x47 0x60 0x64 ] */ notedv PITCH_E1, 96, 100 +/* 0x10F3 [0xFF ] */ end + +.channel CHAN_10F4 +/* 0x10F4 [0x88 0x10 0xF8 ] */ ldlayer 0, LAYER_10F8 +/* 0x10F7 [0xFF ] */ end + +.layer LAYER_10F8 +/* 0x10F8 [0xFC 0x11 0x03 ] */ call LAYER_1103 +/* 0x10FB [0xC7 0x01 0x22 0x18 ] */ portamento 0x01, PITCH_G3, 24 +/* 0x10FF [0x69 0x48 0x64 ] */ notedv PITCH_D4, 72, 100 +/* 0x1102 [0xFF ] */ end + +.layer LAYER_1103 +/* 0x1103 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x1105 [0xC2 0xEE ] */ transpose -18 +/* 0x1107 [0x5F 0x09 0x64 ] */ notedv PITCH_E3, 9, 100 +/* 0x110A [0xFF ] */ end + +.channel CHAN_110B +/* 0x110B [0xC1 0x1E ] */ instr SF0_INST_30 +/* 0x110D [0x88 0x11 0x11 ] */ ldlayer 0, LAYER_1111 +/* 0x1110 [0xFF ] */ end + +.layer LAYER_1111 +/* 0x1111 [0xC7 0x81 0x26 0x7F ] */ portamento 0x81, PITCH_B3, 127 +/* 0x1115 [0x47 0x14 0x69 ] */ notedv PITCH_E1, 20, 105 +/* 0x1118 [0xC7 0x81 0x03 0x7F ] */ portamento 0x81, PITCH_C1, 127 +/* 0x111C [0x60 0x0A 0x69 ] */ notedv PITCH_F3, 10, 105 +/* 0x111F [0xFF ] */ end + +.channel CHAN_1120 +/* 0x1120 [0xFB 0x10 0x01 ] */ jump CHAN_1001 + +.channel CHAN_1123 +/* 0x1123 [0x88 0x11 0x2A ] */ ldlayer 0, LAYER_112A +/* 0x1126 [0x89 0x11 0x3A ] */ ldlayer 1, LAYER_113A +/* 0x1129 [0xFF ] */ end + +.layer LAYER_112A +/* 0x112A [0xC2 0xFE ] */ transpose -2 +/* 0x112C [0xC6 0x1E ] */ instr SF0_INST_30 +/* 0x112E [0xC4 ] */ legato +/* 0x112F [0xC7 0x85 0x03 0xFF ] */ portamento 0x85, PITCH_C1, 255 +/* 0x1133 [0x4F 0x09 0x5A ] */ notedv PITCH_C2, 9, 90 +/* 0x1136 [0x65 0x12 0x5A ] */ notedv PITCH_BF3, 18, 90 +/* 0x1139 [0xFF ] */ end + +.layer LAYER_113A +/* 0x113A [0xC2 0xFF ] */ transpose -1 +/* 0x113C [0xC6 0x25 ] */ instr SF0_INST_37 +/* 0x113E [0xC7 0x81 0x22 0xFF ] */ portamento 0x81, PITCH_G3, 255 +/* 0x1142 [0x5B 0x1B 0x50 ] */ notedv PITCH_C3, 27, 80 +/* 0x1145 [0xFF ] */ end + +.channel CHAN_1146 +/* 0x1146 [0x88 0x11 0x4D ] */ ldlayer 0, LAYER_114D +/* 0x1149 [0x89 0x11 0x5D ] */ ldlayer 1, LAYER_115D +/* 0x114C [0xFF ] */ end + +.layer LAYER_114D +/* 0x114D [0xC2 0x04 ] */ transpose 4 +/* 0x114F [0xC6 0x1E ] */ instr SF0_INST_30 +/* 0x1151 [0xC4 ] */ legato +/* 0x1152 [0xC7 0x85 0x03 0xFF ] */ portamento 0x85, PITCH_C1, 255 +/* 0x1156 [0x54 0x0C 0x67 ] */ notedv PITCH_F2, 12, 103 +/* 0x1159 [0x6C 0x18 0x67 ] */ notedv PITCH_F4, 24, 103 +/* 0x115C [0xFF ] */ end + +.layer LAYER_115D +/* 0x115D [0xC2 0x04 ] */ transpose 4 +/* 0x115F [0xC6 0x25 ] */ instr SF0_INST_37 +/* 0x1161 [0xC7 0x81 0x22 0xFF ] */ portamento 0x81, PITCH_G3, 255 +/* 0x1165 [0x5B 0x28 0x57 ] */ notedv PITCH_C3, 40, 87 +/* 0x1168 [0xFF ] */ end + +.channel CHAN_1169 +/* 0x1169 [0x88 0x11 0x70 ] */ ldlayer 0, LAYER_1170 +/* 0x116C [0x89 0x11 0x7C ] */ ldlayer 1, LAYER_117C +/* 0x116F [0xFF ] */ end + +.layer LAYER_1170 +/* 0x1170 [0xC6 0x1B ] */ instr SF0_INST_27 +/* 0x1172 [0xC7 0x81 0x20 0xFF ] */ portamento 0x81, PITCH_F3, 255 +/* 0x1176 [0x54 0x24 0x69 ] */ notedv PITCH_F2, 36, 105 +/* 0x1179 [0xC0 0x68 ] */ ldelay 104 +/* 0x117B [0xFF ] */ end + +.layer LAYER_117C +/* 0x117C [0xC6 0x27 ] */ instr SF0_INST_39 +/* 0x117E [0xC7 0x81 0x2E 0x2C ] */ portamento 0x81, PITCH_G4, 44 +/* 0x1182 [0x62 0x80 0x8C 0x4B ] */ notedv PITCH_G3, 140, 75 +/* 0x1186 [0xFF ] */ end + +.channel CHAN_1187 +/* 0x1187 [0xC1 0x1A ] */ instr SF0_INST_26 +/* 0x1189 [0xDA 0x66 0x74 ] */ env ENVELOPE_6674 +/* 0x118C [0x88 0x11 0x96 ] */ ldlayer 0, LAYER_1196 +CHAN_118F: +/* 0x118F [0xD7 0x7F ] */ vibfreq 127 +/* 0x1191 [0xE2 0x00 0x80 0x38 ] */ vibdepthgrad 0, 128, 56 +/* 0x1195 [0xFF ] */ end + +.layer LAYER_1196 +/* 0x1196 [0x53 0x60 0x6E ] */ notedv PITCH_E2, 96, 110 +/* 0x1199 [0xFF ] */ end + +.channel CHAN_119A +/* 0x119A [0xC1 0x1A ] */ instr SF0_INST_26 +/* 0x119C [0x88 0x11 0xA3 ] */ ldlayer 0, LAYER_11A3 +/* 0x119F [0x89 0x11 0xAF ] */ ldlayer 1, LAYER_11AF +/* 0x11A2 [0xFF ] */ end + +.layer LAYER_11A3 +/* 0x11A3 [0xCB 0x66 0x74 0xFB ] */ env ENVELOPE_6674, 251 +/* 0x11A7 [0xC7 0x01 0x1B 0x1E ] */ portamento 0x01, PITCH_C3, 30 +/* 0x11AB [0x64 0x60 0x64 ] */ notedv PITCH_A3, 96, 100 +/* 0x11AE [0xFF ] */ end + +.layer LAYER_11AF +/* 0x11AF [0x5B 0x60 0x60 ] */ notedv PITCH_C3, 96, 96 +/* 0x11B2 [0xFF ] */ end + +.channel CHAN_11B3 +/* 0x11B3 [0x88 0x11 0xB7 ] */ ldlayer 0, LAYER_11B7 +/* 0x11B6 [0xFF ] */ end + +.layer LAYER_11B7 +/* 0x11B7 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x11B9 [0xCB 0x66 0x10 0xFB ] */ env ENVELOPE_6610, 251 +/* 0x11BD [0x4C 0x08 0x6E ] */ notedv PITCH_A1, 8, 110 +/* 0x11C0 [0x48 0x30 0x6E ] */ notedv PITCH_F1, 48, 110 +/* 0x11C3 [0xFF ] */ end + +.channel CHAN_11C4 +/* 0x11C4 [0xC1 0x28 ] */ instr SF0_INST_40 +/* 0x11C6 [0xDA 0x66 0x60 ] */ env ENVELOPE_6660 +/* 0x11C9 [0x88 0x11 0xCD ] */ ldlayer 0, LAYER_11CD +/* 0x11CC [0xFF ] */ end + +.layer LAYER_11CD +/* 0x11CD [0x17 0x07 0x5D 0x7F ] */ notedvg PITCH_AF2, 7, 93, 127 +/* 0x11D1 [0x62 0x05 0x5A ] */ notedv PITCH_G3, 5, 90 +/* 0x11D4 [0xFF ] */ end + +.channel CHAN_11D5 +/* 0x11D5 [0x88 0x11 0xD9 ] */ ldlayer 0, LAYER_11D9 +/* 0x11D8 [0xFF ] */ end + +.layer LAYER_11D9 +/* 0x11D9 [0xC6 0x1E ] */ instr SF0_INST_30 +/* 0x11DB [0x64 0x08 0x69 ] */ notedv PITCH_A3, 8, 105 +/* 0x11DE [0xC6 0x29 ] */ instr SF0_INST_41 +/* 0x11E0 [0xCB 0x66 0x24 0xFF ] */ env ENVELOPE_6624, 255 +/* 0x11E4 [0x61 0x16 0x57 ] */ notedv PITCH_GF3, 22, 87 +/* 0x11E7 [0xFF ] */ end + +.channel CHAN_11E8 +/* 0x11E8 [0x88 0x11 0xEF ] */ ldlayer 0, LAYER_11EF +/* 0x11EB [0x89 0x11 0xF5 ] */ ldlayer 1, LAYER_11F5 +/* 0x11EE [0xFF ] */ end + +.layer LAYER_11EF +/* 0x11EF [0xC6 0x1C ] */ instr SF0_INST_28 +/* 0x11F1 [0x60 0x12 0x6E ] */ notedv PITCH_F3, 18, 110 +/* 0x11F4 [0xFF ] */ end + +.layer LAYER_11F5 +/* 0x11F5 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x11F7 [0xC2 0x30 ] */ transpose 48 +/* 0x11F9 [0xCB 0x67 0x20 0xFB ] */ env ENVELOPE_6720, 251 +/* 0x11FD [0x5B 0x0A 0x4B ] */ notedv PITCH_C3, 10, 75 +/* 0x1200 [0x1F 0x04 0x4B 0x7F ] */ notedvg PITCH_E3, 4, 75, 127 +/* 0x1204 [0x5F 0x04 0x4B ] */ notedv PITCH_E3, 4, 75 +/* 0x1207 [0xFF ] */ end + +.channel CHAN_1208 +/* 0x1208 [0xC1 0x1E ] */ instr SF0_INST_30 +/* 0x120A [0x88 0x12 0x0E ] */ ldlayer 0, LAYER_120E +/* 0x120D [0xFF ] */ end + +.layer LAYER_120E +/* 0x120E [0xC7 0x81 0x30 0xFF ] */ portamento 0x81, PITCH_A4, 255 +/* 0x1212 [0x40 0x12 0x64 ] */ notedv PITCH_A0, 18, 100 +/* 0x1215 [0xFF ] */ end + +.channel CHAN_1216 +/* 0x1216 [0xC1 0x21 ] */ instr SF0_INST_33 +/* 0x1218 [0x88 0x12 0x1C ] */ ldlayer 0, LAYER_121C +/* 0x121B [0xFF ] */ end + +.layer LAYER_121C +/* 0x121C [0xC7 0x81 0x27 0x7F ] */ portamento 0x81, PITCH_C4, 127 +/* 0x1220 [0x72 0x07 0x6E ] */ notedv PITCH_B4, 7, 110 +/* 0x1223 [0xFF ] */ end + +.channel CHAN_1224 +/* 0x1224 [0xCC 0x18 ] */ ldi 24 +/* 0x1226 [0x71 ] */ stio IO_PORT_1 +/* 0x1227 [0x88 0x12 0x4B ] */ ldlayer 0, LAYER_124B +/* 0x122A [0x89 0x12 0x34 ] */ ldlayer 1, LAYER_1234 +/* 0x122D [0xD7 0x7F ] */ vibfreq 127 +/* 0x122F [0xE2 0x00 0xA0 0x09 ] */ vibdepthgrad 0, 160, 9 +/* 0x1233 [0xFF ] */ end + +.layer LAYER_1234 +/* 0x1234 [0xC6 0x86 ] */ instr FONTANY_INSTR_8PULSE +/* 0x1236 [0xC7 0x81 0x03 0xFF ] */ portamento 0x81, PITCH_C1, 255 +/* 0x123A [0x6E 0x64 0x1E ] */ notedv PITCH_G4, 100, 30 +/* 0x123D [0xC7 0x81 0x0F 0xFF ] */ portamento 0x81, PITCH_C2, 255 +/* 0x1241 [0x7A 0x64 0x1E ] */ notedv PITCH_G5, 100, 30 +/* 0x1244 [0xC4 ] */ legato +LAYER_1245: +/* 0x1245 [0x7A 0x80 0xC8 0x1E ] */ notedv PITCH_G5, 200, 30 +/* 0x1249 [0xF4 0xFA ] */ rjump LAYER_1245 + +.layer LAYER_124B +/* 0x124B [0xC6 0x2A ] */ instr SF0_INST_42 +/* 0x124D [0xC4 ] */ legato +/* 0x124E [0xC2 0x09 ] */ transpose 9 +/* 0x1250 [0xC7 0x81 0x03 0xFF ] */ portamento 0x81, PITCH_C1, 255 +LAYER_1254: +/* 0x1254 [0x7A 0x80 0xC8 0x32 ] */ notedv PITCH_G5, 200, 50 +/* 0x1258 [0xF4 0xFA ] */ rjump LAYER_1254 + +.channel CHAN_125A +/* 0x125A [0x88 0x12 0x66 ] */ ldlayer 0, LAYER_1266 +/* 0x125D [0x89 0x12 0x64 ] */ ldlayer 1, LAYER_1264 +/* 0x1260 [0x8A 0x11 0x70 ] */ ldlayer 2, LAYER_1170 +/* 0x1263 [0xFF ] */ end + +.layer LAYER_1264 +/* 0x1264 [0xC2 0xFC ] */ transpose -4 +.layer LAYER_1266 +/* 0x1266 [0xC6 0x27 ] */ instr SF0_INST_39 +/* 0x1268 [0xC7 0x81 0x33 0x2C ] */ portamento 0x81, PITCH_C5, 44 +/* 0x126C [0x60 0x80 0x8C 0x5A ] */ notedv PITCH_F3, FRAMERATE_CONST(140, 168), 90 +/* 0x1270 [0xFF ] */ end + +.channel CHAN_1271 +/* 0x1271 [0xC1 0x2B ] */ instr SF0_INST_43 +/* 0x1273 [0xDA 0x66 0xC8 ] */ env ENVELOPE_66C8 +/* 0x1276 [0x88 0x12 0x7D ] */ ldlayer 0, LAYER_127D +/* 0x1279 [0x89 0x11 0x3A ] */ ldlayer 1, LAYER_113A +/* 0x127C [0xFF ] */ end + +.layer LAYER_127D +/* 0x127D [0x58 0x03 0x6E ] */ notedv PITCH_A2, 3, 110 +/* 0x1280 [0xC7 0x02 0x0E 0x0C ] */ portamento 0x02, PITCH_B1, 12 +/* 0x1284 [0x66 0x06 0x6E ] */ notedv PITCH_B3, 6, 110 +/* 0x1287 [0xC0 0x07 ] */ ldelay 7 +/* 0x1289 [0xFF ] */ end + +.channel CHAN_128A +/* 0x128A [0x88 0x12 0x8E ] */ ldlayer 0, LAYER_128E +/* 0x128D [0xFF ] */ end + +.layer LAYER_128E +/* 0x128E [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x1290 [0xC2 0x30 ] */ transpose 48 +/* 0x1292 [0x18 0x03 0x64 0x7F ] */ notedvg PITCH_A2, 3, 100, 127 +/* 0x1296 [0xCF 0xFB ] */ releaserate 251 +/* 0x1298 [0xC7 0x81 0x0F 0x30 ] */ portamento 0x81, PITCH_C2, 48 +/* 0x129C [0x5C 0x24 0x64 ] */ notedv PITCH_DF3, 36, 100 +/* 0x129F [0xFF ] */ end + +.channel CHAN_12A0 +/* 0x12A0 [0x88 0x12 0xA7 ] */ ldlayer 0, LAYER_12A7 +/* 0x12A3 [0x89 0x12 0xAD ] */ ldlayer 1, LAYER_12AD +/* 0x12A6 [0xFF ] */ end + +.layer LAYER_12A7 +/* 0x12A7 [0xC6 0x1C ] */ instr SF0_INST_28 +/* 0x12A9 [0x64 0x12 0x6E ] */ notedv PITCH_A3, 18, 110 +/* 0x12AC [0xFF ] */ end + +.layer LAYER_12AD +/* 0x12AD [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x12AF [0xC2 0x30 ] */ transpose 48 +/* 0x12B1 [0xCB 0x67 0x20 0xFB ] */ env ENVELOPE_6720, 251 +/* 0x12B5 [0x60 0x0A 0x4B ] */ notedv PITCH_F3, 10, 75 +/* 0x12B8 [0x1F 0x04 0x4B 0x7F ] */ notedvg PITCH_E3, 4, 75, 127 +/* 0x12BC [0x53 0x04 0x4B ] */ notedv PITCH_E2, 4, 75 +/* 0x12BF [0xFF ] */ end + +.channel CHAN_12C0 +/* 0x12C0 [0x88 0x12 0xC7 ] */ ldlayer 0, LAYER_12C7 +/* 0x12C3 [0x89 0x12 0xCD ] */ ldlayer 1, LAYER_12CD +/* 0x12C6 [0xFF ] */ end + +.layer LAYER_12C7 +/* 0x12C7 [0xC6 0x1C ] */ instr SF0_INST_28 +/* 0x12C9 [0x6A 0x10 0x69 ] */ notedv PITCH_EF4, 16, 105 +/* 0x12CC [0xFF ] */ end + +.layer LAYER_12CD +/* 0x12CD [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x12CF [0xCB 0x66 0x4C 0xFB ] */ env ENVELOPE_664C, 251 +/* 0x12D3 [0x63 0x04 0x56 ] */ notedv PITCH_AF3, 4, 86 +/* 0x12D6 [0x58 0x04 0x40 ] */ notedv PITCH_A2, 4, 64 +/* 0x12D9 [0xFF ] */ end + +.channel CHAN_12DA +/* 0x12DA [0x88 0x12 0xE7 ] */ ldlayer 0, LAYER_12E7 +/* 0x12DD [0x89 0x12 0xE1 ] */ ldlayer 1, LAYER_12E1 +/* 0x12E0 [0xFF ] */ end + +.layer LAYER_12E1 +/* 0x12E1 [0xC6 0x1C ] */ instr SF0_INST_28 +/* 0x12E3 [0x58 0x28 0x69 ] */ notedv PITCH_A2, 40, 105 +/* 0x12E6 [0xFF ] */ end + +.layer LAYER_12E7 +/* 0x12E7 [0xC6 0x22 ] */ instr SF0_INST_34 +/* 0x12E9 [0xCF 0xEE ] */ releaserate 238 +/* 0x12EB [0x75 0x08 0x56 ] */ notedv PITCH_D5, 8, 86 +/* 0x12EE [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x12F0 [0x6D 0x18 0x64 ] */ notedv PITCH_GF4, 24, 100 +/* 0x12F3 [0xFF ] */ end + +.channel CHAN_12F4 +/* 0x12F4 [0x88 0x12 0xFB ] */ ldlayer 0, LAYER_12FB +/* 0x12F7 [0x89 0x13 0x09 ] */ ldlayer 1, LAYER_1309 +/* 0x12FA [0xFF ] */ end + +.layer LAYER_12FB +/* 0x12FB [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x12FD [0xCB 0x66 0x24 0xFB ] */ env ENVELOPE_6624, 251 +/* 0x1301 [0xC7 0x81 0x32 0x90 ] */ portamento 0x81, PITCH_B4, 144 +/* 0x1305 [0x5A 0x20 0x6E ] */ notedv PITCH_B2, 32, 110 +/* 0x1308 [0xFF ] */ end + +.layer LAYER_1309 +/* 0x1309 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x130B [0xCB 0x66 0x4C 0xF1 ] */ env ENVELOPE_664C, 241 +/* 0x130F [0x57 0x04 0x40 ] */ notedv PITCH_AF2, 4, 64 +/* 0x1312 [0x64 0x0C 0x38 ] */ notedv PITCH_A3, 12, 56 +/* 0x1315 [0xFF ] */ end + +.channel CHAN_1316 +/* 0x1316 [0xCC 0x18 ] */ ldi 24 +/* 0x1318 [0x71 ] */ stio IO_PORT_1 +/* 0x1319 [0x88 0x13 0x20 ] */ ldlayer 0, LAYER_1320 +/* 0x131C [0x89 0x11 0x7C ] */ ldlayer 1, LAYER_117C +/* 0x131F [0xFF ] */ end + +.layer LAYER_1320 +/* 0x1320 [0xC6 0x2A ] */ instr SF0_INST_42 +/* 0x1322 [0xC4 ] */ legato +/* 0x1323 [0xC2 0x0C ] */ transpose 12 +/* 0x1325 [0xC7 0x81 0x38 0x7F ] */ portamento 0x81, PITCH_F5, 127 +/* 0x1329 [0x6C 0x24 0x50 ] */ notedv PITCH_F4, 36, 80 +/* 0x132C [0xFF ] */ end + +.channel CHAN_132D +/* 0x132D [0x88 0x13 0x34 ] */ ldlayer 0, LAYER_1334 +/* 0x1330 [0x89 0x13 0x44 ] */ ldlayer 1, LAYER_1344 +/* 0x1333 [0xFF ] */ end + +.layer LAYER_1334 +/* 0x1334 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x1336 [0xC2 0x30 ] */ transpose 48 +/* 0x1338 [0xCB 0x66 0xD0 0xE8 ] */ env ENVELOPE_66D0, 232 +/* 0x133C [0xC7 0x81 0x13 0x48 ] */ portamento 0x81, PITCH_E2, 72 +/* 0x1340 [0x55 0x04 0x53 ] */ notedv PITCH_GF2, 4, 83 +/* 0x1343 [0xFF ] */ end + +.layer LAYER_1344 +/* 0x1344 [0xC6 0x29 ] */ instr SF0_INST_41 +/* 0x1346 [0xCF 0xE1 ] */ releaserate 225 +/* 0x1348 [0xC7 0x81 0x2D 0xC8 ] */ portamento 0x81, PITCH_GF4, 200 +/* 0x134C [0x5C 0x04 0x6E ] */ notedv PITCH_DF3, 4, 110 +/* 0x134F [0xFF ] */ end + +.channel CHAN_1350 +/* 0x1350 [0xCC 0x20 ] */ ldi 32 +/* 0x1352 [0x71 ] */ stio IO_PORT_1 +/* 0x1353 [0x88 0x13 0x7F ] */ ldlayer 0, LAYER_137F +/* 0x1356 [0x89 0x13 0x73 ] */ ldlayer 1, LAYER_1373 +/* 0x1359 [0x8A 0x13 0x61 ] */ ldlayer 2, LAYER_1361 +CHAN_135C: +/* 0x135C [0xD7 0x64 ] */ vibfreq 100 +/* 0x135E [0xD8 0x54 ] */ vibdepth 84 +/* 0x1360 [0xFF ] */ end + +.layer LAYER_1361 +/* 0x1361 [0xC4 ] */ legato +/* 0x1362 [0xC6 0x34 ] */ instr SF0_INST_52 +/* 0x1364 [0xCB 0x66 0x74 0xFB ] */ env ENVELOPE_6674, 251 +/* 0x1368 [0xC7 0x85 0x0B 0xFF ] */ portamento 0x85, PITCH_AF1, 255 +/* 0x136C [0x57 0x24 0x3C ] */ notedv PITCH_AF2, 36, 60 +/* 0x136F [0x4B 0x24 0x3C ] */ notedv PITCH_AF1, 36, 60 +/* 0x1372 [0xFF ] */ end + +.layer LAYER_1373 +/* 0x1373 [0xC6 0x25 ] */ instr SF0_INST_37 +/* 0x1375 [0xC7 0x82 0x0F 0xFF ] */ portamento 0x82, PITCH_C2, 255 +/* 0x1379 [0x5B 0x3E 0x69 ] */ notedv PITCH_C3, 62, 105 +/* 0x137C [0xFF ] */ end + +.layer LAYER_137D +/* 0x137D [0xC2 0xFA ] */ transpose -6 +.layer LAYER_137F +/* 0x137F [0xC0 0x01 ] */ ldelay 1 +/* 0x1381 [0xC6 0x51 ] */ instr SF0_INST_81 +/* 0x1383 [0xCB 0x65 0xD8 0xFB ] */ env ENVELOPE_65D8, 251 +/* 0x1387 [0xC7 0x81 0x14 0xFF ] */ portamento 0x81, PITCH_F2, 255 +/* 0x138B [0x57 0x08 0x55 ] */ notedv PITCH_AF2, FRAMERATE_CONST(8, 10), 85 +/* 0x138E [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +/* 0x1392 [0x4F 0x60 0x55 ] */ notedv PITCH_C2, FRAMERATE_CONST(96, 115), 85 +/* 0x1395 [0xFF ] */ end + +.channel CHAN_1396 +/* 0x1396 [0xC1 0x1D ] */ instr SF0_INST_29 +/* 0x1398 [0x88 0x13 0x9C ] */ ldlayer 0, LAYER_139C +/* 0x139B [0xFF ] */ end + +.layer LAYER_139C +/* 0x139C [0xC7 0x83 0x20 0x7F ] */ portamento 0x83, PITCH_F3, 127 +/* 0x13A0 [0x62 0x08 0x64 ] */ notedv PITCH_G3, 8, 100 +/* 0x13A3 [0x6A 0x18 0x64 ] */ notedv PITCH_EF4, 24, 100 +/* 0x13A6 [0xFF ] */ end + +.channel CHAN_13A7 +/* 0x13A7 [0x88 0x13 0xC5 ] */ ldlayer 0, LAYER_13C5 +/* 0x13AA [0x89 0x13 0xB1 ] */ ldlayer 1, LAYER_13B1 +/* 0x13AD [0x8A 0x11 0x70 ] */ ldlayer 2, LAYER_1170 +/* 0x13B0 [0xFF ] */ end + +.layer LAYER_13B1 +/* 0x13B1 [0xC2 0x11 ] */ transpose 17 +LAYER_13B3: +/* 0x13B3 [0xC6 0x2A ] */ instr SF0_INST_42 +/* 0x13B5 [0xCB 0x66 0x38 0xFB ] */ env ENVELOPE_6638, 251 +/* 0x13B9 [0xC4 ] */ legato +/* 0x13BA [0xC7 0x85 0x2C 0xFF ] */ portamento 0x85, PITCH_F4, 255 +/* 0x13BE [0x78 0x10 0x44 ] */ notedv PITCH_F5, FRAMERATE_CONST(16, 19), 68 +/* 0x13C1 [0x45 0x2C 0x44 ] */ notedv PITCH_D1, FRAMERATE_CONST(44, 53), 68 +/* 0x13C4 [0xFF ] */ end + +.layer LAYER_13C5 +/* 0x13C5 [0xC2 0xFE ] */ transpose -2 +/* 0x13C7 [0xFB 0x12 0x66 ] */ jump LAYER_1266 + +.channel CHAN_13CA +/* 0x13CA [0x88 0x12 0x66 ] */ ldlayer 0, LAYER_1266 +/* 0x13CD [0x89 0x13 0xD4 ] */ ldlayer 1, LAYER_13D4 +/* 0x13D0 [0x8A 0x13 0xD8 ] */ ldlayer 2, LAYER_13D8 +/* 0x13D3 [0xFF ] */ end + +.layer LAYER_13D4 +/* 0x13D4 [0xC2 0x14 ] */ transpose 20 +/* 0x13D6 [0xF4 0xDB ] */ rjump LAYER_13B3 + +.layer LAYER_13D8 +/* 0x13D8 [0xC6 0x4A ] */ instr SF0_INST_74 +/* 0x13DA [0xCF 0xDD ] */ releaserate 221 +/* 0x13DC [0xC4 ] */ legato +/* 0x13DD [0xC7 0x85 0x1C 0xFF ] */ portamento 0x85, PITCH_DF3, 255 +/* 0x13E1 [0x68 0x10 0x4A ] */ notedv PITCH_DF4, 16, 74 +/* 0x13E4 [0x64 0x44 0x4A ] */ notedv PITCH_A3, 68, 74 +/* 0x13E7 [0xFF ] */ end + +.channel CHAN_13E8 +/* 0x13E8 [0xED 0x16 ] */ gain 22 +/* 0x13EA [0x88 0x13 0xEE ] */ ldlayer 0, LAYER_13EE +/* 0x13ED [0xFF ] */ end + +.layer LAYER_13EE +/* 0x13EE [0xC6 0x21 ] */ instr SF0_INST_33 +/* 0x13F0 [0xCB 0x65 0xD8 0xFB ] */ env ENVELOPE_65D8, 251 +/* 0x13F4 [0xC2 0x30 ] */ transpose 48 +/* 0x13F6 [0xC7 0x81 0x2B 0x7F ] */ portamento 0x81, PITCH_E4, 127 +/* 0x13FA [0x6F 0x60 0x5F ] */ notedv PITCH_AF4, 96, 95 +/* 0x13FD [0xFF ] */ end + +.channel CHAN_13FE +/* 0x13FE [0x88 0x14 0x02 ] */ ldlayer 0, LAYER_1402 +/* 0x1401 [0xFF ] */ end + +.layer LAYER_1402 +/* 0x1402 [0xC6 0x23 ] */ instr SF0_INST_35 +/* 0x1404 [0xC2 0x30 ] */ transpose 48 +/* 0x1406 [0xC4 ] */ legato +/* 0x1407 [0xC7 0x01 0x24 0x38 ] */ portamento 0x01, PITCH_A3, 56 +LAYER_140B: +/* 0x140B [0x6B 0xFD 0x00 0x50 ] */ notedv PITCH_E4, 32000, 80 +/* 0x140F [0xF4 0xFA ] */ rjump LAYER_140B + +.channel CHAN_1411 +/* 0x1411 [0xCC 0x00 ] */ ldi 0 +/* 0x1413 [0x76 ] */ stio IO_PORT_6 +CHAN_1414: +/* 0x1414 [0xCB 0x14 0x2D ] */ ldseq UNK_142D +/* 0x1417 [0xC7 0x00 0x14 0x5B ] */ stseq 0, LAYER_145A + STSEQ_TRANSPOSITION +/* 0x141B [0x66 ] */ ldio IO_PORT_6 +/* 0x141C [0xCB 0x14 0x31 ] */ ldseq UNK_1431 +/* 0x141F [0xC7 0x00 0x14 0x56 ] */ stseq 0, LAYER_1455 + STSEQ_NOTEDV_DELAY_HI +/* 0x1423 [0xCC 0x18 ] */ ldi 24 +/* 0x1425 [0x71 ] */ stio IO_PORT_1 +/* 0x1426 [0x88 0x14 0x48 ] */ ldlayer 0, LAYER_1448 +/* 0x1429 [0x89 0x14 0x35 ] */ ldlayer 1, LAYER_1435 +/* 0x142C [0xFF ] */ end + +UNK_142D: + .byte 0x00, 0x04, 0x08, 0x00 + +UNK_1431: +#if !OOT_PAL_N64 + .byte 0x60, 0x30, 0x18, 0x60 +#else + .byte 0x73, 0x3A, 0x1D, 0x60 +#endif + +.layer LAYER_1435 +/* 0x1435 [0xFC 0x14 0x5A ] */ call LAYER_145A +.layer LAYER_1438 +/* 0x1438 [0xC6 0x08 ] */ instr SF0_INST_8 +/* 0x143A [0xC4 ] */ legato +/* 0x143B [0xC7 0x85 0x18 0xFF ] */ portamento 0x85, PITCH_A2, 255 +/* 0x143F [0x4F 0x06 0x5A ] */ notedv PITCH_C2, 6, 90 +/* 0x1442 [0x72 0x50 0x5A ] */ notedv PITCH_B4, 80, 90 +/* 0x1445 [0xC0 0x21 ] */ ldelay 33 +/* 0x1447 [0xFF ] */ end + +.layer LAYER_1448 +/* 0x1448 [0xFC 0x14 0x5A ] */ call LAYER_145A +/* 0x144B [0xC6 0x08 ] */ instr SF0_INST_8 +/* 0x144D [0xCB 0x66 0xC8 0xFB ] */ env ENVELOPE_66C8, 251 +LAYER_1451: +/* 0x1451 [0xC7 0x81 0x03 0xFF ] */ portamento 0x81, PITCH_C1, 255 +LAYER_1455: +/* 0x1455 [0x58 0x60 0x58 ] */ notedv PITCH_A2, 96, 88 +/* 0x1458 [0xF4 0xF7 ] */ rjump LAYER_1451 + +.layer LAYER_145A +/* 0x145A [0xC2 0x00 ] */ transpose 0 +/* 0x145C [0xFF ] */ end + +.channel CHAN_145D +/* 0x145D [0xCC 0x01 ] */ ldi 1 +/* 0x145F [0x76 ] */ stio IO_PORT_6 +/* 0x1460 [0xF4 0xB2 ] */ rjump CHAN_1414 + +.channel CHAN_1462 +/* 0x1462 [0xCC 0x02 ] */ ldi 2 +/* 0x1464 [0x76 ] */ stio IO_PORT_6 +/* 0x1465 [0xF4 0xAD ] */ rjump CHAN_1414 + +.channel CHAN_1467 +/* 0x1467 [0xC1 0x21 ] */ instr SF0_INST_33 +/* 0x1469 [0xDA 0x67 0xBC ] */ env ENVELOPE_67BC +/* 0x146C [0xED 0x08 ] */ gain 8 +/* 0x146E [0x88 0x14 0x72 ] */ ldlayer 0, LAYER_1472 +/* 0x1471 [0xFF ] */ end + +.layer LAYER_1472 +/* 0x1472 [0xC2 0x30 ] */ transpose 48 +/* 0x1474 [0xC7 0x81 0x30 0x7F ] */ portamento 0x81, PITCH_A4, 127 +/* 0x1478 [0x74 0x30 0x69 ] */ notedv PITCH_DF5, 48, 105 +/* 0x147B [0xFF ] */ end + +.channel CHAN_147C +/* 0x147C [0x88 0x14 0x83 ] */ ldlayer 0, LAYER_1483 +/* 0x147F [0x89 0x14 0x8D ] */ ldlayer 1, LAYER_148D +/* 0x1482 [0xFF ] */ end + +.layer LAYER_1483 +/* 0x1483 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x1485 [0xC7 0x81 0x30 0x90 ] */ portamento 0x81, PITCH_A4, 144 +/* 0x1489 [0x54 0x0E 0x60 ] */ notedv PITCH_F2, 14, 96 +/* 0x148C [0xFF ] */ end + +.layer LAYER_148D +/* 0x148D [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x148F [0x59 0x0E 0x48 ] */ notedv PITCH_BF2, 14, 72 +/* 0x1492 [0xFF ] */ end + +.channel CHAN_1493 +/* 0x1493 [0x88 0x14 0x9A ] */ ldlayer 0, LAYER_149A +/* 0x1496 [0x89 0x14 0xA4 ] */ ldlayer 1, LAYER_14A4 +/* 0x1499 [0xFF ] */ end + +.layer LAYER_149A +/* 0x149A [0xC6 0x3F ] */ instr SF0_INST_63 +/* 0x149C [0xCB 0x65 0xE8 0xF4 ] */ env ENVELOPE_65E8, 244 +/* 0x14A0 [0x6D 0x08 0x6E ] */ notedv PITCH_GF4, 8, 110 +/* 0x14A3 [0xFF ] */ end + +.layer LAYER_14A4 +/* 0x14A4 [0xC6 0x16 ] */ instr SF0_INST_22 +/* 0x14A6 [0xC0 0x03 ] */ ldelay 3 +/* 0x14A8 [0xCB 0x65 0xE8 0xF4 ] */ env ENVELOPE_65E8, 244 +/* 0x14AC [0x55 0x05 0x6E ] */ notedv PITCH_GF2, 5, 110 +/* 0x14AF [0xFF ] */ end + +.channel CHAN_14B0 +/* 0x14B0 [0xED 0x0F ] */ gain 15 +/* 0x14B2 [0x88 0x10 0x43 ] */ ldlayer 0, LAYER_1043 +/* 0x14B5 [0x89 0x10 0x5A ] */ ldlayer 1, LAYER_105A +/* 0x14B8 [0xFF ] */ end + +.channel CHAN_14B9 +/* 0x14B9 [0x88 0x14 0xC0 ] */ ldlayer 0, LAYER_14C0 +/* 0x14BC [0x89 0x0F 0xB3 ] */ ldlayer 1, LAYER_0FB3 +/* 0x14BF [0xFF ] */ end + +.layer LAYER_14C0 +/* 0x14C0 [0xC6 0x27 ] */ instr SF0_INST_39 +/* 0x14C2 [0xC7 0x81 0x0F 0x28 ] */ portamento 0x81, PITCH_C2, 40 +/* 0x14C6 [0x6C 0x40 0x50 ] */ notedv PITCH_F4, 64, 80 +/* 0x14C9 [0xFF ] */ end + +.channel CHAN_14CA +/* 0x14CA [0x88 0x14 0xD6 ] */ ldlayer 0, LAYER_14D6 +CHAN_14CD: +/* 0x14CD [0x89 0x14 0xE0 ] */ ldlayer 1, LAYER_14E0 +/* 0x14D0 [0x8A 0x15 0xB1 ] */ ldlayer 2, LAYER_15B1 +/* 0x14D3 [0xED 0x14 ] */ gain 20 +/* 0x14D5 [0xFF ] */ end + +.layer LAYER_14D6 +/* 0x14D6 [0xC6 0x43 ] */ instr SF0_INST_67 +/* 0x14D8 [0xCB 0x66 0x88 0xC8 ] */ env ENVELOPE_6688, 200 +/* 0x14DC [0x5B 0x44 0x64 ] */ notedv PITCH_C3, 68, 100 +/* 0x14DF [0xFF ] */ end + +.layer LAYER_14E0 +/* 0x14E0 [0xC2 0x30 ] */ transpose 48 +/* 0x14E2 [0xFB 0x2A 0x06 ] */ jump LAYER_2A06 + +.channel CHAN_14E5 +/* 0x14E5 [0x88 0x14 0xEA ] */ ldlayer 0, LAYER_14EA +/* 0x14E8 [0xF4 0xE3 ] */ rjump CHAN_14CD + +.layer LAYER_14EA +/* 0x14EA [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x14EC [0xC2 0x0A ] */ transpose 10 +/* 0x14EE [0xCB 0x66 0x88 0xC8 ] */ env ENVELOPE_6688, 200 +/* 0x14F2 [0x73 0x44 0x64 ] */ notedv PITCH_C5, 68, 100 +/* 0x14F5 [0xFF ] */ end + +.channel CHAN_14F6 +/* 0x14F6 [0x88 0x14 0xFB ] */ ldlayer 0, LAYER_14FB +/* 0x14F9 [0xF4 0xD2 ] */ rjump CHAN_14CD + +.layer LAYER_14FB +/* 0x14FB [0xC6 0x40 ] */ instr SF0_INST_64 +/* 0x14FD [0xCB 0x66 0x7C 0xC8 ] */ env ENVELOPE_667C, 200 +/* 0x1501 [0x70 0x44 0x36 ] */ notedv PITCH_A4, 68, 54 +/* 0x1504 [0xFF ] */ end + +.channel CHAN_1505 +/* 0x1505 [0xC1 0x21 ] */ instr SF0_INST_33 +/* 0x1507 [0x88 0x15 0x0B ] */ ldlayer 0, LAYER_150B +/* 0x150A [0xFF ] */ end + +.layer LAYER_150B +/* 0x150B [0x6C 0x06 0x66 ] */ notedv PITCH_F4, 6, 102 +/* 0x150E [0xF4 0xFB ] */ rjump LAYER_150B + +.channel CHAN_1510 +/* 0x1510 [0xC1 0x21 ] */ instr SF0_INST_33 +/* 0x1512 [0x88 0x15 0x16 ] */ ldlayer 0, LAYER_1516 +/* 0x1515 [0xFF ] */ end + +.layer LAYER_1516 +/* 0x1516 [0x70 0x03 0x66 ] */ notedv PITCH_A4, 3, 102 +/* 0x1519 [0xF4 0xFB ] */ rjump LAYER_1516 + +.channel CHAN_151B +/* 0x151B [0xFC 0x28 0x23 ] */ call CHAN_2823 +/* 0x151E [0x88 0x15 0x28 ] */ ldlayer 0, LAYER_1528 +/* 0x1521 [0x89 0x15 0x32 ] */ ldlayer 1, LAYER_1532 +/* 0x1524 [0x8A 0x15 0x3C ] */ ldlayer 2, LAYER_153C +/* 0x1527 [0xFF ] */ end + +.layer LAYER_1528 +/* 0x1528 [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x152A [0xC7 0x81 0x37 0xFF ] */ portamento 0x81, PITCH_E5, 255 +/* 0x152E [0x5F 0x48 0x41 ] */ notedv PITCH_E3, 72, 65 +/* 0x1531 [0xFF ] */ end + +.layer LAYER_1532 +/* 0x1532 [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x1534 [0xC7 0x81 0x37 0xE7 ] */ portamento 0x81, PITCH_E5, 231 +/* 0x1538 [0x6B 0x48 0x3A ] */ notedv PITCH_E4, 72, 58 +/* 0x153B [0xFF ] */ end + +.layer LAYER_153C +/* 0x153C [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x153E [0xCB 0x66 0xD0 0xE7 ] */ env ENVELOPE_66D0, 231 +/* 0x1542 [0xC7 0x81 0x33 0xFF ] */ portamento 0x81, PITCH_C5, 255 +/* 0x1546 [0x58 0x30 0x48 ] */ notedv PITCH_A2, 48, 72 +/* 0x1549 [0xFF ] */ end + +.channel CHAN_154A +/* 0x154A [0xFC 0x28 0x23 ] */ call CHAN_2823 +/* 0x154D [0x88 0x15 0x57 ] */ ldlayer 0, LAYER_1557 +/* 0x1550 [0x89 0x15 0x61 ] */ ldlayer 1, LAYER_1561 +/* 0x1553 [0x8A 0x15 0x6F ] */ ldlayer 2, LAYER_156F +/* 0x1556 [0xFF ] */ end + +.layer LAYER_1557 +/* 0x1557 [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x1559 [0xC7 0x82 0x2C 0xE7 ] */ portamento 0x82, PITCH_F4, 231 +/* 0x155D [0x53 0x48 0x55 ] */ notedv PITCH_E2, 72, 85 +/* 0x1560 [0xFF ] */ end + +.layer LAYER_1561 +/* 0x1561 [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x1563 [0xCB 0x66 0xF4 0xE7 ] */ env ENVELOPE_66F4, 231 +/* 0x1567 [0xC7 0x82 0x33 0xFF ] */ portamento 0x82, PITCH_C5, 255 +/* 0x156B [0x69 0x48 0x70 ] */ notedv PITCH_D4, 72, 112 +/* 0x156E [0xFF ] */ end + +.layer LAYER_156F +/* 0x156F [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x1571 [0xCB 0x66 0xD0 0xE7 ] */ env ENVELOPE_66D0, 231 +/* 0x1575 [0xC7 0x82 0x33 0xFF ] */ portamento 0x82, PITCH_C5, 255 +/* 0x1579 [0x58 0x30 0x55 ] */ notedv PITCH_A2, 48, 85 +/* 0x157C [0xFF ] */ end + +.channel CHAN_157D +/* 0x157D [0xCC 0x1E ] */ ldi 30 +/* 0x157F [0x71 ] */ stio IO_PORT_1 +/* 0x1580 [0x88 0x15 0x8A ] */ ldlayer 0, LAYER_158A +/* 0x1583 [0x89 0x15 0xA2 ] */ ldlayer 1, LAYER_15A2 +/* 0x1586 [0x8A 0x15 0xB1 ] */ ldlayer 2, LAYER_15B1 +/* 0x1589 [0xFF ] */ end + +.layer LAYER_158A +/* 0x158A [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x158C [0xC7 0x81 0x30 0xE7 ] */ portamento 0x81, PITCH_A4, 231 +/* 0x1590 [0x58 0x18 0x4B ] */ notedv PITCH_A2, FRAMERATE_CONST(24, 48), 75 +/* 0x1593 [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x1595 [0xCB 0x67 0x40 0xE7 ] */ env ENVELOPE_6740, 231 +/* 0x1599 [0xC7 0x81 0x26 0xFF ] */ portamento 0x81, PITCH_B3, 255 +/* 0x159D [0x5A 0x80 0xE8 0x69 ] */ notedv PITCH_B2, FRAMERATE_CONST(232, 278), 105 +/* 0x15A1 [0xFF ] */ end + +.layer LAYER_15A2 +/* 0x15A2 [0xC6 0x11 ] */ instr SF0_INST_17 +/* 0x15A4 [0xCB 0x67 0xCC 0xE7 ] */ env ENVELOPE_67CC, 231 +/* 0x15A8 [0xC7 0x81 0x0E 0xFF ] */ portamento 0x81, PITCH_B1, 255 +/* 0x15AC [0x5A 0x80 0xE8 0x5F ] */ notedv PITCH_B2, FRAMERATE_CONST(232, 278), 95 +/* 0x15B0 [0xFF ] */ end + +.layer LAYER_15B1 +/* 0x15B1 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x15B3 [0xCB 0x66 0x10 0xE7 ] */ env ENVELOPE_6610, 231 +/* 0x15B7 [0x64 0x48 0x69 ] */ notedv PITCH_A3, FRAMERATE_CONST(72, 86), 105 +/* 0x15BA [0xFF ] */ end + +.channel CHAN_15BB +/* 0x15BB [0x88 0x15 0xC7 ] */ ldlayer 0, LAYER_15C7 +/* 0x15BE [0x89 0x15 0xC5 ] */ ldlayer 1, LAYER_15C5 +/* 0x15C1 [0x8A 0x21 0x85 ] */ ldlayer 2, LAYER_2185 +/* 0x15C4 [0xFF ] */ end + +.layer LAYER_15C5 +/* 0x15C5 [0xC2 0xEE ] */ transpose -18 +.layer LAYER_15C7 +/* 0x15C7 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x15C9 [0xCF 0xDD ] */ releaserate 221 +/* 0x15CB [0x72 0x80 0xC8 0x55 ] */ notedv PITCH_B4, FRAMERATE_CONST(200, 240), 85 +/* 0x15CF [0xFF ] */ end + +.channel CHAN_15D0 +/* 0x15D0 [0x88 0x15 0xD7 ] */ ldlayer 0, LAYER_15D7 +/* 0x15D3 [0x89 0x1E 0xF0 ] */ ldlayer 1, LAYER_1EF0 +/* 0x15D6 [0xFF ] */ end + +.layer LAYER_15D7 +/* 0x15D7 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x15D9 [0xCF 0xF0 ] */ releaserate 240 +/* 0x15DB [0x72 0x7F 0x55 ] */ notedv PITCH_B4, 127, 85 +/* 0x15DE [0xFF ] */ end + +.channel CHAN_15DF +/* 0x15DF [0x88 0x15 0xE3 ] */ ldlayer 0, LAYER_15E3 +/* 0x15E2 [0xFF ] */ end + +.layer LAYER_15E3 +/* 0x15E3 [0xC6 0x21 ] */ instr SF0_INST_33 +/* 0x15E5 [0xCB 0x65 0xD8 0xFB ] */ env ENVELOPE_65D8, 251 +/* 0x15E9 [0xC2 0x30 ] */ transpose 48 +/* 0x15EB [0xC7 0x81 0x13 0xFF ] */ portamento 0x81, PITCH_E2, 255 +/* 0x15EF [0x6F 0x30 0x50 ] */ notedv PITCH_AF4, 48, 80 +/* 0x15F2 [0xFF ] */ end + +.channel CHAN_15F3 +/* 0x15F3 [0x88 0x2C 0x60 ] */ ldlayer 0, LAYER_2C60 +/* 0x15F6 [0x89 0x1B 0xEF ] */ ldlayer 1, LAYER_1BEF +/* 0x15F9 [0xFF ] */ end + +.channel CHAN_15FA +/* 0x15FA [0x88 0x16 0x01 ] */ ldlayer 0, LAYER_1601 +/* 0x15FD [0x89 0x16 0x0C ] */ ldlayer 1, LAYER_160C +/* 0x1600 [0xFF ] */ end + +.layer LAYER_1601 +/* 0x1601 [0xC6 0x29 ] */ instr SF0_INST_41 +/* 0x1603 [0xCF 0xE0 ] */ releaserate 224 +/* 0x1605 [0x6E 0x06 0x64 ] */ notedv PITCH_G4, 6, 100 +/* 0x1608 [0x63 0x00 0x64 ] */ notedv PITCH_AF3, 0, 100 +/* 0x160B [0xFF ] */ end + +.layer LAYER_160C +/* 0x160C [0xC6 0x27 ] */ instr SF0_INST_39 +/* 0x160E [0x6A 0x14 0x4C ] */ notedv PITCH_EF4, 20, 76 +/* 0x1611 [0xC6 0x21 ] */ instr SF0_INST_33 +/* 0x1613 [0x76 0x0A 0x66 ] */ notedv PITCH_EF5, 10, 102 +/* 0x1616 [0xFF ] */ end + +.channel CHAN_1617 +/* 0x1617 [0xC1 0x2F ] */ instr SF0_INST_47 +/* 0x1619 [0xDA 0x66 0xD0 ] */ env ENVELOPE_66D0 +/* 0x161C [0x88 0x16 0x20 ] */ ldlayer 0, LAYER_1620 +/* 0x161F [0xFF ] */ end + +.layer LAYER_1620 +/* 0x1620 [0x62 0x00 0x5F ] */ notedv PITCH_G3, 0, 95 +/* 0x1623 [0xFF ] */ end + +.channel CHAN_1624 +/* 0x1624 [0xC1 0x20 ] */ instr SF0_INST_32 +/* 0x1626 [0xDA 0x66 0x10 ] */ env ENVELOPE_6610 +/* 0x1629 [0x88 0x16 0x33 ] */ ldlayer 0, LAYER_1633 +/* 0x162C [0x89 0x10 0x5A ] */ ldlayer 1, LAYER_105A +/* 0x162F [0x8A 0x11 0xB7 ] */ ldlayer 2, LAYER_11B7 +/* 0x1632 [0xFF ] */ end + +.layer LAYER_1633 +/* 0x1633 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x1635 [0xC2 0x24 ] */ transpose 36 +/* 0x1637 [0x5F 0x08 0x64 ] */ notedv PITCH_E3, 8, 100 +/* 0x163A [0x64 0x00 0x64 ] */ notedv PITCH_A3, 0, 100 +/* 0x163D [0xFF ] */ end + +.channel CHAN_163E +/* 0x163E [0x88 0x16 0x42 ] */ ldlayer 0, LAYER_1642 +/* 0x1641 [0xFF ] */ end + +.layer LAYER_1642 +/* 0x1642 [0xC6 0x29 ] */ instr SF0_INST_41 +/* 0x1644 [0x62 0x0D 0x60 ] */ notedv PITCH_G3, 13, 96 +/* 0x1647 [0xFF ] */ end + +.channel CHAN_1648 +/* 0x1648 [0xCC 0x10 ] */ ldi 16 +/* 0x164A [0x71 ] */ stio IO_PORT_1 +/* 0x164B [0x89 0x16 0x51 ] */ ldlayer 1, LAYER_1651 +/* 0x164E [0xFB 0x10 0xE6 ] */ jump CHAN_10E6 + +.layer LAYER_1651 +/* 0x1651 [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x1653 [0xCB 0x66 0x10 0xEB ] */ env ENVELOPE_6610, 235 +/* 0x1657 [0xC7 0x82 0x1D 0x7F ] */ portamento 0x82, PITCH_D3, 127 +/* 0x165B [0x55 0x28 0x4A ] */ notedv PITCH_GF2, 40, 74 +/* 0x165E [0xFF ] */ end + +.filter FILTER_1660 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.filter FILTER_1670 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.channel environmentbank_handler_1 +/* 0x1680 [0xB0 0x30 0xC0 ] */ ldfilter FILTER_30C0 +/* 0x1683 [0xF4 0x08 ] */ rjump CHAN_168D + +.channel environmentbank_handler_2 +/* 0x1685 [0xB0 0x30 0xD0 ] */ ldfilter FILTER_30D0 +/* 0x1688 [0xF4 0x03 ] */ rjump CHAN_168D + +.channel environmentbank_handler_3 +/* 0x168A [0xB0 0x30 0xE0 ] */ ldfilter FILTER_30E0 +CHAN_168D: +/* 0x168D [0xFC 0x00 0x72 ] */ call CHAN_0072 +/* 0x1690 [0xC6 0x00 ] */ font Soundfont_0_ID +/* 0x1692 [0xB3 0x00 ] */ filter 0, 0 +/* 0x1694 [0xE3 0x00 ] */ vibdelay 0 +CHAN_1696: +/* 0x1696 [0xFE ] */ delay1 +/* 0x1697 [0x60 ] */ ldio IO_PORT_0 +/* 0x1698 [0xC8 0x01 ] */ sub 1 +/* 0x169A [0xF3 0x02 ] */ rbeqz CHAN_169E +/* 0x169C [0xF4 0xF8 ] */ rjump CHAN_1696 + +CHAN_169E: +/* 0x169E [0xD8 0x00 ] */ vibdepth 0 +/* 0x16A0 [0xD1 0x00 ] */ notealloc 0 +/* 0x16A2 [0xF0 ] */ freenotelist +/* 0x16A3 [0xDC 0x7F ] */ panweight 127 +/* 0x16A5 [0xFC 0x00 0x7C ] */ call CHAN_007C +/* 0x16A8 [0x92 ] */ dellayer 2 +/* 0x16A9 [0x64 ] */ ldio IO_PORT_SFX_INDEX_LOBITS +/* 0x16AA [0xF5 0x16 0xB4 ] */ bgez CHAN_16B4 +/* 0x16AD [0xC9 0x7F ] */ and 127 +/* 0x16AF [0xC2 0x17 0xD5 ] */ dyntbl environmentbank_table + 2 * 1 * 128 +/* 0x16B2 [0xF4 0x03 ] */ rjump CHAN_16B7 + +CHAN_16B4: +/* 0x16B4 [0xC2 0x16 0xD5 ] */ dyntbl environmentbank_table + 2 * 0 * 128 +CHAN_16B7: +/* 0x16B7 [0xE4 ] */ dyncall +CHAN_16B8: +/* 0x16B8 [0x63 ] */ ldio IO_PORT_3 +/* 0x16B9 [0xC7 0x00 0x16 0xBE ] */ stseq 0, STSEQ_HERE + STSEQ_FILTER_IDX +/* 0x16BD [0xB3 0x00 ] */ filter 0, 0 +/* 0x16BF [0xFC 0x00 0x84 ] */ call CHAN_0084 +/* 0x16C2 [0xFE ] */ delay1 +/* 0x16C3 [0x60 ] */ ldio IO_PORT_0 +/* 0x16C4 [0xF3 0x0A ] */ rbeqz CHAN_16D0 +/* 0x16C6 [0xF2 0x02 ] */ rbltz CHAN_16CA +/* 0x16C8 [0xF4 0xD4 ] */ rjump CHAN_169E + +CHAN_16CA: +/* 0x16CA [0x80 ] */ testlayer 0 +/* 0x16CB [0xF3 0xEB ] */ rbeqz CHAN_16B8 +/* 0x16CD [0xCC 0xFF ] */ ldi 255 +/* 0x16CF [0x71 ] */ stio IO_PORT_1 +CHAN_16D0: +/* 0x16D0 [0x90 ] */ dellayer 0 +/* 0x16D1 [0x91 ] */ dellayer 1 +/* 0x16D2 [0x92 ] */ dellayer 2 +/* 0x16D3 [0xF4 0xC1 ] */ rjump CHAN_1696 + +#define DEFINE_SFX(lblName, sfxId, priority, decay, rand, flags) \ + entry lblName + +.table_unaligned environmentbank_table + #include "environmentbank_table.h" + +#undef DEFINE_SFX + +.channel CHAN_18C5 +/* 0x18C5 [0xE5 0x01 ] */ reverbidx 1 +/* 0x18C7 [0xCC 0x00 ] */ ldi 0 +/* 0x18C9 [0x71 ] */ stio IO_PORT_1 +.channel CHAN_18CA +/* 0x18CA [0x88 0x18 0xCE ] */ ldlayer 0, LAYER_18CE +/* 0x18CD [0xFF ] */ end + +.layer LAYER_18CE +/* 0x18CE [0xC6 0x2D ] */ instr SF0_INST_45 +/* 0x18D0 [0x64 0x30 0x64 ] */ notedv PITCH_A3, 48, 100 +/* 0x18D3 [0xC6 0x42 ] */ instr SF0_INST_66 +/* 0x18D5 [0x64 0x30 0x4B ] */ notedv PITCH_A3, 48, 75 +/* 0x18D8 [0xFF ] */ end + +.channel CHAN_18D9 +/* 0x18D9 [0x88 0x18 0xDD ] */ ldlayer 0, LAYER_18DD +/* 0x18DC [0xFF ] */ end + +.layer LAYER_18DD +/* 0x18DD [0xC6 0x2D ] */ instr SF0_INST_45 +/* 0x18DF [0xC2 0x30 ] */ transpose 48 +/* 0x18E1 [0x64 0x60 0x64 ] */ notedv PITCH_A3, 96, 100 +/* 0x18E4 [0xFF ] */ end + +.channel CHAN_18E5 +/* 0x18E5 [0x88 0x18 0xE9 ] */ ldlayer 0, LAYER_18E9 +/* 0x18E8 [0xFF ] */ end + +.layer LAYER_18E9 +/* 0x18E9 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x18EB [0xCB 0x65 0xE8 0xFB ] */ env ENVELOPE_65E8, 251 +/* 0x18EF [0x70 0x0C 0x6E ] */ notedv PITCH_A4, 12, 110 +/* 0x18F2 [0x64 0x7F 0x6E ] */ notedv PITCH_A3, 127, 110 +/* 0x18F5 [0xFF ] */ end + +.channel CHAN_18F6 +/* 0x18F6 [0xC1 0x30 ] */ instr SF0_INST_48 +/* 0x18F8 [0x88 0x18 0xFC ] */ ldlayer 0, LAYER_18FC +/* 0x18FB [0xFF ] */ end + +.layer LAYER_18FC +/* 0x18FC [0x62 0x18 0x6E ] */ notedv PITCH_G3, 24, 110 +/* 0x18FF [0xFF ] */ end + +.channel CHAN_1900 +/* 0x1900 [0xC1 0x30 ] */ instr SF0_INST_48 +/* 0x1902 [0x88 0x19 0x06 ] */ ldlayer 0, LAYER_1906 +/* 0x1905 [0xFF ] */ end + +.layer LAYER_1906 +/* 0x1906 [0x67 0x25 0x6E ] */ notedv PITCH_C4, 37, 110 +/* 0x1909 [0xFF ] */ end + +.channel CHAN_190A +/* 0x190A [0xC1 0x32 ] */ instr SF0_INST_50 +/* 0x190C [0x88 0x19 0x10 ] */ ldlayer 0, LAYER_1910 +/* 0x190F [0xFF ] */ end + +.layer LAYER_1910 +/* 0x1910 [0x67 0x80 0xAF 0x6E ] */ notedv PITCH_C4, 175, 110 +/* 0x1914 [0xFF ] */ end + +.channel CHAN_1915 +/* 0x1915 [0xC1 0x33 ] */ instr SF0_INST_51 +/* 0x1917 [0xDC 0x30 ] */ panweight 48 +/* 0x1919 [0x88 0x19 0x22 ] */ ldlayer 0, LAYER_1922 +/* 0x191C [0x89 0x19 0x20 ] */ ldlayer 1, LAYER_1920 +/* 0x191F [0xFF ] */ end + +.layer LAYER_1920 +/* 0x1920 [0xC2 0x07 ] */ transpose 7 +.layer LAYER_1922 +/* 0x1922 [0xC4 ] */ legato +LAYER_1923: +/* 0x1923 [0x5B 0xFD 0x00 0x4B ] */ notedv PITCH_C3, 32000, 75 +/* 0x1927 [0xF4 0xFA ] */ rjump LAYER_1923 + +.channel CHAN_1929 +/* 0x1929 [0xDC 0x30 ] */ panweight 48 +/* 0x192B [0x88 0x19 0x36 ] */ ldlayer 0, LAYER_1936 +/* 0x192E [0x89 0x19 0x32 ] */ ldlayer 1, LAYER_1932 +/* 0x1931 [0xFF ] */ end + +.layer LAYER_1932 +/* 0x1932 [0xC2 0x36 ] */ transpose 54 +/* 0x1934 [0xF4 0x02 ] */ rjump LAYER_1938 + +.layer LAYER_1936 +/* 0x1936 [0xC2 0x30 ] */ transpose 48 +LAYER_1938: +/* 0x1938 [0xC6 0x33 ] */ instr SF0_INST_51 +/* 0x193A [0xCB 0x66 0xF4 0xDC ] */ env ENVELOPE_66F4, 220 +/* 0x193E [0xC4 ] */ legato +LAYER_193F: +/* 0x193F [0x67 0xFD 0x00 0x5C ] */ notedv PITCH_C4, 32000, 92 +/* 0x1943 [0xF4 0xFA ] */ rjump LAYER_193F + +.channel CHAN_1945 +/* 0x1945 [0xC1 0x13 ] */ instr SF0_INST_19 +/* 0x1947 [0xDA 0x66 0x10 ] */ env ENVELOPE_6610 +/* 0x194A [0x88 0x19 0x4E ] */ ldlayer 0, LAYER_194E +/* 0x194D [0xFF ] */ end + +.layer LAYER_194E +/* 0x194E [0x72 0x06 0x64 ] */ notedv PITCH_B4, 6, 100 +/* 0x1951 [0xC7 0x81 0x30 0xC8 ] */ portamento 0x81, PITCH_A4, 200 +/* 0x1955 [0x6B 0x48 0x5A ] */ notedv PITCH_E4, 72, 90 +/* 0x1958 [0xFF ] */ end + +.channel CHAN_1959 +/* 0x1959 [0x88 0x19 0x5D ] */ ldlayer 0, LAYER_195D +/* 0x195C [0xFF ] */ end + +.layer LAYER_195D +/* 0x195D [0xC6 0x13 ] */ instr SF0_INST_19 +/* 0x195F [0xCB 0x65 0xFC 0x7F ] */ env ENVELOPE_65FC, 127 +/* 0x1963 [0xC7 0x81 0x24 0xC8 ] */ portamento 0x81, PITCH_A3, 200 +/* 0x1967 [0x58 0x7F 0x5A ] */ notedv PITCH_A2, 127, 90 +/* 0x196A [0xFF ] */ end + +.channel CHAN_196B +/* 0x196B [0x88 0x19 0x6F ] */ ldlayer 0, LAYER_196F +/* 0x196E [0xFF ] */ end + +.layer LAYER_196F +/* 0x196F [0xC6 0x37 ] */ instr SF0_INST_55 +/* 0x1971 [0xCF 0xF5 ] */ releaserate 245 +/* 0x1973 [0xC4 ] */ legato +/* 0x1974 [0xC7 0x01 0x0F 0x30 ] */ portamento 0x01, PITCH_C2, 48 +LAYER_1978: +/* 0x1978 [0x5B 0xFF 0xBC 0x64 ] */ notedv PITCH_C3, 32700, 100 +/* 0x197C [0xF4 0xFA ] */ rjump LAYER_1978 + +.channel CHAN_197E +/* 0x197E [0xC1 0x38 ] */ instr SF0_INST_56 +/* 0x1980 [0xDC 0x30 ] */ panweight 48 +/* 0x1982 [0xD9 0x70 ] */ releaserate 112 +/* 0x1984 [0x88 0x19 0x88 ] */ ldlayer 0, LAYER_1988 +/* 0x1987 [0xFF ] */ end + +.layer LAYER_1988 +/* 0x1988 [0xC4 ] */ legato +LAYER_1989: +/* 0x1989 [0x5F 0xFF 0xBC 0x64 ] */ notedv PITCH_E3, 32700, 100 +/* 0x198D [0xF4 0xFA ] */ rjump LAYER_1989 + +.channel CHAN_198F +/* 0x198F [0x88 0x19 0x96 ] */ ldlayer 0, LAYER_1996 +/* 0x1992 [0x89 0x19 0xB0 ] */ ldlayer 1, LAYER_19B0 +/* 0x1995 [0xFF ] */ end + +.layer LAYER_1996 +/* 0x1996 [0xC6 0x22 ] */ instr SF0_INST_34 +/* 0x1998 [0xCF 0xEB ] */ releaserate 235 +/* 0x199A [0x20 0x19 0x38 0x0A ] */ notedvg PITCH_F3, 25, 56, 10 +/* 0x199E [0x22 0x17 0x38 0x0A ] */ notedvg PITCH_G3, 23, 56, 10 +/* 0x19A2 [0x24 0x15 0x38 0x0A ] */ notedvg PITCH_A3, 21, 56, 10 +/* 0x19A6 [0x25 0x13 0x38 0x0A ] */ notedvg PITCH_BF3, 19, 56, 10 +LAYER_19AA: +/* 0x19AA [0x27 0x13 0x38 0x0A ] */ notedvg PITCH_C4, 19, 56, 10 +/* 0x19AE [0xF4 0xFA ] */ rjump LAYER_19AA + +.layer LAYER_19B0 +/* 0x19B0 [0xC6 0x39 ] */ instr SF0_INST_57 +/* 0x19B2 [0xC4 ] */ legato +/* 0x19B3 [0xC7 0x85 0x12 0xFF ] */ portamento 0x85, PITCH_EF2, 255 +/* 0x19B7 [0x59 0x14 0x5A ] */ notedv PITCH_BF2, 20, 90 +/* 0x19BA [0x5E 0x0A 0x5A ] */ notedv PITCH_EF3, 10, 90 +LAYER_19BD: +/* 0x19BD [0x5E 0xFF 0xBC 0x5A ] */ notedv PITCH_EF3, 32700, 90 +/* 0x19C1 [0xF4 0xFA ] */ rjump LAYER_19BD + +.channel CHAN_19C3 +/* 0x19C3 [0xC1 0x39 ] */ instr SF0_INST_57 +/* 0x19C5 [0x88 0x19 0xCC ] */ ldlayer 0, LAYER_19CC +/* 0x19C8 [0x89 0x19 0xDD ] */ ldlayer 1, LAYER_19DD +/* 0x19CB [0xFF ] */ end + +.layer LAYER_19CC +/* 0x19CC [0xC4 ] */ legato +/* 0x19CD [0xC7 0x85 0x14 0xFF ] */ portamento 0x85, PITCH_F2, 255 +/* 0x19D1 [0x58 0x1E 0x5A ] */ notedv PITCH_A2, 30, 90 +/* 0x19D4 [0x5F 0x0F 0x5A ] */ notedv PITCH_E3, 15, 90 +LAYER_19D7: +/* 0x19D7 [0x5F 0xFF 0xBC 0x5A ] */ notedv PITCH_E3, 32700, 90 +/* 0x19DB [0xF4 0xFA ] */ rjump LAYER_19D7 + +.layer LAYER_19DD +/* 0x19DD [0xC6 0x22 ] */ instr SF0_INST_34 +/* 0x19DF [0xCF 0xEB ] */ releaserate 235 +/* 0x19E1 [0x22 0x19 0x38 0x0A ] */ notedvg PITCH_G3, 25, 56, 10 +/* 0x19E5 [0x24 0x17 0x38 0x0A ] */ notedvg PITCH_A3, 23, 56, 10 +/* 0x19E9 [0x26 0x15 0x38 0x0A ] */ notedvg PITCH_B3, 21, 56, 10 +/* 0x19ED [0x27 0x13 0x38 0x0A ] */ notedvg PITCH_C4, 19, 56, 10 +LAYER_19F1: +/* 0x19F1 [0x29 0x11 0x38 0x0A ] */ notedvg PITCH_D4, 17, 56, 10 +/* 0x19F5 [0xF4 0xFA ] */ rjump LAYER_19F1 + +.channel CHAN_19F7 +/* 0x19F7 [0xDA 0x65 0xE8 ] */ env ENVELOPE_65E8 +/* 0x19FA [0x88 0x1A 0x07 ] */ ldlayer 0, LAYER_1A07 +/* 0x19FD [0x89 0x1A 0x01 ] */ ldlayer 1, LAYER_1A01 +/* 0x1A00 [0xFF ] */ end + +.layer LAYER_1A01 +/* 0x1A01 [0xC6 0x24 ] */ instr SF0_INST_36 +/* 0x1A03 [0x5A 0x64 0x4B ] */ notedv PITCH_B2, 100, 75 +/* 0x1A06 [0xFF ] */ end + +.layer LAYER_1A07 +/* 0x1A07 [0xC6 0x3B ] */ instr SF0_INST_59 +/* 0x1A09 [0x45 0x80 0xB4 0x6E ] */ notedv PITCH_D1, 180, 110 +/* 0x1A0D [0xFF ] */ end + +.channel CHAN_1A0E +/* 0x1A0E [0xDA 0x65 0xE8 ] */ env ENVELOPE_65E8 +/* 0x1A11 [0x88 0x1A 0x1E ] */ ldlayer 0, LAYER_1A1E +/* 0x1A14 [0x89 0x1A 0x18 ] */ ldlayer 1, LAYER_1A18 +/* 0x1A17 [0xFF ] */ end + +.layer LAYER_1A18 +/* 0x1A18 [0xC6 0x24 ] */ instr SF0_INST_36 +/* 0x1A1A [0x5A 0x64 0x4B ] */ notedv PITCH_B2, 100, 75 +/* 0x1A1D [0xFF ] */ end + +.layer LAYER_1A1E +/* 0x1A1E [0xC6 0x3B ] */ instr SF0_INST_59 +/* 0x1A20 [0x4B 0x80 0xB4 0x6E ] */ notedv PITCH_AF1, 180, 110 +/* 0x1A24 [0xFF ] */ end + +.channel CHAN_1A25 +/* 0x1A25 [0x88 0x1A 0x36 ] */ ldlayer 0, LAYER_1A36 +/* 0x1A28 [0x89 0x1B 0x41 ] */ ldlayer 1, LAYER_1B41 +/* 0x1A2B [0xFF ] */ end + +CHAN_1A2C: +/* 0x1A2C [0x89 0x1A 0x34 ] */ ldlayer 1, LAYER_1A34 +/* 0x1A2F [0xFF ] */ end + +.layer LAYER_1A30 +/* 0x1A30 [0xC2 0xF4 ] */ transpose -12 +/* 0x1A32 [0xF4 0x02 ] */ rjump LAYER_1A36 + +.layer LAYER_1A34 +/* 0x1A34 [0xC2 0xE8 ] */ transpose -24 +.layer LAYER_1A36 +/* 0x1A36 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x1A38 [0xCB 0x66 0x88 0xE6 ] */ env ENVELOPE_6688, 230 +/* 0x1A3C [0xC7 0x81 0x3A 0x7F ] */ portamento 0x81, PITCH_G5, 127 +/* 0x1A40 [0x67 0x52 0x5F ] */ notedv PITCH_C4, 82, 95 +/* 0x1A43 [0xC7 0x81 0x33 0x7F ] */ portamento 0x81, PITCH_C5, 127 +/* 0x1A47 [0x60 0x80 0xB9 0x46 ] */ notedv PITCH_F3, 185, 70 +/* 0x1A4B [0xFF ] */ end + +.channel CHAN_1A4C +/* 0x1A4C [0xC1 0x3A ] */ instr SF0_INST_58 +/* 0x1A4E [0x88 0x1A 0x52 ] */ ldlayer 0, LAYER_1A52 +/* 0x1A51 [0xFF ] */ end + +.layer LAYER_1A52 +/* 0x1A52 [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x1A56 [0x68 0x80 0xA0 0x69 ] */ notedv PITCH_DF4, 160, 105 +/* 0x1A5A [0xFF ] */ end + +.channel CHAN_1A5B +/* 0x1A5B [0x88 0x1A 0x5F ] */ ldlayer 0, LAYER_1A5F +/* 0x1A5E [0xFF ] */ end + +.layer LAYER_1A5F +/* 0x1A5F [0xC6 0x3D ] */ instr SF0_INST_61 +/* 0x1A61 [0x23 0x0C 0x5F 0x0A ] */ notedvg PITCH_AF3, 12, 95, 10 +/* 0x1A65 [0xC6 0x3A ] */ instr SF0_INST_58 +/* 0x1A67 [0xCB 0x65 0xD8 0xFB ] */ env ENVELOPE_65D8, 251 +/* 0x1A6B [0xC7 0x81 0x33 0x7F ] */ portamento 0x81, PITCH_C5, 127 +/* 0x1A6F [0x6B 0x48 0x69 ] */ notedv PITCH_E4, 72, 105 +/* 0x1A72 [0xFF ] */ end + +.channel CHAN_1A73 +/* 0x1A73 [0xC1 0x3D ] */ instr SF0_INST_61 +/* 0x1A75 [0x88 0x1A 0x79 ] */ ldlayer 0, LAYER_1A79 +/* 0x1A78 [0xFF ] */ end + +.layer LAYER_1A79 +/* 0x1A79 [0x67 0x80 0xA6 0x69 ] */ notedv PITCH_C4, 166, 105 +/* 0x1A7D [0xFF ] */ end + +.channel CHAN_1A7E +/* 0x1A7E [0xC1 0x36 ] */ instr SF0_INST_54 +/* 0x1A80 [0xDA 0x66 0x10 ] */ env ENVELOPE_6610 +/* 0x1A83 [0x88 0x1A 0x87 ] */ ldlayer 0, LAYER_1A87 +/* 0x1A86 [0xFF ] */ end + +.layer LAYER_1A87 +/* 0x1A87 [0xC7 0x81 0x20 0xAF ] */ portamento 0x81, PITCH_F3, 175 +/* 0x1A8B [0x66 0x30 0x73 ] */ notedv PITCH_B3, 48, 115 +/* 0x1A8E [0xFF ] */ end + +.channel CHAN_1A8F +/* 0x1A8F [0x88 0x1A 0x96 ] */ ldlayer 0, LAYER_1A96 +/* 0x1A92 [0x89 0x1A 0xA5 ] */ ldlayer 1, LAYER_1AA5 +/* 0x1A95 [0xFF ] */ end + +.layer LAYER_1A96 +/* 0x1A96 [0xC6 0x3F ] */ instr SF0_INST_63 +/* 0x1A98 [0x67 0x04 0x69 ] */ notedv PITCH_C4, 4, 105 +/* 0x1A9B [0xC6 0x3B ] */ instr SF0_INST_59 +/* 0x1A9D [0xCB 0x66 0x4C 0xFF ] */ env ENVELOPE_664C, 255 +/* 0x1AA1 [0x4D 0x28 0x69 ] */ notedv PITCH_BF1, 40, 105 +/* 0x1AA4 [0xFF ] */ end + +.layer LAYER_1AA5 +/* 0x1AA5 [0xC6 0x3B ] */ instr SF0_INST_59 +/* 0x1AA7 [0xCB 0x66 0x4C 0xFB ] */ env ENVELOPE_664C, 251 +/* 0x1AAB [0x1B 0x04 0x66 0x60 ] */ notedvg PITCH_C3, 4, 102, 96 +/* 0x1AAF [0x4D 0x28 0x66 ] */ notedv PITCH_BF1, 40, 102 +/* 0x1AB2 [0xFF ] */ end + +.channel CHAN_1AB3 +/* 0x1AB3 [0x88 0x1A 0xB7 ] */ ldlayer 0, LAYER_1AB7 +/* 0x1AB6 [0xFF ] */ end + +.layer LAYER_1AB7 +/* 0x1AB7 [0xC2 0x30 ] */ transpose 48 +LAYER_1AB9: +/* 0x1AB9 [0xC6 0x32 ] */ instr SF0_INST_50 +/* 0x1ABB [0xC4 ] */ legato +/* 0x1ABC [0xC7 0x85 0x22 0xFF ] */ portamento 0x85, PITCH_G3, 255 +/* 0x1AC0 [0x63 0x06 0x55 ] */ notedv PITCH_AF3, 6, 85 +/* 0x1AC3 [0x5E 0x08 0x55 ] */ notedv PITCH_EF3, 8, 85 +/* 0x1AC6 [0x5A 0x73 0x55 ] */ notedv PITCH_B2, 115, 85 +/* 0x1AC9 [0xFF ] */ end + +.channel CHAN_1ACA +/* 0x1ACA [0x88 0x1A 0xD0 ] */ ldlayer 0, LAYER_1AD0 +/* 0x1ACD [0xFF ] */ end + +.layer LAYER_1ACE +/* 0x1ACE [0xC2 0x06 ] */ transpose 6 +.layer LAYER_1AD0 +/* 0x1AD0 [0xC6 0x3E ] */ instr SF0_INST_62 +/* 0x1AD2 [0x6C 0x5C 0x73 ] */ notedv PITCH_F4, 92, 115 +/* 0x1AD5 [0xFF ] */ end + +.channel CHAN_1AD6 +/* 0x1AD6 [0xC1 0x30 ] */ instr SF0_INST_48 +/* 0x1AD8 [0x88 0x1A 0xDC ] */ ldlayer 0, LAYER_1ADC +/* 0x1ADB [0xFF ] */ end + +.layer LAYER_1ADC +/* 0x1ADC [0x69 0x08 0x6E ] */ notedv PITCH_D4, 8, 110 +/* 0x1ADF [0x6B 0x0F 0x6E ] */ notedv PITCH_E4, 15, 110 +/* 0x1AE2 [0xFF ] */ end + +.channel CHAN_1AE3 +/* 0x1AE3 [0xC1 0x30 ] */ instr SF0_INST_48 +/* 0x1AE5 [0x88 0x1A 0xE9 ] */ ldlayer 0, LAYER_1AE9 +/* 0x1AE8 [0xFF ] */ end + +.layer LAYER_1AE9 +/* 0x1AE9 [0x6C 0x0A 0x6E ] */ notedv PITCH_F4, 10, 110 +/* 0x1AEC [0x69 0x12 0x6E ] */ notedv PITCH_D4, 18, 110 +/* 0x1AEF [0xFF ] */ end + +.channel CHAN_1AF0 +/* 0x1AF0 [0xC1 0x0C ] */ instr SF0_INST_12 +/* 0x1AF2 [0xDA 0x66 0x7C ] */ env ENVELOPE_667C +/* 0x1AF5 [0x88 0x1A 0xF9 ] */ ldlayer 0, LAYER_1AF9 +/* 0x1AF8 [0xFF ] */ end + +.layer LAYER_1AF9 +/* 0x1AF9 [0xC7 0x81 0x26 0xFF ] */ portamento 0x81, PITCH_B3, 255 +/* 0x1AFD [0x5B 0x3C 0x50 ] */ notedv PITCH_C3, 60, 80 +/* 0x1B00 [0xFF ] */ end + +.channel CHAN_1B01 +/* 0x1B01 [0x88 0x1B 0x05 ] */ ldlayer 0, LAYER_1B05 +/* 0x1B04 [0xFF ] */ end + +.layer LAYER_1B05 +/* 0x1B05 [0xC6 0x45 ] */ instr SF0_INST_69 +/* 0x1B07 [0xCB 0x67 0x94 0xFB ] */ env ENVELOPE_6794, 251 +/* 0x1B0B [0xC7 0x01 0x34 0x81 0x00] */ portamento 0x01, PITCH_DF5, 256 +/* 0x1B10 [0x7E 0x48 0x41 ] */ notedv PITCH_B5, 72, 65 +/* 0x1B13 [0xFF ] */ end + +.channel CHAN_1B14 +/* 0x1B14 [0xC1 0x36 ] */ instr SF0_INST_54 +/* 0x1B16 [0xDA 0x66 0x10 ] */ env ENVELOPE_6610 +/* 0x1B19 [0x88 0x1B 0x1D ] */ ldlayer 0, LAYER_1B1D +/* 0x1B1C [0xFF ] */ end + +.layer LAYER_1B1D +/* 0x1B1D [0xC7 0x81 0x26 0xAF ] */ portamento 0x81, PITCH_B3, 175 +/* 0x1B21 [0x60 0x30 0x73 ] */ notedv PITCH_F3, 48, 115 +/* 0x1B24 [0xFF ] */ end + +.channel CHAN_1B25 +/* 0x1B25 [0xED 0x14 ] */ gain 20 +/* 0x1B27 [0x88 0x1B 0x2E ] */ ldlayer 0, LAYER_1B2E +/* 0x1B2A [0x89 0x1B 0x41 ] */ ldlayer 1, LAYER_1B41 +/* 0x1B2D [0xFF ] */ end + +.layer LAYER_1B2E +/* 0x1B2E [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x1B30 [0xCF 0xA0 ] */ releaserate 160 +/* 0x1B32 [0x6B 0x32 0x66 ] */ notedv PITCH_E4, 50, 102 +LAYER_1B35: +/* 0x1B35 [0xC6 0x41 ] */ instr SF0_INST_65 +/* 0x1B37 [0xCB 0x67 0x40 0xF5 ] */ env ENVELOPE_6740, 245 +/* 0x1B3B [0x53 0x64 0x50 ] */ notedv PITCH_E2, 100, 80 +/* 0x1B3E [0xFF ] */ end + +.layer LAYER_1B3F +/* 0x1B3F [0xC2 0x04 ] */ transpose 4 +.layer LAYER_1B41 +/* 0x1B41 [0xC6 0x41 ] */ instr SF0_INST_65 +/* 0x1B43 [0x5F 0x64 0x6E ] */ notedv PITCH_E3, 100, 110 +/* 0x1B46 [0xFF ] */ end + +.channel CHAN_1B47 +/* 0x1B47 [0xC1 0x36 ] */ instr SF0_INST_54 +/* 0x1B49 [0xDA 0x66 0x74 ] */ env ENVELOPE_6674 +/* 0x1B4C [0x88 0x1B 0x57 ] */ ldlayer 0, LAYER_1B57 +/* 0x1B4F [0x89 0x1B 0x53 ] */ ldlayer 1, LAYER_1B53 +/* 0x1B52 [0xFF ] */ end + +.layer LAYER_1B53 +/* 0x1B53 [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x1B55 [0xC2 0x16 ] */ transpose 22 +.layer LAYER_1B57 +/* 0x1B57 [0xC4 ] */ legato +/* 0x1B58 [0xC7 0x81 0x22 0xAF ] */ portamento 0x81, PITCH_G3, 175 +LAYER_1B5C: +/* 0x1B5C [0x58 0x60 0x73 ] */ notedv PITCH_A2, 96, 115 +/* 0x1B5F [0xF4 0xFB ] */ rjump LAYER_1B5C + +.channel CHAN_1B61 +/* 0x1B61 [0x88 0x1B 0x71 ] */ ldlayer 0, LAYER_1B71 +/* 0x1B64 [0x89 0x1B 0x68 ] */ ldlayer 1, LAYER_1B68 +/* 0x1B67 [0xFF ] */ end + +.layer LAYER_1B68 +/* 0x1B68 [0xC6 0x2D ] */ instr SF0_INST_45 +/* 0x1B6A [0x70 0x03 0x73 ] */ notedv PITCH_A4, 3, 115 +/* 0x1B6D [0x77 0x06 0x73 ] */ notedv PITCH_E5, 6, 115 +/* 0x1B70 [0xFF ] */ end + +.layer LAYER_1B71 +/* 0x1B71 [0xC0 0x19 ] */ ldelay 25 +/* 0x1B73 [0xC6 0x42 ] */ instr SF0_INST_66 +/* 0x1B75 [0xC7 0x81 0x1F 0xFF ] */ portamento 0x81, PITCH_E3, 255 +/* 0x1B79 [0x62 0x18 0x64 ] */ notedv PITCH_G3, 24, 100 +/* 0x1B7C [0xFF ] */ end + +.channel CHAN_1B7D +/* 0x1B7D [0x88 0x1B 0x81 ] */ ldlayer 0, LAYER_1B81 +/* 0x1B80 [0xFF ] */ end + +.layer LAYER_1B81 +/* 0x1B81 [0xC6 0x42 ] */ instr SF0_INST_66 +/* 0x1B83 [0xCB 0x65 0xFC 0xFA ] */ env ENVELOPE_65FC, 250 +/* 0x1B87 [0xC7 0x83 0x20 0xFF ] */ portamento 0x83, PITCH_F3, 255 +/* 0x1B8B [0x1D 0x18 0x64 0x7F ] */ notedvg PITCH_D3, FRAMERATE_CONST(24, 28), 100, 127 +/* 0x1B8F [0x67 0x48 0x64 ] */ notedv PITCH_C4, FRAMERATE_CONST(72, 86), 100 +/* 0x1B92 [0xFF ] */ end + +.channel CHAN_1B93 +/* 0x1B93 [0xC1 0x21 ] */ instr SF0_INST_33 +/* 0x1B95 [0xCC 0x07 ] */ ldi 7 +/* 0x1B97 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x1B9A [0xD1 0x02 ] */ notealloc 2 +/* 0x1B9C [0xF1 0x02 ] */ allocnotelist 2 +/* 0x1B9E [0x88 0x1B 0xBA ] */ ldlayer 0, LAYER_1BBA +CHAN_1BA1: +/* 0x1BA1 [0x66 ] */ ldio IO_PORT_6 +/* 0x1BA2 [0xC9 0x03 ] */ and 3 +/* 0x1BA4 [0xCB 0x1B 0xB6 ] */ ldseq UNK_1BB6 +/* 0x1BA7 [0xC7 0x00 0x1B 0xE7 ] */ stseq 0, LAYER_1BE6 + STSEQ_LDELAY +/* 0x1BAB [0xC7 0x08 0x1B 0xB0 ] */ stseq 8, STSEQ_HERE + STSEQ_LDI_IMM +/* 0x1BAF [0xCC 0x30 ] */ ldi 48 +/* 0x1BB1 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x1BB4 [0xF4 0xEB ] */ rjump CHAN_1BA1 + +UNK_1BB6: + .byte 0x20, 0x0E, 0x05, 0x20 + +.layer LAYER_1BBA +/* 0x1BBA [0xC2 0x30 ] */ transpose 48 +LAYER_1BBC: +/* 0x1BBC [0x26 0x02 0x46 0x7F ] */ notedvg PITCH_B3, 2, 70, 127 +/* 0x1BC0 [0x5B 0x02 0x46 ] */ notedv PITCH_C3, 2, 70 +/* 0x1BC3 [0xFC 0x1B 0xE6 ] */ call LAYER_1BE6 +/* 0x1BC6 [0x20 0x02 0x46 0x7F ] */ notedvg PITCH_F3, 2, 70, 127 +/* 0x1BCA [0x55 0x02 0x46 ] */ notedv PITCH_GF2, 2, 70 +/* 0x1BCD [0xFC 0x1B 0xE6 ] */ call LAYER_1BE6 +/* 0x1BD0 [0x32 0x02 0x46 0x7F ] */ notedvg PITCH_B4, 2, 70, 127 +/* 0x1BD4 [0x67 0x02 0x46 ] */ notedv PITCH_C4, 2, 70 +/* 0x1BD7 [0xFC 0x1B 0xE6 ] */ call LAYER_1BE6 +/* 0x1BDA [0x2C 0x02 0x46 0x7F ] */ notedvg PITCH_F4, 2, 70, 127 +/* 0x1BDE [0x61 0x02 0x46 ] */ notedv PITCH_GF3, 2, 70 +/* 0x1BE1 [0xFC 0x1B 0xE6 ] */ call LAYER_1BE6 +/* 0x1BE4 [0xF4 0xD6 ] */ rjump LAYER_1BBC + +.layer LAYER_1BE6 +/* 0x1BE6 [0xC0 0x14 ] */ ldelay 20 +/* 0x1BE8 [0xFF ] */ end + +.channel CHAN_1BE9 +/* 0x1BE9 [0xED 0x0F ] */ gain 15 +/* 0x1BEB [0x88 0x1B 0xEF ] */ ldlayer 0, LAYER_1BEF +/* 0x1BEE [0xFF ] */ end + +.layer LAYER_1BEF +/* 0x1BEF [0xC6 0x43 ] */ instr SF0_INST_67 +/* 0x1BF1 [0xC7 0x81 0x1B 0x98 ] */ portamento 0x81, PITCH_C3, 152 +/* 0x1BF5 [0x67 0x3C 0x64 ] */ notedv PITCH_C4, 60, 100 +/* 0x1BF8 [0xFF ] */ end + +.channel CHAN_1BF9 +/* 0x1BF9 [0xC1 0x1A ] */ instr SF0_INST_26 +/* 0x1BFB [0x88 0x1C 0x05 ] */ ldlayer 0, LAYER_1C05 +/* 0x1BFE [0x89 0x1C 0x0B ] */ ldlayer 1, LAYER_1C0B +/* 0x1C01 [0x8A 0x1C 0x0F ] */ ldlayer 2, LAYER_1C0F +/* 0x1C04 [0xFF ] */ end + +.layer LAYER_1C05 +/* 0x1C05 [0xC0 0x02 ] */ ldelay 2 +/* 0x1C07 [0x67 0x1E 0x5A ] */ notedv PITCH_C4, 30, 90 +/* 0x1C0A [0xFF ] */ end + +.layer LAYER_1C0B +/* 0x1C0B [0x6B 0x1E 0x5A ] */ notedv PITCH_E4, 30, 90 +/* 0x1C0E [0xFF ] */ end + +.layer LAYER_1C0F +/* 0x1C0F [0xC2 0xF4 ] */ transpose -12 +/* 0x1C11 [0xFB 0x12 0xE7 ] */ jump LAYER_12E7 + +.channel CHAN_1C14 +/* 0x1C14 [0x88 0x1C 0x1D ] */ ldlayer 0, LAYER_1C1D +/* 0x1C17 [0x89 0x1C 0x1B ] */ ldlayer 1, LAYER_1C1B +/* 0x1C1A [0xFF ] */ end + +.layer LAYER_1C1B +/* 0x1C1B [0xC2 0xF4 ] */ transpose -12 +.layer LAYER_1C1D +/* 0x1C1D [0xC6 0x36 ] */ instr SF0_INST_54 +/* 0x1C1F [0xCB 0x66 0x74 0xFB ] */ env ENVELOPE_6674, 251 +/* 0x1C23 [0xC4 ] */ legato +/* 0x1C24 [0xC7 0x01 0x1A 0x3C ] */ portamento 0x01, PITCH_B2, 60 +LAYER_1C28: +/* 0x1C28 [0x64 0xFF 0xBC 0x5F ] */ notedv PITCH_A3, 32700, 95 +/* 0x1C2C [0xF4 0xFA ] */ rjump LAYER_1C28 + +.channel CHAN_1C2E +/* 0x1C2E [0xC1 0x44 ] */ instr SF0_INST_68 +/* 0x1C30 [0xD9 0xB6 ] */ releaserate 182 +/* 0x1C32 [0x88 0x1C 0x65 ] */ ldlayer 0, LAYER_1C65 +/* 0x1C35 [0x89 0x1C 0x6F ] */ ldlayer 1, LAYER_1C6F +/* 0x1C38 [0x8A 0x1C 0x61 ] */ ldlayer 2, LAYER_1C61 +CHAN_1C3B: +/* 0x1C3B [0x63 ] */ ldio IO_PORT_3 +/* 0x1C3C [0xC9 0xF0 ] */ and 240 +/* 0x1C3E [0xF3 0x0E ] */ rbeqz CHAN_1C4E +/* 0x1C40 [0xCE 0x00 0x00 ] */ ldptr SEQ_0000 +/* 0x1C43 [0xCF 0x1C 0x80 ] */ stptrtoseq ENVELOPE_1C7A + STSEQ_ENVELOPE_POINT(3) +/* 0x1C46 [0xCE 0x7F 0xBC ] */ ldptr SEQ_0_END + 0x1538 +/* 0x1C49 [0xCF 0x1C 0x8C ] */ stptrtoseq ENVELOPE_1C86 + STSEQ_ENVELOPE_POINT(3) +/* 0x1C4C [0xF4 0x0C ] */ rjump CHAN_1C5A + +CHAN_1C4E: +/* 0x1C4E [0xCE 0x00 0x00 ] */ ldptr SEQ_0000 +/* 0x1C51 [0xCF 0x1C 0x8C ] */ stptrtoseq ENVELOPE_1C86 + STSEQ_ENVELOPE_POINT(3) +/* 0x1C54 [0xCE 0x7F 0xBC ] */ ldptr SEQ_0_END + 0x1538 +/* 0x1C57 [0xCF 0x1C 0x80 ] */ stptrtoseq ENVELOPE_1C7A + STSEQ_ENVELOPE_POINT(3) +CHAN_1C5A: +/* 0x1C5A [0xCC 0x01 ] */ ldi 1 +/* 0x1C5C [0xFC 0x00 0x40 ] */ call CHAN_0040 +/* 0x1C5F [0xF4 0xDA ] */ rjump CHAN_1C3B + +.layer LAYER_1C61 +/* 0x1C61 [0xCD 0x14 ] */ stereo 1, 0, 1, 0, 0 +/* 0x1C63 [0xF4 0x00 ] */ rjump LAYER_1C65 + +.layer LAYER_1C65 +/* 0x1C65 [0xC4 ] */ legato +/* 0x1C66 [0x6F 0x0C 0x4B ] */ notedv PITCH_AF4, 12, 75 +LAYER_1C69: +/* 0x1C69 [0x71 0xFF 0xBC 0x4B ] */ notedv PITCH_BF4, 32700, 75 +/* 0x1C6D [0xF4 0xFA ] */ rjump LAYER_1C69 + +.layer LAYER_1C6F +/* 0x1C6F [0xC4 ] */ legato +/* 0x1C70 [0x75 0x0C 0x4B ] */ notedv PITCH_D5, 12, 75 +LAYER_1C73: +/* 0x1C73 [0x75 0xFF 0xBC 0x4B ] */ notedv PITCH_D5, 32700, 75 +/* 0x1C77 [0xF4 0xFA ] */ rjump LAYER_1C73 + +.balign 2 +.envelope ENVELOPE_1C7A + point 1, 32700 + point 80, 32700 + goto 1 + +.envelope ENVELOPE_1C86 + point 1, 0 + point 80, 32700 + goto 1 + +.envelope ENVELOPE_1C92 + point 1, 32700 + point 80, 32700 + goto 1 + +.channel CHAN_1C9E +/* 0x1C9E [0xC1 0x44 ] */ instr SF0_INST_68 +/* 0x1CA0 [0xDC 0x30 ] */ panweight 48 +/* 0x1CA2 [0xCC 0x19 ] */ ldi 25 +/* 0x1CA4 [0x71 ] */ stio IO_PORT_1 +/* 0x1CA5 [0xDA 0x67 0x50 ] */ env ENVELOPE_6750 +/* 0x1CA8 [0xD9 0xE8 ] */ releaserate 232 +/* 0x1CAA [0x88 0x1C 0xB4 ] */ ldlayer 0, LAYER_1CB4 +/* 0x1CAD [0x89 0x1C 0xCB ] */ ldlayer 1, LAYER_1CCB +/* 0x1CB0 [0x8A 0x1C 0xE7 ] */ ldlayer 2, LAYER_1CE7 +/* 0x1CB3 [0xFF ] */ end + +.layer LAYER_1CB4 +/* 0x1CB4 [0xCA 0x18 ] */ notepan 24 +/* 0x1CB6 [0xC2 0x0C ] */ transpose 12 +/* 0x1CB8 [0x69 0x18 0x4B ] */ notedv PITCH_D4, 24, 75 +/* 0x1CBB [0xC4 ] */ legato +/* 0x1CBC [0xCF 0xFB ] */ releaserate 251 +/* 0x1CBE [0xC7 0x85 0x35 0xFF ] */ portamento 0x85, PITCH_D5, 255 +/* 0x1CC2 [0x75 0x81 0x90 0x5A ] */ notedv PITCH_D5, FRAMERATE_CONST(400, 480), 90 +/* 0x1CC6 [0x77 0x81 0xF4 0x5A ] */ notedv PITCH_E5, FRAMERATE_CONST(500, 600), 90 +/* 0x1CCA [0xFF ] */ end + +.layer LAYER_1CCB +/* 0x1CCB [0xCA 0x40 ] */ notepan 64 +/* 0x1CCD [0xC2 0x0C ] */ transpose 12 +/* 0x1CCF [0x69 0x18 0x4B ] */ notedv PITCH_D4, 24, 75 +/* 0x1CD2 [0x75 0x81 0x90 0x4B ] */ notedv PITCH_D5, FRAMERATE_CONST(400, 480), 75 +/* 0x1CD6 [0xC2 0x00 ] */ transpose 0 +/* 0x1CD8 [0xC6 0x40 ] */ instr SF0_INST_64 +/* 0x1CDA [0xCB 0x67 0x78 0xFB ] */ env ENVELOPE_6778, 251 +/* 0x1CDE [0xC7 0x81 0x39 0xFF ] */ portamento 0x81, PITCH_GF5, 255 +/* 0x1CE2 [0x7D 0x81 0xF4 0x32 ] */ notedv PITCH_BF5, FRAMERATE_CONST(500, 600), 50 +/* 0x1CE6 [0xFF ] */ end + +.layer LAYER_1CE7 +/* 0x1CE7 [0xCA 0x68 ] */ notepan 104 +/* 0x1CE9 [0xC2 0x18 ] */ transpose 24 +/* 0x1CEB [0x65 0x18 0x4B ] */ notedv PITCH_BF3, 24, 75 +/* 0x1CEE [0xC4 ] */ legato +/* 0x1CEF [0xCF 0xFB ] */ releaserate 251 +/* 0x1CF1 [0xC7 0x85 0x31 0xFF ] */ portamento 0x85, PITCH_BF4, 255 +/* 0x1CF5 [0x71 0x81 0x90 0x5A ] */ notedv PITCH_BF4, FRAMERATE_CONST(400, 480), 90 +/* 0x1CF9 [0x73 0x81 0xF4 0x5A ] */ notedv PITCH_C5, FRAMERATE_CONST(500, 600), 90 +/* 0x1CFD [0xFF ] */ end + +.channel CHAN_1CFE +/* 0x1CFE [0xC1 0x2F ] */ instr SF0_INST_47 +/* 0x1D00 [0xDC 0x48 ] */ panweight 72 +/* 0x1D02 [0x88 0x1D 0x0C ] */ ldlayer 0, LAYER_1D0C +/* 0x1D05 [0x89 0x1D 0x70 ] */ ldlayer 1, LAYER_1D70 +/* 0x1D08 [0x8A 0x1D 0x44 ] */ ldlayer 2, LAYER_1D44 +/* 0x1D0B [0xFF ] */ end + +.layer LAYER_1D0C +/* 0x1D0C [0xCB 0x65 0xE8 0xC8 ] */ env ENVELOPE_65E8, 200 +/* 0x1D10 [0xC2 0xF8 ] */ transpose -8 +LAYER_1D12: +/* 0x1D12 [0xCA 0x22 ] */ notepan 34 +/* 0x1D14 [0x70 0x08 0x64 ] */ notedv PITCH_A4, 8, 100 +/* 0x1D17 [0x64 0x18 0x64 ] */ notedv PITCH_A3, 24, 100 +/* 0x1D1A [0xCA 0x4A ] */ notepan 74 +/* 0x1D1C [0x72 0x06 0x55 ] */ notedv PITCH_B4, 6, 85 +/* 0x1D1F [0x66 0x15 0x55 ] */ notedv PITCH_B3, 21, 85 +/* 0x1D22 [0xCA 0x36 ] */ notepan 54 +/* 0x1D24 [0x6C 0x09 0x5B ] */ notedv PITCH_F4, 9, 91 +/* 0x1D27 [0x62 0x1A 0x5B ] */ notedv PITCH_G3, 26, 91 +/* 0x1D2A [0xCA 0x5E ] */ notepan 94 +/* 0x1D2C [0x70 0x07 0x66 ] */ notedv PITCH_A4, 7, 102 +/* 0x1D2F [0x60 0x0B 0x66 ] */ notedv PITCH_F3, 11, 102 +/* 0x1D32 [0xCA 0x2C ] */ notepan 44 +/* 0x1D34 [0x6E 0x09 0x56 ] */ notedv PITCH_G4, 9, 86 +/* 0x1D37 [0x60 0x1D 0x56 ] */ notedv PITCH_F3, 29, 86 +/* 0x1D3A [0xCA 0x40 ] */ notepan 64 +/* 0x1D3C [0x6E 0x05 0x58 ] */ notedv PITCH_G4, 5, 88 +/* 0x1D3F [0x64 0x1B 0x58 ] */ notedv PITCH_A3, 27, 88 +/* 0x1D42 [0xF4 0xCE ] */ rjump LAYER_1D12 + +.layer LAYER_1D44 +/* 0x1D44 [0xCB 0x65 0xE8 0x7F ] */ env ENVELOPE_65E8, 127 +/* 0x1D48 [0xC2 0xF8 ] */ transpose -8 +LAYER_1D4A: +/* 0x1D4A [0x62 0x09 0x49 ] */ notedv PITCH_G3, 9, 73 +/* 0x1D4D [0x54 0x22 0x49 ] */ notedv PITCH_F2, 34, 73 +/* 0x1D50 [0x64 0x09 0x4F ] */ notedv PITCH_A3, 9, 79 +/* 0x1D53 [0x54 0x1D 0x4F ] */ notedv PITCH_F2, 29, 79 +/* 0x1D56 [0x64 0x09 0x57 ] */ notedv PITCH_A3, 9, 87 +/* 0x1D59 [0x54 0x1B 0x57 ] */ notedv PITCH_F2, 27, 87 +/* 0x1D5C [0x5F 0x07 0x51 ] */ notedv PITCH_E3, 7, 81 +/* 0x1D5F [0x51 0x0F 0x51 ] */ notedv PITCH_D2, 15, 81 +/* 0x1D62 [0x64 0x09 0x44 ] */ notedv PITCH_A3, 9, 68 +/* 0x1D65 [0x4F 0x18 0x44 ] */ notedv PITCH_C2, 24, 68 +/* 0x1D68 [0x62 0x05 0x46 ] */ notedv PITCH_G3, 5, 70 +/* 0x1D6B [0x4F 0x21 0x46 ] */ notedv PITCH_C2, 33, 70 +/* 0x1D6E [0xF4 0xDA ] */ rjump LAYER_1D4A + +.layer LAYER_1D70 +/* 0x1D70 [0xC6 0x36 ] */ instr SF0_INST_54 +LAYER_1D72: +/* 0x1D72 [0x5C 0x1C 0x66 ] */ notedv PITCH_DF3, 28, 102 +/* 0x1D75 [0xF4 0xFB ] */ rjump LAYER_1D72 + +.channel CHAN_1D77 +/* 0x1D77 [0xC1 0x33 ] */ instr SF0_INST_51 +/* 0x1D79 [0xDC 0x30 ] */ panweight 48 +/* 0x1D7B [0xD9 0xD3 ] */ releaserate 211 +/* 0x1D7D [0x88 0x1D 0x86 ] */ ldlayer 0, LAYER_1D86 +/* 0x1D80 [0x89 0x1D 0x84 ] */ ldlayer 1, LAYER_1D84 +/* 0x1D83 [0xFF ] */ end + +.layer LAYER_1D84 +/* 0x1D84 [0xC2 0x0A ] */ transpose 10 +.layer LAYER_1D86 +/* 0x1D86 [0xC4 ] */ legato +LAYER_1D87: +/* 0x1D87 [0x64 0xFD 0x00 0x4B ] */ notedv PITCH_A3, 32000, 75 +/* 0x1D8B [0xF4 0xFA ] */ rjump LAYER_1D87 + +.channel CHAN_1D8D +/* 0x1D8D [0xC1 0x33 ] */ instr SF0_INST_51 +/* 0x1D8F [0xDC 0x40 ] */ panweight 64 +/* 0x1D91 [0x88 0x1D 0x9A ] */ ldlayer 0, LAYER_1D9A +/* 0x1D94 [0x89 0x1D 0x98 ] */ ldlayer 1, LAYER_1D98 +/* 0x1D97 [0xFF ] */ end + +.layer LAYER_1D98 +/* 0x1D98 [0xC2 0x04 ] */ transpose 4 +.layer LAYER_1D9A +/* 0x1D9A [0xC4 ] */ legato +LAYER_1D9B: +/* 0x1D9B [0x56 0xFD 0x00 0x3C ] */ notedv PITCH_G2, 32000, 60 +/* 0x1D9F [0xF4 0xFA ] */ rjump LAYER_1D9B + +.channel CHAN_1DA1 +/* 0x1DA1 [0xC1 0x33 ] */ instr SF0_INST_51 +/* 0x1DA3 [0xDC 0x40 ] */ panweight 64 +/* 0x1DA5 [0x88 0x1D 0xAE ] */ ldlayer 0, LAYER_1DAE +/* 0x1DA8 [0x89 0x1D 0xAC ] */ ldlayer 1, LAYER_1DAC +/* 0x1DAB [0xFF ] */ end + +.layer LAYER_1DAC +/* 0x1DAC [0xC2 0x07 ] */ transpose 7 +.layer LAYER_1DAE +/* 0x1DAE [0xC4 ] */ legato +LAYER_1DAF: +/* 0x1DAF [0x62 0xFD 0x00 0x4B ] */ notedv PITCH_G3, 32000, 75 +/* 0x1DB3 [0xF4 0xFA ] */ rjump LAYER_1DAF + +.channel CHAN_1DB5 +/* 0x1DB5 [0xC1 0x30 ] */ instr SF0_INST_48 +/* 0x1DB7 [0x88 0x1D 0xBB ] */ ldlayer 0, LAYER_1DBB +/* 0x1DBA [0xFF ] */ end + +.layer LAYER_1DBB +/* 0x1DBB [0x66 0x12 0x6E ] */ notedv PITCH_B3, 18, 110 +/* 0x1DBE [0xFF ] */ end + +.channel CHAN_1DBF +/* 0x1DBF [0xC1 0x0C ] */ instr SF0_INST_12 +/* 0x1DC1 [0xDA 0x66 0x7C ] */ env ENVELOPE_667C +/* 0x1DC4 [0x88 0x1D 0xC8 ] */ ldlayer 0, LAYER_1DC8 +/* 0x1DC7 [0xFF ] */ end + +.layer LAYER_1DC8 +/* 0x1DC8 [0xC7 0x81 0x26 0xFF ] */ portamento 0x81, PITCH_B3, 255 +/* 0x1DCC [0x67 0x20 0x50 ] */ notedv PITCH_C4, 32, 80 +/* 0x1DCF [0xFF ] */ end + +.channel CHAN_1DD0 +/* 0x1DD0 [0xC1 0x46 ] */ instr SF0_INST_70 +/* 0x1DD2 [0xCC 0x20 ] */ ldi 32 +/* 0x1DD4 [0x71 ] */ stio IO_PORT_1 +/* 0x1DD5 [0xD9 0xF5 ] */ releaserate 245 +/* 0x1DD7 [0x88 0x1D 0xE6 ] */ ldlayer 0, LAYER_1DE6 +/* 0x1DDA [0x89 0x1D 0xDE ] */ ldlayer 1, LAYER_1DDE +/* 0x1DDD [0xFF ] */ end + +.layer LAYER_1DDE +/* 0x1DDE [0xC7 0x81 0x16 0xFF ] */ portamento 0x81, PITCH_G2, 255 +/* 0x1DE2 [0x62 0x78 0x46 ] */ notedv PITCH_G3, 120, 70 +/* 0x1DE5 [0xFF ] */ end + +.layer LAYER_1DE6 +/* 0x1DE6 [0xC7 0x01 0x22 0x30 ] */ portamento 0x01, PITCH_G3, 48 +/* 0x1DEA [0x6E 0x78 0x46 ] */ notedv PITCH_G4, 120, 70 +/* 0x1DED [0xFF ] */ end + +.channel CHAN_1DEE +/* 0x1DEE [0xED 0x0F ] */ gain 15 +/* 0x1DF0 [0x88 0x1D 0xFE ] */ ldlayer 0, LAYER_1DFE +/* 0x1DF3 [0x89 0x1D 0xFA ] */ ldlayer 1, LAYER_1DFA +/* 0x1DF6 [0x8A 0x1E 0x0A ] */ ldlayer 2, LAYER_1E0A +/* 0x1DF9 [0xFF ] */ end + +.layer LAYER_1DFA +/* 0x1DFA [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x1DFC [0xF4 0x04 ] */ rjump LAYER_1E02 + +.layer LAYER_1DFE +/* 0x1DFE [0xC2 0x2A ] */ transpose 42 +/* 0x1E00 [0xC6 0x4A ] */ instr SF0_INST_74 +LAYER_1E02: +/* 0x1E02 [0xCB 0x65 0xFC 0xC8 ] */ env ENVELOPE_65FC, 200 +/* 0x1E06 [0x68 0x00 0x6E ] */ notedv PITCH_DF4, 0, 110 +/* 0x1E09 [0xFF ] */ end + +.layer LAYER_1E0A +/* 0x1E0A [0xC6 0x46 ] */ instr SF0_INST_70 +/* 0x1E0C [0x62 0x32 0x32 ] */ notedv PITCH_G3, 50, 50 +/* 0x1E0F [0xFF ] */ end + +.channel CHAN_1E10 +/* 0x1E10 [0x88 0x1E 0x14 ] */ ldlayer 0, LAYER_1E14 +/* 0x1E13 [0xFF ] */ end + +.layer LAYER_1E14 +/* 0x1E14 [0xC6 0x24 ] */ instr SF0_INST_36 +/* 0x1E16 [0xCB 0x66 0x60 0xFB ] */ env ENVELOPE_6660, 251 +/* 0x1E1A [0xC4 ] */ legato +/* 0x1E1B [0xC7 0x85 0x30 0xFF ] */ portamento 0x85, PITCH_A4, 255 +/* 0x1E1F [0x5B 0x04 0x5F ] */ notedv PITCH_C3, 4, 95 +/* 0x1E22 [0x65 0x05 0x5F ] */ notedv PITCH_BF3, 5, 95 +/* 0x1E25 [0xFF ] */ end + +.channel CHAN_1E26 +/* 0x1E26 [0xC1 0x47 ] */ instr SF0_INST_71 +/* 0x1E28 [0xDA 0x66 0x24 ] */ env ENVELOPE_6624 +/* 0x1E2B [0xD9 0xC9 ] */ releaserate 201 +/* 0x1E2D [0xCC 0x14 ] */ ldi 20 +/* 0x1E2F [0x71 ] */ stio IO_PORT_1 +/* 0x1E30 [0xDC 0x00 ] */ panweight 0 +/* 0x1E32 [0x88 0x1E 0x3C ] */ ldlayer 0, LAYER_1E3C +/* 0x1E35 [0x89 0x1E 0x57 ] */ ldlayer 1, LAYER_1E57 +/* 0x1E38 [0x8A 0x1E 0x74 ] */ ldlayer 2, LAYER_1E74 +/* 0x1E3B [0xFF ] */ end + +.layer LAYER_1E3C +/* 0x1E3C [0xCA 0x4A ] */ notepan 74 +/* 0x1E3E [0xFC 0x1E 0x7F ] */ call LAYER_1E7F +/* 0x1E41 [0xCA 0x54 ] */ notepan 84 +/* 0x1E43 [0xFC 0x1E 0x88 ] */ call LAYER_1E88 +/* 0x1E46 [0xCA 0x59 ] */ notepan 89 +/* 0x1E48 [0xFC 0x1E 0x91 ] */ call LAYER_1E91 +/* 0x1E4B [0xCA 0x45 ] */ notepan 69 +/* 0x1E4D [0xFC 0x1E 0x96 ] */ call LAYER_1E96 +/* 0x1E50 [0xCA 0x4E ] */ notepan 78 +/* 0x1E52 [0xFC 0x1E 0x9F ] */ call LAYER_1E9F +/* 0x1E55 [0xF4 0xE5 ] */ rjump LAYER_1E3C + +.layer LAYER_1E57 +/* 0x1E57 [0xC0 0x44 ] */ ldelay 68 +/* 0x1E59 [0xCA 0x22 ] */ notepan 34 +/* 0x1E5B [0xFC 0x1E 0x9F ] */ call LAYER_1E9F +/* 0x1E5E [0xCA 0x2C ] */ notepan 44 +/* 0x1E60 [0xFC 0x1E 0x96 ] */ call LAYER_1E96 +/* 0x1E63 [0xCA 0x36 ] */ notepan 54 +/* 0x1E65 [0xFC 0x1E 0x91 ] */ call LAYER_1E91 +/* 0x1E68 [0xCA 0x2F ] */ notepan 47 +/* 0x1E6A [0xFC 0x1E 0x88 ] */ call LAYER_1E88 +/* 0x1E6D [0xCA 0x29 ] */ notepan 41 +/* 0x1E6F [0xFC 0x1E 0x7F ] */ call LAYER_1E7F +/* 0x1E72 [0xF4 0xE3 ] */ rjump LAYER_1E57 + +.layer LAYER_1E74 +/* 0x1E74 [0xFC 0x1E 0xA8 ] */ call LAYER_1EA8 +/* 0x1E77 [0xC0 0x80 0x64 ] */ lldelay 100 +/* 0x1E7A [0xFC 0x1E 0x7F ] */ call LAYER_1E7F +/* 0x1E7D [0xF4 0xD8 ] */ rjump LAYER_1E57 + +.layer LAYER_1E7F +/* 0x1E7F [0x67 0x81 0x72 0x62 ] */ notedv PITCH_C4, 370, 98 +/* 0x1E83 [0x63 0x81 0x0C 0x38 ] */ notedv PITCH_AF3, 268, 56 +/* 0x1E87 [0xFF ] */ end + +.layer LAYER_1E88 +/* 0x1E88 [0x64 0x81 0x13 0x41 ] */ notedv PITCH_A3, 275, 65 +/* 0x1E8C [0x65 0x81 0x40 0x5C ] */ notedv PITCH_BF3, 320, 92 +/* 0x1E90 [0xFF ] */ end + +.layer LAYER_1E91 +/* 0x1E91 [0x66 0x81 0x59 0x4C ] */ notedv PITCH_B3, 345, 76 +/* 0x1E95 [0xFF ] */ end + +.layer LAYER_1E96 +/* 0x1E96 [0x62 0x80 0xD7 0x62 ] */ notedv PITCH_G3, 215, 98 +/* 0x1E9A [0x69 0x81 0xCC 0x6A ] */ notedv PITCH_D4, 460, 106 +/* 0x1E9E [0xFF ] */ end + +.layer LAYER_1E9F +/* 0x1E9F [0x64 0x81 0x20 0x5C ] */ notedv PITCH_A3, 288, 92 +/* 0x1EA3 [0x65 0x81 0x3B 0x58 ] */ notedv PITCH_BF3, 315, 88 +/* 0x1EA7 [0xFF ] */ end + +.layer LAYER_1EA8 +/* 0x1EA8 [0xCD 0x14 ] */ stereo 1, 0, 1, 0, 0 +/* 0x1EAA [0xFF ] */ end + +.channel CHAN_1EAB +/* 0x1EAB [0xC1 0x49 ] */ instr SF0_INST_73 +/* 0x1EAD [0xED 0x0A ] */ gain 10 +/* 0x1EAF [0x88 0x1E 0xB3 ] */ ldlayer 0, LAYER_1EB3 +/* 0x1EB2 [0xFF ] */ end + +.layer LAYER_1EB3 +/* 0x1EB3 [0xC4 ] */ legato +LAYER_1EB4: +/* 0x1EB4 [0x65 0xFF 0xBC 0x64 ] */ notedv PITCH_BF3, 32700, 100 +/* 0x1EB8 [0xF4 0xFA ] */ rjump LAYER_1EB4 + +.channel CHAN_1EBA +/* 0x1EBA [0xDC 0x30 ] */ panweight 48 +/* 0x1EBC [0x88 0x1E 0xC3 ] */ ldlayer 0, LAYER_1EC3 +/* 0x1EBF [0x89 0x1E 0xD4 ] */ ldlayer 1, LAYER_1ED4 +/* 0x1EC2 [0xFF ] */ end + +.layer LAYER_1EC3 +/* 0x1EC3 [0xC6 0x38 ] */ instr SF0_INST_56 +/* 0x1EC5 [0xC4 ] */ legato +/* 0x1EC6 [0xC7 0x85 0x20 0xC8 ] */ portamento 0x85, PITCH_F3, 200 +LAYER_1ECA: +/* 0x1ECA [0x64 0x81 0xF4 0x69 ] */ notedv PITCH_A3, 500, 105 +/* 0x1ECE [0x60 0x81 0xF4 0x69 ] */ notedv PITCH_F3, 500, 105 +/* 0x1ED2 [0xF4 0xF6 ] */ rjump LAYER_1ECA + +.layer LAYER_1ED4 +/* 0x1ED4 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x1ED6 [0xCB 0x66 0x7C 0xDD ] */ env ENVELOPE_667C, 221 +LAYER_1EDA: +/* 0x1EDA [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +/* 0x1EDE [0x54 0x81 0x90 0x41 ] */ notedv PITCH_F2, 400, 65 +/* 0x1EE2 [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +/* 0x1EE6 [0x6C 0x82 0xBC 0x41 ] */ notedv PITCH_F4, 700, 65 +/* 0x1EEA [0xF4 0xEE ] */ rjump LAYER_1EDA + +.channel CHAN_1EEC +/* 0x1EEC [0x88 0x1E 0xF0 ] */ ldlayer 0, LAYER_1EF0 +/* 0x1EEF [0xFF ] */ end + +.layer LAYER_1EF0 +/* 0x1EF0 [0xC6 0x4A ] */ instr SF0_INST_74 +/* 0x1EF2 [0xCF 0xF0 ] */ releaserate 240 +/* 0x1EF4 [0xC4 ] */ legato +/* 0x1EF5 [0xC7 0x01 0x18 0x28 ] */ portamento 0x01, PITCH_A2, 40 +LAYER_1EF9: +/* 0x1EF9 [0x60 0xFF 0xBC 0x64 ] */ notedv PITCH_F3, 32700, 100 +/* 0x1EFD [0xF4 0xFA ] */ rjump LAYER_1EF9 + +.channel CHAN_1EFF +/* 0x1EFF [0x88 0x1F 0x03 ] */ ldlayer 0, LAYER_1F03 +/* 0x1F02 [0xFF ] */ end + +.layer LAYER_1F03 +/* 0x1F03 [0xC6 0x4A ] */ instr SF0_INST_74 +/* 0x1F05 [0xCB 0x66 0x7C 0xF0 ] */ env ENVELOPE_667C, 240 +/* 0x1F09 [0xC4 ] */ legato +/* 0x1F0A [0xC7 0x85 0x20 0xFF ] */ portamento 0x85, PITCH_F3, 255 +/* 0x1F0E [0x67 0x60 0x64 ] */ notedv PITCH_C4, 96, 100 +LAYER_1F11: +/* 0x1F11 [0x66 0x60 0x64 ] */ notedv PITCH_B3, 96, 100 +/* 0x1F14 [0xF4 0xFB ] */ rjump LAYER_1F11 + +.channel CHAN_1F16 +/* 0x1F16 [0x88 0x1F 0x1C ] */ ldlayer 0, LAYER_1F1C +/* 0x1F19 [0xFF ] */ end + +.layer LAYER_1F1A +/* 0x1F1A [0xC2 0xFC ] */ transpose -4 +.layer LAYER_1F1C +/* 0x1F1C [0xC6 0x41 ] */ instr SF0_INST_65 +/* 0x1F1E [0xCF 0xF1 ] */ releaserate 241 +/* 0x1F20 [0x6D 0x06 0x6E ] */ notedv PITCH_GF4, 6, 110 +/* 0x1F23 [0x5E 0x64 0x6E ] */ notedv PITCH_EF3, 100, 110 +/* 0x1F26 [0xFF ] */ end + +.channel CHAN_1F27 +/* 0x1F27 [0x88 0x1F 0x2B ] */ ldlayer 0, LAYER_1F2B +/* 0x1F2A [0xFF ] */ end + +.layer LAYER_1F2B +/* 0x1F2B [0xC6 0x4B ] */ instr SF0_INST_75 +/* 0x1F2D [0xCF 0xF0 ] */ releaserate 240 +/* 0x1F2F [0xC4 ] */ legato +/* 0x1F30 [0xC7 0x85 0x19 0xFF ] */ portamento 0x85, PITCH_BF2, 255 +/* 0x1F34 [0x5D 0x28 0x4B ] */ notedv PITCH_D3, 40, 75 +LAYER_1F37: +/* 0x1F37 [0x5F 0x81 0x41 0x4B ] */ notedv PITCH_E3, 321, 75 +/* 0x1F3B [0xF4 0xFA ] */ rjump LAYER_1F37 + +.channel CHAN_1F3D +/* 0x1F3D [0x88 0x1F 0x43 ] */ ldlayer 0, LAYER_1F43 +/* 0x1F40 [0xFF ] */ end + +.layer LAYER_1F41 +/* 0x1F41 [0xC2 0xFA ] */ transpose -6 +.layer LAYER_1F43 +/* 0x1F43 [0xC6 0x4C ] */ instr SF0_INST_76 +/* 0x1F45 [0xCF 0xF1 ] */ releaserate 241 +/* 0x1F47 [0x64 0x5E 0x5F ] */ notedv PITCH_A3, 94, 95 +/* 0x1F4A [0xFF ] */ end + +.channel CHAN_1F4B +/* 0x1F4B [0xC1 0x41 ] */ instr SF0_INST_65 +/* 0x1F4D [0xDA 0x66 0x60 ] */ env ENVELOPE_6660 +/* 0x1F50 [0x88 0x1F 0x57 ] */ ldlayer 0, LAYER_1F57 +/* 0x1F53 [0x89 0x1F 0x5F ] */ ldlayer 1, LAYER_1F5F +/* 0x1F56 [0xFF ] */ end + +.layer LAYER_1F57 +/* 0x1F57 [0xC7 0x81 0x2B 0xC8 ] */ portamento 0x81, PITCH_E4, 200 +/* 0x1F5B [0x5B 0x14 0x6E ] */ notedv PITCH_C3, 20, 110 +/* 0x1F5E [0xFF ] */ end + +.layer LAYER_1F5F +/* 0x1F5F [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x1F61 [0x58 0x14 0x64 ] */ notedv PITCH_A2, 20, 100 +/* 0x1F64 [0xFF ] */ end + +.channel CHAN_1F65 +/* 0x1F65 [0xED 0x0A ] */ gain 10 +/* 0x1F67 [0x88 0x1F 0x6E ] */ ldlayer 0, LAYER_1F6E +/* 0x1F6A [0x89 0x1F 0x7B ] */ ldlayer 1, LAYER_1F7B +/* 0x1F6D [0xFF ] */ end + +.layer LAYER_1F6E +/* 0x1F6E [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x1F70 [0xCB 0x66 0x10 0xFB ] */ env ENVELOPE_6610, 251 +/* 0x1F74 [0x73 0x0F 0x5E ] */ notedv PITCH_C5, 15, 94 +/* 0x1F77 [0x6A 0x60 0x63 ] */ notedv PITCH_EF4, 96, 99 +/* 0x1F7A [0xFF ] */ end + +.layer LAYER_1F7B +/* 0x1F7B [0xC6 0x3F ] */ instr SF0_INST_63 +/* 0x1F7D [0xCB 0x65 0xE8 0xB4 ] */ env ENVELOPE_65E8, 180 +/* 0x1F81 [0x6D 0x08 0x5C ] */ notedv PITCH_GF4, 8, 92 +/* 0x1F84 [0x6A 0x06 0x55 ] */ notedv PITCH_EF4, 6, 85 +/* 0x1F87 [0x65 0x05 0x5E ] */ notedv PITCH_BF3, 5, 94 +/* 0x1F8A [0x61 0x0A 0x59 ] */ notedv PITCH_GF3, 10, 89 +/* 0x1F8D [0x59 0x50 0x5F ] */ notedv PITCH_BF2, 80, 95 +/* 0x1F90 [0xFF ] */ end + +.channel CHAN_1F91 +/* 0x1F91 [0x88 0x1F 0x98 ] */ ldlayer 0, LAYER_1F98 +/* 0x1F94 [0x89 0x1F 0xA2 ] */ ldlayer 1, LAYER_1FA2 +/* 0x1F97 [0xFF ] */ end + +.layer LAYER_1F98 +/* 0x1F98 [0xC6 0x41 ] */ instr SF0_INST_65 +/* 0x1F9A [0x34 0x12 0x5F 0x7F ] */ notedvg PITCH_DF5, 18, 95, 127 +/* 0x1F9E [0x68 0x41 0x5F ] */ notedv PITCH_DF4, 65, 95 +/* 0x1FA1 [0xFF ] */ end + +.layer LAYER_1FA2 +/* 0x1FA2 [0xC6 0x3B ] */ instr SF0_INST_59 +/* 0x1FA4 [0x67 0x12 0x50 ] */ notedv PITCH_C4, 18, 80 +/* 0x1FA7 [0x5B 0x41 0x50 ] */ notedv PITCH_C3, 65, 80 +/* 0x1FAA [0xFF ] */ end + +.channel CHAN_1FAB +/* 0x1FAB [0xDC 0x30 ] */ panweight 48 +/* 0x1FAD [0x88 0x1F 0xB4 ] */ ldlayer 0, LAYER_1FB4 +/* 0x1FB0 [0x89 0x1F 0xC5 ] */ ldlayer 1, LAYER_1FC5 +/* 0x1FB3 [0xFF ] */ end + +.layer LAYER_1FB4 +/* 0x1FB4 [0xC6 0x38 ] */ instr SF0_INST_56 +/* 0x1FB6 [0xC4 ] */ legato +/* 0x1FB7 [0xC7 0x85 0x26 0xC8 ] */ portamento 0x85, PITCH_B3, 200 +LAYER_1FBB: +/* 0x1FBB [0x6A 0x81 0x9A 0x6E ] */ notedv PITCH_EF4, 410, 110 +/* 0x1FBF [0x66 0x81 0x7C 0x6E ] */ notedv PITCH_B3, 380, 110 +/* 0x1FC3 [0xF4 0xF6 ] */ rjump LAYER_1FBB + +.layer LAYER_1FC5 +/* 0x1FC5 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x1FC7 [0xCB 0x66 0x7C 0xDD ] */ env ENVELOPE_667C, 221 +LAYER_1FCB: +/* 0x1FCB [0xC7 0x81 0x20 0xFF ] */ portamento 0x81, PITCH_F3, 255 +/* 0x1FCF [0x5A 0x81 0x36 0x50 ] */ notedv PITCH_B2, 310, 80 +/* 0x1FD3 [0xC7 0x81 0x20 0xFF ] */ portamento 0x81, PITCH_F3, 255 +/* 0x1FD7 [0x72 0x82 0x26 0x50 ] */ notedv PITCH_B4, 550, 80 +/* 0x1FDB [0xF4 0xEE ] */ rjump LAYER_1FCB + +.channel CHAN_1FDD +/* 0x1FDD [0x88 0x1F 0xF1 ] */ ldlayer 0, LAYER_1FF1 +/* 0x1FE0 [0x89 0x1F 0xE4 ] */ ldlayer 1, LAYER_1FE4 +/* 0x1FE3 [0xFF ] */ end + +.layer LAYER_1FE4 +/* 0x1FE4 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x1FE6 [0xCB 0x66 0x4C 0xF0 ] */ env ENVELOPE_664C, 240 +/* 0x1FEA [0x78 0x03 0x46 ] */ notedv PITCH_F5, 3, 70 +/* 0x1FED [0x60 0x04 0x40 ] */ notedv PITCH_F3, 4, 64 +/* 0x1FF0 [0xFF ] */ end + +.layer LAYER_1FF1 +/* 0x1FF1 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x1FF3 [0xC2 0x30 ] */ transpose 48 +/* 0x1FF5 [0x11 0x03 0x64 0x7F ] */ notedvg PITCH_D2, 3, 100, 127 +/* 0x1FF9 [0x5F 0x30 0x64 ] */ notedv PITCH_E3, 48, 100 +/* 0x1FFC [0xFF ] */ end + +.channel CHAN_1FFD +/* 0x1FFD [0xC1 0x32 ] */ instr SF0_INST_50 +/* 0x1FFF [0x88 0x20 0x03 ] */ ldlayer 0, LAYER_2003 +/* 0x2002 [0xFF ] */ end + +.layer LAYER_2003 +/* 0x2003 [0xC4 ] */ legato +/* 0x2004 [0xC7 0x85 0x26 0x7F ] */ portamento 0x85, PITCH_B3, 127 +/* 0x2008 [0x69 0x50 0x6E ] */ notedv PITCH_D4, 80, 110 +/* 0x200B [0x62 0x73 0x6E ] */ notedv PITCH_G3, 115, 110 +/* 0x200E [0xFF ] */ end + +.channel CHAN_200F +/* 0x200F [0x88 0x20 0x13 ] */ ldlayer 0, LAYER_2013 +/* 0x2012 [0xFF ] */ end + +.layer LAYER_2013 +/* 0x2013 [0xC6 0x32 ] */ instr SF0_INST_50 +/* 0x2015 [0xC2 0x30 ] */ transpose 48 +/* 0x2017 [0xC4 ] */ legato +/* 0x2018 [0xC7 0x85 0x20 0xFF ] */ portamento 0x85, PITCH_F3, 255 +/* 0x201C [0x65 0x06 0x55 ] */ notedv PITCH_BF3, 6, 85 +/* 0x201F [0x5E 0x10 0x55 ] */ notedv PITCH_EF3, 16, 85 +/* 0x2022 [0x58 0x73 0x55 ] */ notedv PITCH_A2, 115, 85 +/* 0x2025 [0xFF ] */ end + +.channel CHAN_2026 +/* 0x2026 [0x88 0x20 0x65 ] */ ldlayer 0, LAYER_2065 +/* 0x2029 [0x89 0x20 0x3C ] */ ldlayer 1, LAYER_203C +/* 0x202C [0xD7 0xFF ] */ vibfreq 255 +/* 0x202E [0xE2 0x32 0x50 0x64 ] */ vibdepthgrad 50, 80, 100 +/* 0x2032 [0xCC 0xFF ] */ ldi 255 +/* 0x2034 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x2037 [0xE2 0x50 0x0A 0x64 ] */ vibdepthgrad 80, 10, 100 +/* 0x203B [0xFF ] */ end + +.layer LAYER_203C +/* 0x203C [0xC6 0x4A ] */ instr SF0_INST_74 +/* 0x203E [0xCB 0x66 0x94 0xE7 ] */ env ENVELOPE_6694, 231 +/* 0x2042 [0xC4 ] */ legato +/* 0x2043 [0xC7 0x85 0x03 0xFF ] */ portamento 0x85, PITCH_C1, 255 +/* 0x2047 [0x54 0x60 0x64 ] */ notedv PITCH_F2, FRAMERATE_CONST(96, 115), 100 +/* 0x204A [0x67 0x80 0x96 0x64 ] */ notedv PITCH_C4, FRAMERATE_CONST(150, 180), 100 +/* 0x204E [0xC5 ] */ nolegato +/* 0x204F [0xC4 ] */ legato +/* 0x2050 [0xC8 ] */ noportamento +/* 0x2051 [0xCB 0x66 0xEC 0xE7 ] */ env ENVELOPE_66EC, 231 +/* 0x2055 [0xC7 0x81 0x0F 0xFF ] */ portamento 0x81, PITCH_C2, 255 +/* 0x2059 [0x67 0x80 0xC8 0x64 ] */ notedv PITCH_C4, FRAMERATE_CONST(200, 240), 100 +/* 0x205D [0xFF ] */ end + +/* 0x205E [0xC2 0xE2 ] */ transpose -30 +/* 0x2060 [0xC6 0x34 ] */ instr SF0_INST_52 +/* 0x2062 [0xFB 0x20 0x69 ] */ jump LAYER_2069 + +.layer LAYER_2065 +/* 0x2065 [0xC2 0x0C ] */ transpose 12 +/* 0x2067 [0xC6 0x44 ] */ instr SF0_INST_68 +LAYER_2069: +/* 0x2069 [0xCB 0x66 0x88 0xFB ] */ env ENVELOPE_6688, 251 +/* 0x206D [0xC4 ] */ legato +/* 0x206E [0xC7 0x85 0x0F 0xFF ] */ portamento 0x85, PITCH_C2, 255 +/* 0x2072 [0x60 0x60 0x4A ] */ notedv PITCH_F3, FRAMERATE_CONST(96, 115), 74 +/* 0x2075 [0x73 0x80 0xC8 0x4A ] */ notedv PITCH_C5, FRAMERATE_CONST(200, 240), 74 +/* 0x2079 [0x7C 0x80 0x96 0x4A ] */ notedv PITCH_A5, FRAMERATE_CONST(150, 180), 74 +/* 0x207D [0xFF ] */ end + +.channel CHAN_207E +/* 0x207E [0x88 0x20 0xA3 ] */ ldlayer 0, LAYER_20A3 +/* 0x2081 [0x89 0x20 0x8C ] */ ldlayer 1, LAYER_208C +/* 0x2084 [0x8A 0x20 0x9C ] */ ldlayer 2, LAYER_209C +/* 0x2087 [0xD7 0xFF ] */ vibfreq 255 +/* 0x2089 [0xD8 0x32 ] */ vibdepth 50 +/* 0x208B [0xFF ] */ end + +.layer LAYER_208C +/* 0x208C [0xC6 0x4A ] */ instr SF0_INST_74 +/* 0x208E [0xCB 0x66 0x7C 0xD3 ] */ env ENVELOPE_667C, 211 +/* 0x2092 [0xC4 ] */ legato +/* 0x2093 [0xC7 0x85 0x03 0xFF ] */ portamento 0x85, PITCH_C1, 255 +LAYER_2097: +/* 0x2097 [0x54 0x60 0x64 ] */ notedv PITCH_F2, 96, 100 +/* 0x209A [0xF4 0xFB ] */ rjump LAYER_2097 + +.layer LAYER_209C +/* 0x209C [0xC2 0xEE ] */ transpose -18 +/* 0x209E [0xC6 0x34 ] */ instr SF0_INST_52 +/* 0x20A0 [0xFB 0x20 0xA7 ] */ jump LAYER_20A7 + +.layer LAYER_20A3 +/* 0x20A3 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x20A5 [0xC2 0x0C ] */ transpose 12 +LAYER_20A7: +/* 0x20A7 [0xCB 0x66 0x7C 0xD3 ] */ env ENVELOPE_667C, 211 +/* 0x20AB [0xC4 ] */ legato +/* 0x20AC [0xC7 0x85 0x0F 0xFF ] */ portamento 0x85, PITCH_C2, 255 +LAYER_20B0: +/* 0x20B0 [0x60 0x60 0x4A ] */ notedv PITCH_F3, 96, 74 +/* 0x20B3 [0xF4 0xFB ] */ rjump LAYER_20B0 + +.channel CHAN_20B5 +/* 0x20B5 [0x88 0x20 0xBC ] */ ldlayer 0, LAYER_20BC +/* 0x20B8 [0x89 0x20 0xC7 ] */ ldlayer 1, LAYER_20C7 +/* 0x20BB [0xFF ] */ end + +.layer LAYER_20BC +/* 0x20BC [0xC6 0x33 ] */ instr SF0_INST_51 +/* 0x20BE [0xC2 0x30 ] */ transpose 48 +LAYER_20C0: +/* 0x20C0 [0xC4 ] */ legato +LAYER_20C1: +/* 0x20C1 [0x6D 0xFF 0xBC 0x40 ] */ notedv PITCH_GF4, 32700, 64 +/* 0x20C5 [0xF4 0xFA ] */ rjump LAYER_20C1 + +.layer LAYER_20C7 +/* 0x20C7 [0xC6 0x33 ] */ instr SF0_INST_51 +/* 0x20C9 [0xF4 0xF5 ] */ rjump LAYER_20C0 + +.channel CHAN_20CB +/* 0x20CB [0xC1 0x30 ] */ instr SF0_INST_48 +/* 0x20CD [0xD9 0xF5 ] */ releaserate 245 +/* 0x20CF [0x88 0x20 0xD3 ] */ ldlayer 0, LAYER_20D3 +/* 0x20D2 [0xFF ] */ end + +.layer LAYER_20D3 +/* 0x20D3 [0x67 0x09 0x6E ] */ notedv PITCH_C4, 9, 110 +/* 0x20D6 [0xFF ] */ end + +.channel CHAN_20D7 +/* 0x20D7 [0xC1 0x30 ] */ instr SF0_INST_48 +/* 0x20D9 [0x88 0x20 0xDD ] */ ldlayer 0, LAYER_20DD +/* 0x20DC [0xFF ] */ end + +.layer LAYER_20DD +/* 0x20DD [0x6B 0x18 0x6E ] */ notedv PITCH_E4, 24, 110 +/* 0x20E0 [0xFF ] */ end + +.channel CHAN_20E1 +/* 0x20E1 [0xC1 0x32 ] */ instr SF0_INST_50 +/* 0x20E3 [0x88 0x20 0xE7 ] */ ldlayer 0, LAYER_20E7 +/* 0x20E6 [0xFF ] */ end + +.layer LAYER_20E7 +/* 0x20E7 [0x6B 0x80 0x91 0x6E ] */ notedv PITCH_E4, 145, 110 +/* 0x20EB [0xFF ] */ end + +.channel CHAN_20EC +/* 0x20EC [0x88 0x20 0xF0 ] */ ldlayer 0, LAYER_20F0 +/* 0x20EF [0xFF ] */ end + +.layer LAYER_20F0 +/* 0x20F0 [0xC2 0x34 ] */ transpose 52 +/* 0x20F2 [0xFB 0x1A 0xB9 ] */ jump LAYER_1AB9 + +.channel CHAN_20F5 +/* 0x20F5 [0xED 0x0F ] */ gain 15 +/* 0x20F7 [0x88 0x20 0xFE ] */ ldlayer 0, LAYER_20FE +/* 0x20FA [0x89 0x21 0x0B ] */ ldlayer 1, LAYER_210B +/* 0x20FD [0xFF ] */ end + +.layer LAYER_20FE +/* 0x20FE [0xC6 0x40 ] */ instr SF0_INST_64 +/* 0x2100 [0xCB 0x67 0xF4 0xDD ] */ env ENVELOPE_67F4, 221 +/* 0x2104 [0xC2 0x18 ] */ transpose 24 +/* 0x2106 [0x67 0x80 0xF8 0x4B ] */ notedv PITCH_C4, 248, 75 +/* 0x210A [0xFF ] */ end + +.layer LAYER_210B +/* 0x210B [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x210D [0xCB 0x67 0xF4 0xDD ] */ env ENVELOPE_67F4, 221 +/* 0x2111 [0xC2 0x24 ] */ transpose 36 +/* 0x2113 [0x67 0x80 0xF8 0x64 ] */ notedv PITCH_C4, 248, 100 +/* 0x2117 [0xFF ] */ end + +.channel CHAN_2118 +/* 0x2118 [0xC1 0x44 ] */ instr SF0_INST_68 +/* 0x211A [0x88 0x21 0x30 ] */ ldlayer 0, LAYER_2130 +/* 0x211D [0x89 0x21 0x24 ] */ ldlayer 1, LAYER_2124 +/* 0x2120 [0x8A 0x21 0x47 ] */ ldlayer 2, LAYER_2147 +/* 0x2123 [0xFF ] */ end + +.layer LAYER_2124 +/* 0x2124 [0xC2 0x1B ] */ transpose 27 +/* 0x2126 [0xF4 0x0A ] */ rjump LAYER_2132 + +/* 0x2128 [0xC2 0x21 ] */ transpose 33 +/* 0x212A [0xCB 0x65 0xFC 0xF0 ] */ env ENVELOPE_65FC, 240 +/* 0x212E [0xF4 0x02 ] */ rjump LAYER_2132 + +.layer LAYER_2130 +/* 0x2130 [0xC2 0x18 ] */ transpose 24 +LAYER_2132: +/* 0x2132 [0xC4 ] */ legato +/* 0x2133 [0xC7 0x81 0x28 0xFF ] */ portamento 0x81, PITCH_DF4, 255 +LAYER_2137: +/* 0x2137 [0x69 0x80 0x30 0x50 ] */ noteldv PITCH_D4, 48, 80 +/* 0x213B [0xF4 0xFA ] */ rjump LAYER_2137 + +/* 0x213D [0xC2 0x20 ] */ transpose 32 +/* 0x213F [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x2141 [0xCB 0x65 0xFC 0xF0 ] */ env ENVELOPE_65FC, 240 +/* 0x2145 [0xF4 0x08 ] */ rjump LAYER_214F + +.layer LAYER_2147 +/* 0x2147 [0xC2 0x30 ] */ transpose 48 +LAYER_2149: +/* 0x2149 [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x214B [0xCB 0x66 0xFC 0xF0 ] */ env ENVELOPE_66FC, 240 +LAYER_214F: +/* 0x214F [0xC4 ] */ legato +LAYER_2150: +/* 0x2150 [0x73 0xFD 0x00 0x32 ] */ notedv PITCH_C5, 32000, 50 +/* 0x2154 [0xF4 0xFA ] */ rjump LAYER_2150 + +.channel CHAN_2156 +/* 0x2156 [0x88 0x21 0x5D ] */ ldlayer 0, LAYER_215D +/* 0x2159 [0x89 0x21 0x6D ] */ ldlayer 1, LAYER_216D +/* 0x215C [0xFF ] */ end + +.layer LAYER_215D +/* 0x215D [0xC0 0x06 ] */ ldelay 6 +/* 0x215F [0xC4 ] */ legato +/* 0x2160 [0xC6 0x07 ] */ instr SF0_INST_7 +/* 0x2162 [0xC7 0x85 0x20 0xFF ] */ portamento 0x85, PITCH_F3, 255 +/* 0x2166 [0x64 0x18 0x50 ] */ notedv PITCH_A3, 24, 80 +/* 0x2169 [0x56 0x32 0x50 ] */ notedv PITCH_G2, 50, 80 +/* 0x216C [0xFF ] */ end + +.layer LAYER_216D +/* 0x216D [0xC6 0x28 ] */ instr SF0_INST_40 +/* 0x216F [0x1F 0x0A 0x5D 0x7F ] */ notedvg PITCH_E3, 10, 93, 127 +/* 0x2173 [0x55 0x1F 0x5A ] */ notedv PITCH_GF2, 31, 90 +/* 0x2176 [0xFF ] */ end + +.channel CHAN_2177 +/* 0x2177 [0xDC 0x60 ] */ panweight 96 +/* 0x2179 [0x88 0x21 0x85 ] */ ldlayer 0, LAYER_2185 +/* 0x217C [0x89 0x21 0x90 ] */ ldlayer 1, LAYER_2190 +/* 0x217F [0x8A 0x21 0x83 ] */ ldlayer 2, LAYER_2183 +/* 0x2182 [0xFF ] */ end + +.layer LAYER_2183 +/* 0x2183 [0xC2 0xFA ] */ transpose -6 +.layer LAYER_2185 +/* 0x2185 [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x2187 [0xCF 0xDD ] */ releaserate 221 +/* 0x2189 [0xC4 ] */ legato +LAYER_218A: +/* 0x218A [0x6C 0xFD 0x00 0x5A ] */ notedv PITCH_F4, 32000, 90 +/* 0x218E [0xF4 0xFA ] */ rjump LAYER_218A + +.layer LAYER_2190 +/* 0x2190 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x2192 [0xCB 0x66 0x74 0xDD ] */ env ENVELOPE_6674, 221 +LAYER_2196: +/* 0x2196 [0xCA 0x40 ] */ notepan 64 +/* 0x2198 [0x72 0x50 0x55 ] */ notedv PITCH_B4, 80, 85 +/* 0x219B [0xCA 0x2D ] */ notepan 45 +/* 0x219D [0x6E 0x50 0x55 ] */ notedv PITCH_G4, 80, 85 +/* 0x21A0 [0xCA 0x61 ] */ notepan 97 +/* 0x21A2 [0x6C 0x40 0x55 ] */ notedv PITCH_F4, 64, 85 +/* 0x21A5 [0xCA 0x4A ] */ notepan 74 +/* 0x21A7 [0x70 0x31 0x55 ] */ notedv PITCH_A4, 49, 85 +/* 0x21AA [0xCA 0x52 ] */ notepan 82 +/* 0x21AC [0x75 0x3A 0x55 ] */ notedv PITCH_D5, 58, 85 +/* 0x21AF [0xCA 0x25 ] */ notepan 37 +/* 0x21B1 [0x70 0x25 0x55 ] */ notedv PITCH_A4, 37, 85 +/* 0x21B4 [0xCA 0x36 ] */ notepan 54 +/* 0x21B6 [0x6C 0x3D 0x55 ] */ notedv PITCH_F4, 61, 85 +/* 0x21B9 [0xCA 0x1D ] */ notepan 29 +/* 0x21BB [0x73 0x20 0x55 ] */ notedv PITCH_C5, 32, 85 +/* 0x21BE [0xF4 0xD6 ] */ rjump LAYER_2196 + +.channel CHAN_21C0 +/* 0x21C0 [0x88 0x21 0xC7 ] */ ldlayer 0, LAYER_21C7 +/* 0x21C3 [0x89 0x21 0xCD ] */ ldlayer 1, LAYER_21CD +/* 0x21C6 [0xFF ] */ end + +.layer LAYER_21C7 +/* 0x21C7 [0xC6 0x22 ] */ instr SF0_INST_34 +/* 0x21C9 [0x6B 0x18 0x50 ] */ notedv PITCH_E4, FRAMERATE_CONST(24, 29), 80 +/* 0x21CC [0xFF ] */ end + +.layer LAYER_21CD +/* 0x21CD [0xC6 0x1D ] */ instr SF0_INST_29 +/* 0x21CF [0xC7 0x81 0x1C 0xFF ] */ portamento 0x81, PITCH_DF3, 255 +/* 0x21D3 [0x5E 0x18 0x5F ] */ notedv PITCH_EF3, FRAMERATE_CONST(24, 29), 95 +/* 0x21D6 [0xFF ] */ end + +.channel CHAN_21D7 +/* 0x21D7 [0x88 0x21 0xED ] */ ldlayer 0, LAYER_21ED +/* 0x21DA [0x89 0x21 0xDE ] */ ldlayer 1, LAYER_21DE +/* 0x21DD [0xFF ] */ end + +.layer LAYER_21DE +/* 0x21DE [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x21E0 [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x21E4 [0x57 0x08 0x46 ] */ notedv PITCH_AF2, 8, 70 +/* 0x21E7 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x21E9 [0x5F 0x08 0x5A ] */ notedv PITCH_E3, 8, 90 +/* 0x21EC [0xFF ] */ end + +.layer LAYER_21ED +/* 0x21ED [0xC6 0x22 ] */ instr SF0_INST_34 +/* 0x21EF [0x70 0x06 0x50 ] */ notedv PITCH_A4, 6, 80 +/* 0x21F2 [0xC6 0x1D ] */ instr SF0_INST_29 +/* 0x21F4 [0xC7 0x81 0x26 0xFF ] */ portamento 0x81, PITCH_B3, 255 +/* 0x21F8 [0x60 0x0E 0x5F ] */ notedv PITCH_F3, 14, 95 +/* 0x21FB [0xFF ] */ end + +.channel CHAN_21FC +/* 0x21FC [0x88 0x22 0x00 ] */ ldlayer 0, LAYER_2200 +/* 0x21FF [0xFF ] */ end + +.layer LAYER_2200 +/* 0x2200 [0xC6 0x4B ] */ instr SF0_INST_75 +/* 0x2202 [0xCF 0xF0 ] */ releaserate 240 +LAYER_2204: +/* 0x2204 [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +/* 0x2208 [0x58 0x40 0x48 ] */ notedv PITCH_A2, 64, 72 +/* 0x220B [0xF4 0xF7 ] */ rjump LAYER_2204 + +.channel CHAN_220D +/* 0x220D [0xC1 0x22 ] */ instr SF0_INST_34 +/* 0x220F [0x88 0x22 0x1A ] */ ldlayer 0, LAYER_221A +/* 0x2212 [0x89 0x22 0x16 ] */ ldlayer 1, LAYER_2216 +/* 0x2215 [0xFF ] */ end + +.layer LAYER_2216 +/* 0x2216 [0xC6 0x39 ] */ instr SF0_INST_57 +/* 0x2218 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_221A +/* 0x221A [0xC4 ] */ legato +/* 0x221B [0xC7 0x01 0x28 0x74 ] */ portamento 0x01, PITCH_DF4, 116 +LAYER_221F: +/* 0x221F [0x6E 0xFF 0xBC 0x4C ] */ notedv PITCH_G4, 32700, 76 +/* 0x2223 [0xF4 0xFA ] */ rjump LAYER_221F + +.channel CHAN_2225 +/* 0x2225 [0x88 0x22 0x32 ] */ ldlayer 0, LAYER_2232 +/* 0x2228 [0x89 0x22 0x2C ] */ ldlayer 1, LAYER_222C +/* 0x222B [0xFF ] */ end + +.layer LAYER_222C +/* 0x222C [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x222E [0x62 0x14 0x64 ] */ notedv PITCH_G3, 20, 100 +/* 0x2231 [0xFF ] */ end + +.layer LAYER_2232 +/* 0x2232 [0xC6 0x07 ] */ instr SF0_INST_7 +/* 0x2234 [0x1F 0x06 0x5A 0x7F ] */ notedvg PITCH_E3, 6, 90, 127 +/* 0x2238 [0x25 0x06 0x5A 0x7F ] */ notedvg PITCH_BF3, 6, 90, 127 +/* 0x223C [0x6B 0x2A 0x5A ] */ notedv PITCH_E4, 42, 90 +/* 0x223F [0xFF ] */ end + +.channel CHAN_2240 +/* 0x2240 [0xC1 0x57 ] */ instr SF0_INST_87 +/* 0x2242 [0xDA 0x66 0x24 ] */ env ENVELOPE_6624 +/* 0x2245 [0xCC 0x20 ] */ ldi 32 +/* 0x2247 [0x71 ] */ stio IO_PORT_1 +/* 0x2248 [0x88 0x22 0x53 ] */ ldlayer 0, LAYER_2253 +/* 0x224B [0x89 0x22 0x4F ] */ ldlayer 1, LAYER_224F +/* 0x224E [0xFF ] */ end + +.layer LAYER_224F +/* 0x224F [0xC2 0x3C ] */ transpose 60 +/* 0x2251 [0xF4 0x04 ] */ rjump LAYER_2257 + +.layer LAYER_2253 +/* 0x2253 [0xC2 0x30 ] */ transpose 48 +/* 0x2255 [0xC0 0x05 ] */ ldelay 5 +LAYER_2257: +/* 0x2257 [0x64 0x09 0x50 ] */ notedv PITCH_A3, 9, 80 +/* 0x225A [0x61 0x53 0x50 ] */ notedv PITCH_GF3, 83, 80 +/* 0x225D [0xC0 0x64 ] */ ldelay 100 +/* 0x225F [0xF4 0xF6 ] */ rjump LAYER_2257 + +.channel CHAN_2261 +/* 0x2261 [0xCC 0x60 ] */ ldi 96 +/* 0x2263 [0xC7 0x00 0x22 0x88 ] */ stseq 0, CHAN_2287 + STSEQ_STSEQ_IMM +CHAN_2267: +/* 0x2267 [0xC1 0x4E ] */ instr SF0_INST_78 +/* 0x2269 [0xDA 0x66 0xEC ] */ env ENVELOPE_66EC +/* 0x226C [0xD9 0xE7 ] */ releaserate 231 +/* 0x226E [0xCC 0x04 ] */ ldi 4 +/* 0x2270 [0x76 ] */ stio IO_PORT_6 +/* 0x2271 [0x88 0x22 0x98 ] */ ldlayer 0, LAYER_2298 +CHAN_2274: +/* 0x2274 [0xB8 0x1F ] */ rand 31 +/* 0x2276 [0xC7 0x0E 0x22 0x99 ] */ stseq 14, LAYER_2298 + STSEQ_NOTEDV_DELAY_HI +/* 0x227A [0xC7 0x0E 0x22 0x92 ] */ stseq 14, CHAN_2291 + STSEQ_LDI_IMM +/* 0x227E [0xC7 0x2D 0x22 0x9A ] */ stseq 45, LAYER_2298 + STSEQ_NOTEDV_VELOCITY_2 +/* 0x2282 [0xB8 0x08 ] */ rand 8 +/* 0x2284 [0x56 ] */ subio IO_PORT_6 +/* 0x2285 [0xC9 0x07 ] */ and 7 +CHAN_2287: +/* 0x2287 [0xC7 0x60 0x22 0x98 ] */ stseq (NOTEDV_OPCODE | PITCH_F3), LAYER_2298 + STSEQ_NOTEDV_OPCODE_PITCH +/* 0x228B [0x66 ] */ ldio IO_PORT_6 +/* 0x228C [0xC8 0xFC ] */ sub 252 +/* 0x228E [0xC9 0x04 ] */ and 4 +/* 0x2290 [0x76 ] */ stio IO_PORT_6 +CHAN_2291: +/* 0x2291 [0xCC 0x01 ] */ ldi 1 +/* 0x2293 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x2296 [0xF4 0xDC ] */ rjump CHAN_2274 + +.layer LAYER_2298 +/* 0x2298 [0x67 0x47 0x50 ] */ notedv PITCH_C4, 71, 80 +/* 0x229B [0xF4 0xFB ] */ rjump LAYER_2298 + +.channel CHAN_229D +/* 0x229D [0x88 0x1F 0x43 ] */ ldlayer 0, LAYER_1F43 +/* 0x22A0 [0x89 0x1F 0x1C ] */ ldlayer 1, LAYER_1F1C +/* 0x22A3 [0xFF ] */ end + +.channel CHAN_22A4 +/* 0x22A4 [0xED 0x12 ] */ gain 18 +/* 0x22A6 [0x88 0x22 0xAA ] */ ldlayer 0, LAYER_22AA +/* 0x22A9 [0xFF ] */ end + +.layer LAYER_22AA +/* 0x22AA [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x22AC [0xCB 0x66 0x24 0xF6 ] */ env ENVELOPE_6624, 246 +/* 0x22B0 [0x2A 0x09 0x69 0xC0 ] */ notedvg PITCH_EF4, 9, 105, 192 +/* 0x22B4 [0xCB 0x66 0x10 0xDC ] */ env ENVELOPE_6610, 220 +/* 0x22B8 [0x5A 0x00 0x69 ] */ notedv PITCH_B2, 0, 105 +/* 0x22BB [0xFF ] */ end + +.channel CHAN_22BC +/* 0x22BC [0xC1 0x34 ] */ instr SF0_INST_52 +/* 0x22BE [0xDA 0x66 0x74 ] */ env ENVELOPE_6674 +/* 0x22C1 [0x88 0x22 0xCB ] */ ldlayer 0, LAYER_22CB +/* 0x22C4 [0xD8 0xFF ] */ vibdepth 255 +/* 0x22C6 [0xE1 0x04 0x40 0x64 ] */ vibfreqgrad 4, 64, 100 +/* 0x22CA [0xFF ] */ end + +.layer LAYER_22CB +/* 0x22CB [0x51 0x81 0xC2 0x50 ] */ notedv PITCH_D2, 450, 80 +/* 0x22CF [0xFF ] */ end + +.channel CHAN_22D0 +/* 0x22D0 [0xC1 0x34 ] */ instr SF0_INST_52 +/* 0x22D2 [0xDA 0x66 0x74 ] */ env ENVELOPE_6674 +/* 0x22D5 [0x88 0x22 0xDF ] */ ldlayer 0, LAYER_22DF +/* 0x22D8 [0xD8 0xFF ] */ vibdepth 255 +/* 0x22DA [0xE1 0x02 0x07 0x19 ] */ vibfreqgrad 2, 7, 25 +/* 0x22DE [0xFF ] */ end + +.layer LAYER_22DF +/* 0x22DF [0xC4 ] */ legato +LAYER_22E0: +/* 0x22E0 [0x4F 0xFF 0xBC 0x50 ] */ notedv PITCH_C2, 32700, 80 +/* 0x22E4 [0xF4 0xFA ] */ rjump LAYER_22E0 + +.channel CHAN_22E6 +/* 0x22E6 [0x88 0x22 0xEA ] */ ldlayer 0, LAYER_22EA +/* 0x22E9 [0xFF ] */ end + +.layer LAYER_22EA +/* 0x22EA [0xC6 0x2D ] */ instr SF0_INST_45 +/* 0x22EC [0x5B 0x13 0x69 ] */ notedv PITCH_C3, FRAMERATE_CONST(19, 23), 105 +/* 0x22EF [0xC6 0x42 ] */ instr SF0_INST_66 +/* 0x22F1 [0x4E 0x49 0x67 ] */ notedv PITCH_B1, FRAMERATE_CONST(73, 88), 103 +/* 0x22F4 [0xFF ] */ end + +.channel CHAN_22F5 +/* 0x22F5 [0xC1 0x3F ] */ instr SF0_INST_63 +/* 0x22F7 [0x88 0x22 0xFB ] */ ldlayer 0, LAYER_22FB +/* 0x22FA [0xFF ] */ end + +.layer LAYER_22FB +/* 0x22FB [0x50 0x08 0x64 ] */ notedv PITCH_DF2, 8, 100 +/* 0x22FE [0x5D 0x18 0x64 ] */ notedv PITCH_D3, 24, 100 +/* 0x2301 [0xFF ] */ end + +.channel CHAN_2302 +/* 0x2302 [0x88 0x23 0x0B ] */ ldlayer 0, LAYER_230B +/* 0x2305 [0x89 0x23 0x09 ] */ ldlayer 1, LAYER_2309 +/* 0x2308 [0xFF ] */ end + +.layer LAYER_2309 +/* 0x2309 [0xC2 0x05 ] */ transpose 5 +.layer LAYER_230B +/* 0x230B [0xC4 ] */ legato +/* 0x230C [0xC6 0x3C ] */ instr SF0_INST_60 +/* 0x230E [0xCB 0x66 0x74 0xC8 ] */ env ENVELOPE_6674, 200 +/* 0x2312 [0xC7 0x01 0x38 0x7F ] */ portamento 0x01, PITCH_F5, 127 +LAYER_2316: +/* 0x2316 [0x7E 0xFF 0xBC 0x55 ] */ notedv PITCH_B5, 32700, 85 +/* 0x231A [0xF4 0xFA ] */ rjump LAYER_2316 + +.channel CHAN_231C +/* 0x231C [0x88 0x23 0x27 ] */ ldlayer 0, LAYER_2327 +/* 0x231F [0x89 0x23 0x25 ] */ ldlayer 1, LAYER_2325 +/* 0x2322 [0xED 0x18 ] */ gain 24 +/* 0x2324 [0xFF ] */ end + +.layer LAYER_2325 +/* 0x2325 [0xC2 0x04 ] */ transpose 4 +.layer LAYER_2327 +/* 0x2327 [0xC6 0x42 ] */ instr SF0_INST_66 +/* 0x2329 [0xC7 0x84 0x13 0x7F ] */ portamento 0x84, PITCH_E2, 127 +LAYER_232D: +/* 0x232D [0x45 0x09 0x6E ] */ notedv PITCH_D1, 9, 110 +/* 0x2330 [0xF4 0xFB ] */ rjump LAYER_232D + +.channel CHAN_2332 +/* 0x2332 [0xC1 0x4B ] */ instr SF0_INST_75 +/* 0x2334 [0x88 0x23 0x38 ] */ ldlayer 0, LAYER_2338 +/* 0x2337 [0xFF ] */ end + +.layer LAYER_2338 +/* 0x2338 [0xC7 0x81 0x20 0xAF ] */ portamento 0x81, PITCH_F3, 175 +/* 0x233C [0x66 0x30 0x50 ] */ notedv PITCH_B3, 48, 80 +/* 0x233F [0xFF ] */ end + +.channel CHAN_2340 +/* 0x2340 [0xC1 0x4B ] */ instr SF0_INST_75 +/* 0x2342 [0x88 0x23 0x46 ] */ ldlayer 0, LAYER_2346 +/* 0x2345 [0xFF ] */ end + +.layer LAYER_2346 +/* 0x2346 [0xC7 0x81 0x26 0xAF ] */ portamento 0x81, PITCH_B3, 175 +/* 0x234A [0x60 0x30 0x50 ] */ notedv PITCH_F3, 48, 80 +/* 0x234D [0xFF ] */ end + +.channel CHAN_234E +/* 0x234E [0xED 0x0A ] */ gain 10 +/* 0x2350 [0x88 0x23 0x57 ] */ ldlayer 0, LAYER_2357 +/* 0x2353 [0x89 0x23 0x66 ] */ ldlayer 1, LAYER_2366 +/* 0x2356 [0xFF ] */ end + +.layer LAYER_2357 +/* 0x2357 [0xC6 0x49 ] */ instr SF0_INST_73 +/* 0x2359 [0xCF 0xDD ] */ releaserate 221 +/* 0x235B [0xC4 ] */ legato +/* 0x235C [0xC7 0x81 0x34 0xFF ] */ portamento 0x81, PITCH_DF5, 255 +LAYER_2360: +/* 0x2360 [0x6C 0x80 0xC8 0x6E ] */ notedv PITCH_F4, 200, 110 +/* 0x2364 [0xF4 0xFA ] */ rjump LAYER_2360 + +.layer LAYER_2366 +/* 0x2366 [0xC6 0x4A ] */ instr SF0_INST_74 +/* 0x2368 [0xCF 0xDD ] */ releaserate 221 +/* 0x236A [0xC4 ] */ legato +/* 0x236B [0xC7 0x81 0x10 0xFF ] */ portamento 0x81, PITCH_DF2, 255 +LAYER_236F: +/* 0x236F [0x54 0x7F 0x48 ] */ notedv PITCH_F2, 127, 72 +/* 0x2372 [0xF4 0xFB ] */ rjump LAYER_236F + +.channel CHAN_2374 +/* 0x2374 [0x88 0x23 0x7B ] */ ldlayer 0, LAYER_237B +/* 0x2377 [0x89 0x21 0x85 ] */ ldlayer 1, LAYER_2185 +/* 0x237A [0xFF ] */ end + +.layer LAYER_237B +/* 0x237B [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x237D [0xCB 0x66 0x60 0xF7 ] */ env ENVELOPE_6660, 247 +LAYER_2381: +/* 0x2381 [0x78 0x03 0x5F ] */ notedv PITCH_F5, 3, 95 +/* 0x2384 [0x6C 0x05 0x5F ] */ notedv PITCH_F4, 5, 95 +/* 0x2387 [0xF4 0xF8 ] */ rjump LAYER_2381 + +.channel CHAN_2389 +/* 0x2389 [0xDC 0x00 ] */ panweight 0 +/* 0x238B [0x88 0x23 0x98 ] */ ldlayer 0, LAYER_2398 +/* 0x238E [0x89 0x23 0x92 ] */ ldlayer 1, LAYER_2392 +/* 0x2391 [0xFF ] */ end + +.layer LAYER_2392 +/* 0x2392 [0xC2 0x01 ] */ transpose 1 +/* 0x2394 [0xCA 0x00 ] */ notepan 0 +/* 0x2396 [0xF4 0x02 ] */ rjump LAYER_239A + +.layer LAYER_2398 +/* 0x2398 [0xCA 0x7F ] */ notepan 127 +LAYER_239A: +/* 0x239A [0xC6 0x4F ] */ instr SF0_INST_79 +/* 0x239C [0xCB 0x66 0xF4 0xE1 ] */ env ENVELOPE_66F4, 225 +LAYER_23A0: +/* 0x23A0 [0x67 0xFD 0x00 0x40 ] */ notedv PITCH_C4, 32000, 64 +/* 0x23A4 [0xF4 0xFA ] */ rjump LAYER_23A0 + +.channel CHAN_23A6 +/* 0x23A6 [0x88 0x23 0xCB ] */ ldlayer 0, LAYER_23CB +/* 0x23A9 [0x89 0x23 0xB1 ] */ ldlayer 1, LAYER_23B1 +/* 0x23AC [0xFF ] */ end + +.layer LAYER_23AD +/* 0x23AD [0xC2 0x12 ] */ transpose 18 +/* 0x23AF [0xF4 0x02 ] */ rjump LAYER_23B3 + +.layer LAYER_23B1 +/* 0x23B1 [0xC2 0x0B ] */ transpose 11 +LAYER_23B3: +/* 0x23B3 [0xC6 0x48 ] */ instr SF0_INST_72 +/* 0x23B5 [0xF4 0x06 ] */ rjump LAYER_23BD + +.layer LAYER_23B7 +/* 0x23B7 [0xC6 0x48 ] */ instr SF0_INST_72 +/* 0x23B9 [0xCB 0x68 0x24 0xE1 ] */ env ENVELOPE_6824, 225 +LAYER_23BD: +/* 0x23BD [0xCF 0xE1 ] */ releaserate 225 +LAYER_23BF: +/* 0x23BF [0x4F 0xFD 0x00 0x46 ] */ notedv PITCH_C2, 32000, 70 +/* 0x23C3 [0xF4 0xFA ] */ rjump LAYER_23BF + +.layer LAYER_23C5 +/* 0x23C5 [0xC2 0x06 ] */ transpose 6 +/* 0x23C7 [0xF4 0x02 ] */ rjump LAYER_23CB + +.layer LAYER_23C9 +/* 0x23C9 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_23CB +/* 0x23CB [0xC6 0x0D ] */ instr SF0_INST_13 +/* 0x23CD [0xCF 0xE1 ] */ releaserate 225 +LAYER_23CF: +/* 0x23CF [0x60 0xFD 0x00 0x4A ] */ notedv PITCH_F3, 32000, 74 +/* 0x23D3 [0xF4 0xFA ] */ rjump LAYER_23CF + +.channel CHAN_23D5 +/* 0x23D5 [0x88 0x23 0xD9 ] */ ldlayer 0, LAYER_23D9 +/* 0x23D8 [0xFF ] */ end + +.layer LAYER_23D9 +/* 0x23D9 [0xC6 0x45 ] */ instr SF0_INST_69 +/* 0x23DB [0xCB 0x66 0xB8 0xFB ] */ env ENVELOPE_66B8, 251 +/* 0x23DF [0xC4 ] */ legato +/* 0x23E0 [0xC7 0x85 0x1B 0xFF ] */ portamento 0x85, PITCH_C3, 255 +/* 0x23E4 [0x78 0x09 0x41 ] */ notedv PITCH_F5, 9, 65 +/* 0x23E7 [0x70 0x2C 0x41 ] */ notedv PITCH_A4, 44, 65 +/* 0x23EA [0xFF ] */ end + +.channel CHAN_23EB +/* 0x23EB [0x89 0x14 0xA4 ] */ ldlayer 1, LAYER_14A4 +/* 0x23EE [0x88 0x23 0xF2 ] */ ldlayer 0, LAYER_23F2 +/* 0x23F1 [0xFF ] */ end + +.layer LAYER_23F2 +/* 0x23F2 [0xC6 0x3F ] */ instr SF0_INST_63 +/* 0x23F4 [0xC2 0x30 ] */ transpose 48 +/* 0x23F6 [0x52 0x05 0x58 ] */ notedv PITCH_EF2, 5, 88 +/* 0x23F9 [0xC6 0x3B ] */ instr SF0_INST_59 +/* 0x23FB [0xC2 0x00 ] */ transpose 0 +/* 0x23FD [0x64 0x0C 0x32 ] */ notedv PITCH_A3, 12, 50 +/* 0x2400 [0xFF ] */ end + +.channel CHAN_2401 +/* 0x2401 [0xC1 0x50 ] */ instr SF0_INST_80 +/* 0x2403 [0xDA 0x66 0x88 ] */ env ENVELOPE_6688 +/* 0x2406 [0x88 0x24 0x0A ] */ ldlayer 0, LAYER_240A +/* 0x2409 [0xFF ] */ end + +.layer LAYER_240A +/* 0x240A [0xC4 ] */ legato +/* 0x240B [0xC7 0x85 0x18 0xFF ] */ portamento 0x85, PITCH_A2, 255 +/* 0x240F [0x54 0x18 0x64 ] */ notedv PITCH_F2, FRAMERATE_CONST(24, 28), 100 +/* 0x2412 [0x57 0x30 0x64 ] */ notedv PITCH_AF2, FRAMERATE_CONST(48, 56), 100 +/* 0x2415 [0xFF ] */ end + +.channel CHAN_2416 +/* 0x2416 [0xC1 0x50 ] */ instr SF0_INST_80 +/* 0x2418 [0xDA 0x66 0x88 ] */ env ENVELOPE_6688 +/* 0x241B [0x88 0x24 0x22 ] */ ldlayer 0, LAYER_2422 +/* 0x241E [0x89 0x24 0x32 ] */ ldlayer 1, LAYER_2432 +/* 0x2421 [0xFF ] */ end + +.layer LAYER_2422 +/* 0x2422 [0xC4 ] */ legato +/* 0x2423 [0xC0 0x28 ] */ ldelay FRAMERATE_CONST(40, 48) +/* 0x2425 [0xC7 0x85 0x3A 0xFF ] */ portamento 0x85, PITCH_G5, 255 +/* 0x2429 [0x56 0x80 0x12 0x69 ] */ noteldv PITCH_G2, 18, 105 +/* 0x242D [0x6E 0x80 0x1E 0x69 ] */ noteldv PITCH_G4, 30, 105 +/* 0x2431 [0xFF ] */ end + +.layer LAYER_2432 +/* 0x2432 [0xC7 0x81 0x14 0xFF ] */ portamento 0x81, PITCH_F2, 255 +/* 0x2436 [0x5A 0x60 0x64 ] */ notedv PITCH_B2, FRAMERATE_CONST(96, 115), 100 +/* 0x2439 [0xFF ] */ end + +.channel CHAN_243A +/* 0x243A [0x88 0x24 0x51 ] */ ldlayer 0, LAYER_2451 +/* 0x243D [0x89 0x24 0x45 ] */ ldlayer 1, LAYER_2445 +/* 0x2440 [0xD7 0xDC ] */ vibfreq 220 +/* 0x2442 [0xD8 0x35 ] */ vibdepth 53 +/* 0x2444 [0xFF ] */ end + +.layer LAYER_2445 +/* 0x2445 [0xC6 0x4A ] */ instr SF0_INST_74 +/* 0x2447 [0xCB 0x66 0x7C 0xF7 ] */ env ENVELOPE_667C, 247 +/* 0x244B [0xC4 ] */ legato +LAYER_244C: +/* 0x244C [0x4C 0x60 0x6C ] */ notedv PITCH_A1, 96, 108 +/* 0x244F [0xF4 0xFB ] */ rjump LAYER_244C + +.layer LAYER_2451 +/* 0x2451 [0xC2 0xEE ] */ transpose -18 +/* 0x2453 [0xC6 0x34 ] */ instr SF0_INST_52 +/* 0x2455 [0xCB 0x66 0x7C 0xF7 ] */ env ENVELOPE_667C, 247 +/* 0x2459 [0xC4 ] */ legato +LAYER_245A: +/* 0x245A [0x5E 0x60 0x5A ] */ notedv PITCH_EF3, 96, 90 +/* 0x245D [0xF4 0xFB ] */ rjump LAYER_245A + +.channel CHAN_245F +/* 0x245F [0x88 0x24 0x66 ] */ ldlayer 0, LAYER_2466 +/* 0x2462 [0x89 0x24 0x75 ] */ ldlayer 1, LAYER_2475 +/* 0x2465 [0xFF ] */ end + +.layer LAYER_2466 +/* 0x2466 [0xC6 0x50 ] */ instr SF0_INST_80 +/* 0x2468 [0xCB 0x66 0x94 0xFB ] */ env ENVELOPE_6694, 251 +/* 0x246C [0xC7 0x81 0x0A 0xFF ] */ portamento 0x81, PITCH_G1, 255 +/* 0x2470 [0x56 0x80 0x24 0x52 ] */ noteldv PITCH_G2, 36, 82 +/* 0x2474 [0xFF ] */ end + +.layer LAYER_2475 +/* 0x2475 [0xC6 0x04 ] */ instr SF0_INST_4 +/* 0x2477 [0xC7 0x81 0x08 0xFF ] */ portamento 0x81, PITCH_F1, 255 +/* 0x247B [0x4F 0x80 0x24 0x69 ] */ noteldv PITCH_C2, 36, 105 +/* 0x247F [0xFF ] */ end + +.channel CHAN_2480 +/* 0x2480 [0x88 0x24 0x87 ] */ ldlayer 0, LAYER_2487 +/* 0x2483 [0x89 0x24 0x96 ] */ ldlayer 1, LAYER_2496 +/* 0x2486 [0xFF ] */ end + +.layer LAYER_2487 +/* 0x2487 [0xC6 0x50 ] */ instr SF0_INST_80 +/* 0x2489 [0xCB 0x66 0x94 0xFB ] */ env ENVELOPE_6694, 251 +/* 0x248D [0xC7 0x81 0x16 0xFF ] */ portamento 0x81, PITCH_G2, 255 +/* 0x2491 [0x43 0x80 0x24 0x5A ] */ noteldv PITCH_C1, 36, 90 +/* 0x2495 [0xFF ] */ end + +.layer LAYER_2496 +/* 0x2496 [0xC6 0x04 ] */ instr SF0_INST_4 +/* 0x2498 [0xC7 0x81 0x14 0xFF ] */ portamento 0x81, PITCH_F2, 255 +/* 0x249C [0x43 0x80 0x24 0x5F ] */ noteldv PITCH_C1, 36, 95 +/* 0x24A0 [0xFF ] */ end + +.channel CHAN_24A1 +/* 0x24A1 [0x88 0x24 0xA7 ] */ ldlayer 0, LAYER_24A7 +/* 0x24A4 [0xFF ] */ end + +.layer LAYER_24A5 +/* 0x24A5 [0xC2 0x08 ] */ transpose 8 +.layer LAYER_24A7 +/* 0x24A7 [0xC6 0x42 ] */ instr SF0_INST_66 +/* 0x24A9 [0x4E 0x00 0x67 ] */ notedv FRAMERATE_CONST(PITCH_B1, PITCH_A1), 0, 103 +/* 0x24AC [0xFF ] */ end + +.channel CHAN_24AD +/* 0x24AD [0x88 0x24 0xB1 ] */ ldlayer 0, LAYER_24B1 +/* 0x24B0 [0xFF ] */ end + +.layer LAYER_24B1 +/* 0x24B1 [0xC6 0x4B ] */ instr SF0_INST_75 +/* 0x24B3 [0xCF 0xF0 ] */ releaserate 240 +/* 0x24B5 [0x5F 0x3C 0x4B ] */ notedv PITCH_E3, 60, 75 +LAYER_24B8: +/* 0x24B8 [0x61 0x38 0x4B ] */ notedv PITCH_GF3, 56, 75 +/* 0x24BB [0xF4 0xFB ] */ rjump LAYER_24B8 + +.channel CHAN_24BD +/* 0x24BD [0xC1 0x3E ] */ instr SF0_INST_62 +/* 0x24BF [0x88 0x24 0xC3 ] */ ldlayer 0, LAYER_24C3 +/* 0x24C2 [0xFF ] */ end + +.layer LAYER_24C3 +/* 0x24C3 [0xC7 0x82 0x27 0x7F ] */ portamento 0x82, PITCH_C4, 127 +/* 0x24C7 [0x64 0x7F 0x64 ] */ notedv PITCH_A3, 127, 100 +/* 0x24CA [0xFF ] */ end + +.channel CHAN_24CB +/* 0x24CB [0xC1 0x3E ] */ instr SF0_INST_62 +/* 0x24CD [0x07 ] */ cdelay 7 +/* 0x24CE [0x88 0x24 0xD2 ] */ ldlayer 0, LAYER_24D2 +/* 0x24D1 [0xFF ] */ end + +.layer LAYER_24D2 +/* 0x24D2 [0x70 0x07 0x4C ] */ notedv PITCH_A4, 7, 76 +/* 0x24D5 [0xC6 0x03 ] */ instr SF0_INST_3 +/* 0x24D7 [0xC7 0x81 0x27 0x7F ] */ portamento 0x81, PITCH_C4, 127 +/* 0x24DB [0x7E 0x18 0x64 ] */ notedv PITCH_B5, 24, 100 +/* 0x24DE [0xFF ] */ end + +.channel CHAN_24DF +/* 0x24DF [0x88 0x24 0xE9 ] */ ldlayer 0, LAYER_24E9 +.channel CHAN_24E2 +/* 0x24E2 [0xC1 0x07 ] */ instr SF0_INST_7 +/* 0x24E4 [0xD8 0x24 ] */ vibdepth 36 +/* 0x24E6 [0xD7 0xFF ] */ vibfreq 255 +/* 0x24E8 [0xFF ] */ end + +.layer LAYER_24E9 +/* 0x24E9 [0x60 0x0A 0x5A ] */ notedv PITCH_F3, 10, 90 +/* 0x24EC [0x67 0x1E 0x5A ] */ notedv PITCH_C4, 30, 90 +/* 0x24EF [0xFF ] */ end + +.channel CHAN_24F0 +/* 0x24F0 [0x88 0x24 0xF7 ] */ ldlayer 0, LAYER_24F7 +/* 0x24F3 [0xFC 0x24 0xE2 ] */ call CHAN_24E2 +/* 0x24F6 [0xFF ] */ end + +.layer LAYER_24F7 +/* 0x24F7 [0x69 0x0A 0x64 ] */ notedv PITCH_D4, 10, 100 +/* 0x24FA [0xC7 0x81 0x2B 0xFF ] */ portamento 0x81, PITCH_E4, 255 +/* 0x24FE [0x5F 0x5A 0x64 ] */ notedv PITCH_E3, 90, 100 +/* 0x2501 [0xFF ] */ end + +.channel CHAN_2502 +/* 0x2502 [0x88 0x25 0x06 ] */ ldlayer 0, LAYER_2506 +/* 0x2505 [0xFF ] */ end + +.layer LAYER_2506 +/* 0x2506 [0xC6 0x29 ] */ instr SF0_INST_41 +/* 0x2508 [0xC2 0x30 ] */ transpose 48 +/* 0x250A [0x64 0x00 0x6E ] */ notedv PITCH_A3, 0, 110 +/* 0x250D [0xFF ] */ end + +.channel CHAN_250E +/* 0x250E [0x88 0x25 0x17 ] */ ldlayer 0, LAYER_2517 +/* 0x2511 [0x89 0x25 0x28 ] */ ldlayer 1, LAYER_2528 +/* 0x2514 [0xDC 0x30 ] */ panweight 48 +/* 0x2516 [0xFF ] */ end + +.layer LAYER_2517 +/* 0x2517 [0xC6 0x3C ] */ instr SF0_INST_60 +/* 0x2519 [0xCB 0x66 0x74 0xE8 ] */ env ENVELOPE_6674, 232 +/* 0x251D [0xC4 ] */ legato +/* 0x251E [0xC7 0x85 0x2E 0xFF ] */ portamento 0x85, PITCH_G4, 255 +LAYER_2522: +/* 0x2522 [0x73 0x83 0xE8 0x69 ] */ notedv PITCH_C5, 1000, 105 +/* 0x2526 [0xF4 0xFA ] */ rjump LAYER_2522 + +.layer LAYER_2528 +/* 0x2528 [0xC6 0x51 ] */ instr SF0_INST_81 +/* 0x252A [0x5B 0x08 0x69 ] */ notedv PITCH_C3, 8, 105 +/* 0x252D [0x56 0x00 0x69 ] */ notedv PITCH_G2, 0, 105 +/* 0x2530 [0xFF ] */ end + +.channel CHAN_2531 +/* 0x2531 [0x88 0x25 0x45 ] */ ldlayer 0, LAYER_2545 +/* 0x2534 [0x89 0x25 0x38 ] */ ldlayer 1, LAYER_2538 +/* 0x2537 [0xFF ] */ end + +.layer LAYER_2538 +/* 0x2538 [0xC6 0x40 ] */ instr SF0_INST_64 +/* 0x253A [0xCB 0x67 0xD8 0xF0 ] */ env ENVELOPE_67D8, 240 +/* 0x253E [0xC4 ] */ legato +LAYER_253F: +/* 0x253F [0x63 0xFD 0x00 0x20 ] */ notedv PITCH_AF3, 32000, 32 +/* 0x2543 [0xF4 0xFA ] */ rjump LAYER_253F + +.layer LAYER_2545 +/* 0x2545 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x2547 [0xCB 0x67 0xE4 0xF0 ] */ env ENVELOPE_67E4, 240 +/* 0x254B [0xC2 0x0F ] */ transpose 15 +/* 0x254D [0xC4 ] */ legato +LAYER_254E: +/* 0x254E [0x70 0xFD 0x00 0x40 ] */ notedv PITCH_A4, 32000, 64 +/* 0x2552 [0xF4 0xFA ] */ rjump LAYER_254E + +.channel CHAN_2554 +/* 0x2554 [0x88 0x25 0x5B ] */ ldlayer 0, LAYER_255B +/* 0x2557 [0x89 0x25 0x68 ] */ ldlayer 1, LAYER_2568 +/* 0x255A [0xFF ] */ end + +.layer LAYER_255B +/* 0x255B [0xC2 0x18 ] */ transpose 24 +/* 0x255D [0xC6 0x2A ] */ instr SF0_INST_42 +/* 0x255F [0xCB 0x67 0xCC 0xF1 ] */ env ENVELOPE_67CC, 241 +/* 0x2563 [0x76 0x81 0x20 0x2A ] */ notedv PITCH_EF5, FRAMERATE_CONST(288, 346), 42 +/* 0x2567 [0xFF ] */ end + +.layer LAYER_2568 +/* 0x2568 [0xFB 0x21 0x0B ] */ jump LAYER_210B + +.channel CHAN_256B +/* 0x256B [0xFC 0x07 0xAE ] */ call CHAN_07AE +/* 0x256E [0x89 0x25 0x72 ] */ ldlayer 1, LAYER_2572 +/* 0x2571 [0xFF ] */ end + +.layer LAYER_2572 +/* 0x2572 [0xC6 0x03 ] */ instr SF0_INST_3 +/* 0x2574 [0xC7 0x84 0x1B 0xFF ] */ portamento 0x84, PITCH_C3, 255 +/* 0x2578 [0x64 0x0F 0x5D ] */ notedv PITCH_A3, 15, 93 +/* 0x257B [0x60 0x10 0x5D ] */ notedv PITCH_F3, 16, 93 +/* 0x257E [0x5D 0x11 0x5D ] */ notedv PITCH_D3, 17, 93 +/* 0x2581 [0xFF ] */ end + +.channel CHAN_2582 +/* 0x2582 [0xC1 0x45 ] */ instr SF0_INST_69 +/* 0x2584 [0xDA 0x67 0xD8 ] */ env ENVELOPE_67D8 +/* 0x2587 [0xDC 0x00 ] */ panweight 0 +/* 0x2589 [0x88 0x25 0x8D ] */ ldlayer 0, LAYER_258D +/* 0x258C [0xFF ] */ end + +.layer LAYER_258D +/* 0x258D [0xC4 ] */ legato +/* 0x258E [0xC7 0x81 0x30 0xFF ] */ portamento 0x81, PITCH_A4, 255 +LAYER_2592: +/* 0x2592 [0x75 0x20 0x32 ] */ notedv PITCH_D5, 32, 50 +/* 0x2595 [0xF4 0xFB ] */ rjump LAYER_2592 + +.channel CHAN_2597 +/* 0x2597 [0x88 0x25 0xA7 ] */ ldlayer 0, LAYER_25A7 +/* 0x259A [0x89 0x25 0xBC ] */ ldlayer 1, LAYER_25BC +/* 0x259D [0x04 ] */ cdelay 4 +/* 0x259E [0xD7 0x7F ] */ vibfreq 127 +/* 0x25A0 [0xE2 0x19 0x50 0x64 ] */ vibdepthgrad 25, 80, 100 +/* 0x25A4 [0xFD 0x32 ] */ delay 50 +/* 0x25A6 [0xFF ] */ end + +.layer LAYER_25A7 +/* 0x25A7 [0xC6 0x0B ] */ instr SF0_INST_11 +/* 0x25A9 [0xCF 0xD2 ] */ releaserate 210 +/* 0x25AB [0x64 0x04 0x5F ] */ notedv PITCH_A3, 4, 95 +/* 0x25AE [0xC6 0x34 ] */ instr SF0_INST_52 +/* 0x25B0 [0xCB 0x66 0x74 0xEB ] */ env ENVELOPE_6674, 235 +/* 0x25B4 [0xC7 0x85 0x07 0xFF ] */ portamento 0x85, PITCH_E1, 255 +/* 0x25B8 [0x62 0x38 0x46 ] */ notedv PITCH_G3, 56, 70 +/* 0x25BB [0xFF ] */ end + +.layer LAYER_25BC +/* 0x25BC [0xC6 0x2D ] */ instr SF0_INST_45 +/* 0x25BE [0xCF 0xD8 ] */ releaserate 216 +/* 0x25C0 [0x5B 0x04 0x5F ] */ notedv PITCH_C3, 4, 95 +/* 0x25C3 [0xFB 0x23 0xD9 ] */ jump LAYER_23D9 + +.channel CHAN_25C6 +/* 0x25C6 [0x88 0x25 0xCA ] */ ldlayer 0, LAYER_25CA +/* 0x25C9 [0xFF ] */ end + +.layer LAYER_25CA +/* 0x25CA [0xC6 0x3F ] */ instr SF0_INST_63 +/* 0x25CC [0xC2 0x30 ] */ transpose 48 +/* 0x25CE [0xCF 0xF5 ] */ releaserate 245 +/* 0x25D0 [0x57 0x0D 0x5A ] */ notedv PITCH_AF2, 13, 90 +/* 0x25D3 [0xFF ] */ end + +.channel CHAN_25D4 +/* 0x25D4 [0x88 0x25 0xEC ] */ ldlayer 0, LAYER_25EC +/* 0x25D7 [0x89 0x25 0xDB ] */ ldlayer 1, LAYER_25DB +/* 0x25DA [0xFF ] */ end + +.layer LAYER_25DB +/* 0x25DB [0xC6 0x48 ] */ instr SF0_INST_72 +/* 0x25DD [0xCB 0x66 0xF4 0xA0 ] */ env ENVELOPE_66F4, 160 +/* 0x25E1 [0xC4 ] */ legato +/* 0x25E2 [0xC7 0x85 0x1A 0xFF ] */ portamento 0x85, PITCH_B2, 255 +LAYER_25E6: +/* 0x25E6 [0x61 0x83 0xE8 0x50 ] */ notedv PITCH_GF3, FRAMERATE_CONST(1000, 1200), 80 +/* 0x25EA [0xF4 0xFA ] */ rjump LAYER_25E6 + +.layer LAYER_25EC +/* 0x25EC [0xC6 0x33 ] */ instr SF0_INST_51 +/* 0x25EE [0xCB 0x66 0xF4 0xA0 ] */ env ENVELOPE_66F4, 160 +/* 0x25F2 [0xC2 0x30 ] */ transpose 48 +/* 0x25F4 [0xC4 ] */ legato +/* 0x25F5 [0xC7 0x85 0x24 0xFF ] */ portamento 0x85, PITCH_A3, 255 +LAYER_25F9: +/* 0x25F9 [0x6C 0x83 0xE8 0x4B ] */ notedv PITCH_F4, FRAMERATE_CONST(1000, 1200), 75 +/* 0x25FD [0xF4 0xFA ] */ rjump LAYER_25F9 + +.channel CHAN_25FF +/* 0x25FF [0x88 0x26 0x08 ] */ ldlayer 0, LAYER_2608 +/* 0x2602 [0x89 0x26 0x06 ] */ ldlayer 1, LAYER_2606 +/* 0x2605 [0xFF ] */ end + +.layer LAYER_2606 +/* 0x2606 [0xC2 0x05 ] */ transpose 5 +.layer LAYER_2608 +/* 0x2608 [0xC6 0x47 ] */ instr SF0_INST_71 +/* 0x260A [0xCB 0x66 0xF4 0xD3 ] */ env ENVELOPE_66F4, 211 +/* 0x260E [0xC4 ] */ legato +/* 0x260F [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +LAYER_2613: +/* 0x2613 [0x6E 0x81 0xF4 0x50 ] */ notedv PITCH_G4, FRAMERATE_CONST(500, 600), 80 +/* 0x2617 [0xF4 0xFA ] */ rjump LAYER_2613 + +.channel CHAN_2619 +/* 0x2619 [0xC1 0x42 ] */ instr SF0_INST_66 +/* 0x261B [0xDC 0x40 ] */ panweight 64 +/* 0x261D [0x88 0x26 0x21 ] */ ldlayer 0, LAYER_2621 +/* 0x2620 [0xFF ] */ end + +.layer LAYER_2621 +/* 0x2621 [0xC7 0x83 0x0A 0xFF ] */ portamento 0x83, PITCH_G1, 255 +LAYER_2625: +/* 0x2625 [0x4F 0x20 0x60 ] */ notedv PITCH_C2, 32, 96 +/* 0x2628 [0xF4 0xFB ] */ rjump LAYER_2625 + +.channel CHAN_262A +/* 0x262A [0x88 0x26 0x38 ] */ ldlayer 0, LAYER_2638 +/* 0x262D [0x89 0x26 0x31 ] */ ldlayer 1, LAYER_2631 +/* 0x2630 [0xFF ] */ end + +.layer LAYER_2631 +/* 0x2631 [0xC6 0x42 ] */ instr SF0_INST_66 +/* 0x2633 [0x5F 0x18 0x41 ] */ notedv PITCH_E3, FRAMERATE_CONST(24, 28), 65 +/* 0x2636 [0xC2 0x12 ] */ transpose 18 +.layer LAYER_2638 +/* 0x2638 [0xC6 0x07 ] */ instr SF0_INST_7 +/* 0x263A [0xCB 0x66 0x88 0xFB ] */ env ENVELOPE_6688, 251 +/* 0x263E [0x5A 0x0E 0x5F ] */ notedv PITCH_B2, FRAMERATE_CONST(14, 16), 95 +/* 0x2641 [0x67 0x14 0x64 ] */ notedv PITCH_C4, FRAMERATE_CONST(20, 24), 100 +/* 0x2644 [0x59 0x11 0x66 ] */ notedv PITCH_BF2, FRAMERATE_CONST(17, 19), 102 +/* 0x2647 [0x65 0x50 0x67 ] */ notedv PITCH_BF3, FRAMERATE_CONST(80, 96), 103 +/* 0x264A [0xFF ] */ end + +.channel CHAN_264B +/* 0x264B [0xC1 0x30 ] */ instr SF0_INST_48 +/* 0x264D [0x88 0x26 0x51 ] */ ldlayer 0, LAYER_2651 +/* 0x2650 [0xFF ] */ end + +.layer LAYER_2651 +/* 0x2651 [0x67 0x27 0x6E ] */ notedv PITCH_C4, FRAMERATE_CONST(39, 47), 110 +/* 0x2654 [0xF4 0xFB ] */ rjump LAYER_2651 + +.channel CHAN_2656 +/* 0x2656 [0xC1 0x4D ] */ instr SF0_INST_77 +/* 0x2658 [0xED 0x14 ] */ gain 20 +/* 0x265A [0x88 0x26 0x5E ] */ ldlayer 0, LAYER_265E +/* 0x265D [0xFF ] */ end + +.layer LAYER_265E +/* 0x265E [0xC2 0x30 ] */ transpose 48 +/* 0x2660 [0xC4 ] */ legato +LAYER_2661: +/* 0x2661 [0x5F 0xFD 0x00 0x64 ] */ notedv PITCH_E3, 32000, 100 +/* 0x2665 [0xF4 0xFA ] */ rjump LAYER_2661 + +.channel CHAN_2667 +/* 0x2667 [0x88 0x26 0x71 ] */ ldlayer 0, LAYER_2671 +/* 0x266A [0x89 0x26 0x77 ] */ ldlayer 1, LAYER_2677 +/* 0x266D [0x8A 0x26 0x85 ] */ ldlayer 2, LAYER_2685 +/* 0x2670 [0xFF ] */ end + +.layer LAYER_2671 +/* 0x2671 [0xC6 0x4C ] */ instr SF0_INST_76 +/* 0x2673 [0x60 0x40 0x5F ] */ notedv PITCH_F3, 64, 95 +/* 0x2676 [0xFF ] */ end + +.layer LAYER_2677 +/* 0x2677 [0xC6 0x15 ] */ instr SF0_INST_21 +/* 0x2679 [0xCB 0x66 0xB0 0xFA ] */ env ENVELOPE_66B0, 250 +/* 0x267D [0xC7 0x81 0x1F 0xC8 ] */ portamento 0x81, PITCH_E3, 200 +/* 0x2681 [0x5B 0x3C 0x64 ] */ notedv PITCH_C3, 60, 100 +/* 0x2684 [0xFF ] */ end + +.layer LAYER_2685 +/* 0x2685 [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x2687 [0xC2 0x30 ] */ transpose 48 +/* 0x2689 [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x268D [0x55 0x34 0x60 ] */ notedv PITCH_GF2, 52, 96 +/* 0x2690 [0xFF ] */ end + +.channel CHAN_2691 +/* 0x2691 [0x88 0x26 0x9B ] */ ldlayer 0, LAYER_269B +/* 0x2694 [0x89 0x26 0xB3 ] */ ldlayer 1, LAYER_26B3 +/* 0x2697 [0x8A 0x26 0xC2 ] */ ldlayer 2, LAYER_26C2 +/* 0x269A [0xFF ] */ end + +.layer LAYER_269B +/* 0x269B [0xC6 0x40 ] */ instr SF0_INST_64 +/* 0x269D [0xCB 0x66 0x94 0xEB ] */ env ENVELOPE_6694, 235 +/* 0x26A1 [0xC7 0x83 0x27 0xFF ] */ portamento 0x83, PITCH_C4, 255 +/* 0x26A5 [0xF8 0x07 ] */ loop 7 +/* 0x26A7 [0x6E 0x40 0x40 ] */ notedv PITCH_G4, FRAMERATE_CONST(64, 77), 64 +/* 0x26AA [0xF7 ] */ loopend +/* 0x26AB [0xC7 0x81 0x29 0xFF ] */ portamento 0x81, PITCH_D4, 255 +/* 0x26AF [0x70 0x70 0x40 ] */ notedv PITCH_A4, 112, 64 +/* 0x26B2 [0xFF ] */ end + +.layer LAYER_26B3 +/* 0x26B3 [0xC2 0x10 ] */ transpose 16 +/* 0x26B5 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x26B7 [0xCB 0x66 0x94 0xEB ] */ env ENVELOPE_6694, 235 +/* 0x26BB [0xF8 0x07 ] */ loop 7 +/* 0x26BD [0x79 0x40 0x32 ] */ notedv PITCH_GF5, FRAMERATE_CONST(64, 77), 50 +/* 0x26C0 [0xF7 ] */ loopend +/* 0x26C1 [0xFF ] */ end + +.layer LAYER_26C2 +/* 0x26C2 [0xC0 0x81 0x09 ] */ ldelay 265 +/* 0x26C5 [0xC6 0x08 ] */ instr SF0_INST_8 +/* 0x26C7 [0xCB 0x67 0xCC 0xEB ] */ env ENVELOPE_67CC, 235 +/* 0x26CB [0x5D 0x7F 0x69 ] */ notedv PITCH_D3, 127, 105 +/* 0x26CE [0xFF ] */ end + +.channel CHAN_26CF +/* 0x26CF [0xED 0x14 ] */ gain 20 +/* 0x26D1 [0x88 0x26 0xD8 ] */ ldlayer 0, LAYER_26D8 +/* 0x26D4 [0x89 0x26 0xDE ] */ ldlayer 1, LAYER_26DE +/* 0x26D7 [0xFF ] */ end + +.layer LAYER_26D8 +/* 0x26D8 [0xC6 0x22 ] */ instr SF0_INST_34 +/* 0x26DA [0x6D 0x4C 0x32 ] */ notedv PITCH_GF4, FRAMERATE_CONST(76, 84), 50 +/* 0x26DD [0xFF ] */ end + +.layer LAYER_26DE +/* 0x26DE [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x26E0 [0x53 0x08 0x54 ] */ notedv PITCH_E2, 8, 84 +/* 0x26E3 [0xC6 0x1C ] */ instr SF0_INST_28 +/* 0x26E5 [0x68 0x14 0x69 ] */ notedv PITCH_DF4, 20, 105 +/* 0x26E8 [0xFF ] */ end + +.channel CHAN_26E9 +/* 0x26E9 [0x88 0x26 0xF0 ] */ ldlayer 0, LAYER_26F0 +/* 0x26EC [0x89 0x26 0xFA ] */ ldlayer 1, LAYER_26FA +/* 0x26EF [0xFF ] */ end + +.layer LAYER_26F0 +/* 0x26F0 [0xC6 0x1D ] */ instr SF0_INST_29 +/* 0x26F2 [0xC7 0x81 0x0C 0x40 ] */ portamento 0x81, PITCH_A1, 64 +/* 0x26F6 [0x59 0x7F 0x55 ] */ notedv PITCH_BF2, 127, 85 +/* 0x26F9 [0xFF ] */ end + +.layer LAYER_26FA +/* 0x26FA [0xC6 0x22 ] */ instr SF0_INST_34 +/* 0x26FC [0x5D 0x30 0x51 ] */ notedv PITCH_D3, 48, 81 +/* 0x26FF [0xFF ] */ end + +.channel CHAN_2700 +/* 0x2700 [0xC1 0x2E ] */ instr SF0_INST_46 +/* 0x2702 [0xDA 0x66 0xF4 ] */ env ENVELOPE_66F4 +/* 0x2705 [0xD9 0xDD ] */ releaserate 221 +/* 0x2707 [0x88 0x27 0x13 ] */ ldlayer 0, LAYER_2713 +/* 0x270A [0x89 0x27 0x11 ] */ ldlayer 1, LAYER_2711 +/* 0x270D [0x8A 0x27 0x1E ] */ ldlayer 2, LAYER_271E +/* 0x2710 [0xFF ] */ end + +.layer LAYER_2711 +/* 0x2711 [0xC2 0x04 ] */ transpose 4 +.layer LAYER_2713 +/* 0x2713 [0xC4 ] */ legato +/* 0x2714 [0xC7 0x81 0x2B 0xFF ] */ portamento 0x81, PITCH_E4, 255 +LAYER_2718: +/* 0x2718 [0x6C 0x81 0x90 0x30 ] */ notedv PITCH_F4, 400, 48 +/* 0x271C [0xF4 0xFA ] */ rjump LAYER_2718 + +.layer LAYER_271E +/* 0x271E [0xC2 0x30 ] */ transpose 48 +/* 0x2720 [0xCB 0x67 0xD8 0xDD ] */ env ENVELOPE_67D8, 221 +/* 0x2724 [0xC4 ] */ legato +/* 0x2725 [0xC7 0x81 0x32 0xFF ] */ portamento 0x81, PITCH_B4, 255 +LAYER_2729: +/* 0x2729 [0x73 0x81 0x90 0x40 ] */ notedv PITCH_C5, 400, 64 +/* 0x272D [0xF4 0xFA ] */ rjump LAYER_2729 + +.channel CHAN_272F +/* 0x272F [0xCC 0x81 ] */ ldi 129 +CHAN_2731: +/* 0x2731 [0xC7 0x00 0x27 0x46 ] */ stseq 0x00/* portamento mode */, LAYER_2745 + STSEQ_PORTAMENTO_MODE +/* 0x2735 [0xC1 0x40 ] */ instr SF0_INST_64 +/* 0x2737 [0xDA 0x66 0xFC ] */ env ENVELOPE_66FC +/* 0x273A [0xD9 0xDD ] */ releaserate 221 +/* 0x273C [0x88 0x27 0x43 ] */ ldlayer 0, LAYER_2743 +/* 0x273F [0x89 0x27 0x45 ] */ ldlayer 1, LAYER_2745 +/* 0x2742 [0xFF ] */ end + +.layer LAYER_2743 +/* 0x2743 [0xC2 0x18 ] */ transpose 24 +.layer LAYER_2745 +/* 0x2745 [0xC7 0x81 0x1F 0xFF ] */ portamento 0x81, PITCH_E3, 255 +/* 0x2749 [0x62 0x80 0xF0 0x50 ] */ notedv PITCH_G3, FRAMERATE_CONST(240, 264), 80 +/* 0x274D [0xFF ] */ end + +.channel CHAN_274E +/* 0x274E [0xCC 0x82 ] */ ldi 130 +/* 0x2750 [0xF4 0xDF ] */ rjump CHAN_2731 + +.channel CHAN_2752 +/* 0x2752 [0x88 0x27 0x56 ] */ ldlayer 0, LAYER_2756 +/* 0x2755 [0xFF ] */ end + +.layer LAYER_2756 +/* 0x2756 [0xC6 0x08 ] */ instr SF0_INST_8 +/* 0x2758 [0xCB 0x67 0xCC 0xF5 ] */ env ENVELOPE_67CC, 245 +/* 0x275C [0xC7 0x81 0x13 0x50 ] */ portamento 0x81, PITCH_E2, 80 +/* 0x2760 [0x63 0x6E 0x69 ] */ notedv PITCH_AF3, FRAMERATE_CONST(110, 132), 105 +/* 0x2763 [0xFF ] */ end + +.channel CHAN_2764 +/* 0x2764 [0xC1 0x36 ] */ instr SF0_INST_54 +/* 0x2766 [0xDA 0x66 0x74 ] */ env ENVELOPE_6674 +/* 0x2769 [0xDC 0x48 ] */ panweight 72 +/* 0x276B [0x88 0x27 0x6F ] */ ldlayer 0, LAYER_276F +/* 0x276E [0xFF ] */ end + +.layer LAYER_276F +/* 0x276F [0xC4 ] */ legato +LAYER_2770: +/* 0x2770 [0x60 0xFD 0x00 0x58 ] */ notedv PITCH_F3, 32000, 88 +/* 0x2774 [0xF4 0xFA ] */ rjump LAYER_2770 + +.channel CHAN_2776 +/* 0x2776 [0xC1 0x36 ] */ instr SF0_INST_54 +/* 0x2778 [0x88 0x27 0x81 ] */ ldlayer 0, LAYER_2781 +/* 0x277B [0x89 0x27 0x7F ] */ ldlayer 1, LAYER_277F +/* 0x277E [0xFF ] */ end + +.layer LAYER_277F +/* 0x277F [0xC2 0xFA ] */ transpose -6 +.layer LAYER_2781 +/* 0x2781 [0xC4 ] */ legato +/* 0x2782 [0xC7 0x01 0x0F 0x30 ] */ portamento 0x01, PITCH_C2, 48 +LAYER_2786: +/* 0x2786 [0x5F 0xFF 0xBC 0x4B ] */ notedv PITCH_E3, 32700, 75 +/* 0x278A [0xF4 0xFA ] */ rjump LAYER_2786 + +.channel CHAN_278C +/* 0x278C [0x88 0x27 0x90 ] */ ldlayer 0, LAYER_2790 +/* 0x278F [0xFF ] */ end + +.layer LAYER_2790 +/* 0x2790 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x2792 [0xCB 0x66 0x38 0xFB ] */ env ENVELOPE_6638, 251 +/* 0x2796 [0xC2 0x24 ] */ transpose 36 +/* 0x2798 [0x5D 0x0D 0x62 ] */ notedv PITCH_D3, FRAMERATE_CONST(13, 15), 98 +/* 0x279B [0x69 0x64 0x62 ] */ notedv PITCH_D4, FRAMERATE_CONST(100, 120), 98 +/* 0x279E [0xFF ] */ end + +.channel CHAN_279F +/* 0x279F [0xC1 0x42 ] */ instr SF0_INST_66 +/* 0x27A1 [0x88 0x27 0xA5 ] */ ldlayer 0, LAYER_27A5 +/* 0x27A4 [0xFF ] */ end + +.layer LAYER_27A5 +/* 0x27A5 [0xC4 ] */ legato +/* 0x27A6 [0xC2 0x30 ] */ transpose 48 +/* 0x27A8 [0x4F 0xFF 0xBC 0x64 ] */ notedv PITCH_C2, 32700, 100 +/* 0x27AC [0xF4 0xF7 ] */ rjump LAYER_27A5 + +.channel CHAN_27AE +/* 0x27AE [0xE5 0x01 ] */ reverbidx 1 +.channel CHAN_27B0 +/* 0x27B0 [0xCC 0x81 ] */ ldi 129 +CHAN_27B2: +/* 0x27B2 [0xC7 0x00 0x27 0xD4 ] */ stseq 0/* portamento mode */, LAYER_27D3 + STSEQ_PORTAMENTO_MODE +/* 0x27B6 [0xDC 0x40 ] */ panweight 64 +/* 0x27B8 [0x88 0x27 0xCC ] */ ldlayer 0, LAYER_27CC +/* 0x27BB [0x89 0x27 0xC8 ] */ ldlayer 1, LAYER_27C8 +/* 0x27BE [0x8A 0x27 0xC2 ] */ ldlayer 2, LAYER_27C2 +/* 0x27C1 [0xFF ] */ end + +.layer LAYER_27C2 +/* 0x27C2 [0xC2 0x08 ] */ transpose 8 +/* 0x27C4 [0xCA 0x68 ] */ notepan 104 +/* 0x27C6 [0xF4 0x04 ] */ rjump LAYER_27CC + +.layer LAYER_27C8 +/* 0x27C8 [0xC2 0x04 ] */ transpose 4 +/* 0x27CA [0xCA 0x18 ] */ notepan 24 +.layer LAYER_27CC +/* 0x27CC [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x27CE [0xCB 0x66 0xF4 0xE6 ] */ env ENVELOPE_66F4, 230 +/* 0x27D2 [0xC4 ] */ legato +LAYER_27D3: +/* 0x27D3 [0xC7 0x81 0x3A 0xFF ] */ portamento 0x81, PITCH_G5, 255 +LAYER_27D7: +/* 0x27D7 [0x7C 0x87 0xD0 0x4B ] */ notedv PITCH_A5, FRAMERATE_CONST(2000, 2400), 75 +/* 0x27DB [0xF4 0xFA ] */ rjump LAYER_27D7 + +.channel CHAN_27DD +/* 0x27DD [0x88 0x27 0xE4 ] */ ldlayer 0, LAYER_27E4 +/* 0x27E0 [0x89 0x27 0xE8 ] */ ldlayer 1, LAYER_27E8 +/* 0x27E3 [0xFF ] */ end + +.layer LAYER_27E4 +/* 0x27E4 [0xC2 0x24 ] */ transpose 36 +/* 0x27E6 [0xF4 0x02 ] */ rjump LAYER_27EA + +.layer LAYER_27E8 +/* 0x27E8 [0xC2 0x30 ] */ transpose 48 +LAYER_27EA: +/* 0x27EA [0xC6 0x46 ] */ instr SF0_INST_70 +/* 0x27EC [0x65 0x00 0x4B ] */ notedv PITCH_BF3, 0, 75 +/* 0x27EF [0xFF ] */ end + +.channel CHAN_27F0 +/* 0x27F0 [0x88 0x27 0xF7 ] */ ldlayer 0, LAYER_27F7 +/* 0x27F3 [0x89 0x09 0x98 ] */ ldlayer 1, LAYER_0998 +/* 0x27F6 [0xFF ] */ end + +.layer LAYER_27F7 +/* 0x27F7 [0xC2 0x30 ] */ transpose 48 +/* 0x27F9 [0xFB 0x09 0x92 ] */ jump LAYER_0992 + +.channel CHAN_27FC +/* 0x27FC [0xFC 0x28 0x23 ] */ call CHAN_2823 +/* 0x27FF [0x88 0x28 0x0A ] */ ldlayer 0, LAYER_280A +/* 0x2802 [0x89 0x28 0x16 ] */ ldlayer 1, LAYER_2816 +/* 0x2805 [0xD7 0x80 ] */ vibfreq 128 +/* 0x2807 [0xD8 0x10 ] */ vibdepth 16 +/* 0x2809 [0xFF ] */ end + +.layer LAYER_280A +/* 0x280A [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x280C [0xCB 0x66 0x74 0xF5 ] */ env ENVELOPE_6674, 245 +LAYER_2810: +/* 0x2810 [0x75 0xFD 0x00 0x3C ] */ notedv PITCH_D5, 32000, 60 +/* 0x2814 [0xF4 0xFA ] */ rjump LAYER_2810 + +.layer LAYER_2816 +/* 0x2816 [0xC6 0x3C ] */ instr SF0_INST_60 +/* 0x2818 [0xCB 0x66 0xF4 0xF5 ] */ env ENVELOPE_66F4, 245 +/* 0x281C [0xC4 ] */ legato +LAYER_281D: +/* 0x281D [0x68 0xFD 0x00 0x4B ] */ notedv PITCH_DF4, 32000, 75 +/* 0x2821 [0xF4 0xFA ] */ rjump LAYER_281D + +.channel CHAN_2823 +/* 0x2823 [0xED 0x0C ] */ gain 12 +/* 0x2825 [0xCC 0x19 ] */ ldi 25 +/* 0x2827 [0x71 ] */ stio IO_PORT_1 +/* 0x2828 [0xFF ] */ end + +.channel CHAN_2829 +/* 0x2829 [0xC1 0x2E ] */ instr SF0_INST_46 +/* 0x282B [0x88 0x28 0x32 ] */ ldlayer 0, LAYER_2832 +/* 0x282E [0x89 0x28 0x3C ] */ ldlayer 1, LAYER_283C +/* 0x2831 [0xFF ] */ end + +.layer LAYER_2832 +/* 0x2832 [0xCB 0x67 0xD8 0xE6 ] */ env ENVELOPE_67D8, 230 +LAYER_2836: +/* 0x2836 [0x6F 0xFD 0x00 0x32 ] */ notedv PITCH_AF4, 32000, 50 +/* 0x283A [0xF4 0xFA ] */ rjump LAYER_2836 + +.layer LAYER_283C +/* 0x283C [0xC2 0x30 ] */ transpose 48 +/* 0x283E [0xCB 0x67 0xD8 0xE6 ] */ env ENVELOPE_67D8, 230 +LAYER_2842: +/* 0x2842 [0x64 0xFD 0x00 0x20 ] */ notedv PITCH_A3, 32000, 32 +/* 0x2846 [0xF4 0xFA ] */ rjump LAYER_2842 + +.channel CHAN_2848 +/* 0x2848 [0x88 0x28 0x53 ] */ ldlayer 0, LAYER_2853 +/* 0x284B [0x89 0x28 0x4F ] */ ldlayer 1, LAYER_284F +/* 0x284E [0xFF ] */ end + +.layer LAYER_284F +/* 0x284F [0xC2 0x10 ] */ transpose 16 +/* 0x2851 [0xF4 0x02 ] */ rjump LAYER_2855 + +.layer LAYER_2853 +/* 0x2853 [0xC2 0x0C ] */ transpose 12 +LAYER_2855: +/* 0x2855 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x2857 [0xCB 0x66 0xF4 0xE6 ] */ env ENVELOPE_66F4, 230 +/* 0x285B [0xC4 ] */ legato +LAYER_285C: +/* 0x285C [0x78 0xFD 0x00 0x23 ] */ notedv PITCH_F5, 32000, 35 +/* 0x2860 [0xF4 0xFA ] */ rjump LAYER_285C + +.channel CHAN_2862 +/* 0x2862 [0xED 0x0F ] */ gain 15 +/* 0x2864 [0x88 0x28 0x6D ] */ ldlayer 0, LAYER_286D +/* 0x2867 [0x89 0x28 0x7C ] */ ldlayer 1, LAYER_287C +/* 0x286A [0xFF ] */ end + +.layer LAYER_286B +/* 0x286B [0xC2 0x04 ] */ transpose 4 +.layer LAYER_286D +/* 0x286D [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x286F [0xCB 0x66 0xFC 0xAA ] */ env ENVELOPE_66FC, 170 +/* 0x2873 [0xC7 0x81 0x20 0x91 ] */ portamento 0x81, PITCH_F3, 145 +/* 0x2877 [0x5D 0x82 0x44 0x69 ] */ notedv PITCH_D3, FRAMERATE_CONST(580, 696), 105 +/* 0x287B [0xFF ] */ end + +.layer LAYER_287C +/* 0x287C [0xC6 0x50 ] */ instr SF0_INST_80 +/* 0x287E [0xCB 0x66 0xFC 0xAA ] */ env ENVELOPE_66FC, 170 +/* 0x2882 [0xC7 0x81 0x05 0x91 ] */ portamento 0x81, PITCH_D1, 145 +/* 0x2886 [0x42 0x82 0x44 0x6E ] */ notedv PITCH_B0, FRAMERATE_CONST(580, 696), 110 +/* 0x288A [0xFF ] */ end + +.channel CHAN_288B +/* 0x288B [0xCC 0x81 ] */ ldi 129 +/* 0x288D [0xC7 0x00 0x28 0xAB ] */ stseq 0/* portamento mode */, LAYER_28AA + STSEQ_PORTAMENTO_MODE +CHAN_2891: +/* 0x2891 [0x88 0x28 0xA3 ] */ ldlayer 0, LAYER_28A3 +/* 0x2894 [0x89 0x28 0x9C ] */ ldlayer 1, LAYER_289C +/* 0x2897 [0xD7 0x6F ] */ vibfreq 111 +/* 0x2899 [0xD8 0x0A ] */ vibdepth 10 +/* 0x289B [0xFF ] */ end + +.layer LAYER_289C +/* 0x289C [0xC2 0xF4 ] */ transpose -12 +/* 0x289E [0xC6 0x34 ] */ instr SF0_INST_52 +/* 0x28A0 [0xFB 0x28 0xA5 ] */ jump LAYER_28A5 + +.layer LAYER_28A3 +/* 0x28A3 [0xC6 0x4A ] */ instr SF0_INST_74 +LAYER_28A5: +/* 0x28A5 [0xCB 0x66 0x7C 0xE7 ] */ env ENVELOPE_667C, 231 +/* 0x28A9 [0xC4 ] */ legato +LAYER_28AA: +/* 0x28AA [0xC7 0x81 0x0C 0x19 ] */ portamento 0x81, PITCH_A1, 25 +LAYER_28AE: +/* 0x28AE [0x5D 0x8C 0xB2 0x4A ] */ notedv PITCH_D3, 3250, 74 +/* 0x28B2 [0xF4 0xFA ] */ rjump LAYER_28AE + +.channel CHAN_28B4 +/* 0x28B4 [0xCC 0x82 ] */ ldi 130 +/* 0x28B6 [0xC7 0x00 0x28 0xAB ] */ stseq 0/* portamento mode */, LAYER_28AA + STSEQ_PORTAMENTO_MODE +/* 0x28BA [0xF4 0xD5 ] */ rjump CHAN_2891 + +.channel CHAN_28BC +/* 0x28BC [0xCC 0x81 ] */ ldi 129 +CHAN_28BE: +/* 0x28BE [0xC7 0x00 0x28 0xD3 ] */ stseq 0/* portamento mode */, LAYER_28D2 + STSEQ_PORTAMENTO_MODE +/* 0x28C2 [0xC1 0x08 ] */ instr SF0_INST_8 +/* 0x28C4 [0xDA 0x66 0x88 ] */ env ENVELOPE_6688 +/* 0x28C7 [0x88 0x28 0xD2 ] */ ldlayer 0, LAYER_28D2 +/* 0x28CA [0x89 0x28 0xD0 ] */ ldlayer 1, LAYER_28D0 +/* 0x28CD [0xFD 0x14 ] */ delay 20 +/* 0x28CF [0xFF ] */ end + +.layer LAYER_28D0 +/* 0x28D0 [0xC6 0x04 ] */ instr SF0_INST_4 +.layer LAYER_28D2 +/* 0x28D2 [0xC7 0x81 0x11 0xFF ] */ portamento 0x81, PITCH_D2, 255 +/* 0x28D6 [0xCF 0xFB ] */ releaserate 251 +/* 0x28D8 [0x45 0x14 0x50 ] */ notedv PITCH_D1, 20, 80 +/* 0x28DB [0xFF ] */ end + +.channel CHAN_28DC +/* 0x28DC [0xCC 0x82 ] */ ldi 130 +/* 0x28DE [0xF4 0xDE ] */ rjump CHAN_28BE + +.channel CHAN_28E0 +/* 0x28E0 [0x88 0x1B 0x2E ] */ ldlayer 0, LAYER_1B2E +/* 0x28E3 [0x89 0x1F 0x1A ] */ ldlayer 1, LAYER_1F1A +/* 0x28E6 [0xFF ] */ end + +.channel CHAN_28E7 +/* 0x28E7 [0xC1 0x44 ] */ instr SF0_INST_68 +/* 0x28E9 [0x88 0x29 0x13 ] */ ldlayer 0, LAYER_2913 +/* 0x28EC [0x89 0x29 0x00 ] */ ldlayer 1, LAYER_2900 +/* 0x28EF [0x8A 0x29 0x22 ] */ ldlayer 2, LAYER_2922 +/* 0x28F2 [0xD7 0x80 ] */ vibfreq 128 +/* 0x28F4 [0xE2 0x20 0x00 0x37 ] */ vibdepthgrad 32, 0, FRAMERATE_CONST(55, 66) +/* 0x28F8 [0xCC 0x01 ] */ ldi 1 +/* 0x28FA [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x28FD [0xD8 0x00 ] */ vibdepth 0 +/* 0x28FF [0xFF ] */ end + +.layer LAYER_2900 +/* 0x2900 [0xC6 0x40 ] */ instr SF0_INST_64 +/* 0x2902 [0xCB 0x67 0xE4 0xC8 ] */ env ENVELOPE_67E4, 200 +/* 0x2906 [0xC7 0x81 0x26 0xB4 ] */ portamento 0x81, PITCH_B3, 180 +/* 0x290A [0x67 0x83 0x84 0x20 ] */ notedv PITCH_C4, FRAMERATE_CONST(900, 1080), 32 +/* 0x290E [0xFF ] */ end + +.layer LAYER_290F +/* 0x290F [0xC2 0x1B ] */ transpose 27 +/* 0x2911 [0xF4 0x02 ] */ rjump LAYER_2915 + +.layer LAYER_2913 +/* 0x2913 [0xC2 0x0F ] */ transpose 15 +LAYER_2915: +/* 0x2915 [0xCB 0x67 0xE4 0xC8 ] */ env ENVELOPE_67E4, 200 +/* 0x2919 [0xC7 0x81 0x32 0xB4 ] */ portamento 0x81, PITCH_B4, 180 +/* 0x291D [0x73 0x83 0x84 0x50 ] */ notedv PITCH_C5, FRAMERATE_CONST(900, 1080), 80 +/* 0x2921 [0xFF ] */ end + +.layer LAYER_2922 +/* 0x2922 [0xCF 0xC8 ] */ releaserate 200 +/* 0x2924 [0x5B 0x82 0x58 0x40 ] */ notedv PITCH_C3, FRAMERATE_CONST(600, 720), 64 +/* 0x2928 [0xC2 0x1B ] */ transpose 27 +/* 0x292A [0xCB 0x66 0xF4 0xDD ] */ env ENVELOPE_66F4, 221 +/* 0x292E [0x73 0x81 0x2C 0x46 ] */ notedv PITCH_C5, FRAMERATE_CONST(300, 360), 70 +/* 0x2932 [0xFF ] */ end + +.channel CHAN_2933 +/* 0x2933 [0x88 0x29 0x37 ] */ ldlayer 0, LAYER_2937 +/* 0x2936 [0xFF ] */ end + +.layer LAYER_2937 +/* 0x2937 [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x2939 [0xCB 0x68 0x08 0xF0 ] */ env ENVELOPE_6808, 240 +/* 0x293D [0xC2 0x30 ] */ transpose 48 +/* 0x293F [0xC4 ] */ legato +/* 0x2940 [0xC7 0x85 0x2E 0xFF ] */ portamento 0x85, PITCH_G4, 255 +/* 0x2944 [0x6D 0x50 0x50 ] */ notedv PITCH_GF4, FRAMERATE_CONST(80, 96), 80 +/* 0x2947 [0x67 0x80 0xD2 0x50 ] */ notedv PITCH_C4, FRAMERATE_CONST(210, 252), 80 +LAYER_294B: +/* 0x294B [0x67 0x81 0x13 0x50 ] */ notedv PITCH_C4, FRAMERATE_CONST(275, 330), 80 +/* 0x294F [0xF4 0xFA ] */ rjump LAYER_294B + +.channel CHAN_2951 +/* 0x2951 [0x88 0x29 0x58 ] */ ldlayer 0, LAYER_2958 +/* 0x2954 [0x89 0x05 0x4B ] */ ldlayer 1, LAYER_054B +/* 0x2957 [0xFF ] */ end + +.layer LAYER_2958 +/* 0x2958 [0xC6 0x15 ] */ instr SF0_INST_21 +/* 0x295A [0xCB 0x66 0xB0 0xFA ] */ env ENVELOPE_66B0, 250 +/* 0x295E [0xC7 0x83 0x26 0xC8 ] */ portamento 0x83, PITCH_B3, 200 +/* 0x2962 [0x57 0x03 0x5F ] */ notedv PITCH_AF2, 3, 95 +/* 0x2965 [0x19 0x09 0x5F 0x64 ] */ notedvg PITCH_BF2, 9, 95, 100 +/* 0x2969 [0xFF ] */ end + +.channel CHAN_296A +/* 0x296A [0x88 0x29 0x6E ] */ ldlayer 0, LAYER_296E +/* 0x296D [0xFF ] */ end + +.layer LAYER_296E +/* 0x296E [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x2970 [0xCB 0x68 0x00 0xF0 ] */ env ENVELOPE_6800, 240 +/* 0x2974 [0xC2 0x30 ] */ transpose 48 +/* 0x2976 [0xC4 ] */ legato +/* 0x2977 [0xC7 0x85 0x20 0xFF ] */ portamento 0x85, PITCH_F3, 255 +/* 0x297B [0x60 0x50 0x50 ] */ notedv PITCH_F3, FRAMERATE_CONST(80, 96), 80 +/* 0x297E [0x6E 0x50 0x50 ] */ notedv PITCH_G4, FRAMERATE_CONST(80, 96), 80 +/* 0x2981 [0x6E 0x82 0x08 0x50 ] */ notedv PITCH_G4, FRAMERATE_CONST(520, 672), 80 +/* 0x2985 [0x67 0x80 0xD2 0x50 ] */ notedv PITCH_C4, FRAMERATE_CONST(210, 252), 80 +LAYER_2989: +/* 0x2989 [0x60 0x64 0x50 ] */ notedv PITCH_F3, FRAMERATE_CONST(100, 120), 80 +/* 0x298C [0xF4 0xFB ] */ rjump LAYER_2989 + +.channel CHAN_298E +/* 0x298E [0x88 0x29 0x9C ] */ ldlayer 0, LAYER_299C +/* 0x2991 [0x89 0x29 0x98 ] */ ldlayer 1, LAYER_2998 +/* 0x2994 [0x8A 0x29 0xAD ] */ ldlayer 2, LAYER_29AD +/* 0x2997 [0xFF ] */ end + +.layer LAYER_2998 +/* 0x2998 [0xCD 0x14 ] */ stereo 1, 0, 1, 0, 0 +.layer LAYER_299A +/* 0x299A [0xC2 0xFA ] */ transpose -6 +.layer LAYER_299C +/* 0x299C [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x299E [0xCB 0x66 0xFC 0xD3 ] */ env ENVELOPE_66FC, 211 +/* 0x29A2 [0xC4 ] */ legato +/* 0x29A3 [0xC7 0x81 0x2E 0xFF ] */ portamento 0x81, PITCH_G4, 255 +LAYER_29A7: +/* 0x29A7 [0x70 0x80 0xC8 0x4D ] */ notedv PITCH_A4, 200, 77 +/* 0x29AB [0xF4 0xFA ] */ rjump LAYER_29A7 + +.layer LAYER_29AD +/* 0x29AD [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_29AF +/* 0x29AF [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x29B1 [0xCB 0x66 0xFC 0xDD ] */ env ENVELOPE_66FC, 221 +/* 0x29B5 [0x58 0x80 0xCF 0x48 ] */ notedv PITCH_A2, 207, 72 +LAYER_29B9: +/* 0x29B9 [0x60 0x6F 0x50 ] */ notedv PITCH_F3, 111, 80 +/* 0x29BC [0x5B 0x80 0xA8 0x54 ] */ notedv PITCH_C3, 168, 84 +/* 0x29C0 [0x5D 0x61 0x44 ] */ notedv PITCH_D3, 97, 68 +/* 0x29C3 [0xF4 0xF4 ] */ rjump LAYER_29B9 + +.channel CHAN_29C5 +/* 0x29C5 [0xCC 0x28 ] */ ldi 40 +/* 0x29C7 [0x71 ] */ stio IO_PORT_1 +/* 0x29C8 [0x88 0x29 0xE3 ] */ ldlayer 0, LAYER_29E3 +/* 0x29CB [0x89 0x29 0xD2 ] */ ldlayer 1, LAYER_29D2 +/* 0x29CE [0x8A 0x29 0xD4 ] */ ldlayer 2, LAYER_29D4 +/* 0x29D1 [0xFF ] */ end + +.layer LAYER_29D2 +/* 0x29D2 [0xC2 0xFC ] */ transpose -4 +.layer LAYER_29D4 +/* 0x29D4 [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x29D6 [0xCB 0x66 0xF4 0xF1 ] */ env ENVELOPE_66F4, 241 +/* 0x29DA [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x29DE [0x5E 0x80 0xC6 0x5A ] */ notedv PITCH_EF3, FRAMERATE_CONST(198, 196), 90 +/* 0x29E2 [0xFF ] */ end + +.layer LAYER_29E3 +/* 0x29E3 [0xC0 0x80 0xBC ] */ ldelay FRAMERATE_CONST(188, 202) +/* 0x29E6 [0xC6 0x08 ] */ instr SF0_INST_8 +/* 0x29E8 [0xC7 0x81 0x03 0x20 ] */ portamento 0x81, PITCH_C1, 32 +/* 0x29EC [0x4F 0x40 0x69 ] */ notedv PITCH_C2, FRAMERATE_CONST(64, 77), 105 +/* 0x29EF [0xFF ] */ end + +.channel CHAN_29F0 +/* 0x29F0 [0xC1 0x44 ] */ instr SF0_INST_68 +/* 0x29F2 [0x88 0x29 0xFC ] */ ldlayer 0, LAYER_29FC +/* 0x29F5 [0x89 0x21 0x24 ] */ ldlayer 1, LAYER_2124 +/* 0x29F8 [0x8A 0x2A 0x01 ] */ ldlayer 2, LAYER_2A01 +/* 0x29FB [0xFF ] */ end + +.layer LAYER_29FC +/* 0x29FC [0xC2 0x1E ] */ transpose 30 +/* 0x29FE [0xFB 0x21 0x32 ] */ jump LAYER_2132 + +.layer LAYER_2A01 +/* 0x2A01 [0xC2 0x33 ] */ transpose 51 +/* 0x2A03 [0xFB 0x21 0x49 ] */ jump LAYER_2149 + +LAYER_2A06: +/* 0x2A06 [0xC6 0x2C ] */ instr SF0_INST_44 +/* 0x2A08 [0xCF 0xDD ] */ releaserate 221 +/* 0x2A0A [0xC7 0x84 0x16 0x7F ] */ portamento 0x84, PITCH_G2, 127 +/* 0x2A0E [0x70 0x60 0x55 ] */ notedv PITCH_A4, 96, 85 +/* 0x2A11 [0x72 0x7F 0x5F ] */ notedv PITCH_B4, 127, 95 +/* 0x2A14 [0xFF ] */ end + +.channel CHAN_2A15 +/* 0x2A15 [0xC1 0x2E ] */ instr SF0_INST_46 +/* 0x2A17 [0x88 0x2A 0x27 ] */ ldlayer 0, LAYER_2A27 +/* 0x2A1A [0x89 0x2A 0x36 ] */ ldlayer 1, LAYER_2A36 +/* 0x2A1D [0x8A 0x2A 0x3F ] */ ldlayer 2, LAYER_2A3F +/* 0x2A20 [0xD8 0x28 ] */ vibdepth 40 +/* 0x2A22 [0xE1 0x94 0xF0 0x64 ] */ vibfreqgrad 148, 240, 100 +/* 0x2A26 [0xFF ] */ end + +.layer LAYER_2A27 +/* 0x2A27 [0xC6 0x4A ] */ instr SF0_INST_74 +/* 0x2A29 [0xCB 0x66 0xF4 0xDD ] */ env ENVELOPE_66F4, 221 +/* 0x2A2D [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x2A31 [0x7E 0x82 0xE4 0x5F ] */ notedv PITCH_B5, FRAMERATE_CONST(740, 925), 95 +/* 0x2A35 [0xFF ] */ end + +.layer LAYER_2A36 +/* 0x2A36 [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +/* 0x2A3A [0x72 0x82 0xE4 0x41 ] */ notedv PITCH_B4, FRAMERATE_CONST(740, 925), 65 +/* 0x2A3E [0xFF ] */ end + +.layer LAYER_2A3F +/* 0x2A3F [0xC2 0x30 ] */ transpose 48 +/* 0x2A41 [0xCF 0xB4 ] */ releaserate 180 +/* 0x2A43 [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +/* 0x2A47 [0x72 0x82 0x1C 0x3E ] */ notedv PITCH_B4, FRAMERATE_CONST(540, 675), 62 +/* 0x2A4B [0xC2 0x00 ] */ transpose 0 +/* 0x2A4D [0xC6 0x0D ] */ instr SF0_INST_13 +/* 0x2A4F [0xCB 0x66 0xF4 0xDD ] */ env ENVELOPE_66F4, 221 +/* 0x2A53 [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x2A57 [0x7E 0x80 0xC8 0x55 ] */ notedv PITCH_B5, FRAMERATE_CONST(200, 250), 85 +/* 0x2A5B [0xFF ] */ end + +.channel CHAN_2A5C +/* 0x2A5C [0xCC 0x1E ] */ ldi 30 +/* 0x2A5E [0x71 ] */ stio IO_PORT_1 +/* 0x2A5F [0x88 0x2A 0x6D ] */ ldlayer 0, LAYER_2A6D +/* 0x2A62 [0x89 0x2A 0x7B ] */ ldlayer 1, LAYER_2A7B +/* 0x2A65 [0x8A 0x2A 0x8A ] */ ldlayer 2, LAYER_2A8A +/* 0x2A68 [0xD7 0xFB ] */ vibfreq 251 +/* 0x2A6A [0xD8 0x06 ] */ vibdepth 6 +/* 0x2A6C [0xFF ] */ end + +.layer LAYER_2A6D +/* 0x2A6D [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x2A6F [0xC2 0x18 ] */ transpose 24 +/* 0x2A71 [0xCB 0x66 0xF4 0xE6 ] */ env ENVELOPE_66F4, 230 +LAYER_2A75: +/* 0x2A75 [0x70 0xFD 0x00 0x40 ] */ notedv PITCH_A4, 32000, 64 +/* 0x2A79 [0xF4 0xFA ] */ rjump LAYER_2A75 + +.layer LAYER_2A7B +/* 0x2A7B [0xC6 0x33 ] */ instr SF0_INST_51 +/* 0x2A7D [0xC2 0x30 ] */ transpose 48 +/* 0x2A7F [0xC4 ] */ legato +/* 0x2A80 [0xCB 0x66 0xF4 0xB4 ] */ env ENVELOPE_66F4, 180 +LAYER_2A84: +/* 0x2A84 [0x78 0xFD 0x00 0x28 ] */ notedv PITCH_F5, 32000, 40 +/* 0x2A88 [0xF4 0xFA ] */ rjump LAYER_2A84 + +.layer LAYER_2A8A +/* 0x2A8A [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x2A8C [0xCB 0x66 0xF4 0xB4 ] */ env ENVELOPE_66F4, 180 +/* 0x2A90 [0xC4 ] */ legato +LAYER_2A91: +/* 0x2A91 [0x73 0xFD 0x00 0x40 ] */ notedv PITCH_C5, 32000, 64 +/* 0x2A95 [0xF4 0xFA ] */ rjump LAYER_2A91 + +.channel CHAN_2A97 +/* 0x2A97 [0xED 0x14 ] */ gain 20 +/* 0x2A99 [0x88 0x2A 0xA8 ] */ ldlayer 0, LAYER_2AA8 +/* 0x2A9C [0x89 0x2A 0xA0 ] */ ldlayer 1, LAYER_2AA0 +/* 0x2A9F [0xFF ] */ end + +.layer LAYER_2AA0 +/* 0x2AA0 [0xC6 0x04 ] */ instr SF0_INST_4 +/* 0x2AA2 [0x4A 0x1E 0x50 ] */ notedv PITCH_G1, 30, 80 +/* 0x2AA5 [0xFB 0x1B 0x35 ] */ jump LAYER_1B35 + +.layer LAYER_2AA8 +/* 0x2AA8 [0xC6 0x41 ] */ instr SF0_INST_65 +/* 0x2AAA [0xC7 0x81 0x20 0x7F ] */ portamento 0x81, PITCH_F3, 127 +/* 0x2AAE [0x64 0x64 0x6E ] */ notedv PITCH_A3, 100, 110 +/* 0x2AB1 [0xFF ] */ end + +.channel CHAN_2AB2 +/* 0x2AB2 [0xED 0x0A ] */ gain 10 +/* 0x2AB4 [0x88 0x1B 0x2E ] */ ldlayer 0, LAYER_1B2E +/* 0x2AB7 [0x89 0x2A 0xC6 ] */ ldlayer 1, LAYER_2AC6 +/* 0x2ABA [0x8A 0x2A 0xBE ] */ ldlayer 2, LAYER_2ABE +/* 0x2ABD [0xFF ] */ end + +.layer LAYER_2ABE +/* 0x2ABE [0xC6 0x04 ] */ instr SF0_INST_4 +/* 0x2AC0 [0x45 0x32 0x50 ] */ notedv PITCH_D1, 50, 80 +/* 0x2AC3 [0xFB 0x1B 0x35 ] */ jump LAYER_1B35 + +.layer LAYER_2AC6 +/* 0x2AC6 [0xC6 0x41 ] */ instr SF0_INST_65 +/* 0x2AC8 [0x5D 0x78 0x6E ] */ notedv PITCH_D3, 120, 110 +/* 0x2ACB [0xFF ] */ end + +.channel CHAN_2ACC +/* 0x2ACC [0x88 0x2A 0xD4 ] */ ldlayer 0, LAYER_2AD4 +/* 0x2ACF [0xD8 0x04 ] */ vibdepth 4 +/* 0x2AD1 [0xD7 0x3A ] */ vibfreq 58 +/* 0x2AD3 [0xFF ] */ end + +.layer LAYER_2AD4 +/* 0x2AD4 [0xC2 0x0C ] */ transpose 12 +/* 0x2AD6 [0xC6 0x82 ] */ instr FONTANY_INSTR_SINE +/* 0x2AD8 [0xCB 0x66 0xD0 0xF8 ] */ env ENVELOPE_66D0, 248 +/* 0x2ADC [0xC7 0x81 0x38 0xFF ] */ portamento 0x81, PITCH_F5, 255 +/* 0x2AE0 [0x60 0x7F 0x3C ] */ notedv PITCH_F3, 127, 60 +/* 0x2AE3 [0xFF ] */ end + +.channel CHAN_2AE4 +/* 0x2AE4 [0x88 0x03 0xE5 ] */ ldlayer 0, LAYER_03E5 +/* 0x2AE7 [0x89 0x07 0x47 ] */ ldlayer 1, LAYER_0747 +/* 0x2AEA [0xFF ] */ end + +.channel CHAN_2AEB +/* 0x2AEB [0x88 0x2B 0x01 ] */ ldlayer 0, LAYER_2B01 +/* 0x2AEE [0x89 0x2A 0xF2 ] */ ldlayer 1, LAYER_2AF2 +/* 0x2AF1 [0xFF ] */ end + +.layer LAYER_2AF2 +/* 0x2AF2 [0xC6 0x0C ] */ instr SF0_INST_12 +/* 0x2AF4 [0xCB 0x66 0xFC 0xE1 ] */ env ENVELOPE_66FC, 225 +/* 0x2AF8 [0xC7 0x81 0x3E 0xFF ] */ portamento 0x81, PITCH_B5, 255 +/* 0x2AFC [0x73 0x80 0xAA 0x60 ] */ notedv PITCH_C5, FRAMERATE_CONST(170, 204), 96 +/* 0x2B00 [0xFF ] */ end + +.layer LAYER_2B01 +/* 0x2B01 [0xC6 0x23 ] */ instr SF0_INST_35 +/* 0x2B03 [0xCB 0x66 0xFC 0xE1 ] */ env ENVELOPE_66FC, 225 +/* 0x2B07 [0xC7 0x81 0x33 0xFF ] */ portamento 0x81, PITCH_C5, 255 +/* 0x2B0B [0x58 0x80 0xAA 0x60 ] */ notedv PITCH_A2, FRAMERATE_CONST(170, 204), 96 +/* 0x2B0F [0xFF ] */ end + +.channel CHAN_2B10 +/* 0x2B10 [0x88 0x2C 0x60 ] */ ldlayer 0, LAYER_2C60 +/* 0x2B13 [0xFF ] */ end + +.channel CHAN_2B14 +/* 0x2B14 [0xC1 0x36 ] */ instr SF0_INST_54 +/* 0x2B16 [0xDA 0x66 0x10 ] */ env ENVELOPE_6610 +/* 0x2B19 [0x88 0x2B 0x1D ] */ ldlayer 0, LAYER_2B1D +/* 0x2B1C [0xFF ] */ end + +.layer LAYER_2B1D +/* 0x2B1D [0x61 0x09 0x6E ] */ notedv PITCH_GF3, 9, 110 +/* 0x2B20 [0xF8 0x20 ] */ loop FRAMERATE_CONST(32, 38) +/* 0x2B22 [0x63 0x08 0x73 ] */ notedv PITCH_AF3, FRAMERATE_CONST(8, 9), 115 +/* 0x2B25 [0xF7 ] */ loopend +/* 0x2B26 [0x65 0x0B 0x73 ] */ notedv PITCH_BF3, FRAMERATE_CONST(11, 13), 115 +/* 0x2B29 [0xFF ] */ end + +.channel CHAN_2B2A +/* 0x2B2A [0x88 0x2B 0x31 ] */ ldlayer 0, LAYER_2B31 +/* 0x2B2D [0x89 0x2B 0x39 ] */ ldlayer 1, LAYER_2B39 +/* 0x2B30 [0xFF ] */ end + +.layer LAYER_2B31 +/* 0x2B31 [0xC6 0x40 ] */ instr SF0_INST_64 +/* 0x2B33 [0xCB 0x66 0xFC 0xC3 ] */ env ENVELOPE_66FC, 195 +/* 0x2B37 [0xF4 0x08 ] */ rjump LAYER_2B41 + +.layer LAYER_2B39 +/* 0x2B39 [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x2B3B [0xCB 0x66 0xFC 0xC3 ] */ env ENVELOPE_66FC, 195 +/* 0x2B3F [0xC2 0x30 ] */ transpose 48 +LAYER_2B41: +/* 0x2B41 [0xC7 0x81 0x2C 0xFF ] */ portamento 0x81, PITCH_F4, 255 +/* 0x2B45 [0x77 0x64 0x55 ] */ notedv PITCH_E5, FRAMERATE_CONST(100, 120), 85 +/* 0x2B48 [0xFF ] */ end + +.channel CHAN_2B49 +/* 0x2B49 [0xCC 0x81 ] */ ldi 129 +/* 0x2B4B [0xC7 0x00 0x2B 0x96 ] */ stseq 0x00/* portamento mode */, LAYER_2B95 + STSEQ_PORTAMENTO_MODE +/* 0x2B4F [0xC7 0x00 0x2B 0xA7 ] */ stseq 0x00/* portamento mode */, LAYER_2BA6 + STSEQ_PORTAMENTO_MODE +/* 0x2B53 [0x88 0x2B 0x5D ] */ ldlayer 0, LAYER_2B5D +/* 0x2B56 [0x89 0x2B 0x9F ] */ ldlayer 1, LAYER_2B9F +/* 0x2B59 [0x8A 0x2B 0x86 ] */ ldlayer 2, LAYER_2B86 +/* 0x2B5C [0xFF ] */ end + +.layer LAYER_2B5D +/* 0x2B5D [0xC0 0x81 0x72 ] */ ldelay FRAMERATE_CONST(370, 444) +/* 0x2B60 [0xFF ] */ end + +.channel CHAN_2B61 +/* 0x2B61 [0xCC 0x82 ] */ ldi 130 +/* 0x2B63 [0xC7 0x00 0x2B 0x96 ] */ stseq 0x00/* portamento mode */, LAYER_2B95 + STSEQ_PORTAMENTO_MODE +/* 0x2B67 [0xC7 0x00 0x2B 0xA7 ] */ stseq 0x00/* portamento mode */, LAYER_2BA6 + STSEQ_PORTAMENTO_MODE +/* 0x2B6B [0x88 0x2B 0x5D ] */ ldlayer 0, LAYER_2B5D +/* 0x2B6E [0x89 0x2B 0x9F ] */ ldlayer 1, LAYER_2B9F +/* 0x2B71 [0x8A 0x2B 0x86 ] */ ldlayer 2, LAYER_2B86 +/* 0x2B74 [0xFF ] */ end + +.channel CHAN_2B75 +/* 0x2B75 [0xCC 0x81 ] */ ldi 129 +/* 0x2B77 [0xC7 0x00 0x2B 0x96 ] */ stseq 0x00/* portamento mode */, LAYER_2B95 + STSEQ_PORTAMENTO_MODE +/* 0x2B7B [0xC7 0x00 0x2B 0xA7 ] */ stseq 0x00/* portamento mode */, LAYER_2BA6 + STSEQ_PORTAMENTO_MODE +/* 0x2B7F [0x88 0x2B 0x8C ] */ ldlayer 0, LAYER_2B8C +/* 0x2B82 [0x89 0x2B 0x9F ] */ ldlayer 1, LAYER_2B9F +/* 0x2B85 [0xFF ] */ end + +.layer LAYER_2B86 +/* 0x2B86 [0xC6 0x45 ] */ instr SF0_INST_69 +/* 0x2B88 [0xC2 0xF4 ] */ transpose -12 +/* 0x2B8A [0xF4 0x04 ] */ rjump LAYER_2B90 + +.layer LAYER_2B8C +/* 0x2B8C [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x2B8E [0xC2 0x30 ] */ transpose 48 +LAYER_2B90: +/* 0x2B90 [0xC4 ] */ legato +/* 0x2B91 [0xCB 0x67 0xD8 0xDD ] */ env ENVELOPE_67D8, 221 +LAYER_2B95: +/* 0x2B95 [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +LAYER_2B99: +/* 0x2B99 [0x73 0x81 0xF4 0x55 ] */ notedv PITCH_C5, 500, 85 +/* 0x2B9D [0xF4 0xFA ] */ rjump LAYER_2B99 + +.layer LAYER_2B9F +/* 0x2B9F [0xC6 0x45 ] */ instr SF0_INST_69 +/* 0x2BA1 [0xC4 ] */ legato +/* 0x2BA2 [0xCB 0x67 0xD8 0xDD ] */ env ENVELOPE_67D8, 221 +LAYER_2BA6: +/* 0x2BA6 [0xC7 0x81 0x33 0xFF ] */ portamento 0x81, PITCH_C5, 255 +LAYER_2BAA: +/* 0x2BAA [0x7E 0x81 0xF4 0x55 ] */ notedv PITCH_B5, 500, 85 +/* 0x2BAE [0xF4 0xFA ] */ rjump LAYER_2BAA + +.channel CHAN_2BB0 +/* 0x2BB0 [0xED 0x14 ] */ gain 20 +/* 0x2BB2 [0x88 0x2B 0xC7 ] */ ldlayer 0, LAYER_2BC7 +/* 0x2BB5 [0x89 0x2B 0xBC ] */ ldlayer 1, LAYER_2BBC +/* 0x2BB8 [0x8A 0x26 0xD8 ] */ ldlayer 2, LAYER_26D8 +/* 0x2BBB [0xFF ] */ end + +.layer LAYER_2BBC +/* 0x2BBC [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x2BBE [0x53 0x0F 0x54 ] */ notedv PITCH_E2, 15, 84 +/* 0x2BC1 [0xC6 0x22 ] */ instr SF0_INST_34 +/* 0x2BC3 [0x67 0x3D 0x42 ] */ notedv PITCH_C4, FRAMERATE_CONST(61, 73), 66 +/* 0x2BC6 [0xFF ] */ end + +.layer LAYER_2BC7 +/* 0x2BC7 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x2BC9 [0x47 0x08 0x54 ] */ notedv PITCH_E1, 8, 84 +/* 0x2BCC [0xC2 0x30 ] */ transpose 48 +/* 0x2BCE [0x52 0x00 0x50 ] */ notedv PITCH_EF2, 0, 80 +/* 0x2BD1 [0xFF ] */ end + +.channel CHAN_2BD2 +/* 0x2BD2 [0x88 0x2B 0xD9 ] */ ldlayer 0, LAYER_2BD9 +/* 0x2BD5 [0x89 0x1F 0x7B ] */ ldlayer 1, LAYER_1F7B +/* 0x2BD8 [0xFF ] */ end + +.layer LAYER_2BD9 +/* 0x2BD9 [0xC2 0xF4 ] */ transpose -12 +/* 0x2BDB [0xFB 0x1F 0x6E ] */ jump LAYER_1F6E + +.channel CHAN_2BDE +/* 0x2BDE [0x89 0x1F 0x1C ] */ ldlayer 1, LAYER_1F1C +.channel CHAN_2BE1 +/* 0x2BE1 [0x88 0x2B 0xE5 ] */ ldlayer 0, LAYER_2BE5 +/* 0x2BE4 [0xFF ] */ end + +.layer LAYER_2BE5 +/* 0x2BE5 [0xC6 0x3F ] */ instr SF0_INST_63 +/* 0x2BE7 [0x5B 0x04 0x64 ] */ notedv PITCH_C3, 4, 100 +/* 0x2BEA [0x56 0x08 0x64 ] */ notedv PITCH_G2, 8, 100 +/* 0x2BED [0xFF ] */ end + +.channel CHAN_2BEE +/* 0x2BEE [0x88 0x05 0x61 ] */ ldlayer 0, LAYER_0561 +/* 0x2BF1 [0x89 0x29 0x58 ] */ ldlayer 1, LAYER_2958 +/* 0x2BF4 [0xFF ] */ end + +.channel CHAN_2BF5 +/* 0x2BF5 [0xED 0x0F ] */ gain 15 +/* 0x2BF7 [0x88 0x28 0x6B ] */ ldlayer 0, LAYER_286B +/* 0x2BFA [0x89 0x24 0xA5 ] */ ldlayer 1, LAYER_24A5 +/* 0x2BFD [0xFF ] */ end + +.channel CHAN_2BFE +/* 0x2BFE [0xCC 0x19 ] */ ldi 25 +/* 0x2C00 [0x71 ] */ stio IO_PORT_1 +/* 0x2C01 [0x88 0x2C 0x05 ] */ ldlayer 0, LAYER_2C05 +/* 0x2C04 [0xFF ] */ end + +.layer LAYER_2C05 +/* 0x2C05 [0xC6 0x3D ] */ instr SF0_INST_61 +/* 0x2C07 [0xC2 0x30 ] */ transpose 48 +/* 0x2C09 [0x62 0x00 0x46 ] */ notedv PITCH_G3, 0, 70 +/* 0x2C0C [0xFF ] */ end + +.channel CHAN_2C0D +/* 0x2C0D [0x88 0x13 0x7D ] */ ldlayer 0, LAYER_137D +/* 0x2C10 [0x89 0x13 0x61 ] */ ldlayer 1, LAYER_1361 +/* 0x2C13 [0x8A 0x29 0x9C ] */ ldlayer 2, LAYER_299C +/* 0x2C16 [0xFB 0x13 0x5C ] */ jump CHAN_135C + +.channel CHAN_2C19 +/* 0x2C19 [0x88 0x2C 0x20 ] */ ldlayer 0, LAYER_2C20 +/* 0x2C1C [0x89 0x2C 0x2A ] */ ldlayer 1, LAYER_2C2A +/* 0x2C1F [0xFF ] */ end + +.layer LAYER_2C20 +/* 0x2C20 [0xC6 0x3A ] */ instr SF0_INST_58 +/* 0x2C22 [0xC2 0x30 ] */ transpose 48 +/* 0x2C24 [0xCF 0xF1 ] */ releaserate 241 +/* 0x2C26 [0x5B 0x2B 0x64 ] */ notedv PITCH_C3, 43, 100 +/* 0x2C29 [0xFF ] */ end + +.layer LAYER_2C2A +/* 0x2C2A [0xC6 0x83 ] */ instr FONTANY_INSTR_SQUARE +/* 0x2C2C [0xCB 0x65 0xD8 0xFB ] */ env ENVELOPE_65D8, 251 +/* 0x2C30 [0xC7 0x81 0x0F 0xFF ] */ portamento 0x81, PITCH_C2, 255 +/* 0x2C34 [0x73 0x28 0x2D ] */ notedv PITCH_C5, 40, 45 +/* 0x2C37 [0xFF ] */ end + +.channel CHAN_2C38 +/* 0x2C38 [0x88 0x2C 0x47 ] */ ldlayer 0, LAYER_2C47 +/* 0x2C3B [0x89 0x2C 0x3F ] */ ldlayer 1, LAYER_2C3F +/* 0x2C3E [0xFF ] */ end + +.layer LAYER_2C3F +/* 0x2C3F [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x2C41 [0xCB 0x66 0x7C 0xF0 ] */ env ENVELOPE_667C, 240 +/* 0x2C45 [0xF4 0x07 ] */ rjump LAYER_2C4E + +.layer LAYER_2C47 +/* 0x2C47 [0xC6 0x0F ] */ instr SF0_INST_15 +/* 0x2C49 [0xC4 ] */ legato +/* 0x2C4A [0xC7 0x81 0x20 0xFF ] */ portamento 0x81, PITCH_F3, 255 +LAYER_2C4E: +/* 0x2C4E [0x4F 0x81 0x90 0x69 ] */ notedv PITCH_C2, FRAMERATE_CONST(400, 480), 105 +/* 0x2C52 [0xF4 0xFA ] */ rjump LAYER_2C4E + +.channel CHAN_2C54 +/* 0x2C54 [0x89 0x2C 0x62 ] */ ldlayer 1, LAYER_2C62 +/* 0x2C57 [0xCC 0x58 ] */ ldi (NOTEDV_OPCODE | PITCH_A2) +/* 0x2C59 [0xC7 0x00 0x22 0x88 ] */ stseq 0, CHAN_2287 + STSEQ_STSEQ_IMM +/* 0x2C5D [0xFB 0x22 0x67 ] */ jump CHAN_2267 + +.layer LAYER_2C60 +/* 0x2C60 [0xC2 0x06 ] */ transpose 6 +.layer LAYER_2C62 +/* 0x2C62 [0xC6 0x12 ] */ instr SF0_INST_18 +/* 0x2C64 [0xCB 0x66 0x7C 0xE6 ] */ env ENVELOPE_667C, 230 +/* 0x2C68 [0xC4 ] */ legato +/* 0x2C69 [0xC7 0x85 0x03 0xFF ] */ portamento 0x85, PITCH_C1, 255 +LAYER_2C6D: +/* 0x2C6D [0x47 0x55 0x50 ] */ notedv PITCH_E1, 85, 80 +/* 0x2C70 [0x43 0x20 0x50 ] */ notedv PITCH_C1, 32, 80 +/* 0x2C73 [0xF4 0xF8 ] */ rjump LAYER_2C6D + +.channel CHAN_2C75 +/* 0x2C75 [0xC1 0x3F ] */ instr SF0_INST_63 +/* 0x2C77 [0x88 0x2C 0x7E ] */ ldlayer 0, LAYER_2C7E +/* 0x2C7A [0x89 0x13 0xEE ] */ ldlayer 1, LAYER_13EE +/* 0x2C7D [0xFF ] */ end + +.layer LAYER_2C7E +/* 0x2C7E [0x61 0x0D 0x64 ] */ notedv PITCH_GF3, 13, 100 +/* 0x2C81 [0x58 0x00 0x48 ] */ notedv PITCH_A2, 0, 72 +/* 0x2C84 [0xFF ] */ end + +.channel CHAN_2C85 +/* 0x2C85 [0xCC 0x50 ] */ ldi 80 +/* 0x2C87 [0x71 ] */ stio IO_PORT_1 +/* 0x2C88 [0x88 0x2C 0x91 ] */ ldlayer 0, LAYER_2C91 +/* 0x2C8B [0x89 0x2C 0x8F ] */ ldlayer 1, LAYER_2C8F +/* 0x2C8E [0xFF ] */ end + +.layer LAYER_2C8F +/* 0x2C8F [0xC2 0xFF ] */ transpose -1 +.layer LAYER_2C91 +/* 0x2C91 [0xC0 0x30 ] */ ldelay 48 +/* 0x2C93 [0xC6 0x47 ] */ instr SF0_INST_71 +/* 0x2C95 [0x61 0x40 0x69 ] */ notedv PITCH_GF3, 64, 105 +/* 0x2C98 [0xFF ] */ end + +.channel CHAN_2C99 +/* 0x2C99 [0x88 0x2C 0x9D ] */ ldlayer 0, LAYER_2C9D +/* 0x2C9C [0xFF ] */ end + +.layer LAYER_2C9D +/* 0x2C9D [0xC6 0x51 ] */ instr SF0_INST_81 +/* 0x2C9F [0xCF 0xF0 ] */ releaserate 240 +/* 0x2CA1 [0xC7 0x83 0x08 0xFF ] */ portamento 0x83, PITCH_F1, 255 +/* 0x2CA5 [0x0F 0x80 0xA8 0x55 0x05] */ notedvg PITCH_C2, FRAMERATE_CONST(168, 202), 85, 5 +/* 0x2CAA [0x43 0x80 0x96 0x55 ] */ notedv PITCH_C1, FRAMERATE_CONST(150, 180), 85 +/* 0x2CAE [0xFF ] */ end + +.channel CHAN_2CAF +/* 0x2CAF [0xED 0x0A ] */ gain 10 +/* 0x2CB1 [0x88 0x1F 0x6E ] */ ldlayer 0, LAYER_1F6E +/* 0x2CB4 [0x89 0x1F 0x7B ] */ ldlayer 1, LAYER_1F7B +/* 0x2CB7 [0x8A 0x2B 0x31 ] */ ldlayer 2, LAYER_2B31 +/* 0x2CBA [0xFF ] */ end + +.channel CHAN_2CBB +/* 0x2CBB [0x88 0x2C 0xC8 ] */ ldlayer 0, LAYER_2CC8 +/* 0x2CBE [0x89 0x2C 0xC2 ] */ ldlayer 1, LAYER_2CC2 +/* 0x2CC1 [0xFF ] */ end + +.layer LAYER_2CC2 +/* 0x2CC2 [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x2CC4 [0xC2 0x0F ] */ transpose 15 +/* 0x2CC6 [0xF4 0x02 ] */ rjump LAYER_2CCA + +.layer LAYER_2CC8 +/* 0x2CC8 [0xC6 0x37 ] */ instr SF0_INST_55 +LAYER_2CCA: +/* 0x2CCA [0xC4 ] */ legato +/* 0x2CCB [0xCF 0xEB ] */ releaserate 235 +/* 0x2CCD [0xC7 0x81 0x16 0xAF ] */ portamento 0x81, PITCH_G2, 175 +LAYER_2CD1: +/* 0x2CD1 [0x5B 0x60 0x5F ] */ notedv PITCH_C3, 96, 95 +/* 0x2CD4 [0xF4 0xFB ] */ rjump LAYER_2CD1 + +.channel CHAN_2CD6 +/* 0x2CD6 [0x88 0x2C 0xDF ] */ ldlayer 0, LAYER_2CDF +/* 0x2CD9 [0x89 0x2C 0xDD ] */ ldlayer 1, LAYER_2CDD +/* 0x2CDC [0xFF ] */ end + +.layer LAYER_2CDD +/* 0x2CDD [0xC2 0xE8 ] */ transpose -24 +.layer LAYER_2CDF +/* 0x2CDF [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x2CE1 [0xCB 0x66 0x74 0xFB ] */ env ENVELOPE_6674, 251 +/* 0x2CE5 [0xC4 ] */ legato +/* 0x2CE6 [0xC7 0x01 0x24 0x7F ] */ portamento 0x01, PITCH_A3, 127 +LAYER_2CEA: +/* 0x2CEA [0x78 0xFF 0xBC 0x5F ] */ notedv PITCH_F5, 32700, 95 +/* 0x2CEE [0xF4 0xFA ] */ rjump LAYER_2CEA + +.channel CHAN_2CF0 +/* 0x2CF0 [0xFC 0x1B 0xF9 ] */ call CHAN_1BF9 +/* 0x2CF3 [0xFB 0x27 0x8C ] */ jump CHAN_278C + +.channel CHAN_2CF6 +/* 0x2CF6 [0xDC 0x30 ] */ panweight 48 +/* 0x2CF8 [0x8A 0x23 0x57 ] */ ldlayer 2, LAYER_2357 +/* 0x2CFB [0xFB 0x2C 0x54 ] */ jump CHAN_2C54 + +.channel CHAN_2CFE +/* 0x2CFE [0xFC 0x28 0x29 ] */ call CHAN_2829 +CHAN_2D01: +/* 0x2D01 [0x89 0x29 0x37 ] */ ldlayer 1, LAYER_2937 +/* 0x2D04 [0xCC 0x64 ] */ ldi 100 +/* 0x2D06 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x2D09 [0x8A 0x29 0x37 ] */ ldlayer 2, LAYER_2937 +/* 0x2D0C [0xCC 0x64 ] */ ldi 100 +/* 0x2D0E [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x2D11 [0xF4 0xEE ] */ rjump CHAN_2D01 + +.channel CHAN_2D13 +/* 0x2D13 [0x89 0x2D 0x25 ] */ ldlayer 1, LAYER_2D25 +/* 0x2D16 [0x8A 0x2D 0x23 ] */ ldlayer 2, LAYER_2D23 +/* 0x2D19 [0xCC 0x66 ] */ ldi (NOTEDV_OPCODE | PITCH_B3) +/* 0x2D1B [0xC7 0x00 0x22 0x88 ] */ stseq 0, CHAN_2287 + STSEQ_STSEQ_IMM +/* 0x2D1F [0xFB 0x22 0x67 ] */ jump CHAN_2267 +/* 0x2D22 [0xFF ] */ end + +.layer LAYER_2D23 +/* 0x2D23 [0xC2 0xF7 ] */ transpose -9 +.layer LAYER_2D25 +/* 0x2D25 [0xC4 ] */ legato +/* 0x2D26 [0xC6 0x3C ] */ instr SF0_INST_60 +/* 0x2D28 [0xCB 0x68 0x18 0xF1 ] */ env ENVELOPE_6818, 241 +/* 0x2D2C [0xC7 0x01 0x2C 0x7F ] */ portamento 0x01, PITCH_F4, 127 +LAYER_2D30: +/* 0x2D30 [0x72 0xFF 0xBC 0x50 ] */ notedv PITCH_B4, 32700, 80 +/* 0x2D34 [0xF4 0xFA ] */ rjump LAYER_2D30 + +.channel CHAN_2D36 +/* 0x2D36 [0x88 0x2D 0x3A ] */ ldlayer 0, LAYER_2D3A +/* 0x2D39 [0xFF ] */ end + +.layer LAYER_2D3A +/* 0x2D3A [0xC2 0x0C ] */ transpose 12 +/* 0x2D3C [0xC4 ] */ legato +/* 0x2D3D [0xC6 0x3C ] */ instr SF0_INST_60 +/* 0x2D3F [0xCB 0x66 0x94 0xDD ] */ env ENVELOPE_6694, 221 +/* 0x2D43 [0xC7 0x85 0x30 0xFF ] */ portamento 0x85, PITCH_A4, 255 +/* 0x2D47 [0x69 0x24 0x69 ] */ notedv PITCH_D4, 36, 105 +/* 0x2D4A [0x7A 0x64 0x69 ] */ notedv PITCH_G5, 100, 105 +/* 0x2D4D [0xFF ] */ end + +.channel CHAN_2D4E +/* 0x2D4E [0x88 0x2D 0x55 ] */ ldlayer 0, LAYER_2D55 +/* 0x2D51 [0x89 0x05 0x99 ] */ ldlayer 1, LAYER_0599 +/* 0x2D54 [0xFF ] */ end + +.layer LAYER_2D55 +/* 0x2D55 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x2D57 [0xCB 0x66 0x88 0xE6 ] */ env ENVELOPE_6688, 230 +/* 0x2D5B [0xC7 0x81 0x0A 0xFF ] */ portamento 0x81, PITCH_G1, 255 +/* 0x2D5F [0x70 0x46 0x5F ] */ notedv PITCH_A4, FRAMERATE_CONST(70, 84), 95 +/* 0x2D62 [0xFF ] */ end + +.channel CHAN_2D63 +/* 0x2D63 [0x88 0x2D 0x6E ] */ ldlayer 0, LAYER_2D6E +/* 0x2D66 [0x89 0x2D 0x6A ] */ ldlayer 1, LAYER_2D6A +/* 0x2D69 [0xFF ] */ end + +.layer LAYER_2D6A +/* 0x2D6A [0xC2 0x1B ] */ transpose 27 +/* 0x2D6C [0xF4 0x02 ] */ rjump LAYER_2D70 + +.layer LAYER_2D6E +/* 0x2D6E [0xC2 0x24 ] */ transpose 36 +LAYER_2D70: +/* 0x2D70 [0xC4 ] */ legato +/* 0x2D71 [0xC6 0x0F ] */ instr SF0_INST_15 +/* 0x2D73 [0xCB 0x66 0x74 0xC8 ] */ env ENVELOPE_6674, 200 +/* 0x2D77 [0xC7 0x85 0x38 0xFF ] */ portamento 0x85, PITCH_F5, 255 +LAYER_2D7B: +/* 0x2D7B [0x7E 0x81 0xF4 0x3A ] */ notedv PITCH_B5, 500, 58 +/* 0x2D7F [0x77 0x81 0x5E 0x3A ] */ notedv PITCH_E5, 350, 58 +/* 0x2D83 [0xF4 0xF6 ] */ rjump LAYER_2D7B + +.channel CHAN_2D85 +/* 0x2D85 [0x88 0x25 0x5B ] */ ldlayer 0, LAYER_255B +/* 0x2D88 [0x89 0x2D 0x8F ] */ ldlayer 1, LAYER_2D8F +/* 0x2D8B [0x8A 0x27 0x90 ] */ ldlayer 2, LAYER_2790 +/* 0x2D8E [0xFF ] */ end + +.layer LAYER_2D8F +/* 0x2D8F [0xC6 0x40 ] */ instr SF0_INST_64 +/* 0x2D91 [0xCB 0x66 0xFC 0xC3 ] */ env ENVELOPE_66FC, 195 +/* 0x2D95 [0xC7 0x81 0x00 0xFF ] */ portamento 0x81, PITCH_A0, 255 +/* 0x2D99 [0x54 0x7F 0x55 ] */ notedv PITCH_F2, FRAMERATE_CONST(127, 152), 85 +/* 0x2D9C [0xFF ] */ end + +.channel CHAN_2D9D +/* 0x2D9D [0xED 0x14 ] */ gain 20 +/* 0x2D9F [0x88 0x1A 0x36 ] */ ldlayer 0, LAYER_1A36 +/* 0x2DA2 [0x89 0x1F 0x6E ] */ ldlayer 1, LAYER_1F6E +/* 0x2DA5 [0x8A 0x1F 0x7B ] */ ldlayer 2, LAYER_1F7B +/* 0x2DA8 [0xFF ] */ end + +.channel CHAN_2DA9 +/* 0x2DA9 [0x88 0x1A 0xCE ] */ ldlayer 0, LAYER_1ACE +/* 0x2DAC [0xFF ] */ end + +.channel CHAN_2DAD +/* 0x2DAD [0x88 0x2D 0xB1 ] */ ldlayer 0, LAYER_2DB1 +/* 0x2DB0 [0xFF ] */ end + +.layer LAYER_2DB1 +/* 0x2DB1 [0xC6 0x3E ] */ instr SF0_INST_62 +/* 0x2DB3 [0x72 0x09 0x64 ] */ notedv PITCH_B4, 9, 100 +/* 0x2DB6 [0xC6 0x13 ] */ instr SF0_INST_19 +/* 0x2DB8 [0xCB 0x66 0x4C 0xF0 ] */ env ENVELOPE_664C, 240 +/* 0x2DBC [0x70 0x06 0x5A ] */ notedv PITCH_A4, 6, 90 +/* 0x2DBF [0x72 0x22 0x50 ] */ notedv PITCH_B4, 34, 80 +/* 0x2DC2 [0xFF ] */ end + +.channel CHAN_2DC3 +/* 0x2DC3 [0xC1 0x4E ] */ instr SF0_INST_78 +/* 0x2DC5 [0x88 0x2D 0xC9 ] */ ldlayer 0, LAYER_2DC9 +/* 0x2DC8 [0xFF ] */ end + +.layer LAYER_2DC9 +/* 0x2DC9 [0xC7 0x81 0x1B 0x7F ] */ portamento 0x81, PITCH_C3, 127 +/* 0x2DCD [0x60 0x64 0x64 ] */ notedv PITCH_F3, FRAMERATE_CONST(100, 120), 100 +/* 0x2DD0 [0xFF ] */ end + +.channel CHAN_2DD1 +/* 0x2DD1 [0x88 0x03 0xCC ] */ ldlayer 0, LAYER_03CC +/* 0x2DD4 [0x89 0x05 0x99 ] */ ldlayer 1, LAYER_0599 +/* 0x2DD7 [0xFF ] */ end + +.channel CHAN_2DD8 +/* 0x2DD8 [0x88 0x2D 0xDC ] */ ldlayer 0, LAYER_2DDC +/* 0x2DDB [0xFF ] */ end + +.layer LAYER_2DDC +/* 0x2DDC [0xC6 0x48 ] */ instr SF0_INST_72 +/* 0x2DDE [0xCF 0xC8 ] */ releaserate 200 +/* 0x2DE0 [0x62 0x40 0x37 ] */ notedv PITCH_G3, 64, 55 +/* 0x2DE3 [0xFF ] */ end + +.channel CHAN_2DE4 +/* 0x2DE4 [0xC1 0x4F ] */ instr SF0_INST_79 +/* 0x2DE6 [0xDA 0x65 0xD8 ] */ env ENVELOPE_65D8 +/* 0x2DE9 [0x88 0x2D 0xF0 ] */ ldlayer 0, LAYER_2DF0 +/* 0x2DEC [0x89 0x2D 0xF6 ] */ ldlayer 1, LAYER_2DF6 +/* 0x2DEF [0xFF ] */ end + +.layer LAYER_2DF0 +/* 0x2DF0 [0xC2 0x30 ] */ transpose 48 +/* 0x2DF2 [0x67 0x48 0x5E ] */ notedv PITCH_C4, 72, 94 +/* 0x2DF5 [0xFF ] */ end + +.layer LAYER_2DF6 +/* 0x2DF6 [0xC2 0x30 ] */ transpose 48 +/* 0x2DF8 [0x72 0x48 0x70 ] */ notedv PITCH_B4, 72, 112 +/* 0x2DFB [0xFF ] */ end + +.channel CHAN_2DFC +/* 0x2DFC [0x88 0x2E 0x00 ] */ ldlayer 0, LAYER_2E00 +/* 0x2DFF [0xFF ] */ end + +.layer LAYER_2E00 +/* 0x2E00 [0xC6 0x85 ] */ instr FONTANY_INSTR_BELL +/* 0x2E02 [0xCB 0x66 0x10 0xFB ] */ env ENVELOPE_6610, 251 +/* 0x2E06 [0xC7 0x83 0x00 0xFF ] */ portamento 0x83, PITCH_A0, 255 +/* 0x2E0A [0x57 0x2C 0x3C ] */ notedv PITCH_AF2, 44, 60 +/* 0x2E0D [0x5D 0x2C 0x3C ] */ notedv PITCH_D3, 44, 60 +/* 0x2E10 [0x62 0x2C 0x3C ] */ notedv PITCH_G3, 44, 60 +/* 0x2E13 [0xFF ] */ end + +.channel CHAN_2E14 +/* 0x2E14 [0xDC 0x30 ] */ panweight 48 +/* 0x2E16 [0x88 0x23 0xC9 ] */ ldlayer 0, LAYER_23C9 +/* 0x2E19 [0x89 0x23 0xB7 ] */ ldlayer 1, LAYER_23B7 +/* 0x2E1C [0xFF ] */ end + +.channel CHAN_2E1D +/* 0x2E1D [0x88 0x2E 0x21 ] */ ldlayer 0, LAYER_2E21 +/* 0x2E20 [0xFF ] */ end + +.layer LAYER_2E21 +/* 0x2E21 [0xC6 0x36 ] */ instr SF0_INST_54 +/* 0x2E23 [0xC2 0x30 ] */ transpose 48 +/* 0x2E25 [0x5B 0x00 0x6E ] */ notedv PITCH_C3, 0, 110 +/* 0x2E28 [0xFF ] */ end + +.channel CHAN_2E29 +/* 0x2E29 [0xFC 0x1A 0x25 ] */ call CHAN_1A25 +/* 0x2E2C [0x8A 0x1A 0x30 ] */ ldlayer 2, LAYER_1A30 +/* 0x2E2F [0xFF ] */ end + +.channel CHAN_2E30 +/* 0x2E30 [0x88 0x1A 0x36 ] */ ldlayer 0, LAYER_1A36 +/* 0x2E33 [0x89 0x29 0x9A ] */ ldlayer 1, LAYER_299A +/* 0x2E36 [0xFF ] */ end + +.channel CHAN_2E37 +/* 0x2E37 [0x88 0x29 0xAD ] */ ldlayer 0, LAYER_29AD +/* 0x2E3A [0x89 0x29 0xAF ] */ ldlayer 1, LAYER_29AF +/* 0x2E3D [0xFF ] */ end + +.channel CHAN_2E3E +/* 0x2E3E [0x88 0x2E 0x45 ] */ ldlayer 0, LAYER_2E45 +/* 0x2E41 [0x89 0x26 0xFA ] */ ldlayer 1, LAYER_26FA +/* 0x2E44 [0xFF ] */ end + +.layer LAYER_2E45 +/* 0x2E45 [0xC6 0x1D ] */ instr SF0_INST_29 +/* 0x2E47 [0xC7 0x81 0x18 0x40 ] */ portamento 0x81, PITCH_A2, 64 +/* 0x2E4B [0x56 0x7F 0x55 ] */ notedv PITCH_G2, 127, 85 +/* 0x2E4E [0xFF ] */ end + +.channel CHAN_2E4F +/* 0x2E4F [0xC1 0x4F ] */ instr SF0_INST_79 +/* 0x2E51 [0x88 0x2E 0x55 ] */ ldlayer 0, LAYER_2E55 +/* 0x2E54 [0xFF ] */ end + +.layer LAYER_2E55 +/* 0x2E55 [0xC2 0x30 ] */ transpose 48 +/* 0x2E57 [0x64 0x0A 0x5E ] */ notedv PITCH_A3, 10, 94 +/* 0x2E5A [0xFF ] */ end + +.channel CHAN_2E5B +/* 0x2E5B [0xCC 0x82 ] */ ldi 130 +/* 0x2E5D [0xFB 0x27 0xB2 ] */ jump CHAN_27B2 + +.channel CHAN_2E60 +/* 0x2E60 [0xCC 0x20 ] */ ldi 32 +/* 0x2E62 [0x71 ] */ stio IO_PORT_1 +/* 0x2E63 [0x88 0x2E 0x67 ] */ ldlayer 0, LAYER_2E67 +/* 0x2E66 [0xFF ] */ end + +.layer LAYER_2E67 +/* 0x2E67 [0xC6 0x47 ] */ instr SF0_INST_71 +LAYER_2E69: +/* 0x2E69 [0x42 0x00 0x46 ] */ notedv PITCH_B0, 0, 70 +/* 0x2E6C [0xF4 0xFB ] */ rjump LAYER_2E69 + +.channel CHAN_2E6E +/* 0x2E6E [0xCC 0x20 ] */ ldi 32 +/* 0x2E70 [0x71 ] */ stio IO_PORT_1 +/* 0x2E71 [0x88 0x2E 0x75 ] */ ldlayer 0, LAYER_2E75 +/* 0x2E74 [0xFF ] */ end + +.layer LAYER_2E75 +/* 0x2E75 [0xC6 0x3C ] */ instr SF0_INST_60 +/* 0x2E77 [0xCB 0x67 0x10 0xFB ] */ env ENVELOPE_6710, 251 +/* 0x2E7B [0xC4 ] */ legato +/* 0x2E7C [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +LAYER_2E80: +/* 0x2E80 [0x5B 0x80 0xFA 0x6E ] */ notedv PITCH_C3, 250, 110 +/* 0x2E84 [0xF4 0xFA ] */ rjump LAYER_2E80 + +.channel CHAN_2E86 +/* 0x2E86 [0x88 0x2E 0x8A ] */ ldlayer 0, LAYER_2E8A +/* 0x2E89 [0xFF ] */ end + +.layer LAYER_2E8A +/* 0x2E8A [0xC6 0x51 ] */ instr SF0_INST_81 +/* 0x2E8C [0xC2 0x30 ] */ transpose 48 +/* 0x2E8E [0x67 0x00 0x64 ] */ notedv PITCH_C4, 0, 100 +/* 0x2E91 [0xFF ] */ end + +.channel CHAN_2E92 +/* 0x2E92 [0xC1 0x44 ] */ instr SF0_INST_68 +/* 0x2E94 [0xED 0x0F ] */ gain 15 +/* 0x2E96 [0x89 0x29 0x0F ] */ ldlayer 1, LAYER_290F +/* 0x2E99 [0x88 0x2E 0xA0 ] */ ldlayer 0, LAYER_2EA0 +/* 0x2E9C [0x8A 0x2E 0xAF ] */ ldlayer 2, LAYER_2EAF +/* 0x2E9F [0xFF ] */ end + +.layer LAYER_2EA0 +/* 0x2EA0 [0xC6 0x40 ] */ instr SF0_INST_64 +/* 0x2EA2 [0xCB 0x67 0xE4 0xC8 ] */ env ENVELOPE_67E4, 200 +/* 0x2EA6 [0xC7 0x81 0x32 0xB4 ] */ portamento 0x81, PITCH_B4, 180 +/* 0x2EAA [0x73 0x80 0xC8 0x6E ] */ notedv PITCH_C5, FRAMERATE_CONST(200, 240), 110 +/* 0x2EAE [0xFF ] */ end + +.layer LAYER_2EAF +/* 0x2EAF [0xCF 0xC8 ] */ releaserate 200 +/* 0x2EB1 [0x67 0x80 0xC8 0x73 ] */ notedv PITCH_C4, FRAMERATE_CONST(200, 240), 115 +/* 0x2EB5 [0xFF ] */ end + +.channel CHAN_2EB6 +/* 0x2EB6 [0xC1 0x7F ] */ instr FONTANY_INSTR_DRUM +/* 0x2EB8 [0xDC 0x00 ] */ panweight 0 +/* 0x2EBA [0x88 0x2E 0xC1 ] */ ldlayer 0, LAYER_2EC1 +/* 0x2EBD [0x89 0x2E 0xC8 ] */ ldlayer 1, LAYER_2EC8 +/* 0x2EC0 [0xFF ] */ end + +.layer LAYER_2EC1 +/* 0x2EC1 [0xC4 ] */ legato +LAYER_2EC2: +/* 0x2EC2 [0x43 0xFF 0xBC 0x50 ] */ notedv PITCH_C1, 32700, 80 +/* 0x2EC6 [0xF4 0xFA ] */ rjump LAYER_2EC2 + +.layer LAYER_2EC8 +/* 0x2EC8 [0xC4 ] */ legato +LAYER_2EC9: +/* 0x2EC9 [0x42 0xFF 0xBC 0x50 ] */ notedv PITCH_B0, 32700, 80 +/* 0x2ECD [0xF4 0xFA ] */ rjump LAYER_2EC9 + +.channel CHAN_2ECF +/* 0x2ECF [0x88 0x2E 0xD3 ] */ ldlayer 0, LAYER_2ED3 +/* 0x2ED2 [0xFF ] */ end + +.layer LAYER_2ED3 +/* 0x2ED3 [0xC6 0x36 ] */ instr SF0_INST_54 +/* 0x2ED5 [0xC2 0x30 ] */ transpose 48 +/* 0x2ED7 [0x69 0x00 0x6E ] */ notedv PITCH_D4, 0, 110 +/* 0x2EDA [0xFF ] */ end + +.channel CHAN_2EDB +/* 0x2EDB [0x88 0x2E 0xDF ] */ ldlayer 0, LAYER_2EDF +/* 0x2EDE [0xFF ] */ end + +.layer LAYER_2EDF +/* 0x2EDF [0xC6 0x36 ] */ instr SF0_INST_54 +/* 0x2EE1 [0xC2 0x30 ] */ transpose 48 +/* 0x2EE3 [0x62 0x00 0x6E ] */ notedv PITCH_G3, 0, 110 +/* 0x2EE6 [0xFF ] */ end + +.channel CHAN_2EE7 +/* 0x2EE7 [0x88 0x23 0xC5 ] */ ldlayer 0, LAYER_23C5 +/* 0x2EEA [0x89 0x23 0xAD ] */ ldlayer 1, LAYER_23AD +/* 0x2EED [0xFF ] */ end + +.channel CHAN_2EEE +/* 0x2EEE [0xED 0x0A ] */ gain 10 +/* 0x2EF0 [0x88 0x2E 0xFA ] */ ldlayer 0, LAYER_2EFA +/* 0x2EF3 [0x89 0x2F 0x0A ] */ ldlayer 1, LAYER_2F0A +/* 0x2EF6 [0x8A 0x1F 0x41 ] */ ldlayer 2, LAYER_1F41 +/* 0x2EF9 [0xFF ] */ end + +.layer LAYER_2EFA +/* 0x2EFA [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x2EFC [0xCF 0xDD ] */ releaserate 221 +/* 0x2EFE [0x67 0x0C 0x52 ] */ notedv PITCH_C4, 12, 82 +/* 0x2F01 [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +/* 0x2F05 [0x54 0x80 0x91 0x69 ] */ notedv PITCH_F2, 145, 105 +/* 0x2F09 [0xFF ] */ end + +.layer LAYER_2F0A +/* 0x2F0A [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x2F0C [0xCF 0xDD ] */ releaserate 221 +/* 0x2F0E [0x73 0x0C 0x52 ] */ notedv PITCH_C5, 12, 82 +/* 0x2F11 [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x2F15 [0x60 0x80 0x91 0x69 ] */ notedv PITCH_F3, 145, 105 +/* 0x2F19 [0xFF ] */ end + +.channel CHAN_2F1A +/* 0x2F1A [0xC1 0x49 ] */ instr SF0_INST_73 +/* 0x2F1C [0x88 0x2F 0x20 ] */ ldlayer 0, LAYER_2F20 +/* 0x2F1F [0xFF ] */ end + +.layer LAYER_2F20 +/* 0x2F20 [0xC2 0x30 ] */ transpose 48 +/* 0x2F22 [0x67 0x00 0x64 ] */ notedv PITCH_C4, 0, 100 +/* 0x2F25 [0xFF ] */ end + +.channel CHAN_2F26 +/* 0x2F26 [0x88 0x2F 0x2D ] */ ldlayer 0, LAYER_2F2D +/* 0x2F29 [0x89 0x2F 0x38 ] */ ldlayer 1, LAYER_2F38 +/* 0x2F2C [0xFF ] */ end + +.layer LAYER_2F2D +/* 0x2F2D [0xC6 0x36 ] */ instr SF0_INST_54 +/* 0x2F2F [0xC2 0x30 ] */ transpose 48 +/* 0x2F31 [0x7A 0x0D 0x42 ] */ notedv PITCH_G5, 13, 66 +/* 0x2F34 [0x75 0x1A 0x42 ] */ notedv PITCH_D5, 26, 66 +/* 0x2F37 [0xFF ] */ end + +.layer LAYER_2F38 +/* 0x2F38 [0xC6 0x46 ] */ instr SF0_INST_70 +/* 0x2F3A [0xC2 0x30 ] */ transpose 48 +/* 0x2F3C [0x64 0x00 0x44 ] */ notedv PITCH_A3, 0, 68 +/* 0x2F3F [0x67 0x00 0x44 ] */ notedv PITCH_C4, 0, 68 +/* 0x2F42 [0xFF ] */ end + +.channel CHAN_2F43 +/* 0x2F43 [0x8B 0x1E 0x0A ] */ ldlayer 3, LAYER_1E0A +/* 0x2F46 [0xFC 0x2D 0x9D ] */ call CHAN_2D9D +/* 0x2F49 [0xFF ] */ end + +.channel CHAN_2F4A +/* 0x2F4A [0x88 0x2F 0x4E ] */ ldlayer 0, LAYER_2F4E +/* 0x2F4D [0xFF ] */ end + +.layer LAYER_2F4E +/* 0x2F4E [0xC6 0x3A ] */ instr SF0_INST_58 +/* 0x2F50 [0xC2 0x30 ] */ transpose 48 +/* 0x2F52 [0x60 0x08 0x55 ] */ notedv PITCH_F3, 8, 85 +/* 0x2F55 [0x5D 0x08 0x55 ] */ notedv PITCH_D3, 8, 85 +/* 0x2F58 [0xC7 0x81 0x1B 0x7F ] */ portamento 0x81, PITCH_C3, 127 +/* 0x2F5C [0x64 0x18 0x55 ] */ notedv PITCH_A3, 24, 85 +/* 0x2F5F [0xFF ] */ end + +.channel CHAN_2F60 +/* 0x2F60 [0x88 0x2F 0x64 ] */ ldlayer 0, LAYER_2F64 +/* 0x2F63 [0xFF ] */ end + +.layer LAYER_2F64 +/* 0x2F64 [0xC6 0x3A ] */ instr SF0_INST_58 +/* 0x2F66 [0xC2 0x30 ] */ transpose 48 +/* 0x2F68 [0x60 0x08 0x55 ] */ notedv PITCH_F3, 8, 85 +/* 0x2F6B [0x64 0x08 0x55 ] */ notedv PITCH_A3, 8, 85 +/* 0x2F6E [0xC7 0x81 0x22 0x7F ] */ portamento 0x81, PITCH_G3, 127 +/* 0x2F72 [0x5B 0x18 0x55 ] */ notedv PITCH_C3, 24, 85 +/* 0x2F75 [0xFF ] */ end + +.channel CHAN_2F76 +/* 0x2F76 [0xC1 0x49 ] */ instr SF0_INST_73 +/* 0x2F78 [0xD9 0xB4 ] */ releaserate 180 +/* 0x2F7A [0xCC 0x14 ] */ ldi 20 +/* 0x2F7C [0x71 ] */ stio IO_PORT_1 +CHAN_2F7D: +/* 0x2F7D [0x88 0x2F 0xB2 ] */ ldlayer 0, LAYER_2FB2 +/* 0x2F80 [0xCC 0xFF ] */ ldi 255 +/* 0x2F82 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x2F85 [0xB8 0x02 ] */ rand 2 +/* 0x2F87 [0xC7 0x2F 0x2F 0xAC ] */ stseq 47, LAYER_2FAB + STSEQ_TRANSPOSITION +/* 0x2F8B [0xBD 0x00 0x6A 0x00 0x96] */ randptr 106, 150 +/* 0x2F90 [0xCF 0x2F 0xB6 ] */ stptrtoseq UNK_2FB6 +/* 0x2F93 [0xCC 0x01 ] */ ldi 1 +/* 0x2F95 [0xCB 0x2F 0xB6 ] */ ldseq UNK_2FB6 +/* 0x2F98 [0xC7 0x00 0x2F 0xA0 ] */ stseq 0, CHAN_2F9F + STSEQ_LDI_IMM +/* 0x2F9C [0x88 0x2F 0xAB ] */ ldlayer 0, LAYER_2FAB +CHAN_2F9F: +/* 0x2F9F [0xCC 0x01 ] */ ldi 1 +/* 0x2FA1 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x2FA4 [0xCC 0xFF ] */ ldi 255 +/* 0x2FA6 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x2FA9 [0xF4 0xD2 ] */ rjump CHAN_2F7D + +.layer LAYER_2FAB +/* 0x2FAB [0xC2 0x30 ] */ transpose 48 +/* 0x2FAD [0x67 0x80 0x93 0x3C ] */ notedv PITCH_C4, 147, 60 +/* 0x2FB1 [0xFF ] */ end + +.layer LAYER_2FB2 +/* 0x2FB2 [0xC0 0xFD 0x00 ] */ ldelay 32000 +/* 0x2FB5 [0xFF ] */ end + +UNK_2FB6: + .half 0x0000 + +.channel CHAN_2FB8 +/* 0x2FB8 [0x88 0x2F 0xBF ] */ ldlayer 0, LAYER_2FBF +/* 0x2FBB [0x89 0x2B 0xC7 ] */ ldlayer 1, LAYER_2BC7 +/* 0x2FBE [0xFF ] */ end + +.layer LAYER_2FBF +/* 0x2FBF [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x2FC1 [0x53 0x00 0x54 ] */ notedv PITCH_E2, 0, 84 +/* 0x2FC4 [0xFF ] */ end + +.channel CHAN_2FC5 +/* 0x2FC5 [0x88 0x2F 0xCC ] */ ldlayer 0, LAYER_2FCC +/* 0x2FC8 [0x89 0x2F 0xDC ] */ ldlayer 1, LAYER_2FDC +/* 0x2FCB [0xFF ] */ end + +.layer LAYER_2FCC +/* 0x2FCC [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x2FCE [0xC2 0x30 ] */ transpose 48 +/* 0x2FD0 [0xCB 0x66 0x38 0xFB ] */ env ENVELOPE_6638, 251 +/* 0x2FD4 [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x2FD8 [0x73 0x64 0x50 ] */ notedv PITCH_C5, 100, 80 +/* 0x2FDB [0xFF ] */ end + +.layer LAYER_2FDC +/* 0x2FDC [0xC6 0x45 ] */ instr SF0_INST_69 +/* 0x2FDE [0xCB 0x66 0x38 0xFB ] */ env ENVELOPE_6638, 251 +/* 0x2FE2 [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x2FE6 [0x73 0x64 0x50 ] */ notedv PITCH_C5, 100, 80 +/* 0x2FE9 [0xFF ] */ end + +.channel CHAN_2FEA +/* 0x2FEA [0x88 0x2F 0xEE ] */ ldlayer 0, LAYER_2FEE +/* 0x2FED [0xFF ] */ end + +.layer LAYER_2FEE +/* 0x2FEE [0xC6 0x85 ] */ instr FONTANY_INSTR_BELL +/* 0x2FF0 [0xCB 0x66 0x10 0xFB ] */ env ENVELOPE_6610, 251 +/* 0x2FF4 [0xC7 0x83 0x00 0xFF ] */ portamento 0x83, PITCH_A0, 255 +/* 0x2FF8 [0x63 0x3C 0x3C ] */ notedv PITCH_AF3, 60, 60 +/* 0x2FFB [0xFF ] */ end + +.channel CHAN_2FFC +/* 0x2FFC [0x88 0x1F 0x03 ] */ ldlayer 0, LAYER_1F03 +/* 0x2FFF [0xFB 0x1A 0x2C ] */ jump CHAN_1A2C + +.channel CHAN_3002 +/* 0x3002 [0x88 0x30 0x06 ] */ ldlayer 0, LAYER_3006 +/* 0x3005 [0xFF ] */ end + +.layer LAYER_3006 +/* 0x3006 [0xC6 0x39 ] */ instr SF0_INST_57 +/* 0x3008 [0xC4 ] */ legato +LAYER_3009: +/* 0x3009 [0x5C 0xFF 0xBC 0x50 ] */ notedv PITCH_DF3, 32700, 80 +/* 0x300D [0xF4 0xFA ] */ rjump LAYER_3009 + +.channel CHAN_300F +/* 0x300F [0x88 0x30 0x16 ] */ ldlayer 0, LAYER_3016 +/* 0x3012 [0x89 0x30 0x29 ] */ ldlayer 1, LAYER_3029 +/* 0x3015 [0xFF ] */ end + +.layer LAYER_3016 +/* 0x3016 [0xC6 0x34 ] */ instr SF0_INST_52 +/* 0x3018 [0xCB 0x66 0x74 0xFB ] */ env ENVELOPE_6674, 251 +/* 0x301C [0xC4 ] */ legato +/* 0x301D [0xC7 0x85 0x0F 0xFF ] */ portamento 0x85, PITCH_C2, 255 +LAYER_3021: +/* 0x3021 [0x5B 0x64 0x37 ] */ notedv PITCH_C3, 100, 55 +/* 0x3024 [0x4F 0x64 0x37 ] */ notedv PITCH_C2, 100, 55 +/* 0x3027 [0xF4 0xF8 ] */ rjump LAYER_3021 + +.layer LAYER_3029 +/* 0x3029 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x302B [0xCB 0x66 0x74 0xFB ] */ env ENVELOPE_6674, 251 +/* 0x302F [0xC4 ] */ legato +/* 0x3030 [0xC7 0x85 0x1B 0xFF ] */ portamento 0x85, PITCH_C3, 255 +LAYER_3034: +/* 0x3034 [0x67 0x32 0x41 ] */ notedv PITCH_C4, 50, 65 +/* 0x3037 [0x5B 0x32 0x41 ] */ notedv PITCH_C3, 50, 65 +/* 0x303A [0xF4 0xF8 ] */ rjump LAYER_3034 + +.channel CHAN_303C +/* 0x303C [0x88 0x30 0x46 ] */ ldlayer 0, LAYER_3046 +/* 0x303F [0x89 0x30 0x59 ] */ ldlayer 1, LAYER_3059 +/* 0x3042 [0x8A 0x30 0x6C ] */ ldlayer 2, LAYER_306C +/* 0x3045 [0xFF ] */ end + +.layer LAYER_3046 +/* 0x3046 [0xC6 0x82 ] */ instr FONTANY_INSTR_SINE +/* 0x3048 [0xCB 0x66 0x74 0xFB ] */ env ENVELOPE_6674, 251 +/* 0x304C [0xC4 ] */ legato +/* 0x304D [0xC7 0x85 0x03 0xFF ] */ portamento 0x85, PITCH_C1, 255 +LAYER_3051: +/* 0x3051 [0x4A 0x2D 0x28 ] */ notedv PITCH_G1, 45, 40 +/* 0x3054 [0x43 0x2D 0x28 ] */ notedv PITCH_C1, 45, 40 +/* 0x3057 [0xF4 0xF8 ] */ rjump LAYER_3051 + +.layer LAYER_3059 +/* 0x3059 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x305B [0xCB 0x66 0x74 0xFB ] */ env ENVELOPE_6674, 251 +/* 0x305F [0xC4 ] */ legato +/* 0x3060 [0xC7 0x85 0x22 0xFF ] */ portamento 0x85, PITCH_G3, 255 +LAYER_3064: +/* 0x3064 [0x6E 0x5A 0x41 ] */ notedv PITCH_G4, 90, 65 +/* 0x3067 [0x62 0x5A 0x41 ] */ notedv PITCH_G3, 90, 65 +/* 0x306A [0xF4 0xF8 ] */ rjump LAYER_3064 + +.layer LAYER_306C +/* 0x306C [0xC6 0x34 ] */ instr SF0_INST_52 +/* 0x306E [0xCB 0x66 0x74 0xFB ] */ env ENVELOPE_6674, 251 +/* 0x3072 [0xC4 ] */ legato +/* 0x3073 [0xC7 0x85 0x07 0xFF ] */ portamento 0x85, PITCH_E1, 255 +LAYER_3077: +/* 0x3077 [0x53 0x80 0xB4 0x37 ] */ notedv PITCH_E2, 180, 55 +/* 0x307B [0x47 0x80 0xB4 0x37 ] */ notedv PITCH_E1, 180, 55 +/* 0x307F [0xF4 0xF6 ] */ rjump LAYER_3077 + +.channel CHAN_3081 +/* 0x3081 [0x88 0x30 0x85 ] */ ldlayer 0, LAYER_3085 +/* 0x3084 [0xFF ] */ end + +.layer LAYER_3085 +/* 0x3085 [0xC6 0x00 ] */ instr SF0_INST_0 +/* 0x3087 [0xC7 0x81 0x2B 0xFF ] */ portamento 0x81, PITCH_E4, 255 +/* 0x308B [0x53 0x0E 0x3C ] */ notedv PITCH_E2, 14, 60 +/* 0x308E [0xFF ] */ end + +.channel CHAN_308F +/* 0x308F [0x88 0x30 0xA0 ] */ ldlayer 0, LAYER_30A0 +/* 0x3092 [0x89 0x30 0x96 ] */ ldlayer 1, LAYER_3096 +/* 0x3095 [0xFF ] */ end + +.layer LAYER_3096 +/* 0x3096 [0xC6 0x00 ] */ instr SF0_INST_0 +/* 0x3098 [0xC7 0x81 0x20 0x7F ] */ portamento 0x81, PITCH_F3, 127 +/* 0x309C [0x60 0x0A 0x4C ] */ notedv PITCH_F3, 10, 76 +/* 0x309F [0xFF ] */ end + +.layer LAYER_30A0 +/* 0x30A0 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x30A2 [0x6C 0x06 0x30 ] */ notedv PITCH_F4, 6, 48 +/* 0x30A5 [0xC6 0x17 ] */ instr SF0_INST_23 +/* 0x30A7 [0x67 0x0A 0x30 ] */ notedv PITCH_C4, 10, 48 +/* 0x30AA [0xFF ] */ end + +.channel CHAN_30AB +/* 0x30AB [0x88 0x30 0xAF ] */ ldlayer 0, LAYER_30AF +/* 0x30AE [0xFF ] */ end + +.layer LAYER_30AF +/* 0x30AF [0xC6 0x41 ] */ instr SF0_INST_65 +/* 0x30B1 [0xCF 0xF1 ] */ releaserate 241 +/* 0x30B3 [0x6D 0x06 0x4B ] */ notedv PITCH_GF4, 6, 75 +/* 0x30B6 [0x60 0x64 0x4B ] */ notedv PITCH_F3, 100, 75 +/* 0x30B9 [0xFF ] */ end + +.filter FILTER_30C0 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.filter FILTER_30D0 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.filter FILTER_30E0 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.channel enemybank_handler_1 +/* 0x30F0 [0xB0 0x56 0xC0 ] */ ldfilter FILTER_56C0 +/* 0x30F3 [0xF4 0x08 ] */ rjump CHAN_30FD + +.channel enemybank_handler_2 +/* 0x30F5 [0xB0 0x56 0xD0 ] */ ldfilter FILTER_56D0 +/* 0x30F8 [0xF4 0x03 ] */ rjump CHAN_30FD + +.channel enemybank_handler_3 +/* 0x30FA [0xB0 0x56 0xE0 ] */ ldfilter FILTER_56E0 +CHAN_30FD: +/* 0x30FD [0xFC 0x00 0x72 ] */ call CHAN_0072 +/* 0x3100 [0xC6 0x01 ] */ font Soundfont_1_ID +/* 0x3102 [0xB3 0x00 ] */ filter 0, 0 +CHAN_3104: +/* 0x3104 [0xFE ] */ delay1 +/* 0x3105 [0x60 ] */ ldio IO_PORT_0 +/* 0x3106 [0xC8 0x01 ] */ sub 1 +/* 0x3108 [0xFA 0x31 0x0E ] */ beqz CHAN_310E +/* 0x310B [0xFB 0x31 0x04 ] */ jump CHAN_3104 + +CHAN_310E: +/* 0x310E [0xFC 0x00 0x7C ] */ call CHAN_007C +/* 0x3111 [0x92 ] */ dellayer 2 +/* 0x3112 [0x93 ] */ dellayer 3 +/* 0x3113 [0xD8 0x00 ] */ vibdepth 0 +/* 0x3115 [0xED 0x00 ] */ gain 0 +/* 0x3117 [0xDC 0x7F ] */ panweight 127 +/* 0x3119 [0x65 ] */ ldio IO_PORT_SFX_INDEX_HIBITS +/* 0x311A [0xC8 0x01 ] */ sub 1 +/* 0x311C [0xF3 0x0B ] */ rbeqz CHAN_3129 +/* 0x311E [0x64 ] */ ldio IO_PORT_SFX_INDEX_LOBITS +/* 0x311F [0xF5 0x31 0x37 ] */ bgez CHAN_3137 +/* 0x3122 [0xC9 0x7F ] */ and 127 +/* 0x3124 [0xC2 0x32 0x5E ] */ dyntbl enemybank_table + 2 * 1 * 128 +/* 0x3127 [0xF4 0x11 ] */ rjump CHAN_313A + +CHAN_3129: +/* 0x3129 [0xC2 0x33 0x5E ] */ dyntbl enemybank_table + 2 * 2 * 128 +/* 0x312C [0x64 ] */ ldio IO_PORT_SFX_INDEX_LOBITS +/* 0x312D [0xF5 0x31 0x3A ] */ bgez CHAN_313A +/* 0x3130 [0xC9 0x7F ] */ and 127 +/* 0x3132 [0xC2 0x34 0x5E ] */ dyntbl enemybank_table + 2 * 3 * 128 +/* 0x3135 [0xF4 0x03 ] */ rjump CHAN_313A + +CHAN_3137: +/* 0x3137 [0xC2 0x31 0x5E ] */ dyntbl enemybank_table + 2 * 0 * 128 +CHAN_313A: +/* 0x313A [0xDA 0x6A 0x7C ] */ env ENVELOPE_6A7C +/* 0x313D [0xD9 0xFB ] */ releaserate 251 +/* 0x313F [0xE4 ] */ dyncall +CHAN_3140: +/* 0x3140 [0x63 ] */ ldio IO_PORT_3 +/* 0x3141 [0xC7 0x00 0x31 0x46 ] */ stseq 0, STSEQ_HERE + STSEQ_FILTER_IDX +/* 0x3145 [0xB3 0x0F ] */ filter 0, 15 +/* 0x3147 [0xFC 0x00 0x84 ] */ call CHAN_0084 +/* 0x314A [0xFE ] */ delay1 +/* 0x314B [0x60 ] */ ldio IO_PORT_0 +/* 0x314C [0xF3 0x0A ] */ rbeqz CHAN_3158 +/* 0x314E [0xF2 0x02 ] */ rbltz CHAN_3152 +/* 0x3150 [0xF4 0xBC ] */ rjump CHAN_310E + +CHAN_3152: +/* 0x3152 [0x80 ] */ testlayer 0 +/* 0x3153 [0xF3 0xEB ] */ rbeqz CHAN_3140 +/* 0x3155 [0xCC 0xFF ] */ ldi 255 +/* 0x3157 [0x71 ] */ stio IO_PORT_1 +CHAN_3158: +/* 0x3158 [0x90 ] */ dellayer 0 +/* 0x3159 [0x91 ] */ dellayer 1 +/* 0x315A [0x92 ] */ dellayer 2 +/* 0x315B [0x93 ] */ dellayer 3 +/* 0x315C [0xF4 0xA6 ] */ rjump CHAN_3104 + +#define DEFINE_SFX(lblName, sfxId, priority, decay, rand, flags) \ + entry lblName + +.table enemybank_table + #include "enemybank_table.h" + +#undef DEFINE_SFX + +.channel CHAN_3544 +/* 0x3544 [0xC1 0x00 ] */ instr SF1_INST_0 +/* 0x3546 [0xDA 0x68 0xDC ] */ env ENVELOPE_68DC +/* 0x3549 [0x88 0x35 0x4D ] */ ldlayer 0, LAYER_354D +/* 0x354C [0xFF ] */ end + +.layer LAYER_354D +/* 0x354D [0xC7 0x81 0x22 0x50 ] */ portamento 0x81, PITCH_G3, 80 +/* 0x3551 [0x5B 0x1E 0x64 ] */ notedv PITCH_C3, 30, 100 +/* 0x3554 [0xFF ] */ end + +.channel CHAN_3555 +/* 0x3555 [0x88 0x35 0x59 ] */ ldlayer 0, LAYER_3559 +/* 0x3558 [0xFF ] */ end + +.layer LAYER_3559 +/* 0x3559 [0xC6 0x01 ] */ instr SF1_INST_1 +/* 0x355B [0x69 0x50 0x64 ] */ notedv PITCH_D4, 80, 100 +/* 0x355E [0xFF ] */ end + +.channel CHAN_355F +/* 0x355F [0xC1 0x02 ] */ instr SF1_INST_2 +/* 0x3561 [0x88 0x35 0x65 ] */ ldlayer 0, LAYER_3565 +/* 0x3564 [0xFF ] */ end + +.layer LAYER_3565 +/* 0x3565 [0x54 0xF5 0x30 0x64 ] */ notedv PITCH_F2, 30000, 100 +/* 0x3569 [0xF4 0xFA ] */ rjump LAYER_3565 + +.channel CHAN_356B +/* 0x356B [0xC1 0x01 ] */ instr SF1_INST_1 +/* 0x356D [0x88 0x35 0x74 ] */ ldlayer 0, LAYER_3574 +/* 0x3570 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x3573 [0xFF ] */ end + +.layer LAYER_3574 +/* 0x3574 [0xC7 0x81 0x24 0xFF ] */ portamento 0x81, PITCH_A3, 255 +/* 0x3578 [0x6B 0x0A 0x64 ] */ notedv PITCH_E4, 10, 100 +/* 0x357B [0xC7 0x81 0x2C 0xFF ] */ portamento 0x81, PITCH_F4, 255 +/* 0x357F [0x66 0x24 0x64 ] */ notedv PITCH_B3, 36, 100 +/* 0x3582 [0xFF ] */ end + +.channel CHAN_3583 +/* 0x3583 [0xC1 0x01 ] */ instr SF1_INST_1 +/* 0x3585 [0x88 0x35 0x8F ] */ ldlayer 0, LAYER_358F +/* 0x3588 [0x89 0x35 0x91 ] */ ldlayer 1, LAYER_3591 +/* 0x358B [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x358E [0xFF ] */ end + +.layer LAYER_358F +/* 0x358F [0xC2 0xFA ] */ transpose -6 +.layer LAYER_3591 +/* 0x3591 [0xC7 0x81 0x26 0xFF ] */ portamento 0x81, PITCH_B3, 255 +/* 0x3595 [0x6D 0x0A 0x64 ] */ notedv PITCH_GF4, 10, 100 +/* 0x3598 [0xC7 0x81 0x2E 0xFF ] */ portamento 0x81, PITCH_G4, 255 +/* 0x359C [0x68 0x5A 0x64 ] */ notedv PITCH_DF4, 90, 100 +/* 0x359F [0xFF ] */ end + +.channel CHAN_35A0 +/* 0x35A0 [0xC1 0x01 ] */ instr SF1_INST_1 +/* 0x35A2 [0xDA 0x68 0x3C ] */ env ENVELOPE_683C +/* 0x35A5 [0x88 0x35 0xAC ] */ ldlayer 0, LAYER_35AC +/* 0x35A8 [0x89 0x35 0xAE ] */ ldlayer 1, LAYER_35AE +/* 0x35AB [0xFF ] */ end + +.layer LAYER_35AC +/* 0x35AC [0xC2 0xF4 ] */ transpose -12 +.layer LAYER_35AE +/* 0x35AE [0xC7 0x01 0x22 0x14 ] */ portamento 0x01, PITCH_G3, 20 +/* 0x35B2 [0x66 0x5A 0x64 ] */ notedv PITCH_B3, 90, 100 +/* 0x35B5 [0xFF ] */ end + +.channel CHAN_35B6 +/* 0x35B6 [0xC1 0x00 ] */ instr SF1_INST_0 +/* 0x35B8 [0x88 0x35 0xCA ] */ ldlayer 0, LAYER_35CA +/* 0x35BB [0x89 0x35 0xC6 ] */ ldlayer 1, LAYER_35C6 +/* 0x35BE [0x8A 0x35 0xC2 ] */ ldlayer 2, LAYER_35C2 +/* 0x35C1 [0xFF ] */ end + +.layer LAYER_35C2 +/* 0x35C2 [0x66 0x50 0x64 ] */ notedv PITCH_B3, 80, 100 +/* 0x35C5 [0xFF ] */ end + +.layer LAYER_35C6 +/* 0x35C6 [0x5D 0x50 0x64 ] */ notedv PITCH_D3, 80, 100 +/* 0x35C9 [0xFF ] */ end + +.layer LAYER_35CA +/* 0x35CA [0x54 0x50 0x64 ] */ notedv PITCH_F2, 80, 100 +/* 0x35CD [0xFF ] */ end + +.channel CHAN_35CE +/* 0x35CE [0xC1 0x02 ] */ instr SF1_INST_2 +/* 0x35D0 [0x88 0x35 0xD9 ] */ ldlayer 0, LAYER_35D9 +/* 0x35D3 [0x89 0x35 0xD7 ] */ ldlayer 1, LAYER_35D7 +/* 0x35D6 [0xFF ] */ end + +.layer LAYER_35D7 +/* 0x35D7 [0xC2 0xF4 ] */ transpose -12 +.layer LAYER_35D9 +/* 0x35D9 [0x62 0xF5 0x30 0x64 ] */ notedv PITCH_G3, 30000, 100 +/* 0x35DD [0xF4 0xFA ] */ rjump LAYER_35D9 + +.channel CHAN_35DF +/* 0x35DF [0xC1 0x05 ] */ instr SF1_INST_5 +/* 0x35E1 [0x88 0x35 0xE5 ] */ ldlayer 0, LAYER_35E5 +/* 0x35E4 [0xFF ] */ end + +.layer LAYER_35E5 +/* 0x35E5 [0x60 0x50 0x64 ] */ notedv PITCH_F3, 80, 100 +/* 0x35E8 [0xFF ] */ end + +.channel CHAN_35E9 +/* 0x35E9 [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x35EB [0x88 0x35 0xF5 ] */ ldlayer 0, LAYER_35F5 +/* 0x35EE [0x89 0x35 0xF7 ] */ ldlayer 1, LAYER_35F7 +/* 0x35F1 [0x8A 0x36 0x06 ] */ ldlayer 2, LAYER_3606 +/* 0x35F4 [0xFF ] */ end + +.layer LAYER_35F5 +/* 0x35F5 [0xC2 0xF8 ] */ transpose -8 +.layer LAYER_35F7 +/* 0x35F7 [0xCB 0x69 0xDC 0xF0 ] */ env ENVELOPE_69DC, 240 +/* 0x35FB [0xC7 0x81 0x22 0x40 ] */ portamento 0x81, PITCH_G3, 64 +/* 0x35FF [0x5B 0x32 0x64 ] */ notedv PITCH_C3, 50, 100 +/* 0x3602 [0x43 0x5A 0x64 ] */ notedv PITCH_C1, 90, 100 +/* 0x3605 [0xFF ] */ end + +.layer LAYER_3606 +/* 0x3606 [0xCB 0x69 0xDC 0xF0 ] */ env ENVELOPE_69DC, 240 +/* 0x360A [0xC7 0x81 0x26 0x40 ] */ portamento 0x81, PITCH_B3, 64 +/* 0x360E [0x5F 0x32 0x64 ] */ notedv PITCH_E3, 50, 100 +/* 0x3611 [0xFF ] */ end + +.channel CHAN_3612 +/* 0x3612 [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x3614 [0x88 0x36 0x1B ] */ ldlayer 0, LAYER_361B +/* 0x3617 [0x89 0x36 0x1D ] */ ldlayer 1, LAYER_361D +/* 0x361A [0xFF ] */ end + +.layer LAYER_361B +/* 0x361B [0xC2 0xF8 ] */ transpose -8 +.layer LAYER_361D +/* 0x361D [0xCB 0x69 0xDC 0xFA ] */ env ENVELOPE_69DC, 250 +/* 0x3621 [0xC7 0x81 0x22 0x40 ] */ portamento 0x81, PITCH_G3, 64 +/* 0x3625 [0x5B 0x62 0x64 ] */ notedv PITCH_C3, 98, 100 +/* 0x3628 [0xFF ] */ end + +.channel CHAN_3629 +/* 0x3629 [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x362B [0x88 0x36 0x31 ] */ ldlayer 0, LAYER_3631 +/* 0x362E [0xED 0x12 ] */ gain 18 +/* 0x3630 [0xFF ] */ end + +.layer LAYER_3631 +/* 0x3631 [0xCB 0x69 0x0C 0xFA ] */ env ENVELOPE_690C, 250 +/* 0x3635 [0xC7 0x81 0x1D 0x96 ] */ portamento 0x81, PITCH_D3, 150 +/* 0x3639 [0x5B 0x08 0x64 ] */ notedv PITCH_C3, 8, 100 +/* 0x363C [0xCB 0x68 0xEC 0xFA ] */ env ENVELOPE_68EC, 250 +/* 0x3640 [0xC7 0x81 0x1B 0x96 ] */ portamento 0x81, PITCH_C3, 150 +/* 0x3644 [0x54 0x1E 0x64 ] */ notedv PITCH_F2, 30, 100 +/* 0x3647 [0xFF ] */ end + +.channel CHAN_3648 +/* 0x3648 [0x88 0x36 0x4C ] */ ldlayer 0, LAYER_364C +/* 0x364B [0xFF ] */ end + +.layer LAYER_364C +/* 0x364C [0xC6 0x06 ] */ instr SF1_INST_6 +/* 0x364E [0xCB 0x68 0xDC 0xFA ] */ env ENVELOPE_68DC, 250 +/* 0x3652 [0xC7 0x81 0x24 0x40 ] */ portamento 0x81, PITCH_A3, 64 +/* 0x3656 [0x5D 0x1E 0x64 ] */ notedv PITCH_D3, 30, 100 +/* 0x3659 [0xFF ] */ end + +.channel CHAN_365A +/* 0x365A [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x365C [0xDA 0x68 0xEC ] */ env ENVELOPE_68EC +/* 0x365F [0x88 0x36 0x65 ] */ ldlayer 0, LAYER_3665 +/* 0x3662 [0xED 0x10 ] */ gain 16 +/* 0x3664 [0xFF ] */ end + +.layer LAYER_3665 +/* 0x3665 [0xC7 0x81 0x25 0x40 ] */ portamento 0x81, PITCH_BF3, 64 +/* 0x3669 [0x5E 0x28 0x64 ] */ notedv PITCH_EF3, 40, 100 +/* 0x366C [0xFF ] */ end + +.channel CHAN_366D +/* 0x366D [0xC1 0x0C ] */ instr SF1_INST_12 +/* 0x366F [0x89 0x36 0x76 ] */ ldlayer 1, LAYER_3676 +/* 0x3672 [0x88 0x36 0x78 ] */ ldlayer 0, LAYER_3678 +/* 0x3675 [0xFF ] */ end + +.layer LAYER_3676 +/* 0x3676 [0xC2 0x01 ] */ transpose 1 +.layer LAYER_3678 +/* 0x3678 [0xC7 0x81 0x13 0x40 ] */ portamento 0x81, PITCH_E2, 64 +/* 0x367C [0x56 0x14 0x64 ] */ notedv PITCH_G2, 20, 100 +/* 0x367F [0xFF ] */ end + +.channel CHAN_3680 +/* 0x3680 [0xC1 0x03 ] */ instr SF1_INST_3 +/* 0x3682 [0xDA 0x69 0x8C ] */ env ENVELOPE_698C +/* 0x3685 [0x88 0x36 0x8B ] */ ldlayer 0, LAYER_368B +/* 0x3688 [0xED 0x12 ] */ gain 18 +/* 0x368A [0xFF ] */ end + +.layer LAYER_368B +/* 0x368B [0xC4 ] */ legato +/* 0x368C [0xC7 0x85 0x14 0xFF ] */ portamento 0x85, PITCH_F2, 255 +/* 0x3690 [0x55 0x28 0x64 ] */ notedv PITCH_GF2, 40, 100 +/* 0x3693 [0x54 0x55 0x64 ] */ notedv PITCH_F2, 85, 100 +/* 0x3696 [0xFF ] */ end + +.channel CHAN_3697 +/* 0x3697 [0xC1 0x04 ] */ instr SF1_INST_4 +/* 0x3699 [0x88 0x36 0x9D ] */ ldlayer 0, LAYER_369D +/* 0x369C [0xFF ] */ end + +.layer LAYER_369D +/* 0x369D [0xC7 0x81 0x1F 0xFF ] */ portamento 0x81, PITCH_E3, 255 +/* 0x36A1 [0x5B 0x05 0x64 ] */ notedv PITCH_C3, 5, 100 +/* 0x36A4 [0xFF ] */ end + +.channel CHAN_36A5 +/* 0x36A5 [0xC1 0x07 ] */ instr SF1_INST_7 +/* 0x36A7 [0x88 0x36 0xAB ] */ ldlayer 0, LAYER_36AB +/* 0x36AA [0xFF ] */ end + +.layer LAYER_36AB +/* 0x36AB [0xC7 0x81 0x30 0xFF ] */ portamento 0x81, PITCH_A4, 255 +/* 0x36AF [0x6D 0x1E 0x64 ] */ notedv PITCH_GF4, 30, 100 +/* 0x36B2 [0xFF ] */ end + +.channel CHAN_36B3 +/* 0x36B3 [0x88 0x48 0x29 ] */ ldlayer 0, LAYER_4829 +/* 0x36B6 [0x89 0x36 0xBD ] */ ldlayer 1, LAYER_36BD +/* 0x36B9 [0x8A 0x36 0xC1 ] */ ldlayer 2, LAYER_36C1 +/* 0x36BC [0xFF ] */ end + +.layer LAYER_36BD +/* 0x36BD [0xC6 0x07 ] */ instr SF1_INST_7 +/* 0x36BF [0xF4 0x02 ] */ rjump LAYER_36C3 + +.layer LAYER_36C1 +/* 0x36C1 [0xC6 0x03 ] */ instr SF1_INST_3 +LAYER_36C3: +/* 0x36C3 [0xC7 0x81 0x33 0xFF ] */ portamento 0x81, PITCH_C5, 255 +/* 0x36C7 [0x7E 0x0A 0x64 ] */ notedv PITCH_B5, 10, 100 +/* 0x36CA [0xC7 0x81 0x3C 0xFF ] */ portamento 0x81, PITCH_A5, 255 +/* 0x36CE [0x77 0x12 0x64 ] */ notedv PITCH_E5, 18, 100 +/* 0x36D1 [0xFF ] */ end + +.channel CHAN_36D2 +/* 0x36D2 [0x88 0x36 0xD6 ] */ ldlayer 0, LAYER_36D6 +/* 0x36D5 [0xFF ] */ end + +.layer LAYER_36D6 +/* 0x36D6 [0xC6 0x07 ] */ instr SF1_INST_7 +/* 0x36D8 [0xC7 0x81 0x33 0xFF ] */ portamento 0x81, PITCH_C5, 255 +/* 0x36DC [0x78 0x0A 0x64 ] */ notedv PITCH_F5, 10, 100 +/* 0x36DF [0xC7 0x81 0x35 0xFF ] */ portamento 0x81, PITCH_D5, 255 +/* 0x36E3 [0x7A 0x0A 0x64 ] */ notedv PITCH_G5, 10, 100 +/* 0x36E6 [0xC2 0x04 ] */ transpose 4 +/* 0x36E8 [0xC7 0x81 0x37 0xFF ] */ portamento 0x81, PITCH_E5, 255 +/* 0x36EC [0x7E 0x0A 0x64 ] */ notedv PITCH_B5, 10, 100 +/* 0x36EF [0xC2 0x06 ] */ transpose 6 +/* 0x36F1 [0xC7 0x81 0x33 0xFF ] */ portamento 0x81, PITCH_C5, 255 +/* 0x36F5 [0x7E 0x14 0x64 ] */ notedv PITCH_B5, 20, 100 +/* 0x36F8 [0xFF ] */ end + +.channel CHAN_36F9 +/* 0x36F9 [0x88 0x37 0x00 ] */ ldlayer 0, LAYER_3700 +/* 0x36FC [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x36FF [0xFF ] */ end + +.layer LAYER_3700 +/* 0x3700 [0xC6 0x07 ] */ instr SF1_INST_7 +/* 0x3702 [0xC7 0x81 0x38 0xFF ] */ portamento 0x81, PITCH_F5, 255 +/* 0x3706 [0x73 0x05 0x64 ] */ notedv PITCH_C5, 5, 100 +/* 0x3709 [0xC7 0x81 0x36 0xFF ] */ portamento 0x81, PITCH_EF5, 255 +/* 0x370D [0x71 0x0A 0x64 ] */ notedv PITCH_BF4, 10, 100 +/* 0x3710 [0xC7 0x81 0x33 0xFF ] */ portamento 0x81, PITCH_C5, 255 +/* 0x3714 [0x6F 0x0A 0x64 ] */ notedv PITCH_AF4, 10, 100 +/* 0x3717 [0xC7 0x81 0x2F 0xFF ] */ portamento 0x81, PITCH_AF4, 255 +/* 0x371B [0x68 0x14 0x64 ] */ notedv PITCH_DF4, 20, 100 +/* 0x371E [0xFF ] */ end + +.channel CHAN_371F +/* 0x371F [0xC1 0x04 ] */ instr SF1_INST_4 +/* 0x3721 [0x88 0x37 0x28 ] */ ldlayer 0, LAYER_3728 +/* 0x3724 [0x89 0x37 0x2C ] */ ldlayer 1, LAYER_372C +/* 0x3727 [0xFF ] */ end + +.layer LAYER_3728 +/* 0x3728 [0x5F 0x50 0x64 ] */ notedv PITCH_E3, 80, 100 +/* 0x372B [0xFF ] */ end + +.layer LAYER_372C +/* 0x372C [0xC0 0x0F ] */ ldelay 15 +/* 0x372E [0x67 0x50 0x64 ] */ notedv PITCH_C4, 80, 100 +/* 0x3731 [0xFF ] */ end + +.channel CHAN_3732 +/* 0x3732 [0x88 0x37 0x4D ] */ ldlayer 0, LAYER_374D +/* 0x3735 [0x89 0x37 0x39 ] */ ldlayer 1, LAYER_3739 +/* 0x3738 [0xFF ] */ end + +.layer LAYER_3739 +/* 0x3739 [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x373B [0xC4 ] */ legato +/* 0x373C [0xC7 0x85 0x27 0xFF ] */ portamento 0x85, PITCH_C4, 255 +/* 0x3740 [0x6E 0x14 0x50 ] */ notedv PITCH_G4, 20, 80 +/* 0x3743 [0x67 0x14 0x50 ] */ notedv PITCH_C4, 20, 80 +/* 0x3746 [0x6B 0x14 0x50 ] */ notedv PITCH_E4, 20, 80 +/* 0x3749 [0x64 0x14 0x50 ] */ notedv PITCH_A3, 20, 80 +/* 0x374C [0xFF ] */ end + +.layer LAYER_374D +/* 0x374D [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x374F [0xC4 ] */ legato +/* 0x3750 [0xC7 0x85 0x27 0xFF ] */ portamento 0x85, PITCH_C4, 255 +/* 0x3754 [0x6E 0x0A 0x64 ] */ notedv PITCH_G4, 10, 100 +/* 0x3757 [0x67 0x0A 0x64 ] */ notedv PITCH_C4, 10, 100 +/* 0x375A [0x6E 0x0A 0x64 ] */ notedv PITCH_G4, 10, 100 +/* 0x375D [0x67 0x0A 0x64 ] */ notedv PITCH_C4, 10, 100 +/* 0x3760 [0x6E 0x0A 0x64 ] */ notedv PITCH_G4, 10, 100 +/* 0x3763 [0x67 0x05 0x64 ] */ notedv PITCH_C4, 5, 100 +/* 0x3766 [0xFF ] */ end + +.channel CHAN_3767 +/* 0x3767 [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x3769 [0x88 0x37 0x6F ] */ ldlayer 0, LAYER_376F +/* 0x376C [0xED 0x12 ] */ gain 18 +/* 0x376E [0xFF ] */ end + +.layer LAYER_376F +/* 0x376F [0xC4 ] */ legato +/* 0x3770 [0xCB 0x68 0xFC 0xFF ] */ env ENVELOPE_68FC, 255 +/* 0x3774 [0xC7 0x85 0x19 0xE6 ] */ portamento 0x85, PITCH_BF2, 230 +/* 0x3778 [0x5E 0x05 0x64 ] */ notedv PITCH_EF3, 5, 100 +/* 0x377B [0x59 0x05 0x64 ] */ notedv PITCH_BF2, 5, 100 +/* 0x377E [0xC5 ] */ nolegato +/* 0x377F [0xC0 0x05 ] */ ldelay 5 +/* 0x3781 [0xC4 ] */ legato +/* 0x3782 [0xCB 0x68 0xFC 0xFF ] */ env ENVELOPE_68FC, 255 +/* 0x3786 [0xC7 0x85 0x19 0xDC ] */ portamento 0x85, PITCH_BF2, 220 +/* 0x378A [0x5E 0x05 0x64 ] */ notedv PITCH_EF3, 5, 100 +/* 0x378D [0x59 0x0A 0x64 ] */ notedv PITCH_BF2, 10, 100 +/* 0x3790 [0xFF ] */ end + +/* 0x3791 [0xC1 0x08 ] */ shortvel 8 +/* 0x3793 [0x88 0x37 0x97 ] */ notevg PITCH_F1, 55, 151 +/* 0x3796 [0xFF ] */ end + +/* 0x3797 [0x69 0x46 0x64 ] */ notedv PITCH_D4, 70, 100 +/* 0x379A [0xFF ] */ end + +.channel CHAN_379B +/* 0x379B [0xC1 0x09 ] */ instr SF1_INST_9 +/* 0x379D [0x88 0x37 0xA3 ] */ ldlayer 0, LAYER_37A3 +/* 0x37A0 [0xED 0x32 ] */ gain 50 +/* 0x37A2 [0xFF ] */ end + +.layer LAYER_37A3 +/* 0x37A3 [0xC7 0x81 0x25 0x64 ] */ portamento 0x81, PITCH_BF3, 100 +/* 0x37A7 [0x6A 0x32 0x64 ] */ notedv PITCH_EF4, 50, 100 +/* 0x37AA [0xFF ] */ end + +.channel CHAN_37AB +/* 0x37AB [0x88 0x37 0xAF ] */ ldlayer 0, LAYER_37AF +/* 0x37AE [0xFF ] */ end + +.layer LAYER_37AF +/* 0x37AF [0xC6 0x0A ] */ instr SF1_INST_10 +/* 0x37B1 [0xC7 0x81 0x24 0xFF ] */ portamento 0x81, PITCH_A3, 255 +/* 0x37B5 [0x6B 0x0A 0x64 ] */ notedv PITCH_E4, 10, 100 +/* 0x37B8 [0xC7 0x81 0x2A 0xFF ] */ portamento 0x81, PITCH_EF4, 255 +/* 0x37BC [0x68 0x06 0x64 ] */ notedv PITCH_DF4, 6, 100 +/* 0x37BF [0xFF ] */ end + +.channel CHAN_37C0 +/* 0x37C0 [0x88 0x37 0xC7 ] */ ldlayer 0, LAYER_37C7 +/* 0x37C3 [0x89 0x37 0xD3 ] */ ldlayer 1, LAYER_37D3 +/* 0x37C6 [0xFF ] */ end + +.layer LAYER_37C7 +/* 0x37C7 [0xC6 0x01 ] */ instr SF1_INST_1 +/* 0x37C9 [0xC0 0x0A ] */ ldelay 10 +/* 0x37CB [0xC7 0x81 0x30 0x40 ] */ portamento 0x81, PITCH_A4, 64 +/* 0x37CF [0x75 0x28 0x64 ] */ notedv PITCH_D5, 40, 100 +/* 0x37D2 [0xFF ] */ end + +.layer LAYER_37D3 +/* 0x37D3 [0xC6 0x00 ] */ instr SF1_INST_0 +/* 0x37D5 [0xCB 0x68 0x6C 0xF0 ] */ env ENVELOPE_686C, 240 +/* 0x37D9 [0xC2 0x06 ] */ transpose 6 +/* 0x37DB [0xC7 0x81 0x1A 0x64 ] */ portamento 0x81, PITCH_B2, 100 +/* 0x37DF [0x7E 0x32 0x64 ] */ notedv PITCH_B5, 50, 100 +/* 0x37E2 [0xFF ] */ end + +.channel CHAN_37E3 +/* 0x37E3 [0x88 0x37 0xEA ] */ ldlayer 0, LAYER_37EA +/* 0x37E6 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x37E9 [0xFF ] */ end + +.layer LAYER_37EA +/* 0x37EA [0xC6 0x01 ] */ instr SF1_INST_1 +/* 0x37EC [0xC7 0x81 0x30 0xFF ] */ portamento 0x81, PITCH_A4, 255 +/* 0x37F0 [0x75 0x0A 0x64 ] */ notedv PITCH_D5, 10, 100 +/* 0x37F3 [0xC7 0x81 0x37 0xFF ] */ portamento 0x81, PITCH_E5, 255 +/* 0x37F7 [0x6C 0x48 0x64 ] */ notedv PITCH_F4, 72, 100 +/* 0x37FA [0xFF ] */ end + +.channel CHAN_37FB +/* 0x37FB [0x88 0x38 0x09 ] */ ldlayer 0, LAYER_3809 +/* 0x37FE [0x89 0x38 0x02 ] */ ldlayer 1, LAYER_3802 +/* 0x3801 [0xFF ] */ end + +.layer LAYER_3802 +/* 0x3802 [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x3804 [0x6B 0x80 0x96 0x46 ] */ notedv PITCH_E4, 150, 70 +/* 0x3808 [0xFF ] */ end + +.layer LAYER_3809 +/* 0x3809 [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x380B [0xC4 ] */ legato +/* 0x380C [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x3810 [0x69 0x0A 0x64 ] */ notedv PITCH_D4, 10, 100 +/* 0x3813 [0xC7 0x81 0x29 0xFF ] */ portamento 0x81, PITCH_D4, 255 +/* 0x3817 [0x6C 0x80 0xC8 0x64 ] */ notedv PITCH_F4, 200, 100 +/* 0x381B [0xFF ] */ end + +.channel CHAN_381C +/* 0x381C [0x88 0x38 0x38 ] */ ldlayer 0, LAYER_3838 +/* 0x381F [0x89 0x38 0x26 ] */ ldlayer 1, LAYER_3826 +/* 0x3822 [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x3825 [0xFF ] */ end + +.layer LAYER_3826 +/* 0x3826 [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x3828 [0xC4 ] */ legato +/* 0x3829 [0xC7 0x81 0x2A 0x40 ] */ portamento 0x81, PITCH_EF4, 64 +/* 0x382D [0x71 0x14 0x50 ] */ notedv PITCH_BF4, 20, 80 +/* 0x3830 [0xC7 0x81 0x2F 0xFF ] */ portamento 0x81, PITCH_AF4, 255 +/* 0x3834 [0x63 0x24 0x50 ] */ notedv PITCH_AF3, 36, 80 +/* 0x3837 [0xFF ] */ end + +.layer LAYER_3838 +/* 0x3838 [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x383A [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x383E [0x6E 0x0F 0x64 ] */ notedv PITCH_G4, 15, 100 +/* 0x3841 [0xC7 0x81 0x2C 0xFF ] */ portamento 0x81, PITCH_F4, 255 +/* 0x3845 [0x66 0x24 0x64 ] */ notedv PITCH_B3, 36, 100 +/* 0x3848 [0xFF ] */ end + +.channel CHAN_3849 +/* 0x3849 [0xC1 0x05 ] */ instr SF1_INST_5 +/* 0x384B [0x88 0x38 0x54 ] */ ldlayer 0, LAYER_3854 +/* 0x384E [0x89 0x38 0x52 ] */ ldlayer 1, LAYER_3852 +/* 0x3851 [0xFF ] */ end + +.layer LAYER_3852 +/* 0x3852 [0xC2 0x02 ] */ transpose 2 +.layer LAYER_3854 +/* 0x3854 [0x4F 0x64 0x64 ] */ notedv PITCH_C2, 100, 100 +/* 0x3857 [0xFF ] */ end + +.channel CHAN_3858 +/* 0x3858 [0x88 0x38 0x5C ] */ ldlayer 0, LAYER_385C +/* 0x385B [0xFF ] */ end + +.layer LAYER_385C +/* 0x385C [0xC6 0x0C ] */ instr SF1_INST_12 +/* 0x385E [0x51 0x1E 0x46 ] */ notedv PITCH_D2, 30, 70 +/* 0x3861 [0xFF ] */ end + +.channel CHAN_3862 +/* 0x3862 [0x88 0x38 0x66 ] */ ldlayer 0, LAYER_3866 +/* 0x3865 [0xFF ] */ end + +.layer LAYER_3866 +/* 0x3866 [0xC6 0x0C ] */ instr SF1_INST_12 +/* 0x3868 [0x59 0x19 0x64 ] */ notedv PITCH_BF2, 25, 100 +/* 0x386B [0x57 0x14 0x64 ] */ notedv PITCH_AF2, 20, 100 +/* 0x386E [0x59 0x0F 0x64 ] */ notedv PITCH_BF2, 15, 100 +/* 0x3871 [0x57 0x0F 0x64 ] */ notedv PITCH_AF2, 15, 100 +/* 0x3874 [0x59 0x0A 0x64 ] */ notedv PITCH_BF2, 10, 100 +/* 0x3877 [0x57 0x0F 0x64 ] */ notedv PITCH_AF2, 15, 100 +/* 0x387A [0x59 0x0F 0x46 ] */ notedv PITCH_BF2, 15, 70 +LAYER_387D: +/* 0x387D [0x57 0x0F 0x46 ] */ notedv PITCH_AF2, 15, 70 +/* 0x3880 [0x59 0x0F 0x46 ] */ notedv PITCH_BF2, 15, 70 +/* 0x3883 [0x57 0x0F 0x46 ] */ notedv PITCH_AF2, 15, 70 +/* 0x3886 [0x59 0x0A 0x3C ] */ notedv PITCH_BF2, 10, 60 +/* 0x3889 [0x57 0x0A 0x3C ] */ notedv PITCH_AF2, 10, 60 +/* 0x388C [0xFF ] */ end + +.channel CHAN_388D +/* 0x388D [0x88 0x38 0x91 ] */ ldlayer 0, LAYER_3891 +/* 0x3890 [0xFF ] */ end + +.layer LAYER_3891 +/* 0x3891 [0xC6 0x0C ] */ instr SF1_INST_12 +/* 0x3893 [0xF4 0xE8 ] */ rjump LAYER_387D + +.channel CHAN_3895 +/* 0x3895 [0x88 0x38 0x99 ] */ ldlayer 0, LAYER_3899 +/* 0x3898 [0xFF ] */ end + +.layer LAYER_3899 +/* 0x3899 [0xC6 0x0C ] */ instr SF1_INST_12 +/* 0x389B [0x57 0x08 0x28 ] */ notedv PITCH_AF2, 8, 40 +/* 0x389E [0x56 0x08 0x28 ] */ notedv PITCH_G2, 8, 40 +/* 0x38A1 [0xFF ] */ end + +.channel CHAN_38A2 +/* 0x38A2 [0x88 0x38 0xA6 ] */ ldlayer 0, LAYER_38A6 +/* 0x38A5 [0xFF ] */ end + +.layer LAYER_38A6 +/* 0x38A6 [0xC6 0x0C ] */ instr SF1_INST_12 +/* 0x38A8 [0x55 0x19 0x64 ] */ notedv PITCH_GF2, 25, 100 +/* 0x38AB [0x57 0x14 0x64 ] */ notedv PITCH_AF2, 20, 100 +/* 0x38AE [0xFF ] */ end + +.channel CHAN_38AF +/* 0x38AF [0x88 0x38 0xB6 ] */ ldlayer 0, LAYER_38B6 +/* 0x38B2 [0x89 0x38 0x66 ] */ ldlayer 1, LAYER_3866 +/* 0x38B5 [0xFF ] */ end + +.layer LAYER_38B6 +/* 0x38B6 [0xC2 0xFB ] */ transpose -5 +/* 0x38B8 [0xF4 0xAC ] */ rjump LAYER_3866 + +.channel CHAN_38BA +/* 0x38BA [0x88 0x38 0xC1 ] */ ldlayer 0, LAYER_38C1 +/* 0x38BD [0x89 0x38 0xA6 ] */ ldlayer 1, LAYER_38A6 +/* 0x38C0 [0xFF ] */ end + +.layer LAYER_38C1 +/* 0x38C1 [0xC2 0xFE ] */ transpose -2 +/* 0x38C3 [0xC0 0x03 ] */ ldelay 3 +/* 0x38C5 [0xF4 0xDF ] */ rjump LAYER_38A6 + +.channel CHAN_38C7 +/* 0x38C7 [0xC1 0x14 ] */ instr SF1_INST_20 +/* 0x38C9 [0x88 0x38 0xCD ] */ ldlayer 0, LAYER_38CD +/* 0x38CC [0xFF ] */ end + +.layer LAYER_38CD +/* 0x38CD [0x5B 0x30 0x64 ] */ notedv PITCH_C3, 48, 100 +/* 0x38D0 [0xFF ] */ end + +.channel CHAN_38D1 +/* 0x38D1 [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x38D3 [0x88 0x38 0xD7 ] */ ldlayer 0, LAYER_38D7 +/* 0x38D6 [0xFF ] */ end + +.layer LAYER_38D7 +/* 0x38D7 [0xC7 0x81 0x23 0x40 ] */ portamento 0x81, PITCH_AF3, 64 +/* 0x38DB [0x5C 0x0C 0x40 ] */ notedv PITCH_DF3, 12, 64 +/* 0x38DE [0xFF ] */ end + +.channel CHAN_38DF +/* 0x38DF [0x88 0x38 0xE5 ] */ ldlayer 0, LAYER_38E5 +/* 0x38E2 [0xED 0x10 ] */ gain 16 +/* 0x38E4 [0xFF ] */ end + +.layer LAYER_38E5 +/* 0x38E5 [0xC6 0x1B ] */ instr SF1_INST_27 +/* 0x38E7 [0x67 0x80 0x8C 0x64 ] */ notedv PITCH_C4, 140, 100 +/* 0x38EB [0xFF ] */ end + +.channel CHAN_38EC +/* 0x38EC [0x88 0x38 0xF6 ] */ ldlayer 0, LAYER_38F6 +/* 0x38EF [0x89 0x39 0x07 ] */ ldlayer 1, LAYER_3907 +/* 0x38F2 [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x38F5 [0xFF ] */ end + +.layer LAYER_38F6 +/* 0x38F6 [0xC6 0x0F ] */ instr SF1_INST_15 +/* 0x38F8 [0xC7 0x81 0x21 0xFF ] */ portamento 0x81, PITCH_GF3, 255 +/* 0x38FC [0x68 0x0F 0x64 ] */ notedv PITCH_DF4, 15, 100 +/* 0x38FF [0xC7 0x81 0x26 0xFF ] */ portamento 0x81, PITCH_B3, 255 +/* 0x3903 [0x57 0x28 0x64 ] */ notedv PITCH_AF2, 40, 100 +/* 0x3906 [0xFF ] */ end + +.layer LAYER_3907 +/* 0x3907 [0xC6 0x0D ] */ instr SF1_INST_13 +/* 0x3909 [0x73 0x05 0x64 ] */ notedv PITCH_C5, 5, 100 +/* 0x390C [0x72 0x05 0x64 ] */ notedv PITCH_B4, 5, 100 +/* 0x390F [0x70 0x05 0x64 ] */ notedv PITCH_A4, 5, 100 +/* 0x3912 [0x6B 0x05 0x64 ] */ notedv PITCH_E4, 5, 100 +/* 0x3915 [0xFF ] */ end + +.channel CHAN_3916 +/* 0x3916 [0x88 0x39 0x1A ] */ ldlayer 0, LAYER_391A +/* 0x3919 [0xFF ] */ end + +.layer LAYER_391A +/* 0x391A [0xC6 0x0E ] */ instr SF1_INST_14 +/* 0x391C [0xC7 0x81 0x2C 0xFF ] */ portamento 0x81, PITCH_F4, 255 +/* 0x3920 [0x67 0x14 0x64 ] */ notedv PITCH_C4, 20, 100 +/* 0x3923 [0xFF ] */ end + +.channel CHAN_3924 +/* 0x3924 [0x88 0x39 0x2E ] */ ldlayer 0, LAYER_392E +/* 0x3927 [0x89 0x39 0x3F ] */ ldlayer 1, LAYER_393F +/* 0x392A [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x392D [0xFF ] */ end + +.layer LAYER_392E +/* 0x392E [0xC6 0x0F ] */ instr SF1_INST_15 +/* 0x3930 [0xC7 0x81 0x23 0xFF ] */ portamento 0x81, PITCH_AF3, 255 +/* 0x3934 [0x5F 0x0F 0x64 ] */ notedv PITCH_E3, 15, 100 +/* 0x3937 [0xC7 0x81 0x1F 0xFF ] */ portamento 0x81, PITCH_E3, 255 +/* 0x393B [0x5B 0x1E 0x64 ] */ notedv PITCH_C3, 30, 100 +/* 0x393E [0xFF ] */ end + +.layer LAYER_393F +/* 0x393F [0xC6 0x0D ] */ instr SF1_INST_13 +/* 0x3941 [0x7B 0x05 0x64 ] */ notedv PITCH_AF5, 5, 100 +/* 0x3944 [0x78 0x05 0x64 ] */ notedv PITCH_F5, 5, 100 +/* 0x3947 [0x74 0x05 0x64 ] */ notedv PITCH_DF5, 5, 100 +/* 0x394A [0x71 0x05 0x64 ] */ notedv PITCH_BF4, 5, 100 +/* 0x394D [0xFF ] */ end + +.channel CHAN_394E +/* 0x394E [0x88 0x39 0x58 ] */ ldlayer 0, LAYER_3958 +CHAN_3951: +/* 0x3951 [0x89 0x39 0x62 ] */ ldlayer 1, LAYER_3962 +/* 0x3954 [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x3957 [0xFF ] */ end + +.layer LAYER_3958 +/* 0x3958 [0xC6 0x1A ] */ instr SF1_INST_26 +/* 0x395A [0xC7 0x81 0x2F 0x64 ] */ portamento 0x81, PITCH_AF4, 100 +/* 0x395E [0x6E 0x50 0x64 ] */ notedv PITCH_G4, 80, 100 +/* 0x3961 [0xFF ] */ end + +.layer LAYER_3962 +/* 0x3962 [0xC6 0x11 ] */ instr SF1_INST_17 +/* 0x3964 [0x62 0x05 0x64 ] */ notedv PITCH_G3, 5, 100 +/* 0x3967 [0x62 0x05 0x64 ] */ notedv PITCH_G3, 5, 100 +/* 0x396A [0xFF ] */ end + +.channel CHAN_396B +/* 0x396B [0x88 0x39 0x70 ] */ ldlayer 0, LAYER_3970 +/* 0x396E [0xF4 0xE1 ] */ rjump CHAN_3951 + +.layer LAYER_3970 +/* 0x3970 [0xC2 0x13 ] */ transpose 19 +/* 0x3972 [0xF4 0xE4 ] */ rjump LAYER_3958 + +.channel CHAN_3974 +/* 0x3974 [0x88 0x39 0x84 ] */ ldlayer 0, LAYER_3984 +CHAN_3977: +/* 0x3977 [0x89 0x39 0x97 ] */ ldlayer 1, LAYER_3997 +/* 0x397A [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x397D [0xED 0x14 ] */ gain 20 +/* 0x397F [0xD7 0x32 ] */ vibfreq 50 +/* 0x3981 [0xD8 0x0A ] */ vibdepth 10 +/* 0x3983 [0xFF ] */ end + +.layer LAYER_3984 +/* 0x3984 [0xC6 0x1A ] */ instr SF1_INST_26 +/* 0x3986 [0xC4 ] */ legato +/* 0x3987 [0xC7 0x85 0x2B 0xC8 ] */ portamento 0x85, PITCH_E4, 200 +/* 0x398B [0x6F 0x1E 0x64 ] */ notedv PITCH_AF4, 30, 100 +/* 0x398E [0x64 0x80 0x8C 0x64 ] */ notedv PITCH_A3, 140, 100 +/* 0x3992 [0x6B 0x80 0xC8 0x64 ] */ notedv PITCH_E4, 200, 100 +/* 0x3996 [0xFF ] */ end + +.layer LAYER_3997 +/* 0x3997 [0xC6 0x11 ] */ instr SF1_INST_17 +/* 0x3999 [0x62 0x05 0x64 ] */ notedv PITCH_G3, 5, 100 +/* 0x399C [0x62 0x0F 0x64 ] */ notedv PITCH_G3, 15, 100 +/* 0x399F [0xFF ] */ end + +.channel CHAN_39A0 +/* 0x39A0 [0x88 0x39 0xA5 ] */ ldlayer 0, LAYER_39A5 +/* 0x39A3 [0xF4 0xD2 ] */ rjump CHAN_3977 + +.layer LAYER_39A5 +/* 0x39A5 [0xC2 0x0E ] */ transpose 14 +/* 0x39A7 [0xF4 0xDB ] */ rjump LAYER_3984 + +.channel CHAN_39A9 +/* 0x39A9 [0x88 0x39 0xA5 ] */ ldlayer 0, LAYER_39A5 +/* 0x39AC [0xFF ] */ end + +.channel CHAN_39AD +/* 0x39AD [0x88 0x39 0xB1 ] */ ldlayer 0, LAYER_39B1 +/* 0x39B0 [0xFF ] */ end + +.layer LAYER_39B1 +/* 0x39B1 [0xC6 0x0F ] */ instr SF1_INST_15 +/* 0x39B3 [0xC2 0x30 ] */ transpose 48 +/* 0x39B5 [0x68 0x0A 0x50 ] */ notedv PITCH_DF4, 10, 80 +/* 0x39B8 [0xFF ] */ end + +.channel CHAN_39B9 +/* 0x39B9 [0x88 0x39 0xBD ] */ ldlayer 0, LAYER_39BD +/* 0x39BC [0xFF ] */ end + +.layer LAYER_39BD +/* 0x39BD [0xC6 0x0F ] */ instr SF1_INST_15 +/* 0x39BF [0xC2 0x30 ] */ transpose 48 +/* 0x39C1 [0x6B 0x0A 0x50 ] */ notedv PITCH_E4, 10, 80 +/* 0x39C4 [0x69 0x0A 0x50 ] */ notedv PITCH_D4, 10, 80 +/* 0x39C7 [0xFF ] */ end + +.channel CHAN_39C8 +/* 0x39C8 [0x88 0x39 0xDD ] */ ldlayer 0, LAYER_39DD +/* 0x39CB [0x89 0x39 0xD2 ] */ ldlayer 1, LAYER_39D2 +/* 0x39CE [0x8A 0x39 0xED ] */ ldlayer 2, LAYER_39ED +/* 0x39D1 [0xFF ] */ end + +.layer LAYER_39D2 +/* 0x39D2 [0xC6 0x0F ] */ instr SF1_INST_15 +/* 0x39D4 [0xC2 0x30 ] */ transpose 48 +/* 0x39D6 [0x6B 0x0A 0x64 ] */ notedv PITCH_E4, 10, 100 +/* 0x39D9 [0x6D 0x0A 0x64 ] */ notedv PITCH_GF4, 10, 100 +/* 0x39DC [0xFF ] */ end + +.layer LAYER_39DD +/* 0x39DD [0xC6 0x00 ] */ instr SF1_INST_0 +/* 0x39DF [0xCB 0x68 0x6C 0xF0 ] */ env ENVELOPE_686C, 240 +/* 0x39E3 [0xC2 0x04 ] */ transpose 4 +/* 0x39E5 [0xC7 0x81 0x1A 0x32 ] */ portamento 0x81, PITCH_B2, 50 +/* 0x39E9 [0x7E 0x50 0x64 ] */ notedv PITCH_B5, 80, 100 +/* 0x39EC [0xFF ] */ end + +.layer LAYER_39ED +/* 0x39ED [0xC6 0x0D ] */ instr SF1_INST_13 +/* 0x39EF [0xC0 0x0A ] */ ldelay 10 +/* 0x39F1 [0x6A 0x05 0x64 ] */ notedv PITCH_EF4, 5, 100 +/* 0x39F4 [0x69 0x05 0x64 ] */ notedv PITCH_D4, 5, 100 +/* 0x39F7 [0x67 0x05 0x64 ] */ notedv PITCH_C4, 5, 100 +/* 0x39FA [0x67 0x05 0x64 ] */ notedv PITCH_C4, 5, 100 +/* 0x39FD [0xFF ] */ end + +.channel CHAN_39FE +/* 0x39FE [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x3A00 [0x88 0x3A 0x04 ] */ ldlayer 0, LAYER_3A04 +/* 0x3A03 [0xFF ] */ end + +.layer LAYER_3A04 +/* 0x3A04 [0xC7 0x81 0x27 0xC8 ] */ portamento 0x81, PITCH_C4, 200 +/* 0x3A08 [0x64 0x14 0x64 ] */ notedv PITCH_A3, 20, 100 +/* 0x3A0B [0xFF ] */ end + +.channel CHAN_3A0C +/* 0x3A0C [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x3A0E [0xDA 0x69 0x0C ] */ env ENVELOPE_690C +/* 0x3A11 [0x89 0x3A 0x18 ] */ ldlayer 1, LAYER_3A18 +/* 0x3A14 [0x88 0x3A 0x2E ] */ ldlayer 0, LAYER_3A2E +/* 0x3A17 [0xFF ] */ end + +.layer LAYER_3A18 +/* 0x3A18 [0x53 0x0A 0x64 ] */ notedv PITCH_E2, 10, 100 +/* 0x3A1B [0x55 0x0A 0x64 ] */ notedv PITCH_GF2, 10, 100 +/* 0x3A1E [0x53 0x0A 0x64 ] */ notedv PITCH_E2, 10, 100 +/* 0x3A21 [0x55 0x0A 0x64 ] */ notedv PITCH_GF2, 10, 100 +/* 0x3A24 [0x53 0x0A 0x64 ] */ notedv PITCH_E2, 10, 100 +/* 0x3A27 [0x55 0x0A 0x64 ] */ notedv PITCH_GF2, 10, 100 +/* 0x3A2A [0x53 0x0A 0x64 ] */ notedv PITCH_E2, 10, 100 +/* 0x3A2D [0xFF ] */ end + +.layer LAYER_3A2E +/* 0x3A2E [0xC6 0x23 ] */ instr SF1_INST_35 +/* 0x3A30 [0xCB 0x69 0x9C 0xFA ] */ env ENVELOPE_699C, 250 +/* 0x3A34 [0xC4 ] */ legato +/* 0x3A35 [0xC7 0x85 0x17 0xFF ] */ portamento 0x85, PITCH_AF2, 255 +/* 0x3A39 [0x67 0x1E 0x64 ] */ notedv PITCH_C4, 30, 100 +/* 0x3A3C [0x60 0x52 0x64 ] */ notedv PITCH_F3, 82, 100 +/* 0x3A3F [0xFF ] */ end + +.channel CHAN_3A40 +/* 0x3A40 [0x88 0x3A 0x47 ] */ ldlayer 0, LAYER_3A47 +/* 0x3A43 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x3A46 [0xFF ] */ end + +.layer LAYER_3A47 +/* 0x3A47 [0xC6 0x23 ] */ instr SF1_INST_35 +/* 0x3A49 [0xCB 0x69 0x9C 0xF0 ] */ env ENVELOPE_699C, 240 +/* 0x3A4D [0xC4 ] */ legato +/* 0x3A4E [0xC7 0x85 0x25 0xC8 ] */ portamento 0x85, PITCH_BF3, 200 +/* 0x3A52 [0x6D 0x1E 0x64 ] */ notedv PITCH_GF4, 30, 100 +/* 0x3A55 [0x61 0x64 0x64 ] */ notedv PITCH_GF3, 100, 100 +/* 0x3A58 [0xFF ] */ end + +.channel CHAN_3A59 +/* 0x3A59 [0xC1 0x23 ] */ instr SF1_INST_35 +/* 0x3A5B [0xDA 0x69 0x9C ] */ env ENVELOPE_699C +/* 0x3A5E [0xED 0x13 ] */ gain 19 +/* 0x3A60 [0x88 0x3A 0x64 ] */ ldlayer 0, LAYER_3A64 +/* 0x3A63 [0xFF ] */ end + +.layer LAYER_3A64 +/* 0x3A64 [0xC4 ] */ legato +/* 0x3A65 [0xC7 0x85 0x17 0xFF ] */ portamento 0x85, PITCH_AF2, 255 +/* 0x3A69 [0x67 0x1E 0x64 ] */ notedv PITCH_C4, 30, 100 +/* 0x3A6C [0x60 0x52 0x64 ] */ notedv PITCH_F3, 82, 100 +/* 0x3A6F [0xFF ] */ end + +.channel CHAN_3A70 +/* 0x3A70 [0x88 0x3A 0x79 ] */ ldlayer 0, LAYER_3A79 +/* 0x3A73 [0x89 0x3A 0x87 ] */ ldlayer 1, LAYER_3A87 +/* 0x3A76 [0xED 0x14 ] */ gain 20 +/* 0x3A78 [0xFF ] */ end + +.layer LAYER_3A79 +/* 0x3A79 [0xC6 0x19 ] */ instr SF1_INST_25 +/* 0x3A7B [0xC4 ] */ legato +/* 0x3A7C [0xC7 0x85 0x1E 0x1E ] */ portamento 0x85, PITCH_EF3, 30 +/* 0x3A80 [0x71 0x14 0x64 ] */ notedv PITCH_BF4, 20, 100 +/* 0x3A83 [0x70 0x14 0x64 ] */ notedv PITCH_A4, 20, 100 +/* 0x3A86 [0xFF ] */ end + +.layer LAYER_3A87 +/* 0x3A87 [0xC6 0x1C ] */ instr SF1_INST_28 +/* 0x3A89 [0xCB 0x68 0x2C 0xF0 ] */ env ENVELOPE_682C, 240 +/* 0x3A8D [0xC0 0x0A ] */ ldelay 10 +/* 0x3A8F [0x66 0x1E 0x64 ] */ notedv PITCH_B3, 30, 100 +/* 0x3A92 [0xFF ] */ end + +.channel CHAN_3A93 +/* 0x3A93 [0x88 0x3A 0x9A ] */ ldlayer 0, LAYER_3A9A +/* 0x3A96 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x3A99 [0xFF ] */ end + +.layer LAYER_3A9A +/* 0x3A9A [0xC6 0x23 ] */ instr SF1_INST_35 +/* 0x3A9C [0xC4 ] */ legato +/* 0x3A9D [0xC7 0x85 0x27 0x64 ] */ portamento 0x85, PITCH_C4, 100 +/* 0x3AA1 [0x6C 0x1E 0x64 ] */ notedv PITCH_F4, 30, 100 +/* 0x3AA4 [0x67 0x1E 0x64 ] */ notedv PITCH_C4, 30, 100 +/* 0x3AA7 [0xFF ] */ end + +.channel CHAN_3AA8 +/* 0x3AA8 [0xC1 0x00 ] */ instr SF1_INST_0 +/* 0x3AAA [0x88 0x3A 0xB4 ] */ ldlayer 0, LAYER_3AB4 +/* 0x3AAD [0x89 0x3A 0xBF ] */ ldlayer 1, LAYER_3ABF +/* 0x3AB0 [0x8A 0x3A 0xCA ] */ ldlayer 2, LAYER_3ACA +/* 0x3AB3 [0xFF ] */ end + +.layer LAYER_3AB4 +/* 0x3AB4 [0x61 0x14 0x64 ] */ notedv PITCH_GF3, 20, 100 +/* 0x3AB7 [0xCB 0x68 0x8C 0xF0 ] */ env ENVELOPE_688C, 240 +/* 0x3ABB [0x57 0x64 0x64 ] */ notedv PITCH_AF2, 100, 100 +/* 0x3ABE [0xFF ] */ end + +.layer LAYER_3ABF +/* 0x3ABF [0x65 0x14 0x64 ] */ notedv PITCH_BF3, 20, 100 +/* 0x3AC2 [0xCB 0x68 0x8C 0xF0 ] */ env ENVELOPE_688C, 240 +/* 0x3AC6 [0x5B 0x64 0x64 ] */ notedv PITCH_C3, 100, 100 +/* 0x3AC9 [0xFF ] */ end + +.layer LAYER_3ACA +/* 0x3ACA [0x68 0x14 0x64 ] */ notedv PITCH_DF4, 20, 100 +/* 0x3ACD [0xCB 0x68 0x8C 0xF0 ] */ env ENVELOPE_688C, 240 +/* 0x3AD1 [0x5E 0x64 0x64 ] */ notedv PITCH_EF3, 100, 100 +/* 0x3AD4 [0xFF ] */ end + +.channel CHAN_3AD5 +/* 0x3AD5 [0xC1 0x00 ] */ instr SF1_INST_0 +/* 0x3AD7 [0x88 0x3A 0xDE ] */ ldlayer 0, LAYER_3ADE +/* 0x3ADA [0x89 0x3A 0xE9 ] */ ldlayer 1, LAYER_3AE9 +/* 0x3ADD [0xFF ] */ end + +.layer LAYER_3ADE +/* 0x3ADE [0x61 0x14 0x64 ] */ notedv PITCH_GF3, 20, 100 +/* 0x3AE1 [0xCB 0x68 0x8C 0xF0 ] */ env ENVELOPE_688C, 240 +/* 0x3AE5 [0x57 0x32 0x64 ] */ notedv PITCH_AF2, 50, 100 +/* 0x3AE8 [0xFF ] */ end + +.layer LAYER_3AE9 +/* 0x3AE9 [0x66 0x14 0x64 ] */ notedv PITCH_B3, 20, 100 +/* 0x3AEC [0xCB 0x68 0x8C 0xF0 ] */ env ENVELOPE_688C, 240 +/* 0x3AF0 [0x5C 0x32 0x64 ] */ notedv PITCH_DF3, 50, 100 +/* 0x3AF3 [0xFF ] */ end + +.channel CHAN_3AF4 +/* 0x3AF4 [0x88 0x3B 0x01 ] */ ldlayer 0, LAYER_3B01 +/* 0x3AF7 [0x89 0x3A 0xFF ] */ ldlayer 1, LAYER_3AFF +/* 0x3AFA [0xD7 0x14 ] */ vibfreq 20 +/* 0x3AFC [0xD8 0x64 ] */ vibdepth 100 +/* 0x3AFE [0xFF ] */ end + +.layer LAYER_3AFF +/* 0x3AFF [0xC2 0x0C ] */ transpose 12 +.layer LAYER_3B01 +/* 0x3B01 [0xC6 0x12 ] */ instr SF1_INST_18 +LAYER_3B03: +/* 0x3B03 [0x67 0xF5 0x30 0x64 ] */ notedv PITCH_C4, 30000, 100 +/* 0x3B07 [0xF4 0xFA ] */ rjump LAYER_3B03 + +.channel CHAN_3B09 +/* 0x3B09 [0xC1 0x13 ] */ instr SF1_INST_19 +/* 0x3B0B [0x88 0x3B 0x14 ] */ ldlayer 0, LAYER_3B14 +/* 0x3B0E [0x89 0x3B 0x12 ] */ ldlayer 1, LAYER_3B12 +/* 0x3B11 [0xFF ] */ end + +.layer LAYER_3B12 +/* 0x3B12 [0xC2 0xFC ] */ transpose -4 +.layer LAYER_3B14 +/* 0x3B14 [0xC4 ] */ legato +/* 0x3B15 [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +/* 0x3B19 [0x60 0x80 0xAA 0x64 ] */ notedv PITCH_F3, 170, 100 +LAYER_3B1D: +/* 0x3B1D [0x60 0xF5 0x30 0x64 ] */ notedv PITCH_F3, 30000, 100 +/* 0x3B21 [0xF4 0xFA ] */ rjump LAYER_3B1D + +.channel CHAN_3B23 +/* 0x3B23 [0xC1 0x14 ] */ instr SF1_INST_20 +/* 0x3B25 [0x88 0x3B 0x2E ] */ ldlayer 0, LAYER_3B2E +/* 0x3B28 [0x89 0x3B 0x30 ] */ ldlayer 1, LAYER_3B30 +/* 0x3B2B [0xED 0x18 ] */ gain 24 +/* 0x3B2D [0xFF ] */ end + +.layer LAYER_3B2E +/* 0x3B2E [0xC2 0xFE ] */ transpose -2 +.layer LAYER_3B30 +/* 0x3B30 [0x5B 0x46 0x64 ] */ notedv PITCH_C3, 70, 100 +/* 0x3B33 [0xFF ] */ end + +.channel CHAN_3B34 +/* 0x3B34 [0xC1 0x01 ] */ instr SF1_INST_1 +/* 0x3B36 [0xDA 0x68 0x3C ] */ env ENVELOPE_683C +/* 0x3B39 [0x88 0x3B 0x40 ] */ ldlayer 0, LAYER_3B40 +/* 0x3B3C [0x89 0x3B 0x42 ] */ ldlayer 1, LAYER_3B42 +/* 0x3B3F [0xFF ] */ end + +.layer LAYER_3B40 +/* 0x3B40 [0xC2 0xFC ] */ transpose -4 +.layer LAYER_3B42 +/* 0x3B42 [0xC4 ] */ legato +/* 0x3B43 [0xC7 0x85 0x0F 0xFF ] */ portamento 0x85, PITCH_C2, 255 +/* 0x3B47 [0x51 0x32 0x64 ] */ notedv PITCH_D2, FRAMERATE_CONST(50, 60), 100 +/* 0x3B4A [0x4E 0x32 0x64 ] */ notedv PITCH_B1, FRAMERATE_CONST(50, 60), 100 +/* 0x3B4D [0xC5 ] */ nolegato +/* 0x3B4E [0xF4 0xF2 ] */ rjump LAYER_3B42 + +.channel CHAN_3B50 +/* 0x3B50 [0xC1 0x13 ] */ instr SF1_INST_19 +/* 0x3B52 [0x88 0x3B 0x56 ] */ ldlayer 0, LAYER_3B56 +/* 0x3B55 [0xFF ] */ end + +.layer LAYER_3B56 +/* 0x3B56 [0x5F 0xF5 0x30 0x64 ] */ notedv PITCH_E3, 30000, 100 +/* 0x3B5A [0xF4 0xFA ] */ rjump LAYER_3B56 + +.channel CHAN_3B5C +/* 0x3B5C [0xC1 0x15 ] */ instr SF1_INST_21 +/* 0x3B5E [0x88 0x3B 0x62 ] */ ldlayer 0, LAYER_3B62 +/* 0x3B61 [0xFF ] */ end + +.layer LAYER_3B62 +/* 0x3B62 [0x60 0x1E 0x64 ] */ notedv PITCH_F3, 30, 100 +/* 0x3B65 [0xFF ] */ end + +.channel CHAN_3B66 +/* 0x3B66 [0x88 0x3B 0x6A ] */ ldlayer 0, LAYER_3B6A +/* 0x3B69 [0xFF ] */ end + +.layer LAYER_3B6A +/* 0x3B6A [0xC6 0x18 ] */ instr SF1_INST_24 +/* 0x3B6C [0xC2 0x30 ] */ transpose 48 +/* 0x3B6E [0xC7 0x81 0x27 0xC8 ] */ portamento 0x81, PITCH_C4, 200 +/* 0x3B72 [0x6B 0x32 0x64 ] */ notedv PITCH_E4, 50, 100 +/* 0x3B75 [0xFF ] */ end + +.channel CHAN_3B76 +/* 0x3B76 [0x88 0x3B 0x7D ] */ ldlayer 0, LAYER_3B7D +/* 0x3B79 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x3B7C [0xFF ] */ end + +.layer LAYER_3B7D +/* 0x3B7D [0xC6 0x17 ] */ instr SF1_INST_23 +/* 0x3B7F [0xC7 0x81 0x2C 0xFF ] */ portamento 0x81, PITCH_F4, 255 +/* 0x3B83 [0x73 0x0A 0x64 ] */ notedv PITCH_C5, 10, 100 +/* 0x3B86 [0xC7 0x81 0x35 0xFF ] */ portamento 0x81, PITCH_D5, 255 +/* 0x3B8A [0x6C 0x1E 0x64 ] */ notedv PITCH_F4, 30, 100 +/* 0x3B8D [0xFF ] */ end + +.channel CHAN_3B8E +/* 0x3B8E [0x88 0x3B 0x99 ] */ ldlayer 0, LAYER_3B99 +/* 0x3B91 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x3B94 [0xD7 0x64 ] */ vibfreq 100 +/* 0x3B96 [0xD8 0x7F ] */ vibdepth 127 +/* 0x3B98 [0xFF ] */ end + +.layer LAYER_3B99 +/* 0x3B99 [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x3B9B [0xCB 0x69 0xAC 0xFF ] */ env ENVELOPE_69AC, 255 +/* 0x3B9F [0xC4 ] */ legato +/* 0x3BA0 [0xC7 0x85 0x1F 0xFF ] */ portamento 0x85, PITCH_E3, 255 +/* 0x3BA4 [0x67 0x1E 0x64 ] */ notedv PITCH_C4, 30, 100 +/* 0x3BA7 [0x5B 0x78 0x64 ] */ notedv PITCH_C3, 120, 100 +/* 0x3BAA [0xFF ] */ end + +.channel CHAN_3BAB +/* 0x3BAB [0x88 0x3B 0xB9 ] */ ldlayer 0, LAYER_3BB9 +/* 0x3BAE [0x89 0x4B 0xA9 ] */ ldlayer 1, LAYER_4BA9 +/* 0x3BB1 [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x3BB4 [0xD7 0x30 ] */ vibfreq 48 +/* 0x3BB6 [0xD8 0x80 ] */ vibdepth 128 +/* 0x3BB8 [0xFF ] */ end + +.layer LAYER_3BB9 +/* 0x3BB9 [0xC2 0x03 ] */ transpose 3 +/* 0x3BBB [0xF4 0xDC ] */ rjump LAYER_3B99 + +.channel CHAN_3BBD +/* 0x3BBD [0xC1 0x15 ] */ instr SF1_INST_21 +/* 0x3BBF [0x88 0x3B 0xC3 ] */ ldlayer 0, LAYER_3BC3 +/* 0x3BC2 [0xFF ] */ end + +.layer LAYER_3BC3 +/* 0x3BC3 [0x6C 0x0F 0x64 ] */ notedv PITCH_F4, 15, 100 +/* 0x3BC6 [0xFF ] */ end + +.channel CHAN_3BC7 +/* 0x3BC7 [0x88 0x3B 0xCB ] */ ldlayer 0, LAYER_3BCB +/* 0x3BCA [0xFF ] */ end + +.layer LAYER_3BCB +/* 0x3BCB [0xC6 0x18 ] */ instr SF1_INST_24 +/* 0x3BCD [0xC2 0x30 ] */ transpose 48 +/* 0x3BCF [0xC7 0x81 0x30 0xFF ] */ portamento 0x81, PITCH_A4, 255 +/* 0x3BD3 [0x73 0x1E 0x64 ] */ notedv PITCH_C5, 30, 100 +/* 0x3BD6 [0xFF ] */ end + +.channel CHAN_3BD7 +/* 0x3BD7 [0xC1 0x03 ] */ instr SF1_INST_3 +/* 0x3BD9 [0xDA 0x68 0x4C ] */ env ENVELOPE_684C +/* 0x3BDC [0x88 0x3B 0xE7 ] */ ldlayer 0, LAYER_3BE7 +/* 0x3BDF [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x3BE2 [0xD7 0x64 ] */ vibfreq 100 +/* 0x3BE4 [0xD8 0x7F ] */ vibdepth 127 +/* 0x3BE6 [0xFF ] */ end + +.layer LAYER_3BE7 +/* 0x3BE7 [0xC4 ] */ legato +/* 0x3BE8 [0xC7 0x85 0x31 0xC8 ] */ portamento 0x85, PITCH_BF4, 200 +/* 0x3BEC [0x79 0x1E 0x64 ] */ notedv PITCH_GF5, 30, 100 +/* 0x3BEF [0x6D 0x32 0x64 ] */ notedv PITCH_GF4, 50, 100 +/* 0x3BF2 [0xFF ] */ end + +.channel CHAN_3BF3 +/* 0x3BF3 [0x88 0x3B 0xFC ] */ ldlayer 0, LAYER_3BFC +/* 0x3BF6 [0xC1 0x0C ] */ instr SF1_INST_12 +/* 0x3BF8 [0xDA 0x68 0xBC ] */ env ENVELOPE_68BC +/* 0x3BFB [0xFF ] */ end + +.layer LAYER_3BFC +/* 0x3BFC [0xC7 0x81 0x0D 0xFF ] */ portamento 0x81, PITCH_BF1, 255 +/* 0x3C00 [0x4A 0x38 0x50 ] */ notedv PITCH_G1, 56, 80 +/* 0x3C03 [0xFF ] */ end + +.channel CHAN_3C04 +/* 0x3C04 [0x88 0x3C 0x0B ] */ ldlayer 0, LAYER_3C0B +/* 0x3C07 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x3C0A [0xFF ] */ end + +.layer LAYER_3C0B +/* 0x3C0B [0xC6 0x17 ] */ instr SF1_INST_23 +/* 0x3C0D [0xC7 0x81 0x2C 0xFF ] */ portamento 0x81, PITCH_F4, 255 +/* 0x3C11 [0x73 0x0A 0x64 ] */ notedv PITCH_C5, 10, 100 +/* 0x3C14 [0xC7 0x81 0x35 0xFF ] */ portamento 0x81, PITCH_D5, 255 +/* 0x3C18 [0x6C 0x1E 0x64 ] */ notedv PITCH_F4, 30, 100 +/* 0x3C1B [0xFF ] */ end + +.channel CHAN_3C1C +/* 0x3C1C [0xC1 0x18 ] */ instr SF1_INST_24 +/* 0x3C1E [0x88 0x3C 0x26 ] */ ldlayer 0, LAYER_3C26 +/* 0x3C21 [0xD7 0x40 ] */ vibfreq 64 +/* 0x3C23 [0xD8 0x80 ] */ vibdepth 128 +/* 0x3C25 [0xFF ] */ end + +.layer LAYER_3C26 +/* 0x3C26 [0x59 0xF5 0x30 0x50 ] */ notedv PITCH_BF2, 30000, 80 +/* 0x3C2A [0xF4 0xFA ] */ rjump LAYER_3C26 + +.channel CHAN_3C2C +/* 0x3C2C [0xC1 0x04 ] */ instr SF1_INST_4 +/* 0x3C2E [0x88 0x3C 0x32 ] */ ldlayer 0, LAYER_3C32 +/* 0x3C31 [0xFF ] */ end + +.layer LAYER_3C32 +/* 0x3C32 [0xC7 0x81 0x0E 0x3C ] */ portamento 0x81, PITCH_B1, 60 +/* 0x3C36 [0x53 0x32 0x64 ] */ notedv PITCH_E2, 50, 100 +/* 0x3C39 [0xFF ] */ end + +.channel CHAN_3C3A +/* 0x3C3A [0x88 0x3C 0x45 ] */ ldlayer 0, LAYER_3C45 +/* 0x3C3D [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x3C40 [0xD7 0x70 ] */ vibfreq 112 +/* 0x3C42 [0xD8 0x70 ] */ vibdepth 112 +/* 0x3C44 [0xFF ] */ end + +.layer LAYER_3C45 +/* 0x3C45 [0xC6 0x17 ] */ instr SF1_INST_23 +/* 0x3C47 [0xC7 0x81 0x23 0x60 ] */ portamento 0x81, PITCH_AF3, 96 +/* 0x3C4B [0x73 0x14 0x64 ] */ notedv PITCH_C5, 20, 100 +/* 0x3C4E [0xC7 0x81 0x2C 0xCF ] */ portamento 0x81, PITCH_F4, 207 +/* 0x3C52 [0x67 0x30 0x64 ] */ notedv PITCH_C4, 48, 100 +/* 0x3C55 [0xFF ] */ end + +.channel CHAN_3C56 +/* 0x3C56 [0xC1 0x04 ] */ instr SF1_INST_4 +/* 0x3C58 [0x88 0x3C 0x5F ] */ ldlayer 0, LAYER_3C5F +/* 0x3C5B [0x89 0x3C 0x67 ] */ ldlayer 1, LAYER_3C67 +/* 0x3C5E [0xFF ] */ end + +.layer LAYER_3C5F +/* 0x3C5F [0xC7 0x81 0x27 0x64 ] */ portamento 0x81, PITCH_C4, 100 +/* 0x3C63 [0x6B 0x32 0x64 ] */ notedv PITCH_E4, 50, 100 +/* 0x3C66 [0xFF ] */ end + +.layer LAYER_3C67 +/* 0x3C67 [0xC0 0x05 ] */ ldelay 5 +/* 0x3C69 [0xC7 0x81 0x25 0x64 ] */ portamento 0x81, PITCH_BF3, 100 +/* 0x3C6D [0x69 0x32 0x64 ] */ notedv PITCH_D4, 50, 100 +/* 0x3C70 [0xFF ] */ end + +.channel CHAN_3C71 +/* 0x3C71 [0xC1 0x04 ] */ instr SF1_INST_4 +/* 0x3C73 [0x88 0x3C 0x7A ] */ ldlayer 0, LAYER_3C7A +/* 0x3C76 [0x89 0x3C 0x82 ] */ ldlayer 1, LAYER_3C82 +/* 0x3C79 [0xFF ] */ end + +.layer LAYER_3C7A +/* 0x3C7A [0xC7 0x81 0x2B 0x64 ] */ portamento 0x81, PITCH_E4, 100 +/* 0x3C7E [0x67 0x32 0x64 ] */ notedv PITCH_C4, 50, 100 +/* 0x3C81 [0xFF ] */ end + +.layer LAYER_3C82 +/* 0x3C82 [0xC0 0x05 ] */ ldelay 5 +/* 0x3C84 [0xC7 0x81 0x29 0x64 ] */ portamento 0x81, PITCH_D4, 100 +/* 0x3C88 [0x65 0x32 0x64 ] */ notedv PITCH_BF3, 50, 100 +/* 0x3C8B [0xFF ] */ end + +.channel CHAN_3C8C +/* 0x3C8C [0xC1 0x0E ] */ instr SF1_INST_14 +/* 0x3C8E [0xDA 0x69 0x9C ] */ env ENVELOPE_699C +/* 0x3C91 [0x88 0x3C 0x9B ] */ ldlayer 0, LAYER_3C9B +/* 0x3C94 [0xED 0x10 ] */ gain 16 +/* 0x3C96 [0xD7 0x64 ] */ vibfreq 100 +/* 0x3C98 [0xD8 0x7F ] */ vibdepth 127 +/* 0x3C9A [0xFF ] */ end + +.layer LAYER_3C9B +/* 0x3C9B [0x48 0x64 0x64 ] */ notedv PITCH_F1, 100, 100 +/* 0x3C9E [0xFF ] */ end + +.channel CHAN_3C9F +/* 0x3C9F [0x88 0x3C 0xA3 ] */ ldlayer 0, LAYER_3CA3 +/* 0x3CA2 [0xFF ] */ end + +.layer LAYER_3CA3 +/* 0x3CA3 [0xC6 0x0C ] */ instr SF1_INST_12 +/* 0x3CA5 [0x67 0x0A 0x46 ] */ notedv PITCH_C4, 10, 70 +/* 0x3CA8 [0xFF ] */ end + +.channel CHAN_3CA9 +/* 0x3CA9 [0x88 0x3C 0xB0 ] */ ldlayer 0, LAYER_3CB0 +/* 0x3CAC [0x89 0x3C 0xB6 ] */ ldlayer 1, LAYER_3CB6 +/* 0x3CAF [0xFF ] */ end + +.layer LAYER_3CB0 +/* 0x3CB0 [0xC6 0x0A ] */ instr SF1_INST_10 +/* 0x3CB2 [0x60 0x19 0x64 ] */ notedv PITCH_F3, 25, 100 +/* 0x3CB5 [0xFF ] */ end + +.layer LAYER_3CB6 +/* 0x3CB6 [0xC6 0x11 ] */ instr SF1_INST_17 +/* 0x3CB8 [0x60 0x0A 0x1E ] */ notedv PITCH_F3, 10, 30 +/* 0x3CBB [0xFF ] */ end + +.channel CHAN_3CBC +/* 0x3CBC [0xC1 0x08 ] */ instr SF1_INST_8 +/* 0x3CBE [0xDA 0x69 0xAC ] */ env ENVELOPE_69AC +/* 0x3CC1 [0x88 0x3C 0xC9 ] */ ldlayer 0, LAYER_3CC9 +/* 0x3CC4 [0xD7 0x14 ] */ vibfreq 20 +/* 0x3CC6 [0xD8 0x7F ] */ vibdepth 127 +/* 0x3CC8 [0xFF ] */ end + +.layer LAYER_3CC9 +/* 0x3CC9 [0x60 0x80 0x87 0x64 ] */ notedv PITCH_F3, 135, 100 +/* 0x3CCD [0xF4 0xFA ] */ rjump LAYER_3CC9 + +.channel CHAN_3CCF +/* 0x3CCF [0xC1 0x08 ] */ instr SF1_INST_8 +/* 0x3CD1 [0x88 0x3C 0xD9 ] */ ldlayer 0, LAYER_3CD9 +/* 0x3CD4 [0xD7 0x3C ] */ vibfreq 60 +/* 0x3CD6 [0xD8 0x64 ] */ vibdepth 100 +/* 0x3CD8 [0xFF ] */ end + +.layer LAYER_3CD9 +/* 0x3CD9 [0x6B 0x32 0x64 ] */ notedv PITCH_E4, 50, 100 +/* 0x3CDC [0xC0 0x0A ] */ ldelay 10 +/* 0x3CDE [0xF4 0xF9 ] */ rjump LAYER_3CD9 + +.channel CHAN_3CE0 +/* 0x3CE0 [0xC1 0x08 ] */ instr SF1_INST_8 +/* 0x3CE2 [0xDA 0x69 0xBC ] */ env ENVELOPE_69BC +/* 0x3CE5 [0x88 0x3C 0xED ] */ ldlayer 0, LAYER_3CED +/* 0x3CE8 [0xD7 0x64 ] */ vibfreq 100 +/* 0x3CEA [0xD8 0x64 ] */ vibdepth 100 +/* 0x3CEC [0xFF ] */ end + +.layer LAYER_3CED +/* 0x3CED [0xC7 0x81 0x2B 0xFF ] */ portamento 0x81, PITCH_E4, 255 +/* 0x3CF1 [0x4F 0x80 0x96 0x64 ] */ notedv PITCH_C2, 150, 100 +/* 0x3CF5 [0xFF ] */ end + +.channel CHAN_3CF6 +/* 0x3CF6 [0xC1 0x08 ] */ instr SF1_INST_8 +/* 0x3CF8 [0x88 0x3D 0x00 ] */ ldlayer 0, LAYER_3D00 +/* 0x3CFB [0xD7 0x64 ] */ vibfreq 100 +/* 0x3CFD [0xD8 0x64 ] */ vibdepth 100 +/* 0x3CFF [0xFF ] */ end + +.layer LAYER_3D00 +/* 0x3D00 [0xC7 0x81 0x0F 0xC8 ] */ portamento 0x81, PITCH_C2, 200 +/* 0x3D04 [0x6B 0x80 0x96 0x64 ] */ notedv PITCH_E4, 150, 100 +/* 0x3D08 [0xFF ] */ end + +.channel CHAN_3D09 +/* 0x3D09 [0xC1 0x08 ] */ instr SF1_INST_8 +/* 0x3D0B [0x88 0x3D 0x14 ] */ ldlayer 0, LAYER_3D14 +/* 0x3D0E [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x3D11 [0xED 0x18 ] */ gain 24 +/* 0x3D13 [0xFF ] */ end + +.layer LAYER_3D14 +/* 0x3D14 [0xC7 0x81 0x31 0xC8 ] */ portamento 0x81, PITCH_BF4, 200 +/* 0x3D18 [0x7C 0x0A 0x64 ] */ notedv PITCH_A5, 10, 100 +/* 0x3D1B [0xC7 0x81 0x3C 0x9B ] */ portamento 0x81, PITCH_A5, 155 +/* 0x3D1F [0x77 0x1E 0x64 ] */ notedv PITCH_E5, 30, 100 +/* 0x3D22 [0xFF ] */ end + +.channel CHAN_3D23 +/* 0x3D23 [0x88 0x3D 0x2C ] */ ldlayer 0, LAYER_3D2C +/* 0x3D26 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x3D29 [0xED 0x18 ] */ gain 24 +/* 0x3D2B [0xFF ] */ end + +.layer LAYER_3D2C +/* 0x3D2C [0xC6 0x08 ] */ instr SF1_INST_8 +/* 0x3D2E [0xC7 0x81 0x31 0xC8 ] */ portamento 0x81, PITCH_BF4, 200 +/* 0x3D32 [0x7C 0x0A 0x64 ] */ notedv PITCH_A5, 10, 100 +/* 0x3D35 [0xC7 0x81 0x3C 0x9B ] */ portamento 0x81, PITCH_A5, 155 +/* 0x3D39 [0x77 0x3C 0x64 ] */ notedv PITCH_E5, 60, 100 +/* 0x3D3C [0xFF ] */ end + +.channel CHAN_3D3D +/* 0x3D3D [0x88 0x3D 0x47 ] */ ldlayer 0, LAYER_3D47 +/* 0x3D40 [0x89 0x3D 0x52 ] */ ldlayer 1, LAYER_3D52 +/* 0x3D43 [0x8A 0x3D 0x5D ] */ ldlayer 2, LAYER_3D5D +/* 0x3D46 [0xFF ] */ end + +.layer LAYER_3D47 +/* 0x3D47 [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x3D49 [0xC7 0x85 0x0B 0x32 ] */ portamento 0x85, PITCH_AF1, 50 +/* 0x3D4D [0x5B 0x81 0x2C 0x64 ] */ notedv PITCH_C3, 300, 100 +/* 0x3D51 [0xFF ] */ end + +.layer LAYER_3D52 +/* 0x3D52 [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x3D54 [0xC7 0x85 0x0D 0x32 ] */ portamento 0x85, PITCH_BF1, 50 +/* 0x3D58 [0x5D 0x81 0x22 0x64 ] */ notedv PITCH_D3, 290, 100 +/* 0x3D5C [0xFF ] */ end + +.layer LAYER_3D5D +/* 0x3D5D [0xC6 0x01 ] */ instr SF1_INST_1 +/* 0x3D5F [0xC7 0x81 0x0C 0xFF ] */ portamento 0x81, PITCH_A1, 255 +/* 0x3D63 [0x50 0x80 0xC8 0x64 ] */ notedv PITCH_DF2, 200, 100 +/* 0x3D67 [0xFF ] */ end + +.channel CHAN_3D68 +/* 0x3D68 [0xC1 0x05 ] */ instr SF1_INST_5 +/* 0x3D6A [0x88 0x3D 0x75 ] */ ldlayer 0, LAYER_3D75 +/* 0x3D6D [0x89 0x3D 0x73 ] */ ldlayer 1, LAYER_3D73 +/* 0x3D70 [0xED 0x12 ] */ gain 18 +/* 0x3D72 [0xFF ] */ end + +.layer LAYER_3D73 +/* 0x3D73 [0xC2 0x04 ] */ transpose 4 +.layer LAYER_3D75 +/* 0x3D75 [0xC7 0x81 0x03 0xC8 ] */ portamento 0x81, PITCH_C1, 200 +/* 0x3D79 [0x47 0x80 0x8C 0x64 ] */ notedv PITCH_E1, 140, 100 +/* 0x3D7D [0xFF ] */ end + +.channel CHAN_3D7E +/* 0x3D7E [0x88 0x3D 0xB4 ] */ ldlayer 0, LAYER_3DB4 +/* 0x3D81 [0x89 0x3D 0x8F ] */ ldlayer 1, LAYER_3D8F +/* 0x3D84 [0x8A 0x3D 0x91 ] */ ldlayer 2, LAYER_3D91 +/* 0x3D87 [0x8B 0x48 0x29 ] */ ldlayer 3, LAYER_4829 +/* 0x3D8A [0xD7 0x14 ] */ vibfreq 20 +/* 0x3D8C [0xD8 0x32 ] */ vibdepth 50 +/* 0x3D8E [0xFF ] */ end + +.layer LAYER_3D8F +/* 0x3D8F [0xC2 0xFA ] */ transpose -6 +.layer LAYER_3D91 +/* 0x3D91 [0xC6 0x01 ] */ instr SF1_INST_1 +/* 0x3D93 [0xC7 0x85 0x26 0xFF ] */ portamento 0x85, PITCH_B3, 255 +/* 0x3D97 [0x6B 0x1E 0x64 ] */ notedv PITCH_E4, 30, 100 +/* 0x3D9A [0x5A 0x80 0x96 0x64 ] */ notedv PITCH_B2, 150, 100 +/* 0x3D9E [0xC2 0xFB ] */ transpose -5 +/* 0x3DA0 [0xCB 0x69 0xDC 0x7F ] */ env ENVELOPE_69DC, 127 +/* 0x3DA4 [0xC7 0x85 0x1F 0xFF ] */ portamento 0x85, PITCH_E3, 255 +/* 0x3DA8 [0x64 0x3C 0x50 ] */ notedv PITCH_A3, 60, 80 +/* 0x3DAB [0xCB 0x6A 0x3C 0x7F ] */ env ENVELOPE_6A3C, 127 +/* 0x3DAF [0x51 0x80 0xE6 0x50 ] */ notedv PITCH_D2, 230, 80 +/* 0x3DB3 [0xFF ] */ end + +.layer LAYER_3DB4 +/* 0x3DB4 [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x3DB6 [0xCB 0x69 0xCC 0xE6 ] */ env ENVELOPE_69CC, 230 +/* 0x3DBA [0xC7 0x81 0x0F 0x14 ] */ portamento 0x81, PITCH_C2, 20 +/* 0x3DBE [0x5F 0x80 0x96 0x64 ] */ notedv PITCH_E3, 150, 100 +/* 0x3DC2 [0xCB 0x6A 0x2C 0xF0 ] */ env ENVELOPE_6A2C, 240 +/* 0x3DC6 [0xC7 0x81 0x1F 0x64 ] */ portamento 0x81, PITCH_E3, 100 +/* 0x3DCA [0x4F 0x81 0x0E 0x64 ] */ notedv PITCH_C2, 270, 100 +/* 0x3DCE [0xFF ] */ end + +.channel CHAN_3DCF +/* 0x3DCF [0x88 0x3D 0xDF ] */ ldlayer 0, LAYER_3DDF +/* 0x3DD2 [0x89 0x3D 0xEA ] */ ldlayer 1, LAYER_3DEA +/* 0x3DD5 [0x8A 0x3D 0xF5 ] */ ldlayer 2, LAYER_3DF5 +/* 0x3DD8 [0xED 0x14 ] */ gain 20 +/* 0x3DDA [0xD7 0x46 ] */ vibfreq 70 +/* 0x3DDC [0xD8 0x32 ] */ vibdepth 50 +/* 0x3DDE [0xFF ] */ end + +.layer LAYER_3DDF +/* 0x3DDF [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x3DE1 [0xC7 0x81 0x0D 0x32 ] */ portamento 0x81, PITCH_BF1, 50 +/* 0x3DE5 [0x5D 0x81 0x18 0x64 ] */ notedv PITCH_D3, 280, 100 +/* 0x3DE9 [0xFF ] */ end + +.layer LAYER_3DEA +/* 0x3DEA [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x3DEC [0xC7 0x81 0x0B 0x32 ] */ portamento 0x81, PITCH_AF1, 50 +/* 0x3DF0 [0x5B 0x81 0x22 0x64 ] */ notedv PITCH_C3, 290, 100 +/* 0x3DF4 [0xFF ] */ end + +.layer LAYER_3DF5 +/* 0x3DF5 [0xC6 0x01 ] */ instr SF1_INST_1 +/* 0x3DF7 [0xC7 0x81 0x0C 0xFF ] */ portamento 0x81, PITCH_A1, 255 +/* 0x3DFB [0x50 0x80 0xC8 0x64 ] */ notedv PITCH_DF2, 200, 100 +/* 0x3DFF [0xFF ] */ end + +.channel CHAN_3E00 +/* 0x3E00 [0xC1 0x02 ] */ instr SF1_INST_2 +/* 0x3E02 [0x88 0x3E 0x0F ] */ ldlayer 0, LAYER_3E0F +/* 0x3E05 [0x89 0x3E 0x11 ] */ ldlayer 1, LAYER_3E11 +/* 0x3E08 [0xED 0x10 ] */ gain 16 +/* 0x3E0A [0xD7 0x0A ] */ vibfreq 10 +/* 0x3E0C [0xD8 0x14 ] */ vibdepth 20 +/* 0x3E0E [0xFF ] */ end + +.layer LAYER_3E0F +/* 0x3E0F [0xC2 0xF8 ] */ transpose -8 +.layer LAYER_3E11 +/* 0x3E11 [0x53 0xF5 0x30 0x64 ] */ notedv PITCH_E2, 30000, 100 +/* 0x3E15 [0xF4 0xFA ] */ rjump LAYER_3E11 + +.channel CHAN_3E17 +/* 0x3E17 [0xC1 0x28 ] */ instr SF1_INST_40 +/* 0x3E19 [0xDA 0x68 0x2C ] */ env ENVELOPE_682C +/* 0x3E1C [0xED 0x14 ] */ gain 20 +/* 0x3E1E [0x88 0x3E 0x25 ] */ ldlayer 0, LAYER_3E25 +/* 0x3E21 [0x89 0x3E 0x29 ] */ ldlayer 1, LAYER_3E29 +/* 0x3E24 [0xFF ] */ end + +.layer LAYER_3E25 +/* 0x3E25 [0xC2 0x2A ] */ transpose 42 +/* 0x3E27 [0xF4 0x02 ] */ rjump LAYER_3E2B + +.layer LAYER_3E29 +/* 0x3E29 [0xC2 0x30 ] */ transpose 48 +LAYER_3E2B: +/* 0x3E2B [0x73 0x46 0x64 ] */ notedv PITCH_C5, 70, 100 +/* 0x3E2E [0x6C 0x46 0x64 ] */ notedv PITCH_F4, 70, 100 +/* 0x3E31 [0x67 0x46 0x64 ] */ notedv PITCH_C4, 70, 100 +/* 0x3E34 [0x65 0x32 0x64 ] */ notedv PITCH_BF3, 50, 100 +/* 0x3E37 [0x62 0x28 0x64 ] */ notedv PITCH_G3, 40, 100 +/* 0x3E3A [0x5E 0x28 0x64 ] */ notedv PITCH_EF3, 40, 100 +/* 0x3E3D [0x5D 0x1E 0x64 ] */ notedv PITCH_D3, 30, 100 +/* 0x3E40 [0x59 0x1E 0x64 ] */ notedv PITCH_BF2, 30, 100 +/* 0x3E43 [0xFF ] */ end + +.channel CHAN_3E44 +/* 0x3E44 [0xC1 0x01 ] */ instr SF1_INST_1 +/* 0x3E46 [0xDA 0x68 0x3C ] */ env ENVELOPE_683C +/* 0x3E49 [0x88 0x3E 0x60 ] */ ldlayer 0, LAYER_3E60 +/* 0x3E4C [0x89 0x3E 0x56 ] */ ldlayer 1, LAYER_3E56 +/* 0x3E4F [0x8A 0x3E 0x58 ] */ ldlayer 2, LAYER_3E58 +/* 0x3E52 [0x8B 0x48 0x29 ] */ ldlayer 3, LAYER_4829 +/* 0x3E55 [0xFF ] */ end + +.layer LAYER_3E56 +/* 0x3E56 [0xC2 0xF8 ] */ transpose -8 +.layer LAYER_3E58 +/* 0x3E58 [0xC7 0x01 0x26 0x14 ] */ portamento 0x01, PITCH_B3, 20 +/* 0x3E5C [0x6A 0x50 0x64 ] */ notedv PITCH_EF4, 80, 100 +/* 0x3E5F [0xFF ] */ end + +.layer LAYER_3E60 +/* 0x3E60 [0xC7 0x85 0x1F 0x96 ] */ portamento 0x85, PITCH_E3, 150 +/* 0x3E64 [0x67 0x14 0x64 ] */ notedv PITCH_C4, 20, 100 +/* 0x3E67 [0x66 0x46 0x64 ] */ notedv PITCH_B3, 70, 100 +/* 0x3E6A [0xFF ] */ end + +.channel CHAN_3E6B +/* 0x3E6B [0x88 0x3E 0x6F ] */ ldlayer 0, LAYER_3E6F +/* 0x3E6E [0xFF ] */ end + +.layer LAYER_3E6F +/* 0x3E6F [0xC6 0x00 ] */ instr SF1_INST_0 +/* 0x3E71 [0xCB 0x68 0x6C 0xFF ] */ env ENVELOPE_686C, 255 +/* 0x3E75 [0xC2 0x04 ] */ transpose 4 +/* 0x3E77 [0xC7 0x81 0x1A 0x32 ] */ portamento 0x81, PITCH_B2, 50 +/* 0x3E7B [0x7E 0x50 0x64 ] */ notedv PITCH_B5, 80, 100 +/* 0x3E7E [0xFF ] */ end + +.channel CHAN_3E7F +/* 0x3E7F [0xDA 0x68 0x7C ] */ env ENVELOPE_687C +/* 0x3E82 [0x88 0x3E 0x93 ] */ ldlayer 0, LAYER_3E93 +/* 0x3E85 [0x89 0x3E 0x95 ] */ ldlayer 1, LAYER_3E95 +/* 0x3E88 [0x8A 0x3E 0xB4 ] */ ldlayer 2, LAYER_3EB4 +/* 0x3E8B [0x8B 0x48 0x29 ] */ ldlayer 3, LAYER_4829 +/* 0x3E8E [0xD7 0x14 ] */ vibfreq 20 +/* 0x3E90 [0xD8 0x32 ] */ vibdepth 50 +/* 0x3E92 [0xFF ] */ end + +.layer LAYER_3E93 +/* 0x3E93 [0xC2 0xFA ] */ transpose -6 +.layer LAYER_3E95 +/* 0x3E95 [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x3E97 [0xC7 0x85 0x26 0xFF ] */ portamento 0x85, PITCH_B3, 255 +/* 0x3E9B [0x6B 0x1E 0x64 ] */ notedv PITCH_E4, 30, 100 +/* 0x3E9E [0x5A 0x80 0x96 0x64 ] */ notedv PITCH_B2, 150, 100 +/* 0x3EA2 [0xC2 0xFB ] */ transpose -5 +/* 0x3EA4 [0xC7 0x85 0x20 0xFF ] */ portamento 0x85, PITCH_F3, 255 +/* 0x3EA8 [0x67 0x3C 0x50 ] */ notedv PITCH_C4, 60, 80 +/* 0x3EAB [0xCB 0x6A 0x3C 0xC8 ] */ env ENVELOPE_6A3C, 200 +/* 0x3EAF [0x5A 0x80 0xC8 0x50 ] */ notedv PITCH_B2, 200, 80 +/* 0x3EB3 [0xFF ] */ end + +.layer LAYER_3EB4 +/* 0x3EB4 [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x3EB6 [0xCB 0x69 0xCC 0xC8 ] */ env ENVELOPE_69CC, 200 +/* 0x3EBA [0xC7 0x81 0x0F 0x14 ] */ portamento 0x81, PITCH_C2, 20 +/* 0x3EBE [0x5F 0x80 0x96 0x64 ] */ notedv PITCH_E3, 150, 100 +/* 0x3EC2 [0xCB 0x6A 0x2C 0xC8 ] */ env ENVELOPE_6A2C, 200 +/* 0x3EC6 [0xC7 0x81 0x1F 0x64 ] */ portamento 0x81, PITCH_E3, 100 +/* 0x3ECA [0x4F 0x81 0x2C 0x64 ] */ notedv PITCH_C2, 300, 100 +/* 0x3ECE [0xFF ] */ end + +.channel CHAN_3ECF +/* 0x3ECF [0xC1 0x04 ] */ instr SF1_INST_4 +/* 0x3ED1 [0x88 0x3E 0xD8 ] */ ldlayer 0, LAYER_3ED8 +/* 0x3ED4 [0x89 0x3E 0xDA ] */ ldlayer 1, LAYER_3EDA +/* 0x3ED7 [0xFF ] */ end + +.layer LAYER_3ED8 +/* 0x3ED8 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_3EDA +/* 0x3EDA [0xC7 0x81 0x1F 0x40 ] */ portamento 0x81, PITCH_E3, 64 +/* 0x3EDE [0x67 0x32 0x64 ] */ notedv PITCH_C4, 50, 100 +/* 0x3EE1 [0xFF ] */ end + +.channel CHAN_3EE2 +/* 0x3EE2 [0xC1 0x04 ] */ instr SF1_INST_4 +/* 0x3EE4 [0x88 0x3E 0xEB ] */ ldlayer 0, LAYER_3EEB +/* 0x3EE7 [0x89 0x3E 0xED ] */ ldlayer 1, LAYER_3EED +/* 0x3EEA [0xFF ] */ end + +.layer LAYER_3EEB +/* 0x3EEB [0xC2 0xFE ] */ transpose -2 +.layer LAYER_3EED +/* 0x3EED [0xC7 0x81 0x27 0x40 ] */ portamento 0x81, PITCH_C4, 64 +/* 0x3EF1 [0x5F 0x32 0x64 ] */ notedv PITCH_E3, 50, 100 +/* 0x3EF4 [0xFF ] */ end + +.channel CHAN_3EF5 +/* 0x3EF5 [0xC1 0x02 ] */ instr SF1_INST_2 +/* 0x3EF7 [0x88 0x3E 0xFD ] */ ldlayer 0, LAYER_3EFD +/* 0x3EFA [0xED 0x20 ] */ gain 32 +/* 0x3EFC [0xFF ] */ end + +.layer LAYER_3EFD +/* 0x3EFD [0xC7 0x81 0x1F 0x40 ] */ portamento 0x81, PITCH_E3, 64 +/* 0x3F01 [0x67 0x0C 0x64 ] */ notedv PITCH_C4, 12, 100 +/* 0x3F04 [0xFF ] */ end + +.channel CHAN_3F05 +/* 0x3F05 [0x88 0x3F 0x0C ] */ ldlayer 0, LAYER_3F0C +/* 0x3F08 [0x89 0x53 0x20 ] */ ldlayer 1, LAYER_5320 +/* 0x3F0B [0xFF ] */ end + +.layer LAYER_3F0C +/* 0x3F0C [0xC6 0x04 ] */ instr SF1_INST_4 +/* 0x3F0E [0x68 0x20 0x46 ] */ notedv PITCH_DF4, 32, 70 +/* 0x3F11 [0xFF ] */ end + +.channel CHAN_3F12 +/* 0x3F12 [0x88 0x3F 0x16 ] */ ldlayer 0, LAYER_3F16 +/* 0x3F15 [0xFF ] */ end + +.layer LAYER_3F16 +/* 0x3F16 [0xC6 0x10 ] */ instr SF1_INST_16 +/* 0x3F18 [0xC2 0x04 ] */ transpose 4 +/* 0x3F1A [0xC7 0x81 0x33 0xFF ] */ portamento 0x81, PITCH_C5, 255 +/* 0x3F1E [0x7E 0x0A 0x64 ] */ notedv PITCH_B5, 10, 100 +/* 0x3F21 [0xC7 0x81 0x3C 0xFF ] */ portamento 0x81, PITCH_A5, 255 +/* 0x3F25 [0x77 0x19 0x64 ] */ notedv PITCH_E5, 25, 100 +/* 0x3F28 [0xFF ] */ end + +.channel CHAN_3F29 +/* 0x3F29 [0x88 0x3F 0x2D ] */ ldlayer 0, LAYER_3F2D +/* 0x3F2C [0xFF ] */ end + +.layer LAYER_3F2D +/* 0x3F2D [0xC6 0x10 ] */ instr SF1_INST_16 +/* 0x3F2F [0xC7 0x81 0x3B 0xFF ] */ portamento 0x81, PITCH_AF5, 255 +/* 0x3F33 [0x77 0x0A 0x64 ] */ notedv PITCH_E5, 10, 100 +/* 0x3F36 [0xC7 0x81 0x33 0xFF ] */ portamento 0x81, PITCH_C5, 255 +/* 0x3F3A [0x6C 0x1E 0x64 ] */ notedv PITCH_F4, 30, 100 +/* 0x3F3D [0xFF ] */ end + +.channel CHAN_3F3E +/* 0x3F3E [0x88 0x3F 0x49 ] */ ldlayer 0, LAYER_3F49 +/* 0x3F41 [0x89 0x3F 0x4B ] */ ldlayer 1, LAYER_3F4B +/* 0x3F44 [0xD7 0x0A ] */ vibfreq 10 +/* 0x3F46 [0xD8 0x14 ] */ vibdepth 20 +/* 0x3F48 [0xFF ] */ end + +.layer LAYER_3F49 +/* 0x3F49 [0xC2 0xFF ] */ transpose -1 +.layer LAYER_3F4B +/* 0x3F4B [0xC6 0x02 ] */ instr SF1_INST_2 +LAYER_3F4D: +/* 0x3F4D [0x46 0xF5 0x30 0x64 ] */ notedv PITCH_EF1, 30000, 100 +/* 0x3F51 [0xF4 0xFA ] */ rjump LAYER_3F4D + +.channel CHAN_3F53 +/* 0x3F53 [0xC1 0x17 ] */ instr SF1_INST_23 +/* 0x3F55 [0xDA 0x65 0xD8 ] */ env ENVELOPE_65D8 +/* 0x3F58 [0x88 0x3F 0x5F ] */ ldlayer 0, LAYER_3F5F +/* 0x3F5B [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x3F5E [0xFF ] */ end + +.layer LAYER_3F5F +/* 0x3F5F [0xC7 0x81 0x24 0xFF ] */ portamento 0x81, PITCH_A3, 255 +/* 0x3F63 [0x6B 0x0A 0x64 ] */ notedv PITCH_E4, 10, 100 +/* 0x3F66 [0xC7 0x81 0x2C 0xFF ] */ portamento 0x81, PITCH_F4, 255 +/* 0x3F6A [0x66 0x1E 0x64 ] */ notedv PITCH_B3, 30, 100 +/* 0x3F6D [0xFF ] */ end + +.channel CHAN_3F6E +/* 0x3F6E [0x88 0x3F 0x78 ] */ ldlayer 0, LAYER_3F78 +/* 0x3F71 [0x89 0x3F 0x89 ] */ ldlayer 1, LAYER_3F89 +/* 0x3F74 [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x3F77 [0xFF ] */ end + +.layer LAYER_3F78 +/* 0x3F78 [0xC6 0x01 ] */ instr SF1_INST_1 +/* 0x3F7A [0xC7 0x81 0x20 0xFF ] */ portamento 0x81, PITCH_F3, 255 +/* 0x3F7E [0x67 0x0A 0x64 ] */ notedv PITCH_C4, 10, 100 +/* 0x3F81 [0xC7 0x81 0x28 0xFF ] */ portamento 0x81, PITCH_DF4, 255 +/* 0x3F85 [0x62 0x5C 0x64 ] */ notedv PITCH_G3, 92, 100 +/* 0x3F88 [0xFF ] */ end + +.layer LAYER_3F89 +/* 0x3F89 [0xC6 0x17 ] */ instr SF1_INST_23 +/* 0x3F8B [0xC7 0x81 0x2B 0xFF ] */ portamento 0x81, PITCH_E4, 255 +/* 0x3F8F [0x72 0x0F 0x50 ] */ notedv PITCH_B4, 15, 80 +/* 0x3F92 [0xC7 0x81 0x30 0xFF ] */ portamento 0x81, PITCH_A4, 255 +/* 0x3F96 [0x6A 0x24 0x50 ] */ notedv PITCH_EF4, 36, 80 +/* 0x3F99 [0xFF ] */ end + +.channel CHAN_3F9A +/* 0x3F9A [0xC1 0x17 ] */ instr SF1_INST_23 +/* 0x3F9C [0x88 0x3F 0xA7 ] */ ldlayer 0, LAYER_3FA7 +/* 0x3F9F [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x3FA2 [0xD7 0x30 ] */ vibfreq 48 +/* 0x3FA4 [0xD8 0x30 ] */ vibdepth 48 +/* 0x3FA6 [0xFF ] */ end + +.layer LAYER_3FA7 +/* 0x3FA7 [0xC2 0xF6 ] */ transpose -10 +/* 0x3FA9 [0xF4 0xB4 ] */ rjump LAYER_3F5F + +/* 0x3FAB [0xFF ] */ end + +.channel CHAN_3FAC +/* 0x3FAC [0x88 0x3F 0xBA ] */ ldlayer 0, LAYER_3FBA +/* 0x3FAF [0x89 0x3F 0xCB ] */ ldlayer 1, LAYER_3FCB +/* 0x3FB2 [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x3FB5 [0xD7 0x30 ] */ vibfreq 48 +/* 0x3FB7 [0xD8 0x30 ] */ vibdepth 48 +/* 0x3FB9 [0xFF ] */ end + +.layer LAYER_3FBA +/* 0x3FBA [0xC6 0x01 ] */ instr SF1_INST_1 +/* 0x3FBC [0xC7 0x81 0x16 0x7F ] */ portamento 0x81, PITCH_G2, 127 +/* 0x3FC0 [0x68 0x28 0x64 ] */ notedv PITCH_DF4, 40, 100 +/* 0x3FC3 [0xC7 0x81 0x26 0xFF ] */ portamento 0x81, PITCH_B3, 255 +/* 0x3FC7 [0x58 0x7F 0x64 ] */ notedv PITCH_A2, 127, 100 +/* 0x3FCA [0xFF ] */ end + +.layer LAYER_3FCB +/* 0x3FCB [0xC2 0xF4 ] */ transpose -12 +/* 0x3FCD [0xF4 0xBA ] */ rjump LAYER_3F89 + +/* 0x3FCF [0xFF ] */ end + +.channel CHAN_3FD0 +/* 0x3FD0 [0x88 0x48 0x29 ] */ ldlayer 0, LAYER_4829 +/* 0x3FD3 [0x89 0x3F 0xD7 ] */ ldlayer 1, LAYER_3FD7 +/* 0x3FD6 [0xFF ] */ end + +.layer LAYER_3FD7 +/* 0x3FD7 [0xC6 0x13 ] */ instr SF1_INST_19 +/* 0x3FD9 [0xC7 0x81 0x33 0xFF ] */ portamento 0x81, PITCH_C5, 255 +/* 0x3FDD [0x7E 0x0A 0x64 ] */ notedv PITCH_B5, 10, 100 +/* 0x3FE0 [0xC7 0x81 0x3C 0xFF ] */ portamento 0x81, PITCH_A5, 255 +/* 0x3FE4 [0x77 0x14 0x64 ] */ notedv PITCH_E5, 20, 100 +/* 0x3FE7 [0xFF ] */ end + +.channel CHAN_3FE8 +/* 0x3FE8 [0x88 0x3F 0xD7 ] */ ldlayer 0, LAYER_3FD7 +/* 0x3FEB [0xFF ] */ end + +.channel CHAN_3FEC +/* 0x3FEC [0xC1 0x0A ] */ instr SF1_INST_10 +/* 0x3FEE [0x88 0x3F 0xF2 ] */ ldlayer 0, LAYER_3FF2 +/* 0x3FF1 [0xFF ] */ end + +.layer LAYER_3FF2 +/* 0x3FF2 [0xC7 0x81 0x33 0xFF ] */ portamento 0x81, PITCH_C5, 255 +/* 0x3FF6 [0x7E 0x14 0x64 ] */ notedv PITCH_B5, 20, 100 +/* 0x3FF9 [0xC7 0x81 0x3C 0xFF ] */ portamento 0x81, PITCH_A5, 255 +/* 0x3FFD [0x77 0x14 0x64 ] */ notedv PITCH_E5, 20, 100 +/* 0x4000 [0xFF ] */ end + +.channel CHAN_4001 +/* 0x4001 [0x88 0x40 0x0C ] */ ldlayer 0, LAYER_400C +/* 0x4004 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x4007 [0xD7 0x64 ] */ vibfreq 100 +/* 0x4009 [0xD8 0x7F ] */ vibdepth 127 +/* 0x400B [0xFF ] */ end + +.layer LAYER_400C +/* 0x400C [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x400E [0xC4 ] */ legato +/* 0x400F [0xC7 0x85 0x1D 0xFF ] */ portamento 0x85, PITCH_D3, 255 +/* 0x4013 [0x65 0x14 0x64 ] */ notedv PITCH_BF3, 20, 100 +/* 0x4016 [0x59 0x3C 0x64 ] */ notedv PITCH_BF2, 60, 100 +/* 0x4019 [0xFF ] */ end + +.channel CHAN_401A +/* 0x401A [0xC1 0x02 ] */ instr SF1_INST_2 +/* 0x401C [0xDA 0x68 0xDC ] */ env ENVELOPE_68DC +/* 0x401F [0x88 0x40 0x23 ] */ ldlayer 0, LAYER_4023 +/* 0x4022 [0xFF ] */ end + +.layer LAYER_4023 +/* 0x4023 [0xC7 0x81 0x07 0x64 ] */ portamento 0x81, PITCH_E1, 100 +/* 0x4027 [0x4C 0x19 0x64 ] */ notedv PITCH_A1, 25, 100 +/* 0x402A [0xFF ] */ end + +.channel CHAN_402B +/* 0x402B [0xC1 0x03 ] */ instr SF1_INST_3 +/* 0x402D [0xDA 0x68 0xEC ] */ env ENVELOPE_68EC +/* 0x4030 [0x88 0x40 0x38 ] */ ldlayer 0, LAYER_4038 +/* 0x4033 [0xD7 0x64 ] */ vibfreq 100 +/* 0x4035 [0xD8 0x32 ] */ vibdepth 50 +/* 0x4037 [0xFF ] */ end + +.layer LAYER_4038 +/* 0x4038 [0xC7 0x81 0x2D 0xFA ] */ portamento 0x81, PITCH_GF4, 250 +/* 0x403C [0x61 0x28 0x64 ] */ notedv PITCH_GF3, 40, 100 +/* 0x403F [0xFF ] */ end + +.channel CHAN_4040 +/* 0x4040 [0x88 0x40 0x4B ] */ ldlayer 0, LAYER_404B +/* 0x4043 [0x89 0x40 0x57 ] */ ldlayer 1, LAYER_4057 +/* 0x4046 [0xD7 0x32 ] */ vibfreq 50 +/* 0x4048 [0xD8 0x3C ] */ vibdepth 60 +/* 0x404A [0xFF ] */ end + +.layer LAYER_404B +/* 0x404B [0xC6 0x18 ] */ instr SF1_INST_24 +/* 0x404D [0xC2 0x30 ] */ transpose 48 +/* 0x404F [0xC7 0x81 0x20 0x64 ] */ portamento 0x81, PITCH_F3, 100 +/* 0x4053 [0x5D 0x23 0x50 ] */ notedv PITCH_D3, 35, 80 +/* 0x4056 [0xFF ] */ end + +.layer LAYER_4057 +/* 0x4057 [0xC6 0x0F ] */ instr SF1_INST_15 +/* 0x4059 [0xC7 0x81 0x27 0x64 ] */ portamento 0x81, PITCH_C4, 100 +/* 0x405D [0x64 0x28 0x64 ] */ notedv PITCH_A3, 40, 100 +/* 0x4060 [0xFF ] */ end + +.channel CHAN_4061 +/* 0x4061 [0x89 0x40 0x6B ] */ ldlayer 1, LAYER_406B +/* 0x4064 [0x88 0x40 0x77 ] */ ldlayer 0, LAYER_4077 +/* 0x4067 [0x8A 0x40 0x81 ] */ ldlayer 2, LAYER_4081 +/* 0x406A [0xFF ] */ end + +.layer LAYER_406B +/* 0x406B [0xC6 0x18 ] */ instr SF1_INST_24 +/* 0x406D [0xC2 0x30 ] */ transpose 48 +/* 0x406F [0xC7 0x81 0x22 0xC8 ] */ portamento 0x81, PITCH_G3, 200 +/* 0x4073 [0x66 0x23 0x50 ] */ notedv PITCH_B3, 35, 80 +/* 0x4076 [0xFF ] */ end + +.layer LAYER_4077 +/* 0x4077 [0xC6 0x0F ] */ instr SF1_INST_15 +/* 0x4079 [0xC7 0x81 0x27 0xFF ] */ portamento 0x81, PITCH_C4, 255 +/* 0x407D [0x6C 0x32 0x64 ] */ notedv PITCH_F4, 50, 100 +/* 0x4080 [0xFF ] */ end + +.layer LAYER_4081 +/* 0x4081 [0xC6 0x1C ] */ instr SF1_INST_28 +/* 0x4083 [0xCB 0x68 0x2C 0xF0 ] */ env ENVELOPE_682C, 240 +/* 0x4087 [0xC0 0x0A ] */ ldelay 10 +/* 0x4089 [0x69 0x1E 0x64 ] */ notedv PITCH_D4, 30, 100 +/* 0x408C [0xFF ] */ end + +.channel CHAN_408D +/* 0x408D [0xC1 0x00 ] */ instr SF1_INST_0 +/* 0x408F [0xDA 0x68 0x6C ] */ env ENVELOPE_686C +/* 0x4092 [0x88 0x40 0x98 ] */ ldlayer 0, LAYER_4098 +/* 0x4095 [0xED 0x14 ] */ gain 20 +/* 0x4097 [0xFF ] */ end + +.layer LAYER_4098 +/* 0x4098 [0xC2 0x05 ] */ transpose 5 +/* 0x409A [0xC7 0x81 0x1A 0xC8 ] */ portamento 0x81, PITCH_B2, 200 +/* 0x409E [0x7E 0x80 0xC8 0x64 ] */ notedv PITCH_B5, 200, 100 +/* 0x40A2 [0xFF ] */ end + +.channel CHAN_40A3 +/* 0x40A3 [0xC1 0x08 ] */ instr SF1_INST_8 +/* 0x40A5 [0xDA 0x69 0xBC ] */ env ENVELOPE_69BC +/* 0x40A8 [0x88 0x40 0xB0 ] */ ldlayer 0, LAYER_40B0 +/* 0x40AB [0xD7 0x64 ] */ vibfreq 100 +/* 0x40AD [0xD8 0x64 ] */ vibdepth 100 +/* 0x40AF [0xFF ] */ end + +.layer LAYER_40B0 +/* 0x40B0 [0xC7 0x81 0x37 0xFF ] */ portamento 0x81, PITCH_E5, 255 +/* 0x40B4 [0x5B 0x50 0x64 ] */ notedv PITCH_C3, 80, 100 +/* 0x40B7 [0xFF ] */ end + +.channel CHAN_40B8 +/* 0x40B8 [0xC1 0x08 ] */ instr SF1_INST_8 +/* 0x40BA [0x88 0x40 0xC1 ] */ ldlayer 0, LAYER_40C1 +/* 0x40BD [0x89 0x40 0xC3 ] */ ldlayer 1, LAYER_40C3 +/* 0x40C0 [0xFF ] */ end + +.layer LAYER_40C1 +/* 0x40C1 [0xC2 0xFA ] */ transpose -6 +.layer LAYER_40C3 +/* 0x40C3 [0x5B 0x81 0xA0 0x64 ] */ notedv PITCH_C3, 416, 100 +/* 0x40C7 [0xFF ] */ end + +.channel CHAN_40C8 +/* 0x40C8 [0xC1 0x08 ] */ instr SF1_INST_8 +/* 0x40CA [0xDA 0x69 0xFC ] */ env ENVELOPE_69FC +/* 0x40CD [0x88 0x40 0xD3 ] */ ldlayer 0, LAYER_40D3 +/* 0x40D0 [0xED 0x10 ] */ gain 16 +/* 0x40D2 [0xFF ] */ end + +.layer LAYER_40D3 +/* 0x40D3 [0xC7 0x81 0x24 0x64 ] */ portamento 0x81, PITCH_A3, 100 +/* 0x40D7 [0x67 0x78 0x64 ] */ notedv PITCH_C4, 120, 100 +/* 0x40DA [0xFF ] */ end + +.channel CHAN_40DB +/* 0x40DB [0xC1 0x05 ] */ instr SF1_INST_5 +/* 0x40DD [0x88 0x40 0xE3 ] */ ldlayer 0, LAYER_40E3 +/* 0x40E0 [0xED 0x14 ] */ gain 20 +/* 0x40E2 [0xFF ] */ end + +.layer LAYER_40E3 +/* 0x40E3 [0xC7 0x81 0x09 0x80 ] */ portamento 0x81, PITCH_GF1, 128 +/* 0x40E7 [0x4C 0x0F 0x64 ] */ notedv PITCH_A1, 15, 100 +/* 0x40EA [0xFF ] */ end + +.channel CHAN_40EB +/* 0x40EB [0xC1 0x0B ] */ instr SF1_INST_11 +/* 0x40ED [0x88 0x40 0xF8 ] */ ldlayer 0, LAYER_40F8 +/* 0x40F0 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x40F3 [0xD7 0x64 ] */ vibfreq 100 +/* 0x40F5 [0xD8 0x46 ] */ vibdepth 70 +/* 0x40F7 [0xFF ] */ end + +.layer LAYER_40F8 +/* 0x40F8 [0xC4 ] */ legato +/* 0x40F9 [0xC7 0x85 0x2A 0x80 ] */ portamento 0x85, PITCH_EF4, 128 +/* 0x40FD [0x6F 0x1E 0x64 ] */ notedv PITCH_AF4, 30, 100 +/* 0x4100 [0x67 0x28 0x64 ] */ notedv PITCH_C4, 40, 100 +/* 0x4103 [0xFF ] */ end + +.channel CHAN_4104 +/* 0x4104 [0x88 0x41 0x0F ] */ ldlayer 0, LAYER_410F +/* 0x4107 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x410A [0xD7 0x84 ] */ vibfreq 132 +/* 0x410C [0xD8 0x46 ] */ vibdepth 70 +/* 0x410E [0xFF ] */ end + +.layer LAYER_410F +/* 0x410F [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x4111 [0xC4 ] */ legato +/* 0x4112 [0xC7 0x85 0x2E 0x80 ] */ portamento 0x85, PITCH_G4, 128 +/* 0x4116 [0x73 0x28 0x64 ] */ notedv PITCH_C5, 40, 100 +/* 0x4119 [0x6B 0x30 0x64 ] */ notedv PITCH_E4, 48, 100 +/* 0x411C [0xFF ] */ end + +.channel CHAN_411D +/* 0x411D [0xC1 0x19 ] */ instr SF1_INST_25 +/* 0x411F [0xDA 0x6A 0x0C ] */ env ENVELOPE_6A0C +/* 0x4122 [0x88 0x41 0x26 ] */ ldlayer 0, LAYER_4126 +/* 0x4125 [0xFF ] */ end + +.layer LAYER_4126 +/* 0x4126 [0xC4 ] */ legato +/* 0x4127 [0xC7 0x85 0x1F 0xFF ] */ portamento 0x85, PITCH_E3, 255 +/* 0x412B [0x64 0x32 0x64 ] */ notedv PITCH_A3, 50, 100 +/* 0x412E [0x57 0x46 0x64 ] */ notedv PITCH_AF2, 70, 100 +/* 0x4131 [0xFF ] */ end + +.channel CHAN_4132 +/* 0x4132 [0x88 0x41 0x4B ] */ ldlayer 0, LAYER_414B +/* 0x4135 [0x89 0x41 0x39 ] */ ldlayer 1, LAYER_4139 +/* 0x4138 [0xFF ] */ end + +.layer LAYER_4139 +/* 0x4139 [0xC6 0x02 ] */ instr SF1_INST_2 +/* 0x413B [0xCB 0x6A 0x0C 0xDC ] */ env ENVELOPE_6A0C, 220 +/* 0x413F [0xC4 ] */ legato +/* 0x4140 [0xC7 0x85 0x1B 0xC8 ] */ portamento 0x85, PITCH_C3, 200 +/* 0x4144 [0x60 0x14 0x3C ] */ notedv PITCH_F3, 20, 60 +/* 0x4147 [0x53 0x32 0x3C ] */ notedv PITCH_E2, 50, 60 +/* 0x414A [0xFF ] */ end + +.layer LAYER_414B +/* 0x414B [0xC6 0x19 ] */ instr SF1_INST_25 +/* 0x414D [0xCB 0x6A 0x0C 0x80 ] */ env ENVELOPE_6A0C, 128 +/* 0x4151 [0xC4 ] */ legato +/* 0x4152 [0xC7 0x85 0x1F 0xC8 ] */ portamento 0x85, PITCH_E3, 200 +/* 0x4156 [0x64 0x32 0x64 ] */ notedv PITCH_A3, 50, 100 +/* 0x4159 [0x57 0x46 0x64 ] */ notedv PITCH_AF2, 70, 100 +/* 0x415C [0xFF ] */ end + +.channel CHAN_415D +/* 0x415D [0xC1 0x1E ] */ instr SF1_INST_30 +CHAN_415F: +/* 0x415F [0x88 0x41 0x79 ] */ ldlayer 0, LAYER_4179 +CHAN_4162: +/* 0x4162 [0xB8 0x06 ] */ rand 6 +/* 0x4164 [0xC7 0x03 0x41 0x7A ] */ stseq 3, LAYER_4179 + STSEQ_NOTEDV_DELAY_HI +/* 0x4168 [0xC7 0x03 0x41 0x73 ] */ stseq 3, CHAN_4172 + STSEQ_LDI_IMM +/* 0x416C [0xB8 0x08 ] */ rand 8 +/* 0x416E [0xC7 0x5B 0x41 0x79 ] */ stseq (NOTEDV_OPCODE | PITCH_C3), LAYER_4179 + STSEQ_NOTEDV_OPCODE_PITCH +CHAN_4172: +/* 0x4172 [0xCC 0x01 ] */ ldi 1 +/* 0x4174 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x4177 [0xF4 0xE9 ] */ rjump CHAN_4162 + +.layer LAYER_4179 +/* 0x4179 [0x5B 0x50 0x50 ] */ notedv PITCH_C3, 80, 80 +/* 0x417C [0xF4 0xFB ] */ rjump LAYER_4179 + +.channel CHAN_417E +/* 0x417E [0xC1 0x1E ] */ instr SF1_INST_30 +/* 0x4180 [0xD9 0xD0 ] */ releaserate 208 +/* 0x4182 [0xF4 0xDB ] */ rjump CHAN_415F + +.channel CHAN_4184 +/* 0x4184 [0x88 0x48 0x29 ] */ ldlayer 0, LAYER_4829 +/* 0x4187 [0x89 0x41 0x8B ] */ ldlayer 1, LAYER_418B +/* 0x418A [0xFF ] */ end + +.layer LAYER_418B +/* 0x418B [0xC6 0x17 ] */ instr SF1_INST_23 +/* 0x418D [0xC7 0x81 0x20 0xFF ] */ portamento 0x81, PITCH_F3, 255 +/* 0x4191 [0x67 0x0A 0x64 ] */ notedv PITCH_C4, 10, 100 +/* 0x4194 [0xC7 0x81 0x29 0xFF ] */ portamento 0x81, PITCH_D4, 255 +/* 0x4198 [0x60 0x0E 0x64 ] */ notedv PITCH_F3, 14, 100 +/* 0x419B [0xFF ] */ end + +.channel CHAN_419C +/* 0x419C [0x88 0x41 0xA6 ] */ ldlayer 0, LAYER_41A6 +/* 0x419F [0x89 0x41 0xB8 ] */ ldlayer 1, LAYER_41B8 +/* 0x41A2 [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x41A5 [0xFF ] */ end + +.layer LAYER_41A6 +/* 0x41A6 [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x41A8 [0xC4 ] */ legato +/* 0x41A9 [0xC7 0x81 0x20 0x40 ] */ portamento 0x81, PITCH_F3, 64 +/* 0x41AD [0x67 0x14 0x50 ] */ notedv PITCH_C4, 20, 80 +/* 0x41B0 [0xC7 0x81 0x25 0xFF ] */ portamento 0x81, PITCH_BF3, 255 +/* 0x41B4 [0x59 0x24 0x50 ] */ notedv PITCH_BF2, 36, 80 +/* 0x41B7 [0xFF ] */ end + +.layer LAYER_41B8 +/* 0x41B8 [0xC2 0xF8 ] */ transpose -8 +/* 0x41BA [0xF4 0xCF ] */ rjump LAYER_418B + +.channel CHAN_41BC +/* 0x41BC [0x88 0x41 0xC0 ] */ ldlayer 0, LAYER_41C0 +/* 0x41BF [0xFF ] */ end + +.layer LAYER_41C0 +/* 0x41C0 [0xC6 0x2C ] */ instr SF1_INST_44 +/* 0x41C2 [0xCB 0x6A 0x1C 0xF9 ] */ env ENVELOPE_6A1C, 249 +/* 0x41C6 [0xC7 0x81 0x19 0xFF ] */ portamento 0x81, PITCH_BF2, 255 +/* 0x41CA [0x62 0x80 0x90 0x64 ] */ notedv PITCH_G3, 144, 100 +/* 0x41CE [0xFF ] */ end + +.channel CHAN_41CF +/* 0x41CF [0xC1 0x0B ] */ instr SF1_INST_11 +/* 0x41D1 [0xDA 0x69 0xCC ] */ env ENVELOPE_69CC +/* 0x41D4 [0x88 0x41 0xE0 ] */ ldlayer 0, LAYER_41E0 +/* 0x41D7 [0xE1 0x46 0x6E 0x12 ] */ vibfreqgrad 70, 110, 18 +/* 0x41DB [0xE2 0x14 0x50 0x0A ] */ vibdepthgrad 20, 80, 10 +/* 0x41DF [0xFF ] */ end + +.layer LAYER_41E0 +/* 0x41E0 [0xC7 0x81 0x15 0xFF ] */ portamento 0x81, PITCH_GF2, 255 +/* 0x41E4 [0x59 0x80 0xE6 0x64 ] */ notedv PITCH_BF2, 230, 100 +/* 0x41E8 [0xFF ] */ end + +.channel CHAN_41E9 +/* 0x41E9 [0x88 0x41 0xEF ] */ ldlayer 0, LAYER_41EF +/* 0x41EC [0xED 0x16 ] */ gain 22 +/* 0x41EE [0xFF ] */ end + +.layer LAYER_41EF +/* 0x41EF [0xC6 0x1D ] */ instr SF1_INST_29 +/* 0x41F1 [0x67 0x81 0x18 0x64 ] */ notedv PITCH_C4, 280, 100 +/* 0x41F5 [0xFF ] */ end + +.channel CHAN_41F6 +/* 0x41F6 [0xC1 0x1E ] */ instr SF1_INST_30 +/* 0x41F8 [0x88 0x41 0xFE ] */ ldlayer 0, LAYER_41FE +/* 0x41FB [0xED 0x14 ] */ gain 20 +/* 0x41FD [0xFF ] */ end + +.layer LAYER_41FE +/* 0x41FE [0x64 0x50 0x64 ] */ notedv PITCH_A3, 80, 100 +/* 0x4201 [0xFF ] */ end + +.channel CHAN_4202 +/* 0x4202 [0xC1 0x1F ] */ instr SF1_INST_31 +/* 0x4204 [0x88 0x42 0x08 ] */ ldlayer 0, LAYER_4208 +/* 0x4207 [0xFF ] */ end + +.layer LAYER_4208 +/* 0x4208 [0x69 0xF5 0x30 0x64 ] */ notedv PITCH_D4, 30000, 100 +/* 0x420C [0xF4 0xFA ] */ rjump LAYER_4208 + +.channel CHAN_420E +/* 0x420E [0x88 0x42 0x14 ] */ ldlayer 0, LAYER_4214 +/* 0x4211 [0xED 0x18 ] */ gain 24 +/* 0x4213 [0xFF ] */ end + +.layer LAYER_4214 +/* 0x4214 [0xC6 0x20 ] */ instr SF1_INST_32 +/* 0x4216 [0x6C 0x5A 0x64 ] */ notedv PITCH_F4, 90, 100 +/* 0x4219 [0xFF ] */ end + +.channel CHAN_421A +/* 0x421A [0x88 0x42 0x20 ] */ ldlayer 0, LAYER_4220 +/* 0x421D [0xED 0x18 ] */ gain 24 +/* 0x421F [0xFF ] */ end + +.layer LAYER_4220 +/* 0x4220 [0xC6 0x21 ] */ instr SF1_INST_33 +/* 0x4222 [0x69 0x5A 0x64 ] */ notedv PITCH_D4, 90, 100 +/* 0x4225 [0xFF ] */ end + +.channel CHAN_4226 +/* 0x4226 [0xC1 0x24 ] */ instr SF1_INST_36 +/* 0x4228 [0x88 0x42 0x2E ] */ ldlayer 0, LAYER_422E +/* 0x422B [0xED 0x18 ] */ gain 24 +/* 0x422D [0xFF ] */ end + +.layer LAYER_422E +/* 0x422E [0xC7 0x81 0x27 0x32 ] */ portamento 0x81, PITCH_C4, 50 +/* 0x4232 [0x6C 0x30 0x64 ] */ notedv PITCH_F4, 48, 100 +/* 0x4235 [0xFF ] */ end + +.channel CHAN_4236 +/* 0x4236 [0x88 0x42 0x3E ] */ ldlayer 0, LAYER_423E +/* 0x4239 [0xD7 0x80 ] */ vibfreq 128 +/* 0x423B [0xD8 0x80 ] */ vibdepth 128 +/* 0x423D [0xFF ] */ end + +.layer LAYER_423E +/* 0x423E [0xC6 0x02 ] */ instr SF1_INST_2 +/* 0x4240 [0xC4 ] */ legato +/* 0x4241 [0xC7 0x81 0x25 0xFF ] */ portamento 0x81, PITCH_BF3, 255 +LAYER_4245: +/* 0x4245 [0x61 0x80 0xC8 0x64 ] */ notedv PITCH_GF3, 200, 100 +/* 0x4249 [0xF4 0xFA ] */ rjump LAYER_4245 + +.channel CHAN_424B +/* 0x424B [0x88 0x42 0x56 ] */ ldlayer 0, LAYER_4256 +/* 0x424E [0x89 0x4B 0x32 ] */ ldlayer 1, LAYER_4B32 +/* 0x4251 [0xD7 0x80 ] */ vibfreq 128 +/* 0x4253 [0xD8 0x60 ] */ vibdepth 96 +/* 0x4255 [0xFF ] */ end + +.layer LAYER_4256 +/* 0x4256 [0xC6 0x02 ] */ instr SF1_INST_2 +/* 0x4258 [0xC2 0x0C ] */ transpose 12 +/* 0x425A [0xC4 ] */ legato +/* 0x425B [0xF4 0xE8 ] */ rjump LAYER_4245 + +.channel CHAN_425D +/* 0x425D [0x88 0x42 0x61 ] */ ldlayer 0, LAYER_4261 +/* 0x4260 [0xFF ] */ end + +.layer LAYER_4261 +/* 0x4261 [0xC6 0x1D ] */ instr SF1_INST_29 +/* 0x4263 [0x73 0x80 0x8C 0x64 ] */ notedv PITCH_C5, 140, 100 +/* 0x4267 [0xFF ] */ end + +.channel CHAN_4268 +/* 0x4268 [0xC1 0x22 ] */ instr SF1_INST_34 +/* 0x426A [0xDA 0x6A 0x5C ] */ env ENVELOPE_6A5C +/* 0x426D [0x88 0x42 0x73 ] */ ldlayer 0, LAYER_4273 +/* 0x4270 [0xED 0x10 ] */ gain 16 +/* 0x4272 [0xFF ] */ end + +.layer LAYER_4273 +/* 0x4273 [0x5F 0x81 0xC2 0x64 ] */ notedv PITCH_E3, 450, 100 +/* 0x4277 [0xFF ] */ end + +.channel CHAN_4278 +/* 0x4278 [0xC1 0x21 ] */ instr SF1_INST_33 +/* 0x427A [0x88 0x42 0x80 ] */ ldlayer 0, LAYER_4280 +/* 0x427D [0xED 0x14 ] */ gain 20 +/* 0x427F [0xFF ] */ end + +.layer LAYER_4280 +/* 0x4280 [0xC0 0x0F ] */ ldelay 15 +/* 0x4282 [0x67 0x07 0x64 ] */ notedv PITCH_C4, 7, 100 +/* 0x4285 [0x6E 0x07 0x64 ] */ notedv PITCH_G4, 7, 100 +/* 0x4288 [0x73 0x07 0x64 ] */ notedv PITCH_C5, 7, 100 +/* 0x428B [0x7A 0x07 0x64 ] */ notedv PITCH_G5, 7, 100 +/* 0x428E [0x6B 0x07 0x64 ] */ notedv PITCH_E4, 7, 100 +/* 0x4291 [0x72 0x07 0x64 ] */ notedv PITCH_B4, 7, 100 +/* 0x4294 [0x77 0x07 0x64 ] */ notedv PITCH_E5, 7, 100 +/* 0x4297 [0x7E 0x07 0x64 ] */ notedv PITCH_B5, 7, 100 +/* 0x429A [0xFF ] */ end + +.channel CHAN_429B +/* 0x429B [0xC1 0x20 ] */ instr SF1_INST_32 +/* 0x429D [0xDA 0x69 0x9C ] */ env ENVELOPE_699C +/* 0x42A0 [0x88 0x42 0xAA ] */ ldlayer 0, LAYER_42AA +/* 0x42A3 [0xED 0x14 ] */ gain 20 +/* 0x42A5 [0xD7 0x80 ] */ vibfreq 128 +/* 0x42A7 [0xD8 0x14 ] */ vibdepth 20 +/* 0x42A9 [0xFF ] */ end + +.layer LAYER_42AA +/* 0x42AA [0xC7 0x81 0x21 0xFF ] */ portamento 0x81, PITCH_GF3, 255 +/* 0x42AE [0x5C 0x6E 0x64 ] */ notedv PITCH_DF3, 110, 100 +/* 0x42B1 [0xFF ] */ end + +.channel CHAN_42B2 +/* 0x42B2 [0xC1 0x22 ] */ instr SF1_INST_34 +/* 0x42B4 [0x88 0x42 0xB8 ] */ ldlayer 0, LAYER_42B8 +/* 0x42B7 [0xFF ] */ end + +.layer LAYER_42B8 +/* 0x42B8 [0xC7 0x81 0x3C 0xC8 ] */ portamento 0x81, PITCH_A5, 200 +/* 0x42BC [0x5B 0x1E 0x64 ] */ notedv PITCH_C3, 30, 100 +/* 0x42BF [0xFF ] */ end + +.channel CHAN_42C0 +/* 0x42C0 [0xC1 0x23 ] */ instr SF1_INST_35 +/* 0x42C2 [0x88 0x42 0xE9 ] */ ldlayer 0, LAYER_42E9 +/* 0x42C5 [0x89 0x42 0xDD ] */ ldlayer 1, LAYER_42DD +/* 0x42C8 [0x8A 0x42 0xD4 ] */ ldlayer 2, LAYER_42D4 +/* 0x42CB [0xED 0x14 ] */ gain 20 +/* 0x42CD [0xD9 0xF4 ] */ releaserate 244 +/* 0x42CF [0xD7 0x32 ] */ vibfreq 50 +/* 0x42D1 [0xD8 0x1E ] */ vibdepth 30 +/* 0x42D3 [0xFF ] */ end + +.layer LAYER_42D4 +/* 0x42D4 [0xC7 0x81 0x2E 0x64 ] */ portamento 0x81, PITCH_G4, 100 +/* 0x42D8 [0x69 0x80 0xB4 0x64 ] */ notedv PITCH_D4, 180, 100 +/* 0x42DC [0xFF ] */ end + +.layer LAYER_42DD +/* 0x42DD [0xC0 0x80 0x96 ] */ ldelay 150 +/* 0x42E0 [0xC7 0x81 0x24 0xDC ] */ portamento 0x81, PITCH_A3, 220 +/* 0x42E4 [0x5F 0x80 0xD2 0x64 ] */ notedv PITCH_E3, 210, 100 +/* 0x42E8 [0xFF ] */ end + +.layer LAYER_42E9 +/* 0x42E9 [0xC0 0x81 0x4A ] */ ldelay 330 +/* 0x42EC [0xC7 0x81 0x1F 0xC8 ] */ portamento 0x81, PITCH_E3, 200 +/* 0x42F0 [0x58 0x81 0x4A 0x64 ] */ notedv PITCH_A2, 330, 100 +/* 0x42F4 [0xFF ] */ end + +.channel CHAN_42F5 +/* 0x42F5 [0x88 0x43 0x01 ] */ ldlayer 0, LAYER_4301 +/* 0x42F8 [0x89 0x43 0x0F ] */ ldlayer 1, LAYER_430F +/* 0x42FB [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x42FE [0xED 0x14 ] */ gain 20 +/* 0x4300 [0xFF ] */ end + +.layer LAYER_4301 +/* 0x4301 [0xC6 0x23 ] */ instr SF1_INST_35 +/* 0x4303 [0xC4 ] */ legato +/* 0x4304 [0xC7 0x85 0x27 0x64 ] */ portamento 0x85, PITCH_C4, 100 +/* 0x4308 [0x70 0x1E 0x64 ] */ notedv PITCH_A4, 30, 100 +/* 0x430B [0x67 0x3C 0x64 ] */ notedv PITCH_C4, 60, 100 +/* 0x430E [0xFF ] */ end + +.layer LAYER_430F +/* 0x430F [0xC6 0x1E ] */ instr SF1_INST_30 +/* 0x4311 [0xC4 ] */ legato +/* 0x4312 [0xC7 0x81 0x1D 0x64 ] */ portamento 0x81, PITCH_D3, 100 +/* 0x4316 [0x6B 0x14 0x44 ] */ notedv PITCH_E4, 20, 68 +/* 0x4319 [0xC7 0x81 0x22 0xFF ] */ portamento 0x81, PITCH_G3, 255 +/* 0x431D [0x56 0x24 0x44 ] */ notedv PITCH_G2, 36, 68 +/* 0x4320 [0xFF ] */ end + +.channel CHAN_4321 +/* 0x4321 [0x88 0x43 0x28 ] */ ldlayer 0, LAYER_4328 +/* 0x4324 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x4327 [0xFF ] */ end + +.layer LAYER_4328 +/* 0x4328 [0xC2 0xF9 ] */ transpose -7 +/* 0x432A [0xF4 0xD5 ] */ rjump LAYER_4301 + +.channel CHAN_432C +/* 0x432C [0x88 0x43 0x3B ] */ ldlayer 0, LAYER_433B +/* 0x432F [0x89 0x43 0x4A ] */ ldlayer 1, LAYER_434A +/* 0x4332 [0x8A 0x43 0x4C ] */ ldlayer 2, LAYER_434C +/* 0x4335 [0x8B 0x48 0x29 ] */ ldlayer 3, LAYER_4829 +/* 0x4338 [0xED 0x14 ] */ gain 20 +/* 0x433A [0xFF ] */ end + +.layer LAYER_433B +/* 0x433B [0xC6 0x23 ] */ instr SF1_INST_35 +/* 0x433D [0xC4 ] */ legato +/* 0x433E [0xC7 0x85 0x24 0xFF ] */ portamento 0x85, PITCH_A3, 255 +/* 0x4342 [0x6D 0x50 0x64 ] */ notedv PITCH_GF4, 80, 100 +/* 0x4345 [0x57 0x81 0xF4 0x64 ] */ notedv PITCH_AF2, 500, 100 +/* 0x4349 [0xFF ] */ end + +.layer LAYER_434A +/* 0x434A [0xC2 0xF0 ] */ transpose -16 +.layer LAYER_434C +/* 0x434C [0xC6 0x22 ] */ instr SF1_INST_34 +/* 0x434E [0x6F 0x81 0xC2 0x64 ] */ notedv PITCH_AF4, 450, 100 +/* 0x4352 [0xFF ] */ end + +.channel CHAN_4353 +/* 0x4353 [0x88 0x43 0x5A ] */ ldlayer 0, LAYER_435A +/* 0x4356 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x4359 [0xFF ] */ end + +.layer LAYER_435A +/* 0x435A [0xC2 0xF8 ] */ transpose -8 +/* 0x435C [0xF4 0xDD ] */ rjump LAYER_433B + +.channel CHAN_435E +/* 0x435E [0xC1 0x23 ] */ instr SF1_INST_35 +/* 0x4360 [0x88 0x43 0x6C ] */ ldlayer 0, LAYER_436C +/* 0x4363 [0xED 0x14 ] */ gain 20 +/* 0x4365 [0xD9 0xF9 ] */ releaserate 249 +/* 0x4367 [0xD7 0x7F ] */ vibfreq 127 +/* 0x4369 [0xD8 0x46 ] */ vibdepth 70 +/* 0x436B [0xFF ] */ end + +.layer LAYER_436C +/* 0x436C [0xC4 ] */ legato +/* 0x436D [0xC7 0x85 0x1E 0x64 ] */ portamento 0x85, PITCH_EF3, 100 +/* 0x4371 [0x62 0x1E 0x64 ] */ notedv PITCH_G3, 30, 100 +/* 0x4374 [0x5B 0x14 0x64 ] */ notedv PITCH_C3, 20, 100 +/* 0x4377 [0xFF ] */ end + +.channel CHAN_4378 +/* 0x4378 [0xC1 0x2B ] */ instr SF1_INST_43 +/* 0x437A [0x88 0x43 0x80 ] */ ldlayer 0, LAYER_4380 +/* 0x437D [0xED 0x10 ] */ gain 16 +/* 0x437F [0xFF ] */ end + +.layer LAYER_4380 +/* 0x4380 [0x65 0x81 0x60 0x64 ] */ notedv PITCH_BF3, 352, 100 +/* 0x4384 [0xFF ] */ end + +.channel CHAN_4385 +/* 0x4385 [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x4387 [0xDA 0x68 0xEC ] */ env ENVELOPE_68EC +/* 0x438A [0x88 0x43 0x8E ] */ ldlayer 0, LAYER_438E +/* 0x438D [0xFF ] */ end + +.layer LAYER_438E +/* 0x438E [0xC7 0x81 0x1C 0x40 ] */ portamento 0x81, PITCH_DF3, 64 +/* 0x4392 [0x55 0x0D 0x4C ] */ notedv PITCH_GF2, 13, 76 +/* 0x4395 [0xFF ] */ end + +.channel CHAN_4396 +/* 0x4396 [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x4398 [0xDA 0x68 0xEC ] */ env ENVELOPE_68EC +/* 0x439B [0x88 0x43 0x9F ] */ ldlayer 0, LAYER_439F +/* 0x439E [0xFF ] */ end + +.layer LAYER_439F +/* 0x439F [0xC7 0x81 0x20 0x40 ] */ portamento 0x81, PITCH_F3, 64 +/* 0x43A3 [0x59 0x1D 0x64 ] */ notedv PITCH_BF2, 29, 100 +/* 0x43A6 [0xFF ] */ end + +.channel CHAN_43A7 +/* 0x43A7 [0x88 0x43 0xAE ] */ ldlayer 0, LAYER_43AE +/* 0x43AA [0x89 0x43 0xB0 ] */ ldlayer 1, LAYER_43B0 +/* 0x43AD [0xFF ] */ end + +.layer LAYER_43AE +/* 0x43AE [0xC2 0xFB ] */ transpose -5 +.layer LAYER_43B0 +/* 0x43B0 [0xC6 0x0C ] */ instr SF1_INST_12 +/* 0x43B2 [0x4F 0x78 0x64 ] */ notedv PITCH_C2, 120, 100 +/* 0x43B5 [0xFF ] */ end + +.channel CHAN_43B6 +/* 0x43B6 [0xC1 0x26 ] */ instr SF1_INST_38 +/* 0x43B8 [0x88 0x43 0xBC ] */ ldlayer 0, LAYER_43BC +/* 0x43BB [0xFF ] */ end + +.layer LAYER_43BC +/* 0x43BC [0xC7 0x81 0x28 0x64 ] */ portamento 0x81, PITCH_DF4, 100 +/* 0x43C0 [0x6F 0x64 0x50 ] */ notedv PITCH_AF4, 100, 80 +/* 0x43C3 [0xFF ] */ end + +.channel CHAN_43C4 +/* 0x43C4 [0xC1 0x26 ] */ instr SF1_INST_38 +/* 0x43C6 [0x88 0x43 0xCA ] */ ldlayer 0, LAYER_43CA +/* 0x43C9 [0xFF ] */ end + +.layer LAYER_43CA +/* 0x43CA [0xC7 0x81 0x26 0x64 ] */ portamento 0x81, PITCH_B3, 100 +/* 0x43CE [0x5F 0x30 0x64 ] */ notedv PITCH_E3, 48, 100 +/* 0x43D1 [0xFF ] */ end + +.channel CHAN_43D2 +/* 0x43D2 [0x88 0x43 0xD6 ] */ ldlayer 0, LAYER_43D6 +/* 0x43D5 [0xFF ] */ end + +.layer LAYER_43D6 +/* 0x43D6 [0xC6 0x27 ] */ instr SF1_INST_39 +/* 0x43D8 [0x4E 0x66 0x64 ] */ notedv PITCH_B1, 102, 100 +/* 0x43DB [0xFF ] */ end + +.channel CHAN_43DC +/* 0x43DC [0xC1 0x27 ] */ instr SF1_INST_39 +/* 0x43DE [0x88 0x43 0xE2 ] */ ldlayer 0, LAYER_43E2 +/* 0x43E1 [0xFF ] */ end + +.layer LAYER_43E2 +/* 0x43E2 [0xC7 0x81 0x17 0x64 ] */ portamento 0x81, PITCH_AF2, 100 +/* 0x43E6 [0x59 0x30 0x44 ] */ notedv PITCH_BF2, 48, 68 +/* 0x43E9 [0xFF ] */ end + +.channel CHAN_43EA +/* 0x43EA [0xC1 0x26 ] */ instr SF1_INST_38 +/* 0x43EC [0x88 0x43 0xF0 ] */ ldlayer 0, LAYER_43F0 +/* 0x43EF [0xFF ] */ end + +.layer LAYER_43F0 +/* 0x43F0 [0xC7 0x81 0x2F 0x64 ] */ portamento 0x81, PITCH_AF4, 100 +/* 0x43F4 [0x68 0x50 0x50 ] */ notedv PITCH_DF4, 80, 80 +/* 0x43F7 [0xFF ] */ end + +.channel CHAN_43F8 +/* 0x43F8 [0x88 0x43 0xFC ] */ ldlayer 0, LAYER_43FC +/* 0x43FB [0xFF ] */ end + +.layer LAYER_43FC +/* 0x43FC [0xC6 0x28 ] */ instr SF1_INST_40 +/* 0x43FE [0xCB 0x68 0xEC 0xFB ] */ env ENVELOPE_68EC, 251 +/* 0x4402 [0x58 0x2C 0x64 ] */ notedv PITCH_A2, 44, 100 +/* 0x4405 [0xFF ] */ end + +.channel CHAN_4406 +/* 0x4406 [0xC1 0x11 ] */ instr SF1_INST_17 +/* 0x4408 [0x88 0x44 0x0C ] */ ldlayer 0, LAYER_440C +/* 0x440B [0xFF ] */ end + +.layer LAYER_440C +/* 0x440C [0xC7 0x81 0x08 0xFF ] */ portamento 0x81, PITCH_F1, 255 +/* 0x4410 [0x4F 0x06 0x46 ] */ notedv PITCH_C2, 6, 70 +/* 0x4413 [0xC7 0x81 0x0E 0xFF ] */ portamento 0x81, PITCH_B1, 255 +/* 0x4417 [0x4C 0x08 0x46 ] */ notedv PITCH_A1, 8, 70 +/* 0x441A [0xFF ] */ end + +.channel CHAN_441B +/* 0x441B [0x88 0x44 0x23 ] */ ldlayer 0, LAYER_4423 +/* 0x441E [0xD7 0x60 ] */ vibfreq 96 +/* 0x4420 [0xD8 0x80 ] */ vibdepth 128 +/* 0x4422 [0xFF ] */ end + +.layer LAYER_4423 +/* 0x4423 [0xC6 0x1B ] */ instr SF1_INST_27 +/* 0x4425 [0x6B 0x54 0x64 ] */ notedv PITCH_E4, 84, 100 +/* 0x4428 [0xFF ] */ end + +.channel CHAN_4429 +/* 0x4429 [0xC1 0x01 ] */ instr SF1_INST_1 +/* 0x442B [0xDA 0x6A 0x0C ] */ env ENVELOPE_6A0C +/* 0x442E [0x88 0x44 0x3A ] */ ldlayer 0, LAYER_443A +/* 0x4431 [0xE1 0x46 0x6E 0x12 ] */ vibfreqgrad 70, 110, 18 +/* 0x4435 [0xE2 0x14 0x50 0x0A ] */ vibdepthgrad 20, 80, 10 +/* 0x4439 [0xFF ] */ end + +.layer LAYER_443A +/* 0x443A [0xC7 0x81 0x13 0xFF ] */ portamento 0x81, PITCH_E2, 255 +/* 0x443E [0x57 0x46 0x64 ] */ notedv PITCH_AF2, 70, 100 +/* 0x4441 [0xFF ] */ end + +.channel CHAN_4442 +/* 0x4442 [0xC1 0x01 ] */ instr SF1_INST_1 +/* 0x4444 [0xDA 0x6A 0x0C ] */ env ENVELOPE_6A0C +/* 0x4447 [0x88 0x44 0x53 ] */ ldlayer 0, LAYER_4453 +/* 0x444A [0xE1 0x46 0x6E 0x12 ] */ vibfreqgrad 70, 110, 18 +/* 0x444E [0xE2 0x14 0x50 0x0A ] */ vibdepthgrad 20, 80, 10 +/* 0x4452 [0xFF ] */ end + +.layer LAYER_4453 +/* 0x4453 [0xC7 0x81 0x17 0xFF ] */ portamento 0x81, PITCH_AF2, 255 +/* 0x4457 [0x53 0x46 0x64 ] */ notedv PITCH_E2, 70, 100 +/* 0x445A [0xFF ] */ end + +.channel CHAN_445B +/* 0x445B [0xC1 0x0F ] */ instr SF1_INST_15 +/* 0x445D [0x88 0x44 0x63 ] */ ldlayer 0, LAYER_4463 +/* 0x4460 [0xED 0x10 ] */ gain 16 +/* 0x4462 [0xFF ] */ end + +.layer LAYER_4463 +/* 0x4463 [0xC7 0x81 0x11 0xFF ] */ portamento 0x81, PITCH_D2, 255 +/* 0x4467 [0x58 0x80 0x96 0x64 ] */ notedv PITCH_A2, 150, 100 +/* 0x446B [0xFF ] */ end + +.channel CHAN_446C +/* 0x446C [0xC1 0x0D ] */ instr SF1_INST_13 +/* 0x446E [0x88 0x44 0x74 ] */ ldlayer 0, LAYER_4474 +/* 0x4471 [0xED 0x10 ] */ gain 16 +/* 0x4473 [0xFF ] */ end + +.layer LAYER_4474 +/* 0x4474 [0xC7 0x81 0x15 0xFF ] */ portamento 0x81, PITCH_GF2, 255 +/* 0x4478 [0x50 0x44 0x64 ] */ notedv PITCH_DF2, 68, 100 +/* 0x447B [0xFF ] */ end + +.channel CHAN_447C +/* 0x447C [0xC1 0x14 ] */ instr SF1_INST_20 +/* 0x447E [0x88 0x44 0x82 ] */ ldlayer 0, LAYER_4482 +/* 0x4481 [0xFF ] */ end + +.layer LAYER_4482 +/* 0x4482 [0xC2 0x2A ] */ transpose 42 +/* 0x4484 [0x6C 0x0A 0x64 ] */ notedv PITCH_F4, 10, 100 +/* 0x4487 [0xFF ] */ end + +.channel CHAN_4488 +/* 0x4488 [0xC1 0x14 ] */ instr SF1_INST_20 +/* 0x448A [0x88 0x44 0x90 ] */ ldlayer 0, LAYER_4490 +/* 0x448D [0xED 0x14 ] */ gain 20 +/* 0x448F [0xFF ] */ end + +.layer LAYER_4490 +/* 0x4490 [0xC2 0x2C ] */ transpose 44 +/* 0x4492 [0x66 0x1D 0x64 ] */ notedv PITCH_B3, 29, 100 +/* 0x4495 [0xFF ] */ end + +.channel CHAN_4496 +/* 0x4496 [0xC1 0x1C ] */ instr SF1_INST_28 +/* 0x4498 [0x88 0x44 0x9C ] */ ldlayer 0, LAYER_449C +/* 0x449B [0xFF ] */ end + +.layer LAYER_449C +/* 0x449C [0xC7 0x81 0x19 0xFF ] */ portamento 0x81, PITCH_BF2, 255 +/* 0x44A0 [0x54 0x78 0x64 ] */ notedv PITCH_F2, 120, 100 +/* 0x44A3 [0xFF ] */ end + +.channel CHAN_44A4 +/* 0x44A4 [0xC1 0x1C ] */ instr SF1_INST_28 +/* 0x44A6 [0x88 0x44 0xAA ] */ ldlayer 0, LAYER_44AA +/* 0x44A9 [0xFF ] */ end + +.layer LAYER_44AA +/* 0x44AA [0xC7 0x81 0x10 0xFF ] */ portamento 0x81, PITCH_DF2, 255 +/* 0x44AE [0x5A 0x78 0x64 ] */ notedv PITCH_B2, 120, 100 +/* 0x44B1 [0xFF ] */ end + +.channel CHAN_44B2 +/* 0x44B2 [0x88 0x44 0xB9 ] */ ldlayer 0, LAYER_44B9 +/* 0x44B5 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x44B8 [0xFF ] */ end + +.layer LAYER_44B9 +/* 0x44B9 [0xC6 0x0F ] */ instr SF1_INST_15 +/* 0x44BB [0xC4 ] */ legato +/* 0x44BC [0xC7 0x85 0x17 0xC8 ] */ portamento 0x85, PITCH_AF2, 200 +/* 0x44C0 [0x5B 0x1E 0x64 ] */ notedv PITCH_C3, 30, 100 +/* 0x44C3 [0x50 0x3C 0x64 ] */ notedv PITCH_DF2, 60, 100 +/* 0x44C6 [0xFF ] */ end + +.channel CHAN_44C7 +/* 0x44C7 [0xC1 0x28 ] */ instr SF1_INST_40 +/* 0x44C9 [0x88 0x44 0xD7 ] */ ldlayer 0, LAYER_44D7 +/* 0x44CC [0xED 0x14 ] */ gain 20 +/* 0x44CE [0xB8 0x04 ] */ rand 4 +/* 0x44D0 [0xC7 0x6B 0x44 0xD7 ] */ stseq (NOTEDV_OPCODE | PITCH_E4), LAYER_44D7 + STSEQ_NOTEDV_OPCODE_PITCH +/* 0x44D4 [0xD9 0xE8 ] */ releaserate 232 +/* 0x44D6 [0xFF ] */ end + +.layer LAYER_44D7 +/* 0x44D7 [0x6C 0x32 0x64 ] */ notedv PITCH_F4, 50, 100 +/* 0x44DA [0xFF ] */ end + +.channel CHAN_44DB +/* 0x44DB [0x88 0x44 0xEB ] */ ldlayer 0, LAYER_44EB +/* 0x44DE [0x89 0x44 0xE4 ] */ ldlayer 1, LAYER_44E4 +/* 0x44E1 [0xED 0x14 ] */ gain 20 +/* 0x44E3 [0xFF ] */ end + +.layer LAYER_44E4 +/* 0x44E4 [0xC6 0x29 ] */ instr SF1_INST_41 +/* 0x44E6 [0x69 0x80 0xA8 0x64 ] */ notedv PITCH_D4, 168, 100 +/* 0x44EA [0xFF ] */ end + +.layer LAYER_44EB +/* 0x44EB [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x44ED [0xC4 ] */ legato +/* 0x44EE [0xC7 0x81 0x2B 0xFF ] */ portamento 0x81, PITCH_E4, 255 +/* 0x44F2 [0x6D 0x0A 0x64 ] */ notedv PITCH_GF4, 10, 100 +/* 0x44F5 [0xC7 0x81 0x2D 0xFF ] */ portamento 0x81, PITCH_GF4, 255 +/* 0x44F9 [0x70 0x80 0xA8 0x64 ] */ notedv PITCH_A4, 168, 100 +/* 0x44FD [0xFF ] */ end + +.channel CHAN_44FE +/* 0x44FE [0x88 0x45 0x08 ] */ ldlayer 0, LAYER_4508 +/* 0x4501 [0x89 0x45 0x0F ] */ ldlayer 1, LAYER_450F +/* 0x4504 [0x8A 0x45 0x13 ] */ ldlayer 2, LAYER_4513 +/* 0x4507 [0xFF ] */ end + +.layer LAYER_4508 +/* 0x4508 [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x450A [0x6B 0x80 0xB4 0x64 ] */ notedv PITCH_E4, 180, 100 +/* 0x450E [0xFF ] */ end + +.layer LAYER_450F +/* 0x450F [0xC2 0xFE ] */ transpose -2 +/* 0x4511 [0xF4 0xD8 ] */ rjump LAYER_44EB + +.layer LAYER_4513 +/* 0x4513 [0xC2 0x06 ] */ transpose 6 +/* 0x4515 [0xF4 0xCD ] */ rjump LAYER_44E4 + +.channel CHAN_4517 +/* 0x4517 [0x88 0x45 0x32 ] */ ldlayer 0, LAYER_4532 +/* 0x451A [0x89 0x45 0x24 ] */ ldlayer 1, LAYER_4524 +/* 0x451D [0xED 0x14 ] */ gain 20 +/* 0x451F [0xD7 0x78 ] */ vibfreq 120 +/* 0x4521 [0xD8 0x40 ] */ vibdepth 64 +/* 0x4523 [0xFF ] */ end + +.layer LAYER_4524 +/* 0x4524 [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x4526 [0xC4 ] */ legato +/* 0x4527 [0xC7 0x85 0x27 0xFF ] */ portamento 0x85, PITCH_C4, 255 +/* 0x452B [0x6C 0x14 0x50 ] */ notedv PITCH_F4, 20, 80 +/* 0x452E [0x5B 0x6E 0x50 ] */ notedv PITCH_C3, 110, 80 +/* 0x4531 [0xFF ] */ end + +.layer LAYER_4532 +/* 0x4532 [0xC6 0x29 ] */ instr SF1_INST_41 +/* 0x4534 [0xC4 ] */ legato +/* 0x4535 [0xC7 0x85 0x27 0xFF ] */ portamento 0x85, PITCH_C4, 255 +/* 0x4539 [0x70 0x14 0x64 ] */ notedv PITCH_A4, 20, 100 +/* 0x453C [0x4F 0x80 0xC8 0x64 ] */ notedv PITCH_C2, 200, 100 +/* 0x4540 [0xFF ] */ end + +.channel CHAN_4541 +/* 0x4541 [0xC1 0x0B ] */ instr SF1_INST_11 +/* 0x4543 [0xED 0x14 ] */ gain 20 +/* 0x4545 [0x88 0x45 0x49 ] */ ldlayer 0, LAYER_4549 +/* 0x4548 [0xFF ] */ end + +.layer LAYER_4549 +/* 0x4549 [0xC4 ] */ legato +/* 0x454A [0xC7 0x85 0x13 0xFF ] */ portamento 0x85, PITCH_E2, 255 +/* 0x454E [0x55 0x1E 0x64 ] */ notedv PITCH_GF2, 30, 100 +/* 0x4551 [0x4E 0x1E 0x64 ] */ notedv PITCH_B1, 30, 100 +/* 0x4554 [0xFF ] */ end + +.channel CHAN_4555 +/* 0x4555 [0x88 0x45 0x64 ] */ ldlayer 0, LAYER_4564 +/* 0x4558 [0x89 0x45 0x5E ] */ ldlayer 1, LAYER_455E +/* 0x455B [0xED 0x14 ] */ gain 20 +/* 0x455D [0xFF ] */ end + +.layer LAYER_455E +/* 0x455E [0xC6 0x29 ] */ instr SF1_INST_41 +/* 0x4560 [0x6F 0x78 0x64 ] */ notedv PITCH_AF4, 120, 100 +/* 0x4563 [0xFF ] */ end + +.layer LAYER_4564 +/* 0x4564 [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x4566 [0xC4 ] */ legato +/* 0x4567 [0xC7 0x81 0x31 0xFF ] */ portamento 0x81, PITCH_BF4, 255 +/* 0x456B [0x73 0x0A 0x64 ] */ notedv PITCH_C5, 10, 100 +/* 0x456E [0xC7 0x81 0x33 0xFF ] */ portamento 0x81, PITCH_C5, 255 +/* 0x4572 [0x76 0x78 0x64 ] */ notedv PITCH_EF5, 120, 100 +/* 0x4575 [0xFF ] */ end + +.channel CHAN_4576 +/* 0x4576 [0x88 0x45 0x80 ] */ ldlayer 0, LAYER_4580 +/* 0x4579 [0x89 0x45 0x64 ] */ ldlayer 1, LAYER_4564 +/* 0x457C [0x8A 0x45 0x84 ] */ ldlayer 2, LAYER_4584 +/* 0x457F [0xFF ] */ end + +.layer LAYER_4580 +/* 0x4580 [0xC2 0xFA ] */ transpose -6 +/* 0x4582 [0xF4 0xE0 ] */ rjump LAYER_4564 + +.layer LAYER_4584 +/* 0x4584 [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x4586 [0xC4 ] */ legato +/* 0x4587 [0xC7 0x85 0x28 0xC8 ] */ portamento 0x85, PITCH_DF4, 200 +/* 0x458B [0x6F 0x10 0x64 ] */ notedv PITCH_AF4, 16, 100 +/* 0x458E [0x5D 0x80 0xB4 0x64 ] */ notedv PITCH_D3, 180, 100 +/* 0x4592 [0xFF ] */ end + +.channel CHAN_4593 +/* 0x4593 [0x88 0x45 0xA0 ] */ ldlayer 0, LAYER_45A0 +/* 0x4596 [0x89 0x45 0xAC ] */ ldlayer 1, LAYER_45AC +/* 0x4599 [0xED 0x14 ] */ gain 20 +/* 0x459B [0xD7 0x0A ] */ vibfreq 10 +/* 0x459D [0xD8 0x14 ] */ vibdepth 20 +/* 0x459F [0xFF ] */ end + +.layer LAYER_45A0 +/* 0x45A0 [0xC6 0x28 ] */ instr SF1_INST_40 +/* 0x45A2 [0xCB 0x68 0xB4 0xDC ] */ env ENVELOPE_68B4, 220 +LAYER_45A6: +/* 0x45A6 [0x55 0x81 0x18 0x64 ] */ notedv PITCH_GF2, 280, 100 +/* 0x45AA [0xF4 0xFA ] */ rjump LAYER_45A6 + +.layer LAYER_45AC +/* 0x45AC [0xC6 0x02 ] */ instr SF1_INST_2 +LAYER_45AE: +/* 0x45AE [0x42 0xF5 0x30 0x64 ] */ notedv PITCH_B0, 30000, 100 +/* 0x45B2 [0xF4 0xFA ] */ rjump LAYER_45AE + +.channel CHAN_45B4 +/* 0x45B4 [0xC1 0x1C ] */ instr SF1_INST_28 +/* 0x45B6 [0x88 0x45 0xBA ] */ ldlayer 0, LAYER_45BA +/* 0x45B9 [0xFF ] */ end + +.layer LAYER_45BA +/* 0x45BA [0xC7 0x81 0x1C 0xFF ] */ portamento 0x81, PITCH_DF3, 255 +/* 0x45BE [0x67 0x40 0x64 ] */ notedv PITCH_C4, 64, 100 +/* 0x45C1 [0xFF ] */ end + +.channel CHAN_45C2 +/* 0x45C2 [0xC1 0x2A ] */ instr SF1_INST_42 +/* 0x45C4 [0x88 0x45 0xCB ] */ ldlayer 0, LAYER_45CB +/* 0x45C7 [0x89 0x45 0xCD ] */ ldlayer 1, LAYER_45CD +/* 0x45CA [0xFF ] */ end + +.layer LAYER_45CB +/* 0x45CB [0xC0 0x18 ] */ ldelay 24 +.layer LAYER_45CD +/* 0x45CD [0x5F 0x81 0x70 0x50 ] */ notedv PITCH_E3, 368, 80 +/* 0x45D1 [0xFF ] */ end + +.channel CHAN_45D2 +/* 0x45D2 [0x88 0x45 0xD9 ] */ ldlayer 0, LAYER_45D9 +/* 0x45D5 [0x89 0x45 0xDF ] */ ldlayer 1, LAYER_45DF +/* 0x45D8 [0xFF ] */ end + +.layer LAYER_45D9 +/* 0x45D9 [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x45DB [0x68 0x00 0x64 ] */ notedv PITCH_DF4, 0, 100 +/* 0x45DE [0xFF ] */ end + +.layer LAYER_45DF +/* 0x45DF [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x45E1 [0xC7 0x81 0x1E 0xFF ] */ portamento 0x81, PITCH_EF3, 255 +/* 0x45E5 [0x65 0x2E 0x64 ] */ notedv PITCH_BF3, 46, 100 +/* 0x45E8 [0xFF ] */ end + +.channel CHAN_45E9 +/* 0x45E9 [0xC1 0x2A ] */ instr SF1_INST_42 +/* 0x45EB [0x88 0x45 0xF5 ] */ ldlayer 0, LAYER_45F5 +/* 0x45EE [0x89 0x45 0xF7 ] */ ldlayer 1, LAYER_45F7 +/* 0x45F1 [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x45F4 [0xFF ] */ end + +.layer LAYER_45F5 +/* 0x45F5 [0xC0 0x18 ] */ ldelay 24 +.layer LAYER_45F7 +/* 0x45F7 [0xC7 0x81 0x22 0xFF ] */ portamento 0x81, PITCH_G3, 255 +/* 0x45FB [0x53 0x44 0x64 ] */ notedv PITCH_E2, 68, 100 +/* 0x45FE [0xFF ] */ end + +.channel CHAN_45FF +/* 0x45FF [0xC1 0x2A ] */ instr SF1_INST_42 +/* 0x4601 [0x88 0x46 0x0B ] */ ldlayer 0, LAYER_460B +/* 0x4604 [0x89 0x46 0x0D ] */ ldlayer 1, LAYER_460D +/* 0x4607 [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x460A [0xFF ] */ end + +.layer LAYER_460B +/* 0x460B [0xC0 0x18 ] */ ldelay 24 +.layer LAYER_460D +/* 0x460D [0xC4 ] */ legato +/* 0x460E [0xC7 0x85 0x1E 0xFF ] */ portamento 0x85, PITCH_EF3, 255 +/* 0x4612 [0x60 0x1E 0x64 ] */ notedv PITCH_F3, 30, 100 +/* 0x4615 [0x52 0x80 0x84 0x64 ] */ notedv PITCH_EF2, 132, 100 +/* 0x4619 [0xFF ] */ end + +.channel CHAN_461A +/* 0x461A [0xC1 0x2B ] */ instr SF1_INST_43 +/* 0x461C [0xED 0x14 ] */ gain 20 +/* 0x461E [0x88 0x46 0x25 ] */ ldlayer 0, LAYER_4625 +/* 0x4621 [0x89 0x46 0x27 ] */ ldlayer 1, LAYER_4627 +/* 0x4624 [0xFF ] */ end + +.layer LAYER_4625 +/* 0x4625 [0xC0 0x16 ] */ ldelay 22 +.layer LAYER_4627 +/* 0x4627 [0x7D 0x62 0x64 ] */ notedv PITCH_BF5, 98, 100 +/* 0x462A [0xFF ] */ end + +.channel CHAN_462B +/* 0x462B [0xC1 0x00 ] */ instr SF1_INST_0 +/* 0x462D [0xDA 0x68 0x6C ] */ env ENVELOPE_686C +/* 0x4630 [0x88 0x46 0x34 ] */ ldlayer 0, LAYER_4634 +/* 0x4633 [0xFF ] */ end + +.layer LAYER_4634 +/* 0x4634 [0xC7 0x81 0x21 0xC8 ] */ portamento 0x81, PITCH_GF3, 200 +/* 0x4638 [0x6D 0x22 0x64 ] */ notedv PITCH_GF4, 34, 100 +/* 0x463B [0xFF ] */ end + +.channel CHAN_463C +/* 0x463C [0x88 0x46 0x43 ] */ ldlayer 0, LAYER_4643 +/* 0x463F [0x89 0x46 0x51 ] */ ldlayer 1, LAYER_4651 +/* 0x4642 [0xFF ] */ end + +.layer LAYER_4643 +/* 0x4643 [0xC6 0x2A ] */ instr SF1_INST_42 +/* 0x4645 [0xCB 0x68 0xEC 0xFA ] */ env ENVELOPE_68EC, 250 +/* 0x4649 [0xC7 0x81 0x1E 0xFF ] */ portamento 0x81, PITCH_EF3, 255 +/* 0x464D [0x5A 0x30 0x64 ] */ notedv PITCH_B2, 48, 100 +/* 0x4650 [0xFF ] */ end + +.layer LAYER_4651 +/* 0x4651 [0xC6 0x06 ] */ instr SF1_INST_6 +/* 0x4653 [0xCB 0x69 0x2C 0xFA ] */ env ENVELOPE_692C, 250 +/* 0x4657 [0xC7 0x81 0x11 0x32 ] */ portamento 0x81, PITCH_D2, 50 +/* 0x465B [0x45 0x1E 0x64 ] */ notedv PITCH_D1, 30, 100 +/* 0x465E [0xFF ] */ end + +.channel CHAN_465F +/* 0x465F [0xC1 0x2B ] */ instr SF1_INST_43 +/* 0x4661 [0x88 0x46 0x6B ] */ ldlayer 0, LAYER_466B +/* 0x4664 [0x89 0x46 0x6D ] */ ldlayer 1, LAYER_466D +/* 0x4667 [0x8A 0x46 0x6F ] */ ldlayer 2, LAYER_466F +/* 0x466A [0xFF ] */ end + +.layer LAYER_466B +/* 0x466B [0xC0 0x16 ] */ ldelay 22 +.layer LAYER_466D +/* 0x466D [0xC0 0x16 ] */ ldelay 22 +.layer LAYER_466F +/* 0x466F [0x79 0x72 0x64 ] */ notedv PITCH_GF5, 114, 100 +/* 0x4672 [0xFF ] */ end + +.channel CHAN_4673 +/* 0x4673 [0xC1 0x08 ] */ instr SF1_INST_8 +/* 0x4675 [0x88 0x46 0x79 ] */ ldlayer 0, LAYER_4679 +/* 0x4678 [0xFF ] */ end + +.layer LAYER_4679 +/* 0x4679 [0xC7 0x81 0x35 0x78 ] */ portamento 0x81, PITCH_D5, 120 +/* 0x467D [0x6E 0x44 0x64 ] */ notedv PITCH_G4, 68, 100 +/* 0x4680 [0xFF ] */ end + +.channel CHAN_4681 +/* 0x4681 [0xC1 0x0B ] */ instr SF1_INST_11 +/* 0x4683 [0x88 0x46 0x8B ] */ ldlayer 0, LAYER_468B +/* 0x4686 [0xD7 0x14 ] */ vibfreq 20 +/* 0x4688 [0xD8 0x24 ] */ vibdepth 36 +/* 0x468A [0xFF ] */ end + +.layer LAYER_468B +/* 0x468B [0xCB 0x6A 0x4C 0xDC ] */ env ENVELOPE_6A4C, 220 +LAYER_468F: +/* 0x468F [0x4C 0x80 0xFA 0x64 ] */ notedv PITCH_A1, 250, 100 +/* 0x4693 [0xF4 0xFA ] */ rjump LAYER_468F + +.channel CHAN_4695 +/* 0x4695 [0xC1 0x0B ] */ instr SF1_INST_11 +/* 0x4697 [0x88 0x46 0x9F ] */ ldlayer 0, LAYER_469F +/* 0x469A [0xD7 0x7F ] */ vibfreq 127 +/* 0x469C [0xD8 0x54 ] */ vibdepth 84 +/* 0x469E [0xFF ] */ end + +.layer LAYER_469F +/* 0x469F [0xCB 0x6A 0x2C 0xDC ] */ env ENVELOPE_6A2C, 220 +/* 0x46A3 [0xC7 0x81 0x0C 0x78 ] */ portamento 0x81, PITCH_A1, 120 +LAYER_46A7: +/* 0x46A7 [0x64 0x80 0xD0 0x64 ] */ notedv PITCH_A3, 208, 100 +/* 0x46AB [0xF4 0xFA ] */ rjump LAYER_46A7 + +.channel CHAN_46AD +/* 0x46AD [0xC1 0x0B ] */ instr SF1_INST_11 +/* 0x46AF [0x88 0x46 0xB7 ] */ ldlayer 0, LAYER_46B7 +/* 0x46B2 [0xD7 0x14 ] */ vibfreq 20 +/* 0x46B4 [0xD8 0x24 ] */ vibdepth 36 +/* 0x46B6 [0xFF ] */ end + +.layer LAYER_46B7 +/* 0x46B7 [0xCB 0x69 0xBC 0xEB ] */ env ENVELOPE_69BC, 235 +/* 0x46BB [0xC4 ] */ legato +/* 0x46BC [0xC7 0x85 0x00 0xFF ] */ portamento 0x85, PITCH_A0, 255 +/* 0x46C0 [0x58 0x2A 0x64 ] */ notedv PITCH_A2, 42, 100 +/* 0x46C3 [0x40 0x52 0x64 ] */ notedv PITCH_A0, 82, 100 +/* 0x46C6 [0xFF ] */ end + +.channel CHAN_46C7 +/* 0x46C7 [0xC1 0x1A ] */ instr SF1_INST_26 +/* 0x46C9 [0x88 0x46 0xCF ] */ ldlayer 0, LAYER_46CF +/* 0x46CC [0xED 0x10 ] */ gain 16 +/* 0x46CE [0xFF ] */ end + +.layer LAYER_46CF +/* 0x46CF [0xC7 0x81 0x1E 0xFF ] */ portamento 0x81, PITCH_EF3, 255 +/* 0x46D3 [0x5B 0x72 0x64 ] */ notedv PITCH_C3, 114, 100 +/* 0x46D6 [0xFF ] */ end + +.channel CHAN_46D7 +/* 0x46D7 [0xC1 0x0F ] */ instr SF1_INST_15 +/* 0x46D9 [0xDA 0x68 0xFC ] */ env ENVELOPE_68FC +/* 0x46DC [0x88 0x46 0xE0 ] */ ldlayer 0, LAYER_46E0 +/* 0x46DF [0xFF ] */ end + +.layer LAYER_46E0 +/* 0x46E0 [0xC7 0x81 0x11 0xFF ] */ portamento 0x81, PITCH_D2, 255 +/* 0x46E4 [0x59 0x08 0x64 ] */ notedv PITCH_BF2, 8, 100 +/* 0x46E7 [0xC7 0x81 0x1A 0xFF ] */ portamento 0x81, PITCH_B2, 255 +/* 0x46EB [0x46 0x0C 0x64 ] */ notedv PITCH_EF1, 12, 100 +/* 0x46EE [0xFF ] */ end + +.channel CHAN_46EF +/* 0x46EF [0xC1 0x0F ] */ instr SF1_INST_15 +/* 0x46F1 [0x88 0x46 0xFC ] */ ldlayer 0, LAYER_46FC +/* 0x46F4 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x46F7 [0xD7 0x64 ] */ vibfreq 100 +/* 0x46F9 [0xD8 0x64 ] */ vibdepth 100 +/* 0x46FB [0xFF ] */ end + +.layer LAYER_46FC +/* 0x46FC [0xC7 0x81 0x26 0xFF ] */ portamento 0x81, PITCH_B3, 255 +/* 0x4700 [0x62 0x80 0x84 0x64 ] */ notedv PITCH_G3, 132, 100 +/* 0x4704 [0xFF ] */ end + +.channel CHAN_4705 +/* 0x4705 [0xC1 0x2C ] */ instr SF1_INST_44 +/* 0x4707 [0x88 0x47 0x0D ] */ ldlayer 0, LAYER_470D +/* 0x470A [0xDC 0x00 ] */ panweight 0 +/* 0x470C [0xFF ] */ end + +.layer LAYER_470D +/* 0x470D [0xC4 ] */ legato +/* 0x470E [0xC7 0x85 0x17 0xFF ] */ portamento 0x85, PITCH_AF2, 255 +LAYER_4712: +/* 0x4712 [0x54 0x2C 0x64 ] */ notedv PITCH_F2, 44, 100 +/* 0x4715 [0x57 0x2C 0x64 ] */ notedv PITCH_AF2, 44, 100 +/* 0x4718 [0xF4 0xF8 ] */ rjump LAYER_4712 + +.channel CHAN_471A +/* 0x471A [0xC1 0x2C ] */ instr SF1_INST_44 +/* 0x471C [0xDA 0x6A 0x1C ] */ env ENVELOPE_6A1C +/* 0x471F [0x88 0x47 0x2A ] */ ldlayer 0, LAYER_472A +/* 0x4722 [0x89 0x47 0x2C ] */ ldlayer 1, LAYER_472C +/* 0x4725 [0xDC 0x00 ] */ panweight 0 +/* 0x4727 [0xED 0x14 ] */ gain 20 +/* 0x4729 [0xFF ] */ end + +.layer LAYER_472A +/* 0x472A [0xC0 0x08 ] */ ldelay 8 +.layer LAYER_472C +/* 0x472C [0xC7 0x81 0x1F 0xFF ] */ portamento 0x81, PITCH_E3, 255 +/* 0x4730 [0x5C 0x74 0x64 ] */ notedv PITCH_DF3, 116, 100 +/* 0x4733 [0xFF ] */ end + +.channel CHAN_4734 +/* 0x4734 [0x88 0x47 0x3B ] */ ldlayer 0, LAYER_473B +/* 0x4737 [0x89 0x47 0x42 ] */ ldlayer 1, LAYER_4742 +/* 0x473A [0xFF ] */ end + +.layer LAYER_473B +/* 0x473B [0xC6 0x26 ] */ instr SF1_INST_38 +/* 0x473D [0x69 0x80 0x86 0x64 ] */ notedv PITCH_D4, 134, 100 +/* 0x4741 [0xFF ] */ end + +.layer LAYER_4742 +/* 0x4742 [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x4744 [0xC4 ] */ legato +/* 0x4745 [0xC7 0x81 0x24 0x64 ] */ portamento 0x81, PITCH_A3, 100 +/* 0x4749 [0x72 0x10 0x50 ] */ notedv PITCH_B4, 16, 80 +/* 0x474C [0xC7 0x81 0x29 0xFF ] */ portamento 0x81, PITCH_D4, 255 +/* 0x4750 [0x5D 0x06 0x50 ] */ notedv PITCH_D3, 6, 80 +/* 0x4753 [0xFF ] */ end + +.channel CHAN_4754 +/* 0x4754 [0x88 0x47 0x81 ] */ ldlayer 0, LAYER_4781 +/* 0x4757 [0x89 0x47 0x9D ] */ ldlayer 1, LAYER_479D +/* 0x475A [0xD8 0x90 ] */ vibdepth 144 +/* 0x475C [0xD7 0xC4 ] */ vibfreq 196 +/* 0x475E [0xCC 0x38 ] */ ldi 56 +/* 0x4760 [0x76 ] */ stio IO_PORT_6 +CHAN_4761: +/* 0x4761 [0x66 ] */ ldio IO_PORT_6 +/* 0x4762 [0xC7 0x00 0x47 0x89 ] */ stseq 0, LAYER_4788 + STSEQ_NOTEDV_DELAY_HI +/* 0x4766 [0xC7 0x00 0x47 0x8C ] */ stseq 0, LAYER_478B + STSEQ_NOTEDV_DELAY_HI +/* 0x476A [0xC7 0x00 0x47 0x95 ] */ stseq 0, LAYER_4794 + STSEQ_NOTEDV_DELAY_HI +/* 0x476E [0xC7 0x00 0x47 0x98 ] */ stseq 0, LAYER_4797 + STSEQ_NOTEDV_DELAY_HI +/* 0x4772 [0xC8 0x01 ] */ sub 1 +/* 0x4774 [0x76 ] */ stio IO_PORT_6 +/* 0x4775 [0xC8 0x04 ] */ sub 4 +/* 0x4777 [0xF3 0x07 ] */ rbeqz CHAN_4780 +/* 0x4779 [0xCC 0x06 ] */ ldi 6 +/* 0x477B [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x477E [0xF4 0xE1 ] */ rjump CHAN_4761 + +CHAN_4780: +/* 0x4780 [0xFF ] */ end + +.layer LAYER_4781 +/* 0x4781 [0xC6 0x0B ] */ instr SF1_INST_11 +LAYER_4783: +/* 0x4783 [0xC4 ] */ legato +/* 0x4784 [0xC7 0x85 0x25 0xFF ] */ portamento 0x85, PITCH_BF3, 255 +LAYER_4788: +/* 0x4788 [0x6A 0x1E 0x64 ] */ notedv PITCH_EF4, 30, 100 +LAYER_478B: +/* 0x478B [0x62 0x1E 0x64 ] */ notedv PITCH_G3, 30, 100 +/* 0x478E [0xC5 ] */ nolegato +/* 0x478F [0xC4 ] */ legato +/* 0x4790 [0xC7 0x85 0x22 0xFF ] */ portamento 0x85, PITCH_G3, 255 +LAYER_4794: +/* 0x4794 [0x71 0x1E 0x64 ] */ notedv PITCH_BF4, 30, 100 +LAYER_4797: +/* 0x4797 [0x65 0x1E 0x64 ] */ notedv PITCH_BF3, 30, 100 +/* 0x479A [0xC5 ] */ nolegato +/* 0x479B [0xF4 0xE6 ] */ rjump LAYER_4783 + +.layer LAYER_479D +/* 0x479D [0xC6 0x2A ] */ instr SF1_INST_42 +/* 0x479F [0xC7 0x85 0x23 0xFF ] */ portamento 0x85, PITCH_AF3, 255 +/* 0x47A3 [0x68 0x80 0xE8 0x64 ] */ notedv PITCH_DF4, 232, 100 +/* 0x47A7 [0xFF ] */ end + +.channel CHAN_47A8 +/* 0x47A8 [0xC1 0x2C ] */ instr SF1_INST_44 +/* 0x47AA [0x88 0x47 0xAE ] */ ldlayer 0, LAYER_47AE +/* 0x47AD [0xFF ] */ end + +.layer LAYER_47AE +/* 0x47AE [0xC4 ] */ legato +/* 0x47AF [0xC7 0x85 0x19 0x80 ] */ portamento 0x85, PITCH_BF2, 128 +LAYER_47B3: +/* 0x47B3 [0x76 0x0C 0x64 ] */ notedv PITCH_EF5, 12, 100 +/* 0x47B6 [0x59 0x0C 0x64 ] */ notedv PITCH_BF2, 12, 100 +/* 0x47B9 [0xF4 0xF8 ] */ rjump LAYER_47B3 + +.channel CHAN_47BB +/* 0x47BB [0xC1 0x2C ] */ instr SF1_INST_44 +/* 0x47BD [0xDA 0x69 0x9C ] */ env ENVELOPE_699C +/* 0x47C0 [0x88 0x47 0xC9 ] */ ldlayer 0, LAYER_47C9 +/* 0x47C3 [0x89 0x47 0xCB ] */ ldlayer 1, LAYER_47CB +/* 0x47C6 [0xED 0x14 ] */ gain 20 +/* 0x47C8 [0xFF ] */ end + +.layer LAYER_47C9 +/* 0x47C9 [0xC0 0x08 ] */ ldelay 8 +.layer LAYER_47CB +/* 0x47CB [0xC7 0x81 0x1F 0xFF ] */ portamento 0x81, PITCH_E3, 255 +/* 0x47CF [0x5A 0x60 0x64 ] */ notedv PITCH_B2, 96, 100 +/* 0x47D2 [0xFF ] */ end + +.channel CHAN_47D3 +/* 0x47D3 [0x88 0x47 0xDC ] */ ldlayer 0, LAYER_47DC +/* 0x47D6 [0x89 0x47 0xE2 ] */ ldlayer 1, LAYER_47E2 +/* 0x47D9 [0xED 0x16 ] */ gain 22 +/* 0x47DB [0xFF ] */ end + +.layer LAYER_47DC +/* 0x47DC [0xC6 0x2D ] */ instr SF1_INST_45 +/* 0x47DE [0x67 0x56 0x64 ] */ notedv PITCH_C4, 86, 100 +/* 0x47E1 [0xFF ] */ end + +.layer LAYER_47E2 +/* 0x47E2 [0xC6 0x05 ] */ instr SF1_INST_5 +/* 0x47E4 [0xC7 0x81 0x0B 0xC8 ] */ portamento 0x81, PITCH_AF1, 200 +/* 0x47E8 [0x4F 0x29 0x64 ] */ notedv PITCH_C2, 41, 100 +/* 0x47EB [0xFF ] */ end + +.channel CHAN_47EC +/* 0x47EC [0x88 0x47 0xF2 ] */ ldlayer 0, LAYER_47F2 +/* 0x47EF [0xED 0x16 ] */ gain 22 +/* 0x47F1 [0xFF ] */ end + +.layer LAYER_47F2 +/* 0x47F2 [0xC6 0x05 ] */ instr SF1_INST_5 +/* 0x47F4 [0xC7 0x81 0x09 0xC8 ] */ portamento 0x81, PITCH_GF1, 200 +/* 0x47F8 [0x4D 0x29 0x64 ] */ notedv PITCH_BF1, 41, 100 +/* 0x47FB [0xFF ] */ end + +.channel CHAN_47FC +/* 0x47FC [0x88 0x48 0x00 ] */ ldlayer 0, LAYER_4800 +/* 0x47FF [0xFF ] */ end + +.layer LAYER_4800 +/* 0x4800 [0xC6 0x2E ] */ instr SF1_INST_46 +/* 0x4802 [0x61 0x20 0x64 ] */ notedv PITCH_GF3, 32, 100 +/* 0x4805 [0xFF ] */ end + +.channel CHAN_4806 +/* 0x4806 [0x88 0x48 0x0A ] */ ldlayer 0, LAYER_480A +/* 0x4809 [0xFF ] */ end + +.layer LAYER_480A +/* 0x480A [0xC6 0x2E ] */ instr SF1_INST_46 +/* 0x480C [0xC2 0x30 ] */ transpose 48 +/* 0x480E [0x65 0x80 0x84 0x64 ] */ notedv PITCH_BF3, 132, 100 +/* 0x4812 [0xFF ] */ end + +.channel CHAN_4813 +/* 0x4813 [0xED 0x10 ] */ gain 16 +/* 0x4815 [0x88 0x48 0x1C ] */ ldlayer 0, LAYER_481C +/* 0x4818 [0x89 0x50 0x95 ] */ ldlayer 1, LAYER_5095 +/* 0x481B [0xFF ] */ end + +.layer LAYER_481C +/* 0x481C [0xC6 0x2D ] */ instr SF1_INST_45 +/* 0x481E [0xC7 0x81 0x23 0xFF ] */ portamento 0x81, PITCH_AF3, 255 +/* 0x4822 [0x5F 0x30 0x64 ] */ notedv PITCH_E3, 48, 100 +/* 0x4825 [0xFF ] */ end + +.channel CHAN_4826 +/* 0x4826 [0x88 0x48 0x29 ] */ ldlayer 0, LAYER_4829 + //! @bug missing end, causes overlapping layer and channel sections + +.layer LAYER_4829 // +/* 0x4829 [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX /* font 126 */ +/* 0x482B [0x67 0x00 0x64 ] */ notedv PITCH_C4, 0, 100 /* ldio IO_PORT_7 */ + /* cdelay 0 */ + /* ldio IO_PORT_4 */ +/* 0x482E [0xFF ] */ end /* end */ + +.channel CHAN_482F +/* 0x482F [0x88, 0x48, 0x33 ] */ ldlayer 0, LAYER_4833 +/* 0x4832 [0xFF ] */ end + +.layer LAYER_4833 +/* 0x4833 [0xC6, 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x4835 [0x57, 0x00, 0x64 ] */ notedv PITCH_AF2, 0, 100 +/* 0x4838 [0xFF ] */ end + +.channel CHAN_4839 +/* 0x4839 [0x88 0x48 0x46 ] */ ldlayer 0, LAYER_4846 +/* 0x483C [0x89 0x48 0x50 ] */ ldlayer 1, LAYER_4850 +/* 0x483F [0xED 0x10 ] */ gain 16 +/* 0x4841 [0xD7 0x64 ] */ vibfreq 100 +/* 0x4843 [0xD8 0x64 ] */ vibdepth 100 +/* 0x4845 [0xFF ] */ end + +.layer LAYER_4846 +/* 0x4846 [0xC6 0x0F ] */ instr SF1_INST_15 +/* 0x4848 [0xC7 0x81 0x0F 0xFF ] */ portamento 0x81, PITCH_C2, 255 +/* 0x484C [0x4B 0x54 0x64 ] */ notedv PITCH_AF1, 84, 100 +/* 0x484F [0xFF ] */ end + +.layer LAYER_4850 +/* 0x4850 [0xC6 0x23 ] */ instr SF1_INST_35 +/* 0x4852 [0xC4 ] */ legato +/* 0x4853 [0xC7 0x85 0x18 0x64 ] */ portamento 0x85, PITCH_A2, 100 +/* 0x4857 [0x5D 0x1E 0x64 ] */ notedv PITCH_D3, 30, 100 +/* 0x485A [0x58 0x2E 0x64 ] */ notedv PITCH_A2, 46, 100 +/* 0x485D [0xFF ] */ end + +.channel CHAN_485E +/* 0x485E [0xC1 0x26 ] */ instr SF1_INST_38 +/* 0x4860 [0x88 0x48 0x70 ] */ ldlayer 0, LAYER_4870 +CHAN_4863: +/* 0x4863 [0xB8 0x04 ] */ rand 4 +/* 0x4865 [0xC7 0x60 0x48 0x70 ] */ stseq (NOTEDV_OPCODE | PITCH_F3), LAYER_4870 + STSEQ_NOTEDV_OPCODE_PITCH +/* 0x4869 [0xCC 0x12 ] */ ldi 18 +/* 0x486B [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x486E [0xF4 0xF3 ] */ rjump CHAN_4863 + +.layer LAYER_4870 +/* 0x4870 [0x60 0x12 0x64 ] */ notedv PITCH_F3, 18, 100 +/* 0x4873 [0xF4 0xFB ] */ rjump LAYER_4870 + +.channel CHAN_4875 +/* 0x4875 [0xC1 0x2E ] */ instr SF1_INST_46 +/* 0x4877 [0x88 0x48 0x7F ] */ ldlayer 0, LAYER_487F +/* 0x487A [0xED 0x12 ] */ gain 18 +/* 0x487C [0xD9 0xF9 ] */ releaserate 249 +/* 0x487E [0xFF ] */ end + +.layer LAYER_487F +/* 0x487F [0x5C 0x08 0x64 ] */ notedv PITCH_DF3, 8, 100 +/* 0x4882 [0x59 0x1E 0x64 ] */ notedv PITCH_BF2, 30, 100 +/* 0x4885 [0xFF ] */ end + +.channel CHAN_4886 +/* 0x4886 [0x88 0x48 0x96 ] */ ldlayer 0, LAYER_4896 +/* 0x4889 [0x89 0x48 0xA4 ] */ ldlayer 1, LAYER_48A4 +/* 0x488C [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x488F [0xED 0x10 ] */ gain 16 +/* 0x4891 [0xD7 0x64 ] */ vibfreq 100 +/* 0x4893 [0xD8 0x64 ] */ vibdepth 100 +/* 0x4895 [0xFF ] */ end + +.layer LAYER_4896 +/* 0x4896 [0xC6 0x0F ] */ instr SF1_INST_15 +/* 0x4898 [0xC4 ] */ legato +/* 0x4899 [0xC7 0x85 0x19 0xFF ] */ portamento 0x85, PITCH_BF2, 255 +/* 0x489D [0x5C 0x18 0x64 ] */ notedv PITCH_DF3, 24, 100 +/* 0x48A0 [0x49 0x1C 0x64 ] */ notedv PITCH_GF1, 28, 100 +/* 0x48A3 [0xFF ] */ end + +.layer LAYER_48A4 +/* 0x48A4 [0xC6 0x23 ] */ instr SF1_INST_35 +/* 0x48A6 [0xC4 ] */ legato +/* 0x48A7 [0xC7 0x85 0x1E 0x64 ] */ portamento 0x85, PITCH_EF3, 100 +/* 0x48AB [0x63 0x0C 0x64 ] */ notedv PITCH_AF3, 12, 100 +/* 0x48AE [0x5E 0x12 0x64 ] */ notedv PITCH_EF3, 18, 100 +/* 0x48B1 [0xFF ] */ end + +.channel CHAN_48B2 +/* 0x48B2 [0xC1 0x26 ] */ instr SF1_INST_38 +/* 0x48B4 [0x88 0x48 0xB8 ] */ ldlayer 0, LAYER_48B8 +/* 0x48B7 [0xFF ] */ end + +.layer LAYER_48B8 +/* 0x48B8 [0xC7 0x81 0x2F 0x64 ] */ portamento 0x81, PITCH_AF4, 100 +/* 0x48BC [0x68 0x12 0x64 ] */ notedv PITCH_DF4, 18, 100 +/* 0x48BF [0xC7 0x81 0x2F 0x64 ] */ portamento 0x81, PITCH_AF4, 100 +/* 0x48C3 [0x68 0x12 0x64 ] */ notedv PITCH_DF4, 18, 100 +/* 0x48C6 [0xC7 0x81 0x2F 0x64 ] */ portamento 0x81, PITCH_AF4, 100 +/* 0x48CA [0x68 0x12 0x64 ] */ notedv PITCH_DF4, 18, 100 +/* 0x48CD [0xC7 0x81 0x2F 0x64 ] */ portamento 0x81, PITCH_AF4, 100 +/* 0x48D1 [0x68 0x50 0x64 ] */ notedv PITCH_DF4, 80, 100 +/* 0x48D4 [0xFF ] */ end + +.channel CHAN_48D5 +/* 0x48D5 [0x88 0x48 0xE5 ] */ ldlayer 0, LAYER_48E5 +/* 0x48D8 [0x89 0x48 0xA4 ] */ ldlayer 1, LAYER_48A4 +/* 0x48DB [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x48DE [0xED 0x10 ] */ gain 16 +/* 0x48E0 [0xD7 0x64 ] */ vibfreq 100 +/* 0x48E2 [0xD8 0x64 ] */ vibdepth 100 +/* 0x48E4 [0xFF ] */ end + +.layer LAYER_48E5 +/* 0x48E5 [0xC6 0x0F ] */ instr SF1_INST_15 +/* 0x48E7 [0xC7 0x85 0x1B 0xFF ] */ portamento 0x85, PITCH_C3, 255 +/* 0x48EB [0x63 0x18 0x64 ] */ notedv PITCH_AF3, 24, 100 +/* 0x48EE [0x4B 0x66 0x64 ] */ notedv PITCH_AF1, 102, 100 +/* 0x48F1 [0xFF ] */ end + +.channel CHAN_48F2 +/* 0x48F2 [0x88 0x48 0xFC ] */ ldlayer 0, LAYER_48FC +/* 0x48F5 [0xED 0x12 ] */ gain 18 +/* 0x48F7 [0xD7 0x64 ] */ vibfreq 100 +/* 0x48F9 [0xD8 0x64 ] */ vibdepth 100 +/* 0x48FB [0xFF ] */ end + +.layer LAYER_48FC +/* 0x48FC [0xC6 0x23 ] */ instr SF1_INST_35 +/* 0x48FE [0xC7 0x85 0x2A 0x64 ] */ portamento 0x85, PITCH_EF4, 100 +/* 0x4902 [0x5E 0x70 0x64 ] */ notedv PITCH_EF3, 112, 100 +/* 0x4905 [0xFF ] */ end + +.channel CHAN_4906 +/* 0x4906 [0xC1 0x0B ] */ instr SF1_INST_11 +/* 0x4908 [0x88 0x49 0x13 ] */ ldlayer 0, LAYER_4913 +/* 0x490B [0x89 0x49 0x20 ] */ ldlayer 1, LAYER_4920 +/* 0x490E [0xD7 0x54 ] */ vibfreq 84 +/* 0x4910 [0xD8 0x64 ] */ vibdepth 100 +/* 0x4912 [0xFF ] */ end + +.layer LAYER_4913 +/* 0x4913 [0x63 0x81 0x10 0x64 ] */ notedv PITCH_AF3, 272, 100 +/* 0x4917 [0xCB 0x68 0xAC 0xF0 ] */ env ENVELOPE_68AC, 240 +/* 0x491B [0xC0 0x80 0x88 ] */ ldelay 136 +/* 0x491E [0xF4 0xF3 ] */ rjump LAYER_4913 + +.layer LAYER_4920 +/* 0x4920 [0xCB 0x68 0xAC 0xF0 ] */ env ENVELOPE_68AC, 240 +/* 0x4924 [0xC0 0x80 0xCC ] */ ldelay 204 +/* 0x4927 [0xF4 0xEA ] */ rjump LAYER_4913 + +.channel CHAN_4929 +/* 0x4929 [0xC1 0x1D ] */ instr SF1_INST_29 +/* 0x492B [0x88 0x49 0x31 ] */ ldlayer 0, LAYER_4931 +/* 0x492E [0xED 0x14 ] */ gain 20 +/* 0x4930 [0xFF ] */ end + +.layer LAYER_4931 +/* 0x4931 [0xC2 0x06 ] */ transpose 6 +/* 0x4933 [0xC7 0x81 0x30 0x36 ] */ portamento 0x81, PITCH_A4, 54 +/* 0x4937 [0x7D 0x2C 0x64 ] */ notedv PITCH_BF5, 44, 100 +/* 0x493A [0xFF ] */ end + +.channel CHAN_493B +/* 0x493B [0x88 0x49 0x59 ] */ ldlayer 0, LAYER_4959 +/* 0x493E [0x89 0x49 0x49 ] */ ldlayer 1, LAYER_4949 +/* 0x4941 [0x8A 0x49 0x4B ] */ ldlayer 2, LAYER_494B +/* 0x4944 [0xD7 0x14 ] */ vibfreq 20 +/* 0x4946 [0xD8 0x32 ] */ vibdepth 50 +/* 0x4948 [0xFF ] */ end + +.layer LAYER_4949 +/* 0x4949 [0xC2 0x01 ] */ transpose 1 +.layer LAYER_494B +/* 0x494B [0xC6 0x23 ] */ instr SF1_INST_35 +/* 0x494D [0xC4 ] */ legato +/* 0x494E [0xC7 0x85 0x27 0x14 ] */ portamento 0x85, PITCH_C4, 20 +/* 0x4952 [0x6B 0x10 0x64 ] */ notedv PITCH_E4, 16, 100 +/* 0x4955 [0x66 0x56 0x64 ] */ notedv PITCH_B3, 86, 100 +/* 0x4958 [0xFF ] */ end + +.layer LAYER_4959 +/* 0x4959 [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x495B [0xC7 0x85 0x26 0xFF ] */ portamento 0x85, PITCH_B3, 255 +/* 0x495F [0x6B 0x14 0x50 ] */ notedv PITCH_E4, 20, 80 +/* 0x4962 [0x5A 0x56 0x50 ] */ notedv PITCH_B2, 86, 80 +/* 0x4965 [0xFF ] */ end + +.channel CHAN_4966 +/* 0x4966 [0x88 0x49 0x6A ] */ ldlayer 0, LAYER_496A +/* 0x4969 [0xFF ] */ end + +.layer LAYER_496A +/* 0x496A [0xC6 0x10 ] */ instr SF1_INST_16 +/* 0x496C [0xC7 0x81 0x2B 0xFF ] */ portamento 0x81, PITCH_E4, 255 +/* 0x4970 [0x76 0x08 0x50 ] */ notedv PITCH_EF5, 8, 80 +/* 0x4973 [0xC7 0x81 0x34 0xFF ] */ portamento 0x81, PITCH_DF5, 255 +/* 0x4977 [0x6F 0x08 0x50 ] */ notedv PITCH_AF4, 8, 80 +/* 0x497A [0xFF ] */ end + +.channel CHAN_497B +/* 0x497B [0xC1 0x04 ] */ instr SF1_INST_4 +/* 0x497D [0x88 0x49 0x84 ] */ ldlayer 0, LAYER_4984 +/* 0x4980 [0x89 0x49 0x8C ] */ ldlayer 1, LAYER_498C +/* 0x4983 [0xFF ] */ end + +.layer LAYER_4984 +/* 0x4984 [0xC7 0x81 0x1F 0x64 ] */ portamento 0x81, PITCH_E3, 100 +/* 0x4988 [0x5B 0x32 0x40 ] */ notedv PITCH_C3, 50, 64 +/* 0x498B [0xFF ] */ end + +.layer LAYER_498C +/* 0x498C [0xC0 0x05 ] */ ldelay 5 +/* 0x498E [0xC7 0x81 0x21 0x64 ] */ portamento 0x81, PITCH_GF3, 100 +/* 0x4992 [0x5D 0x32 0x40 ] */ notedv PITCH_D3, 50, 64 +/* 0x4995 [0xFF ] */ end + +.channel CHAN_4996 +/* 0x4996 [0xC1 0x04 ] */ instr SF1_INST_4 +/* 0x4998 [0x88 0x49 0x9F ] */ ldlayer 0, LAYER_499F +/* 0x499B [0x89 0x49 0xA7 ] */ ldlayer 1, LAYER_49A7 +/* 0x499E [0xFF ] */ end + +.layer LAYER_499F +/* 0x499F [0xC7 0x81 0x1B 0x64 ] */ portamento 0x81, PITCH_C3, 100 +/* 0x49A3 [0x5F 0x32 0x40 ] */ notedv PITCH_E3, 50, 64 +/* 0x49A6 [0xFF ] */ end + +.layer LAYER_49A7 +/* 0x49A7 [0xC0 0x05 ] */ ldelay 5 +/* 0x49A9 [0xC7 0x81 0x1D 0x64 ] */ portamento 0x81, PITCH_D3, 100 +/* 0x49AD [0x61 0x32 0x40 ] */ notedv PITCH_GF3, 50, 64 +/* 0x49B0 [0xFF ] */ end + +.channel CHAN_49B1 +/* 0x49B1 [0xC1 0x20 ] */ instr SF1_INST_32 +/* 0x49B3 [0xDA 0x69 0x9C ] */ env ENVELOPE_699C +/* 0x49B6 [0x88 0x49 0xC0 ] */ ldlayer 0, LAYER_49C0 +/* 0x49B9 [0xED 0x12 ] */ gain 18 +/* 0x49BB [0xD7 0x80 ] */ vibfreq 128 +/* 0x49BD [0xD8 0x34 ] */ vibdepth 52 +/* 0x49BF [0xFF ] */ end + +.layer LAYER_49C0 +/* 0x49C0 [0xC7 0x81 0x1F 0xFF ] */ portamento 0x81, PITCH_E3, 255 +/* 0x49C4 [0x5A 0x64 0x64 ] */ notedv PITCH_B2, 100, 100 +/* 0x49C7 [0xFF ] */ end + +.channel CHAN_49C8 +/* 0x49C8 [0x88 0x49 0xD5 ] */ ldlayer 0, LAYER_49D5 +/* 0x49CB [0x89 0x49 0xDB ] */ ldlayer 1, LAYER_49DB +/* 0x49CE [0xED 0x14 ] */ gain 20 +/* 0x49D0 [0xD7 0xF0 ] */ vibfreq 240 +/* 0x49D2 [0xD8 0xF0 ] */ vibdepth 240 +/* 0x49D4 [0xFF ] */ end + +.layer LAYER_49D5 +/* 0x49D5 [0xC6 0x00 ] */ instr SF1_INST_0 +/* 0x49D7 [0x5D 0x64 0x64 ] */ notedv PITCH_D3, 100, 100 +/* 0x49DA [0xFF ] */ end + +.layer LAYER_49DB +/* 0x49DB [0xC6 0x13 ] */ instr SF1_INST_19 +/* 0x49DD [0xC7 0x81 0x07 0xFF ] */ portamento 0x81, PITCH_E1, 255 +/* 0x49E1 [0x65 0x80 0xE6 0x54 ] */ notedv PITCH_BF3, 230, 84 +/* 0x49E5 [0xFF ] */ end + +.channel CHAN_49E6 +/* 0x49E6 [0xC1 0x13 ] */ instr SF1_INST_19 +/* 0x49E8 [0x88 0x49 0xF0 ] */ ldlayer 0, LAYER_49F0 +/* 0x49EB [0xD7 0x7F ] */ vibfreq 127 +/* 0x49ED [0xD8 0x54 ] */ vibdepth 84 +/* 0x49EF [0xFF ] */ end + +.layer LAYER_49F0 +/* 0x49F0 [0xC4 ] */ legato +/* 0x49F1 [0xC7 0x85 0x0F 0x78 ] */ portamento 0x85, PITCH_C2, 120 +/* 0x49F5 [0x67 0x80 0xC8 0x64 ] */ notedv PITCH_C4, 200, 100 +LAYER_49F9: +/* 0x49F9 [0x67 0xF5 0x30 0x64 ] */ notedv PITCH_C4, 30000, 100 +/* 0x49FD [0xF4 0xFA ] */ rjump LAYER_49F9 + +.channel CHAN_49FF +/* 0x49FF [0x88 0x4A 0x09 ] */ ldlayer 0, LAYER_4A09 +/* 0x4A02 [0x89 0x4A 0x0B ] */ ldlayer 1, LAYER_4A0B +/* 0x4A05 [0x8A 0x4A 0x17 ] */ ldlayer 2, LAYER_4A17 +/* 0x4A08 [0xFF ] */ end + +.layer LAYER_4A09 +/* 0x4A09 [0xC2 0xF4 ] */ transpose -12 +.layer LAYER_4A0B +/* 0x4A0B [0xC6 0x02 ] */ instr SF1_INST_2 +/* 0x4A0D [0xCB 0x6A 0x7C 0xC8 ] */ env ENVELOPE_6A7C, 200 +LAYER_4A11: +/* 0x4A11 [0x62 0xF5 0x30 0x64 ] */ notedv PITCH_G3, 30000, 100 +/* 0x4A15 [0xF4 0xFA ] */ rjump LAYER_4A11 + +.layer LAYER_4A17 +/* 0x4A17 [0xC6 0x22 ] */ instr SF1_INST_34 +/* 0x4A19 [0xCB 0x6A 0x5C 0xC8 ] */ env ENVELOPE_6A5C, 200 +/* 0x4A1D [0x55 0x81 0x80 0x64 ] */ notedv PITCH_GF2, 384, 100 +/* 0x4A21 [0xFF ] */ end + +.channel CHAN_4A22 +/* 0x4A22 [0xC1 0x16 ] */ instr SF1_INST_22 +/* 0x4A24 [0x88 0x4A 0x28 ] */ ldlayer 0, LAYER_4A28 +/* 0x4A27 [0xFF ] */ end + +.layer LAYER_4A28 +/* 0x4A28 [0xC4 ] */ legato +/* 0x4A29 [0xC7 0x85 0x0A 0x66 ] */ portamento 0x85, PITCH_G1, 102 +/* 0x4A2D [0xC2 0x0A ] */ transpose 10 +/* 0x4A2F [0x78 0x28 0x64 ] */ notedv PITCH_F5, 40, 100 +/* 0x4A32 [0xC2 0x00 ] */ transpose 0 +LAYER_4A34: +/* 0x4A34 [0x78 0x64 0x64 ] */ notedv PITCH_F5, 100, 100 +/* 0x4A37 [0xF4 0xFB ] */ rjump LAYER_4A34 + +.channel CHAN_4A39 +/* 0x4A39 [0x88 0x4A 0x44 ] */ ldlayer 0, LAYER_4A44 +/* 0x4A3C [0x89 0x4B 0x32 ] */ ldlayer 1, LAYER_4B32 +/* 0x4A3F [0xD7 0x80 ] */ vibfreq 128 +/* 0x4A41 [0xD8 0x60 ] */ vibdepth 96 +/* 0x4A43 [0xFF ] */ end + +.layer LAYER_4A44 +/* 0x4A44 [0xC6 0x16 ] */ instr SF1_INST_22 +/* 0x4A46 [0xC2 0x0C ] */ transpose 12 +/* 0x4A48 [0xC4 ] */ legato +/* 0x4A49 [0xF4 0xE9 ] */ rjump LAYER_4A34 + +/* 0x4A4B [0xFF ] */ end + +.channel CHAN_4A4C +/* 0x4A4C [0xC1 0x16 ] */ instr SF1_INST_22 +/* 0x4A4E [0x88 0x4A 0x56 ] */ ldlayer 0, LAYER_4A56 +/* 0x4A51 [0xD7 0x7F ] */ vibfreq 127 +/* 0x4A53 [0xD8 0x54 ] */ vibdepth 84 +/* 0x4A55 [0xFF ] */ end + +.layer LAYER_4A56 +/* 0x4A56 [0xC4 ] */ legato +/* 0x4A57 [0xC7 0x85 0x23 0x78 ] */ portamento 0x85, PITCH_AF3, 120 +/* 0x4A5B [0x7B 0x80 0xC8 0x64 ] */ notedv PITCH_AF5, 200, 100 +LAYER_4A5F: +/* 0x4A5F [0x7B 0xF5 0x30 0x64 ] */ notedv PITCH_AF5, 30000, 100 +/* 0x4A63 [0xF4 0xFA ] */ rjump LAYER_4A5F + +.channel CHAN_4A65 +/* 0x4A65 [0xC1 0x16 ] */ instr SF1_INST_22 +/* 0x4A67 [0x88 0x4A 0x94 ] */ ldlayer 0, LAYER_4A94 +/* 0x4A6A [0x89 0x4A 0x96 ] */ ldlayer 1, LAYER_4A96 +/* 0x4A6D [0x8A 0x4A 0x9E ] */ ldlayer 2, LAYER_4A9E +/* 0x4A70 [0xD7 0xAF ] */ vibfreq 175 +/* 0x4A72 [0xD8 0xC4 ] */ vibdepth 196 +/* 0x4A74 [0xCC 0x24 ] */ ldi 36 +/* 0x4A76 [0x76 ] */ stio IO_PORT_6 +/* 0x4A77 [0xCC 0xBF ] */ ldi 191 +/* 0x4A79 [0xFC 0x00 0x48 ] */ call CHAN_0048 +CHAN_4A7C: +/* 0x4A7C [0x66 ] */ ldio IO_PORT_6 +/* 0x4A7D [0xC7 0x00 0x4A 0xAB ] */ stseq 0, LAYER_4AAA + STSEQ_NOTEDV_DELAY_HI +/* 0x4A81 [0xC7 0x00 0x4A 0xAE ] */ stseq 0, LAYER_4AAD + STSEQ_NOTEDV_DELAY_HI +/* 0x4A85 [0xC8 0x01 ] */ sub 1 +/* 0x4A87 [0x76 ] */ stio IO_PORT_6 +/* 0x4A88 [0xC8 0x04 ] */ sub 4 +/* 0x4A8A [0xF3 0x07 ] */ rbeqz CHAN_4A93 +/* 0x4A8C [0xCC 0x08 ] */ ldi 8 +/* 0x4A8E [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x4A91 [0xF4 0xE9 ] */ rjump CHAN_4A7C + +CHAN_4A93: +/* 0x4A93 [0xFF ] */ end + +.layer LAYER_4A94 +/* 0x4A94 [0xC6 0x13 ] */ instr SF1_INST_19 +.layer LAYER_4A96 +/* 0x4A96 [0xCB 0x68 0xB4 0xF9 ] */ env ENVELOPE_68B4, 249 +/* 0x4A9A [0xC2 0xFC ] */ transpose -4 +/* 0x4A9C [0xF4 0xB8 ] */ rjump LAYER_4A56 + +.layer LAYER_4A9E +/* 0x4A9E [0xC6 0x01 ] */ instr SF1_INST_1 +/* 0x4AA0 [0xC0 0x81 0x20 ] */ ldelay 288 +/* 0x4AA3 [0xF8 0x0A ] */ loop 10 +/* 0x4AA5 [0xC4 ] */ legato +/* 0x4AA6 [0xC7 0x85 0x1B 0xFF ] */ portamento 0x85, PITCH_C3, 255 +LAYER_4AAA: +/* 0x4AAA [0x60 0x1E 0x64 ] */ notedv PITCH_F3, 30, 100 +LAYER_4AAD: +/* 0x4AAD [0x58 0x1E 0x64 ] */ notedv PITCH_A2, 30, 100 +/* 0x4AB0 [0xC5 ] */ nolegato +/* 0x4AB1 [0xF7 ] */ loopend +/* 0x4AB2 [0xFF ] */ end + +.channel CHAN_4AB3 +/* 0x4AB3 [0xC1 0x02 ] */ instr SF1_INST_2 +/* 0x4AB5 [0x88 0x4A 0xBF ] */ ldlayer 0, LAYER_4ABF +/* 0x4AB8 [0xED 0x14 ] */ gain 20 +/* 0x4ABA [0xD7 0x90 ] */ vibfreq 144 +/* 0x4ABC [0xD8 0xF0 ] */ vibdepth 240 +/* 0x4ABE [0xFF ] */ end + +.layer LAYER_4ABF +/* 0x4ABF [0x57 0x30 0x64 ] */ notedv PITCH_AF2, 48, 100 +/* 0x4AC2 [0xFF ] */ end + +.channel CHAN_4AC3 +/* 0x4AC3 [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x4AC5 [0x88 0x4A 0xC9 ] */ ldlayer 0, LAYER_4AC9 +/* 0x4AC8 [0xFF ] */ end + +.layer LAYER_4AC9 +/* 0x4AC9 [0xCB 0x68 0xDC 0xFA ] */ env ENVELOPE_68DC, 250 +LAYER_4ACD: +/* 0x4ACD [0xC7 0x81 0x1A 0x40 ] */ portamento 0x81, PITCH_B2, 64 +/* 0x4AD1 [0x53 0x0C 0x64 ] */ notedv PITCH_E2, 12, 100 +/* 0x4AD4 [0xF4 0xF7 ] */ rjump LAYER_4ACD + +.channel CHAN_4AD6 +/* 0x4AD6 [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x4AD8 [0xDA 0x69 0x2C ] */ env ENVELOPE_692C +/* 0x4ADB [0x88 0x4A 0xDF ] */ ldlayer 0, LAYER_4ADF +/* 0x4ADE [0xFF ] */ end + +.layer LAYER_4ADF +/* 0x4ADF [0xC7 0x81 0x20 0x82 ] */ portamento 0x81, PITCH_F3, 130 +/* 0x4AE3 [0x55 0x1E 0x64 ] */ notedv PITCH_GF2, 30, 100 +/* 0x4AE6 [0xFF ] */ end + +.channel CHAN_4AE7 +/* 0x4AE7 [0x88 0x42 0x61 ] */ ldlayer 0, LAYER_4261 +/* 0x4AEA [0x89 0x4A 0xEE ] */ ldlayer 1, LAYER_4AEE +/* 0x4AED [0xFF ] */ end + +.layer LAYER_4AEE +/* 0x4AEE [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x4AF0 [0x42 0x00 0x64 ] */ notedv PITCH_B0, 0, 100 +/* 0x4AF3 [0xFF ] */ end + +.channel CHAN_4AF4 +/* 0x4AF4 [0x88 0x42 0x61 ] */ ldlayer 0, LAYER_4261 +/* 0x4AF7 [0x89 0x4A 0xFB ] */ ldlayer 1, LAYER_4AFB +/* 0x4AFA [0xFF ] */ end + +.layer LAYER_4AFB +/* 0x4AFB [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x4AFD [0x46 0x00 0x64 ] */ notedv PITCH_EF1, 0, 100 +/* 0x4B00 [0xFF ] */ end + +.channel CHAN_4B01 +/* 0x4B01 [0x88 0x4B 0x0B ] */ ldlayer 0, LAYER_4B0B +/* 0x4B04 [0x89 0x4B 0x12 ] */ ldlayer 1, LAYER_4B12 +/* 0x4B07 [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x4B0A [0xFF ] */ end + +.layer LAYER_4B0B +/* 0x4B0B [0xC6 0x22 ] */ instr SF1_INST_34 +/* 0x4B0D [0x6F 0x81 0x10 0x64 ] */ notedv PITCH_AF4, 272, 100 +/* 0x4B11 [0xFF ] */ end + +.layer LAYER_4B12 +/* 0x4B12 [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x4B14 [0x4A 0x00 0x64 ] */ notedv PITCH_G1, 0, 100 +/* 0x4B17 [0xFF ] */ end + +.channel CHAN_4B18 +/* 0x4B18 [0xC1 0x01 ] */ instr SF1_INST_1 +/* 0x4B1A [0x88 0x4B 0x22 ] */ ldlayer 0, LAYER_4B22 +/* 0x4B1D [0xD7 0x70 ] */ vibfreq 112 +/* 0x4B1F [0xD8 0x80 ] */ vibdepth 128 +/* 0x4B21 [0xFF ] */ end + +.layer LAYER_4B22 +/* 0x4B22 [0xCB 0x69 0xDC 0xF0 ] */ env ENVELOPE_69DC, 240 +/* 0x4B26 [0xC4 ] */ legato +/* 0x4B27 [0xC7 0x85 0x03 0xFF ] */ portamento 0x85, PITCH_C1, 255 +/* 0x4B2B [0x54 0x1A 0x64 ] */ notedv PITCH_F2, 26, 100 +/* 0x4B2E [0x40 0x20 0x64 ] */ notedv PITCH_A0, 32, 100 +/* 0x4B31 [0xFF ] */ end + +.layer LAYER_4B32 +/* 0x4B32 [0xC6 0x86 ] */ instr FONTANY_INSTR_8PULSE +/* 0x4B34 [0xCB 0x6A 0x7C 0xF9 ] */ env ENVELOPE_6A7C, 249 +LAYER_4B38: +/* 0x4B38 [0x61 0xF5 0x30 0x64 ] */ notedv PITCH_GF3, 30000, 100 +/* 0x4B3C [0xF4 0xFA ] */ rjump LAYER_4B38 + +.channel CHAN_4B3E +/* 0x4B3E [0x88 0x52 0x1B ] */ ldlayer 0, LAYER_521B +/* 0x4B41 [0x89 0x52 0x19 ] */ ldlayer 1, LAYER_5219 +/* 0x4B44 [0xD7 0x60 ] */ vibfreq 96 +/* 0x4B46 [0xD8 0xF0 ] */ vibdepth 240 +/* 0x4B48 [0xFF ] */ end + +.channel CHAN_4B49 +/* 0x4B49 [0x88 0x4B 0x59 ] */ ldlayer 0, LAYER_4B59 +/* 0x4B4C [0x89 0x4B 0x50 ] */ ldlayer 1, LAYER_4B50 +/* 0x4B4F [0xFF ] */ end + +.layer LAYER_4B50 +/* 0x4B50 [0xC6 0x2F ] */ instr SF1_INST_47 +/* 0x4B52 [0x4D 0x08 0x40 ] */ notedv PITCH_BF1, 8, 64 +/* 0x4B55 [0x56 0x14 0x40 ] */ notedv PITCH_G2, 20, 64 +/* 0x4B58 [0xFF ] */ end + +.layer LAYER_4B59 +/* 0x4B59 [0xC6 0x00 ] */ instr SF1_INST_0 +/* 0x4B5B [0xCB 0x68 0xDC 0xF9 ] */ env ENVELOPE_68DC, 249 +/* 0x4B5F [0xC7 0x81 0x1A 0x60 ] */ portamento 0x81, PITCH_B2, 96 +/* 0x4B63 [0x50 0x1E 0x64 ] */ notedv PITCH_DF2, 30, 100 +/* 0x4B66 [0xFF ] */ end + +.channel CHAN_4B67 +/* 0x4B67 [0x88 0x4B 0x71 ] */ ldlayer 0, LAYER_4B71 +/* 0x4B6A [0x89 0x4B 0x7B ] */ ldlayer 1, LAYER_4B7B +/* 0x4B6D [0x8A 0x4B 0x87 ] */ ldlayer 2, LAYER_4B87 +/* 0x4B70 [0xFF ] */ end + +.layer LAYER_4B71 +/* 0x4B71 [0xC6 0x1C ] */ instr SF1_INST_28 +/* 0x4B73 [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +/* 0x4B77 [0x58 0x78 0x64 ] */ notedv PITCH_A2, 120, 100 +/* 0x4B7A [0xFF ] */ end + +.layer LAYER_4B7B +/* 0x4B7B [0xC6 0x2F ] */ instr SF1_INST_47 +/* 0x4B7D [0x4D 0x04 0x40 ] */ notedv PITCH_BF1, 4, 64 +/* 0x4B80 [0x56 0x06 0x40 ] */ notedv PITCH_G2, 6, 64 +/* 0x4B83 [0x5C 0x14 0x40 ] */ notedv PITCH_DF3, 20, 64 +/* 0x4B86 [0xFF ] */ end + +.layer LAYER_4B87 +/* 0x4B87 [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x4B89 [0x4D 0x00 0x64 ] */ notedv PITCH_BF1, 0, 100 +/* 0x4B8C [0xFF ] */ end + +.channel CHAN_4B8D +/* 0x4B8D [0x88 0x4B 0x9B ] */ ldlayer 0, LAYER_4B9B +/* 0x4B90 [0x8A 0x4B 0xA9 ] */ ldlayer 2, LAYER_4BA9 +CHAN_4B93: +/* 0x4B93 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x4B96 [0xD7 0x80 ] */ vibfreq 128 +/* 0x4B98 [0xD8 0x30 ] */ vibdepth 48 +/* 0x4B9A [0xFF ] */ end + +.layer LAYER_4B9B +/* 0x4B9B [0xC6 0x1A ] */ instr SF1_INST_26 +/* 0x4B9D [0xC4 ] */ legato +/* 0x4B9E [0xC7 0x85 0x2E 0xC8 ] */ portamento 0x85, PITCH_G4, 200 +/* 0x4BA2 [0x73 0x20 0x64 ] */ notedv PITCH_C5, 32, 100 +/* 0x4BA5 [0x6B 0x6C 0x64 ] */ notedv PITCH_E4, 108, 100 +/* 0x4BA8 [0xFF ] */ end + +.layer LAYER_4BA9 +/* 0x4BA9 [0xC6 0x11 ] */ instr SF1_INST_17 +/* 0x4BAB [0x62 0x05 0x64 ] */ notedv PITCH_G3, 5, 100 +/* 0x4BAE [0x62 0x05 0x64 ] */ notedv PITCH_G3, 5, 100 +/* 0x4BB1 [0xFF ] */ end + +.channel CHAN_4BB2 +/* 0x4BB2 [0x88 0x4B 0xB7 ] */ ldlayer 0, LAYER_4BB7 +/* 0x4BB5 [0xF4 0xDC ] */ rjump CHAN_4B93 + +.layer LAYER_4BB7 +/* 0x4BB7 [0xC2 0x05 ] */ transpose 5 +/* 0x4BB9 [0xF4 0xE0 ] */ rjump LAYER_4B9B + +/* 0x4BBB [0xFF ] */ end + +.channel CHAN_4BBC +/* 0x4BBC [0x88 0x4B 0xC0 ] */ ldlayer 0, LAYER_4BC0 +/* 0x4BBF [0xFF ] */ end + +.layer LAYER_4BC0 +/* 0x4BC0 [0xC6 0x19 ] */ instr SF1_INST_25 +/* 0x4BC2 [0xC4 ] */ legato +/* 0x4BC3 [0xC7 0x85 0x1E 0x1E ] */ portamento 0x85, PITCH_EF3, 30 +/* 0x4BC7 [0x6F 0x08 0x64 ] */ notedv PITCH_AF4, 8, 100 +/* 0x4BCA [0x6D 0x12 0x64 ] */ notedv PITCH_GF4, 18, 100 +/* 0x4BCD [0xFF ] */ end + +.channel CHAN_4BCE +/* 0x4BCE [0x8B 0x48 0x29 ] */ ldlayer 3, LAYER_4829 +CHAN_4BD1: +/* 0x4BD1 [0x88 0x4B 0xDB ] */ ldlayer 0, LAYER_4BDB +/* 0x4BD4 [0x89 0x4B 0xDD ] */ ldlayer 1, LAYER_4BDD +/* 0x4BD7 [0x8A 0x4B 0xF3 ] */ ldlayer 2, LAYER_4BF3 +/* 0x4BDA [0xFF ] */ end + +.layer LAYER_4BDB +/* 0x4BDB [0xC0 0x08 ] */ ldelay 8 +.layer LAYER_4BDD +/* 0x4BDD [0xC6 0x2B ] */ instr SF1_INST_43 +/* 0x4BDF [0xC2 0x0C ] */ transpose 12 +/* 0x4BE1 [0xC7 0x81 0x30 0x64 ] */ portamento 0x81, PITCH_A4, 100 +/* 0x4BE5 [0x77 0x1E 0x64 ] */ notedv PITCH_E5, 30, 100 +/* 0x4BE8 [0xC7 0x85 0x33 0x64 ] */ portamento 0x85, PITCH_C5, 100 +/* 0x4BEC [0x78 0x14 0x64 ] */ notedv PITCH_F5, 20, 100 +/* 0x4BEF [0x72 0x1E 0x64 ] */ notedv PITCH_B4, 30, 100 +/* 0x4BF2 [0xFF ] */ end + +.layer LAYER_4BF3 +/* 0x4BF3 [0xC6 0x2D ] */ instr SF1_INST_45 +/* 0x4BF5 [0xC4 ] */ legato +/* 0x4BF6 [0xC2 0x30 ] */ transpose 48 +/* 0x4BF8 [0xC7 0x85 0x2F 0xC8 ] */ portamento 0x85, PITCH_AF4, 200 +/* 0x4BFC [0x75 0x20 0x64 ] */ notedv PITCH_D5, 32, 100 +/* 0x4BFF [0x5A 0x64 0x64 ] */ notedv PITCH_B2, 100, 100 +/* 0x4C02 [0xFF ] */ end + +.channel CHAN_4C03 +/* 0x4C03 [0xF4 0xCC ] */ rjump CHAN_4BD1 + +.channel CHAN_4C05 +/* 0x4C05 [0x88 0x4B 0x7B ] */ ldlayer 0, LAYER_4B7B +/* 0x4C08 [0xFF ] */ end + +.channel CHAN_4C09 +/* 0x4C09 [0xC1 0x1C ] */ instr SF1_INST_28 +/* 0x4C0B [0x88 0x4C 0x0F ] */ ldlayer 0, LAYER_4C0F +/* 0x4C0E [0xFF ] */ end + +.layer LAYER_4C0F +/* 0x4C0F [0xC4 ] */ legato +/* 0x4C10 [0xC7 0x85 0x13 0xC8 ] */ portamento 0x85, PITCH_E2, 200 +/* 0x4C14 [0x52 0x18 0x64 ] */ notedv PITCH_EF2, 24, 100 +/* 0x4C17 [0x5A 0x3C 0x64 ] */ notedv PITCH_B2, 60, 100 +/* 0x4C1A [0xFF ] */ end + +.channel CHAN_4C1B +/* 0x4C1B [0xC1 0x08 ] */ instr SF1_INST_8 +/* 0x4C1D [0x88 0x4C 0x25 ] */ ldlayer 0, LAYER_4C25 +/* 0x4C20 [0xD7 0xC4 ] */ vibfreq 196 +/* 0x4C22 [0xD8 0xC4 ] */ vibdepth 196 +/* 0x4C24 [0xFF ] */ end + +.layer LAYER_4C25 +/* 0x4C25 [0xC7 0x81 0x3E 0xFF ] */ portamento 0x81, PITCH_B5, 255 +/* 0x4C29 [0x5E 0x40 0x64 ] */ notedv PITCH_EF3, 64, 100 +/* 0x4C2C [0xFF ] */ end + +.channel CHAN_4C2D +/* 0x4C2D [0x88 0x4C 0x34 ] */ ldlayer 0, LAYER_4C34 +/* 0x4C30 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x4C33 [0xFF ] */ end + +.layer LAYER_4C34 +/* 0x4C34 [0xC6 0x17 ] */ instr SF1_INST_23 +LAYER_4C36: +/* 0x4C36 [0xC7 0x81 0x20 0xFF ] */ portamento 0x81, PITCH_F3, 255 +/* 0x4C3A [0x67 0x0A 0x64 ] */ notedv PITCH_C4, 10, 100 +/* 0x4C3D [0xC7 0x81 0x22 0xFF ] */ portamento 0x81, PITCH_G3, 255 +/* 0x4C41 [0x69 0x0A 0x64 ] */ notedv PITCH_D4, 10, 100 +/* 0x4C44 [0xC7 0x81 0x24 0xFF ] */ portamento 0x81, PITCH_A3, 255 +/* 0x4C48 [0x6B 0x0A 0x64 ] */ notedv PITCH_E4, 10, 100 +/* 0x4C4B [0xC7 0x81 0x2D 0xFF ] */ portamento 0x81, PITCH_GF4, 255 +/* 0x4C4F [0x64 0x0E 0x64 ] */ notedv PITCH_A3, 14, 100 +/* 0x4C52 [0xFF ] */ end + +.channel CHAN_4C53 +/* 0x4C53 [0x88 0x4C 0x57 ] */ ldlayer 0, LAYER_4C57 +/* 0x4C56 [0xFF ] */ end + +.layer LAYER_4C57 +/* 0x4C57 [0xC6 0x14 ] */ instr SF1_INST_20 +/* 0x4C59 [0xC2 0x04 ] */ transpose 4 +/* 0x4C5B [0xF4 0xD9 ] */ rjump LAYER_4C36 + +.channel CHAN_4C5D +/* 0x4C5D [0xC1 0x01 ] */ instr SF1_INST_1 +/* 0x4C5F [0x88 0x4C 0x6A ] */ ldlayer 0, LAYER_4C6A +/* 0x4C62 [0xDA 0x69 0x9C ] */ env ENVELOPE_699C +/* 0x4C65 [0xD7 0x70 ] */ vibfreq 112 +/* 0x4C67 [0xD8 0x60 ] */ vibdepth 96 +/* 0x4C69 [0xFF ] */ end + +.layer LAYER_4C6A +/* 0x4C6A [0x53 0x64 0x64 ] */ notedv PITCH_E2, 100, 100 +/* 0x4C6D [0xFF ] */ end + +.channel CHAN_4C6E +/* 0x4C6E [0xC1 0x05 ] */ instr SF1_INST_5 +/* 0x4C70 [0x88 0x4C 0x74 ] */ ldlayer 0, LAYER_4C74 +/* 0x4C73 [0xFF ] */ end + +.layer LAYER_4C74 +/* 0x4C74 [0xC7 0x81 0x15 0x80 ] */ portamento 0x81, PITCH_GF2, 128 +/* 0x4C78 [0x58 0x08 0x64 ] */ notedv PITCH_A2, 8, 100 +/* 0x4C7B [0xFF ] */ end + +.channel CHAN_4C7C +/* 0x4C7C [0xC1 0x0B ] */ instr SF1_INST_11 +/* 0x4C7E [0x88 0x4C 0x89 ] */ ldlayer 0, LAYER_4C89 +/* 0x4C81 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x4C84 [0xD7 0x84 ] */ vibfreq 132 +/* 0x4C86 [0xD8 0x46 ] */ vibdepth 70 +/* 0x4C88 [0xFF ] */ end + +.layer LAYER_4C89 +/* 0x4C89 [0xC4 ] */ legato +/* 0x4C8A [0xC7 0x85 0x38 0x80 ] */ portamento 0x85, PITCH_F5, 128 +/* 0x4C8E [0x7D 0x14 0x64 ] */ notedv PITCH_BF5, 20, 100 +/* 0x4C91 [0x75 0x2C 0x64 ] */ notedv PITCH_D5, 44, 100 +/* 0x4C94 [0xFF ] */ end + +.channel CHAN_4C95 +/* 0x4C95 [0xC1 0x0B ] */ instr SF1_INST_11 +/* 0x4C97 [0x88 0x4C 0xA2 ] */ ldlayer 0, LAYER_4CA2 +/* 0x4C9A [0xDA 0x69 0xDC ] */ env ENVELOPE_69DC +/* 0x4C9D [0xD7 0x3E ] */ vibfreq 62 +/* 0x4C9F [0xD8 0x60 ] */ vibdepth 96 +/* 0x4CA1 [0xFF ] */ end + +.layer LAYER_4CA2 +/* 0x4CA2 [0x63 0x3C 0x50 ] */ notedv PITCH_AF3, 60, 80 +/* 0x4CA5 [0xF4 0xFB ] */ rjump LAYER_4CA2 + +.channel CHAN_4CA7 +/* 0x4CA7 [0x88 0x4C 0xAB ] */ ldlayer 0, LAYER_4CAB +/* 0x4CAA [0xFF ] */ end + +.layer LAYER_4CAB +/* 0x4CAB [0xC6 0x28 ] */ instr SF1_INST_40 +/* 0x4CAD [0xCB 0x69 0x4C 0xF9 ] */ env ENVELOPE_694C, 249 +/* 0x4CB1 [0xC4 ] */ legato +/* 0x4CB2 [0xC7 0x85 0x07 0x96 ] */ portamento 0x85, PITCH_E1, 150 +/* 0x4CB6 [0x44 0x0A 0x64 ] */ notedv PITCH_DF1, 10, 100 +/* 0x4CB9 [0x50 0x16 0x64 ] */ notedv PITCH_DF2, 22, 100 +/* 0x4CBC [0xFF ] */ end + +.channel CHAN_4CBD +/* 0x4CBD [0x88 0x4C 0xC1 ] */ ldlayer 0, LAYER_4CC1 +/* 0x4CC0 [0xFF ] */ end + +.layer LAYER_4CC1 +/* 0x4CC1 [0xC2 0x0C ] */ transpose 12 +/* 0x4CC3 [0xF4 0xE6 ] */ rjump LAYER_4CAB + +/* 0x4CC5 [0xFF ] */ end + +.channel CHAN_4CC6 +/* 0x4CC6 [0xC1 0x0B ] */ instr SF1_INST_11 +/* 0x4CC8 [0x88 0x4C 0xD3 ] */ ldlayer 0, LAYER_4CD3 +/* 0x4CCB [0xDA 0x69 0xFC ] */ env ENVELOPE_69FC +/* 0x4CCE [0xD7 0x50 ] */ vibfreq 80 +/* 0x4CD0 [0xD8 0x40 ] */ vibdepth 64 +/* 0x4CD2 [0xFF ] */ end + +.layer LAYER_4CD3 +/* 0x4CD3 [0xC4 ] */ legato +/* 0x4CD4 [0xC7 0x85 0x06 0xFF ] */ portamento 0x85, PITCH_EF1, 255 +/* 0x4CD8 [0x5E 0x2A 0x45 ] */ notedv PITCH_EF3, 42, 69 +/* 0x4CDB [0x56 0x40 0x45 ] */ notedv PITCH_G2, 64, 69 +/* 0x4CDE [0xF4 0xF3 ] */ rjump LAYER_4CD3 + +.channel CHAN_4CE0 +/* 0x4CE0 [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x4CE2 [0x88 0x4C 0xE6 ] */ ldlayer 0, LAYER_4CE6 +/* 0x4CE5 [0xFF ] */ end + +.layer LAYER_4CE6 +/* 0x4CE6 [0xC4 ] */ legato +/* 0x4CE7 [0xCB 0x68 0xFC 0xFF ] */ env ENVELOPE_68FC, 255 +/* 0x4CEB [0xC7 0x85 0x19 0xE6 ] */ portamento 0x85, PITCH_BF2, 230 +/* 0x4CEF [0x5E 0x05 0x50 ] */ notedv PITCH_EF3, 5, 80 +/* 0x4CF2 [0x59 0x05 0x50 ] */ notedv PITCH_BF2, 5, 80 +/* 0x4CF5 [0xC5 ] */ nolegato +/* 0x4CF6 [0xC0 0x05 ] */ ldelay 5 +/* 0x4CF8 [0xC4 ] */ legato +/* 0x4CF9 [0xCB 0x68 0xFC 0xFF ] */ env ENVELOPE_68FC, 255 +/* 0x4CFD [0xC7 0x85 0x19 0xDC ] */ portamento 0x85, PITCH_BF2, 220 +/* 0x4D01 [0x5E 0x05 0x50 ] */ notedv PITCH_EF3, 5, 80 +/* 0x4D04 [0x59 0x0A 0x50 ] */ notedv PITCH_BF2, 10, 80 +/* 0x4D07 [0xFF ] */ end + +.channel CHAN_4D08 +/* 0x4D08 [0xC1 0x0A ] */ instr SF1_INST_10 +/* 0x4D0A [0x88 0x4D 0x0E ] */ ldlayer 0, LAYER_4D0E +/* 0x4D0D [0xFF ] */ end + +.layer LAYER_4D0E +/* 0x4D0E [0xC7 0x81 0x23 0xC8 ] */ portamento 0x81, PITCH_AF3, 200 +/* 0x4D12 [0x66 0x20 0x64 ] */ notedv PITCH_B3, 32, 100 +/* 0x4D15 [0xFF ] */ end + +.channel CHAN_4D16 +/* 0x4D16 [0x88 0x4D 0x23 ] */ ldlayer 0, LAYER_4D23 +/* 0x4D19 [0x89 0x4A 0x09 ] */ ldlayer 1, LAYER_4A09 +/* 0x4D1C [0x8A 0x4A 0x0B ] */ ldlayer 2, LAYER_4A0B +/* 0x4D1F [0x8B 0x4A 0x17 ] */ ldlayer 3, LAYER_4A17 +/* 0x4D22 [0xFF ] */ end + +.layer LAYER_4D23 +/* 0x4D23 [0xC0 0x7F ] */ ldelay 127 +/* 0x4D25 [0xFF ] */ end + +.channel CHAN_4D26 +/* 0x4D26 [0xC1 0x2F ] */ instr SF1_INST_47 +/* 0x4D28 [0x88 0x4D 0x2C ] */ ldlayer 0, LAYER_4D2C +/* 0x4D2B [0xFF ] */ end + +.layer LAYER_4D2C +/* 0x4D2C [0xC2 0x30 ] */ transpose 48 +LAYER_4D2E: +/* 0x4D2E [0x67 0xF5 0x30 0x64 ] */ notedv PITCH_C4, 30000, 100 +/* 0x4D32 [0xF4 0xFA ] */ rjump LAYER_4D2E + +.channel CHAN_4D34 +/* 0x4D34 [0x88 0x4D 0x4D ] */ ldlayer 0, LAYER_4D4D +/* 0x4D37 [0x89 0x4D 0x3B ] */ ldlayer 1, LAYER_4D3B +/* 0x4D3A [0xFF ] */ end + +.layer LAYER_4D3B +/* 0x4D3B [0xC6 0x2F ] */ instr SF1_INST_47 +/* 0x4D3D [0x49 0x40 0x64 ] */ notedv PITCH_GF1, 64, 100 +/* 0x4D40 [0x49 0x14 0x64 ] */ notedv PITCH_GF1, 20, 100 +/* 0x4D43 [0x49 0x10 0x54 ] */ notedv PITCH_GF1, 16, 84 +/* 0x4D46 [0x49 0x0A 0x44 ] */ notedv PITCH_GF1, 10, 68 +/* 0x4D49 [0x49 0x0A 0x44 ] */ notedv PITCH_GF1, 10, 68 +/* 0x4D4C [0xFF ] */ end + +.layer LAYER_4D4D +/* 0x4D4D [0xC2 0xF8 ] */ transpose -8 +/* 0x4D4F [0xC0 0x04 ] */ ldelay 4 +/* 0x4D51 [0xF4 0xE8 ] */ rjump LAYER_4D3B + +.channel CHAN_4D53 +/* 0x4D53 [0x88 0x4D 0x3B ] */ ldlayer 0, LAYER_4D3B +/* 0x4D56 [0xFF ] */ end + +.channel CHAN_4D57 +/* 0x4D57 [0x88 0x4D 0x70 ] */ ldlayer 0, LAYER_4D70 +/* 0x4D5A [0x89 0x4D 0x5E ] */ ldlayer 1, LAYER_4D5E +/* 0x4D5D [0xFF ] */ end + +.layer LAYER_4D5E +/* 0x4D5E [0xC6 0x2F ] */ instr SF1_INST_47 +/* 0x4D60 [0x49 0x08 0x64 ] */ notedv PITCH_GF1, 8, 100 +/* 0x4D63 [0x49 0x40 0x64 ] */ notedv PITCH_GF1, 64, 100 +/* 0x4D66 [0x49 0x20 0x64 ] */ notedv PITCH_GF1, 32, 100 +/* 0x4D69 [0x49 0x30 0x54 ] */ notedv PITCH_GF1, 48, 84 +/* 0x4D6C [0x49 0x40 0x44 ] */ notedv PITCH_GF1, 64, 68 +/* 0x4D6F [0xFF ] */ end + +.layer LAYER_4D70 +/* 0x4D70 [0xC2 0xF8 ] */ transpose -8 +/* 0x4D72 [0xF4 0xEA ] */ rjump LAYER_4D5E + +.channel CHAN_4D74 +/* 0x4D74 [0x88 0x4D 0x87 ] */ ldlayer 0, LAYER_4D87 +/* 0x4D77 [0x89 0x4D 0x7B ] */ ldlayer 1, LAYER_4D7B +/* 0x4D7A [0xFF ] */ end + +.layer LAYER_4D7B +/* 0x4D7B [0xC6 0x2F ] */ instr SF1_INST_47 +/* 0x4D7D [0x46 0x06 0x64 ] */ notedv PITCH_EF1, 6, 100 +/* 0x4D80 [0x49 0x0E 0x64 ] */ notedv PITCH_GF1, 14, 100 +/* 0x4D83 [0x4F 0x10 0x64 ] */ notedv PITCH_C2, 16, 100 +/* 0x4D86 [0xFF ] */ end + +.layer LAYER_4D87 +/* 0x4D87 [0xC2 0xFB ] */ transpose -5 +/* 0x4D89 [0xF4 0xF0 ] */ rjump LAYER_4D7B + +.channel CHAN_4D8B +/* 0x4D8B [0x88 0x4D 0x9C ] */ ldlayer 0, LAYER_4D9C +/* 0x4D8E [0x89 0x4D 0x92 ] */ ldlayer 1, LAYER_4D92 +/* 0x4D91 [0xFF ] */ end + +.layer LAYER_4D92 +/* 0x4D92 [0xC6 0x11 ] */ instr SF1_INST_17 +/* 0x4D94 [0xC7 0x81 0x08 0xC8 ] */ portamento 0x81, PITCH_F1, 200 +/* 0x4D98 [0x4D 0x20 0x64 ] */ notedv PITCH_BF1, 32, 100 +/* 0x4D9B [0xFF ] */ end + +.layer LAYER_4D9C +/* 0x4D9C [0xC6 0x2F ] */ instr SF1_INST_47 +/* 0x4D9E [0xC0 0x0E ] */ ldelay 14 +/* 0x4DA0 [0x46 0x14 0x40 ] */ notedv PITCH_EF1, 20, 64 +/* 0x4DA3 [0xFF ] */ end + +.channel CHAN_4DA4 +/* 0x4DA4 [0x88 0x4D 0xAB ] */ ldlayer 0, LAYER_4DAB +/* 0x4DA7 [0x89 0x4D 0xBB ] */ ldlayer 1, LAYER_4DBB +/* 0x4DAA [0xFF ] */ end + +.layer LAYER_4DAB +/* 0x4DAB [0xC6 0x2F ] */ instr SF1_INST_47 +/* 0x4DAD [0xCB 0x69 0x5C 0xF9 ] */ env ENVELOPE_695C, 249 +/* 0x4DB1 [0xF8 0x05 ] */ loop 5 +/* 0x4DB3 [0x4F 0x0A 0x64 ] */ notedv PITCH_C2, 10, 100 +/* 0x4DB6 [0x4A 0x08 0x64 ] */ notedv PITCH_G1, 8, 100 +/* 0x4DB9 [0xF7 ] */ loopend +/* 0x4DBA [0xFF ] */ end + +.layer LAYER_4DBB +/* 0x4DBB [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x4DBD [0x4F 0x00 0x64 ] */ notedv PITCH_C2, 0, 100 +/* 0x4DC0 [0xFF ] */ end + +.channel CHAN_4DC1 +/* 0x4DC1 [0x88 0x4D 0xC7 ] */ ldlayer 0, LAYER_4DC7 +/* 0x4DC4 [0xED 0x20 ] */ gain 32 +/* 0x4DC6 [0xFF ] */ end + +.layer LAYER_4DC7 +/* 0x4DC7 [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x4DC9 [0x4C 0x00 0x64 ] */ notedv PITCH_A1, 0, 100 +/* 0x4DCC [0xFF ] */ end + +.channel CHAN_4DCD +/* 0x4DCD [0xC1 0x12 ] */ instr SF1_INST_18 +/* 0x4DCF [0x88 0x4D 0xDA ] */ ldlayer 0, LAYER_4DDA +/* 0x4DD2 [0x89 0x4D 0xDC ] */ ldlayer 1, LAYER_4DDC +/* 0x4DD5 [0xD7 0x28 ] */ vibfreq 40 +/* 0x4DD7 [0xD8 0x60 ] */ vibdepth 96 +/* 0x4DD9 [0xFF ] */ end + +.layer LAYER_4DDA +/* 0x4DDA [0xC2 0x06 ] */ transpose 6 +.layer LAYER_4DDC +/* 0x4DDC [0x70 0xF5 0x30 0x64 ] */ notedv PITCH_A4, 30000, 100 +/* 0x4DE0 [0xF4 0xFA ] */ rjump LAYER_4DDC + +.channel CHAN_4DE2 +/* 0x4DE2 [0x88 0x4E 0x03 ] */ ldlayer 0, LAYER_4E03 +/* 0x4DE5 [0x89 0x4D 0xF3 ] */ ldlayer 1, LAYER_4DF3 +/* 0x4DE8 [0x8A 0x4D 0xF5 ] */ ldlayer 2, LAYER_4DF5 +/* 0x4DEB [0x8B 0x48 0x29 ] */ ldlayer 3, LAYER_4829 +/* 0x4DEE [0xD7 0x74 ] */ vibfreq 116 +/* 0x4DF0 [0xD8 0xD2 ] */ vibdepth 210 +/* 0x4DF2 [0xFF ] */ end + +.layer LAYER_4DF3 +/* 0x4DF3 [0xC2 0x0C ] */ transpose 12 +.layer LAYER_4DF5 +/* 0x4DF5 [0xC6 0x0B ] */ instr SF1_INST_11 +LAYER_4DF7: +/* 0x4DF7 [0xC7 0x85 0x20 0xFF ] */ portamento 0x85, PITCH_F3, 255 +/* 0x4DFB [0x67 0x20 0x50 ] */ notedv PITCH_C4, 32, 80 +/* 0x4DFE [0x5A 0x80 0x90 0x50 ] */ notedv PITCH_B2, 144, 80 +/* 0x4E02 [0xFF ] */ end + +.layer LAYER_4E03 +/* 0x4E03 [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x4E05 [0xC7 0x81 0x25 0x64 ] */ portamento 0x81, PITCH_BF3, 100 +/* 0x4E09 [0x55 0x80 0xB0 0x64 ] */ notedv PITCH_GF2, 176, 100 +/* 0x4E0D [0xFF ] */ end + +.channel CHAN_4E0E +/* 0x4E0E [0x88 0x4E 0x1F ] */ ldlayer 0, LAYER_4E1F +/* 0x4E11 [0x89 0x4D 0xF5 ] */ ldlayer 1, LAYER_4DF5 +/* 0x4E14 [0x8A 0x4E 0x77 ] */ ldlayer 2, LAYER_4E77 +/* 0x4E17 [0x8B 0x48 0x29 ] */ ldlayer 3, LAYER_4829 +/* 0x4E1A [0xD7 0x50 ] */ vibfreq 80 +/* 0x4E1C [0xD8 0x30 ] */ vibdepth 48 +/* 0x4E1E [0xFF ] */ end + +.layer LAYER_4E1F +/* 0x4E1F [0xC2 0x04 ] */ transpose 4 +/* 0x4E21 [0xF4 0xE0 ] */ rjump LAYER_4E03 + +.channel CHAN_4E23 +/* 0x4E23 [0x88 0x4E 0x3A ] */ ldlayer 0, LAYER_4E3A +/* 0x4E26 [0x89 0x4E 0x34 ] */ ldlayer 1, LAYER_4E34 +/* 0x4E29 [0x8A 0x4E 0x36 ] */ ldlayer 2, LAYER_4E36 +/* 0x4E2C [0x8B 0x48 0x29 ] */ ldlayer 3, LAYER_4829 +/* 0x4E2F [0xD7 0xA4 ] */ vibfreq 164 +/* 0x4E31 [0xD8 0xA2 ] */ vibdepth 162 +/* 0x4E33 [0xFF ] */ end + +.layer LAYER_4E34 +/* 0x4E34 [0xC2 0x04 ] */ transpose 4 +.layer LAYER_4E36 +/* 0x4E36 [0xC6 0x01 ] */ instr SF1_INST_1 +/* 0x4E38 [0xF4 0xBD ] */ rjump LAYER_4DF7 + +.layer LAYER_4E3A +/* 0x4E3A [0xC2 0x02 ] */ transpose 2 +/* 0x4E3C [0xF4 0xC5 ] */ rjump LAYER_4E03 + +.channel CHAN_4E3E +/* 0x4E3E [0x88 0x4E 0x47 ] */ ldlayer 0, LAYER_4E47 +/* 0x4E41 [0x89 0x4E 0x45 ] */ ldlayer 1, LAYER_4E45 +/* 0x4E44 [0xFF ] */ end + +.layer LAYER_4E45 +/* 0x4E45 [0xC2 0x06 ] */ transpose 6 +.layer LAYER_4E47 +/* 0x4E47 [0xC6 0x28 ] */ instr SF1_INST_40 +/* 0x4E49 [0xCB 0x69 0x4C 0xF9 ] */ env ENVELOPE_694C, 249 +/* 0x4E4D [0xC4 ] */ legato +/* 0x4E4E [0xC7 0x85 0x13 0x96 ] */ portamento 0x85, PITCH_E2, 150 +/* 0x4E52 [0x43 0x0A 0x64 ] */ notedv PITCH_C1, 10, 100 +/* 0x4E55 [0x5A 0x14 0x64 ] */ notedv PITCH_B2, 20, 100 +/* 0x4E58 [0xFF ] */ end + +.channel CHAN_4E59 +/* 0x4E59 [0x88 0x4E 0x75 ] */ ldlayer 0, LAYER_4E75 +/* 0x4E5C [0x89 0x4E 0x77 ] */ ldlayer 1, LAYER_4E77 +/* 0x4E5F [0x8A 0x4E 0x66 ] */ ldlayer 2, LAYER_4E66 +/* 0x4E62 [0x8B 0x4E 0x68 ] */ ldlayer 3, LAYER_4E68 +/* 0x4E65 [0xFF ] */ end + +.layer LAYER_4E66 +/* 0x4E66 [0xC2 0x02 ] */ transpose 2 +.layer LAYER_4E68 +/* 0x4E68 [0xC6 0x28 ] */ instr SF1_INST_40 +/* 0x4E6A [0xC7 0x85 0x22 0xFF ] */ portamento 0x85, PITCH_G3, 255 +/* 0x4E6E [0x6C 0x14 0x64 ] */ notedv PITCH_F4, 20, 100 +/* 0x4E71 [0x5A 0x7F 0x64 ] */ notedv PITCH_B2, 127, 100 +/* 0x4E74 [0xFF ] */ end + +.layer LAYER_4E75 +/* 0x4E75 [0xC2 0xFE ] */ transpose -2 +.layer LAYER_4E77 +/* 0x4E77 [0xC6 0x23 ] */ instr SF1_INST_35 +/* 0x4E79 [0xC4 ] */ legato +/* 0x4E7A [0xC7 0x85 0x27 0x40 ] */ portamento 0x85, PITCH_C4, 64 +/* 0x4E7E [0x6C 0x12 0x64 ] */ notedv PITCH_F4, 18, 100 +/* 0x4E81 [0x64 0x80 0xA8 0x64 ] */ notedv PITCH_A3, 168, 100 +/* 0x4E85 [0xFF ] */ end + +.channel CHAN_4E86 +/* 0x4E86 [0x88 0x4E 0x66 ] */ ldlayer 0, LAYER_4E66 +/* 0x4E89 [0x89 0x4E 0x68 ] */ ldlayer 1, LAYER_4E68 +/* 0x4E8C [0xFF ] */ end + +.channel CHAN_4E8D +/* 0x4E8D [0x88 0x4E 0x94 ] */ ldlayer 0, LAYER_4E94 +/* 0x4E90 [0x89 0x4E 0x9E ] */ ldlayer 1, LAYER_4E9E +/* 0x4E93 [0xFF ] */ end + +.layer LAYER_4E94 +/* 0x4E94 [0xC6 0x18 ] */ instr SF1_INST_24 +/* 0x4E96 [0xC7 0x81 0x23 0x32 ] */ portamento 0x81, PITCH_AF3, 50 +/* 0x4E9A [0x57 0x30 0x64 ] */ notedv PITCH_AF2, 48, 100 +/* 0x4E9D [0xFF ] */ end + +.layer LAYER_4E9E +/* 0x4E9E [0xC6 0x1E ] */ instr SF1_INST_30 +/* 0x4EA0 [0xC7 0x81 0x27 0x32 ] */ portamento 0x81, PITCH_C4, 50 +/* 0x4EA4 [0x5C 0x40 0x64 ] */ notedv PITCH_DF3, 64, 100 +/* 0x4EA7 [0xFF ] */ end + +.channel CHAN_4EA8 +/* 0x4EA8 [0xC1 0x22 ] */ instr SF1_INST_34 +/* 0x4EAA [0x88 0x4E 0xB7 ] */ ldlayer 0, LAYER_4EB7 +/* 0x4EAD [0x89 0x4E 0xB5 ] */ ldlayer 1, LAYER_4EB5 +/* 0x4EB0 [0xD7 0xC4 ] */ vibfreq 196 +/* 0x4EB2 [0xD8 0x30 ] */ vibdepth 48 +/* 0x4EB4 [0xFF ] */ end + +.layer LAYER_4EB5 +/* 0x4EB5 [0xC2 0x08 ] */ transpose 8 +.layer LAYER_4EB7 +/* 0x4EB7 [0x64 0x81 0xA2 0x64 ] */ notedv PITCH_A3, 418, 100 +/* 0x4EBB [0xFF ] */ end + +.channel CHAN_4EBC +/* 0x4EBC [0xC1 0x1C ] */ instr SF1_INST_28 +/* 0x4EBE [0x88 0x4E 0xC6 ] */ ldlayer 0, LAYER_4EC6 +/* 0x4EC1 [0xD7 0x80 ] */ vibfreq 128 +/* 0x4EC3 [0xD8 0xA0 ] */ vibdepth 160 +/* 0x4EC5 [0xFF ] */ end + +.layer LAYER_4EC6 +/* 0x4EC6 [0xC7 0x81 0x16 0xFF ] */ portamento 0x81, PITCH_G2, 255 +/* 0x4ECA [0x50 0x7F 0x64 ] */ notedv PITCH_DF2, 127, 100 +/* 0x4ECD [0xFF ] */ end + +.channel CHAN_4ECE +/* 0x4ECE [0xC1 0x1C ] */ instr SF1_INST_28 +/* 0x4ED0 [0x88 0x4E 0xD8 ] */ ldlayer 0, LAYER_4ED8 +/* 0x4ED3 [0xD7 0x80 ] */ vibfreq 128 +/* 0x4ED5 [0xD8 0xA0 ] */ vibdepth 160 +/* 0x4ED7 [0xFF ] */ end + +.layer LAYER_4ED8 +/* 0x4ED8 [0xC7 0x81 0x10 0xFF ] */ portamento 0x81, PITCH_DF2, 255 +/* 0x4EDC [0x56 0x7F 0x64 ] */ notedv PITCH_G2, 127, 100 +/* 0x4EDF [0xFF ] */ end + +.channel CHAN_4EE0 +/* 0x4EE0 [0x88 0x4E 0xF4 ] */ ldlayer 0, LAYER_4EF4 +/* 0x4EE3 [0x89 0x4E 0xEA ] */ ldlayer 1, LAYER_4EEA +/* 0x4EE6 [0x8A 0x4E 0xF9 ] */ ldlayer 2, LAYER_4EF9 +/* 0x4EE9 [0xFF ] */ end + +.layer LAYER_4EEA +/* 0x4EEA [0xC6 0x00 ] */ instr SF1_INST_0 +/* 0x4EEC [0xC7 0x81 0x36 0x64 ] */ portamento 0x81, PITCH_EF5, 100 +/* 0x4EF0 [0x7E 0x60 0x64 ] */ notedv PITCH_B5, 96, 100 +/* 0x4EF3 [0xFF ] */ end + +.layer LAYER_4EF4 +/* 0x4EF4 [0xC0 0x02 ] */ ldelay 2 +/* 0x4EF6 [0xF4 0xF2 ] */ rjump LAYER_4EEA + +/* 0x4EF8 [0xFF ] */ end + +.layer LAYER_4EF9 +/* 0x4EF9 [0xC6 0x27 ] */ instr SF1_INST_39 +/* 0x4EFB [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +/* 0x4EFF [0x60 0x14 0x64 ] */ notedv PITCH_F3, 20, 100 +/* 0x4F02 [0xFF ] */ end + +.channel CHAN_4F03 +/* 0x4F03 [0xC1 0x2C ] */ instr SF1_INST_44 +/* 0x4F05 [0x88 0x4F 0x0C ] */ ldlayer 0, LAYER_4F0C +/* 0x4F08 [0xDA 0x69 0x2C ] */ env ENVELOPE_692C +/* 0x4F0B [0xFF ] */ end + +.layer LAYER_4F0C +/* 0x4F0C [0xC7 0x85 0x27 0x64 ] */ portamento 0x85, PITCH_C4, 100 +/* 0x4F10 [0x64 0x16 0x64 ] */ notedv PITCH_A3, 22, 100 +/* 0x4F13 [0x72 0x16 0x64 ] */ notedv PITCH_B4, 22, 100 +/* 0x4F16 [0xFF ] */ end + +.channel CHAN_4F17 +/* 0x4F17 [0xC1 0x26 ] */ instr SF1_INST_38 +/* 0x4F19 [0x88 0x4F 0x20 ] */ ldlayer 0, LAYER_4F20 +/* 0x4F1C [0xDA 0x68 0xCC ] */ env ENVELOPE_68CC +/* 0x4F1F [0xFF ] */ end + +.layer LAYER_4F20 +/* 0x4F20 [0xC7 0x81 0x1B 0x64 ] */ portamento 0x81, PITCH_C3, 100 +/* 0x4F24 [0x60 0x34 0x64 ] */ notedv PITCH_F3, 52, 100 +/* 0x4F27 [0xFF ] */ end + +.channel CHAN_4F28 +/* 0x4F28 [0xC1 0x0B ] */ instr SF1_INST_11 +/* 0x4F2A [0x88 0x4F 0x32 ] */ ldlayer 0, LAYER_4F32 +/* 0x4F2D [0xD7 0x50 ] */ vibfreq 80 +/* 0x4F2F [0xD8 0x60 ] */ vibdepth 96 +/* 0x4F31 [0xFF ] */ end + +.layer LAYER_4F32 +/* 0x4F32 [0xCB 0x6A 0x2C 0xE6 ] */ env ENVELOPE_6A2C, 230 +LAYER_4F36: +/* 0x4F36 [0x53 0x80 0xD0 0x50 ] */ notedv PITCH_E2, 208, 80 +/* 0x4F3A [0xF4 0xFA ] */ rjump LAYER_4F36 + +.channel CHAN_4F3C +/* 0x4F3C [0x88 0x4F 0x44 ] */ ldlayer 0, LAYER_4F44 +/* 0x4F3F [0xD7 0xF0 ] */ vibfreq 240 +/* 0x4F41 [0xD8 0xA0 ] */ vibdepth 160 +/* 0x4F43 [0xFF ] */ end + +.layer LAYER_4F44 +/* 0x4F44 [0xC6 0x17 ] */ instr SF1_INST_23 +/* 0x4F46 [0xC7 0x81 0x34 0xFF ] */ portamento 0x81, PITCH_DF5, 255 +/* 0x4F4A [0x79 0x40 0x64 ] */ notedv PITCH_GF5, 64, 100 +/* 0x4F4D [0xFF ] */ end + +.channel CHAN_4F4E +/* 0x4F4E [0x88 0x4F 0x55 ] */ ldlayer 0, LAYER_4F55 +/* 0x4F51 [0x89 0x4F 0x57 ] */ ldlayer 1, LAYER_4F57 +/* 0x4F54 [0xFF ] */ end + +.layer LAYER_4F55 +/* 0x4F55 [0xC0 0x06 ] */ ldelay 6 +.layer LAYER_4F57 +/* 0x4F57 [0xC6 0x17 ] */ instr SF1_INST_23 +/* 0x4F59 [0x79 0x64 0x64 ] */ notedv PITCH_GF5, 100, 100 +/* 0x4F5C [0xFF ] */ end + +.channel CHAN_4F5D +/* 0x4F5D [0xC1 0x30 ] */ instr SF1_INST_48 +/* 0x4F5F [0x88 0x4F 0x6A ] */ ldlayer 0, LAYER_4F6A +/* 0x4F62 [0x89 0x4F 0x68 ] */ ldlayer 1, LAYER_4F68 +/* 0x4F65 [0xED 0x18 ] */ gain 24 +/* 0x4F67 [0xFF ] */ end + +.layer LAYER_4F68 +/* 0x4F68 [0xC2 0x02 ] */ transpose 2 +.layer LAYER_4F6A +/* 0x4F6A [0x67 0x40 0x64 ] */ notedv PITCH_C4, 64, 100 +/* 0x4F6D [0xFF ] */ end + +.channel CHAN_4F6E +/* 0x4F6E [0xC1 0x30 ] */ instr SF1_INST_48 +/* 0x4F70 [0x88 0x4F 0x7B ] */ ldlayer 0, LAYER_4F7B +/* 0x4F73 [0x89 0x4F 0x79 ] */ ldlayer 1, LAYER_4F79 +/* 0x4F76 [0xED 0x18 ] */ gain 24 +/* 0x4F78 [0xFF ] */ end + +.layer LAYER_4F79 +/* 0x4F79 [0xC2 0x02 ] */ transpose 2 +.layer LAYER_4F7B +/* 0x4F7B [0x6C 0x40 0x64 ] */ notedv PITCH_F4, 64, 100 +/* 0x4F7E [0xFF ] */ end + +.channel CHAN_4F7F +/* 0x4F7F [0xC1 0x0A ] */ instr SF1_INST_10 +/* 0x4F81 [0x88 0x4F 0x8A ] */ ldlayer 0, LAYER_4F8A +/* 0x4F84 [0x89 0x4F 0x88 ] */ ldlayer 1, LAYER_4F88 +/* 0x4F87 [0xFF ] */ end + +.layer LAYER_4F88 +/* 0x4F88 [0xC2 0x02 ] */ transpose 2 +.layer LAYER_4F8A +/* 0x4F8A [0xC7 0x81 0x17 0xC8 ] */ portamento 0x81, PITCH_AF2, 200 +/* 0x4F8E [0x5A 0x2C 0x64 ] */ notedv PITCH_B2, 44, 100 +/* 0x4F91 [0xFF ] */ end + +.channel CHAN_4F92 +/* 0x4F92 [0xC1 0x21 ] */ instr SF1_INST_33 +/* 0x4F94 [0x88 0x4F 0x98 ] */ ldlayer 0, LAYER_4F98 +/* 0x4F97 [0xFF ] */ end + +.layer LAYER_4F98 +/* 0x4F98 [0x77 0x06 0x64 ] */ notedv PITCH_E5, 6, 100 +/* 0x4F9B [0x79 0x06 0x64 ] */ notedv PITCH_GF5, 6, 100 +/* 0x4F9E [0x7B 0x06 0x64 ] */ notedv PITCH_AF5, 6, 100 +/* 0x4FA1 [0x7C 0x06 0x64 ] */ notedv PITCH_A5, 6, 100 +/* 0x4FA4 [0x7B 0x06 0x64 ] */ notedv PITCH_AF5, 6, 100 +/* 0x4FA7 [0x79 0x06 0x64 ] */ notedv PITCH_GF5, 6, 100 +/* 0x4FAA [0x77 0x06 0x64 ] */ notedv PITCH_E5, 6, 100 +/* 0x4FAD [0xF4 0xE9 ] */ rjump LAYER_4F98 + +.channel CHAN_4FAF +/* 0x4FAF [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x4FB1 [0x88 0x36 0x1B ] */ ldlayer 0, LAYER_361B +/* 0x4FB4 [0xFF ] */ end + +.channel CHAN_4FB5 +/* 0x4FB5 [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x4FB7 [0x88 0x4F 0xBB ] */ ldlayer 0, LAYER_4FBB +/* 0x4FBA [0xFF ] */ end + +.layer LAYER_4FBB +/* 0x4FBB [0xC7 0x81 0x0F 0x68 ] */ portamento 0x81, PITCH_C2, 104 +/* 0x4FBF [0x66 0x40 0x64 ] */ notedv PITCH_B3, 64, 100 +/* 0x4FC2 [0xFF ] */ end + +.channel CHAN_4FC3 +/* 0x4FC3 [0x88 0x4F 0xDE ] */ ldlayer 0, LAYER_4FDE +/* 0x4FC6 [0x89 0x4F 0xD1 ] */ ldlayer 1, LAYER_4FD1 +/* 0x4FC9 [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x4FCC [0xD7 0x70 ] */ vibfreq 112 +/* 0x4FCE [0xD8 0xA0 ] */ vibdepth 160 +/* 0x4FD0 [0xFF ] */ end + +.layer LAYER_4FD1 +/* 0x4FD1 [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x4FD3 [0xC7 0x85 0x28 0xFF ] */ portamento 0x85, PITCH_DF4, 255 +/* 0x4FD7 [0x6F 0x20 0x50 ] */ notedv PITCH_AF4, 32, 80 +/* 0x4FDA [0x62 0x40 0x50 ] */ notedv PITCH_G3, 64, 80 +/* 0x4FDD [0xFF ] */ end + +.layer LAYER_4FDE +/* 0x4FDE [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x4FE0 [0xC7 0x81 0x29 0x64 ] */ portamento 0x81, PITCH_D4, 100 +/* 0x4FE4 [0x5E 0x60 0x64 ] */ notedv PITCH_EF3, 96, 100 +/* 0x4FE7 [0xFF ] */ end + +.channel CHAN_4FE8 +/* 0x4FE8 [0xC1 0x01 ] */ instr SF1_INST_1 +/* 0x4FEA [0x88 0x4F 0xF2 ] */ ldlayer 0, LAYER_4FF2 +/* 0x4FED [0xD7 0x60 ] */ vibfreq 96 +/* 0x4FEF [0xD8 0x80 ] */ vibdepth 128 +/* 0x4FF1 [0xFF ] */ end + +.layer LAYER_4FF2 +/* 0x4FF2 [0xCB 0x6A 0x2C 0xE6 ] */ env ENVELOPE_6A2C, 230 +LAYER_4FF6: +/* 0x4FF6 [0x49 0x70 0x64 ] */ notedv PITCH_GF1, 112, 100 +/* 0x4FF9 [0xF4 0xFB ] */ rjump LAYER_4FF6 + +.channel CHAN_4FFB +/* 0x4FFB [0x88 0x50 0x08 ] */ ldlayer 0, LAYER_5008 +/* 0x4FFE [0x89 0x50 0x06 ] */ ldlayer 1, LAYER_5006 +/* 0x5001 [0xD7 0x10 ] */ vibfreq 16 +/* 0x5003 [0xD8 0x80 ] */ vibdepth 128 +/* 0x5005 [0xFF ] */ end + +.layer LAYER_5006 +/* 0x5006 [0xC2 0x02 ] */ transpose 2 +.layer LAYER_5008 +/* 0x5008 [0xC6 0x01 ] */ instr SF1_INST_1 +/* 0x500A [0xCB 0x6A 0x2C 0xE6 ] */ env ENVELOPE_6A2C, 230 +LAYER_500E: +/* 0x500E [0x43 0x70 0x64 ] */ notedv PITCH_C1, 112, 100 +/* 0x5011 [0xF4 0xFB ] */ rjump LAYER_500E + +.channel CHAN_5013 +/* 0x5013 [0xC1 0x26 ] */ instr SF1_INST_38 +/* 0x5015 [0x88 0x50 0x19 ] */ ldlayer 0, LAYER_5019 +/* 0x5018 [0xFF ] */ end + +.layer LAYER_5019 +/* 0x5019 [0xC7 0x81 0x23 0x64 ] */ portamento 0x81, PITCH_AF3, 100 +/* 0x501D [0x74 0x38 0x50 ] */ notedv PITCH_DF5, 56, 80 +/* 0x5020 [0xFF ] */ end + +.channel CHAN_5021 +/* 0x5021 [0xC1 0x26 ] */ instr SF1_INST_38 +/* 0x5023 [0x88 0x50 0x27 ] */ ldlayer 0, LAYER_5027 +/* 0x5026 [0xFF ] */ end + +.layer LAYER_5027 +/* 0x5027 [0xC7 0x81 0x31 0x64 ] */ portamento 0x81, PITCH_BF4, 100 +/* 0x502B [0x6A 0x38 0x50 ] */ notedv PITCH_EF4, 56, 80 +/* 0x502E [0xFF ] */ end + +.channel CHAN_502F +/* 0x502F [0xC1 0x27 ] */ instr SF1_INST_39 +/* 0x5031 [0x88 0x50 0x35 ] */ ldlayer 0, LAYER_5035 +/* 0x5034 [0xFF ] */ end + +.layer LAYER_5035 +/* 0x5035 [0xC7 0x81 0x10 0x64 ] */ portamento 0x81, PITCH_DF2, 100 +/* 0x5039 [0x53 0x30 0x44 ] */ notedv PITCH_E2, 48, 68 +/* 0x503C [0xFF ] */ end + +.channel CHAN_503D +/* 0x503D [0xC1 0x13 ] */ instr SF1_INST_19 +/* 0x503F [0x88 0x50 0x47 ] */ ldlayer 0, LAYER_5047 +/* 0x5042 [0xD7 0x70 ] */ vibfreq 112 +/* 0x5044 [0xD8 0xF0 ] */ vibdepth 240 +/* 0x5046 [0xFF ] */ end + +.layer LAYER_5047 +/* 0x5047 [0xC2 0xED ] */ transpose -19 +/* 0x5049 [0xC4 ] */ legato +/* 0x504A [0xC7 0x85 0x00 0xFF ] */ portamento 0x85, PITCH_A0, 255 +/* 0x504E [0x58 0x20 0x64 ] */ notedv PITCH_A2, 32, 100 +/* 0x5051 [0x40 0x20 0x64 ] */ notedv PITCH_A0, 32, 100 +/* 0x5054 [0xFF ] */ end + +.channel CHAN_5055 +/* 0x5055 [0x88 0x50 0x5C ] */ ldlayer 0, LAYER_505C +/* 0x5058 [0x89 0x50 0x5E ] */ ldlayer 1, LAYER_505E +/* 0x505B [0xFF ] */ end + +.layer LAYER_505C +/* 0x505C [0xC2 0xFA ] */ transpose -6 +.layer LAYER_505E +/* 0x505E [0xC6 0x00 ] */ instr SF1_INST_0 +/* 0x5060 [0x75 0x30 0x64 ] */ notedv PITCH_D5, 48, 100 +/* 0x5063 [0xFF ] */ end + +.channel CHAN_5064 +/* 0x5064 [0xC1 0x22 ] */ instr SF1_INST_34 +/* 0x5066 [0x88 0x50 0x6E ] */ ldlayer 0, LAYER_506E +/* 0x5069 [0xD7 0x80 ] */ vibfreq 128 +/* 0x506B [0xD8 0xE0 ] */ vibdepth 224 +/* 0x506D [0xFF ] */ end + +.layer LAYER_506E +/* 0x506E [0x60 0x35 0x64 ] */ notedv PITCH_F3, 53, 100 +/* 0x5071 [0xFF ] */ end + +.channel CHAN_5072 +/* 0x5072 [0xC1 0x01 ] */ instr SF1_INST_1 +/* 0x5074 [0x88 0x50 0x83 ] */ ldlayer 0, LAYER_5083 +/* 0x5077 [0x89 0x50 0x81 ] */ ldlayer 1, LAYER_5081 +/* 0x507A [0xD9 0xDC ] */ releaserate 220 +/* 0x507C [0xD7 0x70 ] */ vibfreq 112 +/* 0x507E [0xD8 0x60 ] */ vibdepth 96 +/* 0x5080 [0xFF ] */ end + +.layer LAYER_5081 +/* 0x5081 [0xC2 0x06 ] */ transpose 6 +.layer LAYER_5083 +/* 0x5083 [0x53 0x80 0x90 0x64 ] */ notedv PITCH_E2, 144, 100 +/* 0x5087 [0xF4 0xFA ] */ rjump LAYER_5083 + +.channel CHAN_5089 +/* 0x5089 [0x88 0x50 0x95 ] */ ldlayer 0, LAYER_5095 +/* 0x508C [0x89 0x50 0x93 ] */ ldlayer 1, LAYER_5093 +/* 0x508F [0x8A 0x50 0xA3 ] */ ldlayer 2, LAYER_50A3 +/* 0x5092 [0xFF ] */ end + +.layer LAYER_5093 +/* 0x5093 [0xC2 0x02 ] */ transpose 2 +.layer LAYER_5095 +/* 0x5095 [0xC6 0x06 ] */ instr SF1_INST_6 +/* 0x5097 [0xCB 0x69 0x6C 0xFA ] */ env ENVELOPE_696C, 250 +/* 0x509B [0xC7 0x81 0x13 0x32 ] */ portamento 0x81, PITCH_E2, 50 +/* 0x509F [0x47 0x20 0x64 ] */ notedv PITCH_E1, 32, 100 +/* 0x50A2 [0xFF ] */ end + +.layer LAYER_50A3 +/* 0x50A3 [0xC6 0x05 ] */ instr SF1_INST_5 +/* 0x50A5 [0xCB 0x69 0x6C 0xFA ] */ env ENVELOPE_696C, 250 +/* 0x50A9 [0xC7 0x81 0x0F 0x32 ] */ portamento 0x81, PITCH_C2, 50 +/* 0x50AD [0x4C 0x20 0x64 ] */ notedv PITCH_A1, 32, 100 +/* 0x50B0 [0xFF ] */ end + +.channel CHAN_50B1 +/* 0x50B1 [0xC1 0x0A ] */ instr SF1_INST_10 +/* 0x50B3 [0x88 0x50 0xB7 ] */ ldlayer 0, LAYER_50B7 +/* 0x50B6 [0xFF ] */ end + +.layer LAYER_50B7 +/* 0x50B7 [0xC7 0x85 0x15 0xC8 ] */ portamento 0x85, PITCH_GF2, 200 +/* 0x50BB [0x5D 0x13 0x64 ] */ notedv PITCH_D3, 19, 100 +/* 0x50BE [0x55 0x13 0x64 ] */ notedv PITCH_GF2, 19, 100 +/* 0x50C1 [0xFF ] */ end + +.channel CHAN_50C2 +/* 0x50C2 [0x88 0x50 0xD3 ] */ ldlayer 0, LAYER_50D3 +/* 0x50C5 [0x89 0x45 0x24 ] */ ldlayer 1, LAYER_4524 +/* 0x50C8 [0x8A 0x45 0x32 ] */ ldlayer 2, LAYER_4532 +/* 0x50CB [0x8B 0x48 0x29 ] */ ldlayer 3, LAYER_4829 +/* 0x50CE [0xD7 0x30 ] */ vibfreq 48 +/* 0x50D0 [0xD8 0x30 ] */ vibdepth 48 +/* 0x50D2 [0xFF ] */ end + +.layer LAYER_50D3 +/* 0x50D3 [0xC6 0x10 ] */ instr SF1_INST_16 +/* 0x50D5 [0xC4 ] */ legato +/* 0x50D6 [0xC7 0x85 0x04 0x3C ] */ portamento 0x85, PITCH_DF1, 60 +/* 0x50DA [0x51 0x32 0x64 ] */ notedv PITCH_D2, 50, 100 +/* 0x50DD [0x4B 0x7F 0x64 ] */ notedv PITCH_AF1, 127, 100 +/* 0x50E0 [0xFF ] */ end + +.channel CHAN_50E1 +/* 0x50E1 [0x88 0x50 0xD3 ] */ ldlayer 0, LAYER_50D3 +/* 0x50E4 [0xD7 0x30 ] */ vibfreq 48 +/* 0x50E6 [0xD8 0x30 ] */ vibdepth 48 +/* 0x50E8 [0xFF ] */ end + +.channel CHAN_50E9 +/* 0x50E9 [0xC1 0x08 ] */ instr SF1_INST_8 +/* 0x50EB [0x88 0x50 0xF8 ] */ ldlayer 0, LAYER_50F8 +/* 0x50EE [0x89 0x50 0xF6 ] */ ldlayer 1, LAYER_50F6 +/* 0x50F1 [0xD7 0x60 ] */ vibfreq 96 +/* 0x50F3 [0xD8 0x50 ] */ vibdepth 80 +/* 0x50F5 [0xFF ] */ end + +.layer LAYER_50F6 +/* 0x50F6 [0xC2 0x06 ] */ transpose 6 +.layer LAYER_50F8 +/* 0x50F8 [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +/* 0x50FC [0x4F 0x81 0x18 0x64 ] */ notedv PITCH_C2, 280, 100 +/* 0x5100 [0xFF ] */ end + +.channel CHAN_5101 +/* 0x5101 [0xC1 0x85 ] */ instr FONTANY_INSTR_BELL +/* 0x5103 [0x88 0x51 0x0B ] */ ldlayer 0, LAYER_510B +/* 0x5106 [0xD7 0x80 ] */ vibfreq 128 +/* 0x5108 [0xD8 0x74 ] */ vibdepth 116 +/* 0x510A [0xFF ] */ end + +.layer LAYER_510B +/* 0x510B [0x6C 0xF5 0x30 0x40 ] */ notedv PITCH_F4, 30000, 64 +/* 0x510F [0xF4 0xFA ] */ rjump LAYER_510B + +.channel CHAN_5111 +/* 0x5111 [0xC1 0x18 ] */ instr SF1_INST_24 +/* 0x5113 [0x88 0x51 0x1B ] */ ldlayer 0, LAYER_511B +/* 0x5116 [0xD7 0xD0 ] */ vibfreq 208 +/* 0x5118 [0xD8 0x60 ] */ vibdepth 96 +/* 0x511A [0xFF ] */ end + +.layer LAYER_511B +/* 0x511B [0x48 0xF5 0x30 0x40 ] */ notedv PITCH_F1, 30000, 64 +/* 0x511F [0xF4 0xFA ] */ rjump LAYER_511B + +.channel CHAN_5121 +/* 0x5121 [0xC1 0x13 ] */ instr SF1_INST_19 +/* 0x5123 [0x88 0x51 0x27 ] */ ldlayer 0, LAYER_5127 +/* 0x5126 [0xFF ] */ end + +.layer LAYER_5127 +/* 0x5127 [0x44 0xF5 0x30 0x64 ] */ notedv PITCH_DF1, 30000, 100 +/* 0x512B [0xF4 0xFA ] */ rjump LAYER_5127 + +.channel CHAN_512D +/* 0x512D [0x88 0x45 0xDF ] */ ldlayer 0, LAYER_45DF +/* 0x5130 [0xD7 0xA0 ] */ vibfreq 160 +/* 0x5132 [0xD8 0xA0 ] */ vibdepth 160 +/* 0x5134 [0xFF ] */ end + +.channel CHAN_5135 +/* 0x5135 [0xC1 0x2C ] */ instr SF1_INST_44 +/* 0x5137 [0x88 0x51 0x42 ] */ ldlayer 0, LAYER_5142 +/* 0x513A [0x89 0x51 0x44 ] */ ldlayer 1, LAYER_5144 +/* 0x513D [0xD7 0xB0 ] */ vibfreq 176 +/* 0x513F [0xD8 0xA0 ] */ vibdepth 160 +/* 0x5141 [0xFF ] */ end + +.layer LAYER_5142 +/* 0x5142 [0xC2 0xFB ] */ transpose -5 +.layer LAYER_5144 +/* 0x5144 [0xC7 0x85 0x27 0x64 ] */ portamento 0x85, PITCH_C4, 100 +/* 0x5148 [0x5F 0x10 0x64 ] */ notedv PITCH_E3, 16, 100 +/* 0x514B [0x74 0x13 0x64 ] */ notedv PITCH_DF5, 19, 100 +/* 0x514E [0xFF ] */ end + +.channel CHAN_514F +/* 0x514F [0x88 0x51 0x60 ] */ ldlayer 0, LAYER_5160 +/* 0x5152 [0x89 0x51 0x56 ] */ ldlayer 1, LAYER_5156 +/* 0x5155 [0xFF ] */ end + +.layer LAYER_5156 +/* 0x5156 [0xC6 0x05 ] */ instr SF1_INST_5 +/* 0x5158 [0xC7 0x81 0x08 0xFF ] */ portamento 0x81, PITCH_F1, 255 +/* 0x515C [0x4F 0x40 0x64 ] */ notedv PITCH_C2, 64, 100 +/* 0x515F [0xFF ] */ end + +.layer LAYER_5160 +/* 0x5160 [0xC0 0x08 ] */ ldelay 8 +/* 0x5162 [0xF4 0xF2 ] */ rjump LAYER_5156 + +.channel CHAN_5164 +/* 0x5164 [0x88 0x51 0x6C ] */ ldlayer 0, LAYER_516C +/* 0x5167 [0xD7 0x40 ] */ vibfreq 64 +/* 0x5169 [0xD8 0x60 ] */ vibdepth 96 +/* 0x516B [0xFF ] */ end + +.layer LAYER_516C +/* 0x516C [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x516E [0xC4 ] */ legato +/* 0x516F [0xC7 0x85 0x27 0xFF ] */ portamento 0x85, PITCH_C4, 255 +/* 0x5173 [0x69 0x08 0x64 ] */ notedv PITCH_D4, 8, 100 +/* 0x5176 [0x64 0x20 0x64 ] */ notedv PITCH_A3, 32, 100 +/* 0x5179 [0xFF ] */ end + +.channel CHAN_517A +/* 0x517A [0x88 0x51 0x88 ] */ ldlayer 0, LAYER_5188 +/* 0x517D [0x89 0x41 0x8B ] */ ldlayer 1, LAYER_418B +/* 0x5180 [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x5183 [0xD7 0x40 ] */ vibfreq 64 +/* 0x5185 [0xD8 0xC0 ] */ vibdepth 192 +/* 0x5187 [0xFF ] */ end + +.layer LAYER_5188 +/* 0x5188 [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x518A [0xC4 ] */ legato +/* 0x518B [0xC7 0x85 0x19 0xFF ] */ portamento 0x85, PITCH_BF2, 255 +/* 0x518F [0x61 0x14 0x50 ] */ notedv PITCH_GF3, 20, 80 +/* 0x5192 [0x55 0x60 0x50 ] */ notedv PITCH_GF2, 96, 80 +/* 0x5195 [0xFF ] */ end + +.channel CHAN_5196 +/* 0x5196 [0xC1 0x21 ] */ instr SF1_INST_33 +/* 0x5198 [0x88 0x51 0x9C ] */ ldlayer 0, LAYER_519C +/* 0x519B [0xFF ] */ end + +.layer LAYER_519C +/* 0x519C [0xF8 0x06 ] */ loop 6 +/* 0x519E [0x73 0x09 0x64 ] */ notedv PITCH_C5, 9, 100 +/* 0x51A1 [0x75 0x09 0x64 ] */ notedv PITCH_D5, 9, 100 +/* 0x51A4 [0x77 0x09 0x64 ] */ notedv PITCH_E5, 9, 100 +/* 0x51A7 [0xF7 ] */ loopend +.layer LAYER_51A8 +/* 0x51A8 [0xCB 0x69 0x7C 0xFF ] */ env ENVELOPE_697C, 255 +LAYER_51AC: +/* 0x51AC [0x79 0x06 0x64 ] */ notedv PITCH_GF5, 6, 100 +/* 0x51AF [0x7B 0x06 0x64 ] */ notedv PITCH_AF5, 6, 100 +/* 0x51B2 [0x7D 0x06 0x64 ] */ notedv PITCH_BF5, 6, 100 +/* 0x51B5 [0x7B 0x06 0x64 ] */ notedv PITCH_AF5, 6, 100 +/* 0x51B8 [0xF4 0xF2 ] */ rjump LAYER_51AC + +.channel CHAN_51BA +/* 0x51BA [0xC1 0x02 ] */ instr SF1_INST_2 +/* 0x51BC [0x88 0x51 0xC0 ] */ ldlayer 0, LAYER_51C0 +/* 0x51BF [0xFF ] */ end + +.layer LAYER_51C0 +/* 0x51C0 [0x58 0x30 0x64 ] */ notedv PITCH_A2, 48, 100 +/* 0x51C3 [0xFF ] */ end + +.channel CHAN_51C4 +/* 0x51C4 [0x88 0x51 0xCB ] */ ldlayer 0, LAYER_51CB +/* 0x51C7 [0x89 0x51 0xD9 ] */ ldlayer 1, LAYER_51D9 +/* 0x51CA [0xFF ] */ end + +.layer LAYER_51CB +/* 0x51CB [0xC6 0x12 ] */ instr SF1_INST_18 +LAYER_51CD: +/* 0x51CD [0xC2 0x0C ] */ transpose 12 +/* 0x51CF [0xCB 0x6A 0x7C 0xE0 ] */ env ENVELOPE_6A7C, 224 +LAYER_51D3: +/* 0x51D3 [0x73 0xF5 0x30 0x64 ] */ notedv PITCH_C5, 30000, 100 +/* 0x51D7 [0xF4 0xFA ] */ rjump LAYER_51D3 + +.layer LAYER_51D9 +/* 0x51D9 [0xC6 0x1F ] */ instr SF1_INST_31 +/* 0x51DB [0xF4 0xF0 ] */ rjump LAYER_51CD + +.channel CHAN_51DD +/* 0x51DD [0xC1 0x06 ] */ instr SF1_INST_6 +/* 0x51DF [0x88 0x51 0xE3 ] */ ldlayer 0, LAYER_51E3 +/* 0x51E2 [0xFF ] */ end + +.layer LAYER_51E3 +/* 0x51E3 [0xC7 0x81 0x14 0x40 ] */ portamento 0x81, PITCH_F2, 64 +/* 0x51E7 [0x4D 0x0D 0x64 ] */ notedv PITCH_BF1, 13, 100 +/* 0x51EA [0xFF ] */ end + +.channel CHAN_51EB +/* 0x51EB [0x88 0x51 0xF6 ] */ ldlayer 0, LAYER_51F6 +/* 0x51EE [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x51F1 [0xD7 0x40 ] */ vibfreq 64 +/* 0x51F3 [0xD8 0xD0 ] */ vibdepth 208 +/* 0x51F5 [0xFF ] */ end + +.layer LAYER_51F6 +/* 0x51F6 [0xC6 0x23 ] */ instr SF1_INST_35 +/* 0x51F8 [0xC4 ] */ legato +/* 0x51F9 [0xC7 0x85 0x2F 0x64 ] */ portamento 0x85, PITCH_AF4, 100 +/* 0x51FD [0x78 0x14 0x64 ] */ notedv PITCH_F5, 20, 100 +/* 0x5200 [0x6F 0x24 0x64 ] */ notedv PITCH_AF4, 36, 100 +/* 0x5203 [0xFF ] */ end + +.channel CHAN_5204 +/* 0x5204 [0x88 0x43 0x01 ] */ ldlayer 0, LAYER_4301 +/* 0x5207 [0xFF ] */ end + +.channel CHAN_5208 +/* 0x5208 [0x88 0x52 0x1B ] */ ldlayer 0, LAYER_521B +/* 0x520B [0x89 0x52 0x19 ] */ ldlayer 1, LAYER_5219 +/* 0x520E [0x8A 0x52 0x26 ] */ ldlayer 2, LAYER_5226 +/* 0x5211 [0x8B 0x52 0x28 ] */ ldlayer 3, LAYER_5228 +/* 0x5214 [0xD7 0x30 ] */ vibfreq 48 +/* 0x5216 [0xD8 0x20 ] */ vibdepth 32 +/* 0x5218 [0xFF ] */ end + +.layer LAYER_5219 +/* 0x5219 [0xC2 0x02 ] */ transpose 2 +.layer LAYER_521B +/* 0x521B [0xC6 0x02 ] */ instr SF1_INST_2 +/* 0x521D [0xC7 0x81 0x15 0xFF ] */ portamento 0x81, PITCH_GF2, 255 +/* 0x5221 [0x72 0x80 0xE0 0x64 ] */ notedv PITCH_B4, 224, 100 +/* 0x5225 [0xFF ] */ end + +.layer LAYER_5226 +/* 0x5226 [0xC2 0x01 ] */ transpose 1 +.layer LAYER_5228 +/* 0x5228 [0xC6 0x2B ] */ instr SF1_INST_43 +/* 0x522A [0x6C 0x80 0xE0 0x64 ] */ notedv PITCH_F4, 224, 100 +/* 0x522E [0xFF ] */ end + +.channel CHAN_522F +/* 0x522F [0xC1 0x13 ] */ instr SF1_INST_19 +/* 0x5231 [0x88 0x52 0x3A ] */ ldlayer 0, LAYER_523A +/* 0x5234 [0x89 0x52 0x3C ] */ ldlayer 1, LAYER_523C +/* 0x5237 [0xD9 0xE0 ] */ releaserate 224 +/* 0x5239 [0xFF ] */ end + +.layer LAYER_523A +/* 0x523A [0xC2 0xFA ] */ transpose -6 +.layer LAYER_523C +/* 0x523C [0x55 0xF5 0x30 0x64 ] */ notedv PITCH_GF2, 30000, 100 +/* 0x5240 [0xF4 0xFA ] */ rjump LAYER_523C + +.channel CHAN_5242 +/* 0x5242 [0xC1 0x21 ] */ instr SF1_INST_33 +/* 0x5244 [0x88 0x52 0x4B ] */ ldlayer 0, LAYER_524B +/* 0x5247 [0xDA 0x69 0x7C ] */ env ENVELOPE_697C +/* 0x524A [0xFF ] */ end + +.layer LAYER_524B +/* 0x524B [0x79 0x06 0x50 ] */ notedv PITCH_GF5, 6, 80 +/* 0x524E [0x7B 0x06 0x50 ] */ notedv PITCH_AF5, 6, 80 +/* 0x5251 [0x7D 0x06 0x50 ] */ notedv PITCH_BF5, 6, 80 +/* 0x5254 [0x7B 0x06 0x50 ] */ notedv PITCH_AF5, 6, 80 +/* 0x5257 [0xF4 0xF2 ] */ rjump LAYER_524B + +.channel CHAN_5259 +/* 0x5259 [0x88 0x45 0x24 ] */ ldlayer 0, LAYER_4524 +/* 0x525C [0x89 0x45 0x32 ] */ ldlayer 1, LAYER_4532 +/* 0x525F [0xD7 0x30 ] */ vibfreq 48 +/* 0x5261 [0xD8 0x30 ] */ vibdepth 48 +/* 0x5263 [0xFF ] */ end + +.channel CHAN_5264 +/* 0x5264 [0x88 0x52 0x77 ] */ ldlayer 0, LAYER_5277 +/* 0x5267 [0x89 0x52 0x75 ] */ ldlayer 1, LAYER_5275 +/* 0x526A [0x8A 0x52 0x86 ] */ ldlayer 2, LAYER_5286 +/* 0x526D [0x8B 0x48 0x29 ] */ ldlayer 3, LAYER_4829 +/* 0x5270 [0xD7 0x46 ] */ vibfreq 70 +/* 0x5272 [0xD8 0x56 ] */ vibdepth 86 +/* 0x5274 [0xFF ] */ end + +.layer LAYER_5275 +/* 0x5275 [0xC2 0x02 ] */ transpose 2 +.layer LAYER_5277 +/* 0x5277 [0xC6 0x03 ] */ instr SF1_INST_3 +LAYER_5279: +/* 0x5279 [0xC4 ] */ legato +/* 0x527A [0xC7 0x85 0x1B 0x7F ] */ portamento 0x85, PITCH_C3, 127 +/* 0x527E [0x64 0x28 0x64 ] */ notedv PITCH_A3, 40, 100 +/* 0x5281 [0x5F 0x80 0xC8 0x64 ] */ notedv PITCH_E3, 200, 100 +/* 0x5285 [0xFF ] */ end + +.layer LAYER_5286 +/* 0x5286 [0xC6 0x29 ] */ instr SF1_INST_41 +/* 0x5288 [0xC2 0x0C ] */ transpose 12 +/* 0x528A [0xF4 0xED ] */ rjump LAYER_5279 + +.channel CHAN_528C +/* 0x528C [0x88 0x52 0x9A ] */ ldlayer 0, LAYER_529A +/* 0x528F [0x89 0x52 0xA6 ] */ ldlayer 1, LAYER_52A6 +/* 0x5292 [0x8A 0x52 0xA8 ] */ ldlayer 2, LAYER_52A8 +/* 0x5295 [0xD7 0x14 ] */ vibfreq 20 +/* 0x5297 [0xD8 0x14 ] */ vibdepth 20 +/* 0x5299 [0xFF ] */ end + +.layer LAYER_529A +/* 0x529A [0xC6 0x13 ] */ instr SF1_INST_19 +LAYER_529C: +/* 0x529C [0xCB 0x6A 0x7C 0xC8 ] */ env ENVELOPE_6A7C, 200 +LAYER_52A0: +/* 0x52A0 [0x4F 0xF5 0x30 0x64 ] */ notedv PITCH_C2, 30000, 100 +/* 0x52A4 [0xF4 0xFA ] */ rjump LAYER_52A0 + +.layer LAYER_52A6 +/* 0x52A6 [0xC2 0xFF ] */ transpose -1 +.layer LAYER_52A8 +/* 0x52A8 [0xC6 0x02 ] */ instr SF1_INST_2 +/* 0x52AA [0xF4 0xF0 ] */ rjump LAYER_529C + +.channel CHAN_52AC +/* 0x52AC [0x88 0x52 0xBC ] */ ldlayer 0, LAYER_52BC +/* 0x52AF [0x89 0x52 0xC4 ] */ ldlayer 1, LAYER_52C4 +/* 0x52B2 [0x8A 0x52 0xBA ] */ ldlayer 2, LAYER_52BA +/* 0x52B5 [0xD7 0x60 ] */ vibfreq 96 +/* 0x52B7 [0xD8 0x54 ] */ vibdepth 84 +/* 0x52B9 [0xFF ] */ end + +.layer LAYER_52BA +/* 0x52BA [0xC2 0x04 ] */ transpose 4 +.layer LAYER_52BC +/* 0x52BC [0xC6 0x13 ] */ instr SF1_INST_19 +LAYER_52BE: +/* 0x52BE [0x58 0xF5 0x30 0x64 ] */ notedv PITCH_A2, 30000, 100 +/* 0x52C2 [0xF4 0xFA ] */ rjump LAYER_52BE + +.layer LAYER_52C4 +/* 0x52C4 [0xC6 0x12 ] */ instr SF1_INST_18 +LAYER_52C6: +/* 0x52C6 [0x70 0xF5 0x30 0x50 ] */ notedv PITCH_A4, 30000, 80 +/* 0x52CA [0xF4 0xFA ] */ rjump LAYER_52C6 + +.channel CHAN_52CC +/* 0x52CC [0xC1 0x30 ] */ instr SF1_INST_48 +/* 0x52CE [0x88 0x52 0xD2 ] */ ldlayer 0, LAYER_52D2 +/* 0x52D1 [0xFF ] */ end + +.layer LAYER_52D2 +/* 0x52D2 [0xC2 0x30 ] */ transpose 48 +/* 0x52D4 [0x59 0x80 0xE0 0x64 ] */ notedv PITCH_BF2, 224, 100 +/* 0x52D8 [0xFF ] */ end + +.channel CHAN_52D9 +/* 0x52D9 [0x88 0x3F 0xBA ] */ ldlayer 0, LAYER_3FBA +/* 0x52DC [0x89 0x51 0x88 ] */ ldlayer 1, LAYER_5188 +/* 0x52DF [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x52E2 [0xD7 0x40 ] */ vibfreq 64 +/* 0x52E4 [0xD8 0xC0 ] */ vibdepth 192 +/* 0x52E6 [0xFF ] */ end + +.channel CHAN_52E7 +/* 0x52E7 [0x88 0x3F 0x78 ] */ ldlayer 0, LAYER_3F78 +/* 0x52EA [0x89 0x40 0x0C ] */ ldlayer 1, LAYER_400C +/* 0x52ED [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x52F0 [0xD7 0x70 ] */ vibfreq 112 +/* 0x52F2 [0xD8 0x30 ] */ vibdepth 48 +/* 0x52F4 [0xFF ] */ end + +.channel CHAN_52F5 +/* 0x52F5 [0x88 0x40 0x81 ] */ ldlayer 0, LAYER_4081 +/* 0x52F8 [0x89 0x52 0xFC ] */ ldlayer 1, LAYER_52FC +/* 0x52FB [0xFF ] */ end + +.layer LAYER_52FC +/* 0x52FC [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x52FE [0x53 0x00 0x50 ] */ notedv PITCH_E2, 0, 80 +/* 0x5301 [0xFF ] */ end + +.channel CHAN_5302 +/* 0x5302 [0x88 0x53 0x09 ] */ ldlayer 0, LAYER_5309 +/* 0x5305 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x5308 [0xFF ] */ end + +.layer LAYER_5309 +/* 0x5309 [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x530B [0x54 0x00 0x64 ] */ notedv PITCH_F2, 0, 100 +/* 0x530E [0xFF ] */ end + +.channel CHAN_530F +/* 0x530F [0x88 0x53 0x16 ] */ ldlayer 0, LAYER_5316 +/* 0x5312 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x5315 [0xFF ] */ end + +.layer LAYER_5316 +/* 0x5316 [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x5318 [0x55 0x00 0x64 ] */ notedv PITCH_GF2, 0, 100 +/* 0x531B [0xFF ] */ end + +.channel CHAN_531C +/* 0x531C [0x88 0x53 0x20 ] */ ldlayer 0, LAYER_5320 +/* 0x531F [0xFF ] */ end + +.layer LAYER_5320 +/* 0x5320 [0xC6 0x06 ] */ instr SF1_INST_6 +/* 0x5322 [0xC7 0x81 0x2C 0x40 ] */ portamento 0x81, PITCH_F4, 64 +/* 0x5326 [0x61 0x05 0x48 ] */ notedv PITCH_GF3, 5, 72 +/* 0x5329 [0xFF ] */ end + +.channel CHAN_532A +/* 0x532A [0x88 0x53 0x35 ] */ ldlayer 0, LAYER_5335 +/* 0x532D [0x89 0x53 0x3C ] */ ldlayer 1, LAYER_533C +/* 0x5330 [0xD7 0x38 ] */ vibfreq 56 +/* 0x5332 [0xD8 0x32 ] */ vibdepth 50 +/* 0x5334 [0xFF ] */ end + +.layer LAYER_5335 +/* 0x5335 [0xC6 0x02 ] */ instr SF1_INST_2 +/* 0x5337 [0x5B 0x80 0xC8 0x64 ] */ notedv PITCH_C3, 200, 100 +/* 0x533B [0xFF ] */ end + +.layer LAYER_533C +/* 0x533C [0xC6 0x23 ] */ instr SF1_INST_35 +/* 0x533E [0xC4 ] */ legato +/* 0x533F [0xC7 0x85 0x20 0xC8 ] */ portamento 0x85, PITCH_F3, 200 +/* 0x5343 [0x69 0x10 0x64 ] */ notedv PITCH_D4, 16, 100 +/* 0x5346 [0x5E 0x80 0x96 0x64 ] */ notedv PITCH_EF3, 150, 100 +/* 0x534A [0xFF ] */ end + +.channel CHAN_534B +/* 0x534B [0x88 0x53 0x4F ] */ ldlayer 0, LAYER_534F +/* 0x534E [0xFF ] */ end + +.layer LAYER_534F +/* 0x534F [0xC6 0x28 ] */ instr SF1_INST_40 +/* 0x5351 [0xC4 ] */ legato +/* 0x5352 [0xC7 0x85 0x1E 0xFF ] */ portamento 0x85, PITCH_EF3, 255 +/* 0x5356 [0x66 0x20 0x64 ] */ notedv PITCH_B3, 32, 100 +/* 0x5359 [0x53 0x50 0x64 ] */ notedv PITCH_E2, 80, 100 +/* 0x535C [0xFF ] */ end + +.channel CHAN_535D +/* 0x535D [0x88 0x53 0x65 ] */ ldlayer 0, LAYER_5365 +/* 0x5360 [0xD7 0xD0 ] */ vibfreq 208 +/* 0x5362 [0xD8 0xD0 ] */ vibdepth 208 +/* 0x5364 [0xFF ] */ end + +.layer LAYER_5365 +/* 0x5365 [0xC6 0x13 ] */ instr SF1_INST_19 +/* 0x5367 [0xC4 ] */ legato +/* 0x5368 [0xC2 0x0F ] */ transpose 15 +/* 0x536A [0xC7 0x85 0x27 0xEF ] */ portamento 0x85, PITCH_C4, 239 +/* 0x536E [0x5C 0x18 0x64 ] */ notedv PITCH_DF3, 24, 100 +/* 0x5371 [0x7E 0x38 0x64 ] */ notedv PITCH_B5, 56, 100 +/* 0x5374 [0xFF ] */ end + +.channel CHAN_5375 +/* 0x5375 [0x88 0x3A 0x9A ] */ ldlayer 0, LAYER_3A9A +/* 0x5378 [0x89 0x39 0x62 ] */ ldlayer 1, LAYER_3962 +/* 0x537B [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x537E [0xFF ] */ end + +.channel CHAN_537F +/* 0x537F [0x88 0x3A 0x47 ] */ ldlayer 0, LAYER_3A47 +/* 0x5382 [0x89 0x39 0x62 ] */ ldlayer 1, LAYER_3962 +/* 0x5385 [0x8A 0x48 0x29 ] */ ldlayer 2, LAYER_4829 +/* 0x5388 [0xFF ] */ end + +.channel CHAN_5389 +/* 0x5389 [0x88 0x53 0x8D ] */ ldlayer 0, LAYER_538D +/* 0x538C [0xFF ] */ end + +.layer LAYER_538D +/* 0x538D [0xC6 0x28 ] */ instr SF1_INST_40 +/* 0x538F [0xCB 0x68 0xB4 0xDC ] */ env ENVELOPE_68B4, 220 +/* 0x5393 [0x69 0x64 0x64 ] */ notedv PITCH_D4, 100, 100 +/* 0x5396 [0xFF ] */ end + +.channel CHAN_5397 +/* 0x5397 [0xC1 0x2B ] */ instr SF1_INST_43 +/* 0x5399 [0x88 0x53 0x9F ] */ ldlayer 0, LAYER_539F +/* 0x539C [0xED 0x10 ] */ gain 16 +/* 0x539E [0xFF ] */ end + +.layer LAYER_539F +/* 0x539F [0xC7 0x81 0x23 0xEF ] */ portamento 0x81, PITCH_AF3, 239 +/* 0x53A3 [0x57 0x80 0xE0 0x64 ] */ notedv PITCH_AF2, 224, 100 +/* 0x53A7 [0xFF ] */ end + +.channel CHAN_53A8 +/* 0x53A8 [0x88 0x53 0xB3 ] */ ldlayer 0, LAYER_53B3 +/* 0x53AB [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x53AE [0xD7 0xE0 ] */ vibfreq 224 +/* 0x53B0 [0xD8 0x60 ] */ vibdepth 96 +/* 0x53B2 [0xFF ] */ end + +.layer LAYER_53B3 +/* 0x53B3 [0xC6 0x2F ] */ instr SF1_INST_47 +/* 0x53B5 [0x58 0x40 0x64 ] */ notedv PITCH_A2, 64, 100 +/* 0x53B8 [0xFF ] */ end + +.channel CHAN_53B9 +/* 0x53B9 [0x88 0x53 0xC0 ] */ ldlayer 0, LAYER_53C0 +/* 0x53BC [0x89 0x53 0xB3 ] */ ldlayer 1, LAYER_53B3 +/* 0x53BF [0xFF ] */ end + +.layer LAYER_53C0 +/* 0x53C0 [0xC6 0x28 ] */ instr SF1_INST_40 +/* 0x53C2 [0x63 0x04 0x64 ] */ notedv PITCH_AF3, 4, 100 +/* 0x53C5 [0x65 0x04 0x64 ] */ notedv PITCH_BF3, 4, 100 +/* 0x53C8 [0x68 0x05 0x64 ] */ notedv PITCH_DF4, 5, 100 +/* 0x53CB [0x6C 0x07 0x64 ] */ notedv PITCH_F4, 7, 100 +/* 0x53CE [0x66 0x30 0x64 ] */ notedv PITCH_B3, 48, 100 +/* 0x53D1 [0xFF ] */ end + +.channel CHAN_53D2 +/* 0x53D2 [0x88 0x53 0xC0 ] */ ldlayer 0, LAYER_53C0 +/* 0x53D5 [0xFF ] */ end + +.channel CHAN_53D6 +/* 0x53D6 [0x88 0x36 0x4C ] */ ldlayer 0, LAYER_364C +/* 0x53D9 [0x89 0x53 0xB3 ] */ ldlayer 1, LAYER_53B3 +/* 0x53DC [0xFF ] */ end + +.channel CHAN_53DD +/* 0x53DD [0x88 0x42 0x20 ] */ ldlayer 0, LAYER_4220 +/* 0x53E0 [0x89 0x53 0xE4 ] */ ldlayer 1, LAYER_53E4 +/* 0x53E3 [0xFF ] */ end + +.layer LAYER_53E4 +/* 0x53E4 [0xC6 0x1D ] */ instr SF1_INST_29 +/* 0x53E6 [0x7E 0x5A 0x46 ] */ notedv PITCH_B5, 90, 70 +/* 0x53E9 [0xFF ] */ end + +.channel CHAN_53EA +/* 0x53EA [0xC1 0x21 ] */ instr SF1_INST_33 +/* 0x53EC [0x88 0x51 0xA8 ] */ ldlayer 0, LAYER_51A8 +/* 0x53EF [0xFF ] */ end + +.channel CHAN_53F0 +/* 0x53F0 [0x88 0x50 0x08 ] */ ldlayer 0, LAYER_5008 +/* 0x53F3 [0x89 0x53 0xFB ] */ ldlayer 1, LAYER_53FB +/* 0x53F6 [0xD7 0x30 ] */ vibfreq 48 +/* 0x53F8 [0xD8 0xF0 ] */ vibdepth 240 +/* 0x53FA [0xFF ] */ end + +.layer LAYER_53FB +/* 0x53FB [0xC6 0x13 ] */ instr SF1_INST_19 +LAYER_53FD: +/* 0x53FD [0x58 0xF5 0x30 0x40 ] */ notedv PITCH_A2, 30000, 64 +/* 0x5401 [0xF4 0xFA ] */ rjump LAYER_53FD + +.channel CHAN_5403 +/* 0x5403 [0xC1 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x5405 [0x64 ] */ ldio IO_PORT_SFX_INDEX_LOBITS +/* 0x5406 [0xC8 0xB0 ] */ sub 176 +/* 0x5408 [0xC7 0x00 0x54 0x17 ] */ stseq (NOTEDVG_OPCODE | PITCH_A0), LAYER_5417 + STSEQ_NOTEDVG_OPCODE_PITCH +/* 0x540C [0xCB 0x54 0x1C ] */ ldseq UNK_541C +/* 0x540F [0xC7 0x00 0x54 0x19 ] */ stseq 0, LAYER_5417 + STSEQ_NOTEDVG_DELAY_LO +/* 0x5413 [0x88 0x54 0x17 ] */ ldlayer 0, LAYER_5417 +/* 0x5416 [0xFF ] */ end + +.layer LAYER_5417 +/* 0x5417 [0x00 0x00 0x64 0x00 ] */ notedvg PITCH_A0, 0, 100, 0 +/* 0x541B [0xFF ] */ end + +UNK_541C: + .byte 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64 + .byte 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64 + .byte 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64 + +.channel CHAN_5443 +/* 0x5443 [0x88 0x42 0x20 ] */ ldlayer 0, LAYER_4220 +/* 0x5446 [0x89 0x42 0x14 ] */ ldlayer 1, LAYER_4214 +/* 0x5449 [0xFF ] */ end + +.channel CHAN_544A +/* 0x544A [0x88 0x43 0x4A ] */ ldlayer 0, LAYER_434A +/* 0x544D [0x89 0x43 0x4C ] */ ldlayer 1, LAYER_434C +/* 0x5450 [0xFF ] */ end + +.channel CHAN_5451 +/* 0x5451 [0x88 0x54 0x58 ] */ ldlayer 0, LAYER_5458 +/* 0x5454 [0x89 0x54 0x60 ] */ ldlayer 1, LAYER_5460 +/* 0x5457 [0xFF ] */ end + +.layer LAYER_5458 +/* 0x5458 [0xC6 0x05 ] */ instr SF1_INST_5 +/* 0x545A [0xC0 0x08 ] */ ldelay 8 +/* 0x545C [0x56 0x25 0x64 ] */ notedv PITCH_G2, 37, 100 +/* 0x545F [0xFF ] */ end + +.layer LAYER_5460 +/* 0x5460 [0xC6 0x15 ] */ instr SF1_INST_21 +/* 0x5462 [0x5C 0x2D 0x64 ] */ notedv PITCH_DF3, 45, 100 +/* 0x5465 [0xFF ] */ end + +.channel CHAN_5466 +/* 0x5466 [0xC1 0x2F ] */ instr SF1_INST_47 +/* 0x5468 [0x88 0x54 0x6C ] */ ldlayer 0, LAYER_546C +/* 0x546B [0xFF ] */ end + +.layer LAYER_546C +/* 0x546C [0x52 0x0A 0x32 ] */ notedv PITCH_EF2, 10, 50 +/* 0x546F [0x54 0x0A 0x32 ] */ notedv PITCH_F2, 10, 50 +/* 0x5472 [0x56 0x0A 0x32 ] */ notedv PITCH_G2, 10, 50 +/* 0x5475 [0xF4 0xF5 ] */ rjump LAYER_546C + +.channel CHAN_5477 +/* 0x5477 [0x88 0x54 0x7B ] */ ldlayer 0, LAYER_547B +/* 0x547A [0xFF ] */ end + +.layer LAYER_547B +/* 0x547B [0xC6 0x05 ] */ instr SF1_INST_5 +/* 0x547D [0x5C 0x0E 0x46 ] */ notedv PITCH_DF3, 14, 70 +/* 0x5480 [0xFF ] */ end + +.channel CHAN_5481 +/* 0x5481 [0x88 0x54 0x88 ] */ ldlayer 0, LAYER_5488 +/* 0x5484 [0x89 0x40 0x81 ] */ ldlayer 1, LAYER_4081 +/* 0x5487 [0xFF ] */ end + +.layer LAYER_5488 +/* 0x5488 [0xC6 0x2B ] */ instr SF1_INST_43 +/* 0x548A [0xC2 0x0E ] */ transpose 14 +/* 0x548C [0x73 0x30 0x64 ] */ notedv PITCH_C5, 48, 100 +/* 0x548F [0xFF ] */ end + +.channel CHAN_5490 +/* 0x5490 [0x88 0x54 0x9E ] */ ldlayer 0, LAYER_549E +/* 0x5493 [0x89 0x54 0xA0 ] */ ldlayer 1, LAYER_54A0 +/* 0x5496 [0x8A 0x54 0xAE ] */ ldlayer 2, LAYER_54AE +/* 0x5499 [0xD7 0x14 ] */ vibfreq 20 +/* 0x549B [0xD8 0x32 ] */ vibdepth 50 +/* 0x549D [0xFF ] */ end + +.layer LAYER_549E +/* 0x549E [0xC0 0x14 ] */ ldelay 20 +.layer LAYER_54A0 +/* 0x54A0 [0xC6 0x03 ] */ instr SF1_INST_3 +LAYER_54A2: +/* 0x54A2 [0xC4 ] */ legato +/* 0x54A3 [0xC7 0x85 0x1C 0xFF ] */ portamento 0x85, PITCH_DF3, 255 +/* 0x54A7 [0x54 0x30 0x64 ] */ notedv PITCH_F2, 48, 100 +/* 0x54AA [0x52 0x48 0x64 ] */ notedv PITCH_EF2, 72, 100 +/* 0x54AD [0xFF ] */ end + +.layer LAYER_54AE +/* 0x54AE [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x54B0 [0xC2 0x04 ] */ transpose 4 +/* 0x54B2 [0xF4 0xEE ] */ rjump LAYER_54A2 + +.channel CHAN_54B4 +/* 0x54B4 [0x88 0x54 0xC5 ] */ ldlayer 0, LAYER_54C5 +/* 0x54B7 [0x89 0x54 0xC7 ] */ ldlayer 1, LAYER_54C7 +/* 0x54BA [0x8A 0x54 0xE9 ] */ ldlayer 2, LAYER_54E9 +/* 0x54BD [0x8B 0x54 0xEB ] */ ldlayer 3, LAYER_54EB +/* 0x54C0 [0xD7 0x14 ] */ vibfreq 20 +/* 0x54C2 [0xD8 0x32 ] */ vibdepth 50 +/* 0x54C4 [0xFF ] */ end + +.layer LAYER_54C5 +/* 0x54C5 [0xC0 0x0A ] */ ldelay 10 +.layer LAYER_54C7 +/* 0x54C7 [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x54C9 [0xF8 0x04 ] */ loop 4 +/* 0x54CB [0xC7 0x81 0x1E 0x6B ] */ portamento 0x81, PITCH_EF3, 107 +/* 0x54CF [0x6C 0x80 0x8C 0x64 ] */ notedv PITCH_F4, 140, 100 +LAYER_54D3: +/* 0x54D3 [0xC4 ] */ legato +/* 0x54D4 [0xC7 0x85 0x27 0xFF ] */ portamento 0x85, PITCH_C4, 255 +/* 0x54D8 [0x6E 0x30 0x64 ] */ notedv PITCH_G4, 48, 100 +/* 0x54DB [0x63 0x48 0x64 ] */ notedv PITCH_AF3, 72, 100 +/* 0x54DE [0xC5 ] */ nolegato +/* 0x54DF [0xF7 ] */ loopend +/* 0x54E0 [0xC7 0x81 0x23 0xFF ] */ portamento 0x81, PITCH_AF3, 255 +/* 0x54E4 [0x59 0x80 0xFA 0x64 ] */ notedv PITCH_BF2, 250, 100 +/* 0x54E8 [0xFF ] */ end + +.layer LAYER_54E9 +/* 0x54E9 [0xC0 0x0A ] */ ldelay 10 +.layer LAYER_54EB +/* 0x54EB [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x54ED [0xF8 0x04 ] */ loop 4 +/* 0x54EF [0xC7 0x81 0x2C 0x6B ] */ portamento 0x81, PITCH_F4, 107 +/* 0x54F3 [0x70 0x80 0x8C 0x64 ] */ notedv PITCH_A4, 140, 100 +LAYER_54F7: +/* 0x54F7 [0xC4 ] */ legato +/* 0x54F8 [0xC7 0x85 0x2F 0xFF ] */ portamento 0x85, PITCH_AF4, 255 +/* 0x54FC [0x71 0x32 0x64 ] */ notedv PITCH_BF4, 50, 100 +/* 0x54FF [0x69 0x48 0x64 ] */ notedv PITCH_D4, 72, 100 +/* 0x5502 [0xC5 ] */ nolegato +/* 0x5503 [0xF7 ] */ loopend +/* 0x5504 [0xC7 0x81 0x25 0xFF ] */ portamento 0x81, PITCH_BF3, 255 +/* 0x5508 [0x5B 0x80 0xC8 0x64 ] */ notedv PITCH_C3, 200, 100 +/* 0x550C [0xFF ] */ end + +.channel CHAN_550D +/* 0x550D [0x88 0x55 0x1B ] */ ldlayer 0, LAYER_551B +/* 0x5510 [0x89 0x55 0x1D ] */ ldlayer 1, LAYER_551D +/* 0x5513 [0x8A 0x55 0x23 ] */ ldlayer 2, LAYER_5523 +/* 0x5516 [0xD7 0x14 ] */ vibfreq 20 +/* 0x5518 [0xD8 0x32 ] */ vibdepth 50 +/* 0x551A [0xFF ] */ end + +.layer LAYER_551B +/* 0x551B [0xC0 0x0D ] */ ldelay 13 +.layer LAYER_551D +/* 0x551D [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x551F [0xF8 0x01 ] */ loop 1 +/* 0x5521 [0xF4 0xB0 ] */ rjump LAYER_54D3 + +.layer LAYER_5523 +/* 0x5523 [0xC6 0x0B ] */ instr SF1_INST_11 +/* 0x5525 [0xF8 0x01 ] */ loop 1 +/* 0x5527 [0xF4 0xCE ] */ rjump LAYER_54F7 + +.channel CHAN_5529 +/* 0x5529 [0xC1 0x31 ] */ instr SF1_INST_49 +/* 0x552B [0x88 0x55 0x2F ] */ ldlayer 0, LAYER_552F +/* 0x552E [0xFF ] */ end + +.layer LAYER_552F +/* 0x552F [0xC7 0x81 0x2A 0x28 ] */ portamento 0x81, PITCH_EF4, 40 +/* 0x5533 [0x6E 0x7F 0x64 ] */ notedv PITCH_G4, 127, 100 +/* 0x5536 [0xFF ] */ end + +.channel CHAN_5537 +/* 0x5537 [0x88 0x55 0x3E ] */ ldlayer 0, LAYER_553E +/* 0x553A [0x89 0x40 0x81 ] */ ldlayer 1, LAYER_4081 +/* 0x553D [0xFF ] */ end + +.layer LAYER_553E +/* 0x553E [0xC6 0x31 ] */ instr SF1_INST_49 +/* 0x5540 [0xC7 0x81 0x23 0x48 ] */ portamento 0x81, PITCH_AF3, 72 +/* 0x5544 [0x6C 0x40 0x64 ] */ notedv PITCH_F4, 64, 100 +/* 0x5547 [0xFF ] */ end + +.channel CHAN_5548 +/* 0x5548 [0xC1 0x31 ] */ instr SF1_INST_49 +/* 0x554A [0x88 0x55 0x51 ] */ ldlayer 0, LAYER_5551 +/* 0x554D [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x5550 [0xFF ] */ end + +.layer LAYER_5551 +/* 0x5551 [0xC4 ] */ legato +/* 0x5552 [0xC7 0x85 0x27 0xC0 ] */ portamento 0x85, PITCH_C4, 192 +/* 0x5556 [0x6C 0x20 0x64 ] */ notedv PITCH_F4, 32, 100 +/* 0x5559 [0x68 0x20 0x64 ] */ notedv PITCH_DF4, 32, 100 +/* 0x555C [0xFF ] */ end + +.channel CHAN_555D +/* 0x555D [0xC1 0x31 ] */ instr SF1_INST_49 +/* 0x555F [0x88 0x55 0x66 ] */ ldlayer 0, LAYER_5566 +/* 0x5562 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x5565 [0xFF ] */ end + +.layer LAYER_5566 +/* 0x5566 [0xC4 ] */ legato +/* 0x5567 [0xC7 0x85 0x27 0x80 ] */ portamento 0x85, PITCH_C4, 128 +/* 0x556B [0x72 0x1C 0x64 ] */ notedv PITCH_B4, 28, 100 +/* 0x556E [0x6F 0x60 0x64 ] */ notedv PITCH_AF4, 96, 100 +/* 0x5571 [0xFF ] */ end + +.channel CHAN_5572 +/* 0x5572 [0xC1 0x31 ] */ instr SF1_INST_49 +/* 0x5574 [0x88 0x55 0x78 ] */ ldlayer 0, LAYER_5578 +/* 0x5577 [0xFF ] */ end + +.layer LAYER_5578 +/* 0x5578 [0x69 0x70 0x4B ] */ notedv PITCH_D4, 112, 75 +/* 0x557B [0xFF ] */ end + +.channel CHAN_557C +/* 0x557C [0x88 0x55 0x83 ] */ ldlayer 0, LAYER_5583 +/* 0x557F [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x5582 [0xFF ] */ end + +.layer LAYER_5583 +/* 0x5583 [0xC6 0x17 ] */ instr SF1_INST_23 +/* 0x5585 [0xC4 ] */ legato +/* 0x5586 [0xC7 0x85 0x22 0xFF ] */ portamento 0x85, PITCH_G3, 255 +/* 0x558A [0x67 0x0A 0x64 ] */ notedv PITCH_C4, 10, 100 +/* 0x558D [0x64 0x1E 0x64 ] */ notedv PITCH_A3, 30, 100 +/* 0x5590 [0xFF ] */ end + +.channel CHAN_5591 +/* 0x5591 [0x88 0x55 0x98 ] */ ldlayer 0, LAYER_5598 +/* 0x5594 [0x89 0x48 0x29 ] */ ldlayer 1, LAYER_4829 +/* 0x5597 [0xFF ] */ end + +.layer LAYER_5598 +/* 0x5598 [0xC6 0x17 ] */ instr SF1_INST_23 +/* 0x559A [0xC4 ] */ legato +/* 0x559B [0xC7 0x85 0x27 0xFF ] */ portamento 0x85, PITCH_C4, 255 +/* 0x559F [0x62 0x0F 0x64 ] */ notedv PITCH_G3, 15, 100 +/* 0x55A2 [0x50 0x60 0x64 ] */ notedv PITCH_DF2, 96, 100 +/* 0x55A5 [0xFF ] */ end + +.channel CHAN_55A6 +/* 0x55A6 [0x88 0x55 0xAE ] */ ldlayer 0, LAYER_55AE +/* 0x55A9 [0xD7 0x70 ] */ vibfreq 112 +/* 0x55AB [0xD8 0x40 ] */ vibdepth 64 +/* 0x55AD [0xFF ] */ end + +.layer LAYER_55AE +/* 0x55AE [0xC6 0x31 ] */ instr SF1_INST_49 +/* 0x55B0 [0xC2 0x30 ] */ transpose 48 +/* 0x55B2 [0x67 0x0C 0x64 ] */ notedv PITCH_C4, 12, 100 +/* 0x55B5 [0x69 0x14 0x64 ] */ notedv PITCH_D4, 20, 100 +/* 0x55B8 [0xFF ] */ end + +.channel CHAN_55B9 +/* 0x55B9 [0x88 0x55 0xC1 ] */ ldlayer 0, LAYER_55C1 +/* 0x55BC [0xD7 0x70 ] */ vibfreq 112 +/* 0x55BE [0xD8 0x40 ] */ vibdepth 64 +/* 0x55C0 [0xFF ] */ end + +.layer LAYER_55C1 +/* 0x55C1 [0xC6 0x31 ] */ instr SF1_INST_49 +/* 0x55C3 [0xC2 0x30 ] */ transpose 48 +/* 0x55C5 [0x6C 0x0C 0x64 ] */ notedv PITCH_F4, 12, 100 +/* 0x55C8 [0x69 0x12 0x64 ] */ notedv PITCH_D4, 18, 100 +/* 0x55CB [0x6B 0x0C 0x64 ] */ notedv PITCH_E4, 12, 100 +/* 0x55CE [0x69 0x10 0x64 ] */ notedv PITCH_D4, 16, 100 +/* 0x55D1 [0xFF ] */ end + +.channel CHAN_55D2 +/* 0x55D2 [0xC1 0x0A ] */ instr SF1_INST_10 +/* 0x55D4 [0x88 0x55 0xD8 ] */ ldlayer 0, LAYER_55D8 +/* 0x55D7 [0xFF ] */ end + +.layer LAYER_55D8 +/* 0x55D8 [0xC7 0x81 0x16 0xC8 ] */ portamento 0x81, PITCH_G2, 200 +/* 0x55DC [0x5D 0x26 0x44 ] */ notedv PITCH_D3, 38, 68 +/* 0x55DF [0xFF ] */ end + +.channel CHAN_55E0 +/* 0x55E0 [0x88 0x55 0xE4 ] */ ldlayer 0, LAYER_55E4 +/* 0x55E3 [0xFF ] */ end + +.layer LAYER_55E4 +/* 0x55E4 [0xC6 0x2E ] */ instr SF1_INST_46 +/* 0x55E6 [0xC2 0x30 ] */ transpose 48 +/* 0x55E8 [0x65 0x45 0x64 ] */ notedv PITCH_BF3, 69, 100 +/* 0x55EB [0xFF ] */ end + +.channel CHAN_55EC +/* 0x55EC [0x88 0x55 0xF3 ] */ ldlayer 0, LAYER_55F3 +/* 0x55EF [0x89 0x55 0xF5 ] */ ldlayer 1, LAYER_55F5 +/* 0x55F2 [0xFF ] */ end + +.layer LAYER_55F3 +/* 0x55F3 [0xC0 0x0C ] */ ldelay 12 +.layer LAYER_55F5 +/* 0x55F5 [0xC6 0x2A ] */ instr SF1_INST_42 +/* 0x55F7 [0xC2 0x30 ] */ transpose 48 +/* 0x55F9 [0x67 0x7F 0x64 ] */ notedv PITCH_C4, 127, 100 +/* 0x55FC [0xFF ] */ end + +.channel CHAN_55FD +/* 0x55FD [0x88 0x56 0x04 ] */ ldlayer 0, LAYER_5604 +/* 0x5600 [0x89 0x56 0x06 ] */ ldlayer 1, LAYER_5606 +/* 0x5603 [0xFF ] */ end + +.layer LAYER_5604 +/* 0x5604 [0xC0 0x14 ] */ ldelay 20 +.layer LAYER_5606 +/* 0x5606 [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x5608 [0xC4 ] */ legato +/* 0x5609 [0xC7 0x85 0x13 0xBF ] */ portamento 0x85, PITCH_E2, 191 +/* 0x560D [0x55 0x34 0x64 ] */ notedv PITCH_GF2, 52, 100 +/* 0x5610 [0x53 0x80 0xC0 0x64 ] */ notedv PITCH_E2, 192, 100 +/* 0x5614 [0xFF ] */ end + +.channel CHAN_5615 +/* 0x5615 [0x88 0x56 0x1C ] */ ldlayer 0, LAYER_561C +/* 0x5618 [0x89 0x56 0x26 ] */ ldlayer 1, LAYER_5626 +/* 0x561B [0xFF ] */ end + +.layer LAYER_561C +/* 0x561C [0xC6 0x04 ] */ instr SF1_INST_4 +/* 0x561E [0xC7 0x81 0x1F 0x64 ] */ portamento 0x81, PITCH_E3, 100 +/* 0x5622 [0x5B 0x32 0x50 ] */ notedv PITCH_C3, 50, 80 +/* 0x5625 [0xFF ] */ end + +.layer LAYER_5626 +/* 0x5626 [0xC6 0x2F ] */ instr SF1_INST_47 +/* 0x5628 [0xC0 0x10 ] */ ldelay 16 +/* 0x562A [0xC2 0x18 ] */ transpose 24 +/* 0x562C [0x4F 0x06 0x24 ] */ notedv PITCH_C2, 6, 36 +/* 0x562F [0x54 0x06 0x24 ] */ notedv PITCH_F2, 6, 36 +/* 0x5632 [0x5B 0x06 0x24 ] */ notedv PITCH_C3, 6, 36 +/* 0x5635 [0x60 0x06 0x24 ] */ notedv PITCH_F3, 6, 36 +/* 0x5638 [0x67 0x06 0x24 ] */ notedv PITCH_C4, 6, 36 +/* 0x563B [0xFF ] */ end + +.channel CHAN_563C +/* 0x563C [0x88 0x56 0x43 ] */ ldlayer 0, LAYER_5643 +/* 0x563F [0x89 0x56 0x47 ] */ ldlayer 1, LAYER_5647 +/* 0x5642 [0xFF ] */ end + +.layer LAYER_5643 +/* 0x5643 [0xC2 0x2C ] */ transpose 44 +/* 0x5645 [0xF4 0x02 ] */ rjump LAYER_5649 + +.layer LAYER_5647 +/* 0x5647 [0xC2 0x30 ] */ transpose 48 +LAYER_5649: +/* 0x5649 [0xC6 0x32 ] */ instr SF1_INST_50 +/* 0x564B [0x6A 0x7F 0x64 ] */ notedv PITCH_EF4, 127, 100 +/* 0x564E [0xFF ] */ end + +.channel CHAN_564F +/* 0x564F [0xC1 0x07 ] */ instr SF1_INST_7 +/* 0x5651 [0x88 0x56 0x55 ] */ ldlayer 0, LAYER_5655 +/* 0x5654 [0xFF ] */ end + +.layer LAYER_5655 +/* 0x5655 [0x5E 0x40 0x64 ] */ notedv PITCH_EF3, 64, 100 +/* 0x5658 [0xFF ] */ end + +.channel CHAN_5659 +/* 0x5659 [0xC1 0x32 ] */ instr SF1_INST_50 +/* 0x565B [0x88 0x56 0x75 ] */ ldlayer 0, LAYER_5675 +CHAN_565E: +/* 0x565E [0xB8 0x20 ] */ rand 32 +/* 0x5660 [0xC7 0x28 0x56 0x76 ] */ stseq 40, LAYER_5675 + STSEQ_NOTEDV_DELAY_HI +/* 0x5664 [0xC7 0x28 0x56 0x6F ] */ stseq 40, CHAN_566E + STSEQ_LDI_IMM +/* 0x5668 [0xB8 0x06 ] */ rand 6 +/* 0x566A [0xC7 0x64 0x56 0x75 ] */ stseq (NOTEDV_OPCODE | PITCH_A3), LAYER_5675 + STSEQ_NOTEDV_OPCODE_PITCH +CHAN_566E: +/* 0x566E [0xCC 0x01 ] */ ldi 1 +/* 0x5670 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x5673 [0xF4 0xE9 ] */ rjump CHAN_565E + +.layer LAYER_5675 +/* 0x5675 [0x5B 0x50 0x64 ] */ notedv PITCH_C3, 80, 100 +/* 0x5678 [0xF4 0xFB ] */ rjump LAYER_5675 + +.channel CHAN_567A +/* 0x567A [0xC1 0x0B ] */ instr SF1_INST_11 +/* 0x567C [0x88 0x56 0x84 ] */ ldlayer 0, LAYER_5684 +/* 0x567F [0xD7 0x38 ] */ vibfreq 56 +/* 0x5681 [0xD8 0x40 ] */ vibdepth 64 +/* 0x5683 [0xFF ] */ end + +.layer LAYER_5684 +/* 0x5684 [0xCB 0x6A 0x2C 0xE6 ] */ env ENVELOPE_6A2C, 230 +LAYER_5688: +/* 0x5688 [0x50 0x80 0xD0 0x38 ] */ notedv PITCH_DF2, 208, 56 +/* 0x568C [0xF4 0xFA ] */ rjump LAYER_5688 + +.channel CHAN_568E +/* 0x568E [0x88 0x56 0x96 ] */ ldlayer 0, LAYER_5696 +/* 0x5691 [0xD7 0x36 ] */ vibfreq 54 +/* 0x5693 [0xD8 0x80 ] */ vibdepth 128 +/* 0x5695 [0xFF ] */ end + +.layer LAYER_5696 +/* 0x5696 [0xC6 0x2E ] */ instr SF1_INST_46 +/* 0x5698 [0xC2 0x30 ] */ transpose 48 +/* 0x569A [0xC7 0x81 0x2E 0xFF ] */ portamento 0x81, PITCH_G4, 255 +/* 0x569E [0x61 0x70 0x58 ] */ notedv PITCH_GF3, 112, 88 +/* 0x56A1 [0xFF ] */ end + +.channel CHAN_56A2 +/* 0x56A2 [0x88 0x56 0xAA ] */ ldlayer 0, LAYER_56AA +/* 0x56A5 [0xD7 0xE0 ] */ vibfreq 224 +/* 0x56A7 [0xD8 0x60 ] */ vibdepth 96 +/* 0x56A9 [0xFF ] */ end + +.layer LAYER_56AA +/* 0x56AA [0xC6 0x2F ] */ instr SF1_INST_47 +/* 0x56AC [0x58 0x40 0x4C ] */ notedv PITCH_A2, 64, 76 +/* 0x56AF [0xFF ] */ end + +.channel CHAN_56B0 +/* 0x56B0 [0xFF ] */ end + +.filter FILTER_56C0 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.filter FILTER_56D0 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.filter FILTER_56E0 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.channel systembank_handler_1 +/* 0x56F0 [0xC2 0x57 0x29 ] */ dyntbl systembank_table +/* 0x56F3 [0xC4 ] */ noshort +/* 0x56F4 [0xCA 0x00 ] */ mutebhv 0x00 +/* 0x56F6 [0xE9 0x0E ] */ notepri 0, 14 +/* 0x56F8 [0xE5 0x01 ] */ reverbidx 1 +/* 0x56FA [0xD0 0x00 ] */ effects FALSE, 0, 0, 0, 0, 0 +/* 0x56FC [0xC6 0x00 ] */ font Soundfont_0_ID +/* 0x56FE [0xDC 0x00 ] */ panweight 0 +CHAN_5700: +/* 0x5700 [0xFE ] */ delay1 +/* 0x5701 [0x60 ] */ ldio IO_PORT_0 +/* 0x5702 [0xC8 0x01 ] */ sub 1 +/* 0x5704 [0xFA 0x57 0x0A ] */ beqz CHAN_570A +/* 0x5707 [0xFB 0x57 0x00 ] */ jump CHAN_5700 + +CHAN_570A: +/* 0x570A [0xD4 0x00 ] */ reverb 0 +/* 0x570C [0xFC 0x00 0x7C ] */ call CHAN_007C +/* 0x570F [0x92 ] */ dellayer 2 +/* 0x5710 [0x64 ] */ ldio IO_PORT_SFX_INDEX_LOBITS +/* 0x5711 [0xE4 ] */ dyncall +CHAN_5712: +/* 0x5712 [0xFC 0x00 0x84 ] */ call CHAN_0084 +/* 0x5715 [0xFE ] */ delay1 +/* 0x5716 [0x60 ] */ ldio IO_PORT_0 +/* 0x5717 [0xF3 0x0B ] */ rbeqz CHAN_5724 +/* 0x5719 [0xF2 0x02 ] */ rbltz CHAN_571D +/* 0x571B [0xF4 0xED ] */ rjump CHAN_570A + +CHAN_571D: +/* 0x571D [0x80 ] */ testlayer 0 +/* 0x571E [0xFA 0x57 0x12 ] */ beqz CHAN_5712 +/* 0x5721 [0xCC 0xFF ] */ ldi 255 +/* 0x5723 [0x71 ] */ stio IO_PORT_1 +CHAN_5724: +/* 0x5724 [0x90 ] */ dellayer 0 +/* 0x5725 [0x91 ] */ dellayer 1 +/* 0x5726 [0x92 ] */ dellayer 2 +/* 0x5727 [0xF4 0xD7 ] */ rjump CHAN_5700 + +#define DEFINE_SFX(lblName, sfxId, priority, decay, rand, flags) \ + entry lblName + +.table_unaligned systembank_table + #include "systembank_table.h" + +#undef DEFINE_SFX + +.channel CHAN_57B9 +/* 0x57B9 [0xC1 0x80 ] */ instr FONTANY_INSTR_SAWTOOTH +/* 0x57BB [0xDA 0x66 0x60 ] */ env ENVELOPE_6660 +/* 0x57BE [0xD9 0xF0 ] */ releaserate 240 +/* 0x57C0 [0x88 0x57 0xC7 ] */ ldlayer 0, LAYER_57C7 +/* 0x57C3 [0x89 0x57 0xDF ] */ ldlayer 1, LAYER_57DF +/* 0x57C6 [0xFF ] */ end + +.layer LAYER_57C7 +/* 0x57C7 [0xC6 0x54 ] */ instr SF0_INST_84 +/* 0x57C9 [0xC2 0x0C ] */ transpose 12 +/* 0x57CB [0xCF 0xE1 ] */ releaserate 225 +/* 0x57CD [0xCA 0x36 ] */ notepan 54 +/* 0x57CF [0x65 0x0C 0x49 ] */ notedv PITCH_BF3, 12, 73 +/* 0x57D2 [0x67 0x0C 0x49 ] */ notedv PITCH_C4, 12, 73 +/* 0x57D5 [0x69 0x0C 0x49 ] */ notedv PITCH_D4, 12, 73 +/* 0x57D8 [0x6A 0x0C 0x49 ] */ notedv PITCH_EF4, 12, 73 +/* 0x57DB [0x6C 0x18 0x49 ] */ notedv PITCH_F4, 24, 73 +/* 0x57DE [0xFF ] */ end + +.layer LAYER_57DF +/* 0x57DF [0xC6 0x54 ] */ instr SF0_INST_84 +/* 0x57E1 [0xC2 0x18 ] */ transpose 24 +/* 0x57E3 [0xCB 0x65 0xD8 0xF5 ] */ env ENVELOPE_65D8, 245 +/* 0x57E7 [0xCA 0x4A ] */ notepan 74 +/* 0x57E9 [0xC7 0x81 0x14 0xFF ] */ portamento 0x81, PITCH_F2, 255 +/* 0x57ED [0x60 0x18 0x49 ] */ notedv PITCH_F3, 24, 73 +/* 0x57F0 [0xC0 0x04 ] */ ldelay 4 +/* 0x57F2 [0x60 0x18 0x49 ] */ notedv PITCH_F3, 24, 73 +/* 0x57F5 [0xFF ] */ end + +.channel CHAN_57F6 +/* 0x57F6 [0xC1 0x80 ] */ instr FONTANY_INSTR_SAWTOOTH +/* 0x57F8 [0xDA 0x66 0x60 ] */ env ENVELOPE_6660 +/* 0x57FB [0xD9 0xF0 ] */ releaserate 240 +/* 0x57FD [0x88 0x58 0x04 ] */ ldlayer 0, LAYER_5804 +/* 0x5800 [0x89 0x58 0x1C ] */ ldlayer 1, LAYER_581C +/* 0x5803 [0xFF ] */ end + +.layer LAYER_5804 +/* 0x5804 [0xC6 0x54 ] */ instr SF0_INST_84 +/* 0x5806 [0xCF 0xE1 ] */ releaserate 225 +/* 0x5808 [0xC2 0x0C ] */ transpose 12 +/* 0x580A [0xCA 0x36 ] */ notepan 54 +/* 0x580C [0x6C 0x04 0x49 ] */ notedv PITCH_F4, 4, 73 +/* 0x580F [0x6A 0x04 0x49 ] */ notedv PITCH_EF4, 4, 73 +/* 0x5812 [0x69 0x04 0x49 ] */ notedv PITCH_D4, 4, 73 +/* 0x5815 [0x67 0x04 0x49 ] */ notedv PITCH_C4, 4, 73 +/* 0x5818 [0x65 0x0C 0x49 ] */ notedv PITCH_BF3, 12, 73 +/* 0x581B [0xFF ] */ end + +.layer LAYER_581C +/* 0x581C [0xC6 0x54 ] */ instr SF0_INST_84 +/* 0x581E [0xC2 0x18 ] */ transpose 24 +/* 0x5820 [0xCB 0x65 0xD8 0xF5 ] */ env ENVELOPE_65D8, 245 +/* 0x5824 [0xCA 0x4A ] */ notepan 74 +/* 0x5826 [0xC7 0x81 0x14 0xFF ] */ portamento 0x81, PITCH_F2, 255 +/* 0x582A [0x60 0x0C 0x49 ] */ notedv PITCH_F3, 12, 73 +/* 0x582D [0xC0 0x04 ] */ ldelay 4 +/* 0x582F [0x60 0x0C 0x49 ] */ notedv PITCH_F3, 12, 73 +/* 0x5832 [0xFF ] */ end + +.channel CHAN_5833 +/* 0x5833 [0xC1 0x83 ] */ instr FONTANY_INSTR_SQUARE +/* 0x5835 [0xDA 0x66 0x4C ] */ env ENVELOPE_664C +/* 0x5838 [0xD9 0xF8 ] */ releaserate 248 +/* 0x583A [0x88 0x58 0x41 ] */ ldlayer 0, LAYER_5841 +/* 0x583D [0x89 0x58 0x50 ] */ ldlayer 1, LAYER_5850 +/* 0x5840 [0xFF ] */ end + +.layer LAYER_5841 +/* 0x5841 [0xCA 0x36 ] */ notepan 54 +/* 0x5843 [0x6E 0x18 0x4B ] */ notedv PITCH_G4, 24, 75 +/* 0x5846 [0x6A 0x18 0x4B ] */ notedv PITCH_EF4, 24, 75 +/* 0x5849 [0x63 0x18 0x4B ] */ notedv PITCH_AF3, 24, 75 +/* 0x584C [0x6F 0x30 0x4B ] */ notedv PITCH_AF4, 48, 75 +/* 0x584F [0xFF ] */ end + +.layer LAYER_5850 +/* 0x5850 [0xCA 0x4A ] */ notepan 74 +/* 0x5852 [0xC0 0x0C ] */ ldelay 12 +/* 0x5854 [0x6D 0x18 0x4B ] */ notedv PITCH_GF4, 24, 75 +/* 0x5857 [0x64 0x18 0x4B ] */ notedv PITCH_A3, 24, 75 +/* 0x585A [0x6B 0x18 0x4B ] */ notedv PITCH_E4, 24, 75 +/* 0x585D [0x73 0x30 0x4B ] */ notedv PITCH_C5, 48, 75 +/* 0x5860 [0xFF ] */ end + +.channel CHAN_5861 +/* 0x5861 [0x88 0x58 0x68 ] */ ldlayer 0, LAYER_5868 +/* 0x5864 [0x89 0x58 0x7A ] */ ldlayer 1, LAYER_587A +/* 0x5867 [0xFF ] */ end + +.layer LAYER_5868 +/* 0x5868 [0xC6 0x80 ] */ instr FONTANY_INSTR_SAWTOOTH +/* 0x586A [0xCB 0x66 0x60 0xFA ] */ env ENVELOPE_6660, 250 +/* 0x586E [0xC2 0x18 ] */ transpose 24 +/* 0x5870 [0x71 0x06 0x50 ] */ notedv PITCH_BF4, 6, 80 +/* 0x5873 [0x6C 0x06 0x50 ] */ notedv PITCH_F4, 6, 80 +/* 0x5876 [0x71 0x18 0x50 ] */ notedv PITCH_BF4, 24, 80 +/* 0x5879 [0xFF ] */ end + +.layer LAYER_587A +/* 0x587A [0xC6 0x5B ] */ instr SF0_INST_91 +/* 0x587C [0x73 0x24 0x48 ] */ notedv PITCH_C5, 36, 72 +/* 0x587F [0xFF ] */ end + +.channel CHAN_5880 +/* 0x5880 [0x88 0x58 0x84 ] */ ldlayer 0, LAYER_5884 +/* 0x5883 [0xFF ] */ end + +.layer LAYER_5884 +/* 0x5884 [0xC6 0x81 ] */ instr FONTANY_INSTR_TRIANGLE +/* 0x5886 [0xCB 0x67 0x20 0xFA ] */ env ENVELOPE_6720, 250 +/* 0x588A [0x70 0x06 0x3C ] */ notedv PITCH_A4, 6, 60 +/* 0x588D [0xFF ] */ end + +.channel CHAN_588E +/* 0x588E [0x88 0x58 0x92 ] */ ldlayer 0, LAYER_5892 +/* 0x5891 [0xFF ] */ end + +.layer LAYER_5892 +/* 0x5892 [0xC6 0x80 ] */ instr FONTANY_INSTR_SAWTOOTH +/* 0x5894 [0xCB 0x66 0x4C 0xFA ] */ env ENVELOPE_664C, 250 +/* 0x5898 [0x53 0x09 0x50 ] */ notedv PITCH_E2, 9, 80 +/* 0x589B [0x53 0x24 0x50 ] */ notedv PITCH_E2, 36, 80 +/* 0x589E [0xFF ] */ end + +.channel CHAN_589F +/* 0x589F [0xC1 0x83 ] */ instr FONTANY_INSTR_SQUARE +/* 0x58A1 [0xDA 0x66 0x4C ] */ env ENVELOPE_664C +/* 0x58A4 [0xD9 0xFA ] */ releaserate 250 +/* 0x58A6 [0x88 0x58 0xAD ] */ ldlayer 0, LAYER_58AD +/* 0x58A9 [0x89 0x58 0xC3 ] */ ldlayer 1, LAYER_58C3 +/* 0x58AC [0xFF ] */ end + +.layer LAYER_58AD +/* 0x58AD [0x70 0x0C 0x46 ] */ notedv PITCH_A4, 12, 70 +/* 0x58B0 [0x72 0x0C 0x46 ] */ notedv PITCH_B4, 12, 70 +/* 0x58B3 [0x75 0x0C 0x46 ] */ notedv PITCH_D5, 12, 70 +/* 0x58B6 [0x77 0x0C 0x46 ] */ notedv PITCH_E5, 12, 70 +/* 0x58B9 [0x7C 0x12 0x46 ] */ notedv PITCH_A5, 18, 70 +/* 0x58BC [0x7C 0x12 0x28 ] */ notedv PITCH_A5, 18, 40 +/* 0x58BF [0x7C 0x12 0x0F ] */ notedv PITCH_A5, 18, 15 +/* 0x58C2 [0xFF ] */ end + +.layer LAYER_58C3 +/* 0x58C3 [0xC0 0x06 ] */ ldelay 6 +/* 0x58C5 [0xCA 0x22 ] */ notepan 34 +/* 0x58C7 [0x70 0x0C 0x28 ] */ notedv PITCH_A4, 12, 40 +/* 0x58CA [0xCA 0x5E ] */ notepan 94 +/* 0x58CC [0x72 0x0C 0x28 ] */ notedv PITCH_B4, 12, 40 +/* 0x58CF [0xCA 0x22 ] */ notepan 34 +/* 0x58D1 [0x75 0x0C 0x28 ] */ notedv PITCH_D5, 12, 40 +/* 0x58D4 [0xCA 0x5E ] */ notepan 94 +/* 0x58D6 [0x77 0x0C 0x28 ] */ notedv PITCH_E5, 12, 40 +/* 0x58D9 [0xCA 0x22 ] */ notepan 34 +/* 0x58DB [0x7C 0x12 0x28 ] */ notedv PITCH_A5, 18, 40 +/* 0x58DE [0xCA 0x5E ] */ notepan 94 +/* 0x58E0 [0x7C 0x12 0x14 ] */ notedv PITCH_A5, 18, 20 +/* 0x58E3 [0xCA 0x40 ] */ notepan 64 +/* 0x58E5 [0x7C 0x12 0x0A ] */ notedv PITCH_A5, 18, 10 +/* 0x58E8 [0xFF ] */ end + +.channel CHAN_58E9 +/* 0x58E9 [0xC1 0x54 ] */ instr SF0_INST_84 +/* 0x58EB [0xDA 0x66 0x60 ] */ env ENVELOPE_6660 +/* 0x58EE [0xD9 0xF0 ] */ releaserate 240 +/* 0x58F0 [0x88 0x58 0xF7 ] */ ldlayer 0, LAYER_58F7 +/* 0x58F3 [0x89 0x59 0x0D ] */ ldlayer 1, LAYER_590D +/* 0x58F6 [0xFF ] */ end + +.layer LAYER_58F7 +/* 0x58F7 [0x70 0x06 0x50 ] */ notedv PITCH_A4, 6, 80 +/* 0x58FA [0x72 0x06 0x50 ] */ notedv PITCH_B4, 6, 80 +/* 0x58FD [0x75 0x06 0x50 ] */ notedv PITCH_D5, 6, 80 +/* 0x5900 [0x77 0x06 0x50 ] */ notedv PITCH_E5, 6, 80 +/* 0x5903 [0x7C 0x09 0x50 ] */ notedv PITCH_A5, 9, 80 +/* 0x5906 [0x7C 0x09 0x32 ] */ notedv PITCH_A5, 9, 50 +/* 0x5909 [0x7C 0x09 0x1E ] */ notedv PITCH_A5, 9, 30 +/* 0x590C [0xFF ] */ end + +.layer LAYER_590D +/* 0x590D [0xC0 0x06 ] */ ldelay 6 +/* 0x590F [0xCA 0x22 ] */ notepan 34 +/* 0x5911 [0x70 0x06 0x37 ] */ notedv PITCH_A4, 6, 55 +/* 0x5914 [0xCA 0x5E ] */ notepan 94 +/* 0x5916 [0x72 0x06 0x37 ] */ notedv PITCH_B4, 6, 55 +/* 0x5919 [0xCA 0x22 ] */ notepan 34 +/* 0x591B [0x75 0x06 0x37 ] */ notedv PITCH_D5, 6, 55 +/* 0x591E [0xCA 0x5E ] */ notepan 94 +/* 0x5920 [0x77 0x06 0x37 ] */ notedv PITCH_E5, 6, 55 +/* 0x5923 [0xCA 0x22 ] */ notepan 34 +/* 0x5925 [0x7C 0x09 0x37 ] */ notedv PITCH_A5, 9, 55 +/* 0x5928 [0xCA 0x5E ] */ notepan 94 +/* 0x592A [0x7C 0x09 0x2D ] */ notedv PITCH_A5, 9, 45 +/* 0x592D [0xCA 0x40 ] */ notepan 64 +/* 0x592F [0x7C 0x09 0x1E ] */ notedv PITCH_A5, 9, 30 +/* 0x5932 [0xFF ] */ end + +.channel CHAN_5933 +/* 0x5933 [0x88 0x59 0x37 ] */ ldlayer 0, LAYER_5937 +/* 0x5936 [0xFF ] */ end + +.layer LAYER_5937 +/* 0x5937 [0xC6 0x83 ] */ instr FONTANY_INSTR_SQUARE +/* 0x5939 [0xCB 0x66 0x60 0xF2 ] */ env ENVELOPE_6660, 242 +/* 0x593D [0xC7 0x81 0x24 0x48 ] */ portamento 0x81, PITCH_A3, 72 +/* 0x5941 [0x69 0x0A 0x2D ] */ notedv PITCH_D4, 10, 45 +/* 0x5944 [0x69 0x06 0x2D ] */ notedv PITCH_D4, 6, 45 +/* 0x5947 [0xFF ] */ end + +.channel CHAN_5948 +/* 0x5948 [0xC1 0x81 ] */ instr FONTANY_INSTR_TRIANGLE +/* 0x594A [0xDA 0x66 0x4C ] */ env ENVELOPE_664C +/* 0x594D [0x88 0x59 0x51 ] */ ldlayer 0, LAYER_5951 +/* 0x5950 [0xFF ] */ end + +.layer LAYER_5951 +/* 0x5951 [0xC6 0x81 ] */ instr FONTANY_INSTR_TRIANGLE +/* 0x5953 [0xCB 0x66 0x4C 0xFA ] */ env ENVELOPE_664C, 250 +/* 0x5957 [0x70 0x06 0x3C ] */ notedv PITCH_A4, 6, 60 +/* 0x595A [0x6B 0x06 0x3C ] */ notedv PITCH_E4, 6, 60 +/* 0x595D [0x69 0x06 0x3C ] */ notedv PITCH_D4, 6, 60 +/* 0x5960 [0x66 0x06 0x3C ] */ notedv PITCH_B3, 6, 60 +/* 0x5963 [0x64 0x09 0x3C ] */ notedv PITCH_A3, 9, 60 +/* 0x5966 [0x66 0x06 0x14 ] */ notedv PITCH_B3, 6, 20 +/* 0x5969 [0x64 0x09 0x14 ] */ notedv PITCH_A3, 9, 20 +/* 0x596C [0xFF ] */ end + +.channel CHAN_596D +/* 0x596D [0x88 0x59 0x71 ] */ ldlayer 0, LAYER_5971 +/* 0x5970 [0xFF ] */ end + +.layer LAYER_5971 +/* 0x5971 [0xC6 0x82 ] */ instr FONTANY_INSTR_SINE +/* 0x5973 [0xCB 0x67 0x20 0xF6 ] */ env ENVELOPE_6720, 246 +/* 0x5977 [0xC7 0x81 0x22 0x7F ] */ portamento 0x81, PITCH_G3, 127 +/* 0x597B [0x64 0x08 0x64 ] */ notedv PITCH_A3, 8, 100 +/* 0x597E [0xC7 0x81 0x2E 0x7F ] */ portamento 0x81, PITCH_G4, 127 +/* 0x5982 [0x70 0x08 0x64 ] */ notedv PITCH_A4, 8, 100 +/* 0x5985 [0xC7 0x81 0x3A 0x7F ] */ portamento 0x81, PITCH_G5, 127 +/* 0x5989 [0x7C 0x08 0x64 ] */ notedv PITCH_A5, 8, 100 +/* 0x598C [0xFF ] */ end + +.channel CHAN_598D +/* 0x598D [0x88 0x59 0x91 ] */ ldlayer 0, LAYER_5991 +/* 0x5990 [0xFF ] */ end + +.layer LAYER_5991 +/* 0x5991 [0xC6 0x54 ] */ instr SF0_INST_84 +/* 0x5993 [0xCB 0x66 0x88 0xFB ] */ env ENVELOPE_6688, 251 +/* 0x5997 [0xC7 0x81 0x24 0xC0 ] */ portamento 0x81, PITCH_A3, 192 +/* 0x599B [0x7C 0x38 0x6E ] */ notedv PITCH_A5, 56, 110 +/* 0x599E [0xFF ] */ end + +/* 0x599F [0xC1 0x80 ] */ shortvel 128 +/* 0x59A1 [0x88 0x59 0xA5 ] */ notevg PITCH_F1, 89, 165 +/* 0x59A4 [0xFF ] */ end + +/* 0x59A5 [0x70 0x60 0x69 ] */ notedv PITCH_A4, 96, 105 +/* 0x59A8 [0xFF ] */ end + +.channel CHAN_59A9 +/* 0x59A9 [0x88 0x59 0xAD ] */ ldlayer 0, LAYER_59AD +/* 0x59AC [0xFF ] */ end + +.layer LAYER_59AD +/* 0x59AD [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x59AF [0xCB 0x66 0x4C 0xFF ] */ env ENVELOPE_664C, 255 +/* 0x59B3 [0xC2 0xFB ] */ transpose -5 +/* 0x59B5 [0x6C 0x20 0x69 ] */ notedv PITCH_F4, 32, 105 +/* 0x59B8 [0xFF ] */ end + +/* 0x59B9 [0xC6 0x20 ] */ instr SF0_INST_32 +/* 0x59BB [0xCB 0x66 0xB0 0xFA ] */ env ENVELOPE_66B0, 250 +/* 0x59BF [0xC4 ] */ legato +/* 0x59C0 [0xC7 0x85 0x2E 0xFF ] */ portamento 0x85, PITCH_G4, 255 +/* 0x59C4 [0x72 0x12 0x5A ] */ notedv PITCH_B4, 18, 90 +/* 0x59C7 [0x6B 0x08 0x5A ] */ notedv PITCH_E4, 8, 90 +/* 0x59CA [0xFF ] */ end + +.channel CHAN_59CB +/* 0x59CB [0x88 0x59 0xCF ] */ ldlayer 0, LAYER_59CF +/* 0x59CE [0xFF ] */ end + +.layer LAYER_59CF +/* 0x59CF [0xC6 0x83 ] */ instr FONTANY_INSTR_SQUARE +/* 0x59D1 [0xC2 0x09 ] */ transpose 9 +/* 0x59D3 [0xCB 0x66 0x60 0xFA ] */ env ENVELOPE_6660, 250 +/* 0x59D7 [0xC7 0x81 0x18 0x40 ] */ portamento 0x81, PITCH_A2, 64 +/* 0x59DB [0x5D 0x02 0x41 ] */ notedv PITCH_D3, 2, 65 +/* 0x59DE [0x58 0x0C 0x41 ] */ notedv PITCH_A2, 12, 65 +/* 0x59E1 [0x5D 0x06 0x23 ] */ notedv PITCH_D3, 6, 35 +/* 0x59E4 [0xFF ] */ end + +.channel CHAN_59E5 +/* 0x59E5 [0x88 0x59 0xE9 ] */ ldlayer 0, LAYER_59E9 +/* 0x59E8 [0xFF ] */ end + +.layer LAYER_59E9 +/* 0x59E9 [0xC6 0x54 ] */ instr SF0_INST_84 +/* 0x59EB [0xCB 0x66 0x60 0xFA ] */ env ENVELOPE_6660, 250 +/* 0x59EF [0x69 0x06 0x5A ] */ notedv PITCH_D4, 6, 90 +/* 0x59F2 [0x6E 0x06 0x5A ] */ notedv PITCH_G4, 6, 90 +/* 0x59F5 [0x6D 0x06 0x5A ] */ notedv PITCH_GF4, 6, 90 +/* 0x59F8 [0x6E 0x0C 0x5A ] */ notedv PITCH_G4, 12, 90 +/* 0x59FB [0x6E 0x0C 0x28 ] */ notedv PITCH_G4, 12, 40 +/* 0x59FE [0x6E 0x0C 0x14 ] */ notedv PITCH_G4, 12, 20 +/* 0x5A01 [0xFF ] */ end + +.channel CHAN_5A02 +/* 0x5A02 [0x88 0x5A 0x06 ] */ ldlayer 0, LAYER_5A06 +/* 0x5A05 [0xFF ] */ end + +.layer LAYER_5A06 +/* 0x5A06 [0xC6 0x54 ] */ instr SF0_INST_84 +/* 0x5A08 [0xCB 0x66 0x60 0xFA ] */ env ENVELOPE_6660, 250 +/* 0x5A0C [0xC2 0x0C ] */ transpose 12 +/* 0x5A0E [0x6D 0x0A 0x4E ] */ notedv PITCH_GF4, 10, 78 +/* 0x5A11 [0x69 0x0A 0x4E ] */ notedv PITCH_D4, 10, 78 +/* 0x5A14 [0x66 0x0A 0x4E ] */ notedv PITCH_B3, 10, 78 +/* 0x5A17 [0x64 0x14 0x4E ] */ notedv PITCH_A3, 20, 78 +/* 0x5A1A [0xFF ] */ end + +.channel CHAN_5A1B +/* 0x5A1B [0x88 0x5A 0x1F ] */ ldlayer 0, LAYER_5A1F +/* 0x5A1E [0xFF ] */ end + +.layer LAYER_5A1F +/* 0x5A1F [0xC6 0x54 ] */ instr SF0_INST_84 +/* 0x5A21 [0xCB 0x66 0x60 0xFA ] */ env ENVELOPE_6660, 250 +/* 0x5A25 [0xC2 0x0C ] */ transpose 12 +/* 0x5A27 [0x64 0x0A 0x4E ] */ notedv PITCH_A3, 10, 78 +/* 0x5A2A [0x66 0x0A 0x4E ] */ notedv PITCH_B3, 10, 78 +/* 0x5A2D [0x69 0x0A 0x4E ] */ notedv PITCH_D4, 10, 78 +/* 0x5A30 [0x6D 0x14 0x4E ] */ notedv PITCH_GF4, 20, 78 +/* 0x5A33 [0xFF ] */ end + +.channel CHAN_5A34 +/* 0x5A34 [0x88 0x5A 0x38 ] */ ldlayer 0, LAYER_5A38 +/* 0x5A37 [0xFF ] */ end + +.layer LAYER_5A38 +/* 0x5A38 [0xC6 0x54 ] */ instr SF0_INST_84 +/* 0x5A3A [0xCB 0x66 0x60 0xFA ] */ env ENVELOPE_6660, 250 +/* 0x5A3E [0xC2 0x0C ] */ transpose 12 +/* 0x5A40 [0x69 0x0A 0x4E ] */ notedv PITCH_D4, 10, 78 +/* 0x5A43 [0x64 0x14 0x4E ] */ notedv PITCH_A3, 20, 78 +/* 0x5A46 [0xFF ] */ end + +.channel CHAN_5A47 +/* 0x5A47 [0x88 0x5A 0x4B ] */ ldlayer 0, LAYER_5A4B +/* 0x5A4A [0xFF ] */ end + +.layer LAYER_5A4B +/* 0x5A4B [0xC6 0x54 ] */ instr SF0_INST_84 +/* 0x5A4D [0xCB 0x66 0x60 0xFA ] */ env ENVELOPE_6660, 250 +/* 0x5A51 [0xC2 0x0C ] */ transpose 12 +/* 0x5A53 [0x64 0x0A 0x4E ] */ notedv PITCH_A3, 10, 78 +/* 0x5A56 [0x69 0x14 0x4E ] */ notedv PITCH_D4, 20, 78 +/* 0x5A59 [0xFF ] */ end + +.channel CHAN_5A5A +/* 0x5A5A [0xC1 0x54 ] */ instr SF0_INST_84 +/* 0x5A5C [0x88 0x5A 0x60 ] */ ldlayer 0, LAYER_5A60 +/* 0x5A5F [0xFF ] */ end + +.layer LAYER_5A60 +/* 0x5A60 [0x6A 0x0C 0x46 ] */ notedv PITCH_EF4, 12, 70 +/* 0x5A63 [0xFF ] */ end + +.channel CHAN_5A64 +/* 0x5A64 [0x88 0x5A 0x68 ] */ ldlayer 0, LAYER_5A68 +/* 0x5A67 [0xFF ] */ end + +.layer LAYER_5A68 +/* 0x5A68 [0xC6 0x54 ] */ instr SF0_INST_84 +/* 0x5A6A [0xCB 0x66 0x60 0xF8 ] */ env ENVELOPE_6660, 248 +/* 0x5A6E [0x6E 0x2E 0x5F ] */ notedv PITCH_G4, 46, 95 +/* 0x5A71 [0xFF ] */ end + +.channel CHAN_5A72 +/* 0x5A72 [0x88 0x5A 0x76 ] */ ldlayer 0, LAYER_5A76 +/* 0x5A75 [0xFF ] */ end + +.layer LAYER_5A76 +/* 0x5A76 [0xC6 0x80 ] */ instr FONTANY_INSTR_SAWTOOTH +/* 0x5A78 [0xCB 0x66 0x60 0xFA ] */ env ENVELOPE_6660, 250 +/* 0x5A7C [0x67 0x06 0x3C ] */ notedv PITCH_C4, 6, 60 +/* 0x5A7F [0x67 0x04 0x28 ] */ notedv PITCH_C4, 4, 40 +/* 0x5A82 [0x67 0x04 0x14 ] */ notedv PITCH_C4, 4, 20 +/* 0x5A85 [0xFF ] */ end + +.channel CHAN_5A86 +/* 0x5A86 [0xD4 0x0A ] */ reverb 10 +/* 0x5A88 [0x88 0x5A 0x8C ] */ ldlayer 0, LAYER_5A8C +/* 0x5A8B [0xFF ] */ end + +.layer LAYER_5A8C +/* 0x5A8C [0xC6 0x80 ] */ instr FONTANY_INSTR_SAWTOOTH +/* 0x5A8E [0xCB 0x66 0x60 0xFA ] */ env ENVELOPE_6660, 250 +/* 0x5A92 [0x67 0x06 0x41 ] */ notedv PITCH_C4, 6, 65 +/* 0x5A95 [0xCA 0x22 ] */ notepan 34 +/* 0x5A97 [0x73 0x04 0x2D ] */ notedv PITCH_C5, 4, 45 +/* 0x5A9A [0xCA 0x5E ] */ notepan 94 +/* 0x5A9C [0x73 0x04 0x2D ] */ notedv PITCH_C5, 4, 45 +/* 0x5A9F [0xCA 0x40 ] */ notepan 64 +/* 0x5AA1 [0x73 0x04 0x1E ] */ notedv PITCH_C5, 4, 30 +/* 0x5AA4 [0xFF ] */ end + +.channel CHAN_5AA5 +/* 0x5AA5 [0x88 0x5A 0xA9 ] */ ldlayer 0, LAYER_5AA9 +/* 0x5AA8 [0xFF ] */ end + +.layer LAYER_5AA9 +/* 0x5AA9 [0xC6 0x80 ] */ instr FONTANY_INSTR_SAWTOOTH +/* 0x5AAB [0xCB 0x66 0x60 0xF8 ] */ env ENVELOPE_6660, 248 +/* 0x5AAF [0x34 0x0D 0x3C 0x80 ] */ notedvg PITCH_DF5, 13, 60, 128 +/* 0x5AB3 [0x74 0x0D 0x3C ] */ notedv PITCH_DF5, 13, 60 +/* 0x5AB6 [0xFF ] */ end + +.channel CHAN_5AB7 +/* 0x5AB7 [0xD4 0x5A ] */ reverb 90 +/* 0x5AB9 [0x88 0x5A 0xC0 ] */ ldlayer 0, LAYER_5AC0 +/* 0x5ABC [0x89 0x5A 0xCC ] */ ldlayer 1, LAYER_5ACC +/* 0x5ABF [0xFF ] */ end + +.layer LAYER_5AC0 +/* 0x5AC0 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x5AC2 [0xCB 0x66 0x10 0xFB ] */ env ENVELOPE_6610, 251 +/* 0x5AC6 [0xCA 0x36 ] */ notepan 54 +/* 0x5AC8 [0x68 0x60 0x6B ] */ notedv PITCH_DF4, 96, 107 +/* 0x5ACB [0xFF ] */ end + +.layer LAYER_5ACC +/* 0x5ACC [0xC6 0x4A ] */ instr SF0_INST_74 +/* 0x5ACE [0xCB 0x66 0x10 0xFB ] */ env ENVELOPE_6610, 251 +/* 0x5AD2 [0xCA 0x36 ] */ notepan 54 +/* 0x5AD4 [0x4C 0x60 0x68 ] */ notedv PITCH_A1, 96, 104 +/* 0x5AD7 [0xFF ] */ end + +.channel CHAN_5AD8 +/* 0x5AD8 [0x88 0x5A 0xDF ] */ ldlayer 0, LAYER_5ADF +/* 0x5ADB [0x89 0x5A 0xED ] */ ldlayer 1, LAYER_5AED +/* 0x5ADE [0xFF ] */ end + +.layer LAYER_5ADF +/* 0x5ADF [0xC6 0x45 ] */ instr SF0_INST_69 +/* 0x5AE1 [0xCB 0x66 0xD0 0xF6 ] */ env ENVELOPE_66D0, 246 +/* 0x5AE5 [0xC7 0x81 0x3A 0xF6 ] */ portamento 0x81, PITCH_G5, 246 +/* 0x5AE9 [0x70 0x20 0x31 ] */ notedv PITCH_A4, 32, 49 +/* 0x5AEC [0xFF ] */ end + +.layer LAYER_5AED +/* 0x5AED [0xC6 0x82 ] */ instr FONTANY_INSTR_SINE +/* 0x5AEF [0xCB 0x66 0x60 0xF8 ] */ env ENVELOPE_6660, 248 +/* 0x5AF3 [0x7C 0x09 0x32 ] */ notedv PITCH_A5, 9, 50 +/* 0x5AF6 [0xFF ] */ end + +.channel CHAN_5AF7 +/* 0x5AF7 [0xCC 0x00 ] */ ldi 0 +/* 0x5AF9 [0x76 ] */ stio IO_PORT_6 +/* 0x5AFA [0xC7 0x00 0x5B 0x1A ] */ stseq 0, LAYER_5B19 + STSEQ_TRANSPOSITION +/* 0x5AFE [0x88 0x5B 0x13 ] */ ldlayer 0, LAYER_5B13 +CHAN_5B01: +/* 0x5B01 [0xCC 0x06 ] */ ldi 6 +/* 0x5B03 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x5B06 [0x66 ] */ ldio IO_PORT_6 +/* 0x5B07 [0xC7 0x00 0x5B 0x1A ] */ stseq 0, LAYER_5B19 + STSEQ_TRANSPOSITION +/* 0x5B0B [0xC8 0xFF ] */ sub 255 +/* 0x5B0D [0x76 ] */ stio IO_PORT_6 +/* 0x5B0E [0xC8 0x32 ] */ sub 50 +/* 0x5B10 [0xF2 0xEF ] */ rbltz CHAN_5B01 +/* 0x5B12 [0xFF ] */ end + +.layer LAYER_5B13 +/* 0x5B13 [0xC6 0x83 ] */ instr FONTANY_INSTR_SQUARE +/* 0x5B15 [0xCF 0xFB ] */ releaserate 251 +/* 0x5B17 [0xCA 0x22 ] */ notepan 34 +LAYER_5B19: +/* 0x5B19 [0xC2 0x00 ] */ transpose 0 +/* 0x5B1B [0x5B 0x03 0x20 ] */ notedv PITCH_C3, 3, 32 +/* 0x5B1E [0xC0 0x03 ] */ ldelay 3 +/* 0x5B20 [0xF4 0xF7 ] */ rjump LAYER_5B19 + +.channel CHAN_5B22 +/* 0x5B22 [0xC1 0x82 ] */ instr FONTANY_INSTR_SINE +/* 0x5B24 [0x88 0x5B 0x28 ] */ ldlayer 0, LAYER_5B28 +/* 0x5B27 [0xFF ] */ end + +.layer LAYER_5B28 +/* 0x5B28 [0xC4 ] */ legato +/* 0x5B29 [0xCB 0x66 0x74 0xF5 ] */ env ENVELOPE_6674, 245 +/* 0x5B2D [0xC7 0x81 0x24 0xFF ] */ portamento 0x81, PITCH_A3, 255 +/* 0x5B31 [0x54 0x08 0x44 ] */ notedv PITCH_F2, 8, 68 +/* 0x5B34 [0xC7 0x81 0x14 0xE1 ] */ portamento 0x81, PITCH_F2, 225 +/* 0x5B38 [0x67 0x1C 0x44 ] */ notedv PITCH_C4, 28, 68 +/* 0x5B3B [0xFF ] */ end + +.channel CHAN_5B3C +/* 0x5B3C [0xC1 0x82 ] */ instr FONTANY_INSTR_SINE +/* 0x5B3E [0x88 0x5B 0x42 ] */ ldlayer 0, LAYER_5B42 +/* 0x5B41 [0xFF ] */ end + +.layer LAYER_5B42 +/* 0x5B42 [0xC0 0x01 ] */ ldelay 1 +/* 0x5B44 [0xFF ] */ end + +/* 0x5B45 [0xCB 0x66 0x74 0xF5 ] */ env ENVELOPE_6674, 245 +/* 0x5B49 [0xC7 0x83 0x20 0xFF ] */ portamento 0x83, PITCH_F3, 255 +/* 0x5B4D [0x54 0x0C 0x50 ] */ notedv PITCH_F2, 12, 80 +/* 0x5B50 [0x54 0x0C 0x28 ] */ notedv PITCH_F2, 12, 40 +/* 0x5B53 [0xFF ] */ end + +.channel CHAN_5B54 +/* 0x5B54 [0x88 0x5B 0x58 ] */ ldlayer 0, LAYER_5B58 +/* 0x5B57 [0xFF ] */ end + +.layer LAYER_5B58 +/* 0x5B58 [0xC0 0x01 ] */ ldelay 1 +/* 0x5B5A [0xFF ] */ end + +.channel CHAN_5B5B +/* 0x5B5B [0xC1 0x81 ] */ instr FONTANY_INSTR_TRIANGLE +/* 0x5B5D [0xDA 0x66 0x4C ] */ env ENVELOPE_664C +/* 0x5B60 [0xD9 0xF0 ] */ releaserate 240 +/* 0x5B62 [0x88 0x5B 0x69 ] */ ldlayer 0, LAYER_5B69 +/* 0x5B65 [0x89 0x5B 0x88 ] */ ldlayer 1, LAYER_5B88 +/* 0x5B68 [0xFF ] */ end + +.layer LAYER_5B69 +/* 0x5B69 [0xCA 0x54 ] */ notepan 84 +/* 0x5B6B [0xC0 0x06 ] */ ldelay 6 +/* 0x5B6D [0x62 0x0C 0x50 ] */ notedv PITCH_G3, 12, 80 +/* 0x5B70 [0x67 0x0C 0x50 ] */ notedv PITCH_C4, 12, 80 +/* 0x5B73 [0x6E 0x0C 0x50 ] */ notedv PITCH_G4, 12, 80 +/* 0x5B76 [0x73 0x0C 0x50 ] */ notedv PITCH_C5, 12, 80 +/* 0x5B79 [0xCB 0x66 0x60 0xDE ] */ env ENVELOPE_6660, 222 +/* 0x5B7D [0xCA 0x2C ] */ notepan 44 +/* 0x5B7F [0x77 0x18 0x1E ] */ notedv PITCH_E5, 24, 30 +/* 0x5B82 [0xCA 0x54 ] */ notepan 84 +/* 0x5B84 [0x77 0x18 0x14 ] */ notedv PITCH_E5, 24, 20 +/* 0x5B87 [0xFF ] */ end + +.layer LAYER_5B88 +/* 0x5B88 [0xCA 0x2C ] */ notepan 44 +/* 0x5B8A [0x5F 0x0C 0x50 ] */ notedv PITCH_E3, 12, 80 +/* 0x5B8D [0x64 0x0C 0x50 ] */ notedv PITCH_A3, 12, 80 +/* 0x5B90 [0x6B 0x0C 0x50 ] */ notedv PITCH_E4, 12, 80 +/* 0x5B93 [0x70 0x0C 0x50 ] */ notedv PITCH_A4, 12, 80 +/* 0x5B96 [0xCA 0x40 ] */ notepan 64 +/* 0x5B98 [0x77 0x60 0x50 ] */ notedv PITCH_E5, 96, 80 +/* 0x5B9B [0xFF ] */ end + +.channel CHAN_5B9C +/* 0x5B9C [0xC1 0x81 ] */ instr FONTANY_INSTR_TRIANGLE +/* 0x5B9E [0xDA 0x66 0x4C ] */ env ENVELOPE_664C +/* 0x5BA1 [0xD9 0xF0 ] */ releaserate 240 +/* 0x5BA3 [0x88 0x5B 0xA7 ] */ ldlayer 0, LAYER_5BA7 +/* 0x5BA6 [0xFF ] */ end + +.layer LAYER_5BA7 +/* 0x5BA7 [0xFC 0x5B 0xB4 ] */ call LAYER_5BB4 +LAYER_5BAA: +/* 0x5BAA [0x6F 0x0A 0x4B ] */ notedv PITCH_AF4, 10, 75 +/* 0x5BAD [0x6F 0x14 0x37 ] */ notedv PITCH_AF4, 20, 55 +/* 0x5BB0 [0x6F 0x14 0x23 ] */ notedv PITCH_AF4, 20, 35 +/* 0x5BB3 [0xFF ] */ end + +.layer LAYER_5BB4 +/* 0x5BB4 [0x6F 0x0A 0x4B ] */ notedv PITCH_AF4, 10, 75 +/* 0x5BB7 [0x6C 0x0A 0x4B ] */ notedv PITCH_F4, 10, 75 +/* 0x5BBA [0x68 0x0A 0x4B ] */ notedv PITCH_DF4, 10, 75 +/* 0x5BBD [0xFF ] */ end + +.channel CHAN_5BBE +/* 0x5BBE [0xC1 0x54 ] */ instr SF0_INST_84 +/* 0x5BC0 [0xDA 0x66 0x4C ] */ env ENVELOPE_664C +/* 0x5BC3 [0xD9 0xF5 ] */ releaserate 245 +/* 0x5BC5 [0x88 0x5B 0xCC ] */ ldlayer 0, LAYER_5BCC +/* 0x5BC8 [0x89 0x5B 0xE1 ] */ ldlayer 1, LAYER_5BE1 +/* 0x5BCB [0xFF ] */ end + +.layer LAYER_5BCC +/* 0x5BCC [0xCA 0x18 ] */ notepan 24 +LAYER_5BCE: +/* 0x5BCE [0x6C 0x08 0x46 ] */ notedv PITCH_F4, 8, 70 +/* 0x5BD1 [0x71 0x08 0x46 ] */ notedv PITCH_BF4, 8, 70 +/* 0x5BD4 [0x70 0x08 0x46 ] */ notedv PITCH_A4, 8, 70 +/* 0x5BD7 [0x6E 0x08 0x46 ] */ notedv PITCH_G4, 8, 70 +/* 0x5BDA [0x6C 0x10 0x46 ] */ notedv PITCH_F4, 16, 70 +/* 0x5BDD [0x6C 0x20 0x23 ] */ notedv PITCH_F4, 32, 35 +/* 0x5BE0 [0xFF ] */ end + +.layer LAYER_5BE1 +/* 0x5BE1 [0x65 0x20 0x2D ] */ notedv PITCH_BF3, 32, 45 +/* 0x5BE4 [0x64 0x30 0x2D ] */ notedv PITCH_A3, 48, 45 +/* 0x5BE7 [0xFF ] */ end + +.channel CHAN_5BE8 +/* 0x5BE8 [0xC1 0x54 ] */ instr SF0_INST_84 +/* 0x5BEA [0xDA 0x66 0x4C ] */ env ENVELOPE_664C +/* 0x5BED [0xD9 0xF5 ] */ releaserate 245 +/* 0x5BEF [0x88 0x5B 0xF6 ] */ ldlayer 0, LAYER_5BF6 +/* 0x5BF2 [0x89 0x5B 0xE1 ] */ ldlayer 1, LAYER_5BE1 +/* 0x5BF5 [0xFF ] */ end + +.layer LAYER_5BF6 +/* 0x5BF6 [0xCA 0x68 ] */ notepan 104 +/* 0x5BF8 [0xF4 0xD4 ] */ rjump LAYER_5BCE + +.channel CHAN_5BFA +/* 0x5BFA [0xC1 0x57 ] */ instr SF0_INST_87 +/* 0x5BFC [0xDA 0x65 0xE8 ] */ env ENVELOPE_65E8 +/* 0x5BFF [0x88 0x5C 0x03 ] */ ldlayer 0, LAYER_5C03 +/* 0x5C02 [0xFF ] */ end + +.layer LAYER_5C03 +/* 0x5C03 [0x6E 0x43 0x6E ] */ notedv PITCH_G4, 67, 110 +/* 0x5C06 [0xFF ] */ end + +.channel CHAN_5C07 +/* 0x5C07 [0x88 0x5C 0x0B ] */ ldlayer 0, LAYER_5C0B +/* 0x5C0A [0xFF ] */ end + +.layer LAYER_5C0B +/* 0x5C0B [0xC6 0x54 ] */ instr SF0_INST_84 +/* 0x5C0D [0xCF 0xFA ] */ releaserate 250 +/* 0x5C0F [0x64 0x06 0x5A ] */ notedv PITCH_A3, 6, 90 +/* 0x5C12 [0xCB 0x66 0x74 0xF5 ] */ env ENVELOPE_6674, 245 +/* 0x5C16 [0xC7 0x81 0x24 0x90 ] */ portamento 0x81, PITCH_A3, 144 +/* 0x5C1A [0x70 0x18 0x5A ] */ notedv PITCH_A4, 24, 90 +/* 0x5C1D [0xFF ] */ end + +.channel CHAN_5C1E +/* 0x5C1E [0x88 0x5C 0x22 ] */ ldlayer 0, LAYER_5C22 +/* 0x5C21 [0xFF ] */ end + +.layer LAYER_5C22 +/* 0x5C22 [0xC6 0x54 ] */ instr SF0_INST_84 +/* 0x5C24 [0xCF 0xFA ] */ releaserate 250 +/* 0x5C26 [0x70 0x06 0x5A ] */ notedv PITCH_A4, 6, 90 +/* 0x5C29 [0xCB 0x66 0x74 0xF5 ] */ env ENVELOPE_6674, 245 +/* 0x5C2D [0xC7 0x82 0x24 0x90 ] */ portamento 0x82, PITCH_A3, 144 +/* 0x5C31 [0x6B 0x18 0x3C ] */ notedv PITCH_E4, 24, 60 +/* 0x5C34 [0xFF ] */ end + +.channel CHAN_5C35 +/* 0x5C35 [0xC1 0x2C ] */ instr SF0_INST_44 +/* 0x5C37 [0xDA 0x65 0xD8 ] */ env ENVELOPE_65D8 +/* 0x5C3A [0x88 0x5C 0x3E ] */ ldlayer 0, LAYER_5C3E +/* 0x5C3D [0xFF ] */ end + +.layer LAYER_5C3E +/* 0x5C3E [0xC4 ] */ legato +/* 0x5C3F [0x67 0x18 0x64 ] */ notedv PITCH_C4, 24, 100 +/* 0x5C42 [0x69 0x60 0x64 ] */ notedv PITCH_D4, 96, 100 +/* 0x5C45 [0xFF ] */ end + +.channel CHAN_5C46 +/* 0x5C46 [0xC1 0x2C ] */ instr SF0_INST_44 +/* 0x5C48 [0xDA 0x65 0xD8 ] */ env ENVELOPE_65D8 +/* 0x5C4B [0x88 0x5C 0x4F ] */ ldlayer 0, LAYER_5C4F +/* 0x5C4E [0xFF ] */ end + +.layer LAYER_5C4F +/* 0x5C4F [0xC4 ] */ legato +/* 0x5C50 [0x67 0x18 0x64 ] */ notedv PITCH_C4, 24, 100 +/* 0x5C53 [0x65 0x60 0x64 ] */ notedv PITCH_BF3, 96, 100 +/* 0x5C56 [0xFF ] */ end + +.channel CHAN_5C57 +/* 0x5C57 [0xC1 0x58 ] */ instr SF0_INST_88 +/* 0x5C59 [0x88 0x5C 0x5D ] */ ldlayer 0, LAYER_5C5D +/* 0x5C5C [0xFF ] */ end + +.layer LAYER_5C5D +/* 0x5C5D [0x6A 0x06 0x64 ] */ notedv PITCH_EF4, 6, 100 +/* 0x5C60 [0x6C 0x60 0x64 ] */ notedv PITCH_F4, 96, 100 +/* 0x5C63 [0xFF ] */ end + +.channel CHAN_5C64 +/* 0x5C64 [0xC1 0x57 ] */ instr SF0_INST_87 +/* 0x5C66 [0x88 0x5C 0x6A ] */ ldlayer 0, LAYER_5C6A +/* 0x5C69 [0xFF ] */ end + +.layer LAYER_5C6A +/* 0x5C6A [0xC2 0x30 ] */ transpose 48 +/* 0x5C6C [0xF8 0x04 ] */ loop 4 +/* 0x5C6E [0xCF 0xFA ] */ releaserate 250 +/* 0x5C70 [0x67 0x0C 0x62 ] */ notedv PITCH_C4, 12, 98 +/* 0x5C73 [0xCF 0xD8 ] */ releaserate 216 +/* 0x5C75 [0x67 0x28 0x57 ] */ notedv PITCH_C4, 40, 87 +/* 0x5C78 [0xF7 ] */ loopend +/* 0x5C79 [0xFF ] */ end + +.channel CHAN_5C7A +/* 0x5C7A [0xC1 0x54 ] */ instr SF0_INST_84 +/* 0x5C7C [0x88 0x5C 0x80 ] */ ldlayer 0, LAYER_5C80 +/* 0x5C7F [0xFF ] */ end + +.layer LAYER_5C80 +/* 0x5C80 [0x6B 0x06 0x46 ] */ notedv PITCH_E4, 6, 70 +/* 0x5C83 [0x69 0x06 0x46 ] */ notedv PITCH_D4, 6, 70 +/* 0x5C86 [0x67 0x0C 0x46 ] */ notedv PITCH_C4, 12, 70 +/* 0x5C89 [0xCA 0x2C ] */ notepan 44 +/* 0x5C8B [0x67 0x06 0x24 ] */ notedv PITCH_C4, 6, 36 +/* 0x5C8E [0xCA 0x54 ] */ notepan 84 +/* 0x5C90 [0x67 0x0C 0x24 ] */ notedv PITCH_C4, 12, 36 +/* 0x5C93 [0xFF ] */ end + +.channel CHAN_5C94 +/* 0x5C94 [0x88 0x5C 0x9B ] */ ldlayer 0, LAYER_5C9B +/* 0x5C97 [0x89 0x5C 0xA1 ] */ ldlayer 1, LAYER_5CA1 +/* 0x5C9A [0xFF ] */ end + +.layer LAYER_5C9B +/* 0x5C9B [0xC6 0x5B ] */ instr SF0_INST_91 +/* 0x5C9D [0x7A 0x0E 0x42 ] */ notedv PITCH_G5, 14, 66 +/* 0x5CA0 [0xFF ] */ end + +.layer LAYER_5CA1 +/* 0x5CA1 [0xC2 0x18 ] */ transpose 24 +/* 0x5CA3 [0xC6 0x80 ] */ instr FONTANY_INSTR_SAWTOOTH +/* 0x5CA5 [0xCB 0x66 0x60 0xFA ] */ env ENVELOPE_6660, 250 +/* 0x5CA9 [0x6C 0x03 0x34 ] */ notedv PITCH_F4, 3, 52 +/* 0x5CAC [0xFF ] */ end + +.channel CHAN_5CAD +/* 0x5CAD [0x88 0x5C 0xB1 ] */ ldlayer 0, LAYER_5CB1 +/* 0x5CB0 [0xFF ] */ end + +.layer LAYER_5CB1 +/* 0x5CB1 [0xC6 0x5A ] */ instr SF0_INST_90 +/* 0x5CB3 [0xC2 0x30 ] */ transpose 48 +/* 0x5CB5 [0x67 0x61 0x64 ] */ notedv PITCH_C4, 97, 100 +/* 0x5CB8 [0xFF ] */ end + +.channel CHAN_5CB9 +/* 0x5CB9 [0xC1 0x81 ] */ instr FONTANY_INSTR_TRIANGLE +/* 0x5CBB [0xDA 0x66 0x4C ] */ env ENVELOPE_664C +/* 0x5CBE [0xD9 0xF0 ] */ releaserate 240 +/* 0x5CC0 [0x88 0x5C 0xC4 ] */ ldlayer 0, LAYER_5CC4 +/* 0x5CC3 [0xFF ] */ end + +.layer LAYER_5CC4 +/* 0x5CC4 [0xFC 0x5B 0xB4 ] */ call LAYER_5BB4 +/* 0x5CC7 [0x71 0x0A 0x4B ] */ notedv PITCH_BF4, 10, 75 +/* 0x5CCA [0x6E 0x0A 0x4B ] */ notedv PITCH_G4, 10, 75 +/* 0x5CCD [0x6A 0x0A 0x4B ] */ notedv PITCH_EF4, 10, 75 +/* 0x5CD0 [0xFB 0x5B 0xAA ] */ jump LAYER_5BAA + +.channel CHAN_5CD3 +/* 0x5CD3 [0xD4 0x19 ] */ reverb 25 +/* 0x5CD5 [0x88 0x5C 0xEB ] */ ldlayer 0, LAYER_5CEB +/* 0x5CD8 [0x89 0x5C 0xDC ] */ ldlayer 1, LAYER_5CDC +/* 0x5CDB [0xFF ] */ end + +.layer LAYER_5CDC +/* 0x5CDC [0xC0 0x64 ] */ ldelay 100 +/* 0x5CDE [0xC6 0x56 ] */ instr SF0_INST_86 +/* 0x5CE0 [0xCB 0x67 0xCC 0xDD ] */ env ENVELOPE_67CC, 221 +/* 0x5CE4 [0xC2 0x18 ] */ transpose 24 +/* 0x5CE6 [0x7E 0x80 0x96 0x64 ] */ notedv PITCH_B5, FRAMERATE_CONST(150, 165), 100 +/* 0x5CEA [0xFF ] */ end + +.layer LAYER_5CEB +/* 0x5CEB [0xC6 0x0E ] */ instr SF0_INST_14 +/* 0x5CED [0xCB 0x67 0xD8 0xDD ] */ env ENVELOPE_67D8, 221 +/* 0x5CF1 [0xC2 0x0C ] */ transpose 12 +/* 0x5CF3 [0xC7 0x81 0x02 0xFF ] */ portamento 0x81, PITCH_B0, 255 +/* 0x5CF7 [0x7E 0x80 0xFA 0x55 ] */ notedv PITCH_B5, FRAMERATE_CONST(250, 275), 85 +/* 0x5CFB [0xFF ] */ end + +.channel CHAN_5CFC +/* 0x5CFC [0xD4 0x19 ] */ reverb 25 +/* 0x5CFE [0x88 0x5D 0x12 ] */ ldlayer 0, LAYER_5D12 +/* 0x5D01 [0x89 0x5D 0x05 ] */ ldlayer 1, LAYER_5D05 +/* 0x5D04 [0xFF ] */ end + +.layer LAYER_5D05 +/* 0x5D05 [0xC6 0x56 ] */ instr SF0_INST_86 +/* 0x5D07 [0xCB 0x67 0xD8 0xC8 ] */ env ENVELOPE_67D8, 200 +/* 0x5D0B [0xC2 0x18 ] */ transpose 24 +/* 0x5D0D [0x7E 0x80 0xC8 0x64 ] */ notedv PITCH_B5, FRAMERATE_CONST(200, 220), 100 +/* 0x5D11 [0xFF ] */ end + +.layer LAYER_5D12 +/* 0x5D12 [0xC6 0x0E ] */ instr SF0_INST_14 +/* 0x5D14 [0xCB 0x67 0xD8 0xC8 ] */ env ENVELOPE_67D8, 200 +/* 0x5D18 [0xC2 0x0C ] */ transpose 12 +/* 0x5D1A [0x7E 0x80 0xC8 0x55 ] */ notedv PITCH_B5, FRAMERATE_CONST(200, 220), 85 +/* 0x5D1E [0xFF ] */ end + +.channel CHAN_5D1F +/* 0x5D1F [0xD4 0x19 ] */ reverb 25 +/* 0x5D21 [0x88 0x5D 0x28 ] */ ldlayer 0, LAYER_5D28 +/* 0x5D24 [0x89 0x5D 0x34 ] */ ldlayer 1, LAYER_5D34 +/* 0x5D27 [0xFF ] */ end + +.layer LAYER_5D28 +/* 0x5D28 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x5D2A [0xCB 0x66 0x38 0xDD ] */ env ENVELOPE_6638, 221 +/* 0x5D2E [0xC2 0x18 ] */ transpose 24 +/* 0x5D30 [0x7E 0x40 0x5F ] */ notedv PITCH_B5, 64, 95 +/* 0x5D33 [0xFF ] */ end + +.layer LAYER_5D34 +/* 0x5D34 [0xC6 0x11 ] */ instr SF0_INST_17 +/* 0x5D36 [0xCB 0x66 0xD0 0xE0 ] */ env ENVELOPE_66D0, 224 +/* 0x5D3A [0xC2 0x0C ] */ transpose 12 +/* 0x5D3C [0x7E 0x20 0x41 ] */ notedv PITCH_B5, 32, 65 +/* 0x5D3F [0xFF ] */ end + +.channel CHAN_5D40 +/* 0x5D40 [0xC1 0x15 ] */ instr SF0_INST_21 +/* 0x5D42 [0xED 0x19 ] */ gain 25 +/* 0x5D44 [0x88 0x5D 0x4B ] */ ldlayer 0, LAYER_5D4B +/* 0x5D47 [0x89 0x5D 0x51 ] */ ldlayer 1, LAYER_5D51 +/* 0x5D4A [0xFF ] */ end + +.layer LAYER_5D4B +/* 0x5D4B [0xC0 0x2A ] */ ldelay 42 +/* 0x5D4D [0xCB 0x66 0xA0 0xFB ] */ env ENVELOPE_66A0, 251 +.layer LAYER_5D51 +/* 0x5D51 [0xC2 0x30 ] */ transpose 48 +/* 0x5D53 [0x67 0x00 0x73 ] */ notedv PITCH_C4, 0, 115 +/* 0x5D56 [0xFF ] */ end + +.channel CHAN_5D57 +/* 0x5D57 [0x88 0x5D 0x5B ] */ ldlayer 0, LAYER_5D5B +/* 0x5D5A [0xFF ] */ end + +.layer LAYER_5D5B +/* 0x5D5B [0xC6 0x7F ] */ instr FONTANY_INSTR_DRUM +/* 0x5D5D [0x41 0x48 0x46 ] */ notedv PITCH_BF0, 72, 70 +/* 0x5D60 [0xFF ] */ end + +.channel CHAN_5D61 +/* 0x5D61 [0xC1 0x5A ] */ instr SF0_INST_90 +/* 0x5D63 [0x88 0x5D 0x67 ] */ ldlayer 0, LAYER_5D67 +/* 0x5D66 [0xFF ] */ end + +.layer LAYER_5D67 +/* 0x5D67 [0x67 0x39 0x6E ] */ notedv PITCH_C4, 57, 110 +/* 0x5D6A [0xFF ] */ end + +.channel CHAN_5D6B +/* 0x5D6B [0xC1 0x7F ] */ instr FONTANY_INSTR_DRUM +/* 0x5D6D [0x88 0x5D 0x71 ] */ ldlayer 0, LAYER_5D71 +/* 0x5D70 [0xFF ] */ end + +.layer LAYER_5D71 +/* 0x5D71 [0x40 0x48 0x46 ] */ notedv PITCH_A0, FRAMERATE_CONST(72, 74), 70 +/* 0x5D74 [0xF4 0xFB ] */ rjump LAYER_5D71 + +.channel CHAN_5D76 +/* 0x5D76 [0x88 0x5D 0x84 ] */ ldlayer 0, LAYER_5D84 +/* 0x5D79 [0x89 0x5D 0x7D ] */ ldlayer 1, LAYER_5D7D +/* 0x5D7C [0xFF ] */ end + +.layer LAYER_5D7D +/* 0x5D7D [0xFC 0x5D 0x95 ] */ call LAYER_5D95 +/* 0x5D80 [0x5B 0x10 0x64 ] */ notedv PITCH_C3, 16, 100 +/* 0x5D83 [0xFF ] */ end + +.layer LAYER_5D84 +/* 0x5D84 [0xFC 0x5D 0x8E ] */ call LAYER_5D8E +/* 0x5D87 [0x5B 0x08 0x2E ] */ notedv PITCH_C3, 8, 46 +/* 0x5D8A [0x67 0x1C 0x24 ] */ notedv PITCH_C4, 28, 36 +/* 0x5D8D [0xFF ] */ end + +.layer LAYER_5D8E +/* 0x5D8E [0xC6 0x82 ] */ instr FONTANY_INSTR_SINE +/* 0x5D90 [0xCB 0x66 0x4C 0xFB ] */ env ENVELOPE_664C, 251 +/* 0x5D94 [0xFF ] */ end + +.layer LAYER_5D95 +/* 0x5D95 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x5D97 [0xCB 0x66 0x7C 0xE8 ] */ env ENVELOPE_667C, 232 +/* 0x5D9B [0xC2 0x24 ] */ transpose 36 +/* 0x5D9D [0xFF ] */ end + +.channel CHAN_5D9E +/* 0x5D9E [0x88 0x5D 0xA5 ] */ ldlayer 0, LAYER_5DA5 +/* 0x5DA1 [0x89 0x5D 0xB1 ] */ ldlayer 1, LAYER_5DB1 +/* 0x5DA4 [0xFF ] */ end + +.layer LAYER_5DA5 +/* 0x5DA5 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x5DA7 [0xCB 0x66 0x10 0xE8 ] */ env ENVELOPE_6610, 232 +/* 0x5DAB [0xC2 0x24 ] */ transpose 36 +/* 0x5DAD [0x5F 0x1E 0x5F ] */ notedv PITCH_E3, 30, 95 +/* 0x5DB0 [0xFF ] */ end + +.layer LAYER_5DB1 +/* 0x5DB1 [0xFC 0x5D 0x8E ] */ call LAYER_5D8E +/* 0x5DB4 [0x69 0x06 0x32 ] */ notedv PITCH_D4, 6, 50 +/* 0x5DB7 [0x6B 0x18 0x32 ] */ notedv PITCH_E4, 24, 50 +/* 0x5DBA [0xFF ] */ end + +.channel CHAN_5DBB +/* 0x5DBB [0x88 0x5D 0xC2 ] */ ldlayer 0, LAYER_5DC2 +/* 0x5DBE [0x89 0x5D 0xCE ] */ ldlayer 1, LAYER_5DCE +/* 0x5DC1 [0xFF ] */ end + +.layer LAYER_5DC2 +/* 0x5DC2 [0xC2 0x24 ] */ transpose 36 +LAYER_5DC4: +/* 0x5DC4 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x5DC6 [0xCB 0x66 0x10 0xE8 ] */ env ENVELOPE_6610, 232 +/* 0x5DCA [0x64 0x60 0x70 ] */ notedv PITCH_A3, 96, 112 +/* 0x5DCD [0xFF ] */ end + +.layer LAYER_5DCE +/* 0x5DCE [0xFC 0x5D 0x8E ] */ call LAYER_5D8E +/* 0x5DD1 [0x69 0x06 0x32 ] */ notedv PITCH_D4, 6, 50 +/* 0x5DD4 [0x6E 0x06 0x32 ] */ notedv PITCH_G4, 6, 50 +/* 0x5DD7 [0x70 0x18 0x32 ] */ notedv PITCH_A4, 24, 50 +/* 0x5DDA [0xFF ] */ end + +.channel CHAN_5DDB +/* 0x5DDB [0x88 0x5D 0xE2 ] */ ldlayer 0, LAYER_5DE2 +/* 0x5DDE [0x89 0x5D 0xE6 ] */ ldlayer 1, LAYER_5DE6 +/* 0x5DE1 [0xFF ] */ end + +.layer LAYER_5DE2 +/* 0x5DE2 [0xC2 0x18 ] */ transpose 24 +/* 0x5DE4 [0xF4 0xDE ] */ rjump LAYER_5DC4 + +.layer LAYER_5DE6 +/* 0x5DE6 [0xFC 0x5D 0x8E ] */ call LAYER_5D8E +/* 0x5DE9 [0x70 0x06 0x32 ] */ notedv PITCH_A4, 6, 50 +/* 0x5DEC [0x6B 0x06 0x32 ] */ notedv PITCH_E4, 6, 50 +/* 0x5DEF [0x64 0x18 0x32 ] */ notedv PITCH_A3, 24, 50 +/* 0x5DF2 [0xFF ] */ end + +.channel CHAN_5DF3 +/* 0x5DF3 [0x88 0x5D 0xF7 ] */ ldlayer 0, LAYER_5DF7 +/* 0x5DF6 [0xFF ] */ end + +.layer LAYER_5DF7 +/* 0x5DF7 [0xC6 0x82 ] */ instr FONTANY_INSTR_SINE +/* 0x5DF9 [0xCB 0x67 0x18 0xF0 ] */ env ENVELOPE_6718, 240 +/* 0x5DFD [0x59 0x09 0x46 ] */ notedv PITCH_BF2, 9, 70 +/* 0x5E00 [0x58 0x09 0x46 ] */ notedv PITCH_A2, 9, 70 +/* 0x5E03 [0x59 0x09 0x46 ] */ notedv PITCH_BF2, 9, 70 +/* 0x5E06 [0x58 0x18 0x46 ] */ notedv PITCH_A2, 24, 70 +/* 0x5E09 [0xFF ] */ end + +.channel CHAN_5E0A +/* 0x5E0A [0x88 0x14 0x38 ] */ ldlayer 0, LAYER_1438 +/* 0x5E0D [0x89 0x0B 0x1D ] */ ldlayer 1, LAYER_0B1D +/* 0x5E10 [0x8A 0x0A 0x6E ] */ ldlayer 2, LAYER_0A6E +/* 0x5E13 [0xFF ] */ end + +.channel CHAN_5E14 +/* 0x5E14 [0x88 0x14 0x38 ] */ ldlayer 0, LAYER_1438 +/* 0x5E17 [0x89 0x0B 0x47 ] */ ldlayer 1, LAYER_0B47 +/* 0x5E1A [0x8A 0x0B 0x41 ] */ ldlayer 2, LAYER_0B41 +/* 0x5E1D [0xFF ] */ end + +.channel CHAN_5E1E +/* 0x5E1E [0x88 0x14 0x38 ] */ ldlayer 0, LAYER_1438 +/* 0x5E21 [0x89 0x0B 0x6D ] */ ldlayer 1, LAYER_0B6D +/* 0x5E24 [0x8A 0x0B 0x67 ] */ ldlayer 2, LAYER_0B67 +/* 0x5E27 [0xFF ] */ end + +.channel CHAN_5E28 +/* 0x5E28 [0x88 0x5E 0x2C ] */ ldlayer 0, LAYER_5E2C +/* 0x5E2B [0xFF ] */ end + +.layer LAYER_5E2C +/* 0x5E2C [0xC2 0x0C ] */ transpose 12 +/* 0x5E2E [0xFB 0x14 0x38 ] */ jump LAYER_1438 + +.channel CHAN_5E31 +/* 0x5E31 [0x88 0x5E 0x35 ] */ ldlayer 0, LAYER_5E35 +/* 0x5E34 [0xFF ] */ end + +.layer LAYER_5E35 +/* 0x5E35 [0xC6 0x7F ] */ instr FONTANY_INSTR_DRUM +/* 0x5E37 [0xCF 0x96 ] */ releaserate 150 +/* 0x5E39 [0x41 0x24 0x46 ] */ notedv PITCH_BF0, 36, 70 +/* 0x5E3C [0xFF ] */ end + +.channel CHAN_5E3D +/* 0x5E3D [0xC1 0x54 ] */ instr SF0_INST_84 +/* 0x5E3F [0xDA 0x66 0x60 ] */ env ENVELOPE_6660 +/* 0x5E42 [0xD9 0xFA ] */ releaserate 250 +/* 0x5E44 [0x88 0x5E 0x51 ] */ ldlayer 0, LAYER_5E51 +/* 0x5E47 [0x89 0x5E 0x4B ] */ ldlayer 1, LAYER_5E4B +/* 0x5E4A [0xFF ] */ end + +.layer LAYER_5E4B +/* 0x5E4B [0xC0 0x05 ] */ ldelay 5 +/* 0x5E4D [0xCA 0x5E ] */ notepan 94 +/* 0x5E4F [0xF4 0x02 ] */ rjump LAYER_5E53 + +.layer LAYER_5E51 +/* 0x5E51 [0xCA 0x22 ] */ notepan 34 +LAYER_5E53: +/* 0x5E53 [0xC2 0x0C ] */ transpose 12 +/* 0x5E55 [0x6C 0x0C 0x55 ] */ notedv PITCH_F4, 12, 85 +/* 0x5E58 [0x71 0x0C 0x55 ] */ notedv PITCH_BF4, 12, 85 +/* 0x5E5B [0x76 0x0C 0x55 ] */ notedv PITCH_EF5, 12, 85 +/* 0x5E5E [0x7D 0x0C 0x55 ] */ notedv PITCH_BF5, 12, 85 +/* 0x5E61 [0x78 0x18 0x55 ] */ notedv PITCH_F5, 24, 85 +/* 0x5E64 [0x78 0x18 0x2D ] */ notedv PITCH_F5, 24, 45 +/* 0x5E67 [0x78 0x18 0x19 ] */ notedv PITCH_F5, 24, 25 +/* 0x5E6A [0xFF ] */ end + +.channel CHAN_5E6B +/* 0x5E6B [0x88 0x5E 0x6F ] */ ldlayer 0, LAYER_5E6F +/* 0x5E6E [0xFF ] */ end + +.layer LAYER_5E6F +/* 0x5E6F [0xC6 0x82 ] */ instr FONTANY_INSTR_SINE +/* 0x5E71 [0xCB 0x66 0xD0 0xF8 ] */ env ENVELOPE_66D0, 248 +/* 0x5E75 [0x65 0x0C 0x50 ] */ notedv PITCH_BF3, 12, 80 +/* 0x5E78 [0x60 0x0C 0x50 ] */ notedv PITCH_F3, 12, 80 +/* 0x5E7B [0x69 0x0C 0x50 ] */ notedv PITCH_D4, 12, 80 +/* 0x5E7E [0x6A 0x0C 0x50 ] */ notedv PITCH_EF4, 12, 80 +/* 0x5E81 [0x6C 0x18 0x50 ] */ notedv PITCH_F4, 24, 80 +/* 0x5E84 [0x6C 0x18 0x28 ] */ notedv PITCH_F4, 24, 40 +/* 0x5E87 [0xFF ] */ end + +.channel CHAN_5E88 +/* 0x5E88 [0x88 0x5E 0x8C ] */ ldlayer 0, LAYER_5E8C +/* 0x5E8B [0xFF ] */ end + +.layer LAYER_5E8C +/* 0x5E8C [0xC6 0x82 ] */ instr FONTANY_INSTR_SINE +/* 0x5E8E [0xCB 0x67 0x20 0xF6 ] */ env ENVELOPE_6720, 246 +/* 0x5E92 [0xC7 0x83 0x20 0x7F ] */ portamento 0x83, PITCH_F3, 127 +/* 0x5E96 [0x67 0x08 0x50 ] */ notedv PITCH_C4, 8, 80 +/* 0x5E99 [0x73 0x0C 0x50 ] */ notedv PITCH_C5, 12, 80 +/* 0x5E9C [0xFF ] */ end + +.channel ocarinabank_handler_1 +/* 0x5E9D [0xC2 0x5E 0xE5 ] */ dyntbl ocarinabank_table +/* 0x5EA0 [0xC4 ] */ noshort +/* 0x5EA1 [0xC6 0x00 ] */ font Soundfont_0_ID +/* 0x5EA3 [0xDC 0x7F ] */ panweight 127 +/* 0x5EA5 [0xCA 0x00 ] */ mutebhv 0x00 +/* 0x5EA7 [0xD0 0x80 ] */ effects TRUE, 0, 0, 0, 0, 0 +/* 0x5EA9 [0xE9 0x0E ] */ notepri 0, 14 +CHAN_5EAB: +/* 0x5EAB [0xFE ] */ delay1 +/* 0x5EAC [0x61 ] */ ldio IO_PORT_1 +/* 0x5EAD [0xF2 0x0B ] */ rbltz CHAN_5EBA +/* 0x5EAF [0xF3 0x06 ] */ rbeqz CHAN_5EB7 +/* 0x5EB1 [0xF1 0x01 ] */ allocnotelist 1 +/* 0x5EB3 [0xD1 0x02 ] */ notealloc 2 +#if OOT_PAL_N64 +/* [0xCC 0x00 ] */ ldi 0 +/* [0x76 ] */ stio IO_PORT_6 +#endif +/* 0x5EB5 [0xF4 0x03 ] */ rjump CHAN_5EBA + +CHAN_5EB7: +/* 0x5EB7 [0xF0 ] */ freenotelist +/* 0x5EB8 [0xD1 0x00 ] */ notealloc 0 +CHAN_5EBA: +/* 0x5EBA [0x60 ] */ ldio IO_PORT_0 +/* 0x5EBB [0xC8 0x01 ] */ sub 1 +/* 0x5EBD [0xF3 0x02 ] */ rbeqz CHAN_5EC1 +/* 0x5EBF [0xF4 0xEA ] */ rjump CHAN_5EAB + +CHAN_5EC1: +/* 0x5EC1 [0xD8 0x00 ] */ vibdepth 0 +/* 0x5EC3 [0xE5 0x00 ] */ reverbidx 0 +/* 0x5EC5 [0x90 ] */ dellayer 0 +#if !OOT_PAL_N64 +/* 0x5EC6 [0xCC 0x00 ] */ ldi 0 +/* 0x5EC8 [0x76 ] */ stio IO_PORT_6 +#endif +/* 0x5EC9 [0x64 ] */ ldio IO_PORT_SFX_INDEX_LOBITS +/* 0x5ECA [0xE4 ] */ dyncall +CHAN_5ECB: +/* 0x5ECB [0x62 ] */ ldio IO_PORT_2 +/* 0x5ECC [0xF2 0x06 ] */ rbltz CHAN_5ED4 +/* 0x5ECE [0xC7 0x00 0x5E 0xD3 ] */ stseq 0, STSEQ_HERE + STSEQ_VOL +/* 0x5ED2 [0xDF 0x7F ] */ vol 127 +CHAN_5ED4: +/* 0x5ED4 [0xFE ] */ delay1 +/* 0x5ED5 [0x60 ] */ ldio IO_PORT_0 +/* 0x5ED6 [0xF3 0x0A ] */ rbeqz CHAN_5EE2 +/* 0x5ED8 [0xF2 0x02 ] */ rbltz CHAN_5EDC +/* 0x5EDA [0xF4 0xE5 ] */ rjump CHAN_5EC1 + +CHAN_5EDC: +/* 0x5EDC [0x80 ] */ testlayer 0 +/* 0x5EDD [0xF3 0xEC ] */ rbeqz CHAN_5ECB +/* 0x5EDF [0xCC 0xFF ] */ ldi 255 +/* 0x5EE1 [0x71 ] */ stio IO_PORT_1 +CHAN_5EE2: +/* 0x5EE2 [0x90 ] */ dellayer 0 +/* 0x5EE3 [0xF4 0xC6 ] */ rjump CHAN_5EAB + +#define DEFINE_SFX(lblName, sfxId, priority, decay, rand, flags) \ + entry lblName + +.table_unaligned ocarinabank_table + #include "ocarinabank_table.h" + +#undef DEFINE_SFX + +.channel CHAN_5EF5 +/* 0x5EF5 [0xCC 0x50 ] */ ldi 80 +/* 0x5EF7 [0x71 ] */ stio IO_PORT_1 +/* 0x5EF8 [0x67 ] */ ldio IO_PORT_7 +/* 0x5EF9 [0xC9 0x07 ] */ and 7 +/* 0x5EFB [0xCB 0x5F 0x30 ] */ ldseq UNK_5F30 +/* 0x5EFE [0xC7 0x00 0x5F 0x0D ] */ stseq 0, CHAN_5F0C + STSEQ_INSTR +/* 0x5F02 [0x67 ] */ ldio IO_PORT_7 +/* 0x5F03 [0xC9 0x07 ] */ and 7 +/* 0x5F05 [0xCB 0x5F 0x38 ] */ ldseq UNK_5F38 +/* 0x5F08 [0xC7 0x00 0x5F 0x2E ] */ stseq 0, LAYER_5F2B + STSEQ_NOTEDV_VELOCITY +CHAN_5F0C: +/* 0x5F0C [0xC1 0x34 ] */ instr SF0_INST_52 +/* 0x5F0E [0x65 ] */ ldio IO_PORT_SFX_INDEX_HIBITS +/* 0x5F0F [0xF2 0x04 ] */ rbltz CHAN_5F15 +/* 0x5F11 [0xC7 0x00 0x5F 0x2A ] */ stseq 0, LAYER_5F29 + STSEQ_TRANSPOSITION +CHAN_5F15: +/* 0x5F15 [0x88 0x5F 0x28 ] */ ldlayer 0, LAYER_5F28 +CHAN_5F18: +/* 0x5F18 [0x66 ] */ ldio IO_PORT_6 +#if !OOT_PAL_N64 +/* 0x5F19 [0xF2 0x06 ] */ rbltz CHAN_5F21 +#endif +/* 0x5F1B [0xC7 0x00 0x5F 0x20 ] */ stseq 0, STSEQ_HERE + STSEQ_VIBDEPTH +/* 0x5F1F [0xD8 0x00 ] */ vibdepth 0 +CHAN_5F21: +/* 0x5F21 [0xCC 0x01 ] */ ldi 1 +/* 0x5F23 [0xFC 0x00 0x48 ] */ call CHAN_0048 +/* 0x5F26 [0xF4 0xF0 ] */ rjump CHAN_5F18 + +.layer LAYER_5F28 +/* 0x5F28 [0xC4 ] */ legato +LAYER_5F29: +/* 0x5F29 [0xC2 0x00 ] */ transpose 0 +LAYER_5F2B: +/* 0x5F2B [0x67 0x81 0xE0 0x7F ] */ notedv PITCH_C4, 480, 127 +/* 0x5F2F [0xFF ] */ end + +UNK_5F30: + .byte 0x34, 0x55, 0x56, 0x59, 0x53, 0x52, 0x34, 0x34 + +UNK_5F38: + .byte 0x73, 0x73, 0x64, 0x73, 0x64, 0x73, 0x73, 0x73 + +.channel CHAN_5F40 +/* 0x5F40 [0xCC 0x81 ] */ ldi 129 +CHAN_5F42: +/* 0x5F42 [0xD7 0x40 ] */ vibfreq 64 +/* 0x5F44 [0xE2 0x04 0x08 0x08 ] */ vibdepthgrad 4, 8, 8 +/* 0x5F48 [0xC7 0x00 0x5F 0x5D ] */ stseq 0/* portamento mode */, LAYER_5F5C + STSEQ_PORTAMENTO_MODE +/* 0x5F4C [0xC1 0x40 ] */ instr SF0_INST_64 +/* 0x5F4E [0xDA 0x66 0xFC ] */ env ENVELOPE_66FC +/* 0x5F51 [0xD9 0xF0 ] */ releaserate 240 +/* 0x5F53 [0x88 0x5F 0x5A ] */ ldlayer 0, LAYER_5F5A +/* 0x5F56 [0x89 0x5F 0x5C ] */ ldlayer 1, LAYER_5F5C +/* 0x5F59 [0xFF ] */ end + +.layer LAYER_5F5A +/* 0x5F5A [0xC2 0x18 ] */ transpose 24 +.layer LAYER_5F5C +/* 0x5F5C [0xC7 0x81 0x0F 0xFF ] */ portamento 0x81, PITCH_C2, 255 +/* 0x5F60 [0x62 0x80 0x8C 0x50 ] */ notedv PITCH_G3, FRAMERATE_CONST(140, 168), 80 +/* 0x5F64 [0xFF ] */ end + +.channel CHAN_5F65 +/* 0x5F65 [0xCC 0x82 ] */ ldi 130 +/* 0x5F67 [0xF4 0xD9 ] */ rjump CHAN_5F42 + +.channel CHAN_5F69 +/* 0x5F69 [0xCC 0x50 ] */ ldi FRAMERATE_CONST(80, 96) +/* 0x5F6B [0xC7 0x00 0x5F 0x91 ] */ stseq 0, LAYER_5F90 + STSEQ_NOTEDV_DELAY_HI +/* 0x5F6F [0xCC 0x81 ] */ ldi 129 +CHAN_5F71: +/* 0x5F71 [0xC7 0x00 0x5F 0x8D ] */ stseq 0/* portamento mode */, LAYER_5F8C + STSEQ_PORTAMENTO_MODE +/* 0x5F75 [0xCC 0x14 ] */ ldi 20 +/* 0x5F77 [0x71 ] */ stio IO_PORT_1 +/* 0x5F78 [0xED 0x0F ] */ gain 15 +/* 0x5F7A [0x88 0x5F 0x84 ] */ ldlayer 0, LAYER_5F84 +/* 0x5F7D [0xD7 0x08 ] */ vibfreq 8 +/* 0x5F7F [0xE2 0x04 0x28 0x08 ] */ vibdepthgrad 4, 40, 8 +/* 0x5F83 [0xFF ] */ end + +.layer LAYER_5F84 +/* 0x5F84 [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x5F86 [0xC2 0x30 ] */ transpose 48 +/* 0x5F88 [0xCB 0x67 0x40 0xFB ] */ env ENVELOPE_6740, 251 +LAYER_5F8C: +/* 0x5F8C [0xC7 0x81 0x20 0xE0 ] */ portamento 0x81, PITCH_F3, 224 +LAYER_5F90: +/* 0x5F90 [0x50 0x50 0x69 ] */ notedv PITCH_DF2, 80, 105 +/* 0x5F93 [0xC0 0x60 ] */ ldelay 96 +/* 0x5F95 [0xFF ] */ end + +.channel CHAN_5F96 +/* 0x5F96 [0xCC 0x28 ] */ ldi FRAMERATE_CONST(40, 48) +/* 0x5F98 [0xC7 0x00 0x5F 0x91 ] */ stseq 0, LAYER_5F90 + STSEQ_NOTEDV_DELAY_HI +/* 0x5F9C [0xCC 0x82 ] */ ldi 130 +/* 0x5F9E [0xF4 0xD1 ] */ rjump CHAN_5F71 + +.channel voicebank_handler_1 +/* 0x5FA0 [0xB0 0x65 0xB0 ] */ ldfilter FILTER_65B0 +/* 0x5FA3 [0xF4 0x03 ] */ rjump CHAN_5FA8 + +.channel voicebank_handler_2 +/* 0x5FA5 [0xB0 0x65 0xC0 ] */ ldfilter FILTER_65C0 +CHAN_5FA8: +/* 0x5FA8 [0xFC 0x00 0x72 ] */ call CHAN_0072 +/* 0x5FAB [0xC1 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x5FAD [0xDA 0x65 0xD0 ] */ env ENVELOPE_65D0 +/* 0x5FB0 [0xD9 0xFB ] */ releaserate 251 +/* 0x5FB2 [0xD3 0x00 ] */ bend 0 +/* 0x5FB4 [0xB3 0x00 ] */ filter 0, 0 +/* 0x5FB6 [0xD0 0x80 ] */ effects TRUE, 0, 0, 0, 0, 0 +/* 0x5FB8 [0xF1 0x01 ] */ allocnotelist 1 +CHAN_5FBA: +/* 0x5FBA [0xFE ] */ delay1 +/* 0x5FBB [0x60 ] */ ldio IO_PORT_0 +/* 0x5FBC [0xC8 0x01 ] */ sub 1 +/* 0x5FBE [0xF3 0x02 ] */ rbeqz CHAN_5FC2 +/* 0x5FC0 [0xF4 0xF8 ] */ rjump CHAN_5FBA + +CHAN_5FC2: +/* 0x5FC2 [0x90 ] */ dellayer 0 +/* 0x5FC3 [0x91 ] */ dellayer 1 +/* 0x5FC4 [0xCC 0x00 ] */ ldi 0 +/* 0x5FC6 [0x71 ] */ stio IO_PORT_1 +/* 0x5FC7 [0x64 ] */ ldio IO_PORT_SFX_INDEX_LOBITS +/* 0x5FC8 [0xF5 0x5F 0xD2 ] */ bgez CHAN_5FD2 +/* 0x5FCB [0xC9 0x7F ] */ and 127 +/* 0x5FCD [0xC2 0x60 0xF2 ] */ dyntbl voicebank_table + 2 * 1 * 128 //! @bug this label points out of bounds of the table +/* 0x5FD0 [0xF4 0x03 ] */ rjump CHAN_5FD5 + +CHAN_5FD2: +/* 0x5FD2 [0xC2 0x5F 0xF2 ] */ dyntbl voicebank_table + 2 * 0 * 128 +CHAN_5FD5: +/* 0x5FD5 [0xE4 ] */ dyncall +CHAN_5FD6: +/* 0x5FD6 [0x63 ] */ ldio IO_PORT_3 +/* 0x5FD7 [0xC7 0x00 0x5F 0xDC ] */ stseq 0, STSEQ_HERE + STSEQ_FILTER_IDX +/* 0x5FDB [0xB3 0x0F ] */ filter 0, 15 +/* 0x5FDD [0xFC 0x00 0x84 ] */ call CHAN_0084 +/* 0x5FE0 [0xFE ] */ delay1 +/* 0x5FE1 [0x60 ] */ ldio IO_PORT_0 +/* 0x5FE2 [0xF3 0x0A ] */ rbeqz CHAN_5FEE +/* 0x5FE4 [0xF2 0x02 ] */ rbltz CHAN_5FE8 +/* 0x5FE6 [0xF4 0xDA ] */ rjump CHAN_5FC2 + +CHAN_5FE8: +/* 0x5FE8 [0x80 ] */ testlayer 0 +/* 0x5FE9 [0xF3 0xEB ] */ rbeqz CHAN_5FD6 +/* 0x5FEB [0xCC 0xFF ] */ ldi 255 +/* 0x5FED [0x71 ] */ stio IO_PORT_1 +CHAN_5FEE: +/* 0x5FEE [0x90 ] */ dellayer 0 +/* 0x5FEF [0x91 ] */ dellayer 1 +/* 0x5FF0 [0xF4 0xC8 ] */ rjump CHAN_5FBA + +#define DEFINE_SFX(lblName, sfxId, priority, decay, rand, flags) \ + entry lblName + +.table voicebank_table + #include "voicebank_table.h" + +#undef DEFINE_SFX + +.channel CHAN_60F2 +/* 0x60F2 [0xC7 0x00 0x61 0x32 ] */ stseq 0, CHAN_6131 + STSEQ_RAND +/* 0x60F6 [0xC7 0x00 0x61 0x12 ] */ stseq 0, CHAN_6111 + STSEQ_SUB_IMM +/* 0x60FA [0xCC 0x00 ] */ ldi 0 +/* 0x60FC [0xC7 0x00 0x61 0x2E ] */ stseq 0, LAYER_612D + STSEQ_NOTEDV_DELAY_HI +/* 0x6100 [0xFC 0x61 0x31 ] */ call CHAN_6131 +/* 0x6103 [0x56 ] */ subio IO_PORT_6 +/* 0x6104 [0xF3 0x05 ] */ rbeqz CHAN_610B +/* 0x6106 [0xFC 0x61 0x31 ] */ call CHAN_6131 +/* 0x6109 [0xF4 0x0B ] */ rjump CHAN_6116 + +CHAN_610B: +/* 0x610B [0xFC 0x61 0x31 ] */ call CHAN_6131 +/* 0x610E [0xC8 0xFF ] */ sub 255 +/* 0x6110 [0x76 ] */ stio IO_PORT_6 +CHAN_6111: +/* 0x6111 [0xC8 0x00 ] */ sub 0 +/* 0x6113 [0xF3 0x01 ] */ rbeqz CHAN_6116 +/* 0x6115 [0x66 ] */ ldio IO_PORT_6 +CHAN_6116: +/* 0x6116 [0x3E 0x06 ] */ stcio 14, IO_PORT_6 +/* 0x6118 [0x3F 0x06 ] */ stcio 15, IO_PORT_6 +CHAN_611A: +/* 0x611A [0xCB 0x61 0x6D ] */ ldseq UNK_616D +/* 0x611D [0xC7 0x40 0x61 0x2D ] */ stseq (NOTEDV_OPCODE | PITCH_A0), LAYER_612D + STSEQ_NOTEDV_OPCODE_PITCH +/* 0x6121 [0x66 ] */ ldio IO_PORT_6 +CHAN_6122: +/* 0x6122 [0xCB 0x61 0x71 ] */ ldseq UNK_6171 +CHAN_6125: +/* 0x6125 [0xC7 0x00 0x61 0x2F ] */ stseq 0, LAYER_612D + STSEQ_NOTEDV_VELOCITY_2 +/* 0x6129 [0x88 0x61 0x2D ] */ ldlayer 0, LAYER_612D +.channel CHAN_612C +/* 0x612C [0xFF ] */ end + +.layer LAYER_612D +/* 0x612D [0x40 0x00 0x7F ] */ notedv PITCH_A0, 0, 127 +/* 0x6130 [0xFF ] */ end + +.channel CHAN_6131 +/* 0x6131 [0xB8 0x00 ] */ rand 0 +/* 0x6133 [0xFF ] */ end + +CHAN_6134: +/* 0x6134 [0x76 ] */ stio IO_PORT_6 +/* 0x6135 [0xCC 0x00 ] */ ldi 0 +/* 0x6137 [0xC7 0x00 0x61 0x2E ] */ stseq 0, LAYER_612D + STSEQ_NOTEDV_DELAY_HI +/* 0x613B [0x66 ] */ ldio IO_PORT_6 +/* 0x613C [0xF4 0xDC ] */ rjump CHAN_611A + +CHAN_613E: +/* 0x613E [0xCC 0x00 ] */ ldi 0 +/* 0x6140 [0xC7 0x00 0x61 0x2E ] */ stseq 0, LAYER_612D + STSEQ_NOTEDV_DELAY_HI + // Transfers the held pointer to the dyntable pointer +/* 0x6144 [0xB4 ] */ ptrtodyntbl + // Load 0 into TR +/* 0x6145 [0xCC 0x00 ] */ ldi 0 + // Reads the byte at (PTR + 0) into TR (the note) +/* 0x6147 [0xB6 ] */ dyntblv + // Store NOTEDV_OPCODE + TR into the pitch +/* 0x6148 [0xC7 0x40 0x61 0x2D ] */ stseq (NOTEDV_OPCODE | PITCH_A0), LAYER_612D + STSEQ_NOTEDV_OPCODE_PITCH + // Load 1 into TR +/* 0x614C [0xCC 0x01 ] */ ldi 1 + // Reads the byte at (PTR + 1) into TR (the velocity) +/* 0x614E [0xB6 ] */ dyntblv +/* 0x614F [0xF4 0xD4 ] */ rjump CHAN_6125 + +CHAN_6151: +/* 0x6151 [0xC7 0x00 0x61 0x2E ] */ stseq 0, LAYER_612D + STSEQ_NOTEDV_DELAY_HI +/* 0x6155 [0x66 ] */ ldio IO_PORT_6 +/* 0x6156 [0xC8 0xFF ] */ sub 255 +/* 0x6158 [0xC9 0x01 ] */ and 1 +/* 0x615A [0x76 ] */ stio IO_PORT_6 +/* 0x615B [0xF4 0xBD ] */ rjump CHAN_611A + +.channel CHAN_615D +/* 0x615D [0xCE 0x61 0x6D ] */ ldptr UNK_616D +/* 0x6160 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x6163 [0xCE 0x61 0x71 ] */ ldptr UNK_6171 +/* 0x6166 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x6169 [0xCC 0x04 ] */ ldi 4 +/* 0x616B [0xF4 0x85 ] */ rjump CHAN_60F2 + +UNK_616D: + .byte 0x00, 0x01, 0x02, 0x03 + +UNK_6171: + .byte 0x69, 0x69, 0x69, 0x69 + +.channel CHAN_6175 +/* 0x6175 [0xCE 0x61 0x97 ] */ ldptr UNK_6197 +/* 0x6178 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x617B [0xCE 0x61 0x99 ] */ ldptr UNK_6199 +/* 0x617E [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x6181 [0xB8 0x02 ] */ rand 2 +/* 0x6183 [0xF4 0xAF ] */ rjump CHAN_6134 + +.channel CHAN_6185 //! Unreachable code? +/* 0x6185 [0x56 ] */ subio IO_PORT_6 +/* 0x6186 [0xF3, 0x04 ] */ rbeqz CHAN_618C +/* 0x6188 [0xB8, 0x02 ] */ rand 2 +/* 0x618A [0xF4, 0x0A ] */ rjump CHAN_6196 +CHAN_618C: +/* 0x618C [0xB8, 0x02 ] */ rand 2 +/* 0x618E [0xC8, 0xFF ] */ sub 255 +/* 0x6190 [0x76 ] */ stio IO_PORT_6 +/* 0x6191 [0xC8, 0x02 ] */ sub 2 +/* 0x6193 [0xF3, 0x01 ] */ rbeqz CHAN_6196 +/* 0x6195 [0x66 ] */ ldio IO_PORT_6 +CHAN_6196: +/* 0x6196 [0x76 ] */ stio IO_PORT_6 + +UNK_6197: + .byte 0x04, 0x05 + +UNK_6199: + .byte 0x6E, 0x6E + +.channel CHAN_619B +/* 0x619B [0xCE 0x61 0xBD ] */ ldptr UNK_61BD +/* 0x619E [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x61A1 [0xCE 0x61 0xBF ] */ ldptr UNK_61BF +/* 0x61A4 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x61A7 [0xB8 0x02 ] */ rand 2 +/* 0x61A9 [0xF4 0x89 ] */ rjump CHAN_6134 + +.channel CHAN_61AB //! Unreachable code? +/* 0x61AB [0x56 ] */ subio IO_PORT_6 +/* 0x61AC [0xF3, 0x04 ] */ rbeqz CHAN_61B2 +/* 0x61AE [0xB8, 0x02 ] */ rand 2 +/* 0x61B0 [0xF4, 0x0A ] */ rjump CHAN_61BC +CHAN_61B2: +/* 0x61B2 [0xB8, 0x02 ] */ rand 2 +/* 0x61B4 [0xC8, 0xFF ] */ sub 255 +/* 0x61B6 [0x76 ] */ stio IO_PORT_6 +/* 0x61B7 [0xC8, 0x02 ] */ sub 2 +/* 0x61B9 [0xF3, 0x01 ] */ rbeqz CHAN_61BC +/* 0x61BB [0x66 ] */ ldio IO_PORT_6 +CHAN_61BC: +/* 0x61BC [0x76 ] */ stio IO_PORT_6 + +UNK_61BD: + .byte 0x15, 0x16 + +UNK_61BF: + .byte 0x69, 0x69 + +.channel CHAN_61C1 +/* 0x61C1 [0xCE 0x61 0xD1 ] */ ldptr UNK_61D1 +/* 0x61C4 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x61C7 [0xCE 0x61 0xD3 ] */ ldptr UNK_61D3 +/* 0x61CA [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x61CD [0xCC 0x00 ] */ ldi 0 +/* 0x61CF [0xF4 0x80 ] */ rjump CHAN_6151 + +UNK_61D1: + .byte 0x06, 0x19 + +UNK_61D3: + .byte 0x5F, 0x69 + +.channel CHAN_61D5 +/* 0x61D5 [0xCE 0x61 0xE6 ] */ ldptr UNK_61E6 +/* 0x61D8 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x61DB [0xCE 0x61 0xE8 ] */ ldptr UNK_61E8 +/* 0x61DE [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x61E1 [0xB8 0x02 ] */ rand 2 +/* 0x61E3 [0xFB 0x61 0x34 ] */ jump CHAN_6134 + +UNK_61E6: + .byte 0x07, 0x08 + +UNK_61E8: + .byte 0x48, 0x50 + +.channel CHAN_61EA +/* 0x61EA [0xCE 0x61 0xFB ] */ ldptr UNK_61FB +/* 0x61ED [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x61F0 [0xCE 0x61 0xFE ] */ ldptr UNK_61FE +/* 0x61F3 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x61F6 [0xCC 0x03 ] */ ldi 3 +/* 0x61F8 [0xFB 0x60 0xF2 ] */ jump CHAN_60F2 + +UNK_61FB: + .byte 0x09, 0x0A, 0x0B + +UNK_61FE: + .byte 0x75, 0x75, 0x75 + +.channel CHAN_6201 +/* 0x6201 [0xCE 0x62 0x12 ] */ ldptr UNK_6212 +/* 0x6204 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x6207 [0xCE 0x62 0x15 ] */ ldptr UNK_6215 +/* 0x620A [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x620D [0xCC 0x03 ] */ ldi 3 +/* 0x620F [0xFB 0x60 0xF2 ] */ jump CHAN_60F2 + +UNK_6212: + .byte 0x0C, 0x0D, 0x0E + +UNK_6215: + .byte 0x71, 0x71, 0x71 + +.channel CHAN_6218 +/* 0x6218 [0xCE 0x62 0x29 ] */ ldptr UNK_6229 +/* 0x621B [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x621E [0xCE 0x62 0x2B ] */ ldptr UNK_622B +/* 0x6221 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x6224 [0xB8 0x02 ] */ rand 2 +/* 0x6226 [0xFB 0x61 0x34 ] */ jump CHAN_6134 + +UNK_6229: + .byte 0x11, 0x12 + +UNK_622B: + .byte 0x64, 0x64 + +.channel CHAN_622D +/* 0x622D [0xCE 0x62 0x3E ] */ ldptr UNK_623E +/* 0x6230 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x6233 [0xCE 0x62 0x40 ] */ ldptr UNK_6240 +/* 0x6236 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x6239 [0xB8 0x02 ] */ rand 2 +/* 0x623B [0xFB 0x61 0x34 ] */ jump CHAN_6134 + +UNK_623E: + .byte 0x0F, 0x10 + +UNK_6240: + .byte 0x6E, 0x6E + +.channel CHAN_6242 +/* 0x6242 [0xCE 0x62 0x53 ] */ ldptr UNK_6253 +/* 0x6245 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x6248 [0xCE 0x62 0x55 ] */ ldptr UNK_6255 +/* 0x624B [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x624E [0xB8 0x02 ] */ rand 2 +/* 0x6250 [0xFB 0x61 0x34 ] */ jump CHAN_6134 + +UNK_6253: + .byte 0x13, 0x17 + +UNK_6255: + .byte 0x5A, 0x5A + +.channel CHAN_6257 +/* 0x6257 [0x88 0x62 0x5B ] */ ldlayer 0, LAYER_625B +/* 0x625A [0xFF ] */ end + +.layer LAYER_625B +/* 0x625B [0x78 0x00 0x60 ] */ notedv PITCH_F5, 0, 96 +/* 0x625E [0xFF ] */ end + +.channel CHAN_625F +/* 0x625F [0x88 0x62 0x63 ] */ ldlayer 0, LAYER_6263 +/* 0x6262 [0xFF ] */ end + +.layer LAYER_6263 +/* 0x6263 [0xC2 0x01 ] */ transpose 1 +/* 0x6265 [0x4D 0x57 0x64 ] */ notedv PITCH_BF1, FRAMERATE_CONST(87, 104), 100 +/* 0x6268 [0x4E 0x61 0x64 ] */ notedv PITCH_B1, FRAMERATE_CONST(97, 116), 100 +/* 0x626B [0x4F 0x47 0x64 ] */ notedv PITCH_C2, FRAMERATE_CONST(71, 85), 100 +/* 0x626E [0xFF ] */ end + +.channel CHAN_626F +/* 0x626F [0xCE 0x62 0x80 ] */ ldptr UNK_6280 +/* 0x6272 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x6275 [0xCE 0x62 0x82 ] */ ldptr UNK_6282 +/* 0x6278 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x627B [0xB8 0x02 ] */ rand 2 +/* 0x627D [0xFB 0x61 0x34 ] */ jump CHAN_6134 + +UNK_6280: + .byte 0x0F, 0x10 + +UNK_6282: + .byte 0x69, 0x69 + +.channel CHAN_6284 +/* 0x6284 [0xFB 0x61 0xEA ] */ jump CHAN_61EA + +.channel CHAN_6287 +/* 0x6287 [0x88 0x62 0x8B ] */ ldlayer 0, LAYER_628B +/* 0x628A [0xFF ] */ end + +.layer LAYER_628B +/* 0x628B [0xC2 0x01 ] */ transpose 1 +/* 0x628D [0x50 0x7F 0x64 ] */ notedv PITCH_DF2, FRAMERATE_CONST(127, 152), 100 +/* 0x6290 [0x51 0x81 0x18 0x64 ] */ notedv PITCH_D2, FRAMERATE_CONST(280, 336), 100 +/* 0x6294 [0x52 0x81 0x3E 0x64 ] */ notedv PITCH_EF2, FRAMERATE_CONST(318, 382), 100 +/* 0x6298 [0xFF ] */ end + +.channel CHAN_6299 +/* 0x6299 [0x88 0x62 0x9D ] */ ldlayer 0, LAYER_629D +/* 0x629C [0xFF ] */ end + +.layer LAYER_629D +/* 0x629D [0xC2 0x01 ] */ transpose 1 +/* 0x629F [0x53 0x81 0x22 0x64 ] */ notedv PITCH_E2, FRAMERATE_CONST(290, 378), 100 +/* 0x62A3 [0x54 0x80 0xA3 0x64 ] */ notedv PITCH_F2, FRAMERATE_CONST(163, 196), 100 +/* 0x62A7 [0x55 0x35 0x64 ] */ notedv PITCH_GF2, FRAMERATE_CONST(53, 64), 100 +/* 0x62AA [0xFF ] */ end + +.channel CHAN_62AB +/* 0x62AB [0x88 0x62 0xAF ] */ ldlayer 0, LAYER_62AF +/* 0x62AE [0xFF ] */ end + +.layer LAYER_62AF +/* 0x62AF [0x77 0x50 0x50 ] */ notedv PITCH_E5, FRAMERATE_CONST(80, 96), 80 +/* 0x62B2 [0xF4 0xFB ] */ rjump LAYER_62AF + +.channel CHAN_62B4 +/* 0x62B4 [0x88 0x62 0xB8 ] */ ldlayer 0, LAYER_62B8 +/* 0x62B7 [0xFF ] */ end + +.layer LAYER_62B8 +/* 0x62B8 [0xC2 0x01 ] */ transpose 1 +/* 0x62BA [0x56 0x80 0xB9 0x64 ] */ notedv PITCH_G2, FRAMERATE_CONST(185, 222), 100 +/* 0x62BE [0x57 0x80 0x86 0x64 ] */ notedv PITCH_AF2, FRAMERATE_CONST(134, 161), 100 +/* 0x62C2 [0x58 0x74 0x64 ] */ notedv PITCH_A2, 116, 100 +/* 0x62C5 [0xFF ] */ end + +.channel CHAN_62C6 +/* 0x62C6 [0xCE 0x62 0xCC ] */ ldptr UNK_62CC +/* 0x62C9 [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_62CC: + .byte 0x00, 0x64 + +.channel CHAN_62CE +/* 0x62CE [0x66 ] */ ldio IO_PORT_6 +/* 0x62CF [0xC8 0xFF ] */ sub 255 +/* 0x62D1 [0x76 ] */ stio IO_PORT_6 +/* 0x62D2 [0xC9 0x01 ] */ and 1 +/* 0x62D4 [0xCB 0x62 0xE8 ] */ ldseq UNK_62E8 +/* 0x62D7 [0xC7 0x40 0x64 0xBF ] */ stseq (NOTEDV_OPCODE | PITCH_A0), LAYER_64BF + STSEQ_NOTEDV_OPCODE_PITCH +/* 0x62DB [0xB8 0x02 ] */ rand 2 +/* 0x62DD [0xCB 0x62 0xEA ] */ ldseq UNK_62EA +/* 0x62E0 [0xC7 0x00 0x64 0xC1 ] */ stseq 0, LAYER_64BF + STSEQ_NOTEDV_VELOCITY_2 +/* 0x62E4 [0x88 0x64 0xBF ] */ ldlayer 0, LAYER_64BF +/* 0x62E7 [0xFF ] */ end + +UNK_62E8: + .byte 0x1A, 0x1B + +UNK_62EA: + .byte 0x50, 0x55 + +.channel CHAN_62EC +/* 0x62EC [0xCE 0x62 0xF2 ] */ ldptr UNK_62F2 +/* 0x62EF [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_62F2: + .byte 0x05, 0x6E + +.channel CHAN_62F4 +/* 0x62F4 [0x88 0x62 0xF8 ] */ ldlayer 0, LAYER_62F8 +/* 0x62F7 [0xFF ] */ end + +.layer LAYER_62F8 +/* 0x62F8 [0xC2 0x02 ] */ transpose 2 +/* 0x62FA [0x46 0x00 0x55 ] */ notedv PITCH_EF1, 0, 85 +/* 0x62FD [0xFF ] */ end + +.channel CHAN_62FE +/* 0x62FE [0xCE 0x63 0x04 ] */ ldptr UNK_6304 +/* 0x6301 [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_6304: + .byte 0x04, 0x5F + +.channel CHAN_6306 +/* 0x6306 [0xCE 0x63 0x0C ] */ ldptr UNK_630C +/* 0x6309 [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_630C: + .byte 0x07, 0x52 + +.channel CHAN_630E +/* 0x630E [0xCE 0x63 0x14 ] */ ldptr UNK_6314 +/* 0x6311 [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_6314: + .byte 0x06, 0x5F + +.channel CHAN_6316 +/* 0x6316 [0xCE 0x63 0x1C ] */ ldptr UNK_631C +/* 0x6319 [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_631C: + .byte 0x18, 0x6E + +.channel CHAN_631E +/* 0x631E [0xCE 0x63 0x24 ] */ ldptr UNK_6324 +/* 0x6321 [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_6324: + .byte 0x3C, 0x64 + +.channel CHAN_6326 +/* 0x6326 [0xCE 0x63 0x2C ] */ ldptr UNK_632C +/* 0x6329 [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_632C: + .byte 0x3D, 0x6E + +.channel CHAN_632E +/* 0x632E [0xCE 0x63 0x34 ] */ ldptr UNK_6334 +/* 0x6331 [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_6334: + .byte 0x0D, 0x71 + +.channel CHAN_6336 +/* 0x6336 [0xCE 0x63 0x47 ] */ ldptr UNK_6347 +/* 0x6339 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x633C [0xCE 0x63 0x4B ] */ ldptr UNK_634B +/* 0x633F [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x6342 [0xCC 0x04 ] */ ldi 4 +/* 0x6344 [0xFB 0x60 0xF2 ] */ jump CHAN_60F2 + +UNK_6347: + .byte 0x1C, 0x1D, 0x1E, 0x1F + +UNK_634B: + .byte 0x6E, 0x6E, 0x6E, 0x6E + +.channel CHAN_634F +/* 0x634F [0xCE 0x63 0x72 ] */ ldptr UNK_6372 +/* 0x6352 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x6355 [0xCE 0x63 0x74 ] */ ldptr UNK_6374 +/* 0x6358 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x635B [0xB8 0x02 ] */ rand 2 +/* 0x635D [0xFB 0x61 0x34 ] */ jump CHAN_6134 + +.channel CHAN_6360 //! Unreachable code? +/* 0x6360 [0x56 ] */ subio IO_PORT_6 +/* 0x6361 [0xF3, 0x04 ] */ rbeqz CHAN_6367 +/* 0x6363 [0xB8, 0x02 ] */ rand 2 +/* 0x6365 [0xF4, 0x0A ] */ rjump CHAN_6371 +CHAN_6367: +/* 0x6367 [0xB8, 0x02 ] */ rand 2 +/* 0x6369 [0xC8, 0xFF ] */ sub 255 +/* 0x636B [0x76 ] */ stio IO_PORT_6 +/* 0x636C [0xC8, 0x02 ] */ sub 2 +/* 0x636E [0xF3, 0x01 ] */ rbeqz CHAN_6371 +/* 0x6370 [0x66 ] */ ldio IO_PORT_6 +CHAN_6371: +/* 0x6371 [0x76 ] */ stio IO_PORT_6 + +UNK_6372: + .byte 0x20, 0x21 + +UNK_6374: + .byte 0x6E, 0x6E + +.channel CHAN_6376 +/* 0x6376 [0x66 ] */ ldio IO_PORT_6 +/* 0x6377 [0xC8 0xFF ] */ sub 255 +/* 0x6379 [0x76 ] */ stio IO_PORT_6 +/* 0x637A [0xC9 0x01 ] */ and 1 +/* 0x637C [0xCB 0x63 0x96 ] */ ldseq UNK_6396 +/* 0x637F [0xC7 0x40 0x63 0x90 ] */ stseq (NOTEDV_OPCODE | PITCH_A0), LAYER_6390 + STSEQ_NOTEDV_OPCODE_PITCH +/* 0x6383 [0xB8 0x02 ] */ rand 2 +/* 0x6385 [0xCB 0x63 0x98 ] */ ldseq UNK_6398 +/* 0x6388 [0xC7 0x00 0x63 0x92 ] */ stseq 0, LAYER_6390 + STSEQ_NOTEDV_VELOCITY_2 +/* 0x638C [0x88 0x63 0x90 ] */ ldlayer 0, LAYER_6390 +/* 0x638F [0xFF ] */ end + +.layer LAYER_6390 +/* 0x6390 [0x40 0x00 0x64 ] */ notedv PITCH_A0, 0, 100 +/* 0x6393 [0xC0 0x30 ] */ ldelay 48 +/* 0x6395 [0xFF ] */ end + +UNK_6396: + .byte 0x22, 0x32 + +UNK_6398: + .byte 0x64, 0x64 + +.channel CHAN_639A +/* 0x639A [0xCE 0x63 0xAB ] */ ldptr UNK_63AB +/* 0x639D [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x63A0 [0xCE 0x63 0xAD ] */ ldptr UNK_63AD +/* 0x63A3 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x63A6 [0xB8 0x02 ] */ rand 2 +/* 0x63A8 [0xFB 0x61 0x34 ] */ jump CHAN_6134 + +UNK_63AB: + .byte 0x23, 0x24 + +UNK_63AD: + .byte 0x5A, 0x46 + +.channel CHAN_63AF +/* 0x63AF [0xCE 0x63 0xC0 ] */ ldptr UNK_63C0 +/* 0x63B2 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x63B5 [0xCE 0x63 0xC3 ] */ ldptr UNK_63C3 +/* 0x63B8 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x63BB [0xCC 0x03 ] */ ldi 3 +/* 0x63BD [0xFB 0x60 0xF2 ] */ jump CHAN_60F2 + +UNK_63C0: + .byte 0x25, 0x26, 0x27 + +UNK_63C3: + .byte 0x6E, 0x6E, 0x6E + +.channel CHAN_63C6 +/* 0x63C6 [0xCE 0x63 0xD7 ] */ ldptr UNK_63D7 +/* 0x63C9 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x63CC [0xCE 0x63 0xDA ] */ ldptr UNK_63DA +/* 0x63CF [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x63D2 [0xCC 0x03 ] */ ldi 3 +/* 0x63D4 [0xFB 0x60 0xF2 ] */ jump CHAN_60F2 + +UNK_63D7: + .byte 0x28, 0x29, 0x2A + +UNK_63DA: + .byte 0x6E, 0x6E, 0x6E + +.channel CHAN_63DD +/* 0x63DD [0xCE 0x63 0xEE ] */ ldptr UNK_63EE +/* 0x63E0 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x63E3 [0xCE 0x63 0xF0 ] */ ldptr UNK_63F0 +/* 0x63E6 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x63E9 [0xB8 0x02 ] */ rand 2 +/* 0x63EB [0xFB 0x61 0x34 ] */ jump CHAN_6134 + +UNK_63EE: + .byte 0x2D, 0x2E + +UNK_63F0: + .byte 0x64, 0x64 + +.channel CHAN_63F2 +/* 0x63F2 [0xCE 0x64 0x03 ] */ ldptr UNK_6403 +/* 0x63F5 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x63F8 [0xCE 0x64 0x05 ] */ ldptr UNK_6405 +/* 0x63FB [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x63FE [0xB8 0x02 ] */ rand 2 +/* 0x6400 [0xFB 0x61 0x34 ] */ jump CHAN_6134 + +UNK_6403: + .byte 0x2B, 0x2C + +UNK_6405: + .byte 0x64, 0x64 + +.channel CHAN_6407 +/* 0x6407 [0xCE 0x64 0x18 ] */ ldptr UNK_6418 +/* 0x640A [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x640D [0xCE 0x64 0x1A ] */ ldptr UNK_641A +/* 0x6410 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x6413 [0xB8 0x02 ] */ rand 2 +/* 0x6415 [0xFB 0x61 0x34 ] */ jump CHAN_6134 + +UNK_6418: + .byte 0x2F, 0x30 + +UNK_641A: + .byte 0x55, 0x55 + +.channel CHAN_641C +/* 0x641C [0x88 0x64 0x20 ] */ ldlayer 0, LAYER_6420 +/* 0x641F [0xFF ] */ end + +.layer LAYER_6420 +/* 0x6420 [0x74 0x00 0x60 ] */ notedv PITCH_DF5, 0, 96 +/* 0x6423 [0xFF ] */ end + +.channel CHAN_6424 +/* 0x6424 [0x88 0x64 0x28 ] */ ldlayer 0, LAYER_6428 +/* 0x6427 [0xFF ] */ end + +.layer LAYER_6428 +/* 0x6428 [0xC2 0x01 ] */ transpose 1 +/* 0x642A [0x40 0x62 0x64 ] */ notedv PITCH_A0, FRAMERATE_CONST(98, 118), 100 +/* 0x642D [0x41 0x6A 0x64 ] */ notedv PITCH_BF0, FRAMERATE_CONST(106, 127), 100 +/* 0x6430 [0x42 0x3A 0x64 ] */ notedv PITCH_B0, 58, 100 +/* 0x6433 [0xFF ] */ end + +.channel CHAN_6434 +/* 0x6434 [0xCE 0x64 0x45 ] */ ldptr UNK_6445 +/* 0x6437 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x643A [0xCE 0x64 0x47 ] */ ldptr UNK_6447 +/* 0x643D [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x6440 [0xB8 0x02 ] */ rand 2 +/* 0x6442 [0xFB 0x61 0x34 ] */ jump CHAN_6134 + +UNK_6445: + .byte 0x2B, 0x2C + +UNK_6447: + .byte 0x64, 0x64 + +.channel CHAN_6449 +/* 0x6449 [0xCE 0x64 0x4F ] */ ldptr UNK_644F +/* 0x644C [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_644F: + .byte 0x14, 0x64 + +.channel CHAN_6451 +/* 0x6451 [0x88 0x64 0x55 ] */ ldlayer 0, LAYER_6455 +/* 0x6454 [0xFF ] */ end + +.layer LAYER_6455 +/* 0x6455 [0xC2 0x01 ] */ transpose 1 +/* 0x6457 [0x43 0x81 0x0B 0x32 ] */ notedv PITCH_C1, FRAMERATE_CONST(267, 320), 50 +/* 0x645B [0x43 0x80 0xC5 0x32 ] */ notedv PITCH_C1, FRAMERATE_CONST(197, 236), 50 +/* 0x645F [0x45 0x80 0x87 0x64 ] */ notedv PITCH_D1, FRAMERATE_CONST(135, 162), 100 +/* 0x6463 [0x46 0x21 0x64 ] */ notedv PITCH_EF1, 33, 100 +/* 0x6466 [0xFF ] */ end + +.channel CHAN_6467 +/* 0x6467 [0x88 0x64 0x6B ] */ ldlayer 0, LAYER_646B +/* 0x646A [0xFF ] */ end + +.layer LAYER_646B +/* 0x646B [0xC2 0x01 ] */ transpose 1 +/* 0x646D [0x47 0x80 0xD9 0x64 ] */ notedv PITCH_E1, FRAMERATE_CONST(217, 260), 100 +/* 0x6471 [0x48 0x62 0x64 ] */ notedv PITCH_F1, FRAMERATE_CONST(98, 118), 100 +/* 0x6474 [0x49 0x81 0x09 0x64 ] */ notedv PITCH_GF1, 265, 100 +/* 0x6478 [0xFF ] */ end + +.channel CHAN_6479 +/* 0x6479 [0x88 0x64 0x7D ] */ ldlayer 0, LAYER_647D +/* 0x647C [0xFF ] */ end + +.layer LAYER_647D +/* 0x647D [0x73 0x50 0x50 ] */ notedv PITCH_C5, FRAMERATE_CONST(80, 96), 80 +/* 0x6480 [0xF4 0xFB ] */ rjump LAYER_647D + +.channel CHAN_6482 +/* 0x6482 [0x88 0x64 0x86 ] */ ldlayer 0, LAYER_6486 +/* 0x6485 [0xFF ] */ end + +.layer LAYER_6486 +/* 0x6486 [0xC2 0x01 ] */ transpose 1 +/* 0x6488 [0x4A 0x41 0x64 ] */ notedv PITCH_G1, FRAMERATE_CONST(65, 78), 100 +/* 0x648B [0x4B 0x81 0x0A 0x64 ] */ notedv PITCH_AF1, FRAMERATE_CONST(266, 319), 100 +/* 0x648F [0x4C 0x53 0x64 ] */ notedv PITCH_A1, 83, 100 +/* 0x6492 [0xFF ] */ end + +.channel CHAN_6493 +/* 0x6493 [0xCE 0x64 0x99 ] */ ldptr UNK_6499 +/* 0x6496 [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_6499: + .byte 0x1C, 0x64 + +.channel CHAN_649B +/* 0x649B [0x88 0x64 0x9F ] */ ldlayer 0, LAYER_649F +/* 0x649E [0xFF ] */ end + +.layer LAYER_649F +/* 0x649F [0xC2 0x01 ] */ transpose 1 +/* 0x64A1 [0x43 0x00 0x32 ] */ notedv PITCH_C1, 0, 50 +/* 0x64A4 [0xFF ] */ end + +.channel CHAN_64A5 +/* 0x64A5 [0x66 ] */ ldio IO_PORT_6 +/* 0x64A6 [0xC8 0xFF ] */ sub 255 +/* 0x64A8 [0x76 ] */ stio IO_PORT_6 +/* 0x64A9 [0xC9 0x01 ] */ and 1 +/* 0x64AB [0xCB 0x64 0xC5 ] */ ldseq UNK_64C5 +/* 0x64AE [0xC7 0x40 0x64 0xBF ] */ stseq (NOTEDV_OPCODE | PITCH_A0), LAYER_64BF + STSEQ_NOTEDV_OPCODE_PITCH +/* 0x64B2 [0xB8 0x02 ] */ rand 2 +/* 0x64B4 [0xCB 0x64 0xC7 ] */ ldseq UNK_64C7 +/* 0x64B7 [0xC7 0x00 0x64 0xC1 ] */ stseq 0, LAYER_64BF + STSEQ_NOTEDV_VELOCITY_2 +/* 0x64BB [0x88 0x64 0xBF ] */ ldlayer 0, LAYER_64BF +/* 0x64BE [0xFF ] */ end + +.layer LAYER_64BF +/* 0x64BF [0x40 0x00 0x64 ] */ notedv PITCH_A0, 0, 100 +/* 0x64C2 [0xC0 0x30 ] */ ldelay 48 +/* 0x64C4 [0xFF ] */ end + +UNK_64C5: + .byte 0x35, 0x36 + +UNK_64C7: + .byte 0x50, 0x50 + +.channel CHAN_64C9 +/* 0x64C9 [0xCE 0x64 0xCF ] */ ldptr UNK_64CF +/* 0x64CC [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_64CF: + .byte 0x21, 0x6E + +.channel CHAN_64D1 +/* 0x64D1 [0x88 0x64 0xD5 ] */ ldlayer 0, LAYER_64D5 +/* 0x64D4 [0xFF ] */ end + +.layer LAYER_64D5 +/* 0x64D5 [0xC2 0x02 ] */ transpose 2 +/* 0x64D7 [0x47 0x00 0x55 ] */ notedv PITCH_E1, 0, 85 +/* 0x64DA [0xFF ] */ end + +.channel CHAN_64DB +/* 0x64DB [0xCE 0x64 0xE1 ] */ ldptr UNK_64E1 +/* 0x64DE [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_64E1: + .byte 0x20, 0x5F + +.channel CHAN_64E3 +/* 0x64E3 [0xCE 0x64 0xE9 ] */ ldptr UNK_64E9 +/* 0x64E6 [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_64E9: + .byte 0x23, 0x5A + +.channel CHAN_64EB +/* 0x64EB [0xCE 0x64 0xF1 ] */ ldptr UNK_64F1 +/* 0x64EE [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_64F1: + .byte 0x22, 0x64 + +.channel CHAN_64F3 +/* 0x64F3 [0xCE 0x64 0xF9 ] */ ldptr UNK_64F9 +/* 0x64F6 [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_64F9: + .byte 0x31, 0x73 + +.channel CHAN_64FB +/* 0x64FB [0xCE 0x65 0x01 ] */ ldptr UNK_6501 +/* 0x64FE [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_6501: + .byte 0x3E, 0x64 + +.channel CHAN_6503 +/* 0x6503 [0xCE 0x65 0x09 ] */ ldptr UNK_6509 +/* 0x6506 [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_6509: + .byte 0x3F, 0x6E + +.channel CHAN_650B +/* 0x650B [0xCE 0x65 0x11 ] */ ldptr UNK_6511 +/* 0x650E [0xFB 0x61 0x3E ] */ jump CHAN_613E + +UNK_6511: + .byte 0x2C, 0x64 + +.channel CHAN_6513 +/* 0x6513 [0xCC 0x20 ] */ ldi 32 +/* 0x6515 [0x71 ] */ stio IO_PORT_1 +/* 0x6516 [0x88 0x65 0x1A ] */ ldlayer 0, LAYER_651A +/* 0x6519 [0xFF ] */ end + +.layer LAYER_651A +/* 0x651A [0xC2 0x02 ] */ transpose 2 +/* 0x651C [0x44 0x00 0x64 ] */ notedv PITCH_DF1, 0, 100 +/* 0x651F [0xFF ] */ end + +.channel CHAN_6520 +/* 0x6520 [0x64 ] */ ldio IO_PORT_SFX_INDEX_LOBITS +/* 0x6521 [0xC8 0x50 ] */ sub 80 +/* 0x6523 [0xC7 0x19 0x65 0x36 ] */ stseq (NOTEDVG_OPCODE | PITCH_BF2), LAYER_6536 + STSEQ_NOTEDVG_OPCODE_PITCH +/* 0x6527 [0xCB 0x65 0x3B ] */ ldseq UNK_653B +/* 0x652A [0xC7 0x00 0x65 0x38 ] */ stseq 0, LAYER_6536 + STSEQ_NOTEDVG_DELAY_LO +/* 0x652E [0x88 0x65 0x34 ] */ ldlayer 0, LAYER_6534 +/* 0x6531 [0xDC 0x60 ] */ panweight 96 +/* 0x6533 [0xFF ] */ end + +.layer LAYER_6534 +/* 0x6534 [0xC2 0x01 ] */ transpose 1 +LAYER_6536: +/* 0x6536 [0x21 0x00 0x64 0x00 ] */ notedvg PITCH_GF3, 0, 100, 0 +/* 0x653A [0xFF ] */ end + +UNK_653B: + .byte 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x6E, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64 + .byte 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64 + .byte 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x6E + +.channel CHAN_6562 +/* 0x6562 [0x64 ] */ ldio IO_PORT_SFX_INDEX_LOBITS +/* 0x6563 [0xC8 0x77 ] */ sub 119 +/* 0x6565 [0xC7 0x00 0x65 0x76 ] */ stseq (NOTEDVG_OPCODE | PITCH_A0), LAYER_6576 + STSEQ_NOTEDVG_OPCODE_PITCH +/* 0x6569 [0xCB 0x65 0x7B ] */ ldseq UNK_657B +/* 0x656C [0xC7 0x00 0x65 0x78 ] */ stseq 0, LAYER_6576 + STSEQ_NOTEDVG_DELAY_LO +/* 0x6570 [0x88 0x65 0x74 ] */ ldlayer 0, LAYER_6574 +/* 0x6573 [0xFF ] */ end + +.layer LAYER_6574 +/* 0x6574 [0xC2 0x02 ] */ transpose 2 +LAYER_6576: +/* 0x6576 [0x00 0x00 0x64 0x00 ] */ notedvg PITCH_A0, 0, 100, 0 +/* 0x657A [0xFF ] */ end + +UNK_657B: + .byte 0x64, 0x64, 0x64, 0x64, 0x64, 0x64 + +.channel CHAN_6581 +/* 0x6581 [0xCC 0x20 ] */ ldi 32 +/* 0x6583 [0x71 ] */ stio IO_PORT_1 +/* 0x6584 [0x89 0x65 0x98 ] */ ldlayer 1, LAYER_6598 +/* 0x6587 [0xCE 0x65 0xA7 ] */ ldptr UNK_65A7 +/* 0x658A [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ +/* 0x658D [0xCE 0x65 0xAA ] */ ldptr UNK_65AA +/* 0x6590 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ +/* 0x6593 [0xCC 0x03 ] */ ldi 3 +/* 0x6595 [0xFB 0x60 0xF2 ] */ jump CHAN_60F2 + +.layer LAYER_6598 +/* 0x6598 [0xC6 0x45 ] */ instr SF0_INST_69 +/* 0x659A [0xCB 0x66 0xB8 0xFB ] */ env ENVELOPE_66B8, 251 +/* 0x659E [0xC4 ] */ legato +/* 0x659F [0xC7 0x81 0x33 0xFF ] */ portamento 0x81, PITCH_C5, 255 +/* 0x65A3 [0x78 0x30 0x41 ] */ notedv PITCH_F5, 48, 65 +/* 0x65A6 [0xFF ] */ end + +UNK_65A7: + .byte 0x39, 0x3A, 0x3B + +UNK_65AA: + .byte 0x64, 0x5F, 0x69 + +.balign 16 + +.filter FILTER_65B0 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.filter FILTER_65C0 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.envelope ENVELOPE_65D0 + point 1, 32700 + hang + +.envelope ENVELOPE_65D8 + point 1, 32700 + point 100, 30000 + point 200, 5000 + hang + +.envelope ENVELOPE_65E8 + point 1, 32700 + point 25, 25000 + point 100, 25000 + point 200, 5000 + hang + +.envelope ENVELOPE_65FC + point 1, 32700 + point 100, 30000 + point 250, 30000 + point 200, 5000 + hang + +.envelope ENVELOPE_6610 + point 1, 32700 + point 50, 30000 + point 100, 10000 + point 100, 0 + hang + +.envelope ENVELOPE_6624 + point 1, 32700 + point 30, 30000 + point 50, 10000 + point 50, 0 + hang + +.envelope ENVELOPE_6638 + point 1, 32700 + point 70, 30000 + point 120, 10000 + point 120, 0 + hang + +.envelope ENVELOPE_664C + point 1, 32700 + point 15, 32700 + point 15, 22000 + point 100, 15000 + hang + +.envelope ENVELOPE_6660 + point 1, 32700 + point 8, 32700 + point 8, 22000 + point 100, 15000 + hang + +.envelope ENVELOPE_6674 + point 10, 32700 + hang + +.envelope ENVELOPE_667C + point 30, 10000 + point 30, 32700 + hang + +.envelope ENVELOPE_6688 + point 20, 15000 + point 10, 32700 + hang + +.envelope ENVELOPE_6694 + point 48, 10000 + point 32, 32700 + hang + +.envelope ENVELOPE_66A0 + point 47, 15000 + point 13, 32700 + point 72, 10000 + hang + +.envelope ENVELOPE_66B0 + point 6, 32700 + hang + +.envelope ENVELOPE_66B8 + point 20, 32700 + point 50, 10000 + point 40, 0 + hang + +.envelope ENVELOPE_66C8 + point 18, 32700 + hang + +.envelope ENVELOPE_66D0 + point 10, 32700 + point 240, 31000 + point 150, 2000 + hang + +.envelope ENVELOPE_66E0 + point 14, 15000 + point 13, 32700 + hang + +.envelope ENVELOPE_66EC + point 40, 32700 + hang + +.envelope ENVELOPE_66F4 + point 400, 32700 + hang + +.envelope ENVELOPE_66FC + point 100, 32700 + hang + +.envelope ENVELOPE_6704 + point 225, 32700 + point 30, 30000 + hang + +.envelope ENVELOPE_6710 + point 200, 32700 + hang + +.envelope ENVELOPE_6718 + point 3, 32700 + hang + +.envelope ENVELOPE_6720 + point 12, 32700 + point 40, 5000 + hang + +ENVELOPE_672C: + point 10, 32700 + point 4, 20000 + point 4, 10000 + point 50, 2000 + hang + +.envelope ENVELOPE_6740 + point 40, 32700 + point 150, 32700 + point 300, 0 + hang + +.envelope ENVELOPE_6750 + point 40, 32700 + point 800, 32700 + point 100, 16000 + point 100, 32700 + point 100, 16000 + point 100, 32700 + point 100, 16000 + point 100, 32700 + point 600, 0 + hang + +.envelope ENVELOPE_6778 + point 200, 32700 + point 100, 16000 + point 100, 32700 + point 100, 16000 + point 100, 32700 + point 600, 0 + hang + +.envelope ENVELOPE_6794 + point 35, 32700 + point 40, 32700 + point 105, 0 + hang + +.envelope ENVELOPE_67A4 + point 1, 25000 + point 12, 32700 + point 40, 32700 + point 60, 15000 + point 80, 5000 + hang + +.envelope ENVELOPE_67BC + point 10, 32700 + point 50, 32700 + point 60, 5000 + hang + +.envelope ENVELOPE_67CC + point 200, 32700 + point 340, 0 + hang + +.envelope ENVELOPE_67D8 + point 400, 32700 + point 400, 20000 + goto 0 + +.envelope ENVELOPE_67E4 + point 1400, 32700 + point 400, 14000 + point 400, 32700 + goto 1 + +.envelope ENVELOPE_67F4 + point 25, 32700 + point 490, 12000 + hang + +.envelope ENVELOPE_6800 + point 100, 32700 + point 450, 32700 +.envelope ENVELOPE_6808 + point 150, 32700 + point 1200, 32700 + point 400, 20000 + hang + +.envelope ENVELOPE_6818 + point 200, 32700 + point 200, 20000 + goto 0 + +.envelope ENVELOPE_6824 + point 2, 25000 + hang + +.envelope ENVELOPE_682C + point 1, 32700 + point 100, 30000 + point 200, 5000 + hang + +.envelope ENVELOPE_683C + point 1, 32700 + point 100, 30000 + point 100, 0 + hang + +.envelope ENVELOPE_684C + point 50, 32700 + point 160, 30000 + point 100, 0 + hang + +ENVELOPE_685C: + point 50, 32700 + point 100, 30000 + point 200, 20000 + hang + +.envelope ENVELOPE_686C + point 20, 32700 + point 100, 30000 + point 200, 20000 + hang + +.envelope ENVELOPE_687C + point 1, 32700 + point 100, 30000 + point 200, 20000 + hang + +.envelope ENVELOPE_688C + point 10, 32700 + point 250, 32700 + point 100, 20000 + hang + +ENVELOPE_689C: + point 15, 32700 + point 55, 20000 + point 15, 5000 + hang + +.envelope ENVELOPE_68AC + point 150, 32700 + hang + +.envelope ENVELOPE_68B4 + point 120, 32700 + hang + +.envelope ENVELOPE_68BC + point 60, 32700 + point 250, 32700 + point 100, 20000 + hang + +.envelope ENVELOPE_68CC + point 25, 32700 + point 100, 32700 + point 20, 2000 + hang + +.envelope ENVELOPE_68DC + point 1, 32700 + point 50, 32700 + point 25, 16000 + hang + +.envelope ENVELOPE_68EC + point 1, 32700 + point 80, 32700 + point 25, 16000 + hang + +.envelope ENVELOPE_68FC + point 1, 32700 + point 20, 32700 + point 7, 16000 + hang + +.envelope ENVELOPE_690C + point 1, 32700 + point 19, 32700 + point 5, 2000 + hang + +ENVELOPE_691C: + point 1, 32700 + point 50, 32700 + point 25, 10000 + hang + +.envelope ENVELOPE_692C + point 1, 32700 + point 50, 32700 + point 20, 1000 + hang + +ENVELOPE_693C: + point 1, 32700 + point 40, 32700 + point 10, 1000 + hang + +.envelope ENVELOPE_694C + point 1, 32700 + point 70, 32700 + point 10, 5000 + hang + +.envelope ENVELOPE_695C + point 1, 32700 + point 19, 32700 + point 5, 3000 + hang + +.envelope ENVELOPE_696C + point 1, 32700 + point 65, 32700 + point 20, 1000 + hang + +.envelope ENVELOPE_697C + point 1, 32700 + point 15, 32700 + point 2, 1000 + hang + +.envelope ENVELOPE_698C + point 1, 32700 + point 250, 32700 + point 60, 16000 + hang + +.envelope ENVELOPE_699C + point 1, 32700 + point 200, 32700 + point 50, 16000 + hang + +.envelope ENVELOPE_69AC + point 1, 32700 + point 260, 32700 + point 60, 16000 + hang + +.envelope ENVELOPE_69BC + point 1, 32700 + point 300, 32700 + point 60, 16000 + hang + +.envelope ENVELOPE_69CC + point 1, 32700 + point 350, 32700 + point 150, 16000 + hang + +.envelope ENVELOPE_69DC + point 1, 32700 + point 150, 32700 + point 100, 16000 + hang + +ENVELOPE_69EC: + point 1, 32700 + point 100, 32700 + point 40, 3000 + hang + +.envelope ENVELOPE_69FC + point 1, 32700 + point 210, 32700 + point 60, 16000 + hang + +.envelope ENVELOPE_6A0C + point 1, 32700 + point 100, 32700 + point 100, 10000 + hang + +.envelope ENVELOPE_6A1C + point 1, 32700 + point 250, 32700 + point 30, 16000 + hang + +.envelope ENVELOPE_6A2C + point 1, 32700 + point 650, 32700 + point 150, 16000 + hang + +.envelope ENVELOPE_6A3C + point 1, 32700 + point 500, 32700 + point 150, 16000 + hang + +.envelope ENVELOPE_6A4C + point 1, 32700 + point 500, 32700 + point 200, 26000 + hang + +.envelope ENVELOPE_6A5C + point 1, 32700 + point 800, 32700 + point 200, 16000 + hang + +ENVELOPE_6A6C: + point 1, 32700 + point 900, 32700 + point 200, 30000 + hang + +.envelope ENVELOPE_6A7C + point 1, 32700 + hang + +SEQ_0_END: + +.endseq Sequence_0 diff --git a/assets/audio/sequences/seq_1.prg.seq b/assets/audio/sequences/seq_1.prg.seq new file mode 100644 index 0000000000..0babce8065 --- /dev/null +++ b/assets/audio/sequences/seq_1.prg.seq @@ -0,0 +1,1961 @@ +#include "aseq.h" +#include "Soundfont_2.h" + +.startseq Sequence_1 + +.sequence SEQ_0000 +/* 0x0000 [0xD3 0x20 ] */ mutebhv 0x20 +/* 0x0002 [0xD5 0x46 ] */ mutescale 70 +/* 0x0004 [0xDB 0x73 ] */ vol 115 +/* 0x0006 [0xDD 0x78 ] */ tempo 120 +/* 0x0008 [0x80 ] */ ldio IO_PORT_0 +/* 0x0009 [0xF5 0x00 0x0D ] */ bgez SEQ_000D +/* 0x000C [0xFF ] */ end + +SEQ_000D: +/* 0x000D [0x84 ] */ ldio IO_PORT_4 +/* 0x000E [0xC7 0x20 0x00 0x18 ] */ stseq 0b00100000, SEQ_0017 + STSEQ_INITCHAN_HI +/* 0x0012 [0x85 ] */ ldio IO_PORT_5 +/* 0x0013 [0xC7 0x00 0x00 0x19 ] */ stseq 0b00000000, SEQ_0017 + STSEQ_INITCHAN_LO +SEQ_0017: +/* 0x0017 [0xD7 0xD0 0x00 ] */ initchan 0b1101000000000000 +/* 0x001A [0x9D 0x0E 0xDB ] */ ldchan 13, CHAN_0EDB +/* 0x001D [0x85 ] */ ldio IO_PORT_5 +/* 0x001E [0xC9 0x01 ] */ and 1 +/* 0x0020 [0xF3 0x03 ] */ rbeqz SEQ_0025 +/* 0x0022 [0x90 0x02 0xAA ] */ ldchan 0, CHAN_02AA +SEQ_0025: +/* 0x0025 [0x85 ] */ ldio IO_PORT_5 +/* 0x0026 [0xC9 0x02 ] */ and 2 +/* 0x0028 [0xF3 0x03 ] */ rbeqz SEQ_002D +/* 0x002A [0x91 0x00 0x91 ] */ ldchan 1, CHAN_0091 +SEQ_002D: +/* 0x002D [0x85 ] */ ldio IO_PORT_5 +/* 0x002E [0xC9 0x04 ] */ and 4 +/* 0x0030 [0xF3 0x03 ] */ rbeqz SEQ_0035 +/* 0x0032 [0x92 0x00 0x91 ] */ ldchan 2, CHAN_0091 +SEQ_0035: +/* 0x0035 [0x85 ] */ ldio IO_PORT_5 +/* 0x0036 [0xC9 0x08 ] */ and 8 +/* 0x0038 [0xF3 0x03 ] */ rbeqz SEQ_003D +/* 0x003A [0x93 0x00 0x91 ] */ ldchan 3, CHAN_0091 +SEQ_003D: +/* 0x003D [0x85 ] */ ldio IO_PORT_5 +/* 0x003E [0xC9 0x10 ] */ and 16 +/* 0x0040 [0xF3 0x03 ] */ rbeqz SEQ_0045 +/* 0x0042 [0x94 0x00 0x91 ] */ ldchan 4, CHAN_0091 +SEQ_0045: +/* 0x0045 [0x85 ] */ ldio IO_PORT_5 +/* 0x0046 [0xC9 0x20 ] */ and 32 +/* 0x0048 [0xF3 0x03 ] */ rbeqz SEQ_004D +/* 0x004A [0x95 0x00 0x91 ] */ ldchan 5, CHAN_0091 +SEQ_004D: +/* 0x004D [0x85 ] */ ldio IO_PORT_5 +/* 0x004E [0xC9 0x40 ] */ and 64 +/* 0x0050 [0xF3 0x03 ] */ rbeqz SEQ_0055 +/* 0x0052 [0x96 0x00 0x91 ] */ ldchan 6, CHAN_0091 +SEQ_0055: +/* 0x0055 [0x85 ] */ ldio IO_PORT_5 +/* 0x0056 [0xC9 0x80 ] */ and 128 +/* 0x0058 [0xF3 0x03 ] */ rbeqz SEQ_005D +/* 0x005A [0x97 0x00 0x91 ] */ ldchan 7, CHAN_0091 +SEQ_005D: +/* 0x005D [0x84 ] */ ldio IO_PORT_4 +/* 0x005E [0xC9 0x01 ] */ and 1 +/* 0x0060 [0xF3 0x03 ] */ rbeqz SEQ_0065 +/* 0x0062 [0x98 0x00 0x91 ] */ ldchan 8, CHAN_0091 +SEQ_0065: +/* 0x0065 [0x84 ] */ ldio IO_PORT_4 +/* 0x0066 [0xC9 0x02 ] */ and 2 +/* 0x0068 [0xF3 0x00 ] */ rbeqz SEQ_006A +SEQ_006A: +/* 0x006A [0x84 ] */ ldio IO_PORT_4 +/* 0x006B [0xC9 0x04 ] */ and 4 +/* 0x006D [0xF3 0x00 ] */ rbeqz SEQ_006F +SEQ_006F: +/* 0x006F [0x84 ] */ ldio IO_PORT_4 +/* 0x0070 [0xC9 0x08 ] */ and 8 +/* 0x0072 [0xF3 0x00 ] */ rbeqz SEQ_0074 +SEQ_0074: +/* 0x0074 [0x84 ] */ ldio IO_PORT_4 +/* 0x0075 [0xC9 0x10 ] */ and 16 +/* 0x0077 [0xF3 0x03 ] */ rbeqz SEQ_007C +/* 0x0079 [0x9C 0x02 0xAA ] */ ldchan 12, CHAN_02AA +SEQ_007C: +/* 0x007C [0x84 ] */ ldio IO_PORT_4 +/* 0x007D [0xC9 0x40 ] */ and 64 +/* 0x007F [0xF3 0x03 ] */ rbeqz SEQ_0084 +/* 0x0081 [0x9E 0x0D 0xA3 ] */ ldchan 14, CHAN_0DA3 +SEQ_0084: +/* 0x0084 [0x84 ] */ ldio IO_PORT_4 +/* 0x0085 [0xC9 0x80 ] */ and 128 +/* 0x0087 [0xF3 0x03 ] */ rbeqz SEQ_008C +/* 0x0089 [0x9F 0x0E 0x0B ] */ ldchan 15, CHAN_0E0B +SEQ_008C: +/* 0x008C [0xFD 0xFF 0xD0 ] */ delay 32720 +/* 0x008F [0xF4 0xFB ] */ rjump SEQ_008C + +.channel CHAN_0091 +/* 0x0091 [0xC4 ] */ noshort +/* 0x0092 [0xE5 0x01 ] */ reverbidx 1 +/* 0x0094 [0xB0 0x10 0x30 ] */ ldfilter FILTER_1030 +/* 0x0097 [0xB3 0x00 ] */ filter 0, 0 +CHAN_0099: +/* 0x0099 [0xFE ] */ delay1 +/* 0x009A [0xDC 0x00 ] */ panweight 0 +/* 0x009C [0x61 ] */ ldio IO_PORT_1 +/* 0x009D [0xC8 0x01 ] */ sub 1 +/* 0x009F [0xF3 0x02 ] */ rbeqz CHAN_00A3 +/* 0x00A1 [0xF4 0xF6 ] */ rjump CHAN_0099 + +CHAN_00A3: +/* 0x00A3 [0x62 ] */ ldio IO_PORT_2 +/* 0x00A4 [0xC8 0x12 ] */ sub 18 +/* 0x00A6 [0xF2 0x03 ] */ rbltz CHAN_00AB +/* 0x00A8 [0xCC 0x11 ] */ ldi 17 +/* 0x00AA [0x72 ] */ stio IO_PORT_2 +CHAN_00AB: +/* 0x00AB [0x62 ] */ ldio IO_PORT_2 +/* 0x00AC [0xCB 0x01 0x6B ] */ ldseq UNK_016B +/* 0x00AF [0xC7 0x00 0x00 0xD8 ] */ stseq 0, CHAN_00D7 + STSEQ_INSTR +/* 0x00B3 [0x62 ] */ ldio IO_PORT_2 +/* 0x00B4 [0xCB 0x01 0x7F ] */ ldseq UNK_017F +/* 0x00B7 [0xC7 0x00 0x00 0xDA ] */ stseq 0, CHAN_00D9 + STSEQ_VOL +/* 0x00BB [0x62 ] */ ldio IO_PORT_2 +/* 0x00BC [0xB2 0x01 0x92 ] */ ldseqtoptr TABLE_0192 +/* 0x00BF [0xCF 0x00 0xDF ] */ stptrtoseq CHAN_00DE + STSEQ_PTR_LDLAYER +/* 0x00C2 [0x62 ] */ ldio IO_PORT_2 +/* 0x00C3 [0xB2 0x01 0xBA ] */ ldseqtoptr TABLE_01BA +/* 0x00C6 [0xCF 0x00 0xE6 ] */ stptrtoseq CHAN_00E5 + STSEQ_PTR_LDLAYER +/* 0x00C9 [0x62 ] */ ldio IO_PORT_2 +/* 0x00CA [0xB2 0x01 0xE2 ] */ ldseqtoptr TABLE_01E2 +/* 0x00CD [0xCF 0x00 0xED ] */ stptrtoseq CHAN_00EC + STSEQ_PTR_LDLAYER +/* 0x00D0 [0x62 ] */ ldio IO_PORT_2 +/* 0x00D1 [0xB2 0x02 0x0A ] */ ldseqtoptr TABLE_020A +/* 0x00D4 [0xCF 0x00 0xF4 ] */ stptrtoseq CHAN_00F3 + STSEQ_PTR_LDLAYER +CHAN_00D7: +/* 0x00D7 [0xC1 0x01 ] */ instr SF2_INST_1 +CHAN_00D9: +/* 0x00D9 [0xDF 0x3C ] */ vol 60 +/* 0x00DB [0x64 ] */ ldio IO_PORT_4 +/* 0x00DC [0xC9 0x03 ] */ and 3 +CHAN_00DE: +/* 0x00DE [0x88 0x03 0x93 ] */ ldlayer 0, LAYER_0393 +/* 0x00E1 [0xF3 0x16 ] */ rbeqz CHAN_00F9 +/* 0x00E3 [0xC8 0x01 ] */ sub 1 +CHAN_00E5: +/* 0x00E5 [0x89 0x03 0xCE ] */ ldlayer 1, LAYER_03CE +/* 0x00E8 [0xF3 0x0F ] */ rbeqz CHAN_00F9 +/* 0x00EA [0xC8 0x01 ] */ sub 1 +CHAN_00EC: +/* 0x00EC [0x8A 0x03 0x8C ] */ ldlayer 2, LAYER_038C +/* 0x00EF [0xF3 0x08 ] */ rbeqz CHAN_00F9 +/* 0x00F1 [0xC8 0x01 ] */ sub 1 +CHAN_00F3: +/* 0x00F3 [0x8B 0x03 0xC4 ] */ ldlayer 3, LAYER_03C4 +/* 0x00F6 [0xCC 0x01 ] */ ldi 1 +/* 0x00F8 [0x77 ] */ stio IO_PORT_7 +CHAN_00F9: +/* 0x00F9 [0xFE ] */ delay1 +/* 0x00FA [0x65 ] */ ldio IO_PORT_5 +/* 0x00FB [0xC9 0x3F ] */ and 63 +/* 0x00FD [0x75 ] */ stio IO_PORT_5 +/* 0x00FE [0xCB 0x0F 0x7A ] */ ldseq UNK_0F7A +/* 0x0101 [0xC7 0x0A 0x01 0x0F ] */ stseq 10, CHAN_010E + STSEQ_REVERB +/* 0x0105 [0xCC 0x7F ] */ ldi 127 +/* 0x0107 [0x55 ] */ subio IO_PORT_5 +/* 0x0108 [0xC7 0x00 0x01 0x0D ] */ stseq 0, STSEQ_HERE + STSEQ_VOLEXP +/* 0x010C [0xE0 0x7F ] */ volexp 127 +CHAN_010E: +/* 0x010E [0xD4 0x00 ] */ reverb 0 +/* 0x0110 [0x61 ] */ ldio IO_PORT_1 +/* 0x0111 [0xC8 0x00 ] */ sub 0 +/* 0x0113 [0xF3 0x4F ] */ rbeqz CHAN_0164 +/* 0x0115 [0x67 ] */ ldio IO_PORT_7 +/* 0x0116 [0xC8 0x01 ] */ sub 1 +/* 0x0118 [0x77 ] */ stio IO_PORT_7 +/* 0x0119 [0xF3 0x02 ] */ rbeqz CHAN_011D +/* 0x011B [0xF4 0xDC ] */ rjump CHAN_00F9 + +CHAN_011D: +/* 0x011D [0x62 ] */ ldio IO_PORT_2 +/* 0x011E [0xB2 0x02 0x32 ] */ ldseqtoptr TABLE_0232 +/* 0x0121 [0xCF 0x01 0x36 ] */ stptrtoseq CHAN_0134 + STSEQ_PTR_STSEQ +/* 0x0124 [0x62 ] */ ldio IO_PORT_2 +/* 0x0125 [0xB2 0x02 0x5A ] */ ldseqtoptr TABLE_025A +/* 0x0128 [0xCF 0x01 0x48 ] */ stptrtoseq CHAN_0146 + STSEQ_PTR_STSEQ +/* 0x012B [0x62 ] */ ldio IO_PORT_2 +/* 0x012C [0xB2 0x02 0x82 ] */ ldseqtoptr TABLE_0282 +/* 0x012F [0xCF 0x01 0x5D ] */ stptrtoseq CHAN_015B + STSEQ_PTR_STSEQ +/* 0x0132 [0xB8 0x5A ] */ rand 90 +CHAN_0134: +/* 0x0134 [0xC7 0x25 0x0E 0xFD ] */ stseq 37, LAYER_0EFC + STSEQ_LDELAY +/* 0x0138 [0x63 ] */ ldio IO_PORT_3 +/* 0x0139 [0xC9 0x7F ] */ and 127 +/* 0x013B [0x73 ] */ stio IO_PORT_3 +/* 0x013C [0xCC 0x00 ] */ ldi 0 +/* 0x013E [0x53 ] */ subio IO_PORT_3 +/* 0x013F [0xC7 0x00 0x01 0x45 ] */ stseq 0, CHAN_0144 + STSEQ_BENDFINE +/* 0x0143 [0x63 ] */ ldio IO_PORT_3 +CHAN_0144: +/* 0x0144 [0xEE 0x00 ] */ bendfine 0 +CHAN_0146: +/* 0x0146 [0xC7 0x00 0x0E 0xFF ] */ stseq 0, LAYER_0EFE + STSEQ_LDELAY +/* 0x014A [0xCC 0x00 ] */ ldi 0 +/* 0x014C [0xCB 0x0E 0xFB ] */ ldseq UNK_0EFB +/* 0x014F [0xF3 0x0A ] */ rbeqz CHAN_015B +/* 0x0151 [0xB8 0x03 ] */ rand 3 +/* 0x0153 [0xF3 0x04 ] */ rbeqz CHAN_0159 +/* 0x0155 [0xCC 0x00 ] */ ldi 0 +/* 0x0157 [0xF4 0x02 ] */ rjump CHAN_015B + +CHAN_0159: +/* 0x0159 [0xCC 0x14 ] */ ldi 20 +CHAN_015B: +/* 0x015B [0xC7 0x00 0x0F 0x01 ] */ stseq 0, LAYER_0F00 + STSEQ_STEREO +/* 0x015F [0xCC 0x32 ] */ ldi 50 +/* 0x0161 [0x77 ] */ stio IO_PORT_7 +/* 0x0162 [0xF4 0x95 ] */ rjump CHAN_00F9 + +CHAN_0164: +/* 0x0164 [0x90 ] */ dellayer 0 +/* 0x0165 [0x91 ] */ dellayer 1 +/* 0x0166 [0x92 ] */ dellayer 2 +/* 0x0167 [0x93 ] */ dellayer 3 +/* 0x0168 [0xFB 0x00 0x99 ] */ jump CHAN_0099 + +UNK_016B: + .byte 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x05, 0x01, 0x01, 0x06, 0x0D, 0x08, 0x09, 0x0B, 0x0C, 0x07, 0x0E, 0x0A, 0x03, 0x01 + +UNK_017F: + .byte 0x4B, 0x55, 0x32, 0x3C, 0x50, 0x50, 0x50, 0x50, 0x50, 0x64, 0x50, 0x50, 0x50, 0x52, 0x50, 0x4B, 0x5A, 0x50, 0x00 + +.table TABLE_0192 + entry LAYER_0393 + entry LAYER_0404 + entry LAYER_048A + entry LAYER_04D1 + entry LAYER_054E + entry LAYER_05B2 + entry LAYER_0665 + entry LAYER_06CE + entry LAYER_0734 + entry LAYER_078B + entry LAYER_07E6 + entry LAYER_0B39 + entry LAYER_0C5E + entry LAYER_09C2 + entry LAYER_0A6C + entry LAYER_0D39 + entry LAYER_08A2 + entry LAYER_0AE6 + entry LAYER_048A + entry LAYER_04D1 + +.table TABLE_01BA + entry LAYER_03CE + entry LAYER_0449 + entry LAYER_0487 + entry LAYER_0516 + entry LAYER_0560 + entry LAYER_0612 + entry LAYER_0676 + entry LAYER_06E8 + entry LAYER_0731 + entry LAYER_0794 + entry LAYER_0849 + entry LAYER_0BC9 + entry LAYER_0CCD + entry LAYER_0A09 + entry LAYER_0A59 + entry LAYER_0D27 + entry LAYER_0932 + entry LAYER_0AFA + entry LAYER_0A59 + entry LAYER_0D27 + +.table TABLE_01E2 + entry LAYER_038C + entry LAYER_03FD + entry LAYER_0484 + entry LAYER_04C7 + entry LAYER_0572 + entry LAYER_05AC + entry LAYER_068B + entry LAYER_06FA + entry LAYER_074E + entry LAYER_07B2 + entry LAYER_07E0 + entry LAYER_0B26 + entry LAYER_0C4D + entry LAYER_09B8 + entry LAYER_0A62 + entry LAYER_0D2A + entry LAYER_0898 + entry LAYER_0AE5 + entry LAYER_0A62 + entry LAYER_0D2A + +.table TABLE_020A + entry LAYER_03C4 + entry LAYER_043F + entry LAYER_0481 + entry LAYER_050C + entry LAYER_058D + entry LAYER_0609 + entry LAYER_06B4 + entry LAYER_0716 + entry LAYER_0770 + entry LAYER_07C9 + entry LAYER_0843 + entry LAYER_0BB3 + entry LAYER_0CB9 + entry LAYER_09FC + entry LAYER_0A4C + entry LAYER_0D24 + entry LAYER_0924 + entry LAYER_0AE5 + entry LAYER_0A4C + entry LAYER_0D24 + +.table TABLE_0232 + entry LAYER_0EFC + 1 + entry LAYER_0F03 + 1 + entry LAYER_0F0A + 1 + entry LAYER_0F11 + 1 + entry LAYER_0F18 + 1 + entry LAYER_0F1F + 1 + entry LAYER_0F26 + 1 + entry LAYER_0F2D + 1 + entry LAYER_0F34 + 1 + entry LAYER_0F3B + 1 + entry LAYER_0F42 + 1 + entry LAYER_0F49 + 1 + entry LAYER_0F50 + 1 + entry LAYER_0F57 + 1 + entry LAYER_0F5E + 1 + entry LAYER_0F65 + 1 + entry LAYER_0F6C + 1 + entry LAYER_0F73 + 1 + entry LAYER_0F0A + 1 + entry LAYER_0F11 + 1 + +.table TABLE_025A + entry LAYER_0EFE + 1 + entry LAYER_0F05 + 1 + entry LAYER_0F0C + 1 + entry LAYER_0F13 + 1 + entry LAYER_0F1A + 1 + entry LAYER_0F21 + 1 + entry LAYER_0F28 + 1 + entry LAYER_0F2F + 1 + entry LAYER_0F36 + 1 + entry LAYER_0F3D + 1 + entry LAYER_0F44 + 1 + entry LAYER_0F4B + 1 + entry LAYER_0F52 + 1 + entry LAYER_0F59 + 1 + entry LAYER_0F60 + 1 + entry LAYER_0F67 + 1 + entry LAYER_0F6E + 1 + entry LAYER_0F75 + 1 + entry LAYER_0F60 + 1 + entry LAYER_0F67 + 1 + +.table TABLE_0282 + entry LAYER_0F00 + 1 + entry LAYER_0F07 + 1 + entry LAYER_0F0E + 1 + entry LAYER_0F15 + 1 + entry LAYER_0F1C + 1 + entry LAYER_0F23 + 1 + entry LAYER_0F2A + 1 + entry LAYER_0F31 + 1 + entry LAYER_0F38 + 1 + entry LAYER_0F3F + 1 + entry LAYER_0F46 + 1 + entry LAYER_0F4D + 1 + entry LAYER_0F54 + 1 + entry LAYER_0F5B + 1 + entry LAYER_0F62 + 1 + entry LAYER_0F69 + 1 + entry LAYER_0F70 + 1 + entry LAYER_0F77 + 1 + entry LAYER_0F62 + 1 + entry LAYER_0F69 + 1 + +.channel CHAN_02AA +/* 0x02AA [0xC4 ] */ noshort +/* 0x02AB [0xE5 0x01 ] */ reverbidx 1 +/* 0x02AD [0xDB 0x0C ] */ transpose 12 +/* 0x02AF [0xB0 0x10 0x30 ] */ ldfilter FILTER_1030 +/* 0x02B2 [0xB3 0x00 ] */ filter 0, 0 +CHAN_02B4: +/* 0x02B4 [0xFE ] */ delay1 +/* 0x02B5 [0x61 ] */ ldio IO_PORT_1 +/* 0x02B6 [0xC8 0x01 ] */ sub 1 +/* 0x02B8 [0xF3 0x02 ] */ rbeqz CHAN_02BC +/* 0x02BA [0xF4 0xF8 ] */ rjump CHAN_02B4 + +CHAN_02BC: +/* 0x02BC [0xE0 0x7F ] */ volexp 127 +/* 0x02BE [0xDC 0x00 ] */ panweight 0 +/* 0x02C0 [0x62 ] */ ldio IO_PORT_2 +/* 0x02C1 [0xC9 0x03 ] */ and 3 +/* 0x02C3 [0xCB 0x03 0x5A ] */ ldseq UNK_035A +/* 0x02C6 [0xC7 0x00 0x02 0xD7 ] */ stseq 0, CHAN_02D6 + STSEQ_INSTR +/* 0x02CA [0x62 ] */ ldio IO_PORT_2 +/* 0x02CB [0xC9 0x03 ] */ and 3 +/* 0x02CD [0xCB 0x03 0x5E ] */ ldseq UNK_035E +/* 0x02D0 [0xC7 0x00 0x02 0xD5 ] */ stseq 0, STSEQ_HERE + STSEQ_VOL +/* 0x02D4 [0xDF 0x3C ] */ vol 60 +CHAN_02D6: +/* 0x02D6 [0xC1 0x10 ] */ instr SF2_INST_16 +/* 0x02D8 [0xDA 0x0F 0xFA ] */ env ENVELOPE_0FFA +/* 0x02DB [0xD4 0x14 ] */ reverb 20 +/* 0x02DD [0x88 0x03 0x68 ] */ ldlayer 0, LAYER_0368 +/* 0x02E0 [0x89 0x03 0x62 ] */ ldlayer 1, LAYER_0362 +/* 0x02E3 [0xCC 0x01 ] */ ldi 1 +/* 0x02E5 [0x77 ] */ stio IO_PORT_7 +/* 0x02E6 [0xF4 0x0C ] */ rjump CHAN_02F4 + +CHAN_02E8: +/* 0x02E8 [0xFE ] */ delay1 +/* 0x02E9 [0x61 ] */ ldio IO_PORT_1 +/* 0x02EA [0xC8 0x00 ] */ sub 0 +/* 0x02EC [0xF3 0x47 ] */ rbeqz CHAN_0335 +/* 0x02EE [0x60 ] */ ldio IO_PORT_0 +/* 0x02EF [0xF2 0x03 ] */ rbltz CHAN_02F4 +/* 0x02F1 [0xFC 0x03 0x3E ] */ call CHAN_033E +CHAN_02F4: +/* 0x02F4 [0x66 ] */ ldio IO_PORT_6 +/* 0x02F5 [0xF2 0x09 ] */ rbltz CHAN_0300 +/* 0x02F7 [0xC7 0x00 0x02 0xFF ] */ stseq 0, CHAN_02FE + STSEQ_FILTER_IDX +/* 0x02FB [0xCC 0xFF ] */ ldi 255 +/* 0x02FD [0x76 ] */ stio IO_PORT_6 +CHAN_02FE: +/* 0x02FE [0xB3 0x0F ] */ filter 0, 15 +CHAN_0300: +/* 0x0300 [0x67 ] */ ldio IO_PORT_7 +/* 0x0301 [0xC8 0x01 ] */ sub 1 +/* 0x0303 [0x77 ] */ stio IO_PORT_7 +/* 0x0304 [0xF3 0x02 ] */ rbeqz CHAN_0308 +/* 0x0306 [0xF4 0xE0 ] */ rjump CHAN_02E8 + +CHAN_0308: +/* 0x0308 [0x63 ] */ ldio IO_PORT_3 +/* 0x0309 [0xC9 0x3F ] */ and 63 +/* 0x030B [0x73 ] */ stio IO_PORT_3 +/* 0x030C [0xCB 0x0F 0xBA ] */ ldseq UNK_0FBA +/* 0x030F [0xC8 0xFF ] */ sub 255 +/* 0x0311 [0xC7 0x05 0x03 0x1E ] */ stseq 5, CHAN_031D + STSEQ_RAND +/* 0x0315 [0x63 ] */ ldio IO_PORT_3 +/* 0x0316 [0xCB 0x0F 0x7A ] */ ldseq UNK_0F7A +/* 0x0319 [0xC7 0x60 0x10 0x00 ] */ stseq 96, ENVELOPE_0FFA + STSEQ_ENVELOPE_POINT(3) +CHAN_031D: +/* 0x031D [0xB8 0x18 ] */ rand 24 +/* 0x031F [0xC7 0x62 0x03 0x6F ] */ stseq (NOTEDV_OPCODE | PITCH_G3), LAYER_036F + STSEQ_NOTEDV_OPCODE_PITCH +/* 0x0323 [0xCC 0x40 ] */ ldi 64 +/* 0x0325 [0x53 ] */ subio IO_PORT_3 +/* 0x0326 [0xC7 0x00 0x03 0x2B ] */ stseq 0, STSEQ_HERE + STSEQ_RAND +/* 0x032A [0xB8 0x40 ] */ rand 64 +/* 0x032C [0xC7 0x3F 0x03 0x70 ] */ stseq 63, LAYER_036F + STSEQ_NOTEDV_DELAY_HI +/* 0x0330 [0xCC 0x64 ] */ ldi 100 +/* 0x0332 [0x77 ] */ stio IO_PORT_7 +/* 0x0333 [0xF4 0xB3 ] */ rjump CHAN_02E8 + +CHAN_0335: +/* 0x0335 [0xD9 0x70 ] */ releaserate 112 +/* 0x0337 [0x90 ] */ dellayer 0 +/* 0x0338 [0x91 ] */ dellayer 1 +/* 0x0339 [0x92 ] */ dellayer 2 +/* 0x033A [0x93 ] */ dellayer 3 +/* 0x033B [0xFB 0x02 0xB4 ] */ jump CHAN_02B4 + +.channel CHAN_033E +/* 0x033E [0x8A 0x03 0x7A ] */ ldlayer 2, LAYER_037A +/* 0x0341 [0x8B 0x03 0x74 ] */ ldlayer 3, LAYER_0374 +/* 0x0344 [0x63 ] */ ldio IO_PORT_3 +/* 0x0345 [0xC9 0x3F ] */ and 63 +/* 0x0347 [0x73 ] */ stio IO_PORT_3 +/* 0x0348 [0xCB 0x0F 0xBA ] */ ldseq UNK_0FBA +/* 0x034B [0xC8 0xFF ] */ sub 255 +/* 0x034D [0xC7 0x64 0x03 0x87 ] */ stseq 100, LAYER_0385 + STSEQ_NOTEDV_VELOCITY_2 +/* 0x0351 [0xC7 0x64 0x03 0x8A ] */ stseq 100, LAYER_0388 + STSEQ_NOTEDV_VELOCITY_2 +/* 0x0355 [0xC7 0x67 0x03 0x85 ] */ stseq (NOTEDV_OPCODE | PITCH_C4), LAYER_0385 + STSEQ_NOTEDV_OPCODE_PITCH +/* 0x0359 [0xFF ] */ end + +UNK_035A: + .byte 0x0F, 0x10, 0x11, 0x11 + +UNK_035E: + .byte 0x3C, 0x73, 0x64, 0x64 + +.layer LAYER_0362 +/* 0x0362 [0xCD 0x14 ] */ stereo 1, 0, 1, 0, 0 +/* 0x0364 [0xC2 0x09 ] */ transpose 9 +/* 0x0366 [0xF4 0x00 ] */ rjump LAYER_0368 + +.layer LAYER_0368 +/* 0x0368 [0xCF 0x64 ] */ releaserate 100 +/* 0x036A [0xC4 ] */ legato +/* 0x036B [0xC7 0x85 0x22 0xFF ] */ portamento 0x85, PITCH_G3, 255 +LAYER_036F: +/* 0x036F [0x5B 0x64 0x4B ] */ notedv PITCH_C3, 100, 75 +/* 0x0372 [0xF4 0xFB ] */ rjump LAYER_036F + +.layer LAYER_0374 +/* 0x0374 [0xC2 0x09 ] */ transpose 9 +/* 0x0376 [0xCA 0x4A ] */ notepan 74 +/* 0x0378 [0xF4 0x02 ] */ rjump LAYER_037C + +.layer LAYER_037A +/* 0x037A [0xCA 0x36 ] */ notepan 54 +LAYER_037C: +/* 0x037C [0xCB 0x10 0x06 0xFF ] */ env ENVELOPE_1006, 255 +/* 0x0380 [0xC4 ] */ legato +/* 0x0381 [0xC7 0x85 0x27 0xFF ] */ portamento 0x85, PITCH_C4, 255 +LAYER_0385: +/* 0x0385 [0x6E 0x0C 0x28 ] */ notedv PITCH_G4, 12, 40 +LAYER_0388: +/* 0x0388 [0x56 0x73 0x28 ] */ notedv PITCH_G2, 115, 40 +/* 0x038B [0xFF ] */ end + +.layer LAYER_038C +/* 0x038C [0xCA 0x5E ] */ notepan 94 +/* 0x038E [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x0391 [0xF4 0x02 ] */ rjump LAYER_0395 + +.layer LAYER_0393 +/* 0x0393 [0xCA 0x54 ] */ notepan 84 +LAYER_0395: +/* 0x0395 [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x0398 [0x6B 0x7E 0x64 ] */ notedv PITCH_E4, 126, 100 +/* 0x039B [0x69 0x81 0x5F 0x4E ] */ notedv PITCH_D4, 351, 78 +/* 0x039F [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x03A2 [0x69 0x80 0xE2 0x5F ] */ notedv PITCH_D4, 226, 95 +/* 0x03A6 [0x67 0x2D 0x56 ] */ notedv PITCH_C4, 45, 86 +/* 0x03A9 [0x6C 0x81 0x44 0x4B ] */ notedv PITCH_F4, 324, 75 +/* 0x03AD [0x69 0x80 0xC4 0x61 ] */ notedv PITCH_D4, 196, 97 +/* 0x03B1 [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x03B4 [0x69 0x80 0xD3 0x43 ] */ notedv PITCH_D4, 211, 67 +/* 0x03B8 [0x6B 0x3B 0x6A ] */ notedv PITCH_E4, 59, 106 +/* 0x03BB [0x67 0x81 0x0B 0x5E ] */ notedv PITCH_C4, 267, 94 +/* 0x03BF [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x03C2 [0xF4 0xD1 ] */ rjump LAYER_0395 + +.layer LAYER_03C4 +/* 0x03C4 [0xCA 0x22 ] */ notepan 34 +/* 0x03C6 [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x03C9 [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x03CC [0xF4 0xC7 ] */ rjump LAYER_0395 + +.layer LAYER_03CE +/* 0x03CE [0xCA 0x2C ] */ notepan 44 +LAYER_03D0: +/* 0x03D0 [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x03D3 [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x03D6 [0x67 0x09 0x40 ] */ notedv PITCH_C4, 9, 64 +/* 0x03D9 [0x67 0x80 0x96 0x4B ] */ notedv PITCH_C4, 150, 75 +/* 0x03DD [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x03E0 [0x67 0x5F 0x64 ] */ notedv PITCH_C4, 95, 100 +/* 0x03E3 [0x67 0x81 0x37 0x5A ] */ notedv PITCH_C4, 311, 90 +/* 0x03E7 [0x67 0x80 0xCE 0x4B ] */ notedv PITCH_C4, 206, 75 +/* 0x03EB [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x03EE [0x67 0x81 0x19 0x56 ] */ notedv PITCH_C4, 281, 86 +/* 0x03F2 [0x67 0x23 0x45 ] */ notedv PITCH_C4, 35, 69 +/* 0x03F5 [0x67 0x54 0x4D ] */ notedv PITCH_C4, 84, 77 +/* 0x03F8 [0x67 0x65 0x51 ] */ notedv PITCH_C4, 101, 81 +/* 0x03FB [0xF4 0xD3 ] */ rjump LAYER_03D0 + +.layer LAYER_03FD +/* 0x03FD [0xCA 0x54 ] */ notepan 84 +/* 0x03FF [0xFC 0x0F 0x03 ] */ call LAYER_0F03 +/* 0x0402 [0xF4 0x02 ] */ rjump LAYER_0406 + +.layer LAYER_0404 +/* 0x0404 [0xCA 0x5E ] */ notepan 94 +LAYER_0406: +/* 0x0406 [0xFC 0x0F 0x03 ] */ call LAYER_0F03 +/* 0x0409 [0x69 0x0C 0x51 ] */ notedv PITCH_D4, 12, 81 +/* 0x040C [0x6B 0x80 0xFE 0x63 ] */ notedv PITCH_E4, 254, 99 +/* 0x0410 [0x69 0x34 0x59 ] */ notedv PITCH_D4, 52, 89 +/* 0x0413 [0xFC 0x0F 0x03 ] */ call LAYER_0F03 +/* 0x0416 [0x67 0x80 0xF4 0x56 ] */ notedv PITCH_C4, 244, 86 +/* 0x041A [0x69 0x81 0x87 0x61 ] */ notedv PITCH_D4, 391, 97 +/* 0x041E [0xFC 0x0F 0x03 ] */ call LAYER_0F03 +/* 0x0421 [0x67 0x15 0x48 ] */ notedv PITCH_C4, 21, 72 +/* 0x0424 [0x69 0x80 0xD3 0x43 ] */ notedv PITCH_D4, 211, 67 +/* 0x0428 [0x6B 0x80 0x91 0x62 ] */ notedv PITCH_E4, 145, 98 +/* 0x042C [0xFC 0x0F 0x03 ] */ call LAYER_0F03 +/* 0x042F [0x6B 0x08 0x56 ] */ notedv PITCH_E4, 8, 86 +/* 0x0432 [0x69 0x81 0x3B 0x5E ] */ notedv PITCH_D4, 315, 94 +/* 0x0436 [0x67 0x0B 0x5E ] */ notedv PITCH_C4, 11, 94 +/* 0x0439 [0x67 0x81 0x0F 0x5E ] */ notedv PITCH_C4, 271, 94 +/* 0x043D [0xF4 0xC7 ] */ rjump LAYER_0406 + +.layer LAYER_043F +/* 0x043F [0xCA 0x2C ] */ notepan 44 +/* 0x0441 [0xFC 0x0F 0x03 ] */ call LAYER_0F03 +/* 0x0444 [0xFC 0x0F 0x03 ] */ call LAYER_0F03 +/* 0x0447 [0xF4 0x02 ] */ rjump LAYER_044B + +.layer LAYER_0449 +/* 0x0449 [0xCA 0x22 ] */ notepan 34 +LAYER_044B: +/* 0x044B [0xFC 0x0F 0x03 ] */ call LAYER_0F03 +/* 0x044E [0xFC 0x0F 0x03 ] */ call LAYER_0F03 +/* 0x0451 [0x67 0x80 0xD3 0x48 ] */ notedv PITCH_C4, 211, 72 +/* 0x0455 [0xFC 0x0F 0x03 ] */ call LAYER_0F03 +/* 0x0458 [0x67 0x0B 0x55 ] */ notedv PITCH_C4, 11, 85 +/* 0x045B [0x6B 0x81 0x26 0x64 ] */ notedv PITCH_E4, 294, 100 +/* 0x045F [0x69 0x80 0xA7 0x5A ] */ notedv PITCH_D4, 167, 90 +/* 0x0463 [0xFC 0x0F 0x03 ] */ call LAYER_0F03 +/* 0x0466 [0x69 0x80 0xA6 0x4B ] */ notedv PITCH_D4, 166, 75 +/* 0x046A [0x6C 0x18 0x56 ] */ notedv PITCH_F4, 24, 86 +/* 0x046D [0x67 0x81 0x63 0x54 ] */ notedv PITCH_C4, 355, 84 +/* 0x0471 [0xFC 0x0F 0x03 ] */ call LAYER_0F03 +/* 0x0474 [0x69 0x80 0xDB 0x5E ] */ notedv PITCH_D4, 219, 94 +/* 0x0478 [0x6B 0x09 0x43 ] */ notedv PITCH_E4, 9, 67 +/* 0x047B [0x67 0x80 0xE0 0x51 ] */ notedv PITCH_C4, 224, 81 +/* 0x047F [0xF4 0xCA ] */ rjump LAYER_044B + +.layer LAYER_0481 +/* 0x0481 [0xFC 0x0F 0x0A ] */ call LAYER_0F0A +.layer LAYER_0484 +/* 0x0484 [0xFC 0x0F 0x0A ] */ call LAYER_0F0A +.layer LAYER_0487 +/* 0x0487 [0xFC 0x0F 0x0A ] */ call LAYER_0F0A +.layer LAYER_048A +/* 0x048A [0xFC 0x0F 0x0A ] */ call LAYER_0F0A +/* 0x048D [0xCA 0x40 ] */ notepan 64 +/* 0x048F [0x27 0x82 0x00 0x5A 0x7F] */ notedvg PITCH_C4, 512, 90, 127 +/* 0x0494 [0xFC 0x0F 0x0A ] */ call LAYER_0F0A +/* 0x0497 [0xCA 0x5B ] */ notepan 91 +/* 0x0499 [0x29 0x7F 0x3D 0x7F ] */ notedvg PITCH_D4, 127, 61, 127 +/* 0x049D [0xC0 0x80 0x96 ] */ ldelay 150 +/* 0x04A0 [0xCA 0x4D ] */ notepan 77 +/* 0x04A2 [0x28 0x81 0xC8 0x64 0x7F] */ notedvg PITCH_DF4, 456, 100, 127 +/* 0x04A7 [0xFC 0x0F 0x0A ] */ call LAYER_0F0A +/* 0x04AA [0xCA 0x26 ] */ notepan 38 +/* 0x04AC [0x27 0x81 0x74 0x36 0x7F] */ notedvg PITCH_C4, 372, 54, 127 +/* 0x04B1 [0xC0 0x80 0xAE ] */ ldelay 174 +/* 0x04B4 [0xCA 0x57 ] */ notepan 87 +/* 0x04B6 [0x28 0x82 0x98 0x49 0x7F] */ notedvg PITCH_DF4, 664, 73, 127 +/* 0x04BB [0xFC 0x0F 0x0A ] */ call LAYER_0F0A +/* 0x04BE [0xCA 0x36 ] */ notepan 54 +/* 0x04C0 [0x27 0x81 0xB5 0x5F 0x7F] */ notedvg PITCH_C4, 437, 95, 127 +/* 0x04C5 [0xF4 0xC3 ] */ rjump LAYER_048A + +.layer LAYER_04C7 +/* 0x04C7 [0xCA 0x4A ] */ notepan 74 +/* 0x04C9 [0xFC 0x0F 0x11 ] */ call LAYER_0F11 +/* 0x04CC [0xFC 0x0F 0x11 ] */ call LAYER_0F11 +/* 0x04CF [0xF4 0x02 ] */ rjump LAYER_04D3 + +.layer LAYER_04D1 +/* 0x04D1 [0xCA 0x5E ] */ notepan 94 +LAYER_04D3: +/* 0x04D3 [0xFC 0x0F 0x11 ] */ call LAYER_0F11 +/* 0x04D6 [0xFC 0x0F 0x11 ] */ call LAYER_0F11 +/* 0x04D9 [0x6B 0x81 0x08 0x64 ] */ notedv PITCH_E4, 264, 100 +/* 0x04DD [0x69 0x0B 0x4E ] */ notedv PITCH_D4, 11, 78 +/* 0x04E0 [0x69 0x2D 0x5F ] */ notedv PITCH_D4, 45, 95 +/* 0x04E3 [0xFC 0x0F 0x11 ] */ call LAYER_0F11 +/* 0x04E6 [0x67 0x80 0xF6 0x56 ] */ notedv PITCH_C4, 246, 86 +/* 0x04EA [0x69 0x81 0x55 0x61 ] */ notedv PITCH_D4, 341, 97 +/* 0x04EE [0xFC 0x0F 0x11 ] */ call LAYER_0F11 +/* 0x04F1 [0x69 0x80 0xD3 0x43 ] */ notedv PITCH_D4, 211, 67 +/* 0x04F5 [0x67 0x15 0x5E ] */ notedv PITCH_C4, 21, 94 +/* 0x04F8 [0x6B 0x80 0x91 0x6A ] */ notedv PITCH_E4, 145, 106 +/* 0x04FC [0xFC 0x0F 0x11 ] */ call LAYER_0F11 +/* 0x04FF [0x69 0x81 0x3B 0x5E ] */ notedv PITCH_D4, 315, 94 +/* 0x0503 [0x6B 0x08 0x6A ] */ notedv PITCH_E4, 8, 106 +/* 0x0506 [0x67 0x81 0x0F 0x5E ] */ notedv PITCH_C4, 271, 94 +/* 0x050A [0xF4 0xC7 ] */ rjump LAYER_04D3 + +.layer LAYER_050C +/* 0x050C [0xCA 0x36 ] */ notepan 54 +/* 0x050E [0xFC 0x0F 0x11 ] */ call LAYER_0F11 +/* 0x0511 [0xFC 0x0F 0x11 ] */ call LAYER_0F11 +/* 0x0514 [0xF4 0x02 ] */ rjump LAYER_0518 + +.layer LAYER_0516 +/* 0x0516 [0xCA 0x22 ] */ notepan 34 +LAYER_0518: +/* 0x0518 [0xFC 0x0F 0x11 ] */ call LAYER_0F11 +/* 0x051B [0xFC 0x0F 0x11 ] */ call LAYER_0F11 +/* 0x051E [0x67 0x80 0xFA 0x40 ] */ notedv PITCH_C4, 250, 64 +/* 0x0522 [0xFC 0x0F 0x11 ] */ call LAYER_0F11 +/* 0x0525 [0x67 0x0E 0x4B ] */ notedv PITCH_C4, 14, 75 +/* 0x0528 [0x6B 0x81 0x0F 0x64 ] */ notedv PITCH_E4, 271, 100 +/* 0x052C [0x69 0x08 0x5A ] */ notedv PITCH_D4, 8, 90 +/* 0x052F [0xFC 0x0F 0x11 ] */ call LAYER_0F11 +/* 0x0532 [0x69 0x80 0x92 0x4B ] */ notedv PITCH_D4, 146, 75 +/* 0x0536 [0x6C 0x43 0x56 ] */ notedv PITCH_F4, 67, 86 +/* 0x0539 [0x67 0x81 0x55 0x45 ] */ notedv PITCH_C4, 341, 69 +/* 0x053D [0xFC 0x0F 0x11 ] */ call LAYER_0F11 +/* 0x0540 [0x69 0x80 0xF5 0x4D ] */ notedv PITCH_D4, 245, 77 +/* 0x0544 [0x6B 0x80 0xBD 0x4D ] */ notedv PITCH_E4, 189, 77 +/* 0x0548 [0x67 0x80 0xDA 0x51 ] */ notedv PITCH_C4, 218, 81 +/* 0x054C [0xF4 0xCA ] */ rjump LAYER_0518 + +.layer LAYER_054E +/* 0x054E [0xFC 0x0F 0x18 ] */ call LAYER_0F18 +/* 0x0551 [0xCA 0x54 ] */ notepan 84 +/* 0x0553 [0x6B 0x81 0x26 0x64 ] */ notedv PITCH_E4, 294, 100 +/* 0x0557 [0xCA 0x4A ] */ notepan 74 +/* 0x0559 [0x6B 0x09 0x4E ] */ notedv PITCH_E4, 9, 78 +/* 0x055C [0x67 0x81 0x6F 0x4A ] */ notedv PITCH_C4, 367, 74 +.layer LAYER_0560 +/* 0x0560 [0xFC 0x0F 0x18 ] */ call LAYER_0F18 +/* 0x0563 [0xFC 0x0F 0x18 ] */ call LAYER_0F18 +/* 0x0566 [0xCA 0x2F ] */ notepan 47 +/* 0x0568 [0x67 0x81 0xC2 0x64 ] */ notedv PITCH_C4, 450, 100 +/* 0x056C [0xCA 0x3A ] */ notepan 58 +/* 0x056E [0x69 0x80 0xF8 0x5B ] */ notedv PITCH_D4, 248, 91 +.layer LAYER_0572 +/* 0x0572 [0xFC 0x0F 0x18 ] */ call LAYER_0F18 +/* 0x0575 [0xC0 0x14 ] */ ldelay 20 +/* 0x0577 [0xFC 0x0F 0x18 ] */ call LAYER_0F18 +/* 0x057A [0xCA 0x5F ] */ notepan 95 +/* 0x057C [0x6C 0x4B 0x43 ] */ notedv PITCH_F4, 75, 67 +/* 0x057F [0xCA 0x57 ] */ notepan 87 +/* 0x0581 [0x69 0x09 0x37 ] */ notedv PITCH_D4, 9, 55 +/* 0x0584 [0x69 0x18 0x3C ] */ notedv PITCH_D4, 24, 60 +/* 0x0587 [0xCA 0x5B ] */ notepan 91 +/* 0x0589 [0x6B 0x81 0x26 0x64 ] */ notedv PITCH_E4, 294, 100 +.layer LAYER_058D +/* 0x058D [0xFC 0x0F 0x18 ] */ call LAYER_0F18 +/* 0x0590 [0xFC 0x0F 0x18 ] */ call LAYER_0F18 +/* 0x0593 [0xC0 0x30 ] */ ldelay 48 +/* 0x0595 [0xFC 0x0F 0x18 ] */ call LAYER_0F18 +/* 0x0598 [0xCA 0x48 ] */ notepan 72 +/* 0x059A [0x67 0x0A 0x5B ] */ notedv PITCH_C4, 10, 91 +/* 0x059D [0x68 0x80 0xC2 0x58 ] */ notedv PITCH_DF4, 194, 88 +/* 0x05A1 [0xCA 0x25 ] */ notepan 37 +/* 0x05A3 [0x69 0x09 0x4C ] */ notedv PITCH_D4, 9, 76 +/* 0x05A6 [0x69 0x81 0x55 0x5B ] */ notedv PITCH_D4, 341, 91 +/* 0x05AA [0xF4 0xA2 ] */ rjump LAYER_054E + +.layer LAYER_05AC +/* 0x05AC [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x05AF [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +.layer LAYER_05B2 +/* 0x05B2 [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x05B5 [0xCA 0x54 ] */ notepan 84 +/* 0x05B7 [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x05BA [0x69 0x80 0xC2 0x5A ] */ notedv PITCH_D4, 194, 90 +/* 0x05BE [0x6A 0x68 0x5E ] */ notedv PITCH_EF4, 104, 94 +/* 0x05C1 [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x05C4 [0x69 0x80 0x95 0x64 ] */ notedv PITCH_D4, 149, 100 +/* 0x05C8 [0x6B 0x61 0x69 ] */ notedv PITCH_E4, 97, 105 +/* 0x05CB [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x05CE [0x69 0x81 0x26 0x4E ] */ notedv PITCH_D4, 294, 78 +/* 0x05D2 [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x05D5 [0x67 0x06 0x54 ] */ notedv PITCH_C4, 6, 84 +/* 0x05D8 [0x6B 0x24 0x4C ] */ notedv PITCH_E4, 36, 76 +/* 0x05DB [0x67 0x81 0x9D 0x4E ] */ notedv PITCH_C4, 413, 78 +/* 0x05DF [0x67 0x5E 0x39 ] */ notedv PITCH_C4, 94, 57 +/* 0x05E2 [0xCA 0x4A ] */ notepan 74 +/* 0x05E4 [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x05E7 [0x69 0x80 0xA8 0x58 ] */ notedv PITCH_D4, 168, 88 +/* 0x05EB [0x67 0x81 0x59 0x43 ] */ notedv PITCH_C4, 345, 67 +/* 0x05EF [0x6B 0x81 0x05 0x54 ] */ notedv PITCH_E4, 261, 84 +/* 0x05F3 [0x6B 0x43 0x43 ] */ notedv PITCH_E4, 67, 67 +/* 0x05F6 [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x05F9 [0x68 0x80 0xD3 0x51 ] */ notedv PITCH_DF4, 211, 81 +/* 0x05FD [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x0600 [0x69 0x0B 0x5B ] */ notedv PITCH_D4, 11, 91 +/* 0x0603 [0x6B 0x81 0x26 0x58 ] */ notedv PITCH_E4, 294, 88 +/* 0x0607 [0xF4 0xA9 ] */ rjump LAYER_05B2 + +.layer LAYER_0609 +/* 0x0609 [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x060C [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x060F [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +.layer LAYER_0612 +/* 0x0612 [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x0615 [0xCA 0x2C ] */ notepan 44 +/* 0x0617 [0x69 0x15 0x4B ] */ notedv PITCH_D4, 21, 75 +/* 0x061A [0x6A 0x3D 0x5E ] */ notedv PITCH_EF4, 61, 94 +/* 0x061D [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x0620 [0x69 0x80 0x95 0x51 ] */ notedv PITCH_D4, 149, 81 +/* 0x0624 [0x6B 0x81 0x37 0x2A ] */ notedv PITCH_E4, 311, 42 +/* 0x0628 [0x67 0x81 0xF4 0x45 ] */ notedv PITCH_C4, 500, 69 +/* 0x062C [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x062F [0x6C 0x80 0xC8 0x5B ] */ notedv PITCH_F4, 200, 91 +/* 0x0633 [0x69 0x80 0x95 0x54 ] */ notedv PITCH_D4, 149, 84 +/* 0x0637 [0xCA 0x36 ] */ notepan 54 +/* 0x0639 [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x063C [0x6A 0x80 0x95 0x57 ] */ notedv PITCH_EF4, 149, 87 +/* 0x0640 [0x69 0x81 0x63 0x60 ] */ notedv PITCH_D4, 355, 96 +/* 0x0644 [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x0647 [0x6A 0x80 0xD8 0x3D ] */ notedv PITCH_EF4, 216, 61 +/* 0x064B [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x064E [0x67 0x81 0xE0 0x51 ] */ notedv PITCH_C4, 480, 81 +/* 0x0652 [0x67 0x80 0x4F 0x44 ] */ noteldv PITCH_C4, 79, 68 //! @bug uses long encoding when short encoding is sufficient +/* 0x0656 [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x0659 [0x6B 0x08 0x4B ] */ notedv PITCH_E4, 8, 75 +/* 0x065C [0x6A 0x81 0xA5 0x5E ] */ notedv PITCH_EF4, 421, 94 +/* 0x0660 [0xFC 0x0F 0x1F ] */ call LAYER_0F1F +/* 0x0663 [0xF4 0xAD ] */ rjump LAYER_0612 + +.layer LAYER_0665 +/* 0x0665 [0xF8 0x03 ] */ loop 3 +/* 0x0667 [0xCA 0x68 ] */ notepan 104 +/* 0x0669 [0x6B 0x81 0xCC 0x4B ] */ notedv PITCH_E4, 460, 75 +/* 0x066D [0xFC 0x0F 0x26 ] */ call LAYER_0F26 +/* 0x0670 [0xCA 0x32 ] */ notepan 50 +/* 0x0672 [0x67 0x81 0x67 0x57 ] */ notedv PITCH_C4, 359, 87 +.layer LAYER_0676 +/* 0x0676 [0xFC 0x0F 0x26 ] */ call LAYER_0F26 +/* 0x0679 [0xFC 0x0F 0x26 ] */ call LAYER_0F26 +/* 0x067C [0xCA 0x22 ] */ notepan 34 +/* 0x067E [0x69 0x81 0x67 0x5E ] */ notedv PITCH_D4, 359, 94 +/* 0x0682 [0xFC 0x0F 0x26 ] */ call LAYER_0F26 +/* 0x0685 [0xCA 0x40 ] */ notepan 64 +/* 0x0687 [0x69 0x81 0x67 0x3E ] */ notedv PITCH_D4, 359, 62 +.layer LAYER_068B +/* 0x068B [0xFC 0x0F 0x26 ] */ call LAYER_0F26 +/* 0x068E [0xC0 0x22 ] */ ldelay 34 +/* 0x0690 [0xFC 0x0F 0x26 ] */ call LAYER_0F26 +/* 0x0693 [0xCA 0x4F ] */ notepan 79 +/* 0x0695 [0x6B 0x81 0x67 0x4F ] */ notedv PITCH_E4, 359, 79 +/* 0x0699 [0xFC 0x0F 0x26 ] */ call LAYER_0F26 +/* 0x069C [0xCA 0x5B ] */ notepan 91 +/* 0x069E [0x6C 0x81 0x67 0x3E ] */ notedv PITCH_F4, 359, 62 +/* 0x06A2 [0xFC 0x0F 0x26 ] */ call LAYER_0F26 +/* 0x06A5 [0xCA 0x36 ] */ notepan 54 +/* 0x06A7 [0x67 0x81 0x67 0x56 ] */ notedv PITCH_C4, 359, 86 +/* 0x06AB [0xFC 0x0F 0x26 ] */ call LAYER_0F26 +/* 0x06AE [0xCA 0x24 ] */ notepan 36 +/* 0x06B0 [0x69 0x81 0x67 0x39 ] */ notedv PITCH_D4, 359, 57 +.layer LAYER_06B4 +/* 0x06B4 [0xFC 0x0F 0x26 ] */ call LAYER_0F26 +/* 0x06B7 [0xFC 0x0F 0x26 ] */ call LAYER_0F26 +/* 0x06BA [0xC0 0x37 ] */ ldelay 55 +/* 0x06BC [0xFC 0x0F 0x26 ] */ call LAYER_0F26 +/* 0x06BF [0xF7 ] */ loopend +/* 0x06C0 [0xCA 0x40 ] */ notepan 64 +/* 0x06C2 [0x67 0x09 0x39 ] */ notedv PITCH_C4, 9, 57 +/* 0x06C5 [0x6B 0x80 0xD8 0x45 ] */ notedv PITCH_E4, 216, 69 +/* 0x06C9 [0xFC 0x0F 0x26 ] */ call LAYER_0F26 +/* 0x06CC [0xF4 0x97 ] */ rjump LAYER_0665 + +.layer LAYER_06CE +/* 0x06CE [0xFC 0x0F 0x2D ] */ call LAYER_0F2D +/* 0x06D1 [0xCA 0x4A ] */ notepan 74 +/* 0x06D3 [0x6B 0x81 0x5F 0x56 ] */ notedv PITCH_E4, 351, 86 +/* 0x06D7 [0xFC 0x0F 0x2D ] */ call LAYER_0F2D +/* 0x06DA [0x6B 0x81 0x26 0x3B ] */ notedv PITCH_E4, 294, 59 +/* 0x06DE [0xCA 0x5A ] */ notepan 90 +/* 0x06E0 [0x6B 0x81 0x5F 0x42 ] */ notedv PITCH_E4, 351, 66 +/* 0x06E4 [0x67 0x81 0x26 0x31 ] */ notedv PITCH_C4, 294, 49 +.layer LAYER_06E8 +/* 0x06E8 [0xFC 0x0F 0x2D ] */ call LAYER_0F2D +/* 0x06EB [0xC0 0x47 ] */ ldelay 71 +/* 0x06ED [0xFC 0x0F 0x2D ] */ call LAYER_0F2D +/* 0x06F0 [0x69 0x81 0x37 0x51 ] */ notedv PITCH_D4, 311, 81 +/* 0x06F4 [0xCA 0x53 ] */ notepan 83 +/* 0x06F6 [0x6B 0x81 0x0B 0x63 ] */ notedv PITCH_E4, 267, 99 +.layer LAYER_06FA +/* 0x06FA [0xFC 0x0F 0x2D ] */ call LAYER_0F2D +/* 0x06FD [0xFC 0x0F 0x2D ] */ call LAYER_0F2D +/* 0x0700 [0xC0 0x21 ] */ ldelay 33 +/* 0x0702 [0xFC 0x0F 0x2D ] */ call LAYER_0F2D +/* 0x0705 [0x67 0x81 0x8D 0x31 ] */ notedv PITCH_C4, 397, 49 +/* 0x0709 [0x67 0x81 0x16 0x4E ] */ notedv PITCH_C4, 278, 78 +/* 0x070D [0xCA 0x45 ] */ notepan 69 +/* 0x070F [0xFC 0x0F 0x2D ] */ call LAYER_0F2D +/* 0x0712 [0x67 0x81 0xC4 0x39 ] */ notedv PITCH_C4, 452, 57 +.layer LAYER_0716 +/* 0x0716 [0xFC 0x0F 0x2D ] */ call LAYER_0F2D +/* 0x0719 [0xFC 0x0F 0x2D ] */ call LAYER_0F2D +/* 0x071C [0xFC 0x0F 0x2D ] */ call LAYER_0F2D +/* 0x071F [0xFC 0x0F 0x2D ] */ call LAYER_0F2D +/* 0x0722 [0x67 0x81 0x49 0x5C ] */ notedv PITCH_C4, 329, 92 +/* 0x0726 [0xCA 0x4E ] */ notepan 78 +/* 0x0728 [0x67 0x81 0x08 0x4B ] */ notedv PITCH_C4, 264, 75 +/* 0x072C [0xFC 0x0F 0x2D ] */ call LAYER_0F2D +/* 0x072F [0xF4 0x9D ] */ rjump LAYER_06CE + +.layer LAYER_0731 +/* 0x0731 [0xFC 0x0F 0x34 ] */ call LAYER_0F34 +.layer LAYER_0734 +/* 0x0734 [0xCA 0x36 ] */ notepan 54 +/* 0x0736 [0xFC 0x0F 0x34 ] */ call LAYER_0F34 +/* 0x0739 [0xCA 0x31 ] */ notepan 49 +/* 0x073B [0x6B 0x80 0xBF 0x56 ] */ notedv PITCH_E4, 191, 86 +/* 0x073F [0xCA 0x29 ] */ notepan 41 +/* 0x0741 [0x69 0x44 0x3B ] */ notedv PITCH_D4, 68, 59 +/* 0x0744 [0x67 0x81 0xCA 0x5B ] */ notedv PITCH_C4, 458, 91 +/* 0x0748 [0xCA 0x39 ] */ notepan 57 +/* 0x074A [0x67 0x80 0xEE 0x4D ] */ notedv PITCH_C4, 238, 77 +.layer LAYER_074E +/* 0x074E [0xFC 0x0F 0x34 ] */ call LAYER_0F34 +/* 0x0751 [0xFC 0x0F 0x34 ] */ call LAYER_0F34 +/* 0x0754 [0xC0 0x19 ] */ ldelay 25 +/* 0x0756 [0xCA 0x27 ] */ notepan 39 +/* 0x0758 [0x6B 0x80 0xC2 0x3B ] */ notedv PITCH_E4, 194, 59 +/* 0x075C [0x69 0x80 0xA4 0x31 ] */ notedv PITCH_D4, 164, 49 +/* 0x0760 [0xCA 0x33 ] */ notepan 51 +/* 0x0762 [0x69 0x81 0x3F 0x37 ] */ notedv PITCH_D4, 319, 55 +/* 0x0766 [0xCA 0x3B ] */ notepan 59 +/* 0x0768 [0x67 0x80 0xDB 0x48 ] */ notedv PITCH_C4, 219, 72 +/* 0x076C [0x67 0x82 0xF9 0x56 ] */ notedv PITCH_C4, 761, 86 +.layer LAYER_0770 +/* 0x0770 [0xFC 0x0F 0x34 ] */ call LAYER_0F34 +/* 0x0773 [0xFC 0x0F 0x34 ] */ call LAYER_0F34 +/* 0x0776 [0xFC 0x0F 0x34 ] */ call LAYER_0F34 +/* 0x0779 [0xC0 0x4B ] */ ldelay 75 +/* 0x077B [0xCA 0x30 ] */ notepan 48 +/* 0x077D [0x69 0x34 0x5F ] */ notedv PITCH_D4, 52, 95 +/* 0x0780 [0xCA 0x35 ] */ notepan 53 +/* 0x0782 [0x67 0x80 0xED 0x40 ] */ notedv PITCH_C4, 237, 64 +/* 0x0786 [0xFC 0x0F 0x34 ] */ call LAYER_0F34 +/* 0x0789 [0xF4 0xA9 ] */ rjump LAYER_0734 + +.layer LAYER_078B +/* 0x078B [0xFC 0x0F 0x3B ] */ call LAYER_0F3B +/* 0x078E [0x67 0x4F 0x5F ] */ notedv PITCH_C4, 79, 95 +/* 0x0791 [0x67 0x4F 0x5F ] */ notedv PITCH_C4, 79, 95 +.layer LAYER_0794 +/* 0x0794 [0xFC 0x0F 0x3B ] */ call LAYER_0F3B +/* 0x0797 [0xFC 0x0F 0x3B ] */ call LAYER_0F3B +/* 0x079A [0x67 0x80 0xA9 0x4B ] */ notedv PITCH_C4, 169, 75 +/* 0x079E [0x67 0x63 0x49 ] */ notedv PITCH_C4, 99, 73 +/* 0x07A1 [0x67 0x80 0x91 0x47 ] */ notedv PITCH_C4, 145, 71 +/* 0x07A5 [0xFC 0x0F 0x3B ] */ call LAYER_0F3B +/* 0x07A8 [0x67 0x55 0x4E ] */ notedv PITCH_C4, 85, 78 +/* 0x07AB [0x67 0x80 0xD3 0x4A ] */ notedv PITCH_C4, 211, 74 +/* 0x07AF [0xFC 0x0F 0x3B ] */ call LAYER_0F3B +.layer LAYER_07B2 +/* 0x07B2 [0xFC 0x0F 0x3B ] */ call LAYER_0F3B +/* 0x07B5 [0xC0 0x29 ] */ ldelay 41 +/* 0x07B7 [0xFC 0x0F 0x3B ] */ call LAYER_0F3B +/* 0x07BA [0x67 0x45 0x39 ] */ notedv PITCH_C4, 69, 57 +/* 0x07BD [0x67 0x5E 0x39 ] */ notedv PITCH_C4, 94, 57 +/* 0x07C0 [0xFC 0x0F 0x3B ] */ call LAYER_0F3B +/* 0x07C3 [0x67 0x4B 0x31 ] */ notedv PITCH_C4, 75, 49 +/* 0x07C6 [0x67 0x48 0x2E ] */ notedv PITCH_C4, 72, 46 +.layer LAYER_07C9 +/* 0x07C9 [0xFC 0x0F 0x3B ] */ call LAYER_0F3B +/* 0x07CC [0xC0 0x44 ] */ ldelay 68 +/* 0x07CE [0xFC 0x0F 0x3B ] */ call LAYER_0F3B +/* 0x07D1 [0xFC 0x0F 0x3B ] */ call LAYER_0F3B +/* 0x07D4 [0x67 0x54 0x58 ] */ notedv PITCH_C4, 84, 88 +/* 0x07D7 [0x67 0x5B 0x58 ] */ notedv PITCH_C4, 91, 88 +/* 0x07DA [0x67 0x80 0xBF 0x53 ] */ notedv PITCH_C4, 191, 83 +/* 0x07DE [0xF4 0xAB ] */ rjump LAYER_078B + +.layer LAYER_07E0 +/* 0x07E0 [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x07E3 [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +.layer LAYER_07E6 +/* 0x07E6 [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x07E9 [0xCA 0x18 ] */ notepan 24 +/* 0x07EB [0x2B 0x81 0xAA 0x56 0x7F] */ notedvg PITCH_E4, 426, 86, 127 +/* 0x07F0 [0x29 0x73 0x38 0x7F ] */ notedvg PITCH_D4, 115, 56, 127 +/* 0x07F4 [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x07F7 [0xCA 0x31 ] */ notepan 49 +/* 0x07F9 [0x27 0x81 0xF4 0x5E 0x7F] */ notedvg PITCH_C4, 500, 94, 127 +/* 0x07FE [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x0801 [0x2B 0x83 0x49 0x44 0x7F] */ notedvg PITCH_E4, 841, 68, 127 +/* 0x0806 [0x2C 0x81 0x67 0x47 0x7F] */ notedvg PITCH_F4, 359, 71, 127 +/* 0x080B [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x080E [0x2B 0x83 0x49 0x44 0x7F] */ notedvg PITCH_E4, 841, 68, 127 +/* 0x0813 [0x2B 0x82 0x29 0x5B 0x7F] */ notedvg PITCH_E4, 553, 91, 127 +/* 0x0818 [0x2C 0x80 0xDB 0x47 0x7F] */ notedvg PITCH_F4, 219, 71, 127 +/* 0x081D [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x0820 [0x2C 0x81 0x2C 0x52 0xDC] */ notedvg PITCH_F4, 300, 82, 220 +/* 0x0825 [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x0828 [0x2B 0x82 0x82 0x51 0x7F] */ notedvg PITCH_E4, 642, 81, 127 +/* 0x082D [0x2B 0x4F 0x44 0x7F ] */ notedvg PITCH_E4, 79, 68, 127 +/* 0x0831 [0x2C 0x80 0xDB 0x47 0x7F] */ notedvg PITCH_F4, 219, 71, 127 +/* 0x0836 [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x0839 [0x2C 0x81 0xC3 0x36 0x7F] */ notedvg PITCH_F4, 451, 54, 127 +/* 0x083E [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x0841 [0xF4 0xA3 ] */ rjump LAYER_07E6 + +.layer LAYER_0843 +/* 0x0843 [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x0846 [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +.layer LAYER_0849 +/* 0x0849 [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x084C [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x084F [0xCA 0x4C ] */ notepan 76 +/* 0x0851 [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x0854 [0x2B 0x81 0x42 0x56 0x7F] */ notedvg PITCH_E4, 322, 86, 127 +/* 0x0859 [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x085C [0x29 0x81 0xF4 0x5E 0x7F] */ notedvg PITCH_D4, 500, 94, 127 +/* 0x0861 [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x0864 [0x2B 0x80 0xFE 0x31 0x7F] */ notedvg PITCH_E4, 254, 49, 127 +/* 0x0869 [0x27 0x80 0xC3 0x47 0x7F] */ notedvg PITCH_C4, 195, 71, 127 +/* 0x086E [0x29 0x81 0xCB 0x3D 0x7F] */ notedvg PITCH_D4, 459, 61, 127 +/* 0x0873 [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x0876 [0x29 0x25 0x33 0x7F ] */ notedvg PITCH_D4, 37, 51, 127 +/* 0x087A [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x087D [0x28 0x82 0x3D 0x5B 0x7F] */ notedvg PITCH_DF4, 573, 91, 127 +/* 0x0882 [0x27 0x82 0xFD 0x58 0x7F] */ notedvg PITCH_C4, 765, 88, 127 +/* 0x0887 [0xCA 0x64 ] */ notepan 100 +/* 0x0889 [0xFC 0x0F 0x42 ] */ call LAYER_0F42 +/* 0x088C [0x2B 0x81 0x5C 0x4C 0x7F] */ notedvg PITCH_E4, 348, 76, 127 +/* 0x0891 [0x2C 0x82 0x84 0x3B 0xB4] */ notedvg PITCH_F4, 644, 59, 180 +/* 0x0896 [0xF4 0xB1 ] */ rjump LAYER_0849 + +.layer LAYER_0898 +/* 0x0898 [0xCA 0x54 ] */ notepan 84 +/* 0x089A [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x089D [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x08A0 [0xF4 0x02 ] */ rjump LAYER_08A4 + +.layer LAYER_08A2 +/* 0x08A2 [0xCA 0x3C ] */ notepan 60 +LAYER_08A4: +/* 0x08A4 [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x08A7 [0x5B 0x34 0x59 ] */ notedv PITCH_C3, 52, 89 +/* 0x08AA [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08AD [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08B0 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08B3 [0x5B 0x34 0x4D ] */ notedv PITCH_C3, 52, 77 +/* 0x08B6 [0x5B 0x34 0x4D ] */ notedv PITCH_C3, 52, 77 +/* 0x08B9 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08BC [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08BF [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08C2 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08C5 [0x5B 0x34 0x47 ] */ notedv PITCH_C3, 52, 71 +/* 0x08C8 [0x5B 0x34 0x47 ] */ notedv PITCH_C3, 52, 71 +/* 0x08CB [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08CE [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08D1 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08D4 [0x5B 0x34 0x4C ] */ notedv PITCH_C3, 52, 76 +/* 0x08D7 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08DA [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08DD [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08E0 [0x5B 0x34 0x59 ] */ notedv PITCH_C3, 52, 89 +/* 0x08E3 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08E6 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08E9 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08EC [0x5B 0x34 0x40 ] */ notedv PITCH_C3, 52, 64 +/* 0x08EF [0x5B 0x34 0x42 ] */ notedv PITCH_C3, 52, 66 +/* 0x08F2 [0x5B 0x34 0x45 ] */ notedv PITCH_C3, 52, 69 +/* 0x08F5 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08F8 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x08FB [0x5B 0x34 0x4B ] */ notedv PITCH_C3, 52, 75 +/* 0x08FE [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0901 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0904 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0907 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x090A [0x5B 0x34 0x55 ] */ notedv PITCH_C3, 52, 85 +/* 0x090D [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0910 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0913 [0x5B 0x34 0x4F ] */ notedv PITCH_C3, 52, 79 +/* 0x0916 [0x5B 0x34 0x4D ] */ notedv PITCH_C3, 52, 77 +/* 0x0919 [0x5B 0x34 0x47 ] */ notedv PITCH_C3, 52, 71 +/* 0x091C [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x091F [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0922 [0xF4 0x80 ] */ rjump LAYER_08A4 + +.layer LAYER_0924 +/* 0x0924 [0xCA 0x2A ] */ notepan 42 +/* 0x0926 [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x0929 [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x092C [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x092F [0xFB 0x09 0x34 ] */ jump LAYER_0934 + +.layer LAYER_0932 +/* 0x0932 [0xCA 0x45 ] */ notepan 69 +LAYER_0934: +/* 0x0934 [0xFC 0x0E 0xFC ] */ call LAYER_0EFC +/* 0x0937 [0x5B 0x30 0x2D ] */ notedv PITCH_C3, 48, 45 +/* 0x093A [0x5B 0x32 0x30 ] */ notedv PITCH_C3, 50, 48 +/* 0x093D [0x5B 0x34 0x2F ] */ notedv PITCH_C3, 52, 47 +/* 0x0940 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0943 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0946 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0949 [0x5B 0x34 0x50 ] */ notedv PITCH_C3, 52, 80 +/* 0x094C [0x5B 0x34 0x51 ] */ notedv PITCH_C3, 52, 81 +/* 0x094F [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0952 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0955 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0958 [0x5B 0x32 0x58 ] */ notedv PITCH_C3, 50, 88 +/* 0x095B [0x5B 0x34 0x54 ] */ notedv PITCH_C3, 52, 84 +/* 0x095E [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0961 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0964 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0967 [0x5B 0x32 0x5E ] */ notedv PITCH_C3, 50, 94 +/* 0x096A [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x096D [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0970 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0973 [0x5B 0x32 0x4C ] */ notedv PITCH_C3, 50, 76 +/* 0x0976 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0979 [0x5B 0x32 0x37 ] */ notedv PITCH_C3, 50, 55 +/* 0x097C [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x097F [0x5B 0x32 0x41 ] */ notedv PITCH_C3, 50, 65 +/* 0x0982 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0985 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0988 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x098B [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x098E [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x0991 [0x5B 0x36 0x53 ] */ notedv PITCH_C3, 54, 83 +/* 0x0994 [0x5B 0x34 0x57 ] */ notedv PITCH_C3, 52, 87 +/* 0x0997 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x099A [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x099D [0x5B 0x36 0x5B ] */ notedv PITCH_C3, 54, 91 +/* 0x09A0 [0x5B 0x34 0x55 ] */ notedv PITCH_C3, 52, 85 +/* 0x09A3 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x09A6 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x09A9 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x09AC [0x5B 0x34 0x41 ] */ notedv PITCH_C3, 52, 65 +/* 0x09AF [0x5B 0x30 0x3B ] */ notedv PITCH_C3, 48, 59 +/* 0x09B2 [0xFC 0x0F 0x6C ] */ call LAYER_0F6C +/* 0x09B5 [0xFB 0x09 0x34 ] */ jump LAYER_0934 + +.layer LAYER_09B8 +/* 0x09B8 [0xCA 0x28 ] */ notepan 40 +/* 0x09BA [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x09BD [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x09C0 [0xF4 0x4F ] */ rjump LAYER_0A11 + +.layer LAYER_09C2 +/* 0x09C2 [0xCA 0x32 ] */ notepan 50 +LAYER_09C4: +/* 0x09C4 [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x09C7 [0x67 0x41 0x56 ] */ notedv PITCH_C4, 65, 86 +/* 0x09CA [0xC0 0x80 0x9F ] */ ldelay 159 +/* 0x09CD [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x09D0 [0x68 0x36 0x38 ] */ notedv PITCH_DF4, 54, 56 +/* 0x09D3 [0xC0 0x81 0x23 ] */ ldelay 291 +/* 0x09D6 [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x09D9 [0x67 0x45 0x24 ] */ notedv PITCH_C4, 69, 36 +/* 0x09DC [0xC0 0x80 0x95 ] */ ldelay 149 +/* 0x09DF [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x09E2 [0x69 0x32 0x46 ] */ notedv PITCH_D4, 50, 70 +/* 0x09E5 [0xC0 0x80 0xE2 ] */ ldelay 226 +/* 0x09E8 [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x09EB [0x67 0x4C 0x33 ] */ notedv PITCH_C4, 76, 51 +/* 0x09EE [0xC0 0x80 0x8F ] */ ldelay 143 +/* 0x09F1 [0x69 0x3D 0x46 ] */ notedv PITCH_D4, 61, 70 +/* 0x09F4 [0xC0 0x81 0x4E ] */ ldelay 334 +/* 0x09F7 [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x09FA [0xF4 0xC8 ] */ rjump LAYER_09C4 + +.layer LAYER_09FC +/* 0x09FC [0xCA 0x58 ] */ notepan 88 +/* 0x09FE [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x0A01 [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x0A04 [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x0A07 [0xF4 0x08 ] */ rjump LAYER_0A11 + +.layer LAYER_0A09 +/* 0x0A09 [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x0A0C [0xCA 0x4E ] */ notepan 78 +/* 0x0A0E [0xC0 0x80 0xD3 ] */ ldelay 211 +LAYER_0A11: +/* 0x0A11 [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x0A14 [0xC0 0x81 0xBB ] */ ldelay 443 +/* 0x0A17 [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x0A1A [0xC0 0x81 0x08 ] */ ldelay 264 +/* 0x0A1D [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x0A20 [0x67 0x47 0x2C ] */ notedv PITCH_C4, 71, 44 +/* 0x0A23 [0xC0 0x81 0xA3 ] */ ldelay 419 +/* 0x0A26 [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x0A29 [0x67 0x47 0x40 ] */ notedv PITCH_C4, 71, 64 +/* 0x0A2C [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x0A2F [0x68 0x38 0x47 ] */ notedv PITCH_DF4, 56, 71 +/* 0x0A32 [0xC0 0x81 0x5F ] */ ldelay 351 +/* 0x0A35 [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x0A38 [0x69 0x3C 0x59 ] */ notedv PITCH_D4, 60, 89 +/* 0x0A3B [0xC0 0x82 0xC1 ] */ ldelay 705 +/* 0x0A3E [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x0A41 [0x67 0x39 0x39 ] */ notedv PITCH_C4, 57, 57 +/* 0x0A44 [0xC0 0x81 0x60 ] */ ldelay 352 +/* 0x0A47 [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x0A4A [0xF4 0xC5 ] */ rjump LAYER_0A11 + +.layer LAYER_0A4C +/* 0x0A4C [0xCA 0x4E ] */ notepan 78 +/* 0x0A4E [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0A51 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0A54 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0A57 [0xF4 0x51 ] */ rjump LAYER_0AAA + +.layer LAYER_0A59 +/* 0x0A59 [0xCA 0x46 ] */ notepan 70 +/* 0x0A5B [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0A5E [0xC0 0x38 ] */ ldelay 56 +/* 0x0A60 [0xF4 0x48 ] */ rjump LAYER_0AAA + +.layer LAYER_0A62 +/* 0x0A62 [0xCA 0x28 ] */ notepan 40 +/* 0x0A64 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0A67 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0A6A [0xF4 0x02 ] */ rjump LAYER_0A6E + +.layer LAYER_0A6C +/* 0x0A6C [0xCA 0x32 ] */ notepan 50 +LAYER_0A6E: +/* 0x0A6E [0xFC 0x0F 0x57 ] */ call LAYER_0F57 +/* 0x0A71 [0x5F 0x61 0x4B ] */ notedv PITCH_E3, 97, 75 +/* 0x0A74 [0x5F 0x5E 0x4F ] */ notedv PITCH_E3, 94, 79 +/* 0x0A77 [0x5F 0x5F 0x4D ] */ notedv PITCH_E3, 95, 77 +/* 0x0A7A [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0A7D [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0A80 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0A83 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0A86 [0x60 0x69 0x4E ] */ notedv PITCH_F3, 105, 78 +/* 0x0A89 [0x60 0x70 0x4F ] */ notedv PITCH_F3, 112, 79 +/* 0x0A8C [0x60 0x6B 0x48 ] */ notedv PITCH_F3, 107, 72 +/* 0x0A8F [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0A92 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0A95 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0A98 [0x5F 0x5F 0x45 ] */ notedv PITCH_E3, 95, 69 +/* 0x0A9B [0x5F 0x59 0x4A ] */ notedv PITCH_E3, 89, 74 +/* 0x0A9E [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0AA1 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0AA4 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0AA7 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +LAYER_0AAA: +/* 0x0AAA [0x5F 0x58 0x51 ] */ notedv PITCH_E3, 88, 81 +/* 0x0AAD [0x5F 0x5D 0x53 ] */ notedv PITCH_E3, 93, 83 +/* 0x0AB0 [0x5F 0x5B 0x4D ] */ notedv PITCH_E3, 91, 77 +/* 0x0AB3 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0AB6 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0AB9 [0x5F 0x66 0x45 ] */ notedv PITCH_E3, 102, 69 +/* 0x0ABC [0x5F 0x64 0x4A ] */ notedv PITCH_E3, 100, 74 +/* 0x0ABF [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0AC2 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0AC5 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0AC8 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0ACB [0x60 0x66 0x4A ] */ notedv PITCH_F3, 102, 74 +/* 0x0ACE [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0AD1 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0AD4 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0AD7 [0x5F 0x4E 0x57 ] */ notedv PITCH_E3, 78, 87 +/* 0x0ADA [0x5F 0x51 0x4E ] */ notedv PITCH_E3, 81, 78 +/* 0x0ADD [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0AE0 [0xFC 0x0F 0x5E ] */ call LAYER_0F5E +/* 0x0AE3 [0xF4 0x89 ] */ rjump LAYER_0A6E + +.layer LAYER_0AE5 +/* 0x0AE5 [0xFF ] */ end + +.layer LAYER_0AE6 +/* 0x0AE6 [0xFC 0x0F 0x73 ] */ call LAYER_0F73 +/* 0x0AE9 [0x67 0x80 0xA6 0x4B ] */ notedv PITCH_C4, 166, 75 +/* 0x0AED [0xFC 0x0F 0x73 ] */ call LAYER_0F73 +/* 0x0AF0 [0xFC 0x0F 0x73 ] */ call LAYER_0F73 +/* 0x0AF3 [0xFC 0x0F 0x73 ] */ call LAYER_0F73 +/* 0x0AF6 [0x68 0x80 0xA6 0x4F ] */ notedv PITCH_DF4, 166, 79 +.layer LAYER_0AFA +/* 0x0AFA [0xFC 0x0F 0x73 ] */ call LAYER_0F73 +/* 0x0AFD [0xFC 0x0F 0x73 ] */ call LAYER_0F73 +/* 0x0B00 [0xFC 0x0F 0x73 ] */ call LAYER_0F73 +/* 0x0B03 [0xFC 0x0F 0x73 ] */ call LAYER_0F73 +/* 0x0B06 [0x68 0x80 0xA6 0x54 ] */ notedv PITCH_DF4, 166, 84 +/* 0x0B0A [0xFC 0x0F 0x73 ] */ call LAYER_0F73 +/* 0x0B0D [0xFC 0x0F 0x73 ] */ call LAYER_0F73 +/* 0x0B10 [0xFC 0x0F 0x73 ] */ call LAYER_0F73 +/* 0x0B13 [0x67 0x80 0xA6 0x66 ] */ notedv PITCH_C4, 166, 102 +/* 0x0B17 [0xFC 0x0F 0x73 ] */ call LAYER_0F73 +/* 0x0B1A [0xFC 0x0F 0x73 ] */ call LAYER_0F73 +/* 0x0B1D [0xFC 0x0F 0x73 ] */ call LAYER_0F73 +/* 0x0B20 [0x67 0x80 0xA6 0x40 ] */ notedv PITCH_C4, 166, 64 +/* 0x0B24 [0xF4 0xC0 ] */ rjump LAYER_0AE6 + +.layer LAYER_0B26 +/* 0x0B26 [0xCF 0xEC ] */ releaserate 236 +/* 0x0B28 [0xC4 ] */ legato +/* 0x0B29 [0xCA 0x22 ] */ notepan 34 +/* 0x0B2B [0x67 0x2A 0x55 ] */ notedv PITCH_C4, 42, 85 +/* 0x0B2E [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0B31 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0B34 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0B37 [0xF4 0x06 ] */ rjump LAYER_0B3F + +.layer LAYER_0B39 +/* 0x0B39 [0xCF 0xEC ] */ releaserate 236 +/* 0x0B3B [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0B3E [0xC4 ] */ legato +LAYER_0B3F: +/* 0x0B3F [0xCA 0x5F ] */ notepan 95 +/* 0x0B41 [0xC7 0x85 0x26 0xFF ] */ portamento 0x85, PITCH_B3, 255 +/* 0x0B45 [0x68 0x34 0x4C ] */ notedv PITCH_DF4, 52, 76 +/* 0x0B48 [0x67 0x4F 0x4C ] */ notedv PITCH_C4, 79, 76 +/* 0x0B4B [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0B4E [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0B51 [0xCA 0x25 ] */ notepan 37 +/* 0x0B53 [0xC7 0x81 0x26 0x7F ] */ portamento 0x81, PITCH_B3, 127 +/* 0x0B57 [0x67 0x80 0xE1 0x63 ] */ notedv PITCH_C4, 225, 99 +/* 0x0B5B [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0B5E [0xCA 0x31 ] */ notepan 49 +/* 0x0B60 [0x67 0x1A 0x51 ] */ notedv PITCH_C4, 26, 81 +/* 0x0B63 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0B66 [0xCA 0x27 ] */ notepan 39 +/* 0x0B68 [0xC7 0x81 0x26 0x7F ] */ portamento 0x81, PITCH_B3, 127 +/* 0x0B6C [0x67 0x81 0x12 0x5B ] */ notedv PITCH_C4, 274, 91 +/* 0x0B70 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0B73 [0xCA 0x37 ] */ notepan 55 +/* 0x0B75 [0xC7 0x85 0x27 0xFF ] */ portamento 0x85, PITCH_C4, 255 +/* 0x0B79 [0x68 0x81 0x12 0x4E ] */ notedv PITCH_DF4, 274, 78 +/* 0x0B7D [0x68 0x5E 0x4E ] */ notedv PITCH_DF4, 94, 78 +/* 0x0B80 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0B83 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0B86 [0xCA 0x4A ] */ notepan 74 +/* 0x0B88 [0xC7 0x81 0x26 0x7F ] */ portamento 0x81, PITCH_B3, 127 +/* 0x0B8C [0x67 0x16 0x69 ] */ notedv PITCH_C4, 22, 105 +/* 0x0B8F [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0B92 [0xCA 0x2E ] */ notepan 46 +/* 0x0B94 [0xC7 0x81 0x26 0x7F ] */ portamento 0x81, PITCH_B3, 127 +/* 0x0B98 [0x68 0x24 0x5E ] */ notedv PITCH_DF4, 36, 94 +/* 0x0B9B [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0B9E [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0BA1 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0BA4 [0xCA 0x5E ] */ notepan 94 +/* 0x0BA6 [0xC7 0x85 0x27 0xFF ] */ portamento 0x85, PITCH_C4, 255 +/* 0x0BAA [0x68 0x81 0x12 0x4E ] */ notedv PITCH_DF4, 274, 78 +/* 0x0BAE [0x68 0x5E 0x4E ] */ notedv PITCH_DF4, 94, 78 +/* 0x0BB1 [0xF4 0x8C ] */ rjump LAYER_0B3F + +.layer LAYER_0BB3 +/* 0x0BB3 [0xCF 0xEC ] */ releaserate 236 +/* 0x0BB5 [0xC4 ] */ legato +/* 0x0BB6 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0BB9 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0BBC [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0BBF [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0BC2 [0xCA 0x54 ] */ notepan 84 +/* 0x0BC4 [0x68 0x5E 0x40 ] */ notedv PITCH_DF4, 94, 64 +/* 0x0BC7 [0xF4 0x09 ] */ rjump LAYER_0BD2 + +.layer LAYER_0BC9 +/* 0x0BC9 [0xCF 0xEC ] */ releaserate 236 +/* 0x0BCB [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0BCE [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0BD1 [0xC4 ] */ legato +LAYER_0BD2: +/* 0x0BD2 [0xCA 0x5E ] */ notepan 94 +/* 0x0BD4 [0xC7 0x81 0x26 0x7F ] */ portamento 0x81, PITCH_B3, 127 +/* 0x0BD8 [0x67 0x74 0x64 ] */ notedv PITCH_C4, 116, 100 +/* 0x0BDB [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0BDE [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0BE1 [0xCA 0x4C ] */ notepan 76 +/* 0x0BE3 [0xC7 0x85 0x27 0xFF ] */ portamento 0x85, PITCH_C4, 255 +/* 0x0BE7 [0x68 0x43 0x55 ] */ notedv PITCH_DF4, 67, 85 +/* 0x0BEA [0x66 0x80 0xF1 0x55 ] */ notedv PITCH_B3, 241, 85 +/* 0x0BEE [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0BF1 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0BF4 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0BF7 [0xCA 0x39 ] */ notepan 57 +/* 0x0BF9 [0x67 0x44 0x4E ] */ notedv PITCH_C4, 68, 78 +/* 0x0BFC [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0BFF [0xCA 0x5E ] */ notepan 94 +/* 0x0C01 [0xC7 0x81 0x26 0x7F ] */ portamento 0x81, PITCH_B3, 127 +/* 0x0C05 [0x68 0x80 0x91 0x4E ] */ notedv PITCH_DF4, 145, 78 +/* 0x0C09 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0C0C [0xCA 0x26 ] */ notepan 38 +/* 0x0C0E [0xC7 0x81 0x26 0x7F ] */ portamento 0x81, PITCH_B3, 127 +/* 0x0C12 [0x68 0x59 0x60 ] */ notedv PITCH_DF4, 89, 96 +/* 0x0C15 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0C18 [0xCA 0x5E ] */ notepan 94 +/* 0x0C1A [0xC7 0x85 0x26 0xFF ] */ portamento 0x85, PITCH_B3, 255 +/* 0x0C1E [0x67 0x80 0xC3 0x63 ] */ notedv PITCH_C4, 195, 99 +/* 0x0C22 [0x66 0x17 0x63 ] */ notedv PITCH_B3, 23, 99 +/* 0x0C25 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0C28 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0C2B [0xCA 0x40 ] */ notepan 64 +/* 0x0C2D [0x66 0x11 0x4C ] */ notedv PITCH_B3, 17, 76 +/* 0x0C30 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0C33 [0xCA 0x25 ] */ notepan 37 +/* 0x0C35 [0x66 0x13 0x69 ] */ notedv PITCH_B3, 19, 105 +/* 0x0C38 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0C3B [0xCA 0x2B ] */ notepan 43 +/* 0x0C3D [0xC7 0x81 0x26 0x7F ] */ portamento 0x81, PITCH_B3, 127 +/* 0x0C41 [0x67 0x81 0x12 0x5B ] */ notedv PITCH_C4, 274, 91 +/* 0x0C45 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0C48 [0xFC 0x0F 0x49 ] */ call LAYER_0F49 +/* 0x0C4B [0xF4 0x85 ] */ rjump LAYER_0BD2 + +.layer LAYER_0C4D +/* 0x0C4D [0xCF 0xEC ] */ releaserate 236 +/* 0x0C4F [0xCA 0x22 ] */ notepan 34 +/* 0x0C51 [0xC0 0x18 ] */ ldelay 24 +/* 0x0C53 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0C56 [0x67 0x2A 0x55 ] */ notedv PITCH_C4, 42, 85 +/* 0x0C59 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0C5C [0xF4 0x02 ] */ rjump LAYER_0C60 + +.layer LAYER_0C5E +/* 0x0C5E [0xCF 0xEC ] */ releaserate 236 +LAYER_0C60: +/* 0x0C60 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0C63 [0xCA 0x4B ] */ notepan 75 +/* 0x0C65 [0x67 0x34 0x5E ] */ notedv PITCH_C4, 52, 94 +/* 0x0C68 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0C6B [0xCA 0x22 ] */ notepan 34 +/* 0x0C6D [0x67 0x80 0x9F 0x43 ] */ notedv PITCH_C4, 159, 67 +/* 0x0C71 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0C74 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0C77 [0xCA 0x48 ] */ notepan 72 +/* 0x0C79 [0x67 0x80 0xC5 0x4F ] */ notedv PITCH_C4, 197, 79 +/* 0x0C7D [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0C80 [0xCA 0x29 ] */ notepan 41 +/* 0x0C82 [0x67 0x80 0x85 0x44 ] */ notedv PITCH_C4, 133, 68 +/* 0x0C86 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0C89 [0xCA 0x31 ] */ notepan 49 +/* 0x0C8B [0x67 0x80 0xD3 0x63 ] */ notedv PITCH_C4, 211, 99 +/* 0x0C8F [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0C92 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0C95 [0xCA 0x44 ] */ notepan 68 +/* 0x0C97 [0x67 0x3B 0x5E ] */ notedv PITCH_C4, 59, 94 +/* 0x0C9A [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0C9D [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CA0 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CA3 [0xCA 0x69 ] */ notepan 105 +/* 0x0CA5 [0x67 0x80 0xC5 0x51 ] */ notedv PITCH_C4, 197, 81 +/* 0x0CA9 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CAC [0xCA 0x4C ] */ notepan 76 +/* 0x0CAE [0x67 0x3B 0x56 ] */ notedv PITCH_C4, 59, 86 +/* 0x0CB1 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CB4 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CB7 [0xF4 0xA7 ] */ rjump LAYER_0C60 + +.layer LAYER_0CB9 +/* 0x0CB9 [0xCF 0xEC ] */ releaserate 236 +/* 0x0CBB [0xCA 0x22 ] */ notepan 34 +/* 0x0CBD [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CC0 [0xC0 0x18 ] */ ldelay 24 +/* 0x0CC2 [0x67 0x5E 0x4D ] */ notedv PITCH_C4, 94, 77 +/* 0x0CC5 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CC8 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CCB [0xF4 0x05 ] */ rjump LAYER_0CD2 + +.layer LAYER_0CCD +/* 0x0CCD [0xCF 0xEC ] */ releaserate 236 +/* 0x0CCF [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +LAYER_0CD2: +/* 0x0CD2 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CD5 [0xCA 0x4B ] */ notepan 75 +/* 0x0CD7 [0x67 0x80 0x98 0x5E ] */ notedv PITCH_C4, 152, 94 +/* 0x0CDB [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CDE [0xCA 0x22 ] */ notepan 34 +/* 0x0CE0 [0x67 0x80 0xD2 0x54 ] */ notedv PITCH_C4, 210, 84 +/* 0x0CE4 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CE7 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CEA [0xCA 0x3B ] */ notepan 59 +/* 0x0CEC [0x67 0x80 0xA8 0x63 ] */ notedv PITCH_C4, 168, 99 +/* 0x0CF0 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CF3 [0xCA 0x5F ] */ notepan 95 +/* 0x0CF5 [0x67 0x25 0x4A ] */ notedv PITCH_C4, 37, 74 +/* 0x0CF8 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CFB [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0CFE [0xCA 0x51 ] */ notepan 81 +/* 0x0D00 [0x67 0x2C 0x58 ] */ notedv PITCH_C4, 44, 88 +/* 0x0D03 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0D06 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0D09 [0xCA 0x40 ] */ notepan 64 +/* 0x0D0B [0x67 0x4E 0x5B ] */ notedv PITCH_C4, 78, 91 +/* 0x0D0E [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0D11 [0xCA 0x25 ] */ notepan 37 +/* 0x0D13 [0x67 0x80 0x9E 0x44 ] */ notedv PITCH_C4, 158, 68 +/* 0x0D17 [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0D1A [0xCA 0x2D ] */ notepan 45 +/* 0x0D1C [0x67 0x73 0x4E ] */ notedv PITCH_C4, 115, 78 +/* 0x0D1F [0xFC 0x0F 0x50 ] */ call LAYER_0F50 +/* 0x0D22 [0xF4 0xAE ] */ rjump LAYER_0CD2 + +.layer LAYER_0D24 +/* 0x0D24 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +.layer LAYER_0D27 +/* 0x0D27 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +.layer LAYER_0D2A +/* 0x0D2A [0xCA 0x22 ] */ notepan 34 +/* 0x0D2C [0xC0 0x18 ] */ ldelay 24 +/* 0x0D2E [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D31 [0x67 0x2A 0x55 ] */ notedv PITCH_C4, 42, 85 +/* 0x0D34 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D37 [0xF4 0x03 ] */ rjump LAYER_0D3C + +.layer LAYER_0D39 +/* 0x0D39 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +LAYER_0D3C: +/* 0x0D3C [0xCA 0x4B ] */ notepan 75 +/* 0x0D3E [0x67 0x34 0x5E ] */ notedv PITCH_C4, 52, 94 +/* 0x0D41 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D44 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D47 [0xCA 0x2F ] */ notepan 47 +/* 0x0D49 [0x68 0x28 0x4C ] */ notedv PITCH_DF4, 40, 76 +/* 0x0D4C [0x68 0x2A 0x4D ] */ notedv PITCH_DF4, 42, 77 +/* 0x0D4F [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D52 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D55 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D58 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D5B [0xCA 0x3D ] */ notepan 61 +/* 0x0D5D [0x67 0x24 0x4C ] */ notedv PITCH_C4, 36, 76 +/* 0x0D60 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D63 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D66 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D69 [0xCA 0x25 ] */ notepan 37 +/* 0x0D6B [0x67 0x2B 0x41 ] */ notedv PITCH_C4, 43, 65 +/* 0x0D6E [0x67 0x33 0x41 ] */ notedv PITCH_C4, 51, 65 +/* 0x0D71 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D74 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D77 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D7A [0xCA 0x57 ] */ notepan 87 +/* 0x0D7C [0x67 0x21 0x58 ] */ notedv PITCH_C4, 33, 88 +/* 0x0D7F [0x67 0x2F 0x58 ] */ notedv PITCH_C4, 47, 88 +/* 0x0D82 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D85 [0xCA 0x47 ] */ notepan 71 +/* 0x0D87 [0x67 0x2D 0x4D ] */ notedv PITCH_C4, 45, 77 +/* 0x0D8A [0x67 0x27 0x4D ] */ notedv PITCH_C4, 39, 77 +/* 0x0D8D [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D90 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D93 [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D96 [0xCA 0x31 ] */ notepan 49 +/* 0x0D98 [0x67 0x37 0x55 ] */ notedv PITCH_C4, 55, 85 +/* 0x0D9B [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0D9E [0xFC 0x0F 0x65 ] */ call LAYER_0F65 +/* 0x0DA1 [0xF4 0x99 ] */ rjump LAYER_0D3C + +.channel CHAN_0DA3 +/* 0x0DA3 [0xC4 ] */ noshort +/* 0x0DA4 [0xE5 0x01 ] */ reverbidx 1 +/* 0x0DA6 [0xB0 0x10 0x30 ] */ ldfilter FILTER_1030 +/* 0x0DA9 [0xB3 0x00 ] */ filter 0, 0 +CHAN_0DAB: +/* 0x0DAB [0xFE ] */ delay1 +/* 0x0DAC [0x61 ] */ ldio IO_PORT_1 +/* 0x0DAD [0xC8 0x01 ] */ sub 1 +/* 0x0DAF [0xF3 0x02 ] */ rbeqz CHAN_0DB3 +/* 0x0DB1 [0xF4 0xF8 ] */ rjump CHAN_0DAB + +CHAN_0DB3: +/* 0x0DB3 [0xDF 0x50 ] */ vol 80 +/* 0x0DB5 [0xE0 0x7F ] */ volexp 127 +/* 0x0DB7 [0xDC 0x00 ] */ panweight 0 +/* 0x0DB9 [0xC1 0x12 ] */ instr SF2_INST_18 +/* 0x0DBB [0xDA 0x10 0x12 ] */ env ENVELOPE_1012 +/* 0x0DBE [0x88 0x0D 0xED ] */ ldlayer 0, LAYER_0DED +/* 0x0DC1 [0x89 0x0D 0xF9 ] */ ldlayer 1, LAYER_0DF9 +/* 0x0DC4 [0x8A 0x0D 0xFF ] */ ldlayer 2, LAYER_0DFF +CHAN_0DC7: +/* 0x0DC7 [0xFE ] */ delay1 +/* 0x0DC8 [0x64 ] */ ldio IO_PORT_4 +/* 0x0DC9 [0xF2 0x14 ] */ rbltz CHAN_0DDF +/* 0x0DCB [0xC9 0x3F ] */ and 63 +/* 0x0DCD [0xC7 0x00 0x0D 0xDE ] */ stseq 0, CHAN_0DDD + STSEQ_BEND +/* 0x0DD1 [0x64 ] */ ldio IO_PORT_4 +/* 0x0DD2 [0xC9 0x3F ] */ and 63 +/* 0x0DD4 [0xCB 0x0F 0x7A ] */ ldseq UNK_0F7A +/* 0x0DD7 [0xC7 0x50 0x0D 0xDC ] */ stseq 80, STSEQ_HERE + STSEQ_VOL +/* 0x0DDB [0xDF 0x60 ] */ vol 96 +CHAN_0DDD: +/* 0x0DDD [0xD3 0x00 ] */ bend 0 +CHAN_0DDF: +/* 0x0DDF [0x61 ] */ ldio IO_PORT_1 +/* 0x0DE0 [0xC8 0x00 ] */ sub 0 +/* 0x0DE2 [0xF3 0x02 ] */ rbeqz CHAN_0DE6 +/* 0x0DE4 [0xF4 0xE1 ] */ rjump CHAN_0DC7 + +CHAN_0DE6: +/* 0x0DE6 [0xD9 0x5C ] */ releaserate 92 +/* 0x0DE8 [0x90 ] */ dellayer 0 +/* 0x0DE9 [0x91 ] */ dellayer 1 +/* 0x0DEA [0x92 ] */ dellayer 2 +/* 0x0DEB [0xF4 0xBE ] */ rjump CHAN_0DAB + +.layer LAYER_0DED +/* 0x0DED [0xCA 0x54 ] */ notepan 84 +LAYER_0DEF: +/* 0x0DEF [0xC4 ] */ legato +/* 0x0DF0 [0xC7 0x01 0x22 0x64 ] */ portamento 0x01, PITCH_G3, 100 +LAYER_0DF4: +/* 0x0DF4 [0x67 0x60 0x64 ] */ notedv PITCH_C4, 96, 100 +/* 0x0DF7 [0xF4 0xFB ] */ rjump LAYER_0DF4 + +.layer LAYER_0DF9 +/* 0x0DF9 [0xC2 0x01 ] */ transpose 1 +/* 0x0DFB [0xCA 0x2C ] */ notepan 44 +/* 0x0DFD [0xF4 0xF0 ] */ rjump LAYER_0DEF + +.layer LAYER_0DFF +/* 0x0DFF [0xCD 0x14 ] */ stereo 1, 0, 1, 0, 0 +/* 0x0E01 [0xC4 ] */ legato +/* 0x0E02 [0xC7 0x01 0x22 0x64 ] */ portamento 0x01, PITCH_G3, 100 +LAYER_0E06: +/* 0x0E06 [0x65 0x60 0x64 ] */ notedv PITCH_BF3, 96, 100 +/* 0x0E09 [0xF4 0xFB ] */ rjump LAYER_0E06 + +.channel CHAN_0E0B +/* 0x0E0B [0xC4 ] */ noshort +/* 0x0E0C [0xE5 0x01 ] */ reverbidx 1 +/* 0x0E0E [0xB0 0x10 0x30 ] */ ldfilter FILTER_1030 +/* 0x0E11 [0xB3 0x00 ] */ filter 0, 0 +CHAN_0E13: +/* 0x0E13 [0xFE ] */ delay1 +/* 0x0E14 [0x61 ] */ ldio IO_PORT_1 +/* 0x0E15 [0xC8 0x01 ] */ sub 1 +/* 0x0E17 [0xF3 0x02 ] */ rbeqz CHAN_0E1B +/* 0x0E19 [0xF4 0xF8 ] */ rjump CHAN_0E13 + +CHAN_0E1B: +/* 0x0E1B [0xDF 0x5F ] */ vol 95 +/* 0x0E1D [0xE0 0x7F ] */ volexp 127 +/* 0x0E1F [0xDC 0x00 ] */ panweight 0 +/* 0x0E21 [0xD4 0x18 ] */ reverb 24 +CHAN_0E23: +/* 0x0E23 [0x88 0x0E 0xAD ] */ ldlayer 0, LAYER_0EAD +/* 0x0E26 [0x89 0x0E 0xA7 ] */ ldlayer 1, LAYER_0EA7 +/* 0x0E29 [0xCC 0x01 ] */ ldi 1 +/* 0x0E2B [0x77 ] */ stio IO_PORT_7 +CHAN_0E2C: +/* 0x0E2C [0xFE ] */ delay1 +/* 0x0E2D [0x60 ] */ ldio IO_PORT_0 +/* 0x0E2E [0x72 ] */ stio IO_PORT_2 +/* 0x0E2F [0xF3 0x2B ] */ rbeqz CHAN_0E5C +/* 0x0E31 [0x61 ] */ ldio IO_PORT_1 +/* 0x0E32 [0xC8 0x00 ] */ sub 0 +/* 0x0E34 [0xF3 0x22 ] */ rbeqz CHAN_0E58 +/* 0x0E36 [0x67 ] */ ldio IO_PORT_7 +/* 0x0E37 [0xC8 0x01 ] */ sub 1 +/* 0x0E39 [0x77 ] */ stio IO_PORT_7 +/* 0x0E3A [0xF3 0x02 ] */ rbeqz CHAN_0E3E +/* 0x0E3C [0xF4 0xEE ] */ rjump CHAN_0E2C + +CHAN_0E3E: +/* 0x0E3E [0xB8 0x5A ] */ rand 90 +/* 0x0E40 [0xC7 0x0A 0x0E 0xBD ] */ stseq 10, LAYER_0EBC + STSEQ_NOTEDV_DELAY_HI +/* 0x0E44 [0xC7 0x0A 0x0E 0xC0 ] */ stseq 10, LAYER_0EBF + STSEQ_LDELAY +/* 0x0E48 [0xB8 0x28 ] */ rand 40 +/* 0x0E4A [0xC7 0x44 0x0E 0xBB ] */ stseq 68, LAYER_0EB8 + STSEQ_NOTEDV_VELOCITY +/* 0x0E4E [0xC7 0x44 0x0E 0xBF ] */ stseq 68, LAYER_0EBF + STSEQ_GENERAL_OPCODE +/* 0x0E52 [0x76 ] */ stio IO_PORT_6 +/* 0x0E53 [0xCC 0x32 ] */ ldi 50 +/* 0x0E55 [0x77 ] */ stio IO_PORT_7 +/* 0x0E56 [0xF4 0xD4 ] */ rjump CHAN_0E2C + +CHAN_0E58: +/* 0x0E58 [0x90 ] */ dellayer 0 +/* 0x0E59 [0x91 ] */ dellayer 1 +/* 0x0E5A [0xF4 0xB7 ] */ rjump CHAN_0E13 + +CHAN_0E5C: +/* 0x0E5C [0xDF 0x73 ] */ vol 115 +/* 0x0E5E [0x65 ] */ ldio IO_PORT_5 +/* 0x0E5F [0xF5 0x0E 0x64 ] */ bgez CHAN_0E64 +/* 0x0E62 [0xCC 0x00 ] */ ldi 0 +CHAN_0E64: +/* 0x0E64 [0xC9 0x3F ] */ and 63 +/* 0x0E66 [0x75 ] */ stio IO_PORT_5 +/* 0x0E67 [0xCC 0x3F ] */ ldi 63 +/* 0x0E69 [0x55 ] */ subio IO_PORT_5 +/* 0x0E6A [0xC8 0xD0 ] */ sub 208 +/* 0x0E6C [0xC7 0x00 0x0E 0x73 ] */ stseq 0, CHAN_0E72 + STSEQ_STSEQ_IMM +/* 0x0E70 [0xB8 0x10 ] */ rand 16 +CHAN_0E72: +/* 0x0E72 [0xC7 0x64 0x0E 0xD2 ] */ stseq 100, LAYER_0ECF + STSEQ_NOTEDV_VELOCITY +/* 0x0E76 [0xCC 0x3F ] */ ldi 63 +/* 0x0E78 [0x55 ] */ subio IO_PORT_5 +/* 0x0E79 [0xCB 0x0F 0xBA ] */ ldseq UNK_0FBA +/* 0x0E7C [0xCB 0x0F 0x7A ] */ ldseq UNK_0F7A +/* 0x0E7F [0x74 ] */ stio IO_PORT_4 +/* 0x0E80 [0xC7 0x67 0x0E 0x88 ] */ stseq 103, CHAN_0E87 + 1 +/* 0x0E84 [0xB8 0x02 ] */ rand 2 +/* 0x0E86 [0x73 ] */ stio IO_PORT_3 +CHAN_0E87: +/* 0x0E87 [0xC7 0x67 0x0E 0xCF ] */ stseq (NOTEDV_OPCODE | PITCH_C4), LAYER_0ECF + STSEQ_NOTEDV_OPCODE_PITCH +/* 0x0E8B [0xB8 0x1E ] */ rand 30 +/* 0x0E8D [0xC7 0x31 0x0E 0xCC ] */ stseq 49, LAYER_0ECB + STSEQ_NOTEPAN +/* 0x0E91 [0x76 ] */ stio IO_PORT_6 +/* 0x0E92 [0x88 0x0E 0xC7 ] */ ldlayer 0, LAYER_0EC7 +/* 0x0E95 [0x89 0x0E 0xC5 ] */ ldlayer 1, LAYER_0EC5 +CHAN_0E98: +/* 0x0E98 [0xFE ] */ delay1 +/* 0x0E99 [0x60 ] */ ldio IO_PORT_0 +/* 0x0E9A [0xF3 0xC0 ] */ rbeqz CHAN_0E5C +/* 0x0E9C [0x61 ] */ ldio IO_PORT_1 +/* 0x0E9D [0xC8 0x00 ] */ sub 0 +/* 0x0E9F [0xF3 0xB7 ] */ rbeqz CHAN_0E58 +/* 0x0EA1 [0x80 ] */ testlayer 0 +/* 0x0EA2 [0xF3 0xF4 ] */ rbeqz CHAN_0E98 +/* 0x0EA4 [0xFB 0x0E 0x23 ] */ jump CHAN_0E23 + +.layer LAYER_0EA7 +/* 0x0EA7 [0xC2 0xF4 ] */ transpose -12 +LAYER_0EA9: +/* 0x0EA9 [0xCD 0x14 ] */ stereo 1, 0, 1, 0, 0 +/* 0x0EAB [0xF4 0x00 ] */ rjump LAYER_0EAD + +.layer LAYER_0EAD +/* 0x0EAD [0xC6 0x13 ] */ instr SF2_INST_19 +/* 0x0EAF [0xCB 0x10 0x1E 0x61 ] */ env ENVELOPE_101E, 97 +LAYER_0EB3: +/* 0x0EB3 [0xC7 0x85 0x1B 0xFF ] */ portamento 0x85, PITCH_C3, 255 +/* 0x0EB7 [0xC4 ] */ legato +LAYER_0EB8: +/* 0x0EB8 [0x58 0x81 0xC2 0x6E ] */ notedv PITCH_A2, 450, 110 +LAYER_0EBC: +/* 0x0EBC [0x58 0x64 0x6E ] */ notedv PITCH_A2, 100, 110 +LAYER_0EBF: +/* 0x0EBF [0xC0 0x60 ] */ ldelay 96 +/* 0x0EC1 [0xC5 ] */ nolegato +/* 0x0EC2 [0xC8 ] */ noportamento +/* 0x0EC3 [0xF4 0xEE ] */ rjump LAYER_0EB3 + +.layer LAYER_0EC5 +/* 0x0EC5 [0xC2 0xF4 ] */ transpose -12 +.layer LAYER_0EC7 +/* 0x0EC7 [0xC6 0x14 ] */ instr SF2_INST_20 +/* 0x0EC9 [0xCF 0x61 ] */ releaserate 97 +LAYER_0ECB: +/* 0x0ECB [0xCA 0x40 ] */ notepan 64 +/* 0x0ECD [0xC0 0x01 ] */ ldelay 1 +LAYER_0ECF: +/* 0x0ECF [0x67 0x80 0xC8 0x7F ] */ notedv PITCH_C4, 200, 127 +LAYER_0ED3: +/* 0x0ED3 [0xCD 0x14 ] */ stereo 1, 0, 1, 0, 0 +/* 0x0ED5 [0x4C 0x28 0x50 ] */ notedv PITCH_A1, 40, 80 +/* 0x0ED8 [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0EDA [0xFF ] */ end + +.channel CHAN_0EDB +/* 0x0EDB [0x67 ] */ ldio IO_PORT_7 +/* 0x0EDC [0xC8 0x02 ] */ sub 2 +/* 0x0EDE [0xF3 0x04 ] */ rbeqz CHAN_0EE4 +/* 0x0EE0 [0xCC 0x00 ] */ ldi 0 +/* 0x0EE2 [0xF4 0x02 ] */ rjump CHAN_0EE6 + +CHAN_0EE4: +/* 0x0EE4 [0xCC 0x14 ] */ ldi 20 +CHAN_0EE6: +/* 0x0EE6 [0xC7 0x00 0x0E 0xFB ] */ stseq 0, UNK_0EFB +/* 0x0EEA [0xC7 0x00 0x0E 0x00 ] */ stseq 0, LAYER_0DFF + STSEQ_STEREO +/* 0x0EEE [0xC7 0x00 0x0E 0xAA ] */ stseq 0, LAYER_0EA9 + STSEQ_STEREO +/* 0x0EF2 [0xC7 0x00 0x0E 0xD4 ] */ stseq 0, LAYER_0ED3 + STSEQ_STEREO +/* 0x0EF6 [0xC7 0x00 0x03 0x63 ] */ stseq 0, LAYER_0362 + STSEQ_STEREO +/* 0x0EFA [0xFF ] */ end + +UNK_0EFB: + .byte 0x00 + +.layer LAYER_0EFC +/* 0x0EFC [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0EFE +/* 0x0EFE [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F00 +/* 0x0F00 [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F02 [0xFF ] */ end + +.layer LAYER_0F03 +/* 0x0F03 [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F05 +/* 0x0F05 [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F07 +/* 0x0F07 [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F09 [0xFF ] */ end + +.layer LAYER_0F0A +/* 0x0F0A [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F0C +/* 0x0F0C [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F0E +/* 0x0F0E [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F10 [0xFF ] */ end + +.layer LAYER_0F11 +/* 0x0F11 [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F13 +/* 0x0F13 [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F15 +/* 0x0F15 [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F17 [0xFF ] */ end + +.layer LAYER_0F18 +/* 0x0F18 [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F1A +/* 0x0F1A [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F1C +/* 0x0F1C [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F1E [0xFF ] */ end + +.layer LAYER_0F1F +/* 0x0F1F [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F21 +/* 0x0F21 [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F23 +/* 0x0F23 [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F25 [0xFF ] */ end + +.layer LAYER_0F26 +/* 0x0F26 [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F28 +/* 0x0F28 [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F2A +/* 0x0F2A [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F2C [0xFF ] */ end + +.layer LAYER_0F2D +/* 0x0F2D [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F2F +/* 0x0F2F [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F31 +/* 0x0F31 [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F33 [0xFF ] */ end + +.layer LAYER_0F34 +/* 0x0F34 [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F36 +/* 0x0F36 [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F38 +/* 0x0F38 [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F3A [0xFF ] */ end + +.layer LAYER_0F3B +/* 0x0F3B [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F3D +/* 0x0F3D [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F3F +/* 0x0F3F [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F41 [0xFF ] */ end + +.layer LAYER_0F42 +/* 0x0F42 [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F44 +/* 0x0F44 [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F46 +/* 0x0F46 [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F48 [0xFF ] */ end + +.layer LAYER_0F49 +/* 0x0F49 [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F4B +/* 0x0F4B [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F4D +/* 0x0F4D [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F4F [0xFF ] */ end + +.layer LAYER_0F50 +/* 0x0F50 [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F52 +/* 0x0F52 [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F54 +/* 0x0F54 [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F56 [0xFF ] */ end + +.layer LAYER_0F57 +/* 0x0F57 [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F59 +/* 0x0F59 [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F5B +/* 0x0F5B [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F5D [0xFF ] */ end + +.layer LAYER_0F5E +/* 0x0F5E [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F60 +/* 0x0F60 [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F62 +/* 0x0F62 [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F64 [0xFF ] */ end + +.layer LAYER_0F65 +/* 0x0F65 [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F67 +/* 0x0F67 [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F69 +/* 0x0F69 [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F6B [0xFF ] */ end + +.layer LAYER_0F6C +/* 0x0F6C [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F6E +/* 0x0F6E [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F70 +/* 0x0F70 [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F72 [0xFF ] */ end + +.layer LAYER_0F73 +/* 0x0F73 [0xC0 0x64 ] */ ldelay 100 +.layer LAYER_0F75 +/* 0x0F75 [0xC0 0x7F ] */ ldelay 127 +.layer LAYER_0F77 +/* 0x0F77 [0xCD 0x00 ] */ stereo 0, 0, 0, 0, 0 +/* 0x0F79 [0xFF ] */ end + +UNK_0F7A: + .byte 0x00, 0x00 + .byte 0x01, 0x01 + .byte 0x02, 0x02 + .byte 0x03, 0x03 + .byte 0x04, 0x04 + .byte 0x05, 0x05 + .byte 0x06, 0x06 + .byte 0x07, 0x07 + .byte 0x08, 0x08 + .byte 0x09, 0x09 + .byte 0x0A, 0x0A + .byte 0x0B, 0x0B + .byte 0x0C, 0x0C + .byte 0x0D, 0x0D + .byte 0x0E, 0x0E + .byte 0x0F, 0x0F + .byte 0x10, 0x10 + .byte 0x11, 0x11 + .byte 0x12, 0x12 + .byte 0x13, 0x13 + .byte 0x14, 0x14 + .byte 0x15, 0x15 + .byte 0x16, 0x16 + .byte 0x17, 0x17 + .byte 0x18, 0x18 + .byte 0x19, 0x19 + .byte 0x1A, 0x1A + .byte 0x1B, 0x1B + .byte 0x1C, 0x1C + .byte 0x1D, 0x1D + .byte 0x1E, 0x1E + .byte 0x1F, 0x1F + +UNK_0FBA: + .byte 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x01, 0x01, 0x01 + .byte 0x02, 0x02, 0x02, 0x02 + .byte 0x03, 0x03, 0x03, 0x03 + .byte 0x04, 0x04, 0x04, 0x04 + .byte 0x05, 0x05, 0x05, 0x05 + .byte 0x06, 0x06, 0x06, 0x06 + .byte 0x07, 0x07, 0x07, 0x07 + .byte 0x08, 0x08, 0x08, 0x08 + .byte 0x09, 0x09, 0x09, 0x09 + .byte 0x0A, 0x0A, 0x0A, 0x0A + .byte 0x0B, 0x0B, 0x0B, 0x0B + .byte 0x0C, 0x0C, 0x0C, 0x0C + .byte 0x0D, 0x0D, 0x0D, 0x0D + .byte 0x0E, 0x0E, 0x0E, 0x0E + .byte 0x0F, 0x0F, 0x0F, 0x0F + +.envelope ENVELOPE_0FFA + point 270, 32700 + point 125, 32700 + goto 1 + +.envelope ENVELOPE_1006 + point 25, 32700 + point 310, 5000 + hang + +.envelope ENVELOPE_1012 + point 2000, 32700 + point 32700, 32700 + hang + +.envelope ENVELOPE_101E + point 100, 32700 + point 2000, 10000 + hang + +.filter FILTER_1030 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.endseq Sequence_1 diff --git a/assets/audio/sequences/seq_109.prg.seq b/assets/audio/sequences/seq_109.prg.seq new file mode 100644 index 0000000000..f4d4247e6a --- /dev/null +++ b/assets/audio/sequences/seq_109.prg.seq @@ -0,0 +1,1158 @@ +#include "aseq.h" +#include "Soundfont_1.h" +#include "Soundfont_0.h" +#include "versions.h" + +.startseq Sequence_109 + +.sequence SEQ_0000 +/* 0x0000 [0xD3 0x60 ] */ mutebhv 0x60 +/* 0x0002 [0xD5 0x00 ] */ mutescale 0 +/* 0x0004 [0xDB 0x7F ] */ vol 127 +/* 0x0006 [0xDD 0x78 ] */ tempo 120 +/* 0x0008 [0xD7 0x00 0x01 ] */ initchan 0b1 +/* 0x000B [0x90 0x00 0x13 ] */ ldchan 0, CHAN_0013 +SEQ_000E: +/* 0x000E [0xFE ] */ delay1 +/* 0x000F [0x00 ] */ testchan 0 +/* 0x0010 [0xF3 0xFC ] */ rbeqz SEQ_000E +/* 0x0012 [0xFF ] */ end + +.channel CHAN_0013 +/* 0x0013 [0xC4 ] */ noshort +/* 0x0014 [0xCA 0x20 ] */ mutebhv 0x20 +/* 0x0016 [0xD0 0x80 ] */ effects TRUE, 0, 0, 0, 0, 0 +/* 0x0018 [0xE9 0x0E ] */ notepri 0, 14 +/* 0x001A [0xE5 0x01 ] */ reverbidx 1 +/* 0x001C [0xC6 0x00 ] */ font Soundfont_0_ID +/* 0x001E [0xD4 0x0F ] */ reverb 15 +/* 0x0020 [0xDC 0x7F ] */ panweight 127 +/* 0x0022 [0xC2 0x06 0x46 ] */ dyntbl TABLE_0646 +/* 0x0025 [0x60 ] */ ldio 0 +/* 0x0026 [0xF2 0x05 ] */ rbltz CHAN_002D +/* 0x0028 [0xE4 ] */ dyncall +CHAN_0029: +/* 0x0029 [0xFE ] */ delay1 +/* 0x002A [0x80 ] */ testlayer 0 +/* 0x002B [0xF3 0xFC ] */ rbeqz CHAN_0029 +CHAN_002D: +/* 0x002D [0xFF ] */ end + +.channel CHAN_002E +/* 0x002E [0xD4 0x1E ] */ reverb 30 +/* 0x0030 [0xDC 0x76 ] */ panweight 118 +/* 0x0032 [0x88 0x00 0x45 ] */ ldlayer 0, LAYER_0045 +/* 0x0035 [0x89 0x00 0x58 ] */ ldlayer 1, LAYER_0058 +/* 0x0038 [0x8A 0x00 0x71 ] */ ldlayer 2, LAYER_0071 +/* 0x003B [0x01 ] */ cdelay 1 +/* 0x003C [0xE2 0x3C 0x00 0x12 ] */ vibdepthgrad 60, 0, 18 +/* 0x0040 [0xE1 0xF0 0x14 0x12 ] */ vibfreqgrad 240, 20, 18 +/* 0x0044 [0xFF ] */ end + +.layer LAYER_0045 +/* 0x0045 [0xCA 0x7F ] */ notepan 127 +/* 0x0047 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x0049 [0xC2 0x18 ] */ transpose 24 +/* 0x004B [0xCB 0x07 0x8A 0xE6 ] */ env ENVELOPE_078A, 230 +/* 0x004F [0x70 0x81 0x0E 0x50 ] */ notedv PITCH_A4, FRAMERATE_CONST(270, 324), 80 +/* 0x0053 [0x7C 0x81 0x2C 0x50 ] */ notedv PITCH_A5, FRAMERATE_CONST(300, 360), 80 +/* 0x0057 [0xFF ] */ end + +.layer LAYER_0058 +/* 0x0058 [0xCA 0x00 ] */ notepan 0 +/* 0x005A [0xC0 0x01 ] */ ldelay 1 +/* 0x005C [0xC6 0x33 ] */ instr SF0_INST_51 +/* 0x005E [0xC2 0x30 ] */ transpose 48 +/* 0x0060 [0xCB 0x07 0x8A 0xB4 ] */ env ENVELOPE_078A, 180 +/* 0x0064 [0xC7 0x81 0x38 0xFF ] */ portamento 0x81, PITCH_F5, 255 +/* 0x0068 [0x78 0x80 0xFA 0x48 ] */ notedv PITCH_F5, FRAMERATE_CONST(250, 300), 72 +/* 0x006C [0x7C 0x81 0x40 0x48 ] */ notedv PITCH_A5, FRAMERATE_CONST(320, 384), 72 +/* 0x0070 [0xFF ] */ end + +.layer LAYER_0071 +/* 0x0071 [0xC0 0x01 ] */ ldelay 1 +/* 0x0073 [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x0075 [0xCB 0x07 0x8A 0xE6 ] */ env ENVELOPE_078A, 230 +/* 0x0079 [0xC7 0x01 0x0F 0x85 0xC8] */ portamento 0x01, PITCH_C2, 1480 +/* 0x007E [0x73 0x82 0x3A 0x40 ] */ notedv PITCH_C5, FRAMERATE_CONST(570, 684), 64 +/* 0x0082 [0xFF ] */ end + +.channel CHAN_0083 +/* 0x0083 [0x88 0x00 0x99 ] */ ldlayer 0, LAYER_0099 +/* 0x0086 [0x89 0x00 0xA6 ] */ ldlayer 1, LAYER_00A6 +/* 0x0089 [0x8A 0x00 0xB7 ] */ ldlayer 2, LAYER_00B7 +/* 0x008C [0x01 ] */ cdelay 1 +/* 0x008D [0xE1 0x7F 0xFF 0x28 ] */ vibfreqgrad 127, 255, 40 +/* 0x0091 [0xE2 0x14 0x7F 0x28 ] */ vibdepthgrad 20, 127, 40 +/* 0x0095 [0x01 ] */ cdelay 1 +/* 0x0096 [0xD8 0x00 ] */ vibdepth 0 +/* 0x0098 [0xFF ] */ end + +.layer LAYER_0099 +/* 0x0099 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x009B [0xCB 0x08 0xD2 0xDD ] */ env ENVELOPE_08D2, 221 +/* 0x009F [0xC2 0x18 ] */ transpose 24 +/* 0x00A1 [0x73 0x81 0x90 0x69 ] */ notedv PITCH_C5, FRAMERATE_CONST(400, 480), 105 +/* 0x00A5 [0xFF ] */ end + +.layer LAYER_00A6 +/* 0x00A6 [0xC0 0x01 ] */ ldelay 1 +/* 0x00A8 [0xC6 0x45 ] */ instr SF0_INST_69 +/* 0x00AA [0xCB 0x09 0x0A 0xE0 ] */ env ENVELOPE_090A, 224 +/* 0x00AE [0xC7 0x81 0x03 0xFF ] */ portamento 0x81, PITCH_C1, 255 +/* 0x00B2 [0x5F 0x81 0x2C 0x41 ] */ notedv PITCH_E3, FRAMERATE_CONST(300, 360), 65 +/* 0x00B6 [0xFF ] */ end + +.layer LAYER_00B7 +/* 0x00B7 [0xC6 0x08 ] */ instr SF0_INST_8 +/* 0x00B9 [0xC7 0x81 0x18 0x19 ] */ portamento 0x81, PITCH_A2, 25 +/* 0x00BD [0x5D 0x46 0x55 ] */ notedv PITCH_D3, FRAMERATE_CONST(70, 84), 85 +/* 0x00C0 [0xC0 0x80 0xC8 ] */ ldelay FRAMERATE_CONST(200, 240) +/* 0x00C3 [0xCB 0x09 0x16 0xDD ] */ env ENVELOPE_0916, 221 +/* 0x00C7 [0xC7 0x81 0x1B 0x19 ] */ portamento 0x81, PITCH_C3, 25 +/* 0x00CB [0x60 0x80 0x96 0x55 ] */ notedv PITCH_F3, FRAMERATE_CONST(150, 180), 85 +/* 0x00CF [0xFF ] */ end + +.channel CHAN_00D0 +/* 0x00D0 [0x88 0x00 0xF7 ] */ ldlayer 0, LAYER_00F7 +/* 0x00D3 [0x89 0x00 0xDE ] */ ldlayer 1, LAYER_00DE +/* 0x00D6 [0x8A 0x00 0xEF ] */ ldlayer 2, LAYER_00EF +/* 0x00D9 [0xD7 0xFF ] */ vibfreq 255 +/* 0x00DB [0xD8 0x28 ] */ vibdepth 40 +/* 0x00DD [0xFF ] */ end + +.layer LAYER_00DE +/* 0x00DE [0xC2 0x30 ] */ transpose 48 +/* 0x00E0 [0xC6 0x2C ] */ instr SF0_INST_44 +/* 0x00E2 [0xCF 0xDD ] */ releaserate 221 +/* 0x00E4 [0xC7 0x84 0x16 0x7F ] */ portamento 0x84, PITCH_G2, 127 +/* 0x00E8 [0x70 0x60 0x55 ] */ notedv PITCH_A4, FRAMERATE_CONST(96, 115), 85 +/* 0x00EB [0x72 0x7F 0x5F ] */ notedv PITCH_B4, FRAMERATE_CONST(127, 152), 95 +/* 0x00EE [0xFF ] */ end + +.layer LAYER_00EF +/* 0x00EF [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x00F1 [0xCB 0x07 0x2A 0xDD ] */ env ENVELOPE_072A, 221 +/* 0x00F5 [0xF4 0x06 ] */ rjump LAYER_00FD + +.layer LAYER_00F7 +/* 0x00F7 [0xC6 0x0D ] */ instr SF0_INST_13 +/* 0x00F9 [0xC2 0x24 ] */ transpose 36 +/* 0x00FB [0xCF 0xDD ] */ releaserate 221 +LAYER_00FD: +/* 0x00FD [0xC7 0x85 0x2E 0xFF ] */ portamento 0x85, PITCH_G4, 255 +/* 0x0101 [0x58 0x3C 0x5A ] */ notedv PITCH_A2, FRAMERATE_CONST(60, 72), 90 +/* 0x0104 [0xCB 0x07 0x12 0xDD ] */ env ENVELOPE_0712, 221 +/* 0x0108 [0x64 0x24 0x5A ] */ notedv PITCH_A3, FRAMERATE_CONST(36, 43), 90 +/* 0x010B [0xC7 0x85 0x33 0xFF ] */ portamento 0x85, PITCH_C5, 255 +/* 0x010F [0x5B 0x7F 0x5A ] */ notedv PITCH_C3, FRAMERATE_CONST(127, 152), 90 +/* 0x0112 [0xFF ] */ end + +.channel CHAN_0113 +/* 0x0113 [0x88 0x01 0x27 ] */ ldlayer 0, LAYER_0127 +/* 0x0116 [0x89 0x01 0x1A ] */ ldlayer 1, LAYER_011A +/* 0x0119 [0xFF ] */ end + +.layer LAYER_011A +/* 0x011A [0xC2 0x24 ] */ transpose 36 +/* 0x011C [0xC6 0x2E ] */ instr SF0_INST_46 +/* 0x011E [0xCB 0x08 0x7A 0xB4 ] */ env ENVELOPE_087A, 180 +/* 0x0122 [0x6B 0x82 0x26 0x46 ] */ notedv PITCH_E4, FRAMERATE_CONST(550, 660), 70 +/* 0x0126 [0xFF ] */ end + +.layer LAYER_0127 +/* 0x0127 [0xC2 0x1E ] */ transpose 30 +/* 0x0129 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x012B [0xCB 0x08 0x7A 0xDD ] */ env ENVELOPE_087A, 221 +/* 0x012F [0x60 0x80 0x9B 0x64 ] */ notedv PITCH_F3, FRAMERATE_CONST(155, 186), 100 +/* 0x0133 [0x6C 0x7F 0x64 ] */ notedv PITCH_F4, FRAMERATE_CONST(127, 152), 100 +/* 0x0136 [0xC2 0x24 ] */ transpose 36 +/* 0x0138 [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x013A [0xCB 0x08 0x8A 0xDD ] */ env ENVELOPE_088A, 221 +/* 0x013E [0x67 0x80 0xF8 0x64 ] */ notedv PITCH_C4, FRAMERATE_CONST(248, 288), 100 +/* 0x0142 [0xFF ] */ end + +.channel CHAN_0143 +/* 0x0143 [0x88 0x01 0x4D ] */ ldlayer 0, LAYER_014D +/* 0x0146 [0x89 0x01 0x27 ] */ ldlayer 1, LAYER_0127 +/* 0x0149 [0x8A 0x01 0x1A ] */ ldlayer 2, LAYER_011A +/* 0x014C [0xFF ] */ end + +.layer LAYER_014D +/* 0x014D [0xC0 0x81 0x90 ] */ ldelay FRAMERATE_CONST(400, 480) +/* 0x0150 [0xFF ] */ end + +.channel CHAN_0151 +/* 0x0151 [0xD4 0x1E ] */ reverb 30 +/* 0x0153 [0x89 0x01 0x72 ] */ ldlayer 1, LAYER_0172 +.channel CHAN_0156 +/* 0x0156 [0xC1 0x11 ] */ instr SF0_INST_17 +/* 0x0158 [0x88 0x01 0x65 ] */ ldlayer 0, LAYER_0165 +/* 0x015B [0x8A 0x01 0x82 ] */ ldlayer 2, LAYER_0182 +/* 0x015E [0xD7 0xA0 ] */ vibfreq 160 +/* 0x0160 [0xE2 0x00 0x30 0x09 ] */ vibdepthgrad 0, 48, 9 +/* 0x0164 [0xFF ] */ end + +.layer LAYER_0165 +/* 0x0165 [0xCB 0x07 0x8A 0xE7 ] */ env ENVELOPE_078A, 231 +/* 0x0169 [0xC7 0x81 0x26 0xFF ] */ portamento 0x81, PITCH_B3, 255 +/* 0x016D [0x60 0x82 0x4E 0x4B ] */ notedv PITCH_F3, FRAMERATE_CONST(590, 708), 75 +/* 0x0171 [0xFF ] */ end + +.layer LAYER_0172 +/* 0x0172 [0xC0 0x81 0x5E ] */ ldelay FRAMERATE_CONST(350, 420) +/* 0x0175 [0xCB 0x07 0x92 0xE7 ] */ env ENVELOPE_0792, 231 +/* 0x0179 [0xC7 0x81 0x03 0xFF ] */ portamento 0x81, PITCH_C1, 255 +/* 0x017D [0x5B 0x80 0xF0 0x64 ] */ notedv PITCH_C3, FRAMERATE_CONST(240, 288), 100 +/* 0x0181 [0xFF ] */ end + +.layer LAYER_0182 +/* 0x0182 [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x0184 [0xCB 0x07 0x92 0xE7 ] */ env ENVELOPE_0792, 231 +/* 0x0188 [0x63 0x82 0x08 0x5C ] */ notedv PITCH_AF3, FRAMERATE_CONST(520, 624), 92 +/* 0x018C [0xFF ] */ end + +.channel CHAN_018D +/* 0x018D [0x21 0x02 0x51 ] */ ldchan 1, CHAN_0251 +/* 0x0190 [0x88 0x01 0xD4 ] */ ldlayer 0, LAYER_01D4 +/* 0x0193 [0x89 0x01 0xE9 ] */ ldlayer 1, LAYER_01E9 +/* 0x0196 [0x8A 0x02 0x43 ] */ ldlayer 2, LAYER_0243 +/* 0x0199 [0xDD 0x3A ] */ pan 58 +/* 0x019B [0xFD 0x30 ] */ delay 48 +/* 0x019D [0xDB 0x01 ] */ transpose 1 +/* 0x019F [0x88 0x01 0xD4 ] */ ldlayer 0, LAYER_01D4 +/* 0x01A2 [0x89 0x01 0xE9 ] */ ldlayer 1, LAYER_01E9 +/* 0x01A5 [0x8A 0x02 0x4A ] */ ldlayer 2, LAYER_024A +/* 0x01A8 [0xDD 0x46 ] */ pan 70 +/* 0x01AA [0xFD 0x47 ] */ delay 71 +/* 0x01AC [0xDB 0x02 ] */ transpose 2 +/* 0x01AE [0x88 0x01 0xD4 ] */ ldlayer 0, LAYER_01D4 +/* 0x01B1 [0x89 0x01 0xE9 ] */ ldlayer 1, LAYER_01E9 +/* 0x01B4 [0x8A 0x01 0xFA ] */ ldlayer 2, LAYER_01FA +/* 0x01B7 [0xDD 0x40 ] */ pan 64 +/* 0x01B9 [0xFD 0x80 0x8E ] */ delay 142 +/* 0x01BC [0xDB 0x00 ] */ transpose 0 +/* 0x01BE [0x88 0x02 0x01 ] */ ldlayer 0, LAYER_0201 +/* 0x01C1 [0x89 0x02 0x10 ] */ ldlayer 1, LAYER_0210 +/* 0x01C4 [0x8A 0x02 0x1B ] */ ldlayer 2, LAYER_021B +/* 0x01C7 [0x8B 0x02 0x36 ] */ ldlayer 3, LAYER_0236 +/* 0x01CA [0xED 0x19 ] */ gain 25 +/* 0x01CC [0xFD 0x64 ] */ delay 100 +/* 0x01CE [0xED 0x00 ] */ gain 0 +/* 0x01D0 [0xFD 0x81 0xE0 ] */ delay 480 +/* 0x01D3 [0xFF ] */ end + +.layer LAYER_01D4 +/* 0x01D4 [0xC6 0x1E ] */ instr SF0_INST_30 +/* 0x01D6 [0xCB 0x07 0x5E 0xFB ] */ env ENVELOPE_075E, 251 +/* 0x01DA [0xC7 0x81 0x37 0x7F ] */ portamento 0x81, PITCH_E5, 127 +/* 0x01DE [0x44 0x08 0x73 ] */ notedv PITCH_DF1, 8, 115 +/* 0x01E1 [0xC7 0x81 0x06 0xFF ] */ portamento 0x81, PITCH_EF1, 255 +/* 0x01E5 [0x63 0x0B 0x69 ] */ notedv PITCH_AF3, 11, 105 +/* 0x01E8 [0xFF ] */ end + +.layer LAYER_01E9 +/* 0x01E9 [0xC6 0x1F ] */ instr SF0_INST_31 +/* 0x01EB [0xC7 0x81 0x31 0xDE ] */ portamento 0x81, PITCH_BF4, 222 +/* 0x01EF [0x59 0x08 0x73 ] */ notedv PITCH_BF2, 8, 115 +/* 0x01F2 [0xC7 0x81 0x13 0xFF ] */ portamento 0x81, PITCH_E2, 255 +/* 0x01F6 [0x60 0x0C 0x73 ] */ notedv PITCH_F3, 12, 115 +/* 0x01F9 [0xFF ] */ end + +.layer LAYER_01FA +/* 0x01FA [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x01FC [0x0F 0x00 0x64 0x00 ] */ notedvg PITCH_C2, 0, 100, 0 +/* 0x0200 [0xFF ] */ end + +.layer LAYER_0201 +/* 0x0201 [0xC6 0x15 ] */ instr SF0_INST_21 +/* 0x0203 [0xCB 0x07 0x46 0xFA ] */ env ENVELOPE_0746, 250 +/* 0x0207 [0xC7 0x81 0x26 0xC8 ] */ portamento 0x81, PITCH_B3, 200 +/* 0x020B [0x25 0x24 0x73 0x64 ] */ notedvg PITCH_BF3, 36, 115, 100 +/* 0x020F [0xFF ] */ end + +.layer LAYER_0210 +/* 0x0210 [0xC6 0x05 ] */ instr SF0_INST_5 +/* 0x0212 [0x6B 0x0A 0x4B ] */ notedv PITCH_E4, 10, 75 +/* 0x0215 [0x62 0x0A 0x4B ] */ notedv PITCH_G3, 10, 75 +/* 0x0218 [0xC0 0x07 ] */ ldelay 7 +/* 0x021A [0xFF ] */ end + +.layer LAYER_021B +/* 0x021B [0xC0 0x07 ] */ ldelay 7 +/* 0x021D [0xC6 0x20 ] */ instr SF0_INST_32 +/* 0x021F [0xCB 0x06 0xF6 0xFA ] */ env ENVELOPE_06F6, 250 +/* 0x0223 [0x33 0x06 0x27 0x7F ] */ notedvg PITCH_C5, 6, 39, 127 +/* 0x0227 [0xC6 0x1A ] */ instr SF0_INST_26 +/* 0x0229 [0x29 0x04 0x31 0x7F ] */ notedvg PITCH_D4, 4, 49, 127 +/* 0x022D [0xC6 0x17 ] */ instr SF0_INST_23 +/* 0x022F [0x66 0x05 0x27 ] */ notedv PITCH_B3, 5, 39 +/* 0x0232 [0x60 0x05 0x27 ] */ notedv PITCH_F3, 5, 39 +/* 0x0235 [0xFF ] */ end + +.layer LAYER_0236 +/* 0x0236 [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x0238 [0x0E 0x00 0x5F 0x00 ] */ notedvg PITCH_B1, 0, 95, 0 +/* 0x023C [0xC0 0x14 ] */ ldelay 20 +/* 0x023E [0x0E 0x0F 0x5A 0x00 ] */ notedvg PITCH_B1, 15, 90, 0 +/* 0x0242 [0xFF ] */ end + +.layer LAYER_0243 +/* 0x0243 [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x0245 [0x0A 0x00 0x64 0x00 ] */ notedvg PITCH_G1, 0, 100, 0 +/* 0x0249 [0xFF ] */ end + +.layer LAYER_024A +/* 0x024A [0xC6 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x024C [0x0C 0x00 0x6E 0x00 ] */ notedvg PITCH_A1, 0, 110, 0 +/* 0x0250 [0xFF ] */ end + +.channel CHAN_0251 +/* 0x0251 [0xC4 ] */ noshort +/* 0x0252 [0xCA 0x20 ] */ mutebhv 0x20 +/* 0x0254 [0xD0 0x80 ] */ effects TRUE, 0, 0, 0, 0, 0 +/* 0x0256 [0xE9 0x0E ] */ notepri 0, 14 +/* 0x0258 [0xE5 0x01 ] */ reverbidx 1 +/* 0x025A [0xD4 0x0F ] */ reverb 15 +/* 0x025C [0xC6 0x01 ] */ font Soundfont_1_ID +/* 0x025E [0x88 0x02 0xAE ] */ ldlayer 0, LAYER_02AE +/* 0x0261 [0x8A 0x02 0xC3 ] */ ldlayer 2, LAYER_02C3 +/* 0x0264 [0xD7 0x60 ] */ vibfreq 96 +/* 0x0266 [0xD8 0x54 ] */ vibdepth 84 +/* 0x0268 [0xFD 0x81 0x7C ] */ delay 380 +/* 0x026B [0x0A ] */ cdelay 10 +/* 0x026C [0xDD 0x3C ] */ pan 60 +/* 0x026E [0x0A ] */ cdelay 10 +/* 0x026F [0xDD 0x38 ] */ pan 56 +/* 0x0271 [0x0A ] */ cdelay 10 +/* 0x0272 [0xDD 0x34 ] */ pan 52 +/* 0x0274 [0x0A ] */ cdelay 10 +/* 0x0275 [0xDD 0x30 ] */ pan 48 +/* 0x0277 [0x0A ] */ cdelay 10 +/* 0x0278 [0xDD 0x34 ] */ pan 52 +/* 0x027A [0x0A ] */ cdelay 10 +/* 0x027B [0xDD 0x38 ] */ pan 56 +/* 0x027D [0x0A ] */ cdelay 10 +/* 0x027E [0xDD 0x3C ] */ pan 60 +/* 0x0280 [0x0A ] */ cdelay 10 +/* 0x0281 [0xDD 0x40 ] */ pan 64 +/* 0x0283 [0x0A ] */ cdelay 10 +/* 0x0284 [0xDD 0x44 ] */ pan 68 +/* 0x0286 [0x0A ] */ cdelay 10 +/* 0x0287 [0xDD 0x48 ] */ pan 72 +/* 0x0289 [0x0A ] */ cdelay 10 +/* 0x028A [0xDD 0x4C ] */ pan 76 +/* 0x028C [0x0A ] */ cdelay 10 +/* 0x028D [0xDD 0x50 ] */ pan 80 +/* 0x028F [0x0A ] */ cdelay 10 +/* 0x0290 [0xDD 0x56 ] */ pan 86 +/* 0x0292 [0x0A ] */ cdelay 10 +/* 0x0293 [0xDD 0x5E ] */ pan 94 +/* 0x0295 [0x0A ] */ cdelay 10 +/* 0x0296 [0xDD 0x68 ] */ pan 104 +/* 0x0298 [0x0A ] */ cdelay 10 +/* 0x0299 [0xDD 0x74 ] */ pan 116 +/* 0x029B [0x0A ] */ cdelay 10 +/* 0x029C [0xDD 0x7F ] */ pan 127 +/* 0x029E [0x0A ] */ cdelay 10 +/* 0x029F [0xDD 0x7C ] */ pan 124 +/* 0x02A1 [0x0A ] */ cdelay 10 +/* 0x02A2 [0xDD 0x78 ] */ pan 120 +/* 0x02A4 [0x0A ] */ cdelay 10 +/* 0x02A5 [0xDD 0x74 ] */ pan 116 +/* 0x02A7 [0x0A ] */ cdelay 10 +/* 0x02A8 [0xDD 0x70 ] */ pan 112 +/* 0x02AA [0xFD 0x81 0x18 ] */ delay 280 +/* 0x02AD [0xFF ] */ end + +.layer LAYER_02AE +/* 0x02AE [0xC2 0xFC ] */ transpose -4 +/* 0x02B0 [0xC6 0x13 ] */ instr SF1_INST_19 +/* 0x02B2 [0xCB 0x08 0xC2 0xFB ] */ env ENVELOPE_08C2, 251 +LAYER_02B6: +/* 0x02B6 [0xC4 ] */ legato +/* 0x02B7 [0xC7 0x85 0x18 0xFF ] */ portamento 0x85, PITCH_A2, 255 +LAYER_02BB: +/* 0x02BB [0x64 0x64 0x5A ] */ notedv PITCH_A3, 100, 90 +/* 0x02BE [0x58 0x64 0x5A ] */ notedv PITCH_A2, 100, 90 +/* 0x02C1 [0xF4 0xF8 ] */ rjump LAYER_02BB + +.layer LAYER_02C3 +/* 0x02C3 [0xC2 0x04 ] */ transpose 4 +/* 0x02C5 [0xC6 0x12 ] */ instr SF1_INST_18 +/* 0x02C7 [0xCB 0x08 0xC2 0xFB ] */ env ENVELOPE_08C2, 251 +LAYER_02CB: +/* 0x02CB [0xC4 ] */ legato +/* 0x02CC [0xC7 0x85 0x30 0xFF ] */ portamento 0x85, PITCH_A4, 255 +LAYER_02D0: +/* 0x02D0 [0x7C 0x32 0x4C ] */ notedv PITCH_A5, 50, 76 +/* 0x02D3 [0x70 0x32 0x4C ] */ notedv PITCH_A4, 50, 76 +/* 0x02D6 [0xF4 0xF8 ] */ rjump LAYER_02D0 + +.channel CHAN_02D8 +/* 0x02D8 [0x88 0x02 0xE8 ] */ ldlayer 0, LAYER_02E8 +/* 0x02DB [0x89 0x02 0xEC ] */ ldlayer 1, LAYER_02EC +/* 0x02DE [0x8A 0x02 0xF6 ] */ ldlayer 2, LAYER_02F6 +/* 0x02E1 [0xC6 0x01 ] */ font Soundfont_1_ID +/* 0x02E3 [0xD7 0x60 ] */ vibfreq 96 +/* 0x02E5 [0xD8 0x54 ] */ vibdepth 84 +/* 0x02E7 [0xFF ] */ end + +.layer LAYER_02E8 +/* 0x02E8 [0xC0 0x87 0x50 ] */ ldelay FRAMERATE_CONST(1872, 2247) +/* 0x02EB [0xFF ] */ end + +.layer LAYER_02EC +/* 0x02EC [0xC2 0xFC ] */ transpose -4 +/* 0x02EE [0xC6 0x13 ] */ instr SF1_INST_19 +/* 0x02F0 [0xCB 0x08 0xEA 0xFB ] */ env ENVELOPE_08EA, 251 +/* 0x02F4 [0xF4 0xC0 ] */ rjump LAYER_02B6 + +.layer LAYER_02F6 +/* 0x02F6 [0xC2 0x04 ] */ transpose 4 +/* 0x02F8 [0xC6 0x12 ] */ instr SF1_INST_18 +/* 0x02FA [0xCB 0x08 0xEA 0xFB ] */ env ENVELOPE_08EA, 251 +/* 0x02FE [0xF4 0xCB ] */ rjump LAYER_02CB + +.channel CHAN_0300 +/* 0x0300 [0xC6 0x01 ] */ font Soundfont_1_ID +/* 0x0302 [0x21 0x03 0x44 ] */ ldchan 1, CHAN_0344 +/* 0x0305 [0xFD 0x81 0x02 ] */ delay FRAMERATE_CONST(258, 310) +/* 0x0308 [0x88 0x03 0x12 ] */ ldlayer 0, LAYER_0312 +/* 0x030B [0x89 0x03 0x2C ] */ ldlayer 1, LAYER_032C +/* 0x030E [0xFD 0x84 0x7E ] */ delay FRAMERATE_CONST(1150, 1380) +/* 0x0311 [0xFF ] */ end + +.layer LAYER_0312 +/* 0x0312 [0xC6 0x03 ] */ instr SF1_INST_3 +/* 0x0314 [0xCB 0x09 0x16 0xDD ] */ env ENVELOPE_0916, 221 +/* 0x0318 [0x2D 0x64 0x5A 0x32 ] */ notedvg PITCH_GF4, FRAMERATE_CONST(100, 120), 90, 50 +/* 0x031C [0xC7 0x81 0x30 0xFF ] */ portamento 0x81, PITCH_A4, 255 +/* 0x0320 [0x67 0x64 0x5A ] */ notedv PITCH_C4, FRAMERATE_CONST(100, 120), 90 +/* 0x0323 [0xC7 0x81 0x32 0x64 ] */ portamento 0x81, PITCH_B4, 100 +/* 0x0327 [0x4F 0x81 0xF4 0x5A ] */ notedv PITCH_C2, FRAMERATE_CONST(500, 600), 90 +/* 0x032B [0xFF ] */ end + +.layer LAYER_032C +/* 0x032C [0xC6 0x29 ] */ instr SF1_INST_41 +/* 0x032E [0xCF 0xDD ] */ releaserate 221 +/* 0x0330 [0x2B 0x64 0x5A 0x32 ] */ notedvg PITCH_E4, FRAMERATE_CONST(100, 120), 90, 50 +/* 0x0334 [0xC7 0x81 0x2E 0xFF ] */ portamento 0x81, PITCH_G4, 255 +/* 0x0338 [0x66 0x64 0x5A ] */ notedv PITCH_B3, FRAMERATE_CONST(100, 120), 90 +/* 0x033B [0xC7 0x81 0x30 0x64 ] */ portamento 0x81, PITCH_A4, 100 +/* 0x033F [0x4E 0x81 0xF4 0x5A ] */ notedv PITCH_B1, FRAMERATE_CONST(500, 600), 90 +/* 0x0343 [0xFF ] */ end + +.channel CHAN_0344 +/* 0x0344 [0xC4 ] */ noshort +/* 0x0345 [0xCA 0x20 ] */ mutebhv 0x20 +/* 0x0347 [0xD0 0x80 ] */ effects TRUE, 0, 0, 0, 0, 0 +/* 0x0349 [0xE9 0x0E ] */ notepri 0, 14 +/* 0x034B [0xE5 0x01 ] */ reverbidx 1 +/* 0x034D [0xD4 0x0F ] */ reverb 15 +/* 0x034F [0x88 0x03 0x6A ] */ ldlayer 0, LAYER_036A +/* 0x0352 [0x89 0x03 0x75 ] */ ldlayer 1, LAYER_0375 +/* 0x0355 [0xC6 0x01 ] */ font Soundfont_1_ID +/* 0x0357 [0xD7 0x60 ] */ vibfreq 96 +/* 0x0359 [0xD8 0x54 ] */ vibdepth 84 +/* 0x035B [0xDB 0xF4 ] */ transpose -12 +/* 0x035D [0xFD 0x81 0x02 ] */ delay FRAMERATE_CONST(258, 310) +/* 0x0360 [0xDB 0x04 ] */ transpose 4 +/* 0x0362 [0xFD 0x84 0x7E ] */ delay FRAMERATE_CONST(1150, 1380) +CHAN_0365: +/* 0x0365 [0xFE ] */ delay1 +/* 0x0366 [0x80 ] */ testlayer 0 +/* 0x0367 [0xF3 0xFC ] */ rbeqz CHAN_0365 +/* 0x0369 [0xFF ] */ end + +.layer LAYER_036A +/* 0x036A [0xC2 0xFC ] */ transpose -4 +/* 0x036C [0xC6 0x13 ] */ instr SF1_INST_19 +/* 0x036E [0xCB 0x09 0x1E 0xC8 ] */ env ENVELOPE_091E, 200 +/* 0x0372 [0xFB 0x02 0xB6 ] */ jump LAYER_02B6 + +.layer LAYER_0375 +/* 0x0375 [0xC2 0x04 ] */ transpose 4 +/* 0x0377 [0xC6 0x12 ] */ instr SF1_INST_18 +/* 0x0379 [0xCB 0x09 0x1E 0xC8 ] */ env ENVELOPE_091E, 200 +/* 0x037D [0xFB 0x02 0xCB ] */ jump LAYER_02CB + +.channel CHAN_0380 +/* 0x0380 [0xD4 0x28 ] */ reverb 40 +/* 0x0382 [0x88 0x03 0x8E ] */ ldlayer 0, LAYER_038E +/* 0x0385 [0x89 0x03 0x8C ] */ ldlayer 1, LAYER_038C +/* 0x0388 [0x8A 0x03 0x9D ] */ ldlayer 2, LAYER_039D +/* 0x038B [0xFF ] */ end + +.layer LAYER_038C +/* 0x038C [0xC2 0xFC ] */ transpose -4 +.layer LAYER_038E +/* 0x038E [0xC6 0x3C ] */ instr SF0_INST_60 +/* 0x0390 [0xCB 0x07 0x8A 0xF1 ] */ env ENVELOPE_078A, 241 +/* 0x0394 [0xC7 0x81 0x03 0xE0 ] */ portamento 0x81, PITCH_C1, 224 +/* 0x0398 [0x72 0x80 0xC6 0x50 ] */ notedv PITCH_B4, FRAMERATE_CONST(198, 238), 80 +/* 0x039C [0xFF ] */ end + +.layer LAYER_039D +/* 0x039D [0xC6 0x0E ] */ instr SF0_INST_14 +/* 0x039F [0xCB 0x08 0x6E 0xDD ] */ env ENVELOPE_086E, 221 +/* 0x03A3 [0xC2 0x0C ] */ transpose 12 +/* 0x03A5 [0xC7 0x81 0x02 0xFF ] */ portamento 0x81, PITCH_B0, 255 +/* 0x03A9 [0x7E 0x80 0xFA 0x55 ] */ notedv PITCH_B5, FRAMERATE_CONST(250, 300), 85 +/* 0x03AD [0xFF ] */ end + +.channel CHAN_03AE +/* 0x03AE [0xC1 0x2E ] */ instr SF0_INST_46 +/* 0x03B0 [0xD4 0x28 ] */ reverb 40 +/* 0x03B2 [0x88 0x03 0xC5 ] */ ldlayer 0, LAYER_03C5 +/* 0x03B5 [0x89 0x03 0xD7 ] */ ldlayer 1, LAYER_03D7 +/* 0x03B8 [0x8A 0x03 0xDB ] */ ldlayer 2, LAYER_03DB +/* 0x03BB [0x8B 0x03 0xEC ] */ ldlayer 3, LAYER_03EC +/* 0x03BE [0xE2 0xFF 0x3C 0x0A ] */ vibdepthgrad 255, 60, 10 +/* 0x03C2 [0xD7 0x96 ] */ vibfreq 150 +/* 0x03C4 [0xFF ] */ end + +.layer LAYER_03C5 +/* 0x03C5 [0xC6 0x46 ] */ instr SF0_INST_70 +/* 0x03C7 [0xCB 0x06 0xCE 0xF5 ] */ env ENVELOPE_06CE, 245 +/* 0x03CB [0xC7 0x82 0x1B 0xFF ] */ portamento 0x82, PITCH_C3, 255 +/* 0x03CF [0x67 0x80 0x96 0x50 ] */ notedv PITCH_C4, FRAMERATE_CONST(150, 180), 80 +/* 0x03D3 [0xC0 0x80 0x96 ] */ ldelay FRAMERATE_CONST(150, 180) +/* 0x03D6 [0xFF ] */ end + +.layer LAYER_03D7 +/* 0x03D7 [0x5B 0x64 0x55 ] */ notedv PITCH_C3, FRAMERATE_CONST(100, 120), 85 +/* 0x03DA [0xFF ] */ end + +.layer LAYER_03DB +/* 0x03DB [0xC2 0x18 ] */ transpose 24 +/* 0x03DD [0xC6 0x0C ] */ instr SF0_INST_12 +/* 0x03DF [0xCB 0x07 0x8A 0xC8 ] */ env ENVELOPE_078A, 200 +/* 0x03E3 [0xC7 0x82 0x33 0xB4 ] */ portamento 0x82, PITCH_C5, 180 +/* 0x03E7 [0x7E 0x80 0xB4 0x4B ] */ notedv PITCH_B5, FRAMERATE_CONST(180, 216), 75 +/* 0x03EB [0xFF ] */ end + +.layer LAYER_03EC +/* 0x03EC [0xC6 0x2A ] */ instr SF0_INST_42 +/* 0x03EE [0xC7 0x81 0x22 0xD0 ] */ portamento 0x81, PITCH_G3, 208 +/* 0x03F2 [0x5D 0x80 0xF0 0x69 ] */ notedv PITCH_D3, FRAMERATE_CONST(240, 288), 105 +/* 0x03F6 [0xFF ] */ end + +#if !OOT_PAL_N64 +/* 0x03F7 [0xC6 0x27 ] */ instr SF0_INST_39 +/* 0x03F9 [0xC7 0x81 0x0A 0x2C ] */ portamento 0x81, PITCH_G1, 44 +/* 0x03FD [0x56 0x80 0x8C 0x4B ] */ notedv PITCH_G2, FRAMERATE_CONST(140, 168), 75 +/* 0x0401 [0xFF ] */ end +#endif + +.channel CHAN_0402 +/* 0x0402 [0xDC 0x30 ] */ panweight 48 +/* 0x0404 [0xDF 0x4E ] */ vol 78 +/* 0x0406 [0xD4 0x37 ] */ reverb 55 +/* 0x0408 [0x21 0x04 0x67 ] */ ldchan 1, CHAN_0467 +/* 0x040B [0x88 0x04 0x4C ] */ ldlayer 0, LAYER_044C +/* 0x040E [0x89 0x04 0x24 ] */ ldlayer 1, LAYER_0424 +/* 0x0411 [0x8A 0x04 0x45 ] */ ldlayer 2, LAYER_0445 +/* 0x0414 [0x8B 0x04 0x3B ] */ ldlayer 3, LAYER_043B +/* 0x0417 [0xD7 0x14 ] */ vibfreq 20 +/* 0x0419 [0xD8 0x46 ] */ vibdepth 70 +/* 0x041B [0xFD 0x60 ] */ delay FRAMERATE_CONST(96, 115) +/* 0x041D [0xE1 0x14 0x96 0x3C ] */ vibfreqgrad 20, 150, 60 +/* 0x0421 [0xD8 0x46 ] */ vibdepth 70 +/* 0x0423 [0xFF ] */ end + +.layer LAYER_0424 +/* 0x0424 [0xC6 0x4A ] */ instr SF0_INST_74 +/* 0x0426 [0xCB 0x07 0x8A 0xD3 ] */ env ENVELOPE_078A, 211 +/* 0x042A [0xC4 ] */ legato +/* 0x042B [0xC7 0x85 0x03 0xFF ] */ portamento 0x85, PITCH_C1, 255 +/* 0x042F [0x54 0x60 0x64 ] */ notedv PITCH_F2, FRAMERATE_CONST(96, 115), 100 +/* 0x0432 [0x54 0x80 0xC8 0x64 ] */ notedv PITCH_F2, FRAMERATE_CONST(200, 240), 100 +/* 0x0436 [0x60 0x81 0x2C 0x4A ] */ notedv PITCH_F3, FRAMERATE_CONST(300, 360), 74 +/* 0x043A [0xFF ] */ end + +.layer LAYER_043B +/* 0x043B [0xC6 0x52 ] */ instr SF0_INST_82 +/* 0x043D [0xC2 0x18 ] */ transpose 24 +/* 0x043F [0xCA 0x58 ] */ notepan 88 +/* 0x0441 [0xC0 0x04 ] */ ldelay FRAMERATE_CONST(4, 5) +/* 0x0443 [0xF4 0x0D ] */ rjump LAYER_0452 + +.layer LAYER_0445 +/* 0x0445 [0xC2 0xEE ] */ transpose -18 +/* 0x0447 [0xC6 0x34 ] */ instr SF0_INST_52 +/* 0x0449 [0xFB 0x04 0x52 ] */ jump LAYER_0452 + +.layer LAYER_044C +/* 0x044C [0xC6 0x44 ] */ instr SF0_INST_68 +/* 0x044E [0xC2 0x0C ] */ transpose 12 +/* 0x0450 [0xCA 0x28 ] */ notepan 40 +LAYER_0452: +/* 0x0452 [0xCB 0x07 0x8A 0xD3 ] */ env ENVELOPE_078A, 211 +/* 0x0456 [0xC4 ] */ legato +/* 0x0457 [0xC7 0x85 0x0F 0xFF ] */ portamento 0x85, PITCH_C2, 255 +/* 0x045B [0x60 0x60 0x4A ] */ notedv PITCH_F3, FRAMERATE_CONST(96, 115), 74 +/* 0x045E [0x60 0x80 0xC8 0x4A ] */ notedv PITCH_F3, FRAMERATE_CONST(200, 240), 74 +/* 0x0462 [0x6C 0x81 0x2C 0x4A ] */ notedv PITCH_F4, FRAMERATE_CONST(300, 360), 74 +/* 0x0466 [0xFF ] */ end + +.channel CHAN_0467 +/* 0x0467 [0xC4 ] */ noshort +/* 0x0468 [0xCA 0x20 ] */ mutebhv 0x20 +/* 0x046A [0xD0 0x80 ] */ effects TRUE, 0, 0, 0, 0, 0 +/* 0x046C [0xE9 0x0E ] */ notepri 0, 14 +/* 0x046E [0xE5 0x01 ] */ reverbidx 1 +/* 0x0470 [0xD4 0x28 ] */ reverb 40 +/* 0x0472 [0xC6 0x00 ] */ font Soundfont_0_ID +/* 0x0474 [0xFC 0x01 0x56 ] */ call CHAN_0156 +/* 0x0477 [0xFD 0x60 ] */ delay 96 +/* 0x0479 [0xFC 0x01 0x56 ] */ call CHAN_0156 +/* 0x047C [0x89 0x04 0x86 ] */ ldlayer 1, LAYER_0486 +/* 0x047F [0x8B 0x04 0x98 ] */ ldlayer 3, LAYER_0498 +/* 0x0482 [0xFD 0x83 0xE8 ] */ delay FRAMERATE_CONST(1000, 1200) +/* 0x0485 [0xFF ] */ end + +.layer LAYER_0486 +/* 0x0486 [0xC6 0x0C ] */ instr SF0_INST_12 +/* 0x0488 [0xCB 0x07 0x8A 0xE7 ] */ env ENVELOPE_078A, 231 +/* 0x048C [0xC0 0x80 0x96 ] */ ldelay FRAMERATE_CONST(150, 180) +/* 0x048F [0xC7 0x81 0x1B 0xFF ] */ portamento 0x81, PITCH_C3, 255 +/* 0x0493 [0x73 0x81 0xB8 0x2D ] */ notedv PITCH_C5, FRAMERATE_CONST(440, 528), 45 +/* 0x0497 [0xFF ] */ end + +.layer LAYER_0498 +/* 0x0498 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x049A [0xCB 0x07 0x92 0xE7 ] */ env ENVELOPE_0792, 231 +/* 0x049E [0xC0 0x80 0xDC ] */ ldelay FRAMERATE_CONST(220, 264) +/* 0x04A1 [0xC7 0x81 0x0F 0xFF ] */ portamento 0x81, PITCH_C2, 255 +/* 0x04A5 [0x5B 0x81 0x72 0x6E ] */ notedv PITCH_C3, FRAMERATE_CONST(370, 444), 110 +/* 0x04A9 [0xFF ] */ end + +.channel CHAN_04AA +/* 0x04AA [0x21 0x04 0xBC ] */ ldchan 1, CHAN_04BC +/* 0x04AD [0xDF 0x69 ] */ vol 105 +/* 0x04AF [0x88 0x05 0x45 ] */ ldlayer 0, LAYER_0545 +/* 0x04B2 [0x89 0x05 0x36 ] */ ldlayer 1, LAYER_0536 +/* 0x04B5 [0x8A 0x05 0x71 ] */ ldlayer 2, LAYER_0571 +/* 0x04B8 [0x8B 0x05 0x66 ] */ ldlayer 3, LAYER_0566 +/* 0x04BB [0xFF ] */ end + +.channel CHAN_04BC +/* 0x04BC [0xC4 ] */ noshort +/* 0x04BD [0xCA 0x20 ] */ mutebhv 0x20 +/* 0x04BF [0xD0 0x80 ] */ effects TRUE, 0, 0, 0, 0, 0 +/* 0x04C1 [0xE9 0x0E ] */ notepri 0, 14 +/* 0x04C3 [0xE5 0x01 ] */ reverbidx 1 +/* 0x04C5 [0xD4 0x28 ] */ reverb 40 +/* 0x04C7 [0xDF 0x69 ] */ vol 105 +/* 0x04C9 [0xDC 0x40 ] */ panweight 64 +/* 0x04CB [0x88 0x04 0xF5 ] */ ldlayer 0, LAYER_04F5 +/* 0x04CE [0x89 0x04 0xDB ] */ ldlayer 1, LAYER_04DB +/* 0x04D1 [0x8A 0x05 0x14 ] */ ldlayer 2, LAYER_0514 +/* 0x04D4 [0x8B 0x05 0x0E ] */ ldlayer 3, LAYER_050E +/* 0x04D7 [0xFD 0x93 0x88 ] */ delay FRAMERATE_CONST(5000, 6000) +/* 0x04DA [0xFF ] */ end + +.layer LAYER_04DB +/* 0x04DB [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x04DD [0xCB 0x07 0x92 0xDD ] */ env ENVELOPE_0792, 221 +/* 0x04E1 [0xCD 0x14 ] */ stereo 1, 0, 1, 0, 0 +/* 0x04E3 [0xCA 0x54 ] */ notepan 84 +/* 0x04E5 [0x54 0x80 0x91 0x48 ] */ notedv PITCH_F2, FRAMERATE_CONST(145, 174), 72 +LAYER_04E9: +/* 0x04E9 [0x5D 0x5A 0x46 ] */ notedv PITCH_D3, FRAMERATE_CONST(90, 108), 70 +/* 0x04EC [0x60 0x80 0xE1 0x4A ] */ notedv PITCH_F3, FRAMERATE_CONST(225, 270), 74 +/* 0x04F0 [0x58 0x61 0x44 ] */ notedv PITCH_A2, FRAMERATE_CONST(97, 116), 68 +/* 0x04F3 [0xF4 0xF4 ] */ rjump LAYER_04E9 + +.layer LAYER_04F5 +/* 0x04F5 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x04F7 [0xCB 0x07 0x92 0xDD ] */ env ENVELOPE_0792, 221 +/* 0x04FB [0xCD 0x14 ] */ stereo 1, 0, 1, 0, 0 +/* 0x04FD [0xCA 0x2C ] */ notepan 44 +/* 0x04FF [0x5D 0x81 0x0B 0x48 ] */ notedv PITCH_D3, FRAMERATE_CONST(267, 320), 72 +LAYER_0503: +/* 0x0503 [0x5B 0x5E 0x28 ] */ notedv PITCH_C3, FRAMERATE_CONST(94, 113), 40 +/* 0x0506 [0x5D 0x7C 0x2C ] */ notedv PITCH_D3, FRAMERATE_CONST(124, 149), 44 +/* 0x0509 [0x5A 0x30 0x44 ] */ notedv PITCH_B2, FRAMERATE_CONST(48, 58), 68 +/* 0x050C [0xF4 0xF5 ] */ rjump LAYER_0503 + +.layer LAYER_050E +/* 0x050E [0xC2 0xF4 ] */ transpose -12 +/* 0x0510 [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x0512 [0xF4 0x06 ] */ rjump LAYER_051A + +.layer LAYER_0514 +/* 0x0514 [0xC6 0x2F ] */ instr SF0_INST_47 +/* 0x0516 [0xCB 0x07 0x1E 0xE6 ] */ env ENVELOPE_071E, 230 +LAYER_051A: +/* 0x051A [0xC0 0x8A 0x82 ] */ ldelay FRAMERATE_CONST(2690, 2854) +/* 0x051D [0xC7 0x81 0x37 0x3C ] */ portamento 0x81, PITCH_E5, 60 +/* 0x0521 [0x4F 0x80 0xC0 0x64 ] */ notedv PITCH_C2, FRAMERATE_CONST(192, 230), 100 +/* 0x0525 [0xC7 0x81 0x3A 0x3C ] */ portamento 0x81, PITCH_G5, 60 +/* 0x0529 [0x53 0x80 0xC0 0x64 ] */ notedv PITCH_E2, FRAMERATE_CONST(192, 230), 100 +/* 0x052D [0xC7 0x81 0x3E 0x2D ] */ portamento 0x81, PITCH_B5, 45 +/* 0x0531 [0x56 0x81 0xF4 0x64 ] */ notedv PITCH_G2, FRAMERATE_CONST(500, 600), 100 +/* 0x0535 [0xFF ] */ end + +.layer LAYER_0536 +/* 0x0536 [0xC2 0xFA ] */ transpose -6 +/* 0x0538 [0xFC 0x05 0x52 ] */ call LAYER_0552 +/* 0x053B [0xC5 ] */ nolegato +/* 0x053C [0xC8 ] */ noportamento +/* 0x053D [0xC6 0x41 ] */ instr SF0_INST_65 +/* 0x053F [0xC0 0x14 ] */ ldelay FRAMERATE_CONST(20, 24) +/* 0x0541 [0xC2 0xFD ] */ transpose -3 +/* 0x0543 [0xF4 0x44 ] */ rjump LAYER_0589 + +.layer LAYER_0545 +/* 0x0545 [0xFC 0x05 0x52 ] */ call LAYER_0552 +/* 0x0548 [0xC5 ] */ nolegato +/* 0x0549 [0xC8 ] */ noportamento +/* 0x054A [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x054C [0xC0 0x0A ] */ ldelay FRAMERATE_CONST(10, 12) +/* 0x054E [0xC2 0x0A ] */ transpose 10 +/* 0x0550 [0xF4 0x37 ] */ rjump LAYER_0589 + +.layer LAYER_0552 +/* 0x0552 [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x0554 [0xCB 0x07 0x92 0xD3 ] */ env ENVELOPE_0792, 211 +/* 0x0558 [0xC4 ] */ legato +/* 0x0559 [0xC7 0x85 0x33 0xFF ] */ portamento 0x85, PITCH_C5, 255 +/* 0x055D [0x77 0x80 0xC8 0x5A ] */ notedv PITCH_E5, FRAMERATE_CONST(200, 240), 90 +/* 0x0561 [0x7A 0x89 0x79 0x50 ] */ notedv PITCH_G5, FRAMERATE_CONST(2425, 2910), 80 +/* 0x0565 [0xFF ] */ end + +.layer LAYER_0566 +/* 0x0566 [0xC2 0x05 ] */ transpose 5 +/* 0x0568 [0xFC 0x05 0x81 ] */ call LAYER_0581 +/* 0x056B [0xC0 0x14 ] */ ldelay FRAMERATE_CONST(20, 24) +/* 0x056D [0xC6 0x4D ] */ instr SF0_INST_77 +/* 0x056F [0xF4 0x18 ] */ rjump LAYER_0589 + +.layer LAYER_0571 +/* 0x0571 [0xFC 0x05 0x81 ] */ call LAYER_0581 +/* 0x0574 [0xC6 0x41 ] */ instr SF0_INST_65 +/* 0x0576 [0xF4 0x11 ] */ rjump LAYER_0589 + +/* 0x0578 [0xCB 0x07 0x92 0xC8 ] */ env ENVELOPE_0792, 200 +/* 0x057C [0xC4 ] */ legato +/* 0x057D [0xC7 0x81 0x11 0xFF ] */ portamento 0x81, PITCH_D2, 255 +.layer LAYER_0581 +/* 0x0581 [0xC6 0x36 ] */ instr SF0_INST_54 +/* 0x0583 [0x58 0x8A 0x41 0x41 ] */ notedv PITCH_A2, FRAMERATE_CONST(2625, 2920), 65 +/* 0x0587 [0xC5 ] */ nolegato +/* 0x0588 [0xFF ] */ end + +LAYER_0589: +/* 0x0589 [0x5F 0x80 0xC0 0x78 ] */ notedv PITCH_E3, FRAMERATE_CONST(192, 230), 120 +/* 0x058D [0x62 0x80 0xC0 0x78 ] */ notedv PITCH_G3, FRAMERATE_CONST(192, 230), 120 +/* 0x0591 [0xCF 0xA0 ] */ releaserate 160 +/* 0x0593 [0x64 0x80 0xC0 0x78 ] */ notedv PITCH_A3, FRAMERATE_CONST(192, 230), 120 +/* 0x0597 [0xFF ] */ end + +.channel CHAN_0598 +/* 0x0598 [0xDF 0x6E ] */ vol 110 +/* 0x059A [0xC1 0x7E ] */ instr FONTANY_INSTR_SFX +/* 0x059C [0xB0 0x05 0xB0 ] */ ldfilter FILTER_05B0 +/* 0x059F [0xB3 0x40 ] */ filter 4, 0 +/* 0x05A1 [0xD4 0x28 ] */ reverb 40 +/* 0x05A3 [0xED 0x19 ] */ gain 25 +/* 0x05A5 [0x88 0x05 0xA9 ] */ ldlayer 0, LAYER_05A9 +/* 0x05A8 [0xFF ] */ end + +.layer LAYER_05A9 +/* 0x05A9 [0x6C 0x00 0x6E ] */ notedv PITCH_F4, 0, 110 +/* 0x05AC [0xFF ] */ end + +.filter FILTER_05B0 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.channel CHAN_05C0 +/* 0x05C0 [0xC1 0x7F ] */ instr FONTANY_INSTR_DRUM +/* 0x05C2 [0xDA 0x09 0x0A ] */ env ENVELOPE_090A +/* 0x05C5 [0xD9 0xC8 ] */ releaserate 200 +/* 0x05C7 [0xDC 0x00 ] */ panweight 0 +/* 0x05C9 [0x88 0x05 0xDA ] */ ldlayer 0, LAYER_05DA +/* 0x05CC [0x89 0x05 0xE0 ] */ ldlayer 1, LAYER_05E0 +/* 0x05CF [0x21 0x05 0xE6 ] */ ldchan 1, CHAN_05E6 +/* 0x05D2 [0xFD 0x87 0x08 ] */ delay FRAMERATE_CONST(1800, 2160) +/* 0x05D5 [0x90 ] */ dellayer 0 +/* 0x05D6 [0x91 ] */ dellayer 1 +/* 0x05D7 [0xFD 0x64 ] */ delay FRAMERATE_CONST(100, 120) +/* 0x05D9 [0xFF ] */ end + +.layer LAYER_05DA +/* 0x05DA [0xC4 ] */ legato +LAYER_05DB: +/* 0x05DB [0x43 0x64 0x50 ] */ notedv PITCH_C1, FRAMERATE_CONST(100, 120), 80 +/* 0x05DE [0xF4 0xFB ] */ rjump LAYER_05DB + +.layer LAYER_05E0 +/* 0x05E0 [0xC4 ] */ legato +LAYER_05E1: +/* 0x05E1 [0x42 0x64 0x50 ] */ notedv PITCH_B0, FRAMERATE_CONST(100, 120), 80 +/* 0x05E4 [0xF4 0xFB ] */ rjump LAYER_05E1 + +.channel CHAN_05E6 +/* 0x05E6 [0xC4 ] */ noshort +/* 0x05E7 [0xCA 0x20 ] */ mutebhv 0x20 +/* 0x05E9 [0xD0 0x80 ] */ effects TRUE, 0, 0, 0, 0, 0 +/* 0x05EB [0xE9 0x0E ] */ notepri 0, 14 +/* 0x05ED [0xE5 0x01 ] */ reverbidx 1 +/* 0x05EF [0xD4 0x14 ] */ reverb 20 +/* 0x05F1 [0xDF 0x64 ] */ vol 100 +/* 0x05F3 [0xED 0x0F ] */ gain 15 +/* 0x05F5 [0xFD 0x82 0x40 ] */ delay FRAMERATE_CONST(576, 691) +/* 0x05F8 [0x88 0x06 0x33 ] */ ldlayer 0, LAYER_0633 +/* 0x05FB [0x89 0x06 0x2F ] */ ldlayer 1, LAYER_062F +/* 0x05FE [0x8A 0x06 0x3F ] */ ldlayer 2, LAYER_063F +/* 0x0601 [0xDF 0x4B ] */ vol 75 +/* 0x0603 [0xFD 0x80 0xC8 ] */ delay FRAMERATE_CONST(200, 240) +/* 0x0606 [0x88 0x06 0x33 ] */ ldlayer 0, LAYER_0633 +/* 0x0609 [0x89 0x06 0x2F ] */ ldlayer 1, LAYER_062F +/* 0x060C [0x8A 0x06 0x3F ] */ ldlayer 2, LAYER_063F +/* 0x060F [0xDF 0x6E ] */ vol 110 +/* 0x0611 [0xFD 0x80 0x87 ] */ delay FRAMERATE_CONST(135, 162) +/* 0x0614 [0x88 0x06 0x33 ] */ ldlayer 0, LAYER_0633 +/* 0x0617 [0x89 0x06 0x2F ] */ ldlayer 1, LAYER_062F +/* 0x061A [0x8A 0x06 0x3F ] */ ldlayer 2, LAYER_063F +/* 0x061D [0xDF 0x5F ] */ vol 95 +/* 0x061F [0xFD 0x81 0x56 ] */ delay FRAMERATE_CONST(342, 410) +/* 0x0622 [0x88 0x06 0x33 ] */ ldlayer 0, LAYER_0633 +/* 0x0625 [0x89 0x06 0x2F ] */ ldlayer 1, LAYER_062F +/* 0x0628 [0x8A 0x06 0x3F ] */ ldlayer 2, LAYER_063F +/* 0x062B [0xFD 0x80 0xFA ] */ delay FRAMERATE_CONST(250, 300) +/* 0x062E [0xFF ] */ end + +.layer LAYER_062F +/* 0x062F [0xC2 0x24 ] */ transpose 36 +/* 0x0631 [0xF4 0x02 ] */ rjump LAYER_0635 + +.layer LAYER_0633 +/* 0x0633 [0xC2 0x30 ] */ transpose 48 +LAYER_0635: +/* 0x0635 [0xC6 0x4A ] */ instr SF0_INST_74 +/* 0x0637 [0xCB 0x06 0x92 0xC8 ] */ env ENVELOPE_0692, 200 +/* 0x063B [0x6E 0x00 0x6E ] */ notedv PITCH_G4, 0, 110 +/* 0x063E [0xFF ] */ end + +.layer LAYER_063F +/* 0x063F [0xC6 0x46 ] */ instr SF0_INST_70 +/* 0x0641 [0x62 0x32 0x32 ] */ notedv PITCH_G3, FRAMERATE_CONST(50, 60), 50 +/* 0x0644 [0xFF ] */ end + +.table TABLE_0646 + entry CHAN_002E + entry CHAN_0083 + entry CHAN_00D0 + entry CHAN_0113 + entry CHAN_0143 + entry CHAN_0151 + entry CHAN_0156 + entry CHAN_018D + entry CHAN_02D8 + entry CHAN_0300 + entry CHAN_0380 + entry CHAN_03AE + entry CHAN_0402 + entry CHAN_04AA + entry CHAN_0598 + entry CHAN_05C0 + +.envelope ENVELOPE_66A + point 1, 32700 + hang + +ENVELOPE_066E: + point 1, 32700 + point 100, 30000 + point 200, 5000 + hang + +ENVELOPE_067E: + point 1, 32700 + point 25, 25000 + point 100, 25000 + point 200, 5000 + hang + +.envelope ENVELOPE_0692 + point 1, 32700 + point 100, 30000 + point 250, 30000 + point 200, 5000 + hang + +ENVELOPE_06A6: + point 1, 32700 + point 50, 30000 + point 100, 10000 + point 100, 0 + hang + +ENVELOPE_06BA: + point 1, 32700 + point 30, 30000 + point 50, 10000 + point 50, 0 + hang + +.envelope ENVELOPE_06CE + point 1, 32700 + point 70, 30000 + point 120, 10000 + point 120, 0 + hang + +ENVELOPE_06E2: + point 1, 32700 + point 15, 32700 + point 15, 22000 + point 100, 15000 + hang + +.envelope ENVELOPE_06F6 + point 1, 32700 + point 8, 32700 + point 8, 22000 + point 100, 15000 + hang + +ENVELOPE_070A: + point 10, 32700 + hang + +.envelope ENVELOPE_0712 + point 30, 10000 + point 30, 32700 + hang + +.envelope ENVELOPE_071E + point 20, 15000 + point 10, 32700 + hang + +.envelope ENVELOPE_072A + point 48, 10000 + point 32, 32700 + hang + +ENVELOPE_0736: + point 47, 15000 + point 13, 32700 + point 72, 10000 + hang + +.envelope ENVELOPE_0746 + point 6, 32700 + hang + +ENVELOPE_074E: + point 20, 32700 + point 50, 10000 + point 40, 0 + hang + +.envelope ENVELOPE_075E + point 18, 32700 + hang + +ENVELOPE_0766: + point 10, 32700 + point 240, 31000 + point 150, 2000 + hang + +ENVELOPE_0776: + point 14, 15000 + point 13, 32700 + hang + +ENVELOPE_0782: + point 40, 32700 + hang + +.envelope ENVELOPE_078A + point 400, 32700 + hang + +.envelope ENVELOPE_0792 + point 100, 32700 + hang + +ENVELOPE_079A: + point 225, 32700 + point 30, 30000 + hang + +ENVELOPE_07A6: + point 200, 32700 + hang + +ENVELOPE_07AE: + point 3, 32700 + hang + +ENVELOPE_07B6: + point 12, 32700 + point 40, 5000 + hang + +ENVELOPE_07C2: + point 10, 32700 + point 4, 20000 + point 4, 10000 + point 50, 2000 + hang + +ENVELOPE_07D6: + point 40, 32700 + point 150, 32700 + point 300, 0 + hang + +ENVELOPE_07E6: + point 40, 32700 + point 800, 32700 + point 100, 16000 + point 100, 32700 + point 100, 16000 + point 100, 32700 + point 100, 16000 + point 100, 32700 + point 600, 0 + hang + +ENVELOPE_080E: + point 200, 32700 + point 100, 16000 + point 100, 32700 + point 100, 16000 + point 100, 32700 + point 600, 0 + hang + +ENVELOPE_082A: + point 35, 32700 + point 40, 32700 + point 105, 0 + hang + +ENVELOPE_083A: + point 1, 25000 + point 12, 32700 + point 40, 32700 + point 60, 15000 + point 80, 5000 + hang + +ENVELOPE_0852: + point 10, 32700 + point 50, 32700 + point 60, 5000 + hang + +ENVELOPE_0862: + point 200, 32700 + point 340, 0 + hang + +.envelope ENVELOPE_086E + point 400, 32700 + point 400, 20000 + goto 0 + +.envelope ENVELOPE_087A + point 1400, 32700 + point 400, 14000 + point 400, 32700 + goto 1 + +.envelope ENVELOPE_088A + point 25, 32700 + point 490, 12000 + hang + +ENVELOPE_0896: + point 100, 32700 + point 450, 32700 + point 150, 32700 + point 1200, 32700 + point 400, 20000 + hang + +ENVELOPE_08AE: + point 200, 32700 + point 200, 20000 + goto 0 + +ENVELOPE_08BA: + point 2, 25000 + hang + +.envelope ENVELOPE_08C2 + point 1, 32700 + point 712, 32700 + point 900, 0 + hang + +.envelope ENVELOPE_08D2 + point 1, 32700 + point 200, 32700 + point 200, 16000 + point 200, 32700 + point 600, 0 + hang + +.envelope ENVELOPE_08EA + point 140, 20000 + point 2540, 10000 +#if !OOT_PAL_N64 + point 200, 32700 +#else + point 160, 32700 +#endif + point 720, 20000 + point 240, 27000 + point 20, 16000 + point 940, 32700 + hang + +#if OOT_PAL_N64 +.envelope ENVELOPE_090A_PAL + point 168, 20000 + point 2488, 10000 + point 240, 32700 + point 864, 20000 + point 288, 27000 + point 24, 16000 + point 1128, 32700 + hang +#endif + +.envelope ENVELOPE_090A + point 100, 20000 + point 400, 32700 + hang + +.envelope ENVELOPE_0916 + point 50, 32700 + hang + +.envelope ENVELOPE_091E + point 500, 25000 + point 675, 30000 + point 800, 25000 + point 20, 20000 + hang + +#if !OOT_PAL_N64 +.filter FILTER_0932 + filter 0, 0, 0, 0, 0, 0, 0, 0 + +.filter FILTER_0942 + filter 0, 0, 0, 0, 0, 0, 0, 0 +#endif + +.endseq Sequence_109 diff --git a/assets/audio/sequences/seq_2.prg.seq b/assets/audio/sequences/seq_2.prg.seq new file mode 100644 index 0000000000..4e967b0424 --- /dev/null +++ b/assets/audio/sequences/seq_2.prg.seq @@ -0,0 +1,208 @@ +#include "aseq.h" +#include "Soundfont_3.h" + +.startseq Sequence_2 + +.sequence SEQ_0000 +/* 0x0000 [0xD3 0x20 ] */ mutebhv 0x20 +/* 0x0002 [0xD5 0x46 ] */ mutescale 70 +/* 0x0004 [0xD7 0xFF 0xFF ] */ initchan 0b1111111111111111 +/* 0x0007 [0xCC 0x00 ] */ ldi 0 +/* 0x0009 [0x73 ] */ stio IO_PORT_3 +/* 0x000A [0x76 ] */ stio IO_PORT_6 +/* 0x000B [0xCC 0xFF ] */ ldi 255 +/* 0x000D [0x75 ] */ stio IO_PORT_5 +/* 0x000E [0x80 ] */ ldio IO_PORT_0 +/* 0x000F [0xC8 0x01 ] */ sub 1 +/* 0x0011 [0xF3 0x07 ] */ rbeqz SEQ_001A +/* 0x0013 [0xCC 0x03 ] */ ldi 3 +/* 0x0015 [0xFC 0x00 0xC4 ] */ call SEQ_00C4 +/* 0x0018 [0xF4 0x05 ] */ rjump SEQ_001F + +SEQ_001A: +/* 0x001A [0xCC 0x31 ] */ ldi 49 +/* 0x001C [0xFC 0x00 0xC4 ] */ call SEQ_00C4 +SEQ_001F: +/* 0x001F [0xCC 0x00 ] */ ldi 0 +/* 0x0021 [0x74 ] */ stio IO_PORT_4 +/* 0x0022 [0x82 ] */ ldio IO_PORT_2 +/* 0x0023 [0xF2 0x0E ] */ rbltz SEQ_0033 +/* 0x0025 [0x53 ] */ subio IO_PORT_3 +/* 0x0026 [0xF3 0x0B ] */ rbeqz SEQ_0033 +/* 0x0028 [0x82 ] */ ldio IO_PORT_2 +/* 0x0029 [0x73 ] */ stio IO_PORT_3 +/* 0x002A [0xC8 0x01 ] */ sub 1 +/* 0x002C [0xF3 0x22 ] */ rbeqz SEQ_0050 +/* 0x002E [0x82 ] */ ldio IO_PORT_2 +/* 0x002F [0xC8 0x02 ] */ sub 2 +/* 0x0031 [0xF3 0x53 ] */ rbeqz SEQ_0086 +SEQ_0033: +/* 0x0033 [0xCE 0x0B ] */ rand 11 +/* 0x0035 [0x55 ] */ subio IO_PORT_5 +/* 0x0036 [0xF3 0x04 ] */ rbeqz SEQ_003C +/* 0x0038 [0xCE 0x0B ] */ rand 11 +/* 0x003A [0xF4 0x0C ] */ rjump SEQ_0048 + +SEQ_003C: +/* 0x003C [0xCE 0x0B ] */ rand 11 +/* 0x003E [0xF3 0x04 ] */ rbeqz SEQ_0044 +/* 0x0040 [0xC8 0x01 ] */ sub 1 +/* 0x0042 [0xF4 0x04 ] */ rjump SEQ_0048 + +SEQ_0044: +/* 0x0044 [0xCC 0x0B ] */ ldi 11 +/* 0x0046 [0xC8 0x01 ] */ sub 1 +SEQ_0048: +/* 0x0048 [0x75 ] */ stio IO_PORT_5 +/* 0x0049 [0xC8 0xFC ] */ sub 252 +/* 0x004B [0xFC 0x00 0xC4 ] */ call SEQ_00C4 +/* 0x004E [0xF4 0xCF ] */ rjump SEQ_001F + +SEQ_0050: +/* 0x0050 [0xCC 0x01 ] */ ldi 1 +/* 0x0052 [0x74 ] */ stio IO_PORT_4 +/* 0x0053 [0xCC 0xFF ] */ ldi 255 +/* 0x0055 [0x75 ] */ stio IO_PORT_5 +/* 0x0056 [0xCC 0x0F ] */ ldi 15 +/* 0x0058 [0xFC 0x00 0xC4 ] */ call SEQ_00C4 +SEQ_005B: +/* 0x005B [0x82 ] */ ldio IO_PORT_2 +/* 0x005C [0xF2 0x0B ] */ rbltz SEQ_0069 +/* 0x005E [0x53 ] */ subio IO_PORT_3 +/* 0x005F [0xF3 0x08 ] */ rbeqz SEQ_0069 +/* 0x0061 [0x82 ] */ ldio IO_PORT_2 +/* 0x0062 [0x73 ] */ stio IO_PORT_3 +/* 0x0063 [0xF3 0xBA ] */ rbeqz SEQ_001F +/* 0x0065 [0xC8 0x02 ] */ sub 2 +/* 0x0067 [0xF3 0x1D ] */ rbeqz SEQ_0086 +SEQ_0069: +/* 0x0069 [0xCE 0x04 ] */ rand 4 +/* 0x006B [0x55 ] */ subio IO_PORT_5 +/* 0x006C [0xF3 0x04 ] */ rbeqz SEQ_0072 +/* 0x006E [0xCE 0x04 ] */ rand 4 +/* 0x0070 [0xF4 0x0C ] */ rjump SEQ_007E + +SEQ_0072: +/* 0x0072 [0xCE 0x04 ] */ rand 4 +/* 0x0074 [0xF3 0x04 ] */ rbeqz SEQ_007A +/* 0x0076 [0xC8 0x01 ] */ sub 1 +/* 0x0078 [0xF4 0x04 ] */ rjump SEQ_007E + +SEQ_007A: +/* 0x007A [0xCC 0x04 ] */ ldi 4 +/* 0x007C [0xC8 0x01 ] */ sub 1 +SEQ_007E: +/* 0x007E [0x75 ] */ stio IO_PORT_5 +/* 0x007F [0xC8 0xF0 ] */ sub 240 +/* 0x0081 [0xFC 0x00 0xC4 ] */ call SEQ_00C4 +/* 0x0084 [0xF4 0xD5 ] */ rjump SEQ_005B + +SEQ_0086: +/* 0x0086 [0xCC 0x02 ] */ ldi 2 +/* 0x0088 [0x74 ] */ stio IO_PORT_4 +/* 0x0089 [0xCC 0xFF ] */ ldi 255 +/* 0x008B [0x75 ] */ stio IO_PORT_5 +/* 0x008C [0xCC 0x14 ] */ ldi 20 +/* 0x008E [0xFC 0x00 0xC4 ] */ call SEQ_00C4 +SEQ_0091: +/* 0x0091 [0x82 ] */ ldio IO_PORT_2 +/* 0x0092 [0xF2 0x0B ] */ rbltz SEQ_009F +/* 0x0094 [0x53 ] */ subio IO_PORT_3 +/* 0x0095 [0xF3 0x08 ] */ rbeqz SEQ_009F +/* 0x0097 [0x82 ] */ ldio IO_PORT_2 +/* 0x0098 [0x73 ] */ stio IO_PORT_3 +/* 0x0099 [0xF3 0x84 ] */ rbeqz SEQ_001F +/* 0x009B [0xC8 0x01 ] */ sub 1 +/* 0x009D [0xF3 0xB1 ] */ rbeqz SEQ_0050 +SEQ_009F: +/* 0x009F [0xCE 0x03 ] */ rand 3 +/* 0x00A1 [0x55 ] */ subio IO_PORT_5 +/* 0x00A2 [0xF3 0x04 ] */ rbeqz SEQ_00A8 +/* 0x00A4 [0xCE 0x03 ] */ rand 3 +/* 0x00A6 [0xF4 0x0C ] */ rjump SEQ_00B4 + +SEQ_00A8: +/* 0x00A8 [0xCE 0x03 ] */ rand 3 +/* 0x00AA [0xF3 0x04 ] */ rbeqz SEQ_00B0 +/* 0x00AC [0xC8 0x01 ] */ sub 1 +/* 0x00AE [0xF4 0x04 ] */ rjump SEQ_00B4 + +SEQ_00B0: +/* 0x00B0 [0xCC 0x03 ] */ ldi 3 +/* 0x00B2 [0xC8 0x01 ] */ sub 1 +SEQ_00B4: +/* 0x00B4 [0x75 ] */ stio IO_PORT_5 +/* 0x00B5 [0xC8 0xEB ] */ sub 235 +/* 0x00B7 [0xFC 0x00 0xC4 ] */ call SEQ_00C4 +/* 0x00BA [0xF4 0xD5 ] */ rjump SEQ_0091 + +.table TABLE_00BC + entry SEQ_00E8 + entry SEQ_00F6 + +.table TABLE_00C0 + entry ARRAY_0110 + entry ARRAY_1308 + +.sequence SEQ_00C4 +/* 0x00C4 [0x77 ] */ stio IO_PORT_7 +/* 0x00C5 [0xCC 0x00 ] */ ldi 0 +/* 0x00C7 [0x70 ] */ stio IO_PORT_0 +/* 0x00C8 [0x86 ] */ ldio IO_PORT_6 +/* 0x00C9 [0xCD 0x00 0xBC ] */ dyncall TABLE_00BC +SEQ_00CC: +/* 0x00CC [0xFE ] */ delay1 +/* 0x00CD [0x00 ] */ testchan 0 +/* 0x00CE [0xF3 0xFC ] */ rbeqz SEQ_00CC +/* 0x00D0 [0x06 ] */ testchan 6 +/* 0x00D1 [0xF3 0xF9 ] */ rbeqz SEQ_00CC +/* 0x00D3 [0x09 ] */ testchan 9 +/* 0x00D4 [0xF3 0xF6 ] */ rbeqz SEQ_00CC +/* 0x00D6 [0x0A ] */ testchan 10 +/* 0x00D7 [0xF3 0xF3 ] */ rbeqz SEQ_00CC +/* 0x00D9 [0x0C ] */ testchan 12 +/* 0x00DA [0xF3 0xF0 ] */ rbeqz SEQ_00CC +/* 0x00DC [0x0E ] */ testchan 14 +/* 0x00DD [0xF3 0xED ] */ rbeqz SEQ_00CC +/* 0x00DF [0x86 ] */ ldio IO_PORT_6 +/* 0x00E0 [0xCD 0x00 0xC0 ] */ dyncall TABLE_00C0 +/* 0x00E3 [0xCC 0x01 ] */ ldi 1 +/* 0x00E5 [0x56 ] */ subio IO_PORT_6 +/* 0x00E6 [0x76 ] */ stio IO_PORT_6 +/* 0x00E7 [0xFF ] */ end + +.sequence SEQ_00E8 +/* 0x00E8 [0x87 ] */ ldio IO_PORT_7 +/* 0x00E9 [0xC7 0x00 0x00 0xF1 ] */ stseq 0, SEQ_00F0 + STSEQ_LDSEQ_SEQ_ID +/* 0x00ED [0xCC 0xFF ] */ ldi 255 +/* 0x00EF [0x71 ] */ stio IO_PORT_1 +SEQ_00F0: +/* 0x00F0 [0xB1 0x02 0x01 0x10 ] */ ldseq 1, NA_BGM_FIELD_LOGIC, ARRAY_0110 +/* 0x00F4 [0xF4 0x0C ] */ rjump SEQ_0102 + +.sequence SEQ_00F6 +/* 0x00F6 [0x87 ] */ ldio IO_PORT_7 +/* 0x00F7 [0xC7 0x00 0x00 0xFF ] */ stseq 0, SEQ_00FE + STSEQ_LDSEQ_SEQ_ID +/* 0x00FB [0xCC 0xFF ] */ ldi 255 +/* 0x00FD [0x71 ] */ stio IO_PORT_1 +SEQ_00FE: +/* 0x00FE [0xB1 0x02 0x13 0x08 ] */ ldseq 1, NA_BGM_FIELD_LOGIC, ARRAY_1308 +SEQ_0102: +/* 0x0102 [0xFE ] */ delay1 +/* 0x0103 [0x81 ] */ ldio IO_PORT_1 +/* 0x0104 [0xF3 0x03 ] */ rbeqz SEQ_0109 +/* 0x0106 [0xF2 0xFA ] */ rbltz SEQ_0102 +/* 0x0108 [0xFF ] */ end + +SEQ_0109: +/* 0x0109 [0xFF ] */ end + +.balign 16 + +.array ARRAY_0110 + .fill 4600 + +.array ARRAY_1308 + .fill 4600 + +.endseq Sequence_2 diff --git a/assets/text/nes_message_data_static.c b/assets/text/nes_message_data_static.c index 6124e07f75..06c415118b 100644 --- a/assets/text/nes_message_data_static.c +++ b/assets/text/nes_message_data_static.c @@ -1,6 +1,7 @@ #define MESSAGE_DATA_STATIC #include "message_data_fmt.h" +#include "versions.h" #define DEFINE_MESSAGE(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage) \ const char _message_##textId##_nes[] = nesMessage; diff --git a/assets/xml/audio/samplebanks/SampleBank_0.xml b/assets/xml/audio/samplebanks/SampleBank_0.xml new file mode 100644 index 0000000000..e90a084930 --- /dev/null +++ b/assets/xml/audio/samplebanks/SampleBank_0.xml @@ -0,0 +1,433 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/samplebanks/SampleBank_2.xml b/assets/xml/audio/samplebanks/SampleBank_2.xml new file mode 100644 index 0000000000..21e76424e2 --- /dev/null +++ b/assets/xml/audio/samplebanks/SampleBank_2.xml @@ -0,0 +1,4 @@ + + + + diff --git a/assets/xml/audio/samplebanks/SampleBank_3.xml b/assets/xml/audio/samplebanks/SampleBank_3.xml new file mode 100644 index 0000000000..e6738f8b39 --- /dev/null +++ b/assets/xml/audio/samplebanks/SampleBank_3.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/xml/audio/samplebanks/SampleBank_4.xml b/assets/xml/audio/samplebanks/SampleBank_4.xml new file mode 100644 index 0000000000..8d68e285ff --- /dev/null +++ b/assets/xml/audio/samplebanks/SampleBank_4.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/xml/audio/samplebanks/SampleBank_5.xml b/assets/xml/audio/samplebanks/SampleBank_5.xml new file mode 100644 index 0000000000..6eb7356935 --- /dev/null +++ b/assets/xml/audio/samplebanks/SampleBank_5.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/xml/audio/samplebanks/SampleBank_6.xml b/assets/xml/audio/samplebanks/SampleBank_6.xml new file mode 100644 index 0000000000..e6971659b0 --- /dev/null +++ b/assets/xml/audio/samplebanks/SampleBank_6.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/xml/audio/sequences/seq_0.xml b/assets/xml/audio/sequences/seq_0.xml new file mode 100644 index 0000000000..d2050652c6 --- /dev/null +++ b/assets/xml/audio/sequences/seq_0.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_1.xml b/assets/xml/audio/sequences/seq_1.xml new file mode 100644 index 0000000000..668006ad5e --- /dev/null +++ b/assets/xml/audio/sequences/seq_1.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_10.xml b/assets/xml/audio/sequences/seq_10.xml new file mode 100644 index 0000000000..7a7d5454a5 --- /dev/null +++ b/assets/xml/audio/sequences/seq_10.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_100.xml b/assets/xml/audio/sequences/seq_100.xml new file mode 100644 index 0000000000..554641913d --- /dev/null +++ b/assets/xml/audio/sequences/seq_100.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_101.xml b/assets/xml/audio/sequences/seq_101.xml new file mode 100644 index 0000000000..a8dc3db486 --- /dev/null +++ b/assets/xml/audio/sequences/seq_101.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_102.xml b/assets/xml/audio/sequences/seq_102.xml new file mode 100644 index 0000000000..264a9fb3b8 --- /dev/null +++ b/assets/xml/audio/sequences/seq_102.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_103.xml b/assets/xml/audio/sequences/seq_103.xml new file mode 100644 index 0000000000..27b66e955b --- /dev/null +++ b/assets/xml/audio/sequences/seq_103.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_104.xml b/assets/xml/audio/sequences/seq_104.xml new file mode 100644 index 0000000000..c0560a0fd3 --- /dev/null +++ b/assets/xml/audio/sequences/seq_104.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_105.xml b/assets/xml/audio/sequences/seq_105.xml new file mode 100644 index 0000000000..11f30d8f76 --- /dev/null +++ b/assets/xml/audio/sequences/seq_105.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_106.xml b/assets/xml/audio/sequences/seq_106.xml new file mode 100644 index 0000000000..3efe9de557 --- /dev/null +++ b/assets/xml/audio/sequences/seq_106.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_107.xml b/assets/xml/audio/sequences/seq_107.xml new file mode 100644 index 0000000000..1b37819a3e --- /dev/null +++ b/assets/xml/audio/sequences/seq_107.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_108.xml b/assets/xml/audio/sequences/seq_108.xml new file mode 100644 index 0000000000..d02cc02095 --- /dev/null +++ b/assets/xml/audio/sequences/seq_108.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_109.xml b/assets/xml/audio/sequences/seq_109.xml new file mode 100644 index 0000000000..27064158e7 --- /dev/null +++ b/assets/xml/audio/sequences/seq_109.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_11.xml b/assets/xml/audio/sequences/seq_11.xml new file mode 100644 index 0000000000..233917f2a0 --- /dev/null +++ b/assets/xml/audio/sequences/seq_11.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_12.xml b/assets/xml/audio/sequences/seq_12.xml new file mode 100644 index 0000000000..de48f97302 --- /dev/null +++ b/assets/xml/audio/sequences/seq_12.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_13.xml b/assets/xml/audio/sequences/seq_13.xml new file mode 100644 index 0000000000..048b3efda6 --- /dev/null +++ b/assets/xml/audio/sequences/seq_13.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_14.xml b/assets/xml/audio/sequences/seq_14.xml new file mode 100644 index 0000000000..79d3238c61 --- /dev/null +++ b/assets/xml/audio/sequences/seq_14.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_15.xml b/assets/xml/audio/sequences/seq_15.xml new file mode 100644 index 0000000000..c54018295e --- /dev/null +++ b/assets/xml/audio/sequences/seq_15.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_16.xml b/assets/xml/audio/sequences/seq_16.xml new file mode 100644 index 0000000000..5267d04126 --- /dev/null +++ b/assets/xml/audio/sequences/seq_16.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_17.xml b/assets/xml/audio/sequences/seq_17.xml new file mode 100644 index 0000000000..0d6d306b3b --- /dev/null +++ b/assets/xml/audio/sequences/seq_17.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_18.xml b/assets/xml/audio/sequences/seq_18.xml new file mode 100644 index 0000000000..af445ff0dc --- /dev/null +++ b/assets/xml/audio/sequences/seq_18.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_19.xml b/assets/xml/audio/sequences/seq_19.xml new file mode 100644 index 0000000000..000b84c2c6 --- /dev/null +++ b/assets/xml/audio/sequences/seq_19.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_2.xml b/assets/xml/audio/sequences/seq_2.xml new file mode 100644 index 0000000000..35b67cbddb --- /dev/null +++ b/assets/xml/audio/sequences/seq_2.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_20.xml b/assets/xml/audio/sequences/seq_20.xml new file mode 100644 index 0000000000..35824b77fd --- /dev/null +++ b/assets/xml/audio/sequences/seq_20.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_21.xml b/assets/xml/audio/sequences/seq_21.xml new file mode 100644 index 0000000000..c4ab27602f --- /dev/null +++ b/assets/xml/audio/sequences/seq_21.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_22.xml b/assets/xml/audio/sequences/seq_22.xml new file mode 100644 index 0000000000..cac61f1e64 --- /dev/null +++ b/assets/xml/audio/sequences/seq_22.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_23.xml b/assets/xml/audio/sequences/seq_23.xml new file mode 100644 index 0000000000..ac69e86045 --- /dev/null +++ b/assets/xml/audio/sequences/seq_23.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_24.xml b/assets/xml/audio/sequences/seq_24.xml new file mode 100644 index 0000000000..2d3386a35d --- /dev/null +++ b/assets/xml/audio/sequences/seq_24.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_25.xml b/assets/xml/audio/sequences/seq_25.xml new file mode 100644 index 0000000000..ef233be23d --- /dev/null +++ b/assets/xml/audio/sequences/seq_25.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_26.xml b/assets/xml/audio/sequences/seq_26.xml new file mode 100644 index 0000000000..590a5165f4 --- /dev/null +++ b/assets/xml/audio/sequences/seq_26.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_27.xml b/assets/xml/audio/sequences/seq_27.xml new file mode 100644 index 0000000000..5d8ff12348 --- /dev/null +++ b/assets/xml/audio/sequences/seq_27.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_28.xml b/assets/xml/audio/sequences/seq_28.xml new file mode 100644 index 0000000000..4520532db0 --- /dev/null +++ b/assets/xml/audio/sequences/seq_28.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_29.xml b/assets/xml/audio/sequences/seq_29.xml new file mode 100644 index 0000000000..2ca7f3e712 --- /dev/null +++ b/assets/xml/audio/sequences/seq_29.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_3.xml b/assets/xml/audio/sequences/seq_3.xml new file mode 100644 index 0000000000..8aa3b1ff0f --- /dev/null +++ b/assets/xml/audio/sequences/seq_3.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_30.xml b/assets/xml/audio/sequences/seq_30.xml new file mode 100644 index 0000000000..a3dead9ba4 --- /dev/null +++ b/assets/xml/audio/sequences/seq_30.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_31.xml b/assets/xml/audio/sequences/seq_31.xml new file mode 100644 index 0000000000..9a1cfe9f27 --- /dev/null +++ b/assets/xml/audio/sequences/seq_31.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_32.xml b/assets/xml/audio/sequences/seq_32.xml new file mode 100644 index 0000000000..bb76497a80 --- /dev/null +++ b/assets/xml/audio/sequences/seq_32.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_33.xml b/assets/xml/audio/sequences/seq_33.xml new file mode 100644 index 0000000000..15bc25a25c --- /dev/null +++ b/assets/xml/audio/sequences/seq_33.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_34.xml b/assets/xml/audio/sequences/seq_34.xml new file mode 100644 index 0000000000..4d21886431 --- /dev/null +++ b/assets/xml/audio/sequences/seq_34.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_35.xml b/assets/xml/audio/sequences/seq_35.xml new file mode 100644 index 0000000000..4d1e7327e4 --- /dev/null +++ b/assets/xml/audio/sequences/seq_35.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_36.xml b/assets/xml/audio/sequences/seq_36.xml new file mode 100644 index 0000000000..63173ecbb4 --- /dev/null +++ b/assets/xml/audio/sequences/seq_36.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_37.xml b/assets/xml/audio/sequences/seq_37.xml new file mode 100644 index 0000000000..bd6813f620 --- /dev/null +++ b/assets/xml/audio/sequences/seq_37.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_38.xml b/assets/xml/audio/sequences/seq_38.xml new file mode 100644 index 0000000000..dc85ce3953 --- /dev/null +++ b/assets/xml/audio/sequences/seq_38.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_39.xml b/assets/xml/audio/sequences/seq_39.xml new file mode 100644 index 0000000000..5cef308792 --- /dev/null +++ b/assets/xml/audio/sequences/seq_39.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_4.xml b/assets/xml/audio/sequences/seq_4.xml new file mode 100644 index 0000000000..6311553183 --- /dev/null +++ b/assets/xml/audio/sequences/seq_4.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_40.xml b/assets/xml/audio/sequences/seq_40.xml new file mode 100644 index 0000000000..c58c83c2a8 --- /dev/null +++ b/assets/xml/audio/sequences/seq_40.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_41.xml b/assets/xml/audio/sequences/seq_41.xml new file mode 100644 index 0000000000..a74ce40600 --- /dev/null +++ b/assets/xml/audio/sequences/seq_41.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_42.xml b/assets/xml/audio/sequences/seq_42.xml new file mode 100644 index 0000000000..3298f00c4d --- /dev/null +++ b/assets/xml/audio/sequences/seq_42.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_43.xml b/assets/xml/audio/sequences/seq_43.xml new file mode 100644 index 0000000000..9e0d2f9280 --- /dev/null +++ b/assets/xml/audio/sequences/seq_43.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_44.xml b/assets/xml/audio/sequences/seq_44.xml new file mode 100644 index 0000000000..7f4efdd764 --- /dev/null +++ b/assets/xml/audio/sequences/seq_44.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_45.xml b/assets/xml/audio/sequences/seq_45.xml new file mode 100644 index 0000000000..1f23ccd5fa --- /dev/null +++ b/assets/xml/audio/sequences/seq_45.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_46.xml b/assets/xml/audio/sequences/seq_46.xml new file mode 100644 index 0000000000..af7340d3d5 --- /dev/null +++ b/assets/xml/audio/sequences/seq_46.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_47.xml b/assets/xml/audio/sequences/seq_47.xml new file mode 100644 index 0000000000..7b9b46489a --- /dev/null +++ b/assets/xml/audio/sequences/seq_47.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_48.xml b/assets/xml/audio/sequences/seq_48.xml new file mode 100644 index 0000000000..0cd313d2bd --- /dev/null +++ b/assets/xml/audio/sequences/seq_48.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_49.xml b/assets/xml/audio/sequences/seq_49.xml new file mode 100644 index 0000000000..c5aa4bbb6a --- /dev/null +++ b/assets/xml/audio/sequences/seq_49.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_5.xml b/assets/xml/audio/sequences/seq_5.xml new file mode 100644 index 0000000000..a1a398f463 --- /dev/null +++ b/assets/xml/audio/sequences/seq_5.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_50.xml b/assets/xml/audio/sequences/seq_50.xml new file mode 100644 index 0000000000..e2e3adcd26 --- /dev/null +++ b/assets/xml/audio/sequences/seq_50.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_51.xml b/assets/xml/audio/sequences/seq_51.xml new file mode 100644 index 0000000000..2b6ba4fcee --- /dev/null +++ b/assets/xml/audio/sequences/seq_51.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_52.xml b/assets/xml/audio/sequences/seq_52.xml new file mode 100644 index 0000000000..17f6f8ea8f --- /dev/null +++ b/assets/xml/audio/sequences/seq_52.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_53.xml b/assets/xml/audio/sequences/seq_53.xml new file mode 100644 index 0000000000..e9f0a82eae --- /dev/null +++ b/assets/xml/audio/sequences/seq_53.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_54.xml b/assets/xml/audio/sequences/seq_54.xml new file mode 100644 index 0000000000..a902858ca6 --- /dev/null +++ b/assets/xml/audio/sequences/seq_54.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_55.xml b/assets/xml/audio/sequences/seq_55.xml new file mode 100644 index 0000000000..361afcebd2 --- /dev/null +++ b/assets/xml/audio/sequences/seq_55.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_56.xml b/assets/xml/audio/sequences/seq_56.xml new file mode 100644 index 0000000000..5710f771e5 --- /dev/null +++ b/assets/xml/audio/sequences/seq_56.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_57.xml b/assets/xml/audio/sequences/seq_57.xml new file mode 100644 index 0000000000..b0f2c8573c --- /dev/null +++ b/assets/xml/audio/sequences/seq_57.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_58.xml b/assets/xml/audio/sequences/seq_58.xml new file mode 100644 index 0000000000..39cc260786 --- /dev/null +++ b/assets/xml/audio/sequences/seq_58.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_59.xml b/assets/xml/audio/sequences/seq_59.xml new file mode 100644 index 0000000000..cf7393a72e --- /dev/null +++ b/assets/xml/audio/sequences/seq_59.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_6.xml b/assets/xml/audio/sequences/seq_6.xml new file mode 100644 index 0000000000..f1d1176256 --- /dev/null +++ b/assets/xml/audio/sequences/seq_6.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_60.xml b/assets/xml/audio/sequences/seq_60.xml new file mode 100644 index 0000000000..2fdaac058f --- /dev/null +++ b/assets/xml/audio/sequences/seq_60.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_61.xml b/assets/xml/audio/sequences/seq_61.xml new file mode 100644 index 0000000000..f7add6ba57 --- /dev/null +++ b/assets/xml/audio/sequences/seq_61.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_62.xml b/assets/xml/audio/sequences/seq_62.xml new file mode 100644 index 0000000000..ca00f1bf03 --- /dev/null +++ b/assets/xml/audio/sequences/seq_62.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_63.xml b/assets/xml/audio/sequences/seq_63.xml new file mode 100644 index 0000000000..d7cb6e7fe6 --- /dev/null +++ b/assets/xml/audio/sequences/seq_63.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_64.xml b/assets/xml/audio/sequences/seq_64.xml new file mode 100644 index 0000000000..95eb98c73f --- /dev/null +++ b/assets/xml/audio/sequences/seq_64.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_65.xml b/assets/xml/audio/sequences/seq_65.xml new file mode 100644 index 0000000000..897347d02c --- /dev/null +++ b/assets/xml/audio/sequences/seq_65.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_66.xml b/assets/xml/audio/sequences/seq_66.xml new file mode 100644 index 0000000000..85f5ff5222 --- /dev/null +++ b/assets/xml/audio/sequences/seq_66.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_67.xml b/assets/xml/audio/sequences/seq_67.xml new file mode 100644 index 0000000000..36dfd9bbfb --- /dev/null +++ b/assets/xml/audio/sequences/seq_67.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_68.xml b/assets/xml/audio/sequences/seq_68.xml new file mode 100644 index 0000000000..6644e0b601 --- /dev/null +++ b/assets/xml/audio/sequences/seq_68.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_69.xml b/assets/xml/audio/sequences/seq_69.xml new file mode 100644 index 0000000000..59ee837c80 --- /dev/null +++ b/assets/xml/audio/sequences/seq_69.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_7.xml b/assets/xml/audio/sequences/seq_7.xml new file mode 100644 index 0000000000..5b099b03e8 --- /dev/null +++ b/assets/xml/audio/sequences/seq_7.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_70.xml b/assets/xml/audio/sequences/seq_70.xml new file mode 100644 index 0000000000..5e7966d811 --- /dev/null +++ b/assets/xml/audio/sequences/seq_70.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_71.xml b/assets/xml/audio/sequences/seq_71.xml new file mode 100644 index 0000000000..f0b9c5166c --- /dev/null +++ b/assets/xml/audio/sequences/seq_71.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_72.xml b/assets/xml/audio/sequences/seq_72.xml new file mode 100644 index 0000000000..f674c78d6a --- /dev/null +++ b/assets/xml/audio/sequences/seq_72.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_73.xml b/assets/xml/audio/sequences/seq_73.xml new file mode 100644 index 0000000000..2548961701 --- /dev/null +++ b/assets/xml/audio/sequences/seq_73.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_74.xml b/assets/xml/audio/sequences/seq_74.xml new file mode 100644 index 0000000000..b1da5b9923 --- /dev/null +++ b/assets/xml/audio/sequences/seq_74.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_75.xml b/assets/xml/audio/sequences/seq_75.xml new file mode 100644 index 0000000000..2bbceeb826 --- /dev/null +++ b/assets/xml/audio/sequences/seq_75.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_76.xml b/assets/xml/audio/sequences/seq_76.xml new file mode 100644 index 0000000000..368881c430 --- /dev/null +++ b/assets/xml/audio/sequences/seq_76.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_77.xml b/assets/xml/audio/sequences/seq_77.xml new file mode 100644 index 0000000000..0eed7ea92c --- /dev/null +++ b/assets/xml/audio/sequences/seq_77.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_78.xml b/assets/xml/audio/sequences/seq_78.xml new file mode 100644 index 0000000000..372b10db22 --- /dev/null +++ b/assets/xml/audio/sequences/seq_78.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_79.xml b/assets/xml/audio/sequences/seq_79.xml new file mode 100644 index 0000000000..cfd002b51b --- /dev/null +++ b/assets/xml/audio/sequences/seq_79.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_8.xml b/assets/xml/audio/sequences/seq_8.xml new file mode 100644 index 0000000000..d5b49b5d12 --- /dev/null +++ b/assets/xml/audio/sequences/seq_8.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_80.xml b/assets/xml/audio/sequences/seq_80.xml new file mode 100644 index 0000000000..2d7f51a5a6 --- /dev/null +++ b/assets/xml/audio/sequences/seq_80.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_81.xml b/assets/xml/audio/sequences/seq_81.xml new file mode 100644 index 0000000000..2534949364 --- /dev/null +++ b/assets/xml/audio/sequences/seq_81.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_82.xml b/assets/xml/audio/sequences/seq_82.xml new file mode 100644 index 0000000000..98d1bff9b7 --- /dev/null +++ b/assets/xml/audio/sequences/seq_82.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_83.xml b/assets/xml/audio/sequences/seq_83.xml new file mode 100644 index 0000000000..e44b8d6ff5 --- /dev/null +++ b/assets/xml/audio/sequences/seq_83.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_84.xml b/assets/xml/audio/sequences/seq_84.xml new file mode 100644 index 0000000000..55dc374a4c --- /dev/null +++ b/assets/xml/audio/sequences/seq_84.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_85.xml b/assets/xml/audio/sequences/seq_85.xml new file mode 100644 index 0000000000..1f024e0923 --- /dev/null +++ b/assets/xml/audio/sequences/seq_85.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_86.xml b/assets/xml/audio/sequences/seq_86.xml new file mode 100644 index 0000000000..f6acb8a9fe --- /dev/null +++ b/assets/xml/audio/sequences/seq_86.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_88.xml b/assets/xml/audio/sequences/seq_88.xml new file mode 100644 index 0000000000..a96383096c --- /dev/null +++ b/assets/xml/audio/sequences/seq_88.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_89.xml b/assets/xml/audio/sequences/seq_89.xml new file mode 100644 index 0000000000..62026869f8 --- /dev/null +++ b/assets/xml/audio/sequences/seq_89.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_9.xml b/assets/xml/audio/sequences/seq_9.xml new file mode 100644 index 0000000000..f6671b1e6e --- /dev/null +++ b/assets/xml/audio/sequences/seq_9.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_90.xml b/assets/xml/audio/sequences/seq_90.xml new file mode 100644 index 0000000000..1f1d9bde08 --- /dev/null +++ b/assets/xml/audio/sequences/seq_90.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_91.xml b/assets/xml/audio/sequences/seq_91.xml new file mode 100644 index 0000000000..e2bee2cb32 --- /dev/null +++ b/assets/xml/audio/sequences/seq_91.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_92.xml b/assets/xml/audio/sequences/seq_92.xml new file mode 100644 index 0000000000..3129a417d5 --- /dev/null +++ b/assets/xml/audio/sequences/seq_92.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_93.xml b/assets/xml/audio/sequences/seq_93.xml new file mode 100644 index 0000000000..0c6b204cb9 --- /dev/null +++ b/assets/xml/audio/sequences/seq_93.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_94.xml b/assets/xml/audio/sequences/seq_94.xml new file mode 100644 index 0000000000..59805445e3 --- /dev/null +++ b/assets/xml/audio/sequences/seq_94.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_95.xml b/assets/xml/audio/sequences/seq_95.xml new file mode 100644 index 0000000000..cdc31a61b1 --- /dev/null +++ b/assets/xml/audio/sequences/seq_95.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_96.xml b/assets/xml/audio/sequences/seq_96.xml new file mode 100644 index 0000000000..402fc8b8b9 --- /dev/null +++ b/assets/xml/audio/sequences/seq_96.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_97.xml b/assets/xml/audio/sequences/seq_97.xml new file mode 100644 index 0000000000..5726322125 --- /dev/null +++ b/assets/xml/audio/sequences/seq_97.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_98.xml b/assets/xml/audio/sequences/seq_98.xml new file mode 100644 index 0000000000..5bd56596b0 --- /dev/null +++ b/assets/xml/audio/sequences/seq_98.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/sequences/seq_99.xml b/assets/xml/audio/sequences/seq_99.xml new file mode 100644 index 0000000000..d550855a0a --- /dev/null +++ b/assets/xml/audio/sequences/seq_99.xml @@ -0,0 +1,2 @@ + + diff --git a/assets/xml/audio/soundfonts/Soundfont_0.xml b/assets/xml/audio/soundfonts/Soundfont_0.xml new file mode 100644 index 0000000000..02f75704f0 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_0.xml @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_1.xml b/assets/xml/audio/soundfonts/Soundfont_1.xml new file mode 100644 index 0000000000..6376f6d115 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_1.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_10.xml b/assets/xml/audio/soundfonts/Soundfont_10.xml new file mode 100644 index 0000000000..578101fd4d --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_10.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_11.xml b/assets/xml/audio/soundfonts/Soundfont_11.xml new file mode 100644 index 0000000000..72b4f77fd4 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_11.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_12.xml b/assets/xml/audio/soundfonts/Soundfont_12.xml new file mode 100644 index 0000000000..4800fecedf --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_12.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_13.xml b/assets/xml/audio/soundfonts/Soundfont_13.xml new file mode 100644 index 0000000000..b399905de8 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_13.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_14.xml b/assets/xml/audio/soundfonts/Soundfont_14.xml new file mode 100644 index 0000000000..2345061c9b --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_14.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_15.xml b/assets/xml/audio/soundfonts/Soundfont_15.xml new file mode 100644 index 0000000000..bf32ecd437 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_15.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_16.xml b/assets/xml/audio/soundfonts/Soundfont_16.xml new file mode 100644 index 0000000000..c1c6d1d2b0 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_16.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_17.xml b/assets/xml/audio/soundfonts/Soundfont_17.xml new file mode 100644 index 0000000000..a16e9752f8 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_17.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_18.xml b/assets/xml/audio/soundfonts/Soundfont_18.xml new file mode 100644 index 0000000000..76807539ad --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_18.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_19.xml b/assets/xml/audio/soundfonts/Soundfont_19.xml new file mode 100644 index 0000000000..9f2ba9286e --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_19.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_2.xml b/assets/xml/audio/soundfonts/Soundfont_2.xml new file mode 100644 index 0000000000..a297ce8505 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_2.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_20.xml b/assets/xml/audio/soundfonts/Soundfont_20.xml new file mode 100644 index 0000000000..5ce632d47c --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_20.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_21.xml b/assets/xml/audio/soundfonts/Soundfont_21.xml new file mode 100644 index 0000000000..a1bc07be8f --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_21.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_22.xml b/assets/xml/audio/soundfonts/Soundfont_22.xml new file mode 100644 index 0000000000..fe0099beb0 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_22.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_23.xml b/assets/xml/audio/soundfonts/Soundfont_23.xml new file mode 100644 index 0000000000..582c638a2d --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_23.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_24.xml b/assets/xml/audio/soundfonts/Soundfont_24.xml new file mode 100644 index 0000000000..aee3907f99 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_24.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_25.xml b/assets/xml/audio/soundfonts/Soundfont_25.xml new file mode 100644 index 0000000000..5ad7d22f22 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_25.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_26.xml b/assets/xml/audio/soundfonts/Soundfont_26.xml new file mode 100644 index 0000000000..ec20f4f56f --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_26.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_27.xml b/assets/xml/audio/soundfonts/Soundfont_27.xml new file mode 100644 index 0000000000..1bc1c9d886 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_27.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_28.xml b/assets/xml/audio/soundfonts/Soundfont_28.xml new file mode 100644 index 0000000000..c0292b0d7b --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_28.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_29.xml b/assets/xml/audio/soundfonts/Soundfont_29.xml new file mode 100644 index 0000000000..39e03a9a23 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_29.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_3.xml b/assets/xml/audio/soundfonts/Soundfont_3.xml new file mode 100644 index 0000000000..bb510aaef1 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_3.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_30.xml b/assets/xml/audio/soundfonts/Soundfont_30.xml new file mode 100644 index 0000000000..e9a1d093e7 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_30.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_31.xml b/assets/xml/audio/soundfonts/Soundfont_31.xml new file mode 100644 index 0000000000..d246fff00f --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_31.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_32.xml b/assets/xml/audio/soundfonts/Soundfont_32.xml new file mode 100644 index 0000000000..7508ee8b5e --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_32.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_33.xml b/assets/xml/audio/soundfonts/Soundfont_33.xml new file mode 100644 index 0000000000..93116ad1cd --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_33.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_34.xml b/assets/xml/audio/soundfonts/Soundfont_34.xml new file mode 100644 index 0000000000..20437b048a --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_34.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_35.xml b/assets/xml/audio/soundfonts/Soundfont_35.xml new file mode 100644 index 0000000000..fa9209a72f --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_35.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_36.xml b/assets/xml/audio/soundfonts/Soundfont_36.xml new file mode 100644 index 0000000000..fe49eda57b --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_36.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_37.xml b/assets/xml/audio/soundfonts/Soundfont_37.xml new file mode 100644 index 0000000000..67fa255b2c --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_37.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_4.xml b/assets/xml/audio/soundfonts/Soundfont_4.xml new file mode 100644 index 0000000000..4e023974e1 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_5.xml b/assets/xml/audio/soundfonts/Soundfont_5.xml new file mode 100644 index 0000000000..465b554eeb --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_5.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_6.xml b/assets/xml/audio/soundfonts/Soundfont_6.xml new file mode 100644 index 0000000000..f4c239da8e --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_6.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_7.xml b/assets/xml/audio/soundfonts/Soundfont_7.xml new file mode 100644 index 0000000000..aa61f7d253 --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_7.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_8.xml b/assets/xml/audio/soundfonts/Soundfont_8.xml new file mode 100644 index 0000000000..06cc14a1ca --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_8.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/audio/soundfonts/Soundfont_9.xml b/assets/xml/audio/soundfonts/Soundfont_9.xml new file mode 100644 index 0000000000..97384ba3cd --- /dev/null +++ b/assets/xml/audio/soundfonts/Soundfont_9.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/n64dd/error_textures.xml b/assets/xml/n64dd/error_textures.xml new file mode 100644 index 0000000000..6db2ab37d5 --- /dev/null +++ b/assets/xml/n64dd/error_textures.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/xml/objects/gameplay_keep.xml b/assets/xml/objects/gameplay_keep.xml index fa68e72853..dcb7e29605 100644 --- a/assets/xml/objects/gameplay_keep.xml +++ b/assets/xml/objects/gameplay_keep.xml @@ -647,7 +647,7 @@ - + @@ -968,7 +968,7 @@ - + diff --git a/assets/xml/objects/gameplay_keep_pal.xml b/assets/xml/objects/gameplay_keep_pal.xml index f5c0c9e683..fbea0efd0c 100644 --- a/assets/xml/objects/gameplay_keep_pal.xml +++ b/assets/xml/objects/gameplay_keep_pal.xml @@ -644,7 +644,7 @@ - + @@ -934,7 +934,7 @@ - + diff --git a/assets/xml/objects/object_ahg.xml b/assets/xml/objects/object_ahg.xml index 4d37b1b110..8147abb75f 100644 --- a/assets/xml/objects/object_ahg.xml +++ b/assets/xml/objects/object_ahg.xml @@ -1,61 +1,66 @@ + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + - - - - - - - + + + diff --git a/assets/xml/objects/object_aob.xml b/assets/xml/objects/object_aob.xml index 61b28914bd..74838f6af3 100644 --- a/assets/xml/objects/object_aob.xml +++ b/assets/xml/objects/object_aob.xml @@ -1,59 +1,58 @@ + - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + - - - - - - - - + + + + + + + + - - - - + + + + diff --git a/assets/xml/objects/object_bba.xml b/assets/xml/objects/object_bba.xml index ccc5c21365..f988d8fbe4 100644 --- a/assets/xml/objects/object_bba.xml +++ b/assets/xml/objects/object_bba.xml @@ -1,45 +1,50 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_bji.xml b/assets/xml/objects/object_bji.xml index c665b6b001..8dd89dd875 100644 --- a/assets/xml/objects/object_bji.xml +++ b/assets/xml/objects/object_bji.xml @@ -1,56 +1,61 @@ + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + - - - - + + diff --git a/assets/xml/objects/object_bob.xml b/assets/xml/objects/object_bob.xml index 289e994e47..ad59e56ea3 100644 --- a/assets/xml/objects/object_bob.xml +++ b/assets/xml/objects/object_bob.xml @@ -1,47 +1,52 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_boj.xml b/assets/xml/objects/object_boj.xml index 4be4764ab5..d43332de00 100644 --- a/assets/xml/objects/object_boj.xml +++ b/assets/xml/objects/object_boj.xml @@ -1,65 +1,73 @@ + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + diff --git a/assets/xml/objects/object_cne.xml b/assets/xml/objects/object_cne.xml index 0c14d0bc54..ecf151d641 100644 --- a/assets/xml/objects/object_cne.xml +++ b/assets/xml/objects/object_cne.xml @@ -1,53 +1,57 @@ + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + + - + + diff --git a/assets/xml/objects/object_cob.xml b/assets/xml/objects/object_cob.xml index ba051cfa74..b5047b4993 100644 --- a/assets/xml/objects/object_cob.xml +++ b/assets/xml/objects/object_cob.xml @@ -1,41 +1,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mag.xml b/assets/xml/objects/object_mag.xml index 66874b0c07..1a59b4092b 100644 --- a/assets/xml/objects/object_mag.xml +++ b/assets/xml/objects/object_mag.xml @@ -1,21 +1,20 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mag_v2.xml b/assets/xml/objects/object_mag_v2.xml new file mode 100644 index 0000000000..69ce890a7a --- /dev/null +++ b/assets/xml/objects/object_mag_v2.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mag_v2_mq.xml b/assets/xml/objects/object_mag_v2_mq.xml new file mode 100644 index 0000000000..9f0543ea8a --- /dev/null +++ b/assets/xml/objects/object_mag_v2_mq.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mag_v3.xml b/assets/xml/objects/object_mag_v3.xml new file mode 100644 index 0000000000..66874b0c07 --- /dev/null +++ b/assets/xml/objects/object_mag_v3.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mag_mq.xml b/assets/xml/objects/object_mag_v3_mq.xml similarity index 100% rename from assets/xml/objects/object_mag_mq.xml rename to assets/xml/objects/object_mag_v3_mq.xml diff --git a/assets/xml/objects/object_oE5.xml b/assets/xml/objects/object_oE5.xml index f5edf745aa..040fb8d733 100644 --- a/assets/xml/objects/object_oE5.xml +++ b/assets/xml/objects/object_oE5.xml @@ -49,7 +49,8 @@ - + + diff --git a/assets/xml/overlays/ovl_Boss_Ganon2.xml b/assets/xml/overlays/ovl_Boss_Ganon2.xml index 07b11108cc..00f985786c 100644 --- a/assets/xml/overlays/ovl_Boss_Ganon2.xml +++ b/assets/xml/overlays/ovl_Boss_Ganon2.xml @@ -1,28 +1,28 @@ - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/assets/xml/overlays/ovl_file_choose.xml b/assets/xml/overlays/ovl_file_choose.xml index aa9dcbb84b..8808ab4281 100644 --- a/assets/xml/overlays/ovl_file_choose.xml +++ b/assets/xml/overlays/ovl_file_choose.xml @@ -1,27 +1,33 @@ - + - - + + - - + + + + + + + + - + - + - + - + - + diff --git a/assets/xml/overlays/ovl_file_choose_pal_gc.xml b/assets/xml/overlays/ovl_file_choose_pal_gc.xml new file mode 100644 index 0000000000..3c4c24cdab --- /dev/null +++ b/assets/xml/overlays/ovl_file_choose_pal_gc.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/overlays/ovl_file_choose_pal_n64.xml b/assets/xml/overlays/ovl_file_choose_pal_n64.xml new file mode 100644 index 0000000000..282fad0c37 --- /dev/null +++ b/assets/xml/overlays/ovl_file_choose_pal_n64.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/scenes/dungeons/ddan_boss.xml b/assets/xml/scenes/dungeons/ddan_boss.xml index 2b61024906..86a34e6d9a 100644 --- a/assets/xml/scenes/dungeons/ddan_boss.xml +++ b/assets/xml/scenes/dungeons/ddan_boss.xml @@ -6,7 +6,7 @@ - + diff --git a/assets/xml/scenes/dungeons/ddan_boss_v2.xml b/assets/xml/scenes/dungeons/ddan_boss_v2.xml new file mode 100644 index 0000000000..2b61024906 --- /dev/null +++ b/assets/xml/scenes/dungeons/ddan_boss_v2.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/assets/xml/scenes/dungeons/ice_doukutu.xml b/assets/xml/scenes/dungeons/ice_doukutu.xml index 4d25aa74f4..f816d7ca24 100644 --- a/assets/xml/scenes/dungeons/ice_doukutu.xml +++ b/assets/xml/scenes/dungeons/ice_doukutu.xml @@ -1,8 +1,8 @@ - - + + diff --git a/assets/xml/scenes/dungeons/ice_doukutu_pal_n64.xml b/assets/xml/scenes/dungeons/ice_doukutu_pal_n64.xml new file mode 100644 index 0000000000..9f08f559ed --- /dev/null +++ b/assets/xml/scenes/dungeons/ice_doukutu_pal_n64.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/scenes/dungeons/ice_doukutu_v2.xml b/assets/xml/scenes/dungeons/ice_doukutu_v2.xml new file mode 100644 index 0000000000..4d25aa74f4 --- /dev/null +++ b/assets/xml/scenes/dungeons/ice_doukutu_v2.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/scenes/indoors/tokinoma_pal_n64.xml b/assets/xml/scenes/indoors/tokinoma_pal_n64.xml new file mode 100644 index 0000000000..f3d250415c --- /dev/null +++ b/assets/xml/scenes/indoors/tokinoma_pal_n64.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/xml/scenes/misc/hiral_demo_pal_n64.xml b/assets/xml/scenes/misc/hiral_demo_pal_n64.xml new file mode 100644 index 0000000000..88d347899a --- /dev/null +++ b/assets/xml/scenes/misc/hiral_demo_pal_n64.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/xml/scenes/overworld/spot00_pal_n64.xml b/assets/xml/scenes/overworld/spot00_pal_n64.xml new file mode 100644 index 0000000000..6eb609adac --- /dev/null +++ b/assets/xml/scenes/overworld/spot00_pal_n64.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/scenes/overworld/spot01.xml b/assets/xml/scenes/overworld/spot01.xml index 4a57964115..205da509c3 100644 --- a/assets/xml/scenes/overworld/spot01.xml +++ b/assets/xml/scenes/overworld/spot01.xml @@ -7,7 +7,6 @@ - diff --git a/assets/xml/scenes/overworld/spot01_pal_n64.xml b/assets/xml/scenes/overworld/spot01_pal_n64.xml new file mode 100644 index 0000000000..a0e653dd43 --- /dev/null +++ b/assets/xml/scenes/overworld/spot01_pal_n64.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/xml/scenes/overworld/spot02.xml b/assets/xml/scenes/overworld/spot02.xml index 334d0e5991..45708dd3ac 100644 --- a/assets/xml/scenes/overworld/spot02.xml +++ b/assets/xml/scenes/overworld/spot02.xml @@ -8,7 +8,6 @@ - diff --git a/assets/xml/scenes/overworld/spot04.xml b/assets/xml/scenes/overworld/spot04.xml index 3cfc140950..c861d45278 100644 --- a/assets/xml/scenes/overworld/spot04.xml +++ b/assets/xml/scenes/overworld/spot04.xml @@ -14,8 +14,6 @@ - - diff --git a/assets/xml/scenes/overworld/spot04_pal_n64.xml b/assets/xml/scenes/overworld/spot04_pal_n64.xml new file mode 100644 index 0000000000..c8e8776a7a --- /dev/null +++ b/assets/xml/scenes/overworld/spot04_pal_n64.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/scenes/overworld/spot05_pal_n64.xml b/assets/xml/scenes/overworld/spot05_pal_n64.xml new file mode 100644 index 0000000000..6458ad63f5 --- /dev/null +++ b/assets/xml/scenes/overworld/spot05_pal_n64.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/assets/xml/scenes/overworld/spot06_pal_n64.xml b/assets/xml/scenes/overworld/spot06_pal_n64.xml new file mode 100644 index 0000000000..308858ff74 --- /dev/null +++ b/assets/xml/scenes/overworld/spot06_pal_n64.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/xml/scenes/overworld/spot07_pal_n64.xml b/assets/xml/scenes/overworld/spot07_pal_n64.xml new file mode 100644 index 0000000000..38070fd780 --- /dev/null +++ b/assets/xml/scenes/overworld/spot07_pal_n64.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/xml/scenes/overworld/spot09.xml b/assets/xml/scenes/overworld/spot09.xml index a447c9df44..7b7ec2ce5e 100644 --- a/assets/xml/scenes/overworld/spot09.xml +++ b/assets/xml/scenes/overworld/spot09.xml @@ -8,9 +8,6 @@ - - - diff --git a/assets/xml/scenes/overworld/spot09_pal_n64.xml b/assets/xml/scenes/overworld/spot09_pal_n64.xml new file mode 100644 index 0000000000..a75774bf68 --- /dev/null +++ b/assets/xml/scenes/overworld/spot09_pal_n64.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/assets/xml/scenes/overworld/spot11_pal_n64.xml b/assets/xml/scenes/overworld/spot11_pal_n64.xml new file mode 100644 index 0000000000..b66cd8f294 --- /dev/null +++ b/assets/xml/scenes/overworld/spot11_pal_n64.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/xml/scenes/overworld/spot12_pal_n64.xml b/assets/xml/scenes/overworld/spot12_pal_n64.xml new file mode 100644 index 0000000000..09c16cb7c3 --- /dev/null +++ b/assets/xml/scenes/overworld/spot12_pal_n64.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/xml/scenes/overworld/spot16.xml b/assets/xml/scenes/overworld/spot16.xml index 57a64323b2..f3d92c8fe7 100644 --- a/assets/xml/scenes/overworld/spot16.xml +++ b/assets/xml/scenes/overworld/spot16.xml @@ -10,6 +10,6 @@ - + diff --git a/assets/xml/scenes/overworld/spot16_pal_n64.xml b/assets/xml/scenes/overworld/spot16_pal_n64.xml new file mode 100644 index 0000000000..aff784ab9f --- /dev/null +++ b/assets/xml/scenes/overworld/spot16_pal_n64.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/xml/scenes/overworld/spot16_v2.xml b/assets/xml/scenes/overworld/spot16_v2.xml new file mode 100644 index 0000000000..57a64323b2 --- /dev/null +++ b/assets/xml/scenes/overworld/spot16_v2.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/xml/scenes/overworld/spot17_pal_n64.xml b/assets/xml/scenes/overworld/spot17_pal_n64.xml new file mode 100644 index 0000000000..6aca94ff73 --- /dev/null +++ b/assets/xml/scenes/overworld/spot17_pal_n64.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/xml/scenes/overworld/spot18_pal_n64.xml b/assets/xml/scenes/overworld/spot18_pal_n64.xml new file mode 100644 index 0000000000..adbbc51121 --- /dev/null +++ b/assets/xml/scenes/overworld/spot18_pal_n64.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/icon_item_field_static.xml b/assets/xml/textures/icon_item_field_static.xml index 1d94ffda11..1ee2483501 100644 --- a/assets/xml/textures/icon_item_field_static.xml +++ b/assets/xml/textures/icon_item_field_static.xml @@ -12,21 +12,21 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/icon_item_jpn_static.xml b/assets/xml/textures/icon_item_jpn_static.xml index 95e1ea0552..f2fe854b8e 100644 --- a/assets/xml/textures/icon_item_jpn_static.xml +++ b/assets/xml/textures/icon_item_jpn_static.xml @@ -11,8 +11,8 @@ - - + + diff --git a/assets/xml/textures/map_name_static.xml b/assets/xml/textures/map_name_static.xml index 42448de7c6..dd705eab60 100644 --- a/assets/xml/textures/map_name_static.xml +++ b/assets/xml/textures/map_name_static.xml @@ -1,5 +1,8 @@ + + + @@ -12,6 +15,7 @@ + @@ -24,6 +28,9 @@ + + + @@ -46,6 +53,7 @@ + diff --git a/assets/xml/textures/map_name_static_pal.xml b/assets/xml/textures/map_name_static_pal.xml index 0504aa432a..780609b18c 100644 --- a/assets/xml/textures/map_name_static_pal.xml +++ b/assets/xml/textures/map_name_static_pal.xml @@ -1,5 +1,8 @@ + + + @@ -12,6 +15,7 @@ + @@ -24,6 +28,7 @@ + @@ -36,6 +41,9 @@ + + + @@ -58,6 +66,7 @@ + @@ -80,6 +89,7 @@ + diff --git a/assets/xml/textures/nes_font_static.xml b/assets/xml/textures/nes_font_static.xml index b01646cb54..f1b80ee045 100644 --- a/assets/xml/textures/nes_font_static.xml +++ b/assets/xml/textures/nes_font_static.xml @@ -140,6 +140,5 @@ - diff --git a/assets/xml/textures/nes_font_static_v2.xml b/assets/xml/textures/nes_font_static_v2.xml new file mode 100644 index 0000000000..b01646cb54 --- /dev/null +++ b/assets/xml/textures/nes_font_static_v2.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/nintendo_rogo_static.xml b/assets/xml/textures/nintendo_rogo_static.xml index 7a60524b20..295bbfcfa2 100644 --- a/assets/xml/textures/nintendo_rogo_static.xml +++ b/assets/xml/textures/nintendo_rogo_static.xml @@ -3,6 +3,6 @@ - + diff --git a/assets/xml/textures/nintendo_rogo_static_v2.xml b/assets/xml/textures/nintendo_rogo_static_v2.xml new file mode 100644 index 0000000000..7a60524b20 --- /dev/null +++ b/assets/xml/textures/nintendo_rogo_static_v2.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/xml/textures/title_static.xml b/assets/xml/textures/title_static.xml index 4a72016fc8..c0f3f2908d 100644 --- a/assets/xml/textures/title_static.xml +++ b/assets/xml/textures/title_static.xml @@ -38,7 +38,7 @@ - + @@ -138,7 +138,7 @@ - + diff --git a/assets/xml/textures/title_static_pal.xml b/assets/xml/textures/title_static_pal_gc.xml similarity index 97% rename from assets/xml/textures/title_static_pal.xml rename to assets/xml/textures/title_static_pal_gc.xml index 422b60cdc9..5f26d7f8de 100644 --- a/assets/xml/textures/title_static_pal.xml +++ b/assets/xml/textures/title_static_pal_gc.xml @@ -82,7 +82,7 @@ - + @@ -105,7 +105,7 @@ - + @@ -166,9 +166,9 @@ - - - + + + diff --git a/assets/xml/textures/title_static_pal_n64.xml b/assets/xml/textures/title_static_pal_n64.xml new file mode 100644 index 0000000000..ad3bf9dbbe --- /dev/null +++ b/assets/xml/textures/title_static_pal_n64.xml @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0x1d480 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/baseroms/gc-eu-mq-dbg/config.yml b/baseroms/gc-eu-mq-dbg/config.yml index bd6c9bf6b3..84a6d3b6c7 100644 --- a/baseroms/gc-eu-mq-dbg/config.yml +++ b/baseroms/gc-eu-mq-dbg/config.yml @@ -1,11 +1,64 @@ dmadata_start: 0x12F70 text_lang_pal: true +incbins: + - name: ipl3 + segment: makerom + vram: 0x80000040 + size: 0xFC0 + - name: rspbootText + segment: boot + vram: 0x80009320 + size: 0xD0 + - name: aspMainText + segment: code + vram: 0x801120C0 + size: 0xFB0 + - name: gspS2DEX2d_fifoText + segment: code + vram: 0x80113070 + size: 0x18C0 + - name: njpgdspMainText + segment: code + vram: 0x80114930 + size: 0xAF0 + - name: gMojiFontTLUTs + segment: code + vram: 0x8012A740 + size: 0x80 + - name: gMojiFontTex + segment: code + vram: 0x8012A7C0 + size: 0x400 + - name: aspMainData + segment: code + vram: 0x80155C70 + size: 0x2E0 + - name: gspF3DZEX2_NoN_PosLight_fifoText + segment: code + vram: 0x80155F50 + size: 0x1630 + - name: gspF3DZEX2_NoN_PosLight_fifoData + segment: code + vram: 0x80157580 + size: 0x420 + - name: gspS2DEX2d_fifoData + segment: code + vram: 0x801579A0 + size: 0x390 + - name: njpgdspMainData + segment: code + vram: 0x80157D30 + size: 0x60 variables: gMtxClear: 0x8012DB20 sNesMessageEntryTable: 0x8014B320 sGerMessageEntryTable: 0x8014F548 sFraMessageEntryTable: 0x80151658 sStaffMessageEntryTable: 0x80153768 + gSoundFontTable: 0x801550D0 + gSequenceFontTable: 0x80155340 + gSequenceTable: 0x80155500 + gSampleBankTable: 0x80155BF0 sShadowTex: 0x80A8E610 assets: - name: code/fbdemo_circle @@ -469,7 +522,7 @@ assets: - name: objects/object_ma2 xml_path: assets/xml/objects/object_ma2.xml - name: objects/object_mag - xml_path: assets/xml/objects/object_mag_mq.xml + xml_path: assets/xml/objects/object_mag_v3_mq.xml - name: objects/object_mamenoki xml_path: assets/xml/objects/object_mamenoki.xml - name: objects/object_mastergolon @@ -887,9 +940,9 @@ assets: start_offset: 0x780 end_offset: 0x4128 - name: overlays/ovl_file_choose - xml_path: assets/xml/overlays/ovl_file_choose.xml + xml_path: assets/xml/overlays/ovl_file_choose_pal_gc.xml start_offset: 0xDE70 - end_offset: 0xE6B0 + end_offset: 0xE740 - name: overlays/ovl_Magic_Dark xml_path: assets/xml/overlays/ovl_Magic_Dark.xml start_offset: 0xD10 @@ -935,7 +988,7 @@ assets: - name: scenes/dungeons/ddan xml_path: assets/xml/scenes/dungeons/ddan_mq.xml - name: scenes/dungeons/ddan_boss - xml_path: assets/xml/scenes/dungeons/ddan_boss.xml + xml_path: assets/xml/scenes/dungeons/ddan_boss_v2.xml - name: scenes/dungeons/FIRE_bs xml_path: assets/xml/scenes/dungeons/FIRE_bs.xml - name: scenes/dungeons/ganon @@ -1107,7 +1160,7 @@ assets: - name: scenes/overworld/spot15 xml_path: assets/xml/scenes/overworld/spot15.xml - name: scenes/overworld/spot16 - xml_path: assets/xml/scenes/overworld/spot16.xml + xml_path: assets/xml/scenes/overworld/spot16_v2.xml - name: scenes/overworld/spot17 xml_path: assets/xml/scenes/overworld/spot17.xml - name: scenes/overworld/spot18 @@ -1181,9 +1234,9 @@ assets: - name: textures/message_texture_static xml_path: assets/xml/textures/message_texture_static.xml - name: textures/nes_font_static - xml_path: assets/xml/textures/nes_font_static.xml + xml_path: assets/xml/textures/nes_font_static_v2.xml - name: textures/nintendo_rogo_static - xml_path: assets/xml/textures/nintendo_rogo_static.xml + xml_path: assets/xml/textures/nintendo_rogo_static_v2.xml - name: textures/parameter_static xml_path: assets/xml/textures/parameter_static.xml - name: textures/place_title_cards @@ -1191,4 +1244,4 @@ assets: - name: textures/skyboxes xml_path: assets/xml/textures/skyboxes.xml - name: textures/title_static - xml_path: assets/xml/textures/title_static_pal.xml + xml_path: assets/xml/textures/title_static_pal_gc.xml diff --git a/baseroms/gc-eu-mq/config.yml b/baseroms/gc-eu-mq/config.yml index e04429d0a2..f29e904e85 100644 --- a/baseroms/gc-eu-mq/config.yml +++ b/baseroms/gc-eu-mq/config.yml @@ -1,11 +1,56 @@ dmadata_start: 0x7170 text_lang_pal: true +incbins: + - name: ipl3 + segment: makerom + vram: 0x80000040 + size: 0xFC0 + - name: rspbootText + segment: boot + vram: 0x80005FC0 + size: 0xD0 + - name: aspMainText + segment: code + vram: 0x800E11A0 + size: 0xFB0 + - name: gspS2DEX2d_fifoText + segment: code + vram: 0x800E2150 + size: 0x18C0 + - name: njpgdspMainText + segment: code + vram: 0x800E3A10 + size: 0xAF0 + - name: aspMainData + segment: code + vram: 0x80111010 + size: 0x2E0 + - name: gspF3DZEX2_NoN_PosLight_fifoText + segment: code + vram: 0x801112F0 + size: 0x1630 + - name: gspF3DZEX2_NoN_PosLight_fifoData + segment: code + vram: 0x80112920 + size: 0x420 + - name: gspS2DEX2d_fifoData + segment: code + vram: 0x80112D40 + size: 0x390 + - name: njpgdspMainData + segment: code + vram: 0x801130D0 + size: 0x60 variables: gMtxClear: 0x800FBC00 sNesMessageEntryTable: 0x801077F0 sGerMessageEntryTable: 0x8010BA18 sFraMessageEntryTable: 0x8010DB28 sStaffMessageEntryTable: 0x8010FC38 + gSoundFontTable: 0x80110470 + gSequenceFontTable: 0x801106E0 + gSequenceTable: 0x801108A0 + gSampleBankTable: 0x80110F90 sShadowTex: 0x80A72FA0 assets: - name: code/fbdemo_circle @@ -469,7 +514,7 @@ assets: - name: objects/object_ma2 xml_path: assets/xml/objects/object_ma2.xml - name: objects/object_mag - xml_path: assets/xml/objects/object_mag_mq.xml + xml_path: assets/xml/objects/object_mag_v3_mq.xml - name: objects/object_mamenoki xml_path: assets/xml/objects/object_mamenoki.xml - name: objects/object_mastergolon @@ -879,9 +924,9 @@ assets: start_offset: 0x6E0 end_offset: 0x4088 - name: overlays/ovl_file_choose - xml_path: assets/xml/overlays/ovl_file_choose.xml + xml_path: assets/xml/overlays/ovl_file_choose_pal_gc.xml start_offset: 0xD740 - end_offset: 0xDF80 + end_offset: 0xE010 - name: overlays/ovl_Magic_Dark xml_path: assets/xml/overlays/ovl_Magic_Dark.xml start_offset: 0xC90 @@ -927,7 +972,7 @@ assets: - name: scenes/dungeons/ddan xml_path: assets/xml/scenes/dungeons/ddan_mq.xml - name: scenes/dungeons/ddan_boss - xml_path: assets/xml/scenes/dungeons/ddan_boss.xml + xml_path: assets/xml/scenes/dungeons/ddan_boss_v2.xml - name: scenes/dungeons/FIRE_bs xml_path: assets/xml/scenes/dungeons/FIRE_bs.xml - name: scenes/dungeons/ganon @@ -1097,7 +1142,7 @@ assets: - name: scenes/overworld/spot15 xml_path: assets/xml/scenes/overworld/spot15.xml - name: scenes/overworld/spot16 - xml_path: assets/xml/scenes/overworld/spot16.xml + xml_path: assets/xml/scenes/overworld/spot16_v2.xml - name: scenes/overworld/spot17 xml_path: assets/xml/scenes/overworld/spot17.xml - name: scenes/overworld/spot18 @@ -1155,9 +1200,9 @@ assets: - name: textures/message_texture_static xml_path: assets/xml/textures/message_texture_static.xml - name: textures/nes_font_static - xml_path: assets/xml/textures/nes_font_static.xml + xml_path: assets/xml/textures/nes_font_static_v2.xml - name: textures/nintendo_rogo_static - xml_path: assets/xml/textures/nintendo_rogo_static.xml + xml_path: assets/xml/textures/nintendo_rogo_static_v2.xml - name: textures/parameter_static xml_path: assets/xml/textures/parameter_static.xml - name: textures/place_title_cards @@ -1165,4 +1210,4 @@ assets: - name: textures/skyboxes xml_path: assets/xml/textures/skyboxes.xml - name: textures/title_static - xml_path: assets/xml/textures/title_static_pal.xml + xml_path: assets/xml/textures/title_static_pal_gc.xml diff --git a/baseroms/gc-eu/config.yml b/baseroms/gc-eu/config.yml index 6f48daec7a..de1d26194c 100644 --- a/baseroms/gc-eu/config.yml +++ b/baseroms/gc-eu/config.yml @@ -1,11 +1,56 @@ dmadata_start: 0x7170 text_lang_pal: true +incbins: + - name: ipl3 + segment: makerom + vram: 0x80000040 + size: 0xFC0 + - name: rspbootText + segment: boot + vram: 0x80005FC0 + size: 0xD0 + - name: aspMainText + segment: code + vram: 0x800E11C0 + size: 0xFB0 + - name: gspS2DEX2d_fifoText + segment: code + vram: 0x800E2170 + size: 0x18C0 + - name: njpgdspMainText + segment: code + vram: 0x800E3A30 + size: 0xAF0 + - name: aspMainData + segment: code + vram: 0x80111030 + size: 0x2E0 + - name: gspF3DZEX2_NoN_PosLight_fifoText + segment: code + vram: 0x80111310 + size: 0x1630 + - name: gspF3DZEX2_NoN_PosLight_fifoData + segment: code + vram: 0x80112940 + size: 0x420 + - name: gspS2DEX2d_fifoData + segment: code + vram: 0x80112D60 + size: 0x390 + - name: njpgdspMainData + segment: code + vram: 0x801130F0 + size: 0x60 variables: gMtxClear: 0x800FBC20 sNesMessageEntryTable: 0x80107810 sGerMessageEntryTable: 0x8010BA38 sFraMessageEntryTable: 0x8010DB48 sStaffMessageEntryTable: 0x8010FC58 + gSoundFontTable: 0x80110490 + gSequenceFontTable: 0x80110700 + gSequenceTable: 0x801108C0 + gSampleBankTable: 0x80110FB0 sShadowTex: 0x80A73020 assets: - name: code/fbdemo_circle @@ -469,7 +514,7 @@ assets: - name: objects/object_ma2 xml_path: assets/xml/objects/object_ma2.xml - name: objects/object_mag - xml_path: assets/xml/objects/object_mag.xml + xml_path: assets/xml/objects/object_mag_v3.xml - name: objects/object_mamenoki xml_path: assets/xml/objects/object_mamenoki.xml - name: objects/object_mastergolon @@ -879,9 +924,9 @@ assets: start_offset: 0x6E0 end_offset: 0x4088 - name: overlays/ovl_file_choose - xml_path: assets/xml/overlays/ovl_file_choose.xml + xml_path: assets/xml/overlays/ovl_file_choose_pal_gc.xml start_offset: 0xD740 - end_offset: 0xDF80 + end_offset: 0xE010 - name: overlays/ovl_Magic_Dark xml_path: assets/xml/overlays/ovl_Magic_Dark.xml start_offset: 0xC90 @@ -927,7 +972,7 @@ assets: - name: scenes/dungeons/ddan xml_path: assets/xml/scenes/dungeons/ddan.xml - name: scenes/dungeons/ddan_boss - xml_path: assets/xml/scenes/dungeons/ddan_boss.xml + xml_path: assets/xml/scenes/dungeons/ddan_boss_v2.xml - name: scenes/dungeons/FIRE_bs xml_path: assets/xml/scenes/dungeons/FIRE_bs.xml - name: scenes/dungeons/ganon @@ -955,7 +1000,7 @@ assets: - name: scenes/dungeons/HIDAN xml_path: assets/xml/scenes/dungeons/HIDAN.xml - name: scenes/dungeons/ice_doukutu - xml_path: assets/xml/scenes/dungeons/ice_doukutu.xml + xml_path: assets/xml/scenes/dungeons/ice_doukutu_v2.xml - name: scenes/dungeons/jyasinboss xml_path: assets/xml/scenes/dungeons/jyasinboss.xml - name: scenes/dungeons/jyasinzou @@ -1097,7 +1142,7 @@ assets: - name: scenes/overworld/spot15 xml_path: assets/xml/scenes/overworld/spot15.xml - name: scenes/overworld/spot16 - xml_path: assets/xml/scenes/overworld/spot16.xml + xml_path: assets/xml/scenes/overworld/spot16_v2.xml - name: scenes/overworld/spot17 xml_path: assets/xml/scenes/overworld/spot17.xml - name: scenes/overworld/spot18 @@ -1155,9 +1200,9 @@ assets: - name: textures/message_texture_static xml_path: assets/xml/textures/message_texture_static.xml - name: textures/nes_font_static - xml_path: assets/xml/textures/nes_font_static.xml + xml_path: assets/xml/textures/nes_font_static_v2.xml - name: textures/nintendo_rogo_static - xml_path: assets/xml/textures/nintendo_rogo_static.xml + xml_path: assets/xml/textures/nintendo_rogo_static_v2.xml - name: textures/parameter_static xml_path: assets/xml/textures/parameter_static.xml - name: textures/place_title_cards @@ -1165,4 +1210,4 @@ assets: - name: textures/skyboxes xml_path: assets/xml/textures/skyboxes.xml - name: textures/title_static - xml_path: assets/xml/textures/title_static_pal.xml + xml_path: assets/xml/textures/title_static_pal_gc.xml diff --git a/baseroms/gc-jp-ce/checksum-compressed.md5 b/baseroms/gc-jp-ce/checksum-compressed.md5 new file mode 100644 index 0000000000..64f7a5219b --- /dev/null +++ b/baseroms/gc-jp-ce/checksum-compressed.md5 @@ -0,0 +1 @@ +0c13e0449a28ea5b925cdb8af8d29768 build/gc-jp-ce/oot-gc-jp-ce-compressed.z64 diff --git a/baseroms/gc-jp-ce/checksum.md5 b/baseroms/gc-jp-ce/checksum.md5 new file mode 100644 index 0000000000..2959de97b2 --- /dev/null +++ b/baseroms/gc-jp-ce/checksum.md5 @@ -0,0 +1 @@ +fe2f22c16e03762513b5af5449d453aa build/gc-jp-ce/oot-gc-jp-ce.z64 diff --git a/baseroms/gc-jp-ce/config.yml b/baseroms/gc-jp-ce/config.yml new file mode 100644 index 0000000000..3a3de8c818 --- /dev/null +++ b/baseroms/gc-jp-ce/config.yml @@ -0,0 +1,1212 @@ +dmadata_start: 0x7170 +text_lang_pal: false +incbins: + - name: ipl3 + segment: makerom + vram: 0x80000040 + size: 0xFC0 + - name: rspbootText + segment: boot + vram: 0x80005FC0 + size: 0xD0 + - name: aspMainText + segment: code + vram: 0x800E3840 + size: 0xFB0 + - name: gspS2DEX2d_fifoText + segment: code + vram: 0x800E47F0 + size: 0x18C0 + - name: njpgdspMainText + segment: code + vram: 0x800E60B0 + size: 0xAF0 + - name: aspMainData + segment: code + vram: 0x80113820 + size: 0x2E0 + - name: gspF3DZEX2_NoN_PosLight_fifoText + segment: code + vram: 0x80113B00 + size: 0x1630 + - name: gspF3DZEX2_NoN_PosLight_fifoData + segment: code + vram: 0x80115130 + size: 0x420 + - name: gspS2DEX2d_fifoData + segment: code + vram: 0x80115550 + size: 0x390 + - name: njpgdspMainData + segment: code + vram: 0x801158E0 + size: 0x60 +variables: + gMtxClear: 0x800FE2A0 + sJpnMessageEntryTable: 0x80109E8C + sNesMessageEntryTable: 0x8010DFCC + sStaffMessageEntryTable: 0x801121EC + gSoundFontTable: 0x80112C80 + gSequenceFontTable: 0x80112EF0 + gSequenceTable: 0x801130B0 + gSampleBankTable: 0x801137A0 + sShadowTex: 0x80A74120 +assets: +- name: code/fbdemo_circle + xml_path: assets/xml/code/fbdemo_circle.xml + start_offset: 0xEB768 + end_offset: 0xEC988 +- name: code/fbdemo_triforce + xml_path: assets/xml/code/fbdemo_triforce.xml + start_offset: 0xEABF0 + end_offset: 0xEACC0 +- name: code/fbdemo_wipe1 + xml_path: assets/xml/code/fbdemo_wipe1.xml + start_offset: 0xEACC0 + end_offset: 0xEB650 +- name: misc/link_animetion + xml_path: assets/xml/misc/link_animetion.xml +- name: misc/z_select_static + xml_path: assets/xml/misc/z_select_static.xml +- name: objects/gameplay_dangeon_keep + xml_path: assets/xml/objects/gameplay_dangeon_keep.xml +- name: objects/gameplay_field_keep + xml_path: assets/xml/objects/gameplay_field_keep.xml +- name: objects/gameplay_keep + xml_path: assets/xml/objects/gameplay_keep.xml +- name: objects/object_ahg + xml_path: assets/xml/objects/object_ahg.xml +- name: objects/object_am + xml_path: assets/xml/objects/object_am.xml +- name: objects/object_ane + xml_path: assets/xml/objects/object_ane.xml +- name: objects/object_ani + xml_path: assets/xml/objects/object_ani.xml +- name: objects/object_anubice + xml_path: assets/xml/objects/object_anubice.xml +- name: objects/object_aob + xml_path: assets/xml/objects/object_aob.xml +- name: objects/object_b_heart + xml_path: assets/xml/objects/object_b_heart.xml +- name: objects/object_Bb + xml_path: assets/xml/objects/object_Bb.xml +- name: objects/object_bba + xml_path: assets/xml/objects/object_bba.xml +- name: objects/object_bdan_objects + xml_path: assets/xml/objects/object_bdan_objects.xml +- name: objects/object_bdoor + xml_path: assets/xml/objects/object_bdoor.xml +- name: objects/object_bg + xml_path: assets/xml/objects/object_bg.xml +- name: objects/object_bigokuta + xml_path: assets/xml/objects/object_bigokuta.xml +- name: objects/object_bird + xml_path: assets/xml/objects/object_bird.xml +- name: objects/object_bji + xml_path: assets/xml/objects/object_bji.xml +- name: objects/object_bl + xml_path: assets/xml/objects/object_bl.xml +- name: objects/object_blkobj + xml_path: assets/xml/objects/object_blkobj.xml +- name: objects/object_bob + xml_path: assets/xml/objects/object_bob.xml +- name: objects/object_boj + xml_path: assets/xml/objects/object_boj.xml +- name: objects/object_bombf + xml_path: assets/xml/objects/object_bombf.xml +- name: objects/object_bombiwa + xml_path: assets/xml/objects/object_bombiwa.xml +- name: objects/object_bowl + xml_path: assets/xml/objects/object_bowl.xml +- name: objects/object_box + xml_path: assets/xml/objects/object_box.xml +- name: objects/object_brob + xml_path: assets/xml/objects/object_brob.xml +- name: objects/object_bubble + xml_path: assets/xml/objects/object_bubble.xml +- name: objects/object_bv + xml_path: assets/xml/objects/object_bv.xml +- name: objects/object_bw + xml_path: assets/xml/objects/object_bw.xml +- name: objects/object_bwall + xml_path: assets/xml/objects/object_bwall.xml +- name: objects/object_bxa + xml_path: assets/xml/objects/object_bxa.xml +- name: objects/object_cne + xml_path: assets/xml/objects/object_cne.xml +- name: objects/object_cob + xml_path: assets/xml/objects/object_cob.xml +- name: objects/object_cow + xml_path: assets/xml/objects/object_cow.xml +- name: objects/object_crow + xml_path: assets/xml/objects/object_crow.xml +- name: objects/object_cs + xml_path: assets/xml/objects/object_cs.xml +- name: objects/object_d_elevator + xml_path: assets/xml/objects/object_d_elevator.xml +- name: objects/object_d_hsblock + xml_path: assets/xml/objects/object_d_hsblock.xml +- name: objects/object_d_lift + xml_path: assets/xml/objects/object_d_lift.xml +- name: objects/object_daiku + xml_path: assets/xml/objects/object_daiku.xml +- name: objects/object_ddan_objects + xml_path: assets/xml/objects/object_ddan_objects.xml +- name: objects/object_dekubaba + xml_path: assets/xml/objects/object_dekubaba.xml +- name: objects/object_dekujr + xml_path: assets/xml/objects/object_dekujr.xml +- name: objects/object_dekunuts + xml_path: assets/xml/objects/object_dekunuts.xml +- name: objects/object_demo_6k + xml_path: assets/xml/objects/object_demo_6k.xml +- name: objects/object_demo_kekkai + xml_path: assets/xml/objects/object_demo_kekkai.xml +- name: objects/object_demo_tre_lgt + xml_path: assets/xml/objects/object_demo_tre_lgt.xml +- name: objects/object_dh + xml_path: assets/xml/objects/object_dh.xml +- name: objects/object_dnk + xml_path: assets/xml/objects/object_dnk.xml +- name: objects/object_dns + xml_path: assets/xml/objects/object_dns.xml +- name: objects/object_dodojr + xml_path: assets/xml/objects/object_dodojr.xml +- name: objects/object_dodongo + xml_path: assets/xml/objects/object_dodongo.xml +- name: objects/object_dog + xml_path: assets/xml/objects/object_dog.xml +- name: objects/object_door_gerudo + xml_path: assets/xml/objects/object_door_gerudo.xml +- name: objects/object_door_killer + xml_path: assets/xml/objects/object_door_killer.xml +- name: objects/object_ds + xml_path: assets/xml/objects/object_ds.xml +- name: objects/object_ds2 + xml_path: assets/xml/objects/object_ds2.xml +- name: objects/object_du + xml_path: assets/xml/objects/object_du.xml +- name: objects/object_dy_obj + xml_path: assets/xml/objects/object_dy_obj.xml +- name: objects/object_ec + xml_path: assets/xml/objects/object_ec.xml +- name: objects/object_efc_crystal_light + xml_path: assets/xml/objects/object_efc_crystal_light.xml +- name: objects/object_efc_doughnut + xml_path: assets/xml/objects/object_efc_doughnut.xml +- name: objects/object_efc_erupc + xml_path: assets/xml/objects/object_efc_erupc.xml +- name: objects/object_efc_fire_ball + xml_path: assets/xml/objects/object_efc_fire_ball.xml +- name: objects/object_efc_flash + xml_path: assets/xml/objects/object_efc_flash.xml +- name: objects/object_efc_lgt_shower + xml_path: assets/xml/objects/object_efc_lgt_shower.xml +- name: objects/object_efc_star_field + xml_path: assets/xml/objects/object_efc_star_field.xml +- name: objects/object_efc_tw + xml_path: assets/xml/objects/object_efc_tw.xml +- name: objects/object_ei + xml_path: assets/xml/objects/object_ei.xml +- name: objects/object_fa + xml_path: assets/xml/objects/object_fa.xml +- name: objects/object_fd + xml_path: assets/xml/objects/object_fd.xml +- name: objects/object_fd2 + xml_path: assets/xml/objects/object_fd2.xml +- name: objects/object_fhg + xml_path: assets/xml/objects/object_fhg.xml +- name: objects/object_fire + xml_path: assets/xml/objects/object_fire.xml +- name: objects/object_firefly + xml_path: assets/xml/objects/object_firefly.xml +- name: objects/object_fish + xml_path: assets/xml/objects/object_fish.xml +- name: objects/object_fr + xml_path: assets/xml/objects/object_fr.xml +- name: objects/object_fu + xml_path: assets/xml/objects/object_fu.xml +- name: objects/object_fw + xml_path: assets/xml/objects/object_fw.xml +- name: objects/object_fz + xml_path: assets/xml/objects/object_fz.xml +- name: objects/object_ganon + xml_path: assets/xml/objects/object_ganon.xml +- name: objects/object_ganon2 + xml_path: assets/xml/objects/object_ganon2.xml +- name: objects/object_ganon_anime1 + xml_path: assets/xml/objects/object_ganon_anime1.xml +- name: objects/object_ganon_anime2 + xml_path: assets/xml/objects/object_ganon_anime2.xml +- name: objects/object_ganon_anime3 + xml_path: assets/xml/objects/object_ganon_anime3.xml +- name: objects/object_ganon_objects + xml_path: assets/xml/objects/object_ganon_objects.xml +- name: objects/object_ge1 + xml_path: assets/xml/objects/object_ge1.xml +- name: objects/object_geff + xml_path: assets/xml/objects/object_geff.xml +- name: objects/object_geldb + xml_path: assets/xml/objects/object_geldb.xml +- name: objects/object_gi_arrow + xml_path: assets/xml/objects/object_gi_arrow.xml +- name: objects/object_gi_arrowcase + xml_path: assets/xml/objects/object_gi_arrowcase.xml +- name: objects/object_gi_bean + xml_path: assets/xml/objects/object_gi_bean.xml +- name: objects/object_gi_bomb_1 + xml_path: assets/xml/objects/object_gi_bomb_1.xml +- name: objects/object_gi_bomb_2 + xml_path: assets/xml/objects/object_gi_bomb_2.xml +- name: objects/object_gi_bombpouch + xml_path: assets/xml/objects/object_gi_bombpouch.xml +- name: objects/object_gi_boomerang + xml_path: assets/xml/objects/object_gi_boomerang.xml +- name: objects/object_gi_boots_2 + xml_path: assets/xml/objects/object_gi_boots_2.xml +- name: objects/object_gi_bosskey + xml_path: assets/xml/objects/object_gi_bosskey.xml +- name: objects/object_gi_bottle + xml_path: assets/xml/objects/object_gi_bottle.xml +- name: objects/object_gi_bottle_letter + xml_path: assets/xml/objects/object_gi_bottle_letter.xml +- name: objects/object_gi_bow + xml_path: assets/xml/objects/object_gi_bow.xml +- name: objects/object_gi_bracelet + xml_path: assets/xml/objects/object_gi_bracelet.xml +- name: objects/object_gi_brokensword + xml_path: assets/xml/objects/object_gi_brokensword.xml +- name: objects/object_gi_butterfly + xml_path: assets/xml/objects/object_gi_butterfly.xml +- name: objects/object_gi_clothes + xml_path: assets/xml/objects/object_gi_clothes.xml +- name: objects/object_gi_coin + xml_path: assets/xml/objects/object_gi_coin.xml +- name: objects/object_gi_compass + xml_path: assets/xml/objects/object_gi_compass.xml +- name: objects/object_gi_dekupouch + xml_path: assets/xml/objects/object_gi_dekupouch.xml +- name: objects/object_gi_egg + xml_path: assets/xml/objects/object_gi_egg.xml +- name: objects/object_gi_eye_lotion + xml_path: assets/xml/objects/object_gi_eye_lotion.xml +- name: objects/object_gi_fire + xml_path: assets/xml/objects/object_gi_fire.xml +- name: objects/object_gi_fish + xml_path: assets/xml/objects/object_gi_fish.xml +- name: objects/object_gi_frog + xml_path: assets/xml/objects/object_gi_frog.xml +- name: objects/object_gi_gerudo + xml_path: assets/xml/objects/object_gi_gerudo.xml +- name: objects/object_gi_gerudomask + xml_path: assets/xml/objects/object_gi_gerudomask.xml +- name: objects/object_gi_ghost + xml_path: assets/xml/objects/object_gi_ghost.xml +- name: objects/object_gi_glasses + xml_path: assets/xml/objects/object_gi_glasses.xml +- name: objects/object_gi_gloves + xml_path: assets/xml/objects/object_gi_gloves.xml +- name: objects/object_gi_goddess + xml_path: assets/xml/objects/object_gi_goddess.xml +- name: objects/object_gi_golonmask + xml_path: assets/xml/objects/object_gi_golonmask.xml +- name: objects/object_gi_grass + xml_path: assets/xml/objects/object_gi_grass.xml +- name: objects/object_gi_hammer + xml_path: assets/xml/objects/object_gi_hammer.xml +- name: objects/object_gi_heart + xml_path: assets/xml/objects/object_gi_heart.xml +- name: objects/object_gi_hearts + xml_path: assets/xml/objects/object_gi_hearts.xml +- name: objects/object_gi_hookshot + xml_path: assets/xml/objects/object_gi_hookshot.xml +- name: objects/object_gi_hoverboots + xml_path: assets/xml/objects/object_gi_hoverboots.xml +- name: objects/object_gi_insect + xml_path: assets/xml/objects/object_gi_insect.xml +- name: objects/object_gi_jewel + xml_path: assets/xml/objects/object_gi_jewel.xml +- name: objects/object_gi_key + xml_path: assets/xml/objects/object_gi_key.xml +- name: objects/object_gi_ki_tan_mask + xml_path: assets/xml/objects/object_gi_ki_tan_mask.xml +- name: objects/object_gi_letter + xml_path: assets/xml/objects/object_gi_letter.xml +- name: objects/object_gi_liquid + xml_path: assets/xml/objects/object_gi_liquid.xml +- name: objects/object_gi_longsword + xml_path: assets/xml/objects/object_gi_longsword.xml +- name: objects/object_gi_m_arrow + xml_path: assets/xml/objects/object_gi_m_arrow.xml +- name: objects/object_gi_magicpot + xml_path: assets/xml/objects/object_gi_magicpot.xml +- name: objects/object_gi_map + xml_path: assets/xml/objects/object_gi_map.xml +- name: objects/object_gi_medal + xml_path: assets/xml/objects/object_gi_medal.xml +- name: objects/object_gi_melody + xml_path: assets/xml/objects/object_gi_melody.xml +- name: objects/object_gi_milk + xml_path: assets/xml/objects/object_gi_milk.xml +- name: objects/object_gi_mushroom + xml_path: assets/xml/objects/object_gi_mushroom.xml +- name: objects/object_gi_niwatori + xml_path: assets/xml/objects/object_gi_niwatori.xml +- name: objects/object_gi_nuts + xml_path: assets/xml/objects/object_gi_nuts.xml +- name: objects/object_gi_ocarina + xml_path: assets/xml/objects/object_gi_ocarina.xml +- name: objects/object_gi_ocarina_0 + xml_path: assets/xml/objects/object_gi_ocarina_0.xml +- name: objects/object_gi_pachinko + xml_path: assets/xml/objects/object_gi_pachinko.xml +- name: objects/object_gi_powder + xml_path: assets/xml/objects/object_gi_powder.xml +- name: objects/object_gi_prescription + xml_path: assets/xml/objects/object_gi_prescription.xml +- name: objects/object_gi_purse + xml_path: assets/xml/objects/object_gi_purse.xml +- name: objects/object_gi_rabit_mask + xml_path: assets/xml/objects/object_gi_rabit_mask.xml +- name: objects/object_gi_redead_mask + xml_path: assets/xml/objects/object_gi_redead_mask.xml +- name: objects/object_gi_rupy + xml_path: assets/xml/objects/object_gi_rupy.xml +- name: objects/object_gi_saw + xml_path: assets/xml/objects/object_gi_saw.xml +- name: objects/object_gi_scale + xml_path: assets/xml/objects/object_gi_scale.xml +- name: objects/object_gi_seed + xml_path: assets/xml/objects/object_gi_seed.xml +- name: objects/object_gi_shield_1 + xml_path: assets/xml/objects/object_gi_shield_1.xml +- name: objects/object_gi_shield_2 + xml_path: assets/xml/objects/object_gi_shield_2.xml +- name: objects/object_gi_shield_3 + xml_path: assets/xml/objects/object_gi_shield_3.xml +- name: objects/object_gi_skj_mask + xml_path: assets/xml/objects/object_gi_skj_mask.xml +- name: objects/object_gi_soldout + xml_path: assets/xml/objects/object_gi_soldout.xml +- name: objects/object_gi_soul + xml_path: assets/xml/objects/object_gi_soul.xml +- name: objects/object_gi_stick + xml_path: assets/xml/objects/object_gi_stick.xml +- name: objects/object_gi_sutaru + xml_path: assets/xml/objects/object_gi_sutaru.xml +- name: objects/object_gi_sword_1 + xml_path: assets/xml/objects/object_gi_sword_1.xml +- name: objects/object_gi_ticketstone + xml_path: assets/xml/objects/object_gi_ticketstone.xml +- name: objects/object_gi_truth_mask + xml_path: assets/xml/objects/object_gi_truth_mask.xml +- name: objects/object_gi_zoramask + xml_path: assets/xml/objects/object_gi_zoramask.xml +- name: objects/object_gj + xml_path: assets/xml/objects/object_gj.xml +- name: objects/object_gjyo_objects + xml_path: assets/xml/objects/object_gjyo_objects.xml +- name: objects/object_gla + xml_path: assets/xml/objects/object_gla.xml +- name: objects/object_gm + xml_path: assets/xml/objects/object_gm.xml +- name: objects/object_gnd + xml_path: assets/xml/objects/object_gnd.xml +- name: objects/object_gnd_magic + xml_path: assets/xml/objects/object_gnd_magic.xml +- name: objects/object_gndd + xml_path: assets/xml/objects/object_gndd.xml +- name: objects/object_god_lgt + xml_path: assets/xml/objects/object_god_lgt.xml +- name: objects/object_gol + xml_path: assets/xml/objects/object_gol.xml +- name: objects/object_goma + xml_path: assets/xml/objects/object_goma.xml +- name: objects/object_goroiwa + xml_path: assets/xml/objects/object_goroiwa.xml +- name: objects/object_gr + xml_path: assets/xml/objects/object_gr.xml +- name: objects/object_gs + xml_path: assets/xml/objects/object_gs.xml +- name: objects/object_gt + xml_path: assets/xml/objects/object_gt.xml +- name: objects/object_haka + xml_path: assets/xml/objects/object_haka.xml +- name: objects/object_haka_door + xml_path: assets/xml/objects/object_haka_door.xml +- name: objects/object_haka_objects + xml_path: assets/xml/objects/object_haka_objects.xml +- name: objects/object_hakach_objects + xml_path: assets/xml/objects/object_hakach_objects.xml +- name: objects/object_hata + xml_path: assets/xml/objects/object_hata.xml +- name: objects/object_heavy_object + xml_path: assets/xml/objects/object_heavy_object.xml +- name: objects/object_hidan_objects + xml_path: assets/xml/objects/object_hidan_objects.xml +- name: objects/object_hintnuts + xml_path: assets/xml/objects/object_hintnuts.xml +- name: objects/object_hni + xml_path: assets/xml/objects/object_hni.xml +- name: objects/object_horse + xml_path: assets/xml/objects/object_horse.xml +- name: objects/object_horse_ganon + xml_path: assets/xml/objects/object_horse_ganon.xml +- name: objects/object_horse_link_child + xml_path: assets/xml/objects/object_horse_link_child.xml +- name: objects/object_horse_normal + xml_path: assets/xml/objects/object_horse_normal.xml +- name: objects/object_horse_zelda + xml_path: assets/xml/objects/object_horse_zelda.xml +- name: objects/object_hs + xml_path: assets/xml/objects/object_hs.xml +- name: objects/object_human + xml_path: assets/xml/objects/object_human.xml +- name: objects/object_ice_objects + xml_path: assets/xml/objects/object_ice_objects.xml +- name: objects/object_ik + xml_path: assets/xml/objects/object_ik.xml +- name: objects/object_im + xml_path: assets/xml/objects/object_im.xml +- name: objects/object_in + xml_path: assets/xml/objects/object_in.xml +- name: objects/object_ingate + xml_path: assets/xml/objects/object_ingate.xml +- name: objects/object_jj + xml_path: assets/xml/objects/object_jj.xml +- name: objects/object_js + xml_path: assets/xml/objects/object_js.xml +- name: objects/object_jya_door + xml_path: assets/xml/objects/object_jya_door.xml +- name: objects/object_jya_iron + xml_path: assets/xml/objects/object_jya_iron.xml +- name: objects/object_jya_obj + xml_path: assets/xml/objects/object_jya_obj.xml +- name: objects/object_ka + xml_path: assets/xml/objects/object_ka.xml +- name: objects/object_kanban + xml_path: assets/xml/objects/object_kanban.xml +- name: objects/object_kibako2 + xml_path: assets/xml/objects/object_kibako2.xml +- name: objects/object_kingdodongo + xml_path: assets/xml/objects/object_kingdodongo.xml +- name: objects/object_km1 + xml_path: assets/xml/objects/object_km1.xml +- name: objects/object_kusa + xml_path: assets/xml/objects/object_kusa.xml +- name: objects/object_kw1 + xml_path: assets/xml/objects/object_kw1.xml +- name: objects/object_kz + xml_path: assets/xml/objects/object_kz.xml +- name: objects/object_light_ring + xml_path: assets/xml/objects/object_light_ring.xml +- name: objects/object_lightbox + xml_path: assets/xml/objects/object_lightbox.xml +- name: objects/object_lightswitch + xml_path: assets/xml/objects/object_lightswitch.xml +- name: objects/object_link_boy + xml_path: assets/xml/objects/object_link_boy.xml +- name: objects/object_link_child + xml_path: assets/xml/objects/object_link_child.xml +- name: objects/object_ma1 + xml_path: assets/xml/objects/object_ma1.xml +- name: objects/object_ma2 + xml_path: assets/xml/objects/object_ma2.xml +- name: objects/object_mag + xml_path: assets/xml/objects/object_mag_v3.xml +- name: objects/object_mamenoki + xml_path: assets/xml/objects/object_mamenoki.xml +- name: objects/object_mastergolon + xml_path: assets/xml/objects/object_mastergolon.xml +- name: objects/object_masterkokiri + xml_path: assets/xml/objects/object_masterkokiri.xml +- name: objects/object_masterkokirihead + xml_path: assets/xml/objects/object_masterkokirihead.xml +- name: objects/object_masterzoora + xml_path: assets/xml/objects/object_masterzoora.xml +- name: objects/object_mb + xml_path: assets/xml/objects/object_mb.xml +- name: objects/object_md + xml_path: assets/xml/objects/object_md.xml +- name: objects/object_medal + xml_path: assets/xml/objects/object_medal.xml +- name: objects/object_menkuri_objects + xml_path: assets/xml/objects/object_menkuri_objects.xml +- name: objects/object_mir_ray + xml_path: assets/xml/objects/object_mir_ray.xml +- name: objects/object_mizu_objects + xml_path: assets/xml/objects/object_mizu_objects.xml +- name: objects/object_mjin + xml_path: assets/xml/objects/object_mjin.xml +- name: objects/object_mjin_dark + xml_path: assets/xml/objects/object_mjin_dark.xml +- name: objects/object_mjin_flame + xml_path: assets/xml/objects/object_mjin_flame.xml +- name: objects/object_mjin_flash + xml_path: assets/xml/objects/object_mjin_flash.xml +- name: objects/object_mjin_ice + xml_path: assets/xml/objects/object_mjin_ice.xml +- name: objects/object_mjin_oka + xml_path: assets/xml/objects/object_mjin_oka.xml +- name: objects/object_mjin_soul + xml_path: assets/xml/objects/object_mjin_soul.xml +- name: objects/object_mjin_wind + xml_path: assets/xml/objects/object_mjin_wind.xml +- name: objects/object_mk + xml_path: assets/xml/objects/object_mk.xml +- name: objects/object_mm + xml_path: assets/xml/objects/object_mm.xml +- name: objects/object_mo + xml_path: assets/xml/objects/object_mo.xml +- name: objects/object_mori_hineri1 + xml_path: assets/xml/objects/object_mori_hineri1.xml +- name: objects/object_mori_hineri1a + xml_path: assets/xml/objects/object_mori_hineri1a.xml +- name: objects/object_mori_hineri2 + xml_path: assets/xml/objects/object_mori_hineri2.xml +- name: objects/object_mori_hineri2a + xml_path: assets/xml/objects/object_mori_hineri2a.xml +- name: objects/object_mori_objects + xml_path: assets/xml/objects/object_mori_objects.xml +- name: objects/object_mori_tex + xml_path: assets/xml/objects/object_mori_tex.xml +- name: objects/object_ms + xml_path: assets/xml/objects/object_ms.xml +- name: objects/object_mu + xml_path: assets/xml/objects/object_mu.xml +- name: objects/object_nb + xml_path: assets/xml/objects/object_nb.xml +- name: objects/object_niw + xml_path: assets/xml/objects/object_niw.xml +- name: objects/object_nwc + xml_path: assets/xml/objects/object_nwc.xml +- name: objects/object_ny + xml_path: assets/xml/objects/object_ny.xml +- name: objects/object_o_anime + xml_path: assets/xml/objects/object_o_anime.xml +- name: objects/object_oA1 + xml_path: assets/xml/objects/object_oA1.xml +- name: objects/object_oA2 + xml_path: assets/xml/objects/object_oA2.xml +- name: objects/object_oA3 + xml_path: assets/xml/objects/object_oA3.xml +- name: objects/object_oA4 + xml_path: assets/xml/objects/object_oA4.xml +- name: objects/object_oA5 + xml_path: assets/xml/objects/object_oA5.xml +- name: objects/object_oA6 + xml_path: assets/xml/objects/object_oA6.xml +- name: objects/object_oA7 + xml_path: assets/xml/objects/object_oA7.xml +- name: objects/object_oA8 + xml_path: assets/xml/objects/object_oA8.xml +- name: objects/object_oA9 + xml_path: assets/xml/objects/object_oA9.xml +- name: objects/object_oA10 + xml_path: assets/xml/objects/object_oA10.xml +- name: objects/object_oA11 + xml_path: assets/xml/objects/object_oA11.xml +- name: objects/object_oB1 + xml_path: assets/xml/objects/object_oB1.xml +- name: objects/object_oB2 + xml_path: assets/xml/objects/object_oB2.xml +- name: objects/object_oB3 + xml_path: assets/xml/objects/object_oB3.xml +- name: objects/object_oB4 + xml_path: assets/xml/objects/object_oB4.xml +- name: objects/object_oE1 + xml_path: assets/xml/objects/object_oE1.xml +- name: objects/object_oE1s + xml_path: assets/xml/objects/object_oE1s.xml +- name: objects/object_oE2 + xml_path: assets/xml/objects/object_oE2.xml +- name: objects/object_oE3 + xml_path: assets/xml/objects/object_oE3.xml +- name: objects/object_oE4 + xml_path: assets/xml/objects/object_oE4.xml +- name: objects/object_oE4s + xml_path: assets/xml/objects/object_oE4s.xml +- name: objects/object_oE5 + xml_path: assets/xml/objects/object_oE5.xml +- name: objects/object_oE6 + xml_path: assets/xml/objects/object_oE6.xml +- name: objects/object_oE7 + xml_path: assets/xml/objects/object_oE7.xml +- name: objects/object_oE8 + xml_path: assets/xml/objects/object_oE8.xml +- name: objects/object_oE9 + xml_path: assets/xml/objects/object_oE9.xml +- name: objects/object_oE10 + xml_path: assets/xml/objects/object_oE10.xml +- name: objects/object_oE11 + xml_path: assets/xml/objects/object_oE11.xml +- name: objects/object_oE12 + xml_path: assets/xml/objects/object_oE12.xml +- name: objects/object_oE_anime + xml_path: assets/xml/objects/object_oE_anime.xml +- name: objects/object_oF1d_map + xml_path: assets/xml/objects/object_oF1d_map.xml +- name: objects/object_oF1s + xml_path: assets/xml/objects/object_oF1s.xml +- name: objects/object_okuta + xml_path: assets/xml/objects/object_okuta.xml +- name: objects/object_opening_demo1 + xml_path: assets/xml/objects/object_opening_demo1.xml +- name: objects/object_os + xml_path: assets/xml/objects/object_os.xml +- name: objects/object_os_anime + xml_path: assets/xml/objects/object_os_anime.xml +- name: objects/object_ossan + xml_path: assets/xml/objects/object_ossan.xml +- name: objects/object_ouke_haka + xml_path: assets/xml/objects/object_ouke_haka.xml +- name: objects/object_owl + xml_path: assets/xml/objects/object_owl.xml +- name: objects/object_peehat + xml_path: assets/xml/objects/object_peehat.xml +- name: objects/object_po_composer + xml_path: assets/xml/objects/object_po_composer.xml +- name: objects/object_po_field + xml_path: assets/xml/objects/object_po_field.xml +- name: objects/object_po_sisters + xml_path: assets/xml/objects/object_po_sisters.xml +- name: objects/object_poh + xml_path: assets/xml/objects/object_poh.xml +- name: objects/object_ps + xml_path: assets/xml/objects/object_ps.xml +- name: objects/object_pu_box + xml_path: assets/xml/objects/object_pu_box.xml +- name: objects/object_rd + xml_path: assets/xml/objects/object_rd.xml +- name: objects/object_reeba + xml_path: assets/xml/objects/object_reeba.xml +- name: objects/object_relay_objects + xml_path: assets/xml/objects/object_relay_objects.xml +- name: objects/object_rl + xml_path: assets/xml/objects/object_rl.xml +- name: objects/object_rr + xml_path: assets/xml/objects/object_rr.xml +- name: objects/object_rs + xml_path: assets/xml/objects/object_rs.xml +- name: objects/object_ru1 + xml_path: assets/xml/objects/object_ru1.xml +- name: objects/object_ru2 + xml_path: assets/xml/objects/object_ru2.xml +- name: objects/object_sa + xml_path: assets/xml/objects/object_sa.xml +- name: objects/object_sb + xml_path: assets/xml/objects/object_sb.xml +- name: objects/object_sd + xml_path: assets/xml/objects/object_sd.xml +- name: objects/object_shop_dungen + xml_path: assets/xml/objects/object_shop_dungen.xml +- name: objects/object_shopnuts + xml_path: assets/xml/objects/object_shopnuts.xml +- name: objects/object_siofuki + xml_path: assets/xml/objects/object_siofuki.xml +- name: objects/object_sk2 + xml_path: assets/xml/objects/object_sk2.xml +- name: objects/object_skb + xml_path: assets/xml/objects/object_skb.xml +- name: objects/object_skj + xml_path: assets/xml/objects/object_skj.xml +- name: objects/object_spot00_break + xml_path: assets/xml/objects/object_spot00_break.xml +- name: objects/object_spot00_objects + xml_path: assets/xml/objects/object_spot00_objects.xml +- name: objects/object_spot01_matoya + xml_path: assets/xml/objects/object_spot01_matoya.xml +- name: objects/object_spot01_matoyab + xml_path: assets/xml/objects/object_spot01_matoyab.xml +- name: objects/object_spot01_objects + xml_path: assets/xml/objects/object_spot01_objects.xml +- name: objects/object_spot01_objects2 + xml_path: assets/xml/objects/object_spot01_objects2.xml +- name: objects/object_spot02_objects + xml_path: assets/xml/objects/object_spot02_objects.xml +- name: objects/object_spot03_object + xml_path: assets/xml/objects/object_spot03_object.xml +- name: objects/object_spot04_objects + xml_path: assets/xml/objects/object_spot04_objects.xml +- name: objects/object_spot05_objects + xml_path: assets/xml/objects/object_spot05_objects.xml +- name: objects/object_spot06_objects + xml_path: assets/xml/objects/object_spot06_objects.xml +- name: objects/object_spot07_object + xml_path: assets/xml/objects/object_spot07_object.xml +- name: objects/object_spot08_obj + xml_path: assets/xml/objects/object_spot08_obj.xml +- name: objects/object_spot09_obj + xml_path: assets/xml/objects/object_spot09_obj.xml +- name: objects/object_spot11_obj + xml_path: assets/xml/objects/object_spot11_obj.xml +- name: objects/object_spot12_obj + xml_path: assets/xml/objects/object_spot12_obj.xml +- name: objects/object_spot15_obj + xml_path: assets/xml/objects/object_spot15_obj.xml +- name: objects/object_spot16_obj + xml_path: assets/xml/objects/object_spot16_obj.xml +- name: objects/object_spot17_obj + xml_path: assets/xml/objects/object_spot17_obj.xml +- name: objects/object_spot18_obj + xml_path: assets/xml/objects/object_spot18_obj.xml +- name: objects/object_ssh + xml_path: assets/xml/objects/object_ssh.xml +- name: objects/object_sst + xml_path: assets/xml/objects/object_sst.xml +- name: objects/object_st + xml_path: assets/xml/objects/object_st.xml +- name: objects/object_stream + xml_path: assets/xml/objects/object_stream.xml +- name: objects/object_syokudai + xml_path: assets/xml/objects/object_syokudai.xml +- name: objects/object_ta + xml_path: assets/xml/objects/object_ta.xml +- name: objects/object_timeblock + xml_path: assets/xml/objects/object_timeblock.xml +- name: objects/object_tite + xml_path: assets/xml/objects/object_tite.xml +- name: objects/object_tk + xml_path: assets/xml/objects/object_tk.xml +- name: objects/object_toki_objects + xml_path: assets/xml/objects/object_toki_objects.xml +- name: objects/object_torch2 + xml_path: assets/xml/objects/object_torch2.xml +- name: objects/object_toryo + xml_path: assets/xml/objects/object_toryo.xml +- name: objects/object_tp + xml_path: assets/xml/objects/object_tp.xml +- name: objects/object_tr + xml_path: assets/xml/objects/object_tr.xml +- name: objects/object_trap + xml_path: assets/xml/objects/object_trap.xml +- name: objects/object_triforce_spot + xml_path: assets/xml/objects/object_triforce_spot.xml +- name: objects/object_ts + xml_path: assets/xml/objects/object_ts.xml +- name: objects/object_tsubo + xml_path: assets/xml/objects/object_tsubo.xml +- name: objects/object_tw + xml_path: assets/xml/objects/object_tw.xml +- name: objects/object_umajump + xml_path: assets/xml/objects/object_umajump.xml +- name: objects/object_vali + xml_path: assets/xml/objects/object_vali.xml +- name: objects/object_vase + xml_path: assets/xml/objects/object_vase.xml +- name: objects/object_vm + xml_path: assets/xml/objects/object_vm.xml +- name: objects/object_wallmaster + xml_path: assets/xml/objects/object_wallmaster.xml +- name: objects/object_warp1 + xml_path: assets/xml/objects/object_warp1.xml +- name: objects/object_warp2 + xml_path: assets/xml/objects/object_warp2.xml +- name: objects/object_wf + xml_path: assets/xml/objects/object_wf.xml +- name: objects/object_wood02 + xml_path: assets/xml/objects/object_wood02.xml +- name: objects/object_xc + xml_path: assets/xml/objects/object_xc.xml +- name: objects/object_yabusame_point + xml_path: assets/xml/objects/object_yabusame_point.xml +- name: objects/object_ydan_objects + xml_path: assets/xml/objects/object_ydan_objects.xml +- name: objects/object_yukabyun + xml_path: assets/xml/objects/object_yukabyun.xml +- name: objects/object_zf + xml_path: assets/xml/objects/object_zf.xml +- name: objects/object_zg + xml_path: assets/xml/objects/object_zg.xml +- name: objects/object_zl1 + xml_path: assets/xml/objects/object_zl1.xml +- name: objects/object_zl2 + xml_path: assets/xml/objects/object_zl2.xml +- name: objects/object_zl2_anime1 + xml_path: assets/xml/objects/object_zl2_anime1.xml +- name: objects/object_zl2_anime2 + xml_path: assets/xml/objects/object_zl2_anime2.xml +- name: objects/object_zl4 + xml_path: assets/xml/objects/object_zl4.xml +- name: objects/object_zo + xml_path: assets/xml/objects/object_zo.xml +- name: overlays/ovl_Arrow_Fire + xml_path: assets/xml/overlays/ovl_Arrow_Fire.xml + start_offset: 0x980 + end_offset: 0x1DA0 +- name: overlays/ovl_Arrow_Ice + xml_path: assets/xml/overlays/ovl_Arrow_Ice.xml + start_offset: 0x9A0 + end_offset: 0x1DC0 +- name: overlays/ovl_Arrow_Light + xml_path: assets/xml/overlays/ovl_Arrow_Light.xml + start_offset: 0x9B0 + end_offset: 0x1DD0 +- name: overlays/ovl_Bg_Ganon_Otyuka + xml_path: assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml + start_offset: 0x1100 + end_offset: 0x24DC +- name: overlays/ovl_Bg_Jya_Cobra + xml_path: assets/xml/overlays/ovl_Bg_Jya_Cobra.xml + start_offset: 0x1850 + end_offset: 0x18C8 +- name: overlays/ovl_Boss_Dodongo + xml_path: assets/xml/overlays/ovl_Boss_Dodongo.xml + start_offset: 0x61E8 + end_offset: 0x91E8 +- name: overlays/ovl_Boss_Ganon + xml_path: assets/xml/overlays/ovl_Boss_Ganon.xml + start_offset: 0xE3C8 + end_offset: 0x20EE8 +- name: overlays/ovl_Boss_Ganon2 + xml_path: assets/xml/overlays/ovl_Boss_Ganon2.xml + start_offset: 0x9F88 + end_offset: 0x10438 +- name: overlays/ovl_Boss_Sst + xml_path: assets/xml/overlays/ovl_Boss_Sst.xml + start_offset: 0xA380 + end_offset: 0xAD30 +- name: overlays/ovl_Demo_Shd + xml_path: assets/xml/overlays/ovl_Demo_Shd.xml + start_offset: 0x410 + end_offset: 0x2390 +- name: overlays/ovl_Effect_Ss_Fhg_Flash + xml_path: assets/xml/overlays/ovl_Effect_Ss_Fhg_Flash.xml + start_offset: 0x9F0 + end_offset: 0xEA8 +- name: overlays/ovl_En_Bili + xml_path: assets/xml/overlays/ovl_En_Bili.xml + start_offset: 0x1E40 + end_offset: 0x1E60 +- name: overlays/ovl_En_Clear_Tag + xml_path: assets/xml/overlays/ovl_En_Clear_Tag.xml + start_offset: 0x2600 + end_offset: 0x8900 +- name: overlays/ovl_En_Ganon_Mant + xml_path: assets/xml/overlays/ovl_En_Ganon_Mant.xml + start_offset: 0x11F8 + end_offset: 0x40F8 +- name: overlays/ovl_En_Ganon_Organ + xml_path: assets/xml/overlays/ovl_En_Ganon_Organ.xml + start_offset: 0x368 + end_offset: 0x6EF0 +- name: overlays/ovl_En_Holl + xml_path: assets/xml/overlays/ovl_En_Holl.xml + start_offset: 0xE68 + end_offset: 0xED0 +- name: overlays/ovl_En_Jsjutan + xml_path: assets/xml/overlays/ovl_En_Jsjutan.xml + start_offset: 0x12C8 + end_offset: 0x4C60 +- name: overlays/ovl_En_Kanban + xml_path: assets/xml/overlays/ovl_En_Kanban.xml + start_offset: 0x2E70 + end_offset: 0x2F30 +- name: overlays/ovl_En_Sda + xml_path: assets/xml/overlays/ovl_En_Sda.xml + start_offset: 0x1498 + end_offset: 0x1528 +- name: overlays/ovl_En_Ssh + xml_path: assets/xml/overlays/ovl_En_Ssh.xml + start_offset: 0x2150 + end_offset: 0x21E0 +- name: overlays/ovl_En_St + xml_path: assets/xml/overlays/ovl_En_St.xml + start_offset: 0x26A0 + end_offset: 0x2730 +- name: overlays/ovl_En_Sth + xml_path: assets/xml/overlays/ovl_En_Sth.xml + start_offset: 0xE70 + end_offset: 0x3E44 +- name: overlays/ovl_End_Title + xml_path: assets/xml/overlays/ovl_End_Title.xml + start_offset: 0x6E0 + end_offset: 0x4088 +- name: overlays/ovl_file_choose + xml_path: assets/xml/overlays/ovl_file_choose.xml + start_offset: 0xEC40 + end_offset: 0xF320 +- name: overlays/ovl_Magic_Dark + xml_path: assets/xml/overlays/ovl_Magic_Dark.xml + start_offset: 0xC90 + end_offset: 0x16C0 +- name: overlays/ovl_Magic_Fire + xml_path: assets/xml/overlays/ovl_Magic_Fire.xml + start_offset: 0xB50 + end_offset: 0x21A0 +- name: overlays/ovl_Magic_Wind + xml_path: assets/xml/overlays/ovl_Magic_Wind.xml + start_offset: 0x6A0 + end_offset: 0x1BB8 +- name: overlays/ovl_Oceff_Spot + xml_path: assets/xml/overlays/ovl_Oceff_Spot.xml + start_offset: 0x780 + end_offset: 0xE58 +- name: overlays/ovl_Oceff_Storm + xml_path: assets/xml/overlays/ovl_Oceff_Storm.xml + start_offset: 0x750 + end_offset: 0x1AE0 +- name: overlays/ovl_Oceff_Wipe + xml_path: assets/xml/overlays/ovl_Oceff_Wipe.xml + start_offset: 0x520 + end_offset: 0xCE0 +- name: overlays/ovl_Oceff_Wipe2 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe2.xml + start_offset: 0x430 + end_offset: 0x1698 +- name: overlays/ovl_Oceff_Wipe3 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe3.xml + start_offset: 0x430 + end_offset: 0x1678 +- name: overlays/ovl_Oceff_Wipe4 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe4.xml + start_offset: 0x410 + end_offset: 0xEF8 +- name: scenes/dungeons/bdan + xml_path: assets/xml/scenes/dungeons/bdan.xml +- name: scenes/dungeons/bdan_boss + xml_path: assets/xml/scenes/dungeons/bdan_boss.xml +- name: scenes/dungeons/Bmori1 + xml_path: assets/xml/scenes/dungeons/Bmori1.xml +- name: scenes/dungeons/ddan + xml_path: assets/xml/scenes/dungeons/ddan.xml +- name: scenes/dungeons/ddan_boss + xml_path: assets/xml/scenes/dungeons/ddan_boss_v2.xml +- name: scenes/dungeons/FIRE_bs + xml_path: assets/xml/scenes/dungeons/FIRE_bs.xml +- name: scenes/dungeons/ganon + xml_path: assets/xml/scenes/dungeons/ganon.xml +- name: scenes/dungeons/ganon_boss + xml_path: assets/xml/scenes/dungeons/ganon_boss.xml +- name: scenes/dungeons/ganon_demo + xml_path: assets/xml/scenes/dungeons/ganon_demo.xml +- name: scenes/dungeons/ganon_final + xml_path: assets/xml/scenes/dungeons/ganon_final.xml +- name: scenes/dungeons/ganon_sonogo + xml_path: assets/xml/scenes/dungeons/ganon_sonogo.xml +- name: scenes/dungeons/ganontika + xml_path: assets/xml/scenes/dungeons/ganontika.xml +- name: scenes/dungeons/ganontikasonogo + xml_path: assets/xml/scenes/dungeons/ganontikasonogo.xml +- name: scenes/dungeons/gerudoway + xml_path: assets/xml/scenes/dungeons/gerudoway.xml +- name: scenes/dungeons/HAKAdan + xml_path: assets/xml/scenes/dungeons/HAKAdan.xml +- name: scenes/dungeons/HAKAdan_bs + xml_path: assets/xml/scenes/dungeons/HAKAdan_bs.xml +- name: scenes/dungeons/HAKAdanCH + xml_path: assets/xml/scenes/dungeons/HAKAdanCH.xml +- name: scenes/dungeons/HIDAN + xml_path: assets/xml/scenes/dungeons/HIDAN.xml +- name: scenes/dungeons/ice_doukutu + xml_path: assets/xml/scenes/dungeons/ice_doukutu_v2.xml +- name: scenes/dungeons/jyasinboss + xml_path: assets/xml/scenes/dungeons/jyasinboss.xml +- name: scenes/dungeons/jyasinzou + xml_path: assets/xml/scenes/dungeons/jyasinzou.xml +- name: scenes/dungeons/men + xml_path: assets/xml/scenes/dungeons/men.xml +- name: scenes/dungeons/MIZUsin + xml_path: assets/xml/scenes/dungeons/MIZUsin.xml +- name: scenes/dungeons/MIZUsin_bs + xml_path: assets/xml/scenes/dungeons/MIZUsin_bs.xml +- name: scenes/dungeons/moribossroom + xml_path: assets/xml/scenes/dungeons/moribossroom.xml +- name: scenes/dungeons/ydan + xml_path: assets/xml/scenes/dungeons/ydan.xml +- name: scenes/dungeons/ydan_boss + xml_path: assets/xml/scenes/dungeons/ydan_boss.xml +- name: scenes/indoors/bowling + xml_path: assets/xml/scenes/indoors/bowling.xml +- name: scenes/indoors/daiyousei_izumi + xml_path: assets/xml/scenes/indoors/daiyousei_izumi.xml +- name: scenes/indoors/hairal_niwa + xml_path: assets/xml/scenes/indoors/hairal_niwa.xml +- name: scenes/indoors/hairal_niwa_n + xml_path: assets/xml/scenes/indoors/hairal_niwa_n.xml +- name: scenes/indoors/hakasitarelay + xml_path: assets/xml/scenes/indoors/hakasitarelay.xml +- name: scenes/indoors/hut + xml_path: assets/xml/scenes/indoors/hut.xml +- name: scenes/indoors/hylia_labo + xml_path: assets/xml/scenes/indoors/hylia_labo.xml +- name: scenes/indoors/impa + xml_path: assets/xml/scenes/indoors/impa.xml +- name: scenes/indoors/kakariko + xml_path: assets/xml/scenes/indoors/kakariko.xml +- name: scenes/indoors/kenjyanoma + xml_path: assets/xml/scenes/indoors/kenjyanoma.xml +- name: scenes/indoors/kokiri_home + xml_path: assets/xml/scenes/indoors/kokiri_home.xml +- name: scenes/indoors/kokiri_home3 + xml_path: assets/xml/scenes/indoors/kokiri_home3.xml +- name: scenes/indoors/kokiri_home4 + xml_path: assets/xml/scenes/indoors/kokiri_home4.xml +- name: scenes/indoors/kokiri_home5 + xml_path: assets/xml/scenes/indoors/kokiri_home5.xml +- name: scenes/indoors/labo + xml_path: assets/xml/scenes/indoors/labo.xml +- name: scenes/indoors/link_home + xml_path: assets/xml/scenes/indoors/link_home.xml +- name: scenes/indoors/mahouya + xml_path: assets/xml/scenes/indoors/mahouya.xml +- name: scenes/indoors/malon_stable + xml_path: assets/xml/scenes/indoors/malon_stable.xml +- name: scenes/indoors/miharigoya + xml_path: assets/xml/scenes/indoors/miharigoya.xml +- name: scenes/indoors/nakaniwa + xml_path: assets/xml/scenes/indoors/nakaniwa.xml +- name: scenes/indoors/souko + xml_path: assets/xml/scenes/indoors/souko.xml +- name: scenes/indoors/syatekijyou + xml_path: assets/xml/scenes/indoors/syatekijyou.xml +- name: scenes/indoors/takaraya + xml_path: assets/xml/scenes/indoors/takaraya.xml +- name: scenes/indoors/tent + xml_path: assets/xml/scenes/indoors/tent.xml +- name: scenes/indoors/tokinoma + xml_path: assets/xml/scenes/indoors/tokinoma.xml +- name: scenes/indoors/yousei_izumi_tate + xml_path: assets/xml/scenes/indoors/yousei_izumi_tate.xml +- name: scenes/indoors/yousei_izumi_yoko + xml_path: assets/xml/scenes/indoors/yousei_izumi_yoko.xml +- name: scenes/misc/enrui + xml_path: assets/xml/scenes/misc/enrui.xml +- name: scenes/misc/entra + xml_path: assets/xml/scenes/misc/entra.xml +- name: scenes/misc/entra_n + xml_path: assets/xml/scenes/misc/entra_n.xml +- name: scenes/misc/hakaana + xml_path: assets/xml/scenes/misc/hakaana.xml +- name: scenes/misc/hakaana2 + xml_path: assets/xml/scenes/misc/hakaana2.xml +- name: scenes/misc/hakaana_ouke + xml_path: assets/xml/scenes/misc/hakaana_ouke.xml +- name: scenes/misc/hiral_demo + xml_path: assets/xml/scenes/misc/hiral_demo.xml +- name: scenes/misc/kakariko3 + xml_path: assets/xml/scenes/misc/kakariko3.xml +- name: scenes/misc/kakusiana + xml_path: assets/xml/scenes/misc/kakusiana.xml +- name: scenes/misc/kinsuta + xml_path: assets/xml/scenes/misc/kinsuta.xml +- name: scenes/misc/market_alley + xml_path: assets/xml/scenes/misc/market_alley.xml +- name: scenes/misc/market_alley_n + xml_path: assets/xml/scenes/misc/market_alley_n.xml +- name: scenes/misc/market_day + xml_path: assets/xml/scenes/misc/market_day.xml +- name: scenes/misc/market_night + xml_path: assets/xml/scenes/misc/market_night.xml +- name: scenes/misc/market_ruins + xml_path: assets/xml/scenes/misc/market_ruins.xml +- name: scenes/misc/shrine + xml_path: assets/xml/scenes/misc/shrine.xml +- name: scenes/misc/shrine_n + xml_path: assets/xml/scenes/misc/shrine_n.xml +- name: scenes/misc/shrine_r + xml_path: assets/xml/scenes/misc/shrine_r.xml +- name: scenes/misc/turibori + xml_path: assets/xml/scenes/misc/turibori.xml +- name: scenes/overworld/ganon_tou + xml_path: assets/xml/scenes/overworld/ganon_tou.xml +- name: scenes/overworld/spot00 + xml_path: assets/xml/scenes/overworld/spot00.xml +- name: scenes/overworld/spot01 + xml_path: assets/xml/scenes/overworld/spot01.xml +- name: scenes/overworld/spot02 + xml_path: assets/xml/scenes/overworld/spot02.xml +- name: scenes/overworld/spot03 + xml_path: assets/xml/scenes/overworld/spot03.xml +- name: scenes/overworld/spot04 + xml_path: assets/xml/scenes/overworld/spot04.xml +- name: scenes/overworld/spot05 + xml_path: assets/xml/scenes/overworld/spot05.xml +- name: scenes/overworld/spot06 + xml_path: assets/xml/scenes/overworld/spot06.xml +- name: scenes/overworld/spot07 + xml_path: assets/xml/scenes/overworld/spot07.xml +- name: scenes/overworld/spot08 + xml_path: assets/xml/scenes/overworld/spot08.xml +- name: scenes/overworld/spot09 + xml_path: assets/xml/scenes/overworld/spot09.xml +- name: scenes/overworld/spot10 + xml_path: assets/xml/scenes/overworld/spot10.xml +- name: scenes/overworld/spot11 + xml_path: assets/xml/scenes/overworld/spot11.xml +- name: scenes/overworld/spot12 + xml_path: assets/xml/scenes/overworld/spot12.xml +- name: scenes/overworld/spot13 + xml_path: assets/xml/scenes/overworld/spot13.xml +- name: scenes/overworld/spot15 + xml_path: assets/xml/scenes/overworld/spot15.xml +- name: scenes/overworld/spot16 + xml_path: assets/xml/scenes/overworld/spot16_v2.xml +- name: scenes/overworld/spot17 + xml_path: assets/xml/scenes/overworld/spot17.xml +- name: scenes/overworld/spot18 + xml_path: assets/xml/scenes/overworld/spot18.xml +- name: scenes/overworld/spot20 + xml_path: assets/xml/scenes/overworld/spot20.xml +- name: scenes/shops/alley_shop + xml_path: assets/xml/scenes/shops/alley_shop.xml +- name: scenes/shops/drag + xml_path: assets/xml/scenes/shops/drag.xml +- name: scenes/shops/face_shop + xml_path: assets/xml/scenes/shops/face_shop.xml +- name: scenes/shops/golon + xml_path: assets/xml/scenes/shops/golon.xml +- name: scenes/shops/kokiri_shop + xml_path: assets/xml/scenes/shops/kokiri_shop.xml +- name: scenes/shops/night_shop + xml_path: assets/xml/scenes/shops/night_shop.xml +- name: scenes/shops/shop1 + xml_path: assets/xml/scenes/shops/shop1.xml +- name: scenes/shops/zoora + xml_path: assets/xml/scenes/shops/zoora.xml +- name: textures/backgrounds + xml_path: assets/xml/textures/backgrounds.xml +- name: textures/do_action_static + xml_path: assets/xml/textures/do_action_static.xml +- name: textures/icon_item_24_static + xml_path: assets/xml/textures/icon_item_24_static.xml +- name: textures/icon_item_dungeon_static + xml_path: assets/xml/textures/icon_item_dungeon_static.xml +- name: textures/icon_item_field_static + xml_path: assets/xml/textures/icon_item_field_static.xml +- name: textures/icon_item_gameover_static + xml_path: assets/xml/textures/icon_item_gameover_static.xml +- name: textures/icon_item_jpn_static + xml_path: assets/xml/textures/icon_item_jpn_static.xml +- name: textures/icon_item_nes_static + xml_path: assets/xml/textures/icon_item_nes_static.xml +- name: textures/icon_item_static + xml_path: assets/xml/textures/icon_item_static.xml +- name: textures/item_name_static + xml_path: assets/xml/textures/item_name_static.xml +- name: textures/kanji + xml_path: assets/xml/textures/kanji.xml +- name: textures/map_48x85_static + xml_path: assets/xml/textures/map_48x85_static.xml +- name: textures/map_grand_static + xml_path: assets/xml/textures/map_grand_static.xml +- name: textures/map_i_static + xml_path: assets/xml/textures/map_i_static.xml +- name: textures/map_name_static + xml_path: assets/xml/textures/map_name_static.xml +- name: textures/message_static + xml_path: assets/xml/textures/message_static.xml +- name: textures/message_texture_static + xml_path: assets/xml/textures/message_texture_static.xml +- name: textures/nes_font_static + xml_path: assets/xml/textures/nes_font_static_v2.xml +- name: textures/nintendo_rogo_static + xml_path: assets/xml/textures/nintendo_rogo_static_v2.xml +- name: textures/parameter_static + xml_path: assets/xml/textures/parameter_static.xml +- name: textures/place_title_cards + xml_path: assets/xml/textures/place_title_cards.xml +- name: textures/skyboxes + xml_path: assets/xml/textures/skyboxes.xml +- name: textures/title_static + xml_path: assets/xml/textures/title_static.xml diff --git a/baseroms/gc-jp-ce/segments.csv b/baseroms/gc-jp-ce/segments.csv new file mode 100644 index 0000000000..38b7d2916a --- /dev/null +++ b/baseroms/gc-jp-ce/segments.csv @@ -0,0 +1,1510 @@ +Name,VRAM start +makerom,80000000 +boot,80000460 +dmadata, +Audiobank, +Audioseq, +Audiotable, +kanji, +link_animetion, +icon_item_static, +icon_item_24_static, +icon_item_field_static, +icon_item_dungeon_static, +icon_item_gameover_static, +icon_item_jpn_static, +icon_item_nes_static, +item_name_static, +map_name_static, +do_action_static, +message_static, +message_texture_static, +nes_font_static, +jpn_message_data_static, +nes_message_data_static, +staff_message_data_static, +map_grand_static, +map_48x85_static, +map_i_static, +code,80010EE0 +ovl_title,80800000 +ovl_select,80800850 +ovl_opening,808034D0 +ovl_file_choose,80803630 +ovl_kaleido_scope,808135A0 +ovl_player_actor,8082FD90 +ovl_map_mark_data,80856570 +ovl_En_Test,8085D0D0 +ovl_Arms_Hook,80862980 +ovl_Arrow_Fire,808636F0 +ovl_Arrow_Ice,808655D0 +ovl_Arrow_Light,808674D0 +ovl_Bg_Bdan_Objects,808693E0 +ovl_Bg_Bdan_Switch,8086A6B0 +ovl_Bg_Bom_Guard,8086BAE0 +ovl_Bg_Bombwall,8086BD00 +ovl_Bg_Bowl_Wall,8086C5C0 +ovl_Bg_Breakwall,8086CF40 +ovl_Bg_Ddan_Jd,8086DDB0 +ovl_Bg_Ddan_Kd,8086E400 +ovl_Bg_Dodoago,8086ECF0 +ovl_Bg_Dy_Yoseizo,8086FAA0 +ovl_Bg_Ganon_Otyuka,80872890 +ovl_Bg_Gate_Shutter,80874ED0 +ovl_Bg_Gjyo_Bridge,80875360 +ovl_Bg_Gnd_Darkmeiro,80875850 +ovl_Bg_Gnd_Firemeiro,80876010 +ovl_Bg_Gnd_Iceblock,80876560 +ovl_Bg_Gnd_Nisekabe,80877660 +ovl_Bg_Gnd_Soulmeiro,808777D0 +ovl_Bg_Haka,80878030 +ovl_Bg_Haka_Gate,808786F0 +ovl_Bg_Haka_Huta,80879790 +ovl_Bg_Haka_Megane,8087A230 +ovl_Bg_Haka_MeganeBG,8087A630 +ovl_Bg_Haka_Sgami,8087ACF0 +ovl_Bg_Haka_Ship,8087B910 +ovl_Bg_Haka_Trap,8087C360 +ovl_Bg_Haka_Tubo,8087D930 +ovl_Bg_Haka_Water,8087E350 +ovl_Bg_Haka_Zou,8087EB50 +ovl_Bg_Heavy_Block,8087FD40 +ovl_Bg_Hidan_Curtain,80881630 +ovl_Bg_Hidan_Dalm,808820D0 +ovl_Bg_Hidan_Firewall,80882920 +ovl_Bg_Hidan_Fslift,80883080 +ovl_Bg_Hidan_Fwbig,80883550 +ovl_Bg_Hidan_Hamstep,80884230 +ovl_Bg_Hidan_Hrock,808850E0 +ovl_Bg_Hidan_Kousi,80885910 +ovl_Bg_Hidan_Kowarerukabe,80885EA0 +ovl_Bg_Hidan_Rock,80886D80 +ovl_Bg_Hidan_Rsekizou,80887E80 +ovl_Bg_Hidan_Sekizou,80888A60 +ovl_Bg_Hidan_Sima,80889EB0 +ovl_Bg_Hidan_Syoku,8088ADB0 +ovl_Bg_Ice_Objects,8088B210 +ovl_Bg_Ice_Shelter,8088C150 +ovl_Bg_Ice_Shutter,8088D390 +ovl_Bg_Ice_Turara,8088D800 +ovl_Bg_Ingate,8088E030 +ovl_Bg_Jya_1flift,8088E3C0 +ovl_Bg_Jya_Amishutter,8088EA50 +ovl_Bg_Jya_Bigmirror,8088EDE0 +ovl_Bg_Jya_Block,8088F630 +ovl_Bg_Jya_Bombchuiwa,8088F8A0 +ovl_Bg_Jya_Bombiwa,808903E0 +ovl_Bg_Jya_Cobra,808909A0 +ovl_Bg_Jya_Goroiwa,808926E0 +ovl_Bg_Jya_Haheniron,80892E60 +ovl_Bg_Jya_Ironobj,80893650 +ovl_Bg_Jya_Kanaami,80894400 +ovl_Bg_Jya_Lift,808947B0 +ovl_Bg_Jya_Megami,80894D00 +ovl_Bg_Jya_Zurerukabe,80895EF0 +ovl_Bg_Menkuri_Eye,808965A0 +ovl_Bg_Menkuri_Kaiten,80896A40 +ovl_Bg_Menkuri_Nisekabe,80896BD0 +ovl_Bg_Mizu_Bwall,80896D20 +ovl_Bg_Mizu_Movebg,808981F0 +ovl_Bg_Mizu_Shutter,80899380 +ovl_Bg_Mizu_Uzu,80899B80 +ovl_Bg_Mizu_Water,80899D50 +ovl_Bg_Mjin,8089AA20 +ovl_Bg_Mori_Bigst,8089AE10 +ovl_Bg_Mori_Elevator,8089B740 +ovl_Bg_Mori_Hashigo,8089C230 +ovl_Bg_Mori_Hashira4,8089CAF0 +ovl_Bg_Mori_Hineri,8089D080 +ovl_Bg_Mori_Idomizu,8089DDD0 +ovl_Bg_Mori_Kaitenkabe,8089E410 +ovl_Bg_Mori_Rakkatenjo,8089EA80 +ovl_Bg_Po_Event,8089F400 +ovl_Bg_Po_Syokudai,808A1240 +ovl_Bg_Pushbox,808A1BB0 +ovl_Bg_Relay_Objects,808A1EB0 +ovl_Bg_Spot00_Break,808A2660 +ovl_Bg_Spot00_Hanebasi,808A2800 +ovl_Bg_Spot01_Fusya,808A3910 +ovl_Bg_Spot01_Idohashira,808A3BB0 +ovl_Bg_Spot01_Idomizu,808A47B0 +ovl_Bg_Spot01_Idosoko,808A4AD0 +ovl_Bg_Spot01_Objects2,808A4CE0 +ovl_Bg_Spot02_Objects,808A51A0 +ovl_Bg_Spot03_Taki,808A6500 +ovl_Bg_Spot05_Soko,808A6E20 +ovl_Bg_Spot06_Objects,808A7140 +ovl_Bg_Spot07_Taki,808A8540 +ovl_Bg_Spot08_Bakudankabe,808A8B30 +ovl_Bg_Spot08_Iceblock,808A91D0 +ovl_Bg_Spot09_Obj,808AA210 +ovl_Bg_Spot11_Bakudankabe,808AA730 +ovl_Bg_Spot11_Oasis,808AAD70 +ovl_Bg_Spot12_Gate,808AB4A0 +ovl_Bg_Spot12_Saku,808AB8B0 +ovl_Bg_Spot15_Rrbox,808ABD70 +ovl_Bg_Spot15_Saku,808ACB50 +ovl_Bg_Spot16_Bombstone,808ACE90 +ovl_Bg_Spot16_Doughnut,808AE3E0 +ovl_Bg_Spot17_Bakudankabe,808AE9A0 +ovl_Bg_Spot17_Funen,808AF090 +ovl_Bg_Spot18_Basket,808AF2E0 +ovl_Bg_Spot18_Futa,808B02D0 +ovl_Bg_Spot18_Obj,808B0470 +ovl_Bg_Spot18_Shutter,808B0D40 +ovl_Bg_Sst_Floor,808B1290 +ovl_Bg_Toki_Hikari,808B17F0 +ovl_Bg_Toki_Swd,808B2590 +ovl_Bg_Treemouth,808B3BE0 +ovl_Bg_Umajump,808B5240 +ovl_Bg_Vb_Sima,808B53D0 +ovl_Bg_Ydan_Hasi,808B5AF0 +ovl_Bg_Ydan_Maruta,808B62A0 +ovl_Bg_Ydan_Sp,808B6980 +ovl_Bg_Zg,808B80A0 +ovl_Boss_Dodongo,808B84F0 +ovl_Boss_Fd,808C1FF0 +ovl_Boss_Fd2,808C9350 +ovl_Boss_Ganon,808CD080 +ovl_Boss_Ganon2,808F2EB0 +ovl_Boss_Ganondrof,80905D20 +ovl_Boss_Goma,8090AAB0 +ovl_Boss_Mo,80910A50 +ovl_Boss_Sst,80921030 +ovl_Boss_Tw,8092D600 +ovl_Boss_Va,809431D0 +ovl_Demo_6K,8095A460 +ovl_Demo_Du,8095D1C0 +ovl_Demo_Ec,809609A0 +ovl_Demo_Effect,80964200 +ovl_Demo_Ext,80969DA0 +ovl_Demo_Geff,8096A6F0 +ovl_Demo_Gj,8096AF10 +ovl_Demo_Go,8096EBC0 +ovl_Demo_Gt,8096F910 +ovl_Demo_Ik,80974F20 +ovl_Demo_Im,80976430 +ovl_Demo_Kankyo,8097A3A0 +ovl_Demo_Kekkai,8097E090 +ovl_Demo_Sa,8097F380 +ovl_Demo_Shd,80981EA0 +ovl_Demo_Tre_Lgt,809842B0 +ovl_Door_Ana,809849C0 +ovl_Door_Gerudo,80985030 +ovl_Door_Killer,80985620 +ovl_Door_Shutter,80986B90 +ovl_Door_Toki,80988E50 +ovl_Door_Warp1,80988FB0 +ovl_Efc_Erupc,8098D2C0 +ovl_Eff_Dust,8098DDB0 +ovl_Effect_Ss_Blast,8098F180 +ovl_Effect_Ss_Bomb,8098F510 +ovl_Effect_Ss_Bomb2,8098F940 +ovl_Effect_Ss_Bubble,80990240 +ovl_Effect_Ss_D_Fire,809906C0 +ovl_Effect_Ss_Dead_Db,80990BB0 +ovl_Effect_Ss_Dead_Dd,80991090 +ovl_Effect_Ss_Dead_Ds,80991620 +ovl_Effect_Ss_Dead_Sound,80991AA0 +ovl_Effect_Ss_Dt_Bubble,80991BE0 +ovl_Effect_Ss_Dust,80992170 +ovl_Effect_Ss_En_Fire,809929B0 +ovl_Effect_Ss_En_Ice,80993100 +ovl_Effect_Ss_Extra,809939C0 +ovl_Effect_Ss_Fcircle,80993D80 +ovl_Effect_Ss_Fhg_Flash,80994230 +ovl_Effect_Ss_Fire_Tail,809951B0 +ovl_Effect_Ss_G_Fire,809958B0 +ovl_Effect_Ss_G_Magma,80995B40 +ovl_Effect_Ss_G_Magma2,80995DA0 +ovl_Effect_Ss_G_Ripple,809962B0 +ovl_Effect_Ss_G_Spk,80996810 +ovl_Effect_Ss_G_Splash,80996DC0 +ovl_Effect_Ss_Hahen,80997270 +ovl_Effect_Ss_HitMark,809978B0 +ovl_Effect_Ss_Ice_Piece,80997E00 +ovl_Effect_Ss_Ice_Smoke,80998240 +ovl_Effect_Ss_K_Fire,80998720 +ovl_Effect_Ss_Kakera,80998B60 +ovl_Effect_Ss_KiraKira,80999BF0 +ovl_Effect_Ss_Lightning,8099A260 +ovl_Effect_Ss_Sibuki,8099A930 +ovl_Effect_Ss_Sibuki2,8099B000 +ovl_Effect_Ss_Solder_Srch_Ball,8099B330 +ovl_Effect_Ss_Stick,8099B4E0 +ovl_Effect_Ss_Stone1,8099B880 +ovl_Elf_Msg,8099BC00 +ovl_Elf_Msg2,8099C1F0 +ovl_En_Am,8099C660 +ovl_En_Ani,8099EA60 +ovl_En_Anubice,8099F7D0 +ovl_En_Anubice_Fire,809A0A80 +ovl_En_Anubice_Tag,809A1840 +ovl_En_Arow_Trap,809A1B10 +ovl_En_Arrow,809A1C60 +ovl_En_Attack_Niw,809A3360 +ovl_En_Ba,809A45C0 +ovl_En_Bb,809A6490 +ovl_En_Bdfire,809AA170 +ovl_En_Bigokuta,809AAD10 +ovl_En_Bili,809AD810 +ovl_En_Bird,809AFAE0 +ovl_En_Blkobj,809AFFA0 +ovl_En_Bom,809B0500 +ovl_En_Bom_Bowl_Man,809B13D0 +ovl_En_Bom_Bowl_Pit,809B2910 +ovl_En_Bom_Chu,809B3280 +ovl_En_Bombf,809B4920 +ovl_En_Boom,809B5DB0 +ovl_En_Box,809B6680 +ovl_En_Brob,809B81E0 +ovl_En_Bubble,809B92D0 +ovl_En_Butte,809BA6F0 +ovl_En_Bw,809BBCC0 +ovl_En_Bx,809BF050 +ovl_En_Changer,809BFB50 +ovl_En_Clear_Tag,809C0530 +ovl_En_Cow,809CBAD0 +ovl_En_Crow,809CCF30 +ovl_En_Cs,809CE5D0 +ovl_En_Daiku,809CF800 +ovl_En_Daiku_Kakariko,809D0F40 +ovl_En_Dekubaba,809D2300 +ovl_En_Dekunuts,809D5DB0 +ovl_En_Dh,809D75B0 +ovl_En_Dha,809D9090 +ovl_En_Diving_Game,809DA090 +ovl_En_Dns,809DBA40 +ovl_En_Dnt_Demo,809DCDD0 +ovl_En_Dnt_Jiji,809DDAF0 +ovl_En_Dnt_Nomal,809DF010 +ovl_En_Dodojr,809E1E10 +ovl_En_Dodongo,809E3CB0 +ovl_En_Dog,809E6A50 +ovl_En_Door,809E7C00 +ovl_En_Ds,809E8A40 +ovl_En_Du,809E9660 +ovl_En_Dy_Extra,809EB0F0 +ovl_En_Eg,809EB690 +ovl_En_Eiyer,809EB840 +ovl_En_Elf,809ED4A0 +ovl_En_Encount1,809F1E60 +ovl_En_Encount2,809F29C0 +ovl_En_Ex_Item,809F3BF0 +ovl_En_Ex_Ruppy,809F4D70 +ovl_En_Fd,809F5E30 +ovl_En_Fd_Fire,809F8AD0 +ovl_En_Fhg_Fire,809F97E0 +ovl_En_Fire_Rock,809FBE80 +ovl_En_Firefly,809FCF90 +ovl_En_Fish,809FF100 +ovl_En_Floormas,80A01210 +ovl_En_Fr,80A045F0 +ovl_En_Fu,80A07080 +ovl_En_Fw,80A07DD0 +ovl_En_Fz,80A09590 +ovl_En_G_Switch,80A0B5A0 +ovl_En_Ganon_Mant,80A0CDC0 +ovl_En_Ganon_Organ,80A10FF0 +ovl_En_Gb,80A18030 +ovl_En_Ge1,80A19760 +ovl_En_Ge2,80A1B790 +ovl_En_Ge3,80A1D130 +ovl_En_GeldB,80A1DD70 +ovl_En_GirlA,80A23120 +ovl_En_Gm,80A25A40 +ovl_En_Go,80A26770 +ovl_En_Go2,80A2ADB0 +ovl_En_Goma,80A30DF0 +ovl_En_Goroiwa,80A33AA0 +ovl_En_Gs,80A35E60 +ovl_En_Guest,80A37CD0 +ovl_En_Hata,80A38670 +ovl_En_Heishi1,80A38C00 +ovl_En_Heishi2,80A3A110 +ovl_En_Heishi3,80A3C310 +ovl_En_Heishi4,80A3CCE0 +ovl_En_Hintnuts,80A3DBE0 +ovl_En_Holl,80A3F610 +ovl_En_Honotrap,80A405E0 +ovl_En_Horse,80A41B40 +ovl_En_Horse_Game_Check,80A4DDA0 +ovl_En_Horse_Ganon,80A4EE70 +ovl_En_Horse_Link_Child,80A4FBF0 +ovl_En_Horse_Normal,80A519F0 +ovl_En_Horse_Zelda,80A54010 +ovl_En_Hs,80A54B00 +ovl_En_Hs2,80A556A0 +ovl_En_Hy,80A55C80 +ovl_En_Ice_Hono,80A595C0 +ovl_En_Ik,80A5A7B0 +ovl_En_In,80A5EE10 +ovl_En_Insect,80A61BB0 +ovl_En_Ishi,80A640D0 +ovl_En_It,80A6D220 +ovl_En_Jj,80A6D3B0 +ovl_En_Js,80A6E980 +ovl_En_Jsjutan,80A6F350 +ovl_En_Kakasi,80A74C80 +ovl_En_Kakasi2,80A759C0 +ovl_En_Kakasi3,80A760E0 +ovl_En_Kanban,80A771C0 +ovl_En_Karebaba,80A7A310 +ovl_En_Ko,80A7BC00 +ovl_En_Kusa,80A7FD40 +ovl_En_Kz,80A81220 +ovl_En_Light,80A827C0 +ovl_En_Lightbox,80A835C0 +ovl_En_M_Fire1,80A83A40 +ovl_En_M_Thunder,80A83BE0 +ovl_En_Ma1,80A851E0 +ovl_En_Ma2,80A864C0 +ovl_En_Ma3,80A87520 +ovl_En_Mag,80A884D0 +ovl_En_Mb,80A8AE00 +ovl_En_Md,80A8F030 +ovl_En_Mk,80A916A0 +ovl_En_Mm,80A92530 +ovl_En_Mm2,80A93B90 +ovl_En_Ms,80A94950 +ovl_En_Mu,80A95040 +ovl_En_Nb,80A95960 +ovl_En_Niw,80A99F30 +ovl_En_Niw_Girl,80A9D260 +ovl_En_Niw_Lady,80A9DD30 +ovl_En_Nutsball,80A9F630 +ovl_En_Nwc,80A9FC50 +ovl_En_Ny,80AA0670 +ovl_En_OE2,80AA1FB0 +ovl_En_Okarina_Effect,80AA2090 +ovl_En_Okarina_Tag,80AA2450 +ovl_En_Okuta,80AA3950 +ovl_En_Ossan,80AA5F30 +ovl_En_Owl,80AAC510 +ovl_En_Part,80AB00B0 +ovl_En_Peehat,80AB1710 +ovl_En_Po_Desert,80AB4E10 +ovl_En_Po_Field,80AB5BD0 +ovl_En_Po_Relay,80AB9660 +ovl_En_Po_Sisters,80ABAD70 +ovl_En_Poh,80ABFA60 +ovl_En_Pu_box,80AC3C50 +ovl_En_Rd,80AC3F90 +ovl_En_Reeba,80AC6850 +ovl_En_River_Sound,80AC82C0 +ovl_En_Rl,80AC8C50 +ovl_En_Rr,80AC9B30 +ovl_En_Ru1,80ACC060 +ovl_En_Ru2,80AD3700 +ovl_En_Sa,80AD6480 +ovl_En_Sb,80AD86F0 +ovl_En_Scene_Change,80AD9B30 +ovl_En_Sda,80AD9C60 +ovl_En_Shopnuts,80ADB350 +ovl_En_Si,80ADC260 +ovl_En_Siofuki,80ADC760 +ovl_En_Skb,80ADD510 +ovl_En_Skj,80ADEE00 +ovl_En_Skjneedle,80AE2750 +ovl_En_Ssh,80AE2A60 +ovl_En_St,80AE5050 +ovl_En_Sth,80AE7CC0 +ovl_En_Stream,80AEBD80 +ovl_En_Sw,80AEC310 +ovl_En_Syateki_Itm,80AEFB00 +ovl_En_Syateki_Man,80AF08A0 +ovl_En_Syateki_Niw,80AF1660 +ovl_En_Ta,80AF36F0 +ovl_En_Takara_Man,80AF70B0 +ovl_En_Tana,80AF7970 +ovl_En_Tg,80AF7C20 +ovl_En_Tite,80AF8300 +ovl_En_Tk,80AFB0A0 +ovl_En_Torch,80AFCED0 +ovl_En_Torch2,80AFCFC0 +ovl_En_Toryo,80AFF760 +ovl_En_Tp,80B003F0 +ovl_En_Tr,80B02260 +ovl_En_Trap,80B03B60 +ovl_En_Tubo_Trap,80B04E00 +ovl_En_Vali,80B05AA0 +ovl_En_Vase,80B08160 +ovl_En_Vb_Ball,80B08260 +ovl_En_Viewer,80B09410 +ovl_En_Vm,80B0C2D0 +ovl_En_Wall_Tubo,80B0DB90 +ovl_En_Wallmas,80B0E080 +ovl_En_Weather_Tag,80B0FA90 +ovl_En_Weiyer,80B10980 +ovl_En_Wf,80B12380 +ovl_En_Wonder_Item,80B16690 +ovl_En_Wonder_Talk,80B173C0 +ovl_En_Wonder_Talk2,80B17A50 +ovl_En_Wood02,80B180F0 +ovl_En_Xc,80B192D0 +ovl_En_Yabusame_Mark,80B1FA60 +ovl_En_Yukabyun,80B20130 +ovl_En_Zf,80B20740 +ovl_En_Zl1,80B27230 +ovl_En_Zl2,80B2B040 +ovl_En_Zl3,80B2F740 +ovl_En_Zl4,80B37590 +ovl_En_Zo,80B3BFC0 +ovl_En_fHG,80B3E580 +ovl_End_Title,80B40EB0 +ovl_Fishing,80B44FD0 +ovl_Item_B_Heart,80B5FB70 +ovl_Item_Etcetera,80B5FF80 +ovl_Item_Inbox,80B60850 +ovl_Item_Ocarina,80B609B0 +ovl_Item_Shield,80B61180 +ovl_Magic_Dark,80B61B90 +ovl_Magic_Fire,80B633E0 +ovl_Magic_Wind,80B656E0 +ovl_Mir_Ray,80B673E0 +ovl_Obj_Bean,80B68C90 +ovl_Obj_Blockstop,80B6B420 +ovl_Obj_Bombiwa,80B6B5C0 +ovl_Obj_Comb,80B6BB30 +ovl_Obj_Dekujr,80B6C390 +ovl_Obj_Elevator,80B6C9D0 +ovl_Obj_Hamishi,80B6CD90 +ovl_Obj_Hana,80B6D5E0 +ovl_Obj_Hsblock,80B6D8F0 +ovl_Obj_Ice_Poly,80B6DEC0 +ovl_Obj_Kibako,80B6E870 +ovl_Obj_Kibako2,80B6F570 +ovl_Obj_Lift,80B6FC30 +ovl_Obj_Lightswitch,80B70650 +ovl_Obj_Makekinsuta,80B71A80 +ovl_Obj_Makeoshihiki,80B71BD0 +ovl_Obj_Mure,80B72060 +ovl_Obj_Mure2,80B73070 +ovl_Obj_Mure3,80B73A90 +ovl_Obj_Oshihiki,80B74260 +ovl_Obj_Roomtimer,80B75D10 +ovl_Obj_Switch,80B75F60 +ovl_Obj_Syokudai,80B77D40 +ovl_Obj_Timeblock,80B78990 +ovl_Obj_Tsubo,80B795E0 +ovl_Obj_Warp2block,80B7A5D0 +ovl_Object_Kankyo,80B7B100 +ovl_Oceff_Spot,80B7E380 +ovl_Oceff_Storm,80B7F2B0 +ovl_Oceff_Wipe,80B80E60 +ovl_Oceff_Wipe2,80B81BE0 +ovl_Oceff_Wipe3,80B83350 +ovl_Oceff_Wipe4,80B84AA0 +ovl_Shot_Sun,80B85A80 +gameplay_keep, +gameplay_field_keep, +gameplay_dangeon_keep, +gameplay_object_exchange_static, +object_link_boy, +object_link_child, +object_box, +object_human, +object_okuta, +object_poh, +object_wallmaster, +object_dy_obj, +object_firefly, +object_dodongo, +object_fire, +object_niw, +object_tite, +object_reeba, +object_peehat, +object_kingdodongo, +object_horse, +object_zf, +object_goma, +object_zl1, +object_gol, +object_bubble, +object_dodojr, +object_torch2, +object_bl, +object_tp, +object_oA1, +object_st, +object_bw, +object_ei, +object_horse_normal, +object_oB1, +object_o_anime, +object_spot04_objects, +object_ddan_objects, +object_hidan_objects, +object_horse_ganon, +object_oA2, +object_spot00_objects, +object_mb, +object_bombf, +object_sk2, +object_oE1, +object_oE_anime, +object_oE2, +object_ydan_objects, +object_gnd, +object_am, +object_dekubaba, +object_oA3, +object_oA4, +object_oA5, +object_oA6, +object_oA7, +object_jj, +object_oA8, +object_oA9, +object_oB2, +object_oB3, +object_oB4, +object_horse_zelda, +object_opening_demo1, +object_warp1, +object_b_heart, +object_dekunuts, +object_oE3, +object_oE4, +object_menkuri_objects, +object_oE5, +object_oE6, +object_oE7, +object_oE8, +object_oE9, +object_oE10, +object_oE11, +object_oE12, +object_vali, +object_oA10, +object_oA11, +object_mizu_objects, +object_fhg, +object_ossan, +object_mori_hineri1, +object_Bb, +object_toki_objects, +object_yukabyun, +object_zl2, +object_mjin, +object_mjin_flash, +object_mjin_dark, +object_mjin_flame, +object_mjin_ice, +object_mjin_soul, +object_mjin_wind, +object_mjin_oka, +object_haka_objects, +object_spot06_objects, +object_ice_objects, +object_relay_objects, +object_mori_hineri1a, +object_mori_hineri2, +object_mori_hineri2a, +object_mori_objects, +object_mori_tex, +object_spot08_obj, +object_warp2, +object_hata, +object_bird, +object_wood02, +object_lightbox, +object_pu_box, +object_trap, +object_vase, +object_im, +object_ta, +object_tk, +object_xc, +object_vm, +object_bv, +object_hakach_objects, +object_efc_crystal_light, +object_efc_fire_ball, +object_efc_flash, +object_efc_lgt_shower, +object_efc_star_field, +object_god_lgt, +object_light_ring, +object_triforce_spot, +object_medal, +object_bdan_objects, +object_sd, +object_rd, +object_po_sisters, +object_heavy_object, +object_gndd, +object_fd, +object_du, +object_fw, +object_horse_link_child, +object_spot02_objects, +object_haka, +object_ru1, +object_syokudai, +object_fd2, +object_dh, +object_rl, +object_efc_tw, +object_demo_tre_lgt, +object_gi_key, +object_mir_ray, +object_brob, +object_gi_jewel, +object_spot09_obj, +object_spot18_obj, +object_bdoor, +object_spot17_obj, +object_shop_dungen, +object_nb, +object_mo, +object_sb, +object_gi_melody, +object_gi_heart, +object_gi_compass, +object_gi_bosskey, +object_gi_medal, +object_gi_nuts, +object_sa, +object_gi_hearts, +object_gi_arrowcase, +object_gi_bombpouch, +object_in, +object_tr, +object_spot16_obj, +object_oE1s, +object_oE4s, +object_os_anime, +object_gi_bottle, +object_gi_stick, +object_gi_map, +object_oF1d_map, +object_ru2, +object_gi_shield_1, +object_dekujr, +object_gi_magicpot, +object_gi_bomb_1, +object_oF1s, +object_ma2, +object_gi_purse, +object_hni, +object_tw, +object_rr, +object_bxa, +object_anubice, +object_gi_gerudo, +object_gi_arrow, +object_gi_bomb_2, +object_gi_egg, +object_gi_scale, +object_gi_shield_2, +object_gi_hookshot, +object_gi_ocarina, +object_gi_milk, +object_ma1, +object_ganon, +object_sst, +object_ny, +object_fr, +object_gi_pachinko, +object_gi_boomerang, +object_gi_bow, +object_gi_glasses, +object_gi_liquid, +object_ani, +object_demo_6k, +object_gi_shield_3, +object_gi_letter, +object_spot15_obj, +object_jya_obj, +object_gi_clothes, +object_gi_bean, +object_gi_fish, +object_gi_saw, +object_gi_hammer, +object_gi_grass, +object_gi_longsword, +object_spot01_objects, +object_md, +object_km1, +object_kw1, +object_zo, +object_kz, +object_umajump, +object_masterkokiri, +object_masterkokirihead, +object_mastergolon, +object_masterzoora, +object_aob, +object_ik, +object_ahg, +object_cne, +object_gi_niwatori, +object_skj, +object_gi_bottle_letter, +object_bji, +object_bba, +object_gi_ocarina_0, +object_ds, +object_ane, +object_boj, +object_spot03_object, +object_spot07_object, +object_fz, +object_bob, +object_ge1, +object_yabusame_point, +object_gi_boots_2, +object_gi_seed, +object_gnd_magic, +object_d_elevator, +object_d_hsblock, +object_d_lift, +object_mamenoki, +object_goroiwa, +object_toryo, +object_daiku, +object_nwc, +object_blkobj, +object_gm, +object_ms, +object_hs, +object_ingate, +object_lightswitch, +object_kusa, +object_tsubo, +object_gi_gloves, +object_gi_coin, +object_kanban, +object_gjyo_objects, +object_owl, +object_mk, +object_fu, +object_gi_ki_tan_mask, +object_gi_redead_mask, +object_gi_skj_mask, +object_gi_rabit_mask, +object_gi_truth_mask, +object_ganon_objects, +object_siofuki, +object_stream, +object_mm, +object_fa, +object_os, +object_gi_eye_lotion, +object_gi_powder, +object_gi_mushroom, +object_gi_ticketstone, +object_gi_brokensword, +object_js, +object_cs, +object_gi_prescription, +object_gi_bracelet, +object_gi_soldout, +object_gi_frog, +object_mag, +object_door_gerudo, +object_gt, +object_efc_erupc, +object_zl2_anime1, +object_zl2_anime2, +object_gi_golonmask, +object_gi_zoramask, +object_gi_gerudomask, +object_ganon2, +object_ka, +object_ts, +object_zg, +object_gi_hoverboots, +object_gi_m_arrow, +object_ds2, +object_ec, +object_fish, +object_gi_sutaru, +object_gi_goddess, +object_ssh, +object_bigokuta, +object_bg, +object_spot05_objects, +object_spot12_obj, +object_bombiwa, +object_hintnuts, +object_rs, +object_spot00_break, +object_gla, +object_shopnuts, +object_geldb, +object_gr, +object_dog, +object_jya_iron, +object_jya_door, +object_spot01_objects2, +object_spot11_obj, +object_kibako2, +object_dns, +object_dnk, +object_gi_fire, +object_gi_insect, +object_gi_butterfly, +object_gi_ghost, +object_gi_soul, +object_bowl, +object_po_field, +object_demo_kekkai, +object_efc_doughnut, +object_gi_dekupouch, +object_ganon_anime1, +object_ganon_anime2, +object_ganon_anime3, +object_gi_rupy, +object_spot01_matoya, +object_spot01_matoyab, +object_po_composer, +object_mu, +object_wf, +object_skb, +object_gj, +object_geff, +object_haka_door, +object_gs, +object_ps, +object_bwall, +object_crow, +object_cow, +object_cob, +object_gi_sword_1, +object_door_killer, +object_ouke_haka, +object_timeblock, +object_zl4, +g_pn_01, +g_pn_02, +g_pn_03, +g_pn_04, +g_pn_05, +g_pn_06, +g_pn_07, +g_pn_08, +g_pn_09, +g_pn_10, +g_pn_11, +g_pn_12, +g_pn_13, +g_pn_14, +g_pn_15, +g_pn_16, +g_pn_17, +g_pn_18, +g_pn_19, +g_pn_20, +g_pn_21, +g_pn_22, +g_pn_23, +g_pn_24, +g_pn_25, +g_pn_26, +g_pn_27, +g_pn_28, +g_pn_29, +g_pn_30, +g_pn_31, +g_pn_32, +g_pn_33, +g_pn_34, +g_pn_35, +g_pn_36, +g_pn_37, +g_pn_38, +g_pn_39, +g_pn_40, +g_pn_41, +g_pn_42, +g_pn_43, +g_pn_44, +g_pn_45, +g_pn_46, +g_pn_47, +g_pn_48, +g_pn_49, +g_pn_50, +g_pn_51, +g_pn_52, +g_pn_53, +g_pn_54, +g_pn_55, +g_pn_56, +g_pn_57, +z_select_static, +nintendo_rogo_static, +title_static, +parameter_static, +vr_fine0_static, +vr_fine0_pal_static, +vr_fine1_static, +vr_fine1_pal_static, +vr_fine2_static, +vr_fine2_pal_static, +vr_fine3_static, +vr_fine3_pal_static, +vr_cloud0_static, +vr_cloud0_pal_static, +vr_cloud1_static, +vr_cloud1_pal_static, +vr_cloud2_static, +vr_cloud2_pal_static, +vr_cloud3_static, +vr_cloud3_pal_static, +vr_holy0_static, +vr_holy0_pal_static, +vr_holy1_static, +vr_holy1_pal_static, +vr_MDVR_static, +vr_MDVR_pal_static, +vr_MNVR_static, +vr_MNVR_pal_static, +vr_RUVR_static, +vr_RUVR_pal_static, +vr_LHVR_static, +vr_LHVR_pal_static, +vr_KHVR_static, +vr_KHVR_pal_static, +vr_K3VR_static, +vr_K3VR_pal_static, +vr_K4VR_static, +vr_K4VR_pal_static, +vr_K5VR_static, +vr_K5VR_pal_static, +vr_SP1a_static, +vr_SP1a_pal_static, +vr_MLVR_static, +vr_MLVR_pal_static, +vr_KKRVR_static, +vr_KKRVR_pal_static, +vr_KR3VR_static, +vr_KR3VR_pal_static, +vr_IPVR_static, +vr_IPVR_pal_static, +vr_KSVR_static, +vr_KSVR_pal_static, +vr_GLVR_static, +vr_GLVR_pal_static, +vr_ZRVR_static, +vr_ZRVR_pal_static, +vr_DGVR_static, +vr_DGVR_pal_static, +vr_ALVR_static, +vr_ALVR_pal_static, +vr_NSVR_static, +vr_NSVR_pal_static, +vr_LBVR_static, +vr_LBVR_pal_static, +vr_TTVR_static, +vr_TTVR_pal_static, +vr_FCVR_static, +vr_FCVR_pal_static, +elf_message_field, +elf_message_ydan, +ydan_scene, +ydan_room_0, +ydan_room_1, +ydan_room_2, +ydan_room_3, +ydan_room_4, +ydan_room_5, +ydan_room_6, +ydan_room_7, +ydan_room_8, +ydan_room_9, +ydan_room_10, +ydan_room_11, +ddan_scene, +ddan_room_0, +ddan_room_1, +ddan_room_2, +ddan_room_3, +ddan_room_4, +ddan_room_5, +ddan_room_6, +ddan_room_7, +ddan_room_8, +ddan_room_9, +ddan_room_10, +ddan_room_11, +ddan_room_12, +ddan_room_13, +ddan_room_14, +ddan_room_15, +ddan_room_16, +bdan_scene, +bdan_room_0, +bdan_room_1, +bdan_room_2, +bdan_room_3, +bdan_room_4, +bdan_room_5, +bdan_room_6, +bdan_room_7, +bdan_room_8, +bdan_room_9, +bdan_room_10, +bdan_room_11, +bdan_room_12, +bdan_room_13, +bdan_room_14, +bdan_room_15, +Bmori1_scene, +Bmori1_room_0, +Bmori1_room_1, +Bmori1_room_2, +Bmori1_room_3, +Bmori1_room_4, +Bmori1_room_5, +Bmori1_room_6, +Bmori1_room_7, +Bmori1_room_8, +Bmori1_room_9, +Bmori1_room_10, +Bmori1_room_11, +Bmori1_room_12, +Bmori1_room_13, +Bmori1_room_14, +Bmori1_room_15, +Bmori1_room_16, +Bmori1_room_17, +Bmori1_room_18, +Bmori1_room_19, +Bmori1_room_20, +Bmori1_room_21, +Bmori1_room_22, +HIDAN_scene, +HIDAN_room_0, +HIDAN_room_1, +HIDAN_room_2, +HIDAN_room_3, +HIDAN_room_4, +HIDAN_room_5, +HIDAN_room_6, +HIDAN_room_7, +HIDAN_room_8, +HIDAN_room_9, +HIDAN_room_10, +HIDAN_room_11, +HIDAN_room_12, +HIDAN_room_13, +HIDAN_room_14, +HIDAN_room_15, +HIDAN_room_16, +HIDAN_room_17, +HIDAN_room_18, +HIDAN_room_19, +HIDAN_room_20, +HIDAN_room_21, +HIDAN_room_22, +HIDAN_room_23, +HIDAN_room_24, +HIDAN_room_25, +HIDAN_room_26, +MIZUsin_scene, +MIZUsin_room_0, +MIZUsin_room_1, +MIZUsin_room_2, +MIZUsin_room_3, +MIZUsin_room_4, +MIZUsin_room_5, +MIZUsin_room_6, +MIZUsin_room_7, +MIZUsin_room_8, +MIZUsin_room_9, +MIZUsin_room_10, +MIZUsin_room_11, +MIZUsin_room_12, +MIZUsin_room_13, +MIZUsin_room_14, +MIZUsin_room_15, +MIZUsin_room_16, +MIZUsin_room_17, +MIZUsin_room_18, +MIZUsin_room_19, +MIZUsin_room_20, +MIZUsin_room_21, +MIZUsin_room_22, +jyasinzou_scene, +jyasinzou_room_0, +jyasinzou_room_1, +jyasinzou_room_2, +jyasinzou_room_3, +jyasinzou_room_4, +jyasinzou_room_5, +jyasinzou_room_6, +jyasinzou_room_7, +jyasinzou_room_8, +jyasinzou_room_9, +jyasinzou_room_10, +jyasinzou_room_11, +jyasinzou_room_12, +jyasinzou_room_13, +jyasinzou_room_14, +jyasinzou_room_15, +jyasinzou_room_16, +jyasinzou_room_17, +jyasinzou_room_18, +jyasinzou_room_19, +jyasinzou_room_20, +jyasinzou_room_21, +jyasinzou_room_22, +jyasinzou_room_23, +jyasinzou_room_24, +jyasinzou_room_25, +jyasinzou_room_26, +jyasinzou_room_27, +jyasinzou_room_28, +HAKAdan_scene, +HAKAdan_room_0, +HAKAdan_room_1, +HAKAdan_room_2, +HAKAdan_room_3, +HAKAdan_room_4, +HAKAdan_room_5, +HAKAdan_room_6, +HAKAdan_room_7, +HAKAdan_room_8, +HAKAdan_room_9, +HAKAdan_room_10, +HAKAdan_room_11, +HAKAdan_room_12, +HAKAdan_room_13, +HAKAdan_room_14, +HAKAdan_room_15, +HAKAdan_room_16, +HAKAdan_room_17, +HAKAdan_room_18, +HAKAdan_room_19, +HAKAdan_room_20, +HAKAdan_room_21, +HAKAdan_room_22, +HAKAdanCH_scene, +HAKAdanCH_room_0, +HAKAdanCH_room_1, +HAKAdanCH_room_2, +HAKAdanCH_room_3, +HAKAdanCH_room_4, +HAKAdanCH_room_5, +HAKAdanCH_room_6, +ice_doukutu_scene, +ice_doukutu_room_0, +ice_doukutu_room_1, +ice_doukutu_room_2, +ice_doukutu_room_3, +ice_doukutu_room_4, +ice_doukutu_room_5, +ice_doukutu_room_6, +ice_doukutu_room_7, +ice_doukutu_room_8, +ice_doukutu_room_9, +ice_doukutu_room_10, +ice_doukutu_room_11, +men_scene, +men_room_0, +men_room_1, +men_room_2, +men_room_3, +men_room_4, +men_room_5, +men_room_6, +men_room_7, +men_room_8, +men_room_9, +men_room_10, +ganontika_scene, +ganontika_room_0, +ganontika_room_1, +ganontika_room_2, +ganontika_room_3, +ganontika_room_4, +ganontika_room_5, +ganontika_room_6, +ganontika_room_7, +ganontika_room_8, +ganontika_room_9, +ganontika_room_10, +ganontika_room_11, +ganontika_room_12, +ganontika_room_13, +ganontika_room_14, +ganontika_room_15, +ganontika_room_16, +ganontika_room_17, +ganontika_room_18, +ganontika_room_19, +spot00_scene, +spot00_room_0, +spot01_scene, +spot01_room_0, +spot02_scene, +spot02_room_0, +spot02_room_1, +spot03_scene, +spot03_room_0, +spot03_room_1, +spot04_scene, +spot04_room_0, +spot04_room_1, +spot04_room_2, +spot05_scene, +spot05_room_0, +spot06_scene, +spot06_room_0, +spot07_scene, +spot07_room_0, +spot07_room_1, +spot08_scene, +spot08_room_0, +spot09_scene, +spot09_room_0, +spot10_scene, +spot10_room_0, +spot10_room_1, +spot10_room_2, +spot10_room_3, +spot10_room_4, +spot10_room_5, +spot10_room_6, +spot10_room_7, +spot10_room_8, +spot10_room_9, +spot11_scene, +spot11_room_0, +spot12_scene, +spot12_room_0, +spot12_room_1, +spot13_scene, +spot13_room_0, +spot13_room_1, +spot15_scene, +spot15_room_0, +spot16_scene, +spot16_room_0, +spot17_scene, +spot17_room_0, +spot17_room_1, +spot18_scene, +spot18_room_0, +spot18_room_1, +spot18_room_2, +spot18_room_3, +market_day_scene, +market_day_room_0, +market_night_scene, +market_night_room_0, +kenjyanoma_scene, +kenjyanoma_room_0, +tokinoma_scene, +tokinoma_room_0, +tokinoma_room_1, +link_home_scene, +link_home_room_0, +kokiri_shop_scene, +kokiri_shop_room_0, +kokiri_home_scene, +kokiri_home_room_0, +kakusiana_scene, +kakusiana_room_0, +kakusiana_room_1, +kakusiana_room_2, +kakusiana_room_3, +kakusiana_room_4, +kakusiana_room_5, +kakusiana_room_6, +kakusiana_room_7, +kakusiana_room_8, +kakusiana_room_9, +kakusiana_room_10, +kakusiana_room_11, +kakusiana_room_12, +kakusiana_room_13, +entra_scene, +entra_room_0, +moribossroom_scene, +moribossroom_room_0, +moribossroom_room_1, +syatekijyou_scene, +syatekijyou_room_0, +shop1_scene, +shop1_room_0, +hairal_niwa_scene, +hairal_niwa_room_0, +ganon_tou_scene, +ganon_tou_room_0, +market_alley_scene, +market_alley_room_0, +spot20_scene, +spot20_room_0, +market_ruins_scene, +market_ruins_room_0, +entra_n_scene, +entra_n_room_0, +enrui_scene, +enrui_room_0, +market_alley_n_scene, +market_alley_n_room_0, +hiral_demo_scene, +hiral_demo_room_0, +kokiri_home3_scene, +kokiri_home3_room_0, +malon_stable_scene, +malon_stable_room_0, +kakariko_scene, +kakariko_room_0, +bdan_boss_scene, +bdan_boss_room_0, +bdan_boss_room_1, +FIRE_bs_scene, +FIRE_bs_room_0, +FIRE_bs_room_1, +hut_scene, +hut_room_0, +daiyousei_izumi_scene, +daiyousei_izumi_room_0, +hakaana_scene, +hakaana_room_0, +yousei_izumi_tate_scene, +yousei_izumi_tate_room_0, +yousei_izumi_yoko_scene, +yousei_izumi_yoko_room_0, +golon_scene, +golon_room_0, +zoora_scene, +zoora_room_0, +drag_scene, +drag_room_0, +alley_shop_scene, +alley_shop_room_0, +night_shop_scene, +night_shop_room_0, +impa_scene, +impa_room_0, +labo_scene, +labo_room_0, +tent_scene, +tent_room_0, +nakaniwa_scene, +nakaniwa_room_0, +ddan_boss_scene, +ddan_boss_room_0, +ddan_boss_room_1, +ydan_boss_scene, +ydan_boss_room_0, +ydan_boss_room_1, +HAKAdan_bs_scene, +HAKAdan_bs_room_0, +HAKAdan_bs_room_1, +MIZUsin_bs_scene, +MIZUsin_bs_room_0, +MIZUsin_bs_room_1, +ganon_scene, +ganon_room_0, +ganon_room_1, +ganon_room_2, +ganon_room_3, +ganon_room_4, +ganon_room_5, +ganon_room_6, +ganon_room_7, +ganon_room_8, +ganon_room_9, +ganon_boss_scene, +ganon_boss_room_0, +jyasinboss_scene, +jyasinboss_room_0, +jyasinboss_room_1, +jyasinboss_room_2, +jyasinboss_room_3, +kokiri_home4_scene, +kokiri_home4_room_0, +kokiri_home5_scene, +kokiri_home5_room_0, +ganon_final_scene, +ganon_final_room_0, +kakariko3_scene, +kakariko3_room_0, +hakasitarelay_scene, +hakasitarelay_room_0, +hakasitarelay_room_1, +hakasitarelay_room_2, +hakasitarelay_room_3, +hakasitarelay_room_4, +hakasitarelay_room_5, +hakasitarelay_room_6, +shrine_scene, +shrine_room_0, +turibori_scene, +turibori_room_0, +shrine_n_scene, +shrine_n_room_0, +shrine_r_scene, +shrine_r_room_0, +hakaana2_scene, +hakaana2_room_0, +gerudoway_scene, +gerudoway_room_0, +gerudoway_room_1, +gerudoway_room_2, +gerudoway_room_3, +gerudoway_room_4, +gerudoway_room_5, +hairal_niwa_n_scene, +hairal_niwa_n_room_0, +bowling_scene, +bowling_room_0, +hakaana_ouke_scene, +hakaana_ouke_room_0, +hakaana_ouke_room_1, +hakaana_ouke_room_2, +hylia_labo_scene, +hylia_labo_room_0, +souko_scene, +souko_room_0, +souko_room_1, +souko_room_2, +miharigoya_scene, +miharigoya_room_0, +mahouya_scene, +mahouya_room_0, +takaraya_scene, +takaraya_room_0, +takaraya_room_1, +takaraya_room_2, +takaraya_room_3, +takaraya_room_4, +takaraya_room_5, +takaraya_room_6, +ganon_sonogo_scene, +ganon_sonogo_room_0, +ganon_sonogo_room_1, +ganon_sonogo_room_2, +ganon_sonogo_room_3, +ganon_sonogo_room_4, +ganon_demo_scene, +ganon_demo_room_0, +face_shop_scene, +face_shop_room_0, +kinsuta_scene, +kinsuta_room_0, +ganontikasonogo_scene, +ganontikasonogo_room_0, +ganontikasonogo_room_1, +bump_texture_static, +anime_model_1_static, +anime_model_2_static, +anime_model_3_static, +anime_model_4_static, +anime_model_5_static, +anime_model_6_static, +anime_texture_1_static, +anime_texture_2_static, +anime_texture_3_static, +anime_texture_4_static, +anime_texture_5_static, +anime_texture_6_static, +softsprite_matrix_static, diff --git a/baseroms/gc-jp-mq/checksum-compressed.md5 b/baseroms/gc-jp-mq/checksum-compressed.md5 new file mode 100644 index 0000000000..8a583aa524 --- /dev/null +++ b/baseroms/gc-jp-mq/checksum-compressed.md5 @@ -0,0 +1 @@ +69895c5c78442260f6eafb2506dc482a build/gc-jp-mq/oot-gc-jp-mq-compressed.z64 diff --git a/baseroms/gc-jp-mq/checksum.md5 b/baseroms/gc-jp-mq/checksum.md5 new file mode 100644 index 0000000000..69819ce2c2 --- /dev/null +++ b/baseroms/gc-jp-mq/checksum.md5 @@ -0,0 +1 @@ +f70cf137eb8f783cb5d79756190728ce build/gc-jp-mq/oot-gc-jp-mq.z64 diff --git a/baseroms/gc-jp-mq/config.yml b/baseroms/gc-jp-mq/config.yml new file mode 100644 index 0000000000..6e1ab6b0ef --- /dev/null +++ b/baseroms/gc-jp-mq/config.yml @@ -0,0 +1,1212 @@ +dmadata_start: 0x7170 +text_lang_pal: false +incbins: + - name: ipl3 + segment: makerom + vram: 0x80000040 + size: 0xFC0 + - name: rspbootText + segment: boot + vram: 0x80005FC0 + size: 0xD0 + - name: aspMainText + segment: code + vram: 0x800E3840 + size: 0xFB0 + - name: gspS2DEX2d_fifoText + segment: code + vram: 0x800E47F0 + size: 0x18C0 + - name: njpgdspMainText + segment: code + vram: 0x800E60B0 + size: 0xAF0 + - name: aspMainData + segment: code + vram: 0x80113820 + size: 0x2E0 + - name: gspF3DZEX2_NoN_PosLight_fifoText + segment: code + vram: 0x80113B00 + size: 0x1630 + - name: gspF3DZEX2_NoN_PosLight_fifoData + segment: code + vram: 0x80115130 + size: 0x420 + - name: gspS2DEX2d_fifoData + segment: code + vram: 0x80115550 + size: 0x390 + - name: njpgdspMainData + segment: code + vram: 0x801158E0 + size: 0x60 +variables: + gMtxClear: 0x800FE2A0 + sJpnMessageEntryTable: 0x80109E8C + sNesMessageEntryTable: 0x8010DFCC + sStaffMessageEntryTable: 0x801121EC + gSoundFontTable: 0x80112C80 + gSequenceFontTable: 0x80112EF0 + gSequenceTable: 0x801130B0 + gSampleBankTable: 0x801137A0 + sShadowTex: 0x80A740D0 +assets: +- name: code/fbdemo_circle + xml_path: assets/xml/code/fbdemo_circle.xml + start_offset: 0xEB768 + end_offset: 0xEC988 +- name: code/fbdemo_triforce + xml_path: assets/xml/code/fbdemo_triforce.xml + start_offset: 0xEABF0 + end_offset: 0xEACC0 +- name: code/fbdemo_wipe1 + xml_path: assets/xml/code/fbdemo_wipe1.xml + start_offset: 0xEACC0 + end_offset: 0xEB650 +- name: misc/link_animetion + xml_path: assets/xml/misc/link_animetion.xml +- name: misc/z_select_static + xml_path: assets/xml/misc/z_select_static.xml +- name: objects/gameplay_dangeon_keep + xml_path: assets/xml/objects/gameplay_dangeon_keep.xml +- name: objects/gameplay_field_keep + xml_path: assets/xml/objects/gameplay_field_keep.xml +- name: objects/gameplay_keep + xml_path: assets/xml/objects/gameplay_keep.xml +- name: objects/object_ahg + xml_path: assets/xml/objects/object_ahg.xml +- name: objects/object_am + xml_path: assets/xml/objects/object_am.xml +- name: objects/object_ane + xml_path: assets/xml/objects/object_ane.xml +- name: objects/object_ani + xml_path: assets/xml/objects/object_ani.xml +- name: objects/object_anubice + xml_path: assets/xml/objects/object_anubice.xml +- name: objects/object_aob + xml_path: assets/xml/objects/object_aob.xml +- name: objects/object_b_heart + xml_path: assets/xml/objects/object_b_heart.xml +- name: objects/object_Bb + xml_path: assets/xml/objects/object_Bb.xml +- name: objects/object_bba + xml_path: assets/xml/objects/object_bba.xml +- name: objects/object_bdan_objects + xml_path: assets/xml/objects/object_bdan_objects.xml +- name: objects/object_bdoor + xml_path: assets/xml/objects/object_bdoor.xml +- name: objects/object_bg + xml_path: assets/xml/objects/object_bg.xml +- name: objects/object_bigokuta + xml_path: assets/xml/objects/object_bigokuta.xml +- name: objects/object_bird + xml_path: assets/xml/objects/object_bird.xml +- name: objects/object_bji + xml_path: assets/xml/objects/object_bji.xml +- name: objects/object_bl + xml_path: assets/xml/objects/object_bl.xml +- name: objects/object_blkobj + xml_path: assets/xml/objects/object_blkobj.xml +- name: objects/object_bob + xml_path: assets/xml/objects/object_bob.xml +- name: objects/object_boj + xml_path: assets/xml/objects/object_boj.xml +- name: objects/object_bombf + xml_path: assets/xml/objects/object_bombf.xml +- name: objects/object_bombiwa + xml_path: assets/xml/objects/object_bombiwa.xml +- name: objects/object_bowl + xml_path: assets/xml/objects/object_bowl.xml +- name: objects/object_box + xml_path: assets/xml/objects/object_box.xml +- name: objects/object_brob + xml_path: assets/xml/objects/object_brob.xml +- name: objects/object_bubble + xml_path: assets/xml/objects/object_bubble.xml +- name: objects/object_bv + xml_path: assets/xml/objects/object_bv.xml +- name: objects/object_bw + xml_path: assets/xml/objects/object_bw.xml +- name: objects/object_bwall + xml_path: assets/xml/objects/object_bwall.xml +- name: objects/object_bxa + xml_path: assets/xml/objects/object_bxa.xml +- name: objects/object_cne + xml_path: assets/xml/objects/object_cne.xml +- name: objects/object_cob + xml_path: assets/xml/objects/object_cob.xml +- name: objects/object_cow + xml_path: assets/xml/objects/object_cow.xml +- name: objects/object_crow + xml_path: assets/xml/objects/object_crow.xml +- name: objects/object_cs + xml_path: assets/xml/objects/object_cs.xml +- name: objects/object_d_elevator + xml_path: assets/xml/objects/object_d_elevator.xml +- name: objects/object_d_hsblock + xml_path: assets/xml/objects/object_d_hsblock.xml +- name: objects/object_d_lift + xml_path: assets/xml/objects/object_d_lift.xml +- name: objects/object_daiku + xml_path: assets/xml/objects/object_daiku.xml +- name: objects/object_ddan_objects + xml_path: assets/xml/objects/object_ddan_objects.xml +- name: objects/object_dekubaba + xml_path: assets/xml/objects/object_dekubaba.xml +- name: objects/object_dekujr + xml_path: assets/xml/objects/object_dekujr.xml +- name: objects/object_dekunuts + xml_path: assets/xml/objects/object_dekunuts.xml +- name: objects/object_demo_6k + xml_path: assets/xml/objects/object_demo_6k.xml +- name: objects/object_demo_kekkai + xml_path: assets/xml/objects/object_demo_kekkai.xml +- name: objects/object_demo_tre_lgt + xml_path: assets/xml/objects/object_demo_tre_lgt.xml +- name: objects/object_dh + xml_path: assets/xml/objects/object_dh.xml +- name: objects/object_dnk + xml_path: assets/xml/objects/object_dnk.xml +- name: objects/object_dns + xml_path: assets/xml/objects/object_dns.xml +- name: objects/object_dodojr + xml_path: assets/xml/objects/object_dodojr.xml +- name: objects/object_dodongo + xml_path: assets/xml/objects/object_dodongo.xml +- name: objects/object_dog + xml_path: assets/xml/objects/object_dog.xml +- name: objects/object_door_gerudo + xml_path: assets/xml/objects/object_door_gerudo.xml +- name: objects/object_door_killer + xml_path: assets/xml/objects/object_door_killer.xml +- name: objects/object_ds + xml_path: assets/xml/objects/object_ds.xml +- name: objects/object_ds2 + xml_path: assets/xml/objects/object_ds2.xml +- name: objects/object_du + xml_path: assets/xml/objects/object_du.xml +- name: objects/object_dy_obj + xml_path: assets/xml/objects/object_dy_obj.xml +- name: objects/object_ec + xml_path: assets/xml/objects/object_ec.xml +- name: objects/object_efc_crystal_light + xml_path: assets/xml/objects/object_efc_crystal_light.xml +- name: objects/object_efc_doughnut + xml_path: assets/xml/objects/object_efc_doughnut.xml +- name: objects/object_efc_erupc + xml_path: assets/xml/objects/object_efc_erupc.xml +- name: objects/object_efc_fire_ball + xml_path: assets/xml/objects/object_efc_fire_ball.xml +- name: objects/object_efc_flash + xml_path: assets/xml/objects/object_efc_flash.xml +- name: objects/object_efc_lgt_shower + xml_path: assets/xml/objects/object_efc_lgt_shower.xml +- name: objects/object_efc_star_field + xml_path: assets/xml/objects/object_efc_star_field.xml +- name: objects/object_efc_tw + xml_path: assets/xml/objects/object_efc_tw.xml +- name: objects/object_ei + xml_path: assets/xml/objects/object_ei.xml +- name: objects/object_fa + xml_path: assets/xml/objects/object_fa.xml +- name: objects/object_fd + xml_path: assets/xml/objects/object_fd.xml +- name: objects/object_fd2 + xml_path: assets/xml/objects/object_fd2.xml +- name: objects/object_fhg + xml_path: assets/xml/objects/object_fhg.xml +- name: objects/object_fire + xml_path: assets/xml/objects/object_fire.xml +- name: objects/object_firefly + xml_path: assets/xml/objects/object_firefly.xml +- name: objects/object_fish + xml_path: assets/xml/objects/object_fish.xml +- name: objects/object_fr + xml_path: assets/xml/objects/object_fr.xml +- name: objects/object_fu + xml_path: assets/xml/objects/object_fu.xml +- name: objects/object_fw + xml_path: assets/xml/objects/object_fw.xml +- name: objects/object_fz + xml_path: assets/xml/objects/object_fz.xml +- name: objects/object_ganon + xml_path: assets/xml/objects/object_ganon.xml +- name: objects/object_ganon2 + xml_path: assets/xml/objects/object_ganon2.xml +- name: objects/object_ganon_anime1 + xml_path: assets/xml/objects/object_ganon_anime1.xml +- name: objects/object_ganon_anime2 + xml_path: assets/xml/objects/object_ganon_anime2.xml +- name: objects/object_ganon_anime3 + xml_path: assets/xml/objects/object_ganon_anime3.xml +- name: objects/object_ganon_objects + xml_path: assets/xml/objects/object_ganon_objects.xml +- name: objects/object_ge1 + xml_path: assets/xml/objects/object_ge1.xml +- name: objects/object_geff + xml_path: assets/xml/objects/object_geff.xml +- name: objects/object_geldb + xml_path: assets/xml/objects/object_geldb.xml +- name: objects/object_gi_arrow + xml_path: assets/xml/objects/object_gi_arrow.xml +- name: objects/object_gi_arrowcase + xml_path: assets/xml/objects/object_gi_arrowcase.xml +- name: objects/object_gi_bean + xml_path: assets/xml/objects/object_gi_bean.xml +- name: objects/object_gi_bomb_1 + xml_path: assets/xml/objects/object_gi_bomb_1.xml +- name: objects/object_gi_bomb_2 + xml_path: assets/xml/objects/object_gi_bomb_2.xml +- name: objects/object_gi_bombpouch + xml_path: assets/xml/objects/object_gi_bombpouch.xml +- name: objects/object_gi_boomerang + xml_path: assets/xml/objects/object_gi_boomerang.xml +- name: objects/object_gi_boots_2 + xml_path: assets/xml/objects/object_gi_boots_2.xml +- name: objects/object_gi_bosskey + xml_path: assets/xml/objects/object_gi_bosskey.xml +- name: objects/object_gi_bottle + xml_path: assets/xml/objects/object_gi_bottle.xml +- name: objects/object_gi_bottle_letter + xml_path: assets/xml/objects/object_gi_bottle_letter.xml +- name: objects/object_gi_bow + xml_path: assets/xml/objects/object_gi_bow.xml +- name: objects/object_gi_bracelet + xml_path: assets/xml/objects/object_gi_bracelet.xml +- name: objects/object_gi_brokensword + xml_path: assets/xml/objects/object_gi_brokensword.xml +- name: objects/object_gi_butterfly + xml_path: assets/xml/objects/object_gi_butterfly.xml +- name: objects/object_gi_clothes + xml_path: assets/xml/objects/object_gi_clothes.xml +- name: objects/object_gi_coin + xml_path: assets/xml/objects/object_gi_coin.xml +- name: objects/object_gi_compass + xml_path: assets/xml/objects/object_gi_compass.xml +- name: objects/object_gi_dekupouch + xml_path: assets/xml/objects/object_gi_dekupouch.xml +- name: objects/object_gi_egg + xml_path: assets/xml/objects/object_gi_egg.xml +- name: objects/object_gi_eye_lotion + xml_path: assets/xml/objects/object_gi_eye_lotion.xml +- name: objects/object_gi_fire + xml_path: assets/xml/objects/object_gi_fire.xml +- name: objects/object_gi_fish + xml_path: assets/xml/objects/object_gi_fish.xml +- name: objects/object_gi_frog + xml_path: assets/xml/objects/object_gi_frog.xml +- name: objects/object_gi_gerudo + xml_path: assets/xml/objects/object_gi_gerudo.xml +- name: objects/object_gi_gerudomask + xml_path: assets/xml/objects/object_gi_gerudomask.xml +- name: objects/object_gi_ghost + xml_path: assets/xml/objects/object_gi_ghost.xml +- name: objects/object_gi_glasses + xml_path: assets/xml/objects/object_gi_glasses.xml +- name: objects/object_gi_gloves + xml_path: assets/xml/objects/object_gi_gloves.xml +- name: objects/object_gi_goddess + xml_path: assets/xml/objects/object_gi_goddess.xml +- name: objects/object_gi_golonmask + xml_path: assets/xml/objects/object_gi_golonmask.xml +- name: objects/object_gi_grass + xml_path: assets/xml/objects/object_gi_grass.xml +- name: objects/object_gi_hammer + xml_path: assets/xml/objects/object_gi_hammer.xml +- name: objects/object_gi_heart + xml_path: assets/xml/objects/object_gi_heart.xml +- name: objects/object_gi_hearts + xml_path: assets/xml/objects/object_gi_hearts.xml +- name: objects/object_gi_hookshot + xml_path: assets/xml/objects/object_gi_hookshot.xml +- name: objects/object_gi_hoverboots + xml_path: assets/xml/objects/object_gi_hoverboots.xml +- name: objects/object_gi_insect + xml_path: assets/xml/objects/object_gi_insect.xml +- name: objects/object_gi_jewel + xml_path: assets/xml/objects/object_gi_jewel.xml +- name: objects/object_gi_key + xml_path: assets/xml/objects/object_gi_key.xml +- name: objects/object_gi_ki_tan_mask + xml_path: assets/xml/objects/object_gi_ki_tan_mask.xml +- name: objects/object_gi_letter + xml_path: assets/xml/objects/object_gi_letter.xml +- name: objects/object_gi_liquid + xml_path: assets/xml/objects/object_gi_liquid.xml +- name: objects/object_gi_longsword + xml_path: assets/xml/objects/object_gi_longsword.xml +- name: objects/object_gi_m_arrow + xml_path: assets/xml/objects/object_gi_m_arrow.xml +- name: objects/object_gi_magicpot + xml_path: assets/xml/objects/object_gi_magicpot.xml +- name: objects/object_gi_map + xml_path: assets/xml/objects/object_gi_map.xml +- name: objects/object_gi_medal + xml_path: assets/xml/objects/object_gi_medal.xml +- name: objects/object_gi_melody + xml_path: assets/xml/objects/object_gi_melody.xml +- name: objects/object_gi_milk + xml_path: assets/xml/objects/object_gi_milk.xml +- name: objects/object_gi_mushroom + xml_path: assets/xml/objects/object_gi_mushroom.xml +- name: objects/object_gi_niwatori + xml_path: assets/xml/objects/object_gi_niwatori.xml +- name: objects/object_gi_nuts + xml_path: assets/xml/objects/object_gi_nuts.xml +- name: objects/object_gi_ocarina + xml_path: assets/xml/objects/object_gi_ocarina.xml +- name: objects/object_gi_ocarina_0 + xml_path: assets/xml/objects/object_gi_ocarina_0.xml +- name: objects/object_gi_pachinko + xml_path: assets/xml/objects/object_gi_pachinko.xml +- name: objects/object_gi_powder + xml_path: assets/xml/objects/object_gi_powder.xml +- name: objects/object_gi_prescription + xml_path: assets/xml/objects/object_gi_prescription.xml +- name: objects/object_gi_purse + xml_path: assets/xml/objects/object_gi_purse.xml +- name: objects/object_gi_rabit_mask + xml_path: assets/xml/objects/object_gi_rabit_mask.xml +- name: objects/object_gi_redead_mask + xml_path: assets/xml/objects/object_gi_redead_mask.xml +- name: objects/object_gi_rupy + xml_path: assets/xml/objects/object_gi_rupy.xml +- name: objects/object_gi_saw + xml_path: assets/xml/objects/object_gi_saw.xml +- name: objects/object_gi_scale + xml_path: assets/xml/objects/object_gi_scale.xml +- name: objects/object_gi_seed + xml_path: assets/xml/objects/object_gi_seed.xml +- name: objects/object_gi_shield_1 + xml_path: assets/xml/objects/object_gi_shield_1.xml +- name: objects/object_gi_shield_2 + xml_path: assets/xml/objects/object_gi_shield_2.xml +- name: objects/object_gi_shield_3 + xml_path: assets/xml/objects/object_gi_shield_3.xml +- name: objects/object_gi_skj_mask + xml_path: assets/xml/objects/object_gi_skj_mask.xml +- name: objects/object_gi_soldout + xml_path: assets/xml/objects/object_gi_soldout.xml +- name: objects/object_gi_soul + xml_path: assets/xml/objects/object_gi_soul.xml +- name: objects/object_gi_stick + xml_path: assets/xml/objects/object_gi_stick.xml +- name: objects/object_gi_sutaru + xml_path: assets/xml/objects/object_gi_sutaru.xml +- name: objects/object_gi_sword_1 + xml_path: assets/xml/objects/object_gi_sword_1.xml +- name: objects/object_gi_ticketstone + xml_path: assets/xml/objects/object_gi_ticketstone.xml +- name: objects/object_gi_truth_mask + xml_path: assets/xml/objects/object_gi_truth_mask.xml +- name: objects/object_gi_zoramask + xml_path: assets/xml/objects/object_gi_zoramask.xml +- name: objects/object_gj + xml_path: assets/xml/objects/object_gj.xml +- name: objects/object_gjyo_objects + xml_path: assets/xml/objects/object_gjyo_objects.xml +- name: objects/object_gla + xml_path: assets/xml/objects/object_gla.xml +- name: objects/object_gm + xml_path: assets/xml/objects/object_gm.xml +- name: objects/object_gnd + xml_path: assets/xml/objects/object_gnd.xml +- name: objects/object_gnd_magic + xml_path: assets/xml/objects/object_gnd_magic.xml +- name: objects/object_gndd + xml_path: assets/xml/objects/object_gndd.xml +- name: objects/object_god_lgt + xml_path: assets/xml/objects/object_god_lgt.xml +- name: objects/object_gol + xml_path: assets/xml/objects/object_gol.xml +- name: objects/object_goma + xml_path: assets/xml/objects/object_goma.xml +- name: objects/object_goroiwa + xml_path: assets/xml/objects/object_goroiwa.xml +- name: objects/object_gr + xml_path: assets/xml/objects/object_gr.xml +- name: objects/object_gs + xml_path: assets/xml/objects/object_gs.xml +- name: objects/object_gt + xml_path: assets/xml/objects/object_gt.xml +- name: objects/object_haka + xml_path: assets/xml/objects/object_haka.xml +- name: objects/object_haka_door + xml_path: assets/xml/objects/object_haka_door.xml +- name: objects/object_haka_objects + xml_path: assets/xml/objects/object_haka_objects.xml +- name: objects/object_hakach_objects + xml_path: assets/xml/objects/object_hakach_objects.xml +- name: objects/object_hata + xml_path: assets/xml/objects/object_hata.xml +- name: objects/object_heavy_object + xml_path: assets/xml/objects/object_heavy_object.xml +- name: objects/object_hidan_objects + xml_path: assets/xml/objects/object_hidan_objects.xml +- name: objects/object_hintnuts + xml_path: assets/xml/objects/object_hintnuts.xml +- name: objects/object_hni + xml_path: assets/xml/objects/object_hni.xml +- name: objects/object_horse + xml_path: assets/xml/objects/object_horse.xml +- name: objects/object_horse_ganon + xml_path: assets/xml/objects/object_horse_ganon.xml +- name: objects/object_horse_link_child + xml_path: assets/xml/objects/object_horse_link_child.xml +- name: objects/object_horse_normal + xml_path: assets/xml/objects/object_horse_normal.xml +- name: objects/object_horse_zelda + xml_path: assets/xml/objects/object_horse_zelda.xml +- name: objects/object_hs + xml_path: assets/xml/objects/object_hs.xml +- name: objects/object_human + xml_path: assets/xml/objects/object_human.xml +- name: objects/object_ice_objects + xml_path: assets/xml/objects/object_ice_objects.xml +- name: objects/object_ik + xml_path: assets/xml/objects/object_ik.xml +- name: objects/object_im + xml_path: assets/xml/objects/object_im.xml +- name: objects/object_in + xml_path: assets/xml/objects/object_in.xml +- name: objects/object_ingate + xml_path: assets/xml/objects/object_ingate.xml +- name: objects/object_jj + xml_path: assets/xml/objects/object_jj.xml +- name: objects/object_js + xml_path: assets/xml/objects/object_js.xml +- name: objects/object_jya_door + xml_path: assets/xml/objects/object_jya_door.xml +- name: objects/object_jya_iron + xml_path: assets/xml/objects/object_jya_iron.xml +- name: objects/object_jya_obj + xml_path: assets/xml/objects/object_jya_obj.xml +- name: objects/object_ka + xml_path: assets/xml/objects/object_ka.xml +- name: objects/object_kanban + xml_path: assets/xml/objects/object_kanban.xml +- name: objects/object_kibako2 + xml_path: assets/xml/objects/object_kibako2.xml +- name: objects/object_kingdodongo + xml_path: assets/xml/objects/object_kingdodongo.xml +- name: objects/object_km1 + xml_path: assets/xml/objects/object_km1.xml +- name: objects/object_kusa + xml_path: assets/xml/objects/object_kusa.xml +- name: objects/object_kw1 + xml_path: assets/xml/objects/object_kw1.xml +- name: objects/object_kz + xml_path: assets/xml/objects/object_kz.xml +- name: objects/object_light_ring + xml_path: assets/xml/objects/object_light_ring.xml +- name: objects/object_lightbox + xml_path: assets/xml/objects/object_lightbox.xml +- name: objects/object_lightswitch + xml_path: assets/xml/objects/object_lightswitch.xml +- name: objects/object_link_boy + xml_path: assets/xml/objects/object_link_boy.xml +- name: objects/object_link_child + xml_path: assets/xml/objects/object_link_child.xml +- name: objects/object_ma1 + xml_path: assets/xml/objects/object_ma1.xml +- name: objects/object_ma2 + xml_path: assets/xml/objects/object_ma2.xml +- name: objects/object_mag + xml_path: assets/xml/objects/object_mag_v2_mq.xml +- name: objects/object_mamenoki + xml_path: assets/xml/objects/object_mamenoki.xml +- name: objects/object_mastergolon + xml_path: assets/xml/objects/object_mastergolon.xml +- name: objects/object_masterkokiri + xml_path: assets/xml/objects/object_masterkokiri.xml +- name: objects/object_masterkokirihead + xml_path: assets/xml/objects/object_masterkokirihead.xml +- name: objects/object_masterzoora + xml_path: assets/xml/objects/object_masterzoora.xml +- name: objects/object_mb + xml_path: assets/xml/objects/object_mb.xml +- name: objects/object_md + xml_path: assets/xml/objects/object_md.xml +- name: objects/object_medal + xml_path: assets/xml/objects/object_medal.xml +- name: objects/object_menkuri_objects + xml_path: assets/xml/objects/object_menkuri_objects.xml +- name: objects/object_mir_ray + xml_path: assets/xml/objects/object_mir_ray.xml +- name: objects/object_mizu_objects + xml_path: assets/xml/objects/object_mizu_objects.xml +- name: objects/object_mjin + xml_path: assets/xml/objects/object_mjin.xml +- name: objects/object_mjin_dark + xml_path: assets/xml/objects/object_mjin_dark.xml +- name: objects/object_mjin_flame + xml_path: assets/xml/objects/object_mjin_flame.xml +- name: objects/object_mjin_flash + xml_path: assets/xml/objects/object_mjin_flash.xml +- name: objects/object_mjin_ice + xml_path: assets/xml/objects/object_mjin_ice.xml +- name: objects/object_mjin_oka + xml_path: assets/xml/objects/object_mjin_oka.xml +- name: objects/object_mjin_soul + xml_path: assets/xml/objects/object_mjin_soul.xml +- name: objects/object_mjin_wind + xml_path: assets/xml/objects/object_mjin_wind.xml +- name: objects/object_mk + xml_path: assets/xml/objects/object_mk.xml +- name: objects/object_mm + xml_path: assets/xml/objects/object_mm.xml +- name: objects/object_mo + xml_path: assets/xml/objects/object_mo.xml +- name: objects/object_mori_hineri1 + xml_path: assets/xml/objects/object_mori_hineri1.xml +- name: objects/object_mori_hineri1a + xml_path: assets/xml/objects/object_mori_hineri1a.xml +- name: objects/object_mori_hineri2 + xml_path: assets/xml/objects/object_mori_hineri2.xml +- name: objects/object_mori_hineri2a + xml_path: assets/xml/objects/object_mori_hineri2a.xml +- name: objects/object_mori_objects + xml_path: assets/xml/objects/object_mori_objects.xml +- name: objects/object_mori_tex + xml_path: assets/xml/objects/object_mori_tex.xml +- name: objects/object_ms + xml_path: assets/xml/objects/object_ms.xml +- name: objects/object_mu + xml_path: assets/xml/objects/object_mu.xml +- name: objects/object_nb + xml_path: assets/xml/objects/object_nb.xml +- name: objects/object_niw + xml_path: assets/xml/objects/object_niw.xml +- name: objects/object_nwc + xml_path: assets/xml/objects/object_nwc.xml +- name: objects/object_ny + xml_path: assets/xml/objects/object_ny.xml +- name: objects/object_o_anime + xml_path: assets/xml/objects/object_o_anime.xml +- name: objects/object_oA1 + xml_path: assets/xml/objects/object_oA1.xml +- name: objects/object_oA2 + xml_path: assets/xml/objects/object_oA2.xml +- name: objects/object_oA3 + xml_path: assets/xml/objects/object_oA3.xml +- name: objects/object_oA4 + xml_path: assets/xml/objects/object_oA4.xml +- name: objects/object_oA5 + xml_path: assets/xml/objects/object_oA5.xml +- name: objects/object_oA6 + xml_path: assets/xml/objects/object_oA6.xml +- name: objects/object_oA7 + xml_path: assets/xml/objects/object_oA7.xml +- name: objects/object_oA8 + xml_path: assets/xml/objects/object_oA8.xml +- name: objects/object_oA9 + xml_path: assets/xml/objects/object_oA9.xml +- name: objects/object_oA10 + xml_path: assets/xml/objects/object_oA10.xml +- name: objects/object_oA11 + xml_path: assets/xml/objects/object_oA11.xml +- name: objects/object_oB1 + xml_path: assets/xml/objects/object_oB1.xml +- name: objects/object_oB2 + xml_path: assets/xml/objects/object_oB2.xml +- name: objects/object_oB3 + xml_path: assets/xml/objects/object_oB3.xml +- name: objects/object_oB4 + xml_path: assets/xml/objects/object_oB4.xml +- name: objects/object_oE1 + xml_path: assets/xml/objects/object_oE1.xml +- name: objects/object_oE1s + xml_path: assets/xml/objects/object_oE1s.xml +- name: objects/object_oE2 + xml_path: assets/xml/objects/object_oE2.xml +- name: objects/object_oE3 + xml_path: assets/xml/objects/object_oE3.xml +- name: objects/object_oE4 + xml_path: assets/xml/objects/object_oE4.xml +- name: objects/object_oE4s + xml_path: assets/xml/objects/object_oE4s.xml +- name: objects/object_oE5 + xml_path: assets/xml/objects/object_oE5.xml +- name: objects/object_oE6 + xml_path: assets/xml/objects/object_oE6.xml +- name: objects/object_oE7 + xml_path: assets/xml/objects/object_oE7.xml +- name: objects/object_oE8 + xml_path: assets/xml/objects/object_oE8.xml +- name: objects/object_oE9 + xml_path: assets/xml/objects/object_oE9.xml +- name: objects/object_oE10 + xml_path: assets/xml/objects/object_oE10.xml +- name: objects/object_oE11 + xml_path: assets/xml/objects/object_oE11.xml +- name: objects/object_oE12 + xml_path: assets/xml/objects/object_oE12.xml +- name: objects/object_oE_anime + xml_path: assets/xml/objects/object_oE_anime.xml +- name: objects/object_oF1d_map + xml_path: assets/xml/objects/object_oF1d_map.xml +- name: objects/object_oF1s + xml_path: assets/xml/objects/object_oF1s.xml +- name: objects/object_okuta + xml_path: assets/xml/objects/object_okuta.xml +- name: objects/object_opening_demo1 + xml_path: assets/xml/objects/object_opening_demo1.xml +- name: objects/object_os + xml_path: assets/xml/objects/object_os.xml +- name: objects/object_os_anime + xml_path: assets/xml/objects/object_os_anime.xml +- name: objects/object_ossan + xml_path: assets/xml/objects/object_ossan.xml +- name: objects/object_ouke_haka + xml_path: assets/xml/objects/object_ouke_haka.xml +- name: objects/object_owl + xml_path: assets/xml/objects/object_owl.xml +- name: objects/object_peehat + xml_path: assets/xml/objects/object_peehat.xml +- name: objects/object_po_composer + xml_path: assets/xml/objects/object_po_composer.xml +- name: objects/object_po_field + xml_path: assets/xml/objects/object_po_field.xml +- name: objects/object_po_sisters + xml_path: assets/xml/objects/object_po_sisters.xml +- name: objects/object_poh + xml_path: assets/xml/objects/object_poh.xml +- name: objects/object_ps + xml_path: assets/xml/objects/object_ps.xml +- name: objects/object_pu_box + xml_path: assets/xml/objects/object_pu_box.xml +- name: objects/object_rd + xml_path: assets/xml/objects/object_rd.xml +- name: objects/object_reeba + xml_path: assets/xml/objects/object_reeba.xml +- name: objects/object_relay_objects + xml_path: assets/xml/objects/object_relay_objects.xml +- name: objects/object_rl + xml_path: assets/xml/objects/object_rl.xml +- name: objects/object_rr + xml_path: assets/xml/objects/object_rr.xml +- name: objects/object_rs + xml_path: assets/xml/objects/object_rs.xml +- name: objects/object_ru1 + xml_path: assets/xml/objects/object_ru1.xml +- name: objects/object_ru2 + xml_path: assets/xml/objects/object_ru2.xml +- name: objects/object_sa + xml_path: assets/xml/objects/object_sa.xml +- name: objects/object_sb + xml_path: assets/xml/objects/object_sb.xml +- name: objects/object_sd + xml_path: assets/xml/objects/object_sd.xml +- name: objects/object_shop_dungen + xml_path: assets/xml/objects/object_shop_dungen.xml +- name: objects/object_shopnuts + xml_path: assets/xml/objects/object_shopnuts.xml +- name: objects/object_siofuki + xml_path: assets/xml/objects/object_siofuki.xml +- name: objects/object_sk2 + xml_path: assets/xml/objects/object_sk2.xml +- name: objects/object_skb + xml_path: assets/xml/objects/object_skb.xml +- name: objects/object_skj + xml_path: assets/xml/objects/object_skj.xml +- name: objects/object_spot00_break + xml_path: assets/xml/objects/object_spot00_break.xml +- name: objects/object_spot00_objects + xml_path: assets/xml/objects/object_spot00_objects.xml +- name: objects/object_spot01_matoya + xml_path: assets/xml/objects/object_spot01_matoya.xml +- name: objects/object_spot01_matoyab + xml_path: assets/xml/objects/object_spot01_matoyab.xml +- name: objects/object_spot01_objects + xml_path: assets/xml/objects/object_spot01_objects.xml +- name: objects/object_spot01_objects2 + xml_path: assets/xml/objects/object_spot01_objects2.xml +- name: objects/object_spot02_objects + xml_path: assets/xml/objects/object_spot02_objects.xml +- name: objects/object_spot03_object + xml_path: assets/xml/objects/object_spot03_object.xml +- name: objects/object_spot04_objects + xml_path: assets/xml/objects/object_spot04_objects.xml +- name: objects/object_spot05_objects + xml_path: assets/xml/objects/object_spot05_objects.xml +- name: objects/object_spot06_objects + xml_path: assets/xml/objects/object_spot06_objects.xml +- name: objects/object_spot07_object + xml_path: assets/xml/objects/object_spot07_object.xml +- name: objects/object_spot08_obj + xml_path: assets/xml/objects/object_spot08_obj.xml +- name: objects/object_spot09_obj + xml_path: assets/xml/objects/object_spot09_obj.xml +- name: objects/object_spot11_obj + xml_path: assets/xml/objects/object_spot11_obj.xml +- name: objects/object_spot12_obj + xml_path: assets/xml/objects/object_spot12_obj.xml +- name: objects/object_spot15_obj + xml_path: assets/xml/objects/object_spot15_obj.xml +- name: objects/object_spot16_obj + xml_path: assets/xml/objects/object_spot16_obj.xml +- name: objects/object_spot17_obj + xml_path: assets/xml/objects/object_spot17_obj.xml +- name: objects/object_spot18_obj + xml_path: assets/xml/objects/object_spot18_obj.xml +- name: objects/object_ssh + xml_path: assets/xml/objects/object_ssh.xml +- name: objects/object_sst + xml_path: assets/xml/objects/object_sst.xml +- name: objects/object_st + xml_path: assets/xml/objects/object_st.xml +- name: objects/object_stream + xml_path: assets/xml/objects/object_stream.xml +- name: objects/object_syokudai + xml_path: assets/xml/objects/object_syokudai.xml +- name: objects/object_ta + xml_path: assets/xml/objects/object_ta.xml +- name: objects/object_timeblock + xml_path: assets/xml/objects/object_timeblock.xml +- name: objects/object_tite + xml_path: assets/xml/objects/object_tite.xml +- name: objects/object_tk + xml_path: assets/xml/objects/object_tk.xml +- name: objects/object_toki_objects + xml_path: assets/xml/objects/object_toki_objects.xml +- name: objects/object_torch2 + xml_path: assets/xml/objects/object_torch2.xml +- name: objects/object_toryo + xml_path: assets/xml/objects/object_toryo.xml +- name: objects/object_tp + xml_path: assets/xml/objects/object_tp.xml +- name: objects/object_tr + xml_path: assets/xml/objects/object_tr.xml +- name: objects/object_trap + xml_path: assets/xml/objects/object_trap.xml +- name: objects/object_triforce_spot + xml_path: assets/xml/objects/object_triforce_spot.xml +- name: objects/object_ts + xml_path: assets/xml/objects/object_ts.xml +- name: objects/object_tsubo + xml_path: assets/xml/objects/object_tsubo.xml +- name: objects/object_tw + xml_path: assets/xml/objects/object_tw.xml +- name: objects/object_umajump + xml_path: assets/xml/objects/object_umajump.xml +- name: objects/object_vali + xml_path: assets/xml/objects/object_vali.xml +- name: objects/object_vase + xml_path: assets/xml/objects/object_vase.xml +- name: objects/object_vm + xml_path: assets/xml/objects/object_vm.xml +- name: objects/object_wallmaster + xml_path: assets/xml/objects/object_wallmaster.xml +- name: objects/object_warp1 + xml_path: assets/xml/objects/object_warp1.xml +- name: objects/object_warp2 + xml_path: assets/xml/objects/object_warp2.xml +- name: objects/object_wf + xml_path: assets/xml/objects/object_wf.xml +- name: objects/object_wood02 + xml_path: assets/xml/objects/object_wood02.xml +- name: objects/object_xc + xml_path: assets/xml/objects/object_xc.xml +- name: objects/object_yabusame_point + xml_path: assets/xml/objects/object_yabusame_point.xml +- name: objects/object_ydan_objects + xml_path: assets/xml/objects/object_ydan_objects.xml +- name: objects/object_yukabyun + xml_path: assets/xml/objects/object_yukabyun.xml +- name: objects/object_zf + xml_path: assets/xml/objects/object_zf.xml +- name: objects/object_zg + xml_path: assets/xml/objects/object_zg.xml +- name: objects/object_zl1 + xml_path: assets/xml/objects/object_zl1.xml +- name: objects/object_zl2 + xml_path: assets/xml/objects/object_zl2.xml +- name: objects/object_zl2_anime1 + xml_path: assets/xml/objects/object_zl2_anime1.xml +- name: objects/object_zl2_anime2 + xml_path: assets/xml/objects/object_zl2_anime2.xml +- name: objects/object_zl4 + xml_path: assets/xml/objects/object_zl4.xml +- name: objects/object_zo + xml_path: assets/xml/objects/object_zo.xml +- name: overlays/ovl_Arrow_Fire + xml_path: assets/xml/overlays/ovl_Arrow_Fire.xml + start_offset: 0x980 + end_offset: 0x1DA0 +- name: overlays/ovl_Arrow_Ice + xml_path: assets/xml/overlays/ovl_Arrow_Ice.xml + start_offset: 0x9A0 + end_offset: 0x1DC0 +- name: overlays/ovl_Arrow_Light + xml_path: assets/xml/overlays/ovl_Arrow_Light.xml + start_offset: 0x9B0 + end_offset: 0x1DD0 +- name: overlays/ovl_Bg_Ganon_Otyuka + xml_path: assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml + start_offset: 0x1100 + end_offset: 0x24DC +- name: overlays/ovl_Bg_Jya_Cobra + xml_path: assets/xml/overlays/ovl_Bg_Jya_Cobra.xml + start_offset: 0x1850 + end_offset: 0x18C8 +- name: overlays/ovl_Boss_Dodongo + xml_path: assets/xml/overlays/ovl_Boss_Dodongo.xml + start_offset: 0x61E8 + end_offset: 0x91E8 +- name: overlays/ovl_Boss_Ganon + xml_path: assets/xml/overlays/ovl_Boss_Ganon.xml + start_offset: 0xE3C8 + end_offset: 0x20EE8 +- name: overlays/ovl_Boss_Ganon2 + xml_path: assets/xml/overlays/ovl_Boss_Ganon2.xml + start_offset: 0x9F88 + end_offset: 0x10438 +- name: overlays/ovl_Boss_Sst + xml_path: assets/xml/overlays/ovl_Boss_Sst.xml + start_offset: 0xA380 + end_offset: 0xAD30 +- name: overlays/ovl_Demo_Shd + xml_path: assets/xml/overlays/ovl_Demo_Shd.xml + start_offset: 0x410 + end_offset: 0x2390 +- name: overlays/ovl_Effect_Ss_Fhg_Flash + xml_path: assets/xml/overlays/ovl_Effect_Ss_Fhg_Flash.xml + start_offset: 0x9F0 + end_offset: 0xEA8 +- name: overlays/ovl_En_Bili + xml_path: assets/xml/overlays/ovl_En_Bili.xml + start_offset: 0x1E40 + end_offset: 0x1E60 +- name: overlays/ovl_En_Clear_Tag + xml_path: assets/xml/overlays/ovl_En_Clear_Tag.xml + start_offset: 0x2600 + end_offset: 0x8900 +- name: overlays/ovl_En_Ganon_Mant + xml_path: assets/xml/overlays/ovl_En_Ganon_Mant.xml + start_offset: 0x11F8 + end_offset: 0x40F8 +- name: overlays/ovl_En_Ganon_Organ + xml_path: assets/xml/overlays/ovl_En_Ganon_Organ.xml + start_offset: 0x368 + end_offset: 0x6EF0 +- name: overlays/ovl_En_Holl + xml_path: assets/xml/overlays/ovl_En_Holl.xml + start_offset: 0xE68 + end_offset: 0xED0 +- name: overlays/ovl_En_Jsjutan + xml_path: assets/xml/overlays/ovl_En_Jsjutan.xml + start_offset: 0x12C8 + end_offset: 0x4C60 +- name: overlays/ovl_En_Kanban + xml_path: assets/xml/overlays/ovl_En_Kanban.xml + start_offset: 0x2E70 + end_offset: 0x2F30 +- name: overlays/ovl_En_Sda + xml_path: assets/xml/overlays/ovl_En_Sda.xml + start_offset: 0x1498 + end_offset: 0x1528 +- name: overlays/ovl_En_Ssh + xml_path: assets/xml/overlays/ovl_En_Ssh.xml + start_offset: 0x2150 + end_offset: 0x21E0 +- name: overlays/ovl_En_St + xml_path: assets/xml/overlays/ovl_En_St.xml + start_offset: 0x26A0 + end_offset: 0x2730 +- name: overlays/ovl_En_Sth + xml_path: assets/xml/overlays/ovl_En_Sth.xml + start_offset: 0xE70 + end_offset: 0x3E44 +- name: overlays/ovl_End_Title + xml_path: assets/xml/overlays/ovl_End_Title.xml + start_offset: 0x6E0 + end_offset: 0x4088 +- name: overlays/ovl_file_choose + xml_path: assets/xml/overlays/ovl_file_choose.xml + start_offset: 0xEC40 + end_offset: 0xF320 +- name: overlays/ovl_Magic_Dark + xml_path: assets/xml/overlays/ovl_Magic_Dark.xml + start_offset: 0xC90 + end_offset: 0x16C0 +- name: overlays/ovl_Magic_Fire + xml_path: assets/xml/overlays/ovl_Magic_Fire.xml + start_offset: 0xB50 + end_offset: 0x21A0 +- name: overlays/ovl_Magic_Wind + xml_path: assets/xml/overlays/ovl_Magic_Wind.xml + start_offset: 0x6A0 + end_offset: 0x1BB8 +- name: overlays/ovl_Oceff_Spot + xml_path: assets/xml/overlays/ovl_Oceff_Spot.xml + start_offset: 0x780 + end_offset: 0xE58 +- name: overlays/ovl_Oceff_Storm + xml_path: assets/xml/overlays/ovl_Oceff_Storm.xml + start_offset: 0x750 + end_offset: 0x1AE0 +- name: overlays/ovl_Oceff_Wipe + xml_path: assets/xml/overlays/ovl_Oceff_Wipe.xml + start_offset: 0x520 + end_offset: 0xCE0 +- name: overlays/ovl_Oceff_Wipe2 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe2.xml + start_offset: 0x430 + end_offset: 0x1698 +- name: overlays/ovl_Oceff_Wipe3 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe3.xml + start_offset: 0x430 + end_offset: 0x1678 +- name: overlays/ovl_Oceff_Wipe4 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe4.xml + start_offset: 0x410 + end_offset: 0xEF8 +- name: scenes/dungeons/bdan + xml_path: assets/xml/scenes/dungeons/bdan_mq.xml +- name: scenes/dungeons/bdan_boss + xml_path: assets/xml/scenes/dungeons/bdan_boss.xml +- name: scenes/dungeons/Bmori1 + xml_path: assets/xml/scenes/dungeons/Bmori1_mq.xml +- name: scenes/dungeons/ddan + xml_path: assets/xml/scenes/dungeons/ddan_mq.xml +- name: scenes/dungeons/ddan_boss + xml_path: assets/xml/scenes/dungeons/ddan_boss_v2.xml +- name: scenes/dungeons/FIRE_bs + xml_path: assets/xml/scenes/dungeons/FIRE_bs.xml +- name: scenes/dungeons/ganon + xml_path: assets/xml/scenes/dungeons/ganon.xml +- name: scenes/dungeons/ganon_boss + xml_path: assets/xml/scenes/dungeons/ganon_boss.xml +- name: scenes/dungeons/ganon_demo + xml_path: assets/xml/scenes/dungeons/ganon_demo.xml +- name: scenes/dungeons/ganon_final + xml_path: assets/xml/scenes/dungeons/ganon_final.xml +- name: scenes/dungeons/ganon_sonogo + xml_path: assets/xml/scenes/dungeons/ganon_sonogo.xml +- name: scenes/dungeons/ganontika + xml_path: assets/xml/scenes/dungeons/ganontika_mq.xml +- name: scenes/dungeons/ganontikasonogo + xml_path: assets/xml/scenes/dungeons/ganontikasonogo.xml +- name: scenes/dungeons/gerudoway + xml_path: assets/xml/scenes/dungeons/gerudoway.xml +- name: scenes/dungeons/HAKAdan + xml_path: assets/xml/scenes/dungeons/HAKAdan_mq.xml +- name: scenes/dungeons/HAKAdan_bs + xml_path: assets/xml/scenes/dungeons/HAKAdan_bs.xml +- name: scenes/dungeons/HAKAdanCH + xml_path: assets/xml/scenes/dungeons/HAKAdanCH_mq.xml +- name: scenes/dungeons/HIDAN + xml_path: assets/xml/scenes/dungeons/HIDAN_mq.xml +- name: scenes/dungeons/ice_doukutu + xml_path: assets/xml/scenes/dungeons/ice_doukutu_mq.xml +- name: scenes/dungeons/jyasinboss + xml_path: assets/xml/scenes/dungeons/jyasinboss.xml +- name: scenes/dungeons/jyasinzou + xml_path: assets/xml/scenes/dungeons/jyasinzou_mq.xml +- name: scenes/dungeons/men + xml_path: assets/xml/scenes/dungeons/men_mq.xml +- name: scenes/dungeons/MIZUsin + xml_path: assets/xml/scenes/dungeons/MIZUsin_mq.xml +- name: scenes/dungeons/MIZUsin_bs + xml_path: assets/xml/scenes/dungeons/MIZUsin_bs.xml +- name: scenes/dungeons/moribossroom + xml_path: assets/xml/scenes/dungeons/moribossroom.xml +- name: scenes/dungeons/ydan + xml_path: assets/xml/scenes/dungeons/ydan_mq.xml +- name: scenes/dungeons/ydan_boss + xml_path: assets/xml/scenes/dungeons/ydan_boss.xml +- name: scenes/indoors/bowling + xml_path: assets/xml/scenes/indoors/bowling.xml +- name: scenes/indoors/daiyousei_izumi + xml_path: assets/xml/scenes/indoors/daiyousei_izumi.xml +- name: scenes/indoors/hairal_niwa + xml_path: assets/xml/scenes/indoors/hairal_niwa.xml +- name: scenes/indoors/hairal_niwa_n + xml_path: assets/xml/scenes/indoors/hairal_niwa_n.xml +- name: scenes/indoors/hakasitarelay + xml_path: assets/xml/scenes/indoors/hakasitarelay.xml +- name: scenes/indoors/hut + xml_path: assets/xml/scenes/indoors/hut.xml +- name: scenes/indoors/hylia_labo + xml_path: assets/xml/scenes/indoors/hylia_labo.xml +- name: scenes/indoors/impa + xml_path: assets/xml/scenes/indoors/impa.xml +- name: scenes/indoors/kakariko + xml_path: assets/xml/scenes/indoors/kakariko.xml +- name: scenes/indoors/kenjyanoma + xml_path: assets/xml/scenes/indoors/kenjyanoma.xml +- name: scenes/indoors/kokiri_home + xml_path: assets/xml/scenes/indoors/kokiri_home.xml +- name: scenes/indoors/kokiri_home3 + xml_path: assets/xml/scenes/indoors/kokiri_home3.xml +- name: scenes/indoors/kokiri_home4 + xml_path: assets/xml/scenes/indoors/kokiri_home4.xml +- name: scenes/indoors/kokiri_home5 + xml_path: assets/xml/scenes/indoors/kokiri_home5.xml +- name: scenes/indoors/labo + xml_path: assets/xml/scenes/indoors/labo.xml +- name: scenes/indoors/link_home + xml_path: assets/xml/scenes/indoors/link_home.xml +- name: scenes/indoors/mahouya + xml_path: assets/xml/scenes/indoors/mahouya.xml +- name: scenes/indoors/malon_stable + xml_path: assets/xml/scenes/indoors/malon_stable.xml +- name: scenes/indoors/miharigoya + xml_path: assets/xml/scenes/indoors/miharigoya.xml +- name: scenes/indoors/nakaniwa + xml_path: assets/xml/scenes/indoors/nakaniwa.xml +- name: scenes/indoors/souko + xml_path: assets/xml/scenes/indoors/souko.xml +- name: scenes/indoors/syatekijyou + xml_path: assets/xml/scenes/indoors/syatekijyou.xml +- name: scenes/indoors/takaraya + xml_path: assets/xml/scenes/indoors/takaraya.xml +- name: scenes/indoors/tent + xml_path: assets/xml/scenes/indoors/tent.xml +- name: scenes/indoors/tokinoma + xml_path: assets/xml/scenes/indoors/tokinoma.xml +- name: scenes/indoors/yousei_izumi_tate + xml_path: assets/xml/scenes/indoors/yousei_izumi_tate.xml +- name: scenes/indoors/yousei_izumi_yoko + xml_path: assets/xml/scenes/indoors/yousei_izumi_yoko.xml +- name: scenes/misc/enrui + xml_path: assets/xml/scenes/misc/enrui.xml +- name: scenes/misc/entra + xml_path: assets/xml/scenes/misc/entra.xml +- name: scenes/misc/entra_n + xml_path: assets/xml/scenes/misc/entra_n.xml +- name: scenes/misc/hakaana + xml_path: assets/xml/scenes/misc/hakaana.xml +- name: scenes/misc/hakaana2 + xml_path: assets/xml/scenes/misc/hakaana2.xml +- name: scenes/misc/hakaana_ouke + xml_path: assets/xml/scenes/misc/hakaana_ouke.xml +- name: scenes/misc/hiral_demo + xml_path: assets/xml/scenes/misc/hiral_demo.xml +- name: scenes/misc/kakariko3 + xml_path: assets/xml/scenes/misc/kakariko3.xml +- name: scenes/misc/kakusiana + xml_path: assets/xml/scenes/misc/kakusiana.xml +- name: scenes/misc/kinsuta + xml_path: assets/xml/scenes/misc/kinsuta.xml +- name: scenes/misc/market_alley + xml_path: assets/xml/scenes/misc/market_alley.xml +- name: scenes/misc/market_alley_n + xml_path: assets/xml/scenes/misc/market_alley_n.xml +- name: scenes/misc/market_day + xml_path: assets/xml/scenes/misc/market_day.xml +- name: scenes/misc/market_night + xml_path: assets/xml/scenes/misc/market_night.xml +- name: scenes/misc/market_ruins + xml_path: assets/xml/scenes/misc/market_ruins.xml +- name: scenes/misc/shrine + xml_path: assets/xml/scenes/misc/shrine.xml +- name: scenes/misc/shrine_n + xml_path: assets/xml/scenes/misc/shrine_n.xml +- name: scenes/misc/shrine_r + xml_path: assets/xml/scenes/misc/shrine_r.xml +- name: scenes/misc/turibori + xml_path: assets/xml/scenes/misc/turibori.xml +- name: scenes/overworld/ganon_tou + xml_path: assets/xml/scenes/overworld/ganon_tou.xml +- name: scenes/overworld/spot00 + xml_path: assets/xml/scenes/overworld/spot00.xml +- name: scenes/overworld/spot01 + xml_path: assets/xml/scenes/overworld/spot01.xml +- name: scenes/overworld/spot02 + xml_path: assets/xml/scenes/overworld/spot02.xml +- name: scenes/overworld/spot03 + xml_path: assets/xml/scenes/overworld/spot03.xml +- name: scenes/overworld/spot04 + xml_path: assets/xml/scenes/overworld/spot04.xml +- name: scenes/overworld/spot05 + xml_path: assets/xml/scenes/overworld/spot05.xml +- name: scenes/overworld/spot06 + xml_path: assets/xml/scenes/overworld/spot06.xml +- name: scenes/overworld/spot07 + xml_path: assets/xml/scenes/overworld/spot07.xml +- name: scenes/overworld/spot08 + xml_path: assets/xml/scenes/overworld/spot08.xml +- name: scenes/overworld/spot09 + xml_path: assets/xml/scenes/overworld/spot09.xml +- name: scenes/overworld/spot10 + xml_path: assets/xml/scenes/overworld/spot10.xml +- name: scenes/overworld/spot11 + xml_path: assets/xml/scenes/overworld/spot11.xml +- name: scenes/overworld/spot12 + xml_path: assets/xml/scenes/overworld/spot12.xml +- name: scenes/overworld/spot13 + xml_path: assets/xml/scenes/overworld/spot13.xml +- name: scenes/overworld/spot15 + xml_path: assets/xml/scenes/overworld/spot15.xml +- name: scenes/overworld/spot16 + xml_path: assets/xml/scenes/overworld/spot16_v2.xml +- name: scenes/overworld/spot17 + xml_path: assets/xml/scenes/overworld/spot17.xml +- name: scenes/overworld/spot18 + xml_path: assets/xml/scenes/overworld/spot18.xml +- name: scenes/overworld/spot20 + xml_path: assets/xml/scenes/overworld/spot20.xml +- name: scenes/shops/alley_shop + xml_path: assets/xml/scenes/shops/alley_shop.xml +- name: scenes/shops/drag + xml_path: assets/xml/scenes/shops/drag.xml +- name: scenes/shops/face_shop + xml_path: assets/xml/scenes/shops/face_shop.xml +- name: scenes/shops/golon + xml_path: assets/xml/scenes/shops/golon.xml +- name: scenes/shops/kokiri_shop + xml_path: assets/xml/scenes/shops/kokiri_shop.xml +- name: scenes/shops/night_shop + xml_path: assets/xml/scenes/shops/night_shop.xml +- name: scenes/shops/shop1 + xml_path: assets/xml/scenes/shops/shop1.xml +- name: scenes/shops/zoora + xml_path: assets/xml/scenes/shops/zoora.xml +- name: textures/backgrounds + xml_path: assets/xml/textures/backgrounds.xml +- name: textures/do_action_static + xml_path: assets/xml/textures/do_action_static.xml +- name: textures/icon_item_24_static + xml_path: assets/xml/textures/icon_item_24_static.xml +- name: textures/icon_item_dungeon_static + xml_path: assets/xml/textures/icon_item_dungeon_static.xml +- name: textures/icon_item_field_static + xml_path: assets/xml/textures/icon_item_field_static.xml +- name: textures/icon_item_gameover_static + xml_path: assets/xml/textures/icon_item_gameover_static.xml +- name: textures/icon_item_jpn_static + xml_path: assets/xml/textures/icon_item_jpn_static.xml +- name: textures/icon_item_nes_static + xml_path: assets/xml/textures/icon_item_nes_static.xml +- name: textures/icon_item_static + xml_path: assets/xml/textures/icon_item_static.xml +- name: textures/item_name_static + xml_path: assets/xml/textures/item_name_static.xml +- name: textures/kanji + xml_path: assets/xml/textures/kanji.xml +- name: textures/map_48x85_static + xml_path: assets/xml/textures/map_48x85_static.xml +- name: textures/map_grand_static + xml_path: assets/xml/textures/map_grand_static.xml +- name: textures/map_i_static + xml_path: assets/xml/textures/map_i_static.xml +- name: textures/map_name_static + xml_path: assets/xml/textures/map_name_static.xml +- name: textures/message_static + xml_path: assets/xml/textures/message_static.xml +- name: textures/message_texture_static + xml_path: assets/xml/textures/message_texture_static.xml +- name: textures/nes_font_static + xml_path: assets/xml/textures/nes_font_static.xml +- name: textures/nintendo_rogo_static + xml_path: assets/xml/textures/nintendo_rogo_static_v2.xml +- name: textures/parameter_static + xml_path: assets/xml/textures/parameter_static.xml +- name: textures/place_title_cards + xml_path: assets/xml/textures/place_title_cards.xml +- name: textures/skyboxes + xml_path: assets/xml/textures/skyboxes.xml +- name: textures/title_static + xml_path: assets/xml/textures/title_static.xml diff --git a/baseroms/gc-jp-mq/segments.csv b/baseroms/gc-jp-mq/segments.csv new file mode 100644 index 0000000000..bb61147317 --- /dev/null +++ b/baseroms/gc-jp-mq/segments.csv @@ -0,0 +1,1510 @@ +Name,VRAM start +makerom,80000000 +boot,80000460 +dmadata, +Audiobank, +Audioseq, +Audiotable, +kanji, +link_animetion, +icon_item_static, +icon_item_24_static, +icon_item_field_static, +icon_item_dungeon_static, +icon_item_gameover_static, +icon_item_jpn_static, +icon_item_nes_static, +item_name_static, +map_name_static, +do_action_static, +message_static, +message_texture_static, +nes_font_static, +jpn_message_data_static, +nes_message_data_static, +staff_message_data_static, +map_grand_static, +map_48x85_static, +map_i_static, +code,80010EE0 +ovl_title,80800000 +ovl_select,80800870 +ovl_opening,808034F0 +ovl_file_choose,80803650 +ovl_kaleido_scope,808135D0 +ovl_player_actor,8082FDC0 +ovl_map_mark_data,808565A0 +ovl_En_Test,8085D080 +ovl_Arms_Hook,80862930 +ovl_Arrow_Fire,808636A0 +ovl_Arrow_Ice,80865580 +ovl_Arrow_Light,80867480 +ovl_Bg_Bdan_Objects,80869390 +ovl_Bg_Bdan_Switch,8086A660 +ovl_Bg_Bom_Guard,8086BA90 +ovl_Bg_Bombwall,8086BCB0 +ovl_Bg_Bowl_Wall,8086C570 +ovl_Bg_Breakwall,8086CEF0 +ovl_Bg_Ddan_Jd,8086DD60 +ovl_Bg_Ddan_Kd,8086E3B0 +ovl_Bg_Dodoago,8086ECA0 +ovl_Bg_Dy_Yoseizo,8086FA50 +ovl_Bg_Ganon_Otyuka,80872840 +ovl_Bg_Gate_Shutter,80874E80 +ovl_Bg_Gjyo_Bridge,80875310 +ovl_Bg_Gnd_Darkmeiro,80875800 +ovl_Bg_Gnd_Firemeiro,80875FC0 +ovl_Bg_Gnd_Iceblock,80876510 +ovl_Bg_Gnd_Nisekabe,80877610 +ovl_Bg_Gnd_Soulmeiro,80877780 +ovl_Bg_Haka,80877FE0 +ovl_Bg_Haka_Gate,808786A0 +ovl_Bg_Haka_Huta,80879740 +ovl_Bg_Haka_Megane,8087A1E0 +ovl_Bg_Haka_MeganeBG,8087A5E0 +ovl_Bg_Haka_Sgami,8087ACA0 +ovl_Bg_Haka_Ship,8087B8C0 +ovl_Bg_Haka_Trap,8087C310 +ovl_Bg_Haka_Tubo,8087D8E0 +ovl_Bg_Haka_Water,8087E300 +ovl_Bg_Haka_Zou,8087EB00 +ovl_Bg_Heavy_Block,8087FCF0 +ovl_Bg_Hidan_Curtain,808815E0 +ovl_Bg_Hidan_Dalm,80882080 +ovl_Bg_Hidan_Firewall,808828D0 +ovl_Bg_Hidan_Fslift,80883030 +ovl_Bg_Hidan_Fwbig,80883500 +ovl_Bg_Hidan_Hamstep,808841E0 +ovl_Bg_Hidan_Hrock,80885090 +ovl_Bg_Hidan_Kousi,808858C0 +ovl_Bg_Hidan_Kowarerukabe,80885E50 +ovl_Bg_Hidan_Rock,80886D30 +ovl_Bg_Hidan_Rsekizou,80887E30 +ovl_Bg_Hidan_Sekizou,80888A10 +ovl_Bg_Hidan_Sima,80889E60 +ovl_Bg_Hidan_Syoku,8088AD60 +ovl_Bg_Ice_Objects,8088B1C0 +ovl_Bg_Ice_Shelter,8088C100 +ovl_Bg_Ice_Shutter,8088D340 +ovl_Bg_Ice_Turara,8088D7B0 +ovl_Bg_Ingate,8088DFE0 +ovl_Bg_Jya_1flift,8088E370 +ovl_Bg_Jya_Amishutter,8088EA00 +ovl_Bg_Jya_Bigmirror,8088ED90 +ovl_Bg_Jya_Block,8088F5E0 +ovl_Bg_Jya_Bombchuiwa,8088F850 +ovl_Bg_Jya_Bombiwa,80890390 +ovl_Bg_Jya_Cobra,80890950 +ovl_Bg_Jya_Goroiwa,80892690 +ovl_Bg_Jya_Haheniron,80892E10 +ovl_Bg_Jya_Ironobj,80893600 +ovl_Bg_Jya_Kanaami,808943B0 +ovl_Bg_Jya_Lift,80894760 +ovl_Bg_Jya_Megami,80894CB0 +ovl_Bg_Jya_Zurerukabe,80895EA0 +ovl_Bg_Menkuri_Eye,80896550 +ovl_Bg_Menkuri_Kaiten,808969F0 +ovl_Bg_Menkuri_Nisekabe,80896B80 +ovl_Bg_Mizu_Bwall,80896CD0 +ovl_Bg_Mizu_Movebg,808981A0 +ovl_Bg_Mizu_Shutter,80899330 +ovl_Bg_Mizu_Uzu,80899B30 +ovl_Bg_Mizu_Water,80899D00 +ovl_Bg_Mjin,8089A9D0 +ovl_Bg_Mori_Bigst,8089ADC0 +ovl_Bg_Mori_Elevator,8089B6F0 +ovl_Bg_Mori_Hashigo,8089C1E0 +ovl_Bg_Mori_Hashira4,8089CAA0 +ovl_Bg_Mori_Hineri,8089D030 +ovl_Bg_Mori_Idomizu,8089DD80 +ovl_Bg_Mori_Kaitenkabe,8089E3C0 +ovl_Bg_Mori_Rakkatenjo,8089EA30 +ovl_Bg_Po_Event,8089F3B0 +ovl_Bg_Po_Syokudai,808A11F0 +ovl_Bg_Pushbox,808A1B60 +ovl_Bg_Relay_Objects,808A1E60 +ovl_Bg_Spot00_Break,808A2610 +ovl_Bg_Spot00_Hanebasi,808A27B0 +ovl_Bg_Spot01_Fusya,808A38C0 +ovl_Bg_Spot01_Idohashira,808A3B60 +ovl_Bg_Spot01_Idomizu,808A4760 +ovl_Bg_Spot01_Idosoko,808A4A80 +ovl_Bg_Spot01_Objects2,808A4C90 +ovl_Bg_Spot02_Objects,808A5150 +ovl_Bg_Spot03_Taki,808A64B0 +ovl_Bg_Spot05_Soko,808A6DD0 +ovl_Bg_Spot06_Objects,808A70F0 +ovl_Bg_Spot07_Taki,808A84F0 +ovl_Bg_Spot08_Bakudankabe,808A8AE0 +ovl_Bg_Spot08_Iceblock,808A9180 +ovl_Bg_Spot09_Obj,808AA1C0 +ovl_Bg_Spot11_Bakudankabe,808AA6E0 +ovl_Bg_Spot11_Oasis,808AAD20 +ovl_Bg_Spot12_Gate,808AB450 +ovl_Bg_Spot12_Saku,808AB860 +ovl_Bg_Spot15_Rrbox,808ABD20 +ovl_Bg_Spot15_Saku,808ACB00 +ovl_Bg_Spot16_Bombstone,808ACE40 +ovl_Bg_Spot16_Doughnut,808AE390 +ovl_Bg_Spot17_Bakudankabe,808AE950 +ovl_Bg_Spot17_Funen,808AF040 +ovl_Bg_Spot18_Basket,808AF290 +ovl_Bg_Spot18_Futa,808B0280 +ovl_Bg_Spot18_Obj,808B0420 +ovl_Bg_Spot18_Shutter,808B0CF0 +ovl_Bg_Sst_Floor,808B1240 +ovl_Bg_Toki_Hikari,808B17A0 +ovl_Bg_Toki_Swd,808B2540 +ovl_Bg_Treemouth,808B3B90 +ovl_Bg_Umajump,808B51F0 +ovl_Bg_Vb_Sima,808B5380 +ovl_Bg_Ydan_Hasi,808B5AA0 +ovl_Bg_Ydan_Maruta,808B6250 +ovl_Bg_Ydan_Sp,808B6930 +ovl_Bg_Zg,808B8050 +ovl_Boss_Dodongo,808B84A0 +ovl_Boss_Fd,808C1FA0 +ovl_Boss_Fd2,808C9300 +ovl_Boss_Ganon,808CD030 +ovl_Boss_Ganon2,808F2E60 +ovl_Boss_Ganondrof,80905CD0 +ovl_Boss_Goma,8090AA60 +ovl_Boss_Mo,80910A00 +ovl_Boss_Sst,80920FE0 +ovl_Boss_Tw,8092D5B0 +ovl_Boss_Va,80943180 +ovl_Demo_6K,8095A410 +ovl_Demo_Du,8095D170 +ovl_Demo_Ec,80960950 +ovl_Demo_Effect,809641B0 +ovl_Demo_Ext,80969D50 +ovl_Demo_Geff,8096A6A0 +ovl_Demo_Gj,8096AEC0 +ovl_Demo_Go,8096EB70 +ovl_Demo_Gt,8096F8C0 +ovl_Demo_Ik,80974ED0 +ovl_Demo_Im,809763E0 +ovl_Demo_Kankyo,8097A350 +ovl_Demo_Kekkai,8097E040 +ovl_Demo_Sa,8097F330 +ovl_Demo_Shd,80981E50 +ovl_Demo_Tre_Lgt,80984260 +ovl_Door_Ana,80984970 +ovl_Door_Gerudo,80984FE0 +ovl_Door_Killer,809855D0 +ovl_Door_Shutter,80986B40 +ovl_Door_Toki,80988E00 +ovl_Door_Warp1,80988F60 +ovl_Efc_Erupc,8098D270 +ovl_Eff_Dust,8098DD60 +ovl_Effect_Ss_Blast,8098F130 +ovl_Effect_Ss_Bomb,8098F4C0 +ovl_Effect_Ss_Bomb2,8098F8F0 +ovl_Effect_Ss_Bubble,809901F0 +ovl_Effect_Ss_D_Fire,80990670 +ovl_Effect_Ss_Dead_Db,80990B60 +ovl_Effect_Ss_Dead_Dd,80991040 +ovl_Effect_Ss_Dead_Ds,809915D0 +ovl_Effect_Ss_Dead_Sound,80991A50 +ovl_Effect_Ss_Dt_Bubble,80991B90 +ovl_Effect_Ss_Dust,80992120 +ovl_Effect_Ss_En_Fire,80992960 +ovl_Effect_Ss_En_Ice,809930B0 +ovl_Effect_Ss_Extra,80993970 +ovl_Effect_Ss_Fcircle,80993D30 +ovl_Effect_Ss_Fhg_Flash,809941E0 +ovl_Effect_Ss_Fire_Tail,80995160 +ovl_Effect_Ss_G_Fire,80995860 +ovl_Effect_Ss_G_Magma,80995AF0 +ovl_Effect_Ss_G_Magma2,80995D50 +ovl_Effect_Ss_G_Ripple,80996260 +ovl_Effect_Ss_G_Spk,809967C0 +ovl_Effect_Ss_G_Splash,80996D70 +ovl_Effect_Ss_Hahen,80997220 +ovl_Effect_Ss_HitMark,80997860 +ovl_Effect_Ss_Ice_Piece,80997DB0 +ovl_Effect_Ss_Ice_Smoke,809981F0 +ovl_Effect_Ss_K_Fire,809986D0 +ovl_Effect_Ss_Kakera,80998B10 +ovl_Effect_Ss_KiraKira,80999BA0 +ovl_Effect_Ss_Lightning,8099A210 +ovl_Effect_Ss_Sibuki,8099A8E0 +ovl_Effect_Ss_Sibuki2,8099AFB0 +ovl_Effect_Ss_Solder_Srch_Ball,8099B2E0 +ovl_Effect_Ss_Stick,8099B490 +ovl_Effect_Ss_Stone1,8099B830 +ovl_Elf_Msg,8099BBB0 +ovl_Elf_Msg2,8099C1A0 +ovl_En_Am,8099C610 +ovl_En_Ani,8099EA10 +ovl_En_Anubice,8099F780 +ovl_En_Anubice_Fire,809A0A30 +ovl_En_Anubice_Tag,809A17F0 +ovl_En_Arow_Trap,809A1AC0 +ovl_En_Arrow,809A1C10 +ovl_En_Attack_Niw,809A3310 +ovl_En_Ba,809A4570 +ovl_En_Bb,809A6440 +ovl_En_Bdfire,809AA120 +ovl_En_Bigokuta,809AACC0 +ovl_En_Bili,809AD7C0 +ovl_En_Bird,809AFA90 +ovl_En_Blkobj,809AFF50 +ovl_En_Bom,809B04B0 +ovl_En_Bom_Bowl_Man,809B1380 +ovl_En_Bom_Bowl_Pit,809B28C0 +ovl_En_Bom_Chu,809B3230 +ovl_En_Bombf,809B48D0 +ovl_En_Boom,809B5D60 +ovl_En_Box,809B6630 +ovl_En_Brob,809B8190 +ovl_En_Bubble,809B9280 +ovl_En_Butte,809BA6A0 +ovl_En_Bw,809BBC70 +ovl_En_Bx,809BF000 +ovl_En_Changer,809BFB00 +ovl_En_Clear_Tag,809C04E0 +ovl_En_Cow,809CBA80 +ovl_En_Crow,809CCEE0 +ovl_En_Cs,809CE580 +ovl_En_Daiku,809CF7B0 +ovl_En_Daiku_Kakariko,809D0EF0 +ovl_En_Dekubaba,809D22B0 +ovl_En_Dekunuts,809D5D60 +ovl_En_Dh,809D7560 +ovl_En_Dha,809D9040 +ovl_En_Diving_Game,809DA040 +ovl_En_Dns,809DB9F0 +ovl_En_Dnt_Demo,809DCD80 +ovl_En_Dnt_Jiji,809DDAA0 +ovl_En_Dnt_Nomal,809DEFC0 +ovl_En_Dodojr,809E1DC0 +ovl_En_Dodongo,809E3C60 +ovl_En_Dog,809E6A00 +ovl_En_Door,809E7BB0 +ovl_En_Ds,809E89F0 +ovl_En_Du,809E9610 +ovl_En_Dy_Extra,809EB0A0 +ovl_En_Eg,809EB640 +ovl_En_Eiyer,809EB7F0 +ovl_En_Elf,809ED450 +ovl_En_Encount1,809F1E10 +ovl_En_Encount2,809F2970 +ovl_En_Ex_Item,809F3BA0 +ovl_En_Ex_Ruppy,809F4D20 +ovl_En_Fd,809F5DE0 +ovl_En_Fd_Fire,809F8A80 +ovl_En_Fhg_Fire,809F9790 +ovl_En_Fire_Rock,809FBE30 +ovl_En_Firefly,809FCF40 +ovl_En_Fish,809FF0B0 +ovl_En_Floormas,80A011C0 +ovl_En_Fr,80A045A0 +ovl_En_Fu,80A07030 +ovl_En_Fw,80A07D80 +ovl_En_Fz,80A09540 +ovl_En_G_Switch,80A0B550 +ovl_En_Ganon_Mant,80A0CD70 +ovl_En_Ganon_Organ,80A10FA0 +ovl_En_Gb,80A17FE0 +ovl_En_Ge1,80A19710 +ovl_En_Ge2,80A1B740 +ovl_En_Ge3,80A1D0E0 +ovl_En_GeldB,80A1DD20 +ovl_En_GirlA,80A230D0 +ovl_En_Gm,80A259F0 +ovl_En_Go,80A26720 +ovl_En_Go2,80A2AD60 +ovl_En_Goma,80A30DA0 +ovl_En_Goroiwa,80A33A50 +ovl_En_Gs,80A35E10 +ovl_En_Guest,80A37C80 +ovl_En_Hata,80A38620 +ovl_En_Heishi1,80A38BB0 +ovl_En_Heishi2,80A3A0C0 +ovl_En_Heishi3,80A3C2C0 +ovl_En_Heishi4,80A3CC90 +ovl_En_Hintnuts,80A3DB90 +ovl_En_Holl,80A3F5C0 +ovl_En_Honotrap,80A40590 +ovl_En_Horse,80A41AF0 +ovl_En_Horse_Game_Check,80A4DD50 +ovl_En_Horse_Ganon,80A4EE20 +ovl_En_Horse_Link_Child,80A4FBA0 +ovl_En_Horse_Normal,80A519A0 +ovl_En_Horse_Zelda,80A53FC0 +ovl_En_Hs,80A54AB0 +ovl_En_Hs2,80A55650 +ovl_En_Hy,80A55C30 +ovl_En_Ice_Hono,80A59570 +ovl_En_Ik,80A5A760 +ovl_En_In,80A5EDC0 +ovl_En_Insect,80A61B60 +ovl_En_Ishi,80A64080 +ovl_En_It,80A6D1D0 +ovl_En_Jj,80A6D360 +ovl_En_Js,80A6E930 +ovl_En_Jsjutan,80A6F300 +ovl_En_Kakasi,80A74C30 +ovl_En_Kakasi2,80A75970 +ovl_En_Kakasi3,80A76090 +ovl_En_Kanban,80A77170 +ovl_En_Karebaba,80A7A2C0 +ovl_En_Ko,80A7BBB0 +ovl_En_Kusa,80A7FCF0 +ovl_En_Kz,80A811D0 +ovl_En_Light,80A82770 +ovl_En_Lightbox,80A83570 +ovl_En_M_Fire1,80A839F0 +ovl_En_M_Thunder,80A83B90 +ovl_En_Ma1,80A85190 +ovl_En_Ma2,80A86470 +ovl_En_Ma3,80A874D0 +ovl_En_Mag,80A88480 +ovl_En_Mb,80A8D110 +ovl_En_Md,80A91340 +ovl_En_Mk,80A939B0 +ovl_En_Mm,80A94840 +ovl_En_Mm2,80A95EA0 +ovl_En_Ms,80A96C60 +ovl_En_Mu,80A97350 +ovl_En_Nb,80A97C70 +ovl_En_Niw,80A9C240 +ovl_En_Niw_Girl,80A9F570 +ovl_En_Niw_Lady,80AA0040 +ovl_En_Nutsball,80AA1940 +ovl_En_Nwc,80AA1F60 +ovl_En_Ny,80AA2980 +ovl_En_OE2,80AA42C0 +ovl_En_Okarina_Effect,80AA43A0 +ovl_En_Okarina_Tag,80AA4760 +ovl_En_Okuta,80AA5C60 +ovl_En_Ossan,80AA8240 +ovl_En_Owl,80AAE820 +ovl_En_Part,80AB23C0 +ovl_En_Peehat,80AB3A20 +ovl_En_Po_Desert,80AB7120 +ovl_En_Po_Field,80AB7EE0 +ovl_En_Po_Relay,80ABB970 +ovl_En_Po_Sisters,80ABD080 +ovl_En_Poh,80AC1D70 +ovl_En_Pu_box,80AC5F60 +ovl_En_Rd,80AC62A0 +ovl_En_Reeba,80AC8B60 +ovl_En_River_Sound,80ACA5D0 +ovl_En_Rl,80ACAF60 +ovl_En_Rr,80ACBE40 +ovl_En_Ru1,80ACE370 +ovl_En_Ru2,80AD5A10 +ovl_En_Sa,80AD8790 +ovl_En_Sb,80ADAA00 +ovl_En_Scene_Change,80ADBE40 +ovl_En_Sda,80ADBF70 +ovl_En_Shopnuts,80ADD660 +ovl_En_Si,80ADE570 +ovl_En_Siofuki,80ADEA70 +ovl_En_Skb,80ADF820 +ovl_En_Skj,80AE1110 +ovl_En_Skjneedle,80AE4A60 +ovl_En_Ssh,80AE4D70 +ovl_En_St,80AE7360 +ovl_En_Sth,80AE9FD0 +ovl_En_Stream,80AEE090 +ovl_En_Sw,80AEE620 +ovl_En_Syateki_Itm,80AF1E10 +ovl_En_Syateki_Man,80AF2BB0 +ovl_En_Syateki_Niw,80AF3970 +ovl_En_Ta,80AF5A00 +ovl_En_Takara_Man,80AF93C0 +ovl_En_Tana,80AF9C80 +ovl_En_Tg,80AF9F30 +ovl_En_Tite,80AFA610 +ovl_En_Tk,80AFD3B0 +ovl_En_Torch,80AFF1E0 +ovl_En_Torch2,80AFF2D0 +ovl_En_Toryo,80B01A70 +ovl_En_Tp,80B02700 +ovl_En_Tr,80B04570 +ovl_En_Trap,80B05E70 +ovl_En_Tubo_Trap,80B07110 +ovl_En_Vali,80B07DB0 +ovl_En_Vase,80B0A470 +ovl_En_Vb_Ball,80B0A570 +ovl_En_Viewer,80B0B720 +ovl_En_Vm,80B0E5E0 +ovl_En_Wall_Tubo,80B0FEA0 +ovl_En_Wallmas,80B10390 +ovl_En_Weather_Tag,80B11DA0 +ovl_En_Weiyer,80B12C90 +ovl_En_Wf,80B14690 +ovl_En_Wonder_Item,80B189A0 +ovl_En_Wonder_Talk,80B196D0 +ovl_En_Wonder_Talk2,80B19D60 +ovl_En_Wood02,80B1A400 +ovl_En_Xc,80B1B5E0 +ovl_En_Yabusame_Mark,80B21D70 +ovl_En_Yukabyun,80B22440 +ovl_En_Zf,80B22A50 +ovl_En_Zl1,80B29540 +ovl_En_Zl2,80B2D350 +ovl_En_Zl3,80B31A50 +ovl_En_Zl4,80B398A0 +ovl_En_Zo,80B3E2D0 +ovl_En_fHG,80B40890 +ovl_End_Title,80B431C0 +ovl_Fishing,80B472E0 +ovl_Item_B_Heart,80B61E80 +ovl_Item_Etcetera,80B62290 +ovl_Item_Inbox,80B62B60 +ovl_Item_Ocarina,80B62CC0 +ovl_Item_Shield,80B63490 +ovl_Magic_Dark,80B63EA0 +ovl_Magic_Fire,80B656F0 +ovl_Magic_Wind,80B679F0 +ovl_Mir_Ray,80B696F0 +ovl_Obj_Bean,80B6AFA0 +ovl_Obj_Blockstop,80B6D730 +ovl_Obj_Bombiwa,80B6D8D0 +ovl_Obj_Comb,80B6DE40 +ovl_Obj_Dekujr,80B6E6A0 +ovl_Obj_Elevator,80B6ECE0 +ovl_Obj_Hamishi,80B6F0A0 +ovl_Obj_Hana,80B6F8F0 +ovl_Obj_Hsblock,80B6FC00 +ovl_Obj_Ice_Poly,80B701D0 +ovl_Obj_Kibako,80B70B80 +ovl_Obj_Kibako2,80B71880 +ovl_Obj_Lift,80B71F40 +ovl_Obj_Lightswitch,80B72960 +ovl_Obj_Makekinsuta,80B73D90 +ovl_Obj_Makeoshihiki,80B73EE0 +ovl_Obj_Mure,80B74370 +ovl_Obj_Mure2,80B75380 +ovl_Obj_Mure3,80B75DA0 +ovl_Obj_Oshihiki,80B76570 +ovl_Obj_Roomtimer,80B78020 +ovl_Obj_Switch,80B78270 +ovl_Obj_Syokudai,80B7A050 +ovl_Obj_Timeblock,80B7ACA0 +ovl_Obj_Tsubo,80B7B8F0 +ovl_Obj_Warp2block,80B7C8E0 +ovl_Object_Kankyo,80B7D410 +ovl_Oceff_Spot,80B80690 +ovl_Oceff_Storm,80B815C0 +ovl_Oceff_Wipe,80B83170 +ovl_Oceff_Wipe2,80B83EF0 +ovl_Oceff_Wipe3,80B85660 +ovl_Oceff_Wipe4,80B86DB0 +ovl_Shot_Sun,80B87D90 +gameplay_keep, +gameplay_field_keep, +gameplay_dangeon_keep, +gameplay_object_exchange_static, +object_link_boy, +object_link_child, +object_box, +object_human, +object_okuta, +object_poh, +object_wallmaster, +object_dy_obj, +object_firefly, +object_dodongo, +object_fire, +object_niw, +object_tite, +object_reeba, +object_peehat, +object_kingdodongo, +object_horse, +object_zf, +object_goma, +object_zl1, +object_gol, +object_bubble, +object_dodojr, +object_torch2, +object_bl, +object_tp, +object_oA1, +object_st, +object_bw, +object_ei, +object_horse_normal, +object_oB1, +object_o_anime, +object_spot04_objects, +object_ddan_objects, +object_hidan_objects, +object_horse_ganon, +object_oA2, +object_spot00_objects, +object_mb, +object_bombf, +object_sk2, +object_oE1, +object_oE_anime, +object_oE2, +object_ydan_objects, +object_gnd, +object_am, +object_dekubaba, +object_oA3, +object_oA4, +object_oA5, +object_oA6, +object_oA7, +object_jj, +object_oA8, +object_oA9, +object_oB2, +object_oB3, +object_oB4, +object_horse_zelda, +object_opening_demo1, +object_warp1, +object_b_heart, +object_dekunuts, +object_oE3, +object_oE4, +object_menkuri_objects, +object_oE5, +object_oE6, +object_oE7, +object_oE8, +object_oE9, +object_oE10, +object_oE11, +object_oE12, +object_vali, +object_oA10, +object_oA11, +object_mizu_objects, +object_fhg, +object_ossan, +object_mori_hineri1, +object_Bb, +object_toki_objects, +object_yukabyun, +object_zl2, +object_mjin, +object_mjin_flash, +object_mjin_dark, +object_mjin_flame, +object_mjin_ice, +object_mjin_soul, +object_mjin_wind, +object_mjin_oka, +object_haka_objects, +object_spot06_objects, +object_ice_objects, +object_relay_objects, +object_mori_hineri1a, +object_mori_hineri2, +object_mori_hineri2a, +object_mori_objects, +object_mori_tex, +object_spot08_obj, +object_warp2, +object_hata, +object_bird, +object_wood02, +object_lightbox, +object_pu_box, +object_trap, +object_vase, +object_im, +object_ta, +object_tk, +object_xc, +object_vm, +object_bv, +object_hakach_objects, +object_efc_crystal_light, +object_efc_fire_ball, +object_efc_flash, +object_efc_lgt_shower, +object_efc_star_field, +object_god_lgt, +object_light_ring, +object_triforce_spot, +object_medal, +object_bdan_objects, +object_sd, +object_rd, +object_po_sisters, +object_heavy_object, +object_gndd, +object_fd, +object_du, +object_fw, +object_horse_link_child, +object_spot02_objects, +object_haka, +object_ru1, +object_syokudai, +object_fd2, +object_dh, +object_rl, +object_efc_tw, +object_demo_tre_lgt, +object_gi_key, +object_mir_ray, +object_brob, +object_gi_jewel, +object_spot09_obj, +object_spot18_obj, +object_bdoor, +object_spot17_obj, +object_shop_dungen, +object_nb, +object_mo, +object_sb, +object_gi_melody, +object_gi_heart, +object_gi_compass, +object_gi_bosskey, +object_gi_medal, +object_gi_nuts, +object_sa, +object_gi_hearts, +object_gi_arrowcase, +object_gi_bombpouch, +object_in, +object_tr, +object_spot16_obj, +object_oE1s, +object_oE4s, +object_os_anime, +object_gi_bottle, +object_gi_stick, +object_gi_map, +object_oF1d_map, +object_ru2, +object_gi_shield_1, +object_dekujr, +object_gi_magicpot, +object_gi_bomb_1, +object_oF1s, +object_ma2, +object_gi_purse, +object_hni, +object_tw, +object_rr, +object_bxa, +object_anubice, +object_gi_gerudo, +object_gi_arrow, +object_gi_bomb_2, +object_gi_egg, +object_gi_scale, +object_gi_shield_2, +object_gi_hookshot, +object_gi_ocarina, +object_gi_milk, +object_ma1, +object_ganon, +object_sst, +object_ny, +object_fr, +object_gi_pachinko, +object_gi_boomerang, +object_gi_bow, +object_gi_glasses, +object_gi_liquid, +object_ani, +object_demo_6k, +object_gi_shield_3, +object_gi_letter, +object_spot15_obj, +object_jya_obj, +object_gi_clothes, +object_gi_bean, +object_gi_fish, +object_gi_saw, +object_gi_hammer, +object_gi_grass, +object_gi_longsword, +object_spot01_objects, +object_md, +object_km1, +object_kw1, +object_zo, +object_kz, +object_umajump, +object_masterkokiri, +object_masterkokirihead, +object_mastergolon, +object_masterzoora, +object_aob, +object_ik, +object_ahg, +object_cne, +object_gi_niwatori, +object_skj, +object_gi_bottle_letter, +object_bji, +object_bba, +object_gi_ocarina_0, +object_ds, +object_ane, +object_boj, +object_spot03_object, +object_spot07_object, +object_fz, +object_bob, +object_ge1, +object_yabusame_point, +object_gi_boots_2, +object_gi_seed, +object_gnd_magic, +object_d_elevator, +object_d_hsblock, +object_d_lift, +object_mamenoki, +object_goroiwa, +object_toryo, +object_daiku, +object_nwc, +object_blkobj, +object_gm, +object_ms, +object_hs, +object_ingate, +object_lightswitch, +object_kusa, +object_tsubo, +object_gi_gloves, +object_gi_coin, +object_kanban, +object_gjyo_objects, +object_owl, +object_mk, +object_fu, +object_gi_ki_tan_mask, +object_gi_redead_mask, +object_gi_skj_mask, +object_gi_rabit_mask, +object_gi_truth_mask, +object_ganon_objects, +object_siofuki, +object_stream, +object_mm, +object_fa, +object_os, +object_gi_eye_lotion, +object_gi_powder, +object_gi_mushroom, +object_gi_ticketstone, +object_gi_brokensword, +object_js, +object_cs, +object_gi_prescription, +object_gi_bracelet, +object_gi_soldout, +object_gi_frog, +object_mag, +object_door_gerudo, +object_gt, +object_efc_erupc, +object_zl2_anime1, +object_zl2_anime2, +object_gi_golonmask, +object_gi_zoramask, +object_gi_gerudomask, +object_ganon2, +object_ka, +object_ts, +object_zg, +object_gi_hoverboots, +object_gi_m_arrow, +object_ds2, +object_ec, +object_fish, +object_gi_sutaru, +object_gi_goddess, +object_ssh, +object_bigokuta, +object_bg, +object_spot05_objects, +object_spot12_obj, +object_bombiwa, +object_hintnuts, +object_rs, +object_spot00_break, +object_gla, +object_shopnuts, +object_geldb, +object_gr, +object_dog, +object_jya_iron, +object_jya_door, +object_spot01_objects2, +object_spot11_obj, +object_kibako2, +object_dns, +object_dnk, +object_gi_fire, +object_gi_insect, +object_gi_butterfly, +object_gi_ghost, +object_gi_soul, +object_bowl, +object_po_field, +object_demo_kekkai, +object_efc_doughnut, +object_gi_dekupouch, +object_ganon_anime1, +object_ganon_anime2, +object_ganon_anime3, +object_gi_rupy, +object_spot01_matoya, +object_spot01_matoyab, +object_po_composer, +object_mu, +object_wf, +object_skb, +object_gj, +object_geff, +object_haka_door, +object_gs, +object_ps, +object_bwall, +object_crow, +object_cow, +object_cob, +object_gi_sword_1, +object_door_killer, +object_ouke_haka, +object_timeblock, +object_zl4, +g_pn_01, +g_pn_02, +g_pn_03, +g_pn_04, +g_pn_05, +g_pn_06, +g_pn_07, +g_pn_08, +g_pn_09, +g_pn_10, +g_pn_11, +g_pn_12, +g_pn_13, +g_pn_14, +g_pn_15, +g_pn_16, +g_pn_17, +g_pn_18, +g_pn_19, +g_pn_20, +g_pn_21, +g_pn_22, +g_pn_23, +g_pn_24, +g_pn_25, +g_pn_26, +g_pn_27, +g_pn_28, +g_pn_29, +g_pn_30, +g_pn_31, +g_pn_32, +g_pn_33, +g_pn_34, +g_pn_35, +g_pn_36, +g_pn_37, +g_pn_38, +g_pn_39, +g_pn_40, +g_pn_41, +g_pn_42, +g_pn_43, +g_pn_44, +g_pn_45, +g_pn_46, +g_pn_47, +g_pn_48, +g_pn_49, +g_pn_50, +g_pn_51, +g_pn_52, +g_pn_53, +g_pn_54, +g_pn_55, +g_pn_56, +g_pn_57, +z_select_static, +nintendo_rogo_static, +title_static, +parameter_static, +vr_fine0_static, +vr_fine0_pal_static, +vr_fine1_static, +vr_fine1_pal_static, +vr_fine2_static, +vr_fine2_pal_static, +vr_fine3_static, +vr_fine3_pal_static, +vr_cloud0_static, +vr_cloud0_pal_static, +vr_cloud1_static, +vr_cloud1_pal_static, +vr_cloud2_static, +vr_cloud2_pal_static, +vr_cloud3_static, +vr_cloud3_pal_static, +vr_holy0_static, +vr_holy0_pal_static, +vr_holy1_static, +vr_holy1_pal_static, +vr_MDVR_static, +vr_MDVR_pal_static, +vr_MNVR_static, +vr_MNVR_pal_static, +vr_RUVR_static, +vr_RUVR_pal_static, +vr_LHVR_static, +vr_LHVR_pal_static, +vr_KHVR_static, +vr_KHVR_pal_static, +vr_K3VR_static, +vr_K3VR_pal_static, +vr_K4VR_static, +vr_K4VR_pal_static, +vr_K5VR_static, +vr_K5VR_pal_static, +vr_SP1a_static, +vr_SP1a_pal_static, +vr_MLVR_static, +vr_MLVR_pal_static, +vr_KKRVR_static, +vr_KKRVR_pal_static, +vr_KR3VR_static, +vr_KR3VR_pal_static, +vr_IPVR_static, +vr_IPVR_pal_static, +vr_KSVR_static, +vr_KSVR_pal_static, +vr_GLVR_static, +vr_GLVR_pal_static, +vr_ZRVR_static, +vr_ZRVR_pal_static, +vr_DGVR_static, +vr_DGVR_pal_static, +vr_ALVR_static, +vr_ALVR_pal_static, +vr_NSVR_static, +vr_NSVR_pal_static, +vr_LBVR_static, +vr_LBVR_pal_static, +vr_TTVR_static, +vr_TTVR_pal_static, +vr_FCVR_static, +vr_FCVR_pal_static, +elf_message_field, +elf_message_ydan, +ydan_scene, +ydan_room_0, +ydan_room_1, +ydan_room_2, +ydan_room_3, +ydan_room_4, +ydan_room_5, +ydan_room_6, +ydan_room_7, +ydan_room_8, +ydan_room_9, +ydan_room_10, +ydan_room_11, +ddan_scene, +ddan_room_0, +ddan_room_1, +ddan_room_2, +ddan_room_3, +ddan_room_4, +ddan_room_5, +ddan_room_6, +ddan_room_7, +ddan_room_8, +ddan_room_9, +ddan_room_10, +ddan_room_11, +ddan_room_12, +ddan_room_13, +ddan_room_14, +ddan_room_15, +ddan_room_16, +bdan_scene, +bdan_room_0, +bdan_room_1, +bdan_room_2, +bdan_room_3, +bdan_room_4, +bdan_room_5, +bdan_room_6, +bdan_room_7, +bdan_room_8, +bdan_room_9, +bdan_room_10, +bdan_room_11, +bdan_room_12, +bdan_room_13, +bdan_room_14, +bdan_room_15, +Bmori1_scene, +Bmori1_room_0, +Bmori1_room_1, +Bmori1_room_2, +Bmori1_room_3, +Bmori1_room_4, +Bmori1_room_5, +Bmori1_room_6, +Bmori1_room_7, +Bmori1_room_8, +Bmori1_room_9, +Bmori1_room_10, +Bmori1_room_11, +Bmori1_room_12, +Bmori1_room_13, +Bmori1_room_14, +Bmori1_room_15, +Bmori1_room_16, +Bmori1_room_17, +Bmori1_room_18, +Bmori1_room_19, +Bmori1_room_20, +Bmori1_room_21, +Bmori1_room_22, +HIDAN_scene, +HIDAN_room_0, +HIDAN_room_1, +HIDAN_room_2, +HIDAN_room_3, +HIDAN_room_4, +HIDAN_room_5, +HIDAN_room_6, +HIDAN_room_7, +HIDAN_room_8, +HIDAN_room_9, +HIDAN_room_10, +HIDAN_room_11, +HIDAN_room_12, +HIDAN_room_13, +HIDAN_room_14, +HIDAN_room_15, +HIDAN_room_16, +HIDAN_room_17, +HIDAN_room_18, +HIDAN_room_19, +HIDAN_room_20, +HIDAN_room_21, +HIDAN_room_22, +HIDAN_room_23, +HIDAN_room_24, +HIDAN_room_25, +HIDAN_room_26, +MIZUsin_scene, +MIZUsin_room_0, +MIZUsin_room_1, +MIZUsin_room_2, +MIZUsin_room_3, +MIZUsin_room_4, +MIZUsin_room_5, +MIZUsin_room_6, +MIZUsin_room_7, +MIZUsin_room_8, +MIZUsin_room_9, +MIZUsin_room_10, +MIZUsin_room_11, +MIZUsin_room_12, +MIZUsin_room_13, +MIZUsin_room_14, +MIZUsin_room_15, +MIZUsin_room_16, +MIZUsin_room_17, +MIZUsin_room_18, +MIZUsin_room_19, +MIZUsin_room_20, +MIZUsin_room_21, +MIZUsin_room_22, +jyasinzou_scene, +jyasinzou_room_0, +jyasinzou_room_1, +jyasinzou_room_2, +jyasinzou_room_3, +jyasinzou_room_4, +jyasinzou_room_5, +jyasinzou_room_6, +jyasinzou_room_7, +jyasinzou_room_8, +jyasinzou_room_9, +jyasinzou_room_10, +jyasinzou_room_11, +jyasinzou_room_12, +jyasinzou_room_13, +jyasinzou_room_14, +jyasinzou_room_15, +jyasinzou_room_16, +jyasinzou_room_17, +jyasinzou_room_18, +jyasinzou_room_19, +jyasinzou_room_20, +jyasinzou_room_21, +jyasinzou_room_22, +jyasinzou_room_23, +jyasinzou_room_24, +jyasinzou_room_25, +jyasinzou_room_26, +jyasinzou_room_27, +jyasinzou_room_28, +HAKAdan_scene, +HAKAdan_room_0, +HAKAdan_room_1, +HAKAdan_room_2, +HAKAdan_room_3, +HAKAdan_room_4, +HAKAdan_room_5, +HAKAdan_room_6, +HAKAdan_room_7, +HAKAdan_room_8, +HAKAdan_room_9, +HAKAdan_room_10, +HAKAdan_room_11, +HAKAdan_room_12, +HAKAdan_room_13, +HAKAdan_room_14, +HAKAdan_room_15, +HAKAdan_room_16, +HAKAdan_room_17, +HAKAdan_room_18, +HAKAdan_room_19, +HAKAdan_room_20, +HAKAdan_room_21, +HAKAdan_room_22, +HAKAdanCH_scene, +HAKAdanCH_room_0, +HAKAdanCH_room_1, +HAKAdanCH_room_2, +HAKAdanCH_room_3, +HAKAdanCH_room_4, +HAKAdanCH_room_5, +HAKAdanCH_room_6, +ice_doukutu_scene, +ice_doukutu_room_0, +ice_doukutu_room_1, +ice_doukutu_room_2, +ice_doukutu_room_3, +ice_doukutu_room_4, +ice_doukutu_room_5, +ice_doukutu_room_6, +ice_doukutu_room_7, +ice_doukutu_room_8, +ice_doukutu_room_9, +ice_doukutu_room_10, +ice_doukutu_room_11, +men_scene, +men_room_0, +men_room_1, +men_room_2, +men_room_3, +men_room_4, +men_room_5, +men_room_6, +men_room_7, +men_room_8, +men_room_9, +men_room_10, +ganontika_scene, +ganontika_room_0, +ganontika_room_1, +ganontika_room_2, +ganontika_room_3, +ganontika_room_4, +ganontika_room_5, +ganontika_room_6, +ganontika_room_7, +ganontika_room_8, +ganontika_room_9, +ganontika_room_10, +ganontika_room_11, +ganontika_room_12, +ganontika_room_13, +ganontika_room_14, +ganontika_room_15, +ganontika_room_16, +ganontika_room_17, +ganontika_room_18, +ganontika_room_19, +spot00_scene, +spot00_room_0, +spot01_scene, +spot01_room_0, +spot02_scene, +spot02_room_0, +spot02_room_1, +spot03_scene, +spot03_room_0, +spot03_room_1, +spot04_scene, +spot04_room_0, +spot04_room_1, +spot04_room_2, +spot05_scene, +spot05_room_0, +spot06_scene, +spot06_room_0, +spot07_scene, +spot07_room_0, +spot07_room_1, +spot08_scene, +spot08_room_0, +spot09_scene, +spot09_room_0, +spot10_scene, +spot10_room_0, +spot10_room_1, +spot10_room_2, +spot10_room_3, +spot10_room_4, +spot10_room_5, +spot10_room_6, +spot10_room_7, +spot10_room_8, +spot10_room_9, +spot11_scene, +spot11_room_0, +spot12_scene, +spot12_room_0, +spot12_room_1, +spot13_scene, +spot13_room_0, +spot13_room_1, +spot15_scene, +spot15_room_0, +spot16_scene, +spot16_room_0, +spot17_scene, +spot17_room_0, +spot17_room_1, +spot18_scene, +spot18_room_0, +spot18_room_1, +spot18_room_2, +spot18_room_3, +market_day_scene, +market_day_room_0, +market_night_scene, +market_night_room_0, +kenjyanoma_scene, +kenjyanoma_room_0, +tokinoma_scene, +tokinoma_room_0, +tokinoma_room_1, +link_home_scene, +link_home_room_0, +kokiri_shop_scene, +kokiri_shop_room_0, +kokiri_home_scene, +kokiri_home_room_0, +kakusiana_scene, +kakusiana_room_0, +kakusiana_room_1, +kakusiana_room_2, +kakusiana_room_3, +kakusiana_room_4, +kakusiana_room_5, +kakusiana_room_6, +kakusiana_room_7, +kakusiana_room_8, +kakusiana_room_9, +kakusiana_room_10, +kakusiana_room_11, +kakusiana_room_12, +kakusiana_room_13, +entra_scene, +entra_room_0, +moribossroom_scene, +moribossroom_room_0, +moribossroom_room_1, +syatekijyou_scene, +syatekijyou_room_0, +shop1_scene, +shop1_room_0, +hairal_niwa_scene, +hairal_niwa_room_0, +ganon_tou_scene, +ganon_tou_room_0, +market_alley_scene, +market_alley_room_0, +spot20_scene, +spot20_room_0, +market_ruins_scene, +market_ruins_room_0, +entra_n_scene, +entra_n_room_0, +enrui_scene, +enrui_room_0, +market_alley_n_scene, +market_alley_n_room_0, +hiral_demo_scene, +hiral_demo_room_0, +kokiri_home3_scene, +kokiri_home3_room_0, +malon_stable_scene, +malon_stable_room_0, +kakariko_scene, +kakariko_room_0, +bdan_boss_scene, +bdan_boss_room_0, +bdan_boss_room_1, +FIRE_bs_scene, +FIRE_bs_room_0, +FIRE_bs_room_1, +hut_scene, +hut_room_0, +daiyousei_izumi_scene, +daiyousei_izumi_room_0, +hakaana_scene, +hakaana_room_0, +yousei_izumi_tate_scene, +yousei_izumi_tate_room_0, +yousei_izumi_yoko_scene, +yousei_izumi_yoko_room_0, +golon_scene, +golon_room_0, +zoora_scene, +zoora_room_0, +drag_scene, +drag_room_0, +alley_shop_scene, +alley_shop_room_0, +night_shop_scene, +night_shop_room_0, +impa_scene, +impa_room_0, +labo_scene, +labo_room_0, +tent_scene, +tent_room_0, +nakaniwa_scene, +nakaniwa_room_0, +ddan_boss_scene, +ddan_boss_room_0, +ddan_boss_room_1, +ydan_boss_scene, +ydan_boss_room_0, +ydan_boss_room_1, +HAKAdan_bs_scene, +HAKAdan_bs_room_0, +HAKAdan_bs_room_1, +MIZUsin_bs_scene, +MIZUsin_bs_room_0, +MIZUsin_bs_room_1, +ganon_scene, +ganon_room_0, +ganon_room_1, +ganon_room_2, +ganon_room_3, +ganon_room_4, +ganon_room_5, +ganon_room_6, +ganon_room_7, +ganon_room_8, +ganon_room_9, +ganon_boss_scene, +ganon_boss_room_0, +jyasinboss_scene, +jyasinboss_room_0, +jyasinboss_room_1, +jyasinboss_room_2, +jyasinboss_room_3, +kokiri_home4_scene, +kokiri_home4_room_0, +kokiri_home5_scene, +kokiri_home5_room_0, +ganon_final_scene, +ganon_final_room_0, +kakariko3_scene, +kakariko3_room_0, +hakasitarelay_scene, +hakasitarelay_room_0, +hakasitarelay_room_1, +hakasitarelay_room_2, +hakasitarelay_room_3, +hakasitarelay_room_4, +hakasitarelay_room_5, +hakasitarelay_room_6, +shrine_scene, +shrine_room_0, +turibori_scene, +turibori_room_0, +shrine_n_scene, +shrine_n_room_0, +shrine_r_scene, +shrine_r_room_0, +hakaana2_scene, +hakaana2_room_0, +gerudoway_scene, +gerudoway_room_0, +gerudoway_room_1, +gerudoway_room_2, +gerudoway_room_3, +gerudoway_room_4, +gerudoway_room_5, +hairal_niwa_n_scene, +hairal_niwa_n_room_0, +bowling_scene, +bowling_room_0, +hakaana_ouke_scene, +hakaana_ouke_room_0, +hakaana_ouke_room_1, +hakaana_ouke_room_2, +hylia_labo_scene, +hylia_labo_room_0, +souko_scene, +souko_room_0, +souko_room_1, +souko_room_2, +miharigoya_scene, +miharigoya_room_0, +mahouya_scene, +mahouya_room_0, +takaraya_scene, +takaraya_room_0, +takaraya_room_1, +takaraya_room_2, +takaraya_room_3, +takaraya_room_4, +takaraya_room_5, +takaraya_room_6, +ganon_sonogo_scene, +ganon_sonogo_room_0, +ganon_sonogo_room_1, +ganon_sonogo_room_2, +ganon_sonogo_room_3, +ganon_sonogo_room_4, +ganon_demo_scene, +ganon_demo_room_0, +face_shop_scene, +face_shop_room_0, +kinsuta_scene, +kinsuta_room_0, +ganontikasonogo_scene, +ganontikasonogo_room_0, +ganontikasonogo_room_1, +bump_texture_static, +anime_model_1_static, +anime_model_2_static, +anime_model_3_static, +anime_model_4_static, +anime_model_5_static, +anime_model_6_static, +anime_texture_1_static, +anime_texture_2_static, +anime_texture_3_static, +anime_texture_4_static, +anime_texture_5_static, +anime_texture_6_static, +softsprite_matrix_static, diff --git a/baseroms/gc-jp/checksum-compressed.md5 b/baseroms/gc-jp/checksum-compressed.md5 new file mode 100644 index 0000000000..8234b5cc8c --- /dev/null +++ b/baseroms/gc-jp/checksum-compressed.md5 @@ -0,0 +1 @@ +33fb7852c180b18ea0b9620b630f413f build/gc-jp/oot-gc-jp-compressed.z64 diff --git a/baseroms/gc-jp/checksum.md5 b/baseroms/gc-jp/checksum.md5 new file mode 100644 index 0000000000..e94a930369 --- /dev/null +++ b/baseroms/gc-jp/checksum.md5 @@ -0,0 +1 @@ +c72746a38cee7b25e6bbecde8db7e2d1 build/gc-jp/oot-gc-jp.z64 diff --git a/baseroms/gc-jp/config.yml b/baseroms/gc-jp/config.yml new file mode 100644 index 0000000000..08df45e6ae --- /dev/null +++ b/baseroms/gc-jp/config.yml @@ -0,0 +1,1212 @@ +dmadata_start: 0x7170 +text_lang_pal: false +incbins: + - name: ipl3 + segment: makerom + vram: 0x80000040 + size: 0xFC0 + - name: rspbootText + segment: boot + vram: 0x80005FC0 + size: 0xD0 + - name: aspMainText + segment: code + vram: 0x800E3860 + size: 0xFB0 + - name: gspS2DEX2d_fifoText + segment: code + vram: 0x800E4810 + size: 0x18C0 + - name: njpgdspMainText + segment: code + vram: 0x800E60D0 + size: 0xAF0 + - name: aspMainData + segment: code + vram: 0x80113840 + size: 0x2E0 + - name: gspF3DZEX2_NoN_PosLight_fifoText + segment: code + vram: 0x80113B20 + size: 0x1630 + - name: gspF3DZEX2_NoN_PosLight_fifoData + segment: code + vram: 0x80115150 + size: 0x420 + - name: gspS2DEX2d_fifoData + segment: code + vram: 0x80115570 + size: 0x390 + - name: njpgdspMainData + segment: code + vram: 0x80115900 + size: 0x60 +variables: + gMtxClear: 0x800FE2C0 + sJpnMessageEntryTable: 0x80109EAC + sNesMessageEntryTable: 0x8010DFEC + sStaffMessageEntryTable: 0x8011220C + gSoundFontTable: 0x80112CA0 + gSequenceFontTable: 0x80112F10 + gSequenceTable: 0x801130D0 + gSampleBankTable: 0x801137C0 + sShadowTex: 0x80A74150 +assets: +- name: code/fbdemo_circle + xml_path: assets/xml/code/fbdemo_circle.xml + start_offset: 0xEB788 + end_offset: 0xEC9A8 +- name: code/fbdemo_triforce + xml_path: assets/xml/code/fbdemo_triforce.xml + start_offset: 0xEAC10 + end_offset: 0xEACE0 +- name: code/fbdemo_wipe1 + xml_path: assets/xml/code/fbdemo_wipe1.xml + start_offset: 0xEACE0 + end_offset: 0xEB670 +- name: misc/link_animetion + xml_path: assets/xml/misc/link_animetion.xml +- name: misc/z_select_static + xml_path: assets/xml/misc/z_select_static.xml +- name: objects/gameplay_dangeon_keep + xml_path: assets/xml/objects/gameplay_dangeon_keep.xml +- name: objects/gameplay_field_keep + xml_path: assets/xml/objects/gameplay_field_keep.xml +- name: objects/gameplay_keep + xml_path: assets/xml/objects/gameplay_keep.xml +- name: objects/object_ahg + xml_path: assets/xml/objects/object_ahg.xml +- name: objects/object_am + xml_path: assets/xml/objects/object_am.xml +- name: objects/object_ane + xml_path: assets/xml/objects/object_ane.xml +- name: objects/object_ani + xml_path: assets/xml/objects/object_ani.xml +- name: objects/object_anubice + xml_path: assets/xml/objects/object_anubice.xml +- name: objects/object_aob + xml_path: assets/xml/objects/object_aob.xml +- name: objects/object_b_heart + xml_path: assets/xml/objects/object_b_heart.xml +- name: objects/object_Bb + xml_path: assets/xml/objects/object_Bb.xml +- name: objects/object_bba + xml_path: assets/xml/objects/object_bba.xml +- name: objects/object_bdan_objects + xml_path: assets/xml/objects/object_bdan_objects.xml +- name: objects/object_bdoor + xml_path: assets/xml/objects/object_bdoor.xml +- name: objects/object_bg + xml_path: assets/xml/objects/object_bg.xml +- name: objects/object_bigokuta + xml_path: assets/xml/objects/object_bigokuta.xml +- name: objects/object_bird + xml_path: assets/xml/objects/object_bird.xml +- name: objects/object_bji + xml_path: assets/xml/objects/object_bji.xml +- name: objects/object_bl + xml_path: assets/xml/objects/object_bl.xml +- name: objects/object_blkobj + xml_path: assets/xml/objects/object_blkobj.xml +- name: objects/object_bob + xml_path: assets/xml/objects/object_bob.xml +- name: objects/object_boj + xml_path: assets/xml/objects/object_boj.xml +- name: objects/object_bombf + xml_path: assets/xml/objects/object_bombf.xml +- name: objects/object_bombiwa + xml_path: assets/xml/objects/object_bombiwa.xml +- name: objects/object_bowl + xml_path: assets/xml/objects/object_bowl.xml +- name: objects/object_box + xml_path: assets/xml/objects/object_box.xml +- name: objects/object_brob + xml_path: assets/xml/objects/object_brob.xml +- name: objects/object_bubble + xml_path: assets/xml/objects/object_bubble.xml +- name: objects/object_bv + xml_path: assets/xml/objects/object_bv.xml +- name: objects/object_bw + xml_path: assets/xml/objects/object_bw.xml +- name: objects/object_bwall + xml_path: assets/xml/objects/object_bwall.xml +- name: objects/object_bxa + xml_path: assets/xml/objects/object_bxa.xml +- name: objects/object_cne + xml_path: assets/xml/objects/object_cne.xml +- name: objects/object_cob + xml_path: assets/xml/objects/object_cob.xml +- name: objects/object_cow + xml_path: assets/xml/objects/object_cow.xml +- name: objects/object_crow + xml_path: assets/xml/objects/object_crow.xml +- name: objects/object_cs + xml_path: assets/xml/objects/object_cs.xml +- name: objects/object_d_elevator + xml_path: assets/xml/objects/object_d_elevator.xml +- name: objects/object_d_hsblock + xml_path: assets/xml/objects/object_d_hsblock.xml +- name: objects/object_d_lift + xml_path: assets/xml/objects/object_d_lift.xml +- name: objects/object_daiku + xml_path: assets/xml/objects/object_daiku.xml +- name: objects/object_ddan_objects + xml_path: assets/xml/objects/object_ddan_objects.xml +- name: objects/object_dekubaba + xml_path: assets/xml/objects/object_dekubaba.xml +- name: objects/object_dekujr + xml_path: assets/xml/objects/object_dekujr.xml +- name: objects/object_dekunuts + xml_path: assets/xml/objects/object_dekunuts.xml +- name: objects/object_demo_6k + xml_path: assets/xml/objects/object_demo_6k.xml +- name: objects/object_demo_kekkai + xml_path: assets/xml/objects/object_demo_kekkai.xml +- name: objects/object_demo_tre_lgt + xml_path: assets/xml/objects/object_demo_tre_lgt.xml +- name: objects/object_dh + xml_path: assets/xml/objects/object_dh.xml +- name: objects/object_dnk + xml_path: assets/xml/objects/object_dnk.xml +- name: objects/object_dns + xml_path: assets/xml/objects/object_dns.xml +- name: objects/object_dodojr + xml_path: assets/xml/objects/object_dodojr.xml +- name: objects/object_dodongo + xml_path: assets/xml/objects/object_dodongo.xml +- name: objects/object_dog + xml_path: assets/xml/objects/object_dog.xml +- name: objects/object_door_gerudo + xml_path: assets/xml/objects/object_door_gerudo.xml +- name: objects/object_door_killer + xml_path: assets/xml/objects/object_door_killer.xml +- name: objects/object_ds + xml_path: assets/xml/objects/object_ds.xml +- name: objects/object_ds2 + xml_path: assets/xml/objects/object_ds2.xml +- name: objects/object_du + xml_path: assets/xml/objects/object_du.xml +- name: objects/object_dy_obj + xml_path: assets/xml/objects/object_dy_obj.xml +- name: objects/object_ec + xml_path: assets/xml/objects/object_ec.xml +- name: objects/object_efc_crystal_light + xml_path: assets/xml/objects/object_efc_crystal_light.xml +- name: objects/object_efc_doughnut + xml_path: assets/xml/objects/object_efc_doughnut.xml +- name: objects/object_efc_erupc + xml_path: assets/xml/objects/object_efc_erupc.xml +- name: objects/object_efc_fire_ball + xml_path: assets/xml/objects/object_efc_fire_ball.xml +- name: objects/object_efc_flash + xml_path: assets/xml/objects/object_efc_flash.xml +- name: objects/object_efc_lgt_shower + xml_path: assets/xml/objects/object_efc_lgt_shower.xml +- name: objects/object_efc_star_field + xml_path: assets/xml/objects/object_efc_star_field.xml +- name: objects/object_efc_tw + xml_path: assets/xml/objects/object_efc_tw.xml +- name: objects/object_ei + xml_path: assets/xml/objects/object_ei.xml +- name: objects/object_fa + xml_path: assets/xml/objects/object_fa.xml +- name: objects/object_fd + xml_path: assets/xml/objects/object_fd.xml +- name: objects/object_fd2 + xml_path: assets/xml/objects/object_fd2.xml +- name: objects/object_fhg + xml_path: assets/xml/objects/object_fhg.xml +- name: objects/object_fire + xml_path: assets/xml/objects/object_fire.xml +- name: objects/object_firefly + xml_path: assets/xml/objects/object_firefly.xml +- name: objects/object_fish + xml_path: assets/xml/objects/object_fish.xml +- name: objects/object_fr + xml_path: assets/xml/objects/object_fr.xml +- name: objects/object_fu + xml_path: assets/xml/objects/object_fu.xml +- name: objects/object_fw + xml_path: assets/xml/objects/object_fw.xml +- name: objects/object_fz + xml_path: assets/xml/objects/object_fz.xml +- name: objects/object_ganon + xml_path: assets/xml/objects/object_ganon.xml +- name: objects/object_ganon2 + xml_path: assets/xml/objects/object_ganon2.xml +- name: objects/object_ganon_anime1 + xml_path: assets/xml/objects/object_ganon_anime1.xml +- name: objects/object_ganon_anime2 + xml_path: assets/xml/objects/object_ganon_anime2.xml +- name: objects/object_ganon_anime3 + xml_path: assets/xml/objects/object_ganon_anime3.xml +- name: objects/object_ganon_objects + xml_path: assets/xml/objects/object_ganon_objects.xml +- name: objects/object_ge1 + xml_path: assets/xml/objects/object_ge1.xml +- name: objects/object_geff + xml_path: assets/xml/objects/object_geff.xml +- name: objects/object_geldb + xml_path: assets/xml/objects/object_geldb.xml +- name: objects/object_gi_arrow + xml_path: assets/xml/objects/object_gi_arrow.xml +- name: objects/object_gi_arrowcase + xml_path: assets/xml/objects/object_gi_arrowcase.xml +- name: objects/object_gi_bean + xml_path: assets/xml/objects/object_gi_bean.xml +- name: objects/object_gi_bomb_1 + xml_path: assets/xml/objects/object_gi_bomb_1.xml +- name: objects/object_gi_bomb_2 + xml_path: assets/xml/objects/object_gi_bomb_2.xml +- name: objects/object_gi_bombpouch + xml_path: assets/xml/objects/object_gi_bombpouch.xml +- name: objects/object_gi_boomerang + xml_path: assets/xml/objects/object_gi_boomerang.xml +- name: objects/object_gi_boots_2 + xml_path: assets/xml/objects/object_gi_boots_2.xml +- name: objects/object_gi_bosskey + xml_path: assets/xml/objects/object_gi_bosskey.xml +- name: objects/object_gi_bottle + xml_path: assets/xml/objects/object_gi_bottle.xml +- name: objects/object_gi_bottle_letter + xml_path: assets/xml/objects/object_gi_bottle_letter.xml +- name: objects/object_gi_bow + xml_path: assets/xml/objects/object_gi_bow.xml +- name: objects/object_gi_bracelet + xml_path: assets/xml/objects/object_gi_bracelet.xml +- name: objects/object_gi_brokensword + xml_path: assets/xml/objects/object_gi_brokensword.xml +- name: objects/object_gi_butterfly + xml_path: assets/xml/objects/object_gi_butterfly.xml +- name: objects/object_gi_clothes + xml_path: assets/xml/objects/object_gi_clothes.xml +- name: objects/object_gi_coin + xml_path: assets/xml/objects/object_gi_coin.xml +- name: objects/object_gi_compass + xml_path: assets/xml/objects/object_gi_compass.xml +- name: objects/object_gi_dekupouch + xml_path: assets/xml/objects/object_gi_dekupouch.xml +- name: objects/object_gi_egg + xml_path: assets/xml/objects/object_gi_egg.xml +- name: objects/object_gi_eye_lotion + xml_path: assets/xml/objects/object_gi_eye_lotion.xml +- name: objects/object_gi_fire + xml_path: assets/xml/objects/object_gi_fire.xml +- name: objects/object_gi_fish + xml_path: assets/xml/objects/object_gi_fish.xml +- name: objects/object_gi_frog + xml_path: assets/xml/objects/object_gi_frog.xml +- name: objects/object_gi_gerudo + xml_path: assets/xml/objects/object_gi_gerudo.xml +- name: objects/object_gi_gerudomask + xml_path: assets/xml/objects/object_gi_gerudomask.xml +- name: objects/object_gi_ghost + xml_path: assets/xml/objects/object_gi_ghost.xml +- name: objects/object_gi_glasses + xml_path: assets/xml/objects/object_gi_glasses.xml +- name: objects/object_gi_gloves + xml_path: assets/xml/objects/object_gi_gloves.xml +- name: objects/object_gi_goddess + xml_path: assets/xml/objects/object_gi_goddess.xml +- name: objects/object_gi_golonmask + xml_path: assets/xml/objects/object_gi_golonmask.xml +- name: objects/object_gi_grass + xml_path: assets/xml/objects/object_gi_grass.xml +- name: objects/object_gi_hammer + xml_path: assets/xml/objects/object_gi_hammer.xml +- name: objects/object_gi_heart + xml_path: assets/xml/objects/object_gi_heart.xml +- name: objects/object_gi_hearts + xml_path: assets/xml/objects/object_gi_hearts.xml +- name: objects/object_gi_hookshot + xml_path: assets/xml/objects/object_gi_hookshot.xml +- name: objects/object_gi_hoverboots + xml_path: assets/xml/objects/object_gi_hoverboots.xml +- name: objects/object_gi_insect + xml_path: assets/xml/objects/object_gi_insect.xml +- name: objects/object_gi_jewel + xml_path: assets/xml/objects/object_gi_jewel.xml +- name: objects/object_gi_key + xml_path: assets/xml/objects/object_gi_key.xml +- name: objects/object_gi_ki_tan_mask + xml_path: assets/xml/objects/object_gi_ki_tan_mask.xml +- name: objects/object_gi_letter + xml_path: assets/xml/objects/object_gi_letter.xml +- name: objects/object_gi_liquid + xml_path: assets/xml/objects/object_gi_liquid.xml +- name: objects/object_gi_longsword + xml_path: assets/xml/objects/object_gi_longsword.xml +- name: objects/object_gi_m_arrow + xml_path: assets/xml/objects/object_gi_m_arrow.xml +- name: objects/object_gi_magicpot + xml_path: assets/xml/objects/object_gi_magicpot.xml +- name: objects/object_gi_map + xml_path: assets/xml/objects/object_gi_map.xml +- name: objects/object_gi_medal + xml_path: assets/xml/objects/object_gi_medal.xml +- name: objects/object_gi_melody + xml_path: assets/xml/objects/object_gi_melody.xml +- name: objects/object_gi_milk + xml_path: assets/xml/objects/object_gi_milk.xml +- name: objects/object_gi_mushroom + xml_path: assets/xml/objects/object_gi_mushroom.xml +- name: objects/object_gi_niwatori + xml_path: assets/xml/objects/object_gi_niwatori.xml +- name: objects/object_gi_nuts + xml_path: assets/xml/objects/object_gi_nuts.xml +- name: objects/object_gi_ocarina + xml_path: assets/xml/objects/object_gi_ocarina.xml +- name: objects/object_gi_ocarina_0 + xml_path: assets/xml/objects/object_gi_ocarina_0.xml +- name: objects/object_gi_pachinko + xml_path: assets/xml/objects/object_gi_pachinko.xml +- name: objects/object_gi_powder + xml_path: assets/xml/objects/object_gi_powder.xml +- name: objects/object_gi_prescription + xml_path: assets/xml/objects/object_gi_prescription.xml +- name: objects/object_gi_purse + xml_path: assets/xml/objects/object_gi_purse.xml +- name: objects/object_gi_rabit_mask + xml_path: assets/xml/objects/object_gi_rabit_mask.xml +- name: objects/object_gi_redead_mask + xml_path: assets/xml/objects/object_gi_redead_mask.xml +- name: objects/object_gi_rupy + xml_path: assets/xml/objects/object_gi_rupy.xml +- name: objects/object_gi_saw + xml_path: assets/xml/objects/object_gi_saw.xml +- name: objects/object_gi_scale + xml_path: assets/xml/objects/object_gi_scale.xml +- name: objects/object_gi_seed + xml_path: assets/xml/objects/object_gi_seed.xml +- name: objects/object_gi_shield_1 + xml_path: assets/xml/objects/object_gi_shield_1.xml +- name: objects/object_gi_shield_2 + xml_path: assets/xml/objects/object_gi_shield_2.xml +- name: objects/object_gi_shield_3 + xml_path: assets/xml/objects/object_gi_shield_3.xml +- name: objects/object_gi_skj_mask + xml_path: assets/xml/objects/object_gi_skj_mask.xml +- name: objects/object_gi_soldout + xml_path: assets/xml/objects/object_gi_soldout.xml +- name: objects/object_gi_soul + xml_path: assets/xml/objects/object_gi_soul.xml +- name: objects/object_gi_stick + xml_path: assets/xml/objects/object_gi_stick.xml +- name: objects/object_gi_sutaru + xml_path: assets/xml/objects/object_gi_sutaru.xml +- name: objects/object_gi_sword_1 + xml_path: assets/xml/objects/object_gi_sword_1.xml +- name: objects/object_gi_ticketstone + xml_path: assets/xml/objects/object_gi_ticketstone.xml +- name: objects/object_gi_truth_mask + xml_path: assets/xml/objects/object_gi_truth_mask.xml +- name: objects/object_gi_zoramask + xml_path: assets/xml/objects/object_gi_zoramask.xml +- name: objects/object_gj + xml_path: assets/xml/objects/object_gj.xml +- name: objects/object_gjyo_objects + xml_path: assets/xml/objects/object_gjyo_objects.xml +- name: objects/object_gla + xml_path: assets/xml/objects/object_gla.xml +- name: objects/object_gm + xml_path: assets/xml/objects/object_gm.xml +- name: objects/object_gnd + xml_path: assets/xml/objects/object_gnd.xml +- name: objects/object_gnd_magic + xml_path: assets/xml/objects/object_gnd_magic.xml +- name: objects/object_gndd + xml_path: assets/xml/objects/object_gndd.xml +- name: objects/object_god_lgt + xml_path: assets/xml/objects/object_god_lgt.xml +- name: objects/object_gol + xml_path: assets/xml/objects/object_gol.xml +- name: objects/object_goma + xml_path: assets/xml/objects/object_goma.xml +- name: objects/object_goroiwa + xml_path: assets/xml/objects/object_goroiwa.xml +- name: objects/object_gr + xml_path: assets/xml/objects/object_gr.xml +- name: objects/object_gs + xml_path: assets/xml/objects/object_gs.xml +- name: objects/object_gt + xml_path: assets/xml/objects/object_gt.xml +- name: objects/object_haka + xml_path: assets/xml/objects/object_haka.xml +- name: objects/object_haka_door + xml_path: assets/xml/objects/object_haka_door.xml +- name: objects/object_haka_objects + xml_path: assets/xml/objects/object_haka_objects.xml +- name: objects/object_hakach_objects + xml_path: assets/xml/objects/object_hakach_objects.xml +- name: objects/object_hata + xml_path: assets/xml/objects/object_hata.xml +- name: objects/object_heavy_object + xml_path: assets/xml/objects/object_heavy_object.xml +- name: objects/object_hidan_objects + xml_path: assets/xml/objects/object_hidan_objects.xml +- name: objects/object_hintnuts + xml_path: assets/xml/objects/object_hintnuts.xml +- name: objects/object_hni + xml_path: assets/xml/objects/object_hni.xml +- name: objects/object_horse + xml_path: assets/xml/objects/object_horse.xml +- name: objects/object_horse_ganon + xml_path: assets/xml/objects/object_horse_ganon.xml +- name: objects/object_horse_link_child + xml_path: assets/xml/objects/object_horse_link_child.xml +- name: objects/object_horse_normal + xml_path: assets/xml/objects/object_horse_normal.xml +- name: objects/object_horse_zelda + xml_path: assets/xml/objects/object_horse_zelda.xml +- name: objects/object_hs + xml_path: assets/xml/objects/object_hs.xml +- name: objects/object_human + xml_path: assets/xml/objects/object_human.xml +- name: objects/object_ice_objects + xml_path: assets/xml/objects/object_ice_objects.xml +- name: objects/object_ik + xml_path: assets/xml/objects/object_ik.xml +- name: objects/object_im + xml_path: assets/xml/objects/object_im.xml +- name: objects/object_in + xml_path: assets/xml/objects/object_in.xml +- name: objects/object_ingate + xml_path: assets/xml/objects/object_ingate.xml +- name: objects/object_jj + xml_path: assets/xml/objects/object_jj.xml +- name: objects/object_js + xml_path: assets/xml/objects/object_js.xml +- name: objects/object_jya_door + xml_path: assets/xml/objects/object_jya_door.xml +- name: objects/object_jya_iron + xml_path: assets/xml/objects/object_jya_iron.xml +- name: objects/object_jya_obj + xml_path: assets/xml/objects/object_jya_obj.xml +- name: objects/object_ka + xml_path: assets/xml/objects/object_ka.xml +- name: objects/object_kanban + xml_path: assets/xml/objects/object_kanban.xml +- name: objects/object_kibako2 + xml_path: assets/xml/objects/object_kibako2.xml +- name: objects/object_kingdodongo + xml_path: assets/xml/objects/object_kingdodongo.xml +- name: objects/object_km1 + xml_path: assets/xml/objects/object_km1.xml +- name: objects/object_kusa + xml_path: assets/xml/objects/object_kusa.xml +- name: objects/object_kw1 + xml_path: assets/xml/objects/object_kw1.xml +- name: objects/object_kz + xml_path: assets/xml/objects/object_kz.xml +- name: objects/object_light_ring + xml_path: assets/xml/objects/object_light_ring.xml +- name: objects/object_lightbox + xml_path: assets/xml/objects/object_lightbox.xml +- name: objects/object_lightswitch + xml_path: assets/xml/objects/object_lightswitch.xml +- name: objects/object_link_boy + xml_path: assets/xml/objects/object_link_boy.xml +- name: objects/object_link_child + xml_path: assets/xml/objects/object_link_child.xml +- name: objects/object_ma1 + xml_path: assets/xml/objects/object_ma1.xml +- name: objects/object_ma2 + xml_path: assets/xml/objects/object_ma2.xml +- name: objects/object_mag + xml_path: assets/xml/objects/object_mag_v2.xml +- name: objects/object_mamenoki + xml_path: assets/xml/objects/object_mamenoki.xml +- name: objects/object_mastergolon + xml_path: assets/xml/objects/object_mastergolon.xml +- name: objects/object_masterkokiri + xml_path: assets/xml/objects/object_masterkokiri.xml +- name: objects/object_masterkokirihead + xml_path: assets/xml/objects/object_masterkokirihead.xml +- name: objects/object_masterzoora + xml_path: assets/xml/objects/object_masterzoora.xml +- name: objects/object_mb + xml_path: assets/xml/objects/object_mb.xml +- name: objects/object_md + xml_path: assets/xml/objects/object_md.xml +- name: objects/object_medal + xml_path: assets/xml/objects/object_medal.xml +- name: objects/object_menkuri_objects + xml_path: assets/xml/objects/object_menkuri_objects.xml +- name: objects/object_mir_ray + xml_path: assets/xml/objects/object_mir_ray.xml +- name: objects/object_mizu_objects + xml_path: assets/xml/objects/object_mizu_objects.xml +- name: objects/object_mjin + xml_path: assets/xml/objects/object_mjin.xml +- name: objects/object_mjin_dark + xml_path: assets/xml/objects/object_mjin_dark.xml +- name: objects/object_mjin_flame + xml_path: assets/xml/objects/object_mjin_flame.xml +- name: objects/object_mjin_flash + xml_path: assets/xml/objects/object_mjin_flash.xml +- name: objects/object_mjin_ice + xml_path: assets/xml/objects/object_mjin_ice.xml +- name: objects/object_mjin_oka + xml_path: assets/xml/objects/object_mjin_oka.xml +- name: objects/object_mjin_soul + xml_path: assets/xml/objects/object_mjin_soul.xml +- name: objects/object_mjin_wind + xml_path: assets/xml/objects/object_mjin_wind.xml +- name: objects/object_mk + xml_path: assets/xml/objects/object_mk.xml +- name: objects/object_mm + xml_path: assets/xml/objects/object_mm.xml +- name: objects/object_mo + xml_path: assets/xml/objects/object_mo.xml +- name: objects/object_mori_hineri1 + xml_path: assets/xml/objects/object_mori_hineri1.xml +- name: objects/object_mori_hineri1a + xml_path: assets/xml/objects/object_mori_hineri1a.xml +- name: objects/object_mori_hineri2 + xml_path: assets/xml/objects/object_mori_hineri2.xml +- name: objects/object_mori_hineri2a + xml_path: assets/xml/objects/object_mori_hineri2a.xml +- name: objects/object_mori_objects + xml_path: assets/xml/objects/object_mori_objects.xml +- name: objects/object_mori_tex + xml_path: assets/xml/objects/object_mori_tex.xml +- name: objects/object_ms + xml_path: assets/xml/objects/object_ms.xml +- name: objects/object_mu + xml_path: assets/xml/objects/object_mu.xml +- name: objects/object_nb + xml_path: assets/xml/objects/object_nb.xml +- name: objects/object_niw + xml_path: assets/xml/objects/object_niw.xml +- name: objects/object_nwc + xml_path: assets/xml/objects/object_nwc.xml +- name: objects/object_ny + xml_path: assets/xml/objects/object_ny.xml +- name: objects/object_o_anime + xml_path: assets/xml/objects/object_o_anime.xml +- name: objects/object_oA1 + xml_path: assets/xml/objects/object_oA1.xml +- name: objects/object_oA2 + xml_path: assets/xml/objects/object_oA2.xml +- name: objects/object_oA3 + xml_path: assets/xml/objects/object_oA3.xml +- name: objects/object_oA4 + xml_path: assets/xml/objects/object_oA4.xml +- name: objects/object_oA5 + xml_path: assets/xml/objects/object_oA5.xml +- name: objects/object_oA6 + xml_path: assets/xml/objects/object_oA6.xml +- name: objects/object_oA7 + xml_path: assets/xml/objects/object_oA7.xml +- name: objects/object_oA8 + xml_path: assets/xml/objects/object_oA8.xml +- name: objects/object_oA9 + xml_path: assets/xml/objects/object_oA9.xml +- name: objects/object_oA10 + xml_path: assets/xml/objects/object_oA10.xml +- name: objects/object_oA11 + xml_path: assets/xml/objects/object_oA11.xml +- name: objects/object_oB1 + xml_path: assets/xml/objects/object_oB1.xml +- name: objects/object_oB2 + xml_path: assets/xml/objects/object_oB2.xml +- name: objects/object_oB3 + xml_path: assets/xml/objects/object_oB3.xml +- name: objects/object_oB4 + xml_path: assets/xml/objects/object_oB4.xml +- name: objects/object_oE1 + xml_path: assets/xml/objects/object_oE1.xml +- name: objects/object_oE1s + xml_path: assets/xml/objects/object_oE1s.xml +- name: objects/object_oE2 + xml_path: assets/xml/objects/object_oE2.xml +- name: objects/object_oE3 + xml_path: assets/xml/objects/object_oE3.xml +- name: objects/object_oE4 + xml_path: assets/xml/objects/object_oE4.xml +- name: objects/object_oE4s + xml_path: assets/xml/objects/object_oE4s.xml +- name: objects/object_oE5 + xml_path: assets/xml/objects/object_oE5.xml +- name: objects/object_oE6 + xml_path: assets/xml/objects/object_oE6.xml +- name: objects/object_oE7 + xml_path: assets/xml/objects/object_oE7.xml +- name: objects/object_oE8 + xml_path: assets/xml/objects/object_oE8.xml +- name: objects/object_oE9 + xml_path: assets/xml/objects/object_oE9.xml +- name: objects/object_oE10 + xml_path: assets/xml/objects/object_oE10.xml +- name: objects/object_oE11 + xml_path: assets/xml/objects/object_oE11.xml +- name: objects/object_oE12 + xml_path: assets/xml/objects/object_oE12.xml +- name: objects/object_oE_anime + xml_path: assets/xml/objects/object_oE_anime.xml +- name: objects/object_oF1d_map + xml_path: assets/xml/objects/object_oF1d_map.xml +- name: objects/object_oF1s + xml_path: assets/xml/objects/object_oF1s.xml +- name: objects/object_okuta + xml_path: assets/xml/objects/object_okuta.xml +- name: objects/object_opening_demo1 + xml_path: assets/xml/objects/object_opening_demo1.xml +- name: objects/object_os + xml_path: assets/xml/objects/object_os.xml +- name: objects/object_os_anime + xml_path: assets/xml/objects/object_os_anime.xml +- name: objects/object_ossan + xml_path: assets/xml/objects/object_ossan.xml +- name: objects/object_ouke_haka + xml_path: assets/xml/objects/object_ouke_haka.xml +- name: objects/object_owl + xml_path: assets/xml/objects/object_owl.xml +- name: objects/object_peehat + xml_path: assets/xml/objects/object_peehat.xml +- name: objects/object_po_composer + xml_path: assets/xml/objects/object_po_composer.xml +- name: objects/object_po_field + xml_path: assets/xml/objects/object_po_field.xml +- name: objects/object_po_sisters + xml_path: assets/xml/objects/object_po_sisters.xml +- name: objects/object_poh + xml_path: assets/xml/objects/object_poh.xml +- name: objects/object_ps + xml_path: assets/xml/objects/object_ps.xml +- name: objects/object_pu_box + xml_path: assets/xml/objects/object_pu_box.xml +- name: objects/object_rd + xml_path: assets/xml/objects/object_rd.xml +- name: objects/object_reeba + xml_path: assets/xml/objects/object_reeba.xml +- name: objects/object_relay_objects + xml_path: assets/xml/objects/object_relay_objects.xml +- name: objects/object_rl + xml_path: assets/xml/objects/object_rl.xml +- name: objects/object_rr + xml_path: assets/xml/objects/object_rr.xml +- name: objects/object_rs + xml_path: assets/xml/objects/object_rs.xml +- name: objects/object_ru1 + xml_path: assets/xml/objects/object_ru1.xml +- name: objects/object_ru2 + xml_path: assets/xml/objects/object_ru2.xml +- name: objects/object_sa + xml_path: assets/xml/objects/object_sa.xml +- name: objects/object_sb + xml_path: assets/xml/objects/object_sb.xml +- name: objects/object_sd + xml_path: assets/xml/objects/object_sd.xml +- name: objects/object_shop_dungen + xml_path: assets/xml/objects/object_shop_dungen.xml +- name: objects/object_shopnuts + xml_path: assets/xml/objects/object_shopnuts.xml +- name: objects/object_siofuki + xml_path: assets/xml/objects/object_siofuki.xml +- name: objects/object_sk2 + xml_path: assets/xml/objects/object_sk2.xml +- name: objects/object_skb + xml_path: assets/xml/objects/object_skb.xml +- name: objects/object_skj + xml_path: assets/xml/objects/object_skj.xml +- name: objects/object_spot00_break + xml_path: assets/xml/objects/object_spot00_break.xml +- name: objects/object_spot00_objects + xml_path: assets/xml/objects/object_spot00_objects.xml +- name: objects/object_spot01_matoya + xml_path: assets/xml/objects/object_spot01_matoya.xml +- name: objects/object_spot01_matoyab + xml_path: assets/xml/objects/object_spot01_matoyab.xml +- name: objects/object_spot01_objects + xml_path: assets/xml/objects/object_spot01_objects.xml +- name: objects/object_spot01_objects2 + xml_path: assets/xml/objects/object_spot01_objects2.xml +- name: objects/object_spot02_objects + xml_path: assets/xml/objects/object_spot02_objects.xml +- name: objects/object_spot03_object + xml_path: assets/xml/objects/object_spot03_object.xml +- name: objects/object_spot04_objects + xml_path: assets/xml/objects/object_spot04_objects.xml +- name: objects/object_spot05_objects + xml_path: assets/xml/objects/object_spot05_objects.xml +- name: objects/object_spot06_objects + xml_path: assets/xml/objects/object_spot06_objects.xml +- name: objects/object_spot07_object + xml_path: assets/xml/objects/object_spot07_object.xml +- name: objects/object_spot08_obj + xml_path: assets/xml/objects/object_spot08_obj.xml +- name: objects/object_spot09_obj + xml_path: assets/xml/objects/object_spot09_obj.xml +- name: objects/object_spot11_obj + xml_path: assets/xml/objects/object_spot11_obj.xml +- name: objects/object_spot12_obj + xml_path: assets/xml/objects/object_spot12_obj.xml +- name: objects/object_spot15_obj + xml_path: assets/xml/objects/object_spot15_obj.xml +- name: objects/object_spot16_obj + xml_path: assets/xml/objects/object_spot16_obj.xml +- name: objects/object_spot17_obj + xml_path: assets/xml/objects/object_spot17_obj.xml +- name: objects/object_spot18_obj + xml_path: assets/xml/objects/object_spot18_obj.xml +- name: objects/object_ssh + xml_path: assets/xml/objects/object_ssh.xml +- name: objects/object_sst + xml_path: assets/xml/objects/object_sst.xml +- name: objects/object_st + xml_path: assets/xml/objects/object_st.xml +- name: objects/object_stream + xml_path: assets/xml/objects/object_stream.xml +- name: objects/object_syokudai + xml_path: assets/xml/objects/object_syokudai.xml +- name: objects/object_ta + xml_path: assets/xml/objects/object_ta.xml +- name: objects/object_timeblock + xml_path: assets/xml/objects/object_timeblock.xml +- name: objects/object_tite + xml_path: assets/xml/objects/object_tite.xml +- name: objects/object_tk + xml_path: assets/xml/objects/object_tk.xml +- name: objects/object_toki_objects + xml_path: assets/xml/objects/object_toki_objects.xml +- name: objects/object_torch2 + xml_path: assets/xml/objects/object_torch2.xml +- name: objects/object_toryo + xml_path: assets/xml/objects/object_toryo.xml +- name: objects/object_tp + xml_path: assets/xml/objects/object_tp.xml +- name: objects/object_tr + xml_path: assets/xml/objects/object_tr.xml +- name: objects/object_trap + xml_path: assets/xml/objects/object_trap.xml +- name: objects/object_triforce_spot + xml_path: assets/xml/objects/object_triforce_spot.xml +- name: objects/object_ts + xml_path: assets/xml/objects/object_ts.xml +- name: objects/object_tsubo + xml_path: assets/xml/objects/object_tsubo.xml +- name: objects/object_tw + xml_path: assets/xml/objects/object_tw.xml +- name: objects/object_umajump + xml_path: assets/xml/objects/object_umajump.xml +- name: objects/object_vali + xml_path: assets/xml/objects/object_vali.xml +- name: objects/object_vase + xml_path: assets/xml/objects/object_vase.xml +- name: objects/object_vm + xml_path: assets/xml/objects/object_vm.xml +- name: objects/object_wallmaster + xml_path: assets/xml/objects/object_wallmaster.xml +- name: objects/object_warp1 + xml_path: assets/xml/objects/object_warp1.xml +- name: objects/object_warp2 + xml_path: assets/xml/objects/object_warp2.xml +- name: objects/object_wf + xml_path: assets/xml/objects/object_wf.xml +- name: objects/object_wood02 + xml_path: assets/xml/objects/object_wood02.xml +- name: objects/object_xc + xml_path: assets/xml/objects/object_xc.xml +- name: objects/object_yabusame_point + xml_path: assets/xml/objects/object_yabusame_point.xml +- name: objects/object_ydan_objects + xml_path: assets/xml/objects/object_ydan_objects.xml +- name: objects/object_yukabyun + xml_path: assets/xml/objects/object_yukabyun.xml +- name: objects/object_zf + xml_path: assets/xml/objects/object_zf.xml +- name: objects/object_zg + xml_path: assets/xml/objects/object_zg.xml +- name: objects/object_zl1 + xml_path: assets/xml/objects/object_zl1.xml +- name: objects/object_zl2 + xml_path: assets/xml/objects/object_zl2.xml +- name: objects/object_zl2_anime1 + xml_path: assets/xml/objects/object_zl2_anime1.xml +- name: objects/object_zl2_anime2 + xml_path: assets/xml/objects/object_zl2_anime2.xml +- name: objects/object_zl4 + xml_path: assets/xml/objects/object_zl4.xml +- name: objects/object_zo + xml_path: assets/xml/objects/object_zo.xml +- name: overlays/ovl_Arrow_Fire + xml_path: assets/xml/overlays/ovl_Arrow_Fire.xml + start_offset: 0x980 + end_offset: 0x1DA0 +- name: overlays/ovl_Arrow_Ice + xml_path: assets/xml/overlays/ovl_Arrow_Ice.xml + start_offset: 0x9A0 + end_offset: 0x1DC0 +- name: overlays/ovl_Arrow_Light + xml_path: assets/xml/overlays/ovl_Arrow_Light.xml + start_offset: 0x9B0 + end_offset: 0x1DD0 +- name: overlays/ovl_Bg_Ganon_Otyuka + xml_path: assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml + start_offset: 0x1100 + end_offset: 0x24DC +- name: overlays/ovl_Bg_Jya_Cobra + xml_path: assets/xml/overlays/ovl_Bg_Jya_Cobra.xml + start_offset: 0x1850 + end_offset: 0x18C8 +- name: overlays/ovl_Boss_Dodongo + xml_path: assets/xml/overlays/ovl_Boss_Dodongo.xml + start_offset: 0x61E8 + end_offset: 0x91E8 +- name: overlays/ovl_Boss_Ganon + xml_path: assets/xml/overlays/ovl_Boss_Ganon.xml + start_offset: 0xE3C8 + end_offset: 0x20EE8 +- name: overlays/ovl_Boss_Ganon2 + xml_path: assets/xml/overlays/ovl_Boss_Ganon2.xml + start_offset: 0x9F88 + end_offset: 0x10438 +- name: overlays/ovl_Boss_Sst + xml_path: assets/xml/overlays/ovl_Boss_Sst.xml + start_offset: 0xA380 + end_offset: 0xAD30 +- name: overlays/ovl_Demo_Shd + xml_path: assets/xml/overlays/ovl_Demo_Shd.xml + start_offset: 0x410 + end_offset: 0x2390 +- name: overlays/ovl_Effect_Ss_Fhg_Flash + xml_path: assets/xml/overlays/ovl_Effect_Ss_Fhg_Flash.xml + start_offset: 0x9F0 + end_offset: 0xEA8 +- name: overlays/ovl_En_Bili + xml_path: assets/xml/overlays/ovl_En_Bili.xml + start_offset: 0x1E40 + end_offset: 0x1E60 +- name: overlays/ovl_En_Clear_Tag + xml_path: assets/xml/overlays/ovl_En_Clear_Tag.xml + start_offset: 0x2600 + end_offset: 0x8900 +- name: overlays/ovl_En_Ganon_Mant + xml_path: assets/xml/overlays/ovl_En_Ganon_Mant.xml + start_offset: 0x11F8 + end_offset: 0x40F8 +- name: overlays/ovl_En_Ganon_Organ + xml_path: assets/xml/overlays/ovl_En_Ganon_Organ.xml + start_offset: 0x368 + end_offset: 0x6EF0 +- name: overlays/ovl_En_Holl + xml_path: assets/xml/overlays/ovl_En_Holl.xml + start_offset: 0xE68 + end_offset: 0xED0 +- name: overlays/ovl_En_Jsjutan + xml_path: assets/xml/overlays/ovl_En_Jsjutan.xml + start_offset: 0x12C8 + end_offset: 0x4C60 +- name: overlays/ovl_En_Kanban + xml_path: assets/xml/overlays/ovl_En_Kanban.xml + start_offset: 0x2E70 + end_offset: 0x2F30 +- name: overlays/ovl_En_Sda + xml_path: assets/xml/overlays/ovl_En_Sda.xml + start_offset: 0x1498 + end_offset: 0x1528 +- name: overlays/ovl_En_Ssh + xml_path: assets/xml/overlays/ovl_En_Ssh.xml + start_offset: 0x2150 + end_offset: 0x21E0 +- name: overlays/ovl_En_St + xml_path: assets/xml/overlays/ovl_En_St.xml + start_offset: 0x26A0 + end_offset: 0x2730 +- name: overlays/ovl_En_Sth + xml_path: assets/xml/overlays/ovl_En_Sth.xml + start_offset: 0xE70 + end_offset: 0x3E44 +- name: overlays/ovl_End_Title + xml_path: assets/xml/overlays/ovl_End_Title.xml + start_offset: 0x6E0 + end_offset: 0x4088 +- name: overlays/ovl_file_choose + xml_path: assets/xml/overlays/ovl_file_choose.xml + start_offset: 0xEC40 + end_offset: 0xF320 +- name: overlays/ovl_Magic_Dark + xml_path: assets/xml/overlays/ovl_Magic_Dark.xml + start_offset: 0xC90 + end_offset: 0x16C0 +- name: overlays/ovl_Magic_Fire + xml_path: assets/xml/overlays/ovl_Magic_Fire.xml + start_offset: 0xB50 + end_offset: 0x21A0 +- name: overlays/ovl_Magic_Wind + xml_path: assets/xml/overlays/ovl_Magic_Wind.xml + start_offset: 0x6A0 + end_offset: 0x1BB8 +- name: overlays/ovl_Oceff_Spot + xml_path: assets/xml/overlays/ovl_Oceff_Spot.xml + start_offset: 0x780 + end_offset: 0xE58 +- name: overlays/ovl_Oceff_Storm + xml_path: assets/xml/overlays/ovl_Oceff_Storm.xml + start_offset: 0x750 + end_offset: 0x1AE0 +- name: overlays/ovl_Oceff_Wipe + xml_path: assets/xml/overlays/ovl_Oceff_Wipe.xml + start_offset: 0x520 + end_offset: 0xCE0 +- name: overlays/ovl_Oceff_Wipe2 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe2.xml + start_offset: 0x430 + end_offset: 0x1698 +- name: overlays/ovl_Oceff_Wipe3 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe3.xml + start_offset: 0x430 + end_offset: 0x1678 +- name: overlays/ovl_Oceff_Wipe4 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe4.xml + start_offset: 0x410 + end_offset: 0xEF8 +- name: scenes/dungeons/bdan + xml_path: assets/xml/scenes/dungeons/bdan.xml +- name: scenes/dungeons/bdan_boss + xml_path: assets/xml/scenes/dungeons/bdan_boss.xml +- name: scenes/dungeons/Bmori1 + xml_path: assets/xml/scenes/dungeons/Bmori1.xml +- name: scenes/dungeons/ddan + xml_path: assets/xml/scenes/dungeons/ddan.xml +- name: scenes/dungeons/ddan_boss + xml_path: assets/xml/scenes/dungeons/ddan_boss_v2.xml +- name: scenes/dungeons/FIRE_bs + xml_path: assets/xml/scenes/dungeons/FIRE_bs.xml +- name: scenes/dungeons/ganon + xml_path: assets/xml/scenes/dungeons/ganon.xml +- name: scenes/dungeons/ganon_boss + xml_path: assets/xml/scenes/dungeons/ganon_boss.xml +- name: scenes/dungeons/ganon_demo + xml_path: assets/xml/scenes/dungeons/ganon_demo.xml +- name: scenes/dungeons/ganon_final + xml_path: assets/xml/scenes/dungeons/ganon_final.xml +- name: scenes/dungeons/ganon_sonogo + xml_path: assets/xml/scenes/dungeons/ganon_sonogo.xml +- name: scenes/dungeons/ganontika + xml_path: assets/xml/scenes/dungeons/ganontika.xml +- name: scenes/dungeons/ganontikasonogo + xml_path: assets/xml/scenes/dungeons/ganontikasonogo.xml +- name: scenes/dungeons/gerudoway + xml_path: assets/xml/scenes/dungeons/gerudoway.xml +- name: scenes/dungeons/HAKAdan + xml_path: assets/xml/scenes/dungeons/HAKAdan.xml +- name: scenes/dungeons/HAKAdan_bs + xml_path: assets/xml/scenes/dungeons/HAKAdan_bs.xml +- name: scenes/dungeons/HAKAdanCH + xml_path: assets/xml/scenes/dungeons/HAKAdanCH.xml +- name: scenes/dungeons/HIDAN + xml_path: assets/xml/scenes/dungeons/HIDAN.xml +- name: scenes/dungeons/ice_doukutu + xml_path: assets/xml/scenes/dungeons/ice_doukutu_v2.xml +- name: scenes/dungeons/jyasinboss + xml_path: assets/xml/scenes/dungeons/jyasinboss.xml +- name: scenes/dungeons/jyasinzou + xml_path: assets/xml/scenes/dungeons/jyasinzou.xml +- name: scenes/dungeons/men + xml_path: assets/xml/scenes/dungeons/men.xml +- name: scenes/dungeons/MIZUsin + xml_path: assets/xml/scenes/dungeons/MIZUsin.xml +- name: scenes/dungeons/MIZUsin_bs + xml_path: assets/xml/scenes/dungeons/MIZUsin_bs.xml +- name: scenes/dungeons/moribossroom + xml_path: assets/xml/scenes/dungeons/moribossroom.xml +- name: scenes/dungeons/ydan + xml_path: assets/xml/scenes/dungeons/ydan.xml +- name: scenes/dungeons/ydan_boss + xml_path: assets/xml/scenes/dungeons/ydan_boss.xml +- name: scenes/indoors/bowling + xml_path: assets/xml/scenes/indoors/bowling.xml +- name: scenes/indoors/daiyousei_izumi + xml_path: assets/xml/scenes/indoors/daiyousei_izumi.xml +- name: scenes/indoors/hairal_niwa + xml_path: assets/xml/scenes/indoors/hairal_niwa.xml +- name: scenes/indoors/hairal_niwa_n + xml_path: assets/xml/scenes/indoors/hairal_niwa_n.xml +- name: scenes/indoors/hakasitarelay + xml_path: assets/xml/scenes/indoors/hakasitarelay.xml +- name: scenes/indoors/hut + xml_path: assets/xml/scenes/indoors/hut.xml +- name: scenes/indoors/hylia_labo + xml_path: assets/xml/scenes/indoors/hylia_labo.xml +- name: scenes/indoors/impa + xml_path: assets/xml/scenes/indoors/impa.xml +- name: scenes/indoors/kakariko + xml_path: assets/xml/scenes/indoors/kakariko.xml +- name: scenes/indoors/kenjyanoma + xml_path: assets/xml/scenes/indoors/kenjyanoma.xml +- name: scenes/indoors/kokiri_home + xml_path: assets/xml/scenes/indoors/kokiri_home.xml +- name: scenes/indoors/kokiri_home3 + xml_path: assets/xml/scenes/indoors/kokiri_home3.xml +- name: scenes/indoors/kokiri_home4 + xml_path: assets/xml/scenes/indoors/kokiri_home4.xml +- name: scenes/indoors/kokiri_home5 + xml_path: assets/xml/scenes/indoors/kokiri_home5.xml +- name: scenes/indoors/labo + xml_path: assets/xml/scenes/indoors/labo.xml +- name: scenes/indoors/link_home + xml_path: assets/xml/scenes/indoors/link_home.xml +- name: scenes/indoors/mahouya + xml_path: assets/xml/scenes/indoors/mahouya.xml +- name: scenes/indoors/malon_stable + xml_path: assets/xml/scenes/indoors/malon_stable.xml +- name: scenes/indoors/miharigoya + xml_path: assets/xml/scenes/indoors/miharigoya.xml +- name: scenes/indoors/nakaniwa + xml_path: assets/xml/scenes/indoors/nakaniwa.xml +- name: scenes/indoors/souko + xml_path: assets/xml/scenes/indoors/souko.xml +- name: scenes/indoors/syatekijyou + xml_path: assets/xml/scenes/indoors/syatekijyou.xml +- name: scenes/indoors/takaraya + xml_path: assets/xml/scenes/indoors/takaraya.xml +- name: scenes/indoors/tent + xml_path: assets/xml/scenes/indoors/tent.xml +- name: scenes/indoors/tokinoma + xml_path: assets/xml/scenes/indoors/tokinoma.xml +- name: scenes/indoors/yousei_izumi_tate + xml_path: assets/xml/scenes/indoors/yousei_izumi_tate.xml +- name: scenes/indoors/yousei_izumi_yoko + xml_path: assets/xml/scenes/indoors/yousei_izumi_yoko.xml +- name: scenes/misc/enrui + xml_path: assets/xml/scenes/misc/enrui.xml +- name: scenes/misc/entra + xml_path: assets/xml/scenes/misc/entra.xml +- name: scenes/misc/entra_n + xml_path: assets/xml/scenes/misc/entra_n.xml +- name: scenes/misc/hakaana + xml_path: assets/xml/scenes/misc/hakaana.xml +- name: scenes/misc/hakaana2 + xml_path: assets/xml/scenes/misc/hakaana2.xml +- name: scenes/misc/hakaana_ouke + xml_path: assets/xml/scenes/misc/hakaana_ouke.xml +- name: scenes/misc/hiral_demo + xml_path: assets/xml/scenes/misc/hiral_demo.xml +- name: scenes/misc/kakariko3 + xml_path: assets/xml/scenes/misc/kakariko3.xml +- name: scenes/misc/kakusiana + xml_path: assets/xml/scenes/misc/kakusiana.xml +- name: scenes/misc/kinsuta + xml_path: assets/xml/scenes/misc/kinsuta.xml +- name: scenes/misc/market_alley + xml_path: assets/xml/scenes/misc/market_alley.xml +- name: scenes/misc/market_alley_n + xml_path: assets/xml/scenes/misc/market_alley_n.xml +- name: scenes/misc/market_day + xml_path: assets/xml/scenes/misc/market_day.xml +- name: scenes/misc/market_night + xml_path: assets/xml/scenes/misc/market_night.xml +- name: scenes/misc/market_ruins + xml_path: assets/xml/scenes/misc/market_ruins.xml +- name: scenes/misc/shrine + xml_path: assets/xml/scenes/misc/shrine.xml +- name: scenes/misc/shrine_n + xml_path: assets/xml/scenes/misc/shrine_n.xml +- name: scenes/misc/shrine_r + xml_path: assets/xml/scenes/misc/shrine_r.xml +- name: scenes/misc/turibori + xml_path: assets/xml/scenes/misc/turibori.xml +- name: scenes/overworld/ganon_tou + xml_path: assets/xml/scenes/overworld/ganon_tou.xml +- name: scenes/overworld/spot00 + xml_path: assets/xml/scenes/overworld/spot00.xml +- name: scenes/overworld/spot01 + xml_path: assets/xml/scenes/overworld/spot01.xml +- name: scenes/overworld/spot02 + xml_path: assets/xml/scenes/overworld/spot02.xml +- name: scenes/overworld/spot03 + xml_path: assets/xml/scenes/overworld/spot03.xml +- name: scenes/overworld/spot04 + xml_path: assets/xml/scenes/overworld/spot04.xml +- name: scenes/overworld/spot05 + xml_path: assets/xml/scenes/overworld/spot05.xml +- name: scenes/overworld/spot06 + xml_path: assets/xml/scenes/overworld/spot06.xml +- name: scenes/overworld/spot07 + xml_path: assets/xml/scenes/overworld/spot07.xml +- name: scenes/overworld/spot08 + xml_path: assets/xml/scenes/overworld/spot08.xml +- name: scenes/overworld/spot09 + xml_path: assets/xml/scenes/overworld/spot09.xml +- name: scenes/overworld/spot10 + xml_path: assets/xml/scenes/overworld/spot10.xml +- name: scenes/overworld/spot11 + xml_path: assets/xml/scenes/overworld/spot11.xml +- name: scenes/overworld/spot12 + xml_path: assets/xml/scenes/overworld/spot12.xml +- name: scenes/overworld/spot13 + xml_path: assets/xml/scenes/overworld/spot13.xml +- name: scenes/overworld/spot15 + xml_path: assets/xml/scenes/overworld/spot15.xml +- name: scenes/overworld/spot16 + xml_path: assets/xml/scenes/overworld/spot16_v2.xml +- name: scenes/overworld/spot17 + xml_path: assets/xml/scenes/overworld/spot17.xml +- name: scenes/overworld/spot18 + xml_path: assets/xml/scenes/overworld/spot18.xml +- name: scenes/overworld/spot20 + xml_path: assets/xml/scenes/overworld/spot20.xml +- name: scenes/shops/alley_shop + xml_path: assets/xml/scenes/shops/alley_shop.xml +- name: scenes/shops/drag + xml_path: assets/xml/scenes/shops/drag.xml +- name: scenes/shops/face_shop + xml_path: assets/xml/scenes/shops/face_shop.xml +- name: scenes/shops/golon + xml_path: assets/xml/scenes/shops/golon.xml +- name: scenes/shops/kokiri_shop + xml_path: assets/xml/scenes/shops/kokiri_shop.xml +- name: scenes/shops/night_shop + xml_path: assets/xml/scenes/shops/night_shop.xml +- name: scenes/shops/shop1 + xml_path: assets/xml/scenes/shops/shop1.xml +- name: scenes/shops/zoora + xml_path: assets/xml/scenes/shops/zoora.xml +- name: textures/backgrounds + xml_path: assets/xml/textures/backgrounds.xml +- name: textures/do_action_static + xml_path: assets/xml/textures/do_action_static.xml +- name: textures/icon_item_24_static + xml_path: assets/xml/textures/icon_item_24_static.xml +- name: textures/icon_item_dungeon_static + xml_path: assets/xml/textures/icon_item_dungeon_static.xml +- name: textures/icon_item_field_static + xml_path: assets/xml/textures/icon_item_field_static.xml +- name: textures/icon_item_gameover_static + xml_path: assets/xml/textures/icon_item_gameover_static.xml +- name: textures/icon_item_jpn_static + xml_path: assets/xml/textures/icon_item_jpn_static.xml +- name: textures/icon_item_nes_static + xml_path: assets/xml/textures/icon_item_nes_static.xml +- name: textures/icon_item_static + xml_path: assets/xml/textures/icon_item_static.xml +- name: textures/item_name_static + xml_path: assets/xml/textures/item_name_static.xml +- name: textures/kanji + xml_path: assets/xml/textures/kanji.xml +- name: textures/map_48x85_static + xml_path: assets/xml/textures/map_48x85_static.xml +- name: textures/map_grand_static + xml_path: assets/xml/textures/map_grand_static.xml +- name: textures/map_i_static + xml_path: assets/xml/textures/map_i_static.xml +- name: textures/map_name_static + xml_path: assets/xml/textures/map_name_static.xml +- name: textures/message_static + xml_path: assets/xml/textures/message_static.xml +- name: textures/message_texture_static + xml_path: assets/xml/textures/message_texture_static.xml +- name: textures/nes_font_static + xml_path: assets/xml/textures/nes_font_static.xml +- name: textures/nintendo_rogo_static + xml_path: assets/xml/textures/nintendo_rogo_static_v2.xml +- name: textures/parameter_static + xml_path: assets/xml/textures/parameter_static.xml +- name: textures/place_title_cards + xml_path: assets/xml/textures/place_title_cards.xml +- name: textures/skyboxes + xml_path: assets/xml/textures/skyboxes.xml +- name: textures/title_static + xml_path: assets/xml/textures/title_static.xml diff --git a/baseroms/gc-jp/segments.csv b/baseroms/gc-jp/segments.csv new file mode 100644 index 0000000000..09c91ec49e --- /dev/null +++ b/baseroms/gc-jp/segments.csv @@ -0,0 +1,1510 @@ +Name,VRAM start +makerom,80000000 +boot,80000460 +dmadata, +Audiobank, +Audioseq, +Audiotable, +kanji, +link_animetion, +icon_item_static, +icon_item_24_static, +icon_item_field_static, +icon_item_dungeon_static, +icon_item_gameover_static, +icon_item_jpn_static, +icon_item_nes_static, +item_name_static, +map_name_static, +do_action_static, +message_static, +message_texture_static, +nes_font_static, +jpn_message_data_static, +nes_message_data_static, +staff_message_data_static, +map_grand_static, +map_48x85_static, +map_i_static, +code,80010EE0 +ovl_title,80800000 +ovl_select,80800870 +ovl_opening,808034F0 +ovl_file_choose,80803650 +ovl_kaleido_scope,808135D0 +ovl_player_actor,8082FDC0 +ovl_map_mark_data,808565A0 +ovl_En_Test,8085D100 +ovl_Arms_Hook,808629B0 +ovl_Arrow_Fire,80863720 +ovl_Arrow_Ice,80865600 +ovl_Arrow_Light,80867500 +ovl_Bg_Bdan_Objects,80869410 +ovl_Bg_Bdan_Switch,8086A6E0 +ovl_Bg_Bom_Guard,8086BB10 +ovl_Bg_Bombwall,8086BD30 +ovl_Bg_Bowl_Wall,8086C5F0 +ovl_Bg_Breakwall,8086CF70 +ovl_Bg_Ddan_Jd,8086DDE0 +ovl_Bg_Ddan_Kd,8086E430 +ovl_Bg_Dodoago,8086ED20 +ovl_Bg_Dy_Yoseizo,8086FAD0 +ovl_Bg_Ganon_Otyuka,808728C0 +ovl_Bg_Gate_Shutter,80874F00 +ovl_Bg_Gjyo_Bridge,80875390 +ovl_Bg_Gnd_Darkmeiro,80875880 +ovl_Bg_Gnd_Firemeiro,80876040 +ovl_Bg_Gnd_Iceblock,80876590 +ovl_Bg_Gnd_Nisekabe,80877690 +ovl_Bg_Gnd_Soulmeiro,80877800 +ovl_Bg_Haka,80878060 +ovl_Bg_Haka_Gate,80878720 +ovl_Bg_Haka_Huta,808797C0 +ovl_Bg_Haka_Megane,8087A260 +ovl_Bg_Haka_MeganeBG,8087A660 +ovl_Bg_Haka_Sgami,8087AD20 +ovl_Bg_Haka_Ship,8087B940 +ovl_Bg_Haka_Trap,8087C390 +ovl_Bg_Haka_Tubo,8087D960 +ovl_Bg_Haka_Water,8087E380 +ovl_Bg_Haka_Zou,8087EB80 +ovl_Bg_Heavy_Block,8087FD70 +ovl_Bg_Hidan_Curtain,80881660 +ovl_Bg_Hidan_Dalm,80882100 +ovl_Bg_Hidan_Firewall,80882950 +ovl_Bg_Hidan_Fslift,808830B0 +ovl_Bg_Hidan_Fwbig,80883580 +ovl_Bg_Hidan_Hamstep,80884260 +ovl_Bg_Hidan_Hrock,80885110 +ovl_Bg_Hidan_Kousi,80885940 +ovl_Bg_Hidan_Kowarerukabe,80885ED0 +ovl_Bg_Hidan_Rock,80886DB0 +ovl_Bg_Hidan_Rsekizou,80887EB0 +ovl_Bg_Hidan_Sekizou,80888A90 +ovl_Bg_Hidan_Sima,80889EE0 +ovl_Bg_Hidan_Syoku,8088ADE0 +ovl_Bg_Ice_Objects,8088B240 +ovl_Bg_Ice_Shelter,8088C180 +ovl_Bg_Ice_Shutter,8088D3C0 +ovl_Bg_Ice_Turara,8088D830 +ovl_Bg_Ingate,8088E060 +ovl_Bg_Jya_1flift,8088E3F0 +ovl_Bg_Jya_Amishutter,8088EA80 +ovl_Bg_Jya_Bigmirror,8088EE10 +ovl_Bg_Jya_Block,8088F660 +ovl_Bg_Jya_Bombchuiwa,8088F8D0 +ovl_Bg_Jya_Bombiwa,80890410 +ovl_Bg_Jya_Cobra,808909D0 +ovl_Bg_Jya_Goroiwa,80892710 +ovl_Bg_Jya_Haheniron,80892E90 +ovl_Bg_Jya_Ironobj,80893680 +ovl_Bg_Jya_Kanaami,80894430 +ovl_Bg_Jya_Lift,808947E0 +ovl_Bg_Jya_Megami,80894D30 +ovl_Bg_Jya_Zurerukabe,80895F20 +ovl_Bg_Menkuri_Eye,808965D0 +ovl_Bg_Menkuri_Kaiten,80896A70 +ovl_Bg_Menkuri_Nisekabe,80896C00 +ovl_Bg_Mizu_Bwall,80896D50 +ovl_Bg_Mizu_Movebg,80898220 +ovl_Bg_Mizu_Shutter,808993B0 +ovl_Bg_Mizu_Uzu,80899BB0 +ovl_Bg_Mizu_Water,80899D80 +ovl_Bg_Mjin,8089AA50 +ovl_Bg_Mori_Bigst,8089AE40 +ovl_Bg_Mori_Elevator,8089B770 +ovl_Bg_Mori_Hashigo,8089C260 +ovl_Bg_Mori_Hashira4,8089CB20 +ovl_Bg_Mori_Hineri,8089D0B0 +ovl_Bg_Mori_Idomizu,8089DE00 +ovl_Bg_Mori_Kaitenkabe,8089E440 +ovl_Bg_Mori_Rakkatenjo,8089EAB0 +ovl_Bg_Po_Event,8089F430 +ovl_Bg_Po_Syokudai,808A1270 +ovl_Bg_Pushbox,808A1BE0 +ovl_Bg_Relay_Objects,808A1EE0 +ovl_Bg_Spot00_Break,808A2690 +ovl_Bg_Spot00_Hanebasi,808A2830 +ovl_Bg_Spot01_Fusya,808A3940 +ovl_Bg_Spot01_Idohashira,808A3BE0 +ovl_Bg_Spot01_Idomizu,808A47E0 +ovl_Bg_Spot01_Idosoko,808A4B00 +ovl_Bg_Spot01_Objects2,808A4D10 +ovl_Bg_Spot02_Objects,808A51D0 +ovl_Bg_Spot03_Taki,808A6530 +ovl_Bg_Spot05_Soko,808A6E50 +ovl_Bg_Spot06_Objects,808A7170 +ovl_Bg_Spot07_Taki,808A8570 +ovl_Bg_Spot08_Bakudankabe,808A8B60 +ovl_Bg_Spot08_Iceblock,808A9200 +ovl_Bg_Spot09_Obj,808AA240 +ovl_Bg_Spot11_Bakudankabe,808AA760 +ovl_Bg_Spot11_Oasis,808AADA0 +ovl_Bg_Spot12_Gate,808AB4D0 +ovl_Bg_Spot12_Saku,808AB8E0 +ovl_Bg_Spot15_Rrbox,808ABDA0 +ovl_Bg_Spot15_Saku,808ACB80 +ovl_Bg_Spot16_Bombstone,808ACEC0 +ovl_Bg_Spot16_Doughnut,808AE410 +ovl_Bg_Spot17_Bakudankabe,808AE9D0 +ovl_Bg_Spot17_Funen,808AF0C0 +ovl_Bg_Spot18_Basket,808AF310 +ovl_Bg_Spot18_Futa,808B0300 +ovl_Bg_Spot18_Obj,808B04A0 +ovl_Bg_Spot18_Shutter,808B0D70 +ovl_Bg_Sst_Floor,808B12C0 +ovl_Bg_Toki_Hikari,808B1820 +ovl_Bg_Toki_Swd,808B25C0 +ovl_Bg_Treemouth,808B3C10 +ovl_Bg_Umajump,808B5270 +ovl_Bg_Vb_Sima,808B5400 +ovl_Bg_Ydan_Hasi,808B5B20 +ovl_Bg_Ydan_Maruta,808B62D0 +ovl_Bg_Ydan_Sp,808B69B0 +ovl_Bg_Zg,808B80D0 +ovl_Boss_Dodongo,808B8520 +ovl_Boss_Fd,808C2020 +ovl_Boss_Fd2,808C9380 +ovl_Boss_Ganon,808CD0B0 +ovl_Boss_Ganon2,808F2EE0 +ovl_Boss_Ganondrof,80905D50 +ovl_Boss_Goma,8090AAE0 +ovl_Boss_Mo,80910A80 +ovl_Boss_Sst,80921060 +ovl_Boss_Tw,8092D630 +ovl_Boss_Va,80943200 +ovl_Demo_6K,8095A490 +ovl_Demo_Du,8095D1F0 +ovl_Demo_Ec,809609D0 +ovl_Demo_Effect,80964230 +ovl_Demo_Ext,80969DD0 +ovl_Demo_Geff,8096A720 +ovl_Demo_Gj,8096AF40 +ovl_Demo_Go,8096EBF0 +ovl_Demo_Gt,8096F940 +ovl_Demo_Ik,80974F50 +ovl_Demo_Im,80976460 +ovl_Demo_Kankyo,8097A3D0 +ovl_Demo_Kekkai,8097E0C0 +ovl_Demo_Sa,8097F3B0 +ovl_Demo_Shd,80981ED0 +ovl_Demo_Tre_Lgt,809842E0 +ovl_Door_Ana,809849F0 +ovl_Door_Gerudo,80985060 +ovl_Door_Killer,80985650 +ovl_Door_Shutter,80986BC0 +ovl_Door_Toki,80988E80 +ovl_Door_Warp1,80988FE0 +ovl_Efc_Erupc,8098D2F0 +ovl_Eff_Dust,8098DDE0 +ovl_Effect_Ss_Blast,8098F1B0 +ovl_Effect_Ss_Bomb,8098F540 +ovl_Effect_Ss_Bomb2,8098F970 +ovl_Effect_Ss_Bubble,80990270 +ovl_Effect_Ss_D_Fire,809906F0 +ovl_Effect_Ss_Dead_Db,80990BE0 +ovl_Effect_Ss_Dead_Dd,809910C0 +ovl_Effect_Ss_Dead_Ds,80991650 +ovl_Effect_Ss_Dead_Sound,80991AD0 +ovl_Effect_Ss_Dt_Bubble,80991C10 +ovl_Effect_Ss_Dust,809921A0 +ovl_Effect_Ss_En_Fire,809929E0 +ovl_Effect_Ss_En_Ice,80993130 +ovl_Effect_Ss_Extra,809939F0 +ovl_Effect_Ss_Fcircle,80993DB0 +ovl_Effect_Ss_Fhg_Flash,80994260 +ovl_Effect_Ss_Fire_Tail,809951E0 +ovl_Effect_Ss_G_Fire,809958E0 +ovl_Effect_Ss_G_Magma,80995B70 +ovl_Effect_Ss_G_Magma2,80995DD0 +ovl_Effect_Ss_G_Ripple,809962E0 +ovl_Effect_Ss_G_Spk,80996840 +ovl_Effect_Ss_G_Splash,80996DF0 +ovl_Effect_Ss_Hahen,809972A0 +ovl_Effect_Ss_HitMark,809978E0 +ovl_Effect_Ss_Ice_Piece,80997E30 +ovl_Effect_Ss_Ice_Smoke,80998270 +ovl_Effect_Ss_K_Fire,80998750 +ovl_Effect_Ss_Kakera,80998B90 +ovl_Effect_Ss_KiraKira,80999C20 +ovl_Effect_Ss_Lightning,8099A290 +ovl_Effect_Ss_Sibuki,8099A960 +ovl_Effect_Ss_Sibuki2,8099B030 +ovl_Effect_Ss_Solder_Srch_Ball,8099B360 +ovl_Effect_Ss_Stick,8099B510 +ovl_Effect_Ss_Stone1,8099B8B0 +ovl_Elf_Msg,8099BC30 +ovl_Elf_Msg2,8099C220 +ovl_En_Am,8099C690 +ovl_En_Ani,8099EA90 +ovl_En_Anubice,8099F800 +ovl_En_Anubice_Fire,809A0AB0 +ovl_En_Anubice_Tag,809A1870 +ovl_En_Arow_Trap,809A1B40 +ovl_En_Arrow,809A1C90 +ovl_En_Attack_Niw,809A3390 +ovl_En_Ba,809A45F0 +ovl_En_Bb,809A64C0 +ovl_En_Bdfire,809AA1A0 +ovl_En_Bigokuta,809AAD40 +ovl_En_Bili,809AD840 +ovl_En_Bird,809AFB10 +ovl_En_Blkobj,809AFFD0 +ovl_En_Bom,809B0530 +ovl_En_Bom_Bowl_Man,809B1400 +ovl_En_Bom_Bowl_Pit,809B2940 +ovl_En_Bom_Chu,809B32B0 +ovl_En_Bombf,809B4950 +ovl_En_Boom,809B5DE0 +ovl_En_Box,809B66B0 +ovl_En_Brob,809B8210 +ovl_En_Bubble,809B9300 +ovl_En_Butte,809BA720 +ovl_En_Bw,809BBCF0 +ovl_En_Bx,809BF080 +ovl_En_Changer,809BFB80 +ovl_En_Clear_Tag,809C0560 +ovl_En_Cow,809CBB00 +ovl_En_Crow,809CCF60 +ovl_En_Cs,809CE600 +ovl_En_Daiku,809CF830 +ovl_En_Daiku_Kakariko,809D0F70 +ovl_En_Dekubaba,809D2330 +ovl_En_Dekunuts,809D5DE0 +ovl_En_Dh,809D75E0 +ovl_En_Dha,809D90C0 +ovl_En_Diving_Game,809DA0C0 +ovl_En_Dns,809DBA70 +ovl_En_Dnt_Demo,809DCE00 +ovl_En_Dnt_Jiji,809DDB20 +ovl_En_Dnt_Nomal,809DF040 +ovl_En_Dodojr,809E1E40 +ovl_En_Dodongo,809E3CE0 +ovl_En_Dog,809E6A80 +ovl_En_Door,809E7C30 +ovl_En_Ds,809E8A70 +ovl_En_Du,809E9690 +ovl_En_Dy_Extra,809EB120 +ovl_En_Eg,809EB6C0 +ovl_En_Eiyer,809EB870 +ovl_En_Elf,809ED4D0 +ovl_En_Encount1,809F1E90 +ovl_En_Encount2,809F29F0 +ovl_En_Ex_Item,809F3C20 +ovl_En_Ex_Ruppy,809F4DA0 +ovl_En_Fd,809F5E60 +ovl_En_Fd_Fire,809F8B00 +ovl_En_Fhg_Fire,809F9810 +ovl_En_Fire_Rock,809FBEB0 +ovl_En_Firefly,809FCFC0 +ovl_En_Fish,809FF130 +ovl_En_Floormas,80A01240 +ovl_En_Fr,80A04620 +ovl_En_Fu,80A070B0 +ovl_En_Fw,80A07E00 +ovl_En_Fz,80A095C0 +ovl_En_G_Switch,80A0B5D0 +ovl_En_Ganon_Mant,80A0CDF0 +ovl_En_Ganon_Organ,80A11020 +ovl_En_Gb,80A18060 +ovl_En_Ge1,80A19790 +ovl_En_Ge2,80A1B7C0 +ovl_En_Ge3,80A1D160 +ovl_En_GeldB,80A1DDA0 +ovl_En_GirlA,80A23150 +ovl_En_Gm,80A25A70 +ovl_En_Go,80A267A0 +ovl_En_Go2,80A2ADE0 +ovl_En_Goma,80A30E20 +ovl_En_Goroiwa,80A33AD0 +ovl_En_Gs,80A35E90 +ovl_En_Guest,80A37D00 +ovl_En_Hata,80A386A0 +ovl_En_Heishi1,80A38C30 +ovl_En_Heishi2,80A3A140 +ovl_En_Heishi3,80A3C340 +ovl_En_Heishi4,80A3CD10 +ovl_En_Hintnuts,80A3DC10 +ovl_En_Holl,80A3F640 +ovl_En_Honotrap,80A40610 +ovl_En_Horse,80A41B70 +ovl_En_Horse_Game_Check,80A4DDD0 +ovl_En_Horse_Ganon,80A4EEA0 +ovl_En_Horse_Link_Child,80A4FC20 +ovl_En_Horse_Normal,80A51A20 +ovl_En_Horse_Zelda,80A54040 +ovl_En_Hs,80A54B30 +ovl_En_Hs2,80A556D0 +ovl_En_Hy,80A55CB0 +ovl_En_Ice_Hono,80A595F0 +ovl_En_Ik,80A5A7E0 +ovl_En_In,80A5EE40 +ovl_En_Insect,80A61BE0 +ovl_En_Ishi,80A64100 +ovl_En_It,80A6D250 +ovl_En_Jj,80A6D3E0 +ovl_En_Js,80A6E9B0 +ovl_En_Jsjutan,80A6F380 +ovl_En_Kakasi,80A74CB0 +ovl_En_Kakasi2,80A759F0 +ovl_En_Kakasi3,80A76110 +ovl_En_Kanban,80A771F0 +ovl_En_Karebaba,80A7A340 +ovl_En_Ko,80A7BC30 +ovl_En_Kusa,80A7FD70 +ovl_En_Kz,80A81250 +ovl_En_Light,80A827F0 +ovl_En_Lightbox,80A835F0 +ovl_En_M_Fire1,80A83A70 +ovl_En_M_Thunder,80A83C10 +ovl_En_Ma1,80A85210 +ovl_En_Ma2,80A864F0 +ovl_En_Ma3,80A87550 +ovl_En_Mag,80A88500 +ovl_En_Mb,80A8D0B0 +ovl_En_Md,80A912E0 +ovl_En_Mk,80A93950 +ovl_En_Mm,80A947E0 +ovl_En_Mm2,80A95E40 +ovl_En_Ms,80A96C00 +ovl_En_Mu,80A972F0 +ovl_En_Nb,80A97C10 +ovl_En_Niw,80A9C1E0 +ovl_En_Niw_Girl,80A9F510 +ovl_En_Niw_Lady,80A9FFE0 +ovl_En_Nutsball,80AA18E0 +ovl_En_Nwc,80AA1F00 +ovl_En_Ny,80AA2920 +ovl_En_OE2,80AA4260 +ovl_En_Okarina_Effect,80AA4340 +ovl_En_Okarina_Tag,80AA4700 +ovl_En_Okuta,80AA5C00 +ovl_En_Ossan,80AA81E0 +ovl_En_Owl,80AAE7C0 +ovl_En_Part,80AB2360 +ovl_En_Peehat,80AB39C0 +ovl_En_Po_Desert,80AB70C0 +ovl_En_Po_Field,80AB7E80 +ovl_En_Po_Relay,80ABB910 +ovl_En_Po_Sisters,80ABD020 +ovl_En_Poh,80AC1D10 +ovl_En_Pu_box,80AC5F00 +ovl_En_Rd,80AC6240 +ovl_En_Reeba,80AC8B00 +ovl_En_River_Sound,80ACA570 +ovl_En_Rl,80ACAF00 +ovl_En_Rr,80ACBDE0 +ovl_En_Ru1,80ACE310 +ovl_En_Ru2,80AD59B0 +ovl_En_Sa,80AD8730 +ovl_En_Sb,80ADA9A0 +ovl_En_Scene_Change,80ADBDE0 +ovl_En_Sda,80ADBF10 +ovl_En_Shopnuts,80ADD600 +ovl_En_Si,80ADE510 +ovl_En_Siofuki,80ADEA10 +ovl_En_Skb,80ADF7C0 +ovl_En_Skj,80AE10B0 +ovl_En_Skjneedle,80AE4A00 +ovl_En_Ssh,80AE4D10 +ovl_En_St,80AE7300 +ovl_En_Sth,80AE9F70 +ovl_En_Stream,80AEE030 +ovl_En_Sw,80AEE5C0 +ovl_En_Syateki_Itm,80AF1DB0 +ovl_En_Syateki_Man,80AF2B50 +ovl_En_Syateki_Niw,80AF3910 +ovl_En_Ta,80AF59A0 +ovl_En_Takara_Man,80AF9360 +ovl_En_Tana,80AF9C20 +ovl_En_Tg,80AF9ED0 +ovl_En_Tite,80AFA5B0 +ovl_En_Tk,80AFD350 +ovl_En_Torch,80AFF180 +ovl_En_Torch2,80AFF270 +ovl_En_Toryo,80B01A10 +ovl_En_Tp,80B026A0 +ovl_En_Tr,80B04510 +ovl_En_Trap,80B05E10 +ovl_En_Tubo_Trap,80B070B0 +ovl_En_Vali,80B07D50 +ovl_En_Vase,80B0A410 +ovl_En_Vb_Ball,80B0A510 +ovl_En_Viewer,80B0B6C0 +ovl_En_Vm,80B0E580 +ovl_En_Wall_Tubo,80B0FE40 +ovl_En_Wallmas,80B10330 +ovl_En_Weather_Tag,80B11D40 +ovl_En_Weiyer,80B12C30 +ovl_En_Wf,80B14630 +ovl_En_Wonder_Item,80B18940 +ovl_En_Wonder_Talk,80B19670 +ovl_En_Wonder_Talk2,80B19D00 +ovl_En_Wood02,80B1A3A0 +ovl_En_Xc,80B1B580 +ovl_En_Yabusame_Mark,80B21D10 +ovl_En_Yukabyun,80B223E0 +ovl_En_Zf,80B229F0 +ovl_En_Zl1,80B294E0 +ovl_En_Zl2,80B2D2F0 +ovl_En_Zl3,80B319F0 +ovl_En_Zl4,80B39840 +ovl_En_Zo,80B3E270 +ovl_En_fHG,80B40830 +ovl_End_Title,80B43160 +ovl_Fishing,80B47280 +ovl_Item_B_Heart,80B61E20 +ovl_Item_Etcetera,80B62230 +ovl_Item_Inbox,80B62B00 +ovl_Item_Ocarina,80B62C60 +ovl_Item_Shield,80B63430 +ovl_Magic_Dark,80B63E40 +ovl_Magic_Fire,80B65690 +ovl_Magic_Wind,80B67990 +ovl_Mir_Ray,80B69690 +ovl_Obj_Bean,80B6AF40 +ovl_Obj_Blockstop,80B6D6D0 +ovl_Obj_Bombiwa,80B6D870 +ovl_Obj_Comb,80B6DDE0 +ovl_Obj_Dekujr,80B6E640 +ovl_Obj_Elevator,80B6EC80 +ovl_Obj_Hamishi,80B6F040 +ovl_Obj_Hana,80B6F890 +ovl_Obj_Hsblock,80B6FBA0 +ovl_Obj_Ice_Poly,80B70170 +ovl_Obj_Kibako,80B70B20 +ovl_Obj_Kibako2,80B71820 +ovl_Obj_Lift,80B71EE0 +ovl_Obj_Lightswitch,80B72900 +ovl_Obj_Makekinsuta,80B73D30 +ovl_Obj_Makeoshihiki,80B73E80 +ovl_Obj_Mure,80B74310 +ovl_Obj_Mure2,80B75320 +ovl_Obj_Mure3,80B75D40 +ovl_Obj_Oshihiki,80B76510 +ovl_Obj_Roomtimer,80B77FC0 +ovl_Obj_Switch,80B78210 +ovl_Obj_Syokudai,80B79FF0 +ovl_Obj_Timeblock,80B7AC40 +ovl_Obj_Tsubo,80B7B890 +ovl_Obj_Warp2block,80B7C880 +ovl_Object_Kankyo,80B7D3B0 +ovl_Oceff_Spot,80B80630 +ovl_Oceff_Storm,80B81560 +ovl_Oceff_Wipe,80B83110 +ovl_Oceff_Wipe2,80B83E90 +ovl_Oceff_Wipe3,80B85600 +ovl_Oceff_Wipe4,80B86D50 +ovl_Shot_Sun,80B87D30 +gameplay_keep, +gameplay_field_keep, +gameplay_dangeon_keep, +gameplay_object_exchange_static, +object_link_boy, +object_link_child, +object_box, +object_human, +object_okuta, +object_poh, +object_wallmaster, +object_dy_obj, +object_firefly, +object_dodongo, +object_fire, +object_niw, +object_tite, +object_reeba, +object_peehat, +object_kingdodongo, +object_horse, +object_zf, +object_goma, +object_zl1, +object_gol, +object_bubble, +object_dodojr, +object_torch2, +object_bl, +object_tp, +object_oA1, +object_st, +object_bw, +object_ei, +object_horse_normal, +object_oB1, +object_o_anime, +object_spot04_objects, +object_ddan_objects, +object_hidan_objects, +object_horse_ganon, +object_oA2, +object_spot00_objects, +object_mb, +object_bombf, +object_sk2, +object_oE1, +object_oE_anime, +object_oE2, +object_ydan_objects, +object_gnd, +object_am, +object_dekubaba, +object_oA3, +object_oA4, +object_oA5, +object_oA6, +object_oA7, +object_jj, +object_oA8, +object_oA9, +object_oB2, +object_oB3, +object_oB4, +object_horse_zelda, +object_opening_demo1, +object_warp1, +object_b_heart, +object_dekunuts, +object_oE3, +object_oE4, +object_menkuri_objects, +object_oE5, +object_oE6, +object_oE7, +object_oE8, +object_oE9, +object_oE10, +object_oE11, +object_oE12, +object_vali, +object_oA10, +object_oA11, +object_mizu_objects, +object_fhg, +object_ossan, +object_mori_hineri1, +object_Bb, +object_toki_objects, +object_yukabyun, +object_zl2, +object_mjin, +object_mjin_flash, +object_mjin_dark, +object_mjin_flame, +object_mjin_ice, +object_mjin_soul, +object_mjin_wind, +object_mjin_oka, +object_haka_objects, +object_spot06_objects, +object_ice_objects, +object_relay_objects, +object_mori_hineri1a, +object_mori_hineri2, +object_mori_hineri2a, +object_mori_objects, +object_mori_tex, +object_spot08_obj, +object_warp2, +object_hata, +object_bird, +object_wood02, +object_lightbox, +object_pu_box, +object_trap, +object_vase, +object_im, +object_ta, +object_tk, +object_xc, +object_vm, +object_bv, +object_hakach_objects, +object_efc_crystal_light, +object_efc_fire_ball, +object_efc_flash, +object_efc_lgt_shower, +object_efc_star_field, +object_god_lgt, +object_light_ring, +object_triforce_spot, +object_medal, +object_bdan_objects, +object_sd, +object_rd, +object_po_sisters, +object_heavy_object, +object_gndd, +object_fd, +object_du, +object_fw, +object_horse_link_child, +object_spot02_objects, +object_haka, +object_ru1, +object_syokudai, +object_fd2, +object_dh, +object_rl, +object_efc_tw, +object_demo_tre_lgt, +object_gi_key, +object_mir_ray, +object_brob, +object_gi_jewel, +object_spot09_obj, +object_spot18_obj, +object_bdoor, +object_spot17_obj, +object_shop_dungen, +object_nb, +object_mo, +object_sb, +object_gi_melody, +object_gi_heart, +object_gi_compass, +object_gi_bosskey, +object_gi_medal, +object_gi_nuts, +object_sa, +object_gi_hearts, +object_gi_arrowcase, +object_gi_bombpouch, +object_in, +object_tr, +object_spot16_obj, +object_oE1s, +object_oE4s, +object_os_anime, +object_gi_bottle, +object_gi_stick, +object_gi_map, +object_oF1d_map, +object_ru2, +object_gi_shield_1, +object_dekujr, +object_gi_magicpot, +object_gi_bomb_1, +object_oF1s, +object_ma2, +object_gi_purse, +object_hni, +object_tw, +object_rr, +object_bxa, +object_anubice, +object_gi_gerudo, +object_gi_arrow, +object_gi_bomb_2, +object_gi_egg, +object_gi_scale, +object_gi_shield_2, +object_gi_hookshot, +object_gi_ocarina, +object_gi_milk, +object_ma1, +object_ganon, +object_sst, +object_ny, +object_fr, +object_gi_pachinko, +object_gi_boomerang, +object_gi_bow, +object_gi_glasses, +object_gi_liquid, +object_ani, +object_demo_6k, +object_gi_shield_3, +object_gi_letter, +object_spot15_obj, +object_jya_obj, +object_gi_clothes, +object_gi_bean, +object_gi_fish, +object_gi_saw, +object_gi_hammer, +object_gi_grass, +object_gi_longsword, +object_spot01_objects, +object_md, +object_km1, +object_kw1, +object_zo, +object_kz, +object_umajump, +object_masterkokiri, +object_masterkokirihead, +object_mastergolon, +object_masterzoora, +object_aob, +object_ik, +object_ahg, +object_cne, +object_gi_niwatori, +object_skj, +object_gi_bottle_letter, +object_bji, +object_bba, +object_gi_ocarina_0, +object_ds, +object_ane, +object_boj, +object_spot03_object, +object_spot07_object, +object_fz, +object_bob, +object_ge1, +object_yabusame_point, +object_gi_boots_2, +object_gi_seed, +object_gnd_magic, +object_d_elevator, +object_d_hsblock, +object_d_lift, +object_mamenoki, +object_goroiwa, +object_toryo, +object_daiku, +object_nwc, +object_blkobj, +object_gm, +object_ms, +object_hs, +object_ingate, +object_lightswitch, +object_kusa, +object_tsubo, +object_gi_gloves, +object_gi_coin, +object_kanban, +object_gjyo_objects, +object_owl, +object_mk, +object_fu, +object_gi_ki_tan_mask, +object_gi_redead_mask, +object_gi_skj_mask, +object_gi_rabit_mask, +object_gi_truth_mask, +object_ganon_objects, +object_siofuki, +object_stream, +object_mm, +object_fa, +object_os, +object_gi_eye_lotion, +object_gi_powder, +object_gi_mushroom, +object_gi_ticketstone, +object_gi_brokensword, +object_js, +object_cs, +object_gi_prescription, +object_gi_bracelet, +object_gi_soldout, +object_gi_frog, +object_mag, +object_door_gerudo, +object_gt, +object_efc_erupc, +object_zl2_anime1, +object_zl2_anime2, +object_gi_golonmask, +object_gi_zoramask, +object_gi_gerudomask, +object_ganon2, +object_ka, +object_ts, +object_zg, +object_gi_hoverboots, +object_gi_m_arrow, +object_ds2, +object_ec, +object_fish, +object_gi_sutaru, +object_gi_goddess, +object_ssh, +object_bigokuta, +object_bg, +object_spot05_objects, +object_spot12_obj, +object_bombiwa, +object_hintnuts, +object_rs, +object_spot00_break, +object_gla, +object_shopnuts, +object_geldb, +object_gr, +object_dog, +object_jya_iron, +object_jya_door, +object_spot01_objects2, +object_spot11_obj, +object_kibako2, +object_dns, +object_dnk, +object_gi_fire, +object_gi_insect, +object_gi_butterfly, +object_gi_ghost, +object_gi_soul, +object_bowl, +object_po_field, +object_demo_kekkai, +object_efc_doughnut, +object_gi_dekupouch, +object_ganon_anime1, +object_ganon_anime2, +object_ganon_anime3, +object_gi_rupy, +object_spot01_matoya, +object_spot01_matoyab, +object_po_composer, +object_mu, +object_wf, +object_skb, +object_gj, +object_geff, +object_haka_door, +object_gs, +object_ps, +object_bwall, +object_crow, +object_cow, +object_cob, +object_gi_sword_1, +object_door_killer, +object_ouke_haka, +object_timeblock, +object_zl4, +g_pn_01, +g_pn_02, +g_pn_03, +g_pn_04, +g_pn_05, +g_pn_06, +g_pn_07, +g_pn_08, +g_pn_09, +g_pn_10, +g_pn_11, +g_pn_12, +g_pn_13, +g_pn_14, +g_pn_15, +g_pn_16, +g_pn_17, +g_pn_18, +g_pn_19, +g_pn_20, +g_pn_21, +g_pn_22, +g_pn_23, +g_pn_24, +g_pn_25, +g_pn_26, +g_pn_27, +g_pn_28, +g_pn_29, +g_pn_30, +g_pn_31, +g_pn_32, +g_pn_33, +g_pn_34, +g_pn_35, +g_pn_36, +g_pn_37, +g_pn_38, +g_pn_39, +g_pn_40, +g_pn_41, +g_pn_42, +g_pn_43, +g_pn_44, +g_pn_45, +g_pn_46, +g_pn_47, +g_pn_48, +g_pn_49, +g_pn_50, +g_pn_51, +g_pn_52, +g_pn_53, +g_pn_54, +g_pn_55, +g_pn_56, +g_pn_57, +z_select_static, +nintendo_rogo_static, +title_static, +parameter_static, +vr_fine0_static, +vr_fine0_pal_static, +vr_fine1_static, +vr_fine1_pal_static, +vr_fine2_static, +vr_fine2_pal_static, +vr_fine3_static, +vr_fine3_pal_static, +vr_cloud0_static, +vr_cloud0_pal_static, +vr_cloud1_static, +vr_cloud1_pal_static, +vr_cloud2_static, +vr_cloud2_pal_static, +vr_cloud3_static, +vr_cloud3_pal_static, +vr_holy0_static, +vr_holy0_pal_static, +vr_holy1_static, +vr_holy1_pal_static, +vr_MDVR_static, +vr_MDVR_pal_static, +vr_MNVR_static, +vr_MNVR_pal_static, +vr_RUVR_static, +vr_RUVR_pal_static, +vr_LHVR_static, +vr_LHVR_pal_static, +vr_KHVR_static, +vr_KHVR_pal_static, +vr_K3VR_static, +vr_K3VR_pal_static, +vr_K4VR_static, +vr_K4VR_pal_static, +vr_K5VR_static, +vr_K5VR_pal_static, +vr_SP1a_static, +vr_SP1a_pal_static, +vr_MLVR_static, +vr_MLVR_pal_static, +vr_KKRVR_static, +vr_KKRVR_pal_static, +vr_KR3VR_static, +vr_KR3VR_pal_static, +vr_IPVR_static, +vr_IPVR_pal_static, +vr_KSVR_static, +vr_KSVR_pal_static, +vr_GLVR_static, +vr_GLVR_pal_static, +vr_ZRVR_static, +vr_ZRVR_pal_static, +vr_DGVR_static, +vr_DGVR_pal_static, +vr_ALVR_static, +vr_ALVR_pal_static, +vr_NSVR_static, +vr_NSVR_pal_static, +vr_LBVR_static, +vr_LBVR_pal_static, +vr_TTVR_static, +vr_TTVR_pal_static, +vr_FCVR_static, +vr_FCVR_pal_static, +elf_message_field, +elf_message_ydan, +ydan_scene, +ydan_room_0, +ydan_room_1, +ydan_room_2, +ydan_room_3, +ydan_room_4, +ydan_room_5, +ydan_room_6, +ydan_room_7, +ydan_room_8, +ydan_room_9, +ydan_room_10, +ydan_room_11, +ddan_scene, +ddan_room_0, +ddan_room_1, +ddan_room_2, +ddan_room_3, +ddan_room_4, +ddan_room_5, +ddan_room_6, +ddan_room_7, +ddan_room_8, +ddan_room_9, +ddan_room_10, +ddan_room_11, +ddan_room_12, +ddan_room_13, +ddan_room_14, +ddan_room_15, +ddan_room_16, +bdan_scene, +bdan_room_0, +bdan_room_1, +bdan_room_2, +bdan_room_3, +bdan_room_4, +bdan_room_5, +bdan_room_6, +bdan_room_7, +bdan_room_8, +bdan_room_9, +bdan_room_10, +bdan_room_11, +bdan_room_12, +bdan_room_13, +bdan_room_14, +bdan_room_15, +Bmori1_scene, +Bmori1_room_0, +Bmori1_room_1, +Bmori1_room_2, +Bmori1_room_3, +Bmori1_room_4, +Bmori1_room_5, +Bmori1_room_6, +Bmori1_room_7, +Bmori1_room_8, +Bmori1_room_9, +Bmori1_room_10, +Bmori1_room_11, +Bmori1_room_12, +Bmori1_room_13, +Bmori1_room_14, +Bmori1_room_15, +Bmori1_room_16, +Bmori1_room_17, +Bmori1_room_18, +Bmori1_room_19, +Bmori1_room_20, +Bmori1_room_21, +Bmori1_room_22, +HIDAN_scene, +HIDAN_room_0, +HIDAN_room_1, +HIDAN_room_2, +HIDAN_room_3, +HIDAN_room_4, +HIDAN_room_5, +HIDAN_room_6, +HIDAN_room_7, +HIDAN_room_8, +HIDAN_room_9, +HIDAN_room_10, +HIDAN_room_11, +HIDAN_room_12, +HIDAN_room_13, +HIDAN_room_14, +HIDAN_room_15, +HIDAN_room_16, +HIDAN_room_17, +HIDAN_room_18, +HIDAN_room_19, +HIDAN_room_20, +HIDAN_room_21, +HIDAN_room_22, +HIDAN_room_23, +HIDAN_room_24, +HIDAN_room_25, +HIDAN_room_26, +MIZUsin_scene, +MIZUsin_room_0, +MIZUsin_room_1, +MIZUsin_room_2, +MIZUsin_room_3, +MIZUsin_room_4, +MIZUsin_room_5, +MIZUsin_room_6, +MIZUsin_room_7, +MIZUsin_room_8, +MIZUsin_room_9, +MIZUsin_room_10, +MIZUsin_room_11, +MIZUsin_room_12, +MIZUsin_room_13, +MIZUsin_room_14, +MIZUsin_room_15, +MIZUsin_room_16, +MIZUsin_room_17, +MIZUsin_room_18, +MIZUsin_room_19, +MIZUsin_room_20, +MIZUsin_room_21, +MIZUsin_room_22, +jyasinzou_scene, +jyasinzou_room_0, +jyasinzou_room_1, +jyasinzou_room_2, +jyasinzou_room_3, +jyasinzou_room_4, +jyasinzou_room_5, +jyasinzou_room_6, +jyasinzou_room_7, +jyasinzou_room_8, +jyasinzou_room_9, +jyasinzou_room_10, +jyasinzou_room_11, +jyasinzou_room_12, +jyasinzou_room_13, +jyasinzou_room_14, +jyasinzou_room_15, +jyasinzou_room_16, +jyasinzou_room_17, +jyasinzou_room_18, +jyasinzou_room_19, +jyasinzou_room_20, +jyasinzou_room_21, +jyasinzou_room_22, +jyasinzou_room_23, +jyasinzou_room_24, +jyasinzou_room_25, +jyasinzou_room_26, +jyasinzou_room_27, +jyasinzou_room_28, +HAKAdan_scene, +HAKAdan_room_0, +HAKAdan_room_1, +HAKAdan_room_2, +HAKAdan_room_3, +HAKAdan_room_4, +HAKAdan_room_5, +HAKAdan_room_6, +HAKAdan_room_7, +HAKAdan_room_8, +HAKAdan_room_9, +HAKAdan_room_10, +HAKAdan_room_11, +HAKAdan_room_12, +HAKAdan_room_13, +HAKAdan_room_14, +HAKAdan_room_15, +HAKAdan_room_16, +HAKAdan_room_17, +HAKAdan_room_18, +HAKAdan_room_19, +HAKAdan_room_20, +HAKAdan_room_21, +HAKAdan_room_22, +HAKAdanCH_scene, +HAKAdanCH_room_0, +HAKAdanCH_room_1, +HAKAdanCH_room_2, +HAKAdanCH_room_3, +HAKAdanCH_room_4, +HAKAdanCH_room_5, +HAKAdanCH_room_6, +ice_doukutu_scene, +ice_doukutu_room_0, +ice_doukutu_room_1, +ice_doukutu_room_2, +ice_doukutu_room_3, +ice_doukutu_room_4, +ice_doukutu_room_5, +ice_doukutu_room_6, +ice_doukutu_room_7, +ice_doukutu_room_8, +ice_doukutu_room_9, +ice_doukutu_room_10, +ice_doukutu_room_11, +men_scene, +men_room_0, +men_room_1, +men_room_2, +men_room_3, +men_room_4, +men_room_5, +men_room_6, +men_room_7, +men_room_8, +men_room_9, +men_room_10, +ganontika_scene, +ganontika_room_0, +ganontika_room_1, +ganontika_room_2, +ganontika_room_3, +ganontika_room_4, +ganontika_room_5, +ganontika_room_6, +ganontika_room_7, +ganontika_room_8, +ganontika_room_9, +ganontika_room_10, +ganontika_room_11, +ganontika_room_12, +ganontika_room_13, +ganontika_room_14, +ganontika_room_15, +ganontika_room_16, +ganontika_room_17, +ganontika_room_18, +ganontika_room_19, +spot00_scene, +spot00_room_0, +spot01_scene, +spot01_room_0, +spot02_scene, +spot02_room_0, +spot02_room_1, +spot03_scene, +spot03_room_0, +spot03_room_1, +spot04_scene, +spot04_room_0, +spot04_room_1, +spot04_room_2, +spot05_scene, +spot05_room_0, +spot06_scene, +spot06_room_0, +spot07_scene, +spot07_room_0, +spot07_room_1, +spot08_scene, +spot08_room_0, +spot09_scene, +spot09_room_0, +spot10_scene, +spot10_room_0, +spot10_room_1, +spot10_room_2, +spot10_room_3, +spot10_room_4, +spot10_room_5, +spot10_room_6, +spot10_room_7, +spot10_room_8, +spot10_room_9, +spot11_scene, +spot11_room_0, +spot12_scene, +spot12_room_0, +spot12_room_1, +spot13_scene, +spot13_room_0, +spot13_room_1, +spot15_scene, +spot15_room_0, +spot16_scene, +spot16_room_0, +spot17_scene, +spot17_room_0, +spot17_room_1, +spot18_scene, +spot18_room_0, +spot18_room_1, +spot18_room_2, +spot18_room_3, +market_day_scene, +market_day_room_0, +market_night_scene, +market_night_room_0, +kenjyanoma_scene, +kenjyanoma_room_0, +tokinoma_scene, +tokinoma_room_0, +tokinoma_room_1, +link_home_scene, +link_home_room_0, +kokiri_shop_scene, +kokiri_shop_room_0, +kokiri_home_scene, +kokiri_home_room_0, +kakusiana_scene, +kakusiana_room_0, +kakusiana_room_1, +kakusiana_room_2, +kakusiana_room_3, +kakusiana_room_4, +kakusiana_room_5, +kakusiana_room_6, +kakusiana_room_7, +kakusiana_room_8, +kakusiana_room_9, +kakusiana_room_10, +kakusiana_room_11, +kakusiana_room_12, +kakusiana_room_13, +entra_scene, +entra_room_0, +moribossroom_scene, +moribossroom_room_0, +moribossroom_room_1, +syatekijyou_scene, +syatekijyou_room_0, +shop1_scene, +shop1_room_0, +hairal_niwa_scene, +hairal_niwa_room_0, +ganon_tou_scene, +ganon_tou_room_0, +market_alley_scene, +market_alley_room_0, +spot20_scene, +spot20_room_0, +market_ruins_scene, +market_ruins_room_0, +entra_n_scene, +entra_n_room_0, +enrui_scene, +enrui_room_0, +market_alley_n_scene, +market_alley_n_room_0, +hiral_demo_scene, +hiral_demo_room_0, +kokiri_home3_scene, +kokiri_home3_room_0, +malon_stable_scene, +malon_stable_room_0, +kakariko_scene, +kakariko_room_0, +bdan_boss_scene, +bdan_boss_room_0, +bdan_boss_room_1, +FIRE_bs_scene, +FIRE_bs_room_0, +FIRE_bs_room_1, +hut_scene, +hut_room_0, +daiyousei_izumi_scene, +daiyousei_izumi_room_0, +hakaana_scene, +hakaana_room_0, +yousei_izumi_tate_scene, +yousei_izumi_tate_room_0, +yousei_izumi_yoko_scene, +yousei_izumi_yoko_room_0, +golon_scene, +golon_room_0, +zoora_scene, +zoora_room_0, +drag_scene, +drag_room_0, +alley_shop_scene, +alley_shop_room_0, +night_shop_scene, +night_shop_room_0, +impa_scene, +impa_room_0, +labo_scene, +labo_room_0, +tent_scene, +tent_room_0, +nakaniwa_scene, +nakaniwa_room_0, +ddan_boss_scene, +ddan_boss_room_0, +ddan_boss_room_1, +ydan_boss_scene, +ydan_boss_room_0, +ydan_boss_room_1, +HAKAdan_bs_scene, +HAKAdan_bs_room_0, +HAKAdan_bs_room_1, +MIZUsin_bs_scene, +MIZUsin_bs_room_0, +MIZUsin_bs_room_1, +ganon_scene, +ganon_room_0, +ganon_room_1, +ganon_room_2, +ganon_room_3, +ganon_room_4, +ganon_room_5, +ganon_room_6, +ganon_room_7, +ganon_room_8, +ganon_room_9, +ganon_boss_scene, +ganon_boss_room_0, +jyasinboss_scene, +jyasinboss_room_0, +jyasinboss_room_1, +jyasinboss_room_2, +jyasinboss_room_3, +kokiri_home4_scene, +kokiri_home4_room_0, +kokiri_home5_scene, +kokiri_home5_room_0, +ganon_final_scene, +ganon_final_room_0, +kakariko3_scene, +kakariko3_room_0, +hakasitarelay_scene, +hakasitarelay_room_0, +hakasitarelay_room_1, +hakasitarelay_room_2, +hakasitarelay_room_3, +hakasitarelay_room_4, +hakasitarelay_room_5, +hakasitarelay_room_6, +shrine_scene, +shrine_room_0, +turibori_scene, +turibori_room_0, +shrine_n_scene, +shrine_n_room_0, +shrine_r_scene, +shrine_r_room_0, +hakaana2_scene, +hakaana2_room_0, +gerudoway_scene, +gerudoway_room_0, +gerudoway_room_1, +gerudoway_room_2, +gerudoway_room_3, +gerudoway_room_4, +gerudoway_room_5, +hairal_niwa_n_scene, +hairal_niwa_n_room_0, +bowling_scene, +bowling_room_0, +hakaana_ouke_scene, +hakaana_ouke_room_0, +hakaana_ouke_room_1, +hakaana_ouke_room_2, +hylia_labo_scene, +hylia_labo_room_0, +souko_scene, +souko_room_0, +souko_room_1, +souko_room_2, +miharigoya_scene, +miharigoya_room_0, +mahouya_scene, +mahouya_room_0, +takaraya_scene, +takaraya_room_0, +takaraya_room_1, +takaraya_room_2, +takaraya_room_3, +takaraya_room_4, +takaraya_room_5, +takaraya_room_6, +ganon_sonogo_scene, +ganon_sonogo_room_0, +ganon_sonogo_room_1, +ganon_sonogo_room_2, +ganon_sonogo_room_3, +ganon_sonogo_room_4, +ganon_demo_scene, +ganon_demo_room_0, +face_shop_scene, +face_shop_room_0, +kinsuta_scene, +kinsuta_room_0, +ganontikasonogo_scene, +ganontikasonogo_room_0, +ganontikasonogo_room_1, +bump_texture_static, +anime_model_1_static, +anime_model_2_static, +anime_model_3_static, +anime_model_4_static, +anime_model_5_static, +anime_model_6_static, +anime_texture_1_static, +anime_texture_2_static, +anime_texture_3_static, +anime_texture_4_static, +anime_texture_5_static, +anime_texture_6_static, +softsprite_matrix_static, diff --git a/baseroms/gc-us-mq/checksum-compressed.md5 b/baseroms/gc-us-mq/checksum-compressed.md5 new file mode 100644 index 0000000000..9288d12116 --- /dev/null +++ b/baseroms/gc-us-mq/checksum-compressed.md5 @@ -0,0 +1 @@ +da35577fe54579f6a266931cc75f512d build/gc-us-mq/oot-gc-us-mq-compressed.z64 diff --git a/baseroms/gc-us-mq/checksum.md5 b/baseroms/gc-us-mq/checksum.md5 new file mode 100644 index 0000000000..5d07400cc5 --- /dev/null +++ b/baseroms/gc-us-mq/checksum.md5 @@ -0,0 +1 @@ +3f0d68ac5b8a9dc3898655025db474dd build/gc-us-mq/oot-gc-us-mq.z64 diff --git a/baseroms/gc-us-mq/config.yml b/baseroms/gc-us-mq/config.yml new file mode 100644 index 0000000000..df026951f4 --- /dev/null +++ b/baseroms/gc-us-mq/config.yml @@ -0,0 +1,1212 @@ +dmadata_start: 0x7170 +text_lang_pal: false +incbins: + - name: ipl3 + segment: makerom + vram: 0x80000040 + size: 0xFC0 + - name: rspbootText + segment: boot + vram: 0x80005FC0 + size: 0xD0 + - name: aspMainText + segment: code + vram: 0x800E3820 + size: 0xFB0 + - name: gspS2DEX2d_fifoText + segment: code + vram: 0x800E47D0 + size: 0x18C0 + - name: njpgdspMainText + segment: code + vram: 0x800E6090 + size: 0xAF0 + - name: aspMainData + segment: code + vram: 0x80113800 + size: 0x2E0 + - name: gspF3DZEX2_NoN_PosLight_fifoText + segment: code + vram: 0x80113AE0 + size: 0x1630 + - name: gspF3DZEX2_NoN_PosLight_fifoData + segment: code + vram: 0x80115110 + size: 0x420 + - name: gspS2DEX2d_fifoData + segment: code + vram: 0x80115530 + size: 0x390 + - name: njpgdspMainData + segment: code + vram: 0x801158C0 + size: 0x60 +variables: + gMtxClear: 0x800FE280 + sJpnMessageEntryTable: 0x80109E6C + sNesMessageEntryTable: 0x8010DFAC + sStaffMessageEntryTable: 0x801121CC + gSoundFontTable: 0x80112C60 + gSequenceFontTable: 0x80112ED0 + gSequenceTable: 0x80113090 + gSampleBankTable: 0x80113780 + sShadowTex: 0x80A740B0 +assets: +- name: code/fbdemo_circle + xml_path: assets/xml/code/fbdemo_circle.xml + start_offset: 0xEB748 + end_offset: 0xEC968 +- name: code/fbdemo_triforce + xml_path: assets/xml/code/fbdemo_triforce.xml + start_offset: 0xEABD0 + end_offset: 0xEACA0 +- name: code/fbdemo_wipe1 + xml_path: assets/xml/code/fbdemo_wipe1.xml + start_offset: 0xEACA0 + end_offset: 0xEB630 +- name: misc/link_animetion + xml_path: assets/xml/misc/link_animetion.xml +- name: misc/z_select_static + xml_path: assets/xml/misc/z_select_static.xml +- name: objects/gameplay_dangeon_keep + xml_path: assets/xml/objects/gameplay_dangeon_keep.xml +- name: objects/gameplay_field_keep + xml_path: assets/xml/objects/gameplay_field_keep.xml +- name: objects/gameplay_keep + xml_path: assets/xml/objects/gameplay_keep.xml +- name: objects/object_ahg + xml_path: assets/xml/objects/object_ahg.xml +- name: objects/object_am + xml_path: assets/xml/objects/object_am.xml +- name: objects/object_ane + xml_path: assets/xml/objects/object_ane.xml +- name: objects/object_ani + xml_path: assets/xml/objects/object_ani.xml +- name: objects/object_anubice + xml_path: assets/xml/objects/object_anubice.xml +- name: objects/object_aob + xml_path: assets/xml/objects/object_aob.xml +- name: objects/object_b_heart + xml_path: assets/xml/objects/object_b_heart.xml +- name: objects/object_Bb + xml_path: assets/xml/objects/object_Bb.xml +- name: objects/object_bba + xml_path: assets/xml/objects/object_bba.xml +- name: objects/object_bdan_objects + xml_path: assets/xml/objects/object_bdan_objects.xml +- name: objects/object_bdoor + xml_path: assets/xml/objects/object_bdoor.xml +- name: objects/object_bg + xml_path: assets/xml/objects/object_bg.xml +- name: objects/object_bigokuta + xml_path: assets/xml/objects/object_bigokuta.xml +- name: objects/object_bird + xml_path: assets/xml/objects/object_bird.xml +- name: objects/object_bji + xml_path: assets/xml/objects/object_bji.xml +- name: objects/object_bl + xml_path: assets/xml/objects/object_bl.xml +- name: objects/object_blkobj + xml_path: assets/xml/objects/object_blkobj.xml +- name: objects/object_bob + xml_path: assets/xml/objects/object_bob.xml +- name: objects/object_boj + xml_path: assets/xml/objects/object_boj.xml +- name: objects/object_bombf + xml_path: assets/xml/objects/object_bombf.xml +- name: objects/object_bombiwa + xml_path: assets/xml/objects/object_bombiwa.xml +- name: objects/object_bowl + xml_path: assets/xml/objects/object_bowl.xml +- name: objects/object_box + xml_path: assets/xml/objects/object_box.xml +- name: objects/object_brob + xml_path: assets/xml/objects/object_brob.xml +- name: objects/object_bubble + xml_path: assets/xml/objects/object_bubble.xml +- name: objects/object_bv + xml_path: assets/xml/objects/object_bv.xml +- name: objects/object_bw + xml_path: assets/xml/objects/object_bw.xml +- name: objects/object_bwall + xml_path: assets/xml/objects/object_bwall.xml +- name: objects/object_bxa + xml_path: assets/xml/objects/object_bxa.xml +- name: objects/object_cne + xml_path: assets/xml/objects/object_cne.xml +- name: objects/object_cob + xml_path: assets/xml/objects/object_cob.xml +- name: objects/object_cow + xml_path: assets/xml/objects/object_cow.xml +- name: objects/object_crow + xml_path: assets/xml/objects/object_crow.xml +- name: objects/object_cs + xml_path: assets/xml/objects/object_cs.xml +- name: objects/object_d_elevator + xml_path: assets/xml/objects/object_d_elevator.xml +- name: objects/object_d_hsblock + xml_path: assets/xml/objects/object_d_hsblock.xml +- name: objects/object_d_lift + xml_path: assets/xml/objects/object_d_lift.xml +- name: objects/object_daiku + xml_path: assets/xml/objects/object_daiku.xml +- name: objects/object_ddan_objects + xml_path: assets/xml/objects/object_ddan_objects.xml +- name: objects/object_dekubaba + xml_path: assets/xml/objects/object_dekubaba.xml +- name: objects/object_dekujr + xml_path: assets/xml/objects/object_dekujr.xml +- name: objects/object_dekunuts + xml_path: assets/xml/objects/object_dekunuts.xml +- name: objects/object_demo_6k + xml_path: assets/xml/objects/object_demo_6k.xml +- name: objects/object_demo_kekkai + xml_path: assets/xml/objects/object_demo_kekkai.xml +- name: objects/object_demo_tre_lgt + xml_path: assets/xml/objects/object_demo_tre_lgt.xml +- name: objects/object_dh + xml_path: assets/xml/objects/object_dh.xml +- name: objects/object_dnk + xml_path: assets/xml/objects/object_dnk.xml +- name: objects/object_dns + xml_path: assets/xml/objects/object_dns.xml +- name: objects/object_dodojr + xml_path: assets/xml/objects/object_dodojr.xml +- name: objects/object_dodongo + xml_path: assets/xml/objects/object_dodongo.xml +- name: objects/object_dog + xml_path: assets/xml/objects/object_dog.xml +- name: objects/object_door_gerudo + xml_path: assets/xml/objects/object_door_gerudo.xml +- name: objects/object_door_killer + xml_path: assets/xml/objects/object_door_killer.xml +- name: objects/object_ds + xml_path: assets/xml/objects/object_ds.xml +- name: objects/object_ds2 + xml_path: assets/xml/objects/object_ds2.xml +- name: objects/object_du + xml_path: assets/xml/objects/object_du.xml +- name: objects/object_dy_obj + xml_path: assets/xml/objects/object_dy_obj.xml +- name: objects/object_ec + xml_path: assets/xml/objects/object_ec.xml +- name: objects/object_efc_crystal_light + xml_path: assets/xml/objects/object_efc_crystal_light.xml +- name: objects/object_efc_doughnut + xml_path: assets/xml/objects/object_efc_doughnut.xml +- name: objects/object_efc_erupc + xml_path: assets/xml/objects/object_efc_erupc.xml +- name: objects/object_efc_fire_ball + xml_path: assets/xml/objects/object_efc_fire_ball.xml +- name: objects/object_efc_flash + xml_path: assets/xml/objects/object_efc_flash.xml +- name: objects/object_efc_lgt_shower + xml_path: assets/xml/objects/object_efc_lgt_shower.xml +- name: objects/object_efc_star_field + xml_path: assets/xml/objects/object_efc_star_field.xml +- name: objects/object_efc_tw + xml_path: assets/xml/objects/object_efc_tw.xml +- name: objects/object_ei + xml_path: assets/xml/objects/object_ei.xml +- name: objects/object_fa + xml_path: assets/xml/objects/object_fa.xml +- name: objects/object_fd + xml_path: assets/xml/objects/object_fd.xml +- name: objects/object_fd2 + xml_path: assets/xml/objects/object_fd2.xml +- name: objects/object_fhg + xml_path: assets/xml/objects/object_fhg.xml +- name: objects/object_fire + xml_path: assets/xml/objects/object_fire.xml +- name: objects/object_firefly + xml_path: assets/xml/objects/object_firefly.xml +- name: objects/object_fish + xml_path: assets/xml/objects/object_fish.xml +- name: objects/object_fr + xml_path: assets/xml/objects/object_fr.xml +- name: objects/object_fu + xml_path: assets/xml/objects/object_fu.xml +- name: objects/object_fw + xml_path: assets/xml/objects/object_fw.xml +- name: objects/object_fz + xml_path: assets/xml/objects/object_fz.xml +- name: objects/object_ganon + xml_path: assets/xml/objects/object_ganon.xml +- name: objects/object_ganon2 + xml_path: assets/xml/objects/object_ganon2.xml +- name: objects/object_ganon_anime1 + xml_path: assets/xml/objects/object_ganon_anime1.xml +- name: objects/object_ganon_anime2 + xml_path: assets/xml/objects/object_ganon_anime2.xml +- name: objects/object_ganon_anime3 + xml_path: assets/xml/objects/object_ganon_anime3.xml +- name: objects/object_ganon_objects + xml_path: assets/xml/objects/object_ganon_objects.xml +- name: objects/object_ge1 + xml_path: assets/xml/objects/object_ge1.xml +- name: objects/object_geff + xml_path: assets/xml/objects/object_geff.xml +- name: objects/object_geldb + xml_path: assets/xml/objects/object_geldb.xml +- name: objects/object_gi_arrow + xml_path: assets/xml/objects/object_gi_arrow.xml +- name: objects/object_gi_arrowcase + xml_path: assets/xml/objects/object_gi_arrowcase.xml +- name: objects/object_gi_bean + xml_path: assets/xml/objects/object_gi_bean.xml +- name: objects/object_gi_bomb_1 + xml_path: assets/xml/objects/object_gi_bomb_1.xml +- name: objects/object_gi_bomb_2 + xml_path: assets/xml/objects/object_gi_bomb_2.xml +- name: objects/object_gi_bombpouch + xml_path: assets/xml/objects/object_gi_bombpouch.xml +- name: objects/object_gi_boomerang + xml_path: assets/xml/objects/object_gi_boomerang.xml +- name: objects/object_gi_boots_2 + xml_path: assets/xml/objects/object_gi_boots_2.xml +- name: objects/object_gi_bosskey + xml_path: assets/xml/objects/object_gi_bosskey.xml +- name: objects/object_gi_bottle + xml_path: assets/xml/objects/object_gi_bottle.xml +- name: objects/object_gi_bottle_letter + xml_path: assets/xml/objects/object_gi_bottle_letter.xml +- name: objects/object_gi_bow + xml_path: assets/xml/objects/object_gi_bow.xml +- name: objects/object_gi_bracelet + xml_path: assets/xml/objects/object_gi_bracelet.xml +- name: objects/object_gi_brokensword + xml_path: assets/xml/objects/object_gi_brokensword.xml +- name: objects/object_gi_butterfly + xml_path: assets/xml/objects/object_gi_butterfly.xml +- name: objects/object_gi_clothes + xml_path: assets/xml/objects/object_gi_clothes.xml +- name: objects/object_gi_coin + xml_path: assets/xml/objects/object_gi_coin.xml +- name: objects/object_gi_compass + xml_path: assets/xml/objects/object_gi_compass.xml +- name: objects/object_gi_dekupouch + xml_path: assets/xml/objects/object_gi_dekupouch.xml +- name: objects/object_gi_egg + xml_path: assets/xml/objects/object_gi_egg.xml +- name: objects/object_gi_eye_lotion + xml_path: assets/xml/objects/object_gi_eye_lotion.xml +- name: objects/object_gi_fire + xml_path: assets/xml/objects/object_gi_fire.xml +- name: objects/object_gi_fish + xml_path: assets/xml/objects/object_gi_fish.xml +- name: objects/object_gi_frog + xml_path: assets/xml/objects/object_gi_frog.xml +- name: objects/object_gi_gerudo + xml_path: assets/xml/objects/object_gi_gerudo.xml +- name: objects/object_gi_gerudomask + xml_path: assets/xml/objects/object_gi_gerudomask.xml +- name: objects/object_gi_ghost + xml_path: assets/xml/objects/object_gi_ghost.xml +- name: objects/object_gi_glasses + xml_path: assets/xml/objects/object_gi_glasses.xml +- name: objects/object_gi_gloves + xml_path: assets/xml/objects/object_gi_gloves.xml +- name: objects/object_gi_goddess + xml_path: assets/xml/objects/object_gi_goddess.xml +- name: objects/object_gi_golonmask + xml_path: assets/xml/objects/object_gi_golonmask.xml +- name: objects/object_gi_grass + xml_path: assets/xml/objects/object_gi_grass.xml +- name: objects/object_gi_hammer + xml_path: assets/xml/objects/object_gi_hammer.xml +- name: objects/object_gi_heart + xml_path: assets/xml/objects/object_gi_heart.xml +- name: objects/object_gi_hearts + xml_path: assets/xml/objects/object_gi_hearts.xml +- name: objects/object_gi_hookshot + xml_path: assets/xml/objects/object_gi_hookshot.xml +- name: objects/object_gi_hoverboots + xml_path: assets/xml/objects/object_gi_hoverboots.xml +- name: objects/object_gi_insect + xml_path: assets/xml/objects/object_gi_insect.xml +- name: objects/object_gi_jewel + xml_path: assets/xml/objects/object_gi_jewel.xml +- name: objects/object_gi_key + xml_path: assets/xml/objects/object_gi_key.xml +- name: objects/object_gi_ki_tan_mask + xml_path: assets/xml/objects/object_gi_ki_tan_mask.xml +- name: objects/object_gi_letter + xml_path: assets/xml/objects/object_gi_letter.xml +- name: objects/object_gi_liquid + xml_path: assets/xml/objects/object_gi_liquid.xml +- name: objects/object_gi_longsword + xml_path: assets/xml/objects/object_gi_longsword.xml +- name: objects/object_gi_m_arrow + xml_path: assets/xml/objects/object_gi_m_arrow.xml +- name: objects/object_gi_magicpot + xml_path: assets/xml/objects/object_gi_magicpot.xml +- name: objects/object_gi_map + xml_path: assets/xml/objects/object_gi_map.xml +- name: objects/object_gi_medal + xml_path: assets/xml/objects/object_gi_medal.xml +- name: objects/object_gi_melody + xml_path: assets/xml/objects/object_gi_melody.xml +- name: objects/object_gi_milk + xml_path: assets/xml/objects/object_gi_milk.xml +- name: objects/object_gi_mushroom + xml_path: assets/xml/objects/object_gi_mushroom.xml +- name: objects/object_gi_niwatori + xml_path: assets/xml/objects/object_gi_niwatori.xml +- name: objects/object_gi_nuts + xml_path: assets/xml/objects/object_gi_nuts.xml +- name: objects/object_gi_ocarina + xml_path: assets/xml/objects/object_gi_ocarina.xml +- name: objects/object_gi_ocarina_0 + xml_path: assets/xml/objects/object_gi_ocarina_0.xml +- name: objects/object_gi_pachinko + xml_path: assets/xml/objects/object_gi_pachinko.xml +- name: objects/object_gi_powder + xml_path: assets/xml/objects/object_gi_powder.xml +- name: objects/object_gi_prescription + xml_path: assets/xml/objects/object_gi_prescription.xml +- name: objects/object_gi_purse + xml_path: assets/xml/objects/object_gi_purse.xml +- name: objects/object_gi_rabit_mask + xml_path: assets/xml/objects/object_gi_rabit_mask.xml +- name: objects/object_gi_redead_mask + xml_path: assets/xml/objects/object_gi_redead_mask.xml +- name: objects/object_gi_rupy + xml_path: assets/xml/objects/object_gi_rupy.xml +- name: objects/object_gi_saw + xml_path: assets/xml/objects/object_gi_saw.xml +- name: objects/object_gi_scale + xml_path: assets/xml/objects/object_gi_scale.xml +- name: objects/object_gi_seed + xml_path: assets/xml/objects/object_gi_seed.xml +- name: objects/object_gi_shield_1 + xml_path: assets/xml/objects/object_gi_shield_1.xml +- name: objects/object_gi_shield_2 + xml_path: assets/xml/objects/object_gi_shield_2.xml +- name: objects/object_gi_shield_3 + xml_path: assets/xml/objects/object_gi_shield_3.xml +- name: objects/object_gi_skj_mask + xml_path: assets/xml/objects/object_gi_skj_mask.xml +- name: objects/object_gi_soldout + xml_path: assets/xml/objects/object_gi_soldout.xml +- name: objects/object_gi_soul + xml_path: assets/xml/objects/object_gi_soul.xml +- name: objects/object_gi_stick + xml_path: assets/xml/objects/object_gi_stick.xml +- name: objects/object_gi_sutaru + xml_path: assets/xml/objects/object_gi_sutaru.xml +- name: objects/object_gi_sword_1 + xml_path: assets/xml/objects/object_gi_sword_1.xml +- name: objects/object_gi_ticketstone + xml_path: assets/xml/objects/object_gi_ticketstone.xml +- name: objects/object_gi_truth_mask + xml_path: assets/xml/objects/object_gi_truth_mask.xml +- name: objects/object_gi_zoramask + xml_path: assets/xml/objects/object_gi_zoramask.xml +- name: objects/object_gj + xml_path: assets/xml/objects/object_gj.xml +- name: objects/object_gjyo_objects + xml_path: assets/xml/objects/object_gjyo_objects.xml +- name: objects/object_gla + xml_path: assets/xml/objects/object_gla.xml +- name: objects/object_gm + xml_path: assets/xml/objects/object_gm.xml +- name: objects/object_gnd + xml_path: assets/xml/objects/object_gnd.xml +- name: objects/object_gnd_magic + xml_path: assets/xml/objects/object_gnd_magic.xml +- name: objects/object_gndd + xml_path: assets/xml/objects/object_gndd.xml +- name: objects/object_god_lgt + xml_path: assets/xml/objects/object_god_lgt.xml +- name: objects/object_gol + xml_path: assets/xml/objects/object_gol.xml +- name: objects/object_goma + xml_path: assets/xml/objects/object_goma.xml +- name: objects/object_goroiwa + xml_path: assets/xml/objects/object_goroiwa.xml +- name: objects/object_gr + xml_path: assets/xml/objects/object_gr.xml +- name: objects/object_gs + xml_path: assets/xml/objects/object_gs.xml +- name: objects/object_gt + xml_path: assets/xml/objects/object_gt.xml +- name: objects/object_haka + xml_path: assets/xml/objects/object_haka.xml +- name: objects/object_haka_door + xml_path: assets/xml/objects/object_haka_door.xml +- name: objects/object_haka_objects + xml_path: assets/xml/objects/object_haka_objects.xml +- name: objects/object_hakach_objects + xml_path: assets/xml/objects/object_hakach_objects.xml +- name: objects/object_hata + xml_path: assets/xml/objects/object_hata.xml +- name: objects/object_heavy_object + xml_path: assets/xml/objects/object_heavy_object.xml +- name: objects/object_hidan_objects + xml_path: assets/xml/objects/object_hidan_objects.xml +- name: objects/object_hintnuts + xml_path: assets/xml/objects/object_hintnuts.xml +- name: objects/object_hni + xml_path: assets/xml/objects/object_hni.xml +- name: objects/object_horse + xml_path: assets/xml/objects/object_horse.xml +- name: objects/object_horse_ganon + xml_path: assets/xml/objects/object_horse_ganon.xml +- name: objects/object_horse_link_child + xml_path: assets/xml/objects/object_horse_link_child.xml +- name: objects/object_horse_normal + xml_path: assets/xml/objects/object_horse_normal.xml +- name: objects/object_horse_zelda + xml_path: assets/xml/objects/object_horse_zelda.xml +- name: objects/object_hs + xml_path: assets/xml/objects/object_hs.xml +- name: objects/object_human + xml_path: assets/xml/objects/object_human.xml +- name: objects/object_ice_objects + xml_path: assets/xml/objects/object_ice_objects.xml +- name: objects/object_ik + xml_path: assets/xml/objects/object_ik.xml +- name: objects/object_im + xml_path: assets/xml/objects/object_im.xml +- name: objects/object_in + xml_path: assets/xml/objects/object_in.xml +- name: objects/object_ingate + xml_path: assets/xml/objects/object_ingate.xml +- name: objects/object_jj + xml_path: assets/xml/objects/object_jj.xml +- name: objects/object_js + xml_path: assets/xml/objects/object_js.xml +- name: objects/object_jya_door + xml_path: assets/xml/objects/object_jya_door.xml +- name: objects/object_jya_iron + xml_path: assets/xml/objects/object_jya_iron.xml +- name: objects/object_jya_obj + xml_path: assets/xml/objects/object_jya_obj.xml +- name: objects/object_ka + xml_path: assets/xml/objects/object_ka.xml +- name: objects/object_kanban + xml_path: assets/xml/objects/object_kanban.xml +- name: objects/object_kibako2 + xml_path: assets/xml/objects/object_kibako2.xml +- name: objects/object_kingdodongo + xml_path: assets/xml/objects/object_kingdodongo.xml +- name: objects/object_km1 + xml_path: assets/xml/objects/object_km1.xml +- name: objects/object_kusa + xml_path: assets/xml/objects/object_kusa.xml +- name: objects/object_kw1 + xml_path: assets/xml/objects/object_kw1.xml +- name: objects/object_kz + xml_path: assets/xml/objects/object_kz.xml +- name: objects/object_light_ring + xml_path: assets/xml/objects/object_light_ring.xml +- name: objects/object_lightbox + xml_path: assets/xml/objects/object_lightbox.xml +- name: objects/object_lightswitch + xml_path: assets/xml/objects/object_lightswitch.xml +- name: objects/object_link_boy + xml_path: assets/xml/objects/object_link_boy.xml +- name: objects/object_link_child + xml_path: assets/xml/objects/object_link_child.xml +- name: objects/object_ma1 + xml_path: assets/xml/objects/object_ma1.xml +- name: objects/object_ma2 + xml_path: assets/xml/objects/object_ma2.xml +- name: objects/object_mag + xml_path: assets/xml/objects/object_mag_v3_mq.xml +- name: objects/object_mamenoki + xml_path: assets/xml/objects/object_mamenoki.xml +- name: objects/object_mastergolon + xml_path: assets/xml/objects/object_mastergolon.xml +- name: objects/object_masterkokiri + xml_path: assets/xml/objects/object_masterkokiri.xml +- name: objects/object_masterkokirihead + xml_path: assets/xml/objects/object_masterkokirihead.xml +- name: objects/object_masterzoora + xml_path: assets/xml/objects/object_masterzoora.xml +- name: objects/object_mb + xml_path: assets/xml/objects/object_mb.xml +- name: objects/object_md + xml_path: assets/xml/objects/object_md.xml +- name: objects/object_medal + xml_path: assets/xml/objects/object_medal.xml +- name: objects/object_menkuri_objects + xml_path: assets/xml/objects/object_menkuri_objects.xml +- name: objects/object_mir_ray + xml_path: assets/xml/objects/object_mir_ray.xml +- name: objects/object_mizu_objects + xml_path: assets/xml/objects/object_mizu_objects.xml +- name: objects/object_mjin + xml_path: assets/xml/objects/object_mjin.xml +- name: objects/object_mjin_dark + xml_path: assets/xml/objects/object_mjin_dark.xml +- name: objects/object_mjin_flame + xml_path: assets/xml/objects/object_mjin_flame.xml +- name: objects/object_mjin_flash + xml_path: assets/xml/objects/object_mjin_flash.xml +- name: objects/object_mjin_ice + xml_path: assets/xml/objects/object_mjin_ice.xml +- name: objects/object_mjin_oka + xml_path: assets/xml/objects/object_mjin_oka.xml +- name: objects/object_mjin_soul + xml_path: assets/xml/objects/object_mjin_soul.xml +- name: objects/object_mjin_wind + xml_path: assets/xml/objects/object_mjin_wind.xml +- name: objects/object_mk + xml_path: assets/xml/objects/object_mk.xml +- name: objects/object_mm + xml_path: assets/xml/objects/object_mm.xml +- name: objects/object_mo + xml_path: assets/xml/objects/object_mo.xml +- name: objects/object_mori_hineri1 + xml_path: assets/xml/objects/object_mori_hineri1.xml +- name: objects/object_mori_hineri1a + xml_path: assets/xml/objects/object_mori_hineri1a.xml +- name: objects/object_mori_hineri2 + xml_path: assets/xml/objects/object_mori_hineri2.xml +- name: objects/object_mori_hineri2a + xml_path: assets/xml/objects/object_mori_hineri2a.xml +- name: objects/object_mori_objects + xml_path: assets/xml/objects/object_mori_objects.xml +- name: objects/object_mori_tex + xml_path: assets/xml/objects/object_mori_tex.xml +- name: objects/object_ms + xml_path: assets/xml/objects/object_ms.xml +- name: objects/object_mu + xml_path: assets/xml/objects/object_mu.xml +- name: objects/object_nb + xml_path: assets/xml/objects/object_nb.xml +- name: objects/object_niw + xml_path: assets/xml/objects/object_niw.xml +- name: objects/object_nwc + xml_path: assets/xml/objects/object_nwc.xml +- name: objects/object_ny + xml_path: assets/xml/objects/object_ny.xml +- name: objects/object_o_anime + xml_path: assets/xml/objects/object_o_anime.xml +- name: objects/object_oA1 + xml_path: assets/xml/objects/object_oA1.xml +- name: objects/object_oA2 + xml_path: assets/xml/objects/object_oA2.xml +- name: objects/object_oA3 + xml_path: assets/xml/objects/object_oA3.xml +- name: objects/object_oA4 + xml_path: assets/xml/objects/object_oA4.xml +- name: objects/object_oA5 + xml_path: assets/xml/objects/object_oA5.xml +- name: objects/object_oA6 + xml_path: assets/xml/objects/object_oA6.xml +- name: objects/object_oA7 + xml_path: assets/xml/objects/object_oA7.xml +- name: objects/object_oA8 + xml_path: assets/xml/objects/object_oA8.xml +- name: objects/object_oA9 + xml_path: assets/xml/objects/object_oA9.xml +- name: objects/object_oA10 + xml_path: assets/xml/objects/object_oA10.xml +- name: objects/object_oA11 + xml_path: assets/xml/objects/object_oA11.xml +- name: objects/object_oB1 + xml_path: assets/xml/objects/object_oB1.xml +- name: objects/object_oB2 + xml_path: assets/xml/objects/object_oB2.xml +- name: objects/object_oB3 + xml_path: assets/xml/objects/object_oB3.xml +- name: objects/object_oB4 + xml_path: assets/xml/objects/object_oB4.xml +- name: objects/object_oE1 + xml_path: assets/xml/objects/object_oE1.xml +- name: objects/object_oE1s + xml_path: assets/xml/objects/object_oE1s.xml +- name: objects/object_oE2 + xml_path: assets/xml/objects/object_oE2.xml +- name: objects/object_oE3 + xml_path: assets/xml/objects/object_oE3.xml +- name: objects/object_oE4 + xml_path: assets/xml/objects/object_oE4.xml +- name: objects/object_oE4s + xml_path: assets/xml/objects/object_oE4s.xml +- name: objects/object_oE5 + xml_path: assets/xml/objects/object_oE5.xml +- name: objects/object_oE6 + xml_path: assets/xml/objects/object_oE6.xml +- name: objects/object_oE7 + xml_path: assets/xml/objects/object_oE7.xml +- name: objects/object_oE8 + xml_path: assets/xml/objects/object_oE8.xml +- name: objects/object_oE9 + xml_path: assets/xml/objects/object_oE9.xml +- name: objects/object_oE10 + xml_path: assets/xml/objects/object_oE10.xml +- name: objects/object_oE11 + xml_path: assets/xml/objects/object_oE11.xml +- name: objects/object_oE12 + xml_path: assets/xml/objects/object_oE12.xml +- name: objects/object_oE_anime + xml_path: assets/xml/objects/object_oE_anime.xml +- name: objects/object_oF1d_map + xml_path: assets/xml/objects/object_oF1d_map.xml +- name: objects/object_oF1s + xml_path: assets/xml/objects/object_oF1s.xml +- name: objects/object_okuta + xml_path: assets/xml/objects/object_okuta.xml +- name: objects/object_opening_demo1 + xml_path: assets/xml/objects/object_opening_demo1.xml +- name: objects/object_os + xml_path: assets/xml/objects/object_os.xml +- name: objects/object_os_anime + xml_path: assets/xml/objects/object_os_anime.xml +- name: objects/object_ossan + xml_path: assets/xml/objects/object_ossan.xml +- name: objects/object_ouke_haka + xml_path: assets/xml/objects/object_ouke_haka.xml +- name: objects/object_owl + xml_path: assets/xml/objects/object_owl.xml +- name: objects/object_peehat + xml_path: assets/xml/objects/object_peehat.xml +- name: objects/object_po_composer + xml_path: assets/xml/objects/object_po_composer.xml +- name: objects/object_po_field + xml_path: assets/xml/objects/object_po_field.xml +- name: objects/object_po_sisters + xml_path: assets/xml/objects/object_po_sisters.xml +- name: objects/object_poh + xml_path: assets/xml/objects/object_poh.xml +- name: objects/object_ps + xml_path: assets/xml/objects/object_ps.xml +- name: objects/object_pu_box + xml_path: assets/xml/objects/object_pu_box.xml +- name: objects/object_rd + xml_path: assets/xml/objects/object_rd.xml +- name: objects/object_reeba + xml_path: assets/xml/objects/object_reeba.xml +- name: objects/object_relay_objects + xml_path: assets/xml/objects/object_relay_objects.xml +- name: objects/object_rl + xml_path: assets/xml/objects/object_rl.xml +- name: objects/object_rr + xml_path: assets/xml/objects/object_rr.xml +- name: objects/object_rs + xml_path: assets/xml/objects/object_rs.xml +- name: objects/object_ru1 + xml_path: assets/xml/objects/object_ru1.xml +- name: objects/object_ru2 + xml_path: assets/xml/objects/object_ru2.xml +- name: objects/object_sa + xml_path: assets/xml/objects/object_sa.xml +- name: objects/object_sb + xml_path: assets/xml/objects/object_sb.xml +- name: objects/object_sd + xml_path: assets/xml/objects/object_sd.xml +- name: objects/object_shop_dungen + xml_path: assets/xml/objects/object_shop_dungen.xml +- name: objects/object_shopnuts + xml_path: assets/xml/objects/object_shopnuts.xml +- name: objects/object_siofuki + xml_path: assets/xml/objects/object_siofuki.xml +- name: objects/object_sk2 + xml_path: assets/xml/objects/object_sk2.xml +- name: objects/object_skb + xml_path: assets/xml/objects/object_skb.xml +- name: objects/object_skj + xml_path: assets/xml/objects/object_skj.xml +- name: objects/object_spot00_break + xml_path: assets/xml/objects/object_spot00_break.xml +- name: objects/object_spot00_objects + xml_path: assets/xml/objects/object_spot00_objects.xml +- name: objects/object_spot01_matoya + xml_path: assets/xml/objects/object_spot01_matoya.xml +- name: objects/object_spot01_matoyab + xml_path: assets/xml/objects/object_spot01_matoyab.xml +- name: objects/object_spot01_objects + xml_path: assets/xml/objects/object_spot01_objects.xml +- name: objects/object_spot01_objects2 + xml_path: assets/xml/objects/object_spot01_objects2.xml +- name: objects/object_spot02_objects + xml_path: assets/xml/objects/object_spot02_objects.xml +- name: objects/object_spot03_object + xml_path: assets/xml/objects/object_spot03_object.xml +- name: objects/object_spot04_objects + xml_path: assets/xml/objects/object_spot04_objects.xml +- name: objects/object_spot05_objects + xml_path: assets/xml/objects/object_spot05_objects.xml +- name: objects/object_spot06_objects + xml_path: assets/xml/objects/object_spot06_objects.xml +- name: objects/object_spot07_object + xml_path: assets/xml/objects/object_spot07_object.xml +- name: objects/object_spot08_obj + xml_path: assets/xml/objects/object_spot08_obj.xml +- name: objects/object_spot09_obj + xml_path: assets/xml/objects/object_spot09_obj.xml +- name: objects/object_spot11_obj + xml_path: assets/xml/objects/object_spot11_obj.xml +- name: objects/object_spot12_obj + xml_path: assets/xml/objects/object_spot12_obj.xml +- name: objects/object_spot15_obj + xml_path: assets/xml/objects/object_spot15_obj.xml +- name: objects/object_spot16_obj + xml_path: assets/xml/objects/object_spot16_obj.xml +- name: objects/object_spot17_obj + xml_path: assets/xml/objects/object_spot17_obj.xml +- name: objects/object_spot18_obj + xml_path: assets/xml/objects/object_spot18_obj.xml +- name: objects/object_ssh + xml_path: assets/xml/objects/object_ssh.xml +- name: objects/object_sst + xml_path: assets/xml/objects/object_sst.xml +- name: objects/object_st + xml_path: assets/xml/objects/object_st.xml +- name: objects/object_stream + xml_path: assets/xml/objects/object_stream.xml +- name: objects/object_syokudai + xml_path: assets/xml/objects/object_syokudai.xml +- name: objects/object_ta + xml_path: assets/xml/objects/object_ta.xml +- name: objects/object_timeblock + xml_path: assets/xml/objects/object_timeblock.xml +- name: objects/object_tite + xml_path: assets/xml/objects/object_tite.xml +- name: objects/object_tk + xml_path: assets/xml/objects/object_tk.xml +- name: objects/object_toki_objects + xml_path: assets/xml/objects/object_toki_objects.xml +- name: objects/object_torch2 + xml_path: assets/xml/objects/object_torch2.xml +- name: objects/object_toryo + xml_path: assets/xml/objects/object_toryo.xml +- name: objects/object_tp + xml_path: assets/xml/objects/object_tp.xml +- name: objects/object_tr + xml_path: assets/xml/objects/object_tr.xml +- name: objects/object_trap + xml_path: assets/xml/objects/object_trap.xml +- name: objects/object_triforce_spot + xml_path: assets/xml/objects/object_triforce_spot.xml +- name: objects/object_ts + xml_path: assets/xml/objects/object_ts.xml +- name: objects/object_tsubo + xml_path: assets/xml/objects/object_tsubo.xml +- name: objects/object_tw + xml_path: assets/xml/objects/object_tw.xml +- name: objects/object_umajump + xml_path: assets/xml/objects/object_umajump.xml +- name: objects/object_vali + xml_path: assets/xml/objects/object_vali.xml +- name: objects/object_vase + xml_path: assets/xml/objects/object_vase.xml +- name: objects/object_vm + xml_path: assets/xml/objects/object_vm.xml +- name: objects/object_wallmaster + xml_path: assets/xml/objects/object_wallmaster.xml +- name: objects/object_warp1 + xml_path: assets/xml/objects/object_warp1.xml +- name: objects/object_warp2 + xml_path: assets/xml/objects/object_warp2.xml +- name: objects/object_wf + xml_path: assets/xml/objects/object_wf.xml +- name: objects/object_wood02 + xml_path: assets/xml/objects/object_wood02.xml +- name: objects/object_xc + xml_path: assets/xml/objects/object_xc.xml +- name: objects/object_yabusame_point + xml_path: assets/xml/objects/object_yabusame_point.xml +- name: objects/object_ydan_objects + xml_path: assets/xml/objects/object_ydan_objects.xml +- name: objects/object_yukabyun + xml_path: assets/xml/objects/object_yukabyun.xml +- name: objects/object_zf + xml_path: assets/xml/objects/object_zf.xml +- name: objects/object_zg + xml_path: assets/xml/objects/object_zg.xml +- name: objects/object_zl1 + xml_path: assets/xml/objects/object_zl1.xml +- name: objects/object_zl2 + xml_path: assets/xml/objects/object_zl2.xml +- name: objects/object_zl2_anime1 + xml_path: assets/xml/objects/object_zl2_anime1.xml +- name: objects/object_zl2_anime2 + xml_path: assets/xml/objects/object_zl2_anime2.xml +- name: objects/object_zl4 + xml_path: assets/xml/objects/object_zl4.xml +- name: objects/object_zo + xml_path: assets/xml/objects/object_zo.xml +- name: overlays/ovl_Arrow_Fire + xml_path: assets/xml/overlays/ovl_Arrow_Fire.xml + start_offset: 0x980 + end_offset: 0x1DA0 +- name: overlays/ovl_Arrow_Ice + xml_path: assets/xml/overlays/ovl_Arrow_Ice.xml + start_offset: 0x9A0 + end_offset: 0x1DC0 +- name: overlays/ovl_Arrow_Light + xml_path: assets/xml/overlays/ovl_Arrow_Light.xml + start_offset: 0x9B0 + end_offset: 0x1DD0 +- name: overlays/ovl_Bg_Ganon_Otyuka + xml_path: assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml + start_offset: 0x1100 + end_offset: 0x24DC +- name: overlays/ovl_Bg_Jya_Cobra + xml_path: assets/xml/overlays/ovl_Bg_Jya_Cobra.xml + start_offset: 0x1850 + end_offset: 0x18C8 +- name: overlays/ovl_Boss_Dodongo + xml_path: assets/xml/overlays/ovl_Boss_Dodongo.xml + start_offset: 0x61E8 + end_offset: 0x91E8 +- name: overlays/ovl_Boss_Ganon + xml_path: assets/xml/overlays/ovl_Boss_Ganon.xml + start_offset: 0xE3C8 + end_offset: 0x20EE8 +- name: overlays/ovl_Boss_Ganon2 + xml_path: assets/xml/overlays/ovl_Boss_Ganon2.xml + start_offset: 0x9F88 + end_offset: 0x10438 +- name: overlays/ovl_Boss_Sst + xml_path: assets/xml/overlays/ovl_Boss_Sst.xml + start_offset: 0xA380 + end_offset: 0xAD30 +- name: overlays/ovl_Demo_Shd + xml_path: assets/xml/overlays/ovl_Demo_Shd.xml + start_offset: 0x410 + end_offset: 0x2390 +- name: overlays/ovl_Effect_Ss_Fhg_Flash + xml_path: assets/xml/overlays/ovl_Effect_Ss_Fhg_Flash.xml + start_offset: 0x9F0 + end_offset: 0xEA8 +- name: overlays/ovl_En_Bili + xml_path: assets/xml/overlays/ovl_En_Bili.xml + start_offset: 0x1E40 + end_offset: 0x1E60 +- name: overlays/ovl_En_Clear_Tag + xml_path: assets/xml/overlays/ovl_En_Clear_Tag.xml + start_offset: 0x2600 + end_offset: 0x8900 +- name: overlays/ovl_En_Ganon_Mant + xml_path: assets/xml/overlays/ovl_En_Ganon_Mant.xml + start_offset: 0x11F8 + end_offset: 0x40F8 +- name: overlays/ovl_En_Ganon_Organ + xml_path: assets/xml/overlays/ovl_En_Ganon_Organ.xml + start_offset: 0x368 + end_offset: 0x6EF0 +- name: overlays/ovl_En_Holl + xml_path: assets/xml/overlays/ovl_En_Holl.xml + start_offset: 0xE68 + end_offset: 0xED0 +- name: overlays/ovl_En_Jsjutan + xml_path: assets/xml/overlays/ovl_En_Jsjutan.xml + start_offset: 0x12C8 + end_offset: 0x4C60 +- name: overlays/ovl_En_Kanban + xml_path: assets/xml/overlays/ovl_En_Kanban.xml + start_offset: 0x2E70 + end_offset: 0x2F30 +- name: overlays/ovl_En_Sda + xml_path: assets/xml/overlays/ovl_En_Sda.xml + start_offset: 0x1498 + end_offset: 0x1528 +- name: overlays/ovl_En_Ssh + xml_path: assets/xml/overlays/ovl_En_Ssh.xml + start_offset: 0x2150 + end_offset: 0x21E0 +- name: overlays/ovl_En_St + xml_path: assets/xml/overlays/ovl_En_St.xml + start_offset: 0x26A0 + end_offset: 0x2730 +- name: overlays/ovl_En_Sth + xml_path: assets/xml/overlays/ovl_En_Sth.xml + start_offset: 0xE70 + end_offset: 0x3E44 +- name: overlays/ovl_End_Title + xml_path: assets/xml/overlays/ovl_End_Title.xml + start_offset: 0x6E0 + end_offset: 0x4088 +- name: overlays/ovl_file_choose + xml_path: assets/xml/overlays/ovl_file_choose.xml + start_offset: 0xEC40 + end_offset: 0xF320 +- name: overlays/ovl_Magic_Dark + xml_path: assets/xml/overlays/ovl_Magic_Dark.xml + start_offset: 0xC90 + end_offset: 0x16C0 +- name: overlays/ovl_Magic_Fire + xml_path: assets/xml/overlays/ovl_Magic_Fire.xml + start_offset: 0xB50 + end_offset: 0x21A0 +- name: overlays/ovl_Magic_Wind + xml_path: assets/xml/overlays/ovl_Magic_Wind.xml + start_offset: 0x6A0 + end_offset: 0x1BB8 +- name: overlays/ovl_Oceff_Spot + xml_path: assets/xml/overlays/ovl_Oceff_Spot.xml + start_offset: 0x780 + end_offset: 0xE58 +- name: overlays/ovl_Oceff_Storm + xml_path: assets/xml/overlays/ovl_Oceff_Storm.xml + start_offset: 0x750 + end_offset: 0x1AE0 +- name: overlays/ovl_Oceff_Wipe + xml_path: assets/xml/overlays/ovl_Oceff_Wipe.xml + start_offset: 0x520 + end_offset: 0xCE0 +- name: overlays/ovl_Oceff_Wipe2 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe2.xml + start_offset: 0x430 + end_offset: 0x1698 +- name: overlays/ovl_Oceff_Wipe3 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe3.xml + start_offset: 0x430 + end_offset: 0x1678 +- name: overlays/ovl_Oceff_Wipe4 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe4.xml + start_offset: 0x410 + end_offset: 0xEF8 +- name: scenes/dungeons/bdan + xml_path: assets/xml/scenes/dungeons/bdan_mq.xml +- name: scenes/dungeons/bdan_boss + xml_path: assets/xml/scenes/dungeons/bdan_boss.xml +- name: scenes/dungeons/Bmori1 + xml_path: assets/xml/scenes/dungeons/Bmori1_mq.xml +- name: scenes/dungeons/ddan + xml_path: assets/xml/scenes/dungeons/ddan_mq.xml +- name: scenes/dungeons/ddan_boss + xml_path: assets/xml/scenes/dungeons/ddan_boss_v2.xml +- name: scenes/dungeons/FIRE_bs + xml_path: assets/xml/scenes/dungeons/FIRE_bs.xml +- name: scenes/dungeons/ganon + xml_path: assets/xml/scenes/dungeons/ganon.xml +- name: scenes/dungeons/ganon_boss + xml_path: assets/xml/scenes/dungeons/ganon_boss.xml +- name: scenes/dungeons/ganon_demo + xml_path: assets/xml/scenes/dungeons/ganon_demo.xml +- name: scenes/dungeons/ganon_final + xml_path: assets/xml/scenes/dungeons/ganon_final.xml +- name: scenes/dungeons/ganon_sonogo + xml_path: assets/xml/scenes/dungeons/ganon_sonogo.xml +- name: scenes/dungeons/ganontika + xml_path: assets/xml/scenes/dungeons/ganontika_mq.xml +- name: scenes/dungeons/ganontikasonogo + xml_path: assets/xml/scenes/dungeons/ganontikasonogo.xml +- name: scenes/dungeons/gerudoway + xml_path: assets/xml/scenes/dungeons/gerudoway.xml +- name: scenes/dungeons/HAKAdan + xml_path: assets/xml/scenes/dungeons/HAKAdan_mq.xml +- name: scenes/dungeons/HAKAdan_bs + xml_path: assets/xml/scenes/dungeons/HAKAdan_bs.xml +- name: scenes/dungeons/HAKAdanCH + xml_path: assets/xml/scenes/dungeons/HAKAdanCH_mq.xml +- name: scenes/dungeons/HIDAN + xml_path: assets/xml/scenes/dungeons/HIDAN_mq.xml +- name: scenes/dungeons/ice_doukutu + xml_path: assets/xml/scenes/dungeons/ice_doukutu_mq.xml +- name: scenes/dungeons/jyasinboss + xml_path: assets/xml/scenes/dungeons/jyasinboss.xml +- name: scenes/dungeons/jyasinzou + xml_path: assets/xml/scenes/dungeons/jyasinzou_mq.xml +- name: scenes/dungeons/men + xml_path: assets/xml/scenes/dungeons/men_mq.xml +- name: scenes/dungeons/MIZUsin + xml_path: assets/xml/scenes/dungeons/MIZUsin_mq.xml +- name: scenes/dungeons/MIZUsin_bs + xml_path: assets/xml/scenes/dungeons/MIZUsin_bs.xml +- name: scenes/dungeons/moribossroom + xml_path: assets/xml/scenes/dungeons/moribossroom.xml +- name: scenes/dungeons/ydan + xml_path: assets/xml/scenes/dungeons/ydan_mq.xml +- name: scenes/dungeons/ydan_boss + xml_path: assets/xml/scenes/dungeons/ydan_boss.xml +- name: scenes/indoors/bowling + xml_path: assets/xml/scenes/indoors/bowling.xml +- name: scenes/indoors/daiyousei_izumi + xml_path: assets/xml/scenes/indoors/daiyousei_izumi.xml +- name: scenes/indoors/hairal_niwa + xml_path: assets/xml/scenes/indoors/hairal_niwa.xml +- name: scenes/indoors/hairal_niwa_n + xml_path: assets/xml/scenes/indoors/hairal_niwa_n.xml +- name: scenes/indoors/hakasitarelay + xml_path: assets/xml/scenes/indoors/hakasitarelay.xml +- name: scenes/indoors/hut + xml_path: assets/xml/scenes/indoors/hut.xml +- name: scenes/indoors/hylia_labo + xml_path: assets/xml/scenes/indoors/hylia_labo.xml +- name: scenes/indoors/impa + xml_path: assets/xml/scenes/indoors/impa.xml +- name: scenes/indoors/kakariko + xml_path: assets/xml/scenes/indoors/kakariko.xml +- name: scenes/indoors/kenjyanoma + xml_path: assets/xml/scenes/indoors/kenjyanoma.xml +- name: scenes/indoors/kokiri_home + xml_path: assets/xml/scenes/indoors/kokiri_home.xml +- name: scenes/indoors/kokiri_home3 + xml_path: assets/xml/scenes/indoors/kokiri_home3.xml +- name: scenes/indoors/kokiri_home4 + xml_path: assets/xml/scenes/indoors/kokiri_home4.xml +- name: scenes/indoors/kokiri_home5 + xml_path: assets/xml/scenes/indoors/kokiri_home5.xml +- name: scenes/indoors/labo + xml_path: assets/xml/scenes/indoors/labo.xml +- name: scenes/indoors/link_home + xml_path: assets/xml/scenes/indoors/link_home.xml +- name: scenes/indoors/mahouya + xml_path: assets/xml/scenes/indoors/mahouya.xml +- name: scenes/indoors/malon_stable + xml_path: assets/xml/scenes/indoors/malon_stable.xml +- name: scenes/indoors/miharigoya + xml_path: assets/xml/scenes/indoors/miharigoya.xml +- name: scenes/indoors/nakaniwa + xml_path: assets/xml/scenes/indoors/nakaniwa.xml +- name: scenes/indoors/souko + xml_path: assets/xml/scenes/indoors/souko.xml +- name: scenes/indoors/syatekijyou + xml_path: assets/xml/scenes/indoors/syatekijyou.xml +- name: scenes/indoors/takaraya + xml_path: assets/xml/scenes/indoors/takaraya.xml +- name: scenes/indoors/tent + xml_path: assets/xml/scenes/indoors/tent.xml +- name: scenes/indoors/tokinoma + xml_path: assets/xml/scenes/indoors/tokinoma.xml +- name: scenes/indoors/yousei_izumi_tate + xml_path: assets/xml/scenes/indoors/yousei_izumi_tate.xml +- name: scenes/indoors/yousei_izumi_yoko + xml_path: assets/xml/scenes/indoors/yousei_izumi_yoko.xml +- name: scenes/misc/enrui + xml_path: assets/xml/scenes/misc/enrui.xml +- name: scenes/misc/entra + xml_path: assets/xml/scenes/misc/entra.xml +- name: scenes/misc/entra_n + xml_path: assets/xml/scenes/misc/entra_n.xml +- name: scenes/misc/hakaana + xml_path: assets/xml/scenes/misc/hakaana.xml +- name: scenes/misc/hakaana2 + xml_path: assets/xml/scenes/misc/hakaana2.xml +- name: scenes/misc/hakaana_ouke + xml_path: assets/xml/scenes/misc/hakaana_ouke.xml +- name: scenes/misc/hiral_demo + xml_path: assets/xml/scenes/misc/hiral_demo.xml +- name: scenes/misc/kakariko3 + xml_path: assets/xml/scenes/misc/kakariko3.xml +- name: scenes/misc/kakusiana + xml_path: assets/xml/scenes/misc/kakusiana.xml +- name: scenes/misc/kinsuta + xml_path: assets/xml/scenes/misc/kinsuta.xml +- name: scenes/misc/market_alley + xml_path: assets/xml/scenes/misc/market_alley.xml +- name: scenes/misc/market_alley_n + xml_path: assets/xml/scenes/misc/market_alley_n.xml +- name: scenes/misc/market_day + xml_path: assets/xml/scenes/misc/market_day.xml +- name: scenes/misc/market_night + xml_path: assets/xml/scenes/misc/market_night.xml +- name: scenes/misc/market_ruins + xml_path: assets/xml/scenes/misc/market_ruins.xml +- name: scenes/misc/shrine + xml_path: assets/xml/scenes/misc/shrine.xml +- name: scenes/misc/shrine_n + xml_path: assets/xml/scenes/misc/shrine_n.xml +- name: scenes/misc/shrine_r + xml_path: assets/xml/scenes/misc/shrine_r.xml +- name: scenes/misc/turibori + xml_path: assets/xml/scenes/misc/turibori.xml +- name: scenes/overworld/ganon_tou + xml_path: assets/xml/scenes/overworld/ganon_tou.xml +- name: scenes/overworld/spot00 + xml_path: assets/xml/scenes/overworld/spot00.xml +- name: scenes/overworld/spot01 + xml_path: assets/xml/scenes/overworld/spot01.xml +- name: scenes/overworld/spot02 + xml_path: assets/xml/scenes/overworld/spot02.xml +- name: scenes/overworld/spot03 + xml_path: assets/xml/scenes/overworld/spot03.xml +- name: scenes/overworld/spot04 + xml_path: assets/xml/scenes/overworld/spot04.xml +- name: scenes/overworld/spot05 + xml_path: assets/xml/scenes/overworld/spot05.xml +- name: scenes/overworld/spot06 + xml_path: assets/xml/scenes/overworld/spot06.xml +- name: scenes/overworld/spot07 + xml_path: assets/xml/scenes/overworld/spot07.xml +- name: scenes/overworld/spot08 + xml_path: assets/xml/scenes/overworld/spot08.xml +- name: scenes/overworld/spot09 + xml_path: assets/xml/scenes/overworld/spot09.xml +- name: scenes/overworld/spot10 + xml_path: assets/xml/scenes/overworld/spot10.xml +- name: scenes/overworld/spot11 + xml_path: assets/xml/scenes/overworld/spot11.xml +- name: scenes/overworld/spot12 + xml_path: assets/xml/scenes/overworld/spot12.xml +- name: scenes/overworld/spot13 + xml_path: assets/xml/scenes/overworld/spot13.xml +- name: scenes/overworld/spot15 + xml_path: assets/xml/scenes/overworld/spot15.xml +- name: scenes/overworld/spot16 + xml_path: assets/xml/scenes/overworld/spot16_v2.xml +- name: scenes/overworld/spot17 + xml_path: assets/xml/scenes/overworld/spot17.xml +- name: scenes/overworld/spot18 + xml_path: assets/xml/scenes/overworld/spot18.xml +- name: scenes/overworld/spot20 + xml_path: assets/xml/scenes/overworld/spot20.xml +- name: scenes/shops/alley_shop + xml_path: assets/xml/scenes/shops/alley_shop.xml +- name: scenes/shops/drag + xml_path: assets/xml/scenes/shops/drag.xml +- name: scenes/shops/face_shop + xml_path: assets/xml/scenes/shops/face_shop.xml +- name: scenes/shops/golon + xml_path: assets/xml/scenes/shops/golon.xml +- name: scenes/shops/kokiri_shop + xml_path: assets/xml/scenes/shops/kokiri_shop.xml +- name: scenes/shops/night_shop + xml_path: assets/xml/scenes/shops/night_shop.xml +- name: scenes/shops/shop1 + xml_path: assets/xml/scenes/shops/shop1.xml +- name: scenes/shops/zoora + xml_path: assets/xml/scenes/shops/zoora.xml +- name: textures/backgrounds + xml_path: assets/xml/textures/backgrounds.xml +- name: textures/do_action_static + xml_path: assets/xml/textures/do_action_static.xml +- name: textures/icon_item_24_static + xml_path: assets/xml/textures/icon_item_24_static.xml +- name: textures/icon_item_dungeon_static + xml_path: assets/xml/textures/icon_item_dungeon_static.xml +- name: textures/icon_item_field_static + xml_path: assets/xml/textures/icon_item_field_static.xml +- name: textures/icon_item_gameover_static + xml_path: assets/xml/textures/icon_item_gameover_static.xml +- name: textures/icon_item_jpn_static + xml_path: assets/xml/textures/icon_item_jpn_static.xml +- name: textures/icon_item_nes_static + xml_path: assets/xml/textures/icon_item_nes_static.xml +- name: textures/icon_item_static + xml_path: assets/xml/textures/icon_item_static.xml +- name: textures/item_name_static + xml_path: assets/xml/textures/item_name_static.xml +- name: textures/kanji + xml_path: assets/xml/textures/kanji.xml +- name: textures/map_48x85_static + xml_path: assets/xml/textures/map_48x85_static.xml +- name: textures/map_grand_static + xml_path: assets/xml/textures/map_grand_static.xml +- name: textures/map_i_static + xml_path: assets/xml/textures/map_i_static.xml +- name: textures/map_name_static + xml_path: assets/xml/textures/map_name_static.xml +- name: textures/message_static + xml_path: assets/xml/textures/message_static.xml +- name: textures/message_texture_static + xml_path: assets/xml/textures/message_texture_static.xml +- name: textures/nes_font_static + xml_path: assets/xml/textures/nes_font_static_v2.xml +- name: textures/nintendo_rogo_static + xml_path: assets/xml/textures/nintendo_rogo_static_v2.xml +- name: textures/parameter_static + xml_path: assets/xml/textures/parameter_static.xml +- name: textures/place_title_cards + xml_path: assets/xml/textures/place_title_cards.xml +- name: textures/skyboxes + xml_path: assets/xml/textures/skyboxes.xml +- name: textures/title_static + xml_path: assets/xml/textures/title_static.xml diff --git a/baseroms/gc-us-mq/segments.csv b/baseroms/gc-us-mq/segments.csv new file mode 100644 index 0000000000..0d2cfff4bc --- /dev/null +++ b/baseroms/gc-us-mq/segments.csv @@ -0,0 +1,1510 @@ +Name,VRAM start +makerom,80000000 +boot,80000460 +dmadata, +Audiobank, +Audioseq, +Audiotable, +kanji, +link_animetion, +icon_item_static, +icon_item_24_static, +icon_item_field_static, +icon_item_dungeon_static, +icon_item_gameover_static, +icon_item_jpn_static, +icon_item_nes_static, +item_name_static, +map_name_static, +do_action_static, +message_static, +message_texture_static, +nes_font_static, +jpn_message_data_static, +nes_message_data_static, +staff_message_data_static, +map_grand_static, +map_48x85_static, +map_i_static, +code,80010EE0 +ovl_title,80800000 +ovl_select,80800850 +ovl_opening,808034D0 +ovl_file_choose,80803630 +ovl_kaleido_scope,808135B0 +ovl_player_actor,8082FDA0 +ovl_map_mark_data,80856580 +ovl_En_Test,8085D060 +ovl_Arms_Hook,80862910 +ovl_Arrow_Fire,80863680 +ovl_Arrow_Ice,80865560 +ovl_Arrow_Light,80867460 +ovl_Bg_Bdan_Objects,80869370 +ovl_Bg_Bdan_Switch,8086A640 +ovl_Bg_Bom_Guard,8086BA70 +ovl_Bg_Bombwall,8086BC90 +ovl_Bg_Bowl_Wall,8086C550 +ovl_Bg_Breakwall,8086CED0 +ovl_Bg_Ddan_Jd,8086DD40 +ovl_Bg_Ddan_Kd,8086E390 +ovl_Bg_Dodoago,8086EC80 +ovl_Bg_Dy_Yoseizo,8086FA30 +ovl_Bg_Ganon_Otyuka,80872820 +ovl_Bg_Gate_Shutter,80874E60 +ovl_Bg_Gjyo_Bridge,808752F0 +ovl_Bg_Gnd_Darkmeiro,808757E0 +ovl_Bg_Gnd_Firemeiro,80875FA0 +ovl_Bg_Gnd_Iceblock,808764F0 +ovl_Bg_Gnd_Nisekabe,808775F0 +ovl_Bg_Gnd_Soulmeiro,80877760 +ovl_Bg_Haka,80877FC0 +ovl_Bg_Haka_Gate,80878680 +ovl_Bg_Haka_Huta,80879720 +ovl_Bg_Haka_Megane,8087A1C0 +ovl_Bg_Haka_MeganeBG,8087A5C0 +ovl_Bg_Haka_Sgami,8087AC80 +ovl_Bg_Haka_Ship,8087B8A0 +ovl_Bg_Haka_Trap,8087C2F0 +ovl_Bg_Haka_Tubo,8087D8C0 +ovl_Bg_Haka_Water,8087E2E0 +ovl_Bg_Haka_Zou,8087EAE0 +ovl_Bg_Heavy_Block,8087FCD0 +ovl_Bg_Hidan_Curtain,808815C0 +ovl_Bg_Hidan_Dalm,80882060 +ovl_Bg_Hidan_Firewall,808828B0 +ovl_Bg_Hidan_Fslift,80883010 +ovl_Bg_Hidan_Fwbig,808834E0 +ovl_Bg_Hidan_Hamstep,808841C0 +ovl_Bg_Hidan_Hrock,80885070 +ovl_Bg_Hidan_Kousi,808858A0 +ovl_Bg_Hidan_Kowarerukabe,80885E30 +ovl_Bg_Hidan_Rock,80886D10 +ovl_Bg_Hidan_Rsekizou,80887E10 +ovl_Bg_Hidan_Sekizou,808889F0 +ovl_Bg_Hidan_Sima,80889E40 +ovl_Bg_Hidan_Syoku,8088AD40 +ovl_Bg_Ice_Objects,8088B1A0 +ovl_Bg_Ice_Shelter,8088C0E0 +ovl_Bg_Ice_Shutter,8088D320 +ovl_Bg_Ice_Turara,8088D790 +ovl_Bg_Ingate,8088DFC0 +ovl_Bg_Jya_1flift,8088E350 +ovl_Bg_Jya_Amishutter,8088E9E0 +ovl_Bg_Jya_Bigmirror,8088ED70 +ovl_Bg_Jya_Block,8088F5C0 +ovl_Bg_Jya_Bombchuiwa,8088F830 +ovl_Bg_Jya_Bombiwa,80890370 +ovl_Bg_Jya_Cobra,80890930 +ovl_Bg_Jya_Goroiwa,80892670 +ovl_Bg_Jya_Haheniron,80892DF0 +ovl_Bg_Jya_Ironobj,808935E0 +ovl_Bg_Jya_Kanaami,80894390 +ovl_Bg_Jya_Lift,80894740 +ovl_Bg_Jya_Megami,80894C90 +ovl_Bg_Jya_Zurerukabe,80895E80 +ovl_Bg_Menkuri_Eye,80896530 +ovl_Bg_Menkuri_Kaiten,808969D0 +ovl_Bg_Menkuri_Nisekabe,80896B60 +ovl_Bg_Mizu_Bwall,80896CB0 +ovl_Bg_Mizu_Movebg,80898180 +ovl_Bg_Mizu_Shutter,80899310 +ovl_Bg_Mizu_Uzu,80899B10 +ovl_Bg_Mizu_Water,80899CE0 +ovl_Bg_Mjin,8089A9B0 +ovl_Bg_Mori_Bigst,8089ADA0 +ovl_Bg_Mori_Elevator,8089B6D0 +ovl_Bg_Mori_Hashigo,8089C1C0 +ovl_Bg_Mori_Hashira4,8089CA80 +ovl_Bg_Mori_Hineri,8089D010 +ovl_Bg_Mori_Idomizu,8089DD60 +ovl_Bg_Mori_Kaitenkabe,8089E3A0 +ovl_Bg_Mori_Rakkatenjo,8089EA10 +ovl_Bg_Po_Event,8089F390 +ovl_Bg_Po_Syokudai,808A11D0 +ovl_Bg_Pushbox,808A1B40 +ovl_Bg_Relay_Objects,808A1E40 +ovl_Bg_Spot00_Break,808A25F0 +ovl_Bg_Spot00_Hanebasi,808A2790 +ovl_Bg_Spot01_Fusya,808A38A0 +ovl_Bg_Spot01_Idohashira,808A3B40 +ovl_Bg_Spot01_Idomizu,808A4740 +ovl_Bg_Spot01_Idosoko,808A4A60 +ovl_Bg_Spot01_Objects2,808A4C70 +ovl_Bg_Spot02_Objects,808A5130 +ovl_Bg_Spot03_Taki,808A6490 +ovl_Bg_Spot05_Soko,808A6DB0 +ovl_Bg_Spot06_Objects,808A70D0 +ovl_Bg_Spot07_Taki,808A84D0 +ovl_Bg_Spot08_Bakudankabe,808A8AC0 +ovl_Bg_Spot08_Iceblock,808A9160 +ovl_Bg_Spot09_Obj,808AA1A0 +ovl_Bg_Spot11_Bakudankabe,808AA6C0 +ovl_Bg_Spot11_Oasis,808AAD00 +ovl_Bg_Spot12_Gate,808AB430 +ovl_Bg_Spot12_Saku,808AB840 +ovl_Bg_Spot15_Rrbox,808ABD00 +ovl_Bg_Spot15_Saku,808ACAE0 +ovl_Bg_Spot16_Bombstone,808ACE20 +ovl_Bg_Spot16_Doughnut,808AE370 +ovl_Bg_Spot17_Bakudankabe,808AE930 +ovl_Bg_Spot17_Funen,808AF020 +ovl_Bg_Spot18_Basket,808AF270 +ovl_Bg_Spot18_Futa,808B0260 +ovl_Bg_Spot18_Obj,808B0400 +ovl_Bg_Spot18_Shutter,808B0CD0 +ovl_Bg_Sst_Floor,808B1220 +ovl_Bg_Toki_Hikari,808B1780 +ovl_Bg_Toki_Swd,808B2520 +ovl_Bg_Treemouth,808B3B70 +ovl_Bg_Umajump,808B51D0 +ovl_Bg_Vb_Sima,808B5360 +ovl_Bg_Ydan_Hasi,808B5A80 +ovl_Bg_Ydan_Maruta,808B6230 +ovl_Bg_Ydan_Sp,808B6910 +ovl_Bg_Zg,808B8030 +ovl_Boss_Dodongo,808B8480 +ovl_Boss_Fd,808C1F80 +ovl_Boss_Fd2,808C92E0 +ovl_Boss_Ganon,808CD010 +ovl_Boss_Ganon2,808F2E40 +ovl_Boss_Ganondrof,80905CB0 +ovl_Boss_Goma,8090AA40 +ovl_Boss_Mo,809109E0 +ovl_Boss_Sst,80920FC0 +ovl_Boss_Tw,8092D590 +ovl_Boss_Va,80943160 +ovl_Demo_6K,8095A3F0 +ovl_Demo_Du,8095D150 +ovl_Demo_Ec,80960930 +ovl_Demo_Effect,80964190 +ovl_Demo_Ext,80969D30 +ovl_Demo_Geff,8096A680 +ovl_Demo_Gj,8096AEA0 +ovl_Demo_Go,8096EB50 +ovl_Demo_Gt,8096F8A0 +ovl_Demo_Ik,80974EB0 +ovl_Demo_Im,809763C0 +ovl_Demo_Kankyo,8097A330 +ovl_Demo_Kekkai,8097E020 +ovl_Demo_Sa,8097F310 +ovl_Demo_Shd,80981E30 +ovl_Demo_Tre_Lgt,80984240 +ovl_Door_Ana,80984950 +ovl_Door_Gerudo,80984FC0 +ovl_Door_Killer,809855B0 +ovl_Door_Shutter,80986B20 +ovl_Door_Toki,80988DE0 +ovl_Door_Warp1,80988F40 +ovl_Efc_Erupc,8098D250 +ovl_Eff_Dust,8098DD40 +ovl_Effect_Ss_Blast,8098F110 +ovl_Effect_Ss_Bomb,8098F4A0 +ovl_Effect_Ss_Bomb2,8098F8D0 +ovl_Effect_Ss_Bubble,809901D0 +ovl_Effect_Ss_D_Fire,80990650 +ovl_Effect_Ss_Dead_Db,80990B40 +ovl_Effect_Ss_Dead_Dd,80991020 +ovl_Effect_Ss_Dead_Ds,809915B0 +ovl_Effect_Ss_Dead_Sound,80991A30 +ovl_Effect_Ss_Dt_Bubble,80991B70 +ovl_Effect_Ss_Dust,80992100 +ovl_Effect_Ss_En_Fire,80992940 +ovl_Effect_Ss_En_Ice,80993090 +ovl_Effect_Ss_Extra,80993950 +ovl_Effect_Ss_Fcircle,80993D10 +ovl_Effect_Ss_Fhg_Flash,809941C0 +ovl_Effect_Ss_Fire_Tail,80995140 +ovl_Effect_Ss_G_Fire,80995840 +ovl_Effect_Ss_G_Magma,80995AD0 +ovl_Effect_Ss_G_Magma2,80995D30 +ovl_Effect_Ss_G_Ripple,80996240 +ovl_Effect_Ss_G_Spk,809967A0 +ovl_Effect_Ss_G_Splash,80996D50 +ovl_Effect_Ss_Hahen,80997200 +ovl_Effect_Ss_HitMark,80997840 +ovl_Effect_Ss_Ice_Piece,80997D90 +ovl_Effect_Ss_Ice_Smoke,809981D0 +ovl_Effect_Ss_K_Fire,809986B0 +ovl_Effect_Ss_Kakera,80998AF0 +ovl_Effect_Ss_KiraKira,80999B80 +ovl_Effect_Ss_Lightning,8099A1F0 +ovl_Effect_Ss_Sibuki,8099A8C0 +ovl_Effect_Ss_Sibuki2,8099AF90 +ovl_Effect_Ss_Solder_Srch_Ball,8099B2C0 +ovl_Effect_Ss_Stick,8099B470 +ovl_Effect_Ss_Stone1,8099B810 +ovl_Elf_Msg,8099BB90 +ovl_Elf_Msg2,8099C180 +ovl_En_Am,8099C5F0 +ovl_En_Ani,8099E9F0 +ovl_En_Anubice,8099F760 +ovl_En_Anubice_Fire,809A0A10 +ovl_En_Anubice_Tag,809A17D0 +ovl_En_Arow_Trap,809A1AA0 +ovl_En_Arrow,809A1BF0 +ovl_En_Attack_Niw,809A32F0 +ovl_En_Ba,809A4550 +ovl_En_Bb,809A6420 +ovl_En_Bdfire,809AA100 +ovl_En_Bigokuta,809AACA0 +ovl_En_Bili,809AD7A0 +ovl_En_Bird,809AFA70 +ovl_En_Blkobj,809AFF30 +ovl_En_Bom,809B0490 +ovl_En_Bom_Bowl_Man,809B1360 +ovl_En_Bom_Bowl_Pit,809B28A0 +ovl_En_Bom_Chu,809B3210 +ovl_En_Bombf,809B48B0 +ovl_En_Boom,809B5D40 +ovl_En_Box,809B6610 +ovl_En_Brob,809B8170 +ovl_En_Bubble,809B9260 +ovl_En_Butte,809BA680 +ovl_En_Bw,809BBC50 +ovl_En_Bx,809BEFE0 +ovl_En_Changer,809BFAE0 +ovl_En_Clear_Tag,809C04C0 +ovl_En_Cow,809CBA60 +ovl_En_Crow,809CCEC0 +ovl_En_Cs,809CE560 +ovl_En_Daiku,809CF790 +ovl_En_Daiku_Kakariko,809D0ED0 +ovl_En_Dekubaba,809D2290 +ovl_En_Dekunuts,809D5D40 +ovl_En_Dh,809D7540 +ovl_En_Dha,809D9020 +ovl_En_Diving_Game,809DA020 +ovl_En_Dns,809DB9D0 +ovl_En_Dnt_Demo,809DCD60 +ovl_En_Dnt_Jiji,809DDA80 +ovl_En_Dnt_Nomal,809DEFA0 +ovl_En_Dodojr,809E1DA0 +ovl_En_Dodongo,809E3C40 +ovl_En_Dog,809E69E0 +ovl_En_Door,809E7B90 +ovl_En_Ds,809E89D0 +ovl_En_Du,809E95F0 +ovl_En_Dy_Extra,809EB080 +ovl_En_Eg,809EB620 +ovl_En_Eiyer,809EB7D0 +ovl_En_Elf,809ED430 +ovl_En_Encount1,809F1DF0 +ovl_En_Encount2,809F2950 +ovl_En_Ex_Item,809F3B80 +ovl_En_Ex_Ruppy,809F4D00 +ovl_En_Fd,809F5DC0 +ovl_En_Fd_Fire,809F8A60 +ovl_En_Fhg_Fire,809F9770 +ovl_En_Fire_Rock,809FBE10 +ovl_En_Firefly,809FCF20 +ovl_En_Fish,809FF090 +ovl_En_Floormas,80A011A0 +ovl_En_Fr,80A04580 +ovl_En_Fu,80A07010 +ovl_En_Fw,80A07D60 +ovl_En_Fz,80A09520 +ovl_En_G_Switch,80A0B530 +ovl_En_Ganon_Mant,80A0CD50 +ovl_En_Ganon_Organ,80A10F80 +ovl_En_Gb,80A17FC0 +ovl_En_Ge1,80A196F0 +ovl_En_Ge2,80A1B720 +ovl_En_Ge3,80A1D0C0 +ovl_En_GeldB,80A1DD00 +ovl_En_GirlA,80A230B0 +ovl_En_Gm,80A259D0 +ovl_En_Go,80A26700 +ovl_En_Go2,80A2AD40 +ovl_En_Goma,80A30D80 +ovl_En_Goroiwa,80A33A30 +ovl_En_Gs,80A35DF0 +ovl_En_Guest,80A37C60 +ovl_En_Hata,80A38600 +ovl_En_Heishi1,80A38B90 +ovl_En_Heishi2,80A3A0A0 +ovl_En_Heishi3,80A3C2A0 +ovl_En_Heishi4,80A3CC70 +ovl_En_Hintnuts,80A3DB70 +ovl_En_Holl,80A3F5A0 +ovl_En_Honotrap,80A40570 +ovl_En_Horse,80A41AD0 +ovl_En_Horse_Game_Check,80A4DD30 +ovl_En_Horse_Ganon,80A4EE00 +ovl_En_Horse_Link_Child,80A4FB80 +ovl_En_Horse_Normal,80A51980 +ovl_En_Horse_Zelda,80A53FA0 +ovl_En_Hs,80A54A90 +ovl_En_Hs2,80A55630 +ovl_En_Hy,80A55C10 +ovl_En_Ice_Hono,80A59550 +ovl_En_Ik,80A5A740 +ovl_En_In,80A5EDA0 +ovl_En_Insect,80A61B40 +ovl_En_Ishi,80A64060 +ovl_En_It,80A6D1B0 +ovl_En_Jj,80A6D340 +ovl_En_Js,80A6E910 +ovl_En_Jsjutan,80A6F2E0 +ovl_En_Kakasi,80A74C10 +ovl_En_Kakasi2,80A75950 +ovl_En_Kakasi3,80A76070 +ovl_En_Kanban,80A77150 +ovl_En_Karebaba,80A7A2A0 +ovl_En_Ko,80A7BB90 +ovl_En_Kusa,80A7FCD0 +ovl_En_Kz,80A811B0 +ovl_En_Light,80A82750 +ovl_En_Lightbox,80A83550 +ovl_En_M_Fire1,80A839D0 +ovl_En_M_Thunder,80A83B70 +ovl_En_Ma1,80A85170 +ovl_En_Ma2,80A86450 +ovl_En_Ma3,80A874B0 +ovl_En_Mag,80A88460 +ovl_En_Mb,80A8AEB0 +ovl_En_Md,80A8F0E0 +ovl_En_Mk,80A91750 +ovl_En_Mm,80A925E0 +ovl_En_Mm2,80A93C40 +ovl_En_Ms,80A94A00 +ovl_En_Mu,80A950F0 +ovl_En_Nb,80A95A10 +ovl_En_Niw,80A99FE0 +ovl_En_Niw_Girl,80A9D310 +ovl_En_Niw_Lady,80A9DDE0 +ovl_En_Nutsball,80A9F6E0 +ovl_En_Nwc,80A9FD00 +ovl_En_Ny,80AA0720 +ovl_En_OE2,80AA2060 +ovl_En_Okarina_Effect,80AA2140 +ovl_En_Okarina_Tag,80AA2500 +ovl_En_Okuta,80AA3A00 +ovl_En_Ossan,80AA5FE0 +ovl_En_Owl,80AAC5C0 +ovl_En_Part,80AB0160 +ovl_En_Peehat,80AB17C0 +ovl_En_Po_Desert,80AB4EC0 +ovl_En_Po_Field,80AB5C80 +ovl_En_Po_Relay,80AB9710 +ovl_En_Po_Sisters,80ABAE20 +ovl_En_Poh,80ABFB10 +ovl_En_Pu_box,80AC3D00 +ovl_En_Rd,80AC4040 +ovl_En_Reeba,80AC6900 +ovl_En_River_Sound,80AC8370 +ovl_En_Rl,80AC8D00 +ovl_En_Rr,80AC9BE0 +ovl_En_Ru1,80ACC110 +ovl_En_Ru2,80AD37B0 +ovl_En_Sa,80AD6530 +ovl_En_Sb,80AD87A0 +ovl_En_Scene_Change,80AD9BE0 +ovl_En_Sda,80AD9D10 +ovl_En_Shopnuts,80ADB400 +ovl_En_Si,80ADC310 +ovl_En_Siofuki,80ADC810 +ovl_En_Skb,80ADD5C0 +ovl_En_Skj,80ADEEB0 +ovl_En_Skjneedle,80AE2800 +ovl_En_Ssh,80AE2B10 +ovl_En_St,80AE5100 +ovl_En_Sth,80AE7D70 +ovl_En_Stream,80AEBE30 +ovl_En_Sw,80AEC3C0 +ovl_En_Syateki_Itm,80AEFBB0 +ovl_En_Syateki_Man,80AF0950 +ovl_En_Syateki_Niw,80AF1710 +ovl_En_Ta,80AF37A0 +ovl_En_Takara_Man,80AF7160 +ovl_En_Tana,80AF7A20 +ovl_En_Tg,80AF7CD0 +ovl_En_Tite,80AF83B0 +ovl_En_Tk,80AFB150 +ovl_En_Torch,80AFCF80 +ovl_En_Torch2,80AFD070 +ovl_En_Toryo,80AFF810 +ovl_En_Tp,80B004A0 +ovl_En_Tr,80B02310 +ovl_En_Trap,80B03C10 +ovl_En_Tubo_Trap,80B04EB0 +ovl_En_Vali,80B05B50 +ovl_En_Vase,80B08210 +ovl_En_Vb_Ball,80B08310 +ovl_En_Viewer,80B094C0 +ovl_En_Vm,80B0C380 +ovl_En_Wall_Tubo,80B0DC40 +ovl_En_Wallmas,80B0E130 +ovl_En_Weather_Tag,80B0FB40 +ovl_En_Weiyer,80B10A30 +ovl_En_Wf,80B12430 +ovl_En_Wonder_Item,80B16740 +ovl_En_Wonder_Talk,80B17470 +ovl_En_Wonder_Talk2,80B17B00 +ovl_En_Wood02,80B181A0 +ovl_En_Xc,80B19380 +ovl_En_Yabusame_Mark,80B1FB10 +ovl_En_Yukabyun,80B201E0 +ovl_En_Zf,80B207F0 +ovl_En_Zl1,80B272E0 +ovl_En_Zl2,80B2B0F0 +ovl_En_Zl3,80B2F7F0 +ovl_En_Zl4,80B37640 +ovl_En_Zo,80B3C070 +ovl_En_fHG,80B3E630 +ovl_End_Title,80B40F60 +ovl_Fishing,80B45080 +ovl_Item_B_Heart,80B5FC20 +ovl_Item_Etcetera,80B60030 +ovl_Item_Inbox,80B60900 +ovl_Item_Ocarina,80B60A60 +ovl_Item_Shield,80B61230 +ovl_Magic_Dark,80B61C40 +ovl_Magic_Fire,80B63490 +ovl_Magic_Wind,80B65790 +ovl_Mir_Ray,80B67490 +ovl_Obj_Bean,80B68D40 +ovl_Obj_Blockstop,80B6B4D0 +ovl_Obj_Bombiwa,80B6B670 +ovl_Obj_Comb,80B6BBE0 +ovl_Obj_Dekujr,80B6C440 +ovl_Obj_Elevator,80B6CA80 +ovl_Obj_Hamishi,80B6CE40 +ovl_Obj_Hana,80B6D690 +ovl_Obj_Hsblock,80B6D9A0 +ovl_Obj_Ice_Poly,80B6DF70 +ovl_Obj_Kibako,80B6E920 +ovl_Obj_Kibako2,80B6F620 +ovl_Obj_Lift,80B6FCE0 +ovl_Obj_Lightswitch,80B70700 +ovl_Obj_Makekinsuta,80B71B30 +ovl_Obj_Makeoshihiki,80B71C80 +ovl_Obj_Mure,80B72110 +ovl_Obj_Mure2,80B73120 +ovl_Obj_Mure3,80B73B40 +ovl_Obj_Oshihiki,80B74310 +ovl_Obj_Roomtimer,80B75DC0 +ovl_Obj_Switch,80B76010 +ovl_Obj_Syokudai,80B77DF0 +ovl_Obj_Timeblock,80B78A40 +ovl_Obj_Tsubo,80B79690 +ovl_Obj_Warp2block,80B7A680 +ovl_Object_Kankyo,80B7B1B0 +ovl_Oceff_Spot,80B7E430 +ovl_Oceff_Storm,80B7F360 +ovl_Oceff_Wipe,80B80F10 +ovl_Oceff_Wipe2,80B81C90 +ovl_Oceff_Wipe3,80B83400 +ovl_Oceff_Wipe4,80B84B50 +ovl_Shot_Sun,80B85B30 +gameplay_keep, +gameplay_field_keep, +gameplay_dangeon_keep, +gameplay_object_exchange_static, +object_link_boy, +object_link_child, +object_box, +object_human, +object_okuta, +object_poh, +object_wallmaster, +object_dy_obj, +object_firefly, +object_dodongo, +object_fire, +object_niw, +object_tite, +object_reeba, +object_peehat, +object_kingdodongo, +object_horse, +object_zf, +object_goma, +object_zl1, +object_gol, +object_bubble, +object_dodojr, +object_torch2, +object_bl, +object_tp, +object_oA1, +object_st, +object_bw, +object_ei, +object_horse_normal, +object_oB1, +object_o_anime, +object_spot04_objects, +object_ddan_objects, +object_hidan_objects, +object_horse_ganon, +object_oA2, +object_spot00_objects, +object_mb, +object_bombf, +object_sk2, +object_oE1, +object_oE_anime, +object_oE2, +object_ydan_objects, +object_gnd, +object_am, +object_dekubaba, +object_oA3, +object_oA4, +object_oA5, +object_oA6, +object_oA7, +object_jj, +object_oA8, +object_oA9, +object_oB2, +object_oB3, +object_oB4, +object_horse_zelda, +object_opening_demo1, +object_warp1, +object_b_heart, +object_dekunuts, +object_oE3, +object_oE4, +object_menkuri_objects, +object_oE5, +object_oE6, +object_oE7, +object_oE8, +object_oE9, +object_oE10, +object_oE11, +object_oE12, +object_vali, +object_oA10, +object_oA11, +object_mizu_objects, +object_fhg, +object_ossan, +object_mori_hineri1, +object_Bb, +object_toki_objects, +object_yukabyun, +object_zl2, +object_mjin, +object_mjin_flash, +object_mjin_dark, +object_mjin_flame, +object_mjin_ice, +object_mjin_soul, +object_mjin_wind, +object_mjin_oka, +object_haka_objects, +object_spot06_objects, +object_ice_objects, +object_relay_objects, +object_mori_hineri1a, +object_mori_hineri2, +object_mori_hineri2a, +object_mori_objects, +object_mori_tex, +object_spot08_obj, +object_warp2, +object_hata, +object_bird, +object_wood02, +object_lightbox, +object_pu_box, +object_trap, +object_vase, +object_im, +object_ta, +object_tk, +object_xc, +object_vm, +object_bv, +object_hakach_objects, +object_efc_crystal_light, +object_efc_fire_ball, +object_efc_flash, +object_efc_lgt_shower, +object_efc_star_field, +object_god_lgt, +object_light_ring, +object_triforce_spot, +object_medal, +object_bdan_objects, +object_sd, +object_rd, +object_po_sisters, +object_heavy_object, +object_gndd, +object_fd, +object_du, +object_fw, +object_horse_link_child, +object_spot02_objects, +object_haka, +object_ru1, +object_syokudai, +object_fd2, +object_dh, +object_rl, +object_efc_tw, +object_demo_tre_lgt, +object_gi_key, +object_mir_ray, +object_brob, +object_gi_jewel, +object_spot09_obj, +object_spot18_obj, +object_bdoor, +object_spot17_obj, +object_shop_dungen, +object_nb, +object_mo, +object_sb, +object_gi_melody, +object_gi_heart, +object_gi_compass, +object_gi_bosskey, +object_gi_medal, +object_gi_nuts, +object_sa, +object_gi_hearts, +object_gi_arrowcase, +object_gi_bombpouch, +object_in, +object_tr, +object_spot16_obj, +object_oE1s, +object_oE4s, +object_os_anime, +object_gi_bottle, +object_gi_stick, +object_gi_map, +object_oF1d_map, +object_ru2, +object_gi_shield_1, +object_dekujr, +object_gi_magicpot, +object_gi_bomb_1, +object_oF1s, +object_ma2, +object_gi_purse, +object_hni, +object_tw, +object_rr, +object_bxa, +object_anubice, +object_gi_gerudo, +object_gi_arrow, +object_gi_bomb_2, +object_gi_egg, +object_gi_scale, +object_gi_shield_2, +object_gi_hookshot, +object_gi_ocarina, +object_gi_milk, +object_ma1, +object_ganon, +object_sst, +object_ny, +object_fr, +object_gi_pachinko, +object_gi_boomerang, +object_gi_bow, +object_gi_glasses, +object_gi_liquid, +object_ani, +object_demo_6k, +object_gi_shield_3, +object_gi_letter, +object_spot15_obj, +object_jya_obj, +object_gi_clothes, +object_gi_bean, +object_gi_fish, +object_gi_saw, +object_gi_hammer, +object_gi_grass, +object_gi_longsword, +object_spot01_objects, +object_md, +object_km1, +object_kw1, +object_zo, +object_kz, +object_umajump, +object_masterkokiri, +object_masterkokirihead, +object_mastergolon, +object_masterzoora, +object_aob, +object_ik, +object_ahg, +object_cne, +object_gi_niwatori, +object_skj, +object_gi_bottle_letter, +object_bji, +object_bba, +object_gi_ocarina_0, +object_ds, +object_ane, +object_boj, +object_spot03_object, +object_spot07_object, +object_fz, +object_bob, +object_ge1, +object_yabusame_point, +object_gi_boots_2, +object_gi_seed, +object_gnd_magic, +object_d_elevator, +object_d_hsblock, +object_d_lift, +object_mamenoki, +object_goroiwa, +object_toryo, +object_daiku, +object_nwc, +object_blkobj, +object_gm, +object_ms, +object_hs, +object_ingate, +object_lightswitch, +object_kusa, +object_tsubo, +object_gi_gloves, +object_gi_coin, +object_kanban, +object_gjyo_objects, +object_owl, +object_mk, +object_fu, +object_gi_ki_tan_mask, +object_gi_redead_mask, +object_gi_skj_mask, +object_gi_rabit_mask, +object_gi_truth_mask, +object_ganon_objects, +object_siofuki, +object_stream, +object_mm, +object_fa, +object_os, +object_gi_eye_lotion, +object_gi_powder, +object_gi_mushroom, +object_gi_ticketstone, +object_gi_brokensword, +object_js, +object_cs, +object_gi_prescription, +object_gi_bracelet, +object_gi_soldout, +object_gi_frog, +object_mag, +object_door_gerudo, +object_gt, +object_efc_erupc, +object_zl2_anime1, +object_zl2_anime2, +object_gi_golonmask, +object_gi_zoramask, +object_gi_gerudomask, +object_ganon2, +object_ka, +object_ts, +object_zg, +object_gi_hoverboots, +object_gi_m_arrow, +object_ds2, +object_ec, +object_fish, +object_gi_sutaru, +object_gi_goddess, +object_ssh, +object_bigokuta, +object_bg, +object_spot05_objects, +object_spot12_obj, +object_bombiwa, +object_hintnuts, +object_rs, +object_spot00_break, +object_gla, +object_shopnuts, +object_geldb, +object_gr, +object_dog, +object_jya_iron, +object_jya_door, +object_spot01_objects2, +object_spot11_obj, +object_kibako2, +object_dns, +object_dnk, +object_gi_fire, +object_gi_insect, +object_gi_butterfly, +object_gi_ghost, +object_gi_soul, +object_bowl, +object_po_field, +object_demo_kekkai, +object_efc_doughnut, +object_gi_dekupouch, +object_ganon_anime1, +object_ganon_anime2, +object_ganon_anime3, +object_gi_rupy, +object_spot01_matoya, +object_spot01_matoyab, +object_po_composer, +object_mu, +object_wf, +object_skb, +object_gj, +object_geff, +object_haka_door, +object_gs, +object_ps, +object_bwall, +object_crow, +object_cow, +object_cob, +object_gi_sword_1, +object_door_killer, +object_ouke_haka, +object_timeblock, +object_zl4, +g_pn_01, +g_pn_02, +g_pn_03, +g_pn_04, +g_pn_05, +g_pn_06, +g_pn_07, +g_pn_08, +g_pn_09, +g_pn_10, +g_pn_11, +g_pn_12, +g_pn_13, +g_pn_14, +g_pn_15, +g_pn_16, +g_pn_17, +g_pn_18, +g_pn_19, +g_pn_20, +g_pn_21, +g_pn_22, +g_pn_23, +g_pn_24, +g_pn_25, +g_pn_26, +g_pn_27, +g_pn_28, +g_pn_29, +g_pn_30, +g_pn_31, +g_pn_32, +g_pn_33, +g_pn_34, +g_pn_35, +g_pn_36, +g_pn_37, +g_pn_38, +g_pn_39, +g_pn_40, +g_pn_41, +g_pn_42, +g_pn_43, +g_pn_44, +g_pn_45, +g_pn_46, +g_pn_47, +g_pn_48, +g_pn_49, +g_pn_50, +g_pn_51, +g_pn_52, +g_pn_53, +g_pn_54, +g_pn_55, +g_pn_56, +g_pn_57, +z_select_static, +nintendo_rogo_static, +title_static, +parameter_static, +vr_fine0_static, +vr_fine0_pal_static, +vr_fine1_static, +vr_fine1_pal_static, +vr_fine2_static, +vr_fine2_pal_static, +vr_fine3_static, +vr_fine3_pal_static, +vr_cloud0_static, +vr_cloud0_pal_static, +vr_cloud1_static, +vr_cloud1_pal_static, +vr_cloud2_static, +vr_cloud2_pal_static, +vr_cloud3_static, +vr_cloud3_pal_static, +vr_holy0_static, +vr_holy0_pal_static, +vr_holy1_static, +vr_holy1_pal_static, +vr_MDVR_static, +vr_MDVR_pal_static, +vr_MNVR_static, +vr_MNVR_pal_static, +vr_RUVR_static, +vr_RUVR_pal_static, +vr_LHVR_static, +vr_LHVR_pal_static, +vr_KHVR_static, +vr_KHVR_pal_static, +vr_K3VR_static, +vr_K3VR_pal_static, +vr_K4VR_static, +vr_K4VR_pal_static, +vr_K5VR_static, +vr_K5VR_pal_static, +vr_SP1a_static, +vr_SP1a_pal_static, +vr_MLVR_static, +vr_MLVR_pal_static, +vr_KKRVR_static, +vr_KKRVR_pal_static, +vr_KR3VR_static, +vr_KR3VR_pal_static, +vr_IPVR_static, +vr_IPVR_pal_static, +vr_KSVR_static, +vr_KSVR_pal_static, +vr_GLVR_static, +vr_GLVR_pal_static, +vr_ZRVR_static, +vr_ZRVR_pal_static, +vr_DGVR_static, +vr_DGVR_pal_static, +vr_ALVR_static, +vr_ALVR_pal_static, +vr_NSVR_static, +vr_NSVR_pal_static, +vr_LBVR_static, +vr_LBVR_pal_static, +vr_TTVR_static, +vr_TTVR_pal_static, +vr_FCVR_static, +vr_FCVR_pal_static, +elf_message_field, +elf_message_ydan, +ydan_scene, +ydan_room_0, +ydan_room_1, +ydan_room_2, +ydan_room_3, +ydan_room_4, +ydan_room_5, +ydan_room_6, +ydan_room_7, +ydan_room_8, +ydan_room_9, +ydan_room_10, +ydan_room_11, +ddan_scene, +ddan_room_0, +ddan_room_1, +ddan_room_2, +ddan_room_3, +ddan_room_4, +ddan_room_5, +ddan_room_6, +ddan_room_7, +ddan_room_8, +ddan_room_9, +ddan_room_10, +ddan_room_11, +ddan_room_12, +ddan_room_13, +ddan_room_14, +ddan_room_15, +ddan_room_16, +bdan_scene, +bdan_room_0, +bdan_room_1, +bdan_room_2, +bdan_room_3, +bdan_room_4, +bdan_room_5, +bdan_room_6, +bdan_room_7, +bdan_room_8, +bdan_room_9, +bdan_room_10, +bdan_room_11, +bdan_room_12, +bdan_room_13, +bdan_room_14, +bdan_room_15, +Bmori1_scene, +Bmori1_room_0, +Bmori1_room_1, +Bmori1_room_2, +Bmori1_room_3, +Bmori1_room_4, +Bmori1_room_5, +Bmori1_room_6, +Bmori1_room_7, +Bmori1_room_8, +Bmori1_room_9, +Bmori1_room_10, +Bmori1_room_11, +Bmori1_room_12, +Bmori1_room_13, +Bmori1_room_14, +Bmori1_room_15, +Bmori1_room_16, +Bmori1_room_17, +Bmori1_room_18, +Bmori1_room_19, +Bmori1_room_20, +Bmori1_room_21, +Bmori1_room_22, +HIDAN_scene, +HIDAN_room_0, +HIDAN_room_1, +HIDAN_room_2, +HIDAN_room_3, +HIDAN_room_4, +HIDAN_room_5, +HIDAN_room_6, +HIDAN_room_7, +HIDAN_room_8, +HIDAN_room_9, +HIDAN_room_10, +HIDAN_room_11, +HIDAN_room_12, +HIDAN_room_13, +HIDAN_room_14, +HIDAN_room_15, +HIDAN_room_16, +HIDAN_room_17, +HIDAN_room_18, +HIDAN_room_19, +HIDAN_room_20, +HIDAN_room_21, +HIDAN_room_22, +HIDAN_room_23, +HIDAN_room_24, +HIDAN_room_25, +HIDAN_room_26, +MIZUsin_scene, +MIZUsin_room_0, +MIZUsin_room_1, +MIZUsin_room_2, +MIZUsin_room_3, +MIZUsin_room_4, +MIZUsin_room_5, +MIZUsin_room_6, +MIZUsin_room_7, +MIZUsin_room_8, +MIZUsin_room_9, +MIZUsin_room_10, +MIZUsin_room_11, +MIZUsin_room_12, +MIZUsin_room_13, +MIZUsin_room_14, +MIZUsin_room_15, +MIZUsin_room_16, +MIZUsin_room_17, +MIZUsin_room_18, +MIZUsin_room_19, +MIZUsin_room_20, +MIZUsin_room_21, +MIZUsin_room_22, +jyasinzou_scene, +jyasinzou_room_0, +jyasinzou_room_1, +jyasinzou_room_2, +jyasinzou_room_3, +jyasinzou_room_4, +jyasinzou_room_5, +jyasinzou_room_6, +jyasinzou_room_7, +jyasinzou_room_8, +jyasinzou_room_9, +jyasinzou_room_10, +jyasinzou_room_11, +jyasinzou_room_12, +jyasinzou_room_13, +jyasinzou_room_14, +jyasinzou_room_15, +jyasinzou_room_16, +jyasinzou_room_17, +jyasinzou_room_18, +jyasinzou_room_19, +jyasinzou_room_20, +jyasinzou_room_21, +jyasinzou_room_22, +jyasinzou_room_23, +jyasinzou_room_24, +jyasinzou_room_25, +jyasinzou_room_26, +jyasinzou_room_27, +jyasinzou_room_28, +HAKAdan_scene, +HAKAdan_room_0, +HAKAdan_room_1, +HAKAdan_room_2, +HAKAdan_room_3, +HAKAdan_room_4, +HAKAdan_room_5, +HAKAdan_room_6, +HAKAdan_room_7, +HAKAdan_room_8, +HAKAdan_room_9, +HAKAdan_room_10, +HAKAdan_room_11, +HAKAdan_room_12, +HAKAdan_room_13, +HAKAdan_room_14, +HAKAdan_room_15, +HAKAdan_room_16, +HAKAdan_room_17, +HAKAdan_room_18, +HAKAdan_room_19, +HAKAdan_room_20, +HAKAdan_room_21, +HAKAdan_room_22, +HAKAdanCH_scene, +HAKAdanCH_room_0, +HAKAdanCH_room_1, +HAKAdanCH_room_2, +HAKAdanCH_room_3, +HAKAdanCH_room_4, +HAKAdanCH_room_5, +HAKAdanCH_room_6, +ice_doukutu_scene, +ice_doukutu_room_0, +ice_doukutu_room_1, +ice_doukutu_room_2, +ice_doukutu_room_3, +ice_doukutu_room_4, +ice_doukutu_room_5, +ice_doukutu_room_6, +ice_doukutu_room_7, +ice_doukutu_room_8, +ice_doukutu_room_9, +ice_doukutu_room_10, +ice_doukutu_room_11, +men_scene, +men_room_0, +men_room_1, +men_room_2, +men_room_3, +men_room_4, +men_room_5, +men_room_6, +men_room_7, +men_room_8, +men_room_9, +men_room_10, +ganontika_scene, +ganontika_room_0, +ganontika_room_1, +ganontika_room_2, +ganontika_room_3, +ganontika_room_4, +ganontika_room_5, +ganontika_room_6, +ganontika_room_7, +ganontika_room_8, +ganontika_room_9, +ganontika_room_10, +ganontika_room_11, +ganontika_room_12, +ganontika_room_13, +ganontika_room_14, +ganontika_room_15, +ganontika_room_16, +ganontika_room_17, +ganontika_room_18, +ganontika_room_19, +spot00_scene, +spot00_room_0, +spot01_scene, +spot01_room_0, +spot02_scene, +spot02_room_0, +spot02_room_1, +spot03_scene, +spot03_room_0, +spot03_room_1, +spot04_scene, +spot04_room_0, +spot04_room_1, +spot04_room_2, +spot05_scene, +spot05_room_0, +spot06_scene, +spot06_room_0, +spot07_scene, +spot07_room_0, +spot07_room_1, +spot08_scene, +spot08_room_0, +spot09_scene, +spot09_room_0, +spot10_scene, +spot10_room_0, +spot10_room_1, +spot10_room_2, +spot10_room_3, +spot10_room_4, +spot10_room_5, +spot10_room_6, +spot10_room_7, +spot10_room_8, +spot10_room_9, +spot11_scene, +spot11_room_0, +spot12_scene, +spot12_room_0, +spot12_room_1, +spot13_scene, +spot13_room_0, +spot13_room_1, +spot15_scene, +spot15_room_0, +spot16_scene, +spot16_room_0, +spot17_scene, +spot17_room_0, +spot17_room_1, +spot18_scene, +spot18_room_0, +spot18_room_1, +spot18_room_2, +spot18_room_3, +market_day_scene, +market_day_room_0, +market_night_scene, +market_night_room_0, +kenjyanoma_scene, +kenjyanoma_room_0, +tokinoma_scene, +tokinoma_room_0, +tokinoma_room_1, +link_home_scene, +link_home_room_0, +kokiri_shop_scene, +kokiri_shop_room_0, +kokiri_home_scene, +kokiri_home_room_0, +kakusiana_scene, +kakusiana_room_0, +kakusiana_room_1, +kakusiana_room_2, +kakusiana_room_3, +kakusiana_room_4, +kakusiana_room_5, +kakusiana_room_6, +kakusiana_room_7, +kakusiana_room_8, +kakusiana_room_9, +kakusiana_room_10, +kakusiana_room_11, +kakusiana_room_12, +kakusiana_room_13, +entra_scene, +entra_room_0, +moribossroom_scene, +moribossroom_room_0, +moribossroom_room_1, +syatekijyou_scene, +syatekijyou_room_0, +shop1_scene, +shop1_room_0, +hairal_niwa_scene, +hairal_niwa_room_0, +ganon_tou_scene, +ganon_tou_room_0, +market_alley_scene, +market_alley_room_0, +spot20_scene, +spot20_room_0, +market_ruins_scene, +market_ruins_room_0, +entra_n_scene, +entra_n_room_0, +enrui_scene, +enrui_room_0, +market_alley_n_scene, +market_alley_n_room_0, +hiral_demo_scene, +hiral_demo_room_0, +kokiri_home3_scene, +kokiri_home3_room_0, +malon_stable_scene, +malon_stable_room_0, +kakariko_scene, +kakariko_room_0, +bdan_boss_scene, +bdan_boss_room_0, +bdan_boss_room_1, +FIRE_bs_scene, +FIRE_bs_room_0, +FIRE_bs_room_1, +hut_scene, +hut_room_0, +daiyousei_izumi_scene, +daiyousei_izumi_room_0, +hakaana_scene, +hakaana_room_0, +yousei_izumi_tate_scene, +yousei_izumi_tate_room_0, +yousei_izumi_yoko_scene, +yousei_izumi_yoko_room_0, +golon_scene, +golon_room_0, +zoora_scene, +zoora_room_0, +drag_scene, +drag_room_0, +alley_shop_scene, +alley_shop_room_0, +night_shop_scene, +night_shop_room_0, +impa_scene, +impa_room_0, +labo_scene, +labo_room_0, +tent_scene, +tent_room_0, +nakaniwa_scene, +nakaniwa_room_0, +ddan_boss_scene, +ddan_boss_room_0, +ddan_boss_room_1, +ydan_boss_scene, +ydan_boss_room_0, +ydan_boss_room_1, +HAKAdan_bs_scene, +HAKAdan_bs_room_0, +HAKAdan_bs_room_1, +MIZUsin_bs_scene, +MIZUsin_bs_room_0, +MIZUsin_bs_room_1, +ganon_scene, +ganon_room_0, +ganon_room_1, +ganon_room_2, +ganon_room_3, +ganon_room_4, +ganon_room_5, +ganon_room_6, +ganon_room_7, +ganon_room_8, +ganon_room_9, +ganon_boss_scene, +ganon_boss_room_0, +jyasinboss_scene, +jyasinboss_room_0, +jyasinboss_room_1, +jyasinboss_room_2, +jyasinboss_room_3, +kokiri_home4_scene, +kokiri_home4_room_0, +kokiri_home5_scene, +kokiri_home5_room_0, +ganon_final_scene, +ganon_final_room_0, +kakariko3_scene, +kakariko3_room_0, +hakasitarelay_scene, +hakasitarelay_room_0, +hakasitarelay_room_1, +hakasitarelay_room_2, +hakasitarelay_room_3, +hakasitarelay_room_4, +hakasitarelay_room_5, +hakasitarelay_room_6, +shrine_scene, +shrine_room_0, +turibori_scene, +turibori_room_0, +shrine_n_scene, +shrine_n_room_0, +shrine_r_scene, +shrine_r_room_0, +hakaana2_scene, +hakaana2_room_0, +gerudoway_scene, +gerudoway_room_0, +gerudoway_room_1, +gerudoway_room_2, +gerudoway_room_3, +gerudoway_room_4, +gerudoway_room_5, +hairal_niwa_n_scene, +hairal_niwa_n_room_0, +bowling_scene, +bowling_room_0, +hakaana_ouke_scene, +hakaana_ouke_room_0, +hakaana_ouke_room_1, +hakaana_ouke_room_2, +hylia_labo_scene, +hylia_labo_room_0, +souko_scene, +souko_room_0, +souko_room_1, +souko_room_2, +miharigoya_scene, +miharigoya_room_0, +mahouya_scene, +mahouya_room_0, +takaraya_scene, +takaraya_room_0, +takaraya_room_1, +takaraya_room_2, +takaraya_room_3, +takaraya_room_4, +takaraya_room_5, +takaraya_room_6, +ganon_sonogo_scene, +ganon_sonogo_room_0, +ganon_sonogo_room_1, +ganon_sonogo_room_2, +ganon_sonogo_room_3, +ganon_sonogo_room_4, +ganon_demo_scene, +ganon_demo_room_0, +face_shop_scene, +face_shop_room_0, +kinsuta_scene, +kinsuta_room_0, +ganontikasonogo_scene, +ganontikasonogo_room_0, +ganontikasonogo_room_1, +bump_texture_static, +anime_model_1_static, +anime_model_2_static, +anime_model_3_static, +anime_model_4_static, +anime_model_5_static, +anime_model_6_static, +anime_texture_1_static, +anime_texture_2_static, +anime_texture_3_static, +anime_texture_4_static, +anime_texture_5_static, +anime_texture_6_static, +softsprite_matrix_static, diff --git a/baseroms/gc-us/config.yml b/baseroms/gc-us/config.yml index 0d6acafc34..60050cb7ec 100644 --- a/baseroms/gc-us/config.yml +++ b/baseroms/gc-us/config.yml @@ -1,10 +1,55 @@ dmadata_start: 0x7170 text_lang_pal: false +incbins: + - name: ipl3 + segment: makerom + vram: 0x80000040 + size: 0xFC0 + - name: rspbootText + segment: boot + vram: 0x80005FC0 + size: 0xD0 + - name: aspMainText + segment: code + vram: 0x800E3840 + size: 0xFB0 + - name: gspS2DEX2d_fifoText + segment: code + vram: 0x800E47F0 + size: 0x18C0 + - name: njpgdspMainText + segment: code + vram: 0x800E60B0 + size: 0xAF0 + - name: aspMainData + segment: code + vram: 0x80113820 + size: 0x2E0 + - name: gspF3DZEX2_NoN_PosLight_fifoText + segment: code + vram: 0x80113B00 + size: 0x1630 + - name: gspF3DZEX2_NoN_PosLight_fifoData + segment: code + vram: 0x80115130 + size: 0x420 + - name: gspS2DEX2d_fifoData + segment: code + vram: 0x80115550 + size: 0x390 + - name: njpgdspMainData + segment: code + vram: 0x801158E0 + size: 0x60 variables: gMtxClear: 0x800FE2A0 sJpnMessageEntryTable: 0x80109E8C sNesMessageEntryTable: 0x8010DFCC sStaffMessageEntryTable: 0x801121EC + gSoundFontTable: 0x80112C80 + gSequenceFontTable: 0x80112EF0 + gSequenceTable: 0x801130B0 + gSampleBankTable: 0x801137A0 sShadowTex: 0x80A74130 assets: - name: code/fbdemo_circle @@ -468,7 +513,7 @@ assets: - name: objects/object_ma2 xml_path: assets/xml/objects/object_ma2.xml - name: objects/object_mag - xml_path: assets/xml/objects/object_mag.xml + xml_path: assets/xml/objects/object_mag_v3.xml - name: objects/object_mamenoki xml_path: assets/xml/objects/object_mamenoki.xml - name: objects/object_mastergolon @@ -879,8 +924,8 @@ assets: end_offset: 0x4088 - name: overlays/ovl_file_choose xml_path: assets/xml/overlays/ovl_file_choose.xml - start_offset: 0xD740 - end_offset: 0xDF80 + start_offset: 0xEC40 + end_offset: 0xF320 - name: overlays/ovl_Magic_Dark xml_path: assets/xml/overlays/ovl_Magic_Dark.xml start_offset: 0xC90 @@ -926,7 +971,7 @@ assets: - name: scenes/dungeons/ddan xml_path: assets/xml/scenes/dungeons/ddan.xml - name: scenes/dungeons/ddan_boss - xml_path: assets/xml/scenes/dungeons/ddan_boss.xml + xml_path: assets/xml/scenes/dungeons/ddan_boss_v2.xml - name: scenes/dungeons/FIRE_bs xml_path: assets/xml/scenes/dungeons/FIRE_bs.xml - name: scenes/dungeons/ganon @@ -954,7 +999,7 @@ assets: - name: scenes/dungeons/HIDAN xml_path: assets/xml/scenes/dungeons/HIDAN.xml - name: scenes/dungeons/ice_doukutu - xml_path: assets/xml/scenes/dungeons/ice_doukutu.xml + xml_path: assets/xml/scenes/dungeons/ice_doukutu_v2.xml - name: scenes/dungeons/jyasinboss xml_path: assets/xml/scenes/dungeons/jyasinboss.xml - name: scenes/dungeons/jyasinzou @@ -1096,7 +1141,7 @@ assets: - name: scenes/overworld/spot15 xml_path: assets/xml/scenes/overworld/spot15.xml - name: scenes/overworld/spot16 - xml_path: assets/xml/scenes/overworld/spot16.xml + xml_path: assets/xml/scenes/overworld/spot16_v2.xml - name: scenes/overworld/spot17 xml_path: assets/xml/scenes/overworld/spot17.xml - name: scenes/overworld/spot18 @@ -1154,9 +1199,9 @@ assets: - name: textures/message_texture_static xml_path: assets/xml/textures/message_texture_static.xml - name: textures/nes_font_static - xml_path: assets/xml/textures/nes_font_static.xml + xml_path: assets/xml/textures/nes_font_static_v2.xml - name: textures/nintendo_rogo_static - xml_path: assets/xml/textures/nintendo_rogo_static.xml + xml_path: assets/xml/textures/nintendo_rogo_static_v2.xml - name: textures/parameter_static xml_path: assets/xml/textures/parameter_static.xml - name: textures/place_title_cards diff --git a/baseroms/hackeroot-mq/checksum-compressed.md5 b/baseroms/hackeroot-mq/checksum-compressed.md5 new file mode 100644 index 0000000000..d902d5fa9f --- /dev/null +++ b/baseroms/hackeroot-mq/checksum-compressed.md5 @@ -0,0 +1 @@ +9704bc98c20c20319cc1633fe02b6fc7 build/gc-eu-mq-dbg/oot-gc-eu-mq-dbg-compressed.z64 diff --git a/baseroms/hackeroot-mq/config.yml b/baseroms/hackeroot-mq/config.yml index bd6c9bf6b3..84a6d3b6c7 100644 --- a/baseroms/hackeroot-mq/config.yml +++ b/baseroms/hackeroot-mq/config.yml @@ -1,11 +1,64 @@ dmadata_start: 0x12F70 text_lang_pal: true +incbins: + - name: ipl3 + segment: makerom + vram: 0x80000040 + size: 0xFC0 + - name: rspbootText + segment: boot + vram: 0x80009320 + size: 0xD0 + - name: aspMainText + segment: code + vram: 0x801120C0 + size: 0xFB0 + - name: gspS2DEX2d_fifoText + segment: code + vram: 0x80113070 + size: 0x18C0 + - name: njpgdspMainText + segment: code + vram: 0x80114930 + size: 0xAF0 + - name: gMojiFontTLUTs + segment: code + vram: 0x8012A740 + size: 0x80 + - name: gMojiFontTex + segment: code + vram: 0x8012A7C0 + size: 0x400 + - name: aspMainData + segment: code + vram: 0x80155C70 + size: 0x2E0 + - name: gspF3DZEX2_NoN_PosLight_fifoText + segment: code + vram: 0x80155F50 + size: 0x1630 + - name: gspF3DZEX2_NoN_PosLight_fifoData + segment: code + vram: 0x80157580 + size: 0x420 + - name: gspS2DEX2d_fifoData + segment: code + vram: 0x801579A0 + size: 0x390 + - name: njpgdspMainData + segment: code + vram: 0x80157D30 + size: 0x60 variables: gMtxClear: 0x8012DB20 sNesMessageEntryTable: 0x8014B320 sGerMessageEntryTable: 0x8014F548 sFraMessageEntryTable: 0x80151658 sStaffMessageEntryTable: 0x80153768 + gSoundFontTable: 0x801550D0 + gSequenceFontTable: 0x80155340 + gSequenceTable: 0x80155500 + gSampleBankTable: 0x80155BF0 sShadowTex: 0x80A8E610 assets: - name: code/fbdemo_circle @@ -469,7 +522,7 @@ assets: - name: objects/object_ma2 xml_path: assets/xml/objects/object_ma2.xml - name: objects/object_mag - xml_path: assets/xml/objects/object_mag_mq.xml + xml_path: assets/xml/objects/object_mag_v3_mq.xml - name: objects/object_mamenoki xml_path: assets/xml/objects/object_mamenoki.xml - name: objects/object_mastergolon @@ -887,9 +940,9 @@ assets: start_offset: 0x780 end_offset: 0x4128 - name: overlays/ovl_file_choose - xml_path: assets/xml/overlays/ovl_file_choose.xml + xml_path: assets/xml/overlays/ovl_file_choose_pal_gc.xml start_offset: 0xDE70 - end_offset: 0xE6B0 + end_offset: 0xE740 - name: overlays/ovl_Magic_Dark xml_path: assets/xml/overlays/ovl_Magic_Dark.xml start_offset: 0xD10 @@ -935,7 +988,7 @@ assets: - name: scenes/dungeons/ddan xml_path: assets/xml/scenes/dungeons/ddan_mq.xml - name: scenes/dungeons/ddan_boss - xml_path: assets/xml/scenes/dungeons/ddan_boss.xml + xml_path: assets/xml/scenes/dungeons/ddan_boss_v2.xml - name: scenes/dungeons/FIRE_bs xml_path: assets/xml/scenes/dungeons/FIRE_bs.xml - name: scenes/dungeons/ganon @@ -1107,7 +1160,7 @@ assets: - name: scenes/overworld/spot15 xml_path: assets/xml/scenes/overworld/spot15.xml - name: scenes/overworld/spot16 - xml_path: assets/xml/scenes/overworld/spot16.xml + xml_path: assets/xml/scenes/overworld/spot16_v2.xml - name: scenes/overworld/spot17 xml_path: assets/xml/scenes/overworld/spot17.xml - name: scenes/overworld/spot18 @@ -1181,9 +1234,9 @@ assets: - name: textures/message_texture_static xml_path: assets/xml/textures/message_texture_static.xml - name: textures/nes_font_static - xml_path: assets/xml/textures/nes_font_static.xml + xml_path: assets/xml/textures/nes_font_static_v2.xml - name: textures/nintendo_rogo_static - xml_path: assets/xml/textures/nintendo_rogo_static.xml + xml_path: assets/xml/textures/nintendo_rogo_static_v2.xml - name: textures/parameter_static xml_path: assets/xml/textures/parameter_static.xml - name: textures/place_title_cards @@ -1191,4 +1244,4 @@ assets: - name: textures/skyboxes xml_path: assets/xml/textures/skyboxes.xml - name: textures/title_static - xml_path: assets/xml/textures/title_static_pal.xml + xml_path: assets/xml/textures/title_static_pal_gc.xml diff --git a/baseroms/ntsc-1.0/checksum-JP-compressed.md5 b/baseroms/ntsc-1.0/checksum-JP-compressed.md5 new file mode 100644 index 0000000000..b371d6ee69 --- /dev/null +++ b/baseroms/ntsc-1.0/checksum-JP-compressed.md5 @@ -0,0 +1 @@ +9f04c8e68534b870f707c247fa4b50fc build/ntsc-1.0/oot-ntsc-1.0-compressed.z64 diff --git a/baseroms/ntsc-1.0/checksum-JP.md5 b/baseroms/ntsc-1.0/checksum-JP.md5 new file mode 100644 index 0000000000..0bdeb74cb9 --- /dev/null +++ b/baseroms/ntsc-1.0/checksum-JP.md5 @@ -0,0 +1 @@ +963d8ee3bd921f4d3c833b82004a76d2 build/ntsc-1.0/oot-ntsc-1.0.z64 diff --git a/baseroms/ntsc-1.0/checksum-US-compressed.md5 b/baseroms/ntsc-1.0/checksum-US-compressed.md5 new file mode 100644 index 0000000000..7aa912648b --- /dev/null +++ b/baseroms/ntsc-1.0/checksum-US-compressed.md5 @@ -0,0 +1 @@ +5bd1fe107bf8106b2ab6650abecd54d6 build/ntsc-1.0/oot-ntsc-1.0-compressed.z64 diff --git a/baseroms/ntsc-1.0/checksum-US.md5 b/baseroms/ntsc-1.0/checksum-US.md5 new file mode 100644 index 0000000000..fda12ac58c --- /dev/null +++ b/baseroms/ntsc-1.0/checksum-US.md5 @@ -0,0 +1 @@ +6829a16db1a34e8ce989847cd8da8d9a build/ntsc-1.0/oot-ntsc-1.0.z64 diff --git a/baseroms/ntsc-1.0/config.yml b/baseroms/ntsc-1.0/config.yml new file mode 100644 index 0000000000..072aebec3d --- /dev/null +++ b/baseroms/ntsc-1.0/config.yml @@ -0,0 +1,1219 @@ +checksums: + - checksum-JP + - checksum-US +dmadata_start: 0x7430 +text_lang_pal: false +incbins: + - name: ipl3 + segment: makerom + vram: 0x80000040 + size: 0xFC0 + - name: rspbootText + segment: boot + vram: 0x800060B0 + size: 0x160 + - name: aspMainText + segment: code + vram: 0x800E2FC0 + size: 0xFB0 + - name: gspF3DZEX2_NoN_PosLight_fifoText + segment: code + vram: 0x800E3F70 + size: 0x1390 + - name: gspS2DEX2d_fifoText + segment: code + vram: 0x800E5300 + size: 0x18C0 + - name: njpgdspMainText + segment: code + vram: 0x800E6BC0 + size: 0xAF0 + - name: aspMainData + segment: code + vram: 0x801142E0 + size: 0x2E0 + - name: gspF3DZEX2_NoN_PosLight_fifoData + segment: code + vram: 0x801145C0 + size: 0x420 + - name: gspS2DEX2d_fifoData + segment: code + vram: 0x801149E0 + size: 0x390 + - name: njpgdspMainData + segment: code + vram: 0x80114D70 + size: 0x60 +variables: + gMtxClear: 0x800FEDB0 + sJpnMessageEntryTable: 0x8010A94C + sNesMessageEntryTable: 0x8010EA8C + sStaffMessageEntryTable: 0x80112CAC + gSoundFontTable: 0x80113740 + gSequenceFontTable: 0x801139B0 + gSequenceTable: 0x80113B70 + gSampleBankTable: 0x80114260 + sShadowTex: 0x80AE0AE0 +assets: +- name: code/fbdemo_circle + xml_path: assets/xml/code/fbdemo_circle.xml + start_offset: 0xEC0A8 + end_offset: 0xED2C8 +- name: code/fbdemo_triforce + xml_path: assets/xml/code/fbdemo_triforce.xml + start_offset: 0xEB530 + end_offset: 0xEB600 +- name: code/fbdemo_wipe1 + xml_path: assets/xml/code/fbdemo_wipe1.xml + start_offset: 0xEB600 + end_offset: 0xEBF90 +- name: n64dd/error_textures + xml_path: assets/xml/n64dd/error_textures.xml + start_offset: 0xC160 + end_offset: 0x11D60 +- name: misc/link_animetion + xml_path: assets/xml/misc/link_animetion.xml +- name: misc/z_select_static + xml_path: assets/xml/misc/z_select_static.xml +- name: objects/gameplay_dangeon_keep + xml_path: assets/xml/objects/gameplay_dangeon_keep.xml +- name: objects/gameplay_field_keep + xml_path: assets/xml/objects/gameplay_field_keep.xml +- name: objects/gameplay_keep + xml_path: assets/xml/objects/gameplay_keep.xml +- name: objects/object_ahg + xml_path: assets/xml/objects/object_ahg.xml +- name: objects/object_am + xml_path: assets/xml/objects/object_am.xml +- name: objects/object_ane + xml_path: assets/xml/objects/object_ane.xml +- name: objects/object_ani + xml_path: assets/xml/objects/object_ani.xml +- name: objects/object_anubice + xml_path: assets/xml/objects/object_anubice.xml +- name: objects/object_aob + xml_path: assets/xml/objects/object_aob.xml +- name: objects/object_b_heart + xml_path: assets/xml/objects/object_b_heart.xml +- name: objects/object_Bb + xml_path: assets/xml/objects/object_Bb.xml +- name: objects/object_bba + xml_path: assets/xml/objects/object_bba.xml +- name: objects/object_bdan_objects + xml_path: assets/xml/objects/object_bdan_objects.xml +- name: objects/object_bdoor + xml_path: assets/xml/objects/object_bdoor.xml +- name: objects/object_bg + xml_path: assets/xml/objects/object_bg.xml +- name: objects/object_bigokuta + xml_path: assets/xml/objects/object_bigokuta.xml +- name: objects/object_bird + xml_path: assets/xml/objects/object_bird.xml +- name: objects/object_bji + xml_path: assets/xml/objects/object_bji.xml +- name: objects/object_bl + xml_path: assets/xml/objects/object_bl.xml +- name: objects/object_blkobj + xml_path: assets/xml/objects/object_blkobj.xml +- name: objects/object_bob + xml_path: assets/xml/objects/object_bob.xml +- name: objects/object_boj + xml_path: assets/xml/objects/object_boj.xml +- name: objects/object_bombf + xml_path: assets/xml/objects/object_bombf.xml +- name: objects/object_bombiwa + xml_path: assets/xml/objects/object_bombiwa.xml +- name: objects/object_bowl + xml_path: assets/xml/objects/object_bowl.xml +- name: objects/object_box + xml_path: assets/xml/objects/object_box.xml +- name: objects/object_brob + xml_path: assets/xml/objects/object_brob.xml +- name: objects/object_bubble + xml_path: assets/xml/objects/object_bubble.xml +- name: objects/object_bv + xml_path: assets/xml/objects/object_bv.xml +- name: objects/object_bw + xml_path: assets/xml/objects/object_bw.xml +- name: objects/object_bwall + xml_path: assets/xml/objects/object_bwall.xml +- name: objects/object_bxa + xml_path: assets/xml/objects/object_bxa.xml +- name: objects/object_cne + xml_path: assets/xml/objects/object_cne.xml +- name: objects/object_cob + xml_path: assets/xml/objects/object_cob.xml +- name: objects/object_cow + xml_path: assets/xml/objects/object_cow.xml +- name: objects/object_crow + xml_path: assets/xml/objects/object_crow.xml +- name: objects/object_cs + xml_path: assets/xml/objects/object_cs.xml +- name: objects/object_d_elevator + xml_path: assets/xml/objects/object_d_elevator.xml +- name: objects/object_d_hsblock + xml_path: assets/xml/objects/object_d_hsblock.xml +- name: objects/object_d_lift + xml_path: assets/xml/objects/object_d_lift.xml +- name: objects/object_daiku + xml_path: assets/xml/objects/object_daiku.xml +- name: objects/object_ddan_objects + xml_path: assets/xml/objects/object_ddan_objects.xml +- name: objects/object_dekubaba + xml_path: assets/xml/objects/object_dekubaba.xml +- name: objects/object_dekujr + xml_path: assets/xml/objects/object_dekujr.xml +- name: objects/object_dekunuts + xml_path: assets/xml/objects/object_dekunuts.xml +- name: objects/object_demo_6k + xml_path: assets/xml/objects/object_demo_6k.xml +- name: objects/object_demo_kekkai + xml_path: assets/xml/objects/object_demo_kekkai.xml +- name: objects/object_demo_tre_lgt + xml_path: assets/xml/objects/object_demo_tre_lgt.xml +- name: objects/object_dh + xml_path: assets/xml/objects/object_dh.xml +- name: objects/object_dnk + xml_path: assets/xml/objects/object_dnk.xml +- name: objects/object_dns + xml_path: assets/xml/objects/object_dns.xml +- name: objects/object_dodojr + xml_path: assets/xml/objects/object_dodojr.xml +- name: objects/object_dodongo + xml_path: assets/xml/objects/object_dodongo.xml +- name: objects/object_dog + xml_path: assets/xml/objects/object_dog.xml +- name: objects/object_door_gerudo + xml_path: assets/xml/objects/object_door_gerudo.xml +- name: objects/object_door_killer + xml_path: assets/xml/objects/object_door_killer.xml +- name: objects/object_ds + xml_path: assets/xml/objects/object_ds.xml +- name: objects/object_ds2 + xml_path: assets/xml/objects/object_ds2.xml +- name: objects/object_du + xml_path: assets/xml/objects/object_du.xml +- name: objects/object_dy_obj + xml_path: assets/xml/objects/object_dy_obj.xml +- name: objects/object_ec + xml_path: assets/xml/objects/object_ec.xml +- name: objects/object_efc_crystal_light + xml_path: assets/xml/objects/object_efc_crystal_light.xml +- name: objects/object_efc_doughnut + xml_path: assets/xml/objects/object_efc_doughnut.xml +- name: objects/object_efc_erupc + xml_path: assets/xml/objects/object_efc_erupc.xml +- name: objects/object_efc_fire_ball + xml_path: assets/xml/objects/object_efc_fire_ball.xml +- name: objects/object_efc_flash + xml_path: assets/xml/objects/object_efc_flash.xml +- name: objects/object_efc_lgt_shower + xml_path: assets/xml/objects/object_efc_lgt_shower.xml +- name: objects/object_efc_star_field + xml_path: assets/xml/objects/object_efc_star_field.xml +- name: objects/object_efc_tw + xml_path: assets/xml/objects/object_efc_tw.xml +- name: objects/object_ei + xml_path: assets/xml/objects/object_ei.xml +- name: objects/object_fa + xml_path: assets/xml/objects/object_fa.xml +- name: objects/object_fd + xml_path: assets/xml/objects/object_fd.xml +- name: objects/object_fd2 + xml_path: assets/xml/objects/object_fd2.xml +- name: objects/object_fhg + xml_path: assets/xml/objects/object_fhg.xml +- name: objects/object_fire + xml_path: assets/xml/objects/object_fire.xml +- name: objects/object_firefly + xml_path: assets/xml/objects/object_firefly.xml +- name: objects/object_fish + xml_path: assets/xml/objects/object_fish.xml +- name: objects/object_fr + xml_path: assets/xml/objects/object_fr.xml +- name: objects/object_fu + xml_path: assets/xml/objects/object_fu.xml +- name: objects/object_fw + xml_path: assets/xml/objects/object_fw.xml +- name: objects/object_fz + xml_path: assets/xml/objects/object_fz.xml +- name: objects/object_ganon + xml_path: assets/xml/objects/object_ganon.xml +- name: objects/object_ganon2 + xml_path: assets/xml/objects/object_ganon2.xml +- name: objects/object_ganon_anime1 + xml_path: assets/xml/objects/object_ganon_anime1.xml +- name: objects/object_ganon_anime2 + xml_path: assets/xml/objects/object_ganon_anime2.xml +- name: objects/object_ganon_anime3 + xml_path: assets/xml/objects/object_ganon_anime3.xml +- name: objects/object_ganon_objects + xml_path: assets/xml/objects/object_ganon_objects.xml +- name: objects/object_ge1 + xml_path: assets/xml/objects/object_ge1.xml +- name: objects/object_geff + xml_path: assets/xml/objects/object_geff.xml +- name: objects/object_geldb + xml_path: assets/xml/objects/object_geldb.xml +- name: objects/object_gi_arrow + xml_path: assets/xml/objects/object_gi_arrow.xml +- name: objects/object_gi_arrowcase + xml_path: assets/xml/objects/object_gi_arrowcase.xml +- name: objects/object_gi_bean + xml_path: assets/xml/objects/object_gi_bean.xml +- name: objects/object_gi_bomb_1 + xml_path: assets/xml/objects/object_gi_bomb_1.xml +- name: objects/object_gi_bomb_2 + xml_path: assets/xml/objects/object_gi_bomb_2.xml +- name: objects/object_gi_bombpouch + xml_path: assets/xml/objects/object_gi_bombpouch.xml +- name: objects/object_gi_boomerang + xml_path: assets/xml/objects/object_gi_boomerang.xml +- name: objects/object_gi_boots_2 + xml_path: assets/xml/objects/object_gi_boots_2.xml +- name: objects/object_gi_bosskey + xml_path: assets/xml/objects/object_gi_bosskey.xml +- name: objects/object_gi_bottle + xml_path: assets/xml/objects/object_gi_bottle.xml +- name: objects/object_gi_bottle_letter + xml_path: assets/xml/objects/object_gi_bottle_letter.xml +- name: objects/object_gi_bow + xml_path: assets/xml/objects/object_gi_bow.xml +- name: objects/object_gi_bracelet + xml_path: assets/xml/objects/object_gi_bracelet.xml +- name: objects/object_gi_brokensword + xml_path: assets/xml/objects/object_gi_brokensword.xml +- name: objects/object_gi_butterfly + xml_path: assets/xml/objects/object_gi_butterfly.xml +- name: objects/object_gi_clothes + xml_path: assets/xml/objects/object_gi_clothes.xml +- name: objects/object_gi_coin + xml_path: assets/xml/objects/object_gi_coin.xml +- name: objects/object_gi_compass + xml_path: assets/xml/objects/object_gi_compass.xml +- name: objects/object_gi_dekupouch + xml_path: assets/xml/objects/object_gi_dekupouch.xml +- name: objects/object_gi_egg + xml_path: assets/xml/objects/object_gi_egg.xml +- name: objects/object_gi_eye_lotion + xml_path: assets/xml/objects/object_gi_eye_lotion.xml +- name: objects/object_gi_fire + xml_path: assets/xml/objects/object_gi_fire.xml +- name: objects/object_gi_fish + xml_path: assets/xml/objects/object_gi_fish.xml +- name: objects/object_gi_frog + xml_path: assets/xml/objects/object_gi_frog.xml +- name: objects/object_gi_gerudo + xml_path: assets/xml/objects/object_gi_gerudo.xml +- name: objects/object_gi_gerudomask + xml_path: assets/xml/objects/object_gi_gerudomask.xml +- name: objects/object_gi_ghost + xml_path: assets/xml/objects/object_gi_ghost.xml +- name: objects/object_gi_glasses + xml_path: assets/xml/objects/object_gi_glasses.xml +- name: objects/object_gi_gloves + xml_path: assets/xml/objects/object_gi_gloves.xml +- name: objects/object_gi_goddess + xml_path: assets/xml/objects/object_gi_goddess.xml +- name: objects/object_gi_golonmask + xml_path: assets/xml/objects/object_gi_golonmask.xml +- name: objects/object_gi_grass + xml_path: assets/xml/objects/object_gi_grass.xml +- name: objects/object_gi_hammer + xml_path: assets/xml/objects/object_gi_hammer.xml +- name: objects/object_gi_heart + xml_path: assets/xml/objects/object_gi_heart.xml +- name: objects/object_gi_hearts + xml_path: assets/xml/objects/object_gi_hearts.xml +- name: objects/object_gi_hookshot + xml_path: assets/xml/objects/object_gi_hookshot.xml +- name: objects/object_gi_hoverboots + xml_path: assets/xml/objects/object_gi_hoverboots.xml +- name: objects/object_gi_insect + xml_path: assets/xml/objects/object_gi_insect.xml +- name: objects/object_gi_jewel + xml_path: assets/xml/objects/object_gi_jewel.xml +- name: objects/object_gi_key + xml_path: assets/xml/objects/object_gi_key.xml +- name: objects/object_gi_ki_tan_mask + xml_path: assets/xml/objects/object_gi_ki_tan_mask.xml +- name: objects/object_gi_letter + xml_path: assets/xml/objects/object_gi_letter.xml +- name: objects/object_gi_liquid + xml_path: assets/xml/objects/object_gi_liquid.xml +- name: objects/object_gi_longsword + xml_path: assets/xml/objects/object_gi_longsword.xml +- name: objects/object_gi_m_arrow + xml_path: assets/xml/objects/object_gi_m_arrow.xml +- name: objects/object_gi_magicpot + xml_path: assets/xml/objects/object_gi_magicpot.xml +- name: objects/object_gi_map + xml_path: assets/xml/objects/object_gi_map.xml +- name: objects/object_gi_medal + xml_path: assets/xml/objects/object_gi_medal.xml +- name: objects/object_gi_melody + xml_path: assets/xml/objects/object_gi_melody.xml +- name: objects/object_gi_milk + xml_path: assets/xml/objects/object_gi_milk.xml +- name: objects/object_gi_mushroom + xml_path: assets/xml/objects/object_gi_mushroom.xml +- name: objects/object_gi_niwatori + xml_path: assets/xml/objects/object_gi_niwatori.xml +- name: objects/object_gi_nuts + xml_path: assets/xml/objects/object_gi_nuts.xml +- name: objects/object_gi_ocarina + xml_path: assets/xml/objects/object_gi_ocarina.xml +- name: objects/object_gi_ocarina_0 + xml_path: assets/xml/objects/object_gi_ocarina_0.xml +- name: objects/object_gi_pachinko + xml_path: assets/xml/objects/object_gi_pachinko.xml +- name: objects/object_gi_powder + xml_path: assets/xml/objects/object_gi_powder.xml +- name: objects/object_gi_prescription + xml_path: assets/xml/objects/object_gi_prescription.xml +- name: objects/object_gi_purse + xml_path: assets/xml/objects/object_gi_purse.xml +- name: objects/object_gi_rabit_mask + xml_path: assets/xml/objects/object_gi_rabit_mask.xml +- name: objects/object_gi_redead_mask + xml_path: assets/xml/objects/object_gi_redead_mask.xml +- name: objects/object_gi_rupy + xml_path: assets/xml/objects/object_gi_rupy.xml +- name: objects/object_gi_saw + xml_path: assets/xml/objects/object_gi_saw.xml +- name: objects/object_gi_scale + xml_path: assets/xml/objects/object_gi_scale.xml +- name: objects/object_gi_seed + xml_path: assets/xml/objects/object_gi_seed.xml +- name: objects/object_gi_shield_1 + xml_path: assets/xml/objects/object_gi_shield_1.xml +- name: objects/object_gi_shield_2 + xml_path: assets/xml/objects/object_gi_shield_2.xml +- name: objects/object_gi_shield_3 + xml_path: assets/xml/objects/object_gi_shield_3.xml +- name: objects/object_gi_skj_mask + xml_path: assets/xml/objects/object_gi_skj_mask.xml +- name: objects/object_gi_soldout + xml_path: assets/xml/objects/object_gi_soldout.xml +- name: objects/object_gi_soul + xml_path: assets/xml/objects/object_gi_soul.xml +- name: objects/object_gi_stick + xml_path: assets/xml/objects/object_gi_stick.xml +- name: objects/object_gi_sutaru + xml_path: assets/xml/objects/object_gi_sutaru.xml +- name: objects/object_gi_sword_1 + xml_path: assets/xml/objects/object_gi_sword_1.xml +- name: objects/object_gi_ticketstone + xml_path: assets/xml/objects/object_gi_ticketstone.xml +- name: objects/object_gi_truth_mask + xml_path: assets/xml/objects/object_gi_truth_mask.xml +- name: objects/object_gi_zoramask + xml_path: assets/xml/objects/object_gi_zoramask.xml +- name: objects/object_gj + xml_path: assets/xml/objects/object_gj.xml +- name: objects/object_gjyo_objects + xml_path: assets/xml/objects/object_gjyo_objects.xml +- name: objects/object_gla + xml_path: assets/xml/objects/object_gla.xml +- name: objects/object_gm + xml_path: assets/xml/objects/object_gm.xml +- name: objects/object_gnd + xml_path: assets/xml/objects/object_gnd.xml +- name: objects/object_gnd_magic + xml_path: assets/xml/objects/object_gnd_magic.xml +- name: objects/object_gndd + xml_path: assets/xml/objects/object_gndd.xml +- name: objects/object_god_lgt + xml_path: assets/xml/objects/object_god_lgt.xml +- name: objects/object_gol + xml_path: assets/xml/objects/object_gol.xml +- name: objects/object_goma + xml_path: assets/xml/objects/object_goma.xml +- name: objects/object_goroiwa + xml_path: assets/xml/objects/object_goroiwa.xml +- name: objects/object_gr + xml_path: assets/xml/objects/object_gr.xml +- name: objects/object_gs + xml_path: assets/xml/objects/object_gs.xml +- name: objects/object_gt + xml_path: assets/xml/objects/object_gt.xml +- name: objects/object_haka + xml_path: assets/xml/objects/object_haka.xml +- name: objects/object_haka_door + xml_path: assets/xml/objects/object_haka_door.xml +- name: objects/object_haka_objects + xml_path: assets/xml/objects/object_haka_objects.xml +- name: objects/object_hakach_objects + xml_path: assets/xml/objects/object_hakach_objects.xml +- name: objects/object_hata + xml_path: assets/xml/objects/object_hata.xml +- name: objects/object_heavy_object + xml_path: assets/xml/objects/object_heavy_object.xml +- name: objects/object_hidan_objects + xml_path: assets/xml/objects/object_hidan_objects.xml +- name: objects/object_hintnuts + xml_path: assets/xml/objects/object_hintnuts.xml +- name: objects/object_hni + xml_path: assets/xml/objects/object_hni.xml +- name: objects/object_horse + xml_path: assets/xml/objects/object_horse.xml +- name: objects/object_horse_ganon + xml_path: assets/xml/objects/object_horse_ganon.xml +- name: objects/object_horse_link_child + xml_path: assets/xml/objects/object_horse_link_child.xml +- name: objects/object_horse_normal + xml_path: assets/xml/objects/object_horse_normal.xml +- name: objects/object_horse_zelda + xml_path: assets/xml/objects/object_horse_zelda.xml +- name: objects/object_hs + xml_path: assets/xml/objects/object_hs.xml +- name: objects/object_human + xml_path: assets/xml/objects/object_human.xml +- name: objects/object_ice_objects + xml_path: assets/xml/objects/object_ice_objects.xml +- name: objects/object_ik + xml_path: assets/xml/objects/object_ik.xml +- name: objects/object_im + xml_path: assets/xml/objects/object_im.xml +- name: objects/object_in + xml_path: assets/xml/objects/object_in.xml +- name: objects/object_ingate + xml_path: assets/xml/objects/object_ingate.xml +- name: objects/object_jj + xml_path: assets/xml/objects/object_jj.xml +- name: objects/object_js + xml_path: assets/xml/objects/object_js.xml +- name: objects/object_jya_door + xml_path: assets/xml/objects/object_jya_door.xml +- name: objects/object_jya_iron + xml_path: assets/xml/objects/object_jya_iron.xml +- name: objects/object_jya_obj + xml_path: assets/xml/objects/object_jya_obj.xml +- name: objects/object_ka + xml_path: assets/xml/objects/object_ka.xml +- name: objects/object_kanban + xml_path: assets/xml/objects/object_kanban.xml +- name: objects/object_kibako2 + xml_path: assets/xml/objects/object_kibako2.xml +- name: objects/object_kingdodongo + xml_path: assets/xml/objects/object_kingdodongo.xml +- name: objects/object_km1 + xml_path: assets/xml/objects/object_km1.xml +- name: objects/object_kusa + xml_path: assets/xml/objects/object_kusa.xml +- name: objects/object_kw1 + xml_path: assets/xml/objects/object_kw1.xml +- name: objects/object_kz + xml_path: assets/xml/objects/object_kz.xml +- name: objects/object_light_ring + xml_path: assets/xml/objects/object_light_ring.xml +- name: objects/object_lightbox + xml_path: assets/xml/objects/object_lightbox.xml +- name: objects/object_lightswitch + xml_path: assets/xml/objects/object_lightswitch.xml +- name: objects/object_link_boy + xml_path: assets/xml/objects/object_link_boy.xml +- name: objects/object_link_child + xml_path: assets/xml/objects/object_link_child.xml +- name: objects/object_ma1 + xml_path: assets/xml/objects/object_ma1.xml +- name: objects/object_ma2 + xml_path: assets/xml/objects/object_ma2.xml +- name: objects/object_mag + xml_path: assets/xml/objects/object_mag.xml +- name: objects/object_mamenoki + xml_path: assets/xml/objects/object_mamenoki.xml +- name: objects/object_mastergolon + xml_path: assets/xml/objects/object_mastergolon.xml +- name: objects/object_masterkokiri + xml_path: assets/xml/objects/object_masterkokiri.xml +- name: objects/object_masterkokirihead + xml_path: assets/xml/objects/object_masterkokirihead.xml +- name: objects/object_masterzoora + xml_path: assets/xml/objects/object_masterzoora.xml +- name: objects/object_mb + xml_path: assets/xml/objects/object_mb.xml +- name: objects/object_md + xml_path: assets/xml/objects/object_md.xml +- name: objects/object_medal + xml_path: assets/xml/objects/object_medal.xml +- name: objects/object_menkuri_objects + xml_path: assets/xml/objects/object_menkuri_objects.xml +- name: objects/object_mir_ray + xml_path: assets/xml/objects/object_mir_ray.xml +- name: objects/object_mizu_objects + xml_path: assets/xml/objects/object_mizu_objects.xml +- name: objects/object_mjin + xml_path: assets/xml/objects/object_mjin.xml +- name: objects/object_mjin_dark + xml_path: assets/xml/objects/object_mjin_dark.xml +- name: objects/object_mjin_flame + xml_path: assets/xml/objects/object_mjin_flame.xml +- name: objects/object_mjin_flash + xml_path: assets/xml/objects/object_mjin_flash.xml +- name: objects/object_mjin_ice + xml_path: assets/xml/objects/object_mjin_ice.xml +- name: objects/object_mjin_oka + xml_path: assets/xml/objects/object_mjin_oka.xml +- name: objects/object_mjin_soul + xml_path: assets/xml/objects/object_mjin_soul.xml +- name: objects/object_mjin_wind + xml_path: assets/xml/objects/object_mjin_wind.xml +- name: objects/object_mk + xml_path: assets/xml/objects/object_mk.xml +- name: objects/object_mm + xml_path: assets/xml/objects/object_mm.xml +- name: objects/object_mo + xml_path: assets/xml/objects/object_mo.xml +- name: objects/object_mori_hineri1 + xml_path: assets/xml/objects/object_mori_hineri1.xml +- name: objects/object_mori_hineri1a + xml_path: assets/xml/objects/object_mori_hineri1a.xml +- name: objects/object_mori_hineri2 + xml_path: assets/xml/objects/object_mori_hineri2.xml +- name: objects/object_mori_hineri2a + xml_path: assets/xml/objects/object_mori_hineri2a.xml +- name: objects/object_mori_objects + xml_path: assets/xml/objects/object_mori_objects.xml +- name: objects/object_mori_tex + xml_path: assets/xml/objects/object_mori_tex.xml +- name: objects/object_ms + xml_path: assets/xml/objects/object_ms.xml +- name: objects/object_mu + xml_path: assets/xml/objects/object_mu.xml +- name: objects/object_nb + xml_path: assets/xml/objects/object_nb.xml +- name: objects/object_niw + xml_path: assets/xml/objects/object_niw.xml +- name: objects/object_nwc + xml_path: assets/xml/objects/object_nwc.xml +- name: objects/object_ny + xml_path: assets/xml/objects/object_ny.xml +- name: objects/object_o_anime + xml_path: assets/xml/objects/object_o_anime.xml +- name: objects/object_oA1 + xml_path: assets/xml/objects/object_oA1.xml +- name: objects/object_oA2 + xml_path: assets/xml/objects/object_oA2.xml +- name: objects/object_oA3 + xml_path: assets/xml/objects/object_oA3.xml +- name: objects/object_oA4 + xml_path: assets/xml/objects/object_oA4.xml +- name: objects/object_oA5 + xml_path: assets/xml/objects/object_oA5.xml +- name: objects/object_oA6 + xml_path: assets/xml/objects/object_oA6.xml +- name: objects/object_oA7 + xml_path: assets/xml/objects/object_oA7.xml +- name: objects/object_oA8 + xml_path: assets/xml/objects/object_oA8.xml +- name: objects/object_oA9 + xml_path: assets/xml/objects/object_oA9.xml +- name: objects/object_oA10 + xml_path: assets/xml/objects/object_oA10.xml +- name: objects/object_oA11 + xml_path: assets/xml/objects/object_oA11.xml +- name: objects/object_oB1 + xml_path: assets/xml/objects/object_oB1.xml +- name: objects/object_oB2 + xml_path: assets/xml/objects/object_oB2.xml +- name: objects/object_oB3 + xml_path: assets/xml/objects/object_oB3.xml +- name: objects/object_oB4 + xml_path: assets/xml/objects/object_oB4.xml +- name: objects/object_oE1 + xml_path: assets/xml/objects/object_oE1.xml +- name: objects/object_oE1s + xml_path: assets/xml/objects/object_oE1s.xml +- name: objects/object_oE2 + xml_path: assets/xml/objects/object_oE2.xml +- name: objects/object_oE3 + xml_path: assets/xml/objects/object_oE3.xml +- name: objects/object_oE4 + xml_path: assets/xml/objects/object_oE4.xml +- name: objects/object_oE4s + xml_path: assets/xml/objects/object_oE4s.xml +- name: objects/object_oE5 + xml_path: assets/xml/objects/object_oE5.xml +- name: objects/object_oE6 + xml_path: assets/xml/objects/object_oE6.xml +- name: objects/object_oE7 + xml_path: assets/xml/objects/object_oE7.xml +- name: objects/object_oE8 + xml_path: assets/xml/objects/object_oE8.xml +- name: objects/object_oE9 + xml_path: assets/xml/objects/object_oE9.xml +- name: objects/object_oE10 + xml_path: assets/xml/objects/object_oE10.xml +- name: objects/object_oE11 + xml_path: assets/xml/objects/object_oE11.xml +- name: objects/object_oE12 + xml_path: assets/xml/objects/object_oE12.xml +- name: objects/object_oE_anime + xml_path: assets/xml/objects/object_oE_anime.xml +- name: objects/object_oF1d_map + xml_path: assets/xml/objects/object_oF1d_map.xml +- name: objects/object_oF1s + xml_path: assets/xml/objects/object_oF1s.xml +- name: objects/object_okuta + xml_path: assets/xml/objects/object_okuta.xml +- name: objects/object_opening_demo1 + xml_path: assets/xml/objects/object_opening_demo1.xml +- name: objects/object_os + xml_path: assets/xml/objects/object_os.xml +- name: objects/object_os_anime + xml_path: assets/xml/objects/object_os_anime.xml +- name: objects/object_ossan + xml_path: assets/xml/objects/object_ossan.xml +- name: objects/object_ouke_haka + xml_path: assets/xml/objects/object_ouke_haka.xml +- name: objects/object_owl + xml_path: assets/xml/objects/object_owl.xml +- name: objects/object_peehat + xml_path: assets/xml/objects/object_peehat.xml +- name: objects/object_po_composer + xml_path: assets/xml/objects/object_po_composer.xml +- name: objects/object_po_field + xml_path: assets/xml/objects/object_po_field.xml +- name: objects/object_po_sisters + xml_path: assets/xml/objects/object_po_sisters.xml +- name: objects/object_poh + xml_path: assets/xml/objects/object_poh.xml +- name: objects/object_ps + xml_path: assets/xml/objects/object_ps.xml +- name: objects/object_pu_box + xml_path: assets/xml/objects/object_pu_box.xml +- name: objects/object_rd + xml_path: assets/xml/objects/object_rd.xml +- name: objects/object_reeba + xml_path: assets/xml/objects/object_reeba.xml +- name: objects/object_relay_objects + xml_path: assets/xml/objects/object_relay_objects.xml +- name: objects/object_rl + xml_path: assets/xml/objects/object_rl.xml +- name: objects/object_rr + xml_path: assets/xml/objects/object_rr.xml +- name: objects/object_rs + xml_path: assets/xml/objects/object_rs.xml +- name: objects/object_ru1 + xml_path: assets/xml/objects/object_ru1.xml +- name: objects/object_ru2 + xml_path: assets/xml/objects/object_ru2.xml +- name: objects/object_sa + xml_path: assets/xml/objects/object_sa.xml +- name: objects/object_sb + xml_path: assets/xml/objects/object_sb.xml +- name: objects/object_sd + xml_path: assets/xml/objects/object_sd.xml +- name: objects/object_shop_dungen + xml_path: assets/xml/objects/object_shop_dungen.xml +- name: objects/object_shopnuts + xml_path: assets/xml/objects/object_shopnuts.xml +- name: objects/object_siofuki + xml_path: assets/xml/objects/object_siofuki.xml +- name: objects/object_sk2 + xml_path: assets/xml/objects/object_sk2.xml +- name: objects/object_skb + xml_path: assets/xml/objects/object_skb.xml +- name: objects/object_skj + xml_path: assets/xml/objects/object_skj.xml +- name: objects/object_spot00_break + xml_path: assets/xml/objects/object_spot00_break.xml +- name: objects/object_spot00_objects + xml_path: assets/xml/objects/object_spot00_objects.xml +- name: objects/object_spot01_matoya + xml_path: assets/xml/objects/object_spot01_matoya.xml +- name: objects/object_spot01_matoyab + xml_path: assets/xml/objects/object_spot01_matoyab.xml +- name: objects/object_spot01_objects + xml_path: assets/xml/objects/object_spot01_objects.xml +- name: objects/object_spot01_objects2 + xml_path: assets/xml/objects/object_spot01_objects2.xml +- name: objects/object_spot02_objects + xml_path: assets/xml/objects/object_spot02_objects.xml +- name: objects/object_spot03_object + xml_path: assets/xml/objects/object_spot03_object.xml +- name: objects/object_spot04_objects + xml_path: assets/xml/objects/object_spot04_objects.xml +- name: objects/object_spot05_objects + xml_path: assets/xml/objects/object_spot05_objects.xml +- name: objects/object_spot06_objects + xml_path: assets/xml/objects/object_spot06_objects.xml +- name: objects/object_spot07_object + xml_path: assets/xml/objects/object_spot07_object.xml +- name: objects/object_spot08_obj + xml_path: assets/xml/objects/object_spot08_obj.xml +- name: objects/object_spot09_obj + xml_path: assets/xml/objects/object_spot09_obj.xml +- name: objects/object_spot11_obj + xml_path: assets/xml/objects/object_spot11_obj.xml +- name: objects/object_spot12_obj + xml_path: assets/xml/objects/object_spot12_obj.xml +- name: objects/object_spot15_obj + xml_path: assets/xml/objects/object_spot15_obj.xml +- name: objects/object_spot16_obj + xml_path: assets/xml/objects/object_spot16_obj.xml +- name: objects/object_spot17_obj + xml_path: assets/xml/objects/object_spot17_obj.xml +- name: objects/object_spot18_obj + xml_path: assets/xml/objects/object_spot18_obj.xml +- name: objects/object_ssh + xml_path: assets/xml/objects/object_ssh.xml +- name: objects/object_sst + xml_path: assets/xml/objects/object_sst.xml +- name: objects/object_st + xml_path: assets/xml/objects/object_st.xml +- name: objects/object_stream + xml_path: assets/xml/objects/object_stream.xml +- name: objects/object_syokudai + xml_path: assets/xml/objects/object_syokudai.xml +- name: objects/object_ta + xml_path: assets/xml/objects/object_ta.xml +- name: objects/object_timeblock + xml_path: assets/xml/objects/object_timeblock.xml +- name: objects/object_tite + xml_path: assets/xml/objects/object_tite.xml +- name: objects/object_tk + xml_path: assets/xml/objects/object_tk.xml +- name: objects/object_toki_objects + xml_path: assets/xml/objects/object_toki_objects.xml +- name: objects/object_torch2 + xml_path: assets/xml/objects/object_torch2.xml +- name: objects/object_toryo + xml_path: assets/xml/objects/object_toryo.xml +- name: objects/object_tp + xml_path: assets/xml/objects/object_tp.xml +- name: objects/object_tr + xml_path: assets/xml/objects/object_tr.xml +- name: objects/object_trap + xml_path: assets/xml/objects/object_trap.xml +- name: objects/object_triforce_spot + xml_path: assets/xml/objects/object_triforce_spot.xml +- name: objects/object_ts + xml_path: assets/xml/objects/object_ts.xml +- name: objects/object_tsubo + xml_path: assets/xml/objects/object_tsubo.xml +- name: objects/object_tw + xml_path: assets/xml/objects/object_tw.xml +- name: objects/object_umajump + xml_path: assets/xml/objects/object_umajump.xml +- name: objects/object_vali + xml_path: assets/xml/objects/object_vali.xml +- name: objects/object_vase + xml_path: assets/xml/objects/object_vase.xml +- name: objects/object_vm + xml_path: assets/xml/objects/object_vm.xml +- name: objects/object_wallmaster + xml_path: assets/xml/objects/object_wallmaster.xml +- name: objects/object_warp1 + xml_path: assets/xml/objects/object_warp1.xml +- name: objects/object_warp2 + xml_path: assets/xml/objects/object_warp2.xml +- name: objects/object_wf + xml_path: assets/xml/objects/object_wf.xml +- name: objects/object_wood02 + xml_path: assets/xml/objects/object_wood02.xml +- name: objects/object_xc + xml_path: assets/xml/objects/object_xc.xml +- name: objects/object_yabusame_point + xml_path: assets/xml/objects/object_yabusame_point.xml +- name: objects/object_ydan_objects + xml_path: assets/xml/objects/object_ydan_objects.xml +- name: objects/object_yukabyun + xml_path: assets/xml/objects/object_yukabyun.xml +- name: objects/object_zf + xml_path: assets/xml/objects/object_zf.xml +- name: objects/object_zg + xml_path: assets/xml/objects/object_zg.xml +- name: objects/object_zl1 + xml_path: assets/xml/objects/object_zl1.xml +- name: objects/object_zl2 + xml_path: assets/xml/objects/object_zl2.xml +- name: objects/object_zl2_anime1 + xml_path: assets/xml/objects/object_zl2_anime1.xml +- name: objects/object_zl2_anime2 + xml_path: assets/xml/objects/object_zl2_anime2.xml +- name: objects/object_zl4 + xml_path: assets/xml/objects/object_zl4.xml +- name: objects/object_zo + xml_path: assets/xml/objects/object_zo.xml +- name: overlays/ovl_Arrow_Fire + xml_path: assets/xml/overlays/ovl_Arrow_Fire.xml + start_offset: 0x960 + end_offset: 0x1D80 +- name: overlays/ovl_Arrow_Ice + xml_path: assets/xml/overlays/ovl_Arrow_Ice.xml + start_offset: 0x980 + end_offset: 0x1DA0 +- name: overlays/ovl_Arrow_Light + xml_path: assets/xml/overlays/ovl_Arrow_Light.xml + start_offset: 0x990 + end_offset: 0x1DB0 +- name: overlays/ovl_Bg_Ganon_Otyuka + xml_path: assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml + start_offset: 0x1110 + end_offset: 0x24EC +- name: overlays/ovl_Bg_Jya_Cobra + xml_path: assets/xml/overlays/ovl_Bg_Jya_Cobra.xml + start_offset: 0x1830 + end_offset: 0x18A8 +- name: overlays/ovl_Boss_Dodongo + xml_path: assets/xml/overlays/ovl_Boss_Dodongo.xml + start_offset: 0x61C8 + end_offset: 0x91C8 +- name: overlays/ovl_Boss_Ganon + xml_path: assets/xml/overlays/ovl_Boss_Ganon.xml + start_offset: 0xE398 + end_offset: 0x20EB8 +- name: overlays/ovl_Boss_Ganon2 + xml_path: assets/xml/overlays/ovl_Boss_Ganon2.xml + start_offset: 0x9F48 + end_offset: 0x103F8 +- name: overlays/ovl_Boss_Sst + xml_path: assets/xml/overlays/ovl_Boss_Sst.xml + start_offset: 0xA330 + end_offset: 0xACE0 +- name: overlays/ovl_Demo_Shd + xml_path: assets/xml/overlays/ovl_Demo_Shd.xml + start_offset: 0x410 + end_offset: 0x2390 +- name: overlays/ovl_Effect_Ss_Fhg_Flash + xml_path: assets/xml/overlays/ovl_Effect_Ss_Fhg_Flash.xml + start_offset: 0x9F0 + end_offset: 0xEA8 +- name: overlays/ovl_En_Bili + xml_path: assets/xml/overlays/ovl_En_Bili.xml + start_offset: 0x1E40 + end_offset: 0x1E60 +- name: overlays/ovl_En_Clear_Tag + xml_path: assets/xml/overlays/ovl_En_Clear_Tag.xml + start_offset: 0x2600 + end_offset: 0x8900 +- name: overlays/ovl_En_Ganon_Mant + xml_path: assets/xml/overlays/ovl_En_Ganon_Mant.xml + start_offset: 0x11E8 + end_offset: 0x40E8 +- name: overlays/ovl_En_Ganon_Organ + xml_path: assets/xml/overlays/ovl_En_Ganon_Organ.xml + start_offset: 0x328 + end_offset: 0x6EB0 +- name: overlays/ovl_En_Holl + xml_path: assets/xml/overlays/ovl_En_Holl.xml + start_offset: 0xE68 + end_offset: 0xED0 +- name: overlays/ovl_En_Jsjutan + xml_path: assets/xml/overlays/ovl_En_Jsjutan.xml + start_offset: 0x12B8 + end_offset: 0x4C50 +- name: overlays/ovl_En_Kanban + xml_path: assets/xml/overlays/ovl_En_Kanban.xml + start_offset: 0x2E70 + end_offset: 0x2F30 +- name: overlays/ovl_En_Sda + xml_path: assets/xml/overlays/ovl_En_Sda.xml + start_offset: 0x14A8 + end_offset: 0x1538 +- name: overlays/ovl_En_Ssh + xml_path: assets/xml/overlays/ovl_En_Ssh.xml + start_offset: 0x2150 + end_offset: 0x21E0 +- name: overlays/ovl_En_St + xml_path: assets/xml/overlays/ovl_En_St.xml + start_offset: 0x26A0 + end_offset: 0x2730 +- name: overlays/ovl_En_Sth + xml_path: assets/xml/overlays/ovl_En_Sth.xml + start_offset: 0xE60 + end_offset: 0x3E34 +- name: overlays/ovl_End_Title + xml_path: assets/xml/overlays/ovl_End_Title.xml + start_offset: 0x6F0 + end_offset: 0x4098 +- name: overlays/ovl_file_choose + xml_path: assets/xml/overlays/ovl_file_choose.xml + start_offset: 0xEC50 + end_offset: 0xF330 +- name: overlays/ovl_Magic_Dark + xml_path: assets/xml/overlays/ovl_Magic_Dark.xml + start_offset: 0xC90 + end_offset: 0x16C0 +- name: overlays/ovl_Magic_Fire + xml_path: assets/xml/overlays/ovl_Magic_Fire.xml + start_offset: 0xB20 + end_offset: 0x2170 +- name: overlays/ovl_Magic_Wind + xml_path: assets/xml/overlays/ovl_Magic_Wind.xml + start_offset: 0x6A0 + end_offset: 0x1BB8 +- name: overlays/ovl_Oceff_Spot + xml_path: assets/xml/overlays/ovl_Oceff_Spot.xml + start_offset: 0x780 + end_offset: 0xE58 +- name: overlays/ovl_Oceff_Storm + xml_path: assets/xml/overlays/ovl_Oceff_Storm.xml + start_offset: 0x740 + end_offset: 0x1AD0 +- name: overlays/ovl_Oceff_Wipe + xml_path: assets/xml/overlays/ovl_Oceff_Wipe.xml + start_offset: 0x4F0 + end_offset: 0xCB0 +- name: overlays/ovl_Oceff_Wipe2 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe2.xml + start_offset: 0x430 + end_offset: 0x1698 +- name: overlays/ovl_Oceff_Wipe3 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe3.xml + start_offset: 0x430 + end_offset: 0x1678 +- name: overlays/ovl_Oceff_Wipe4 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe4.xml + start_offset: 0x410 + end_offset: 0xEF8 +- name: scenes/dungeons/bdan + xml_path: assets/xml/scenes/dungeons/bdan.xml +- name: scenes/dungeons/bdan_boss + xml_path: assets/xml/scenes/dungeons/bdan_boss.xml +- name: scenes/dungeons/Bmori1 + xml_path: assets/xml/scenes/dungeons/Bmori1.xml +- name: scenes/dungeons/ddan + xml_path: assets/xml/scenes/dungeons/ddan.xml +- name: scenes/dungeons/ddan_boss + xml_path: assets/xml/scenes/dungeons/ddan_boss.xml +- name: scenes/dungeons/FIRE_bs + xml_path: assets/xml/scenes/dungeons/FIRE_bs.xml +- name: scenes/dungeons/ganon + xml_path: assets/xml/scenes/dungeons/ganon.xml +- name: scenes/dungeons/ganon_boss + xml_path: assets/xml/scenes/dungeons/ganon_boss.xml +- name: scenes/dungeons/ganon_demo + xml_path: assets/xml/scenes/dungeons/ganon_demo.xml +- name: scenes/dungeons/ganon_final + xml_path: assets/xml/scenes/dungeons/ganon_final.xml +- name: scenes/dungeons/ganon_sonogo + xml_path: assets/xml/scenes/dungeons/ganon_sonogo.xml +- name: scenes/dungeons/ganontika + xml_path: assets/xml/scenes/dungeons/ganontika.xml +- name: scenes/dungeons/ganontikasonogo + xml_path: assets/xml/scenes/dungeons/ganontikasonogo.xml +- name: scenes/dungeons/gerudoway + xml_path: assets/xml/scenes/dungeons/gerudoway.xml +- name: scenes/dungeons/HAKAdan + xml_path: assets/xml/scenes/dungeons/HAKAdan.xml +- name: scenes/dungeons/HAKAdan_bs + xml_path: assets/xml/scenes/dungeons/HAKAdan_bs.xml +- name: scenes/dungeons/HAKAdanCH + xml_path: assets/xml/scenes/dungeons/HAKAdanCH.xml +- name: scenes/dungeons/HIDAN + xml_path: assets/xml/scenes/dungeons/HIDAN.xml +- name: scenes/dungeons/ice_doukutu + xml_path: assets/xml/scenes/dungeons/ice_doukutu.xml +- name: scenes/dungeons/jyasinboss + xml_path: assets/xml/scenes/dungeons/jyasinboss.xml +- name: scenes/dungeons/jyasinzou + xml_path: assets/xml/scenes/dungeons/jyasinzou.xml +- name: scenes/dungeons/men + xml_path: assets/xml/scenes/dungeons/men.xml +- name: scenes/dungeons/MIZUsin + xml_path: assets/xml/scenes/dungeons/MIZUsin.xml +- name: scenes/dungeons/MIZUsin_bs + xml_path: assets/xml/scenes/dungeons/MIZUsin_bs.xml +- name: scenes/dungeons/moribossroom + xml_path: assets/xml/scenes/dungeons/moribossroom.xml +- name: scenes/dungeons/ydan + xml_path: assets/xml/scenes/dungeons/ydan.xml +- name: scenes/dungeons/ydan_boss + xml_path: assets/xml/scenes/dungeons/ydan_boss.xml +- name: scenes/indoors/bowling + xml_path: assets/xml/scenes/indoors/bowling.xml +- name: scenes/indoors/daiyousei_izumi + xml_path: assets/xml/scenes/indoors/daiyousei_izumi.xml +- name: scenes/indoors/hairal_niwa + xml_path: assets/xml/scenes/indoors/hairal_niwa.xml +- name: scenes/indoors/hairal_niwa_n + xml_path: assets/xml/scenes/indoors/hairal_niwa_n.xml +- name: scenes/indoors/hakasitarelay + xml_path: assets/xml/scenes/indoors/hakasitarelay.xml +- name: scenes/indoors/hut + xml_path: assets/xml/scenes/indoors/hut.xml +- name: scenes/indoors/hylia_labo + xml_path: assets/xml/scenes/indoors/hylia_labo.xml +- name: scenes/indoors/impa + xml_path: assets/xml/scenes/indoors/impa.xml +- name: scenes/indoors/kakariko + xml_path: assets/xml/scenes/indoors/kakariko.xml +- name: scenes/indoors/kenjyanoma + xml_path: assets/xml/scenes/indoors/kenjyanoma.xml +- name: scenes/indoors/kokiri_home + xml_path: assets/xml/scenes/indoors/kokiri_home.xml +- name: scenes/indoors/kokiri_home3 + xml_path: assets/xml/scenes/indoors/kokiri_home3.xml +- name: scenes/indoors/kokiri_home4 + xml_path: assets/xml/scenes/indoors/kokiri_home4.xml +- name: scenes/indoors/kokiri_home5 + xml_path: assets/xml/scenes/indoors/kokiri_home5.xml +- name: scenes/indoors/labo + xml_path: assets/xml/scenes/indoors/labo.xml +- name: scenes/indoors/link_home + xml_path: assets/xml/scenes/indoors/link_home.xml +- name: scenes/indoors/mahouya + xml_path: assets/xml/scenes/indoors/mahouya.xml +- name: scenes/indoors/malon_stable + xml_path: assets/xml/scenes/indoors/malon_stable.xml +- name: scenes/indoors/miharigoya + xml_path: assets/xml/scenes/indoors/miharigoya.xml +- name: scenes/indoors/nakaniwa + xml_path: assets/xml/scenes/indoors/nakaniwa.xml +- name: scenes/indoors/souko + xml_path: assets/xml/scenes/indoors/souko.xml +- name: scenes/indoors/syatekijyou + xml_path: assets/xml/scenes/indoors/syatekijyou.xml +- name: scenes/indoors/takaraya + xml_path: assets/xml/scenes/indoors/takaraya.xml +- name: scenes/indoors/tent + xml_path: assets/xml/scenes/indoors/tent.xml +- name: scenes/indoors/tokinoma + xml_path: assets/xml/scenes/indoors/tokinoma.xml +- name: scenes/indoors/yousei_izumi_tate + xml_path: assets/xml/scenes/indoors/yousei_izumi_tate.xml +- name: scenes/indoors/yousei_izumi_yoko + xml_path: assets/xml/scenes/indoors/yousei_izumi_yoko.xml +- name: scenes/misc/enrui + xml_path: assets/xml/scenes/misc/enrui.xml +- name: scenes/misc/entra + xml_path: assets/xml/scenes/misc/entra.xml +- name: scenes/misc/entra_n + xml_path: assets/xml/scenes/misc/entra_n.xml +- name: scenes/misc/hakaana + xml_path: assets/xml/scenes/misc/hakaana.xml +- name: scenes/misc/hakaana2 + xml_path: assets/xml/scenes/misc/hakaana2.xml +- name: scenes/misc/hakaana_ouke + xml_path: assets/xml/scenes/misc/hakaana_ouke.xml +- name: scenes/misc/hiral_demo + xml_path: assets/xml/scenes/misc/hiral_demo.xml +- name: scenes/misc/kakariko3 + xml_path: assets/xml/scenes/misc/kakariko3.xml +- name: scenes/misc/kakusiana + xml_path: assets/xml/scenes/misc/kakusiana.xml +- name: scenes/misc/kinsuta + xml_path: assets/xml/scenes/misc/kinsuta.xml +- name: scenes/misc/market_alley + xml_path: assets/xml/scenes/misc/market_alley.xml +- name: scenes/misc/market_alley_n + xml_path: assets/xml/scenes/misc/market_alley_n.xml +- name: scenes/misc/market_day + xml_path: assets/xml/scenes/misc/market_day.xml +- name: scenes/misc/market_night + xml_path: assets/xml/scenes/misc/market_night.xml +- name: scenes/misc/market_ruins + xml_path: assets/xml/scenes/misc/market_ruins.xml +- name: scenes/misc/shrine + xml_path: assets/xml/scenes/misc/shrine.xml +- name: scenes/misc/shrine_n + xml_path: assets/xml/scenes/misc/shrine_n.xml +- name: scenes/misc/shrine_r + xml_path: assets/xml/scenes/misc/shrine_r.xml +- name: scenes/misc/turibori + xml_path: assets/xml/scenes/misc/turibori.xml +- name: scenes/overworld/ganon_tou + xml_path: assets/xml/scenes/overworld/ganon_tou.xml +- name: scenes/overworld/spot00 + xml_path: assets/xml/scenes/overworld/spot00.xml +- name: scenes/overworld/spot01 + xml_path: assets/xml/scenes/overworld/spot01.xml +- name: scenes/overworld/spot02 + xml_path: assets/xml/scenes/overworld/spot02.xml +- name: scenes/overworld/spot03 + xml_path: assets/xml/scenes/overworld/spot03.xml +- name: scenes/overworld/spot04 + xml_path: assets/xml/scenes/overworld/spot04.xml +- name: scenes/overworld/spot05 + xml_path: assets/xml/scenes/overworld/spot05.xml +- name: scenes/overworld/spot06 + xml_path: assets/xml/scenes/overworld/spot06.xml +- name: scenes/overworld/spot07 + xml_path: assets/xml/scenes/overworld/spot07.xml +- name: scenes/overworld/spot08 + xml_path: assets/xml/scenes/overworld/spot08.xml +- name: scenes/overworld/spot09 + xml_path: assets/xml/scenes/overworld/spot09.xml +- name: scenes/overworld/spot10 + xml_path: assets/xml/scenes/overworld/spot10.xml +- name: scenes/overworld/spot11 + xml_path: assets/xml/scenes/overworld/spot11.xml +- name: scenes/overworld/spot12 + xml_path: assets/xml/scenes/overworld/spot12.xml +- name: scenes/overworld/spot13 + xml_path: assets/xml/scenes/overworld/spot13.xml +- name: scenes/overworld/spot15 + xml_path: assets/xml/scenes/overworld/spot15.xml +- name: scenes/overworld/spot16 + xml_path: assets/xml/scenes/overworld/spot16.xml +- name: scenes/overworld/spot17 + xml_path: assets/xml/scenes/overworld/spot17.xml +- name: scenes/overworld/spot18 + xml_path: assets/xml/scenes/overworld/spot18.xml +- name: scenes/overworld/spot20 + xml_path: assets/xml/scenes/overworld/spot20.xml +- name: scenes/shops/alley_shop + xml_path: assets/xml/scenes/shops/alley_shop.xml +- name: scenes/shops/drag + xml_path: assets/xml/scenes/shops/drag.xml +- name: scenes/shops/face_shop + xml_path: assets/xml/scenes/shops/face_shop.xml +- name: scenes/shops/golon + xml_path: assets/xml/scenes/shops/golon.xml +- name: scenes/shops/kokiri_shop + xml_path: assets/xml/scenes/shops/kokiri_shop.xml +- name: scenes/shops/night_shop + xml_path: assets/xml/scenes/shops/night_shop.xml +- name: scenes/shops/shop1 + xml_path: assets/xml/scenes/shops/shop1.xml +- name: scenes/shops/zoora + xml_path: assets/xml/scenes/shops/zoora.xml +- name: textures/backgrounds + xml_path: assets/xml/textures/backgrounds.xml +- name: textures/do_action_static + xml_path: assets/xml/textures/do_action_static.xml +- name: textures/icon_item_24_static + xml_path: assets/xml/textures/icon_item_24_static.xml +- name: textures/icon_item_dungeon_static + xml_path: assets/xml/textures/icon_item_dungeon_static.xml +- name: textures/icon_item_field_static + xml_path: assets/xml/textures/icon_item_field_static.xml +- name: textures/icon_item_gameover_static + xml_path: assets/xml/textures/icon_item_gameover_static.xml +- name: textures/icon_item_jpn_static + xml_path: assets/xml/textures/icon_item_jpn_static.xml +- name: textures/icon_item_nes_static + xml_path: assets/xml/textures/icon_item_nes_static.xml +- name: textures/icon_item_static + xml_path: assets/xml/textures/icon_item_static.xml +- name: textures/item_name_static + xml_path: assets/xml/textures/item_name_static.xml +- name: textures/kanji + xml_path: assets/xml/textures/kanji.xml +- name: textures/map_48x85_static + xml_path: assets/xml/textures/map_48x85_static.xml +- name: textures/map_grand_static + xml_path: assets/xml/textures/map_grand_static.xml +- name: textures/map_i_static + xml_path: assets/xml/textures/map_i_static.xml +- name: textures/map_name_static + xml_path: assets/xml/textures/map_name_static.xml +- name: textures/message_static + xml_path: assets/xml/textures/message_static.xml +- name: textures/message_texture_static + xml_path: assets/xml/textures/message_texture_static.xml +- name: textures/nes_font_static + xml_path: assets/xml/textures/nes_font_static.xml +- name: textures/nintendo_rogo_static + xml_path: assets/xml/textures/nintendo_rogo_static.xml +- name: textures/parameter_static + xml_path: assets/xml/textures/parameter_static.xml +- name: textures/place_title_cards + xml_path: assets/xml/textures/place_title_cards.xml +- name: textures/skyboxes + xml_path: assets/xml/textures/skyboxes.xml +- name: textures/title_static + xml_path: assets/xml/textures/title_static.xml diff --git a/baseroms/ntsc-1.0/segments.csv b/baseroms/ntsc-1.0/segments.csv new file mode 100644 index 0000000000..cb73e168af --- /dev/null +++ b/baseroms/ntsc-1.0/segments.csv @@ -0,0 +1,1511 @@ +Name,VRAM start +makerom,80000000 +boot,80000460 +dmadata, +Audiobank, +Audioseq, +Audiotable, +kanji, +link_animetion, +icon_item_static, +icon_item_24_static, +icon_item_field_static, +icon_item_dungeon_static, +icon_item_gameover_static, +icon_item_jpn_static, +icon_item_nes_static, +item_name_static, +map_name_static, +do_action_static, +message_static, +jpn_message_data_static, +message_texture_static, +nes_font_static, +nes_message_data_static, +staff_message_data_static, +map_grand_static, +map_i_static, +map_48x85_static, +code,800110A0 +n64dd,801C6E80 +ovl_title,80800000 +ovl_select,808009C0 +ovl_opening,80803720 +ovl_file_choose,80803880 +ovl_kaleido_scope,808137C0 +ovl_player_actor,808301C0 +ovl_map_mark_data,808567F0 +ovl_En_Test,8085D350 +ovl_En_GirlA,80862C00 +ovl_En_Part,80865520 +ovl_En_Light,80866B30 +ovl_En_Door,80867920 +ovl_En_Box,80868750 +ovl_En_Poh,8086A290 +ovl_En_Okuta,8086E420 +ovl_En_Bom,80870A00 +ovl_En_Wallmas,808718D0 +ovl_En_Dodongo,808732E0 +ovl_En_Firefly,80876080 +ovl_En_Horse,808781F0 +ovl_En_Arrow,80884410 +ovl_En_Elf,80885B00 +ovl_En_Niw,8088A4C0 +ovl_En_Tite,8088D7F0 +ovl_En_Reeba,80890590 +ovl_En_Peehat,80892000 +ovl_En_Holl,80895700 +ovl_En_Scene_Change,808966D0 +ovl_En_Zf,80896800 +ovl_En_Hata,8089D300 +ovl_Boss_Dodongo,8089D890 +ovl_Boss_Goma,808A7370 +ovl_En_Zl1,808AD2F0 +ovl_En_Viewer,808B10F0 +ovl_En_Goma,808B3FC0 +ovl_Bg_Pushbox,808B6C50 +ovl_En_Bubble,808B6F50 +ovl_Door_Shutter,808B8370 +ovl_En_Dodojr,808BA5F0 +ovl_En_Bdfire,808BC490 +ovl_En_Boom,808BD020 +ovl_En_Torch2,808BD8E0 +ovl_En_Bili,808C0080 +ovl_En_Tp,808C2350 +ovl_En_St,808C41A0 +ovl_En_Bw,808C6E10 +ovl_En_Eiyer,808CA170 +ovl_En_River_Sound,808CBDD0 +ovl_En_Horse_Normal,808CC760 +ovl_En_Ossan,808CED80 +ovl_Bg_Treemouth,808D5360 +ovl_Bg_Dodoago,808D69B0 +ovl_Bg_Hidan_Dalm,808D7760 +ovl_Bg_Hidan_Hrock,808D7FB0 +ovl_En_Horse_Ganon,808D87E0 +ovl_Bg_Hidan_Rock,808D9560 +ovl_Bg_Hidan_Rsekizou,808DA650 +ovl_Bg_Hidan_Sekizou,808DB230 +ovl_Bg_Hidan_Sima,808DC680 +ovl_Bg_Hidan_Syoku,808DD5A0 +ovl_En_Xc,808DDA00 +ovl_Bg_Hidan_Curtain,808E4190 +ovl_Bg_Spot00_Hanebasi,808E4C30 +ovl_En_Mb,808E5D40 +ovl_En_Bombf,808E9E80 +ovl_Bg_Hidan_Firewall,808EB2F0 +ovl_Bg_Dy_Yoseizo,808EBA50 +ovl_En_Zl2,808EE7A0 +ovl_Bg_Hidan_Fslift,808F2ED0 +ovl_En_OE2,808F33A0 +ovl_Bg_Ydan_Hasi,808F3480 +ovl_Bg_Ydan_Maruta,808F3C30 +ovl_Boss_Ganondrof,808F4310 +ovl_En_Am,808F9080 +ovl_En_Dekubaba,808FB480 +ovl_En_M_Fire1,808FEF20 +ovl_En_M_Thunder,808FF0C0 +ovl_Bg_Ddan_Jd,809006B0 +ovl_Bg_Breakwall,80900D00 +ovl_En_Jj,80901B70 +ovl_En_Horse_Zelda,80903140 +ovl_Bg_Ddan_Kd,80903C30 +ovl_Door_Warp1,80904520 +ovl_Obj_Syokudai,809087D0 +ovl_Item_B_Heart,80909410 +ovl_En_Dekunuts,80909800 +ovl_Bg_Menkuri_Kaiten,8090B000 +ovl_Bg_Menkuri_Eye,8090B190 +ovl_En_Vali,8090B630 +ovl_Bg_Mizu_Movebg,8090DCD0 +ovl_Bg_Mizu_Water,8090EE70 +ovl_Arms_Hook,8090FB40 +ovl_En_fHG,809108A0 +ovl_Bg_Mori_Hineri,809131D0 +ovl_En_Bb,80913EA0 +ovl_Bg_Toki_Hikari,80917B70 +ovl_En_Yukabyun,80918910 +ovl_Bg_Toki_Swd,80918F20 +ovl_En_Fhg_Fire,8091A570 +ovl_Bg_Mjin,8091CB90 +ovl_Bg_Hidan_Kousi,8091CF70 +ovl_Door_Toki,8091D4F0 +ovl_Bg_Hidan_Hamstep,8091D650 +ovl_En_Bird,8091E4E0 +ovl_En_Wood02,8091E9A0 +ovl_En_Lightbox,8091FB80 +ovl_En_Pu_box,80920000 +ovl_En_Trap,80920340 +ovl_En_Arow_Trap,809215E0 +ovl_En_Vase,80921730 +ovl_En_Ta,80921830 +ovl_En_Tk,809251F0 +ovl_Bg_Mori_Bigst,80927020 +ovl_Bg_Mori_Elevator,80927950 +ovl_Bg_Mori_Kaitenkabe,80928440 +ovl_Bg_Mori_Rakkatenjo,80928AA0 +ovl_En_Vm,80929410 +ovl_Demo_Effect,8092ACC0 +ovl_Demo_Kankyo,809307C0 +ovl_Bg_Hidan_Fwbig,809344C0 +ovl_En_Floormas,809351A0 +ovl_En_Heishi1,80938580 +ovl_En_Rd,80939A90 +ovl_En_Po_Sisters,8093C340 +ovl_Bg_Heavy_Block,80941030 +ovl_Bg_Po_Event,80942920 +ovl_Obj_Mure,80944760 +ovl_En_Sw,80945770 +ovl_Boss_Fd,80948F60 +ovl_Object_Kankyo,80950290 +ovl_En_Du,809534B0 +ovl_En_Fd,80954F50 +ovl_En_Horse_Link_Child,80957C10 +ovl_Door_Ana,80959A10 +ovl_Bg_Spot02_Objects,8095A080 +ovl_Bg_Haka,8095B3D0 +ovl_Magic_Wind,8095BA90 +ovl_Magic_Fire,8095D790 +ovl_En_Ru1,8095FA60 +ovl_Boss_Fd2,80967100 +ovl_En_Fd_Fire,8096AE30 +ovl_En_Dh,8096BB40 +ovl_En_Dha,8096D610 +ovl_En_Rl,8096E5E0 +ovl_En_Encount1,8096F4C0 +ovl_Demo_Du,80970020 +ovl_Demo_Im,80973800 +ovl_Demo_Tre_Lgt,80977770 +ovl_En_Fw,80977E80 +ovl_Bg_Vb_Sima,80979630 +ovl_En_Vb_Ball,80979D40 +ovl_Bg_Haka_Megane,8097AEE0 +ovl_Bg_Haka_MeganeBG,8097B2E0 +ovl_Bg_Haka_Ship,8097B9A0 +ovl_Bg_Haka_Sgami,8097C3E0 +ovl_En_Heishi2,8097D000 +ovl_En_Encount2,8097F200 +ovl_En_Fire_Rock,80980430 +ovl_En_Brob,80981540 +ovl_Mir_Ray,80982630 +ovl_Bg_Spot09_Obj,80983EF0 +ovl_Bg_Spot18_Obj,80984400 +ovl_Boss_Va,80984CD0 +ovl_Bg_Haka_Tubo,8099BEC0 +ovl_Bg_Haka_Trap,8099C8E0 +ovl_Bg_Haka_Huta,8099DEB0 +ovl_Bg_Haka_Zou,8099E950 +ovl_Bg_Spot17_Funen,8099FB40 +ovl_En_Syateki_Itm,8099FD90 +ovl_En_Syateki_Man,809A0B30 +ovl_En_Tana,809A18F0 +ovl_En_Nb,809A1B90 +ovl_Boss_Mo,809A6160 +ovl_En_Sb,809B6210 +ovl_En_Bigokuta,809B7650 +ovl_En_Karebaba,809BA160 +ovl_Bg_Bdan_Objects,809BBA50 +ovl_Demo_Sa,809BCD20 +ovl_Demo_Go,809BF840 +ovl_En_In,809C05A0 +ovl_En_Tr,809C3300 +ovl_Bg_Spot16_Bombstone,809C4C00 +ovl_Bg_Hidan_Kowarerukabe,809C6140 +ovl_Bg_Bombwall,809C7010 +ovl_En_Ru2,809C78D0 +ovl_Obj_Dekujr,809CA650 +ovl_Bg_Mizu_Uzu,809CAC90 +ovl_Bg_Spot06_Objects,809CAE60 +ovl_Bg_Ice_Objects,809CC270 +ovl_Bg_Haka_Water,809CD1B0 +ovl_En_Ma2,809CD990 +ovl_En_Bom_Chu,809CE9F0 +ovl_En_Horse_Game_Check,809D0090 +ovl_Boss_Tw,809D1160 +ovl_En_Rr,809E6C60 +ovl_En_Ba,809E9180 +ovl_En_Bx,809EB050 +ovl_En_Anubice,809EBB40 +ovl_En_Anubice_Fire,809ECDF0 +ovl_Bg_Mori_Hashigo,809EDBB0 +ovl_Bg_Mori_Hashira4,809EE470 +ovl_Bg_Mori_Idomizu,809EEA00 +ovl_Bg_Spot16_Doughnut,809EF040 +ovl_Bg_Bdan_Switch,809EF5F0 +ovl_En_Ma1,809F0A20 +ovl_Boss_Ganon,809F1D00 +ovl_Boss_Sst,80A17AF0 +ovl_En_Ny,80A24050 +ovl_En_Fr,80A25980 +ovl_Item_Shield,80A28410 +ovl_Bg_Ice_Shelter,80A28E20 +ovl_En_Ice_Hono,80A2A050 +ovl_Item_Ocarina,80A2B240 +ovl_Magic_Dark,80A2BA10 +ovl_Demo_6K,80A2D260 +ovl_En_Anubice_Tag,80A2FF70 +ovl_Bg_Haka_Gate,80A30240 +ovl_Bg_Spot15_Saku,80A312D0 +ovl_Bg_Jya_Goroiwa,80A31610 +ovl_Bg_Jya_Zurerukabe,80A31D90 +ovl_Bg_Jya_Cobra,80A32440 +ovl_Bg_Jya_Kanaami,80A34160 +ovl_Fishing,80A34510 +ovl_Obj_Oshihiki,80A4EFC0 +ovl_Bg_Gate_Shutter,80A50A70 +ovl_Eff_Dust,80A50EF0 +ovl_Bg_Spot01_Fusya,80A522D0 +ovl_Bg_Spot01_Idohashira,80A52570 +ovl_Bg_Spot01_Idomizu,80A53170 +ovl_Bg_Po_Syokudai,80A53480 +ovl_Bg_Ganon_Otyuka,80A53DD0 +ovl_Bg_Spot15_Rrbox,80A56410 +ovl_Bg_Umajump,80A571F0 +ovl_En_Insect,80A57380 +ovl_En_Butte,80A598A0 +ovl_En_Fish,80A5AE70 +ovl_Bg_Spot08_Iceblock,80A5CF80 +ovl_Item_Etcetera,80A5DFC0 +ovl_Arrow_Fire,80A5E890 +ovl_Arrow_Ice,80A60750 +ovl_Arrow_Light,80A62630 +ovl_Obj_Kibako,80A64520 +ovl_Obj_Tsubo,80A65220 +ovl_En_Wonder_Item,80A66210 +ovl_En_Ik,80A66F40 +ovl_Demo_Ik,80A6B580 +ovl_En_Skj,80A6CA90 +ovl_En_Skjneedle,80A703D0 +ovl_En_G_Switch,80A706E0 +ovl_Demo_Ext,80A71F10 +ovl_Demo_Shd,80A72850 +ovl_En_Dns,80A74C60 +ovl_Elf_Msg,80A75FF0 +ovl_En_Honotrap,80A765E0 +ovl_En_Tubo_Trap,80A77B30 +ovl_Obj_Ice_Poly,80A787D0 +ovl_Bg_Spot03_Taki,80A79180 +ovl_Bg_Spot07_Taki,80A79A70 +ovl_En_Fz,80A7A030 +ovl_En_Po_Relay,80A7C040 +ovl_Bg_Relay_Objects,80A7D750 +ovl_En_Diving_Game,80A7DF00 +ovl_En_Kusa,80A7F8B0 +ovl_Obj_Bean,80A80D90 +ovl_Obj_Bombiwa,80A83520 +ovl_Obj_Switch,80A83A90 +ovl_Obj_Elevator,80A85850 +ovl_Obj_Lift,80A85C10 +ovl_Obj_Hsblock,80A86630 +ovl_En_Okarina_Tag,80A86C00 +ovl_En_Yabusame_Mark,80A880E0 +ovl_En_Goroiwa,80A887B0 +ovl_En_Ex_Ruppy,80A8AB70 +ovl_En_Toryo,80A8BC30 +ovl_En_Daiku,80A8C8C0 +ovl_En_Nwc,80A8E000 +ovl_En_Blkobj,80A8EA40 +ovl_Item_Inbox,80A8EFA0 +ovl_En_Ge1,80A8F100 +ovl_Obj_Blockstop,80A91130 +ovl_En_Sda,80A912D0 +ovl_En_Clear_Tag,80A929D0 +ovl_En_Niw_Lady,80A9DF70 +ovl_En_Gm,80A9F850 +ovl_En_Ms,80AA0580 +ovl_En_Hs,80AA0C70 +ovl_Bg_Ingate,80AA1810 +ovl_En_Kanban,80AA1BA0 +ovl_En_Heishi3,80AA4CF0 +ovl_En_Syateki_Niw,80AA56C0 +ovl_En_Attack_Niw,80AA7750 +ovl_Bg_Spot01_Idosoko,80AA89B0 +ovl_En_Sa,80AA8BC0 +ovl_En_Wonder_Talk,80AAAE30 +ovl_Bg_Gjyo_Bridge,80AAB4C0 +ovl_En_Ds,80AAB9C0 +ovl_En_Mk,80AAC5E0 +ovl_En_Bom_Bowl_Man,80AAD470 +ovl_En_Bom_Bowl_Pit,80AAE9B0 +ovl_En_Owl,80AAF320 +ovl_En_Ishi,80AB2EC0 +ovl_Obj_Hana,80ABC010 +ovl_Obj_Lightswitch,80ABC320 +ovl_Obj_Mure2,80ABD750 +ovl_En_Go,80ABE170 +ovl_En_Fu,80AC27B0 +ovl_En_Changer,80AC3500 +ovl_Bg_Jya_Megami,80AC3EE0 +ovl_Bg_Jya_Lift,80AC50C0 +ovl_Bg_Jya_Bigmirror,80AC5610 +ovl_Bg_Jya_Bombchuiwa,80AC5E50 +ovl_Bg_Jya_Amishutter,80AC6980 +ovl_Bg_Jya_Bombiwa,80AC6D10 +ovl_Bg_Spot18_Basket,80AC72D0 +ovl_En_Ganon_Organ,80AC82C0 +ovl_En_Siofuki,80ACF2C0 +ovl_En_Stream,80AD0070 +ovl_En_Mm,80AD0600 +ovl_En_Ko,80AD1C20 +ovl_En_Kz,80AD5D60 +ovl_En_Weather_Tag,80AD7270 +ovl_Bg_Sst_Floor,80AD8160 +ovl_En_Ani,80AD86C0 +ovl_En_Ex_Item,80AD9430 +ovl_Bg_Jya_Ironobj,80ADA5A0 +ovl_En_Js,80ADB350 +ovl_En_Jsjutan,80ADBD20 +ovl_En_Cs,80AE1640 +ovl_En_Md,80AE2870 +ovl_En_Hy,80AE4EE0 +ovl_En_Ganon_Mant,80AE8820 +ovl_En_Okarina_Effect,80AECA40 +ovl_En_Mag,80AECDF0 +ovl_Door_Gerudo,80AF1D00 +ovl_Elf_Msg2,80AF22F0 +ovl_Demo_Gt,80AF2760 +ovl_En_Po_Field,80AF7D60 +ovl_Efc_Erupc,80AFB7D0 +ovl_Bg_Zg,80AFC2B0 +ovl_En_Heishi4,80AFC720 +ovl_En_Zl3,80AFD620 +ovl_Boss_Ganon2,80B05470 +ovl_En_Kakasi,80B18280 +ovl_En_Takara_Man,80B18FC0 +ovl_Obj_Makeoshihiki,80B19880 +ovl_Oceff_Spot,80B19D10 +ovl_End_Title,80B1AC40 +ovl_En_Torch,80B1ED70 +ovl_Demo_Ec,80B1EE60 +ovl_Shot_Sun,80B226C0 +ovl_En_Dy_Extra,80B22D80 +ovl_En_Wonder_Talk2,80B23300 +ovl_En_Ge2,80B239A0 +ovl_Obj_Roomtimer,80B25340 +ovl_En_Ssh,80B25590 +ovl_En_Sth,80B27B80 +ovl_Oceff_Wipe,80B2BC30 +ovl_Effect_Ss_Dust,80B2C980 +ovl_Effect_Ss_KiraKira,80B2D1B0 +ovl_Effect_Ss_Bomb,80B2D820 +ovl_Effect_Ss_Bomb2,80B2DC40 +ovl_Effect_Ss_Blast,80B2E570 +ovl_Effect_Ss_G_Spk,80B2E900 +ovl_Effect_Ss_D_Fire,80B2EEB0 +ovl_Effect_Ss_Bubble,80B2F3A0 +ovl_Effect_Ss_G_Ripple,80B2F820 +ovl_Effect_Ss_G_Splash,80B2FD80 +ovl_Effect_Ss_G_Magma,80B30230 +ovl_Effect_Ss_G_Fire,80B30490 +ovl_Effect_Ss_Lightning,80B30720 +ovl_Effect_Ss_Dt_Bubble,80B30DF0 +ovl_Effect_Ss_Hahen,80B31380 +ovl_Effect_Ss_Stick,80B319C0 +ovl_Effect_Ss_Sibuki,80B31D60 +ovl_Effect_Ss_Sibuki2,80B32430 +ovl_Effect_Ss_G_Magma2,80B32760 +ovl_Effect_Ss_Stone1,80B32C70 +ovl_Effect_Ss_HitMark,80B33000 +ovl_Effect_Ss_Fhg_Flash,80B33550 +ovl_Effect_Ss_K_Fire,80B344D0 +ovl_Effect_Ss_Solder_Srch_Ball,80B34900 +ovl_Effect_Ss_Kakera,80B34AB0 +ovl_Effect_Ss_Ice_Piece,80B35B40 +ovl_Effect_Ss_En_Ice,80B35F80 +ovl_Effect_Ss_Fire_Tail,80B36790 +ovl_Effect_Ss_En_Fire,80B36E90 +ovl_Effect_Ss_Extra,80B375D0 +ovl_Effect_Ss_Fcircle,80B37990 +ovl_Effect_Ss_Dead_Db,80B37E40 +ovl_Effect_Ss_Dead_Dd,80B38320 +ovl_Effect_Ss_Dead_Ds,80B388B0 +ovl_Effect_Ss_Dead_Sound,80B38D30 +ovl_Oceff_Storm,80B38E70 +ovl_En_Weiyer,80B3AA10 +ovl_Bg_Spot05_Soko,80B3C410 +ovl_Bg_Jya_1flift,80B3C730 +ovl_Bg_Jya_Haheniron,80B3CDC0 +ovl_Bg_Spot12_Gate,80B3D5B0 +ovl_Bg_Spot12_Saku,80B3D9C0 +ovl_En_Hintnuts,80B3DE80 +ovl_En_Nutsball,80B3F8B0 +ovl_Bg_Spot00_Break,80B3FED0 +ovl_En_Shopnuts,80B40070 +ovl_En_It,80B40F80 +ovl_En_GeldB,80B41110 +ovl_Oceff_Wipe2,80B464C0 +ovl_Oceff_Wipe3,80B47C30 +ovl_En_Niw_Girl,80B49380 +ovl_En_Dog,80B49E50 +ovl_En_Si,80B4B000 +ovl_Bg_Spot01_Objects2,80B4B500 +ovl_Obj_Comb,80B4B9C0 +ovl_Bg_Spot11_Bakudankabe,80B4C220 +ovl_Obj_Kibako2,80B4C860 +ovl_En_Dnt_Demo,80B4CF20 +ovl_En_Dnt_Jiji,80B4DC40 +ovl_En_Dnt_Nomal,80B4F150 +ovl_En_Guest,80B51F50 +ovl_Bg_Bom_Guard,80B528F0 +ovl_En_Hs2,80B52B10 +ovl_Demo_Kekkai,80B530F0 +ovl_Bg_Spot08_Bakudankabe,80B543D0 +ovl_Bg_Spot17_Bakudankabe,80B54A70 +ovl_Obj_Mure3,80B55150 +ovl_En_Tg,80B55920 +ovl_En_Mu,80B55FF0 +ovl_En_Go2,80B56910 +ovl_En_Wf,80B5C930 +ovl_En_Skb,80B60C40 +ovl_Demo_Gj,80B62530 +ovl_Demo_Geff,80B661E0 +ovl_Bg_Gnd_Firemeiro,80B66A00 +ovl_Bg_Gnd_Darkmeiro,80B66F40 +ovl_Bg_Gnd_Soulmeiro,80B67700 +ovl_Bg_Gnd_Nisekabe,80B67F60 +ovl_Bg_Gnd_Iceblock,80B680D0 +ovl_Bg_Ydan_Sp,80B691D0 +ovl_En_Gb,80B6A940 +ovl_En_Gs,80B6C070 +ovl_Bg_Mizu_Bwall,80B6DF10 +ovl_Bg_Mizu_Shutter,80B6F3E0 +ovl_En_Daiku_Kakariko,80B6FBE0 +ovl_Bg_Bowl_Wall,80B70FA0 +ovl_En_Wall_Tubo,80B71920 +ovl_En_Po_Desert,80B71E10 +ovl_En_Crow,80B72BD0 +ovl_Door_Killer,80B74270 +ovl_Bg_Spot11_Oasis,80B757E0 +ovl_Bg_Spot18_Futa,80B75F10 +ovl_Bg_Spot18_Shutter,80B760B0 +ovl_En_Ma3,80B76600 +ovl_En_Cow,80B77570 +ovl_Bg_Ice_Turara,80B789D0 +ovl_Bg_Ice_Shutter,80B79200 +ovl_En_Kakasi2,80B79670 +ovl_En_Kakasi3,80B79D90 +ovl_Oceff_Wipe4,80B7AE70 +ovl_En_Eg,80B7BE50 +ovl_Bg_Menkuri_Nisekabe,80B7C000 +ovl_En_Zo,80B7C150 +ovl_Effect_Ss_Ice_Smoke,80B7E700 +ovl_Obj_Makekinsuta,80B7EBC0 +ovl_En_Ge3,80B7ED10 +ovl_Obj_Timeblock,80B7F860 +ovl_Obj_Hamishi,80B804A0 +ovl_En_Zl4,80B80CF0 +ovl_En_Mm2,80B85720 +ovl_Bg_Jya_Block,80B864E0 +ovl_Obj_Warp2block,80B86750 +gameplay_keep, +gameplay_field_keep, +gameplay_dangeon_keep, +gameplay_object_exchange_static, +object_link_boy, +object_link_child, +object_box, +object_human, +object_okuta, +object_poh, +object_wallmaster, +object_dy_obj, +object_firefly, +object_dodongo, +object_fire, +object_niw, +object_tite, +object_reeba, +object_peehat, +object_kingdodongo, +object_horse, +object_zf, +object_goma, +object_zl1, +object_gol, +object_bubble, +object_dodojr, +object_torch2, +object_bl, +object_tp, +object_oA1, +object_st, +object_bw, +object_ei, +object_horse_normal, +object_oB1, +object_o_anime, +object_spot04_objects, +object_ddan_objects, +object_hidan_objects, +object_horse_ganon, +object_oA2, +object_spot00_objects, +object_mb, +object_bombf, +object_sk2, +object_oE1, +object_oE_anime, +object_oE2, +object_ydan_objects, +object_gnd, +object_am, +object_dekubaba, +object_oA3, +object_oA4, +object_oA5, +object_oA6, +object_oA7, +object_jj, +object_oA8, +object_oA9, +object_oB2, +object_oB3, +object_oB4, +object_horse_zelda, +object_opening_demo1, +object_warp1, +object_b_heart, +object_dekunuts, +object_oE3, +object_oE4, +object_menkuri_objects, +object_oE5, +object_oE6, +object_oE7, +object_oE8, +object_oE9, +object_oE10, +object_oE11, +object_oE12, +object_vali, +object_oA10, +object_oA11, +object_mizu_objects, +object_fhg, +object_ossan, +object_mori_hineri1, +object_Bb, +object_toki_objects, +object_yukabyun, +object_zl2, +object_mjin, +object_mjin_flash, +object_mjin_dark, +object_mjin_flame, +object_mjin_ice, +object_mjin_soul, +object_mjin_wind, +object_mjin_oka, +object_haka_objects, +object_spot06_objects, +object_ice_objects, +object_relay_objects, +object_mori_hineri1a, +object_mori_hineri2, +object_mori_hineri2a, +object_mori_objects, +object_mori_tex, +object_spot08_obj, +object_warp2, +object_hata, +object_bird, +object_wood02, +object_lightbox, +object_pu_box, +object_trap, +object_vase, +object_im, +object_ta, +object_tk, +object_xc, +object_vm, +object_bv, +object_hakach_objects, +object_efc_crystal_light, +object_efc_fire_ball, +object_efc_flash, +object_efc_lgt_shower, +object_efc_star_field, +object_god_lgt, +object_light_ring, +object_triforce_spot, +object_medal, +object_bdan_objects, +object_sd, +object_rd, +object_po_sisters, +object_heavy_object, +object_gndd, +object_fd, +object_du, +object_fw, +object_horse_link_child, +object_spot02_objects, +object_haka, +object_ru1, +object_syokudai, +object_fd2, +object_dh, +object_rl, +object_efc_tw, +object_demo_tre_lgt, +object_gi_key, +object_mir_ray, +object_brob, +object_gi_jewel, +object_spot09_obj, +object_spot18_obj, +object_bdoor, +object_spot17_obj, +object_shop_dungen, +object_nb, +object_mo, +object_sb, +object_gi_melody, +object_gi_heart, +object_gi_compass, +object_gi_bosskey, +object_gi_medal, +object_gi_nuts, +object_sa, +object_gi_hearts, +object_gi_arrowcase, +object_gi_bombpouch, +object_in, +object_tr, +object_spot16_obj, +object_oE1s, +object_oE4s, +object_os_anime, +object_gi_bottle, +object_gi_stick, +object_gi_map, +object_oF1d_map, +object_ru2, +object_gi_shield_1, +object_dekujr, +object_gi_magicpot, +object_gi_bomb_1, +object_oF1s, +object_ma2, +object_gi_purse, +object_hni, +object_tw, +object_rr, +object_bxa, +object_anubice, +object_gi_gerudo, +object_gi_arrow, +object_gi_bomb_2, +object_gi_egg, +object_gi_scale, +object_gi_shield_2, +object_gi_hookshot, +object_gi_ocarina, +object_gi_milk, +object_ma1, +object_ganon, +object_sst, +object_ny, +object_fr, +object_gi_pachinko, +object_gi_boomerang, +object_gi_bow, +object_gi_glasses, +object_gi_liquid, +object_ani, +object_demo_6k, +object_gi_shield_3, +object_gi_letter, +object_spot15_obj, +object_jya_obj, +object_gi_clothes, +object_gi_bean, +object_gi_fish, +object_gi_saw, +object_gi_hammer, +object_gi_grass, +object_gi_longsword, +object_spot01_objects, +object_md, +object_km1, +object_kw1, +object_zo, +object_kz, +object_umajump, +object_masterkokiri, +object_masterkokirihead, +object_mastergolon, +object_masterzoora, +object_aob, +object_ik, +object_ahg, +object_cne, +object_gi_niwatori, +object_skj, +object_gi_bottle_letter, +object_bji, +object_bba, +object_gi_ocarina_0, +object_ds, +object_ane, +object_boj, +object_spot03_object, +object_spot07_object, +object_fz, +object_bob, +object_ge1, +object_yabusame_point, +object_gi_boots_2, +object_gi_seed, +object_gnd_magic, +object_d_elevator, +object_d_hsblock, +object_d_lift, +object_mamenoki, +object_goroiwa, +object_toryo, +object_daiku, +object_nwc, +object_blkobj, +object_gm, +object_ms, +object_hs, +object_ingate, +object_lightswitch, +object_kusa, +object_tsubo, +object_gi_gloves, +object_gi_coin, +object_kanban, +object_gjyo_objects, +object_owl, +object_mk, +object_fu, +object_gi_ki_tan_mask, +object_gi_redead_mask, +object_gi_skj_mask, +object_gi_rabit_mask, +object_gi_truth_mask, +object_ganon_objects, +object_siofuki, +object_stream, +object_mm, +object_fa, +object_os, +object_gi_eye_lotion, +object_gi_powder, +object_gi_mushroom, +object_gi_ticketstone, +object_gi_brokensword, +object_js, +object_cs, +object_gi_prescription, +object_gi_bracelet, +object_gi_soldout, +object_gi_frog, +object_mag, +object_door_gerudo, +object_gt, +object_efc_erupc, +object_zl2_anime1, +object_zl2_anime2, +object_gi_golonmask, +object_gi_zoramask, +object_gi_gerudomask, +object_ganon2, +object_ka, +object_ts, +object_zg, +object_gi_hoverboots, +object_gi_m_arrow, +object_ds2, +object_ec, +object_fish, +object_gi_sutaru, +object_gi_goddess, +object_ssh, +object_bigokuta, +object_bg, +object_spot05_objects, +object_spot12_obj, +object_bombiwa, +object_hintnuts, +object_rs, +object_spot00_break, +object_gla, +object_shopnuts, +object_geldb, +object_gr, +object_dog, +object_jya_iron, +object_jya_door, +object_spot01_objects2, +object_spot11_obj, +object_kibako2, +object_dns, +object_dnk, +object_gi_fire, +object_gi_insect, +object_gi_butterfly, +object_gi_ghost, +object_gi_soul, +object_bowl, +object_po_field, +object_demo_kekkai, +object_efc_doughnut, +object_gi_dekupouch, +object_ganon_anime1, +object_ganon_anime2, +object_ganon_anime3, +object_gi_rupy, +object_spot01_matoya, +object_spot01_matoyab, +object_po_composer, +object_mu, +object_wf, +object_skb, +object_gj, +object_geff, +object_haka_door, +object_gs, +object_ps, +object_bwall, +object_crow, +object_cow, +object_cob, +object_gi_sword_1, +object_door_killer, +object_ouke_haka, +object_timeblock, +object_zl4, +g_pn_01, +g_pn_02, +g_pn_03, +g_pn_04, +g_pn_05, +g_pn_06, +g_pn_07, +g_pn_08, +g_pn_09, +g_pn_10, +g_pn_11, +g_pn_12, +g_pn_13, +g_pn_14, +g_pn_15, +g_pn_16, +g_pn_17, +g_pn_18, +g_pn_19, +g_pn_20, +g_pn_21, +g_pn_22, +g_pn_23, +g_pn_24, +g_pn_25, +g_pn_26, +g_pn_27, +g_pn_28, +g_pn_29, +g_pn_30, +g_pn_31, +g_pn_32, +g_pn_33, +g_pn_34, +g_pn_35, +g_pn_36, +g_pn_37, +g_pn_38, +g_pn_39, +g_pn_40, +g_pn_41, +g_pn_42, +g_pn_43, +g_pn_44, +g_pn_45, +g_pn_46, +g_pn_47, +g_pn_48, +g_pn_49, +g_pn_50, +g_pn_51, +g_pn_52, +g_pn_53, +g_pn_54, +g_pn_55, +g_pn_56, +g_pn_57, +z_select_static, +nintendo_rogo_static, +title_static, +parameter_static, +vr_fine0_static, +vr_fine0_pal_static, +vr_fine1_static, +vr_fine1_pal_static, +vr_fine2_static, +vr_fine2_pal_static, +vr_fine3_static, +vr_fine3_pal_static, +vr_cloud0_static, +vr_cloud0_pal_static, +vr_cloud1_static, +vr_cloud1_pal_static, +vr_cloud2_static, +vr_cloud2_pal_static, +vr_cloud3_static, +vr_cloud3_pal_static, +vr_holy0_static, +vr_holy0_pal_static, +vr_holy1_static, +vr_holy1_pal_static, +vr_MDVR_static, +vr_MDVR_pal_static, +vr_MNVR_static, +vr_MNVR_pal_static, +vr_RUVR_static, +vr_RUVR_pal_static, +vr_LHVR_static, +vr_LHVR_pal_static, +vr_KHVR_static, +vr_KHVR_pal_static, +vr_K3VR_static, +vr_K3VR_pal_static, +vr_K4VR_static, +vr_K4VR_pal_static, +vr_K5VR_static, +vr_K5VR_pal_static, +vr_SP1a_static, +vr_SP1a_pal_static, +vr_MLVR_static, +vr_MLVR_pal_static, +vr_KKRVR_static, +vr_KKRVR_pal_static, +vr_KR3VR_static, +vr_KR3VR_pal_static, +vr_IPVR_static, +vr_IPVR_pal_static, +vr_KSVR_static, +vr_KSVR_pal_static, +vr_GLVR_static, +vr_GLVR_pal_static, +vr_ZRVR_static, +vr_ZRVR_pal_static, +vr_DGVR_static, +vr_DGVR_pal_static, +vr_ALVR_static, +vr_ALVR_pal_static, +vr_NSVR_static, +vr_NSVR_pal_static, +vr_LBVR_static, +vr_LBVR_pal_static, +vr_TTVR_static, +vr_TTVR_pal_static, +vr_FCVR_static, +vr_FCVR_pal_static, +elf_message_field, +elf_message_ydan, +ddan_scene, +ddan_room_0, +ddan_room_1, +ddan_room_2, +ddan_room_3, +ddan_room_4, +ddan_room_5, +ddan_room_6, +ddan_room_7, +ddan_room_8, +ddan_room_9, +ddan_room_10, +ddan_room_11, +ddan_room_12, +ddan_room_13, +ddan_room_14, +ddan_room_15, +ddan_room_16, +spot00_scene, +spot00_room_0, +spot01_scene, +spot01_room_0, +spot02_scene, +spot02_room_0, +spot02_room_1, +spot03_scene, +spot03_room_0, +spot03_room_1, +spot04_scene, +spot04_room_0, +spot04_room_1, +spot04_room_2, +spot05_scene, +spot05_room_0, +spot06_scene, +spot06_room_0, +spot07_scene, +spot07_room_0, +spot07_room_1, +spot08_scene, +spot08_room_0, +spot09_scene, +spot09_room_0, +spot10_scene, +spot10_room_0, +spot10_room_1, +spot10_room_2, +spot10_room_3, +spot10_room_4, +spot10_room_5, +spot10_room_6, +spot10_room_7, +spot10_room_8, +spot10_room_9, +spot11_scene, +spot11_room_0, +spot12_scene, +spot12_room_0, +spot12_room_1, +spot13_scene, +spot13_room_0, +spot13_room_1, +spot15_scene, +spot15_room_0, +spot16_scene, +spot16_room_0, +spot17_scene, +spot17_room_0, +spot17_room_1, +spot18_scene, +spot18_room_0, +spot18_room_1, +spot18_room_2, +spot18_room_3, +market_day_scene, +market_day_room_0, +market_night_scene, +market_night_room_0, +HIDAN_scene, +HIDAN_room_0, +HIDAN_room_1, +HIDAN_room_2, +HIDAN_room_3, +HIDAN_room_4, +HIDAN_room_5, +HIDAN_room_6, +HIDAN_room_7, +HIDAN_room_8, +HIDAN_room_9, +HIDAN_room_10, +HIDAN_room_11, +HIDAN_room_12, +HIDAN_room_13, +HIDAN_room_14, +HIDAN_room_15, +HIDAN_room_16, +HIDAN_room_17, +HIDAN_room_18, +HIDAN_room_19, +HIDAN_room_20, +HIDAN_room_21, +HIDAN_room_22, +HIDAN_room_23, +HIDAN_room_24, +HIDAN_room_25, +HIDAN_room_26, +Bmori1_scene, +Bmori1_room_0, +Bmori1_room_1, +Bmori1_room_2, +Bmori1_room_3, +Bmori1_room_4, +Bmori1_room_5, +Bmori1_room_6, +Bmori1_room_7, +Bmori1_room_8, +Bmori1_room_9, +Bmori1_room_10, +Bmori1_room_11, +Bmori1_room_12, +Bmori1_room_13, +Bmori1_room_14, +Bmori1_room_15, +Bmori1_room_16, +Bmori1_room_17, +Bmori1_room_18, +Bmori1_room_19, +Bmori1_room_20, +Bmori1_room_21, +Bmori1_room_22, +ydan_scene, +ydan_room_0, +ydan_room_1, +ydan_room_2, +ydan_room_3, +ydan_room_4, +ydan_room_5, +ydan_room_6, +ydan_room_7, +ydan_room_8, +ydan_room_9, +ydan_room_10, +ydan_room_11, +kenjyanoma_scene, +kenjyanoma_room_0, +tokinoma_scene, +tokinoma_room_0, +tokinoma_room_1, +link_home_scene, +link_home_room_0, +kokiri_shop_scene, +kokiri_shop_room_0, +MIZUsin_scene, +MIZUsin_room_0, +MIZUsin_room_1, +MIZUsin_room_2, +MIZUsin_room_3, +MIZUsin_room_4, +MIZUsin_room_5, +MIZUsin_room_6, +MIZUsin_room_7, +MIZUsin_room_8, +MIZUsin_room_9, +MIZUsin_room_10, +MIZUsin_room_11, +MIZUsin_room_12, +MIZUsin_room_13, +MIZUsin_room_14, +MIZUsin_room_15, +MIZUsin_room_16, +MIZUsin_room_17, +MIZUsin_room_18, +MIZUsin_room_19, +MIZUsin_room_20, +MIZUsin_room_21, +MIZUsin_room_22, +kokiri_home_scene, +kokiri_home_room_0, +kakusiana_scene, +kakusiana_room_0, +kakusiana_room_1, +kakusiana_room_2, +kakusiana_room_3, +kakusiana_room_4, +kakusiana_room_5, +kakusiana_room_6, +kakusiana_room_7, +kakusiana_room_8, +kakusiana_room_9, +kakusiana_room_10, +kakusiana_room_11, +kakusiana_room_12, +kakusiana_room_13, +entra_scene, +entra_room_0, +bdan_scene, +bdan_room_0, +bdan_room_1, +bdan_room_2, +bdan_room_3, +bdan_room_4, +bdan_room_5, +bdan_room_6, +bdan_room_7, +bdan_room_8, +bdan_room_9, +bdan_room_10, +bdan_room_11, +bdan_room_12, +bdan_room_13, +bdan_room_14, +bdan_room_15, +HAKAdan_scene, +HAKAdan_room_0, +HAKAdan_room_1, +HAKAdan_room_2, +HAKAdan_room_3, +HAKAdan_room_4, +HAKAdan_room_5, +HAKAdan_room_6, +HAKAdan_room_7, +HAKAdan_room_8, +HAKAdan_room_9, +HAKAdan_room_10, +HAKAdan_room_11, +HAKAdan_room_12, +HAKAdan_room_13, +HAKAdan_room_14, +HAKAdan_room_15, +HAKAdan_room_16, +HAKAdan_room_17, +HAKAdan_room_18, +HAKAdan_room_19, +HAKAdan_room_20, +HAKAdan_room_21, +HAKAdan_room_22, +moribossroom_scene, +moribossroom_room_0, +moribossroom_room_1, +syatekijyou_scene, +syatekijyou_room_0, +men_scene, +men_room_0, +men_room_1, +men_room_2, +men_room_3, +men_room_4, +men_room_5, +men_room_6, +men_room_7, +men_room_8, +men_room_9, +men_room_10, +shop1_scene, +shop1_room_0, +hairal_niwa_scene, +hairal_niwa_room_0, +ganon_tou_scene, +ganon_tou_room_0, +market_alley_scene, +market_alley_room_0, +spot20_scene, +spot20_room_0, +market_ruins_scene, +market_ruins_room_0, +entra_n_scene, +entra_n_room_0, +enrui_scene, +enrui_room_0, +market_alley_n_scene, +market_alley_n_room_0, +hiral_demo_scene, +hiral_demo_room_0, +kokiri_home3_scene, +kokiri_home3_room_0, +jyasinzou_scene, +jyasinzou_room_0, +jyasinzou_room_1, +jyasinzou_room_2, +jyasinzou_room_3, +jyasinzou_room_4, +jyasinzou_room_5, +jyasinzou_room_6, +jyasinzou_room_7, +jyasinzou_room_8, +jyasinzou_room_9, +jyasinzou_room_10, +jyasinzou_room_11, +jyasinzou_room_12, +jyasinzou_room_13, +jyasinzou_room_14, +jyasinzou_room_15, +jyasinzou_room_16, +jyasinzou_room_17, +jyasinzou_room_18, +jyasinzou_room_19, +jyasinzou_room_20, +jyasinzou_room_21, +jyasinzou_room_22, +jyasinzou_room_23, +jyasinzou_room_24, +jyasinzou_room_25, +jyasinzou_room_26, +jyasinzou_room_27, +jyasinzou_room_28, +ice_doukutu_scene, +ice_doukutu_room_0, +ice_doukutu_room_1, +ice_doukutu_room_2, +ice_doukutu_room_3, +ice_doukutu_room_4, +ice_doukutu_room_5, +ice_doukutu_room_6, +ice_doukutu_room_7, +ice_doukutu_room_8, +ice_doukutu_room_9, +ice_doukutu_room_10, +ice_doukutu_room_11, +malon_stable_scene, +malon_stable_room_0, +kakariko_scene, +kakariko_room_0, +bdan_boss_scene, +bdan_boss_room_0, +bdan_boss_room_1, +FIRE_bs_scene, +FIRE_bs_room_0, +FIRE_bs_room_1, +hut_scene, +hut_room_0, +daiyousei_izumi_scene, +daiyousei_izumi_room_0, +hakaana_scene, +hakaana_room_0, +yousei_izumi_tate_scene, +yousei_izumi_tate_room_0, +yousei_izumi_yoko_scene, +yousei_izumi_yoko_room_0, +golon_scene, +golon_room_0, +zoora_scene, +zoora_room_0, +drag_scene, +drag_room_0, +alley_shop_scene, +alley_shop_room_0, +night_shop_scene, +night_shop_room_0, +impa_scene, +impa_room_0, +labo_scene, +labo_room_0, +tent_scene, +tent_room_0, +nakaniwa_scene, +nakaniwa_room_0, +ddan_boss_scene, +ddan_boss_room_0, +ddan_boss_room_1, +ydan_boss_scene, +ydan_boss_room_0, +ydan_boss_room_1, +HAKAdan_bs_scene, +HAKAdan_bs_room_0, +HAKAdan_bs_room_1, +MIZUsin_bs_scene, +MIZUsin_bs_room_0, +MIZUsin_bs_room_1, +ganon_scene, +ganon_room_0, +ganon_room_1, +ganon_room_2, +ganon_room_3, +ganon_room_4, +ganon_room_5, +ganon_room_6, +ganon_room_7, +ganon_room_8, +ganon_room_9, +ganon_boss_scene, +ganon_boss_room_0, +jyasinboss_scene, +jyasinboss_room_0, +jyasinboss_room_1, +jyasinboss_room_2, +jyasinboss_room_3, +kokiri_home4_scene, +kokiri_home4_room_0, +kokiri_home5_scene, +kokiri_home5_room_0, +ganon_final_scene, +ganon_final_room_0, +kakariko3_scene, +kakariko3_room_0, +hakasitarelay_scene, +hakasitarelay_room_0, +hakasitarelay_room_1, +hakasitarelay_room_2, +hakasitarelay_room_3, +hakasitarelay_room_4, +hakasitarelay_room_5, +hakasitarelay_room_6, +shrine_scene, +shrine_room_0, +turibori_scene, +turibori_room_0, +shrine_n_scene, +shrine_n_room_0, +shrine_r_scene, +shrine_r_room_0, +ganontika_scene, +ganontika_room_0, +ganontika_room_1, +ganontika_room_2, +ganontika_room_3, +ganontika_room_4, +ganontika_room_5, +ganontika_room_6, +ganontika_room_7, +ganontika_room_8, +ganontika_room_9, +ganontika_room_10, +ganontika_room_11, +ganontika_room_12, +ganontika_room_13, +ganontika_room_14, +ganontika_room_15, +ganontika_room_16, +ganontika_room_17, +ganontika_room_18, +ganontika_room_19, +hakaana2_scene, +hakaana2_room_0, +gerudoway_scene, +gerudoway_room_0, +gerudoway_room_1, +gerudoway_room_2, +gerudoway_room_3, +gerudoway_room_4, +gerudoway_room_5, +HAKAdanCH_scene, +HAKAdanCH_room_0, +HAKAdanCH_room_1, +HAKAdanCH_room_2, +HAKAdanCH_room_3, +HAKAdanCH_room_4, +HAKAdanCH_room_5, +HAKAdanCH_room_6, +hairal_niwa_n_scene, +hairal_niwa_n_room_0, +bowling_scene, +bowling_room_0, +hakaana_ouke_scene, +hakaana_ouke_room_0, +hakaana_ouke_room_1, +hakaana_ouke_room_2, +hylia_labo_scene, +hylia_labo_room_0, +souko_scene, +souko_room_0, +souko_room_1, +souko_room_2, +miharigoya_scene, +miharigoya_room_0, +mahouya_scene, +mahouya_room_0, +takaraya_scene, +takaraya_room_0, +takaraya_room_1, +takaraya_room_2, +takaraya_room_3, +takaraya_room_4, +takaraya_room_5, +takaraya_room_6, +ganon_sonogo_scene, +ganon_sonogo_room_0, +ganon_sonogo_room_1, +ganon_sonogo_room_2, +ganon_sonogo_room_3, +ganon_sonogo_room_4, +ganon_demo_scene, +ganon_demo_room_0, +face_shop_scene, +face_shop_room_0, +kinsuta_scene, +kinsuta_room_0, +ganontikasonogo_scene, +ganontikasonogo_room_0, +ganontikasonogo_room_1, +bump_texture_static, +anime_model_1_static, +anime_model_2_static, +anime_model_3_static, +anime_model_4_static, +anime_model_5_static, +anime_model_6_static, +anime_texture_1_static, +anime_texture_2_static, +anime_texture_3_static, +anime_texture_4_static, +anime_texture_5_static, +anime_texture_6_static, +softsprite_matrix_static, diff --git a/baseroms/ntsc-1.1/checksum-JP-compressed.md5 b/baseroms/ntsc-1.1/checksum-JP-compressed.md5 new file mode 100644 index 0000000000..f02c9c055f --- /dev/null +++ b/baseroms/ntsc-1.1/checksum-JP-compressed.md5 @@ -0,0 +1 @@ +1bf5f42b98c3e97948f01155f12e2d88 build/ntsc-1.1/oot-ntsc-1.1-compressed.z64 diff --git a/baseroms/ntsc-1.1/checksum-JP.md5 b/baseroms/ntsc-1.1/checksum-JP.md5 new file mode 100644 index 0000000000..771035379f --- /dev/null +++ b/baseroms/ntsc-1.1/checksum-JP.md5 @@ -0,0 +1 @@ +8b07c719217cb89334edf481a52ef392 build/ntsc-1.1/oot-ntsc-1.1.z64 diff --git a/baseroms/ntsc-1.1/checksum-US-compressed.md5 b/baseroms/ntsc-1.1/checksum-US-compressed.md5 new file mode 100644 index 0000000000..4d13bee152 --- /dev/null +++ b/baseroms/ntsc-1.1/checksum-US-compressed.md5 @@ -0,0 +1 @@ +721fdcc6f5f34be55c43a807f2a16af4 build/ntsc-1.1/oot-ntsc-1.1-compressed.z64 diff --git a/baseroms/ntsc-1.1/checksum-US.md5 b/baseroms/ntsc-1.1/checksum-US.md5 new file mode 100644 index 0000000000..df5611fe03 --- /dev/null +++ b/baseroms/ntsc-1.1/checksum-US.md5 @@ -0,0 +1 @@ +a11496a4abcd9f173f2f2a342a6370d2 build/ntsc-1.1/oot-ntsc-1.1.z64 diff --git a/baseroms/ntsc-1.1/config.yml b/baseroms/ntsc-1.1/config.yml new file mode 100644 index 0000000000..6726cc59f6 --- /dev/null +++ b/baseroms/ntsc-1.1/config.yml @@ -0,0 +1,1219 @@ +checksums: + - checksum-JP + - checksum-US +dmadata_start: 0x7430 +text_lang_pal: false +incbins: + - name: ipl3 + segment: makerom + vram: 0x80000040 + size: 0xFC0 + - name: rspbootText + segment: boot + vram: 0x800060B0 + size: 0x160 + - name: aspMainText + segment: code + vram: 0x800E3180 + size: 0xFB0 + - name: gspF3DZEX2_NoN_PosLight_fifoText + segment: code + vram: 0x800E4130 + size: 0x1390 + - name: gspS2DEX2d_fifoText + segment: code + vram: 0x800E54C0 + size: 0x18C0 + - name: njpgdspMainText + segment: code + vram: 0x800E6D80 + size: 0xAF0 + - name: aspMainData + segment: code + vram: 0x801144A0 + size: 0x2E0 + - name: gspF3DZEX2_NoN_PosLight_fifoData + segment: code + vram: 0x80114780 + size: 0x420 + - name: gspS2DEX2d_fifoData + segment: code + vram: 0x80114BA0 + size: 0x390 + - name: njpgdspMainData + segment: code + vram: 0x80114F30 + size: 0x60 +variables: + gMtxClear: 0x800FEF70 + sJpnMessageEntryTable: 0x8010AB0C + sNesMessageEntryTable: 0x8010EC4C + sStaffMessageEntryTable: 0x80112E6C + gSoundFontTable: 0x80113900 + gSequenceFontTable: 0x80113B70 + gSequenceTable: 0x80113D30 + gSampleBankTable: 0x80114420 + sShadowTex: 0x80AE0C80 +assets: +- name: code/fbdemo_circle + xml_path: assets/xml/code/fbdemo_circle.xml + start_offset: 0xEC268 + end_offset: 0xED488 +- name: code/fbdemo_triforce + xml_path: assets/xml/code/fbdemo_triforce.xml + start_offset: 0xEB6F0 + end_offset: 0xEB7C0 +- name: code/fbdemo_wipe1 + xml_path: assets/xml/code/fbdemo_wipe1.xml + start_offset: 0xEB7C0 + end_offset: 0xEC150 +- name: n64dd/error_textures + xml_path: assets/xml/n64dd/error_textures.xml + start_offset: 0xC140 + end_offset: 0x11D40 +- name: misc/link_animetion + xml_path: assets/xml/misc/link_animetion.xml +- name: misc/z_select_static + xml_path: assets/xml/misc/z_select_static.xml +- name: objects/gameplay_dangeon_keep + xml_path: assets/xml/objects/gameplay_dangeon_keep.xml +- name: objects/gameplay_field_keep + xml_path: assets/xml/objects/gameplay_field_keep.xml +- name: objects/gameplay_keep + xml_path: assets/xml/objects/gameplay_keep.xml +- name: objects/object_ahg + xml_path: assets/xml/objects/object_ahg.xml +- name: objects/object_am + xml_path: assets/xml/objects/object_am.xml +- name: objects/object_ane + xml_path: assets/xml/objects/object_ane.xml +- name: objects/object_ani + xml_path: assets/xml/objects/object_ani.xml +- name: objects/object_anubice + xml_path: assets/xml/objects/object_anubice.xml +- name: objects/object_aob + xml_path: assets/xml/objects/object_aob.xml +- name: objects/object_b_heart + xml_path: assets/xml/objects/object_b_heart.xml +- name: objects/object_Bb + xml_path: assets/xml/objects/object_Bb.xml +- name: objects/object_bba + xml_path: assets/xml/objects/object_bba.xml +- name: objects/object_bdan_objects + xml_path: assets/xml/objects/object_bdan_objects.xml +- name: objects/object_bdoor + xml_path: assets/xml/objects/object_bdoor.xml +- name: objects/object_bg + xml_path: assets/xml/objects/object_bg.xml +- name: objects/object_bigokuta + xml_path: assets/xml/objects/object_bigokuta.xml +- name: objects/object_bird + xml_path: assets/xml/objects/object_bird.xml +- name: objects/object_bji + xml_path: assets/xml/objects/object_bji.xml +- name: objects/object_bl + xml_path: assets/xml/objects/object_bl.xml +- name: objects/object_blkobj + xml_path: assets/xml/objects/object_blkobj.xml +- name: objects/object_bob + xml_path: assets/xml/objects/object_bob.xml +- name: objects/object_boj + xml_path: assets/xml/objects/object_boj.xml +- name: objects/object_bombf + xml_path: assets/xml/objects/object_bombf.xml +- name: objects/object_bombiwa + xml_path: assets/xml/objects/object_bombiwa.xml +- name: objects/object_bowl + xml_path: assets/xml/objects/object_bowl.xml +- name: objects/object_box + xml_path: assets/xml/objects/object_box.xml +- name: objects/object_brob + xml_path: assets/xml/objects/object_brob.xml +- name: objects/object_bubble + xml_path: assets/xml/objects/object_bubble.xml +- name: objects/object_bv + xml_path: assets/xml/objects/object_bv.xml +- name: objects/object_bw + xml_path: assets/xml/objects/object_bw.xml +- name: objects/object_bwall + xml_path: assets/xml/objects/object_bwall.xml +- name: objects/object_bxa + xml_path: assets/xml/objects/object_bxa.xml +- name: objects/object_cne + xml_path: assets/xml/objects/object_cne.xml +- name: objects/object_cob + xml_path: assets/xml/objects/object_cob.xml +- name: objects/object_cow + xml_path: assets/xml/objects/object_cow.xml +- name: objects/object_crow + xml_path: assets/xml/objects/object_crow.xml +- name: objects/object_cs + xml_path: assets/xml/objects/object_cs.xml +- name: objects/object_d_elevator + xml_path: assets/xml/objects/object_d_elevator.xml +- name: objects/object_d_hsblock + xml_path: assets/xml/objects/object_d_hsblock.xml +- name: objects/object_d_lift + xml_path: assets/xml/objects/object_d_lift.xml +- name: objects/object_daiku + xml_path: assets/xml/objects/object_daiku.xml +- name: objects/object_ddan_objects + xml_path: assets/xml/objects/object_ddan_objects.xml +- name: objects/object_dekubaba + xml_path: assets/xml/objects/object_dekubaba.xml +- name: objects/object_dekujr + xml_path: assets/xml/objects/object_dekujr.xml +- name: objects/object_dekunuts + xml_path: assets/xml/objects/object_dekunuts.xml +- name: objects/object_demo_6k + xml_path: assets/xml/objects/object_demo_6k.xml +- name: objects/object_demo_kekkai + xml_path: assets/xml/objects/object_demo_kekkai.xml +- name: objects/object_demo_tre_lgt + xml_path: assets/xml/objects/object_demo_tre_lgt.xml +- name: objects/object_dh + xml_path: assets/xml/objects/object_dh.xml +- name: objects/object_dnk + xml_path: assets/xml/objects/object_dnk.xml +- name: objects/object_dns + xml_path: assets/xml/objects/object_dns.xml +- name: objects/object_dodojr + xml_path: assets/xml/objects/object_dodojr.xml +- name: objects/object_dodongo + xml_path: assets/xml/objects/object_dodongo.xml +- name: objects/object_dog + xml_path: assets/xml/objects/object_dog.xml +- name: objects/object_door_gerudo + xml_path: assets/xml/objects/object_door_gerudo.xml +- name: objects/object_door_killer + xml_path: assets/xml/objects/object_door_killer.xml +- name: objects/object_ds + xml_path: assets/xml/objects/object_ds.xml +- name: objects/object_ds2 + xml_path: assets/xml/objects/object_ds2.xml +- name: objects/object_du + xml_path: assets/xml/objects/object_du.xml +- name: objects/object_dy_obj + xml_path: assets/xml/objects/object_dy_obj.xml +- name: objects/object_ec + xml_path: assets/xml/objects/object_ec.xml +- name: objects/object_efc_crystal_light + xml_path: assets/xml/objects/object_efc_crystal_light.xml +- name: objects/object_efc_doughnut + xml_path: assets/xml/objects/object_efc_doughnut.xml +- name: objects/object_efc_erupc + xml_path: assets/xml/objects/object_efc_erupc.xml +- name: objects/object_efc_fire_ball + xml_path: assets/xml/objects/object_efc_fire_ball.xml +- name: objects/object_efc_flash + xml_path: assets/xml/objects/object_efc_flash.xml +- name: objects/object_efc_lgt_shower + xml_path: assets/xml/objects/object_efc_lgt_shower.xml +- name: objects/object_efc_star_field + xml_path: assets/xml/objects/object_efc_star_field.xml +- name: objects/object_efc_tw + xml_path: assets/xml/objects/object_efc_tw.xml +- name: objects/object_ei + xml_path: assets/xml/objects/object_ei.xml +- name: objects/object_fa + xml_path: assets/xml/objects/object_fa.xml +- name: objects/object_fd + xml_path: assets/xml/objects/object_fd.xml +- name: objects/object_fd2 + xml_path: assets/xml/objects/object_fd2.xml +- name: objects/object_fhg + xml_path: assets/xml/objects/object_fhg.xml +- name: objects/object_fire + xml_path: assets/xml/objects/object_fire.xml +- name: objects/object_firefly + xml_path: assets/xml/objects/object_firefly.xml +- name: objects/object_fish + xml_path: assets/xml/objects/object_fish.xml +- name: objects/object_fr + xml_path: assets/xml/objects/object_fr.xml +- name: objects/object_fu + xml_path: assets/xml/objects/object_fu.xml +- name: objects/object_fw + xml_path: assets/xml/objects/object_fw.xml +- name: objects/object_fz + xml_path: assets/xml/objects/object_fz.xml +- name: objects/object_ganon + xml_path: assets/xml/objects/object_ganon.xml +- name: objects/object_ganon2 + xml_path: assets/xml/objects/object_ganon2.xml +- name: objects/object_ganon_anime1 + xml_path: assets/xml/objects/object_ganon_anime1.xml +- name: objects/object_ganon_anime2 + xml_path: assets/xml/objects/object_ganon_anime2.xml +- name: objects/object_ganon_anime3 + xml_path: assets/xml/objects/object_ganon_anime3.xml +- name: objects/object_ganon_objects + xml_path: assets/xml/objects/object_ganon_objects.xml +- name: objects/object_ge1 + xml_path: assets/xml/objects/object_ge1.xml +- name: objects/object_geff + xml_path: assets/xml/objects/object_geff.xml +- name: objects/object_geldb + xml_path: assets/xml/objects/object_geldb.xml +- name: objects/object_gi_arrow + xml_path: assets/xml/objects/object_gi_arrow.xml +- name: objects/object_gi_arrowcase + xml_path: assets/xml/objects/object_gi_arrowcase.xml +- name: objects/object_gi_bean + xml_path: assets/xml/objects/object_gi_bean.xml +- name: objects/object_gi_bomb_1 + xml_path: assets/xml/objects/object_gi_bomb_1.xml +- name: objects/object_gi_bomb_2 + xml_path: assets/xml/objects/object_gi_bomb_2.xml +- name: objects/object_gi_bombpouch + xml_path: assets/xml/objects/object_gi_bombpouch.xml +- name: objects/object_gi_boomerang + xml_path: assets/xml/objects/object_gi_boomerang.xml +- name: objects/object_gi_boots_2 + xml_path: assets/xml/objects/object_gi_boots_2.xml +- name: objects/object_gi_bosskey + xml_path: assets/xml/objects/object_gi_bosskey.xml +- name: objects/object_gi_bottle + xml_path: assets/xml/objects/object_gi_bottle.xml +- name: objects/object_gi_bottle_letter + xml_path: assets/xml/objects/object_gi_bottle_letter.xml +- name: objects/object_gi_bow + xml_path: assets/xml/objects/object_gi_bow.xml +- name: objects/object_gi_bracelet + xml_path: assets/xml/objects/object_gi_bracelet.xml +- name: objects/object_gi_brokensword + xml_path: assets/xml/objects/object_gi_brokensword.xml +- name: objects/object_gi_butterfly + xml_path: assets/xml/objects/object_gi_butterfly.xml +- name: objects/object_gi_clothes + xml_path: assets/xml/objects/object_gi_clothes.xml +- name: objects/object_gi_coin + xml_path: assets/xml/objects/object_gi_coin.xml +- name: objects/object_gi_compass + xml_path: assets/xml/objects/object_gi_compass.xml +- name: objects/object_gi_dekupouch + xml_path: assets/xml/objects/object_gi_dekupouch.xml +- name: objects/object_gi_egg + xml_path: assets/xml/objects/object_gi_egg.xml +- name: objects/object_gi_eye_lotion + xml_path: assets/xml/objects/object_gi_eye_lotion.xml +- name: objects/object_gi_fire + xml_path: assets/xml/objects/object_gi_fire.xml +- name: objects/object_gi_fish + xml_path: assets/xml/objects/object_gi_fish.xml +- name: objects/object_gi_frog + xml_path: assets/xml/objects/object_gi_frog.xml +- name: objects/object_gi_gerudo + xml_path: assets/xml/objects/object_gi_gerudo.xml +- name: objects/object_gi_gerudomask + xml_path: assets/xml/objects/object_gi_gerudomask.xml +- name: objects/object_gi_ghost + xml_path: assets/xml/objects/object_gi_ghost.xml +- name: objects/object_gi_glasses + xml_path: assets/xml/objects/object_gi_glasses.xml +- name: objects/object_gi_gloves + xml_path: assets/xml/objects/object_gi_gloves.xml +- name: objects/object_gi_goddess + xml_path: assets/xml/objects/object_gi_goddess.xml +- name: objects/object_gi_golonmask + xml_path: assets/xml/objects/object_gi_golonmask.xml +- name: objects/object_gi_grass + xml_path: assets/xml/objects/object_gi_grass.xml +- name: objects/object_gi_hammer + xml_path: assets/xml/objects/object_gi_hammer.xml +- name: objects/object_gi_heart + xml_path: assets/xml/objects/object_gi_heart.xml +- name: objects/object_gi_hearts + xml_path: assets/xml/objects/object_gi_hearts.xml +- name: objects/object_gi_hookshot + xml_path: assets/xml/objects/object_gi_hookshot.xml +- name: objects/object_gi_hoverboots + xml_path: assets/xml/objects/object_gi_hoverboots.xml +- name: objects/object_gi_insect + xml_path: assets/xml/objects/object_gi_insect.xml +- name: objects/object_gi_jewel + xml_path: assets/xml/objects/object_gi_jewel.xml +- name: objects/object_gi_key + xml_path: assets/xml/objects/object_gi_key.xml +- name: objects/object_gi_ki_tan_mask + xml_path: assets/xml/objects/object_gi_ki_tan_mask.xml +- name: objects/object_gi_letter + xml_path: assets/xml/objects/object_gi_letter.xml +- name: objects/object_gi_liquid + xml_path: assets/xml/objects/object_gi_liquid.xml +- name: objects/object_gi_longsword + xml_path: assets/xml/objects/object_gi_longsword.xml +- name: objects/object_gi_m_arrow + xml_path: assets/xml/objects/object_gi_m_arrow.xml +- name: objects/object_gi_magicpot + xml_path: assets/xml/objects/object_gi_magicpot.xml +- name: objects/object_gi_map + xml_path: assets/xml/objects/object_gi_map.xml +- name: objects/object_gi_medal + xml_path: assets/xml/objects/object_gi_medal.xml +- name: objects/object_gi_melody + xml_path: assets/xml/objects/object_gi_melody.xml +- name: objects/object_gi_milk + xml_path: assets/xml/objects/object_gi_milk.xml +- name: objects/object_gi_mushroom + xml_path: assets/xml/objects/object_gi_mushroom.xml +- name: objects/object_gi_niwatori + xml_path: assets/xml/objects/object_gi_niwatori.xml +- name: objects/object_gi_nuts + xml_path: assets/xml/objects/object_gi_nuts.xml +- name: objects/object_gi_ocarina + xml_path: assets/xml/objects/object_gi_ocarina.xml +- name: objects/object_gi_ocarina_0 + xml_path: assets/xml/objects/object_gi_ocarina_0.xml +- name: objects/object_gi_pachinko + xml_path: assets/xml/objects/object_gi_pachinko.xml +- name: objects/object_gi_powder + xml_path: assets/xml/objects/object_gi_powder.xml +- name: objects/object_gi_prescription + xml_path: assets/xml/objects/object_gi_prescription.xml +- name: objects/object_gi_purse + xml_path: assets/xml/objects/object_gi_purse.xml +- name: objects/object_gi_rabit_mask + xml_path: assets/xml/objects/object_gi_rabit_mask.xml +- name: objects/object_gi_redead_mask + xml_path: assets/xml/objects/object_gi_redead_mask.xml +- name: objects/object_gi_rupy + xml_path: assets/xml/objects/object_gi_rupy.xml +- name: objects/object_gi_saw + xml_path: assets/xml/objects/object_gi_saw.xml +- name: objects/object_gi_scale + xml_path: assets/xml/objects/object_gi_scale.xml +- name: objects/object_gi_seed + xml_path: assets/xml/objects/object_gi_seed.xml +- name: objects/object_gi_shield_1 + xml_path: assets/xml/objects/object_gi_shield_1.xml +- name: objects/object_gi_shield_2 + xml_path: assets/xml/objects/object_gi_shield_2.xml +- name: objects/object_gi_shield_3 + xml_path: assets/xml/objects/object_gi_shield_3.xml +- name: objects/object_gi_skj_mask + xml_path: assets/xml/objects/object_gi_skj_mask.xml +- name: objects/object_gi_soldout + xml_path: assets/xml/objects/object_gi_soldout.xml +- name: objects/object_gi_soul + xml_path: assets/xml/objects/object_gi_soul.xml +- name: objects/object_gi_stick + xml_path: assets/xml/objects/object_gi_stick.xml +- name: objects/object_gi_sutaru + xml_path: assets/xml/objects/object_gi_sutaru.xml +- name: objects/object_gi_sword_1 + xml_path: assets/xml/objects/object_gi_sword_1.xml +- name: objects/object_gi_ticketstone + xml_path: assets/xml/objects/object_gi_ticketstone.xml +- name: objects/object_gi_truth_mask + xml_path: assets/xml/objects/object_gi_truth_mask.xml +- name: objects/object_gi_zoramask + xml_path: assets/xml/objects/object_gi_zoramask.xml +- name: objects/object_gj + xml_path: assets/xml/objects/object_gj.xml +- name: objects/object_gjyo_objects + xml_path: assets/xml/objects/object_gjyo_objects.xml +- name: objects/object_gla + xml_path: assets/xml/objects/object_gla.xml +- name: objects/object_gm + xml_path: assets/xml/objects/object_gm.xml +- name: objects/object_gnd + xml_path: assets/xml/objects/object_gnd.xml +- name: objects/object_gnd_magic + xml_path: assets/xml/objects/object_gnd_magic.xml +- name: objects/object_gndd + xml_path: assets/xml/objects/object_gndd.xml +- name: objects/object_god_lgt + xml_path: assets/xml/objects/object_god_lgt.xml +- name: objects/object_gol + xml_path: assets/xml/objects/object_gol.xml +- name: objects/object_goma + xml_path: assets/xml/objects/object_goma.xml +- name: objects/object_goroiwa + xml_path: assets/xml/objects/object_goroiwa.xml +- name: objects/object_gr + xml_path: assets/xml/objects/object_gr.xml +- name: objects/object_gs + xml_path: assets/xml/objects/object_gs.xml +- name: objects/object_gt + xml_path: assets/xml/objects/object_gt.xml +- name: objects/object_haka + xml_path: assets/xml/objects/object_haka.xml +- name: objects/object_haka_door + xml_path: assets/xml/objects/object_haka_door.xml +- name: objects/object_haka_objects + xml_path: assets/xml/objects/object_haka_objects.xml +- name: objects/object_hakach_objects + xml_path: assets/xml/objects/object_hakach_objects.xml +- name: objects/object_hata + xml_path: assets/xml/objects/object_hata.xml +- name: objects/object_heavy_object + xml_path: assets/xml/objects/object_heavy_object.xml +- name: objects/object_hidan_objects + xml_path: assets/xml/objects/object_hidan_objects.xml +- name: objects/object_hintnuts + xml_path: assets/xml/objects/object_hintnuts.xml +- name: objects/object_hni + xml_path: assets/xml/objects/object_hni.xml +- name: objects/object_horse + xml_path: assets/xml/objects/object_horse.xml +- name: objects/object_horse_ganon + xml_path: assets/xml/objects/object_horse_ganon.xml +- name: objects/object_horse_link_child + xml_path: assets/xml/objects/object_horse_link_child.xml +- name: objects/object_horse_normal + xml_path: assets/xml/objects/object_horse_normal.xml +- name: objects/object_horse_zelda + xml_path: assets/xml/objects/object_horse_zelda.xml +- name: objects/object_hs + xml_path: assets/xml/objects/object_hs.xml +- name: objects/object_human + xml_path: assets/xml/objects/object_human.xml +- name: objects/object_ice_objects + xml_path: assets/xml/objects/object_ice_objects.xml +- name: objects/object_ik + xml_path: assets/xml/objects/object_ik.xml +- name: objects/object_im + xml_path: assets/xml/objects/object_im.xml +- name: objects/object_in + xml_path: assets/xml/objects/object_in.xml +- name: objects/object_ingate + xml_path: assets/xml/objects/object_ingate.xml +- name: objects/object_jj + xml_path: assets/xml/objects/object_jj.xml +- name: objects/object_js + xml_path: assets/xml/objects/object_js.xml +- name: objects/object_jya_door + xml_path: assets/xml/objects/object_jya_door.xml +- name: objects/object_jya_iron + xml_path: assets/xml/objects/object_jya_iron.xml +- name: objects/object_jya_obj + xml_path: assets/xml/objects/object_jya_obj.xml +- name: objects/object_ka + xml_path: assets/xml/objects/object_ka.xml +- name: objects/object_kanban + xml_path: assets/xml/objects/object_kanban.xml +- name: objects/object_kibako2 + xml_path: assets/xml/objects/object_kibako2.xml +- name: objects/object_kingdodongo + xml_path: assets/xml/objects/object_kingdodongo.xml +- name: objects/object_km1 + xml_path: assets/xml/objects/object_km1.xml +- name: objects/object_kusa + xml_path: assets/xml/objects/object_kusa.xml +- name: objects/object_kw1 + xml_path: assets/xml/objects/object_kw1.xml +- name: objects/object_kz + xml_path: assets/xml/objects/object_kz.xml +- name: objects/object_light_ring + xml_path: assets/xml/objects/object_light_ring.xml +- name: objects/object_lightbox + xml_path: assets/xml/objects/object_lightbox.xml +- name: objects/object_lightswitch + xml_path: assets/xml/objects/object_lightswitch.xml +- name: objects/object_link_boy + xml_path: assets/xml/objects/object_link_boy.xml +- name: objects/object_link_child + xml_path: assets/xml/objects/object_link_child.xml +- name: objects/object_ma1 + xml_path: assets/xml/objects/object_ma1.xml +- name: objects/object_ma2 + xml_path: assets/xml/objects/object_ma2.xml +- name: objects/object_mag + xml_path: assets/xml/objects/object_mag.xml +- name: objects/object_mamenoki + xml_path: assets/xml/objects/object_mamenoki.xml +- name: objects/object_mastergolon + xml_path: assets/xml/objects/object_mastergolon.xml +- name: objects/object_masterkokiri + xml_path: assets/xml/objects/object_masterkokiri.xml +- name: objects/object_masterkokirihead + xml_path: assets/xml/objects/object_masterkokirihead.xml +- name: objects/object_masterzoora + xml_path: assets/xml/objects/object_masterzoora.xml +- name: objects/object_mb + xml_path: assets/xml/objects/object_mb.xml +- name: objects/object_md + xml_path: assets/xml/objects/object_md.xml +- name: objects/object_medal + xml_path: assets/xml/objects/object_medal.xml +- name: objects/object_menkuri_objects + xml_path: assets/xml/objects/object_menkuri_objects.xml +- name: objects/object_mir_ray + xml_path: assets/xml/objects/object_mir_ray.xml +- name: objects/object_mizu_objects + xml_path: assets/xml/objects/object_mizu_objects.xml +- name: objects/object_mjin + xml_path: assets/xml/objects/object_mjin.xml +- name: objects/object_mjin_dark + xml_path: assets/xml/objects/object_mjin_dark.xml +- name: objects/object_mjin_flame + xml_path: assets/xml/objects/object_mjin_flame.xml +- name: objects/object_mjin_flash + xml_path: assets/xml/objects/object_mjin_flash.xml +- name: objects/object_mjin_ice + xml_path: assets/xml/objects/object_mjin_ice.xml +- name: objects/object_mjin_oka + xml_path: assets/xml/objects/object_mjin_oka.xml +- name: objects/object_mjin_soul + xml_path: assets/xml/objects/object_mjin_soul.xml +- name: objects/object_mjin_wind + xml_path: assets/xml/objects/object_mjin_wind.xml +- name: objects/object_mk + xml_path: assets/xml/objects/object_mk.xml +- name: objects/object_mm + xml_path: assets/xml/objects/object_mm.xml +- name: objects/object_mo + xml_path: assets/xml/objects/object_mo.xml +- name: objects/object_mori_hineri1 + xml_path: assets/xml/objects/object_mori_hineri1.xml +- name: objects/object_mori_hineri1a + xml_path: assets/xml/objects/object_mori_hineri1a.xml +- name: objects/object_mori_hineri2 + xml_path: assets/xml/objects/object_mori_hineri2.xml +- name: objects/object_mori_hineri2a + xml_path: assets/xml/objects/object_mori_hineri2a.xml +- name: objects/object_mori_objects + xml_path: assets/xml/objects/object_mori_objects.xml +- name: objects/object_mori_tex + xml_path: assets/xml/objects/object_mori_tex.xml +- name: objects/object_ms + xml_path: assets/xml/objects/object_ms.xml +- name: objects/object_mu + xml_path: assets/xml/objects/object_mu.xml +- name: objects/object_nb + xml_path: assets/xml/objects/object_nb.xml +- name: objects/object_niw + xml_path: assets/xml/objects/object_niw.xml +- name: objects/object_nwc + xml_path: assets/xml/objects/object_nwc.xml +- name: objects/object_ny + xml_path: assets/xml/objects/object_ny.xml +- name: objects/object_o_anime + xml_path: assets/xml/objects/object_o_anime.xml +- name: objects/object_oA1 + xml_path: assets/xml/objects/object_oA1.xml +- name: objects/object_oA2 + xml_path: assets/xml/objects/object_oA2.xml +- name: objects/object_oA3 + xml_path: assets/xml/objects/object_oA3.xml +- name: objects/object_oA4 + xml_path: assets/xml/objects/object_oA4.xml +- name: objects/object_oA5 + xml_path: assets/xml/objects/object_oA5.xml +- name: objects/object_oA6 + xml_path: assets/xml/objects/object_oA6.xml +- name: objects/object_oA7 + xml_path: assets/xml/objects/object_oA7.xml +- name: objects/object_oA8 + xml_path: assets/xml/objects/object_oA8.xml +- name: objects/object_oA9 + xml_path: assets/xml/objects/object_oA9.xml +- name: objects/object_oA10 + xml_path: assets/xml/objects/object_oA10.xml +- name: objects/object_oA11 + xml_path: assets/xml/objects/object_oA11.xml +- name: objects/object_oB1 + xml_path: assets/xml/objects/object_oB1.xml +- name: objects/object_oB2 + xml_path: assets/xml/objects/object_oB2.xml +- name: objects/object_oB3 + xml_path: assets/xml/objects/object_oB3.xml +- name: objects/object_oB4 + xml_path: assets/xml/objects/object_oB4.xml +- name: objects/object_oE1 + xml_path: assets/xml/objects/object_oE1.xml +- name: objects/object_oE1s + xml_path: assets/xml/objects/object_oE1s.xml +- name: objects/object_oE2 + xml_path: assets/xml/objects/object_oE2.xml +- name: objects/object_oE3 + xml_path: assets/xml/objects/object_oE3.xml +- name: objects/object_oE4 + xml_path: assets/xml/objects/object_oE4.xml +- name: objects/object_oE4s + xml_path: assets/xml/objects/object_oE4s.xml +- name: objects/object_oE5 + xml_path: assets/xml/objects/object_oE5.xml +- name: objects/object_oE6 + xml_path: assets/xml/objects/object_oE6.xml +- name: objects/object_oE7 + xml_path: assets/xml/objects/object_oE7.xml +- name: objects/object_oE8 + xml_path: assets/xml/objects/object_oE8.xml +- name: objects/object_oE9 + xml_path: assets/xml/objects/object_oE9.xml +- name: objects/object_oE10 + xml_path: assets/xml/objects/object_oE10.xml +- name: objects/object_oE11 + xml_path: assets/xml/objects/object_oE11.xml +- name: objects/object_oE12 + xml_path: assets/xml/objects/object_oE12.xml +- name: objects/object_oE_anime + xml_path: assets/xml/objects/object_oE_anime.xml +- name: objects/object_oF1d_map + xml_path: assets/xml/objects/object_oF1d_map.xml +- name: objects/object_oF1s + xml_path: assets/xml/objects/object_oF1s.xml +- name: objects/object_okuta + xml_path: assets/xml/objects/object_okuta.xml +- name: objects/object_opening_demo1 + xml_path: assets/xml/objects/object_opening_demo1.xml +- name: objects/object_os + xml_path: assets/xml/objects/object_os.xml +- name: objects/object_os_anime + xml_path: assets/xml/objects/object_os_anime.xml +- name: objects/object_ossan + xml_path: assets/xml/objects/object_ossan.xml +- name: objects/object_ouke_haka + xml_path: assets/xml/objects/object_ouke_haka.xml +- name: objects/object_owl + xml_path: assets/xml/objects/object_owl.xml +- name: objects/object_peehat + xml_path: assets/xml/objects/object_peehat.xml +- name: objects/object_po_composer + xml_path: assets/xml/objects/object_po_composer.xml +- name: objects/object_po_field + xml_path: assets/xml/objects/object_po_field.xml +- name: objects/object_po_sisters + xml_path: assets/xml/objects/object_po_sisters.xml +- name: objects/object_poh + xml_path: assets/xml/objects/object_poh.xml +- name: objects/object_ps + xml_path: assets/xml/objects/object_ps.xml +- name: objects/object_pu_box + xml_path: assets/xml/objects/object_pu_box.xml +- name: objects/object_rd + xml_path: assets/xml/objects/object_rd.xml +- name: objects/object_reeba + xml_path: assets/xml/objects/object_reeba.xml +- name: objects/object_relay_objects + xml_path: assets/xml/objects/object_relay_objects.xml +- name: objects/object_rl + xml_path: assets/xml/objects/object_rl.xml +- name: objects/object_rr + xml_path: assets/xml/objects/object_rr.xml +- name: objects/object_rs + xml_path: assets/xml/objects/object_rs.xml +- name: objects/object_ru1 + xml_path: assets/xml/objects/object_ru1.xml +- name: objects/object_ru2 + xml_path: assets/xml/objects/object_ru2.xml +- name: objects/object_sa + xml_path: assets/xml/objects/object_sa.xml +- name: objects/object_sb + xml_path: assets/xml/objects/object_sb.xml +- name: objects/object_sd + xml_path: assets/xml/objects/object_sd.xml +- name: objects/object_shop_dungen + xml_path: assets/xml/objects/object_shop_dungen.xml +- name: objects/object_shopnuts + xml_path: assets/xml/objects/object_shopnuts.xml +- name: objects/object_siofuki + xml_path: assets/xml/objects/object_siofuki.xml +- name: objects/object_sk2 + xml_path: assets/xml/objects/object_sk2.xml +- name: objects/object_skb + xml_path: assets/xml/objects/object_skb.xml +- name: objects/object_skj + xml_path: assets/xml/objects/object_skj.xml +- name: objects/object_spot00_break + xml_path: assets/xml/objects/object_spot00_break.xml +- name: objects/object_spot00_objects + xml_path: assets/xml/objects/object_spot00_objects.xml +- name: objects/object_spot01_matoya + xml_path: assets/xml/objects/object_spot01_matoya.xml +- name: objects/object_spot01_matoyab + xml_path: assets/xml/objects/object_spot01_matoyab.xml +- name: objects/object_spot01_objects + xml_path: assets/xml/objects/object_spot01_objects.xml +- name: objects/object_spot01_objects2 + xml_path: assets/xml/objects/object_spot01_objects2.xml +- name: objects/object_spot02_objects + xml_path: assets/xml/objects/object_spot02_objects.xml +- name: objects/object_spot03_object + xml_path: assets/xml/objects/object_spot03_object.xml +- name: objects/object_spot04_objects + xml_path: assets/xml/objects/object_spot04_objects.xml +- name: objects/object_spot05_objects + xml_path: assets/xml/objects/object_spot05_objects.xml +- name: objects/object_spot06_objects + xml_path: assets/xml/objects/object_spot06_objects.xml +- name: objects/object_spot07_object + xml_path: assets/xml/objects/object_spot07_object.xml +- name: objects/object_spot08_obj + xml_path: assets/xml/objects/object_spot08_obj.xml +- name: objects/object_spot09_obj + xml_path: assets/xml/objects/object_spot09_obj.xml +- name: objects/object_spot11_obj + xml_path: assets/xml/objects/object_spot11_obj.xml +- name: objects/object_spot12_obj + xml_path: assets/xml/objects/object_spot12_obj.xml +- name: objects/object_spot15_obj + xml_path: assets/xml/objects/object_spot15_obj.xml +- name: objects/object_spot16_obj + xml_path: assets/xml/objects/object_spot16_obj.xml +- name: objects/object_spot17_obj + xml_path: assets/xml/objects/object_spot17_obj.xml +- name: objects/object_spot18_obj + xml_path: assets/xml/objects/object_spot18_obj.xml +- name: objects/object_ssh + xml_path: assets/xml/objects/object_ssh.xml +- name: objects/object_sst + xml_path: assets/xml/objects/object_sst.xml +- name: objects/object_st + xml_path: assets/xml/objects/object_st.xml +- name: objects/object_stream + xml_path: assets/xml/objects/object_stream.xml +- name: objects/object_syokudai + xml_path: assets/xml/objects/object_syokudai.xml +- name: objects/object_ta + xml_path: assets/xml/objects/object_ta.xml +- name: objects/object_timeblock + xml_path: assets/xml/objects/object_timeblock.xml +- name: objects/object_tite + xml_path: assets/xml/objects/object_tite.xml +- name: objects/object_tk + xml_path: assets/xml/objects/object_tk.xml +- name: objects/object_toki_objects + xml_path: assets/xml/objects/object_toki_objects.xml +- name: objects/object_torch2 + xml_path: assets/xml/objects/object_torch2.xml +- name: objects/object_toryo + xml_path: assets/xml/objects/object_toryo.xml +- name: objects/object_tp + xml_path: assets/xml/objects/object_tp.xml +- name: objects/object_tr + xml_path: assets/xml/objects/object_tr.xml +- name: objects/object_trap + xml_path: assets/xml/objects/object_trap.xml +- name: objects/object_triforce_spot + xml_path: assets/xml/objects/object_triforce_spot.xml +- name: objects/object_ts + xml_path: assets/xml/objects/object_ts.xml +- name: objects/object_tsubo + xml_path: assets/xml/objects/object_tsubo.xml +- name: objects/object_tw + xml_path: assets/xml/objects/object_tw.xml +- name: objects/object_umajump + xml_path: assets/xml/objects/object_umajump.xml +- name: objects/object_vali + xml_path: assets/xml/objects/object_vali.xml +- name: objects/object_vase + xml_path: assets/xml/objects/object_vase.xml +- name: objects/object_vm + xml_path: assets/xml/objects/object_vm.xml +- name: objects/object_wallmaster + xml_path: assets/xml/objects/object_wallmaster.xml +- name: objects/object_warp1 + xml_path: assets/xml/objects/object_warp1.xml +- name: objects/object_warp2 + xml_path: assets/xml/objects/object_warp2.xml +- name: objects/object_wf + xml_path: assets/xml/objects/object_wf.xml +- name: objects/object_wood02 + xml_path: assets/xml/objects/object_wood02.xml +- name: objects/object_xc + xml_path: assets/xml/objects/object_xc.xml +- name: objects/object_yabusame_point + xml_path: assets/xml/objects/object_yabusame_point.xml +- name: objects/object_ydan_objects + xml_path: assets/xml/objects/object_ydan_objects.xml +- name: objects/object_yukabyun + xml_path: assets/xml/objects/object_yukabyun.xml +- name: objects/object_zf + xml_path: assets/xml/objects/object_zf.xml +- name: objects/object_zg + xml_path: assets/xml/objects/object_zg.xml +- name: objects/object_zl1 + xml_path: assets/xml/objects/object_zl1.xml +- name: objects/object_zl2 + xml_path: assets/xml/objects/object_zl2.xml +- name: objects/object_zl2_anime1 + xml_path: assets/xml/objects/object_zl2_anime1.xml +- name: objects/object_zl2_anime2 + xml_path: assets/xml/objects/object_zl2_anime2.xml +- name: objects/object_zl4 + xml_path: assets/xml/objects/object_zl4.xml +- name: objects/object_zo + xml_path: assets/xml/objects/object_zo.xml +- name: overlays/ovl_Arrow_Fire + xml_path: assets/xml/overlays/ovl_Arrow_Fire.xml + start_offset: 0x960 + end_offset: 0x1D80 +- name: overlays/ovl_Arrow_Ice + xml_path: assets/xml/overlays/ovl_Arrow_Ice.xml + start_offset: 0x980 + end_offset: 0x1DA0 +- name: overlays/ovl_Arrow_Light + xml_path: assets/xml/overlays/ovl_Arrow_Light.xml + start_offset: 0x990 + end_offset: 0x1DB0 +- name: overlays/ovl_Bg_Ganon_Otyuka + xml_path: assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml + start_offset: 0x1110 + end_offset: 0x24EC +- name: overlays/ovl_Bg_Jya_Cobra + xml_path: assets/xml/overlays/ovl_Bg_Jya_Cobra.xml + start_offset: 0x1830 + end_offset: 0x18A8 +- name: overlays/ovl_Boss_Dodongo + xml_path: assets/xml/overlays/ovl_Boss_Dodongo.xml + start_offset: 0x61C8 + end_offset: 0x91C8 +- name: overlays/ovl_Boss_Ganon + xml_path: assets/xml/overlays/ovl_Boss_Ganon.xml + start_offset: 0xE398 + end_offset: 0x20EB8 +- name: overlays/ovl_Boss_Ganon2 + xml_path: assets/xml/overlays/ovl_Boss_Ganon2.xml + start_offset: 0x9F48 + end_offset: 0x103F8 +- name: overlays/ovl_Boss_Sst + xml_path: assets/xml/overlays/ovl_Boss_Sst.xml + start_offset: 0xA330 + end_offset: 0xACE0 +- name: overlays/ovl_Demo_Shd + xml_path: assets/xml/overlays/ovl_Demo_Shd.xml + start_offset: 0x410 + end_offset: 0x2390 +- name: overlays/ovl_Effect_Ss_Fhg_Flash + xml_path: assets/xml/overlays/ovl_Effect_Ss_Fhg_Flash.xml + start_offset: 0x9F0 + end_offset: 0xEA8 +- name: overlays/ovl_En_Bili + xml_path: assets/xml/overlays/ovl_En_Bili.xml + start_offset: 0x1E40 + end_offset: 0x1E60 +- name: overlays/ovl_En_Clear_Tag + xml_path: assets/xml/overlays/ovl_En_Clear_Tag.xml + start_offset: 0x2600 + end_offset: 0x8900 +- name: overlays/ovl_En_Ganon_Mant + xml_path: assets/xml/overlays/ovl_En_Ganon_Mant.xml + start_offset: 0x11E8 + end_offset: 0x40E8 +- name: overlays/ovl_En_Ganon_Organ + xml_path: assets/xml/overlays/ovl_En_Ganon_Organ.xml + start_offset: 0x328 + end_offset: 0x6EB0 +- name: overlays/ovl_En_Holl + xml_path: assets/xml/overlays/ovl_En_Holl.xml + start_offset: 0xE68 + end_offset: 0xED0 +- name: overlays/ovl_En_Jsjutan + xml_path: assets/xml/overlays/ovl_En_Jsjutan.xml + start_offset: 0x12B8 + end_offset: 0x4C50 +- name: overlays/ovl_En_Kanban + xml_path: assets/xml/overlays/ovl_En_Kanban.xml + start_offset: 0x2E70 + end_offset: 0x2F30 +- name: overlays/ovl_En_Sda + xml_path: assets/xml/overlays/ovl_En_Sda.xml + start_offset: 0x14A8 + end_offset: 0x1538 +- name: overlays/ovl_En_Ssh + xml_path: assets/xml/overlays/ovl_En_Ssh.xml + start_offset: 0x2150 + end_offset: 0x21E0 +- name: overlays/ovl_En_St + xml_path: assets/xml/overlays/ovl_En_St.xml + start_offset: 0x26A0 + end_offset: 0x2730 +- name: overlays/ovl_En_Sth + xml_path: assets/xml/overlays/ovl_En_Sth.xml + start_offset: 0xE60 + end_offset: 0x3E34 +- name: overlays/ovl_End_Title + xml_path: assets/xml/overlays/ovl_End_Title.xml + start_offset: 0x6F0 + end_offset: 0x4098 +- name: overlays/ovl_file_choose + xml_path: assets/xml/overlays/ovl_file_choose.xml + start_offset: 0xEC50 + end_offset: 0xF330 +- name: overlays/ovl_Magic_Dark + xml_path: assets/xml/overlays/ovl_Magic_Dark.xml + start_offset: 0xC90 + end_offset: 0x16C0 +- name: overlays/ovl_Magic_Fire + xml_path: assets/xml/overlays/ovl_Magic_Fire.xml + start_offset: 0xB20 + end_offset: 0x2170 +- name: overlays/ovl_Magic_Wind + xml_path: assets/xml/overlays/ovl_Magic_Wind.xml + start_offset: 0x6A0 + end_offset: 0x1BB8 +- name: overlays/ovl_Oceff_Spot + xml_path: assets/xml/overlays/ovl_Oceff_Spot.xml + start_offset: 0x780 + end_offset: 0xE58 +- name: overlays/ovl_Oceff_Storm + xml_path: assets/xml/overlays/ovl_Oceff_Storm.xml + start_offset: 0x740 + end_offset: 0x1AD0 +- name: overlays/ovl_Oceff_Wipe + xml_path: assets/xml/overlays/ovl_Oceff_Wipe.xml + start_offset: 0x4F0 + end_offset: 0xCB0 +- name: overlays/ovl_Oceff_Wipe2 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe2.xml + start_offset: 0x430 + end_offset: 0x1698 +- name: overlays/ovl_Oceff_Wipe3 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe3.xml + start_offset: 0x430 + end_offset: 0x1678 +- name: overlays/ovl_Oceff_Wipe4 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe4.xml + start_offset: 0x410 + end_offset: 0xEF8 +- name: scenes/dungeons/bdan + xml_path: assets/xml/scenes/dungeons/bdan.xml +- name: scenes/dungeons/bdan_boss + xml_path: assets/xml/scenes/dungeons/bdan_boss.xml +- name: scenes/dungeons/Bmori1 + xml_path: assets/xml/scenes/dungeons/Bmori1.xml +- name: scenes/dungeons/ddan + xml_path: assets/xml/scenes/dungeons/ddan.xml +- name: scenes/dungeons/ddan_boss + xml_path: assets/xml/scenes/dungeons/ddan_boss.xml +- name: scenes/dungeons/FIRE_bs + xml_path: assets/xml/scenes/dungeons/FIRE_bs.xml +- name: scenes/dungeons/ganon + xml_path: assets/xml/scenes/dungeons/ganon.xml +- name: scenes/dungeons/ganon_boss + xml_path: assets/xml/scenes/dungeons/ganon_boss.xml +- name: scenes/dungeons/ganon_demo + xml_path: assets/xml/scenes/dungeons/ganon_demo.xml +- name: scenes/dungeons/ganon_final + xml_path: assets/xml/scenes/dungeons/ganon_final.xml +- name: scenes/dungeons/ganon_sonogo + xml_path: assets/xml/scenes/dungeons/ganon_sonogo.xml +- name: scenes/dungeons/ganontika + xml_path: assets/xml/scenes/dungeons/ganontika.xml +- name: scenes/dungeons/ganontikasonogo + xml_path: assets/xml/scenes/dungeons/ganontikasonogo.xml +- name: scenes/dungeons/gerudoway + xml_path: assets/xml/scenes/dungeons/gerudoway.xml +- name: scenes/dungeons/HAKAdan + xml_path: assets/xml/scenes/dungeons/HAKAdan.xml +- name: scenes/dungeons/HAKAdan_bs + xml_path: assets/xml/scenes/dungeons/HAKAdan_bs.xml +- name: scenes/dungeons/HAKAdanCH + xml_path: assets/xml/scenes/dungeons/HAKAdanCH.xml +- name: scenes/dungeons/HIDAN + xml_path: assets/xml/scenes/dungeons/HIDAN.xml +- name: scenes/dungeons/ice_doukutu + xml_path: assets/xml/scenes/dungeons/ice_doukutu.xml +- name: scenes/dungeons/jyasinboss + xml_path: assets/xml/scenes/dungeons/jyasinboss.xml +- name: scenes/dungeons/jyasinzou + xml_path: assets/xml/scenes/dungeons/jyasinzou.xml +- name: scenes/dungeons/men + xml_path: assets/xml/scenes/dungeons/men.xml +- name: scenes/dungeons/MIZUsin + xml_path: assets/xml/scenes/dungeons/MIZUsin.xml +- name: scenes/dungeons/MIZUsin_bs + xml_path: assets/xml/scenes/dungeons/MIZUsin_bs.xml +- name: scenes/dungeons/moribossroom + xml_path: assets/xml/scenes/dungeons/moribossroom.xml +- name: scenes/dungeons/ydan + xml_path: assets/xml/scenes/dungeons/ydan.xml +- name: scenes/dungeons/ydan_boss + xml_path: assets/xml/scenes/dungeons/ydan_boss.xml +- name: scenes/indoors/bowling + xml_path: assets/xml/scenes/indoors/bowling.xml +- name: scenes/indoors/daiyousei_izumi + xml_path: assets/xml/scenes/indoors/daiyousei_izumi.xml +- name: scenes/indoors/hairal_niwa + xml_path: assets/xml/scenes/indoors/hairal_niwa.xml +- name: scenes/indoors/hairal_niwa_n + xml_path: assets/xml/scenes/indoors/hairal_niwa_n.xml +- name: scenes/indoors/hakasitarelay + xml_path: assets/xml/scenes/indoors/hakasitarelay.xml +- name: scenes/indoors/hut + xml_path: assets/xml/scenes/indoors/hut.xml +- name: scenes/indoors/hylia_labo + xml_path: assets/xml/scenes/indoors/hylia_labo.xml +- name: scenes/indoors/impa + xml_path: assets/xml/scenes/indoors/impa.xml +- name: scenes/indoors/kakariko + xml_path: assets/xml/scenes/indoors/kakariko.xml +- name: scenes/indoors/kenjyanoma + xml_path: assets/xml/scenes/indoors/kenjyanoma.xml +- name: scenes/indoors/kokiri_home + xml_path: assets/xml/scenes/indoors/kokiri_home.xml +- name: scenes/indoors/kokiri_home3 + xml_path: assets/xml/scenes/indoors/kokiri_home3.xml +- name: scenes/indoors/kokiri_home4 + xml_path: assets/xml/scenes/indoors/kokiri_home4.xml +- name: scenes/indoors/kokiri_home5 + xml_path: assets/xml/scenes/indoors/kokiri_home5.xml +- name: scenes/indoors/labo + xml_path: assets/xml/scenes/indoors/labo.xml +- name: scenes/indoors/link_home + xml_path: assets/xml/scenes/indoors/link_home.xml +- name: scenes/indoors/mahouya + xml_path: assets/xml/scenes/indoors/mahouya.xml +- name: scenes/indoors/malon_stable + xml_path: assets/xml/scenes/indoors/malon_stable.xml +- name: scenes/indoors/miharigoya + xml_path: assets/xml/scenes/indoors/miharigoya.xml +- name: scenes/indoors/nakaniwa + xml_path: assets/xml/scenes/indoors/nakaniwa.xml +- name: scenes/indoors/souko + xml_path: assets/xml/scenes/indoors/souko.xml +- name: scenes/indoors/syatekijyou + xml_path: assets/xml/scenes/indoors/syatekijyou.xml +- name: scenes/indoors/takaraya + xml_path: assets/xml/scenes/indoors/takaraya.xml +- name: scenes/indoors/tent + xml_path: assets/xml/scenes/indoors/tent.xml +- name: scenes/indoors/tokinoma + xml_path: assets/xml/scenes/indoors/tokinoma.xml +- name: scenes/indoors/yousei_izumi_tate + xml_path: assets/xml/scenes/indoors/yousei_izumi_tate.xml +- name: scenes/indoors/yousei_izumi_yoko + xml_path: assets/xml/scenes/indoors/yousei_izumi_yoko.xml +- name: scenes/misc/enrui + xml_path: assets/xml/scenes/misc/enrui.xml +- name: scenes/misc/entra + xml_path: assets/xml/scenes/misc/entra.xml +- name: scenes/misc/entra_n + xml_path: assets/xml/scenes/misc/entra_n.xml +- name: scenes/misc/hakaana + xml_path: assets/xml/scenes/misc/hakaana.xml +- name: scenes/misc/hakaana2 + xml_path: assets/xml/scenes/misc/hakaana2.xml +- name: scenes/misc/hakaana_ouke + xml_path: assets/xml/scenes/misc/hakaana_ouke.xml +- name: scenes/misc/hiral_demo + xml_path: assets/xml/scenes/misc/hiral_demo.xml +- name: scenes/misc/kakariko3 + xml_path: assets/xml/scenes/misc/kakariko3.xml +- name: scenes/misc/kakusiana + xml_path: assets/xml/scenes/misc/kakusiana.xml +- name: scenes/misc/kinsuta + xml_path: assets/xml/scenes/misc/kinsuta.xml +- name: scenes/misc/market_alley + xml_path: assets/xml/scenes/misc/market_alley.xml +- name: scenes/misc/market_alley_n + xml_path: assets/xml/scenes/misc/market_alley_n.xml +- name: scenes/misc/market_day + xml_path: assets/xml/scenes/misc/market_day.xml +- name: scenes/misc/market_night + xml_path: assets/xml/scenes/misc/market_night.xml +- name: scenes/misc/market_ruins + xml_path: assets/xml/scenes/misc/market_ruins.xml +- name: scenes/misc/shrine + xml_path: assets/xml/scenes/misc/shrine.xml +- name: scenes/misc/shrine_n + xml_path: assets/xml/scenes/misc/shrine_n.xml +- name: scenes/misc/shrine_r + xml_path: assets/xml/scenes/misc/shrine_r.xml +- name: scenes/misc/turibori + xml_path: assets/xml/scenes/misc/turibori.xml +- name: scenes/overworld/ganon_tou + xml_path: assets/xml/scenes/overworld/ganon_tou.xml +- name: scenes/overworld/spot00 + xml_path: assets/xml/scenes/overworld/spot00.xml +- name: scenes/overworld/spot01 + xml_path: assets/xml/scenes/overworld/spot01.xml +- name: scenes/overworld/spot02 + xml_path: assets/xml/scenes/overworld/spot02.xml +- name: scenes/overworld/spot03 + xml_path: assets/xml/scenes/overworld/spot03.xml +- name: scenes/overworld/spot04 + xml_path: assets/xml/scenes/overworld/spot04.xml +- name: scenes/overworld/spot05 + xml_path: assets/xml/scenes/overworld/spot05.xml +- name: scenes/overworld/spot06 + xml_path: assets/xml/scenes/overworld/spot06.xml +- name: scenes/overworld/spot07 + xml_path: assets/xml/scenes/overworld/spot07.xml +- name: scenes/overworld/spot08 + xml_path: assets/xml/scenes/overworld/spot08.xml +- name: scenes/overworld/spot09 + xml_path: assets/xml/scenes/overworld/spot09.xml +- name: scenes/overworld/spot10 + xml_path: assets/xml/scenes/overworld/spot10.xml +- name: scenes/overworld/spot11 + xml_path: assets/xml/scenes/overworld/spot11.xml +- name: scenes/overworld/spot12 + xml_path: assets/xml/scenes/overworld/spot12.xml +- name: scenes/overworld/spot13 + xml_path: assets/xml/scenes/overworld/spot13.xml +- name: scenes/overworld/spot15 + xml_path: assets/xml/scenes/overworld/spot15.xml +- name: scenes/overworld/spot16 + xml_path: assets/xml/scenes/overworld/spot16.xml +- name: scenes/overworld/spot17 + xml_path: assets/xml/scenes/overworld/spot17.xml +- name: scenes/overworld/spot18 + xml_path: assets/xml/scenes/overworld/spot18.xml +- name: scenes/overworld/spot20 + xml_path: assets/xml/scenes/overworld/spot20.xml +- name: scenes/shops/alley_shop + xml_path: assets/xml/scenes/shops/alley_shop.xml +- name: scenes/shops/drag + xml_path: assets/xml/scenes/shops/drag.xml +- name: scenes/shops/face_shop + xml_path: assets/xml/scenes/shops/face_shop.xml +- name: scenes/shops/golon + xml_path: assets/xml/scenes/shops/golon.xml +- name: scenes/shops/kokiri_shop + xml_path: assets/xml/scenes/shops/kokiri_shop.xml +- name: scenes/shops/night_shop + xml_path: assets/xml/scenes/shops/night_shop.xml +- name: scenes/shops/shop1 + xml_path: assets/xml/scenes/shops/shop1.xml +- name: scenes/shops/zoora + xml_path: assets/xml/scenes/shops/zoora.xml +- name: textures/backgrounds + xml_path: assets/xml/textures/backgrounds.xml +- name: textures/do_action_static + xml_path: assets/xml/textures/do_action_static.xml +- name: textures/icon_item_24_static + xml_path: assets/xml/textures/icon_item_24_static.xml +- name: textures/icon_item_dungeon_static + xml_path: assets/xml/textures/icon_item_dungeon_static.xml +- name: textures/icon_item_field_static + xml_path: assets/xml/textures/icon_item_field_static.xml +- name: textures/icon_item_gameover_static + xml_path: assets/xml/textures/icon_item_gameover_static.xml +- name: textures/icon_item_jpn_static + xml_path: assets/xml/textures/icon_item_jpn_static.xml +- name: textures/icon_item_nes_static + xml_path: assets/xml/textures/icon_item_nes_static.xml +- name: textures/icon_item_static + xml_path: assets/xml/textures/icon_item_static.xml +- name: textures/item_name_static + xml_path: assets/xml/textures/item_name_static.xml +- name: textures/kanji + xml_path: assets/xml/textures/kanji.xml +- name: textures/map_48x85_static + xml_path: assets/xml/textures/map_48x85_static.xml +- name: textures/map_grand_static + xml_path: assets/xml/textures/map_grand_static.xml +- name: textures/map_i_static + xml_path: assets/xml/textures/map_i_static.xml +- name: textures/map_name_static + xml_path: assets/xml/textures/map_name_static.xml +- name: textures/message_static + xml_path: assets/xml/textures/message_static.xml +- name: textures/message_texture_static + xml_path: assets/xml/textures/message_texture_static.xml +- name: textures/nes_font_static + xml_path: assets/xml/textures/nes_font_static.xml +- name: textures/nintendo_rogo_static + xml_path: assets/xml/textures/nintendo_rogo_static_v2.xml +- name: textures/parameter_static + xml_path: assets/xml/textures/parameter_static.xml +- name: textures/place_title_cards + xml_path: assets/xml/textures/place_title_cards.xml +- name: textures/skyboxes + xml_path: assets/xml/textures/skyboxes.xml +- name: textures/title_static + xml_path: assets/xml/textures/title_static.xml diff --git a/baseroms/ntsc-1.1/segments.csv b/baseroms/ntsc-1.1/segments.csv new file mode 100644 index 0000000000..78f80b081e --- /dev/null +++ b/baseroms/ntsc-1.1/segments.csv @@ -0,0 +1,1511 @@ +Name,VRAM start +makerom,80000000 +boot,80000460 +dmadata, +Audiobank, +Audioseq, +Audiotable, +kanji, +link_animetion, +icon_item_static, +icon_item_24_static, +icon_item_field_static, +icon_item_dungeon_static, +icon_item_gameover_static, +icon_item_jpn_static, +icon_item_nes_static, +item_name_static, +map_name_static, +do_action_static, +message_static, +jpn_message_data_static, +message_texture_static, +nes_font_static, +nes_message_data_static, +staff_message_data_static, +map_grand_static, +map_i_static, +map_48x85_static, +code,800110A0 +n64dd,801C7040 +ovl_title,80800000 +ovl_select,808009C0 +ovl_opening,80803720 +ovl_file_choose,80803880 +ovl_kaleido_scope,808137C0 +ovl_player_actor,808301C0 +ovl_map_mark_data,80856810 +ovl_En_Test,8085D370 +ovl_En_GirlA,80862C20 +ovl_En_Part,80865540 +ovl_En_Light,80866B50 +ovl_En_Door,80867940 +ovl_En_Box,80868780 +ovl_En_Poh,8086A2C0 +ovl_En_Okuta,8086E450 +ovl_En_Bom,80870A30 +ovl_En_Wallmas,80871900 +ovl_En_Dodongo,80873310 +ovl_En_Firefly,808760B0 +ovl_En_Horse,80878220 +ovl_En_Arrow,80884440 +ovl_En_Elf,80885B30 +ovl_En_Niw,8088A4F0 +ovl_En_Tite,8088D820 +ovl_En_Reeba,808905C0 +ovl_En_Peehat,80892030 +ovl_En_Holl,80895730 +ovl_En_Scene_Change,80896700 +ovl_En_Zf,80896830 +ovl_En_Hata,8089D330 +ovl_Boss_Dodongo,8089D8C0 +ovl_Boss_Goma,808A73A0 +ovl_En_Zl1,808AD320 +ovl_En_Viewer,808B1120 +ovl_En_Goma,808B3FF0 +ovl_Bg_Pushbox,808B6C80 +ovl_En_Bubble,808B6F80 +ovl_Door_Shutter,808B83A0 +ovl_En_Dodojr,808BA620 +ovl_En_Bdfire,808BC4C0 +ovl_En_Boom,808BD050 +ovl_En_Torch2,808BD910 +ovl_En_Bili,808C00B0 +ovl_En_Tp,808C2380 +ovl_En_St,808C41D0 +ovl_En_Bw,808C6E40 +ovl_En_Eiyer,808CA1A0 +ovl_En_River_Sound,808CBE00 +ovl_En_Horse_Normal,808CC790 +ovl_En_Ossan,808CEDB0 +ovl_Bg_Treemouth,808D5390 +ovl_Bg_Dodoago,808D69E0 +ovl_Bg_Hidan_Dalm,808D7790 +ovl_Bg_Hidan_Hrock,808D7FE0 +ovl_En_Horse_Ganon,808D8810 +ovl_Bg_Hidan_Rock,808D9590 +ovl_Bg_Hidan_Rsekizou,808DA680 +ovl_Bg_Hidan_Sekizou,808DB260 +ovl_Bg_Hidan_Sima,808DC6B0 +ovl_Bg_Hidan_Syoku,808DD5D0 +ovl_En_Xc,808DDA30 +ovl_Bg_Hidan_Curtain,808E41C0 +ovl_Bg_Spot00_Hanebasi,808E4C60 +ovl_En_Mb,808E5D70 +ovl_En_Bombf,808E9F00 +ovl_Bg_Hidan_Firewall,808EB370 +ovl_Bg_Dy_Yoseizo,808EBAD0 +ovl_En_Zl2,808EE8D0 +ovl_Bg_Hidan_Fslift,808F3000 +ovl_En_OE2,808F34D0 +ovl_Bg_Ydan_Hasi,808F35B0 +ovl_Bg_Ydan_Maruta,808F3D60 +ovl_Boss_Ganondrof,808F4440 +ovl_En_Am,808F91B0 +ovl_En_Dekubaba,808FB5B0 +ovl_En_M_Fire1,808FF050 +ovl_En_M_Thunder,808FF1F0 +ovl_Bg_Ddan_Jd,809007E0 +ovl_Bg_Breakwall,80900E30 +ovl_En_Jj,80901CA0 +ovl_En_Horse_Zelda,80903270 +ovl_Bg_Ddan_Kd,80903D60 +ovl_Door_Warp1,80904650 +ovl_Obj_Syokudai,80908900 +ovl_Item_B_Heart,80909540 +ovl_En_Dekunuts,80909930 +ovl_Bg_Menkuri_Kaiten,8090B130 +ovl_Bg_Menkuri_Eye,8090B2C0 +ovl_En_Vali,8090B760 +ovl_Bg_Mizu_Movebg,8090DE00 +ovl_Bg_Mizu_Water,8090EFA0 +ovl_Arms_Hook,8090FC70 +ovl_En_fHG,809109D0 +ovl_Bg_Mori_Hineri,80913300 +ovl_En_Bb,80913FD0 +ovl_Bg_Toki_Hikari,80917CA0 +ovl_En_Yukabyun,80918A40 +ovl_Bg_Toki_Swd,80919050 +ovl_En_Fhg_Fire,8091A6A0 +ovl_Bg_Mjin,8091CCC0 +ovl_Bg_Hidan_Kousi,8091D0A0 +ovl_Door_Toki,8091D620 +ovl_Bg_Hidan_Hamstep,8091D780 +ovl_En_Bird,8091E610 +ovl_En_Wood02,8091EAD0 +ovl_En_Lightbox,8091FCB0 +ovl_En_Pu_box,80920130 +ovl_En_Trap,80920470 +ovl_En_Arow_Trap,80921710 +ovl_En_Vase,80921860 +ovl_En_Ta,80921960 +ovl_En_Tk,80925320 +ovl_Bg_Mori_Bigst,80927150 +ovl_Bg_Mori_Elevator,80927A80 +ovl_Bg_Mori_Kaitenkabe,80928570 +ovl_Bg_Mori_Rakkatenjo,80928BD0 +ovl_En_Vm,80929540 +ovl_Demo_Effect,8092ADF0 +ovl_Demo_Kankyo,809308F0 +ovl_Bg_Hidan_Fwbig,809345F0 +ovl_En_Floormas,809352D0 +ovl_En_Heishi1,809386B0 +ovl_En_Rd,80939BC0 +ovl_En_Po_Sisters,8093C470 +ovl_Bg_Heavy_Block,80941160 +ovl_Bg_Po_Event,80942A50 +ovl_Obj_Mure,80944890 +ovl_En_Sw,809458A0 +ovl_Boss_Fd,80949090 +ovl_Object_Kankyo,809503C0 +ovl_En_Du,809535E0 +ovl_En_Fd,80955080 +ovl_En_Horse_Link_Child,80957D40 +ovl_Door_Ana,80959B40 +ovl_Bg_Spot02_Objects,8095A1B0 +ovl_Bg_Haka,8095B500 +ovl_Magic_Wind,8095BBC0 +ovl_Magic_Fire,8095D8C0 +ovl_En_Ru1,8095FB90 +ovl_Boss_Fd2,80967230 +ovl_En_Fd_Fire,8096AF60 +ovl_En_Dh,8096BC70 +ovl_En_Dha,8096D740 +ovl_En_Rl,8096E730 +ovl_En_Encount1,8096F610 +ovl_Demo_Du,80970170 +ovl_Demo_Im,80973950 +ovl_Demo_Tre_Lgt,809778C0 +ovl_En_Fw,80977FD0 +ovl_Bg_Vb_Sima,80979780 +ovl_En_Vb_Ball,80979E90 +ovl_Bg_Haka_Megane,8097B030 +ovl_Bg_Haka_MeganeBG,8097B430 +ovl_Bg_Haka_Ship,8097BAF0 +ovl_Bg_Haka_Sgami,8097C530 +ovl_En_Heishi2,8097D150 +ovl_En_Encount2,8097F350 +ovl_En_Fire_Rock,80980580 +ovl_En_Brob,80981690 +ovl_Mir_Ray,80982780 +ovl_Bg_Spot09_Obj,80984040 +ovl_Bg_Spot18_Obj,80984550 +ovl_Boss_Va,80984E20 +ovl_Bg_Haka_Tubo,8099C010 +ovl_Bg_Haka_Trap,8099CA30 +ovl_Bg_Haka_Huta,8099E000 +ovl_Bg_Haka_Zou,8099EAA0 +ovl_Bg_Spot17_Funen,8099FC90 +ovl_En_Syateki_Itm,8099FEE0 +ovl_En_Syateki_Man,809A0C80 +ovl_En_Tana,809A1A40 +ovl_En_Nb,809A1CE0 +ovl_Boss_Mo,809A62B0 +ovl_En_Sb,809B6360 +ovl_En_Bigokuta,809B77A0 +ovl_En_Karebaba,809BA2B0 +ovl_Bg_Bdan_Objects,809BBBA0 +ovl_Demo_Sa,809BCE70 +ovl_Demo_Go,809BF990 +ovl_En_In,809C06F0 +ovl_En_Tr,809C3450 +ovl_Bg_Spot16_Bombstone,809C4D50 +ovl_Bg_Hidan_Kowarerukabe,809C6290 +ovl_Bg_Bombwall,809C7160 +ovl_En_Ru2,809C7A20 +ovl_Obj_Dekujr,809CA7A0 +ovl_Bg_Mizu_Uzu,809CADE0 +ovl_Bg_Spot06_Objects,809CAFB0 +ovl_Bg_Ice_Objects,809CC3C0 +ovl_Bg_Haka_Water,809CD300 +ovl_En_Ma2,809CDAE0 +ovl_En_Bom_Chu,809CEB40 +ovl_En_Horse_Game_Check,809D01E0 +ovl_Boss_Tw,809D12B0 +ovl_En_Rr,809E6DB0 +ovl_En_Ba,809E92E0 +ovl_En_Bx,809EB1B0 +ovl_En_Anubice,809EBCA0 +ovl_En_Anubice_Fire,809ECF50 +ovl_Bg_Mori_Hashigo,809EDD10 +ovl_Bg_Mori_Hashira4,809EE5D0 +ovl_Bg_Mori_Idomizu,809EEB60 +ovl_Bg_Spot16_Doughnut,809EF1A0 +ovl_Bg_Bdan_Switch,809EF750 +ovl_En_Ma1,809F0B80 +ovl_Boss_Ganon,809F1E60 +ovl_Boss_Sst,80A17C50 +ovl_En_Ny,80A241B0 +ovl_En_Fr,80A25AE0 +ovl_Item_Shield,80A28570 +ovl_Bg_Ice_Shelter,80A28F80 +ovl_En_Ice_Hono,80A2A1B0 +ovl_Item_Ocarina,80A2B3A0 +ovl_Magic_Dark,80A2BB70 +ovl_Demo_6K,80A2D3C0 +ovl_En_Anubice_Tag,80A300D0 +ovl_Bg_Haka_Gate,80A303A0 +ovl_Bg_Spot15_Saku,80A31430 +ovl_Bg_Jya_Goroiwa,80A31770 +ovl_Bg_Jya_Zurerukabe,80A31EF0 +ovl_Bg_Jya_Cobra,80A325A0 +ovl_Bg_Jya_Kanaami,80A342C0 +ovl_Fishing,80A34670 +ovl_Obj_Oshihiki,80A4F120 +ovl_Bg_Gate_Shutter,80A50BD0 +ovl_Eff_Dust,80A51050 +ovl_Bg_Spot01_Fusya,80A52430 +ovl_Bg_Spot01_Idohashira,80A526D0 +ovl_Bg_Spot01_Idomizu,80A532D0 +ovl_Bg_Po_Syokudai,80A535E0 +ovl_Bg_Ganon_Otyuka,80A53F30 +ovl_Bg_Spot15_Rrbox,80A56570 +ovl_Bg_Umajump,80A57350 +ovl_En_Insect,80A574E0 +ovl_En_Butte,80A59A00 +ovl_En_Fish,80A5AFD0 +ovl_Bg_Spot08_Iceblock,80A5D0E0 +ovl_Item_Etcetera,80A5E120 +ovl_Arrow_Fire,80A5E9F0 +ovl_Arrow_Ice,80A608B0 +ovl_Arrow_Light,80A62790 +ovl_Obj_Kibako,80A64680 +ovl_Obj_Tsubo,80A65380 +ovl_En_Wonder_Item,80A66370 +ovl_En_Ik,80A670A0 +ovl_Demo_Ik,80A6B6E0 +ovl_En_Skj,80A6CBF0 +ovl_En_Skjneedle,80A70530 +ovl_En_G_Switch,80A70840 +ovl_Demo_Ext,80A72070 +ovl_Demo_Shd,80A729B0 +ovl_En_Dns,80A74DC0 +ovl_Elf_Msg,80A76150 +ovl_En_Honotrap,80A76740 +ovl_En_Tubo_Trap,80A77C90 +ovl_Obj_Ice_Poly,80A78930 +ovl_Bg_Spot03_Taki,80A792E0 +ovl_Bg_Spot07_Taki,80A79BD0 +ovl_En_Fz,80A7A190 +ovl_En_Po_Relay,80A7C1A0 +ovl_Bg_Relay_Objects,80A7D8B0 +ovl_En_Diving_Game,80A7E060 +ovl_En_Kusa,80A7FA10 +ovl_Obj_Bean,80A80EF0 +ovl_Obj_Bombiwa,80A83680 +ovl_Obj_Switch,80A83BF0 +ovl_Obj_Elevator,80A859B0 +ovl_Obj_Lift,80A85D70 +ovl_Obj_Hsblock,80A86790 +ovl_En_Okarina_Tag,80A86D60 +ovl_En_Yabusame_Mark,80A88260 +ovl_En_Goroiwa,80A88930 +ovl_En_Ex_Ruppy,80A8ACF0 +ovl_En_Toryo,80A8BDB0 +ovl_En_Daiku,80A8CA40 +ovl_En_Nwc,80A8E180 +ovl_En_Blkobj,80A8EBC0 +ovl_Item_Inbox,80A8F120 +ovl_En_Ge1,80A8F280 +ovl_Obj_Blockstop,80A912B0 +ovl_En_Sda,80A91450 +ovl_En_Clear_Tag,80A92B50 +ovl_En_Niw_Lady,80A9E0F0 +ovl_En_Gm,80A9F9F0 +ovl_En_Ms,80AA0720 +ovl_En_Hs,80AA0E10 +ovl_Bg_Ingate,80AA19B0 +ovl_En_Kanban,80AA1D40 +ovl_En_Heishi3,80AA4E90 +ovl_En_Syateki_Niw,80AA5860 +ovl_En_Attack_Niw,80AA78F0 +ovl_Bg_Spot01_Idosoko,80AA8B50 +ovl_En_Sa,80AA8D60 +ovl_En_Wonder_Talk,80AAAFD0 +ovl_Bg_Gjyo_Bridge,80AAB660 +ovl_En_Ds,80AABB60 +ovl_En_Mk,80AAC780 +ovl_En_Bom_Bowl_Man,80AAD610 +ovl_En_Bom_Bowl_Pit,80AAEB50 +ovl_En_Owl,80AAF4C0 +ovl_En_Ishi,80AB3060 +ovl_Obj_Hana,80ABC1B0 +ovl_Obj_Lightswitch,80ABC4C0 +ovl_Obj_Mure2,80ABD8F0 +ovl_En_Go,80ABE310 +ovl_En_Fu,80AC2950 +ovl_En_Changer,80AC36A0 +ovl_Bg_Jya_Megami,80AC4080 +ovl_Bg_Jya_Lift,80AC5260 +ovl_Bg_Jya_Bigmirror,80AC57B0 +ovl_Bg_Jya_Bombchuiwa,80AC5FF0 +ovl_Bg_Jya_Amishutter,80AC6B20 +ovl_Bg_Jya_Bombiwa,80AC6EB0 +ovl_Bg_Spot18_Basket,80AC7470 +ovl_En_Ganon_Organ,80AC8460 +ovl_En_Siofuki,80ACF460 +ovl_En_Stream,80AD0210 +ovl_En_Mm,80AD07A0 +ovl_En_Ko,80AD1DC0 +ovl_En_Kz,80AD5F00 +ovl_En_Weather_Tag,80AD7410 +ovl_Bg_Sst_Floor,80AD8300 +ovl_En_Ani,80AD8860 +ovl_En_Ex_Item,80AD95D0 +ovl_Bg_Jya_Ironobj,80ADA740 +ovl_En_Js,80ADB4F0 +ovl_En_Jsjutan,80ADBEC0 +ovl_En_Cs,80AE17E0 +ovl_En_Md,80AE2A10 +ovl_En_Hy,80AE5080 +ovl_En_Ganon_Mant,80AE89C0 +ovl_En_Okarina_Effect,80AECBE0 +ovl_En_Mag,80AECF90 +ovl_Door_Gerudo,80AF1EA0 +ovl_Elf_Msg2,80AF2490 +ovl_Demo_Gt,80AF2900 +ovl_En_Po_Field,80AF7F00 +ovl_Efc_Erupc,80AFB970 +ovl_Bg_Zg,80AFC450 +ovl_En_Heishi4,80AFC8C0 +ovl_En_Zl3,80AFD7C0 +ovl_Boss_Ganon2,80B05610 +ovl_En_Kakasi,80B18420 +ovl_En_Takara_Man,80B19160 +ovl_Obj_Makeoshihiki,80B19A20 +ovl_Oceff_Spot,80B19EB0 +ovl_End_Title,80B1ADE0 +ovl_En_Torch,80B1EF10 +ovl_Demo_Ec,80B1F000 +ovl_Shot_Sun,80B22860 +ovl_En_Dy_Extra,80B22F20 +ovl_En_Wonder_Talk2,80B234A0 +ovl_En_Ge2,80B23B40 +ovl_Obj_Roomtimer,80B254E0 +ovl_En_Ssh,80B25730 +ovl_En_Sth,80B27D20 +ovl_Oceff_Wipe,80B2BDD0 +ovl_Effect_Ss_Dust,80B2CB20 +ovl_Effect_Ss_KiraKira,80B2D350 +ovl_Effect_Ss_Bomb,80B2D9C0 +ovl_Effect_Ss_Bomb2,80B2DDE0 +ovl_Effect_Ss_Blast,80B2E710 +ovl_Effect_Ss_G_Spk,80B2EAA0 +ovl_Effect_Ss_D_Fire,80B2F050 +ovl_Effect_Ss_Bubble,80B2F540 +ovl_Effect_Ss_G_Ripple,80B2F9C0 +ovl_Effect_Ss_G_Splash,80B2FF20 +ovl_Effect_Ss_G_Magma,80B303D0 +ovl_Effect_Ss_G_Fire,80B30630 +ovl_Effect_Ss_Lightning,80B308C0 +ovl_Effect_Ss_Dt_Bubble,80B30F90 +ovl_Effect_Ss_Hahen,80B31520 +ovl_Effect_Ss_Stick,80B31B60 +ovl_Effect_Ss_Sibuki,80B31F00 +ovl_Effect_Ss_Sibuki2,80B325D0 +ovl_Effect_Ss_G_Magma2,80B32900 +ovl_Effect_Ss_Stone1,80B32E10 +ovl_Effect_Ss_HitMark,80B331A0 +ovl_Effect_Ss_Fhg_Flash,80B336F0 +ovl_Effect_Ss_K_Fire,80B34670 +ovl_Effect_Ss_Solder_Srch_Ball,80B34AA0 +ovl_Effect_Ss_Kakera,80B34C50 +ovl_Effect_Ss_Ice_Piece,80B35CE0 +ovl_Effect_Ss_En_Ice,80B36120 +ovl_Effect_Ss_Fire_Tail,80B369E0 +ovl_Effect_Ss_En_Fire,80B370E0 +ovl_Effect_Ss_Extra,80B37820 +ovl_Effect_Ss_Fcircle,80B37BE0 +ovl_Effect_Ss_Dead_Db,80B38090 +ovl_Effect_Ss_Dead_Dd,80B38570 +ovl_Effect_Ss_Dead_Ds,80B38B00 +ovl_Effect_Ss_Dead_Sound,80B38F80 +ovl_Oceff_Storm,80B390C0 +ovl_En_Weiyer,80B3AC60 +ovl_Bg_Spot05_Soko,80B3C660 +ovl_Bg_Jya_1flift,80B3C980 +ovl_Bg_Jya_Haheniron,80B3D010 +ovl_Bg_Spot12_Gate,80B3D800 +ovl_Bg_Spot12_Saku,80B3DC10 +ovl_En_Hintnuts,80B3E0D0 +ovl_En_Nutsball,80B3FB00 +ovl_Bg_Spot00_Break,80B40120 +ovl_En_Shopnuts,80B402C0 +ovl_En_It,80B411D0 +ovl_En_GeldB,80B41360 +ovl_Oceff_Wipe2,80B46710 +ovl_Oceff_Wipe3,80B47E80 +ovl_En_Niw_Girl,80B495D0 +ovl_En_Dog,80B4A0A0 +ovl_En_Si,80B4B250 +ovl_Bg_Spot01_Objects2,80B4B750 +ovl_Obj_Comb,80B4BC10 +ovl_Bg_Spot11_Bakudankabe,80B4C470 +ovl_Obj_Kibako2,80B4CAB0 +ovl_En_Dnt_Demo,80B4D170 +ovl_En_Dnt_Jiji,80B4DE90 +ovl_En_Dnt_Nomal,80B4F3A0 +ovl_En_Guest,80B521A0 +ovl_Bg_Bom_Guard,80B52B40 +ovl_En_Hs2,80B52D60 +ovl_Demo_Kekkai,80B53340 +ovl_Bg_Spot08_Bakudankabe,80B54620 +ovl_Bg_Spot17_Bakudankabe,80B54CC0 +ovl_Obj_Mure3,80B553A0 +ovl_En_Tg,80B55B70 +ovl_En_Mu,80B56240 +ovl_En_Go2,80B56B60 +ovl_En_Wf,80B5CB80 +ovl_En_Skb,80B60E90 +ovl_Demo_Gj,80B62780 +ovl_Demo_Geff,80B66430 +ovl_Bg_Gnd_Firemeiro,80B66C50 +ovl_Bg_Gnd_Darkmeiro,80B67190 +ovl_Bg_Gnd_Soulmeiro,80B67950 +ovl_Bg_Gnd_Nisekabe,80B681B0 +ovl_Bg_Gnd_Iceblock,80B68320 +ovl_Bg_Ydan_Sp,80B69420 +ovl_En_Gb,80B6AB90 +ovl_En_Gs,80B6C2C0 +ovl_Bg_Mizu_Bwall,80B6E160 +ovl_Bg_Mizu_Shutter,80B6F630 +ovl_En_Daiku_Kakariko,80B6FE30 +ovl_Bg_Bowl_Wall,80B711F0 +ovl_En_Wall_Tubo,80B71B70 +ovl_En_Po_Desert,80B72060 +ovl_En_Crow,80B72E20 +ovl_Door_Killer,80B744C0 +ovl_Bg_Spot11_Oasis,80B75A30 +ovl_Bg_Spot18_Futa,80B76160 +ovl_Bg_Spot18_Shutter,80B76300 +ovl_En_Ma3,80B76850 +ovl_En_Cow,80B777C0 +ovl_Bg_Ice_Turara,80B78C20 +ovl_Bg_Ice_Shutter,80B79450 +ovl_En_Kakasi2,80B798C0 +ovl_En_Kakasi3,80B79FE0 +ovl_Oceff_Wipe4,80B7B0C0 +ovl_En_Eg,80B7C0A0 +ovl_Bg_Menkuri_Nisekabe,80B7C250 +ovl_En_Zo,80B7C3A0 +ovl_Effect_Ss_Ice_Smoke,80B7E950 +ovl_Obj_Makekinsuta,80B7EE10 +ovl_En_Ge3,80B7EF60 +ovl_Obj_Timeblock,80B7FAB0 +ovl_Obj_Hamishi,80B806F0 +ovl_En_Zl4,80B80F40 +ovl_En_Mm2,80B85970 +ovl_Bg_Jya_Block,80B86730 +ovl_Obj_Warp2block,80B869A0 +gameplay_keep, +gameplay_field_keep, +gameplay_dangeon_keep, +gameplay_object_exchange_static, +object_link_boy, +object_link_child, +object_box, +object_human, +object_okuta, +object_poh, +object_wallmaster, +object_dy_obj, +object_firefly, +object_dodongo, +object_fire, +object_niw, +object_tite, +object_reeba, +object_peehat, +object_kingdodongo, +object_horse, +object_zf, +object_goma, +object_zl1, +object_gol, +object_bubble, +object_dodojr, +object_torch2, +object_bl, +object_tp, +object_oA1, +object_st, +object_bw, +object_ei, +object_horse_normal, +object_oB1, +object_o_anime, +object_spot04_objects, +object_ddan_objects, +object_hidan_objects, +object_horse_ganon, +object_oA2, +object_spot00_objects, +object_mb, +object_bombf, +object_sk2, +object_oE1, +object_oE_anime, +object_oE2, +object_ydan_objects, +object_gnd, +object_am, +object_dekubaba, +object_oA3, +object_oA4, +object_oA5, +object_oA6, +object_oA7, +object_jj, +object_oA8, +object_oA9, +object_oB2, +object_oB3, +object_oB4, +object_horse_zelda, +object_opening_demo1, +object_warp1, +object_b_heart, +object_dekunuts, +object_oE3, +object_oE4, +object_menkuri_objects, +object_oE5, +object_oE6, +object_oE7, +object_oE8, +object_oE9, +object_oE10, +object_oE11, +object_oE12, +object_vali, +object_oA10, +object_oA11, +object_mizu_objects, +object_fhg, +object_ossan, +object_mori_hineri1, +object_Bb, +object_toki_objects, +object_yukabyun, +object_zl2, +object_mjin, +object_mjin_flash, +object_mjin_dark, +object_mjin_flame, +object_mjin_ice, +object_mjin_soul, +object_mjin_wind, +object_mjin_oka, +object_haka_objects, +object_spot06_objects, +object_ice_objects, +object_relay_objects, +object_mori_hineri1a, +object_mori_hineri2, +object_mori_hineri2a, +object_mori_objects, +object_mori_tex, +object_spot08_obj, +object_warp2, +object_hata, +object_bird, +object_wood02, +object_lightbox, +object_pu_box, +object_trap, +object_vase, +object_im, +object_ta, +object_tk, +object_xc, +object_vm, +object_bv, +object_hakach_objects, +object_efc_crystal_light, +object_efc_fire_ball, +object_efc_flash, +object_efc_lgt_shower, +object_efc_star_field, +object_god_lgt, +object_light_ring, +object_triforce_spot, +object_medal, +object_bdan_objects, +object_sd, +object_rd, +object_po_sisters, +object_heavy_object, +object_gndd, +object_fd, +object_du, +object_fw, +object_horse_link_child, +object_spot02_objects, +object_haka, +object_ru1, +object_syokudai, +object_fd2, +object_dh, +object_rl, +object_efc_tw, +object_demo_tre_lgt, +object_gi_key, +object_mir_ray, +object_brob, +object_gi_jewel, +object_spot09_obj, +object_spot18_obj, +object_bdoor, +object_spot17_obj, +object_shop_dungen, +object_nb, +object_mo, +object_sb, +object_gi_melody, +object_gi_heart, +object_gi_compass, +object_gi_bosskey, +object_gi_medal, +object_gi_nuts, +object_sa, +object_gi_hearts, +object_gi_arrowcase, +object_gi_bombpouch, +object_in, +object_tr, +object_spot16_obj, +object_oE1s, +object_oE4s, +object_os_anime, +object_gi_bottle, +object_gi_stick, +object_gi_map, +object_oF1d_map, +object_ru2, +object_gi_shield_1, +object_dekujr, +object_gi_magicpot, +object_gi_bomb_1, +object_oF1s, +object_ma2, +object_gi_purse, +object_hni, +object_tw, +object_rr, +object_bxa, +object_anubice, +object_gi_gerudo, +object_gi_arrow, +object_gi_bomb_2, +object_gi_egg, +object_gi_scale, +object_gi_shield_2, +object_gi_hookshot, +object_gi_ocarina, +object_gi_milk, +object_ma1, +object_ganon, +object_sst, +object_ny, +object_fr, +object_gi_pachinko, +object_gi_boomerang, +object_gi_bow, +object_gi_glasses, +object_gi_liquid, +object_ani, +object_demo_6k, +object_gi_shield_3, +object_gi_letter, +object_spot15_obj, +object_jya_obj, +object_gi_clothes, +object_gi_bean, +object_gi_fish, +object_gi_saw, +object_gi_hammer, +object_gi_grass, +object_gi_longsword, +object_spot01_objects, +object_md, +object_km1, +object_kw1, +object_zo, +object_kz, +object_umajump, +object_masterkokiri, +object_masterkokirihead, +object_mastergolon, +object_masterzoora, +object_aob, +object_ik, +object_ahg, +object_cne, +object_gi_niwatori, +object_skj, +object_gi_bottle_letter, +object_bji, +object_bba, +object_gi_ocarina_0, +object_ds, +object_ane, +object_boj, +object_spot03_object, +object_spot07_object, +object_fz, +object_bob, +object_ge1, +object_yabusame_point, +object_gi_boots_2, +object_gi_seed, +object_gnd_magic, +object_d_elevator, +object_d_hsblock, +object_d_lift, +object_mamenoki, +object_goroiwa, +object_toryo, +object_daiku, +object_nwc, +object_blkobj, +object_gm, +object_ms, +object_hs, +object_ingate, +object_lightswitch, +object_kusa, +object_tsubo, +object_gi_gloves, +object_gi_coin, +object_kanban, +object_gjyo_objects, +object_owl, +object_mk, +object_fu, +object_gi_ki_tan_mask, +object_gi_redead_mask, +object_gi_skj_mask, +object_gi_rabit_mask, +object_gi_truth_mask, +object_ganon_objects, +object_siofuki, +object_stream, +object_mm, +object_fa, +object_os, +object_gi_eye_lotion, +object_gi_powder, +object_gi_mushroom, +object_gi_ticketstone, +object_gi_brokensword, +object_js, +object_cs, +object_gi_prescription, +object_gi_bracelet, +object_gi_soldout, +object_gi_frog, +object_mag, +object_door_gerudo, +object_gt, +object_efc_erupc, +object_zl2_anime1, +object_zl2_anime2, +object_gi_golonmask, +object_gi_zoramask, +object_gi_gerudomask, +object_ganon2, +object_ka, +object_ts, +object_zg, +object_gi_hoverboots, +object_gi_m_arrow, +object_ds2, +object_ec, +object_fish, +object_gi_sutaru, +object_gi_goddess, +object_ssh, +object_bigokuta, +object_bg, +object_spot05_objects, +object_spot12_obj, +object_bombiwa, +object_hintnuts, +object_rs, +object_spot00_break, +object_gla, +object_shopnuts, +object_geldb, +object_gr, +object_dog, +object_jya_iron, +object_jya_door, +object_spot01_objects2, +object_spot11_obj, +object_kibako2, +object_dns, +object_dnk, +object_gi_fire, +object_gi_insect, +object_gi_butterfly, +object_gi_ghost, +object_gi_soul, +object_bowl, +object_po_field, +object_demo_kekkai, +object_efc_doughnut, +object_gi_dekupouch, +object_ganon_anime1, +object_ganon_anime2, +object_ganon_anime3, +object_gi_rupy, +object_spot01_matoya, +object_spot01_matoyab, +object_po_composer, +object_mu, +object_wf, +object_skb, +object_gj, +object_geff, +object_haka_door, +object_gs, +object_ps, +object_bwall, +object_crow, +object_cow, +object_cob, +object_gi_sword_1, +object_door_killer, +object_ouke_haka, +object_timeblock, +object_zl4, +g_pn_01, +g_pn_02, +g_pn_03, +g_pn_04, +g_pn_05, +g_pn_06, +g_pn_07, +g_pn_08, +g_pn_09, +g_pn_10, +g_pn_11, +g_pn_12, +g_pn_13, +g_pn_14, +g_pn_15, +g_pn_16, +g_pn_17, +g_pn_18, +g_pn_19, +g_pn_20, +g_pn_21, +g_pn_22, +g_pn_23, +g_pn_24, +g_pn_25, +g_pn_26, +g_pn_27, +g_pn_28, +g_pn_29, +g_pn_30, +g_pn_31, +g_pn_32, +g_pn_33, +g_pn_34, +g_pn_35, +g_pn_36, +g_pn_37, +g_pn_38, +g_pn_39, +g_pn_40, +g_pn_41, +g_pn_42, +g_pn_43, +g_pn_44, +g_pn_45, +g_pn_46, +g_pn_47, +g_pn_48, +g_pn_49, +g_pn_50, +g_pn_51, +g_pn_52, +g_pn_53, +g_pn_54, +g_pn_55, +g_pn_56, +g_pn_57, +z_select_static, +nintendo_rogo_static, +title_static, +parameter_static, +vr_fine0_static, +vr_fine0_pal_static, +vr_fine1_static, +vr_fine1_pal_static, +vr_fine2_static, +vr_fine2_pal_static, +vr_fine3_static, +vr_fine3_pal_static, +vr_cloud0_static, +vr_cloud0_pal_static, +vr_cloud1_static, +vr_cloud1_pal_static, +vr_cloud2_static, +vr_cloud2_pal_static, +vr_cloud3_static, +vr_cloud3_pal_static, +vr_holy0_static, +vr_holy0_pal_static, +vr_holy1_static, +vr_holy1_pal_static, +vr_MDVR_static, +vr_MDVR_pal_static, +vr_MNVR_static, +vr_MNVR_pal_static, +vr_RUVR_static, +vr_RUVR_pal_static, +vr_LHVR_static, +vr_LHVR_pal_static, +vr_KHVR_static, +vr_KHVR_pal_static, +vr_K3VR_static, +vr_K3VR_pal_static, +vr_K4VR_static, +vr_K4VR_pal_static, +vr_K5VR_static, +vr_K5VR_pal_static, +vr_SP1a_static, +vr_SP1a_pal_static, +vr_MLVR_static, +vr_MLVR_pal_static, +vr_KKRVR_static, +vr_KKRVR_pal_static, +vr_KR3VR_static, +vr_KR3VR_pal_static, +vr_IPVR_static, +vr_IPVR_pal_static, +vr_KSVR_static, +vr_KSVR_pal_static, +vr_GLVR_static, +vr_GLVR_pal_static, +vr_ZRVR_static, +vr_ZRVR_pal_static, +vr_DGVR_static, +vr_DGVR_pal_static, +vr_ALVR_static, +vr_ALVR_pal_static, +vr_NSVR_static, +vr_NSVR_pal_static, +vr_LBVR_static, +vr_LBVR_pal_static, +vr_TTVR_static, +vr_TTVR_pal_static, +vr_FCVR_static, +vr_FCVR_pal_static, +elf_message_field, +elf_message_ydan, +ddan_scene, +ddan_room_0, +ddan_room_1, +ddan_room_2, +ddan_room_3, +ddan_room_4, +ddan_room_5, +ddan_room_6, +ddan_room_7, +ddan_room_8, +ddan_room_9, +ddan_room_10, +ddan_room_11, +ddan_room_12, +ddan_room_13, +ddan_room_14, +ddan_room_15, +ddan_room_16, +spot00_scene, +spot00_room_0, +spot01_scene, +spot01_room_0, +spot02_scene, +spot02_room_0, +spot02_room_1, +spot03_scene, +spot03_room_0, +spot03_room_1, +spot04_scene, +spot04_room_0, +spot04_room_1, +spot04_room_2, +spot05_scene, +spot05_room_0, +spot06_scene, +spot06_room_0, +spot07_scene, +spot07_room_0, +spot07_room_1, +spot08_scene, +spot08_room_0, +spot09_scene, +spot09_room_0, +spot10_scene, +spot10_room_0, +spot10_room_1, +spot10_room_2, +spot10_room_3, +spot10_room_4, +spot10_room_5, +spot10_room_6, +spot10_room_7, +spot10_room_8, +spot10_room_9, +spot11_scene, +spot11_room_0, +spot12_scene, +spot12_room_0, +spot12_room_1, +spot13_scene, +spot13_room_0, +spot13_room_1, +spot15_scene, +spot15_room_0, +spot16_scene, +spot16_room_0, +spot17_scene, +spot17_room_0, +spot17_room_1, +spot18_scene, +spot18_room_0, +spot18_room_1, +spot18_room_2, +spot18_room_3, +market_day_scene, +market_day_room_0, +market_night_scene, +market_night_room_0, +HIDAN_scene, +HIDAN_room_0, +HIDAN_room_1, +HIDAN_room_2, +HIDAN_room_3, +HIDAN_room_4, +HIDAN_room_5, +HIDAN_room_6, +HIDAN_room_7, +HIDAN_room_8, +HIDAN_room_9, +HIDAN_room_10, +HIDAN_room_11, +HIDAN_room_12, +HIDAN_room_13, +HIDAN_room_14, +HIDAN_room_15, +HIDAN_room_16, +HIDAN_room_17, +HIDAN_room_18, +HIDAN_room_19, +HIDAN_room_20, +HIDAN_room_21, +HIDAN_room_22, +HIDAN_room_23, +HIDAN_room_24, +HIDAN_room_25, +HIDAN_room_26, +Bmori1_scene, +Bmori1_room_0, +Bmori1_room_1, +Bmori1_room_2, +Bmori1_room_3, +Bmori1_room_4, +Bmori1_room_5, +Bmori1_room_6, +Bmori1_room_7, +Bmori1_room_8, +Bmori1_room_9, +Bmori1_room_10, +Bmori1_room_11, +Bmori1_room_12, +Bmori1_room_13, +Bmori1_room_14, +Bmori1_room_15, +Bmori1_room_16, +Bmori1_room_17, +Bmori1_room_18, +Bmori1_room_19, +Bmori1_room_20, +Bmori1_room_21, +Bmori1_room_22, +ydan_scene, +ydan_room_0, +ydan_room_1, +ydan_room_2, +ydan_room_3, +ydan_room_4, +ydan_room_5, +ydan_room_6, +ydan_room_7, +ydan_room_8, +ydan_room_9, +ydan_room_10, +ydan_room_11, +kenjyanoma_scene, +kenjyanoma_room_0, +tokinoma_scene, +tokinoma_room_0, +tokinoma_room_1, +link_home_scene, +link_home_room_0, +kokiri_shop_scene, +kokiri_shop_room_0, +MIZUsin_scene, +MIZUsin_room_0, +MIZUsin_room_1, +MIZUsin_room_2, +MIZUsin_room_3, +MIZUsin_room_4, +MIZUsin_room_5, +MIZUsin_room_6, +MIZUsin_room_7, +MIZUsin_room_8, +MIZUsin_room_9, +MIZUsin_room_10, +MIZUsin_room_11, +MIZUsin_room_12, +MIZUsin_room_13, +MIZUsin_room_14, +MIZUsin_room_15, +MIZUsin_room_16, +MIZUsin_room_17, +MIZUsin_room_18, +MIZUsin_room_19, +MIZUsin_room_20, +MIZUsin_room_21, +MIZUsin_room_22, +kokiri_home_scene, +kokiri_home_room_0, +kakusiana_scene, +kakusiana_room_0, +kakusiana_room_1, +kakusiana_room_2, +kakusiana_room_3, +kakusiana_room_4, +kakusiana_room_5, +kakusiana_room_6, +kakusiana_room_7, +kakusiana_room_8, +kakusiana_room_9, +kakusiana_room_10, +kakusiana_room_11, +kakusiana_room_12, +kakusiana_room_13, +entra_scene, +entra_room_0, +bdan_scene, +bdan_room_0, +bdan_room_1, +bdan_room_2, +bdan_room_3, +bdan_room_4, +bdan_room_5, +bdan_room_6, +bdan_room_7, +bdan_room_8, +bdan_room_9, +bdan_room_10, +bdan_room_11, +bdan_room_12, +bdan_room_13, +bdan_room_14, +bdan_room_15, +HAKAdan_scene, +HAKAdan_room_0, +HAKAdan_room_1, +HAKAdan_room_2, +HAKAdan_room_3, +HAKAdan_room_4, +HAKAdan_room_5, +HAKAdan_room_6, +HAKAdan_room_7, +HAKAdan_room_8, +HAKAdan_room_9, +HAKAdan_room_10, +HAKAdan_room_11, +HAKAdan_room_12, +HAKAdan_room_13, +HAKAdan_room_14, +HAKAdan_room_15, +HAKAdan_room_16, +HAKAdan_room_17, +HAKAdan_room_18, +HAKAdan_room_19, +HAKAdan_room_20, +HAKAdan_room_21, +HAKAdan_room_22, +moribossroom_scene, +moribossroom_room_0, +moribossroom_room_1, +syatekijyou_scene, +syatekijyou_room_0, +men_scene, +men_room_0, +men_room_1, +men_room_2, +men_room_3, +men_room_4, +men_room_5, +men_room_6, +men_room_7, +men_room_8, +men_room_9, +men_room_10, +shop1_scene, +shop1_room_0, +hairal_niwa_scene, +hairal_niwa_room_0, +ganon_tou_scene, +ganon_tou_room_0, +market_alley_scene, +market_alley_room_0, +spot20_scene, +spot20_room_0, +market_ruins_scene, +market_ruins_room_0, +entra_n_scene, +entra_n_room_0, +enrui_scene, +enrui_room_0, +market_alley_n_scene, +market_alley_n_room_0, +hiral_demo_scene, +hiral_demo_room_0, +kokiri_home3_scene, +kokiri_home3_room_0, +jyasinzou_scene, +jyasinzou_room_0, +jyasinzou_room_1, +jyasinzou_room_2, +jyasinzou_room_3, +jyasinzou_room_4, +jyasinzou_room_5, +jyasinzou_room_6, +jyasinzou_room_7, +jyasinzou_room_8, +jyasinzou_room_9, +jyasinzou_room_10, +jyasinzou_room_11, +jyasinzou_room_12, +jyasinzou_room_13, +jyasinzou_room_14, +jyasinzou_room_15, +jyasinzou_room_16, +jyasinzou_room_17, +jyasinzou_room_18, +jyasinzou_room_19, +jyasinzou_room_20, +jyasinzou_room_21, +jyasinzou_room_22, +jyasinzou_room_23, +jyasinzou_room_24, +jyasinzou_room_25, +jyasinzou_room_26, +jyasinzou_room_27, +jyasinzou_room_28, +ice_doukutu_scene, +ice_doukutu_room_0, +ice_doukutu_room_1, +ice_doukutu_room_2, +ice_doukutu_room_3, +ice_doukutu_room_4, +ice_doukutu_room_5, +ice_doukutu_room_6, +ice_doukutu_room_7, +ice_doukutu_room_8, +ice_doukutu_room_9, +ice_doukutu_room_10, +ice_doukutu_room_11, +malon_stable_scene, +malon_stable_room_0, +kakariko_scene, +kakariko_room_0, +bdan_boss_scene, +bdan_boss_room_0, +bdan_boss_room_1, +FIRE_bs_scene, +FIRE_bs_room_0, +FIRE_bs_room_1, +hut_scene, +hut_room_0, +daiyousei_izumi_scene, +daiyousei_izumi_room_0, +hakaana_scene, +hakaana_room_0, +yousei_izumi_tate_scene, +yousei_izumi_tate_room_0, +yousei_izumi_yoko_scene, +yousei_izumi_yoko_room_0, +golon_scene, +golon_room_0, +zoora_scene, +zoora_room_0, +drag_scene, +drag_room_0, +alley_shop_scene, +alley_shop_room_0, +night_shop_scene, +night_shop_room_0, +impa_scene, +impa_room_0, +labo_scene, +labo_room_0, +tent_scene, +tent_room_0, +nakaniwa_scene, +nakaniwa_room_0, +ddan_boss_scene, +ddan_boss_room_0, +ddan_boss_room_1, +ydan_boss_scene, +ydan_boss_room_0, +ydan_boss_room_1, +HAKAdan_bs_scene, +HAKAdan_bs_room_0, +HAKAdan_bs_room_1, +MIZUsin_bs_scene, +MIZUsin_bs_room_0, +MIZUsin_bs_room_1, +ganon_scene, +ganon_room_0, +ganon_room_1, +ganon_room_2, +ganon_room_3, +ganon_room_4, +ganon_room_5, +ganon_room_6, +ganon_room_7, +ganon_room_8, +ganon_room_9, +ganon_boss_scene, +ganon_boss_room_0, +jyasinboss_scene, +jyasinboss_room_0, +jyasinboss_room_1, +jyasinboss_room_2, +jyasinboss_room_3, +kokiri_home4_scene, +kokiri_home4_room_0, +kokiri_home5_scene, +kokiri_home5_room_0, +ganon_final_scene, +ganon_final_room_0, +kakariko3_scene, +kakariko3_room_0, +hakasitarelay_scene, +hakasitarelay_room_0, +hakasitarelay_room_1, +hakasitarelay_room_2, +hakasitarelay_room_3, +hakasitarelay_room_4, +hakasitarelay_room_5, +hakasitarelay_room_6, +shrine_scene, +shrine_room_0, +turibori_scene, +turibori_room_0, +shrine_n_scene, +shrine_n_room_0, +shrine_r_scene, +shrine_r_room_0, +ganontika_scene, +ganontika_room_0, +ganontika_room_1, +ganontika_room_2, +ganontika_room_3, +ganontika_room_4, +ganontika_room_5, +ganontika_room_6, +ganontika_room_7, +ganontika_room_8, +ganontika_room_9, +ganontika_room_10, +ganontika_room_11, +ganontika_room_12, +ganontika_room_13, +ganontika_room_14, +ganontika_room_15, +ganontika_room_16, +ganontika_room_17, +ganontika_room_18, +ganontika_room_19, +hakaana2_scene, +hakaana2_room_0, +gerudoway_scene, +gerudoway_room_0, +gerudoway_room_1, +gerudoway_room_2, +gerudoway_room_3, +gerudoway_room_4, +gerudoway_room_5, +HAKAdanCH_scene, +HAKAdanCH_room_0, +HAKAdanCH_room_1, +HAKAdanCH_room_2, +HAKAdanCH_room_3, +HAKAdanCH_room_4, +HAKAdanCH_room_5, +HAKAdanCH_room_6, +hairal_niwa_n_scene, +hairal_niwa_n_room_0, +bowling_scene, +bowling_room_0, +hakaana_ouke_scene, +hakaana_ouke_room_0, +hakaana_ouke_room_1, +hakaana_ouke_room_2, +hylia_labo_scene, +hylia_labo_room_0, +souko_scene, +souko_room_0, +souko_room_1, +souko_room_2, +miharigoya_scene, +miharigoya_room_0, +mahouya_scene, +mahouya_room_0, +takaraya_scene, +takaraya_room_0, +takaraya_room_1, +takaraya_room_2, +takaraya_room_3, +takaraya_room_4, +takaraya_room_5, +takaraya_room_6, +ganon_sonogo_scene, +ganon_sonogo_room_0, +ganon_sonogo_room_1, +ganon_sonogo_room_2, +ganon_sonogo_room_3, +ganon_sonogo_room_4, +ganon_demo_scene, +ganon_demo_room_0, +face_shop_scene, +face_shop_room_0, +kinsuta_scene, +kinsuta_room_0, +ganontikasonogo_scene, +ganontikasonogo_room_0, +ganontikasonogo_room_1, +bump_texture_static, +anime_model_1_static, +anime_model_2_static, +anime_model_3_static, +anime_model_4_static, +anime_model_5_static, +anime_model_6_static, +anime_texture_1_static, +anime_texture_2_static, +anime_texture_3_static, +anime_texture_4_static, +anime_texture_5_static, +anime_texture_6_static, +softsprite_matrix_static, diff --git a/baseroms/ntsc-1.2/checksum-JP-compressed.md5 b/baseroms/ntsc-1.2/checksum-JP-compressed.md5 new file mode 100644 index 0000000000..66fb4932a4 --- /dev/null +++ b/baseroms/ntsc-1.2/checksum-JP-compressed.md5 @@ -0,0 +1 @@ +2258052847bdd056c8406a9ef6427f13 build/ntsc-1.2/oot-ntsc-1.2-compressed.z64 diff --git a/baseroms/ntsc-1.2/checksum-JP.md5 b/baseroms/ntsc-1.2/checksum-JP.md5 new file mode 100644 index 0000000000..8dec1a19ac --- /dev/null +++ b/baseroms/ntsc-1.2/checksum-JP.md5 @@ -0,0 +1 @@ +48b3e547359f21bb7e123fb362c1dd4e build/ntsc-1.2/oot-ntsc-1.2.z64 diff --git a/baseroms/ntsc-1.2/checksum-US-compressed.md5 b/baseroms/ntsc-1.2/checksum-US-compressed.md5 new file mode 100644 index 0000000000..001d6babd3 --- /dev/null +++ b/baseroms/ntsc-1.2/checksum-US-compressed.md5 @@ -0,0 +1 @@ +57a9719ad547c516342e1a15d5c28c3d build/ntsc-1.2/oot-ntsc-1.2-compressed.z64 diff --git a/baseroms/ntsc-1.2/checksum-US.md5 b/baseroms/ntsc-1.2/checksum-US.md5 new file mode 100644 index 0000000000..75c1434d1a --- /dev/null +++ b/baseroms/ntsc-1.2/checksum-US.md5 @@ -0,0 +1 @@ +12fcafeba93992facaf65c2ba00f3089 build/ntsc-1.2/oot-ntsc-1.2.z64 diff --git a/baseroms/ntsc-1.2/config.yml b/baseroms/ntsc-1.2/config.yml new file mode 100644 index 0000000000..f9293586f9 --- /dev/null +++ b/baseroms/ntsc-1.2/config.yml @@ -0,0 +1,1219 @@ +checksums: + - checksum-JP + - checksum-US +dmadata_start: 0x7960 +text_lang_pal: false +incbins: + - name: ipl3 + segment: makerom + vram: 0x80000040 + size: 0xFC0 + - name: rspbootText + segment: boot + vram: 0x800065C0 + size: 0x160 + - name: aspMainText + segment: code + vram: 0x800E3600 + size: 0xFB0 + - name: gspF3DZEX2_NoN_PosLight_fifoText + segment: code + vram: 0x800E45B0 + size: 0x1390 + - name: gspS2DEX2d_fifoText + segment: code + vram: 0x800E5940 + size: 0x18C0 + - name: njpgdspMainText + segment: code + vram: 0x800E7200 + size: 0xAF0 + - name: aspMainData + segment: code + vram: 0x80114990 + size: 0x2E0 + - name: gspF3DZEX2_NoN_PosLight_fifoData + segment: code + vram: 0x80114C70 + size: 0x420 + - name: gspS2DEX2d_fifoData + segment: code + vram: 0x80115090 + size: 0x390 + - name: njpgdspMainData + segment: code + vram: 0x80115420 + size: 0x60 +variables: + gMtxClear: 0x800FF3F0 + sJpnMessageEntryTable: 0x8010AFFC + sNesMessageEntryTable: 0x8010F13C + sStaffMessageEntryTable: 0x8011335C + gSoundFontTable: 0x80113DF0 + gSequenceFontTable: 0x80114060 + gSequenceTable: 0x80114220 + gSampleBankTable: 0x80114910 + sShadowTex: 0x80AE0FE0 +assets: +- name: code/fbdemo_circle + xml_path: assets/xml/code/fbdemo_circle.xml + start_offset: 0xEC0B8 + end_offset: 0xED2D8 +- name: code/fbdemo_triforce + xml_path: assets/xml/code/fbdemo_triforce.xml + start_offset: 0xEB540 + end_offset: 0xEB610 +- name: code/fbdemo_wipe1 + xml_path: assets/xml/code/fbdemo_wipe1.xml + start_offset: 0xEB610 + end_offset: 0xEBFA0 +- name: n64dd/error_textures + xml_path: assets/xml/n64dd/error_textures.xml + start_offset: 0xC120 + end_offset: 0x11D20 +- name: misc/link_animetion + xml_path: assets/xml/misc/link_animetion.xml +- name: misc/z_select_static + xml_path: assets/xml/misc/z_select_static.xml +- name: objects/gameplay_dangeon_keep + xml_path: assets/xml/objects/gameplay_dangeon_keep.xml +- name: objects/gameplay_field_keep + xml_path: assets/xml/objects/gameplay_field_keep.xml +- name: objects/gameplay_keep + xml_path: assets/xml/objects/gameplay_keep.xml +- name: objects/object_ahg + xml_path: assets/xml/objects/object_ahg.xml +- name: objects/object_am + xml_path: assets/xml/objects/object_am.xml +- name: objects/object_ane + xml_path: assets/xml/objects/object_ane.xml +- name: objects/object_ani + xml_path: assets/xml/objects/object_ani.xml +- name: objects/object_anubice + xml_path: assets/xml/objects/object_anubice.xml +- name: objects/object_aob + xml_path: assets/xml/objects/object_aob.xml +- name: objects/object_b_heart + xml_path: assets/xml/objects/object_b_heart.xml +- name: objects/object_Bb + xml_path: assets/xml/objects/object_Bb.xml +- name: objects/object_bba + xml_path: assets/xml/objects/object_bba.xml +- name: objects/object_bdan_objects + xml_path: assets/xml/objects/object_bdan_objects.xml +- name: objects/object_bdoor + xml_path: assets/xml/objects/object_bdoor.xml +- name: objects/object_bg + xml_path: assets/xml/objects/object_bg.xml +- name: objects/object_bigokuta + xml_path: assets/xml/objects/object_bigokuta.xml +- name: objects/object_bird + xml_path: assets/xml/objects/object_bird.xml +- name: objects/object_bji + xml_path: assets/xml/objects/object_bji.xml +- name: objects/object_bl + xml_path: assets/xml/objects/object_bl.xml +- name: objects/object_blkobj + xml_path: assets/xml/objects/object_blkobj.xml +- name: objects/object_bob + xml_path: assets/xml/objects/object_bob.xml +- name: objects/object_boj + xml_path: assets/xml/objects/object_boj.xml +- name: objects/object_bombf + xml_path: assets/xml/objects/object_bombf.xml +- name: objects/object_bombiwa + xml_path: assets/xml/objects/object_bombiwa.xml +- name: objects/object_bowl + xml_path: assets/xml/objects/object_bowl.xml +- name: objects/object_box + xml_path: assets/xml/objects/object_box.xml +- name: objects/object_brob + xml_path: assets/xml/objects/object_brob.xml +- name: objects/object_bubble + xml_path: assets/xml/objects/object_bubble.xml +- name: objects/object_bv + xml_path: assets/xml/objects/object_bv.xml +- name: objects/object_bw + xml_path: assets/xml/objects/object_bw.xml +- name: objects/object_bwall + xml_path: assets/xml/objects/object_bwall.xml +- name: objects/object_bxa + xml_path: assets/xml/objects/object_bxa.xml +- name: objects/object_cne + xml_path: assets/xml/objects/object_cne.xml +- name: objects/object_cob + xml_path: assets/xml/objects/object_cob.xml +- name: objects/object_cow + xml_path: assets/xml/objects/object_cow.xml +- name: objects/object_crow + xml_path: assets/xml/objects/object_crow.xml +- name: objects/object_cs + xml_path: assets/xml/objects/object_cs.xml +- name: objects/object_d_elevator + xml_path: assets/xml/objects/object_d_elevator.xml +- name: objects/object_d_hsblock + xml_path: assets/xml/objects/object_d_hsblock.xml +- name: objects/object_d_lift + xml_path: assets/xml/objects/object_d_lift.xml +- name: objects/object_daiku + xml_path: assets/xml/objects/object_daiku.xml +- name: objects/object_ddan_objects + xml_path: assets/xml/objects/object_ddan_objects.xml +- name: objects/object_dekubaba + xml_path: assets/xml/objects/object_dekubaba.xml +- name: objects/object_dekujr + xml_path: assets/xml/objects/object_dekujr.xml +- name: objects/object_dekunuts + xml_path: assets/xml/objects/object_dekunuts.xml +- name: objects/object_demo_6k + xml_path: assets/xml/objects/object_demo_6k.xml +- name: objects/object_demo_kekkai + xml_path: assets/xml/objects/object_demo_kekkai.xml +- name: objects/object_demo_tre_lgt + xml_path: assets/xml/objects/object_demo_tre_lgt.xml +- name: objects/object_dh + xml_path: assets/xml/objects/object_dh.xml +- name: objects/object_dnk + xml_path: assets/xml/objects/object_dnk.xml +- name: objects/object_dns + xml_path: assets/xml/objects/object_dns.xml +- name: objects/object_dodojr + xml_path: assets/xml/objects/object_dodojr.xml +- name: objects/object_dodongo + xml_path: assets/xml/objects/object_dodongo.xml +- name: objects/object_dog + xml_path: assets/xml/objects/object_dog.xml +- name: objects/object_door_gerudo + xml_path: assets/xml/objects/object_door_gerudo.xml +- name: objects/object_door_killer + xml_path: assets/xml/objects/object_door_killer.xml +- name: objects/object_ds + xml_path: assets/xml/objects/object_ds.xml +- name: objects/object_ds2 + xml_path: assets/xml/objects/object_ds2.xml +- name: objects/object_du + xml_path: assets/xml/objects/object_du.xml +- name: objects/object_dy_obj + xml_path: assets/xml/objects/object_dy_obj.xml +- name: objects/object_ec + xml_path: assets/xml/objects/object_ec.xml +- name: objects/object_efc_crystal_light + xml_path: assets/xml/objects/object_efc_crystal_light.xml +- name: objects/object_efc_doughnut + xml_path: assets/xml/objects/object_efc_doughnut.xml +- name: objects/object_efc_erupc + xml_path: assets/xml/objects/object_efc_erupc.xml +- name: objects/object_efc_fire_ball + xml_path: assets/xml/objects/object_efc_fire_ball.xml +- name: objects/object_efc_flash + xml_path: assets/xml/objects/object_efc_flash.xml +- name: objects/object_efc_lgt_shower + xml_path: assets/xml/objects/object_efc_lgt_shower.xml +- name: objects/object_efc_star_field + xml_path: assets/xml/objects/object_efc_star_field.xml +- name: objects/object_efc_tw + xml_path: assets/xml/objects/object_efc_tw.xml +- name: objects/object_ei + xml_path: assets/xml/objects/object_ei.xml +- name: objects/object_fa + xml_path: assets/xml/objects/object_fa.xml +- name: objects/object_fd + xml_path: assets/xml/objects/object_fd.xml +- name: objects/object_fd2 + xml_path: assets/xml/objects/object_fd2.xml +- name: objects/object_fhg + xml_path: assets/xml/objects/object_fhg.xml +- name: objects/object_fire + xml_path: assets/xml/objects/object_fire.xml +- name: objects/object_firefly + xml_path: assets/xml/objects/object_firefly.xml +- name: objects/object_fish + xml_path: assets/xml/objects/object_fish.xml +- name: objects/object_fr + xml_path: assets/xml/objects/object_fr.xml +- name: objects/object_fu + xml_path: assets/xml/objects/object_fu.xml +- name: objects/object_fw + xml_path: assets/xml/objects/object_fw.xml +- name: objects/object_fz + xml_path: assets/xml/objects/object_fz.xml +- name: objects/object_ganon + xml_path: assets/xml/objects/object_ganon.xml +- name: objects/object_ganon2 + xml_path: assets/xml/objects/object_ganon2.xml +- name: objects/object_ganon_anime1 + xml_path: assets/xml/objects/object_ganon_anime1.xml +- name: objects/object_ganon_anime2 + xml_path: assets/xml/objects/object_ganon_anime2.xml +- name: objects/object_ganon_anime3 + xml_path: assets/xml/objects/object_ganon_anime3.xml +- name: objects/object_ganon_objects + xml_path: assets/xml/objects/object_ganon_objects.xml +- name: objects/object_ge1 + xml_path: assets/xml/objects/object_ge1.xml +- name: objects/object_geff + xml_path: assets/xml/objects/object_geff.xml +- name: objects/object_geldb + xml_path: assets/xml/objects/object_geldb.xml +- name: objects/object_gi_arrow + xml_path: assets/xml/objects/object_gi_arrow.xml +- name: objects/object_gi_arrowcase + xml_path: assets/xml/objects/object_gi_arrowcase.xml +- name: objects/object_gi_bean + xml_path: assets/xml/objects/object_gi_bean.xml +- name: objects/object_gi_bomb_1 + xml_path: assets/xml/objects/object_gi_bomb_1.xml +- name: objects/object_gi_bomb_2 + xml_path: assets/xml/objects/object_gi_bomb_2.xml +- name: objects/object_gi_bombpouch + xml_path: assets/xml/objects/object_gi_bombpouch.xml +- name: objects/object_gi_boomerang + xml_path: assets/xml/objects/object_gi_boomerang.xml +- name: objects/object_gi_boots_2 + xml_path: assets/xml/objects/object_gi_boots_2.xml +- name: objects/object_gi_bosskey + xml_path: assets/xml/objects/object_gi_bosskey.xml +- name: objects/object_gi_bottle + xml_path: assets/xml/objects/object_gi_bottle.xml +- name: objects/object_gi_bottle_letter + xml_path: assets/xml/objects/object_gi_bottle_letter.xml +- name: objects/object_gi_bow + xml_path: assets/xml/objects/object_gi_bow.xml +- name: objects/object_gi_bracelet + xml_path: assets/xml/objects/object_gi_bracelet.xml +- name: objects/object_gi_brokensword + xml_path: assets/xml/objects/object_gi_brokensword.xml +- name: objects/object_gi_butterfly + xml_path: assets/xml/objects/object_gi_butterfly.xml +- name: objects/object_gi_clothes + xml_path: assets/xml/objects/object_gi_clothes.xml +- name: objects/object_gi_coin + xml_path: assets/xml/objects/object_gi_coin.xml +- name: objects/object_gi_compass + xml_path: assets/xml/objects/object_gi_compass.xml +- name: objects/object_gi_dekupouch + xml_path: assets/xml/objects/object_gi_dekupouch.xml +- name: objects/object_gi_egg + xml_path: assets/xml/objects/object_gi_egg.xml +- name: objects/object_gi_eye_lotion + xml_path: assets/xml/objects/object_gi_eye_lotion.xml +- name: objects/object_gi_fire + xml_path: assets/xml/objects/object_gi_fire.xml +- name: objects/object_gi_fish + xml_path: assets/xml/objects/object_gi_fish.xml +- name: objects/object_gi_frog + xml_path: assets/xml/objects/object_gi_frog.xml +- name: objects/object_gi_gerudo + xml_path: assets/xml/objects/object_gi_gerudo.xml +- name: objects/object_gi_gerudomask + xml_path: assets/xml/objects/object_gi_gerudomask.xml +- name: objects/object_gi_ghost + xml_path: assets/xml/objects/object_gi_ghost.xml +- name: objects/object_gi_glasses + xml_path: assets/xml/objects/object_gi_glasses.xml +- name: objects/object_gi_gloves + xml_path: assets/xml/objects/object_gi_gloves.xml +- name: objects/object_gi_goddess + xml_path: assets/xml/objects/object_gi_goddess.xml +- name: objects/object_gi_golonmask + xml_path: assets/xml/objects/object_gi_golonmask.xml +- name: objects/object_gi_grass + xml_path: assets/xml/objects/object_gi_grass.xml +- name: objects/object_gi_hammer + xml_path: assets/xml/objects/object_gi_hammer.xml +- name: objects/object_gi_heart + xml_path: assets/xml/objects/object_gi_heart.xml +- name: objects/object_gi_hearts + xml_path: assets/xml/objects/object_gi_hearts.xml +- name: objects/object_gi_hookshot + xml_path: assets/xml/objects/object_gi_hookshot.xml +- name: objects/object_gi_hoverboots + xml_path: assets/xml/objects/object_gi_hoverboots.xml +- name: objects/object_gi_insect + xml_path: assets/xml/objects/object_gi_insect.xml +- name: objects/object_gi_jewel + xml_path: assets/xml/objects/object_gi_jewel.xml +- name: objects/object_gi_key + xml_path: assets/xml/objects/object_gi_key.xml +- name: objects/object_gi_ki_tan_mask + xml_path: assets/xml/objects/object_gi_ki_tan_mask.xml +- name: objects/object_gi_letter + xml_path: assets/xml/objects/object_gi_letter.xml +- name: objects/object_gi_liquid + xml_path: assets/xml/objects/object_gi_liquid.xml +- name: objects/object_gi_longsword + xml_path: assets/xml/objects/object_gi_longsword.xml +- name: objects/object_gi_m_arrow + xml_path: assets/xml/objects/object_gi_m_arrow.xml +- name: objects/object_gi_magicpot + xml_path: assets/xml/objects/object_gi_magicpot.xml +- name: objects/object_gi_map + xml_path: assets/xml/objects/object_gi_map.xml +- name: objects/object_gi_medal + xml_path: assets/xml/objects/object_gi_medal.xml +- name: objects/object_gi_melody + xml_path: assets/xml/objects/object_gi_melody.xml +- name: objects/object_gi_milk + xml_path: assets/xml/objects/object_gi_milk.xml +- name: objects/object_gi_mushroom + xml_path: assets/xml/objects/object_gi_mushroom.xml +- name: objects/object_gi_niwatori + xml_path: assets/xml/objects/object_gi_niwatori.xml +- name: objects/object_gi_nuts + xml_path: assets/xml/objects/object_gi_nuts.xml +- name: objects/object_gi_ocarina + xml_path: assets/xml/objects/object_gi_ocarina.xml +- name: objects/object_gi_ocarina_0 + xml_path: assets/xml/objects/object_gi_ocarina_0.xml +- name: objects/object_gi_pachinko + xml_path: assets/xml/objects/object_gi_pachinko.xml +- name: objects/object_gi_powder + xml_path: assets/xml/objects/object_gi_powder.xml +- name: objects/object_gi_prescription + xml_path: assets/xml/objects/object_gi_prescription.xml +- name: objects/object_gi_purse + xml_path: assets/xml/objects/object_gi_purse.xml +- name: objects/object_gi_rabit_mask + xml_path: assets/xml/objects/object_gi_rabit_mask.xml +- name: objects/object_gi_redead_mask + xml_path: assets/xml/objects/object_gi_redead_mask.xml +- name: objects/object_gi_rupy + xml_path: assets/xml/objects/object_gi_rupy.xml +- name: objects/object_gi_saw + xml_path: assets/xml/objects/object_gi_saw.xml +- name: objects/object_gi_scale + xml_path: assets/xml/objects/object_gi_scale.xml +- name: objects/object_gi_seed + xml_path: assets/xml/objects/object_gi_seed.xml +- name: objects/object_gi_shield_1 + xml_path: assets/xml/objects/object_gi_shield_1.xml +- name: objects/object_gi_shield_2 + xml_path: assets/xml/objects/object_gi_shield_2.xml +- name: objects/object_gi_shield_3 + xml_path: assets/xml/objects/object_gi_shield_3.xml +- name: objects/object_gi_skj_mask + xml_path: assets/xml/objects/object_gi_skj_mask.xml +- name: objects/object_gi_soldout + xml_path: assets/xml/objects/object_gi_soldout.xml +- name: objects/object_gi_soul + xml_path: assets/xml/objects/object_gi_soul.xml +- name: objects/object_gi_stick + xml_path: assets/xml/objects/object_gi_stick.xml +- name: objects/object_gi_sutaru + xml_path: assets/xml/objects/object_gi_sutaru.xml +- name: objects/object_gi_sword_1 + xml_path: assets/xml/objects/object_gi_sword_1.xml +- name: objects/object_gi_ticketstone + xml_path: assets/xml/objects/object_gi_ticketstone.xml +- name: objects/object_gi_truth_mask + xml_path: assets/xml/objects/object_gi_truth_mask.xml +- name: objects/object_gi_zoramask + xml_path: assets/xml/objects/object_gi_zoramask.xml +- name: objects/object_gj + xml_path: assets/xml/objects/object_gj.xml +- name: objects/object_gjyo_objects + xml_path: assets/xml/objects/object_gjyo_objects.xml +- name: objects/object_gla + xml_path: assets/xml/objects/object_gla.xml +- name: objects/object_gm + xml_path: assets/xml/objects/object_gm.xml +- name: objects/object_gnd + xml_path: assets/xml/objects/object_gnd.xml +- name: objects/object_gnd_magic + xml_path: assets/xml/objects/object_gnd_magic.xml +- name: objects/object_gndd + xml_path: assets/xml/objects/object_gndd.xml +- name: objects/object_god_lgt + xml_path: assets/xml/objects/object_god_lgt.xml +- name: objects/object_gol + xml_path: assets/xml/objects/object_gol.xml +- name: objects/object_goma + xml_path: assets/xml/objects/object_goma.xml +- name: objects/object_goroiwa + xml_path: assets/xml/objects/object_goroiwa.xml +- name: objects/object_gr + xml_path: assets/xml/objects/object_gr.xml +- name: objects/object_gs + xml_path: assets/xml/objects/object_gs.xml +- name: objects/object_gt + xml_path: assets/xml/objects/object_gt.xml +- name: objects/object_haka + xml_path: assets/xml/objects/object_haka.xml +- name: objects/object_haka_door + xml_path: assets/xml/objects/object_haka_door.xml +- name: objects/object_haka_objects + xml_path: assets/xml/objects/object_haka_objects.xml +- name: objects/object_hakach_objects + xml_path: assets/xml/objects/object_hakach_objects.xml +- name: objects/object_hata + xml_path: assets/xml/objects/object_hata.xml +- name: objects/object_heavy_object + xml_path: assets/xml/objects/object_heavy_object.xml +- name: objects/object_hidan_objects + xml_path: assets/xml/objects/object_hidan_objects.xml +- name: objects/object_hintnuts + xml_path: assets/xml/objects/object_hintnuts.xml +- name: objects/object_hni + xml_path: assets/xml/objects/object_hni.xml +- name: objects/object_horse + xml_path: assets/xml/objects/object_horse.xml +- name: objects/object_horse_ganon + xml_path: assets/xml/objects/object_horse_ganon.xml +- name: objects/object_horse_link_child + xml_path: assets/xml/objects/object_horse_link_child.xml +- name: objects/object_horse_normal + xml_path: assets/xml/objects/object_horse_normal.xml +- name: objects/object_horse_zelda + xml_path: assets/xml/objects/object_horse_zelda.xml +- name: objects/object_hs + xml_path: assets/xml/objects/object_hs.xml +- name: objects/object_human + xml_path: assets/xml/objects/object_human.xml +- name: objects/object_ice_objects + xml_path: assets/xml/objects/object_ice_objects.xml +- name: objects/object_ik + xml_path: assets/xml/objects/object_ik.xml +- name: objects/object_im + xml_path: assets/xml/objects/object_im.xml +- name: objects/object_in + xml_path: assets/xml/objects/object_in.xml +- name: objects/object_ingate + xml_path: assets/xml/objects/object_ingate.xml +- name: objects/object_jj + xml_path: assets/xml/objects/object_jj.xml +- name: objects/object_js + xml_path: assets/xml/objects/object_js.xml +- name: objects/object_jya_door + xml_path: assets/xml/objects/object_jya_door.xml +- name: objects/object_jya_iron + xml_path: assets/xml/objects/object_jya_iron.xml +- name: objects/object_jya_obj + xml_path: assets/xml/objects/object_jya_obj.xml +- name: objects/object_ka + xml_path: assets/xml/objects/object_ka.xml +- name: objects/object_kanban + xml_path: assets/xml/objects/object_kanban.xml +- name: objects/object_kibako2 + xml_path: assets/xml/objects/object_kibako2.xml +- name: objects/object_kingdodongo + xml_path: assets/xml/objects/object_kingdodongo.xml +- name: objects/object_km1 + xml_path: assets/xml/objects/object_km1.xml +- name: objects/object_kusa + xml_path: assets/xml/objects/object_kusa.xml +- name: objects/object_kw1 + xml_path: assets/xml/objects/object_kw1.xml +- name: objects/object_kz + xml_path: assets/xml/objects/object_kz.xml +- name: objects/object_light_ring + xml_path: assets/xml/objects/object_light_ring.xml +- name: objects/object_lightbox + xml_path: assets/xml/objects/object_lightbox.xml +- name: objects/object_lightswitch + xml_path: assets/xml/objects/object_lightswitch.xml +- name: objects/object_link_boy + xml_path: assets/xml/objects/object_link_boy.xml +- name: objects/object_link_child + xml_path: assets/xml/objects/object_link_child.xml +- name: objects/object_ma1 + xml_path: assets/xml/objects/object_ma1.xml +- name: objects/object_ma2 + xml_path: assets/xml/objects/object_ma2.xml +- name: objects/object_mag + xml_path: assets/xml/objects/object_mag.xml +- name: objects/object_mamenoki + xml_path: assets/xml/objects/object_mamenoki.xml +- name: objects/object_mastergolon + xml_path: assets/xml/objects/object_mastergolon.xml +- name: objects/object_masterkokiri + xml_path: assets/xml/objects/object_masterkokiri.xml +- name: objects/object_masterkokirihead + xml_path: assets/xml/objects/object_masterkokirihead.xml +- name: objects/object_masterzoora + xml_path: assets/xml/objects/object_masterzoora.xml +- name: objects/object_mb + xml_path: assets/xml/objects/object_mb.xml +- name: objects/object_md + xml_path: assets/xml/objects/object_md.xml +- name: objects/object_medal + xml_path: assets/xml/objects/object_medal.xml +- name: objects/object_menkuri_objects + xml_path: assets/xml/objects/object_menkuri_objects.xml +- name: objects/object_mir_ray + xml_path: assets/xml/objects/object_mir_ray.xml +- name: objects/object_mizu_objects + xml_path: assets/xml/objects/object_mizu_objects.xml +- name: objects/object_mjin + xml_path: assets/xml/objects/object_mjin.xml +- name: objects/object_mjin_dark + xml_path: assets/xml/objects/object_mjin_dark.xml +- name: objects/object_mjin_flame + xml_path: assets/xml/objects/object_mjin_flame.xml +- name: objects/object_mjin_flash + xml_path: assets/xml/objects/object_mjin_flash.xml +- name: objects/object_mjin_ice + xml_path: assets/xml/objects/object_mjin_ice.xml +- name: objects/object_mjin_oka + xml_path: assets/xml/objects/object_mjin_oka.xml +- name: objects/object_mjin_soul + xml_path: assets/xml/objects/object_mjin_soul.xml +- name: objects/object_mjin_wind + xml_path: assets/xml/objects/object_mjin_wind.xml +- name: objects/object_mk + xml_path: assets/xml/objects/object_mk.xml +- name: objects/object_mm + xml_path: assets/xml/objects/object_mm.xml +- name: objects/object_mo + xml_path: assets/xml/objects/object_mo.xml +- name: objects/object_mori_hineri1 + xml_path: assets/xml/objects/object_mori_hineri1.xml +- name: objects/object_mori_hineri1a + xml_path: assets/xml/objects/object_mori_hineri1a.xml +- name: objects/object_mori_hineri2 + xml_path: assets/xml/objects/object_mori_hineri2.xml +- name: objects/object_mori_hineri2a + xml_path: assets/xml/objects/object_mori_hineri2a.xml +- name: objects/object_mori_objects + xml_path: assets/xml/objects/object_mori_objects.xml +- name: objects/object_mori_tex + xml_path: assets/xml/objects/object_mori_tex.xml +- name: objects/object_ms + xml_path: assets/xml/objects/object_ms.xml +- name: objects/object_mu + xml_path: assets/xml/objects/object_mu.xml +- name: objects/object_nb + xml_path: assets/xml/objects/object_nb.xml +- name: objects/object_niw + xml_path: assets/xml/objects/object_niw.xml +- name: objects/object_nwc + xml_path: assets/xml/objects/object_nwc.xml +- name: objects/object_ny + xml_path: assets/xml/objects/object_ny.xml +- name: objects/object_o_anime + xml_path: assets/xml/objects/object_o_anime.xml +- name: objects/object_oA1 + xml_path: assets/xml/objects/object_oA1.xml +- name: objects/object_oA2 + xml_path: assets/xml/objects/object_oA2.xml +- name: objects/object_oA3 + xml_path: assets/xml/objects/object_oA3.xml +- name: objects/object_oA4 + xml_path: assets/xml/objects/object_oA4.xml +- name: objects/object_oA5 + xml_path: assets/xml/objects/object_oA5.xml +- name: objects/object_oA6 + xml_path: assets/xml/objects/object_oA6.xml +- name: objects/object_oA7 + xml_path: assets/xml/objects/object_oA7.xml +- name: objects/object_oA8 + xml_path: assets/xml/objects/object_oA8.xml +- name: objects/object_oA9 + xml_path: assets/xml/objects/object_oA9.xml +- name: objects/object_oA10 + xml_path: assets/xml/objects/object_oA10.xml +- name: objects/object_oA11 + xml_path: assets/xml/objects/object_oA11.xml +- name: objects/object_oB1 + xml_path: assets/xml/objects/object_oB1.xml +- name: objects/object_oB2 + xml_path: assets/xml/objects/object_oB2.xml +- name: objects/object_oB3 + xml_path: assets/xml/objects/object_oB3.xml +- name: objects/object_oB4 + xml_path: assets/xml/objects/object_oB4.xml +- name: objects/object_oE1 + xml_path: assets/xml/objects/object_oE1.xml +- name: objects/object_oE1s + xml_path: assets/xml/objects/object_oE1s.xml +- name: objects/object_oE2 + xml_path: assets/xml/objects/object_oE2.xml +- name: objects/object_oE3 + xml_path: assets/xml/objects/object_oE3.xml +- name: objects/object_oE4 + xml_path: assets/xml/objects/object_oE4.xml +- name: objects/object_oE4s + xml_path: assets/xml/objects/object_oE4s.xml +- name: objects/object_oE5 + xml_path: assets/xml/objects/object_oE5.xml +- name: objects/object_oE6 + xml_path: assets/xml/objects/object_oE6.xml +- name: objects/object_oE7 + xml_path: assets/xml/objects/object_oE7.xml +- name: objects/object_oE8 + xml_path: assets/xml/objects/object_oE8.xml +- name: objects/object_oE9 + xml_path: assets/xml/objects/object_oE9.xml +- name: objects/object_oE10 + xml_path: assets/xml/objects/object_oE10.xml +- name: objects/object_oE11 + xml_path: assets/xml/objects/object_oE11.xml +- name: objects/object_oE12 + xml_path: assets/xml/objects/object_oE12.xml +- name: objects/object_oE_anime + xml_path: assets/xml/objects/object_oE_anime.xml +- name: objects/object_oF1d_map + xml_path: assets/xml/objects/object_oF1d_map.xml +- name: objects/object_oF1s + xml_path: assets/xml/objects/object_oF1s.xml +- name: objects/object_okuta + xml_path: assets/xml/objects/object_okuta.xml +- name: objects/object_opening_demo1 + xml_path: assets/xml/objects/object_opening_demo1.xml +- name: objects/object_os + xml_path: assets/xml/objects/object_os.xml +- name: objects/object_os_anime + xml_path: assets/xml/objects/object_os_anime.xml +- name: objects/object_ossan + xml_path: assets/xml/objects/object_ossan.xml +- name: objects/object_ouke_haka + xml_path: assets/xml/objects/object_ouke_haka.xml +- name: objects/object_owl + xml_path: assets/xml/objects/object_owl.xml +- name: objects/object_peehat + xml_path: assets/xml/objects/object_peehat.xml +- name: objects/object_po_composer + xml_path: assets/xml/objects/object_po_composer.xml +- name: objects/object_po_field + xml_path: assets/xml/objects/object_po_field.xml +- name: objects/object_po_sisters + xml_path: assets/xml/objects/object_po_sisters.xml +- name: objects/object_poh + xml_path: assets/xml/objects/object_poh.xml +- name: objects/object_ps + xml_path: assets/xml/objects/object_ps.xml +- name: objects/object_pu_box + xml_path: assets/xml/objects/object_pu_box.xml +- name: objects/object_rd + xml_path: assets/xml/objects/object_rd.xml +- name: objects/object_reeba + xml_path: assets/xml/objects/object_reeba.xml +- name: objects/object_relay_objects + xml_path: assets/xml/objects/object_relay_objects.xml +- name: objects/object_rl + xml_path: assets/xml/objects/object_rl.xml +- name: objects/object_rr + xml_path: assets/xml/objects/object_rr.xml +- name: objects/object_rs + xml_path: assets/xml/objects/object_rs.xml +- name: objects/object_ru1 + xml_path: assets/xml/objects/object_ru1.xml +- name: objects/object_ru2 + xml_path: assets/xml/objects/object_ru2.xml +- name: objects/object_sa + xml_path: assets/xml/objects/object_sa.xml +- name: objects/object_sb + xml_path: assets/xml/objects/object_sb.xml +- name: objects/object_sd + xml_path: assets/xml/objects/object_sd.xml +- name: objects/object_shop_dungen + xml_path: assets/xml/objects/object_shop_dungen.xml +- name: objects/object_shopnuts + xml_path: assets/xml/objects/object_shopnuts.xml +- name: objects/object_siofuki + xml_path: assets/xml/objects/object_siofuki.xml +- name: objects/object_sk2 + xml_path: assets/xml/objects/object_sk2.xml +- name: objects/object_skb + xml_path: assets/xml/objects/object_skb.xml +- name: objects/object_skj + xml_path: assets/xml/objects/object_skj.xml +- name: objects/object_spot00_break + xml_path: assets/xml/objects/object_spot00_break.xml +- name: objects/object_spot00_objects + xml_path: assets/xml/objects/object_spot00_objects.xml +- name: objects/object_spot01_matoya + xml_path: assets/xml/objects/object_spot01_matoya.xml +- name: objects/object_spot01_matoyab + xml_path: assets/xml/objects/object_spot01_matoyab.xml +- name: objects/object_spot01_objects + xml_path: assets/xml/objects/object_spot01_objects.xml +- name: objects/object_spot01_objects2 + xml_path: assets/xml/objects/object_spot01_objects2.xml +- name: objects/object_spot02_objects + xml_path: assets/xml/objects/object_spot02_objects.xml +- name: objects/object_spot03_object + xml_path: assets/xml/objects/object_spot03_object.xml +- name: objects/object_spot04_objects + xml_path: assets/xml/objects/object_spot04_objects.xml +- name: objects/object_spot05_objects + xml_path: assets/xml/objects/object_spot05_objects.xml +- name: objects/object_spot06_objects + xml_path: assets/xml/objects/object_spot06_objects.xml +- name: objects/object_spot07_object + xml_path: assets/xml/objects/object_spot07_object.xml +- name: objects/object_spot08_obj + xml_path: assets/xml/objects/object_spot08_obj.xml +- name: objects/object_spot09_obj + xml_path: assets/xml/objects/object_spot09_obj.xml +- name: objects/object_spot11_obj + xml_path: assets/xml/objects/object_spot11_obj.xml +- name: objects/object_spot12_obj + xml_path: assets/xml/objects/object_spot12_obj.xml +- name: objects/object_spot15_obj + xml_path: assets/xml/objects/object_spot15_obj.xml +- name: objects/object_spot16_obj + xml_path: assets/xml/objects/object_spot16_obj.xml +- name: objects/object_spot17_obj + xml_path: assets/xml/objects/object_spot17_obj.xml +- name: objects/object_spot18_obj + xml_path: assets/xml/objects/object_spot18_obj.xml +- name: objects/object_ssh + xml_path: assets/xml/objects/object_ssh.xml +- name: objects/object_sst + xml_path: assets/xml/objects/object_sst.xml +- name: objects/object_st + xml_path: assets/xml/objects/object_st.xml +- name: objects/object_stream + xml_path: assets/xml/objects/object_stream.xml +- name: objects/object_syokudai + xml_path: assets/xml/objects/object_syokudai.xml +- name: objects/object_ta + xml_path: assets/xml/objects/object_ta.xml +- name: objects/object_timeblock + xml_path: assets/xml/objects/object_timeblock.xml +- name: objects/object_tite + xml_path: assets/xml/objects/object_tite.xml +- name: objects/object_tk + xml_path: assets/xml/objects/object_tk.xml +- name: objects/object_toki_objects + xml_path: assets/xml/objects/object_toki_objects.xml +- name: objects/object_torch2 + xml_path: assets/xml/objects/object_torch2.xml +- name: objects/object_toryo + xml_path: assets/xml/objects/object_toryo.xml +- name: objects/object_tp + xml_path: assets/xml/objects/object_tp.xml +- name: objects/object_tr + xml_path: assets/xml/objects/object_tr.xml +- name: objects/object_trap + xml_path: assets/xml/objects/object_trap.xml +- name: objects/object_triforce_spot + xml_path: assets/xml/objects/object_triforce_spot.xml +- name: objects/object_ts + xml_path: assets/xml/objects/object_ts.xml +- name: objects/object_tsubo + xml_path: assets/xml/objects/object_tsubo.xml +- name: objects/object_tw + xml_path: assets/xml/objects/object_tw.xml +- name: objects/object_umajump + xml_path: assets/xml/objects/object_umajump.xml +- name: objects/object_vali + xml_path: assets/xml/objects/object_vali.xml +- name: objects/object_vase + xml_path: assets/xml/objects/object_vase.xml +- name: objects/object_vm + xml_path: assets/xml/objects/object_vm.xml +- name: objects/object_wallmaster + xml_path: assets/xml/objects/object_wallmaster.xml +- name: objects/object_warp1 + xml_path: assets/xml/objects/object_warp1.xml +- name: objects/object_warp2 + xml_path: assets/xml/objects/object_warp2.xml +- name: objects/object_wf + xml_path: assets/xml/objects/object_wf.xml +- name: objects/object_wood02 + xml_path: assets/xml/objects/object_wood02.xml +- name: objects/object_xc + xml_path: assets/xml/objects/object_xc.xml +- name: objects/object_yabusame_point + xml_path: assets/xml/objects/object_yabusame_point.xml +- name: objects/object_ydan_objects + xml_path: assets/xml/objects/object_ydan_objects.xml +- name: objects/object_yukabyun + xml_path: assets/xml/objects/object_yukabyun.xml +- name: objects/object_zf + xml_path: assets/xml/objects/object_zf.xml +- name: objects/object_zg + xml_path: assets/xml/objects/object_zg.xml +- name: objects/object_zl1 + xml_path: assets/xml/objects/object_zl1.xml +- name: objects/object_zl2 + xml_path: assets/xml/objects/object_zl2.xml +- name: objects/object_zl2_anime1 + xml_path: assets/xml/objects/object_zl2_anime1.xml +- name: objects/object_zl2_anime2 + xml_path: assets/xml/objects/object_zl2_anime2.xml +- name: objects/object_zl4 + xml_path: assets/xml/objects/object_zl4.xml +- name: objects/object_zo + xml_path: assets/xml/objects/object_zo.xml +- name: overlays/ovl_Arrow_Fire + xml_path: assets/xml/overlays/ovl_Arrow_Fire.xml + start_offset: 0x960 + end_offset: 0x1D80 +- name: overlays/ovl_Arrow_Ice + xml_path: assets/xml/overlays/ovl_Arrow_Ice.xml + start_offset: 0x980 + end_offset: 0x1DA0 +- name: overlays/ovl_Arrow_Light + xml_path: assets/xml/overlays/ovl_Arrow_Light.xml + start_offset: 0x990 + end_offset: 0x1DB0 +- name: overlays/ovl_Bg_Ganon_Otyuka + xml_path: assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml + start_offset: 0x1110 + end_offset: 0x24EC +- name: overlays/ovl_Bg_Jya_Cobra + xml_path: assets/xml/overlays/ovl_Bg_Jya_Cobra.xml + start_offset: 0x1830 + end_offset: 0x18A8 +- name: overlays/ovl_Boss_Dodongo + xml_path: assets/xml/overlays/ovl_Boss_Dodongo.xml + start_offset: 0x61C8 + end_offset: 0x91C8 +- name: overlays/ovl_Boss_Ganon + xml_path: assets/xml/overlays/ovl_Boss_Ganon.xml + start_offset: 0xE388 + end_offset: 0x20EA8 +- name: overlays/ovl_Boss_Ganon2 + xml_path: assets/xml/overlays/ovl_Boss_Ganon2.xml + start_offset: 0x9F38 + end_offset: 0x103E8 +- name: overlays/ovl_Boss_Sst + xml_path: assets/xml/overlays/ovl_Boss_Sst.xml + start_offset: 0xA370 + end_offset: 0xAD20 +- name: overlays/ovl_Demo_Shd + xml_path: assets/xml/overlays/ovl_Demo_Shd.xml + start_offset: 0x410 + end_offset: 0x2390 +- name: overlays/ovl_Effect_Ss_Fhg_Flash + xml_path: assets/xml/overlays/ovl_Effect_Ss_Fhg_Flash.xml + start_offset: 0x9F0 + end_offset: 0xEA8 +- name: overlays/ovl_En_Bili + xml_path: assets/xml/overlays/ovl_En_Bili.xml + start_offset: 0x1E40 + end_offset: 0x1E60 +- name: overlays/ovl_En_Clear_Tag + xml_path: assets/xml/overlays/ovl_En_Clear_Tag.xml + start_offset: 0x2600 + end_offset: 0x8900 +- name: overlays/ovl_En_Ganon_Mant + xml_path: assets/xml/overlays/ovl_En_Ganon_Mant.xml + start_offset: 0x11E8 + end_offset: 0x40E8 +- name: overlays/ovl_En_Ganon_Organ + xml_path: assets/xml/overlays/ovl_En_Ganon_Organ.xml + start_offset: 0x328 + end_offset: 0x6EB0 +- name: overlays/ovl_En_Holl + xml_path: assets/xml/overlays/ovl_En_Holl.xml + start_offset: 0xE68 + end_offset: 0xED0 +- name: overlays/ovl_En_Jsjutan + xml_path: assets/xml/overlays/ovl_En_Jsjutan.xml + start_offset: 0x12B8 + end_offset: 0x4C50 +- name: overlays/ovl_En_Kanban + xml_path: assets/xml/overlays/ovl_En_Kanban.xml + start_offset: 0x2E70 + end_offset: 0x2F30 +- name: overlays/ovl_En_Sda + xml_path: assets/xml/overlays/ovl_En_Sda.xml + start_offset: 0x14A8 + end_offset: 0x1538 +- name: overlays/ovl_En_Ssh + xml_path: assets/xml/overlays/ovl_En_Ssh.xml + start_offset: 0x2150 + end_offset: 0x21E0 +- name: overlays/ovl_En_St + xml_path: assets/xml/overlays/ovl_En_St.xml + start_offset: 0x26A0 + end_offset: 0x2730 +- name: overlays/ovl_En_Sth + xml_path: assets/xml/overlays/ovl_En_Sth.xml + start_offset: 0xE60 + end_offset: 0x3E34 +- name: overlays/ovl_End_Title + xml_path: assets/xml/overlays/ovl_End_Title.xml + start_offset: 0x6F0 + end_offset: 0x4098 +- name: overlays/ovl_file_choose + xml_path: assets/xml/overlays/ovl_file_choose.xml + start_offset: 0xEC50 + end_offset: 0xF330 +- name: overlays/ovl_Magic_Dark + xml_path: assets/xml/overlays/ovl_Magic_Dark.xml + start_offset: 0xC90 + end_offset: 0x16C0 +- name: overlays/ovl_Magic_Fire + xml_path: assets/xml/overlays/ovl_Magic_Fire.xml + start_offset: 0xB20 + end_offset: 0x2170 +- name: overlays/ovl_Magic_Wind + xml_path: assets/xml/overlays/ovl_Magic_Wind.xml + start_offset: 0x6A0 + end_offset: 0x1BB8 +- name: overlays/ovl_Oceff_Spot + xml_path: assets/xml/overlays/ovl_Oceff_Spot.xml + start_offset: 0x780 + end_offset: 0xE58 +- name: overlays/ovl_Oceff_Storm + xml_path: assets/xml/overlays/ovl_Oceff_Storm.xml + start_offset: 0x740 + end_offset: 0x1AD0 +- name: overlays/ovl_Oceff_Wipe + xml_path: assets/xml/overlays/ovl_Oceff_Wipe.xml + start_offset: 0x4F0 + end_offset: 0xCB0 +- name: overlays/ovl_Oceff_Wipe2 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe2.xml + start_offset: 0x430 + end_offset: 0x1698 +- name: overlays/ovl_Oceff_Wipe3 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe3.xml + start_offset: 0x430 + end_offset: 0x1678 +- name: overlays/ovl_Oceff_Wipe4 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe4.xml + start_offset: 0x410 + end_offset: 0xEF8 +- name: scenes/dungeons/bdan + xml_path: assets/xml/scenes/dungeons/bdan.xml +- name: scenes/dungeons/bdan_boss + xml_path: assets/xml/scenes/dungeons/bdan_boss.xml +- name: scenes/dungeons/Bmori1 + xml_path: assets/xml/scenes/dungeons/Bmori1.xml +- name: scenes/dungeons/ddan + xml_path: assets/xml/scenes/dungeons/ddan.xml +- name: scenes/dungeons/ddan_boss + xml_path: assets/xml/scenes/dungeons/ddan_boss_v2.xml +- name: scenes/dungeons/FIRE_bs + xml_path: assets/xml/scenes/dungeons/FIRE_bs.xml +- name: scenes/dungeons/ganon + xml_path: assets/xml/scenes/dungeons/ganon.xml +- name: scenes/dungeons/ganon_boss + xml_path: assets/xml/scenes/dungeons/ganon_boss.xml +- name: scenes/dungeons/ganon_demo + xml_path: assets/xml/scenes/dungeons/ganon_demo.xml +- name: scenes/dungeons/ganon_final + xml_path: assets/xml/scenes/dungeons/ganon_final.xml +- name: scenes/dungeons/ganon_sonogo + xml_path: assets/xml/scenes/dungeons/ganon_sonogo.xml +- name: scenes/dungeons/ganontika + xml_path: assets/xml/scenes/dungeons/ganontika.xml +- name: scenes/dungeons/ganontikasonogo + xml_path: assets/xml/scenes/dungeons/ganontikasonogo.xml +- name: scenes/dungeons/gerudoway + xml_path: assets/xml/scenes/dungeons/gerudoway.xml +- name: scenes/dungeons/HAKAdan + xml_path: assets/xml/scenes/dungeons/HAKAdan.xml +- name: scenes/dungeons/HAKAdan_bs + xml_path: assets/xml/scenes/dungeons/HAKAdan_bs.xml +- name: scenes/dungeons/HAKAdanCH + xml_path: assets/xml/scenes/dungeons/HAKAdanCH.xml +- name: scenes/dungeons/HIDAN + xml_path: assets/xml/scenes/dungeons/HIDAN.xml +- name: scenes/dungeons/ice_doukutu + xml_path: assets/xml/scenes/dungeons/ice_doukutu_v2.xml +- name: scenes/dungeons/jyasinboss + xml_path: assets/xml/scenes/dungeons/jyasinboss.xml +- name: scenes/dungeons/jyasinzou + xml_path: assets/xml/scenes/dungeons/jyasinzou.xml +- name: scenes/dungeons/men + xml_path: assets/xml/scenes/dungeons/men.xml +- name: scenes/dungeons/MIZUsin + xml_path: assets/xml/scenes/dungeons/MIZUsin.xml +- name: scenes/dungeons/MIZUsin_bs + xml_path: assets/xml/scenes/dungeons/MIZUsin_bs.xml +- name: scenes/dungeons/moribossroom + xml_path: assets/xml/scenes/dungeons/moribossroom.xml +- name: scenes/dungeons/ydan + xml_path: assets/xml/scenes/dungeons/ydan.xml +- name: scenes/dungeons/ydan_boss + xml_path: assets/xml/scenes/dungeons/ydan_boss.xml +- name: scenes/indoors/bowling + xml_path: assets/xml/scenes/indoors/bowling.xml +- name: scenes/indoors/daiyousei_izumi + xml_path: assets/xml/scenes/indoors/daiyousei_izumi.xml +- name: scenes/indoors/hairal_niwa + xml_path: assets/xml/scenes/indoors/hairal_niwa.xml +- name: scenes/indoors/hairal_niwa_n + xml_path: assets/xml/scenes/indoors/hairal_niwa_n.xml +- name: scenes/indoors/hakasitarelay + xml_path: assets/xml/scenes/indoors/hakasitarelay.xml +- name: scenes/indoors/hut + xml_path: assets/xml/scenes/indoors/hut.xml +- name: scenes/indoors/hylia_labo + xml_path: assets/xml/scenes/indoors/hylia_labo.xml +- name: scenes/indoors/impa + xml_path: assets/xml/scenes/indoors/impa.xml +- name: scenes/indoors/kakariko + xml_path: assets/xml/scenes/indoors/kakariko.xml +- name: scenes/indoors/kenjyanoma + xml_path: assets/xml/scenes/indoors/kenjyanoma.xml +- name: scenes/indoors/kokiri_home + xml_path: assets/xml/scenes/indoors/kokiri_home.xml +- name: scenes/indoors/kokiri_home3 + xml_path: assets/xml/scenes/indoors/kokiri_home3.xml +- name: scenes/indoors/kokiri_home4 + xml_path: assets/xml/scenes/indoors/kokiri_home4.xml +- name: scenes/indoors/kokiri_home5 + xml_path: assets/xml/scenes/indoors/kokiri_home5.xml +- name: scenes/indoors/labo + xml_path: assets/xml/scenes/indoors/labo.xml +- name: scenes/indoors/link_home + xml_path: assets/xml/scenes/indoors/link_home.xml +- name: scenes/indoors/mahouya + xml_path: assets/xml/scenes/indoors/mahouya.xml +- name: scenes/indoors/malon_stable + xml_path: assets/xml/scenes/indoors/malon_stable.xml +- name: scenes/indoors/miharigoya + xml_path: assets/xml/scenes/indoors/miharigoya.xml +- name: scenes/indoors/nakaniwa + xml_path: assets/xml/scenes/indoors/nakaniwa.xml +- name: scenes/indoors/souko + xml_path: assets/xml/scenes/indoors/souko.xml +- name: scenes/indoors/syatekijyou + xml_path: assets/xml/scenes/indoors/syatekijyou.xml +- name: scenes/indoors/takaraya + xml_path: assets/xml/scenes/indoors/takaraya.xml +- name: scenes/indoors/tent + xml_path: assets/xml/scenes/indoors/tent.xml +- name: scenes/indoors/tokinoma + xml_path: assets/xml/scenes/indoors/tokinoma.xml +- name: scenes/indoors/yousei_izumi_tate + xml_path: assets/xml/scenes/indoors/yousei_izumi_tate.xml +- name: scenes/indoors/yousei_izumi_yoko + xml_path: assets/xml/scenes/indoors/yousei_izumi_yoko.xml +- name: scenes/misc/enrui + xml_path: assets/xml/scenes/misc/enrui.xml +- name: scenes/misc/entra + xml_path: assets/xml/scenes/misc/entra.xml +- name: scenes/misc/entra_n + xml_path: assets/xml/scenes/misc/entra_n.xml +- name: scenes/misc/hakaana + xml_path: assets/xml/scenes/misc/hakaana.xml +- name: scenes/misc/hakaana2 + xml_path: assets/xml/scenes/misc/hakaana2.xml +- name: scenes/misc/hakaana_ouke + xml_path: assets/xml/scenes/misc/hakaana_ouke.xml +- name: scenes/misc/hiral_demo + xml_path: assets/xml/scenes/misc/hiral_demo.xml +- name: scenes/misc/kakariko3 + xml_path: assets/xml/scenes/misc/kakariko3.xml +- name: scenes/misc/kakusiana + xml_path: assets/xml/scenes/misc/kakusiana.xml +- name: scenes/misc/kinsuta + xml_path: assets/xml/scenes/misc/kinsuta.xml +- name: scenes/misc/market_alley + xml_path: assets/xml/scenes/misc/market_alley.xml +- name: scenes/misc/market_alley_n + xml_path: assets/xml/scenes/misc/market_alley_n.xml +- name: scenes/misc/market_day + xml_path: assets/xml/scenes/misc/market_day.xml +- name: scenes/misc/market_night + xml_path: assets/xml/scenes/misc/market_night.xml +- name: scenes/misc/market_ruins + xml_path: assets/xml/scenes/misc/market_ruins.xml +- name: scenes/misc/shrine + xml_path: assets/xml/scenes/misc/shrine.xml +- name: scenes/misc/shrine_n + xml_path: assets/xml/scenes/misc/shrine_n.xml +- name: scenes/misc/shrine_r + xml_path: assets/xml/scenes/misc/shrine_r.xml +- name: scenes/misc/turibori + xml_path: assets/xml/scenes/misc/turibori.xml +- name: scenes/overworld/ganon_tou + xml_path: assets/xml/scenes/overworld/ganon_tou.xml +- name: scenes/overworld/spot00 + xml_path: assets/xml/scenes/overworld/spot00.xml +- name: scenes/overworld/spot01 + xml_path: assets/xml/scenes/overworld/spot01.xml +- name: scenes/overworld/spot02 + xml_path: assets/xml/scenes/overworld/spot02.xml +- name: scenes/overworld/spot03 + xml_path: assets/xml/scenes/overworld/spot03.xml +- name: scenes/overworld/spot04 + xml_path: assets/xml/scenes/overworld/spot04.xml +- name: scenes/overworld/spot05 + xml_path: assets/xml/scenes/overworld/spot05.xml +- name: scenes/overworld/spot06 + xml_path: assets/xml/scenes/overworld/spot06.xml +- name: scenes/overworld/spot07 + xml_path: assets/xml/scenes/overworld/spot07.xml +- name: scenes/overworld/spot08 + xml_path: assets/xml/scenes/overworld/spot08.xml +- name: scenes/overworld/spot09 + xml_path: assets/xml/scenes/overworld/spot09.xml +- name: scenes/overworld/spot10 + xml_path: assets/xml/scenes/overworld/spot10.xml +- name: scenes/overworld/spot11 + xml_path: assets/xml/scenes/overworld/spot11.xml +- name: scenes/overworld/spot12 + xml_path: assets/xml/scenes/overworld/spot12.xml +- name: scenes/overworld/spot13 + xml_path: assets/xml/scenes/overworld/spot13.xml +- name: scenes/overworld/spot15 + xml_path: assets/xml/scenes/overworld/spot15.xml +- name: scenes/overworld/spot16 + xml_path: assets/xml/scenes/overworld/spot16_v2.xml +- name: scenes/overworld/spot17 + xml_path: assets/xml/scenes/overworld/spot17.xml +- name: scenes/overworld/spot18 + xml_path: assets/xml/scenes/overworld/spot18.xml +- name: scenes/overworld/spot20 + xml_path: assets/xml/scenes/overworld/spot20.xml +- name: scenes/shops/alley_shop + xml_path: assets/xml/scenes/shops/alley_shop.xml +- name: scenes/shops/drag + xml_path: assets/xml/scenes/shops/drag.xml +- name: scenes/shops/face_shop + xml_path: assets/xml/scenes/shops/face_shop.xml +- name: scenes/shops/golon + xml_path: assets/xml/scenes/shops/golon.xml +- name: scenes/shops/kokiri_shop + xml_path: assets/xml/scenes/shops/kokiri_shop.xml +- name: scenes/shops/night_shop + xml_path: assets/xml/scenes/shops/night_shop.xml +- name: scenes/shops/shop1 + xml_path: assets/xml/scenes/shops/shop1.xml +- name: scenes/shops/zoora + xml_path: assets/xml/scenes/shops/zoora.xml +- name: textures/backgrounds + xml_path: assets/xml/textures/backgrounds.xml +- name: textures/do_action_static + xml_path: assets/xml/textures/do_action_static.xml +- name: textures/icon_item_24_static + xml_path: assets/xml/textures/icon_item_24_static.xml +- name: textures/icon_item_dungeon_static + xml_path: assets/xml/textures/icon_item_dungeon_static.xml +- name: textures/icon_item_field_static + xml_path: assets/xml/textures/icon_item_field_static.xml +- name: textures/icon_item_gameover_static + xml_path: assets/xml/textures/icon_item_gameover_static.xml +- name: textures/icon_item_jpn_static + xml_path: assets/xml/textures/icon_item_jpn_static.xml +- name: textures/icon_item_nes_static + xml_path: assets/xml/textures/icon_item_nes_static.xml +- name: textures/icon_item_static + xml_path: assets/xml/textures/icon_item_static.xml +- name: textures/item_name_static + xml_path: assets/xml/textures/item_name_static.xml +- name: textures/kanji + xml_path: assets/xml/textures/kanji.xml +- name: textures/map_48x85_static + xml_path: assets/xml/textures/map_48x85_static.xml +- name: textures/map_grand_static + xml_path: assets/xml/textures/map_grand_static.xml +- name: textures/map_i_static + xml_path: assets/xml/textures/map_i_static.xml +- name: textures/map_name_static + xml_path: assets/xml/textures/map_name_static.xml +- name: textures/message_static + xml_path: assets/xml/textures/message_static.xml +- name: textures/message_texture_static + xml_path: assets/xml/textures/message_texture_static.xml +- name: textures/nes_font_static + xml_path: assets/xml/textures/nes_font_static.xml +- name: textures/nintendo_rogo_static + xml_path: assets/xml/textures/nintendo_rogo_static_v2.xml +- name: textures/parameter_static + xml_path: assets/xml/textures/parameter_static.xml +- name: textures/place_title_cards + xml_path: assets/xml/textures/place_title_cards.xml +- name: textures/skyboxes + xml_path: assets/xml/textures/skyboxes.xml +- name: textures/title_static + xml_path: assets/xml/textures/title_static.xml diff --git a/baseroms/ntsc-1.2/segments.csv b/baseroms/ntsc-1.2/segments.csv new file mode 100644 index 0000000000..7bee5f379c --- /dev/null +++ b/baseroms/ntsc-1.2/segments.csv @@ -0,0 +1,1511 @@ +Name,VRAM start +makerom,80000000 +boot,80000460 +dmadata, +Audiobank, +Audioseq, +Audiotable, +kanji, +link_animetion, +icon_item_static, +icon_item_24_static, +icon_item_field_static, +icon_item_dungeon_static, +icon_item_gameover_static, +icon_item_jpn_static, +icon_item_nes_static, +item_name_static, +map_name_static, +do_action_static, +message_static, +message_texture_static, +nes_font_static, +jpn_message_data_static, +nes_message_data_static, +staff_message_data_static, +map_grand_static, +map_i_static, +map_48x85_static, +code,800116E0 +n64dd,801C7740 +ovl_title,80800000 +ovl_select,808009C0 +ovl_opening,80803720 +ovl_file_choose,80803880 +ovl_kaleido_scope,808137C0 +ovl_player_actor,808301C0 +ovl_map_mark_data,80856900 +ovl_En_Test,8085D460 +ovl_En_GirlA,80862D10 +ovl_En_Part,80865630 +ovl_En_Light,80866C40 +ovl_En_Door,80867A30 +ovl_En_Box,80868870 +ovl_En_Poh,8086A3B0 +ovl_En_Okuta,8086E540 +ovl_En_Bom,80870B20 +ovl_En_Wallmas,808719F0 +ovl_En_Dodongo,80873400 +ovl_En_Firefly,808761A0 +ovl_En_Horse,80878310 +ovl_En_Arrow,80884570 +ovl_En_Elf,80885C60 +ovl_En_Niw,8088A620 +ovl_En_Tite,8088D950 +ovl_En_Reeba,808906F0 +ovl_En_Peehat,80892160 +ovl_En_Holl,80895860 +ovl_En_Scene_Change,80896830 +ovl_En_Zf,80896960 +ovl_En_Hata,8089D460 +ovl_Boss_Dodongo,8089D9F0 +ovl_Boss_Goma,808A74D0 +ovl_En_Zl1,808AD450 +ovl_En_Viewer,808B1250 +ovl_En_Goma,808B4120 +ovl_Bg_Pushbox,808B6DB0 +ovl_En_Bubble,808B70B0 +ovl_Door_Shutter,808B84D0 +ovl_En_Dodojr,808BA750 +ovl_En_Bdfire,808BC5F0 +ovl_En_Boom,808BD180 +ovl_En_Torch2,808BDA40 +ovl_En_Bili,808C01E0 +ovl_En_Tp,808C24B0 +ovl_En_St,808C4300 +ovl_En_Bw,808C6F70 +ovl_En_Eiyer,808CA2E0 +ovl_En_River_Sound,808CBF40 +ovl_En_Horse_Normal,808CC8D0 +ovl_En_Ossan,808CEEF0 +ovl_Bg_Treemouth,808D54D0 +ovl_Bg_Dodoago,808D6B30 +ovl_Bg_Hidan_Dalm,808D78E0 +ovl_Bg_Hidan_Hrock,808D8130 +ovl_En_Horse_Ganon,808D8960 +ovl_Bg_Hidan_Rock,808D96E0 +ovl_Bg_Hidan_Rsekizou,808DA7D0 +ovl_Bg_Hidan_Sekizou,808DB3B0 +ovl_Bg_Hidan_Sima,808DC800 +ovl_Bg_Hidan_Syoku,808DD720 +ovl_En_Xc,808DDB80 +ovl_Bg_Hidan_Curtain,808E4310 +ovl_Bg_Spot00_Hanebasi,808E4DB0 +ovl_En_Mb,808E5EC0 +ovl_En_Bombf,808EA0F0 +ovl_Bg_Hidan_Firewall,808EB560 +ovl_Bg_Dy_Yoseizo,808EBCC0 +ovl_En_Zl2,808EEAC0 +ovl_Bg_Hidan_Fslift,808F31F0 +ovl_En_OE2,808F36C0 +ovl_Bg_Ydan_Hasi,808F37A0 +ovl_Bg_Ydan_Maruta,808F3F50 +ovl_Boss_Ganondrof,808F4630 +ovl_En_Am,808F93A0 +ovl_En_Dekubaba,808FB7A0 +ovl_En_M_Fire1,808FF240 +ovl_En_M_Thunder,808FF3E0 +ovl_Bg_Ddan_Jd,809009D0 +ovl_Bg_Breakwall,80901020 +ovl_En_Jj,80901E90 +ovl_En_Horse_Zelda,80903460 +ovl_Bg_Ddan_Kd,80903F50 +ovl_Door_Warp1,80904840 +ovl_Obj_Syokudai,80908AF0 +ovl_Item_B_Heart,80909730 +ovl_En_Dekunuts,80909B20 +ovl_Bg_Menkuri_Kaiten,8090B320 +ovl_Bg_Menkuri_Eye,8090B4B0 +ovl_En_Vali,8090B950 +ovl_Bg_Mizu_Movebg,8090DFF0 +ovl_Bg_Mizu_Water,8090F190 +ovl_Arms_Hook,8090FE60 +ovl_En_fHG,80910BC0 +ovl_Bg_Mori_Hineri,809134F0 +ovl_En_Bb,809141F0 +ovl_Bg_Toki_Hikari,80917EC0 +ovl_En_Yukabyun,80918C60 +ovl_Bg_Toki_Swd,80919270 +ovl_En_Fhg_Fire,8091A8C0 +ovl_Bg_Mjin,8091CEE0 +ovl_Bg_Hidan_Kousi,8091D2C0 +ovl_Door_Toki,8091D840 +ovl_Bg_Hidan_Hamstep,8091D9A0 +ovl_En_Bird,8091E850 +ovl_En_Wood02,8091ED10 +ovl_En_Lightbox,8091FEF0 +ovl_En_Pu_box,80920370 +ovl_En_Trap,809206B0 +ovl_En_Arow_Trap,80921950 +ovl_En_Vase,80921AA0 +ovl_En_Ta,80921BA0 +ovl_En_Tk,80925560 +ovl_Bg_Mori_Bigst,80927390 +ovl_Bg_Mori_Elevator,80927CC0 +ovl_Bg_Mori_Kaitenkabe,809287B0 +ovl_Bg_Mori_Rakkatenjo,80928E10 +ovl_En_Vm,80929780 +ovl_Demo_Effect,8092B030 +ovl_Demo_Kankyo,80930B20 +ovl_Bg_Hidan_Fwbig,80934820 +ovl_En_Floormas,80935500 +ovl_En_Heishi1,809388E0 +ovl_En_Rd,80939DF0 +ovl_En_Po_Sisters,8093C6A0 +ovl_Bg_Heavy_Block,80941390 +ovl_Bg_Po_Event,80942C80 +ovl_Obj_Mure,80944AC0 +ovl_En_Sw,80945AD0 +ovl_Boss_Fd,809492C0 +ovl_Object_Kankyo,809505F0 +ovl_En_Du,80953810 +ovl_En_Fd,809552B0 +ovl_En_Horse_Link_Child,80957F70 +ovl_Door_Ana,80959D70 +ovl_Bg_Spot02_Objects,8095A3E0 +ovl_Bg_Haka,8095B730 +ovl_Magic_Wind,8095BDF0 +ovl_Magic_Fire,8095DAF0 +ovl_En_Ru1,8095FDC0 +ovl_Boss_Fd2,80967460 +ovl_En_Fd_Fire,8096B190 +ovl_En_Dh,8096BEA0 +ovl_En_Dha,8096D970 +ovl_En_Rl,8096E970 +ovl_En_Encount1,8096F850 +ovl_Demo_Du,809703B0 +ovl_Demo_Im,80973B90 +ovl_Demo_Tre_Lgt,80977B00 +ovl_En_Fw,80978210 +ovl_Bg_Vb_Sima,809799C0 +ovl_En_Vb_Ball,8097A0D0 +ovl_Bg_Haka_Megane,8097B270 +ovl_Bg_Haka_MeganeBG,8097B670 +ovl_Bg_Haka_Ship,8097BD30 +ovl_Bg_Haka_Sgami,8097C770 +ovl_En_Heishi2,8097D390 +ovl_En_Encount2,8097F590 +ovl_En_Fire_Rock,809807C0 +ovl_En_Brob,809818D0 +ovl_Mir_Ray,809829C0 +ovl_Bg_Spot09_Obj,80984280 +ovl_Bg_Spot18_Obj,80984790 +ovl_Boss_Va,80985060 +ovl_Bg_Haka_Tubo,8099C250 +ovl_Bg_Haka_Trap,8099CC70 +ovl_Bg_Haka_Huta,8099E240 +ovl_Bg_Haka_Zou,8099ECE0 +ovl_Bg_Spot17_Funen,8099FED0 +ovl_En_Syateki_Itm,809A0120 +ovl_En_Syateki_Man,809A0EC0 +ovl_En_Tana,809A1C80 +ovl_En_Nb,809A1F20 +ovl_Boss_Mo,809A64F0 +ovl_En_Sb,809B65A0 +ovl_En_Bigokuta,809B79E0 +ovl_En_Karebaba,809BA4F0 +ovl_Bg_Bdan_Objects,809BBDE0 +ovl_Demo_Sa,809BD0B0 +ovl_Demo_Go,809BFBD0 +ovl_En_In,809C0930 +ovl_En_Tr,809C36D0 +ovl_Bg_Spot16_Bombstone,809C4FD0 +ovl_Bg_Hidan_Kowarerukabe,809C6510 +ovl_Bg_Bombwall,809C73E0 +ovl_En_Ru2,809C7CA0 +ovl_Obj_Dekujr,809CAA20 +ovl_Bg_Mizu_Uzu,809CB060 +ovl_Bg_Spot06_Objects,809CB230 +ovl_Bg_Ice_Objects,809CC640 +ovl_Bg_Haka_Water,809CD580 +ovl_En_Ma2,809CDD60 +ovl_En_Bom_Chu,809CEDC0 +ovl_En_Horse_Game_Check,809D0460 +ovl_Boss_Tw,809D1530 +ovl_En_Rr,809E7030 +ovl_En_Ba,809E9560 +ovl_En_Bx,809EB430 +ovl_En_Anubice,809EBF20 +ovl_En_Anubice_Fire,809ED1D0 +ovl_Bg_Mori_Hashigo,809EDF90 +ovl_Bg_Mori_Hashira4,809EE850 +ovl_Bg_Mori_Idomizu,809EEDE0 +ovl_Bg_Spot16_Doughnut,809EF420 +ovl_Bg_Bdan_Switch,809EF9D0 +ovl_En_Ma1,809F0E00 +ovl_Boss_Ganon,809F20E0 +ovl_Boss_Sst,80A17EC0 +ovl_En_Ny,80A24480 +ovl_En_Fr,80A25DB0 +ovl_Item_Shield,80A28840 +ovl_Bg_Ice_Shelter,80A29250 +ovl_En_Ice_Hono,80A2A480 +ovl_Item_Ocarina,80A2B670 +ovl_Magic_Dark,80A2BE40 +ovl_Demo_6K,80A2D690 +ovl_En_Anubice_Tag,80A303A0 +ovl_Bg_Haka_Gate,80A30670 +ovl_Bg_Spot15_Saku,80A31700 +ovl_Bg_Jya_Goroiwa,80A31A40 +ovl_Bg_Jya_Zurerukabe,80A321C0 +ovl_Bg_Jya_Cobra,80A32870 +ovl_Bg_Jya_Kanaami,80A34590 +ovl_Fishing,80A34940 +ovl_Obj_Oshihiki,80A4F3F0 +ovl_Bg_Gate_Shutter,80A50EA0 +ovl_Eff_Dust,80A51320 +ovl_Bg_Spot01_Fusya,80A52700 +ovl_Bg_Spot01_Idohashira,80A529A0 +ovl_Bg_Spot01_Idomizu,80A535A0 +ovl_Bg_Po_Syokudai,80A538B0 +ovl_Bg_Ganon_Otyuka,80A54200 +ovl_Bg_Spot15_Rrbox,80A56840 +ovl_Bg_Umajump,80A57620 +ovl_En_Insect,80A577B0 +ovl_En_Butte,80A59CD0 +ovl_En_Fish,80A5B2A0 +ovl_Bg_Spot08_Iceblock,80A5D3B0 +ovl_Item_Etcetera,80A5E3F0 +ovl_Arrow_Fire,80A5ECC0 +ovl_Arrow_Ice,80A60B80 +ovl_Arrow_Light,80A62A60 +ovl_Obj_Kibako,80A64950 +ovl_Obj_Tsubo,80A65650 +ovl_En_Wonder_Item,80A66640 +ovl_En_Ik,80A67370 +ovl_Demo_Ik,80A6B9B0 +ovl_En_Skj,80A6CEC0 +ovl_En_Skjneedle,80A70800 +ovl_En_G_Switch,80A70B10 +ovl_Demo_Ext,80A72340 +ovl_Demo_Shd,80A72C80 +ovl_En_Dns,80A75090 +ovl_Elf_Msg,80A76420 +ovl_En_Honotrap,80A76A10 +ovl_En_Tubo_Trap,80A77F60 +ovl_Obj_Ice_Poly,80A78C00 +ovl_Bg_Spot03_Taki,80A795B0 +ovl_Bg_Spot07_Taki,80A79EA0 +ovl_En_Fz,80A7A460 +ovl_En_Po_Relay,80A7C470 +ovl_Bg_Relay_Objects,80A7DB80 +ovl_En_Diving_Game,80A7E330 +ovl_En_Kusa,80A7FCE0 +ovl_Obj_Bean,80A811C0 +ovl_Obj_Bombiwa,80A83950 +ovl_Obj_Switch,80A83EC0 +ovl_Obj_Elevator,80A85C80 +ovl_Obj_Lift,80A86040 +ovl_Obj_Hsblock,80A86A60 +ovl_En_Okarina_Tag,80A87030 +ovl_En_Yabusame_Mark,80A88530 +ovl_En_Goroiwa,80A88C00 +ovl_En_Ex_Ruppy,80A8AFC0 +ovl_En_Toryo,80A8C080 +ovl_En_Daiku,80A8CD10 +ovl_En_Nwc,80A8E450 +ovl_En_Blkobj,80A8EE90 +ovl_Item_Inbox,80A8F3F0 +ovl_En_Ge1,80A8F550 +ovl_Obj_Blockstop,80A91580 +ovl_En_Sda,80A91720 +ovl_En_Clear_Tag,80A92E20 +ovl_En_Niw_Lady,80A9E3C0 +ovl_En_Gm,80A9FCC0 +ovl_En_Ms,80AA09F0 +ovl_En_Hs,80AA10E0 +ovl_Bg_Ingate,80AA1C80 +ovl_En_Kanban,80AA2010 +ovl_En_Heishi3,80AA5160 +ovl_En_Syateki_Niw,80AA5B30 +ovl_En_Attack_Niw,80AA7BC0 +ovl_Bg_Spot01_Idosoko,80AA8E20 +ovl_En_Sa,80AA9030 +ovl_En_Wonder_Talk,80AAB2A0 +ovl_Bg_Gjyo_Bridge,80AAB930 +ovl_En_Ds,80AABE30 +ovl_En_Mk,80AACA50 +ovl_En_Bom_Bowl_Man,80AAD8E0 +ovl_En_Bom_Bowl_Pit,80AAEE20 +ovl_En_Owl,80AAF790 +ovl_En_Ishi,80AB3330 +ovl_Obj_Hana,80ABC480 +ovl_Obj_Lightswitch,80ABC790 +ovl_Obj_Mure2,80ABDBC0 +ovl_En_Go,80ABE5E0 +ovl_En_Fu,80AC2C20 +ovl_En_Changer,80AC3970 +ovl_Bg_Jya_Megami,80AC4350 +ovl_Bg_Jya_Lift,80AC5530 +ovl_Bg_Jya_Bigmirror,80AC5A80 +ovl_Bg_Jya_Bombchuiwa,80AC62C0 +ovl_Bg_Jya_Amishutter,80AC6DF0 +ovl_Bg_Jya_Bombiwa,80AC7180 +ovl_Bg_Spot18_Basket,80AC7740 +ovl_En_Ganon_Organ,80AC8730 +ovl_En_Siofuki,80ACF730 +ovl_En_Stream,80AD04E0 +ovl_En_Mm,80AD0A70 +ovl_En_Ko,80AD2090 +ovl_En_Kz,80AD61D0 +ovl_En_Weather_Tag,80AD7770 +ovl_Bg_Sst_Floor,80AD8660 +ovl_En_Ani,80AD8BC0 +ovl_En_Ex_Item,80AD9930 +ovl_Bg_Jya_Ironobj,80ADAAA0 +ovl_En_Js,80ADB850 +ovl_En_Jsjutan,80ADC220 +ovl_En_Cs,80AE1B40 +ovl_En_Md,80AE2D70 +ovl_En_Hy,80AE53E0 +ovl_En_Ganon_Mant,80AE8D20 +ovl_En_Okarina_Effect,80AECF40 +ovl_En_Mag,80AED300 +ovl_Door_Gerudo,80AF2210 +ovl_Elf_Msg2,80AF2800 +ovl_Demo_Gt,80AF2C70 +ovl_En_Po_Field,80AF8270 +ovl_Efc_Erupc,80AFBCE0 +ovl_Bg_Zg,80AFC7C0 +ovl_En_Heishi4,80AFCC30 +ovl_En_Zl3,80AFDB30 +ovl_Boss_Ganon2,80B05980 +ovl_En_Kakasi,80B187A0 +ovl_En_Takara_Man,80B194E0 +ovl_Obj_Makeoshihiki,80B19DA0 +ovl_Oceff_Spot,80B1A230 +ovl_End_Title,80B1B160 +ovl_En_Torch,80B1F290 +ovl_Demo_Ec,80B1F380 +ovl_Shot_Sun,80B22BE0 +ovl_En_Dy_Extra,80B232A0 +ovl_En_Wonder_Talk2,80B23820 +ovl_En_Ge2,80B23EC0 +ovl_Obj_Roomtimer,80B25860 +ovl_En_Ssh,80B25AB0 +ovl_En_Sth,80B280A0 +ovl_Oceff_Wipe,80B2C150 +ovl_Effect_Ss_Dust,80B2CEA0 +ovl_Effect_Ss_KiraKira,80B2D6D0 +ovl_Effect_Ss_Bomb,80B2DD40 +ovl_Effect_Ss_Bomb2,80B2E160 +ovl_Effect_Ss_Blast,80B2EA90 +ovl_Effect_Ss_G_Spk,80B2EE20 +ovl_Effect_Ss_D_Fire,80B2F3D0 +ovl_Effect_Ss_Bubble,80B2F8C0 +ovl_Effect_Ss_G_Ripple,80B2FD40 +ovl_Effect_Ss_G_Splash,80B302A0 +ovl_Effect_Ss_G_Magma,80B30750 +ovl_Effect_Ss_G_Fire,80B309B0 +ovl_Effect_Ss_Lightning,80B30C40 +ovl_Effect_Ss_Dt_Bubble,80B31310 +ovl_Effect_Ss_Hahen,80B318A0 +ovl_Effect_Ss_Stick,80B31EE0 +ovl_Effect_Ss_Sibuki,80B32280 +ovl_Effect_Ss_Sibuki2,80B32950 +ovl_Effect_Ss_G_Magma2,80B32C80 +ovl_Effect_Ss_Stone1,80B33190 +ovl_Effect_Ss_HitMark,80B33520 +ovl_Effect_Ss_Fhg_Flash,80B33A70 +ovl_Effect_Ss_K_Fire,80B349F0 +ovl_Effect_Ss_Solder_Srch_Ball,80B34E20 +ovl_Effect_Ss_Kakera,80B34FD0 +ovl_Effect_Ss_Ice_Piece,80B36060 +ovl_Effect_Ss_En_Ice,80B364A0 +ovl_Effect_Ss_Fire_Tail,80B36D60 +ovl_Effect_Ss_En_Fire,80B37460 +ovl_Effect_Ss_Extra,80B37BA0 +ovl_Effect_Ss_Fcircle,80B37F60 +ovl_Effect_Ss_Dead_Db,80B38410 +ovl_Effect_Ss_Dead_Dd,80B388F0 +ovl_Effect_Ss_Dead_Ds,80B38E80 +ovl_Effect_Ss_Dead_Sound,80B39300 +ovl_Oceff_Storm,80B39440 +ovl_En_Weiyer,80B3AFE0 +ovl_Bg_Spot05_Soko,80B3C9E0 +ovl_Bg_Jya_1flift,80B3CD00 +ovl_Bg_Jya_Haheniron,80B3D390 +ovl_Bg_Spot12_Gate,80B3DB80 +ovl_Bg_Spot12_Saku,80B3DF90 +ovl_En_Hintnuts,80B3E450 +ovl_En_Nutsball,80B3FE80 +ovl_Bg_Spot00_Break,80B404A0 +ovl_En_Shopnuts,80B40640 +ovl_En_It,80B41550 +ovl_En_GeldB,80B416E0 +ovl_Oceff_Wipe2,80B46A90 +ovl_Oceff_Wipe3,80B48200 +ovl_En_Niw_Girl,80B49950 +ovl_En_Dog,80B4A420 +ovl_En_Si,80B4B5D0 +ovl_Bg_Spot01_Objects2,80B4BAD0 +ovl_Obj_Comb,80B4BF90 +ovl_Bg_Spot11_Bakudankabe,80B4C7F0 +ovl_Obj_Kibako2,80B4CE30 +ovl_En_Dnt_Demo,80B4D4F0 +ovl_En_Dnt_Jiji,80B4E210 +ovl_En_Dnt_Nomal,80B4F720 +ovl_En_Guest,80B52530 +ovl_Bg_Bom_Guard,80B52ED0 +ovl_En_Hs2,80B530F0 +ovl_Demo_Kekkai,80B536D0 +ovl_Bg_Spot08_Bakudankabe,80B549B0 +ovl_Bg_Spot17_Bakudankabe,80B55050 +ovl_Obj_Mure3,80B55730 +ovl_En_Tg,80B55F00 +ovl_En_Mu,80B565D0 +ovl_En_Go2,80B56EF0 +ovl_En_Wf,80B5CF10 +ovl_En_Skb,80B61220 +ovl_Demo_Gj,80B62B10 +ovl_Demo_Geff,80B667C0 +ovl_Bg_Gnd_Firemeiro,80B66FE0 +ovl_Bg_Gnd_Darkmeiro,80B67520 +ovl_Bg_Gnd_Soulmeiro,80B67CE0 +ovl_Bg_Gnd_Nisekabe,80B68540 +ovl_Bg_Gnd_Iceblock,80B686B0 +ovl_Bg_Ydan_Sp,80B697B0 +ovl_En_Gb,80B6AF20 +ovl_En_Gs,80B6C650 +ovl_Bg_Mizu_Bwall,80B6E4F0 +ovl_Bg_Mizu_Shutter,80B6F9C0 +ovl_En_Daiku_Kakariko,80B701C0 +ovl_Bg_Bowl_Wall,80B71580 +ovl_En_Wall_Tubo,80B71F00 +ovl_En_Po_Desert,80B723F0 +ovl_En_Crow,80B731B0 +ovl_Door_Killer,80B74850 +ovl_Bg_Spot11_Oasis,80B75DC0 +ovl_Bg_Spot18_Futa,80B764F0 +ovl_Bg_Spot18_Shutter,80B76690 +ovl_En_Ma3,80B76BE0 +ovl_En_Cow,80B77B90 +ovl_Bg_Ice_Turara,80B78FF0 +ovl_Bg_Ice_Shutter,80B79820 +ovl_En_Kakasi2,80B79C90 +ovl_En_Kakasi3,80B7A3B0 +ovl_Oceff_Wipe4,80B7B490 +ovl_En_Eg,80B7C470 +ovl_Bg_Menkuri_Nisekabe,80B7C620 +ovl_En_Zo,80B7C770 +ovl_Effect_Ss_Ice_Smoke,80B7ED20 +ovl_Obj_Makekinsuta,80B7F1E0 +ovl_En_Ge3,80B7F330 +ovl_Obj_Timeblock,80B7FE80 +ovl_Obj_Hamishi,80B80AC0 +ovl_En_Zl4,80B81310 +ovl_En_Mm2,80B85D40 +ovl_Bg_Jya_Block,80B86B00 +ovl_Obj_Warp2block,80B86D70 +gameplay_keep, +gameplay_field_keep, +gameplay_dangeon_keep, +gameplay_object_exchange_static, +object_link_boy, +object_link_child, +object_box, +object_human, +object_okuta, +object_poh, +object_wallmaster, +object_dy_obj, +object_firefly, +object_dodongo, +object_fire, +object_niw, +object_tite, +object_reeba, +object_peehat, +object_kingdodongo, +object_horse, +object_zf, +object_goma, +object_zl1, +object_gol, +object_bubble, +object_dodojr, +object_torch2, +object_bl, +object_tp, +object_oA1, +object_st, +object_bw, +object_ei, +object_horse_normal, +object_oB1, +object_o_anime, +object_spot04_objects, +object_ddan_objects, +object_hidan_objects, +object_horse_ganon, +object_oA2, +object_spot00_objects, +object_mb, +object_bombf, +object_sk2, +object_oE1, +object_oE_anime, +object_oE2, +object_ydan_objects, +object_gnd, +object_am, +object_dekubaba, +object_oA3, +object_oA4, +object_oA5, +object_oA6, +object_oA7, +object_jj, +object_oA8, +object_oA9, +object_oB2, +object_oB3, +object_oB4, +object_horse_zelda, +object_opening_demo1, +object_warp1, +object_b_heart, +object_dekunuts, +object_oE3, +object_oE4, +object_menkuri_objects, +object_oE5, +object_oE6, +object_oE7, +object_oE8, +object_oE9, +object_oE10, +object_oE11, +object_oE12, +object_vali, +object_oA10, +object_oA11, +object_mizu_objects, +object_fhg, +object_ossan, +object_mori_hineri1, +object_Bb, +object_toki_objects, +object_yukabyun, +object_zl2, +object_mjin, +object_mjin_flash, +object_mjin_dark, +object_mjin_flame, +object_mjin_ice, +object_mjin_soul, +object_mjin_wind, +object_mjin_oka, +object_haka_objects, +object_spot06_objects, +object_ice_objects, +object_relay_objects, +object_mori_hineri1a, +object_mori_hineri2, +object_mori_hineri2a, +object_mori_objects, +object_mori_tex, +object_spot08_obj, +object_warp2, +object_hata, +object_bird, +object_wood02, +object_lightbox, +object_pu_box, +object_trap, +object_vase, +object_im, +object_ta, +object_tk, +object_xc, +object_vm, +object_bv, +object_hakach_objects, +object_efc_crystal_light, +object_efc_fire_ball, +object_efc_flash, +object_efc_lgt_shower, +object_efc_star_field, +object_god_lgt, +object_light_ring, +object_triforce_spot, +object_medal, +object_bdan_objects, +object_sd, +object_rd, +object_po_sisters, +object_heavy_object, +object_gndd, +object_fd, +object_du, +object_fw, +object_horse_link_child, +object_spot02_objects, +object_haka, +object_ru1, +object_syokudai, +object_fd2, +object_dh, +object_rl, +object_efc_tw, +object_demo_tre_lgt, +object_gi_key, +object_mir_ray, +object_brob, +object_gi_jewel, +object_spot09_obj, +object_spot18_obj, +object_bdoor, +object_spot17_obj, +object_shop_dungen, +object_nb, +object_mo, +object_sb, +object_gi_melody, +object_gi_heart, +object_gi_compass, +object_gi_bosskey, +object_gi_medal, +object_gi_nuts, +object_sa, +object_gi_hearts, +object_gi_arrowcase, +object_gi_bombpouch, +object_in, +object_tr, +object_spot16_obj, +object_oE1s, +object_oE4s, +object_os_anime, +object_gi_bottle, +object_gi_stick, +object_gi_map, +object_oF1d_map, +object_ru2, +object_gi_shield_1, +object_dekujr, +object_gi_magicpot, +object_gi_bomb_1, +object_oF1s, +object_ma2, +object_gi_purse, +object_hni, +object_tw, +object_rr, +object_bxa, +object_anubice, +object_gi_gerudo, +object_gi_arrow, +object_gi_bomb_2, +object_gi_egg, +object_gi_scale, +object_gi_shield_2, +object_gi_hookshot, +object_gi_ocarina, +object_gi_milk, +object_ma1, +object_ganon, +object_sst, +object_ny, +object_fr, +object_gi_pachinko, +object_gi_boomerang, +object_gi_bow, +object_gi_glasses, +object_gi_liquid, +object_ani, +object_demo_6k, +object_gi_shield_3, +object_gi_letter, +object_spot15_obj, +object_jya_obj, +object_gi_clothes, +object_gi_bean, +object_gi_fish, +object_gi_saw, +object_gi_hammer, +object_gi_grass, +object_gi_longsword, +object_spot01_objects, +object_md, +object_km1, +object_kw1, +object_zo, +object_kz, +object_umajump, +object_masterkokiri, +object_masterkokirihead, +object_mastergolon, +object_masterzoora, +object_aob, +object_ik, +object_ahg, +object_cne, +object_gi_niwatori, +object_skj, +object_gi_bottle_letter, +object_bji, +object_bba, +object_gi_ocarina_0, +object_ds, +object_ane, +object_boj, +object_spot03_object, +object_spot07_object, +object_fz, +object_bob, +object_ge1, +object_yabusame_point, +object_gi_boots_2, +object_gi_seed, +object_gnd_magic, +object_d_elevator, +object_d_hsblock, +object_d_lift, +object_mamenoki, +object_goroiwa, +object_toryo, +object_daiku, +object_nwc, +object_blkobj, +object_gm, +object_ms, +object_hs, +object_ingate, +object_lightswitch, +object_kusa, +object_tsubo, +object_gi_gloves, +object_gi_coin, +object_kanban, +object_gjyo_objects, +object_owl, +object_mk, +object_fu, +object_gi_ki_tan_mask, +object_gi_redead_mask, +object_gi_skj_mask, +object_gi_rabit_mask, +object_gi_truth_mask, +object_ganon_objects, +object_siofuki, +object_stream, +object_mm, +object_fa, +object_os, +object_gi_eye_lotion, +object_gi_powder, +object_gi_mushroom, +object_gi_ticketstone, +object_gi_brokensword, +object_js, +object_cs, +object_gi_prescription, +object_gi_bracelet, +object_gi_soldout, +object_gi_frog, +object_mag, +object_door_gerudo, +object_gt, +object_efc_erupc, +object_zl2_anime1, +object_zl2_anime2, +object_gi_golonmask, +object_gi_zoramask, +object_gi_gerudomask, +object_ganon2, +object_ka, +object_ts, +object_zg, +object_gi_hoverboots, +object_gi_m_arrow, +object_ds2, +object_ec, +object_fish, +object_gi_sutaru, +object_gi_goddess, +object_ssh, +object_bigokuta, +object_bg, +object_spot05_objects, +object_spot12_obj, +object_bombiwa, +object_hintnuts, +object_rs, +object_spot00_break, +object_gla, +object_shopnuts, +object_geldb, +object_gr, +object_dog, +object_jya_iron, +object_jya_door, +object_spot01_objects2, +object_spot11_obj, +object_kibako2, +object_dns, +object_dnk, +object_gi_fire, +object_gi_insect, +object_gi_butterfly, +object_gi_ghost, +object_gi_soul, +object_bowl, +object_po_field, +object_demo_kekkai, +object_efc_doughnut, +object_gi_dekupouch, +object_ganon_anime1, +object_ganon_anime2, +object_ganon_anime3, +object_gi_rupy, +object_spot01_matoya, +object_spot01_matoyab, +object_po_composer, +object_mu, +object_wf, +object_skb, +object_gj, +object_geff, +object_haka_door, +object_gs, +object_ps, +object_bwall, +object_crow, +object_cow, +object_cob, +object_gi_sword_1, +object_door_killer, +object_ouke_haka, +object_timeblock, +object_zl4, +g_pn_01, +g_pn_02, +g_pn_03, +g_pn_04, +g_pn_05, +g_pn_06, +g_pn_07, +g_pn_08, +g_pn_09, +g_pn_10, +g_pn_11, +g_pn_12, +g_pn_13, +g_pn_14, +g_pn_15, +g_pn_16, +g_pn_17, +g_pn_18, +g_pn_19, +g_pn_20, +g_pn_21, +g_pn_22, +g_pn_23, +g_pn_24, +g_pn_25, +g_pn_26, +g_pn_27, +g_pn_28, +g_pn_29, +g_pn_30, +g_pn_31, +g_pn_32, +g_pn_33, +g_pn_34, +g_pn_35, +g_pn_36, +g_pn_37, +g_pn_38, +g_pn_39, +g_pn_40, +g_pn_41, +g_pn_42, +g_pn_43, +g_pn_44, +g_pn_45, +g_pn_46, +g_pn_47, +g_pn_48, +g_pn_49, +g_pn_50, +g_pn_51, +g_pn_52, +g_pn_53, +g_pn_54, +g_pn_55, +g_pn_56, +g_pn_57, +z_select_static, +nintendo_rogo_static, +title_static, +parameter_static, +vr_fine0_static, +vr_fine0_pal_static, +vr_fine1_static, +vr_fine1_pal_static, +vr_fine2_static, +vr_fine2_pal_static, +vr_fine3_static, +vr_fine3_pal_static, +vr_cloud0_static, +vr_cloud0_pal_static, +vr_cloud1_static, +vr_cloud1_pal_static, +vr_cloud2_static, +vr_cloud2_pal_static, +vr_cloud3_static, +vr_cloud3_pal_static, +vr_holy0_static, +vr_holy0_pal_static, +vr_holy1_static, +vr_holy1_pal_static, +vr_MDVR_static, +vr_MDVR_pal_static, +vr_MNVR_static, +vr_MNVR_pal_static, +vr_RUVR_static, +vr_RUVR_pal_static, +vr_LHVR_static, +vr_LHVR_pal_static, +vr_KHVR_static, +vr_KHVR_pal_static, +vr_K3VR_static, +vr_K3VR_pal_static, +vr_K4VR_static, +vr_K4VR_pal_static, +vr_K5VR_static, +vr_K5VR_pal_static, +vr_SP1a_static, +vr_SP1a_pal_static, +vr_MLVR_static, +vr_MLVR_pal_static, +vr_KKRVR_static, +vr_KKRVR_pal_static, +vr_KR3VR_static, +vr_KR3VR_pal_static, +vr_IPVR_static, +vr_IPVR_pal_static, +vr_KSVR_static, +vr_KSVR_pal_static, +vr_GLVR_static, +vr_GLVR_pal_static, +vr_ZRVR_static, +vr_ZRVR_pal_static, +vr_DGVR_static, +vr_DGVR_pal_static, +vr_ALVR_static, +vr_ALVR_pal_static, +vr_NSVR_static, +vr_NSVR_pal_static, +vr_LBVR_static, +vr_LBVR_pal_static, +vr_TTVR_static, +vr_TTVR_pal_static, +vr_FCVR_static, +vr_FCVR_pal_static, +elf_message_field, +elf_message_ydan, +ddan_scene, +ddan_room_0, +ddan_room_1, +ddan_room_2, +ddan_room_3, +ddan_room_4, +ddan_room_5, +ddan_room_6, +ddan_room_7, +ddan_room_8, +ddan_room_9, +ddan_room_10, +ddan_room_11, +ddan_room_12, +ddan_room_13, +ddan_room_14, +ddan_room_15, +ddan_room_16, +spot00_scene, +spot00_room_0, +spot01_scene, +spot01_room_0, +spot02_scene, +spot02_room_0, +spot02_room_1, +spot03_scene, +spot03_room_0, +spot03_room_1, +spot04_scene, +spot04_room_0, +spot04_room_1, +spot04_room_2, +spot05_scene, +spot05_room_0, +spot06_scene, +spot06_room_0, +spot07_scene, +spot07_room_0, +spot07_room_1, +spot08_scene, +spot08_room_0, +spot09_scene, +spot09_room_0, +spot10_scene, +spot10_room_0, +spot10_room_1, +spot10_room_2, +spot10_room_3, +spot10_room_4, +spot10_room_5, +spot10_room_6, +spot10_room_7, +spot10_room_8, +spot10_room_9, +spot11_scene, +spot11_room_0, +spot12_scene, +spot12_room_0, +spot12_room_1, +spot13_scene, +spot13_room_0, +spot13_room_1, +spot15_scene, +spot15_room_0, +spot16_scene, +spot16_room_0, +spot17_scene, +spot17_room_0, +spot17_room_1, +spot18_scene, +spot18_room_0, +spot18_room_1, +spot18_room_2, +spot18_room_3, +market_day_scene, +market_day_room_0, +market_night_scene, +market_night_room_0, +HIDAN_scene, +HIDAN_room_0, +HIDAN_room_1, +HIDAN_room_2, +HIDAN_room_3, +HIDAN_room_4, +HIDAN_room_5, +HIDAN_room_6, +HIDAN_room_7, +HIDAN_room_8, +HIDAN_room_9, +HIDAN_room_10, +HIDAN_room_11, +HIDAN_room_12, +HIDAN_room_13, +HIDAN_room_14, +HIDAN_room_15, +HIDAN_room_16, +HIDAN_room_17, +HIDAN_room_18, +HIDAN_room_19, +HIDAN_room_20, +HIDAN_room_21, +HIDAN_room_22, +HIDAN_room_23, +HIDAN_room_24, +HIDAN_room_25, +HIDAN_room_26, +Bmori1_scene, +Bmori1_room_0, +Bmori1_room_1, +Bmori1_room_2, +Bmori1_room_3, +Bmori1_room_4, +Bmori1_room_5, +Bmori1_room_6, +Bmori1_room_7, +Bmori1_room_8, +Bmori1_room_9, +Bmori1_room_10, +Bmori1_room_11, +Bmori1_room_12, +Bmori1_room_13, +Bmori1_room_14, +Bmori1_room_15, +Bmori1_room_16, +Bmori1_room_17, +Bmori1_room_18, +Bmori1_room_19, +Bmori1_room_20, +Bmori1_room_21, +Bmori1_room_22, +ydan_scene, +ydan_room_0, +ydan_room_1, +ydan_room_2, +ydan_room_3, +ydan_room_4, +ydan_room_5, +ydan_room_6, +ydan_room_7, +ydan_room_8, +ydan_room_9, +ydan_room_10, +ydan_room_11, +kenjyanoma_scene, +kenjyanoma_room_0, +tokinoma_scene, +tokinoma_room_0, +tokinoma_room_1, +link_home_scene, +link_home_room_0, +kokiri_shop_scene, +kokiri_shop_room_0, +MIZUsin_scene, +MIZUsin_room_0, +MIZUsin_room_1, +MIZUsin_room_2, +MIZUsin_room_3, +MIZUsin_room_4, +MIZUsin_room_5, +MIZUsin_room_6, +MIZUsin_room_7, +MIZUsin_room_8, +MIZUsin_room_9, +MIZUsin_room_10, +MIZUsin_room_11, +MIZUsin_room_12, +MIZUsin_room_13, +MIZUsin_room_14, +MIZUsin_room_15, +MIZUsin_room_16, +MIZUsin_room_17, +MIZUsin_room_18, +MIZUsin_room_19, +MIZUsin_room_20, +MIZUsin_room_21, +MIZUsin_room_22, +kokiri_home_scene, +kokiri_home_room_0, +kakusiana_scene, +kakusiana_room_0, +kakusiana_room_1, +kakusiana_room_2, +kakusiana_room_3, +kakusiana_room_4, +kakusiana_room_5, +kakusiana_room_6, +kakusiana_room_7, +kakusiana_room_8, +kakusiana_room_9, +kakusiana_room_10, +kakusiana_room_11, +kakusiana_room_12, +kakusiana_room_13, +entra_scene, +entra_room_0, +bdan_scene, +bdan_room_0, +bdan_room_1, +bdan_room_2, +bdan_room_3, +bdan_room_4, +bdan_room_5, +bdan_room_6, +bdan_room_7, +bdan_room_8, +bdan_room_9, +bdan_room_10, +bdan_room_11, +bdan_room_12, +bdan_room_13, +bdan_room_14, +bdan_room_15, +HAKAdan_scene, +HAKAdan_room_0, +HAKAdan_room_1, +HAKAdan_room_2, +HAKAdan_room_3, +HAKAdan_room_4, +HAKAdan_room_5, +HAKAdan_room_6, +HAKAdan_room_7, +HAKAdan_room_8, +HAKAdan_room_9, +HAKAdan_room_10, +HAKAdan_room_11, +HAKAdan_room_12, +HAKAdan_room_13, +HAKAdan_room_14, +HAKAdan_room_15, +HAKAdan_room_16, +HAKAdan_room_17, +HAKAdan_room_18, +HAKAdan_room_19, +HAKAdan_room_20, +HAKAdan_room_21, +HAKAdan_room_22, +moribossroom_scene, +moribossroom_room_0, +moribossroom_room_1, +syatekijyou_scene, +syatekijyou_room_0, +men_scene, +men_room_0, +men_room_1, +men_room_2, +men_room_3, +men_room_4, +men_room_5, +men_room_6, +men_room_7, +men_room_8, +men_room_9, +men_room_10, +shop1_scene, +shop1_room_0, +hairal_niwa_scene, +hairal_niwa_room_0, +ganon_tou_scene, +ganon_tou_room_0, +market_alley_scene, +market_alley_room_0, +spot20_scene, +spot20_room_0, +market_ruins_scene, +market_ruins_room_0, +entra_n_scene, +entra_n_room_0, +enrui_scene, +enrui_room_0, +market_alley_n_scene, +market_alley_n_room_0, +hiral_demo_scene, +hiral_demo_room_0, +kokiri_home3_scene, +kokiri_home3_room_0, +jyasinzou_scene, +jyasinzou_room_0, +jyasinzou_room_1, +jyasinzou_room_2, +jyasinzou_room_3, +jyasinzou_room_4, +jyasinzou_room_5, +jyasinzou_room_6, +jyasinzou_room_7, +jyasinzou_room_8, +jyasinzou_room_9, +jyasinzou_room_10, +jyasinzou_room_11, +jyasinzou_room_12, +jyasinzou_room_13, +jyasinzou_room_14, +jyasinzou_room_15, +jyasinzou_room_16, +jyasinzou_room_17, +jyasinzou_room_18, +jyasinzou_room_19, +jyasinzou_room_20, +jyasinzou_room_21, +jyasinzou_room_22, +jyasinzou_room_23, +jyasinzou_room_24, +jyasinzou_room_25, +jyasinzou_room_26, +jyasinzou_room_27, +jyasinzou_room_28, +ice_doukutu_scene, +ice_doukutu_room_0, +ice_doukutu_room_1, +ice_doukutu_room_2, +ice_doukutu_room_3, +ice_doukutu_room_4, +ice_doukutu_room_5, +ice_doukutu_room_6, +ice_doukutu_room_7, +ice_doukutu_room_8, +ice_doukutu_room_9, +ice_doukutu_room_10, +ice_doukutu_room_11, +malon_stable_scene, +malon_stable_room_0, +kakariko_scene, +kakariko_room_0, +bdan_boss_scene, +bdan_boss_room_0, +bdan_boss_room_1, +FIRE_bs_scene, +FIRE_bs_room_0, +FIRE_bs_room_1, +hut_scene, +hut_room_0, +daiyousei_izumi_scene, +daiyousei_izumi_room_0, +hakaana_scene, +hakaana_room_0, +yousei_izumi_tate_scene, +yousei_izumi_tate_room_0, +yousei_izumi_yoko_scene, +yousei_izumi_yoko_room_0, +golon_scene, +golon_room_0, +zoora_scene, +zoora_room_0, +drag_scene, +drag_room_0, +alley_shop_scene, +alley_shop_room_0, +night_shop_scene, +night_shop_room_0, +impa_scene, +impa_room_0, +labo_scene, +labo_room_0, +tent_scene, +tent_room_0, +nakaniwa_scene, +nakaniwa_room_0, +ddan_boss_scene, +ddan_boss_room_0, +ddan_boss_room_1, +ydan_boss_scene, +ydan_boss_room_0, +ydan_boss_room_1, +HAKAdan_bs_scene, +HAKAdan_bs_room_0, +HAKAdan_bs_room_1, +MIZUsin_bs_scene, +MIZUsin_bs_room_0, +MIZUsin_bs_room_1, +ganon_scene, +ganon_room_0, +ganon_room_1, +ganon_room_2, +ganon_room_3, +ganon_room_4, +ganon_room_5, +ganon_room_6, +ganon_room_7, +ganon_room_8, +ganon_room_9, +ganon_boss_scene, +ganon_boss_room_0, +jyasinboss_scene, +jyasinboss_room_0, +jyasinboss_room_1, +jyasinboss_room_2, +jyasinboss_room_3, +kokiri_home4_scene, +kokiri_home4_room_0, +kokiri_home5_scene, +kokiri_home5_room_0, +ganon_final_scene, +ganon_final_room_0, +kakariko3_scene, +kakariko3_room_0, +hakasitarelay_scene, +hakasitarelay_room_0, +hakasitarelay_room_1, +hakasitarelay_room_2, +hakasitarelay_room_3, +hakasitarelay_room_4, +hakasitarelay_room_5, +hakasitarelay_room_6, +shrine_scene, +shrine_room_0, +turibori_scene, +turibori_room_0, +shrine_n_scene, +shrine_n_room_0, +shrine_r_scene, +shrine_r_room_0, +ganontika_scene, +ganontika_room_0, +ganontika_room_1, +ganontika_room_2, +ganontika_room_3, +ganontika_room_4, +ganontika_room_5, +ganontika_room_6, +ganontika_room_7, +ganontika_room_8, +ganontika_room_9, +ganontika_room_10, +ganontika_room_11, +ganontika_room_12, +ganontika_room_13, +ganontika_room_14, +ganontika_room_15, +ganontika_room_16, +ganontika_room_17, +ganontika_room_18, +ganontika_room_19, +hakaana2_scene, +hakaana2_room_0, +gerudoway_scene, +gerudoway_room_0, +gerudoway_room_1, +gerudoway_room_2, +gerudoway_room_3, +gerudoway_room_4, +gerudoway_room_5, +HAKAdanCH_scene, +HAKAdanCH_room_0, +HAKAdanCH_room_1, +HAKAdanCH_room_2, +HAKAdanCH_room_3, +HAKAdanCH_room_4, +HAKAdanCH_room_5, +HAKAdanCH_room_6, +hairal_niwa_n_scene, +hairal_niwa_n_room_0, +bowling_scene, +bowling_room_0, +hakaana_ouke_scene, +hakaana_ouke_room_0, +hakaana_ouke_room_1, +hakaana_ouke_room_2, +hylia_labo_scene, +hylia_labo_room_0, +souko_scene, +souko_room_0, +souko_room_1, +souko_room_2, +miharigoya_scene, +miharigoya_room_0, +mahouya_scene, +mahouya_room_0, +takaraya_scene, +takaraya_room_0, +takaraya_room_1, +takaraya_room_2, +takaraya_room_3, +takaraya_room_4, +takaraya_room_5, +takaraya_room_6, +ganon_sonogo_scene, +ganon_sonogo_room_0, +ganon_sonogo_room_1, +ganon_sonogo_room_2, +ganon_sonogo_room_3, +ganon_sonogo_room_4, +ganon_demo_scene, +ganon_demo_room_0, +face_shop_scene, +face_shop_room_0, +kinsuta_scene, +kinsuta_room_0, +ganontikasonogo_scene, +ganontikasonogo_room_0, +ganontikasonogo_room_1, +bump_texture_static, +anime_model_1_static, +anime_model_2_static, +anime_model_3_static, +anime_model_4_static, +anime_model_5_static, +anime_model_6_static, +anime_texture_1_static, +anime_texture_2_static, +anime_texture_3_static, +anime_texture_4_static, +anime_texture_5_static, +anime_texture_6_static, +softsprite_matrix_static, diff --git a/baseroms/pal-1.0/checksum-compressed.md5 b/baseroms/pal-1.0/checksum-compressed.md5 new file mode 100644 index 0000000000..0689459f03 --- /dev/null +++ b/baseroms/pal-1.0/checksum-compressed.md5 @@ -0,0 +1 @@ +e040de91a74b61e3201db0e2323f768a build/pal-1.0/oot-pal-1.0-compressed.z64 diff --git a/baseroms/pal-1.0/checksum.md5 b/baseroms/pal-1.0/checksum.md5 new file mode 100644 index 0000000000..352e0126b5 --- /dev/null +++ b/baseroms/pal-1.0/checksum.md5 @@ -0,0 +1 @@ +f7e8dec14a2fbae90aafa838c801310f build/pal-1.0/oot-pal-1.0.z64 diff --git a/baseroms/pal-1.0/config.yml b/baseroms/pal-1.0/config.yml new file mode 100644 index 0000000000..1a80071bbb --- /dev/null +++ b/baseroms/pal-1.0/config.yml @@ -0,0 +1,1225 @@ +dmadata_start: 0x7950 +text_lang_pal: true +incbins: + - name: ipl3 + segment: makerom + vram: 0x80000040 + size: 0xFC0 + - name: rspbootText + segment: boot + vram: 0x80006560 + size: 0x160 + - name: aspMainText + segment: code + vram: 0x800E0F10 + size: 0xFB0 + - name: gspF3DZEX2_NoN_PosLight_fifoText + segment: code + vram: 0x800E1EC0 + size: 0x1390 + - name: gspS2DEX2d_fifoText + segment: code + vram: 0x800E3250 + size: 0x18C0 + - name: njpgdspMainText + segment: code + vram: 0x800E4B10 + size: 0xAF0 + - name: gSequenceFontTable + segment: code + vram: 0x801117B0 + size: 0x1C0 + - name: gSequenceTable + segment: code + vram: 0x80111970 + size: 0x6F0 + - name: aspMainData + segment: code + vram: 0x801120E0 + size: 0x2E0 + - name: gspF3DZEX2_NoN_PosLight_fifoData + segment: code + vram: 0x801123C0 + size: 0x420 + - name: gspS2DEX2d_fifoData + segment: code + vram: 0x801127E0 + size: 0x390 + - name: njpgdspMainData + segment: code + vram: 0x80112B70 + size: 0x60 +variables: + gMtxClear: 0x800FCD00 + sNesMessageEntryTable: 0x801088BC + sGerMessageEntryTable: 0x8010CAE4 + sFraMessageEntryTable: 0x8010EBF4 + sStaffMessageEntryTable: 0x80110D04 + gSoundFontTable: 0x80111540 + gSequenceFontTable: 0x801117B0 + gSequenceTable: 0x80111970 + gSampleBankTable: 0x80112060 + sShadowTex: 0x80AE19F0 +assets: +- name: code/fbdemo_circle + xml_path: assets/xml/code/fbdemo_circle.xml + start_offset: 0xE99C8 + end_offset: 0xEABE8 +- name: code/fbdemo_triforce + xml_path: assets/xml/code/fbdemo_triforce.xml + start_offset: 0xE8E50 + end_offset: 0xE8F20 +- name: code/fbdemo_wipe1 + xml_path: assets/xml/code/fbdemo_wipe1.xml + start_offset: 0xE8F20 + end_offset: 0xE98B0 +- name: n64dd/error_textures + xml_path: assets/xml/n64dd/error_textures.xml + start_offset: 0xC0E0 + end_offset: 0x11CE0 +- name: misc/link_animetion + xml_path: assets/xml/misc/link_animetion.xml +- name: misc/z_select_static + xml_path: assets/xml/misc/z_select_static.xml +- name: objects/gameplay_dangeon_keep + xml_path: assets/xml/objects/gameplay_dangeon_keep.xml +- name: objects/gameplay_field_keep + xml_path: assets/xml/objects/gameplay_field_keep.xml +- name: objects/gameplay_keep + xml_path: assets/xml/objects/gameplay_keep_pal.xml +- name: objects/object_ahg + xml_path: assets/xml/objects/object_ahg.xml +- name: objects/object_am + xml_path: assets/xml/objects/object_am.xml +- name: objects/object_ane + xml_path: assets/xml/objects/object_ane.xml +- name: objects/object_ani + xml_path: assets/xml/objects/object_ani.xml +- name: objects/object_anubice + xml_path: assets/xml/objects/object_anubice.xml +- name: objects/object_aob + xml_path: assets/xml/objects/object_aob.xml +- name: objects/object_b_heart + xml_path: assets/xml/objects/object_b_heart.xml +- name: objects/object_Bb + xml_path: assets/xml/objects/object_Bb.xml +- name: objects/object_bba + xml_path: assets/xml/objects/object_bba.xml +- name: objects/object_bdan_objects + xml_path: assets/xml/objects/object_bdan_objects.xml +- name: objects/object_bdoor + xml_path: assets/xml/objects/object_bdoor.xml +- name: objects/object_bg + xml_path: assets/xml/objects/object_bg.xml +- name: objects/object_bigokuta + xml_path: assets/xml/objects/object_bigokuta.xml +- name: objects/object_bird + xml_path: assets/xml/objects/object_bird.xml +- name: objects/object_bji + xml_path: assets/xml/objects/object_bji.xml +- name: objects/object_bl + xml_path: assets/xml/objects/object_bl.xml +- name: objects/object_blkobj + xml_path: assets/xml/objects/object_blkobj.xml +- name: objects/object_bob + xml_path: assets/xml/objects/object_bob.xml +- name: objects/object_boj + xml_path: assets/xml/objects/object_boj.xml +- name: objects/object_bombf + xml_path: assets/xml/objects/object_bombf.xml +- name: objects/object_bombiwa + xml_path: assets/xml/objects/object_bombiwa.xml +- name: objects/object_bowl + xml_path: assets/xml/objects/object_bowl.xml +- name: objects/object_box + xml_path: assets/xml/objects/object_box.xml +- name: objects/object_brob + xml_path: assets/xml/objects/object_brob.xml +- name: objects/object_bubble + xml_path: assets/xml/objects/object_bubble.xml +- name: objects/object_bv + xml_path: assets/xml/objects/object_bv_pal.xml +- name: objects/object_bw + xml_path: assets/xml/objects/object_bw.xml +- name: objects/object_bwall + xml_path: assets/xml/objects/object_bwall.xml +- name: objects/object_bxa + xml_path: assets/xml/objects/object_bxa.xml +- name: objects/object_cne + xml_path: assets/xml/objects/object_cne.xml +- name: objects/object_cob + xml_path: assets/xml/objects/object_cob.xml +- name: objects/object_cow + xml_path: assets/xml/objects/object_cow.xml +- name: objects/object_crow + xml_path: assets/xml/objects/object_crow.xml +- name: objects/object_cs + xml_path: assets/xml/objects/object_cs.xml +- name: objects/object_d_elevator + xml_path: assets/xml/objects/object_d_elevator.xml +- name: objects/object_d_hsblock + xml_path: assets/xml/objects/object_d_hsblock.xml +- name: objects/object_d_lift + xml_path: assets/xml/objects/object_d_lift.xml +- name: objects/object_daiku + xml_path: assets/xml/objects/object_daiku.xml +- name: objects/object_ddan_objects + xml_path: assets/xml/objects/object_ddan_objects.xml +- name: objects/object_dekubaba + xml_path: assets/xml/objects/object_dekubaba.xml +- name: objects/object_dekujr + xml_path: assets/xml/objects/object_dekujr.xml +- name: objects/object_dekunuts + xml_path: assets/xml/objects/object_dekunuts.xml +- name: objects/object_demo_6k + xml_path: assets/xml/objects/object_demo_6k.xml +- name: objects/object_demo_kekkai + xml_path: assets/xml/objects/object_demo_kekkai.xml +- name: objects/object_demo_tre_lgt + xml_path: assets/xml/objects/object_demo_tre_lgt.xml +- name: objects/object_dh + xml_path: assets/xml/objects/object_dh.xml +- name: objects/object_dnk + xml_path: assets/xml/objects/object_dnk.xml +- name: objects/object_dns + xml_path: assets/xml/objects/object_dns.xml +- name: objects/object_dodojr + xml_path: assets/xml/objects/object_dodojr.xml +- name: objects/object_dodongo + xml_path: assets/xml/objects/object_dodongo.xml +- name: objects/object_dog + xml_path: assets/xml/objects/object_dog.xml +- name: objects/object_door_gerudo + xml_path: assets/xml/objects/object_door_gerudo.xml +- name: objects/object_door_killer + xml_path: assets/xml/objects/object_door_killer.xml +- name: objects/object_ds + xml_path: assets/xml/objects/object_ds.xml +- name: objects/object_ds2 + xml_path: assets/xml/objects/object_ds2.xml +- name: objects/object_du + xml_path: assets/xml/objects/object_du_pal.xml +- name: objects/object_dy_obj + xml_path: assets/xml/objects/object_dy_obj.xml +- name: objects/object_ec + xml_path: assets/xml/objects/object_ec.xml +- name: objects/object_efc_crystal_light + xml_path: assets/xml/objects/object_efc_crystal_light.xml +- name: objects/object_efc_doughnut + xml_path: assets/xml/objects/object_efc_doughnut.xml +- name: objects/object_efc_erupc + xml_path: assets/xml/objects/object_efc_erupc.xml +- name: objects/object_efc_fire_ball + xml_path: assets/xml/objects/object_efc_fire_ball.xml +- name: objects/object_efc_flash + xml_path: assets/xml/objects/object_efc_flash.xml +- name: objects/object_efc_lgt_shower + xml_path: assets/xml/objects/object_efc_lgt_shower.xml +- name: objects/object_efc_star_field + xml_path: assets/xml/objects/object_efc_star_field.xml +- name: objects/object_efc_tw + xml_path: assets/xml/objects/object_efc_tw.xml +- name: objects/object_ei + xml_path: assets/xml/objects/object_ei.xml +- name: objects/object_fa + xml_path: assets/xml/objects/object_fa.xml +- name: objects/object_fd + xml_path: assets/xml/objects/object_fd_pal.xml +- name: objects/object_fd2 + xml_path: assets/xml/objects/object_fd2.xml +- name: objects/object_fhg + xml_path: assets/xml/objects/object_fhg_pal.xml +- name: objects/object_fire + xml_path: assets/xml/objects/object_fire.xml +- name: objects/object_firefly + xml_path: assets/xml/objects/object_firefly.xml +- name: objects/object_fish + xml_path: assets/xml/objects/object_fish.xml +- name: objects/object_fr + xml_path: assets/xml/objects/object_fr.xml +- name: objects/object_fu + xml_path: assets/xml/objects/object_fu.xml +- name: objects/object_fw + xml_path: assets/xml/objects/object_fw.xml +- name: objects/object_fz + xml_path: assets/xml/objects/object_fz.xml +- name: objects/object_ganon + xml_path: assets/xml/objects/object_ganon_pal.xml +- name: objects/object_ganon2 + xml_path: assets/xml/objects/object_ganon2_pal.xml +- name: objects/object_ganon_anime1 + xml_path: assets/xml/objects/object_ganon_anime1.xml +- name: objects/object_ganon_anime2 + xml_path: assets/xml/objects/object_ganon_anime2.xml +- name: objects/object_ganon_anime3 + xml_path: assets/xml/objects/object_ganon_anime3.xml +- name: objects/object_ganon_objects + xml_path: assets/xml/objects/object_ganon_objects.xml +- name: objects/object_ge1 + xml_path: assets/xml/objects/object_ge1.xml +- name: objects/object_geff + xml_path: assets/xml/objects/object_geff.xml +- name: objects/object_geldb + xml_path: assets/xml/objects/object_geldb.xml +- name: objects/object_gi_arrow + xml_path: assets/xml/objects/object_gi_arrow.xml +- name: objects/object_gi_arrowcase + xml_path: assets/xml/objects/object_gi_arrowcase.xml +- name: objects/object_gi_bean + xml_path: assets/xml/objects/object_gi_bean.xml +- name: objects/object_gi_bomb_1 + xml_path: assets/xml/objects/object_gi_bomb_1.xml +- name: objects/object_gi_bomb_2 + xml_path: assets/xml/objects/object_gi_bomb_2.xml +- name: objects/object_gi_bombpouch + xml_path: assets/xml/objects/object_gi_bombpouch.xml +- name: objects/object_gi_boomerang + xml_path: assets/xml/objects/object_gi_boomerang.xml +- name: objects/object_gi_boots_2 + xml_path: assets/xml/objects/object_gi_boots_2.xml +- name: objects/object_gi_bosskey + xml_path: assets/xml/objects/object_gi_bosskey.xml +- name: objects/object_gi_bottle + xml_path: assets/xml/objects/object_gi_bottle.xml +- name: objects/object_gi_bottle_letter + xml_path: assets/xml/objects/object_gi_bottle_letter.xml +- name: objects/object_gi_bow + xml_path: assets/xml/objects/object_gi_bow.xml +- name: objects/object_gi_bracelet + xml_path: assets/xml/objects/object_gi_bracelet.xml +- name: objects/object_gi_brokensword + xml_path: assets/xml/objects/object_gi_brokensword.xml +- name: objects/object_gi_butterfly + xml_path: assets/xml/objects/object_gi_butterfly.xml +- name: objects/object_gi_clothes + xml_path: assets/xml/objects/object_gi_clothes.xml +- name: objects/object_gi_coin + xml_path: assets/xml/objects/object_gi_coin.xml +- name: objects/object_gi_compass + xml_path: assets/xml/objects/object_gi_compass.xml +- name: objects/object_gi_dekupouch + xml_path: assets/xml/objects/object_gi_dekupouch.xml +- name: objects/object_gi_egg + xml_path: assets/xml/objects/object_gi_egg.xml +- name: objects/object_gi_eye_lotion + xml_path: assets/xml/objects/object_gi_eye_lotion.xml +- name: objects/object_gi_fire + xml_path: assets/xml/objects/object_gi_fire.xml +- name: objects/object_gi_fish + xml_path: assets/xml/objects/object_gi_fish.xml +- name: objects/object_gi_frog + xml_path: assets/xml/objects/object_gi_frog.xml +- name: objects/object_gi_gerudo + xml_path: assets/xml/objects/object_gi_gerudo.xml +- name: objects/object_gi_gerudomask + xml_path: assets/xml/objects/object_gi_gerudomask.xml +- name: objects/object_gi_ghost + xml_path: assets/xml/objects/object_gi_ghost.xml +- name: objects/object_gi_glasses + xml_path: assets/xml/objects/object_gi_glasses.xml +- name: objects/object_gi_gloves + xml_path: assets/xml/objects/object_gi_gloves.xml +- name: objects/object_gi_goddess + xml_path: assets/xml/objects/object_gi_goddess.xml +- name: objects/object_gi_golonmask + xml_path: assets/xml/objects/object_gi_golonmask.xml +- name: objects/object_gi_grass + xml_path: assets/xml/objects/object_gi_grass.xml +- name: objects/object_gi_hammer + xml_path: assets/xml/objects/object_gi_hammer.xml +- name: objects/object_gi_heart + xml_path: assets/xml/objects/object_gi_heart.xml +- name: objects/object_gi_hearts + xml_path: assets/xml/objects/object_gi_hearts.xml +- name: objects/object_gi_hookshot + xml_path: assets/xml/objects/object_gi_hookshot.xml +- name: objects/object_gi_hoverboots + xml_path: assets/xml/objects/object_gi_hoverboots.xml +- name: objects/object_gi_insect + xml_path: assets/xml/objects/object_gi_insect.xml +- name: objects/object_gi_jewel + xml_path: assets/xml/objects/object_gi_jewel.xml +- name: objects/object_gi_key + xml_path: assets/xml/objects/object_gi_key.xml +- name: objects/object_gi_ki_tan_mask + xml_path: assets/xml/objects/object_gi_ki_tan_mask.xml +- name: objects/object_gi_letter + xml_path: assets/xml/objects/object_gi_letter.xml +- name: objects/object_gi_liquid + xml_path: assets/xml/objects/object_gi_liquid.xml +- name: objects/object_gi_longsword + xml_path: assets/xml/objects/object_gi_longsword.xml +- name: objects/object_gi_m_arrow + xml_path: assets/xml/objects/object_gi_m_arrow.xml +- name: objects/object_gi_magicpot + xml_path: assets/xml/objects/object_gi_magicpot.xml +- name: objects/object_gi_map + xml_path: assets/xml/objects/object_gi_map.xml +- name: objects/object_gi_medal + xml_path: assets/xml/objects/object_gi_medal.xml +- name: objects/object_gi_melody + xml_path: assets/xml/objects/object_gi_melody.xml +- name: objects/object_gi_milk + xml_path: assets/xml/objects/object_gi_milk.xml +- name: objects/object_gi_mushroom + xml_path: assets/xml/objects/object_gi_mushroom.xml +- name: objects/object_gi_niwatori + xml_path: assets/xml/objects/object_gi_niwatori.xml +- name: objects/object_gi_nuts + xml_path: assets/xml/objects/object_gi_nuts.xml +- name: objects/object_gi_ocarina + xml_path: assets/xml/objects/object_gi_ocarina.xml +- name: objects/object_gi_ocarina_0 + xml_path: assets/xml/objects/object_gi_ocarina_0.xml +- name: objects/object_gi_pachinko + xml_path: assets/xml/objects/object_gi_pachinko.xml +- name: objects/object_gi_powder + xml_path: assets/xml/objects/object_gi_powder.xml +- name: objects/object_gi_prescription + xml_path: assets/xml/objects/object_gi_prescription.xml +- name: objects/object_gi_purse + xml_path: assets/xml/objects/object_gi_purse.xml +- name: objects/object_gi_rabit_mask + xml_path: assets/xml/objects/object_gi_rabit_mask.xml +- name: objects/object_gi_redead_mask + xml_path: assets/xml/objects/object_gi_redead_mask.xml +- name: objects/object_gi_rupy + xml_path: assets/xml/objects/object_gi_rupy.xml +- name: objects/object_gi_saw + xml_path: assets/xml/objects/object_gi_saw.xml +- name: objects/object_gi_scale + xml_path: assets/xml/objects/object_gi_scale.xml +- name: objects/object_gi_seed + xml_path: assets/xml/objects/object_gi_seed.xml +- name: objects/object_gi_shield_1 + xml_path: assets/xml/objects/object_gi_shield_1.xml +- name: objects/object_gi_shield_2 + xml_path: assets/xml/objects/object_gi_shield_2.xml +- name: objects/object_gi_shield_3 + xml_path: assets/xml/objects/object_gi_shield_3.xml +- name: objects/object_gi_skj_mask + xml_path: assets/xml/objects/object_gi_skj_mask.xml +- name: objects/object_gi_soldout + xml_path: assets/xml/objects/object_gi_soldout.xml +- name: objects/object_gi_soul + xml_path: assets/xml/objects/object_gi_soul.xml +- name: objects/object_gi_stick + xml_path: assets/xml/objects/object_gi_stick.xml +- name: objects/object_gi_sutaru + xml_path: assets/xml/objects/object_gi_sutaru.xml +- name: objects/object_gi_sword_1 + xml_path: assets/xml/objects/object_gi_sword_1.xml +- name: objects/object_gi_ticketstone + xml_path: assets/xml/objects/object_gi_ticketstone.xml +- name: objects/object_gi_truth_mask + xml_path: assets/xml/objects/object_gi_truth_mask.xml +- name: objects/object_gi_zoramask + xml_path: assets/xml/objects/object_gi_zoramask.xml +- name: objects/object_gj + xml_path: assets/xml/objects/object_gj.xml +- name: objects/object_gjyo_objects + xml_path: assets/xml/objects/object_gjyo_objects.xml +- name: objects/object_gla + xml_path: assets/xml/objects/object_gla.xml +- name: objects/object_gm + xml_path: assets/xml/objects/object_gm.xml +- name: objects/object_gnd + xml_path: assets/xml/objects/object_gnd.xml +- name: objects/object_gnd_magic + xml_path: assets/xml/objects/object_gnd_magic.xml +- name: objects/object_gndd + xml_path: assets/xml/objects/object_gndd.xml +- name: objects/object_god_lgt + xml_path: assets/xml/objects/object_god_lgt.xml +- name: objects/object_gol + xml_path: assets/xml/objects/object_gol.xml +- name: objects/object_goma + xml_path: assets/xml/objects/object_goma_pal.xml +- name: objects/object_goroiwa + xml_path: assets/xml/objects/object_goroiwa.xml +- name: objects/object_gr + xml_path: assets/xml/objects/object_gr.xml +- name: objects/object_gs + xml_path: assets/xml/objects/object_gs.xml +- name: objects/object_gt + xml_path: assets/xml/objects/object_gt.xml +- name: objects/object_haka + xml_path: assets/xml/objects/object_haka.xml +- name: objects/object_haka_door + xml_path: assets/xml/objects/object_haka_door.xml +- name: objects/object_haka_objects + xml_path: assets/xml/objects/object_haka_objects.xml +- name: objects/object_hakach_objects + xml_path: assets/xml/objects/object_hakach_objects.xml +- name: objects/object_hata + xml_path: assets/xml/objects/object_hata.xml +- name: objects/object_heavy_object + xml_path: assets/xml/objects/object_heavy_object.xml +- name: objects/object_hidan_objects + xml_path: assets/xml/objects/object_hidan_objects.xml +- name: objects/object_hintnuts + xml_path: assets/xml/objects/object_hintnuts.xml +- name: objects/object_hni + xml_path: assets/xml/objects/object_hni.xml +- name: objects/object_horse + xml_path: assets/xml/objects/object_horse.xml +- name: objects/object_horse_ganon + xml_path: assets/xml/objects/object_horse_ganon.xml +- name: objects/object_horse_link_child + xml_path: assets/xml/objects/object_horse_link_child.xml +- name: objects/object_horse_normal + xml_path: assets/xml/objects/object_horse_normal.xml +- name: objects/object_horse_zelda + xml_path: assets/xml/objects/object_horse_zelda.xml +- name: objects/object_hs + xml_path: assets/xml/objects/object_hs.xml +- name: objects/object_human + xml_path: assets/xml/objects/object_human.xml +- name: objects/object_ice_objects + xml_path: assets/xml/objects/object_ice_objects.xml +- name: objects/object_ik + xml_path: assets/xml/objects/object_ik.xml +- name: objects/object_im + xml_path: assets/xml/objects/object_im.xml +- name: objects/object_in + xml_path: assets/xml/objects/object_in.xml +- name: objects/object_ingate + xml_path: assets/xml/objects/object_ingate.xml +- name: objects/object_jj + xml_path: assets/xml/objects/object_jj.xml +- name: objects/object_js + xml_path: assets/xml/objects/object_js.xml +- name: objects/object_jya_door + xml_path: assets/xml/objects/object_jya_door.xml +- name: objects/object_jya_iron + xml_path: assets/xml/objects/object_jya_iron.xml +- name: objects/object_jya_obj + xml_path: assets/xml/objects/object_jya_obj.xml +- name: objects/object_ka + xml_path: assets/xml/objects/object_ka.xml +- name: objects/object_kanban + xml_path: assets/xml/objects/object_kanban.xml +- name: objects/object_kibako2 + xml_path: assets/xml/objects/object_kibako2.xml +- name: objects/object_kingdodongo + xml_path: assets/xml/objects/object_kingdodongo_pal.xml +- name: objects/object_km1 + xml_path: assets/xml/objects/object_km1.xml +- name: objects/object_kusa + xml_path: assets/xml/objects/object_kusa.xml +- name: objects/object_kw1 + xml_path: assets/xml/objects/object_kw1.xml +- name: objects/object_kz + xml_path: assets/xml/objects/object_kz.xml +- name: objects/object_light_ring + xml_path: assets/xml/objects/object_light_ring.xml +- name: objects/object_lightbox + xml_path: assets/xml/objects/object_lightbox.xml +- name: objects/object_lightswitch + xml_path: assets/xml/objects/object_lightswitch.xml +- name: objects/object_link_boy + xml_path: assets/xml/objects/object_link_boy.xml +- name: objects/object_link_child + xml_path: assets/xml/objects/object_link_child.xml +- name: objects/object_ma1 + xml_path: assets/xml/objects/object_ma1.xml +- name: objects/object_ma2 + xml_path: assets/xml/objects/object_ma2.xml +- name: objects/object_mag + xml_path: assets/xml/objects/object_mag.xml +- name: objects/object_mamenoki + xml_path: assets/xml/objects/object_mamenoki.xml +- name: objects/object_mastergolon + xml_path: assets/xml/objects/object_mastergolon.xml +- name: objects/object_masterkokiri + xml_path: assets/xml/objects/object_masterkokiri.xml +- name: objects/object_masterkokirihead + xml_path: assets/xml/objects/object_masterkokirihead.xml +- name: objects/object_masterzoora + xml_path: assets/xml/objects/object_masterzoora.xml +- name: objects/object_mb + xml_path: assets/xml/objects/object_mb.xml +- name: objects/object_md + xml_path: assets/xml/objects/object_md.xml +- name: objects/object_medal + xml_path: assets/xml/objects/object_medal.xml +- name: objects/object_menkuri_objects + xml_path: assets/xml/objects/object_menkuri_objects.xml +- name: objects/object_mir_ray + xml_path: assets/xml/objects/object_mir_ray.xml +- name: objects/object_mizu_objects + xml_path: assets/xml/objects/object_mizu_objects.xml +- name: objects/object_mjin + xml_path: assets/xml/objects/object_mjin.xml +- name: objects/object_mjin_dark + xml_path: assets/xml/objects/object_mjin_dark.xml +- name: objects/object_mjin_flame + xml_path: assets/xml/objects/object_mjin_flame.xml +- name: objects/object_mjin_flash + xml_path: assets/xml/objects/object_mjin_flash.xml +- name: objects/object_mjin_ice + xml_path: assets/xml/objects/object_mjin_ice.xml +- name: objects/object_mjin_oka + xml_path: assets/xml/objects/object_mjin_oka.xml +- name: objects/object_mjin_soul + xml_path: assets/xml/objects/object_mjin_soul.xml +- name: objects/object_mjin_wind + xml_path: assets/xml/objects/object_mjin_wind.xml +- name: objects/object_mk + xml_path: assets/xml/objects/object_mk.xml +- name: objects/object_mm + xml_path: assets/xml/objects/object_mm.xml +- name: objects/object_mo + xml_path: assets/xml/objects/object_mo_pal.xml +- name: objects/object_mori_hineri1 + xml_path: assets/xml/objects/object_mori_hineri1.xml +- name: objects/object_mori_hineri1a + xml_path: assets/xml/objects/object_mori_hineri1a.xml +- name: objects/object_mori_hineri2 + xml_path: assets/xml/objects/object_mori_hineri2.xml +- name: objects/object_mori_hineri2a + xml_path: assets/xml/objects/object_mori_hineri2a.xml +- name: objects/object_mori_objects + xml_path: assets/xml/objects/object_mori_objects.xml +- name: objects/object_mori_tex + xml_path: assets/xml/objects/object_mori_tex.xml +- name: objects/object_ms + xml_path: assets/xml/objects/object_ms.xml +- name: objects/object_mu + xml_path: assets/xml/objects/object_mu.xml +- name: objects/object_nb + xml_path: assets/xml/objects/object_nb.xml +- name: objects/object_niw + xml_path: assets/xml/objects/object_niw.xml +- name: objects/object_nwc + xml_path: assets/xml/objects/object_nwc.xml +- name: objects/object_ny + xml_path: assets/xml/objects/object_ny.xml +- name: objects/object_o_anime + xml_path: assets/xml/objects/object_o_anime.xml +- name: objects/object_oA1 + xml_path: assets/xml/objects/object_oA1.xml +- name: objects/object_oA2 + xml_path: assets/xml/objects/object_oA2.xml +- name: objects/object_oA3 + xml_path: assets/xml/objects/object_oA3.xml +- name: objects/object_oA4 + xml_path: assets/xml/objects/object_oA4.xml +- name: objects/object_oA5 + xml_path: assets/xml/objects/object_oA5.xml +- name: objects/object_oA6 + xml_path: assets/xml/objects/object_oA6.xml +- name: objects/object_oA7 + xml_path: assets/xml/objects/object_oA7.xml +- name: objects/object_oA8 + xml_path: assets/xml/objects/object_oA8.xml +- name: objects/object_oA9 + xml_path: assets/xml/objects/object_oA9.xml +- name: objects/object_oA10 + xml_path: assets/xml/objects/object_oA10.xml +- name: objects/object_oA11 + xml_path: assets/xml/objects/object_oA11.xml +- name: objects/object_oB1 + xml_path: assets/xml/objects/object_oB1.xml +- name: objects/object_oB2 + xml_path: assets/xml/objects/object_oB2.xml +- name: objects/object_oB3 + xml_path: assets/xml/objects/object_oB3.xml +- name: objects/object_oB4 + xml_path: assets/xml/objects/object_oB4.xml +- name: objects/object_oE1 + xml_path: assets/xml/objects/object_oE1.xml +- name: objects/object_oE1s + xml_path: assets/xml/objects/object_oE1s.xml +- name: objects/object_oE2 + xml_path: assets/xml/objects/object_oE2.xml +- name: objects/object_oE3 + xml_path: assets/xml/objects/object_oE3.xml +- name: objects/object_oE4 + xml_path: assets/xml/objects/object_oE4.xml +- name: objects/object_oE4s + xml_path: assets/xml/objects/object_oE4s.xml +- name: objects/object_oE5 + xml_path: assets/xml/objects/object_oE5.xml +- name: objects/object_oE6 + xml_path: assets/xml/objects/object_oE6.xml +- name: objects/object_oE7 + xml_path: assets/xml/objects/object_oE7.xml +- name: objects/object_oE8 + xml_path: assets/xml/objects/object_oE8.xml +- name: objects/object_oE9 + xml_path: assets/xml/objects/object_oE9.xml +- name: objects/object_oE10 + xml_path: assets/xml/objects/object_oE10.xml +- name: objects/object_oE11 + xml_path: assets/xml/objects/object_oE11.xml +- name: objects/object_oE12 + xml_path: assets/xml/objects/object_oE12.xml +- name: objects/object_oE_anime + xml_path: assets/xml/objects/object_oE_anime.xml +- name: objects/object_oF1d_map + xml_path: assets/xml/objects/object_oF1d_map.xml +- name: objects/object_oF1s + xml_path: assets/xml/objects/object_oF1s.xml +- name: objects/object_okuta + xml_path: assets/xml/objects/object_okuta.xml +- name: objects/object_opening_demo1 + xml_path: assets/xml/objects/object_opening_demo1.xml +- name: objects/object_os + xml_path: assets/xml/objects/object_os.xml +- name: objects/object_os_anime + xml_path: assets/xml/objects/object_os_anime.xml +- name: objects/object_ossan + xml_path: assets/xml/objects/object_ossan.xml +- name: objects/object_ouke_haka + xml_path: assets/xml/objects/object_ouke_haka.xml +- name: objects/object_owl + xml_path: assets/xml/objects/object_owl.xml +- name: objects/object_peehat + xml_path: assets/xml/objects/object_peehat.xml +- name: objects/object_po_composer + xml_path: assets/xml/objects/object_po_composer.xml +- name: objects/object_po_field + xml_path: assets/xml/objects/object_po_field.xml +- name: objects/object_po_sisters + xml_path: assets/xml/objects/object_po_sisters.xml +- name: objects/object_poh + xml_path: assets/xml/objects/object_poh.xml +- name: objects/object_ps + xml_path: assets/xml/objects/object_ps.xml +- name: objects/object_pu_box + xml_path: assets/xml/objects/object_pu_box.xml +- name: objects/object_rd + xml_path: assets/xml/objects/object_rd.xml +- name: objects/object_reeba + xml_path: assets/xml/objects/object_reeba.xml +- name: objects/object_relay_objects + xml_path: assets/xml/objects/object_relay_objects.xml +- name: objects/object_rl + xml_path: assets/xml/objects/object_rl.xml +- name: objects/object_rr + xml_path: assets/xml/objects/object_rr.xml +- name: objects/object_rs + xml_path: assets/xml/objects/object_rs.xml +- name: objects/object_ru1 + xml_path: assets/xml/objects/object_ru1.xml +- name: objects/object_ru2 + xml_path: assets/xml/objects/object_ru2.xml +- name: objects/object_sa + xml_path: assets/xml/objects/object_sa.xml +- name: objects/object_sb + xml_path: assets/xml/objects/object_sb.xml +- name: objects/object_sd + xml_path: assets/xml/objects/object_sd.xml +- name: objects/object_shop_dungen + xml_path: assets/xml/objects/object_shop_dungen.xml +- name: objects/object_shopnuts + xml_path: assets/xml/objects/object_shopnuts.xml +- name: objects/object_siofuki + xml_path: assets/xml/objects/object_siofuki.xml +- name: objects/object_sk2 + xml_path: assets/xml/objects/object_sk2.xml +- name: objects/object_skb + xml_path: assets/xml/objects/object_skb.xml +- name: objects/object_skj + xml_path: assets/xml/objects/object_skj.xml +- name: objects/object_spot00_break + xml_path: assets/xml/objects/object_spot00_break.xml +- name: objects/object_spot00_objects + xml_path: assets/xml/objects/object_spot00_objects.xml +- name: objects/object_spot01_matoya + xml_path: assets/xml/objects/object_spot01_matoya.xml +- name: objects/object_spot01_matoyab + xml_path: assets/xml/objects/object_spot01_matoyab.xml +- name: objects/object_spot01_objects + xml_path: assets/xml/objects/object_spot01_objects.xml +- name: objects/object_spot01_objects2 + xml_path: assets/xml/objects/object_spot01_objects2.xml +- name: objects/object_spot02_objects + xml_path: assets/xml/objects/object_spot02_objects.xml +- name: objects/object_spot03_object + xml_path: assets/xml/objects/object_spot03_object.xml +- name: objects/object_spot04_objects + xml_path: assets/xml/objects/object_spot04_objects.xml +- name: objects/object_spot05_objects + xml_path: assets/xml/objects/object_spot05_objects.xml +- name: objects/object_spot06_objects + xml_path: assets/xml/objects/object_spot06_objects.xml +- name: objects/object_spot07_object + xml_path: assets/xml/objects/object_spot07_object.xml +- name: objects/object_spot08_obj + xml_path: assets/xml/objects/object_spot08_obj.xml +- name: objects/object_spot09_obj + xml_path: assets/xml/objects/object_spot09_obj.xml +- name: objects/object_spot11_obj + xml_path: assets/xml/objects/object_spot11_obj.xml +- name: objects/object_spot12_obj + xml_path: assets/xml/objects/object_spot12_obj.xml +- name: objects/object_spot15_obj + xml_path: assets/xml/objects/object_spot15_obj.xml +- name: objects/object_spot16_obj + xml_path: assets/xml/objects/object_spot16_obj.xml +- name: objects/object_spot17_obj + xml_path: assets/xml/objects/object_spot17_obj.xml +- name: objects/object_spot18_obj + xml_path: assets/xml/objects/object_spot18_obj.xml +- name: objects/object_ssh + xml_path: assets/xml/objects/object_ssh.xml +- name: objects/object_sst + xml_path: assets/xml/objects/object_sst_pal.xml +- name: objects/object_st + xml_path: assets/xml/objects/object_st.xml +- name: objects/object_stream + xml_path: assets/xml/objects/object_stream.xml +- name: objects/object_syokudai + xml_path: assets/xml/objects/object_syokudai.xml +- name: objects/object_ta + xml_path: assets/xml/objects/object_ta.xml +- name: objects/object_timeblock + xml_path: assets/xml/objects/object_timeblock.xml +- name: objects/object_tite + xml_path: assets/xml/objects/object_tite.xml +- name: objects/object_tk + xml_path: assets/xml/objects/object_tk.xml +- name: objects/object_toki_objects + xml_path: assets/xml/objects/object_toki_objects.xml +- name: objects/object_torch2 + xml_path: assets/xml/objects/object_torch2.xml +- name: objects/object_toryo + xml_path: assets/xml/objects/object_toryo.xml +- name: objects/object_tp + xml_path: assets/xml/objects/object_tp.xml +- name: objects/object_tr + xml_path: assets/xml/objects/object_tr.xml +- name: objects/object_trap + xml_path: assets/xml/objects/object_trap.xml +- name: objects/object_triforce_spot + xml_path: assets/xml/objects/object_triforce_spot.xml +- name: objects/object_ts + xml_path: assets/xml/objects/object_ts.xml +- name: objects/object_tsubo + xml_path: assets/xml/objects/object_tsubo.xml +- name: objects/object_tw + xml_path: assets/xml/objects/object_tw_pal.xml +- name: objects/object_umajump + xml_path: assets/xml/objects/object_umajump.xml +- name: objects/object_vali + xml_path: assets/xml/objects/object_vali.xml +- name: objects/object_vase + xml_path: assets/xml/objects/object_vase.xml +- name: objects/object_vm + xml_path: assets/xml/objects/object_vm.xml +- name: objects/object_wallmaster + xml_path: assets/xml/objects/object_wallmaster.xml +- name: objects/object_warp1 + xml_path: assets/xml/objects/object_warp1.xml +- name: objects/object_warp2 + xml_path: assets/xml/objects/object_warp2.xml +- name: objects/object_wf + xml_path: assets/xml/objects/object_wf.xml +- name: objects/object_wood02 + xml_path: assets/xml/objects/object_wood02.xml +- name: objects/object_xc + xml_path: assets/xml/objects/object_xc_pal.xml +- name: objects/object_yabusame_point + xml_path: assets/xml/objects/object_yabusame_point.xml +- name: objects/object_ydan_objects + xml_path: assets/xml/objects/object_ydan_objects.xml +- name: objects/object_yukabyun + xml_path: assets/xml/objects/object_yukabyun.xml +- name: objects/object_zf + xml_path: assets/xml/objects/object_zf.xml +- name: objects/object_zg + xml_path: assets/xml/objects/object_zg.xml +- name: objects/object_zl1 + xml_path: assets/xml/objects/object_zl1.xml +- name: objects/object_zl2 + xml_path: assets/xml/objects/object_zl2.xml +- name: objects/object_zl2_anime1 + xml_path: assets/xml/objects/object_zl2_anime1.xml +- name: objects/object_zl2_anime2 + xml_path: assets/xml/objects/object_zl2_anime2.xml +- name: objects/object_zl4 + xml_path: assets/xml/objects/object_zl4.xml +- name: objects/object_zo + xml_path: assets/xml/objects/object_zo.xml +- name: overlays/ovl_Arrow_Fire + xml_path: assets/xml/overlays/ovl_Arrow_Fire.xml + start_offset: 0x960 + end_offset: 0x1D80 +- name: overlays/ovl_Arrow_Ice + xml_path: assets/xml/overlays/ovl_Arrow_Ice.xml + start_offset: 0x980 + end_offset: 0x1DA0 +- name: overlays/ovl_Arrow_Light + xml_path: assets/xml/overlays/ovl_Arrow_Light.xml + start_offset: 0x990 + end_offset: 0x1DB0 +- name: overlays/ovl_Bg_Ganon_Otyuka + xml_path: assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml + start_offset: 0x1110 + end_offset: 0x24EC +- name: overlays/ovl_Bg_Jya_Cobra + xml_path: assets/xml/overlays/ovl_Bg_Jya_Cobra.xml + start_offset: 0x1830 + end_offset: 0x18A8 +- name: overlays/ovl_Boss_Dodongo + xml_path: assets/xml/overlays/ovl_Boss_Dodongo.xml + start_offset: 0x61C8 + end_offset: 0x91C8 +- name: overlays/ovl_Boss_Ganon + xml_path: assets/xml/overlays/ovl_Boss_Ganon.xml + start_offset: 0xE388 + end_offset: 0x20EA8 +- name: overlays/ovl_Boss_Ganon2 + xml_path: assets/xml/overlays/ovl_Boss_Ganon2.xml + start_offset: 0x9F38 + end_offset: 0x103E8 +- name: overlays/ovl_Boss_Sst + xml_path: assets/xml/overlays/ovl_Boss_Sst.xml + start_offset: 0xA330 + end_offset: 0xACE0 +- name: overlays/ovl_Demo_Shd + xml_path: assets/xml/overlays/ovl_Demo_Shd.xml + start_offset: 0x410 + end_offset: 0x2390 +- name: overlays/ovl_Effect_Ss_Fhg_Flash + xml_path: assets/xml/overlays/ovl_Effect_Ss_Fhg_Flash.xml + start_offset: 0x9F0 + end_offset: 0xEA8 +- name: overlays/ovl_En_Bili + xml_path: assets/xml/overlays/ovl_En_Bili.xml + start_offset: 0x1E40 + end_offset: 0x1E60 +- name: overlays/ovl_En_Clear_Tag + xml_path: assets/xml/overlays/ovl_En_Clear_Tag.xml + start_offset: 0x2600 + end_offset: 0x8900 +- name: overlays/ovl_En_Ganon_Mant + xml_path: assets/xml/overlays/ovl_En_Ganon_Mant.xml + start_offset: 0x11E8 + end_offset: 0x40E8 +- name: overlays/ovl_En_Ganon_Organ + xml_path: assets/xml/overlays/ovl_En_Ganon_Organ.xml + start_offset: 0x328 + end_offset: 0x6EB0 +- name: overlays/ovl_En_Holl + xml_path: assets/xml/overlays/ovl_En_Holl.xml + start_offset: 0xE68 + end_offset: 0xED0 +- name: overlays/ovl_En_Jsjutan + xml_path: assets/xml/overlays/ovl_En_Jsjutan.xml + start_offset: 0x12B8 + end_offset: 0x4C50 +- name: overlays/ovl_En_Kanban + xml_path: assets/xml/overlays/ovl_En_Kanban.xml + start_offset: 0x2E70 + end_offset: 0x2F30 +- name: overlays/ovl_En_Sda + xml_path: assets/xml/overlays/ovl_En_Sda.xml + start_offset: 0x14A8 + end_offset: 0x1538 +- name: overlays/ovl_En_Ssh + xml_path: assets/xml/overlays/ovl_En_Ssh.xml + start_offset: 0x2150 + end_offset: 0x21E0 +- name: overlays/ovl_En_St + xml_path: assets/xml/overlays/ovl_En_St.xml + start_offset: 0x26A0 + end_offset: 0x2730 +- name: overlays/ovl_En_Sth + xml_path: assets/xml/overlays/ovl_En_Sth.xml + start_offset: 0xE60 + end_offset: 0x3E34 +- name: overlays/ovl_End_Title + xml_path: assets/xml/overlays/ovl_End_Title.xml + start_offset: 0x6F0 + end_offset: 0x4098 +- name: overlays/ovl_file_choose + xml_path: assets/xml/overlays/ovl_file_choose_pal_n64.xml + start_offset: 0xF0A0 + end_offset: 0xF9B0 +- name: overlays/ovl_Magic_Dark + xml_path: assets/xml/overlays/ovl_Magic_Dark.xml + start_offset: 0xC90 + end_offset: 0x16C0 +- name: overlays/ovl_Magic_Fire + xml_path: assets/xml/overlays/ovl_Magic_Fire.xml + start_offset: 0xB20 + end_offset: 0x2170 +- name: overlays/ovl_Magic_Wind + xml_path: assets/xml/overlays/ovl_Magic_Wind.xml + start_offset: 0x6A0 + end_offset: 0x1BB8 +- name: overlays/ovl_Oceff_Spot + xml_path: assets/xml/overlays/ovl_Oceff_Spot.xml + start_offset: 0x780 + end_offset: 0xE58 +- name: overlays/ovl_Oceff_Storm + xml_path: assets/xml/overlays/ovl_Oceff_Storm.xml + start_offset: 0x740 + end_offset: 0x1AD0 +- name: overlays/ovl_Oceff_Wipe + xml_path: assets/xml/overlays/ovl_Oceff_Wipe.xml + start_offset: 0x4F0 + end_offset: 0xCB0 +- name: overlays/ovl_Oceff_Wipe2 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe2.xml + start_offset: 0x430 + end_offset: 0x1698 +- name: overlays/ovl_Oceff_Wipe3 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe3.xml + start_offset: 0x430 + end_offset: 0x1678 +- name: overlays/ovl_Oceff_Wipe4 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe4.xml + start_offset: 0x410 + end_offset: 0xEF8 +- name: scenes/dungeons/bdan + xml_path: assets/xml/scenes/dungeons/bdan.xml +- name: scenes/dungeons/bdan_boss + xml_path: assets/xml/scenes/dungeons/bdan_boss.xml +- name: scenes/dungeons/Bmori1 + xml_path: assets/xml/scenes/dungeons/Bmori1.xml +- name: scenes/dungeons/ddan + xml_path: assets/xml/scenes/dungeons/ddan.xml +- name: scenes/dungeons/ddan_boss + xml_path: assets/xml/scenes/dungeons/ddan_boss_v2.xml +- name: scenes/dungeons/FIRE_bs + xml_path: assets/xml/scenes/dungeons/FIRE_bs.xml +- name: scenes/dungeons/ganon + xml_path: assets/xml/scenes/dungeons/ganon.xml +- name: scenes/dungeons/ganon_boss + xml_path: assets/xml/scenes/dungeons/ganon_boss.xml +- name: scenes/dungeons/ganon_demo + xml_path: assets/xml/scenes/dungeons/ganon_demo.xml +- name: scenes/dungeons/ganon_final + xml_path: assets/xml/scenes/dungeons/ganon_final.xml +- name: scenes/dungeons/ganon_sonogo + xml_path: assets/xml/scenes/dungeons/ganon_sonogo.xml +- name: scenes/dungeons/ganontika + xml_path: assets/xml/scenes/dungeons/ganontika.xml +- name: scenes/dungeons/ganontikasonogo + xml_path: assets/xml/scenes/dungeons/ganontikasonogo.xml +- name: scenes/dungeons/gerudoway + xml_path: assets/xml/scenes/dungeons/gerudoway.xml +- name: scenes/dungeons/HAKAdan + xml_path: assets/xml/scenes/dungeons/HAKAdan.xml +- name: scenes/dungeons/HAKAdan_bs + xml_path: assets/xml/scenes/dungeons/HAKAdan_bs.xml +- name: scenes/dungeons/HAKAdanCH + xml_path: assets/xml/scenes/dungeons/HAKAdanCH.xml +- name: scenes/dungeons/HIDAN + xml_path: assets/xml/scenes/dungeons/HIDAN.xml +- name: scenes/dungeons/ice_doukutu + xml_path: assets/xml/scenes/dungeons/ice_doukutu_pal_n64.xml +- name: scenes/dungeons/jyasinboss + xml_path: assets/xml/scenes/dungeons/jyasinboss.xml +- name: scenes/dungeons/jyasinzou + xml_path: assets/xml/scenes/dungeons/jyasinzou.xml +- name: scenes/dungeons/men + xml_path: assets/xml/scenes/dungeons/men.xml +- name: scenes/dungeons/MIZUsin + xml_path: assets/xml/scenes/dungeons/MIZUsin.xml +- name: scenes/dungeons/MIZUsin_bs + xml_path: assets/xml/scenes/dungeons/MIZUsin_bs.xml +- name: scenes/dungeons/moribossroom + xml_path: assets/xml/scenes/dungeons/moribossroom.xml +- name: scenes/dungeons/ydan + xml_path: assets/xml/scenes/dungeons/ydan.xml +- name: scenes/dungeons/ydan_boss + xml_path: assets/xml/scenes/dungeons/ydan_boss.xml +- name: scenes/indoors/bowling + xml_path: assets/xml/scenes/indoors/bowling.xml +- name: scenes/indoors/daiyousei_izumi + xml_path: assets/xml/scenes/indoors/daiyousei_izumi.xml +- name: scenes/indoors/hairal_niwa + xml_path: assets/xml/scenes/indoors/hairal_niwa.xml +- name: scenes/indoors/hairal_niwa_n + xml_path: assets/xml/scenes/indoors/hairal_niwa_n.xml +- name: scenes/indoors/hakasitarelay + xml_path: assets/xml/scenes/indoors/hakasitarelay.xml +- name: scenes/indoors/hut + xml_path: assets/xml/scenes/indoors/hut.xml +- name: scenes/indoors/hylia_labo + xml_path: assets/xml/scenes/indoors/hylia_labo.xml +- name: scenes/indoors/impa + xml_path: assets/xml/scenes/indoors/impa.xml +- name: scenes/indoors/kakariko + xml_path: assets/xml/scenes/indoors/kakariko.xml +- name: scenes/indoors/kenjyanoma + xml_path: assets/xml/scenes/indoors/kenjyanoma.xml +- name: scenes/indoors/kokiri_home + xml_path: assets/xml/scenes/indoors/kokiri_home.xml +- name: scenes/indoors/kokiri_home3 + xml_path: assets/xml/scenes/indoors/kokiri_home3.xml +- name: scenes/indoors/kokiri_home4 + xml_path: assets/xml/scenes/indoors/kokiri_home4.xml +- name: scenes/indoors/kokiri_home5 + xml_path: assets/xml/scenes/indoors/kokiri_home5.xml +- name: scenes/indoors/labo + xml_path: assets/xml/scenes/indoors/labo.xml +- name: scenes/indoors/link_home + xml_path: assets/xml/scenes/indoors/link_home.xml +- name: scenes/indoors/mahouya + xml_path: assets/xml/scenes/indoors/mahouya.xml +- name: scenes/indoors/malon_stable + xml_path: assets/xml/scenes/indoors/malon_stable.xml +- name: scenes/indoors/miharigoya + xml_path: assets/xml/scenes/indoors/miharigoya.xml +- name: scenes/indoors/nakaniwa + xml_path: assets/xml/scenes/indoors/nakaniwa.xml +- name: scenes/indoors/souko + xml_path: assets/xml/scenes/indoors/souko.xml +- name: scenes/indoors/syatekijyou + xml_path: assets/xml/scenes/indoors/syatekijyou.xml +- name: scenes/indoors/takaraya + xml_path: assets/xml/scenes/indoors/takaraya.xml +- name: scenes/indoors/tent + xml_path: assets/xml/scenes/indoors/tent.xml +- name: scenes/indoors/tokinoma + xml_path: assets/xml/scenes/indoors/tokinoma_pal_n64.xml +- name: scenes/indoors/yousei_izumi_tate + xml_path: assets/xml/scenes/indoors/yousei_izumi_tate.xml +- name: scenes/indoors/yousei_izumi_yoko + xml_path: assets/xml/scenes/indoors/yousei_izumi_yoko.xml +- name: scenes/misc/enrui + xml_path: assets/xml/scenes/misc/enrui.xml +- name: scenes/misc/entra + xml_path: assets/xml/scenes/misc/entra.xml +- name: scenes/misc/entra_n + xml_path: assets/xml/scenes/misc/entra_n.xml +- name: scenes/misc/hakaana + xml_path: assets/xml/scenes/misc/hakaana.xml +- name: scenes/misc/hakaana2 + xml_path: assets/xml/scenes/misc/hakaana2.xml +- name: scenes/misc/hakaana_ouke + xml_path: assets/xml/scenes/misc/hakaana_ouke.xml +- name: scenes/misc/hiral_demo + xml_path: assets/xml/scenes/misc/hiral_demo_pal_n64.xml +- name: scenes/misc/kakariko3 + xml_path: assets/xml/scenes/misc/kakariko3.xml +- name: scenes/misc/kakusiana + xml_path: assets/xml/scenes/misc/kakusiana.xml +- name: scenes/misc/kinsuta + xml_path: assets/xml/scenes/misc/kinsuta.xml +- name: scenes/misc/market_alley + xml_path: assets/xml/scenes/misc/market_alley.xml +- name: scenes/misc/market_alley_n + xml_path: assets/xml/scenes/misc/market_alley_n.xml +- name: scenes/misc/market_day + xml_path: assets/xml/scenes/misc/market_day.xml +- name: scenes/misc/market_night + xml_path: assets/xml/scenes/misc/market_night.xml +- name: scenes/misc/market_ruins + xml_path: assets/xml/scenes/misc/market_ruins.xml +- name: scenes/misc/shrine + xml_path: assets/xml/scenes/misc/shrine.xml +- name: scenes/misc/shrine_n + xml_path: assets/xml/scenes/misc/shrine_n.xml +- name: scenes/misc/shrine_r + xml_path: assets/xml/scenes/misc/shrine_r.xml +- name: scenes/misc/turibori + xml_path: assets/xml/scenes/misc/turibori.xml +- name: scenes/overworld/ganon_tou + xml_path: assets/xml/scenes/overworld/ganon_tou.xml +- name: scenes/overworld/spot00 + xml_path: assets/xml/scenes/overworld/spot00_pal_n64.xml +- name: scenes/overworld/spot01 + xml_path: assets/xml/scenes/overworld/spot01_pal_n64.xml +- name: scenes/overworld/spot02 + xml_path: assets/xml/scenes/overworld/spot02.xml +- name: scenes/overworld/spot03 + xml_path: assets/xml/scenes/overworld/spot03.xml +- name: scenes/overworld/spot04 + xml_path: assets/xml/scenes/overworld/spot04_pal_n64.xml +- name: scenes/overworld/spot05 + xml_path: assets/xml/scenes/overworld/spot05_pal_n64.xml +- name: scenes/overworld/spot06 + xml_path: assets/xml/scenes/overworld/spot06_pal_n64.xml +- name: scenes/overworld/spot07 + xml_path: assets/xml/scenes/overworld/spot07_pal_n64.xml +- name: scenes/overworld/spot08 + xml_path: assets/xml/scenes/overworld/spot08.xml +- name: scenes/overworld/spot09 + xml_path: assets/xml/scenes/overworld/spot09_pal_n64.xml +- name: scenes/overworld/spot10 + xml_path: assets/xml/scenes/overworld/spot10.xml +- name: scenes/overworld/spot11 + xml_path: assets/xml/scenes/overworld/spot11_pal_n64.xml +- name: scenes/overworld/spot12 + xml_path: assets/xml/scenes/overworld/spot12_pal_n64.xml +- name: scenes/overworld/spot13 + xml_path: assets/xml/scenes/overworld/spot13.xml +- name: scenes/overworld/spot15 + xml_path: assets/xml/scenes/overworld/spot15.xml +- name: scenes/overworld/spot16 + xml_path: assets/xml/scenes/overworld/spot16_pal_n64.xml +- name: scenes/overworld/spot17 + xml_path: assets/xml/scenes/overworld/spot17_pal_n64.xml +- name: scenes/overworld/spot18 + xml_path: assets/xml/scenes/overworld/spot18_pal_n64.xml +- name: scenes/overworld/spot20 + xml_path: assets/xml/scenes/overworld/spot20_pal.xml +- name: scenes/shops/alley_shop + xml_path: assets/xml/scenes/shops/alley_shop.xml +- name: scenes/shops/drag + xml_path: assets/xml/scenes/shops/drag.xml +- name: scenes/shops/face_shop + xml_path: assets/xml/scenes/shops/face_shop.xml +- name: scenes/shops/golon + xml_path: assets/xml/scenes/shops/golon.xml +- name: scenes/shops/kokiri_shop + xml_path: assets/xml/scenes/shops/kokiri_shop.xml +- name: scenes/shops/night_shop + xml_path: assets/xml/scenes/shops/night_shop.xml +- name: scenes/shops/shop1 + xml_path: assets/xml/scenes/shops/shop1.xml +- name: scenes/shops/zoora + xml_path: assets/xml/scenes/shops/zoora.xml +- name: textures/backgrounds + xml_path: assets/xml/textures/backgrounds.xml +- name: textures/do_action_static + xml_path: assets/xml/textures/do_action_static_pal.xml +- name: textures/icon_item_24_static + xml_path: assets/xml/textures/icon_item_24_static.xml +- name: textures/icon_item_dungeon_static + xml_path: assets/xml/textures/icon_item_dungeon_static.xml +- name: textures/icon_item_field_static + xml_path: assets/xml/textures/icon_item_field_static.xml +- name: textures/icon_item_fra_static + xml_path: assets/xml/textures/icon_item_fra_static.xml +- name: textures/icon_item_gameover_static + xml_path: assets/xml/textures/icon_item_gameover_static_pal.xml +- name: textures/icon_item_ger_static + xml_path: assets/xml/textures/icon_item_ger_static.xml +- name: textures/icon_item_nes_static + xml_path: assets/xml/textures/icon_item_nes_static.xml +- name: textures/icon_item_static + xml_path: assets/xml/textures/icon_item_static_pal.xml +- name: textures/item_name_static + xml_path: assets/xml/textures/item_name_static_pal.xml +- name: textures/map_48x85_static + xml_path: assets/xml/textures/map_48x85_static.xml +- name: textures/map_grand_static + xml_path: assets/xml/textures/map_grand_static.xml +- name: textures/map_i_static + xml_path: assets/xml/textures/map_i_static.xml +- name: textures/map_name_static + xml_path: assets/xml/textures/map_name_static_pal.xml +- name: textures/message_static + xml_path: assets/xml/textures/message_static.xml +- name: textures/message_texture_static + xml_path: assets/xml/textures/message_texture_static.xml +- name: textures/nes_font_static + xml_path: assets/xml/textures/nes_font_static.xml +- name: textures/nintendo_rogo_static + xml_path: assets/xml/textures/nintendo_rogo_static_v2.xml +- name: textures/parameter_static + xml_path: assets/xml/textures/parameter_static.xml +- name: textures/place_title_cards + xml_path: assets/xml/textures/place_title_cards_pal.xml +- name: textures/skyboxes + xml_path: assets/xml/textures/skyboxes.xml +- name: textures/title_static + xml_path: assets/xml/textures/title_static_pal_n64.xml diff --git a/baseroms/pal-1.0/segments.csv b/baseroms/pal-1.0/segments.csv new file mode 100644 index 0000000000..28d8dbd2ce --- /dev/null +++ b/baseroms/pal-1.0/segments.csv @@ -0,0 +1,1512 @@ +Name,VRAM start +makerom,80000000 +boot,80000460 +dmadata, +Audiobank, +Audioseq, +Audiotable, +link_animetion, +icon_item_static, +icon_item_24_static, +icon_item_field_static, +icon_item_dungeon_static, +icon_item_gameover_static, +icon_item_nes_static, +icon_item_ger_static, +icon_item_fra_static, +item_name_static, +map_name_static, +do_action_static, +message_static, +message_texture_static, +nes_font_static, +nes_message_data_static, +ger_message_data_static, +fra_message_data_static, +staff_message_data_static, +map_grand_static, +map_i_static, +map_48x85_static, +code,800116E0 +n64dd,801C4EC0 +ovl_title,80800000 +ovl_select,808009C0 +ovl_opening,80803720 +ovl_file_choose,80803880 +ovl_kaleido_scope,80813F90 +ovl_player_actor,80830C00 +ovl_map_mark_data,80857380 +ovl_En_Test,8085DEE0 +ovl_En_GirlA,80863790 +ovl_En_Part,808660B0 +ovl_En_Light,808676C0 +ovl_En_Door,808684B0 +ovl_En_Box,808692F0 +ovl_En_Poh,8086AE30 +ovl_En_Okuta,8086EFC0 +ovl_En_Bom,808715A0 +ovl_En_Wallmas,80872470 +ovl_En_Dodongo,80873E80 +ovl_En_Firefly,80876C20 +ovl_En_Horse,80878D90 +ovl_En_Arrow,80884FF0 +ovl_En_Elf,808866E0 +ovl_En_Niw,8088B0A0 +ovl_En_Tite,8088E3D0 +ovl_En_Reeba,80891170 +ovl_En_Peehat,80892BE0 +ovl_En_Holl,808962E0 +ovl_En_Scene_Change,808972B0 +ovl_En_Zf,808973E0 +ovl_En_Hata,8089DEE0 +ovl_Boss_Dodongo,8089E470 +ovl_Boss_Goma,808A7F50 +ovl_En_Zl1,808ADED0 +ovl_En_Viewer,808B1CD0 +ovl_En_Goma,808B4BA0 +ovl_Bg_Pushbox,808B7830 +ovl_En_Bubble,808B7B30 +ovl_Door_Shutter,808B8F50 +ovl_En_Dodojr,808BB1D0 +ovl_En_Bdfire,808BD070 +ovl_En_Boom,808BDC00 +ovl_En_Torch2,808BE4C0 +ovl_En_Bili,808C0C60 +ovl_En_Tp,808C2F30 +ovl_En_St,808C4D80 +ovl_En_Bw,808C79F0 +ovl_En_Eiyer,808CAD60 +ovl_En_River_Sound,808CC9C0 +ovl_En_Horse_Normal,808CD350 +ovl_En_Ossan,808CF970 +ovl_Bg_Treemouth,808D5F50 +ovl_Bg_Dodoago,808D75B0 +ovl_Bg_Hidan_Dalm,808D8360 +ovl_Bg_Hidan_Hrock,808D8BB0 +ovl_En_Horse_Ganon,808D93E0 +ovl_Bg_Hidan_Rock,808DA160 +ovl_Bg_Hidan_Rsekizou,808DB250 +ovl_Bg_Hidan_Sekizou,808DBE30 +ovl_Bg_Hidan_Sima,808DD280 +ovl_Bg_Hidan_Syoku,808DE1A0 +ovl_En_Xc,808DE600 +ovl_Bg_Hidan_Curtain,808E4D90 +ovl_Bg_Spot00_Hanebasi,808E5830 +ovl_En_Mb,808E6940 +ovl_En_Bombf,808EAB50 +ovl_Bg_Hidan_Firewall,808EBFC0 +ovl_Bg_Dy_Yoseizo,808EC720 +ovl_En_Zl2,808EF520 +ovl_Bg_Hidan_Fslift,808F3C50 +ovl_En_OE2,808F4120 +ovl_Bg_Ydan_Hasi,808F4200 +ovl_Bg_Ydan_Maruta,808F49B0 +ovl_Boss_Ganondrof,808F5090 +ovl_En_Am,808F9E00 +ovl_En_Dekubaba,808FC200 +ovl_En_M_Fire1,808FFCA0 +ovl_En_M_Thunder,808FFE40 +ovl_Bg_Ddan_Jd,80901430 +ovl_Bg_Breakwall,80901A80 +ovl_En_Jj,809028F0 +ovl_En_Horse_Zelda,80903EC0 +ovl_Bg_Ddan_Kd,809049B0 +ovl_Door_Warp1,809052A0 +ovl_Obj_Syokudai,80909550 +ovl_Item_B_Heart,8090A190 +ovl_En_Dekunuts,8090A580 +ovl_Bg_Menkuri_Kaiten,8090BD80 +ovl_Bg_Menkuri_Eye,8090BF10 +ovl_En_Vali,8090C3B0 +ovl_Bg_Mizu_Movebg,8090EA50 +ovl_Bg_Mizu_Water,8090FBF0 +ovl_Arms_Hook,809108C0 +ovl_En_fHG,80911620 +ovl_Bg_Mori_Hineri,80913F50 +ovl_En_Bb,80914C50 +ovl_Bg_Toki_Hikari,80918920 +ovl_En_Yukabyun,809196C0 +ovl_Bg_Toki_Swd,80919CD0 +ovl_En_Fhg_Fire,8091B320 +ovl_Bg_Mjin,8091D940 +ovl_Bg_Hidan_Kousi,8091DD20 +ovl_Door_Toki,8091E2A0 +ovl_Bg_Hidan_Hamstep,8091E400 +ovl_En_Bird,8091F2B0 +ovl_En_Wood02,8091F770 +ovl_En_Lightbox,80920950 +ovl_En_Pu_box,80920DD0 +ovl_En_Trap,80921110 +ovl_En_Arow_Trap,809223B0 +ovl_En_Vase,80922500 +ovl_En_Ta,80922600 +ovl_En_Tk,80925FC0 +ovl_Bg_Mori_Bigst,80927DF0 +ovl_Bg_Mori_Elevator,80928720 +ovl_Bg_Mori_Kaitenkabe,80929210 +ovl_Bg_Mori_Rakkatenjo,80929870 +ovl_En_Vm,8092A1E0 +ovl_Demo_Effect,8092BA90 +ovl_Demo_Kankyo,80931590 +ovl_Bg_Hidan_Fwbig,80935290 +ovl_En_Floormas,80935F70 +ovl_En_Heishi1,80939350 +ovl_En_Rd,8093A860 +ovl_En_Po_Sisters,8093D110 +ovl_Bg_Heavy_Block,80941E00 +ovl_Bg_Po_Event,809436F0 +ovl_Obj_Mure,80945530 +ovl_En_Sw,80946540 +ovl_Boss_Fd,80949D30 +ovl_Object_Kankyo,80951060 +ovl_En_Du,80954280 +ovl_En_Fd,80955D20 +ovl_En_Horse_Link_Child,809589E0 +ovl_Door_Ana,8095A7E0 +ovl_Bg_Spot02_Objects,8095AE50 +ovl_Bg_Haka,8095C1A0 +ovl_Magic_Wind,8095C860 +ovl_Magic_Fire,8095E560 +ovl_En_Ru1,80960830 +ovl_Boss_Fd2,80967ED0 +ovl_En_Fd_Fire,8096BC00 +ovl_En_Dh,8096C910 +ovl_En_Dha,8096E3E0 +ovl_En_Rl,8096F3E0 +ovl_En_Encount1,809702C0 +ovl_Demo_Du,80970E20 +ovl_Demo_Im,80974600 +ovl_Demo_Tre_Lgt,80978570 +ovl_En_Fw,80978C80 +ovl_Bg_Vb_Sima,8097A430 +ovl_En_Vb_Ball,8097AB40 +ovl_Bg_Haka_Megane,8097BCE0 +ovl_Bg_Haka_MeganeBG,8097C0E0 +ovl_Bg_Haka_Ship,8097C7A0 +ovl_Bg_Haka_Sgami,8097D1E0 +ovl_En_Heishi2,8097DE00 +ovl_En_Encount2,80980000 +ovl_En_Fire_Rock,80981230 +ovl_En_Brob,80982340 +ovl_Mir_Ray,80983430 +ovl_Bg_Spot09_Obj,80984CF0 +ovl_Bg_Spot18_Obj,80985200 +ovl_Boss_Va,80985AD0 +ovl_Bg_Haka_Tubo,8099CCC0 +ovl_Bg_Haka_Trap,8099D6E0 +ovl_Bg_Haka_Huta,8099ECB0 +ovl_Bg_Haka_Zou,8099F750 +ovl_Bg_Spot17_Funen,809A0940 +ovl_En_Syateki_Itm,809A0B90 +ovl_En_Syateki_Man,809A1930 +ovl_En_Tana,809A26F0 +ovl_En_Nb,809A2990 +ovl_Boss_Mo,809A6F60 +ovl_En_Sb,809B7010 +ovl_En_Bigokuta,809B8450 +ovl_En_Karebaba,809BAF60 +ovl_Bg_Bdan_Objects,809BC850 +ovl_Demo_Sa,809BDB20 +ovl_Demo_Go,809C0640 +ovl_En_In,809C13A0 +ovl_En_Tr,809C4140 +ovl_Bg_Spot16_Bombstone,809C5A40 +ovl_Bg_Hidan_Kowarerukabe,809C6F80 +ovl_Bg_Bombwall,809C7E50 +ovl_En_Ru2,809C8710 +ovl_Obj_Dekujr,809CB490 +ovl_Bg_Mizu_Uzu,809CBAD0 +ovl_Bg_Spot06_Objects,809CBCA0 +ovl_Bg_Ice_Objects,809CD0B0 +ovl_Bg_Haka_Water,809CDFF0 +ovl_En_Ma2,809CE7D0 +ovl_En_Bom_Chu,809CF830 +ovl_En_Horse_Game_Check,809D0ED0 +ovl_Boss_Tw,809D1FA0 +ovl_En_Rr,809E7AA0 +ovl_En_Ba,809E9FD0 +ovl_En_Bx,809EBEA0 +ovl_En_Anubice,809EC990 +ovl_En_Anubice_Fire,809EDC40 +ovl_Bg_Mori_Hashigo,809EEA00 +ovl_Bg_Mori_Hashira4,809EF2C0 +ovl_Bg_Mori_Idomizu,809EF850 +ovl_Bg_Spot16_Doughnut,809EFE90 +ovl_Bg_Bdan_Switch,809F0440 +ovl_En_Ma1,809F1870 +ovl_Boss_Ganon,809F2B50 +ovl_Boss_Sst,80A18930 +ovl_En_Ny,80A24E90 +ovl_En_Fr,80A267C0 +ovl_Item_Shield,80A29250 +ovl_Bg_Ice_Shelter,80A29C60 +ovl_En_Ice_Hono,80A2AE90 +ovl_Item_Ocarina,80A2C080 +ovl_Magic_Dark,80A2C850 +ovl_Demo_6K,80A2E0A0 +ovl_En_Anubice_Tag,80A30DB0 +ovl_Bg_Haka_Gate,80A31080 +ovl_Bg_Spot15_Saku,80A32110 +ovl_Bg_Jya_Goroiwa,80A32450 +ovl_Bg_Jya_Zurerukabe,80A32BD0 +ovl_Bg_Jya_Cobra,80A33280 +ovl_Bg_Jya_Kanaami,80A34FA0 +ovl_Fishing,80A35350 +ovl_Obj_Oshihiki,80A4FDE0 +ovl_Bg_Gate_Shutter,80A51890 +ovl_Eff_Dust,80A51D10 +ovl_Bg_Spot01_Fusya,80A530F0 +ovl_Bg_Spot01_Idohashira,80A53390 +ovl_Bg_Spot01_Idomizu,80A53F90 +ovl_Bg_Po_Syokudai,80A542A0 +ovl_Bg_Ganon_Otyuka,80A54BF0 +ovl_Bg_Spot15_Rrbox,80A57230 +ovl_Bg_Umajump,80A58010 +ovl_En_Insect,80A581A0 +ovl_En_Butte,80A5A6C0 +ovl_En_Fish,80A5BC90 +ovl_Bg_Spot08_Iceblock,80A5DDA0 +ovl_Item_Etcetera,80A5EDE0 +ovl_Arrow_Fire,80A5F6B0 +ovl_Arrow_Ice,80A61570 +ovl_Arrow_Light,80A63450 +ovl_Obj_Kibako,80A65340 +ovl_Obj_Tsubo,80A66040 +ovl_En_Wonder_Item,80A67030 +ovl_En_Ik,80A67D60 +ovl_Demo_Ik,80A6C390 +ovl_En_Skj,80A6D8A0 +ovl_En_Skjneedle,80A711E0 +ovl_En_G_Switch,80A714F0 +ovl_Demo_Ext,80A72D20 +ovl_Demo_Shd,80A73660 +ovl_En_Dns,80A75A70 +ovl_Elf_Msg,80A76E00 +ovl_En_Honotrap,80A773F0 +ovl_En_Tubo_Trap,80A78940 +ovl_Obj_Ice_Poly,80A795E0 +ovl_Bg_Spot03_Taki,80A79F90 +ovl_Bg_Spot07_Taki,80A7A880 +ovl_En_Fz,80A7AE50 +ovl_En_Po_Relay,80A7CE60 +ovl_Bg_Relay_Objects,80A7E570 +ovl_En_Diving_Game,80A7ED20 +ovl_En_Kusa,80A806D0 +ovl_Obj_Bean,80A81BB0 +ovl_Obj_Bombiwa,80A84340 +ovl_Obj_Switch,80A848B0 +ovl_Obj_Elevator,80A86670 +ovl_Obj_Lift,80A86A30 +ovl_Obj_Hsblock,80A87450 +ovl_En_Okarina_Tag,80A87A20 +ovl_En_Yabusame_Mark,80A88F20 +ovl_En_Goroiwa,80A895F0 +ovl_En_Ex_Ruppy,80A8B9B0 +ovl_En_Toryo,80A8CA70 +ovl_En_Daiku,80A8D700 +ovl_En_Nwc,80A8EE40 +ovl_En_Blkobj,80A8F880 +ovl_Item_Inbox,80A8FDE0 +ovl_En_Ge1,80A8FF40 +ovl_Obj_Blockstop,80A91F70 +ovl_En_Sda,80A92110 +ovl_En_Clear_Tag,80A93810 +ovl_En_Niw_Lady,80A9EDB0 +ovl_En_Gm,80AA06B0 +ovl_En_Ms,80AA13E0 +ovl_En_Hs,80AA1AD0 +ovl_Bg_Ingate,80AA2670 +ovl_En_Kanban,80AA2A00 +ovl_En_Heishi3,80AA5B50 +ovl_En_Syateki_Niw,80AA6540 +ovl_En_Attack_Niw,80AA85D0 +ovl_Bg_Spot01_Idosoko,80AA9830 +ovl_En_Sa,80AA9A40 +ovl_En_Wonder_Talk,80AABCB0 +ovl_Bg_Gjyo_Bridge,80AAC340 +ovl_En_Ds,80AAC840 +ovl_En_Mk,80AAD460 +ovl_En_Bom_Bowl_Man,80AAE2F0 +ovl_En_Bom_Bowl_Pit,80AAF830 +ovl_En_Owl,80AB01A0 +ovl_En_Ishi,80AB3D40 +ovl_Obj_Hana,80ABCE90 +ovl_Obj_Lightswitch,80ABD1A0 +ovl_Obj_Mure2,80ABE5D0 +ovl_En_Go,80ABEFF0 +ovl_En_Fu,80AC3630 +ovl_En_Changer,80AC4380 +ovl_Bg_Jya_Megami,80AC4D60 +ovl_Bg_Jya_Lift,80AC5F40 +ovl_Bg_Jya_Bigmirror,80AC6490 +ovl_Bg_Jya_Bombchuiwa,80AC6CD0 +ovl_Bg_Jya_Amishutter,80AC7800 +ovl_Bg_Jya_Bombiwa,80AC7B90 +ovl_Bg_Spot18_Basket,80AC8150 +ovl_En_Ganon_Organ,80AC9140 +ovl_En_Siofuki,80AD0140 +ovl_En_Stream,80AD0EF0 +ovl_En_Mm,80AD1480 +ovl_En_Ko,80AD2AA0 +ovl_En_Kz,80AD6BE0 +ovl_En_Weather_Tag,80AD8180 +ovl_Bg_Sst_Floor,80AD9070 +ovl_En_Ani,80AD95D0 +ovl_En_Ex_Item,80ADA340 +ovl_Bg_Jya_Ironobj,80ADB4B0 +ovl_En_Js,80ADC260 +ovl_En_Jsjutan,80ADCC30 +ovl_En_Cs,80AE2550 +ovl_En_Md,80AE3780 +ovl_En_Hy,80AE5DF0 +ovl_En_Ganon_Mant,80AE9730 +ovl_En_Okarina_Effect,80AED950 +ovl_En_Mag,80AEDD10 +ovl_Door_Gerudo,80AF2870 +ovl_Elf_Msg2,80AF2E60 +ovl_Demo_Gt,80AF32D0 +ovl_En_Po_Field,80AF88D0 +ovl_Efc_Erupc,80AFC340 +ovl_Bg_Zg,80AFCE20 +ovl_En_Heishi4,80AFD290 +ovl_En_Zl3,80AFE190 +ovl_Boss_Ganon2,80B05FE0 +ovl_En_Kakasi,80B18E00 +ovl_En_Takara_Man,80B19B40 +ovl_Obj_Makeoshihiki,80B1A400 +ovl_Oceff_Spot,80B1A890 +ovl_End_Title,80B1B7C0 +ovl_En_Torch,80B1F8F0 +ovl_Demo_Ec,80B1F9E0 +ovl_Shot_Sun,80B23240 +ovl_En_Dy_Extra,80B23900 +ovl_En_Wonder_Talk2,80B23E80 +ovl_En_Ge2,80B24520 +ovl_Obj_Roomtimer,80B25EC0 +ovl_En_Ssh,80B26110 +ovl_En_Sth,80B28700 +ovl_Oceff_Wipe,80B2C7B0 +ovl_Effect_Ss_Dust,80B2D500 +ovl_Effect_Ss_KiraKira,80B2DD30 +ovl_Effect_Ss_Bomb,80B2E3A0 +ovl_Effect_Ss_Bomb2,80B2E7C0 +ovl_Effect_Ss_Blast,80B2F0F0 +ovl_Effect_Ss_G_Spk,80B2F480 +ovl_Effect_Ss_D_Fire,80B2FA30 +ovl_Effect_Ss_Bubble,80B2FF20 +ovl_Effect_Ss_G_Ripple,80B303A0 +ovl_Effect_Ss_G_Splash,80B30900 +ovl_Effect_Ss_G_Magma,80B30DB0 +ovl_Effect_Ss_G_Fire,80B31010 +ovl_Effect_Ss_Lightning,80B312A0 +ovl_Effect_Ss_Dt_Bubble,80B31970 +ovl_Effect_Ss_Hahen,80B31F00 +ovl_Effect_Ss_Stick,80B32540 +ovl_Effect_Ss_Sibuki,80B328E0 +ovl_Effect_Ss_Sibuki2,80B32FB0 +ovl_Effect_Ss_G_Magma2,80B332E0 +ovl_Effect_Ss_Stone1,80B337F0 +ovl_Effect_Ss_HitMark,80B33B80 +ovl_Effect_Ss_Fhg_Flash,80B340D0 +ovl_Effect_Ss_K_Fire,80B35050 +ovl_Effect_Ss_Solder_Srch_Ball,80B35480 +ovl_Effect_Ss_Kakera,80B35630 +ovl_Effect_Ss_Ice_Piece,80B366C0 +ovl_Effect_Ss_En_Ice,80B36B00 +ovl_Effect_Ss_Fire_Tail,80B373C0 +ovl_Effect_Ss_En_Fire,80B37AC0 +ovl_Effect_Ss_Extra,80B38200 +ovl_Effect_Ss_Fcircle,80B385C0 +ovl_Effect_Ss_Dead_Db,80B38A70 +ovl_Effect_Ss_Dead_Dd,80B38F50 +ovl_Effect_Ss_Dead_Ds,80B394E0 +ovl_Effect_Ss_Dead_Sound,80B39960 +ovl_Oceff_Storm,80B39AA0 +ovl_En_Weiyer,80B3B640 +ovl_Bg_Spot05_Soko,80B3D040 +ovl_Bg_Jya_1flift,80B3D360 +ovl_Bg_Jya_Haheniron,80B3D9F0 +ovl_Bg_Spot12_Gate,80B3E1E0 +ovl_Bg_Spot12_Saku,80B3E5F0 +ovl_En_Hintnuts,80B3EAB0 +ovl_En_Nutsball,80B404E0 +ovl_Bg_Spot00_Break,80B40B00 +ovl_En_Shopnuts,80B40CA0 +ovl_En_It,80B41BB0 +ovl_En_GeldB,80B41D40 +ovl_Oceff_Wipe2,80B470F0 +ovl_Oceff_Wipe3,80B48860 +ovl_En_Niw_Girl,80B49FB0 +ovl_En_Dog,80B4AA80 +ovl_En_Si,80B4BC30 +ovl_Bg_Spot01_Objects2,80B4C130 +ovl_Obj_Comb,80B4C5F0 +ovl_Bg_Spot11_Bakudankabe,80B4CE50 +ovl_Obj_Kibako2,80B4D490 +ovl_En_Dnt_Demo,80B4DB50 +ovl_En_Dnt_Jiji,80B4E870 +ovl_En_Dnt_Nomal,80B4FD80 +ovl_En_Guest,80B52BC0 +ovl_Bg_Bom_Guard,80B53560 +ovl_En_Hs2,80B53780 +ovl_Demo_Kekkai,80B53D60 +ovl_Bg_Spot08_Bakudankabe,80B55040 +ovl_Bg_Spot17_Bakudankabe,80B556E0 +ovl_Obj_Mure3,80B55DC0 +ovl_En_Tg,80B56590 +ovl_En_Mu,80B56C60 +ovl_En_Go2,80B57580 +ovl_En_Wf,80B5D5A0 +ovl_En_Skb,80B618B0 +ovl_Demo_Gj,80B631A0 +ovl_Demo_Geff,80B66E50 +ovl_Bg_Gnd_Firemeiro,80B67670 +ovl_Bg_Gnd_Darkmeiro,80B67BB0 +ovl_Bg_Gnd_Soulmeiro,80B68370 +ovl_Bg_Gnd_Nisekabe,80B68BD0 +ovl_Bg_Gnd_Iceblock,80B68D40 +ovl_Bg_Ydan_Sp,80B69E40 +ovl_En_Gb,80B6B5B0 +ovl_En_Gs,80B6CCE0 +ovl_Bg_Mizu_Bwall,80B6EB80 +ovl_Bg_Mizu_Shutter,80B70050 +ovl_En_Daiku_Kakariko,80B70850 +ovl_Bg_Bowl_Wall,80B71C10 +ovl_En_Wall_Tubo,80B72590 +ovl_En_Po_Desert,80B72A80 +ovl_En_Crow,80B73840 +ovl_Door_Killer,80B74EE0 +ovl_Bg_Spot11_Oasis,80B76450 +ovl_Bg_Spot18_Futa,80B76B80 +ovl_Bg_Spot18_Shutter,80B76D20 +ovl_En_Ma3,80B77270 +ovl_En_Cow,80B78340 +ovl_Bg_Ice_Turara,80B797A0 +ovl_Bg_Ice_Shutter,80B79FD0 +ovl_En_Kakasi2,80B7A440 +ovl_En_Kakasi3,80B7AB60 +ovl_Oceff_Wipe4,80B7BC40 +ovl_En_Eg,80B7CC20 +ovl_Bg_Menkuri_Nisekabe,80B7CDD0 +ovl_En_Zo,80B7CF20 +ovl_Effect_Ss_Ice_Smoke,80B7F4D0 +ovl_Obj_Makekinsuta,80B7F990 +ovl_En_Ge3,80B7FAE0 +ovl_Obj_Timeblock,80B80630 +ovl_Obj_Hamishi,80B81270 +ovl_En_Zl4,80B81AC0 +ovl_En_Mm2,80B864F0 +ovl_Bg_Jya_Block,80B872B0 +ovl_Obj_Warp2block,80B87520 +gameplay_keep, +gameplay_field_keep, +gameplay_dangeon_keep, +gameplay_object_exchange_static, +object_link_boy, +object_link_child, +object_box, +object_human, +object_okuta, +object_poh, +object_wallmaster, +object_dy_obj, +object_firefly, +object_dodongo, +object_fire, +object_niw, +object_tite, +object_reeba, +object_peehat, +object_kingdodongo, +object_horse, +object_zf, +object_goma, +object_zl1, +object_gol, +object_bubble, +object_dodojr, +object_torch2, +object_bl, +object_tp, +object_oA1, +object_st, +object_bw, +object_ei, +object_horse_normal, +object_oB1, +object_o_anime, +object_spot04_objects, +object_ddan_objects, +object_hidan_objects, +object_horse_ganon, +object_oA2, +object_spot00_objects, +object_mb, +object_bombf, +object_sk2, +object_oE1, +object_oE_anime, +object_oE2, +object_ydan_objects, +object_gnd, +object_am, +object_dekubaba, +object_oA3, +object_oA4, +object_oA5, +object_oA6, +object_oA7, +object_jj, +object_oA8, +object_oA9, +object_oB2, +object_oB3, +object_oB4, +object_horse_zelda, +object_opening_demo1, +object_warp1, +object_b_heart, +object_dekunuts, +object_oE3, +object_oE4, +object_menkuri_objects, +object_oE5, +object_oE6, +object_oE7, +object_oE8, +object_oE9, +object_oE10, +object_oE11, +object_oE12, +object_vali, +object_oA10, +object_oA11, +object_mizu_objects, +object_fhg, +object_ossan, +object_mori_hineri1, +object_Bb, +object_toki_objects, +object_yukabyun, +object_zl2, +object_mjin, +object_mjin_flash, +object_mjin_dark, +object_mjin_flame, +object_mjin_ice, +object_mjin_soul, +object_mjin_wind, +object_mjin_oka, +object_haka_objects, +object_spot06_objects, +object_ice_objects, +object_relay_objects, +object_mori_hineri1a, +object_mori_hineri2, +object_mori_hineri2a, +object_mori_objects, +object_mori_tex, +object_spot08_obj, +object_warp2, +object_hata, +object_bird, +object_wood02, +object_lightbox, +object_pu_box, +object_trap, +object_vase, +object_im, +object_ta, +object_tk, +object_xc, +object_vm, +object_bv, +object_hakach_objects, +object_efc_crystal_light, +object_efc_fire_ball, +object_efc_flash, +object_efc_lgt_shower, +object_efc_star_field, +object_god_lgt, +object_light_ring, +object_triforce_spot, +object_medal, +object_bdan_objects, +object_sd, +object_rd, +object_po_sisters, +object_heavy_object, +object_gndd, +object_fd, +object_du, +object_fw, +object_horse_link_child, +object_spot02_objects, +object_haka, +object_ru1, +object_syokudai, +object_fd2, +object_dh, +object_rl, +object_efc_tw, +object_demo_tre_lgt, +object_gi_key, +object_mir_ray, +object_brob, +object_gi_jewel, +object_spot09_obj, +object_spot18_obj, +object_bdoor, +object_spot17_obj, +object_shop_dungen, +object_nb, +object_mo, +object_sb, +object_gi_melody, +object_gi_heart, +object_gi_compass, +object_gi_bosskey, +object_gi_medal, +object_gi_nuts, +object_sa, +object_gi_hearts, +object_gi_arrowcase, +object_gi_bombpouch, +object_in, +object_tr, +object_spot16_obj, +object_oE1s, +object_oE4s, +object_os_anime, +object_gi_bottle, +object_gi_stick, +object_gi_map, +object_oF1d_map, +object_ru2, +object_gi_shield_1, +object_dekujr, +object_gi_magicpot, +object_gi_bomb_1, +object_oF1s, +object_ma2, +object_gi_purse, +object_hni, +object_tw, +object_rr, +object_bxa, +object_anubice, +object_gi_gerudo, +object_gi_arrow, +object_gi_bomb_2, +object_gi_egg, +object_gi_scale, +object_gi_shield_2, +object_gi_hookshot, +object_gi_ocarina, +object_gi_milk, +object_ma1, +object_ganon, +object_sst, +object_ny, +object_fr, +object_gi_pachinko, +object_gi_boomerang, +object_gi_bow, +object_gi_glasses, +object_gi_liquid, +object_ani, +object_demo_6k, +object_gi_shield_3, +object_gi_letter, +object_spot15_obj, +object_jya_obj, +object_gi_clothes, +object_gi_bean, +object_gi_fish, +object_gi_saw, +object_gi_hammer, +object_gi_grass, +object_gi_longsword, +object_spot01_objects, +object_md, +object_km1, +object_kw1, +object_zo, +object_kz, +object_umajump, +object_masterkokiri, +object_masterkokirihead, +object_mastergolon, +object_masterzoora, +object_aob, +object_ik, +object_ahg, +object_cne, +object_gi_niwatori, +object_skj, +object_gi_bottle_letter, +object_bji, +object_bba, +object_gi_ocarina_0, +object_ds, +object_ane, +object_boj, +object_spot03_object, +object_spot07_object, +object_fz, +object_bob, +object_ge1, +object_yabusame_point, +object_gi_boots_2, +object_gi_seed, +object_gnd_magic, +object_d_elevator, +object_d_hsblock, +object_d_lift, +object_mamenoki, +object_goroiwa, +object_toryo, +object_daiku, +object_nwc, +object_blkobj, +object_gm, +object_ms, +object_hs, +object_ingate, +object_lightswitch, +object_kusa, +object_tsubo, +object_gi_gloves, +object_gi_coin, +object_kanban, +object_gjyo_objects, +object_owl, +object_mk, +object_fu, +object_gi_ki_tan_mask, +object_gi_redead_mask, +object_gi_skj_mask, +object_gi_rabit_mask, +object_gi_truth_mask, +object_ganon_objects, +object_siofuki, +object_stream, +object_mm, +object_fa, +object_os, +object_gi_eye_lotion, +object_gi_powder, +object_gi_mushroom, +object_gi_ticketstone, +object_gi_brokensword, +object_js, +object_cs, +object_gi_prescription, +object_gi_bracelet, +object_gi_soldout, +object_gi_frog, +object_mag, +object_door_gerudo, +object_gt, +object_efc_erupc, +object_zl2_anime1, +object_zl2_anime2, +object_gi_golonmask, +object_gi_zoramask, +object_gi_gerudomask, +object_ganon2, +object_ka, +object_ts, +object_zg, +object_gi_hoverboots, +object_gi_m_arrow, +object_ds2, +object_ec, +object_fish, +object_gi_sutaru, +object_gi_goddess, +object_ssh, +object_bigokuta, +object_bg, +object_spot05_objects, +object_spot12_obj, +object_bombiwa, +object_hintnuts, +object_rs, +object_spot00_break, +object_gla, +object_shopnuts, +object_geldb, +object_gr, +object_dog, +object_jya_iron, +object_jya_door, +object_spot01_objects2, +object_spot11_obj, +object_kibako2, +object_dns, +object_dnk, +object_gi_fire, +object_gi_insect, +object_gi_butterfly, +object_gi_ghost, +object_gi_soul, +object_bowl, +object_po_field, +object_demo_kekkai, +object_efc_doughnut, +object_gi_dekupouch, +object_ganon_anime1, +object_ganon_anime2, +object_ganon_anime3, +object_gi_rupy, +object_spot01_matoya, +object_spot01_matoyab, +object_po_composer, +object_mu, +object_wf, +object_skb, +object_gj, +object_geff, +object_haka_door, +object_gs, +object_ps, +object_bwall, +object_crow, +object_cow, +object_cob, +object_gi_sword_1, +object_door_killer, +object_ouke_haka, +object_timeblock, +object_zl4, +g_pn_01, +g_pn_02, +g_pn_03, +g_pn_04, +g_pn_05, +g_pn_06, +g_pn_07, +g_pn_08, +g_pn_09, +g_pn_10, +g_pn_11, +g_pn_12, +g_pn_13, +g_pn_14, +g_pn_15, +g_pn_16, +g_pn_17, +g_pn_18, +g_pn_19, +g_pn_20, +g_pn_21, +g_pn_22, +g_pn_23, +g_pn_24, +g_pn_25, +g_pn_26, +g_pn_27, +g_pn_28, +g_pn_29, +g_pn_30, +g_pn_31, +g_pn_32, +g_pn_33, +g_pn_34, +g_pn_35, +g_pn_36, +g_pn_37, +g_pn_38, +g_pn_39, +g_pn_40, +g_pn_41, +g_pn_42, +g_pn_43, +g_pn_44, +g_pn_45, +g_pn_46, +g_pn_47, +g_pn_48, +g_pn_49, +g_pn_50, +g_pn_51, +g_pn_52, +g_pn_53, +g_pn_54, +g_pn_55, +g_pn_56, +g_pn_57, +z_select_static, +nintendo_rogo_static, +title_static, +parameter_static, +vr_fine0_static, +vr_fine0_pal_static, +vr_fine1_static, +vr_fine1_pal_static, +vr_fine2_static, +vr_fine2_pal_static, +vr_fine3_static, +vr_fine3_pal_static, +vr_cloud0_static, +vr_cloud0_pal_static, +vr_cloud1_static, +vr_cloud1_pal_static, +vr_cloud2_static, +vr_cloud2_pal_static, +vr_cloud3_static, +vr_cloud3_pal_static, +vr_holy0_static, +vr_holy0_pal_static, +vr_holy1_static, +vr_holy1_pal_static, +vr_MDVR_static, +vr_MDVR_pal_static, +vr_MNVR_static, +vr_MNVR_pal_static, +vr_RUVR_static, +vr_RUVR_pal_static, +vr_LHVR_static, +vr_LHVR_pal_static, +vr_KHVR_static, +vr_KHVR_pal_static, +vr_K3VR_static, +vr_K3VR_pal_static, +vr_K4VR_static, +vr_K4VR_pal_static, +vr_K5VR_static, +vr_K5VR_pal_static, +vr_SP1a_static, +vr_SP1a_pal_static, +vr_MLVR_static, +vr_MLVR_pal_static, +vr_KKRVR_static, +vr_KKRVR_pal_static, +vr_KR3VR_static, +vr_KR3VR_pal_static, +vr_IPVR_static, +vr_IPVR_pal_static, +vr_KSVR_static, +vr_KSVR_pal_static, +vr_GLVR_static, +vr_GLVR_pal_static, +vr_ZRVR_static, +vr_ZRVR_pal_static, +vr_DGVR_static, +vr_DGVR_pal_static, +vr_ALVR_static, +vr_ALVR_pal_static, +vr_NSVR_static, +vr_NSVR_pal_static, +vr_LBVR_static, +vr_LBVR_pal_static, +vr_TTVR_static, +vr_TTVR_pal_static, +vr_FCVR_static, +vr_FCVR_pal_static, +elf_message_field, +elf_message_ydan, +ddan_scene, +ddan_room_0, +ddan_room_1, +ddan_room_2, +ddan_room_3, +ddan_room_4, +ddan_room_5, +ddan_room_6, +ddan_room_7, +ddan_room_8, +ddan_room_9, +ddan_room_10, +ddan_room_11, +ddan_room_12, +ddan_room_13, +ddan_room_14, +ddan_room_15, +ddan_room_16, +spot00_scene, +spot00_room_0, +spot01_scene, +spot01_room_0, +spot02_scene, +spot02_room_0, +spot02_room_1, +spot03_scene, +spot03_room_0, +spot03_room_1, +spot04_scene, +spot04_room_0, +spot04_room_1, +spot04_room_2, +spot05_scene, +spot05_room_0, +spot06_scene, +spot06_room_0, +spot07_scene, +spot07_room_0, +spot07_room_1, +spot08_scene, +spot08_room_0, +spot09_scene, +spot09_room_0, +spot10_scene, +spot10_room_0, +spot10_room_1, +spot10_room_2, +spot10_room_3, +spot10_room_4, +spot10_room_5, +spot10_room_6, +spot10_room_7, +spot10_room_8, +spot10_room_9, +spot11_scene, +spot11_room_0, +spot12_scene, +spot12_room_0, +spot12_room_1, +spot13_scene, +spot13_room_0, +spot13_room_1, +spot15_scene, +spot15_room_0, +spot16_scene, +spot16_room_0, +spot17_scene, +spot17_room_0, +spot17_room_1, +spot18_scene, +spot18_room_0, +spot18_room_1, +spot18_room_2, +spot18_room_3, +market_day_scene, +market_day_room_0, +market_night_scene, +market_night_room_0, +HIDAN_scene, +HIDAN_room_0, +HIDAN_room_1, +HIDAN_room_2, +HIDAN_room_3, +HIDAN_room_4, +HIDAN_room_5, +HIDAN_room_6, +HIDAN_room_7, +HIDAN_room_8, +HIDAN_room_9, +HIDAN_room_10, +HIDAN_room_11, +HIDAN_room_12, +HIDAN_room_13, +HIDAN_room_14, +HIDAN_room_15, +HIDAN_room_16, +HIDAN_room_17, +HIDAN_room_18, +HIDAN_room_19, +HIDAN_room_20, +HIDAN_room_21, +HIDAN_room_22, +HIDAN_room_23, +HIDAN_room_24, +HIDAN_room_25, +HIDAN_room_26, +Bmori1_scene, +Bmori1_room_0, +Bmori1_room_1, +Bmori1_room_2, +Bmori1_room_3, +Bmori1_room_4, +Bmori1_room_5, +Bmori1_room_6, +Bmori1_room_7, +Bmori1_room_8, +Bmori1_room_9, +Bmori1_room_10, +Bmori1_room_11, +Bmori1_room_12, +Bmori1_room_13, +Bmori1_room_14, +Bmori1_room_15, +Bmori1_room_16, +Bmori1_room_17, +Bmori1_room_18, +Bmori1_room_19, +Bmori1_room_20, +Bmori1_room_21, +Bmori1_room_22, +ydan_scene, +ydan_room_0, +ydan_room_1, +ydan_room_2, +ydan_room_3, +ydan_room_4, +ydan_room_5, +ydan_room_6, +ydan_room_7, +ydan_room_8, +ydan_room_9, +ydan_room_10, +ydan_room_11, +kenjyanoma_scene, +kenjyanoma_room_0, +tokinoma_scene, +tokinoma_room_0, +tokinoma_room_1, +link_home_scene, +link_home_room_0, +kokiri_shop_scene, +kokiri_shop_room_0, +MIZUsin_scene, +MIZUsin_room_0, +MIZUsin_room_1, +MIZUsin_room_2, +MIZUsin_room_3, +MIZUsin_room_4, +MIZUsin_room_5, +MIZUsin_room_6, +MIZUsin_room_7, +MIZUsin_room_8, +MIZUsin_room_9, +MIZUsin_room_10, +MIZUsin_room_11, +MIZUsin_room_12, +MIZUsin_room_13, +MIZUsin_room_14, +MIZUsin_room_15, +MIZUsin_room_16, +MIZUsin_room_17, +MIZUsin_room_18, +MIZUsin_room_19, +MIZUsin_room_20, +MIZUsin_room_21, +MIZUsin_room_22, +kokiri_home_scene, +kokiri_home_room_0, +kakusiana_scene, +kakusiana_room_0, +kakusiana_room_1, +kakusiana_room_2, +kakusiana_room_3, +kakusiana_room_4, +kakusiana_room_5, +kakusiana_room_6, +kakusiana_room_7, +kakusiana_room_8, +kakusiana_room_9, +kakusiana_room_10, +kakusiana_room_11, +kakusiana_room_12, +kakusiana_room_13, +entra_scene, +entra_room_0, +bdan_scene, +bdan_room_0, +bdan_room_1, +bdan_room_2, +bdan_room_3, +bdan_room_4, +bdan_room_5, +bdan_room_6, +bdan_room_7, +bdan_room_8, +bdan_room_9, +bdan_room_10, +bdan_room_11, +bdan_room_12, +bdan_room_13, +bdan_room_14, +bdan_room_15, +HAKAdan_scene, +HAKAdan_room_0, +HAKAdan_room_1, +HAKAdan_room_2, +HAKAdan_room_3, +HAKAdan_room_4, +HAKAdan_room_5, +HAKAdan_room_6, +HAKAdan_room_7, +HAKAdan_room_8, +HAKAdan_room_9, +HAKAdan_room_10, +HAKAdan_room_11, +HAKAdan_room_12, +HAKAdan_room_13, +HAKAdan_room_14, +HAKAdan_room_15, +HAKAdan_room_16, +HAKAdan_room_17, +HAKAdan_room_18, +HAKAdan_room_19, +HAKAdan_room_20, +HAKAdan_room_21, +HAKAdan_room_22, +moribossroom_scene, +moribossroom_room_0, +moribossroom_room_1, +syatekijyou_scene, +syatekijyou_room_0, +men_scene, +men_room_0, +men_room_1, +men_room_2, +men_room_3, +men_room_4, +men_room_5, +men_room_6, +men_room_7, +men_room_8, +men_room_9, +men_room_10, +shop1_scene, +shop1_room_0, +hairal_niwa_scene, +hairal_niwa_room_0, +ganon_tou_scene, +ganon_tou_room_0, +market_alley_scene, +market_alley_room_0, +spot20_scene, +spot20_room_0, +market_ruins_scene, +market_ruins_room_0, +entra_n_scene, +entra_n_room_0, +enrui_scene, +enrui_room_0, +market_alley_n_scene, +market_alley_n_room_0, +hiral_demo_scene, +hiral_demo_room_0, +kokiri_home3_scene, +kokiri_home3_room_0, +jyasinzou_scene, +jyasinzou_room_0, +jyasinzou_room_1, +jyasinzou_room_2, +jyasinzou_room_3, +jyasinzou_room_4, +jyasinzou_room_5, +jyasinzou_room_6, +jyasinzou_room_7, +jyasinzou_room_8, +jyasinzou_room_9, +jyasinzou_room_10, +jyasinzou_room_11, +jyasinzou_room_12, +jyasinzou_room_13, +jyasinzou_room_14, +jyasinzou_room_15, +jyasinzou_room_16, +jyasinzou_room_17, +jyasinzou_room_18, +jyasinzou_room_19, +jyasinzou_room_20, +jyasinzou_room_21, +jyasinzou_room_22, +jyasinzou_room_23, +jyasinzou_room_24, +jyasinzou_room_25, +jyasinzou_room_26, +jyasinzou_room_27, +jyasinzou_room_28, +ice_doukutu_scene, +ice_doukutu_room_0, +ice_doukutu_room_1, +ice_doukutu_room_2, +ice_doukutu_room_3, +ice_doukutu_room_4, +ice_doukutu_room_5, +ice_doukutu_room_6, +ice_doukutu_room_7, +ice_doukutu_room_8, +ice_doukutu_room_9, +ice_doukutu_room_10, +ice_doukutu_room_11, +malon_stable_scene, +malon_stable_room_0, +kakariko_scene, +kakariko_room_0, +bdan_boss_scene, +bdan_boss_room_0, +bdan_boss_room_1, +FIRE_bs_scene, +FIRE_bs_room_0, +FIRE_bs_room_1, +hut_scene, +hut_room_0, +daiyousei_izumi_scene, +daiyousei_izumi_room_0, +hakaana_scene, +hakaana_room_0, +yousei_izumi_tate_scene, +yousei_izumi_tate_room_0, +yousei_izumi_yoko_scene, +yousei_izumi_yoko_room_0, +golon_scene, +golon_room_0, +zoora_scene, +zoora_room_0, +drag_scene, +drag_room_0, +alley_shop_scene, +alley_shop_room_0, +night_shop_scene, +night_shop_room_0, +impa_scene, +impa_room_0, +labo_scene, +labo_room_0, +tent_scene, +tent_room_0, +nakaniwa_scene, +nakaniwa_room_0, +ddan_boss_scene, +ddan_boss_room_0, +ddan_boss_room_1, +ydan_boss_scene, +ydan_boss_room_0, +ydan_boss_room_1, +HAKAdan_bs_scene, +HAKAdan_bs_room_0, +HAKAdan_bs_room_1, +MIZUsin_bs_scene, +MIZUsin_bs_room_0, +MIZUsin_bs_room_1, +ganon_scene, +ganon_room_0, +ganon_room_1, +ganon_room_2, +ganon_room_3, +ganon_room_4, +ganon_room_5, +ganon_room_6, +ganon_room_7, +ganon_room_8, +ganon_room_9, +ganon_boss_scene, +ganon_boss_room_0, +jyasinboss_scene, +jyasinboss_room_0, +jyasinboss_room_1, +jyasinboss_room_2, +jyasinboss_room_3, +kokiri_home4_scene, +kokiri_home4_room_0, +kokiri_home5_scene, +kokiri_home5_room_0, +ganon_final_scene, +ganon_final_room_0, +kakariko3_scene, +kakariko3_room_0, +hakasitarelay_scene, +hakasitarelay_room_0, +hakasitarelay_room_1, +hakasitarelay_room_2, +hakasitarelay_room_3, +hakasitarelay_room_4, +hakasitarelay_room_5, +hakasitarelay_room_6, +shrine_scene, +shrine_room_0, +turibori_scene, +turibori_room_0, +shrine_n_scene, +shrine_n_room_0, +shrine_r_scene, +shrine_r_room_0, +ganontika_scene, +ganontika_room_0, +ganontika_room_1, +ganontika_room_2, +ganontika_room_3, +ganontika_room_4, +ganontika_room_5, +ganontika_room_6, +ganontika_room_7, +ganontika_room_8, +ganontika_room_9, +ganontika_room_10, +ganontika_room_11, +ganontika_room_12, +ganontika_room_13, +ganontika_room_14, +ganontika_room_15, +ganontika_room_16, +ganontika_room_17, +ganontika_room_18, +ganontika_room_19, +hakaana2_scene, +hakaana2_room_0, +gerudoway_scene, +gerudoway_room_0, +gerudoway_room_1, +gerudoway_room_2, +gerudoway_room_3, +gerudoway_room_4, +gerudoway_room_5, +HAKAdanCH_scene, +HAKAdanCH_room_0, +HAKAdanCH_room_1, +HAKAdanCH_room_2, +HAKAdanCH_room_3, +HAKAdanCH_room_4, +HAKAdanCH_room_5, +HAKAdanCH_room_6, +hairal_niwa_n_scene, +hairal_niwa_n_room_0, +bowling_scene, +bowling_room_0, +hakaana_ouke_scene, +hakaana_ouke_room_0, +hakaana_ouke_room_1, +hakaana_ouke_room_2, +hylia_labo_scene, +hylia_labo_room_0, +souko_scene, +souko_room_0, +souko_room_1, +souko_room_2, +miharigoya_scene, +miharigoya_room_0, +mahouya_scene, +mahouya_room_0, +takaraya_scene, +takaraya_room_0, +takaraya_room_1, +takaraya_room_2, +takaraya_room_3, +takaraya_room_4, +takaraya_room_5, +takaraya_room_6, +ganon_sonogo_scene, +ganon_sonogo_room_0, +ganon_sonogo_room_1, +ganon_sonogo_room_2, +ganon_sonogo_room_3, +ganon_sonogo_room_4, +ganon_demo_scene, +ganon_demo_room_0, +face_shop_scene, +face_shop_room_0, +kinsuta_scene, +kinsuta_room_0, +ganontikasonogo_scene, +ganontikasonogo_room_0, +ganontikasonogo_room_1, +bump_texture_static, +anime_model_1_static, +anime_model_2_static, +anime_model_3_static, +anime_model_4_static, +anime_model_5_static, +anime_model_6_static, +anime_texture_1_static, +anime_texture_2_static, +anime_texture_3_static, +anime_texture_4_static, +anime_texture_5_static, +anime_texture_6_static, +softsprite_matrix_static, diff --git a/baseroms/pal-1.1/checksum-compressed.md5 b/baseroms/pal-1.1/checksum-compressed.md5 new file mode 100644 index 0000000000..ef351b211c --- /dev/null +++ b/baseroms/pal-1.1/checksum-compressed.md5 @@ -0,0 +1 @@ +d714580dd74c2c033f5e1b6dc0aeac77 build/pal-1.1/oot-pal-1.1-compressed.z64 diff --git a/baseroms/pal-1.1/checksum.md5 b/baseroms/pal-1.1/checksum.md5 new file mode 100644 index 0000000000..60671db15f --- /dev/null +++ b/baseroms/pal-1.1/checksum.md5 @@ -0,0 +1 @@ +fee6fe6e4cc6228aae02e15c40168aa1 build/pal-1.1/oot-pal-1.1.z64 diff --git a/baseroms/pal-1.1/config.yml b/baseroms/pal-1.1/config.yml new file mode 100644 index 0000000000..57f037b350 --- /dev/null +++ b/baseroms/pal-1.1/config.yml @@ -0,0 +1,1225 @@ +dmadata_start: 0x7950 +text_lang_pal: true +incbins: + - name: ipl3 + segment: makerom + vram: 0x80000040 + size: 0xFC0 + - name: rspbootText + segment: boot + vram: 0x80006560 + size: 0x160 + - name: aspMainText + segment: code + vram: 0x800E0F50 + size: 0xFB0 + - name: gspF3DZEX2_NoN_PosLight_fifoText + segment: code + vram: 0x800E1F00 + size: 0x1390 + - name: gspS2DEX2d_fifoText + segment: code + vram: 0x800E3290 + size: 0x18C0 + - name: njpgdspMainText + segment: code + vram: 0x800E4B50 + size: 0xAF0 + - name: gSequenceFontTable + segment: code + vram: 0x801117F0 + size: 0x1C0 + - name: gSequenceTable + segment: code + vram: 0x801119B0 + size: 0x6F0 + - name: aspMainData + segment: code + vram: 0x80112120 + size: 0x2E0 + - name: gspF3DZEX2_NoN_PosLight_fifoData + segment: code + vram: 0x80112400 + size: 0x420 + - name: gspS2DEX2d_fifoData + segment: code + vram: 0x80112820 + size: 0x390 + - name: njpgdspMainData + segment: code + vram: 0x80112BB0 + size: 0x60 +variables: + gMtxClear: 0x800FCD40 + sNesMessageEntryTable: 0x801088FC + sGerMessageEntryTable: 0x8010CB24 + sFraMessageEntryTable: 0x8010EC34 + sStaffMessageEntryTable: 0x80110D44 + gSoundFontTable: 0x80111580 + gSequenceFontTable: 0x801117F0 + gSequenceTable: 0x801119B0 + gSampleBankTable: 0x801120A0 + sShadowTex: 0x80AE1B80 +assets: +- name: code/fbdemo_circle + xml_path: assets/xml/code/fbdemo_circle.xml + start_offset: 0xE9A08 + end_offset: 0xEAC28 +- name: code/fbdemo_triforce + xml_path: assets/xml/code/fbdemo_triforce.xml + start_offset: 0xE8E90 + end_offset: 0xE8F60 +- name: code/fbdemo_wipe1 + xml_path: assets/xml/code/fbdemo_wipe1.xml + start_offset: 0xE8F60 + end_offset: 0xE98F0 +- name: n64dd/error_textures + xml_path: assets/xml/n64dd/error_textures.xml + start_offset: 0xC0E0 + end_offset: 0x11CE0 +- name: misc/link_animetion + xml_path: assets/xml/misc/link_animetion.xml +- name: misc/z_select_static + xml_path: assets/xml/misc/z_select_static.xml +- name: objects/gameplay_dangeon_keep + xml_path: assets/xml/objects/gameplay_dangeon_keep.xml +- name: objects/gameplay_field_keep + xml_path: assets/xml/objects/gameplay_field_keep.xml +- name: objects/gameplay_keep + xml_path: assets/xml/objects/gameplay_keep_pal.xml +- name: objects/object_ahg + xml_path: assets/xml/objects/object_ahg.xml +- name: objects/object_am + xml_path: assets/xml/objects/object_am.xml +- name: objects/object_ane + xml_path: assets/xml/objects/object_ane.xml +- name: objects/object_ani + xml_path: assets/xml/objects/object_ani.xml +- name: objects/object_anubice + xml_path: assets/xml/objects/object_anubice.xml +- name: objects/object_aob + xml_path: assets/xml/objects/object_aob.xml +- name: objects/object_b_heart + xml_path: assets/xml/objects/object_b_heart.xml +- name: objects/object_Bb + xml_path: assets/xml/objects/object_Bb.xml +- name: objects/object_bba + xml_path: assets/xml/objects/object_bba.xml +- name: objects/object_bdan_objects + xml_path: assets/xml/objects/object_bdan_objects.xml +- name: objects/object_bdoor + xml_path: assets/xml/objects/object_bdoor.xml +- name: objects/object_bg + xml_path: assets/xml/objects/object_bg.xml +- name: objects/object_bigokuta + xml_path: assets/xml/objects/object_bigokuta.xml +- name: objects/object_bird + xml_path: assets/xml/objects/object_bird.xml +- name: objects/object_bji + xml_path: assets/xml/objects/object_bji.xml +- name: objects/object_bl + xml_path: assets/xml/objects/object_bl.xml +- name: objects/object_blkobj + xml_path: assets/xml/objects/object_blkobj.xml +- name: objects/object_bob + xml_path: assets/xml/objects/object_bob.xml +- name: objects/object_boj + xml_path: assets/xml/objects/object_boj.xml +- name: objects/object_bombf + xml_path: assets/xml/objects/object_bombf.xml +- name: objects/object_bombiwa + xml_path: assets/xml/objects/object_bombiwa.xml +- name: objects/object_bowl + xml_path: assets/xml/objects/object_bowl.xml +- name: objects/object_box + xml_path: assets/xml/objects/object_box.xml +- name: objects/object_brob + xml_path: assets/xml/objects/object_brob.xml +- name: objects/object_bubble + xml_path: assets/xml/objects/object_bubble.xml +- name: objects/object_bv + xml_path: assets/xml/objects/object_bv_pal.xml +- name: objects/object_bw + xml_path: assets/xml/objects/object_bw.xml +- name: objects/object_bwall + xml_path: assets/xml/objects/object_bwall.xml +- name: objects/object_bxa + xml_path: assets/xml/objects/object_bxa.xml +- name: objects/object_cne + xml_path: assets/xml/objects/object_cne.xml +- name: objects/object_cob + xml_path: assets/xml/objects/object_cob.xml +- name: objects/object_cow + xml_path: assets/xml/objects/object_cow.xml +- name: objects/object_crow + xml_path: assets/xml/objects/object_crow.xml +- name: objects/object_cs + xml_path: assets/xml/objects/object_cs.xml +- name: objects/object_d_elevator + xml_path: assets/xml/objects/object_d_elevator.xml +- name: objects/object_d_hsblock + xml_path: assets/xml/objects/object_d_hsblock.xml +- name: objects/object_d_lift + xml_path: assets/xml/objects/object_d_lift.xml +- name: objects/object_daiku + xml_path: assets/xml/objects/object_daiku.xml +- name: objects/object_ddan_objects + xml_path: assets/xml/objects/object_ddan_objects.xml +- name: objects/object_dekubaba + xml_path: assets/xml/objects/object_dekubaba.xml +- name: objects/object_dekujr + xml_path: assets/xml/objects/object_dekujr.xml +- name: objects/object_dekunuts + xml_path: assets/xml/objects/object_dekunuts.xml +- name: objects/object_demo_6k + xml_path: assets/xml/objects/object_demo_6k.xml +- name: objects/object_demo_kekkai + xml_path: assets/xml/objects/object_demo_kekkai.xml +- name: objects/object_demo_tre_lgt + xml_path: assets/xml/objects/object_demo_tre_lgt.xml +- name: objects/object_dh + xml_path: assets/xml/objects/object_dh.xml +- name: objects/object_dnk + xml_path: assets/xml/objects/object_dnk.xml +- name: objects/object_dns + xml_path: assets/xml/objects/object_dns.xml +- name: objects/object_dodojr + xml_path: assets/xml/objects/object_dodojr.xml +- name: objects/object_dodongo + xml_path: assets/xml/objects/object_dodongo.xml +- name: objects/object_dog + xml_path: assets/xml/objects/object_dog.xml +- name: objects/object_door_gerudo + xml_path: assets/xml/objects/object_door_gerudo.xml +- name: objects/object_door_killer + xml_path: assets/xml/objects/object_door_killer.xml +- name: objects/object_ds + xml_path: assets/xml/objects/object_ds.xml +- name: objects/object_ds2 + xml_path: assets/xml/objects/object_ds2.xml +- name: objects/object_du + xml_path: assets/xml/objects/object_du_pal.xml +- name: objects/object_dy_obj + xml_path: assets/xml/objects/object_dy_obj.xml +- name: objects/object_ec + xml_path: assets/xml/objects/object_ec.xml +- name: objects/object_efc_crystal_light + xml_path: assets/xml/objects/object_efc_crystal_light.xml +- name: objects/object_efc_doughnut + xml_path: assets/xml/objects/object_efc_doughnut.xml +- name: objects/object_efc_erupc + xml_path: assets/xml/objects/object_efc_erupc.xml +- name: objects/object_efc_fire_ball + xml_path: assets/xml/objects/object_efc_fire_ball.xml +- name: objects/object_efc_flash + xml_path: assets/xml/objects/object_efc_flash.xml +- name: objects/object_efc_lgt_shower + xml_path: assets/xml/objects/object_efc_lgt_shower.xml +- name: objects/object_efc_star_field + xml_path: assets/xml/objects/object_efc_star_field.xml +- name: objects/object_efc_tw + xml_path: assets/xml/objects/object_efc_tw.xml +- name: objects/object_ei + xml_path: assets/xml/objects/object_ei.xml +- name: objects/object_fa + xml_path: assets/xml/objects/object_fa.xml +- name: objects/object_fd + xml_path: assets/xml/objects/object_fd_pal.xml +- name: objects/object_fd2 + xml_path: assets/xml/objects/object_fd2.xml +- name: objects/object_fhg + xml_path: assets/xml/objects/object_fhg_pal.xml +- name: objects/object_fire + xml_path: assets/xml/objects/object_fire.xml +- name: objects/object_firefly + xml_path: assets/xml/objects/object_firefly.xml +- name: objects/object_fish + xml_path: assets/xml/objects/object_fish.xml +- name: objects/object_fr + xml_path: assets/xml/objects/object_fr.xml +- name: objects/object_fu + xml_path: assets/xml/objects/object_fu.xml +- name: objects/object_fw + xml_path: assets/xml/objects/object_fw.xml +- name: objects/object_fz + xml_path: assets/xml/objects/object_fz.xml +- name: objects/object_ganon + xml_path: assets/xml/objects/object_ganon_pal.xml +- name: objects/object_ganon2 + xml_path: assets/xml/objects/object_ganon2_pal.xml +- name: objects/object_ganon_anime1 + xml_path: assets/xml/objects/object_ganon_anime1.xml +- name: objects/object_ganon_anime2 + xml_path: assets/xml/objects/object_ganon_anime2.xml +- name: objects/object_ganon_anime3 + xml_path: assets/xml/objects/object_ganon_anime3.xml +- name: objects/object_ganon_objects + xml_path: assets/xml/objects/object_ganon_objects.xml +- name: objects/object_ge1 + xml_path: assets/xml/objects/object_ge1.xml +- name: objects/object_geff + xml_path: assets/xml/objects/object_geff.xml +- name: objects/object_geldb + xml_path: assets/xml/objects/object_geldb.xml +- name: objects/object_gi_arrow + xml_path: assets/xml/objects/object_gi_arrow.xml +- name: objects/object_gi_arrowcase + xml_path: assets/xml/objects/object_gi_arrowcase.xml +- name: objects/object_gi_bean + xml_path: assets/xml/objects/object_gi_bean.xml +- name: objects/object_gi_bomb_1 + xml_path: assets/xml/objects/object_gi_bomb_1.xml +- name: objects/object_gi_bomb_2 + xml_path: assets/xml/objects/object_gi_bomb_2.xml +- name: objects/object_gi_bombpouch + xml_path: assets/xml/objects/object_gi_bombpouch.xml +- name: objects/object_gi_boomerang + xml_path: assets/xml/objects/object_gi_boomerang.xml +- name: objects/object_gi_boots_2 + xml_path: assets/xml/objects/object_gi_boots_2.xml +- name: objects/object_gi_bosskey + xml_path: assets/xml/objects/object_gi_bosskey.xml +- name: objects/object_gi_bottle + xml_path: assets/xml/objects/object_gi_bottle.xml +- name: objects/object_gi_bottle_letter + xml_path: assets/xml/objects/object_gi_bottle_letter.xml +- name: objects/object_gi_bow + xml_path: assets/xml/objects/object_gi_bow.xml +- name: objects/object_gi_bracelet + xml_path: assets/xml/objects/object_gi_bracelet.xml +- name: objects/object_gi_brokensword + xml_path: assets/xml/objects/object_gi_brokensword.xml +- name: objects/object_gi_butterfly + xml_path: assets/xml/objects/object_gi_butterfly.xml +- name: objects/object_gi_clothes + xml_path: assets/xml/objects/object_gi_clothes.xml +- name: objects/object_gi_coin + xml_path: assets/xml/objects/object_gi_coin.xml +- name: objects/object_gi_compass + xml_path: assets/xml/objects/object_gi_compass.xml +- name: objects/object_gi_dekupouch + xml_path: assets/xml/objects/object_gi_dekupouch.xml +- name: objects/object_gi_egg + xml_path: assets/xml/objects/object_gi_egg.xml +- name: objects/object_gi_eye_lotion + xml_path: assets/xml/objects/object_gi_eye_lotion.xml +- name: objects/object_gi_fire + xml_path: assets/xml/objects/object_gi_fire.xml +- name: objects/object_gi_fish + xml_path: assets/xml/objects/object_gi_fish.xml +- name: objects/object_gi_frog + xml_path: assets/xml/objects/object_gi_frog.xml +- name: objects/object_gi_gerudo + xml_path: assets/xml/objects/object_gi_gerudo.xml +- name: objects/object_gi_gerudomask + xml_path: assets/xml/objects/object_gi_gerudomask.xml +- name: objects/object_gi_ghost + xml_path: assets/xml/objects/object_gi_ghost.xml +- name: objects/object_gi_glasses + xml_path: assets/xml/objects/object_gi_glasses.xml +- name: objects/object_gi_gloves + xml_path: assets/xml/objects/object_gi_gloves.xml +- name: objects/object_gi_goddess + xml_path: assets/xml/objects/object_gi_goddess.xml +- name: objects/object_gi_golonmask + xml_path: assets/xml/objects/object_gi_golonmask.xml +- name: objects/object_gi_grass + xml_path: assets/xml/objects/object_gi_grass.xml +- name: objects/object_gi_hammer + xml_path: assets/xml/objects/object_gi_hammer.xml +- name: objects/object_gi_heart + xml_path: assets/xml/objects/object_gi_heart.xml +- name: objects/object_gi_hearts + xml_path: assets/xml/objects/object_gi_hearts.xml +- name: objects/object_gi_hookshot + xml_path: assets/xml/objects/object_gi_hookshot.xml +- name: objects/object_gi_hoverboots + xml_path: assets/xml/objects/object_gi_hoverboots.xml +- name: objects/object_gi_insect + xml_path: assets/xml/objects/object_gi_insect.xml +- name: objects/object_gi_jewel + xml_path: assets/xml/objects/object_gi_jewel.xml +- name: objects/object_gi_key + xml_path: assets/xml/objects/object_gi_key.xml +- name: objects/object_gi_ki_tan_mask + xml_path: assets/xml/objects/object_gi_ki_tan_mask.xml +- name: objects/object_gi_letter + xml_path: assets/xml/objects/object_gi_letter.xml +- name: objects/object_gi_liquid + xml_path: assets/xml/objects/object_gi_liquid.xml +- name: objects/object_gi_longsword + xml_path: assets/xml/objects/object_gi_longsword.xml +- name: objects/object_gi_m_arrow + xml_path: assets/xml/objects/object_gi_m_arrow.xml +- name: objects/object_gi_magicpot + xml_path: assets/xml/objects/object_gi_magicpot.xml +- name: objects/object_gi_map + xml_path: assets/xml/objects/object_gi_map.xml +- name: objects/object_gi_medal + xml_path: assets/xml/objects/object_gi_medal.xml +- name: objects/object_gi_melody + xml_path: assets/xml/objects/object_gi_melody.xml +- name: objects/object_gi_milk + xml_path: assets/xml/objects/object_gi_milk.xml +- name: objects/object_gi_mushroom + xml_path: assets/xml/objects/object_gi_mushroom.xml +- name: objects/object_gi_niwatori + xml_path: assets/xml/objects/object_gi_niwatori.xml +- name: objects/object_gi_nuts + xml_path: assets/xml/objects/object_gi_nuts.xml +- name: objects/object_gi_ocarina + xml_path: assets/xml/objects/object_gi_ocarina.xml +- name: objects/object_gi_ocarina_0 + xml_path: assets/xml/objects/object_gi_ocarina_0.xml +- name: objects/object_gi_pachinko + xml_path: assets/xml/objects/object_gi_pachinko.xml +- name: objects/object_gi_powder + xml_path: assets/xml/objects/object_gi_powder.xml +- name: objects/object_gi_prescription + xml_path: assets/xml/objects/object_gi_prescription.xml +- name: objects/object_gi_purse + xml_path: assets/xml/objects/object_gi_purse.xml +- name: objects/object_gi_rabit_mask + xml_path: assets/xml/objects/object_gi_rabit_mask.xml +- name: objects/object_gi_redead_mask + xml_path: assets/xml/objects/object_gi_redead_mask.xml +- name: objects/object_gi_rupy + xml_path: assets/xml/objects/object_gi_rupy.xml +- name: objects/object_gi_saw + xml_path: assets/xml/objects/object_gi_saw.xml +- name: objects/object_gi_scale + xml_path: assets/xml/objects/object_gi_scale.xml +- name: objects/object_gi_seed + xml_path: assets/xml/objects/object_gi_seed.xml +- name: objects/object_gi_shield_1 + xml_path: assets/xml/objects/object_gi_shield_1.xml +- name: objects/object_gi_shield_2 + xml_path: assets/xml/objects/object_gi_shield_2.xml +- name: objects/object_gi_shield_3 + xml_path: assets/xml/objects/object_gi_shield_3.xml +- name: objects/object_gi_skj_mask + xml_path: assets/xml/objects/object_gi_skj_mask.xml +- name: objects/object_gi_soldout + xml_path: assets/xml/objects/object_gi_soldout.xml +- name: objects/object_gi_soul + xml_path: assets/xml/objects/object_gi_soul.xml +- name: objects/object_gi_stick + xml_path: assets/xml/objects/object_gi_stick.xml +- name: objects/object_gi_sutaru + xml_path: assets/xml/objects/object_gi_sutaru.xml +- name: objects/object_gi_sword_1 + xml_path: assets/xml/objects/object_gi_sword_1.xml +- name: objects/object_gi_ticketstone + xml_path: assets/xml/objects/object_gi_ticketstone.xml +- name: objects/object_gi_truth_mask + xml_path: assets/xml/objects/object_gi_truth_mask.xml +- name: objects/object_gi_zoramask + xml_path: assets/xml/objects/object_gi_zoramask.xml +- name: objects/object_gj + xml_path: assets/xml/objects/object_gj.xml +- name: objects/object_gjyo_objects + xml_path: assets/xml/objects/object_gjyo_objects.xml +- name: objects/object_gla + xml_path: assets/xml/objects/object_gla.xml +- name: objects/object_gm + xml_path: assets/xml/objects/object_gm.xml +- name: objects/object_gnd + xml_path: assets/xml/objects/object_gnd.xml +- name: objects/object_gnd_magic + xml_path: assets/xml/objects/object_gnd_magic.xml +- name: objects/object_gndd + xml_path: assets/xml/objects/object_gndd.xml +- name: objects/object_god_lgt + xml_path: assets/xml/objects/object_god_lgt.xml +- name: objects/object_gol + xml_path: assets/xml/objects/object_gol.xml +- name: objects/object_goma + xml_path: assets/xml/objects/object_goma_pal.xml +- name: objects/object_goroiwa + xml_path: assets/xml/objects/object_goroiwa.xml +- name: objects/object_gr + xml_path: assets/xml/objects/object_gr.xml +- name: objects/object_gs + xml_path: assets/xml/objects/object_gs.xml +- name: objects/object_gt + xml_path: assets/xml/objects/object_gt.xml +- name: objects/object_haka + xml_path: assets/xml/objects/object_haka.xml +- name: objects/object_haka_door + xml_path: assets/xml/objects/object_haka_door.xml +- name: objects/object_haka_objects + xml_path: assets/xml/objects/object_haka_objects.xml +- name: objects/object_hakach_objects + xml_path: assets/xml/objects/object_hakach_objects.xml +- name: objects/object_hata + xml_path: assets/xml/objects/object_hata.xml +- name: objects/object_heavy_object + xml_path: assets/xml/objects/object_heavy_object.xml +- name: objects/object_hidan_objects + xml_path: assets/xml/objects/object_hidan_objects.xml +- name: objects/object_hintnuts + xml_path: assets/xml/objects/object_hintnuts.xml +- name: objects/object_hni + xml_path: assets/xml/objects/object_hni.xml +- name: objects/object_horse + xml_path: assets/xml/objects/object_horse.xml +- name: objects/object_horse_ganon + xml_path: assets/xml/objects/object_horse_ganon.xml +- name: objects/object_horse_link_child + xml_path: assets/xml/objects/object_horse_link_child.xml +- name: objects/object_horse_normal + xml_path: assets/xml/objects/object_horse_normal.xml +- name: objects/object_horse_zelda + xml_path: assets/xml/objects/object_horse_zelda.xml +- name: objects/object_hs + xml_path: assets/xml/objects/object_hs.xml +- name: objects/object_human + xml_path: assets/xml/objects/object_human.xml +- name: objects/object_ice_objects + xml_path: assets/xml/objects/object_ice_objects.xml +- name: objects/object_ik + xml_path: assets/xml/objects/object_ik.xml +- name: objects/object_im + xml_path: assets/xml/objects/object_im.xml +- name: objects/object_in + xml_path: assets/xml/objects/object_in.xml +- name: objects/object_ingate + xml_path: assets/xml/objects/object_ingate.xml +- name: objects/object_jj + xml_path: assets/xml/objects/object_jj.xml +- name: objects/object_js + xml_path: assets/xml/objects/object_js.xml +- name: objects/object_jya_door + xml_path: assets/xml/objects/object_jya_door.xml +- name: objects/object_jya_iron + xml_path: assets/xml/objects/object_jya_iron.xml +- name: objects/object_jya_obj + xml_path: assets/xml/objects/object_jya_obj.xml +- name: objects/object_ka + xml_path: assets/xml/objects/object_ka.xml +- name: objects/object_kanban + xml_path: assets/xml/objects/object_kanban.xml +- name: objects/object_kibako2 + xml_path: assets/xml/objects/object_kibako2.xml +- name: objects/object_kingdodongo + xml_path: assets/xml/objects/object_kingdodongo_pal.xml +- name: objects/object_km1 + xml_path: assets/xml/objects/object_km1.xml +- name: objects/object_kusa + xml_path: assets/xml/objects/object_kusa.xml +- name: objects/object_kw1 + xml_path: assets/xml/objects/object_kw1.xml +- name: objects/object_kz + xml_path: assets/xml/objects/object_kz.xml +- name: objects/object_light_ring + xml_path: assets/xml/objects/object_light_ring.xml +- name: objects/object_lightbox + xml_path: assets/xml/objects/object_lightbox.xml +- name: objects/object_lightswitch + xml_path: assets/xml/objects/object_lightswitch.xml +- name: objects/object_link_boy + xml_path: assets/xml/objects/object_link_boy.xml +- name: objects/object_link_child + xml_path: assets/xml/objects/object_link_child.xml +- name: objects/object_ma1 + xml_path: assets/xml/objects/object_ma1.xml +- name: objects/object_ma2 + xml_path: assets/xml/objects/object_ma2.xml +- name: objects/object_mag + xml_path: assets/xml/objects/object_mag.xml +- name: objects/object_mamenoki + xml_path: assets/xml/objects/object_mamenoki.xml +- name: objects/object_mastergolon + xml_path: assets/xml/objects/object_mastergolon.xml +- name: objects/object_masterkokiri + xml_path: assets/xml/objects/object_masterkokiri.xml +- name: objects/object_masterkokirihead + xml_path: assets/xml/objects/object_masterkokirihead.xml +- name: objects/object_masterzoora + xml_path: assets/xml/objects/object_masterzoora.xml +- name: objects/object_mb + xml_path: assets/xml/objects/object_mb.xml +- name: objects/object_md + xml_path: assets/xml/objects/object_md.xml +- name: objects/object_medal + xml_path: assets/xml/objects/object_medal.xml +- name: objects/object_menkuri_objects + xml_path: assets/xml/objects/object_menkuri_objects.xml +- name: objects/object_mir_ray + xml_path: assets/xml/objects/object_mir_ray.xml +- name: objects/object_mizu_objects + xml_path: assets/xml/objects/object_mizu_objects.xml +- name: objects/object_mjin + xml_path: assets/xml/objects/object_mjin.xml +- name: objects/object_mjin_dark + xml_path: assets/xml/objects/object_mjin_dark.xml +- name: objects/object_mjin_flame + xml_path: assets/xml/objects/object_mjin_flame.xml +- name: objects/object_mjin_flash + xml_path: assets/xml/objects/object_mjin_flash.xml +- name: objects/object_mjin_ice + xml_path: assets/xml/objects/object_mjin_ice.xml +- name: objects/object_mjin_oka + xml_path: assets/xml/objects/object_mjin_oka.xml +- name: objects/object_mjin_soul + xml_path: assets/xml/objects/object_mjin_soul.xml +- name: objects/object_mjin_wind + xml_path: assets/xml/objects/object_mjin_wind.xml +- name: objects/object_mk + xml_path: assets/xml/objects/object_mk.xml +- name: objects/object_mm + xml_path: assets/xml/objects/object_mm.xml +- name: objects/object_mo + xml_path: assets/xml/objects/object_mo_pal.xml +- name: objects/object_mori_hineri1 + xml_path: assets/xml/objects/object_mori_hineri1.xml +- name: objects/object_mori_hineri1a + xml_path: assets/xml/objects/object_mori_hineri1a.xml +- name: objects/object_mori_hineri2 + xml_path: assets/xml/objects/object_mori_hineri2.xml +- name: objects/object_mori_hineri2a + xml_path: assets/xml/objects/object_mori_hineri2a.xml +- name: objects/object_mori_objects + xml_path: assets/xml/objects/object_mori_objects.xml +- name: objects/object_mori_tex + xml_path: assets/xml/objects/object_mori_tex.xml +- name: objects/object_ms + xml_path: assets/xml/objects/object_ms.xml +- name: objects/object_mu + xml_path: assets/xml/objects/object_mu.xml +- name: objects/object_nb + xml_path: assets/xml/objects/object_nb.xml +- name: objects/object_niw + xml_path: assets/xml/objects/object_niw.xml +- name: objects/object_nwc + xml_path: assets/xml/objects/object_nwc.xml +- name: objects/object_ny + xml_path: assets/xml/objects/object_ny.xml +- name: objects/object_o_anime + xml_path: assets/xml/objects/object_o_anime.xml +- name: objects/object_oA1 + xml_path: assets/xml/objects/object_oA1.xml +- name: objects/object_oA2 + xml_path: assets/xml/objects/object_oA2.xml +- name: objects/object_oA3 + xml_path: assets/xml/objects/object_oA3.xml +- name: objects/object_oA4 + xml_path: assets/xml/objects/object_oA4.xml +- name: objects/object_oA5 + xml_path: assets/xml/objects/object_oA5.xml +- name: objects/object_oA6 + xml_path: assets/xml/objects/object_oA6.xml +- name: objects/object_oA7 + xml_path: assets/xml/objects/object_oA7.xml +- name: objects/object_oA8 + xml_path: assets/xml/objects/object_oA8.xml +- name: objects/object_oA9 + xml_path: assets/xml/objects/object_oA9.xml +- name: objects/object_oA10 + xml_path: assets/xml/objects/object_oA10.xml +- name: objects/object_oA11 + xml_path: assets/xml/objects/object_oA11.xml +- name: objects/object_oB1 + xml_path: assets/xml/objects/object_oB1.xml +- name: objects/object_oB2 + xml_path: assets/xml/objects/object_oB2.xml +- name: objects/object_oB3 + xml_path: assets/xml/objects/object_oB3.xml +- name: objects/object_oB4 + xml_path: assets/xml/objects/object_oB4.xml +- name: objects/object_oE1 + xml_path: assets/xml/objects/object_oE1.xml +- name: objects/object_oE1s + xml_path: assets/xml/objects/object_oE1s.xml +- name: objects/object_oE2 + xml_path: assets/xml/objects/object_oE2.xml +- name: objects/object_oE3 + xml_path: assets/xml/objects/object_oE3.xml +- name: objects/object_oE4 + xml_path: assets/xml/objects/object_oE4.xml +- name: objects/object_oE4s + xml_path: assets/xml/objects/object_oE4s.xml +- name: objects/object_oE5 + xml_path: assets/xml/objects/object_oE5.xml +- name: objects/object_oE6 + xml_path: assets/xml/objects/object_oE6.xml +- name: objects/object_oE7 + xml_path: assets/xml/objects/object_oE7.xml +- name: objects/object_oE8 + xml_path: assets/xml/objects/object_oE8.xml +- name: objects/object_oE9 + xml_path: assets/xml/objects/object_oE9.xml +- name: objects/object_oE10 + xml_path: assets/xml/objects/object_oE10.xml +- name: objects/object_oE11 + xml_path: assets/xml/objects/object_oE11.xml +- name: objects/object_oE12 + xml_path: assets/xml/objects/object_oE12.xml +- name: objects/object_oE_anime + xml_path: assets/xml/objects/object_oE_anime.xml +- name: objects/object_oF1d_map + xml_path: assets/xml/objects/object_oF1d_map.xml +- name: objects/object_oF1s + xml_path: assets/xml/objects/object_oF1s.xml +- name: objects/object_okuta + xml_path: assets/xml/objects/object_okuta.xml +- name: objects/object_opening_demo1 + xml_path: assets/xml/objects/object_opening_demo1.xml +- name: objects/object_os + xml_path: assets/xml/objects/object_os.xml +- name: objects/object_os_anime + xml_path: assets/xml/objects/object_os_anime.xml +- name: objects/object_ossan + xml_path: assets/xml/objects/object_ossan.xml +- name: objects/object_ouke_haka + xml_path: assets/xml/objects/object_ouke_haka.xml +- name: objects/object_owl + xml_path: assets/xml/objects/object_owl.xml +- name: objects/object_peehat + xml_path: assets/xml/objects/object_peehat.xml +- name: objects/object_po_composer + xml_path: assets/xml/objects/object_po_composer.xml +- name: objects/object_po_field + xml_path: assets/xml/objects/object_po_field.xml +- name: objects/object_po_sisters + xml_path: assets/xml/objects/object_po_sisters.xml +- name: objects/object_poh + xml_path: assets/xml/objects/object_poh.xml +- name: objects/object_ps + xml_path: assets/xml/objects/object_ps.xml +- name: objects/object_pu_box + xml_path: assets/xml/objects/object_pu_box.xml +- name: objects/object_rd + xml_path: assets/xml/objects/object_rd.xml +- name: objects/object_reeba + xml_path: assets/xml/objects/object_reeba.xml +- name: objects/object_relay_objects + xml_path: assets/xml/objects/object_relay_objects.xml +- name: objects/object_rl + xml_path: assets/xml/objects/object_rl.xml +- name: objects/object_rr + xml_path: assets/xml/objects/object_rr.xml +- name: objects/object_rs + xml_path: assets/xml/objects/object_rs.xml +- name: objects/object_ru1 + xml_path: assets/xml/objects/object_ru1.xml +- name: objects/object_ru2 + xml_path: assets/xml/objects/object_ru2.xml +- name: objects/object_sa + xml_path: assets/xml/objects/object_sa.xml +- name: objects/object_sb + xml_path: assets/xml/objects/object_sb.xml +- name: objects/object_sd + xml_path: assets/xml/objects/object_sd.xml +- name: objects/object_shop_dungen + xml_path: assets/xml/objects/object_shop_dungen.xml +- name: objects/object_shopnuts + xml_path: assets/xml/objects/object_shopnuts.xml +- name: objects/object_siofuki + xml_path: assets/xml/objects/object_siofuki.xml +- name: objects/object_sk2 + xml_path: assets/xml/objects/object_sk2.xml +- name: objects/object_skb + xml_path: assets/xml/objects/object_skb.xml +- name: objects/object_skj + xml_path: assets/xml/objects/object_skj.xml +- name: objects/object_spot00_break + xml_path: assets/xml/objects/object_spot00_break.xml +- name: objects/object_spot00_objects + xml_path: assets/xml/objects/object_spot00_objects.xml +- name: objects/object_spot01_matoya + xml_path: assets/xml/objects/object_spot01_matoya.xml +- name: objects/object_spot01_matoyab + xml_path: assets/xml/objects/object_spot01_matoyab.xml +- name: objects/object_spot01_objects + xml_path: assets/xml/objects/object_spot01_objects.xml +- name: objects/object_spot01_objects2 + xml_path: assets/xml/objects/object_spot01_objects2.xml +- name: objects/object_spot02_objects + xml_path: assets/xml/objects/object_spot02_objects.xml +- name: objects/object_spot03_object + xml_path: assets/xml/objects/object_spot03_object.xml +- name: objects/object_spot04_objects + xml_path: assets/xml/objects/object_spot04_objects.xml +- name: objects/object_spot05_objects + xml_path: assets/xml/objects/object_spot05_objects.xml +- name: objects/object_spot06_objects + xml_path: assets/xml/objects/object_spot06_objects.xml +- name: objects/object_spot07_object + xml_path: assets/xml/objects/object_spot07_object.xml +- name: objects/object_spot08_obj + xml_path: assets/xml/objects/object_spot08_obj.xml +- name: objects/object_spot09_obj + xml_path: assets/xml/objects/object_spot09_obj.xml +- name: objects/object_spot11_obj + xml_path: assets/xml/objects/object_spot11_obj.xml +- name: objects/object_spot12_obj + xml_path: assets/xml/objects/object_spot12_obj.xml +- name: objects/object_spot15_obj + xml_path: assets/xml/objects/object_spot15_obj.xml +- name: objects/object_spot16_obj + xml_path: assets/xml/objects/object_spot16_obj.xml +- name: objects/object_spot17_obj + xml_path: assets/xml/objects/object_spot17_obj.xml +- name: objects/object_spot18_obj + xml_path: assets/xml/objects/object_spot18_obj.xml +- name: objects/object_ssh + xml_path: assets/xml/objects/object_ssh.xml +- name: objects/object_sst + xml_path: assets/xml/objects/object_sst_pal.xml +- name: objects/object_st + xml_path: assets/xml/objects/object_st.xml +- name: objects/object_stream + xml_path: assets/xml/objects/object_stream.xml +- name: objects/object_syokudai + xml_path: assets/xml/objects/object_syokudai.xml +- name: objects/object_ta + xml_path: assets/xml/objects/object_ta.xml +- name: objects/object_timeblock + xml_path: assets/xml/objects/object_timeblock.xml +- name: objects/object_tite + xml_path: assets/xml/objects/object_tite.xml +- name: objects/object_tk + xml_path: assets/xml/objects/object_tk.xml +- name: objects/object_toki_objects + xml_path: assets/xml/objects/object_toki_objects.xml +- name: objects/object_torch2 + xml_path: assets/xml/objects/object_torch2.xml +- name: objects/object_toryo + xml_path: assets/xml/objects/object_toryo.xml +- name: objects/object_tp + xml_path: assets/xml/objects/object_tp.xml +- name: objects/object_tr + xml_path: assets/xml/objects/object_tr.xml +- name: objects/object_trap + xml_path: assets/xml/objects/object_trap.xml +- name: objects/object_triforce_spot + xml_path: assets/xml/objects/object_triforce_spot.xml +- name: objects/object_ts + xml_path: assets/xml/objects/object_ts.xml +- name: objects/object_tsubo + xml_path: assets/xml/objects/object_tsubo.xml +- name: objects/object_tw + xml_path: assets/xml/objects/object_tw_pal.xml +- name: objects/object_umajump + xml_path: assets/xml/objects/object_umajump.xml +- name: objects/object_vali + xml_path: assets/xml/objects/object_vali.xml +- name: objects/object_vase + xml_path: assets/xml/objects/object_vase.xml +- name: objects/object_vm + xml_path: assets/xml/objects/object_vm.xml +- name: objects/object_wallmaster + xml_path: assets/xml/objects/object_wallmaster.xml +- name: objects/object_warp1 + xml_path: assets/xml/objects/object_warp1.xml +- name: objects/object_warp2 + xml_path: assets/xml/objects/object_warp2.xml +- name: objects/object_wf + xml_path: assets/xml/objects/object_wf.xml +- name: objects/object_wood02 + xml_path: assets/xml/objects/object_wood02.xml +- name: objects/object_xc + xml_path: assets/xml/objects/object_xc_pal.xml +- name: objects/object_yabusame_point + xml_path: assets/xml/objects/object_yabusame_point.xml +- name: objects/object_ydan_objects + xml_path: assets/xml/objects/object_ydan_objects.xml +- name: objects/object_yukabyun + xml_path: assets/xml/objects/object_yukabyun.xml +- name: objects/object_zf + xml_path: assets/xml/objects/object_zf.xml +- name: objects/object_zg + xml_path: assets/xml/objects/object_zg.xml +- name: objects/object_zl1 + xml_path: assets/xml/objects/object_zl1.xml +- name: objects/object_zl2 + xml_path: assets/xml/objects/object_zl2.xml +- name: objects/object_zl2_anime1 + xml_path: assets/xml/objects/object_zl2_anime1.xml +- name: objects/object_zl2_anime2 + xml_path: assets/xml/objects/object_zl2_anime2.xml +- name: objects/object_zl4 + xml_path: assets/xml/objects/object_zl4.xml +- name: objects/object_zo + xml_path: assets/xml/objects/object_zo.xml +- name: overlays/ovl_Arrow_Fire + xml_path: assets/xml/overlays/ovl_Arrow_Fire.xml + start_offset: 0x960 + end_offset: 0x1D80 +- name: overlays/ovl_Arrow_Ice + xml_path: assets/xml/overlays/ovl_Arrow_Ice.xml + start_offset: 0x980 + end_offset: 0x1DA0 +- name: overlays/ovl_Arrow_Light + xml_path: assets/xml/overlays/ovl_Arrow_Light.xml + start_offset: 0x990 + end_offset: 0x1DB0 +- name: overlays/ovl_Bg_Ganon_Otyuka + xml_path: assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml + start_offset: 0x1110 + end_offset: 0x24EC +- name: overlays/ovl_Bg_Jya_Cobra + xml_path: assets/xml/overlays/ovl_Bg_Jya_Cobra.xml + start_offset: 0x1830 + end_offset: 0x18A8 +- name: overlays/ovl_Boss_Dodongo + xml_path: assets/xml/overlays/ovl_Boss_Dodongo.xml + start_offset: 0x61C8 + end_offset: 0x91C8 +- name: overlays/ovl_Boss_Ganon + xml_path: assets/xml/overlays/ovl_Boss_Ganon.xml + start_offset: 0xE388 + end_offset: 0x20EA8 +- name: overlays/ovl_Boss_Ganon2 + xml_path: assets/xml/overlays/ovl_Boss_Ganon2.xml + start_offset: 0x9F38 + end_offset: 0x103E8 +- name: overlays/ovl_Boss_Sst + xml_path: assets/xml/overlays/ovl_Boss_Sst.xml + start_offset: 0xA370 + end_offset: 0xAD20 +- name: overlays/ovl_Demo_Shd + xml_path: assets/xml/overlays/ovl_Demo_Shd.xml + start_offset: 0x410 + end_offset: 0x2390 +- name: overlays/ovl_Effect_Ss_Fhg_Flash + xml_path: assets/xml/overlays/ovl_Effect_Ss_Fhg_Flash.xml + start_offset: 0x9F0 + end_offset: 0xEA8 +- name: overlays/ovl_En_Bili + xml_path: assets/xml/overlays/ovl_En_Bili.xml + start_offset: 0x1E40 + end_offset: 0x1E60 +- name: overlays/ovl_En_Clear_Tag + xml_path: assets/xml/overlays/ovl_En_Clear_Tag.xml + start_offset: 0x2600 + end_offset: 0x8900 +- name: overlays/ovl_En_Ganon_Mant + xml_path: assets/xml/overlays/ovl_En_Ganon_Mant.xml + start_offset: 0x11E8 + end_offset: 0x40E8 +- name: overlays/ovl_En_Ganon_Organ + xml_path: assets/xml/overlays/ovl_En_Ganon_Organ.xml + start_offset: 0x328 + end_offset: 0x6EB0 +- name: overlays/ovl_En_Holl + xml_path: assets/xml/overlays/ovl_En_Holl.xml + start_offset: 0xE68 + end_offset: 0xED0 +- name: overlays/ovl_En_Jsjutan + xml_path: assets/xml/overlays/ovl_En_Jsjutan.xml + start_offset: 0x12B8 + end_offset: 0x4C50 +- name: overlays/ovl_En_Kanban + xml_path: assets/xml/overlays/ovl_En_Kanban.xml + start_offset: 0x2E70 + end_offset: 0x2F30 +- name: overlays/ovl_En_Sda + xml_path: assets/xml/overlays/ovl_En_Sda.xml + start_offset: 0x14A8 + end_offset: 0x1538 +- name: overlays/ovl_En_Ssh + xml_path: assets/xml/overlays/ovl_En_Ssh.xml + start_offset: 0x2150 + end_offset: 0x21E0 +- name: overlays/ovl_En_St + xml_path: assets/xml/overlays/ovl_En_St.xml + start_offset: 0x26A0 + end_offset: 0x2730 +- name: overlays/ovl_En_Sth + xml_path: assets/xml/overlays/ovl_En_Sth.xml + start_offset: 0xE60 + end_offset: 0x3E34 +- name: overlays/ovl_End_Title + xml_path: assets/xml/overlays/ovl_End_Title.xml + start_offset: 0x6F0 + end_offset: 0x4098 +- name: overlays/ovl_file_choose + xml_path: assets/xml/overlays/ovl_file_choose_pal_n64.xml + start_offset: 0xF120 + end_offset: 0xFA30 +- name: overlays/ovl_Magic_Dark + xml_path: assets/xml/overlays/ovl_Magic_Dark.xml + start_offset: 0xC90 + end_offset: 0x16C0 +- name: overlays/ovl_Magic_Fire + xml_path: assets/xml/overlays/ovl_Magic_Fire.xml + start_offset: 0xB20 + end_offset: 0x2170 +- name: overlays/ovl_Magic_Wind + xml_path: assets/xml/overlays/ovl_Magic_Wind.xml + start_offset: 0x6A0 + end_offset: 0x1BB8 +- name: overlays/ovl_Oceff_Spot + xml_path: assets/xml/overlays/ovl_Oceff_Spot.xml + start_offset: 0x780 + end_offset: 0xE58 +- name: overlays/ovl_Oceff_Storm + xml_path: assets/xml/overlays/ovl_Oceff_Storm.xml + start_offset: 0x740 + end_offset: 0x1AD0 +- name: overlays/ovl_Oceff_Wipe + xml_path: assets/xml/overlays/ovl_Oceff_Wipe.xml + start_offset: 0x4F0 + end_offset: 0xCB0 +- name: overlays/ovl_Oceff_Wipe2 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe2.xml + start_offset: 0x430 + end_offset: 0x1698 +- name: overlays/ovl_Oceff_Wipe3 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe3.xml + start_offset: 0x430 + end_offset: 0x1678 +- name: overlays/ovl_Oceff_Wipe4 + xml_path: assets/xml/overlays/ovl_Oceff_Wipe4.xml + start_offset: 0x410 + end_offset: 0xEF8 +- name: scenes/dungeons/bdan + xml_path: assets/xml/scenes/dungeons/bdan.xml +- name: scenes/dungeons/bdan_boss + xml_path: assets/xml/scenes/dungeons/bdan_boss.xml +- name: scenes/dungeons/Bmori1 + xml_path: assets/xml/scenes/dungeons/Bmori1.xml +- name: scenes/dungeons/ddan + xml_path: assets/xml/scenes/dungeons/ddan.xml +- name: scenes/dungeons/ddan_boss + xml_path: assets/xml/scenes/dungeons/ddan_boss_v2.xml +- name: scenes/dungeons/FIRE_bs + xml_path: assets/xml/scenes/dungeons/FIRE_bs.xml +- name: scenes/dungeons/ganon + xml_path: assets/xml/scenes/dungeons/ganon.xml +- name: scenes/dungeons/ganon_boss + xml_path: assets/xml/scenes/dungeons/ganon_boss.xml +- name: scenes/dungeons/ganon_demo + xml_path: assets/xml/scenes/dungeons/ganon_demo.xml +- name: scenes/dungeons/ganon_final + xml_path: assets/xml/scenes/dungeons/ganon_final.xml +- name: scenes/dungeons/ganon_sonogo + xml_path: assets/xml/scenes/dungeons/ganon_sonogo.xml +- name: scenes/dungeons/ganontika + xml_path: assets/xml/scenes/dungeons/ganontika.xml +- name: scenes/dungeons/ganontikasonogo + xml_path: assets/xml/scenes/dungeons/ganontikasonogo.xml +- name: scenes/dungeons/gerudoway + xml_path: assets/xml/scenes/dungeons/gerudoway.xml +- name: scenes/dungeons/HAKAdan + xml_path: assets/xml/scenes/dungeons/HAKAdan.xml +- name: scenes/dungeons/HAKAdan_bs + xml_path: assets/xml/scenes/dungeons/HAKAdan_bs.xml +- name: scenes/dungeons/HAKAdanCH + xml_path: assets/xml/scenes/dungeons/HAKAdanCH.xml +- name: scenes/dungeons/HIDAN + xml_path: assets/xml/scenes/dungeons/HIDAN.xml +- name: scenes/dungeons/ice_doukutu + xml_path: assets/xml/scenes/dungeons/ice_doukutu_pal_n64.xml +- name: scenes/dungeons/jyasinboss + xml_path: assets/xml/scenes/dungeons/jyasinboss.xml +- name: scenes/dungeons/jyasinzou + xml_path: assets/xml/scenes/dungeons/jyasinzou.xml +- name: scenes/dungeons/men + xml_path: assets/xml/scenes/dungeons/men.xml +- name: scenes/dungeons/MIZUsin + xml_path: assets/xml/scenes/dungeons/MIZUsin.xml +- name: scenes/dungeons/MIZUsin_bs + xml_path: assets/xml/scenes/dungeons/MIZUsin_bs.xml +- name: scenes/dungeons/moribossroom + xml_path: assets/xml/scenes/dungeons/moribossroom.xml +- name: scenes/dungeons/ydan + xml_path: assets/xml/scenes/dungeons/ydan.xml +- name: scenes/dungeons/ydan_boss + xml_path: assets/xml/scenes/dungeons/ydan_boss.xml +- name: scenes/indoors/bowling + xml_path: assets/xml/scenes/indoors/bowling.xml +- name: scenes/indoors/daiyousei_izumi + xml_path: assets/xml/scenes/indoors/daiyousei_izumi.xml +- name: scenes/indoors/hairal_niwa + xml_path: assets/xml/scenes/indoors/hairal_niwa.xml +- name: scenes/indoors/hairal_niwa_n + xml_path: assets/xml/scenes/indoors/hairal_niwa_n.xml +- name: scenes/indoors/hakasitarelay + xml_path: assets/xml/scenes/indoors/hakasitarelay.xml +- name: scenes/indoors/hut + xml_path: assets/xml/scenes/indoors/hut.xml +- name: scenes/indoors/hylia_labo + xml_path: assets/xml/scenes/indoors/hylia_labo.xml +- name: scenes/indoors/impa + xml_path: assets/xml/scenes/indoors/impa.xml +- name: scenes/indoors/kakariko + xml_path: assets/xml/scenes/indoors/kakariko.xml +- name: scenes/indoors/kenjyanoma + xml_path: assets/xml/scenes/indoors/kenjyanoma.xml +- name: scenes/indoors/kokiri_home + xml_path: assets/xml/scenes/indoors/kokiri_home.xml +- name: scenes/indoors/kokiri_home3 + xml_path: assets/xml/scenes/indoors/kokiri_home3.xml +- name: scenes/indoors/kokiri_home4 + xml_path: assets/xml/scenes/indoors/kokiri_home4.xml +- name: scenes/indoors/kokiri_home5 + xml_path: assets/xml/scenes/indoors/kokiri_home5.xml +- name: scenes/indoors/labo + xml_path: assets/xml/scenes/indoors/labo.xml +- name: scenes/indoors/link_home + xml_path: assets/xml/scenes/indoors/link_home.xml +- name: scenes/indoors/mahouya + xml_path: assets/xml/scenes/indoors/mahouya.xml +- name: scenes/indoors/malon_stable + xml_path: assets/xml/scenes/indoors/malon_stable.xml +- name: scenes/indoors/miharigoya + xml_path: assets/xml/scenes/indoors/miharigoya.xml +- name: scenes/indoors/nakaniwa + xml_path: assets/xml/scenes/indoors/nakaniwa.xml +- name: scenes/indoors/souko + xml_path: assets/xml/scenes/indoors/souko.xml +- name: scenes/indoors/syatekijyou + xml_path: assets/xml/scenes/indoors/syatekijyou.xml +- name: scenes/indoors/takaraya + xml_path: assets/xml/scenes/indoors/takaraya.xml +- name: scenes/indoors/tent + xml_path: assets/xml/scenes/indoors/tent.xml +- name: scenes/indoors/tokinoma + xml_path: assets/xml/scenes/indoors/tokinoma_pal_n64.xml +- name: scenes/indoors/yousei_izumi_tate + xml_path: assets/xml/scenes/indoors/yousei_izumi_tate.xml +- name: scenes/indoors/yousei_izumi_yoko + xml_path: assets/xml/scenes/indoors/yousei_izumi_yoko.xml +- name: scenes/misc/enrui + xml_path: assets/xml/scenes/misc/enrui.xml +- name: scenes/misc/entra + xml_path: assets/xml/scenes/misc/entra.xml +- name: scenes/misc/entra_n + xml_path: assets/xml/scenes/misc/entra_n.xml +- name: scenes/misc/hakaana + xml_path: assets/xml/scenes/misc/hakaana.xml +- name: scenes/misc/hakaana2 + xml_path: assets/xml/scenes/misc/hakaana2.xml +- name: scenes/misc/hakaana_ouke + xml_path: assets/xml/scenes/misc/hakaana_ouke.xml +- name: scenes/misc/hiral_demo + xml_path: assets/xml/scenes/misc/hiral_demo_pal_n64.xml +- name: scenes/misc/kakariko3 + xml_path: assets/xml/scenes/misc/kakariko3.xml +- name: scenes/misc/kakusiana + xml_path: assets/xml/scenes/misc/kakusiana.xml +- name: scenes/misc/kinsuta + xml_path: assets/xml/scenes/misc/kinsuta.xml +- name: scenes/misc/market_alley + xml_path: assets/xml/scenes/misc/market_alley.xml +- name: scenes/misc/market_alley_n + xml_path: assets/xml/scenes/misc/market_alley_n.xml +- name: scenes/misc/market_day + xml_path: assets/xml/scenes/misc/market_day.xml +- name: scenes/misc/market_night + xml_path: assets/xml/scenes/misc/market_night.xml +- name: scenes/misc/market_ruins + xml_path: assets/xml/scenes/misc/market_ruins.xml +- name: scenes/misc/shrine + xml_path: assets/xml/scenes/misc/shrine.xml +- name: scenes/misc/shrine_n + xml_path: assets/xml/scenes/misc/shrine_n.xml +- name: scenes/misc/shrine_r + xml_path: assets/xml/scenes/misc/shrine_r.xml +- name: scenes/misc/turibori + xml_path: assets/xml/scenes/misc/turibori.xml +- name: scenes/overworld/ganon_tou + xml_path: assets/xml/scenes/overworld/ganon_tou.xml +- name: scenes/overworld/spot00 + xml_path: assets/xml/scenes/overworld/spot00_pal_n64.xml +- name: scenes/overworld/spot01 + xml_path: assets/xml/scenes/overworld/spot01_pal_n64.xml +- name: scenes/overworld/spot02 + xml_path: assets/xml/scenes/overworld/spot02.xml +- name: scenes/overworld/spot03 + xml_path: assets/xml/scenes/overworld/spot03.xml +- name: scenes/overworld/spot04 + xml_path: assets/xml/scenes/overworld/spot04_pal_n64.xml +- name: scenes/overworld/spot05 + xml_path: assets/xml/scenes/overworld/spot05_pal_n64.xml +- name: scenes/overworld/spot06 + xml_path: assets/xml/scenes/overworld/spot06_pal_n64.xml +- name: scenes/overworld/spot07 + xml_path: assets/xml/scenes/overworld/spot07_pal_n64.xml +- name: scenes/overworld/spot08 + xml_path: assets/xml/scenes/overworld/spot08.xml +- name: scenes/overworld/spot09 + xml_path: assets/xml/scenes/overworld/spot09_pal_n64.xml +- name: scenes/overworld/spot10 + xml_path: assets/xml/scenes/overworld/spot10.xml +- name: scenes/overworld/spot11 + xml_path: assets/xml/scenes/overworld/spot11_pal_n64.xml +- name: scenes/overworld/spot12 + xml_path: assets/xml/scenes/overworld/spot12_pal_n64.xml +- name: scenes/overworld/spot13 + xml_path: assets/xml/scenes/overworld/spot13.xml +- name: scenes/overworld/spot15 + xml_path: assets/xml/scenes/overworld/spot15.xml +- name: scenes/overworld/spot16 + xml_path: assets/xml/scenes/overworld/spot16_pal_n64.xml +- name: scenes/overworld/spot17 + xml_path: assets/xml/scenes/overworld/spot17_pal_n64.xml +- name: scenes/overworld/spot18 + xml_path: assets/xml/scenes/overworld/spot18_pal_n64.xml +- name: scenes/overworld/spot20 + xml_path: assets/xml/scenes/overworld/spot20_pal.xml +- name: scenes/shops/alley_shop + xml_path: assets/xml/scenes/shops/alley_shop.xml +- name: scenes/shops/drag + xml_path: assets/xml/scenes/shops/drag.xml +- name: scenes/shops/face_shop + xml_path: assets/xml/scenes/shops/face_shop.xml +- name: scenes/shops/golon + xml_path: assets/xml/scenes/shops/golon.xml +- name: scenes/shops/kokiri_shop + xml_path: assets/xml/scenes/shops/kokiri_shop.xml +- name: scenes/shops/night_shop + xml_path: assets/xml/scenes/shops/night_shop.xml +- name: scenes/shops/shop1 + xml_path: assets/xml/scenes/shops/shop1.xml +- name: scenes/shops/zoora + xml_path: assets/xml/scenes/shops/zoora.xml +- name: textures/backgrounds + xml_path: assets/xml/textures/backgrounds.xml +- name: textures/do_action_static + xml_path: assets/xml/textures/do_action_static_pal.xml +- name: textures/icon_item_24_static + xml_path: assets/xml/textures/icon_item_24_static.xml +- name: textures/icon_item_dungeon_static + xml_path: assets/xml/textures/icon_item_dungeon_static.xml +- name: textures/icon_item_field_static + xml_path: assets/xml/textures/icon_item_field_static.xml +- name: textures/icon_item_fra_static + xml_path: assets/xml/textures/icon_item_fra_static.xml +- name: textures/icon_item_gameover_static + xml_path: assets/xml/textures/icon_item_gameover_static_pal.xml +- name: textures/icon_item_ger_static + xml_path: assets/xml/textures/icon_item_ger_static.xml +- name: textures/icon_item_nes_static + xml_path: assets/xml/textures/icon_item_nes_static.xml +- name: textures/icon_item_static + xml_path: assets/xml/textures/icon_item_static_pal.xml +- name: textures/item_name_static + xml_path: assets/xml/textures/item_name_static_pal.xml +- name: textures/map_48x85_static + xml_path: assets/xml/textures/map_48x85_static.xml +- name: textures/map_grand_static + xml_path: assets/xml/textures/map_grand_static.xml +- name: textures/map_i_static + xml_path: assets/xml/textures/map_i_static.xml +- name: textures/map_name_static + xml_path: assets/xml/textures/map_name_static_pal.xml +- name: textures/message_static + xml_path: assets/xml/textures/message_static.xml +- name: textures/message_texture_static + xml_path: assets/xml/textures/message_texture_static.xml +- name: textures/nes_font_static + xml_path: assets/xml/textures/nes_font_static.xml +- name: textures/nintendo_rogo_static + xml_path: assets/xml/textures/nintendo_rogo_static_v2.xml +- name: textures/parameter_static + xml_path: assets/xml/textures/parameter_static.xml +- name: textures/place_title_cards + xml_path: assets/xml/textures/place_title_cards_pal.xml +- name: textures/skyboxes + xml_path: assets/xml/textures/skyboxes.xml +- name: textures/title_static + xml_path: assets/xml/textures/title_static_pal_n64.xml diff --git a/baseroms/pal-1.1/segments.csv b/baseroms/pal-1.1/segments.csv new file mode 100644 index 0000000000..9104452ea7 --- /dev/null +++ b/baseroms/pal-1.1/segments.csv @@ -0,0 +1,1512 @@ +Name,VRAM start +makerom,80000000 +boot,80000460 +dmadata, +Audiobank, +Audioseq, +Audiotable, +link_animetion, +icon_item_static, +icon_item_24_static, +icon_item_field_static, +icon_item_dungeon_static, +icon_item_gameover_static, +icon_item_nes_static, +icon_item_ger_static, +icon_item_fra_static, +item_name_static, +map_name_static, +do_action_static, +message_static, +message_texture_static, +nes_font_static, +nes_message_data_static, +ger_message_data_static, +fra_message_data_static, +staff_message_data_static, +map_grand_static, +map_i_static, +map_48x85_static, +code,800116E0 +n64dd,801C4F00 +ovl_title,80800000 +ovl_select,808009C0 +ovl_opening,80803720 +ovl_file_choose,80803880 +ovl_kaleido_scope,808140A0 +ovl_player_actor,80830D10 +ovl_map_mark_data,80857490 +ovl_En_Test,8085DFF0 +ovl_En_GirlA,808638A0 +ovl_En_Part,808661C0 +ovl_En_Light,808677D0 +ovl_En_Door,808685C0 +ovl_En_Box,80869400 +ovl_En_Poh,8086AF40 +ovl_En_Okuta,8086F0D0 +ovl_En_Bom,808716B0 +ovl_En_Wallmas,80872580 +ovl_En_Dodongo,80873F90 +ovl_En_Firefly,80876D30 +ovl_En_Horse,80878EA0 +ovl_En_Arrow,80885100 +ovl_En_Elf,808867F0 +ovl_En_Niw,8088B1B0 +ovl_En_Tite,8088E4E0 +ovl_En_Reeba,80891280 +ovl_En_Peehat,80892CF0 +ovl_En_Holl,808963F0 +ovl_En_Scene_Change,808973C0 +ovl_En_Zf,808974F0 +ovl_En_Hata,8089DFF0 +ovl_Boss_Dodongo,8089E580 +ovl_Boss_Goma,808A8060 +ovl_En_Zl1,808ADFE0 +ovl_En_Viewer,808B1DE0 +ovl_En_Goma,808B4CB0 +ovl_Bg_Pushbox,808B7940 +ovl_En_Bubble,808B7C40 +ovl_Door_Shutter,808B9060 +ovl_En_Dodojr,808BB2E0 +ovl_En_Bdfire,808BD180 +ovl_En_Boom,808BDD10 +ovl_En_Torch2,808BE5D0 +ovl_En_Bili,808C0D70 +ovl_En_Tp,808C3040 +ovl_En_St,808C4E90 +ovl_En_Bw,808C7B00 +ovl_En_Eiyer,808CAE70 +ovl_En_River_Sound,808CCAD0 +ovl_En_Horse_Normal,808CD460 +ovl_En_Ossan,808CFA80 +ovl_Bg_Treemouth,808D6060 +ovl_Bg_Dodoago,808D76C0 +ovl_Bg_Hidan_Dalm,808D8470 +ovl_Bg_Hidan_Hrock,808D8CC0 +ovl_En_Horse_Ganon,808D94F0 +ovl_Bg_Hidan_Rock,808DA270 +ovl_Bg_Hidan_Rsekizou,808DB360 +ovl_Bg_Hidan_Sekizou,808DBF40 +ovl_Bg_Hidan_Sima,808DD390 +ovl_Bg_Hidan_Syoku,808DE2B0 +ovl_En_Xc,808DE710 +ovl_Bg_Hidan_Curtain,808E4EA0 +ovl_Bg_Spot00_Hanebasi,808E5940 +ovl_En_Mb,808E6A50 +ovl_En_Bombf,808EAC80 +ovl_Bg_Hidan_Firewall,808EC0F0 +ovl_Bg_Dy_Yoseizo,808EC850 +ovl_En_Zl2,808EF650 +ovl_Bg_Hidan_Fslift,808F3D80 +ovl_En_OE2,808F4250 +ovl_Bg_Ydan_Hasi,808F4330 +ovl_Bg_Ydan_Maruta,808F4AE0 +ovl_Boss_Ganondrof,808F51C0 +ovl_En_Am,808F9F30 +ovl_En_Dekubaba,808FC330 +ovl_En_M_Fire1,808FFDD0 +ovl_En_M_Thunder,808FFF70 +ovl_Bg_Ddan_Jd,80901560 +ovl_Bg_Breakwall,80901BB0 +ovl_En_Jj,80902A20 +ovl_En_Horse_Zelda,80903FF0 +ovl_Bg_Ddan_Kd,80904AE0 +ovl_Door_Warp1,809053D0 +ovl_Obj_Syokudai,80909680 +ovl_Item_B_Heart,8090A2C0 +ovl_En_Dekunuts,8090A6B0 +ovl_Bg_Menkuri_Kaiten,8090BEB0 +ovl_Bg_Menkuri_Eye,8090C040 +ovl_En_Vali,8090C4E0 +ovl_Bg_Mizu_Movebg,8090EB80 +ovl_Bg_Mizu_Water,8090FD20 +ovl_Arms_Hook,809109F0 +ovl_En_fHG,80911750 +ovl_Bg_Mori_Hineri,80914080 +ovl_En_Bb,80914D80 +ovl_Bg_Toki_Hikari,80918A50 +ovl_En_Yukabyun,809197F0 +ovl_Bg_Toki_Swd,80919E00 +ovl_En_Fhg_Fire,8091B450 +ovl_Bg_Mjin,8091DA70 +ovl_Bg_Hidan_Kousi,8091DE50 +ovl_Door_Toki,8091E3D0 +ovl_Bg_Hidan_Hamstep,8091E530 +ovl_En_Bird,8091F3E0 +ovl_En_Wood02,8091F8A0 +ovl_En_Lightbox,80920A80 +ovl_En_Pu_box,80920F00 +ovl_En_Trap,80921240 +ovl_En_Arow_Trap,809224E0 +ovl_En_Vase,80922630 +ovl_En_Ta,80922730 +ovl_En_Tk,809260F0 +ovl_Bg_Mori_Bigst,80927F20 +ovl_Bg_Mori_Elevator,80928850 +ovl_Bg_Mori_Kaitenkabe,80929340 +ovl_Bg_Mori_Rakkatenjo,809299A0 +ovl_En_Vm,8092A310 +ovl_Demo_Effect,8092BBC0 +ovl_Demo_Kankyo,809316C0 +ovl_Bg_Hidan_Fwbig,809353C0 +ovl_En_Floormas,809360A0 +ovl_En_Heishi1,80939480 +ovl_En_Rd,8093A990 +ovl_En_Po_Sisters,8093D240 +ovl_Bg_Heavy_Block,80941F30 +ovl_Bg_Po_Event,80943820 +ovl_Obj_Mure,80945660 +ovl_En_Sw,80946670 +ovl_Boss_Fd,80949E60 +ovl_Object_Kankyo,80951190 +ovl_En_Du,809543B0 +ovl_En_Fd,80955E50 +ovl_En_Horse_Link_Child,80958B10 +ovl_Door_Ana,8095A910 +ovl_Bg_Spot02_Objects,8095AF80 +ovl_Bg_Haka,8095C2D0 +ovl_Magic_Wind,8095C990 +ovl_Magic_Fire,8095E690 +ovl_En_Ru1,80960960 +ovl_Boss_Fd2,80968000 +ovl_En_Fd_Fire,8096BD30 +ovl_En_Dh,8096CA40 +ovl_En_Dha,8096E510 +ovl_En_Rl,8096F510 +ovl_En_Encount1,809703F0 +ovl_Demo_Du,80970F50 +ovl_Demo_Im,80974730 +ovl_Demo_Tre_Lgt,809786A0 +ovl_En_Fw,80978DB0 +ovl_Bg_Vb_Sima,8097A560 +ovl_En_Vb_Ball,8097AC70 +ovl_Bg_Haka_Megane,8097BE10 +ovl_Bg_Haka_MeganeBG,8097C210 +ovl_Bg_Haka_Ship,8097C8D0 +ovl_Bg_Haka_Sgami,8097D310 +ovl_En_Heishi2,8097DF30 +ovl_En_Encount2,80980130 +ovl_En_Fire_Rock,80981360 +ovl_En_Brob,80982470 +ovl_Mir_Ray,80983560 +ovl_Bg_Spot09_Obj,80984E20 +ovl_Bg_Spot18_Obj,80985330 +ovl_Boss_Va,80985C00 +ovl_Bg_Haka_Tubo,8099CDF0 +ovl_Bg_Haka_Trap,8099D810 +ovl_Bg_Haka_Huta,8099EDE0 +ovl_Bg_Haka_Zou,8099F880 +ovl_Bg_Spot17_Funen,809A0A70 +ovl_En_Syateki_Itm,809A0CC0 +ovl_En_Syateki_Man,809A1A60 +ovl_En_Tana,809A2820 +ovl_En_Nb,809A2AC0 +ovl_Boss_Mo,809A7090 +ovl_En_Sb,809B7140 +ovl_En_Bigokuta,809B8580 +ovl_En_Karebaba,809BB090 +ovl_Bg_Bdan_Objects,809BC980 +ovl_Demo_Sa,809BDC50 +ovl_Demo_Go,809C0770 +ovl_En_In,809C14D0 +ovl_En_Tr,809C4270 +ovl_Bg_Spot16_Bombstone,809C5B70 +ovl_Bg_Hidan_Kowarerukabe,809C70B0 +ovl_Bg_Bombwall,809C7F80 +ovl_En_Ru2,809C8840 +ovl_Obj_Dekujr,809CB5C0 +ovl_Bg_Mizu_Uzu,809CBC00 +ovl_Bg_Spot06_Objects,809CBDD0 +ovl_Bg_Ice_Objects,809CD1E0 +ovl_Bg_Haka_Water,809CE120 +ovl_En_Ma2,809CE900 +ovl_En_Bom_Chu,809CF960 +ovl_En_Horse_Game_Check,809D1000 +ovl_Boss_Tw,809D20D0 +ovl_En_Rr,809E7BD0 +ovl_En_Ba,809EA100 +ovl_En_Bx,809EBFD0 +ovl_En_Anubice,809ECAC0 +ovl_En_Anubice_Fire,809EDD70 +ovl_Bg_Mori_Hashigo,809EEB30 +ovl_Bg_Mori_Hashira4,809EF3F0 +ovl_Bg_Mori_Idomizu,809EF980 +ovl_Bg_Spot16_Doughnut,809EFFC0 +ovl_Bg_Bdan_Switch,809F0570 +ovl_En_Ma1,809F19A0 +ovl_Boss_Ganon,809F2C80 +ovl_Boss_Sst,80A18A60 +ovl_En_Ny,80A25020 +ovl_En_Fr,80A26950 +ovl_Item_Shield,80A293E0 +ovl_Bg_Ice_Shelter,80A29DF0 +ovl_En_Ice_Hono,80A2B020 +ovl_Item_Ocarina,80A2C210 +ovl_Magic_Dark,80A2C9E0 +ovl_Demo_6K,80A2E230 +ovl_En_Anubice_Tag,80A30F40 +ovl_Bg_Haka_Gate,80A31210 +ovl_Bg_Spot15_Saku,80A322A0 +ovl_Bg_Jya_Goroiwa,80A325E0 +ovl_Bg_Jya_Zurerukabe,80A32D60 +ovl_Bg_Jya_Cobra,80A33410 +ovl_Bg_Jya_Kanaami,80A35130 +ovl_Fishing,80A354E0 +ovl_Obj_Oshihiki,80A4FF70 +ovl_Bg_Gate_Shutter,80A51A20 +ovl_Eff_Dust,80A51EA0 +ovl_Bg_Spot01_Fusya,80A53280 +ovl_Bg_Spot01_Idohashira,80A53520 +ovl_Bg_Spot01_Idomizu,80A54120 +ovl_Bg_Po_Syokudai,80A54430 +ovl_Bg_Ganon_Otyuka,80A54D80 +ovl_Bg_Spot15_Rrbox,80A573C0 +ovl_Bg_Umajump,80A581A0 +ovl_En_Insect,80A58330 +ovl_En_Butte,80A5A850 +ovl_En_Fish,80A5BE20 +ovl_Bg_Spot08_Iceblock,80A5DF30 +ovl_Item_Etcetera,80A5EF70 +ovl_Arrow_Fire,80A5F840 +ovl_Arrow_Ice,80A61700 +ovl_Arrow_Light,80A635E0 +ovl_Obj_Kibako,80A654D0 +ovl_Obj_Tsubo,80A661D0 +ovl_En_Wonder_Item,80A671C0 +ovl_En_Ik,80A67EF0 +ovl_Demo_Ik,80A6C520 +ovl_En_Skj,80A6DA30 +ovl_En_Skjneedle,80A71370 +ovl_En_G_Switch,80A71680 +ovl_Demo_Ext,80A72EB0 +ovl_Demo_Shd,80A737F0 +ovl_En_Dns,80A75C00 +ovl_Elf_Msg,80A76F90 +ovl_En_Honotrap,80A77580 +ovl_En_Tubo_Trap,80A78AD0 +ovl_Obj_Ice_Poly,80A79770 +ovl_Bg_Spot03_Taki,80A7A120 +ovl_Bg_Spot07_Taki,80A7AA10 +ovl_En_Fz,80A7AFE0 +ovl_En_Po_Relay,80A7CFF0 +ovl_Bg_Relay_Objects,80A7E700 +ovl_En_Diving_Game,80A7EEB0 +ovl_En_Kusa,80A80860 +ovl_Obj_Bean,80A81D40 +ovl_Obj_Bombiwa,80A844D0 +ovl_Obj_Switch,80A84A40 +ovl_Obj_Elevator,80A86800 +ovl_Obj_Lift,80A86BC0 +ovl_Obj_Hsblock,80A875E0 +ovl_En_Okarina_Tag,80A87BB0 +ovl_En_Yabusame_Mark,80A890B0 +ovl_En_Goroiwa,80A89780 +ovl_En_Ex_Ruppy,80A8BB40 +ovl_En_Toryo,80A8CC00 +ovl_En_Daiku,80A8D890 +ovl_En_Nwc,80A8EFD0 +ovl_En_Blkobj,80A8FA10 +ovl_Item_Inbox,80A8FF70 +ovl_En_Ge1,80A900D0 +ovl_Obj_Blockstop,80A92100 +ovl_En_Sda,80A922A0 +ovl_En_Clear_Tag,80A939A0 +ovl_En_Niw_Lady,80A9EF40 +ovl_En_Gm,80AA0840 +ovl_En_Ms,80AA1570 +ovl_En_Hs,80AA1C60 +ovl_Bg_Ingate,80AA2800 +ovl_En_Kanban,80AA2B90 +ovl_En_Heishi3,80AA5CE0 +ovl_En_Syateki_Niw,80AA66D0 +ovl_En_Attack_Niw,80AA8760 +ovl_Bg_Spot01_Idosoko,80AA99C0 +ovl_En_Sa,80AA9BD0 +ovl_En_Wonder_Talk,80AABE40 +ovl_Bg_Gjyo_Bridge,80AAC4D0 +ovl_En_Ds,80AAC9D0 +ovl_En_Mk,80AAD5F0 +ovl_En_Bom_Bowl_Man,80AAE480 +ovl_En_Bom_Bowl_Pit,80AAF9C0 +ovl_En_Owl,80AB0330 +ovl_En_Ishi,80AB3ED0 +ovl_Obj_Hana,80ABD020 +ovl_Obj_Lightswitch,80ABD330 +ovl_Obj_Mure2,80ABE760 +ovl_En_Go,80ABF180 +ovl_En_Fu,80AC37C0 +ovl_En_Changer,80AC4510 +ovl_Bg_Jya_Megami,80AC4EF0 +ovl_Bg_Jya_Lift,80AC60D0 +ovl_Bg_Jya_Bigmirror,80AC6620 +ovl_Bg_Jya_Bombchuiwa,80AC6E60 +ovl_Bg_Jya_Amishutter,80AC7990 +ovl_Bg_Jya_Bombiwa,80AC7D20 +ovl_Bg_Spot18_Basket,80AC82E0 +ovl_En_Ganon_Organ,80AC92D0 +ovl_En_Siofuki,80AD02D0 +ovl_En_Stream,80AD1080 +ovl_En_Mm,80AD1610 +ovl_En_Ko,80AD2C30 +ovl_En_Kz,80AD6D70 +ovl_En_Weather_Tag,80AD8310 +ovl_Bg_Sst_Floor,80AD9200 +ovl_En_Ani,80AD9760 +ovl_En_Ex_Item,80ADA4D0 +ovl_Bg_Jya_Ironobj,80ADB640 +ovl_En_Js,80ADC3F0 +ovl_En_Jsjutan,80ADCDC0 +ovl_En_Cs,80AE26E0 +ovl_En_Md,80AE3910 +ovl_En_Hy,80AE5F80 +ovl_En_Ganon_Mant,80AE98C0 +ovl_En_Okarina_Effect,80AEDAE0 +ovl_En_Mag,80AEDEA0 +ovl_Door_Gerudo,80AF2A00 +ovl_Elf_Msg2,80AF2FF0 +ovl_Demo_Gt,80AF3460 +ovl_En_Po_Field,80AF8A60 +ovl_Efc_Erupc,80AFC4D0 +ovl_Bg_Zg,80AFCFB0 +ovl_En_Heishi4,80AFD420 +ovl_En_Zl3,80AFE320 +ovl_Boss_Ganon2,80B06170 +ovl_En_Kakasi,80B18F90 +ovl_En_Takara_Man,80B19CD0 +ovl_Obj_Makeoshihiki,80B1A590 +ovl_Oceff_Spot,80B1AA20 +ovl_End_Title,80B1B950 +ovl_En_Torch,80B1FA80 +ovl_Demo_Ec,80B1FB70 +ovl_Shot_Sun,80B233D0 +ovl_En_Dy_Extra,80B23A90 +ovl_En_Wonder_Talk2,80B24010 +ovl_En_Ge2,80B246B0 +ovl_Obj_Roomtimer,80B26050 +ovl_En_Ssh,80B262A0 +ovl_En_Sth,80B28890 +ovl_Oceff_Wipe,80B2C940 +ovl_Effect_Ss_Dust,80B2D690 +ovl_Effect_Ss_KiraKira,80B2DEC0 +ovl_Effect_Ss_Bomb,80B2E530 +ovl_Effect_Ss_Bomb2,80B2E950 +ovl_Effect_Ss_Blast,80B2F280 +ovl_Effect_Ss_G_Spk,80B2F610 +ovl_Effect_Ss_D_Fire,80B2FBC0 +ovl_Effect_Ss_Bubble,80B300B0 +ovl_Effect_Ss_G_Ripple,80B30530 +ovl_Effect_Ss_G_Splash,80B30A90 +ovl_Effect_Ss_G_Magma,80B30F40 +ovl_Effect_Ss_G_Fire,80B311A0 +ovl_Effect_Ss_Lightning,80B31430 +ovl_Effect_Ss_Dt_Bubble,80B31B00 +ovl_Effect_Ss_Hahen,80B32090 +ovl_Effect_Ss_Stick,80B326D0 +ovl_Effect_Ss_Sibuki,80B32A70 +ovl_Effect_Ss_Sibuki2,80B33140 +ovl_Effect_Ss_G_Magma2,80B33470 +ovl_Effect_Ss_Stone1,80B33980 +ovl_Effect_Ss_HitMark,80B33D10 +ovl_Effect_Ss_Fhg_Flash,80B34260 +ovl_Effect_Ss_K_Fire,80B351E0 +ovl_Effect_Ss_Solder_Srch_Ball,80B35610 +ovl_Effect_Ss_Kakera,80B357C0 +ovl_Effect_Ss_Ice_Piece,80B36850 +ovl_Effect_Ss_En_Ice,80B36C90 +ovl_Effect_Ss_Fire_Tail,80B37550 +ovl_Effect_Ss_En_Fire,80B37C50 +ovl_Effect_Ss_Extra,80B38390 +ovl_Effect_Ss_Fcircle,80B38750 +ovl_Effect_Ss_Dead_Db,80B38C00 +ovl_Effect_Ss_Dead_Dd,80B390E0 +ovl_Effect_Ss_Dead_Ds,80B39670 +ovl_Effect_Ss_Dead_Sound,80B39AF0 +ovl_Oceff_Storm,80B39C30 +ovl_En_Weiyer,80B3B7D0 +ovl_Bg_Spot05_Soko,80B3D1D0 +ovl_Bg_Jya_1flift,80B3D4F0 +ovl_Bg_Jya_Haheniron,80B3DB80 +ovl_Bg_Spot12_Gate,80B3E370 +ovl_Bg_Spot12_Saku,80B3E780 +ovl_En_Hintnuts,80B3EC40 +ovl_En_Nutsball,80B40670 +ovl_Bg_Spot00_Break,80B40C90 +ovl_En_Shopnuts,80B40E30 +ovl_En_It,80B41D40 +ovl_En_GeldB,80B41ED0 +ovl_Oceff_Wipe2,80B47280 +ovl_Oceff_Wipe3,80B489F0 +ovl_En_Niw_Girl,80B4A140 +ovl_En_Dog,80B4AC10 +ovl_En_Si,80B4BDC0 +ovl_Bg_Spot01_Objects2,80B4C2C0 +ovl_Obj_Comb,80B4C780 +ovl_Bg_Spot11_Bakudankabe,80B4CFE0 +ovl_Obj_Kibako2,80B4D620 +ovl_En_Dnt_Demo,80B4DCE0 +ovl_En_Dnt_Jiji,80B4EA00 +ovl_En_Dnt_Nomal,80B4FF10 +ovl_En_Guest,80B52D50 +ovl_Bg_Bom_Guard,80B536F0 +ovl_En_Hs2,80B53910 +ovl_Demo_Kekkai,80B53EF0 +ovl_Bg_Spot08_Bakudankabe,80B551D0 +ovl_Bg_Spot17_Bakudankabe,80B55870 +ovl_Obj_Mure3,80B55F50 +ovl_En_Tg,80B56720 +ovl_En_Mu,80B56DF0 +ovl_En_Go2,80B57710 +ovl_En_Wf,80B5D750 +ovl_En_Skb,80B61A60 +ovl_Demo_Gj,80B63350 +ovl_Demo_Geff,80B67000 +ovl_Bg_Gnd_Firemeiro,80B67820 +ovl_Bg_Gnd_Darkmeiro,80B67D60 +ovl_Bg_Gnd_Soulmeiro,80B68520 +ovl_Bg_Gnd_Nisekabe,80B68D80 +ovl_Bg_Gnd_Iceblock,80B68EF0 +ovl_Bg_Ydan_Sp,80B69FF0 +ovl_En_Gb,80B6B760 +ovl_En_Gs,80B6CE90 +ovl_Bg_Mizu_Bwall,80B6ED30 +ovl_Bg_Mizu_Shutter,80B70200 +ovl_En_Daiku_Kakariko,80B70A00 +ovl_Bg_Bowl_Wall,80B71DC0 +ovl_En_Wall_Tubo,80B72740 +ovl_En_Po_Desert,80B72C30 +ovl_En_Crow,80B739F0 +ovl_Door_Killer,80B75090 +ovl_Bg_Spot11_Oasis,80B76600 +ovl_Bg_Spot18_Futa,80B76D30 +ovl_Bg_Spot18_Shutter,80B76ED0 +ovl_En_Ma3,80B77420 +ovl_En_Cow,80B784F0 +ovl_Bg_Ice_Turara,80B79950 +ovl_Bg_Ice_Shutter,80B7A180 +ovl_En_Kakasi2,80B7A5F0 +ovl_En_Kakasi3,80B7AD10 +ovl_Oceff_Wipe4,80B7BDF0 +ovl_En_Eg,80B7CDD0 +ovl_Bg_Menkuri_Nisekabe,80B7CF80 +ovl_En_Zo,80B7D0D0 +ovl_Effect_Ss_Ice_Smoke,80B7F680 +ovl_Obj_Makekinsuta,80B7FB40 +ovl_En_Ge3,80B7FC90 +ovl_Obj_Timeblock,80B808D0 +ovl_Obj_Hamishi,80B81510 +ovl_En_Zl4,80B81D60 +ovl_En_Mm2,80B86790 +ovl_Bg_Jya_Block,80B87550 +ovl_Obj_Warp2block,80B877C0 +gameplay_keep, +gameplay_field_keep, +gameplay_dangeon_keep, +gameplay_object_exchange_static, +object_link_boy, +object_link_child, +object_box, +object_human, +object_okuta, +object_poh, +object_wallmaster, +object_dy_obj, +object_firefly, +object_dodongo, +object_fire, +object_niw, +object_tite, +object_reeba, +object_peehat, +object_kingdodongo, +object_horse, +object_zf, +object_goma, +object_zl1, +object_gol, +object_bubble, +object_dodojr, +object_torch2, +object_bl, +object_tp, +object_oA1, +object_st, +object_bw, +object_ei, +object_horse_normal, +object_oB1, +object_o_anime, +object_spot04_objects, +object_ddan_objects, +object_hidan_objects, +object_horse_ganon, +object_oA2, +object_spot00_objects, +object_mb, +object_bombf, +object_sk2, +object_oE1, +object_oE_anime, +object_oE2, +object_ydan_objects, +object_gnd, +object_am, +object_dekubaba, +object_oA3, +object_oA4, +object_oA5, +object_oA6, +object_oA7, +object_jj, +object_oA8, +object_oA9, +object_oB2, +object_oB3, +object_oB4, +object_horse_zelda, +object_opening_demo1, +object_warp1, +object_b_heart, +object_dekunuts, +object_oE3, +object_oE4, +object_menkuri_objects, +object_oE5, +object_oE6, +object_oE7, +object_oE8, +object_oE9, +object_oE10, +object_oE11, +object_oE12, +object_vali, +object_oA10, +object_oA11, +object_mizu_objects, +object_fhg, +object_ossan, +object_mori_hineri1, +object_Bb, +object_toki_objects, +object_yukabyun, +object_zl2, +object_mjin, +object_mjin_flash, +object_mjin_dark, +object_mjin_flame, +object_mjin_ice, +object_mjin_soul, +object_mjin_wind, +object_mjin_oka, +object_haka_objects, +object_spot06_objects, +object_ice_objects, +object_relay_objects, +object_mori_hineri1a, +object_mori_hineri2, +object_mori_hineri2a, +object_mori_objects, +object_mori_tex, +object_spot08_obj, +object_warp2, +object_hata, +object_bird, +object_wood02, +object_lightbox, +object_pu_box, +object_trap, +object_vase, +object_im, +object_ta, +object_tk, +object_xc, +object_vm, +object_bv, +object_hakach_objects, +object_efc_crystal_light, +object_efc_fire_ball, +object_efc_flash, +object_efc_lgt_shower, +object_efc_star_field, +object_god_lgt, +object_light_ring, +object_triforce_spot, +object_medal, +object_bdan_objects, +object_sd, +object_rd, +object_po_sisters, +object_heavy_object, +object_gndd, +object_fd, +object_du, +object_fw, +object_horse_link_child, +object_spot02_objects, +object_haka, +object_ru1, +object_syokudai, +object_fd2, +object_dh, +object_rl, +object_efc_tw, +object_demo_tre_lgt, +object_gi_key, +object_mir_ray, +object_brob, +object_gi_jewel, +object_spot09_obj, +object_spot18_obj, +object_bdoor, +object_spot17_obj, +object_shop_dungen, +object_nb, +object_mo, +object_sb, +object_gi_melody, +object_gi_heart, +object_gi_compass, +object_gi_bosskey, +object_gi_medal, +object_gi_nuts, +object_sa, +object_gi_hearts, +object_gi_arrowcase, +object_gi_bombpouch, +object_in, +object_tr, +object_spot16_obj, +object_oE1s, +object_oE4s, +object_os_anime, +object_gi_bottle, +object_gi_stick, +object_gi_map, +object_oF1d_map, +object_ru2, +object_gi_shield_1, +object_dekujr, +object_gi_magicpot, +object_gi_bomb_1, +object_oF1s, +object_ma2, +object_gi_purse, +object_hni, +object_tw, +object_rr, +object_bxa, +object_anubice, +object_gi_gerudo, +object_gi_arrow, +object_gi_bomb_2, +object_gi_egg, +object_gi_scale, +object_gi_shield_2, +object_gi_hookshot, +object_gi_ocarina, +object_gi_milk, +object_ma1, +object_ganon, +object_sst, +object_ny, +object_fr, +object_gi_pachinko, +object_gi_boomerang, +object_gi_bow, +object_gi_glasses, +object_gi_liquid, +object_ani, +object_demo_6k, +object_gi_shield_3, +object_gi_letter, +object_spot15_obj, +object_jya_obj, +object_gi_clothes, +object_gi_bean, +object_gi_fish, +object_gi_saw, +object_gi_hammer, +object_gi_grass, +object_gi_longsword, +object_spot01_objects, +object_md, +object_km1, +object_kw1, +object_zo, +object_kz, +object_umajump, +object_masterkokiri, +object_masterkokirihead, +object_mastergolon, +object_masterzoora, +object_aob, +object_ik, +object_ahg, +object_cne, +object_gi_niwatori, +object_skj, +object_gi_bottle_letter, +object_bji, +object_bba, +object_gi_ocarina_0, +object_ds, +object_ane, +object_boj, +object_spot03_object, +object_spot07_object, +object_fz, +object_bob, +object_ge1, +object_yabusame_point, +object_gi_boots_2, +object_gi_seed, +object_gnd_magic, +object_d_elevator, +object_d_hsblock, +object_d_lift, +object_mamenoki, +object_goroiwa, +object_toryo, +object_daiku, +object_nwc, +object_blkobj, +object_gm, +object_ms, +object_hs, +object_ingate, +object_lightswitch, +object_kusa, +object_tsubo, +object_gi_gloves, +object_gi_coin, +object_kanban, +object_gjyo_objects, +object_owl, +object_mk, +object_fu, +object_gi_ki_tan_mask, +object_gi_redead_mask, +object_gi_skj_mask, +object_gi_rabit_mask, +object_gi_truth_mask, +object_ganon_objects, +object_siofuki, +object_stream, +object_mm, +object_fa, +object_os, +object_gi_eye_lotion, +object_gi_powder, +object_gi_mushroom, +object_gi_ticketstone, +object_gi_brokensword, +object_js, +object_cs, +object_gi_prescription, +object_gi_bracelet, +object_gi_soldout, +object_gi_frog, +object_mag, +object_door_gerudo, +object_gt, +object_efc_erupc, +object_zl2_anime1, +object_zl2_anime2, +object_gi_golonmask, +object_gi_zoramask, +object_gi_gerudomask, +object_ganon2, +object_ka, +object_ts, +object_zg, +object_gi_hoverboots, +object_gi_m_arrow, +object_ds2, +object_ec, +object_fish, +object_gi_sutaru, +object_gi_goddess, +object_ssh, +object_bigokuta, +object_bg, +object_spot05_objects, +object_spot12_obj, +object_bombiwa, +object_hintnuts, +object_rs, +object_spot00_break, +object_gla, +object_shopnuts, +object_geldb, +object_gr, +object_dog, +object_jya_iron, +object_jya_door, +object_spot01_objects2, +object_spot11_obj, +object_kibako2, +object_dns, +object_dnk, +object_gi_fire, +object_gi_insect, +object_gi_butterfly, +object_gi_ghost, +object_gi_soul, +object_bowl, +object_po_field, +object_demo_kekkai, +object_efc_doughnut, +object_gi_dekupouch, +object_ganon_anime1, +object_ganon_anime2, +object_ganon_anime3, +object_gi_rupy, +object_spot01_matoya, +object_spot01_matoyab, +object_po_composer, +object_mu, +object_wf, +object_skb, +object_gj, +object_geff, +object_haka_door, +object_gs, +object_ps, +object_bwall, +object_crow, +object_cow, +object_cob, +object_gi_sword_1, +object_door_killer, +object_ouke_haka, +object_timeblock, +object_zl4, +g_pn_01, +g_pn_02, +g_pn_03, +g_pn_04, +g_pn_05, +g_pn_06, +g_pn_07, +g_pn_08, +g_pn_09, +g_pn_10, +g_pn_11, +g_pn_12, +g_pn_13, +g_pn_14, +g_pn_15, +g_pn_16, +g_pn_17, +g_pn_18, +g_pn_19, +g_pn_20, +g_pn_21, +g_pn_22, +g_pn_23, +g_pn_24, +g_pn_25, +g_pn_26, +g_pn_27, +g_pn_28, +g_pn_29, +g_pn_30, +g_pn_31, +g_pn_32, +g_pn_33, +g_pn_34, +g_pn_35, +g_pn_36, +g_pn_37, +g_pn_38, +g_pn_39, +g_pn_40, +g_pn_41, +g_pn_42, +g_pn_43, +g_pn_44, +g_pn_45, +g_pn_46, +g_pn_47, +g_pn_48, +g_pn_49, +g_pn_50, +g_pn_51, +g_pn_52, +g_pn_53, +g_pn_54, +g_pn_55, +g_pn_56, +g_pn_57, +z_select_static, +nintendo_rogo_static, +title_static, +parameter_static, +vr_fine0_static, +vr_fine0_pal_static, +vr_fine1_static, +vr_fine1_pal_static, +vr_fine2_static, +vr_fine2_pal_static, +vr_fine3_static, +vr_fine3_pal_static, +vr_cloud0_static, +vr_cloud0_pal_static, +vr_cloud1_static, +vr_cloud1_pal_static, +vr_cloud2_static, +vr_cloud2_pal_static, +vr_cloud3_static, +vr_cloud3_pal_static, +vr_holy0_static, +vr_holy0_pal_static, +vr_holy1_static, +vr_holy1_pal_static, +vr_MDVR_static, +vr_MDVR_pal_static, +vr_MNVR_static, +vr_MNVR_pal_static, +vr_RUVR_static, +vr_RUVR_pal_static, +vr_LHVR_static, +vr_LHVR_pal_static, +vr_KHVR_static, +vr_KHVR_pal_static, +vr_K3VR_static, +vr_K3VR_pal_static, +vr_K4VR_static, +vr_K4VR_pal_static, +vr_K5VR_static, +vr_K5VR_pal_static, +vr_SP1a_static, +vr_SP1a_pal_static, +vr_MLVR_static, +vr_MLVR_pal_static, +vr_KKRVR_static, +vr_KKRVR_pal_static, +vr_KR3VR_static, +vr_KR3VR_pal_static, +vr_IPVR_static, +vr_IPVR_pal_static, +vr_KSVR_static, +vr_KSVR_pal_static, +vr_GLVR_static, +vr_GLVR_pal_static, +vr_ZRVR_static, +vr_ZRVR_pal_static, +vr_DGVR_static, +vr_DGVR_pal_static, +vr_ALVR_static, +vr_ALVR_pal_static, +vr_NSVR_static, +vr_NSVR_pal_static, +vr_LBVR_static, +vr_LBVR_pal_static, +vr_TTVR_static, +vr_TTVR_pal_static, +vr_FCVR_static, +vr_FCVR_pal_static, +elf_message_field, +elf_message_ydan, +ddan_scene, +ddan_room_0, +ddan_room_1, +ddan_room_2, +ddan_room_3, +ddan_room_4, +ddan_room_5, +ddan_room_6, +ddan_room_7, +ddan_room_8, +ddan_room_9, +ddan_room_10, +ddan_room_11, +ddan_room_12, +ddan_room_13, +ddan_room_14, +ddan_room_15, +ddan_room_16, +spot00_scene, +spot00_room_0, +spot01_scene, +spot01_room_0, +spot02_scene, +spot02_room_0, +spot02_room_1, +spot03_scene, +spot03_room_0, +spot03_room_1, +spot04_scene, +spot04_room_0, +spot04_room_1, +spot04_room_2, +spot05_scene, +spot05_room_0, +spot06_scene, +spot06_room_0, +spot07_scene, +spot07_room_0, +spot07_room_1, +spot08_scene, +spot08_room_0, +spot09_scene, +spot09_room_0, +spot10_scene, +spot10_room_0, +spot10_room_1, +spot10_room_2, +spot10_room_3, +spot10_room_4, +spot10_room_5, +spot10_room_6, +spot10_room_7, +spot10_room_8, +spot10_room_9, +spot11_scene, +spot11_room_0, +spot12_scene, +spot12_room_0, +spot12_room_1, +spot13_scene, +spot13_room_0, +spot13_room_1, +spot15_scene, +spot15_room_0, +spot16_scene, +spot16_room_0, +spot17_scene, +spot17_room_0, +spot17_room_1, +spot18_scene, +spot18_room_0, +spot18_room_1, +spot18_room_2, +spot18_room_3, +market_day_scene, +market_day_room_0, +market_night_scene, +market_night_room_0, +HIDAN_scene, +HIDAN_room_0, +HIDAN_room_1, +HIDAN_room_2, +HIDAN_room_3, +HIDAN_room_4, +HIDAN_room_5, +HIDAN_room_6, +HIDAN_room_7, +HIDAN_room_8, +HIDAN_room_9, +HIDAN_room_10, +HIDAN_room_11, +HIDAN_room_12, +HIDAN_room_13, +HIDAN_room_14, +HIDAN_room_15, +HIDAN_room_16, +HIDAN_room_17, +HIDAN_room_18, +HIDAN_room_19, +HIDAN_room_20, +HIDAN_room_21, +HIDAN_room_22, +HIDAN_room_23, +HIDAN_room_24, +HIDAN_room_25, +HIDAN_room_26, +Bmori1_scene, +Bmori1_room_0, +Bmori1_room_1, +Bmori1_room_2, +Bmori1_room_3, +Bmori1_room_4, +Bmori1_room_5, +Bmori1_room_6, +Bmori1_room_7, +Bmori1_room_8, +Bmori1_room_9, +Bmori1_room_10, +Bmori1_room_11, +Bmori1_room_12, +Bmori1_room_13, +Bmori1_room_14, +Bmori1_room_15, +Bmori1_room_16, +Bmori1_room_17, +Bmori1_room_18, +Bmori1_room_19, +Bmori1_room_20, +Bmori1_room_21, +Bmori1_room_22, +ydan_scene, +ydan_room_0, +ydan_room_1, +ydan_room_2, +ydan_room_3, +ydan_room_4, +ydan_room_5, +ydan_room_6, +ydan_room_7, +ydan_room_8, +ydan_room_9, +ydan_room_10, +ydan_room_11, +kenjyanoma_scene, +kenjyanoma_room_0, +tokinoma_scene, +tokinoma_room_0, +tokinoma_room_1, +link_home_scene, +link_home_room_0, +kokiri_shop_scene, +kokiri_shop_room_0, +MIZUsin_scene, +MIZUsin_room_0, +MIZUsin_room_1, +MIZUsin_room_2, +MIZUsin_room_3, +MIZUsin_room_4, +MIZUsin_room_5, +MIZUsin_room_6, +MIZUsin_room_7, +MIZUsin_room_8, +MIZUsin_room_9, +MIZUsin_room_10, +MIZUsin_room_11, +MIZUsin_room_12, +MIZUsin_room_13, +MIZUsin_room_14, +MIZUsin_room_15, +MIZUsin_room_16, +MIZUsin_room_17, +MIZUsin_room_18, +MIZUsin_room_19, +MIZUsin_room_20, +MIZUsin_room_21, +MIZUsin_room_22, +kokiri_home_scene, +kokiri_home_room_0, +kakusiana_scene, +kakusiana_room_0, +kakusiana_room_1, +kakusiana_room_2, +kakusiana_room_3, +kakusiana_room_4, +kakusiana_room_5, +kakusiana_room_6, +kakusiana_room_7, +kakusiana_room_8, +kakusiana_room_9, +kakusiana_room_10, +kakusiana_room_11, +kakusiana_room_12, +kakusiana_room_13, +entra_scene, +entra_room_0, +bdan_scene, +bdan_room_0, +bdan_room_1, +bdan_room_2, +bdan_room_3, +bdan_room_4, +bdan_room_5, +bdan_room_6, +bdan_room_7, +bdan_room_8, +bdan_room_9, +bdan_room_10, +bdan_room_11, +bdan_room_12, +bdan_room_13, +bdan_room_14, +bdan_room_15, +HAKAdan_scene, +HAKAdan_room_0, +HAKAdan_room_1, +HAKAdan_room_2, +HAKAdan_room_3, +HAKAdan_room_4, +HAKAdan_room_5, +HAKAdan_room_6, +HAKAdan_room_7, +HAKAdan_room_8, +HAKAdan_room_9, +HAKAdan_room_10, +HAKAdan_room_11, +HAKAdan_room_12, +HAKAdan_room_13, +HAKAdan_room_14, +HAKAdan_room_15, +HAKAdan_room_16, +HAKAdan_room_17, +HAKAdan_room_18, +HAKAdan_room_19, +HAKAdan_room_20, +HAKAdan_room_21, +HAKAdan_room_22, +moribossroom_scene, +moribossroom_room_0, +moribossroom_room_1, +syatekijyou_scene, +syatekijyou_room_0, +men_scene, +men_room_0, +men_room_1, +men_room_2, +men_room_3, +men_room_4, +men_room_5, +men_room_6, +men_room_7, +men_room_8, +men_room_9, +men_room_10, +shop1_scene, +shop1_room_0, +hairal_niwa_scene, +hairal_niwa_room_0, +ganon_tou_scene, +ganon_tou_room_0, +market_alley_scene, +market_alley_room_0, +spot20_scene, +spot20_room_0, +market_ruins_scene, +market_ruins_room_0, +entra_n_scene, +entra_n_room_0, +enrui_scene, +enrui_room_0, +market_alley_n_scene, +market_alley_n_room_0, +hiral_demo_scene, +hiral_demo_room_0, +kokiri_home3_scene, +kokiri_home3_room_0, +jyasinzou_scene, +jyasinzou_room_0, +jyasinzou_room_1, +jyasinzou_room_2, +jyasinzou_room_3, +jyasinzou_room_4, +jyasinzou_room_5, +jyasinzou_room_6, +jyasinzou_room_7, +jyasinzou_room_8, +jyasinzou_room_9, +jyasinzou_room_10, +jyasinzou_room_11, +jyasinzou_room_12, +jyasinzou_room_13, +jyasinzou_room_14, +jyasinzou_room_15, +jyasinzou_room_16, +jyasinzou_room_17, +jyasinzou_room_18, +jyasinzou_room_19, +jyasinzou_room_20, +jyasinzou_room_21, +jyasinzou_room_22, +jyasinzou_room_23, +jyasinzou_room_24, +jyasinzou_room_25, +jyasinzou_room_26, +jyasinzou_room_27, +jyasinzou_room_28, +ice_doukutu_scene, +ice_doukutu_room_0, +ice_doukutu_room_1, +ice_doukutu_room_2, +ice_doukutu_room_3, +ice_doukutu_room_4, +ice_doukutu_room_5, +ice_doukutu_room_6, +ice_doukutu_room_7, +ice_doukutu_room_8, +ice_doukutu_room_9, +ice_doukutu_room_10, +ice_doukutu_room_11, +malon_stable_scene, +malon_stable_room_0, +kakariko_scene, +kakariko_room_0, +bdan_boss_scene, +bdan_boss_room_0, +bdan_boss_room_1, +FIRE_bs_scene, +FIRE_bs_room_0, +FIRE_bs_room_1, +hut_scene, +hut_room_0, +daiyousei_izumi_scene, +daiyousei_izumi_room_0, +hakaana_scene, +hakaana_room_0, +yousei_izumi_tate_scene, +yousei_izumi_tate_room_0, +yousei_izumi_yoko_scene, +yousei_izumi_yoko_room_0, +golon_scene, +golon_room_0, +zoora_scene, +zoora_room_0, +drag_scene, +drag_room_0, +alley_shop_scene, +alley_shop_room_0, +night_shop_scene, +night_shop_room_0, +impa_scene, +impa_room_0, +labo_scene, +labo_room_0, +tent_scene, +tent_room_0, +nakaniwa_scene, +nakaniwa_room_0, +ddan_boss_scene, +ddan_boss_room_0, +ddan_boss_room_1, +ydan_boss_scene, +ydan_boss_room_0, +ydan_boss_room_1, +HAKAdan_bs_scene, +HAKAdan_bs_room_0, +HAKAdan_bs_room_1, +MIZUsin_bs_scene, +MIZUsin_bs_room_0, +MIZUsin_bs_room_1, +ganon_scene, +ganon_room_0, +ganon_room_1, +ganon_room_2, +ganon_room_3, +ganon_room_4, +ganon_room_5, +ganon_room_6, +ganon_room_7, +ganon_room_8, +ganon_room_9, +ganon_boss_scene, +ganon_boss_room_0, +jyasinboss_scene, +jyasinboss_room_0, +jyasinboss_room_1, +jyasinboss_room_2, +jyasinboss_room_3, +kokiri_home4_scene, +kokiri_home4_room_0, +kokiri_home5_scene, +kokiri_home5_room_0, +ganon_final_scene, +ganon_final_room_0, +kakariko3_scene, +kakariko3_room_0, +hakasitarelay_scene, +hakasitarelay_room_0, +hakasitarelay_room_1, +hakasitarelay_room_2, +hakasitarelay_room_3, +hakasitarelay_room_4, +hakasitarelay_room_5, +hakasitarelay_room_6, +shrine_scene, +shrine_room_0, +turibori_scene, +turibori_room_0, +shrine_n_scene, +shrine_n_room_0, +shrine_r_scene, +shrine_r_room_0, +ganontika_scene, +ganontika_room_0, +ganontika_room_1, +ganontika_room_2, +ganontika_room_3, +ganontika_room_4, +ganontika_room_5, +ganontika_room_6, +ganontika_room_7, +ganontika_room_8, +ganontika_room_9, +ganontika_room_10, +ganontika_room_11, +ganontika_room_12, +ganontika_room_13, +ganontika_room_14, +ganontika_room_15, +ganontika_room_16, +ganontika_room_17, +ganontika_room_18, +ganontika_room_19, +hakaana2_scene, +hakaana2_room_0, +gerudoway_scene, +gerudoway_room_0, +gerudoway_room_1, +gerudoway_room_2, +gerudoway_room_3, +gerudoway_room_4, +gerudoway_room_5, +HAKAdanCH_scene, +HAKAdanCH_room_0, +HAKAdanCH_room_1, +HAKAdanCH_room_2, +HAKAdanCH_room_3, +HAKAdanCH_room_4, +HAKAdanCH_room_5, +HAKAdanCH_room_6, +hairal_niwa_n_scene, +hairal_niwa_n_room_0, +bowling_scene, +bowling_room_0, +hakaana_ouke_scene, +hakaana_ouke_room_0, +hakaana_ouke_room_1, +hakaana_ouke_room_2, +hylia_labo_scene, +hylia_labo_room_0, +souko_scene, +souko_room_0, +souko_room_1, +souko_room_2, +miharigoya_scene, +miharigoya_room_0, +mahouya_scene, +mahouya_room_0, +takaraya_scene, +takaraya_room_0, +takaraya_room_1, +takaraya_room_2, +takaraya_room_3, +takaraya_room_4, +takaraya_room_5, +takaraya_room_6, +ganon_sonogo_scene, +ganon_sonogo_room_0, +ganon_sonogo_room_1, +ganon_sonogo_room_2, +ganon_sonogo_room_3, +ganon_sonogo_room_4, +ganon_demo_scene, +ganon_demo_room_0, +face_shop_scene, +face_shop_room_0, +kinsuta_scene, +kinsuta_room_0, +ganontikasonogo_scene, +ganontikasonogo_room_0, +ganontikasonogo_room_1, +bump_texture_static, +anime_model_1_static, +anime_model_2_static, +anime_model_3_static, +anime_model_4_static, +anime_model_5_static, +anime_model_6_static, +anime_texture_1_static, +anime_texture_2_static, +anime_texture_3_static, +anime_texture_4_static, +anime_texture_5_static, +anime_texture_6_static, +softsprite_matrix_static, diff --git a/data/audio_tables.rodata.s b/data/audio_tables.rodata.s deleted file mode 100644 index 5e76a127b8..0000000000 --- a/data/audio_tables.rodata.s +++ /dev/null @@ -1,22 +0,0 @@ -.include "macro.inc" - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purpose registers - -.section .rodata - -.balign 16 - -glabel gSoundFontTable - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCC270, 0x270 - -glabel gSequenceFontTable - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCC4E0, 0x1C0 - -glabel gSequenceTable - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCC6A0, 0x6F0 - -glabel gSampleBankTable - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCCD90, 0x80 diff --git a/data/unk_800093F0.data.s b/data/cic6105.text.s similarity index 50% rename from data/unk_800093F0.data.s rename to data/cic6105.text.s index 380dbe64b1..387beeded5 100644 --- a/data/unk_800093F0.data.s +++ b/data/cic6105.text.s @@ -1,18 +1,16 @@ .include "macro.inc" -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purpose registers +/* assembler directives */ +.set noat /* allow manual use of $at */ +.set noreorder /* don't insert nops after branches */ +.set gp=64 /* allow use of 64-bit general purpose registers */ -.section .data +.section .text .balign 16 -# Unused. -# This appears to be RSP code, however it is not part of -# rspboot as rspbootTextEnd is at this symbol -glabel D_800093F0 +/* RSP code for cic6105.c, used only in N64 versions. */ + glabel cic6105TextStart .word 0xE80C2001 # sqv $v12[0], 0x10($zero) .word 0x34014000 # li $1, 0x4000 .word 0x40812000 # mtc0 $1, SP_STATUS @@ -21,3 +19,4 @@ glabel D_800093F0 .word 0x09000425 # j 0x04001094 .word 0x00000000 # nop .word 0x00000000 # nop +glabel cic6105TextEnd diff --git a/data/f3dzex2.rodata.s b/data/f3dzex2.rodata.s index 48953bfbe0..111acf2ea0 100644 --- a/data/f3dzex2.rodata.s +++ b/data/f3dzex2.rodata.s @@ -1,18 +1,20 @@ .include "macro.inc" -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purpose registers +/* assembler directives */ +.set noat /* allow manual use of $at */ +.set noreorder /* don't insert nops after branches */ +.set gp=64 /* allow use of 64-bit general purpose registers */ .section .rodata .balign 16 +#if !PLATFORM_N64 glabel gspF3DZEX2_NoN_PosLight_fifoTextStart - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCD0F0, 0x1630 + .incbin "incbin/gspF3DZEX2_NoN_PosLight_fifoText" glabel gspF3DZEX2_NoN_PosLight_fifoTextEnd +#endif glabel gspF3DZEX2_NoN_PosLight_fifoDataStart - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCE720, 0x420 + .incbin "incbin/gspF3DZEX2_NoN_PosLight_fifoData" glabel gspF3DZEX2_NoN_PosLight_fifoDataEnd diff --git a/data/rsp.rodata.s b/data/rsp.rodata.s index 5d3f61ea88..3fc6087f16 100644 --- a/data/rsp.rodata.s +++ b/data/rsp.rodata.s @@ -1,38 +1,38 @@ .include "macro.inc" -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purpose registers +/* assembler directives */ +.set noat /* allow manual use of $at */ +.set noreorder /* don't insert nops after branches */ +.set gp=64 /* allow use of 64-bit general purpose registers */ .section .rodata .balign 16 glabel rspbootTextStart - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0x9F20, 0xD0 + .incbin "incbin/rspbootText" glabel rspbootTextEnd glabel aspMainTextStart - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xB89260, 0xFB0 + .incbin "incbin/aspMainText" glabel aspMainTextEnd glabel aspMainDataStart - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCCE10, 0x2E0 + .incbin "incbin/aspMainData" glabel aspMainDataEnd glabel gspS2DEX2d_fifoTextStart - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xB8A210, 0x18C0 + .incbin "incbin/gspS2DEX2d_fifoText" glabel gspS2DEX2d_fifoTextEnd glabel gspS2DEX2d_fifoDataStart - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCEB40, 0x390 + .incbin "incbin/gspS2DEX2d_fifoData" glabel gspS2DEX2d_fifoDataEnd glabel njpgdspMainTextStart - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xB8BAD0, 0xAF0 + .incbin "incbin/njpgdspMainText" glabel njpgdspMainTextEnd glabel njpgdspMainDataStart - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCEED0, 0x60 + .incbin "incbin/njpgdspMainData" glabel njpgdspMainDataEnd diff --git a/data/unk_80009410.data.s b/data/unk_80009410.data.s deleted file mode 100644 index d2bded6c36..0000000000 --- a/data/unk_80009410.data.s +++ /dev/null @@ -1,21 +0,0 @@ -.include "macro.inc" - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purpose registers - -.section .data - -.balign 16 - -# Unused -glabel D_80009410 - .word osStopThread - .word __osSetHWIntrRoutine - .word __osSetFpcCsr - .word __osGetFpcCsr - .word __osGetHWIntrRoutine - .word __osSetHWIntrRoutine - .word osViGetNextFramebuffer - .word bcmp diff --git a/data/unk_8012ABC0.data.s b/data/unk_8012ABC0.data.s index 31e03580e8..7f99d09e0d 100644 --- a/data/unk_8012ABC0.data.s +++ b/data/unk_8012ABC0.data.s @@ -1,15 +1,15 @@ .include "macro.inc" -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purpose registers +/* assembler directives */ +.set noat /* allow manual use of $at */ +.set noreorder /* don't insert nops after branches */ +.set gp=64 /* allow use of 64-bit general purpose registers */ .section .data .balign 16 -# Unused +/* Unused */ glabel D_8012ABC0 .word fmodf .word guScale diff --git a/data/z_text.data.s b/data/z_text.data.s index 3fe890cdb6..d2a76e0b8e 100644 --- a/data/z_text.data.s +++ b/data/z_text.data.s @@ -1,18 +1,20 @@ .include "macro.inc" -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purpose registers +/* assembler directives */ +.set noat /* allow manual use of $at */ +.set noreorder /* don't insert nops after branches */ +.set gp=64 /* allow use of 64-bit general purpose registers */ .section .data .balign 16 -# temporary file name, rename to something more appropriate when decompiled +/* temporary file name, rename to something more appropriate when decompiled */ +#if OOT_DEBUG glabel gMojiFontTLUTs - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBA18E0, 0x80 + .incbin "incbin/gMojiFontTLUTs" glabel gMojiFontTex - .incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBA1960, 0x400 + .incbin "incbin/gMojiFontTex" +#endif diff --git a/docs/BUILDING_MACOS.md b/docs/BUILDING_MACOS.md index cdfbda24b8..af58ac3fce 100644 --- a/docs/BUILDING_MACOS.md +++ b/docs/BUILDING_MACOS.md @@ -13,12 +13,13 @@ For macOS, use Homebrew to install the following dependencies: * libpng * bash * clang-format +* libxml2 You can install them with the following commands: ```bash brew update -brew install coreutils make python3 libpng bash clang-format +brew install coreutils make python3 libpng bash clang-format libxml2 ``` (The repository expects Homebrew-installed programs to be either linked correctly in `$PATH` etc. or in their default locations.) diff --git a/docs/c_cpp_properties.json b/docs/c_cpp_properties.json new file mode 100644 index 0000000000..b863d21c63 --- /dev/null +++ b/docs/c_cpp_properties.json @@ -0,0 +1,246 @@ +{ + "configurations": [ + { + "name": "oot-ntsc-1.2", + "compilerArgs": [ + "-m32" + ], + "includePath": [ + "include", + "include/libc", + "src", + "build/ntsc-1.2", + ".", + "extracted/ntsc-1.2" + ], + "defines": [ + "_LANGUAGE_C", + "OOT_VERSION=NTSC_1_2", + "OOT_REGION=REGION_JP", + "PLATFORM_N64=1", + "PLATFORM_GC=0", + "OOT_DEBUG=0", + "NDEBUG", + "F3DEX_GBI_2" + ], + "cStandard": "gnu89" + }, + { + "name": "oot-gc-jp", + "compilerArgs": [ + "-m32" + ], + "includePath": [ + "include", + "include/libc", + "src", + "build/gc-jp", + ".", + "extracted/gc-jp" + ], + "defines": [ + "_LANGUAGE_C", + "OOT_VERSION=GC_JP", + "OOT_REGION=REGION_JP", + "PLATFORM_N64=0", + "PLATFORM_GC=1", + "OOT_DEBUG=0", + "NDEBUG", + "F3DEX_GBI_2", + "F3DEX_GBI_PL", + "GBI_DOWHILE" + ], + "cStandard": "gnu89" + }, + { + "name": "oot-gc-jp-mq", + "compilerArgs": [ + "-m32" + ], + "includePath": [ + "include", + "include/libc", + "src", + "build/gc-jp-mq", + ".", + "extracted/gc-jp-mq" + ], + "defines": [ + "_LANGUAGE_C", + "OOT_VERSION=GC_JP_MQ", + "OOT_REGION=REGION_JP", + "PLATFORM_N64=0", + "PLATFORM_GC=1", + "OOT_DEBUG=0", + "NDEBUG", + "F3DEX_GBI_2", + "F3DEX_GBI_PL", + "GBI_DOWHILE" + ], + "cStandard": "gnu89" + }, + { + "name": "oot-gc-us", + "compilerArgs": [ + "-m32" + ], + "includePath": [ + "include", + "include/libc", + "src", + "build/gc-us", + ".", + "extracted/gc-us" + ], + "defines": [ + "_LANGUAGE_C", + "OOT_VERSION=GC_US", + "OOT_REGION=REGION_US", + "PLATFORM_N64=0", + "PLATFORM_GC=1", + "OOT_DEBUG=0", + "NDEBUG", + "F3DEX_GBI_2", + "F3DEX_GBI_PL", + "GBI_DOWHILE" + ], + "cStandard": "gnu89" + }, + { + "name": "oot-gc-us-mq", + "compilerArgs": [ + "-m32" + ], + "includePath": [ + "include", + "include/libc", + "src", + "build/gc-us-mq", + ".", + "extracted/gc-us-mq" + ], + "defines": [ + "_LANGUAGE_C", + "OOT_VERSION=GC_US_MQ", + "OOT_REGION=REGION_US", + "PLATFORM_N64=0", + "PLATFORM_GC=1", + "OOT_DEBUG=0", + "NDEBUG", + "F3DEX_GBI_2", + "F3DEX_GBI_PL", + "GBI_DOWHILE" + ], + "cStandard": "gnu89" + }, + { + "name": "oot-gc-eu-mq-dbg", + "compilerArgs": [ + "-m32" + ], + "includePath": [ + "include", + "include/libc", + "src", + "build/gc-eu-mq-dbg", + ".", + "extracted/gc-eu-mq-dbg" + ], + "defines": [ + "_LANGUAGE_C", + "OOT_VERSION=GC_EU_MQ_DBG", + "OOT_REGION=REGION_EU", + "PLATFORM_N64=0", + "PLATFORM_GC=1", + "OOT_DEBUG=1", + "F3DEX_GBI_2", + "F3DEX_GBI_PL", + "GBI_DOWHILE", + "GBI_DEBUG" + ], + "cStandard": "gnu89" + }, + { + "name": "oot-gc-eu", + "compilerArgs": [ + "-m32" + ], + "includePath": [ + "include", + "include/libc", + "src", + "build/gc-eu", + ".", + "extracted/gc-eu" + ], + "defines": [ + "_LANGUAGE_C", + "OOT_VERSION=GC_EU", + "OOT_REGION=REGION_EU", + "PLATFORM_N64=0", + "PLATFORM_GC=1", + "OOT_DEBUG=0", + "NDEBUG", + "F3DEX_GBI_2", + "F3DEX_GBI_PL", + "GBI_DOWHILE" + ], + "cStandard": "gnu89" + }, + { + "name": "oot-gc-eu-mq", + "compilerArgs": [ + "-m32" + ], + "includePath": [ + "include", + "include/libc", + "src", + "build/gc-eu-mq", + ".", + "extracted/gc-eu-mq" + ], + "defines": [ + "_LANGUAGE_C", + "OOT_VERSION=GC_EU_MQ", + "OOT_REGION=REGION_EU", + "PLATFORM_N64=0", + "PLATFORM_GC=1", + "OOT_DEBUG=0", + "NDEBUG", + "F3DEX_GBI_2", + "F3DEX_GBI_PL", + "GBI_DOWHILE" + ], + "cStandard": "gnu89" + }, + { + "name": "oot-gc-jp-ce", + "compilerArgs": [ + "-m32" + ], + "includePath": [ + "include", + "include/libc", + "src", + "build/gc-jp-ce", + ".", + "extracted/gc-jp-ce" + ], + "defines": [ + "_LANGUAGE_C", + "OOT_VERSION=GC_JP_CE", + "OOT_REGION=REGION_JP", + "PLATFORM_N64=0", + "PLATFORM_GC=1", + "OOT_DEBUG=0", + "NDEBUG", + "F3DEX_GBI_2", + "F3DEX_GBI_PL", + "GBI_DOWHILE" + ], + "cStandard": "gnu89" + }, + ], + "version": 4 +} diff --git a/docs/decompiling_tutorial.md b/docs/decompiling_tutorial.md new file mode 100644 index 0000000000..a77fb1bb8b --- /dev/null +++ b/docs/decompiling_tutorial.md @@ -0,0 +1,10 @@ +This repository used to contain a tutorial for how to do +decompilation work in the repo. + +It has been less useful as more and more was decompiled, +and also more of a chore to keep up-to-date, so it has been +removed from the repo. + +It is still interesting for historical purposes or for +curiosity, you can find the last version of it in revision +[9963e7f5d5fa8caee329f6b40e393d8a2c45390b](https://github.com/zeldaret/oot/blob/9963e7f5d5fa8caee329f6b40e393d8a2c45390b/docs/tutorial/contents.md). diff --git a/docs/retail_versions.md b/docs/retail_versions.md index 535238fd9e..b2f790b267 100644 --- a/docs/retail_versions.md +++ b/docs/retail_versions.md @@ -1,18 +1,17 @@ # Decompiling retail versions -The next decompilation target for OOT is the PAL GameCube Master Quest ROM -(`gc-eu-mq`), because it is the retail version that is most similar to the Debug -ROM. Unfortunately there are still a lot of differences, many of which are -register or stack allocation differences because retail ROMs were built with -different compiler flags. However, once this version is done, future -retail versions should be much easier, as the changes between retail versions are +The next decompilation target for OOT is NTSC version 1.2 +(`ntsc-1.2`), because it is the N64 version that is most similar to the GC +versions. Unfortunately there are still a lot of differences, +but once this version is done, future +N64 versions should be much easier, as the changes between N64 versions are small in comparison. Instead of `cp`ing a matching build into `expected/`, the target ROM is disassembled as `.s` files then -reassembled as `.o` files directly into `expected/build/gc-eu-mq` for diff tools. +reassembled as `.o` files directly into `expected/build/ntsc-1.2` for diff tools. This allows us to make progress matching code in parallel with solving other problems (such as the build system, ROM organization, and BSS ordering). The -files in `tools/disasm/gc-eu-mq` say how to split the source files and where the +files in `tools/disasm/ntsc-1.2` say how to split the source files and where the functions and variables are in the target ROM, and these may need to be updated if there are mistakes or if function names change due to documentation work. @@ -21,55 +20,44 @@ still show diffs with data symbols. We might improve this later, but these data diffs are fine to ignore for now. For register and stack allocation differences, often the code can be tweaked so -that it matches both the retail ROM while continuing to match the Debug ROM (for +that it matches both the retail ROM while continuing to match GC versions and the Debug ROM (for example, by reordering assignments or moving a local variable declaration inside -an `if` block). Since retail MM versions use the same compiler flags as retail -OOT, checking MM decomp for similar code can help. +an `if` block). Since retail MM versions currently target N64, checking MM decomp for similar code can help. -We can disable code that was removed in retail builds by adding -`#if OOT_DEBUG ... #endif` or `if (OOT_DEBUG) { ... }` around these parts of the +We can handle code that is different between versions by adding +`#if PLATFORM_N64 ... #endif` or `#if PLATFORM_GC ... #endif` around these parts of the code. In order to keep the code readable, we should try to minimize the amount of `#if` noise whenever possible. ## Setup -1. Copy your target PAL GameCube Master Quest ROM (non-debug) to - `baseroms/gc-eu-mq/baserom.z64` - -1. Extract assets and ROM files **from the Debug ROM** by running - - ```sh - make setup -jN - ``` - - if necessary, where `N` is the number of cores on your machine. +1. Copy your target JP NTSC 1.2 ROM to `baseroms/ntsc-1.2/baserom.z64` 1. Build the non-matching test ROM by running ```sh - make setup -jN VERSION=gc-eu-mq - make -jN VERSION=gc-eu-mq + make setup -jN VERSION=ntsc-1.2 + make -jN VERSION=ntsc-1.2 ``` where `N` is the number of cores on your machine. This will build into - `build/gc-eu-mq` and produce `build/gc-eu-mq/oot-gc-eu-mq.z64`. + `build/ntsc-1.2` and produce `build/ntsc-1.2/oot-ntsc-1.2.z64`. If you later want to delete all output files, run ```sh - make clean VERSION=gc-eu-mq + make clean VERSION=ntsc-1.2 ``` 1. Disassemble the target ROM by running ```sh - make disasm -jN VERSION=gc-eu-mq + make disasm VERSION=ntsc-1.2 ``` - where `N` is the number of cores on your machine. The outputs will be written to - `expected/build/gc-eu-mq`. + The outputs will be written to `expected/build/ntsc-1.2`. - Note that if you need to copy a matching build for the Debug ROM, you can use + Note that if you need to copy a matching build for another version, you can use e.g. ```sh mkdir -p expected/build @@ -90,37 +78,32 @@ source .venv/bin/activate ### retail_progress.py Running `./retail_progress.py path/to/file.c` will attempt to figure out which functions -in a file still need to match for `gc-eu-mq`. To get an overview of diffs for +in a file still need to match for `ntsc-1.2`. To get an overview of diffs for all files, run `./retail_progress.py` with no arguments. ### asm-differ / diff.py -To diff assembly for a single function in `gc-eu-mq`, run e.g. +To diff assembly for a single function in `ntsc-1.2`, run e.g. ```sh -./diff.py -mwo3 -v gc-eu-mq Math3D_CylTriVsIntersect +./diff.py -mwo3 -v ntsc-1.2 Math3D_CylTriVsIntersect ``` -The `-v` flag tells `diff.py` to compare between `build/gc-eu-mq` and -`expected/build/gc-eu-mq`, and to use `make VERSION=gc-eu-mq` when rebuilding. - -You may also want to diff the Debug ROM in another terminal with - -```sh -./diff.py -mwo3 Math3D_CylTriVsIntersect -``` +The `-v` flag tells `diff.py` to compare between `build/ntsc-1.2` and +`expected/build/ntsc-1.2`, and to use `make VERSION=ntsc-1.2` when rebuilding. +You may also want to diff versions `gc-eu-mq` and/or `gc-eu-mq-dbg` in another terminal to ensure any changes still match there. ### Permuter and decomp.me Disassembly for individual functions is written to -`expected/build/gc-eu-mq/functions`, so to get a [decomp.me](https://decomp.me/) scratch you can run +`expected/build/ntsc-1.2/functions`, so to get a [decomp.me](https://decomp.me/) scratch you can run e.g. ```sh decomp-permuter/import.py \ src/code/sys_math3d.c \ - expected/build/gc-eu-mq/functions/src/code/sys_math3d/Math3D_CylTriVsIntersect.s \ - VERSION=gc-eu-mq --decompme + expected/build/ntsc-1.2/functions/src/code/sys_math3d/Math3D_CylTriVsIntersect.s \ + VERSION=ntsc-1.2 --decompme ``` diff --git a/docs/tutorial/beginning_decomp.md b/docs/tutorial/beginning_decomp.md deleted file mode 100644 index 149753d43b..0000000000 --- a/docs/tutorial/beginning_decomp.md +++ /dev/null @@ -1,926 +0,0 @@ -# Beginning decompilation: the Init function and the Actor struct - -Up: [Contents](contents.md) - -Open the C file and the H file with your actor's name from the appropriate directory in `src/overlays/actors/`. These will be the main files we work with. We will be using EnJj (Lord Jabu Jabu) as our example: despite being a fairly small actor, it has a number of interesting features. - -Each actor has associated to it a data file and one assembly file per function. During the process, we will transfer the contents of all or most of these into the main C file. VSCode's search feature usually makes it quite easy to find the appropriate files without troubling the directory tree. - -## Anatomy of the C file - -The actor file starts off looking like: - -![Fresh actor file annotated](images/fresh_actor_file_annotated.png) - -It is currently divided into six sections as follows: - -1. Preliminary description of the actor. This is not present for all actors, but gives a short description based on what we know about the actor already. It may be inaccurate, so feel free to correct it after you understand the actor better. - -2. Specific `include`s and `define`s for the actor. You may need to add more header files, but otherwise this section is unlikely to change. - -3. These are prototypes for the "main four" functions that almost every actor has. You add more functions here if they need to be declared above their first use. - -4. A set of `extern`s. These refer to data that comes from other files, usually in the actor's corresponding object file. They point to addresses in the ROM where assets are stored (usually collision data, animations or display lists). Once the corresponding object files have been decompiled, these will simply be replaced by including the object file (see [Object Decompilation](object_decomp.md) for how this process works). For now, you can put them between blocks 5 and 6 to conform with how the rest of our files are structured. These symbols have been automatically extracted from the MIPS code. There may turn out to be some that were not caught by the script, in which case they need to be placed in the file called `undefined_syms.txt` in the root directory of the project. Ask in Discord for how to do this: it is simple, but rare enough to not be worth covering here. - -5. Commented-out section containing the `InitVars`. This can be ignored until we import the data: it is a section of the actor data that has been imported automatically since, unlike most of the data, it has the same format in every actor. (This image is out of date: actors now also have their ColliderInits in here) - -6. List of functions. Each `#pragma` is letting the compiler use the corresponding assembly file while we do not have decompiled C code for that function. The majority of the decompilation work is converting these functions into C that it looks like a human wrote. - -## Header file - -The header file looks like this at the moment: - -![Fresh actor header](images/fresh_actor_header.png) - -The struct currently contains a variable that is the `Actor` struct, which all actors use one way or another, plus other items. Currently we don't know what those items are, so we have an array of chars as padding instead, just so the struct is the right size. As we understand the actor better, we will be able to gradually replace this padding with the actual variables that the actor uses. - -The header file is also used to declare structs and other information about the actor that is needed globally (e.g. by other actors). - -## Order of decompilation - -The general rule for order of decompilation is -- Start with `Init`, because it usually contains the most information about the structure of the actor. -- Next, decompile any other functions from the actor you have found in `Init`. You generally start with the action functions, because they return nothing and all take the same arguments, - -```C -void func_80whatever(EnJj* this, PlayState* play); -``` - -- Decompile each action function in turn until you run out. Along the way, do any other functions in the actor for which you have discovered the argument types. (You are probably better doing depth-first on action functions than breadth-first: it's normally easier to follow along one branch of the actions than ) - -- After you've run out, do `Update`. This usually provides the rest of the function tree, apart from posibly some Draw functions. - -- Finally, do the draw functions. - -The above is a rough ordering for the beginner. As you become more experienced, you can deviate from this scheme, but the general principle remains that you should work on functions that you already know something about. - -## Data - -![Fresh actor data](images/fresh_actor_data.png) - -Associated to each actor is a `.data` file, containing data that the actor uses. This ranges from spawn positions, to display lists, to even some cutscene data. Since the structure of the data is very inconsistent between actors, automatic importing has been very limited, so the vast majority must be done manually. - -There are two ways of transfering the data into an actor: we can either -- import it all naively as words (`s32`s), which will still allow it to compile, and sort out the actual types later, or -- we can extern each piece of data as we come across it, and come back to it later when we have a better idea of what it is. - -We will concentrate on the second here; the other is covered in [the document about data](data.md). Thankfully this means we essentially don't have to do anything to the data yet. Nevertheless, it is often quite helpful to copy over at least some of the data and leave it commented out for later replacement. *Data must go in the same order as in the data file, and data is "all or nothing": you cannot only import some of it*. - -![Data copied in and commented out](images/data_inserted_commented_out.png) - -**WARNING** The way in which the data was extracted from the ROM means that there are sometimes "fake symbols" in the data, which have to be removed to avoid confusing the compiler. Thankfully it will turn out that this is not the case here, although there will be other data issues. - -(Sometimes it is useful to import the data in the middle of doing functions: you just have to choose an appropriate moment.) - - -Some actors also have a `.bss` file. This is just data that is initialised to 0, and can be imported immediately once you know what type it is, by declaring it without giving it a value. - -## Init - -The Init function sets up the various components of the actor when it is first loaded. It is hence usually very useful for finding out what is in the actor struct, and so we usually start with it. (Some people like starting with Destroy, which is usually shorter and simpler, but gives some basic information about the actor, but Init is probably best for beginners.) - -### mips2c - -The first stage of decompilation is done by a program called mips2c or mips_to_c, which constructs a C interpretation of the assembly code based on reading it very literally. This means that considerable cleanup will be required to turn it into something that firstly compiles at all, and secondly looks like a human wrote it, let alone a Zelda developer from the late '90s. - -The web version of mips2c can be found [here](https://simonsoftware.se/other/mips_to_c.py). There is also a downloadable version, but let's just use the online one for now. - -Since the actor depends on the rest of the codebase, we can't expect to get much intelligible out of mips2c without giving it some context. We make this using a Python script in the `tools` directory called `m2ctx.py`, so run -``` -$ ./tools/m2ctx.py -``` -from the main directory of the repository. In this case, the C file is `src/overlays/actors/ovl_En_Jj/z_en_jj.c`. This generates a file called `ctx.c` in the main directory of the repository. Open this file in a text editor (Notepad will do) and copy the whole contents into the "Existing C source, preprocessed" box. - -![Copying the context](images/ctx.png) - -Now, open the file containing the assembly for `EnJj_Init`. - -![Copying the Init asm](images/init_asm.png) - -Copy the entire contents of this file into the upper box, labelled "MIPS assembly". Now, for Init (and also the other "main 4" functions `Destroy`, `Update` and `Draw`), the function's first argument is `Actor* thisx`. But we would like mips2c to use the fields in the actual actor struct; we can make it do this by deliberately changing the prototype of the `EnJj_Init` in the pasted context to have first argument `EnJj* this` instead. - -![Changing init prototype](images/changing_init_prototype.png) - -Now press "Decompile". This should produce C code: -```C -void EnJj_Init(EnJj *this, PlayState *play) { - CollisionHeader *sp4C; - DynaCollisionContext *sp44; - DynaCollisionContext *temp_a1; - DynaCollisionContext *temp_a1_2; - DynaCollisionContext *temp_a1_3; - char *temp_v0_2; - s16 temp_v0; - - sp4C = NULL; - Actor_ProcessInitChain((Actor *) this, &D_80A88CE0); - ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); - temp_v0 = this->actor.params; - temp_a1 = this + 0x164; - [...] -``` - -Typically for all buth the simplest functions, there is a lot that needs fixing before we are anywhere near seeing how close we are to the original code. You will notice that mips2c creates a lot of temporary variables. Usually most of these will turn out to not be real, and we need to remove the right ones to get the code to match. - -First, change the first argument back to `Actor* thisx` so that the function matches its prototype above. To allow the function to find the variables, we need another correction. Half of this has already been done at the top of the function, where we have - -```C -#define THIS ((EnJj*)thisx) -``` - -To do the other half, write the following at the beginning of the function, before any declarations: - -```C -EnJj* this = THIS; -``` - -Now everything points to the right place, even though the argument of the function seems inconsistent with the contents. - -(This step is only necessary for the "main 4" functions, and sometimes functions that are used by these: it relates to how such functions are used outside the actor.) - -While we are carrying out initial changes, you can also find-and-replace any instances of `(Actor *) this` by `&this->actor`. The function now looks like this: - -
- - Large code block, click to show. - - -```C -void EnJj_Init(Actor *thisx, PlayState *play) { - EnJj* this = THIS; - - CollisionHeader *sp4C; - DynaCollisionContext *sp44; - DynaCollisionContext *temp_a1; - DynaCollisionContext *temp_a1_2; - DynaCollisionContext *temp_a1_3; - char *temp_v0_2; - s16 temp_v0; - - sp4C = NULL; - Actor_ProcessInitChain(&this->actor, &D_80A88CE0); - ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); - temp_v0 = this->actor.params; - temp_a1 = this + 0x164; - if (temp_v0 == -1) { - sp44 = temp_a1; - SkelAnime_InitFlex(play, (SkelAnime *) temp_a1, (FlexSkeletonHeader *) &D_0600B9A8, (AnimationHeader *) &D_06001F4C, this + 0x1A8, this + 0x22C, 0x16); - Animation_PlayLoop((SkelAnime *) sp44, (AnimationHeader *) &D_06001F4C); - this->unk30A = (u16)0; - this->unk30E = (u8)0; - this->unk30F = (u8)0; - this->unk310 = (u8)0; - this->unk311 = (u8)0; - if ((*(&gSaveContext + 0xEDA) & 0x400) != 0) { - func_80A87800(this, &func_80A87BEC); - } else { - func_80A87800(this, &func_80A87C30); - } - this->unk300 = Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, (u16)0x5A, this->actor.world.pos.x - 10.0f, this->actor.world.pos.y, this->actor.world.pos.z, 0, (?32) this->actor.world.rot.y, 0, 0); - DynaPolyActor_Init((DynaPolyActor *) this, 0); - CollisionHeader_GetVirtual((void *) &D_06000A1C, &sp4C); - this->unk_14C = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->actor, sp4C); - temp_a1_3 = this + 0x2B0; - sp44 = temp_a1_3; - Collider_InitCylinder(play, (ColliderCylinder *) temp_a1_3); - Collider_SetCylinder(play, (ColliderCylinder *) temp_a1_3, &this->actor, &D_80A88CB4); - this->actor.colChkInfo.mass = 0xFF; - return; - } - if (temp_v0 == 0) { - DynaPolyActor_Init((DynaPolyActor *) this, 0); - CollisionHeader_GetVirtual((void *) &D_06001830, &sp4C); - temp_a1_2 = &play->colCtx.dyna; - sp44 = temp_a1_2; - temp_v0_2 = DynaPoly_SetBgActor(play, temp_a1_2, &this->actor, sp4C); - this->unk_14C = temp_v0_2; - func_8003ECA8(play, temp_a1_2, (s32) temp_v0_2); - this->actor.update = &func_80A87F44; - this->actor.draw = NULL; - Actor_SetScale(&this->actor, 0.087f); - return; - } - if (temp_v0 != 1) { - return; - } - DynaPolyActor_Init((DynaPolyActor *) this, 0); - CollisionHeader_GetVirtual((void *) &D_0600BA8C, &sp4C); - this->unk_14C = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->actor, sp4C); - this->actor.update = &func_80A87F44; - this->actor.draw = NULL; - Actor_SetScale(&this->actor, 0.087f); -} -``` - -
- -In the next sections, we shall sort out the various initialisation functions that occur in Init. There are several types, and one of the reasons we are using EnJj as the example is that it has several of the most common ones. A disadvantage of this actor is that it has an unusually complicated Init: we can see that it does three different things depending on the value of its params. - -### Init chains - -Almost always, one of the first items in `Init` is a function that looks like - -```C -Actor_ProcessInitChain(&this->actor, &D_80A88CE0); -``` - -which initialises common properties of actor using an InitChain, which is usually somewhere near the top of the data, in this case in the variable `D_80A88CE0`. Although we don't need to do this now since we we will extern the data, we might as well work out what it is now. Fortunately, we have a script to do this. - -The InitChain script is also in the tools directory, and is called `ichaindis.py`. Simply passing it the ROM address will spit out the entire contents of the InitChain, in this case: - -``` -$ ./tools/ichaindis.py baseroms/gc-eu-mq-dbg/baserom-decompressed.z64 80A88CE0 -static InitChainEntry sInitChain[] = { - ICHAIN_VEC3F_DIV1000(unk_50, 87, ICHAIN_CONTINUE), - ICHAIN_F32(unk_F4, 4000, ICHAIN_CONTINUE), - ICHAIN_F32(unk_F8, 3300, ICHAIN_CONTINUE), - ICHAIN_F32(unk_FC, 1100, ICHAIN_STOP), -}; -``` - -However, some of these variables have now been given names in the Actor struct. Pass it `--names` to fill these in automatically: -``` -$ ./tools/ichaindis.py --names baseroms/gc-eu-mq-dbg/baserom-decompressed.z64 80A88CE0 -static InitChainEntry sInitChain[] = { - ICHAIN_VEC3F_DIV1000(scale, 87, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneScale, 3300, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneDownward, 1100, ICHAIN_STOP), -}; -``` - -Replace the commented-out .words for the `glabel D_80A88CE0` with this, and comment it out, instead adding -```C -extern InitChainEntry D_80A88CE0[]; - -``` -above it: - -```C -extern InitChainEntry D_80A88CE0[]; -// static InitChainEntry sInitChain[] = { -// ICHAIN_VEC3F_DIV1000(scale, 87, ICHAIN_CONTINUE), -// ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), -// ICHAIN_F32(uncullZoneScale, 3300, ICHAIN_CONTINUE), -// ICHAIN_F32(uncullZoneDownward, 1100, ICHAIN_STOP), -// }; -``` - -(We will come back and actually import it after doing the rest of the actor.) - -Since this is an array, we do not need the `&` in the function any more, which leaves us with -```C -Actor_ProcessInitChain(&this->actor, D_80A88CE0); -``` - -in `EnJj_Init`. - -### DynaPoly - -Glancing through the rest of `EnJj_Init`, we notice some references to DynaPoly, for example -```C -DynaPolyActor_Init((DynaPolyActor *) this, 0); -CollisionHeader_GetVirtual((void *) &D_06000A1C, &sp4C); -this->unk_14C = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->actor, sp4C); -``` - -This means that EnJj is not an ordinary actor: it is instead a DynaPoly actor. In-game this is to do with how the actor interacts with Link and the environment (a good rule of thumb is that Link can often stand on DynaPoly actors as if they were ground). For decompilation purposes, it means that the actor struct is wrong: the first element of a DynaPoly actor's struct is not an `Actor` struct, but a `DynaPolyActor`, usually called `dyna`. We should fix this immediately to avoid confusion later. (Some actors have this correctly identified already; we were unlucky with this one.) - -Since there's basically nothing in the struct at present, the change is easy to make: replace `Actor actor` with `DynaPolyActor dyna`. Now, `DynaPolyActor` is a different size to `Actor`, so we need to account for that. To find out what size it is, you need to find the definition. In VSCode you can usually Ctrl+Left Click on things to go to where they are defined. Doing so takes us to `z64actor.h`, where most actor-related structs are defined: we find -```C -typedef struct { - /* 0x000 */ Actor actor; - /* 0x14C */ u32 bgId; - /* 0x150 */ f32 unk_150; - /* 0x154 */ f32 unk_154; - /* 0x158 */ s16 unk_158; - /* 0x15A */ u16 unk_15A; - /* 0x15C */ u32 unk_15C; - /* 0x160 */ u8 unk_160; - /* 0x162 */ s16 unk_162; -} DynaPolyActor; // size = 0x164 -``` - -so a `DynaPolyActor` struct is an `Actor` with various other things after it. For now all we care about is the size, i.e. `0x164`. This tells us that the next thing after the `DynaPolyActor` struct in the `EnJj` struct begins at `0x164`, not `0x14C` as it does for `Actor`s. - -So rename the variable to `unk_164` and change the comment to say `0x0164` (the comments don't do anything, they just make it easier to keep track of where everything is when it's named). - -Next we need to adjust the size of the array so that the struct is still the right size. In this case, we just subtract the address of the padding variable from the total size of the struct: -```0x314 - 0x164 = 1B0```. Hence the struct is now -```C -typedef struct EnJj { - /* 0x0000 */ DynaPolyActor dyna; - /* 0x0164 */ char unk_164[0x1B0]; -} EnJj; // size = 0x0314 -``` - -Now that we know this, it is worth remaking the context file and running mips2c again, since we have changed the struct significantly. Doing so, and replacing `(Actor*) this` with `&this->dyna.actor` this time, we find that the block we quoted above has become -```C -DynaPolyActor_Init((DynaPolyActor *) this, 0); -CollisionHeader_GetVirtual((void *) &D_06000A1C, &sp4C); -this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, sp4C); -``` - -Next, replace `(DynaPolyActor *) this` by `&this->dyna`. There's not a lot more we can do to the DynaPoly stuff right now, so just remove the casts to void and move on. - -### Colliders - -The next common thing that actors have is colliders. Not every actor has these, but most do, even if they don't just use them for collision system purposes. - -The relevant functions in this actor are -```C -temp_a1_3 = this + 0x2B0; -sp44 = temp_a1_3; -Collider_InitCylinder(play, (ColliderCylinder *) temp_a1_3); -Collider_SetCylinder(play, (ColliderCylinder *) temp_a1_3, &this->dyna.actor, &D_80A88CB4); -``` - -Notice that `sp44` is set, but actually not used anywhere in the actor. This is a good indication that it is fake. We'll get back to that. Similarly, `temp_a1_3` is only used in these functions, so is likely to be fake as well: it's simply trying to get the pointer into the `a1` register. - -Since mips2c doesn't know about the collider, it has just told us where it is, namely `this + 0x2B0`. So insert a `ColliderCylinder collider` variable in the actor struct, look up its size, and redo the padding. This should give -```C -typedef struct EnJj { - /* 0x0000 */ DynaPolyActor dyna; - /* 0x0164 */ char unk_164[0x14C]; - /* 0x02B0 */ ColliderCylinder collider; - /* 0x02FC */ char unk_2FC[0x18]; -} EnJj; // size = 0x0314 -``` - -Now replace the temps, so we have -```C -Collider_InitCylinder(play, &this->collider); -Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &D_80A88CB4); -``` - -(You may prefer to just comment out temps initially, to keep track of where they were.) - -The last thing we need to deal with is the last variable of `Collider_SetCylinder`, which is again data. - - - -This is already in the actor file in the correct format, all you need to do is add an extern for it underneath: -```C -/* -[...] -*/ -extern ColliderCylinderInit D_80A88CB4; -``` - -Unlike the InitChain, this is not an array, so keep the `&` in the function. - -### SkelAnime - -This is the combined system that handles actors' skeletons and their animations. It is the other significant part of most actor structs. We see its initialisation in this part of the code: -```C -temp_a1 = this->unk_164; -... -sp44 = (DynaCollisionContext *) temp_a1; -SkelAnime_InitFlex(play, (SkelAnime *) temp_a1, (FlexSkeletonHeader *) &D_0600B9A8, (AnimationHeader *) &D_06001F4C, this + 0x1A8, this + 0x22C, 0x16); -Animation_PlayLoop((SkelAnime *) sp44, (AnimationHeader *) &D_06001F4C); -``` - -(Both of the temps are likely to be fake.) - -An actor with SkelAnime has three structs in the Actor struct that handle it: one called SkelAnime, and two arrays of `Vec3s`, called `jointTable` and `overrideDrawTable` (for now). Usually, although not always, they are next to one another. - -There are two different sorts of SkelAnime, although for decompilation purposes there is not much difference between them. From `SkelAnime_InitFlex` we can read off that - -- The `SkelAnime` struct is at `this + 0x164` -- The `jointTable` is at `this + 0x1A8` -- The `overrideDrawTable` is at `this + 0x22C` -- The number of limbs is `0x16 = 22` -- Hence the `jointTable` and `overrideDrawTable` both have `22` elements - -Looking in `z64animation.h`, we find that `SkelAnime` has size `0x44`, and looking in `z64math.h`, that `Vec3s` has size `0x6`. Since ` 0x164 + 0x44 = 0x1A8 `, `jointTable` is immediately after the `SkelAnime`, and since `0x1A8 + 0x6 * 0x16 = 0x22C`, `overrideDrawTable` is immediately after the `jointTable`. Finally, `0x22C + 0x6 * 0x16 = 2B0`, and we have filled all the space between the `dyna` and `collider`. Therefore the struct now looks like -```C -typedef struct EnJj { - /* 0x0000 */ DynaPolyActor dyna; - /* 0x0164 */ SkelAnime skelAnime; - /* 0x01A8 */ Vec3s jointTable[22]; - /* 0x022C */ Vec3s overrideDrawTable[22]; - /* 0x02B0 */ ColliderCylinder collider; - /* 0x02FC */ char unk_2FC[0x18]; -} EnJj; // size = 0x0314 -``` - -The last information we get from the SkelAnime functions is the types of two of the externed symbols: `D_0600B9A8` is a `FlexSkeletonHeader`, and `D_06001F4C` is an `AnimationHeader`. So we can change these in the C file: - -```C -extern UNK_TYPE D_06000A1C; -extern UNK_TYPE D_06001830; -extern AnimationHeader D_06001F4C; -extern FlexSkeletonHeader D_0600B9A8; -extern UNK_TYPE D_0600BA8C; -``` - -and removing the temps, -```C -SkelAnime_InitFlex(play, &this->skelAnime, &D_0600B9A8, &D_06001F4C, this->jointTable, this->morphTable, 22); -Animation_PlayLoop(&this->skelAnime, &D_06001F4C); -``` - -### More struct variables - -This function also gives us information about other things in the struct. One obvious thing that sticks out is -```C -this->unk300 = Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, (u16)0x5A, this->dyna.actor.world.pos.x - 10.0f, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, (?32) this->dyna.actor.world.rot.y, 0, 0); -``` -Hovering over this function tells us it outputs a pointer to the spawned actor, so `this->unk_300` is an `Actor*`. We may or may not care what this actor actually is, depending on how it is used later on, so let's just add `/* 0x0300 */ Actor* childActor` to the struct for now. - -We can look up what the actor with ID 0x5A is in `z64actor.h`: we find it is `ACTOR_EN_JJ`. So some Jabus spawn another Jabu. Filling this in and removing the spurious cast, we have -```C -this->childActor = Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_EN_JJ, this->dyna.actor.world.pos.x - 10.0f, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, this->dyna.actor.world.rot.y, 0, 0); -``` - -Finally, we have this block: -```C -this->unk30A = (u16)0; -this->unk30E = (u8)0; -this->unk30F = (u8)0; -this->unk310 = (u8)0; -this->unk311 = (u8)0; -``` -This is not quite as helpful as you might think: it tells us the size of these variables, but despite mips2c's assertion that they are all unsigned, they may actually be signed: you can't tell from the MIPS unless they are loaded: there is only `sh`, but there are both `lh` and `lhu`, for example. There's not much to choose between them when guessing, but generally signed is a better guess with no other context. For unnamed struct variables, our convention is `unk_30A` etc. Adding them to the struct, we end up with -
- - Large code block, click to show. - - -```C -typedef struct EnJj { - /* 0x0000 */ DynaPolyActor dyna; - /* 0x0164 */ SkelAnime skelAnime; - /* 0x01A8 */ Vec3s jointTable[22]; - /* 0x022C */ Vec3s morphTable[22]; - /* 0x02B0 */ ColliderCylinder collider; - /* 0x02FC */ char unk_2FC[0x4]; - /* 0x0300 */ Actor* childActor; - /* 0x0304 */ char unk_304[0x6]; - /* 0x030A */ s16 unk_30A; - /* 0x030C */ char unk_30C[0x2]; - /* 0x030E */ s8 unk_30E; - /* 0x030F */ s8 unk_30F; - /* 0x0310 */ s8 unk_310; - /* 0x0311 */ s8 unk_311; - /* 0x0312 */ char unk_312[0x2]; -} EnJj; // size = 0x0314 -``` - -We can remove a few more temps that don't look real, and end up with -```C -void EnJj_Init(Actor *thisx, PlayState *play) { - EnJj* this = THIS; - - CollisionHeader *sp4C; - // DynaCollisionContext *sp44; - // DynaCollisionContext *temp_a1_2; - // DynaCollisionContext *temp_a1_3; - // char *temp_a1; - s16 temp_v0; - // u32 temp_v0_2; - - sp4C = NULL; - Actor_ProcessInitChain(&this->dyna.actor, D_80A88CE0); - ActorShape_Init(&this->dyna.actor.shape, 0.0f, NULL, 0.0f); - temp_v0 = this->dyna.actor.params; - // temp_a1 = this->unk_164; - if (temp_v0 == -1) { - // sp44 = (DynaCollisionContext *) temp_a1; - SkelAnime_InitFlex(play, &this->skelAnime, &D_0600B9A8, &D_06001F4C, this->jointTable, this->morphTable, 22); - Animation_PlayLoop(&this->skelAnime, &D_06001F4C); - this->unk_30A = 0; - this->unk_30E = 0; - this->unk_30F = 0; - this->unk_310 = 0; - this->unk_311 = 0; - if ((*(&gSaveContext + 0xEDA) & 0x400) != 0) { - func_80A87800(this, &func_80A87BEC); - } else { - func_80A87800(this, &func_80A87C30); - } - this->childActor = Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_EN_JJ, this->dyna.actor.world.pos.x - 10.0f, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, this->dyna.actor.world.rot.y, 0, 0); - DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(&D_06000A1C, &sp4C); - this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, sp4C); - // temp_a1_3 = this + 0x2B0; - // sp44 = temp_a1_3; - Collider_InitCylinder(play, &this->collider); - Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &D_80A88CB4); - this->dyna.actor.colChkInfo.mass = 0xFF; - return; - } - if (temp_v0 == 0) { - DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(&D_06001830, &sp4C); - // temp_a1_2 = &play->colCtx.dyna; - // sp44 = temp_a1_2; - this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, sp4C); - func_8003ECA8(play, &play->colCtx.dyna, this->dyna.bgId); - this->dyna.actor.update = &func_80A87F44; - this->dyna.actor.draw = NULL; - Actor_SetScale(&this->dyna.actor, 0.087f); - return; - } - if (temp_v0 != 1) { - return; - } - DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(&D_0600BA8C, &sp4C); - this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, sp4C); - this->dyna.actor.update = &func_80A87F44; - this->dyna.actor.draw = NULL; - Actor_SetScale(&this->dyna.actor, 0.087f); -} -``` -
- -This will still not compile without errors: we need to know what the functions it calls are. - -### Functions called - -Function pointers do not need `&`, so remove all those. There are three functions that are called in this actor. Firstly, `this->dyna.actor.update = func_80A87F44;` tells us that `func_80A87F44` is an alternative update function for this actor. We therefore give it a prototype similar to the original Update: -```C -void EnJj_Init(Actor* thisx, PlayState* play); -void EnJj_Destroy(Actor* thisx, PlayState* play); -void EnJj_Update(Actor* thisx, PlayState* play); -void EnJj_Draw(Actor* thisx, PlayState* play); - -void func_80A87F44(Actor* thisx, PlayState* play); -``` - -Unfortunately the others are not so easy to deal with. In order to find out what type the functions called by `func_80A87800`, we have to look at `func_80A87800` itself. But fortunately, this is the entire MIPS for `func_80A87800`: - -```MIPS -glabel func_80A87800 -/* 00000 80A87800 03E00008 */ jr $ra -/* 00004 80A87804 AC8502FC */ sw $a1, 0x02FC($a0) ## 000002FC -``` - -This is simple enough to read that we don't even need to appeal to mips2c: it saves its second argument into its first argument `+ 0x2FC`. Many actors use this type of function, which we call `SetupAction`: it simply changes the action function. - -*Action functions* are the main other kind of function in most actors: they are usually run by Update every frame, and carry out the main actions that the actor does (hence the name). They all have the same arguments, and so we have a typedef for such things: it is -```C -typedef void (*EnJjActionFunc)(struct EnJj*, PlayState*); -``` -Put this between `struct EnJj;` and the actor struct in the header file. This also gives us another bit of the struct, conveniently plugging the gap at `0x2FC`: -```C -/* 0x02FC */ EnJjActionFunc actionFunc; -``` - -We have actually learnt three useful pieces of information from this, the other two being that the function above Init is simply -```C -void func_80A87800(EnJj* this, EnJjActionFunc actionFunc) { - this->actionFunc = actionFunc; -} -``` - -and that `func_80A87BEC` and `func_80A87C30`, passed to it in `EnJj_Init`, are action functions. Since they are first used above where they are defined, we prototype them at the top as well, -```C -void EnJj_Init(Actor* thisx, PlayState* play); -void EnJj_Destroy(Actor* thisx, PlayState* play); -void EnJj_Update(Actor* thisx, PlayState* play); -void EnJj_Draw(Actor* thisx, PlayState* play); - -void func_80A87F44(Actor* thisx, PlayState* play); -void func_80A87BEC(EnJj* this, PlayState* play); -void func_80A87C30(EnJj* this, PlayState* play); -``` - - -### Other pointer issues - -Mips2c is bad at arrays. We see this in the `(*(&gSaveContext + 0xEDA) & 0x400) != 0`, which will actually stop the compiler working. We need to go and look up what this is actually pointing to, and replace it in the code. Following the trail, we find that: - -1. `gSaveContext` is of type `SaveContext` -2. The struct `SaveContext` is defined in `z64save.h` -3. The entry in `SaveContext` that contains `0xEDA` is `/* 0x0ED4 */ u16 eventChkInf[14];` -4. Since `0xEDA - 0xED4 = 0x6`, and `u16`s take up 2 bytes each, we conclude that it is `eventChkInf[3]` that is being referenced. - -Therefore, the condition should be `(gSaveContext.save.info.eventChkInf[3] & 0x400) != 0`. This is a flag comparison, so we can also leave off the `!= 0`. - -With all of this implemented, the function should now compile without errors. The parts of the file that we have changed now look like - -
- - Large code block, click to show. - - -```C -void EnJj_Init(Actor* thisx, PlayState* play); -void EnJj_Destroy(Actor* thisx, PlayState* play); -void EnJj_Update(Actor* thisx, PlayState* play); -void EnJj_Draw(Actor* thisx, PlayState* play); - -void func_80A87F44(Actor* thisx, PlayState* play); -void func_80A87BEC(EnJj* this, PlayState* play); -void func_80A87C30(EnJj* this, PlayState* play); - -#if 0 -ActorInit En_Jj_InitVars = { - /**/ ACTOR_EN_JJ, - /**/ ACTORTYPE_ITEMACTION, - /**/ FLAGS, - /**/ OBJECT_JJ, - /**/ sizeof(EnJj), - /**/ EnJj_Init, - /**/ EnJj_Destroy, - /**/ EnJj_Update, - /**/ EnJj_Draw, -}; -#endif - -extern ColliderCylinderInit D_80A88CB4; -// static ColliderCylinderInit sCylinderInit = { -// { -// COLTYPE_NONE, -// AT_NONE, -// AC_ON | AC_TYPE_PLAYER, -// OC1_ON | OC1_TYPE_ALL, -// OC2_TYPE_1, -// COLSHAPE_CYLINDER, -// }, -// { -// ELEMTYPE_UNK0, -// { 0x00000000, 0x00, 0x00 }, -// { 0x00000004, 0x00, 0x00 }, -// ATELEM_NONE, -// ACELEM_ON, -// OCELEM_ON, -// }, -// { 170, 150, 0, { 0, 0, 0 } }, -// }; - -extern InitChainEntry D_80A88CE0[]; -// static InitChainEntry sInitChain[] = { -// ICHAIN_VEC3F_DIV1000(scale, 87, ICHAIN_CONTINUE), -// ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), -// ICHAIN_F32(uncullZoneScale, 3300, ICHAIN_CONTINUE), -// ICHAIN_F32(uncullZoneDownward, 1100, ICHAIN_STOP), -// }; - -// glabel D_80A88CF0 -// .word 0xC4C6A000, 0x42540000, 0xC22C0000 -// glabel D_80A88CFC -// .word 0x06007698, 0x06007A98, 0x06007E98, 0x00000000, 0x00000000 - - -extern UNK_TYPE D_06000A1C; -extern UNK_TYPE D_06001830; -extern AnimationHeader D_06001F4C; -extern FlexSkeletonHeader D_0600B9A8; -extern UNK_TYPE D_0600BA8C; - -// #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Jj/func_80A87800.s") -void func_80A87800(EnJj* this, EnJjActionFunc actionFunc) { - this->actionFunc = actionFunc; -} - -// #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Jj/EnJj_Init.s") -void EnJj_Init(Actor *thisx, PlayState *play) { - EnJj* this = THIS; - - CollisionHeader *sp4C; - // DynaCollisionContext *sp44; - // DynaCollisionContext *temp_a1_2; - // DynaCollisionContext *temp_a1_3; - // char *temp_a1; - s16 temp_v0; - // u32 temp_v0_2; - - sp4C = NULL; - Actor_ProcessInitChain(&this->dyna.actor, D_80A88CE0); - ActorShape_Init(&this->dyna.actor.shape, 0.0f, NULL, 0.0f); - temp_v0 = this->dyna.actor.params; - // temp_a1 = this->unk_164; - if (temp_v0 == -1) { - // sp44 = (DynaCollisionContext *) temp_a1; - SkelAnime_InitFlex(play, &this->skelAnime, &D_0600B9A8, &D_06001F4C, this->jointTable, this->morphTable, 22); - Animation_PlayLoop(&this->skelAnime, &D_06001F4C); - this->unk_30A = 0; - this->unk_30E = 0; - this->unk_30F = 0; - this->unk_310 = 0; - this->unk_311 = 0; - if ((gSaveContext.save.info.eventChkInf[3] & 0x400) != 0) { - func_80A87800(this, func_80A87BEC); - } else { - func_80A87800(this, func_80A87C30); - } - this->childActor = Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_EN_JJ, this->dyna.actor.world.pos.x - 10.0f, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, this->dyna.actor.world.rot.y, 0, 0); - DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(&D_06000A1C, &sp4C); - this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, sp4C); - // temp_a1_3 = this + 0x2B0; - // sp44 = temp_a1_3; - Collider_InitCylinder(play, &this->collider); - Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &D_80A88CB4); - this->dyna.actor.colChkInfo.mass = 0xFF; - return; - } - if (temp_v0 == 0) { - DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(&D_06001830, &sp4C); - // temp_a1_2 = &play->colCtx.dyna; - // sp44 = temp_a1_2; - this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, sp4C); - func_8003ECA8(play, &play->colCtx.dyna, this->dyna.bgId); - this->dyna.actor.update = func_80A87F44; - this->dyna.actor.draw = NULL; - Actor_SetScale(&this->dyna.actor, 0.087f); - return; - } - if (temp_v0 != 1) { - return; - } - DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(&D_0600BA8C, &sp4C); - this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, sp4C); - this->dyna.actor.update = func_80A87F44; - this->dyna.actor.draw = NULL; - Actor_SetScale(&this->dyna.actor, 0.087f); -} -``` -
- -## Diff - -Once preliminary cleanup and struct filling is done, most time spent matching functions is done by comparing the original code with the code you have compiled. This is aided by a program called `diff.py`. - -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 -cp -r build expected/ -``` -from the main directory of the repository. You should end up with the directory structure `expected/build/...`. - -You may want to do this again when you start renaming functions. *Make sure that you copy an OK build, or you are going to get very confused.* You should also do this again after needing to do a `make clean`. - -Now, we run diff on the function name: in the main directory, -``` -$ ./diff.py -mwo3 EnJj_Init -``` - -(To see what these arguments do, run it with `./diff.py -h` or look in the scripts documentation.) - -This gives the following: - -
- - Large image, click to show. - - -![Init diff 1](images/init_diff1.png) -
- -The code we want is on the left, current code on the right. To spot where the function ends, either look for where stuff is added and subtracted from the stack pointer in successive lines, or for a -```MIPS -jr ra -nop -``` - -The colours mean the following: - -- White/gray is matching lines -- Red is lines missing -- Green is extra lines -- Blue denotes significant differences in instructions, be they just numerical ones, or whole instructions -- Yellow/Gold denotes that instructions are correct but register usage is wrong -- Other colors are used to distinguish incorrectly used registers or stack variables, to make it easy to follow where they are used. -- The colored arrows denote branching. An arrow of one color on the right leads to the arrow of the same color on the left. - -Obviously we want to make the whole thing white. This is the tricky bit: you have to have the imagination to try different things until you get the diff to match. You learn these with experience. - -Generally, the order of what to fix should be: - -1. Control flow (conditionals, where branches go) -2. Instruction ordering and type (functions cannot change order, which is a useful indicator) -3. Regalloc (register allocation) differences -4. Stack differences - -(It is this order because the things that happen earlier can influence the things that happen later.) - -You can keep the diff open in the terminal, and it will refresh when the C file (but not the H file) is changed with these settings. - -In this case, we see that various branches are happening in the wrong place. Here I fear experience is necessary: notice that the function has three blocks that look quite similar, and three separate conditionals that depend on the same variable. This is a good indicator of a switch. Changing the function to use a switch, - -```C -void EnJj_Init(Actor* thisx, PlayState* play) { - EnJj* this = THIS; - - s32 sp4C; - s16 temp_v0; - - sp4C = 0; - Actor_ProcessInitChain(&this->dyna.actor, D_80A88CE0); - ActorShape_Init(&this->dyna.actor.shape, 0.0f, NULL, 0.0f); - temp_v0 = this->dyna.actor.params; - - switch (temp_v0) { - case -1: - SkelAnime_InitFlex(play, &this->skelAnime, &D_0600B9A8, &D_06001F4C, this->jointTable, - this->morphTable, 22); - Animation_PlayLoop(&this->skelAnime, &D_06001F4C); - this->unk_30A = 0; - this->unk_30E = 0; - this->unk_30F = 0; - this->unk_310 = 0; - this->unk_311 = 0; - if ((gSaveContext.save.info.eventChkInf[3] & 0x400) != 0) { - func_80A87800(this, func_80A87BEC); - } else { - func_80A87800(this, func_80A87C30); - } - this->childActor = Actor_SpawnAsChild( - &play->actorCtx, &this->dyna.actor, play, ACTOR_EN_JJ, this->dyna.actor.world.pos.x - 10.0f, - this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, this->dyna.actor.world.rot.y, 0, 0); - DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(&D_06000A1C, &sp4C); - this->dyna.bgId = - DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, sp4C); - Collider_InitCylinder(play, &this->collider); - Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &D_80A88CB4); - this->dyna.actor.colChkInfo.mass = 0xFF; - break; - case 0: - DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(&D_06001830, &sp4C); - // temp_a1_2 = &play->colCtx.dyna; - // sp44 = temp_a1_2; - this->dyna.bgId = - DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, sp4C); - func_8003ECA8(play, &play->colCtx.dyna, this->dyna.bgId); - this->dyna.actor.update = func_80A87F44; - this->dyna.actor.draw = NULL; - Actor_SetScale(&this->dyna.actor, 0.087f); - break; - case 1: - DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(&D_0600BA8C, &sp4C); - this->dyna.bgId = - DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, sp4C); - this->dyna.actor.update = func_80A87F44; - this->dyna.actor.draw = NULL; - Actor_SetScale(&this->dyna.actor, 0.087f); - break; - } -} -``` - -we see that the diff is nearly correct (note that `-3` lets you compare current with previous): - -
- - Large image, click to show. - - -![Init diff 2](images/init_diff2.png) -
- -except we still have some stack issues. Now that `temp_v0` is only used once, it looks fake. Eliminating it actually seems to make the stack worse. To fix this, we employ something that we have evidence that the developers did: namely, we make a copy of `play` (the theory is that they actually used `gameState` as an argument of the main 4 functions, just like we used `Actor* thisx` as the first argument.) The quick way to do this is to change the top of the function to -```C -void EnJj_Init(Actor* thisx, PlayState* play2) { - PlayState* play = play2; - EnJj* this = THIS; - ... -``` - -It turns out that this is enough to completely fix the diff: - -![Init diff 2](images/init_diff3top.png) -(last two edits, only top shown for brevity) - -Everything *looks* fine, but we only know for sure when we run `make`. Thankfully doing so gives -``` -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. - -And with that, we have successfully matched our first function. (Or first two counting `func_80A87800`) - -**N.B** Notice that we don't yet have much idea of what this code actually does: this should be clarified by going through the rest of the actor's functions, which is discussed in the next document. - -Next: [Other functions in the actor](other_functions.md) diff --git a/docs/tutorial/contents.md b/docs/tutorial/contents.md deleted file mode 100644 index c3279a437a..0000000000 --- a/docs/tutorial/contents.md +++ /dev/null @@ -1,62 +0,0 @@ -# Getting started - -## [Introduction to decomp](introduction.md) -- What we are doing -- Structure of the code - -## Pre-decompilation -- Building the repo (follow the instructions in the README.md) -- Most of us use VSCode. (You can watch Fig's video to get an idea of how this can be used). Some useful information is [here](../vscode.md). -- Choosing a first actor (You want something small that has simple interactions with the environment. But OoT is far enough in that there are basically no unreserved actors left anyway now.) - -## Decompilation - -- [Begining decompilation: order, Init and the actor struct](beginning_decomp.md) - - Order of decompilation - - Init and common actor features - - Initchains - - Actors and dynapoly actors - - Colliders - - Skelanime - - - Matching - - Using diff - - control flow (branches) -> instruction ordering -> register allocation -> stack - -- [The rest of the functions in the actor](other_functions.md) - - Order of decompilation - - Action Functions and other functions - - - More on matching: the permuter - -- [Draw functions](draw_functions.md) - -- [Data, migration and non-migration](data.md) - - Importing the data: early and late - - Fake symbols - - Inlining - -## [Object Decompilation](object_decomp.md) -- Object files -- How we decompile objects -- [Example](object_decomp_example.md) - - -## After Decompilation - -- [Preparing to merge](merging.md) - - Preliminary documentation - - Preparing to PR - - Pull Requests - - Trello - -## Appendices -- [Types, Structs and Padding](types_structs_padding.md) (a miscellany of useful stuff) -- [Helper scripts](helper_scripts.md) - -To be written, maybe - -- How we use git and GitHub -- Some notes on the basic structure of N64 MIPS -- Glossary -- Conventions diff --git a/docs/tutorial/data.md b/docs/tutorial/data.md deleted file mode 100644 index a96d26d84f..0000000000 --- a/docs/tutorial/data.md +++ /dev/null @@ -1,648 +0,0 @@ -# Data - -## Table of Contents - -- [Data first](#data-first) - * [Example: `EnTg`](#example-entg) -- [Extern and data last](#extern-and-data-last) -- [Fake symbols](#fake-symbols) -- [Inlining](#inlining) - -Each actor's data is stored in a separate file. EnJj's data is in `data/overlays/actors/z_en_jj.data.s`, for example. At some point in the decompilation process we need to convert this raw data into recognisable information for the C to use. - -There are two main ways to do this: either -1. import the data first and type it later, or -2. wait until the data appears in functions, extern it, then import it at the end - -Sometimes something between these two is appropriate: wait until the largest or strangest bits of data appear in functions, get some typing information out of that, and then import it, but for now, let's stick to both of these. - -Both approaches have their advantages and disadvantages. - -## Data first - - -This way is good for smaller actors with little data. It is not really suitable for EnJj, for example, because of the enormous section of data labelled as `D_80A88164`. - -### Example: `EnTg` - -We give a simple example of this approach with a small NPC actor, EnTg, that is, the spinning couple. - -The data file looks like - -
- -Large code block, click to show - - -``` -.include "macro.inc" - - # assembler directives - .set noat # allow manual use of $at - .set noreorder # don't insert nops after branches - .set gp=64 # allow use of 64-bit general purpose registers - -.section .data - -.balign 16 - -glabel D_80B18910 - .word 0x0A000039, 0x20010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00140040, 0x00000000, 0x00000000 -glabel D_80B1893C - .word 0x00000000, 0x00000000, 0xFF000000 -glabel En_Tg_InitVars - .word 0x01AC0400, 0x00000009, 0x01820000, 0x0000020C -.word EnTg_Init -.word EnTg_Destroy -.word EnTg_Update -.word EnTg_Draw -glabel D_80B18968 - .word 0x00000000, 0x44480000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - - -``` - -
- -We transfer this data into the actor file by pretending it is an array of words. The InitVars have already been processed and inserted into the C file, so just need to be uncommented. Data cannot change order, so the two pieces above the InitVars must stay there. At the end of this process, the top of the file will look like - -
- -Large code block, click to show - - -```C -/* - * File: z_en_tg.c - * Overlay: ovl_En_Tg - * Description: Honey & Darling - */ - -#include "z_en_tg.h" - -#define FLAGS 0x00000009 - -#define THIS ((EnTg*)thisx) - -void EnTg_Init(Actor* thisx, PlayState* play); -void EnTg_Destroy(Actor* thisx, PlayState* play); -void EnTg_Update(Actor* thisx, PlayState* play); -void EnTg_Draw(Actor* thisx, PlayState* play); - -s32 D_80B18910[] = { 0x0A000039, 0x20010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00140040, 0x00000000, 0x00000000 }; - -s32 D_80B1893C[] = { 0x00000000, 0x00000000, 0xFF000000 }; - -ActorInit En_Tg_InitVars = { - /**/ ACTOR_EN_TG, - /**/ ACTORTYPE_NPC, - /**/ FLAGS, - /**/ OBJECT_MU, - /**/ sizeof(EnTg), - /**/ EnTg_Init, - /**/ EnTg_Destroy, - /**/ EnTg_Update, - /**/ EnTg_Draw, -}; - -s32 D_80B18968[] = { 0x00000000, 0x44480000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }; - -extern UNK_TYPE D_06005040; -extern UNK_TYPE D_0600AE40; - -``` - -
- -Now, open the file called `spec` in the base directory, find the section corresponding to EnTg: -``` -beginseg - name "ovl_En_Tg" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tg/z_en_tg.o" - include "$(BUILD_DIR)/data/overlays/actors/z_en_tg.data.o" - include "$(BUILD_DIR)/data/overlays/actors/z_en_tg.reloc.o" -endseg -``` -and comment out the .data line, -``` -beginseg - name "ovl_En_Tg" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tg/z_en_tg.o" - //include "$(BUILD_DIR)/data/overlays/actors/z_en_tg.data.o" - include "$(BUILD_DIR)/data/overlays/actors/z_en_tg.reloc.o" -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`. - -Now carry out the usual steps to decompile `Init`. The usual cleanup and struct population gets us to -```C -void EnTg_Init(Actor *thisx, PlayState *play) { - EnTg *this = THIS; - - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 28.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &D_0600AE40, &D_06005040, 0, 0, 0); - Collider_InitCylinder(play, &this->collider); - Collider_SetCylinder(play, &this->collider, &this->actor, (ColliderCylinderInit *) D_80B18910); - func_80061EFC(&this->actor.colChkInfo, NULL, (CollisionCheckInfoInit2 *) D_80B1893C); - this->actor.unk_1F = 6; - Actor_SetScale(&this->actor, 0.01f); - this->actionFunc = func_80B185C0; - this->unk_208 = play->state.frames & 1; -} -``` -and it remains to deal with the data. mips2c has told us what the types should be. We run `colliderinit` on `D_80B18910` as usual, which gives -``` -$ ./tools/overlayhelpers/colliderinit.py 80B18910 ColliderCylinderInit -ovl_En_Tg: Rom 00ECE1F0:00ECE910 VRam 80B18360:80B18A80 Offset 0005B0 - -static ColliderCylinderInit sCylinderInit = -{ - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, - { 20, 64, 0, { 0, 0, 0 } }, -}; -``` - -Copy this in below `D_80B18910`, delete the original words of data, change the name back to `D_80B18910`, and put `sCylinderInit` commented out above it: -```C -// sCylinderInit -static ColliderCylinderInit D_80B18910 = -{ - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, - { 20, 64, 0, { 0, 0, 0 } }, -}; -``` - -For the `CollisionCheckInfoInit2`, we don't have a script to separate it, but you can look in other files to see that it should be separated as -```C -// sColChkInit -CollisionCheckInfoInit2 D_80B1893C = { 0, 0, 0, 0, 0xFF }; -``` - -One more thing needs to change: since both are no longer arrays, we need to make the uses in the functions pointers: -```C -Collider_SetCylinder(play, &this->collider, &this->actor, &D_80B18910); -func_80061EFC(&this->actor.colChkInfo, NULL, &D_80B1893C); -``` - -A quick check of the diff shows that we just need to put the action function set to last, and it matches. - -Following the function tree as usual, we find the only other place any data is used is in `func_80B1871C`. From its use in `EnTg_Draw`, we realise that this is a `PostLimbDraw` function. Giving mips2c the correct prototype, it comes out as -```C -void func_80B1871C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { - ? sp18; - - sp18.unk0 = (s32) D_80B18968->unk0; - sp18.unk4 = (s32) D_80B18968[1]; - sp18.unk8 = (s32) D_80B18968[2]; - if (limbIndex == 9) { - Matrix_MultVec3f((Vec3f *) &sp18, thisx + 0x38); - } -} -``` -which clearly doesn't like the words we fed it. We see that `sp18` should be a `Vec3f` from the cast in the `Matrix_MultVec3f`, so the last three words are padding (a `Vec3f` has size `0xC`, and it's not using it like an array), and we can convert it to -```C -Vec3f D_80B18968 = { 0.0f, 800.0f, 0.0f }; -``` -and the function matches as -```C -void func_80B1871C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { - EnTg* this = THIS; - - Vec3f sp18 = D_80B18968; - - if (limbIndex == 9) { - Matrix_MultVec3f(&sp18, &this->actor.world2.pos); - } -} -``` -(we can see from the assembly doing `lw` and `sw` rather than `lwc1` and `swc1` that it is doing a struct copy, rather than setting it componentwise). - - -## Extern and data last - -Externing is explained in detail in the document about the [Init function](beginning_decomp.md). To summarize, every time a `D_address` appears that is in the data file, we put a -```C -extern UNK_TYPE D_address; -``` -at the top of the file, in the same order that the data appears in the data file. We can also give it a type if we know what the type actually is (e.g. for colliders, initchains, etc.), and convert the actual data and place it commented-out under the corresponding line. This means we don't have to do everything at once at the end. - -Once we have decompiled enough things to know what the data is, we can import it. The advantage of doing it this way is we should know what type everything is already: in our work on EnJj, for example, we ended up with the following data at the top of the file -```C -extern UNK_TYPE D_80A88164; - -extern ColliderCylinderInit D_80A88CB4; -// static ColliderCylinderInit sCylinderInit = -// { -// { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, -// { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000004, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, -// { 170, 150, 0, { 0, 0, 0 } }, -// }; - -extern InitChainEntry D_80A88CE0[]; -// static InitChainEntry sInitChain[] = { -// ICHAIN_VEC3F_DIV1000(scale, 87, ICHAIN_CONTINUE), -// ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), -// ICHAIN_F32(uncullZoneScale, 3300, ICHAIN_CONTINUE), -// ICHAIN_F32(uncullZoneDownward, 1100, ICHAIN_STOP), -// }; - -extern Vec3f D_80A88CF0; -// static Vec3f D_80A88CF0 = { -1589.0f, 53.0f, -43.0f }; - -extern Gfx* D_80A88CFC[]; -// static Gfx* D_80A88CFC[] = { 0x06007698, 0x06007A98, 0x06007E98, } -``` -and the only thing we don't know about is the cutscene data `D_80A88164`. - -*Before doing anything else, make sure `make` gives `OK`.* - -First, we tell the compiler to ignore the original data file. To do this, open the file called `spec` in the main directory of the repository, and search for the actor name. You will find a section that looks like -``` -beginseg - name "ovl_En_Jj" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o" - include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.data.o" - include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.reloc.o" -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: -``` -beginseg - name "ovl_En_Jj" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o" - //include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.data.o" - include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.reloc.o" -endseg -``` - -Next remove all the externs, and uncomment their corresponding commented data: -```C -extern UNK_TYPE D_80A88164; - -static ColliderCylinderInit sCylinderInit = -{ - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000004, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, - { 170, 150, 0, { 0, 0, 0 } }, -}; - -static InitChainEntry sInitChain[] = { - ICHAIN_VEC3F_DIV1000(scale, 87, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneScale, 3300, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneDownward, 1100, ICHAIN_STOP), -}; - -static Vec3f D_80A88CF0 = { -1589.0f, 53.0f, -43.0f }; - -static Gfx* D_80A88CFC[] = { 0x06007698, 0x06007A98, 0x06007E98, } -``` -Find-and-replace `D_80A88CB4` and `D_80A88CE0` by `sCylinderInit` and `sInitChain` respectively. Notice the naming scheme: static data symbols always start with `s` in our style. (Unless they are inlined, but we'll worry about that later.) - -We still need to deal with the cutscene data. This is special: because it's so large, it goes in its own file. Make a new file called `z_en_jj_cutscene_data.c` in the same directory as `z_en_jj.c`. Include the actor's header file and `z64cutscene_commands.h`, and put `// clang-format off` and `// clang-format on` in the file (this is so that our formatting script doesn't wreak havoc with the formatting of the cutscene macros). Thus the contents of the file is currently - -```C -#include "z_en_jj.h" -#include "z64cutscene_commands.h" -// clang-format off - -// clang-format on -``` - -Finally, we have a script to convert the cutscene data into macros, namely `csdis.py` in the tools folder. We can just give it the VRAM address that the `D_address` is referring to, and it will output the cs macros: - -
- - (Very) long code block, click to view - - -``` -$ ./tools/csdis.py 80A88164 -ovl_En_Jj: Rom 00E3E3D0:00E3F9E0 VRam 80A87800:80A88E10 Offset 000964 - -static CutsceneData D_80A88164[] = { - CS_BEGIN_CUTSCENE(26, 1629), - CS_PLAYER_CUE_LIST(4), - CS_PLAYER_CUE(PLAYER_CUEID_5, 0, 240, 0x0000, 0x4000, 0x0000, -1732, 52, -44, -1732, 52, -44, 1.1393037197548209e-29f, 0.0f, 1.401298464324817e-45f), - CS_PLAYER_CUE(PLAYER_CUEID_3, 240, 255, 0x0000, 0x4000, 0x0000, -1732, 52, -44, -1732, 52, -44, 1.1393037197548209e-29f, 0.0f, 1.401298464324817e-45f), - CS_PLAYER_CUE(PLAYER_CUEID_6, 255, 285, 0x0000, 0x4000, 0x0000, -1732, 52, -44, -1732, 52, -44, 1.1393037197548209e-29f, 0.0f, 1.401298464324817e-45f), - CS_PLAYER_CUE(PLAYER_CUEID_32, 285, 300, 0x0000, 0xC000, 0x0000, -1732, 52, -44, -1537, 109, -44, 1.1393037197548209e-29f, 0.0f, 1.401298464324817e-45f), - CS_ACTOR_CUE_LIST(68, 4), - CS_ACTOR_CUE(0x0001, 0, 234, 0x0000, 0x4000, 0x0000, -1665, 52, -44, -1665, 52, -44, 1.1393037197548209e-29f, 0.0f, 1.401298464324817e-45f), - CS_ACTOR_CUE(0x0002, 234, 241, 0x41F8, 0x0000, 0x0000, -1665, 52, -44, -1603, 130, -47, 8.857142448425293f, 11.142857551574707f, -8.857142448425293f), - CS_ACTOR_CUE(0x0002, 241, 280, 0x4031, 0x0000, 0x0000, -1603, 130, -47, -549, 130, -52, 27.0256404876709f, 0.0f, -27.0256404876709f), - CS_ACTOR_CUE(0x0003, 280, 300, 0x0000, 0x0000, 0x0000, -549, 130, -52, -549, 130, -52, 0.0f, 0.0f, 0.0f), - CS_ACTOR_CUE_LIST(67, 5), - CS_ACTOR_CUE(0x0001, 0, 93, 0x0000, 0x0000, 0x0000, 0, 51, 124, 0, 51, 124, 0.0f, 0.0f, 0.0f), - CS_ACTOR_CUE(0x0003, 93, 121, 0x0000, 0x0000, 0x0000, 0, 51, 124, 0, 51, 124, 0.0f, 0.0f, 0.0f), - CS_ACTOR_CUE(0x0001, 121, 146, 0x0000, 0x0000, 0x0000, 0, 51, 124, 0, 51, 124, 0.0f, 0.0f, 0.0f), - CS_ACTOR_CUE(0x0002, 146, 241, 0x0000, 0x0000, 0x0000, 0, 51, 124, 0, 51, 124, 0.0f, 0.0f, 0.0f), - CS_ACTOR_CUE(0x0001, 241, 441, 0x0000, 0x0000, 0x0000, 0, 51, 124, 0, 51, 124, 0.0f, 0.0f, 0.0f), - CS_ACTOR_CUE_LIST(69, 3), - CS_ACTOR_CUE(0x0001, 0, 90, 0x0000, 0x0000, 0x0000, 0, -33, 9, 0, -33, 9, 0.0f, 0.0f, 0.0f), - CS_ACTOR_CUE(0x0002, 90, 330, 0x0000, 0x0000, 0x0000, 0, -33, 9, 0, -62, 22, 0.0f, -0.12083332985639572f, 0.0f), - CS_ACTOR_CUE(0x0003, 330, 380, 0x0000, 0x0000, 0x0000, 0, -62, 22, 0, -62, 22, 0.0f, 0.0f, 0.0f), - CS_MISC_LIST(1), - CS_MISC(0x000C, 1095, 1161, 0x0000, 0x00000000, 0xFFFFFFD2, 0x00000000, 0xFFFFFFD0, 0xFFFFFFD2, 0x00000000, 0xFFFFFFD0, 0x00000000, 0x00000000, 0x00000000), - CS_TRANSITION(0x0009, 0, 10), - CS_PLAYER_CUE_LIST(1), - CS_PLAYER_CUE(PLAYER_CUEID_53, 300, 1629, 0x0000, 0x0000, 0x0000, -1630, 52, -52, -1630, 52, -52, 0.0f, 0.0f, 0.0f), - CS_CAM_EYE_SPLINE(0, 1091), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1641, 95, -41, 0x015C), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1641, 95, -41, 0x016D), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1641, 95, -41, 0x017E), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1641, 95, -41, 0x0223), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 0, 45.39994430541992f, -1641, 95, -41, 0x7065), - CS_CAM_EYE_SPLINE(60, 1151), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1532, 251, 222, 0x015C), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1532, 251, 222, 0x016D), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1532, 251, 222, 0x017E), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1532, 251, 222, 0x0223), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 0, 45.39994430541992f, -1532, 251, 222, 0x7065), - CS_CAM_EYE_SPLINE(90, 351), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1698, 382, 455, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1698, 382, 455, 0xAC34), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1698, 382, 455, 0x4428), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1694, 380, 451, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 32.99989700317383f, -1694, 380, 451, 0xAC10), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 32.99989700317383f, -1694, 380, 451, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 32.99989700317383f, -1694, 380, 451, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 32.99989700317383f, -1694, 380, 451, 0x0164), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 0, 32.99989700317383f, -1694, 380, 451, 0xAD78), - CS_CAM_EYE_SPLINE(220, 392), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1641, 95, -41, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1641, 95, -41, 0xAC34), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1641, 95, -41, 0x4428), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1641, 95, -41, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1641, 95, -41, 0xAC10), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1641, 95, -41, 0x0000), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 0, 45.39994430541992f, -1641, 95, -41, 0x0000), - CS_CAM_EYE_SPLINE(240, 1331), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.599945068359375f, -1810, 65, -15, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.599945068359375f, -1810, 65, -15, 0xAC34), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.599945068359375f, -1810, 65, -15, 0x4428), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.599945068359375f, -1810, 65, -15, 0x0000), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 0, 45.599945068359375f, -1810, 65, -15, 0xAC10), - CS_CAM_EYE_SPLINE(280, 1371), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.599945068359375f, -1531, 95, -7, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.599945068359375f, -1531, 95, -7, 0xAC34), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.599945068359375f, -1531, 95, -7, 0x4428), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.599945068359375f, -1531, 95, -7, 0x0000), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 0, 45.599945068359375f, -1531, 95, -7, 0xAC10), - CS_CAM_EYE_SPLINE(310, 1421), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1717, 83, -59, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1717, 83, -59, 0xAC34), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1649, 177, -59, 0x4428), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1533, 224, -59, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -1243, 180, -59, 0xAC10), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -953, 71, -55, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -953, 71, -55, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 45.39994430541992f, -953, 71, -55, 0x0164), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 0, 45.39994430541992f, -953, 71, -55, 0xAD78), - CS_CAM_EYE_SPLINE(355, 1466), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 60.60000228881836f, -1830, 103, 18, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 60.60000228881836f, -1830, 103, 18, 0xAC34), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 60.60000228881836f, -1830, 103, 18, 0x4428), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 60.60000228881836f, -1830, 103, 18, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 60.60000228881836f, -1830, 103, 18, 0xAC10), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 0, 60.60000228881836f, -1830, 103, 18, 0x0000), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 0, 60.60000228881836f, -1830, 103, 18, 0x0000), - CS_CAM_AT_SPLINE(0, 1120), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.39994430541992f, -1724, -5, -45, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.39994430541992f, -1724, -5, -45, 0xAC34), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 1000, 45.39994430541992f, -1724, -5, -45, 0x4428), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.39994430541992f, -1724, -5, -45, 0x0000), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 30, 45.39994430541992f, -1724, -5, -45, 0xAC10), - CS_CAM_AT_SPLINE(60, 1180), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.39994430541992f, -1440, 241, 134, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.39994430541992f, -1440, 241, 134, 0xAC34), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 1000, 45.39994430541992f, -1440, 241, 134, 0x4428), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.39994430541992f, -1440, 241, 134, 0x0000), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 30, 45.39994430541992f, -1440, 241, 134, 0xAC10), - CS_CAM_AT_SPLINE(90, 380), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.39994430541992f, -1610, 348, 373, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.39994430541992f, -1610, 348, 373, 0xAC34), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 50, 45.39994430541992f, -1610, 348, 373, 0x4428), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 35.399906158447266f, -1614, 338, 367, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 32.99989700317383f, -1614, 338, 367, 0xAC10), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 32.99989700317383f, -1614, 338, 367, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 32.99989700317383f, -1614, 338, 367, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 32.99989700317383f, -1614, 338, 367, 0x0164), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 30, 32.99989700317383f, -1614, 338, 367, 0xAD78), - CS_CAM_AT_SPLINE(220, 421), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.39994430541992f, -1724, -5, -45, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 70, 45.39994430541992f, -1724, -5, -45, 0xAC34), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 5, 45.39994430541992f, -1724, -5, -45, 0x4428), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 6, 45.79994583129883f, -1593, 150, -146, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.39994430541992f, -1531, 152, -75, 0xAC10), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.39994430541992f, -1531, 152, -75, 0x0000), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 30, 45.39994430541992f, -1531, 152, -75, 0x0000), - CS_CAM_AT_SPLINE(240, 1360), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.599945068359375f, -1712, 74, -37, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.599945068359375f, -1712, 74, -37, 0xAC34), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 1000, 45.599945068359375f, -1712, 74, -37, 0x4428), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.599945068359375f, -1712, 74, -37, 0x0000), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 30, 45.599945068359375f, -1712, 74, -37, 0xAC10), - CS_CAM_AT_SPLINE(280, 1400), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.599945068359375f, -1619, 99, -50, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.599945068359375f, -1619, 99, -50, 0xAC34), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 1000, 45.599945068359375f, -1619, 99, -50, 0x4428), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.599945068359375f, -1619, 99, -50, 0x0000), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 30, 45.599945068359375f, -1619, 99, -50, 0xAC10), - CS_CAM_AT_SPLINE(310, 1450), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x0B, 30, 90.99960327148438f, -1610, 141, -59, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x09, 10, 90.79960632324219f, -1599, 114, -57, 0xAC34), - CS_CAM_POINT(CS_CAM_CONTINUE, 0xFC, 10, 90.39961242675781f, -1528, 192, -54, 0x4428), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 10, 90.599609375f, -1427, 164, -54, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0xCB, 10, 90.39961242675781f, -1138, 119, -37, 0xAC10), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x20, 10, 90.39961242675781f, -832, 50, -51, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 1000, 45.39994430541992f, -836, 35, -51, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 45.39994430541992f, -836, 35, -51, 0x0164), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 30, 45.39994430541992f, -836, 35, -51, 0xAD78), - CS_CAM_AT_SPLINE(355, 1495), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 60.60000228881836f, -1706, 111, -6, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 60.60000228881836f, -1706, 111, -6, 0xAC34), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 10, 60.60000228881836f, -1706, 111, -6, 0x4428), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 10, 60.60000228881836f, -1721, 82, -42, 0x0000), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 1000, 60.60000228881836f, -1721, 82, -42, 0xAC10), - CS_CAM_POINT(CS_CAM_CONTINUE, 0x00, 30, 60.60000228881836f, -1721, 82, -42, 0x0000), - CS_CAM_POINT(CS_CAM_STOP, 0x00, 30, 60.60000228881836f, -1721, 82, -42, 0x0000), - CS_TRANSITION(0x000B, 335, 342), - CS_DESTINATION(CS_DEST_JABU_JABU, 345, 395), - CS_ACTOR_CUE_LIST(62, 1), - CS_ACTOR_CUE(0x0001, 305, 494, 0x0000, 0x0000, 0x0000, -1399, 452, -53, -1399, 452, -53, 0.0f, 0.0f, 0.0f), - CS_END(), -}; -``` - -
- -Copy this into the file we just made (given the length, you may prefer to `>` it into a file and copy it from there, rather than the terminal itself). Save and close that file: we won't need it any more. - -To replace the `extern`, because the data is in a separate file, we include the file in a particular way: -```C -#include "z_en_jj_cutscene_data.c" EARLY -``` -(`EARLY` is required specifically for cutscene data. See [the definition of the CutsceneData struct](../include/z64cutscene.h) for exactly why.) - -Lastly, uncomment the InitVars block that's been sitting there the whole time. The data section of the file now looks like -```C -ActorInit En_Jj_InitVars = { - /**/ ACTOR_EN_JJ, - /**/ ACTORTYPE_ITEMACTION, - /**/ FLAGS, - /**/ OBJECT_JJ, - /**/ sizeof(EnJj), - /**/ EnJj_Init, - /**/ EnJj_Destroy, - /**/ EnJj_Update, - /**/ EnJj_Draw, -}; - -#include "en_jj_cutscene_data.c" EARLY - -static ColliderCylinderInit sCylinderInit = -{ - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000004, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, - { 170, 150, 0, { 0, 0, 0 } }, -}; - -static InitChainEntry sInitChain[] = { - ICHAIN_VEC3F_DIV1000(scale, 87, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneScale, 3300, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneDownward, 1100, ICHAIN_STOP), -}; - -static Vec3f D_80A88CF0 = { -1589.0f, 53.0f, -43.0f }; - -static Gfx* D_80A88CFC[] = { 0x06007698, 0x06007A98, 0x06007E98, }; -``` - -That should be everything, and we should now be able to `make` without the data file with no issues - -But running `make`, we get the dreaded Error 1: - -``` -md5sum: WARNING: 1 computed checksum did NOT match -make: *** [Makefile:172: all] Error 1 -``` - -Oh no! What went wrong? - -To find out what went wrong, we need to use `firstdiff.py`. This tells us where our ROM starts to differ: -``` -$ ./firstdiff.py -First difference at ROM addr 0x144F4, gDmaDataTable (RAM 0x80016DA0, ROM 0x12F70, build/asm/dmadata.o) -Bytes: 00:E3:F9:D0 vs 00:E3:F9:E0 -Instruction difference at ROM addr 0xE3ED48, En_Jj_InitVars (RAM 0x80A88140, ROM 0xE3ED10, build/src/overlays/actors/ovl_En_Jj/z_en_jj.o) -Bytes: 40:00:00:00 vs 00:F0:00:00 -Instruction difference at ROM addr 0xE3F900, D_80A88D40 (RAM 0x80A88D30, ROM 0xE3F900, build/data/overlays/actors/z_en_jj.reloc.o) -Bytes: 00:00:09:40 vs C4:89:80:00 -Instruction difference at ROM addr 0xE3F9D4, En_Js_SetupAction (RAM 0x80A88E00, ROM 0xE3F9D0, build/src/overlays/actors/ovl_En_Js/z_en_js.o) -Bytes: AC:85:02:8C vs 00:00:00:00 -Instruction difference at ROM addr 0xE3F9D8, EnJs_Init (RAM 0x80A88E08, ROM 0xE3F9D8, build/src/overlays/actors/ovl_En_Js/z_en_js.o) -Bytes: 27:BD:FF:B0 vs 00:00:00:00 -Instruction difference at ROM addr 0xE3FAFC, EnJs_Destroy (RAM 0x80A88F2C, ROM 0xE3FAFC, build/src/overlays/actors/ovl_En_Js/z_en_js.o) -Bytes: 27:BD:FF:E8 vs 8F:B0:00:34 - -Over 1000 differing words, must be a shifted ROM. -Map appears to have shifted just before D_80A88D40 (build/data/overlays/actors/z_en_jj.reloc.o) -- in En_Jj_InitVars? -``` - -Ignore the first line: `gDmaDataTable` is always different if the ROM is shifted. The useful lines are usually the next line, and the guess it makes at the end. - -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 baseroms/gc-eu-mq-dbg/baserom-decompressed.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: - -![vbindiff for data](images/vbindiff_data_1.png) - -Notice that the numbers in the bottom pane is all shifted one word to the left. We therefore need some extra padding somewhere. The real issue is where. Thankfully the guess at the bottom gives us a hint: let's try just under `InitVars`. Just put a padding variable straight after them: - -```C -ActorInit En_Jj_InitVars = { - /**/ ACTOR_EN_JJ, - /**/ ACTORTYPE_ITEMACTION, - /**/ FLAGS, - /**/ OBJECT_JJ, - /**/ sizeof(EnJj), - /**/ EnJj_Init, - /**/ EnJj_Destroy, - /**/ EnJj_Update, - /**/ EnJj_Draw, -}; - -s32 usused = 0; - -#include "z_en_jj_cutscene_data.c" EARLY -``` - -This isn't good enough: we still get Error 1, but: -``` -$ ./first_diff.py -First difference at ROM addr 0x144F4, gDmaDataTable (RAM 0x80016DA0, ROM 0x12F70, build/asm/dmadata.o) -Bytes: 00:E3:F9:D0 vs 00:E3:F9:E0 -Instruction difference at ROM addr 0xE3F87C, unused (RAM 0x80A88160, ROM 0xE3ED30, build/src/overlays/actors/ovl_En_Jj/z_en_jj.o) -Bytes: 0A:00:09:39 vs 00:00:00:00 -Instruction difference at ROM addr 0xE3F900, D_80A88D40 (RAM 0x80A88D30, ROM 0xE3F900, build/data/overlays/actors/z_en_jj.reloc.o) -Bytes: 00:00:09:40 vs C4:89:80:00 -Instruction difference at ROM addr 0xE3F9D4, En_Js_SetupAction (RAM 0x80A88E00, ROM 0xE3F9D0, build/src/overlays/actors/ovl_En_Js/z_en_js.o) -Bytes: AC:85:02:8C vs 00:00:00:00 -Instruction difference at ROM addr 0xE3F9D8, EnJs_Init (RAM 0x80A88E08, ROM 0xE3F9D8, build/src/overlays/actors/ovl_En_Js/z_en_js.o) -Bytes: 27:BD:FF:B0 vs 00:00:00:00 -Instruction difference at ROM addr 0xE3FAFC, EnJs_Destroy (RAM 0x80A88F2C, ROM 0xE3FAFC, build/src/overlays/actors/ovl_En_Js/z_en_js.o) -Bytes: 27:BD:FF:E8 vs 8F:B0:00:34 - -Over 1000 differing words, must be a shifted ROM. -Map appears to have shifted just before D_80A88D40 (build/data/overlays/actors/z_en_jj.reloc.o) -- in unused? -(Base map file expected/build/z64.map out of date due to new or renamed symbols, so result may be imprecise.) -``` -We've managed to get rid of one issue, but there's still another one. Looking in vbindiff again, - -![vbindiff data 2](images/vbindiff_data_2.png) - -we see that everything is shifted left by 2 words. Guessing based on the hint from `first_diff`, we put two words after the cutscene include: -```C -#include "z_en_jj_cutscene_data.c" EARLY - -s32 usused2[] = { 0, 0 }; - -static ColliderCylinderInit sCylinderInit = -{ - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000004, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, - { 170, 150, 0, { 0, 0, 0 } }, -}; -``` - -Running `make -j` again, -``` -oot-gc-eu-mq-dbg.z64: OK -``` - -Hooray, we won! - - -## Fake symbols - -Some symbols in the data have been decompiled wrongly, being incorrectly separated from the previous symbol due to how it was accessed by the actor's functions. However, most of these have now been fixed. Some more detail is given in [Types, structs and padding](types_structs_padding.md) If you are unsure, ask! - - -## Inlining - -After the file is finished, it is possible to move some static data into functions. This requires that: -1. The data is used in only one function -2. The ordering of the data can be maintained - -Additionally, we prefer to keep larger data (more than a line or two) out of functions anyway. - - -# Finally: .bss - -A .bss contains data that is uninitialised (actually initialised to `0`). For most actors all you need to do is declare it at the top of the actor file without giving it a value, once you find out what type it is. diff --git a/docs/tutorial/draw_functions.md b/docs/tutorial/draw_functions.md deleted file mode 100644 index 6724b42817..0000000000 --- a/docs/tutorial/draw_functions.md +++ /dev/null @@ -1,476 +0,0 @@ -# Draw functions - -Up: [Contents](contents.md) -Previous: [The rest of the functions in the actor](other_functions.md) - -Draw functions behave completely differently from the other functions in an actor. They often use a lot of macros. - -For this tutorial we will first look at the `EnJj` draw function, `EnJj_Draw`, then some more complicated examples. - -## A first example - -Unless it is completely invisible, an actor usually has a draw function as one of the main four actor functions. Hence its prototype looks like - -```C -EnJj_Draw(Actor* thisx, PlayState* play); -``` - -As in Init, Destroy and Update, it is much more convenient to feed mips2c the fake prototype - -```C -EnJj_Draw(EnJj* this, PlayState* play); -``` - -so that it fills out the struct fields from the actuar actor; we then put a - -```C -EnJj* this = THIS; -``` - -in the declarations as before. From now on, the process is rather different from the decompilation process used for the other functions. Here is the output of mips2c after sorting out the actor struct from Init, and with the arguments set back to `Actor* thisx`: -```C -void EnJj_Draw(Actor *thisx, PlayState *play) { - EnJj* this = THIS; - - GraphicsContext *sp4C; - Gfx *sp3C; - EnJj *sp18; - Gfx *temp_v1; - GraphicsContext *temp_a1; - s32 temp_a0; - - temp_a1 = play->state.gfxCtx; - sp4C = temp_a1; - Graph_OpenDisps(&sp3C, temp_a1, (const char *) "../z_en_jj.c", 0x36F); - Gfx_SetupDL_37Opa(play->state.gfxCtx); - Matrix_Translate(0.0f, (cosf(this->skelAnime.curFrame * 0.076624215f) * 10.0f) - 10.0f, 0.0f, (u8)1U); - Matrix_Scale(10.0f, 10.0f, 10.0f, (u8)1U); - temp_v1 = temp_a1->polyOpa.p; - temp_a1->polyOpa.p = temp_v1 + 8; - temp_v1->words.w0 = 0xDB060020; - temp_a0 = *(&D_80A88CFC + (this->unk_30E * 4)); - temp_v1->words.w1 = (temp_a0 & 0xFFFFFF) + gSegments[(u32) (temp_a0 * 0x10) >> 0x1C] + 0x80000000; - sp18 = this; - SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, (s32) this->skelAnime.dListCount, 0, 0); - Graph_CloseDisps(&sp3C, play->state.gfxCtx, (const char *) "../z_en_jj.c", 0x382); -} -``` - -Notable features are the Open and Close Disps functions, and blocks of the form - -```C -temp_v1 = temp_a1->polyOpa.p; -temp_a1->polyOpa.p = temp_v1 + 8; -temp_v1->words.w0 = 0xDB060020; -temp_a0 = *(&D_80A88CFC + (this->unk_30E * 4)); -temp_v1->words.w1 = (temp_a0 & 0xFFFFFF) + gSegments[(u32) (temp_a0 * 0x10) >> 0x1C] + 0x80000000; -``` - -(This is a particularly simple example, since there's only one of these blocks. We will give a more involved example later.) - -Each of these blocks converts into a graphics macro. They are usually (but not always) straightforward, but manually converting them is a pain, and there are sometimes special cases. To deal with them easily, we will use a tool from glank's N64 tools. To install these, follow the instructions [here](https://practicerom.com/public/packages/debian/howto.txt). - -For our purposes, we only need one of the programs this provides: `gfxdis.f3dex2`. - - -Graphics are actually 64-bit on the Nintendo 64. This code block is a result of instructions telling the processor what to do with the graphics pointer. There are two types of graphics pointer, -- polyOpa for solid textures -- polyXlu for translucent textures - -Our example is polyOpa, not surprisingly since Jabu is solid. - -`words.w0` and `words.w1` contain the actual graphics instruction, in hex format. Usually, `w0` is constant and `w1` contains the arguments. To find out what sort of macro we are dealing with, we use `gfxdis.f3dex2`. `w1` is variable, but we need to give the program a constant placeholder. A common word to use is 12345678, so in this case we run -``` -gfxdis.f3dex2 -x -g "POLY_OPA_DISP++" -d DB06002012345678 -``` - -- `-x` uses hex instead of the default qu macros (never mind what those are, OoT doesn't have them) -- `-g` is used to specify which graphics pointer macro to use -- `-d` is for the graphics dword - -Our standard now is to use decimal colors. If you have a constant second argument rather than a variable one, you can also use `-dc` to get decimal colors instead of the default hex. - -The output looks like -``` -gSPSegment(POLY_OPA_DISP++, 0x08, 0x12345678); -``` - -We can now replace the `0x12345678` by the actual second word. Or we could, if we had worked out what it was. - -Firstly, `*(&D_80A88CFC + (this->unk_30E * 4))` is referring to a piece of data we haven't externed yet. It looks like -``` -glabel D_80A88CFC -.word 0x06007698, 0x06007A98, 0x06007E98, 0x00000000, 0x00000000 -``` - -The first three words look like pointers to assets in the actor segment, which would make sense if we're looking for textures to draw. The last two words are 0, which is strange. A check in the rest of the actor file shows that `unk_30E` only takes the values `0,1,2`. We conclude that the last two words are just padding, and can be removed. Because this data is used in a graphics macro, it will be either a displaylist or a texture. We therefore set it up to be an array of unknown pointers for now: -```C -extern UNK_PTR D_80A88CFC[]; -// static Gfx* D_80A88CFC[] = { 0x06007698, 0x06007A98, 0x06007E98, } -``` - -It goes through further processing before it is used in the macro: `(temp_a0 & 0xFFFFFF) + gSegments[(u32) (temp_a0 * 0x10) >> 0x1C] + 0x80000000` is a conversion of a segmented address into a VRAM address. We have a macro for this too: `SEGMENTED_TO_VIRTUAL`. So after all this, the second word is -```C -SEGMENTED_TO_VIRTUAL(D_80A88CFC[this->unk_30E]); -``` -and the whole macro is -```C -gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80A88CFC[this->unk_30E])); -``` -The contents of a desegmentation macro used like this are almost always textures in this context, so we can replace `UNK_PTR` by `u64*`, the type for textures. - -You repeat this for every block in the function. - -We also have macros for Graph_OpenDisps and Graph_CloseDisps: you can replace -```C -Graph_OpenDisps(&sp3C, temp_a1, (const char *) "../z_en_jj.c", 0x36F); -``` -by -```C -OPEN_DISPS(temp_a1, "../z_en_jj.c", 879); -``` -(the last argument is a line number, so should be in decimal). - -The function may or may not use a temp for `play->state.gfxCtx`: you have to work it out using the diff. - -Once you've replaced all the blocks and the open and close with macros, you proceed with the function as usual. - -Two last things: the last argument of the matrix functions tells the compiler whether to use the previously stored matrix or not, so we have the enums `MTXMODE_NEW` and `MTXMODE_APPLY` for these. And the rather weird-looking float `0.076624215f` is, of all things, `(M_PI/41.0f)` (try Wolfram Alpha for these things, and if that doesn't produce anything sensible, ask in Discord). - -(The actual reason is probably that the animation is 41 frames long, but you won't necessarily spot this sort of thing for most floats) - -After all that, it turns out that -```C -void EnJj_Draw(Actor *thisx, PlayState *play) { - EnJj *this = THIS; - - OPEN_DISPS(play->state.gfxCtx, "../z_en_jj.c", 879); - Gfx_SetupDL_37Opa(play->state.gfxCtx); - Matrix_Translate(0.0f, (cosf(this->skelAnime.curFrame * (M_PI/41.0f)) * 10.0f) - 10.0f, 0.0f, 1); - Matrix_Scale(10.0f, 10.0f, 10.0f, 1); - gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80A88CFC[this->unk_30E])); - SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, - this->skelAnime.dListCount, 0, 0, this); - CLOSE_DISPS(play->state.gfxCtx, "../z_en_jj.c", 898); -} -``` - -matches apart from a couple of stack differences. This can be resolved by giving it `PlayState* play = play2;` at the top of the function and changing the second argument to `play2` as usual. - -We have enums for the last argument of the matrix functions: `0` is `MTXMODE_NEW`, `1` is `MTXMODE_APPLY`. - -Lastly, the penultimate and antepenultimate arguments of `SkelAnime_DrawFlexOpa` are actually pointers to functions, so they should be `NULL` instead of `0`. - - -## More examples: OverrideLimbDraw and PostLimbDraw - -For more examples of graphics macros and the structure of Draw functions, we look at a function from `EnDntNormal`, which is some Deku Scrubs used in the minigame stuff in Lost Woods. This has a good selection of macros, and two functions that are commonly combined with Draw, namely OverrideLimbDraw and PostLimbDraw. - -The mips2c output for - -```C -void func_809F5A6C(Actor *thisx, PlayState *play) { - ? sp60; - Gfx *sp48; - Gfx *sp38; - Actor *sp14; - Gfx *temp_v0; - Gfx *temp_v0_2; - Gfx *temp_v0_3; - Gfx *temp_v0_4; - Gfx *temp_v0_5; - GraphicsContext *temp_a1; - GraphicsContext *temp_s0; - s32 temp_a0; - void *temp_v1; - - sp60.unk0 = (s32) D_809F5E94.unk0; - sp60.unk4 = (s32) D_809F5E94.unk4; - sp60.unk8 = (s32) D_809F5E94.unk8; - temp_a1 = play->state.gfxCtx; - temp_s0 = temp_a1; - Graph_OpenDisps(&sp48, temp_a1, (const char *) "../z_en_dnt_nomal.c", 0x6FE); - Gfx_SetupDL_25Opa(play->state.gfxCtx); - temp_v0 = temp_s0->polyOpa.p; - temp_s0->polyOpa.p = temp_v0 + 8; - temp_v0->words.w0 = 0xDB060020; - temp_a0 = *(&D_809F5EA0 + (thisx->unk268 * 4)); - temp_v0->words.w1 = (temp_a0 & 0xFFFFFF) + gSegments[(u32) (temp_a0 * 0x10) >> 0x1C] + 0x80000000; - sp14 = thisx; - SkelAnime_DrawOpa(play, thisx->unk150, thisx->unk16C, &func_809F58E4, &func_809F59E4); - Matrix_Translate(thisx->unk21C, thisx->unk220, (bitwise f32) thisx->unk224, (u8)0U); - Matrix_Scale(0.01f, 0.01f, 0.01f, (u8)1U); - temp_v0_2 = temp_s0->polyOpa.p; - temp_s0->polyOpa.p = temp_v0_2 + 8; - temp_v0_2->words.w0 = 0xE7000000; - temp_v0_2->words.w1 = 0; - temp_v0_3 = temp_s0->polyOpa.p; - temp_s0->polyOpa.p = temp_v0_3 + 8; - temp_v0_3->words.w0 = 0xFB000000; - temp_v1 = (thisx->unk26A * 4) + &D_809F5E4C; - temp_v0_3->words.w1 = (temp_v1->unk-2 << 8) | (temp_v1->unk-4 << 0x18) | (temp_v1->unk-3 << 0x10) | 0xFF; - temp_v0_4 = temp_s0->polyOpa.p; - temp_s0->polyOpa.p = temp_v0_4 + 8; - temp_v0_4->words.w0 = 0xDA380003; - sp38 = temp_v0_4; - sp38->words.w1 = Matrix_NewMtx(play->state.gfxCtx, (char *) "../z_en_dnt_nomal.c", 0x716); - temp_v0_5 = temp_s0->polyOpa.p; - temp_s0->polyOpa.p = temp_v0_5 + 8; - temp_v0_5->words.w1 = (u32) &D_06001B00; - temp_v0_5->words.w0 = 0xDE000000; - Graph_CloseDisps(&sp48, play->state.gfxCtx, (const char *) "../z_en_dnt_nomal.c", 0x719); - if (&func_809F49A4 == thisx->unk214) { - func_80033C30((Vec3f *) &thisx->world, (Vec3f *) &sp60, (u8)0xFFU, play); - } -} -``` - -### Graphics macros - -There are 5 graphics macro blocks here: -```C -temp_v0 = temp_s0->polyOpa.p; -temp_s0->polyOpa.p = temp_v0 + 8; -temp_v0->words.w0 = 0xDB060020; -temp_a0 = *(&D_809F5EA0 + (thisx->unk268 * 4)); -temp_v0->words.w1 = (temp_a0 & 0xFFFFFF) + gSegments[(u32) (temp_a0 * 0x10) >> 0x1C] + 0x80000000; -``` - -We've seen one of these before: gfxdis gives -```C -$ gfxdis.f3dex2 -g "POLY_OPA_DISP++" -d DB06002012345678 -gSPSegment(POLY_OPA_DISP++, 0x08, 0x12345678); -``` -and looking at the data shows -``` -glabel D_809F5EA0 - .word 0x060027D0, 0x060025D0, 0x06002750, 0x00000000 -``` -which is an array of pointers to something again. It is used inside a `SEGMENTED_TO_VIRTUAL`, so they are most likely textures, and this block becomes -```C -gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_809F5EA0[this->unk_268])); -``` - -Next, -```C -temp_v0_2 = temp_s0->polyOpa.p; -temp_s0->polyOpa.p = temp_v0_2 + 8; -temp_v0_2->words.w0 = 0xE7000000; -temp_v0_2->words.w1 = 0; -``` -which we can find immediately using -``` -$ gfxdis.f3dex2 -g "POLY_OPA_DISP++" -d E700000000000000 -gDPPipeSync(POLY_OPA_DISP++); -``` - -Third, -```C -temp_v0_3 = temp_s0->polyOpa.p; -temp_s0->polyOpa.p = temp_v0_3 + 8; -temp_v0_3->words.w0 = 0xFB000000; -temp_v1 = (thisx->unk26A * 4) + &D_809F5E4C; -temp_v0_3->words.w1 = (temp_v1->unk-2 << 8) | (temp_v1->unk-4 << 0x18) | (temp_v1->unk-3 << 0x10) | 0xFF; -``` -this looks more troublesome. We find -``` -$ gfxdis.f3dex2 -g "POLY_OPA_DISP++" -d FB00000012345678 -gDPSetEnvColor(POLY_OPA_DISP++, 0x12, 0x34, 0x56, 0x78); -``` - -Now we need to work out what the last four arguments are. Two things are going on here: `D_809F5E4C` is an array of something: -``` -glabel D_809F5E4C - .word 0xFFFFFFFF, 0xFFC3AFFF, 0xD2FF00FF, 0xFFFFFFFF, 0xD2FF00FF, 0xFFC3AFFF, 0xFFFFFFFF, 0xFFC3AFFF, 0xD2FF00FF -``` -Worse, this is being accessed with pointer subtraction in the second word. `temp_v1 = (thisx->unk26A * 4) + &D_809F5E4C;` tells us that the array has elements of size 4 bytes, and the graphics macro implies the elements are colors. Colors of size 4 bytes are `Color_RGBA8`. Usually, we write colors in decimal, so `D_809F5E4C` becomes -```C -static Color_RGBA8 D_809F5E4C[] = { - { 255, 255, 255, 255 }, { 255, 195, 175, 255 }, { 210, 255, 0, 255 }, - { 255, 255, 255, 255 }, { 210, 255, 0, 255 }, { 255, 195, 175, 255 }, - { 255, 255, 255, 255 }, { 255, 195, 175, 255 }, { 210, 255, 0, 255 }, -}; -``` - -Now, we have two things to worry about: how to implement the negative pointer access, and how the second word is built. Negative accesses can be done by just subtracting 1, so that -```C -temp_v1 = D_809F5E4C[this->unk_26A - 1]; -``` -and then -```C -temp_v0_3->words.w1 = (temp_v1->unk2 << 8) | (temp_v1->unk0 << 0x18) | (temp_v1->unk3 << 0x10) | 0xFF; -``` -or rather, since it is a `Color_RGB8`, -```C -temp_v0_3->words.w1 = (temp_v1.b << 8) | (temp_v1.r << 0x18) | (temp_v1.g << 0x10) | 0xFF; -``` - -The last thing to worry about is how to put this word into the macro. Let's think about what the word actually is in a concrete case; it is easiest to see what is going on in hex, so suppose we are in the case -```C -temp_v1 = { 0xFF, 0xC3, 0xAF, 0xFF }; -``` - -Then the calculation is -``` -(0xAF << 8) | (0xFF << 0x18) | (0xC3 << 0x10) | 0xFF = 0xAF00 | 0xC30000 | 0xFF0000000 | 0xFF = 0xFFC3AFFF -``` -and so all this calculation is doing is turning `temp_v1` back into a word, with the last byte replaced by `0xFF` (that all the elements of `D_809F5E4C` have `0xFF` as their last element anyway is irrelevant here). Looking back at the output of gfxdis, we see that this actually means that the r,g,b just slot into the penultimate three arguments, the last being `0xFF`, leaving -```C -temp_v1 = D_809F5E4C[this->unk_26A - 1]; -gDPSetEnvColor(POLY_OPA_DISP++, temp_v1.r, temp_v1.g, temp_v1.b, 0xFF); -``` -as the residue of this block; it may turn out later that we can eliminate the temp. - - -The last two are much easier: -```C -temp_v0_4 = temp_s0->polyOpa.p; -temp_s0->polyOpa.p = temp_v0_4 + 8; -temp_v0_4->words.w0 = 0xDA380003; -sp38 = temp_v0_4; -sp38->words.w1 = Matrix_NewMtx(play->state.gfxCtx, (char *) "../z_en_dnt_nomal.c", 0x716); -``` -The macro is -``` -$ gfxdis.f3dex2 -g "POLY_OPA_DISP++" -d DA38000312345678 -gSPMatrix(POLY_OPA_DISP++, 0x12345678, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); -``` -and the second argument is filled by the `Matrix_NewMtx` function: -```C -gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_dnt_nomal.c", 1814), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); -``` - -Lastly, -```C -temp_v0_5 = temp_s0->polyOpa.p; -temp_s0->polyOpa.p = temp_v0_5 + 8; -temp_v0_5->words.w1 = (u32) &D_06001B00; -temp_v0_5->words.w0 = 0xDE000000; -``` -The macro is -``` -$ gfxdis.f3dex2 -g "POLY_OPA_DISP++" -d DE00000012345678 -gSPDisplayList(POLY_OPA_DISP++, 0x12345678); -``` -and so `D_06001B00` is a displaylist, so the type in the externed data at the top of the file can be changed to `Gfx D_06001B00[]`. Arrays act like pointers, so we don't need the `&` in the macro: -```C -gSPDisplayList(POLY_OPA_DISP++, D_06001B00); -``` - -Putting this all together -```C -void func_809F5A6C(Actor *thisx, PlayState *play) { - EnDntNormal *this = THIS; - ? sp60; - Actor *sp14; - Color_RGBA8 temp_v1; - - sp60.unk0 = (s32) D_809F5E94.unk0; - sp60.unk4 = (s32) D_809F5E94.unk4; - sp60.unk8 = (s32) D_809F5E94.unk8; - - OPEN_DISPS(play->state.gfxCtx, "../z_en_dnt_nomal.c", 1790); - Gfx_SetupDL_25Opa(play->state.gfxCtx); - - gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_809F5EA0[this->unk_268])); - - sp14 = this; - SkelAnime_DrawOpa(play, thisx->unk150, thisx->unk16C, &func_809F58E4, &func_809F59E4); - Matrix_Translate(thisx->unk21C, thisx->unk220, (bitwise f32) thisx->unk224, (u8)0U); - Matrix_Scale(0.01f, 0.01f, 0.01f, (u8)1U); - - gDPPipeSync(POLY_OPA_DISP++); - temp_v1 = D_809F5E4C[this->unk_26A - 1]; - gDPSetEnvColor(POLY_OPA_DISP++, temp_v1.r, temp_v1.g, temp_v1.r, 0xFF); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_dnt_nomal.c", 1814), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06001B00); - - CLOSE_DISPS(play->state.gfxCtx, "../z_en_dnt_nomal.c", 1817); - - if (&func_809F49A4 == this->unk214) { - func_80033C30((Vec3f *) &this.actor->world, (Vec3f *) &sp60, (u8)0xFFU, play); - } -} -``` - -### SkelAnime_Draw and the LimbDraws - -Some more general tidying up can be done here (`sp60` and so `D_809F5E94` are `Vec3f`, for example, and under normal circumstances we'd know that ), but the big remaining issue is -```C -sp14 = this; -SkelAnime_DrawOpa(play, thisx->unk150, thisx->unk16C, func_809F58E4, func_809F59E4); -``` -If we look at the definition of `SkelAnime_DrawOpa`, we find that it's missing the last argument. This is mips2c not noticing why `this` has been put on the stack: this code should actually be -```C -SkelAnime_DrawOpa(play, thisx->unk150, thisx->unk16C, func_809F58E4, func_809F59E4, this); -``` -mips2c doing this is not especially unusual, so bear it in mind. - -The other thing this tells us is that `func_809F58E4` is of type `OverrideLimbDraw`, and `func_809F59E4` of type `PostLimbDraw`. Their names are fairly self-explanatory. Filling in the prototypes as -```C -s32 func_809F58E4(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx); -void func_809F59E4(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx); -``` -and running mips2c gives - -```C -s32 func_809F58E4(PlayState *play, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, void *thisx) { - GraphicsContext *sp38; - Gfx *sp28; - Gfx *temp_v1; - Gfx *temp_v1_2; - GraphicsContext *temp_a1; - void *temp_v0; - - if ((limbIndex == 1) || (limbIndex == 3) || (limbIndex == 4) || (limbIndex == 5) || (limbIndex == 6)) { - temp_a1 = play->state.gfxCtx; - sp38 = temp_a1; - Graph_OpenDisps(&sp28, temp_a1, (const char *) "../z_en_dnt_nomal.c", 0x6C5); - temp_v1 = sp38->polyOpa.p; - sp38->polyOpa.p = temp_v1 + 8; - temp_v1->words.w1 = 0; - temp_v1->words.w0 = 0xE7000000; - temp_v1_2 = sp38->polyOpa.p; - sp38->polyOpa.p = temp_v1_2 + 8; - temp_v1_2->words.w0 = 0xFB000000; - temp_v0 = (thisx->unk26A * 4) + &D_809F5E4C; - temp_v1_2->words.w1 = (temp_v0->unk-2 << 8) | (temp_v0->unk-4 << 0x18) | (temp_v0->unk-3 << 0x10) | 0xFF; - Graph_CloseDisps(&sp28, play->state.gfxCtx, (const char *) "../z_en_dnt_nomal.c", 0x6CF); - } - return 0; -} - -void func_809F59E4(PlayState *play, s32 limbIndex, Gfx **dList, Vec3s *rot, void *thisx) { - ? sp18; - - sp18.unk0 = (s32) D_809F5E88.unk0; - sp18.unk4 = (s32) D_809F5E88.unk4; - sp18.unk8 = (s32) D_809F5E88.unk8; - if (thisx->unk26A == 0) { - if (limbIndex == 5) { - Matrix_MultVec3f((Vec3f *) &sp18, thisx + 0x27C); - return; - } - } else if (limbIndex == 7) { - Matrix_MultVec3f((Vec3f *) &sp18, thisx + 0x27C); - } -} -``` - -This structure is pretty typical: both edit what certain limbs do. Both also usually need a `ActorName *this = THIS;` at the top. We have seen both of the macros in the former before: applying the usual procedure, we find that it becomes -```C -s32 func_809F58E4(PlayState *play, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, void *thisx) { - EnDntNormal *this = THIS; - - if ((limbIndex == 1) || (limbIndex == 3) || (limbIndex == 4) || (limbIndex == 5) || (limbIndex == 6)) { - OPEN_DISPS(play->state.gfxCtx, "../z_en_dnt_nomal.c", 1733); - gDPPipeSync(POLY_OPA_DISP++); - gDPSetEnvColor(POLY_OPA_DISP++, D_809F5E4C[this->type - 1].r, D_809F5E4C[this->type - 1].g, D_809F5E4C[this->type - 1].b, 255); - CLOSE_DISPS(play->state.gfxCtx, "../z_en_dnt_nomal.c", 1743); - } - return 0; -} -``` -Notice that this function returns `0`. OverrideLimbDraw almost always returns `0`. - -The latter function is easier, and it is probably unnecessary to explain to the reader what it is necessary to do to it to clean it up. diff --git a/docs/tutorial/helper_scripts.md b/docs/tutorial/helper_scripts.md deleted file mode 100644 index 74c580904a..0000000000 --- a/docs/tutorial/helper_scripts.md +++ /dev/null @@ -1,202 +0,0 @@ -# List of helper scripts - -This list gives brief information on the most common usage cases. For more information, first try using `-h` or `--help` as an argument, and failing that, ask in #oot-decomp-help or #tools-other in the Discord. - -Many tools require activating a Python virtual environment that contains Python -dependencies. This virtual environment is automatically installed into the -`.venv` directory by `make setup`, but you need to **activate** it in your -current terminal session in order to run Python tools. To start using the -virtual environment in your current terminal run: - -```bash -source .venv/bin/activate -``` - -Keep in mind that for each new terminal session, you will need to activate the -Python virtual environment again. That is, run the above `source .venv/bin/activate` command. - -To deactivate the virtual environment, run - -```bash -deactivate -``` - -and your terminal session state will be restored to what it was before. - -## m2ctx - -This generates the context for mips2c to use to type objects in its output. It lives in the tools directory. Running -```sh -./tools/m2ctx.py -``` -will produce a file in the root directory called `ctx.c`. You open this file and copy it into the mips2c context box. - -The rule of thumb is to rerun this every time you change something significant to other functions, like the struct in the header or a function prototype, and probably after every function, at least at first. As with most other things on this project, you will develop intuition for when this is required. - -## diff - -This is in the repo's root directory. It is the main comparison tool to check your C code generates the right MIPS. - -The usual way diff is used is -```sh -./diff.py -mwo3 -``` - -- `m` automatically runs make as necessary -- `o` allows using symbol names -- `w` refreshes the diff output when the c file is saved (only the c file, not the header) -- `3` allows comparison of the previous and current saves of the file. - -Many other options exist, use the `-h` to see them. - -In order to use `diff.py` with the symbol names (with `o`), we need a copy of the code to compare against. This is done by copying the `build` folder into a folder called `expected`. Copying in Windows on WSL is very slow, so run -```sh -mkdir expected -cp -r build/ expected/ -``` -from the main directory of the repository. You should end up with the folder structure `expected/build/...`. - -![Example of a diff](images/func_80A87B9C_diff1.png) - -The colors have the following meanings: - -- Red is lines missing -- Green is extra lines -- Blue denotes significant differences in instructions, be they just numerical ones, or whole instructions -- Yellow/Gold denotes that register usage is wrong -- Other colors are used to distinguish incorrectly used registers or stack variables, to make it easy to follow where they are used. - -## decomp-permuter - -This is linked in #resources in the Discord. - -For inspiration when you run out of ideas to match a function. It is unlikely to match it completely by itself, but if you can't see from the MIPS or your code where you have issues, it will often tell you where to start looking. - -First, import the C file and MIPS of the function to compare using -```sh -./import.py -``` - -It will put it in a subdirectory of `nonmatchings`. You then run -```sh -./permuter.py nonmatchings// -``` -to produce suggestions. There are various arguments that can be used, of which the most important initially is `-j`: `-jN` tells it to use `N` CPU threads. - -Suggestions are saved in the function directory it imported the function into. - -## first_diff - -Tells you where your built rom first differs from the baserom. It gives you a memory address that you can use to do, e.g. a binary diff, and also tries too find what function or data this address is in. Run with -```C -./first_diff.py -``` - -If the rom is shifted, the first problem will be in gDMADataTable. Ignore this and look at the next one for where you actually need to look to see what's happened. The last line makes a guess on this location you need to edit to fix the problem. - -## sym_info - -Gives information about a `D_address` symbol (ROM address, RAM address, file). Run -```C -./sym_info.py -``` - -## ichaindis - -This is used to convert the data associated to the `D_address` in -```C -Actor_ProcessInitChain(&this->actor, &D_address); -``` -into an InitChain. It lives in the tools directory. Run -```sh -./tools/ichaindis.py -``` -and copy the output. (This used to only take the ROM address, which you would need to get from `sym_info.py`. Now you can just give it the RAM address, or even the raw `D_address`.) - -## colliderinit - -This is used to convert data `D_address` in the various ColliderInit functions into the format of a collider. It lives in `tools/overlayhelpers`. Because there are different types of collider, you need to give it the type of collider as well. This does not need the baserom path, and a recent update allows it to be run from anywhere. You also have to give it the `
` without the leading `D_`. -```sh -./colliderinit.py
-``` -Collider types supported are - -- `ColliderJntSphInit` -- `ColliderCylinderInit` -- `ColliderTrisInit` -- `ColliderQuadInit` -- `ColliderJntSphElementInit` -- `ColliderTrisElementInit` - -and `num` is used only for `ColliderJntSphElementInit`. - -## sfxconvert - -Automatically converts sound effect numbers in a file into their corresponding `#defines`, taking into account if `SFX_FLAG` is used. Run on a specific C file, -```sh -./tools/sfxconvert.py -``` - -Optional arguments are `-o output` to output to a different file and `-v` to give verbose output (i.e. tell you what changes it has made). - -## vt_fmt - -This turns the strange strings in the `PRINTF`s into the human-readable equivalent instructions. Copy the contents, including the quotation marks, and run -```sh -./tools/vt_fmt.py "contents" -``` -and replace the contents of the printf with the output. - -## Glank's N64 tools - -In particular, the ones used to decompile graphics macros. Their use is discussed in the section on [decompiling Draw functions](draw_functions.md). - -## graphovl - -This generates a directed graph showing an actor's function. Search for `graphovl.py` in the Discord. Put it in the root directory of the project, and run -```sh -./graphovl.py Actor_Name -``` -to produce a png in the `graphs` subdirectory. - -## format - -Shell script that does a standardised format to the C code. Can be run on a file, a directory, or the whole codebase. Run this before you submit a PR. - -## find_unused_asm - -Tracks down any `.s` files no longer used by the project. Does not ignore comments, so you have to actually remove any `#pragma` lines for it to consider the file unused. -```sh -./tools/find_unused_asm.sh -``` -will output a list of all such files, while adding `-d` deletes the files. - -## csdis - -This converts the cutscene data into macros that the cutscene system uses. Cutscenes are generally very long, so I recommend sending the output straight to a file with `>`, rather than trying to copy it all from the terminal. Run -```sh -./tools/csdis.py
-``` -on the address from the `D_address` containing the cutscene data. - -## regconvert - -This converts the direct memory references, of the form `gRegEditor->data[index]` or `gRegEditor + 0x`, into the corresponding REG macros defined in [regs.h](../include/regs.h). Run -```sh -./tools/regconvert.py -``` -if you have it in the form `gRegEditor->data[index]`, or -```sh -./tools/regconvert.py --offset -``` -if you have it in the form `gRegEditor + 0x`. You can also run it on a whole file using `--file `. - -## assist - -This takes a function name, and looks for functions with very similar assembly code. It outputs the best matches, and tells you if there is a decompiled one. -```sh -./tools/assist.py -``` -It has two optional arguments: -- `--threshold` adjust how high the matching threshold is, 1.0 being highest, 0.0 lowest -- `--num-out` change the number of matches to output diff --git a/docs/tutorial/images/changing_init_prototype.png b/docs/tutorial/images/changing_init_prototype.png deleted file mode 100644 index 7e3088b0f4..0000000000 Binary files a/docs/tutorial/images/changing_init_prototype.png and /dev/null differ diff --git a/docs/tutorial/images/ctx.png b/docs/tutorial/images/ctx.png deleted file mode 100644 index 4dd8c87447..0000000000 Binary files a/docs/tutorial/images/ctx.png and /dev/null differ diff --git a/docs/tutorial/images/data_inserted_commented_out.png b/docs/tutorial/images/data_inserted_commented_out.png deleted file mode 100644 index 8ad9686aa2..0000000000 Binary files a/docs/tutorial/images/data_inserted_commented_out.png and /dev/null differ diff --git a/docs/tutorial/images/fresh_actor_data.png b/docs/tutorial/images/fresh_actor_data.png deleted file mode 100644 index 3ab88dff2f..0000000000 Binary files a/docs/tutorial/images/fresh_actor_data.png and /dev/null differ diff --git a/docs/tutorial/images/fresh_actor_file.png b/docs/tutorial/images/fresh_actor_file.png deleted file mode 100644 index f431820248..0000000000 Binary files a/docs/tutorial/images/fresh_actor_file.png and /dev/null differ diff --git a/docs/tutorial/images/fresh_actor_file_annotated.png b/docs/tutorial/images/fresh_actor_file_annotated.png deleted file mode 100644 index e43a96ce77..0000000000 Binary files a/docs/tutorial/images/fresh_actor_file_annotated.png and /dev/null differ diff --git a/docs/tutorial/images/fresh_actor_header.png b/docs/tutorial/images/fresh_actor_header.png deleted file mode 100644 index 53649250e8..0000000000 Binary files a/docs/tutorial/images/fresh_actor_header.png and /dev/null differ diff --git a/docs/tutorial/images/func_80A87B1C_diff1.png b/docs/tutorial/images/func_80A87B1C_diff1.png deleted file mode 100644 index 4c2c6c234f..0000000000 Binary files a/docs/tutorial/images/func_80A87B1C_diff1.png and /dev/null differ diff --git a/docs/tutorial/images/func_80A87B1C_diff2.png b/docs/tutorial/images/func_80A87B1C_diff2.png deleted file mode 100644 index 8f1ae4183d..0000000000 Binary files a/docs/tutorial/images/func_80A87B1C_diff2.png and /dev/null differ diff --git a/docs/tutorial/images/func_80A87B9C_diff1.png b/docs/tutorial/images/func_80A87B9C_diff1.png deleted file mode 100644 index a44354fc67..0000000000 Binary files a/docs/tutorial/images/func_80A87B9C_diff1.png and /dev/null differ diff --git a/docs/tutorial/images/func_80A87B9C_diff2.png b/docs/tutorial/images/func_80A87B9C_diff2.png deleted file mode 100644 index 204eb8b4ad..0000000000 Binary files a/docs/tutorial/images/func_80A87B9C_diff2.png and /dev/null differ diff --git a/docs/tutorial/images/init_after_replace_actorthis.png b/docs/tutorial/images/init_after_replace_actorthis.png deleted file mode 100644 index d73d46fc53..0000000000 Binary files a/docs/tutorial/images/init_after_replace_actorthis.png and /dev/null differ diff --git a/docs/tutorial/images/init_asm.png b/docs/tutorial/images/init_asm.png deleted file mode 100644 index ebd47fde91..0000000000 Binary files a/docs/tutorial/images/init_asm.png and /dev/null differ diff --git a/docs/tutorial/images/init_diff1.png b/docs/tutorial/images/init_diff1.png deleted file mode 100644 index 8f92523e40..0000000000 Binary files a/docs/tutorial/images/init_diff1.png and /dev/null differ diff --git a/docs/tutorial/images/init_diff2.png b/docs/tutorial/images/init_diff2.png deleted file mode 100644 index cc128d754a..0000000000 Binary files a/docs/tutorial/images/init_diff2.png and /dev/null differ diff --git a/docs/tutorial/images/init_diff3top.png b/docs/tutorial/images/init_diff3top.png deleted file mode 100644 index 38d3a5b89c..0000000000 Binary files a/docs/tutorial/images/init_diff3top.png and /dev/null differ diff --git a/docs/tutorial/images/permuter_console_output.png b/docs/tutorial/images/permuter_console_output.png deleted file mode 100644 index cd427a9dc4..0000000000 Binary files a/docs/tutorial/images/permuter_console_output.png and /dev/null differ diff --git a/docs/tutorial/images/vbindiff_data_1.png b/docs/tutorial/images/vbindiff_data_1.png deleted file mode 100644 index 5f04b6b6e1..0000000000 Binary files a/docs/tutorial/images/vbindiff_data_1.png and /dev/null differ diff --git a/docs/tutorial/images/vbindiff_data_2.png b/docs/tutorial/images/vbindiff_data_2.png deleted file mode 100644 index 97d8a0feaa..0000000000 Binary files a/docs/tutorial/images/vbindiff_data_2.png and /dev/null differ diff --git a/docs/tutorial/introduction.md b/docs/tutorial/introduction.md deleted file mode 100644 index b9a658d531..0000000000 --- a/docs/tutorial/introduction.md +++ /dev/null @@ -1,74 +0,0 @@ -# Introduction to decomp - -In this project, we are decompiling The Legend of Zelda: Ocarina of Time. This means that we take the assembly language that is on the cartridge, - -``` -glabel func_80A13098 -/* 00028 80A13098 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -/* 0002C 80A1309C 24010004 */ addiu $at, $zero, 0x0004 ## $at = 00000004 -/* 00030 80A130A0 14410003 */ bne $v0, $at, .L80A130B0 -/* 00034 80A130A4 244EFFFE */ addiu $t6, $v0, 0xFFFE ## $t6 = FFFFFFFE -/* 00038 80A130A8 10000002 */ beq $zero, $zero, .L80A130B4 -/* 0003C 80A130AC A480001C */ sh $zero, 0x001C($a0) ## 0000001C -.L80A130B0: -/* 00040 80A130B0 A48E001C */ sh $t6, 0x001C($a0) ## 0000001C -.L80A130B4: -/* 00044 80A130B4 8C8F0330 */ lw $t7, 0x0330($a0) ## 00000330 -/* 00048 80A130B8 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -/* 0004C 80A130BC 24180011 */ addiu $t8, $zero, 0x0011 ## $t8 = 00000011 -/* 00050 80A130C0 A1E20004 */ sb $v0, 0x0004($t7) ## 00000004 -/* 00054 80A130C4 A08201B8 */ sb $v0, 0x01B8($a0) ## 000001B8 -/* 00058 80A130C8 A08201B9 */ sb $v0, 0x01B9($a0) ## 000001B9 -/* 0005C 80A130CC 03E00008 */ jr $ra -/* 00060 80A130D0 A0980117 */ sb $t8, 0x0117($a0) ## 00000117 -``` - -(the commented numbers on the left are the original machine code, the middle the translation into MIPS assembly, the right useful information about the numbers in the code) -and turn it into compilable C code: - -```C -void func_80A13098(EnFirefly* this) { - if (this->actor.params == 4) { - this->actor.params = 0; - } else { - this->actor.params -= 2; - } - this->collider.list->body.atDmgInfo.effect = 1; - this->auraType = 1; - this->onFire = 1; - this->actor.naviEnemyId = 0x11; -} -``` - -which is intended to be as close to the original code as possible. We are doing *matching* decomp: in the right context, and with the right compiler settings, the above C compiles into *precisely* the assembly code above, not just equivalent code. - -N.B. We are using only publicly available code. In particular, we are not looking at any of the recent Nintendo source code leaks. (These apparently contain very little Ocarina of Time material anyway.) - -Progress of the project can be found at [https://zelda64.dev]. The long-term goal of this project is to obtain a complete compilable version of the code for every publicly released version of Ocarina of Time (there are also sister projects for Majora's Mask and other Zelda games). *We are not working on a PC Port, and this project will not be making one*, although the resulting code will be very useful if someone does intend to make such a port. - -Most of the discussion on the project takes place on the Zelda Decompilation Discord (linked in the README.md). We are very welcoming to newcomers and are happy to help you with any problems you might have with the decompilation process. - -## What do I need to know to take part? - -Basic knowledge of C, particularly arrays and pointers, is extremely useful. Knowledge of MIPS is not required initially, but if you are serious about decompilation you will soon pick up a lot of it. - -Knowledge of the fundamentals of git and GitHub is required. There are a number of tutorials available online, and a later document in this tutorial describes how you contribute to this project outside the actual decompilation process. - -The most useful knowledge to have is a general understanding of how the game works. An afternoon of constructive mucking about in the [Practice Rom](http://practicerom.com) (aka GZ) will be very beneficial if you have not looked at the game's subsurface workings before. - -## Structure of the code - -A lot of work has already been done on the code to bring it into a format that is easy to decompile. I will discuss actors, since this is where the majority of new people should begin. - -An *actor* is any thing in the game that moves or performs actions or interactions: Link is an actor, enemies are actors, NPCs are actors, props like grass are actors (Fishing is also an actor, the largest one, but you don't need to know about it). The vast majority of actors are *overlays*, which means they are loaded only when the game needs them. - -In the code, each actor is associated to several files: there is -- the main .c file, e.g. `src/overlays/actors/ovl_En_Firefly/z_en_firefly.c` -- the actor's Header file, e.g. `src/overlays/actors/ovl_En_Firefly/z_en_firefly.h` -- various .o files that tell the `make` script how to incorporate it into building the ROM, - -and then for undecompiled actors, various assembly (.s) files, generally including: -- one for the actor's *data* (this usually includes things like its collision information about how to draw it, and various other stuff that is used in it), e.g. `data/overlays/actors/z_en_firefly.data.s` -- one for each function in the actor, e.g. `asm/non_matchings/overlays/actors/ovl_En_Firefly/func_80A13098.s` - -The basic process of decomp is to take one of the .s files, run it through a decompilation program (mips_to_c) that reads the ASM very literally, and then, through humen ingenuity, reshape it into code that not only compiles in the first place, but completely matches the original code (well-written or otherwise). diff --git a/docs/tutorial/merging.md b/docs/tutorial/merging.md deleted file mode 100644 index fb51b8d585..0000000000 --- a/docs/tutorial/merging.md +++ /dev/null @@ -1,97 +0,0 @@ -# The merging process - -## Optional: Documentation - -It is helpful to document the functions and variables in the actor before you Pull Request it. The aim is to provide code that is sufficiently clear to be self-documenting, but it is worth leaving a comment on anything you find obscure or confusing. (Pull Request reviews will let you know if you are leaving too many comments.) Useful things to do documentation-wise: - -- Name all (or most) of the functions. -- Name all the variables in the actor struct. -- Create enums for params, and any other numbers that would benefit from that sort of clarity. - -You can test things using the practice rom for a retail version (watches and memory view is especially helpful), as well as the generated rom with Project 64 and something like Spectrum. The most important things to know if using a retail version to test are: - -- all the addresses will be different -- actor structs in debug have 10 bytes of padding at the end, so subtract `0x10` from any subsequent offsets. - -If you want to use `diff` after renaming anything, particularly functions, remember to copy the `build/` folder into `expected/` so use the correct symbols. *Make sure that `make` gives `OK` before doing this, or you're going to get very confused.* - -Finally, *if you are not sure what something does, either ask or leave it unnamed: it will be less confusing later if things are unnamed than if they are wrongly named* - -## Preparing to PR - -### Change the `spec` - -Specifically, to use the automatically generated reloc, rather than the original. In the case of an entirely matched actor, you find the section relating to the actor that you edited before: - -``` -beginseg - name "ovl_En_Jj" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o" - //include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.data.o" - include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.reloc.o" -endseg -``` - -and change to use our reloc: - -``` -beginseg - name "ovl_En_Jj" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/ovl_En_Jj_reloc.o" -endseg -``` - -(copy the path, then copy the directory name and put `_reloc.o` after it). - -### Delete the asm files. - -We have a script that will detect and delete unused asm files, `find_unused_asm.py`. Running it bare will output a list of all the unused files, while passing `-d` will delete them. - -This does not distinguish comments, so remove all commented references to the files themselves first. If you have left the `#pragma` lines in but commented out, the following regular expression will find them: -``` -\n//.*#pragma .*?\) -``` - -### Non-matchings - -If you can't match a function even with everyone's, don't worry overlong about it. Hopefully you can get it to do the same thing as the original (non-matching), and then you set it up to use the original asm for the matching build, and your code for the non-matching. You can look at the other partially-matched actors to see how to set this up with `#ifdef`s. - -### Format - -Run the formatting script `format.py`, to format the C files in the standard way we use. - -### Merge main - -To make sure the PR builds correctly with the current main, you need to merge `upstream/main` before you make the PR. This tends to break things, that you have to fix to get it to compile correctly again. - -## Pull Requests - -Push commits to your fork of the repository on GitHub, and then open a pull request. Name the PR something sensible, like - -- `EnJj OK and documented` (if all the functions match and your documentation is fairly complete) -- `EnJj OK` (if all the functions match) -- `EnJj (n nonmatching)` (if you couldn't get one or more functions to work, but to the best of your knowledge they are equivalent code) -- `EnJj (1 nonequivalent)` (if you couldn't get one or more functions to work, and do not believe the code has the same effect) - -and so on, although these four tend to cover most cases. Feel free to add a comment describing anything interesting you had to do or issues in non-matchings, - - -### Reviews - -Pull requests may be reviewed by anyone (who knows enough about the conventions of the project), but all are usually reviewed by Fig and Roman. - -To implement suggestions made in reviews, it is generally easier to be consistent if you push more commits from your local branch. It is quite possible that in the meantime some other PR has gone in, and git will ask you to merge main before you add more commits. This is normally fairly painless, although often you have to resolve merge conflicts. If in doubt, backup your work before doing anything, and ask in Discord before doing anything drastic, or if you don't understand what git is telling you. - -There is no need to wait for your PR to be approved and committed before working on your next actor. - - -## Trello - -It's helpful to use the labels on Trello. -- RESERVED is obvious. -- Work in Progress is for when you're actively working on something -- Matched for when it is totally decompiled and matching -- Documented if at least everything is named and odd code is commented. We'll likely wipe these and start over when proper documentation begins. - -We now have a PR label on the Trello that you can use to indicate your actor is in a PR. When the actor is committed to main, you can move the actor into the `Decompiled Files (Overlays)` column: it goes at the top if there is a non-matching, and below if not. diff --git a/docs/tutorial/object_decomp.md b/docs/tutorial/object_decomp.md deleted file mode 100644 index 325239313a..0000000000 --- a/docs/tutorial/object_decomp.md +++ /dev/null @@ -1,174 +0,0 @@ -# Object Decompilation - -Object decompilation is the process of taking an object file and writing instructions to extract the various assets from it in the correct format, with appropriate labelling to distinguish their nature and/or use. - -## What is an object file? - -An object file is generally where most of the information used by overlays is stored. Its contents can include - -- Vertices (positional/normal/color data used by displaylists) -- Textures -- DisplayLists (instructions to the graphics processor on how to put together textures and vertices) -- Skeleton (The underlying structure of an actor's shape, that can be manipulated to change its "pose") -- Animations -- Prerendered backgrounds - -## How we work with objects - -Because these are regarded as copyrighted, we do not want them in the repository. We instead extract them from the ROM. To do this we use a system called ZAPD (Zelda Asset Processor for Decompilation). The main aim of object decompilation is to give ZAPD an XML file that tells it what the assets it is supposed to be extracting actually are, so it can put them in the right format and name them. - - -## How to decomp an object - -Choose an object to decomp. As usual, some will be easier than others. For reasons explained shortly, it is much easier to decomp an object if all actors that use it are decompiled. - -### Files and folders - -Select the XML file of your selected object, which should be in `assets/xml/objects/object_name.xml`. - -The ZAPD output will go in the folder `assets/objects/object_name/`. You'll want this folder open later to check the output is correct. - -### Examining actor files - -Most objects are used by at least one actor. For those used by an actor, we can use the script `tools/xmlcreate.py` on the actor to separate all the blobs of data in the object that we already know about. (While it is possible to do this manually, it is much simpler to run the script first and sort it out afterwards, since it won't miss anything accidentally.) - -Many objects have been added in an automated way, so most constituent parts of each object are already identified, but will still need to be named and documented properly. Also, these objects usually have some blobs unreferenced by the object's own contents and hence not automatically extracted; most of the time these can be identified by looking at references in the actor which uses said object. - -### Extracting assets - -You can run `extract_assets.py` to extract the object's assets. Running it with no arguments extracts *everything* all over again, though. A better way is to run it with `-s` (for single file), and give it the location of the object you want to extract relative to `assets`, i.e. - -```bash -./extract_assets.py -s objects/object_name -``` - -This should populate the folder you created earlier. ZAPD produces a C file containing the extracted object data, which will be `assets/objects/object_name/object_name.c`. Any data that you have not specified the type of, or is not referenced elsewhere in the object, is extracted as unknown blobs (usually named `unaccounted_XXXXXX`). Open the C file to see if there are any such blobs. (Some are just padding with 0s and can be ignored.) - -You now have to try and decipher these blobs using the [list of tools given below](#tools) to work out what they might be. In the case of unused parts of the object, this can be very difficult. - -### Naming - -A significant question is how deep into the object you want to explicitly categorise and name things. - -1. As a minimum, you need to include every piece of data that is directly accessed by another part of the repo (generally, but not always, actors). This allows for elimination of entries in [`undefined_syms.txt`](../../undefined_syms.txt). For most objects, this includes several of a skeleton, animations, some textures, and collision information. - -2. Naming display lists that are associated to limbs in the skeleton. This is usually straightforward, providing Z64Utils or Hylian Toolbox can show the skeleton properly. - -3. The next level is to name and give a format to any texture files that are produced from the extraction that are so far unnamed. - -4. If you really want to you can name the limbs themselves. - -5. In very rare cases, you may also want to name a particular set of vertices. - -Current naming practice is to name each item in the xml using camelCase as usual, with the `g` prefix (for "global"), and the type of data last (Skel, Anim, DL, Tex), while output texture files are named in `snake_case`. - -Each pass of a successive level will require extracting the single asset again. - -### Textures - -Textures are especially troublesome due to the abundance of formats they can be in. Some are simple RGBA textures, while others use external palettes, and can look meaningless without. If the texture is used in a displaylist, it will tell you the format, but if not, you have to use your best judgement based on anything you know about its context. - -The order of operations is that palettes are loaded first, then the texture, and then the vertices to which it is applied. - -The first argument of `gsDPLoadTextureBlock` tells you the offset, the second the format, the third the bit depth, fourth the width and fifth the height - -The following is a list of the texture formats the Nintendo 64 supports, with their gfxdis names and ZAPD format names. - - -| Format name | Typing in `gsDPLoadTextureBlock` | "Format" in xml | -| ----------------------------------------------- | -------------------------------- | --------------- | -| 4-bit intensity (I) | `G_IM_FMT_I, G_IM_SIZ_4b` | i4 | -| 4-bit intensity with alpha (I/A) (3/1) | `G_IM_FMT_IA, G_IM_SIZ_4b` | ia4 | -| 4-bit color index (CI) | `G_IM_FMT_CI, G_IM_SIZ_4b` | ci4 | -| 8-bit I | `G_IM_FMT_I, G_IM_SIZ_8b` | i8 | -| 8-bit IA (4/4) | `G_IM_FMT_IA, G_IM_SIZ_8b` | ia8 | -| 8-bit CI | `G_IM_FMT_CI, G_IM_SIZ_8b` | ci8 | -| 16-bit red, green, blue, alpha (RGBA) (5/5/5/1) | `G_IM_FMT_RGBA, G_IM_SIZ_16b` | rgba16 | -| 16-bit IA (8/8) | `G_IM_FMT_IA, G_IM_SIZ_16b` | ia16 | -| 16-bit YUV (Luminance, Blue-Y, Red-Y) | `G_IM_FMT_YUV, G_IM_SIZ_16b` | (not used) | -| 32-bit RGBA (8/8/8/8) | `G_IM_FMT_RGBA, G_IM_SIZ_32b` | rgba32 | - -The 4-bit formats are loaded using `gDPLoadTextureBlock_4b`. The others use `gDPLoadTextureBlock`. - -For example, - -```c -gsDPLoadTextureBlock(D_06006110, G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 16, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 4, 4, 0, 0), -``` - -says that there is a texture at offset `0x6110`, its Format is `rgba16`, Width is `16` and Height is `16`, so we can declare - -```XML - -``` - -See [this web page](http://n64devkit.square7.ch/tutorial/graphics/3/3_3.htm) for more information about these formats, and [gSP functions](http://n64devkit.square7.ch/n64man/gsp/gSP_INDEX.htm) and [gDP functions](http://n64devkit.square7.ch/n64man/gdp/gDP_INDEX.htm) for more about the graphics functions used. - -The `ci` formats use palettes, which are declared separately. The shape you give the palette does not matter, but to avoid overlap errors it needs to fit into a rectangle; choose the one you think looks best. - -If in doubt, look at completed objects in the repo, and if still in doubt, ask. - -### Telling the repo to use the new files - -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 -include "$(BUILD_DIR)/baserom/object_name.o" -``` - -by - -```c -include "$(BUILD_DIR)/assets/objects/object_name/object_name.o" -number 6 -``` - -(the second line tells it to assign the object to segment 6 for the actors that use it: some objects use other segments, but you'll know this from the generated XML already: the `Segment` argument in the `File` tag will be different). - -Now, add - -```c -#include "assets/objects/object_name/object_name.h" -``` - -to every actor that uses the file, to tell it about the new symbols you have defined. - -Finally, replace all the symbols in the actors that use the file by the new names you gave them, and remove the corresponding sections in `undefined_syms.txt` and any `extern`s to the object's data in the actor files. - -If you did everything correctly, you should still get OK when running `make`. - -## Tools - -Object decompilation is essentially a descriptive process, but it requires that we know what each blob of data in the object file actually is, and sometimes, the actor files that use an object are not sufficient to determine what everything is. Therefore it is useful to have a battery of romhacking and examination tools to bring to bear on the file to read its contents. - -- The state-of-the-art is random's [Z64Utils](https://github.com/Random06457/Z64Utils). This can find and analyze the displaylists, textures and vertices in an object file, and even has an skeleton and animation viewer. It is not perfect; the best model viewer remains the debug rom itself. -- The old solution to look at skeletons and animations is [Hylian Toolbox](http://wiki.maco64.com/Tools/Hylian_Toolbox). This suffers from numerous issues, but is usually suitable for looking at object files that contain one skeleton and a few animations. -- To look at textures that you know something about, a texture viewer such as [Texture64](https://github.com/queueRAM/Texture64) is often useful. You may have trouble determining things like the palette a texture uses, depending on the format. - -## Building and investigative modding - -Thankfully it is not necessary to do a full make from clean to check that a particular object file has been decompiled successfully. - -- With a valid xml file, run `extract_assets.py -s` on its object. -- `make` - -If you want to change a texture, for example to see precisely where it is used, the following steps ensure it will be used in the build - -- Make sure the `spec` is updated to use the generated assets (see above) -- Change and save the texture -- Touch the C file in the same directory (that includes it) -- make -- Ironically, ERROR 1 implies success (your new texture has changed the checksum). - -If you'd rather not have it tell you about the checksum, you can run `make COMPARE=0` instead. - ---- - -To revert to the original texture, you can just run `extract_assets.py -s` on the object again. - -N.B. doing this will overwrite every custom texture, as will running `make setup`. - - -## Example - -An example of decompiling a particular object is given [here](object_decomp_example.md). diff --git a/docs/tutorial/object_decomp_example.md b/docs/tutorial/object_decomp_example.md deleted file mode 100644 index f7317bbddb..0000000000 --- a/docs/tutorial/object_decomp_example.md +++ /dev/null @@ -1,258 +0,0 @@ -# Object Decompilation Example - -A fairly typical example of an NPC's object is `object_bg`. It is used by one actor: `ovl_En_Bom_Bowl_Man`. - -## First pass: getting it to compile - -Running `tools/xmlcreate.py` gives - -```xml -$ python3 tools/xmlcreate.py src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c chuGirl -Unknown type at offset 004110 -Unknown type at offset 004910 -Unknown type at offset 005110 - - - - - - - - - - - -``` - -We have two issues here that need to be resolved: naming the animations and sorting out the unknown things. - -### Animations - -You have three choices to work out what the animations are: - -- Read the code and look at them in the game. -- Hylian Toolbox -- The latest versions of Z64Utils - -The first of these is probably simplest if you know the game and the actor well. In this case, we know that she is dozing when you first enter, wakes up when you talk to her, then leans on the counter with both hands. We can thus name them accordingly. - -Hylian Toolbox is terrible, but good for quick-and-dirty things like finding out what a particular animation does without booting up the game. - -Z64Utils is way better than Hylian Toolbox, but still in development. - -### Unknowns - -Looking in the actor, the unknowns are assigned to segment 8 using `SEGMENTED_TO_VIRTUAL`. This indicates textures. To find out what type they are, we can find the displaylist that uses them, and look at it in Z64Utils: if we look at the object in the object analyser, then find the right displaylist, it will not display correctly in the DList viewer, asking for a texture to put on 08000000. Giving it one of the textures, we discover that it is the head displaylist and the textures are eye textures. Hence we can name them `gChuGirlEyeOpen/Half/ClosedTex` (we equivocate on half-open/half-closed since many actors use the half texture for both opening and closing). From the code in the displaylist that loads it, we can also extract the texture's format, namely - -```c -06002FD8: gsDPLoadTextureBlock(D_08000000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 5, 5, 0, 0), -``` - -So all three are `Format="rgba16" Width="32" Height="32"`. - -```xml - - - - - - - - - - - - - - - - - - -``` - -Having got this far, we can now run - -```bash -./extract_assets.py -s objects/object_bg -``` - -to extract the contents of the object into the new folder, change the spec to use our newly extracted assets: - -```txt -beginseg - name "object_bg" - romalign 0x1000 - include "$(BUILD_DIR)/baserom/object_bg.o" -endseg -``` - -to - -```txt -beginseg - name "object_bg" - romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bg/object_bg.o" - number 6 -endseg -``` - -and wipe the `z_en_bom_bowl_man` section from `undefined_syms.txt`: - -```txt -// z_en_bom_bowl_man -D_06006EB0 = 0x06006EB0; -D_06000710 = 0x06000710; -D_06000080 = 0x06000080; -D_060072AC = 0x060072AC; -``` - -Now `make` should give OK. - -## The displaylists - -For this step, we use Hylian Toolbox; if you have more than one skeleton in your actor, Hylian Toolbox will only show the first one. The others can be examined in the latest version of Z64Utils. Z64Utils can also give you a list of every displaylist in an object, be it just for cross-checking or to find extras. - -Opening the rom in Hylian Toolbox and looking at object_bg, we can note down the displaylist associated to each limb. -In this case naming is easy: we just have to note down the limb each is attached to. We only need a name and offset, and we end up with: - -```xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -``` - -Checking the C file, these are all of the displaylists in the actor, so we can move on. - -## The rest of the textures - -This is the difficult bit: we have to work out what each texture in the extracted pile is actually used for. A lot of this can be done in Z64Utils, but sometimes it is necessary to check in-game, especially for the weirder-looking ones. You can edit a texture file and compile the rom (which shouldn't match any more if you did it successfully) to make it easier to find. - -```xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -``` - - -## Final pass - -Therefore, we end up with the following: -```xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -``` - -This was an easier object to do, both because it's a fairly simple collection of stuff associated to a single actor, and because a lot of the typing was already known. diff --git a/docs/tutorial/other_functions.md b/docs/tutorial/other_functions.md deleted file mode 100644 index 9c1916ee60..0000000000 --- a/docs/tutorial/other_functions.md +++ /dev/null @@ -1,830 +0,0 @@ -# The rest of the functions in the actor - -Up: [Contents](contents.md) -Previous: [Beginning decompilation: the Init function and the Actor struct](beginning_decomp.md) - -## Now what? - -Following the scheme we gave last time, we have three options: -- `func_80A87BEC` -- `func_80A87C30` -- `func_80A87F44` - -Another option is to look at `Destroy`, which for smaller actors can often be done straight after Init, since it usually just removes colliders and deallocates dynapoly. However, glancing at the three given functions' assembly, there is an obvious standout: -```MIPS -glabel func_80A87F44 -/* 00744 80A87F44 AFA40000 */ sw $a0, 0x0000($sp) -/* 00748 80A87F48 03E00008 */ jr $ra -/* 0074C 80A87F4C AFA50004 */ sw $a1, 0x0004($sp) - -``` -This is a classic "function with two arguments that does nothing". So we can simply comment out the appropriate pragma and put -```C -void func_80A87F44(Actor* thisx, PlayState* play) { - -} -``` -in the C file. - -## Destroy - -Destroy will be a dead end, but we might as well do it now. Remaking the context and using mips2c on it (main 4 function, so change the prototype to use `EnJj* this`!) gives -```C -void EnJj_Destroy(EnJj *this, PlayState *play) { - PlayState *temp_a3; - s16 temp_v0; - - temp_v0 = this->dyna.actor.params; - temp_a3 = play; - if (temp_v0 == -1) { - play = temp_a3; - DynaPoly_DeleteBgActor(temp_a3, &temp_a3->colCtx.dyna, (s32) this->dyna.bgId); - Collider_DestroyCylinder(play, &this->collider); - return; - } - if ((temp_v0 != 0) && (temp_v0 != 1)) { - return; - } - DynaPoly_DeleteBgActor(temp_a3, &temp_a3->colCtx.dyna, (s32) this->dyna.bgId); -} -``` - -Again remember to return the first argument to `Actor* this` and put `EnJj* this = THIS;` in the function body. Based on what we know about this actor already, we expect this to be another switch. Rearranging it as such, and removing the likely fake `temp_v0` gives -```C -void EnJj_Destroy(Actor* thisx, PlayState* play) { - EnJj* this = THIS; - PlayState* temp_a3; - temp_a3 = play; - - switch (this->dyna.actor.params) { - case -1: - DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); - Collider_DestroyCylinder(play, &this->collider); - break; - case 0: - case 1: - DynaPoly_DeleteBgActor(temp_a3, &temp_a3->colCtx.dyna, this->dyna.bgId); - break; - } -} -``` -Using `./diff.py -mwo3 EnJj_Destroy` shows that this matches already, but it seems like the temp usage should be more consistent. A little experimentation shows that -```C -void EnJj_Destroy(Actor* thisx, PlayState* play) { - EnJj* this = THIS; - - switch (this->dyna.actor.params) { - case -1: - DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); - Collider_DestroyCylinder(play, &this->collider); - break; - case 0: - case 1: - DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); - break; - } -} -``` - -also matches, with no need for the `PlayState*` temp. - -## Action Functions - -### `func_80A87BEC` - -Of the two functions we have available, `func_80A87BEC` is shorter, so we do that next. Since we haven't changed any types or header file information, there is no need to remake the context. mips2c gives -```C -void func_80A87BEC(EnJj *this, PlayState *play) { - if (this->dyna.actor.xzDistToPlayer < 300.0f) { - func_80A87800(this, &func_80A87B9C); - } -} -``` - -We see that this function just sets another action function when Link is close enough to the actor. All we have to do to this is remove the `&`, and prototype `func_80A87B9C` to be an action function. Notably, this time it is not used before it is defined, so we don't need a prototype at the top: putting a placeholder one in at the function position will do, i.e. our total edits this time are -```C -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Jj/func_80A87B9C.s") -void func_80A87B9C(EnJj *this, PlayState *play); - -// #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Jj/func_80A87BEC.s") -void func_80A87BEC(EnJj *this, PlayState *play) { - if (this->dyna.actor.xzDistToPlayer < 300.0f) { - func_80A87800(this, func_80A87B9C); - } -} -``` - -We can now either follow this chain of action functions down, or start with the other one. We will go down in this case: it is usually easier to keep track that way. - -### `func_80A87B9C` - -We can remake the context, but it's simpler to just stick the function prototype we made at the bottom of the context. Either way, mips2c gives us -```C -void func_80A87B9C(EnJj *this, PlayState *play) { - s16 temp_v0; - - temp_v0 = this->unk308; - if ((s32) temp_v0 >= -0x1450) { - this->unk308 = (s16) (temp_v0 - 0x66); - if ((s32) this->unk308 < -0xA28) { - func_8003EBF8(play, &play->colCtx.dyna, this->childActor->unk14C); - } - } -} -``` -Here's a new variable for our actor struct! Don't be deceived by the `s32` cast in the comparison: mips2c always does that if it's not sure. The reliable one is the `s16` cast lower down. (An `s32` doesn't fit in the space we have anyway). So the actor struct is now -```C -typedef struct EnJj { - /* 0x0000 */ DynaPolyActor dyna; - /* 0x0164 */ SkelAnime skelAnime; - /* 0x01A8 */ Vec3s jointTable[22]; - /* 0x022C */ Vec3s morphTable[22]; - /* 0x02B0 */ ColliderCylinder collider; - /* 0x02FC */ EnJjActionFunc actionFunc; - /* 0x0300 */ Actor* childActor; - /* 0x0304 */ char unk_304[0x4]; - /* 0x0308 */ s16 unk_308; - /* 0x030A */ s16 unk_30A; - /* 0x030C */ char unk_30C[0x2]; - /* 0x030E */ s8 unk_30E; - /* 0x030F */ s8 unk_30F; - /* 0x0310 */ s8 unk_310; - /* 0x0311 */ s8 unk_311; - /* 0x0312 */ char unk_312[0x2]; -} EnJj; // size = 0x0314 -``` - -We can eliminate the temp since it's used in a simple way one after the other. `this->unk308 = (s16) (this->unk308 - 0x66);` can be written as `this->unk308 -= 0x66;`. - -In the `func_8003EBF8` we see that we should have at least made `this->childActor` a `DynaPolyActor*`, so that the last argument is its `bgId`. To avoid compiler warnings, we also need to cast the `Actor_SpawnAsChild` as such in Init, -```C -this->childActor = (DynaPolyActor*)Actor_SpawnAsChild(...) -``` - -Doing so, we are left with -```C -void func_80A87B9C(EnJj *this, PlayState *play) { - if (this->unk_308 >= -0x1450) { - this->unk_308 -= 0x66; - if (this->unk_308 < -0xA28) { - func_8003EBF8(play, &play->colCtx.dyna, this->childActor->bgId); - } - } -} -``` - -The diff shows this doesn't match: - -![func_80A87B9C diff 1](images/func_80A87B9C_diff1.png) - -It's not obvious why this doesn't match: the branching is correct, but it's loading stuff in the wrong order. Now is therefore a good time to introduce the permuter. - -### The permuter - -The permuter is a useful program for when you run out of ideas: it assigns a function a score based on how much it differs from the original code, then does random stuff that is known to improve matching, keeping ones that give better scores. It is not going to fix your control flow, but it does reasonably well on instruction differences and regalloc. It also has an option to worry about stack differences as well (`--stack-diffs`). - -To use the permuter, clone the decomp-permuter repo from the link given in Discord. First, import the C file and MIPS of the function to compare using -```sh -./import.py -``` - -It will put it in a subdirectory of `nonmatchings`. You then run -```sh -./permuter.py nonmatchings// -``` -to produce suggestions. There are various arguments that can be used, of which the most important initially is `-j`: `-jN` tells it to use `N` CPU threads. - -Suggestions are saved in the directory it imported the function into. - -![Permuter console output](images/permuter_console_output.png) - -The first suggestion looks plausible: -```C ---- before -+++ after -@@ -1390,12 +1390,14 @@ - } EnJj; - void func_80A87B9C(EnJj *this, PlayState *play) - { -- if (this->unk_308 >= (-0x1450)) -+ DynaPolyActor *new_var; -+ new_var = this->childActor; -+ if (this->unk_308 > ((-0x1450) - 1)) - { - this->unk_308 -= 0x66; - if (this->unk_308 < (-0xA28)) - { -- func_8003EBF8(play, &play->colCtx.dyna, this->childActor->bgId); -+ func_8003EBF8(play, &play->colCtx.dyna, new_var->bgId); - } - - } -``` - -In particular, adding a temp for the actor. Some of the rest is rather puzzling, but let's just try the actor temp, -```C -void func_80A87B9C(EnJj *this, PlayState *play) { - DynaPolyActor* child = this->childActor; - - if (this->unk_308 >= -0x1450) { - this->unk_308 -= 0x66; - if (this->unk_308 < -0xA28) { - func_8003EBF8(play, &play->colCtx.dyna, child->bgId); - } - } -} -``` - -![func_80A87B9C diff 2](images/func_80A87B9C_diff2.png) - -Hooray, that worked. The function now matches (as you can check by running `make -j`). In this case we are lucky and got a couple of 0s almost immediately. This will often not be the case, and you may have to go through multiple iterations to improve things. Or you get more ideas for what to do without the permuter necessarily doing everything for you. - -However, the hex values look a bit strange, and it turns out the decimal equivalents look less strange, so it's a good idea to translate them: -```C -void func_80A87B9C(EnJj *this, PlayState *play) { - DynaPolyActor* child = this->childActor; - - if (this->unk_308 >= -5200) { - this->unk_308 -= 102; - if (this->unk_308 < -2600) { - func_8003EBF8(play, &play->colCtx.dyna, child->bgId); - } - } -} -``` - -With that, we have reached the end of this action function chain, and now have to look at `func_80A87C30` - -### `func_80A87C30` - -Remaking the context and running mips2c on the assembly gives -```C -void func_80A87C30(EnJj *this, PlayState *play) { - if ((Math_Vec3f_DistXZ(&D_80A88CF0, play->unk1C44 + 0x24) < 300.0f) && (play->isPlayerDroppingFish(play) != 0)) { - this->unk_30C = 0x64; - func_80A87800(this, &func_80A87CEC); - } - this->collider.dim.pos.x = -0x4DD; - this->collider.dim.pos.y = 0x14; - this->collider.dim.pos.z = -0x30; - CollisionCheck_SetOC(play, &play->colChkCtx, (Collider *) &this->collider); -} -``` - -If you know anything about this game, this is obviously the function that begins the process of the swallowing Link cutscene. Performing minor cleanups reduces us to -```C -void func_80A87C30(EnJj *this, PlayState *play) { - if ((Math_Vec3f_DistXZ(&D_80A88CF0, play->unk1C44 + 0x24) < 300.0f) && (play->isPlayerDroppingFish(play) != 0)) { - this->unk_30C = 100; - func_80A87800(this, func_80A87CEC); - } - this->collider.dim.pos.x = -1245; - this->collider.dim.pos.y = 20; - this->collider.dim.pos.z = -48; - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider); -} -``` - -There are three things left to do to this function: -- prototype the new action function, `func_80A87CEC`. This one is used before its definition, so needs to be prototyped at the top of the file. -- extern `D_80A88CF0`, and since the arguments of `Math_Vec3f_DistXZ` are `Vec3f`s, convert it to floats. To do float conversion, either use an online converter, or get an extension for VSCode that can do it. The data becomes -```C -extern Vec3f D_80A88CF0; -// static Vec3f D_80A88CF0 = { -1589.0f, 53.0f, -43.0f }; -``` -(you must include the `.0f` parts even for integer floats: it can affect codegen, and as such it is part of our style). - -- replace the mysterious `play->unk1C44 + 0x24`. The first part is so common that most people on decomp know it by heart: it is the location of the Player actor. `+ 0x24` is obviously an offset that leats to a `Vec3f`, and if you look in the actor struct, you find that this is the location of `world.pos`. To use `Player`, we put `Player* player = GET_PLAYER(play)` at the top of the function. - -**NOTE:** mips_to_c will now output something like `&play->actorCtx.actorLists[2].head` for the Player pointer instead: this makes a lot more sense, but is not so easy to spot in the ASM without the characteristic `1C44`. - -After all this, the function becomes -```C -void func_80A87C30(EnJj *this, PlayState *play) { - Player* player = GET_PLAYER(play); - - if ((Math_Vec3f_DistXZ(&D_80A88CF0, &player->actor.world.pos) < 300.0f) && (play->isPlayerDroppingFish(play) != 0)) { - this->unk_30C = 100; - func_80A87800(this, func_80A87CEC); - } - this->collider.dim.pos.x = -1245; - this->collider.dim.pos.y = 20; - this->collider.dim.pos.z = -48; - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider); -} -``` - -One issue we have swept under the carpet thus far is what `unk_30C` is: we still have it as padding. For this we have to look at the MIPS, since mips2c hasn't told us. Scanning through the file, we find -```MIPS -/* 00498 80A87C98 A60E030C */ sh $t6, 0x030C($s0) ## 0000030C -``` - -which tells us that `unk_30C` is an `s16`, filling another gap in the struct: -```C -typedef struct EnJj { - /* 0x0000 */ DynaPolyActor dyna; - /* 0x0164 */ SkelAnime skelAnime; - /* 0x01A8 */ Vec3s jointTable[22]; - /* 0x022C */ Vec3s morphTable[22]; - /* 0x02B0 */ ColliderCylinder collider; - /* 0x02FC */ EnJjActionFunc actionFunc; - /* 0x0300 */ DynaPolyActor* childActor; - /* 0x0304 */ char unk_304[0x4]; - /* 0x0308 */ s16 unk_308; - /* 0x030A */ s16 unk_30A; - /* 0x030C */ s16 unk_30C; - /* 0x030E */ s8 unk_30E; - /* 0x030F */ s8 unk_30F; - /* 0x0310 */ s8 unk_310; - /* 0x0311 */ s8 unk_311; - /* 0x0312 */ char unk_312[0x2]; -} EnJj; // size = 0x0314 -``` - -The diff now looks fine for this function, but it gives compiler warnings about `CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider);`: the last argument is the wrong type: we need to give it `&this->collider.base` instead, which points to the same address, but is the right type. So the matching function is -```C -void func_80A87C30(EnJj *this, PlayState *play) { - Player* player = GET_PLAYER(play); - - if ((Math_Vec3f_DistXZ(&D_80A88CF0, &player->actor.world.pos) < 300.0f) && (play->isPlayerDroppingFish(play) != 0)) { - this->unk_30C = 100; - func_80A87800(this, func_80A87CEC); - } - this->collider.dim.pos.x = -1245; - this->collider.dim.pos.y = 20; - this->collider.dim.pos.z = -48; - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); -} -``` - -Again we have only one choice for our next function, namely `func_80A87CEC`. - -### `func_80A87CEC` - -Remaking the context and running mips2c on the assembly gives -```C -void func_80A87CEC(EnJj *this, PlayState *play) { - DynaPolyActor *sp1C; - DynaPolyActor *temp_v1; - s16 temp_v0; - - temp_v0 = this->unk_30C; - temp_v1 = this->childActor; - if ((s32) temp_v0 > 0) { - this->unk_30C = temp_v0 - 1; - return; - } - sp1C = temp_v1; - play = play; - func_80A87800(this, &func_80A87EF0); - play->csCtx.script = &D_80A88164; - gSaveContext.cutsceneTrigger = (u8)1U; - func_8003EBF8(play, &play->colCtx.dyna, (s32) temp_v1->bgId); - Camera_SetFinishedFlag(play->cameraPtrs[play->activeCamId]); - gSaveContext.unkEDA = (u16) (gSaveContext.unkEDA | 0x400); - Sfx_PlaySfxCentered((u16)0x4802U); -} -``` - -Easy things to sort out: - -- `func_80A87EF0` is another action function. Again it is defined below, so needs a prototype at the top. - -- We have another unknown symbol, `D_80A88164`. This is the massive chunk of data that makes up the cutscene (of Jabu swallowing Link). We will worry about it when we have decompiled the rest of the actor. For now just extern it as `UNK_TYPE`. - -- We can remove the casts from `(u8)1U` and just leave `1`. - -- `play->cameraPtrs[play->activeCamId]` has a macro: it is `GET_ACTIVE_CAM(play)`, so this line can be written as -```C -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 -```C -gSaveContext.unkEDA |= 0x400 -``` - -- The last function is an audio function: we can look up the argument in `sfx.h` and find it is `NA_SE_SY_CORRECT_CHIME` - -It remains to work out which, if any, of the temps are real. Based on our previous experience, we expect `temp_v1` to be real. `sp1C` is unused and hence unlikely to be real. `temp_v0` is only used in the short if and so probably not real. Checking the diff shows that our suspicions were correct: -```C -void func_80A87CEC(EnJj *this, PlayState *play) { - DynaPolyActor *child = this->childActor; - if (this->unk_30C > 0) { - this->unk_30C--; - return; - } - func_80A87800(this, func_80A87EF0); - play->csCtx.script = &D_80A88164; - gSaveContext.cutsceneTrigger = 1; - func_8003EBF8(play, &play->colCtx.dyna, child->bgId); - Camera_SetFinishedFlag(GET_ACTIVE_CAM(play)); - gSaveContext.save.info.eventChkInf[3] |= 0x400; - Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); -} -``` - -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 -```C -void func_80A87CEC(EnJj* this, PlayState* play) { - DynaPolyActor* child = this->childActor; - if (this->unk_30C > 0) { - this->unk_30C--; - } else { - func_80A87800(this, func_80A87EF0); - play->csCtx.script = &D_80A88164; - gSaveContext.cutsceneTrigger = 1; - func_8003EBF8(play, &play->colCtx.dyna, child->bgId); - Camera_SetFinishedFlag(GET_ACTIVE_CAM(play)); - gSaveContext.save.info.eventChkInf[3] |= 0x400; - Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); - } -} -``` - -and still match. (Early `return`s are used after an `Actor_Kill` and in a few other situations, but generally avoided for `else`s elsewhere if possible. Talking of which...) - -## `func_80A87EF0` - -mips2c with updated context gives -```C -void func_80A87EF0(EnJj *this, PlayState *play) { - char *temp_a0; - u16 temp_v0; - - temp_v0 = (u16) this->unk_30A; - if ((temp_v0 & 4) == 0) { - this->unk_30A = temp_v0 | 4; - temp_a0 = this->unk_304; - if (temp_a0 != 0) { - this = this; - Actor_Kill((Actor *) temp_a0); - this->dyna.actor.child = NULL; - } - } -} -``` - -Now we're a bit stuck: this tells us that `this->unk_304` is an `Actor*`, but we know nothing else about it. So just make it an actor for the time being. As before, `this->unk_304` is a pointer, so we should compare `temp_a0` to `NULL`. - -We also find in the MIPS -```MIPS -lhu $v0, 0x030A($a0) -``` -which at last tells us that `unk_30A` is actually a `u16`. We can now eliminate `temp_v0`, and replace the ` == 0` by a `!(...)`, which leaves -```C -void func_80A87EF0(EnJj *this, PlayState *play) { - Actor *temp_a0; - - if (!(this->unk_30A & 4)) { - this->unk_30A |= 4; - temp_a0 = this->unk_304; - if (temp_a0 != 0) { - Actor_Kill(temp_a0); - this->dyna.actor.child = NULL; - } - } -} -``` -although we are as yet none the wiser as to which actor `unk_304` actually points to. - -Again we have run out of action functions. The rules suggest that we now look at Update. - -## Update - -Update runs every frame and updates the properties of the actor, and usually runs the action functions once per frame. As before we change the first argument to `EnJj* this` to get it to use our actor's struct. mips2c gives -```C -void EnJj_Update(EnJj *this, PlayState *play) { - if ((play->csCtx.state != CS_STATE_IDLE) && (play->unk1D94 != 0)) { - func_80A87D94(); - } else { - this->actionFunc(this); - if (this->skelAnime.curFrame == 41.0f) { - Actor_PlaySfx((Actor *) this, (u16)0x28B6U); - } - } - func_80A87B1C(this); - SkelAnime_Update(&this->skelAnime); - Actor_SetScale((Actor *) this, 0.087f); - this->skelAnime.jointTable->unk40 = (s16) this->unk_308; -} -``` - -This has several problems: firstly, the action function is called with the wrong argument. We should thus be suspicious of previous functions this actor calls, and decompile them mith mips2c without context if necessary, if only to find out how many arguments they have. We find that `func_80A87D94` definitely takes `EnJj* this, PlayState* play` as arguments. Again, put this prototype at the function location above to avoid compiler warnings. - -`unk40` of an array of `Vec3s`s is `0x40 = 0x6 * 0xA + 0x4`, so is actually `this->skelAnime.jointTable[10].z` - -Lastly, what is `play->unk1D94`? It is at `play->csCtx + 0x30`, or `play->csCtx.actorCues + 0x8`, which is `play->csCtx.actorCues[2]` since this is an array of pointers. Hence it is a pointer, and so should be compared to `NULL`. Looking up the sfx Id again, we end up with -```C -void EnJj_Update(Actor *thisx, PlayState *play) { - EnJj* this = THIS; - - if ((play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.actorCues[2] != NULL)) { - func_80A87D94(this, play); - } else { - this->actionFunc(this, play); - if (this->skelAnime.curFrame == 41.0f) { - Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_JABJAB_GROAN); - } - } - func_80A87B1C(this); - SkelAnime_Update(&this->skelAnime); - Actor_SetScale(&this->dyna.actor, 0.087f); - this->skelAnime.jointTable[10].z = this->unk_308; -} -``` -which matches. - - -3 more functions to go: the two functions called here, and Draw. - - -## `func_80A87B1C` - -Now our typing problems come home to roost: - -```C -void func_80A87B1C(EnJj *this) { - s8 temp_t8; - u8 temp_v0; - u8 temp_v0_2; - - temp_v0 = (u8) this->unk_30F; - if ((s32) temp_v0 > 0) { - this->unk_30F = temp_v0 - 1; - return; - } - temp_t8 = (u8) this->unk_30E + 1; - this->unk_30E = temp_t8; - if ((temp_t8 & 0xFF) >= 3) { - temp_v0_2 = (u8) this->unk_310; - this->unk_30E = 0; - if ((s32) temp_v0_2 > 0) { - this->unk_310 = temp_v0_2 - 1; - return; - } - this = this; - this->unk_30F = Rand_S16Offset((u16)0x14, (u16)0x14); - this->unk_310 = (s8) (u8) this->unk_311; - } -} -``` - -From this we can read off that `unk_30F` is a `u8`, `unk_30E` is a `u8`, `unk_310` is a `u8`, and `unk_311` is a `u8`. Giving mips2c new context and trying again, -```C -void func_80A87B1C(EnJj *this) { - u8 temp_t8; - u8 temp_v0; - u8 temp_v0_2; - - temp_v0 = this->unk_30F; - if ((s32) temp_v0 > 0) { - this->unk_30F = temp_v0 - 1; - return; - } - temp_t8 = this->unk_30E + 1; - this->unk_30E = temp_t8; - if ((temp_t8 & 0xFF) >= 3) { - temp_v0_2 = this->unk_310; - this->unk_30E = 0; - if ((s32) temp_v0_2 > 0) { - this->unk_310 = temp_v0_2 - 1; - return; - } - this = this; - this->unk_30F = Rand_S16Offset((u16)0x14, (u16)0x14); - this->unk_310 = this->unk_311; - } -} -``` -and all the weird casts are gone. Eliminating the temps, replacing the hex, discarding pointless definitions, and replacing early `return`s by `else`s, we end up with -```C -void func_80A87B1C(EnJj* this) { - if (this->unk_30F > 0) { - this->unk_30F--; - } else { - this->unk_30E++; - if ((this->unk_30E & 0xFF) >= 3) { - this->unk_30E = 0; - if (this->unk_310 > 0) { - this->unk_310--; - } else { - this->unk_30F = Rand_S16Offset(20, 20); - this->unk_310 = this->unk_311; - } - } - } -} -``` - -Sadly this doesn't match: - -![func_80A87B1C diff 1](images/func_80A87B1C_diff1.png) - -You will also find that the permuter is essentially useless here: most solutions it offers look very fake. But there's already something a bit weird in here: why does it do `this->unk_30E & 0xFF` explicitly in the comparison? It turns out if you remove this, the function matches: the compiler does this calculation automatically when doing comparisons with `u8`s anyway. - -![func_80A87B1C diff 2](images/func_80A87B1C_diff2.png) - -### `func_80A87D94` - -This is our last ordinary function. Unfortunately, even with new context, mips2c gives us a bit of a mess: -```C -void func_80A87D94(EnJj *this, PlayState *play) { - s16 temp_v0_2; - u16 temp_t1; - u16 temp_t4; - u16 temp_t7; - u16 temp_t9; - u16 temp_v0; - u16 temp_v1; - u16 temp_v1_2; - u16 temp_v1_3; - u16 phi_v1; - - temp_v0 = *play->unk1D94; - if (temp_v0 != 1) { - if (temp_v0 != 2) { - if (temp_v0 != 3) { - phi_v1 = this->unk_30A; - } else { - temp_v1 = this->unk_30A; - temp_t7 = temp_v1 | 2; - phi_v1 = temp_v1; - if ((temp_v1 & 2) == 0) { - this->unk_30E = 0; - this->unk_30F = 0; - this->unk_310 = 1; - this->unk_311 = 0; - this->unk_30A = temp_t7; - phi_v1 = temp_t7 & 0xFFFF; - } - } - } else { - temp_t1 = this->unk_30A | 1; - temp_v1_2 = temp_t1 & 0xFFFF; - this->unk_30A = temp_t1; - phi_v1 = temp_v1_2; - if ((temp_v1_2 & 8) == 0) { - this->unk_304 = Actor_SpawnAsChild(&play->actorCtx, (Actor *) this, play, (u16)0x101, -1100.0f, 105.0f, -27.0f, 0, 0, 0, 0); - temp_t4 = this->unk_30A | 8; - this->unk_30A = temp_t4; - phi_v1 = temp_t4 & 0xFFFF; - } - } - } else { - temp_v1_3 = this->unk_30A; - phi_v1 = temp_v1_3; - if ((temp_v1_3 & 2) != 0) { - this->unk_30E = 0; - this->unk_30F = Rand_S16Offset((u16)0x14, (u16)0x14); - this->unk_310 = 0; - temp_t9 = this->unk_30A ^ 2; - this->unk_311 = 0; - this->unk_30A = temp_t9; - phi_v1 = temp_t9 & 0xFFFF; - } - } - if ((phi_v1 & 1) != 0) { - Actor_PlaySfx((Actor *) this, (u16)0x206DU); - temp_v0_2 = this->unk_308; - if ((s32) temp_v0_2 >= -0x1450) { - this->unk_308 = temp_v0_2 - 0x66; - } - } -} -``` - -At the top we have -```C - temp_v0 = *play->unk1D94; - if (temp_v0 != 1) { - if (temp_v0 != 2) { - if (temp_v0 != 3) { -``` -Firstly, we are now comparing with the value of `play->unk1D94`, not just using a pointer, so we need the first thing in `play->csCtx.actorCues[2]`. This turns out to be `play->csCtx.actorCues[2]->id`. - -The if structure here is another classic indicator of a switch: nested, with the same variable compared multiple times. If you were to diff this as-is, you would find that the code is in completely the wrong order. Reading how the ifs work, we see that if `temp_v0` is `1`, it executes the outermost else block, if it is `2`, the middle, if `3`, the innermost, and if it is anything else, the contents of the innermost if. Hence this becomes -```C -void func_80A87D94(EnJj *this, PlayState *play) { - s16 temp_v0_2; - u16 temp_t1; - u16 temp_t4; - u16 temp_t7; - u16 temp_t9; - // u16 temp_v0; - u16 temp_v1; - u16 temp_v1_2; - u16 temp_v1_3; - u16 phi_v1; - - switch (play->csCtx.actorCues[2]->id) { - case 1: - temp_v1_3 = this->unk_30A; - phi_v1 = temp_v1_3; - if ((temp_v1_3 & 2) != 0) { - this->unk_30E = 0; - this->unk_30F = Rand_S16Offset((u16)0x14, (u16)0x14); - this->unk_310 = 0; - temp_t9 = this->unk_30A ^ 2; - this->unk_311 = 0; - this->unk_30A = temp_t9; - phi_v1 = temp_t9 & 0xFFFF; - } - break; - case 2: - temp_t1 = this->unk_30A | 1; - temp_v1_2 = temp_t1 & 0xFFFF; - this->unk_30A = temp_t1; - phi_v1 = temp_v1_2; - if ((temp_v1_2 & 8) == 0) { - this->unk_304 = Actor_SpawnAsChild(&play->actorCtx, (Actor *) this, play, (u16)0x101, -1100.0f, 105.0f, -27.0f, 0, 0, 0, 0); - temp_t4 = this->unk_30A | 8; - this->unk_30A = temp_t4; - phi_v1 = temp_t4 & 0xFFFF; - } - break; - case 3: - temp_v1 = this->unk_30A; - temp_t7 = temp_v1 | 2; - phi_v1 = temp_v1; - if ((temp_v1 & 2) == 0) { - this->unk_30E = 0; - this->unk_30F = 0; - this->unk_310 = 1; - this->unk_311 = 0; - this->unk_30A = temp_t7; - phi_v1 = temp_t7 & 0xFFFF; - } - break; - default: - phi_v1 = this->unk_30A; - break; - } - if ((phi_v1 & 1) != 0) { - Actor_PlaySfx((Actor *) this, (u16)0x206DU); - temp_v0_2 = this->unk_308; - if ((s32) temp_v0_2 >= -0x1450) { - this->unk_308 = temp_v0_2 - 0x66; - } - } -} -``` -(notice that this time we need a `default` to deal with the innermost if contents). If you try to replace `0x206D` in the `Actor_PlaySfx`, you will find there is no such sfxId in the list: this is because some sound effects have an extra offset of `0x800` to do with setting flags. Adding `0x800` to the sfxId shows that this sound effect is `NA_SE_EV_JABJAB_BREATHE`. To correct this to the id in the function, we have a macro `SFX_FLAG`, and it should therefore be -```C -Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_JABJAB_BREATHE - SFX_FLAG); -``` - -As usual, most of the remaining temps look fake. The only one that does not is possibly `phi_v1`. However, the way in which they are used here makes it hard to tell if they are fake, and if so, how to replace them. I encourage you to try this yourself, with the aid of the diff script; the final, matching result, with other cleanup, is hidden below - -
- - Matching C for `func_80A87D94` - - -```C -void func_80A87D94(EnJj* this, PlayState* play) { - switch (play->csCtx.actorCues[2]->id) { - case 1: - if ((this->unk_30A & 2) != 0) { - this->unk_30E = 0; - this->unk_30F = Rand_S16Offset(20, 20); - this->unk_310 = 0; - this->unk_311 = 0; - this->unk_30A ^= 2; - } - break; - case 2: - this->unk_30A |= 1; - if ((this->unk_30A & 8) == 0) { - this->unk_304 = Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_EFF_DUST, - -1100.0f, 105.0f, -27.0f, 0, 0, 0, 0); - this->unk_30A |= 8; - } - break; - case 3: - if ((this->unk_30A & 2) == 0) { - this->unk_30E = 0; - this->unk_30F = 0; - this->unk_310 = 1; - this->unk_311 = 0; - this->unk_30A |= 2; - } - break; - } - if ((this->unk_30A & 1) != 0) { - Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_JABJAB_BREATHE - SFX_FLAG); - if (this->unk_308 >= -5200) { - this->unk_308 -= 102; - } - } -} -``` - -
- - -With that, the last remaining function is `EnJj_Draw`. Draw functions have an extra layer of macroing that is required, so we shall cover them separately. - -Next: [Draw functions](draw_functions.md) diff --git a/docs/tutorial/pre-decomp.md b/docs/tutorial/pre-decomp.md deleted file mode 100644 index 4ad66b76f5..0000000000 --- a/docs/tutorial/pre-decomp.md +++ /dev/null @@ -1,31 +0,0 @@ -# Pre-decompilation - -It is very important to get everything set up properly before you start trying to decompile anything. As usual, if you need help at any stage of the process, ask in the Discord and we'll do our best to help. - -## Setting up the repository - -This is covered on the main page of the repository. - -## Git and GitHub workflow - -First, make a GitHub fork of the repository, then clone it into a git-enabled local folder. - -Once you have decided on an actor, you should make a new git branch to work on: your main branch is meant to stay level with the main repository. Name it something sensible: my `EnFirefly` branch is called "en_firefly", for example, but you may prefer to use a more descriptive name: "Dark_Link" is rather more suggestive than "en_torch2", for example. You work on the branch, commit changes, and periodically push them to GitHub, if only for backup purposes. - -Once you have finished an actor, you submit a pull request for other people to check your work complies with the project's conventions, and once it is deemed satisfactory, it will be merged in to the main repository. - -But we are getting ahead of ourselves: - -## Choosing a first actor - -Since actors cover so many different categories of stuff in the game, they come in a wide variety of shapes, sizes and difficulties. The following is a list of things to bear in mind: - -- Bosses are by far the largest, and all are already taken, so you can safely ignore them. Likewise `ovl_Fishing`, the largest actor in the game. -- Enemies are often quite complicated due to the many different interactions they have with Link, and sometimes one another. -- NPCs vary hugely. Some of the smaller ones are suitable to be first actors, but many are not. -- Cutscene objects tend to have very complicated functions, and are best left until later. -- The best starter actors tend to be dungeon or scene objects: statues, platforms, decorations, gates, etc., although we are naturally running a bit short on these now. - -The general rule of thumb is to pick something with few, simple interactions with its environment. (For example, my first actor was BgIceTurara: icicles, which can do about 3 different things: break, fall, and grow.) This hopefully means that the functions are mostly small and simple. You are also probably better off if Draw and Init are small functions, although difficulty is sometimes not correlated to size. - -If in doubt, ask someone to have a quick look through the code to see if it's suitable. diff --git a/docs/tutorial/types_structs_padding.md b/docs/tutorial/types_structs_padding.md deleted file mode 100644 index 30c691a0c4..0000000000 --- a/docs/tutorial/types_structs_padding.md +++ /dev/null @@ -1,149 +0,0 @@ -# Types, structs, and padding - -Reminders: -- In N64 MIPS, 1 word is 4 bytes (yes, the N64 is meant to be 64-bit, but it mostly isn't used like it in OoT) -- A byte is 8 bits, or 2 hex digits - - -## Types - -The following are the common data types used everywhere: - -| Name | Size | Comment | -| ---- | ----- | -------- | -| char | 1 byte | character | -| u8 | 1 byte | unsigned byte | -| s8 | 1 byte | signed byte | -| u16 | 2 bytes | unsigned short | -| s16 | 2 bytes | signed short | -| u32 | 4 bytes/1 word | unsigned int | -| s32 | 4 bytes/1 word | signed int | -| void* | 4 bytes/1 word | pointer | - -A pointer is sometimes mistaken for an s32. s32 is the default thing to use in the absence of any other information about the data. - -Useful data for guessing types: -- u8 is about 7 times more common than s8 (so the tutorial is a bit misleading) -- s16 is about 16 times more common than u16 -- s32 is about 8 times more common than u32 - -Another useful thing to put here: the prototype for an action function is -```C -typedef void (*ActorNameActionFunc)(struct ActorName*, PlayState*); -``` -where you replace `ActorName` by the actual actor name as used elsewhere in the actor, e.g. `EnJj`. - - -## Some Common Structs - - - -Here are the usual names and the sizes of some of the most common structs used in actors and their structs: -| Type | Usual name | Size | -| ----------------------- | --------------------- | --------------- | -| `Actor` | `actor` | 0x14C | -| `DynaPolyActor` | `dyna` | 0x164 | -| `Vec3f` | | 0xC | -| `Vec3s` | | 0x6 | -| `SkelAnime` | `skelAnime` | 0x44 | -| `Vec3s[limbCount]` | `jointTable` | 0x6 * limbCount | -| `Vec3s[limbCount]` | `morphTable` | 0x6 * limbCount | -| `ColliderCylinder` | `collider` | 0x4C | -| `ColliderQuad` | `collider` | 0x80 | -| `ColliderJntSph` | `collider` | 0x20 | -| `ColliderJntSphElement` | `colliderElements[n]` | 0x40 * n | -| `ColliderTris` | `collider` | 0x20 | -| `ColliderTrisElement` | `colliderElements[n]` | 0x5C * n | - -(`colliderElements` used to be called `colliderItems`, and we have not switched over fully in the repo yet.) - -## Padding - -### Alignment - -A stored variable or piece of data does not always start immediately after the previous one: there may be padding in between: `0`s that are never written or referred to, and so ignored. This is to do with how the processor accesses memory: it reads 1 word at a time, so multibyte objects are aligned so they cross as few word boundaries as possible. - -The clearest example of this is that variables with types that are 1 word in size (`s32`s and pointers, for example) are automatically shifted so that they start at the beginning of the next word, i.e. at an offset ending with one of `0,4,8,C`: this is called 4-alignment. This will also happen to `s16`s, but with 2-alignment - -### Struct padding - -In actor structs, this manifests as some of the char arrays not being completely replaced by actual variables. For example, BgIceTurara, the actor for icicles, has the following actor struct: - -```C -typedef struct BgIceTurara { - /* 0x0000 */ DynaPolyActor dyna; - /* 0x0164 */ BgIceTuraraActionFunc actionFunc; - /* 0x0168 */ s16 shiverTimer; - /* 0x016C */ ColliderCylinder collider; -} BgIceTurara; // size = 0x01B8 -``` - -Notice that even though `timer` is an `s16`, `collider` is at `this + 0x16C`: there was originally a `char unk_166[0x2]` left over from the original char array, but it has been removed without affecting the alignment. - -How do structs themselves align? A struct has the same alignment properties as its longest constituent (that is not itself a struct). For example, a `Vec3f` has 4-alignment, while a `Vec3s` has 2-alignment. - -A struct may also pad at the end: it will pad to the size of its largest non-struct element. Notably, every actor struct has size a whole number of words as well, so this phenomenon also occurs at the ends of structs: see, for example, EnJj's actor struct that we filled out in the tutorial: the `char unk_312[0x2]` is unnecessary, because it is used nowhere, and the struct pads to `0x314` anyway. - -For more information on this topic, there are plenty of guides elsewhere on the Internet. *The main thing to bear in mind for decomp purposes is that after finishing the functions, there may be some small parts of the actor struct that are just not used, because they were originally just struct padding.* - -### Padding at the end of sections - - - - - -In the ROM, each actor is layed out in the following order: - -- .text (Function instructions, separated into .s files, aka .text) -- .data (contents of the .data.s file) -- .rodata (read-only data, includes strings, floats, jumptables etc., moved to the appropriate function files in the OoT repo) -- .bss (varibles initialised to 0, not assigned a value when declared) -- .reloc (relocation information: you can ignore this) - -Each section is 0x10/16-aligned (qword aligned): each new section begins at an address with last digit `0`. This means that there can occur up to three words of padding at the end of each section. - -(The same occurs with any object divided into multiple .c files: each new file becomes 0x10 aligned.) - -#### Padding at the end of .text (function instructions) - -In function instructions, this manifests as a set of `nop`s at the end of the last function, and once the rest of the functions match, this is automatic. So you never need to worry about these. - -#### Padding at the end of .data - -In data, the last entry may contain up to 3 words of 0s as padding. These can safely be removed when migrating data, but make sure that you don't remove something that actually is accessed by the function and happens to be 0! - -For example, in `EnJj` we found that the last symbol in the data, -```C -glabel D_80A88CFC - .word 0x06007698, 0x06007A98, 0x06007E98, 0x00000000, 0x00000000 -``` -had 2 words of padding: only the first 3 entries are actually used. - -### Padding within the .data section - -Every distinct symbol in data is 4-aligned (word-aligned). So in the data, even if you have two `u8`s, they will be stored in addresses starting successive words: - -```C -u8 byte1 = 1 // will go to address ending in 0 -u8 byte2 = 2 // Will go to address ending in 4 -``` - -#### Fake symbols - -The process of separating the data is not flawless, and sometimes gives rise to symbols that are fake: that is, containing data that should not be stored by itself, but part of a different earlier symbol. - -Since `D_address` corresponds to the address where the symbol is stored, every address should be word-aligned, i.e. end in one of `0,4,8,C`. Any symbols that do not are fake, and the data attached to them should be joined to the data of previous symbol, with all references to them adjusted to the correct offset from the previous symbol. - -Thankfully most of the fake symbols have now been automatically eliminated, but that does not mean that there are none left. Symbols can also be fake if they have the correct alignment, but are rather harder to spot. diff --git a/docs/vscode.md b/docs/vscode.md index 11f5cac471..a7fd4d44ce 100644 --- a/docs/vscode.md +++ b/docs/vscode.md @@ -35,18 +35,20 @@ Many of VS Code's other shortcuts can be found on [its getting started page](htt ## C/C++ configuration -You can create a `.vscode/c_cpp_properties.json` file with `C/C++: Edit Configurations (JSON)` in the command box to customise how IntelliSense reads the repository (stuff like where to look for includes, flags, compiler defines, etc.) to make VSCode's IntelliSense plugin better able to understand the structure of the repository. This is a good default one to use for this project's repository: +You can create a `.vscode/c_cpp_properties.json` file with `C/C++: Edit Configurations (JSON)` in the command box to customise how IntelliSense reads the repository (stuff like where to look for includes, flags, compiler defines, etc.) to make VSCode's IntelliSense plugin better able to understand the structure of the repository. + +Below is a good default one to use for this project's repository, for the oot-gc-eu-mq-dbg version specifically. + +A more complete `c_cpp_properties.json` with configurations for all supported versions [can be found here](c_cpp_properties.json). ```jsonc { "configurations": [ { - "name": "N64 hackeroot-mq", - "compilerPath": "/usr/bin/gcc", // Needs to not be "" for -m32 to work + "name": "hackeroot-mq", "compilerArgs": [ "-m32" // Removes integer truncation warnings with gbi macros ], - "intelliSenseMode": "gcc-x86", // Shouldn't matter "includePath": [ // Matches makefile's includes "include", "include/libc", @@ -57,13 +59,21 @@ You can create a `.vscode/c_cpp_properties.json` file with `C/C++: Edit Configur ], "defines": [ "_LANGUAGE_C", // For gbi.h - "OOT_DEBUG=1", // If targeting a debug version "ENABLE_HACKEROOT=1", "RELEASE_ROM=0", - "COMPRESS_YAZ=1" + "COMPRESS_YAZ=1", + // Version-specific + "OOT_VERSION=GC_EU_MQ_DBG", + "OOT_REGION=REGION_EU", + "PLATFORM_N64=0", + "PLATFORM_GC=1", + "OOT_DEBUG=1", + "F3DEX_GBI_2", + "F3DEX_GBI_PL", + "GBI_DOWHILE", + "GBI_DEBUG" ], "cStandard": "gnu89", // C89 + some GNU extensions from C99 like C++ comments - "cppStandard": "${default}" // Only ZAPD uses C++, so doesn't really matter } ], "version": 4 diff --git a/extract_assets.py b/extract_assets.py index 815b1af498..acf01cb71a 100755 --- a/extract_assets.py +++ b/extract_assets.py @@ -17,6 +17,7 @@ def SignalHandler(sig, frame): # Don't exit immediately to update the extracted assets file. def ExtractFile(assetConfig: version_config.AssetConfig, outputPath: Path, outputSourcePath: Path): + name = assetConfig.name xmlPath = assetConfig.xml_path version = globalVersionConfig.version if globalAbort.is_set(): @@ -29,17 +30,17 @@ def ExtractFile(assetConfig: version_config.AssetConfig, outputPath: Path, outpu outputPath.mkdir(parents=True, exist_ok=True) outputSourcePath.mkdir(parents=True, exist_ok=True) - execStr = f"{zapdPath} e -eh -i {xmlPath} -b extracted/{version}/baserom -o {outputPath} -osf {outputSourcePath} -gsf 1 -rconf {configPath} --cs-float both {ZAPDArgs}" + execStr = f"{zapdPath} e -eh -i {xmlPath} -b {globalBaseromSegmentsDir} -o {outputPath} -osf {outputSourcePath} -gsf 1 -rconf {configPath} --cs-float both {ZAPDArgs}" - if "code" in xmlPath.parts or "overlays" in xmlPath.parts: + if name.startswith("code/") or name.startswith("n64dd/") or name.startswith("overlays/"): assert assetConfig.start_offset is not None assert assetConfig.end_offset is not None execStr += f" --start-offset 0x{assetConfig.start_offset:X}" execStr += f" --end-offset 0x{assetConfig.end_offset:X}" - if "overlays" in xmlPath.parts: - overlayName = xmlPath.stem + if name.startswith("overlays/"): + overlayName = name.split("/")[1] baseAddress = globalVersionConfig.dmadata_segments[overlayName].vram + assetConfig.start_offset execStr += f" --base-address 0x{baseAddress:X}" @@ -62,8 +63,7 @@ def ExtractFunc(assetConfig: version_config.AssetConfig): xml_path = assetConfig.xml_path xml_path_str = str(xml_path) - version = globalVersionConfig.version - outPath = Path("extracted") / version / "assets" / objectName + outPath = globalOutputDir / objectName outSourcePath = outPath if xml_path_str in globalExtractedAssetsTracker: @@ -78,22 +78,26 @@ def ExtractFunc(assetConfig: version_config.AssetConfig): ExtractFile(assetConfig, outPath, outSourcePath) if not globalAbort.is_set(): - # Only update timestamp on succesful extractions + # Only update timestamp on successful extractions if xml_path_str not in globalExtractedAssetsTracker: globalExtractedAssetsTracker[xml_path_str] = globalManager.dict() globalExtractedAssetsTracker[xml_path_str]["timestamp"] = currentTimeStamp -def initializeWorker(versionConfig: version_config.VersionConfig, abort, unaccounted: bool, extractedAssetsTracker: dict, manager): +def initializeWorker(versionConfig: version_config.VersionConfig, abort, unaccounted: bool, extractedAssetsTracker: dict, manager, baseromSegmentsDir: Path, outputDir: Path): global globalVersionConfig global globalAbort global globalUnaccounted global globalExtractedAssetsTracker global globalManager + global globalBaseromSegmentsDir + global globalOutputDir globalVersionConfig = versionConfig globalAbort = abort globalUnaccounted = unaccounted globalExtractedAssetsTracker = extractedAssetsTracker globalManager = manager + globalBaseromSegmentsDir = baseromSegmentsDir + globalOutputDir = outputDir def processZAPDArgs(argsZ): badZAPDArg = False @@ -111,7 +115,17 @@ def processZAPDArgs(argsZ): def main(): parser = argparse.ArgumentParser(description="baserom asset extractor") - parser.add_argument("-v", "--oot-version", dest="oot_version", help="OOT game version", default="gc-eu-mq-dbg") + parser.add_argument( + "baserom_segments_dir", + type=Path, + help="Directory of uncompressed ROM segments", + ) + parser.add_argument( + "output_dir", + type=Path, + help="Output directory to place files in", + ) + parser.add_argument("-v", "--version", dest="oot_version", help="OOT game version", default="gc-eu-mq-dbg") parser.add_argument("-s", "--single", help="Extract a single asset by name, e.g. objects/gameplay_keep") parser.add_argument("-f", "--force", help="Force the extraction of every xml instead of checking the touched ones (overwriting current files).", action="store_true") parser.add_argument("-j", "--jobs", help="Number of cpu cores to extract with.") @@ -119,7 +133,12 @@ def main(): parser.add_argument("-Z", help="Pass the argument on to ZAPD, e.g. `-ZWunaccounted` to warn about unaccounted blocks in XMLs. Each argument should be passed separately, *without* the leading dash.", metavar="ZAPD_ARG", action="append") args = parser.parse_args() + baseromSegmentsDir: Path = args.baserom_segments_dir version: str = args.oot_version + outputDir: Path = args.output_dir + + args.output_dir.mkdir(parents=True, exist_ok=True) + versionConfig = version_config.load_version_config(version) global ZAPDArgs @@ -130,7 +149,7 @@ def main(): manager = multiprocessing.Manager() signal.signal(signal.SIGINT, SignalHandler) - extraction_times_p = Path("extracted") / version / "assets_extraction_times.json" + extraction_times_p = outputDir / "assets_extraction_times.json" extractedAssetsTracker = manager.dict() if extraction_times_p.exists() and not args.force: with extraction_times_p.open(encoding='utf-8') as f: @@ -147,7 +166,7 @@ def main(): print(f"Error. Asset {singleAssetName} not found in config.", file=os.sys.stderr) exit(1) - initializeWorker(versionConfig, mainAbort, args.unaccounted, extractedAssetsTracker, manager) + initializeWorker(versionConfig, mainAbort, args.unaccounted, extractedAssetsTracker, manager, baseromSegmentsDir, outputDir) # Always extract if -s is used. xml_path_str = str(assetConfig.xml_path) if xml_path_str in extractedAssetsTracker: @@ -166,13 +185,13 @@ class CannotMultiprocessError(Exception): mp_context = multiprocessing.get_context("fork") except ValueError as e: raise CannotMultiprocessError() from e - with mp_context.Pool(numCores, initializer=initializeWorker, initargs=(versionConfig, mainAbort, args.unaccounted, extractedAssetsTracker, manager)) as p: + with mp_context.Pool(numCores, initializer=initializeWorker, initargs=(versionConfig, mainAbort, args.unaccounted, extractedAssetsTracker, manager, baseromSegmentsDir, outputDir)) as p: p.map(ExtractFunc, versionConfig.assets) except (multiprocessing.ProcessError, TypeError, CannotMultiprocessError): - print("Warning: Multiprocessing exception ocurred.", file=os.sys.stderr) + print("Warning: Multiprocessing exception occurred.", file=os.sys.stderr) print("Disabling mutliprocessing.", file=os.sys.stderr) - initializeWorker(versionConfig, mainAbort, args.unaccounted, extractedAssetsTracker, manager) + initializeWorker(versionConfig, mainAbort, args.unaccounted, extractedAssetsTracker, manager, baseromSegmentsDir, outputDir) for assetConfig in versionConfig.assets: ExtractFunc(assetConfig) diff --git a/format.py b/format.py index 71e73f1074..9eaf983d31 100755 --- a/format.py +++ b/format.py @@ -31,7 +31,7 @@ # Compiler options used with Clang-Tidy # Normal warnings are disabled with -Wno-everything to focus only on tidying INCLUDES = "-Iinclude -Isrc -Ibuild/gc-eu-mq-dbg -Ibuild/hackeroot-mq -I." -DEFINES = "-D_LANGUAGE_C -DNON_MATCHING" +DEFINES = "-D_LANGUAGE_C -DNON_MATCHING -DF3DEX_GBI_2" COMPILER_OPTS = f"-fno-builtin -std=gnu90 -m32 -Wno-everything {INCLUDES} {DEFINES}" diff --git a/include/attributes.h b/include/attributes.h index f58cc8122d..0bee9c40ca 100644 --- a/include/attributes.h +++ b/include/attributes.h @@ -5,8 +5,10 @@ #define __attribute__(x) #endif -#define UNUSED __attribute__((unused)) -#define FALLTHROUGH __attribute__((fallthrough)) -#define NORETURN __attribute__((noreturn)) +#define UNUSED __attribute__((unused)) +#define FALLTHROUGH __attribute__((fallthrough)) +#define NORETURN __attribute__((noreturn)) +#define NO_REORDER __attribute__((no_reorder)) +#define SECTION_DATA __attribute__((section(".data"))) #endif diff --git a/include/audio/aseq.h b/include/audio/aseq.h new file mode 100644 index 0000000000..ac600738b0 --- /dev/null +++ b/include/audio/aseq.h @@ -0,0 +1,2346 @@ +/** + * @file aseq.h + * Zelda64 Music Macro Language (MML) Assembler Definitions + * + * This file implements the assembler for Zelda64 Music Macro Language. MML is an interpreted language that combines + * general MIDI with arithmetic and control flow instructions. + * + * There are multiple distinct sections: + * - .sequence: The top level of the program, this is unique and executes sequentially. + * - .channel: Spawned by the top-level sequence, there can be up to 16 channels active at any time that execute in + * parallel. Channels map directly to MIDI channels, control changes made in channels affect the notes + * in the layers spawned by the channel. + * - .layer: Spawned by channels, up to 4 layers per channel. These execute in parallel. The purpose of layers is + * to allow overlapping notes. + * - .table: Contains dyntable labels. + * - .array: Contains array-like data that can be read using sequence IO instructions. + * - .filter: Contains filter structures. + * - .envelope: Contains envelope scripts. + * - .buffer: Contains arbitrary data. + * + * Execution begins in the sequence section at position 0 of the sequence with no channels or layers initialized. + * + * Execution flows until it blocks on certain commands that induce delays for a fixed number of ticks (it is to be + * understood that ticks in this context refers to seqTicks in code), such as the delay instructions or note + * instructions. If this happens in a channel or layer, the other channels/layers will continue execution until they + * hit their own delays. + * + * Sequences can self-modify. The ldseq, stseq and related instructions can perform loads and stores to any location + * in a sequence, including the executable sections. This can be used to make up for the lack of registers and + * arithmetic instructions by replacing immediate values in the instructions themselves. + * + * The maximum call depth is 4. Call depth applies to both loops and subroutines. Loops are implemented like + * subroutines in that starting a loop pushes a return address onto the call stack and reaching the end of the loop + * decrements the loop counter. If the loop has iterations left, it jumps to the return address. When a loop completes + * all the iterations, or when the break instruction is executed, the return address is popped from the call stack and + * no jump occurs. + * + * In the instruction descriptions, we use a number of conventions for referring to various internal state: + * - PC : The location of the current instruction, within the respective sequence/channel/layer + * - SEQ : The sequence data, viewed as an array of s8/u8 + * - TR : Temporary s8 register + * - TP : Temporary u16 register + * - CIO[15..0][7..0] : Channel IO + * - SIO[7..0] : Sequence IO + * - DYNTBL : Current dyntable, DYNTBL16 and DYNTBL8 are different views into the same memory + * - DYNTBL16 : Current dyntable, viewed as an array of s16/u16 + * - DYNTBL8 : Current dyntable, viewed as an array of s8/u8 + * - CALLDEPTH : The current subroutine nesting level + * - SHORTVELTBL : Current short notes velocity table + * - SHORTGATETBL : Current short notes gate time table + */ +#ifndef ASEQ_H +#define ASEQ_H + +#include "versions.h" + +/** + * IO Ports + */ + +#define IO_PORT_0 0 +#define IO_PORT_1 1 +#define IO_PORT_2 2 +#define IO_PORT_3 3 +#define IO_PORT_4 4 +#define IO_PORT_5 5 +#define IO_PORT_6 6 +#define IO_PORT_7 7 + + + +/** + * Parameter Constants + */ + +#define TRUE 1 +#define FALSE 0 + +#define PITCH_A0 0 +#define PITCH_BF0 1 +#define PITCH_B0 2 +#define PITCH_C1 3 +#define PITCH_DF1 4 +#define PITCH_D1 5 +#define PITCH_EF1 6 +#define PITCH_E1 7 +#define PITCH_F1 8 +#define PITCH_GF1 9 +#define PITCH_G1 10 +#define PITCH_AF1 11 +#define PITCH_A1 12 +#define PITCH_BF1 13 +#define PITCH_B1 14 +#define PITCH_C2 15 +#define PITCH_DF2 16 +#define PITCH_D2 17 +#define PITCH_EF2 18 +#define PITCH_E2 19 +#define PITCH_F2 20 +#define PITCH_GF2 21 +#define PITCH_G2 22 +#define PITCH_AF2 23 +#define PITCH_A2 24 +#define PITCH_BF2 25 +#define PITCH_B2 26 +#define PITCH_C3 27 +#define PITCH_DF3 28 +#define PITCH_D3 29 +#define PITCH_EF3 30 +#define PITCH_E3 31 +#define PITCH_F3 32 +#define PITCH_GF3 33 +#define PITCH_G3 34 +#define PITCH_AF3 35 +#define PITCH_A3 36 +#define PITCH_BF3 37 +#define PITCH_B3 38 +#define PITCH_C4 39 +#define PITCH_DF4 40 +#define PITCH_D4 41 +#define PITCH_EF4 42 +#define PITCH_E4 43 +#define PITCH_F4 44 +#define PITCH_GF4 45 +#define PITCH_G4 46 +#define PITCH_AF4 47 +#define PITCH_A4 48 +#define PITCH_BF4 49 +#define PITCH_B4 50 +#define PITCH_C5 51 +#define PITCH_DF5 52 +#define PITCH_D5 53 +#define PITCH_EF5 54 +#define PITCH_E5 55 +#define PITCH_F5 56 +#define PITCH_GF5 57 +#define PITCH_G5 58 +#define PITCH_AF5 59 +#define PITCH_A5 60 +#define PITCH_BF5 61 +#define PITCH_B5 62 +#define PITCH_C6 63 +#define PITCH_DF6 64 +#define PITCH_D6 65 +#define PITCH_EF6 66 +#define PITCH_E6 67 +#define PITCH_F6 68 +#define PITCH_GF6 69 +#define PITCH_G6 70 +#define PITCH_AF6 71 +#define PITCH_A6 72 +#define PITCH_BF6 73 +#define PITCH_B6 74 +#define PITCH_C7 75 +#define PITCH_DF7 76 +#define PITCH_D7 77 +#define PITCH_EF7 78 +#define PITCH_E7 79 +#define PITCH_F7 80 +#define PITCH_GF7 81 +#define PITCH_G7 82 +#define PITCH_AF7 83 +#define PITCH_A7 84 +#define PITCH_BF7 85 +#define PITCH_B7 86 +#define PITCH_C8 87 +#define PITCH_DF8 88 +#define PITCH_D8 89 +#define PITCH_EF8 90 +#define PITCH_E8 91 +#define PITCH_F8 92 +#define PITCH_GF8 93 +#define PITCH_G8 94 +#define PITCH_AF8 95 +#define PITCH_A8 96 +#define PITCH_BF8 97 +#define PITCH_B8 98 +#define PITCH_C9 99 +#define PITCH_DF9 100 +#define PITCH_D9 101 +#define PITCH_EF9 102 +#define PITCH_E9 103 +#define PITCH_F9 104 +#define PITCH_GF9 105 +#define PITCH_G9 106 +#define PITCH_AF9 107 +#define PITCH_A9 108 +#define PITCH_BF9 109 +#define PITCH_B9 110 +#define PITCH_C10 111 +#define PITCH_DF10 112 +#define PITCH_D10 113 +#define PITCH_EF10 114 +#define PITCH_E10 115 +#define PITCH_F10 116 +#define PITCH_BFNEG1 117 +#define PITCH_BNEG1 118 +#define PITCH_C0 119 +#define PITCH_DF0 120 +#define PITCH_D0 121 +#define PITCH_EF0 122 +#define PITCH_E0 123 +#define PITCH_F0 124 +#define PITCH_GF0 125 +#define PITCH_G0 126 +#define PITCH_AF0 127 + +// Hardcoded Instruments +#define FONTANY_INSTR_SFX 126 +#define FONTANY_INSTR_DRUM 127 +// Instruments implemented in gWaveSamples +#define FONTANY_INSTR_SAWTOOTH 128 +#define FONTANY_INSTR_TRIANGLE 129 +#define FONTANY_INSTR_SINE 130 +#define FONTANY_INSTR_SQUARE 131 +#define FONTANY_INSTR_NOISE 132 +#define FONTANY_INSTR_BELL 133 +#define FONTANY_INSTR_8PULSE 134 +#define FONTANY_INSTR_4PULSE 135 +#define FONTANY_INSTR_ASM_NOISE 136 + + + +#ifdef _LANGUAGE_ASEQ + +/** + * MML Version + */ + +#ifndef MML_VERSION + #error "MML version not defined, define MML_VERSION in the cpp invocation" +#endif + +#define MML_VERSION_OOT 0 +#define MML_VERSION_MM 1 + + + +/** + * IDENT + */ + +.ident "Zelda64 Audio Sequence compiled with GNU AS + aseq.h" +#if (MML_VERSION == MML_VERSION_OOT) + .ident "MML VERSION OOT" +#else + .ident "MML VERSION MM" +#endif + + + +/** + * Sequence IDs + */ + +// Some sequence instructions such as runseq would like sequence names for certain arguments. +// This facilitates making the sequence enum names available in sequence assembly files. + +.set __SEQ_ID_CTR, 0 + +#define DEFINE_SEQUENCE(name, seqId, storageMedium, cachePolicy, seqFlags) \ + .internal seqId; \ + .set seqId, __SEQ_ID_CTR; \ + .set __SEQ_ID_CTR, __SEQ_ID_CTR + 1 + +#define DEFINE_SEQUENCE_PTR(seqIdReal, seqId, storageMediumReal, cachePolicyReal, seqFlags) \ + .internal seqId; \ + .set seqId, __SEQ_ID_CTR; \ + .set __SEQ_ID_CTR, __SEQ_ID_CTR + 1 + +#include "tables/sequence_table.h" + +#undef DEFINE_SEQUENCE +#undef DEFINE_SEQUENCE_PTR + +// Mark the counter as internal for the symbol table +.internal __SEQ_ID_CTR + + + +/** + * STSEQ offsets + */ + +#define STSEQ_HERE (. + 1) + +// stores 1 byte (stseq) +#define STSEQ_LOOP_COUNT 1 +#define STSEQ_VOL 1 +#define STSEQ_PAN 1 +#define STSEQ_REVERB 1 +#define STSEQ_UNK_A4 1 +#define STSEQ_FILTER_IDX 1 +#define STSEQ_COMBFILTER_ARG1_HI 2 +#define STSEQ_NOTEDV_OPCODE_PITCH 0 +#define STSEQ_NOTEDV_DELAY 1 +#define STSEQ_NOTEDV_DELAY_HI 1 +#define STSEQ_NOTEDV_DELAY_LO 2 +#define STSEQ_NOTEDV_VELOCITY 3 +#define STSEQ_NOTEDV_VELOCITY_2 2 +#define STSEQ_LDI_IMM 1 +#define STSEQ_TRANSPOSITION 1 +#define STSEQ_PORTAMENTO_MODE 1 +#define STSEQ_PORTAMENTO_PITCH 2 +#define STSEQ_PORTAMENTO_TIME 3 +#define STSEQ_NOTEPAN 1 +#define STSEQ_LDELAY 1 +#define STSEQ_STSEQ_IMM 1 +#define STSEQ_RAND 1 +#define STSEQ_SURROUNDEFFECT 1 +#define STSEQ_GENERAL_OPCODE 0 +#define STSEQ_STEREO 1 +#define STSEQ_BENDFINE 1 +#define STSEQ_NOTEDVG_OPCODE_PITCH 0 +#define STSEQ_NOTEDVG_DELAY_HI 1 +#define STSEQ_NOTEDVG_DELAY_LO 2 +#define STSEQ_NOTEDVG_VELOCITY_LONGDELAY 3 +#define STSEQ_NOTEDVG_DELAY_SHORT 1 +#define STSEQ_NOTEDVG_VELOCITY_SHORTDELAY 2 +#define STSEQ_GAIN 1 +#define STSEQ_INSTR 1 +#define STSEQ_VIBDEPTH 1 +#define STSEQ_SUB_IMM 1 +#define STSEQ_INITCHAN_HI 1 +#define STSEQ_INITCHAN_LO 2 +#define STSEQ_VOLEXP 1 +#define STSEQ_BEND 1 +#define STSEQ_LDSEQ_SEQ_ID 1 + +// stores 2 bytes (stptrtoseq) +#define STSEQ_PTR_DYNTBL 1 +#define STSEQ_PTR_LDLAYER 1 +#define STSEQ_PTR_LDSEQ 1 +#define STSEQ_PTR_STSEQ 2 + +// stores 2 bytes (so should be used with stptrtoseq) +#define STSEQ_ENVELOPE_POINT(n) (2 * (n)) + + + +/** + * Sequence Sections + */ + +.internal ASEQ_MODE_NONE; .set ASEQ_MODE_NONE, 0 +.internal ASEQ_MODE_SEQUENCE; .set ASEQ_MODE_SEQUENCE, 1 +.internal ASEQ_MODE_CHANNEL; .set ASEQ_MODE_CHANNEL, 2 +.internal ASEQ_MODE_LAYER; .set ASEQ_MODE_LAYER, 3 +.internal ASEQ_MODE_TABLE; .set ASEQ_MODE_TABLE, 4 +.internal ASEQ_MODE_ARRAY; .set ASEQ_MODE_ARRAY, 5 +.internal ASEQ_MODE_FILTER; .set ASEQ_MODE_FILTER, 6 +.internal ASEQ_MODE_ENVELOPE; .set ASEQ_MODE_ENVELOPE, 7 +.internal ASEQ_MODE_BUFFER; .set ASEQ_MODE_BUFFER, 8 + + +/* Macros that change structure based on current section */ +.macro _RESET_SECTION + .purgem ldseq + .macro ldseq + .error "Invalid section for `ldseq`" + .endm + + .purgem filter + .macro filter + .error "Invalid section for `filter`" + .endm + + .purgem env + .macro env + .error "Invalid section for `env`" + .endm +.endm + +/* Dummy macro definitions for above so purgem doesn't error on first run */ +.macro ldseq +.endm +.macro filter +.endm +.macro env +.endm + +/* Instantiate above macros */ +_RESET_SECTION + +/** + * Begin a sequence code section. + */ +.macro .sequence name + _RESET_SECTION + + /* `ldseq` changes structure based on current section. */ + .purgem ldseq + .macro ldseq ioPortNum, seqId, label + _wr_cmd_id ldseq, 0xB0,,,,,,,, \ioPortNum, 4 + _wr_u8 \seqId + _wr_lbl \label + .endm + + .set ASEQ_MODE, ASEQ_MODE_SEQUENCE + \name: +.endm + +/** + * Begin a channel code section. + */ +.macro .channel name + _RESET_SECTION + + /* `ldseq` changes structure based on current section. */ + .purgem ldseq + .macro ldseq label + _wr_cmd_id ldseq, ,0xCB,,,,,,, 0, 0 + _wr_lbl \label + .endm + + /* `filter` changes structure based on current section. */ + .purgem filter + .macro filter lowpassCutoff, highpassCutoff + _check_arg_bitwidth_u \lowpassCutoff, 4 + _check_arg_bitwidth_u \highpassCutoff, 4 + + _wr_cmd_id filter, ,0xB3,,,,,,, 0, 0 + _wr_u8 (\lowpassCutoff << 4) | (\highpassCutoff) + .endm + + /* `env` changes structure based on current section. */ + .purgem env + .macro env label + _wr_cmd_id env, ,0xDA,,,,,,, 0, 0 + _wr_lbl \label + .endm + + .set ASEQ_MODE, ASEQ_MODE_CHANNEL + \name: +.endm + +/** + * Begin a layer code section. + */ +.macro .layer name + _RESET_SECTION + + /* `env` changes structure based on current section. */ + .purgem env + .macro env label, arg + _wr_cmd_id env, ,,0xCB,,,,,, 0, 0 + _wr_lbl \label + _wr_u8 \arg + .endm + + .set ASEQ_MODE, ASEQ_MODE_LAYER + \name: +.endm + +/** + * Begin a table section. + */ +.macro .table name + .balign 2 + .table_unaligned \name +.endm + +/** + * Begin a table section at an unaligned offset. + */ +.macro .table_unaligned name + _RESET_SECTION + + .set ASEQ_MODE, ASEQ_MODE_TABLE + \name: +.endm + +/** + * Begin an array section. + */ +.macro .array name + _RESET_SECTION + + .set ASEQ_MODE, ASEQ_MODE_ARRAY + \name: +.endm + +/** + * Begin a filter section. + */ +.macro .filter name + _RESET_SECTION + + /* `filter` changes structure based on current section. */ + .purgem filter + .macro filter a0, a1, a2, a3, a4, a5, a6, a7 + _wr_s16 \a0 + _wr_s16 \a1 + _wr_s16 \a2 + _wr_s16 \a3 + _wr_s16 \a4 + _wr_s16 \a5 + _wr_s16 \a6 + _wr_s16 \a7 + .endm + + .set ASEQ_MODE, ASEQ_MODE_FILTER + .balign 16 + \name: +.endm + +/** + * Begin an envelope section. + */ +.macro .envelope name + _RESET_SECTION + + .set ASEQ_MODE, ASEQ_MODE_ENVELOPE + .balign 2 + \name: +.endm + +/** + * Begin a buffer section. + */ +.macro .buffer name + _RESET_SECTION + + .set ASEQ_MODE, ASEQ_MODE_BUFFER + .balign 16 + \name: +.endm + + +.macro _section_invalid macro_name + .if ASEQ_MODE == ASEQ_MODE_SEQUENCE + .error "Invalid section for `\macro_name`: Sequence" + .elseif ASEQ_MODE == ASEQ_MODE_CHANNEL + .error "Invalid section for `\macro_name`: Channel" + .elseif ASEQ_MODE == ASEQ_MODE_LAYER + .error "Invalid section for `\macro_name`: Layer" + .elseif ASEQ_MODE == ASEQ_MODE_TABLE + .error "Invalid section for `\macro_name`: Table" + .elseif ASEQ_MODE == ASEQ_MODE_ARRAY + .error "Invalid section for `\macro_name`: Array" + .elseif ASEQ_MODE == ASEQ_MODE_FILTER + .error "Invalid section for `\macro_name`: Filter" + .elseif ASEQ_MODE == ASEQ_MODE_ENVELOPE + .error "Invalid section for `\macro_name`: Envelope" + .elseif ASEQ_MODE == ASEQ_MODE_BUFFER + .error "Invalid section for `\macro_name`: Buffer" + .else + .error "Invalid section" + .endif +.endm + + + +/** + * Sequence Start/End + */ + +.macro .startseq name + /* Begin a sequence. */ + + /* Write the sequence name into a special .name section */ + .pushsection .name, "", @note + .asciz "\name" + .balign 4 + .popsection + + /* Reset section and write start symbol. */ + .section .data, "wa", @progbits + .set ASEQ_MODE, ASEQ_MODE_NONE + .balign 16 + .global \name\()_Start + \name\()_Start: + _seq_start: +.endm + +.macro .endseq name + /* End a sequence. Align to 16 bytes, write end and size symbols. */ + .balign 16 + _seq_end: + .global \name\()_End + \name\()_End: + .global \name\()_Size + .set \name\()_Size, _seq_end - _seq_start + /* Mark ASEQ_MODE as an internal symbol at the very end since it is redefined many times */ + .internal ASEQ_MODE +.endm + + + +/** + * Parameters + */ + +.macro _check_arg_bitwidth_u value, num + /* Checks if the unsigned integer `value` fits within `num` bits. */ + .if (\value & ((1 << \num) - 1)) != \value + .error "value \value out of range for unsigned \num\()-bit argument" + .endif +.endm + +.macro _check_arg_bitwidth_s value, num + /* Checks if the signed integer `value` fits within `num` bits. */ + .if (\value & ((1 << (\num - 1)) - 1)) - (\value & (1 << (\num - 1))) != \value + .error "value \value out of range for signed \num\()-bit argument" + .endif +.endm + +/* Long encoded numbers a la MIDI */ +.macro _var_long x + _check_arg_bitwidth_u \x, 15 + + .byte (0x80 | (\x & 0x7f00) >> 8), (\x & 0xff) +.endm + +/* Potentially long encoded numbers, but may not be. */ +.macro _var x + .if (\x >= 0x80) + _var_long \x + .else + _check_arg_bitwidth_u \x, 8 + .byte \x + .endif +.endm + +.macro _wr8 value + /* Write 8 bits */ + .byte (\value) & 0xFF +.endm + +.macro _wr16 value + /* Write 16 bits (big-endian) */ + .byte (\value) >> 8, (\value) & 0xFF +.endm + +.macro _wr_s8 value + /* Ensure the provided arg value fits in 8 bits (signed) */ + _check_arg_bitwidth_s \value, 8 + _wr8 \value +.endm + +.macro _wr_u8 value + /* Ensure the provided arg value fits in 8 bits (unsigned) */ + _check_arg_bitwidth_u \value, 8 + _wr8 \value +.endm + +.macro _wr_s16 value + /* Ensure the provided arg value fits in 16 bits (signed) */ + _check_arg_bitwidth_s \value, 16 + _wr16 \value +.endm + +.macro _wr_u16 value + /* Ensure the provided arg value fits in 16 bits (unsigned) */ + _check_arg_bitwidth_u \value, 16 + _wr16 \value +.endm + +.macro _wr_lbl value + /* Subtract sequence start label to get a numeric offset that can be written at assembling time */ + _wr16 (\value - _seq_start) +.endm + +.macro _wr_16_rel value + /* Turn label into relative offset. + * Can't check encoding, complains about non-constant value.. */ + _wr16 (\value - $reladdr\@) +$reladdr\@: +.endm + +.macro _wr_8_rel value + /* Turn label into relative offset. + * Can't check encoding, complains about non-constant value.. */ + _wr8 (\value - $reladdr\@) +$reladdr\@: +.endm + +.macro _wr_cmd_id cmd_name, seq_id=-1, chan_id=-1, layer_id=-1, tbl_id=-1, arr_id=-1, filt_id=-1, env_id=-1, buf_id=-1, lo_bits, n_lo_bits + /* Helper for writing command ids. Will write the command id appropriate for the current section, optionally + * packing in low-order bits if a command uses them for an argument. */ + _check_arg_bitwidth_u \lo_bits, \n_lo_bits + + .if ASEQ_MODE == ASEQ_MODE_SEQUENCE && \seq_id != -1 + _check_arg_bitwidth_u \seq_id, 8 + .byte (\seq_id & 0xFF) | (\lo_bits) + .elseif ASEQ_MODE == ASEQ_MODE_CHANNEL && \chan_id != -1 + _check_arg_bitwidth_u \chan_id, 8 + .byte (\chan_id & 0xFF) | (\lo_bits) + .elseif ASEQ_MODE == ASEQ_MODE_LAYER && \layer_id != -1 + _check_arg_bitwidth_u \layer_id, 8 + .byte (\layer_id & 0xFF) | (\lo_bits) + .elseif ASEQ_MODE == ASEQ_MODE_TABLE && \tbl_id != -1 + _check_arg_bitwidth_u \tbl_id, 8 + .byte (\tbl_id & 0xFF) | (\lo_bits) + .elseif ASEQ_MODE == ASEQ_MODE_ARRAY && \arr_id != -1 + _check_arg_bitwidth_u \arr_id, 8 + .byte (\arr_id & 0xFF) | (\lo_bits) + .elseif ASEQ_MODE == ASEQ_MODE_FILTER && \filt_id != -1 + _check_arg_bitwidth_u \filt_id, 8 + .byte (\filt_id & 0xFF) | (\lo_bits) + .elseif ASEQ_MODE == ASEQ_MODE_ENVELOPE && \env_id != -1 + _check_arg_bitwidth_u \env_id, 8 + .byte (\env_id & 0xFF) | (\lo_bits) + .elseif ASEQ_MODE == ASEQ_MODE_BUFFER && \buf_id != -1 + _check_arg_bitwidth_u \buf_id, 8 + .byte (\buf_id & 0xFF) | (\lo_bits) + .else + _section_invalid \cmd_name + .endif +.endm + +.macro .ptr value + _wr_lbl \value +.endm + +.macro .ptr_raw value + _wr16 \value +.endm + + + +/** + * Instructions + */ + +/** + * end + * + * Marks the end of an executable section. + * + * If CALLDEPTH is not 0 (that is, execution is currently in a subroutine) + * the current subroutine is exited and execution continues at the saved + * return address. If CALLDEPTH is 0, the current layer/channel/sequence is + * closed. If the sequence is closed, all execution ends. If a channel is + * closed, so are its layers. + */ +.macro end + _wr_cmd_id end, 0xFF,0xFF,0xFF,,,,,, 0, 0 +.endm + +/** + * delay1 + * + * Delays for one tick. + */ +.macro delay1 + _wr_cmd_id delay1, 0xFE,0xFE,,,,,,, 0, 0 +.endm + +/** + * delay + * + * Delays for `delay` ticks. + */ +.macro delay delay + _wr_cmd_id delay, 0xFD,0xFD,,,,,,, 0, 0 + _var \delay +.endm + +/** + * call + * + * Unconditionally enters a subroutine at `label`. Execution will resume following this instruction once the + * subroutine encounters an `end` instruction. + */ +.macro call label + _wr_cmd_id call, 0xFC,0xFC,0xFC,,,,,, 0, 0 + _wr_lbl \label +.endm + +/** + * jump + * + * Branches to `label` unconditionally. + */ +.macro jump label + _wr_cmd_id jump, 0xFB,0xFB,0xFB,,,,,, 0, 0 + _wr_lbl \label +.endm + +/** + * beqz + * + * Branches to `label` if TR == 0. + */ +.macro beqz label + _wr_cmd_id beqz, 0xFA,0xFA,0xFA,,,,,, 0, 0 + _wr_lbl \label +.endm + +/** + * bltz + * + * Branches to `label` if TR < 0. + */ +.macro bltz label + _wr_cmd_id beqz, 0xF9,0xF9,0xF9,,,,,, 0, 0 + _wr_lbl \label +.endm + +/** + * loop + * + * Begin a loop for `num` iterations, pushing the address of the next + * instruction to the call stack. + * + * Maximum loop nesting level is 4 - CALLDEPTH, after this the call stack + * becomes full. + */ +.macro loop num + _wr_cmd_id loop, 0xF8,0xF8,0xF8,,,,,, 0, 0 + _wr_u8 \num +.endm + +/** + * loopend + * + * Indicates the end of a loop body. Whenever the instruction is executed + * the loop counter decrements and either branches back to the loop start + * if there are remaining iterations or exits the loop if all iterations + * have been completed. When the loop is to be exited, the top of the call + * stack is popped. + */ +.macro loopend + _wr_cmd_id loopend, 0xF7,0xF7,0xF7,,,,,, 0, 0 +.endm + +/** + * break + * + * Immediately ends the current loop, popping it from the call stack, but + * does not branch to the end of the loop. + * + * Programming Note: Do not allow execution to later flow into loopend, as + * the call stack would be popped twice. + */ +.macro break + _wr_cmd_id break, 0xF6,0xF6,0xF6,,,,,, 0, 0 +.endm + +/** + * bgez + * + * Branches to `label` if TR >= 0. + */ +.macro bgez label + _wr_cmd_id bgez, 0xF5,0xF5,0xF5,,,,,, 0, 0 + _wr_lbl \label +.endm + +/** + * rjump + * + * Branches to `label` unconditionally. + * `label` is a relative offset rather than an absolute offset, making it appropriate + * for use in position-independent code. + * Note that the range is reduced compared to absolute jumps, only labels within a + * signed 8-bit (+/-128) range are reachable. + */ +.macro rjump label + _wr_cmd_id rjump, 0xF4,0xF4,0xF4,,,,,, 0, 0 + _wr_8_rel \label +.endm + +/** + * rbeqz + * + * Branches to `label` if TR == 0. + * `label` is a relative offset rather than an absolute offset, making it appropriate + * for use in position-independent code. + * Note that the range is reduced compared to absolute branches, only labels within a + * signed 8-bit (+/-128) range are reachable. + */ +.macro rbeqz label + _wr_cmd_id rbeqz, 0xF3,0xF3,0xF3,,,,,, 0, 0 + _wr_8_rel \label +.endm + +/** + * rbltz + * + * Branches to `label` if TR < 0. + * `label` is a relative offset rather than an absolute offset, making it appropriate + * for use in position-independent code. + * Note that the range is reduced compared to absolute branches, only labels within a + * signed 8-bit (+/-128) range are reachable. + */ +.macro rbltz label + _wr_cmd_id rbltz, 0xF2,0xF2,0xF2,,,,,, 0, 0 + _wr_8_rel \label +.endm + +/** + * allocnotelist + * + * Clears the channel note pool and reallocates it with space for `num` notes. + */ +.macro allocnotelist num + _wr_cmd_id allocnotelist, 0xF1,0xF1,,,,,,, 0, 0 + _wr_u8 \num +.endm + +/** + * freenotelist + * + * Clears the channel note pool. + */ +.macro freenotelist + _wr_cmd_id freenotelist, 0xF0,0xF0,,,,,,, 0, 0 +.endm + +/** + * unk_EF + * + * Has no function. + */ +.macro unk_EF arg1, arg2 + _wr_cmd_id unk_EF, 0xEF,,,,,,,, 0, 0 + _wr_s16 \arg1 + _w_u8 \arg2 +.endm + +/** + * bendfine + * + * Fine-tunes the pitch bend amount for the channel or layer. + */ +.macro bendfine amt + _wr_cmd_id bendfine, ,0xEE,0xCE,,,,,, 0, 0 + _wr_s8 \amt +.endm + +/** + * gain + * + * Sets the channel gain (multiplicative volume scale factor) to the provided qu4.4 fixed-point value. + */ +.macro gain value + _wr_cmd_id gain, ,0xED,,,,,,, 0, 0 + _wr_u8 \value +.endm + +/** + * vibreset + * + * Resets channel vibrato, filter, gain, sustain, etc. state. + */ +.macro vibreset + _wr_cmd_id vibreset, ,0xEC,,,,,,, 0, 0 +.endm + +/** + * fontinstr + * + * Updates the soundfont and instrument for the channel simultaneously. + */ +.macro fontinstr fontId, instId + _wr_cmd_id fontinstr, ,0xEB,,,,,,, 0, 0 + _wr_u8 \fontId + _wr_u8 \instId +.endm + +/** + * notepri + * + * Set note priorities. + */ +.macro notepri priority1, priority2 + _check_arg_bitwidth_u \priority1, 4 + _check_arg_bitwidth_u \priority2, 4 + _wr_cmd_id notepri, ,0xE9,,,,,,, 0, 0 + _wr_u8 (\priority1 << 4) | \priority2 +.endm + +/** + * params + * + * + * Sets various channel parameters. + */ +.macro params muteBhv, noteAllocPolicy, channelPriority, transposition, pan, panWeight, reverb, reverbIndex + _wr_cmd_id params, ,0xE8,,,,,,, 0, 0 + _wr_u8 \muteBhv + _wr_u8 \noteAllocPolicy + _wr_u8 \channelPriority + _wr_u8 \transposition + _wr_u8 \pan + _wr_u8 \panWeight + _wr_u8 \reverb + _wr_u8 \reverbIndex +.endm + +/** + * ldparams + * + * Sets various channel parameters by loading them from `label`. The data + * is ordered in the same way as the arguments in `params`. + */ +.macro ldparams label + _wr_cmd_id ldparams, ,0xE7,,,,,,, 0, 0 + _wr_lbl \label +.endm + +/** + * samplebook + * + * Sets the sample book mode. + */ +.macro samplebook value + _wr_cmd_id samplebook, ,0xE6,,,,,,, 0, 0 + _wr_u8 \value +.endm + +/** + * reverbidx + * + * Sets the channel reverb. + */ +.macro reverbidx arg + _wr_cmd_id reverbidx, ,0xE5,,,,,,, 0, 0 + _wr_u8 \arg +.endm + +/** + * reverbidx + * + * Sets the channel vibrato delay. + */ +.macro vibdelay arg + _wr_cmd_id vibdelay, ,0xE3,,,,,,, 0, 0 + _wr_u8 \arg +.endm + +/** + * vibdepthgrad + * + * Sets the vibrato extent. + */ +.macro vibdepthgrad arg0, arg1, arg2 + _wr_cmd_id vibdepthgrad, ,0xE2,,,,,,, 0, 0 + _wr_u8 \arg0 + _wr_u8 \arg1 + _wr_u8 \arg2 +.endm + +/** + * vibfreqgrad + * + * Sets the vibrato rate. + */ +.macro vibfreqgrad arg0, arg1, arg2 + _wr_cmd_id vibfreqgrad, ,0xE1,,,,,,, 0, 0 + _wr_u8 \arg0 + _wr_u8 \arg1 + _wr_u8 \arg2 +.endm + +/** + * volexp + * + * Changes the expression amount for the channel. + */ +.macro volexp amt + _wr_cmd_id volexp, ,0xE0,,,,,,, 0, 0 + _wr_u8 \amt +.endm + +/** + * transpose + * + * Sets the transposition amount. Transposition shifts all note pitches by the + * provided number of semitones. + */ +.macro transpose semitones + _wr_cmd_id transpose, 0xDF,0xDB,0xC2,,,,,, 0, 0 + _wr_s8 \semitones +.endm + +/** + * rtranspose + * + * Adjusts the transposition amount. This is only available at the top sequence level. + */ +.macro rtranspose semitones + _wr_cmd_id rtranspose, 0xDE,,,,,,,, 0, 0 + _wr_s8 \semitones +.endm + +/** + * freqscale + * + * Sets the freqScale for the current channel. + */ +.macro freqscale arg + _wr_cmd_id freqscale, ,0xDE,,,,,,, 0, 0 + _wr_s16 \arg +.endm + +/** + * tempo + * + * Changes the tempo of the sequence. + */ +.macro tempo bpm + _wr_cmd_id tempo, 0xDD,,,,,,,, 0, 0 + _wr_u8 \bpm +.endm + +/** + * tempochg + * + * Sets the tempoChange for the sequence. + */ +.macro tempochg arg + _wr_cmd_id tempochg, 0xDC,,,,,,,, 0, 0 + _wr_s8 \arg +.endm + +/** + * pan + * + * Changes the pan amount for a channel. + */ +.macro pan pan + /* pan can only take values in 0..127 */ + _check_arg_bitwidth_u \pan, 7 + _wr_cmd_id pan, ,0xDD,,,,,,, 0, 0 + _wr_u8 \pan +.endm + +/** + * panweight + * + * Controls how much the final pan value is influenced by the channel pan and layer pan. + * The layer pan is set by the drum instrument pan. + * A value of 0 ignores channel pan, while a value of 127 ignores layer pan. + * + * finalPan = (weight * channelPan + (128 - weight) * layerPan) / 128 + */ +.macro panweight weight + /* weight can only take values in 0..127 */ + _check_arg_bitwidth_u \weight, 7 + _wr_cmd_id panweight, ,0xDC,,,,,,, 0, 0 + _wr_u8 \weight +.endm + +/** + * vol + * + * Sets the volume amount for this sequence or channel. + */ +.macro vol amt + _wr_cmd_id vol, 0xDB,0xDF,,,,,,, 0, 0 + _wr_u8 \amt +.endm + +/** + * volmode + * + * TODO DESCRIPTION + */ +.macro volmode mode, fadeTimer + _wr_cmd_id volmode, 0xDA,,,,,,,, 0, 0 + _wr_u8 \mode + _wr_u16 \fadeTimer +.endm + +/** + * volscale + * + * Sets the fadeVolumeScale for the sequence. + */ +.macro volscale arg + _wr_cmd_id volscale, 0xD9,,,,,,,, 0, 0 + _wr_u8 \arg +.endm + +/** + * releaserate + * + * Sets the envelope release rate for this channel or layer. + */ +.macro releaserate release + _wr_cmd_id releaserate, ,0xD9,0xCF,,,,,, 0, 0 + _wr_u8 \release +.endm + +/** + * vibdepth + * + * Sets the vibrato depth for the channel. + */ +.macro vibdepth arg + _wr_cmd_id vibdepth, ,0xD8,,,,,,, 0, 0 + _wr_u8 \arg +.endm + +/** + * vibfreq + * + * Sets the vibrato rate for the channel. + */ +.macro vibfreq arg + _wr_cmd_id vibfreq, ,0xD7,,,,,,, 0, 0 + _wr_u8 \arg +.endm + +/** + * initchan + * + * Initializes the channels marked in the provided bitmask. + * + * e.g. initchan 0b1 initializes channel 0. + * initchan 0b101 initializes channels 0 and 2. + */ +.macro initchan bitmask + _wr_cmd_id initchan, 0xD7,,,,,,,, 0, 0 + _wr_u16 \bitmask +.endm + +/** + * freechan + * + * Frees the channels marked in the provided bitmask. + */ +.macro freechan bitmask + _wr_cmd_id freechan, 0xD6,,,,,,,, 0, 0 + _wr_u16 \bitmask +.endm + +/** + * mutescale + * + * Sets the muteVolumeScale for the sequence. + */ +.macro mutescale arg + _wr_cmd_id mutescale, 0xD5,,,,,,,, 0, 0 + _wr_s8 \arg +.endm + +/** + * mute + * + * Mutes the sequence player. + */ +.macro mute + _wr_cmd_id mute, 0xD4,,,,,,,, 0, 0 +.endm + +/** + * reverb + * + * Sets the reverb amount for this channel. + */ +.macro reverb amt + _wr_cmd_id reverb, ,0xD4,,,,,,, 0, 0 + _wr_u8 \amt +.endm + +/** + * mutebhv + * + * Sets mute behavior for this sequence or channel. + */ +.macro mutebhv flags + _wr_cmd_id mutebhv, 0xD3,0xCA,,,,,,, 0, 0 + _wr_u8 \flags +.endm + +/** + * bend + * + * Sets the pitch bend amount for this channel. + */ +.macro bend amt + _wr_cmd_id bend, ,0xD3,,,,,,, 0, 0 + _wr_s8 \amt +.endm + +/** + * ldshortvelarr + * + * Sets the location of SHORTVELTBL. + */ +.macro ldshortvelarr label + _wr_cmd_id ldshortvelarr, 0xD2,,,,,,,, 0, 0 + _wr_lbl \label +.endm + +/** + * sustain + * + * Sets the adsr sustain value for this channel. + */ +.macro sustain value + _wr_cmd_id sustain, ,0xD2,,,,,,, 0, 0 + _wr_u8 \value +.endm + +/** + * ldshortgatearr + * + * Sets the location of SHORTGATETBL. + */ +.macro ldshortgatearr label + _wr_cmd_id ldshortgatearr, 0xD1,,,,,,,, 0, 0 + _wr_lbl \label +.endm + +/** + * notealloc + * + * Sets the noteAllocPolicy for either the sequence or the current channel. + */ +.macro notealloc arg + _wr_cmd_id notealloc, 0xD0,0xD1,,,,,,, 0, 0 + _wr_u8 \arg +.endm + +/** + * effects + * + * Sets stereo effects. + */ +.macro effects headset, type, strongR, strongL, strongRvrbR, strongRvrbL + _check_arg_bitwidth_u \headset, 1 + _check_arg_bitwidth_u \type, 2 + _check_arg_bitwidth_u \strongR, 1 + _check_arg_bitwidth_u \strongL, 1 + _check_arg_bitwidth_u \strongRvrbR, 1 + _check_arg_bitwidth_u \strongRvrbL, 1 + + _wr_cmd_id effects, ,0xD0,,,,,,, 0, 0 + _wr_u8 (\headset << 7) | (\type << 4) | (\strongR << 3) | (\strongL << 2) | (\strongRvrbR << 1) | (\strongRvrbL << 0) +.endm + +/** + * stptrtoseq + * + * Stores TP -> label + */ +.macro stptrtoseq label + _wr_cmd_id stptrtoseq, ,0xCF,,,,,,, 0, 0 + _wr_lbl \label +.endm + +/** + * ldptr + * + * Loads label -> TP + */ +.macro ldptr label + _wr_cmd_id ldptr, ,0xCE,,,,,,, 0, 0 + _wr_lbl \label +.endm + +/** + * ldptr + * + * Loads imm -> TP + */ +.macro ldptri imm + _wr_cmd_id ldptr, ,0xCE,,,,,,, 0, 0 + _wr_u16 \imm +.endm + +/** + * rand + * + * Stores a random number in the range [0, max) into TR. If max is 0 the range is [0, 255] + */ +.macro rand max + _wr_cmd_id rand, 0xCE,0xB8,,,,,,, 0, 0 + _wr_u8 \max +.endm + +/** + * [sequence] dyncall + * + * Jumps to table[TR], treating table as a u16 array, pushing the next PC to the call stack + * + * [channel] dyncall + * + * Jumps to DYNTBL16[TR], pushing the next PC to the call stack + */ +.macro dyncall table=-1 + .if \table == -1 + _wr_cmd_id dyncall, ,0xE4,,,,,,, 0, 0 + .else + _wr_cmd_id dyncall, 0xCD,,,,,,,, 0, 0 + _wr_lbl \table + .endif +.endm + +/** + * ldi + * + * Loads the immediate value `imm` into TR. + */ +.macro ldi imm + _wr_cmd_id ldi, 0xCC,0xCC,,,,,,, 0, 0 + _wr_u8 \imm +.endm + +/** + * and + * + * Computes TR = TR & imm + */ +.macro and imm + _wr_cmd_id and, 0xC9,0xC9,,,,,,, 0, 0 + _wr_u8 \imm +.endm + +/** + * sub + * + * Computes TR = TR - imm + */ +.macro sub imm + _wr_cmd_id sub, 0xC8,0xC8,,,,,,, 0, 0 + _wr_u8 \imm +.endm + +/** + * stseq + * + * Stores the u8 value `TR + imm` to the location specified by `label`. + */ +.macro stseq imm, label + _wr_cmd_id stseq, 0xC7,0xC7,,,,,,, 0, 0 + _wr_u8 \imm + _wr_lbl \label +.endm + +/** + * stop + * + * Immediately stops the sequence or channel. + */ +.macro stop + _wr_cmd_id stop, 0xC6,0xEA,,,,,,, 0, 0 +.endm + +/** + * font + * + * Set the current soundfont for this channel to `fontId`. + */ +.macro font fontId + _wr_cmd_id font, ,0xC6,,,,,,, 0, 0 + _wr_u8 \fontId +.endm + +/** + * scriptctr + * + * Sets scriptCounter to arg. + * + * scriptCounter usually increments every time the sequence is updated but is otherwise + * never used, so changing it with this instruction has no useful effects. + */ +.macro scriptctr arg + _wr_cmd_id scriptctr, 0xC5,,,,,,,, 0, 0 + _wr_u16 \arg +.endm + +/** + * dyntbllookup + * + * Loads DYNTBL16[TR] -> DYNTBL + * unless TR is -1, in which case nothing happens. + */ +.macro dyntbllookup + _wr_cmd_id dyntbllookup, ,0xC5,,,,,,, 0, 0 +.endm + +/** + * runseq + * + * Plays the sequence seqId on seqPlayer. + */ +.macro runseq seqPlayer, seqId + _wr_cmd_id runseq, 0xC4,,,,,,,, 0, 0 + _wr_u8 \seqPlayer + _wr_u8 \seqId +.endm + +#if (MML_VERSION == MML_VERSION_MM) + + /** + * mutechan + * + * TODO DESCRIPTION + */ + .macro mutechan arg0 + _wr_cmd_id mutechan, 0xC3,,,,,,,, 0, 0 + _wr_s16 \arg0 + .endm + +#endif + +/** + * noshort + * + * Disable short notes encoding. + */ +.macro noshort + _wr_cmd_id noshort, ,0xC4,,,,,,, 0, 0 +.endm + +/** + * short + * + * Enable short notes encoding. + */ +.macro short + _wr_cmd_id short, ,0xC3,,,,,,, 0, 0 +.endm + +/** + * dyntbl + * + * Loads label -> DYNTBL + */ +.macro dyntbl label + _wr_cmd_id dyntbl, ,0xC2,,,,,,, 0, 0 + _wr_lbl \label +.endm + +/** + * instr + * + * Set instrument `instNum` from the current soundfont as the active instrument for this channel or layer. + */ +.macro instr instNum + _wr_cmd_id instr, ,0xC1,0xC6,,,,,, 0, 0 + _wr_u8 \instNum +.endm + +#if (MML_VERSION == MML_VERSION_MM) + + /** + * unk_BE + * + * TODO DESCRIPTION + */ + .macro unk_BE arg0 + _wr_cmd_id unk_BE, ,0xBE,,,,,,, 0, 0 + _wr_u8 \arg0 + .endm + +#endif + +/** + * randptr + * + * Assigns a random number sampled from [offset,offset+range) -> TP + * + * If range is 0, it is treated as 65536. + */ +.macro randptr range, offset + #if (MML_VERSION == MML_VERSION_OOT) + _wr_cmd_id randptr, ,0xBD,,,,,,, 0, 0 + #else + _wr_cmd_id randptr, ,0xA8,,,,,,, 0, 0 + #endif + _wr_u16 \range + _wr_u16 \offset +.endm + +#if (MML_VERSION == MML_VERSION_MM) + + /** + * samplestart + * + * TODO DESCRIPTION + */ + .macro samplestart arg + _wr_cmd_id samplestart, ,0xBD,,,,,,, 0, 0 + _wr_u8 \arg + .endm + + /** + * unk_A7 + * + * TODO DESCRIPTION + */ + .macro unk_A7 arg + _wr_cmd_id unk_A7, ,0xA7,,,,,,, 0, 0 + _wr_u8 \arg + .endm + + /** + * unk_A6 + * + * TODO DESCRIPTION + */ + .macro unk_A6 arg0, arg1 + _wr_cmd_id unk_A6, ,0xA6,,,,,,, 0, 0 + _wr_u8 \arg0 + _wr_s16 \arg1 + .endm + + /** + * unk_A5 + * + * TODO DESCRIPTION + */ + .macro unk_A5 + _wr_cmd_id unk_A5, ,0xA5,,,,,,, 0, 0 + .endm + + /** + * unk_A4 + * + * TODO DESCRIPTION + */ + .macro unk_A4 arg + _wr_cmd_id unk_A4, ,0xA4,,,,,,, 0, 0 + _wr_u8 \arg + .endm + + /** + * unk_A3 + * + * TODO DESCRIPTION + */ + .macro unk_A3 + _wr_cmd_id unk_A3, ,0xA3,,,,,,, 0, 0 + .endm + + /** + * unk_A2 + * + * TODO DESCRIPTION + */ + .macro unk_A2 arg + _wr_cmd_id unk_A2, ,0xA2,,,,,,, 0, 0 + _wr_s16 \arg + .endm + + /** + * unk_A1 + * + * TODO DESCRIPTION + */ + .macro unk_A1 + _wr_cmd_id unk_A1, ,0xA1,,,,,,, 0, 0 + .endm + + /** + * unk_A0 + * + * TODO DESCRIPTION + */ + .macro unk_A0 arg + _wr_cmd_id unk_A0, ,0xA0,,,,,,, 0, 0 + _wr_s16 \arg + .endm + +#endif + +/** + * ptradd + * + * Computes TP += value + */ +.macro ptradd value + _wr_cmd_id ptradd, ,0xBC,,,,,,, 0, 0 + _wr_lbl \value +.endm + +/** + * ptraddi + * + * Like ptradd but for immediates instead of labels + * + * Computes TP += value + */ +.macro ptraddi value + _wr_cmd_id ptradd, ,0xBC,,,,,,, 0, 0 + _wr_u16 \value +.endm + +/** + * combfilter + * + * Enable comb filter. + * TODO args? arg0=16,arg1=val<<8 maps well to midi chorus + */ +.macro combfilter arg0, arg1 + _wr_cmd_id combfilter, ,0xBB,,,,,,, 0, 0 + _wr_u8 \arg0 + _wr_u16 \arg1 +.endm + +/** + * randgate + * + * Sets the range of random note gateTime fluctuations. + * + * NOTE: This feature is bugged. If this is non-zero it will actually use the range set by randvel. + */ +.macro randgate range + _wr_cmd_id randgate, ,0xBA,,,,,,, 0, 0 + _wr_u8 \range +.endm + +/** + * randvel + * + * Sets the range for random note velocity fluctuations. + */ +.macro randvel range + _wr_cmd_id randvel, ,0xB9,,,,,,, 0, 0 + _wr_u8 \range +.endm + +/** + * rand + * + * Stores a random number in the range [0, max) into TP. If max is 0 the range is [0, 65535] + */ +.macro randtoptr max + _wr_cmd_id randtoptr, ,0xB7,,,,,,, 0, 0 + _wr_u16 \max +.endm + +/** + * dyntblv + * + * Loads DYNTBL8[TR] -> TR + */ +.macro dyntblv + _wr_cmd_id dyntblv, ,0xB6,,,,,,, 0, 0 +.endm + +/** + * dyntbltoptr + * + * Loads DYNTBL16[TR] -> TP + */ +.macro dyntbltoptr + _wr_cmd_id dyntbltoptr, ,0xB5,,,,,,, 0, 0 +.endm + +/** + * ptrtodyntbl + * + * Transfers TP -> DYNTBL + */ +.macro ptrtodyntbl + _wr_cmd_id ptrtodyntbl, ,0xB4,,,,,,, 0, 0 +.endm + +/** + * ldseqtoptr + * + * Loads SEQ[label + TR * 2] -> TP + * + * Note that TR acts as an index into an array of u16 starting at label. + */ +.macro ldseqtoptr label + _wr_cmd_id ldseqtoptr, ,0xB2,,,,,,, 0, 0 + _wr_lbl \label +.endm + +/** + * freefilter + * + * Invalidates the current active filter buffer. + */ +.macro freefilter + _wr_cmd_id freefilter, ,0xB1,,,,,,, 0, 0 +.endm + +/** + * ldfilter + * + * Sets the active filter buffer to the location specified by `filter`. + */ +.macro ldfilter filter + _wr_cmd_id ldfilter, ,0xB0,,,,,,, 0, 0 + _wr_lbl \filter +.endm + +/** + * cdelay + * + * Short delay encoding for channel sections. + * Delays by `delay` ticks. + */ +.macro cdelay delay + _wr_cmd_id cdelay, ,0x00,,,,,,, \delay, 4 +.endm + +/** + * ldsample + * + * Triggers an async load of a sample belonging to either: + * - The Instrument ID in TR, if type is LDSAMPLE_INST. + * - The Sound Effect ID in TP, if type is LDSAMPLE_SFX. + * + * Load status is made available in CIO[CUR_CHANNEL][portNum]. + */ +.macro ldsample type, portNum + .if \type == LDSAMPLE_INST + _wr_cmd_id ldsample, ,0x10,,,,,,, \portNum, 3 + .elif \type == LDSAMPLE_SFX + _wr_cmd_id ldsample, ,0x18,,,,,,, \portNum, 3 + .else + .error "ldsample: invalid type" + .endif +.endm +#define LDSAMPLE_INST 0 +#define LDSAMPLE_SFX 1 + +/** + * stcio + * + * Stores the contents of TR into CIO[channelNum][portNum] + */ +.macro stcio channelNum, portNum + _wr_cmd_id stcio, ,0x30,,,,,,, \channelNum, 4 + _wr_u8 \portNum +.endm + +/** + * ldcio + * + * Loads the contents of CIO[channelNum][portNum] into TR. + */ +.macro ldcio channelNum, portNum + _wr_cmd_id ldcio, ,0x40,,,,,,, \channelNum, 4 + _wr_u8 \portNum +.endm + +/** + * rldlayer + * + * Opens the note layer at `label` for index `layerNum`. + * `label` is a relative offset rather than an absolute offset, making it appropriate + * for use in position-independent code. + */ +.macro rldlayer layerNum, label + _wr_cmd_id rldlayer, ,0x78,,,,,,, \layerNum, 3 + _wr_16_rel \label +.endm + +/** + * testlayer + * + * Tests if the layer specified by `layerNum` is finished. + * Stores result to TR: + * - 1 if layer is finished. + * - 0 if layer is not finished. + * - -1 if layer does not exist. + */ +.macro testlayer layerNum + _wr_cmd_id testlayer, ,0x80,,,,,,, \layerNum, 3 +.endm + +/** + * ldlayer + * + * Opens the note layer at `label` for index `layerNum`. + */ +.macro ldlayer layerNum, label + _wr_cmd_id ldlayer, ,0x88,,,,,,, \layerNum, 3 + _wr_lbl \label +.endm + +/** + * dellayer + * + * Deletes the layer specified by index `layerNum`. + */ +.macro dellayer arg + _wr_cmd_id dellayer, ,0x90,,,,,,, \arg, 3 +.endm + +/** + * dynldlayer + * + * Allocates a new layer starting at the pointer read from DYNTBL16[TR] + */ +.macro dynldlayer arg + _wr_cmd_id dynldlayer, ,0x98,,,,,,, \arg, 3 +.endm + +/** + * testchan + * + * Tests if the channel specified by index `channelNum` is enabled. + * Stores result to TR: + * - 0 if enabled + * - 1 if disabled + */ +.macro testchan channelNum + _wr_cmd_id testchan, 0x00,,,,,,,, \channelNum, 4 +.endm + +/** + * stopchan + * + * Disables the channel specified by channel `channelNum`. + */ +.macro stopchan channelNum + .if ASEQ_MODE == ASEQ_MODE_SEQUENCE + _wr_cmd_id stopchan, 0x40,,,,,,,, \channelNum, 4 + .else + _wr_cmd_id stopchan, ,0xCD,,,,,,, 0, 0 + _wr_u8 \channelNum + .endif +.endm + +/** + * subio + * + * In sequence section: + * Computes TR = TR - SIO[portNum] + * + * In channel section: + * Computes TR = TR - CIO[CUR_CHANNEL][portNum] + */ +.macro subio portNum + _wr_cmd_id subio, 0x50,0x50,,,,,,, \portNum, 4 +.endm + +/** + * ldres + * + * Load Resource. + * resType (sync with SampleBankTableType) + * - 0 = Sequence + * - 1 = Font + * - 2 = Sample + * + * resId is either a sequence id, soundfont id or samplebank id. + * + * Load status is made available in SIO[portNum]. + */ +.macro ldres portNum, resType, resId + _wr_cmd_id ldres, 0x60,,,,,,,, \portNum, 4 + _wr_u8 \resType + _wr_u8 \resId +.endm + +/** + * Sequence Section: stio + * Channel Section: stio + * + * Moves the contents of TR to either SIO[portNum] or CIO[CUR_CHANNEL][portNum] + * depending on current section. + */ +.macro stio portNum + .if ASEQ_MODE == ASEQ_MODE_CHANNEL + _wr_cmd_id stio, ,0x70,,,,,,, \portNum, 3 + .else + _wr_cmd_id stio, 0x70,,,,,,,, \portNum, 4 + .endif +.endm + +/** + * ldio + * + * Moves the contents of either SIO[portNum] or CIO[CUR_CHANNEL][portNum] to TR + * depending on current section. + */ +.macro ldio portNum + _wr_cmd_id ldio, 0x80,0x60,,,,,,, \portNum, 4 +.endm + +/** + * ldchan + * + * Opens the sequence channel for index `channelNum` with data beginning at `label`. + */ +.macro ldchan channelNum, label + _wr_cmd_id ldchan, 0x90,0x20,,,,,,, \channelNum, 4 + _wr_lbl \label +.endm + +/** + * rldchan + * + * Opens the sequence channel for index `channelNum` with data beginning at `label`. + * `label` is a relative offset rather than an absolute offset, making it appropriate + * for use in position-independent code. + */ +.macro rldchan channelNum, label + _wr_cmd_id rldchan, 0xA0,,,,,,,, \channelNum, 4 + _wr_16_rel \label +.endm + +/** + * ldelay + * + * Delay for `delay` ticks. + */ +.macro ldelay delay + _wr_cmd_id ldelay, ,,0xC0,,,,,, 0, 0 + _var \delay +.endm + +/** + * Workaround for bugged delays using a larger encoding than is needed. + * Acts like ldelay but forces a long var encoding even if the arg can fit + * in a smaller encoding. + * Should never be used when not required for matching purposes. + */ +.macro lldelay delay + _wr_cmd_id lldelay, ,0xFD,0xC0,,,,,, 0, 0 + _var_long \delay +.endm + +/** + * shortvel + * + * Set velocity used by short notes. + */ +.macro shortvel velocity + _wr_cmd_id shortvel, ,,0xC1,,,,,, 0, 0 + _wr_u8 \velocity +.endm + +/** + * shortdelay + * + * Set delay used by short notes. + */ +.macro shortdelay delay + _wr_cmd_id shortdelay, ,,0xC3,,,,,, 0, 0 + _var \delay +.endm + +/** + * legato + * + * Enables legato on the current layer. + */ +.macro legato + _wr_cmd_id legato, ,,0xC4,,,,,, 0, 0 +.endm + +/** + * nolegato + * + * Disables legato on the current layer. + */ +.macro nolegato + _wr_cmd_id nolegato, ,,0xC5,,,,,, 0, 0 +.endm + +/** + * portamento + * + * The time argument is either a var or a u8 depending on mode + */ +.macro portamento mode, target, time + _wr_cmd_id portamento, ,,0xC7,,,,,, 0, 0 + _wr_u8 \mode + _wr_u8 \target + .if (\mode & 0x80) != 0 + _wr_u8 \time + .else + _var \time + .endif +.endm + +/** + * noportamento + * + * Disables portamento on the current layer. + */ +.macro noportamento + _wr_cmd_id noportamento, ,,0xC8,,,,,, 0, 0 +.endm + +/** + * shortgate + * + * Sets gate time for short notes. + */ +.macro shortgate gateTime + _wr_cmd_id shortgate, ,,0xC9,,,,,, 0, 0 + _wr_u8 \gateTime +.endm + +/** + * notepan + * + * Sets the pan for this layer. A value of 64 is center. + */ +.macro notepan pan + /* pan can only take values in 0..127 */ + _check_arg_bitwidth_u \pan, 7 + _wr_cmd_id notepan, ,,0xCA,,,,,, 0, 0 + _wr_u8 \pan +.endm + +/** + * nodrumpan + * + * Instructs the layer to ignore the pan value in drum instruments and only + * use pan set in the layer. + */ +.macro nodrumpan + _wr_cmd_id nodrumpan, ,,0xCC,,,,,, 0, 0 +.endm + +/** + * stereo + * + * TODO DESCRIPTION + */ +#define STEREO_OPCODE 0xCD +.macro stereo type, strongR, strongL, strongRvrbR, strongRvrbL + _check_arg_bitwidth_u \type, 2 + _check_arg_bitwidth_u \strongR, 1 + _check_arg_bitwidth_u \strongL, 1 + _check_arg_bitwidth_u \strongRvrbR, 1 + _check_arg_bitwidth_u \strongRvrbL, 1 + + _wr_cmd_id stereo, ,,STEREO_OPCODE,,,,,, 0, 0 + _wr_u8 (\type << 4) | (\strongR << 3) | (\strongL << 2) | (\strongRvrbR << 1) | (\strongRvrbL << 0) +.endm + +/** + * ldshortvel + * + * Sets the velocity used in short notes by reading from SHORTVELTBL[velocity] + */ +.macro ldshortvel velocity + _wr_cmd_id ldshortvel, ,,0xD0,,,,,, \velocity, 4 +.endm + +/** + * ldshortgate + * + * Sets the gate time used in short notes by reading from SHORTGATETBL[gateTime] + */ +.macro ldshortgate gateTime + _wr_cmd_id ldshortgate, ,,0xE0,,,,,, \gateTime, 4 +.endm + +#if (MML_VERSION == MML_VERSION_MM) + + /** + * unk_F0 + * + * TODO DESCRIPTION + */ + .macro unk_F0 arg + _wr_cmd_id unk_F0, ,,0xF0,,,,,, 0, 0 + _wr_s16 \arg + .endm + + /** + * surroundeffect + * + * TODO DESCRIPTION + */ + #define SURROUNDEFFECT_OPCODE 0xF1 + .macro surroundeffect arg + _wr_cmd_id surroundeffect, ,,SURROUNDEFFECT_OPCODE,,,,,, 0, 0 + _wr_u8 \arg + .endm + +#endif + +/** + * notedvg + * + * Plays a note with the current instrument settings for a specified length of time. + * + * pitch : The note to play. Since pitch is only 6 bits it can only hold values 0..63, for access to more values + * use `transpose` first to shift the base pitch. + * delay : The time to play the note for, plus the delay before executing the next instruction. + * velocity : The relative volume. + * gateTime : The proportion of the delay for which the sound does not play. + * + * This instruction must only be used when long notes are enabled with the noshort instruction. + */ +#define NOTEDVG_OPCODE 0x00 +.macro notedvg pitch, delay, velocity, gateTime + _wr_cmd_id notedvg, ,,0x00,,,,,, \pitch, 6 + _var \delay + _wr_u8 \velocity + _wr_u8 \gateTime +.endm + +/** + * notedv + * + * Like notedvg, but gateTime is fixed to 0 so there is no delay between when the sound stops and the next instruction. + * + * This instruction must only be used when long notes are enabled with the noshort instruction. + */ +#define NOTEDV_OPCODE 0x40 +.macro notedv pitch, delay, velocity + _wr_cmd_id notedv, ,,NOTEDV_OPCODE,,,,,, \pitch, 6 + _var \delay + _wr_u8 \velocity +.endm + +/* Workaround for bugs in vanilla sequences, force long encoding for delay. This should not typically be used. */ +.macro noteldv pitch, delay, velocity + _wr_cmd_id noteldv, ,,0x40,,,,,, \pitch, 6 + _var_long \delay + _wr_u8 \velocity +.endm + +/** + * notevg + * + * Like notedvg, but delay is assumed to be the same as the delay for a previous note instruction. + * + * This instruction must only be used when long notes are enabled with the noshort instruction. + */ +.macro notevg pitch, velocity, gateTime + _wr_cmd_id notevg, ,,0x80,,,,,, \pitch, 6 + _wr_u8 \velocity + _wr_u8 \gateTime +.endm + +/** + * shortdvg + * + * Like notedvg, but encodes shorter by requiring that the velocity and gateTime be specified in advance using the + * shortvel and shortgate instructions. + * + * This instruction must only be used when short notes are enabled with the short instruction. + */ +.macro shortdvg pitch, delay + _wr_cmd_id shortdvg, ,,0x00,,,,,, \pitch, 6 + _var \delay +.endm + +/** + * shortdv + * + * Like shortdvg, but gateTime is fixed to 0 so there is no delay between when the sound stops and the next + * instruction. Uses the delay set by shortdelay, and the velocity set by shortvel. + * + * This instruction must only be used when short notes are enabled with the short instruction. + */ +.macro shortdv pitch + _wr_cmd_id shortdv, ,,0x40,,,,,, \pitch, 6 +.endm + +/** + * shortvg + * + * Like shortdvg, but delay is assumed to be the same as the delay for a previous note instruction. Uses the velocity + * set by shortvel. + * + * This instruction must only be used when short notes are enabled with the short instruction. + */ +.macro shortvg pitch + _wr_cmd_id shortvg, ,,0x80,,,,,, \pitch, 6 +.endm + +/** + * entry + * + * For dyntable entries. + */ +.macro entry label + _wr_lbl \label +.endm + +/** + * point + * + * Envelope point + */ +.macro point delay, arg + .if ASEQ_MODE != ASEQ_MODE_ENVELOPE + _section_invalid point + .endif + + _wr_s16 \delay + _wr_s16 \arg +.endm + +/** + * disable + * + * Envelope disable + */ +.macro disable + .if ASEQ_MODE != ASEQ_MODE_ENVELOPE + _section_invalid disable + .endif + + _wr_u16 0 + _wr_s16 0 +.endm + +/** + * hang + * + * Envelope hang + */ +.macro hang + .if ASEQ_MODE != ASEQ_MODE_ENVELOPE + _section_invalid hang + .endif + + _wr_u16 0xFFFF // -1 + _wr_s16 0 +.endm + +/** + * goto + * + * Envelope goto + */ +.macro goto index + .if ASEQ_MODE != ASEQ_MODE_ENVELOPE + _section_invalid goto + .endif + + _wr_u16 0xFFFE // -2 + _wr_s16 \index +.endm + +/** + * restart + * + * Envelope restart + */ +.macro restart + .if ASEQ_MODE != ASEQ_MODE_ENVELOPE + _section_invalid restart + .endif + + _wr_u16 0xFFFD // -3 + _wr_s16 0 +.endm + +#endif /* _LANGUAGE_ASEQ */ + +#endif /* ASEQ_H */ diff --git a/include/audio/soundfont_file.h b/include/audio/soundfont_file.h new file mode 100644 index 0000000000..3f320a6e56 --- /dev/null +++ b/include/audio/soundfont_file.h @@ -0,0 +1,46 @@ +#ifndef SOUNDFONT_FILE_H +#define SOUNDFONT_FILE_H + +#include "libc/stdbool.h" +#include "alignment.h" +#include "attributes.h" +#include "z64audio.h" + +// Envelope definitions + +#define ENVELOPE_POINT(delay, target) { (delay), (target) } +#define ENVELOPE_DISABLE() { ADSR_DISABLE, 0 } +#define ENVELOPE_HANG() { ADSR_HANG, 0 } +#define ENVELOPE_GOTO(index) { ADSR_GOTO, (index) } +#define ENVELOPE_RESTART() { ADSR_RESTART, 0 } + +// Instrument definitions + +#define INSTR_SAMPLE_NONE { NULL, 0.0f } +#define INSTR_SAMPLE_LO_NONE 0 +#define INSTR_SAMPLE_HI_NONE 127 + +// Explicit padding is sometimes required where soundfont data was padded to 0x10 bytes (possibly due to source file +// splits in the original soundfonts?) +// It's less convenient for us to emit multiple files per soundfont, so instead we fill in the padding manually. + +#ifndef GLUE +#define GLUE(a,b) a##b +#endif +#ifndef GLUE2 +#define GLUE2(a,b) GLUE(a,b) +#endif + +#ifdef __sgi +// For IDO, we have to add explicit padding arrays +#define SF_PAD4() static u8 GLUE2(_pad, __LINE__) [] = { 0,0,0,0 } +#define SF_PAD8() static u8 GLUE2(_pad, __LINE__) [] = { 0,0,0,0,0,0,0,0 } +#define SF_PADC() static u8 GLUE2(_pad, __LINE__) [] = { 0,0,0,0,0,0,0,0,0,0,0,0 } +#else +// For other compilers, the soundfont compiler (sfc) emits alignment attributes that handle this automatically +#define SF_PAD4() +#define SF_PAD8() +#define SF_PADC() +#endif + +#endif diff --git a/include/audiomgr.h b/include/audiomgr.h index 036192ce7c..b518c976a5 100644 --- a/include/audiomgr.h +++ b/include/audiomgr.h @@ -4,13 +4,13 @@ #include "sched.h" #include "z64audio.h" -typedef enum { +typedef enum AudioMgrDebugLevel { /* 0 */ AUDIOMGR_DEBUG_LEVEL_NONE, /* 1 */ AUDIOMGR_DEBUG_LEVEL_NO_RSP, /* 2 */ AUDIOMGR_DEBUG_LEVEL_NO_UPDATE } AudioMgrDebugLevel; -typedef struct { +typedef struct AudioMgr { /* 0x0000 */ IrqMgr* irqMgr; /* 0x0004 */ Scheduler* sched; /* 0x0008 */ OSScTask audioTask; diff --git a/include/audiothread_cmd.h b/include/audiothread_cmd.h index ab0ea1c176..c0576b82b3 100644 --- a/include/audiothread_cmd.h +++ b/include/audiothread_cmd.h @@ -6,7 +6,7 @@ * from the external graph thread to the internal audio thread */ -typedef enum { +typedef enum AudioThreadCmdOp { // Channel Commands /* 0x00 */ AUDIOCMD_OP_NOOP, /* 0x01 */ AUDIOCMD_OP_CHANNEL_SET_VOL_SCALE, diff --git a/include/cic6105.h b/include/cic6105.h new file mode 100644 index 0000000000..43ffcc4f98 --- /dev/null +++ b/include/cic6105.h @@ -0,0 +1,14 @@ +#ifndef CIC6105_H +#define CIC6105_H + +#include "ultra64.h" + +extern s32 B_80008EE0; + +void func_800014E8(void); +void CIC6105_AddFaultClient(void); +void CIC6105_RemoveFaultClient(void); +void func_80001640(void); +void func_80001720(void); + +#endif diff --git a/include/color.h b/include/color.h index 723983f83a..816d38349d 100644 --- a/include/color.h +++ b/include/color.h @@ -1,11 +1,13 @@ #ifndef COLOR_H #define COLOR_H -typedef struct { +#include "ultra64/ultratypes.h" + +typedef struct Color_RGB8 { u8 r, g, b; } Color_RGB8; -typedef struct { +typedef struct Color_RGBA8 { u8 r, g, b, a; } Color_RGBA8; @@ -17,11 +19,11 @@ typedef union Color_RGBA8_u32 { u32 rgba; } Color_RGBA8_u32; -typedef struct { +typedef struct Color_RGBAf { f32 r, g, b, a; } Color_RGBAf; -typedef union { +typedef union Color_RGBA16 { struct { u16 r : 5; u16 g : 5; diff --git a/include/controller.h b/include/controller.h new file mode 100644 index 0000000000..dbc850aa21 --- /dev/null +++ b/include/controller.h @@ -0,0 +1,27 @@ +#ifndef CONTROLLER_H +#define CONTROLLER_H + +#define BTN_A 0x8000 +#define BTN_B 0x4000 +#define BTN_Z 0x2000 +#define BTN_START 0x1000 +#define BTN_DUP 0x0800 +#define BTN_DDOWN 0x0400 +#define BTN_DLEFT 0x0200 +#define BTN_DRIGHT 0x0100 +#define BTN_L 0x0020 +#define BTN_R 0x0010 +#define BTN_CUP 0x0008 +#define BTN_CDOWN 0x0004 +#define BTN_CLEFT 0x0002 +#define BTN_CRIGHT 0x0001 + +#define CHECK_BTN_ANY(state, combo) (((state) & (combo)) != 0) + +#if PLATFORM_N64 +#define CHECK_BTN_ALL(state, combo) (((state) & (combo)) == (combo)) +#else +#define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0) +#endif + +#endif diff --git a/include/face_change.h b/include/face_change.h index 6a5573765a..5a0c8d8566 100644 --- a/include/face_change.h +++ b/include/face_change.h @@ -1,7 +1,7 @@ #ifndef FACE_CHANGE_H #define FACE_CHANGE_H -typedef struct { +typedef struct FaceChange { /* 0x00 */ s16 face; /* 0x02 */ s16 timer; } FaceChange; // size = 0x4 diff --git a/include/fault.h b/include/fault.h index df125487e5..a95ae59064 100644 --- a/include/fault.h +++ b/include/fault.h @@ -5,6 +5,7 @@ #include "attributes.h" #include "padmgr.h" +#if PLATFORM_GC // These are the same as the 3-bit ansi color codes #define FAULT_COLOR_BLACK 0 #define FAULT_COLOR_RED 1 @@ -23,6 +24,7 @@ #define FAULT_ESC '\x1A' #define FAULT_COLOR(n) "\x1A" FAULT_COLOR_EXPAND_AND_STRINGIFY(FAULT_COLOR_ ## n) +#endif typedef struct FaultClient { /* 0x00 */ struct FaultClient* next; @@ -31,11 +33,13 @@ typedef struct FaultClient { /* 0x0C */ void* arg1; } FaultClient; // size = 0x10 +#if PLATFORM_GC typedef struct FaultAddrConvClient { /* 0x00 */ struct FaultAddrConvClient* next; /* 0x04 */ void* callback; /* 0x08 */ void* arg; } FaultAddrConvClient; // size = 0xC +#endif // Initialization @@ -51,27 +55,54 @@ NORETURN void Fault_AddHungupAndCrash(const char* file, int line); void Fault_AddClient(FaultClient* client, void* callback, void* arg0, void* arg1); void Fault_RemoveClient(FaultClient* client); +#if PLATFORM_GC void Fault_AddAddrConvClient(FaultAddrConvClient* client, void* callback, void* arg); void Fault_RemoveAddrConvClient(FaultAddrConvClient* client); +#endif // For use in Fault Client callbacks -void Fault_WaitForInput(void); -void Fault_FillScreenBlack(void); void Fault_SetFrameBuffer(void* fb, u16 w, u16 h); -void FaultDrawer_SetForeColor(u16 color); -void FaultDrawer_SetBackColor(u16 color); -void FaultDrawer_SetFontColor(u16 color); -void FaultDrawer_SetCharPad(s8 padW, s8 padH); -void FaultDrawer_SetCursor(s32 x, s32 y); -s32 FaultDrawer_VPrintf(const char* fmt, va_list args); -s32 FaultDrawer_Printf(const char* fmt, ...); -void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...); +void Fault_WaitForInput(void); + +void Fault_SetCursor(s32 x, s32 y); +s32 Fault_Printf(const char* fmt, ...); +void Fault_DrawText(s32 x, s32 y, const char* fmt, ...); + +#if PLATFORM_N64 + +void func_800AE1F8(void); + +// Not implemented. Silently noop-ing is fine, these are not essential for functionality. +#define Fault_SetFontColor(color) (void)0 +#define Fault_SetCharPad(padW, padH) (void)0 + +#elif PLATFORM_GC + +void Fault_InitDrawer(void); +void Fault_SetForeColor(u16 color); +void Fault_SetBackColor(u16 color); +void Fault_SetFontColor(u16 color); +void Fault_SetCharPad(s8 padW, s8 padH); +s32 Fault_VPrintf(const char* fmt, va_list args); + +#endif + +#if PLATFORM_N64 + +extern vs32 gFaultExit; +extern vs32 gFaultMsgId; +extern vs32 gFaultDisplayEnable; +extern volatile OSThread* gFaultFaultedThread; + +#define FAULT_MSG_ID gFaultMsgId + +#elif PLATFORM_GC typedef struct FaultMgr { /* 0x000 */ OSThread thread; - /* 0x1B0 */ char unk_1B0[0x600]; // probably an unused internal thread stack for `Fault_ClientRunTask`/`clientThreadSp` + /* 0x1B0 */ char unk_1B0[0x600]; /* 0x7B0 */ OSMesgQueue queue; /* 0x7C8 */ OSMesg msg; /* 0x7CC */ u8 exit; @@ -84,10 +115,14 @@ typedef struct FaultMgr { /* 0x7DC */ FaultAddrConvClient* addrConvClients; /* 0x7E0 */ char unk_7E0[0x4]; /* 0x7E4 */ Input inputs[MAXCONTROLLERS]; - /* 0x844 */ void* fb; + /* 0x844 */ u16* fb; /* 0x848 */ void* clientThreadSp; } FaultMgr; // size = 0x850 extern FaultMgr gFaultMgr; +#define FAULT_MSG_ID gFaultMgr.msgId + +#endif + #endif diff --git a/include/functions.h b/include/functions.h index 753b6b4834..1e94ddb2dc 100644 --- a/include/functions.h +++ b/include/functions.h @@ -4,7 +4,6 @@ #include "z64.h" #include "macros.h" -void cleararena(void); void bootproc(void); void Main_ThreadEntry(void* arg); void Idle_ThreadEntry(void* arg); @@ -22,12 +21,6 @@ NORETURN void func_80002384(const char* exp, const char* file, int line); #endif OSPiHandle* osDriveRomInit(void); void Mio0_Decompress(u8* src, u8* dst); -void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 initValue, s32 minSpace, - const char* name); -void StackCheck_Cleanup(StackEntry* entry); -u32 StackCheck_GetState(StackEntry* entry); -u32 StackCheck_CheckAll(void); -u32 StackCheck_Check(StackEntry* entry); #if IS_DEBUG void LogUtils_LogHexDump(void* ptr, s32 size0); void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, int line); @@ -36,700 +29,18 @@ void LogUtils_LogThreadId(const char* name, int line); #endif void LogUtils_HungupThread(const char* name, int line); void LogUtils_ResetHungup(void); -void __osPiCreateAccessQueue(void); -void __osPiGetAccess(void); -void __osPiRelAccess(void); -s32 osSendMesg(OSMesgQueue* mq, OSMesg msg, s32 flag); -void osStopThread(OSThread* thread); -void osViExtendVStart(u32 value); -s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flag); -void __osInitialize_common(void); -void __osInitialize_autodetect(void); -void __osEnqueueAndYield(OSThread**); -void __osEnqueueThread(OSThread**, OSThread*); -OSThread* __osPopThread(OSThread**); -void __osDispatchThread(void); -void __osCleanupThread(void); -void __osDequeueThread(OSThread** queue, OSThread* thread); -void osDestroyThread(OSThread* thread); -void osCreateThread(OSThread* thread, OSId id, void (*entry)(void*), void* arg, void* sp, OSPri pri); -void __osSetSR(u32); -u32 __osGetSR(void); -void osWritebackDCache(void* vaddr, s32 nbytes); -void* osViGetNextFramebuffer(void); -void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQueue, OSMesg* cmdBuf, s32 cmdMsgCnt); -void __osDevMgrMain(void* arg); -s32 __osPiRawStartDma(s32 dir, u32 cartAddr, void* dramAddr, size_t size); -u32 osVirtualToPhysical(void* vaddr); -void osViBlack(u8 active); -s32 __osSiRawReadIo(void* devAddr, u32* dst); -OSId osGetThreadId(OSThread* thread); -void osViSetMode(OSViMode* mode); -u32 __osProbeTLB(void*); -u32 osGetMemSize(void); -void osSetEventMesg(OSEvent e, OSMesgQueue* mq, OSMesg msg); -void osUnmapTLBAll(void); -s32 osEPiStartDma(OSPiHandle* handle, OSIoMesg* mb, s32 direction); -void osInvalICache(void* vaddr, s32 nbytes); -void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msg, s32 count); -void osInvalDCache(void* vaddr, s32 nbytes); -s32 __osSiDeviceBusy(void); -s32 osJamMesg(OSMesgQueue* mq, OSMesg msg, s32 flag); -void osSetThreadPri(OSThread* thread, OSPri pri); -OSPri osGetThreadPri(OSThread* thread); -s32 __osEPiRawReadIo(OSPiHandle* handle, u32 devAddr, u32* data); -void osViSwapBuffer(void* frameBufPtr); -s32 __osEPiRawStartDma(OSPiHandle* handle, s32 direction, u32 cartAddr, void* dramAddr, size_t size); -OSTime osGetTime(void); -void __osTimerServicesInit(void); -void __osTimerInterrupt(void); -void __osSetTimerIntr(OSTime time); -OSTime __osInsertTimer(OSTimer* timer); -u32 osGetCount(void); -void __osSetCompare(u32); -s32 __osDisableInt(void); -void __osRestoreInt(s32); -void __osViInit(void); -void __osViSwapContext(void); -OSMesgQueue* osPiGetCmdQueue(void); -s32 osEPiReadIo(OSPiHandle* handle, u32 devAddr, u32* data); -void osViSetSpecialFeatures(u32 func); -OSPiHandle* osCartRomInit(void); -void __osSetFpcCsr(u32); -u32 __osGetFpcCsr(void); -s32 osEPiWriteIo(OSPiHandle* handle, u32 devAddr, u32 data); -void osMapTLBRdb(void); -void osYieldThread(void); -u32 __osGetCause(void); -s32 __osEPiRawWriteIo(OSPiHandle* handle, u32 devAddr, u32 data); -s32 __osSiRawWriteIo(void* devAddr, u32 val); -void osCreateViManager(OSPri pri); -OSViContext* __osViGetCurrentContext(void); -void osStartThread(OSThread* thread); -void osViSetYScale(f32 scale); -void osViSetXScale(f32 value); -void __osSetWatchLo(u32); EnItem00* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, s16 params); EnItem00* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s16 params); void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnPos, s16 params); -void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2); -void EffectBlure_AddSpace(EffectBlure* this); -void EffectBlure_Init1(void* thisx, void* initParamsx); -void EffectBlure_Init2(void* thisx, void* initParamsx); -void EffectBlure_Destroy(void* thisx); -s32 EffectBlure_Update(void* thisx); -void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx); -void EffectShieldParticle_Init(void* thisx, void* initParamsx); -void EffectShieldParticle_Destroy(void* thisx); -s32 EffectShieldParticle_Update(void* thisx); -void EffectShieldParticle_Draw(void* thisx, GraphicsContext* gfxCtx); -void EffectSpark_Init(void* thisx, void* initParamsx); -void EffectSpark_Destroy(void* thisx); -s32 EffectSpark_Update(void* thisx); -void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx); -void func_80026230(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3); -void func_80026400(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3); -void func_80026608(PlayState* play); -void func_80026690(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3); -void func_80026860(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3); -void func_80026A6C(PlayState* play); -PlayState* Effect_GetPlayState(void); -void* Effect_GetByIndex(s32 index); -void Effect_InitContext(PlayState* play); -void Effect_Add(PlayState* play, s32* pIndex, s32 type, u8 arg3, u8 arg4, void* initParams); -void Effect_DrawAll(GraphicsContext* gfxCtx); -void Effect_UpdateAll(PlayState* play); -void Effect_Delete(PlayState* play, s32 index); -void Effect_DeleteAll(PlayState* play); -void EffectSs_InitInfo(PlayState* play, s32 tableSize); -void EffectSs_ClearAll(PlayState* play); -void EffectSs_Delete(EffectSs* effectSs); -void EffectSs_Reset(EffectSs* effectSs); -void EffectSs_Insert(PlayState* play, EffectSs* effectSs); -void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initParams); -void EffectSs_UpdateAll(PlayState* play); -void EffectSs_DrawAll(PlayState* play); -s16 EffectSs_LerpInv(s16 a, s16 b, s32 weightInv); -s16 EffectSs_LerpS16(s16 a, s16 b, f32 weight); -u8 EffectSs_LerpU8(u8 a, u8 b, f32 weight); -void EffectSs_DrawGEffect(PlayState* play, EffectSs* this, void* texture); -void EffectSsDust_Spawn(PlayState* play, u16 drawFlags, Vec3f* pos, Vec3f* velocity, Vec3f* accel, - Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life, - u8 updateMode); -void func_8002829C(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor, s16 scale, s16 scaleStep); -void func_80028304(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor, s16 scale, s16 scaleStep); -void func_8002836C(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); -void func_800283D4(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); -void func_8002843C(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); -void func_800284A4(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor, s16 scale, s16 scaleStep); -void func_80028510(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor, s16 scale, s16 scaleStep); -void func_8002857C(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel); -void func_800285EC(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel); -void func_8002865C(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep); -void func_800286CC(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep); -void func_8002873C(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, - s16 life); -void func_800287AC(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, - s16 life); -void func_8002881C(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor); -void func_80028858(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor); -void func_80028990(PlayState* play, f32 randScale, Vec3f* srcPos); -void func_80028A54(PlayState* play, f32 randScale, Vec3f* srcPos); -void EffectSsKiraKira_SpawnSmallYellow(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel); -void EffectSsKiraKira_SpawnSmall(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, - Color_RGBA8* primColor, Color_RGBA8* envColor); -void EffectSsKiraKira_SpawnDispersed(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, - Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s32 life); -void EffectSsKiraKira_SpawnFocused(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, - Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s32 life); -void EffectSsBomb_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel); -void EffectSsBomb2_SpawnFade(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel); -void EffectSsBomb2_SpawnLayered(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, - s16 scaleStep); -void EffectSsBlast_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* innerColor, - Color_RGBA8* outerColor, s16 scale, s16 scaleStep, s16 scaleStepDecay, s16 life); -void EffectSsBlast_SpawnWhiteShockwaveSetScale(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, - s16 scaleStep, s16 life); -void EffectSsBlast_SpawnShockwaveSetColor(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, - Color_RGBA8* innerColor, Color_RGBA8* outerColor, s16 life); -void EffectSsBlast_SpawnWhiteShockwave(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel); -void EffectSsGSpk_SpawnAccel(PlayState* play, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel, - Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep); -void EffectSsGSpk_SpawnNoAccel(PlayState* play, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel, - Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep); -void EffectSsGSpk_SpawnFuse(PlayState* play, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel); -void EffectSsGSpk_SpawnRandColor(PlayState* play, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel, - s16 scale, s16 scaleStep); -void EffectSsGSpk_SpawnSmall(PlayState* play, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel, - Color_RGBA8* primColor, Color_RGBA8* envColor); -void EffectSsDFire_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, - s16 alpha, s16 fadeDelay, s32 life); -void EffectSsDFire_SpawnFixedScale(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 alpha, - s16 fadeDelay); -void EffectSsBubble_Spawn(PlayState* play, Vec3f* pos, f32 yPosOffset, f32 yPosRandScale, f32 xzPosRandScale, - f32 scale); -void EffectSsGRipple_Spawn(PlayState* play, Vec3f* pos, s16 radius, s16 radiusMax, s16 life); -void EffectSsGSplash_Spawn(PlayState* play, Vec3f* pos, Color_RGBA8* primColor, Color_RGBA8* envColor, - s16 type, s16 scale); -void EffectSsGMagma_Spawn(PlayState* play, Vec3f* pos); -void EffectSsGFire_Spawn(PlayState* play, Vec3f* pos); -void EffectSsLightning_Spawn(PlayState* play, Vec3f* pos, Color_RGBA8* primColor, Color_RGBA8* envColor, - s16 scale, s16 yaw, s16 life, s16 numBolts); -void EffectSsDtBubble_SpawnColorProfile(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, - s16 life, s16 colorProfile, s16 randXZ); -void EffectSsDtBubble_SpawnCustomColor(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, - Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 life, s16 randXZ); -void EffectSsHahen_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 unused, s16 scale, - s16 objId, s16 life, Gfx* dList); -void EffectSsHahen_SpawnBurst(PlayState* play, Vec3f* pos, f32 burstScale, s16 unused, s16 scale, - s16 randScaleRange, s16 count, s16 objId, s16 life, Gfx* dList); -void EffectSsStick_Spawn(PlayState* play, Vec3f* pos, s16 yaw); -void EffectSsSibuki_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 moveDelay, - s16 direction, s16 scale); -void EffectSsSibuki_SpawnBurst(PlayState* play, Vec3f* pos); -void EffectSsSibuki2_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale); -void EffectSsGMagma2_Spawn(PlayState* play, Vec3f* pos, Color_RGBA8* primColor, Color_RGBA8* envColor, - s16 updateRate, s16 drawMode, s16 scale); -void EffectSsStone1_Spawn(PlayState* play, Vec3f* pos, s32 arg2); -void EffectSsHitMark_Spawn(PlayState* play, s32 type, s16 scale, Vec3f* pos); -void EffectSsHitMark_SpawnFixedScale(PlayState* play, s32 type, Vec3f* pos); -void EffectSsHitMark_SpawnCustomScale(PlayState* play, s32 type, s16 scale, Vec3f* pos); -void EffectSsFhgFlash_SpawnLightBall(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, - u8 param); -void EffectSsFhgFlash_SpawnShock(PlayState* play, Actor* actor, Vec3f* pos, s16 scale, u8 param); -void EffectSsKFire_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scaleMax, u8 type); -void EffectSsSolderSrchBall_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 unused, - s16* linkDetected); -void EffectSsKakera_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* arg3, s16 gravity, s16 arg5, - s16 arg6, s16 arg7, s16 arg8, s16 scale, s16 arg10, s16 arg11, s32 life, s16 colorIdx, - s16 objId, Gfx* dList); -void EffectSsIcePiece_Spawn(PlayState* play, Vec3f* pos, f32 scale, Vec3f* velocity, Vec3f* accel, s32 life); -void EffectSsIcePiece_SpawnBurst(PlayState* play, Vec3f* refPos, f32 scale); -void EffectSsEnIce_SpawnFlyingVec3f(PlayState* play, Actor* actor, Vec3f* pos, s16 primR, s16 primG, s16 primB, - s16 primA, s16 envR, s16 envG, s16 envB, f32 scale); -void EffectSsEnIce_SpawnFlyingVec3s(PlayState* play, Actor* actor, Vec3s* pos, s16 primR, s16 primG, s16 primB, - s16 primA, s16 envR, s16 envG, s16 envB, f32 scale); -void EffectSsEnIce_Spawn(PlayState* play, Vec3f* pos, f32 scale, Vec3f* velocity, Vec3f* accel, - Color_RGBA8* primColor, Color_RGBA8* envColor, s32 life); -void EffectSsFireTail_Spawn(PlayState* play, Actor* actor, Vec3f* pos, f32 scale, Vec3f* arg4, s16 arg5, - Color_RGBA8* primColor, Color_RGBA8* envColor, s16 type, s16 bodyPart, s32 life); -void EffectSsFireTail_SpawnFlame(PlayState* play, Actor* actor, Vec3f* pos, f32 arg3, s16 bodyPart, - f32 colorIntensity); -void EffectSsFireTail_SpawnFlameOnPlayer(PlayState* play, f32 scale, s16 bodyPart, f32 colorIntensity); -void EffectSsEnFire_SpawnVec3f(PlayState* play, Actor* actor, Vec3f* pos, s16 scale, s16 arg4, s16 flags, s16 bodyPart); -void EffectSsEnFire_SpawnVec3s(PlayState* play, Actor* actor, Vec3s* pos, s16 scale, s16 arg4, s16 flags, s16 bodyPart); -void EffectSsExtra_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scoreIdx); -void EffectSsFCircle_Spawn(PlayState* play, Actor* actor, Vec3f* pos, s16 radius, s16 height); -void EffectSsDeadDb_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, - s16 primR, s16 primG, s16 primB, s16 primA, s16 envR, s16 envG, s16 envB, s16 unused, - s32 arg14, s16 playSfx); -void EffectSsDeadDd_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, - s16 primR, s16 primG, s16 primB, s16 alpha, s16 envR, s16 envG, s16 envB, s16 alphaStep, - s32 life); -void EffectSsDeadDd_SpawnRandYellow(PlayState* play, Vec3f* pos, s16 scale, s16 scaleStep, f32 randPosScale, - s32 randIter, s32 life); -void EffectSsDeadDs_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, - s16 alpha, s32 life); -void EffectSsDeadDs_SpawnStationary(PlayState* play, Vec3f* pos, s16 scale, s16 scaleStep, s16 alpha, - s32 life); -void EffectSsDeadSound_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, u16 sfxId, - s16 lowerPriority, s16 repeatMode, s32 life); -void EffectSsDeadSound_SpawnStationary(PlayState* play, Vec3f* pos, u16 sfxId, s16 lowerPriority, - s16 repeatMode, s32 life); -void EffectSsIceSmoke_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale); void FlagSet_Update(PlayState* play); // ENABLE_EVENT_EDITOR void Overlay_LoadGameState(GameStateOverlay* overlayEntry); void Overlay_FreeGameState(GameStateOverlay* overlayEntry); -void ActorShape_Init(ActorShape* shape, f32 yOffset, ActorShadowFunc shadowDraw, f32 shadowScale); -void ActorShadow_DrawCircle(Actor* actor, Lights* lights, PlayState* play); -void ActorShadow_DrawWhiteCircle(Actor* actor, Lights* lights, PlayState* play); -void ActorShadow_DrawHorse(Actor* actor, Lights* lights, PlayState* play); -void ActorShadow_DrawFeet(Actor* actor, Lights* lights, PlayState* play); -void Actor_SetFeetPos(Actor* actor, s32 limbIndex, s32 leftFootIndex, Vec3f* leftFootPos, s32 rightFootIndex, - Vec3f* rightFootPos); -void Actor_ProjectPos(PlayState* play, Vec3f* src, Vec3f* xyzDest, f32* cappedInvWDest); -void func_8002C124(TargetContext* targetCtx, PlayState* play); -s32 Flags_GetSwitch(PlayState* play, s32 flag); -void Flags_SetSwitch(PlayState* play, s32 flag); -void Flags_UnsetSwitch(PlayState* play, s32 flag); -s32 Flags_GetUnknown(PlayState* play, s32 flag); -void Flags_SetUnknown(PlayState* play, s32 flag); -void Flags_UnsetUnknown(PlayState* play, s32 flag); -s32 Flags_GetTreasure(PlayState* play, s32 flag); -void Flags_SetTreasure(PlayState* play, s32 flag); -s32 Flags_GetClear(PlayState* play, s32 flag); -void Flags_SetClear(PlayState* play, s32 flag); -void Flags_UnsetClear(PlayState* play, s32 flag); -s32 Flags_GetTempClear(PlayState* play, s32 flag); -void Flags_SetTempClear(PlayState* play, s32 flag); -void Flags_UnsetTempClear(PlayState* play, s32 flag); -s32 Flags_GetCollectible(PlayState* play, s32 flag); -void Flags_SetCollectible(PlayState* play, s32 flag); -void TitleCard_InitBossName(PlayState* play, TitleCardContext* titleCtx, void* texture, s16 x, s16 y, u8 width, - u8 height); -void TitleCard_InitPlaceName(PlayState* play, TitleCardContext* titleCtx, void* texture, s32 x, s32 y, - s32 width, s32 height, s32 delay); -s32 TitleCard_Clear(PlayState* play, TitleCardContext* titleCtx); -void Actor_Kill(Actor* actor); -void Actor_SetFocus(Actor* actor, f32 yOffset); -void Actor_SetScale(Actor* actor, f32 scale); -void Actor_SetObjectDependency(PlayState* play, Actor* actor); -void Actor_UpdatePos(Actor* actor); -void Actor_UpdateVelocityXZGravity(Actor* actor); -void Actor_MoveXZGravity(Actor* actor); -void Actor_UpdateVelocityXYZ(Actor* actor); -void Actor_MoveXYZ(Actor* actor); -void Actor_SetProjectileSpeed(Actor* actor, f32 speedXYZ); -s16 Actor_WorldYawTowardActor(Actor* origin, Actor* target); -s16 Actor_FocusYawTowardActor(Actor* origin, Actor* target); -s16 Actor_WorldYawTowardPoint(Actor* origin, Vec3f* point); -f32 Actor_WorldDistXYZToActor(Actor* actorA, Actor* actorB); -f32 Actor_WorldDistXYZToPoint(Actor* actor, Vec3f* refPoint); -s16 Actor_WorldPitchTowardActor(Actor* actorA, Actor* actorB); -s16 Actor_WorldPitchTowardPoint(Actor* actor, Vec3f* refPoint); -f32 Actor_WorldDistXZToActor(Actor* actorA, Actor* actorB); -f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint); -void func_8002DBD0(Actor* actor, Vec3f* dest, Vec3f* pos); -f32 Actor_HeightDiff(Actor* actorA, Actor* actorB); -f32 Player_GetHeight(Player* player); -f32 func_8002DCE4(Player* player); -int func_8002DD6C(Player* player); -int func_8002DD78(Player* player); -s32 func_8002DDE4(PlayState* play); -s32 func_8002DDF4(PlayState* play); -void func_8002DE04(PlayState* play, Actor* actorA, Actor* actorB); -void func_8002DE74(PlayState* play, Player* player); -void Actor_MountHorse(PlayState* play, Player* player, Actor* horse); -int func_8002DEEC(Player* player); -void func_8002DF18(PlayState* play, Player* player); -s32 Player_SetCsAction(PlayState* play, Actor* csActor, u8 csAction); -s32 Player_SetCsActionWithHaltedActors(PlayState* play, Actor* csActor, u8 csAction); -void func_8002DF90(DynaPolyActor* dynaActor); -void func_8002DFA4(DynaPolyActor* dynaActor, f32 arg1, s16 arg2); -s32 Player_IsFacingActor(Actor* actor, s16 maxAngle, PlayState* play); -s32 Actor_ActorBIsFacingActorA(Actor* actorA, Actor* actorB, s16 maxAngle); -s32 Actor_IsFacingPlayer(Actor* actor, s16 maxAngle); -s32 Actor_ActorAIsFacingActorB(Actor* actorA, Actor* actorB, s16 maxAngle); -s32 Actor_IsFacingAndNearPlayer(Actor* actor, f32 range, s16 maxAngle); -s32 Actor_ActorAIsFacingAndNearActorB(Actor* actorA, Actor* actorB, f32 range, s16 maxAngle); -void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight, f32 wallCheckRadius, - f32 ceilingCheckHeight, s32 flags); -Hilite* func_8002EABC(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_8002ED80(Actor* actor, PlayState* play, s32 flag); -PosRot Actor_GetFocus(Actor* actor); -PosRot Actor_GetWorld(Actor* actor); -PosRot Actor_GetWorldPosShapeRot(Actor* actor); -s32 func_8002F0C8(Actor* actor, Player* player, s32 flag); -s32 Actor_TalkOfferAccepted(Actor* actor, PlayState* play); -s32 Actor_OfferTalkExchange(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, u32 exchangeItemId); -s32 Actor_OfferTalkExchangeEquiCylinder(Actor* actor, PlayState* play, f32 radius, u32 exchangeItemId); -s32 Actor_OfferTalk(Actor* actor, PlayState* play, f32 radius); -s32 Actor_OfferTalkNearColChkInfoCylinder(Actor* actor, PlayState* play); -u32 Actor_TextboxIsClosing(Actor* actor, PlayState* play); -s8 func_8002F368(PlayState* play); -void Actor_GetScreenPos(PlayState* play, Actor* actor, s16* x, s16* y); -u32 Actor_HasParent(Actor* actor, PlayState* play); -s32 Actor_OfferGetItem(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange, f32 yRange); -s32 Actor_OfferGetItemNearby(Actor* actor, PlayState* play, s32 getItemId); -s32 Actor_OfferCarry(Actor* actor, PlayState* play); -u32 Actor_HasNoParent(Actor* actor, PlayState* play); -void func_8002F5C4(Actor* actorA, Actor* actorB, PlayState* play); -void Actor_SetClosestSecretDistance(Actor* actor, PlayState* play); -s32 Actor_IsMounted(PlayState* play, Actor* horse); -u32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide); -s32 Actor_NotMounted(PlayState* play, Actor* horse); -void func_8002F698(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6); -void func_8002F6D4(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5); -void func_8002F71C(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4); -void func_8002F758(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5); -void func_8002F7A0(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4); -void Player_PlaySfx(Player* player, u16 sfxId); -void Actor_PlaySfx(Actor* actor, u16 sfxId); -void func_8002F850(PlayState* play, Actor* actor); -void func_8002F8F0(Actor* actor, u16 sfxId); -void func_8002F91C(Actor* actor, u16 sfxId); -void func_8002F948(Actor* actor, u16 sfxId); -void func_8002F974(Actor* actor, u16 sfxId); -void func_8002F994(Actor* actor, s32 timer); -s32 func_8002F9EC(PlayState* play, Actor* actor, CollisionPoly* poly, s32 bgId, Vec3f* pos); -void Actor_DisableLens(PlayState* play); -void Actor_InitContext(PlayState* play, ActorContext* actorCtx, ActorEntry* playerEntry); -void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx); -s32 func_800314D4(PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3); -void func_800315AC(PlayState* play, ActorContext* actorCtx); -void Actor_KillAllWithMissingObject(PlayState* play, ActorContext* actorCtx); -void func_80031B14(PlayState* play, ActorContext* actorCtx); -void func_80031C3C(ActorContext* actorCtx, PlayState* play); -Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, - s16 rotX, s16 rotY, s16 rotZ, s16 params); -Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, PlayState* play, s16 actorId, f32 posX, - f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params); -void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx); -Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, PlayState* play); -Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play); -Actor* func_80032AF0(PlayState* play, ActorContext* actorCtx, Actor** actorPtr, Player* player); -Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorCategory); -void Enemy_StartFinishingBlow(PlayState* play, Actor* actor); -void BodyBreak_Alloc(BodyBreak* bodyBreak, s32 count, PlayState* play); -void BodyBreak_SetInfo(BodyBreak* bodyBreak, s32 limbIndex, s32 minLimbIndex, s32 maxLimbIndex, u32 count, Gfx** dList, - s16 objectSlot); -s32 BodyBreak_SpawnParts(Actor* actor, BodyBreak* bodyBreak, PlayState* play, s16 type); -void Actor_SpawnFloorDustRing(PlayState* play, Actor* actor, Vec3f* posXZ, f32 radius, s32 amountMinusOne, - f32 randAccelWeight, s16 scale, s16 scaleStep, u8 useLighting); -void func_80033480(PlayState* play, Vec3f* posBase, f32 randRangeDiameter, s32 amountMinusOne, s16 scaleBase, - s16 scaleStep, u8 arg6); -Actor* Actor_GetCollidedExplosive(PlayState* play, Collider* collider); -Actor* func_80033684(PlayState* play, Actor* explosiveActor); -Actor* Actor_GetProjectileActor(PlayState* play, Actor* refActor, f32 radius); -void Actor_ChangeCategory(PlayState* play, ActorContext* actorCtx, Actor* actor, u8 actorCategory); -void Actor_SetTextWithPrefix(PlayState* play, Actor* actor, s16 baseTextId); -s16 Actor_TestFloorInDirection(Actor* actor, PlayState* play, f32 distance, s16 angle); -s32 Actor_IsTargeted(PlayState* play, Actor* actor); -s32 Actor_OtherIsTargeted(PlayState* play, Actor* actor); -f32 func_80033AEC(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5); -void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play); -void Actor_RequestQuake(PlayState* play, s16 y, s16 duration); -void Actor_RequestQuakeWithSpeed(PlayState* play, s16 y, s16 duration, s16 speed); -void Actor_RequestQuakeAndRumble(Actor* actor, PlayState* play, s16 quakeY, s16 quakeDuration); -f32 Rand_ZeroFloat(f32 f); -f32 Rand_CenteredFloat(f32 f); -void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type); -void func_8003424C(PlayState* play, Vec3f* arg1); -void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s16 bufFlag, s16 duration); -Hilite* func_800342EC(Vec3f* object, PlayState* play); -Hilite* func_8003435C(Vec3f* object, PlayState* play); -s32 Npc_UpdateTalking(PlayState* play, Actor* actor, s16* talkState, f32 interactRange, - NpcGetTextIdFunc getTextId, NpcUpdateTalkStateFunc updateTalkState); -s16 Npc_GetTrackingPresetMaxPlayerYaw(s16 presetIndex); -void Npc_TrackPoint(Actor* actor, NpcInteractInfo* interactInfo, s16 presetIndex, - s16 trackingMode); -void func_80034BA0(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, - PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); -void func_80034CC4(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, - PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); -s16 func_80034DD4(Actor* actor, PlayState* play, s16 arg2, f32 arg3); -void func_80034F54(PlayState* play, s16* arg1, s16* arg2, s32 arg3); -void Actor_Noop(Actor* actor, PlayState* play); -void Gfx_DrawDListOpa(PlayState* play, Gfx* dlist); -void Gfx_DrawDListXlu(PlayState* play, Gfx* dlist); -Actor* Actor_FindNearby(PlayState* play, Actor* refActor, s16 actorId, u8 actorCategory, f32 range); -s32 func_800354B4(PlayState* play, Actor* actor, f32 range, s16 arg3, s16 arg4, s16 arg5); -void func_8003555C(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel); -void func_800355B8(PlayState* play, Vec3f* pos); -u8 func_800355E4(PlayState* play, Collider* collider); -u8 Actor_ApplyDamage(Actor* actor); -void Actor_SetDropFlag(Actor* actor, ColliderElement* elem, s32 freezeFlag); -void Actor_SetDropFlagJntSph(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag); -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, - PlayState* play, s16 params, Gfx* dList); -void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2); -s32 Flags_GetEventChkInf(s32 flag); -void Flags_SetEventChkInf(s32 flag); -s32 Flags_GetInfTable(s32 flag); -void Flags_SetInfTable(s32 flag); -u16 func_80037C30(PlayState* play, s16 arg1); -s32 func_80037D98(PlayState* play, Actor* actor, s16 arg2, s32* arg3); -s32 Actor_TrackPlayer(PlayState* play, Actor* actor, Vec3s* headRot, Vec3s* torsoRot, Vec3f focusPos); + void ActorOverlayTable_LogPrint(void); void ActorOverlayTable_Init(void); void ActorOverlayTable_Cleanup(void); -void func_80038A28(CollisionPoly* poly, f32 tx, f32 ty, f32 tz, MtxF* dest); -f32 CollisionPoly_GetPointDistanceFromPlane(CollisionPoly* poly, Vec3f* point); -void CollisionPoly_GetVerticesByBgId(CollisionPoly* poly, s32 bgId, CollisionContext* colCtx, Vec3f* dest); -void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader* colHeader); -f32 BgCheck_EntityRaycastDown1(CollisionContext* colCtx, CollisionPoly** outGroundPoly, Vec3f* pos); -f32 BgCheck_EntityRaycastDown2(PlayState* play, CollisionContext* colCtx, CollisionPoly** outGroundPoly, Vec3f* pos); -f32 BgCheck_EntityRaycastDown3(CollisionContext* colCtx, CollisionPoly** outGroundPoly, s32* bgId, Vec3f* pos); -f32 BgCheck_EntityRaycastDown4(CollisionContext* colCtx, CollisionPoly** outGroundPoly, s32* bgId, Actor* actor, - Vec3f* pos); -f32 BgCheck_EntityRaycastDown5(PlayState* play, CollisionContext* colCtx, CollisionPoly** outGroundPoly, s32* bgId, - Actor* actor, Vec3f* pos); -f32 BgCheck_EntityRaycastDown6(CollisionContext* colCtx, CollisionPoly** outGroundPoly, s32* bgId, Actor* actor, - Vec3f* pos, f32 chkDist); -f32 BgCheck_EntityRaycastDown7(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos); -f32 BgCheck_AnyRaycastDown1(CollisionContext* colCtx, CollisionPoly* outGroundPoly, Vec3f* pos); -f32 BgCheck_AnyRaycastDown2(CollisionContext* colCtx, CollisionPoly* outGroundPoly, s32* bgId, Vec3f* pos); -f32 BgCheck_CameraRaycastDown2(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Vec3f* pos); -f32 BgCheck_EntityRaycastDownWalls(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos); -f32 BgCheck_EntityRaycastDown9(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Vec3f* pos); -s32 BgCheck_EntitySphVsWall1(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, - CollisionPoly** outPoly, f32 checkHeight); -s32 BgCheck_EntitySphVsWall2(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, - CollisionPoly** outPoly, s32* outBgId, f32 checkHeight); -s32 BgCheck_EntitySphVsWall3(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, - CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight); -s32 BgCheck_EntitySphVsWall4(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, - CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight); -s32 BgCheck_AnyCheckCeiling(CollisionContext* colCtx, f32* outY, Vec3f* pos, f32 checkHeight); -s32 BgCheck_EntityCheckCeiling(CollisionContext* colCtx, f32* outY, Vec3f* pos, f32 checkHeight, - CollisionPoly** outPoly, s32* outBgId, Actor* actor); -s32 BgCheck_CameraLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, - CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); -s32 BgCheck_CameraLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, - CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); -s32 BgCheck_EntityLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, - CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); -s32 BgCheck_EntityLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, - CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId, - Actor* actor); -s32 BgCheck_EntityLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, - CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId, - Actor* actor, f32 chkDist); -s32 BgCheck_ProjectileLineTest(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, - CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, - s32* bgId); -s32 BgCheck_AnyLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, - s32 chkOneFace); -s32 BgCheck_AnyLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, - s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace); -s32 BgCheck_AnyLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, - s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); -s32 BgCheck_SphVsFirstPoly(CollisionContext* colCtx, Vec3f* center, f32 radius); -s32 DynaPoly_IsBgIdBgActor(s32 bgId); -void DynaPoly_DisableCollision(PlayState* play, DynaCollisionContext* dyna, s32 bgId); -void DynaPoly_EnableCollision(PlayState* play, DynaCollisionContext* dyna, s32 bgId); -void DynaPoly_DisableCeilingCollision(PlayState* play, DynaCollisionContext* dyna, s32 bgId); -s32 DynaPoly_SetBgActor(PlayState* play, DynaCollisionContext* dyna, Actor* actor, CollisionHeader* colHeader); -DynaPolyActor* DynaPoly_GetActor(CollisionContext* colCtx, s32 bgId); -void DynaPoly_DeleteBgActor(PlayState* play, DynaCollisionContext* dyna, s32 bgId); -void DynaPoly_InvalidateLookup(PlayState* play, DynaCollisionContext* dyna); -void DynaPoly_UnsetAllInteractFlags(PlayState* play, DynaCollisionContext* dyna, Actor* actor); -void DynaPoly_UpdateContext(PlayState* play, DynaCollisionContext* dyna); -void DynaPoly_UpdateBgActorTransforms(PlayState* play, DynaCollisionContext* dyna); -void CollisionHeader_GetVirtual(void* colHeader, CollisionHeader** dest); -void func_800418D0(CollisionContext* colCtx, PlayState* play); -u32 SurfaceType_GetBgCamIndex(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u16 BgCheck_GetBgCamSettingImpl(CollisionContext* colCtx, u32 bgCamIndex, s32 bgId); -u16 BgCheck_GetBgCamSetting(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u16 BgCheck_GetBgCamCount(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -Vec3s* BgCheck_GetBgCamFuncDataImpl(CollisionContext* colCtx, s32 bgCamIndex, s32 bgId); -Vec3s* BgCheck_GetBgCamFuncData(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 SurfaceType_GetExitIndex(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 SurfaceType_GetFloorType(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 func_80041D70(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -s32 SurfaceType_GetWallFlags(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -s32 SurfaceType_CheckWallFlag0(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -s32 SurfaceType_CheckWallFlag1(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -s32 SurfaceType_CheckWallFlag2(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 SurfaceType_GetFloorProperty(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 SurfaceType_IsSoft(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 SurfaceType_IsHorseBlocked(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 SurfaceType_GetMaterial(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u16 SurfaceType_GetSfxOffset(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 SurfaceType_GetFloorEffect(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 SurfaceType_GetLightSetting(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 SurfaceType_GetEcho(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 SurfaceType_CanHookshot(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -s32 SurfaceType_IsIgnoredByEntities(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -s32 SurfaceType_IsIgnoredByProjectiles(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -s32 SurfaceType_IsFloorConveyor(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 SurfaceType_GetConveyorSpeed(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 SurfaceType_GetConveyorDirection(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 func_80042108(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -s32 WaterBox_GetSurface1(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, - WaterBox** outWaterBox); -s32 WaterBox_GetSurface2(PlayState* play, CollisionContext* colCtx, Vec3f* pos, f32 surfaceChkDist, - WaterBox** outWaterBox); -s32 WaterBox_GetSurfaceImpl(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, - WaterBox** outWaterBox); -u32 WaterBox_GetBgCamIndex(CollisionContext* colCtx, WaterBox* waterBox); -u16 WaterBox_GetBgCamSetting(CollisionContext* colCtx, WaterBox* waterBox); -u32 WaterBox_GetLightIndex(CollisionContext* colCtx, WaterBox* waterBox); -s32 func_80042708(CollisionPoly* polyA, CollisionPoly* polyB, Vec3f* point, Vec3f* closestPoint); -s32 func_800427B4(CollisionPoly* polyA, CollisionPoly* polyB, Vec3f* pointA, Vec3f* pointB, Vec3f* closestPoint); -#if IS_DEBUG -void BgCheck_DrawDynaCollision(PlayState*, CollisionContext*); -void BgCheck_DrawStaticCollision(PlayState*, CollisionContext*); -#endif -void func_80043334(CollisionContext* colCtx, Actor* actor, s32 bgId); -s32 DynaPolyActor_TransformCarriedActor(CollisionContext* colCtx, s32 bgId, Actor* carriedActor); -void DynaPolyActor_Init(DynaPolyActor* dynaActor, s32 transformFlags); -void DynaPolyActor_UnsetAllInteractFlags(DynaPolyActor* dynaActor); -void DynaPolyActor_SetActorOnTop(DynaPolyActor* dynaActor); -void DynaPoly_SetPlayerOnTop(CollisionContext* colCtx, s32 floorBgId); -void DynaPoly_SetPlayerAbove(CollisionContext* colCtx, s32 floorBgId); -void func_80043538(DynaPolyActor* dynaActor); -s32 DynaPolyActor_IsActorOnTop(DynaPolyActor* dynaActor); -s32 DynaPolyActor_IsPlayerOnTop(DynaPolyActor* dynaActor); -s32 DynaPolyActor_IsPlayerAbove(DynaPolyActor* dynaActor); -s32 func_800435B4(DynaPolyActor* dynaActor); -s32 func_800435D8(PlayState* play, DynaPolyActor* dynaActor, s16 arg2, s16 arg3, s16 arg4); -void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState* play); -void Camera_InitDataUsingPlayer(Camera* camera, Player* player); -s16 Camera_ChangeStatus(Camera* camera, s16 status); -Vec3s Camera_Update(Camera* camera); -void Camera_Finish(Camera* camera); -s32 Camera_RequestMode(Camera* camera, s16 mode); -s32 Camera_CheckValidMode(Camera* camera, s16 mode); -s32 Camera_RequestSetting(Camera* camera, s16 setting); -s32 Camera_RequestBgCam(Camera* camera, s32 requestedBgCamIndex); -s16 Camera_GetInputDirYaw(Camera* camera); -Vec3s Camera_GetCamDir(Camera* camera); -s16 Camera_GetCamDirPitch(Camera* camera); -s16 Camera_GetCamDirYaw(Camera* camera); -s32 Camera_RequestQuake(Camera* camera, s32 unused, s16 y, s32 duration); -s32 Camera_SetViewParam(Camera* camera, s32 viewFlag, void* param); -s32 Camera_OverwriteStateFlags(Camera* camera, s16 stateFlags); -s16 Camera_SetStateFlag(Camera* camera, s16 stateFlag); -s16 Camera_UnsetStateFlag(Camera* camera, s16 stateFlag); -s32 Camera_ResetAnim(Camera* camera); -s32 Camera_SetCSParams(Camera* camera, CutsceneCameraPoint* atPoints, CutsceneCameraPoint* eyePoints, Player* player, - s16 relativeToPlayer); -s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2, - s16 timer3); -s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera); -Vec3f Camera_GetQuakeOffset(Camera* camera); -void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* data1, s16 data2, s16 data3, - UNK_TYPE arg6); -s32 func_8005B198(void); -s16 Camera_SetFinishedFlag(Camera* camera); -DamageTable* DamageTable_Get(s32 index); -void DamageTable_Clear(DamageTable* table); -#if IS_DEBUG -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); -#endif -s32 Collider_InitJntSph(PlayState* play, ColliderJntSph* jntSph); -s32 Collider_FreeJntSph(PlayState* play, ColliderJntSph* jntSph); -s32 Collider_DestroyJntSph(PlayState* play, ColliderJntSph* jntSph); -s32 Collider_SetJntSphToActor(PlayState* play, ColliderJntSph* dest, ColliderJntSphInitToActor* src); -s32 Collider_SetJntSphAllocType1(PlayState* play, ColliderJntSph* dest, Actor* actor, - ColliderJntSphInitType1* src); -s32 Collider_SetJntSphAlloc(PlayState* play, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src); -s32 Collider_SetJntSph(PlayState* play, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src, - ColliderJntSphElement* jntSphElements); -s32 Collider_ResetJntSphAT(PlayState* play, Collider* col); -s32 Collider_ResetJntSphAC(PlayState* play, Collider* col); -s32 Collider_ResetJntSphOC(PlayState* play, Collider* col); -s32 Collider_InitCylinder(PlayState* play, ColliderCylinder* cyl); -s32 Collider_DestroyCylinder(PlayState* play, ColliderCylinder* cyl); -s32 Collider_SetCylinderToActor(PlayState* play, ColliderCylinder* dest, ColliderCylinderInitToActor* src); -s32 Collider_SetCylinderType1(PlayState* play, ColliderCylinder* dest, Actor* actor, ColliderCylinderInitType1* src); -s32 Collider_SetCylinder(PlayState* play, ColliderCylinder* dest, Actor* actor, ColliderCylinderInit* src); -s32 Collider_ResetCylinderAT(PlayState* play, Collider* col); -s32 Collider_ResetCylinderAC(PlayState* play, Collider* col); -s32 Collider_ResetCylinderOC(PlayState* play, Collider* col); -s32 Collider_InitTris(PlayState* play, ColliderTris* tris); -s32 Collider_FreeTris(PlayState* play, ColliderTris* tris); -s32 Collider_DestroyTris(PlayState* play, ColliderTris* tris); -s32 Collider_SetTrisAllocType1(PlayState* play, ColliderTris* dest, Actor* actor, ColliderTrisInitType1* src); -s32 Collider_SetTrisAlloc(PlayState* play, ColliderTris* dest, Actor* actor, ColliderTrisInit* src); -s32 Collider_SetTris(PlayState* play, ColliderTris* dest, Actor* actor, ColliderTrisInit* src, - ColliderTrisElement* trisElements); -s32 Collider_ResetTrisAT(PlayState* play, Collider* col); -s32 Collider_ResetTrisAC(PlayState* play, Collider* col); -s32 Collider_ResetTrisOC(PlayState* play, Collider* col); -s32 Collider_InitQuad(PlayState* play, ColliderQuad* quad); -s32 Collider_DestroyQuad(PlayState* play, ColliderQuad* quad); -s32 Collider_SetQuadType1(PlayState* play, ColliderQuad* dest, Actor* actor, ColliderQuadInitType1* src); -s32 Collider_SetQuad(PlayState* play, ColliderQuad* dest, Actor* actor, ColliderQuadInit* src); -s32 Collider_ResetQuadAT(PlayState* play, Collider* col); -s32 Collider_ResetQuadAC(PlayState* play, Collider* col); -s32 Collider_ResetQuadOC(PlayState* play, Collider* col); -s32 Collider_InitLine(PlayState* play, OcLine* line); -s32 Collider_DestroyLine(PlayState* play, OcLine* line); -s32 Collider_SetLinePoints(PlayState* play, OcLine* ocLine, Vec3f* a, Vec3f* b); -s32 Collider_SetLine(PlayState* play, OcLine* dest, OcLine* src); -s32 Collider_ResetLineOC(PlayState* play, OcLine* line); -void CollisionCheck_InitContext(PlayState* play, CollisionCheckContext* colChkCtx); -void CollisionCheck_DestroyContext(PlayState* play, CollisionCheckContext* colChkCtx); -void CollisionCheck_ClearContext(PlayState* play, CollisionCheckContext* colChkCtx); -void CollisionCheck_EnableSAC(PlayState* play, CollisionCheckContext* colChkCtx); -void CollisionCheck_DisableSAC(PlayState* play, CollisionCheckContext* colChkCtx); -#if IS_DEBUG -void Collider_Draw(PlayState* play, Collider* col); -void CollisionCheck_DrawCollision(PlayState* play, CollisionCheckContext* colChkCtx); -#endif -s32 CollisionCheck_SetAT(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider); -s32 CollisionCheck_SetAT_SAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, s32 index); -s32 CollisionCheck_SetAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider); -s32 CollisionCheck_SetAC_SAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, s32 index); -s32 CollisionCheck_SetOC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider); -s32 CollisionCheck_SetOC_SAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, s32 index); -s32 CollisionCheck_SetOCLine(PlayState* play, CollisionCheckContext* colChkCtx, OcLine* collider); -void CollisionCheck_BlueBlood(PlayState* play, Collider* collider, Vec3f* v); -void CollisionCheck_AT(PlayState* play, CollisionCheckContext* colChkCtx); -void CollisionCheck_OC(PlayState* play, CollisionCheckContext* colChkCtx); -void CollisionCheck_InitInfo(CollisionCheckInfo* info); -void CollisionCheck_ResetDamage(CollisionCheckInfo* info); -void CollisionCheck_SetInfoNoDamageTable(CollisionCheckInfo* info, CollisionCheckInfoInit* init); -void CollisionCheck_SetInfo(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init); -void CollisionCheck_SetInfo2(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init); -void CollisionCheck_SetInfoGetDamageTable(CollisionCheckInfo* info, s32 index, CollisionCheckInfoInit2* init); -void CollisionCheck_Damage(PlayState* play, CollisionCheckContext* colChkCtx); -s32 CollisionCheck_LineOCCheckAll(PlayState* play, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b); -s32 CollisionCheck_LineOCCheck(PlayState* play, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b, - Actor** exclusions, s32 numExclusions); -void Collider_UpdateCylinder(Actor* actor, ColliderCylinder* cyl); -void Collider_SetCylinderPosition(ColliderCylinder* cyl, Vec3s* pos); -void Collider_SetQuadVertices(ColliderQuad* quad, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d); -void Collider_SetTrisVertices(ColliderTris* tris, s32 elemIndex, Vec3f* a, Vec3f* b, Vec3f* c); -void Collider_SetTrisDim(PlayState* play, ColliderTris* tris, s32 elemIndex, ColliderTrisElementDimInit* src); -void Collider_UpdateSpheres(s32 limb, ColliderJntSph* jntSph); -void CollisionCheck_SpawnRedBlood(PlayState* play, Vec3f* v); -void CollisionCheck_SpawnWaterDroplets(PlayState* play, Vec3f* v); -void CollisionCheck_SpawnShieldParticles(PlayState* play, Vec3f* v); -void CollisionCheck_SpawnShieldParticlesMetal(PlayState* play, Vec3f* v); -void CollisionCheck_SpawnShieldParticlesMetalSfx(PlayState* play, Vec3f* v, Vec3f* pos); -void CollisionCheck_SpawnShieldParticlesMetal2(PlayState* play, Vec3f* v); -void CollisionCheck_SpawnShieldParticlesWood(PlayState* play, Vec3f* v, Vec3f* actorPos); -s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* itemPos, - Vec3f* itemProjPos, Vec3f* out1, Vec3f* out2); -u8 CollisionCheck_GetSwordDamage(s32 dmgFlags); void SaveContext_Init(void); s32 func_800635D0(s32); void Regs_Init(void); @@ -742,14 +53,7 @@ DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha, s16 type, GraphicsContext* gfxCtx); void DebugDisplay_DrawObjects(PlayState* play); -void Cutscene_InitContext(PlayState* play, CutsceneContext* csCtx); -void Cutscene_StartManual(PlayState* play, CutsceneContext* csCtx); -void Cutscene_StopManual(PlayState* play, CutsceneContext* csCtx); -void Cutscene_UpdateManual(PlayState* play, CutsceneContext* csCtx); -void Cutscene_UpdateScripted(PlayState* play, CutsceneContext* csCtx); -void Cutscene_HandleEntranceTriggers(PlayState* play); -void Cutscene_HandleConditionalTriggers(PlayState* play); -void Cutscene_SetScript(PlayState* play, void* script); + void* MemCpy(void* dest, const void* src, s32 len); void GetItem_Draw(PlayState* play, s16 drawId); @@ -767,98 +71,19 @@ void func_8006D0EC(PlayState* play, Player* player); void func_8006D684(PlayState* play, Player* player); void func_8006DC68(PlayState* play, Player* player); void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2); -s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize); -void KaleidoSetup_Update(PlayState* play); -void KaleidoSetup_Init(PlayState* play); -void KaleidoSetup_Destroy(PlayState* play); -void func_8006EE50(Font* font, u16 arg1, u16 arg2); + +s32 Kanji_OffsetFromShiftJIS(s32 character); +void Font_LoadCharWide(Font* font, u16 character, u16 codePointIndex); void Font_LoadChar(Font* font, u8 character, u16 codePointIndex); void Font_LoadMessageBoxIcon(Font* font, u16 icon); void Font_LoadOrderedFont(Font* font); -s32 Environment_ZBufValToFixedPoint(s32 zBufferVal); -u16 Environment_GetPixelDepth(s32 x, s32 y); -void Environment_GraphCallback(GraphicsContext* gfxCtx, void* param); -void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused); -u8 Environment_SmoothStepToU8(u8* pvalue, u8 target, u8 scale, u8 step, u8 minStep); -u8 Environment_SmoothStepToS8(s8* pvalue, s8 target, u8 scale, u8 step, u8 minStep); -f32 Environment_LerpWeight(u16 max, u16 min, u16 val); -f32 Environment_LerpWeightAccelDecel(u16 endFrame, u16 startFrame, u16 curFrame, u16 accelDuration, u16 decelDuration); -void Environment_EnableUnderwaterLights(PlayState* play, s32 waterLightsIndex); -void Environment_DisableUnderwaterLights(PlayState* play); -void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContext* lightCtx, - PauseContext* pauseCtx, MessageContext* msgCtx, GameOverContext* gameOverCtx, - GraphicsContext* gfxCtx); -void Environment_DrawSunAndMoon(PlayState* play); -void Environment_DrawSunLensFlare(PlayState* play, EnvironmentContext* envCtx, View* view, - GraphicsContext* gfxCtx, Vec3f pos, s32 unused); -void Environment_DrawLensFlare(PlayState* play, EnvironmentContext* envCtx, View* view, - GraphicsContext* gfxCtx, Vec3f pos, s32 unused, s16 scale, f32 colorIntensity, - s16 glareStrength, u8 isSun); -void Environment_DrawRain(PlayState* play, View* view, GraphicsContext* gfxCtx); -void Environment_ChangeLightSetting(PlayState* play, u32 lightSetting); -void Environment_UpdateLightningStrike(PlayState* play); -void Environment_AddLightningBolts(PlayState* play, u8 num); -void Environment_DrawLightning(PlayState* play, s32 unused); -void Environment_PlaySceneSequence(PlayState* play); -void Environment_DrawCustomLensFlare(PlayState* play); -void Environment_InitGameOverLights(PlayState* play); -void Environment_FadeInGameOverLights(PlayState* play); -void Environment_FadeOutGameOverLights(PlayState* play); -void Environment_FillScreen(GraphicsContext* gfxCtx, u8 red, u8 green, u8 blue, u8 alpha, u8 drawFlags); -void Environment_DrawSandstorm(PlayState* play, u8 sandstormState); -void Environment_AdjustLights(PlayState* play, f32 arg1, f32 arg2, f32 arg3, f32 arg4); -s32 Environment_GetBgsDayCount(void); -void Environment_ClearBgsDayCount(void); -s32 Environment_GetTotalDays(void); -void Environment_ForcePlaySequence(u16 seqId); -s32 Environment_IsForcedSequenceDisabled(void); -void Environment_PlayStormNatureAmbience(PlayState* play); -void Environment_StopStormNatureAmbience(PlayState* play); -void Environment_WarpSongLeave(PlayState* play); + void Health_InitMeter(PlayState* play); void Health_UpdateMeter(PlayState* play); void Health_DrawMeter(PlayState* play); void Health_UpdateBeatingHeart(PlayState* play); u32 Health_IsCritical(void); -void Lights_PointSetInfo(LightInfo* info, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius, s32 type); -void Lights_PointNoGlowSetInfo(LightInfo* info, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius); -void Lights_PointGlowSetInfo(LightInfo* info, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius); -void Lights_PointSetColorAndRadius(LightInfo* info, u8 r, u8 g, u8 b, s16 radius); -void Lights_DirectionalSetInfo(LightInfo* info, s8 x, s8 y, s8 z, u8 r, u8 g, u8 b); -void Lights_Reset(Lights* lights, u8 ambentR, u8 ambentG, u8 ambentB); -void Lights_Draw(Lights* lights, GraphicsContext* gfxCtx); -void Lights_BindAll(Lights* lights, LightNode* listHead, Vec3f* vec); -void LightContext_Init(PlayState* play, LightContext* lightCtx); -void LightContext_SetAmbientColor(LightContext* lightCtx, u8 r, u8 g, u8 b); -void LightContext_SetFog(LightContext* lightCtx, u8 r, u8 g, u8 b, s16 fogNear, s16 zFar); -Lights* LightContext_NewLights(LightContext* lightCtx, GraphicsContext* gfxCtx); -void LightContext_InitList(PlayState* play, LightContext* lightCtx); -void LightContext_DestroyList(PlayState* play, LightContext* lightCtx); -LightNode* LightContext_InsertLight(PlayState* play, LightContext* lightCtx, LightInfo* info); -void LightContext_RemoveLight(PlayState* play, LightContext* lightCtx, LightNode* node); -Lights* Lights_NewAndDraw(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambientB, u8 numLights, u8 r, u8 g, - u8 b, s8 x, s8 y, s8 z); -Lights* Lights_New(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambientB); -void Lights_GlowCheck(PlayState* play); -void Lights_DrawGlow(PlayState* play); -void* ZeldaArena_Malloc(u32 size); -void* ZeldaArena_MallocR(u32 size); -void* ZeldaArena_Realloc(void* ptr, u32 newSize); -void ZeldaArena_Free(void* ptr); -void* ZeldaArena_Calloc(u32 num, u32 size); -void ZeldaArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc); -void ZeldaArena_Check(void); -void ZeldaArena_Init(void* start, u32 size); -void ZeldaArena_Cleanup(void); -u8 ZeldaArena_IsInitialized(void); -#if IS_DEBUG -void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action); -void* ZeldaArena_MallocDebug(u32 size, const char* file, int line); -void* ZeldaArena_MallocRDebug(u32 size, const char* file, int line); -void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line); -void ZeldaArena_FreeDebug(void* ptr, const char* file, int line); -void ZeldaArena_Display(void); -#endif + void MapMark_Init(PlayState* play); void MapMark_ClearPointers(PlayState* play); void MapMark_Draw(PlayState* play); @@ -866,192 +91,24 @@ void PreNmiBuff_Init(PreNmiBuff* this); void PreNmiBuff_SetReset(PreNmiBuff* this); u32 PreNmiBuff_IsResetting(PreNmiBuff* this); void Sched_FlushTaskQueue(void); -f32 OLib_Vec3fDist(Vec3f* a, Vec3f* b); -f32 OLib_Vec3fDistXZ(Vec3f* a, Vec3f* b); -f32 OLib_ClampMinDist(f32 val, f32 min); -f32 OLib_ClampMaxDist(f32 val, f32 max); -Vec3f OLib_Vec3fDistNormalize(Vec3f* a, Vec3f* b); -Vec3f OLib_VecGeoToVec3f(VecGeo* geo); -VecSph OLib_Vec3fToVecSph(Vec3f* vec); -VecGeo OLib_Vec3fToVecGeo(Vec3f* vec); -VecGeo OLib_Vec3fDiffToVecGeo(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_EndCutscene(PlayState* play, s16 subCamId); -s32 OnePointCutscene_Attention(PlayState* play, Actor* actor); -s32 OnePointCutscene_AttentionSetSfx(PlayState* play, Actor* actor, s32 sfxId); -void OnePointCutscene_EnableAttention(void); -void OnePointCutscene_DisableAttention(void); -s32 OnePointCutscene_CheckForCategory(PlayState* play, s32 actorCategory); -void OnePointCutscene_Noop(PlayState* play, s32 arg1); -void Map_SavePlayerInitialInfo(PlayState* play); -void Map_SetFloorPalettesData(PlayState* play, s16 floor); -void Map_InitData(PlayState* play, s16 room); -void Map_InitRoomData(PlayState* play, s16 room); -void Map_Destroy(PlayState* play); -void Map_Init(PlayState* play); -void Minimap_Draw(PlayState* play); -void Map_Update(PlayState* play); -void Interface_ChangeHudVisibilityMode(u16 hudVisibilityMode); -void Interface_SetSceneRestrictions(PlayState* play); -void Inventory_SwapAgeEquipment(void); -void Interface_InitHorsebackArchery(PlayState* play); -void func_800849EC(PlayState* play); -void Interface_LoadItemIcon1(PlayState* play, u16 button); -void Interface_LoadItemIcon2(PlayState* play, u16 button); -void func_80084BF4(PlayState* play, u16 flag); -u8 Item_Give(PlayState* play, u8 item); -u8 Item_CheckObtainability(u8 item); -void Inventory_DeleteItem(u16 item, u16 invSlot); -s32 Inventory_ReplaceItem(PlayState* play, u16 oldItem, u16 newItem); -s32 Inventory_HasEmptyBottle(void); -s32 Inventory_HasSpecificBottle(u8 bottleItem); -void Inventory_UpdateBottleItem(PlayState* play, u8 item, u8 button); -s32 Inventory_ConsumeFairy(PlayState* play); -void Interface_SetDoAction(PlayState* play, u16 action); -void Interface_SetNaviCall(PlayState* play, u16 naviCallState); -void Interface_LoadActionLabelB(PlayState* play, u16 action); -s32 Health_ChangeBy(PlayState* play, s16 amount); -void Rupees_ChangeBy(s16 rupeeChange); -void Inventory_ChangeAmmo(s16 item, s16 ammoChange); -void Magic_Fill(PlayState* play); -void Magic_Reset(PlayState* play); -s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type); -void Interface_SetSubTimer(s16 seconds); -void Interface_SetSubTimerToFinalSecond(PlayState* play); -void Interface_SetTimer(s16 seconds); -void Interface_Draw(PlayState* play); -void Interface_Update(PlayState* play); + Path* Path_GetByIndex(PlayState* play, s16 index, s16 max); f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw); void Path_CopyLastPoint(Path* path, Vec3f* dest); -void Player_SetBootData(PlayState* play, Player* this); -int Player_InBlockingCsMode(PlayState* play, Player* this); -int Player_InCsMode(PlayState* play); -s32 func_8008E9C4(Player* this); -int Player_IsChildWithHylianShield(Player* this); -s32 Player_ActionToModelGroup(Player* this, s32 itemAction); -void Player_SetModelsForHoldingShield(Player* this); -void Player_SetModels(Player* this, s32 modelGroup); -void Player_SetModelGroup(Player* this, s32 modelGroup); -void func_8008EC70(Player* this); -void Player_SetEquipmentData(PlayState* play, Player* this); -void Player_UpdateBottleHeld(PlayState* play, Player* this, s32 item, s32 itemAction); -void func_8008EDF0(Player* this); -void func_8008EE08(Player* this); -void func_8008EEAC(PlayState* play, Actor* actor); -s32 func_8008EF44(PlayState* play, s32 ammo); -int Player_IsBurningStickInRange(PlayState* play, Vec3f* pos, f32 xzRange, f32 yRange); -s32 Player_GetStrength(void); -u8 Player_GetMask(PlayState* play); -Player* Player_UnsetMask(PlayState* play); -s32 Player_HasMirrorShieldEquipped(PlayState* play); -int Player_HasMirrorShieldSetToDraw(PlayState* play); -s32 Player_ActionToMagicSpell(Player* this, s32 itemAction); -int Player_HoldsHookshot(Player* this); -int func_8008F128(Player* this); -s32 Player_ActionToMeleeWeapon(s32 itemAction); -s32 Player_GetMeleeWeaponHeld(Player* this); -s32 Player_HoldsTwoHandedWeapon(Player* this); -int Player_HoldsBrokenKnife(Player* this); -s32 Player_ActionToBottle(Player* this, s32 itemAction); -s32 Player_GetBottleHeld(Player* this); -s32 Player_ActionToExplosive(Player* this, s32 itemAction); -s32 Player_GetExplosiveHeld(Player* this); -s32 func_8008F2BC(Player* this, s32 itemAction); -s32 Player_GetEnvironmentalHazard(PlayState* play); -void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, s32 tunic, - s32 boots, s32 face, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, - void* data); -s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, - void* thisx); -s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, - void* thisx); -s32 Player_OverrideLimbDrawGameplayFirstPerson(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, - void* thisx); -s32 Player_OverrideLimbDrawGameplayCrawling(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, - void* thisx); -u8 func_80090480(PlayState* play, ColliderQuad* collider, WeaponInfo* weaponInfo, Vec3f* newTip, Vec3f* newBase); -void Player_DrawGetItem(PlayState* play, Player* this); -void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx); -u32 Player_InitPauseDrawData(PlayState* play, u8* segment, SkelAnime* skelAnime); -void Player_DrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot, f32 scale, - s32 sword, s32 tunic, s32 shield, s32 boots); void PreNMI_Init(GameState* thisx); -Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far); -Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far); -Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far); -Gfx* Gfx_SetupDL(Gfx* gfx, u32 i); -Gfx* Gfx_SetupDL_57(Gfx* gfx); -Gfx* Gfx_SetupDL_52NoCD(Gfx* gfx); -void Gfx_SetupDL_57Opa(GraphicsContext* gfxCtx); -void Gfx_SetupDL_51Opa(GraphicsContext* gfxCtx); -void Gfx_SetupDL_54Opa(GraphicsContext* gfxCtx); -void Gfx_SetupDL_26Opa(GraphicsContext* gfxCtx); -void Gfx_SetupDL_25Xlu2(GraphicsContext* gfxCtx); -void func_80093C80(PlayState* play); -void Gfx_SetupDL_25Opa(GraphicsContext* gfxCtx); -void Gfx_SetupDL_25Xlu(GraphicsContext* gfxCtx); -Gfx* Gfx_SetupDL_64(Gfx* gfx); -Gfx* Gfx_SetupDL_34(Gfx* gfx); -void Gfx_SetupDL_44Xlu(GraphicsContext* gfxCtx); -void Gfx_SetupDL_36Opa(GraphicsContext* gfxCtx); -void Gfx_SetupDL_28Opa(GraphicsContext* gfxCtx); -Gfx* Gfx_SetupDL_28(Gfx* gfx); -void Gfx_SetupDL_38Xlu(GraphicsContext* gfxCtx); -void Gfx_SetupDL_4Xlu(GraphicsContext* gfxCtx); -void Gfx_SetupDL_37Opa(GraphicsContext* gfxCtx); -Gfx* Gfx_SetupDL_39(Gfx* gfx); -void Gfx_SetupDL_39Opa(GraphicsContext* gfxCtx); -void Gfx_SetupDL_39Overlay(GraphicsContext* gfxCtx); -void Gfx_SetupDL_39Ptr(Gfx** gfxP); -void Gfx_SetupDL_40Opa(GraphicsContext* gfxCtx); -void Gfx_SetupDL_41Opa(GraphicsContext* gfxCtx); -void Gfx_SetupDL_47Xlu(GraphicsContext* gfxCtx); -Gfx* Gfx_SetupDL_20NoCD(Gfx* gfx); -Gfx* Gfx_SetupDL_66(Gfx* gfx); -Gfx* func_800947AC(Gfx* gfx); -void Gfx_SetupDL_42Opa(GraphicsContext* gfxCtx); -void Gfx_SetupDL_42Overlay(GraphicsContext* gfxCtx); -void Gfx_SetupDL_27Xlu(GraphicsContext* gfxCtx); -void Gfx_SetupDL_60NoCDXlu(GraphicsContext* gfxCtx); -void Gfx_SetupDL_61Xlu(GraphicsContext* gfxCtx); -void Gfx_SetupDL_56Ptr(Gfx** gfxP); -Gfx* Gfx_BranchTexScroll(Gfx** gfxP, u32 x, u32 y, s32 width, s32 height); -Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y); -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, - u32 y2, s32 width2, s32 height2); -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); -Gfx* Gfx_EnvColor(GraphicsContext* gfxCtx, s32 r, s32 g, s32 b, s32 a); -void Gfx_SetupFrame(GraphicsContext* gfxCtx, s32 clearFB, u8 r, u8 g, u8 b); -void Gfx_ClearZBuffer(GraphicsContext* gfxCtx); -void func_80095974(GraphicsContext* gfxCtx); + void func_80095AA0(PlayState* play, Room* room, Input* input, s32 arg3); void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tlutMode, u16 tlutCount, f32 offsetX, f32 offsetY); -void func_80096FD4(PlayState* play, Room* room); -u32 func_80096FE8(PlayState* play, RoomContext* roomCtx); -s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum); -s32 func_800973FC(PlayState* play, RoomContext* roomCtx); +void Room_Init(PlayState* play, Room* room); +u32 Room_SetupFirstRoom(PlayState* play, RoomContext* roomCtx); +s32 Room_RequestNewRoom(PlayState* play, RoomContext* roomCtx, s32 roomNum); +s32 Room_ProcessRoomRequest(PlayState* play, RoomContext* roomCtx); void Room_Draw(PlayState* play, Room* room, u32 flags); -void func_80097534(PlayState* play, RoomContext* roomCtx); +void Room_FinishRoomChange(PlayState* play, RoomContext* roomCtx); void Sample_Destroy(GameState* thisx); void Sample_Init(GameState* thisx); -void Inventory_ChangeEquipment(s16 equipment, u16 value); -u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment); -void Inventory_ChangeUpgrade(s16 upgrade, s16 value); -void Object_InitContext(PlayState* play, ObjectContext* objectCtx); -void Object_UpdateEntries(ObjectContext* objectCtx); -s32 Object_GetSlot(ObjectContext* objectCtx, s16 objectId); -s32 Object_IsLoaded(ObjectContext* objectCtx, s32 slot); -void func_800981B8(ObjectContext* objectCtx); -s32 Scene_ExecuteCommands(PlayState* play, SceneCmd* sceneCmd); -void TransitionActor_InitContext(GameState* state, TransitionActorContext* transiActorCtx); -void Scene_SetTransitionForNextEntrance(PlayState* play); -void Scene_Draw(PlayState* play); void Skin_UpdateVertices(MtxF* mtx, SkinVertex* skinVertices, SkinLimbModif* modifEntry, Vtx* vtxBuf, Vec3f* pos); void Skin_DrawAnimatedLimb(GraphicsContext* gfxCtx, Skin* skin, s32 limbIndex, s32 arg3, s32 drawFlags); @@ -1068,21 +125,6 @@ void Skin_Init(PlayState* play, Skin* skin, SkeletonHeader* skeletonHeader, Anim void Skin_Free(PlayState* play, Skin* skin); s32 Skin_ApplyAnimTransformations(Skin* skin, MtxF* limbMatrices, Actor* actor, s32 setTranslation); -void SkinMatrix_Vec3fMtxFMultXYZW(MtxF* mf, Vec3f* src, Vec3f* xyzDest, f32* wDest); -void SkinMatrix_Vec3fMtxFMultXYZ(MtxF* mf, Vec3f* src, Vec3f* dest); -void SkinMatrix_MtxFMtxFMult(MtxF* mfA, MtxF* mfB, MtxF* dest); -void SkinMatrix_GetClear(MtxF** mfp); -void SkinMatrix_MtxFCopy(MtxF* src, MtxF* dest); -s32 SkinMatrix_Invert(MtxF* src, MtxF* dest); -void SkinMatrix_SetScale(MtxF* mf, f32 x, f32 y, f32 z); -void SkinMatrix_SetRotateZYX(MtxF* mf, s16 x, s16 y, s16 z); -void SkinMatrix_SetTranslate(MtxF* mf, f32 x, f32 y, f32 z); -void SkinMatrix_SetTranslateRotateYXZScale(MtxF* dest, f32 scaleX, f32 scaleY, f32 scaleZ, s16 rotX, s16 rotY, s16 rotZ, - f32 translateX, f32 translateY, f32 translateZ); -void SkinMatrix_SetTranslateRotateZYX(MtxF* dest, s16 rotX, s16 rotY, s16 rotZ, f32 translateX, f32 translateY, - f32 translateZ); -Mtx* SkinMatrix_MtxFToNewMtx(GraphicsContext* gfxCtx, MtxF* src); -void SkinMatrix_SetRotateAxis(MtxF* mf, s16 angle, f32 axisX, f32 axisY, f32 axisZ); void Sram_InitNewSave(void); void Sram_InitDebugSave(void); void Sram_OpenSave(SramContext* sramCtx); @@ -1099,34 +141,6 @@ void SsSram_Init(s32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 u8 handlePulse, u32 handleSpeed); void SsSram_Dma(void* dramAddr, size_t size, s32 direction); void SsSram_ReadWrite(s32 addr, void* dramAddr, size_t size, s32 direction); -View* View_New(GraphicsContext* gfxCtx); -void View_Free(View* view); -void View_Init(View*, GraphicsContext*); -void View_LookAt(View* view, Vec3f* eye, Vec3f* at, Vec3f* up); -void View_LookAtUnsafe(View* view, Vec3f* eye, Vec3f* at, Vec3f* up); -void View_SetScale(View* view, f32 scale); -void View_GetScale(View* view, f32* scale); -void View_SetPerspective(View* view, f32 fovy, f32 zNear, f32 zFar); -void View_GetPerspective(View* view, f32* fovy, f32* zNear, f32* zFar); -void View_SetOrtho(View* view, f32 fovy, f32 zNear, f32 zFar); -void View_GetOrtho(View* view, f32* fovy, f32* zNear, f32* zFar); -void View_SetViewport(View* view, Viewport* viewport); -void View_GetViewport(View* view, Viewport* viewport); -void View_SetDistortionOrientation(View* view, f32 rotX, f32 rotY, f32 rotZ); -void View_SetDistortionScale(View* view, f32 scaleX, f32 scaleY, f32 scaleZ); -s32 View_SetDistortionSpeed(View* view, f32 speed); -void View_InitDistortion(View* view); -void View_ClearDistortion(View* view); -void View_SetDistortion(View* view, Vec3f orientation, Vec3f scale, f32 speed); -s32 View_StepDistortion(View* view, Mtx* projectionMtx); -s32 View_Apply(View* view, s32 mask); -s32 View_ApplyOrthoToOverlay(View* view); -s32 View_ApplyPerspectiveToOverlay(View* view); -s32 View_UpdateViewingMatrix(View* view); -s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP); -#if IS_DEBUG -s32 View_ErrorCheckEyePosition(f32 eyeX, f32 eyeY, f32 eyeZ); -#endif void ViMode_LogPrint(OSViMode* osViMode); void ViMode_Configure(ViMode* viMode, s32 type, s32 tvType, s32 loRes, s32 antialiasOff, s32 modeN, s32 fb16Bit, s32 width, s32 height, s32 leftAdjust, s32 rightAdjust, s32 upperAdjust, s32 lowerAdjust); @@ -1174,13 +188,6 @@ void TransitionFade_Draw(void* thisx, Gfx** gfxP); s32 TransitionFade_IsDone(void* thisx); void TransitionFade_SetColor(void* thisx, u32 color); void TransitionFade_SetType(void* thisx, s32 type); -void Letterbox_SetSizeTarget(s32 target); -u32 Letterbox_GetSizeTarget(void); -void Letterbox_SetSize(s32 size); -u32 Letterbox_GetSize(void); -void Letterbox_Init(void); -void Letterbox_Destroy(void); -void Letterbox_Update(s32 updateRate); // ENABLE_CAMERA_DEBUGGER void DebugCamera_Init(DebugCam* debugCam, Camera* cameraPtr); @@ -1190,16 +197,6 @@ void DebugCamera_Reset(Camera* cam, DebugCam* debugCam); void func_800BB0A0(f32 u, Vec3f* pos, f32* roll, f32* viewAngle, f32* point0, f32* point1, f32* point2, f32* point3); s32 func_800BB2B4(Vec3f* pos, f32* roll, f32* fov, CutsceneCameraPoint* point, s16* keyFrame, f32* curFrame); -void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl); -void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl); -void KaleidoManager_Init(PlayState* play); -void KaleidoManager_Destroy(void); -void* KaleidoManager_GetRamAddr(void* vram); -void KaleidoScopeCall_LoadPlayer(void); -void KaleidoScopeCall_Init(PlayState* play); -void KaleidoScopeCall_Destroy(PlayState* play); -void KaleidoScopeCall_Update(PlayState* play); -void KaleidoScopeCall_Draw(PlayState* play); s32 func_800C0D34(PlayState* this, Actor* actor, s16* yaw); s32 func_800C0DB4(PlayState* this, Vec3f* pos); @@ -1246,15 +243,6 @@ void Graph_Destroy(GraphicsContext* gfxCtx); void Graph_TaskSet00(GraphicsContext* gfxCtx); void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState); void Graph_ThreadEntry(void*); -void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size); -void* Graph_Alloc2(GraphicsContext* gfxCtx, size_t size); -#if IS_DEBUG -void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line); -void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line); -#endif -Gfx* Gfx_Open(Gfx* gfx); -Gfx* Gfx_Close(Gfx* gfx, Gfx* dst); -void* Gfx_Alloc(Gfx** gfxP, u32 size); ListAlloc* ListAlloc_Init(ListAlloc* this); void* ListAlloc_Alloc(ListAlloc* this, u32 size); void ListAlloc_Free(ListAlloc* this, void* data); @@ -1264,44 +252,6 @@ void SysCfb_Init(s32 n64dd); void* SysCfb_GetFbPtr(s32 idx); void* SysCfb_GetFbEnd(void); -void Math3D_DrawSphere(PlayState* play, Sphere16* sph); -void Math3D_DrawCylinder(PlayState* play, Cylinder16* cyl); -void Matrix_Init(GameState* gameState); -void Matrix_Push(void); -void Matrix_Pop(void); -void Matrix_Get(MtxF* dest); -void Matrix_Put(MtxF* src); -void Matrix_Mult(MtxF* mf, u8 mode); -void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode); -void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode); -void Matrix_RotateX(f32 x, u8 mode); -void Matrix_RotateY(f32 y, u8 mode); -void Matrix_RotateZ(f32 z, u8 mode); -void Matrix_RotateZYX(s16 x, s16 y, s16 z, u8 mode); -void Matrix_TranslateRotateZYX(Vec3f* translation, Vec3s* rotation); -void Matrix_SetTranslateRotateYXZ(f32 translateX, f32 translateY, f32 translateZ, Vec3s* rot); -Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest); -#if IS_DEBUG -Mtx* Matrix_ToMtx(Mtx* dest, const char* file, int line); -Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, const char* file, int line); -#else -Mtx* Matrix_ToMtx(Mtx* dest); -Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx); -#endif -void Matrix_MultVec3f(Vec3f* src, Vec3f* dest); -void Matrix_MtxFCopy(MtxF* dest, MtxF* src); -void Matrix_MtxToMtxF(Mtx* src, MtxF* dest); -void Matrix_MultVec3fExt(Vec3f* src, Vec3f* dest, MtxF* mf); -void Matrix_Transpose(MtxF* mf); -void Matrix_ReplaceRotation(MtxF* mf); -void Matrix_MtxFToYXZRotS(MtxF* mf, Vec3s* rotDest, s32 flag); -void Matrix_MtxFToZYXRotS(MtxF* mf, Vec3s* rotDest, s32 flag); -void Matrix_RotateAxis(f32 angle, Vec3f* axis, u8 mode); -#if IS_DEBUG -MtxF* Matrix_CheckFloats(MtxF* mf, const char* file, int line); -#endif -void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, f32 translateX, f32 translateY, - f32 translateZ); u64* SysUcode_GetUCodeBoot(void); size_t SysUcode_GetUCodeBootSize(void); u64* SysUcode_GetUCode(void); @@ -1321,7 +271,7 @@ void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc); void DebugArena_Check(void); void DebugArena_Init(void* start, u32 size); void DebugArena_Cleanup(void); -u8 DebugArena_IsInitialized(void); +s32 DebugArena_IsInitialized(void); #if IS_DEBUG void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action); void* DebugArena_MallocDebug(u32 size, const char* file, int line); @@ -1330,233 +280,7 @@ void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line void DebugArena_FreeDebug(void* ptr, const char* file, int line); void DebugArena_Display(void); #endif -void DebugArena_Display(void); - -void UCodeDisas_Init(UCodeDisas*); -void UCodeDisas_Destroy(UCodeDisas*); -void UCodeDisas_Disassemble(UCodeDisas*, Gfx*); -void UCodeDisas_RegisterUCode(UCodeDisas*, s32, UCodeInfo*); -void UCodeDisas_SetCurUCode(UCodeDisas*, void*); -Acmd* AudioSynth_Update(Acmd* cmdStart, s32* cmdCnt, s16* aiStart, s32 aiBufLen); -void AudioHeap_DiscardFont(s32 fontId); -void AudioHeap_DiscardSequence(s32 seqId); -void AudioHeap_WritebackDCache(void* ramAddr, u32 size); -void* AudioHeap_AllocZeroedAttemptExternal(AudioAllocPool* pool, u32 size); -void* AudioHeap_AllocAttemptExternal(AudioAllocPool* pool, u32 size); -void* AudioHeap_AllocDmaMemory(AudioAllocPool* pool, u32 size); -void* AudioHeap_AllocDmaMemoryZeroed(AudioAllocPool* pool, u32 size); -void* AudioHeap_AllocZeroed(AudioAllocPool* pool, u32 size); -void* AudioHeap_Alloc(AudioAllocPool* pool, u32 size); -void AudioHeap_InitPool(AudioAllocPool* pool, void* ramAddr, u32 size); -void AudioHeap_PopPersistentCache(s32 tableType); -void AudioHeap_InitMainPools(s32 initPoolSize); -void* AudioHeap_AllocCached(s32 tableType, s32 size, s32 cache, s32 id); -void* AudioHeap_SearchCaches(s32 tableType, s32 cache, s32 id); -void* AudioHeap_SearchRegularCaches(s32 tableType, s32 cache, s32 id); -void AudioHeap_LoadFilter(s16* filter, s32 lowPassCutoff, s32 highPassCutoff); -s32 AudioHeap_ResetStep(void); -void AudioHeap_Init(void); -void* AudioHeap_SearchPermanentCache(s32 tableType, s32 id); -void* AudioHeap_AllocPermanent(s32 tableType, s32 id, u32 size); -void* AudioHeap_AllocSampleCache(u32 size, s32 fontId, void* sampleAddr, s8 medium, s32 cache); -void AudioHeap_ApplySampleBankCache(s32 sampleBankId); -void AudioLoad_DecreaseSampleDmaTtls(void); -void* AudioLoad_DmaSampleData(u32 devAddr, u32 size, s32 arg2, u8* dmaIndexRef, s32 medium); -void AudioLoad_InitSampleDmaBuffers(s32 numNotes); -s32 AudioLoad_IsFontLoadComplete(s32 fontId); -s32 AudioLoad_IsSeqLoadComplete(s32 seqId); -void AudioLoad_SetFontLoadStatus(s32 fontId, s32 loadStatus); -void AudioLoad_SetSeqLoadStatus(s32 seqId, s32 loadStatus); -void AudioLoad_SyncLoadSeqParts(s32 seqId, s32 arg1); -s32 AudioLoad_SyncLoadInstrument(s32 fontId, s32 instId, s32 drumId); -void AudioLoad_AsyncLoadSeq(s32 seqId, s32 arg1, s32 retData, OSMesgQueue* retQueue); -void AudioLoad_AsyncLoadSampleBank(s32 sampleBankId, s32 arg1, s32 retData, OSMesgQueue* retQueue); -void AudioLoad_AsyncLoadFont(s32 fontId, s32 arg1, s32 retData, OSMesgQueue* retQueue); -u8* AudioLoad_GetFontsForSequence(s32 seqId, u32* outNumFonts); -void AudioLoad_DiscardSeqFonts(s32 seqId); -s32 AudioLoad_SyncInitSeqPlayer(s32 playerIdx, s32 seqId, s32 arg2); -s32 AudioLoad_SyncInitSeqPlayerSkipTicks(s32 playerIdx, s32 seqId, s32 skipTicks); -void AudioLoad_ProcessLoads(s32 resetStatus); -void AudioLoad_SetDmaHandler(DmaHandler callback); -void AudioLoad_Init(void* heap, u32 heapSize); -void AudioLoad_InitSlowLoads(void); -s32 AudioLoad_SlowLoadSample(s32 fontId, s32 instId, s8* status); -s32 AudioLoad_SlowLoadSeq(s32 seqId, u8* ramAddr, s8* status); -void AudioLoad_InitAsyncLoads(void); -void AudioLoad_LoadPermanentSamples(void); -void AudioLoad_ScriptLoad(s32 tableType, s32 id, s8* status); -void AudioLoad_ProcessScriptLoads(void); -void AudioLoad_InitScriptLoads(void); - -AudioTask* AudioThread_Update(void); -void AudioThread_QueueCmdF32(u32 opArgs, f32 data); -void AudioThread_QueueCmdS32(u32 opArgs, s32 data); -void AudioThread_QueueCmdS8(u32 opArgs, s8 data); -void AudioThread_QueueCmdU16(u32 opArgs, u16 data); -s32 AudioThread_ScheduleProcessCmds(void); -u32 func_800E5E20(u32* out); -u8* AudioThread_GetFontsForSequence(s32 seqId, u32* outNumFonts); -s32 func_800E5EDC(void); -s32 AudioThread_ResetAudioHeap(s32 specId); -void AudioThread_PreNMIInternal(void); -s32 func_800E6680(void); -u32 AudioThread_NextRandom(void); -void AudioThread_InitMesgQueues(void); -void Audio_InvalDCache(void* buf, s32 size); -void Audio_WritebackDCache(void* buf, s32 size); -s32 osAiSetNextBuffer(void*, u32); -void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs); -void Audio_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput); -void Audio_NoteInit(Note* note); -void Audio_NoteDisable(Note* note); -void Audio_ProcessNotes(void); -TunedSample* Audio_GetInstrumentTunedSample(Instrument* instrument, s32 semitone); -Instrument* Audio_GetInstrumentInner(s32 fontId, s32 instId); -Drum* Audio_GetDrum(s32 fontId, s32 drumId); -SoundEffect* Audio_GetSoundEffect(s32 fontId, s32 sfxId); -s32 Audio_SetFontInstrument(s32 instrumentType, s32 fontId, s32 index, void* value); -void Audio_SeqLayerDecayRelease(SequenceLayer* layer, s32 target); -void Audio_SeqLayerNoteDecay(SequenceLayer* layer); -void Audio_SeqLayerNoteRelease(SequenceLayer* layer); -s32 Audio_BuildSyntheticWave(Note* note, SequenceLayer* layer, s32 waveId); -void Audio_InitSyntheticWave(Note* note, SequenceLayer* layer); -void Audio_InitNoteList(AudioListItem* list); -void Audio_InitNoteLists(NotePool* pool); -void Audio_InitNoteFreeList(void); -void Audio_NotePoolClear(NotePool* pool); -void Audio_NotePoolFill(NotePool* pool, s32 count); -void Audio_AudioListPushFront(AudioListItem* list, AudioListItem* item); -void Audio_AudioListRemove(AudioListItem* item); -Note* Audio_FindNodeWithPrioLessThan(AudioListItem* list, s32 limit); -void Audio_NoteInitForLayer(Note* note, SequenceLayer* layer); -void func_800E82C0(Note* note, SequenceLayer* layer); -void Audio_NoteReleaseAndTakeOwnership(Note* note, SequenceLayer* layer); -Note* Audio_AllocNoteFromDisabled(NotePool* pool, SequenceLayer* layer); -Note* Audio_AllocNoteFromDecaying(NotePool* pool, SequenceLayer* layer); -Note* Audio_AllocNoteFromActive(NotePool* pool, SequenceLayer* layer); -Note* Audio_AllocNote(SequenceLayer* layer); -void Audio_NoteInitAll(void); -void Audio_SequenceChannelProcessSound(SequenceChannel* channel, s32 recalculateVolume, s32 applyBend); -void Audio_SequencePlayerProcessSound(SequencePlayer* seqPlayer); -f32 Audio_GetPortamentoFreqScale(Portamento* portamento); -s16 Audio_GetVibratoPitchChange(VibratoState* vib); -f32 Audio_GetVibratoFreqScale(VibratoState* vib); -void Audio_NoteVibratoUpdate(Note* note); -void Audio_NoteVibratoInit(Note* note); -void Audio_NotePortamentoInit(Note* note); -void Audio_AdsrInit(AdsrState* adsr, EnvelopePoint* envelope, s16* volOut); -f32 Audio_AdsrUpdate(AdsrState* adsr); -void AudioSeq_SequenceChannelDisable(SequenceChannel* channel); -void AudioSeq_SequencePlayerDisableAsFinished(SequencePlayer* seqPlayer); -void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer); -void AudioSeq_AudioListPushBack(AudioListItem* list, AudioListItem* item); -void* AudioSeq_AudioListPopBack(AudioListItem* list); -void AudioSeq_ProcessSequences(s32 arg0); -void AudioSeq_SkipForwardSequence(SequencePlayer* seqPlayer); -void AudioSeq_ResetSequencePlayer(SequencePlayer* seqPlayer); -void AudioSeq_InitSequencePlayerChannels(s32 playerIdx); -void AudioSeq_InitSequencePlayers(void); -void AudioOcarina_Start(u16 ocarinaFlags); -void AudioOcarina_SetInstrument(u8 ocarinaInstrumentId); -void AudioOcarina_SetPlaybackSong(s8 songIndexPlusOne, s8 playbackState); -void AudioOcarina_SetRecordingState(u8 recordingState); -OcarinaStaff* AudioOcarina_GetRecordingStaff(void); -OcarinaStaff* AudioOcarina_GetPlayingStaff(void); -OcarinaStaff* AudioOcarina_GetPlaybackStaff(void); -void AudioOcarina_MemoryGameInit(u8 minigameRound); -s32 AudioOcarina_MemoryGameNextNote(void); -void AudioOcarina_PlayLongScarecrowSong(void); - -// ENABLE_AUDIO_DEBUGGER -void AudioDebug_Draw(GfxPrint* printer); -void AudioDebug_ScrPrt(const char* str, u16 num); - -void Audio_Update(void); -void Audio_SetSfxProperties(u8 bankId, u8 entryIdx, u8 channelIndex); -void Audio_PlayCutsceneEffectsSequence(u8 csEffectType); -void func_800F4010(Vec3f* pos, u16 sfxId, f32); -void Audio_PlaySfxRandom(Vec3f* pos, u16 baseSfxId, u8 randLim); -void func_800F4138(Vec3f* pos, u16 sfxId, f32); -void func_800F4190(Vec3f* pos, u16 sfxId); -void func_800F436C(Vec3f* pos, u16 sfxId, f32 arg2); -void func_800F4414(Vec3f* pos, u16 sfxId, f32); -void func_800F44EC(s8 arg0, s8 arg1); -void func_800F4524(Vec3f* pos, u16 sfxId, s8 arg2); -void func_800F4254(Vec3f* pos, u8 level); -void Audio_PlaySfxRiver(Vec3f* pos, f32 freqScale); -void Audio_PlaySfxWaterfall(Vec3f* pos, f32 freqScale); -void Audio_SetBgmVolumeOffDuringFanfare(void); -void Audio_SetBgmVolumeOnDuringFanfare(void); -void Audio_SetMainBgmVolume(u8 targetVol, u8 volFadeTimer); -void Audio_SetGanonsTowerBgmVolumeLevel(u8 ganonsTowerLevel); -void Audio_LowerMainBgmVolume(u8 volume); -void Audio_PlaySfxIncreasinglyTransposed(Vec3f* pos, s16 sfxId, u8* semitones); -void Audio_ResetIncreasingTranspose(void); -void Audio_PlaySfxTransposed(Vec3f* pos, u16 sfxId, s8 semitone); -void func_800F4C58(Vec3f* pos, u16 sfxId, u8); -void func_800F4E30(Vec3f* pos, f32); -void Audio_ClearSariaBgm(void); -void Audio_ClearSariaBgmAtPos(Vec3f* pos); -void Audio_PlaySariaBgm(Vec3f* pos, u16 seqId, u16 distMax); -void Audio_ClearSariaBgm2(void); -void Audio_PlayMorningSceneSequence(u16 seqId); -void Audio_PlaySceneSequence(u16 seqId); -void Audio_SetMainBgmTempoFreqAfterFanfare(f32 scaleTempoAndFreq, u8 duration); -void Audio_PlayWindmillBgm(void); -void Audio_SetFastTempoForTimedMinigame(void); -void Audio_PlaySequenceInCutscene(u16 seqId); -void Audio_StopSequenceInCutscene(u16 seqId); -s32 Audio_IsSequencePlaying(u16 seqId); -void func_800F5ACC(u16 seqId); -void func_800F5B58(void); -void func_800F5BF0(u8 natureAmbienceId); -void Audio_PlayFanfare(u16); -void func_800F5C2C(void); -void Audio_PlaySequenceWithSeqPlayerIO(u8 seqPlayerIndex, u16 seqId, u8 fadeInDuration, s8 ioPort, s8 ioData); -void Audio_SetSequenceMode(u8 seqMode); -void Audio_SetBgmEnemyVolume(f32 dist); -void Audio_UpdateMalonSinging(f32 dist, u16 seqId); -void func_800F64E0(u8 arg0); -void Audio_ToggleMalonSinging(u8 malonSingingDisabled); -void Audio_SetEnvReverb(s8 reverb); -void Audio_SetCodeReverb(s8 reverb); -void func_800F6700(s8 audioSetting); -void Audio_SetBaseFilter(u8); -void Audio_SetExtraFilter(u8); -void Audio_SetCutsceneFlag(s8 flag); -void Audio_PlaySfxIfNotInCutscene(u16 sfxId); -void func_800F6964(u16); -void Audio_StopBgmAndFanfare(u16 fadeOutDuration); -void Audio_PreNMI(void); -void Audio_SetNatureAmbienceChannelIO(u8 channelIdxRange, u8 ioPort, u8 ioData); -void Audio_PlayNatureAmbienceSequence(u8 natureAmbienceId); -void Audio_Init(void); -void Audio_InitSound(void); -void func_800F7170(void); -void func_800F71BC(s32 arg0); - -void Audio_StartSequence(u8 seqPlayerIndex, u8 seqId, u8 seqArgs, u16 fadeInDuration); -void Audio_StopSequence(u8 seqPlayerIndex, u16 fadeOutDuration); -void Audio_QueueSeqCmd(u32 cmd); -void Audio_ProcessSeqCmds(void); -u16 Audio_GetActiveSeqId(u8 seqPlayerIndex); -s32 Audio_IsSeqCmdNotQueued(u32 cmdVal, u32 cmdMask); -void Audio_SetVolumeScale(u8 seqPlayerIndex, u8 scaleIndex, u8 targetVol, u8 volFadeTimer); -void Audio_UpdateActiveSequences(void); -u8 func_800FAD34(void); -void Audio_ResetActiveSequences(void); -void Audio_ResetActiveSequencesAndVolume(void); -void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a); -void GfxPrint_SetColor32(GfxPrint* this, u32 rgba); -void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y); -void GfxPrint_SetPos(GfxPrint* this, s32 x, s32 y); -void GfxPrint_SetBasePosPx(GfxPrint* this, s32 x, s32 y); -void GfxPrint_Init(GfxPrint* this); -void GfxPrint_Destroy(GfxPrint* this); -void GfxPrint_Open(GfxPrint* this, Gfx* dList); -Gfx* GfxPrint_Close(GfxPrint* this); -s32 GfxPrint_Printf(GfxPrint* this, const char* fmt, ...); void RcpUtils_PrintRegisterStatus(void); void RcpUtils_Reset(void); void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd); @@ -1587,178 +311,8 @@ s8 PadUtils_GetRelY(Input* input); void PadUtils_UpdateRelXY(Input* input); s32 PadSetup_Init(OSMesgQueue* mq, u8* outMask, OSContStatus* status); -void* SystemArena_Malloc(u32 size); -void* SystemArena_MallocR(u32 size); -void* SystemArena_Realloc(void* ptr, u32 newSize); -void SystemArena_Free(void* ptr); -void* SystemArena_Calloc(u32 num, u32 size); -void SystemArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc); -void SystemArena_Check(void); -void SystemArena_Init(void* start, u32 size); -void SystemArena_Cleanup(void); -u8 SystemArena_IsInitialized(void); -#if IS_DEBUG -void* SystemArena_MallocDebug(u32 size, const char* file, int line); -void* SystemArena_MallocRDebug(u32 size, const char* file, int line); -void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line); -void SystemArena_FreeDebug(void* ptr, const char* file, int line); -void SystemArena_Display(void); -#endif - -void __osMallocInit(Arena* arena, void* start, u32 size); -void __osMallocAddBlock(Arena* arena, void* start, s32 size); -void __osMallocCleanup(Arena* arena); -u8 __osMallocIsInitialized(Arena* arena); -void* __osMalloc(Arena* arena, u32 size); -void* __osMallocR(Arena* arena, u32 size); -void __osFree(Arena* arena, void* ptr); -void* __osRealloc(Arena* arena, void* ptr, u32 newSize); -void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc); -u32 __osCheckArena(Arena* arena); -#if IS_DEBUG -void* __osMallocDebug(Arena* arena, u32 size, const char* file, int line); -void* __osMallocRDebug(Arena* arena, u32 size, const char* file, int line); -void __osFreeDebug(Arena* arena, void* ptr, const char* file, int line); -void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, int line); -void __osDisplayArena(Arena* arena); -#endif -s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args); -s32 PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...); -void Sleep_Cycles(OSTime cycles); -void Sleep_Nsec(u32 nsec); -void Sleep_Usec(u32 usec); -void Sleep_Msec(u32 ms); -void Sleep_Sec(u32 sec); -void JpegUtils_ProcessQuantizationTable(u8* dqt, JpegQuantizationTable* qt, u8 count); -s32 JpegUtils_ParseHuffmanCodesLengths(u8* ptr, u8* codesLengths); -s32 JpegUtils_GetHuffmanCodes(u8* codesLengths, u16* codes); -s32 JpegUtils_SetHuffmanTable(u8* data, JpegHuffmanTable* ht, u16* codes); -u32 JpegUtils_ProcessHuffmanTableImpl(u8* data, JpegHuffmanTable* ht, u8* codesLengths, u16* codes, u8 isAc); -u32 JpegUtils_ProcessHuffmanTable(u8* dht, JpegHuffmanTable* ht, u8* codesLengths, u16* codes, u8 count); -void JpegUtils_SetHuffmanTableOld(u8* data, JpegHuffmanTableOld* ht, u8* codesLengths, u16* codes, s16 count, u8 isAc); -u32 JpegUtils_ProcessHuffmanTableImplOld(u8* dht, JpegHuffmanTableOld* ht, u8* codesLengths, u16* codes); -s32 JpegDecoder_Decode(JpegDecoder* decoder, u16* mcuBuff, s32 count, u8 isFollowing, JpegDecoderState* state); -s32 JpegDecoder_ProcessMcu(JpegHuffmanTable* hTable0, JpegHuffmanTable* hTable1, u16* mcu, s16* unk); -s32 JpegDecoder_ParseNextSymbol(JpegHuffmanTable* hTable, s16* outCoeff, s8* outZeroCount); -u16 JpegDecoder_ReadBits(u8 len); -s32 osPfsFreeBlocks(OSPfs* pfs, s32* leftoverBytes); -void guScale(Mtx* m, f32 x, f32 y, f32 z); -OSTask* _VirtualToPhysicalTask(OSTask* intp); -void osSpTaskLoad(OSTask* intp); -void osSpTaskStartGo(OSTask* tp); -void __osSiCreateAccessQueue(void); -void __osSiGetAccess(void); -void __osSiRelAccess(void); -s32 osContInit(OSMesgQueue* mq, u8* ctlBitfield, OSContStatus* status); -void __osContGetInitData(u8* ctlBitfield, OSContStatus* data); -void __osPackRequestData(u8 poll); -s32 osContStartReadData(OSMesgQueue* mq); -void osContGetReadData(OSContPad* contData); -void __osPackReadData(void); -void guPerspectiveF(f32 mf[4][4], u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale); -void guPerspective(Mtx* m, u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale); -s32 __osSpRawStartDma(s32 direction, void* devAddr, void* dramAddr, u32 size); -s32 __osSiRawStartDma(s32 dir, void* addr); -void osSpTaskYield(void); -s32 __osPfsGetNextPage(OSPfs* pfs, u8* bank, __OSInode* inode, __OSInodeUnit* page); -s32 osPfsReadWriteFile(OSPfs* pfs, s32 fileNo, u8 flag, s32 offset, s32 size, u8* data); -s32 __osPfsGetStatus(OSMesgQueue* queue, s32 channel); -void __osPfsRequestOneChannel(s32 channel, u8 cmd); -void __osPfsGetOneChannelData(s32 channel, OSContStatus* contData); -void guMtxIdentF(f32 mf[4][4]); -void guLookAtF(f32 mf[4][4], f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp); -void guLookAt(Mtx*, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp); -s32 osPfsAllocateFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32 fileSize, s32* fileNo); -s32 __osPfsDeclearPage(OSPfs* pfs, __OSInode* inode, s32 fileSizeInPages, s32* startPage, u8 bank, s32* decleared, - s32* finalPage); -s32 osStopTimer(OSTimer* timer); -u16 __osSumcalc(u8* ptr, s32 length); -s32 __osIdCheckSum(u16* ptr, u16* checkSum, u16* idSum); -s32 __osRepairPackId(OSPfs* pfs, __OSPackId* badid, __OSPackId* newid); -s32 __osCheckPackId(OSPfs* pfs, __OSPackId* check); -s32 __osGetId(OSPfs* pfs); -s32 __osCheckId(OSPfs* pfs); -s32 __osPfsRWInode(OSPfs* pfs, __OSInode* inode, u8 flag, u8 bank); -void guMtxL2F(MtxF* m1, Mtx* m2); -s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32* fileNo); -s32 osAfterPreNMI(void); -s32 osContStartQuery(OSMesgQueue* mq); -void osContGetQuery(OSContStatus* data); -void guLookAtHiliteF(f32 mf[4][4], LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, - f32 xUp, f32 yUp, f32 zUp, f32 xl1, f32 yl1, f32 zl1, f32 xl2, f32 yl2, f32 zl2, s32 hiliteWidth, - s32 hiliteHeight); -void guLookAtHilite(Mtx* m, LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, - f32 yUp, f32 zUp, f32 xl1, f32 yl1, f32 zl1, f32 xl2, f32 yl2, f32 zl2, s32 hiliteWidth, - s32 hiliteHeight); -u32 __osSpDeviceBusy(void); -void guMtxIdent(Mtx*); -void guPositionF(f32 mf[4][4], f32 rot, f32 pitch, f32 yaw, f32 scale, f32 x, f32 y, f32 z); -void guPosition(Mtx*, f32, f32, f32, f32, f32, f32, f32); -OSYieldResult osSpTaskYielded(OSTask* task); -void guRotateF(f32 m[4][4], f32 a, f32 x, f32 y, f32 z); -void guRotate(Mtx*, f32 a, f32 x, f32 y, f32 z); -s32 osAiSetFrequency(u32 frequency); -OSThread* __osGetActiveQueue(void); -void guNormalize(f32* x, f32* y, f32* z); -u32 osDpGetStatus(void); -void osDpSetStatus(u32 status); -s32 osPfsDeleteFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName); -s32 __osPfsReleasePages(OSPfs* pfs, __OSInode* inode, u8 initialPage, u8 bank, __OSInodeUnit* finalPage); -void guOrthoF(f32[4][4], f32, f32, f32, f32, f32, f32, f32); -void guOrtho(Mtx*, f32, f32, f32, f32, f32, f32, f32); -void osViSetEvent(OSMesgQueue* mq, OSMesg msg, u32 retraceCount); -s32 osPfsIsPlug(OSMesgQueue* mq, u8* pattern); -void __osPfsRequestData(u8 cmd); -void __osPfsGetInitData(u8* pattern, OSContStatus* contData); -void guS2DInitBg(uObjBg* bg); -s32 __osPfsSelectBank(OSPfs* pfs, u8 bank); -s32 osContSetCh(u8 ch); -s32 osPfsFileState(OSPfs* pfs, s32 fileNo, OSPfsState* state); -s32 osPfsInitPak(OSMesgQueue* queue, OSPfs* pfs, s32 channel); -s32 __osPfsCheckRamArea(OSPfs* pfs); -s32 osPfsChecker(OSPfs* pfs); -s32 func_80105788(OSPfs* pfs, __OSInodeCache* cache); -s32 func_80105A60(OSPfs* pfs, __OSInodeUnit fpage, __OSInodeCache* cache); -u32 osAiGetLength(void); -void guTranslate(Mtx* m, f32 x, f32 y, f32 z); -s32 __osContRamWrite(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer, s32 force); -s32 __osContRamRead(OSMesgQueue* ctrlrqueue, s32 channel, u16 addr, u8* data); -u8 __osContAddressCrc(u16 addr); -u8 __osContDataCrc(u8* data); -s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* mq, OSMesg msg); -u32 __osSpGetStatus(void); -void __osSpSetStatus(u32 status); -void osWritebackDCacheAll(void); -OSThread* __osGetCurrFaultedThread(void); -void guMtxF2L(MtxF* m1, Mtx* m2); -// ? __d_to_ll(?); -// ? __f_to_ll(?); -// ? __d_to_ull(?); -// ? __f_to_ull(?); -// ? __ll_to_d(?); -// ? __ll_to_f(?); -// ? __ull_to_d(?); -// ? __ull_to_f(?); -void* osViGetCurrentFramebuffer(void); -s32 __osSpSetPc(void* pc); f32 absf(f32); -void* __osMemset(void* dest, s32 val, size_t len); -void* __osMemmove(void* dest, const void* src, size_t len); -void Message_UpdateOcarinaMemoryGame(PlayState* play); -u8 Message_ShouldAdvance(PlayState* play); -void Message_CloseTextbox(PlayState*); -void Message_StartTextbox(PlayState* play, u16 textId, Actor* actor); -void Message_ContinueTextbox(PlayState* play, u16 textId); -void Message_StartOcarina(PlayState* play, u16 ocarinaActionId); -void Message_StartOcarinaSunsSongDisabled(PlayState* play, u16 ocarinaActionId); -u8 Message_GetState(MessageContext* msgCtx); -void Message_Draw(PlayState* play); -void Message_Update(PlayState* play); -void Message_SetTables(void); -void Interface_Destroy(PlayState* play); -void Interface_Init(PlayState* play); -void Message_Init(PlayState* play); void Regs_InitData(PlayState* play); void Setup_Init(GameState* thisx); diff --git a/include/gfx.h b/include/gfx.h index ab696f6e86..72c3793438 100644 --- a/include/gfx.h +++ b/include/gfx.h @@ -6,11 +6,12 @@ #include "sched.h" #include "thga.h" #include "config.h" +#include "versions.h" // Texture memory size, 4 KiB #define TMEM_SIZE 0x1000 -typedef struct { +typedef struct GfxPool { /* 0x00000 */ u16 headMagic; // GFXPOOL_HEAD_MAGIC /* 0x00008 */ Gfx polyOpaBuffer[POLY_OPA_BUFFER_SIZE]; /* 0x0BF08 */ Gfx polyXluBuffer[POLY_XLU_BUFFER_SIZE]; @@ -47,120 +48,79 @@ typedef struct GraphicsContext { /* 0x02E8 */ s32 fbIdx; /* 0x02EC */ void (*callback)(struct GraphicsContext*, void*); /* 0x02F0 */ void* callbackParam; +#if OOT_VERSION >= PAL_1_0 /* 0x02F4 */ f32 xScale; /* 0x02F8 */ f32 yScale; +#endif +#if IS_DEBUG /* 0x02FC */ Gfx* debugBuffer; TwoHeadGfxArena debug; +#endif } GraphicsContext; // size = 0x300 -typedef enum { - /* 0 */ SETUPDL_0, - /* 1 */ SETUPDL_1, - /* 2 */ SETUPDL_2, - /* 3 */ SETUPDL_3, - /* 4 */ SETUPDL_4, - /* 5 */ SETUPDL_5, - /* 6 */ SETUPDL_6, - /* 7 */ SETUPDL_7, - /* 8 */ SETUPDL_8, - /* 9 */ SETUPDL_9, - /* 10 */ SETUPDL_10, - /* 11 */ SETUPDL_11, - /* 12 */ SETUPDL_12, - /* 13 */ SETUPDL_13, - /* 14 */ SETUPDL_14, - /* 15 */ SETUPDL_15, - /* 16 */ SETUPDL_16, - /* 17 */ SETUPDL_17, - /* 18 */ SETUPDL_18, - /* 19 */ SETUPDL_19, - /* 20 */ SETUPDL_20, - /* 21 */ SETUPDL_21, - /* 22 */ SETUPDL_22, - /* 23 */ SETUPDL_23, - /* 24 */ SETUPDL_24, - /* 25 */ SETUPDL_25, - /* 26 */ SETUPDL_26, - /* 27 */ SETUPDL_27, - /* 28 */ SETUPDL_28, - /* 29 */ SETUPDL_29, - /* 30 */ SETUPDL_30, - /* 31 */ SETUPDL_31, - /* 32 */ SETUPDL_32, - /* 33 */ SETUPDL_33, - /* 34 */ SETUPDL_34, - /* 35 */ SETUPDL_35, - /* 36 */ SETUPDL_36, - /* 37 */ SETUPDL_37, - /* 38 */ SETUPDL_38, - /* 39 */ SETUPDL_39, - /* 40 */ SETUPDL_40, - /* 41 */ SETUPDL_41, - /* 42 */ SETUPDL_42, - /* 43 */ SETUPDL_43, - /* 44 */ SETUPDL_44, - /* 45 */ SETUPDL_45, - /* 46 */ SETUPDL_46, - /* 47 */ SETUPDL_47, - /* 48 */ SETUPDL_48, - /* 49 */ SETUPDL_49, - /* 50 */ SETUPDL_50, - /* 51 */ SETUPDL_51, - /* 52 */ SETUPDL_52, - /* 53 */ SETUPDL_53, - /* 54 */ SETUPDL_54, - /* 55 */ SETUPDL_55, - /* 56 */ SETUPDL_56, - /* 57 */ SETUPDL_57, - /* 58 */ SETUPDL_58, - /* 59 */ SETUPDL_59, - /* 60 */ SETUPDL_60, - /* 61 */ SETUPDL_61, - /* 62 */ SETUPDL_62, - /* 63 */ SETUPDL_63, - /* 64 */ SETUPDL_64, - /* 65 */ SETUPDL_65, - /* 66 */ SETUPDL_66, - /* 67 */ SETUPDL_67, - /* 68 */ SETUPDL_68, - /* 69 */ SETUPDL_69, - /* 70 */ SETUPDL_70, - /* 71 */ SETUPDL_MAX -} SetupDL; - -#define UCODE_NULL 0 -#define UCODE_F3DZEX 1 -#define UCODE_UNK 2 -#define UCODE_S2DEX 3 - -typedef struct { - /* 0x00 */ u32 type; - /* 0x04 */ void* ptr; -} UCodeInfo; // size = 0x8 - -typedef struct { - /* 0x00 */ uintptr_t segments[NUM_SEGMENTS]; - /* 0x40 */ Gfx* dlStack[18]; - /* 0x88 */ s32 dlDepth; - /* 0x8C */ u32 dlCnt; - /* 0x90 */ u32 vtxCnt; - /* 0x94 */ u32 spvtxCnt; - /* 0x98 */ u32 tri1Cnt; - /* 0x9C */ u32 tri2Cnt; - /* 0xA0 */ u32 quadCnt; - /* 0xA4 */ u32 lineCnt; - /* 0xA8 */ u32 loaducodeCnt; - /* 0xAC */ u32 pipeSyncRequired; - /* 0xB0 */ u32 tileSyncRequired; - /* 0xB4 */ u32 loadSyncRequired; - /* 0xB8 */ u32 syncErr; - /* 0xBC */ s32 enableLog; - /* 0xC0 */ s32 ucodeType; - /* 0xC4 */ s32 ucodeInfoCount; - /* 0xC8 */ UCodeInfo* ucodeInfo; - /* 0xCC */ u32 modeH; - /* 0xD0 */ u32 modeL; - /* 0xD4 */ u32 geometryMode; -} UCodeDisas; // size = 0xD8 +Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far); +Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far); +Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far); + +Gfx* Gfx_BranchTexScroll(Gfx** gfxP, u32 x, u32 y, s32 width, s32 height); +Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y); +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, + u32 y2, s32 width2, s32 height2); +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); +Gfx* Gfx_EnvColor(GraphicsContext* gfxCtx, s32 r, s32 g, s32 b, s32 a); +void Gfx_SetupFrame(GraphicsContext* gfxCtx, s32 clearFB, u8 r, u8 g, u8 b); +void Gfx_ClearZBuffer(GraphicsContext* gfxCtx); +void func_80095974(GraphicsContext* gfxCtx); + +void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size); +void* Graph_Alloc2(GraphicsContext* gfxCtx, size_t size); + +#define WORK_DISP __gfxCtx->work.p +#define POLY_OPA_DISP __gfxCtx->polyOpa.p +#define POLY_XLU_DISP __gfxCtx->polyXlu.p +#define OVERLAY_DISP __gfxCtx->overlay.p +#define DEBUG_DISP __gfxCtx->debug.p + +#if IS_DEBUG + +void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line); +void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line); + +// __gfxCtx shouldn't be used directly. +// Use the DISP macros defined above when writing to display buffers. +#define OPEN_DISPS(gfxCtx, ...) \ + { \ + GraphicsContext* __gfxCtx; \ + Gfx* dispRefs[4]; \ + __gfxCtx = gfxCtx; \ + (void)__gfxCtx; \ + Graph_OpenDisps(dispRefs, gfxCtx, __FILE__, __LINE__) + +#define CLOSE_DISPS(gfxCtx, ...) \ + do { \ + Graph_CloseDisps(dispRefs, gfxCtx, __FILE__, __LINE__); \ + } while (0); \ + } \ + (void)0 + +#define GRAPH_ALLOC(gfxCtx, size) Graph_Alloc(gfxCtx, size) + +#else + +#define OPEN_DISPS(gfxCtx, file, line) \ + { \ + GraphicsContext* __gfxCtx = gfxCtx; \ + s32 __dispPad + +#define CLOSE_DISPS(gfxCtx, file, line) \ + do {} while (0); \ + } \ + (void)0 + +#define GRAPH_ALLOC(gfxCtx, size) ((void*)((gfxCtx)->polyOpa.d = (Gfx*)((u8*)(gfxCtx)->polyOpa.d - ALIGN16(size)))) + +#endif #endif diff --git a/include/gfx_setupdl.h b/include/gfx_setupdl.h new file mode 100644 index 0000000000..1ba9ba06f5 --- /dev/null +++ b/include/gfx_setupdl.h @@ -0,0 +1,122 @@ +#ifndef GFX_SETUPDL_H +#define GFX_SETUPDL_H + +#include "ultra64.h" + +struct GraphicsContext; +struct PlayState; + +typedef enum SetupDL { + /* 0 */ SETUPDL_0, + /* 1 */ SETUPDL_1, + /* 2 */ SETUPDL_2, + /* 3 */ SETUPDL_3, + /* 4 */ SETUPDL_4, + /* 5 */ SETUPDL_5, + /* 6 */ SETUPDL_6, + /* 7 */ SETUPDL_7, + /* 8 */ SETUPDL_8, + /* 9 */ SETUPDL_9, + /* 10 */ SETUPDL_10, + /* 11 */ SETUPDL_11, + /* 12 */ SETUPDL_12, + /* 13 */ SETUPDL_13, + /* 14 */ SETUPDL_14, + /* 15 */ SETUPDL_15, + /* 16 */ SETUPDL_16, + /* 17 */ SETUPDL_17, + /* 18 */ SETUPDL_18, + /* 19 */ SETUPDL_19, + /* 20 */ SETUPDL_20, + /* 21 */ SETUPDL_21, + /* 22 */ SETUPDL_22, + /* 23 */ SETUPDL_23, + /* 24 */ SETUPDL_24, + /* 25 */ SETUPDL_25, + /* 26 */ SETUPDL_26, + /* 27 */ SETUPDL_27, + /* 28 */ SETUPDL_28, + /* 29 */ SETUPDL_29, + /* 30 */ SETUPDL_30, + /* 31 */ SETUPDL_31, + /* 32 */ SETUPDL_32, + /* 33 */ SETUPDL_33, + /* 34 */ SETUPDL_34, + /* 35 */ SETUPDL_35, + /* 36 */ SETUPDL_36, + /* 37 */ SETUPDL_37, + /* 38 */ SETUPDL_38, + /* 39 */ SETUPDL_39, + /* 40 */ SETUPDL_40, + /* 41 */ SETUPDL_41, + /* 42 */ SETUPDL_42, + /* 43 */ SETUPDL_43, + /* 44 */ SETUPDL_44, + /* 45 */ SETUPDL_45, + /* 46 */ SETUPDL_46, + /* 47 */ SETUPDL_47, + /* 48 */ SETUPDL_48, + /* 49 */ SETUPDL_49, + /* 50 */ SETUPDL_50, + /* 51 */ SETUPDL_51, + /* 52 */ SETUPDL_52, + /* 53 */ SETUPDL_53, + /* 54 */ SETUPDL_54, + /* 55 */ SETUPDL_55, + /* 56 */ SETUPDL_56, + /* 57 */ SETUPDL_57, + /* 58 */ SETUPDL_58, + /* 59 */ SETUPDL_59, + /* 60 */ SETUPDL_60, + /* 61 */ SETUPDL_61, + /* 62 */ SETUPDL_62, + /* 63 */ SETUPDL_63, + /* 64 */ SETUPDL_64, + /* 65 */ SETUPDL_65, + /* 66 */ SETUPDL_66, + /* 67 */ SETUPDL_67, + /* 68 */ SETUPDL_68, + /* 69 */ SETUPDL_69, + /* 70 */ SETUPDL_70, + /* 71 */ SETUPDL_MAX +} SetupDL; + +Gfx* Gfx_SetupDL(Gfx* gfx, u32 i); +Gfx* Gfx_SetupDL_57(Gfx* gfx); +Gfx* Gfx_SetupDL_52NoCD(Gfx* gfx); +void Gfx_SetupDL_57Opa(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_51Opa(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_54Opa(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_26Opa(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_25Xlu2(struct GraphicsContext* gfxCtx); +void func_80093C80(struct PlayState* play); +void Gfx_SetupDL_25Opa(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_25Xlu(struct GraphicsContext* gfxCtx); +Gfx* Gfx_SetupDL_64(Gfx* gfx); +Gfx* Gfx_SetupDL_34(Gfx* gfx); +void Gfx_SetupDL_44Xlu(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_36Opa(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_28Opa(struct GraphicsContext* gfxCtx); +Gfx* Gfx_SetupDL_28(Gfx* gfx); +void Gfx_SetupDL_38Xlu(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_4Xlu(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_37Opa(struct GraphicsContext* gfxCtx); +Gfx* Gfx_SetupDL_39(Gfx* gfx); +void Gfx_SetupDL_39Opa(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_39Overlay(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_39Ptr(Gfx** gfxP); +void Gfx_SetupDL_40Opa(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_41Opa(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_47Xlu(struct GraphicsContext* gfxCtx); +Gfx* Gfx_SetupDL_20NoCD(Gfx* gfx); +Gfx* Gfx_SetupDL_66(Gfx* gfx); +Gfx* func_800947AC(Gfx* gfx); +void Gfx_SetupDL_42Opa(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_42Overlay(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_27Xlu(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_60NoCDXlu(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_61Xlu(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_56Opa(struct GraphicsContext* gfxCtx); +void Gfx_SetupDL_56Ptr(Gfx** gfxP); + +#endif diff --git a/include/gfxalloc.h b/include/gfxalloc.h new file mode 100644 index 0000000000..158a2a9f58 --- /dev/null +++ b/include/gfxalloc.h @@ -0,0 +1,10 @@ +#ifndef GFXALLOC_H +#define GFXALLOC_H + +#include "ultra64.h" + +Gfx* Gfx_Open(Gfx* gfx); +Gfx* Gfx_Close(Gfx* gfx, Gfx* dst); +void* Gfx_Alloc(Gfx** gfxP, u32 size); + +#endif diff --git a/include/gfxprint.h b/include/gfxprint.h index d7b37fdb65..5409dec4a9 100644 --- a/include/gfxprint.h +++ b/include/gfxprint.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "color.h" -typedef struct { +typedef struct GfxPrint { /* 0x00 */ PrintCallback callback; /* 0x04 */ Gfx* dList; /* 0x08 */ u16 posX; @@ -33,7 +33,20 @@ typedef struct { #define GFXP_FLAG_RAINBOW (1 << 1) #define GFXP_FLAG_SHADOW (1 << 2) #define GFXP_FLAG_UPDATE (1 << 3) +#if !PLATFORM_N64 #define GFXP_FLAG_ENLARGE (1 << 6) +#endif #define GFXP_FLAG_OPEN (1 << 7) +void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a); +void GfxPrint_SetColor32(GfxPrint* this, u32 rgba); +void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y); +void GfxPrint_SetPos(GfxPrint* this, s32 x, s32 y); +void GfxPrint_SetBasePosPx(GfxPrint* this, s32 x, s32 y); +void GfxPrint_Init(GfxPrint* this); +void GfxPrint_Destroy(GfxPrint* this); +void GfxPrint_Open(GfxPrint* this, Gfx* dList); +Gfx* GfxPrint_Close(GfxPrint* this); +s32 GfxPrint_Printf(GfxPrint* this, const char* fmt, ...); + #endif diff --git a/include/global.h b/include/global.h index 9ab8e14b38..d2a081a5fb 100644 --- a/include/global.h +++ b/include/global.h @@ -4,5 +4,6 @@ #include "functions.h" #include "variables.h" #include "macros.h" +#include "versions.h" #endif diff --git a/include/ichain.h b/include/ichain.h index 8334237801..a77ed379ad 100644 --- a/include/ichain.h +++ b/include/ichain.h @@ -5,14 +5,14 @@ struct Actor; -typedef struct { +typedef struct InitChainEntry { u32 cont: 1; u32 type: 4; u32 offset: 11; s32 value: 16; } InitChainEntry; -typedef enum { +typedef enum InitChainType { /* 0x0 */ ICHAINTYPE_U8, // sets byte /* 0x1 */ ICHAINTYPE_S8, /* 0x2 */ ICHAINTYPE_U16, // sets short diff --git a/include/irqmgr.h b/include/irqmgr.h index 69a749a494..b931977ab0 100644 --- a/include/irqmgr.h +++ b/include/irqmgr.h @@ -8,13 +8,13 @@ #define OS_SC_NMI_MSG 3 // name is made up, 3 is OS_SC_RDP_DONE_MSG in the original sched.c #define OS_SC_PRE_NMI_MSG 4 -typedef enum { +typedef enum IrqResetStatus { IRQ_RESET_STATUS_IDLE, IRQ_RESET_STATUS_PRENMI, IRQ_RESET_STATUS_NMI } IrqResetStatus; -typedef struct { +typedef struct OSScMsg { /* 0x00 */ s16 type; /* 0x02 */ char misc[0x1E]; } OSScMsg; // size = 0x20 @@ -24,7 +24,7 @@ typedef struct IrqMgrClient { /* 0x04 */ OSMesgQueue* queue; } IrqMgrClient; -typedef struct { +typedef struct IrqMgr { /* 0x000 */ OSScMsg retraceMsg; /* 0x020 */ OSScMsg prenmiMsg; /* 0x040 */ OSScMsg nmiMsg; diff --git a/include/jpeg.h b/include/jpeg.h index 253d797bd4..4dab27632a 100644 --- a/include/jpeg.h +++ b/include/jpeg.h @@ -4,11 +4,11 @@ #include "ultra64.h" #include "sched.h" -typedef struct { +typedef struct JpegQuantizationTable { /* 0x00 */ u16 table[8*8]; } JpegQuantizationTable; // size = 0x80 -typedef struct { +typedef struct JpegHuffmanTable { /* 0x00 */ u8 codeOffs[16]; /* 0x10 */ u16 codesA[16]; /* 0x30 */ u16 codesB[16]; @@ -16,13 +16,13 @@ typedef struct { } JpegHuffmanTable; // size = 0x54 // this struct might be inaccurate but it's not used outside jpegutils.c anyways -typedef struct { +typedef struct JpegHuffmanTableOld { /* 0x000 */ u8 codeOffs[16]; /* 0x010 */ u16 dcCodes[120]; /* 0x100 */ u16 acCodes[256]; } JpegHuffmanTableOld; // size = 0x300 -typedef union { +typedef union JpegTaskData { struct { /* 0x00 */ u32 address; /* 0x04 */ u32 mbCount; @@ -35,7 +35,7 @@ typedef union { long long int force_structure_alignment; } JpegTaskData; // size = 0x20 -typedef struct { +typedef struct JpegWork { /* 0x000 */ JpegTaskData taskData; /* 0x020 */ u64 yieldData[0x200 / sizeof(u64)]; /* 0x220 */ JpegQuantizationTable qTableY; @@ -46,7 +46,7 @@ typedef struct { /* 0x6C0 */ u16 data[4][0x180]; } JpegWork; // size = 0x12C0 -typedef struct { +typedef struct JpegDecoder { /* 0x00 */ void* imageData; /* 0x04 */ u8 mode; /* 0x05 */ u8 unk_05; @@ -54,7 +54,7 @@ typedef struct { /* 0x18 */ u8 unk_18; } JpegDecoder; // size = 0x1C -typedef struct { +typedef struct JpegContext { /* 0x00 */ u8 dqtCount; /* 0x04 */ u8* dqtPtr[3]; /* 0x10 */ u8 dhtCount; @@ -67,7 +67,7 @@ typedef struct { /* 0xB4 */ JpegWork* workBuf; } JpegContext; // size = 0xB8 -typedef struct { +typedef struct JpegDecoderState { /* 0x00 */ u32 byteIdx; /* 0x04 */ u8 bitIdx; /* 0x05 */ u8 dontSkip; @@ -77,4 +77,11 @@ typedef struct { /* 0x10 */ s16 unk_10; } JpegDecoderState; // size = 0x14 +s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize); + +void JpegUtils_ProcessQuantizationTable(u8* dqt, JpegQuantizationTable* qt, u8 count); +u32 JpegUtils_ProcessHuffmanTable(u8* dht, JpegHuffmanTable* ht, u8* codesLengths, u16* codes, u8 count); + +s32 JpegDecoder_Decode(JpegDecoder* decoder, u16* mcuBuff, s32 count, u8 isFollowing, JpegDecoderState* state); + #endif diff --git a/include/kaleido_manager.h b/include/kaleido_manager.h new file mode 100644 index 0000000000..ce116752a4 --- /dev/null +++ b/include/kaleido_manager.h @@ -0,0 +1,39 @@ +#ifndef KALEIDO_MANAGER_H +#define KALEIDO_MANAGER_H + +#include "ultra64.h" +#include "romfile.h" + +struct PlayState; + +typedef struct KaleidoMgrOverlay { + /* 0x00 */ void* loadedRamAddr; + /* 0x04 */ RomFile file; + /* 0x0C */ void* vramStart; + /* 0x10 */ void* vramEnd; + /* 0x14 */ u32 offset; // loadedRamAddr - vramStart + /* 0x18 */ const char* name; +} KaleidoMgrOverlay; // size = 0x1C + +typedef enum KaleidoOverlayType { + /* 0 */ KALEIDO_OVL_KALEIDO_SCOPE, + /* 1 */ KALEIDO_OVL_PLAYER_ACTOR, + /* 2 */ KALEIDO_OVL_MAX +} KaleidoOverlayType; + +void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl); +void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl); +void KaleidoManager_Init(struct PlayState* play); +void KaleidoManager_Destroy(void); +void* KaleidoManager_GetRamAddr(void* vram); + +extern KaleidoMgrOverlay gKaleidoMgrOverlayTable[KALEIDO_OVL_MAX]; +extern KaleidoMgrOverlay* gKaleidoMgrCurOvl; + +void KaleidoScopeCall_LoadPlayer(void); +void KaleidoScopeCall_Init(struct PlayState* play); +void KaleidoScopeCall_Destroy(struct PlayState* play); +void KaleidoScopeCall_Update(struct PlayState* play); +void KaleidoScopeCall_Draw(struct PlayState* play); + +#endif diff --git a/include/letterbox.h b/include/letterbox.h new file mode 100644 index 0000000000..48d6ea7c13 --- /dev/null +++ b/include/letterbox.h @@ -0,0 +1,14 @@ +#ifndef LETTERBOX_H +#define LETTERBOX_H + +#include "ultra64.h" + +void Letterbox_SetSizeTarget(s32 target); +u32 Letterbox_GetSizeTarget(void); +void Letterbox_SetSize(s32 size); +u32 Letterbox_GetSize(void); +void Letterbox_Init(void); +void Letterbox_Destroy(void); +void Letterbox_Update(s32 updateRate); + +#endif diff --git a/include/libc/math.h b/include/libc/math.h index d8031ee1a6..b46b6cd911 100644 --- a/include/libc/math.h +++ b/include/libc/math.h @@ -41,8 +41,17 @@ f32 fabsf(f32 f); #define fabsf(f) __builtin_fabsf((f32)(f)) #endif -f32 sqrtf(f32 f); +f64 fabs(f64 f); #ifdef __sgi +#pragma intrinsic(fabs) +#else +#define fabs(f) __builtin_fabs((f64)(f)) +#endif + +f32 sqrtf(f32 f); +// IDO has a sqrtf intrinsic, but in N64 versions it's not used for some files. +// For these files we define NO_SQRTF_INTRINSIC to use the sqrtf function instead. +#if defined(__sgi) && !defined(NO_SQRTF_INTRINSIC) #pragma intrinsic(sqrtf) #endif @@ -51,8 +60,10 @@ f64 sqrt(f64 f); #pragma intrinsic(sqrt) #endif +#if !PLATFORM_N64 extern float qNaN0x3FFFFF; extern float qNaN0x10000; extern float sNaN0x3FFFFF; +#endif #endif diff --git a/include/libc/string.h b/include/libc/string.h index 3f9a5cee71..3e2e6be592 100644 --- a/include/libc/string.h +++ b/include/libc/string.h @@ -7,5 +7,7 @@ char* strchr(const char*, int); size_t strlen(const char*); void* memcpy(void*, const void*, size_t); +void* memmove(void* dest, const void* src, size_t len); +void* memset(void* dest, int val, size_t len); #endif diff --git a/include/libc64/aprintf.h b/include/libc64/aprintf.h new file mode 100644 index 0000000000..e6aad4bc79 --- /dev/null +++ b/include/libc64/aprintf.h @@ -0,0 +1,11 @@ +#ifndef LIBC64_APRINTF_H +#define LIBC64_APRINTF_H + +#include "ultra64.h" + +#include "stdarg.h" + +s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args); +s32 PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...); + +#endif diff --git a/include/libc64/malloc.h b/include/libc64/malloc.h new file mode 100644 index 0000000000..9acee66097 --- /dev/null +++ b/include/libc64/malloc.h @@ -0,0 +1,28 @@ +#ifndef LIBC64_MALLOC_H +#define LIBC64_MALLOC_H + +#include "ultra64.h" +#include "libc64/os_malloc.h" + +void* SystemArena_Malloc(u32 size); +void* SystemArena_MallocR(u32 size); +void* SystemArena_Realloc(void* ptr, u32 newSize); +void SystemArena_Free(void* ptr); +void* SystemArena_Calloc(u32 num, u32 size); +void SystemArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc); +void SystemArena_Check(void); +void SystemArena_Init(void* start, u32 size); +void SystemArena_Cleanup(void); +s32 SystemArena_IsInitialized(void); + +#if IS_DEBUG +void* SystemArena_MallocDebug(u32 size, const char* file, int line); +void* SystemArena_MallocRDebug(u32 size, const char* file, int line); +void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line); +void SystemArena_FreeDebug(void* ptr, const char* file, int line); +void SystemArena_Display(void); +#endif + +extern Arena gSystemArena; + +#endif diff --git a/include/fp_math.h b/include/libc64/math64.h similarity index 85% rename from include/fp_math.h rename to include/libc64/math64.h index 26f9b171b7..acd6992b77 100644 --- a/include/fp_math.h +++ b/include/libc64/math64.h @@ -1,5 +1,5 @@ -#ifndef FP_MATH_H -#define FP_MATH_H +#ifndef LIBC64_MATH64_H +#define LIBC64_MATH64_H #include "ultra64.h" diff --git a/include/libc64/os_malloc.h b/include/libc64/os_malloc.h new file mode 100644 index 0000000000..e31a6f08fa --- /dev/null +++ b/include/libc64/os_malloc.h @@ -0,0 +1,72 @@ +#ifndef LIBC64_OS_MALLOC_H +#define LIBC64_OS_MALLOC_H + +#include "ultra64.h" + +struct ArenaNode; + +typedef struct Arena { + /* 0x00 */ struct ArenaNode* head; + /* 0x04 */ void* start; +#if PLATFORM_N64 + /* 0x08 */ u32 size; + /* 0x0C */ u8 allocFailures; +#elif PLATFORM_GC + /* 0x08 */ OSMesgQueue lockQueue; + /* 0x20 */ u8 allocFailures; // only used in non-debug builds + /* 0x21 */ u8 isInit; + /* 0x22 */ u8 flag; +#endif +} Arena; // size = 0x10 (N64), size = 0x24 (GC) + +typedef struct ArenaNode { + /* 0x00 */ s16 magic; + /* 0x02 */ s16 isFree; + /* 0x04 */ u32 size; + /* 0x08 */ struct ArenaNode* next; + /* 0x0C */ struct ArenaNode* prev; +#if PLATFORM_N64 || OOT_DEBUG + /* 0x10 */ const char* filename; + /* 0x14 */ int line; + /* 0x18 */ OSId threadId; + /* 0x1C */ Arena* arena; + /* 0x20 */ OSTime time; + /* 0x28 */ u8 unk_28[0x30-0x28]; // probably padding +#endif +} ArenaNode; // size = 0x30 (N64 and GC debug), size = 0x10 (GC retail) + +#if PLATFORM_N64 +#define DECLARE_INTERRUPT_MASK OSIntMask __mask; +#define CLEAR_INTERRUPTS() __mask = osSetIntMask(OS_IM_NONE) +#define DISABLE_INTERRUPTS() __mask = osSetIntMask(OS_IM_NONE) +#define RESTORE_INTERRUPTS() osSetIntMask(__mask) +#else +#define DECLARE_INTERRUPT_MASK +#define CLEAR_INTERRUPTS() (void)0 +#define DISABLE_INTERRUPTS() (void)0 +#define RESTORE_INTERRUPTS() (void)0 +#endif + +void __osMallocInit(Arena* arena, void* start, s32 size); +void __osMallocCleanup(Arena* arena); +s32 __osMallocIsInitialized(Arena* arena); +void* __osMalloc(Arena* arena, u32 size); +void* __osMallocR(Arena* arena, u32 size); +void __osFree(Arena* arena, void* ptr); +void* __osRealloc(Arena* arena, void* ptr, u32 newSize); +void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc); +s32 __osCheckArena(Arena* arena); + +#if OOT_DEBUG +void* __osMallocDebug(Arena* arena, u32 size, const char* file, int line); +void* __osMallocRDebug(Arena* arena, u32 size, const char* file, int line); +void __osFreeDebug(Arena* arena, void* ptr, const char* file, int line); +void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, int line); +void __osDisplayArena(Arena* arena); + +extern u32 __osMalloc_FreeBlockTest_Enable; +#else +extern u32 gTotalAllocFailures; +#endif + +#endif diff --git a/include/libc64/qrand.h b/include/libc64/qrand.h new file mode 100644 index 0000000000..cc66d4f43b --- /dev/null +++ b/include/libc64/qrand.h @@ -0,0 +1,18 @@ +#ifndef LIBC64_QRAND_H +#define LIBC64_QRAND_H + +#include "ultra64.h" + +u32 Rand_Next(void); +void Rand_Seed(u32 seed); +f32 Rand_ZeroOne(void); +void Rand_Seed_Variable(u32* rndNum, u32 seed); +u32 Rand_Next_Variable(u32* rndNum); +f32 Rand_ZeroOne_Variable(u32* rndNum); + +#if !PLATFORM_N64 +f32 Rand_Centered(void); +f32 Rand_Centered_Variable(u32* rndNum); +#endif + +#endif diff --git a/include/libc64/sleep.h b/include/libc64/sleep.h new file mode 100644 index 0000000000..88eba0a785 --- /dev/null +++ b/include/libc64/sleep.h @@ -0,0 +1,12 @@ +#ifndef LIBC64_SLEEP_H +#define LIBC64_SLEEP_H + +#include "ultra64.h" + +void Sleep_Cycles(OSTime cycles); +void Sleep_Nsec(u32 nsec); +void Sleep_Usec(u32 usec); +void Sleep_Msec(u32 ms); +void Sleep_Sec(u32 sec); + +#endif diff --git a/include/libc/stdio.h b/include/libc64/sprintf.h similarity index 64% rename from include/libc/stdio.h rename to include/libc64/sprintf.h index ce91816145..485f938f58 100644 --- a/include/libc/stdio.h +++ b/include/libc64/sprintf.h @@ -1,9 +1,11 @@ -#ifndef STDIO_H -#define STDIO_H +#ifndef LIBC64_SPRINTF_H +#define LIBC64_SPRINTF_H + +#include "ultra64.h" #include "stdarg.h" -int sprintf(char* dst, const char* fmt, ...); int vsprintf(char* dst, const char* fmt, va_list args); +int sprintf(char* dst, const char* fmt, ...); #endif diff --git a/include/macros.h b/include/macros.h index 45ee7131f2..e3cce94ab6 100644 --- a/include/macros.h +++ b/include/macros.h @@ -1,18 +1,27 @@ #ifndef MACROS_H #define MACROS_H +#include "versions.h" + #ifndef AVOID_UB #define BAD_RETURN(type) type #else #define BAD_RETURN(type) void #endif +/** + * The T macro holds translations in English for original debug strings written in Japanese. + * The translated strings match the original debug strings, they are only direct translations. + * For example, any original name is left as is rather than being replaced with the name in the codebase. + */ +#define T(jp, en) jp + #define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) #define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0])) +#define ARRAY_COUNT_2D(arr) (s32)(sizeof(arr) / sizeof(arr[0][0])) #define PHYSICAL_TO_VIRTUAL(addr) (void*)((uintptr_t)(addr) + 0x80000000) #define VIRTUAL_TO_PHYSICAL(addr) (uintptr_t)((u8*)(addr) - 0x80000000) -#define SEGMENTED_TO_VIRTUAL(addr) PHYSICAL_TO_VIRTUAL(gSegments[SEGMENT_NUMBER(addr)] + SEGMENT_OFFSET(addr)) #define ABS(x) ((x) >= 0 ? (x) : -(x)) #define DECR(x) ((x) == 0 ? 0 : --(x)) @@ -30,77 +39,6 @@ #define RGBA8(r, g, b, a) ((((r) & 0xFF) << 24) | (((g) & 0xFF) << 16) | (((b) & 0xFF) << 8) | (((a) & 0xFF) << 0)) -#define LINK_IS_ADULT (gSaveContext.save.linkAge == LINK_AGE_ADULT) -#define LINK_IS_CHILD (gSaveContext.save.linkAge == LINK_AGE_CHILD) - -#define YEARS_CHILD 5 -#define YEARS_ADULT 17 -#define LINK_AGE_IN_YEARS (!LINK_IS_ADULT ? YEARS_CHILD : YEARS_ADULT) - -#define CLOCK_TIME(hr, min) ((s32)(((hr) * 60 + (min)) * (f32)0x10000 / (24 * 60) + 0.5f)) - -#define IS_DAY (gSaveContext.save.nightFlag == 0) -#define IS_NIGHT (gSaveContext.save.nightFlag == 1) - -#define SLOT(item) gItemSlots[item] -#define INV_CONTENT(item) gSaveContext.save.info.inventory.items[SLOT(item)] -#define AMMO(item) gSaveContext.save.info.inventory.ammo[SLOT(item)] -#define BEANS_BOUGHT AMMO(ITEM_MAGIC_BEAN + 1) - -#define ALL_EQUIP_VALUE(equip) ((s32)(gSaveContext.save.info.inventory.equipment & gEquipMasks[equip]) >> gEquipShifts[equip]) -#define CUR_EQUIP_VALUE(equip) ((s32)(gSaveContext.save.info.equips.equipment & gEquipMasks[equip]) >> gEquipShifts[equip]) -#define OWNED_EQUIP_FLAG(equip, value) (gBitFlags[value] << gEquipShifts[equip]) -#define OWNED_EQUIP_FLAG_ALT(equip, value) ((1 << (value)) << gEquipShifts[equip]) -#define CHECK_OWNED_EQUIP(equip, value) (OWNED_EQUIP_FLAG(equip, value) & gSaveContext.save.info.inventory.equipment) -#define CHECK_OWNED_EQUIP_ALT(equip, value) (gBitFlags[(value) + (equip) * 4] & gSaveContext.save.info.inventory.equipment) - -#define SWORD_EQUIP_TO_PLAYER(swordEquip) (swordEquip) -#define SHIELD_EQUIP_TO_PLAYER(shieldEquip) (shieldEquip) -#define TUNIC_EQUIP_TO_PLAYER(tunicEquip) ((tunicEquip) - 1) -#define BOOTS_EQUIP_TO_PLAYER(bootsEquip) ((bootsEquip) - 1) - -#define CUR_UPG_VALUE(upg) ((s32)(gSaveContext.save.info.inventory.upgrades & gUpgradeMasks[upg]) >> gUpgradeShifts[upg]) -#define CAPACITY(upg, value) gUpgradeCapacities[upg][value] -#define CUR_CAPACITY(upg) CAPACITY(upg, CUR_UPG_VALUE(upg)) - -#define CHECK_QUEST_ITEM(item) (gBitFlags[item] & gSaveContext.save.info.inventory.questItems) -#define CHECK_DUNGEON_ITEM(item, dungeonIndex) (gSaveContext.save.info.inventory.dungeonItems[dungeonIndex] & gBitFlags[item]) - -#define GET_GS_FLAGS(index) \ - ((gSaveContext.save.info.gsFlags[(index) >> 2] & gGsFlagsMasks[(index) & 3]) >> gGsFlagsShifts[(index) & 3]) -#define SET_GS_FLAGS(index, value) \ - (gSaveContext.save.info.gsFlags[(index) >> 2] |= (value) << gGsFlagsShifts[(index) & 3]) - -#define HIGH_SCORE(score) (gSaveContext.save.info.highScores[score]) - -#define GET_EVENTCHKINF(flag) (gSaveContext.save.info.eventChkInf[(flag) >> 4] & (1 << ((flag) & 0xF))) -#define SET_EVENTCHKINF(flag) (gSaveContext.save.info.eventChkInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) -#define CLEAR_EVENTCHKINF(flag) (gSaveContext.save.info.eventChkInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) - -#define GET_ITEMGETINF(flag) (gSaveContext.save.info.itemGetInf[(flag) >> 4] & (1 << ((flag) & 0xF))) -#define SET_ITEMGETINF(flag) (gSaveContext.save.info.itemGetInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) - -#define GET_INFTABLE(flag) (gSaveContext.save.info.infTable[(flag) >> 4] & (1 << ((flag) & 0xF))) -#define SET_INFTABLE(flag) (gSaveContext.save.info.infTable[(flag) >> 4] |= (1 << ((flag) & 0xF))) -#define CLEAR_INFTABLE(flag) (gSaveContext.save.info.infTable[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) - -#define GET_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] & (1 << ((flag) & 0xF))) -#define SET_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) -#define CLEAR_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) - -#define B_BTN_ITEM ((gSaveContext.buttonStatus[0] == ITEM_NONE) \ - ? ITEM_NONE \ - : (gSaveContext.save.info.equips.buttonItems[0] == ITEM_GIANTS_KNIFE) \ - ? ITEM_SWORD_BIGGORON \ - : gSaveContext.save.info.equips.buttonItems[0]) - -#define C_BTN_ITEM(button) ((gSaveContext.buttonStatus[(button) + 1] != BTN_DISABLED) \ - ? gSaveContext.save.info.equips.buttonItems[(button) + 1] \ - : ITEM_NONE) - -#define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0) -#define CHECK_BTN_ANY(state, combo) (((state) & (combo)) != 0) - #define CHECK_FLAG_ALL(flags, mask) (((flags) & (mask)) == (mask)) // IDO doesn't support variadic macros, but it merely throws a warning for the @@ -145,81 +83,23 @@ (state)->size = sizeof(newStruct); \ } while (0) -#define SET_FULLSCREEN_VIEWPORT(view) \ - { \ - Viewport viewport; \ - viewport.bottomY = SCREEN_HEIGHT; \ - viewport.rightX = SCREEN_WIDTH; \ - viewport.topY = 0; \ - viewport.leftX = 0; \ - View_SetViewport(view, &viewport); \ - } \ - (void)0 - -struct GraphicsContext; - -extern struct GraphicsContext* __gfxCtx; - -#define WORK_DISP __gfxCtx->work.p -#define POLY_OPA_DISP __gfxCtx->polyOpa.p -#define POLY_XLU_DISP __gfxCtx->polyXlu.p -#define OVERLAY_DISP __gfxCtx->overlay.p -#define DEBUG_DISP __gfxCtx->debug.p - #if IS_DEBUG -// __gfxCtx shouldn't be used directly. -// Use the DISP macros defined above when writing to display buffers. -#define OPEN_DISPS(gfxCtx, ...) \ - { \ - GraphicsContext* __gfxCtx; \ - Gfx* dispRefs[4]; \ - __gfxCtx = gfxCtx; \ - (void)__gfxCtx; \ - Graph_OpenDisps(dispRefs, gfxCtx, __FILE__, __LINE__) - -#define CLOSE_DISPS(gfxCtx, ...) \ - Graph_CloseDisps(dispRefs, gfxCtx, __FILE__, __LINE__); \ - } \ - (void)0 - -#define GRAPH_ALLOC(gfxCtx, size) Graph_Alloc(gfxCtx, size) -#define MATRIX_TO_MTX(gfxCtx, ...) Matrix_ToMtx(gfxCtx, __FILE__, __LINE__) -#define MATRIX_NEW(gfxCtx, ...) Matrix_NewMtx(gfxCtx, __FILE__, __LINE__) -#define MATRIX_CHECK_FLOATS(mtx, ...) Matrix_CheckFloats(mtx, __FILE__, __LINE__) -#define DMA_REQUEST_SYNC(ram, vrom, size, ...) DmaMgr_RequestSyncDebug(ram, vrom, size, __FILE__, __LINE__) -#define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, ...) DmaMgr_RequestAsyncDebug(req, ram, vrom, size, unk5, queue, msg, __FILE__, __LINE__) -#define GAME_STATE_ALLOC(gameState, size, ...) GameState_Alloc(gameState, size, __FILE__, __LINE__) -#define DEBUG_ARENA_MALLOC(size, ...) DebugArena_MallocDebug(size, __FILE__, __LINE__) -#define DEBUG_ARENA_MALLOC_R(size, ...) DebugArena_MallocRDebug(size, __FILE__, __LINE__) -#define DEBUG_ARENA_FREE(size, ...) DebugArena_FreeDebug(size, __FILE__, __LINE__) -#define SYSTEM_ARENA_MALLOC(size, ...) SystemArena_MallocDebug(size, __FILE__, __LINE__) -#define SYSTEM_ARENA_MALLOC_R(size, ...) SystemArena_MallocRDebug(size, __FILE__, __LINE__) -#define SYSTEM_ARENA_FREE(size, ...) SystemArena_FreeDebug(size, __FILE__, __LINE__) -#define ZELDA_ARENA_MALLOC(size, ...) ZeldaArena_MallocDebug(size, __FILE__, __LINE__) -#define ZELDA_ARENA_MALLOC_R(size, ...) ZeldaArena_MallocRDebug(size, __FILE__, __LINE__) -#define ZELDA_ARENA_FREE(size, ...) ZeldaArena_FreeDebug(size, __FILE__, __LINE__) -#define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, ...) LogUtils_CheckNullPointer(exp, ptr, __FILE__, __LINE__) -#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, ...) LogUtils_CheckValidPointer(exp, ptr, __FILE__, __LINE__) -#define HUNGUP_AND_CRASH(...) Fault_AddHungupAndCrash(__FILE__, __LINE__) -#define GAME_ALLOC_MALLOC(alloc, size, ...) GameAlloc_MallocDebug(alloc, size, __FILE__, __LINE__) +#define DMA_REQUEST_SYNC(ram, vrom, size, ...) DmaMgr_RequestSyncDebug(ram, vrom, size, __FILE__, __LINE__) +#define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, ...) DmaMgr_RequestAsyncDebug(req, ram, vrom, size, unk5, queue, msg, __FILE__, __LINE__) +#define GAME_STATE_ALLOC(gameState, size, ...) GameState_Alloc(gameState, size, __FILE__, __LINE__) +#define DEBUG_ARENA_MALLOC(size, ...) DebugArena_MallocDebug(size, __FILE__, __LINE__) +#define DEBUG_ARENA_MALLOC_R(size, ...) DebugArena_MallocRDebug(size, __FILE__, __LINE__) +#define DEBUG_ARENA_FREE(size, ...) DebugArena_FreeDebug(size, __FILE__, __LINE__) +#define SYSTEM_ARENA_MALLOC(size, ...) SystemArena_MallocDebug(size, __FILE__, __LINE__) +#define SYSTEM_ARENA_MALLOC_R(size, ...) SystemArena_MallocRDebug(size, __FILE__, __LINE__) +#define SYSTEM_ARENA_FREE(size, ...) SystemArena_FreeDebug(size, __FILE__, __LINE__) +#define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, ...) LogUtils_CheckNullPointer(exp, ptr, __FILE__, __LINE__) +#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, ...) LogUtils_CheckValidPointer(exp, ptr, __FILE__, __LINE__) +#define GAME_ALLOC_MALLOC(alloc, size, ...) GameAlloc_MallocDebug(alloc, size, __FILE__, __LINE__) #else -#define OPEN_DISPS(gfxCtx, ...) \ - { \ - GraphicsContext* __gfxCtx = gfxCtx; \ - s32 __dispPad - -#define CLOSE_DISPS(gfxCtx, ...) \ - (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, ...) Matrix_ToMtx(gfxCtx) -#define MATRIX_NEW(gfxCtx, ...) Matrix_NewMtx(gfxCtx) -#define MATRIX_CHECK_FLOATS(mtx, ...) (mtx) #define DMA_REQUEST_SYNC(ram, vrom, size, ...) DmaMgr_RequestSync(ram, vrom, size) #define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, ...) DmaMgr_RequestAsync(req, ram, vrom, size, unk5, queue, msg) #define GAME_STATE_ALLOC(gameState, size, ...) THA_AllocTailAlign16(&(gameState)->tha, size) @@ -229,20 +109,25 @@ extern struct GraphicsContext* __gfxCtx; #define SYSTEM_ARENA_MALLOC(size, ...) SystemArena_Malloc(size) #define SYSTEM_ARENA_MALLOC_R(size, ...) SystemArena_MallocR(size) #define SYSTEM_ARENA_FREE(size, ...) SystemArena_Free(size) -#define ZELDA_ARENA_MALLOC(size, ...) ZeldaArena_Malloc(size) -#define ZELDA_ARENA_MALLOC_R(size, ...) ZeldaArena_MallocR(size) -#define ZELDA_ARENA_FREE(size, ...) ZeldaArena_Free(size) #define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, ...) (void)0 #define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, ...) (void)0 -#define HUNGUP_AND_CRASH(...) LogUtils_HungupThread(__FILE__, __LINE__) #define GAME_ALLOC_MALLOC(alloc, size, ...) GameAlloc_Malloc(alloc, size) #endif /* IS_DEBUG */ +#if PLATFORM_N64 || OOT_DEBUG +#define HUNGUP_AND_CRASH(...) Fault_AddHungupAndCrash(__FILE__, __LINE__) +#else +#define HUNGUP_AND_CRASH(...) LogUtils_HungupThread(__FILE__, __LINE__) +#endif + +#define MATRIX_FINALIZE_AND_LOAD(pkt, gfxCtx, file, line) \ + gSPMatrix(pkt, MATRIX_FINALIZE(gfxCtx, file, line), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW) + #if OOT_NTSC -#define LANGUAGE_ARRAY(jpn, nes, ger, fra) { jpn, nes } +#define LANGUAGE_ARRAY(jpn, eng, ger, fra) { jpn, eng } #else -#define LANGUAGE_ARRAY(jpn, nes, ger, fra) { nes, ger, fra } +#define LANGUAGE_ARRAY(jpn, eng, ger, fra) { eng, ger, fra } #endif /** @@ -260,18 +145,25 @@ extern struct GraphicsContext* __gfxCtx; #define VTX_T(x,y,z,s,t,cr,cg,cb,a) { { x, y, z }, 0, { s, t }, { cr, cg, cb, a } } -#define gDPSetTileCustom(pkt, fmt, siz, width, height, pal, cms, cmt, masks, maskt, shifts, shiftt) \ - do { \ - gDPPipeSync(pkt); \ - gDPTileSync(pkt); \ - gDPSetTile(pkt, fmt, siz, (((width)*siz##_TILE_BYTES) + 7) >> 3, 0, G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, \ - masks, shifts); \ - gDPTileSync(pkt); \ - gDPSetTile(pkt, fmt, siz, (((width)*siz##_TILE_BYTES) + 7) >> 3, 0, G_TX_RENDERTILE, pal, cmt, maskt, shiftt, \ - cms, masks, shifts); \ - gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ - ((height)-1) << G_TEXTURE_IMAGE_FRAC); \ - } while (0) +#define gDPSetTileCustom(pkt, fmt, siz, uls, ult, lrs, lrt, pal, \ + cms, cmt, masks, maskt, shifts, shiftt) \ +_DW({ \ + gDPPipeSync(pkt); \ + gDPTileSync(pkt); \ + gDPSetTile(pkt, fmt, siz, \ + (((((lrs) - (uls) + 1) * siz##_TILE_BYTES) + 7) >> 3), 0, \ + G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPTileSync(pkt); \ + gDPSetTile(pkt, fmt, siz, \ + (((((lrs) - (uls) + 1) * siz##_LINE_BYTES) + 7) >> 3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, \ + (uls) << G_TEXTURE_IMAGE_FRAC, \ + (ult) << G_TEXTURE_IMAGE_FRAC, \ + (lrs) << G_TEXTURE_IMAGE_FRAC, \ + (lrt) << G_TEXTURE_IMAGE_FRAC); \ +}) #endif @@ -290,12 +182,6 @@ extern struct GraphicsContext* __gfxCtx; #define TIMER_DECR(val, target, changeBy) (((val - changeBy) < target) ? target : (val > target) ? (val - changeBy) : val) #define TIMER_INCR(val, target, changeBy) (((val + changeBy) > target) ? target : (val < target) ? (val + changeBy) : val) -#ifdef __GNUC__ -#define NO_REORDER __attribute__((section(".data"))) __attribute__((no_reorder)) -#else -#define NO_REORDER -#endif - // System for inserting SPDontSkipTexLoadsAcross for actors/effects which // manipulate segments to select texture indices. Note that this only needs to // be done for things which have a single material and which can appear multiple diff --git a/include/main.h b/include/main.h new file mode 100644 index 0000000000..495a0b9a9c --- /dev/null +++ b/include/main.h @@ -0,0 +1,12 @@ +#ifndef MAIN_H +#define MAIN_H + +#include "ultra64.h" + +extern s32 gScreenWidth; +extern s32 gScreenHeight; +extern u32 gSystemHeapSize; + +void Main(void* arg); + +#endif diff --git a/include/map.h b/include/map.h new file mode 100644 index 0000000000..23d3eb3c88 --- /dev/null +++ b/include/map.h @@ -0,0 +1,79 @@ +#ifndef MAP_H +#define MAP_H + +#include "ultra64.h" + +struct PlayState; + +typedef enum FloorID { + /* 1 */ F_8F = 1, + /* 2 */ F_7F, + /* 3 */ F_6F, + /* 4 */ F_5F, + /* 5 */ F_4F, + /* 6 */ F_3F, + /* 7 */ F_2F, + /* 8 */ F_1F, + /* 9 */ F_B1, + /* 10 */ F_B2, + /* 11 */ F_B3, + /* 12 */ F_B4, + /* 13 */ F_B5, + /* 14 */ F_B6, + /* 15 */ F_B7, + /* 16 */ F_B8 +} FloorID; + +// All arrays pointed in this struct are indexed by "map indices" +// In dungeons, the map index corresponds to the dungeon index (which also indexes keys, items, etc) +// In overworld areas, the map index corresponds to the overworld area index (spot 00, 01, etc) +typedef struct MapData { + /* 0x00 */ s16 (*floorTexIndexOffset)[8]; // dungeon texture index offset by floor + /* 0x04 */ s16* bossFloor; // floor the boss is on + /* 0x08 */ s16 (*roomPalette)[32]; // map palette by room + /* 0x0C */ s16* maxPaletteCount; // max number of palettes in a same floor + /* 0x10 */ s16 (*paletteRoom)[8][14]; // room by palette by floor + /* 0x14 */ s16 (*roomCompassOffsetX)[44]; // dungeon compass icon X offset by room + /* 0x18 */ s16 (*roomCompassOffsetY)[44]; // dungeon compass icon Y offset by room + /* 0x1C */ u8* dgnMinimapCount; // number of room minimaps + /* 0x20 */ u16* dgnMinimapTexIndexOffset; // dungeon minimap texture index offset + /* 0x24 */ u16* owMinimapTexSize; + /* 0x28 */ u16* owMinimapTexOffset; + /* 0x2C */ s16* owMinimapPosX; + /* 0x30 */ s16* owMinimapPosY; + /* 0x34 */ s16 (*owCompassInfo)[4]; // [X scale, Y scale, X offset, Y offset] + /* 0x38 */ s16* dgnTexIndexBase; // dungeon texture index base + /* 0x3C */ s16 (*dgnCompassInfo)[4]; // [X scale, Y scale, X offset, Y offset] + /* 0x40 */ s16* owMinimapWidth; + /* 0x44 */ s16* owMinimapHeight; + /* 0x48 */ s16* owEntranceIconPosX; // "dungeon entrance" icon X pos + /* 0x4C */ s16* owEntranceIconPosY; // "dungeon entrance" icon Y pos + /* 0x50 */ u16* owEntranceFlag; // flag in inf_table[26] based on which entrance icons are shown (0xFFFF = always shown) + /* 0x54 */ f32 (*floorCoordY)[8]; // Y coordinate of each floor + /* 0x58 */ u16* switchEntryCount; // number of "room switch" entries, which correspond to the next 3 arrays + /* 0x5C */ u8 (*switchFromRoom)[51]; // room to come from + /* 0x60 */ u8 (*switchFromFloor)[51]; // floor to come from + /* 0x64 */ u8 (*switchToRoom)[51]; // room to go to + /* 0x68 */ u8 (*floorID)[8]; + /* 0x6C */ s16* skullFloorIconY; // dungeon big skull icon Y pos +} MapData; // size = 0x70 + +// TODO get these properties from the textures themselves +#define MAP_I_TEX_WIDTH 96 +#define MAP_I_TEX_HEIGHT 85 +#define MAP_I_TEX_SIZE ((MAP_I_TEX_WIDTH * MAP_I_TEX_HEIGHT) / 2) // 96x85 I4 texture + +#define MAP_48x85_TEX_WIDTH 48 +#define MAP_48x85_TEX_HEIGHT 85 +#define MAP_48x85_TEX_SIZE ((MAP_48x85_TEX_WIDTH * MAP_48x85_TEX_HEIGHT) / 2) // 48x85 CI4 texture + +void Map_SavePlayerInitialInfo(struct PlayState* play); +void Map_SetFloorPalettesData(struct PlayState* play, s16 floor); +void Map_InitData(struct PlayState* play, s16 room); +void Map_InitRoomData(struct PlayState* play, s16 room); +void Map_Destroy(struct PlayState* play); +void Map_Init(struct PlayState* play); +void Minimap_Draw(struct PlayState* play); +void Map_Update(struct PlayState* play); + +#endif diff --git a/include/message_data_fmt.h b/include/message_data_fmt.h index afdfb7aee2..af9af59e50 100644 --- a/include/message_data_fmt.h +++ b/include/message_data_fmt.h @@ -77,11 +77,43 @@ #define MESSAGE_WIDE_HIGHSCORE 0x869F #define MESSAGE_WIDE_TIME 0x81A1 +/* + * Message character constants + */ + +// Non-Wide (nes/ger/fra) + +#define MESSAGE_CHAR_SPACE 0x20 // ' ' + +// Wide (jpn) + +#define MESSAGE_WIDE_CHAR_SPACE 0x8140 // ' ' +#define MESSAGE_WIDE_CHAR_TOUTEN 0x8141 // '、' +#define MESSAGE_WIDE_CHAR_KUTEN 0x8142 // '。' +#define MESSAGE_WIDE_CHAR_PERIOD 0x8144 // '.' +#define MESSAGE_WIDE_CHAR_NAKATEN 0x8145 // '・' +#define MESSAGE_WIDE_CHAR_QUESTION_MARK 0x8148 // '?' +#define MESSAGE_WIDE_CHAR_EXCLAMATION_MARK 0x8149 // '!' +#define MESSAGE_WIDE_CHAR_CIRCUMFLEX_ACCENT 0x814F // '^' +#define MESSAGE_WIDE_CHAR_DOUBLE_QUOTATION_MARK_LEFT 0x8167 // '“' +#define MESSAGE_WIDE_CHAR_DOUBLE_QUOTATION_MARK_RIGHT 0x8168 // '”' +#define MESSAGE_WIDE_CHAR_PARENTHESES_LEFT 0x8169 // '(' +#define MESSAGE_WIDE_CHAR_PARENTHESES_RIGHT 0x816A // ')' +#define MESSAGE_WIDE_CHAR_KAGIKAKKO_LEFT 0x8175 // '「' +#define MESSAGE_WIDE_CHAR_KAGIKAKKO_RIGHT 0x8176 // '」' +#define MESSAGE_WIDE_CHAR_NUMBER_SIGN 0x8194 // '#' +#define MESSAGE_WIDE_CHAR_ASTERISK 0x8196 // '*' +#define MESSAGE_WIDE_CHAR_ZERO 0x824F // '0' +#define MESSAGE_WIDE_CHAR_ONE 0x8250 // '1' +#define MESSAGE_WIDE_CHAR_HOURS 0x8E9E // '時' +#define MESSAGE_WIDE_CHAR_SECONDS 0x9562 // '秒' +#define MESSAGE_WIDE_CHAR_MINUTES 0x95AA // '分' + /* * Colors */ -typedef enum { +typedef enum TextColor { TEXT_COLOR_DEFAULT, TEXT_COLOR_RED, TEXT_COLOR_ADJUSTABLE, @@ -96,12 +128,12 @@ typedef enum { * Background */ -typedef enum { +typedef enum TextboxBackgroundIndex { TEXTBOX_BG_X_LEFT, TEXTBOX_BG_X_RIGHT } TextboxBackgroundIndex; -typedef enum { +typedef enum TextboxBackgroundForegroundColor { TEXTBOX_BG_FGCOL_WHITE, TEXTBOX_BG_FGCOL_DARK_RED, TEXTBOX_BG_FGCOL_ORANGE, @@ -112,14 +144,14 @@ typedef enum { TEXTBOX_BG_FGCOL_WHITE_7 } TextboxBackgroundForegroundColor; -typedef enum { +typedef enum TextboxBackgroundBackgroundColor { TEXTBOX_BG_BGCOL_BLACK, TEXTBOX_BG_BGCOL_GOLD, TEXTBOX_BG_BGCOL_BLACK_2, TEXTBOX_BG_BGCOL_BLACK_3 } TextboxBackgroundBackgroundColor; -typedef enum { +typedef enum TextboxBackgroundYOffsetIndex { TEXTBOX_BG_Y_OFFSET_1, TEXTBOX_BG_Y_OFFSET_2 } TextboxBackgroundYOffsetIndex; diff --git a/include/message_data_static.h b/include/message_data_static.h index 4b38aec6b2..2b08302731 100644 --- a/include/message_data_static.h +++ b/include/message_data_static.h @@ -3,8 +3,9 @@ #include "ultra64.h" #include "message_data_fmt.h" +#include "versions.h" -typedef enum { +typedef enum TextBoxType { /* 0 */ TEXTBOX_TYPE_BLACK, /* 1 */ TEXTBOX_TYPE_WOODEN, /* 2 */ TEXTBOX_TYPE_BLUE, @@ -14,18 +15,18 @@ typedef enum { /* 11 */ TEXTBOX_TYPE_CREDITS = 11 } TextBoxType; -typedef enum { +typedef enum TextBoxBackground { /* 0 */ TEXTBOX_BG_CROSS } TextBoxBackground; -typedef enum { +typedef enum TextBoxPosition { /* 0 */ TEXTBOX_POS_VARIABLE, /* 1 */ TEXTBOX_POS_TOP, /* 2 */ TEXTBOX_POS_MIDDLE, /* 3 */ TEXTBOX_POS_BOTTOM } TextBoxPosition; -typedef struct { +typedef struct MessageTableEntry { u16 textId; u8 typePos; const char* segment; diff --git a/include/n64dd.h b/include/n64dd.h new file mode 100644 index 0000000000..6a353c3172 --- /dev/null +++ b/include/n64dd.h @@ -0,0 +1,177 @@ +#ifndef N64DD_H +#define N64DD_H + +#include "ultra64.h" +#include "ultra64/leo.h" +#include "z64pause.h" +#include "z64scene.h" +#include "z64map_mark.h" +#include "versions.h" + +struct Font; +struct GameState; +struct MapData; +struct MessageTableEntry; +struct PlayState; +struct RegEditor; +struct RoomContext; +struct SaveContext; +struct Scene; + +// TODO Use the specific pointer types instead of void* +typedef struct n64ddStruct_800FEE70_pointers { + void* unk_00; + void* unk_04; + struct RegEditor* unk_08; + void* unk_0C[31]; + struct SaveContext* unk_88; + void* unk_8C[9]; +} n64ddStruct_800FEE70_pointers; // size = 0xB0 + +typedef struct n64ddStruct_80121220 { + void (*unk_00)(n64ddStruct_800FEE70_pointers*, struct n64ddStruct_80121220*); + void (*unk_04)(void); + void (*unk_08)(struct PlayState* play, struct RoomContext* roomCtx, s32 roomNum); + void (*unk_0C)(struct PlayState* play); + void (*unk_10)(struct PlayState* play); + void (*unk_14)(struct PlayState* play); + s32 (*unk_18)(struct MapData**); + s32 (*unk_1C)(struct MapData**); + s32 (*unk_20)(struct MapData*); + s32 (*unk_24)(void); + s32 (*unk_28)(struct PlayState*); + s32 (*unk_2C)(MapMarkData***); + s32 (*unk_30)(MapMarkData***); + void (*unk_34)(PauseMapMarksData**); + void (*unk_38)(PauseMapMarksData**); + void (*unk_3C)(void); + void (*unk_40)(void); + s32 (*unk_44)(struct PlayState*); + struct SceneTableEntry* (*unk_48)(s32 sceneId, struct SceneTableEntry* sceneTable); + char unk_4C[0x08]; + s32 (*unk_54)(struct PlayState*); +#if OOT_NTSC + void (*unk_58)(struct MessageTableEntry**, struct MessageTableEntry**, struct MessageTableEntry**); +#else + void (*unk_58)(struct MessageTableEntry**, const char***, const char***, struct MessageTableEntry**); +#endif + char unk_5C[0x4]; + s32 (*unk_60)(struct Font*); + s32 (*unk_64)(struct Font*); + s32 (*unk_68)(struct Font*); +#if OOT_PAL + s32 (*unk_6C_PAL)(struct Font*); +#endif + void (*unk_6C)(struct PlayState*, SceneDrawConfigFunc*); + s32 (*unk_70)(struct DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk, OSMesgQueue* queue, OSMesg msg); + void (*unk_74)(struct GameState*); + s32 (*unk_78)(struct PlayState*, void*, void*); +} n64ddStruct_80121220; // size = ? + +typedef struct struct_801E0D18 { + /* 0x00 */ LEOCmd unk_00; + /* 0x1C */ OSMesgQueue unk_1C; + /* 0x38 */ LEODiskID diskId; + /* 0x58 */ UNK_TYPE unk_58; + /* 0x5C */ UNK_TYPE unk_5C; + /* 0x60 */ u32 unk_60; + /* 0x64 */ u8 unk_64; + /* 0x65 */ u8 unk_65; + /* 0x66 */ u8 unk_66; + /* 0x68 */ s32 unk_68; + /* 0x6C */ s32 unk_6C; +} struct_801E0D18; // size = 0x70 + +typedef struct struct_801D9D50 { + /* 0x00 */ u8 unk_00; // command enum + /* 0x04 */ s32 unk_04; + /* 0x08 */ u8 unk_08; + /* 0x0C */ void (*unk_0C)(void*, void*, void*); + /* 0x10 */ s32 unk_10; + /* 0x14 */ void (*unk_14)(void*, uintptr_t, size_t); + /* 0x18 */ void* unk_18; + /* 0x1C */ void* unk_1C; // either OSMesgQueue* (command 0) or integer LBA (commands 2 and 3) + /* 0x20 */ void* unk_20; // either OSMesgQueue* (command 0) or integer byte size (commands 3 and 4) + /* 0x24 */ OSId unk_24; + /* 0x28 */ void* unk_28; + /* 0x2C */ OSPri unk_2C; +} struct_801D9D50; // size = 0x30 + +void func_800AD410(void); +void func_800AD488(void); +n64ddStruct_80121220* func_800AD4C0(n64ddStruct_80121220* arg0); +void func_800AD51C(void); +n64ddStruct_800FEE70_pointers* func_800AD560(void); +void func_800AD590(void); +void func_800AD598(s32 arg0, s32 arg1, s32 arg2); + +u32 func_801C6E80(void); +void func_801C6EA0(Gfx** gfxP); +s32 func_801C70FC(void); +void func_801C7268(void); +s32 func_801C7658(void); +s32 func_801C7818(void); +void func_801C7C1C(void* dest, s32 offset, s32 size); +void func_801C7E78(void); +void n64dd_SetDiskVersion(s32 arg0); + +s32 func_801C8000(struct_801D9D50* arg0); +s32 func_801C81C4(void); +void func_801C81EC(struct_801E0D18* arg0); +void func_801C8298(struct_801E0D18* arg0); +void func_801C82E0(struct_801E0D18* arg0); +void func_801C832C(struct_801E0D18* arg0); +void func_801C83A0(struct_801E0D18* arg0); +void func_801C8414(struct_801E0D18* arg0); +s32 func_801C873C(struct_801E0D18* arg0); + +void func_801C8AA8(void); +s32 func_801C91E0(struct_801E0D18*); +s32 func_801C9260(struct_801E0D18*); +s32 func_801C9334(struct_801E0D18*); +s32 func_801C93C4(struct_801E0D18*); + +void func_801C94F8(u8* arg0, u16 arg1); +void func_801C9A10(u8* arg0, s32 arg1, u8* str); +void func_801C9B50(s32 arg0, void (*arg1)(void*, uintptr_t, size_t)); + +u8* func_801C9E28(s32 errorNum); +u8* func_801C9EC0(void); +u8* func_801C9F90(s32 errorNum); +u8* func_801C9FFC(void); +u8* func_801CA030(s32 errorNum); +u8* func_801CA070(void); + +void func_801CA1F0(void* charTexBuf, s32 posX, s32 posY, s32 dx, s32 dy, s32 cy, void* frameBuf, s32 screenWidth); + +extern n64ddStruct_800FEE70_pointers D_800FEE70; +extern n64ddStruct_80121220* B_80121220; + +extern u8 D_80121210; +extern u8 D_80121211; +extern u8 D_80121212; +extern vu8 D_80121213; +extern vu8 D_80121214; + +extern s32 (*D_801D2E54)(struct_801E0D18*); + +extern u8 B_801DC000[]; + +extern s32 D_801D2E90; +extern OSMesgQueue* B_801E0D10[2]; + +extern s32 D_801D2EA0; +extern s32 D_801D2EA8; +extern s32 B_801E0F60; +extern s32 B_801E0F64; +extern void (*D_801D2EB4)(void*, void*, void*); + +// Error messages +extern const char* D_801D2ED0[]; // "Error Number " array +extern const char* D_801D2EE0[2][8][4]; // Array of error message strings + +// Error textures +extern u64 gN64DDError41Texs[2][0x600 / sizeof(u64)]; +extern u64 gN64DDPleaseReadManualTexs[2][0x2800 / sizeof(u64)]; + +#endif diff --git a/include/one_point_cutscene.h b/include/one_point_cutscene.h new file mode 100644 index 0000000000..2c829ba642 --- /dev/null +++ b/include/one_point_cutscene.h @@ -0,0 +1,18 @@ +#ifndef ONE_POINT_CUTSCENE_H +#define ONE_POINT_CUTSCENE_H + +#include "ultra64.h" + +struct Actor; +struct PlayState; + +s16 OnePointCutscene_Init(struct PlayState* play, s16 csId, s16 timer, struct Actor* actor, s16 parentCamId); +s16 OnePointCutscene_EndCutscene(struct PlayState* play, s16 subCamId); +s32 OnePointCutscene_Attention(struct PlayState* play, struct Actor* actor); +s32 OnePointCutscene_AttentionSetSfx(struct PlayState* play, struct Actor* actor, s32 sfxId); +void OnePointCutscene_EnableAttention(void); +void OnePointCutscene_DisableAttention(void); +s32 OnePointCutscene_CheckForCategory(struct PlayState* play, s32 actorCategory); +void OnePointCutscene_Noop(struct PlayState* play, s32 arg1); + +#endif diff --git a/include/padmgr.h b/include/padmgr.h index e46d037c31..064bdbc24f 100644 --- a/include/padmgr.h +++ b/include/padmgr.h @@ -3,8 +3,9 @@ #include "ultra64.h" #include "irqmgr.h" +#include "versions.h" -typedef enum { +typedef enum ControllerPakType { CONT_PAK_NONE, CONT_PAK_RUMBLE, CONT_PAK_OTHER @@ -57,9 +58,9 @@ void PadMgr_Init(PadMgr* padMgr, OSMesgQueue* serialEventQueue, IrqMgr* irqMgr, // Fetching inputs -// This function cannot be prototyped here without AVOID_UB because it is called incorrectly in fault.c (see bug in -// `Fault_PadCallback`) -#ifdef AVOID_UB +// This function cannot be prototyped here in all configurations because it is called incorrectly in fault_gc.c +// (see bug in `Fault_PadCallback`) +#if PLATFORM_N64 || defined(AVOID_UB) void PadMgr_RequestPadData(PadMgr* padmgr, Input* inputs, s32 gameRequest); #endif @@ -82,7 +83,7 @@ void PadMgr_RumbleSet(PadMgr* padMgr, u8* enable); * user-provided argument. The callback function should be `void (*)(PadMgr*, void*)`. * * @param callback callback to run before rumble state is updated for the current VI - * @param arg the argument to pass to the calback + * @param arg the argument to pass to the callback * * @see PADMGR_UNSET_RETRACE_CALLACK */ @@ -107,4 +108,6 @@ void PadMgr_RumbleSet(PadMgr* padMgr, u8* enable); } \ (void)0 +extern PadMgr gPadMgr; + #endif diff --git a/include/prerender.h b/include/prerender.h index 12f17f7ed9..ca16826341 100644 --- a/include/prerender.h +++ b/include/prerender.h @@ -8,7 +8,7 @@ typedef struct ListAlloc { /* 0x04 */ struct ListAlloc* next; } ListAlloc; // size = 0x8 -typedef struct { +typedef struct PreRender { /* 0x00 */ s32 width; /* 0x04 */ s32 height; /* 0x08 */ s32 widthSave; diff --git a/include/quake.h b/include/quake.h index a9a33b5288..0d97a5bf45 100644 --- a/include/quake.h +++ b/include/quake.h @@ -4,7 +4,7 @@ #include "z64camera.h" #include "z64math.h" -typedef struct { +typedef struct ShakeInfo { /* 0x00 */ Vec3f atOffset; /* 0x0C */ Vec3f eyeOffset; /* 0x18 */ s16 upPitchOffset; // gives a "roll" effect by offsetting the Up vector @@ -13,7 +13,7 @@ typedef struct { /* 0x20 */ f32 maxOffset; } ShakeInfo; // size = 0x24 -typedef enum { +typedef enum QuakeType { /* 0 */ QUAKE_TYPE_NONE, /* 1 */ QUAKE_TYPE_1, // Periodic, sustaining, random X perturbations /* 2 */ QUAKE_TYPE_2, // Aperiodic, sustaining, random X perturbations diff --git a/include/rand.h b/include/rand.h index 508c9d6466..d6844f4b74 100644 --- a/include/rand.h +++ b/include/rand.h @@ -1,15 +1,9 @@ #ifndef RAND_H #define RAND_H -#include "ultra64.h" +#include "libc64/qrand.h" -u32 Rand_Next(void); -void Rand_Seed(u32 seed); -f32 Rand_ZeroOne(void); -f32 Rand_Centered(void); -void Rand_Seed_Variable(u32* rndNum, u32 seed); -u32 Rand_Next_Variable(u32* rndNum); -f32 Rand_ZeroOne_Variable(u32* rndNum); -f32 Rand_Centered_Variable(u32* rndNum); +f32 Rand_ZeroFloat(f32 f); +f32 Rand_CenteredFloat(f32 f); #endif diff --git a/include/region.h b/include/region.h new file mode 100644 index 0000000000..b33375e6f5 --- /dev/null +++ b/include/region.h @@ -0,0 +1,9 @@ +#ifndef REGION_H +#define REGION_H + +#define REGION_NULL 0 +#define REGION_JP 1 +#define REGION_US 2 +#define REGION_EU 3 + +#endif diff --git a/include/regs.h b/include/regs.h index 19aa940618..ce267b9a9f 100644 --- a/include/regs.h +++ b/include/regs.h @@ -2,6 +2,7 @@ #define REGS_H #include "config.h" +#include "versions.h" #define REG_GROUPS 29 // number of REG groups, i.e. REG, SREG, OREG, etc. #define REG_PAGES 6 @@ -48,6 +49,7 @@ #define R_ENV_Z_FAR REG(13) #define R_ENV_FOG_NEAR REG(14) #define R_ENV_TIME_SPEED_OLD REG(15) // Most likely used during development. Unused in the final game. +#define R_DECELERATE_RATE REG(43) #define R_RUN_SPEED_LIMIT REG(45) #define R_ENABLE_ARENA_DBG SREG(0) @@ -103,6 +105,14 @@ #define R_TEXTBOX_TEXHEIGHT YREG(17) #define R_TEXTBOX_WIDTH YREG(22) #define R_TEXTBOX_HEIGHT YREG(23) +#if OOT_NTSC +#define R_KALEIDO_UNK1(i) YREG(48 + (i)) +#define R_KALEIDO_UNK2(i) YREG(50 + (i)) +#define R_KALEIDO_UNK3(i) YREG(52 + (i)) +#define R_KALEIDO_UNK4(i) YREG(54 + (i)) +#define R_KALEIDO_UNK5(i) YREG(56 + (i)) +#define R_KALEIDO_UNK6(i) YREG(58 + (i)) +#endif #define R_TEXTBOX_ICON_XPOS YREG(71) #define R_TEXTBOX_ICON_YPOS YREG(72) #define R_TEXTBOX_ICON_DIMENSION YREG(75) @@ -127,6 +137,7 @@ #define R_START_LABEL_Y(i) ZREG(51 + (i)) #define R_START_LABEL_X(i) ZREG(54 + (i)) #endif +#define R_PAUSE_QUEST_MEDALLION_SHINE_TIME(i) ZREG(61 + (i)) // i = 0..3 (clashes with ZREG(62) and ZREG(63)) #define R_C_UP_BTN_X ZREG(62) #define R_C_UP_BTN_Y ZREG(63) #define R_START_BTN_X ZREG(68) @@ -176,6 +187,8 @@ #define R_ROOM_CULL_USED_ENTRIES iREG(88) #define R_ROOM_CULL_DEBUG_TARGET iREG(89) #define R_B_LABEL_DD WREG(0) +#define R_PAUSE_PAGES_Y_ORIGIN_2 WREG(2) // Complements PauseContext.pagesYOrigin1 +#define R_PAUSE_DEPTH_OFFSET WREG(3) // Offset position of all pages away from the camera #if OOT_NTSC #define R_B_LABEL_SCALE(i) WREG(8 + (i)) #define R_B_LABEL_X(i) WREG(10 + (i)) @@ -190,6 +203,12 @@ #define R_B_LABEL_X(i) WREG(40 + (i)) #define R_B_LABEL_Y(i) WREG(43 + (i)) #define R_A_LABEL_Z(i) WREG(46 + (i)) +#define R_KALEIDO_UNK1(i) WREG(49 + (i)) +#define R_KALEIDO_UNK2(i) WREG(52 + (i)) +#define R_KALEIDO_UNK3(i) WREG(55 + (i)) +#define R_KALEIDO_UNK4(i) WREG(58 + (i)) +#define R_KALEIDO_UNK5(i) WREG(61 + (i)) +#define R_KALEIDO_UNK6(i) WREG(64 + (i)) #endif #define R_DGN_MINIMAP_X WREG(68) #define R_DGN_MINIMAP_Y WREG(69) @@ -205,6 +224,7 @@ #define R_COMPASS_OFFSET_X VREG(16) #define R_COMPASS_OFFSET_Y VREG(17) #define R_MINIMAP_COLOR(i) VREG(18 + (i)) +#define R_PAUSE_SONG_OCA_BTN_Y(ocarinaBtnIndex) VREG(21 + (ocarinaBtnIndex)) // VREG(21) to VREG(25) #define R_OCARINA_BUTTONS_XPOS VREG(28) #define R_OCARINA_BUTTONS_XPOS_OFFSET VREG(29) #define R_TEXT_ADJUST_COLOR_1_R VREG(33) @@ -214,7 +234,12 @@ #define R_TEXT_ADJUST_COLOR_2_G VREG(37) #define R_TEXT_ADJUST_COLOR_2_B VREG(38) #define R_OCARINA_BUTTONS_YPOS(note) VREG(45 + (note)) +#define R_OCARINA_BUTTONS_APPEAR_ALPHA_STEP VREG(50) #define R_OCARINA_BUTTONS_YPOS_OFFSET VREG(51) +#define R_KALEIDO_PROMPT_CURSOR_ALPHA_TIMER_BASE VREG(60) +#define R_KALEIDO_PROMPT_CURSOR_ALPHA VREG(61) +#define R_KALEIDO_PROMPT_CURSOR_ALPHA_STATE VREG(62) +#define R_KALEIDO_PROMPT_CURSOR_ALPHA_TIMER VREG(63) #define R_ITEM_AMMO_X(i) VREG(64 + (i)) #define R_ITEM_AMMO_Y(i) VREG(68 + (i)) #define R_ITEM_ICON_WIDTH(i) VREG(76 + (i)) @@ -232,7 +257,7 @@ #define R_HREG_MODE HREG(80) // see `HRegMode` for mode options -typedef enum { +typedef enum HRegMode { /* 6 */ HREG_MODE_PRINT_HILITE_INFO = 6, // print hilite information /* 7 */ HREG_MODE_UCODE_DISAS, // various controls for the ucode disas system /* 8 */ HREG_MODE_PRINT_MEMORY, // print memory at a specified address @@ -258,7 +283,7 @@ typedef enum { // HREG_MODE_UCODE_DISAS #define R_UCODE_DISAS_TOGGLE HREG(81) // < 0 enables and prints some hardware reg info for 1 frame, > 0 enables constant disas #define R_UCODE_DISAS_LOG_MODE HREG(82) // 1 and 2 print counts, 3 enables fault client, 4 disables open/close disps -#define R_UCODE_DISAS_LOG_LEVEL HREG(83) // enables various logging within the dissasembler itself +#define R_UCODE_DISAS_LOG_LEVEL HREG(83) // enables various logging within the dissassembler itself #define R_UCODE_DISAS_TOTAL_COUNT HREG(84) // read-only #define R_UCODE_DISAS_VTX_COUNT HREG(85) // read-only #define R_UCODE_DISAS_SPVTX_COUNT HREG(86) // read-only @@ -380,7 +405,7 @@ typedef enum { #define R_MOTION_BLUR_PRIORITY_ENABLED SREG(93) #define R_MOTION_BLUR_ENABLED SREG(95) -typedef struct { +typedef struct RegEditor { // ENABLE_REG_EDITOR /* 0x00 */ s32 regPage; // 0: no page selected (reg editor is not active); 1: first page; `REG_PAGES`: last page /* 0x04 */ s32 regGroup; // Indexed from 0 to `REG_GROUPS`-1. Each group has its own character to identify it. diff --git a/include/romfile.h b/include/romfile.h index a7022f45f4..49b5f202dc 100644 --- a/include/romfile.h +++ b/include/romfile.h @@ -3,7 +3,7 @@ #include "ultra64.h" -typedef struct { +typedef struct RomFile { /* 0x00 */ uintptr_t vromStart; /* 0x04 */ uintptr_t vromEnd; } RomFile; // size = 0x8 diff --git a/include/rumble.h b/include/rumble.h index 2ce8f4e71a..f8e0b82cb7 100644 --- a/include/rumble.h +++ b/include/rumble.h @@ -5,13 +5,13 @@ #define RUMBLE_MAX_REQUESTS 64 -typedef enum { +typedef enum RumbleState { RUMBLE_STATE_CLEAR, RUMBLE_STATE_RUNNING, RUMBLE_STATE_RESET } RumbleState; -typedef struct { +typedef struct RumbleMgr { /* 0x000 */ u8 rumbleEnable[MAXCONTROLLERS]; /* 0x004 */ u8 reqStrengths[RUMBLE_MAX_REQUESTS]; // Source strength modulated by distance to the source /* 0x044 */ u8 reqDurations[RUMBLE_MAX_REQUESTS]; // Duration until decreaseRate kicks in diff --git a/include/sched.h b/include/sched.h index da946bdce3..2d20e7ec09 100644 --- a/include/sched.h +++ b/include/sched.h @@ -3,6 +3,7 @@ #include "ultra64.h" #include "irqmgr.h" +#include "versions.h" #define OS_SC_NEEDS_RDP 0x0001 // Task uses the RDP #define OS_SC_NEEDS_RSP 0x0002 // Task uses the RSP @@ -19,7 +20,7 @@ #define OS_SC_RCP_MASK (OS_SC_NEEDS_RDP | OS_SC_NEEDS_RSP) #define OS_SC_TYPE_MASK (OS_SC_NEEDS_RDP | OS_SC_NEEDS_RSP | OS_SC_DRAM_DLIST) -typedef struct { +typedef struct CfbInfo { /* 0x00 */ u16* framebuffer; // current framebuffer /* 0x04 */ u16* swapBuffer; // framebuffer to swap to /* 0x08 */ OSViMode* viMode; @@ -27,8 +28,10 @@ typedef struct { /* 0x10 */ u8 unk_10; // set to 0, never read /* 0x11 */ s8 updateRate; // how many VIs should elapse before next swap /* 0x12 */ s8 updateTimer; // counts down (in VIs) from updateRate to 0, swaps the framebuffer at 0 +#if OOT_VERSION >= PAL_1_0 /* 0x14 */ f32 xScale; /* 0x18 */ f32 yScale; +#endif } CfbInfo; // size = 0x1C typedef struct OSScTask { @@ -43,7 +46,7 @@ typedef struct OSScTask { /* 0x60 */ OSTime totalTime; } OSScTask; // size = 0x68 -typedef struct { +typedef struct Scheduler { /* 0x0000 */ OSMesgQueue interruptQueue; /* 0x0018 */ OSMesg interruptMsgBuf[8]; /* 0x0038 */ OSMesgQueue cmdQueue; // queue for receiving OSScTask pointers @@ -67,4 +70,6 @@ typedef struct { void Sched_Notify(Scheduler* sc); void Sched_Init(Scheduler* sc, void* stack, OSPri priority, u8 viModeType, UNK_TYPE arg4, IrqMgr* irqMgr); +extern Scheduler gScheduler; + #endif diff --git a/include/segment_symbols.h b/include/segment_symbols.h index 7b4cfe47f6..2d4da158cc 100644 --- a/include/segment_symbols.h +++ b/include/segment_symbols.h @@ -1,6 +1,7 @@ #ifndef SEGMENT_SYMBOLS_H #define SEGMENT_SYMBOLS_H +#include "versions.h" #include "z64.h" #include "config.h" @@ -91,6 +92,12 @@ DECLARE_ROM_SEGMENT(debug) DECLARE_BSS_SEGMENT(debug) #endif +// N64-only, not wrapped in these are not wrapped in an `#if PLATFORM_N64` +// so that the N64DD code can always be built. +DECLARE_SEGMENT(n64dd) +DECLARE_ROM_SEGMENT(n64dd) +DECLARE_BSS_SEGMENT(n64dd) + DECLARE_OVERLAY_SEGMENT(kaleido_scope) DECLARE_OVERLAY_SEGMENT(player_actor) DECLARE_OVERLAY_SEGMENT(map_mark_data) diff --git a/include/segmented_address.h b/include/segmented_address.h new file mode 100644 index 0000000000..a4d05c74f3 --- /dev/null +++ b/include/segmented_address.h @@ -0,0 +1,11 @@ +#ifndef SEGMENTED_ADDRESS_H +#define SEGMENTED_ADDRESS_H + +#include "ultra64.h" +#include "stdint.h" + +extern uintptr_t gSegments[NUM_SEGMENTS]; + +#define SEGMENTED_TO_VIRTUAL(addr) (void*)(gSegments[SEGMENT_NUMBER(addr)] + SEGMENT_OFFSET(addr) + K0BASE) + +#endif diff --git a/include/seqcmd.h b/include/seqcmd.h index f6c42b7014..5acce7c493 100644 --- a/include/seqcmd.h +++ b/include/seqcmd.h @@ -1,11 +1,13 @@ #ifndef SEQCMD_H #define SEQCMD_H +#include "sequence.h" + // ==== Primary commands ==== #define SEQCMD_OP_MASK 0xF0000000 -typedef enum { +typedef enum SeqCmdOp { /* 0x0 */ SEQCMD_OP_PLAY_SEQUENCE, /* 0x1 */ SEQCMD_OP_STOP_SEQUENCE, /* 0x2 */ SEQCMD_OP_QUEUE_SEQUENCE, @@ -27,7 +29,7 @@ typedef enum { // ==== Secondary commands ==== // Subset of `SEQCMD_OP_TEMPO_CMD` -typedef enum { +typedef enum SeqCmdTempoCmdOp { /* 0x0 */ SEQCMD_SUB_OP_TEMPO_SET, /* 0x1 */ SEQCMD_SUB_OP_TEMPO_SPEED_UP, /* 0x2 */ SEQCMD_SUB_OP_TEMPO_SLOW_DOWN, @@ -36,7 +38,7 @@ typedef enum { } SeqCmdTempoCmdOp; // Subset of `SEQCMD_OP_SETUP_CMD` -typedef enum { +typedef enum SeqCmdSetupCmdOp { /* 0x0 */ SEQCMD_SUB_OP_SETUP_RESTORE_SEQPLAYER_VOLUME, /* 0x1 */ SEQCMD_SUB_OP_SETUP_SEQ_UNQUEUE, /* 0x2 */ SEQCMD_SUB_OP_SETUP_RESTART_SEQ, @@ -53,7 +55,7 @@ typedef enum { } SeqCmdSetupCmdOp; // Subset of `SEQCMD_OP_GLOBAL_CMD` -typedef enum { +typedef enum SeqCmdSubCmdOp { /* 0x0 */ SEQCMD_SUB_OP_GLOBAL_SET_SOUND_MODE, /* 0x1 */ SEQCMD_SUB_OP_GLOBAL_DISABLE_NEW_SEQUENCES } SeqCmdSubCmdOp; diff --git a/include/sequence.h b/include/sequence.h index 5f040d1ce9..d405e32362 100644 --- a/include/sequence.h +++ b/include/sequence.h @@ -1,137 +1,37 @@ #ifndef SEQUENCE_H #define SEQUENCE_H -typedef enum { - /* 0x00 */ NA_BGM_GENERAL_SFX, // General Sound Effects - /* 0x01 */ NA_BGM_NATURE_AMBIENCE, // Environmental nature background sounds - /* 0x02 */ NA_BGM_FIELD_LOGIC, // Hyrule Field - /* 0x03 */ NA_BGM_FIELD_INIT, // Hyrule Field Initial Segment From Loading Area - /* 0x04 */ NA_BGM_FIELD_DEFAULT_1, // Hyrule Field Moving Segment 1 - /* 0x05 */ NA_BGM_FIELD_DEFAULT_2, // Hyrule Field Moving Segment 2 - /* 0x06 */ NA_BGM_FIELD_DEFAULT_3, // Hyrule Field Moving Segment 3 - /* 0x07 */ NA_BGM_FIELD_DEFAULT_4, // Hyrule Field Moving Segment 4 - /* 0x08 */ NA_BGM_FIELD_DEFAULT_5, // Hyrule Field Moving Segment 5 - /* 0x09 */ NA_BGM_FIELD_DEFAULT_6, // Hyrule Field Moving Segment 6 - /* 0x0A */ NA_BGM_FIELD_DEFAULT_7, // Hyrule Field Moving Segment 7 - /* 0x0B */ NA_BGM_FIELD_DEFAULT_8, // Hyrule Field Moving Segment 8 - /* 0x0C */ NA_BGM_FIELD_DEFAULT_9, // Hyrule Field Moving Segment 9 - /* 0x0D */ NA_BGM_FIELD_DEFAULT_A, // Hyrule Field Moving Segment 10 - /* 0x0E */ NA_BGM_FIELD_DEFAULT_B, // Hyrule Field Moving Segment 11 - /* 0x0F */ NA_BGM_FIELD_ENEMY_INIT, // Hyrule Field Enemy Approaches - /* 0x10 */ NA_BGM_FIELD_ENEMY_1, // Hyrule Field Enemy Near Segment 1 - /* 0x11 */ NA_BGM_FIELD_ENEMY_2, // Hyrule Field Enemy Near Segment 2 - /* 0x12 */ NA_BGM_FIELD_ENEMY_3, // Hyrule Field Enemy Near Segment 3 - /* 0x13 */ NA_BGM_FIELD_ENEMY_4, // Hyrule Field Enemy Near Segment 4 - /* 0x14 */ NA_BGM_FIELD_STILL_1, // Hyrule Field Standing Still Segment 1 - /* 0x15 */ NA_BGM_FIELD_STILL_2, // Hyrule Field Standing Still Segment 2 - /* 0x16 */ NA_BGM_FIELD_STILL_3, // Hyrule Field Standing Still Segment 3 - /* 0x17 */ NA_BGM_FIELD_STILL_4, // Hyrule Field Standing Still Segment 4 - /* 0x18 */ NA_BGM_DUNGEON, // Dodongo's Cavern - /* 0x19 */ NA_BGM_KAKARIKO_ADULT, // Kakariko Village (Adult) - /* 0x1A */ NA_BGM_ENEMY, // Battle - /* 0x1B */ NA_BGM_BOSS, // Boss Battle "NA_BGM_BOSS00" - /* 0x1C */ NA_BGM_INSIDE_DEKU_TREE, // Inside the Deku Tree "NA_BGM_FAIRY_DUNGEON" - /* 0x1D */ NA_BGM_MARKET, // Market - /* 0x1E */ NA_BGM_TITLE, // Title Theme - /* 0x1F */ NA_BGM_LINK_HOUSE, // House - /* 0x20 */ NA_BGM_GAME_OVER, // Game Over - /* 0x21 */ NA_BGM_BOSS_CLEAR, // Boss Clear - /* 0x22 */ NA_BGM_ITEM_GET, // Obtain Item - /* 0x23 */ NA_BGM_OPENING_GANON, // Enter Ganondorf - /* 0x24 */ NA_BGM_HEART_GET, // Obtain Heart Container - /* 0x25 */ NA_BGM_OCA_LIGHT, // Prelude of Light - /* 0x26 */ NA_BGM_JABU_JABU, // Inside Jabu-Jabu's Belly "NA_BGM_BUYO_DUNGEON" - /* 0x27 */ NA_BGM_KAKARIKO_KID, // Kakariko Village (Child) - /* 0x28 */ NA_BGM_GREAT_FAIRY, // Great Fairy's Fountain "NA_BGM_GODESS" - /* 0x29 */ NA_BGM_ZELDA_THEME, // Zelda's Theme "NA_BGM_HIME" - /* 0x2A */ NA_BGM_FIRE_TEMPLE, // Fire Temple "NA_BGM_FIRE_DUNGEON" - /* 0x2B */ NA_BGM_OPEN_TRE_BOX, // Open Treasure Chest - /* 0x2C */ NA_BGM_FOREST_TEMPLE, // Forest Temple "NA_BGM_FORST_DUNGEON" - /* 0x2D */ NA_BGM_COURTYARD, // Hyrule Castle Courtyard "NA_BGM_HIRAL_GARDEN" - /* 0x2E */ NA_BGM_GANON_TOWER, // Ganondorf's Theme - /* 0x2F */ NA_BGM_LONLON, // Lon Lon Ranch "NA_BGM_RONRON" - /* 0x30 */ NA_BGM_GORON_CITY, // Goron City "NA_BGM_GORON" - /* 0x31 */ NA_BGM_FIELD_MORNING, // Hyrule Field Morning Theme - /* 0x32 */ NA_BGM_SPIRITUAL_STONE, // Spiritual Stone Get "NA_BGM_SPIRIT_STONE" - /* 0x33 */ NA_BGM_OCA_BOLERO, // Bolero of Fire "NA_BGM_OCA_FLAME" - /* 0x34 */ NA_BGM_OCA_MINUET, // Minuet of Forest "NA_BGM_OCA_WIND" - /* 0x35 */ NA_BGM_OCA_SERENADE, // Serenade of Water "NA_BGM_OCA_WATER" - /* 0x36 */ NA_BGM_OCA_REQUIEM, // Requiem of Spirit "NA_BGM_OCA_SOUL" - /* 0x37 */ NA_BGM_OCA_NOCTURNE, // Nocturne of Shadow "NA_BGM_OCA_DARKNESS" - /* 0x38 */ NA_BGM_MINI_BOSS, // Mini-Boss Battle "NA_BGM_MIDDLE_BOSS" - /* 0x39 */ NA_BGM_SMALL_ITEM_GET, // Obtain Small Item "NA_BGM_S_ITEM_GET" - /* 0x3A */ NA_BGM_TEMPLE_OF_TIME, // Temple of Time "NA_BGM_SHRINE_OF_TIME" - /* 0x3B */ NA_BGM_EVENT_CLEAR, // Escape from Lon Lon Ranch - /* 0x3C */ NA_BGM_KOKIRI, // Kokiri Forest - /* 0x3D */ NA_BGM_OCA_FAIRY_GET, // Obtain Fairy Ocarina "NA_BGM_OCA_YOUSEI" - /* 0x3E */ NA_BGM_SARIA_THEME, // Lost Woods "NA_BGM_MAYOIMORI" - /* 0x3F */ NA_BGM_SPIRIT_TEMPLE, // Spirit Temple "NA_BGM_SOUL_DUNGEON" - /* 0x40 */ NA_BGM_HORSE, // Horse Race - /* 0x41 */ NA_BGM_HORSE_GOAL, // Horse Race Goal - /* 0x42 */ NA_BGM_INGO, // Ingo's Theme - /* 0x43 */ NA_BGM_MEDALLION_GET, // Obtain Medallion "NA_BGM_MEDAL_GET" - /* 0x44 */ NA_BGM_OCA_SARIA, // Ocarina Saria's Song - /* 0x45 */ NA_BGM_OCA_EPONA, // Ocarina Epona's Song - /* 0x46 */ NA_BGM_OCA_ZELDA, // Ocarina Zelda's Lullaby - /* 0x47 */ NA_BGM_OCA_SUNS, // Ocarina Sun's Song "NA_BGM_OCA_SUNMOON" - /* 0x48 */ NA_BGM_OCA_TIME, // Ocarina Song of Time - /* 0x49 */ NA_BGM_OCA_STORM, // Ocarina Song of Storms - /* 0x4A */ NA_BGM_NAVI_OPENING, // Fairy Flying "NA_BGM_NAVI" - /* 0x4B */ NA_BGM_DEKU_TREE_CS, // Deku Tree "NA_BGM_DEKUNOKI" - /* 0x4C */ NA_BGM_WINDMILL, // Windmill Hut "NA_BGM_FUSHA" - /* 0x4D */ NA_BGM_HYRULE_CS, // Legend of Hyrule "NA_BGM_HIRAL_DEMO" - /* 0x4E */ NA_BGM_MINI_GAME, // Shooting Gallery - /* 0x4F */ NA_BGM_SHEIK, // Sheik's Theme "NA_BGM_SEAK" - /* 0x50 */ NA_BGM_ZORA_DOMAIN, // Zora's Domain "NA_BGM_ZORA" - /* 0x51 */ NA_BGM_APPEAR, // Enter Zelda - /* 0x52 */ NA_BGM_ADULT_LINK, // Goodbye to Zelda - /* 0x53 */ NA_BGM_MASTER_SWORD, // Master Sword - /* 0x54 */ NA_BGM_INTRO_GANON, - /* 0x55 */ NA_BGM_SHOP, // Shop - /* 0x56 */ NA_BGM_CHAMBER_OF_SAGES, // Chamber of the Sages "NA_BGM_KENJA" - /* 0x57 */ NA_BGM_FILE_SELECT, // File Select - /* 0x58 */ NA_BGM_ICE_CAVERN, // Ice Cavern "NA_BGM_ICE_DUNGEON" - /* 0x59 */ NA_BGM_DOOR_OF_TIME, // Open Door of Temple of Time "NA_BGM_GATE_OPEN" - /* 0x5A */ NA_BGM_OWL, // Kaepora Gaebora's Theme - /* 0x5B */ NA_BGM_SHADOW_TEMPLE, // Shadow Temple "NA_BGM_DARKNESS_DUNGEON" - /* 0x5C */ NA_BGM_WATER_TEMPLE, // Water Temple "NA_BGM_AQUA_DUNGEON" - /* 0x5D */ NA_BGM_BRIDGE_TO_GANONS, // Ganon's Castle Bridge "NA_BGM_BRIDGE" - /* 0x5E */ NA_BGM_OCARINA_OF_TIME, // Ocarina of Time "NA_BGM_SARIA" - /* 0x5F */ NA_BGM_GERUDO_VALLEY, // Gerudo Valley "NA_BGM_GERUDO" - /* 0x60 */ NA_BGM_POTION_SHOP, // Potion Shop "NA_BGM_DRUGSTORE" - /* 0x61 */ NA_BGM_KOTAKE_KOUME, // Kotake & Koume's Theme - /* 0x62 */ NA_BGM_ESCAPE, // Escape from Ganon's Castle - /* 0x63 */ NA_BGM_UNDERGROUND, // Ganon's Castle Under Ground - /* 0x64 */ NA_BGM_GANONDORF_BOSS, // Ganondorf Battle - /* 0x65 */ NA_BGM_GANON_BOSS, // Ganon Battle - /* 0x66 */ NA_BGM_END_DEMO, // Seal of Six Sages - /* 0x67 */ NA_BGM_STAFF_1, // End Credits I - /* 0x68 */ NA_BGM_STAFF_2, // End Credits II - /* 0x69 */ NA_BGM_STAFF_3, // End Credits III - /* 0x6A */ NA_BGM_STAFF_4, // End Credits IV - /* 0x6B */ NA_BGM_FIRE_BOSS, // King Dodongo & Volvagia Boss Battle "NA_BGM_BOSS01" - /* 0x6C */ NA_BGM_TIMED_MINI_GAME, // Mini-Game - /* 0x6D */ NA_BGM_CUTSCENE_EFFECTS, // A small collection of various cutscene sounds - /* 0x7F */ NA_BGM_NO_MUSIC = 0x7F, // No bgm music is played - /* 0x80 */ NA_BGM_NATURE_SFX_RAIN = 0x80, // Related to rain - /* 0xFFFF */ NA_BGM_DISABLED = 0xFFFF -} SeqId; +#include "ultra64.h" +#include "versions.h" +#define DEFINE_SEQUENCE(_0, seqId, _2, _3, _4) seqId, +#define DEFINE_SEQUENCE_PTR(_0, seqId, _2, _3, _4) seqId, typedef enum { +#include "tables/sequence_table.h" + NA_BGM_MAX, + + NA_BGM_NO_MUSIC = 0x7F, + NA_BGM_NATURE_SFX_RAIN = 0x80, + NA_BGM_DISABLED = 0xFFFF +} NA_BGM; +#undef DEFINE_SEQUENCE +#undef DEFINE_SEQUENCE_PTR + +typedef enum SequencePlayerId { /* 0 */ SEQ_PLAYER_BGM_MAIN, /* 1 */ SEQ_PLAYER_FANFARE, /* 2 */ SEQ_PLAYER_SFX, /* 3 */ SEQ_PLAYER_BGM_SUB } SequencePlayerId; -typedef enum { +typedef enum SequenceMode { /* 0 */ SEQ_MODE_DEFAULT, /* 1 */ SEQ_MODE_ENEMY, /* 2 */ SEQ_MODE_STILL, // Not moving or first-person view /* 3 */ SEQ_MODE_IGNORE } SequenceMode; -typedef enum { +typedef enum SequenceCutsceneEffects { /* 0x0 */ SEQ_CS_EFFECTS_SWORD_GLOW, // Master sword glow /* 0x1 */ SEQ_CS_EFFECTS_SHEIK_TRANSFORM, // Sheik's transformation to Zelda /* 0x2 */ SEQ_CS_EFFECTS_SAGE_SEAL, // Sages accumulating their power @@ -150,7 +50,7 @@ typedef enum { /* 0xF */ SEQ_CS_EFFECTS_RAINFALL // Rain with thunder effects } SequenceCutsceneEffects; -typedef enum { +typedef enum ChannelIOPort { /* 0x0 */ CHANNEL_IO_PORT_0, /* 0x1 */ CHANNEL_IO_PORT_1, /* 0x2 */ CHANNEL_IO_PORT_2, @@ -161,7 +61,7 @@ typedef enum { /* 0x7 */ CHANNEL_IO_PORT_7 } ChannelIOPort; -typedef enum { +typedef enum VolumeScaleIndex { /* 0 */ VOL_SCALE_INDEX_BGM_MAIN, /* 1 */ VOL_SCALE_INDEX_FANFARE, /* 2 */ VOL_SCALE_INDEX_SFX, @@ -169,7 +69,7 @@ typedef enum { /* 4 */ VOL_SCALE_INDEX_MAX } VolumeScaleIndex; // May be worth using SequencePlayerId instead -typedef struct { +typedef struct ActiveSequenceChannelData { /* 0x00 */ f32 volCur; /* 0x04 */ f32 volTarget; /* 0x08 */ f32 volStep; @@ -180,7 +80,7 @@ typedef struct { /* 0x1C */ u16 freqScaleTimer; } ActiveSequenceChannelData; // size = 0x20 -typedef struct { +typedef struct ActiveSequence { /* 0x000 */ f32 volCur; /* 0x004 */ f32 volTarget; /* 0x008 */ f32 volStep; @@ -208,7 +108,7 @@ typedef struct { /* 0x260 */ u8 isWaitingForFonts; // This name comes from MM } ActiveSequence; // size = 0x264 -typedef enum { +typedef enum NatureChannelIndex { /* 0x0 */ NATURE_CHANNEL_STREAM_0, /* 0x1 */ NATURE_CHANNEL_CRITTER_0, /* 0x2 */ NATURE_CHANNEL_CRITTER_1, @@ -224,7 +124,7 @@ typedef enum { /* 0xF */ NATURE_CHANNEL_LIGHTNING } NatureChannelIndex; // seqPlayerIndex = 0 (Overlaps with main bgm) -typedef enum { +typedef enum NatureAmbienceId { /* 0x00 */ NATURE_ID_GENERAL_NIGHT, /* 0x01 */ NATURE_ID_MARKET_ENTRANCE, /* 0x02 */ NATURE_ID_KAKARIKO_REGION, @@ -248,14 +148,14 @@ typedef enum { /* 0xFF */ NATURE_ID_DISABLED = 0xFF } NatureAmbienceId; -typedef enum { +typedef enum NatureStreamId { /* 0x00 */ NATURE_STREAM_RUSHING_WATER, /* 0x01 */ NATURE_STREAM_HOWLING_WIND, /* 0x02 */ NATURE_STREAM_SCREECHING_WIND, /* 0x03 */ NATURE_STREAM_SCREECHING_WIND_ALT1 } NatureStreamId; -typedef enum { +typedef enum NatureAmimalId { /* 0x00 */ NATURE_CRITTER_BIRD_CHIRP_1, /* 0x01 */ NATURE_CRITTER_TAP, /* 0x02 */ NATURE_CRITTER_BIRD_CHIRP_2, @@ -323,4 +223,18 @@ typedef enum { #define NATURE_IO_ENTRIES_END 0xFF +// functions in sequence.c + +void Audio_StartSequence(u8 seqPlayerIndex, u8 seqId, u8 seqArgs, u16 fadeInDuration); +void Audio_StopSequence(u8 seqPlayerIndex, u16 fadeOutDuration); +void Audio_QueueSeqCmd(u32 cmd); +void Audio_ProcessSeqCmds(void); +u16 Audio_GetActiveSeqId(u8 seqPlayerIndex); +s32 Audio_IsSeqCmdNotQueued(u32 cmdVal, u32 cmdMask); +void Audio_SetVolumeScale(u8 seqPlayerIndex, u8 scaleIndex, u8 targetVol, u8 volFadeTimer); +void Audio_UpdateActiveSequences(void); +u8 func_800FAD34(void); +void Audio_ResetActiveSequences(void); +void Audio_ResetActiveSequencesAndVolume(void); + #endif diff --git a/include/sfx.h b/include/sfx.h index 3e18b2e96d..d58a498095 100644 --- a/include/sfx.h +++ b/include/sfx.h @@ -1,7 +1,11 @@ #ifndef SFX_H #define SFX_H -typedef enum { +#include "ultra64.h" +#include "versions.h" +#include "z64math.h" + +typedef enum SfxBankType { /* 0 */ BANK_PLAYER, /* 1 */ BANK_ITEM, /* 2 */ BANK_ENV, @@ -11,7 +15,7 @@ typedef enum { /* 6 */ BANK_VOICE } SfxBankType; -typedef enum { +typedef enum SfxState { /* 0 */ SFX_STATE_EMPTY, /* 1 */ SFX_STATE_QUEUED, /* 2 */ SFX_STATE_READY, @@ -20,7 +24,7 @@ typedef enum { /* 5 */ SFX_STATE_PLAYING_2 } SfxState; -typedef struct { +typedef struct SfxBankEntry { /* 0x00 */ f32* posX; /* 0x04 */ f32* posY; /* 0x08 */ f32* posZ; @@ -55,9 +59,9 @@ typedef struct { * bank 1111000000000000 observed in audio code */ -#define DEFINE_SFX(enum, _1, _2, _3, _4) enum, +#define DEFINE_SFX(_0, enum, _2, _3, _4, _5) enum, -typedef enum { +typedef enum SfxId { NA_SE_NONE, // Requesting a sfx with this id will play no sound NA_SE_PL_BASE = 0x7FF, #include "tables/sfx/playerbank_table.h" @@ -87,7 +91,7 @@ typedef enum { #define SFX_FLAG 0x800 -typedef struct { +typedef struct ActiveSfx { u32 priority; // lower is more prioritized u8 entryIndex; } ActiveSfx; @@ -114,7 +118,7 @@ typedef struct { #define SFX_FLAG_14 (1 << 14) #define SFX_FLAG_15 (1 << 15) -typedef struct { +typedef struct SfxParams { u8 importance; u16 params; } SfxParams; @@ -133,7 +137,7 @@ void Audio_ProcessSfxRequest(void); void Audio_ChooseActiveSfx(u8 bankId); void Audio_PlayActiveSfx(u8 bankId); void Audio_StopSfxByBank(u8 bankId); -void func_800F8884(u8 bankId, Vec3f* pos); +void Audio_RemoveSfxFromBankByPos(u8 bankId, Vec3f* pos); void Audio_StopSfxByPosAndBank(u8 bankId, Vec3f* pos); void Audio_StopSfxByPos(Vec3f* pos); void Audio_StopSfxByPosAndId(Vec3f* pos, u16 sfxId); diff --git a/include/stack.h b/include/stack.h new file mode 100644 index 0000000000..3667862cb6 --- /dev/null +++ b/include/stack.h @@ -0,0 +1,12 @@ +#ifndef STACK_H +#define STACK_H + +#include "alignment.h" + +#define STACK(stack, size) \ + u64 stack[ALIGN8(size) / sizeof(u64)] + +#define STACK_TOP(stack) \ + ((u8*)(stack) + sizeof(stack)) + +#endif diff --git a/include/stackcheck.h b/include/stackcheck.h new file mode 100644 index 0000000000..33b4a674c9 --- /dev/null +++ b/include/stackcheck.h @@ -0,0 +1,27 @@ +#ifndef STACKCHECK_H +#define STACKCHECK_H + +#include "ultra64.h" + +typedef enum StackStatus { + /* 0 */ STACK_STATUS_OK, + /* 1 */ STACK_STATUS_WARNING, + /* 2 */ STACK_STATUS_OVERFLOW +} StackStatus; + +typedef struct StackEntry { + /* 0x00 */ struct StackEntry* next; + /* 0x04 */ struct StackEntry* prev; + /* 0x08 */ u32* head; + /* 0x0C */ u32* tail; + /* 0x10 */ u32 initValue; + /* 0x14 */ s32 minSpace; + /* 0x18 */ const char* name; +} StackEntry; + +void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 initValue, s32 minSpace, + const char* name); +void StackCheck_Cleanup(StackEntry* entry); +u32 StackCheck_Check(StackEntry* entry); + +#endif diff --git a/include/sys_math3d.h b/include/sys_math3d.h index b01063a9f0..deeb093f4e 100644 --- a/include/sys_math3d.h +++ b/include/sys_math3d.h @@ -4,6 +4,8 @@ #include "ultra64.h" #include "z64math.h" +struct PlayState; + s32 Math3D_PlaneVsLineSegClosestPoint(f32 planeAA, f32 planeAB, f32 planeAC, f32 planeADist, f32 planeBA, f32 planeBB, f32 planeBC, f32 planeBDist, Vec3f* linePointA, Vec3f* linePointB, Vec3f* closestPoint); @@ -70,4 +72,7 @@ s32 Math3D_XZInSphere(Sphere16* sphere, f32 x, f32 z); s32 Math3D_XYInSphere(Sphere16* sphere, f32 x, f32 y); s32 Math3D_YZInSphere(Sphere16* sphere, f32 y, f32 z); +void Math3D_DrawSphere(struct PlayState* play, Sphere16* sph); +void Math3D_DrawCylinder(struct PlayState* play, Cylinder16* cyl); + #endif diff --git a/include/sys_matrix.h b/include/sys_matrix.h new file mode 100644 index 0000000000..eb1764a16a --- /dev/null +++ b/include/sys_matrix.h @@ -0,0 +1,85 @@ +#ifndef SYS_MATRIX_H +#define SYS_MATRIX_H + +#include "z64math.h" + +struct GraphicsContext; +struct GameState; + +typedef enum MatrixMode { + /* 0 */ MTXMODE_NEW, // generates a new matrix + /* 1 */ MTXMODE_APPLY // applies transformation to the current matrix +} MatrixMode; + +extern Mtx gMtxClear; +extern MtxF gMtxFClear; + +/* Stack operations */ + +void Matrix_Init(struct GameState* gameState); +void Matrix_Push(void); +void Matrix_Pop(void); +void Matrix_Get(MtxF* dest); +void Matrix_Put(MtxF* src); + +/* Basic operations */ + +void Matrix_Mult(MtxF* mf, u8 mode); +void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode); +void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode); +void Matrix_RotateX(f32 x, u8 mode); +void Matrix_RotateY(f32 y, u8 mode); +void Matrix_RotateZ(f32 z, u8 mode); + +/* Compound operations */ + +void Matrix_RotateZYX(s16 x, s16 y, s16 z, u8 mode); +void Matrix_TranslateRotateZYX(Vec3f* translation, Vec3s* rotation); +void Matrix_SetTranslateRotateYXZ(f32 translateX, f32 translateY, f32 translateZ, Vec3s* rot); +void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, f32 translateX, f32 translateY, + f32 translateZ); + +/* Conversion and allocation operations */ + +Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest); + +#if IS_DEBUG + +Mtx* Matrix_ToMtx(Mtx* dest, const char* file, int line); +Mtx* Matrix_Finalize(struct GraphicsContext* gfxCtx, const char* file, int line); +MtxF* Matrix_CheckFloats(MtxF* mf, const char* file, int line); + +#define MATRIX_TO_MTX(gfxCtx, ...) Matrix_ToMtx(gfxCtx, __FILE__, __LINE__) +#define MATRIX_FINALIZE(gfxCtx, ...) Matrix_Finalize(gfxCtx, __FILE__, __LINE__) +#define MATRIX_CHECK_FLOATS(mtx, ...) Matrix_CheckFloats(mtx, __FILE__, __LINE__) + +#else + +Mtx* Matrix_ToMtx(Mtx* dest); +Mtx* Matrix_Finalize(struct GraphicsContext* gfxCtx); + +#define MATRIX_TO_MTX(gfxCtx, ...) Matrix_ToMtx(gfxCtx) +#define MATRIX_FINALIZE(gfxCtx, ...) Matrix_Finalize(gfxCtx) +#define MATRIX_CHECK_FLOATS(mtx, ...) (mtx) + +#endif + +/* Vector operations */ + +void Matrix_MultVec3f(Vec3f* src, Vec3f* dest); +void Matrix_MultVec3fExt(Vec3f* src, Vec3f* dest, MtxF* mf); + +/* Copy and another conversion */ + +void Matrix_MtxFCopy(MtxF* dest, MtxF* src); +void Matrix_MtxToMtxF(Mtx* src, MtxF* dest); + +/* Miscellaneous */ + +void Matrix_Transpose(MtxF* mf); +void Matrix_ReplaceRotation(MtxF* mf); +void Matrix_MtxFToYXZRotS(MtxF* mf, Vec3s* rotDest, s32 flag); +void Matrix_MtxFToZYXRotS(MtxF* mf, Vec3s* rotDest, s32 flag); +void Matrix_RotateAxis(f32 angle, Vec3f* axis, u8 mode); + +#endif diff --git a/include/tables/sequence_table.h b/include/tables/sequence_table.h new file mode 100644 index 0000000000..3e8f13e5f9 --- /dev/null +++ b/include/tables/sequence_table.h @@ -0,0 +1,132 @@ +/** + * Sequence Table + * + * DEFINE_SEQUENCE should be used to define sequences + * - Argument 0: The name of the sequence, as defined by .startseq in the .seq file + * - Argument 1: The sequence id enum name + * - Argument 2: Storage medium for the sequence (SampleMedium) + * - Argument 3: Cache load policy for the sequence (AudioCacheLoadType) + * - Argument 4: Sequence flags + * + * DEFINE_SEQUENCE_PTR should be used to define pointers to sequences + * - Argument 0: The sequence id enum name of the sequence this entry points to + * - Argument 1: The sequence id enum name for this pointer + * - Argument 2: Storage medium for the sequence (SampleMedium) + * - Argument 3: Cache load policy for the sequence (AudioCacheLoadType) + * - Argument 4: Sequence flags + */ +#if OOT_VERSION < PAL_1_0 || PLATFORM_GC +#define SEQ_0_FLAGS SEQ_FLAG_FANFARE +#else +#define SEQ_0_FLAGS SEQ_FLAG_FANFARE | SEQ_FLAG_ENEMY +#endif +DEFINE_SEQUENCE (Sequence_0, NA_BGM_GENERAL_SFX, MEDIUM_CART, CACHE_LOAD_PERMANENT, SEQ_0_FLAGS ) // general_sfx +DEFINE_SEQUENCE (Sequence_1, NA_BGM_NATURE_AMBIENCE, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_ENEMY ) // nature_ambience +DEFINE_SEQUENCE (Sequence_2, NA_BGM_FIELD_LOGIC, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_logic +DEFINE_SEQUENCE (Sequence_3, NA_BGM_FIELD_INIT, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_init +DEFINE_SEQUENCE (Sequence_4, NA_BGM_FIELD_DEFAULT_1, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_default_1 +DEFINE_SEQUENCE (Sequence_5, NA_BGM_FIELD_DEFAULT_2, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_default_2 +DEFINE_SEQUENCE (Sequence_6, NA_BGM_FIELD_DEFAULT_3, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_default_3 +DEFINE_SEQUENCE (Sequence_7, NA_BGM_FIELD_DEFAULT_4, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_default_4 +DEFINE_SEQUENCE (Sequence_8, NA_BGM_FIELD_DEFAULT_5, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_default_5 +DEFINE_SEQUENCE (Sequence_9, NA_BGM_FIELD_DEFAULT_6, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_default_6 +DEFINE_SEQUENCE (Sequence_10, NA_BGM_FIELD_DEFAULT_7, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_default_7 +DEFINE_SEQUENCE (Sequence_11, NA_BGM_FIELD_DEFAULT_8, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_default_8 +DEFINE_SEQUENCE (Sequence_12, NA_BGM_FIELD_DEFAULT_9, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_default_9 +DEFINE_SEQUENCE (Sequence_13, NA_BGM_FIELD_DEFAULT_A, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_default_a +DEFINE_SEQUENCE (Sequence_14, NA_BGM_FIELD_DEFAULT_B, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_default_b +DEFINE_SEQUENCE (Sequence_15, NA_BGM_FIELD_ENEMY_INIT, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_enemy_init +DEFINE_SEQUENCE (Sequence_16, NA_BGM_FIELD_ENEMY_1, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_enemy_1 +DEFINE_SEQUENCE (Sequence_17, NA_BGM_FIELD_ENEMY_2, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_enemy_2 +DEFINE_SEQUENCE (Sequence_18, NA_BGM_FIELD_ENEMY_3, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_enemy_3 +DEFINE_SEQUENCE (Sequence_19, NA_BGM_FIELD_ENEMY_4, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_enemy_4 +DEFINE_SEQUENCE (Sequence_20, NA_BGM_FIELD_STILL_1, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_still_1 +DEFINE_SEQUENCE (Sequence_21, NA_BGM_FIELD_STILL_2, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_still_2 +DEFINE_SEQUENCE (Sequence_22, NA_BGM_FIELD_STILL_3, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_still_3 +DEFINE_SEQUENCE (Sequence_23, NA_BGM_FIELD_STILL_4, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_still_4 +DEFINE_SEQUENCE (Sequence_24, NA_BGM_DUNGEON, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_RESUME_PREV | SEQ_FLAG_ENEMY ) // dungeon +DEFINE_SEQUENCE (Sequence_25, NA_BGM_KAKARIKO_ADULT, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_RESUME ) // kakariko_adult +DEFINE_SEQUENCE (Sequence_26, NA_BGM_ENEMY, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // enemy +DEFINE_SEQUENCE (Sequence_27, NA_BGM_BOSS, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_NO_AMBIENCE | SEQ_FLAG_RESTORE) // boss +DEFINE_SEQUENCE (Sequence_28, NA_BGM_INSIDE_DEKU_TREE, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_ENEMY ) // inside_deku_tree +DEFINE_SEQUENCE (Sequence_29, NA_BGM_MARKET, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // market +DEFINE_SEQUENCE (Sequence_30, NA_BGM_TITLE, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // title +DEFINE_SEQUENCE (Sequence_31, NA_BGM_LINK_HOUSE, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_RESUME_PREV ) // link_house +DEFINE_SEQUENCE (Sequence_32, NA_BGM_GAME_OVER, MEDIUM_CART, CACHE_LOAD_PERSISTENT, 0 ) // game_over +DEFINE_SEQUENCE (Sequence_33, NA_BGM_BOSS_CLEAR, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // boss_clear +DEFINE_SEQUENCE (Sequence_34, NA_BGM_ITEM_GET, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // item_get +DEFINE_SEQUENCE (Sequence_35, NA_BGM_OPENING_GANON, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_FANFARE_GANON ) // opening_ganon +DEFINE_SEQUENCE (Sequence_36, NA_BGM_HEART_GET, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // heart_get +DEFINE_SEQUENCE (Sequence_37, NA_BGM_OCA_LIGHT, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // oca_light +DEFINE_SEQUENCE (Sequence_38, NA_BGM_JABU_JABU, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_ENEMY ) // jabu_jabu +DEFINE_SEQUENCE (Sequence_39, NA_BGM_KAKARIKO_KID, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_RESUME ) // kakariko_kid +DEFINE_SEQUENCE (Sequence_40, NA_BGM_GREAT_FAIRY, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // great_fairy +DEFINE_SEQUENCE (Sequence_41, NA_BGM_ZELDA_THEME, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // zelda_theme +DEFINE_SEQUENCE (Sequence_42, NA_BGM_FIRE_TEMPLE, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_ENEMY ) // fire_temple +DEFINE_SEQUENCE (Sequence_43, NA_BGM_OPEN_TRE_BOX, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // open_tre_box +DEFINE_SEQUENCE (Sequence_44, NA_BGM_FOREST_TEMPLE, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_ENEMY ) // forest_temple +DEFINE_SEQUENCE (Sequence_45, NA_BGM_COURTYARD, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // courtyard +DEFINE_SEQUENCE (Sequence_46, NA_BGM_GANON_TOWER, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_NO_AMBIENCE ) // ganon_tower +DEFINE_SEQUENCE (Sequence_47, NA_BGM_LONLON, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // lonlon +DEFINE_SEQUENCE (Sequence_48, NA_BGM_GORON_CITY, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_NO_AMBIENCE ) // goron_city +DEFINE_SEQUENCE (Sequence_49, NA_BGM_FIELD_MORNING, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // field_morning +DEFINE_SEQUENCE (Sequence_50, NA_BGM_SPIRITUAL_STONE, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // spiritual_stone +DEFINE_SEQUENCE (Sequence_51, NA_BGM_OCA_BOLERO, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // oca_bolero +DEFINE_SEQUENCE (Sequence_52, NA_BGM_OCA_MINUET, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // oca_minuet +DEFINE_SEQUENCE (Sequence_53, NA_BGM_OCA_SERENADE, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // oca_serenade +DEFINE_SEQUENCE (Sequence_54, NA_BGM_OCA_REQUIEM, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // oca_requiem +DEFINE_SEQUENCE (Sequence_55, NA_BGM_OCA_NOCTURNE, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // oca_nocturne +DEFINE_SEQUENCE (Sequence_56, NA_BGM_MINI_BOSS, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_NO_AMBIENCE | SEQ_FLAG_RESTORE) // mini_boss +DEFINE_SEQUENCE (Sequence_57, NA_BGM_SMALL_ITEM_GET, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // small_item_get +DEFINE_SEQUENCE (Sequence_58, NA_BGM_TEMPLE_OF_TIME, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // temple_of_time +DEFINE_SEQUENCE (Sequence_59, NA_BGM_EVENT_CLEAR, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // event_clear +DEFINE_SEQUENCE (Sequence_60, NA_BGM_KOKIRI, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_RESUME | SEQ_FLAG_ENEMY ) // kokiri +DEFINE_SEQUENCE (Sequence_61, NA_BGM_OCA_FAIRY_GET, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // oca_fairy_get +DEFINE_SEQUENCE (Sequence_62, NA_BGM_SARIA_THEME, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_ENEMY ) // saria_theme +DEFINE_SEQUENCE (Sequence_63, NA_BGM_SPIRIT_TEMPLE, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_ENEMY ) // spirit_temple +DEFINE_SEQUENCE (Sequence_64, NA_BGM_HORSE, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // horse +DEFINE_SEQUENCE (Sequence_65, NA_BGM_HORSE_GOAL, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // horse_goal +DEFINE_SEQUENCE (Sequence_66, NA_BGM_INGO, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // ingo +DEFINE_SEQUENCE (Sequence_67, NA_BGM_MEDALLION_GET, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // medallion_get +DEFINE_SEQUENCE (Sequence_68, NA_BGM_OCA_SARIA, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // oca_saria +DEFINE_SEQUENCE (Sequence_69, NA_BGM_OCA_EPONA, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // oca_epona +DEFINE_SEQUENCE (Sequence_70, NA_BGM_OCA_ZELDA, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // oca_zelda +DEFINE_SEQUENCE (Sequence_71, NA_BGM_OCA_SUNS, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // oca_suns +DEFINE_SEQUENCE (Sequence_72, NA_BGM_OCA_TIME, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // oca_time +DEFINE_SEQUENCE (Sequence_73, NA_BGM_OCA_STORM, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // oca_storm +DEFINE_SEQUENCE (Sequence_74, NA_BGM_NAVI_OPENING, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // navi_opening +DEFINE_SEQUENCE (Sequence_75, NA_BGM_DEKU_TREE_CS, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // deku_tree_cs +DEFINE_SEQUENCE (Sequence_76, NA_BGM_WINDMILL, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // windmill +DEFINE_SEQUENCE (Sequence_77, NA_BGM_HYRULE_CS, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // hyrule_cs +DEFINE_SEQUENCE (Sequence_78, NA_BGM_MINI_GAME, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_RESUME_PREV ) // mini_game +DEFINE_SEQUENCE (Sequence_79, NA_BGM_SHEIK, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // sheik +DEFINE_SEQUENCE (Sequence_80, NA_BGM_ZORA_DOMAIN, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_RESUME ) // zora_domain +DEFINE_SEQUENCE (Sequence_81, NA_BGM_APPEAR, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // appear +DEFINE_SEQUENCE (Sequence_82, NA_BGM_ADULT_LINK, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // adult_link +DEFINE_SEQUENCE (Sequence_83, NA_BGM_MASTER_SWORD, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // master_sword +DEFINE_SEQUENCE (Sequence_84, NA_BGM_INTRO_GANON, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_FANFARE_GANON ) // intro_ganon +DEFINE_SEQUENCE (Sequence_85, NA_BGM_SHOP, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_RESUME_PREV ) // shop +DEFINE_SEQUENCE (Sequence_86, NA_BGM_CHAMBER_OF_SAGES, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_SKIP_HARP_INTRO ) // chamber_of_sages +DEFINE_SEQUENCE_PTR(NA_BGM_GREAT_FAIRY, NA_BGM_FILE_SELECT, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_SKIP_HARP_INTRO ) // file_select +DEFINE_SEQUENCE (Sequence_88, NA_BGM_ICE_CAVERN, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_ENEMY ) // ice_cavern +DEFINE_SEQUENCE (Sequence_89, NA_BGM_DOOR_OF_TIME, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // door_of_time +DEFINE_SEQUENCE (Sequence_90, NA_BGM_OWL, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // owl +DEFINE_SEQUENCE (Sequence_91, NA_BGM_SHADOW_TEMPLE, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_ENEMY ) // shadow_temple +DEFINE_SEQUENCE (Sequence_92, NA_BGM_WATER_TEMPLE, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_ENEMY ) // water_temple +DEFINE_SEQUENCE (Sequence_93, NA_BGM_BRIDGE_TO_GANONS, MEDIUM_CART, CACHE_LOAD_PERSISTENT, SEQ_FLAG_FANFARE ) // bridge_to_ganons +DEFINE_SEQUENCE (Sequence_94, NA_BGM_OCARINA_OF_TIME, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // ocarina_of_time +DEFINE_SEQUENCE (Sequence_95, NA_BGM_GERUDO_VALLEY, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_RESUME | SEQ_FLAG_ENEMY ) // gerudo_valley +DEFINE_SEQUENCE (Sequence_96, NA_BGM_POTION_SHOP, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // potion_shop +DEFINE_SEQUENCE (Sequence_97, NA_BGM_KOTAKE_KOUME, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // kotake_koume +DEFINE_SEQUENCE (Sequence_98, NA_BGM_ESCAPE, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_NO_AMBIENCE ) // escape +DEFINE_SEQUENCE (Sequence_99, NA_BGM_UNDERGROUND, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // underground +DEFINE_SEQUENCE (Sequence_100, NA_BGM_GANONDORF_BOSS, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_NO_AMBIENCE ) // ganondorf_boss +DEFINE_SEQUENCE (Sequence_101, NA_BGM_GANON_BOSS, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_NO_AMBIENCE ) // ganon_boss +DEFINE_SEQUENCE (Sequence_102, NA_BGM_END_DEMO, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // end_demo +DEFINE_SEQUENCE (Sequence_103, NA_BGM_STAFF_1, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // staff_1 +DEFINE_SEQUENCE (Sequence_104, NA_BGM_STAFF_2, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // staff_2 +DEFINE_SEQUENCE (Sequence_105, NA_BGM_STAFF_3, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // staff_3 +DEFINE_SEQUENCE (Sequence_106, NA_BGM_STAFF_4, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // staff_4 +DEFINE_SEQUENCE (Sequence_107, NA_BGM_FIRE_BOSS, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // fire_boss +DEFINE_SEQUENCE (Sequence_108, NA_BGM_TIMED_MINI_GAME, MEDIUM_CART, CACHE_LOAD_TEMPORARY, SEQ_FLAG_RESTORE ) // timed_mini_game +DEFINE_SEQUENCE (Sequence_109, NA_BGM_CUTSCENE_EFFECTS, MEDIUM_CART, CACHE_LOAD_TEMPORARY, 0 ) // cutscene_effects diff --git a/include/tables/sfx/enemybank_table.h b/include/tables/sfx/enemybank_table.h index 6ad17f6ad2..de741033e8 100644 --- a/include/tables/sfx/enemybank_table.h +++ b/include/tables/sfx/enemybank_table.h @@ -2,510 +2,513 @@ * Sfx Enemy Bank * * DEFINE_SFX should be used for all sfx define in the enemy bank from sequence 0 + * - Argument 0: Channel name for sequence 0 * - Argument 1: Enum value for this sfx * - Argument 2: Importance for deciding which sfx to prioritize. Higher values have greater importance * - Argument 3: Slows the decay of volume with distance (a 2-bit number ranging from 0-3) * - Argument 4: Applies increasingly random offsets to frequency (a 2-bit number ranging from 0-3) * - Argument 5: Various flags to add properties to the sfx - * - * WARNING: entries must align with the table defined for the enemy bank in sequence 0 */ -/* 0x3800 */ DEFINE_SFX(NA_SE_EN_DODO_J_WALK, 0x18, 0, 0, 0) -/* 0x3801 */ DEFINE_SFX(NA_SE_EN_DODO_J_CRY, 0x30, 0, 0, 0) -/* 0x3802 */ DEFINE_SFX(NA_SE_EN_DODO_J_FIRE, 0x30, 0, 0, 0) -/* 0x3803 */ DEFINE_SFX(NA_SE_EN_DODO_J_DAMAGE, 0x38, 1, 0, 0) -/* 0x3804 */ DEFINE_SFX(NA_SE_EN_DODO_J_DEAD, 0x40, 1, 0, 0) -/* 0x3805 */ DEFINE_SFX(NA_SE_EN_DODO_K_CRY, 0x30, 3, 0, 0) -/* 0x3806 */ DEFINE_SFX(NA_SE_EN_DODO_K_DAMAGE, 0x38, 3, 0, 0) -/* 0x3807 */ DEFINE_SFX(NA_SE_EN_DODO_K_DEAD, 0x40, 3, 0, 0) -/* 0x3808 */ DEFINE_SFX(NA_SE_EN_DODO_K_WALK, 0x30, 2, 0, 0) -/* 0x3809 */ DEFINE_SFX(NA_SE_EN_DODO_K_FIRE, 0x30, 3, 0, 0) -/* 0x380A */ DEFINE_SFX(NA_SE_EN_GOMA_WALK, 0x30, 2, 0, 0) -/* 0x380B */ DEFINE_SFX(NA_SE_EN_GOMA_HIGH, 0x20, 1, 2, 0) -/* 0x380C */ DEFINE_SFX(NA_SE_EN_GOMA_CLIM, 0x30, 3, 0, 0) -/* 0x380D */ DEFINE_SFX(NA_SE_EN_GOMA_DOWN, 0x30, 3, 0, 0) -/* 0x380E */ DEFINE_SFX(NA_SE_EN_GOMA_CRY1, 0x38, 3, 0, 0) -/* 0x380F */ DEFINE_SFX(NA_SE_EN_GOMA_CRY2, 0x30, 3, 0, 0) -/* 0x3810 */ DEFINE_SFX(NA_SE_EN_GOMA_DAM1, 0x30, 3, 0, 0) -/* 0x3811 */ DEFINE_SFX(NA_SE_EN_GOMA_DAM2, 0x38, 3, 0, 0) -/* 0x3812 */ DEFINE_SFX(NA_SE_EN_GOMA_DEAD, 0x40, 3, 0, 0) -/* 0x3813 */ DEFINE_SFX(NA_SE_EN_GOMA_UNARI, 0x20, 0, 0, SFX_FLAG_13) -/* 0x3814 */ DEFINE_SFX(NA_SE_EN_GOMA_BJR_EGG1, 0x28, 3, 0, 0) -/* 0x3815 */ DEFINE_SFX(NA_SE_EN_GOMA_BJR_EGG2, 0x28, 3, 0, 0) -/* 0x3816 */ DEFINE_SFX(NA_SE_EN_GOMA_BJR_WALK, 0x20, 2, 0, 0) -/* 0x3817 */ DEFINE_SFX(NA_SE_EN_GOMA_BJR_CRY, 0x28, 3, 0, 0) -/* 0x3818 */ DEFINE_SFX(NA_SE_EN_GOMA_BJR_DAM1, 0x38, 3, 0, 0) -/* 0x3819 */ DEFINE_SFX(NA_SE_EN_GOMA_BJR_DAM2, 0x30, 3, 0, 0) -/* 0x381A */ DEFINE_SFX(NA_SE_EN_GOMA_BJR_DEAD, 0x40, 3, 0, 0) -/* 0x381B */ DEFINE_SFX(NA_SE_EN_GOMA_DEMO_EYE, 0x30, 3, 0, 0) -/* 0x381C */ DEFINE_SFX(NA_SE_EN_GOMA_LAST, 0x30, 3, 0, 0) -/* 0x381D */ DEFINE_SFX(NA_SE_EN_GOMA_UNARI2, 0x30, 3, 0, 0) -/* 0x381E */ DEFINE_SFX(NA_SE_EN_GOMA_FAINT, 0x30, 3, 0, 0) -/* 0x381F */ DEFINE_SFX(NA_SE_EN_GOMA_BJR_FREEZE, 0x30, 3, 0, 0) -/* 0x3820 */ DEFINE_SFX(NA_SE_EN_DODO_M_CRY, 0x30, 0, 0, 0) -/* 0x3821 */ DEFINE_SFX(NA_SE_EN_DODO_M_DEAD, 0x40, 1, 0, 0) -/* 0x3822 */ DEFINE_SFX(NA_SE_EN_DODO_M_MOVE, 0x18, 0, 0, 0) -/* 0x3823 */ DEFINE_SFX(NA_SE_EN_DODO_M_DOWN, 0x14, 0, 0, 0) -/* 0x3824 */ DEFINE_SFX(NA_SE_EN_DODO_M_UP, 0x14, 0, 0, 0) -/* 0x3825 */ DEFINE_SFX(NA_SE_EN_GANON_THROW_MASIC, 0x30, 3, 0, 0) -/* 0x3826 */ DEFINE_SFX(NA_SE_EN_DODO_M_EAT, 0x30, 0, 0, 0) -/* 0x3827 */ DEFINE_SFX(NA_SE_EN_GANON_DD_THUNDER, 0x44, 3, 0, 0) -/* 0x3828 */ DEFINE_SFX(NA_SE_EN_RIZA_ONGND, 0x18, 0, 0, 0) -/* 0x3829 */ DEFINE_SFX(NA_SE_EN_RIZA_CRY, 0x30, 2, 0, 0) -/* 0x382A */ DEFINE_SFX(NA_SE_EN_RIZA_ATTACK, 0x32, 2, 0, 0) -/* 0x382B */ DEFINE_SFX(NA_SE_EN_RIZA_DAMAGE, 0x38, 1, 0, 0) -/* 0x382C */ DEFINE_SFX(NA_SE_EN_RIZA_WARAU, 0x20, 0, 0, 0) -/* 0x382D */ DEFINE_SFX(NA_SE_EN_RIZA_DEAD, 0x40, 1, 0, 0) -/* 0x382E */ DEFINE_SFX(NA_SE_EN_RIZA_WALK, 0x18, 0, 0, 0) -/* 0x382F */ DEFINE_SFX(NA_SE_EN_RIZA_JUMP, 0x28, 0, 0, 0) -/* 0x3830 */ DEFINE_SFX(NA_SE_EN_STALKID_WALK, 0x18, 0, 0, 0) -/* 0x3831 */ DEFINE_SFX(NA_SE_EN_STALKID_ATTACK, 0x30, 0, 0, 0) -/* 0x3832 */ DEFINE_SFX(NA_SE_EN_STALKID_DAMAGE, 0x38, 1, 0, 0) -/* 0x3833 */ DEFINE_SFX(NA_SE_EN_STALKID_DEAD, 0x40, 1, 0, 0) -/* 0x3834 */ DEFINE_SFX(NA_SE_EN_FLOORMASTER_SLIDING, 0x14, 0, 0, 0) -/* 0x3835 */ DEFINE_SFX(NA_SE_EN_TEKU_WALK_WATER, 0x18, 0, 2, 0) -/* 0x3836 */ DEFINE_SFX(NA_SE_EN_LIGHT_ARROW_HIT, 0x38, 2, 0, 0) -/* 0x3837 */ DEFINE_SFX(NA_SE_EN_TUBOOCK_FLY, 0x30, 0, 0, 0) -/* 0x3838 */ DEFINE_SFX(NA_SE_EN_STAL_WARAU, 0x28, 1, 0, 0) -/* 0x3839 */ DEFINE_SFX(NA_SE_EN_STAL_SAKEBI, 0x30, 0, 0, 0) -/* 0x383A */ DEFINE_SFX(NA_SE_EN_STAL_DAMAGE, 0x38, 1, 0, 0) -/* 0x383B */ DEFINE_SFX(NA_SE_EN_STAL_DEAD, 0x40, 1, 0, 0) -/* 0x383C */ DEFINE_SFX(NA_SE_EN_WOLFOS_APPEAR, 0x30, 0, 0, 0) -/* 0x383D */ DEFINE_SFX(NA_SE_EN_STAL_WALK, 0x18, 0, 0, 0) -/* 0x383E */ DEFINE_SFX(NA_SE_EN_WOLFOS_CRY, 0x20, 0, 0, 0) -/* 0x383F */ DEFINE_SFX(NA_SE_EN_WOLFOS_ATTACK, 0x30, 0, 0, 0) -/* 0x3840 */ DEFINE_SFX(NA_SE_EN_FFLY_ATTACK, 0x30, 0, 0, 0) -/* 0x3841 */ DEFINE_SFX(NA_SE_EN_FFLY_FLY, 0x20, 1, 0, 0) -/* 0x3842 */ DEFINE_SFX(NA_SE_EN_FFLY_DEAD, 0x40, 1, 0, 0) -/* 0x3843 */ DEFINE_SFX(NA_SE_EN_WOLFOS_DAMAGE, 0x38, 1, 0, 0) -/* 0x3844 */ DEFINE_SFX(NA_SE_EN_AMOS_WALK, 0x30, 0, 0, 0) -/* 0x3845 */ DEFINE_SFX(NA_SE_EN_AMOS_WAVE, 0x30, 0, 0, 0) -/* 0x3846 */ DEFINE_SFX(NA_SE_EN_AMOS_DEAD, 0x40, 1, 0, 0) -/* 0x3847 */ DEFINE_SFX(NA_SE_EN_AMOS_DAMAGE, 0x38, 1, 0, 0) -/* 0x3848 */ DEFINE_SFX(NA_SE_EN_AMOS_VOICE, 0x20, 0, 0, 0) -/* 0x3849 */ DEFINE_SFX(NA_SE_EN_SHELL_MOUTH, 0x30, 0, 0, 0) -/* 0x384A */ DEFINE_SFX(NA_SE_EN_SHELL_DEAD, 0x40, 1, 0, 0) -/* 0x384B */ DEFINE_SFX(NA_SE_EN_WOLFOS_DEAD, 0x40, 1, 0, 0) -/* 0x384C */ DEFINE_SFX(NA_SE_EN_DODO_K_COLI, 0x30, 3, 0, 0) -/* 0x384D */ DEFINE_SFX(NA_SE_EN_DODO_K_COLI2, 0x30, 0, 0, SFX_FLAG_13) -/* 0x384E */ DEFINE_SFX(NA_SE_EN_DODO_K_ROLL, 0x30, 3, 0, 0) -/* 0x384F */ DEFINE_SFX(NA_SE_EN_DODO_K_BREATH, 0x30, 3, 0, 0) -/* 0x3850 */ DEFINE_SFX(NA_SE_EN_DODO_K_DRINK, 0x30, 3, 0, 0) -/* 0x3851 */ DEFINE_SFX(NA_SE_EN_DODO_K_DOWN, 0x30, 3, 0, 0) -/* 0x3852 */ DEFINE_SFX(NA_SE_EN_DODO_K_OTAKEBI, 0x30, 3, 0, 0) -/* 0x3853 */ DEFINE_SFX(NA_SE_EN_DODO_K_END, 0x30, 3, 0, 0) -/* 0x3854 */ DEFINE_SFX(NA_SE_EN_DODO_K_LAST, 0x30, 3, 0, 0) -/* 0x3855 */ DEFINE_SFX(NA_SE_EN_DODO_K_LAVA, 0x30, 3, 0, 0) -/* 0x3856 */ DEFINE_SFX(NA_SE_EN_GANON_FLOAT, 0x18, 3, 0, 0) -/* 0x3857 */ DEFINE_SFX(NA_SE_EN_GANON_DARKWAVE_M, 0x30, 3, 0, 0) -/* 0x3858 */ DEFINE_SFX(NA_SE_EN_DODO_J_BREATH, 0x28, 0, 0, 0) -/* 0x3859 */ DEFINE_SFX(NA_SE_EN_DODO_J_TAIL, 0x30, 0, 0, 0) -/* 0x385A */ DEFINE_SFX(NA_SE_EN_WOLFOS_WALK, 0x18, 0, 0, 0) -/* 0x385B */ DEFINE_SFX(NA_SE_EN_DODO_J_EAT, 0x30, 0, 0, 0) -/* 0x385C */ DEFINE_SFX(NA_SE_EN_DEKU_MOUTH, 0x28, 0, 0, 0) -/* 0x385D */ DEFINE_SFX(NA_SE_EN_DEKU_ATTACK, 0x30, 0, 0, 0) -/* 0x385E */ DEFINE_SFX(NA_SE_EN_DEKU_DAMAGE, 0x38, 1, 0, 0) -/* 0x385F */ DEFINE_SFX(NA_SE_EN_DEKU_DEAD, 0x40, 1, 0, 0) -/* 0x3860 */ DEFINE_SFX(NA_SE_EN_DEKU_JR_MOUTH, 0x28, 0, 0, 0) -/* 0x3861 */ DEFINE_SFX(NA_SE_EN_DEKU_JR_ATTACK, 0x30, 0, 0, 0) -/* 0x3862 */ DEFINE_SFX(NA_SE_EN_DEKU_JR_DEAD, 0x40, 1, 0, 0) -/* 0x3863 */ DEFINE_SFX(NA_SE_EN_DEKU_SCRAPE, 0x14, 0, 0, 0) -/* 0x3864 */ DEFINE_SFX(NA_SE_EN_TAIL_FLY, 0x30, 0, 0, 0) -/* 0x3865 */ DEFINE_SFX(NA_SE_EN_TAIL_CRY, 0x20, 0, 0, 0) -/* 0x3866 */ DEFINE_SFX(NA_SE_EN_TAIL_DEAD, 0x40, 1, 0, 0) -/* 0x3867 */ DEFINE_SFX(NA_SE_EN_GANON_SPARK, 0x30, 3, 0, 0) -/* 0x3868 */ DEFINE_SFX(NA_SE_EN_STALTU_DOWN, 0x30, 0, 0, 0) -/* 0x3869 */ DEFINE_SFX(NA_SE_EN_STALTU_UP, 0x30, 0, 0, 0) -/* 0x386A */ DEFINE_SFX(NA_SE_EN_STALTU_LAUGH, 0x20, 0, 0, 0) -/* 0x386B */ DEFINE_SFX(NA_SE_EN_STALTU_DAMAGE, 0x38, 1, 0, 0) -/* 0x386C */ DEFINE_SFX(NA_SE_EN_STAL_JUMP, 0x20, 0, 0, 0) -/* 0x386D */ DEFINE_SFX(NA_SE_EN_TEKU_DAMAGE, 0x38, 1, 0, 0) -/* 0x386E */ DEFINE_SFX(NA_SE_EN_TEKU_DEAD, 0x40, 1, 0, 0) -/* 0x386F */ DEFINE_SFX(NA_SE_EN_TEKU_WALK, 0x14, 0, 0, 0) -/* 0x3870 */ DEFINE_SFX(NA_SE_EN_PO_KANTERA, 0x30, 3, 0, 0) -/* 0x3871 */ DEFINE_SFX(NA_SE_EN_PO_FLY, 0x20, 1, 0, 0) -/* 0x3872 */ DEFINE_SFX(NA_SE_EN_PO_AWAY, 0x20, 1, 0, 0) -/* 0x3873 */ DEFINE_SFX(NA_SE_EN_PO_APPEAR, 0x30, 2, 0, 0) -/* 0x3874 */ DEFINE_SFX(NA_SE_EN_PO_DISAPPEAR, 0x30, 2, 0, 0) -/* 0x3875 */ DEFINE_SFX(NA_SE_EN_PO_DAMAGE, 0x38, 2, 0, 0) -/* 0x3876 */ DEFINE_SFX(NA_SE_EN_PO_DEAD, 0x40, 2, 0, 0) -/* 0x3877 */ DEFINE_SFX(NA_SE_EN_PO_DEAD2, 0x40, 2, 0, 0) -/* 0x3878 */ DEFINE_SFX(NA_SE_EN_EXTINCT, 0x14, 1, 2, 0) -/* 0x3879 */ DEFINE_SFX(NA_SE_EN_GOLON_LAND_BIG, 0x34, 0, 0, 0) -/* 0x387A */ DEFINE_SFX(NA_SE_EN_RIZA_DOWN, 0x40, 0, 0, 0) -/* 0x387B */ DEFINE_SFX(NA_SE_EN_DODO_M_GND, 0x20, 0, 0, 0) -/* 0x387C */ DEFINE_SFX(NA_SE_EN_NUTS_UP, 0x28, 0, 0, 0) -/* 0x387D */ DEFINE_SFX(NA_SE_EN_NUTS_DOWN, 0x28, 0, 0, 0) -/* 0x387E */ DEFINE_SFX(NA_SE_EN_NUTS_THROW, 0x30, 0, 0, 0) -/* 0x387F */ DEFINE_SFX(NA_SE_EN_NUTS_WALK, 0x14, 0, 0, 0) -/* 0x3880 */ DEFINE_SFX(NA_SE_EN_NUTS_DAMAGE, 0x38, 1, 0, 0) -/* 0x3881 */ DEFINE_SFX(NA_SE_EN_NUTS_DEAD, 0x40, 1, 0, 0) -/* 0x3882 */ DEFINE_SFX(NA_SE_EN_NUTS_FAINT, 0x20, 0, 0, 0) -/* 0x3883 */ DEFINE_SFX(NA_SE_EN_PO_BIG_GET, 0x30, 3, 0, 0) -/* 0x3884 */ DEFINE_SFX(NA_SE_EN_STALTU_ROLL, 0x30, 0, 0, 0) -/* 0x3885 */ DEFINE_SFX(NA_SE_EN_STALWALL_DEAD, 0x40, 1, 0, 0) -/* 0x3886 */ DEFINE_SFX(NA_SE_EN_PO_SISTER_DEAD, 0x40, 3, 0, 0) -/* 0x3887 */ DEFINE_SFX(NA_SE_EN_BARI_SPLIT, 0x40, 1, 0, 0) -/* 0x3888 */ DEFINE_SFX(NA_SE_EN_TEKU_REVERSE, 0x28, 1, 0, 0) -/* 0x3889 */ DEFINE_SFX(NA_SE_EN_VALVAISA_LAND2, 0x30, 3, 0, 0) -/* 0x388A */ DEFINE_SFX(NA_SE_EN_TEKU_LAND_WATER, 0x20, 0, 0, 0) -/* 0x388B */ DEFINE_SFX(NA_SE_EN_LAST_DAMAGE, 0x38, 1, 0, 0) -/* 0x388C */ DEFINE_SFX(NA_SE_EN_STALWALL_ROLL, 0x30, 0, 0, 0) -/* 0x388D */ DEFINE_SFX(NA_SE_EN_STALWALL_DASH, 0x30, 0, 0, 0) -/* 0x388E */ DEFINE_SFX(NA_SE_EN_TEKU_JUMP_WATER, 0x20, 0, 0, 0) -/* 0x388F */ DEFINE_SFX(NA_SE_EN_TEKU_LAND_WATER2, 0x20, 0, 0, 0) -/* 0x3890 */ DEFINE_SFX(NA_SE_EN_FALL_AIM, 0x38, 0, 0, SFX_FLAG_13) -/* 0x3891 */ DEFINE_SFX(NA_SE_EN_FALL_UP, 0x30, 3, 0, 0) -/* 0x3892 */ DEFINE_SFX(NA_SE_EN_FALL_CATCH, 0x30, 0, 0, SFX_FLAG_13) -/* 0x3893 */ DEFINE_SFX(NA_SE_EN_FALL_LAND, 0x30, 0, 0, 0) -/* 0x3894 */ DEFINE_SFX(NA_SE_EN_FALL_WALK, 0x14, 0, 0, 0) -/* 0x3895 */ DEFINE_SFX(NA_SE_EN_FALL_DAMAGE, 0x38, 1, 0, 0) -/* 0x3896 */ DEFINE_SFX(NA_SE_EN_FALL_DEAD, 0x40, 1, 0, 0) -/* 0x3897 */ DEFINE_SFX(NA_SE_EN_KAICHO_FLUTTER, 0x14, 0, 0, 0) -/* 0x3898 */ DEFINE_SFX(NA_SE_EN_BIRI_FLY, 0x20, 0, 0, 0) -/* 0x3899 */ DEFINE_SFX(NA_SE_EN_BIRI_JUMP, 0x20, 0, 0, 0) -/* 0x389A */ DEFINE_SFX(NA_SE_EN_BIRI_SPARK, 0x30, 0, 0, 0) -/* 0x389B */ DEFINE_SFX(NA_SE_EN_BIRI_DEAD, 0x40, 1, 0, 0) -/* 0x389C */ DEFINE_SFX(NA_SE_EN_BIRI_BUBLE, 0x40, 1, 0, 0) -/* 0x389D */ DEFINE_SFX(NA_SE_EN_BARI_ROLL, 0x30, 0, 0, 0) -/* 0x389E */ DEFINE_SFX(NA_SE_EN_GOMA_JR_FREEZE, 0x34, 1, 0, 0) -/* 0x389F */ DEFINE_SFX(NA_SE_EN_BARI_DEAD, 0x40, 1, 0, 0) -/* 0x38A0 */ DEFINE_SFX(NA_SE_EN_GANON_FIRE, 0x30, 3, 0, 0) -/* 0x38A1 */ DEFINE_SFX(NA_SE_EN_FANTOM_TRANSFORM, 0x30, 2, 0, 0) -/* 0x38A2 */ DEFINE_SFX(NA_SE_EN_FANTOM_THUNDER, 0x30, 0, 0, SFX_FLAG_13) -/* 0x38A3 */ DEFINE_SFX(NA_SE_EN_FANTOM_SPARK, 0x20, 3, 1, 0) -/* 0x38A4 */ DEFINE_SFX(NA_SE_EN_FANTOM_FLOAT, 0x20, 2, 0, 0) -/* 0x38A5 */ DEFINE_SFX(NA_SE_EN_FANTOM_MASIC1, 0x30, 3, 0, 0) -/* 0x38A6 */ DEFINE_SFX(NA_SE_EN_FANTOM_MASIC2, 0x30, 3, 0, 0) -/* 0x38A7 */ DEFINE_SFX(NA_SE_EN_FANTOM_FIRE, 0x30, 3, 0, 0) -/* 0x38A8 */ DEFINE_SFX(NA_SE_EN_FANTOM_HIT_THUNDER, 0x38, 3, 0, 0) -/* 0x38A9 */ DEFINE_SFX(NA_SE_EN_FANTOM_ATTACK, 0x30, 0, 0, SFX_FLAG_13) -/* 0x38AA */ DEFINE_SFX(NA_SE_EN_FANTOM_STICK, 0x30, 3, 0, 0) -/* 0x38AB */ DEFINE_SFX(NA_SE_EN_FANTOM_EYE, 0x30, 2, 0, 0) -/* 0x38AC */ DEFINE_SFX(NA_SE_EN_FANTOM_LAST, 0x30, 0, 0, SFX_FLAG_13) -/* 0x38AD */ DEFINE_SFX(NA_SE_EN_FANTOM_THUNDER_GND, 0x30, 3, 0, 0) -/* 0x38AE */ DEFINE_SFX(NA_SE_EN_FANTOM_DAMAGE, 0x38, 3, 0, 0) -/* 0x38AF */ DEFINE_SFX(NA_SE_EN_FANTOM_DEAD, 0x40, 3, 0, 0) -/* 0x38B0 */ DEFINE_SFX(NA_SE_EN_FANTOM_LAUGH, 0x30, 3, 0, 0) -/* 0x38B1 */ DEFINE_SFX(NA_SE_EN_FANTOM_DAMAGE2, 0x30, 3, 0, 0) -/* 0x38B2 */ DEFINE_SFX(NA_SE_EN_FANTOM_VOICE, 0x30, 3, 0, SFX_FLAG_10) -/* 0x38B3 */ DEFINE_SFX(NA_SE_EN_KAICHO_DAMAGE, 0x38, 1, 0, 0) -/* 0x38B4 */ DEFINE_SFX(NA_SE_EN_GANON_ATTACK_DEMO, 0x30, 3, 0, 0) -/* 0x38B5 */ DEFINE_SFX(NA_SE_EN_GANON_FIRE_DEMO, 0x30, 3, 0, 0) -/* 0x38B6 */ DEFINE_SFX(NA_SE_EN_KAICHO_CRY, 0x20, 0, 0, 0) -/* 0x38B7 */ DEFINE_SFX(NA_SE_EN_KAICHO_ATTACK, 0x34, 0, 0, 0) -/* 0x38B8 */ DEFINE_SFX(NA_SE_EN_MORIBLIN_WALK, 0x18, 1, 0, 0) -/* 0x38B9 */ DEFINE_SFX(NA_SE_EN_MORIBLIN_SLIDE, 0x20, 0, 0, SFX_FLAG_13) -/* 0x38BA */ DEFINE_SFX(NA_SE_EN_MORIBLIN_ATTACK, 0x30, 0, 0, SFX_FLAG_13) -/* 0x38BB */ DEFINE_SFX(NA_SE_EN_MORIBLIN_VOICE, 0x14, 3, 0, 0) -/* 0x38BC */ DEFINE_SFX(NA_SE_EN_MORIBLIN_SPEAR_AT, 0x28, 3, 0, 0) -/* 0x38BD */ DEFINE_SFX(NA_SE_EN_MORIBLIN_SPEAR_NORM, 0x28, 3, 0, 0) -/* 0x38BE */ DEFINE_SFX(NA_SE_EN_MORIBLIN_DEAD, 0x40, 3, 0, 0) -/* 0x38BF */ DEFINE_SFX(NA_SE_EN_MORIBLIN_DASH, 0x30, 3, 0, 0) -/* 0x38C0 */ DEFINE_SFX(NA_SE_EN_OCTAROCK_ROCK, 0x20, 0, 0, 0) -/* 0x38C1 */ DEFINE_SFX(NA_SE_EN_OCTAROCK_FLOAT, 0x14, 0, 0, 0) -/* 0x38C2 */ DEFINE_SFX(NA_SE_EN_OCTAROCK_JUMP, 0x30, 0, 0, 0) -/* 0x38C3 */ DEFINE_SFX(NA_SE_EN_OCTAROCK_LAND, 0x30, 0, 0, 0) -/* 0x38C4 */ DEFINE_SFX(NA_SE_EN_OCTAROCK_SINK, 0x28, 0, 0, 0) -/* 0x38C5 */ DEFINE_SFX(NA_SE_EN_OCTAROCK_BUBLE, 0x28, 0, 0, 0) -/* 0x38C6 */ DEFINE_SFX(NA_SE_EN_OCTAROCK_DEAD1, 0x40, 1, 0, 0) -/* 0x38C7 */ DEFINE_SFX(NA_SE_EN_OCTAROCK_DEAD2, 0x40, 1, 0, 0) -/* 0x38C8 */ DEFINE_SFX(NA_SE_EN_BUBLE_WING, 0x20, 0, 0, 0) -/* 0x38C9 */ DEFINE_SFX(NA_SE_EN_BUBLE_MOUTH, 0x20, 0, 0, 0) -/* 0x38CA */ DEFINE_SFX(NA_SE_EN_BUBLE_LAUGH, 0x14, 0, 0, 0) -/* 0x38CB */ DEFINE_SFX(NA_SE_EN_BUBLE_BITE, 0x30, 0, 0, 0) -/* 0x38CC */ DEFINE_SFX(NA_SE_EN_BUBLE_UP, 0x30, 0, 0, 0) -/* 0x38CD */ DEFINE_SFX(NA_SE_EN_BUBLE_DOWN, 0x30, 0, 0, 0) -/* 0x38CE */ DEFINE_SFX(NA_SE_EN_BUBLE_DEAD, 0x40, 1, 0, 0) -/* 0x38CF */ DEFINE_SFX(NA_SE_EN_BUBLEFALL_FIRE, 0x30, 0, 0, 0) -/* 0x38D0 */ DEFINE_SFX(NA_SE_EN_VALVAISA_APPEAR, 0x30, 3, 0, 0) -/* 0x38D1 */ DEFINE_SFX(NA_SE_EN_VALVAISA_ROAR, 0x30, 3, 0, 0) -/* 0x38D2 */ DEFINE_SFX(NA_SE_EN_VALVAISA_MAHI1, 0x30, 3, 0, 0) -/* 0x38D3 */ DEFINE_SFX(NA_SE_EN_VALVAISA_MAHI2, 0x30, 3, 0, 0) -/* 0x38D4 */ DEFINE_SFX(NA_SE_EN_VALVAISA_KNOCKOUT, 0x30, 3, 0, 0) -/* 0x38D5 */ DEFINE_SFX(NA_SE_EN_VALVAISA_DAMAGE1, 0x38, 3, 0, 0) -/* 0x38D6 */ DEFINE_SFX(NA_SE_EN_VALVAISA_DAMAGE2, 0x38, 3, 0, 0) -/* 0x38D7 */ DEFINE_SFX(NA_SE_EN_VALVAISA_ROCK, 0x30, 3, 0, 0) -/* 0x38D8 */ DEFINE_SFX(NA_SE_EN_VALVAISA_SW_NAIL, 0x30, 3, 0, 0) -/* 0x38D9 */ DEFINE_SFX(NA_SE_EN_VALVAISA_DEAD, 0x40, 3, 0, 0) -/* 0x38DA */ DEFINE_SFX(NA_SE_EN_VALVAISA_BURN, 0x30, 3, 0, 0) -/* 0x38DB */ DEFINE_SFX(NA_SE_EN_VALVAISA_FIRE, 0x30, 3, 0, 0) -/* 0x38DC */ DEFINE_SFX(NA_SE_EN_BARI_DAMAGE, 0x38, 1, 0, 0) -/* 0x38DD */ DEFINE_SFX(NA_SE_EN_MOFER_CORE_LAND, 0x28, 3, 0, 0) -/* 0x38DE */ DEFINE_SFX(NA_SE_EN_MOFER_CORE_MOVE_WT, 0x28, 3, 2, 0) -/* 0x38DF */ DEFINE_SFX(NA_SE_EN_MOFER_CORE_SMJUMP, 0x28, 2, 2, 0) -/* 0x38E0 */ DEFINE_SFX(NA_SE_EN_MONBLIN_GNDWAVE, 0x30, 3, 0, 0) -/* 0x38E1 */ DEFINE_SFX(NA_SE_EN_MONBLIN_HAM_DOWN, 0x30, 0, 0, SFX_FLAG_13) -/* 0x38E2 */ DEFINE_SFX(NA_SE_EN_MONBLIN_HAM_UP, 0x30, 0, 0, SFX_FLAG_13) -/* 0x38E3 */ DEFINE_SFX(NA_SE_EN_BUBLE_DAMAGE, 0x38, 1, 0, 0) -/* 0x38E4 */ DEFINE_SFX(NA_SE_EN_REDEAD_CRY, 0x20, 0, 0, 0) -/* 0x38E5 */ DEFINE_SFX(NA_SE_EN_REDEAD_AIM, 0x34, 0, 0, 0) -/* 0x38E6 */ DEFINE_SFX(NA_SE_EN_REDEAD_DAMAGE, 0x38, 1, 0, 0) -/* 0x38E7 */ DEFINE_SFX(NA_SE_EN_REDEAD_DEAD, 0x40, 1, 0, 0) -/* 0x38E8 */ DEFINE_SFX(NA_SE_EN_REDEAD_ATTACK, 0x34, 0, 0, SFX_FLAG_13) -/* 0x38E9 */ DEFINE_SFX(NA_SE_EN_NYU_MOVE, 0x20, 0, 0, 0) -/* 0x38EA */ DEFINE_SFX(NA_SE_EN_NYU_HIT_STOP, 0x38, 0, 0, 0) -/* 0x38EB */ DEFINE_SFX(NA_SE_EN_KAICHO_DEAD, 0x40, 1, 0, 0) -/* 0x38EC */ DEFINE_SFX(NA_SE_EN_PO_LAUGH, 0x30, 3, 0, 0) -/* 0x38ED */ DEFINE_SFX(NA_SE_EN_PO_CRY, 0x30, 2, 0, 0) -/* 0x38EE */ DEFINE_SFX(NA_SE_EN_PO_ROLL, 0x30, 2, 0, 0) -/* 0x38EF */ DEFINE_SFX(NA_SE_EN_PO_LAUGH2, 0x38, 3, 0, 0) -/* 0x38F0 */ DEFINE_SFX(NA_SE_EN_MOFER_APPEAR, 0x30, 3, 0, 0) -/* 0x38F1 */ DEFINE_SFX(NA_SE_EN_MOFER_ATTACK, 0x32, 3, 0, 0) -/* 0x38F2 */ DEFINE_SFX(NA_SE_EN_MOFER_WAVE, 0x34, 3, 0, 0) -/* 0x38F3 */ DEFINE_SFX(NA_SE_EN_MOFER_CATCH, 0x34, 3, 0, 0) -/* 0x38F4 */ DEFINE_SFX(NA_SE_EN_MOFER_CUT, 0x30, 3, 0, 0) -/* 0x38F5 */ DEFINE_SFX(NA_SE_EN_MOFER_MOVE_DEMO, 0x30, 3, 0, 0) -/* 0x38F6 */ DEFINE_SFX(NA_SE_EN_MOFER_BUBLE_DEMO, 0x30, 3, 0, 0) -/* 0x38F7 */ DEFINE_SFX(NA_SE_EN_MOFER_CORE_JUMP, 0x28, 2, 2, 0) -/* 0x38F8 */ DEFINE_SFX(NA_SE_EN_MOFER_DEAD, 0x40, 3, 0, 0) -/* 0x38F9 */ DEFINE_SFX(NA_SE_EN_MOFER_LASTVOICE, 0x40, 3, 0, 0) -/* 0x38FA */ DEFINE_SFX(NA_SE_EN_MOFER_CORE_ROLL, 0x30, 3, 0, 0) -/* 0x38FB */ DEFINE_SFX(NA_SE_EN_MOFER_CORE_FLY, 0x30, 3, 0, 0) -/* 0x38FC */ DEFINE_SFX(NA_SE_EN_GOLON_WAKE_UP, 0x20, 0, 0, 0) -/* 0x38FD */ DEFINE_SFX(NA_SE_EN_GOLON_SIT_DOWN, 0x20, 0, 0, 0) -/* 0x38FE */ DEFINE_SFX(NA_SE_EN_CHICKEN_FLUTTER, 0x30, 0, 0, 0) -/* 0x38FF */ DEFINE_SFX(NA_SE_EN_DEKU_WAKEUP, 0x20, 0, 2, 0) -/* 0x3900 */ DEFINE_SFX(NA_SE_EN_DEADHAND_BITE, 0x30, 3, 0, 0) -/* 0x3901 */ DEFINE_SFX(NA_SE_EN_DEADHAND_WALK, 0x18, 3, 0, 0) -/* 0x3902 */ DEFINE_SFX(NA_SE_EN_DEADHAND_GRIP, 0x34, 3, 0, 0) -/* 0x3903 */ DEFINE_SFX(NA_SE_EN_DEADHAND_HAND_AT, 0x30, 3, 0, 0) -/* 0x3904 */ DEFINE_SFX(NA_SE_EN_DAIOCTA_MAHI, 0x38, 3, 0, 0) -/* 0x3905 */ DEFINE_SFX(NA_SE_EN_DAIOCTA_SPLASH, 0x18, 3, 0, 0) -/* 0x3906 */ DEFINE_SFX(NA_SE_EN_DAIOCTA_VOICE, 0x30, 0, 0, SFX_FLAG_13) -/* 0x3907 */ DEFINE_SFX(NA_SE_EN_DAIOCTA_DAMAGE, 0x38, 3, 0, 0) -/* 0x3908 */ DEFINE_SFX(NA_SE_EN_DAIOCTA_SINK, 0x30, 3, 0, 0) -/* 0x3909 */ DEFINE_SFX(NA_SE_EN_DAIOCTA_DEAD, 0x40, 3, 0, 0) -/* 0x390A */ DEFINE_SFX(NA_SE_EN_DAIOCTA_DEAD2, 0x40, 0, 0, SFX_FLAG_13) -/* 0x390B */ DEFINE_SFX(NA_SE_EN_GANON_HIT_THUNDER, 0x38, 3, 0, 0) -/* 0x390C */ DEFINE_SFX(NA_SE_EN_TWINROBA_APPEAR_MS, 0x30, 0, 0, SFX_FLAG_13) -/* 0x390D */ DEFINE_SFX(NA_SE_EN_TWINROBA_TRANSFORM, 0x30, 3, 0, 0) -/* 0x390E */ DEFINE_SFX(NA_SE_EN_TWINROBA_MS_FIRE, 0x30, 3, 0, 0) -/* 0x390F */ DEFINE_SFX(NA_SE_EN_TWINROBA_FIRE_EXP, 0x30, 3, 0, 0) -/* 0x3910 */ DEFINE_SFX(NA_SE_EN_TWINROBA_POWERUP, 0x30, 3, 0, 0) -/* 0x3911 */ DEFINE_SFX(NA_SE_EN_TWINROBA_SHOOT_FREEZE, 0x30, 3, 0, 0) -/* 0x3912 */ DEFINE_SFX(NA_SE_EN_TWINROBA_MS_FREEZE, 0x30, 3, 0, 0) -/* 0x3913 */ DEFINE_SFX(NA_SE_EN_TWINROBA_MASIC_SET, 0x30, 2, 0, 0) -/* 0x3914 */ DEFINE_SFX(NA_SE_EN_TWINROBA_CUTBODY, 0x30, 3, 0, 0) -/* 0x3915 */ DEFINE_SFX(NA_SE_EN_GANON_HIT_GND_IMP, 0x30, 3, 0, 0) -/* 0x3916 */ DEFINE_SFX(NA_SE_EN_TWINROBA_DAMAGE_VOICE, 0x38, 0, 0, SFX_FLAG_13) -/* 0x3917 */ DEFINE_SFX(NA_SE_EN_TWINROBA_REFL_FIRE, 0x38, 3, 0, 0) -/* 0x3918 */ DEFINE_SFX(NA_SE_EN_TWINROBA_REFL_FREEZE, 0x38, 3, 0, 0) -/* 0x3919 */ DEFINE_SFX(NA_SE_EN_GANON_CUTBODY, 0x38, 3, 0, 0) -/* 0x391A */ DEFINE_SFX(NA_SE_EN_TWINROBA_YOUNG_DAMAGE, 0x38, 0, 0, SFX_FLAG_13) -/* 0x391B */ DEFINE_SFX(NA_SE_EN_TWINROBA_YOUNG_DEAD, 0x40, 0, 0, SFX_FLAG_13) -/* 0x391C */ DEFINE_SFX(NA_SE_EN_GOLON_EYE_BIG, 0x18, 0, 0, 0) -/* 0x391D */ DEFINE_SFX(NA_SE_EN_GOLON_GOOD_BIG, 0x30, 3, 0, 0) -/* 0x391E */ DEFINE_SFX(NA_SE_EN_TWINROBA_FB_FLY, 0x30, 2, 0, 0) -/* 0x391F */ DEFINE_SFX(NA_SE_EN_TWINROBA_FLY, 0x20, 2, 0, 0) -/* 0x3920 */ DEFINE_SFX(NA_SE_EN_TWINROBA_UNARI, 0x24, 3, 0, 0) -/* 0x3921 */ DEFINE_SFX(NA_SE_EN_TWINROBA_ROLL, 0x28, 3, 0, 0) -/* 0x3922 */ DEFINE_SFX(NA_SE_EN_TWINROBA_SHOOT_FIRE, 0x30, 3, 0, 0) -/* 0x3923 */ DEFINE_SFX(NA_SE_EN_TWINROBA_THROW_MASIC, 0x30, 3, 0, 0) -/* 0x3924 */ DEFINE_SFX(NA_SE_EN_DARUNIA_HIT_BREAST, 0x30, 0, 0, 0) -/* 0x3925 */ DEFINE_SFX(NA_SE_EN_DARUNIA_HIT_LINK, 0x30, 0, 0, 0) -/* 0x3926 */ DEFINE_SFX(NA_SE_EN_OWL_FLUTTER, 0x30, 0, 0, 0) -/* 0x3927 */ DEFINE_SFX(NA_SE_EN_VALVAISA_LAND, 0x30, 3, 0, 0) -/* 0x3928 */ DEFINE_SFX(NA_SE_EN_IRONNACK_WALK, 0x18, 1, 0, 0) -/* 0x3929 */ DEFINE_SFX(NA_SE_EN_IRONNACK_SWING_AXE, 0x34, 3, 0, 0) -/* 0x392A */ DEFINE_SFX(NA_SE_EN_IRONNACK_ARMOR_DEMO, 0x30, 3, 0, 0) -/* 0x392B */ DEFINE_SFX(NA_SE_EN_IRONNACK_STAGGER_DEMO, 0x30, 3, 0, 0) -/* 0x392C */ DEFINE_SFX(NA_SE_EN_IRONNACK_ARMOR_OFF_DEMO, 0x34, 3, 0, 0) -/* 0x392D */ DEFINE_SFX(NA_SE_EN_IRONNACK_ARMOR_LAND1_DEMO, 0x30, 3, 0, 0) -/* 0x392E */ DEFINE_SFX(NA_SE_EN_IRONNACK_ARMOR_LAND2_DEMO, 0x30, 3, 0, 0) -/* 0x392F */ DEFINE_SFX(NA_SE_EN_IRONNACK_ARMOR_LAND3_DEMO, 0x30, 3, 0, 0) -/* 0x3930 */ DEFINE_SFX(NA_SE_EN_FLOORMASTER_ATTACK, 0x30, 1, 0, 0) -/* 0x3931 */ DEFINE_SFX(NA_SE_EN_FLOORMASTER_SM_WALK, 0x14, 0, 0, 0) -/* 0x3932 */ DEFINE_SFX(NA_SE_EN_FLOORMASTER_SM_DEAD, 0x40, 1, 0, 0) -/* 0x3933 */ DEFINE_SFX(NA_SE_EN_FLOORMASTER_RESTORE, 0x30, 1, 0, 0) -/* 0x3934 */ DEFINE_SFX(NA_SE_EN_FLOORMASTER_EXPAND, 0x30, 1, 0, 0) -/* 0x3935 */ DEFINE_SFX(NA_SE_EN_FLOORMASTER_SPLIT, 0x30, 1, 0, 0) -/* 0x3936 */ DEFINE_SFX(NA_SE_EN_FLOORMASTER_SM_STICK, 0x38, 3, 0, 0) -/* 0x3937 */ DEFINE_SFX(NA_SE_EN_FLOORMASTER_SM_LAND, 0x30, 0, 0, 0) -/* 0x3938 */ DEFINE_SFX(NA_SE_EN_IRONNACK_WAVE_DEMO, 0x30, 3, 0, 0) -/* 0x3939 */ DEFINE_SFX(NA_SE_EN_IRONNACK_FINGER_DEMO, 0x30, 3, 0, 0) -/* 0x393A */ DEFINE_SFX(NA_SE_EN_IRONNACK_ARMOR_HIT, 0x38, 3, 0, 0) -/* 0x393B */ DEFINE_SFX(NA_SE_EN_NUTS_CUTBODY, 0x38, 3, 0, 0) -/* 0x393C */ DEFINE_SFX(NA_SE_EN_BALINADE_LEVEL, 0x30, 2, 0, 0) -/* 0x393D */ DEFINE_SFX(NA_SE_EN_BALINADE_DAMAGE, 0x38, 3, 0, 0) -/* 0x393E */ DEFINE_SFX(NA_SE_EN_BALINADE_FAINT, 0x38, 3, 0, 0) -/* 0x393F */ DEFINE_SFX(NA_SE_EN_BALINADE_BREAK, 0x30, 3, 2, 0) -/* 0x3940 */ DEFINE_SFX(NA_SE_EN_BALINADE_DEAD, 0x38, 3, 0, 0) -/* 0x3941 */ DEFINE_SFX(NA_SE_EN_BALINADE_STICK, 0x30, 3, 0, 0) -/* 0x3942 */ DEFINE_SFX(NA_SE_EN_BALINADE_THUNDER, 0x34, 3, 0, 0) -/* 0x3943 */ DEFINE_SFX(NA_SE_EN_BALINADE_BL_SPARK, 0x20, 2, 0, 0) -/* 0x3944 */ DEFINE_SFX(NA_SE_EN_BALINADE_BL_DEAD, 0x34, 3, 0, 0) -/* 0x3945 */ DEFINE_SFX(NA_SE_EN_BALINADE_BREAK2, 0x30, 3, 0, 0) -/* 0x3946 */ DEFINE_SFX(NA_SE_EN_BALINADE_HIT_RINK, 0x38, 3, 0, 0) -/* 0x3947 */ DEFINE_SFX(NA_SE_EN_GANON_WAVE_GND, 0x20, 3, 0, 0) -/* 0x3948 */ DEFINE_SFX(NA_SE_EN_AWA_BOUND, 0x14, 0, 0, 0) -/* 0x3949 */ DEFINE_SFX(NA_SE_EN_AWA_BREAK, 0x20, 1, 0, 0) -/* 0x394A */ DEFINE_SFX(NA_SE_EN_BROB_WAVE, 0x30, 3, 0, 0) -/* 0x394B */ DEFINE_SFX(NA_SE_EN_NYU_DEAD, 0x40, 1, 0, 0) -/* 0x394C */ DEFINE_SFX(NA_SE_EN_EIER_DAMAGE, 0x38, 1, 0, 0) -/* 0x394D */ DEFINE_SFX(NA_SE_EN_EIER_DEAD, 0x40, 1, 0, 0) -/* 0x394E */ DEFINE_SFX(NA_SE_EN_EIER_FLUTTER, 0x20, 0, 0, 0) -/* 0x394F */ DEFINE_SFX(NA_SE_EN_EIER_FLY, 0x20, 0, 0, 0) -/* 0x3950 */ DEFINE_SFX(NA_SE_EN_SHADEST_TAIKO_LOW, 0x30, 3, 0, 0) -/* 0x3951 */ DEFINE_SFX(NA_SE_EN_SHADEST_TAIKO_HIGH, 0x30, 3, 0, 0) -/* 0x3952 */ DEFINE_SFX(NA_SE_EN_SHADEST_CLAP, 0x30, 3, 0, 0) -/* 0x3953 */ DEFINE_SFX(NA_SE_EN_SHADEST_FLY_ATTACK, 0x30, 3, 0, 0) -/* 0x3954 */ DEFINE_SFX(NA_SE_EN_PIHAT_UP, 0x28, 2, 0, 0) -/* 0x3955 */ DEFINE_SFX(NA_SE_EN_PIHAT_FLY, 0x30, 0, 0, 0) -/* 0x3956 */ DEFINE_SFX(NA_SE_EN_PIHAT_DAMAGE, 0x38, 1, 0, 0) -/* 0x3957 */ DEFINE_SFX(NA_SE_EN_PIHAT_LAND, 0x28, 2, 0, 0) -/* 0x3958 */ DEFINE_SFX(NA_SE_EN_BALINADE_HAND_DOWN, 0x30, 3, 0, 0) -/* 0x3959 */ DEFINE_SFX(NA_SE_EN_BALINADE_HAND_UP, 0x30, 3, 0, 0) -/* 0x395A */ DEFINE_SFX(NA_SE_EN_BALINADE_HAND_DAMAGE, 0x38, 3, 0, 0) -/* 0x395B */ DEFINE_SFX(NA_SE_EN_BALINADE_HAND_DEAD, 0x40, 3, 0, 0) -/* 0x395C */ DEFINE_SFX(NA_SE_EN_GOMA_JR_WALK, 0x14, 0, 0, 0) -/* 0x395D */ DEFINE_SFX(NA_SE_EN_GOMA_JR_CRY, 0x30, 0, 0, 0) -/* 0x395E */ DEFINE_SFX(NA_SE_EN_GOMA_JR_DAM1, 0x38, 1, 0, 0) -/* 0x395F */ DEFINE_SFX(NA_SE_EN_GOMA_JR_DAM2, 0x30, 1, 0, 0) -/* 0x3960 */ DEFINE_SFX(NA_SE_EN_GOMA_JR_DEAD, 0x40, 1, 0, 0) -/* 0x3961 */ DEFINE_SFX(NA_SE_EN_GOMA_EGG1, 0x28, 0, 0, 0) -/* 0x3962 */ DEFINE_SFX(NA_SE_EN_GOMA_EGG2, 0x28, 0, 0, 0) -/* 0x3963 */ DEFINE_SFX(NA_SE_EN_GANON_BODY_SPARK, 0x30, 2, 0, 0) -/* 0x3964 */ DEFINE_SFX(NA_SE_EN_SHADEST_HAND_WAVE, 0x30, 3, 0, 0) -/* 0x3965 */ DEFINE_SFX(NA_SE_EN_SHADEST_CATCH, 0x30, 3, 0, 0) -/* 0x3966 */ DEFINE_SFX(NA_SE_EN_SHADEST_LAND, 0x30, 3, 0, 0) -/* 0x3967 */ DEFINE_SFX(NA_SE_EN_SHADEST_HAND_FLY, 0x30, 3, 0, 0) -/* 0x3968 */ DEFINE_SFX(NA_SE_EN_SHADEST_SHAKEHAND, 0x30, 0, 0, SFX_FLAG_13) -/* 0x3969 */ DEFINE_SFX(NA_SE_EN_SHADEST_DAMAGE, 0x38, 3, 0, 0) -/* 0x396A */ DEFINE_SFX(NA_SE_EN_SHADEST_DAMAGE_HAND, 0x38, 3, 0, 0) -/* 0x396B */ DEFINE_SFX(NA_SE_EN_SHADEST_DISAPPEAR, 0x30, 3, 0, 0) -/* 0x396C */ DEFINE_SFX(NA_SE_EN_GANON_CHARGE_MASIC, 0x30, 3, 0, 0) -/* 0x396D */ DEFINE_SFX(NA_SE_EN_GANON_THROW_BIG, 0x34, 3, 0, 0) -/* 0x396E */ DEFINE_SFX(NA_SE_EN_SHADEST_FREEZE, 0x38, 3, 0, 0) -/* 0x396F */ DEFINE_SFX(NA_SE_EN_SHADEST_DEAD, 0x40, 3, 0, 0) -/* 0x3970 */ DEFINE_SFX(NA_SE_EN_BIMOS_ROLL_HEAD, 0x10, 0, 0, 0) -/* 0x3971 */ DEFINE_SFX(NA_SE_EN_BIMOS_LAZER, 0x34, 0, 0, 0) -/* 0x3972 */ DEFINE_SFX(NA_SE_EN_BIMOS_LAZER_GND, 0x18, 0, 0, 0) -/* 0x3973 */ DEFINE_SFX(NA_SE_EN_BIMOS_AIM, 0x30, 0, 0, 0) -/* 0x3974 */ DEFINE_SFX(NA_SE_EN_BUBLEWALK_WALK, 0x14, 0, 0, 0) -/* 0x3975 */ DEFINE_SFX(NA_SE_EN_BUBLEWALK_AIM, 0x34, 0, 0, 0) -/* 0x3976 */ DEFINE_SFX(NA_SE_EN_BUBLEWALK_REVERSE, 0x28, 1, 0, 0) -/* 0x3977 */ DEFINE_SFX(NA_SE_EN_BUBLEWALK_DAMAGE, 0x38, 1, 0, 0) -/* 0x3978 */ DEFINE_SFX(NA_SE_EN_BUBLEWALK_DEAD, 0x40, 1, 0, 0) -/* 0x3979 */ DEFINE_SFX(NA_SE_EN_YUKABYUN_FLY, 0x30, 0, 0, 0) -/* 0x397A */ DEFINE_SFX(NA_SE_EN_FLAME_DAMAGE, 0x38, 3, 0, 0) -/* 0x397B */ DEFINE_SFX(NA_SE_EN_TWINROBA_FLY_DEMO, 0x20, 0, 0, 0) -/* 0x397C */ DEFINE_SFX(NA_SE_EN_FLAME_KICK, 0x20, 2, 0, 0) -/* 0x397D */ DEFINE_SFX(NA_SE_EN_FLAME_RUN, 0x30, 2, 0, 0) -/* 0x397E */ DEFINE_SFX(NA_SE_EN_FLAME_ROLL, 0x30, 3, 0, 0) -/* 0x397F */ DEFINE_SFX(NA_SE_EN_FLAME_MAN_RUN, 0x30, 3, 0, 0) -/* 0x3980 */ DEFINE_SFX(NA_SE_EN_FLAME_MAN_DAMAGE, 0x38, 3, 0, 0) -/* 0x3981 */ DEFINE_SFX(NA_SE_EN_FLAME_LAUGH, 0x30, 3, 0, 0) -/* 0x3982 */ DEFINE_SFX(NA_SE_EN_FLAME_MAN_SLIDE, 0x20, 0, 0, SFX_FLAG_13) -/* 0x3983 */ DEFINE_SFX(NA_SE_EN_FLAME_FIRE_ATTACK, 0x30, 3, 0, 0) -/* 0x3984 */ DEFINE_SFX(NA_SE_EN_PIHAT_SM_FLY, 0x30, 0, 0, 0) -/* 0x3985 */ DEFINE_SFX(NA_SE_EN_PIHAT_SM_DEAD, 0x40, 1, 0, 0) -/* 0x3986 */ DEFINE_SFX(NA_SE_EN_RIVA_APPEAR, 0x30, 0, 0, 0) -/* 0x3987 */ DEFINE_SFX(NA_SE_EN_AKINDONUTS_HIDE, 0x20, 0, 0, 0) -/* 0x3988 */ DEFINE_SFX(NA_SE_EN_RIVA_DAMAGE, 0x38, 1, 0, 0) -/* 0x3989 */ DEFINE_SFX(NA_SE_EN_RIVA_DEAD, 0x40, 1, 0, 0) -/* 0x398A */ DEFINE_SFX(NA_SE_EN_RIVA_MOVE, 0x30, 0, 0, 0) -/* 0x398B */ DEFINE_SFX(NA_SE_EN_FLAME_MAN_SURP, 0x30, 0, 0, SFX_FLAG_13) -/* 0x398C */ DEFINE_SFX(NA_SE_EN_SHADEST_LAST, 0x30, 3, 0, 0) -/* 0x398D */ DEFINE_SFX(NA_SE_EN_SHADEST_MOVE, 0x30, 2, 0, 0) -/* 0x398E */ DEFINE_SFX(NA_SE_EN_SHADEST_PRAY, 0x30, 3, 0, 0) -/* 0x398F */ DEFINE_SFX(NA_SE_EN_MGANON_ROAR, 0x30, 3, 0, 0) -/* 0x3990 */ DEFINE_SFX(NA_SE_EN_LIKE_WALK, 0x18, 0, 0, 0) -/* 0x3991 */ DEFINE_SFX(NA_SE_EN_LIKE_UNARI, 0x28, 0, 0, 0) -/* 0x3992 */ DEFINE_SFX(NA_SE_EN_LIKE_DRINK, 0x34, 0, 0, 0) -/* 0x3993 */ DEFINE_SFX(NA_SE_EN_LIKE_EAT, 0x34, 0, 0, 0) -/* 0x3994 */ DEFINE_SFX(NA_SE_EN_LIKE_THROW, 0x34, 0, 0, 0) -/* 0x3995 */ DEFINE_SFX(NA_SE_EN_LIKE_DAMAGE, 0x38, 1, 0, 0) -/* 0x3996 */ DEFINE_SFX(NA_SE_EN_LIKE_DEAD, 0x40, 1, 0, 0) -/* 0x3997 */ DEFINE_SFX(NA_SE_EN_MGANON_SWORD, 0x30, 3, 0, 0) -/* 0x3998 */ DEFINE_SFX(NA_SE_EN_GERUDOFT_ATTACK, 0x30, 0, 0, 0) -/* 0x3999 */ DEFINE_SFX(NA_SE_EN_GERUDOFT_DAMAGE, 0x38, 1, 0, 0) -/* 0x399A */ DEFINE_SFX(NA_SE_EN_GERUDOFT_DEAD, 0x40, 1, 0, 0) -/* 0x399B */ DEFINE_SFX(NA_SE_EN_MGANON_DAMAGE, 0x38, 3, 0, 0) -/* 0x399C */ DEFINE_SFX(NA_SE_EN_ANUBIS_FIRE, 0x30, 0, 0, 0) -/* 0x399D */ DEFINE_SFX(NA_SE_EN_ANUBIS_FIREBOMB, 0x30, 0, 0, 0) -/* 0x399E */ DEFINE_SFX(NA_SE_EN_MGANON_DEAD1, 0x40, 3, 0, 0) -/* 0x399F */ DEFINE_SFX(NA_SE_EN_ANUBIS_DEAD, 0x40, 2, 0, 0) -/* 0x39A0 */ DEFINE_SFX(NA_SE_EN_MUSI_LAND, 0x18, 0, 0, 0) -/* 0x39A1 */ DEFINE_SFX(NA_SE_EN_MGANON_DEAD2, 0x44, 3, 0, 0) -/* 0x39A2 */ DEFINE_SFX(NA_SE_EN_EIER_ATTACK, 0x34, 0, 0, 0) -/* 0x39A3 */ DEFINE_SFX(NA_SE_EN_EIER_CRY, 0x18, 0, 0, 0) -/* 0x39A4 */ DEFINE_SFX(NA_SE_EN_FREEZAD_BREATH, 0x30, 0, 0, 0) -/* 0x39A5 */ DEFINE_SFX(NA_SE_EN_FREEZAD_DAMAGE, 0x38, 1, 0, 0) -/* 0x39A6 */ DEFINE_SFX(NA_SE_EN_FREEZAD_DEAD, 0x40, 1, 0, 0) -/* 0x39A7 */ DEFINE_SFX(NA_SE_EN_DEADHAND_LAUGH, 0x18, 3, 0, 0) -/* 0x39A8 */ DEFINE_SFX(NA_SE_EN_DEADHAND_HIDE, 0x30, 3, 0, 0) -/* 0x39A9 */ DEFINE_SFX(NA_SE_EN_DEADHAND_DAMAGE, 0x38, 3, 0, 0) -/* 0x39AA */ DEFINE_SFX(NA_SE_EN_DEADHAND_HAND_DEAD, 0x38, 3, 0, 0) -/* 0x39AB */ DEFINE_SFX(NA_SE_EN_DEADHAND_DEAD, 0x40, 3, 0, 0) -/* 0x39AC */ DEFINE_SFX(NA_SE_EN_IRONNACK_BREAK_PILLAR2, 0x30, 3, 0, 0) -/* 0x39AD */ DEFINE_SFX(NA_SE_EN_IRONNACK_BREAK_PILLAR, 0x36, 3, 0, 0) -/* 0x39AE */ DEFINE_SFX(NA_SE_EN_IRONNACK_HIT_GND, 0x34, 3, 0, 0) -/* 0x39AF */ DEFINE_SFX(NA_SE_EN_MGANON_BREATH, 0x28, 2, 2, 0) -/* 0x39B0 */ DEFINE_SFX(NA_SE_EN_TWINROBA_LAUGH, 0x30, 3, 0, 0) -/* 0x39B1 */ DEFINE_SFX(NA_SE_EN_TWINROBA_LAUGH2, 0x30, 3, 0, 0) -/* 0x39B2 */ DEFINE_SFX(NA_SE_EN_DUMMY434, 0x30, 0, 0, 0) -/* 0x39B3 */ DEFINE_SFX(NA_SE_EN_TWINROBA_SHOOT_VOICE, 0x30, 3, 0, 0) -/* 0x39B4 */ DEFINE_SFX(NA_SE_EN_TWINROBA_SENSE, 0x30, 3, 0, 0) -/* 0x39B5 */ DEFINE_SFX(NA_SE_EN_TWINROBA_DIE, 0x30, 3, 0, 0) -/* 0x39B6 */ DEFINE_SFX(NA_SE_EN_DUMMY438, 0x30, 0, 0, 0) -/* 0x39B7 */ DEFINE_SFX(NA_SE_EN_TWINROBA_YOUNG_DAMAGE2, 0x30, 0, 0, SFX_FLAG_13) -/* 0x39B8 */ DEFINE_SFX(NA_SE_EN_TWINROBA_YOUNG_SHOOTVC, 0x30, 0, 0, SFX_FLAG_13) -/* 0x39B9 */ DEFINE_SFX(NA_SE_EN_TWINROBA_YOUNG_LAUGH, 0x30, 0, 0, SFX_FLAG_13) -/* 0x39BA */ DEFINE_SFX(NA_SE_EN_DUMMY442, 0x30, 0, 0, 0) -/* 0x39BB */ DEFINE_SFX(NA_SE_EN_TWINROBA_YOUNG_WINK, 0x30, 0, 0, SFX_FLAG_13) -/* 0x39BC */ DEFINE_SFX(NA_SE_EN_DUMMY444, 0x30, 0, 0, 0) -/* 0x39BD */ DEFINE_SFX(NA_SE_EN_DUMMY445, 0x30, 0, 0, 0) -/* 0x39BE */ DEFINE_SFX(NA_SE_EN_IRONNACK_DAMAGE, 0x28, 3, 0, 0) -/* 0x39BF */ DEFINE_SFX(NA_SE_EN_IRONNACK_DASH, 0x30, 3, 0, 0) -/* 0x39C0 */ DEFINE_SFX(NA_SE_EN_IRONNACK_DEAD, 0x40, 3, 0, 0) -/* 0x39C1 */ DEFINE_SFX(NA_SE_EN_IRONNACK_PULLOUT, 0x30, 3, 0, 0) -/* 0x39C2 */ DEFINE_SFX(NA_SE_EN_IRONNACK_WAKEUP, 0x30, 3, 0, 0) -/* 0x39C3 */ DEFINE_SFX(NA_SE_EN_DUMMY451, 0x30, 0, 0, 0) -/* 0x39C4 */ DEFINE_SFX(NA_SE_EN_DUMMY452, 0x30, 0, 0, 0) -/* 0x39C5 */ DEFINE_SFX(NA_SE_EN_DUMMY453, 0x30, 0, 0, 0) -/* 0x39C6 */ DEFINE_SFX(NA_SE_EN_GERUDOFT_BREATH, 0x20, 0, 0, 0) -/* 0x39C7 */ DEFINE_SFX(NA_SE_EN_GANON_LAUGH, 0x20, 3, 0, 0) -/* 0x39C8 */ DEFINE_SFX(NA_SE_EN_GANON_VOICE_DEMO, 0x30, 3, 0, 0) -/* 0x39C9 */ DEFINE_SFX(NA_SE_EN_GANON_THROW, 0x30, 3, 0, 0) -/* 0x39CA */ DEFINE_SFX(NA_SE_EN_GANON_AT_RETURN, 0x30, 3, 0, 0) -/* 0x39CB */ DEFINE_SFX(NA_SE_EN_GANON_HIT_GND, 0x30, 3, 0, 0) -/* 0x39CC */ DEFINE_SFX(NA_SE_EN_GANON_DAMAGE1, 0x38, 3, 0, 0) -/* 0x39CD */ DEFINE_SFX(NA_SE_EN_GANON_DAMAGE2, 0x38, 3, 0, 0) -/* 0x39CE */ DEFINE_SFX(NA_SE_EN_GANON_DOWN, 0x20, 3, 0, 0) -/* 0x39CF */ DEFINE_SFX(NA_SE_EN_GANON_RESTORE, 0x30, 3, 0, 0) -/* 0x39D0 */ DEFINE_SFX(NA_SE_EN_GANON_DEAD, 0x44, 3, 0, 0) -/* 0x39D1 */ DEFINE_SFX(NA_SE_EN_GANON_BREATH, 0x30, 3, 2, 0) -/* 0x39D2 */ DEFINE_SFX(NA_SE_EN_GANON_TOKETU, 0x30, 3, 0, 0) -/* 0x39D3 */ DEFINE_SFX(NA_SE_EN_GANON_CASBREAK, 0x30, 3, 0, 0) -/* 0x39D4 */ DEFINE_SFX(NA_SE_EN_GANON_BIGMASIC, 0x34, 3, 0, 0) -/* 0x39D5 */ DEFINE_SFX(NA_SE_EN_GANON_DARKWAVE, 0x30, 3, 0, 0) -/* 0x39D6 */ DEFINE_SFX(NA_SE_EN_FANTOM_ST_LAUGH, 0x30, 3, 0, 0) -/* 0x39D7 */ DEFINE_SFX(NA_SE_EN_MGANON_WALK, 0x20, 2, 0, 0) -/* 0x39D8 */ DEFINE_SFX(NA_SE_EN_MGANON_STAND, 0x30, 3, 0, 0) -/* 0x39D9 */ DEFINE_SFX(NA_SE_EN_MGANON_UNARI, 0x20, 3, 0, 0) -/* 0x39DA */ DEFINE_SFX(NA_SE_EN_STALGOLD_ROLL, 0x30, 0, 0, 0) -/* 0x39DB */ DEFINE_SFX(NA_SE_EN_KDOOR_WAVE, 0x30, 2, 0, 0) -/* 0x39DC */ DEFINE_SFX(NA_SE_EN_KDOOR_HIT, 0x40, 2, 0, 0) -/* 0x39DD */ DEFINE_SFX(NA_SE_EN_KDOOR_BREAK, 0x40, 3, 0, 0) -/* 0x39DE */ DEFINE_SFX(NA_SE_EN_KDOOR_HIT_GND, 0x34, 2, 0, 0) -/* 0x39DF */ DEFINE_SFX(NA_SE_EN_MGANON_SWDIMP, 0x30, 3, 0, 0) -/* 0x39E0 */ DEFINE_SFX(NA_SE_EN_STALTU_WAVE, 0x30, 0, 0, 0) -/* 0x39E1 */ DEFINE_SFX(NA_SE_EN_STALTU_DOWN_SET, 0x30, 0, 0, 0) -/* 0x39E2 */ DEFINE_SFX(NA_SE_EN_DUMMY482, 0x30, 1, 0, 0) -/* 0x39E3 */ DEFINE_SFX(NA_SE_EN_GOMA_BJR_LAND, 0x34, 3, 0, 0) -/* 0x39E4 */ DEFINE_SFX(NA_SE_EN_GOMA_BJR_LAND2, 0x24, 3, 0, 0) -/* 0x39E5 */ DEFINE_SFX(NA_SE_EN_GOMA_JR_LAND, 0x34, 1, 0, 0) -/* 0x39E6 */ DEFINE_SFX(NA_SE_EN_GOMA_JR_LAND2, 0x20, 0, 0, 0) -/* 0x39E7 */ DEFINE_SFX(NA_SE_EN_TWINROBA_FIGHT, 0x30, 3, 0, 0) -/* 0x39E8 */ DEFINE_SFX(NA_SE_EN_PO_BIG_CRY, 0x30, 0, 0, 0) -/* 0x39E9 */ DEFINE_SFX(NA_SE_EN_MUSI_SINK, 0x08, 1, 0, 0) -/* 0x39EA */ DEFINE_SFX(NA_SE_EN_STALGOLD_UP_CRY, 0x30, 1, 0, 0) -/* 0x39EB */ DEFINE_SFX(NA_SE_EN_GOLON_CRY, 0x30, 3, 0, 0) -/* 0x39EC */ DEFINE_SFX(NA_SE_EN_MOFER_CORE_DAMAGE, 0x38, 3, 0, 0) -/* 0x39ED */ DEFINE_SFX(NA_SE_EN_DAIOCTA_LAND_WATER, 0x20, 0, 0, SFX_FLAG_13) -/* 0x39EE */ DEFINE_SFX(NA_SE_EN_RIVA_BIG_APPEAR, 0x34, 3, 0, 0) -/* 0x39EF */ DEFINE_SFX(NA_SE_EN_MONBLIN_HAM_LAND, 0x34, 0, 0, SFX_FLAG_13) -/* 0x39F0 */ DEFINE_SFX(NA_SE_EN_MUSI_WALK, 0x08, 0, 0, 0) -/* 0x39F1 */ DEFINE_SFX(NA_SE_EN_MIMICK_BREATH, 0x40, 3, 0, 0) -/* 0x39F2 */ DEFINE_SFX(NA_SE_EN_STALWALL_LAUGH, 0x34, 3, 0, 0) +/* 0x3800 */ DEFINE_SFX(CHAN_3544, NA_SE_EN_DODO_J_WALK, 0x18, 0, 0, 0) +/* 0x3801 */ DEFINE_SFX(CHAN_3555, NA_SE_EN_DODO_J_CRY, 0x30, 0, 0, 0) +/* 0x3802 */ DEFINE_SFX(CHAN_355F, NA_SE_EN_DODO_J_FIRE, 0x30, 0, 0, 0) +/* 0x3803 */ DEFINE_SFX(CHAN_356B, NA_SE_EN_DODO_J_DAMAGE, 0x38, 1, 0, 0) +/* 0x3804 */ DEFINE_SFX(CHAN_3583, NA_SE_EN_DODO_J_DEAD, 0x40, 1, 0, 0) +/* 0x3805 */ DEFINE_SFX(CHAN_35A0, NA_SE_EN_DODO_K_CRY, 0x30, 3, 0, 0) +/* 0x3806 */ DEFINE_SFX(CHAN_3E44, NA_SE_EN_DODO_K_DAMAGE, 0x38, 3, 0, 0) +/* 0x3807 */ DEFINE_SFX(CHAN_3D7E, NA_SE_EN_DODO_K_DEAD, 0x40, 3, 0, 0) +/* 0x3808 */ DEFINE_SFX(CHAN_35B6, NA_SE_EN_DODO_K_WALK, 0x30, 2, 0, 0) +/* 0x3809 */ DEFINE_SFX(CHAN_35CE, NA_SE_EN_DODO_K_FIRE, 0x30, 3, 0, 0) +/* 0x380A */ DEFINE_SFX(CHAN_365A, NA_SE_EN_GOMA_WALK, 0x30, 2, 0, 0) +/* 0x380B */ DEFINE_SFX(CHAN_371F, NA_SE_EN_GOMA_HIGH, 0x20, 1, 2, 0) +/* 0x380C */ DEFINE_SFX(CHAN_366D, NA_SE_EN_GOMA_CLIM, 0x30, 3, 0, 0) +/* 0x380D */ DEFINE_SFX(CHAN_35E9, NA_SE_EN_GOMA_DOWN, 0x30, 3, 0, 0) +/* 0x380E */ DEFINE_SFX(CHAN_37FB, NA_SE_EN_GOMA_CRY1, 0x38, 3, 0, 0) +/* 0x380F */ DEFINE_SFX(CHAN_3849, NA_SE_EN_GOMA_CRY2, 0x30, 3, 0, 0) +/* 0x3810 */ DEFINE_SFX(CHAN_381C, NA_SE_EN_GOMA_DAM1, 0x30, 3, 0, 0) +/* 0x3811 */ DEFINE_SFX(CHAN_3732, NA_SE_EN_GOMA_DAM2, 0x38, 3, 0, 0) +/* 0x3812 */ DEFINE_SFX(CHAN_3E7F, NA_SE_EN_GOMA_DEAD, 0x40, 3, 0, 0) +/* 0x3813 */ DEFINE_SFX(CHAN_3680, NA_SE_EN_GOMA_UNARI, 0x20, 0, 0, SFX_FLAG_13) +/* 0x3814 */ DEFINE_SFX(CHAN_3767, NA_SE_EN_GOMA_BJR_EGG1, 0x28, 3, 0, 0) +/* 0x3815 */ DEFINE_SFX(CHAN_35DF, NA_SE_EN_GOMA_BJR_EGG2, 0x28, 3, 0, 0) +/* 0x3816 */ DEFINE_SFX(CHAN_3697, NA_SE_EN_GOMA_BJR_WALK, 0x20, 2, 0, 0) +/* 0x3817 */ DEFINE_SFX(CHAN_36A5, NA_SE_EN_GOMA_BJR_CRY, 0x28, 3, 0, 0) +/* 0x3818 */ DEFINE_SFX(CHAN_36B3, NA_SE_EN_GOMA_BJR_DAM1, 0x38, 3, 0, 0) +/* 0x3819 */ DEFINE_SFX(CHAN_36D2, NA_SE_EN_GOMA_BJR_DAM2, 0x30, 3, 0, 0) +/* 0x381A */ DEFINE_SFX(CHAN_36F9, NA_SE_EN_GOMA_BJR_DEAD, 0x40, 3, 0, 0) +/* 0x381B */ DEFINE_SFX(CHAN_3D68, NA_SE_EN_GOMA_DEMO_EYE, 0x30, 3, 0, 0) +/* 0x381C */ DEFINE_SFX(CHAN_3F3E, NA_SE_EN_GOMA_LAST, 0x30, 3, 0, 0) +/* 0x381D */ DEFINE_SFX(CHAN_402B, NA_SE_EN_GOMA_UNARI2, 0x30, 3, 0, 0) +/* 0x381E */ DEFINE_SFX(CHAN_4906, NA_SE_EN_GOMA_FAINT, 0x30, 3, 0, 0) +/* 0x381F */ DEFINE_SFX(CHAN_4C1B, NA_SE_EN_GOMA_BJR_FREEZE, 0x30, 3, 0, 0) +/* 0x3820 */ DEFINE_SFX(CHAN_37C0, NA_SE_EN_DODO_M_CRY, 0x30, 0, 0, 0) +/* 0x3821 */ DEFINE_SFX(CHAN_37E3, NA_SE_EN_DODO_M_DEAD, 0x40, 1, 0, 0) +/* 0x3822 */ DEFINE_SFX(CHAN_3858, NA_SE_EN_DODO_M_MOVE, 0x18, 0, 0, 0) +/* 0x3823 */ DEFINE_SFX(CHAN_3862, NA_SE_EN_DODO_M_DOWN, 0x14, 0, 0, 0) +/* 0x3824 */ DEFINE_SFX(CHAN_38A2, NA_SE_EN_DODO_M_UP, 0x14, 0, 0, 0) +/* 0x3825 */ DEFINE_SFX(CHAN_5443, NA_SE_EN_GANON_THROW_MASIC, 0x30, 3, 0, 0) +/* 0x3826 */ DEFINE_SFX(CHAN_38C7, NA_SE_EN_DODO_M_EAT, 0x30, 0, 0, 0) +/* 0x3827 */ DEFINE_SFX(CHAN_544A, NA_SE_EN_GANON_DD_THUNDER, 0x44, 3, 0, 0) +/* 0x3828 */ DEFINE_SFX(CHAN_39B9, NA_SE_EN_RIZA_ONGND, 0x18, 0, 0, 0) +/* 0x3829 */ DEFINE_SFX(CHAN_4040, NA_SE_EN_RIZA_CRY, 0x30, 2, 0, 0) +/* 0x382A */ DEFINE_SFX(CHAN_4061, NA_SE_EN_RIZA_ATTACK, 0x32, 2, 0, 0) +/* 0x382B */ DEFINE_SFX(CHAN_38EC, NA_SE_EN_RIZA_DAMAGE, 0x38, 1, 0, 0) +/* 0x382C */ DEFINE_SFX(CHAN_3916, NA_SE_EN_RIZA_WARAU, 0x20, 0, 0, 0) +/* 0x382D */ DEFINE_SFX(CHAN_3924, NA_SE_EN_RIZA_DEAD, 0x40, 1, 0, 0) +/* 0x382E */ DEFINE_SFX(CHAN_39AD, NA_SE_EN_RIZA_WALK, 0x18, 0, 0, 0) +/* 0x382F */ DEFINE_SFX(CHAN_39C8, NA_SE_EN_RIZA_JUMP, 0x28, 0, 0, 0) +/* 0x3830 */ DEFINE_SFX(CHAN_5477, NA_SE_EN_STALKID_WALK, 0x18, 0, 0, 0) +/* 0x3831 */ DEFINE_SFX(CHAN_5481, NA_SE_EN_STALKID_ATTACK, 0x30, 0, 0, 0) +/* 0x3832 */ DEFINE_SFX(CHAN_396B, NA_SE_EN_STALKID_DAMAGE, 0x38, 1, 0, 0) +/* 0x3833 */ DEFINE_SFX(CHAN_39A0, NA_SE_EN_STALKID_DEAD, 0x40, 1, 0, 0) +/* 0x3834 */ DEFINE_SFX(CHAN_4D26, NA_SE_EN_FLOORMASTER_SLIDING, 0x14, 0, 0, 0) +/* 0x3835 */ DEFINE_SFX(CHAN_502F, NA_SE_EN_TEKU_WALK_WATER, 0x18, 0, 2, 0) +/* 0x3836 */ DEFINE_SFX(CHAN_535D, NA_SE_EN_LIGHT_ARROW_HIT, 0x38, 2, 0, 0) +/* 0x3837 */ DEFINE_SFX(CHAN_53EA, NA_SE_EN_TUBOOCK_FLY, 0x30, 0, 0, 0) +/* 0x3838 */ DEFINE_SFX(CHAN_38DF, NA_SE_EN_STAL_WARAU, 0x28, 1, 0, 0) +/* 0x3839 */ DEFINE_SFX(CHAN_3A70, NA_SE_EN_STAL_SAKEBI, 0x30, 0, 0, 0) +/* 0x383A */ DEFINE_SFX(CHAN_394E, NA_SE_EN_STAL_DAMAGE, 0x38, 1, 0, 0) +/* 0x383B */ DEFINE_SFX(CHAN_3974, NA_SE_EN_STAL_DEAD, 0x40, 1, 0, 0) +/* 0x383C */ DEFINE_SFX(CHAN_5529, NA_SE_EN_WOLFOS_APPEAR, 0x30, 0, 0, 0) +/* 0x383D */ DEFINE_SFX(CHAN_38D1, NA_SE_EN_STAL_WALK, 0x18, 0, 0, 0) +/* 0x383E */ DEFINE_SFX(CHAN_5572, NA_SE_EN_WOLFOS_CRY, 0x20, 0, 0, 0) +/* 0x383F */ DEFINE_SFX(CHAN_5537, NA_SE_EN_WOLFOS_ATTACK, 0x30, 0, 0, 0) +/* 0x3840 */ DEFINE_SFX(CHAN_379B, NA_SE_EN_FFLY_ATTACK, 0x30, 0, 0, 0) +/* 0x3841 */ DEFINE_SFX(CHAN_37AB, NA_SE_EN_FFLY_FLY, 0x20, 1, 0, 0) +/* 0x3842 */ DEFINE_SFX(CHAN_3C04, NA_SE_EN_FFLY_DEAD, 0x40, 1, 0, 0) +/* 0x3843 */ DEFINE_SFX(CHAN_5548, NA_SE_EN_WOLFOS_DAMAGE, 0x38, 1, 0, 0) +/* 0x3844 */ DEFINE_SFX(CHAN_39FE, NA_SE_EN_AMOS_WALK, 0x30, 0, 0, 0) +/* 0x3845 */ DEFINE_SFX(CHAN_3A0C, NA_SE_EN_AMOS_WAVE, 0x30, 0, 0, 0) +/* 0x3846 */ DEFINE_SFX(CHAN_3A40, NA_SE_EN_AMOS_DEAD, 0x40, 1, 0, 0) +/* 0x3847 */ DEFINE_SFX(CHAN_3A93, NA_SE_EN_AMOS_DAMAGE, 0x38, 1, 0, 0) +/* 0x3848 */ DEFINE_SFX(CHAN_3A59, NA_SE_EN_AMOS_VOICE, 0x20, 0, 0, 0) +/* 0x3849 */ DEFINE_SFX(CHAN_5451, NA_SE_EN_SHELL_MOUTH, 0x30, 0, 0, 0) +/* 0x384A */ DEFINE_SFX(CHAN_3BAB, NA_SE_EN_SHELL_DEAD, 0x40, 1, 0, 0) +/* 0x384B */ DEFINE_SFX(CHAN_555D, NA_SE_EN_WOLFOS_DEAD, 0x40, 1, 0, 0) +/* 0x384C */ DEFINE_SFX(CHAN_3AA8, NA_SE_EN_DODO_K_COLI, 0x30, 3, 0, 0) +/* 0x384D */ DEFINE_SFX(CHAN_3AD5, NA_SE_EN_DODO_K_COLI2, 0x30, 0, 0, SFX_FLAG_13) +/* 0x384E */ DEFINE_SFX(CHAN_3AF4, NA_SE_EN_DODO_K_ROLL, 0x30, 3, 0, 0) +/* 0x384F */ DEFINE_SFX(CHAN_3B09, NA_SE_EN_DODO_K_BREATH, 0x30, 3, 0, 0) +/* 0x3850 */ DEFINE_SFX(CHAN_3B23, NA_SE_EN_DODO_K_DRINK, 0x30, 3, 0, 0) +/* 0x3851 */ DEFINE_SFX(CHAN_3B34, NA_SE_EN_DODO_K_DOWN, 0x30, 3, 0, 0) +/* 0x3852 */ DEFINE_SFX(CHAN_3D3D, NA_SE_EN_DODO_K_OTAKEBI, 0x30, 3, 0, 0) +/* 0x3853 */ DEFINE_SFX(CHAN_3DCF, NA_SE_EN_DODO_K_END, 0x30, 3, 0, 0) +/* 0x3854 */ DEFINE_SFX(CHAN_3E00, NA_SE_EN_DODO_K_LAST, 0x30, 3, 0, 0) +/* 0x3855 */ DEFINE_SFX(CHAN_3E17, NA_SE_EN_DODO_K_LAVA, 0x30, 3, 0, 0) +/* 0x3856 */ DEFINE_SFX(CHAN_4202, NA_SE_EN_GANON_FLOAT, 0x18, 3, 0, 0) +/* 0x3857 */ DEFINE_SFX(CHAN_53F0, NA_SE_EN_GANON_DARKWAVE_M, 0x30, 3, 0, 0) +/* 0x3858 */ DEFINE_SFX(CHAN_3B50, NA_SE_EN_DODO_J_BREATH, 0x28, 0, 0, 0) +/* 0x3859 */ DEFINE_SFX(CHAN_408D, NA_SE_EN_DODO_J_TAIL, 0x30, 0, 0, 0) +/* 0x385A */ DEFINE_SFX(CHAN_531C, NA_SE_EN_WOLFOS_WALK, 0x18, 0, 0, 0) +/* 0x385B */ DEFINE_SFX(CHAN_38C7, NA_SE_EN_DODO_J_EAT, 0x30, 0, 0, 0) +/* 0x385C */ DEFINE_SFX(CHAN_3B5C, NA_SE_EN_DEKU_MOUTH, 0x28, 0, 0, 0) +/* 0x385D */ DEFINE_SFX(CHAN_3B66, NA_SE_EN_DEKU_ATTACK, 0x30, 0, 0, 0) +/* 0x385E */ DEFINE_SFX(CHAN_3B76, NA_SE_EN_DEKU_DAMAGE, 0x38, 1, 0, 0) +/* 0x385F */ DEFINE_SFX(CHAN_3B8E, NA_SE_EN_DEKU_DEAD, 0x40, 1, 0, 0) +/* 0x3860 */ DEFINE_SFX(CHAN_3BBD, NA_SE_EN_DEKU_JR_MOUTH, 0x28, 0, 0, 0) +/* 0x3861 */ DEFINE_SFX(CHAN_3BC7, NA_SE_EN_DEKU_JR_ATTACK, 0x30, 0, 0, 0) +/* 0x3862 */ DEFINE_SFX(CHAN_3BD7, NA_SE_EN_DEKU_JR_DEAD, 0x40, 1, 0, 0) +/* 0x3863 */ DEFINE_SFX(CHAN_3BF3, NA_SE_EN_DEKU_SCRAPE, 0x14, 0, 0, 0) +/* 0x3864 */ DEFINE_SFX(CHAN_3C1C, NA_SE_EN_TAIL_FLY, 0x30, 0, 0, 0) +/* 0x3865 */ DEFINE_SFX(CHAN_3C2C, NA_SE_EN_TAIL_CRY, 0x20, 0, 0, 0) +/* 0x3866 */ DEFINE_SFX(CHAN_3C3A, NA_SE_EN_TAIL_DEAD, 0x40, 1, 0, 0) +/* 0x3867 */ DEFINE_SFX(CHAN_41F6, NA_SE_EN_GANON_SPARK, 0x30, 3, 0, 0) +/* 0x3868 */ DEFINE_SFX(CHAN_3C71, NA_SE_EN_STALTU_DOWN, 0x30, 0, 0, 0) +/* 0x3869 */ DEFINE_SFX(CHAN_3C56, NA_SE_EN_STALTU_UP, 0x30, 0, 0, 0) +/* 0x386A */ DEFINE_SFX(CHAN_3C8C, NA_SE_EN_STALTU_LAUGH, 0x20, 0, 0, 0) +/* 0x386B */ DEFINE_SFX(CHAN_3FD0, NA_SE_EN_STALTU_DAMAGE, 0x38, 1, 0, 0) +/* 0x386C */ DEFINE_SFX(CHAN_3E6B, NA_SE_EN_STAL_JUMP, 0x20, 0, 0, 0) +/* 0x386D */ DEFINE_SFX(CHAN_3F53, NA_SE_EN_TEKU_DAMAGE, 0x38, 1, 0, 0) +/* 0x386E */ DEFINE_SFX(CHAN_3F6E, NA_SE_EN_TEKU_DEAD, 0x40, 1, 0, 0) +/* 0x386F */ DEFINE_SFX(CHAN_3C9F, NA_SE_EN_TEKU_WALK, 0x14, 0, 0, 0) +/* 0x3870 */ DEFINE_SFX(CHAN_3CA9, NA_SE_EN_PO_KANTERA, 0x30, 3, 0, 0) +/* 0x3871 */ DEFINE_SFX(CHAN_3CBC, NA_SE_EN_PO_FLY, 0x20, 1, 0, 0) +/* 0x3872 */ DEFINE_SFX(CHAN_3CCF, NA_SE_EN_PO_AWAY, 0x20, 1, 0, 0) +/* 0x3873 */ DEFINE_SFX(CHAN_3CF6, NA_SE_EN_PO_APPEAR, 0x30, 2, 0, 0) +/* 0x3874 */ DEFINE_SFX(CHAN_3CE0, NA_SE_EN_PO_DISAPPEAR, 0x30, 2, 0, 0) +/* 0x3875 */ DEFINE_SFX(CHAN_3D09, NA_SE_EN_PO_DAMAGE, 0x38, 2, 0, 0) +/* 0x3876 */ DEFINE_SFX(CHAN_3D23, NA_SE_EN_PO_DEAD, 0x40, 2, 0, 0) +/* 0x3877 */ DEFINE_SFX(CHAN_40A3, NA_SE_EN_PO_DEAD2, 0x40, 2, 0, 0) +/* 0x3878 */ DEFINE_SFX(CHAN_401A, NA_SE_EN_EXTINCT, 0x14, 1, 2, 0) +/* 0x3879 */ DEFINE_SFX(CHAN_3612, NA_SE_EN_GOLON_LAND_BIG, 0x34, 0, 0, 0) +/* 0x387A */ DEFINE_SFX(CHAN_3629, NA_SE_EN_RIZA_DOWN, 0x40, 0, 0, 0) +/* 0x387B */ DEFINE_SFX(CHAN_3648, NA_SE_EN_DODO_M_GND, 0x20, 0, 0, 0) +/* 0x387C */ DEFINE_SFX(CHAN_3ECF, NA_SE_EN_NUTS_UP, 0x28, 0, 0, 0) +/* 0x387D */ DEFINE_SFX(CHAN_3EE2, NA_SE_EN_NUTS_DOWN, 0x28, 0, 0, 0) +/* 0x387E */ DEFINE_SFX(CHAN_3EF5, NA_SE_EN_NUTS_THROW, 0x30, 0, 0, 0) +/* 0x387F */ DEFINE_SFX(CHAN_3F05, NA_SE_EN_NUTS_WALK, 0x14, 0, 0, 0) +/* 0x3880 */ DEFINE_SFX(CHAN_3F12, NA_SE_EN_NUTS_DAMAGE, 0x38, 1, 0, 0) +/* 0x3881 */ DEFINE_SFX(CHAN_3F29, NA_SE_EN_NUTS_DEAD, 0x40, 1, 0, 0) +/* 0x3882 */ DEFINE_SFX(CHAN_4966, NA_SE_EN_NUTS_FAINT, 0x20, 0, 0, 0) +/* 0x3883 */ DEFINE_SFX(CHAN_4C03, NA_SE_EN_PO_BIG_GET, 0x30, 3, 0, 0) +/* 0x3884 */ DEFINE_SFX(CHAN_3FEC, NA_SE_EN_STALTU_ROLL, 0x30, 0, 0, 0) +/* 0x3885 */ DEFINE_SFX(CHAN_4001, NA_SE_EN_STALWALL_DEAD, 0x40, 1, 0, 0) +/* 0x3886 */ DEFINE_SFX(CHAN_4BCE, NA_SE_EN_PO_SISTER_DEAD, 0x40, 3, 0, 0) +/* 0x3887 */ DEFINE_SFX(CHAN_4C53, NA_SE_EN_BARI_SPLIT, 0x40, 1, 0, 0) +/* 0x3888 */ DEFINE_SFX(CHAN_5135, NA_SE_EN_TEKU_REVERSE, 0x28, 1, 0, 0) +/* 0x3889 */ DEFINE_SFX(CHAN_35E9, NA_SE_EN_VALVAISA_LAND2, 0x30, 3, 0, 0) +/* 0x388A */ DEFINE_SFX(CHAN_43EA, NA_SE_EN_TEKU_LAND_WATER, 0x20, 0, 0, 0) +/* 0x388B */ DEFINE_SFX(CHAN_4929, NA_SE_EN_LAST_DAMAGE, 0x38, 1, 0, 0) +/* 0x388C */ DEFINE_SFX(CHAN_497B, NA_SE_EN_STALWALL_ROLL, 0x30, 0, 0, 0) +/* 0x388D */ DEFINE_SFX(CHAN_4996, NA_SE_EN_STALWALL_DASH, 0x30, 0, 0, 0) +/* 0x388E */ DEFINE_SFX(CHAN_5013, NA_SE_EN_TEKU_JUMP_WATER, 0x20, 0, 0, 0) +/* 0x388F */ DEFINE_SFX(CHAN_5021, NA_SE_EN_TEKU_LAND_WATER2, 0x20, 0, 0, 0) +/* 0x3890 */ DEFINE_SFX(CHAN_40B8, NA_SE_EN_FALL_AIM, 0x38, 0, 0, SFX_FLAG_13) +/* 0x3891 */ DEFINE_SFX(CHAN_40C8, NA_SE_EN_FALL_UP, 0x30, 3, 0, 0) +/* 0x3892 */ DEFINE_SFX(CHAN_5089, NA_SE_EN_FALL_CATCH, 0x30, 0, 0, SFX_FLAG_13) +/* 0x3893 */ DEFINE_SFX(CHAN_3767, NA_SE_EN_FALL_LAND, 0x30, 0, 0, 0) +/* 0x3894 */ DEFINE_SFX(CHAN_40DB, NA_SE_EN_FALL_WALK, 0x14, 0, 0, 0) +/* 0x3895 */ DEFINE_SFX(CHAN_40EB, NA_SE_EN_FALL_DAMAGE, 0x38, 1, 0, 0) +/* 0x3896 */ DEFINE_SFX(CHAN_4104, NA_SE_EN_FALL_DEAD, 0x40, 1, 0, 0) +/* 0x3897 */ DEFINE_SFX(CHAN_55D2, NA_SE_EN_KAICHO_FLUTTER, 0x14, 0, 0, 0) +/* 0x3898 */ DEFINE_SFX(CHAN_411D, NA_SE_EN_BIRI_FLY, 0x20, 0, 0, 0) +/* 0x3899 */ DEFINE_SFX(CHAN_4132, NA_SE_EN_BIRI_JUMP, 0x20, 0, 0, 0) +/* 0x389A */ DEFINE_SFX(CHAN_415D, NA_SE_EN_BIRI_SPARK, 0x30, 0, 0, 0) +/* 0x389B */ DEFINE_SFX(CHAN_4184, NA_SE_EN_BIRI_DEAD, 0x40, 1, 0, 0) +/* 0x389C */ DEFINE_SFX(CHAN_41BC, NA_SE_EN_BIRI_BUBLE, 0x40, 1, 0, 0) +/* 0x389D */ DEFINE_SFX(CHAN_4C09, NA_SE_EN_BARI_ROLL, 0x30, 0, 0, 0) +/* 0x389E */ DEFINE_SFX(CHAN_4C1B, NA_SE_EN_GOMA_JR_FREEZE, 0x34, 1, 0, 0) +/* 0x389F */ DEFINE_SFX(CHAN_4C2D, NA_SE_EN_BARI_DEAD, 0x40, 1, 0, 0) +/* 0x38A0 */ DEFINE_SFX(CHAN_4236, NA_SE_EN_GANON_FIRE, 0x30, 3, 0, 0) +/* 0x38A1 */ DEFINE_SFX(CHAN_41CF, NA_SE_EN_FANTOM_TRANSFORM, 0x30, 2, 0, 0) +/* 0x38A2 */ DEFINE_SFX(CHAN_41E9, NA_SE_EN_FANTOM_THUNDER, 0x30, 0, 0, SFX_FLAG_13) +/* 0x38A3 */ DEFINE_SFX(CHAN_41F6, NA_SE_EN_FANTOM_SPARK, 0x20, 3, 1, 0) +/* 0x38A4 */ DEFINE_SFX(CHAN_4202, NA_SE_EN_FANTOM_FLOAT, 0x20, 2, 0, 0) +/* 0x38A5 */ DEFINE_SFX(CHAN_420E, NA_SE_EN_FANTOM_MASIC1, 0x30, 3, 0, 0) +/* 0x38A6 */ DEFINE_SFX(CHAN_421A, NA_SE_EN_FANTOM_MASIC2, 0x30, 3, 0, 0) +/* 0x38A7 */ DEFINE_SFX(CHAN_4236, NA_SE_EN_FANTOM_FIRE, 0x30, 3, 0, 0) +/* 0x38A8 */ DEFINE_SFX(CHAN_425D, NA_SE_EN_FANTOM_HIT_THUNDER, 0x38, 3, 0, 0) +/* 0x38A9 */ DEFINE_SFX(CHAN_4268, NA_SE_EN_FANTOM_ATTACK, 0x30, 0, 0, SFX_FLAG_13) +/* 0x38AA */ DEFINE_SFX(CHAN_4278, NA_SE_EN_FANTOM_STICK, 0x30, 3, 0, 0) +/* 0x38AB */ DEFINE_SFX(CHAN_429B, NA_SE_EN_FANTOM_EYE, 0x30, 2, 0, 0) +/* 0x38AC */ DEFINE_SFX(CHAN_42C0, NA_SE_EN_FANTOM_LAST, 0x30, 0, 0, SFX_FLAG_13) +/* 0x38AD */ DEFINE_SFX(CHAN_42B2, NA_SE_EN_FANTOM_THUNDER_GND, 0x30, 3, 0, 0) +/* 0x38AE */ DEFINE_SFX(CHAN_42F5, NA_SE_EN_FANTOM_DAMAGE, 0x38, 3, 0, 0) +/* 0x38AF */ DEFINE_SFX(CHAN_432C, NA_SE_EN_FANTOM_DEAD, 0x40, 3, 0, 0) +/* 0x38B0 */ DEFINE_SFX(CHAN_4378, NA_SE_EN_FANTOM_LAUGH, 0x30, 3, 0, 0) +/* 0x38B1 */ DEFINE_SFX(CHAN_435E, NA_SE_EN_FANTOM_DAMAGE2, 0x30, 3, 0, 0) +/* 0x38B2 */ DEFINE_SFX(CHAN_4226, NA_SE_EN_FANTOM_VOICE, 0x30, 3, 0, SFX_FLAG_10) +/* 0x38B3 */ DEFINE_SFX(CHAN_557C, NA_SE_EN_KAICHO_DAMAGE, 0x38, 1, 0, 0) +/* 0x38B4 */ DEFINE_SFX(CHAN_4A65, NA_SE_EN_GANON_ATTACK_DEMO, 0x30, 3, 0, 0) +/* 0x38B5 */ DEFINE_SFX(CHAN_4D16, NA_SE_EN_GANON_FIRE_DEMO, 0x30, 3, 0, 0) +/* 0x38B6 */ DEFINE_SFX(CHAN_55A6, NA_SE_EN_KAICHO_CRY, 0x20, 0, 0, 0) +/* 0x38B7 */ DEFINE_SFX(CHAN_55B9, NA_SE_EN_KAICHO_ATTACK, 0x34, 0, 0, 0) +/* 0x38B8 */ DEFINE_SFX(CHAN_4385, NA_SE_EN_MORIBLIN_WALK, 0x18, 1, 0, 0) +/* 0x38B9 */ DEFINE_SFX(CHAN_43A7, NA_SE_EN_MORIBLIN_SLIDE, 0x20, 0, 0, SFX_FLAG_13) +/* 0x38BA */ DEFINE_SFX(CHAN_445B, NA_SE_EN_MORIBLIN_ATTACK, 0x30, 0, 0, SFX_FLAG_13) +/* 0x38BB */ DEFINE_SFX(CHAN_446C, NA_SE_EN_MORIBLIN_VOICE, 0x14, 3, 0, 0) +/* 0x38BC */ DEFINE_SFX(CHAN_4488, NA_SE_EN_MORIBLIN_SPEAR_AT, 0x28, 3, 0, 0) +/* 0x38BD */ DEFINE_SFX(CHAN_447C, NA_SE_EN_MORIBLIN_SPEAR_NORM, 0x28, 3, 0, 0) +/* 0x38BE */ DEFINE_SFX(CHAN_44B2, NA_SE_EN_MORIBLIN_DEAD, 0x40, 3, 0, 0) +/* 0x38BF */ DEFINE_SFX(CHAN_4396, NA_SE_EN_MORIBLIN_DASH, 0x30, 3, 0, 0) +/* 0x38C0 */ DEFINE_SFX(CHAN_43F8, NA_SE_EN_OCTAROCK_ROCK, 0x20, 0, 0, 0) +/* 0x38C1 */ DEFINE_SFX(CHAN_43DC, NA_SE_EN_OCTAROCK_FLOAT, 0x14, 0, 0, 0) +/* 0x38C2 */ DEFINE_SFX(CHAN_43B6, NA_SE_EN_OCTAROCK_JUMP, 0x30, 0, 0, 0) +/* 0x38C3 */ DEFINE_SFX(CHAN_43EA, NA_SE_EN_OCTAROCK_LAND, 0x30, 0, 0, 0) +/* 0x38C4 */ DEFINE_SFX(CHAN_43C4, NA_SE_EN_OCTAROCK_SINK, 0x28, 0, 0, 0) +/* 0x38C5 */ DEFINE_SFX(CHAN_43D2, NA_SE_EN_OCTAROCK_BUBLE, 0x28, 0, 0, 0) +/* 0x38C6 */ DEFINE_SFX(CHAN_46EF, NA_SE_EN_OCTAROCK_DEAD1, 0x40, 1, 0, 0) +/* 0x38C7 */ DEFINE_SFX(CHAN_46D7, NA_SE_EN_OCTAROCK_DEAD2, 0x40, 1, 0, 0) +/* 0x38C8 */ DEFINE_SFX(CHAN_37AB, NA_SE_EN_BUBLE_WING, 0x20, 0, 0, 0) +/* 0x38C9 */ DEFINE_SFX(CHAN_4406, NA_SE_EN_BUBLE_MOUTH, 0x20, 0, 0, 0) +/* 0x38CA */ DEFINE_SFX(CHAN_441B, NA_SE_EN_BUBLE_LAUGH, 0x14, 0, 0, 0) +/* 0x38CB */ DEFINE_SFX(CHAN_4BBC, NA_SE_EN_BUBLE_BITE, 0x30, 0, 0, 0) +/* 0x38CC */ DEFINE_SFX(CHAN_4429, NA_SE_EN_BUBLE_UP, 0x30, 0, 0, 0) +/* 0x38CD */ DEFINE_SFX(CHAN_4442, NA_SE_EN_BUBLE_DOWN, 0x30, 0, 0, 0) +/* 0x38CE */ DEFINE_SFX(CHAN_4B8D, NA_SE_EN_BUBLE_DEAD, 0x40, 1, 0, 0) +/* 0x38CF */ DEFINE_SFX(CHAN_355F, NA_SE_EN_BUBLEFALL_FIRE, 0x30, 0, 0, 0) +/* 0x38D0 */ DEFINE_SFX(CHAN_4593, NA_SE_EN_VALVAISA_APPEAR, 0x30, 3, 0, 0) +/* 0x38D1 */ DEFINE_SFX(CHAN_44DB, NA_SE_EN_VALVAISA_ROAR, 0x30, 3, 0, 0) +/* 0x38D2 */ DEFINE_SFX(CHAN_3732, NA_SE_EN_VALVAISA_MAHI1, 0x30, 3, 0, 0) +/* 0x38D3 */ DEFINE_SFX(CHAN_4517, NA_SE_EN_VALVAISA_MAHI2, 0x30, 3, 0, 0) +/* 0x38D4 */ DEFINE_SFX(CHAN_4541, NA_SE_EN_VALVAISA_KNOCKOUT, 0x30, 3, 0, 0) +/* 0x38D5 */ DEFINE_SFX(CHAN_381C, NA_SE_EN_VALVAISA_DAMAGE1, 0x38, 3, 0, 0) +/* 0x38D6 */ DEFINE_SFX(CHAN_4555, NA_SE_EN_VALVAISA_DAMAGE2, 0x38, 3, 0, 0) +/* 0x38D7 */ DEFINE_SFX(CHAN_44C7, NA_SE_EN_VALVAISA_ROCK, 0x30, 3, 0, 0) +/* 0x38D8 */ DEFINE_SFX(CHAN_45B4, NA_SE_EN_VALVAISA_SW_NAIL, 0x30, 3, 0, 0) +/* 0x38D9 */ DEFINE_SFX(CHAN_3E7F, NA_SE_EN_VALVAISA_DEAD, 0x40, 3, 0, 0) +/* 0x38DA */ DEFINE_SFX(CHAN_3E00, NA_SE_EN_VALVAISA_BURN, 0x30, 3, 0, 0) +/* 0x38DB */ DEFINE_SFX(CHAN_35CE, NA_SE_EN_VALVAISA_FIRE, 0x30, 3, 0, 0) +/* 0x38DC */ DEFINE_SFX(CHAN_4184, NA_SE_EN_BARI_DAMAGE, 0x38, 1, 0, 0) +/* 0x38DD */ DEFINE_SFX(CHAN_3648, NA_SE_EN_MOFER_CORE_LAND, 0x28, 3, 0, 0) +/* 0x38DE */ DEFINE_SFX(CHAN_47BB, NA_SE_EN_MOFER_CORE_MOVE_WT, 0x28, 3, 2, 0) +/* 0x38DF */ DEFINE_SFX(CHAN_502F, NA_SE_EN_MOFER_CORE_SMJUMP, 0x28, 2, 2, 0) +/* 0x38E0 */ DEFINE_SFX(CHAN_522F, NA_SE_EN_MONBLIN_GNDWAVE, 0x30, 3, 0, 0) +/* 0x38E1 */ DEFINE_SFX(CHAN_4496, NA_SE_EN_MONBLIN_HAM_DOWN, 0x30, 0, 0, SFX_FLAG_13) +/* 0x38E2 */ DEFINE_SFX(CHAN_44A4, NA_SE_EN_MONBLIN_HAM_UP, 0x30, 0, 0, SFX_FLAG_13) +/* 0x38E3 */ DEFINE_SFX(CHAN_4BB2, NA_SE_EN_BUBLE_DAMAGE, 0x38, 1, 0, 0) +/* 0x38E4 */ DEFINE_SFX(CHAN_45C2, NA_SE_EN_REDEAD_CRY, 0x20, 0, 0, 0) +/* 0x38E5 */ DEFINE_SFX(CHAN_45D2, NA_SE_EN_REDEAD_AIM, 0x34, 0, 0, 0) +/* 0x38E6 */ DEFINE_SFX(CHAN_45E9, NA_SE_EN_REDEAD_DAMAGE, 0x38, 1, 0, 0) +/* 0x38E7 */ DEFINE_SFX(CHAN_45FF, NA_SE_EN_REDEAD_DEAD, 0x40, 1, 0, 0) +/* 0x38E8 */ DEFINE_SFX(CHAN_463C, NA_SE_EN_REDEAD_ATTACK, 0x34, 0, 0, SFX_FLAG_13) +/* 0x38E9 */ DEFINE_SFX(CHAN_5466, NA_SE_EN_NYU_MOVE, 0x20, 0, 0, 0) +/* 0x38EA */ DEFINE_SFX(CHAN_56A2, NA_SE_EN_NYU_HIT_STOP, 0x38, 0, 0, 0) +/* 0x38EB */ DEFINE_SFX(CHAN_5591, NA_SE_EN_KAICHO_DEAD, 0x40, 1, 0, 0) +/* 0x38EC */ DEFINE_SFX(CHAN_461A, NA_SE_EN_PO_LAUGH, 0x30, 3, 0, 0) +/* 0x38ED */ DEFINE_SFX(CHAN_4673, NA_SE_EN_PO_CRY, 0x30, 2, 0, 0) +/* 0x38EE */ DEFINE_SFX(CHAN_462B, NA_SE_EN_PO_ROLL, 0x30, 2, 0, 0) +/* 0x38EF */ DEFINE_SFX(CHAN_465F, NA_SE_EN_PO_LAUGH2, 0x38, 3, 0, 0) +/* 0x38F0 */ DEFINE_SFX(CHAN_4681, NA_SE_EN_MOFER_APPEAR, 0x30, 3, 0, 0) +/* 0x38F1 */ DEFINE_SFX(CHAN_4695, NA_SE_EN_MOFER_ATTACK, 0x32, 3, 0, 0) +/* 0x38F2 */ DEFINE_SFX(CHAN_46AD, NA_SE_EN_MOFER_WAVE, 0x34, 3, 0, 0) +/* 0x38F3 */ DEFINE_SFX(CHAN_46C7, NA_SE_EN_MOFER_CATCH, 0x34, 3, 0, 0) +/* 0x38F4 */ DEFINE_SFX(CHAN_4734, NA_SE_EN_MOFER_CUT, 0x30, 3, 0, 0) +/* 0x38F5 */ DEFINE_SFX(CHAN_4705, NA_SE_EN_MOFER_MOVE_DEMO, 0x30, 3, 0, 0) +/* 0x38F6 */ DEFINE_SFX(CHAN_471A, NA_SE_EN_MOFER_BUBLE_DEMO, 0x30, 3, 0, 0) +/* 0x38F7 */ DEFINE_SFX(CHAN_5013, NA_SE_EN_MOFER_CORE_JUMP, 0x28, 2, 2, 0) +/* 0x38F8 */ DEFINE_SFX(CHAN_4754, NA_SE_EN_MOFER_DEAD, 0x40, 3, 0, 0) +/* 0x38F9 */ DEFINE_SFX(CHAN_493B, NA_SE_EN_MOFER_LASTVOICE, 0x40, 3, 0, 0) +/* 0x38FA */ DEFINE_SFX(CHAN_47A8, NA_SE_EN_MOFER_CORE_ROLL, 0x30, 3, 0, 0) +/* 0x38FB */ DEFINE_SFX(CHAN_420E, NA_SE_EN_MOFER_CORE_FLY, 0x30, 3, 0, 0) +/* 0x38FC */ DEFINE_SFX(CHAN_47FC, NA_SE_EN_GOLON_WAKE_UP, 0x20, 0, 0, 0) +/* 0x38FD */ DEFINE_SFX(CHAN_4806, NA_SE_EN_GOLON_SIT_DOWN, 0x20, 0, 0, 0) +/* 0x38FE */ DEFINE_SFX(CHAN_56B0, NA_SE_EN_CHICKEN_FLUTTER, 0x30, 0, 0, 0) +/* 0x38FF */ DEFINE_SFX(CHAN_4D08, NA_SE_EN_DEKU_WAKEUP, 0x20, 0, 2, 0) +/* 0x3900 */ DEFINE_SFX(CHAN_47D3, NA_SE_EN_DEADHAND_BITE, 0x30, 3, 0, 0) +/* 0x3901 */ DEFINE_SFX(CHAN_47EC, NA_SE_EN_DEADHAND_WALK, 0x18, 3, 0, 0) +/* 0x3902 */ DEFINE_SFX(CHAN_4813, NA_SE_EN_DEADHAND_GRIP, 0x34, 3, 0, 0) +/* 0x3903 */ DEFINE_SFX(CHAN_4EBC, NA_SE_EN_DEADHAND_HAND_AT, 0x30, 3, 0, 0) +/* 0x3904 */ DEFINE_SFX(CHAN_4839, NA_SE_EN_DAIOCTA_MAHI, 0x38, 3, 0, 0) +/* 0x3905 */ DEFINE_SFX(CHAN_485E, NA_SE_EN_DAIOCTA_SPLASH, 0x18, 3, 0, 0) +/* 0x3906 */ DEFINE_SFX(CHAN_4875, NA_SE_EN_DAIOCTA_VOICE, 0x30, 0, 0, SFX_FLAG_13) +/* 0x3907 */ DEFINE_SFX(CHAN_4886, NA_SE_EN_DAIOCTA_DAMAGE, 0x38, 3, 0, 0) +/* 0x3908 */ DEFINE_SFX(CHAN_48B2, NA_SE_EN_DAIOCTA_SINK, 0x30, 3, 0, 0) +/* 0x3909 */ DEFINE_SFX(CHAN_48D5, NA_SE_EN_DAIOCTA_DEAD, 0x40, 3, 0, 0) +/* 0x390A */ DEFINE_SFX(CHAN_48F2, NA_SE_EN_DAIOCTA_DEAD2, 0x40, 0, 0, SFX_FLAG_13) +/* 0x390B */ DEFINE_SFX(CHAN_41E9, NA_SE_EN_GANON_HIT_THUNDER, 0x38, 3, 0, 0) +/* 0x390C */ DEFINE_SFX(CHAN_49B1, NA_SE_EN_TWINROBA_APPEAR_MS, 0x30, 0, 0, SFX_FLAG_13) +/* 0x390D */ DEFINE_SFX(CHAN_49C8, NA_SE_EN_TWINROBA_TRANSFORM, 0x30, 3, 0, 0) +/* 0x390E */ DEFINE_SFX(CHAN_49E6, NA_SE_EN_TWINROBA_MS_FIRE, 0x30, 3, 0, 0) +/* 0x390F */ DEFINE_SFX(CHAN_49FF, NA_SE_EN_TWINROBA_FIRE_EXP, 0x30, 3, 0, 0) +/* 0x3910 */ DEFINE_SFX(CHAN_4B3E, NA_SE_EN_TWINROBA_POWERUP, 0x30, 3, 0, 0) +/* 0x3911 */ DEFINE_SFX(CHAN_4A22, NA_SE_EN_TWINROBA_SHOOT_FREEZE, 0x30, 3, 0, 0) +/* 0x3912 */ DEFINE_SFX(CHAN_4A4C, NA_SE_EN_TWINROBA_MS_FREEZE, 0x30, 3, 0, 0) +/* 0x3913 */ DEFINE_SFX(CHAN_4AB3, NA_SE_EN_TWINROBA_MASIC_SET, 0x30, 2, 0, 0) +/* 0x3914 */ DEFINE_SFX(CHAN_4826, NA_SE_EN_TWINROBA_CUTBODY, 0x30, 3, 0, 0) +/* 0x3915 */ DEFINE_SFX(CHAN_3AA8, NA_SE_EN_GANON_HIT_GND_IMP, 0x30, 3, 0, 0) +/* 0x3916 */ DEFINE_SFX(CHAN_4AE7, NA_SE_EN_TWINROBA_DAMAGE_VOICE, 0x38, 0, 0, SFX_FLAG_13) +/* 0x3917 */ DEFINE_SFX(CHAN_424B, NA_SE_EN_TWINROBA_REFL_FIRE, 0x38, 3, 0, 0) +/* 0x3918 */ DEFINE_SFX(CHAN_4A39, NA_SE_EN_TWINROBA_REFL_FREEZE, 0x38, 3, 0, 0) +/* 0x3919 */ DEFINE_SFX(CHAN_4826, NA_SE_EN_GANON_CUTBODY, 0x38, 3, 0, 0) +/* 0x391A */ DEFINE_SFX(CHAN_4AF4, NA_SE_EN_TWINROBA_YOUNG_DAMAGE, 0x38, 0, 0, SFX_FLAG_13) +/* 0x391B */ DEFINE_SFX(CHAN_4B01, NA_SE_EN_TWINROBA_YOUNG_DEAD, 0x40, 0, 0, SFX_FLAG_13) +/* 0x391C */ DEFINE_SFX(CHAN_55E0, NA_SE_EN_GOLON_EYE_BIG, 0x18, 0, 0, 0) +/* 0x391D */ DEFINE_SFX(CHAN_55EC, NA_SE_EN_GOLON_GOOD_BIG, 0x30, 3, 0, 0) +/* 0x391E */ DEFINE_SFX(CHAN_4B18, NA_SE_EN_TWINROBA_FB_FLY, 0x30, 2, 0, 0) +/* 0x391F */ DEFINE_SFX(CHAN_4FE8, NA_SE_EN_TWINROBA_FLY, 0x20, 2, 0, 0) +/* 0x3920 */ DEFINE_SFX(CHAN_4FFB, NA_SE_EN_TWINROBA_UNARI, 0x24, 3, 0, 0) +/* 0x3921 */ DEFINE_SFX(CHAN_462B, NA_SE_EN_TWINROBA_ROLL, 0x28, 3, 0, 0) +/* 0x3922 */ DEFINE_SFX(CHAN_4236, NA_SE_EN_TWINROBA_SHOOT_FIRE, 0x30, 3, 0, 0) +/* 0x3923 */ DEFINE_SFX(CHAN_421A, NA_SE_EN_TWINROBA_THROW_MASIC, 0x30, 3, 0, 0) +/* 0x3924 */ DEFINE_SFX(CHAN_4AC3, NA_SE_EN_DARUNIA_HIT_BREAST, 0x30, 0, 0, 0) +/* 0x3925 */ DEFINE_SFX(CHAN_4AD6, NA_SE_EN_DARUNIA_HIT_LINK, 0x30, 0, 0, 0) +/* 0x3926 */ DEFINE_SFX(CHAN_4F7F, NA_SE_EN_OWL_FLUTTER, 0x30, 0, 0, 0) +/* 0x3927 */ DEFINE_SFX(CHAN_3612, NA_SE_EN_VALVAISA_LAND, 0x30, 3, 0, 0) +/* 0x3928 */ DEFINE_SFX(CHAN_4B49, NA_SE_EN_IRONNACK_WALK, 0x18, 1, 0, 0) +/* 0x3929 */ DEFINE_SFX(CHAN_4B67, NA_SE_EN_IRONNACK_SWING_AXE, 0x34, 3, 0, 0) +/* 0x392A */ DEFINE_SFX(CHAN_4C05, NA_SE_EN_IRONNACK_ARMOR_DEMO, 0x30, 3, 0, 0) +/* 0x392B */ DEFINE_SFX(CHAN_4D74, NA_SE_EN_IRONNACK_STAGGER_DEMO, 0x30, 3, 0, 0) +/* 0x392C */ DEFINE_SFX(CHAN_4D8B, NA_SE_EN_IRONNACK_ARMOR_OFF_DEMO, 0x34, 3, 0, 0) +/* 0x392D */ DEFINE_SFX(CHAN_4D57, NA_SE_EN_IRONNACK_ARMOR_LAND1_DEMO, 0x30, 3, 0, 0) +/* 0x392E */ DEFINE_SFX(CHAN_4D34, NA_SE_EN_IRONNACK_ARMOR_LAND2_DEMO, 0x30, 3, 0, 0) +/* 0x392F */ DEFINE_SFX(CHAN_4D53, NA_SE_EN_IRONNACK_ARMOR_LAND3_DEMO, 0x30, 3, 0, 0) +/* 0x3930 */ DEFINE_SFX(CHAN_4C5D, NA_SE_EN_FLOORMASTER_ATTACK, 0x30, 1, 0, 0) +/* 0x3931 */ DEFINE_SFX(CHAN_4C6E, NA_SE_EN_FLOORMASTER_SM_WALK, 0x14, 0, 0, 0) +/* 0x3932 */ DEFINE_SFX(CHAN_4C7C, NA_SE_EN_FLOORMASTER_SM_DEAD, 0x40, 1, 0, 0) +/* 0x3933 */ DEFINE_SFX(CHAN_4C95, NA_SE_EN_FLOORMASTER_RESTORE, 0x30, 1, 0, 0) +/* 0x3934 */ DEFINE_SFX(CHAN_4CA7, NA_SE_EN_FLOORMASTER_EXPAND, 0x30, 1, 0, 0) +/* 0x3935 */ DEFINE_SFX(CHAN_4CBD, NA_SE_EN_FLOORMASTER_SPLIT, 0x30, 1, 0, 0) +/* 0x3936 */ DEFINE_SFX(CHAN_4CC6, NA_SE_EN_FLOORMASTER_SM_STICK, 0x38, 3, 0, 0) +/* 0x3937 */ DEFINE_SFX(CHAN_4CE0, NA_SE_EN_FLOORMASTER_SM_LAND, 0x30, 0, 0, 0) +/* 0x3938 */ DEFINE_SFX(CHAN_4DA4, NA_SE_EN_IRONNACK_WAVE_DEMO, 0x30, 3, 0, 0) +/* 0x3939 */ DEFINE_SFX(CHAN_4DC1, NA_SE_EN_IRONNACK_FINGER_DEMO, 0x30, 3, 0, 0) +/* 0x393A */ DEFINE_SFX(CHAN_53A8, NA_SE_EN_IRONNACK_ARMOR_HIT, 0x38, 3, 0, 0) +/* 0x393B */ DEFINE_SFX(CHAN_4826, NA_SE_EN_NUTS_CUTBODY, 0x38, 3, 0, 0) +/* 0x393C */ DEFINE_SFX(CHAN_4DCD, NA_SE_EN_BALINADE_LEVEL, 0x30, 2, 0, 0) +/* 0x393D */ DEFINE_SFX(CHAN_4DE2, NA_SE_EN_BALINADE_DAMAGE, 0x38, 3, 0, 0) +/* 0x393E */ DEFINE_SFX(CHAN_4E23, NA_SE_EN_BALINADE_FAINT, 0x38, 3, 0, 0) +/* 0x393F */ DEFINE_SFX(CHAN_4E3E, NA_SE_EN_BALINADE_BREAK, 0x30, 3, 2, 0) +/* 0x3940 */ DEFINE_SFX(CHAN_4E59, NA_SE_EN_BALINADE_DEAD, 0x38, 3, 0, 0) +/* 0x3941 */ DEFINE_SFX(CHAN_4E8D, NA_SE_EN_BALINADE_STICK, 0x30, 3, 0, 0) +/* 0x3942 */ DEFINE_SFX(CHAN_4EA8, NA_SE_EN_BALINADE_THUNDER, 0x34, 3, 0, 0) +/* 0x3943 */ DEFINE_SFX(CHAN_415D, NA_SE_EN_BALINADE_BL_SPARK, 0x20, 2, 0, 0) +/* 0x3944 */ DEFINE_SFX(CHAN_4184, NA_SE_EN_BALINADE_BL_DEAD, 0x34, 3, 0, 0) +#if OOT_VERSION < PAL_1_0 || PLATFORM_GC +/* 0x3945 */ DEFINE_SFX(CHAN_4E86, NA_SE_EN_BALINADE_BREAK2, 0x30, 3, 0, 0) +#else +/* 0x3945 */ DEFINE_SFX(CHAN_4E86, NA_SE_EN_BALINADE_BREAK2, 0x34, 3, 0, 0) +#endif +/* 0x3946 */ DEFINE_SFX(CHAN_425D, NA_SE_EN_BALINADE_HIT_RINK, 0x38, 3, 0, 0) +/* 0x3947 */ DEFINE_SFX(CHAN_3AF4, NA_SE_EN_GANON_WAVE_GND, 0x20, 3, 0, 0) +/* 0x3948 */ DEFINE_SFX(CHAN_4F03, NA_SE_EN_AWA_BOUND, 0x14, 0, 0, 0) +/* 0x3949 */ DEFINE_SFX(CHAN_4EE0, NA_SE_EN_AWA_BREAK, 0x20, 1, 0, 0) +/* 0x394A */ DEFINE_SFX(CHAN_503D, NA_SE_EN_BROB_WAVE, 0x30, 3, 0, 0) +/* 0x394B */ DEFINE_SFX(CHAN_43F8, NA_SE_EN_NYU_DEAD, 0x40, 1, 0, 0) +/* 0x394C */ DEFINE_SFX(CHAN_3F9A, NA_SE_EN_EIER_DAMAGE, 0x38, 1, 0, 0) +/* 0x394D */ DEFINE_SFX(CHAN_3FAC, NA_SE_EN_EIER_DEAD, 0x40, 1, 0, 0) +/* 0x394E */ DEFINE_SFX(CHAN_4F17, NA_SE_EN_EIER_FLUTTER, 0x20, 0, 0, 0) +/* 0x394F */ DEFINE_SFX(CHAN_4F28, NA_SE_EN_EIER_FLY, 0x20, 0, 0, 0) +/* 0x3950 */ DEFINE_SFX(CHAN_4F5D, NA_SE_EN_SHADEST_TAIKO_LOW, 0x30, 3, 0, 0) +/* 0x3951 */ DEFINE_SFX(CHAN_4F6E, NA_SE_EN_SHADEST_TAIKO_HIGH, 0x30, 3, 0, 0) +/* 0x3952 */ DEFINE_SFX(CHAN_5055, NA_SE_EN_SHADEST_CLAP, 0x30, 3, 0, 0) +/* 0x3953 */ DEFINE_SFX(CHAN_4EBC, NA_SE_EN_SHADEST_FLY_ATTACK, 0x30, 3, 0, 0) +/* 0x3954 */ DEFINE_SFX(CHAN_4FB5, NA_SE_EN_PIHAT_UP, 0x28, 2, 0, 0) +/* 0x3955 */ DEFINE_SFX(CHAN_4F92, NA_SE_EN_PIHAT_FLY, 0x30, 0, 0, 0) +/* 0x3956 */ DEFINE_SFX(CHAN_4FC3, NA_SE_EN_PIHAT_DAMAGE, 0x38, 1, 0, 0) +/* 0x3957 */ DEFINE_SFX(CHAN_4FAF, NA_SE_EN_PIHAT_LAND, 0x28, 2, 0, 0) +/* 0x3958 */ DEFINE_SFX(CHAN_4EBC, NA_SE_EN_BALINADE_HAND_DOWN, 0x30, 3, 0, 0) +/* 0x3959 */ DEFINE_SFX(CHAN_4ECE, NA_SE_EN_BALINADE_HAND_UP, 0x30, 3, 0, 0) +/* 0x395A */ DEFINE_SFX(CHAN_4FC3, NA_SE_EN_BALINADE_HAND_DAMAGE, 0x38, 3, 0, 0) +/* 0x395B */ DEFINE_SFX(CHAN_4E0E, NA_SE_EN_BALINADE_HAND_DEAD, 0x40, 3, 0, 0) +/* 0x395C */ DEFINE_SFX(CHAN_3697, NA_SE_EN_GOMA_JR_WALK, 0x14, 0, 0, 0) +/* 0x395D */ DEFINE_SFX(CHAN_36A5, NA_SE_EN_GOMA_JR_CRY, 0x30, 0, 0, 0) +/* 0x395E */ DEFINE_SFX(CHAN_36B3, NA_SE_EN_GOMA_JR_DAM1, 0x38, 1, 0, 0) +/* 0x395F */ DEFINE_SFX(CHAN_36D2, NA_SE_EN_GOMA_JR_DAM2, 0x30, 1, 0, 0) +/* 0x3960 */ DEFINE_SFX(CHAN_36F9, NA_SE_EN_GOMA_JR_DEAD, 0x40, 1, 0, 0) +/* 0x3961 */ DEFINE_SFX(CHAN_3767, NA_SE_EN_GOMA_EGG1, 0x28, 0, 0, 0) +/* 0x3962 */ DEFINE_SFX(CHAN_35DF, NA_SE_EN_GOMA_EGG2, 0x28, 0, 0, 0) +/* 0x3963 */ DEFINE_SFX(CHAN_417E, NA_SE_EN_GANON_BODY_SPARK, 0x30, 2, 0, 0) +/* 0x3964 */ DEFINE_SFX(CHAN_5064, NA_SE_EN_SHADEST_HAND_WAVE, 0x30, 3, 0, 0) +/* 0x3965 */ DEFINE_SFX(CHAN_5089, NA_SE_EN_SHADEST_CATCH, 0x30, 3, 0, 0) +/* 0x3966 */ DEFINE_SFX(CHAN_3612, NA_SE_EN_SHADEST_LAND, 0x30, 3, 0, 0) +/* 0x3967 */ DEFINE_SFX(CHAN_5072, NA_SE_EN_SHADEST_HAND_FLY, 0x30, 3, 0, 0) +/* 0x3968 */ DEFINE_SFX(CHAN_50B1, NA_SE_EN_SHADEST_SHAKEHAND, 0x30, 0, 0, SFX_FLAG_13) +/* 0x3969 */ DEFINE_SFX(CHAN_50C2, NA_SE_EN_SHADEST_DAMAGE, 0x38, 3, 0, 0) +/* 0x396A */ DEFINE_SFX(CHAN_50E1, NA_SE_EN_SHADEST_DAMAGE_HAND, 0x38, 3, 0, 0) +/* 0x396B */ DEFINE_SFX(CHAN_50E9, NA_SE_EN_SHADEST_DISAPPEAR, 0x30, 3, 0, 0) +/* 0x396C */ DEFINE_SFX(CHAN_4A65, NA_SE_EN_GANON_CHARGE_MASIC, 0x30, 3, 0, 0) +/* 0x396D */ DEFINE_SFX(CHAN_4EA8, NA_SE_EN_GANON_THROW_BIG, 0x34, 3, 0, 0) +/* 0x396E */ DEFINE_SFX(CHAN_5259, NA_SE_EN_SHADEST_FREEZE, 0x38, 3, 0, 0) +/* 0x396F */ DEFINE_SFX(CHAN_5264, NA_SE_EN_SHADEST_DEAD, 0x40, 3, 0, 0) +/* 0x3970 */ DEFINE_SFX(CHAN_5111, NA_SE_EN_BIMOS_ROLL_HEAD, 0x10, 0, 0, 0) +/* 0x3971 */ DEFINE_SFX(CHAN_5101, NA_SE_EN_BIMOS_LAZER, 0x34, 0, 0, 0) +/* 0x3972 */ DEFINE_SFX(CHAN_5121, NA_SE_EN_BIMOS_LAZER_GND, 0x18, 0, 0, 0) +/* 0x3973 */ DEFINE_SFX(CHAN_512D, NA_SE_EN_BIMOS_AIM, 0x30, 0, 0, 0) +/* 0x3974 */ DEFINE_SFX(CHAN_514F, NA_SE_EN_BUBLEWALK_WALK, 0x14, 0, 0, 0) +/* 0x3975 */ DEFINE_SFX(CHAN_5164, NA_SE_EN_BUBLEWALK_AIM, 0x34, 0, 0, 0) +/* 0x3976 */ DEFINE_SFX(CHAN_5135, NA_SE_EN_BUBLEWALK_REVERSE, 0x28, 1, 0, 0) +/* 0x3977 */ DEFINE_SFX(CHAN_419C, NA_SE_EN_BUBLEWALK_DAMAGE, 0x38, 1, 0, 0) +/* 0x3978 */ DEFINE_SFX(CHAN_517A, NA_SE_EN_BUBLEWALK_DEAD, 0x40, 1, 0, 0) +/* 0x3979 */ DEFINE_SFX(CHAN_5196, NA_SE_EN_YUKABYUN_FLY, 0x30, 0, 0, 0) +/* 0x397A */ DEFINE_SFX(CHAN_5204, NA_SE_EN_FLAME_DAMAGE, 0x38, 3, 0, 0) +/* 0x397B */ DEFINE_SFX(CHAN_4FE8, NA_SE_EN_TWINROBA_FLY_DEMO, 0x20, 0, 0, 0) +/* 0x397C */ DEFINE_SFX(CHAN_51BA, NA_SE_EN_FLAME_KICK, 0x20, 2, 0, 0) +/* 0x397D */ DEFINE_SFX(CHAN_522F, NA_SE_EN_FLAME_RUN, 0x30, 2, 0, 0) +/* 0x397E */ DEFINE_SFX(CHAN_51C4, NA_SE_EN_FLAME_ROLL, 0x30, 3, 0, 0) +/* 0x397F */ DEFINE_SFX(CHAN_51DD, NA_SE_EN_FLAME_MAN_RUN, 0x30, 3, 0, 0) +/* 0x3980 */ DEFINE_SFX(CHAN_51EB, NA_SE_EN_FLAME_MAN_DAMAGE, 0x38, 3, 0, 0) +/* 0x3981 */ DEFINE_SFX(CHAN_5208, NA_SE_EN_FLAME_LAUGH, 0x30, 3, 0, 0) +/* 0x3982 */ DEFINE_SFX(CHAN_3BF3, NA_SE_EN_FLAME_MAN_SLIDE, 0x20, 0, 0, SFX_FLAG_13) +/* 0x3983 */ DEFINE_SFX(CHAN_4593, NA_SE_EN_FLAME_FIRE_ATTACK, 0x30, 3, 0, 0) +/* 0x3984 */ DEFINE_SFX(CHAN_5242, NA_SE_EN_PIHAT_SM_FLY, 0x30, 0, 0, 0) +/* 0x3985 */ DEFINE_SFX(CHAN_3C04, NA_SE_EN_PIHAT_SM_DEAD, 0x40, 1, 0, 0) +/* 0x3986 */ DEFINE_SFX(CHAN_38BA, NA_SE_EN_RIVA_APPEAR, 0x30, 0, 0, 0) +/* 0x3987 */ DEFINE_SFX(CHAN_38AF, NA_SE_EN_AKINDONUTS_HIDE, 0x20, 0, 0, 0) +/* 0x3988 */ DEFINE_SFX(CHAN_381C, NA_SE_EN_RIVA_DAMAGE, 0x38, 1, 0, 0) +/* 0x3989 */ DEFINE_SFX(CHAN_52E7, NA_SE_EN_RIVA_DEAD, 0x40, 1, 0, 0) +/* 0x398A */ DEFINE_SFX(CHAN_503D, NA_SE_EN_RIVA_MOVE, 0x30, 0, 0, 0) +/* 0x398B */ DEFINE_SFX(CHAN_39A9, NA_SE_EN_FLAME_MAN_SURP, 0x30, 0, 0, SFX_FLAG_13) +/* 0x398C */ DEFINE_SFX(CHAN_528C, NA_SE_EN_SHADEST_LAST, 0x30, 3, 0, 0) +/* 0x398D */ DEFINE_SFX(CHAN_52AC, NA_SE_EN_SHADEST_MOVE, 0x30, 2, 0, 0) +/* 0x398E */ DEFINE_SFX(CHAN_52CC, NA_SE_EN_SHADEST_PRAY, 0x30, 3, 0, 0) +/* 0x398F */ DEFINE_SFX(CHAN_44FE, NA_SE_EN_MGANON_ROAR, 0x30, 3, 0, 0) +/* 0x3990 */ DEFINE_SFX(CHAN_514F, NA_SE_EN_LIKE_WALK, 0x18, 0, 0, 0) +/* 0x3991 */ DEFINE_SFX(CHAN_46C7, NA_SE_EN_LIKE_UNARI, 0x28, 0, 0, 0) +/* 0x3992 */ DEFINE_SFX(CHAN_3B23, NA_SE_EN_LIKE_DRINK, 0x34, 0, 0, 0) +/* 0x3993 */ DEFINE_SFX(CHAN_3D68, NA_SE_EN_LIKE_EAT, 0x34, 0, 0, 0) +/* 0x3994 */ DEFINE_SFX(CHAN_3EF5, NA_SE_EN_LIKE_THROW, 0x34, 0, 0, 0) +/* 0x3995 */ DEFINE_SFX(CHAN_381C, NA_SE_EN_LIKE_DAMAGE, 0x38, 1, 0, 0) +/* 0x3996 */ DEFINE_SFX(CHAN_52D9, NA_SE_EN_LIKE_DEAD, 0x40, 1, 0, 0) +/* 0x3997 */ DEFINE_SFX(CHAN_53DD, NA_SE_EN_MGANON_SWORD, 0x30, 3, 0, 0) +/* 0x3998 */ DEFINE_SFX(CHAN_52F5, NA_SE_EN_GERUDOFT_ATTACK, 0x30, 0, 0, 0) +/* 0x3999 */ DEFINE_SFX(CHAN_5302, NA_SE_EN_GERUDOFT_DAMAGE, 0x38, 1, 0, 0) +/* 0x399A */ DEFINE_SFX(CHAN_530F, NA_SE_EN_GERUDOFT_DEAD, 0x40, 1, 0, 0) +/* 0x399B */ DEFINE_SFX(CHAN_4576, NA_SE_EN_MGANON_DAMAGE, 0x38, 3, 0, 0) +/* 0x399C */ DEFINE_SFX(CHAN_355F, NA_SE_EN_ANUBIS_FIRE, 0x30, 0, 0, 0) +/* 0x399D */ DEFINE_SFX(CHAN_534B, NA_SE_EN_ANUBIS_FIREBOMB, 0x30, 0, 0, 0) +/* 0x399E */ DEFINE_SFX(CHAN_550D, NA_SE_EN_MGANON_DEAD1, 0x40, 3, 0, 0) +/* 0x399F */ DEFINE_SFX(CHAN_532A, NA_SE_EN_ANUBIS_DEAD, 0x40, 2, 0, 0) +/* 0x39A0 */ DEFINE_SFX(CHAN_531C, NA_SE_EN_MUSI_LAND, 0x18, 0, 0, 0) +/* 0x39A1 */ DEFINE_SFX(CHAN_54B4, NA_SE_EN_MGANON_DEAD2, 0x44, 3, 0, 0) +/* 0x39A2 */ DEFINE_SFX(CHAN_4F3C, NA_SE_EN_EIER_ATTACK, 0x34, 0, 0, 0) +/* 0x39A3 */ DEFINE_SFX(CHAN_4F4E, NA_SE_EN_EIER_CRY, 0x18, 0, 0, 0) +/* 0x39A4 */ DEFINE_SFX(CHAN_4A22, NA_SE_EN_FREEZAD_BREATH, 0x30, 0, 0, 0) +/* 0x39A5 */ DEFINE_SFX(CHAN_5375, NA_SE_EN_FREEZAD_DAMAGE, 0x38, 1, 0, 0) +/* 0x39A6 */ DEFINE_SFX(CHAN_537F, NA_SE_EN_FREEZAD_DEAD, 0x40, 1, 0, 0) +/* 0x39A7 */ DEFINE_SFX(CHAN_5397, NA_SE_EN_DEADHAND_LAUGH, 0x18, 3, 0, 0) +/* 0x39A8 */ DEFINE_SFX(CHAN_5389, NA_SE_EN_DEADHAND_HIDE, 0x30, 3, 0, 0) +/* 0x39A9 */ DEFINE_SFX(CHAN_4321, NA_SE_EN_DEADHAND_DAMAGE, 0x38, 3, 0, 0) +/* 0x39AA */ DEFINE_SFX(CHAN_3B8E, NA_SE_EN_DEADHAND_HAND_DEAD, 0x38, 3, 0, 0) +/* 0x39AB */ DEFINE_SFX(CHAN_4353, NA_SE_EN_DEADHAND_DEAD, 0x40, 3, 0, 0) +/* 0x39AC */ DEFINE_SFX(CHAN_53D2, NA_SE_EN_IRONNACK_BREAK_PILLAR2, 0x30, 3, 0, 0) +/* 0x39AD */ DEFINE_SFX(CHAN_53B9, NA_SE_EN_IRONNACK_BREAK_PILLAR, 0x36, 3, 0, 0) +/* 0x39AE */ DEFINE_SFX(CHAN_53D6, NA_SE_EN_IRONNACK_HIT_GND, 0x34, 3, 0, 0) +/* 0x39AF */ DEFINE_SFX(CHAN_5490, NA_SE_EN_MGANON_BREATH, 0x28, 2, 2, 0) +/* 0x39B0 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_TWINROBA_LAUGH, 0x30, 3, 0, 0) +/* 0x39B1 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_TWINROBA_LAUGH2, 0x30, 3, 0, 0) +/* 0x39B2 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_DUMMY434, 0x30, 0, 0, 0) +/* 0x39B3 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_TWINROBA_SHOOT_VOICE, 0x30, 3, 0, 0) +/* 0x39B4 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_TWINROBA_SENSE, 0x30, 3, 0, 0) +/* 0x39B5 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_TWINROBA_DIE, 0x30, 3, 0, 0) +/* 0x39B6 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_DUMMY438, 0x30, 0, 0, 0) +/* 0x39B7 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_TWINROBA_YOUNG_DAMAGE2, 0x30, 0, 0, SFX_FLAG_13) +/* 0x39B8 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_TWINROBA_YOUNG_SHOOTVC, 0x30, 0, 0, SFX_FLAG_13) +/* 0x39B9 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_TWINROBA_YOUNG_LAUGH, 0x30, 0, 0, SFX_FLAG_13) +/* 0x39BA */ DEFINE_SFX(CHAN_5403, NA_SE_EN_DUMMY442, 0x30, 0, 0, 0) +/* 0x39BB */ DEFINE_SFX(CHAN_5403, NA_SE_EN_TWINROBA_YOUNG_WINK, 0x30, 0, 0, SFX_FLAG_13) +/* 0x39BC */ DEFINE_SFX(CHAN_5403, NA_SE_EN_DUMMY444, 0x30, 0, 0, 0) +/* 0x39BD */ DEFINE_SFX(CHAN_5403, NA_SE_EN_DUMMY445, 0x30, 0, 0, 0) +/* 0x39BE */ DEFINE_SFX(CHAN_5403, NA_SE_EN_IRONNACK_DAMAGE, 0x28, 3, 0, 0) +/* 0x39BF */ DEFINE_SFX(CHAN_5403, NA_SE_EN_IRONNACK_DASH, 0x30, 3, 0, 0) +/* 0x39C0 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_IRONNACK_DEAD, 0x40, 3, 0, 0) +/* 0x39C1 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_IRONNACK_PULLOUT, 0x30, 3, 0, 0) +/* 0x39C2 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_IRONNACK_WAKEUP, 0x30, 3, 0, 0) +/* 0x39C3 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_DUMMY451, 0x30, 0, 0, 0) +/* 0x39C4 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_DUMMY452, 0x30, 0, 0, 0) +/* 0x39C5 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_DUMMY453, 0x30, 0, 0, 0) +/* 0x39C6 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GERUDOFT_BREATH, 0x20, 0, 0, 0) +/* 0x39C7 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_LAUGH, 0x20, 3, 0, 0) +/* 0x39C8 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_VOICE_DEMO, 0x30, 3, 0, 0) +/* 0x39C9 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_THROW, 0x30, 3, 0, 0) +/* 0x39CA */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_AT_RETURN, 0x30, 3, 0, 0) +/* 0x39CB */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_HIT_GND, 0x30, 3, 0, 0) +/* 0x39CC */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_DAMAGE1, 0x38, 3, 0, 0) +/* 0x39CD */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_DAMAGE2, 0x38, 3, 0, 0) +/* 0x39CE */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_DOWN, 0x20, 3, 0, 0) +/* 0x39CF */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_RESTORE, 0x30, 3, 0, 0) +/* 0x39D0 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_DEAD, 0x44, 3, 0, 0) +/* 0x39D1 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_BREATH, 0x30, 3, 2, 0) +/* 0x39D2 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_TOKETU, 0x30, 3, 0, 0) +/* 0x39D3 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_CASBREAK, 0x30, 3, 0, 0) +/* 0x39D4 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_BIGMASIC, 0x34, 3, 0, 0) +/* 0x39D5 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_GANON_DARKWAVE, 0x30, 3, 0, 0) +/* 0x39D6 */ DEFINE_SFX(CHAN_5403, NA_SE_EN_FANTOM_ST_LAUGH, 0x30, 3, 0, 0) +/* 0x39D7 */ DEFINE_SFX(CHAN_3612, NA_SE_EN_MGANON_WALK, 0x20, 2, 0, 0) +/* 0x39D8 */ DEFINE_SFX(CHAN_5389, NA_SE_EN_MGANON_STAND, 0x30, 3, 0, 0) +/* 0x39D9 */ DEFINE_SFX(CHAN_55FD, NA_SE_EN_MGANON_UNARI, 0x20, 3, 0, 0) +/* 0x39DA */ DEFINE_SFX(CHAN_5615, NA_SE_EN_STALGOLD_ROLL, 0x30, 0, 0, 0) +/* 0x39DB */ DEFINE_SFX(CHAN_503D, NA_SE_EN_KDOOR_WAVE, 0x30, 2, 0, 0) +/* 0x39DC */ DEFINE_SFX(CHAN_39FE, NA_SE_EN_KDOOR_HIT, 0x40, 2, 0, 0) +/* 0x39DD */ DEFINE_SFX(CHAN_53D2, NA_SE_EN_KDOOR_BREAK, 0x40, 3, 0, 0) +/* 0x39DE */ DEFINE_SFX(CHAN_39FE, NA_SE_EN_KDOOR_HIT_GND, 0x34, 2, 0, 0) +/* 0x39DF */ DEFINE_SFX(CHAN_563C, NA_SE_EN_MGANON_SWDIMP, 0x30, 3, 0, 0) +/* 0x39E0 */ DEFINE_SFX(CHAN_4EBC, NA_SE_EN_STALTU_WAVE, 0x30, 0, 0, 0) +/* 0x39E1 */ DEFINE_SFX(CHAN_564F, NA_SE_EN_STALTU_DOWN_SET, 0x30, 0, 0, 0) +/* 0x39E2 */ DEFINE_SFX(CHAN_4CA7, NA_SE_EN_DUMMY482, 0x30, 1, 0, 0) +/* 0x39E3 */ DEFINE_SFX(CHAN_3648, NA_SE_EN_GOMA_BJR_LAND, 0x34, 3, 0, 0) +/* 0x39E4 */ DEFINE_SFX(CHAN_38D1, NA_SE_EN_GOMA_BJR_LAND2, 0x24, 3, 0, 0) +/* 0x39E5 */ DEFINE_SFX(CHAN_3648, NA_SE_EN_GOMA_JR_LAND, 0x34, 1, 0, 0) +/* 0x39E6 */ DEFINE_SFX(CHAN_38D1, NA_SE_EN_GOMA_JR_LAND2, 0x20, 0, 0, 0) +/* 0x39E7 */ DEFINE_SFX(CHAN_5659, NA_SE_EN_TWINROBA_FIGHT, 0x30, 3, 0, 0) +/* 0x39E8 */ DEFINE_SFX(CHAN_567A, NA_SE_EN_PO_BIG_CRY, 0x30, 0, 0, 0) +/* 0x39E9 */ DEFINE_SFX(CHAN_388D, NA_SE_EN_MUSI_SINK, 0x08, 1, 0, 0) +/* 0x39EA */ DEFINE_SFX(CHAN_3FE8, NA_SE_EN_STALGOLD_UP_CRY, 0x30, 1, 0, 0) +/* 0x39EB */ DEFINE_SFX(CHAN_568E, NA_SE_EN_GOLON_CRY, 0x30, 3, 0, 0) +/* 0x39EC */ DEFINE_SFX(CHAN_381C, NA_SE_EN_MOFER_CORE_DAMAGE, 0x38, 3, 0, 0) +/* 0x39ED */ DEFINE_SFX(CHAN_43EA, NA_SE_EN_DAIOCTA_LAND_WATER, 0x20, 0, 0, SFX_FLAG_13) +/* 0x39EE */ DEFINE_SFX(CHAN_5389, NA_SE_EN_RIVA_BIG_APPEAR, 0x34, 3, 0, 0) +/* 0x39EF */ DEFINE_SFX(CHAN_3612, NA_SE_EN_MONBLIN_HAM_LAND, 0x34, 0, 0, SFX_FLAG_13) +/* 0x39F0 */ DEFINE_SFX(CHAN_3895, NA_SE_EN_MUSI_WALK, 0x08, 0, 0, 0) +/* 0x39F1 */ DEFINE_SFX(CHAN_4A22, NA_SE_EN_MIMICK_BREATH, 0x40, 3, 0, 0) +/* 0x39F2 */ DEFINE_SFX(CHAN_3C8C, NA_SE_EN_STALWALL_LAUGH, 0x34, 3, 0, 0) diff --git a/include/tables/sfx/environmentbank_table.h b/include/tables/sfx/environmentbank_table.h index 58bffcee8f..a2ecf23c0d 100644 --- a/include/tables/sfx/environmentbank_table.h +++ b/include/tables/sfx/environmentbank_table.h @@ -2,259 +2,266 @@ * Sfx Environment Bank * * DEFINE_SFX should be used for all sfx define in the environment bank from sequence 0 + * - Argument 0: Channel name for sequence 0 * - Argument 1: Enum value for this sfx * - Argument 2: Importance for deciding which sfx to prioritize. Higher values have greater importance * - Argument 3: Slows the decay of volume with distance (a 2-bit number ranging from 0-3) * - Argument 4: Applies increasingly random offsets to frequency (a 2-bit number ranging from 0-3) * - Argument 5: Various flags to add properties to the sfx - * - * WARNING: entries must align with the table defined for the environment bank in sequence 0 */ -/* 0x2800 */ DEFINE_SFX(NA_SE_EV_DOOR_OPEN, 0x70, 0, 1, SFX_FLAG_10 | SFX_FLAG_9) -/* 0x2801 */ DEFINE_SFX(NA_SE_EV_DOOR_CLOSE, 0x80, 0, 1, 0) -/* 0x2802 */ DEFINE_SFX(NA_SE_EV_EXPLOSION, 0x30, 0, 0, 0) -/* 0x2803 */ DEFINE_SFX(NA_SE_EV_HORSE_WALK, 0x30, 0, 1, 0) -/* 0x2804 */ DEFINE_SFX(NA_SE_EV_HORSE_RUN, 0x30, 0, 1, 0) -/* 0x2805 */ DEFINE_SFX(NA_SE_EV_HORSE_NEIGH, 0x40, 0, 1, 0) -/* 0x2806 */ DEFINE_SFX(NA_SE_EV_RIVER_STREAM, 0x30, 0, 2, SFX_FLAG_10) -/* 0x2807 */ DEFINE_SFX(NA_SE_EV_WATER_WALL_BIG, 0x38, 2, 0, 0) -/* 0x2808 */ DEFINE_SFX(NA_SE_EV_OUT_OF_WATER, 0x30, 0, 1, 0) -/* 0x2809 */ DEFINE_SFX(NA_SE_EV_DIVE_WATER, 0x30, 0, 1, 0) -/* 0x280A */ DEFINE_SFX(NA_SE_EV_ROCK_SLIDE, 0x80, 2, 0, 0) -/* 0x280B */ DEFINE_SFX(NA_SE_EV_MAGMA_LEVEL, 0xA0, 3, 0, 0) -/* 0x280C */ DEFINE_SFX(NA_SE_EV_BRIDGE_OPEN, 0x30, 3, 0, 0) -/* 0x280D */ DEFINE_SFX(NA_SE_EV_BRIDGE_CLOSE, 0x30, 3, 0, 0) -/* 0x280E */ DEFINE_SFX(NA_SE_EV_BRIDGE_OPEN_STOP, 0x30, 3, 0, 0) -/* 0x280F */ DEFINE_SFX(NA_SE_EV_BRIDGE_CLOSE_STOP, 0x30, 3, 0, 0) -/* 0x2810 */ DEFINE_SFX(NA_SE_EV_WALL_BROKEN, 0x30, 2, 0, 0) -/* 0x2811 */ DEFINE_SFX(NA_SE_EV_CHICKEN_CRY_N, 0x30, 0, 1, 0) -/* 0x2812 */ DEFINE_SFX(NA_SE_EV_CHICKEN_CRY_A, 0x30, 0, 1, 0) -/* 0x2813 */ DEFINE_SFX(NA_SE_EV_CHICKEN_CRY_M, 0x30, 0, 0, 0) -/* 0x2814 */ DEFINE_SFX(NA_SE_EV_SLIDE_DOOR_OPEN, 0x60, 0, 0, 0) -/* 0x2815 */ DEFINE_SFX(NA_SE_EV_FOOT_SWITCH, 0x30, 3, 0, 0) -/* 0x2816 */ DEFINE_SFX(NA_SE_EV_HORSE_GROAN, 0x30, 0, 0, 0) -/* 0x2817 */ DEFINE_SFX(NA_SE_EV_BOMB_DROP_WATER, 0x30, 2, 2, 0) -/* 0x2818 */ DEFINE_SFX(NA_SE_EV_HORSE_JUMP, 0x30, 0, 0, 0) -/* 0x2819 */ DEFINE_SFX(NA_SE_EV_HORSE_LAND, 0x40, 0, 0, 0) -/* 0x281A */ DEFINE_SFX(NA_SE_EV_HORSE_SLIP, 0x38, 0, 0, 0) -/* 0x281B */ DEFINE_SFX(NA_SE_EV_FAIRY_DASH, 0x28, 0, 0, 0) -/* 0x281C */ DEFINE_SFX(NA_SE_EV_SLIDE_DOOR_CLOSE, 0x60, 0, 0, 0) -/* 0x281D */ DEFINE_SFX(NA_SE_EV_STONE_BOUND, 0x70, 3, 0, 0) -/* 0x281E */ DEFINE_SFX(NA_SE_EV_STONE_STATUE_OPEN, 0x30, 3, 0, 0) -/* 0x281F */ DEFINE_SFX(NA_SE_EV_TBOX_UNLOCK, 0x30, 0, 0, 0) -/* 0x2820 */ DEFINE_SFX(NA_SE_EV_TBOX_OPEN, 0x30, 0, 0, 0) -/* 0x2821 */ DEFINE_SFX(NA_SE_SY_TIMER, 0xA0, 0, 0, SFX_FLAG_13 | SFX_FLAG_3) -/* 0x2822 */ DEFINE_SFX(NA_SE_EV_FLAME_IGNITION, 0x20, 2, 0, 0) -/* 0x2823 */ DEFINE_SFX(NA_SE_EV_SPEAR_HIT, 0x30, 0, 0, 0) -/* 0x2824 */ DEFINE_SFX(NA_SE_EV_ELEVATOR_MOVE, 0x30, 0, 0, SFX_FLAG_11) -/* 0x2825 */ DEFINE_SFX(NA_SE_EV_WARP_HOLE, 0x30, 0, 0, SFX_FLAG_15 | SFX_FLAG_11) -/* 0x2826 */ DEFINE_SFX(NA_SE_EV_LINK_WARP, 0x30, 0, 0, SFX_FLAG_15) -/* 0x2827 */ DEFINE_SFX(NA_SE_EV_PILLAR_SINK, 0x30, 2, 0, 0) -/* 0x2828 */ DEFINE_SFX(NA_SE_EV_WATER_WALL, 0x30, 0, 0, 0) -/* 0x2829 */ DEFINE_SFX(NA_SE_EV_RIVER_STREAM_S, 0x30, 0, 0, 0) -/* 0x282A */ DEFINE_SFX(NA_SE_EV_RIVER_STREAM_F, 0x30, 0, 0, 0) -/* 0x282B */ DEFINE_SFX(NA_SE_EV_HORSE_LAND2, 0x30, 0, 0, 0) -/* 0x282C */ DEFINE_SFX(NA_SE_EV_HORSE_SANDDUST, 0x30, 0, 0, SFX_FLAG_10) -/* 0x282D */ DEFINE_SFX(NA_SE_EV_DUMMY45, 0x30, 0, 0, 0) -/* 0x282E */ DEFINE_SFX(NA_SE_EV_LIGHTNING, 0x30, 0, 0, 0) -/* 0x282F */ DEFINE_SFX(NA_SE_EV_BOMB_BOUND, 0x30, 0, 2, 0) -/* 0x2830 */ DEFINE_SFX(NA_SE_EV_WATERDROP, 0x60, 2, 1, 0) -/* 0x2831 */ DEFINE_SFX(NA_SE_EV_TORCH, 0x10, 0, 0, 0) -/* 0x2832 */ DEFINE_SFX(NA_SE_EV_MAGMA_LEVEL_M, 0xA0, 3, 0, 0) -/* 0x2833 */ DEFINE_SFX(NA_SE_EV_FIRE_PILLAR, 0x30, 0, 0, 0) -/* 0x2834 */ DEFINE_SFX(NA_SE_EV_FIRE_PLATE, 0x30, 0, 0, SFX_FLAG_4) -/* 0x2835 */ DEFINE_SFX(NA_SE_EV_BLOCK_BOUND, 0x30, 3, 0, 0) -/* 0x2836 */ DEFINE_SFX(NA_SE_EV_METALDOOR_SLIDE, 0x30, 0, 0, 0) -/* 0x2837 */ DEFINE_SFX(NA_SE_EV_METALDOOR_STOP, 0x30, 0, 0, 0) -/* 0x2838 */ DEFINE_SFX(NA_SE_EV_BLOCK_SHAKE, 0x30, 0, 0, 0) -/* 0x2839 */ DEFINE_SFX(NA_SE_EV_BOX_BREAK, 0x30, 2, 0, 0) -/* 0x283A */ DEFINE_SFX(NA_SE_EV_HAMMER_SWITCH, 0x30, 0, 0, 0) -/* 0x283B */ DEFINE_SFX(NA_SE_EV_MAGMA_LEVEL_L, 0xA0, 3, 0, 0) -/* 0x283C */ DEFINE_SFX(NA_SE_EV_SPEAR_FENCE, 0x30, 0, 0, 0) -/* 0x283D */ DEFINE_SFX(NA_SE_EV_GANON_HORSE_NEIGH, 0x30, 0, 0, SFX_FLAG_10) -/* 0x283E */ DEFINE_SFX(NA_SE_EV_GANON_HORSE_GROAN, 0x30, 0, 0, SFX_FLAG_10) -/* 0x283F */ DEFINE_SFX(NA_SE_EV_FANTOM_WARP_S, 0x70, 3, 0, SFX_FLAG_4) -/* 0x2840 */ DEFINE_SFX(NA_SE_EV_FANTOM_WARP_L, 0x60, 0, 0, SFX_FLAG_15) -/* 0x2841 */ DEFINE_SFX(NA_SE_EV_FOUNTAIN, 0x30, 0, 0, SFX_FLAG_15) -/* 0x2842 */ DEFINE_SFX(NA_SE_EV_KID_HORSE_WALK, 0x30, 0, 0, 0) -/* 0x2843 */ DEFINE_SFX(NA_SE_EV_KID_HORSE_RUN, 0x30, 0, 0, 0) -/* 0x2844 */ DEFINE_SFX(NA_SE_EV_KID_HORSE_NEIGH, 0x30, 0, 0, 0) -/* 0x2845 */ DEFINE_SFX(NA_SE_EV_KID_HORSE_GROAN, 0x30, 0, 0, 0) -/* 0x2846 */ DEFINE_SFX(NA_SE_EV_WHITE_OUT, 0x30, 3, 0, SFX_FLAG_13) -/* 0x2847 */ DEFINE_SFX(NA_SE_EV_LIGHT_GATHER, 0x30, 0, 0, 0) -/* 0x2848 */ DEFINE_SFX(NA_SE_EV_TREE_CUT, 0x30, 0, 0, 0) -/* 0x2849 */ DEFINE_SFX(NA_SE_EV_VOLCANO, 0x30, 0, 0, SFX_FLAG_13 | SFX_FLAG_4) -/* 0x284A */ DEFINE_SFX(NA_SE_EV_GUILLOTINE_UP, 0x30, 0, 0, 0) -/* 0x284B */ DEFINE_SFX(NA_SE_EV_GUILLOTINE_BOUND, 0x30, 0, 0, 0) -/* 0x284C */ DEFINE_SFX(NA_SE_EV_ROLLCUTTER_MOTOR, 0x30, 0, 0, 0) -/* 0x284D */ DEFINE_SFX(NA_SE_EV_CHINETRAP_DOWN, 0x30, 0, 0, 0) -/* 0x284E */ DEFINE_SFX(NA_SE_EV_PLANT_BROKEN, 0x30, 1, 0, 0) -/* 0x284F */ DEFINE_SFX(NA_SE_EV_SHIP_BELL, 0x30, 0, 0, 0) -/* 0x2850 */ DEFINE_SFX(NA_SE_EV_FLUTTER_FLAG, 0x30, 0, 0, 0) -/* 0x2851 */ DEFINE_SFX(NA_SE_EV_TRAP_BOUND, 0x40, 0, 0, 0) -/* 0x2852 */ DEFINE_SFX(NA_SE_EV_ROCK_BROKEN, 0x30, 2, 3, 0) -/* 0x2853 */ DEFINE_SFX(NA_SE_EV_FANTOM_WARP_S2, 0x70, 2, 0, 0) -/* 0x2854 */ DEFINE_SFX(NA_SE_EV_FANTOM_WARP_L2, 0x60, 2, 0, 0) -/* 0x2855 */ DEFINE_SFX(NA_SE_EV_COFFIN_CAP_OPEN, 0x30, 0, 0, 0) -/* 0x2856 */ DEFINE_SFX(NA_SE_EV_COFFIN_CAP_BOUND, 0x60, 1, 0, 0) -/* 0x2857 */ DEFINE_SFX(NA_SE_EV_WIND_TRAP, 0x30, 2, 0, 0) -/* 0x2858 */ DEFINE_SFX(NA_SE_EV_TRAP_OBJ_SLIDE, 0x30, 0, 0, 0) -/* 0x2859 */ DEFINE_SFX(NA_SE_EV_METALDOOR_OPEN, 0x90, 3, 0, 0) -/* 0x285A */ DEFINE_SFX(NA_SE_EV_METALDOOR_CLOSE, 0x90, 3, 0, 0) -/* 0x285B */ DEFINE_SFX(NA_SE_EV_BURN_OUT, 0x30, 0, 0, 0) -/* 0x285C */ DEFINE_SFX(NA_SE_EV_BLOCKSINK, 0x30, 2, 0, 0) -/* 0x285D */ DEFINE_SFX(NA_SE_EV_CROWD, 0x30, 0, 0, SFX_FLAG_13 | SFX_FLAG_12 | SFX_FLAG_11) -/* 0x285E */ DEFINE_SFX(NA_SE_EV_WATER_LEVEL_DOWN, 0x30, 0, 0, 0) -/* 0x285F */ DEFINE_SFX(NA_SE_EV_NAVY_VANISH, 0x30, 0, 0, 0) -/* 0x2860 */ DEFINE_SFX(NA_SE_EV_LADDER_DOUND, 0x30, 3, 0, 0) -/* 0x2861 */ DEFINE_SFX(NA_SE_EV_WEB_VIBRATION, 0x30, 0, 0, 0) -/* 0x2862 */ DEFINE_SFX(NA_SE_EV_WEB_BROKEN, 0x30, 0, 0, 0) -/* 0x2863 */ DEFINE_SFX(NA_SE_EV_ROLL_STAND, 0x30, 3, 0, 0) -/* 0x2864 */ DEFINE_SFX(NA_SE_EV_BUYODOOR_OPEN, 0x30, 0, 0, 0) -/* 0x2865 */ DEFINE_SFX(NA_SE_EV_BUYODOOR_CLOSE, 0x30, 0, 0, 0) -/* 0x2866 */ DEFINE_SFX(NA_SE_EV_WOODDOOR_OPEN, 0x30, 0, 0, 0) -/* 0x2867 */ DEFINE_SFX(NA_SE_EV_METALGATE_OPEN, 0x30, 0, 0, 0) -/* 0x2868 */ DEFINE_SFX(NA_SE_IT_SCOOP_UP_WATER, 0x30, 0, 0, 0) -/* 0x2869 */ DEFINE_SFX(NA_SE_EV_FISH_LEAP, 0x30, 0, 0, 0) -/* 0x286A */ DEFINE_SFX(NA_SE_EV_KAKASHI_SWING, 0x30, 0, 0, 0) -/* 0x286B */ DEFINE_SFX(NA_SE_EV_KAKASHI_ROLL, 0x30, 0, 0, 0) -/* 0x286C */ DEFINE_SFX(NA_SE_EV_BOTTLE_CAP_OPEN, 0x30, 0, 0, 0) -/* 0x286D */ DEFINE_SFX(NA_SE_EV_JABJAB_BREATHE, 0x30, 3, 0, SFX_FLAG_11) -/* 0x286E */ DEFINE_SFX(NA_SE_EV_SPIRIT_STONE, 0x30, 0, 0, 0) -/* 0x286F */ DEFINE_SFX(NA_SE_EV_TRIFORCE_FLASH, 0x30, 3, 0, 0) -/* 0x2870 */ DEFINE_SFX(NA_SE_EV_FALL_DOWN_DIRT, 0x30, 0, 0, 0) -/* 0x2871 */ DEFINE_SFX(NA_SE_EV_NAVY_FLY, 0x30, 0, 0, 0) -/* 0x2872 */ DEFINE_SFX(NA_SE_EV_NAVY_CRASH, 0x30, 0, 0, 0) -/* 0x2873 */ DEFINE_SFX(NA_SE_EV_WOOD_HIT, 0x30, 0, 0, 0) -/* 0x2874 */ DEFINE_SFX(NA_SE_EV_SCOOPUP_WATER, 0x30, 0, 0, 0) -/* 0x2875 */ DEFINE_SFX(NA_SE_EV_DROP_FALL, 0x30, 0, 0, 0) -/* 0x2876 */ DEFINE_SFX(NA_SE_EV_WOOD_GEAR, 0x30, 2, 0, 0) -/* 0x2877 */ DEFINE_SFX(NA_SE_EV_TREE_SWING, 0x30, 0, 0, 0) -/* 0x2878 */ DEFINE_SFX(NA_SE_EV_HORSE_RUN_LEVEL, 0x30, 0, 0, 0) -/* 0x2879 */ DEFINE_SFX(NA_SE_EV_ELEVATOR_MOVE2, 0x30, 2, 0, 0) -/* 0x287A */ DEFINE_SFX(NA_SE_EV_ELEVATOR_STOP, 0x30, 2, 0, 0) -/* 0x287B */ DEFINE_SFX(NA_SE_EV_TRE_BOX_APPEAR, 0x30, 2, 0, 0) -/* 0x287C */ DEFINE_SFX(NA_SE_EV_CHAIN_KEY_UNLOCK, 0x40, 0, 0, 0) -/* 0x287D */ DEFINE_SFX(NA_SE_EV_SPINE_TRAP_MOVE, 0x1C, 0, 0, 0) -/* 0x287E */ DEFINE_SFX(NA_SE_EV_HEALING, 0x30, 0, 0, 0) -/* 0x287F */ DEFINE_SFX(NA_SE_EV_GREAT_FAIRY_APPEAR, 0x30, 0, 0, 0) -/* 0x2880 */ DEFINE_SFX(NA_SE_EV_GREAT_FAIRY_VANISH, 0x30, 0, 0, 0) -/* 0x2881 */ DEFINE_SFX(NA_SE_EV_RED_EYE, 0x30, 0, 0, 0) -/* 0x2882 */ DEFINE_SFX(NA_SE_EV_ROLL_STAND_2, 0x30, 0, 0, 0) -/* 0x2883 */ DEFINE_SFX(NA_SE_EV_WALL_SLIDE, 0x30, 0, 0, 0) -/* 0x2884 */ DEFINE_SFX(NA_SE_EV_TRE_BOX_FLASH, 0x30, 0, 0, 0) -/* 0x2885 */ DEFINE_SFX(NA_SE_EV_WINDMILL_LEVEL, 0x60, 0, 0, SFX_FLAG_9) -/* 0x2886 */ DEFINE_SFX(NA_SE_EV_GOTO_HEAVEN, 0x30, 0, 0, SFX_FLAG_11) -/* 0x2887 */ DEFINE_SFX(NA_SE_EV_POT_BROKEN, 0x30, 0, 0, 0) -/* 0x2888 */ DEFINE_SFX(NA_SE_PL_PUT_DOWN_POT, 0x30, 0, 0, 0) -/* 0x2889 */ DEFINE_SFX(NA_SE_EV_DIVE_INTO_WATER, 0x30, 0, 0, 0) -/* 0x288A */ DEFINE_SFX(NA_SE_EV_JUMP_OUT_WATER, 0x30, 0, 0, 0) -/* 0x288B */ DEFINE_SFX(NA_SE_EV_GOD_FLYING, 0x30, 3, 0, 0) -/* 0x288C */ DEFINE_SFX(NA_SE_EV_TRIFORCE, 0x30, 0, 0, 0) -/* 0x288D */ DEFINE_SFX(NA_SE_EV_AURORA, 0x30, 0, 0, 0) -/* 0x288E */ DEFINE_SFX(NA_SE_EV_DEKU_DEATH, 0x30, 0, 0, 0) -/* 0x288F */ DEFINE_SFX(NA_SE_EV_BUYOSTAND_RISING, 0x30, 3, 0, 0) -/* 0x2890 */ DEFINE_SFX(NA_SE_EV_BUYOSTAND_FALL, 0x30, 3, 0, 0) -/* 0x2891 */ DEFINE_SFX(NA_SE_EV_BUYOSHUTTER_OPEN, 0x30, 0, 0, SFX_FLAG_13) -/* 0x2892 */ DEFINE_SFX(NA_SE_EV_BUYOSHUTTER_CLOSE, 0x30, 0, 0, SFX_FLAG_13) -/* 0x2893 */ DEFINE_SFX(NA_SE_EV_STONEDOOR_STOP, 0x30, 3, 0, 0) -/* 0x2894 */ DEFINE_SFX(NA_SE_EV_S_STONE_REVIVAL, 0x30, 0, 0, 0) -/* 0x2895 */ DEFINE_SFX(NA_SE_EV_MEDAL_APPEAR_S, 0x30, 0, 0, 0) -/* 0x2896 */ DEFINE_SFX(NA_SE_EV_HUMAN_BOUND, 0x30, 0, 2, 0) -/* 0x2897 */ DEFINE_SFX(NA_SE_EV_MEDAL_APPEAR_L, 0x30, 0, 0, 0) -/* 0x2898 */ DEFINE_SFX(NA_SE_EV_EARTHQUAKE, 0x30, 0, 0, 0) -/* 0x2899 */ DEFINE_SFX(NA_SE_EV_SHUT_BY_CRYSTAL, 0x30, 0, 0, 0) -/* 0x289A */ DEFINE_SFX(NA_SE_EV_GOD_LIGHTBALL_2, 0x30, 0, 0, 0) -/* 0x289B */ DEFINE_SFX(NA_SE_EV_RUN_AROUND, 0x30, 0, 0, 0) -/* 0x289C */ DEFINE_SFX(NA_SE_EV_CONSENTRATION, 0x30, 0, 0, SFX_FLAG_11) -/* 0x289D */ DEFINE_SFX(NA_SE_EV_TIMETRIP_LIGHT, 0x30, 0, 0, SFX_FLAG_11) -/* 0x289E */ DEFINE_SFX(NA_SE_EV_BUYOSTAND_STOP_A, 0x30, 2, 0, 0) -/* 0x289F */ DEFINE_SFX(NA_SE_EV_BUYOSTAND_STOP_U, 0x30, 3, 0, 0) -/* 0x28A0 */ DEFINE_SFX(NA_SE_EV_OBJECT_FALL, 0x30, 0, 0, 0) -/* 0x28A1 */ DEFINE_SFX(NA_SE_EV_JUMP_CONC, 0x30, 0, 0, 0) -/* 0x28A2 */ DEFINE_SFX(NA_SE_EV_ICE_MELT, 0x30, 0, 0, 0) -/* 0x28A3 */ DEFINE_SFX(NA_SE_EV_FIRE_PILLAR_S, 0x30, 0, 0, 0) -/* 0x28A4 */ DEFINE_SFX(NA_SE_EV_BLOCK_RISING, 0x20, 3, 0, 0) -/* 0x28A5 */ DEFINE_SFX(NA_SE_EV_NABALL_VANISH, 0x30, 0, 0, 0) -/* 0x28A6 */ DEFINE_SFX(NA_SE_EV_SARIA_MELODY, 0x30, 0, 0, SFX_FLAG_15) -/* 0x28A7 */ DEFINE_SFX(NA_SE_EV_LINK_WARP_OUT, 0x30, 0, 0, 0) -/* 0x28A8 */ DEFINE_SFX(NA_SE_EV_FIATY_HEAL, 0x30, 0, 0, 0) -/* 0x28A9 */ DEFINE_SFX(NA_SE_EV_CHAIN_KEY_UNLOCK_B, 0x30, 0, 0, 0) -/* 0x28AA */ DEFINE_SFX(NA_SE_EV_WOODBOX_BREAK, 0x30, 2, 0, 0) -/* 0x28AB */ DEFINE_SFX(NA_SE_EV_PUT_DOWN_WOODBOX, 0x30, 0, 0, 0) -/* 0x28AC */ DEFINE_SFX(NA_SE_EV_LAND_DIRT, 0x30, 0, 0, 0) -/* 0x28AD */ DEFINE_SFX(NA_SE_EV_FLOOR_ROLLING, 0x30, 0, 0, 0) -/* 0x28AE */ DEFINE_SFX(NA_SE_EV_DOG_CRY_EVENING, 0x30, 0, 0, 0) -/* 0x28AF */ DEFINE_SFX(NA_SE_EV_JABJAB_HICCUP, 0x30, 0, 0, 0) -/* 0x28B0 */ DEFINE_SFX(NA_SE_EV_NALE_MAGIC, 0x30, 0, 0, 0) -/* 0x28B1 */ DEFINE_SFX(NA_SE_EV_FROG_JUMP, 0x30, 0, 0, 0) -/* 0x28B2 */ DEFINE_SFX(NA_SE_EV_ICE_FREEZE, 0x30, 3, 0, 0) -/* 0x28B3 */ DEFINE_SFX(NA_SE_EV_BURNING, 0x60, 3, 0, 0) -/* 0x28B4 */ DEFINE_SFX(NA_SE_EV_WOODPLATE_BOUND, 0x30, 0, 2, 0) -/* 0x28B5 */ DEFINE_SFX(NA_SE_EV_GORON_WATER_DROP, 0x30, 0, 0, SFX_FLAG_13) -/* 0x28B6 */ DEFINE_SFX(NA_SE_EV_JABJAB_GROAN, 0x30, 0, 0, 0) -/* 0x28B7 */ DEFINE_SFX(NA_SE_EV_DARUMA_VANISH, 0x30, 1, 0, 0) -/* 0x28B8 */ DEFINE_SFX(NA_SE_EV_BIGBALL_ROLL, 0x30, 0, 0, 0) -/* 0x28B9 */ DEFINE_SFX(NA_SE_EV_ELEVATOR_MOVE3, 0x30, 0, 0, 0) -/* 0x28BA */ DEFINE_SFX(NA_SE_EV_DIAMOND_SWITCH, 0x30, 2, 0, 0) -/* 0x28BB */ DEFINE_SFX(NA_SE_EV_FLAME_OF_FIRE, 0x30, 3, 0, 0) -/* 0x28BC */ DEFINE_SFX(NA_SE_EV_RAINBOW_SHOWER, 0x30, 0, 0, 0) -/* 0x28BD */ DEFINE_SFX(NA_SE_EV_FLYING_AIR, 0x30, 0, 0, 0) -/* 0x28BE */ DEFINE_SFX(NA_SE_EV_PASS_AIR, 0x30, 0, 0, 0) -/* 0x28BF */ DEFINE_SFX(NA_SE_EV_COME_UP_DEKU_JR, 0x30, 0, 0, 0) -/* 0x28C0 */ DEFINE_SFX(NA_SE_EV_SAND_STORM, 0x30, 0, 0, 0) -/* 0x28C1 */ DEFINE_SFX(NA_SE_EV_TRIFORCE_MARK, 0x30, 0, 0, 0) -/* 0x28C2 */ DEFINE_SFX(NA_SE_EV_GRAVE_EXPLOSION, 0xA0, 3, 0, 0) -/* 0x28C3 */ DEFINE_SFX(NA_SE_EV_LURE_MOVE_W, 0x30, 0, 0, 0) -/* 0x28C4 */ DEFINE_SFX(NA_SE_EV_POT_MOVE_START, 0x30, 0, 0, 0) -/* 0x28C5 */ DEFINE_SFX(NA_SE_EV_DIVE_INTO_WATER_L, 0x30, 0, 0, 0) -/* 0x28C6 */ DEFINE_SFX(NA_SE_EV_OUT_OF_WATER_L, 0x30, 0, 0, 0) -/* 0x28C7 */ DEFINE_SFX(NA_SE_EV_GANON_MANTLE, 0x30, 0, 0, 0) -/* 0x28C8 */ DEFINE_SFX(NA_SE_EV_DIG_UP, 0x30, 0, 0, 0) -/* 0x28C9 */ DEFINE_SFX(NA_SE_EV_WOOD_BOUND, 0x30, 0, 0, 0) -/* 0x28CA */ DEFINE_SFX(NA_SE_EV_WATER_BUBBLE, 0x30, 0, 3, 0) -/* 0x28CB */ DEFINE_SFX(NA_SE_EV_ICE_BROKEN, 0x30, 2, 0, 0) -/* 0x28CC */ DEFINE_SFX(NA_SE_EV_FROG_GROW_UP, 0x30, 2, 0, 0) -/* 0x28CD */ DEFINE_SFX(NA_SE_EV_WATER_CONVECTION, 0x30, 0, 0, 0) -/* 0x28CE */ DEFINE_SFX(NA_SE_EV_GROUND_GATE_OPEN, 0x30, 3, 0, 0) -/* 0x28CF */ DEFINE_SFX(NA_SE_EV_FACE_BREAKDOWN, 0x30, 3, 0, 0) -/* 0x28D0 */ DEFINE_SFX(NA_SE_EV_FACE_EXPLOSION, 0x30, 0, 0, 0) -/* 0x28D1 */ DEFINE_SFX(NA_SE_EV_FACE_CRUMBLE_SLOW, 0x30, 3, 2, SFX_FLAG_14) -/* 0x28D2 */ DEFINE_SFX(NA_SE_EV_ROUND_TRAP_MOVE, 0x30, 0, 0, 0) -/* 0x28D3 */ DEFINE_SFX(NA_SE_EV_HIT_SOUND, 0x30, 0, 0, 0) -/* 0x28D4 */ DEFINE_SFX(NA_SE_EV_ICE_SWING, 0x30, 0, 0, 0) -/* 0x28D5 */ DEFINE_SFX(NA_SE_EV_DOWN_TO_GROUND, 0x30, 0, 0, 0) -/* 0x28D6 */ DEFINE_SFX(NA_SE_EV_KENJA_ENVIROMENT_0, 0x30, 0, 0, 0) -/* 0x28D7 */ DEFINE_SFX(NA_SE_EV_KENJA_ENVIROMENT_1, 0x30, 0, 0, 0) -/* 0x28D8 */ DEFINE_SFX(NA_SE_EV_SMALL_DOG_BARK, 0x80, 0, 0, 0) -/* 0x28D9 */ DEFINE_SFX(NA_SE_EV_ZELDA_POWER, 0x60, 0, 0, 0) -/* 0x28DA */ DEFINE_SFX(NA_SE_EV_RAIN, 0x90, 0, 0, 0) -/* 0x28DB */ DEFINE_SFX(NA_SE_EV_IRON_DOOR_OPEN, 0x30, 0, 0, 0) -/* 0x28DC */ DEFINE_SFX(NA_SE_EV_IRON_DOOR_CLOSE, 0x30, 0, 0, 0) -/* 0x28DD */ DEFINE_SFX(NA_SE_EV_WHIRLPOOL, 0x30, 0, 0, 0) -/* 0x28DE */ DEFINE_SFX(NA_SE_EV_TOWER_PARTS_BROKEN, 0x60, 3, 3, 0) -/* 0x28DF */ DEFINE_SFX(NA_SE_EV_COW_CRY, 0x30, 0, 0, 0) -/* 0x28E0 */ DEFINE_SFX(NA_SE_EV_METAL_BOX_BOUND, 0x30, 0, 0, 0) -/* 0x28E1 */ DEFINE_SFX(NA_SE_EV_ELECTRIC_EXPLOSION, 0x30, 3, 0, 0) -/* 0x28E2 */ DEFINE_SFX(NA_SE_EV_HEAVY_THROW, 0x30, 3, 0, 0) -/* 0x28E3 */ DEFINE_SFX(NA_SE_EV_FROG_CRY_0, 0x30, 0, 0, 0) -/* 0x28E4 */ DEFINE_SFX(NA_SE_EV_FROG_CRY_1, 0x30, 0, 0, 0) -/* 0x28E5 */ DEFINE_SFX(NA_SE_EV_COW_CRY_LV, 0x30, 0, 0, 0) -/* 0x28E6 */ DEFINE_SFX(NA_SE_EV_RONRON_DOOR_CLOSE, 0x30, 0, 0, 0) -/* 0x28E7 */ DEFINE_SFX(NA_SE_EV_BUTTERFRY_TO_FAIRY, 0x30, 0, 0, 0) -/* 0x28E8 */ DEFINE_SFX(NA_SE_EV_FIVE_COUNT_LUPY, 0xA0, 0, 0, SFX_FLAG_11) -/* 0x28E9 */ DEFINE_SFX(NA_SE_EV_STONE_GROW_UP, 0x30, 0, 0, 0) -/* 0x28EA */ DEFINE_SFX(NA_SE_EV_STONE_LAUNCH, 0x30, 0, 0, 0) -/* 0x28EB */ DEFINE_SFX(NA_SE_EV_STONE_ROLLING, 0x30, 0, 0, 0) -/* 0x28EC */ DEFINE_SFX(NA_SE_EV_TOGE_STICK_ROLLING, 0x30, 2, 0, 0) -/* 0x28ED */ DEFINE_SFX(NA_SE_EV_TOWER_ENERGY, 0x30, 0, 0, 0) -/* 0x28EE */ DEFINE_SFX(NA_SE_EV_TOWER_BARRIER, 0x30, 3, 0, 0) -/* 0x28EF */ DEFINE_SFX(NA_SE_EV_CHIBI_WALK, 0x20, 0, 0, 0) -/* 0x28F0 */ DEFINE_SFX(NA_SE_EV_KNIGHT_WALK, 0x30, 0, 0, 0) -/* 0x28F1 */ DEFINE_SFX(NA_SE_EV_PILLAR_MOVE_STOP, 0x30, 0, 0, 0) -/* 0x28F2 */ DEFINE_SFX(NA_SE_EV_ERUPTION_CLOUD, 0x30, 0, 0, 0) -/* 0x28F3 */ DEFINE_SFX(NA_SE_EV_LINK_WARP_OUT_LV, 0x30, 0, 0, 0) -/* 0x28F4 */ DEFINE_SFX(NA_SE_EV_LINK_WARP_IN, 0x30, 0, 0, 0) -/* 0x28F5 */ DEFINE_SFX(NA_SE_EV_OCARINA_BMELO_0, 0x30, 0, 0, 0) -/* 0x28F6 */ DEFINE_SFX(NA_SE_EV_OCARINA_BMELO_1, 0x30, 0, 0, 0) -/* 0x28F7 */ DEFINE_SFX(NA_SE_EV_EXPLOSION_FOR_RENZOKU, 0x30, 0, 0, 0) +/* 0x2800 */ DEFINE_SFX(CHAN_18CA, NA_SE_EV_DOOR_OPEN, 0x70, 0, 1, SFX_FLAG_10 | SFX_FLAG_9) +/* 0x2801 */ DEFINE_SFX(CHAN_18D9, NA_SE_EV_DOOR_CLOSE, 0x80, 0, 1, 0) +/* 0x2802 */ DEFINE_SFX(CHAN_18E5, NA_SE_EV_EXPLOSION, 0x30, 0, 0, 0) +/* 0x2803 */ DEFINE_SFX(CHAN_18F6, NA_SE_EV_HORSE_WALK, 0x30, 0, 1, 0) +/* 0x2804 */ DEFINE_SFX(CHAN_1900, NA_SE_EV_HORSE_RUN, 0x30, 0, 1, 0) +/* 0x2805 */ DEFINE_SFX(CHAN_190A, NA_SE_EV_HORSE_NEIGH, 0x40, 0, 1, 0) +/* 0x2806 */ DEFINE_SFX(CHAN_1915, NA_SE_EV_RIVER_STREAM, 0x30, 0, 2, SFX_FLAG_10) +/* 0x2807 */ DEFINE_SFX(CHAN_1929, NA_SE_EV_WATER_WALL_BIG, 0x38, 2, 0, 0) +/* 0x2808 */ DEFINE_SFX(CHAN_1945, NA_SE_EV_OUT_OF_WATER, 0x30, 0, 1, 0) +/* 0x2809 */ DEFINE_SFX(CHAN_1959, NA_SE_EV_DIVE_WATER, 0x30, 0, 1, 0) +/* 0x280A */ DEFINE_SFX(CHAN_196B, NA_SE_EV_ROCK_SLIDE, 0x80, 2, 0, 0) +/* 0x280B */ DEFINE_SFX(CHAN_197E, NA_SE_EV_MAGMA_LEVEL, 0xA0, 3, 0, 0) +/* 0x280C */ DEFINE_SFX(CHAN_198F, NA_SE_EV_BRIDGE_OPEN, 0x30, 3, 0, 0) +/* 0x280D */ DEFINE_SFX(CHAN_19C3, NA_SE_EV_BRIDGE_CLOSE, 0x30, 3, 0, 0) +/* 0x280E */ DEFINE_SFX(CHAN_19F7, NA_SE_EV_BRIDGE_OPEN_STOP, 0x30, 3, 0, 0) +/* 0x280F */ DEFINE_SFX(CHAN_1A0E, NA_SE_EV_BRIDGE_CLOSE_STOP, 0x30, 3, 0, 0) +/* 0x2810 */ DEFINE_SFX(CHAN_1A25, NA_SE_EV_WALL_BROKEN, 0x30, 2, 0, 0) +/* 0x2811 */ DEFINE_SFX(CHAN_1A4C, NA_SE_EV_CHICKEN_CRY_N, 0x30, 0, 1, 0) +/* 0x2812 */ DEFINE_SFX(CHAN_1A5B, NA_SE_EV_CHICKEN_CRY_A, 0x30, 0, 1, 0) +/* 0x2813 */ DEFINE_SFX(CHAN_1A73, NA_SE_EV_CHICKEN_CRY_M, 0x30, 0, 0, 0) +/* 0x2814 */ DEFINE_SFX(CHAN_1A7E, NA_SE_EV_SLIDE_DOOR_OPEN, 0x60, 0, 0, 0) +/* 0x2815 */ DEFINE_SFX(CHAN_1A8F, NA_SE_EV_FOOT_SWITCH, 0x30, 3, 0, 0) +/* 0x2816 */ DEFINE_SFX(CHAN_1AB3, NA_SE_EV_HORSE_GROAN, 0x30, 0, 0, 0) +/* 0x2817 */ DEFINE_SFX(CHAN_1ACA, NA_SE_EV_BOMB_DROP_WATER, 0x30, 2, 2, 0) +/* 0x2818 */ DEFINE_SFX(CHAN_1AD6, NA_SE_EV_HORSE_JUMP, 0x30, 0, 0, 0) +/* 0x2819 */ DEFINE_SFX(CHAN_1AE3, NA_SE_EV_HORSE_LAND, 0x40, 0, 0, 0) +/* 0x281A */ DEFINE_SFX(CHAN_1AF0, NA_SE_EV_HORSE_SLIP, 0x38, 0, 0, 0) +/* 0x281B */ DEFINE_SFX(CHAN_1B01, NA_SE_EV_FAIRY_DASH, 0x28, 0, 0, 0) +/* 0x281C */ DEFINE_SFX(CHAN_1B14, NA_SE_EV_SLIDE_DOOR_CLOSE, 0x60, 0, 0, 0) +/* 0x281D */ DEFINE_SFX(CHAN_1B25, NA_SE_EV_STONE_BOUND, 0x70, 3, 0, 0) +/* 0x281E */ DEFINE_SFX(CHAN_1B47, NA_SE_EV_STONE_STATUE_OPEN, 0x30, 3, 0, 0) +/* 0x281F */ DEFINE_SFX(CHAN_1B61, NA_SE_EV_TBOX_UNLOCK, 0x30, 0, 0, 0) +/* 0x2820 */ DEFINE_SFX(CHAN_1B7D, NA_SE_EV_TBOX_OPEN, 0x30, 0, 0, 0) +/* 0x2821 */ DEFINE_SFX(CHAN_1B93, NA_SE_SY_TIMER, 0xA0, 0, 0, SFX_FLAG_13 | SFX_FLAG_3) +#if OOT_VERSION < PAL_1_0 || PLATFORM_GC +/* 0x2822 */ DEFINE_SFX(CHAN_1BE9, NA_SE_EV_FLAME_IGNITION, 0x20, 2, 0, 0) +#else +/* 0x2822 */ DEFINE_SFX(CHAN_1BE9, NA_SE_EV_FLAME_IGNITION, 0x2D, 2, 0, 0) +#endif +/* 0x2823 */ DEFINE_SFX(CHAN_1BF9, NA_SE_EV_SPEAR_HIT, 0x30, 0, 0, 0) +/* 0x2824 */ DEFINE_SFX(CHAN_1C14, NA_SE_EV_ELEVATOR_MOVE, 0x30, 0, 0, SFX_FLAG_11) +/* 0x2825 */ DEFINE_SFX(CHAN_1C2E, NA_SE_EV_WARP_HOLE, 0x30, 0, 0, SFX_FLAG_15 | SFX_FLAG_11) +/* 0x2826 */ DEFINE_SFX(CHAN_1C9E, NA_SE_EV_LINK_WARP, 0x30, 0, 0, SFX_FLAG_15) +/* 0x2827 */ DEFINE_SFX(CHAN_1CFE, NA_SE_EV_PILLAR_SINK, 0x30, 2, 0, 0) +/* 0x2828 */ DEFINE_SFX(CHAN_1D77, NA_SE_EV_WATER_WALL, 0x30, 0, 0, 0) +/* 0x2829 */ DEFINE_SFX(CHAN_1D8D, NA_SE_EV_RIVER_STREAM_S, 0x30, 0, 0, 0) +/* 0x282A */ DEFINE_SFX(CHAN_1DA1, NA_SE_EV_RIVER_STREAM_F, 0x30, 0, 0, 0) +/* 0x282B */ DEFINE_SFX(CHAN_1DB5, NA_SE_EV_HORSE_LAND2, 0x30, 0, 0, 0) +/* 0x282C */ DEFINE_SFX(CHAN_1DBF, NA_SE_EV_HORSE_SANDDUST, 0x30, 0, 0, SFX_FLAG_10) +/* 0x282D */ DEFINE_SFX(CHAN_1DD0, NA_SE_EV_DUMMY45, 0x30, 0, 0, 0) +/* 0x282E */ DEFINE_SFX(CHAN_1DEE, NA_SE_EV_LIGHTNING, 0x30, 0, 0, 0) +/* 0x282F */ DEFINE_SFX(CHAN_1E10, NA_SE_EV_BOMB_BOUND, 0x30, 0, 2, 0) +/* 0x2830 */ DEFINE_SFX(CHAN_1E26, NA_SE_EV_WATERDROP, 0x60, 2, 1, 0) +/* 0x2831 */ DEFINE_SFX(CHAN_1EAB, NA_SE_EV_TORCH, 0x10, 0, 0, 0) +/* 0x2832 */ DEFINE_SFX(CHAN_1EBA, NA_SE_EV_MAGMA_LEVEL_M, 0xA0, 3, 0, 0) +/* 0x2833 */ DEFINE_SFX(CHAN_1EEC, NA_SE_EV_FIRE_PILLAR, 0x30, 0, 0, 0) +/* 0x2834 */ DEFINE_SFX(CHAN_1EFF, NA_SE_EV_FIRE_PLATE, 0x30, 0, 0, SFX_FLAG_4) +/* 0x2835 */ DEFINE_SFX(CHAN_1F16, NA_SE_EV_BLOCK_BOUND, 0x30, 3, 0, 0) +/* 0x2836 */ DEFINE_SFX(CHAN_1F27, NA_SE_EV_METALDOOR_SLIDE, 0x30, 0, 0, 0) +/* 0x2837 */ DEFINE_SFX(CHAN_1F3D, NA_SE_EV_METALDOOR_STOP, 0x30, 0, 0, 0) +/* 0x2838 */ DEFINE_SFX(CHAN_1F4B, NA_SE_EV_BLOCK_SHAKE, 0x30, 0, 0, 0) +/* 0x2839 */ DEFINE_SFX(CHAN_1F65, NA_SE_EV_BOX_BREAK, 0x30, 2, 0, 0) +/* 0x283A */ DEFINE_SFX(CHAN_1F91, NA_SE_EV_HAMMER_SWITCH, 0x30, 0, 0, 0) +/* 0x283B */ DEFINE_SFX(CHAN_1FAB, NA_SE_EV_MAGMA_LEVEL_L, 0xA0, 3, 0, 0) +/* 0x283C */ DEFINE_SFX(CHAN_1FDD, NA_SE_EV_SPEAR_FENCE, 0x30, 0, 0, 0) +/* 0x283D */ DEFINE_SFX(CHAN_1FFD, NA_SE_EV_GANON_HORSE_NEIGH, 0x30, 0, 0, SFX_FLAG_10) +/* 0x283E */ DEFINE_SFX(CHAN_200F, NA_SE_EV_GANON_HORSE_GROAN, 0x30, 0, 0, SFX_FLAG_10) +/* 0x283F */ DEFINE_SFX(CHAN_2026, NA_SE_EV_FANTOM_WARP_S, 0x70, 3, 0, SFX_FLAG_4) +/* 0x2840 */ DEFINE_SFX(CHAN_207E, NA_SE_EV_FANTOM_WARP_L, 0x60, 0, 0, SFX_FLAG_15) +/* 0x2841 */ DEFINE_SFX(CHAN_20B5, NA_SE_EV_FOUNTAIN, 0x30, 0, 0, SFX_FLAG_15) +/* 0x2842 */ DEFINE_SFX(CHAN_20CB, NA_SE_EV_KID_HORSE_WALK, 0x30, 0, 0, 0) +/* 0x2843 */ DEFINE_SFX(CHAN_20D7, NA_SE_EV_KID_HORSE_RUN, 0x30, 0, 0, 0) +/* 0x2844 */ DEFINE_SFX(CHAN_20E1, NA_SE_EV_KID_HORSE_NEIGH, 0x30, 0, 0, 0) +/* 0x2845 */ DEFINE_SFX(CHAN_20EC, NA_SE_EV_KID_HORSE_GROAN, 0x30, 0, 0, 0) +/* 0x2846 */ DEFINE_SFX(CHAN_20F5, NA_SE_EV_WHITE_OUT, 0x30, 3, 0, SFX_FLAG_13) +/* 0x2847 */ DEFINE_SFX(CHAN_2118, NA_SE_EV_LIGHT_GATHER, 0x30, 0, 0, 0) +/* 0x2848 */ DEFINE_SFX(CHAN_2156, NA_SE_EV_TREE_CUT, 0x30, 0, 0, 0) +/* 0x2849 */ DEFINE_SFX(CHAN_2177, NA_SE_EV_VOLCANO, 0x30, 0, 0, SFX_FLAG_13 | SFX_FLAG_4) +/* 0x284A */ DEFINE_SFX(CHAN_21C0, NA_SE_EV_GUILLOTINE_UP, 0x30, 0, 0, 0) +/* 0x284B */ DEFINE_SFX(CHAN_21D7, NA_SE_EV_GUILLOTINE_BOUND, 0x30, 0, 0, 0) +/* 0x284C */ DEFINE_SFX(CHAN_21FC, NA_SE_EV_ROLLCUTTER_MOTOR, 0x30, 0, 0, 0) +/* 0x284D */ DEFINE_SFX(CHAN_220D, NA_SE_EV_CHINETRAP_DOWN, 0x30, 0, 0, 0) +/* 0x284E */ DEFINE_SFX(CHAN_2225, NA_SE_EV_PLANT_BROKEN, 0x30, 1, 0, 0) +/* 0x284F */ DEFINE_SFX(CHAN_2240, NA_SE_EV_SHIP_BELL, 0x30, 0, 0, 0) +/* 0x2850 */ DEFINE_SFX(CHAN_2261, NA_SE_EV_FLUTTER_FLAG, 0x30, 0, 0, 0) +/* 0x2851 */ DEFINE_SFX(CHAN_229D, NA_SE_EV_TRAP_BOUND, 0x40, 0, 0, 0) +/* 0x2852 */ DEFINE_SFX(CHAN_22A4, NA_SE_EV_ROCK_BROKEN, 0x30, 2, 3, 0) +/* 0x2853 */ DEFINE_SFX(CHAN_22BC, NA_SE_EV_FANTOM_WARP_S2, 0x70, 2, 0, 0) +/* 0x2854 */ DEFINE_SFX(CHAN_22D0, NA_SE_EV_FANTOM_WARP_L2, 0x60, 2, 0, 0) +/* 0x2855 */ DEFINE_SFX(CHAN_22E6, NA_SE_EV_COFFIN_CAP_OPEN, 0x30, 0, 0, 0) +/* 0x2856 */ DEFINE_SFX(CHAN_22F5, NA_SE_EV_COFFIN_CAP_BOUND, 0x60, 1, 0, 0) +/* 0x2857 */ DEFINE_SFX(CHAN_2302, NA_SE_EV_WIND_TRAP, 0x30, 2, 0, 0) +/* 0x2858 */ DEFINE_SFX(CHAN_231C, NA_SE_EV_TRAP_OBJ_SLIDE, 0x30, 0, 0, 0) +/* 0x2859 */ DEFINE_SFX(CHAN_2332, NA_SE_EV_METALDOOR_OPEN, 0x90, 3, 0, 0) +/* 0x285A */ DEFINE_SFX(CHAN_2340, NA_SE_EV_METALDOOR_CLOSE, 0x90, 3, 0, 0) +/* 0x285B */ DEFINE_SFX(CHAN_234E, NA_SE_EV_BURN_OUT, 0x30, 0, 0, 0) +/* 0x285C */ DEFINE_SFX(CHAN_2374, NA_SE_EV_BLOCKSINK, 0x30, 2, 0, 0) +/* 0x285D */ DEFINE_SFX(CHAN_2389, NA_SE_EV_CROWD, 0x30, 0, 0, SFX_FLAG_13 | SFX_FLAG_12 | SFX_FLAG_11) +/* 0x285E */ DEFINE_SFX(CHAN_23A6, NA_SE_EV_WATER_LEVEL_DOWN, 0x30, 0, 0, 0) +#if OOT_VERSION < PAL_1_0 || PLATFORM_GC +/* 0x285F */ DEFINE_SFX(CHAN_23D5, NA_SE_EV_NAVY_VANISH, 0x30, 0, 0, 0) +#else +/* 0x285F */ DEFINE_SFX(CHAN_23D5, NA_SE_EV_NAVY_VANISH, 0x2C, 0, 0, 0) +#endif +/* 0x2860 */ DEFINE_SFX(CHAN_23EB, NA_SE_EV_LADDER_DOUND, 0x30, 3, 0, 0) +/* 0x2861 */ DEFINE_SFX(CHAN_2401, NA_SE_EV_WEB_VIBRATION, 0x30, 0, 0, 0) +/* 0x2862 */ DEFINE_SFX(CHAN_2416, NA_SE_EV_WEB_BROKEN, 0x30, 0, 0, 0) +/* 0x2863 */ DEFINE_SFX(CHAN_243A, NA_SE_EV_ROLL_STAND, 0x30, 3, 0, 0) +/* 0x2864 */ DEFINE_SFX(CHAN_245F, NA_SE_EV_BUYODOOR_OPEN, 0x30, 0, 0, 0) +/* 0x2865 */ DEFINE_SFX(CHAN_2480, NA_SE_EV_BUYODOOR_CLOSE, 0x30, 0, 0, 0) +/* 0x2866 */ DEFINE_SFX(CHAN_24A1, NA_SE_EV_WOODDOOR_OPEN, 0x30, 0, 0, 0) +/* 0x2867 */ DEFINE_SFX(CHAN_24AD, NA_SE_EV_METALGATE_OPEN, 0x30, 0, 0, 0) +/* 0x2868 */ DEFINE_SFX(CHAN_24BD, NA_SE_IT_SCOOP_UP_WATER, 0x30, 0, 0, 0) +/* 0x2869 */ DEFINE_SFX(CHAN_24CB, NA_SE_EV_FISH_LEAP, 0x30, 0, 0, 0) +/* 0x286A */ DEFINE_SFX(CHAN_24DF, NA_SE_EV_KAKASHI_SWING, 0x30, 0, 0, 0) +/* 0x286B */ DEFINE_SFX(CHAN_24F0, NA_SE_EV_KAKASHI_ROLL, 0x30, 0, 0, 0) +/* 0x286C */ DEFINE_SFX(CHAN_2502, NA_SE_EV_BOTTLE_CAP_OPEN, 0x30, 0, 0, 0) +/* 0x286D */ DEFINE_SFX(CHAN_250E, NA_SE_EV_JABJAB_BREATHE, 0x30, 3, 0, SFX_FLAG_11) +/* 0x286E */ DEFINE_SFX(CHAN_2531, NA_SE_EV_SPIRIT_STONE, 0x30, 0, 0, 0) +/* 0x286F */ DEFINE_SFX(CHAN_2554, NA_SE_EV_TRIFORCE_FLASH, 0x30, 3, 0, 0) +/* 0x2870 */ DEFINE_SFX(CHAN_256B, NA_SE_EV_FALL_DOWN_DIRT, 0x30, 0, 0, 0) +/* 0x2871 */ DEFINE_SFX(CHAN_2582, NA_SE_EV_NAVY_FLY, 0x30, 0, 0, 0) +/* 0x2872 */ DEFINE_SFX(CHAN_2597, NA_SE_EV_NAVY_CRASH, 0x30, 0, 0, 0) +/* 0x2873 */ DEFINE_SFX(CHAN_25C6, NA_SE_EV_WOOD_HIT, 0x30, 0, 0, 0) +/* 0x2874 */ DEFINE_SFX(CHAN_25D4, NA_SE_EV_SCOOPUP_WATER, 0x30, 0, 0, 0) +/* 0x2875 */ DEFINE_SFX(CHAN_25FF, NA_SE_EV_DROP_FALL, 0x30, 0, 0, 0) +/* 0x2876 */ DEFINE_SFX(CHAN_2619, NA_SE_EV_WOOD_GEAR, 0x30, 2, 0, 0) +/* 0x2877 */ DEFINE_SFX(CHAN_262A, NA_SE_EV_TREE_SWING, 0x30, 0, 0, 0) +/* 0x2878 */ DEFINE_SFX(CHAN_264B, NA_SE_EV_HORSE_RUN_LEVEL, 0x30, 0, 0, 0) +/* 0x2879 */ DEFINE_SFX(CHAN_2656, NA_SE_EV_ELEVATOR_MOVE2, 0x30, 2, 0, 0) +/* 0x287A */ DEFINE_SFX(CHAN_2667, NA_SE_EV_ELEVATOR_STOP, 0x30, 2, 0, 0) +/* 0x287B */ DEFINE_SFX(CHAN_2691, NA_SE_EV_TRE_BOX_APPEAR, 0x30, 2, 0, 0) +/* 0x287C */ DEFINE_SFX(CHAN_26CF, NA_SE_EV_CHAIN_KEY_UNLOCK, 0x40, 0, 0, 0) +/* 0x287D */ DEFINE_SFX(CHAN_26E9, NA_SE_EV_SPINE_TRAP_MOVE, 0x1C, 0, 0, 0) +/* 0x287E */ DEFINE_SFX(CHAN_2700, NA_SE_EV_HEALING, 0x30, 0, 0, 0) +/* 0x287F */ DEFINE_SFX(CHAN_272F, NA_SE_EV_GREAT_FAIRY_APPEAR, 0x30, 0, 0, 0) +/* 0x2880 */ DEFINE_SFX(CHAN_274E, NA_SE_EV_GREAT_FAIRY_VANISH, 0x30, 0, 0, 0) +/* 0x2881 */ DEFINE_SFX(CHAN_2752, NA_SE_EV_RED_EYE, 0x30, 0, 0, 0) +/* 0x2882 */ DEFINE_SFX(CHAN_2764, NA_SE_EV_ROLL_STAND_2, 0x30, 0, 0, 0) +/* 0x2883 */ DEFINE_SFX(CHAN_2776, NA_SE_EV_WALL_SLIDE, 0x30, 0, 0, 0) +/* 0x2884 */ DEFINE_SFX(CHAN_278C, NA_SE_EV_TRE_BOX_FLASH, 0x30, 0, 0, 0) +/* 0x2885 */ DEFINE_SFX(CHAN_279F, NA_SE_EV_WINDMILL_LEVEL, 0x60, 0, 0, SFX_FLAG_9) +/* 0x2886 */ DEFINE_SFX(CHAN_27B0, NA_SE_EV_GOTO_HEAVEN, 0x30, 0, 0, SFX_FLAG_11) +/* 0x2887 */ DEFINE_SFX(CHAN_27DD, NA_SE_EV_POT_BROKEN, 0x30, 0, 0, 0) +/* 0x2888 */ DEFINE_SFX(CHAN_27F0, NA_SE_PL_PUT_DOWN_POT, 0x30, 0, 0, 0) +/* 0x2889 */ DEFINE_SFX(CHAN_06CD, NA_SE_EV_DIVE_INTO_WATER, 0x30, 0, 0, 0) +/* 0x288A */ DEFINE_SFX(CHAN_06E1, NA_SE_EV_JUMP_OUT_WATER, 0x30, 0, 0, 0) +/* 0x288B */ DEFINE_SFX(CHAN_27FC, NA_SE_EV_GOD_FLYING, 0x30, 3, 0, 0) +/* 0x288C */ DEFINE_SFX(CHAN_2829, NA_SE_EV_TRIFORCE, 0x30, 0, 0, 0) +/* 0x288D */ DEFINE_SFX(CHAN_2848, NA_SE_EV_AURORA, 0x30, 0, 0, 0) +/* 0x288E */ DEFINE_SFX(CHAN_2862, NA_SE_EV_DEKU_DEATH, 0x30, 0, 0, 0) +/* 0x288F */ DEFINE_SFX(CHAN_288B, NA_SE_EV_BUYOSTAND_RISING, 0x30, 3, 0, 0) +/* 0x2890 */ DEFINE_SFX(CHAN_28B4, NA_SE_EV_BUYOSTAND_FALL, 0x30, 3, 0, 0) +/* 0x2891 */ DEFINE_SFX(CHAN_28BC, NA_SE_EV_BUYOSHUTTER_OPEN, 0x30, 0, 0, SFX_FLAG_13) +/* 0x2892 */ DEFINE_SFX(CHAN_28DC, NA_SE_EV_BUYOSHUTTER_CLOSE, 0x30, 0, 0, SFX_FLAG_13) +/* 0x2893 */ DEFINE_SFX(CHAN_28E0, NA_SE_EV_STONEDOOR_STOP, 0x30, 3, 0, 0) +/* 0x2894 */ DEFINE_SFX(CHAN_28E7, NA_SE_EV_S_STONE_REVIVAL, 0x30, 0, 0, 0) +/* 0x2895 */ DEFINE_SFX(CHAN_2933, NA_SE_EV_MEDAL_APPEAR_S, 0x30, 0, 0, 0) +/* 0x2896 */ DEFINE_SFX(CHAN_2951, NA_SE_EV_HUMAN_BOUND, 0x30, 0, 2, 0) +/* 0x2897 */ DEFINE_SFX(CHAN_296A, NA_SE_EV_MEDAL_APPEAR_L, 0x30, 0, 0, 0) +/* 0x2898 */ DEFINE_SFX(CHAN_298E, NA_SE_EV_EARTHQUAKE, 0x30, 0, 0, 0) +/* 0x2899 */ DEFINE_SFX(CHAN_29C5, NA_SE_EV_SHUT_BY_CRYSTAL, 0x30, 0, 0, 0) +/* 0x289A */ DEFINE_SFX(CHAN_29F0, NA_SE_EV_GOD_LIGHTBALL_2, 0x30, 0, 0, 0) +/* 0x289B */ DEFINE_SFX(CHAN_2A15, NA_SE_EV_RUN_AROUND, 0x30, 0, 0, 0) +/* 0x289C */ DEFINE_SFX(CHAN_2A15, NA_SE_EV_CONSENTRATION, 0x30, 0, 0, SFX_FLAG_11) +/* 0x289D */ DEFINE_SFX(CHAN_2A5C, NA_SE_EV_TIMETRIP_LIGHT, 0x30, 0, 0, SFX_FLAG_11) +/* 0x289E */ DEFINE_SFX(CHAN_2A97, NA_SE_EV_BUYOSTAND_STOP_A, 0x30, 2, 0, 0) +/* 0x289F */ DEFINE_SFX(CHAN_2AB2, NA_SE_EV_BUYOSTAND_STOP_U, 0x30, 3, 0, 0) +/* 0x28A0 */ DEFINE_SFX(CHAN_2ACC, NA_SE_EV_OBJECT_FALL, 0x30, 0, 0, 0) +/* 0x28A1 */ DEFINE_SFX(CHAN_2AE4, NA_SE_EV_JUMP_CONC, 0x30, 0, 0, 0) +/* 0x28A2 */ DEFINE_SFX(CHAN_2AEB, NA_SE_EV_ICE_MELT, 0x30, 0, 0, 0) +/* 0x28A3 */ DEFINE_SFX(CHAN_2B10, NA_SE_EV_FIRE_PILLAR_S, 0x30, 0, 0, 0) +/* 0x28A4 */ DEFINE_SFX(CHAN_2B14, NA_SE_EV_BLOCK_RISING, 0x20, 3, 0, 0) +/* 0x28A5 */ DEFINE_SFX(CHAN_2B2A, NA_SE_EV_NABALL_VANISH, 0x30, 0, 0, 0) +/* 0x28A6 */ DEFINE_SFX(CHAN_2B49, NA_SE_EV_SARIA_MELODY, 0x30, 0, 0, SFX_FLAG_15) +/* 0x28A7 */ DEFINE_SFX(CHAN_2B61, NA_SE_EV_LINK_WARP_OUT, 0x30, 0, 0, 0) +/* 0x28A8 */ DEFINE_SFX(CHAN_2B75, NA_SE_EV_FIATY_HEAL, 0x30, 0, 0, 0) +/* 0x28A9 */ DEFINE_SFX(CHAN_2BB0, NA_SE_EV_CHAIN_KEY_UNLOCK_B, 0x30, 0, 0, 0) +/* 0x28AA */ DEFINE_SFX(CHAN_2BD2, NA_SE_EV_WOODBOX_BREAK, 0x30, 2, 0, 0) +/* 0x28AB */ DEFINE_SFX(CHAN_2BE1, NA_SE_EV_PUT_DOWN_WOODBOX, 0x30, 0, 0, 0) +/* 0x28AC */ DEFINE_SFX(CHAN_2BEE, NA_SE_EV_LAND_DIRT, 0x30, 0, 0, 0) +/* 0x28AD */ DEFINE_SFX(CHAN_2BF5, NA_SE_EV_FLOOR_ROLLING, 0x30, 0, 0, 0) +/* 0x28AE */ DEFINE_SFX(CHAN_2BFE, NA_SE_EV_DOG_CRY_EVENING, 0x30, 0, 0, 0) +/* 0x28AF */ DEFINE_SFX(CHAN_2C0D, NA_SE_EV_JABJAB_HICCUP, 0x30, 0, 0, 0) +/* 0x28B0 */ DEFINE_SFX(CHAN_0F8D, NA_SE_EV_NALE_MAGIC, 0x30, 0, 0, 0) +/* 0x28B1 */ DEFINE_SFX(CHAN_2C19, NA_SE_EV_FROG_JUMP, 0x30, 0, 0, 0) +/* 0x28B2 */ DEFINE_SFX(CHAN_2C38, NA_SE_EV_ICE_FREEZE, 0x30, 3, 0, 0) +/* 0x28B3 */ DEFINE_SFX(CHAN_2C54, NA_SE_EV_BURNING, 0x60, 3, 0, 0) +/* 0x28B4 */ DEFINE_SFX(CHAN_2C75, NA_SE_EV_WOODPLATE_BOUND, 0x30, 0, 2, 0) +/* 0x28B5 */ DEFINE_SFX(CHAN_2C85, NA_SE_EV_GORON_WATER_DROP, 0x30, 0, 0, SFX_FLAG_13) +/* 0x28B6 */ DEFINE_SFX(CHAN_2C99, NA_SE_EV_JABJAB_GROAN, 0x30, 0, 0, 0) +/* 0x28B7 */ DEFINE_SFX(CHAN_2CAF, NA_SE_EV_DARUMA_VANISH, 0x30, 1, 0, 0) +/* 0x28B8 */ DEFINE_SFX(CHAN_2CBB, NA_SE_EV_BIGBALL_ROLL, 0x30, 0, 0, 0) +/* 0x28B9 */ DEFINE_SFX(CHAN_2CD6, NA_SE_EV_ELEVATOR_MOVE3, 0x30, 0, 0, 0) +/* 0x28BA */ DEFINE_SFX(CHAN_2CF0, NA_SE_EV_DIAMOND_SWITCH, 0x30, 2, 0, 0) +/* 0x28BB */ DEFINE_SFX(CHAN_2CF6, NA_SE_EV_FLAME_OF_FIRE, 0x30, 3, 0, 0) +/* 0x28BC */ DEFINE_SFX(CHAN_2CFE, NA_SE_EV_RAINBOW_SHOWER, 0x30, 0, 0, 0) +/* 0x28BD */ DEFINE_SFX(CHAN_2D13, NA_SE_EV_FLYING_AIR, 0x30, 0, 0, 0) +/* 0x28BE */ DEFINE_SFX(CHAN_2D36, NA_SE_EV_PASS_AIR, 0x30, 0, 0, 0) +/* 0x28BF */ DEFINE_SFX(CHAN_2D4E, NA_SE_EV_COME_UP_DEKU_JR, 0x30, 0, 0, 0) +/* 0x28C0 */ DEFINE_SFX(CHAN_2D63, NA_SE_EV_SAND_STORM, 0x30, 0, 0, 0) +/* 0x28C1 */ DEFINE_SFX(CHAN_2D85, NA_SE_EV_TRIFORCE_MARK, 0x30, 0, 0, 0) +/* 0x28C2 */ DEFINE_SFX(CHAN_2D9D, NA_SE_EV_GRAVE_EXPLOSION, 0xA0, 3, 0, 0) +/* 0x28C3 */ DEFINE_SFX(CHAN_06F2, NA_SE_EV_LURE_MOVE_W, 0x30, 0, 0, 0) +/* 0x28C4 */ DEFINE_SFX(CHAN_0989, NA_SE_EV_POT_MOVE_START, 0x30, 0, 0, 0) +/* 0x28C5 */ DEFINE_SFX(CHAN_2DA9, NA_SE_EV_DIVE_INTO_WATER_L, 0x30, 0, 0, 0) +/* 0x28C6 */ DEFINE_SFX(CHAN_2DAD, NA_SE_EV_OUT_OF_WATER_L, 0x30, 0, 0, 0) +/* 0x28C7 */ DEFINE_SFX(CHAN_2DC3, NA_SE_EV_GANON_MANTLE, 0x30, 0, 0, 0) +/* 0x28C8 */ DEFINE_SFX(CHAN_2DD1, NA_SE_EV_DIG_UP, 0x30, 0, 0, 0) +/* 0x28C9 */ DEFINE_SFX(CHAN_2BDE, NA_SE_EV_WOOD_BOUND, 0x30, 0, 0, 0) +/* 0x28CA */ DEFINE_SFX(CHAN_2DD8, NA_SE_EV_WATER_BUBBLE, 0x30, 0, 3, 0) +/* 0x28CB */ DEFINE_SFX(CHAN_2DE4, NA_SE_EV_ICE_BROKEN, 0x30, 2, 0, 0) +/* 0x28CC */ DEFINE_SFX(CHAN_2DFC, NA_SE_EV_FROG_GROW_UP, 0x30, 2, 0, 0) +/* 0x28CD */ DEFINE_SFX(CHAN_2E14, NA_SE_EV_WATER_CONVECTION, 0x30, 0, 0, 0) +/* 0x28CE */ DEFINE_SFX(CHAN_2E1D, NA_SE_EV_GROUND_GATE_OPEN, 0x30, 3, 0, 0) +/* 0x28CF */ DEFINE_SFX(CHAN_2E29, NA_SE_EV_FACE_BREAKDOWN, 0x30, 3, 0, 0) +/* 0x28D0 */ DEFINE_SFX(CHAN_2E30, NA_SE_EV_FACE_EXPLOSION, 0x30, 0, 0, 0) +/* 0x28D1 */ DEFINE_SFX(CHAN_2E37, NA_SE_EV_FACE_CRUMBLE_SLOW, 0x30, 3, 2, SFX_FLAG_14) +/* 0x28D2 */ DEFINE_SFX(CHAN_2E3E, NA_SE_EV_ROUND_TRAP_MOVE, 0x30, 0, 0, 0) +/* 0x28D3 */ DEFINE_SFX(CHAN_5C64, NA_SE_EV_HIT_SOUND, 0x30, 0, 0, 0) +/* 0x28D4 */ DEFINE_SFX(CHAN_2E4F, NA_SE_EV_ICE_SWING, 0x30, 0, 0, 0) +/* 0x28D5 */ DEFINE_SFX(CHAN_2E5B, NA_SE_EV_DOWN_TO_GROUND, 0x30, 0, 0, 0) +/* 0x28D6 */ DEFINE_SFX(CHAN_2E60, NA_SE_EV_KENJA_ENVIROMENT_0, 0x30, 0, 0, 0) +/* 0x28D7 */ DEFINE_SFX(CHAN_2E6E, NA_SE_EV_KENJA_ENVIROMENT_1, 0x30, 0, 0, 0) +/* 0x28D8 */ DEFINE_SFX(CHAN_2E86, NA_SE_EV_SMALL_DOG_BARK, 0x80, 0, 0, 0) +/* 0x28D9 */ DEFINE_SFX(CHAN_2E92, NA_SE_EV_ZELDA_POWER, 0x60, 0, 0, 0) +/* 0x28DA */ DEFINE_SFX(CHAN_2EB6, NA_SE_EV_RAIN, 0x90, 0, 0, 0) +/* 0x28DB */ DEFINE_SFX(CHAN_2ECF, NA_SE_EV_IRON_DOOR_OPEN, 0x30, 0, 0, 0) +/* 0x28DC */ DEFINE_SFX(CHAN_2EDB, NA_SE_EV_IRON_DOOR_CLOSE, 0x30, 0, 0, 0) +/* 0x28DD */ DEFINE_SFX(CHAN_2EE7, NA_SE_EV_WHIRLPOOL, 0x30, 0, 0, 0) +/* 0x28DE */ DEFINE_SFX(CHAN_2EEE, NA_SE_EV_TOWER_PARTS_BROKEN, 0x60, 3, 3, 0) +/* 0x28DF */ DEFINE_SFX(CHAN_2F1A, NA_SE_EV_COW_CRY, 0x30, 0, 0, 0) +/* 0x28E0 */ DEFINE_SFX(CHAN_2F26, NA_SE_EV_METAL_BOX_BOUND, 0x30, 0, 0, 0) +/* 0x28E1 */ DEFINE_SFX(CHAN_2F43, NA_SE_EV_ELECTRIC_EXPLOSION, 0x30, 3, 0, 0) +/* 0x28E2 */ DEFINE_SFX(CHAN_2D4E, NA_SE_EV_HEAVY_THROW, 0x30, 3, 0, 0) +/* 0x28E3 */ DEFINE_SFX(CHAN_2F4A, NA_SE_EV_FROG_CRY_0, 0x30, 0, 0, 0) +/* 0x28E4 */ DEFINE_SFX(CHAN_2F60, NA_SE_EV_FROG_CRY_1, 0x30, 0, 0, 0) +/* 0x28E5 */ DEFINE_SFX(CHAN_2F76, NA_SE_EV_COW_CRY_LV, 0x30, 0, 0, 0) +/* 0x28E6 */ DEFINE_SFX(CHAN_2FB8, NA_SE_EV_RONRON_DOOR_CLOSE, 0x30, 0, 0, 0) +/* 0x28E7 */ DEFINE_SFX(CHAN_2FC5, NA_SE_EV_BUTTERFRY_TO_FAIRY, 0x30, 0, 0, 0) +/* 0x28E8 */ DEFINE_SFX(CHAN_5E6B, NA_SE_EV_FIVE_COUNT_LUPY, 0xA0, 0, 0, SFX_FLAG_11) +/* 0x28E9 */ DEFINE_SFX(CHAN_2FEA, NA_SE_EV_STONE_GROW_UP, 0x30, 0, 0, 0) +/* 0x28EA */ DEFINE_SFX(CHAN_2FFC, NA_SE_EV_STONE_LAUNCH, 0x30, 0, 0, 0) +/* 0x28EB */ DEFINE_SFX(CHAN_1B14, NA_SE_EV_STONE_ROLLING, 0x30, 0, 0, 0) +/* 0x28EC */ DEFINE_SFX(CHAN_3002, NA_SE_EV_TOGE_STICK_ROLLING, 0x30, 2, 0, 0) +/* 0x28ED */ DEFINE_SFX(CHAN_300F, NA_SE_EV_TOWER_ENERGY, 0x30, 0, 0, 0) +/* 0x28EE */ DEFINE_SFX(CHAN_303C, NA_SE_EV_TOWER_BARRIER, 0x30, 3, 0, 0) +/* 0x28EF */ DEFINE_SFX(CHAN_3081, NA_SE_EV_CHIBI_WALK, 0x20, 0, 0, 0) +/* 0x28F0 */ DEFINE_SFX(CHAN_308F, NA_SE_EV_KNIGHT_WALK, 0x30, 0, 0, 0) +/* 0x28F1 */ DEFINE_SFX(CHAN_30AB, NA_SE_EV_PILLAR_MOVE_STOP, 0x30, 0, 0, 0) +/* 0x28F2 */ DEFINE_SFX(CHAN_2D4E, NA_SE_EV_ERUPTION_CLOUD, 0x30, 0, 0, 0) +/* 0x28F3 */ DEFINE_SFX(CHAN_2F4A, NA_SE_EV_LINK_WARP_OUT_LV, 0x30, 0, 0, 0) +/* 0x28F4 */ DEFINE_SFX(CHAN_2F60, NA_SE_EV_LINK_WARP_IN, 0x30, 0, 0, 0) +/* 0x28F5 */ DEFINE_SFX(CHAN_2F76, NA_SE_EV_OCARINA_BMELO_0, 0x30, 0, 0, 0) +/* 0x28F6 */ DEFINE_SFX(CHAN_2FB8, NA_SE_EV_OCARINA_BMELO_1, 0x30, 0, 0, 0) +/* 0x28F7 */ DEFINE_SFX(CHAN_2FC5, NA_SE_EV_EXPLOSION_FOR_RENZOKU, 0x30, 0, 0, 0) diff --git a/include/tables/sfx/itembank_table.h b/include/tables/sfx/itembank_table.h index 91c074496c..ed2001a557 100644 --- a/include/tables/sfx/itembank_table.h +++ b/include/tables/sfx/itembank_table.h @@ -2,91 +2,94 @@ * Sfx Item Bank * * DEFINE_SFX should be used for all sfx define in the item bank from sequence 0 + * - Argument 0: Channel name for sequence 0 * - Argument 1: Enum value for this sfx * - Argument 2: Importance for deciding which sfx to prioritize. Higher values have greater importance * - Argument 3: Slows the decay of volume with distance (a 2-bit number ranging from 0-3) * - Argument 4: Applies increasingly random offsets to frequency (a 2-bit number ranging from 0-3) * - Argument 5: Various flags to add properties to the sfx - * - * WARNING: entries must align with the table defined for the item bank in sequence 0 */ -/* 0x1800 */ DEFINE_SFX(NA_SE_IT_SWORD_IMPACT, 0x30, 0, 1, SFX_FLAG_15) -/* 0x1801 */ DEFINE_SFX(NA_SE_IT_SWORD_SWING, 0x30, 0, 1, 0) -/* 0x1802 */ DEFINE_SFX(NA_SE_IT_SWORD_PUTAWAY, 0x30, 0, 0, 0) -/* 0x1803 */ DEFINE_SFX(NA_SE_IT_SWORD_PICKOUT, 0x30, 0, 0, 0) -/* 0x1804 */ DEFINE_SFX(NA_SE_IT_ARROW_SHOT, 0x30, 0, 1, SFX_FLAG_10) -/* 0x1805 */ DEFINE_SFX(NA_SE_IT_BOOMERANG_THROW, 0x30, 0, 1, SFX_FLAG_10) -/* 0x1806 */ DEFINE_SFX(NA_SE_IT_SHIELD_BOUND, 0x60, 3, 2, 0) -/* 0x1807 */ DEFINE_SFX(NA_SE_IT_BOW_DRAW, 0x30, 0, 1, SFX_FLAG_10) -/* 0x1808 */ DEFINE_SFX(NA_SE_IT_SHIELD_REFLECT_SW, 0x80, 3, 1, 0) -/* 0x1809 */ DEFINE_SFX(NA_SE_IT_ARROW_STICK_HRAD, 0x30, 0, 0, 0) -/* 0x180A */ DEFINE_SFX(NA_SE_IT_HAMMER_HIT, 0x30, 0, 1, 0) -/* 0x180B */ DEFINE_SFX(NA_SE_IT_HOOKSHOT_CHAIN, 0x30, 0, 0, SFX_FLAG_10) -/* 0x180C */ DEFINE_SFX(NA_SE_IT_SHIELD_REFLECT_MG, 0x30, 1, 0, SFX_FLAG_10) -/* 0x180D */ DEFINE_SFX(NA_SE_IT_BOMB_IGNIT, 0x50, 0, 0, 0) -/* 0x180E */ DEFINE_SFX(NA_SE_IT_BOMB_EXPLOSION, 0x90, 2, 0, 0) -/* 0x180F */ DEFINE_SFX(NA_SE_IT_BOMB_UNEXPLOSION, 0x50, 2, 0, 0) -/* 0x1810 */ DEFINE_SFX(NA_SE_IT_BOOMERANG_FLY, 0x30, 0, 0, SFX_FLAG_10) -/* 0x1811 */ DEFINE_SFX(NA_SE_IT_SWORD_STRIKE, 0x40, 2, 0, 0) -/* 0x1812 */ DEFINE_SFX(NA_SE_IT_HAMMER_SWING, 0x30, 0, 1, 0) -/* 0x1813 */ DEFINE_SFX(NA_SE_IT_HOOKSHOT_REFLECT, 0x30, 0, 0, 0) -/* 0x1814 */ DEFINE_SFX(NA_SE_IT_ARROW_STICK_CRE, 0x30, 0, 0, 0) -/* 0x1815 */ DEFINE_SFX(NA_SE_IT_ARROW_STICK_OBJ, 0x34, 0, 0, 0) -/* 0x1816 */ DEFINE_SFX(NA_SE_IT_DUMMY, 0x30, 0, 0, 0) -/* 0x1817 */ DEFINE_SFX(NA_SE_IT_DUMMY2, 0x30, 0, 0, 0) -/* 0x1818 */ DEFINE_SFX(NA_SE_IT_SWORD_SWING_HARD, 0x30, 0, 0, 0) -/* 0x1819 */ DEFINE_SFX(NA_SE_IT_DUMMY3, 0x30, 0, 0, 0) -/* 0x181A */ DEFINE_SFX(NA_SE_IT_WALL_HIT_HARD, 0x40, 0, 0, 0) -/* 0x181B */ DEFINE_SFX(NA_SE_IT_WALL_HIT_SOFT, 0x30, 0, 0, 0) -/* 0x181C */ DEFINE_SFX(NA_SE_IT_STONE_HIT, 0x30, 0, 0, 0) -/* 0x181D */ DEFINE_SFX(NA_SE_IT_WOODSTICK_BROKEN, 0x30, 0, 0, 0) -/* 0x181E */ DEFINE_SFX(NA_SE_IT_LASH, 0x30, 0, 2, 0) -/* 0x181F */ DEFINE_SFX(NA_SE_IT_SHIELD_POSTURE, 0x30, 0, 1, 0) -/* 0x1820 */ DEFINE_SFX(NA_SE_IT_SLING_SHOT, 0x30, 0, 0, SFX_FLAG_10) -/* 0x1821 */ DEFINE_SFX(NA_SE_IT_SLING_DRAW, 0x20, 0, 0, SFX_FLAG_10) -/* 0x1822 */ DEFINE_SFX(NA_SE_IT_SWORD_CHARGE, 0x30, 0, 0, 0) -/* 0x1823 */ DEFINE_SFX(NA_SE_IT_ROLLING_CUT, 0x30, 0, 0, 0) -/* 0x1824 */ DEFINE_SFX(NA_SE_IT_SWORD_STRIKE_HARD, 0x30, 0, 0, 0) -/* 0x1825 */ DEFINE_SFX(NA_SE_IT_SLING_REFLECT, 0x30, 0, 0, 0) -/* 0x1826 */ DEFINE_SFX(NA_SE_IT_SHIELD_REMOVE, 0x30, 0, 0, 0) -/* 0x1827 */ DEFINE_SFX(NA_SE_IT_HOOKSHOT_READY, 0x30, 0, 0, SFX_FLAG_10) -/* 0x1828 */ DEFINE_SFX(NA_SE_IT_HOOKSHOT_RECEIVE, 0x30, 0, 0, SFX_FLAG_10) -/* 0x1829 */ DEFINE_SFX(NA_SE_IT_HOOKSHOT_STICK_OBJ, 0x60, 3, 1, 0) -/* 0x182A */ DEFINE_SFX(NA_SE_IT_SWORD_REFLECT_MG, 0x30, 1, 0, 0) -/* 0x182B */ DEFINE_SFX(NA_SE_IT_DEKU, 0x30, 1, 0, SFX_FLAG_10) -/* 0x182C */ DEFINE_SFX(NA_SE_IT_WALL_HIT_BUYO, 0x30, 0, 0, 0) -/* 0x182D */ DEFINE_SFX(NA_SE_IT_SWORD_PUTAWAY_STN, 0x30, 0, 0, 0) -/* 0x182E */ DEFINE_SFX(NA_SE_IT_ROLLING_CUT_LV1, 0xA0, 2, 0, 0) -/* 0x182F */ DEFINE_SFX(NA_SE_IT_ROLLING_CUT_LV2, 0xA0, 2, 0, 0) -/* 0x1830 */ DEFINE_SFX(NA_SE_IT_BOW_FLICK, 0x30, 0, 0, SFX_FLAG_10) -/* 0x1831 */ DEFINE_SFX(NA_SE_IT_BOMBCHU_MOVE, 0x30, 0, 0, 0) -/* 0x1832 */ DEFINE_SFX(NA_SE_IT_SHIELD_CHARGE_LV1, 0x60, 0, 0, 0) -/* 0x1833 */ DEFINE_SFX(NA_SE_IT_SHIELD_CHARGE_LV2, 0x60, 0, 0, 0) -/* 0x1834 */ DEFINE_SFX(NA_SE_IT_SHIELD_CHARGE_LV3, 0x60, 0, 0, 0) -/* 0x1835 */ DEFINE_SFX(NA_SE_IT_SLING_FLICK, 0x30, 0, 0, SFX_FLAG_10) -/* 0x1836 */ DEFINE_SFX(NA_SE_IT_SWORD_STICK_STN, 0x30, 0, 0, 0) -/* 0x1837 */ DEFINE_SFX(NA_SE_IT_REFLECTION_WOOD, 0x60, 1, 2, 0) -/* 0x1838 */ DEFINE_SFX(NA_SE_IT_SHIELD_REFLECT_MG2, 0x30, 0, 0, 0) -/* 0x1839 */ DEFINE_SFX(NA_SE_IT_MAGIC_ARROW_SHOT, 0x30, 0, 0, 0) -/* 0x183A */ DEFINE_SFX(NA_SE_IT_EXPLOSION_FRAME, 0x60, 3, 0, SFX_FLAG_15) -/* 0x183B */ DEFINE_SFX(NA_SE_IT_EXPLOSION_ICE, 0x60, 3, 0, SFX_FLAG_15) -/* 0x183C */ DEFINE_SFX(NA_SE_IT_EXPLOSION_LIGHT, 0x60, 3, 0, SFX_FLAG_15) -/* 0x183D */ DEFINE_SFX(NA_SE_IT_FISHING_REEL_SLOW, 0x30, 0, 0, SFX_FLAG_14) -/* 0x183E */ DEFINE_SFX(NA_SE_IT_FISHING_REEL_HIGH, 0x30, 0, 0, SFX_FLAG_14) -/* 0x183F */ DEFINE_SFX(NA_SE_IT_PULL_FISHING_ROD, 0x30, 0, 1, 0) -/* 0x1840 */ DEFINE_SFX(NA_SE_IT_DM_FLYING_GOD_PASS, 0x80, 3, 0, 0) -/* 0x1841 */ DEFINE_SFX(NA_SE_IT_DM_FLYING_GOD_DASH, 0x80, 3, 0, 0) -/* 0x1842 */ DEFINE_SFX(NA_SE_IT_DM_RING_EXPLOSION, 0x30, 3, 0, 0) -/* 0x1843 */ DEFINE_SFX(NA_SE_IT_DM_RING_GATHER, 0x30, 0, 0, 0) -/* 0x1844 */ DEFINE_SFX(NA_SE_IT_INGO_HORSE_NEIGH, 0x30, 0, 1, 0) -/* 0x1845 */ DEFINE_SFX(NA_SE_IT_EARTHQUAKE, 0x30, 0, 0, 0) -/* 0x1846 */ DEFINE_SFX(NA_SE_IT_DUMMY4, 0x30, 0, 0, 0) -/* 0x1847 */ DEFINE_SFX(NA_SE_IT_KAKASHI_JUMP, 0x30, 0, 0, 0) -/* 0x1848 */ DEFINE_SFX(NA_SE_IT_FLAME, 0x30, 0, 0, 0) -/* 0x1849 */ DEFINE_SFX(NA_SE_IT_SHIELD_BEAM, 0x30, 0, 0, 0) -/* 0x184A */ DEFINE_SFX(NA_SE_IT_FISHING_HIT, 0x30, 0, 0, 0) -/* 0x184B */ DEFINE_SFX(NA_SE_IT_GOODS_APPEAR, 0x30, 0, 0, 0) -/* 0x184C */ DEFINE_SFX(NA_SE_IT_MAJIN_SWORD_BROKEN, 0x80, 0, 0, 0) -/* 0x184D */ DEFINE_SFX(NA_SE_IT_HAND_CLAP, 0x30, 0, 0, 0) -/* 0x184E */ DEFINE_SFX(NA_SE_IT_MASTER_SWORD_SWING, 0x30, 0, 0, 0) -/* 0x184F */ DEFINE_SFX(NA_SE_IT_DUMMY5, 0x30, 0, 0, 0) +/* 0x1800 */ DEFINE_SFX(CHAN_0F83, NA_SE_IT_SWORD_IMPACT, 0x30, 0, 1, SFX_FLAG_15) +/* 0x1801 */ DEFINE_SFX(CHAN_0F8D, NA_SE_IT_SWORD_SWING, 0x30, 0, 1, 0) +/* 0x1802 */ DEFINE_SFX(CHAN_0F9B, NA_SE_IT_SWORD_PUTAWAY, 0x30, 0, 0, 0) +/* 0x1803 */ DEFINE_SFX(CHAN_0FA5, NA_SE_IT_SWORD_PICKOUT, 0x30, 0, 0, 0) +/* 0x1804 */ DEFINE_SFX(CHAN_0FAF, NA_SE_IT_ARROW_SHOT, 0x30, 0, 1, SFX_FLAG_10) +/* 0x1805 */ DEFINE_SFX(CHAN_0FB9, NA_SE_IT_BOOMERANG_THROW, 0x30, 0, 1, SFX_FLAG_10) +/* 0x1806 */ DEFINE_SFX(CHAN_0FCB, NA_SE_IT_SHIELD_BOUND, 0x60, 3, 2, 0) +/* 0x1807 */ DEFINE_SFX(CHAN_0FDB, NA_SE_IT_BOW_DRAW, 0x30, 0, 1, SFX_FLAG_10) +/* 0x1808 */ DEFINE_SFX(CHAN_0FE9, NA_SE_IT_SHIELD_REFLECT_SW, 0x80, 3, 1, 0) +/* 0x1809 */ DEFINE_SFX(CHAN_1001, NA_SE_IT_ARROW_STICK_HRAD, 0x30, 0, 0, 0) +/* 0x180A */ DEFINE_SFX(CHAN_100B, NA_SE_IT_HAMMER_HIT, 0x30, 0, 1, 0) +/* 0x180B */ DEFINE_SFX(CHAN_1022, NA_SE_IT_HOOKSHOT_CHAIN, 0x30, 0, 0, SFX_FLAG_10) +/* 0x180C */ DEFINE_SFX(CHAN_103A, NA_SE_IT_SHIELD_REFLECT_MG, 0x30, 1, 0, SFX_FLAG_10) +/* 0x180D */ DEFINE_SFX(CHAN_106A, NA_SE_IT_BOMB_IGNIT, 0x50, 0, 0, 0) +/* 0x180E */ DEFINE_SFX(CHAN_1076, NA_SE_IT_BOMB_EXPLOSION, 0x90, 2, 0, 0) +/* 0x180F */ DEFINE_SFX(CHAN_1085, NA_SE_IT_BOMB_UNEXPLOSION, 0x50, 2, 0, 0) +/* 0x1810 */ DEFINE_SFX(CHAN_10A2, NA_SE_IT_BOOMERANG_FLY, 0x30, 0, 0, SFX_FLAG_10) +/* 0x1811 */ DEFINE_SFX(CHAN_10D2, NA_SE_IT_SWORD_STRIKE, 0x40, 2, 0, 0) +/* 0x1812 */ DEFINE_SFX(CHAN_10E6, NA_SE_IT_HAMMER_SWING, 0x30, 0, 1, 0) +#if OOT_VERSION < PAL_1_0 || PLATFORM_GC +/* 0x1813 */ DEFINE_SFX(CHAN_10F4, NA_SE_IT_HOOKSHOT_REFLECT, 0x30, 0, 0, 0) +#else +/* 0x1813 */ DEFINE_SFX(CHAN_10F4, NA_SE_IT_HOOKSHOT_REFLECT, 0x20, 0, 0, 0) +#endif +/* 0x1814 */ DEFINE_SFX(CHAN_110B, NA_SE_IT_ARROW_STICK_CRE, 0x30, 0, 0, 0) +/* 0x1815 */ DEFINE_SFX(CHAN_1120, NA_SE_IT_ARROW_STICK_OBJ, 0x34, 0, 0, 0) +/* 0x1816 */ DEFINE_SFX(CHAN_1123, NA_SE_IT_DUMMY, 0x30, 0, 0, 0) +/* 0x1817 */ DEFINE_SFX(CHAN_1146, NA_SE_IT_DUMMY2, 0x30, 0, 0, 0) +/* 0x1818 */ DEFINE_SFX(CHAN_1169, NA_SE_IT_SWORD_SWING_HARD, 0x30, 0, 0, 0) +/* 0x1819 */ DEFINE_SFX(CHAN_1E10, NA_SE_IT_DUMMY3, 0x30, 0, 0, 0) +/* 0x181A */ DEFINE_SFX(CHAN_1187, NA_SE_IT_WALL_HIT_HARD, 0x40, 0, 0, 0) +/* 0x181B */ DEFINE_SFX(CHAN_119A, NA_SE_IT_WALL_HIT_SOFT, 0x30, 0, 0, 0) +/* 0x181C */ DEFINE_SFX(CHAN_11B3, NA_SE_IT_STONE_HIT, 0x30, 0, 0, 0) +/* 0x181D */ DEFINE_SFX(CHAN_11C4, NA_SE_IT_WOODSTICK_BROKEN, 0x30, 0, 0, 0) +/* 0x181E */ DEFINE_SFX(CHAN_11D5, NA_SE_IT_LASH, 0x30, 0, 2, 0) +/* 0x181F */ DEFINE_SFX(CHAN_11E8, NA_SE_IT_SHIELD_POSTURE, 0x30, 0, 1, 0) +/* 0x1820 */ DEFINE_SFX(CHAN_1208, NA_SE_IT_SLING_SHOT, 0x30, 0, 0, SFX_FLAG_10) +/* 0x1821 */ DEFINE_SFX(CHAN_1216, NA_SE_IT_SLING_DRAW, 0x20, 0, 0, SFX_FLAG_10) +/* 0x1822 */ DEFINE_SFX(CHAN_1224, NA_SE_IT_SWORD_CHARGE, 0x30, 0, 0, 0) +/* 0x1823 */ DEFINE_SFX(CHAN_125A, NA_SE_IT_ROLLING_CUT, 0x30, 0, 0, 0) +/* 0x1824 */ DEFINE_SFX(CHAN_1271, NA_SE_IT_SWORD_STRIKE_HARD, 0x30, 0, 0, 0) +/* 0x1825 */ DEFINE_SFX(CHAN_128A, NA_SE_IT_SLING_REFLECT, 0x30, 0, 0, 0) +/* 0x1826 */ DEFINE_SFX(CHAN_12A0, NA_SE_IT_SHIELD_REMOVE, 0x30, 0, 0, 0) +/* 0x1827 */ DEFINE_SFX(CHAN_12C0, NA_SE_IT_HOOKSHOT_READY, 0x30, 0, 0, SFX_FLAG_10) +/* 0x1828 */ DEFINE_SFX(CHAN_12DA, NA_SE_IT_HOOKSHOT_RECEIVE, 0x30, 0, 0, SFX_FLAG_10) +/* 0x1829 */ DEFINE_SFX(CHAN_12F4, NA_SE_IT_HOOKSHOT_STICK_OBJ, 0x60, 3, 1, 0) +/* 0x182A */ DEFINE_SFX(CHAN_1316, NA_SE_IT_SWORD_REFLECT_MG, 0x30, 1, 0, 0) +/* 0x182B */ DEFINE_SFX(CHAN_132D, NA_SE_IT_DEKU, 0x30, 1, 0, SFX_FLAG_10) +/* 0x182C */ DEFINE_SFX(CHAN_1350, NA_SE_IT_WALL_HIT_BUYO, 0x30, 0, 0, 0) +/* 0x182D */ DEFINE_SFX(CHAN_1396, NA_SE_IT_SWORD_PUTAWAY_STN, 0x30, 0, 0, 0) +/* 0x182E */ DEFINE_SFX(CHAN_13A7, NA_SE_IT_ROLLING_CUT_LV1, 0xA0, 2, 0, 0) +/* 0x182F */ DEFINE_SFX(CHAN_13CA, NA_SE_IT_ROLLING_CUT_LV2, 0xA0, 2, 0, 0) +/* 0x1830 */ DEFINE_SFX(CHAN_13E8, NA_SE_IT_BOW_FLICK, 0x30, 0, 0, SFX_FLAG_10) +/* 0x1831 */ DEFINE_SFX(CHAN_13FE, NA_SE_IT_BOMBCHU_MOVE, 0x30, 0, 0, 0) +/* 0x1832 */ DEFINE_SFX(CHAN_1411, NA_SE_IT_SHIELD_CHARGE_LV1, 0x60, 0, 0, 0) +/* 0x1833 */ DEFINE_SFX(CHAN_145D, NA_SE_IT_SHIELD_CHARGE_LV2, 0x60, 0, 0, 0) +/* 0x1834 */ DEFINE_SFX(CHAN_1462, NA_SE_IT_SHIELD_CHARGE_LV3, 0x60, 0, 0, 0) +/* 0x1835 */ DEFINE_SFX(CHAN_1467, NA_SE_IT_SLING_FLICK, 0x30, 0, 0, SFX_FLAG_10) +/* 0x1836 */ DEFINE_SFX(CHAN_147C, NA_SE_IT_SWORD_STICK_STN, 0x30, 0, 0, 0) +/* 0x1837 */ DEFINE_SFX(CHAN_1493, NA_SE_IT_REFLECTION_WOOD, 0x60, 1, 2, 0) +/* 0x1838 */ DEFINE_SFX(CHAN_14B0, NA_SE_IT_SHIELD_REFLECT_MG2, 0x30, 0, 0, 0) +/* 0x1839 */ DEFINE_SFX(CHAN_14B9, NA_SE_IT_MAGIC_ARROW_SHOT, 0x30, 0, 0, 0) +/* 0x183A */ DEFINE_SFX(CHAN_14CA, NA_SE_IT_EXPLOSION_FRAME, 0x60, 3, 0, SFX_FLAG_15) +/* 0x183B */ DEFINE_SFX(CHAN_14E5, NA_SE_IT_EXPLOSION_ICE, 0x60, 3, 0, SFX_FLAG_15) +/* 0x183C */ DEFINE_SFX(CHAN_14F6, NA_SE_IT_EXPLOSION_LIGHT, 0x60, 3, 0, SFX_FLAG_15) +/* 0x183D */ DEFINE_SFX(CHAN_1505, NA_SE_IT_FISHING_REEL_SLOW, 0x30, 0, 0, SFX_FLAG_14) +/* 0x183E */ DEFINE_SFX(CHAN_1510, NA_SE_IT_FISHING_REEL_HIGH, 0x30, 0, 0, SFX_FLAG_14) +/* 0x183F */ DEFINE_SFX(CHAN_0FDB, NA_SE_IT_PULL_FISHING_ROD, 0x30, 0, 1, 0) +/* 0x1840 */ DEFINE_SFX(CHAN_151B, NA_SE_IT_DM_FLYING_GOD_PASS, 0x80, 3, 0, 0) +/* 0x1841 */ DEFINE_SFX(CHAN_154A, NA_SE_IT_DM_FLYING_GOD_DASH, 0x80, 3, 0, 0) +/* 0x1842 */ DEFINE_SFX(CHAN_157D, NA_SE_IT_DM_RING_EXPLOSION, 0x30, 3, 0, 0) +/* 0x1843 */ DEFINE_SFX(CHAN_15BB, NA_SE_IT_DM_RING_GATHER, 0x30, 0, 0, 0) +/* 0x1844 */ DEFINE_SFX(CHAN_190A, NA_SE_IT_INGO_HORSE_NEIGH, 0x30, 0, 1, 0) +/* 0x1845 */ DEFINE_SFX(CHAN_15BB, NA_SE_IT_EARTHQUAKE, 0x30, 0, 0, 0) +/* 0x1846 */ DEFINE_SFX(CHAN_15D0, NA_SE_IT_DUMMY4, 0x30, 0, 0, 0) +/* 0x1847 */ DEFINE_SFX(CHAN_15DF, NA_SE_IT_KAKASHI_JUMP, 0x30, 0, 0, 0) +/* 0x1848 */ DEFINE_SFX(CHAN_15F3, NA_SE_IT_FLAME, 0x30, 0, 0, 0) +/* 0x1849 */ DEFINE_SFX(CHAN_2848, NA_SE_IT_SHIELD_BEAM, 0x30, 0, 0, 0) +/* 0x184A */ DEFINE_SFX(CHAN_15FA, NA_SE_IT_FISHING_HIT, 0x30, 0, 0, 0) +/* 0x184B */ DEFINE_SFX(CHAN_1617, NA_SE_IT_GOODS_APPEAR, 0x30, 0, 0, 0) +/* 0x184C */ DEFINE_SFX(CHAN_1624, NA_SE_IT_MAJIN_SWORD_BROKEN, 0x80, 0, 0, 0) +/* 0x184D */ DEFINE_SFX(CHAN_163E, NA_SE_IT_HAND_CLAP, 0x30, 0, 0, 0) +/* 0x184E */ DEFINE_SFX(CHAN_1648, NA_SE_IT_MASTER_SWORD_SWING, 0x30, 0, 0, 0) +/* 0x184F */ DEFINE_SFX(CHAN_1085, NA_SE_IT_DUMMY5, 0x30, 0, 0, 0) diff --git a/include/tables/sfx/ocarinabank_table.h b/include/tables/sfx/ocarinabank_table.h index d10944fab7..42448dd9e1 100644 --- a/include/tables/sfx/ocarinabank_table.h +++ b/include/tables/sfx/ocarinabank_table.h @@ -2,19 +2,18 @@ * Sfx Ocarina Bank * * DEFINE_SFX should be used for all sfx define in the ocarina bank from sequence 0 + * - Argument 0: Channel name for sequence 0 * - Argument 1: Enum value for this sfx * - Argument 2: Importance for deciding which sfx to prioritize. Higher values have greater importance * - Argument 3: Slows the decay of volume with distance (a 2-bit number ranging from 0-3) * - Argument 4: Applies increasingly random offsets to frequency (a 2-bit number ranging from 0-3) * - Argument 5: Various flags to add properties to the sfx - * - * WARNING: entries must align with the table defined for the ocarina bank in sequence 0 */ -/* 0x5800 */ DEFINE_SFX(NA_SE_OC_OCARINA, 0x30, 0, 0, 0) -/* 0x5801 */ DEFINE_SFX(NA_SE_OC_ABYSS, 0x30, 0, 0, SFX_FLAG_5) -/* 0x5802 */ DEFINE_SFX(NA_SE_OC_DOOR_OPEN, 0x30, 2, 1, SFX_FLAG_10 | SFX_FLAG_9) -/* 0x5803 */ DEFINE_SFX(NA_SE_OC_SECRET_WARP_IN, 0x30, 0, 0, 0) -/* 0x5804 */ DEFINE_SFX(NA_SE_OC_SECRET_WARP_OUT, 0x30, 0, 0, 0) -/* 0x5805 */ DEFINE_SFX(NA_SE_OC_SECRET_HOLE_OUT, 0x30, 0, 0, 0) -/* 0x5806 */ DEFINE_SFX(NA_SE_OC_REVENGE, 0x30, 0, 0, 0) -/* 0x5807 */ DEFINE_SFX(NA_SE_OC_HINT_MOVIE, 0x30, 0, 0, 0) +/* 0x5800 */ DEFINE_SFX(CHAN_5EF5, NA_SE_OC_OCARINA, 0x30, 0, 0, 0) +/* 0x5801 */ DEFINE_SFX(CHAN_5F69, NA_SE_OC_ABYSS, 0x30, 0, 0, SFX_FLAG_5) +/* 0x5802 */ DEFINE_SFX(CHAN_18C5, NA_SE_OC_DOOR_OPEN, 0x30, 2, 1, SFX_FLAG_10 | SFX_FLAG_9) +/* 0x5803 */ DEFINE_SFX(CHAN_5F65, NA_SE_OC_SECRET_WARP_IN, 0x30, 0, 0, 0) +/* 0x5804 */ DEFINE_SFX(CHAN_5F40, NA_SE_OC_SECRET_WARP_OUT, 0x30, 0, 0, 0) +/* 0x5805 */ DEFINE_SFX(CHAN_27AE, NA_SE_OC_SECRET_HOLE_OUT, 0x30, 0, 0, 0) +/* 0x5806 */ DEFINE_SFX(CHAN_5F96, NA_SE_OC_REVENGE, 0x30, 0, 0, 0) +/* 0x5807 */ DEFINE_SFX(CHAN_5EF5, NA_SE_OC_HINT_MOVIE, 0x30, 0, 0, 0) diff --git a/include/tables/sfx/playerbank_table.h b/include/tables/sfx/playerbank_table.h index 128ba0c48b..efe161f908 100644 --- a/include/tables/sfx/playerbank_table.h +++ b/include/tables/sfx/playerbank_table.h @@ -2,235 +2,234 @@ * Sfx Player Bank * * DEFINE_SFX should be used for all sfx define in the player bank from sequence 0 + * - Argument 0: Channel name for sequence 0 * - Argument 1: Enum value for this sfx * - Argument 2: Importance for deciding which sfx to prioritize. Higher values have greater importance * - Argument 3: Slows the decay of volume with distance (a 2-bit number ranging from 0-3) * - Argument 4: Applies increasingly random offsets to frequency (a 2-bit number ranging from 0-3) * - Argument 5: Various flags to add properties to the sfx - * - * WARNING: entries must align with the table defined for the player bank in sequence 0 */ -/* 0x800 */ DEFINE_SFX(NA_SE_PL_WALK_GROUND, 0x20, 0, 2, SFX_FLAG_10) -/* 0x801 */ DEFINE_SFX(NA_SE_PL_WALK_SAND, 0x20, 0, 2, SFX_FLAG_10) -/* 0x802 */ DEFINE_SFX(NA_SE_PL_WALK_CONCRETE, 0x20, 0, 2, SFX_FLAG_10) -/* 0x803 */ DEFINE_SFX(NA_SE_PL_WALK_DIRT, 0x20, 0, 2, SFX_FLAG_10) -/* 0x804 */ DEFINE_SFX(NA_SE_PL_WALK_WATER0, 0x20, 0, 1, SFX_FLAG_10) -/* 0x805 */ DEFINE_SFX(NA_SE_PL_WALK_WATER1, 0x20, 0, 1, SFX_FLAG_10) -/* 0x806 */ DEFINE_SFX(NA_SE_PL_WALK_WATER2, 0x20, 0, 1, SFX_FLAG_10) -/* 0x807 */ DEFINE_SFX(NA_SE_PL_WALK_MAGMA, 0x20, 0, 1, SFX_FLAG_10) -/* 0x808 */ DEFINE_SFX(NA_SE_PL_WALK_GRASS, 0x20, 0, 2, SFX_FLAG_10) -/* 0x809 */ DEFINE_SFX(NA_SE_PL_WALK_IRON, 0x20, 0, 1, SFX_FLAG_10) -/* 0x80A */ DEFINE_SFX(NA_SE_PL_WALK_LADDER, 0x20, 0, 2, SFX_FLAG_10) -/* 0x80B */ DEFINE_SFX(NA_SE_PL_WALK_GLASS, 0x20, 0, 0, SFX_FLAG_10) -/* 0x80C */ DEFINE_SFX(NA_SE_PL_WALK_WALL, 0x20, 0, 0, SFX_FLAG_10) -/* 0x80D */ DEFINE_SFX(NA_SE_PL_WALK_HEAVYBOOTS, 0x20, 0, 0, SFX_FLAG_10) -/* 0x80E */ DEFINE_SFX(NA_SE_PL_DUMMY_14, 0x20, 0, 0, SFX_FLAG_10) -/* 0x80F */ DEFINE_SFX(NA_SE_PL_WALK_ICE, 0x20, 0, 0, SFX_FLAG_10) -/* 0x810 */ DEFINE_SFX(NA_SE_PL_JUMP, 0x30, 0, 0, SFX_FLAG_10) -/* 0x811 */ DEFINE_SFX(NA_SE_PL_JUMP_SAND, 0x30, 0, 0, SFX_FLAG_10) -/* 0x812 */ DEFINE_SFX(NA_SE_PL_JUMP_CONCRETE, 0x30, 0, 0, SFX_FLAG_10) -/* 0x813 */ DEFINE_SFX(NA_SE_PL_JUMP_DIRT, 0x30, 0, 0, SFX_FLAG_10) -/* 0x814 */ DEFINE_SFX(NA_SE_PL_JUMP_WATER0, 0x30, 0, 0, SFX_FLAG_10) -/* 0x815 */ DEFINE_SFX(NA_SE_PL_JUMP_WATER1, 0x30, 0, 0, SFX_FLAG_10) -/* 0x816 */ DEFINE_SFX(NA_SE_PL_JUMP_WATER2, 0x30, 0, 0, SFX_FLAG_10) -/* 0x817 */ DEFINE_SFX(NA_SE_PL_JUMP_MAGMA, 0x30, 0, 0, SFX_FLAG_10) -/* 0x818 */ DEFINE_SFX(NA_SE_PL_JUMP_GRASS, 0x30, 0, 0, SFX_FLAG_10) -/* 0x819 */ DEFINE_SFX(NA_SE_PL_JUMP_IRON, 0x30, 0, 0, SFX_FLAG_10) -/* 0x81A */ DEFINE_SFX(NA_SE_PL_JUMP_LADDER, 0x30, 0, 0, SFX_FLAG_10) -/* 0x81B */ DEFINE_SFX(NA_SE_PL_JUMP_GLASS, 0x30, 0, 0, SFX_FLAG_10) -/* 0x81C */ DEFINE_SFX(NA_SE_PL_DUMMY28, 0x30, 0, 0, SFX_FLAG_10) -/* 0x81D */ DEFINE_SFX(NA_SE_PL_JUMP_HEAVYBOOTS, 0x30, 0, 0, SFX_FLAG_10) -/* 0x81E */ DEFINE_SFX(NA_SE_PL_DUMMY30, 0x30, 0, 0, SFX_FLAG_10) -/* 0x81F */ DEFINE_SFX(NA_SE_PL_JUMP_ICE, 0x30, 0, 0, SFX_FLAG_10) -/* 0x820 */ DEFINE_SFX(NA_SE_PL_LAND, 0x40, 0, 1, SFX_FLAG_10) -/* 0x821 */ DEFINE_SFX(NA_SE_PL_LAND_SAND, 0x40, 0, 1, SFX_FLAG_10) -/* 0x822 */ DEFINE_SFX(NA_SE_PL_LAND_CONCRETE, 0x40, 0, 1, SFX_FLAG_10) -/* 0x823 */ DEFINE_SFX(NA_SE_PL_LAND_DIRT, 0x40, 0, 1, SFX_FLAG_10) -/* 0x824 */ DEFINE_SFX(NA_SE_PL_LAND_WATER0, 0x40, 0, 1, SFX_FLAG_10) -/* 0x825 */ DEFINE_SFX(NA_SE_PL_LAND_WATER1, 0x40, 0, 1, SFX_FLAG_10) -/* 0x826 */ DEFINE_SFX(NA_SE_PL_LAND_WATER2, 0x40, 0, 1, SFX_FLAG_10) -/* 0x827 */ DEFINE_SFX(NA_SE_PL_LAND_MAGMA, 0x40, 0, 1, SFX_FLAG_10) -/* 0x828 */ DEFINE_SFX(NA_SE_PL_LAND_GRASS, 0x40, 0, 1, SFX_FLAG_10) -/* 0x829 */ DEFINE_SFX(NA_SE_PL_LAND_IRON, 0x40, 0, 1, SFX_FLAG_10) -/* 0x82A */ DEFINE_SFX(NA_SE_PL_LAND_LADDER, 0x40, 0, 1, SFX_FLAG_10) -/* 0x82B */ DEFINE_SFX(NA_SE_PL_LAND_GLASS, 0x40, 0, 1, SFX_FLAG_10) -/* 0x82C */ DEFINE_SFX(NA_SE_PL_DUMMY_44, 0x40, 0, 1, SFX_FLAG_10) -/* 0x82D */ DEFINE_SFX(NA_SE_PL_LAND_HEAVYBOOTS, 0x40, 0, 1, SFX_FLAG_10) -/* 0x82E */ DEFINE_SFX(NA_SE_PL_DUMMY_46, 0x40, 0, 1, SFX_FLAG_10) -/* 0x82F */ DEFINE_SFX(NA_SE_PL_LAND_ICE, 0x40, 0, 1, SFX_FLAG_10) -/* 0x830 */ DEFINE_SFX(NA_SE_PL_SLIPDOWN, 0x30, 0, 2, 0) -/* 0x831 */ DEFINE_SFX(NA_SE_PL_CLIMB_CLIFF, 0x30, 0, 0, 0) -/* 0x832 */ DEFINE_SFX(NA_SE_PL_SIT_ON_HORSE, 0x30, 0, 0, 0) -/* 0x833 */ DEFINE_SFX(NA_SE_PL_GET_OFF_HORSE, 0x30, 0, 0, 0) -/* 0x834 */ DEFINE_SFX(NA_SE_PL_TAKE_OUT_SHIELD, 0x30, 0, 0, SFX_FLAG_10) -/* 0x835 */ DEFINE_SFX(NA_SE_PL_CHANGE_ARMS, 0x30, 0, 0, SFX_FLAG_10) -/* 0x836 */ DEFINE_SFX(NA_SE_PL_CATCH_BOOMERANG, 0x30, 0, 0, SFX_FLAG_10) -/* 0x837 */ DEFINE_SFX(NA_SE_PL_DUMMY_55, 0x30, 0, 1, 0) -/* 0x838 */ DEFINE_SFX(NA_SE_PL_DUMMY_56, 0x30, 0, 1, 0) -/* 0x839 */ DEFINE_SFX(NA_SE_PL_SWIM, 0x30, 0, 2, 0) -/* 0x83A */ DEFINE_SFX(NA_SE_PL_THROW, 0x30, 0, 0, SFX_FLAG_10) -/* 0x83B */ DEFINE_SFX(NA_SE_PL_BODY_BOUND, 0x30, 0, 0, SFX_FLAG_10) -/* 0x83C */ DEFINE_SFX(NA_SE_PL_ROLL, 0x40, 0, 0, SFX_FLAG_10) -/* 0x83D */ DEFINE_SFX(NA_SE_PL_SKIP, 0x30, 0, 0, SFX_FLAG_10) -/* 0x83E */ DEFINE_SFX(NA_SE_PL_BODY_HIT, 0x30, 2, 0, SFX_FLAG_10) -/* 0x83F */ DEFINE_SFX(NA_SE_PL_DAMAGE, 0x30, 0, 0, SFX_FLAG_10) -/* 0x840 */ DEFINE_SFX(NA_SE_PL_SLIP, 0x30, 0, 1, 0) -/* 0x841 */ DEFINE_SFX(NA_SE_PL_SLIP_SAND, 0x30, 0, 1, 0) -/* 0x842 */ DEFINE_SFX(NA_SE_PL_SLIP_CONCRETE, 0x30, 0, 1, 0) -/* 0x843 */ DEFINE_SFX(NA_SE_PL_SLIP_DIRT, 0x30, 0, 1, 0) -/* 0x844 */ DEFINE_SFX(NA_SE_PL_SLIP_WATER0, 0x30, 0, 1, 0) -/* 0x845 */ DEFINE_SFX(NA_SE_PL_SLIP_WATER1, 0x30, 0, 1, 0) -/* 0x846 */ DEFINE_SFX(NA_SE_PL_SLIP_WATER2, 0x30, 0, 1, 0) -/* 0x847 */ DEFINE_SFX(NA_SE_PL_SLIP_MAGMA, 0x30, 0, 1, 0) -/* 0x848 */ DEFINE_SFX(NA_SE_PL_SLIP_GRASS, 0x30, 0, 1, 0) -/* 0x849 */ DEFINE_SFX(NA_SE_PL_SLIP_IRON, 0x30, 0, 1, 0) -/* 0x84A */ DEFINE_SFX(NA_SE_PL_SLIP_LADDER, 0x30, 0, 1, 0) -/* 0x84B */ DEFINE_SFX(NA_SE_PL_SLIP_GLASS, 0x30, 0, 1, 0) -/* 0x84C */ DEFINE_SFX(NA_SE_PL_DUMMY76, 0x30, 0, 0, 0) -/* 0x84D */ DEFINE_SFX(NA_SE_PL_SLIP_HEAVYBOOTS, 0x30, 0, 0, 0) -/* 0x84E */ DEFINE_SFX(NA_SE_PL_DUMMY78, 0x30, 0, 0, 0) -/* 0x84F */ DEFINE_SFX(NA_SE_PL_SLIP_ICE, 0x30, 0, 0, 0) -/* 0x850 */ DEFINE_SFX(NA_SE_PL_BOUND, 0x80, 0, 0, 0) -/* 0x851 */ DEFINE_SFX(NA_SE_PL_BOUND_SAND, 0x80, 0, 0, 0) -/* 0x852 */ DEFINE_SFX(NA_SE_PL_BOUND_CONCRETE, 0x80, 0, 0, 0) -/* 0x853 */ DEFINE_SFX(NA_SE_PL_BOUND_DIRT, 0x80, 0, 0, 0) -/* 0x854 */ DEFINE_SFX(NA_SE_PL_BOUND_WATER0, 0x80, 0, 0, 0) -/* 0x855 */ DEFINE_SFX(NA_SE_PL_BOUND_WATER1, 0x80, 0, 0, 0) -/* 0x856 */ DEFINE_SFX(NA_SE_PL_BOUND_WATER2, 0x80, 0, 0, 0) -/* 0x857 */ DEFINE_SFX(NA_SE_PL_BOUND_MAGMA, 0x80, 0, 0, 0) -/* 0x858 */ DEFINE_SFX(NA_SE_PL_BOUND_GRASS, 0x80, 0, 0, 0) -/* 0x859 */ DEFINE_SFX(NA_SE_PL_BOUND_IRON, 0x80, 0, 0, 0) -/* 0x85A */ DEFINE_SFX(NA_SE_PL_BOUND_LADDER, 0x80, 0, 0, 0) -/* 0x85B */ DEFINE_SFX(NA_SE_PL_BOUND_WOOD, 0x80, 0, 0, 0) -/* 0x85C */ DEFINE_SFX(NA_SE_PL_DUMMY_92, 0x80, 0, 0, 0) -/* 0x85D */ DEFINE_SFX(NA_SE_PL_BOUND_HEAVYBOOTS, 0x80, 0, 0, 0) -/* 0x85E */ DEFINE_SFX(NA_SE_PL_DUMMY_94, 0x80, 0, 0, 0) -/* 0x85F */ DEFINE_SFX(NA_SE_PL_BOUND_ICE, 0x80, 0, 0, 0) -/* 0x860 */ DEFINE_SFX(NA_SE_PL_DUMMY_96, 0x30, 0, 0, 0) -/* 0x861 */ DEFINE_SFX(NA_SE_PL_DUMMY_97, 0x30, 0, 0, 0) -/* 0x862 */ DEFINE_SFX(NA_SE_PL_DUMMY_98, 0x30, 0, 0, 0) -/* 0x863 */ DEFINE_SFX(NA_SE_PL_FACE_UP, 0x30, 0, 0, 0) -/* 0x864 */ DEFINE_SFX(NA_SE_PL_DIVE_BUBBLE, 0x30, 0, 0, 0) -/* 0x865 */ DEFINE_SFX(NA_SE_PL_MOVE_BUBBLE, 0x30, 0, 0, 0) -/* 0x866 */ DEFINE_SFX(NA_SE_PL_METALEFFECT_KID, 0x30, 0, 0, SFX_FLAG_10) -/* 0x867 */ DEFINE_SFX(NA_SE_PL_METALEFFECT_ADULT, 0x30, 0, 0, SFX_FLAG_10) -/* 0x868 */ DEFINE_SFX(NA_SE_PL_SPARK, 0x30, 0, 0, 0) -/* 0x869 */ DEFINE_SFX(NA_SE_PL_PULL_UP_PLANT, 0x30, 0, 0, 0) -/* 0x86A */ DEFINE_SFX(NA_SE_PL_PULL_UP_ROCK, 0x30, 0, 0, 0) -/* 0x86B */ DEFINE_SFX(NA_SE_PL_IN_BUBBLE, 0x30, 0, 0, 0) -/* 0x86C */ DEFINE_SFX(NA_SE_PL_PULL_UP_BIGROCK, 0x30, 3, 0, 0) -/* 0x86D */ DEFINE_SFX(NA_SE_PL_SWORD_CHARGE, 0x30, 0, 0, 0) -/* 0x86E */ DEFINE_SFX(NA_SE_PL_FREEZE, 0x30, 0, 0, 0) -/* 0x86F */ DEFINE_SFX(NA_SE_PL_PULL_UP_POT, 0x30, 0, 0, 0) -/* 0x870 */ DEFINE_SFX(NA_SE_PL_KNOCK, 0x30, 0, 0, 0) -/* 0x871 */ DEFINE_SFX(NA_SE_PL_CALM_HIT, 0x30, 0, 2, 0) -/* 0x872 */ DEFINE_SFX(NA_SE_PL_CALM_PAT, 0x30, 0, 0, 0) -/* 0x873 */ DEFINE_SFX(NA_SE_PL_SUBMERGE, 0x30, 0, 0, 0) -/* 0x874 */ DEFINE_SFX(NA_SE_PL_FREEZE_S, 0x30, 3, 0, 0) -/* 0x875 */ DEFINE_SFX(NA_SE_PL_ICE_BROKEN, 0x30, 1, 0, 0) -/* 0x876 */ DEFINE_SFX(NA_SE_PL_SLIP_ICE_LELEL, 0x30, 0, 0, 0) -/* 0x877 */ DEFINE_SFX(NA_SE_PL_PUT_OUT_ITEM, 0x30, 0, 0, 0) -/* 0x878 */ DEFINE_SFX(NA_SE_PL_PULL_UP_WOODBOX, 0x30, 0, 0, 0) -/* 0x879 */ DEFINE_SFX(NA_SE_PL_MAGIC_FIRE, 0x30, 0, 0, 0) -/* 0x87A */ DEFINE_SFX(NA_SE_PL_MAGIC_WIND_NORMAL, 0x30, 0, 0, 0) -/* 0x87B */ DEFINE_SFX(NA_SE_PL_MAGIC_WIND_WARP, 0x30, 0, 0, SFX_FLAG_13) -/* 0x87C */ DEFINE_SFX(NA_SE_PL_MAGIC_SOUL_NORMAL, 0x30, 0, 0, SFX_FLAG_11 | SFX_FLAG_10) -/* 0x87D */ DEFINE_SFX(NA_SE_PL_ARROW_CHARGE_FIRE, 0x30, 0, 0, SFX_FLAG_10) -/* 0x87E */ DEFINE_SFX(NA_SE_PL_ARROW_CHARGE_ICE, 0x30, 0, 0, SFX_FLAG_10) -/* 0x87F */ DEFINE_SFX(NA_SE_PL_ARROW_CHARGE_LIGHT, 0x30, 0, 0, SFX_FLAG_10) -/* 0x880 */ DEFINE_SFX(NA_SE_PL_DUMMY_128, 0x20, 0, 2, 0) -/* 0x881 */ DEFINE_SFX(NA_SE_PL_DUMMY_129, 0x20, 0, 2, 0) -/* 0x882 */ DEFINE_SFX(NA_SE_PL_DUMMY_130, 0x20, 0, 2, 0) -/* 0x883 */ DEFINE_SFX(NA_SE_PL_PULL_UP_RUTO, 0x20, 0, 2, 0) -/* 0x884 */ DEFINE_SFX(NA_SE_PL_DUMMY_132, 0x20, 0, 1, 0) -/* 0x885 */ DEFINE_SFX(NA_SE_PL_DUMMY_133, 0x20, 0, 1, 0) -/* 0x886 */ DEFINE_SFX(NA_SE_PL_DUMMY_134, 0x20, 0, 1, 0) -/* 0x887 */ DEFINE_SFX(NA_SE_PL_DUMMY_135, 0x20, 0, 1, 0) -/* 0x888 */ DEFINE_SFX(NA_SE_PL_DUMMY_136, 0x20, 0, 2, 0) -/* 0x889 */ DEFINE_SFX(NA_SE_PL_DUMMY_137, 0x20, 0, 2, 0) -/* 0x88A */ DEFINE_SFX(NA_SE_PL_DUMMY_138, 0x20, 0, 2, 0) -/* 0x88B */ DEFINE_SFX(NA_SE_PL_DUMMY_139, 0x20, 0, 0, 0) -/* 0x88C */ DEFINE_SFX(NA_SE_PL_DUMMY_140, 0x20, 0, 0, 0) -/* 0x88D */ DEFINE_SFX(NA_SE_PL_DUMMY_141, 0x20, 0, 0, 0) -/* 0x88E */ DEFINE_SFX(NA_SE_PL_DUMMY_142, 0x20, 0, 0, 0) -/* 0x88F */ DEFINE_SFX(NA_SE_PL_DUMMY_143, 0x20, 0, 0, 0) -/* 0x890 */ DEFINE_SFX(NA_SE_PL_DUMMY_144, 0x30, 0, 0, 0) -/* 0x891 */ DEFINE_SFX(NA_SE_PL_DUMMY_145, 0x30, 0, 0, 0) -/* 0x892 */ DEFINE_SFX(NA_SE_PL_DUMMY_146, 0x30, 0, 0, 0) -/* 0x893 */ DEFINE_SFX(NA_SE_PL_DUMMY_147, 0x30, 0, 0, 0) -/* 0x894 */ DEFINE_SFX(NA_SE_PL_DUMMY_148, 0x30, 0, 0, 0) -/* 0x895 */ DEFINE_SFX(NA_SE_PL_DUMMY_149, 0x30, 0, 0, 0) -/* 0x896 */ DEFINE_SFX(NA_SE_PL_DUMMY_150, 0x30, 0, 0, 0) -/* 0x897 */ DEFINE_SFX(NA_SE_PL_DUMMY_151, 0x30, 0, 0, 0) -/* 0x898 */ DEFINE_SFX(NA_SE_PL_DUMMY_152, 0x30, 0, 0, 0) -/* 0x899 */ DEFINE_SFX(NA_SE_PL_DUMMY_153, 0x30, 0, 0, 0) -/* 0x89A */ DEFINE_SFX(NA_SE_PL_DUMMY_154, 0x30, 0, 0, 0) -/* 0x89B */ DEFINE_SFX(NA_SE_PL_DUMMY_155, 0x30, 0, 0, 0) -/* 0x89C */ DEFINE_SFX(NA_SE_PL_DUMMY_156, 0x30, 0, 0, 0) -/* 0x89D */ DEFINE_SFX(NA_SE_PL_DUMMY_157, 0x30, 0, 0, 0) -/* 0x89E */ DEFINE_SFX(NA_SE_PL_DUMMY_158, 0x30, 0, 0, 0) -/* 0x89F */ DEFINE_SFX(NA_SE_PL_DUMMY_159, 0x30, 0, 0, 0) -/* 0x8A0 */ DEFINE_SFX(NA_SE_PL_DUMMY_160, 0x40, 0, 0, 0) -/* 0x8A1 */ DEFINE_SFX(NA_SE_PL_DUMMY_161, 0x40, 0, 0, 0) -/* 0x8A2 */ DEFINE_SFX(NA_SE_PL_DUMMY_162, 0x40, 0, 0, 0) -/* 0x8A3 */ DEFINE_SFX(NA_SE_PL_DUMMY_163, 0x40, 0, 0, 0) -/* 0x8A4 */ DEFINE_SFX(NA_SE_PL_DUMMY_164, 0x40, 0, 0, 0) -/* 0x8A5 */ DEFINE_SFX(NA_SE_PL_DUMMY_165, 0x40, 0, 0, 0) -/* 0x8A6 */ DEFINE_SFX(NA_SE_PL_DUMMY_166, 0x40, 0, 0, 0) -/* 0x8A7 */ DEFINE_SFX(NA_SE_PL_DUMMY_167, 0x40, 0, 0, 0) -/* 0x8A8 */ DEFINE_SFX(NA_SE_PL_DUMMY_168, 0x40, 0, 0, 0) -/* 0x8A9 */ DEFINE_SFX(NA_SE_PL_DUMMY_169, 0x40, 0, 0, 0) -/* 0x8AA */ DEFINE_SFX(NA_SE_PL_DUMMY_170, 0x40, 0, 0, 0) -/* 0x8AB */ DEFINE_SFX(NA_SE_PL_DUMMY_171, 0x40, 0, 0, 0) -/* 0x8AC */ DEFINE_SFX(NA_SE_PL_DUMMY_172, 0x40, 0, 0, 0) -/* 0x8AD */ DEFINE_SFX(NA_SE_PL_DUMMY_173, 0x40, 0, 0, 0) -/* 0x8AE */ DEFINE_SFX(NA_SE_PL_DUMMY_174, 0x40, 0, 0, 0) -/* 0x8AF */ DEFINE_SFX(NA_SE_PL_DUMMY_175, 0x40, 0, 0, 0) -/* 0x8B0 */ DEFINE_SFX(NA_SE_PL_CRAWL, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8B1 */ DEFINE_SFX(NA_SE_PL_CRAWL_SAND, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8B2 */ DEFINE_SFX(NA_SE_PL_CRAWL_CONCRETE, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8B3 */ DEFINE_SFX(NA_SE_PL_CRAWL_DIRT, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8B4 */ DEFINE_SFX(NA_SE_PL_CRAWL_WATER0, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8B5 */ DEFINE_SFX(NA_SE_PL_DUMMY_181, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8B6 */ DEFINE_SFX(NA_SE_PL_DUMMY_182, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8B7 */ DEFINE_SFX(NA_SE_PL_DUMMY_183, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8B8 */ DEFINE_SFX(NA_SE_PL_DUMMY_184, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8B9 */ DEFINE_SFX(NA_SE_PL_DUMMY_185, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8BA */ DEFINE_SFX(NA_SE_PL_DUMMY_186, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8BB */ DEFINE_SFX(NA_SE_PL_CRAWL_WOOD, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8BC */ DEFINE_SFX(NA_SE_PL_CRAWL_ICE, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8BD */ DEFINE_SFX(NA_SE_PL_DUMMY_189, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8BE */ DEFINE_SFX(NA_SE_PL_DUMMY_190, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8BF */ DEFINE_SFX(NA_SE_PL_DUMMY_191, 0x30, 0, 1, SFX_FLAG_10) -/* 0x8C0 */ DEFINE_SFX(NA_SE_PL_MAGIC_SOUL_FLASH, 0x30, 0, 0, SFX_FLAG_11 | SFX_FLAG_10) -/* 0x8C1 */ DEFINE_SFX(NA_SE_PL_ROLL_DUST, 0x30, 0, 2, 0) -/* 0x8C2 */ DEFINE_SFX(NA_SE_PL_DUMMY_192, 0x30, 0, 0, 0) -/* 0x8C3 */ DEFINE_SFX(NA_SE_PL_MAGIC_SOUL_BALL, 0x30, 0, 0, 0) -/* 0x8C4 */ DEFINE_SFX(NA_SE_PL_SPIRAL_HEAL_BEAM, 0x30, 0, 0, 0) -/* 0x8C5 */ DEFINE_SFX(NA_SE_PL_BOUND_NOWEAPON, 0x30, 0, 0, 0) -/* 0x8C6 */ DEFINE_SFX(NA_SE_PL_PLANT_GROW_UP, 0x30, 0, 0, 0) -/* 0x8C7 */ DEFINE_SFX(NA_SE_PL_PLANT_TALLER, 0x30, 0, 0, 0) -/* 0x8C8 */ DEFINE_SFX(NA_SE_PL_MAGIC_WIND_VANISH, 0x60, 2, 0, 0) -/* 0x8C9 */ DEFINE_SFX(NA_SE_PL_HOBBERBOOTS_LV, 0x30, 0, 0, 0) -/* 0x8CA */ DEFINE_SFX(NA_SE_PL_PLANT_MOVE, 0x30, 0, 0, 0) -/* 0x8CB */ DEFINE_SFX(NA_SE_EV_WALL_MOVE_SP, 0x30, 0, 0, SFX_FLAG_11) -/* 0x8CC */ DEFINE_SFX(NA_SE_PL_DUMMY_204, 0x30, 0, 0, 0) -/* 0x8CD */ DEFINE_SFX(NA_SE_PL_DUMMY_205, 0x30, 0, 0, 0) -/* 0x8CE */ DEFINE_SFX(NA_SE_PL_DUMMY_206, 0x30, 0, 0, 0) -/* 0x8CF */ DEFINE_SFX(NA_SE_PL_DUMMY_207, 0x30, 0, 0, 0) -/* 0x8D0 */ DEFINE_SFX(NA_SE_PL_SLIP_LEVEL, 0x30, 0, 0, 0) -/* 0x8D1 */ DEFINE_SFX(NA_SE_PL_SLIP_SAND_LEVEL, 0x30, 0, 0, 0) -/* 0x8D2 */ DEFINE_SFX(NA_SE_PL_SLIP_CONCRETE_LEVEL, 0x30, 0, 0, 0) -/* 0x8D3 */ DEFINE_SFX(NA_SE_PL_SLIP_DIRT_LEVEL, 0x30, 0, 0, 0) -/* 0x8D4 */ DEFINE_SFX(NA_SE_PL_SLIP_WATER0_LEVEL, 0x30, 0, 0, 0) -/* 0x8D5 */ DEFINE_SFX(NA_SE_PL_SLIP_WATER1_LEVEL, 0x30, 0, 0, 0) -/* 0x8D6 */ DEFINE_SFX(NA_SE_PL_SLIP_WATER2_LEVEL, 0x30, 0, 0, 0) -/* 0x8D7 */ DEFINE_SFX(NA_SE_PL_SLIP_MAGMA_LEVEL, 0x30, 0, 0, 0) -/* 0x8D8 */ DEFINE_SFX(NA_SE_PL_SLIP_GRASS_LEVEL, 0x30, 0, 0, 0) -/* 0x8D9 */ DEFINE_SFX(NA_SE_PL_SLIP_IRON_LEVEL, 0x30, 0, 0, 0) -/* 0x8DA */ DEFINE_SFX(NA_SE_PL_SLIP_GLASS_LEVEL, 0x30, 0, 0, 0) -/* 0x8DB */ DEFINE_SFX(NA_SE_PL_SLIP_WOOD_LEVEL, 0x30, 0, 0, 0) -/* 0x8DC */ DEFINE_SFX(NA_SE_PL_DUMMY_220, 0x30, 0, 0, 0) -/* 0x8DD */ DEFINE_SFX(NA_SE_PL_DUMMY_221, 0x30, 0, 0, 0) -/* 0x8DE */ DEFINE_SFX(NA_SE_PL_SLIP_HEAVYBOOTS_LEVEL, 0x30, 0, 0, 0) -/* 0x8DF */ DEFINE_SFX(NA_SE_PL_SLIP_ICE_LEVEL, 0x30, 0, 0, 0) +/* 0x800 */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_WALK_GROUND, 0x20, 0, 2, SFX_FLAG_10) +/* 0x801 */ DEFINE_SFX(CHAN_02BD, NA_SE_PL_WALK_SAND, 0x20, 0, 2, SFX_FLAG_10) +/* 0x802 */ DEFINE_SFX(CHAN_02C9, NA_SE_PL_WALK_CONCRETE, 0x20, 0, 2, SFX_FLAG_10) +/* 0x803 */ DEFINE_SFX(CHAN_02D8, NA_SE_PL_WALK_DIRT, 0x20, 0, 2, SFX_FLAG_10) +/* 0x804 */ DEFINE_SFX(CHAN_02E8, NA_SE_PL_WALK_WATER0, 0x20, 0, 1, SFX_FLAG_10) +/* 0x805 */ DEFINE_SFX(CHAN_02F4, NA_SE_PL_WALK_WATER1, 0x20, 0, 1, SFX_FLAG_10) +/* 0x806 */ DEFINE_SFX(CHAN_0300, NA_SE_PL_WALK_WATER2, 0x20, 0, 1, SFX_FLAG_10) +/* 0x807 */ DEFINE_SFX(CHAN_0313, NA_SE_PL_WALK_MAGMA, 0x20, 0, 1, SFX_FLAG_10) +/* 0x808 */ DEFINE_SFX(CHAN_032D, NA_SE_PL_WALK_GRASS, 0x20, 0, 2, SFX_FLAG_10) +/* 0x809 */ DEFINE_SFX(CHAN_033D, NA_SE_PL_WALK_IRON, 0x20, 0, 1, SFX_FLAG_10) +/* 0x80A */ DEFINE_SFX(CHAN_0349, NA_SE_PL_WALK_LADDER, 0x20, 0, 2, SFX_FLAG_10) +/* 0x80B */ DEFINE_SFX(CHAN_0355, NA_SE_PL_WALK_GLASS, 0x20, 0, 0, SFX_FLAG_10) +/* 0x80C */ DEFINE_SFX(CHAN_0361, NA_SE_PL_WALK_WALL, 0x20, 0, 0, SFX_FLAG_10) +/* 0x80D */ DEFINE_SFX(CHAN_0376, NA_SE_PL_WALK_HEAVYBOOTS, 0x20, 0, 0, SFX_FLAG_10) +/* 0x80E */ DEFINE_SFX(CHAN_0380, NA_SE_PL_DUMMY_14, 0x20, 0, 0, SFX_FLAG_10) +/* 0x80F */ DEFINE_SFX(CHAN_038A, NA_SE_PL_WALK_ICE, 0x20, 0, 0, SFX_FLAG_10) +/* 0x810 */ DEFINE_SFX(CHAN_0396, NA_SE_PL_JUMP, 0x30, 0, 0, SFX_FLAG_10) +/* 0x811 */ DEFINE_SFX(CHAN_03C5, NA_SE_PL_JUMP_SAND, 0x30, 0, 0, SFX_FLAG_10) +/* 0x812 */ DEFINE_SFX(CHAN_03D9, NA_SE_PL_JUMP_CONCRETE, 0x30, 0, 0, SFX_FLAG_10) +/* 0x813 */ DEFINE_SFX(CHAN_03F2, NA_SE_PL_JUMP_DIRT, 0x30, 0, 0, SFX_FLAG_10) +/* 0x814 */ DEFINE_SFX(CHAN_0406, NA_SE_PL_JUMP_WATER0, 0x30, 0, 0, SFX_FLAG_10) +/* 0x815 */ DEFINE_SFX(CHAN_0418, NA_SE_PL_JUMP_WATER1, 0x30, 0, 0, SFX_FLAG_10) +/* 0x816 */ DEFINE_SFX(CHAN_042A, NA_SE_PL_JUMP_WATER2, 0x30, 0, 0, SFX_FLAG_10) +/* 0x817 */ DEFINE_SFX(CHAN_0443, NA_SE_PL_JUMP_MAGMA, 0x30, 0, 0, SFX_FLAG_10) +/* 0x818 */ DEFINE_SFX(CHAN_0465, NA_SE_PL_JUMP_GRASS, 0x30, 0, 0, SFX_FLAG_10) +/* 0x819 */ DEFINE_SFX(CHAN_0479, NA_SE_PL_JUMP_IRON, 0x30, 0, 0, SFX_FLAG_10) +/* 0x81A */ DEFINE_SFX(CHAN_048D, NA_SE_PL_JUMP_LADDER, 0x30, 0, 0, SFX_FLAG_10) +/* 0x81B */ DEFINE_SFX(CHAN_049F, NA_SE_PL_JUMP_GLASS, 0x30, 0, 0, SFX_FLAG_10) +/* 0x81C */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_DUMMY28, 0x30, 0, 0, SFX_FLAG_10) +/* 0x81D */ DEFINE_SFX(CHAN_04B1, NA_SE_PL_JUMP_HEAVYBOOTS, 0x30, 0, 0, SFX_FLAG_10) +/* 0x81E */ DEFINE_SFX(CHAN_04D8, NA_SE_PL_DUMMY30, 0x30, 0, 0, SFX_FLAG_10) +/* 0x81F */ DEFINE_SFX(CHAN_04EA, NA_SE_PL_JUMP_ICE, 0x30, 0, 0, SFX_FLAG_10) +/* 0x820 */ DEFINE_SFX(CHAN_04FE, NA_SE_PL_LAND, 0x40, 0, 1, SFX_FLAG_10) +/* 0x821 */ DEFINE_SFX(CHAN_052D, NA_SE_PL_LAND_SAND, 0x40, 0, 1, SFX_FLAG_10) +/* 0x822 */ DEFINE_SFX(CHAN_053F, NA_SE_PL_LAND_CONCRETE, 0x40, 0, 1, SFX_FLAG_10) +/* 0x823 */ DEFINE_SFX(CHAN_0558, NA_SE_PL_LAND_DIRT, 0x40, 0, 1, SFX_FLAG_10) +/* 0x824 */ DEFINE_SFX(CHAN_056C, NA_SE_PL_LAND_WATER0, 0x40, 0, 1, SFX_FLAG_10) +/* 0x825 */ DEFINE_SFX(CHAN_057E, NA_SE_PL_LAND_WATER1, 0x40, 0, 1, SFX_FLAG_10) +/* 0x826 */ DEFINE_SFX(CHAN_0590, NA_SE_PL_LAND_WATER2, 0x40, 0, 1, SFX_FLAG_10) +/* 0x827 */ DEFINE_SFX(CHAN_05A9, NA_SE_PL_LAND_MAGMA, 0x40, 0, 1, SFX_FLAG_10) +/* 0x828 */ DEFINE_SFX(CHAN_05C9, NA_SE_PL_LAND_GRASS, 0x40, 0, 1, SFX_FLAG_10) +/* 0x829 */ DEFINE_SFX(CHAN_05DD, NA_SE_PL_LAND_IRON, 0x40, 0, 1, SFX_FLAG_10) +/* 0x82A */ DEFINE_SFX(CHAN_05F1, NA_SE_PL_LAND_LADDER, 0x40, 0, 1, SFX_FLAG_10) +/* 0x82B */ DEFINE_SFX(CHAN_0603, NA_SE_PL_LAND_GLASS, 0x40, 0, 1, SFX_FLAG_10) +/* 0x82C */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_DUMMY_44, 0x40, 0, 1, SFX_FLAG_10) +/* 0x82D */ DEFINE_SFX(CHAN_0615, NA_SE_PL_LAND_HEAVYBOOTS, 0x40, 0, 1, SFX_FLAG_10) +/* 0x82E */ DEFINE_SFX(CHAN_0622, NA_SE_PL_DUMMY_46, 0x40, 0, 1, SFX_FLAG_10) +/* 0x82F */ DEFINE_SFX(CHAN_0632, NA_SE_PL_LAND_ICE, 0x40, 0, 1, SFX_FLAG_10) +/* 0x830 */ DEFINE_SFX(CHAN_0644, NA_SE_PL_SLIPDOWN, 0x30, 0, 2, 0) +/* 0x831 */ DEFINE_SFX(CHAN_0655, NA_SE_PL_CLIMB_CLIFF, 0x30, 0, 0, 0) +/* 0x832 */ DEFINE_SFX(CHAN_0662, NA_SE_PL_SIT_ON_HORSE, 0x30, 0, 0, 0) +/* 0x833 */ DEFINE_SFX(CHAN_066F, NA_SE_PL_GET_OFF_HORSE, 0x30, 0, 0, 0) +/* 0x834 */ DEFINE_SFX(CHAN_0680, NA_SE_PL_TAKE_OUT_SHIELD, 0x30, 0, 0, SFX_FLAG_10) +/* 0x835 */ DEFINE_SFX(CHAN_069D, NA_SE_PL_CHANGE_ARMS, 0x30, 0, 0, SFX_FLAG_10) +/* 0x836 */ DEFINE_SFX(CHAN_06BF, NA_SE_PL_CATCH_BOOMERANG, 0x30, 0, 0, SFX_FLAG_10) +/* 0x837 */ DEFINE_SFX(CHAN_06CD, NA_SE_PL_DUMMY_55, 0x30, 0, 1, 0) +/* 0x838 */ DEFINE_SFX(CHAN_06E1, NA_SE_PL_DUMMY_56, 0x30, 0, 1, 0) +/* 0x839 */ DEFINE_SFX(CHAN_06F2, NA_SE_PL_SWIM, 0x30, 0, 2, 0) +/* 0x83A */ DEFINE_SFX(CHAN_0706, NA_SE_PL_THROW, 0x30, 0, 0, SFX_FLAG_10) +/* 0x83B */ DEFINE_SFX(CHAN_0714, NA_SE_PL_BODY_BOUND, 0x30, 0, 0, SFX_FLAG_10) +/* 0x83C */ DEFINE_SFX(CHAN_0731, NA_SE_PL_ROLL, 0x40, 0, 0, SFX_FLAG_10) +/* 0x83D */ DEFINE_SFX(CHAN_0743, NA_SE_PL_SKIP, 0x30, 0, 0, SFX_FLAG_10) +/* 0x83E */ DEFINE_SFX(CHAN_0753, NA_SE_PL_BODY_HIT, 0x30, 2, 0, SFX_FLAG_10) +/* 0x83F */ DEFINE_SFX(CHAN_076A, NA_SE_PL_DAMAGE, 0x30, 0, 0, SFX_FLAG_10) +/* 0x840 */ DEFINE_SFX(CHAN_0796, NA_SE_PL_SLIP, 0x30, 0, 1, 0) +/* 0x841 */ DEFINE_SFX(CHAN_07A0, NA_SE_PL_SLIP_SAND, 0x30, 0, 1, 0) +/* 0x842 */ DEFINE_SFX(CHAN_07A7, NA_SE_PL_SLIP_CONCRETE, 0x30, 0, 1, 0) +/* 0x843 */ DEFINE_SFX(CHAN_07AE, NA_SE_PL_SLIP_DIRT, 0x30, 0, 1, 0) +/* 0x844 */ DEFINE_SFX(CHAN_07B5, NA_SE_PL_SLIP_WATER0, 0x30, 0, 1, 0) +/* 0x845 */ DEFINE_SFX(CHAN_07BC, NA_SE_PL_SLIP_WATER1, 0x30, 0, 1, 0) +/* 0x846 */ DEFINE_SFX(CHAN_07C3, NA_SE_PL_SLIP_WATER2, 0x30, 0, 1, 0) +/* 0x847 */ DEFINE_SFX(CHAN_07CA, NA_SE_PL_SLIP_MAGMA, 0x30, 0, 1, 0) +/* 0x848 */ DEFINE_SFX(CHAN_07D1, NA_SE_PL_SLIP_GRASS, 0x30, 0, 1, 0) +/* 0x849 */ DEFINE_SFX(CHAN_07D8, NA_SE_PL_SLIP_IRON, 0x30, 0, 1, 0) +/* 0x84A */ DEFINE_SFX(CHAN_07DF, NA_SE_PL_SLIP_LADDER, 0x30, 0, 1, 0) +/* 0x84B */ DEFINE_SFX(CHAN_07E6, NA_SE_PL_SLIP_GLASS, 0x30, 0, 1, 0) +/* 0x84C */ DEFINE_SFX(CHAN_02E8, NA_SE_PL_DUMMY76, 0x30, 0, 0, 0) +/* 0x84D */ DEFINE_SFX(CHAN_07DF, NA_SE_PL_SLIP_HEAVYBOOTS, 0x30, 0, 0, 0) +/* 0x84E */ DEFINE_SFX(CHAN_07ED, NA_SE_PL_DUMMY78, 0x30, 0, 0, 0) +/* 0x84F */ DEFINE_SFX(CHAN_07A7, NA_SE_PL_SLIP_ICE, 0x30, 0, 0, 0) +/* 0x850 */ DEFINE_SFX(CHAN_07F4, NA_SE_PL_BOUND, 0x80, 0, 0, 0) +/* 0x851 */ DEFINE_SFX(CHAN_0811, NA_SE_PL_BOUND_SAND, 0x80, 0, 0, 0) +/* 0x852 */ DEFINE_SFX(CHAN_081B, NA_SE_PL_BOUND_CONCRETE, 0x80, 0, 0, 0) +/* 0x853 */ DEFINE_SFX(CHAN_0825, NA_SE_PL_BOUND_DIRT, 0x80, 0, 0, 0) +/* 0x854 */ DEFINE_SFX(CHAN_082F, NA_SE_PL_BOUND_WATER0, 0x80, 0, 0, 0) +/* 0x855 */ DEFINE_SFX(CHAN_083B, NA_SE_PL_BOUND_WATER1, 0x80, 0, 0, 0) +/* 0x856 */ DEFINE_SFX(CHAN_0845, NA_SE_PL_BOUND_WATER2, 0x80, 0, 0, 0) +/* 0x857 */ DEFINE_SFX(CHAN_084F, NA_SE_PL_BOUND_MAGMA, 0x80, 0, 0, 0) +/* 0x858 */ DEFINE_SFX(CHAN_0859, NA_SE_PL_BOUND_GRASS, 0x80, 0, 0, 0) +/* 0x859 */ DEFINE_SFX(CHAN_0863, NA_SE_PL_BOUND_IRON, 0x80, 0, 0, 0) +/* 0x85A */ DEFINE_SFX(CHAN_086D, NA_SE_PL_BOUND_LADDER, 0x80, 0, 0, 0) +/* 0x85B */ DEFINE_SFX(CHAN_0877, NA_SE_PL_BOUND_WOOD, 0x80, 0, 0, 0) +/* 0x85C */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_DUMMY_92, 0x80, 0, 0, 0) +/* 0x85D */ DEFINE_SFX(CHAN_086D, NA_SE_PL_BOUND_HEAVYBOOTS, 0x80, 0, 0, 0) +/* 0x85E */ DEFINE_SFX(CHAN_0882, NA_SE_PL_DUMMY_94, 0x80, 0, 0, 0) +/* 0x85F */ DEFINE_SFX(CHAN_088D, NA_SE_PL_BOUND_ICE, 0x80, 0, 0, 0) +/* 0x860 */ DEFINE_SFX(CHAN_0376, NA_SE_PL_DUMMY_96, 0x30, 0, 0, 0) +/* 0x861 */ DEFINE_SFX(CHAN_04B1, NA_SE_PL_DUMMY_97, 0x30, 0, 0, 0) +/* 0x862 */ DEFINE_SFX(CHAN_0615, NA_SE_PL_DUMMY_98, 0x30, 0, 0, 0) +/* 0x863 */ DEFINE_SFX(CHAN_0898, NA_SE_PL_FACE_UP, 0x30, 0, 0, 0) +/* 0x864 */ DEFINE_SFX(CHAN_08B7, NA_SE_PL_DIVE_BUBBLE, 0x30, 0, 0, 0) +/* 0x865 */ DEFINE_SFX(CHAN_08CA, NA_SE_PL_MOVE_BUBBLE, 0x30, 0, 0, 0) +/* 0x866 */ DEFINE_SFX(CHAN_08DC, NA_SE_PL_METALEFFECT_KID, 0x30, 0, 0, SFX_FLAG_10) +/* 0x867 */ DEFINE_SFX(CHAN_08E0, NA_SE_PL_METALEFFECT_ADULT, 0x30, 0, 0, SFX_FLAG_10) +/* 0x868 */ DEFINE_SFX(CHAN_08E4, NA_SE_PL_SPARK, 0x30, 0, 0, 0) +/* 0x869 */ DEFINE_SFX(CHAN_090A, NA_SE_PL_PULL_UP_PLANT, 0x30, 0, 0, 0) +/* 0x86A */ DEFINE_SFX(CHAN_091C, NA_SE_PL_PULL_UP_ROCK, 0x30, 0, 0, 0) +/* 0x86B */ DEFINE_SFX(CHAN_0940, NA_SE_PL_IN_BUBBLE, 0x30, 0, 0, 0) +/* 0x86C */ DEFINE_SFX(CHAN_0950, NA_SE_PL_PULL_UP_BIGROCK, 0x30, 3, 0, 0) +/* 0x86D */ DEFINE_SFX(CHAN_0959, NA_SE_PL_SWORD_CHARGE, 0x30, 0, 0, 0) +/* 0x86E */ DEFINE_SFX(CHAN_096A, NA_SE_PL_FREEZE, 0x30, 0, 0, 0) +/* 0x86F */ DEFINE_SFX(CHAN_0989, NA_SE_PL_PULL_UP_POT, 0x30, 0, 0, 0) +/* 0x870 */ DEFINE_SFX(CHAN_09A0, NA_SE_PL_KNOCK, 0x30, 0, 0, 0) +/* 0x871 */ DEFINE_SFX(CHAN_09AE, NA_SE_PL_CALM_HIT, 0x30, 0, 2, 0) +/* 0x872 */ DEFINE_SFX(CHAN_09BC, NA_SE_PL_CALM_PAT, 0x30, 0, 0, 0) +/* 0x873 */ DEFINE_SFX(CHAN_09CA, NA_SE_PL_SUBMERGE, 0x30, 0, 0, 0) +/* 0x874 */ DEFINE_SFX(CHAN_09E9, NA_SE_PL_FREEZE_S, 0x30, 3, 0, 0) +/* 0x875 */ DEFINE_SFX(CHAN_0A06, NA_SE_PL_ICE_BROKEN, 0x30, 1, 0, 0) +/* 0x876 */ DEFINE_SFX(CHAN_0A15, NA_SE_PL_SLIP_ICE_LELEL, 0x30, 0, 0, 0) +/* 0x877 */ DEFINE_SFX(CHAN_0A23, NA_SE_PL_PUT_OUT_ITEM, 0x30, 0, 0, 0) +/* 0x878 */ DEFINE_SFX(CHAN_0A36, NA_SE_PL_PULL_UP_WOODBOX, 0x30, 0, 0, 0) +/* 0x879 */ DEFINE_SFX(CHAN_0A40, NA_SE_PL_MAGIC_FIRE, 0x30, 0, 0, 0) +/* 0x87A */ DEFINE_SFX(CHAN_0A7B, NA_SE_PL_MAGIC_WIND_NORMAL, 0x30, 0, 0, 0) +/* 0x87B */ DEFINE_SFX(CHAN_0ABC, NA_SE_PL_MAGIC_WIND_WARP, 0x30, 0, 0, SFX_FLAG_13) +/* 0x87C */ DEFINE_SFX(CHAN_0AD8, NA_SE_PL_MAGIC_SOUL_NORMAL, 0x30, 0, 0, SFX_FLAG_11 | SFX_FLAG_10) +/* 0x87D */ DEFINE_SFX(CHAN_0B08, NA_SE_PL_ARROW_CHARGE_FIRE, 0x30, 0, 0, SFX_FLAG_10) +/* 0x87E */ DEFINE_SFX(CHAN_0B37, NA_SE_PL_ARROW_CHARGE_ICE, 0x30, 0, 0, SFX_FLAG_10) +/* 0x87F */ DEFINE_SFX(CHAN_0B5D, NA_SE_PL_ARROW_CHARGE_LIGHT, 0x30, 0, 0, SFX_FLAG_10) +/* 0x880 */ DEFINE_SFX(CHAN_0B79, NA_SE_PL_DUMMY_128, 0x20, 0, 2, 0) +/* 0x881 */ DEFINE_SFX(CHAN_0B96, NA_SE_PL_DUMMY_129, 0x20, 0, 2, 0) +/* 0x882 */ DEFINE_SFX(CHAN_0B9A, NA_SE_PL_DUMMY_130, 0x20, 0, 2, 0) +/* 0x883 */ DEFINE_SFX(CHAN_0B9E, NA_SE_PL_PULL_UP_RUTO, 0x20, 0, 2, 0) +/* 0x884 */ DEFINE_SFX(CHAN_0BA2, NA_SE_PL_DUMMY_132, 0x20, 0, 1, 0) +/* 0x885 */ DEFINE_SFX(CHAN_0BA6, NA_SE_PL_DUMMY_133, 0x20, 0, 1, 0) +/* 0x886 */ DEFINE_SFX(CHAN_0BAA, NA_SE_PL_DUMMY_134, 0x20, 0, 1, 0) +/* 0x887 */ DEFINE_SFX(CHAN_0BAE, NA_SE_PL_DUMMY_135, 0x20, 0, 1, 0) +/* 0x888 */ DEFINE_SFX(CHAN_0BB2, NA_SE_PL_DUMMY_136, 0x20, 0, 2, 0) +/* 0x889 */ DEFINE_SFX(CHAN_0BB6, NA_SE_PL_DUMMY_137, 0x20, 0, 2, 0) +/* 0x88A */ DEFINE_SFX(CHAN_0BBA, NA_SE_PL_DUMMY_138, 0x20, 0, 2, 0) +/* 0x88B */ DEFINE_SFX(CHAN_0BBE, NA_SE_PL_DUMMY_139, 0x20, 0, 0, 0) +/* 0x88C */ DEFINE_SFX(CHAN_0BC2, NA_SE_PL_DUMMY_140, 0x20, 0, 0, 0) +/* 0x88D */ DEFINE_SFX(CHAN_0376, NA_SE_PL_DUMMY_141, 0x20, 0, 0, 0) +/* 0x88E */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_DUMMY_142, 0x20, 0, 0, 0) +/* 0x88F */ DEFINE_SFX(CHAN_0BC9, NA_SE_PL_DUMMY_143, 0x20, 0, 0, 0) +/* 0x890 */ DEFINE_SFX(CHAN_0BCD, NA_SE_PL_DUMMY_144, 0x30, 0, 0, 0) +/* 0x891 */ DEFINE_SFX(CHAN_0BED, NA_SE_PL_DUMMY_145, 0x30, 0, 0, 0) +/* 0x892 */ DEFINE_SFX(CHAN_0BF4, NA_SE_PL_DUMMY_146, 0x30, 0, 0, 0) +/* 0x893 */ DEFINE_SFX(CHAN_0BFB, NA_SE_PL_DUMMY_147, 0x30, 0, 0, 0) +/* 0x894 */ DEFINE_SFX(CHAN_0C02, NA_SE_PL_DUMMY_148, 0x30, 0, 0, 0) +/* 0x895 */ DEFINE_SFX(CHAN_0C09, NA_SE_PL_DUMMY_149, 0x30, 0, 0, 0) +/* 0x896 */ DEFINE_SFX(CHAN_0C0D, NA_SE_PL_DUMMY_150, 0x30, 0, 0, 0) +/* 0x897 */ DEFINE_SFX(CHAN_0C14, NA_SE_PL_DUMMY_151, 0x30, 0, 0, 0) +/* 0x898 */ DEFINE_SFX(CHAN_0C1B, NA_SE_PL_DUMMY_152, 0x30, 0, 0, 0) +/* 0x899 */ DEFINE_SFX(CHAN_0C22, NA_SE_PL_DUMMY_153, 0x30, 0, 0, 0) +/* 0x89A */ DEFINE_SFX(CHAN_0C29, NA_SE_PL_DUMMY_154, 0x30, 0, 0, 0) +/* 0x89B */ DEFINE_SFX(CHAN_0C30, NA_SE_PL_DUMMY_155, 0x30, 0, 0, 0) +/* 0x89C */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_DUMMY_156, 0x30, 0, 0, 0) +/* 0x89D */ DEFINE_SFX(CHAN_04B1, NA_SE_PL_DUMMY_157, 0x30, 0, 0, 0) +/* 0x89E */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_DUMMY_158, 0x30, 0, 0, 0) +/* 0x89F */ DEFINE_SFX(CHAN_0C37, NA_SE_PL_DUMMY_159, 0x30, 0, 0, 0) +/* 0x8A0 */ DEFINE_SFX(CHAN_0C3E, NA_SE_PL_DUMMY_160, 0x40, 0, 0, 0) +/* 0x8A1 */ DEFINE_SFX(CHAN_0C5C, NA_SE_PL_DUMMY_161, 0x40, 0, 0, 0) +/* 0x8A2 */ DEFINE_SFX(CHAN_0C63, NA_SE_PL_DUMMY_162, 0x40, 0, 0, 0) +/* 0x8A3 */ DEFINE_SFX(CHAN_0C6A, NA_SE_PL_DUMMY_163, 0x40, 0, 0, 0) +/* 0x8A4 */ DEFINE_SFX(CHAN_0C71, NA_SE_PL_DUMMY_164, 0x40, 0, 0, 0) +/* 0x8A5 */ DEFINE_SFX(CHAN_0C78, NA_SE_PL_DUMMY_165, 0x40, 0, 0, 0) +/* 0x8A6 */ DEFINE_SFX(CHAN_0C7C, NA_SE_PL_DUMMY_166, 0x40, 0, 0, 0) +/* 0x8A7 */ DEFINE_SFX(CHAN_0C83, NA_SE_PL_DUMMY_167, 0x40, 0, 0, 0) +/* 0x8A8 */ DEFINE_SFX(CHAN_0C8A, NA_SE_PL_DUMMY_168, 0x40, 0, 0, 0) +/* 0x8A9 */ DEFINE_SFX(CHAN_0C91, NA_SE_PL_DUMMY_169, 0x40, 0, 0, 0) +/* 0x8AA */ DEFINE_SFX(CHAN_0C98, NA_SE_PL_DUMMY_170, 0x40, 0, 0, 0) +/* 0x8AB */ DEFINE_SFX(CHAN_0C9F, NA_SE_PL_DUMMY_171, 0x40, 0, 0, 0) +/* 0x8AC */ DEFINE_SFX(CHAN_0B79, NA_SE_PL_DUMMY_172, 0x40, 0, 0, 0) +/* 0x8AD */ DEFINE_SFX(CHAN_0615, NA_SE_PL_DUMMY_173, 0x40, 0, 0, 0) +/* 0x8AE */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_DUMMY_174, 0x40, 0, 0, 0) +/* 0x8AF */ DEFINE_SFX(CHAN_0CA6, NA_SE_PL_DUMMY_175, 0x40, 0, 0, 0) +/* 0x8B0 */ DEFINE_SFX(CHAN_0CAD, NA_SE_PL_CRAWL, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8B1 */ DEFINE_SFX(CHAN_0CB8, NA_SE_PL_CRAWL_SAND, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8B2 */ DEFINE_SFX(CHAN_0CC3, NA_SE_PL_CRAWL_CONCRETE, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8B3 */ DEFINE_SFX(CHAN_0CCE, NA_SE_PL_CRAWL_DIRT, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8B4 */ DEFINE_SFX(CHAN_0CD9, NA_SE_PL_CRAWL_WATER0, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8B5 */ DEFINE_SFX(CHAN_0CE4, NA_SE_PL_DUMMY_181, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8B6 */ DEFINE_SFX(CHAN_0CEF, NA_SE_PL_DUMMY_182, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8B7 */ DEFINE_SFX(CHAN_0CFA, NA_SE_PL_DUMMY_183, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8B8 */ DEFINE_SFX(CHAN_0D05, NA_SE_PL_DUMMY_184, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8B9 */ DEFINE_SFX(CHAN_0D10, NA_SE_PL_DUMMY_185, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8BA */ DEFINE_SFX(CHAN_0D1B, NA_SE_PL_DUMMY_186, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8BB */ DEFINE_SFX(CHAN_0D26, NA_SE_PL_CRAWL_WOOD, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8BC */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_CRAWL_ICE, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8BD */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_DUMMY_189, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8BE */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_DUMMY_190, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8BF */ DEFINE_SFX(CHAN_0D31, NA_SE_PL_DUMMY_191, 0x30, 0, 1, SFX_FLAG_10) +/* 0x8C0 */ DEFINE_SFX(CHAN_0D3C, NA_SE_PL_MAGIC_SOUL_FLASH, 0x30, 0, 0, SFX_FLAG_11 | SFX_FLAG_10) +/* 0x8C1 */ DEFINE_SFX(CHAN_0D43, NA_SE_PL_ROLL_DUST, 0x30, 0, 2, 0) +/* 0x8C2 */ DEFINE_SFX(CHAN_0D57, NA_SE_PL_DUMMY_192, 0x30, 0, 0, 0) +/* 0x8C3 */ DEFINE_SFX(CHAN_0D68, NA_SE_PL_MAGIC_SOUL_BALL, 0x30, 0, 0, 0) +/* 0x8C4 */ DEFINE_SFX(CHAN_0D7F, NA_SE_PL_SPIRAL_HEAL_BEAM, 0x30, 0, 0, 0) +/* 0x8C5 */ DEFINE_SFX(CHAN_07FC, NA_SE_PL_BOUND_NOWEAPON, 0x30, 0, 0, 0) +/* 0x8C6 */ DEFINE_SFX(CHAN_0DC9, NA_SE_PL_PLANT_GROW_UP, 0x30, 0, 0, 0) +/* 0x8C7 */ DEFINE_SFX(CHAN_0DA9, NA_SE_PL_PLANT_TALLER, 0x30, 0, 0, 0) +/* 0x8C8 */ DEFINE_SFX(CHAN_0DCE, NA_SE_PL_MAGIC_WIND_VANISH, 0x60, 2, 0, 0) +/* 0x8C9 */ DEFINE_SFX(CHAN_0DE3, NA_SE_PL_HOBBERBOOTS_LV, 0x30, 0, 0, 0) +/* 0x8CA */ DEFINE_SFX(CHAN_0DF9, NA_SE_PL_PLANT_MOVE, 0x30, 0, 0, 0) +/* 0x8CB */ DEFINE_SFX(CHAN_1C14, NA_SE_EV_WALL_MOVE_SP, 0x30, 0, 0, SFX_FLAG_11) +/* 0x8CC */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_DUMMY_204, 0x30, 0, 0, 0) +/* 0x8CD */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_DUMMY_205, 0x30, 0, 0, 0) +/* 0x8CE */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_DUMMY_206, 0x30, 0, 0, 0) +/* 0x8CF */ DEFINE_SFX(CHAN_02A1, NA_SE_PL_DUMMY_207, 0x30, 0, 0, 0) +/* 0x8D0 */ DEFINE_SFX(CHAN_0E08, NA_SE_PL_SLIP_LEVEL, 0x30, 0, 0, 0) +/* 0x8D1 */ DEFINE_SFX(CHAN_0E18, NA_SE_PL_SLIP_SAND_LEVEL, 0x30, 0, 0, 0) +/* 0x8D2 */ DEFINE_SFX(CHAN_0E20, NA_SE_PL_SLIP_CONCRETE_LEVEL, 0x30, 0, 0, 0) +/* 0x8D3 */ DEFINE_SFX(CHAN_0E30, NA_SE_PL_SLIP_DIRT_LEVEL, 0x30, 0, 0, 0) +/* 0x8D4 */ DEFINE_SFX(CHAN_0E30, NA_SE_PL_SLIP_WATER0_LEVEL, 0x30, 0, 0, 0) +/* 0x8D5 */ DEFINE_SFX(CHAN_0E30, NA_SE_PL_SLIP_WATER1_LEVEL, 0x30, 0, 0, 0) +/* 0x8D6 */ DEFINE_SFX(CHAN_0E38, NA_SE_PL_SLIP_WATER2_LEVEL, 0x30, 0, 0, 0) +/* 0x8D7 */ DEFINE_SFX(CHAN_0E30, NA_SE_PL_SLIP_MAGMA_LEVEL, 0x30, 0, 0, 0) +/* 0x8D8 */ DEFINE_SFX(CHAN_0E48, NA_SE_PL_SLIP_GRASS_LEVEL, 0x30, 0, 0, 0) +/* 0x8D9 */ DEFINE_SFX(CHAN_0E08, NA_SE_PL_SLIP_IRON_LEVEL, 0x30, 0, 0, 0) +/* 0x8DA */ DEFINE_SFX(CHAN_0E50, NA_SE_PL_SLIP_GLASS_LEVEL, 0x30, 0, 0, 0) +/* 0x8DB */ DEFINE_SFX(CHAN_0E50, NA_SE_PL_SLIP_WOOD_LEVEL, 0x30, 0, 0, 0) +/* 0x8DC */ DEFINE_SFX(CHAN_02E8, NA_SE_PL_DUMMY_220, 0x30, 0, 0, 0) +/* 0x8DD */ DEFINE_SFX(CHAN_0E50, NA_SE_PL_DUMMY_221, 0x30, 0, 0, 0) +/* 0x8DE */ DEFINE_SFX(CHAN_0E60, NA_SE_PL_SLIP_HEAVYBOOTS_LEVEL, 0x30, 0, 0, 0) +/* 0x8DF */ DEFINE_SFX(CHAN_0E20, NA_SE_PL_SLIP_ICE_LEVEL, 0x30, 0, 0, 0) diff --git a/include/tables/sfx/systembank_table.h b/include/tables/sfx/systembank_table.h index 7792cdd46b..b94899ed14 100644 --- a/include/tables/sfx/systembank_table.h +++ b/include/tables/sfx/systembank_table.h @@ -2,83 +2,82 @@ * Sfx System Bank * * DEFINE_SFX should be used for all sfx define in the system bank from sequence 0 + * - Argument 0: Channel name for sequence 0 * - Argument 1: Enum value for this sfx * - Argument 2: Importance for deciding which sfx to prioritize. Higher values have greater importance * - Argument 3: Slows the decay of volume with distance (a 2-bit number ranging from 0-3) * - Argument 4: Applies increasingly random offsets to frequency (a 2-bit number ranging from 0-3) * - Argument 5: Various flags to add properties to the sfx - * - * WARNING: entries must align with the table defined for the system bank in sequence 0 */ -/* 0x4800 */ DEFINE_SFX(NA_SE_SY_WIN_OPEN, 0xC0, 0, 0, 0) -/* 0x4801 */ DEFINE_SFX(NA_SE_SY_WIN_CLOSE, 0xC0, 0, 0, 0) -/* 0x4802 */ DEFINE_SFX(NA_SE_SY_CORRECT_CHIME, 0xB0, 0, 0, SFX_FLAG_5) -/* 0x4803 */ DEFINE_SFX(NA_SE_SY_GET_RUPY, 0x30, 0, 0, 0) -/* 0x4804 */ DEFINE_SFX(NA_SE_SY_MESSAGE_WOMAN, 0x30, 0, 0, 0) -/* 0x4805 */ DEFINE_SFX(NA_SE_SY_MESSAGE_MAN, 0x30, 0, 0, 0) -/* 0x4806 */ DEFINE_SFX(NA_SE_SY_ERROR, 0x50, 0, 0, 0) -/* 0x4807 */ DEFINE_SFX(NA_SE_SY_TRE_BOX_APPEAR, 0x30, 0, 0, SFX_FLAG_5) -/* 0x4808 */ DEFINE_SFX(NA_SE_SY_DECIDE, 0x30, 0, 0, 0) -/* 0x4809 */ DEFINE_SFX(NA_SE_SY_CURSOR, 0x30, 0, 0, 0) -/* 0x480A */ DEFINE_SFX(NA_SE_SY_CANCEL, 0x30, 0, 0, 0) -/* 0x480B */ DEFINE_SFX(NA_SE_SY_HP_RECOVER, 0x30, 0, 0, 0) -/* 0x480C */ DEFINE_SFX(NA_SE_SY_ATTENTION_ON, 0x20, 0, 0, 0) -/* 0x480D */ DEFINE_SFX(NA_SE_SY_DUMMY_13, 0x30, 0, 0, 0) -/* 0x480E */ DEFINE_SFX(NA_SE_SY_DUMMY_14, 0x30, 0, 0, 0) -/* 0x480F */ DEFINE_SFX(NA_SE_SY_LOCK_OFF, 0x30, 0, 0, 0) -/* 0x4810 */ DEFINE_SFX(NA_SE_SY_LOCK_ON_HUMAN, 0x28, 0, 0, 0) -/* 0x4811 */ DEFINE_SFX(NA_SE_SY_DUMMY_17, 0x30, 0, 0, 0) -/* 0x4812 */ DEFINE_SFX(NA_SE_SY_DUMMY_18, 0x30, 0, 0, 0) -/* 0x4813 */ DEFINE_SFX(NA_SE_SY_CAMERA_ZOOM_UP, 0x30, 0, 0, 0) -/* 0x4814 */ DEFINE_SFX(NA_SE_SY_CAMERA_ZOOM_DOWN, 0x30, 0, 0, 0) -/* 0x4815 */ DEFINE_SFX(NA_SE_SY_DUMMY_21, 0x30, 0, 0, 0) -/* 0x4816 */ DEFINE_SFX(NA_SE_SY_DUMMY_22, 0x30, 0, 0, 0) -/* 0x4817 */ DEFINE_SFX(NA_SE_SY_ATTENTION_ON_OLD, 0x30, 0, 0, 0) -/* 0x4818 */ DEFINE_SFX(NA_SE_SY_MESSAGE_PASS, 0x18, 0, 0, 0) -/* 0x4819 */ DEFINE_SFX(NA_SE_SY_WARNING_COUNT_N, 0x2C, 0, 0, 0) -/* 0x481A */ DEFINE_SFX(NA_SE_SY_WARNING_COUNT_E, 0x2C, 0, 0, 0) -/* 0x481B */ DEFINE_SFX(NA_SE_SY_HITPOINT_ALARM, 0x20, 0, 0, 0) -/* 0x481C */ DEFINE_SFX(NA_SE_SY_DUMMY_28, 0x30, 0, 0, 0) -/* 0x481D */ DEFINE_SFX(NA_SE_SY_DEMO_CUT, 0x30, 0, 0, 0) -/* 0x481E */ DEFINE_SFX(NA_SE_SY_NAVY_CALL, 0x30, 0, 0, 0) -/* 0x481F */ DEFINE_SFX(NA_SE_SY_GAUGE_UP, 0x30, 0, 0, 0) -/* 0x4820 */ DEFINE_SFX(NA_SE_SY_DUMMY_32, 0x30, 0, 0, 0) -/* 0x4821 */ DEFINE_SFX(NA_SE_SY_DUMMY_33, 0x30, 0, 0, 0) -/* 0x4822 */ DEFINE_SFX(NA_SE_SY_DUMMY_34, 0x30, 0, 0, 0) -/* 0x4823 */ DEFINE_SFX(NA_SE_SY_PIECE_OF_HEART, 0x30, 0, 0, 0) -/* 0x4824 */ DEFINE_SFX(NA_SE_SY_GET_ITEM, 0x30, 0, 0, 0) -/* 0x4825 */ DEFINE_SFX(NA_SE_SY_WIN_SCROLL_LEFT, 0x30, 0, 0, 0) -/* 0x4826 */ DEFINE_SFX(NA_SE_SY_WIN_SCROLL_RIGHT, 0x30, 0, 0, 0) -/* 0x4827 */ DEFINE_SFX(NA_SE_SY_OCARINA_ERROR, 0x20, 0, 0, 0) -/* 0x4828 */ DEFINE_SFX(NA_SE_SY_CAMERA_ZOOM_UP_2, 0x30, 0, 0, 0) -/* 0x4829 */ DEFINE_SFX(NA_SE_SY_CAMERA_ZOOM_DOWN_2, 0x30, 0, 0, 0) -/* 0x482A */ DEFINE_SFX(NA_SE_SY_GLASSMODE_ON, 0x30, 0, 0, 0) -/* 0x482B */ DEFINE_SFX(NA_SE_SY_GLASSMODE_OFF, 0x30, 0, 0, 0) -/* 0x482C */ DEFINE_SFX(NA_SE_SY_FOUND, 0x60, 0, 0, 0) -/* 0x482D */ DEFINE_SFX(NA_SE_SY_HIT_SOUND, 0x30, 0, 0, 0) -/* 0x482E */ DEFINE_SFX(NA_SE_SY_MESSAGE_END, 0x30, 0, 0, 0) -/* 0x482F */ DEFINE_SFX(NA_SE_SY_RUPY_COUNT, 0x30, 0, 0, 0) -/* 0x4830 */ DEFINE_SFX(NA_SE_SY_LOCK_ON, 0x30, 0, 0, 0) -/* 0x4831 */ DEFINE_SFX(NA_SE_SY_GET_BOXITEM, 0x30, 0, 0, 0) -/* 0x4832 */ DEFINE_SFX(NA_SE_SY_WHITE_OUT_L, 0x30, 0, 0, 0) -/* 0x4833 */ DEFINE_SFX(NA_SE_SY_WHITE_OUT_S, 0x30, 0, 0, 0) -/* 0x4834 */ DEFINE_SFX(NA_SE_SY_WHITE_OUT_T, 0x30, 0, 0, 0) -/* 0x4835 */ DEFINE_SFX(NA_SE_SY_START_SHOT, 0x30, 0, 0, 0) -/* 0x4836 */ DEFINE_SFX(NA_SE_SY_METRONOME, 0x30, 0, 0, 0) -/* 0x4837 */ DEFINE_SFX(NA_SE_SY_ATTENTION_URGENCY, 0x30, 0, 0, 0) -/* 0x4838 */ DEFINE_SFX(NA_SE_SY_METRONOME_LV, 0x30, 0, 0, 0) -/* 0x4839 */ DEFINE_SFX(NA_SE_SY_FSEL_CURSOR, 0x30, 0, 0, 0) -/* 0x483A */ DEFINE_SFX(NA_SE_SY_FSEL_DECIDE_S, 0x30, 0, 0, 0) -/* 0x483B */ DEFINE_SFX(NA_SE_SY_FSEL_DECIDE_L, 0x30, 0, 0, 0) -/* 0x483C */ DEFINE_SFX(NA_SE_SY_FSEL_CLOSE, 0x30, 0, 0, 0) -/* 0x483D */ DEFINE_SFX(NA_SE_SY_FSEL_ERROR, 0x30, 0, 0, 0) -/* 0x483E */ DEFINE_SFX(NA_SE_SY_SET_FIRE_ARROW, 0x30, 0, 0, 0) -/* 0x483F */ DEFINE_SFX(NA_SE_SY_SET_ICE_ARROW, 0x30, 0, 0, 0) -/* 0x4840 */ DEFINE_SFX(NA_SE_SY_SET_LIGHT_ARROW, 0x30, 0, 0, 0) -/* 0x4841 */ DEFINE_SFX(NA_SE_SY_SYNTH_MAGIC_ARROW, 0x30, 0, 0, 0) -/* 0x4842 */ DEFINE_SFX(NA_SE_SY_METRONOME_2, 0x30, 0, 0, 0) -/* 0x4843 */ DEFINE_SFX(NA_SE_SY_KINSTA_MARK_APPEAR, 0x30, 0, 0, 0) -/* 0x4844 */ DEFINE_SFX(NA_SE_SY_FIVE_COUNT_LUPY, 0x30, 0, 0, 0) -/* 0x4845 */ DEFINE_SFX(NA_SE_SY_CARROT_RECOVER, 0x30, 0, 0, 0) -/* 0x4846 */ DEFINE_SFX(NA_SE_EV_FAIVE_LUPY_COUNT, 0x30, 0, 0, 0) -/* 0x4847 */ DEFINE_SFX(NA_SE_SY_DUMMY_71, 0x30, 0, 0, 0) +/* 0x4800 */ DEFINE_SFX(CHAN_57B9, NA_SE_SY_WIN_OPEN, 0xC0, 0, 0, 0) +/* 0x4801 */ DEFINE_SFX(CHAN_57F6, NA_SE_SY_WIN_CLOSE, 0xC0, 0, 0, 0) +/* 0x4802 */ DEFINE_SFX(CHAN_5833, NA_SE_SY_CORRECT_CHIME, 0xB0, 0, 0, SFX_FLAG_5) +/* 0x4803 */ DEFINE_SFX(CHAN_5861, NA_SE_SY_GET_RUPY, 0x30, 0, 0, 0) +/* 0x4804 */ DEFINE_SFX(CHAN_5880, NA_SE_SY_MESSAGE_WOMAN, 0x30, 0, 0, 0) +/* 0x4805 */ DEFINE_SFX(CHAN_588E, NA_SE_SY_MESSAGE_MAN, 0x30, 0, 0, 0) +/* 0x4806 */ DEFINE_SFX(CHAN_588E, NA_SE_SY_ERROR, 0x50, 0, 0, 0) +/* 0x4807 */ DEFINE_SFX(CHAN_589F, NA_SE_SY_TRE_BOX_APPEAR, 0x30, 0, 0, SFX_FLAG_5) +/* 0x4808 */ DEFINE_SFX(CHAN_58E9, NA_SE_SY_DECIDE, 0x30, 0, 0, 0) +/* 0x4809 */ DEFINE_SFX(CHAN_5933, NA_SE_SY_CURSOR, 0x30, 0, 0, 0) +/* 0x480A */ DEFINE_SFX(CHAN_5948, NA_SE_SY_CANCEL, 0x30, 0, 0, 0) +/* 0x480B */ DEFINE_SFX(CHAN_596D, NA_SE_SY_HP_RECOVER, 0x30, 0, 0, 0) +/* 0x480C */ DEFINE_SFX(CHAN_598D, NA_SE_SY_ATTENTION_ON, 0x20, 0, 0, 0) +/* 0x480D */ DEFINE_SFX(CHAN_5A02, NA_SE_SY_DUMMY_13, 0x30, 0, 0, 0) +/* 0x480E */ DEFINE_SFX(CHAN_59A9, NA_SE_SY_DUMMY_14, 0x30, 0, 0, 0) +/* 0x480F */ DEFINE_SFX(CHAN_59CB, NA_SE_SY_LOCK_OFF, 0x30, 0, 0, 0) +/* 0x4810 */ DEFINE_SFX(CHAN_59E5, NA_SE_SY_LOCK_ON_HUMAN, 0x28, 0, 0, 0) +/* 0x4811 */ DEFINE_SFX(CHAN_5A02, NA_SE_SY_DUMMY_17, 0x30, 0, 0, 0) +/* 0x4812 */ DEFINE_SFX(CHAN_5A1B, NA_SE_SY_DUMMY_18, 0x30, 0, 0, 0) +/* 0x4813 */ DEFINE_SFX(CHAN_5A34, NA_SE_SY_CAMERA_ZOOM_UP, 0x30, 0, 0, 0) +/* 0x4814 */ DEFINE_SFX(CHAN_5A47, NA_SE_SY_CAMERA_ZOOM_DOWN, 0x30, 0, 0, 0) +/* 0x4815 */ DEFINE_SFX(CHAN_5A34, NA_SE_SY_DUMMY_21, 0x30, 0, 0, 0) +/* 0x4816 */ DEFINE_SFX(CHAN_5A34, NA_SE_SY_DUMMY_22, 0x30, 0, 0, 0) +/* 0x4817 */ DEFINE_SFX(CHAN_5A5A, NA_SE_SY_ATTENTION_ON_OLD, 0x30, 0, 0, 0) +/* 0x4818 */ DEFINE_SFX(CHAN_5A64, NA_SE_SY_MESSAGE_PASS, 0x18, 0, 0, 0) +/* 0x4819 */ DEFINE_SFX(CHAN_5A72, NA_SE_SY_WARNING_COUNT_N, 0x2C, 0, 0, 0) +/* 0x481A */ DEFINE_SFX(CHAN_5A86, NA_SE_SY_WARNING_COUNT_E, 0x2C, 0, 0, 0) +/* 0x481B */ DEFINE_SFX(CHAN_5AA5, NA_SE_SY_HITPOINT_ALARM, 0x20, 0, 0, 0) +/* 0x481C */ DEFINE_SFX(CHAN_5AB7, NA_SE_SY_DUMMY_28, 0x30, 0, 0, 0) +/* 0x481D */ DEFINE_SFX(CHAN_5AB7, NA_SE_SY_DEMO_CUT, 0x30, 0, 0, 0) +/* 0x481E */ DEFINE_SFX(CHAN_5AD8, NA_SE_SY_NAVY_CALL, 0x30, 0, 0, 0) +/* 0x481F */ DEFINE_SFX(CHAN_5AF7, NA_SE_SY_GAUGE_UP, 0x30, 0, 0, 0) +/* 0x4820 */ DEFINE_SFX(CHAN_5B22, NA_SE_SY_DUMMY_32, 0x30, 0, 0, 0) +/* 0x4821 */ DEFINE_SFX(CHAN_5B3C, NA_SE_SY_DUMMY_33, 0x30, 0, 0, 0) +/* 0x4822 */ DEFINE_SFX(CHAN_5B54, NA_SE_SY_DUMMY_34, 0x30, 0, 0, 0) +/* 0x4823 */ DEFINE_SFX(CHAN_5B5B, NA_SE_SY_PIECE_OF_HEART, 0x30, 0, 0, 0) +/* 0x4824 */ DEFINE_SFX(CHAN_5B9C, NA_SE_SY_GET_ITEM, 0x30, 0, 0, 0) +/* 0x4825 */ DEFINE_SFX(CHAN_5BBE, NA_SE_SY_WIN_SCROLL_LEFT, 0x30, 0, 0, 0) +/* 0x4826 */ DEFINE_SFX(CHAN_5BE8, NA_SE_SY_WIN_SCROLL_RIGHT, 0x30, 0, 0, 0) +/* 0x4827 */ DEFINE_SFX(CHAN_5BFA, NA_SE_SY_OCARINA_ERROR, 0x20, 0, 0, 0) +/* 0x4828 */ DEFINE_SFX(CHAN_5C07, NA_SE_SY_CAMERA_ZOOM_UP_2, 0x30, 0, 0, 0) +/* 0x4829 */ DEFINE_SFX(CHAN_5C1E, NA_SE_SY_CAMERA_ZOOM_DOWN_2, 0x30, 0, 0, 0) +/* 0x482A */ DEFINE_SFX(CHAN_5C35, NA_SE_SY_GLASSMODE_ON, 0x30, 0, 0, 0) +/* 0x482B */ DEFINE_SFX(CHAN_5C46, NA_SE_SY_GLASSMODE_OFF, 0x30, 0, 0, 0) +/* 0x482C */ DEFINE_SFX(CHAN_5C57, NA_SE_SY_FOUND, 0x60, 0, 0, 0) +/* 0x482D */ DEFINE_SFX(CHAN_5C64, NA_SE_SY_HIT_SOUND, 0x30, 0, 0, 0) +/* 0x482E */ DEFINE_SFX(CHAN_5C7A, NA_SE_SY_MESSAGE_END, 0x30, 0, 0, 0) +/* 0x482F */ DEFINE_SFX(CHAN_5C94, NA_SE_SY_RUPY_COUNT, 0x30, 0, 0, 0) +/* 0x4830 */ DEFINE_SFX(CHAN_5CAD, NA_SE_SY_LOCK_ON, 0x30, 0, 0, 0) +/* 0x4831 */ DEFINE_SFX(CHAN_5CB9, NA_SE_SY_GET_BOXITEM, 0x30, 0, 0, 0) +/* 0x4832 */ DEFINE_SFX(CHAN_5CD3, NA_SE_SY_WHITE_OUT_L, 0x30, 0, 0, 0) +/* 0x4833 */ DEFINE_SFX(CHAN_5CFC, NA_SE_SY_WHITE_OUT_S, 0x30, 0, 0, 0) +/* 0x4834 */ DEFINE_SFX(CHAN_5D1F, NA_SE_SY_WHITE_OUT_T, 0x30, 0, 0, 0) +/* 0x4835 */ DEFINE_SFX(CHAN_5D40, NA_SE_SY_START_SHOT, 0x30, 0, 0, 0) +/* 0x4836 */ DEFINE_SFX(CHAN_5D57, NA_SE_SY_METRONOME, 0x30, 0, 0, 0) +/* 0x4837 */ DEFINE_SFX(CHAN_5D61, NA_SE_SY_ATTENTION_URGENCY, 0x30, 0, 0, 0) +/* 0x4838 */ DEFINE_SFX(CHAN_5D6B, NA_SE_SY_METRONOME_LV, 0x30, 0, 0, 0) +/* 0x4839 */ DEFINE_SFX(CHAN_5D76, NA_SE_SY_FSEL_CURSOR, 0x30, 0, 0, 0) +/* 0x483A */ DEFINE_SFX(CHAN_5D9E, NA_SE_SY_FSEL_DECIDE_S, 0x30, 0, 0, 0) +/* 0x483B */ DEFINE_SFX(CHAN_5DBB, NA_SE_SY_FSEL_DECIDE_L, 0x30, 0, 0, 0) +/* 0x483C */ DEFINE_SFX(CHAN_5DDB, NA_SE_SY_FSEL_CLOSE, 0x30, 0, 0, 0) +/* 0x483D */ DEFINE_SFX(CHAN_5DF3, NA_SE_SY_FSEL_ERROR, 0x30, 0, 0, 0) +/* 0x483E */ DEFINE_SFX(CHAN_5E0A, NA_SE_SY_SET_FIRE_ARROW, 0x30, 0, 0, 0) +/* 0x483F */ DEFINE_SFX(CHAN_5E14, NA_SE_SY_SET_ICE_ARROW, 0x30, 0, 0, 0) +/* 0x4840 */ DEFINE_SFX(CHAN_5E1E, NA_SE_SY_SET_LIGHT_ARROW, 0x30, 0, 0, 0) +/* 0x4841 */ DEFINE_SFX(CHAN_5E28, NA_SE_SY_SYNTH_MAGIC_ARROW, 0x30, 0, 0, 0) +/* 0x4842 */ DEFINE_SFX(CHAN_5E31, NA_SE_SY_METRONOME_2, 0x30, 0, 0, 0) +/* 0x4843 */ DEFINE_SFX(CHAN_5E3D, NA_SE_SY_KINSTA_MARK_APPEAR, 0x30, 0, 0, 0) +/* 0x4844 */ DEFINE_SFX(CHAN_5E6B, NA_SE_SY_FIVE_COUNT_LUPY, 0x30, 0, 0, 0) +/* 0x4845 */ DEFINE_SFX(CHAN_5E88, NA_SE_SY_CARROT_RECOVER, 0x30, 0, 0, 0) +/* 0x4846 */ DEFINE_SFX(CHAN_5D57, NA_SE_EV_FAIVE_LUPY_COUNT, 0x30, 0, 0, 0) +/* 0x4847 */ DEFINE_SFX(CHAN_5D61, NA_SE_SY_DUMMY_71, 0x30, 0, 0, 0) diff --git a/include/tables/sfx/voicebank_table.h b/include/tables/sfx/voicebank_table.h index b876662b71..d39ebe1ba9 100644 --- a/include/tables/sfx/voicebank_table.h +++ b/include/tables/sfx/voicebank_table.h @@ -2,139 +2,141 @@ * Sfx Voice Bank * * DEFINE_SFX should be used for all sfx define in the voice bank from sequence 0 + * - Argument 0: Channel name for sequence 0 * - Argument 1: Enum value for this sfx * - Argument 2: Importance for deciding which sfx to prioritize. Higher values have greater importance * - Argument 3: Slows the decay of volume with distance (a 2-bit number ranging from 0-3) * - Argument 4: Applies increasingly random offsets to frequency (a 2-bit number ranging from 0-3) * - Argument 5: Various flags to add properties to the sfx - * - * WARNING: entries must align with the table defined for the voice bank in sequence 0 */ -/* 0x6800 */ DEFINE_SFX(NA_SE_VO_LI_SWORD_N, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6801 */ DEFINE_SFX(NA_SE_VO_LI_SWORD_L, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6802 */ DEFINE_SFX(NA_SE_VO_LI_LASH, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6803 */ DEFINE_SFX(NA_SE_VO_LI_HANG, 0x20, 2, 0, SFX_FLAG_10) -/* 0x6804 */ DEFINE_SFX(NA_SE_VO_LI_CLIMB_END, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6805 */ DEFINE_SFX(NA_SE_VO_LI_DAMAGE_S, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6806 */ DEFINE_SFX(NA_SE_VO_LI_FREEZE, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6807 */ DEFINE_SFX(NA_SE_VO_LI_FALL_S, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6808 */ DEFINE_SFX(NA_SE_VO_LI_FALL_L, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6809 */ DEFINE_SFX(NA_SE_VO_LI_BREATH_REST, 0x30, 2, 1, SFX_FLAG_10) -/* 0x680A */ DEFINE_SFX(NA_SE_VO_LI_BREATH_DRINK, 0x30, 2, 1, SFX_FLAG_10) -/* 0x680B */ DEFINE_SFX(NA_SE_VO_LI_DOWN, 0x30, 2, 0, SFX_FLAG_10) -/* 0x680C */ DEFINE_SFX(NA_SE_VO_LI_TAKEN_AWAY, 0x30, 2, 0, SFX_FLAG_10) -/* 0x680D */ DEFINE_SFX(NA_SE_VO_LI_HELD, 0x50, 2, 0, SFX_FLAG_10) -/* 0x680E */ DEFINE_SFX(NA_SE_VO_LI_SNEEZE, 0x30, 2, 0, SFX_FLAG_10) -/* 0x680F */ DEFINE_SFX(NA_SE_VO_LI_SWEAT, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6810 */ DEFINE_SFX(NA_SE_VO_LI_DRINK, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6811 */ DEFINE_SFX(NA_SE_VO_LI_RELAX, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6812 */ DEFINE_SFX(NA_SE_VO_LI_SWORD_PUTAWAY, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6813 */ DEFINE_SFX(NA_SE_VO_LI_GROAN, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6814 */ DEFINE_SFX(NA_SE_VO_LI_AUTO_JUMP, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6815 */ DEFINE_SFX(NA_SE_VO_LI_MAGIC_NALE, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6816 */ DEFINE_SFX(NA_SE_VO_LI_SURPRISE, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6817 */ DEFINE_SFX(NA_SE_VO_LI_MAGIC_FROL, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6818 */ DEFINE_SFX(NA_SE_VO_LI_PUSH, 0x30, 2, 2, SFX_FLAG_10) -/* 0x6819 */ DEFINE_SFX(NA_SE_VO_LI_HOOKSHOT_HANG, 0x30, 2, 0, SFX_FLAG_10) -/* 0x681A */ DEFINE_SFX(NA_SE_VO_LI_LAND_DAMAGE_S, 0x30, 2, 0, SFX_FLAG_10) -/* 0x681B */ DEFINE_SFX(NA_SE_VO_LI_NULL_0x1b, 0x30, 2, 0, SFX_FLAG_10) -/* 0x681C */ DEFINE_SFX(NA_SE_VO_LI_MAGIC_ATTACK, 0x30, 2, 0, SFX_FLAG_10) -/* 0x681D */ DEFINE_SFX(NA_SE_VO_BL_DOWN, 0x80, 2, 0, SFX_FLAG_10) -/* 0x681E */ DEFINE_SFX(NA_SE_VO_LI_DEMO_DAMAGE, 0x30, 2, 0, SFX_FLAG_10) -/* 0x681F */ DEFINE_SFX(NA_SE_VO_LI_ELECTRIC_SHOCK_LV, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6820 */ DEFINE_SFX(NA_SE_VO_LI_SWORD_N_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6821 */ DEFINE_SFX(NA_SE_VO_LI_ROLLING_CUT_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6822 */ DEFINE_SFX(NA_SE_VO_LI_LASH_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6823 */ DEFINE_SFX(NA_SE_VO_LI_HANG_KID, 0x20, 2, 0, SFX_FLAG_10) -/* 0x6824 */ DEFINE_SFX(NA_SE_VO_LI_CLIMB_END_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6825 */ DEFINE_SFX(NA_SE_VO_LI_DAMAGE_S_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6826 */ DEFINE_SFX(NA_SE_VO_LI_FREEZE_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6827 */ DEFINE_SFX(NA_SE_VO_LI_FALL_S_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6828 */ DEFINE_SFX(NA_SE_VO_LI_FALL_L_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6829 */ DEFINE_SFX(NA_SE_VO_LI_BREATH_REST_KID, 0x30, 2, 1, SFX_FLAG_10) -/* 0x682A */ DEFINE_SFX(NA_SE_VO_LI_BREATH_DRINK_KID, 0x30, 2, 1, SFX_FLAG_10) -/* 0x682B */ DEFINE_SFX(NA_SE_VO_LI_DOWN_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x682C */ DEFINE_SFX(NA_SE_VO_LI_TAKEN_AWAY_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x682D */ DEFINE_SFX(NA_SE_VO_LI_HELD_KID, 0x50, 2, 0, SFX_FLAG_10) -/* 0x682E */ DEFINE_SFX(NA_SE_VO_LI_SNEEZE_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x682F */ DEFINE_SFX(NA_SE_VO_LI_SWEAT_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6830 */ DEFINE_SFX(NA_SE_VO_LI_DRINK_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6831 */ DEFINE_SFX(NA_SE_VO_LI_RELAX_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6832 */ DEFINE_SFX(NA_SE_VO_LI_SWORD_PUTAWAY_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6833 */ DEFINE_SFX(NA_SE_VO_LI_GROAN_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6834 */ DEFINE_SFX(NA_SE_VO_LI_AUTO_JUMP_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6835 */ DEFINE_SFX(NA_SE_VO_LI_MAGIC_NALE_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6836 */ DEFINE_SFX(NA_SE_VO_LI_SURPRISE_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6837 */ DEFINE_SFX(NA_SE_VO_LI_MAGIC_FROL_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6838 */ DEFINE_SFX(NA_SE_VO_LI_PUSH_KID, 0x30, 1, 2, SFX_FLAG_10) -/* 0x6839 */ DEFINE_SFX(NA_SE_VO_LI_HOOKSHOT_HANG_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x683A */ DEFINE_SFX(NA_SE_VO_LI_LAND_DAMAGE_S_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x683B */ DEFINE_SFX(NA_SE_VO_LI_NULL_0x1b_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x683C */ DEFINE_SFX(NA_SE_VO_LI_MAGIC_ATTACK_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x683D */ DEFINE_SFX(NA_SE_VO_BL_DOWN_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x683E */ DEFINE_SFX(NA_SE_VO_LI_DEMO_DAMAGE_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x683F */ DEFINE_SFX(NA_SE_VO_LI_ELECTRIC_SHOCK_LV_KID, 0x30, 2, 0, SFX_FLAG_10) -/* 0x6840 */ DEFINE_SFX(NA_SE_VO_NAVY_ENEMY, 0x60, 0, 0, SFX_FLAG_5) -/* 0x6841 */ DEFINE_SFX(NA_SE_VO_NAVY_HELLO, 0x30, 0, 0, SFX_FLAG_5) -/* 0x6842 */ DEFINE_SFX(NA_SE_VO_NAVY_HEAR, 0x30, 0, 0, SFX_FLAG_5) -/* 0x6843 */ DEFINE_SFX(NA_SE_VO_NAVY_CALL, 0x60, 0, 0, 0) -/* 0x6844 */ DEFINE_SFX(NA_SE_VO_NA_HELLO_3, 0x30, 0, 0, 0) -/* 0x6845 */ DEFINE_SFX(NA_SE_VO_DUMMY_0x45, 0x30, 0, 0, 0) -/* 0x6846 */ DEFINE_SFX(NA_SE_VO_DUMMY_0x46, 0x30, 0, 0, 0) -/* 0x6847 */ DEFINE_SFX(NA_SE_VO_DUMMY_0x47, 0x30, 0, 0, 0) -/* 0x6848 */ DEFINE_SFX(NA_SE_VO_DUMMY_0x48, 0x30, 0, 0, 0) -/* 0x6849 */ DEFINE_SFX(NA_SE_VO_DUMMY_0x49, 0x30, 0, 0, 0) -/* 0x684A */ DEFINE_SFX(NA_SE_VO_DUMMY_0x4a, 0x30, 0, 0, 0) -/* 0x684B */ DEFINE_SFX(NA_SE_VO_DUMMY_0x4b, 0x30, 0, 0, 0) -/* 0x684C */ DEFINE_SFX(NA_SE_VO_DUMMY_0x4c, 0x30, 0, 0, 0) -/* 0x684D */ DEFINE_SFX(NA_SE_VO_DUMMY_0x4d, 0x30, 0, 0, 0) -/* 0x684E */ DEFINE_SFX(NA_SE_VO_DUMMY_0x4e, 0x30, 0, 0, 0) -/* 0x684F */ DEFINE_SFX(NA_SE_VO_DUMMY_0x4f, 0x30, 0, 0, 0) -/* 0x6850 */ DEFINE_SFX(NA_SE_VO_TA_SLEEP, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6851 */ DEFINE_SFX(NA_SE_VO_TA_SURPRISE, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6852 */ DEFINE_SFX(NA_SE_VO_TA_CRY_0, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6853 */ DEFINE_SFX(NA_SE_VO_TA_CRY_1, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6854 */ DEFINE_SFX(NA_SE_VO_IN_CRY_0, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6855 */ DEFINE_SFX(NA_SE_VO_IN_LOST, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6856 */ DEFINE_SFX(NA_SE_VO_IN_LASH_0, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6857 */ DEFINE_SFX(NA_SE_VO_IN_LASH_1, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6858 */ DEFINE_SFX(NA_SE_VO_FR_LAUGH_0, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6859 */ DEFINE_SFX(NA_SE_VO_FR_SMILE_0, 0x30, 1, 1, SFX_FLAG_15) -/* 0x685A */ DEFINE_SFX(NA_SE_VO_NB_AGONY, 0x30, 1, 1, SFX_FLAG_15) -/* 0x685B */ DEFINE_SFX(NA_SE_VO_NB_CRY_0, 0x30, 1, 1, SFX_FLAG_15) -/* 0x685C */ DEFINE_SFX(NA_SE_VO_NB_NOTICE, 0x30, 1, 1, SFX_FLAG_15) -/* 0x685D */ DEFINE_SFX(NA_SE_VO_NA_HELLO_0, 0x30, 1, 1, SFX_FLAG_15) -/* 0x685E */ DEFINE_SFX(NA_SE_VO_NA_HELLO_1, 0x30, 1, 1, SFX_FLAG_15) -/* 0x685F */ DEFINE_SFX(NA_SE_VO_NA_HELLO_2, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6860 */ DEFINE_SFX(NA_SE_VO_RT_CRASH, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6861 */ DEFINE_SFX(NA_SE_VO_RT_DISCOVER, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6862 */ DEFINE_SFX(NA_SE_VO_RT_FALL, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6863 */ DEFINE_SFX(NA_SE_VO_RT_LAUGH_0, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6864 */ DEFINE_SFX(NA_SE_VO_RT_LIFT, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6865 */ DEFINE_SFX(NA_SE_VO_RT_THROW, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6866 */ DEFINE_SFX(NA_SE_VO_RT_UNBALLANCE, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6867 */ DEFINE_SFX(NA_SE_VO_ST_DAMAGE, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6868 */ DEFINE_SFX(NA_SE_VO_ST_ATTACK, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6869 */ DEFINE_SFX(NA_SE_VO_Z0_HURRY, 0x30, 1, 1, SFX_FLAG_15) -/* 0x686A */ DEFINE_SFX(NA_SE_VO_Z0_MEET, 0x30, 1, 1, SFX_FLAG_15) -/* 0x686B */ DEFINE_SFX(NA_SE_VO_Z0_QUESTION, 0x30, 1, 1, SFX_FLAG_15) -/* 0x686C */ DEFINE_SFX(NA_SE_VO_Z0_SIGH_0, 0x30, 1, 1, SFX_FLAG_15) -/* 0x686D */ DEFINE_SFX(NA_SE_VO_Z0_SMILE_0, 0x30, 1, 1, SFX_FLAG_15) -/* 0x686E */ DEFINE_SFX(NA_SE_VO_Z0_SURPRISE, 0x30, 1, 1, SFX_FLAG_15) -/* 0x686F */ DEFINE_SFX(NA_SE_VO_Z0_THROW, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6870 */ DEFINE_SFX(NA_SE_VO_SK_CRY_0, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6871 */ DEFINE_SFX(NA_SE_VO_SK_CRY_1, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6872 */ DEFINE_SFX(NA_SE_VO_SK_CRASH, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6873 */ DEFINE_SFX(NA_SE_VO_SK_LAUGH, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6874 */ DEFINE_SFX(NA_SE_VO_SK_SHOUT, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6875 */ DEFINE_SFX(NA_SE_VO_Z1_CRY_0, 0x30, 3, 1, SFX_FLAG_15) -/* 0x6876 */ DEFINE_SFX(NA_SE_VO_Z1_CRY_1, 0x30, 3, 1, SFX_FLAG_15) -/* 0x6877 */ DEFINE_SFX(NA_SE_VO_Z1_OPENDOOR, 0x30, 3, 1, SFX_FLAG_15) -/* 0x6878 */ DEFINE_SFX(NA_SE_VO_Z1_SURPRISE, 0x30, 1, 1, SFX_FLAG_15) -/* 0x6879 */ DEFINE_SFX(NA_SE_VO_Z1_PAIN, 0x30, 1, 1, SFX_FLAG_15) -/* 0x687A */ DEFINE_SFX(NA_SE_VO_KZ_MOVE, 0x30, 1, 1, SFX_FLAG_15) -/* 0x687B */ DEFINE_SFX(NA_SE_VO_NB_LAUGH, 0x30, 1, 1, SFX_FLAG_15) -/* 0x687C */ DEFINE_SFX(NA_SE_VO_IN_LAUGH, 0x30, 1, 1, SFX_FLAG_15) -/* 0x687D */ DEFINE_SFX(NA_SE_VO_DUMMY_0x7d, 0x30, 1, 1, SFX_FLAG_15) -/* 0x687E */ DEFINE_SFX(NA_SE_VO_DUMMY_0x7e, 0x30, 1, 1, SFX_FLAG_15) -/* 0x687F */ DEFINE_SFX(NA_SE_VO_DUMMY_0x7f, 0x30, 1, 1, SFX_FLAG_15) +/* Player Voices: Adult Link */ +/* 0x6800 */ DEFINE_SFX(CHAN_615D, NA_SE_VO_LI_SWORD_N, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6801 */ DEFINE_SFX(CHAN_6175, NA_SE_VO_LI_SWORD_L, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6802 */ DEFINE_SFX(CHAN_619B, NA_SE_VO_LI_LASH, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6803 */ DEFINE_SFX(CHAN_61C1, NA_SE_VO_LI_HANG, 0x20, 2, 0, SFX_FLAG_10) +/* 0x6804 */ DEFINE_SFX(CHAN_61D5, NA_SE_VO_LI_CLIMB_END, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6805 */ DEFINE_SFX(CHAN_61EA, NA_SE_VO_LI_DAMAGE_S, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6806 */ DEFINE_SFX(CHAN_6201, NA_SE_VO_LI_FREEZE, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6807 */ DEFINE_SFX(CHAN_6218, NA_SE_VO_LI_FALL_S, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6808 */ DEFINE_SFX(CHAN_622D, NA_SE_VO_LI_FALL_L, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6809 */ DEFINE_SFX(CHAN_6242, NA_SE_VO_LI_BREATH_REST, 0x30, 2, 1, SFX_FLAG_10) +/* 0x680A */ DEFINE_SFX(CHAN_6257, NA_SE_VO_LI_BREATH_DRINK, 0x30, 2, 1, SFX_FLAG_10) +/* 0x680B */ DEFINE_SFX(CHAN_625F, NA_SE_VO_LI_DOWN, 0x30, 2, 0, SFX_FLAG_10) +/* 0x680C */ DEFINE_SFX(CHAN_626F, NA_SE_VO_LI_TAKEN_AWAY, 0x30, 2, 0, SFX_FLAG_10) +/* 0x680D */ DEFINE_SFX(CHAN_6284, NA_SE_VO_LI_HELD, 0x50, 2, 0, SFX_FLAG_10) +/* 0x680E */ DEFINE_SFX(CHAN_6287, NA_SE_VO_LI_SNEEZE, 0x30, 2, 0, SFX_FLAG_10) +/* 0x680F */ DEFINE_SFX(CHAN_6299, NA_SE_VO_LI_SWEAT, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6810 */ DEFINE_SFX(CHAN_62AB, NA_SE_VO_LI_DRINK, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6811 */ DEFINE_SFX(CHAN_62B4, NA_SE_VO_LI_RELAX, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6812 */ DEFINE_SFX(CHAN_62C6, NA_SE_VO_LI_SWORD_PUTAWAY, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6813 */ DEFINE_SFX(CHAN_649B, NA_SE_VO_LI_GROAN, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6814 */ DEFINE_SFX(CHAN_62CE, NA_SE_VO_LI_AUTO_JUMP, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6815 */ DEFINE_SFX(CHAN_62EC, NA_SE_VO_LI_MAGIC_NALE, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6816 */ DEFINE_SFX(CHAN_62F4, NA_SE_VO_LI_SURPRISE, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6817 */ DEFINE_SFX(CHAN_62FE, NA_SE_VO_LI_MAGIC_FROL, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6818 */ DEFINE_SFX(CHAN_6306, NA_SE_VO_LI_PUSH, 0x30, 2, 2, SFX_FLAG_10) +/* 0x6819 */ DEFINE_SFX(CHAN_630E, NA_SE_VO_LI_HOOKSHOT_HANG, 0x30, 2, 0, SFX_FLAG_10) +/* 0x681A */ DEFINE_SFX(CHAN_6316, NA_SE_VO_LI_LAND_DAMAGE_S, 0x30, 2, 0, SFX_FLAG_10) +/* 0x681B */ DEFINE_SFX(CHAN_631E, NA_SE_VO_LI_NULL_0x1b, 0x30, 2, 0, SFX_FLAG_10) +/* 0x681C */ DEFINE_SFX(CHAN_6326, NA_SE_VO_LI_MAGIC_ATTACK, 0x30, 2, 0, SFX_FLAG_10) +/* 0x681D */ DEFINE_SFX(CHAN_622D, NA_SE_VO_BL_DOWN, 0x80, 2, 0, SFX_FLAG_10) +/* 0x681E */ DEFINE_SFX(CHAN_632E, NA_SE_VO_LI_DEMO_DAMAGE, 0x30, 2, 0, SFX_FLAG_10) +/* 0x681F */ DEFINE_SFX(CHAN_615D, NA_SE_VO_LI_ELECTRIC_SHOCK_LV, 0x30, 2, 0, SFX_FLAG_10) +/* Player Voices: Child Link */ +/* 0x6820 */ DEFINE_SFX(CHAN_6336, NA_SE_VO_LI_SWORD_N_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6821 */ DEFINE_SFX(CHAN_634F, NA_SE_VO_LI_ROLLING_CUT_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6822 */ DEFINE_SFX(CHAN_619B, NA_SE_VO_LI_LASH_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6823 */ DEFINE_SFX(CHAN_6376, NA_SE_VO_LI_HANG_KID, 0x20, 2, 0, SFX_FLAG_10) +/* 0x6824 */ DEFINE_SFX(CHAN_639A, NA_SE_VO_LI_CLIMB_END_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6825 */ DEFINE_SFX(CHAN_63AF, NA_SE_VO_LI_DAMAGE_S_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6826 */ DEFINE_SFX(CHAN_63C6, NA_SE_VO_LI_FREEZE_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6827 */ DEFINE_SFX(CHAN_63DD, NA_SE_VO_LI_FALL_S_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6828 */ DEFINE_SFX(CHAN_63F2, NA_SE_VO_LI_FALL_L_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6829 */ DEFINE_SFX(CHAN_6407, NA_SE_VO_LI_BREATH_REST_KID, 0x30, 2, 1, SFX_FLAG_10) +/* 0x682A */ DEFINE_SFX(CHAN_641C, NA_SE_VO_LI_BREATH_DRINK_KID, 0x30, 2, 1, SFX_FLAG_10) +/* 0x682B */ DEFINE_SFX(CHAN_6424, NA_SE_VO_LI_DOWN_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x682C */ DEFINE_SFX(CHAN_6434, NA_SE_VO_LI_TAKEN_AWAY_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x682D */ DEFINE_SFX(CHAN_6449, NA_SE_VO_LI_HELD_KID, 0x50, 2, 0, SFX_FLAG_10) +/* 0x682E */ DEFINE_SFX(CHAN_6451, NA_SE_VO_LI_SNEEZE_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x682F */ DEFINE_SFX(CHAN_6467, NA_SE_VO_LI_SWEAT_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6830 */ DEFINE_SFX(CHAN_6479, NA_SE_VO_LI_DRINK_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6831 */ DEFINE_SFX(CHAN_6482, NA_SE_VO_LI_RELAX_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6832 */ DEFINE_SFX(CHAN_6493, NA_SE_VO_LI_SWORD_PUTAWAY_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6833 */ DEFINE_SFX(CHAN_649B, NA_SE_VO_LI_GROAN_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6834 */ DEFINE_SFX(CHAN_64A5, NA_SE_VO_LI_AUTO_JUMP_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6835 */ DEFINE_SFX(CHAN_64C9, NA_SE_VO_LI_MAGIC_NALE_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6836 */ DEFINE_SFX(CHAN_64D1, NA_SE_VO_LI_SURPRISE_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6837 */ DEFINE_SFX(CHAN_64DB, NA_SE_VO_LI_MAGIC_FROL_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x6838 */ DEFINE_SFX(CHAN_64E3, NA_SE_VO_LI_PUSH_KID, 0x30, 1, 2, SFX_FLAG_10) +/* 0x6839 */ DEFINE_SFX(CHAN_64EB, NA_SE_VO_LI_HOOKSHOT_HANG_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x683A */ DEFINE_SFX(CHAN_64F3, NA_SE_VO_LI_LAND_DAMAGE_S_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x683B */ DEFINE_SFX(CHAN_64FB, NA_SE_VO_LI_NULL_0x1b_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x683C */ DEFINE_SFX(CHAN_6503, NA_SE_VO_LI_MAGIC_ATTACK_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x683D */ DEFINE_SFX(CHAN_63F2, NA_SE_VO_BL_DOWN_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x683E */ DEFINE_SFX(CHAN_650B, NA_SE_VO_LI_DEMO_DAMAGE_KID, 0x30, 2, 0, SFX_FLAG_10) +/* 0x683F */ DEFINE_SFX(CHAN_615D, NA_SE_VO_LI_ELECTRIC_SHOCK_LV_KID, 0x30, 2, 0, SFX_FLAG_10) +/* */ +/* 0x6840 */ DEFINE_SFX(CHAN_612C, NA_SE_VO_NAVY_ENEMY, 0x60, 0, 0, SFX_FLAG_5) +/* 0x6841 */ DEFINE_SFX(CHAN_612C, NA_SE_VO_NAVY_HELLO, 0x30, 0, 0, SFX_FLAG_5) +/* 0x6842 */ DEFINE_SFX(CHAN_612C, NA_SE_VO_NAVY_HEAR, 0x30, 0, 0, SFX_FLAG_5) +/* 0x6843 */ DEFINE_SFX(CHAN_6581, NA_SE_VO_NAVY_CALL, 0x60, 0, 0, 0) +/* 0x6844 */ DEFINE_SFX(CHAN_6513, NA_SE_VO_NA_HELLO_3, 0x30, 0, 0, 0) +/* 0x6845 */ DEFINE_SFX(CHAN_6581, NA_SE_VO_DUMMY_0x45, 0x30, 0, 0, 0) +/* 0x6846 */ DEFINE_SFX(CHAN_6581, NA_SE_VO_DUMMY_0x46, 0x30, 0, 0, 0) +/* 0x6847 */ DEFINE_SFX(CHAN_6581, NA_SE_VO_DUMMY_0x47, 0x30, 0, 0, 0) +/* 0x6848 */ DEFINE_SFX(CHAN_6581, NA_SE_VO_DUMMY_0x48, 0x30, 0, 0, 0) +/* 0x6849 */ DEFINE_SFX(CHAN_6581, NA_SE_VO_DUMMY_0x49, 0x30, 0, 0, 0) +/* 0x684A */ DEFINE_SFX(CHAN_6581, NA_SE_VO_DUMMY_0x4a, 0x30, 0, 0, 0) +/* 0x684B */ DEFINE_SFX(CHAN_6581, NA_SE_VO_DUMMY_0x4b, 0x30, 0, 0, 0) +/* 0x684C */ DEFINE_SFX(CHAN_6581, NA_SE_VO_DUMMY_0x4c, 0x30, 0, 0, 0) +/* 0x684D */ DEFINE_SFX(CHAN_6581, NA_SE_VO_DUMMY_0x4d, 0x30, 0, 0, 0) +/* 0x684E */ DEFINE_SFX(CHAN_6581, NA_SE_VO_DUMMY_0x4e, 0x30, 0, 0, 0) +/* 0x684F */ DEFINE_SFX(CHAN_6581, NA_SE_VO_DUMMY_0x4f, 0x30, 0, 0, 0) +/* 0x6850 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_TA_SLEEP, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6851 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_TA_SURPRISE, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6852 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_TA_CRY_0, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6853 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_TA_CRY_1, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6854 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_IN_CRY_0, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6855 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_IN_LOST, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6856 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_IN_LASH_0, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6857 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_IN_LASH_1, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6858 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_FR_LAUGH_0, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6859 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_FR_SMILE_0, 0x30, 1, 1, SFX_FLAG_15) +/* 0x685A */ DEFINE_SFX(CHAN_6520, NA_SE_VO_NB_AGONY, 0x30, 1, 1, SFX_FLAG_15) +/* 0x685B */ DEFINE_SFX(CHAN_6520, NA_SE_VO_NB_CRY_0, 0x30, 1, 1, SFX_FLAG_15) +/* 0x685C */ DEFINE_SFX(CHAN_6520, NA_SE_VO_NB_NOTICE, 0x30, 1, 1, SFX_FLAG_15) +/* 0x685D */ DEFINE_SFX(CHAN_6520, NA_SE_VO_NA_HELLO_0, 0x30, 1, 1, SFX_FLAG_15) +/* 0x685E */ DEFINE_SFX(CHAN_6520, NA_SE_VO_NA_HELLO_1, 0x30, 1, 1, SFX_FLAG_15) +/* 0x685F */ DEFINE_SFX(CHAN_6520, NA_SE_VO_NA_HELLO_2, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6860 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_RT_CRASH, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6861 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_RT_DISCOVER, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6862 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_RT_FALL, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6863 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_RT_LAUGH_0, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6864 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_RT_LIFT, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6865 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_RT_THROW, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6866 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_RT_UNBALLANCE, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6867 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_ST_DAMAGE, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6868 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_ST_ATTACK, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6869 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_Z0_HURRY, 0x30, 1, 1, SFX_FLAG_15) +/* 0x686A */ DEFINE_SFX(CHAN_6520, NA_SE_VO_Z0_MEET, 0x30, 1, 1, SFX_FLAG_15) +/* 0x686B */ DEFINE_SFX(CHAN_6520, NA_SE_VO_Z0_QUESTION, 0x30, 1, 1, SFX_FLAG_15) +/* 0x686C */ DEFINE_SFX(CHAN_6520, NA_SE_VO_Z0_SIGH_0, 0x30, 1, 1, SFX_FLAG_15) +/* 0x686D */ DEFINE_SFX(CHAN_6520, NA_SE_VO_Z0_SMILE_0, 0x30, 1, 1, SFX_FLAG_15) +/* 0x686E */ DEFINE_SFX(CHAN_6520, NA_SE_VO_Z0_SURPRISE, 0x30, 1, 1, SFX_FLAG_15) +/* 0x686F */ DEFINE_SFX(CHAN_6520, NA_SE_VO_Z0_THROW, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6870 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_SK_CRY_0, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6871 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_SK_CRY_1, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6872 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_SK_CRASH, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6873 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_SK_LAUGH, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6874 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_SK_SHOUT, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6875 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_Z1_CRY_0, 0x30, 3, 1, SFX_FLAG_15) +/* 0x6876 */ DEFINE_SFX(CHAN_6520, NA_SE_VO_Z1_CRY_1, 0x30, 3, 1, SFX_FLAG_15) +/* 0x6877 */ DEFINE_SFX(CHAN_6562, NA_SE_VO_Z1_OPENDOOR, 0x30, 3, 1, SFX_FLAG_15) +/* 0x6878 */ DEFINE_SFX(CHAN_6562, NA_SE_VO_Z1_SURPRISE, 0x30, 1, 1, SFX_FLAG_15) +/* 0x6879 */ DEFINE_SFX(CHAN_6562, NA_SE_VO_Z1_PAIN, 0x30, 1, 1, SFX_FLAG_15) +/* 0x687A */ DEFINE_SFX(CHAN_6562, NA_SE_VO_KZ_MOVE, 0x30, 1, 1, SFX_FLAG_15) +/* 0x687B */ DEFINE_SFX(CHAN_6562, NA_SE_VO_NB_LAUGH, 0x30, 1, 1, SFX_FLAG_15) +/* 0x687C */ DEFINE_SFX(CHAN_6562, NA_SE_VO_IN_LAUGH, 0x30, 1, 1, SFX_FLAG_15) +/* 0x687D */ DEFINE_SFX(CHAN_6520, NA_SE_VO_DUMMY_0x7d, 0x30, 1, 1, SFX_FLAG_15) +/* 0x687E */ DEFINE_SFX(CHAN_6520, NA_SE_VO_DUMMY_0x7e, 0x30, 1, 1, SFX_FLAG_15) +/* 0x687F */ DEFINE_SFX(CHAN_6520, NA_SE_VO_DUMMY_0x7f, 0x30, 1, 1, SFX_FLAG_15) diff --git a/include/tha.h b/include/tha.h index 1f086b0016..941321b820 100644 --- a/include/tha.h +++ b/include/tha.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "alignment.h" -typedef struct { +typedef struct TwoHeadArena { /* 0x00 */ size_t size; /* 0x04 */ void* start; /* 0x08 */ void* head; diff --git a/include/thga.h b/include/thga.h index 9d9e96950a..fb84506813 100644 --- a/include/thga.h +++ b/include/thga.h @@ -3,7 +3,7 @@ #include "tha.h" -typedef union { +typedef union TwoHeadGfxArena { /* 0x00 */ TwoHeadArena tha; struct { // Same as TwoHeadArena, with different types and field names for the head and tail pointers /* 0x00 */ size_t size; diff --git a/include/ucode_disas.h b/include/ucode_disas.h new file mode 100644 index 0000000000..d1fc901335 --- /dev/null +++ b/include/ucode_disas.h @@ -0,0 +1,49 @@ +#ifndef UCODE_DISAS_H +#define UCODE_DISAS_H + +#include "ultra64.h" + +typedef enum UcodeType { + /* 0 */ UCODE_TYPE_NULL, + /* 1 */ UCODE_TYPE_F3DZEX, + /* 2 */ UCODE_TYPE_UNK, // Likely F3DEX2 or a similar variant + /* 3 */ UCODE_TYPE_S2DEX +} UcodeType; + +typedef struct UCodeInfo { + /* 0x00 */ u32 type; + /* 0x04 */ void* ptr; +} UCodeInfo; // size = 0x8 + +typedef struct UCodeDisas { + /* 0x00 */ uintptr_t segments[NUM_SEGMENTS]; + /* 0x40 */ Gfx* dlStack[18]; + /* 0x88 */ s32 dlDepth; + /* 0x8C */ u32 dlCnt; + /* 0x90 */ u32 vtxCnt; + /* 0x94 */ u32 spvtxCnt; + /* 0x98 */ u32 tri1Cnt; + /* 0x9C */ u32 tri2Cnt; + /* 0xA0 */ u32 quadCnt; + /* 0xA4 */ u32 lineCnt; + /* 0xA8 */ u32 loaducodeCnt; + /* 0xAC */ u32 pipeSyncRequired; + /* 0xB0 */ u32 tileSyncRequired; + /* 0xB4 */ u32 loadSyncRequired; + /* 0xB8 */ u32 syncErr; + /* 0xBC */ s32 enableLog; + /* 0xC0 */ s32 ucodeType; + /* 0xC4 */ s32 ucodeInfoCount; + /* 0xC8 */ UCodeInfo* ucodeInfo; + /* 0xCC */ u32 modeH; + /* 0xD0 */ u32 modeL; + /* 0xD4 */ u32 geometryMode; +} UCodeDisas; // size = 0xD8 + +void UCodeDisas_Init(UCodeDisas*); +void UCodeDisas_Destroy(UCodeDisas*); +void UCodeDisas_Disassemble(UCodeDisas*, Gfx*); +void UCodeDisas_RegisterUCode(UCodeDisas*, s32, UCodeInfo*); +void UCodeDisas_SetCurUCode(UCodeDisas*, void*); + +#endif diff --git a/include/ultra64.h b/include/ultra64.h index f6460c5834..e1f9a7c9b9 100644 --- a/include/ultra64.h +++ b/include/ultra64.h @@ -7,7 +7,6 @@ #include "libc/stdbool.h" #include "libc/stddef.h" #include "libc/stdint.h" -#include "libc/stdio.h" #include "libc/stdlib.h" #include "libc/string.h" @@ -33,4 +32,185 @@ #include "ultra64/R4300.h" #include "ultra64/ucode.h" +union uObjBg; + +void __osPiCreateAccessQueue(void); +void __osPiGetAccess(void); +void __osPiRelAccess(void); +s32 osSendMesg(OSMesgQueue* mq, OSMesg msg, s32 flag); +void osStopThread(OSThread* thread); +void osViExtendVStart(u32 value); +s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flag); + +#if PLATFORM_N64 +void osInitialize(void); +#else +#define osInitialize() \ + { \ + __osInitialize_common(); \ + __osInitialize_autodetect(); \ + } +#endif + +void __osInitialize_common(void); +void __osInitialize_autodetect(void); +void __osEnqueueAndYield(OSThread**); +void __osEnqueueThread(OSThread**, OSThread*); +OSThread* __osPopThread(OSThread**); +void __osDispatchThread(void); +void __osCleanupThread(void); +void __osDequeueThread(OSThread** queue, OSThread* thread); +void osDestroyThread(OSThread* thread); +void osCreateThread(OSThread* thread, OSId id, void (*entry)(void*), void* arg, void* sp, OSPri pri); +void __osSetSR(u32); +u32 __osGetSR(void); +void osWritebackDCache(void* vaddr, s32 nbytes); +void* osViGetNextFramebuffer(void); +void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQueue, OSMesg* cmdBuf, s32 cmdMsgCnt); +void __osDevMgrMain(void* arg); +s32 __osPiRawStartDma(s32 dir, u32 cartAddr, void* dramAddr, size_t size); +u32 osVirtualToPhysical(void* vaddr); +void osViBlack(u8 active); +s32 __osSiRawReadIo(void* devAddr, u32* dst); +OSId osGetThreadId(OSThread* thread); +void osViSetMode(OSViMode* mode); +u32 __osProbeTLB(void*); +u32 osGetMemSize(void); +void osSetEventMesg(OSEvent e, OSMesgQueue* mq, OSMesg msg); +void osUnmapTLBAll(void); +s32 osEPiStartDma(OSPiHandle* handle, OSIoMesg* mb, s32 direction); +void osInvalICache(void* vaddr, s32 nbytes); +void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msg, s32 count); +void osInvalDCache(void* vaddr, s32 nbytes); +s32 __osSiDeviceBusy(void); +s32 osJamMesg(OSMesgQueue* mq, OSMesg msg, s32 flag); +void osSetThreadPri(OSThread* thread, OSPri pri); +OSPri osGetThreadPri(OSThread* thread); +s32 __osEPiRawReadIo(OSPiHandle* handle, u32 devAddr, u32* data); +void osViSwapBuffer(void* frameBufPtr); +s32 __osEPiRawStartDma(OSPiHandle* handle, s32 direction, u32 cartAddr, void* dramAddr, size_t size); +OSTime osGetTime(void); +void osSetTime(OSTime time); +void __osTimerServicesInit(void); +void __osTimerInterrupt(void); +void __osSetTimerIntr(OSTime time); +OSTime __osInsertTimer(OSTimer* timer); +u32 osGetCount(void); +void __osSetCompare(u32); +s32 __osDisableInt(void); +void __osRestoreInt(s32); +void __osViInit(void); +void __osViSwapContext(void); +OSMesgQueue* osPiGetCmdQueue(void); +s32 osEPiReadIo(OSPiHandle* handle, u32 devAddr, u32* data); +void osViSetSpecialFeatures(u32 func); +OSPiHandle* osCartRomInit(void); +void __osSetFpcCsr(u32); +u32 __osGetFpcCsr(void); +s32 osEPiWriteIo(OSPiHandle* handle, u32 devAddr, u32 data); +void osMapTLBRdb(void); +void osYieldThread(void); +u32 __osGetCause(void); +s32 __osEPiRawWriteIo(OSPiHandle* handle, u32 devAddr, u32 data); +s32 __osSiRawWriteIo(void* devAddr, u32 val); +void osCreateViManager(OSPri pri); +OSViContext* __osViGetCurrentContext(void); +void osStartThread(OSThread* thread); +void osViSetYScale(f32 scale); +void osViSetXScale(f32 value); +void __osSetWatchLo(u32); + +s32 osPfsFreeBlocks(OSPfs* pfs, s32* leftoverBytes); +void guScale(Mtx* m, f32 x, f32 y, f32 z); +OSTask* _VirtualToPhysicalTask(OSTask* intp); +void osSpTaskLoad(OSTask* intp); +void osSpTaskStartGo(OSTask* tp); +void __osSiCreateAccessQueue(void); +void __osSiGetAccess(void); +void __osSiRelAccess(void); +s32 osContInit(OSMesgQueue* mq, u8* ctlBitfield, OSContStatus* status); +void __osContGetInitData(u8* ctlBitfield, OSContStatus* data); +void __osPackRequestData(u8 poll); +s32 osContStartReadData(OSMesgQueue* mq); +void osContGetReadData(OSContPad* contData); +void __osPackReadData(void); +void guPerspectiveF(f32 mf[4][4], u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale); +void guPerspective(Mtx* m, u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale); +s32 __osSpRawStartDma(s32 direction, void* devAddr, void* dramAddr, u32 size); +s32 __osSiRawStartDma(s32 dir, void* addr); +void osSpTaskYield(void); +s32 __osPfsGetNextPage(OSPfs* pfs, u8* bank, __OSInode* inode, __OSInodeUnit* page); +s32 osPfsReadWriteFile(OSPfs* pfs, s32 fileNo, u8 flag, s32 offset, s32 size, u8* data); +s32 __osPfsGetStatus(OSMesgQueue* queue, s32 channel); +void __osPfsRequestOneChannel(s32 channel, u8 cmd); +void __osPfsGetOneChannelData(s32 channel, OSContStatus* contData); +void guMtxIdentF(f32 mf[4][4]); +void guLookAtF(f32 mf[4][4], f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp); +void guLookAt(Mtx*, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp); +s32 osPfsAllocateFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32 fileSize, s32* fileNo); +s32 __osPfsDeclearPage(OSPfs* pfs, __OSInode* inode, s32 fileSizeInPages, s32* startPage, u8 bank, s32* decleared, + s32* finalPage); +s32 osStopTimer(OSTimer* timer); +u16 __osSumcalc(u8* ptr, s32 length); +s32 __osIdCheckSum(u16* ptr, u16* checkSum, u16* idSum); +s32 __osRepairPackId(OSPfs* pfs, __OSPackId* badid, __OSPackId* newid); +s32 __osCheckPackId(OSPfs* pfs, __OSPackId* check); +s32 __osGetId(OSPfs* pfs); +s32 __osCheckId(OSPfs* pfs); +s32 __osPfsRWInode(OSPfs* pfs, __OSInode* inode, u8 flag, u8 bank); +void guMtxL2F(f32 mf[4][4], Mtx* m); +s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32* fileNo); +s32 osAfterPreNMI(void); +s32 osContStartQuery(OSMesgQueue* mq); +void osContGetQuery(OSContStatus* data); +void guLookAtHiliteF(f32 mf[4][4], LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, + f32 xUp, f32 yUp, f32 zUp, f32 xl1, f32 yl1, f32 zl1, f32 xl2, f32 yl2, f32 zl2, s32 hiliteWidth, + s32 hiliteHeight); +void guLookAtHilite(Mtx* m, LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, + f32 yUp, f32 zUp, f32 xl1, f32 yl1, f32 zl1, f32 xl2, f32 yl2, f32 zl2, s32 hiliteWidth, + s32 hiliteHeight); +u32 __osSpDeviceBusy(void); +void guMtxIdent(Mtx*); +void guPositionF(f32 mf[4][4], f32 rot, f32 pitch, f32 yaw, f32 scale, f32 x, f32 y, f32 z); +void guPosition(Mtx*, f32, f32, f32, f32, f32, f32, f32); +OSYieldResult osSpTaskYielded(OSTask* task); +void guRotateF(f32 m[4][4], f32 a, f32 x, f32 y, f32 z); +void guRotate(Mtx*, f32 a, f32 x, f32 y, f32 z); +s32 osAiSetFrequency(u32 frequency); +OSThread* __osGetActiveQueue(void); +void guNormalize(f32* x, f32* y, f32* z); +u32 osDpGetStatus(void); +void osDpSetStatus(u32 status); +s32 osPfsDeleteFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName); +s32 __osPfsReleasePages(OSPfs* pfs, __OSInode* inode, u8 initialPage, u8 bank, __OSInodeUnit* finalPage); +void guOrthoF(f32[4][4], f32, f32, f32, f32, f32, f32, f32); +void guOrtho(Mtx*, f32, f32, f32, f32, f32, f32, f32); +void osViSetEvent(OSMesgQueue* mq, OSMesg msg, u32 retraceCount); +s32 osPfsIsPlug(OSMesgQueue* mq, u8* pattern); +void __osPfsRequestData(u8 cmd); +void __osPfsGetInitData(u8* pattern, OSContStatus* contData); +void guS2DInitBg(union uObjBg* bg); +s32 __osPfsSelectBank(OSPfs* pfs, u8 bank); +s32 osContSetCh(u8 ch); +s32 osPfsFileState(OSPfs* pfs, s32 fileNo, OSPfsState* state); +s32 osPfsInitPak(OSMesgQueue* queue, OSPfs* pfs, s32 channel); +s32 __osPfsCheckRamArea(OSPfs* pfs); +s32 osPfsChecker(OSPfs* pfs); +s32 func_80105788(OSPfs* pfs, __OSInodeCache* cache); +s32 func_80105A60(OSPfs* pfs, __OSInodeUnit fpage, __OSInodeCache* cache); +u32 osAiGetLength(void); +void guTranslate(Mtx* m, f32 x, f32 y, f32 z); +s32 __osContRamWrite(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer, s32 force); +s32 __osContRamRead(OSMesgQueue* ctrlrqueue, s32 channel, u16 addr, u8* data); +u8 __osContAddressCrc(u16 addr); +u8 __osContDataCrc(u8* data); +s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* mq, OSMesg msg); +u32 __osSpGetStatus(void); +void __osSpSetStatus(u32 status); +void osWritebackDCacheAll(void); +OSThread* __osGetCurrFaultedThread(void); +void guMtxF2L(f32 mf[4][4], Mtx* m); +void* osViGetCurrentFramebuffer(void); +s32 __osSpSetPc(void* pc); + #endif diff --git a/include/ultra64/abi.h b/include/ultra64/abi.h index a71beb9e79..1dda80dbca 100644 --- a/include/ultra64/abi.h +++ b/include/ultra64/abi.h @@ -49,28 +49,28 @@ * Data Structures. */ -typedef struct { +typedef struct Aadpcm { u32 cmd : 8; u32 flags : 8; u32 gain : 16; u32 addr; } Aadpcm; -typedef struct { +typedef struct Apolef { u32 cmd : 8; u32 flags : 8; u32 gain : 16; u32 addr; } Apolef; -typedef struct { +typedef struct Aenvelope { u32 cmd : 8; u32 flags : 8; u32 pad1 : 16; u32 addr; } Aenvelope; -typedef struct { +typedef struct Aclearbuff { u32 cmd : 8; u32 pad1 : 8; u32 dmem : 16; @@ -78,7 +78,7 @@ typedef struct { u32 count : 16; } Aclearbuff; -typedef struct { +typedef struct Ainterleave { u32 cmd : 8; u32 pad1 : 8; u32 pad2 : 16; @@ -86,20 +86,20 @@ typedef struct { u32 inR : 16; } Ainterleave; -typedef struct { +typedef struct Aloadbuff { u32 cmd : 8; u32 pad1 : 24; u32 addr; } Aloadbuff; -typedef struct { +typedef struct Aenvmixer { u32 cmd : 8; u32 flags : 8; u32 pad1 : 16; u32 addr; } Aenvmixer; -typedef struct { +typedef struct Amixer { u32 cmd : 8; u32 flags : 8; u32 gain : 16; @@ -107,34 +107,34 @@ typedef struct { u32 dmemo : 16; } Amixer; -typedef struct { +typedef struct Apan { u32 cmd : 8; u32 flags : 8; u32 dmem2 : 16; u32 addr; } Apan; -typedef struct { +typedef struct Aresample { u32 cmd : 8; u32 flags : 8; u32 pitch : 16; u32 addr; } Aresample; -typedef struct { +typedef struct Areverb { u32 cmd : 8; u32 flags : 8; u32 pad1 : 16; u32 addr; } Areverb; -typedef struct { +typedef struct Asavebuff { u32 cmd : 8; u32 pad1 : 24; u32 addr; } Asavebuff; -typedef struct { +typedef struct Asegment { u32 cmd : 8; u32 pad1 : 24; u32 pad2 : 2; @@ -142,7 +142,7 @@ typedef struct { u32 base : 24; } Asegment; -typedef struct { +typedef struct Asetbuff { u32 cmd : 8; u32 flags : 8; u32 dmemin : 16; @@ -150,7 +150,7 @@ typedef struct { u32 count : 16; } Asetbuff; -typedef struct { +typedef struct Asetvol { u32 cmd : 8; u32 flags : 8; u32 vol : 16; @@ -158,7 +158,7 @@ typedef struct { u32 volrate : 16; } Asetvol; -typedef struct { +typedef struct Admemmove { u32 cmd : 8; u32 pad1 : 8; u32 dmemin : 16; @@ -166,14 +166,14 @@ typedef struct { u32 count : 16; } Admemmove; -typedef struct { +typedef struct Aloadadpcm { u32 cmd : 8; u32 pad1 : 8; u32 count : 16; u32 addr; } Aloadadpcm; -typedef struct { +typedef struct Asetloop { u32 cmd : 8; u32 pad1 : 8; u32 pad2 : 16; @@ -184,12 +184,12 @@ typedef struct { * Generic Acmd Packet */ -typedef struct { +typedef struct Awords { u32 w0; u32 w1; } Awords; -typedef union { +typedef union Acmd { Awords words; Aadpcm adpcm; Apolef polef; diff --git a/include/ultra64/controller.h b/include/ultra64/controller.h index 9178991d94..4ce047a201 100644 --- a/include/ultra64/controller.h +++ b/include/ultra64/controller.h @@ -103,29 +103,13 @@ #define CONT_BLOCK_GB_BANK CONT_BLOCKS(CONT_ADDR_GB_BANK) #define CONT_BLOCK_GB_STATUS CONT_BLOCKS(CONT_ADDR_GB_STATUS) -/* Buttons */ -#define BTN_CRIGHT 0x0001 -#define BTN_CLEFT 0x0002 -#define BTN_CDOWN 0x0004 -#define BTN_CUP 0x0008 -#define BTN_R 0x0010 -#define BTN_L 0x0020 -#define BTN_DRIGHT 0x0100 -#define BTN_DLEFT 0x0200 -#define BTN_DDOWN 0x0400 -#define BTN_DUP 0x0800 -#define BTN_START 0x1000 -#define BTN_Z 0x2000 -#define BTN_B 0x4000 -#define BTN_A 0x8000 - #ifdef __GNUC__ // Ensure data cache coherency for OSPifRam structures by aligning to the data cache line size. // On older compilers such as IDO this was done by placing each OSPifRam at the top of the file it is declared in, // however file alignment should not be relied on in general. __attribute__((aligned(0x10))) #endif -typedef union { +typedef union OSPifRam { struct { /* 0x00 */ u32 ram[15]; /* 0x3C */ u32 status; @@ -133,20 +117,20 @@ typedef union { u64 force_structure_alignment; } OSPifRam; // size = 0x40 -typedef struct { +typedef struct OSContStatus { /* 0x00 */ u16 type; /* 0x02 */ u8 status; /* 0x03 */ u8 errno; } OSContStatus; // size = 0x04 -typedef struct { +typedef struct OSContPad { /* 0x00 */ u16 button; /* 0x02 */ s8 stick_x; /* 0x03 */ s8 stick_y; /* 0x04 */ u8 errno; } OSContPad; // size = 0x06 -typedef struct { +typedef struct OSContRamIo { /* 0x00 */ void* address; /* 0x04 */ u8 databuffer[32]; /* 0x24 */ u8 addressCrc; @@ -154,7 +138,7 @@ typedef struct { /* 0x26 */ u8 errno; } OSContRamIo; // size = 0x28 -typedef struct { +typedef struct __OSContRequesFormat { /* 0x00 */ u8 align; /* 0x01 */ u8 txsize; /* 0x02 */ u8 rxsize; @@ -165,7 +149,7 @@ typedef struct { /* 0x07 */ u8 align1; } __OSContRequesFormat; // size = 0x8 -typedef struct { +typedef struct __OSContRequesFormatShort { /* 0x00 */ u8 txsize; /* 0x01 */ u8 rxsize; /* 0x02 */ u8 cmd; @@ -174,7 +158,7 @@ typedef struct { /* 0x05 */ u8 status; } __OSContRequesFormatShort; // size = 0x6 -typedef struct { +typedef struct __OSContRamReadFormat { /* 0x00 */ u8 unk_00; /* 0x01 */ u8 txsize; /* 0x02 */ u8 rxsize; @@ -187,7 +171,7 @@ typedef struct { #define READFORMAT(ptr) ((__OSContRamReadFormat*)(ptr)) -typedef struct { +typedef struct __OSContReadFormat { /* 0x00 */ u8 align; /* 0x01 */ u8 txsize; /* 0x02 */ u8 rxsize; diff --git a/include/ultra64/convert.h b/include/ultra64/convert.h index 02024d17fa..13679fc5b0 100644 --- a/include/ultra64/convert.h +++ b/include/ultra64/convert.h @@ -15,7 +15,4 @@ #define OS_PHYSICAL_TO_K0(x) (void*)(((u32)(x)+0x80000000)) #define OS_PHYSICAL_TO_K1(x) (void*)(((u32)(x)+0xA0000000)) -#define OS_MSEC_TO_CYCLES(n) OS_USEC_TO_CYCLES((n) * 1000) -#define OS_SEC_TO_CYCLES(n) OS_MSEC_TO_CYCLES((n) * 1000) - #endif diff --git a/include/ultra64/exception.h b/include/ultra64/exception.h index 7d4977f4f9..886a3b9096 100644 --- a/include/ultra64/exception.h +++ b/include/ultra64/exception.h @@ -38,6 +38,7 @@ typedef struct { /* 0x04 */ void* sp; } __osHwInt; // size = 0x08 +OSIntMask osGetIntMask(void); OSIntMask osSetIntMask(OSIntMask); void __osSetHWIntrRoutine(OSHWIntr intr, s32 (*callback)(void), void* sp); diff --git a/include/ultra64/gbi.h b/include/ultra64/gbi.h index 5ef69b994d..5771a2ee51 100644 --- a/include/ultra64/gbi.h +++ b/include/ultra64/gbi.h @@ -1015,7 +1015,7 @@ /* * Vertex (set up for use with colors) */ -typedef struct { +typedef struct Vtx_t { short ob[3]; /* x, y, z */ unsigned short flag; short tc[2]; /* texture coord */ @@ -1025,7 +1025,7 @@ typedef struct { /* * Vertex (set up for use with normals) */ -typedef struct { +typedef struct Vtx_tn { short ob[3]; /* x, y, z */ unsigned short flag; short tc[2]; /* texture coord */ @@ -1033,7 +1033,7 @@ typedef struct { unsigned char a; /* alpha */ } Vtx_tn; -typedef union { +typedef union Vtx { Vtx_t v; /* Use this one for colors */ Vtx_tn n; /* Use this one for normals */ long long int force_structure_alignment; @@ -1043,7 +1043,7 @@ typedef union { * Sprite structure */ -typedef struct { +typedef struct uSprite_t { void* SourceImagePointer; void* TlutPointer; short Stride; @@ -1059,7 +1059,7 @@ typedef struct { char dummy[4]; } uSprite_t; -typedef union { +typedef union uSprite { uSprite_t s; /* Need to make sure this is 64 bit aligned */ @@ -1069,7 +1069,7 @@ typedef union { /* * Triangle face */ -typedef struct { +typedef struct Tri { unsigned char flag; unsigned char v[3]; } Tri; @@ -1080,7 +1080,7 @@ typedef struct { * Last 8 words are the fraction portion of the 4x4 matrix */ typedef long int Mtx_t[4][4]; -typedef union { +typedef union Mtx { Mtx_t m; struct { u16 intPart[4][4]; @@ -1150,13 +1150,13 @@ typedef union { * (SCREEN_WD/2)*4, (SCREEN_HT/2)*4, G_MAXZ, 0, * (SCREEN_WD/2)*4, (SCREEN_HT/2)*4, 0, 0, */ -typedef struct { +typedef struct Vp_t { short vscale[4]; /* scale, 2 bits fraction */ short vtrans[4]; /* translate, 2 bits fraction */ /* both the above arrays are padded to 64-bit boundary */ } Vp_t; -typedef union { +typedef union Vp { Vp_t vp; long long int force_structure_alignment; } Vp; @@ -1316,7 +1316,7 @@ typedef union { * */ -typedef struct { +typedef struct Light_t { unsigned char col[3]; /* diffuse light value (rgba) */ char pad1; unsigned char colc[3]; /* copy of diffuse light value (rgba) */ @@ -1326,7 +1326,7 @@ typedef struct { } Light_t; #ifdef F3DEX_GBI_PL -typedef struct { +typedef struct PointLight_t { unsigned char col[3]; /* point light value (rgba) */ unsigned char kc; /* constant attenuation (> 0 indicates point light) */ unsigned char colc[3]; /* copy of point light value (rgba) */ @@ -1336,14 +1336,14 @@ typedef struct { } PointLight_t; #endif -typedef struct { +typedef struct Ambient_t { unsigned char col[3]; /* ambient light value (rgba) */ char pad1; unsigned char colc[3]; /* copy of ambient light value (rgba) */ char pad2; } Ambient_t; -typedef struct { +typedef struct Hilite_t { /* texture offsets for highlight 1/2 */ int x1; int y1; @@ -1351,7 +1351,7 @@ typedef struct { int y2; } Hilite_t; -typedef union { +typedef union Light { Light_t l; #ifdef F3DEX_GBI_PL PointLight_t p; @@ -1359,61 +1359,61 @@ typedef union { long long int force_structure_alignment[2]; } Light; -typedef union { +typedef union Ambient { Ambient_t l; long long int force_structure_alignment[1]; } Ambient; -typedef struct { +typedef struct Lightsn { Ambient a; Light l[7]; } Lightsn; -typedef struct { +typedef struct Lights0 { Ambient a; Light l[1]; } Lights0; -typedef struct { +typedef struct Lights1 { Ambient a; Light l[1]; } Lights1; -typedef struct { +typedef struct Lights2 { Ambient a; Light l[2]; } Lights2; -typedef struct { +typedef struct Lights3 { Ambient a; Light l[3]; } Lights3; -typedef struct { +typedef struct Lights4 { Ambient a; Light l[4]; } Lights4; -typedef struct { +typedef struct Lights5 { Ambient a; Light l[5]; } Lights5; -typedef struct { +typedef struct Lights6 { Ambient a; Light l[6]; } Lights6; -typedef struct { +typedef struct Lights7 { Ambient a; Light l[7]; } Lights7; -typedef struct { +typedef struct LookAt { Light l[2]; } LookAt; -typedef union { +typedef union Hilite { Hilite_t h; long int force_structure_alignment; } Hilite; @@ -1682,7 +1682,7 @@ typedef union { }}, \ }} -typedef struct { +typedef struct Gnoop { int cmd : 8; unsigned int type : 8; unsigned int len : 16; @@ -1700,7 +1700,7 @@ typedef struct { /* * Graphics DMA Packet */ -typedef struct { +typedef struct Gdma { int cmd : 8; unsigned int par : 8; unsigned int len : 16; @@ -1708,7 +1708,7 @@ typedef struct { } Gdma; #ifdef F3DEX_GBI_2 -typedef struct { +typedef struct Gdma2 { int cmd : 8; unsigned int len : 8; unsigned int ofs : 8; @@ -1721,7 +1721,7 @@ typedef struct { * Graphics Moveword Packet */ // Inaccurate for F3DEX2, offset and index are swapped -typedef struct { +typedef struct Gmovewd { int cmd : 8; unsigned int offset : 16; unsigned int index : 8; @@ -1731,7 +1731,7 @@ typedef struct { /* * Graphics Movemem Packet */ -typedef struct { +typedef struct Gmovemem { int cmd : 8; unsigned int size : 8; unsigned int offset : 8; @@ -1742,24 +1742,24 @@ typedef struct { /* * Graphics Immediate Mode Packet types */ -typedef struct { +typedef struct Gtri { int cmd : 8; int pad : 24; Tri tri; } Gtri; #if (defined(F3DLP_GBI) || defined(F3DEX_GBI)) -typedef struct { +typedef struct Gtri2 { Tri tri1; /* flag is the command byte */ Tri tri2; } Gtri2; -typedef struct { +typedef struct Gquad { Tri tri1; /* flag is the command byte */ Tri tri2; } Gquad; -typedef struct { +typedef struct Gcull { int cmd : 8; unsigned int pad : 8; unsigned short vstart_x2; @@ -1768,14 +1768,14 @@ typedef struct { } Gcull; #endif -typedef struct { +typedef struct Gsetprimdepth { int cmd : 8; unsigned int pad : 24; unsigned short z; unsigned short dz; } Gsetprimdepth; -typedef struct { +typedef struct Gpopmtx { int cmd : 8; int pad1 : 24; #ifdef F3DEX_GBI_2 @@ -1787,7 +1787,7 @@ typedef struct { } Gpopmtx; /* - * typedef struct { + * typedef struct Gsegment { * int cmd:8; * int pad0:24; * int pad1:4; @@ -1795,7 +1795,7 @@ typedef struct { * int base:24; * } Gsegment; */ -typedef struct { +typedef struct Gsegment { int cmd : 8; int pad0 : 8; int mw_index : 8; @@ -1804,7 +1804,7 @@ typedef struct { int base : 24; } Gsegment; -typedef struct { +typedef struct GsetothermodeL { int cmd : 8; int pad0 : 8; unsigned int sft : 8; @@ -1812,7 +1812,7 @@ typedef struct { unsigned int data : 32; } GsetothermodeL; -typedef struct { +typedef struct GsetothermodeH { int cmd : 8; int pad0 : 8; unsigned int sft : 8; @@ -1820,7 +1820,7 @@ typedef struct { unsigned int data : 32; } GsetothermodeH; -typedef struct { +typedef struct Gtexture { unsigned char cmd; unsigned char lodscale; #ifdef F3DEX_GBI_2 @@ -1835,7 +1835,7 @@ typedef struct { unsigned short t; } Gtexture; -typedef struct { +typedef struct Gline3D { int cmd : 8; #ifdef F3DEX_GBI_2 unsigned char v0; @@ -1848,7 +1848,7 @@ typedef struct { #endif } Gline3D; -typedef struct { +typedef struct Gperspnorm { int cmd : 8; int pad1 : 24; short int pad2; @@ -1859,7 +1859,7 @@ typedef struct { /* * RDP Packet types */ -typedef struct { +typedef struct Gsetimg { int cmd : 8; unsigned int fmt : 3; unsigned int siz : 2; @@ -1868,7 +1868,7 @@ typedef struct { unsigned int dram; /* to account for 1024 */ } Gsetimg; -typedef struct { +typedef struct Gsetcombine { int cmd : 8; // muxs0 unsigned int a0 : 4; @@ -1890,7 +1890,7 @@ typedef struct { unsigned int Ad1 : 3; } Gsetcombine; -typedef struct { +typedef struct Gsetcolor { int cmd : 8; unsigned char pad; unsigned char prim_min_level; @@ -1906,7 +1906,7 @@ typedef struct { }; } Gsetcolor; -typedef struct { +typedef struct Gfillrect { int cmd : 8; int x0 : 10; int x0frac : 2; @@ -1919,7 +1919,7 @@ typedef struct { int y1frac : 2; } Gfillrect; -typedef struct { +typedef struct Gsettile { int cmd : 8; unsigned int fmt : 3; unsigned int siz : 2; @@ -1939,7 +1939,7 @@ typedef struct { unsigned int shifts : 4; } Gsettile; -typedef struct { +typedef struct Gloadtile { int cmd : 8; unsigned int sl : 12; unsigned int tl : 12; @@ -1955,7 +1955,7 @@ typedef Gloadtile Gsettilesize; typedef Gloadtile Gloadtlut; -typedef struct { +typedef struct Gtexrect { unsigned int cmd : 8; /* command */ unsigned int xl : 12; /* X coordinate of upper left */ unsigned int yl : 12; /* Y coordinate of upper left */ @@ -1975,7 +1975,7 @@ typedef struct { /* * Textured rectangles are 128 bits not 64 bits */ -typedef struct { +typedef struct TexRect { unsigned long w0; unsigned long w1; unsigned long w2; @@ -1983,7 +1983,7 @@ typedef struct { } TexRect; #ifdef F3DEX_GBI_2 -typedef struct { +typedef struct Gvtx { int cmd : 8; unsigned int pad : 4; unsigned int len : 8; // n @@ -1998,7 +1998,7 @@ typedef Gdma Gvtx; /* * Generic Gfx Packet */ -typedef struct { +typedef struct Gwords { unsigned int w0; unsigned int w1; } Gwords; @@ -2007,7 +2007,7 @@ typedef struct { * This union is the fundamental type of the display list. * It is, by law, exactly 64 bits in size. */ -typedef union { +typedef union Gfx { Gwords words; Gnoop noop; Gdma dma; diff --git a/include/ultra64/gs2dex.h b/include/ultra64/gs2dex.h index 6371ae04c2..031dcb9f7d 100644 --- a/include/ultra64/gs2dex.h +++ b/include/ultra64/gs2dex.h @@ -91,7 +91,7 @@ typedef struct { } uObjScaleBg_t; /* 40 bytes */ -typedef union { +typedef union uObjBg { uObjBg_t b; uObjScaleBg_t s; long long int force_structure_alignment; @@ -103,7 +103,7 @@ typedef union { #define G_OBJ_FLAG_FLIPS 1<<0 /* inversion to S-direction */ #define G_OBJ_FLAG_FLIPT 1<<4 /* nversion to T-direction */ -typedef struct { +typedef struct uObjSprite_t { s16 objX; /* s10.2 OBJ x-coordinate of upper-left end */ u16 scaleW; /* u5.10 Scaling of u5.10 width direction */ u16 imageW; /* u10.5 width of u10.5 texture (length of S-direction) */ @@ -120,7 +120,7 @@ typedef struct { u8 imageFlags; /* The display flag - G_OBJ_FLAG_FLIP* */ } uObjSprite_t; /* 24 bytes */ -typedef union { +typedef union uObjSprite { uObjSprite_t s; long long int force_structure_alignment; } uObjSprite; @@ -128,25 +128,25 @@ typedef union { /*---------------------------------------------------------------------------* * 2D Matrix *---------------------------------------------------------------------------*/ -typedef struct { +typedef struct uObjMtx_t { s32 A, B, C, D; /* s15.16 */ s16 X, Y; /* s10.2 */ u16 BaseScaleX; /* u5.10 */ u16 BaseScaleY; /* u5.10 */ } uObjMtx_t; /* 24 bytes */ -typedef union { +typedef union uObjMtx { uObjMtx_t m; long long int force_structure_alignment; } uObjMtx; -typedef struct { +typedef struct uObjSubMtx_t { s16 X, Y; /* s10.2 */ u16 BaseScaleX; /* u5.10 */ u16 BaseScaleY; /* u5.10 */ } uObjSubMtx_t; /* 8 bytes */ -typedef union { +typedef union uObjSubMtx { uObjSubMtx_t m; long long int force_structure_alignment; } uObjSubMtx; @@ -200,7 +200,7 @@ typedef struct { u32 mask; /* STATE mask */ } uObjTxtrTLUT_t; /* 24 bytes */ -typedef union { +typedef union uObjTxtr { uObjTxtrBlock_t block; uObjTxtrTile_t tile; uObjTxtrTLUT_t tlut; diff --git a/include/ultra64/gu.h b/include/ultra64/gu.h index 7e2a50d725..d0548b3a8d 100644 --- a/include/ultra64/gu.h +++ b/include/ultra64/gu.h @@ -5,9 +5,12 @@ #define GU_PI 3.1415926 +#define FTOFIX32(x) (s32)((x) * (f32)0x00010000) +#define FIX32TOF(x) ((f32)(x) * (1.0f / (f32)0x00010000)) + #define ROUND(x) (s32)(((x) >= 0.0) ? ((x) + 0.5) : ((x) - 0.5)) -typedef union { +typedef union du { struct { u32 hi; u32 lo; @@ -16,7 +19,7 @@ typedef union { f64 d; } du; -typedef union { +typedef union fu { u32 i; f32 f; } fu; diff --git a/include/ultra64/internal.h b/include/ultra64/internal.h index 0851314a8b..e094d39622 100644 --- a/include/ultra64/internal.h +++ b/include/ultra64/internal.h @@ -3,7 +3,7 @@ #include "pi.h" -typedef struct { +typedef struct OSDevMgr { /* 0x00 */ u32 active; /* 0x04 */ OSThread* thread; /* 0x08 */ OSMesgQueue* cmdQueue; diff --git a/include/ultra64/leo.h b/include/ultra64/leo.h new file mode 100644 index 0000000000..3bc8a1dd6e --- /dev/null +++ b/include/ultra64/leo.h @@ -0,0 +1,214 @@ +#ifndef ULTRA64_LEO_H +#define ULTRA64_LEO_H + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include "pi.h" +#include "leoappli.h" + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +typedef u32 LEOError; + +typedef u8 LEOSpdlMode; + +typedef u8 LEOStatus; + +typedef struct LEOVersion { + /* 0x0 */ u8 driver; // version of sw + /* 0x1 */ u8 drive; // version of hw + /* 0x2 */ u8 deviceType; // dev type, always 00 + /* 0x3 */ u8 nDevices; // # of devices, always 01 +} LEOVersion; // size = 0x4 + +typedef struct LEOCapacity { + /* 0x0 */ u32 startLBA; + /* 0x4 */ u32 endLBA; + /* 0x8 */ u32 nbytes; +} LEOCapacity; // size = 0xC + +typedef struct LEODiskTime { + /* 0x0 */ u8 pad; + /* 0x1 */ u8 yearhi; + /* 0x2 */ u8 yearlo; + /* 0x3 */ u8 month; + /* 0x4 */ u8 day; + /* 0x5 */ u8 hour; + /* 0x6 */ u8 minute; + /* 0x7 */ u8 second; +} LEODiskTime; // size = 0x8 + +typedef struct LEOSerialNum { + /* 0x0 */ u64 lineNumber; + /* 0x8 */ LEODiskTime time; +} LEOSerialNum; // size = 0x10 + +typedef struct LEODiskID { + /* 0x0 */ u8 gameName[4]; + /* 0x4 */ u8 gameVersion; + /* 0x5 */ u8 diskNumber; + /* 0x6 */ u8 ramUsage; + /* 0x7 */ u8 diskUsage; + /* 0x8 */ LEOSerialNum serialNumber; + /* 0x18 */ u8 company[2]; + /* 0x1A */ u8 freeArea[6]; +} LEODiskID; // size = 0x20 + +// Not attempting to number this struct until required since it's scary +typedef struct LEOCmd { + /* 0x00 */ LEOCmdHeader header; + union { + struct { + /* 0x0C */ u32 lba; + /* 0x10 */ u32 transferBlks; + /* 0x14 */ void* buffPtr; + /* 0x18 */ u32 rwBytes; +#ifdef _LONGCMD + /* 0x1C */ u32 size; +#endif + } readWrite; + struct { + /* 0x0C */ u32 lba; + } seek; + struct { + /* 0x0C */ void* bufferPointer; + } readdiskid; + /* 0x0C */ LEODiskTime time; + struct { + /* 0x0C */ u8 reserve1; + /* 0x0D */ u8 reserve2; + /* 0x0E */ u8 standbyTime; + /* 0x0F */ u8 sleepTime; + /* 0x10 */ u32 reserve3; + } modeSelect; + } data; +} LEOCmd; // size = 0x1C + + +#define _nbytes readwrite.rwBytes +#define _result header.status + +#endif // defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + + +#define LEO_SW_VERSION 6 // This will be returned by LeoInquiry command + +#define OS_PRIORITY_LEOMGR OS_PRIORITY_PIMGR + +#define DDROM_FONT_START 0x000A0000 +#define DDROM_WAVEDATA_START 0x00140000 + +/* + * Definition for osLeoSpdlMotor() + */ +#define ACTIVE 0 +#define STANDBY 1 +#define SLEEP 2 +#define BRAKE 4 + +#define LEO_MOTOR_ACTIVE 0 +#define LEO_MOTOR_STANDBY 1 +#define LEO_MOTOR_SLEEP 2 +#define LEO_MOTOR_BRAKE 4 + +#define NUM_LBAS 4292 + +#define BLK_SIZE_ZONE0 19720 +#define BLK_SIZE_ZONE1 18360 +#define BLK_SIZE_ZONE2 17680 +#define BLK_SIZE_ZONE3 16320 +#define BLK_SIZE_ZONE4 14960 +#define BLK_SIZE_ZONE5 13600 +#define BLK_SIZE_ZONE6 12240 +#define BLK_SIZE_ZONE7 10880 +#define BLK_SIZE_ZONE8 9520 + +#define MAX_BLK_SIZE BLK_SIZE_ZONE0 +#define MIN_BLK_SIZE BLK_SIZE_ZONE8 + +#define LEO_ERROR_GOOD 0 +#define LEO_ERROR_DRIVE_NOT_READY 1 +#define LEO_ERROR_DIAGNOSTIC_FAILURE 2 +#define LEO_ERROR_COMMAND_PHASE_ERROR 3 +#define LEO_ERROR_DATA_PHASE_ERROR 4 +#define LEO_ERROR_REAL_TIME_CLOCK_FAILURE 5 +#define LEO_ERROR_BUSY 8 +#define LEO_ERROR_INCOMPATIBLE_MEDIUM_INSTALLED 11 +#define LEO_ERROR_UNKNOWN_FORMAT 11 +#define LEO_ERROR_NO_SEEK_COMPLETE 21 +#define LEO_ERROR_WRITE_FAULT 22 +#define LEO_ERROR_UNRECOVERED_READ_ERROR 23 +#define LEO_ERROR_NO_REFERENCE_POSITION_FOUND 24 +#define LEO_ERROR_TRACK_FOLLOWING_ERROR 25 +#define LEO_ERROR_TRACKING_OR_SPDL_SERVO_FAILURE 25 +#define LEO_ERROR_INVALID_COMMAND_OPERATION_CODE 31 +#define LEO_ERROR_LBA_OUT_OF_RANGE 32 +#define LEO_ERROR_WRITE_PROTECT_ERROR 33 +#define LEO_ERROR_COMMAND_CLEARED_BY_HOST 34 +#define LEO_ERROR_COMMAND_TERMINATED 34 +#define LEO_ERROR_QUEUE_FULL 35 +#define LEO_ERROR_ILLEGAL_TIMER_VALUE 36 +#define LEO_ERROR_WAITING_NMI 37 +#define LEO_ERROR_DEVICE_COMMUNICATION_FAILURE 41 +#define LEO_ERROR_MEDIUM_NOT_PRESENT 42 +#define LEO_ERROR_POWERONRESET_DEVICERESET_OCCURED 43 +#define LEO_ERROR_RAMPACK_NOT_CONNECTED 44 +#define LEO_ERROR_MEDIUM_MAY_HAVE_CHANGED 47 +#define LEO_ERROR_EJECTED_ILLEGALLY_RESUME 49 + +#define LEO_ERROR_NOT_BOOTED_DISK 45 +#define LEO_ERROR_DIDNOT_CHANGED_DISK_AS_EXPECTED 46 + +#define LEO_ERROR_RTC_NOT_SET_CORRECTLY 48 +#define LEO_ERROR_DIAGNOSTIC_FAILURE_RESET 50 +#define LEO_ERROR_EJECTED_ILLEGALLY_RESET 51 + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +#define GET_ERROR(x) ((x).header.sense) + +extern LEODiskID leoBootID; +extern OSPiHandle* __osDiskHandle; // For exceptasm to get disk info + +// Initialize routine +s32 LeoCreateLeoManager(OSPri comPri, OSPri intPri, OSMesg* cmdBuf, s32 cmdMsgCnt); +s32 LeoCJCreateLeoManager(OSPri comPri, OSPri intPri, OSMesg* cmdBuf, s32 cmdMsgCnt); +s32 LeoCACreateLeoManager(OSPri comPri, OSPri intPri, OSMesg* cmdBuf, s32 cmdMsgCnt); +u32 LeoDriveExist(void); + +// Synchronous functions +s32 LeoClearQueue(void); +s32 LeoByteToLBA(s32 startlba, u32 nbytes, s32* lba); +s32 LeoLBAToByte(s32 startlba, u32 nlbas, s32* bytes); +s32 LeoReadCapacity(LEOCapacity* cap, s32 dir); +s32 LeoInquiry(LEOVersion* ver); +s32 LeoTestUnitReady(LEOStatus* status); + +// Asynchronous functions +s32 LeoSpdlMotor(LEOCmd* cmdBlock, LEOSpdlMode mode, OSMesgQueue* mq); +s32 LeoSeek(LEOCmd* cmdBlock, u32 lba, OSMesgQueue* mq); +s32 LeoRezero(LEOCmd* cmdBlock, OSMesgQueue* mq); +s32 LeoReadWrite(LEOCmd* cmdBlock, s32 direction, u32 LBA, void* vAddr, u32 nLBAs, OSMesgQueue* mq); +s32 LeoReadDiskID(LEOCmd* cmdBlock, LEODiskID* vaddr, OSMesgQueue* mq); +s32 LeoSetRTC(LEOCmd* cmdBlock, LEODiskTime* RTCdata, OSMesgQueue* mq); +s32 LeoReadRTC(LEOCmd* cmdBlock, OSMesgQueue* mq); +s32 LeoModeSelectAsync(LEOCmd* cmdBlock, u32 standby, u32 sleep, OSMesgQueue* mq); + +// Font routines +int LeoGetKAdr(int sjis); +int LeoGetAAdr(int code, int* dx, int* dy, int* cy); +int LeoGetAAdr2(u32 ccode, int* dx, int* dy, int* cy); + +// Boot function +void LeoBootGame(void* entry); + +#endif // defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif + diff --git a/include/ultra64/leoappli.h b/include/ultra64/leoappli.h new file mode 100644 index 0000000000..ef526ee5a5 --- /dev/null +++ b/include/ultra64/leoappli.h @@ -0,0 +1,198 @@ +#ifndef ULTRA64_LEOAPPLI_H +#define ULTRA64_LEOAPPLI_H + +#include "thread.h" +#include "message.h" + +#define LEO_DISK_TYPE_MIN 0 +#define LEO_DISK_TYPE_MAX 6 + +#define LEO_LBA_MIN 0 +#define LEO_LBA_MAX 4291 + +#define LEO_LBA_ROM_TOP LEO_LBA_MIN +#define LEO_LBA_ROM_END0 1417 +#define LEO_LBA_ROM_END1 1965 +#define LEO_LBA_ROM_END2 2513 +#define LEO_LBA_ROM_END3 3061 +#define LEO_LBA_ROM_END4 3609 +#define LEO_LBA_ROM_END5 4087 +#define LEO_LBA_ROM_END6 LEO_LBA_MAX +#define LEO_LBA_RAM_TOP0 (LEO_LBA_ROM_END0+1) +#define LEO_LBA_RAM_TOP1 (LEO_LBA_ROM_END1+1) +#define LEO_LBA_RAM_TOP2 (LEO_LBA_ROM_END2+1) +#define LEO_LBA_RAM_TOP3 (LEO_LBA_ROM_END3+1) +#define LEO_LBA_RAM_TOP4 (LEO_LBA_ROM_END4+1) +#define LEO_LBA_RAM_TOP5 (LEO_LBA_ROM_END5+1) +#define LEO_LBA_RAM_TOP6 (LEO_LBA_ROM_END6+1) +#define LEO_LBA_RAM_END6 LEO_LBA_MAX + +void leoInitialize(OSPri compri, OSPri intpri, OSMesg* command_que_buf, u32 cmd_buff_size); +void leoCommand(void* cmd_blk_addr); +void LeoReset(void); +s32 LeoResetClear(void); + +#define LEO_PRIORITY_WRK (OS_PRIORITY_PIMGR-1) +#define LEO_PRIORITY_INT OS_PRIORITY_PIMGR + +#define LEO_COMMAND_CLEAR_QUE 0x01 +#define LEO_COMMAND_INQUIRY 0x02 +#define LEO_COMMAND_TEST_UNIT_READY 0x03 +#define LEO_COMMAND_REZERO 0x04 +#define LEO_COMMAND_READ 0x05 +#define LEO_COMMAND_WRITE 0x06 +#define LEO_COMMAND_SEEK 0x07 +#define LEO_COMMAND_START_STOP 0x08 +#define LEO_COMMAND_READ_CAPACITY 0x09 +#define LEO_COMMAND_TRANSLATE 0x0A +#define LEO_COMMAND_MODE_SELECT 0x0B +#define LEO_COMMAND_READ_DISK_ID 0x0C +#define LEO_COMMAND_READ_TIMER 0x0D +#define LEO_COMMAND_SET_TIMER 0x0E +// should be +// #define LEO_COMMAND_CLEAR_RESET 0x0F + +#define LEO_CONTROL_POST 0x80 // ENABLE POST QUEUE +#define LEO_CONTROL_START 0x01 // START COMMAND +#define LEO_CONTROL_STBY 0x02 // STAND-BY MODE(NOT SLEEP MODE) +#define LEO_CONTROL_WRT 0x01 // READ RE-WRITE-ABLE CAPACITY +#define LEO_CONTROL_TBL 0x01 // TRANSLATE BYTE TO LBA +#define LEO_CONTROL_BRAKE 0x04 // SLEEP MODE(BRAKE ON) + +#define LEO_TEST_UNIT_MR 0x01 // MEDIUM REMOVED +#define LEO_TEST_UNIT_RE 0x02 // HEAD RETRACTED +#define LEO_TEST_UNIT_SS 0x04 // SPINDLE STOPPED + +#define LEO_STATUS_GOOD 0x00 +#define LEO_STATUS_CHECK_CONDITION 0x02 +#define LEO_STATUS_BUSY 0x08 + +#define LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION 00 +#define LEO_SENSE_DRIVE_NOT_READY 01 +#define LEO_SENSE_DIAGNOSTIC_FAILURE 02 +#define LEO_SENSE_COMMAND_PHASE_ERROR 03 +#define LEO_SENSE_DATA_PHASE_ERROR 04 +#define LEO_SENSE_REAL_TIME_CLOCK_FAILURE 05 +#define LEO_SENSE_INCOMPATIBLE_MEDIUM_INSTALLED 11 +#define LEO_SENSE_UNKNOWN_FORMAT 11 +#define LEO_SENSE_NO_SEEK_COMPLETE 21 +#define LEO_SENSE_WRITE_FAULT 22 +#define LEO_SENSE_UNRECOVERED_READ_ERROR 23 +#define LEO_SENSE_NO_REFERENCE_POSITION_FOUND 24 +#define LEO_SENSE_TRACK_FOLLOWING_ERROR 25 +#define LEO_SENSE_TRACKING_OR_SPDL_SERVO_FAILURE 25 +#define LEO_SENSE_INVALID_COMMAND_OPERATION_CODE 31 +#define LEO_SENSE_LBA_OUT_OF_RANGE 32 +#define LEO_SENSE_WRITE_PROTECT_ERROR 33 +#define LEO_SENSE_COMMAND_TERMINATED 34 +#define LEO_SENSE_QUEUE_FULL 35 +#define LEO_SENSE_ILLEGAL_TIMER_VALUE 36 +#define LEO_SENSE_WAITING_NMI 37 +#define LEO_SENSE_DEVICE_COMMUNICATION_FAILURE 41 +#define LEO_SENSE_MEDIUM_NOT_PRESENT 42 +#define LEO_SENSE_POWERONRESET_DEVICERESET_OCCURED 43 +#define LEO_SENSE_MEDIUM_MAY_HAVE_CHANGED 47 +#define LEO_SENSE_EJECTED_ILLEGALLY_RESUME 49 + +typedef struct LEOCmdHeader { + /* 0x0 */ u8 command; + /* 0x1 */ u8 reserve1; + /* 0x2 */ u8 control; + /* 0x3 */ u8 reserve3; + /* 0x4 */ u8 status; + /* 0x5 */ u8 sense; + /* 0x6 */ u8 reserve6; + /* 0x7 */ u8 reserve7; + /* 0x8 */ OSMesgQueue* post; +} LEOCmdHeader; // 0xC + +typedef struct LEOCmdClearQueue { + /* 0x0 */ LEOCmdHeader header; +} LEOCmdClearQueue; // 0xC + +typedef struct LEOCmdInquiry { + /* 0x00 */ LEOCmdHeader header; + /* 0x0C */ u8 devType; + /* 0x0D */ u8 version; + /* 0x0E */ u8 devNum; + /* 0x0F */ u8 leoBiosVer; + /* 0x10 */ u32 reserve5; +} LEOCmdInquiry; // size = 0x14 + +typedef struct LEOCmdTestUnitReady { + /* 0x0 */ LEOCmdHeader header; + /* 0xC */ u8 test; + /* 0xD */ u8 reserve2; + /* 0xE */ u8 reserve3; + /* 0xF */ u8 reserve4; +} LEOCmdTestUnitReady; // size = 0x10 + +typedef struct LEOCmdRezero { + /* 0x0 */ LEOCmdHeader header; +} LEOCmdRezero; // size = 0xC + +typedef struct LEOCmdRead { + /* 0x00 */ LEOCmdHeader header; + /* 0x0C */ u32 lba; + /* 0x10 */ u32 transferBlks; + /* 0x14 */ void* buffPtr; + /* 0x18 */ u32 rwBytes; +} LEOCmdRead; // size = 0x1C + +typedef LEOCmdRead LEOCmdWrite; + +typedef struct LEOCmdSeek { + /* 0x0 */ LEOCmdHeader header; + /* 0xC */ u32 lba; +} LEOCmdSeek; // size = 0x10 + +typedef struct LEOCmdStartStop { + /* 0x0 */ LEOCmdHeader header; +} LEOCmdStartStop; // size = 0xC + +typedef struct LEOCmdReadCapacity { + /* 0x00 */ LEOCmdHeader header; + /* 0x0C */ u32 startLba; + /* 0x10 */ u32 endLba; + /* 0x14 */ u32 capaBytes; +} LEOCmdReadCapacity; // size = 0x18 + +typedef struct LEOCmdTranslate { + /* 0x00 */ LEOCmdHeader header; + /* 0x0C */ u32 startLba; + /* 0x10 */ u32 inParam; + /* 0x14 */ u32 outParam; +} LEOCmdTranslate; // size = 0x18 + +typedef struct LEOCmdModeSelect { + /* 0x00 */ LEOCmdHeader header; + /* 0x0C */ u8 pageCode; + /* 0x0D */ u8 reserve1; + /* 0x0E */ u8 standbyTime; + /* 0x0F */ u8 sleepTime; + /* 0x10 */ u8 ledOnTime; + /* 0x11 */ u8 ledOffTime; + /* 0x12 */ u8 reserve18; + /* 0x13 */ u8 reserve19; +} LEOCmdModeSelect; // size = 0x14 + +typedef struct LEOCmdReadDiskId { + /* 0x0 */ LEOCmdHeader header; + /* 0xC */ void* bufferPointer; +} LEOCmdReadDiskId; // size = 0x10 + +typedef struct LEOCmdReadTimer { + /* 0x00 */ LEOCmdHeader header; + /* 0x0C */ u8 reserve12; + /* 0x0D */ u8 reserve13; + /* 0x0E */ u8 year; + /* 0x0F */ u8 month; + /* 0x10 */ u8 day; + /* 0x11 */ u8 hour; + /* 0x12 */ u8 minute; + /* 0x13 */ u8 second; +} LEOCmdReadTimer; // size = 0x14 + +typedef LEOCmdReadTimer LEOCmdSetTimer; + +#endif diff --git a/include/ultra64/leodrive.h b/include/ultra64/leodrive.h index 36b28f4b9e..fbbbef8e0f 100644 --- a/include/ultra64/leodrive.h +++ b/include/ultra64/leodrive.h @@ -1,7 +1,14 @@ #ifndef ULTRA64_LEODRIVE_H #define ULTRA64_LEODRIVE_H +#include "leo.h" +#include "leoappli.h" +#include "message.h" +#include "pi.h" #include "rcp.h" +#include "stack.h" +#include "thread.h" +#include "ultratypes.h" #define ASIC_BASE PI_DOM2_ADDR1 @@ -44,4 +51,144 @@ // ASIC_STATUS read bits #define LEO_STATUS_MECHANIC_INTR 0x02000000 // Mechanic Interrupt Raised +typedef union { + /* 0x0 */ u8 u8_data[4]; + /* 0x0 */ u16 u16_data[2]; + /* 0x0 */ u32 u32_data; +} data_trans_form; // size = 0x4 + +typedef struct { + /* 0x00 */ u8* pntr; + /* 0x04 */ u8* c2buff_e; + /* 0x08 */ u8 err_pos[4]; + /* 0x0C */ u8 err_num; + /* 0x0D */ u8 bytes; + /* 0x0E */ u16 blkbytes; +} block_param_form; // size = 0x10 + +typedef struct { + /* 0x0 */ u16 lba; + /* 0x2 */ u16 cylinder; + /* 0x4 */ u16 blk_bytes; + /* 0x6 */ u8 sec_bytes; + /* 0x7 */ u8 head; + /* 0x8 */ u8 zone; + /* 0x9 */ u8 rdwr_blocks; + /* 0xA */ u8 start_block; +} tgt_param_form; // size = 0xC + +typedef union { + /* 0x00 */ struct { + /* 0x00 */ u32 country; + /* 0x04 */ u8 fmt_type; + /* 0x05 */ u8 disk_type; + /* 0x06 */ u16 ipl_load_len; + /* 0x08 */ u8 defect_num[20]; + /* 0x1C */ void* loadptr; + /* 0x20 */ u8 defect_data[192]; + /* 0xE0 */ u16 rom_end_lba; + /* 0xE2 */ u16 ram_start_lba; + /* 0xE4 */ u16 ram_end_lba; + } param; + /* 0x00 */ u64 u64_data[29]; +} leo_sys_form; // size = 0xE8 + +void leomain(void* arg); +void leointerrupt(void* arg); + +OSPiHandle* osLeoDiskInit(void); +s32 __osLeoInterrupt(void); + +void leoClr_queue(void); +void leoInquiry(void); +void leoTest_unit_rdy(void); +void leoRezero(void); +void leoRead(void); +void leoWrite(void); +void leoSeek(void); +void leoStart_stop(void); +void leoRd_capacity(void); +void leoTranslate(); +void leoMode_sel(void); +void leoReadDiskId(void); +void leoReadTimer(void); +void leoSetTimer(void); +void leoClr_reset(void); + +u16 leoLba_to_phys(u32 lba); +u16 leoLba_to_vzone(u32 lba); + +u8 leoAnalize_asic_status(void); +u8 leoChk_asic_ready(u32 asic_cmd); +u8 leoChk_done_status(u32 asic_cmd); +u8 leoSend_asic_cmd_i(u32 asic_cmd, u32 asic_data); +u8 leoWait_mecha_cmd_done(u32 asic_cmd); +u8 leoSend_asic_cmd_w(u32 asic_cmd, u32 asic_data); +u8 leoSend_asic_cmd_w_nochkDiskChange(u32 asic_cmd, u32 asic_data); +u8 leoDetect_index_w(void); +u8 leoRecal_i(void); +u8 leoRecal_w(void); +u8 leoSeek_i(u16 rwmode); +u8 leoSeek_w(void); +u8 leoRecv_event_mesg(s32 control); +u32 leoChk_err_retry(u32 sense); +u8 leoChk_cur_drvmode(void); +void leoDrive_reset(void); +u32 leoChkUnit_atten(void); +u32 leoRetUnit_atten(void); +void leoClrUA_RESET(void); +void leoClrUA_MEDIUM_CHANGED(void); +void leoSetUA_MEDIUM_CHANGED(void); +void leoInitUnit_atten(void); + +s32 __leoSetReset(void); + +void leoRead_common(unsigned int offset); + +int leoC2_Correction(void); + +void leoSet_mseq(u16 rwmode); + +extern leo_sys_form LEO_sys_data; +extern OSThread LEOcommandThread; +extern OSThread LEOinterruptThread; +extern STACK(LEOcommandThreadStack, 0x400); +extern STACK(LEOinterruptThreadStack, 0x400); +extern OSMesgQueue LEOcommand_que; +extern OSMesgQueue LEOevent_que; +extern OSMesgQueue LEOcontrol_que; +extern OSMesgQueue LEOdma_que; +extern OSMesgQueue LEOblock_que; +extern OSMesg LEOevent_que_buf[1]; +extern OSMesg LEOcontrol_que_buf[1]; +extern OSMesg LEOdma_que_buf[2]; +extern OSMesg LEOblock_que_buf[1]; +extern u8* LEOwrite_pointer; +extern LEOCmd* LEOcur_command; +extern u32 LEOasic_bm_ctl_shadow; +extern u32 LEOasic_seq_ctl_shadow; +extern u8 LEOdrive_flag; +extern vu8 LEOclr_que_flag; +// needs to not be volatile in some files +// extern vu16 LEOrw_flags; +extern u8 LEOdisk_type; +extern tgt_param_form LEOtgt_param; +extern u32 LEO_country_code; + +extern const char LEOfirmware_rev[]; +extern const u8 LEOBYTE_TBL1[]; +extern const u16 LEOBYTE_TBL2[]; +extern const u16 LEOVZONE_TBL[][0x10]; +extern const u16 LEOZONE_SCYL_TBL[]; +extern const u8 LEOVZONE_PZONEHD_TBL[][0x10]; +extern const u16 LEOZONE_OUTERCYL_TBL[]; +extern const u16 LEORAM_START_LBA[]; +extern const s32 LEORAM_BYTE[]; + +extern s32 __leoActive; +extern LEOVersion __leoVersion; +extern STACK(leoDiskStack, 0x1000); + +extern OSPiHandle* LEOPiInfo; + #endif diff --git a/include/ultra64/pfs.h b/include/ultra64/pfs.h index 019f29350c..c86f36d628 100644 --- a/include/ultra64/pfs.h +++ b/include/ultra64/pfs.h @@ -69,7 +69,7 @@ #define PFS_INODE_DIST_MAP (PFS_BANK_LAPPED_BY * PFS_SECTOR_PER_BANK) #define PFS_SECTOR_SIZE (PFS_INODE_SIZE_PER_PAGE/PFS_SECTOR_PER_BANK) -typedef struct { +typedef struct OSPfs { /* 0x00 */ s32 status; /* 0x04 */ OSMesgQueue* queue; /* 0x08 */ s32 channel; @@ -85,7 +85,7 @@ typedef struct { /* 0x65 */ u8 activebank; } OSPfs; // size = 0x68 -typedef struct { +typedef struct OSPfsState { /* 0x00 */ u32 file_size; /* bytes */ /* 0x04 */ u32 game_code; /* 0x08 */ u16 company_code; @@ -93,7 +93,7 @@ typedef struct { /* 0x10 */ char game_name[16]; } OSPfsState; // size = 0x20 -typedef union { +typedef union __OSInodeUnit { struct { /* 0x00 */ u8 bank; /* 0x01 */ u8 page; @@ -101,11 +101,11 @@ typedef union { /* 0x00 */ u16 ipage; } __OSInodeUnit; // size = 0x02 -typedef struct { +typedef struct __OSInode { /* 0x00 */ __OSInodeUnit inodePage[128]; } __OSInode; // size = 0x100 -typedef struct { +typedef struct __OSDir { /* 0x00 */ u32 game_code; /* 0x04 */ u16 company_code; /* 0x06 */ __OSInodeUnit start_page; @@ -116,7 +116,7 @@ typedef struct { /* 0x10 */ u8 game_name[PFS_FILE_NAME_LEN]; } __OSDir; // size = 0x20 -typedef struct { +typedef struct __OSPackId { /* 0x00 */ u32 repaired; /* 0x04 */ u32 random; /* 0x08 */ u64 serialMid; @@ -128,7 +128,7 @@ typedef struct { /* 0x1E */ u16 invertedChecksum; } __OSPackId; // size = 0x20 -typedef struct { +typedef struct __OSInodeCache { /* 0x000 */ __OSInode inode; /* 0x100 */ u8 bank; /* 0x101 */ u8 map[PFS_INODE_DIST_MAP]; diff --git a/include/ultra64/pi.h b/include/ultra64/pi.h index 6fb52cea70..af18c407ea 100644 --- a/include/ultra64/pi.h +++ b/include/ultra64/pi.h @@ -3,7 +3,7 @@ #include "message.h" -typedef struct { +typedef struct __OSBlockInfo { /* 0x00 */ u32 errStatus; /* 0x04 */ void* dramAddr; /* 0x08 */ void* C2Addr; @@ -12,7 +12,7 @@ typedef struct { /* 0x14 */ u32 C1ErrSector[4]; } __OSBlockInfo; // size = 0x24 -typedef struct { +typedef struct __OSTranxInfo { /* 0x00 */ u32 cmdType; /* 0x04 */ u16 transferMode; /* 0x06 */ u16 blockNum; @@ -36,19 +36,19 @@ typedef struct OSPiHandle { /* 0x14 */ __OSTranxInfo transferInfo; } OSPiHandle; // size = 0x74 -typedef struct { +typedef struct OSPiInfo { /* 0x00 */ u8 type; /* 0x04 */ u32 address; } OSPiInfo; // size = 0x08 -typedef struct { +typedef struct OSIoMesgHdr { /* 0x00 */ u16 type; /* 0x02 */ u8 pri; /* 0x03 */ u8 status; /* 0x04 */ OSMesgQueue* retQueue; } OSIoMesgHdr; // size = 0x08 -typedef struct { +typedef struct OSIoMesg { /* 0x00 */ OSIoMesgHdr hdr; /* 0x08 */ void* dramAddr; /* 0x0C */ u32 devAddr; diff --git a/include/ultra64/rcp.h b/include/ultra64/rcp.h index 86387ef5e8..9c97e8bd9f 100644 --- a/include/ultra64/rcp.h +++ b/include/ultra64/rcp.h @@ -529,7 +529,7 @@ #define VI_CTRL_ANTIALIAS_MODE_2 0x00200 // Bit [9:8] anti-alias mode: AA disabled, resampling enabled, operate as if everything is covered #define VI_CTRL_ANTIALIAS_MODE_3 0x00300 // Bit [9:8] anti-alias mode: AA disabled, resampling disabled, replicate pixels #define VI_CTRL_PIXEL_ADV_MASK 0x0F000 // [15:12] pixel advance mode -#define VI_CTRL_PIXEL_ADV(n) (((n) << 12) & VI_CTRL_PIXEL_ADV_MASK) // Bit [15:12] pixel advance mode: Always 3 on N64 +#define VI_CTRL_PIXEL_ADV_3 0x03000 // Bit [15:12] pixel advance mode: Always 3 on N64 #define VI_CTRL_DITHER_FILTER_ON 0x10000 // 16: dither-filter mode /* diff --git a/include/ultra64/rdb.h b/include/ultra64/rdb.h index 0493b82b99..b58e3c8cf9 100644 --- a/include/ultra64/rdb.h +++ b/include/ultra64/rdb.h @@ -71,7 +71,7 @@ #include "ultratypes.h" /* Structure for debug port */ -typedef struct { +typedef struct rdbPacket { u32 type : 6; /* 0: invalid, 1: print, 2: debug */ u32 length : 2; /* 1, 2, or 3 */ char buf[3]; /* character buffer */ diff --git a/include/ultra64/sptask.h b/include/ultra64/sptask.h index ea00dbfdf5..5218c64cac 100644 --- a/include/ultra64/sptask.h +++ b/include/ultra64/sptask.h @@ -28,7 +28,7 @@ #define OS_YIELD_DATA_SIZE 0xC00 -typedef struct { +typedef struct OSTask_t { /* 0x00 */ u32 type; /* 0x04 */ u32 flags; @@ -54,7 +54,7 @@ typedef struct { /* 0x3C */ u32 yield_data_size; } OSTask_t; // size = 0x40 -typedef union { +typedef union OSTask { OSTask_t t; long long int force_structure_alignment; } OSTask; diff --git a/include/ultra64/thread.h b/include/ultra64/thread.h index 474a63641a..813fefaa97 100644 --- a/include/ultra64/thread.h +++ b/include/ultra64/thread.h @@ -27,7 +27,7 @@ typedef s32 OSPri; typedef s32 OSId; -typedef union { +typedef union __OSfp { struct { /* 0x00 */ f32 f_odd; /* 0x04 */ f32 f_even; @@ -35,7 +35,7 @@ typedef union { f64 d; } __OSfp; // size = 0x08 -typedef struct { +typedef struct __OSThreadContext { /* 0x000 */ u64 at, v0, v1, a0, a1, a2, a3; /* 0x038 */ u64 t0, t1, t2, t3, t4, t5, t6, t7; /* 0x078 */ u64 s0, s1, s2, s3, s4, s5, s6, s7; @@ -47,7 +47,7 @@ typedef struct { /* 0x150 */ __OSfp fp16, fp18, fp20, fp22, fp24, fp26, fp28, fp30; } __OSThreadContext; // size = 0x190 -typedef struct { +typedef struct __OSThreadprofile { /* 0x00 */ u32 flag; /* 0x04 */ u32 count; /* 0x08 */ u64 time; @@ -66,7 +66,7 @@ typedef struct OSThread { /* 0x20 */ __OSThreadContext context; } OSThread; // size = 0x1B0 -typedef struct { +typedef struct __OSThreadTail { OSThread* next; OSPri priority; } __OSThreadTail; // size = 0x8 diff --git a/include/ultra64/ucode.h b/include/ultra64/ucode.h index 00ef36ac2b..9265c882b6 100644 --- a/include/ultra64/ucode.h +++ b/include/ultra64/ucode.h @@ -12,6 +12,8 @@ extern u64 rspbootTextStart[], rspbootTextEnd[]; +extern u64 cic6105TextStart[], cic6105TextEnd[]; + extern u64 aspMainTextStart[], aspMainTextEnd[]; extern u64 aspMainDataStart[], aspMainDataEnd[]; diff --git a/include/ultra64/ultratypes.h b/include/ultra64/ultratypes.h index 7f45a7ef84..743e755ae9 100644 --- a/include/ultra64/ultratypes.h +++ b/include/ultra64/ultratypes.h @@ -26,7 +26,7 @@ typedef double f64; typedef float MtxF_t[4][4]; -typedef union { +typedef union MtxF { MtxF_t mf; struct { // Note: The order displayed here is the transpose of the order in which matrices are typically written. diff --git a/include/ultra64/vi.h b/include/ultra64/vi.h index 5125461123..70665d8f55 100644 --- a/include/ultra64/vi.h +++ b/include/ultra64/vi.h @@ -13,7 +13,7 @@ #define OS_VI_DITHER_FILTER_ON 0x0040 #define OS_VI_DITHER_FILTER_OFF 0x0080 -typedef struct { +typedef struct OSViCommonRegs { /* 0x00 */ u32 ctrl; /* 0x04 */ u32 width; /* 0x08 */ u32 burst; @@ -25,7 +25,7 @@ typedef struct { /* 0x20 */ u32 vCurrent; } OSViCommonRegs; // size = 0x20 -typedef struct { +typedef struct OSViFieldRegs { /* 0x00 */ u32 origin; /* 0x04 */ u32 yScale; /* 0x08 */ u32 vStart; @@ -33,19 +33,19 @@ typedef struct { /* 0x10 */ u32 vIntr; } OSViFieldRegs; // size = 0x14 -typedef struct { +typedef struct OSViMode { /* 0x00 */ u8 type; /* 0x04 */ OSViCommonRegs comRegs; /* 0x24 */ OSViFieldRegs fldRegs[2]; } OSViMode; // size = 0x4C -typedef struct { +typedef struct __OSViScale { /* 0x0 */ f32 factor; /* 0x4 */ u16 offset; /* 0x8 */ u32 scale; } __OSViScale; // size = 0x0C -typedef struct { +typedef struct OSViContext { /* 0x00 */ u16 state; /* 0x02 */ u16 retraceCount; /* 0x04 */ void* framep; diff --git a/include/ultra64/xstdio.h b/include/ultra64/xstdio.h index 27c44a56be..184ee49079 100644 --- a/include/ultra64/xstdio.h +++ b/include/ultra64/xstdio.h @@ -10,7 +10,7 @@ #define LONG_DOUBLE_TYPE long double #endif -typedef struct { +typedef struct _Pft { /* 0x00 */ union { long long ll; LONG_DOUBLE_TYPE ld; diff --git a/include/variables.h b/include/variables.h index e8c9bd79f2..c4bc14be74 100644 --- a/include/variables.h +++ b/include/variables.h @@ -2,6 +2,7 @@ #define VARIABLES_H #include "z64.h" +#include "libc64/os_malloc.h" #include "segment_symbols.h" #include "config.h" @@ -13,9 +14,10 @@ extern Debug gDebug; extern Mtx D_01000000; -extern u32 osTvType; -extern u32 osRomBase; -extern u32 osResetType; +extern void* osRomBase; +extern s32 osTvType; +extern s32 osResetType; +extern s32 osCicId; extern u32 osMemSize; extern u8 osAppNMIBuffer[0x40]; @@ -26,6 +28,7 @@ extern u32 gViConfigFeatures; extern f32 gViConfigXScale; extern f32 gViConfigYScale; extern OSPiHandle* gCartHandle; +extern s32 gCurrentRegion; extern u32 __osPiAccessQueueEnabled; extern OSViMode osViModePalLan1; extern s32 osViClock; @@ -48,7 +51,7 @@ extern OSViMode gCustomViModePal60Lan1; extern u32 __additional_scanline; extern const char gBuildMakeOption[]; extern const char gBuildGitVersion[]; -extern const char gBuildTeam[]; +extern const char gBuildCreator[]; extern OSMesgQueue gPiMgrCmdQueue; extern OSViMode gViConfigMode; extern u8 gViConfigModeType; @@ -65,52 +68,19 @@ extern ActorOverlay gActorOverlayTable[ACTOR_ID_MAX]; // original name: "actor_d extern s32 gMaxActorId; // original name: "MaxProfile" extern s32 gDebugCamEnabled; // ENABLE_CAMERA_DEBUGGER extern GameStateOverlay gGameStateOverlayTable[GAMESTATE_ID_MAX]; -extern u8 gWeatherMode; -extern u8 gLightConfigAfterUnderwater; -extern u8 gInterruptSongOfStorms; -extern u16 gTimeSpeed; extern s32 gZeldaArenaLogSeverity; extern MapData gMapDataTable; extern s16 gSpoilingItems[3]; extern s16 gSpoilingItemReverts[3]; -extern FlexSkeletonHeader* gPlayerSkelHeaders[2]; -extern u8 gPlayerModelTypes[PLAYER_MODELGROUP_MAX][PLAYER_MODELGROUPENTRY_MAX]; -extern Gfx* gPlayerLeftHandBgsDLs[]; -extern Gfx* gPlayerLeftHandOpenDLs[]; -extern Gfx* gPlayerLeftHandClosedDLs[]; -extern Gfx* gPlayerLeftHandBoomerangDLs[]; -extern Gfx gCullBackDList[]; -extern Gfx gCullFrontDList[]; + extern Gfx gEmptyDL[]; -extern u32 gBitFlags[32]; -extern u16 gEquipMasks[EQUIP_TYPE_MAX]; -extern u16 gEquipNegMasks[EQUIP_TYPE_MAX]; -extern u32 gUpgradeMasks[UPG_MAX]; -extern u8 gEquipShifts[EQUIP_TYPE_MAX]; -extern u8 gUpgradeShifts[UPG_MAX]; -extern u16 gUpgradeCapacities[UPG_MAX][4]; -extern u32 gGsFlagsMasks[4]; -extern u32 gGsFlagsShifts[4]; -extern void* gItemIcons[0x82]; -extern u8 gItemSlots[56]; -extern SceneCmdHandlerFunc gSceneCmdHandlers[SCENE_CMD_ID_MAX]; -extern s16 gLinkObjectIds[2]; -extern u32 gObjectTableSize; -extern RomFile gObjectTable[OBJECT_ID_MAX]; -extern EntranceInfo gEntranceTable[ENTR_MAX]; -extern SceneTableEntry gSceneTable[SCENE_ID_MAX]; + extern u16 gSramSlotOffsets[]; // 4 16-colors palettes extern u64 gMojiFontTLUTs[4][4]; // original name: "moji_tlut" extern u64 gMojiFontTex[]; // original name: "font_ff" -extern KaleidoMgrOverlay gKaleidoMgrOverlayTable[KALEIDO_OVL_MAX]; -extern KaleidoMgrOverlay* gKaleidoMgrCurOvl; extern u8 gBossMarkState; -extern s32 gScreenWidth; -extern s32 gScreenHeight; -extern Mtx gMtxClear; -extern MtxF gMtxFClear; #if IS_DEBUG extern u32 gIsCtrlr2Valid; #endif @@ -176,12 +146,10 @@ extern s32 __osPfsLastChannel; extern const TempoData gTempoData; extern const AudioHeapInitSizes gAudioHeapInitSizes; extern s16 gOcarinaSongItemMap[]; -extern u8 gSoundFontTable[]; +extern AudioTable gSoundFontTable; extern u8 gSequenceFontTable[]; extern u8 gSequenceTable[]; -extern u8 gSampleBankTable[]; - -extern SaveContext gSaveContext; +extern AudioTable gSampleBankTable; extern u8 gUseCutsceneCam; extern u16 D_8015FCCC; @@ -209,9 +177,9 @@ extern u32 D_8016139C; extern PauseMapMarksData* gLoadedPauseMarkDataTable; extern PreNmiBuff* gAppNmiBufferPtr; -extern uintptr_t gSegments[NUM_SEGMENTS]; extern Scheduler gScheduler; extern PadMgr gPadMgr; +extern IrqMgr gIrqMgr; #if ENABLE_F3DEX3 extern u8 gF3DEX3TextBuffer[]; @@ -241,8 +209,6 @@ extern ActiveSequence gActiveSeqs[4]; extern AudioContext gAudioCtx; extern AudioCustomUpdateFunction gAudioCustomUpdateFunction; -extern u32 __osMalloc_FreeBlockTest_Enable; -extern Arena gSystemArena; extern OSPifRam __osContPifRam; extern u8 __osContLastCmd; extern u8 __osMaxControllers; diff --git a/include/versions.h b/include/versions.h new file mode 100644 index 0000000000..778e28d93c --- /dev/null +++ b/include/versions.h @@ -0,0 +1,49 @@ +#ifndef VERSIONS_H +#define VERSIONS_H + +// OOT versions in build order +#define NTSC_1_0 1 +#define NTSC_1_1 2 +#define PAL_1_0 3 +#define NTSC_1_2 4 +#define PAL_1_1 5 +#define GC_JP 6 +#define GC_JP_MQ 7 +#define GC_US 8 +#define GC_US_MQ 9 +#define GC_EU_MQ_DBG 10 +#define GC_EU 11 +#define GC_EU_MQ 12 +#define GC_JP_CE 13 + +// NTSC/PAL +#if OOT_VERSION == PAL_1_0 || OOT_VERSION == PAL_1_1 || OOT_VERSION == GC_EU || OOT_VERSION == GC_EU_MQ || OOT_VERSION == GC_EU_MQ_DBG +#define OOT_NTSC 0 +#define OOT_PAL 1 +#else +#define OOT_NTSC 1 +#define OOT_PAL 0 +#endif + +// PAL N64 (50 Hz) +#if OOT_VERSION == PAL_1_0 || OOT_VERSION == PAL_1_1 +#define OOT_PAL_N64 1 +#else +#define OOT_PAL_N64 0 +#endif + +// Master Quest +#if OOT_VERSION == GC_JP_MQ || OOT_VERSION == GC_US_MQ || OOT_VERSION == GC_EU_MQ || OOT_VERSION == GC_EU_MQ_DBG +#define OOT_MQ 1 +#else +#define OOT_MQ 0 +#endif + +// Macro for constants that change in 50 Hz N64 PAL versions. +#if !OOT_PAL_N64 +#define FRAMERATE_CONST(value60Hz, value50Hz) (value60Hz) +#else +#define FRAMERATE_CONST(value60Hz, value50Hz) (value50Hz) +#endif + +#endif diff --git a/include/z64.h b/include/z64.h index 3d88800015..72f98e7b20 100644 --- a/include/z64.h +++ b/include/z64.h @@ -6,6 +6,8 @@ #include "ultra64/gs2dex.h" #include "attributes.h" #include "audiomgr.h" +#include "controller.h" +#include "versions.h" #include "z64save.h" #include "z64light.h" #include "z64bgcheck.h" @@ -22,16 +24,21 @@ #include "z64scene.h" #include "z64effect.h" #include "z64game_over.h" +#include "z64inventory.h" #include "z64item.h" #include "z64animation.h" #include "z64animation_legacy.h" #include "z64dma.h" +#include "letterbox.h" #include "z64math.h" #include "z64map_mark.h" #include "z64message.h" +#include "z64olib.h" +#include "one_point_cutscene.h" #include "z64pause.h" #include "z64play.h" #include "z64skin.h" +#include "z64skin_matrix.h" #include "z64game.h" #include "z64transition.h" #include "z64transition_instances.h" @@ -41,6 +48,7 @@ #include "z64sram.h" #include "z64view.h" #include "z64vis.h" +#include "zelda_arena.h" #include "alignment.h" #include "audiothread_cmd.h" #include "seqcmd.h" @@ -53,19 +61,21 @@ #include "regs.h" #include "irqmgr.h" #include "padmgr.h" -#include "fault.h" #include "sched.h" #include "rumble.h" +#include "map.h" #include "mempak.h" #include "tha.h" #include "thga.h" #include "gfx.h" +#include "gfx_setupdl.h" +#include "gfxalloc.h" #include "jpeg.h" #include "prerender.h" #include "rand.h" +#include "libc64/qrand.h" #include "sys_math.h" #include "sys_math3d.h" -#include "fp_math.h" #include "widescreen.h" #include "rainbow.h" @@ -81,19 +91,27 @@ #include "occlusionplanes.h" #endif +#include "libc64/math64.h" +#include "sys_matrix.h" +#include "main.h" +#include "segmented_address.h" +#include "stackcheck.h" +#include "kaleido_manager.h" +#include "libc64/aprintf.h" +#include "libc64/malloc.h" +#include "libc64/sleep.h" +#include "libc64/sprintf.h" + #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 -#define REGION_NULL 0 -#define REGION_JP 1 -#define REGION_US 2 -#define REGION_EU 3 - #define THREAD_PRI_IDLE_INIT 10 #define THREAD_PRI_MAIN_INIT 10 #define THREAD_PRI_DMAMGR_LOW 10 // Used when decompressing files #define THREAD_PRI_GRAPH 11 #define THREAD_PRI_AUDIOMGR 12 +#define THREAD_PRI_N64DD 13 +#define THREAD_PRI_DDMSG 13 #define THREAD_PRI_PADMGR 14 #define THREAD_PRI_MAIN 15 #define THREAD_PRI_SCHED 15 @@ -108,6 +126,7 @@ #define THREAD_ID_GRAPH 4 #define THREAD_ID_SCHED 5 #define THREAD_ID_PADMGR 7 + #if ENABLE_PROFILER #define THREAD_ID_PIMGR 8 #define THREAD_ID_VIMGR 9 @@ -116,57 +135,36 @@ #define THREAD_ID_PIMGR 0 #define THREAD_ID_VIMGR 0 #endif + +#define THREAD_ID_N64DD 8 +#define THREAD_ID_DDMSG 9 #define THREAD_ID_AUDIOMGR 10 #define THREAD_ID_DMAMGR 18 #define THREAD_ID_IRQMGR 19 #define VI_CUSTOM_PAL60_LAN1 56 // Custom PAL60 VI mode -#define STACK(stack, size) \ - u64 stack[ALIGN8(size) / sizeof(u64)] - -#define STACK_TOP(stack) \ - ((u8*)(stack) + sizeof(stack)) - -// NOTE: Once we start supporting other builds, this can be changed with an ifdef -#define REGION_NATIVE REGION_EU - -typedef struct { - /* 0x00 */ void* loadedRamAddr; - /* 0x04 */ RomFile file; - /* 0x0C */ void* vramStart; - /* 0x10 */ void* vramEnd; - /* 0x14 */ u32 offset; // loadedRamAddr - vramStart - /* 0x18 */ const char* name; -} KaleidoMgrOverlay; // size = 0x1C - -typedef enum { - /* 0 */ KALEIDO_OVL_KALEIDO_SCOPE, - /* 1 */ KALEIDO_OVL_PLAYER_ACTOR, - /* 2 */ KALEIDO_OVL_MAX -} KaleidoOverlayType; - -typedef enum { +typedef enum LensMode { /* 0 */ LENS_MODE_SHOW_ACTORS, // lens actors are invisible by default, and shown by using lens (for example, invisible enemies) /* 1 */ LENS_MODE_HIDE_ACTORS // lens actors are visible by default, and hidden by using lens (for example, fake walls) } LensMode; -typedef struct { +typedef struct SetupState { /* 0x00 */ GameState state; } SetupState; // size = 0xA4 -typedef struct { +typedef struct ConsoleLogoState { /* 0x0000 */ GameState state; /* 0x00A4 */ u8* staticSegment; /* 0x00A8 */ View view; /* 0x01D0 */ SramContext sramCtx; - /* 0x01D4 */ u16 timer; // not used in mq dbg (some sort of timer that doesn't seem to affect anything) + /* 0x01D4 */ s16 timer; // not used in mq dbg (some sort of timer that doesn't seem to affect anything) /* 0x01D6 */ s16 coverAlpha; /* 0x01D8 */ s16 addAlpha; - /* 0x01DA */ u16 visibleDuration; + /* 0x01DA */ s16 visibleDuration; /* 0x01DC */ s16 ult; /* 0x01DE */ s16 uls; - /* 0x01E0 */ char unk_1E0[0x01]; + /* 0x01E0 */ u8 unk_1E0; /* 0x01E1 */ u8 exit; /* 0x01E2 */ char unk_1E2[0x06]; } ConsoleLogoState; // size = 0x1E8 @@ -174,7 +172,7 @@ typedef struct { // vvv IS_MAP_SELECT_ENABLED vvv struct MapSelectState; -typedef struct { +typedef struct SceneSelectEntry { /* 0x00 */ char* name; /* 0x04 */ void (*loadFunc)(struct MapSelectState*, s32); /* 0x08 */ s32 entranceIndex; @@ -204,7 +202,7 @@ typedef struct MapSelectState { // ^^^ IS_MAP_SELECT_ENABLED ^^^ -typedef struct { +typedef struct SampleState { /* 0x0000 */ GameState state; /* 0x00A4 */ u8* staticSegment; /* 0x00A8 */ View view; @@ -217,7 +215,7 @@ typedef struct QuestHintCmd { /* 0x03 */ u8 byte3; } QuestHintCmd; // size = 0x4 -typedef enum { +typedef enum PauseBgPreRenderState { /* 0 */ PAUSE_BG_PRERENDER_OFF, // Inactive, do nothing. /* 1 */ PAUSE_BG_PRERENDER_SETUP, // The current frame is only drawn for the purpose of serving as the pause background. /* 2 */ PAUSE_BG_PRERENDER_PROCESS, // The previous frame was PAUSE_BG_PRERENDER_SETUP, now apply prerender filters. @@ -225,24 +223,26 @@ typedef enum { /* 4 */ PAUSE_BG_PRERENDER_MAX } PauseBgPreRenderState; -typedef enum { +typedef enum TransitionTileState { /* 0 */ TRANS_TILE_OFF, // Inactive, do nothing /* 1 */ TRANS_TILE_SETUP, // Save the necessary buffers /* 2 */ TRANS_TILE_PROCESS, // Initialize the transition /* 3 */ TRANS_TILE_READY // The transition is ready, so will update and draw each frame } TransitionTileState; -typedef struct { +typedef struct TitleSetupState { /* 0x0000 */ GameState state; /* 0x00A8 */ View view; } TitleSetupState; // size = 0x1D0 -typedef struct { +typedef struct FileSelectState { /* 0x00000 */ GameState state; /* 0x000A4 */ Vtx* windowVtx; /* 0x000A8 */ u8* staticSegment; /* 0x000AC */ u8* parameterSegment; - /* 0x000B0 */ char unk_B0[0x8]; +#if OOT_PAL + /* 0x000B0 */ u8* objectMagSegment; +#endif /* 0x000B8 */ View view; /* 0x001E0 */ SramContext sramCtx; /* 0x001E4 */ char unk_1E4[0x4]; @@ -261,7 +261,9 @@ typedef struct { /* 0x1CA1C */ u32 questItems[3]; /* 0x1CA28 */ s16 n64ddFlags[3]; /* 0x1CA2E */ s8 defense[3]; +#if OOT_PAL /* 0x1CA32 */ u16 health[3]; +#endif /* 0x1CA38 */ s16 buttonIndex; /* 0x1CA3A */ s16 confirmButtonIndex; // 0: yes, 1: quit /* 0x1CA3C */ s16 menuMode; @@ -316,27 +318,7 @@ typedef struct { /* 0x1CAD6 */ s16 unk_1CAD6[5]; } FileSelectState; // size = 0x1CAE0 -// Macros for `EntranceInfo.field` -#define ENTRANCE_INFO_CONTINUE_BGM_FLAG (1 << 15) -#define ENTRANCE_INFO_DISPLAY_TITLE_CARD_FLAG (1 << 14) -#define ENTRANCE_INFO_END_TRANS_TYPE_MASK 0x3F80 -#define ENTRANCE_INFO_END_TRANS_TYPE_SHIFT 7 -#define ENTRANCE_INFO_END_TRANS_TYPE(field) \ - (((field) >> ENTRANCE_INFO_END_TRANS_TYPE_SHIFT) \ - & (ENTRANCE_INFO_END_TRANS_TYPE_MASK >> ENTRANCE_INFO_END_TRANS_TYPE_SHIFT)) -#define ENTRANCE_INFO_START_TRANS_TYPE_MASK 0x7F -#define ENTRANCE_INFO_START_TRANS_TYPE_SHIFT 0 -#define ENTRANCE_INFO_START_TRANS_TYPE(field) \ - (((field) >> ENTRANCE_INFO_START_TRANS_TYPE_SHIFT) \ - & (ENTRANCE_INFO_START_TRANS_TYPE_MASK >> ENTRANCE_INFO_START_TRANS_TYPE_SHIFT)) - -typedef struct { - /* 0x00 */ u8 sceneId; - /* 0x01 */ u8 spawn; - /* 0x02 */ u16 field; -} EntranceInfo; // size = 0x4 - -typedef struct { +typedef struct GameStateOverlay { /* 0x00 */ void* loadedRamAddr; /* 0x04 */ RomFile file; // if applicable /* 0x0C */ void* vramStart; // if applicable @@ -350,74 +332,12 @@ typedef struct { /* 0x2C */ u32 instanceSize; } GameStateOverlay; // size = 0x30 -typedef struct { +typedef struct PreNMIState { /* 0x00 */ GameState state; /* 0xA4 */ u32 timer; /* 0xA8 */ UNK_TYPE4 unk_A8; } PreNMIState; // size = 0xAC -typedef enum { - /* 1 */ F_8F = 1, - /* 2 */ F_7F, - /* 3 */ F_6F, - /* 4 */ F_5F, - /* 5 */ F_4F, - /* 6 */ F_3F, - /* 7 */ F_2F, - /* 8 */ F_1F, - /* 9 */ F_B1, - /* 10 */ F_B2, - /* 11 */ F_B3, - /* 12 */ F_B4, - /* 13 */ F_B5, - /* 14 */ F_B6, - /* 15 */ F_B7, - /* 16 */ F_B8 -} FloorID; - -// All arrays pointed in this struct are indexed by "map indices" -// In dungeons, the map index corresponds to the dungeon index (which also indexes keys, items, etc) -// In overworld areas, the map index corresponds to the overworld area index (spot 00, 01, etc) -typedef struct { - /* 0x00 */ s16 (*floorTexIndexOffset)[8]; // dungeon texture index offset by floor - /* 0x04 */ s16* bossFloor; // floor the boss is on - /* 0x08 */ s16 (*roomPalette)[32]; // map palette by room - /* 0x0C */ s16* maxPaletteCount; // max number of palettes in a same floor - /* 0x10 */ s16 (*paletteRoom)[8][14]; // room by palette by floor - /* 0x14 */ s16 (*roomCompassOffsetX)[44]; // dungeon compass icon X offset by room - /* 0x18 */ s16 (*roomCompassOffsetY)[44]; // dungeon compass icon Y offset by room - /* 0x1C */ u8* dgnMinimapCount; // number of room minimaps - /* 0x20 */ u16* dgnMinimapTexIndexOffset; // dungeon minimap texture index offset - /* 0x24 */ u16* owMinimapTexSize; - /* 0x28 */ u16* owMinimapTexOffset; - /* 0x2C */ s16* owMinimapPosX; - /* 0x30 */ s16* owMinimapPosY; - /* 0x34 */ s16 (*owCompassInfo)[4]; // [X scale, Y scale, X offset, Y offset] - /* 0x38 */ s16* dgnTexIndexBase; // dungeon texture index base - /* 0x3C */ s16 (*dgnCompassInfo)[4]; // [X scale, Y scale, X offset, Y offset] - /* 0x40 */ s16* owMinimapWidth; - /* 0x44 */ s16* owMinimapHeight; - /* 0x48 */ s16* owEntranceIconPosX; // "dungeon entrance" icon X pos - /* 0x4C */ s16* owEntranceIconPosY; // "dungeon entrance" icon Y pos - /* 0x50 */ u16* owEntranceFlag; // flag in inf_table[26] based on which entrance icons are shown (0xFFFF = always shown) - /* 0x54 */ f32 (*floorCoordY)[8]; // Y coordinate of each floor - /* 0x58 */ u16* switchEntryCount; // number of "room switch" entries, which correspond to the next 3 arrays - /* 0x5C */ u8 (*switchFromRoom)[51]; // room to come from - /* 0x60 */ u8 (*switchFromFloor)[51]; // floor to come from - /* 0x64 */ u8 (*switchToRoom)[51]; // room to go to - /* 0x68 */ u8 (*floorID)[8]; - /* 0x6C */ s16* skullFloorIconY; // dungeon big skull icon Y pos -} MapData; // size = 0x70 - -// TODO get these properties from the textures themselves -#define MAP_I_TEX_WIDTH 96 -#define MAP_I_TEX_HEIGHT 85 -#define MAP_I_TEX_SIZE ((MAP_I_TEX_WIDTH * MAP_I_TEX_HEIGHT) / 2) // 96x85 I4 texture - -#define MAP_48x85_TEX_WIDTH 48 -#define MAP_48x85_TEX_HEIGHT 85 -#define MAP_48x85_TEX_SIZE ((MAP_48x85_TEX_WIDTH * MAP_48x85_TEX_HEIGHT) / 2) // 48x85 CI4 texture - typedef struct DebugDispObject { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3s rot; @@ -427,28 +347,7 @@ typedef struct DebugDispObject { /* 0x28 */ struct DebugDispObject* next; } DebugDispObject; // size = 0x2C -typedef enum { - /* 0 */ MTXMODE_NEW, // generates a new matrix - /* 1 */ MTXMODE_APPLY // applies transformation to the current matrix -} MatrixMode; - -typedef struct StackEntry { - /* 0x00 */ struct StackEntry* next; - /* 0x04 */ struct StackEntry* prev; - /* 0x08 */ u32* head; - /* 0x0C */ u32* tail; - /* 0x10 */ u32 initValue; - /* 0x14 */ s32 minSpace; - /* 0x18 */ const char* name; -} StackEntry; - -typedef enum { - /* 0 */ STACK_STATUS_OK, - /* 1 */ STACK_STATUS_WARNING, - /* 2 */ STACK_STATUS_OVERFLOW -} StackStatus; - -typedef struct { +typedef struct ISVDbg { /* 0x00 */ u32 magic; // IS64 /* 0x04 */ u32 get; /* 0x08 */ u8 unk_08[0x14-0x08]; @@ -457,7 +356,7 @@ typedef struct { /* 0x20 */ u8 data[0x10000-0x20]; } ISVDbg; -typedef struct { +typedef struct LocaleCartInfo { /* 0x00 */ char name[0x18]; /* 0x18 */ u32 mediaFormat; /* 0x1C */ union { @@ -470,40 +369,13 @@ typedef struct { }; } LocaleCartInfo; // size = 0x20 -typedef struct { +typedef struct Yaz0Header { /* 0x00 */ char magic[4]; // Yaz0 /* 0x04 */ u32 decSize; /* 0x08 */ u32 compInfoOffset; // only used in mio0 /* 0x0C */ u32 uncompDataOffset; // only used in mio0 } Yaz0Header; // size = 0x10 -struct ArenaNode; - -typedef struct Arena { - /* 0x00 */ struct ArenaNode* head; - /* 0x04 */ void* start; - /* 0x08 */ OSMesgQueue lockQueue; - /* 0x20 */ u8 allocFailures; // only used in non-debug builds - /* 0x21 */ u8 isInit; - /* 0x22 */ u8 flag; -} Arena; // size = 0x24 - -typedef struct ArenaNode { - /* 0x00 */ s16 magic; - /* 0x02 */ s16 isFree; - /* 0x04 */ u32 size; - /* 0x08 */ struct ArenaNode* next; - /* 0x0C */ struct ArenaNode* prev; -#if IS_DEBUG // TODO: This debug info is also present in N64 retail builds - /* 0x10 */ const char* filename; - /* 0x14 */ int line; - /* 0x18 */ OSId threadId; - /* 0x1C */ Arena* arena; - /* 0x20 */ OSTime time; - /* 0x28 */ u8 unk_28[0x30-0x28]; // probably padding -#endif -} ArenaNode; // size = 0x30 - /* Relocation entry field getters */ #define RELOC_SECTION(reloc) ((reloc) >> 30) #define RELOC_OFFSET(reloc) ((reloc) & 0xFFFFFF) @@ -517,7 +389,7 @@ typedef struct ArenaNode { #define R_MIPS_LO16 6 /* Reloc section id, must fit in 2 bits otherwise the relocation format must be modified */ -typedef enum { +typedef enum RelocSectionId { /* 0 */ RELOC_SECTION_NULL, /* 1 */ RELOC_SECTION_TEXT, /* 2 */ RELOC_SECTION_DATA, @@ -539,21 +411,23 @@ typedef struct OverlayRelocationSection { // where 64-bit load/store instructions are emulated with 2x 32-bit load/store instructions. The alignment attribute // conveys that this structure will not always be 8-bytes aligned, allowing a modern compiler to generate non-crashing // code for accessing these. This is not an issue in the original compiler as it only output O32 ABI code. -ALIGNED(4) typedef struct { +ALIGNED(4) typedef struct PreNmiBuff { /* 0x00 */ u32 resetting; /* 0x04 */ u32 resetCount; /* 0x08 */ OSTime duration; /* 0x10 */ OSTime resetTime; } PreNmiBuff; // size = 0x18 (actually osAppNMIBuffer is 0x40 bytes large but the rest is unused) -typedef enum { - /* 0 */ VI_MODE_EDIT_STATE_INACTIVE, - /* 1 */ VI_MODE_EDIT_STATE_ACTIVE, - /* 2 */ VI_MODE_EDIT_STATE_2, // active, more adjustments - /* 3 */ VI_MODE_EDIT_STATE_3 // active, more adjustments, print comparison with NTSC LAN1 mode +typedef enum ViModeEditState { + /* -2 */ VI_MODE_EDIT_STATE_NEGATIVE_2 = -2, + /* -1 */ VI_MODE_EDIT_STATE_NEGATIVE_1, + /* 0 */ VI_MODE_EDIT_STATE_INACTIVE, + /* 1 */ VI_MODE_EDIT_STATE_ACTIVE, + /* 2 */ VI_MODE_EDIT_STATE_2, // active, more adjustments + /* 3 */ VI_MODE_EDIT_STATE_3 // active, more adjustments, print comparison with NTSC LAN1 mode } ViModeEditState; -typedef struct { +typedef struct ViMode { /* 0x00 */ OSViMode customViMode; /* 0x50 */ s32 viHeight; /* 0x54 */ s32 viWidth; diff --git a/include/z64actor.h b/include/z64actor.h index d651786862..7c908f4c4a 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -2,7 +2,7 @@ #define Z64ACTOR_H #include "color.h" -#include "z64dma.h" +#include "romfile.h" #include "z64animation.h" #include "z64math.h" #include "z64collision_check.h" @@ -15,8 +15,10 @@ #define MASS_HEAVY 0xFE // Can only be pushed by OC colliders from actors with IMMOVABLE or HEAVY mass. struct Actor; +struct ActorEntry; struct CollisionPoly; struct Lights; +struct Player; struct PlayState; typedef void (*ActorFunc)(struct Actor*, struct PlayState*); @@ -24,7 +26,7 @@ typedef void (*ActorShadowFunc)(struct Actor*, struct Lights*, struct PlayState* typedef u16 (*NpcGetTextIdFunc)(struct PlayState*, struct Actor*); typedef s16 (*NpcUpdateTalkStateFunc)(struct PlayState*, struct Actor*); -typedef struct { +typedef struct ActorProfile { /* 0x00 */ s16 id; /* 0x02 */ u8 category; // Classifies actor and determines when it will update or draw /* 0x04 */ u32 flags; @@ -34,7 +36,7 @@ typedef struct { /* 0x14 */ ActorFunc destroy; // Destructor /* 0x18 */ ActorFunc update; // Update Function /* 0x1C */ ActorFunc draw; // Draw function -} ActorInit; // size = 0x20 +} ActorProfile; // size = 0x20 /** * @see ACTOROVL_ALLOC_ABSOLUTE @@ -85,51 +87,18 @@ typedef struct { */ #define ACTOROVL_ALLOC_PERSISTENT (1 << 1) -typedef struct { +typedef struct ActorOverlay { /* 0x00 */ RomFile file; /* 0x08 */ void* vramStart; /* 0x0C */ void* vramEnd; /* 0x10 */ void* loadedRamAddr; // original name: "allocp" - /* 0x14 */ ActorInit* initInfo; + /* 0x14 */ ActorProfile* profile; /* 0x18 */ char* name; /* 0x1C */ u16 allocType; // See `ACTOROVL_ALLOC_` defines /* 0x1E */ s8 numLoaded; // original name: "clients" } ActorOverlay; // size = 0x20 -typedef struct { - u8 table[32]; -} DamageTable; - -typedef struct { - /* 0x00 */ u8 health; - /* 0x02 */ s16 cylRadius; - /* 0x04 */ s16 cylHeight; - /* 0x06 */ u8 mass; -} CollisionCheckInfoInit; - -typedef struct { - /* 0x00 */ u8 health; - /* 0x02 */ s16 cylRadius; - /* 0x04 */ s16 cylHeight; - /* 0x06 */ s16 cylYShift; - /* 0x08 */ u8 mass; -} CollisionCheckInfoInit2; - -typedef struct { - /* 0x00 */ DamageTable* damageTable; - /* 0x04 */ Vec3f displacement; // Amount to correct actor velocity by when colliding into a body - /* 0x10 */ s16 cylRadius; // Used for various purposes - /* 0x12 */ s16 cylHeight; // Used for various purposes - /* 0x14 */ s16 cylYShift; // Unused. Purpose inferred from Cylinder16 and CollisionCheck_CylSideVsLineSeg - /* 0x16 */ u8 mass; // Used to compute displacement for OC collisions - /* 0x17 */ u8 health; // Note: some actors may use their own health variable instead of this one - /* 0x18 */ u8 damage; // Amount to decrement health by - /* 0x19 */ u8 damageEffect; // Stores what effect should occur when hit by a weapon - /* 0x1A */ u8 atHitEffect; // Stores what effect should occur when AT connects with an AC - /* 0x1B */ u8 acHitEffect; // Stores what effect should occur when AC is touched by an AT -} CollisionCheckInfo; // size = 0x1C - -typedef struct { +typedef struct ActorShape { /* 0x00 */ Vec3s rot; // Current actor shape rotation /* 0x06 */ s16 face; // Used to index eyes and mouth textures. Only used by player /* 0x08 */ f32 yOffset; // Model y axis offset. Represents model space units @@ -140,14 +109,19 @@ typedef struct { /* 0x18 */ Vec3f feetPos[2]; // Update by using `Actor_SetFeetPos` in PostLimbDraw } ActorShape; // size = 0x30 -// -#define ACTOR_FLAG_0 (1 << 0) +// Actor is discoverable by the Attention System. This enables Navi to hover over the actor when it is in range. +// The actor can also be locked onto (as long as `ACTOR_FLAG_LOCK_ON_DISABLED` is not set). +#define ACTOR_FLAG_ATTENTION_ENABLED (1 << 0) -// -#define ACTOR_FLAG_2 (1 << 2) +// Actor is hostile toward the Player. Player has specific "battle" behavior when locked onto hostile actors. +// Enemy background music will also be played when the player is close enough to a hostile actor. +// Note: This must be paired with `ACTOR_FLAG_ATTENTION_ENABLED` to have any effect. +#define ACTOR_FLAG_HOSTILE (1 << 2) -// -#define ACTOR_FLAG_3 (1 << 3) +// Actor is considered "friendly"; Opposite flag of `ACTOR_FLAG_HOSTILE`. +// Note that this flag doesn't have any effect on either the actor, or Player's behavior. +// What actually matters is the presence or lack of `ACTOR_FLAG_HOSTILE`. +#define ACTOR_FLAG_FRIENDLY (1 << 3) // #define ACTOR_FLAG_4 (1 << 4) @@ -187,29 +161,32 @@ typedef struct { // #define ACTOR_FLAG_15 (1 << 15) -// -#define ACTOR_FLAG_16 (1 << 16) +// Player automatically accepts a Talk Offer without needing to press the A button. +// Player still has to meet all conditions to be able to receive a talk offer (for example, being in range). +#define ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED (1 << 16) -// -#define ACTOR_FLAG_17 (1 << 17) +// Actor will be influenced by the pitch (x rot) of Player's left hand when being carried, +// instead of Player's yaw which is the default actor carry behavior. +// This flag is helpful for something like the `BG_HEAVY_BLOCK` actor which Player carries underhanded. +#define ACTOR_FLAG_CARRY_X_ROT_INFLUENCE (1 << 17) -// -#define ACTOR_FLAG_18 (1 << 18) +// When locked onto an actor with this flag set, the C-Up button can be used to talk to this actor. +// A C-Up button labeled "Navi" will appear on the HUD when locked on which indicates the actor can be checked with Navi. +// With this flag Player talks directly to the actor with C-Up. It is expected that the resulting dialog should appear +// to be coming from Navi, even though she is not involved at all with this interaction. +#define ACTOR_FLAG_TALK_WITH_C_UP (1 << 18) -// -#define ACTOR_FLAG_19 (1 << 19) - -// -#define ACTOR_FLAG_20 (1 << 20) - -// -#define ACTOR_FLAG_21 (1 << 21) +// Flags controlling the use of `Actor.sfx`. Do not use directly. +#define ACTOR_FLAG_SFX_ACTOR_POS_2 (1 << 19) // see Actor_PlaySfx_Flagged2 +#define ACTOR_AUDIO_FLAG_SFX_CENTERED_1 (1 << 20) // see Actor_PlaySfx_FlaggedCentered1 +#define ACTOR_AUDIO_FLAG_SFX_CENTERED_2 (1 << 21) // see Actor_PlaySfx_FlaggedCentered2 // ignores point lights but not directional lights (such as environment lights) #define ACTOR_FLAG_IGNORE_POINT_LIGHTS (1 << 22) -// -#define ACTOR_FLAG_23 (1 << 23) +// When Player is carrying this actor, it can only be thrown, not dropped/placed. +// Typically an actor can only be thrown when moving, but this allows an actor to be thrown when standing still. +#define ACTOR_FLAG_THROW_ONLY (1 << 23) // #define ACTOR_FLAG_24 (1 << 24) @@ -220,11 +197,12 @@ typedef struct { // #define ACTOR_FLAG_26 (1 << 26) -// -#define ACTOR_FLAG_27 (1 << 27) +// Player is not able to lock onto the actor. +// Navi will still be able to hover over the actor, assuming `ACTOR_FLAG_ATTENTION_ENABLED` is set. +#define ACTOR_FLAG_LOCK_ON_DISABLED (1 << 27) -// -#define ACTOR_FLAG_28 (1 << 28) +// Flag controlling the use of `Actor.sfx`. Do not use directly. See Actor_PlaySfx_FlaggedTimer +#define ACTOR_FLAG_SFX_TIMER (1 << 28) #define COLORFILTER_GET_COLORINTENSITY(colorFilterParams) (((colorFilterParams) & 0x1F00) >> 5) #define COLORFILTER_GET_DURATION(colorFilterParams) ((colorFilterParams) & 0xFF) @@ -257,11 +235,11 @@ typedef struct Actor { /* 0x008 */ PosRot home; // Initial position/rotation when spawned. Can be used for other purposes /* 0x01C */ s16 params; // Configurable variable set by the actor's spawn data; original name: "args_data" /* 0x01E */ s8 objectSlot; // Object slot (in ObjectContext) corresponding to the actor's object; original name: "bank" - /* 0x01F */ s8 targetMode; // Controls how far the actor can be targeted from and how far it can stay locked on + /* 0x01F */ s8 attentionRangeType; // Controls the attention actor range and the lock-on leash range. See `AttentionRangeType`. /* 0x020 */ u16 sfx; // SFX ID to play. Sfx plays when value is set, then is cleared the following update cycle /* 0x024 */ PosRot world; // Position/rotation in the world - /* 0x038 */ PosRot focus; // Target reticle focuses on this position. For player this represents head pos and rot - /* 0x04C */ f32 targetArrowOffset; // Height offset of the target arrow relative to `focus` position + /* 0x038 */ PosRot focus; // Player + camera focus pos during lock-on, among other uses. For player this represents head pos and rot. + /* 0x04C */ f32 lockOnArrowOffset; // Height offset of the lock-on arrow relative to `focus` position /* 0x050 */ Vec3f scale; // Scale of the actor in each axis /* 0x05C */ Vec3f velocity; // Velocity of the actor in each axis /* 0x068 */ f32 speed; // Context dependent speed value. Can be used for XZ or XYZ depending on which move function is used @@ -287,8 +265,8 @@ typedef struct Actor { /* 0x0F8 */ f32 uncullZoneScale; // Amount to increase the uncull zone scale by (in projected space) /* 0x0FC */ f32 uncullZoneDownward; // Amount to increase uncull zone downward by (in projected space) /* 0x100 */ Vec3f prevPos; // World position from the previous update cycle - /* 0x10C */ u8 isTargeted; // Set to true if the actor is currently being targeted by the player - /* 0x10D */ u8 targetPriority; // Lower values have higher priority. Resets to 0 when player stops targeting + /* 0x10C */ u8 isLockedOn; // Set to true if the actor is currently locked-on by Player + /* 0x10D */ u8 attentionPriority; // Lower values have higher priority. Resets to 0 when lock-on is released. /* 0x10E */ u16 textId; // Text ID to pass to player/display when interacting with the actor /* 0x110 */ u16 freezeTimer; // Actor does not update when set. Timer decrements automatically /* 0x112 */ u16 colorFilterParams; // Set color filter to red, blue, or white. Toggle opa or xlu @@ -310,7 +288,7 @@ typedef struct Actor { #endif } Actor; // size = 0x14C -typedef enum { +typedef enum ActorFootIndex { /* 0 */ FOOT_LEFT, /* 1 */ FOOT_RIGHT } ActorFootIndex; @@ -344,7 +322,7 @@ typedef struct DynaPolyActor { /* 0x162 */ s16 unk_162; } DynaPolyActor; // size = 0x164 -typedef struct { +typedef struct BodyBreak { /* 0x00 */ MtxF* matrices; /* 0x04 */ s16* objectSlots; /* 0x08 */ s16 count; @@ -357,7 +335,7 @@ typedef struct { #define BODYBREAK_STATUS_READY -1 #define BODYBREAK_STATUS_FINISHED 0 -typedef enum { +typedef enum Item00Type { /* 0x00 */ ITEM00_RUPEE_GREEN, /* 0x01 */ ITEM00_RUPEE_BLUE, /* 0x02 */ ITEM00_RUPEE_RED, @@ -406,7 +384,7 @@ typedef struct EnItem00 { } EnItem00; // size = 0x1AC // Only A_OBJ_SIGNPOST_OBLONG and A_OBJ_SIGNPOST_ARROW are used in room files. -typedef enum { +typedef enum AObjType { /* 0x00 */ A_OBJ_BLOCK_SMALL, /* 0x01 */ A_OBJ_BLOCK_LARGE, /* 0x02 */ A_OBJ_BLOCK_HUGE, @@ -439,7 +417,7 @@ typedef struct EnAObj { /* 0x17C */ ColliderCylinder collider; } EnAObj; // size = 0x1C8 -typedef enum { +typedef enum ActorCategory { /* 0x00 */ ACTORCAT_SWITCH, /* 0x01 */ ACTORCAT_BG, /* 0x02 */ ACTORCAT_PLAYER, @@ -459,7 +437,7 @@ typedef enum { #define DEFINE_ACTOR_INTERNAL(_0, enum, _2, _3) enum, #define DEFINE_ACTOR_UNSET(enum) enum, -typedef enum { +typedef enum ActorID { #include "tables/actor_table.h" /* 0x0192 */ ACTOR_ID_MAX // originally "ACTOR_DLF_MAX" } ActorID; @@ -468,13 +446,13 @@ typedef enum { #undef DEFINE_ACTOR_INTERNAL #undef DEFINE_ACTOR_UNSET -typedef enum { +typedef enum DoorLockType { DOORLOCK_NORMAL, DOORLOCK_BOSS, DOORLOCK_NORMAL_SPIRIT } DoorLockType; -typedef enum { +typedef enum NaviEnemy { /* 0x00 */ NAVI_ENEMY_DEFAULT, /* 0x01 */ NAVI_ENEMY_GOHMA, /* 0x02 */ NAVI_ENEMY_GOHMA_EGG, @@ -571,31 +549,62 @@ typedef enum { /* 0xFF */ NAVI_ENEMY_NONE = 0xFF } NaviEnemy; -typedef struct TargetContextEntry { +/** + * Attention System + * + * The Attention System's responsibility is to bring specific actors to the player's attention. + * This includes: + * - Making Navi fly over to certain actors of interest (can be lock-on actors, but may also not be) + * - Displaying an arrow over an actor that can be locked onto + * - Displaying a reticle over the current lock-on actor + * - Playing enemy background music if a hostile actor is nearby + * + * This system does not handle the actual lock-on implementation. + * That is the responsibility of Player via `player->focusActor` and the camera. + */ + +// A set of 4 triangles which appear as a ring around an actor when locked-on +typedef struct LockOnReticle { /* 0x00 */ Vec3f pos; - /* 0x0C */ f32 unk_0C; // radius? + /* 0x0C */ f32 radius; // distance towards the center of the locked-on actor /* 0x10 */ Color_RGB8 color; -} TargetContextEntry; // size = 0x14 - -typedef struct TargetContext { - /* 0x00 */ Vec3f naviRefPos; // possibly wrong - /* 0x0C */ Vec3f targetCenterPos; - /* 0x18 */ Color_RGBAf naviInner; - /* 0x28 */ Color_RGBAf naviOuter; - /* 0x38 */ Actor* arrowPointedActor; - /* 0x3C */ Actor* targetedActor; - /* 0x40 */ f32 unk_40; - /* 0x44 */ f32 unk_44; - /* 0x48 */ s16 unk_48; - /* 0x4A */ u8 activeCategory; - /* 0x4B */ u8 unk_4B; - /* 0x4C */ s8 unk_4C; - /* 0x4D */ char unk_4D[0x03]; - /* 0x50 */ TargetContextEntry arr_50[3]; - /* 0x8C */ Actor* unk_8C; - /* 0x90 */ Actor* bgmEnemy; // The nearest enemy to player with the right flags that will trigger NA_BGM_ENEMY - /* 0x94 */ Actor* unk_94; -} TargetContext; // size = 0x98 +} LockOnReticle; // size = 0x14 + +typedef struct Attention { + /* 0x00 */ Vec3f naviHoverPos; // Navi's current hover position + /* 0x0C */ Vec3f reticlePos; // Main reticle pos which each `LockOnReticle` instance can reference + /* 0x18 */ Color_RGBAf naviInnerColor; // Navi inner color, based on actor category + /* 0x28 */ Color_RGBAf naviOuterColor; // Navi outer color, based on actor category + /* 0x38 */ Actor* naviHoverActor; // The actor that Navi hovers over + /* 0x3C */ Actor* reticleActor; // Actor to draw a reticle over + /* 0x40 */ f32 naviMoveProgressFactor; // Controls Navi so she can smootly transition to an actor + /* 0x44 */ f32 reticleRadius; // Main reticle radius value which each `LockOnReticle` instance can reference + /* 0x48 */ s16 reticleFadeAlphaControl; // Set and fade the reticle alpha; Non-zero values control if it should draw + /* 0x4A */ u8 naviHoverActorCategory; // Category of the actor Navi is currently hovering over + /* 0x4B */ u8 reticleSpinCounter; // Counts up when a reticle is active, used for the spinning animation + /* 0x4C */ s8 curReticle; // Indexes lockOnReticles[] + /* 0x50 */ LockOnReticle lockOnReticles[3]; // Multiple reticles are used for a motion-blur effect + /* 0x8C */ Actor* forcedLockOnActor; // Forces lock-on to this actor when set (never used in practice) + /* 0x90 */ Actor* bgmEnemy; // The nearest actor which can trigger enemy background music + /* 0x94 */ Actor* arrowHoverActor; // Actor to draw an arrow over +} Attention; // size = 0x98 + +// It is difficult to give each type a name because it is numerically based +// and there are so many different combinations. +// Each type has a comment of the form "attention range / lock-on leash range" +typedef enum AttentionRangeType { + /* 0 */ ATTENTION_RANGE_0, // 70 / 140 + /* 1 */ ATTENTION_RANGE_1, // 170 / 255 + /* 2 */ ATTENTION_RANGE_2, // 280 / 5600 + /* 3 */ ATTENTION_RANGE_3, // 350 / 525 (default) + /* 4 */ ATTENTION_RANGE_4, // 700 / 1050 + /* 5 */ ATTENTION_RANGE_5, // 1000 / 1500 + /* 6 */ ATTENTION_RANGE_6, // 100 / 105.36842 + /* 7 */ ATTENTION_RANGE_7, // 140 / 163.33333 + /* 8 */ ATTENTION_RANGE_8, // 240 / 576 + /* 9 */ ATTENTION_RANGE_9, // 280 / 280000 + /* 10 */ ATTENTION_RANGE_MAX +} AttentionRangeType; typedef struct TitleCardContext { /* 0x00 */ void* texture; @@ -634,16 +643,13 @@ typedef struct ActorContext { /* 0x004 */ char unk_04[0x04]; /* 0x008 */ u8 total; // total number of actors loaded /* 0x00C */ ActorListEntry actorLists[ACTORCAT_MAX]; - /* 0x06C */ TargetContext targetCtx; + /* 0x06C */ Attention attention; /* 0x104 */ ActorContextSceneFlags flags; /* 0x128 */ TitleCardContext titleCtx; /* 0x138 */ char unk_138[0x04]; /* 0x13C */ void* absoluteSpace; // Space used to allocate actor overlays with alloc type ACTOROVL_ALLOC_ABSOLUTE } ActorContext; // size = 0x140 -#define TRANSITION_ACTOR_PARAMS_INDEX_SHIFT 10 -#define GET_TRANSITION_ACTOR_INDEX(actor) ((u16)(actor)->params >> TRANSITION_ACTOR_PARAMS_INDEX_SHIFT) - // EnDoor and DoorKiller share openAnim and playerIsOpening // Due to alignment, a substruct cannot be used in the structs of these actors. #define DOOR_ACTOR_BASE \ @@ -666,7 +672,7 @@ typedef struct SlidingDoorActorBase { /* 0x0000 */ SLIDING_DOOR_ACTOR_BASE; } SlidingDoorActorBase; -typedef enum { +typedef enum DoorOpenAnim { /* 0x00 */ DOOR_OPEN_ANIM_ADULT_L, /* 0x01 */ DOOR_OPEN_ANIM_CHILD_L, /* 0x02 */ DOOR_OPEN_ANIM_ADULT_R, @@ -683,14 +689,14 @@ typedef enum { #define UPDBGCHECKINFO_FLAG_6 (1 << 6) // disable water ripples #define UPDBGCHECKINFO_FLAG_7 (1 << 7) // alternate wall check? -typedef enum { +typedef enum NpcTalkState { /* 0x0 */ NPC_TALK_STATE_IDLE, // NPC not currently talking to player /* 0x1 */ NPC_TALK_STATE_TALKING, // NPC is currently talking to player /* 0x2 */ NPC_TALK_STATE_ACTION, // An NPC-defined action triggered in the conversation /* 0x3 */ NPC_TALK_STATE_ITEM_GIVEN // NPC finished giving an item and text box is done } NpcTalkState; -typedef enum { +typedef enum NpcTrackingMode { /* 0x0 */ NPC_TRACKING_PLAYER_AUTO_TURN, // Determine tracking mode based on player position, see Npc_UpdateAutoTurn /* 0x1 */ NPC_TRACKING_NONE, // Don't track the target (usually the player) /* 0x2 */ NPC_TRACKING_HEAD_AND_TORSO, // Track target by turning the head and the torso @@ -698,7 +704,7 @@ typedef enum { /* 0x4 */ NPC_TRACKING_FULL_BODY // Track target by turning the body, torso and head } NpcTrackingMode; -typedef struct { +typedef struct NpcInteractInfo { /* 0x00 */ s16 talkState; /* 0x02 */ s16 trackingMode; /* 0x04 */ s16 autoTurnTimer; @@ -710,4 +716,227 @@ typedef struct { /* 0x24 */ char unk_24[0x4]; } NpcInteractInfo; // size = 0x28 +// Converts a number of bits to a bitmask, helper for params macros +// e.g. 3 becomes 0b111 (7) +#define NBITS_TO_MASK(n) \ + ((1 << (n)) - 1) + +// Extracts the `n`-bit value at position `s` in `p`, shifts then masks +// Unsigned variant, no possibility of sign extension +#define PARAMS_GET_U(p, s, n) \ + (((p) >> (s)) & NBITS_TO_MASK(n)) + +// Extracts the `n`-bit value at position `s` in `p`, masks then shifts +// Signed variant, possibility of sign extension +#define PARAMS_GET_S(p, s, n) \ + (((p) & (NBITS_TO_MASK(n) << (s))) >> (s)) + +// Extracts all bits past position `s` in `p` +#define PARAMS_GET_NOMASK(p, s) \ + ((p) >> (s)) + +// Extracts the `n`-bit value at position `s` in `p` without shifting it from its current position +#define PARAMS_GET_NOSHIFT(p, s, n) \ + ((p) & (NBITS_TO_MASK(n) << (s))) + +// Generates a bitmask for bit position `s` of length `n` +#define PARAMS_MAKE_MASK(s, n) PARAMS_GET_NOSHIFT(~0, s, n) + +#define TRANSITION_ACTOR_PARAMS_INDEX_SHIFT 10 +#define GET_TRANSITION_ACTOR_INDEX(actor) PARAMS_GET_NOMASK((u16)(actor)->params, 10) + +void ActorShape_Init(ActorShape* shape, f32 yOffset, ActorShadowFunc shadowDraw, f32 shadowScale); +void ActorShadow_DrawCircle(Actor* actor, struct Lights* lights, struct PlayState* play); +void ActorShadow_DrawWhiteCircle(Actor* actor, struct Lights* lights, struct PlayState* play); +void ActorShadow_DrawHorse(Actor* actor, struct Lights* lights, struct PlayState* play); +void ActorShadow_DrawFeet(Actor* actor, struct Lights* lights, struct PlayState* play); +void Actor_SetFeetPos(Actor* actor, s32 limbIndex, s32 leftFootIndex, Vec3f* leftFootPos, s32 rightFootIndex, + Vec3f* rightFootPos); +void Actor_ProjectPos(struct PlayState* play, Vec3f* src, Vec3f* xyzDest, f32* cappedInvWDest); +void Attention_Draw(Attention* attention, struct PlayState* play); +s32 Flags_GetSwitch(struct PlayState* play, s32 flag); +void Flags_SetSwitch(struct PlayState* play, s32 flag); +void Flags_UnsetSwitch(struct PlayState* play, s32 flag); +s32 Flags_GetUnknown(struct PlayState* play, s32 flag); +void Flags_SetUnknown(struct PlayState* play, s32 flag); +void Flags_UnsetUnknown(struct PlayState* play, s32 flag); +s32 Flags_GetTreasure(struct PlayState* play, s32 flag); +void Flags_SetTreasure(struct PlayState* play, s32 flag); +s32 Flags_GetClear(struct PlayState* play, s32 flag); +void Flags_SetClear(struct PlayState* play, s32 flag); +void Flags_UnsetClear(struct PlayState* play, s32 flag); +s32 Flags_GetTempClear(struct PlayState* play, s32 flag); +void Flags_SetTempClear(struct PlayState* play, s32 flag); +void Flags_UnsetTempClear(struct PlayState* play, s32 flag); +s32 Flags_GetCollectible(struct PlayState* play, s32 flag); +void Flags_SetCollectible(struct PlayState* play, s32 flag); +void TitleCard_InitBossName(struct PlayState* play, TitleCardContext* titleCtx, void* texture, s16 x, s16 y, u8 width, + u8 height); +void TitleCard_InitPlaceName(struct PlayState* play, TitleCardContext* titleCtx, void* texture, s32 x, s32 y, s32 width, + s32 height, s32 delay); +s32 TitleCard_Clear(struct PlayState* play, TitleCardContext* titleCtx); +void Actor_Kill(Actor* actor); +void Actor_SetFocus(Actor* actor, f32 yOffset); +void Actor_SetScale(Actor* actor, f32 scale); +void Actor_SetObjectDependency(struct PlayState* play, Actor* actor); +void Actor_UpdatePos(Actor* actor); +void Actor_UpdateVelocityXZGravity(Actor* actor); +void Actor_MoveXZGravity(Actor* actor); +void Actor_UpdateVelocityXYZ(Actor* actor); +void Actor_MoveXYZ(Actor* actor); +void Actor_SetProjectileSpeed(Actor* actor, f32 speedXYZ); +s16 Actor_WorldYawTowardActor(Actor* origin, Actor* target); +s16 Actor_FocusYawTowardActor(Actor* origin, Actor* target); +s16 Actor_WorldYawTowardPoint(Actor* origin, Vec3f* point); +f32 Actor_WorldDistXYZToActor(Actor* actorA, Actor* actorB); +f32 Actor_WorldDistXYZToPoint(Actor* actor, Vec3f* refPoint); +s16 Actor_WorldPitchTowardActor(Actor* actorA, Actor* actorB); +s16 Actor_WorldPitchTowardPoint(Actor* actor, Vec3f* refPoint); +f32 Actor_WorldDistXZToActor(Actor* actorA, Actor* actorB); +f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint); +void Actor_WorldToActorCoords(Actor* actor, Vec3f* dest, Vec3f* pos); +f32 Actor_HeightDiff(Actor* actorA, Actor* actorB); +f32 Player_GetHeight(struct Player* player); +f32 func_8002DCE4(struct Player* player); +int func_8002DD6C(struct Player* player); +int func_8002DD78(struct Player* player); +s32 func_8002DDE4(struct PlayState* play); +s32 func_8002DDF4(struct PlayState* play); +void func_8002DE04(struct PlayState* play, Actor* actorA, Actor* actorB); +void func_8002DE74(struct PlayState* play, struct Player* player); +void Actor_MountHorse(struct PlayState* play, struct Player* player, Actor* horse); +int func_8002DEEC(struct Player* player); +void func_8002DF18(struct PlayState* play, struct Player* player); +s32 Player_SetCsAction(struct PlayState* play, Actor* csActor, u8 csAction); +s32 Player_SetCsActionWithHaltedActors(struct PlayState* play, Actor* csActor, u8 csAction); +void func_8002DF90(DynaPolyActor* dynaActor); +void func_8002DFA4(DynaPolyActor* dynaActor, f32 arg1, s16 arg2); +s32 Player_IsFacingActor(Actor* actor, s16 maxAngle, struct PlayState* play); +s32 Actor_ActorBIsFacingActorA(Actor* actorA, Actor* actorB, s16 maxAngle); +s32 Actor_IsFacingPlayer(Actor* actor, s16 maxAngle); +s32 Actor_ActorAIsFacingActorB(Actor* actorA, Actor* actorB, s16 maxAngle); +s32 Actor_IsFacingAndNearPlayer(Actor* actor, f32 range, s16 maxAngle); +s32 Actor_ActorAIsFacingAndNearActorB(Actor* actorA, Actor* actorB, f32 range, s16 maxAngle); +void Actor_UpdateBgCheckInfo(struct PlayState* play, Actor* actor, f32 wallCheckHeight, f32 wallCheckRadius, + f32 ceilingCheckHeight, s32 flags); +Hilite* func_8002EABC(Vec3f* object, Vec3f* eye, Vec3f* lightDir, struct GraphicsContext* gfxCtx); +Hilite* func_8002EB44(Vec3f* object, Vec3f* eye, Vec3f* lightDir, struct GraphicsContext* gfxCtx); +void func_8002EBCC(Actor* actor, struct PlayState* play, s32 flag); +void func_8002ED80(Actor* actor, struct PlayState* play, s32 flag); +PosRot Actor_GetFocus(Actor* actor); +PosRot Actor_GetWorld(Actor* actor); +PosRot Actor_GetWorldPosShapeRot(Actor* actor); +s32 Attention_ShouldReleaseLockOn(Actor* actor, struct Player* player, s32 ignoreLeash); +s32 Actor_TalkOfferAccepted(Actor* actor, struct PlayState* play); +s32 Actor_OfferTalkExchange(Actor* actor, struct PlayState* play, f32 xzRange, f32 yRange, u32 exchangeItemId); +s32 Actor_OfferTalkExchangeEquiCylinder(Actor* actor, struct PlayState* play, f32 radius, u32 exchangeItemId); +s32 Actor_OfferTalk(Actor* actor, struct PlayState* play, f32 radius); +s32 Actor_OfferTalkNearColChkInfoCylinder(Actor* actor, struct PlayState* play); +u32 Actor_TextboxIsClosing(Actor* actor, struct PlayState* play); +s8 func_8002F368(struct PlayState* play); +void Actor_GetScreenPos(struct PlayState* play, Actor* actor, s16* x, s16* y); +u32 Actor_HasParent(Actor* actor, struct PlayState* play); +s32 Actor_OfferGetItem(Actor* actor, struct PlayState* play, s32 getItemId, f32 xzRange, f32 yRange); +s32 Actor_OfferGetItemNearby(Actor* actor, struct PlayState* play, s32 getItemId); +s32 Actor_OfferCarry(Actor* actor, struct PlayState* play); +u32 Actor_HasNoParent(Actor* actor, struct PlayState* play); +void func_8002F5C4(Actor* actorA, Actor* actorB, struct PlayState* play); +void Actor_SetClosestSecretDistance(Actor* actor, struct PlayState* play); +s32 Actor_IsMounted(struct PlayState* play, Actor* horse); +u32 Actor_SetRideActor(struct PlayState* play, Actor* horse, s32 mountSide); +s32 Actor_NotMounted(struct PlayState* play, Actor* horse); +void Actor_SetPlayerKnockback(struct PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 type, u32 damage); +void Actor_SetPlayerKnockbackLarge(struct PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 damage); +void Actor_SetPlayerKnockbackLargeNoDamage(struct PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity); +void Actor_SetPlayerKnockbackSmall(struct PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 damage); +void Actor_SetPlayerKnockbackSmallNoDamage(struct PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity); +void Player_PlaySfx(struct Player* player, u16 sfxId); +void Actor_PlaySfx(Actor* actor, u16 sfxId); +void Actor_PlaySfx_SurfaceBomb(struct PlayState* play, Actor* actor); +void Actor_PlaySfx_Flagged2(Actor* actor, u16 sfxId); +void Actor_PlaySfx_FlaggedCentered1(Actor* actor, u16 sfxId); +void Actor_PlaySfx_FlaggedCentered2(Actor* actor, u16 sfxId); +void Actor_PlaySfx_Flagged(Actor* actor, u16 sfxId); +void Actor_PlaySfx_FlaggedTimer(Actor* actor, s32 timer); +s32 func_8002F9EC(struct PlayState* play, Actor* actor, struct CollisionPoly* poly, s32 bgId, Vec3f* pos); +void Actor_DisableLens(struct PlayState* play); +void Actor_InitContext(struct PlayState* play, ActorContext* actorCtx, struct ActorEntry* playerEntry); +void Actor_UpdateAll(struct PlayState* play, ActorContext* actorCtx); +s32 func_800314D4(struct PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3); +void func_800315AC(struct PlayState* play, ActorContext* actorCtx); +void Actor_KillAllWithMissingObject(struct PlayState* play, ActorContext* actorCtx); +void func_80031B14(struct PlayState* play, ActorContext* actorCtx); +void func_80031C3C(ActorContext* actorCtx, struct PlayState* play); +Actor* Actor_Spawn(ActorContext* actorCtx, struct PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX, + s16 rotY, s16 rotZ, s16 params); +Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, struct PlayState* play, s16 actorId, f32 posX, + f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params); +void Actor_SpawnTransitionActors(struct PlayState* play, ActorContext* actorCtx); +Actor* Actor_SpawnEntry(ActorContext* actorCtx, struct ActorEntry* actorEntry, struct PlayState* play); +Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, struct PlayState* play); +Actor* Attention_FindActor(struct PlayState* play, ActorContext* actorCtx, Actor** attentionActorP, + struct Player* player); +Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorCategory); +void Enemy_StartFinishingBlow(struct PlayState* play, Actor* actor); +void BodyBreak_Alloc(BodyBreak* bodyBreak, s32 count, struct PlayState* play); +void BodyBreak_SetInfo(BodyBreak* bodyBreak, s32 limbIndex, s32 minLimbIndex, s32 maxLimbIndex, u32 count, Gfx** dList, + s16 objectSlot); +s32 BodyBreak_SpawnParts(Actor* actor, BodyBreak* bodyBreak, struct PlayState* play, s16 type); +void Actor_SpawnFloorDustRing(struct PlayState* play, Actor* actor, Vec3f* posXZ, f32 radius, s32 amountMinusOne, + f32 randAccelWeight, s16 scale, s16 scaleStep, u8 useLighting); +void func_80033480(struct PlayState* play, Vec3f* posBase, f32 randRangeDiameter, s32 amountMinusOne, s16 scaleBase, + s16 scaleStep, u8 arg6); +Actor* Actor_GetCollidedExplosive(struct PlayState* play, Collider* collider); +Actor* func_80033684(struct PlayState* play, Actor* explosiveActor); +Actor* Actor_GetProjectileActor(struct PlayState* play, Actor* refActor, f32 radius); +void Actor_ChangeCategory(struct PlayState* play, ActorContext* actorCtx, Actor* actor, u8 actorCategory); +void Actor_SetTextWithPrefix(struct PlayState* play, Actor* actor, s16 baseTextId); +s16 Actor_TestFloorInDirection(Actor* actor, struct PlayState* play, f32 distance, s16 angle); +s32 Actor_IsLockedOn(struct PlayState* play, Actor* actor); +s32 Actor_OtherIsLockedOn(struct PlayState* play, Actor* actor); +f32 func_80033AEC(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5); +void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, struct PlayState* play); +void Actor_RequestQuake(struct PlayState* play, s16 y, s16 duration); +void Actor_RequestQuakeWithSpeed(struct PlayState* play, s16 y, s16 duration, s16 speed); +void Actor_RequestQuakeAndRumble(Actor* actor, struct PlayState* play, s16 quakeY, s16 quakeDuration); +void Actor_DrawDoorLock(struct PlayState* play, s32 frame, s32 type); +void func_8003424C(struct PlayState* play, Vec3f* arg1); +void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s16 bufFlag, s16 duration); +void func_800342EC(Vec3f* object, struct PlayState* play); +void func_8003435C(Vec3f* object, struct PlayState* play); +s32 Npc_UpdateTalking(struct PlayState* play, Actor* actor, s16* talkState, f32 interactRange, + NpcGetTextIdFunc getTextId, NpcUpdateTalkStateFunc updateTalkState); +s16 Npc_GetTrackingPresetMaxPlayerYaw(s16 presetIndex); +void Npc_TrackPoint(Actor* actor, NpcInteractInfo* interactInfo, s16 presetIndex, s16 trackingMode); +void func_80034BA0(struct PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, + PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); +void func_80034CC4(struct PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, + PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); +s16 func_80034DD4(Actor* actor, struct PlayState* play, s16 arg2, f32 arg3); +void func_80034F54(struct PlayState* play, s16* arg1, s16* arg2, s32 arg3); +void Actor_Noop(Actor* actor, struct PlayState* play); + +void Gfx_DrawDListOpa(struct PlayState* play, Gfx* dlist); +void Gfx_DrawDListXlu(struct PlayState* play, Gfx* dlist); + +Actor* Actor_FindNearby(struct PlayState* play, Actor* refActor, s16 actorId, u8 actorCategory, f32 range); +s32 func_800354B4(struct PlayState* play, Actor* actor, f32 range, s16 arg3, s16 arg4, s16 arg5); +void func_8003555C(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel); +void func_800355B8(struct PlayState* play, Vec3f* pos); +u8 func_800355E4(struct PlayState* play, Collider* collider); +u8 Actor_ApplyDamage(Actor* actor); +void Actor_SetDropFlag(Actor* actor, ColliderElement* elem, s32 freezeFlag); +void Actor_SetDropFlagJntSph(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag); +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, + struct PlayState* play, s16 params, Gfx* dList); +void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2); +s32 Flags_GetEventChkInf(s32 flag); +void Flags_SetEventChkInf(s32 flag); +s32 Flags_GetInfTable(s32 flag); +void Flags_SetInfTable(s32 flag); +u16 func_80037C30(struct PlayState* play, s16 arg1); +s32 func_80037D98(struct PlayState* play, Actor* actor, s16 arg2, s32* arg3); +s32 Actor_TrackPlayer(struct PlayState* play, Actor* actor, Vec3s* headRot, Vec3s* torsoRot, Vec3f focusPos); + #endif diff --git a/include/z64animation.h b/include/z64animation.h index 2365db14bc..17b42e1a0f 100644 --- a/include/z64animation.h +++ b/include/z64animation.h @@ -16,14 +16,14 @@ struct SkelAnime; #define LIMB_DONE 0xFF -typedef struct { +typedef struct StandardLimb { /* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent /* 0x06 */ u8 child; /* 0x07 */ u8 sibling; /* 0x08 */ Gfx* dList; } StandardLimb; // size = 0xC -typedef struct { +typedef struct LodLimb { /* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent /* 0x06 */ u8 child; /* 0x07 */ u8 sibling; @@ -31,13 +31,13 @@ typedef struct { } LodLimb; // size = 0x10 // Model has limbs with only rigid meshes -typedef struct { +typedef struct SkeletonHeader { /* 0x00 */ void** segment; /* 0x04 */ u8 limbCount; } SkeletonHeader; // size = 0x8 // Model has limbs with flexible meshes -typedef struct { +typedef struct FlexSkeletonHeader { /* 0x00 */ SkeletonHeader sh; /* 0x08 */ u8 dListCount; } FlexSkeletonHeader; // size = 0xC @@ -47,22 +47,22 @@ typedef struct { */ // Index into the frame data table. -typedef struct { +typedef struct JointIndex { /* 0x00 */ u16 x; /* 0x02 */ u16 y; /* 0x04 */ u16 z; } JointIndex; // size = 0x06 -typedef struct { +typedef struct AnimationHeaderCommon { /* 0x00 */ s16 frameCount; } AnimationHeaderCommon; -typedef struct { +typedef struct LinkAnimationHeader { /* 0x00 */ AnimationHeaderCommon common; /* 0x04 */ void* segment; } LinkAnimationHeader; // size = 0x8 -typedef struct { +typedef struct AnimationHeader { /* 0x00 */ AnimationHeaderCommon common; /* 0x04 */ s16* frameData; // "tbl" /* 0x08 */ JointIndex* jointIndices; // "ref_tbl" @@ -73,7 +73,7 @@ typedef struct { * SkelAnime */ -typedef enum { +typedef enum AnimationMode { /* 0 */ ANIMMODE_LOOP, /* 1 */ ANIMMODE_LOOP_INTERP, /* 2 */ ANIMMODE_ONCE, @@ -82,7 +82,7 @@ typedef enum { /* 5 */ ANIMMODE_LOOP_PARTIAL_INTERP } AnimationMode; -typedef enum { +typedef enum AnimationTapers { /* -1 */ ANIMTAPER_DECEL = -1, /* 0 */ ANIMTAPER_NONE, /* 1 */ ANIMTAPER_ACCEL @@ -91,14 +91,14 @@ typedef enum { // This flag seems like it was intended to be paired with `ANIM_FLAG_UPDATE_Y` to control // XZ movement based on the current animation. // However, this flag is not checked by the Skelanime system. XZ movement will always occur -// regardless of the current state of this flag, as long as the "Actor Move" Anim Task is in use. +// regardless of the current state of this flag, as long as the ActorMovement Anim Task is in use. // The name of this flag is speculative based on its usage in Player and in other actors. // // In practice, this flag only affects the scaling of Player's XZ position based on age. #define ANIM_FLAG_UPDATE_XZ (1 << 0) // Enables the movement of an actor in the Y-axis based on the current animation. -// This only has an effect if the "Actor Move" Anim Task is in use. +// This only has an effect if the ActorMovement Anim Task is in use. // // This animation-driven movement does not replace "normal" movement from other sources // such as speed/velocity and collisions. The actor should stop updating other sources of movement @@ -106,14 +106,46 @@ typedef enum { // An option is to implement and use `ANIM_FLAG_OVERRIDE_MOVEMENT`. #define ANIM_FLAG_UPDATE_Y (1 << 1) -// (player-only) Related to scaling an animation from/to child/adult -#define ANIM_FLAG_PLAYER_2 (1 << 2) - -// (player-only) Call AnimTaskQueue_AddActorMove -#define ANIM_FLAG_PLAYER_SETMOVE (1 << 3) - +// When this flag is set, Player's root limb position adjustment as child is disabled. +// Many of Player's animations are originally created for Adult Link. When playing those +// animations as Child Link without any adjustment, he will appear to be floating in the air. +// To fix this, Child Link's root position is scaled down by default to fit his smaller size. +// However, if an animation is created specifically for Child Link, it is desirable to disable +// this scaling of the root position by using this flag. +// Note that this flag will be ignored if `ANIM_FLAG_UPDATE_XZ` or `ANIM_FLAG_UPDATE_Y` are also +// set. The adjustment will be applied in this case regardless of this flag being enabled. +#define ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT (1 << 2) + +// When this flag is set, ActorMovement tasks will be queued. +// +// Note that individual actors are responsible for implementing the functionality of this flag. +// In practice, Player is the only actor who implements this flag. +// It is possible to bypass the need for this flag by manually calling `AnimTaskQueue_AddActorMovement` +// when it is needed. +#define ANIM_FLAG_ENABLE_MOVEMENT (1 << 3) + +// When this flag is set, movement in all axes will not be applied for one frame. The flag +// is unset automatically after one use, so movement can resume. The intent is for this flag to be used +// when changing between two different animations. +// In some contexts, disabling the first frame of movement is necessary for a seamless transition. +// +// Depending on specific implementations, an actor may choose to reset `prevTransl` to `baseTransl` when +// starting a new animation. This is helpful when an animation's translation data starts at the "origin" +// (in this case, the origin refers to `baseTransl`, in model space). +// Some animations have translation data that does not begin at the "origin". This is common when a +// longer sequence of animation is broken up into different parts as separate animations. +// In this case, when one animation starts its translation at the same position where a different animation +// left off, resetting `prevTransl` is not desirable. This will cause the actor's position to noticeably change +// when the translation data from the first frame of the new animation is applied. +// +// When this flag is used during a transition between two animations, the first frame of movement is not applied. +// This allows the actor's world position to stay at the same location as where the previous animation ended. +// Because translations are calculated as a difference from the current and previous frame, all subsequent +// frames have their translation occur relative to this new starting point. // -#define ANIM_FLAG_NO_MOVE (1 << 4) +// Note that for Player, this flag is only relevant when transitioning from an animation that was also using +// ActorMovement. This is because of how `prevTransl` gets reset in `Player_StartAnimMovement`. +#define ANIM_FLAG_ADJUST_STARTING_POS (1 << 4) // Disables "normal" movement from sources like speed/velocity and collisions, which allows the // animation to have full control over the actor's movement. @@ -143,7 +175,7 @@ typedef struct SkelAnime { s32 (*link)(struct PlayState*, struct SkelAnime*); // Can be Loop, Play once, or Morph } update; /* 0x34 */ s8 initFlags; // Flags used when initializing Link's skeleton - /* 0x35 */ u8 moveFlags; // Flags used for animations that move the actor in worldspace. + /* 0x35 */ u8 movementFlags; // Flags used for animations that move the actor in worldspace. /* 0x36 */ s16 prevRot; // Previous rotation in worldspace. /* 0x38 */ Vec3s prevTransl; // Previous modelspace translation. /* 0x3E */ Vec3s baseTransl; // Base modelspace translation. @@ -226,7 +258,7 @@ void Animation_EndLoop(SkelAnime* skelAnime); void Animation_Reverse(SkelAnime* skelAnime); void Animation_SetMorph(struct PlayState* play, SkelAnime* skelAnime, f32 morphFrames); -typedef struct { +typedef struct AnimationInfo { /* 0x00 */ AnimationHeader* animation; /* 0x04 */ f32 playSpeed; /* 0x08 */ f32 startFrame; @@ -237,21 +269,21 @@ typedef struct { void Animation_ChangeByInfo(SkelAnime* skelAnime, AnimationInfo* animationInfo, s32 index); -typedef struct { +typedef struct AnimationFrameCountInfo { /* 0x00 */ AnimationHeader* animation; /* 0x04 */ f32 frameCount; /* 0x08 */ u8 mode; /* 0x0C */ f32 morphFrames; } AnimationFrameCountInfo; // size = 0x10 -typedef struct { +typedef struct AnimationSpeedInfo { /* 0x00 */ AnimationHeader* animation; /* 0x04 */ f32 playSpeed; /* 0x08 */ u8 mode; /* 0x0C */ f32 morphFrames; } AnimationSpeedInfo; // size = 0x10 -typedef struct { +typedef struct AnimationMinimalInfo { /* 0x00 */ AnimationHeader* animation; /* 0x04 */ u8 mode; /* 0x08 */ f32 morphFrames; @@ -269,7 +301,7 @@ s16 Animation_GetLastFrame(void* animation); * Animation Task Queue */ -typedef enum { +typedef enum AnimTaskType { /* 0 */ ANIMTASK_LOAD_PLAYER_FRAME, /* 1 */ ANIMTASK_COPY, /* 2 */ ANIMTASK_INTERP, @@ -278,20 +310,20 @@ typedef enum { /* 5 */ ANIMTASK_ACTOR_MOVE } AnimTaskType; -typedef struct { +typedef struct AnimTaskLoadPlayerFrame { /* 0x00 */ DmaRequest req; /* 0x20 */ OSMesgQueue msgQueue; /* 0x38 */ OSMesg msg; } AnimTaskLoadPlayerFrame; // size = 0x3C -typedef struct { +typedef struct AnimTaskCopy { /* 0x00 */ u8 group; /* 0x01 */ u8 vecCount; /* 0x04 */ Vec3s* dest; /* 0x08 */ Vec3s* src; } AnimTaskCopy; // size = 0xC -typedef struct { +typedef struct AnimTaskInterp { /* 0x00 */ u8 group; /* 0x01 */ u8 vecCount; /* 0x04 */ Vec3s* base; @@ -299,7 +331,7 @@ typedef struct { /* 0x0C */ f32 weight; } AnimTaskInterp; // size = 0x10 -typedef struct { +typedef struct AnimTaskCopyUsingMap { /* 0x00 */ u8 group; /* 0x01 */ u8 vecCount; /* 0x04 */ Vec3s* dest; @@ -307,7 +339,7 @@ typedef struct { /* 0x0C */ u8* limbCopyMap; } AnimTaskCopyUsingMap; // size = 0x10 -typedef struct { +typedef struct AnimTaskCopyUsingMapInverted { /* 0x00 */ u8 group; /* 0x01 */ u8 vecCount; /* 0x04 */ Vec3s* dest; @@ -315,22 +347,22 @@ typedef struct { /* 0x0C */ u8* limbCopyMap; } AnimTaskCopyUsingMapInverted; // size = 0x10 -typedef struct { +typedef struct AnimTaskActorMovement { /* 0x00 */ struct Actor* actor; /* 0x04 */ struct SkelAnime* skelAnime; /* 0x08 */ f32 diffScaleY; -} AnimTaskActorMove; // size = 0xC +} AnimTaskActorMovement; // size = 0xC -typedef union { +typedef union AnimTaskData { AnimTaskLoadPlayerFrame loadPlayerFrame; AnimTaskCopy copy; AnimTaskInterp interp; AnimTaskCopyUsingMap copyUsingMap; AnimTaskCopyUsingMapInverted copyUsingMapInverted; - AnimTaskActorMove actorMove; + AnimTaskActorMovement actorMovement; } AnimTaskData; // size = 0x3C -typedef struct { +typedef struct AnimTask { /* 0x00 */ u8 type; /* 0x04 */ AnimTaskData data; } AnimTask; // size = 0x40 @@ -348,7 +380,7 @@ void AnimTaskQueue_AddCopy(struct PlayState* play, s32 vecCount, Vec3s* dest, Ve void AnimTaskQueue_AddInterp(struct PlayState* play, s32 vecCount, Vec3s* base, Vec3s* mod, f32 weight); void AnimTaskQueue_AddCopyUsingMap(struct PlayState* play, s32 vecCount, Vec3s* dest, Vec3s* src, u8* limbCopyMap); void AnimTaskQueue_AddCopyUsingMapInverted(struct PlayState* play, s32 vecCount, Vec3s* dest, Vec3s* src, u8* limbCopyMap); -void AnimTaskQueue_AddActorMove(struct PlayState* play, struct Actor* actor, SkelAnime* skelAnime, f32 moveDiffScaleY); +void AnimTaskQueue_AddActorMovement(struct PlayState* play, struct Actor* actor, SkelAnime* skelAnime, f32 moveDiffScaleY); void AnimTaskQueue_SetNextGroup(struct PlayState* play); void AnimTaskQueue_DisableTransformTasksForGroup(struct PlayState* play); diff --git a/include/z64animation_legacy.h b/include/z64animation_legacy.h index f4c222a5cc..066a8faa33 100644 --- a/include/z64animation_legacy.h +++ b/include/z64animation_legacy.h @@ -12,7 +12,7 @@ typedef struct LegacyLimb { /* 0x01C */ struct LegacyLimb* child; } LegacyLimb; // size = 0x20 -typedef struct { +typedef struct LegacyJointKey { /* 0x00 */ s16 xMax; /* 0x02 */ s16 x; /* 0x04 */ s16 yMax; @@ -21,7 +21,7 @@ typedef struct { /* 0x0A */ s16 z; } LegacyJointKey; // size = 0x0C -typedef struct { +typedef struct LegacyAnimationHeader { /* 0x00 */ s16 frameCount; /* 0x02 */ s16 limbCount; /* 0x04 */ s16* frameData; diff --git a/include/z64audio.h b/include/z64audio.h index c4d1d937ed..60ae4fb2a2 100644 --- a/include/z64audio.h +++ b/include/z64audio.h @@ -1,6 +1,12 @@ #ifndef Z64_AUDIO_H #define Z64_AUDIO_H +#include "ultra64.h" +#include "sequence.h" +#include "z64math.h" + +struct GfxPrint; + typedef void (*AudioCustomUpdateFunction)(void); @@ -62,14 +68,14 @@ typedef void (*AudioCustomUpdateFunction)(void); #define AUDIO_RELOCATED_ADDRESS_START K0BASE -typedef enum { +typedef enum SoundMode { /* 0 */ SOUNDMODE_STEREO, /* 1 */ SOUNDMODE_HEADSET, /* 2 */ SOUNDMODE_SURROUND, /* 3 */ SOUNDMODE_MONO } SoundMode; -typedef enum { +typedef enum AdsrStatus { /* 0 */ ADSR_STATE_DISABLED, /* 1 */ ADSR_STATE_INITIAL, /* 2 */ ADSR_STATE_START_LOOP, @@ -81,14 +87,14 @@ typedef enum { /* 8 */ ADSR_STATE_SUSTAIN } AdsrStatus; -typedef enum { +typedef enum SampleMedium { /* 0 */ MEDIUM_RAM, /* 1 */ MEDIUM_UNK, /* 2 */ MEDIUM_CART, /* 3 */ MEDIUM_DISK_DRIVE } SampleMedium; -typedef enum { +typedef enum SampleCodec { /* 0 */ CODEC_ADPCM, // 16 2-byte samples (32 bytes) compressed into 4-bit samples (8 bytes) + 1 header byte /* 1 */ CODEC_S8, // 16 2-byte samples (32 bytes) compressed into 8-bit samples (16 bytes) /* 2 */ CODEC_S16_INMEMORY, @@ -97,20 +103,28 @@ typedef enum { /* 5 */ CODEC_S16 } SampleCodec; -typedef enum { +typedef enum SampleBankTableType { /* 0 */ SEQUENCE_TABLE, /* 1 */ FONT_TABLE, /* 2 */ SAMPLE_TABLE } SampleBankTableType; -typedef enum { +typedef enum AudioCacheType { /* 0 */ CACHE_TEMPORARY, /* 1 */ CACHE_PERSISTENT, /* 2 */ CACHE_EITHER, /* 3 */ CACHE_PERMANENT } AudioCacheType; -typedef enum { +typedef enum AudioCacheLoadType { + /* 0 */ CACHE_LOAD_PERMANENT, + /* 1 */ CACHE_LOAD_PERSISTENT, + /* 2 */ CACHE_LOAD_TEMPORARY, + /* 3 */ CACHE_LOAD_EITHER, + /* 4 */ CACHE_LOAD_EITHER_NOSYNC +} AudioCacheLoadType; + +typedef enum AudioLoadStatus { /* 0 */ LOAD_STATUS_NOT_LOADED, // the entry data is not loaded /* 1 */ LOAD_STATUS_IN_PROGRESS, // the entry data is being loaded asynchronously /* 2 */ LOAD_STATUS_COMPLETE, // the entry data is loaded, it may be discarded if not stored persistently, and either no longer in use, or the memory is needed for something else @@ -154,33 +168,47 @@ typedef struct NotePool { // direction is "supported" by setting extent to be negative. The code // exterpolates exponentially in the wrong direction in that case, but that // doesn't prevent seqplayer from doing it, AFAICT. -typedef struct { +typedef struct Portamento { /* 0x00 */ u8 mode; // bit 0x80 denotes something; the rest are an index 0-5 /* 0x02 */ u16 cur; /* 0x04 */ u16 speed; /* 0x08 */ f32 extent; } Portamento; // size = 0xC -typedef struct { +typedef struct EnvelopePoint { /* 0x0 */ s16 delay; /* 0x2 */ s16 arg; } EnvelopePoint; // size = 0x4 -typedef struct { +typedef struct AdpcmLoopHeader { /* 0x00 */ u32 start; - /* 0x04 */ u32 end; - /* 0x08 */ u32 count; + /* 0x04 */ u32 end; // s16 sample position where the loop ends + /* 0x08 */ u32 count; // The number of times the loop is played before the sound completes. Setting count to -1 indicates that the loop should play indefinitely. /* 0x0C */ char unk_0C[0x4]; +} AdpcmLoopHeader; // size = 0x10 + +typedef struct AdpcmLoop { + /* 0x00 */ AdpcmLoopHeader header; /* 0x10 */ s16 predictorState[16]; // only exists if count != 0. 8-byte aligned } AdpcmLoop; // size = 0x30 (or 0x10) -typedef struct { +typedef struct AdpcmBookHeader { /* 0x00 */ s32 order; /* 0x04 */ s32 numPredictors; - /* 0x08 */ s16 book[1]; // size 8 * order * numPredictors. 8-byte aligned +} AdpcmBookHeader; // size = 0x8 + +/** + * The procedure used to design the codeBook is based on an adaptive clustering algorithm. + * The size of the codeBook is (8 * order * numPredictors) and is 8-byte aligned + */ +typedef s16 AdpcmBookData[]; + +typedef struct AdpcmBook { + /* 0x00 */ AdpcmBookHeader header; + /* 0x08 */ AdpcmBookData book; // size 8 * order * numPredictors. 8-byte aligned } AdpcmBook; // size >= 0x8 -typedef struct { +typedef struct Sample { /* 0x00 */ u32 codec : 4; // The state of compression or decompression /* 0x00 */ u32 medium : 2; // Medium where sample is currently stored /* 0x00 */ u32 unk_bit26 : 1; @@ -191,12 +219,12 @@ typedef struct { /* 0x0C */ AdpcmBook* book; // Adpcm book parameters used by the sample. Offset from the start of the sound font / pointer to ram } Sample; // size = 0x10 -typedef struct { +typedef struct TunedSample { /* 0x00 */ Sample* sample; /* 0x04 */ f32 tuning; // frequency scale factor } TunedSample; // size = 0x8 -typedef struct { +typedef struct Instrument { /* 0x00 */ u8 isRelocated; // have the envelope and all samples been relocated (offsets to pointers) /* 0x01 */ u8 normalRangeLo; /* 0x02 */ u8 normalRangeHi; @@ -207,7 +235,7 @@ typedef struct { /* 0x18 */ TunedSample highPitchTunedSample; } Instrument; // size = 0x20 -typedef struct { +typedef struct Drum { /* 0x00 */ u8 adsrDecayIndex; // index used to obtain adsr decay rate from adsrDecayTable /* 0x01 */ u8 pan; /* 0x02 */ u8 isRelocated; // have tunedSample.sample and envelope been relocated (offsets to pointers) @@ -215,14 +243,14 @@ typedef struct { /* 0x0C */ EnvelopePoint* envelope; } Drum; // size = 0x10 -typedef struct { +typedef struct SoundEffect { /* 0x00 */ TunedSample tunedSample; } SoundEffect; // size = 0x08 /** * Stores parsed information from soundfont data */ -typedef struct { +typedef struct SoundFont { /* 0x00 */ u8 numInstruments; /* 0x01 */ u8 numDrums; /* 0x02 */ u8 sampleBankId1; @@ -233,7 +261,7 @@ typedef struct { /* 0x10 */ SoundEffect* soundEffects; } SoundFont; // size = 0x14 -typedef struct { +typedef struct ReverbRingBufferItem { /* 0x00 */ s16 numSamplesAfterDownsampling; // never read /* 0x02 */ s16 chunkLen; // never read /* 0x04 */ s16* toDownsampleLeft; @@ -246,7 +274,7 @@ typedef struct { /* 0x18 */ u16 unk_18; } ReverbRingBufferItem; // size = 0x1C -typedef struct { +typedef struct SynthesisReverb { /* 0x000 */ u8 resampleFlags; /* 0x001 */ u8 useReverb; /* 0x002 */ u8 framesToIgnore; @@ -286,7 +314,7 @@ typedef struct { /* 0x298 */ AdpcmLoop loop; } SynthesisReverb; // size = 0x2C8 -typedef struct { +typedef struct SeqScriptState { /* 0x00 */ u8* pc; // program counter /* 0x04 */ u8* stack[4]; /* 0x14 */ u8 remLoopIters[4]; // remaining loop iterations @@ -295,7 +323,7 @@ typedef struct { } SeqScriptState; // size = 0x1C // Also known as a Group, according to debug strings. -typedef struct { +typedef struct SequencePlayer { /* 0x000 */ u8 enabled : 1; /* 0x000 */ u8 finished : 1; /* 0x000 */ u8 muted : 1; @@ -337,13 +365,13 @@ typedef struct { /* 0x158 */ s8 seqScriptIO[8]; } SequencePlayer; // size = 0x160 -typedef struct { +typedef struct AdsrSettings { /* 0x0 */ u8 decayIndex; // index used to obtain adsr decay rate from adsrDecayTable /* 0x1 */ u8 sustain; /* 0x4 */ EnvelopePoint* envelope; } AdsrSettings; // size = 0x8 -typedef struct { +typedef struct AdsrState { /* 0x00 */ union { struct A { /* 0x00 */ u8 unused : 1; @@ -365,7 +393,7 @@ typedef struct { /* 0x1C */ EnvelopePoint* envelope; } AdsrState; // size = 0x20 -typedef struct { +typedef struct StereoData { /* 0x00 */ u8 unused : 2; /* 0x00 */ u8 bit2 : 2; /* 0x00 */ u8 strongRight : 1; @@ -374,12 +402,12 @@ typedef struct { /* 0x00 */ u8 usesHeadsetPanEffects : 1; } StereoData; // size = 0x1 -typedef union { +typedef union Stereo { /* 0x00 */ StereoData s; /* 0x00 */ u8 asByte; } Stereo; // size = 0x1 -typedef struct { +typedef struct NoteAttributes { /* 0x00 */ u8 reverb; /* 0x01 */ u8 gain; // Increases volume by a multiplicative scaling factor. Represented as a UQ4.4 number /* 0x02 */ u8 pan; @@ -498,7 +526,7 @@ typedef struct SequenceLayer { /* 0x70 */ AudioListItem listItem; } SequenceLayer; // size = 0x80 -typedef struct { +typedef struct NoteSynthesisBuffers { /* 0x000 */ s16 adpcmdecState[16]; /* 0x020 */ s16 finalResampleState[16]; /* 0x040 */ s16 mixEnvelopeState[32]; @@ -507,7 +535,7 @@ typedef struct { /* 0x0E0 */ s16 combFilterState[128]; } NoteSynthesisBuffers; // size = 0x1E0 -typedef struct { +typedef struct NoteSynthesisState { /* 0x00 */ u8 restart; /* 0x01 */ u8 sampleDmaIndex; /* 0x02 */ u8 prevHaasEffectLeftDelaySize; @@ -524,7 +552,7 @@ typedef struct { /* 0x1C */ char unk_1C[0x4]; } NoteSynthesisState; // size = 0x20 -typedef struct { +typedef struct VibratoState { /* 0x00 */ struct SequenceChannel* channel; /* 0x04 */ u32 time; /* 0x08 */ s16* curve; // sineWave @@ -536,7 +564,7 @@ typedef struct { /* 0x1A */ u16 delay; } VibratoState; // size = 0x1C -typedef struct { +typedef struct NotePlaybackState { /* 0x00 */ u8 priority; /* 0x01 */ u8 waveId; /* 0x02 */ u8 harmonicIndex; // the harmonic index for the synthetic wave contained in gWaveSamples (also matches the base 2 logarithm of the harmonic order) @@ -555,7 +583,7 @@ typedef struct { /* 0x6C */ VibratoState vibratoState; } NotePlaybackState; // size = 0x88 -typedef struct { +typedef struct NoteSubEu { struct { /* 0x00 */ volatile u8 enabled : 1; /* 0x00 */ u8 needsInit : 1; @@ -600,7 +628,7 @@ typedef struct Note { /* 0xC0 */ NoteSubEu noteSubEu; } Note; // size = 0xE0 -typedef struct { +typedef struct ReverbSettings { /* 0x00 */ u8 downsampleRate; /* 0x02 */ u16 windowSize; /* 0x04 */ u16 decayRatio; // determines how much reverb persists @@ -619,7 +647,7 @@ typedef struct { * The high-level audio specifications requested when initializing or resetting the audio heap. * The audio heap can be reset on various occasions, including on most scene transitions. */ -typedef struct { +typedef struct AudioSpec { /* 0x00 */ u32 samplingFrequency; // Target sampling rate in Hz /* 0x04 */ u8 unk_04; /* 0x05 */ u8 numNotes; @@ -646,7 +674,7 @@ typedef struct { * digital-analog converter (DAC), then to play on the speakers. The audio buffer is written to by the rsp after * processing audio commands. This struct parameterizes that buffer. */ -typedef struct { +typedef struct AudioBufferParameters { /* 0x00 */ s16 specUnk4; /* 0x02 */ u16 samplingFrequency; // Target sampling rate in Hz /* 0x04 */ u16 aiSamplingFrequency; // True sampling rate of the audio interface (AI), see `osAiSetFrequency` @@ -667,7 +695,7 @@ typedef struct { /** * Meta-data associated with a pool (contained within the Audio Heap) */ -typedef struct { +typedef struct AudioAllocPool { /* 0x0 */ u8* startRamAddr; // start addr of the pool /* 0x4 */ u8* curRamAddr; // address of the next available memory for allocation /* 0x8 */ s32 size; // size of the pool @@ -677,7 +705,7 @@ typedef struct { /** * Audio cache entry data to store a single entry containing either a sequence, soundfont, or entire sample banks */ -typedef struct { +typedef struct AudioCacheEntry { /* 0x0 */ u8* ramAddr; /* 0x4 */ u32 size; /* 0x8 */ s16 tableType; @@ -687,7 +715,7 @@ typedef struct { /** * Audio cache entry data to store a single entry containing an individual sample */ -typedef struct { +typedef struct SampleCacheEntry { /* 0x00 */ s8 inUse; /* 0x01 */ s8 origMedium; /* 0x02 */ s8 sampleBankId; @@ -700,48 +728,48 @@ typedef struct { /** * Audio cache entry data to store individual samples */ -typedef struct { +typedef struct AudioSampleCache { /* 0x000 */ AudioAllocPool pool; /* 0x010 */ SampleCacheEntry entries[32]; /* 0x290 */ s32 numEntries; } AudioSampleCache; // size = 0x294 -typedef struct { +typedef struct AudioPersistentCache { /* 0x00*/ u32 numEntries; /* 0x04*/ AudioAllocPool pool; /* 0x14*/ AudioCacheEntry entries[16]; } AudioPersistentCache; // size = 0xD4 -typedef struct { +typedef struct AudioTemporaryCache { /* 0x00*/ u32 nextSide; /* 0x04*/ AudioAllocPool pool; /* 0x14*/ AudioCacheEntry entries[2]; } AudioTemporaryCache; // size = 0x3C -typedef struct { +typedef struct AudioCache { /* 0x000*/ AudioPersistentCache persistent; /* 0x0D4*/ AudioTemporaryCache temporary; /* 0x100*/ u8 unk_100[0x10]; } AudioCache; // size = 0x110 -typedef struct { +typedef struct AudioCachePoolSplit { /* 0x0 */ u32 persistentCommonPoolSize; /* 0x4 */ u32 temporaryCommonPoolSize; } AudioCachePoolSplit; // size = 0x8 -typedef struct { +typedef struct AudioCommonPoolSplit { /* 0x0 */ u32 seqCacheSize; /* 0x4 */ u32 fontCacheSize; /* 0x8 */ u32 sampleBankCacheSize; } AudioCommonPoolSplit; // size = 0xC -typedef struct { +typedef struct AudioSessionPoolSplit { /* 0x0 */ u32 miscPoolSize; /* 0x4 */ u32 unkSizes[2]; /* 0xC */ u32 cachePoolSize; } AudioSessionPoolSplit; // size = 0x10 -typedef struct { +typedef struct AudioPreloadReq { /* 0x00 */ u32 endAndMediumKey; /* 0x04 */ Sample* sample; /* 0x08 */ u8* ramAddr; @@ -752,7 +780,7 @@ typedef struct { /** * Audio commands used to transfer audio requests from the graph thread to the audio thread */ -typedef struct { +typedef struct AudioCmd { /* 0x0 */ union{ u32 opArgs; struct { @@ -773,7 +801,7 @@ typedef struct { }; } AudioCmd; // size = 0x8 -typedef struct { +typedef struct AudioAsyncLoad { /* 0x00 */ s8 status; /* 0x01 */ s8 delay; /* 0x02 */ s8 medium; @@ -790,7 +818,7 @@ typedef struct { /* 0x40 */ OSIoMesg ioMesg; } AudioAsyncLoad; // size = 0x58 -typedef struct { +typedef struct AudioSlowLoad { /* 0x00 */ u8 medium; /* 0x01 */ u8 seqOrFontId; /* 0x02 */ u16 instId; @@ -807,7 +835,14 @@ typedef struct { /* 0x4C */ OSIoMesg ioMesg; } AudioSlowLoad; // size = 0x64 -typedef struct { +typedef struct AudioTableHeader { + /* 0x00 */ s16 numEntries; + /* 0x02 */ s16 unkMediumParam; + /* 0x04 */ uintptr_t romAddr; + /* 0x08 */ char pad[0x8]; +} AudioTableHeader; // size = 0x10 + +typedef struct AudioTableEntry { /* 0x00 */ u32 romAddr; /* 0x04 */ u32 size; /* 0x08 */ s8 medium; @@ -817,15 +852,12 @@ typedef struct { /* 0x0E */ s16 shortData3; } AudioTableEntry; // size = 0x10 -typedef struct { - /* 0x00 */ s16 numEntries; - /* 0x02 */ s16 unkMediumParam; - /* 0x04 */ u32 romAddr; - /* 0x08 */ char pad[0x8]; +typedef struct AudioTable { + /* 0x00 */ AudioTableHeader header; /* 0x10 */ AudioTableEntry entries[1]; // (dynamic size) } AudioTable; // size >= 0x20 -typedef struct { +typedef struct SampleDma { /* 0x00 */ u8* ramAddr; /* 0x04 */ u32 devAddr; /* 0x08 */ u16 sizeUnused; @@ -835,14 +867,14 @@ typedef struct { /* 0x0E */ u8 ttl; // duration after which the DMA can be discarded } SampleDma; // size = 0x10 -typedef struct { +typedef struct AudioTask { /* 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 AudioContext { /* 0x0000 */ char unk_0000; /* 0x0001 */ s8 numSynthesisReverbs; /* 0x0002 */ u16 unk_2; // reads from audio spec unk_14, never used, always set to 0x7FFF @@ -968,7 +1000,7 @@ typedef struct { /* 0x5C50 */ AudioCmd threadCmdBuf[0x100]; // Audio thread commands used to transfer audio requests from the graph thread to the audio thread } AudioContext; // size = 0x6450 -typedef struct { +typedef struct NoteSubAttributes { /* 0x00 */ u8 reverbVol; /* 0x01 */ u8 gain; // Increases volume by a multiplicative scaling factor. Represented as a UQ4.4 number /* 0x02 */ u8 pan; @@ -981,15 +1013,207 @@ typedef struct { /* 0x16 */ u16 combFilterGain; } NoteSubAttributes; // size = 0x18 -typedef struct { +typedef struct TempoData { /* 0x0 */ s16 unk_00; // set to 0x1C00, unused /* 0x2 */ s16 seqTicksPerBeat; } TempoData; // size = 0x4 -typedef struct { +typedef struct AudioHeapInitSizes { /* 0x00 */ u32 heapSize; // total number of bytes allocated to the audio heap. Must be <= the size of `gAudioHeap` (ideally about the same size) /* 0x04 */ u32 initPoolSize; // The entire audio heap is split into two pools. /* 0x08 */ u32 permanentPoolSize; } AudioHeapInitSizes; // size = 0xC +// TODO these prototypes should be sorted into the relevant audio header files + +Acmd* AudioSynth_Update(Acmd* cmdStart, s32* cmdCnt, s16* aiStart, s32 aiBufLen); +void AudioHeap_DiscardFont(s32 fontId); +void AudioHeap_ReleaseNotesForFont(s32 fontId); +void AudioHeap_DiscardSequence(s32 seqId); +void AudioHeap_WritebackDCache(void* ramAddr, u32 size); +void* AudioHeap_AllocZeroedAttemptExternal(AudioAllocPool* pool, u32 size); +void* AudioHeap_AllocAttemptExternal(AudioAllocPool* pool, u32 size); +void* AudioHeap_AllocDmaMemory(AudioAllocPool* pool, u32 size); +void* AudioHeap_AllocDmaMemoryZeroed(AudioAllocPool* pool, u32 size); +void* AudioHeap_AllocZeroed(AudioAllocPool* pool, u32 size); +void* AudioHeap_Alloc(AudioAllocPool* pool, u32 size); +void AudioHeap_InitPool(AudioAllocPool* pool, void* ramAddr, u32 size); +void AudioHeap_PopPersistentCache(s32 tableType); +void AudioHeap_InitMainPools(s32 initPoolSize); +void* AudioHeap_AllocCached(s32 tableType, s32 size, s32 cache, s32 id); +void* AudioHeap_SearchCaches(s32 tableType, s32 cache, s32 id); +void* AudioHeap_SearchRegularCaches(s32 tableType, s32 cache, s32 id); +void AudioHeap_LoadFilter(s16* filter, s32 lowPassCutoff, s32 highPassCutoff); +s32 AudioHeap_ResetStep(void); +void AudioHeap_Init(void); +void* AudioHeap_SearchPermanentCache(s32 tableType, s32 id); +void* AudioHeap_AllocPermanent(s32 tableType, s32 id, u32 size); +void* AudioHeap_AllocSampleCache(u32 size, s32 fontId, void* sampleAddr, s8 medium, s32 cache); +void AudioHeap_ApplySampleBankCache(s32 sampleBankId); +void AudioLoad_DecreaseSampleDmaTtls(void); +void* AudioLoad_DmaSampleData(u32 devAddr, u32 size, s32 arg2, u8* dmaIndexRef, s32 medium); +void AudioLoad_InitSampleDmaBuffers(s32 numNotes); +s32 AudioLoad_IsFontLoadComplete(s32 fontId); +s32 AudioLoad_IsSeqLoadComplete(s32 seqId); +void AudioLoad_SetFontLoadStatus(s32 fontId, s32 loadStatus); +void AudioLoad_SetSeqLoadStatus(s32 seqId, s32 loadStatus); +void AudioLoad_SyncLoadSeqParts(s32 seqId, s32 arg1); +s32 AudioLoad_SyncLoadInstrument(s32 fontId, s32 instId, s32 drumId); +void AudioLoad_AsyncLoadSeq(s32 seqId, s32 arg1, s32 retData, OSMesgQueue* retQueue); +void AudioLoad_AsyncLoadSampleBank(s32 sampleBankId, s32 arg1, s32 retData, OSMesgQueue* retQueue); +void AudioLoad_AsyncLoadFont(s32 fontId, s32 arg1, s32 retData, OSMesgQueue* retQueue); +u8* AudioLoad_GetFontsForSequence(s32 seqId, u32* outNumFonts); +void AudioLoad_DiscardSeqFonts(s32 seqId); +s32 AudioLoad_SyncInitSeqPlayer(s32 playerIdx, s32 seqId, s32 arg2); +s32 AudioLoad_SyncInitSeqPlayerSkipTicks(s32 playerIdx, s32 seqId, s32 skipTicks); +void AudioLoad_ProcessLoads(s32 resetStatus); +void AudioLoad_SetDmaHandler(DmaHandler callback); +void AudioLoad_Init(void* heap, u32 heapSize); +void AudioLoad_InitSlowLoads(void); +s32 AudioLoad_SlowLoadSample(s32 fontId, s32 instId, s8* status); +s32 AudioLoad_SlowLoadSeq(s32 seqId, u8* ramAddr, s8* status); +void AudioLoad_InitAsyncLoads(void); +void AudioLoad_LoadPermanentSamples(void); +void AudioLoad_ScriptLoad(s32 tableType, s32 id, s8* status); +void AudioLoad_ProcessScriptLoads(void); +void AudioLoad_InitScriptLoads(void); + +AudioTask* AudioThread_Update(void); +void AudioThread_QueueCmdF32(u32 opArgs, f32 data); +void AudioThread_QueueCmdS32(u32 opArgs, s32 data); +void AudioThread_QueueCmdS8(u32 opArgs, s8 data); +void AudioThread_QueueCmdU16(u32 opArgs, u16 data); +s32 AudioThread_ScheduleProcessCmds(void); +u32 func_800E5E20(u32* out); +u8* AudioThread_GetFontsForSequence(s32 seqId, u32* outNumFonts); +s32 func_800E5EDC(void); +s32 AudioThread_ResetAudioHeap(s32 specId); +void AudioThread_PreNMIInternal(void); +s32 func_800E6680(void); +u32 AudioThread_NextRandom(void); +void AudioThread_InitMesgQueues(void); + +void Audio_InvalDCache(void* buf, s32 size); +void Audio_WritebackDCache(void* buf, s32 size); +s32 osAiSetNextBuffer(void*, u32); +void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs); +void Audio_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput); +void Audio_NoteInit(Note* note); +void Audio_NoteDisable(Note* note); +void Audio_ProcessNotes(void); +TunedSample* Audio_GetInstrumentTunedSample(Instrument* instrument, s32 semitone); +Instrument* Audio_GetInstrumentInner(s32 fontId, s32 instId); +Drum* Audio_GetDrum(s32 fontId, s32 drumId); +SoundEffect* Audio_GetSoundEffect(s32 fontId, s32 sfxId); +s32 Audio_SetFontInstrument(s32 instrumentType, s32 fontId, s32 index, void* value); +void Audio_SeqLayerDecayRelease(SequenceLayer* layer, s32 target); +void Audio_SeqLayerNoteDecay(SequenceLayer* layer); +void Audio_SeqLayerNoteRelease(SequenceLayer* layer); +s32 Audio_BuildSyntheticWave(Note* note, SequenceLayer* layer, s32 waveId); +void Audio_InitSyntheticWave(Note* note, SequenceLayer* layer); +void Audio_InitNoteList(AudioListItem* list); +void Audio_InitNoteLists(NotePool* pool); +void Audio_InitNoteFreeList(void); +void Audio_NotePoolClear(NotePool* pool); +void Audio_NotePoolFill(NotePool* pool, s32 count); +void Audio_AudioListPushFront(AudioListItem* list, AudioListItem* item); +void Audio_AudioListRemove(AudioListItem* item); +Note* Audio_FindNodeWithPrioLessThan(AudioListItem* list, s32 limit); +void Audio_NoteInitForLayer(Note* note, SequenceLayer* layer); +void func_800E82C0(Note* note, SequenceLayer* layer); +void Audio_NoteReleaseAndTakeOwnership(Note* note, SequenceLayer* layer); +Note* Audio_AllocNoteFromDisabled(NotePool* pool, SequenceLayer* layer); +Note* Audio_AllocNoteFromDecaying(NotePool* pool, SequenceLayer* layer); +Note* Audio_AllocNoteFromActive(NotePool* pool, SequenceLayer* layer); +Note* Audio_AllocNote(SequenceLayer* layer); +void Audio_NoteInitAll(void); +void Audio_SequenceChannelProcessSound(SequenceChannel* channel, s32 recalculateVolume, s32 applyBend); +void Audio_SequencePlayerProcessSound(SequencePlayer* seqPlayer); +f32 Audio_GetPortamentoFreqScale(Portamento* portamento); +s16 Audio_GetVibratoPitchChange(VibratoState* vib); +f32 Audio_GetVibratoFreqScale(VibratoState* vib); +void Audio_NoteVibratoUpdate(Note* note); +void Audio_NoteVibratoInit(Note* note); +void Audio_NotePortamentoInit(Note* note); +void Audio_AdsrInit(AdsrState* adsr, EnvelopePoint* envelope, s16* volOut); +f32 Audio_AdsrUpdate(AdsrState* adsr); +void AudioSeq_SequenceChannelDisable(SequenceChannel* channel); +void AudioSeq_SequencePlayerDisableAsFinished(SequencePlayer* seqPlayer); +void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer); +void AudioSeq_AudioListPushBack(AudioListItem* list, AudioListItem* item); +void* AudioSeq_AudioListPopBack(AudioListItem* list); +void AudioSeq_ProcessSequences(s32 arg0); +void AudioSeq_SkipForwardSequence(SequencePlayer* seqPlayer); +void AudioSeq_ResetSequencePlayer(SequencePlayer* seqPlayer); +void AudioSeq_InitSequencePlayerChannels(s32 playerIdx); +void AudioSeq_InitSequencePlayers(void); + +void AudioDebug_Draw(struct GfxPrint* printer); +void AudioDebug_ScrPrt(const char* str, u16 num); +void Audio_Update(void); +void Audio_SetSfxProperties(u8 bankId, u8 entryIdx, u8 channelIndex); +void Audio_PlayCutsceneEffectsSequence(u8 csEffectType); +void func_800F4010(Vec3f* pos, u16 sfxId, f32); +void Audio_PlaySfxRandom(Vec3f* pos, u16 baseSfxId, u8 randLim); +void func_800F4138(Vec3f* pos, u16 sfxId, f32); +void func_800F4190(Vec3f* pos, u16 sfxId); +void func_800F436C(Vec3f* pos, u16 sfxId, f32 arg2); +void func_800F4414(Vec3f* pos, u16 sfxId, f32); +void func_800F44EC(s8 arg0, s8 arg1); +void func_800F4524(Vec3f* pos, u16 sfxId, s8 arg2); +void func_800F4254(Vec3f* pos, u8 level); +void Audio_PlaySfxRiver(Vec3f* pos, f32 freqScale); +void Audio_PlaySfxWaterfall(Vec3f* pos, f32 freqScale); +void Audio_SetBgmVolumeOffDuringFanfare(void); +void Audio_SetBgmVolumeOnDuringFanfare(void); +void Audio_SetMainBgmVolume(u8 targetVol, u8 volFadeTimer); +void Audio_SetGanonsTowerBgmVolumeLevel(u8 ganonsTowerLevel); +void Audio_LowerMainBgmVolume(u8 volume); +void Audio_PlaySfxIncreasinglyTransposed(Vec3f* pos, s16 sfxId, u8* semitones); +void Audio_ResetIncreasingTranspose(void); +void Audio_PlaySfxTransposed(Vec3f* pos, u16 sfxId, s8 semitone); +void func_800F4C58(Vec3f* pos, u16 sfxId, u8); +void func_800F4E30(Vec3f* pos, f32); +void Audio_ClearSariaBgm(void); +void Audio_ClearSariaBgmAtPos(Vec3f* pos); +void Audio_PlaySariaBgm(Vec3f* pos, u16 seqId, u16 distMax); +void Audio_ClearSariaBgm2(void); +void Audio_PlayMorningSceneSequence(u16 seqId); +void Audio_PlaySceneSequence(u16 seqId); +void Audio_SetMainBgmTempoFreqAfterFanfare(f32 scaleTempoAndFreq, u8 duration); +void Audio_PlayWindmillBgm(void); +void Audio_SetFastTempoForTimedMinigame(void); +void Audio_PlaySequenceInCutscene(u16 seqId); +void Audio_StopSequenceInCutscene(u16 seqId); +s32 Audio_IsSequencePlaying(u16 seqId); +void func_800F5ACC(u16 seqId); +void func_800F5B58(void); +void func_800F5BF0(u8 natureAmbienceId); +void Audio_PlayFanfare(u16); +void func_800F5C2C(void); +void Audio_PlaySequenceWithSeqPlayerIO(u8 seqPlayerIndex, u16 seqId, u8 fadeInDuration, s8 ioPort, s8 ioData); +void Audio_SetSequenceMode(u8 seqMode); +void Audio_SetBgmEnemyVolume(f32 dist); +void Audio_UpdateMalonSinging(f32 dist, u16 seqId); +void func_800F64E0(u8 arg0); +void Audio_ToggleMalonSinging(u8 malonSingingDisabled); +void Audio_SetEnvReverb(s8 reverb); +void Audio_SetCodeReverb(s8 reverb); +void func_800F6700(s8 audioSetting); +void Audio_SetBaseFilter(u8); +void Audio_SetExtraFilter(u8); +void Audio_SetCutsceneFlag(s8 flag); +void Audio_PlaySfxIfNotInCutscene(u16 sfxId); +void func_800F6964(u16); +void Audio_StopBgmAndFanfare(u16 fadeOutDuration); +void func_800F6B3C(void); +void func_800F6BDC(void); +void Audio_PreNMI(void); +void Audio_SetNatureAmbienceChannelIO(u8 channelIdxRange, u8 ioPort, u8 ioData); +void Audio_PlayNatureAmbienceSequence(u8 natureAmbienceId); +void Audio_Init(void); +void Audio_InitSound(void); +void func_800F7170(void); +void func_800F71BC(s32 arg0); + #endif diff --git a/include/z64bgcheck.h b/include/z64bgcheck.h index a1017ddc71..1164abadbd 100644 --- a/include/z64bgcheck.h +++ b/include/z64bgcheck.h @@ -23,7 +23,7 @@ struct DynaPolyActor; #define FUNC_80041EA4_STOP 8 #define FUNC_80041EA4_VOID_OUT 12 -typedef struct { +typedef struct ScaleRotPos { /* 0x00 */ Vec3f scale; /* 0x0C */ Vec3s rot; /* 0x14 */ Vec3f pos; @@ -66,7 +66,7 @@ typedef struct CollisionPoly { /* 0x0E */ s16 dist; // Plane distance from origin along the normal } CollisionPoly; // size = 0x10 -typedef struct { +typedef struct BgCamInfo { /* 0x0 */ u16 setting; // camera setting described by CameraSettingType enum /* 0x2 */ s16 count; // only used when `bgCamFuncData` is a list of points used for crawlspaces /* 0x4 */ Vec3s* bgCamFuncData; // s16 data grouped in threes (ex. Vec3s), is usually of type `BgCamFuncData`, but can be a list of points of type `Vec3s` for crawlspaces @@ -74,7 +74,7 @@ typedef struct { // The structure used for all instances of s16 data from `BgCamInfo` with the exception of crawlspaces. // See `Camera_Subj4` for Vec3s data usage in crawlspaces -typedef struct { +typedef struct BgCamFuncData { /* 0x00 */ Vec3s pos; /* 0x06 */ Vec3s rot; /* 0x0C */ s16 fov; @@ -101,7 +101,7 @@ typedef struct { (((room) & 0x3F) << 13) | \ (((setFlag19) & 1) << 19)) -typedef struct { +typedef struct WaterBox { /* 0x00 */ s16 xMin; /* 0x02 */ s16 ySurface; /* 0x04 */ s16 zMin; @@ -110,7 +110,7 @@ typedef struct { /* 0x0C */ u32 properties; } WaterBox; // size = 0x10 -typedef enum { +typedef enum FloorType { /* 0 */ FLOOR_TYPE_0, /* 1 */ FLOOR_TYPE_1, /* 2 */ FLOOR_TYPE_2, @@ -126,7 +126,7 @@ typedef enum { /* 12 */ FLOOR_TYPE_12 } FloorType; -typedef enum { +typedef enum WallType { /* 0 */ WALL_TYPE_0, /* 1 */ WALL_TYPE_1, /* 2 */ WALL_TYPE_2, @@ -152,7 +152,7 @@ typedef enum { #define WALL_FLAG_6 (1 << 6) #define WALL_FLAG_CRAWLSPACE (WALL_FLAG_CRAWLSPACE_1 | WALL_FLAG_CRAWLSPACE_2) -typedef enum { +typedef enum FloorProperty { /* 0 */ FLOOR_PROPERTY_0, /* 5 */ FLOOR_PROPERTY_5 = 5, /* 6 */ FLOOR_PROPERTY_6, @@ -163,7 +163,7 @@ typedef enum { /* 12 */ FLOOR_PROPERTY_12 } FloorProperty; -typedef enum { +typedef enum SurfaceSfxOffset { /* 0 */ SURFACE_SFX_OFFSET_DIRT, /* 1 */ SURFACE_SFX_OFFSET_SAND, /* 2 */ SURFACE_SFX_OFFSET_STONE, @@ -182,7 +182,7 @@ typedef enum { /* 15 */ SURFACE_SFX_OFFSET_ICE } SurfaceSfxOffset; -typedef enum { +typedef enum SurfaceMaterial { /* 0 */ SURFACE_MATERIAL_DIRT, /* 1 */ SURFACE_MATERIAL_SAND, /* 2 */ SURFACE_MATERIAL_STONE, @@ -200,13 +200,13 @@ typedef enum { /* 14 */ SURFACE_MATERIAL_MAX } SurfaceMaterial; -typedef enum { +typedef enum FloorEffect { /* 0 */ FLOOR_EFFECT_0, /* 1 */ FLOOR_EFFECT_1, /* 2 */ FLOOR_EFFECT_2 } FloorEffect; -typedef enum { +typedef enum ConveyorSpeed { /* 0 */ CONVEYOR_SPEED_DISABLED, /* 1 */ CONVEYOR_SPEED_SLOW, /* 2 */ CONVEYOR_SPEED_MEDIUM, @@ -237,11 +237,11 @@ typedef enum { (((conveyorDirection) & 0x3F) << 21) | \ (((unk27) & 1) << 27)) -typedef struct { +typedef struct SurfaceType { u32 data[2]; } SurfaceType; -typedef struct { +typedef struct CollisionHeader { /* 0x00 */ Vec3s minBounds; // minimum coordinates of poly bounding box /* 0x06 */ Vec3s maxBounds; // maximum coordinates of poly bounding box /* 0x0C */ u16 numVertices; @@ -254,41 +254,41 @@ typedef struct { /* 0x28 */ WaterBox* waterBoxes; } CollisionHeader; // original name: BGDataInfo -typedef struct { +typedef struct SSNode { s16 polyId; u16 next; // next SSNode index } SSNode; -typedef struct { +typedef struct SSList { u16 head; // first SSNode index } SSList; -typedef struct { +typedef struct SSNodeList { /* 0x00 */ u16 max; // original name: short_slist_node_size /* 0x02 */ u16 count; // original name: short_slist_node_last_index /* 0x04 */ SSNode* tbl; // original name: short_slist_node_tbl } SSNodeList; -typedef struct { +typedef struct DynaSSNodeList { SSNode* tbl; s32 count; s32 max; } DynaSSNodeList; -typedef struct { +typedef struct StaticLookup { SSList floor; SSList wall; SSList ceiling; } StaticLookup; -typedef struct { +typedef struct DynaLookup { u16 polyStartIndex; SSList ceiling; SSList wall; SSList floor; } DynaLookup; -typedef struct { +typedef struct BgActor { /* 0x00 */ struct Actor* actor; /* 0x04 */ CollisionHeader* colHeader; /* 0x08 */ DynaLookup dynaLookup; @@ -305,7 +305,7 @@ typedef struct { #define BGACTOR_COLLISION_DISABLED (1 << 2) // The collision of the bgActor is disabled #define BGACTOR_CEILING_COLLISION_DISABLED (1 << 3) // The ceilings in the collision of the bgActor are ignored -typedef struct { +typedef struct DynaCollisionContext { /* 0x0000 */ u8 bitFlag; /* 0x0004 */ BgActor bgActors[BG_ACTOR_MAX]; /* 0x138C */ u16 bgActorFlags[BG_ACTOR_MAX]; @@ -330,7 +330,7 @@ typedef struct CollisionContext { /* 0x1460 */ u32 memSize; // Size of all allocated memory plus CollisionContext } CollisionContext; // size = 0x1464 -typedef struct { +typedef struct DynaRaycastDown { /* 0x00 */ struct PlayState* play; /* 0x04 */ struct CollisionContext* colCtx; /* 0x08 */ u16 xpFlags; @@ -345,7 +345,7 @@ typedef struct { /* 0x2C */ SSList* ssList; } DynaRaycastDown; -typedef struct { +typedef struct DynaLineTest { /* 0x00 */ struct CollisionContext* colCtx; /* 0x04 */ u16 xpFlags; /* 0x08 */ DynaCollisionContext* dyna; @@ -359,4 +359,131 @@ typedef struct { /* 0x28 */ f32 chkDist; // distance from poly } DynaLineTest; +void func_80038A28(CollisionPoly* poly, f32 tx, f32 ty, f32 tz, MtxF* dest); +f32 CollisionPoly_GetPointDistanceFromPlane(CollisionPoly* poly, Vec3f* point); +void CollisionPoly_GetVerticesByBgId(CollisionPoly* poly, s32 bgId, CollisionContext* colCtx, Vec3f* dest); +void BgCheck_Allocate(CollisionContext* colCtx, struct PlayState* play, CollisionHeader* colHeader); +f32 BgCheck_EntityRaycastDown1(CollisionContext* colCtx, CollisionPoly** outGroundPoly, Vec3f* pos); +f32 BgCheck_EntityRaycastDown2(struct PlayState* play, CollisionContext* colCtx, CollisionPoly** outGroundPoly, + Vec3f* pos); +f32 BgCheck_EntityRaycastDown3(CollisionContext* colCtx, CollisionPoly** outGroundPoly, s32* bgId, Vec3f* pos); +f32 BgCheck_EntityRaycastDown4(CollisionContext* colCtx, CollisionPoly** outGroundPoly, s32* bgId, struct Actor* actor, + Vec3f* pos); +f32 BgCheck_EntityRaycastDown5(struct PlayState* play, CollisionContext* colCtx, CollisionPoly** outGroundPoly, + s32* bgId, struct Actor* actor, Vec3f* pos); +f32 BgCheck_EntityRaycastDown6(CollisionContext* colCtx, CollisionPoly** outGroundPoly, s32* bgId, struct Actor* actor, + Vec3f* pos, f32 chkDist); +f32 BgCheck_EntityRaycastDown7(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, struct Actor* actor, + Vec3f* pos); +f32 BgCheck_AnyRaycastDown1(CollisionContext* colCtx, CollisionPoly* outGroundPoly, Vec3f* pos); +f32 BgCheck_AnyRaycastDown2(CollisionContext* colCtx, CollisionPoly* outGroundPoly, s32* bgId, Vec3f* pos); +f32 BgCheck_CameraRaycastDown2(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Vec3f* pos); +f32 BgCheck_EntityRaycastDownWalls(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, struct Actor* actor, + Vec3f* pos); +f32 BgCheck_EntityRaycastDown9(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Vec3f* pos); +s32 BgCheck_EntitySphVsWall1(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, + CollisionPoly** outPoly, f32 checkHeight); +s32 BgCheck_EntitySphVsWall2(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, + CollisionPoly** outPoly, s32* outBgId, f32 checkHeight); +s32 BgCheck_EntitySphVsWall3(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, + CollisionPoly** outPoly, s32* outBgId, struct Actor* actor, f32 checkHeight); +s32 BgCheck_EntitySphVsWall4(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, + CollisionPoly** outPoly, s32* outBgId, struct Actor* actor, f32 checkHeight); +s32 BgCheck_AnyCheckCeiling(CollisionContext* colCtx, f32* outY, Vec3f* pos, f32 checkHeight); +s32 BgCheck_EntityCheckCeiling(CollisionContext* colCtx, f32* outY, Vec3f* pos, f32 checkHeight, + CollisionPoly** outPoly, s32* outBgId, struct Actor* actor); +s32 BgCheck_CameraLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); +s32 BgCheck_CameraLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); +s32 BgCheck_EntityLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); +s32 BgCheck_EntityLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId, + struct Actor* actor); +s32 BgCheck_EntityLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId, + struct Actor* actor, f32 chkDist); +s32 BgCheck_ProjectileLineTest(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, + s32* bgId); +s32 BgCheck_AnyLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, + s32 chkOneFace); +s32 BgCheck_AnyLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, + s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace); +s32 BgCheck_AnyLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, + s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); +s32 BgCheck_SphVsFirstPoly(CollisionContext* colCtx, Vec3f* center, f32 radius); +s32 DynaPoly_IsBgIdBgActor(s32 bgId); +void DynaPoly_DisableCollision(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId); +void DynaPoly_EnableCollision(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId); +void DynaPoly_DisableCeilingCollision(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId); +s32 DynaPoly_SetBgActor(struct PlayState* play, DynaCollisionContext* dyna, struct Actor* actor, + CollisionHeader* colHeader); +struct DynaPolyActor* DynaPoly_GetActor(CollisionContext* colCtx, s32 bgId); +void DynaPoly_DeleteBgActor(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId); +void DynaPoly_InvalidateLookup(struct PlayState* play, DynaCollisionContext* dyna); +void DynaPoly_UnsetAllInteractFlags(struct PlayState* play, DynaCollisionContext* dyna, struct Actor* actor); +void DynaPoly_UpdateContext(struct PlayState* play, DynaCollisionContext* dyna); +void DynaPoly_UpdateBgActorTransforms(struct PlayState* play, DynaCollisionContext* dyna); +void CollisionHeader_GetVirtual(void* colHeader, CollisionHeader** dest); +void func_800418D0(CollisionContext* colCtx, struct PlayState* play); +u32 SurfaceType_GetBgCamIndex(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u16 BgCheck_GetBgCamSettingImpl(CollisionContext* colCtx, u32 bgCamIndex, s32 bgId); +u16 BgCheck_GetBgCamSetting(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u16 BgCheck_GetBgCamCount(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +Vec3s* BgCheck_GetBgCamFuncDataImpl(CollisionContext* colCtx, s32 bgCamIndex, s32 bgId); +Vec3s* BgCheck_GetBgCamFuncData(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 SurfaceType_GetExitIndex(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 SurfaceType_GetFloorType(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 func_80041D70(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +s32 SurfaceType_GetWallFlags(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +s32 SurfaceType_CheckWallFlag0(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +s32 SurfaceType_CheckWallFlag1(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +s32 SurfaceType_CheckWallFlag2(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 SurfaceType_GetFloorProperty(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 SurfaceType_IsSoft(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 SurfaceType_IsHorseBlocked(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 SurfaceType_GetMaterial(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u16 SurfaceType_GetSfxOffset(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 SurfaceType_GetFloorEffect(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 SurfaceType_GetLightSetting(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 SurfaceType_GetEcho(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 SurfaceType_CanHookshot(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +s32 SurfaceType_IsIgnoredByEntities(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +s32 SurfaceType_IsIgnoredByProjectiles(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +s32 SurfaceType_IsFloorConveyor(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 SurfaceType_GetConveyorSpeed(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 SurfaceType_GetConveyorDirection(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 func_80042108(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +s32 WaterBox_GetSurface1(struct PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, + WaterBox** outWaterBox); +s32 WaterBox_GetSurface2(struct PlayState* play, CollisionContext* colCtx, Vec3f* pos, f32 surfaceChkDist, + WaterBox** outWaterBox); +s32 WaterBox_GetSurfaceImpl(struct PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, + WaterBox** outWaterBox); +u32 WaterBox_GetBgCamIndex(CollisionContext* colCtx, WaterBox* waterBox); +u16 WaterBox_GetBgCamSetting(CollisionContext* colCtx, WaterBox* waterBox); +u32 WaterBox_GetLightIndex(CollisionContext* colCtx, WaterBox* waterBox); +s32 func_80042708(CollisionPoly* polyA, CollisionPoly* polyB, Vec3f* point, Vec3f* closestPoint); +s32 func_800427B4(CollisionPoly* polyA, CollisionPoly* polyB, Vec3f* pointA, Vec3f* pointB, Vec3f* closestPoint); +#if IS_DEBUG +void BgCheck_DrawDynaCollision(struct PlayState*, CollisionContext*); +void BgCheck_DrawStaticCollision(struct PlayState*, CollisionContext*); +#endif + +void func_80043334(CollisionContext* colCtx, struct Actor* actor, s32 bgId); +s32 DynaPolyActor_TransformCarriedActor(CollisionContext* colCtx, s32 bgId, struct Actor* carriedActor); +void DynaPolyActor_Init(struct DynaPolyActor* dynaActor, s32 transformFlags); +void DynaPolyActor_UnsetAllInteractFlags(struct DynaPolyActor* dynaActor); +void DynaPolyActor_SetActorOnTop(struct DynaPolyActor* dynaActor); +void DynaPoly_SetPlayerOnTop(CollisionContext* colCtx, s32 floorBgId); +void DynaPoly_SetPlayerAbove(CollisionContext* colCtx, s32 floorBgId); +void func_80043538(struct DynaPolyActor* dynaActor); +s32 DynaPolyActor_IsActorOnTop(struct DynaPolyActor* dynaActor); +s32 DynaPolyActor_IsPlayerOnTop(struct DynaPolyActor* dynaActor); +s32 DynaPolyActor_IsPlayerAbove(struct DynaPolyActor* dynaActor); +s32 func_800435B4(struct DynaPolyActor* dynaActor); +s32 func_800435D8(struct PlayState* play, struct DynaPolyActor* dynaActor, s16 arg2, s16 arg3, s16 arg4); + #endif diff --git a/include/z64camera.h b/include/z64camera.h index ab729b0830..41f22aec7c 100644 --- a/include/z64camera.h +++ b/include/z64camera.h @@ -8,6 +8,9 @@ #include "config.h" +struct CollisionContext; +struct View; + #define CAM_STAT_CUT 0 #define CAM_STAT_WAIT 1 #define CAM_STAT_UNK3 3 @@ -100,7 +103,7 @@ #define CAM_STATE_CHECK_BG (1 << 2) // Must be set for the camera to change settings based on the bg surface #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_CAM_FUNC_FINISH (1 << 4) // Signal from camera to player that the cam-update function is finished its primary purpose -#define CAM_STATE_LOCK_MODE (1 << 5) // Prevents camera from changing mode, unless overriden by `forceModeChange` passed to `Camera_RequestModeImpl` +#define CAM_STATE_LOCK_MODE (1 << 5) // Prevents camera from changing mode, unless overridden by `forceModeChange` passed to `Camera_RequestModeImpl` #define CAM_STATE_DISTORTION (1 << 6) // Set when camera distortion is on #define CAM_STATE_PLAY_INIT (1 << 7) // Set in Play_Init, never used or changed #define CAM_STATE_CAMERA_IN_WATER (1 << 8) // Camera (eye) is underwater @@ -135,7 +138,7 @@ struct Actor; struct CollisionPoly; -typedef enum { +typedef enum CameraSettingType { /* 0x00 */ CAM_SET_NONE, /* 0x01 */ CAM_SET_NORMAL0, /* 0x02 */ CAM_SET_NORMAL1, @@ -205,7 +208,7 @@ typedef enum { /* 0x42 */ CAM_SET_MAX } CameraSettingType; -typedef enum { +typedef enum CameraModeType { /* 0x00 */ CAM_MODE_NORMAL, /* 0x01 */ CAM_MODE_Z_PARALLEL, // Holding Z but with no target, keeps the camera aligned /* 0x02 */ CAM_MODE_Z_TARGET_FRIENDLY, @@ -230,7 +233,7 @@ typedef enum { /* 0x15 */ CAM_MODE_MAX } CameraModeType; -typedef enum { +typedef enum CameraFuncType { /* 0x00 */ CAM_FUNC_NONE, /* 0x01 */ CAM_FUNC_NORM0, /* 0x02 */ CAM_FUNC_NORM1, @@ -305,7 +308,7 @@ typedef enum { /* 0x47 */ CAM_FUNC_MAX } CameraFuncType; -typedef enum { +typedef enum CameraDataType { /* 0x00 */ CAM_DATA_Y_OFFSET, /* 0x01 */ CAM_DATA_EYE_DIST, /* 0x02 */ CAM_DATA_EYE_DIST_NEXT, @@ -339,7 +342,7 @@ typedef enum { #define CAM_FUNCDATA_INTERFACE_FIELD(interfaceField) \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct SwingAnimation { /* 0x00 */ Vec3f collisionClosePoint; /* 0x0C */ struct CollisionPoly* atEyePoly; /* 0x10 */ f32 swingUpdateRate; @@ -349,7 +352,7 @@ typedef struct { /* 0x1A */ s16 swingUpdateRateTimer; } SwingAnimation; // size = 0x1C -typedef struct { +typedef struct Normal1ReadOnlyData { /* 0x00 */ f32 yOffset; /* 0x04 */ f32 distMin; /* 0x08 */ f32 distMax; @@ -362,7 +365,7 @@ typedef struct { /* 0x22 */ s16 interfaceField; } Normal1ReadOnlyData; // size = 0x24 -typedef struct { +typedef struct Normal1ReadWriteData { /* 0x00 */ SwingAnimation swing; /* 0x1C */ f32 yOffset; /* 0x20 */ f32 unk_20; @@ -372,7 +375,7 @@ typedef struct { /* 0x2A */ s16 startSwingTimer; } Normal1ReadWriteData; // size = 0x2C -typedef struct { +typedef struct Normal1 { /* 0x00 */ Normal1ReadOnlyData roData; /* 0x24 */ Normal1ReadWriteData rwData; } Normal1; // size = 0x50 @@ -408,7 +411,7 @@ typedef struct { { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Normal2ReadOnlyData { /* 0x00 */ f32 unk_00; /* 0x04 */ f32 unk_04; /* 0x08 */ f32 unk_08; @@ -420,7 +423,7 @@ typedef struct { /* 0x1E */ s16 interfaceField; } Normal2ReadOnlyData; // size = 0x20 -typedef struct { +typedef struct Normal2ReadWriteData { /* 0x00 */ Vec3f unk_00; /* 0x0C */ Vec3f unk_0C; /* 0x18 */ f32 unk_18; @@ -431,7 +434,7 @@ typedef struct { /* 0x28 */ s16 unk_28; } Normal2ReadWriteData; // size = 0x2C -typedef struct { +typedef struct Normal2 { /* 0x00 */ Normal2ReadOnlyData roData; /* 0x20 */ Normal2ReadWriteData rwData; } Normal2; // size = 0x4C @@ -452,7 +455,7 @@ typedef struct { { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Normal3ReadOnlyData { /* 0x00 */ f32 yOffset; /* 0x04 */ f32 distMin; /* 0x08 */ f32 distMax; @@ -464,7 +467,7 @@ typedef struct { /* 0x1E */ s16 interfaceField; } Normal3ReadOnlyData; // size = 0x20 -typedef struct { +typedef struct Normal3ReadWriteData { /* 0x00 */ SwingAnimation swing; /* 0x1C */ f32 unk_1C; /* 0x20 */ f32 unk_20; @@ -474,7 +477,7 @@ typedef struct { /* 0x2A */ s16 distTimer; } Normal3ReadWriteData; // size = 0x2C -typedef struct { +typedef struct Normal3 { /* 0x00 */ Normal3ReadOnlyData roData; /* 0x20 */ Normal3ReadWriteData rwData; } Normal3; // size = 0x4C @@ -490,7 +493,7 @@ typedef struct { { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Parallel1ReadOnlyData { /* 0x00 */ f32 yOffset; /* 0x04 */ f32 distTarget; /* 0x08 */ f32 unk_08; @@ -504,7 +507,7 @@ typedef struct { /* 0x24 */ s16 interfaceField; } Parallel1ReadOnlyData; // size = 0x28 -typedef struct { +typedef struct Parallel1ReadWriteData { /* 0x00 */ Vec3f unk_00; /* 0x0C */ f32 yTarget; /* 0x10 */ s16 unk_10; @@ -514,7 +517,7 @@ typedef struct { /* 0x18 */ s16 animTimer; } Parallel1ReadWriteData; // size = 0x1C -typedef struct { +typedef struct Parallel1 { /* 0x00 */ Parallel1ReadOnlyData roData; /* 0x28 */ Parallel1ReadWriteData rwData; } Parallel1; // size = 0x44 @@ -544,7 +547,7 @@ typedef struct { #define PARALLEL3_FLAG_0 (1 << 0) #define PARALLEL3_FLAG_1 (1 << 1) -typedef struct { +typedef struct Jump1ReadOnlyData { /* 0x00 */ f32 atYOffset; /* 0x04 */ f32 distMin; /* 0x08 */ f32 distMax; @@ -555,7 +558,7 @@ typedef struct { /* 0x1C */ s16 interfaceField; } Jump1ReadOnlyData; // size = 0x20 -typedef struct { +typedef struct Jump1ReadWriteData { /* 0x00 */ SwingAnimation swing; /* 0x1C */ f32 unk_1C; /* 0x20 */ f32 unk_20; @@ -563,7 +566,7 @@ typedef struct { /* 0x26 */ s16 unk_26; } Jump1ReadWriteData; // size = 0x28 -typedef struct { +typedef struct Jump1 { /* 0x00 */ Jump1ReadOnlyData roData; /* 0x20 */ Jump1ReadWriteData rwData; } Jump1; // size = 0x48 @@ -581,7 +584,7 @@ typedef struct { { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Jump2ReadOnlyData { /* 0x00 */ f32 atYOffset; /* 0x04 */ f32 minDist; /* 0x08 */ f32 maxDist; @@ -593,7 +596,7 @@ typedef struct { /* 0x20 */ s16 interfaceField; } Jump2ReadOnlyData; // size = 0x24 -typedef struct { +typedef struct Jump2ReadWriteData { /* 0x0 */ f32 floorY; /* 0x4 */ s16 yawTarget; /* 0x6 */ s16 initYawDiff; // unused, set but not read. @@ -602,7 +605,7 @@ typedef struct { /* 0xC */ s16 animTimer; } Jump2ReadWriteData; // size = 0x10 -typedef struct { +typedef struct Jump2 { /* 0x00 */ Jump2ReadOnlyData roData; /* 0x24 */ Jump2ReadWriteData rwData; } Jump2; // size = 0x34 @@ -621,7 +624,7 @@ typedef struct { { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Jump3ReadOnlyData { /* 0x00 */ f32 yOffset; /* 0x04 */ f32 distMin; /* 0x08 */ f32 distMax; @@ -634,14 +637,14 @@ typedef struct { /* 0x22 */ s16 interfaceField; } Jump3ReadOnlyData; // size = 0x24 -typedef struct { +typedef struct Jump3ReadWriteData { /* 0x00 */ SwingAnimation swing; /* 0x1C */ f32 unk_1C; /* 0x20 */ s16 animTimer; /* 0x22 */ s16 mode; } Jump3ReadWriteData; // size = 0x24 -typedef struct { +typedef struct Jump3 { /* 0x00 */ Jump3ReadOnlyData roData; /* 0x24 */ Jump3ReadWriteData rwData; } Jump3; // size = 0x48 @@ -662,7 +665,7 @@ typedef struct { { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Battle1ReadOnlyData { /* 0x00 */ f32 yOffset; /* 0x04 */ f32 distance; /* 0x08 */ f32 swingYawInitial; @@ -677,7 +680,7 @@ typedef struct { /* 0x2C */ s16 interfaceField; } Battle1ReadOnlyData; // size = 0x30 -typedef struct { +typedef struct Battle1ReadWriteData { /* 0x00 */ f32 initialEyeToAtDist; /* 0x04 */ f32 roll; /* 0x08 */ f32 yPosOffset; @@ -690,7 +693,7 @@ typedef struct { /* 0x1C */ s16 chargeTimer; } Battle1ReadWriteData; // size = 0x20 -typedef struct { +typedef struct Battle1 { /* 0x00 */ Battle1ReadOnlyData roData; /* 0x30 */ Battle1ReadWriteData rwData; } Battle1; // size = 0x50 @@ -713,7 +716,7 @@ typedef struct { { groundYOffset, CAM_DATA_GROUND_Y_OFFSET }, \ { groundAtLerpStepScale, CAM_DATA_GROUND_AT_LERP_STEP_SCALE } -typedef struct { +typedef struct Battle4ReadOnlyData { /* 0x00 */ f32 yOffset; /* 0x04 */ f32 rTarget; /* 0x08 */ s16 pitchTarget; @@ -724,11 +727,11 @@ typedef struct { /* 0x1A */ s16 unk_1A; } Battle4ReadOnlyData; // size = 0x1C -typedef struct { +typedef struct Battle4ReadWriteData { /* 0x0 */ s16 animTimer; } Battle4ReadWriteData; // size = 0x4 -typedef struct { +typedef struct Battle4 { /* 0x00 */ Battle4ReadOnlyData roData; /* 0x1C */ Battle4ReadWriteData rwData; } Battle4; // size = 0x20 @@ -742,7 +745,7 @@ typedef struct { { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct KeepOn1ReadOnlyData { /* 0x00 */ f32 unk_00; /* 0x04 */ f32 unk_04; /* 0x08 */ f32 unk_08; @@ -758,7 +761,7 @@ typedef struct { /* 0x30 */ s16 interfaceField; } KeepOn1ReadOnlyData; // size = 0x34 -typedef struct { +typedef struct KeepOn1ReadWriteData { /* 0x00 */ f32 unk_00; /* 0x04 */ f32 unk_04; /* 0x08 */ f32 unk_08; @@ -769,7 +772,7 @@ typedef struct { /* 0x16 */ s16 unk_16; } KeepOn1ReadWriteData; // size = 0x18 -typedef struct { +typedef struct KeepOn1 { /* 0x00 */ KeepOn1ReadOnlyData roData; /* 0x34 */ KeepOn1ReadWriteData rwData; } KeepOn1; // size = 0x4C @@ -792,11 +795,11 @@ typedef struct { { groundYOffset, CAM_DATA_GROUND_Y_OFFSET }, \ { groundAtLerpStepScale, CAM_DATA_GROUND_AT_LERP_STEP_SCALE } -typedef struct { +typedef struct KeepOn3ReadOnlyData { /* 0x00 */ f32 yOffset; /* 0x04 */ f32 minDist; /* 0x08 */ f32 maxDist; - /* 0x0C */ f32 swingYawInital; + /* 0x0C */ f32 swingYawInitial; /* 0x10 */ f32 swingYawFinal; /* 0x14 */ f32 swingPitchInitial; /* 0x18 */ f32 swingPitchFinal; @@ -807,7 +810,7 @@ typedef struct { /* 0x2A */ s16 interfaceField; } KeepOn3ReadOnlyData; // size = 0x2C -typedef struct { +typedef struct KeepOn3ReadWriteData { /* 0x00 */ f32 eyeToAtTargetR; /* 0x08 */ f32 eyeToAtTargetYaw; /* 0x04 */ f32 eyeToAtTargetPitch; @@ -816,7 +819,7 @@ typedef struct { /* 0x1C */ s16 animTimer; } KeepOn3ReadWriteData; // size = 0x20 -typedef struct { +typedef struct KeepOn3 { /* 0x00 */ KeepOn3ReadOnlyData roData; /* 0x2C */ KeepOn3ReadWriteData rwData; } KeepOn3; // size = 0x4C @@ -839,7 +842,7 @@ typedef struct { { yawUpdateRateTarget, CAM_DATA_YAW_UPDATE_RATE_TARGET }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct KeepOn4ReadOnlyData { /* 0x00 */ f32 unk_00; /* 0x04 */ f32 unk_04; /* 0x08 */ f32 unk_08; @@ -851,7 +854,7 @@ typedef struct { /* 0x1E */ s16 unk_1E; } KeepOn4ReadOnlyData; // size = 0x20 -typedef struct { +typedef struct KeepOn4ReadWriteData { /* 0x00 */ f32 unk_00; /* 0x04 */ f32 unk_04; /* 0x08 */ f32 unk_08; @@ -862,7 +865,7 @@ typedef struct { /* 0x14 */ s16 unk_14; } KeepOn4ReadWriteData; // size = 0x18 -typedef struct { +typedef struct KeepOn4 { /* 0x00 */ KeepOn4ReadOnlyData roData; /* 0x20 */ KeepOn4ReadWriteData rwData; } KeepOn4; // size = 0x38 @@ -887,19 +890,19 @@ typedef struct { { yawUpdateRateTarget, CAM_DATA_YAW_UPDATE_RATE_TARGET }, \ { unk_22, CAM_DATA_UNK_22 } -typedef struct { +typedef struct KeepOn0ReadOnlyData { /* 0x00 */ f32 fovScale; /* 0x04 */ f32 yawScale; /* 0x08 */ s16 timerInit; /* 0x0A */ s16 interfaceField; } KeepOn0ReadOnlyData; // size = 0x0C -typedef struct { +typedef struct KeepOn0ReadWriteData { /* 0x0 */ f32 fovTarget; /* 0x4 */ s16 animTimer; } KeepOn0ReadWriteData; // size = 0x8 -typedef struct { +typedef struct KeepOn0 { /* 0x00 */ KeepOn0ReadOnlyData roData; /* 0x0C */ KeepOn0ReadWriteData rwData; } KeepOn0; // size = 0x14 @@ -910,19 +913,19 @@ typedef struct { { yawUpdateRateTarget, CAM_DATA_YAW_UPDATE_RATE_TARGET }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Fixed1ReadOnlyData { /* 0x00 */ f32 unk_00; // seems to be unused? /* 0x04 */ f32 lerpStep; /* 0x08 */ f32 fov; /* 0x0C */ s16 interfaceField; } Fixed1ReadOnlyData; // size = 0x10 -typedef struct { +typedef struct Fixed1ReadWriteData { /* 0x00 */ PosRot eyePosRotTarget; /* 0x14 */ s16 fov; } Fixed1ReadWriteData; // size = 0x18 -typedef struct { +typedef struct Fixed1 { /* 0x00 */ Fixed1ReadOnlyData roData; /* 0x10 */ Fixed1ReadWriteData rwData; } Fixed1; // size = 0x28 @@ -933,7 +936,7 @@ typedef struct { { fov, CAM_DATA_FOV }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Fixed2ReadOnlyData { /* 0x00 */ f32 yOffset; /* 0x04 */ f32 eyeStepScale; /* 0x08 */ f32 posStepScale; @@ -941,12 +944,12 @@ typedef struct { /* 0x10 */ s16 interfaceField; } Fixed2ReadOnlyData; // size = 0x14 -typedef struct { +typedef struct Fixed2ReadWriteData { /* 0x0 */ Vec3f eye; /* 0xC */ s16 fov; } Fixed2ReadWriteData; // size = 0x10 -typedef struct { +typedef struct Fixed2 { /* 0x00 */ Fixed2ReadOnlyData roData; /* 0x14 */ Fixed2ReadWriteData rwData; } Fixed2; // size = 0x24 @@ -961,23 +964,23 @@ typedef struct { { fov, CAM_DATA_FOV }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Fixed3ReadOnlyData { /* 0x0 */ s16 interfaceField; } Fixed3ReadOnlyData; // size = 0x4 -typedef struct { +typedef struct Fixed3ReadWriteData { /* 0x0 */ Vec3s rot; /* 0x6 */ s16 fov; /* 0x8 */ s16 updDirTimer; /* 0xA */ s16 roomImageOverrideBgCamIndex; } Fixed3ReadWriteData; // size = 0xC -typedef struct { +typedef struct Fixed3 { /* 0x0 */ Fixed3ReadOnlyData roData; /* 0x4 */ Fixed3ReadWriteData rwData; } Fixed3; // size = 0x10 -typedef struct { +typedef struct Fixed4ReadOnlyData { /* 0x00 */ f32 yOffset; /* 0x04 */ f32 speedToEyePos; /* 0x08 */ f32 followSpeed; @@ -985,12 +988,12 @@ typedef struct { /* 0x10 */ s16 interfaceField; } Fixed4ReadOnlyData; // size = 0x14 -typedef struct { +typedef struct Fixed4ReadWriteData { /* 0x0 */ Vec3f eyeTarget; /* 0xC */ f32 followSpeed; } Fixed4ReadWriteData; // size = 0x10 -typedef struct { +typedef struct Fixed4 { /* 0x00 */ Fixed4ReadOnlyData roData; /* 0x14 */ Fixed4ReadWriteData rwData; } Fixed4; // size = 0x24 @@ -1004,7 +1007,7 @@ typedef struct { { fov, CAM_DATA_FOV }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Subj3ReadOnlyData { /* 0x00 */ f32 eyeNextYOffset; /* 0x04 */ f32 eyeDist; /* 0x08 */ f32 eyeNextDist; @@ -1014,14 +1017,14 @@ typedef struct { /* 0x20 */ s16 interfaceField; } Subj3ReadOnlyData; // size = 0x24 -typedef struct { +typedef struct Subj3ReadWriteData { /* 0x0 */ f32 r; /* 0x4 */ s16 yaw; /* 0x6 */ s16 pitch; /* 0x8 */ s16 animTimer; } Subj3ReadWriteData; // size = 0xC -typedef struct { +typedef struct Subj3 { /* 0x00 */ Subj3ReadOnlyData roData; /* 0x24 */ Subj3ReadWriteData rwData; } Subj3; // size = 0x30 @@ -1037,11 +1040,11 @@ typedef struct { { fov, CAM_DATA_FOV }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Subj4ReadOnlyData { /* 0x0 */ s16 interfaceField; } Subj4ReadOnlyData; // size = 0x4 -typedef struct { +typedef struct Subj4ReadWriteData { /* 0x00 */ InfiniteLine crawlspaceLine; /* 0x18 */ Vec3f unk_18; // unused /* 0x24 */ f32 xzSpeed; @@ -1052,7 +1055,7 @@ typedef struct { /* 0x32 */ s16 zoomTimer; } Subj4ReadWriteData; // size = 0x34 -typedef struct { +typedef struct Subj4 { /* 0x00 */ Subj4ReadOnlyData roData; /* 0x04 */ Subj4ReadWriteData rwData; } Subj4; // size = 0x38 @@ -1065,20 +1068,20 @@ typedef struct { { fov, CAM_DATA_FOV }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Data4ReadOnlyData { /* 0x0 */ f32 yOffset; /* 0x4 */ f32 fov; /* 0x8 */ s16 interfaceField; } Data4ReadOnlyData; // size = 0xC -typedef struct { +typedef struct Data4ReadWriteData { /* 0x00 */ PosRot eyePosRot; /* 0x14 */ char unk_14[0x8]; /* 0x1C */ s16 fov; /* 0x1E */ s16 flags; } Data4ReadWriteData; // size = 0x20 -typedef struct { +typedef struct Data4 { /* 0x00 */ Data4ReadOnlyData roData; /* 0x0C */ Data4ReadWriteData rwData; } Data4; // size = 0x2C @@ -1088,7 +1091,7 @@ typedef struct { { fov, CAM_DATA_FOV }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Unique1ReadOnlyData { /* 0x00 */ f32 yOffset; /* 0x04 */ f32 distMin; /* 0x08 */ f32 distMax; @@ -1099,14 +1102,14 @@ typedef struct { /* 0x1A */ s16 interfaceField; } Unique1ReadOnlyData; // size = 0x1C -typedef struct { +typedef struct Unique1ReadWriteData { /* 0x0 */ f32 unk_00; // unused /* 0x4 */ s16 yawTarget; /* 0x6 */ s16 yawTargetAdj; /* 0x8 */ s16 timer; } Unique1ReadWriteData; // size = 0xC -typedef struct { +typedef struct Unique1 { /* 0x00 */ Unique1ReadOnlyData roData; /* 0x1C */ Unique1ReadWriteData rwData; } Unique1; // size = 0x28 @@ -1120,19 +1123,19 @@ typedef struct { { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Unique2ReadOnlyData { /* 0x00 */ f32 yOffset; /* 0x04 */ f32 distTarget; /* 0x08 */ f32 fovTarget; /* 0x0C */ s16 interfaceField; } Unique2ReadOnlyData; // size = 0x10 -typedef struct { +typedef struct Unique2ReadWriteData { /* 0x0 */ f32 unk_00; /* 0x4 */ s16 unk_04; } Unique2ReadWriteData; // size = 0x8 -typedef struct { +typedef struct Unique2 { /* 0x00 */ Unique2ReadOnlyData roData; /* 0x10 */ Unique2ReadWriteData rwData; } Unique2; // size = 0x18 @@ -1147,7 +1150,7 @@ typedef struct { { fov, CAM_DATA_FOV }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct DoorParams { /* 0x0 */ struct Actor* doorActor; /* 0x4 */ s16 bgCamIndex; /* 0x6 */ s16 timer1; @@ -1155,18 +1158,18 @@ typedef struct { /* 0xA */ s16 timer3; } DoorParams; // size = 0xC -typedef struct { +typedef struct Unique3ReadOnlyData { /* 0x0 */ f32 yOffset; /* 0x4 */ f32 fov; /* 0x8 */ s16 interfaceField; } Unique3ReadOnlyData; // size = 0xC -typedef struct { +typedef struct Unique3ReadWriteData { /* 0x0 */ f32 initialFov; /* 0x4 */ f32 initialDist; } Unique3ReadWriteData; // size = 0x8 -typedef struct { +typedef struct Unique3 { /* 0x00 */ Unique3ReadOnlyData roData; /* 0x0C */ Unique3ReadWriteData rwData; } Unique3; // size = 0x14 @@ -1179,44 +1182,44 @@ typedef struct { { fov, CAM_DATA_FOV }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Unique0ReadOnlyData { /* 0x0 */ s16 interfaceField; } Unique0ReadOnlyData; // size = 0x4 -typedef struct { - /* 0x00 */ Vec3f initalPos; +typedef struct Unique0ReadWriteData { + /* 0x00 */ Vec3f initialPos; /* 0x0C */ s16 animTimer; /* 0x10 */ InfiniteLine eyeAndDirection; } Unique0ReadWriteData; // size = 0x28 -typedef struct { +typedef struct Unique0 { /* 0x00 */ Unique0ReadOnlyData roData; /* 0x04 */ Unique0ReadWriteData rwData; } Unique0; // size = 0x2C #define UNIQUE0_FLAG_0 (1 << 0) -typedef struct { +typedef struct Unique6ReadOnlyData { /* 0x0 */ s16 interfaceField; } Unique6ReadOnlyData; // size = 0x4 -typedef struct { +typedef struct Unique6 { /* 0x0 */ Unique6ReadOnlyData roData; } Unique6; // size = 0x4 #define UNIQUE6_FLAG_0 (1 << 0) -typedef struct { +typedef struct Unique7ReadOnlyData { /* 0x0 */ f32 fov; /* 0x4 */ s16 interfaceField; /* 0x6 */ s16 align; } Unique7ReadOnlyData; // size = 0x8 -typedef struct { +typedef struct Unique7ReadWriteData { /* 0x0 */ Vec3s unk_00; } Unique7ReadWriteData; // size = 0x8 -typedef struct { +typedef struct Unique7 { /* 0x00 */ Unique7ReadOnlyData roData; /* 0x08 */ Unique7ReadWriteData rwData; } Unique7; // size = 0x10 @@ -1225,7 +1228,7 @@ typedef struct { { fov, CAM_DATA_FOV }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef enum { +typedef enum OnePointCsAction { /* 0x1 */ ONEPOINT_CS_ACTION_ID_1 = 1, /* 0x2 */ ONEPOINT_CS_ACTION_ID_2, /* 0x3 */ ONEPOINT_CS_ACTION_ID_3, @@ -1274,7 +1277,7 @@ typedef enum { * 0x10: ? unused * 0x20: focus on player */ -typedef struct { +typedef struct OnePointCsFull { /* 0x00 */ u8 actionFlags; /* 0x01 */ u8 initField; /* 0x02 */ s16 viewFlags; @@ -1286,16 +1289,16 @@ typedef struct { /* 0x1C */ Vec3f eyeTargetInit; } OnePointCsFull; // size = 0x28 -typedef struct { +typedef struct OnePointCsInfo { /* 0x0 */ s32 keyFrameCount; /* 0x4 */ OnePointCsFull* keyFrames; } OnePointCsInfo; // size = 0x8 -typedef struct { +typedef struct Unique9ReadOnlyData { /* 0x0 */ s16 interfaceField; } Unique9ReadOnlyData; // size = 0x40 -typedef struct { +typedef struct Unique9ReadWriteData { /* 0x00 */ OnePointCsFull* curKeyFrame; /* 0x04 */ Vec3f atTarget; /* 0x10 */ Vec3f eyeTarget; @@ -1309,40 +1312,40 @@ typedef struct { /* 0x3C */ s16 keyFrameTimer; } Unique9ReadWriteData; // size = 0x40 -typedef struct { +typedef struct Unique9 { /* 0x00 */ OnePointCsInfo csInfo; /* 0x08 */ Unique9ReadOnlyData roData; /* 0x0C */ Unique9ReadWriteData rwData; } Unique9; // size = 0x4C -typedef struct { +typedef struct Demo1ReadOnlyData { /* 0x0 */ s16 interfaceField; } Demo1ReadOnlyData; // size = 0x4 -typedef struct { +typedef struct Demo1ReadWriteData { /* 0x0 */ f32 curFrame; /* 0x4 */ s16 keyframe; } Demo1ReadWriteData; // size = 0x14 -typedef struct { +typedef struct Demo1 { /* 0x00 */ Demo1ReadOnlyData roData; /* 0x04 */ Demo1ReadWriteData rwData; } Demo1; // size = 0x18 -typedef struct { +typedef struct Demo3ReadOnlyData { /* 0x0 */ f32 fov; /* 0x4 */ f32 unk_04; // unused /* 0x8 */ s16 interfaceField; } Demo3ReadOnlyData; // size = 0xC -typedef struct { +typedef struct Demo3ReadWriteData { /* 0x00 */ Vec3f initialAt; /* 0x0C */ f32 unk_0C; /* 0x10 */ s16 animFrame; /* 0x12 */ s16 yawDir; } Demo3ReadWriteData; // size = 0x14 -typedef struct { +typedef struct Demo3 { /* 0x00 */ Demo3ReadOnlyData roData; /* 0x0C */ Demo3ReadWriteData rwData; } Demo3; // size = 0x20 @@ -1352,33 +1355,33 @@ typedef struct { { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Demo6ReadOnlyData { /* 0x0 */ s16 interfaceField; /* 0x2 */ s16 unk_02; } Demo6ReadOnlyData; // size = 0x4 -typedef struct { +typedef struct Demo6ReadWriteData { /* 0x0 */ s16 animTimer; /* 0x4 */ Vec3f atTarget; } Demo6ReadWriteData; // size = 0x10 -typedef struct { +typedef struct Demo6 { /* 0x00 */ Demo6ReadOnlyData roData; /* 0x04 */ Demo6ReadWriteData rwData; } Demo6; // size = 0x14 -typedef struct { +typedef struct OnePointCamData { /* 0x0 */ CutsceneCameraPoint* atPoints; /* 0x4 */ CutsceneCameraPoint* eyePoints; /* 0x8 */ s16 actionParameters; /* 0xA */ s16 initTimer; } OnePointCamData; // size = 0xC -typedef struct { +typedef struct Demo9ReadOnlyData { /* 0x0 */ s16 interfaceField; } Demo9ReadOnlyData; // size = 0x4 -typedef struct { +typedef struct Demo9ReadWriteData { /* 0x0 */ f32 curFrame; /* 0x4 */ s16 keyframe; /* 0x6 */ s16 doLERPAt; @@ -1386,7 +1389,7 @@ typedef struct { /* 0xA */ s16 animTimer; } Demo9ReadWriteData; // size = 0xC -typedef struct { +typedef struct Demo9 { /* 0x00 */ OnePointCamData onePointCamData; /* 0x0C */ Demo9ReadOnlyData roData; /* 0x10 */ Demo9ReadWriteData rwData; @@ -1395,12 +1398,12 @@ typedef struct { #define DEMO9_FLAG_1 (1 << 1) #define DEMO9_FLAG_4 (1 << 4) -typedef struct { +typedef struct Special0ReadOnlyData { /* 0x0 */ f32 lerpAtScale; /* 0x4 */ s16 interfaceField; } Special0ReadOnlyData; // size = 0x8 -typedef struct { +typedef struct Special0 { /* 0x0 */ Special0ReadOnlyData roData; } Special0; // size = 0x8 @@ -1408,15 +1411,15 @@ typedef struct { { yawUpdateRateTarget, CAM_DATA_YAW_UPDATE_RATE_TARGET }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { - /* 0x0 */ s16 initalTimer; +typedef struct Special4ReadWriteData { + /* 0x0 */ s16 initialTimer; } Special4ReadWriteData; // size = 0x4 -typedef struct { +typedef struct Special4 { /* 0x0 */ Special4ReadWriteData rwData; } Special4; // size = 0x4 -typedef struct { +typedef struct Special5ReadOnlyData { /* 0x00 */ f32 yOffset; /* 0x04 */ f32 eyeDist; /* 0x08 */ f32 minDistForRot; @@ -1428,11 +1431,11 @@ typedef struct { /* 0x1A */ s16 unk_1A; } Special5ReadOnlyData; // size = 0x1C -typedef struct { +typedef struct Special5ReadWriteData { /* 0x0 */ s16 animTimer; } Special5ReadWriteData; // size = 0x4 -typedef struct { +typedef struct Special5 { /* 0x00 */ Special5ReadOnlyData roData; /* 0x1C */ Special5ReadWriteData rwData; } Special5; // size = 0x20 @@ -1458,40 +1461,40 @@ typedef struct { { unk_22, CAM_DATA_UNK_22 }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef struct { +typedef struct Special7ReadWriteData { /* 0x0 */ s16 index; // See `CamElevatorPlatform` } Special7ReadWriteData; // size = 0x4 -typedef struct { +typedef struct Special7 { /* 0x0 */ Special7ReadWriteData rwData; } Special7; // size = 0x4 -typedef struct { +typedef struct Special6ReadOnlyData { /* 0x0 */ s16 interfaceField; } Special6ReadOnlyData; // size = 0x4 -typedef struct { - /* 0x0 */ f32 initalPlayerY; +typedef struct Special6ReadWriteData { + /* 0x0 */ f32 initialPlayerY; /* 0x4 */ s16 animTimer; } Special6ReadWriteData; // size = 0x8 -typedef struct { +typedef struct Special6 { /* 0x0 */ Special6ReadOnlyData roData; /* 0x4 */ Special6ReadWriteData rwData; } Special6; // size = 0xC -typedef struct { +typedef struct Special9ReadOnlyData { /* 0x0 */ f32 yOffset; /* 0x4 */ f32 unk_04; /* 0x8 */ s16 interfaceField; /* 0xA */ s16 unk_0A; } Special9ReadOnlyData; // size = 0xC -typedef struct { +typedef struct Special9ReadWriteData { /* 0x0 */ s16 targetYaw; } Special9ReadWriteData; // size = 0x4 -typedef struct { +typedef struct Special9 { /* 0x00 */ Special9ReadOnlyData roData; /* 0x0C */ Special9ReadWriteData rwData; } Special9; // size = 0x10 @@ -1505,7 +1508,7 @@ typedef struct { { fov, CAM_DATA_FOV }, \ { interfaceField, CAM_DATA_INTERFACE_FIELD } -typedef union { +typedef union CamParamData { Normal1 norm1; Normal2 norm2; Normal3 norm3; @@ -1550,7 +1553,7 @@ typedef union { }; } CamParamData; // size = 0x50 -typedef struct { +typedef struct CamColChk { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f norm; /* 0x18 */ struct CollisionPoly* poly; @@ -1627,7 +1630,7 @@ typedef struct Camera { * Debug Camera */ -typedef struct { +typedef struct DebugCamSub { /* 0x0000 */ s16 mode; /* 0x0002 */ s16 nFrames; /* 0x0004 */ s16 nPoints; @@ -1644,7 +1647,7 @@ typedef struct { /* 0x104A */ Vec3s unk_104A; } DebugCamSub; // size = 0x1050 -typedef struct { +typedef struct DebugCam { /* 0x00 */ s32 unk_00; /* 0x04 */ Vec3f at; /* 0x10 */ Vec3f eye; @@ -1667,7 +1670,7 @@ typedef struct { /* 0x7C */ DebugCamSub sub; } DebugCam; // size = 0x10CC -typedef struct { +typedef struct DebugCamCut { /* 0x00 */ char letter; /* 0x01 */ u8 unk_01; /* 0x02 */ s16 mode; @@ -1677,7 +1680,7 @@ typedef struct { /* 0x0E */ s16 nPoints; } DebugCamCut; // size = 0x10 -typedef struct { +typedef struct DebugCamAnim { /* 0x00 */ f32 curFrame; /* 0x04 */ f32 unk_04; // frame count? /* 0x08 */ s16 keyframe; @@ -1689,7 +1692,7 @@ typedef struct { /* 0x2C */ f32 fov; } DebugCamAnim; // size = 0x30 -typedef enum { +typedef enum DebugCamTextColor { /* 0 */ DEBUG_CAM_TEXT_YELLOW, /* 1 */ DEBUG_CAM_TEXT_PEACH, /* 2 */ DEBUG_CAM_TEXT_BROWN, @@ -1700,4 +1703,34 @@ typedef enum { /* 7 */ DEBUG_CAM_TEXT_GREEN } DebugCamTextColor; +void Camera_Init(Camera* camera, struct View* view, struct CollisionContext* colCtx, struct PlayState* play); +void Camera_InitDataUsingPlayer(Camera* camera, struct Player* player); +s16 Camera_ChangeStatus(Camera* camera, s16 status); +Vec3s Camera_Update(Camera* camera); +void Camera_Finish(Camera* camera); +s32 Camera_RequestMode(Camera* camera, s16 mode); +s32 Camera_CheckValidMode(Camera* camera, s16 mode); +s32 Camera_RequestSetting(Camera* camera, s16 setting); +s32 Camera_RequestBgCam(Camera* camera, s32 requestedBgCamIndex); +s16 Camera_GetInputDirYaw(Camera* camera); +Vec3s Camera_GetCamDir(Camera* camera); +s16 Camera_GetCamDirPitch(Camera* camera); +s16 Camera_GetCamDirYaw(Camera* camera); +s32 Camera_RequestQuake(Camera* camera, s32 unused, s16 y, s32 duration); +s32 Camera_SetViewParam(Camera* camera, s32 viewFlag, void* param); +s32 Camera_OverwriteStateFlags(Camera* camera, s16 stateFlags); +s16 Camera_SetStateFlag(Camera* camera, s16 stateFlag); +s16 Camera_UnsetStateFlag(Camera* camera, s16 stateFlag); +s32 Camera_ResetAnim(Camera* camera); +s32 Camera_SetCSParams(Camera* camera, CutsceneCameraPoint* atPoints, CutsceneCameraPoint* eyePoints, + struct Player* player, s16 relativeToPlayer); +s32 Camera_ChangeDoorCam(Camera* camera, struct Actor* doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2, + s16 timer3); +s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera); +Vec3f Camera_GetQuakeOffset(Camera* camera); +void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* data1, s16 data2, s16 data3, + UNK_TYPE arg6); +s32 func_8005B198(void); +s16 Camera_SetFinishedFlag(Camera* camera); + #endif diff --git a/include/z64collision_check.h b/include/z64collision_check.h index a9cff3a58e..6da6400c64 100644 --- a/include/z64collision_check.h +++ b/include/z64collision_check.h @@ -1,35 +1,23 @@ #ifndef Z64COLLISION_CHECK_H #define Z64COLLISION_CHECK_H +#include "ultra64.h" +#include "z64math.h" + #define COLLISION_CHECK_AT_MAX 50 #define COLLISION_CHECK_AC_MAX 60 #define COLLISION_CHECK_OC_MAX 50 #define COLLISION_CHECK_OC_LINE_MAX 3 struct Actor; +struct GraphicsContext; +struct PlayState; /* * Bases for all shapes of colliders */ -typedef enum { - /* 0 */ COLTYPE_HIT0, // Blue blood, white hitmark - /* 1 */ COLTYPE_HIT1, // No blood, dust hitmark - /* 2 */ COLTYPE_HIT2, // Green blood, dust hitmark - /* 3 */ COLTYPE_HIT3, // No blood, white hitmark - /* 4 */ COLTYPE_HIT4, // Water burst, no hitmark - /* 5 */ COLTYPE_HIT5, // No blood, red hitmark - /* 6 */ COLTYPE_HIT6, // Green blood, white hitmark - /* 7 */ COLTYPE_HIT7, // Red blood, white hitmark - /* 8 */ COLTYPE_HIT8, // Blue blood, red hitmark - /* 9 */ COLTYPE_METAL, - /* 10 */ COLTYPE_NONE, - /* 11 */ COLTYPE_WOOD, - /* 12 */ COLTYPE_HARD, - /* 13 */ COLTYPE_TREE -} ColliderType; - -typedef enum { +typedef enum ColliderShape { /* 0 */ COLSHAPE_JNTSPH, /* 1 */ COLSHAPE_CYLINDER, /* 2 */ COLSHAPE_TRIS, @@ -37,7 +25,24 @@ typedef enum { /* 4 */ COLSHAPE_MAX } ColliderShape; -typedef struct { +typedef enum ColliderMaterial { + /* 0 */ COL_MATERIAL_HIT0, // Blue blood, white hitmark + /* 1 */ COL_MATERIAL_HIT1, // No blood, dust hitmark + /* 2 */ COL_MATERIAL_HIT2, // Green blood, dust hitmark + /* 3 */ COL_MATERIAL_HIT3, // No blood, white hitmark + /* 4 */ COL_MATERIAL_HIT4, // Water burst, no hitmark + /* 5 */ COL_MATERIAL_HIT5, // No blood, red hitmark + /* 6 */ COL_MATERIAL_HIT6, // Green blood, white hitmark + /* 7 */ COL_MATERIAL_HIT7, // Red blood, white hitmark + /* 8 */ COL_MATERIAL_HIT8, // Blue blood, red hitmark + /* 9 */ COL_MATERIAL_METAL, + /* 10 */ COL_MATERIAL_NONE, + /* 11 */ COL_MATERIAL_WOOD, + /* 12 */ COL_MATERIAL_HARD, + /* 13 */ COL_MATERIAL_TREE +} ColliderMaterial; + +typedef struct Collider { /* 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. @@ -46,12 +51,12 @@ typedef struct { /* 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 + /* 0x14 */ u8 colMaterial; // Determines hitmarks and sound effects during AC collisions. See `ColliderMaterial` enum /* 0x15 */ u8 shape; // See `ColliderShape` enum } Collider; // size = 0x18 -typedef struct { - /* 0x00 */ u8 colType; +typedef struct ColliderInit { + /* 0x00 */ u8 colMaterial; /* 0x01 */ u8 atFlags; /* 0x02 */ u8 acFlags; /* 0x03 */ u8 ocFlags1; @@ -59,15 +64,15 @@ typedef struct { /* 0x05 */ u8 shape; } ColliderInit; // size = 0x06 -typedef struct { - /* 0x00 */ u8 colType; +typedef struct ColliderInitType1 { + /* 0x00 */ u8 colMaterial; /* 0x01 */ u8 atFlags; /* 0x02 */ u8 acFlags; /* 0x03 */ u8 ocFlags1; /* 0x04 */ u8 shape; } ColliderInitType1; // size = 0x05 -typedef struct { +typedef struct ColliderInitToActor { /* 0x00 */ struct Actor* actor; /* 0x04 */ u8 atFlags; /* 0x05 */ u8 acFlags; @@ -75,46 +80,40 @@ typedef struct { /* 0x07 */ u8 shape; } ColliderInitToActor; // size = 0x08 -typedef struct { +typedef struct ColliderElementDamageInfoAT { /* 0x00 */ u32 dmgFlags; // Damage types dealt by this collider element as AT. /* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.) /* 0x05 */ u8 damage; // Damage } ColliderElementDamageInfoAT; // size = 0x08 -typedef struct { +typedef struct ColliderElementDamageInfoAC { /* 0x00 */ u32 dmgFlags; // Damage types that may affect this collider element as AC. /* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.) /* 0x05 */ u8 defense; // Damage Resistance /* 0x06 */ Vec3s hitPos; // Point of contact } ColliderElementDamageInfoAC; // size = 0x0C -typedef struct { +typedef struct ColliderElementDamageInfoACInit { /* 0x00 */ u32 dmgFlags; // Damage types that may affect this collider element as AC. /* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.) /* 0x05 */ u8 defense; // Damage Resistance } ColliderElementDamageInfoACInit; // size = 0x08 -/** - * Affects the sound Link's sword makes when hitting it, hookability, - * and possibly other things. It's definitely not flags, as all checks - * are == or !=. Will probably need more actors decomped to truly - * understand what this is. - */ -typedef enum { - /* 0 */ ELEMTYPE_UNK0, - /* 1 */ ELEMTYPE_UNK1, - /* 2 */ ELEMTYPE_UNK2, - /* 3 */ ELEMTYPE_UNK3, - /* 4 */ ELEMTYPE_UNK4, - /* 5 */ ELEMTYPE_UNK5, - /* 6 */ ELEMTYPE_UNK6, - /* 7 */ ELEMTYPE_UNK7 -} ElementType; +typedef enum ElementMaterial { + /* 0 */ ELEM_MATERIAL_UNK0, + /* 1 */ ELEM_MATERIAL_UNK1, + /* 2 */ ELEM_MATERIAL_UNK2, + /* 3 */ ELEM_MATERIAL_UNK3, + /* 4 */ ELEM_MATERIAL_UNK4, + /* 5 */ ELEM_MATERIAL_UNK5, + /* 6 */ ELEM_MATERIAL_UNK6, + /* 7 */ ELEM_MATERIAL_UNK7 +} ElementMaterial; typedef struct ColliderElement { /* 0x00 */ ColliderElementDamageInfoAT atDmgInfo; // Damage properties when acting as an AT collider /* 0x08 */ ColliderElementDamageInfoAC acDmgInfo; // Damage properties when acting as an AC collider - /* 0x14 */ u8 elemType; // Affects sfx reaction when attacked by Link and hookability. Full purpose unknown. + /* 0x14 */ u8 elemMaterial; // Affects sfx when attacked by Player, and interaction with hookshot and arrows. /* 0x15 */ u8 atElemFlags; // Information flags for AT collisions /* 0x16 */ u8 acElemFlags; // Information flags for AC collisions /* 0x17 */ u8 ocElemFlags; // Information flags for OC collisions @@ -124,8 +123,8 @@ typedef struct ColliderElement { /* 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. +typedef struct ColliderElementInit { + /* 0x00 */ u8 elemMaterial; // Affects sfx when attacked by Player, and interaction with hookshot and arrows. /* 0x04 */ ColliderElementDamageInfoAT atDmgInfo; // Damage properties when acting as an AT collider /* 0x0C */ ColliderElementDamageInfoACInit acDmgInfo; // Damage properties when acting as an AC collider /* 0x14 */ u8 atElemFlags; // Information flags for AT collisions @@ -139,19 +138,19 @@ typedef struct { // collider structs -typedef struct { +typedef struct ColliderJntSphElementDim { /* 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 { +typedef struct ColliderJntSphElement { /* 0x00 */ ColliderElement base; /* 0x28 */ ColliderJntSphElementDim dim; } ColliderJntSphElement; // size = 0x40 -typedef struct { +typedef struct ColliderJntSph { /* 0x00 */ Collider base; /* 0x18 */ s32 count; /* 0x1C */ ColliderJntSphElement* elements; @@ -159,30 +158,30 @@ typedef struct { // init data structs -typedef struct { +typedef struct ColliderJntSphElementDimInit { /* 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 { +typedef struct ColliderJntSphElementInit { /* 0x00 */ ColliderElementInit base; /* 0x18 */ ColliderJntSphElementDimInit dim; } ColliderJntSphElementInit; // size = 0x24 -typedef struct { +typedef struct ColliderJntSphInit { /* 0x00 */ ColliderInit base; /* 0x08 */ s32 count; /* 0x0C */ ColliderJntSphElementInit* elements; } ColliderJntSphInit; // size = 0x10 -typedef struct { +typedef struct ColliderJntSphInitType1 { /* 0x00 */ ColliderInitType1 base; /* 0x08 */ s32 count; /* 0x0C */ ColliderJntSphElementInit* elements; } ColliderJntSphInitType1; // size = 0x10 -typedef struct { +typedef struct ColliderJntSphInitToActor { /* 0x00 */ ColliderInitToActor base; /* 0x08 */ s32 count; /* 0x0C */ ColliderJntSphElementInit* elements; @@ -194,7 +193,7 @@ typedef struct { // collider structs -typedef struct { +typedef struct ColliderCylinder { /* 0x00 */ Collider base; /* 0x18 */ ColliderElement elem; /* 0x40 */ Cylinder16 dim; @@ -202,19 +201,19 @@ typedef struct { // init data structs -typedef struct { +typedef struct ColliderCylinderInit { /* 0x00 */ ColliderInit base; /* 0x08 */ ColliderElementInit elem; /* 0x20 */ Cylinder16 dim; } ColliderCylinderInit; // size = 0x2C -typedef struct { +typedef struct ColliderCylinderInitType1 { /* 0x00 */ ColliderInitType1 base; /* 0x08 */ ColliderElementInit elem; /* 0x20 */ Cylinder16 dim; } ColliderCylinderInitType1; // size = 0x2C -typedef struct { +typedef struct ColliderCylinderInitToActor { /* 0x00 */ ColliderInitToActor base; /* 0x08 */ ColliderElementInit elem; /* 0x20 */ Cylinder16 dim; @@ -226,12 +225,12 @@ typedef struct { // collider structs -typedef struct { +typedef struct ColliderTrisElement { /* 0x00 */ ColliderElement base; /* 0x28 */ TriNorm dim; } ColliderTrisElement; // size = 0x5C -typedef struct { +typedef struct ColliderTris { /* 0x00 */ Collider base; /* 0x18 */ s32 count; /* 0x1C */ ColliderTrisElement* elements; @@ -239,22 +238,22 @@ typedef struct { // init data structs -typedef struct { +typedef struct ColliderTrisElementDimInit { /* 0x00 */ Vec3f vtx[3]; } ColliderTrisElementDimInit; // size = 0x24 -typedef struct { +typedef struct ColliderTrisElementInit { /* 0x00 */ ColliderElementInit base; /* 0x18 */ ColliderTrisElementDimInit dim; } ColliderTrisElementInit; // size = 0x3C -typedef struct { +typedef struct ColliderTrisInit { /* 0x00 */ ColliderInit base; /* 0x08 */ s32 count; /* 0x0C */ ColliderTrisElementInit* elements; } ColliderTrisInit; // size = 0x10 -typedef struct { +typedef struct ColliderTrisInitType1 { /* 0x00 */ ColliderInitType1 base; /* 0x08 */ s32 count; /* 0x0C */ ColliderTrisElementInit* elements; @@ -266,14 +265,14 @@ typedef struct { // collider structs -typedef struct { +typedef struct ColliderQuadDim { /* 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 { +typedef struct ColliderQuad { /* 0x00 */ Collider base; /* 0x18 */ ColliderElement elem; /* 0x40 */ ColliderQuadDim dim; @@ -281,17 +280,17 @@ typedef struct { // init data structs -typedef struct { +typedef struct ColliderQuadDimInit { /* 0x00 */ Vec3f quad[4]; } ColliderQuadDimInit; // size = 0x30 -typedef struct { +typedef struct ColliderQuadInit { /* 0x00 */ ColliderInit base; /* 0x08 */ ColliderElementInit elem; /* 0x20 */ ColliderQuadDimInit dim; } ColliderQuadInit; // size = 0x50 -typedef struct { +typedef struct ColliderQuadInitType1 { /* 0x00 */ ColliderInitType1 base; /* 0x08 */ ColliderElementInit elem; /* 0x20 */ ColliderQuadDimInit dim; @@ -301,7 +300,7 @@ typedef struct { * Line collider */ -typedef struct { +typedef struct OcLine { /* 0x00 */ Linef line; /* 0x18 */ u16 ocFlags; } OcLine; // size = 0x1C @@ -437,4 +436,131 @@ typedef struct CollisionCheckContext { #define DMG_RANGED (DMG_ARROW | DMG_HOOKSHOT | DMG_SLINGSHOT) #define DMG_DEFAULT ~(DMG_SHIELD | DMG_MIR_RAY) +typedef struct DamageTable { + u8 table[32]; +} DamageTable; + +typedef struct CollisionCheckInfoInit { + /* 0x00 */ u8 health; + /* 0x02 */ s16 cylRadius; + /* 0x04 */ s16 cylHeight; + /* 0x06 */ u8 mass; +} CollisionCheckInfoInit; + +typedef struct CollisionCheckInfoInit2 { + /* 0x00 */ u8 health; + /* 0x02 */ s16 cylRadius; + /* 0x04 */ s16 cylHeight; + /* 0x06 */ s16 cylYShift; + /* 0x08 */ u8 mass; +} CollisionCheckInfoInit2; + +typedef struct CollisionCheckInfo { + /* 0x00 */ DamageTable* damageTable; + /* 0x04 */ Vec3f displacement; // Amount to correct actor velocity by when colliding into a body + /* 0x10 */ s16 cylRadius; // Used for various purposes + /* 0x12 */ s16 cylHeight; // Used for various purposes + /* 0x14 */ s16 cylYShift; // Unused. Purpose inferred from Cylinder16 and CollisionCheck_CylSideVsLineSeg + /* 0x16 */ u8 mass; // Used to compute displacement for OC collisions + /* 0x17 */ u8 health; // Note: some actors may use their own health variable instead of this one + /* 0x18 */ u8 damage; // Amount to decrement health by + /* 0x19 */ u8 damageEffect; // Stores what effect should occur when hit by a weapon + /* 0x1A */ u8 atHitEffect; // Stores what effect should occur when AT connects with an AC + /* 0x1B */ u8 acHitEffect; // Stores what effect should occur when AC is touched by an AT +} CollisionCheckInfo; // size = 0x1C + +DamageTable* DamageTable_Get(s32 index); +void DamageTable_Clear(DamageTable* table); +#if IS_DEBUG +void Collider_DrawRedPoly(struct GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC); +void Collider_DrawPoly(struct GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b); +#endif +s32 Collider_InitJntSph(struct PlayState* play, ColliderJntSph* jntSph); +s32 Collider_FreeJntSph(struct PlayState* play, ColliderJntSph* jntSph); +s32 Collider_DestroyJntSph(struct PlayState* play, ColliderJntSph* jntSph); +s32 Collider_SetJntSphToActor(struct PlayState* play, ColliderJntSph* dest, ColliderJntSphInitToActor* src); +s32 Collider_SetJntSphAllocType1(struct PlayState* play, ColliderJntSph* dest, struct Actor* actor, + ColliderJntSphInitType1* src); +s32 Collider_SetJntSphAlloc(struct PlayState* play, ColliderJntSph* dest, struct Actor* actor, ColliderJntSphInit* src); +s32 Collider_SetJntSph(struct PlayState* play, ColliderJntSph* dest, struct Actor* actor, ColliderJntSphInit* src, + ColliderJntSphElement* jntSphElements); +s32 Collider_ResetJntSphAT(struct PlayState* play, Collider* col); +s32 Collider_ResetJntSphAC(struct PlayState* play, Collider* col); +s32 Collider_ResetJntSphOC(struct PlayState* play, Collider* col); +s32 Collider_InitCylinder(struct PlayState* play, ColliderCylinder* cyl); +s32 Collider_DestroyCylinder(struct PlayState* play, ColliderCylinder* cyl); +s32 Collider_SetCylinderToActor(struct PlayState* play, ColliderCylinder* dest, ColliderCylinderInitToActor* src); +s32 Collider_SetCylinderType1(struct PlayState* play, ColliderCylinder* dest, struct Actor* actor, ColliderCylinderInitType1* src); +s32 Collider_SetCylinder(struct PlayState* play, ColliderCylinder* dest, struct Actor* actor, ColliderCylinderInit* src); +s32 Collider_ResetCylinderAT(struct PlayState* play, Collider* col); +s32 Collider_ResetCylinderAC(struct PlayState* play, Collider* col); +s32 Collider_ResetCylinderOC(struct PlayState* play, Collider* col); +s32 Collider_InitTris(struct PlayState* play, ColliderTris* tris); +s32 Collider_FreeTris(struct PlayState* play, ColliderTris* tris); +s32 Collider_DestroyTris(struct PlayState* play, ColliderTris* tris); +s32 Collider_SetTrisAllocType1(struct PlayState* play, ColliderTris* dest, struct Actor* actor, ColliderTrisInitType1* src); +s32 Collider_SetTrisAlloc(struct PlayState* play, ColliderTris* dest, struct Actor* actor, ColliderTrisInit* src); +s32 Collider_SetTris(struct PlayState* play, ColliderTris* dest, struct Actor* actor, ColliderTrisInit* src, + ColliderTrisElement* trisElements); +s32 Collider_ResetTrisAT(struct PlayState* play, Collider* col); +s32 Collider_ResetTrisAC(struct PlayState* play, Collider* col); +s32 Collider_ResetTrisOC(struct PlayState* play, Collider* col); +s32 Collider_InitQuad(struct PlayState* play, ColliderQuad* quad); +s32 Collider_DestroyQuad(struct PlayState* play, ColliderQuad* quad); +s32 Collider_SetQuadType1(struct PlayState* play, ColliderQuad* dest, struct Actor* actor, ColliderQuadInitType1* src); +s32 Collider_SetQuad(struct PlayState* play, ColliderQuad* dest, struct Actor* actor, ColliderQuadInit* src); +s32 Collider_ResetQuadAT(struct PlayState* play, Collider* col); +s32 Collider_ResetQuadAC(struct PlayState* play, Collider* col); +s32 Collider_ResetQuadOC(struct PlayState* play, Collider* col); +s32 Collider_InitLine(struct PlayState* play, OcLine* line); +s32 Collider_DestroyLine(struct PlayState* play, OcLine* line); +s32 Collider_SetLinePoints(struct PlayState* play, OcLine* ocLine, Vec3f* a, Vec3f* b); +s32 Collider_SetLine(struct PlayState* play, OcLine* dest, OcLine* src); +s32 Collider_ResetLineOC(struct PlayState* play, OcLine* line); +void CollisionCheck_InitContext(struct PlayState* play, CollisionCheckContext* colChkCtx); +void CollisionCheck_DestroyContext(struct PlayState* play, CollisionCheckContext* colChkCtx); +void CollisionCheck_ClearContext(struct PlayState* play, CollisionCheckContext* colChkCtx); +void CollisionCheck_EnableSAC(struct PlayState* play, CollisionCheckContext* colChkCtx); +void CollisionCheck_DisableSAC(struct PlayState* play, CollisionCheckContext* colChkCtx); +#if IS_DEBUG +void Collider_Draw(struct PlayState* play, Collider* col); +void CollisionCheck_DrawCollision(struct PlayState* play, CollisionCheckContext* colChkCtx); +#endif +s32 CollisionCheck_SetAT(struct PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider); +s32 CollisionCheck_SetAT_SAC(struct PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, s32 index); +s32 CollisionCheck_SetAC(struct PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider); +s32 CollisionCheck_SetAC_SAC(struct PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, s32 index); +s32 CollisionCheck_SetOC(struct PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider); +s32 CollisionCheck_SetOC_SAC(struct PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, s32 index); +s32 CollisionCheck_SetOCLine(struct PlayState* play, CollisionCheckContext* colChkCtx, OcLine* collider); +void CollisionCheck_BlueBlood(struct PlayState* play, Collider* collider, Vec3f* v); +void CollisionCheck_AT(struct PlayState* play, CollisionCheckContext* colChkCtx); +void CollisionCheck_OC(struct PlayState* play, CollisionCheckContext* colChkCtx); +void CollisionCheck_InitInfo(CollisionCheckInfo* info); +void CollisionCheck_ResetDamage(CollisionCheckInfo* info); +void CollisionCheck_SetInfoNoDamageTable(CollisionCheckInfo* info, CollisionCheckInfoInit* init); +void CollisionCheck_SetInfo(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init); +void CollisionCheck_SetInfo2(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init); +void CollisionCheck_SetInfoGetDamageTable(CollisionCheckInfo* info, s32 index, CollisionCheckInfoInit2* init); +void CollisionCheck_Damage(struct PlayState* play, CollisionCheckContext* colChkCtx); +s32 CollisionCheck_LineOCCheckAll(struct PlayState* play, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b); +s32 CollisionCheck_LineOCCheck(struct PlayState* play, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b, + struct Actor** exclusions, s32 numExclusions); +void Collider_UpdateCylinder(struct Actor* actor, ColliderCylinder* cyl); +void Collider_SetCylinderPosition(ColliderCylinder* cyl, Vec3s* pos); +void Collider_SetQuadVertices(ColliderQuad* quad, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d); +void Collider_SetTrisVertices(ColliderTris* tris, s32 elemIndex, Vec3f* a, Vec3f* b, Vec3f* c); +void Collider_SetTrisDim(struct PlayState* play, ColliderTris* tris, s32 elemIndex, ColliderTrisElementDimInit* src); +void Collider_UpdateSpheres(s32 limb, ColliderJntSph* jntSph); +void CollisionCheck_SpawnRedBlood(struct PlayState* play, Vec3f* v); +void CollisionCheck_SpawnWaterDroplets(struct PlayState* play, Vec3f* v); +void CollisionCheck_SpawnShieldParticles(struct PlayState* play, Vec3f* v); +void CollisionCheck_SpawnShieldParticlesMetal(struct PlayState* play, Vec3f* v); +void CollisionCheck_SpawnShieldParticlesMetalSfx(struct PlayState* play, Vec3f* v, Vec3f* pos); +void CollisionCheck_SpawnShieldParticlesMetal2(struct PlayState* play, Vec3f* v); +void CollisionCheck_SpawnShieldParticlesWood(struct PlayState* play, Vec3f* v, Vec3f* actorPos); +s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* itemPos, + Vec3f* itemProjPos, Vec3f* out1, Vec3f* out2); +u8 CollisionCheck_GetSwordDamage(s32 dmgFlags); + #endif diff --git a/include/z64curve.h b/include/z64curve.h index b150302e9c..2f35aec967 100644 --- a/include/z64curve.h +++ b/include/z64curve.h @@ -6,7 +6,7 @@ struct PlayState; -typedef struct { +typedef struct CurveInterpKnot { /* 0x0 */ u16 flags; // Only the bottom two bits are used, although others are set in objects /* 0x2 */ s16 abscissa; // knot input value /* 0x4 */ s16 leftGradient; // left derivative at the point @@ -14,7 +14,7 @@ typedef struct { /* 0x8 */ f32 ordinate; // output value } CurveInterpKnot; // size = 0xC -typedef struct { +typedef struct CurveAnimationHeader { /* 0x0 */ u8* knotCounts; /* 0x4 */ CurveInterpKnot* interpolationData; /* 0x8 */ s16* constantData; @@ -22,18 +22,18 @@ typedef struct { /* 0xE */ s16 frameCount; // Not used, inferred from use in objects } CurveAnimationHeader; // size = 0x10 -typedef struct { +typedef struct SkelCurveLimb { /* 0x0 */ u8 child; /* 0x1 */ u8 sibling; /* 0x4 */ Gfx* dList[2]; } SkelCurveLimb; // size = 0xC -typedef struct { +typedef struct CurveSkeletonHeader { /* 0x0 */ SkelCurveLimb** limbs; /* 0x4 */ u8 limbCount; } CurveSkeletonHeader; // size = 0x8 -typedef struct { +typedef struct SkelCurve { /* 0x00 */ u8 limbCount; /* 0x04 */ SkelCurveLimb** skeleton; /* 0x08 */ CurveAnimationHeader* animation; diff --git a/include/z64cutscene.h b/include/z64cutscene.h index 3968fe14cd..8e94406eda 100644 --- a/include/z64cutscene.h +++ b/include/z64cutscene.h @@ -5,6 +5,8 @@ #include "z64math.h" #include "config.h" +struct PlayState; + typedef union CutsceneData { s32 i; f32 f; @@ -12,7 +14,7 @@ typedef union CutsceneData { s8 b[4]; } CutsceneData; -typedef enum { +typedef enum CutsceneState { /* 0 */ CS_STATE_IDLE, /* 1 */ CS_STATE_START, /* 2 */ CS_STATE_RUN, @@ -20,7 +22,7 @@ typedef enum { /* 4 */ CS_STATE_RUN_UNSTOPPABLE } CutsceneState; -typedef enum { +typedef enum CutsceneCmd { /* 0x0001 */ CS_CMD_CAM_EYE_SPLINE = 0x01, /* 0x0002 */ CS_CMD_CAM_AT_SPLINE, /* 0x0003 */ CS_CMD_MISC, @@ -153,7 +155,7 @@ typedef enum { /* 0xFFFF */ CS_CMD_END = 0xFFFF } CutsceneCmd; -typedef enum { +typedef enum CutsceneMiscType { /* 0x00 */ CS_MISC_UNIMPLEMENTED_0, /* 0x01 */ CS_MISC_RAIN, /* 0x02 */ CS_MISC_LIGHTNING, @@ -192,7 +194,7 @@ typedef enum { /* 0x23 */ CS_MISC_LONG_SCARECROW_SONG } CutsceneMiscType; -typedef enum { +typedef enum CutsceneTextType { /* 0x00 */ CS_TEXT_NORMAL, /* 0x01 */ CS_TEXT_CHOICE, /* 0x02 */ CS_TEXT_OCARINA_ACTION, @@ -200,12 +202,12 @@ typedef enum { /* 0x04 */ CS_TEXT_ZORA_SAPPHIRE // use `altTextId1` in the sapphire cutscene if ruby is already obtained } CutsceneTextType; -typedef enum { +typedef enum CutsceneFadeOutSeqPlayer { /* 0x03 */ CS_FADE_OUT_FANFARE = 3, /* 0x04 */ CS_FADE_OUT_BGM_MAIN } CutsceneFadeOutSeqPlayer; -typedef enum { +typedef enum CutsceneTransitionType { /* 0x01 */ CS_TRANS_GRAY_FILL_IN = 1, // has hardcoded sounds for some scenes /* 0x02 */ CS_TRANS_BLUE_FILL_IN, /* 0x03 */ CS_TRANS_RED_FILL_OUT, @@ -221,7 +223,7 @@ typedef enum { /* 0x0D */ CS_TRANS_BLACK_FILL_IN_FROM_HALF } CutsceneTransitionType; -typedef enum { +typedef enum CutsceneDestination { /* 0x00 */ CS_DEST_UNIMPLEMENTED_0, /* 0x01 */ CS_DEST_CUTSCENE_MAP_GANON_HORSE, /* 0x02 */ CS_DEST_CUTSCENE_MAP_THREE_GODDESSES, @@ -344,7 +346,7 @@ typedef enum { /* 0x77 */ CS_DEST_ZELDAS_COURTYARD_RECEIVE_LETTER } CutsceneDestination; -typedef union { +typedef union CsCmdCam { struct { /* 0x00 */ u16 unused0; /* 0x02 */ u16 startFrame; @@ -354,7 +356,7 @@ typedef union { } CsCmdCam; // size = 0x8 -typedef union { +typedef union CsCmdMisc { struct { /* 0x00 */ u16 type; /* 0x02 */ u16 startFrame; @@ -363,7 +365,7 @@ typedef union { s32 _words[12]; } CsCmdMisc; // size = 0x30 -typedef union { +typedef union CsCmdLightSetting { struct { /* 0x00 */ u8 unused0; /* 0x01 */ u8 settingPlusOne; @@ -373,7 +375,7 @@ typedef union { s32 _words[12]; } CsCmdLightSetting; // size = 0x30 -typedef union { +typedef union CsCmdStartSeq { struct { /* 0x00 */ u8 unused0; /* 0x01 */ u8 seqIdPlusOne; @@ -383,7 +385,7 @@ typedef union { s32 _words[12]; } CsCmdStartSeq; // size = 0x30 -typedef union { +typedef union CsCmdStopSeq { struct { /* 0x00 */ u8 unused0; /* 0x01 */ u8 seqIdPlusOne; @@ -393,7 +395,7 @@ typedef union { s32 _words[12]; } CsCmdStopSeq; // size = 0x30 -typedef union { +typedef union CsCmdFadeOutSeq { struct { /* 0x00 */ u16 seqPlayer; /* 0x02 */ u16 startFrame; @@ -402,7 +404,7 @@ typedef union { s32 _words[12]; } CsCmdFadeOutSeq; // size = 0x30 -typedef union { +typedef union CsCmdRumble { struct { /* 0x00 */ u16 unused0; /* 0x02 */ u16 startFrame; @@ -414,7 +416,7 @@ typedef union { s32 _words[3]; } CsCmdRumble; // size = 0xC -typedef union { +typedef union CsCmdTime { struct { /* 0x00 */ u16 unused0; /* 0x02 */ u16 startFrame; @@ -425,7 +427,7 @@ typedef union { s32 _words[3]; } CsCmdTime; // size = 0xC -typedef union { +typedef union CsCmdDestination { struct { /* 0x00 */ u16 destination; /* 0x02 */ u16 startFrame; @@ -434,7 +436,7 @@ typedef union { s32 _words[2]; } CsCmdDestination; // size = 0x8 -typedef union { +typedef union CsCmdText { struct { /* 0x00 */ u16 textId; // can also be an ocarina action for `CS_TEXT_OCARINA_ACTION` /* 0x02 */ u16 startFrame; @@ -448,7 +450,7 @@ typedef union { #define CS_TEXT_ID_NONE 0xFFFF -typedef union { +typedef union CsCmdTransition { struct { /* 0x00 */ u16 type; /* 0x02 */ u16 startFrame; @@ -457,7 +459,7 @@ typedef union { s32 _words[2]; } CsCmdTransition; // size = 0x8 -typedef union { +typedef union CsCmdActorCue { struct { /* 0x00 */ u16 id; // "dousa" /* 0x02 */ u16 startFrame; @@ -469,7 +471,7 @@ typedef union { s32 _words[12]; } CsCmdActorCue; // size = 0x30 -typedef union { +typedef union CutsceneCameraPoint { struct { /* 0x00 */ s8 continueFlag; /* 0x01 */ s8 cameraRoll; @@ -485,20 +487,20 @@ typedef union { #define CS_CAM_DATA_NOT_APPLIED 0xFFFF -typedef struct { +typedef struct CutsceneCameraDirection { /* 0x00 */ Vec3f at; /* 0x0C */ Vec3f eye; /* 0x18 */ s16 roll; /* 0x1A */ s16 fov; } CutsceneCameraDirection; // size = 0x1C -typedef struct { +typedef struct CutsceneCameraMove { /* 0x0 */ CutsceneCameraPoint* atPoints; /* 0x4 */ CutsceneCameraPoint* eyePoints; /* 0x8 */ s16 relativeToPlayer; } CutsceneCameraMove; // size = 0xC -typedef struct { +typedef struct CutsceneContext { /* 0x00 */ char unk_00[0x4]; /* 0x04 */ void* script; /* 0x08 */ u8 state; @@ -531,4 +533,13 @@ typedef enum { /* 2 */ CS_MOTION_BLUR_DISABLE } CsMotionBlurType; +void Cutscene_InitContext(struct PlayState* play, CutsceneContext* csCtx); +void Cutscene_StartManual(struct PlayState* play, CutsceneContext* csCtx); +void Cutscene_StopManual(struct PlayState* play, CutsceneContext* csCtx); +void Cutscene_UpdateManual(struct PlayState* play, CutsceneContext* csCtx); +void Cutscene_UpdateScripted(struct PlayState* play, CutsceneContext* csCtx); +void Cutscene_HandleEntranceTriggers(struct PlayState* play); +void Cutscene_HandleConditionalTriggers(struct PlayState* play); +void Cutscene_SetScript(struct PlayState* play, void* script); + #endif diff --git a/include/z64dma.h b/include/z64dma.h index 7fdb530ae9..3b60e7d6e1 100755 --- a/include/z64dma.h +++ b/include/z64dma.h @@ -5,7 +5,7 @@ #include "alignment.h" #include "romfile.h" -typedef struct { +typedef struct DmaRequest { /* 0x00 */ uintptr_t vromAddr; // VROM address (source) /* 0x04 */ void* dramAddr; // DRAM address (destination) /* 0x08 */ size_t size; // File Transfer size @@ -16,7 +16,7 @@ typedef struct { /* 0x1C */ OSMesg notifyMsg; // Completion notification message } DmaRequest; // size = 0x20 -typedef struct { +typedef struct DmaEntry { /* 0x00 */ RomFile file; /* 0x08 */ uintptr_t romStart; /* 0x0C */ uintptr_t romEnd; diff --git a/include/z64effect.h b/include/z64effect.h index e90ff85af6..bad2b1d324 100644 --- a/include/z64effect.h +++ b/include/z64effect.h @@ -2,7 +2,11 @@ #define Z64EFFECT_H #include "color.h" +#include "romfile.h" +#include "z64light.h" +#include "z64math.h" +struct Actor; struct GraphicsContext; struct PlayState; @@ -14,20 +18,20 @@ struct PlayState; #define TOTAL_EFFECT_COUNT SPARK_COUNT + BLURE_COUNT + SHIELD_PARTICLE_COUNT -typedef struct { +typedef struct EffectStatus { /* 0x00 */ u8 active; /* 0x01 */ u8 unk_01; /* 0x02 */ u8 unk_02; } EffectStatus; // size = 0x03 -typedef struct { +typedef struct EffectSparkElement { /* 0x00 */ Vec3f velocity; /* 0x0C */ Vec3f position; /* 0x18 */ Vec3s unkVelocity; /* 0x1E */ Vec3s unkPosition; } EffectSparkElement; // size = 0x24 -typedef struct { +typedef struct EffectSparkInit { /* 0x000 */ Vec3s position; /* 0x008 */ s32 numElements; // "table_size"; calculated as uDiv * vDiv + 2 /* 0x00C */ EffectSparkElement elements[32]; @@ -41,7 +45,7 @@ typedef struct { /* 0x4C0 */ s32 duration; } EffectSparkInit; // size = 0x4C4 -typedef struct { +typedef struct EffectSpark { /* 0x000 */ Vec3s position; /* 0x008 */ s32 numElements; // "table_size"; calculated as uDiv * vDiv + 2 /* 0x00C */ EffectSparkElement elements[32]; @@ -55,7 +59,7 @@ typedef struct { /* 0x4C0 */ s32 duration; } EffectSpark; // size = 0x4C4 -typedef struct { +typedef struct EffectBlureElement { /* 0x00 */ s32 state; /* 0x04 */ s32 timer; /* 0x08 */ Vec3s p1; @@ -63,7 +67,7 @@ typedef struct { /* 0x14 */ u16 flags; } EffectBlureElement; // size = 0x18 -typedef struct { +typedef struct EffectBlureInit1 { /* 0x000 */ char unk_00[0x184]; /* 0x184 */ u8 p1StartColor[4]; /* 0x188 */ u8 p2StartColor[4]; @@ -74,7 +78,7 @@ typedef struct { /* 0x19C */ s32 calcMode; } EffectBlureInit1; // size = 0x1A0 -typedef struct { +typedef struct EffectBlureInit2 { /* 0x00 */ s32 calcMode; /* 0x04 */ u16 flags; /* 0x06 */ s16 addAngleChange; @@ -90,7 +94,7 @@ typedef struct { /* 0x20 */ Color_RGBA8 altEnvColor; // used with drawMode 1 } EffectBlureInit2; // size = 0x24 -typedef struct { +typedef struct EffectBlure { /* 0x000 */ EffectBlureElement elements[16]; /* 0x180 */ s32 calcMode; /* 0x184 */ f32 mode4Param; @@ -109,7 +113,7 @@ typedef struct { /* 0x1A6 */ Color_RGBA8 altEnvColor; // used with drawMode 1 } EffectBlure; // size = 0x1AC -typedef struct { +typedef struct EffectShieldParticleElement { /* 0x00 */ f32 initialSpeed; /* 0x04 */ f32 endXChange; /* 0x08 */ f32 endX; @@ -119,7 +123,7 @@ typedef struct { /* 0x16 */ s16 pitch; } EffectShieldParticleElement; // size = 0x18 -typedef struct { +typedef struct EffectShieldParticleInit { /* 0x00 */ u8 numElements; /* 0x02 */ Vec3s position; /* 0x08 */ Color_RGBA8 primColorStart; @@ -136,7 +140,7 @@ typedef struct { /* 0x3C */ s32 lightDecay; // halves light radius every frame when set to 1 } EffectShieldParticleInit; // size = 0x40 -typedef struct { +typedef struct EffectShieldParticle { /* 0x000 */ EffectShieldParticleElement elements[16]; /* 0x180 */ u8 numElements; /* 0x182 */ Vec3s position; @@ -157,7 +161,7 @@ typedef struct { /* 0x1C4 */ s32 lightDecay; // halves light radius every frame when set to 1 } EffectShieldParticle; // size = 0x1C8 -typedef struct { +typedef struct EffectContext { /* 0x0000 */ struct PlayState* play; struct { EffectStatus status; @@ -173,7 +177,7 @@ typedef struct { } /* 0x388C */ shieldParticles[SHIELD_PARTICLE_COUNT]; } EffectContext; // size = 0x3DF0 -typedef struct { +typedef struct EffectInfo { /* 0x00 */ u32 size; /* 0x04 */ void (*init)(void* effect, void* initParams); /* 0x08 */ void (*destroy)(void* effect); @@ -181,7 +185,7 @@ typedef struct { /* 0x10 */ void (*draw)(void* effect, struct GraphicsContext* gfxCtx); } EffectInfo; // size = 0x14 -typedef enum { +typedef enum EffectType { /* 0x00 */ EFFECT_SPARK, /* 0x01 */ EFFECT_BLURE1, /* 0x02 */ EFFECT_BLURE2, @@ -196,17 +200,17 @@ typedef u32 (*EffectSsInitFunc)(struct PlayState* play, u32 index, struct Effect typedef void (*EffectSsUpdateFunc)(struct PlayState* play, u32 index, struct EffectSs* effectSs); typedef void (*EffectSsDrawFunc)(struct PlayState* play, u32 index, struct EffectSs* effectSs); -typedef struct { +typedef struct EffectSsProfile { /* 0x00 */ u32 type; /* 0x04 */ EffectSsInitFunc init; -} EffectSsInit; // size = 0x08 +} EffectSsProfile; // size = 0x08 -typedef struct { +typedef struct EffectSsOverlay { /* 0x00 */ RomFile file; /* 0x08 */ void* vramStart; /* 0x0C */ void* vramEnd; /* 0x10 */ void* loadedRamAddr; - /* 0x14 */ EffectSsInit* initInfo; + /* 0x14 */ EffectSsProfile* profile; /* 0x18 */ u8 unk_18; } EffectSsOverlay; // size = 0x1C @@ -218,7 +222,7 @@ typedef struct EffectSs { /* 0x28 */ EffectSsDrawFunc draw; /* 0x2C */ Vec3f vec; // usage specific per effect /* 0x38 */ void* gfx; // mostly used for display lists, sometimes textures - /* 0x3C */ Actor* actor; // interfacing actor, usually the actor that spawned the effect + /* 0x3C */ struct Actor* actor; // interfacing actor, usually the actor that spawned the effect /* 0x40 */ s16 regs[13]; // specific per effect /* 0x5A */ u16 flags; /* 0x5C */ s16 life; // -1 means this entry is free @@ -226,7 +230,7 @@ typedef struct EffectSs { /* 0x5F */ u8 type; } EffectSs; // size = 0x60 -typedef struct { +typedef struct EffectSsInfo { /* 0x00 */ EffectSs* table; // "data_table" /* 0x04 */ s32 searchStartIndex; /* 0x08 */ s32 tableSize; @@ -250,7 +254,7 @@ typedef struct { #define DEFINE_EFFECT_SS(_0, enum) enum, #define DEFINE_EFFECT_SS_UNSET(enum) enum, -typedef enum { +typedef enum EffectSsType { #include "tables/effect_ss_table.h" /* 0x25 */ EFFECT_SS_TYPE_MAX // originally "EFFECT_SS2_TYPE_LAST_LABEL" } EffectSsType; @@ -258,4 +262,180 @@ typedef enum { #undef DEFINE_EFFECT_SS #undef DEFINE_EFFECT_SS_UNSET +void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2); +void EffectBlure_AddSpace(EffectBlure* this); +void EffectBlure_Init1(void* thisx, void* initParamsx); +void EffectBlure_Init2(void* thisx, void* initParamsx); +void EffectBlure_Destroy(void* thisx); +s32 EffectBlure_Update(void* thisx); +void EffectBlure_Draw(void* thisx, struct GraphicsContext* gfxCtx); +void EffectShieldParticle_Init(void* thisx, void* initParamsx); +void EffectShieldParticle_Destroy(void* thisx); +s32 EffectShieldParticle_Update(void* thisx); +void EffectShieldParticle_Draw(void* thisx, struct GraphicsContext* gfxCtx); +void EffectSpark_Init(void* thisx, void* initParamsx); +void EffectSpark_Destroy(void* thisx); +s32 EffectSpark_Update(void* thisx); +void EffectSpark_Draw(void* thisx, struct GraphicsContext* gfxCtx); +void func_80026230(struct PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3); +void func_80026400(struct PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3); +void func_80026608(struct PlayState* play); +void func_80026690(struct PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3); +void func_80026860(struct PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3); +void func_80026A6C(struct PlayState* play); +struct PlayState* Effect_GetPlayState(void); +void* Effect_GetByIndex(s32 index); +void Effect_InitContext(struct PlayState* play); +void Effect_Add(struct PlayState* play, s32* pIndex, s32 type, u8 arg3, u8 arg4, void* initParams); +void Effect_DrawAll(struct GraphicsContext* gfxCtx); +void Effect_UpdateAll(struct PlayState* play); +void Effect_Delete(struct PlayState* play, s32 index); +void Effect_DeleteAll(struct PlayState* play); +void EffectSs_InitInfo(struct PlayState* play, s32 tableSize); +void EffectSs_ClearAll(struct PlayState* play); +void EffectSs_Delete(EffectSs* effectSs); +void EffectSs_Reset(EffectSs* effectSs); +void EffectSs_Insert(struct PlayState* play, EffectSs* effectSs); +void EffectSs_Spawn(struct PlayState* play, s32 type, s32 priority, void* initParams); +void EffectSs_UpdateAll(struct PlayState* play); +void EffectSs_DrawAll(struct PlayState* play); +s16 EffectSs_LerpInv(s16 a, s16 b, s32 weightInv); +s16 EffectSs_LerpS16(s16 a, s16 b, f32 weight); +u8 EffectSs_LerpU8(u8 a, u8 b, f32 weight); +void EffectSs_DrawGEffect(struct PlayState* play, EffectSs* this, void* texture); +void EffectSsDust_Spawn(struct PlayState* play, u16 drawFlags, Vec3f* pos, Vec3f* velocity, Vec3f* accel, + Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life, + u8 updateMode); +void func_8002829C(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor, s16 scale, s16 scaleStep); +void func_80028304(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor, s16 scale, s16 scaleStep); +void func_8002836C(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); +void func_800283D4(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); +void func_8002843C(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); +void func_800284A4(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor, s16 scale, s16 scaleStep); +void func_80028510(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor, s16 scale, s16 scaleStep); +void func_8002857C(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel); +void func_800285EC(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel); +void func_8002865C(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep); +void func_800286CC(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep); +void func_8002873C(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, + s16 life); +void func_800287AC(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, + s16 life); +void func_8002881C(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor); +void func_80028858(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor); +void func_80028990(struct PlayState* play, f32 randScale, Vec3f* srcPos); +void func_80028A54(struct PlayState* play, f32 randScale, Vec3f* srcPos); +void EffectSsKiraKira_SpawnSmallYellow(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel); +void EffectSsKiraKira_SpawnSmall(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, + Color_RGBA8* primColor, Color_RGBA8* envColor); +void EffectSsKiraKira_SpawnDispersed(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, + Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s32 life); +void EffectSsKiraKira_SpawnFocused(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, + Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s32 life); +void EffectSsBomb_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel); +void EffectSsBomb2_SpawnFade(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel); +void EffectSsBomb2_SpawnLayered(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, + s16 scaleStep); +void EffectSsBlast_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* innerColor, + Color_RGBA8* outerColor, s16 scale, s16 scaleStep, s16 scaleStepDecay, s16 life); +void EffectSsBlast_SpawnWhiteShockwaveSetScale(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, + s16 scale, s16 scaleStep, s16 life); +void EffectSsBlast_SpawnShockwaveSetColor(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, + Color_RGBA8* innerColor, Color_RGBA8* outerColor, s16 life); +void EffectSsBlast_SpawnWhiteShockwave(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel); +void EffectSsGSpk_SpawnAccel(struct PlayState* play, struct Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel, + Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep); +void EffectSsGSpk_SpawnNoAccel(struct PlayState* play, struct Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel, + Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep); +void EffectSsGSpk_SpawnFuse(struct PlayState* play, struct Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel); +void EffectSsGSpk_SpawnRandColor(struct PlayState* play, struct Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel, + s16 scale, s16 scaleStep); +void EffectSsGSpk_SpawnSmall(struct PlayState* play, struct Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel, + Color_RGBA8* primColor, Color_RGBA8* envColor); +void EffectSsDFire_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, + s16 alpha, s16 fadeDelay, s32 life); +void EffectSsDFire_SpawnFixedScale(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 alpha, + s16 fadeDelay); +void EffectSsBubble_Spawn(struct PlayState* play, Vec3f* pos, f32 yPosOffset, f32 yPosRandScale, f32 xzPosRandScale, + f32 scale); +void EffectSsGRipple_Spawn(struct PlayState* play, Vec3f* pos, s16 radius, s16 radiusMax, s16 life); +void EffectSsGSplash_Spawn(struct PlayState* play, Vec3f* pos, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 type, + s16 scale); +void EffectSsGMagma_Spawn(struct PlayState* play, Vec3f* pos); +void EffectSsGFire_Spawn(struct PlayState* play, Vec3f* pos); +void EffectSsLightning_Spawn(struct PlayState* play, Vec3f* pos, Color_RGBA8* primColor, Color_RGBA8* envColor, + s16 scale, s16 yaw, s16 life, s16 numBolts); +void EffectSsDtBubble_SpawnColorProfile(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, + s16 life, s16 colorProfile, s16 randXZ); +void EffectSsDtBubble_SpawnCustomColor(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, + Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 life, s16 randXZ); +void EffectSsHahen_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 unused, s16 scale, + s16 objId, s16 life, Gfx* dList); +void EffectSsHahen_SpawnBurst(struct PlayState* play, Vec3f* pos, f32 burstScale, s16 unused, s16 scale, + s16 randScaleRange, s16 count, s16 objId, s16 life, Gfx* dList); +void EffectSsStick_Spawn(struct PlayState* play, Vec3f* pos, s16 yaw); +void EffectSsSibuki_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 moveDelay, + s16 direction, s16 scale); +void EffectSsSibuki_SpawnBurst(struct PlayState* play, Vec3f* pos); +void EffectSsSibuki2_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale); +void EffectSsGMagma2_Spawn(struct PlayState* play, Vec3f* pos, Color_RGBA8* primColor, Color_RGBA8* envColor, + s16 updateRate, s16 drawMode, s16 scale); +void EffectSsStone1_Spawn(struct PlayState* play, Vec3f* pos, s32 arg2); +void EffectSsHitMark_Spawn(struct PlayState* play, s32 type, s16 scale, Vec3f* pos); +void EffectSsHitMark_SpawnFixedScale(struct PlayState* play, s32 type, Vec3f* pos); +void EffectSsHitMark_SpawnCustomScale(struct PlayState* play, s32 type, s16 scale, Vec3f* pos); +void EffectSsFhgFlash_SpawnLightBall(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, + u8 param); +void EffectSsFhgFlash_SpawnShock(struct PlayState* play, struct Actor* actor, Vec3f* pos, s16 scale, u8 param); +void EffectSsKFire_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scaleMax, u8 type); +void EffectSsSolderSrchBall_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 unused, + s16* linkDetected); +void EffectSsKakera_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* arg3, s16 gravity, s16 arg5, + s16 arg6, s16 arg7, s16 arg8, s16 scale, s16 arg10, s16 arg11, s32 life, s16 colorIdx, + s16 objId, Gfx* dList); +void EffectSsIcePiece_Spawn(struct PlayState* play, Vec3f* pos, f32 scale, Vec3f* velocity, Vec3f* accel, s32 life); +void EffectSsIcePiece_SpawnBurst(struct PlayState* play, Vec3f* refPos, f32 scale); +void EffectSsEnIce_SpawnFlyingVec3f(struct PlayState* play, struct Actor* actor, Vec3f* pos, s16 primR, s16 primG, + s16 primB, s16 primA, s16 envR, s16 envG, s16 envB, f32 scale); +void EffectSsEnIce_SpawnFlyingVec3s(struct PlayState* play, struct Actor* actor, Vec3s* pos, s16 primR, s16 primG, + s16 primB, s16 primA, s16 envR, s16 envG, s16 envB, f32 scale); +void EffectSsEnIce_Spawn(struct PlayState* play, Vec3f* pos, f32 scale, Vec3f* velocity, Vec3f* accel, + Color_RGBA8* primColor, Color_RGBA8* envColor, s32 life); +void EffectSsFireTail_Spawn(struct PlayState* play, struct Actor* actor, Vec3f* pos, f32 scale, Vec3f* arg4, s16 arg5, + Color_RGBA8* primColor, Color_RGBA8* envColor, s16 type, s16 bodyPart, s32 life); +void EffectSsFireTail_SpawnFlame(struct PlayState* play, struct Actor* actor, Vec3f* pos, f32 arg3, s16 bodyPart, + f32 colorIntensity); +void EffectSsFireTail_SpawnFlameOnPlayer(struct PlayState* play, f32 scale, s16 bodyPart, f32 colorIntensity); +void EffectSsEnFire_SpawnVec3f(struct PlayState* play, struct Actor* actor, Vec3f* pos, s16 scale, s16 arg4, s16 flags, + s16 bodyPart); +void EffectSsEnFire_SpawnVec3s(struct PlayState* play, struct Actor* actor, Vec3s* pos, s16 scale, s16 arg4, s16 flags, + s16 bodyPart); +void EffectSsExtra_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scoreIdx); +void EffectSsFCircle_Spawn(struct PlayState* play, struct Actor* actor, Vec3f* pos, s16 radius, s16 height); +void EffectSsDeadDb_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, + s16 primR, s16 primG, s16 primB, s16 primA, s16 envR, s16 envG, s16 envB, s16 unused, + s32 arg14, s16 playSfx); +void EffectSsDeadDd_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, + s16 primR, s16 primG, s16 primB, s16 alpha, s16 envR, s16 envG, s16 envB, s16 alphaStep, + s32 life); +void EffectSsDeadDd_SpawnRandYellow(struct PlayState* play, Vec3f* pos, s16 scale, s16 scaleStep, f32 randPosScale, + s32 randIter, s32 life); +void EffectSsDeadDs_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, + s16 alpha, s32 life); +void EffectSsDeadDs_SpawnStationary(struct PlayState* play, Vec3f* pos, s16 scale, s16 scaleStep, s16 alpha, s32 life); +void EffectSsDeadSound_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, u16 sfxId, + s16 lowerPriority, s16 repeatMode, s32 life); +void EffectSsDeadSound_SpawnStationary(struct PlayState* play, Vec3f* pos, u16 sfxId, s16 lowerPriority, s16 repeatMode, + s32 life); +void EffectSsIceSmoke_Spawn(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale); + #endif diff --git a/include/z64environment.h b/include/z64environment.h index 922c544258..598c4655a9 100644 --- a/include/z64environment.h +++ b/include/z64environment.h @@ -5,8 +5,12 @@ #include "z64light.h" #include "z64dma.h" +struct GameOverContext; +struct MessageContext; +struct PauseContext; struct PlayState; struct SkyboxContext; +struct View; #define FILL_SCREEN_OPA (1 << 0) #define FILL_SCREEN_XLU (1 << 1) @@ -34,12 +38,12 @@ struct SkyboxContext; // This is a bit of a hack used only by bosses in the original game. #define LIGHT_BLEND_OVERRIDE_FULL_CONTROL 2 -typedef enum { +typedef enum LightMode { /* 0 */ LIGHT_MODE_TIME, // environment lights use `lightConfig` and change based on time of day /* 1 */ LIGHT_MODE_SETTINGS // environment lights use `lightSetting` } LightMode; -typedef enum { +typedef enum SkyboxDmaState { /* 0 */ SKYBOX_DMA_INACTIVE, /* 1 */ SKYBOX_DMA_TEXTURE1_START, /* 2 */ SKYBOX_DMA_TEXTURE1_DONE, @@ -49,19 +53,19 @@ typedef enum { /* 13 */ SKYBOX_DMA_TLUT2_START } SkyboxDmaState; -typedef enum { +typedef enum LightningState { /* 0 */ LIGHTNING_OFF, // no lightning /* 1 */ LIGHTNING_ON, // request lightning strikes at random intervals /* 2 */ LIGHTNING_LAST // request one lightning strike before turning off } LightningState; -typedef enum { +typedef enum LightningStrikeState { /* 0 */ LIGHTNING_STRIKE_WAIT, // wait between lightning strikes. request bolts when timer hits 0 /* 1 */ LIGHTNING_STRIKE_START, // fade in the flash. note: bolts are requested in the previous state /* 2 */ LIGHTNING_STRIKE_END // fade out the flash and go back to wait } LightningStrikeState; -typedef enum { +typedef enum WeatherMode { /* 0 */ WEATHER_MODE_CLEAR, /* 1 */ WEATHER_MODE_CLOUDY_CONFIG3, // scene must define settings for light config 3 /* 2 */ WEATHER_MODE_CLOUDY_CONFIG2, // scene must define settings for light config 2 @@ -70,14 +74,14 @@ typedef enum { /* 5 */ WEATHER_MODE_HEAVY_RAIN // scene must define settings for light config 4 } WeatherMode; -typedef enum { +typedef enum ChangeSkyboxState { /* 0 */ CHANGE_SKYBOX_INACTIVE, /* 1 */ CHANGE_SKYBOX_REQUESTED, /* 2 */ CHANGE_SKYBOX_WAIT, /* 3 */ CHANGE_SKYBOX_ACTIVE } ChangeSkyboxState; -typedef enum { +typedef enum PrecipitationData { /* 0 */ PRECIP_RAIN_MAX, // max number of raindrops that can draw; uses this or SOS_MAX, whichever is larger /* 1 */ PRECIP_RAIN_CUR, // current number of rain drops being drawn on screen /* 2 */ PRECIP_SNOW_CUR, // current number of snowflakes being drawn on screen @@ -86,18 +90,18 @@ typedef enum { /* 5 */ PRECIP_MAX } PrecipitationData; -typedef enum { +typedef enum StormRequest { /* 0 */ STORM_REQUEST_NONE, /* 1 */ STORM_REQUEST_START, /* 2 */ STORM_REQUEST_STOP } StormRequest; -typedef enum { +typedef enum StormState { /* 0 */ STORM_STATE_OFF, /* 1 */ STORM_STATE_ON } StormState; -typedef enum { +typedef enum TimeBasedSeqState { /* 0x00 */ TIMESEQ_DAY_BGM, /* 0x01 */ TIMESEQ_FADE_DAY_BGM, /* 0x02 */ TIMESEQ_NIGHT_BEGIN_SFX, @@ -110,7 +114,7 @@ typedef enum { /* 0xFF */ TIMESEQ_DISABLED = 0xFF } TimeBasedSeqState; -typedef enum { +typedef enum SandstormState { /* 0 */ SANDSTORM_OFF, /* 1 */ SANDSTORM_FILL, /* 2 */ SANDSTORM_UNFILL, @@ -118,7 +122,7 @@ typedef enum { /* 4 */ SANDSTORM_DISSIPATE } SandstormState; -typedef struct { +typedef struct LightningStrike { /* 0x00 */ u8 state; /* 0x01 */ u8 flashRed; /* 0x02 */ u8 flashGreen; @@ -127,7 +131,7 @@ typedef struct { /* 0x08 */ f32 delayTimer; } LightningStrike; // size = 0xC -typedef struct { +typedef struct TimeBasedSkyboxEntry { /* 0x00 */ u16 startTime; /* 0x02 */ u16 endTime; /* 0x04 */ u8 changeSkybox; @@ -135,7 +139,7 @@ typedef struct { /* 0x06 */ u8 skybox2Index; } TimeBasedSkyboxEntry; // size = 0x8 -typedef struct { +typedef struct CurrentEnvLightSettings { /* 0x00 */ u8 ambientColor[3]; /* 0x03 */ s8 light1Dir[3]; /* 0x06 */ u8 light1Color[3]; @@ -155,7 +159,7 @@ typedef struct { #define ENV_LIGHT_SETTINGS_BLEND_RATE_U8(blendRateAndFogNear) (((blendRateAndFogNear) >> 10) * 4) #define ENV_LIGHT_SETTINGS_FOG_NEAR(blendRateAndFogNear) ((blendRateAndFogNear) & 0x3FF) -typedef struct { +typedef struct EnvLightSettings { /* 0x00 */ u8 ambientColor[3]; /* 0x03 */ s8 light1Dir[3]; /* 0x06 */ u8 light1Color[3]; @@ -166,7 +170,7 @@ typedef struct { /* 0x14 */ s16 zFar; } EnvLightSettings; // size = 0x16 -typedef struct { +typedef struct EnvironmentContext { /* 0x00 */ char unk_00[0x02]; /* 0x02 */ u16 sceneTimeSpeed; // time speed value from the scene file /* 0x04 */ Vec3f sunPos; // moon position can be found by negating the sun position @@ -233,7 +237,53 @@ typedef struct { extern u8 gSkyboxIsChanging; extern TimeBasedSkyboxEntry gTimeBasedSkyboxConfigs[][9]; +extern u8 gWeatherMode; +extern u8 gLightConfigAfterUnderwater; +extern u8 gInterruptSongOfStorms; +extern u16 gTimeSpeed; + void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, struct SkyboxContext* skyboxCtx); void Environment_DrawSkyboxFilters(struct PlayState* play); +s32 Environment_ZBufValToFixedPoint(s32 zBufferVal); +u16 Environment_GetPixelDepth(s32 x, s32 y); +void Environment_GraphCallback(struct GraphicsContext* gfxCtx, void* param); +void Environment_Init(struct PlayState* play2, EnvironmentContext* envCtx, s32 unused); +u8 Environment_SmoothStepToU8(u8* pvalue, u8 target, u8 scale, u8 step, u8 minStep); +u8 Environment_SmoothStepToS8(s8* pvalue, s8 target, u8 scale, u8 step, u8 minStep); +f32 Environment_LerpWeight(u16 max, u16 min, u16 val); +f32 Environment_LerpWeightAccelDecel(u16 endFrame, u16 startFrame, u16 curFrame, u16 accelDuration, u16 decelDuration); +void Environment_EnableUnderwaterLights(struct PlayState* play, s32 waterLightsIndex); +void Environment_DisableUnderwaterLights(struct PlayState* play); +void Environment_Update(struct PlayState* play, EnvironmentContext* envCtx, LightContext* lightCtx, + struct PauseContext* pauseCtx, struct MessageContext* msgCtx, + struct GameOverContext* gameOverCtx, struct GraphicsContext* gfxCtx); +void Environment_DrawSunAndMoon(struct PlayState* play); +void Environment_DrawSunLensFlare(struct PlayState* play, EnvironmentContext* envCtx, struct View* view, + struct GraphicsContext* gfxCtx, Vec3f pos, s32 unused); +void Environment_DrawLensFlare(struct PlayState* play, EnvironmentContext* envCtx, struct View* view, + struct GraphicsContext* gfxCtx, Vec3f pos, s32 unused, s16 scale, f32 colorIntensity, + s16 glareStrength, u8 isSun); +void Environment_DrawRain(struct PlayState* play, struct View* view, struct GraphicsContext* gfxCtx); +void Environment_ChangeLightSetting(struct PlayState* play, u32 lightSetting); +void Environment_UpdateLightningStrike(struct PlayState* play); +void Environment_AddLightningBolts(struct PlayState* play, u8 num); +void Environment_DrawLightning(struct PlayState* play, s32 unused); +void Environment_PlaySceneSequence(struct PlayState* play); +void Environment_DrawCustomLensFlare(struct PlayState* play); +void Environment_InitGameOverLights(struct PlayState* play); +void Environment_FadeInGameOverLights(struct PlayState* play); +void Environment_FadeOutGameOverLights(struct PlayState* play); +void Environment_FillScreen(struct GraphicsContext* gfxCtx, u8 red, u8 green, u8 blue, u8 alpha, u8 drawFlags); +void Environment_DrawSandstorm(struct PlayState* play, u8 sandstormState); +void Environment_AdjustLights(struct PlayState* play, f32 arg1, f32 arg2, f32 arg3, f32 arg4); +s32 Environment_GetBgsDayCount(void); +void Environment_ClearBgsDayCount(void); +s32 Environment_GetTotalDays(void); +void Environment_ForcePlaySequence(u16 seqId); +s32 Environment_IsForcedSequenceDisabled(void); +void Environment_PlayStormNatureAmbience(struct PlayState* play); +void Environment_StopStormNatureAmbience(struct PlayState* play); +void Environment_WarpSongLeave(struct PlayState* play); + #endif diff --git a/include/z64frame_advance.h b/include/z64frame_advance.h index 3912b333eb..88f8731e04 100644 --- a/include/z64frame_advance.h +++ b/include/z64frame_advance.h @@ -8,7 +8,7 @@ struct Input; struct PlayState; -typedef struct { +typedef struct FrameAdvanceContext { /* 0x0 */ s32 enabled; /* 0x4 */ s32 timer; } FrameAdvanceContext; // size = 0x8 diff --git a/include/z64game.h b/include/z64game.h index 8cd6478963..3b50cfd362 100644 --- a/include/z64game.h +++ b/include/z64game.h @@ -15,7 +15,7 @@ typedef struct GameAllocEntry { /* 0x0C */ u32 unk_0C; } GameAllocEntry; // size = 0x10 -typedef struct { +typedef struct GameAlloc { /* 0x00 */ GameAllocEntry base; /* 0x10 */ GameAllocEntry* head; } GameAlloc; // size = 0x14 @@ -23,7 +23,7 @@ typedef struct { // Used in Graph_GetNextGameState in graph.c #define DEFINE_GAMESTATE_INTERNAL(typeName, enumName) enumName, #define DEFINE_GAMESTATE(typeName, enumName, name) DEFINE_GAMESTATE_INTERNAL(typeName, enumName) -typedef enum { +typedef enum GameStateId { #include "tables/gamestate_table.h" GAMESTATE_ID_MAX } GameStateId; diff --git a/include/z64interface.h b/include/z64interface.h index 4412cfdeda..96e68df8f9 100644 --- a/include/z64interface.h +++ b/include/z64interface.h @@ -1,6 +1,11 @@ #ifndef Z64INTERFACE_H #define Z64INTERFACE_H +#include "z64dma.h" +#include "z64view.h" + +struct PlayState; + extern u8 _icon_item_staticSegmentRomStart[]; extern u8 _icon_item_24_staticSegmentRomStart[]; @@ -29,7 +34,7 @@ extern u8 _icon_item_24_staticSegmentRomStart[]; #define GET_QUEST_ICON_VROM(itemId) \ ((uintptr_t)_icon_item_24_staticSegmentRomStart + (((itemId)-ITEM_MEDALLION_FOREST) * QUEST_ICON_SIZE)) -typedef enum { +typedef enum DoAction { /* 0x00 */ DO_ACTION_ATTACK, /* 0x01 */ DO_ACTION_CHECK, /* 0x02 */ DO_ACTION_ENTER, @@ -67,7 +72,7 @@ typedef enum { #define DO_ACTION_TEX_HEIGHT 16 #define DO_ACTION_TEX_SIZE ((DO_ACTION_TEX_WIDTH * DO_ACTION_TEX_HEIGHT) / 2) // (sizeof(gCheckDoActionENGTex)) -typedef struct { +typedef struct InterfaceContext { /* 0x0000 */ View view; /* 0x0128 */ Vtx* actionVtx; /* 0x012C */ Vtx* beatingHeartVtx; @@ -144,14 +149,34 @@ typedef struct { } InterfaceContext; // size = 0x270 /** - * Button HUD Positions (Upper Left) + * Button HUD positions and colors */ #define A_BUTTON_X 186 #define A_BUTTON_Y 9 +#if N64_BTN_COLORS +#define A_BUTTON_R 90 +#define A_BUTTON_G 90 +#define A_BUTTON_B 255 +#else +#define A_BUTTON_R 0 +#define A_BUTTON_G 200 +#define A_BUTTON_B 50 +#endif + #define B_BUTTON_X 160 #define B_BUTTON_Y 17 +#if N64_BTN_COLORS +#define B_BUTTON_R 0 +#define B_BUTTON_G 150 +#define B_BUTTON_B 0 +#else +#define B_BUTTON_R 255 +#define B_BUTTON_G 30 +#define B_BUTTON_B 30 +#endif + #define C_LEFT_BUTTON_X 227 #define C_LEFT_BUTTON_Y 18 @@ -164,6 +189,16 @@ typedef struct { #define C_UP_BUTTON_X 254 #define C_UP_BUTTON_Y 16 +#if N64_BTN_COLORS +#define START_BUTTON_R 200 +#define START_BUTTON_G 0 +#define START_BUTTON_B 0 +#else +#define START_BUTTON_R 120 +#define START_BUTTON_G 120 +#define START_BUTTON_B 120 +#endif + /** * These are the colors for the hearts in the interface. The prim color is the red color of the heart * for the base hearts, while the prim color for the double defense hearts is the white outline. The @@ -210,4 +245,37 @@ typedef struct { #define HEARTS_DROWN_ENV_G 0 #define HEARTS_DROWN_ENV_B 255 +void Interface_ChangeHudVisibilityMode(u16 hudVisibilityMode); +void Interface_SetSceneRestrictions(struct PlayState* play); +void Inventory_SwapAgeEquipment(void); +void Interface_InitHorsebackArchery(struct PlayState* play); +void func_800849EC(struct PlayState* play); +void Interface_LoadItemIcon1(struct PlayState* play, u16 button); +void Interface_LoadItemIcon2(struct PlayState* play, u16 button); +void func_80084BF4(struct PlayState* play, u16 flag); +u8 Item_Give(struct PlayState* play, u8 item); +u8 Item_CheckObtainability(u8 item); +void Inventory_DeleteItem(u16 item, u16 invSlot); +s32 Inventory_ReplaceItem(struct PlayState* play, u16 oldItem, u16 newItem); +s32 Inventory_HasEmptyBottle(void); +s32 Inventory_HasSpecificBottle(u8 bottleItem); +void Inventory_UpdateBottleItem(struct PlayState* play, u8 item, u8 button); +s32 Inventory_ConsumeFairy(struct PlayState* play); +void Interface_SetDoAction(struct PlayState* play, u16 action); +void Interface_SetNaviCall(struct PlayState* play, u16 naviCallState); +void Interface_LoadActionLabelB(struct PlayState* play, u16 action); +s32 Health_ChangeBy(struct PlayState* play, s16 amount); +void Rupees_ChangeBy(s16 rupeeChange); +void Inventory_ChangeAmmo(s16 item, s16 ammoChange); +void Magic_Fill(struct PlayState* play); +void Magic_Reset(struct PlayState* play); +s32 Magic_RequestChange(struct PlayState* play, s16 amount, s16 type); +void Interface_SetSubTimer(s16 seconds); +void Interface_SetSubTimerToFinalSecond(struct PlayState* play); +void Interface_SetTimer(s16 seconds); +void Interface_Draw(struct PlayState* play); +void Interface_Update(struct PlayState* play); +void Interface_Destroy(struct PlayState* play); +void Interface_Init(struct PlayState* play); + #endif diff --git a/include/z64inventory.h b/include/z64inventory.h new file mode 100644 index 0000000000..9a8133b3da --- /dev/null +++ b/include/z64inventory.h @@ -0,0 +1,26 @@ +#ifndef Z64INVENTORY_H +#define Z64INVENTORY_H + +#include "ultra64.h" +#include "z64item.h" +#include "z64save.h" + +struct PlayState; + +void Inventory_ChangeEquipment(s16 equipment, u16 value); +u8 Inventory_DeleteEquipment(struct PlayState* play, s16 equipment); +void Inventory_ChangeUpgrade(s16 upgrade, s16 value); + +extern u32 gBitFlags[32]; +extern u16 gEquipMasks[EQUIP_TYPE_MAX]; +extern u16 gEquipNegMasks[EQUIP_TYPE_MAX]; +extern u32 gUpgradeMasks[UPG_MAX]; +extern u8 gEquipShifts[EQUIP_TYPE_MAX]; +extern u8 gUpgradeShifts[UPG_MAX]; +extern u16 gUpgradeCapacities[UPG_MAX][4]; +extern u32 gGsFlagsMasks[4]; +extern u32 gGsFlagsShifts[4]; +extern void* gItemIcons[0x82]; +extern u8 gItemSlots[56]; + +#endif diff --git a/include/z64item.h b/include/z64item.h index 5ddd8b7e36..60344f326c 100644 --- a/include/z64item.h +++ b/include/z64item.h @@ -7,7 +7,7 @@ #define ITEM_NAME_TEX_HEIGHT 16 #define ITEM_NAME_TEX_SIZE ((ITEM_NAME_TEX_WIDTH * ITEM_NAME_TEX_HEIGHT) / 2) // 128x16 IA4 texture -typedef enum { +typedef enum EquipmentType { /* 0 */ EQUIP_TYPE_SWORD, /* 1 */ EQUIP_TYPE_SHIELD, /* 2 */ EQUIP_TYPE_TUNIC, @@ -17,26 +17,26 @@ typedef enum { // `EquipInv*` enums are for Inventory.equipment (for example used in the `CHECK_OWNED_EQUIP` macro) -typedef enum { +typedef enum EquipInvSword { /* 0 */ EQUIP_INV_SWORD_KOKIRI, /* 1 */ EQUIP_INV_SWORD_MASTER, /* 2 */ EQUIP_INV_SWORD_BIGGORON, /* 3 */ EQUIP_INV_SWORD_BROKENGIANTKNIFE } EquipInvSword; -typedef enum { +typedef enum EquipInvShield { /* 0 */ EQUIP_INV_SHIELD_DEKU, /* 1 */ EQUIP_INV_SHIELD_HYLIAN, /* 2 */ EQUIP_INV_SHIELD_MIRROR } EquipInvShield; -typedef enum { +typedef enum EquipInvTunic { /* 0 */ EQUIP_INV_TUNIC_KOKIRI, /* 1 */ EQUIP_INV_TUNIC_GORON, /* 2 */ EQUIP_INV_TUNIC_ZORA } EquipInvTunic; -typedef enum { +typedef enum EquipInvBoots { /* 0 */ EQUIP_INV_BOOTS_KOKIRI, /* 1 */ EQUIP_INV_BOOTS_IRON, /* 2 */ EQUIP_INV_BOOTS_HOVER @@ -44,7 +44,7 @@ typedef enum { // `EquipValue*` enums are for ItemEquips.equipment (for example used in the `CUR_EQUIP_VALUE` macro) -typedef enum { +typedef enum EquipValueSword { /* 0 */ EQUIP_VALUE_SWORD_NONE, /* 1 */ EQUIP_VALUE_SWORD_KOKIRI, /* 2 */ EQUIP_VALUE_SWORD_MASTER, @@ -52,7 +52,7 @@ typedef enum { /* 4 */ EQUIP_VALUE_SWORD_MAX } EquipValueSword; -typedef enum { +typedef enum EquipValueShield { /* 0 */ EQUIP_VALUE_SHIELD_NONE, /* 1 */ EQUIP_VALUE_SHIELD_DEKU, /* 2 */ EQUIP_VALUE_SHIELD_HYLIAN, @@ -60,7 +60,7 @@ typedef enum { /* 4 */ EQUIP_VALUE_SHIELD_MAX } EquipValueShield; -typedef enum { +typedef enum EquipValueTunic { /* 0 */ EQUIP_VALUE_TUNIC_NONE, /* 1 */ EQUIP_VALUE_TUNIC_KOKIRI, /* 2 */ EQUIP_VALUE_TUNIC_GORON, @@ -68,7 +68,7 @@ typedef enum { /* 4 */ EQUIP_VALUE_TUNIC_MAX } EquipValueTunic; -typedef enum { +typedef enum EquipValueBoots { /* 0 */ EQUIP_VALUE_BOOTS_NONE, /* 1 */ EQUIP_VALUE_BOOTS_KOKIRI, /* 2 */ EQUIP_VALUE_BOOTS_IRON, @@ -76,7 +76,7 @@ typedef enum { /* 4 */ EQUIP_VALUE_BOOTS_MAX } EquipValueBoots; -typedef enum { +typedef enum UpgradeType { /* 0x00 */ UPG_QUIVER, /* 0x01 */ UPG_BOMB_BAG, /* 0x02 */ UPG_STRENGTH, @@ -88,7 +88,7 @@ typedef enum { /* 0x08 */ UPG_MAX } UpgradeType; -typedef enum { +typedef enum QuestItem { /* 0x00 */ QUEST_MEDALLION_FOREST, /* 0x01 */ QUEST_MEDALLION_FIRE, /* 0x02 */ QUEST_MEDALLION_WATER, @@ -113,16 +113,17 @@ typedef enum { /* 0x15 */ QUEST_STONE_OF_AGONY, /* 0x16 */ QUEST_GERUDOS_CARD, /* 0x17 */ QUEST_SKULL_TOKEN, - /* 0x1C */ QUEST_HEART_PIECE_COUNT = 0x1C + /* 0x18 */ QUEST_HEART_PIECE, // for `pauseCtx->cursorPoint[PAUSE_QUEST]` + /* 0x1C */ QUEST_HEART_PIECE_COUNT = 0x1C // for accessing the `Inventory.questItems` bitfield } QuestItem; -typedef enum { +typedef enum DungeonItem { /* 0x00 */ DUNGEON_BOSS_KEY, /* 0x01 */ DUNGEON_COMPASS, /* 0x02 */ DUNGEON_MAP } DungeonItem; -typedef enum { +typedef enum InventorySlot { /* 0x00 */ SLOT_DEKU_STICK, /* 0x01 */ SLOT_DEKU_NUT, /* 0x02 */ SLOT_BOMB, @@ -150,7 +151,7 @@ typedef enum { /* 0xFF */ SLOT_NONE = 0xFF } InventorySlot; -typedef enum { +typedef enum ItemID { /* 0x00 */ ITEM_DEKU_STICK, /* 0x01 */ ITEM_DEKU_NUT, /* 0x02 */ ITEM_BOMB, @@ -316,7 +317,7 @@ typedef enum { #define ITEM_TRADE_ADULT ITEM_POCKET_EGG // Get Item result may vary depending on context (chest/shop/scrub/drop) -typedef enum { +typedef enum GetItemID { /* 0x00 */ GI_NONE, /* 0x01 */ GI_BOMBS_5, /* 0x02 */ GI_DEKU_NUTS_5, @@ -446,7 +447,7 @@ typedef enum { /* 0x7E */ GI_MAX } GetItemID; -typedef enum { +typedef enum GetItemDrawID { /* 0x00 */ GID_BOTTLE_EMPTY, /* 0x01 */ GID_SMALL_KEY, /* 0x02 */ GID_SONG_MINUET, @@ -567,7 +568,7 @@ typedef enum { /* 0x75 */ GID_MAX } GetItemDrawID; -typedef enum { +typedef enum ExchangeItemID { /* 0x00 */ EXCH_ITEM_NONE, /* 0x01 */ EXCH_ITEM_ZELDAS_LETTER, /* 0x02 */ EXCH_ITEM_WEIRD_EGG, diff --git a/include/z64light.h b/include/z64light.h index 769501216a..cb666ff752 100644 --- a/include/z64light.h +++ b/include/z64light.h @@ -6,7 +6,10 @@ #include "z64math.h" #include "color.h" -typedef struct { +struct GraphicsContext; +struct PlayState; + +typedef struct LightPoint { /* 0x0 */ s16 x; /* 0x2 */ s16 y; /* 0x4 */ s16 z; @@ -15,19 +18,19 @@ typedef struct { /* 0xA */ s16 radius; } LightPoint; // size = 0xC -typedef struct { +typedef struct LightDirectional { /* 0x0 */ s8 x; /* 0x1 */ s8 y; /* 0x2 */ s8 z; /* 0x3 */ u8 color[3]; } LightDirectional; // size = 0x6 -typedef union { +typedef union LightParams { LightPoint point; LightDirectional dir; } LightParams; // size = 0xC -typedef struct { +typedef struct LightInfo { /* 0x0 */ u8 type; /* 0x2 */ LightParams params; } LightInfo; // size = 0xE @@ -54,7 +57,7 @@ typedef struct LightContext { /* 0xC */ s16 zFar; // draw distance. range 0 - ENV_ZFAR_MAX } LightContext; // size = 0x10 -typedef enum { +typedef enum LightType { /* 0x00 */ LIGHT_POINT_NOGLOW, /* 0x01 */ LIGHT_DIRECTIONAL, /* 0x02 */ LIGHT_POINT_GLOW @@ -62,4 +65,26 @@ typedef enum { typedef void (*LightsBindFunc)(Lights* lights, LightParams* params, Vec3f* vec); +void Lights_PointSetInfo(LightInfo* info, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius, s32 type); +void Lights_PointNoGlowSetInfo(LightInfo* info, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius); +void Lights_PointGlowSetInfo(LightInfo* info, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius); +void Lights_PointSetColorAndRadius(LightInfo* info, u8 r, u8 g, u8 b, s16 radius); +void Lights_DirectionalSetInfo(LightInfo* info, s8 x, s8 y, s8 z, u8 r, u8 g, u8 b); +void Lights_Reset(Lights* lights, u8 ambentR, u8 ambentG, u8 ambentB); +void Lights_Draw(Lights* lights, struct GraphicsContext* gfxCtx); +void Lights_BindAll(Lights* lights, LightNode* listHead, Vec3f* vec); +void LightContext_Init(struct PlayState* play, LightContext* lightCtx); +void LightContext_SetAmbientColor(LightContext* lightCtx, u8 r, u8 g, u8 b); +void LightContext_SetFog(LightContext* lightCtx, u8 r, u8 g, u8 b, s16 fogNear, s16 zFar); +Lights* LightContext_NewLights(LightContext* lightCtx, struct GraphicsContext* gfxCtx); +void LightContext_InitList(struct PlayState* play, LightContext* lightCtx); +void LightContext_DestroyList(struct PlayState* play, LightContext* lightCtx); +LightNode* LightContext_InsertLight(struct PlayState* play, LightContext* lightCtx, LightInfo* info); +void LightContext_RemoveLight(struct PlayState* play, LightContext* lightCtx, LightNode* node); +Lights* Lights_NewAndDraw(struct GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambientB, u8 numLights, u8 r, u8 g, + u8 b, s8 x, s8 y, s8 z); +Lights* Lights_New(struct GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambientB); +void Lights_GlowCheck(struct PlayState* play); +void Lights_DrawGlow(struct PlayState* play); + #endif diff --git a/include/z64map_mark.h b/include/z64map_mark.h index d862197840..0c55efa3ae 100644 --- a/include/z64map_mark.h +++ b/include/z64map_mark.h @@ -7,12 +7,12 @@ #define MAP_MARK_CHEST 0 #define MAP_MARK_BOSS 1 -typedef struct { +typedef struct MapMarkPoint { /* 0x00 */ s8 chestFlag; // chest icon is only displayed if this flag is not set for the current room /* 0x01 */ u8 x, y; // coordinates to place the icon (top-left corner), relative to the minimap texture } MapMarkPoint; // size = 0x3 -typedef struct { +typedef struct MapMarkIconData { /* 0x00 */ s8 markType; // 0 for the chest icon, 1 for the boss skull icon, -1 for none /* 0x01 */ u8 count; // number of icons to display /* 0x02 */ MapMarkPoint points[12]; diff --git a/include/z64math.h b/include/z64math.h index b8b6e35602..1a2a6c95d5 100644 --- a/include/z64math.h +++ b/include/z64math.h @@ -7,80 +7,85 @@ #define SQ(x) ((x)*(x)) #define VEC_SET(V,X,Y,Z) (V).x=(X);(V).y=(Y);(V).z=(Z) -typedef struct { +typedef union FloatInt { + f32 f; + u32 i; +} FloatInt; + +typedef struct Vec2s { s32 x, y; } Vec2s; // size = 0x08 -typedef struct { +typedef struct Vec2f { f32 x, y; } Vec2f; // size = 0x08 -typedef struct { +typedef struct Vec3f { f32 x, y, z; } Vec3f; // size = 0x0C -typedef struct { +typedef struct Vec3us { u16 x, y, z; } Vec3us; // size = 0x06 -typedef struct { +typedef struct Vec3s { s16 x, y, z; } Vec3s; // size = 0x06 -typedef struct { +typedef struct Vec3i { s32 x, y, z; } Vec3i; // size = 0x0C -typedef struct { +typedef struct Sphere16 { Vec3s center; s16 radius; } Sphere16; // size = 0x08 -typedef struct { +typedef struct Spheref { Vec3f center; f32 radius; } Spheref; // size = 0x10 -typedef struct { +typedef struct PosRot { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3s rot; } PosRot; // size = 0x14 -typedef struct { +typedef struct Plane { Vec3f normal; f32 originDist; } Plane; // size = 0x10 -typedef struct { +typedef struct TriNorm { Vec3f vtx[3]; Plane plane; } TriNorm; // size = 0x34 -typedef struct { +typedef struct Cylinder16 { /* 0x0000 */ s16 radius; /* 0x0002 */ s16 height; /* 0x0004 */ s16 yShift; /* 0x0006 */ Vec3s pos; } Cylinder16; // size = 0x0C -typedef struct { +typedef struct Cylinderf { /* 0x00 */ f32 radius; /* 0x04 */ f32 height; /* 0x08 */ f32 yShift; /* 0x0C */ Vec3f pos; } Cylinderf; // size = 0x18 -typedef struct { +typedef struct InfiniteLine { /* 0x0000 */ Vec3f point; /* 0x000C */ Vec3f dir; } InfiniteLine; // size = 0x18 -typedef struct { +typedef struct Linef { /* 0x0000 */ Vec3f a; /* 0x000C */ Vec3f b; } Linef; // size = 0x18 -typedef struct { +typedef struct VecSphGeo { /* 0x0 */ f32 r; // radius /* 0x4 */ s16 pitch; // depends on coordinate system. See below. /* 0x6 */ s16 yaw; // azimuthal angle @@ -127,6 +132,17 @@ typedef VecSphGeo VecGeo; #define BINANG_TO_RAD_ALT(binang) (((f32)(binang) / (f32)0x8000) * M_PI) #define BINANG_TO_RAD_ALT2(binang) (((f32)(binang) * M_PI) / 0x8000) +// Angle conversion macros required for matching. These were probably the original macros used, but +// we prefer DEG_TO_BINANG/RAD_TO_BINANG where possible to avoid possible undefined behavior with input +// values outside of [-180, 180) degrees or [-PI, PI) radians. +#if PLATFORM_N64 +#define DEG_TO_BINANG2(degrees) (f32)((degrees) * (0x8000 / 180.0f)) +#define RAD_TO_BINANG2(radians) (f32)((radians) * (0x8000 / M_PI)) +#else +#define DEG_TO_BINANG2(degrees) (s32)((degrees) * (0x8000 / 180.0f)) +#define RAD_TO_BINANG2(radians) (s32)((radians) * (0x8000 / M_PI)) +#endif + // Angle conversion macros (Camera) // these two angle conversion macros are slightly inaccurate #define CAM_DEG_TO_BINANG(degrees) (s16)TRUNCF_BINANG((degrees) * 182.04167f + .5f) diff --git a/include/z64message.h b/include/z64message.h index cf942a4c51..ad2e19f547 100644 --- a/include/z64message.h +++ b/include/z64message.h @@ -2,11 +2,13 @@ #define Z64MESSAGE_H #include "z64view.h" +#include "versions.h" struct OcarinaStaff; struct Actor; +struct PlayState; -typedef enum { +typedef enum TextBoxIcon { /* 0 */ TEXTBOX_ICON_TRIANGLE, /* 1 */ TEXTBOX_ICON_SQUARE, /* 2 */ TEXTBOX_ICON_ARROW @@ -54,7 +56,7 @@ typedef enum { #define FILENAME_PERIOD 0x40 #endif -typedef enum { +typedef enum MessageMode { /* 0x00 */ MSGMODE_NONE, /* 0x01 */ MSGMODE_TEXT_START, /* 0x02 */ MSGMODE_TEXT_BOX_GROWING, @@ -151,33 +153,33 @@ typedef enum MaskReactionSet { /* 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 + /* 0x25 */ MASK_REACTION_SET_DOG_LADY, + /* 0x26 */ MASK_REACTION_SET_WOMAN_3, + /* 0x27 */ MASK_REACTION_SET_MAN_1_BEARD, + /* 0x28 */ MASK_REACTION_SET_MAN_2_BALD, + /* 0x29 */ MASK_REACTION_SET_MAN_1_SHAVED_BLACK_SHIRT, + /* 0x2A */ MASK_REACTION_SET_BEGGAR, + /* 0x2B */ MASK_REACTION_SET_OLD_WOMAN, + /* 0x2C */ MASK_REACTION_SET_OLD_MAN, + /* 0x2D */ MASK_REACTION_SET_YOUNG_WOMAN_BROWN_HAIR, + /* 0x2E */ MASK_REACTION_SET_MAN_2_MUSTACHE_RED_SHIRT, + /* 0x2F */ MASK_REACTION_SET_MAN_2_MUSTACHE_BLUE_SHIRT, + /* 0x30 */ MASK_REACTION_SET_YOUNG_WOMAN_ORANGE_HAIR, + /* 0x31 */ MASK_REACTION_SET_MAN_2_ALT_MUSTACHE, + /* 0x32 */ MASK_REACTION_SET_MAN_1_BOWL_CUT_PURPLE_SHIRT, + /* 0x33 */ MASK_REACTION_SET_MAN_2_BEARD, + /* 0x34 */ MASK_REACTION_SET_OLD_MAN_BALD_BROWN_ROBE, + /* 0x35 */ MASK_REACTION_SET_MAN_2_MUSTACHE_WHITE_SHIRT, + /* 0x36 */ MASK_REACTION_SET_MAN_1_SHAVED_GREEN_SHIRT, + /* 0x37 */ MASK_REACTION_SET_WOMAN_2, + /* 0x38 */ MASK_REACTION_SET_OLD_MAN_BALD_PURPLE_ROBE, + /* 0x39 */ MASK_REACTION_SET_MAN_1_BOWL_CUT_GREEN_SHIRT, /* 0x3A */ MASK_REACTION_SET_HAGGLING_TOWNSPEOPLE_1, /* 0x3B */ MASK_REACTION_SET_HAGGLING_TOWNSPEOPLE_2, /* 0x3C */ MASK_REACTION_SET_MAX } MaskReactionSet; -typedef enum { +typedef enum TextState { /* 0 */ TEXT_STATE_NONE, /* 1 */ TEXT_STATE_DONE_HAS_NEXT, /* 2 */ TEXT_STATE_CLOSING, @@ -191,7 +193,7 @@ typedef enum { /* 10 */ TEXT_STATE_AWAITING_NEXT } TextState; -typedef struct { +typedef struct Font { /* 0x0000 */ u32 msgOffset; /* 0x0004 */ u32 msgLength; union { @@ -221,7 +223,7 @@ typedef struct { #define TEXTBOX_ENDTYPE_EVENT 0x50 #define TEXTBOX_ENDTYPE_FADING 0x60 -typedef struct { +typedef struct MessageContext { /* 0x0000 */ View view; /* 0x0128 */ Font font; /* 0xE2B0 */ u8* textboxSegment; // original name: "fukidashiSegment" @@ -235,8 +237,10 @@ typedef struct { /* 0xE2FE */ u8 textBoxPos; // text box position /* 0xE300 */ s32 msgLength; // original name : "msg_data" /* 0xE304 */ u8 msgMode; // original name: "msg_mode" - /* 0xE305 */ char unk_E305[0x1]; - /* 0xE306 */ u8 msgBufDecoded[200]; // decoded message buffer, may be smaller than this + /* 0xE306 */ union { + u8 msgBufDecoded[200]; + u16 msgBufDecodedWide[100]; + }; /* 0xE3CE */ u16 msgBufPos; // original name : "rdp" /* 0xE3D0 */ u16 unk_E3D0; // unused, only ever set to 0 /* 0xE3D2 */ u16 textDrawPos; // draw all decoded characters up to this buffer position @@ -276,4 +280,17 @@ typedef struct { /* 0xE410 */ u8 lastOcarinaButtonIndex; } MessageContext; // size = 0xE418 +void Message_UpdateOcarinaMemoryGame(struct PlayState* play); +u8 Message_ShouldAdvance(struct PlayState* play); +void Message_CloseTextbox(struct PlayState*); +void Message_StartTextbox(struct PlayState* play, u16 textId, struct Actor* actor); +void Message_ContinueTextbox(struct PlayState* play, u16 textId); +void Message_StartOcarina(struct PlayState* play, u16 ocarinaActionId); +void Message_StartOcarinaSunsSongDisabled(struct PlayState* play, u16 ocarinaActionId); +u8 Message_GetState(MessageContext* msgCtx); +void Message_Draw(struct PlayState* play); +void Message_Update(struct PlayState* play); +void Message_SetTables(void); +void Message_Init(struct PlayState* play); + #endif diff --git a/include/z64object.h b/include/z64object.h index 057b445b69..016eda00d7 100644 --- a/include/z64object.h +++ b/include/z64object.h @@ -4,7 +4,9 @@ #include "ultra64.h" #include "z64dma.h" -typedef struct { +struct PlayState; + +typedef struct ObjectEntry { /* 0x00 */ s16 id; /* 0x04 */ void* segment; /* 0x08 */ DmaRequest dmaRequest; @@ -12,7 +14,7 @@ typedef struct { /* 0x40 */ OSMesg loadMsg; } ObjectEntry; // size = 0x44 -typedef struct { +typedef struct ObjectContext { /* 0x0000 */ void* spaceStart; /* 0x0004 */ void* spaceEnd; // original name: "endSegment" /* 0x0008 */ u8 numEntries; // total amount of used entries @@ -26,7 +28,7 @@ typedef struct { #define DEFINE_OBJECT_EMPTY(_0, enum) enum, #define DEFINE_OBJECT_UNSET(enum) enum, -typedef enum { +typedef enum ObjectId { #include "tables/object_table.h" /* 0x0192 */ OBJECT_ID_MAX } ObjectId; @@ -35,4 +37,13 @@ typedef enum { #undef DEFINE_OBJECT_EMPTY #undef DEFINE_OBJECT_UNSET +void Object_InitContext(struct PlayState* play, ObjectContext* objectCtx); +void Object_UpdateEntries(ObjectContext* objectCtx); +s32 Object_GetSlot(ObjectContext* objectCtx, s16 objectId); +s32 Object_IsLoaded(ObjectContext* objectCtx, s32 slot); +void func_800981B8(ObjectContext* objectCtx); + +extern u32 gObjectTableSize; +extern RomFile gObjectTable[OBJECT_ID_MAX]; + #endif diff --git a/include/z64ocarina.h b/include/z64ocarina.h index 0ff3d01487..afad53811b 100644 --- a/include/z64ocarina.h +++ b/include/z64ocarina.h @@ -3,7 +3,7 @@ #include "ultra64.h" -typedef enum { +typedef enum OcarinaSongId { /* 0 */ OCARINA_SONG_MINUET, /* 1 */ OCARINA_SONG_BOLERO, /* 2 */ OCARINA_SONG_SERENADE, @@ -22,7 +22,7 @@ typedef enum { /* 14 */ OCARINA_SONG_SCARECROW_LONG = OCARINA_SONG_MAX // anything larger than 13 is considered the long scarecrow's song } OcarinaSongId; -typedef enum { +typedef enum OcarinaSongActionId { /* 0x00 */ OCARINA_ACTION_UNK_0, // acts like free play but never set /* 0x01 */ OCARINA_ACTION_FREE_PLAY, /* 0x02 */ OCARINA_ACTION_TEACH_MINUET, // Song demonstrations by teachers @@ -75,7 +75,7 @@ typedef enum { /* 0x31 */ OCARINA_ACTION_CHECK_NOWARP_DONE } OcarinaSongActionId; -typedef enum { +typedef enum OcarinaMode { /* 0x00 */ OCARINA_MODE_00, /* 0x01 */ OCARINA_MODE_01, /* 0x02 */ OCARINA_MODE_02, @@ -94,7 +94,7 @@ typedef enum { /* 0x0F */ OCARINA_MODE_0F } OcarinaMode; -typedef enum { +typedef enum OcarinaButtonIndex { /* 0 */ OCARINA_BTN_A, /* 1 */ OCARINA_BTN_C_DOWN, /* 2 */ OCARINA_BTN_C_RIGHT, @@ -106,7 +106,7 @@ typedef enum { // Uses scientific pitch notation relative to middle C // https://en.wikipedia.org/wiki/Scientific_pitch_notation -typedef enum { +typedef enum OcarinaPitch { /* 0x0 */ OCARINA_PITCH_C4, /* 0x1 */ OCARINA_PITCH_DFLAT4, /* 0x2 */ OCARINA_PITCH_D4, @@ -126,7 +126,7 @@ typedef enum { /* 0xFF */ OCARINA_PITCH_NONE = 0xFF } OcarinaPitch; -typedef enum { +typedef enum OcarinaInstrumentId { /* 0 */ OCARINA_INSTRUMENT_OFF, /* 1 */ OCARINA_INSTRUMENT_DEFAULT, /* 2 */ OCARINA_INSTRUMENT_MALON, @@ -139,7 +139,7 @@ typedef enum { /* 8 */ OCARINA_INSTRUMENT_DEFAULT_COPY2 = OCARINA_INSTRUMENT_MAX + 1 // Unused but present in Sequence 0 table } OcarinaInstrumentId; -typedef enum { +typedef enum OcarinaRecordingState { /* 0 */ OCARINA_RECORD_OFF, /* 1 */ OCARINA_RECORD_SCARECROW_LONG, /* 2 */ OCARINA_RECORD_SCARECROW_SPAWN, @@ -157,7 +157,7 @@ typedef enum { * 0x80 - BTN_R is pressed to raise note by a semitone */ -typedef struct { +typedef struct OcarinaNote { /* 0x0 */ u8 pitch; // number of semitones above middle C /* 0x2 */ u16 length; // number of frames the note is sustained /* 0x4 */ u8 volume; @@ -166,7 +166,7 @@ typedef struct { /* 0x7 */ u8 bFlat4Flag; // See note above } OcarinaNote; // size = 0x8 -typedef struct { +typedef struct OcarinaSongButtons { /* 0x0 */ u8 numButtons; /* 0x1 */ u8 buttonsIndex[8]; } OcarinaSongButtons; // size = 0x9 @@ -177,4 +177,15 @@ typedef struct OcarinaStaff { /* 0x2 */ u8 pos; // "locate" } OcarinaStaff; // size = 0x3 +void AudioOcarina_Start(u16 ocarinaFlags); +void AudioOcarina_SetInstrument(u8 ocarinaInstrumentId); +void AudioOcarina_SetPlaybackSong(s8 songIndexPlusOne, s8 playbackState); +void AudioOcarina_SetRecordingState(u8 recordingState); +OcarinaStaff* AudioOcarina_GetRecordingStaff(void); +OcarinaStaff* AudioOcarina_GetPlayingStaff(void); +OcarinaStaff* AudioOcarina_GetPlaybackStaff(void); +void AudioOcarina_MemoryGameInit(u8 minigameRound); +s32 AudioOcarina_MemoryGameNextNote(void); +void AudioOcarina_PlayLongScarecrowSong(void); + #endif diff --git a/include/z64olib.h b/include/z64olib.h new file mode 100644 index 0000000000..1b704b0e69 --- /dev/null +++ b/include/z64olib.h @@ -0,0 +1,17 @@ +#ifndef Z64OLIB_H +#define Z64OLIB_H + +#include "z64math.h" + +f32 OLib_Vec3fDist(Vec3f* a, Vec3f* b); +f32 OLib_Vec3fDistXZ(Vec3f* a, Vec3f* b); +f32 OLib_ClampMinDist(f32 val, f32 min); +f32 OLib_ClampMaxDist(f32 val, f32 max); +Vec3f OLib_Vec3fDistNormalize(Vec3f* a, Vec3f* b); +Vec3f OLib_VecGeoToVec3f(VecGeo* geo); +VecSph OLib_Vec3fToVecSph(Vec3f* vec); +VecGeo OLib_Vec3fToVecGeo(Vec3f* vec); +VecGeo OLib_Vec3fDiffToVecGeo(Vec3f* a, Vec3f* b); +Vec3f OLib_Vec3fDiffRad(Vec3f* a, Vec3f* b); + +#endif diff --git a/include/z64pause.h b/include/z64pause.h index a58bccccfa..f521499e9d 100644 --- a/include/z64pause.h +++ b/include/z64pause.h @@ -8,13 +8,14 @@ #include "config.h" struct OcarinaStaff; +struct PlayState; #define PAUSE_ITEM_NONE 999 #define PAUSE_CURSOR_PAGE_LEFT 10 #define PAUSE_CURSOR_PAGE_RIGHT 11 -typedef enum { +typedef enum PauseMenuPage { /* 0x00 */ PAUSE_ITEM, /* 0x01 */ PAUSE_MAP, /* 0x02 */ PAUSE_QUEST, @@ -55,7 +56,7 @@ typedef enum { #define PAUSE_EQUIP_BUFFER_SIZE sizeof(u16[PAUSE_EQUIP_PLAYER_HEIGHT][PAUSE_EQUIP_PLAYER_WIDTH]) #define PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE 0x5000 -typedef enum { +typedef enum PauseState { /* 0 */ PAUSE_STATE_OFF, /* 1 */ PAUSE_STATE_WAIT_LETTERBOX, // Request no letterboxing and wait for it. /* 2 */ PAUSE_STATE_WAIT_BG_PRERENDER, // Wait for the pause background prerender to be done. @@ -90,20 +91,69 @@ typedef enum { #endif // Sub-states of PAUSE_STATE_MAIN -typedef enum { +typedef enum PauseMainState { /* 0 */ PAUSE_MAIN_STATE_IDLE, /* 1 */ PAUSE_MAIN_STATE_SWITCHING_PAGE, - /* 2 */ PAUSE_MAIN_STATE_2, + /* 2 */ PAUSE_MAIN_STATE_SONG_PLAYBACK, // The song is being played back to the player. /* 3 */ PAUSE_MAIN_STATE_3, - /* 4 */ PAUSE_MAIN_STATE_4, - /* 5 */ PAUSE_MAIN_STATE_5, - /* 6 */ PAUSE_MAIN_STATE_6, + /* 4 */ PAUSE_MAIN_STATE_SONG_PROMPT_INIT, // Start the prompt for the player to play the song. + /* 5 */ PAUSE_MAIN_STATE_SONG_PROMPT, // Waiting for the player to play the song. + /* 6 */ PAUSE_MAIN_STATE_SONG_PROMPT_DONE, // The song prompt is done, the player either played the song successfully or made a mistake. /* 7 */ PAUSE_MAIN_STATE_7, - /* 8 */ PAUSE_MAIN_STATE_8, - /* 9 */ PAUSE_MAIN_STATE_9 + /* 8 */ PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG, // Like PAUSE_MAIN_STATE_IDLE, but the quest page is active and the cursor is positioned on a song. + /* 9 */ PAUSE_MAIN_STATE_SONG_PLAYBACK_START // Start playing the song back to the player. } PauseMainState; -typedef struct { +// Sub-states of PAUSE_STATE_SAVE_PROMPT +typedef enum PauseSavePromptState { + /* 0 */ PAUSE_SAVE_PROMPT_STATE_APPEARING, + /* 1 */ PAUSE_SAVE_PROMPT_STATE_WAIT_CHOICE, + /* 2 */ PAUSE_SAVE_PROMPT_STATE_CLOSING, + /* 3 */ PAUSE_SAVE_PROMPT_STATE_RETURN_TO_MENU, + /* 4 */ PAUSE_SAVE_PROMPT_STATE_SAVED, + /* 5 */ PAUSE_SAVE_PROMPT_STATE_CLOSING_AFTER_SAVED, + /* 6 */ PAUSE_SAVE_PROMPT_STATE_RETURN_TO_MENU_2 // unused +} PauseSavePromptState; + +typedef enum PauseCursorQuad { + /* 0 */ PAUSE_CURSOR_QUAD_TL, + /* 1 */ PAUSE_CURSOR_QUAD_TR, + /* 2 */ PAUSE_CURSOR_QUAD_BL, + /* 3 */ PAUSE_CURSOR_QUAD_BR, + /* 4 */ PAUSE_CURSOR_QUAD_4, + /* 5 */ PAUSE_CURSOR_QUAD_MAX +} PauseCursorQuad; + +typedef enum WorldMapPoint { + /* 0 */ WORLD_MAP_POINT_HAUNTED_WASTELAND, + /* 1 */ WORLD_MAP_POINT_GERUDOS_FORTRESS, + /* 2 */ WORLD_MAP_POINT_GERUDO_VALLEY, + /* 3 */ WORLD_MAP_POINT_LAKE_HYLIA, + /* 4 */ WORLD_MAP_POINT_LON_LON_RANCH, + /* 5 */ WORLD_MAP_POINT_MARKET, + /* 6 */ WORLD_MAP_POINT_HYRULE_FIELD, + /* 7 */ WORLD_MAP_POINT_DEATH_MOUNTAIN, + /* 8 */ WORLD_MAP_POINT_KAKARIKO_VILLAGE, + /* 9 */ WORLD_MAP_POINT_LOST_WOODS, + /* 10 */ WORLD_MAP_POINT_KOKIRI_FOREST, + /* 11 */ WORLD_MAP_POINT_ZORAS_DOMAIN, + /* 12 */ WORLD_MAP_POINT_MAX +} WorldMapPoint; + +#define TRADE_QUEST_MARKER_NONE 0xFF + +typedef enum WorldMapPointState { + /* 0 */ WORLD_MAP_POINT_STATE_HIDE, + /* 1 */ WORLD_MAP_POINT_STATE_SHOW, + /* 2 */ WORLD_MAP_POINT_STATE_HIGHLIGHT +} WorldMapPointState; + +// Values for PauseContext.pagesYOrigin1 and R_PAUSE_PAGES_Y_ORIGIN_2 respectively, +// that make the pause pages rotate around their lower edge instead of the middle. +#define PAUSE_PAGES_Y_ORIGIN_1_LOWER 80 // PAGE_BG_ROWS * PAGE_BG_QUAD_HEIGHT / 2 +#define PAUSE_PAGES_Y_ORIGIN_2_LOWER (s16)(-PAUSE_PAGES_Y_ORIGIN_1_LOWER * 0.78 * 100) + +typedef struct PauseContext { /* 0x0000 */ View view; /* 0x0128 */ u8* iconItemSegment; /* 0x012C */ u8* iconItem24Segment; @@ -122,7 +172,7 @@ typedef struct { /* 0x0160 */ char unk_160[0x04]; /* 0x0164 */ Vtx* questVtx; /* 0x0168 */ Vtx* cursorVtx; - /* 0x016C */ Vtx* saveVtx; + /* 0x016C */ Vtx* promptPageVtx; // Used by both the pause menu save prompt and the gameover prompt /* 0x0170 */ char unk_170[0x24]; /* 0x0194 */ struct OcarinaStaff* ocarinaStaff; /* 0x0198 */ char unk_198[0x20]; @@ -135,15 +185,15 @@ typedef struct { /* 0x01E6 */ u16 nextPageMode; // During a page switch, indicates the page before switching and the direction to scroll in. Value is `(2 * prev pageIndex) + (scroll left ? 1 : 0)` /* 0x01E8 */ u16 pageIndex; // "kscp_pos" /* 0x01EA */ u16 pageSwitchTimer; - /* 0x01EC */ u16 unk_1EC; - /* 0x01F0 */ f32 unk_1F0; - /* 0x01F4 */ f32 unk_1F4; - /* 0x01F8 */ f32 unk_1F8; - /* 0x01FC */ f32 unk_1FC; - /* 0x0200 */ f32 unk_200; - /* 0x0204 */ f32 unk_204; // "angle_s" + /* 0x01EC */ u16 savePromptState; + /* 0x01F0 */ f32 promptDepthOffset; // Offset position of the prompt away from the camera + /* 0x01F4 */ f32 itemPagePitch; // Rotation of the item page around its local horizontal/sideways axis + /* 0x01F8 */ f32 equipPagePitch; // Rotation of the equip page around its local horizontal/sideways axis + /* 0x01FC */ f32 mapPagePitch; // Rotation of the map page around its local horizontal/sideways axis + /* 0x0200 */ f32 questPagePitch; // Rotation of the quest page around its local horizontal/sideways axis + /* 0x0204 */ f32 promptPitch; // Rotation of the prompt around its local horizontal/sideways axis. "angle_s" /* 0x0208 */ u16 alpha; - /* 0x020A */ s16 offsetY; + /* 0x020A */ s16 pagesYOrigin1; /* 0x020C */ char unk_20C[0x08]; /* 0x0214 */ s16 stickAdjX; /* 0x0216 */ s16 stickAdjY; @@ -168,8 +218,8 @@ typedef struct { /* 0x0260 */ s16 cursorColorSet; // 0 = white; 4 = yellow; 8 = green /* 0x0262 */ s16 promptChoice; // save/continue choice: 0 = yes; 4 = no /* 0x0264 */ s16 ocarinaSongIdx; - /* 0x0266 */ u8 worldMapPoints[20]; // 0 = hidden; 1 = displayed; 2 = highlighted - /* 0x027A */ u8 tradeQuestLocation; + /* 0x0266 */ u8 worldMapPoints[20]; // indices: `WorldMapPoint` enum, values: `WorldMapPointState` enum + /* 0x027A */ u8 tradeQuestMarker; // Can be either a `WorldMapPoint` value or `TRADE_QUEST_MARKER_NONE` /* 0x027C */ SkelAnime playerSkelAnime; } PauseContext; // size = 0x2C0 @@ -187,12 +237,12 @@ typedef struct { #define PAUSE_MAP_MARK_CHEST 0 #define PAUSE_MAP_MARK_BOSS 1 -typedef struct { +typedef struct PauseMapMarkPoint { /* 0x00 */ s16 chestFlag; // chest icon is only displayed if this flag is not set for the current room, -1 for no flag /* 0x04 */ f32 x, y; // coordinates to place the icon (top-left corner) } PauseMapMarkPoint; // size = 0x0C -typedef struct { +typedef struct PauseMapMarkData { /* 0x00 */ s16 markType; // 0 for the chest icon, 1 for the boss skull icon, -1 for none /* 0x04 */ s32 unk_04; /* 0x08 */ const Vtx* vtx; @@ -203,4 +253,8 @@ typedef struct { typedef PauseMapMarkData PauseMapMarksData[3]; +void KaleidoSetup_Update(struct PlayState* play); +void KaleidoSetup_Init(struct PlayState* play); +void KaleidoSetup_Destroy(struct PlayState* play); + #endif diff --git a/include/z64play.h b/include/z64play.h index ae5882fcae..73e0248558 100644 --- a/include/z64play.h +++ b/include/z64play.h @@ -26,6 +26,7 @@ #include "z64view.h" union Color_RGBA8_u32; +struct Player; struct QuestHintCmd; struct VisMono; @@ -63,14 +64,14 @@ typedef struct PlayState { /* 0x10B20 */ AnimTaskQueue animTaskQueue; /* 0x117A4 */ ObjectContext objectCtx; /* 0x11CBC */ RoomContext roomCtx; - /* 0x11D34 */ TransitionActorContext transiActorCtx; - /* 0x11D3C */ void (*playerInit)(Player* player, struct PlayState* play, FlexSkeletonHeader* skelHeader); - /* 0x11D40 */ void (*playerUpdate)(Player* player, struct PlayState* play, Input* input); + /* 0x11D34 */ TransitionActorList transitionActors; + /* 0x11D3C */ void (*playerInit)(struct Player* player, struct PlayState* play, FlexSkeletonHeader* skelHeader); + /* 0x11D40 */ void (*playerUpdate)(struct Player* player, struct PlayState* play, Input* input); /* 0x11D44 */ int (*isPlayerDroppingFish)(struct PlayState* play); /* 0x11D48 */ s32 (*startPlayerFishing)(struct PlayState* play); - /* 0x11D4C */ s32 (*grabPlayer)(struct PlayState* play, Player* player); + /* 0x11D4C */ s32 (*grabPlayer)(struct PlayState* play, struct Player* player); /* 0x11D50 */ s32 (*tryPlayerCsAction)(struct PlayState* play, Actor* actor, s32 csAction); - /* 0x11D54 */ void (*func_11D54)(Player* player, struct PlayState* play); + /* 0x11D54 */ void (*func_11D54)(struct Player* player, struct PlayState* play); /* 0x11D58 */ s32 (*damagePlayer)(struct PlayState* play, s32 damage); /* 0x11D5C */ void (*talkWithPlayer)(struct PlayState* play, Actor* actor); /* 0x11D60 */ MtxF viewProjectionMtxF; @@ -81,8 +82,7 @@ typedef struct PlayState { /* 0x11DE9 */ u8 haltAllActors; /* 0x11DEA */ u8 spawn; /* 0x11DEB */ u8 numActorEntries; - /* 0x11DEC */ u8 numRooms; - /* 0x11DF0 */ RomFile* roomList; + /* 0x11DEC */ RoomList roomList; /* 0x11DF4 */ ActorEntry* playerEntry; /* 0x11DF8 */ ActorEntry* actorEntryList; /* 0x11DFC */ void* unk_11DFC; @@ -140,7 +140,7 @@ s32 Play_SetCameraAtEyeUp(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye, Vec s32 Play_SetCameraFov(PlayState* this, s16 camId, f32 fov); s32 Play_SetCameraRoll(PlayState* this, s16 camId, s16 roll); 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, struct Player* player, s16 setting); s32 Play_RequestCameraSetting(PlayState* this, s16 camId, s16 setting); void Play_ReturnToMainCam(PlayState* this, s16 camId, s16 duration); void Play_SaveSceneFlags(PlayState* this); diff --git a/include/z64player.h b/include/z64player.h index bc44fb1244..3f48d07e6d 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -7,7 +7,7 @@ struct Player; -typedef enum { +typedef enum PlayerSword { /* 0 */ PLAYER_SWORD_NONE, /* 1 */ PLAYER_SWORD_KOKIRI, /* 2 */ PLAYER_SWORD_MASTER, @@ -15,7 +15,7 @@ typedef enum { /* 4 */ PLAYER_SWORD_MAX } PlayerSword; -typedef enum { +typedef enum PlayerShield { /* 0x00 */ PLAYER_SHIELD_NONE, /* 0x01 */ PLAYER_SHIELD_DEKU, /* 0x02 */ PLAYER_SHIELD_HYLIAN, @@ -23,14 +23,14 @@ typedef enum { /* 0x04 */ PLAYER_SHIELD_MAX } PlayerShield; -typedef enum { +typedef enum PlayerTunic { /* 0x00 */ PLAYER_TUNIC_KOKIRI, /* 0x01 */ PLAYER_TUNIC_GORON, /* 0x02 */ PLAYER_TUNIC_ZORA, /* 0x03 */ PLAYER_TUNIC_MAX } PlayerTunic; -typedef enum { +typedef enum PlayerBoots { /* 0x00 */ PLAYER_BOOTS_KOKIRI, /* 0x01 */ PLAYER_BOOTS_IRON, /* 0x02 */ PLAYER_BOOTS_HOVER, @@ -41,7 +41,7 @@ typedef enum { /* 0x06 */ PLAYER_BOOTS_MAX } PlayerBoots; -typedef enum { +typedef enum PlayerStrength { /* 0x00 */ PLAYER_STR_NONE, /* 0x01 */ PLAYER_STR_BRACELET, /* 0x02 */ PLAYER_STR_SILVER_G, @@ -49,7 +49,7 @@ typedef enum { /* 0x04 */ PLAYER_STR_MAX } PlayerStrength; -typedef enum { +typedef enum PlayerMask { /* 0x00 */ PLAYER_MASK_NONE, /* 0x01 */ PLAYER_MASK_KEATON, /* 0x02 */ PLAYER_MASK_SKULL, @@ -62,7 +62,7 @@ typedef enum { /* 0x09 */ PLAYER_MASK_MAX } PlayerMask; -typedef enum { +typedef enum PlayerEnvHazard { /* 0x0 */ PLAYER_ENV_HAZARD_NONE, /* 0x1 */ PLAYER_ENV_HAZARD_HOTROOM, /* 0x2 */ PLAYER_ENV_HAZARD_UNDERWATER_FLOOR, @@ -70,9 +70,15 @@ typedef enum { /* 0x4 */ PLAYER_ENV_HAZARD_UNDERWATER_FREE } PlayerEnvHazard; -typedef enum { +typedef enum PlayerIdleType { + /* -0x1 */ PLAYER_IDLE_CRIT_HEALTH = -1, + /* 0x0 */ PLAYER_IDLE_DEFAULT, + /* 0x1 */ PLAYER_IDLE_FIDGET +} PlayerIdleType; + +typedef enum PlayerItemAction { /* 0x00 */ PLAYER_IA_NONE, - /* 0x01 */ PLAYER_IA_SWORD_CS, // Hold sword without shield in hand. The sword is not useable. + /* 0x01 */ PLAYER_IA_SWORD_CS, // Hold sword without shield in hand. The sword is not usable. /* 0x02 */ PLAYER_IA_FISHING_POLE, /* 0x03 */ PLAYER_IA_SWORD_MASTER, /* 0x04 */ PLAYER_IA_SWORD_KOKIRI, @@ -141,7 +147,7 @@ typedef enum { /* 0x43 */ PLAYER_IA_MAX } PlayerItemAction; -typedef enum { +typedef enum PlayerLimb { /* 0x00 */ PLAYER_LIMB_NONE, /* 0x01 */ PLAYER_LIMB_ROOT, /* 0x02 */ PLAYER_LIMB_WAIST, @@ -167,7 +173,7 @@ typedef enum { /* 0x16 */ PLAYER_LIMB_MAX } PlayerLimb; -typedef enum { +typedef enum PlayerBodyPart { /* 0x00 */ PLAYER_BODYPART_WAIST, // PLAYER_LIMB_WAIST /* 0x01 */ PLAYER_BODYPART_R_THIGH, // PLAYER_LIMB_R_THIGH /* 0x02 */ PLAYER_BODYPART_R_SHIN, // PLAYER_LIMB_R_SHIN @@ -189,7 +195,7 @@ typedef enum { /* 0x12 */ PLAYER_BODYPART_MAX } PlayerBodyPart; -typedef enum { +typedef enum PlayerMeleeWeaponAnimation { /* 0 */ PLAYER_MWA_FORWARD_SLASH_1H, /* 1 */ PLAYER_MWA_FORWARD_SLASH_2H, /* 2 */ PLAYER_MWA_FORWARD_COMBO_1H, @@ -221,7 +227,7 @@ typedef enum { /* 28 */ PLAYER_MWA_MAX } PlayerMeleeWeaponAnimation; -typedef enum { +typedef enum PlayerDoorType { /* -1 */ PLAYER_DOORTYPE_AJAR = -1, /* 0 */ PLAYER_DOORTYPE_NONE, /* 1 */ PLAYER_DOORTYPE_HANDLE, @@ -229,13 +235,13 @@ typedef enum { /* 3 */ PLAYER_DOORTYPE_FAKE } PlayerDoorType; -typedef enum { +typedef enum PlayerFacePart { /* 0 */ PLAYER_FACEPART_EYES, /* 1 */ PLAYER_FACEPART_MOUTH, /* 2 */ PLAYER_FACEPART_MAX } PlayerFacePart; -typedef enum { +typedef enum PlayerEyes { /* 0 */ PLAYER_EYES_OPEN, /* 1 */ PLAYER_EYES_HALF, /* 2 */ PLAYER_EYES_CLOSED, @@ -247,7 +253,7 @@ typedef enum { /* 8 */ PLAYER_EYES_MAX } PlayerEyes; -typedef enum { +typedef enum PlayerMouth { /* 0 */ PLAYER_MOUTH_CLOSED, /* 1 */ PLAYER_MOUTH_HALF, /* 2 */ PLAYER_MOUTH_OPEN, @@ -255,7 +261,7 @@ typedef enum { /* 4 */ PLAYER_MOUTH_MAX } PlayerMouth; -typedef enum { +typedef enum PlayerFace { /* 0 */ PLAYER_FACE_NEUTRAL, // eyes open and mouth closed /* 1 */ PLAYER_FACE_NEUTRAL_BLINKING_HALF, // eyes half open and mouth closed /* 2 */ PLAYER_FACE_NEUTRAL_BLINKING_CLOSED, // eyes and mouth closed @@ -275,7 +281,7 @@ typedef enum { /* 16 */ PLAYER_FACE_MAX } PlayerFace; -typedef enum { +typedef enum PlayerModelGroup { /* 0x00 */ PLAYER_MODELGROUP_0, // unused (except for a bug in `Player_OverrideLimbDrawPause`) /* 0x01 */ PLAYER_MODELGROUP_CHILD_HYLIAN_SHIELD, //hold sword only. used for holding sword only as child link with hylian shield equipped /* 0x02 */ PLAYER_MODELGROUP_SWORD_AND_SHIELD, // hold sword and shield or just sword if no shield is equipped @@ -295,7 +301,7 @@ typedef enum { /* 0x10 */ PLAYER_MODELGROUP_MAX } PlayerModelGroup; -typedef enum { +typedef enum PlayerModelGroupEntry { /* 0x00 */ PLAYER_MODELGROUPENTRY_ANIM, /* 0x01 */ PLAYER_MODELGROUPENTRY_LEFT_HAND, /* 0x02 */ PLAYER_MODELGROUPENTRY_RIGHT_HAND, @@ -304,7 +310,7 @@ typedef enum { /* 0x05 */ PLAYER_MODELGROUPENTRY_MAX } PlayerModelGroupEntry; -typedef enum { +typedef enum PlayerModelType { // left hand /* 0x00 */ PLAYER_MODELTYPE_LH_OPEN, // empty open hand /* 0x01 */ PLAYER_MODELTYPE_LH_CLOSED, // empty closed hand @@ -334,7 +340,7 @@ typedef enum { /* 0xFF */ PLAYER_MODELTYPE_RH_FF = 0xFF // disable shield collider, cutscene-specific } PlayerModelType; -typedef enum { +typedef enum PlayerAnimType { /* 0x00 */ PLAYER_ANIMTYPE_0, /* 0x01 */ PLAYER_ANIMTYPE_1, /* 0x02 */ PLAYER_ANIMTYPE_2, @@ -347,7 +353,7 @@ typedef enum { /** * Temporary names, derived from original animation names in `D_80853914` */ -typedef enum { +typedef enum PlayerAnimGroup { /* 0x00 */ PLAYER_ANIMGROUP_wait, /* 0x01 */ PLAYER_ANIMGROUP_walk, /* 0x02 */ PLAYER_ANIMGROUP_run, @@ -399,7 +405,7 @@ typedef enum { #define LIMB_BUF_COUNT(limbCount) ((ALIGN16((limbCount) * sizeof(Vec3s)) + sizeof(Vec3s) - 1) / sizeof(Vec3s)) #define PLAYER_LIMB_BUF_COUNT LIMB_BUF_COUNT(PLAYER_LIMB_MAX) -typedef enum { +typedef enum PlayerCsAction { /* 0x00 */ PLAYER_CSACTION_NONE, /* 0x01 */ PLAYER_CSACTION_1, /* 0x02 */ PLAYER_CSACTION_2, @@ -506,7 +512,7 @@ typedef enum { /* 0x67 */ PLAYER_CSACTION_MAX } PlayerCsAction; -typedef enum { +typedef enum PlayerCueId { /* 0x00 */ PLAYER_CUEID_NONE, /* 0x01 */ PLAYER_CUEID_1, /* 0x02 */ PLAYER_CUEID_2, @@ -588,7 +594,7 @@ typedef enum { /* 0x4E */ PLAYER_CUEID_MAX } PlayerCueId; -typedef enum { +typedef enum PlayerLedgeClimbType { /* 0 */ PLAYER_LEDGE_CLIMB_NONE, /* 1 */ PLAYER_LEDGE_CLIMB_1, /* 2 */ PLAYER_LEDGE_CLIMB_2, @@ -596,7 +602,7 @@ typedef enum { /* 4 */ PLAYER_LEDGE_CLIMB_4 } PlayerLedgeClimbType; -typedef enum { +typedef enum PlayerStickDirection { /* -1 */ PLAYER_STICK_DIR_NONE = -1, /* 0 */ PLAYER_STICK_DIR_FORWARD, /* 1 */ PLAYER_STICK_DIR_LEFT, @@ -604,7 +610,22 @@ typedef enum { /* 3 */ PLAYER_STICK_DIR_RIGHT } PlayerStickDirection; -typedef struct { +typedef enum { + /* 0 */ PLAYER_KNOCKBACK_NONE, // No knockback + /* 1 */ PLAYER_KNOCKBACK_SMALL, // A small hop, remains standing up + /* 2 */ PLAYER_KNOCKBACK_LARGE, // Sent flying in the air and lands laying down on the floor + /* 3 */ PLAYER_KNOCKBACK_LARGE_SHOCK // Same as`PLAYER_KNOCKBACK_LARGE` with a shock effect +} PlayerKnockbackType; + +typedef enum { + /* 0 */ PLAYER_HIT_RESPONSE_NONE, + /* 1 */ PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE, + /* 2 */ PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL, + /* 3 */ PLAYER_HIT_RESPONSE_ICE_TRAP, + /* 4 */ PLAYER_HIT_RESPONSE_ELECTRIC_SHOCK +} PlayerDamageResponseType; + +typedef struct PlayerAgeProperties { /* 0x00 */ f32 ceilingCheckHeight; /* 0x04 */ f32 unk_04; /* 0x08 */ f32 unk_08; @@ -640,7 +661,7 @@ typedef struct { /* 0xCC */ LinkAnimationHeader* unk_CC[2]; } PlayerAgeProperties; // size = 0xD4 -typedef struct { +typedef struct WeaponInfo { /* 0x00 */ s32 active; /* 0x04 */ Vec3f tip; /* 0x10 */ Vec3f base; @@ -649,40 +670,40 @@ typedef struct { #define LEDGE_DIST_MAX 399.96002f #define PLAYER_STATE1_0 (1 << 0) -#define PLAYER_STATE1_SWINGING_BOTTLE (1 << 1) +#define PLAYER_STATE1_SWINGING_BOTTLE (1 << 1) // Bottle is swung; Bottle is active and can catch things #define PLAYER_STATE1_2 (1 << 2) #define PLAYER_STATE1_3 (1 << 3) -#define PLAYER_STATE1_4 (1 << 4) +#define PLAYER_STATE1_HOSTILE_LOCK_ON (1 << 4) // Currently locked onto a hostile actor. Triggers a "battle" variant of many actions. #define PLAYER_STATE1_5 (1 << 5) -#define PLAYER_STATE1_6 (1 << 6) -#define PLAYER_STATE1_7 (1 << 7) -#define PLAYER_STATE1_START_CHANGING_HELD_ITEM (1 << 8) +#define PLAYER_STATE1_TALKING (1 << 6) // Currently talking to an actor. This includes item exchanges. +#define PLAYER_STATE1_DEAD (1 << 7) // Player has died. Note that this gets set when the death cutscene has started, after landing from the air. +#define PLAYER_STATE1_START_CHANGING_HELD_ITEM (1 << 8) // Item change process has begun #define PLAYER_STATE1_9 (1 << 9) #define PLAYER_STATE1_10 (1 << 10) -#define PLAYER_STATE1_11 (1 << 11) -#define PLAYER_STATE1_12 (1 << 12) +#define PLAYER_STATE1_CARRYING_ACTOR (1 << 11) // Currently carrying an actor +#define PLAYER_STATE1_CHARGING_SPIN_ATTACK (1 << 12) // Currently charing a spin attack (by holding down the B button) #define PLAYER_STATE1_13 (1 << 13) #define PLAYER_STATE1_14 (1 << 14) -#define PLAYER_STATE1_15 (1 << 15) -#define PLAYER_STATE1_16 (1 << 16) -#define PLAYER_STATE1_17 (1 << 17) +#define PLAYER_STATE1_Z_TARGETING (1 << 15) // Either lock-on or parallel is active. This flag is never checked for and is practically unused. +#define PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS (1 << 16) // Currently focusing on a friendly actor. Includes friendly lock-on, talking, and more. Usually does not include hostile actor lock-on, see `PLAYER_STATE1_HOSTILE_LOCK_ON`. +#define PLAYER_STATE1_PARALLEL (1 << 17) // "Parallel" mode, Z-Target without an actor lock-on #define PLAYER_STATE1_18 (1 << 18) #define PLAYER_STATE1_19 (1 << 19) #define PLAYER_STATE1_20 (1 << 20) #define PLAYER_STATE1_21 (1 << 21) #define PLAYER_STATE1_22 (1 << 22) #define PLAYER_STATE1_23 (1 << 23) -#define PLAYER_STATE1_24 (1 << 24) -#define PLAYER_STATE1_25 (1 << 25) +#define PLAYER_STATE1_USING_BOOMERANG (1 << 24) // Currently using the boomerang. This includes all phases (aiming, throwing, and catching). +#define PLAYER_STATE1_BOOMERANG_THROWN (1 << 25) // Boomerang has been thrown and is flying in the air #define PLAYER_STATE1_26 (1 << 26) #define PLAYER_STATE1_27 (1 << 27) #define PLAYER_STATE1_28 (1 << 28) #define PLAYER_STATE1_29 (1 << 29) -#define PLAYER_STATE1_30 (1 << 30) +#define PLAYER_STATE1_LOCK_ON_FORCED_TO_RELEASE (1 << 30) // Lock-on was released automatically, for example by leaving the lock-on leash range #define PLAYER_STATE1_31 (1 << 31) #define PLAYER_STATE2_0 (1 << 0) -#define PLAYER_STATE2_1 (1 << 1) +#define PLAYER_STATE2_CAN_ACCEPT_TALK_OFFER (1 << 1) // Can accept a talk offer. "Speak" or "Check" is shown on the A button. #define PLAYER_STATE2_2 (1 << 2) #define PLAYER_STATE2_3 (1 << 3) #define PLAYER_STATE2_4 (1 << 4) @@ -690,18 +711,18 @@ typedef struct { #define PLAYER_STATE2_6 (1 << 6) #define PLAYER_STATE2_7 (1 << 7) #define PLAYER_STATE2_8 (1 << 8) -#define PLAYER_STATE2_FORCE_SAND_FLOOR_SOUND (1 << 9) +#define PLAYER_STATE2_FORCE_SAND_FLOOR_SOUND (1 << 9) // Forces sand footstep sounds regardless of current floor type #define PLAYER_STATE2_10 (1 << 10) #define PLAYER_STATE2_11 (1 << 11) #define PLAYER_STATE2_12 (1 << 12) -#define PLAYER_STATE2_13 (1 << 13) +#define PLAYER_STATE2_LOCK_ON_WITH_SWITCH (1 << 13) // Actor lock-on is active, specifically with Switch Targeting. Hold Targeting checks the state of the Z button instead of this flag. #define PLAYER_STATE2_14 (1 << 14) #define PLAYER_STATE2_15 (1 << 15) -#define PLAYER_STATE2_DO_ACTION_ENTER (1 << 16) // Turns on the "Enter On A" DoAction +#define PLAYER_STATE2_DO_ACTION_ENTER (1 << 16) // Sets the "Enter On A" DoAction #define PLAYER_STATE2_17 (1 << 17) #define PLAYER_STATE2_CRAWLING (1 << 18) // Crawling through a crawlspace #define PLAYER_STATE2_19 (1 << 19) -#define PLAYER_STATE2_20 (1 << 20) +#define PLAYER_STATE2_NAVI_ACTIVE (1 << 20) // Navi is visible and active. Could be hovering idle near Link or hovering over other actors. #define PLAYER_STATE2_21 (1 << 21) #define PLAYER_STATE2_22 (1 << 22) #define PLAYER_STATE2_23 (1 << 23) @@ -709,7 +730,7 @@ typedef struct { #define PLAYER_STATE2_25 (1 << 25) #define PLAYER_STATE2_26 (1 << 26) #define PLAYER_STATE2_27 (1 << 27) -#define PLAYER_STATE2_28 (1 << 28) +#define PLAYER_STATE2_IDLE_FIDGET (1 << 28) // Playing a fidget idle animation (under typical circumstances, see `Player_ChooseNextIdleAnim` for more info) #define PLAYER_STATE2_29 (1 << 29) #define PLAYER_STATE2_30 (1 << 30) #define PLAYER_STATE2_31 (1 << 31) @@ -721,7 +742,7 @@ typedef struct { #define PLAYER_STATE3_4 (1 << 4) #define PLAYER_STATE3_5 (1 << 5) #define PLAYER_STATE3_RESTORE_NAYRUS_LOVE (1 << 6) // Set by ocarina effects actors when destroyed to signal Nayru's Love may be restored (see `ACTOROVL_ALLOC_ABSOLUTE`) -#define PLAYER_STATE3_7 (1 << 7) +#define PLAYER_STATE3_FLYING_WITH_HOOKSHOT (1 << 7) // Flying in the air with the hookshot as it pulls Player toward its destination #define PLAYER_ALLOC_GI_MIN 0x2880 // title card maximum file size @@ -729,6 +750,16 @@ typedef void (*PlayerActionFunc)(struct Player*, struct PlayState*); typedef s32 (*UpperActionFunc)(struct Player*, struct PlayState*); typedef void (*AfterPutAwayFunc)(struct PlayState*, struct Player*); +#define UNK6AE_ROT_FOCUS_X (1 << 0) +#define UNK6AE_ROT_FOCUS_Y (1 << 1) +#define UNK6AE_ROT_FOCUS_Z (1 << 2) +#define UNK6AE_ROT_HEAD_X (1 << 3) +#define UNK6AE_ROT_HEAD_Y (1 << 4) +#define UNK6AE_ROT_HEAD_Z (1 << 5) +#define UNK6AE_ROT_UPPER_X (1 << 6) +#define UNK6AE_ROT_UPPER_Y (1 << 7) +#define UNK6AE_ROT_UPPER_Z (1 << 8) + typedef struct Player { /* 0x0000 */ Actor actor; /* 0x014C */ s8 currentTunic; // current tunic from `PlayerTunic` @@ -797,15 +828,15 @@ typedef struct Player { /* 0x0498 */ ColliderCylinder cylinder; /* 0x04E4 */ ColliderQuad meleeWeaponQuads[2]; /* 0x05E4 */ ColliderQuad shieldQuad; - /* 0x0664 */ Actor* unk_664; + /* 0x0664 */ Actor* focusActor; // Actor that Player and the camera are looking at; Used for lock-on, talking, and more /* 0x0668 */ char unk_668[0x004]; - /* 0x066C */ s32 unk_66C; + /* 0x066C */ s32 zTargetActiveTimer; // Non-zero values indicate Z-Targeting should update; Values under 5 indicate lock-on is releasing /* 0x0670 */ s32 meleeWeaponEffectIndex; /* 0x0674 */ PlayerActionFunc actionFunc; /* 0x0678 */ PlayerAgeProperties* ageProperties; /* 0x067C */ u32 stateFlags1; /* 0x0680 */ u32 stateFlags2; - /* 0x0684 */ Actor* unk_684; + /* 0x0684 */ Actor* autoLockOnActor; // Actor that is locked onto automatically without player input; see `Player_SetAutoLockOnActor` /* 0x0688 */ Actor* boomerangActor; /* 0x068C */ Actor* naviActor; /* 0x0690 */ s16 naviTextId; @@ -817,17 +848,13 @@ typedef struct Player { /* 0x06A0 */ f32 unk_6A0; /* 0x06A4 */ f32 closestSecretDistSq; /* 0x06A8 */ Actor* unk_6A8; - /* 0x06AC */ s8 unk_6AC; + /* 0x06AC */ s8 idleType; /* 0x06AD */ u8 unk_6AD; - /* 0x06AE */ u16 unk_6AE; - /* 0x06B0 */ s16 unk_6B0; + /* 0x06AE */ u16 unk_6AE_rotFlags; // See `UNK6AE_ROT_` macros. If its flag isn't set, a rot steps to 0. + /* 0x06B0 */ s16 upperLimbYawSecondary; /* 0x06B2 */ char unk_6B4[0x004]; - /* 0x06B6 */ s16 unk_6B6; - /* 0x06B8 */ s16 unk_6B8; - /* 0x06BA */ s16 unk_6BA; - /* 0x06BC */ s16 unk_6BC; - /* 0x06BE */ s16 unk_6BE; - /* 0x06C0 */ s16 unk_6C0; + /* 0x06B6 */ Vec3s headLimbRot; + /* 0x06BC */ Vec3s upperLimbRot; /* 0x06C2 */ s16 unk_6C2; /* 0x06C4 */ f32 unk_6C4; /* 0x06C8 */ SkelAnime upperSkelAnime; @@ -837,10 +864,10 @@ typedef struct Player { /* 0x0830 */ f32 upperAnimInterpWeight; /* 0x0834 */ s16 unk_834; /* 0x0836 */ s8 unk_836; - /* 0x0837 */ u8 unk_837; + /* 0x0837 */ u8 putAwayCooldownTimer; /* 0x0838 */ f32 speedXZ; // Controls horizontal speed, used for `actor.speed`. Current or target value depending on context. /* 0x083C */ s16 yaw; // General yaw value, used both for world and shape rotation. Current or target value depending on context. - /* 0x083E */ s16 zTargetYaw; // yaw relating to Z targeting/"parallel" mode + /* 0x083E */ s16 parallelYaw; // yaw in "parallel" mode, Z-Target without an actor lock-on /* 0x0840 */ u16 underwaterTimer; /* 0x0842 */ s8 meleeWeaponAnimation; /* 0x0843 */ s8 meleeWeaponState; @@ -852,10 +879,16 @@ typedef struct Player { /* 0x084F */ union { s8 actionVar1; + s8 facingUpSlope; // Player_Action_SlideOnSlope: facing uphill when sliding on a slope + s8 bottleCatchType; // Player_Action_SwingBottle: entry type for `sBottleCatchInfo`, corresponds to actor caught in a bottle } av1; // "Action Variable 1": context dependent variable that has different meanings depending on what action is currently running /* 0x0850 */ union { s16 actionVar2; + s16 fallDamageStunTimer; // Player_Action_Idle: Prevents any movement and shakes model up and down quickly to indicate fall damage stun + s16 bonked; // Player_Action_Roll: set to true after bonking into a wall or an actor + s16 startedTextbox; // Player_Action_SwingBottle: set to true when the textbox is started + s16 inWater; // Player_Action_SwingBottle: true if a bottle is swung in water. Used to determine which bottle swing animation to use. } av2; // "Action Variable 2": context dependent variable that has different meanings depending on what action is currently running /* 0x0854 */ f32 unk_854; @@ -870,14 +903,14 @@ typedef struct Player { /* 0x0874 */ f32 unk_874; /* 0x0878 */ f32 unk_878; /* 0x087C */ s16 unk_87C; - /* 0x087E */ s16 unk_87E; + /* 0x087E */ s16 turnRate; // Amount angle is changed every frame when turning in place /* 0x0880 */ f32 unk_880; /* 0x0884 */ f32 yDistToLedge; // y distance to ground above an interact wall. LEDGE_DIST_MAX if no ground is found /* 0x0888 */ f32 distToInteractWall; // xyz distance to the interact wall /* 0x088C */ u8 ledgeClimbType; /* 0x088D */ u8 ledgeClimbDelayTimer; - /* 0x088E */ u8 unk_88E; - /* 0x088F */ u8 unk_88F; + /* 0x088E */ u8 textboxBtnCooldownTimer; // Prevents usage of A/B/C-up when counting down + /* 0x088F */ u8 damageFlickerAnimCounter; // Used to flicker Link after taking damage /* 0x0890 */ u8 unk_890; /* 0x0891 */ u8 bodyShockTimer; /* 0x0892 */ u8 unk_892; @@ -888,11 +921,11 @@ typedef struct Player { /* 0x089A */ s16 floorPitchAlt; // the calculation for this value is bugged and doesn't represent anything meaningful /* 0x089C */ s16 unk_89C; /* 0x089E */ u16 floorSfxOffset; - /* 0x08A0 */ u8 unk_8A0; - /* 0x08A1 */ u8 unk_8A1; - /* 0x08A2 */ s16 unk_8A2; - /* 0x08A4 */ f32 unk_8A4; - /* 0x08A8 */ f32 unk_8A8; + /* 0x08A0 */ u8 knockbackDamage; + /* 0x08A1 */ u8 knockbackType; + /* 0x08A2 */ s16 knockbackRot; + /* 0x08A4 */ f32 knockbackSpeed; + /* 0x08A8 */ f32 knockbackYVelocity; /* 0x08AC */ f32 pushedSpeed; // Pushing player, examples include water currents, floor conveyors, climbing sloped surfaces /* 0x08B0 */ s16 pushedYaw; // Yaw direction of player being pushed /* 0x08B4 */ WeaponInfo meleeWeaponInfo[3]; @@ -903,7 +936,7 @@ typedef struct Player { /* 0x0A61 */ u8 bodyFlameTimers[PLAYER_BODYPART_MAX]; // one flame per body part /* 0x0A73 */ u8 unk_A73; /* 0x0A74 */ AfterPutAwayFunc afterPutAwayFunc; // See `Player_SetupWaitForPutAway` and `Player_Action_WaitForPutAway` - /* 0x0A78 */ s8 invincibilityTimer; // prevents damage when nonzero (positive = visible, counts towards zero each frame) + /* 0x0A78 */ s8 invincibilityTimer; // prevents damage when nonzero. Positive values are intangibility, negative are invulnerability /* 0x0A79 */ u8 floorTypeTimer; // counts up every frame the current floor type is the same as the last frame /* 0x0A7A */ u8 floorProperty; /* 0x0A7B */ u8 prevFloorType; @@ -916,4 +949,71 @@ typedef struct Player { /* 0x0A88 */ Vec3f unk_A88; // previous body part 0 position } Player; // size = 0xA94 +// z_player_lib.c +void Player_SetBootData(struct PlayState* play, Player* this); +int Player_InBlockingCsMode(struct PlayState* play, Player* this); +int Player_InCsMode(struct PlayState* play); +s32 Player_CheckHostileLockOn(Player* this); +int Player_IsChildWithHylianShield(Player* this); +s32 Player_ActionToModelGroup(Player* this, s32 itemAction); +void Player_SetModelsForHoldingShield(Player* this); +void Player_SetModels(Player* this, s32 modelGroup); +void Player_SetModelGroup(Player* this, s32 modelGroup); +void func_8008EC70(Player* this); +void Player_SetEquipmentData(struct PlayState* play, Player* this); +void Player_UpdateBottleHeld(struct PlayState* play, Player* this, s32 item, s32 itemAction); +void Player_ReleaseLockOn(Player* this); +void Player_ClearZTargeting(Player* this); +void Player_SetAutoLockOnActor(struct PlayState* play, Actor* actor); +s32 func_8008EF44(struct PlayState* play, s32 ammo); +int Player_IsBurningStickInRange(struct PlayState* play, Vec3f* pos, f32 xzRange, f32 yRange); +s32 Player_GetStrength(void); +u8 Player_GetMask(struct PlayState* play); +Player* Player_UnsetMask(struct PlayState* play); +s32 Player_HasMirrorShieldEquipped(struct PlayState* play); +int Player_HasMirrorShieldSetToDraw(struct PlayState* play); +s32 Player_ActionToMagicSpell(Player* this, s32 itemAction); +int Player_HoldsHookshot(Player* this); +int func_8008F128(Player* this); +s32 Player_ActionToMeleeWeapon(s32 itemAction); +s32 Player_GetMeleeWeaponHeld(Player* this); +s32 Player_HoldsTwoHandedWeapon(Player* this); +int Player_HoldsBrokenKnife(Player* this); +s32 Player_ActionToBottle(Player* this, s32 itemAction); +s32 Player_GetBottleHeld(Player* this); +s32 Player_ActionToExplosive(Player* this, s32 itemAction); +s32 Player_GetExplosiveHeld(Player* this); +s32 func_8008F2BC(Player* this, s32 itemAction); +s32 Player_GetEnvironmentalHazard(struct PlayState* play); +void Player_DrawImpl(struct PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, s32 tunic, + s32 boots, s32 face, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, + void* data); +s32 Player_OverrideLimbDrawGameplayCommon(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, + void* thisx); +s32 Player_OverrideLimbDrawGameplayDefault(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, + void* thisx); +s32 Player_OverrideLimbDrawGameplayFirstPerson(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, + Vec3s* rot, void* thisx); +s32 Player_OverrideLimbDrawGameplayCrawling(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, + void* thisx); +u8 func_80090480(struct PlayState* play, ColliderQuad* collider, WeaponInfo* weaponInfo, Vec3f* newTip, Vec3f* newBase); +void Player_DrawGetItem(struct PlayState* play, Player* this); +void Player_PostLimbDrawGameplay(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx); +u32 Player_InitPauseDrawData(struct PlayState* play, u8* segment, SkelAnime* skelAnime); +void Player_DrawPause(struct PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot, f32 scale, + s32 sword, s32 tunic, s32 shield, s32 boots); + +// z_player_lib.c +extern FlexSkeletonHeader* gPlayerSkelHeaders[2]; +extern u8 gPlayerModelTypes[PLAYER_MODELGROUP_MAX][PLAYER_MODELGROUPENTRY_MAX]; +extern Gfx* gPlayerLeftHandBgsDLs[]; +extern Gfx* gPlayerLeftHandOpenDLs[]; +extern Gfx* gPlayerLeftHandClosedDLs[]; +extern Gfx* gPlayerLeftHandBoomerangDLs[]; +extern Gfx gCullBackDList[]; +extern Gfx gCullFrontDList[]; + +// object_table.c +extern s16 gLinkObjectIds[2]; + #endif diff --git a/include/z64save.h b/include/z64save.h index e6012c0a40..c5eac00270 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -2,9 +2,11 @@ #define Z64SAVE_H #include "ultra64.h" +#include "versions.h" +#include "z64inventory.h" #include "z64math.h" -typedef enum { +typedef enum Language { #if OOT_NTSC /* 0 */ LANGUAGE_JPN, /* 1 */ LANGUAGE_ENG, @@ -19,7 +21,7 @@ typedef enum { // `_FORCE` means that this request will respond to `forceRisingButtonAlphas`. // If set, the buttons will also raise alphas but will also account for disabled buttons -typedef enum { +typedef enum HudVisibilityMode { /* 0 */ HUD_VISIBILITY_NO_CHANGE, /* 1 */ HUD_VISIBILITY_NOTHING, /* 2 */ HUD_VISIBILITY_NOTHING_ALT, // Identical to HUD_VISIBILITY_NOTHING @@ -38,7 +40,7 @@ typedef enum { /* 52 */ HUD_VISIBILITY_NOTHING_INSTANT = 52 } HudVisibilityMode; -typedef enum { +typedef enum MagicState { /* 0x0 */ MAGIC_STATE_IDLE, // Regular gameplay /* 0x1 */ MAGIC_STATE_CONSUME_SETUP, // Sets the speed at which magic border flashes /* 0x2 */ MAGIC_STATE_CONSUME, // Consume magic until target is reached or no more magic is available @@ -52,7 +54,7 @@ typedef enum { /* 0xA */ MAGIC_STATE_ADD // Add requested magic } MagicState; -typedef enum { +typedef enum MagicChangeType { /* 0 */ MAGIC_CONSUME_NOW, // Consume Magic immediately without preview /* 1 */ MAGIC_CONSUME_WAIT_NO_PREVIEW, // Sets consume target but waits to consume. No yellow magic preview to target consumption. Unused /* 2 */ MAGIC_CONSUME_NOW_ALT, // Identical behaviour to MAGIC_CONSUME_NOW. Unused @@ -64,13 +66,13 @@ typedef enum { #define MAGIC_NORMAL_METER 0x30 #define MAGIC_DOUBLE_METER (2 * MAGIC_NORMAL_METER) -typedef struct { +typedef struct ItemEquips { /* 0x00 */ u8 buttonItems[4]; /* 0x04 */ u8 cButtonSlots[3]; /* 0x08 */ u16 equipment; // a mask where each nibble corresponds to a type of equipment `EquipmentType`, and each nibble is a piece `EquipValue*` } ItemEquips; // size = 0x0A -typedef struct { +typedef struct Inventory { /* 0x00 */ u8 items[24]; /* 0x18 */ s8 ammo[16]; /* 0x28 */ u16 equipment; // a mask where each nibble corresponds to a type of equipment `EquipmentType`, and each bit to an owned piece `EquipInv*` @@ -82,7 +84,7 @@ typedef struct { /* 0x5C */ s16 gsTokens; } Inventory; // size = 0x5E -typedef struct { +typedef struct SavedSceneFlags { /* 0x00 */ u32 chest; /* 0x04 */ u32 swch; /* 0x08 */ u32 clear; @@ -92,7 +94,7 @@ typedef struct { /* 0x18 */ u32 floors; } SavedSceneFlags; // size = 0x1C -typedef struct { +typedef struct HorseData { /* 0x00 */ s16 sceneId; /* 0x02 */ Vec3s pos; /* 0x08 */ s16 angle; @@ -104,14 +106,14 @@ typedef struct { * "return": coming from the ground * "top": coming from the air */ -typedef enum { +typedef enum RespawnMode { /* 0x00 */ RESPAWN_MODE_DOWN, /* Normal Void Outs */ /* 0x01 */ RESPAWN_MODE_RETURN, /* Grotto Returnpoints */ /* 0x02 */ RESPAWN_MODE_TOP, /* Farore's Wind */ /* 0x03 */ RESPAWN_MODE_MAX } RespawnMode; -typedef struct { +typedef struct RespawnData { /* 0x00 */ Vec3f pos; /* 0x0C */ s16 yaw; /* 0x0E */ s16 playerParams; @@ -122,7 +124,7 @@ typedef struct { /* 0x18 */ u32 tempCollectFlags; } RespawnData; // size = 0x1C -typedef struct { +typedef struct FaroresWindData { /* 0x00 */ Vec3i pos; /* 0x0C */ s32 yaw; /* 0x10 */ s32 playerParams; @@ -133,7 +135,7 @@ typedef struct { /* 0x24 */ s32 tempCollectFlags; } FaroresWindData; // size = 0x28 -typedef enum { +typedef enum TimerState { /* 0x0 */ TIMER_STATE_OFF, /* 0x1 */ TIMER_STATE_ENV_HAZARD_INIT, // Init env timer that counts down, total time based on health, resets on void-out, kills at 0 /* 0x2 */ TIMER_STATE_ENV_HAZARD_PREVIEW, // Display initial time, keep it fixed at the screen center @@ -151,7 +153,7 @@ typedef enum { /* 0xF */ TIMER_STATE_UP_FREEZE // Stop counting the timer } TimerState; -typedef enum { +typedef enum SubTimerState { /* 0x0 */ SUBTIMER_STATE_OFF, /* 0x1 */ SUBTIMER_STATE_DOWN_INIT, // Init timer that counts down /* 0x2 */ SUBTIMER_STATE_DOWN_PREVIEW, // Display initial time, keep it fixed at the screen center @@ -165,7 +167,7 @@ typedef enum { /* 0xA */ SUBTIMER_STATE_UP_TICK // Counting up } SubTimerState; -typedef enum { +typedef enum TimerId { /* 0 */ TIMER_ID_MAIN, // Takes priority in both counting and drawing. See `timerState` and `timerSeconds` /* 1 */ TIMER_ID_SUB, // See `subTimerState` and `subTimerSeconds` /* 2 */ TIMER_ID_MAX @@ -176,8 +178,34 @@ typedef enum { #define ENV_HAZARD_TEXT_TRIGGER_HOTROOM (1 << 0) #define ENV_HAZARD_TEXT_TRIGGER_UNDERWATER (1 << 1) +typedef enum WorldMapArea { + /* 0 */ WORLD_MAP_AREA_HYRULE_FIELD, + /* 1 */ WORLD_MAP_AREA_KAKARIKO_VILLAGE, + /* 2 */ WORLD_MAP_AREA_GRAVEYARD, + /* 3 */ WORLD_MAP_AREA_ZORAS_RIVER, + /* 4 */ WORLD_MAP_AREA_KOKIRI_FOREST, + /* 5 */ WORLD_MAP_AREA_SACRED_FOREST_MEADOW, + /* 6 */ WORLD_MAP_AREA_LAKE_HYLIA, + /* 7 */ WORLD_MAP_AREA_ZORAS_DOMAIN, + /* 8 */ WORLD_MAP_AREA_ZORAS_FOUNTAIN, + /* 9 */ WORLD_MAP_AREA_GERUDO_VALLEY, + /* 10 */ WORLD_MAP_AREA_LOST_WOODS, + /* 11 */ WORLD_MAP_AREA_DESERT_COLOSSUS, + /* 12 */ WORLD_MAP_AREA_GERUDOS_FORTRESS, + /* 13 */ WORLD_MAP_AREA_HAUNTED_WASTELAND, + /* 14 */ WORLD_MAP_AREA_MARKET, + /* 15 */ WORLD_MAP_AREA_HYRULE_CASTLE, + /* 16 */ WORLD_MAP_AREA_DEATH_MOUNTAIN_TRAIL, + /* 17 */ WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER, + /* 18 */ WORLD_MAP_AREA_GORON_CITY, + /* 19 */ WORLD_MAP_AREA_LON_LON_RANCH, + /* 20 */ WORLD_MAP_AREA_QUESTION_MARK, // Windmill/Dampé's Grave (and a Lon Lon Ranch cutscene). Labeled as "?" + /* 21 */ WORLD_MAP_AREA_GANONS_CASTLE, + /* 22 */ WORLD_MAP_AREA_MAX // also grottos and fairy's/great fairy's fountains (scenes with varying locations) +} WorldMapArea; + // offsets in SavePlayerData and SaveContext/Save -typedef struct { +typedef struct SavePlayerData { /* 0x00 0x001C */ char newf[6]; // string "ZELDAZ" /* 0x06 0x0022 */ u16 deaths; /* 0x08 0x0024 */ char playerName[8]; @@ -203,7 +231,7 @@ typedef struct { } SavePlayerData; // offsets in SaveInfo and SaveContext/Save -typedef struct { +typedef struct SaveInfo { /* 0x0000 0x001C */ SavePlayerData playerData; // "S_Private" /* 0x004C 0x0068 */ ItemEquips equips; /* 0x0058 0x0074 */ Inventory inventory; @@ -230,7 +258,7 @@ typedef struct { /* 0x1336 0x1352 */ u16 checksum; // "check_sum" } SaveInfo; -typedef struct { +typedef struct Save { /* 0x00 */ s32 entranceIndex; /* 0x04 */ s32 linkAge; // 0: Adult; 1: Child (see enum `LinkAge`) /* 0x08 */ s32 cutsceneIndex; @@ -242,7 +270,7 @@ typedef struct { u8 useWidescreen; } Save; -typedef struct { +typedef struct SaveContext { /* 0x0000 */ Save save; // "memory" /* 0x1354 */ s32 fileNum; // "file_no" /* 0x1358 */ char unk_1358[0x0004]; @@ -307,12 +335,12 @@ typedef struct { /* 0x1424 */ s16 healthAccumulator; } SaveContext; // size = 0x1428 -typedef enum { +typedef enum ButtonStatus { /* 0x00 */ BTN_ENABLED, /* 0xFF */ BTN_DISABLED = 0xFF } ButtonStatus; -typedef enum { +typedef enum ChamberCutsceneNum { /* 0 */ CHAMBER_CS_FOREST, /* 1 */ CHAMBER_CS_FIRE, /* 2 */ CHAMBER_CS_WATER, @@ -321,7 +349,7 @@ typedef enum { /* 5 */ CHAMBER_CS_LIGHT } ChamberCutsceneNum; -typedef enum { +typedef enum HighScores { /* 0x00 */ HS_HBA, // horseback archery /* 0x01 */ HS_POE_POINTS, /* 0x02 */ HS_FISHING, @@ -343,14 +371,14 @@ typedef enum { #define HS_FISH_CHEAT_ADULT 0x80000000 // used Sinking Lure as adult to catch record fish #define HS_FISH_PLAYED 0x10000 // incremented for every play. controls weather. -typedef enum { +typedef enum SunsSongState { /* 0 */ SUNSSONG_INACTIVE, /* 1 */ SUNSSONG_START, // the suns ocarina effect signals that the song has finished playing /* 2 */ SUNSSONG_SPEED_TIME, // suns was played where time passes, speed up the advancement of time /* 3 */ SUNSSONG_SPECIAL // time does not advance, but signals the song was played. used for freezing redeads } SunsSongState; -typedef enum { +typedef enum GameMode { /* 0 */ GAMEMODE_NORMAL, /* 1 */ GAMEMODE_TITLE_SCREEN, /* 2 */ GAMEMODE_FILE_SELECT, // Note: only instance type transitions swap to file select @@ -358,7 +386,7 @@ typedef enum { /* 4 */ GAMEMODE_MAP_SELECT } GameMode; -typedef enum { +typedef enum SceneLayer { /* 0 */ SCENE_LAYER_CHILD_DAY, /* 1 */ SCENE_LAYER_CHILD_NIGHT, /* 2 */ SCENE_LAYER_ADULT_DAY, @@ -368,12 +396,65 @@ typedef enum { #define IS_CUTSCENE_LAYER (gSaveContext.sceneLayer >= SCENE_LAYER_CUTSCENE_FIRST) -typedef enum { +typedef enum LinkAge { /* 0 */ LINK_AGE_ADULT, /* 1 */ LINK_AGE_CHILD } LinkAge; +#define LINK_IS_ADULT (gSaveContext.save.linkAge == LINK_AGE_ADULT) +#define LINK_IS_CHILD (gSaveContext.save.linkAge == LINK_AGE_CHILD) + +#define YEARS_CHILD 5 +#define YEARS_ADULT 17 +#define LINK_AGE_IN_YEARS (!LINK_IS_ADULT ? YEARS_CHILD : YEARS_ADULT) + +#define CLOCK_TIME(hr, min) ((s32)(((hr) * 60 + (min)) * (f32)0x10000 / (24 * 60) + 0.5f)) + +#define IS_DAY (gSaveContext.save.nightFlag == 0) +#define IS_NIGHT (gSaveContext.save.nightFlag == 1) + +#define SLOT(item) gItemSlots[item] +#define INV_CONTENT(item) gSaveContext.save.info.inventory.items[SLOT(item)] +#define AMMO(item) gSaveContext.save.info.inventory.ammo[SLOT(item)] +#define BEANS_BOUGHT AMMO(ITEM_MAGIC_BEAN + 1) + +#define ALL_EQUIP_VALUE(equip) ((s32)(gSaveContext.save.info.inventory.equipment & gEquipMasks[equip]) >> gEquipShifts[equip]) +#define CUR_EQUIP_VALUE(equip) ((s32)(gSaveContext.save.info.equips.equipment & gEquipMasks[equip]) >> gEquipShifts[equip]) +#define OWNED_EQUIP_FLAG(equip, value) (gBitFlags[value] << gEquipShifts[equip]) +#define OWNED_EQUIP_FLAG_ALT(equip, value) ((1 << (value)) << gEquipShifts[equip]) +#define CHECK_OWNED_EQUIP(equip, value) (OWNED_EQUIP_FLAG(equip, value) & gSaveContext.save.info.inventory.equipment) +#define CHECK_OWNED_EQUIP_ALT(equip, value) (gBitFlags[(value) + (equip) * 4] & gSaveContext.save.info.inventory.equipment) + +#define SWORD_EQUIP_TO_PLAYER(swordEquip) (swordEquip) +#define SHIELD_EQUIP_TO_PLAYER(shieldEquip) (shieldEquip) +#define TUNIC_EQUIP_TO_PLAYER(tunicEquip) ((tunicEquip) - 1) +#define BOOTS_EQUIP_TO_PLAYER(bootsEquip) ((bootsEquip) - 1) + +#define CUR_UPG_VALUE(upg) ((s32)(gSaveContext.save.info.inventory.upgrades & gUpgradeMasks[upg]) >> gUpgradeShifts[upg]) +#define CAPACITY(upg, value) gUpgradeCapacities[upg][value] +#define CUR_CAPACITY(upg) CAPACITY(upg, CUR_UPG_VALUE(upg)) + +#define CHECK_QUEST_ITEM(item) (gBitFlags[item] & gSaveContext.save.info.inventory.questItems) +#define CHECK_DUNGEON_ITEM(item, dungeonIndex) (gSaveContext.save.info.inventory.dungeonItems[dungeonIndex] & gBitFlags[item]) + +#define GET_GS_FLAGS(index) \ + ((gSaveContext.save.info.gsFlags[(index) >> 2] & gGsFlagsMasks[(index) & 3]) >> gGsFlagsShifts[(index) & 3]) +#define SET_GS_FLAGS(index, value) \ + (gSaveContext.save.info.gsFlags[(index) >> 2] |= (value) << gGsFlagsShifts[(index) & 3]) + +#define HIGH_SCORE(score) (gSaveContext.save.info.highScores[score]) + +#define B_BTN_ITEM ((gSaveContext.buttonStatus[0] == ITEM_NONE) \ + ? ITEM_NONE \ + : (gSaveContext.save.info.equips.buttonItems[0] == ITEM_GIANTS_KNIFE) \ + ? ITEM_SWORD_BIGGORON \ + : gSaveContext.save.info.equips.buttonItems[0]) + +#define C_BTN_ITEM(button) ((gSaveContext.buttonStatus[(button) + 1] != BTN_DISABLED) \ + ? gSaveContext.save.info.equips.buttonItems[(button) + 1] \ + : ITEM_NONE) + /* * @@ -575,6 +656,11 @@ typedef enum { #define EVENTCHKINF_DE_MASK (1 << 14) +#define GET_EVENTCHKINF(flag) (gSaveContext.save.info.eventChkInf[(flag) >> 4] & (1 << ((flag) & 0xF))) +#define SET_EVENTCHKINF(flag) (gSaveContext.save.info.eventChkInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) +#define CLEAR_EVENTCHKINF(flag) (gSaveContext.save.info.eventChkInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) + + /* * SaveContext.itemGetInf */ @@ -634,6 +720,10 @@ typedef enum { #define ITEMGETINF_3F 0x3F +#define GET_ITEMGETINF(flag) (gSaveContext.save.info.itemGetInf[(flag) >> 4] & (1 << ((flag) & 0xF))) +#define SET_ITEMGETINF(flag) (gSaveContext.save.info.itemGetInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) + + /* * SaveContext.infTable */ @@ -794,6 +884,11 @@ typedef enum { #define INFTABLE_1DX_INDEX 29 +#define GET_INFTABLE(flag) (gSaveContext.save.info.infTable[(flag) >> 4] & (1 << ((flag) & 0xF))) +#define SET_INFTABLE(flag) (gSaveContext.save.info.infTable[(flag) >> 4] |= (1 << ((flag) & 0xF))) +#define CLEAR_INFTABLE(flag) (gSaveContext.save.info.infTable[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) + + /* * SaveContext.eventInf */ @@ -823,7 +918,7 @@ typedef enum { #define EVENTINF_HORSES_0A ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_0A_SHIFT) #define EVENTINF_CUCCO_GAME_FINISHED EVENTINF_HORSES_0A -typedef enum { +typedef enum EventInfHorsesState { /* 0 */ EVENTINF_HORSES_STATE_0, /* 1 */ EVENTINF_HORSES_STATE_1, /* 2 */ EVENTINF_HORSES_STATE_2, @@ -868,5 +963,11 @@ typedef enum { #define EVENTINF_30 0x30 +#define GET_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] & (1 << ((flag) & 0xF))) +#define SET_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) +#define CLEAR_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) + + +extern SaveContext gSaveContext; #endif diff --git a/include/z64scene.h b/include/z64scene.h index ccda1129d8..afb6fe6f1a 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -1,13 +1,21 @@ #ifndef Z64SCENE_H #define Z64SCENE_H -#include "z64.h" -#include "z64dma.h" // for RomFile +#include "macros.h" +#include "ultra64.h" +#include "z64bgcheck.h" +#include "z64dma.h" +#include "z64environment.h" +#include "z64light.h" +#include "z64math.h" #include "config.h" #include "command_macros_base.h" -typedef struct { +struct GameState; +struct PlayState; + +typedef struct SceneTableEntry { /* 0x00 */ RomFile sceneFile; /* 0x08 */ RomFile titleFile; /* 0x10 */ u8 unk_10; @@ -16,14 +24,14 @@ typedef struct { /* 0x13 */ u8 unk_13; } SceneTableEntry; // size = 0x14 -typedef struct { +typedef struct ActorEntry { /* 0x00 */ s16 id; /* 0x02 */ Vec3s pos; /* 0x08 */ Vec3s rot; /* 0x0E */ s16 params; } ActorEntry; // size = 0x10 -typedef struct { +typedef struct TransitionActorEntry { struct { s8 room; // Room to switch to s8 bgCamIndex; // How the camera reacts during the transition. See `Camera_ChangeDoorCam` @@ -34,58 +42,58 @@ typedef struct { /* 0x0E */ s16 params; } TransitionActorEntry; // size = 0x10 -typedef struct TransitionActorContext { - /* 0x00 */ u8 numActors; +typedef struct TransitionActorList { + /* 0x00 */ u8 count; /* 0x04 */ TransitionActorEntry* list; -} TransitionActorContext; // size = 0x8 +} TransitionActorList; // size = 0x8 -typedef struct { +typedef struct Spawn { /* 0x00 */ u8 playerEntryIndex; /* 0x01 */ u8 room; } Spawn; -typedef struct { +typedef struct Path { /* 0x00 */ u8 count; // number of points in the path /* 0x04 */ Vec3s* points; // Segment Address to the array of points } Path; // size = 0x8 // Room shapes -typedef enum { +typedef enum RoomShapeType { /* 0 */ ROOM_SHAPE_TYPE_NORMAL, /* 1 */ ROOM_SHAPE_TYPE_IMAGE, /* 2 */ ROOM_SHAPE_TYPE_CULLABLE, /* 3 */ ROOM_SHAPE_TYPE_MAX } RoomShapeType; -typedef struct { +typedef struct RoomShapeBase { /* 0x00 */ u8 type; } RoomShapeBase; // size = 0x01 -typedef struct { +typedef struct RoomShapeDListsEntry { /* 0x00 */ Gfx* opa; /* 0x04 */ Gfx* xlu; } RoomShapeDListsEntry; // size = 0x08 -typedef struct { +typedef struct RoomShapeNormal { /* 0x00 */ RoomShapeBase base; /* 0x01 */ u8 numEntries; /* 0x04 */ RoomShapeDListsEntry* entries; /* 0x08 */ RoomShapeDListsEntry* entriesEnd; } RoomShapeNormal; // size = 0x0C -typedef enum { +typedef enum RoomShapeImageAmountType { /* 1 */ ROOM_SHAPE_IMAGE_AMOUNT_SINGLE = 1, /* 2 */ ROOM_SHAPE_IMAGE_AMOUNT_MULTI } RoomShapeImageAmountType; -typedef struct { +typedef struct RoomShapeImageBase { /* 0x00 */ RoomShapeBase base; /* 0x01 */ u8 amountType; // RoomShapeImageAmountType /* 0x04 */ RoomShapeDListsEntry* entry; } RoomShapeImageBase; // size = 0x08 -typedef struct { +typedef struct RoomShapeImageSingle { /* 0x00 */ RoomShapeImageBase base; /* 0x08 */ void* source; /* 0x0C */ u32 unk_0C; @@ -98,7 +106,7 @@ typedef struct { /* 0x1C */ u16 tlutCount; } RoomShapeImageSingle; // size = 0x20 -typedef struct { +typedef struct RoomShapeImageMultiBgEntry { /* 0x00 */ u16 unk_00; /* 0x02 */ u8 bgCamIndex; // for which bg cam index is this entry for /* 0x04 */ void* source; @@ -112,13 +120,13 @@ typedef struct { /* 0x18 */ u16 tlutCount; } RoomShapeImageMultiBgEntry; // size = 0x1C -typedef struct { +typedef struct RoomShapeImageMulti { /* 0x00 */ RoomShapeImageBase base; /* 0x08 */ u8 numBackgrounds; /* 0x0C */ RoomShapeImageMultiBgEntry* backgrounds; } RoomShapeImageMulti; // size = 0x10 -typedef struct { +typedef struct RoomShapeCullableEntry { /* 0x00 */ Vec3s boundsSphereCenter; /* 0x06 */ s16 boundsSphereRadius; /* 0x08 */ Gfx* opa; @@ -127,14 +135,14 @@ typedef struct { #define ROOM_SHAPE_CULLABLE_MAX_ENTRIES 64 -typedef struct { +typedef struct RoomShapeCullable { /* 0x00 */ RoomShapeBase base; /* 0x01 */ u8 numEntries; /* 0x04 */ RoomShapeCullableEntry* entries; /* 0x08 */ RoomShapeCullableEntry* entriesEnd; } RoomShapeCullable; // size = 0x0C -typedef union { +typedef union RoomShape { RoomShapeBase base; RoomShapeNormal normal; union { @@ -145,30 +153,30 @@ typedef union { RoomShapeCullable cullable; } RoomShape; // "Ground Shape" -typedef enum RoomBehaviorType1 { - /* 0 */ ROOM_BEHAVIOR_TYPE1_0, - /* 1 */ ROOM_BEHAVIOR_TYPE1_1, - /* 2 */ ROOM_BEHAVIOR_TYPE1_2, - /* 3 */ ROOM_BEHAVIOR_TYPE1_3, // unused - /* 4 */ ROOM_BEHAVIOR_TYPE1_4, // unused - /* 5 */ ROOM_BEHAVIOR_TYPE1_5 -} RoomBehaviorType1; - -typedef enum RoomBehaviorType2 { - /* 0 */ ROOM_BEHAVIOR_TYPE2_0, - /* 1 */ ROOM_BEHAVIOR_TYPE2_1, - /* 2 */ ROOM_BEHAVIOR_TYPE2_2, - /* 3 */ ROOM_BEHAVIOR_TYPE2_3, - /* 4 */ ROOM_BEHAVIOR_TYPE2_4, - /* 5 */ ROOM_BEHAVIOR_TYPE2_5, - /* 6 */ ROOM_BEHAVIOR_TYPE2_6 -} RoomBehaviorType2; +typedef enum RoomType { + /* 0 */ ROOM_TYPE_NORMAL, + /* 1 */ ROOM_TYPE_DUNGEON, // Blocks Sun's Song's time advance effect. Not exclusively used by typical dungeon rooms. + /* 2 */ ROOM_TYPE_INDOORS, // Reduces player run speed and blocks player from attacking or jumping. + /* 3 */ ROOM_TYPE_3, // Unused. Color dithering is turned off when drawing the room and other things. + /* 4 */ ROOM_TYPE_4, // Unused. Prevents switching to CAM_SET_HORSE when mounting a horse. + /* 5 */ ROOM_TYPE_BOSS // Disables Environment_AdjustLights +} RoomType; + +typedef enum RoomEnvironmentType { + /* 0 */ ROOM_ENV_DEFAULT, + /* 1 */ ROOM_ENV_COLD, + /* 2 */ ROOM_ENV_WARM, + /* 3 */ ROOM_ENV_HOT, // Enables hot room timer for the current room + /* 4 */ ROOM_ENV_UNK_STRETCH_1, + /* 5 */ ROOM_ENV_UNK_STRETCH_2, + /* 6 */ ROOM_ENV_UNK_STRETCH_3 +} RoomEnvironmentType; typedef struct Room { - /* 0x00 */ s8 num; + /* 0x00 */ s8 num; // -1 is invalid room /* 0x01 */ u8 unk_01; - /* 0x02 */ u8 behaviorType2; - /* 0x03 */ u8 behaviorType1; + /* 0x02 */ u8 environmentType; + /* 0x03 */ u8 type; /* 0x04 */ s8 echo; /* 0x05 */ u8 lensMode; #if ENABLE_F3DEX3 @@ -183,58 +191,63 @@ typedef struct Room { typedef struct RoomContext { /* 0x00 */ Room curRoom; /* 0x14 */ Room prevRoom; - /* 0x28 */ void* bufPtrs[2]; - /* 0x30 */ u8 unk_30; - /* 0x31 */ s8 status; - /* 0x34 */ void* unk_34; + /* 0x28 */ void* bufPtrs[2]; // Start and end pointers for the room buffer. Can be split into two pages, where page 0 is allocated from the start pointer and page 1 is allocated from the end pointer. + /* 0x30 */ u8 activeBufPage; // 0 - First page in memory, 1 - Last page in memory + /* 0x31 */ s8 status; // 0 - Free for new room request, 1 - DmaRequest for a new room is in progress + /* 0x34 */ void* roomRequestAddr; // Pointer to where the requested room segment will be stored /* 0x38 */ DmaRequest dmaRequest; /* 0x58 */ OSMesgQueue loadQueue; /* 0x70 */ OSMesg loadMsg; - /* 0x74 */ s16 unk_74[2]; // context-specific data used by the current scene draw config + /* 0x74 */ s16 drawParams[2]; // context-specific data used by the current scene draw config } RoomContext; // size = 0x78 +typedef struct RoomList { + /* 0x00 */ u8 count; + /* 0x04 */ RomFile* romFiles; // Array of rom addresses for each room in a scene +} RoomList; + #define ROOM_DRAW_OPA (1 << 0) #define ROOM_DRAW_XLU (1 << 1) // Scene commands -typedef struct { +typedef struct SCmdBase { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ u32 data2; } SCmdBase; -typedef struct { +typedef struct SCmdPlayerEntryList { /* 0x00 */ u8 code; /* 0x01 */ u8 length; /* 0x04 */ ActorEntry* data; } SCmdPlayerEntryList; -typedef struct { +typedef struct SCmdActorEntryList { /* 0x00 */ u8 code; /* 0x01 */ u8 length; /* 0x04 */ ActorEntry* data; } SCmdActorEntryList; -typedef struct { +typedef struct SCmdUnused02 { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ void* segment; } SCmdUnused02; -typedef struct { +typedef struct SCmdColHeader { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ CollisionHeader* data; } SCmdColHeader; -typedef struct { +typedef struct SCmdRoomList { /* 0x00 */ u8 code; /* 0x01 */ u8 length; /* 0x04 */ RomFile* data; } SCmdRoomList; -typedef struct { +typedef struct SCmdWindSettings { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x02 */ char pad[2]; @@ -244,61 +257,61 @@ typedef struct { /* 0x07 */ u8 unk_07; } SCmdWindSettings; -typedef struct { +typedef struct SCmdSpawnList { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ Spawn* data; } SCmdSpawnList; -typedef struct { +typedef struct SCmdSpecialFiles { /* 0x00 */ u8 code; /* 0x01 */ u8 naviQuestHintFileId; /* 0x04 */ u32 keepObjectId; } SCmdSpecialFiles; -typedef struct { +typedef struct SCmdRoomBehavior { /* 0x00 */ u8 code; /* 0x01 */ u8 gpFlag1; /* 0x04 */ u32 gpFlag2; } SCmdRoomBehavior; -typedef struct { +typedef struct SCmdMesh { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ RoomShapeBase* data; } SCmdMesh; -typedef struct { +typedef struct SCmdObjectList { /* 0x00 */ u8 code; /* 0x01 */ u8 length; /* 0x04 */ s16* data; } SCmdObjectList; -typedef struct { +typedef struct SCmdLightList { /* 0x00 */ u8 code; /* 0x01 */ u8 length; /* 0x04 */ LightInfo* data; } SCmdLightList; -typedef struct { +typedef struct SCmdPathList { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ Path* data; } SCmdPathList; -typedef struct { +typedef struct SCmdTransiActorList { /* 0x00 */ u8 code; /* 0x01 */ u8 length; /* 0x04 */ TransitionActorEntry* data; } SCmdTransiActorList; -typedef struct { +typedef struct SCmdLightSettingList { /* 0x00 */ u8 code; /* 0x01 */ u8 length; /* 0x04 */ EnvLightSettings* data; } SCmdLightSettingList; -typedef struct { +typedef struct SCmdTimeSettings { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x02 */ char pad[2]; @@ -307,7 +320,7 @@ typedef struct { /* 0x06 */ u8 timeSpeed; } SCmdTimeSettings; -typedef struct { +typedef struct SCmdSkyboxSettings { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x02 */ char pad[2]; @@ -316,7 +329,7 @@ typedef struct { /* 0x06 */ u8 envLightMode; } SCmdSkyboxSettings; -typedef struct { +typedef struct SCmdSkyboxDisables { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x02 */ char pad[2]; @@ -324,19 +337,19 @@ typedef struct { /* 0x05 */ u8 sunMoonDisabled; } SCmdSkyboxDisables; -typedef struct { +typedef struct SCmdEndMarker { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ u32 data2; } SCmdEndMarker; -typedef struct { +typedef struct SCmdExitList { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ s16* data; } SCmdExitList; -typedef struct { +typedef struct SCmdSoundSettings { /* 0x00 */ u8 code; /* 0x01 */ u8 specId; /* 0x02 */ char pad[4]; @@ -344,40 +357,40 @@ typedef struct { /* 0x07 */ u8 seqId; } SCmdSoundSettings; -typedef struct { +typedef struct SCmdEchoSettings { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x02 */ char pad[5]; /* 0x07 */ u8 echo; } SCmdEchoSettings; -typedef struct { +typedef struct SCmdCutsceneData { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ void* data; } SCmdCutsceneData; -typedef struct { +typedef struct SCmdAltHeaders { /* 0x00 */ u8 code; /* 0x01 */ u8 data1; /* 0x04 */ void* data; } SCmdAltHeaders; -typedef struct { +typedef struct SCmdMiscSettings { /* 0x00 */ u8 code; /* 0x01 */ u8 sceneCamType; /* 0x04 */ u32 area; } SCmdMiscSettings; #if ENABLE_F3DEX3 -typedef struct { +typedef struct SCmdOccPlaneCandList { /* 0x00 */ u8 code; /* 0x01 */ u8 count; /* 0x04 */ OcclusionPlaneCandidate* list; } SCmdOccPlaneCandList; #endif -typedef union { +typedef union SceneCmd { SCmdBase base; SCmdPlayerEntryList playerEntryList; SCmdActorEntryList actorEntryList; @@ -413,7 +426,7 @@ typedef BAD_RETURN(s32) (*SceneCmdHandlerFunc)(struct PlayState*, SceneCmd*); #define DEFINE_SCENE(_0, _1, enum, _3, _4, _5) enum, -typedef enum { +typedef enum SceneID { #include "tables/scene_table.h" /* 0x6E */ SCENE_ID_MAX } SceneID; @@ -436,10 +449,30 @@ typedef enum { // Deleted scene #define SCENE_UNUSED_6E 0x6E +// Macros for `EntranceInfo.field` +#define ENTRANCE_INFO_CONTINUE_BGM_FLAG (1 << 15) +#define ENTRANCE_INFO_DISPLAY_TITLE_CARD_FLAG (1 << 14) +#define ENTRANCE_INFO_END_TRANS_TYPE_MASK 0x3F80 +#define ENTRANCE_INFO_END_TRANS_TYPE_SHIFT 7 +#define ENTRANCE_INFO_END_TRANS_TYPE(field) \ + (((field) >> ENTRANCE_INFO_END_TRANS_TYPE_SHIFT) \ + & (ENTRANCE_INFO_END_TRANS_TYPE_MASK >> ENTRANCE_INFO_END_TRANS_TYPE_SHIFT)) +#define ENTRANCE_INFO_START_TRANS_TYPE_MASK 0x7F +#define ENTRANCE_INFO_START_TRANS_TYPE_SHIFT 0 +#define ENTRANCE_INFO_START_TRANS_TYPE(field) \ + (((field) >> ENTRANCE_INFO_START_TRANS_TYPE_SHIFT) \ + & (ENTRANCE_INFO_START_TRANS_TYPE_MASK >> ENTRANCE_INFO_START_TRANS_TYPE_SHIFT)) + +typedef struct EntranceInfo { + /* 0x00 */ u8 sceneId; + /* 0x01 */ u8 spawn; + /* 0x02 */ u16 field; +} EntranceInfo; // size = 0x4 + // Entrance Index Enum #define DEFINE_ENTRANCE(enum, _1, _2, _3, _4, _5, _6) enum, -typedef enum { +typedef enum EntranceIndex { #include "tables/entrance_table.h" /* 0x614 */ ENTR_MAX } EntranceIndex; @@ -448,7 +481,7 @@ typedef enum { #define ENTR_LOAD_OPENING -1 -typedef enum { +typedef enum ReturnEntranceIndex { /* 0x7FF9 */ ENTR_RETURN_GREAT_FAIRYS_FOUNTAIN_SPELLS = 0x7FF9, /* 0x7FFA */ ENTR_RETURN_SHOOTING_GALLERY, /* 0x7FFB */ ENTR_RETURN_2, // unused @@ -458,7 +491,7 @@ typedef enum { /* 0x7FFF */ ENTR_RETURN_GROTTO // Grottos and normal Fairy Fountain } ReturnEntranceIndex; -typedef enum { +typedef enum SceneDrawConfig { /* 0 */ SDC_DEFAULT, /* 1 */ SDC_HYRULE_FIELD, /* 2 */ SDC_KAKARIKO_VILLAGE, @@ -515,6 +548,8 @@ typedef enum { /* 53 */ SDC_MAX } SceneDrawConfig; +typedef void (*SceneDrawConfigFunc)(struct PlayState*); + // R_SCENE_CAM_TYPE values #define SCENE_CAM_TYPE_DEFAULT 0 #define SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT 0x10 // Camera exhibits fixed behaviors and viewpoint changing is handled by shops @@ -524,7 +559,7 @@ typedef enum { #define SCENE_CAM_TYPE_SHOOTING_GALLERY 0x50 // Unreferenced in code, and used only by the main layer of the shooting gallery scene // navi hints -typedef enum { +typedef enum NaviQuestHintFileId { NAVI_QUEST_HINTS_NONE, NAVI_QUEST_HINTS_OVERWORLD, NAVI_QUEST_HINTS_DUNGEON @@ -532,7 +567,7 @@ typedef enum { // Scene commands -typedef enum { +typedef enum SceneCommandTypeID { /* 0x00 */ SCENE_CMD_ID_SPAWN_LIST, /* 0x01 */ SCENE_CMD_ID_ACTOR_LIST, /* 0x02 */ SCENE_CMD_ID_UNUSED_2, @@ -589,9 +624,9 @@ typedef enum { #define SCENE_CMD_SPECIAL_FILES(naviQuestHintFileId, keepObjectId) \ { SCENE_CMD_ID_SPECIAL_FILES, naviQuestHintFileId, CMD_W(keepObjectId) } -#define SCENE_CMD_ROOM_BEHAVIOR(curRoomUnk3, curRoomUnk2, showInvisActors, disableWarpSongs) \ - { SCENE_CMD_ID_ROOM_BEHAVIOR, curRoomUnk3, \ - curRoomUnk2 | _SHIFTL(showInvisActors, 8, 1) | _SHIFTL(disableWarpSongs, 10, 1) } +#define SCENE_CMD_ROOM_BEHAVIOR(type, environment, showInvisActors, disableWarpSongs) \ + { SCENE_CMD_ID_ROOM_BEHAVIOR, type, \ + environment | _SHIFTL(showInvisActors, 8, 1) | _SHIFTL(disableWarpSongs, 10, 1) } #define SCENE_CMD_UNK_09() \ { SCENE_CMD_ID_UNDEFINED_9, 0, CMD_W(0) } @@ -649,5 +684,12 @@ typedef enum { { SCENE_CMD_ID_OCC_PLANE_CAND_LIST, numPlanes, CMD_PTR(planeList) } #endif +s32 Scene_ExecuteCommands(struct PlayState* play, SceneCmd* sceneCmd); +void Scene_ResetTransitionActorList(struct GameState* state, TransitionActorList* transitionActors); +void Scene_SetTransitionForNextEntrance(struct PlayState* play); +void Scene_Draw(struct PlayState* play); + +extern EntranceInfo gEntranceTable[ENTR_MAX]; +extern SceneTableEntry gSceneTable[SCENE_ID_MAX]; #endif diff --git a/include/z64skin.h b/include/z64skin.h index a199ed41b1..d29c7c7482 100644 --- a/include/z64skin.h +++ b/include/z64skin.h @@ -7,7 +7,7 @@ * Holds a compact version of a vertex used in the Skin system * It is used to initialise the Vtx used by an animated limb */ -typedef struct { +typedef struct SkinVertex { /* 0x00 */ u16 index; /* 0x02 */ s16 s; // s and t are texture coordinates (also known as u and v) /* 0x04 */ s16 t; @@ -20,7 +20,7 @@ typedef struct { /** * Describes a position displacement and a scale to be applied to a limb at index `limbIndex` */ -typedef struct { +typedef struct SkinTransformation { /* 0x00 */ u8 limbIndex; /* 0x02 */ s16 x; /* 0x04 */ s16 y; @@ -28,7 +28,7 @@ typedef struct { /* 0x08 */ u8 scale; } SkinTransformation; // size = 0xA -typedef struct { +typedef struct SkinLimbModif { /* 0x00 */ u16 vtxCount; // number of vertices in this modif entry /* 0x02 */ u16 transformCount; /* 0x04 */ u16 unk_4; // index of limbTransformations? @@ -36,7 +36,7 @@ typedef struct { /* 0x0C */ SkinTransformation* limbTransformations; } SkinLimbModif; // size = 0x10 -typedef struct { +typedef struct SkinAnimatedLimbData { /* 0x00 */ u16 totalVtxCount; // total vertex count for all modif entries /* 0x02 */ u16 limbModifCount; /* 0x04 */ SkinLimbModif* limbModifications; @@ -46,7 +46,7 @@ typedef struct { #define SKIN_LIMB_TYPE_ANIMATED 4 #define SKIN_LIMB_TYPE_NORMAL 11 -typedef struct { +typedef struct SkinLimb { /* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent /* 0x06 */ u8 child; /* 0x07 */ u8 sibling; @@ -54,12 +54,12 @@ typedef struct { /* 0x0C */ void* segment; // Gfx* if segmentType is SKIN_LIMB_TYPE_NORMAL, SkinAnimatedLimbData* if segmentType is SKIN_LIMB_TYPE_ANIMATED, NULL otherwise } SkinLimb; // size = 0x10 -typedef struct { +typedef struct SkinLimbVtx { /* 0x000 */ u8 index; // alternates every draw cycle /* 0x004 */ Vtx* buf[2]; // number of vertices in buffer determined by `totalVtxCount` } SkinLimbVtx; // size = 0xC -typedef struct { +typedef struct Skin { /* 0x000 */ SkeletonHeader* skeletonHeader; /* 0x004 */ MtxF mtx; /* 0x044 */ s32 limbCount; diff --git a/include/z64skin_matrix.h b/include/z64skin_matrix.h new file mode 100644 index 0000000000..647790abff --- /dev/null +++ b/include/z64skin_matrix.h @@ -0,0 +1,25 @@ +#ifndef Z64SKIN_MATRIX_H +#define Z64SKIN_MATRIX_H + +#include "ultra64.h" +#include "z64math.h" + +struct GraphicsContext; + +void SkinMatrix_Vec3fMtxFMultXYZW(MtxF* mf, Vec3f* src, Vec3f* xyzDest, f32* wDest); +void SkinMatrix_Vec3fMtxFMultXYZ(MtxF* mf, Vec3f* src, Vec3f* dest); +void SkinMatrix_MtxFMtxFMult(MtxF* mfA, MtxF* mfB, MtxF* dest); +void SkinMatrix_GetClear(MtxF** mfp); +void SkinMatrix_MtxFCopy(MtxF* src, MtxF* dest); +s32 SkinMatrix_Invert(MtxF* src, MtxF* dest); +void SkinMatrix_SetScale(MtxF* mf, f32 x, f32 y, f32 z); +void SkinMatrix_SetRotateZYX(MtxF* mf, s16 x, s16 y, s16 z); +void SkinMatrix_SetTranslate(MtxF* mf, f32 x, f32 y, f32 z); +void SkinMatrix_SetTranslateRotateYXZScale(MtxF* dest, f32 scaleX, f32 scaleY, f32 scaleZ, s16 rotX, s16 rotY, s16 rotZ, + f32 translateX, f32 translateY, f32 translateZ); +void SkinMatrix_SetTranslateRotateZYX(MtxF* dest, s16 rotX, s16 rotY, s16 rotZ, f32 translateX, f32 translateY, + f32 translateZ); +Mtx* SkinMatrix_MtxFToNewMtx(struct GraphicsContext* gfxCtx, MtxF* src); +void SkinMatrix_SetRotateAxis(MtxF* mf, s16 angle, f32 axisX, f32 axisY, f32 axisZ); + +#endif diff --git a/include/z64skybox.h b/include/z64skybox.h index 2e6725bac0..2d7bb2923f 100644 --- a/include/z64skybox.h +++ b/include/z64skybox.h @@ -11,7 +11,7 @@ struct GameState; struct GraphicsContext; struct LightContext; -typedef enum { +typedef enum SkyboxId { /* 0x00 */ SKYBOX_NONE, /* 0x01 */ SKYBOX_NORMAL_SKY, /* 0x02 */ SKYBOX_BAZAAR, @@ -42,7 +42,7 @@ typedef enum { /* 0x27 */ SKYBOX_UNSET_27 = 39 } SkyboxId; -typedef enum { +typedef enum SkyboxDrawType { /* 0 */ SKYBOX_DRAW_128, // 128x128 top/bottom faces, 128x64 side faces /* 1 */ SKYBOX_DRAW_256_4FACE, // 256x256 all side faces with per-face palettes /* 2 */ SKYBOX_DRAW_256_3FACE // 256x256 3/4 side faces with per-face palettes @@ -60,7 +60,7 @@ typedef struct SkyboxContext { /* 0x150 */ char unk_150[0x10]; } SkyboxContext; // size = 0x160 -typedef struct { +typedef struct SkyboxFile { /* 0x00 */ RomFile file; /* 0x08 */ RomFile palette; } SkyboxFile; // size = 0x10 diff --git a/include/z64sram.h b/include/z64sram.h index 0f87f55fcd..36478c1716 100644 --- a/include/z64sram.h +++ b/include/z64sram.h @@ -3,14 +3,14 @@ #include "ultra64/ultratypes.h" -typedef struct { +typedef struct SramContext { /* 0x00 */ u8* readBuff; } SramContext; // size = 0x4 #define SRAM_SIZE 0x8000 #define SRAM_HEADER_SIZE 0x10 -typedef enum { +typedef enum SramHeaderField { /* 0x00 */ SRAM_HEADER_SOUND, /* 0x01 */ SRAM_HEADER_ZTARGET, /* 0x02 */ SRAM_HEADER_LANGUAGE, diff --git a/include/z64transition.h b/include/z64transition.h index 9cf74f7229..569b8fb328 100644 --- a/include/z64transition.h +++ b/include/z64transition.h @@ -9,7 +9,7 @@ #define TRANS_TRIGGER_START 20 // start transition (exiting an area) #define TRANS_TRIGGER_END -20 // transition is ending (arriving in a new area) -typedef enum { +typedef enum TransitionMode { /* 0 */ TRANS_MODE_OFF, /* 1 */ TRANS_MODE_SETUP, /* 2 */ TRANS_MODE_INSTANCE_INIT, @@ -30,7 +30,7 @@ typedef enum { /* 17 */ TRANS_MODE_CS_BLACK_FILL } TransitionMode; -typedef enum { +typedef enum TransitionType { /* 0 */ TRANS_TYPE_WIPE, /* 1 */ TRANS_TYPE_TRIFORCE, /* 2 */ TRANS_TYPE_FADE_BLACK, @@ -62,7 +62,7 @@ typedef enum { #define TRANS_TYPE_CIRCLE(appearance, color, speed) ((1 << 5) | ((color & 3) << 3) | ((appearance & 3) << 1) | (speed & 1)) -typedef struct { +typedef struct TransitionContext { union { TransitionFade fade; TransitionCircle circle; diff --git a/include/z64transition_instances.h b/include/z64transition_instances.h index 1d08ab34ba..154b98d008 100644 --- a/include/z64transition_instances.h +++ b/include/z64transition_instances.h @@ -4,12 +4,12 @@ #include "ultra64.h" #include "color.h" -typedef struct { +typedef struct TransitionTileVtxData { /* 0x0 */ f32 x; /* 0x4 */ f32 y; } TransitionTileVtxData; // size = 0x8 -typedef struct { +typedef struct TransitionTile { /* 0x00 */ s32 cols; /* 0x04 */ s32 rows; /* 0x08 */ s32 frame; @@ -23,12 +23,12 @@ typedef struct { /* 0xDC */ u16* zBuffer; } TransitionTile; // size = 0xE0 -typedef enum { +typedef enum TransitionInstanceType { /* 1 */ TRANS_INSTANCE_TYPE_FILL_OUT = 1, /* 2 */ TRANS_INSTANCE_TYPE_FILL_IN } TransitionInstanceType; -typedef struct { +typedef struct TransitionWipe { /* 0x000 */ Color_RGBA8_u32 color; /* 0x004 */ Color_RGBA8_u32 unkColor; /* 0x008 */ u8 direction; @@ -44,7 +44,7 @@ typedef struct { #define TRANS_INSTANCE_TYPE_FADE_FLASH 3 -typedef struct { +typedef struct TransitionFade { /* 0x000 */ u8 type; /* 0x001 */ u8 isDone; /* 0x002 */ u8 direction; @@ -52,26 +52,26 @@ typedef struct { /* 0x008 */ u16 timer; } TransitionFade; // size = 0xC -typedef enum { +typedef enum TransitionCircleAppearance { /* 0 */ TCA_NORMAL, /* 1 */ TCA_WAVE, /* 2 */ TCA_RIPPLE, /* 3 */ TCA_STARBURST } TransitionCircleAppearance; -typedef enum { +typedef enum TransitionCircleColor { /* 0 */ TCC_BLACK, /* 1 */ TCC_WHITE, /* 2 */ TCC_GRAY, /* 3 */ TCC_SPECIAL // color varies depending on appearance. unused and appears broken } TransitionCircleColor; -typedef enum { +typedef enum TransitionCircleSpeed { /* 0 */ TCS_FAST, /* 1 */ TCS_SLOW } TransitionCircleSpeed; -typedef struct { +typedef struct TransitionCircle { /* 0x000 */ Color_RGBA8_u32 color; /* 0x004 */ Color_RGBA8_u32 unkColor; /* 0x008 */ s32 texX; @@ -90,7 +90,7 @@ typedef struct { /* 0x0A8 */ Mtx modelView[2][3]; } TransitionCircle; // size = 0x228 -typedef struct { +typedef struct TransitionTriforce { /* 0x000 */ Color_RGBA8_u32 color; /* 0x004 */ f32 transPos; /* 0x008 */ f32 step; diff --git a/include/z64view.h b/include/z64view.h index 058a4df049..073e1af4ef 100644 --- a/include/z64view.h +++ b/include/z64view.h @@ -5,14 +5,25 @@ struct GraphicsContext; -typedef struct { +typedef struct Viewport { /* 0x0 */ s32 topY; // uly (upper left y) /* 0x4 */ s32 bottomY; // lry (lower right y) /* 0x8 */ s32 leftX; // ulx (upper left x) /* 0xC */ s32 rightX; // lrx (lower right x) } Viewport; // size = 0x10 -typedef struct { +#define SET_FULLSCREEN_VIEWPORT(view) \ + { \ + Viewport viewport; \ + viewport.bottomY = SCREEN_HEIGHT; \ + viewport.rightX = SCREEN_WIDTH; \ + viewport.topY = 0; \ + viewport.leftX = 0; \ + View_SetViewport(view, &viewport); \ + } \ + (void)0 + +typedef struct View { /* 0x000 */ s32 magic; // string literal "VIEW" / 0x56494557 /* 0x004 */ struct GraphicsContext* gfxCtx; /* 0x008 */ Viewport viewport; @@ -58,4 +69,33 @@ typedef struct { #define VIEW_ERROR_CHECK_EYE_POS(x, y, z) (void)0 #endif +View* View_New(struct GraphicsContext* gfxCtx); +void View_Free(View* view); +void View_Init(View*, struct GraphicsContext*); +void View_LookAt(View* view, Vec3f* eye, Vec3f* at, Vec3f* up); +void View_LookAtUnsafe(View* view, Vec3f* eye, Vec3f* at, Vec3f* up); +void View_SetScale(View* view, f32 scale); +void View_GetScale(View* view, f32* scale); +void View_SetPerspective(View* view, f32 fovy, f32 zNear, f32 zFar); +void View_GetPerspective(View* view, f32* fovy, f32* zNear, f32* zFar); +void View_SetOrtho(View* view, f32 fovy, f32 zNear, f32 zFar); +void View_GetOrtho(View* view, f32* fovy, f32* zNear, f32* zFar); +void View_SetViewport(View* view, Viewport* viewport); +void View_GetViewport(View* view, Viewport* viewport); +void View_SetDistortionOrientation(View* view, f32 rotX, f32 rotY, f32 rotZ); +void View_SetDistortionScale(View* view, f32 scaleX, f32 scaleY, f32 scaleZ); +s32 View_SetDistortionSpeed(View* view, f32 speed); +void View_InitDistortion(View* view); +void View_ClearDistortion(View* view); +void View_SetDistortion(View* view, Vec3f orientation, Vec3f scale, f32 speed); +s32 View_StepDistortion(View* view, Mtx* projectionMtx); +s32 View_Apply(View* view, s32 mask); +s32 View_ApplyOrthoToOverlay(View* view); +s32 View_ApplyPerspectiveToOverlay(View* view); +s32 View_UpdateViewingMatrix(View* view); +s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP); +#if IS_DEBUG +s32 View_ErrorCheckEyePosition(f32 eyeX, f32 eyeY, f32 eyeZ); +#endif + #endif diff --git a/include/z64vis.h b/include/z64vis.h index 371b2346bd..fcd24d1b76 100644 --- a/include/z64vis.h +++ b/include/z64vis.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "color.h" -typedef enum { +typedef enum FramebufferFilterType { /* 0 */ FB_FILTER_NONE, /* 1 */ FB_FILTER_CVG_RGB, /* 2 */ FB_FILTER_CVG_RGB_UNIFORM, @@ -15,12 +15,12 @@ typedef enum { /* 7 */ FB_FILTER_MONO } FramebufferFilterType; -typedef enum { +typedef enum VisScissorType { /* 0 */ VIS_NO_SETSCISSOR, /* 1 */ VIS_SETSCISSOR } VisScissorType; -typedef struct { +typedef struct Vis { /* 0x00 */ u32 type; /* 0x04 */ u32 scissorType; /* 0x08 */ Color_RGBA8_u32 primColor; @@ -33,7 +33,7 @@ typedef struct { #define FB_FILTER_TO_CVG_TYPE(filter) (filter) -typedef enum { +typedef enum VisCvgType { /* 0 */ VIS_CVG_TYPE_NONE = FB_FILTER_TO_CVG_TYPE(FB_FILTER_NONE), /* 1 */ VIS_CVG_TYPE_CVG_RGB = FB_FILTER_TO_CVG_TYPE(FB_FILTER_CVG_RGB), /* 2 */ VIS_CVG_TYPE_CVG_RGB_UNIFORM = FB_FILTER_TO_CVG_TYPE(FB_FILTER_CVG_RGB_UNIFORM), @@ -41,7 +41,7 @@ typedef enum { /* 4 */ VIS_CVG_TYPE_CVG_RGB_FOG = FB_FILTER_TO_CVG_TYPE(FB_FILTER_CVG_RGB_FOG) } VisCvgType; -typedef struct { +typedef struct VisCvg { /* 0x00 */ Vis vis; } VisCvg; // size = 0x10 @@ -71,12 +71,12 @@ void VisMono_Draw(VisMono* this, Gfx** gfxP); #define FB_FILTER_TO_ZBUF_TYPE(filter) ((filter) - FB_FILTER_ZBUF_IA) -typedef enum { +typedef enum VisZBufType { /* 0 */ VIS_ZBUF_TYPE_IA = FB_FILTER_TO_ZBUF_TYPE(FB_FILTER_ZBUF_IA), /* 1 */ VIS_ZBUF_TYPE_RGBA = FB_FILTER_TO_ZBUF_TYPE(FB_FILTER_ZBUF_RGBA) } VisZBufType; -typedef struct { +typedef struct VisZBuf { /* 0x00 */ Vis vis; } VisZBuf; // size = 0x10 diff --git a/include/zelda_arena.h b/include/zelda_arena.h new file mode 100644 index 0000000000..10409581d8 --- /dev/null +++ b/include/zelda_arena.h @@ -0,0 +1,37 @@ +#ifndef ZELDA_ARENA_H +#define ZELDA_ARENA_H + +#include "ultra64.h" + +void* ZeldaArena_Malloc(u32 size); +void* ZeldaArena_MallocR(u32 size); +void* ZeldaArena_Realloc(void* ptr, u32 newSize); +void ZeldaArena_Free(void* ptr); +void* ZeldaArena_Calloc(u32 num, u32 size); +void ZeldaArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc); +void ZeldaArena_Check(void); +void ZeldaArena_Init(void* start, u32 size); +void ZeldaArena_Cleanup(void); +s32 ZeldaArena_IsInitialized(void); + +#if IS_DEBUG +void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action); +void* ZeldaArena_MallocDebug(u32 size, const char* file, int line); +void* ZeldaArena_MallocRDebug(u32 size, const char* file, int line); +void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line); +void ZeldaArena_FreeDebug(void* ptr, const char* file, int line); +void ZeldaArena_Display(void); + +#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 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 + +#endif diff --git a/linker_scripts/data_with_rodata.ld b/linker_scripts/data_with_rodata.ld new file mode 100644 index 0000000000..8d508ee18b --- /dev/null +++ b/linker_scripts/data_with_rodata.ld @@ -0,0 +1,22 @@ +OUTPUT_ARCH (mips) + +/* Maps data into rodata, used for audio tables and z_message/z_game_over */ + +SECTIONS { + .rodata : + { + *(.data) + *(.rodata) + *(.rodata.str*) + *(.rodata.cst*) + } + + /DISCARD/ : + { + /* GNU ld assumes that the linker script always combines .gptab.data and + * .gptab.sdata into .gptab.sdata, and likewise for .gptab.bss and .gptab.sbss. + * To avoid dealing with this, we just discard all .gptab sections. + */ + *(.gptab.*) + } +} diff --git a/linker_scripts/soundfont.ld b/linker_scripts/soundfont.ld new file mode 100644 index 0000000000..d914a7de31 --- /dev/null +++ b/linker_scripts/soundfont.ld @@ -0,0 +1,19 @@ +OUTPUT_ARCH (mips) + +/* Soundfont Linker Script, maps data into rodata and adds a file length symbol */ + +SECTIONS { + + .rodata : + { + *(.data*) + *(.rodata*) + . = ALIGN(16); + __LEN__ = . - ADDR(.rodata); + } + + /DISCARD/ : + { + *(*); + } +} diff --git a/requirements.txt b/requirements.txt index 05f2ae930d..806233c045 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,7 @@ toml mapfile-parser>=2.3.5,<3.0.0 pyelftools==0.30 rabbitizer>=1.0.0,<2.0.0 -spimdisasm>=1.21.0,<2.0.0 +spimdisasm>=1.28.1,<2.0.0 ### --- HackerOoT --- ### diff --git a/spec b/spec index 218eedfc7d..adcb297a7c 100644 --- a/spec +++ b/spec @@ -3,6 +3,7 @@ */ #include "include/config.h" +#include "include/versions.h" beginseg name "makerom" @@ -15,11 +16,12 @@ beginseg name "boot" address 0x80000460 include "$(BUILD_DIR)/src/boot/boot_main.o" - include "$(BUILD_DIR)/data/unk_800093F0.data.o" - include "$(BUILD_DIR)/data/unk_80009410.data.o" include "$(BUILD_DIR)/src/boot/vimodepal60lan1.o" include "$(BUILD_DIR)/src/boot/idle.o" +#if OOT_VERSION >= PAL_1_0 include "$(BUILD_DIR)/src/boot/viconfig.o" +#endif + include "$(BUILD_DIR)/src/boot/carthandle.o" include "$(BUILD_DIR)/src/boot/z_std_dma.o" #if COMPRESS_YAZ include "$(BUILD_DIR)/src/compression/yaz0.o" @@ -29,31 +31,47 @@ beginseg include "$(BUILD_DIR)/src/compression/aplib.o" #endif include "$(BUILD_DIR)/src/boot/z_locale.o" +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/boot/cic6105.o" +#endif #if IS_DEBUG include "$(BUILD_DIR)/src/boot/assert.o" #endif include "$(BUILD_DIR)/src/boot/is_debug.o" - include "$(BUILD_DIR)/src/libultra/io/driverominit.o" + include "$(BUILD_DIR)/src/boot/driverominit.o" include "$(BUILD_DIR)/src/boot/mio0.o" include "$(BUILD_DIR)/src/boot/stackcheck.o" include "$(BUILD_DIR)/src/boot/logutils.o" +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/libc64/sleep.o" +#endif #if IS_DEBUG - include "$(BUILD_DIR)/src/libultra/libc/sprintf.o" + include "$(BUILD_DIR)/src/libc64/sprintf.o" #endif include "$(BUILD_DIR)/src/libultra/io/piacs.o" include "$(BUILD_DIR)/src/libultra/os/sendmesg.o" include "$(BUILD_DIR)/src/libultra/os/stopthread.o" +#if OOT_VERSION >= PAL_1_0 include "$(BUILD_DIR)/src/libultra/io/viextendvstart.o" include "$(BUILD_DIR)/src/libultra/io/vimodepallan1.o" +#endif include "$(BUILD_DIR)/src/libultra/os/recvmesg.o" +#if !PLATFORM_N64 include "$(BUILD_DIR)/src/libultra/os/initialize.o" +#endif include "$(BUILD_DIR)/src/libultra/libc/ll.o" include "$(BUILD_DIR)/src/libultra/os/exceptasm.o" include "$(BUILD_DIR)/src/libultra/os/thread.o" include "$(BUILD_DIR)/src/libultra/os/destroythread.o" include "$(BUILD_DIR)/src/libultra/libc/bzero.o" +#if !PLATFORM_N64 include "$(BUILD_DIR)/src/libultra/os/parameters.o" +#endif include "$(BUILD_DIR)/src/libultra/os/createthread.o" +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/libultra/os/initialize.o" + include "$(BUILD_DIR)/src/libultra/os/parameters.o" +#endif include "$(BUILD_DIR)/src/libultra/os/setsr.o" include "$(BUILD_DIR)/src/libultra/os/getsr.o" include "$(BUILD_DIR)/src/libultra/os/writebackdcache.o" @@ -75,7 +93,7 @@ beginseg #endif include "$(BUILD_DIR)/src/libultra/os/unmaptlball.o" include "$(BUILD_DIR)/src/libultra/io/epidma.o" -#if IS_DEBUG || COMPILER_GCC +#if IS_DEBUG || defined(COMPILER_GCC) include "$(BUILD_DIR)/src/libultra/libc/string.o" #endif include "$(BUILD_DIR)/src/libultra/os/invalicache.o" @@ -86,9 +104,13 @@ beginseg include "$(BUILD_DIR)/src/libultra/os/setthreadpri.o" include "$(BUILD_DIR)/src/libultra/os/getthreadpri.o" include "$(BUILD_DIR)/src/libultra/io/epirawread.o" +#if OOT_VERSION >= PAL_1_0 include "$(BUILD_DIR)/src/libultra/io/viswapbuf.o" +#endif include "$(BUILD_DIR)/src/libultra/io/epirawdma.o" +#if !PLATFORM_N64 include "$(BUILD_DIR)/src/libultra/libc/bcmp.o" +#endif include "$(BUILD_DIR)/src/libultra/os/gettime.o" include "$(BUILD_DIR)/src/libultra/os/timerintr.o" include "$(BUILD_DIR)/src/libultra/os/getcount.o" @@ -97,20 +119,31 @@ beginseg include "$(BUILD_DIR)/src/libultra/libc/bcopy.o" include "$(BUILD_DIR)/src/libultra/os/resetglobalintmask.o" include "$(BUILD_DIR)/src/libultra/os/interrupt.o" +#if !OOT_PAL_N64 include "$(BUILD_DIR)/src/libultra/io/vimodentsclan1.o" include "$(BUILD_DIR)/src/libultra/io/vimodempallan1.o" +#endif include "$(BUILD_DIR)/src/libultra/io/vi.o" +#if OOT_PAL_N64 + include "$(BUILD_DIR)/src/libultra/io/vimodentsclan1.o" + include "$(BUILD_DIR)/src/libultra/io/vimodempallan1.o" +#endif +#if OOT_VERSION < PAL_1_0 + include "$(BUILD_DIR)/src/libultra/io/vimodepallan1.o" +#endif include "$(BUILD_DIR)/src/libultra/io/viswapcontext.o" include "$(BUILD_DIR)/src/libultra/io/pigetcmdq.o" include "$(BUILD_DIR)/src/libultra/io/epiread.o" +#if OOT_VERSION >= PAL_1_0 include "$(BUILD_DIR)/src/libultra/io/visetspecial.o" +#endif include "$(BUILD_DIR)/src/libultra/io/cartrominit.o" -#if IS_DEBUG +#if OOT_PAL_N64 || IS_DEBUG include "$(BUILD_DIR)/src/libultra/io/vimodefpallan1.o" #endif include "$(BUILD_DIR)/src/libultra/os/setfpccsr.o" include "$(BUILD_DIR)/src/libultra/os/getfpccsr.o" -#if IS_DEBUG +#if PLATFORM_N64 || IS_DEBUG include "$(BUILD_DIR)/src/libultra/io/epiwrite.o" #endif include "$(BUILD_DIR)/src/libultra/os/maptlbrdb.o" @@ -122,17 +155,27 @@ beginseg include "$(BUILD_DIR)/src/libultra/libc/ldiv.o" include "$(BUILD_DIR)/src/libultra/libc/xldtob.o" #endif - include "$(BUILD_DIR)/src/boot/build.o" +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/libultra/os/settimer.o" +#endif include "$(BUILD_DIR)/src/libultra/io/sirawwrite.o" include "$(BUILD_DIR)/src/libultra/io/vimgr.o" include "$(BUILD_DIR)/src/libultra/io/vigetcurrcontext.o" include "$(BUILD_DIR)/src/libultra/os/startthread.o" +#if OOT_VERSION >= PAL_1_0 include "$(BUILD_DIR)/src/libultra/io/visetyscale.o" include "$(BUILD_DIR)/src/libultra/io/visetxscale.o" +#endif include "$(BUILD_DIR)/src/libultra/os/sethwintrroutine.o" include "$(BUILD_DIR)/src/libultra/os/gethwintrroutine.o" +#if !PLATFORM_N64 include "$(BUILD_DIR)/src/libultra/os/setwatchlo.o" +#endif + include "$(BUILD_DIR)/src/boot/build.o" + include "$(BUILD_DIR)/data/cic6105.text.o" #ifdef COMPILER_GCC + include "$(BUILD_DIR)/src/libc/memset.o" + include "$(BUILD_DIR)/src/libc/memmove.o" include "$(BUILD_DIR)/src/gcc_fix/missing_gcc_functions.o" #endif endseg @@ -144,18 +187,171 @@ endseg beginseg name "Audiobank" - address 0x10 // fake RAM address to avoid map lookup inaccuracies - include "$(BUILD_DIR)/baserom/Audiobank.o" + address 0 + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_0.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_1.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_2.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_3.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_4.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_5.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_6.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_7.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_8.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_9.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_10.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_11.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_12.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_13.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_14.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_15.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_16.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_17.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_18.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_19.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_20.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_21.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_22.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_23.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_24.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_25.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_26.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_27.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_28.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_29.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_30.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_31.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_32.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_33.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_34.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_35.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_36.o" + include "$(BUILD_DIR)/assets/audio/soundfonts/Soundfont_37.o" + include "$(BUILD_DIR)/assets/audio/audiobank_padding.o" endseg beginseg name "Audioseq" - include "$(BUILD_DIR)/baserom/Audioseq.o" + address 0 + include "$(BUILD_DIR)/assets/audio/sequences/seq_0.prg.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_1.prg.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_2.prg.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_3.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_4.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_5.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_6.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_7.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_8.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_9.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_10.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_11.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_12.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_13.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_14.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_15.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_16.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_17.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_18.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_19.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_20.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_21.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_22.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_23.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_24.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_25.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_26.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_27.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_28.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_29.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_30.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_31.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_32.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_33.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_34.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_35.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_36.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_37.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_38.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_39.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_40.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_41.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_42.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_43.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_44.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_45.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_46.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_47.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_48.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_49.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_50.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_51.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_52.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_53.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_54.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_55.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_56.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_57.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_58.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_59.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_60.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_61.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_62.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_63.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_64.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_65.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_66.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_67.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_68.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_69.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_70.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_71.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_72.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_73.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_74.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_75.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_76.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_77.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_78.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_79.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_80.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_81.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_82.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_83.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_84.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_85.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_86.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_88.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_89.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_90.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_91.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_92.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_93.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_94.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_95.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_96.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_97.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_98.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_99.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_100.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_101.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_102.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_103.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_104.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_105.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_106.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_107.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_108.o" + include "$(BUILD_DIR)/assets/audio/sequences/seq_109.prg.o" endseg beginseg name "Audiotable" - include "$(BUILD_DIR)/baserom/Audiotable.o" + address 0 + include "$(BUILD_DIR)/assets/audio/samplebanks/SampleBank_0.o" + include "$(BUILD_DIR)/assets/audio/samplebanks/SampleBank_2.o" + include "$(BUILD_DIR)/assets/audio/samplebanks/SampleBank_3.o" + include "$(BUILD_DIR)/assets/audio/samplebanks/SampleBank_4.o" + include "$(BUILD_DIR)/assets/audio/samplebanks/SampleBank_5.o" + include "$(BUILD_DIR)/assets/audio/samplebanks/SampleBank_6.o" endseg #if OOT_NTSC @@ -276,6 +472,15 @@ beginseg number 7 endseg +#if OOT_NTSC && OOT_VERSION < NTSC_1_2 +beginseg + name "jpn_message_data_static" + romalign 0x1000 + include "$(BUILD_DIR)/assets/text/jpn_message_data_static.o" + number 8 +endseg +#endif + beginseg name "message_texture_static" romalign 0x1000 @@ -290,7 +495,7 @@ beginseg number 10 endseg -#if OOT_NTSC +#if OOT_NTSC && OOT_VERSION >= NTSC_1_2 beginseg name "jpn_message_data_static" romalign 0x1000 @@ -336,6 +541,15 @@ beginseg number 11 endseg +#if PLATFORM_N64 +beginseg + name "map_i_static" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/map_i_static/map_i_static.o" + number 11 +endseg +#endif + beginseg name "map_48x85_static" romalign 0x1000 @@ -343,12 +557,14 @@ beginseg number 11 endseg +#if !PLATFORM_N64 beginseg name "map_i_static" romalign 0x1000 include "$(BUILD_DIR)/assets/textures/map_i_static/map_i_static.o" number 11 endseg +#endif beginseg name "code" @@ -485,16 +701,26 @@ beginseg include "$(BUILD_DIR)/src/code/sys_rumble.o" include "$(BUILD_DIR)/src/code/code_800D31A0.o" include "$(BUILD_DIR)/src/code/irqmgr.o" +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/code/code_n64dd_800AD410.o" + include "$(BUILD_DIR)/src/code/code_n64dd_800AD4C0.o" +#endif #if IS_DEBUG_HEAP_ENABLED include "$(BUILD_DIR)/src/code/debug_malloc.o" #endif - include "$(BUILD_DIR)/src/code/fault.o" - include "$(BUILD_DIR)/src/code/fault_drawer.o" +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/code/fault_n64.o" +#else + include "$(BUILD_DIR)/src/code/fault_gc.o" + include "$(BUILD_DIR)/src/code/fault_gc_drawer.o" +#endif include "$(BUILD_DIR)/src/code/kanread.o" #if IS_DEBUG include "$(BUILD_DIR)/src/code/ucode_disas.o" #endif - pad_text // on GameCube, NTSC 1.0 and "0.9" prerelease +#if OOT_VERSION < NTSC_1_1 || PLATFORM_GC + pad_text +#endif include "$(BUILD_DIR)/src/audio/lib/data.o" include "$(BUILD_DIR)/src/audio/lib/synthesis.o" include "$(BUILD_DIR)/src/audio/lib/heap.o" @@ -502,40 +728,60 @@ beginseg include "$(BUILD_DIR)/src/audio/lib/thread.o" include "$(BUILD_DIR)/src/audio/lib/dcache.o" include "$(BUILD_DIR)/src/audio/lib/aisetnextbuf.o" +#if OOT_PAL_N64 + pad_text + pad_text + pad_text +#endif include "$(BUILD_DIR)/src/audio/lib/playback.o" include "$(BUILD_DIR)/src/audio/lib/effects.o" include "$(BUILD_DIR)/src/audio/lib/seqplayer.o" include "$(BUILD_DIR)/src/audio/general.o" -#if !IS_DEBUG - pad_text // on retail GameCube +#if PLATFORM_GC && !IS_DEBUG + pad_text #endif include "$(BUILD_DIR)/src/audio/sfx_params.o" include "$(BUILD_DIR)/src/audio/sfx.o" include "$(BUILD_DIR)/src/audio/sequence.o" include "$(BUILD_DIR)/src/audio/data.o" include "$(BUILD_DIR)/src/audio/session_config.o" - include "$(BUILD_DIR)/src/code/logseverity.o" +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/code/gfxprint.o" + include "$(BUILD_DIR)/src/code/rcp_utils.o" + include "$(BUILD_DIR)/src/code/loadfragment2_n64.o" + include "$(BUILD_DIR)/src/code/padutils.o" + include "$(BUILD_DIR)/src/code/code_800FC620.o" + include "$(BUILD_DIR)/src/code/padsetup.o" +#else + include "$(BUILD_DIR)/src/code/logseverity_gc.o" include "$(BUILD_DIR)/src/code/gfxprint.o" include "$(BUILD_DIR)/src/code/rcp_utils.o" - include "$(BUILD_DIR)/src/code/loadfragment2.o" + include "$(BUILD_DIR)/src/code/loadfragment2_gc.o" #if IS_DEBUG include "$(BUILD_DIR)/src/code/mtxuty-cvt.o" #endif - include "$(BUILD_DIR)/src/code/relocation.o" - include "$(BUILD_DIR)/src/code/load.o" + include "$(BUILD_DIR)/src/code/relocation_gc.o" + include "$(BUILD_DIR)/src/code/load_gc.o" include "$(BUILD_DIR)/src/code/code_800FC620.o" include "$(BUILD_DIR)/src/code/padutils.o" include "$(BUILD_DIR)/src/code/padsetup.o" - include "$(BUILD_DIR)/src/code/fp_math.o" - include "$(BUILD_DIR)/src/code/fp.o" - include "$(BUILD_DIR)/src/code/system_malloc.o" - include "$(BUILD_DIR)/src/code/rand.o" - include "$(BUILD_DIR)/src/code/__osMalloc.o" +#endif + include "$(BUILD_DIR)/src/libc64/math64.o" + include "$(BUILD_DIR)/src/libc64/fp.o" + include "$(BUILD_DIR)/src/libc64/malloc.o" + include "$(BUILD_DIR)/src/libc64/qrand.o" +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/libc64/__osMalloc_n64.o" +#else + include "$(BUILD_DIR)/src/libc64/__osMalloc_gc.o" +#endif #if !IS_DEBUG - include "$(BUILD_DIR)/src/libultra/libc/sprintf.o" + include "$(BUILD_DIR)/src/libc64/sprintf.o" +#endif + include "$(BUILD_DIR)/src/libc64/aprintf.o" +#if !PLATFORM_N64 + include "$(BUILD_DIR)/src/libc64/sleep.o" #endif - include "$(BUILD_DIR)/src/code/printutils.o" - include "$(BUILD_DIR)/src/code/sleep.o" include "$(BUILD_DIR)/src/code/jpegutils.o" include "$(BUILD_DIR)/src/code/jpegdecoder.o" #if ENABLE_F3DEX3 @@ -544,7 +790,14 @@ beginseg #if IS_DEBUG include "$(BUILD_DIR)/src/libultra/io/pfsfreeblocks.o" #endif +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/libultra/os/getintmask.o" +#endif +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/libultra/gu/scale.o" +#else include "$(BUILD_DIR)/src/libultra/mgu/scale.o" +#endif include "$(BUILD_DIR)/src/libultra/gu/sinf.o" include "$(BUILD_DIR)/src/libultra/gu/sins.o" include "$(BUILD_DIR)/src/libultra/io/sptask.o" @@ -560,7 +813,12 @@ beginseg include "$(BUILD_DIR)/src/libultra/io/pfsreadwritefile.o" include "$(BUILD_DIR)/src/libultra/io/pfsgetstatus.o" #endif +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/libultra/gu/mtxutil.o" +#endif +#if !PLATFORM_N64 include "$(BUILD_DIR)/src/libultra/mgu/mtxidentf.o" +#endif include "$(BUILD_DIR)/src/libultra/gu/lookat.o" #if IS_DEBUG include "$(BUILD_DIR)/src/libultra/io/pfsallocatefile.o" @@ -568,7 +826,9 @@ beginseg include "$(BUILD_DIR)/src/libultra/os/stoptimer.o" #if IS_DEBUG include "$(BUILD_DIR)/src/libultra/io/contpfs.o" +#if !PLATFORM_N64 include "$(BUILD_DIR)/src/libultra/mgu/mtxl2f.o" +#endif include "$(BUILD_DIR)/src/libultra/io/pfsfindfile.o" #endif include "$(BUILD_DIR)/src/libultra/gu/sqrtf.o" @@ -578,17 +838,26 @@ beginseg #if !IS_DEBUG include "$(BUILD_DIR)/src/libultra/libc/xprintf.o" #endif -#if !IS_DEBUG && !COMPILER_GCC +#if !IS_DEBUG && !defined(COMPILER_GCC) include "$(BUILD_DIR)/src/libultra/libc/string.o" #endif include "$(BUILD_DIR)/src/libultra/io/sp.o" +#if OOT_VERSION < PAL_1_0 + include "$(BUILD_DIR)/src/libultra/io/viswapbuf.o" +#endif +#if !PLATFORM_N64 include "$(BUILD_DIR)/src/libultra/mgu/mtxident.o" +#endif include "$(BUILD_DIR)/src/libultra/gu/position.o" include "$(BUILD_DIR)/src/libultra/io/sptaskyielded.o" include "$(BUILD_DIR)/src/libultra/gu/rotate.o" include "$(BUILD_DIR)/src/libultra/io/aisetfreq.o" include "$(BUILD_DIR)/src/libultra/os/getactivequeue.o" +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/libultra/gu/normalize.o" +#else include "$(BUILD_DIR)/src/libultra/mgu/normalize.o" +#endif include "$(BUILD_DIR)/src/libultra/io/dpgetstat.o" include "$(BUILD_DIR)/src/libultra/io/dpsetstat.o" #if IS_DEBUG @@ -597,7 +866,13 @@ beginseg include "$(BUILD_DIR)/src/libultra/gu/ortho.o" include "$(BUILD_DIR)/src/libultra/gu/cosf.o" include "$(BUILD_DIR)/src/libultra/gu/libm_vals.o" +#if OOT_VERSION < PAL_1_0 + include "$(BUILD_DIR)/src/libultra/io/visetspecial.o" +#endif include "$(BUILD_DIR)/src/libultra/gu/coss.o" +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/libultra/os/settime.o" +#endif include "$(BUILD_DIR)/src/libultra/io/visetevent.o" #if IS_DEBUG include "$(BUILD_DIR)/src/libultra/io/pfsisplug.o" @@ -611,20 +886,35 @@ beginseg include "$(BUILD_DIR)/src/libultra/io/pfschecker.o" #endif include "$(BUILD_DIR)/src/libultra/io/aigetlen.o" +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/libultra/gu/translate.o" +#else include "$(BUILD_DIR)/src/libultra/mgu/translate.o" +#endif include "$(BUILD_DIR)/src/libultra/io/contramwrite.o" -#if !IS_DEBUG +#if OOT_VERSION == NTSC_1_2 || (PLATFORM_GC && !IS_DEBUG) include "$(BUILD_DIR)/src/libultra/io/vimodefpallan1.o" +#endif +#if !IS_DEBUG include "$(BUILD_DIR)/src/libultra/io/pfsgetstatus.o" include "$(BUILD_DIR)/src/libultra/io/contpfs.o" +#endif +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/libultra/libc/bcmp.o" #endif include "$(BUILD_DIR)/src/libultra/io/contramread.o" include "$(BUILD_DIR)/src/libultra/io/crc.o" #if !IS_DEBUG include "$(BUILD_DIR)/src/libultra/io/pfsisplug.o" #endif +#if !PLATFORM_N64 include "$(BUILD_DIR)/src/libultra/os/settimer.o" -#if !IS_DEBUG +#endif +#if PLATFORM_N64 + include "$(BUILD_DIR)/src/libultra/libc/xlitob.o" + include "$(BUILD_DIR)/src/libultra/libc/ldiv.o" + include "$(BUILD_DIR)/src/libultra/libc/xldtob.o" +#elif !IS_DEBUG include "$(BUILD_DIR)/src/libultra/libc/xldtob.o" include "$(BUILD_DIR)/src/libultra/libc/ldiv.o" include "$(BUILD_DIR)/src/libultra/libc/xlitob.o" @@ -633,23 +923,33 @@ beginseg include "$(BUILD_DIR)/src/libultra/io/spsetstat.o" include "$(BUILD_DIR)/src/libultra/os/writebackdcacheall.o" include "$(BUILD_DIR)/src/libultra/os/getcurrfaultedthread.o" +#if !PLATFORM_N64 include "$(BUILD_DIR)/src/libultra/mgu/mtxf2l.o" +#endif include "$(BUILD_DIR)/src/libultra/libc/llcvt.o" +#if OOT_VERSION < PAL_1_0 + include "$(BUILD_DIR)/src/libultra/io/visetyscale.o" +#endif include "$(BUILD_DIR)/src/libultra/io/vigetcurrframebuf.o" include "$(BUILD_DIR)/src/libultra/io/spsetpc.o" - include "$(BUILD_DIR)/src/libultra/libc/sqrt.o" - include "$(BUILD_DIR)/src/libultra/libc/absf.o" - include "$(BUILD_DIR)/src/code/fmodf.o" - include "$(BUILD_DIR)/src/code/__osMemset.o" - include "$(BUILD_DIR)/src/code/__osMemmove.o" - // For some reason, the data sections of these files are placed here near the - // rodata sections of the other files - include_data_only_within_rodata "$(BUILD_DIR)/src/code/z_message.o" - include_data_only_within_rodata "$(BUILD_DIR)/src/code/z_game_over.o" - include_no_data "$(BUILD_DIR)/src/code/z_message.o" - include_no_data "$(BUILD_DIR)/src/code/z_game_over.o" + include "$(BUILD_DIR)/src/libc/sqrt.o" +#if !PLATFORM_N64 + include "$(BUILD_DIR)/src/libc/absf.o" +#endif + include "$(BUILD_DIR)/src/libc/fmodf.o" +#ifndef COMPILER_GCC + include "$(BUILD_DIR)/src/libc/memset.o" + include "$(BUILD_DIR)/src/libc/memmove.o" +#endif + // For some reason, the data sections of z_message and z_game_over are + // placed near the rodata sections of other files, so we first build this + // combined object before the final link. + include "$(BUILD_DIR)/src/code/z_message_z_game_over.o" include "$(BUILD_DIR)/src/code/z_construct.o" - include "$(BUILD_DIR)/data/audio_tables.rodata.o" + include "$(BUILD_DIR)/src/audio/tables/soundfont_table.o" + include "$(BUILD_DIR)/assets/audio/sequence_font_table.o" + include "$(BUILD_DIR)/src/audio/tables/sequence_table.o" + include "$(BUILD_DIR)/src/audio/tables/samplebank_table.o" include "$(BUILD_DIR)/data/rsp.rodata.o" #if !ENABLE_F3DEX3 include "$(BUILD_DIR)/data/f3dzex2.rodata.o" @@ -764,6 +1064,64 @@ beginseg endseg #endif +#if PLATFORM_N64 +beginseg + name "n64dd" + compress + align 0x40 + include "$(BUILD_DIR)/src/n64dd/z_n64dd.o" + include "$(BUILD_DIR)/src/n64dd/n64dd_data_buffer.o" + include "$(BUILD_DIR)/src/n64dd/n64dd_801C8000.o" + include "$(BUILD_DIR)/src/n64dd/n64dd_801C8940.o" + include "$(BUILD_DIR)/src/n64dd/n64dd_801C9440.o" + include "$(BUILD_DIR)/src/n64dd/n64dd_801C9B70.o" + include "$(BUILD_DIR)/src/n64dd/n64dd_error_headers.o" + include "$(BUILD_DIR)/src/n64dd/n64dd_error_bodies.o" + include "$(BUILD_DIR)/src/n64dd/n64dd_error_textures.o" + include "$(BUILD_DIR)/src/n64dd/n64dd_801CA0B0.o" + include "$(BUILD_DIR)/src/libleo/api/readwrite.o" + include "$(BUILD_DIR)/src/libleo/leo/leofunc.o" + include "$(BUILD_DIR)/src/libleo/leo/leoram.o" + include "$(BUILD_DIR)/src/libleo/leo/leoint.o" + include "$(BUILD_DIR)/src/libleo/leo/leocmdex.o" + include "$(BUILD_DIR)/src/libleo/api/getaadr2.o" + include "$(BUILD_DIR)/src/libleo/leo/leoread.o" + include "$(BUILD_DIR)/src/libleo/api/lbatobyte.o" + include "$(BUILD_DIR)/src/libleo/leo/leoinquiry.o" + include "$(BUILD_DIR)/src/libleo/leo/leodiskinit.o" + include "$(BUILD_DIR)/src/libleo/api/seek.o" + include "$(BUILD_DIR)/src/libleo/leo/leord_diskid.o" + include "$(BUILD_DIR)/src/libleo/leo/leomecha.o" + include "$(BUILD_DIR)/src/libleo/api/spdlmotor.o" + include "$(BUILD_DIR)/src/libleo/leo/leo_tbl.o" + include "$(BUILD_DIR)/src/libleo/leo/leotempbuffer.o" + include "$(BUILD_DIR)/src/libleo/leo/leoc2_syndrome.o" + include "$(BUILD_DIR)/src/libleo/leo/leoc2ecc.o" + include "$(BUILD_DIR)/src/libleo/leo/leomseq_tbl.o" + include "$(BUILD_DIR)/src/libleo/leo/leomotor.o" + include "$(BUILD_DIR)/src/libleo/api/driveexist.o" + include "$(BUILD_DIR)/src/libleo/leo/leomode_sel.o" + include "$(BUILD_DIR)/src/libleo/leo/leord_capa.o" + include "$(BUILD_DIR)/src/libleo/leo/leoutil.o" + include "$(BUILD_DIR)/src/libleo/leo/leorezero.o" + include "$(BUILD_DIR)/src/libleo/api/clearqueue.o" + include "$(BUILD_DIR)/src/libleo/api/bytetolba.o" + include "$(BUILD_DIR)/src/libleo/leo/leoreset.o" + include "$(BUILD_DIR)/src/libleo/leo/leotranslat.o" + include "$(BUILD_DIR)/src/libleo/leo/leotimer.o" + include "$(BUILD_DIR)/src/libleo/api/getkadr.o" + include "$(BUILD_DIR)/src/libleo/api/getaadr.o" + include "$(BUILD_DIR)/src/libleo/leo/leoglobals.o" + include "$(BUILD_DIR)/src/libleo/leo/leowrite.o" + include "$(BUILD_DIR)/src/libleo/api/cjcreateleomanager.o" + include "$(BUILD_DIR)/src/libleo/leo/leointerrupt.o" + include "$(BUILD_DIR)/src/libleo/api/cacreateleomanager.o" + include "$(BUILD_DIR)/src/libleo/api/testunitready.o" + include "$(BUILD_DIR)/src/libleo/leo/leotestunit.o" + include "$(BUILD_DIR)/src/libleo/leo/leoseek.o" +endseg +#endif + beginseg name "ovl_title" compress @@ -844,305 +1202,339 @@ beginseg include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Test/ovl_En_Test_reloc.o" endseg +// Overlays for most actors and effects are reordered between versions. On N64 and iQue, +// the overlays are in some arbitrary order, while on GameCube they are sorted alphabetically. +#if !PLATFORM_GC + beginseg - name "ovl_Arms_Hook" + name "ovl_En_GirlA" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Arms_Hook/ovl_Arms_Hook_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_GirlA/z_en_girla.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_GirlA/ovl_En_GirlA_reloc.o" endseg beginseg - name "ovl_Arrow_Fire" + name "ovl_En_Part" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Fire/ovl_Arrow_Fire_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Part/z_en_part.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Part/ovl_En_Part_reloc.o" endseg beginseg - name "ovl_Arrow_Ice" + name "ovl_En_Light" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Ice/ovl_Arrow_Ice_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Light/z_en_light.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Light/ovl_En_Light_reloc.o" endseg beginseg - name "ovl_Arrow_Light" + name "ovl_En_Door" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Light/ovl_Arrow_Light_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Door/z_en_door.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Door/ovl_En_Door_reloc.o" endseg beginseg - name "ovl_Bg_Bdan_Objects" + name "ovl_En_Box" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bdan_Objects/ovl_Bg_Bdan_Objects_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Box/z_en_box.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Box/ovl_En_Box_reloc.o" endseg beginseg - name "ovl_Bg_Bdan_Switch" + name "ovl_En_Poh" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bdan_Switch/ovl_Bg_Bdan_Switch_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Poh/z_en_poh.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Poh/ovl_En_Poh_reloc.o" endseg beginseg - name "ovl_Bg_Bom_Guard" + name "ovl_En_Okuta" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bom_Guard/ovl_Bg_Bom_Guard_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okuta/z_en_okuta.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okuta/ovl_En_Okuta_reloc.o" endseg beginseg - name "ovl_Bg_Bombwall" + name "ovl_En_Bom" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bombwall/ovl_Bg_Bombwall_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom/z_en_bom.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom/ovl_En_Bom_reloc.o" endseg beginseg - name "ovl_Bg_Bowl_Wall" + name "ovl_En_Wallmas" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bowl_Wall/ovl_Bg_Bowl_Wall_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wallmas/ovl_En_Wallmas_reloc.o" endseg beginseg - name "ovl_Bg_Breakwall" + name "ovl_En_Dodongo" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Breakwall/ovl_Bg_Breakwall_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dodongo/ovl_En_Dodongo_reloc.o" endseg beginseg - name "ovl_Bg_Ddan_Jd" + name "ovl_En_Firefly" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ddan_Jd/ovl_Bg_Ddan_Jd_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Firefly/z_en_firefly.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Firefly/ovl_En_Firefly_reloc.o" endseg beginseg - name "ovl_Bg_Ddan_Kd" + name "ovl_En_Horse" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ddan_Kd/ovl_Bg_Ddan_Kd_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse/z_en_horse.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse/ovl_En_Horse_reloc.o" endseg beginseg - name "ovl_Bg_Dodoago" + name "ovl_En_Arrow" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Dodoago/ovl_Bg_Dodoago_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Arrow/z_en_arrow.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Arrow/ovl_En_Arrow_reloc.o" endseg beginseg - name "ovl_Bg_Dy_Yoseizo" + name "ovl_En_Elf" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Dy_Yoseizo/ovl_Bg_Dy_Yoseizo_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Elf/z_en_elf.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Elf/ovl_En_Elf_reloc.o" endseg beginseg - name "ovl_Bg_Ganon_Otyuka" + name "ovl_En_Niw" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ganon_Otyuka/ovl_Bg_Ganon_Otyuka_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw/z_en_niw.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw/ovl_En_Niw_reloc.o" endseg beginseg - name "ovl_Bg_Gate_Shutter" + name "ovl_En_Tite" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gate_Shutter/ovl_Bg_Gate_Shutter_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tite/z_en_tite.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tite/ovl_En_Tite_reloc.o" endseg beginseg - name "ovl_Bg_Gjyo_Bridge" + name "ovl_En_Reeba" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gjyo_Bridge/ovl_Bg_Gjyo_Bridge_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Reeba/z_en_reeba.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Reeba/ovl_En_Reeba_reloc.o" endseg beginseg - name "ovl_Bg_Gnd_Darkmeiro" + name "ovl_En_Peehat" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/ovl_Bg_Gnd_Darkmeiro_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Peehat/z_en_peehat.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Peehat/ovl_En_Peehat_reloc.o" endseg beginseg - name "ovl_Bg_Gnd_Firemeiro" + name "ovl_En_Holl" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/ovl_Bg_Gnd_Firemeiro_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Holl/z_en_holl.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Holl/ovl_En_Holl_reloc.o" endseg beginseg - name "ovl_Bg_Gnd_Iceblock" + name "ovl_En_Scene_Change" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Iceblock/ovl_Bg_Gnd_Iceblock_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Scene_Change/ovl_En_Scene_Change_reloc.o" endseg beginseg - name "ovl_Bg_Gnd_Nisekabe" + name "ovl_En_Zf" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/ovl_Bg_Gnd_Nisekabe_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zf/z_en_zf.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zf/ovl_En_Zf_reloc.o" endseg beginseg - name "ovl_Bg_Gnd_Soulmeiro" + name "ovl_En_Hata" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/ovl_Bg_Gnd_Soulmeiro_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hata/z_en_hata.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hata/ovl_En_Hata_reloc.o" endseg beginseg - name "ovl_Bg_Haka" + name "ovl_Boss_Dodongo" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka/ovl_Bg_Haka_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Dodongo/ovl_Boss_Dodongo_reloc.o" endseg beginseg - name "ovl_Bg_Haka_Gate" + name "ovl_Boss_Goma" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Gate/ovl_Bg_Haka_Gate_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Goma/ovl_Boss_Goma_reloc.o" endseg beginseg - name "ovl_Bg_Haka_Huta" + name "ovl_En_Zl1" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Huta/ovl_Bg_Haka_Huta_reloc.o" +include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl1/z_en_zl1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl1/ovl_En_Zl1_reloc.o" endseg beginseg - name "ovl_Bg_Haka_Megane" + name "ovl_En_Viewer" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Megane/ovl_Bg_Haka_Megane_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Viewer/z_en_viewer.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Viewer/ovl_En_Viewer_reloc.o" endseg beginseg - name "ovl_Bg_Haka_MeganeBG" + name "ovl_En_Goma" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_MeganeBG/ovl_Bg_Haka_MeganeBG_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Goma/z_en_goma.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Goma/ovl_En_Goma_reloc.o" endseg beginseg - name "ovl_Bg_Haka_Sgami" + name "ovl_Bg_Pushbox" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Sgami/ovl_Bg_Haka_Sgami_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Pushbox/ovl_Bg_Pushbox_reloc.o" endseg beginseg - name "ovl_Bg_Haka_Ship" + name "ovl_En_Bubble" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Ship/ovl_Bg_Haka_Ship_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bubble/z_en_bubble.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bubble/ovl_En_Bubble_reloc.o" endseg beginseg - name "ovl_Bg_Haka_Trap" + name "ovl_Door_Shutter" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Trap/ovl_Bg_Haka_Trap_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Shutter/ovl_Door_Shutter_reloc.o" endseg beginseg - name "ovl_Bg_Haka_Tubo" + name "ovl_En_Dodojr" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Tubo/ovl_Bg_Haka_Tubo_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dodojr/ovl_En_Dodojr_reloc.o" endseg beginseg - name "ovl_Bg_Haka_Water" + name "ovl_En_Bdfire" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Water/ovl_Bg_Haka_Water_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bdfire/ovl_En_Bdfire_reloc.o" endseg beginseg - name "ovl_Bg_Haka_Zou" + name "ovl_En_Boom" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Zou/ovl_Bg_Haka_Zou_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Boom/z_en_boom.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Boom/ovl_En_Boom_reloc.o" endseg beginseg - name "ovl_Bg_Heavy_Block" + name "ovl_En_Torch2" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Heavy_Block/ovl_Bg_Heavy_Block_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Torch2/z_en_torch2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Torch2/ovl_En_Torch2_reloc.o" endseg beginseg - name "ovl_Bg_Hidan_Curtain" + name "ovl_En_Bili" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Curtain/ovl_Bg_Hidan_Curtain_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bili/z_en_bili.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bili/ovl_En_Bili_reloc.o" endseg beginseg - name "ovl_Bg_Hidan_Dalm" + name "ovl_En_Tp" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Dalm/ovl_Bg_Hidan_Dalm_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tp/z_en_tp.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tp/ovl_En_Tp_reloc.o" endseg beginseg - name "ovl_Bg_Hidan_Firewall" + name "ovl_En_St" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Firewall/ovl_Bg_Hidan_Firewall_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_St/z_en_st.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_St/ovl_En_St_reloc.o" endseg beginseg - name "ovl_Bg_Hidan_Fslift" + name "ovl_En_Bw" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Fslift/ovl_Bg_Hidan_Fslift_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bw/z_en_bw.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bw/ovl_En_Bw_reloc.o" endseg beginseg - name "ovl_Bg_Hidan_Fwbig" + name "ovl_En_Eiyer" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Fwbig/ovl_Bg_Hidan_Fwbig_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Eiyer/ovl_En_Eiyer_reloc.o" endseg beginseg - name "ovl_Bg_Hidan_Hamstep" + name "ovl_En_River_Sound" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Hamstep/ovl_Bg_Hidan_Hamstep_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_River_Sound/ovl_En_River_Sound_reloc.o" endseg beginseg - name "ovl_Bg_Hidan_Hrock" + name "ovl_En_Horse_Normal" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Hrock/ovl_Bg_Hidan_Hrock_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Normal/ovl_En_Horse_Normal_reloc.o" endseg beginseg - name "ovl_Bg_Hidan_Kousi" + name "ovl_En_Ossan" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Kousi/ovl_Bg_Hidan_Kousi_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ossan/z_en_ossan.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ossan/ovl_En_Ossan_reloc.o" endseg beginseg - name "ovl_Bg_Hidan_Kowarerukabe" + name "ovl_Bg_Treemouth" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/ovl_Bg_Hidan_Kowarerukabe_reloc.o" +include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Treemouth/ovl_Bg_Treemouth_reloc.o" +endseg + +beginseg + name "ovl_Bg_Dodoago" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Dodoago/ovl_Bg_Dodoago_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Dalm" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Dalm/ovl_Bg_Hidan_Dalm_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Hrock" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Hrock/ovl_Bg_Hidan_Hrock_reloc.o" +endseg + +beginseg + name "ovl_En_Horse_Ganon" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Ganon/ovl_En_Horse_Ganon_reloc.o" endseg beginseg @@ -1181,1107 +1573,1099 @@ beginseg endseg beginseg - name "ovl_Bg_Ice_Objects" + name "ovl_En_Xc" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Objects/ovl_Bg_Ice_Objects_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Xc/z_en_xc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Xc/ovl_En_Xc_reloc.o" endseg beginseg - name "ovl_Bg_Ice_Shelter" + name "ovl_Bg_Hidan_Curtain" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Shelter/ovl_Bg_Ice_Shelter_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Curtain/ovl_Bg_Hidan_Curtain_reloc.o" endseg beginseg - name "ovl_Bg_Ice_Shutter" + name "ovl_Bg_Spot00_Hanebasi" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Shutter/ovl_Bg_Ice_Shutter_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/ovl_Bg_Spot00_Hanebasi_reloc.o" endseg beginseg - name "ovl_Bg_Ice_Turara" + name "ovl_En_Mb" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Turara/ovl_Bg_Ice_Turara_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mb/z_en_mb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mb/ovl_En_Mb_reloc.o" endseg beginseg - name "ovl_Bg_Ingate" + name "ovl_En_Bombf" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ingate/ovl_Bg_Ingate_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bombf/z_en_bombf.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bombf/ovl_En_Bombf_reloc.o" endseg beginseg - name "ovl_Bg_Jya_1flift" + name "ovl_Bg_Hidan_Firewall" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_1flift/ovl_Bg_Jya_1flift_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Firewall/ovl_Bg_Hidan_Firewall_reloc.o" endseg beginseg - name "ovl_Bg_Jya_Amishutter" + name "ovl_Bg_Dy_Yoseizo" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Amishutter/ovl_Bg_Jya_Amishutter_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Dy_Yoseizo/ovl_Bg_Dy_Yoseizo_reloc.o" endseg beginseg - name "ovl_Bg_Jya_Bigmirror" + name "ovl_En_Zl2" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bigmirror/ovl_Bg_Jya_Bigmirror_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl2/z_en_zl2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl2/ovl_En_Zl2_reloc.o" endseg beginseg - name "ovl_Bg_Jya_Block" + name "ovl_Bg_Hidan_Fslift" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Block/ovl_Bg_Jya_Block_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Fslift/ovl_Bg_Hidan_Fslift_reloc.o" endseg beginseg - name "ovl_Bg_Jya_Bombchuiwa" + name "ovl_En_OE2" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/ovl_Bg_Jya_Bombchuiwa_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_OE2/z_en_oe2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_OE2/ovl_En_OE2_reloc.o" endseg beginseg - name "ovl_Bg_Jya_Bombiwa" + name "ovl_Bg_Ydan_Hasi" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bombiwa/ovl_Bg_Jya_Bombiwa_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Hasi/ovl_Bg_Ydan_Hasi_reloc.o" endseg beginseg - name "ovl_Bg_Jya_Cobra" + name "ovl_Bg_Ydan_Maruta" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Cobra/ovl_Bg_Jya_Cobra_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Maruta/ovl_Bg_Ydan_Maruta_reloc.o" endseg beginseg - name "ovl_Bg_Jya_Goroiwa" + name "ovl_Boss_Ganondrof" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Goroiwa/ovl_Bg_Jya_Goroiwa_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganondrof/ovl_Boss_Ganondrof_reloc.o" endseg beginseg - name "ovl_Bg_Jya_Haheniron" + name "ovl_En_Am" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Haheniron/ovl_Bg_Jya_Haheniron_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Am/z_en_am.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Am/ovl_En_Am_reloc.o" endseg beginseg - name "ovl_Bg_Jya_Ironobj" + name "ovl_En_Dekubaba" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Ironobj/ovl_Bg_Jya_Ironobj_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dekubaba/ovl_En_Dekubaba_reloc.o" endseg beginseg - name "ovl_Bg_Jya_Kanaami" + name "ovl_En_M_Fire1" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Kanaami/ovl_Bg_Jya_Kanaami_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_M_Fire1/ovl_En_M_Fire1_reloc.o" endseg beginseg - name "ovl_Bg_Jya_Lift" + name "ovl_En_M_Thunder" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Lift/ovl_Bg_Jya_Lift_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_M_Thunder/ovl_En_M_Thunder_reloc.o" endseg beginseg - name "ovl_Bg_Jya_Megami" + name "ovl_Bg_Ddan_Jd" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Megami/ovl_Bg_Jya_Megami_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ddan_Jd/ovl_Bg_Ddan_Jd_reloc.o" endseg beginseg - name "ovl_Bg_Jya_Zurerukabe" + name "ovl_Bg_Breakwall" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/ovl_Bg_Jya_Zurerukabe_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Breakwall/ovl_Bg_Breakwall_reloc.o" endseg beginseg - name "ovl_Bg_Menkuri_Eye" + name "ovl_En_Jj" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Eye/ovl_Bg_Menkuri_Eye_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/ovl_En_Jj_reloc.o" endseg beginseg - name "ovl_Bg_Menkuri_Kaiten" + name "ovl_En_Horse_Zelda" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/ovl_Bg_Menkuri_Kaiten_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Zelda/ovl_En_Horse_Zelda_reloc.o" endseg beginseg - name "ovl_Bg_Menkuri_Nisekabe" + name "ovl_Bg_Ddan_Kd" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/ovl_Bg_Menkuri_Nisekabe_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ddan_Kd/ovl_Bg_Ddan_Kd_reloc.o" endseg beginseg - name "ovl_Bg_Mizu_Bwall" + name "ovl_Door_Warp1" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Bwall/ovl_Bg_Mizu_Bwall_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Warp1/ovl_Door_Warp1_reloc.o" endseg beginseg - name "ovl_Bg_Mizu_Movebg" + name "ovl_Obj_Syokudai" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Movebg/ovl_Bg_Mizu_Movebg_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Syokudai/ovl_Obj_Syokudai_reloc.o" endseg beginseg - name "ovl_Bg_Mizu_Shutter" + name "ovl_Item_B_Heart" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Shutter/ovl_Bg_Mizu_Shutter_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_B_Heart/ovl_Item_B_Heart_reloc.o" endseg beginseg - name "ovl_Bg_Mizu_Uzu" + name "ovl_En_Dekunuts" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Uzu/ovl_Bg_Mizu_Uzu_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dekunuts/ovl_En_Dekunuts_reloc.o" endseg beginseg - name "ovl_Bg_Mizu_Water" + name "ovl_Bg_Menkuri_Kaiten" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Water/ovl_Bg_Mizu_Water_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/ovl_Bg_Menkuri_Kaiten_reloc.o" endseg beginseg - name "ovl_Bg_Mjin" + name "ovl_Bg_Menkuri_Eye" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mjin/ovl_Bg_Mjin_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Eye/ovl_Bg_Menkuri_Eye_reloc.o" endseg beginseg - name "ovl_Bg_Mori_Bigst" + name "ovl_En_Vali" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Bigst/ovl_Bg_Mori_Bigst_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vali/z_en_vali.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vali/ovl_En_Vali_reloc.o" endseg beginseg - name "ovl_Bg_Mori_Elevator" + name "ovl_Bg_Mizu_Movebg" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Elevator/ovl_Bg_Mori_Elevator_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Movebg/ovl_Bg_Mizu_Movebg_reloc.o" endseg beginseg - name "ovl_Bg_Mori_Hashigo" + name "ovl_Bg_Mizu_Water" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hashigo/ovl_Bg_Mori_Hashigo_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Water/ovl_Bg_Mizu_Water_reloc.o" endseg beginseg - name "ovl_Bg_Mori_Hashira4" + name "ovl_Arms_Hook" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hashira4/ovl_Bg_Mori_Hashira4_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arms_Hook/ovl_Arms_Hook_reloc.o" endseg beginseg - name "ovl_Bg_Mori_Hineri" + name "ovl_En_fHG" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hineri/ovl_Bg_Mori_Hineri_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_fHG/z_en_fhg.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_fHG/ovl_En_fHG_reloc.o" endseg beginseg - name "ovl_Bg_Mori_Idomizu" + name "ovl_Bg_Mori_Hineri" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Idomizu/ovl_Bg_Mori_Idomizu_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hineri/ovl_Bg_Mori_Hineri_reloc.o" endseg beginseg - name "ovl_Bg_Mori_Kaitenkabe" + name "ovl_En_Bb" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/ovl_Bg_Mori_Kaitenkabe_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bb/z_en_bb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bb/ovl_En_Bb_reloc.o" endseg beginseg - name "ovl_Bg_Mori_Rakkatenjo" + name "ovl_Bg_Toki_Hikari" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/ovl_Bg_Mori_Rakkatenjo_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Hikari/ovl_Bg_Toki_Hikari_reloc.o" endseg beginseg - name "ovl_Bg_Po_Event" + name "ovl_En_Yukabyun" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Po_Event/ovl_Bg_Po_Event_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Yukabyun/ovl_En_Yukabyun_reloc.o" endseg beginseg - name "ovl_Bg_Po_Syokudai" + name "ovl_Bg_Toki_Swd" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Po_Syokudai/ovl_Bg_Po_Syokudai_reloc.o" +include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.o" +include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.o" +include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/ovl_Bg_Toki_Swd_reloc.o" endseg beginseg - name "ovl_Bg_Pushbox" + name "ovl_En_Fhg_Fire" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Pushbox/ovl_Bg_Pushbox_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fhg_Fire/ovl_En_Fhg_Fire_reloc.o" endseg beginseg - name "ovl_Bg_Relay_Objects" + name "ovl_Bg_Mjin" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Relay_Objects/ovl_Bg_Relay_Objects_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mjin/ovl_Bg_Mjin_reloc.o" endseg beginseg - name "ovl_Bg_Spot00_Break" + name "ovl_Bg_Hidan_Kousi" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot00_Break/ovl_Bg_Spot00_Break_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Kousi/ovl_Bg_Hidan_Kousi_reloc.o" endseg beginseg - name "ovl_Bg_Spot00_Hanebasi" + name "ovl_Door_Toki" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/ovl_Bg_Spot00_Hanebasi_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Toki/z_door_toki.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Toki/ovl_Door_Toki_reloc.o" endseg beginseg - name "ovl_Bg_Spot01_Fusya" + name "ovl_Bg_Hidan_Hamstep" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Fusya/ovl_Bg_Spot01_Fusya_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Hamstep/ovl_Bg_Hidan_Hamstep_reloc.o" endseg beginseg - name "ovl_Bg_Spot01_Idohashira" + name "ovl_En_Bird" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idohashira/ovl_Bg_Spot01_Idohashira_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bird/z_en_bird.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bird/ovl_En_Bird_reloc.o" endseg beginseg - name "ovl_Bg_Spot01_Idomizu" + name "ovl_En_Wood02" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idomizu/ovl_Bg_Spot01_Idomizu_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wood02/z_en_wood02.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wood02/ovl_En_Wood02_reloc.o" endseg beginseg - name "ovl_Bg_Spot01_Idosoko" + name "ovl_En_Lightbox" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idosoko/ovl_Bg_Spot01_Idosoko_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Lightbox/ovl_En_Lightbox_reloc.o" endseg beginseg - name "ovl_Bg_Spot01_Objects2" + name "ovl_En_Pu_box" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Objects2/ovl_Bg_Spot01_Objects2_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Pu_box/ovl_En_Pu_box_reloc.o" endseg beginseg - name "ovl_Bg_Spot02_Objects" + name "ovl_En_Trap" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot02_Objects/ovl_Bg_Spot02_Objects_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Trap/z_en_trap.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Trap/ovl_En_Trap_reloc.o" endseg beginseg - name "ovl_Bg_Spot03_Taki" + name "ovl_En_Arow_Trap" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot03_Taki/ovl_Bg_Spot03_Taki_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Arow_Trap/ovl_En_Arow_Trap_reloc.o" endseg beginseg - name "ovl_Bg_Spot05_Soko" + name "ovl_En_Vase" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot05_Soko/ovl_Bg_Spot05_Soko_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vase/z_en_vase.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vase/ovl_En_Vase_reloc.o" endseg beginseg - name "ovl_Bg_Spot06_Objects" + name "ovl_En_Ta" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot06_Objects/ovl_Bg_Spot06_Objects_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ta/z_en_ta.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ta/ovl_En_Ta_reloc.o" endseg beginseg - name "ovl_Bg_Spot07_Taki" + name "ovl_En_Tk" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot07_Taki/ovl_Bg_Spot07_Taki_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tk/z_en_tk.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tk/ovl_En_Tk_reloc.o" endseg beginseg - name "ovl_Bg_Spot08_Bakudankabe" + name "ovl_Bg_Mori_Bigst" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/ovl_Bg_Spot08_Bakudankabe_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Bigst/ovl_Bg_Mori_Bigst_reloc.o" endseg beginseg - name "ovl_Bg_Spot08_Iceblock" + name "ovl_Bg_Mori_Elevator" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot08_Iceblock/ovl_Bg_Spot08_Iceblock_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Elevator/ovl_Bg_Mori_Elevator_reloc.o" endseg beginseg - name "ovl_Bg_Spot09_Obj" + name "ovl_Bg_Mori_Kaitenkabe" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot09_Obj/ovl_Bg_Spot09_Obj_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/ovl_Bg_Mori_Kaitenkabe_reloc.o" endseg beginseg - name "ovl_Bg_Spot11_Bakudankabe" + name "ovl_Bg_Mori_Rakkatenjo" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/ovl_Bg_Spot11_Bakudankabe_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/ovl_Bg_Mori_Rakkatenjo_reloc.o" endseg beginseg - name "ovl_Bg_Spot11_Oasis" + name "ovl_En_Vm" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot11_Oasis/ovl_Bg_Spot11_Oasis_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vm/z_en_vm.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vm/ovl_En_Vm_reloc.o" endseg beginseg - name "ovl_Bg_Spot12_Gate" + name "ovl_Demo_Effect" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot12_Gate/ovl_Bg_Spot12_Gate_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Effect/ovl_Demo_Effect_reloc.o" endseg beginseg - name "ovl_Bg_Spot12_Saku" + name "ovl_Demo_Kankyo" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot12_Saku/ovl_Bg_Spot12_Saku_reloc.o" +include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data1.o" +include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data2.o" +include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data3.o" +include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data4.o" +include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data5.o" +include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data6.o" +include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data7.o" +include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data8.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/ovl_Demo_Kankyo_reloc.o" endseg beginseg - name "ovl_Bg_Spot15_Rrbox" + name "ovl_Bg_Hidan_Fwbig" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot15_Rrbox/ovl_Bg_Spot15_Rrbox_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Fwbig/ovl_Bg_Hidan_Fwbig_reloc.o" endseg beginseg - name "ovl_Bg_Spot15_Saku" + name "ovl_En_Floormas" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot15_Saku/ovl_Bg_Spot15_Saku_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Floormas/z_en_floormas.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Floormas/ovl_En_Floormas_reloc.o" endseg beginseg - name "ovl_Bg_Spot16_Bombstone" + name "ovl_En_Heishi1" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot16_Bombstone/ovl_Bg_Spot16_Bombstone_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi1/ovl_En_Heishi1_reloc.o" endseg beginseg - name "ovl_Bg_Spot16_Doughnut" + name "ovl_En_Rd" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot16_Doughnut/ovl_Bg_Spot16_Doughnut_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rd/z_en_rd.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rd/ovl_En_Rd_reloc.o" endseg beginseg - name "ovl_Bg_Spot17_Bakudankabe" + name "ovl_En_Po_Sisters" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/ovl_Bg_Spot17_Bakudankabe_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Sisters/ovl_En_Po_Sisters_reloc.o" endseg beginseg - name "ovl_Bg_Spot17_Funen" + name "ovl_Bg_Heavy_Block" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot17_Funen/ovl_Bg_Spot17_Funen_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Heavy_Block/ovl_Bg_Heavy_Block_reloc.o" endseg beginseg - name "ovl_Bg_Spot18_Basket" + name "ovl_Bg_Po_Event" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Basket/ovl_Bg_Spot18_Basket_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Po_Event/ovl_Bg_Po_Event_reloc.o" endseg beginseg - name "ovl_Bg_Spot18_Futa" + name "ovl_Obj_Mure" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Futa/ovl_Bg_Spot18_Futa_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure/ovl_Obj_Mure_reloc.o" endseg beginseg - name "ovl_Bg_Spot18_Obj" + name "ovl_En_Sw" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Obj/ovl_Bg_Spot18_Obj_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sw/z_en_sw.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sw/ovl_En_Sw_reloc.o" endseg beginseg - name "ovl_Bg_Spot18_Shutter" + name "ovl_Boss_Fd" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Shutter/ovl_Bg_Spot18_Shutter_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Fd/ovl_Boss_Fd_reloc.o" endseg beginseg - name "ovl_Bg_Sst_Floor" + name "ovl_Object_Kankyo" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Sst_Floor/ovl_Bg_Sst_Floor_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Object_Kankyo/ovl_Object_Kankyo_reloc.o" endseg beginseg - name "ovl_Bg_Toki_Hikari" + name "ovl_En_Du" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Hikari/ovl_Bg_Toki_Hikari_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Du/z_en_du.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Du/ovl_En_Du_reloc.o" endseg beginseg - name "ovl_Bg_Toki_Swd" + name "ovl_En_Fd" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_3.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/ovl_Bg_Toki_Swd_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fd/z_en_fd.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fd/ovl_En_Fd_reloc.o" endseg beginseg - name "ovl_Bg_Treemouth" + name "ovl_En_Horse_Link_Child" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Treemouth/ovl_Bg_Treemouth_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Link_Child/ovl_En_Horse_Link_Child_reloc.o" endseg beginseg - name "ovl_Bg_Umajump" + name "ovl_Door_Ana" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Umajump/ovl_Bg_Umajump_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Ana/z_door_ana.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Ana/ovl_Door_Ana_reloc.o" endseg beginseg - name "ovl_Bg_Vb_Sima" + name "ovl_Bg_Spot02_Objects" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Vb_Sima/ovl_Bg_Vb_Sima_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot02_Objects/ovl_Bg_Spot02_Objects_reloc.o" endseg beginseg - name "ovl_Bg_Ydan_Hasi" + name "ovl_Bg_Haka" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Hasi/ovl_Bg_Ydan_Hasi_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka/ovl_Bg_Haka_reloc.o" endseg beginseg - name "ovl_Bg_Ydan_Maruta" + name "ovl_Magic_Wind" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Maruta/ovl_Bg_Ydan_Maruta_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Wind/ovl_Magic_Wind_reloc.o" endseg beginseg - name "ovl_Bg_Ydan_Sp" + name "ovl_Magic_Fire" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Sp/ovl_Bg_Ydan_Sp_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Fire/ovl_Magic_Fire_reloc.o" endseg beginseg - name "ovl_Bg_Zg" + name "ovl_En_Ru1" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Zg/ovl_Bg_Zg_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ru1/z_en_ru1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ru1/ovl_En_Ru1_reloc.o" endseg beginseg - name "ovl_Boss_Dodongo" + name "ovl_Boss_Fd2" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Dodongo/ovl_Boss_Dodongo_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Fd2/ovl_Boss_Fd2_reloc.o" endseg beginseg - name "ovl_Boss_Fd" + name "ovl_En_Fd_Fire" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Fd/ovl_Boss_Fd_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fd_Fire/ovl_En_Fd_Fire_reloc.o" endseg beginseg - name "ovl_Boss_Fd2" + name "ovl_En_Dh" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Fd2/ovl_Boss_Fd2_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dh/z_en_dh.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dh/ovl_En_Dh_reloc.o" endseg beginseg - name "ovl_Boss_Ganon" + name "ovl_En_Dha" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganon/ovl_Boss_Ganon_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dha/z_en_dha.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dha/ovl_En_Dha_reloc.o" endseg beginseg - name "ovl_Boss_Ganon2" + name "ovl_En_Rl" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganon2/ovl_Boss_Ganon2_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rl/z_en_rl.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rl/ovl_En_Rl_reloc.o" endseg beginseg - name "ovl_Boss_Ganondrof" + name "ovl_En_Encount1" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganondrof/ovl_Boss_Ganondrof_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Encount1/z_en_encount1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Encount1/ovl_En_Encount1_reloc.o" endseg beginseg - name "ovl_Boss_Goma" + name "ovl_Demo_Du" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Goma/ovl_Boss_Goma_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Du/z_demo_du.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Du/ovl_Demo_Du_reloc.o" endseg beginseg - name "ovl_Boss_Mo" + name "ovl_Demo_Im" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Mo/ovl_Boss_Mo_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Im/z_demo_im.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Im/ovl_Demo_Im_reloc.o" endseg beginseg - name "ovl_Boss_Sst" + name "ovl_Demo_Tre_Lgt" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Sst/ovl_Boss_Sst_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Tre_Lgt/ovl_Demo_Tre_Lgt_reloc.o" endseg beginseg - name "ovl_Boss_Tw" + name "ovl_En_Fw" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Tw/ovl_Boss_Tw_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fw/z_en_fw.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fw/ovl_En_Fw_reloc.o" endseg beginseg - name "ovl_Boss_Va" + name "ovl_Bg_Vb_Sima" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Va/z_boss_va.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Va/ovl_Boss_Va_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Vb_Sima/ovl_Bg_Vb_Sima_reloc.o" endseg beginseg - name "ovl_Demo_6K" + name "ovl_En_Vb_Ball" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_6K/z_demo_6k.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_6K/ovl_Demo_6K_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vb_Ball/ovl_En_Vb_Ball_reloc.o" endseg beginseg - name "ovl_Demo_Du" + name "ovl_Bg_Haka_Megane" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Du/z_demo_du.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Du/ovl_Demo_Du_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Megane/ovl_Bg_Haka_Megane_reloc.o" endseg beginseg - name "ovl_Demo_Ec" + name "ovl_Bg_Haka_MeganeBG" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ec/ovl_Demo_Ec_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_MeganeBG/ovl_Bg_Haka_MeganeBG_reloc.o" endseg beginseg - name "ovl_Demo_Effect" + name "ovl_Bg_Haka_Ship" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Effect/ovl_Demo_Effect_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Ship/ovl_Bg_Haka_Ship_reloc.o" endseg beginseg - name "ovl_Demo_Ext" + name "ovl_Bg_Haka_Sgami" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ext/ovl_Demo_Ext_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Sgami/ovl_Bg_Haka_Sgami_reloc.o" endseg beginseg - name "ovl_Demo_Geff" + name "ovl_En_Heishi2" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Geff/ovl_Demo_Geff_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi2/ovl_En_Heishi2_reloc.o" endseg beginseg - name "ovl_Demo_Gj" + name "ovl_En_Encount2" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Gj/ovl_Demo_Gj_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Encount2/z_en_encount2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Encount2/ovl_En_Encount2_reloc.o" endseg beginseg - name "ovl_Demo_Go" + name "ovl_En_Fire_Rock" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Go/z_demo_go.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Go/ovl_Demo_Go_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fire_Rock/ovl_En_Fire_Rock_reloc.o" endseg beginseg - name "ovl_Demo_Gt" + name "ovl_En_Brob" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Gt/ovl_Demo_Gt_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Brob/z_en_brob.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Brob/ovl_En_Brob_reloc.o" endseg beginseg - name "ovl_Demo_Ik" + name "ovl_Mir_Ray" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ik/ovl_Demo_Ik_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Mir_Ray/ovl_Mir_Ray_reloc.o" endseg beginseg - name "ovl_Demo_Im" + name "ovl_Bg_Spot09_Obj" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Im/z_demo_im.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Im/ovl_Demo_Im_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot09_Obj/ovl_Bg_Spot09_Obj_reloc.o" endseg beginseg - name "ovl_Demo_Kankyo" + name "ovl_Bg_Spot18_Obj" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data1.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data3.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data4.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data5.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data6.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data7.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data8.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/ovl_Demo_Kankyo_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Obj/ovl_Bg_Spot18_Obj_reloc.o" endseg beginseg - name "ovl_Demo_Kekkai" + name "ovl_Boss_Va" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kekkai/ovl_Demo_Kekkai_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Va/z_boss_va.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Va/ovl_Boss_Va_reloc.o" endseg beginseg - name "ovl_Demo_Sa" + name "ovl_Bg_Haka_Tubo" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Sa/ovl_Demo_Sa_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Tubo/ovl_Bg_Haka_Tubo_reloc.o" endseg beginseg - name "ovl_Demo_Shd" + name "ovl_Bg_Haka_Trap" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Shd/ovl_Demo_Shd_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Trap/ovl_Bg_Haka_Trap_reloc.o" endseg beginseg - name "ovl_Demo_Tre_Lgt" + name "ovl_Bg_Haka_Huta" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Tre_Lgt/ovl_Demo_Tre_Lgt_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Huta/ovl_Bg_Haka_Huta_reloc.o" endseg beginseg - name "ovl_Door_Ana" + name "ovl_Bg_Haka_Zou" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Ana/z_door_ana.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Ana/ovl_Door_Ana_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Zou/ovl_Bg_Haka_Zou_reloc.o" endseg beginseg - name "ovl_Door_Gerudo" + name "ovl_Bg_Spot17_Funen" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Gerudo/ovl_Door_Gerudo_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot17_Funen/ovl_Bg_Spot17_Funen_reloc.o" endseg beginseg - name "ovl_Door_Killer" + name "ovl_En_Syateki_Itm" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Killer/z_door_killer.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Killer/ovl_Door_Killer_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Itm/ovl_En_Syateki_Itm_reloc.o" endseg beginseg - name "ovl_Door_Shutter" + name "ovl_En_Syateki_Man" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Shutter/ovl_Door_Shutter_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Man/ovl_En_Syateki_Man_reloc.o" endseg beginseg - name "ovl_Door_Toki" + name "ovl_En_Tana" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Toki/z_door_toki.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Toki/ovl_Door_Toki_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tana/z_en_tana.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tana/ovl_En_Tana_reloc.o" endseg beginseg - name "ovl_Door_Warp1" + name "ovl_En_Nb" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Warp1/ovl_Door_Warp1_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nb/z_en_nb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nb/ovl_En_Nb_reloc.o" endseg beginseg - name "ovl_Efc_Erupc" + name "ovl_Boss_Mo" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Efc_Erupc/ovl_Efc_Erupc_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Mo/ovl_Boss_Mo_reloc.o" endseg beginseg - name "ovl_Eff_Dust" + name "ovl_En_Sb" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Eff_Dust/ovl_Eff_Dust_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sb/z_en_sb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sb/ovl_En_Sb_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Blast" + name "ovl_En_Bigokuta" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Blast/ovl_Effect_Ss_Blast_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bigokuta/ovl_En_Bigokuta_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Bomb" + name "ovl_En_Karebaba" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bomb/ovl_Effect_Ss_Bomb_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Karebaba/ovl_En_Karebaba_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Bomb2" + name "ovl_Bg_Bdan_Objects" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bomb2/ovl_Effect_Ss_Bomb2_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bdan_Objects/ovl_Bg_Bdan_Objects_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Bubble" + name "ovl_Demo_Sa" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bubble/ovl_Effect_Ss_Bubble_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Sa/ovl_Demo_Sa_reloc.o" endseg beginseg - name "ovl_Effect_Ss_D_Fire" + name "ovl_Demo_Go" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_D_Fire/ovl_Effect_Ss_D_Fire_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Go/z_demo_go.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Go/ovl_Demo_Go_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Dead_Db" + name "ovl_En_In" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Db/ovl_Effect_Ss_Dead_Db_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_In/z_en_in.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_In/ovl_En_In_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Dead_Dd" + name "ovl_En_Tr" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/ovl_Effect_Ss_Dead_Dd_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tr/z_en_tr.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tr/ovl_En_Tr_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Dead_Ds" + name "ovl_Bg_Spot16_Bombstone" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/ovl_Effect_Ss_Dead_Ds_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot16_Bombstone/ovl_Bg_Spot16_Bombstone_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Dead_Sound" + name "ovl_Bg_Hidan_Kowarerukabe" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/ovl_Effect_Ss_Dead_Sound_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/ovl_Bg_Hidan_Kowarerukabe_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Dt_Bubble" + name "ovl_Bg_Bombwall" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/ovl_Effect_Ss_Dt_Bubble_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bombwall/ovl_Bg_Bombwall_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Dust" + name "ovl_En_Ru2" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dust/ovl_Effect_Ss_Dust_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ru2/z_en_ru2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ru2/ovl_En_Ru2_reloc.o" endseg beginseg - name "ovl_Effect_Ss_En_Fire" + name "ovl_Obj_Dekujr" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_En_Fire/ovl_Effect_Ss_En_Fire_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Dekujr/ovl_Obj_Dekujr_reloc.o" endseg beginseg - name "ovl_Effect_Ss_En_Ice" + name "ovl_Bg_Mizu_Uzu" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_En_Ice/ovl_Effect_Ss_En_Ice_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Uzu/ovl_Bg_Mizu_Uzu_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Extra" + name "ovl_Bg_Spot06_Objects" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Extra/ovl_Effect_Ss_Extra_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot06_Objects/ovl_Bg_Spot06_Objects_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Fcircle" + name "ovl_Bg_Ice_Objects" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fcircle/ovl_Effect_Ss_Fcircle_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Objects/ovl_Bg_Ice_Objects_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Fhg_Flash" + name "ovl_Bg_Haka_Water" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/ovl_Effect_Ss_Fhg_Flash_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Water/ovl_Bg_Haka_Water_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Fire_Tail" + name "ovl_En_Ma2" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/ovl_Effect_Ss_Fire_Tail_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma2/z_en_ma2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma2/ovl_En_Ma2_reloc.o" endseg beginseg - name "ovl_Effect_Ss_G_Fire" + name "ovl_En_Bom_Chu" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Fire/ovl_Effect_Ss_G_Fire_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Chu/ovl_En_Bom_Chu_reloc.o" endseg beginseg - name "ovl_Effect_Ss_G_Magma" + name "ovl_En_Horse_Game_Check" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Magma/ovl_Effect_Ss_G_Magma_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Game_Check/ovl_En_Horse_Game_Check_reloc.o" endseg beginseg - name "ovl_Effect_Ss_G_Magma2" + name "ovl_Boss_Tw" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Magma2/ovl_Effect_Ss_G_Magma2_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Tw/ovl_Boss_Tw_reloc.o" endseg beginseg - name "ovl_Effect_Ss_G_Ripple" + name "ovl_En_Rr" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Ripple/ovl_Effect_Ss_G_Ripple_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rr/z_en_rr.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rr/ovl_En_Rr_reloc.o" endseg beginseg - name "ovl_Effect_Ss_G_Spk" + name "ovl_En_Ba" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Spk/ovl_Effect_Ss_G_Spk_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ba/z_en_ba.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ba/ovl_En_Ba_reloc.o" endseg beginseg - name "ovl_Effect_Ss_G_Splash" + name "ovl_En_Bx" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Splash/ovl_Effect_Ss_G_Splash_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bx/z_en_bx.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bx/ovl_En_Bx_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Hahen" + name "ovl_En_Anubice" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Hahen/ovl_Effect_Ss_Hahen_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Anubice/z_en_anubice.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Anubice/ovl_En_Anubice_reloc.o" endseg beginseg - name "ovl_Effect_Ss_HitMark" + name "ovl_En_Anubice_Fire" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_HitMark/ovl_Effect_Ss_HitMark_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Anubice_Fire/ovl_En_Anubice_Fire_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Ice_Piece" + name "ovl_Bg_Mori_Hashigo" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/ovl_Effect_Ss_Ice_Piece_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hashigo/ovl_Bg_Mori_Hashigo_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Ice_Smoke" + name "ovl_Bg_Mori_Hashira4" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/ovl_Effect_Ss_Ice_Smoke_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hashira4/ovl_Bg_Mori_Hashira4_reloc.o" endseg beginseg - name "ovl_Effect_Ss_K_Fire" + name "ovl_Bg_Mori_Idomizu" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_K_Fire/ovl_Effect_Ss_K_Fire_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Idomizu/ovl_Bg_Mori_Idomizu_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Kakera" + name "ovl_Bg_Spot16_Doughnut" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Kakera/ovl_Effect_Ss_Kakera_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot16_Doughnut/ovl_Bg_Spot16_Doughnut_reloc.o" endseg beginseg - name "ovl_Effect_Ss_KiraKira" + name "ovl_Bg_Bdan_Switch" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_KiraKira/ovl_Effect_Ss_KiraKira_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bdan_Switch/ovl_Bg_Bdan_Switch_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Lightning" + name "ovl_En_Ma1" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Lightning/ovl_Effect_Ss_Lightning_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma1/z_en_ma1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma1/ovl_En_Ma1_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Sibuki" + name "ovl_Boss_Ganon" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Sibuki/ovl_Effect_Ss_Sibuki_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganon/ovl_Boss_Ganon_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Sibuki2" + name "ovl_Boss_Sst" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Sibuki2/ovl_Effect_Ss_Sibuki2_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Sst/ovl_Boss_Sst_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Solder_Srch_Ball" + name "ovl_En_Ny" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/ovl_Effect_Ss_Solder_Srch_Ball_reloc.o" -endseg - -beginseg - name "ovl_Effect_Ss_Stick" - compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Stick/ovl_Effect_Ss_Stick_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ny/z_en_ny.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ny/ovl_En_Ny_reloc.o" endseg beginseg - name "ovl_Effect_Ss_Stone1" + name "ovl_En_Fr" compress - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.o" - include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Stone1/ovl_Effect_Ss_Stone1_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fr/z_en_fr.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fr/ovl_En_Fr_reloc.o" endseg beginseg - name "ovl_Elf_Msg" + name "ovl_Item_Shield" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Elf_Msg/ovl_Elf_Msg_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Shield/z_item_shield.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Shield/ovl_Item_Shield_reloc.o" endseg beginseg - name "ovl_Elf_Msg2" + name "ovl_Bg_Ice_Shelter" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Elf_Msg2/ovl_Elf_Msg2_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Shelter/ovl_Bg_Ice_Shelter_reloc.o" endseg beginseg - name "ovl_En_Am" + name "ovl_En_Ice_Hono" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Am/z_en_am.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Am/ovl_En_Am_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ice_Hono/ovl_En_Ice_Hono_reloc.o" endseg beginseg - name "ovl_En_Ani" + name "ovl_Item_Ocarina" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ani/z_en_ani.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ani/ovl_En_Ani_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Ocarina/ovl_Item_Ocarina_reloc.o" endseg beginseg - name "ovl_En_Anubice" + name "ovl_Magic_Dark" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Anubice/z_en_anubice.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Anubice/ovl_En_Anubice_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Dark/ovl_Magic_Dark_reloc.o" endseg beginseg - name "ovl_En_Anubice_Fire" + name "ovl_Demo_6K" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Anubice_Fire/ovl_En_Anubice_Fire_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_6K/z_demo_6k.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_6K/ovl_Demo_6K_reloc.o" endseg beginseg @@ -2292,136 +2676,129 @@ beginseg endseg beginseg - name "ovl_En_Arow_Trap" - compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Arow_Trap/ovl_En_Arow_Trap_reloc.o" -endseg - -beginseg - name "ovl_En_Arrow" + name "ovl_Bg_Haka_Gate" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Arrow/z_en_arrow.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Arrow/ovl_En_Arrow_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Gate/ovl_Bg_Haka_Gate_reloc.o" endseg beginseg - name "ovl_En_Attack_Niw" + name "ovl_Bg_Spot15_Saku" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Attack_Niw/ovl_En_Attack_Niw_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot15_Saku/ovl_Bg_Spot15_Saku_reloc.o" endseg beginseg - name "ovl_En_Ba" + name "ovl_Bg_Jya_Goroiwa" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ba/z_en_ba.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ba/ovl_En_Ba_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Goroiwa/ovl_Bg_Jya_Goroiwa_reloc.o" endseg beginseg - name "ovl_En_Bb" + name "ovl_Bg_Jya_Zurerukabe" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bb/z_en_bb.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bb/ovl_En_Bb_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/ovl_Bg_Jya_Zurerukabe_reloc.o" endseg beginseg - name "ovl_En_Bdfire" + name "ovl_Bg_Jya_Cobra" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bdfire/ovl_En_Bdfire_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Cobra/ovl_Bg_Jya_Cobra_reloc.o" endseg beginseg - name "ovl_En_Bigokuta" + name "ovl_Bg_Jya_Kanaami" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bigokuta/ovl_En_Bigokuta_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Kanaami/ovl_Bg_Jya_Kanaami_reloc.o" endseg beginseg - name "ovl_En_Bili" + name "ovl_Fishing" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bili/z_en_bili.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bili/ovl_En_Bili_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Fishing/z_fishing.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Fishing/ovl_Fishing_reloc.o" endseg beginseg - name "ovl_En_Bird" + name "ovl_Obj_Oshihiki" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bird/z_en_bird.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bird/ovl_En_Bird_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Oshihiki/ovl_Obj_Oshihiki_reloc.o" endseg beginseg - name "ovl_En_Blkobj" + name "ovl_Bg_Gate_Shutter" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Blkobj/ovl_En_Blkobj_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gate_Shutter/ovl_Bg_Gate_Shutter_reloc.o" endseg beginseg - name "ovl_En_Bom" + name "ovl_Eff_Dust" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom/z_en_bom.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom/ovl_En_Bom_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Eff_Dust/ovl_Eff_Dust_reloc.o" endseg beginseg - name "ovl_En_Bom_Bowl_Man" + name "ovl_Bg_Spot01_Fusya" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Bowl_Man/ovl_En_Bom_Bowl_Man_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Fusya/ovl_Bg_Spot01_Fusya_reloc.o" endseg beginseg - name "ovl_En_Bom_Bowl_Pit" + name "ovl_Bg_Spot01_Idohashira" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Bowl_Pit/ovl_En_Bom_Bowl_Pit_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idohashira/ovl_Bg_Spot01_Idohashira_reloc.o" endseg beginseg - name "ovl_En_Bom_Chu" + name "ovl_Bg_Spot01_Idomizu" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Chu/ovl_En_Bom_Chu_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idomizu/ovl_Bg_Spot01_Idomizu_reloc.o" endseg beginseg - name "ovl_En_Bombf" + name "ovl_Bg_Po_Syokudai" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bombf/z_en_bombf.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bombf/ovl_En_Bombf_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Po_Syokudai/ovl_Bg_Po_Syokudai_reloc.o" endseg beginseg - name "ovl_En_Boom" + name "ovl_Bg_Ganon_Otyuka" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Boom/z_en_boom.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Boom/ovl_En_Boom_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ganon_Otyuka/ovl_Bg_Ganon_Otyuka_reloc.o" endseg beginseg - name "ovl_En_Box" + name "ovl_Bg_Spot15_Rrbox" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Box/z_en_box.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Box/ovl_En_Box_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot15_Rrbox/ovl_Bg_Spot15_Rrbox_reloc.o" endseg beginseg - name "ovl_En_Brob" + name "ovl_Bg_Umajump" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Brob/z_en_brob.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Brob/ovl_En_Brob_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Umajump/ovl_Bg_Umajump_reloc.o" endseg beginseg - name "ovl_En_Bubble" + name "ovl_En_Insect" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bubble/z_en_bubble.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bubble/ovl_En_Bubble_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Insect/z_en_insect.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Insect/ovl_En_Insect_reloc.o" endseg beginseg @@ -2432,5609 +2809,12757 @@ beginseg endseg beginseg - name "ovl_En_Bw" + name "ovl_En_Fish" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bw/z_en_bw.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bw/ovl_En_Bw_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fish/z_en_fish.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fish/ovl_En_Fish_reloc.o" endseg beginseg - name "ovl_En_Bx" + name "ovl_Bg_Spot08_Iceblock" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bx/z_en_bx.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bx/ovl_En_Bx_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot08_Iceblock/ovl_Bg_Spot08_Iceblock_reloc.o" endseg beginseg - name "ovl_En_Changer" + name "ovl_Item_Etcetera" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Changer/z_en_changer.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Changer/ovl_En_Changer_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Etcetera/ovl_Item_Etcetera_reloc.o" endseg beginseg - name "ovl_En_Clear_Tag" + name "ovl_Arrow_Fire" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Clear_Tag/ovl_En_Clear_Tag_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Fire/ovl_Arrow_Fire_reloc.o" endseg beginseg - name "ovl_En_Cow" + name "ovl_Arrow_Ice" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Cow/z_en_cow.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Cow/ovl_En_Cow_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Ice/ovl_Arrow_Ice_reloc.o" endseg beginseg - name "ovl_En_Crow" + name "ovl_Arrow_Light" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Crow/z_en_crow.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Crow/ovl_En_Crow_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Light/ovl_Arrow_Light_reloc.o" endseg beginseg - name "ovl_En_Cs" + name "ovl_Obj_Kibako" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Cs/z_en_cs.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Cs/ovl_En_Cs_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Kibako/ovl_Obj_Kibako_reloc.o" endseg beginseg - name "ovl_En_Daiku" + name "ovl_Obj_Tsubo" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Daiku/z_en_daiku.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Daiku/ovl_En_Daiku_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Tsubo/ovl_Obj_Tsubo_reloc.o" endseg beginseg - name "ovl_En_Daiku_Kakariko" + name "ovl_En_Wonder_Item" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Daiku_Kakariko/ovl_En_Daiku_Kakariko_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Item/ovl_En_Wonder_Item_reloc.o" endseg beginseg - name "ovl_En_Dekubaba" + name "ovl_En_Ik" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dekubaba/ovl_En_Dekubaba_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ik/z_en_ik.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ik/ovl_En_Ik_reloc.o" endseg beginseg - name "ovl_En_Dekunuts" + name "ovl_Demo_Ik" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dekunuts/ovl_En_Dekunuts_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ik/ovl_Demo_Ik_reloc.o" endseg beginseg - name "ovl_En_Dh" + name "ovl_En_Skj" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dh/z_en_dh.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dh/ovl_En_Dh_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skj/z_en_skj.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skj/ovl_En_Skj_reloc.o" endseg beginseg - name "ovl_En_Dha" + name "ovl_En_Skjneedle" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dha/z_en_dha.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dha/ovl_En_Dha_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skjneedle/ovl_En_Skjneedle_reloc.o" endseg beginseg - name "ovl_En_Diving_Game" + name "ovl_En_G_Switch" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Diving_Game/ovl_En_Diving_Game_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_G_Switch/ovl_En_G_Switch_reloc.o" endseg beginseg - name "ovl_En_Dns" + name "ovl_Demo_Ext" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dns/z_en_dns.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dns/ovl_En_Dns_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ext/ovl_Demo_Ext_reloc.o" endseg beginseg - name "ovl_En_Dnt_Demo" + name "ovl_Demo_Shd" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Demo/ovl_En_Dnt_Demo_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Shd/ovl_Demo_Shd_reloc.o" endseg beginseg - name "ovl_En_Dnt_Jiji" + name "ovl_En_Dns" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Jiji/ovl_En_Dnt_Jiji_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dns/z_en_dns.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dns/ovl_En_Dns_reloc.o" endseg beginseg - name "ovl_En_Dnt_Nomal" + name "ovl_Elf_Msg" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Nomal/ovl_En_Dnt_Nomal_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Elf_Msg/ovl_Elf_Msg_reloc.o" endseg beginseg - name "ovl_En_Dodojr" + name "ovl_En_Honotrap" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dodojr/ovl_En_Dodojr_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Honotrap/ovl_En_Honotrap_reloc.o" endseg beginseg - name "ovl_En_Dodongo" + name "ovl_En_Tubo_Trap" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dodongo/ovl_En_Dodongo_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tubo_Trap/ovl_En_Tubo_Trap_reloc.o" endseg beginseg - name "ovl_En_Dog" + name "ovl_Obj_Ice_Poly" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dog/z_en_dog.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dog/ovl_En_Dog_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Ice_Poly/ovl_Obj_Ice_Poly_reloc.o" endseg beginseg - name "ovl_En_Door" + name "ovl_Bg_Spot03_Taki" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Door/z_en_door.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Door/ovl_En_Door_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot03_Taki/ovl_Bg_Spot03_Taki_reloc.o" endseg beginseg - name "ovl_En_Ds" + name "ovl_Bg_Spot07_Taki" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ds/z_en_ds.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ds/ovl_En_Ds_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot07_Taki/ovl_Bg_Spot07_Taki_reloc.o" endseg beginseg - name "ovl_En_Du" + name "ovl_En_Fz" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Du/z_en_du.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Du/ovl_En_Du_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fz/z_en_fz.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fz/ovl_En_Fz_reloc.o" endseg beginseg - name "ovl_En_Dy_Extra" + name "ovl_En_Po_Relay" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dy_Extra/ovl_En_Dy_Extra_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Relay/ovl_En_Po_Relay_reloc.o" endseg beginseg - name "ovl_En_Eg" + name "ovl_Bg_Relay_Objects" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Eg/z_en_eg.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Eg/ovl_En_Eg_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Relay_Objects/ovl_Bg_Relay_Objects_reloc.o" endseg beginseg - name "ovl_En_Eiyer" + name "ovl_En_Diving_Game" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Eiyer/ovl_En_Eiyer_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Diving_Game/ovl_En_Diving_Game_reloc.o" endseg beginseg - name "ovl_En_Elf" + name "ovl_En_Kusa" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Elf/z_en_elf.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Elf/ovl_En_Elf_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kusa/z_en_kusa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kusa/ovl_En_Kusa_reloc.o" endseg beginseg - name "ovl_En_Encount1" + name "ovl_Obj_Bean" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Encount1/z_en_encount1.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Encount1/ovl_En_Encount1_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Bean/ovl_Obj_Bean_reloc.o" endseg beginseg - name "ovl_En_Encount2" + name "ovl_Obj_Bombiwa" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Encount2/z_en_encount2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Encount2/ovl_En_Encount2_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Bombiwa/ovl_Obj_Bombiwa_reloc.o" endseg beginseg - name "ovl_En_Ex_Item" + name "ovl_Obj_Switch" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ex_Item/ovl_En_Ex_Item_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Switch/ovl_Obj_Switch_reloc.o" endseg beginseg - name "ovl_En_Ex_Ruppy" + name "ovl_Obj_Elevator" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ex_Ruppy/ovl_En_Ex_Ruppy_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Elevator/ovl_Obj_Elevator_reloc.o" endseg beginseg - name "ovl_En_Fd" + name "ovl_Obj_Lift" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fd/z_en_fd.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fd/ovl_En_Fd_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Lift/ovl_Obj_Lift_reloc.o" endseg beginseg - name "ovl_En_Fd_Fire" + name "ovl_Obj_Hsblock" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fd_Fire/ovl_En_Fd_Fire_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hsblock/ovl_Obj_Hsblock_reloc.o" endseg beginseg - name "ovl_En_Fhg_Fire" + name "ovl_En_Okarina_Tag" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fhg_Fire/ovl_En_Fhg_Fire_reloc.o" +include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag_cutscene_data.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Tag/ovl_En_Okarina_Tag_reloc.o" endseg beginseg - name "ovl_En_Fire_Rock" + name "ovl_En_Yabusame_Mark" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fire_Rock/ovl_En_Fire_Rock_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Yabusame_Mark/ovl_En_Yabusame_Mark_reloc.o" endseg beginseg - name "ovl_En_Firefly" + name "ovl_En_Goroiwa" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Firefly/z_en_firefly.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Firefly/ovl_En_Firefly_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Goroiwa/ovl_En_Goroiwa_reloc.o" endseg beginseg - name "ovl_En_Fish" + name "ovl_En_Ex_Ruppy" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fish/z_en_fish.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fish/ovl_En_Fish_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ex_Ruppy/ovl_En_Ex_Ruppy_reloc.o" endseg beginseg - name "ovl_En_Floormas" + name "ovl_En_Toryo" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Floormas/z_en_floormas.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Floormas/ovl_En_Floormas_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Toryo/z_en_toryo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Toryo/ovl_En_Toryo_reloc.o" endseg beginseg - name "ovl_En_Fr" + name "ovl_En_Daiku" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fr/z_en_fr.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fr/ovl_En_Fr_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Daiku/z_en_daiku.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Daiku/ovl_En_Daiku_reloc.o" endseg beginseg - name "ovl_En_Fu" + name "ovl_En_Nwc" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fu/z_en_fu.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fu/ovl_En_Fu_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nwc/z_en_nwc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nwc/ovl_En_Nwc_reloc.o" endseg beginseg - name "ovl_En_Fw" + name "ovl_En_Blkobj" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fw/z_en_fw.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fw/ovl_En_Fw_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Blkobj/ovl_En_Blkobj_reloc.o" endseg beginseg - name "ovl_En_Fz" + name "ovl_Item_Inbox" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fz/z_en_fz.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fz/ovl_En_Fz_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Inbox/ovl_Item_Inbox_reloc.o" endseg beginseg - name "ovl_En_G_Switch" + name "ovl_En_Ge1" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_G_Switch/ovl_En_G_Switch_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge1/z_en_ge1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge1/ovl_En_Ge1_reloc.o" endseg beginseg - name "ovl_En_Ganon_Mant" + name "ovl_Obj_Blockstop" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ganon_Mant/ovl_En_Ganon_Mant_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Blockstop/ovl_Obj_Blockstop_reloc.o" endseg beginseg - name "ovl_En_Ganon_Organ" + name "ovl_En_Sda" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ganon_Organ/ovl_En_Ganon_Organ_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sda/z_en_sda.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sda/ovl_En_Sda_reloc.o" endseg beginseg - name "ovl_En_Gb" + name "ovl_En_Clear_Tag" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gb/z_en_gb.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gb/ovl_En_Gb_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Clear_Tag/ovl_En_Clear_Tag_reloc.o" endseg beginseg - name "ovl_En_Ge1" + name "ovl_En_Niw_Lady" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge1/z_en_ge1.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge1/ovl_En_Ge1_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw_Lady/ovl_En_Niw_Lady_reloc.o" endseg beginseg - name "ovl_En_Ge2" + name "ovl_En_Gm" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge2/z_en_ge2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge2/ovl_En_Ge2_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gm/z_en_gm.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gm/ovl_En_Gm_reloc.o" endseg beginseg - name "ovl_En_Ge3" + name "ovl_En_Ms" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge3/z_en_ge3.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge3/ovl_En_Ge3_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ms/z_en_ms.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ms/ovl_En_Ms_reloc.o" endseg beginseg - name "ovl_En_GeldB" + name "ovl_En_Hs" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_GeldB/z_en_geldb.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_GeldB/ovl_En_GeldB_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hs/z_en_hs.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hs/ovl_En_Hs_reloc.o" endseg beginseg - name "ovl_En_GirlA" + name "ovl_Bg_Ingate" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_GirlA/z_en_girla.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_GirlA/ovl_En_GirlA_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ingate/ovl_Bg_Ingate_reloc.o" endseg beginseg - name "ovl_En_Gm" + name "ovl_En_Kanban" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gm/z_en_gm.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gm/ovl_En_Gm_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kanban/z_en_kanban.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kanban/ovl_En_Kanban_reloc.o" endseg beginseg - name "ovl_En_Go" + name "ovl_En_Heishi3" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Go/z_en_go.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Go/ovl_En_Go_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi3/ovl_En_Heishi3_reloc.o" endseg beginseg - name "ovl_En_Go2" + name "ovl_En_Syateki_Niw" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Go2/z_en_go2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Go2/ovl_En_Go2_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Niw/ovl_En_Syateki_Niw_reloc.o" endseg beginseg - name "ovl_En_Goma" + name "ovl_En_Attack_Niw" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Goma/z_en_goma.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Goma/ovl_En_Goma_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Attack_Niw/ovl_En_Attack_Niw_reloc.o" endseg beginseg - name "ovl_En_Goroiwa" + name "ovl_Bg_Spot01_Idosoko" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Goroiwa/ovl_En_Goroiwa_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idosoko/ovl_Bg_Spot01_Idosoko_reloc.o" endseg beginseg - name "ovl_En_Gs" + name "ovl_En_Sa" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gs/z_en_gs.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gs/ovl_En_Gs_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sa/z_en_sa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sa/ovl_En_Sa_reloc.o" endseg beginseg - name "ovl_En_Guest" + name "ovl_En_Wonder_Talk" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Guest/z_en_guest.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Guest/ovl_En_Guest_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Talk/ovl_En_Wonder_Talk_reloc.o" endseg beginseg - name "ovl_En_Hata" + name "ovl_Bg_Gjyo_Bridge" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hata/z_en_hata.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hata/ovl_En_Hata_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gjyo_Bridge/ovl_Bg_Gjyo_Bridge_reloc.o" endseg beginseg - name "ovl_En_Heishi1" + name "ovl_En_Ds" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi1/ovl_En_Heishi1_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ds/z_en_ds.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ds/ovl_En_Ds_reloc.o" endseg beginseg - name "ovl_En_Heishi2" + name "ovl_En_Mk" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi2/ovl_En_Heishi2_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mk/z_en_mk.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mk/ovl_En_Mk_reloc.o" endseg beginseg - name "ovl_En_Heishi3" + name "ovl_En_Bom_Bowl_Man" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi3/ovl_En_Heishi3_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Bowl_Man/ovl_En_Bom_Bowl_Man_reloc.o" endseg beginseg - name "ovl_En_Heishi4" + name "ovl_En_Bom_Bowl_Pit" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi4/ovl_En_Heishi4_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Bowl_Pit/ovl_En_Bom_Bowl_Pit_reloc.o" endseg beginseg - name "ovl_En_Hintnuts" + name "ovl_En_Owl" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hintnuts/ovl_En_Hintnuts_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Owl/z_en_owl.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Owl/ovl_En_Owl_reloc.o" endseg beginseg - name "ovl_En_Holl" + name "ovl_En_Ishi" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Holl/z_en_holl.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Holl/ovl_En_Holl_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ishi/z_en_ishi.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ishi/ovl_En_Ishi_reloc.o" endseg beginseg - name "ovl_En_Honotrap" + name "ovl_Obj_Hana" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Honotrap/ovl_En_Honotrap_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hana/ovl_Obj_Hana_reloc.o" endseg beginseg - name "ovl_En_Horse" + name "ovl_Obj_Lightswitch" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse/z_en_horse.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse/ovl_En_Horse_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Lightswitch/ovl_Obj_Lightswitch_reloc.o" endseg beginseg - name "ovl_En_Horse_Game_Check" + name "ovl_Obj_Mure2" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Game_Check/ovl_En_Horse_Game_Check_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure2/ovl_Obj_Mure2_reloc.o" endseg beginseg - name "ovl_En_Horse_Ganon" + name "ovl_En_Go" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Ganon/ovl_En_Horse_Ganon_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Go/z_en_go.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Go/ovl_En_Go_reloc.o" endseg beginseg - name "ovl_En_Horse_Link_Child" + name "ovl_En_Fu" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Link_Child/ovl_En_Horse_Link_Child_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fu/z_en_fu.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fu/ovl_En_Fu_reloc.o" endseg beginseg - name "ovl_En_Horse_Normal" + name "ovl_En_Changer" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Normal/ovl_En_Horse_Normal_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Changer/z_en_changer.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Changer/ovl_En_Changer_reloc.o" endseg beginseg - name "ovl_En_Horse_Zelda" + name "ovl_Bg_Jya_Megami" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Zelda/ovl_En_Horse_Zelda_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Megami/ovl_Bg_Jya_Megami_reloc.o" endseg beginseg - name "ovl_En_Hs" + name "ovl_Bg_Jya_Lift" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hs/z_en_hs.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hs/ovl_En_Hs_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Lift/ovl_Bg_Jya_Lift_reloc.o" endseg beginseg - name "ovl_En_Hs2" + name "ovl_Bg_Jya_Bigmirror" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hs2/z_en_hs2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hs2/ovl_En_Hs2_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bigmirror/ovl_Bg_Jya_Bigmirror_reloc.o" endseg beginseg - name "ovl_En_Hy" + name "ovl_Bg_Jya_Bombchuiwa" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hy/z_en_hy.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hy/ovl_En_Hy_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/ovl_Bg_Jya_Bombchuiwa_reloc.o" endseg beginseg - name "ovl_En_Ice_Hono" + name "ovl_Bg_Jya_Amishutter" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ice_Hono/ovl_En_Ice_Hono_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Amishutter/ovl_Bg_Jya_Amishutter_reloc.o" endseg beginseg - name "ovl_En_Ik" + name "ovl_Bg_Jya_Bombiwa" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ik/z_en_ik.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ik/ovl_En_Ik_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bombiwa/ovl_Bg_Jya_Bombiwa_reloc.o" endseg beginseg - name "ovl_En_In" + name "ovl_Bg_Spot18_Basket" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_In/z_en_in.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_In/ovl_En_In_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Basket/ovl_Bg_Spot18_Basket_reloc.o" endseg beginseg - name "ovl_En_Insect" + name "ovl_En_Ganon_Organ" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Insect/z_en_insect.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Insect/ovl_En_Insect_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ganon_Organ/ovl_En_Ganon_Organ_reloc.o" endseg beginseg - name "ovl_En_Ishi" + name "ovl_En_Siofuki" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ishi/z_en_ishi.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ishi/ovl_En_Ishi_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Siofuki/ovl_En_Siofuki_reloc.o" endseg beginseg - name "ovl_En_It" + name "ovl_En_Stream" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_It/z_en_it.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_It/ovl_En_It_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Stream/z_en_stream.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Stream/ovl_En_Stream_reloc.o" endseg beginseg - name "ovl_En_Jj" + name "ovl_En_Mm" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/ovl_En_Jj_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mm/z_en_mm.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mm/ovl_En_Mm_reloc.o" endseg beginseg - name "ovl_En_Js" + name "ovl_En_Ko" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Js/z_en_js.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Js/ovl_En_Js_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ko/z_en_ko.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ko/ovl_En_Ko_reloc.o" endseg beginseg - name "ovl_En_Jsjutan" + name "ovl_En_Kz" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jsjutan/ovl_En_Jsjutan_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kz/z_en_kz.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kz/ovl_En_Kz_reloc.o" endseg beginseg - name "ovl_En_Kakasi" + name "ovl_En_Weather_Tag" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi/ovl_En_Kakasi_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Weather_Tag/ovl_En_Weather_Tag_reloc.o" endseg beginseg - name "ovl_En_Kakasi2" + name "ovl_Bg_Sst_Floor" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi2/ovl_En_Kakasi2_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Sst_Floor/ovl_Bg_Sst_Floor_reloc.o" endseg beginseg - name "ovl_En_Kakasi3" + name "ovl_En_Ani" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi3/ovl_En_Kakasi3_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ani/z_en_ani.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ani/ovl_En_Ani_reloc.o" endseg beginseg - name "ovl_En_Kanban" + name "ovl_En_Ex_Item" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kanban/z_en_kanban.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kanban/ovl_En_Kanban_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ex_Item/ovl_En_Ex_Item_reloc.o" endseg beginseg - name "ovl_En_Karebaba" + name "ovl_Bg_Jya_Ironobj" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Karebaba/ovl_En_Karebaba_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Ironobj/ovl_Bg_Jya_Ironobj_reloc.o" endseg beginseg - name "ovl_En_Ko" + name "ovl_En_Js" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ko/z_en_ko.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ko/ovl_En_Ko_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Js/z_en_js.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Js/ovl_En_Js_reloc.o" endseg beginseg - name "ovl_En_Kusa" + name "ovl_En_Jsjutan" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kusa/z_en_kusa.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kusa/ovl_En_Kusa_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jsjutan/ovl_En_Jsjutan_reloc.o" endseg beginseg - name "ovl_En_Kz" + name "ovl_En_Cs" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kz/z_en_kz.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kz/ovl_En_Kz_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Cs/z_en_cs.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Cs/ovl_En_Cs_reloc.o" endseg beginseg - name "ovl_En_Light" + name "ovl_En_Md" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Light/z_en_light.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Light/ovl_En_Light_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Md/z_en_md.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Md/ovl_En_Md_reloc.o" endseg beginseg - name "ovl_En_Lightbox" + name "ovl_En_Hy" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Lightbox/ovl_En_Lightbox_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hy/z_en_hy.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hy/ovl_En_Hy_reloc.o" endseg beginseg - name "ovl_En_M_Fire1" + name "ovl_En_Ganon_Mant" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_M_Fire1/ovl_En_M_Fire1_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ganon_Mant/ovl_En_Ganon_Mant_reloc.o" endseg beginseg - name "ovl_En_M_Thunder" + name "ovl_En_Okarina_Effect" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_M_Thunder/ovl_En_M_Thunder_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Effect/ovl_En_Okarina_Effect_reloc.o" endseg beginseg - name "ovl_En_Ma1" + name "ovl_En_Mag" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma1/z_en_ma1.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma1/ovl_En_Ma1_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mag/z_en_mag.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mag/ovl_En_Mag_reloc.o" endseg beginseg - name "ovl_En_Ma2" + name "ovl_Door_Gerudo" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma2/z_en_ma2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma2/ovl_En_Ma2_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Gerudo/ovl_Door_Gerudo_reloc.o" endseg beginseg - name "ovl_En_Ma3" + name "ovl_Elf_Msg2" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma3/z_en_ma3.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma3/ovl_En_Ma3_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Elf_Msg2/ovl_Elf_Msg2_reloc.o" +endseg + +beginseg + name "ovl_Demo_Gt" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Gt/ovl_Demo_Gt_reloc.o" +endseg + +beginseg + name "ovl_En_Po_Field" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Field/ovl_En_Po_Field_reloc.o" +endseg + +beginseg + name "ovl_Efc_Erupc" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Efc_Erupc/ovl_Efc_Erupc_reloc.o" +endseg + +beginseg + name "ovl_Bg_Zg" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Zg/ovl_Bg_Zg_reloc.o" +endseg + +beginseg + name "ovl_En_Heishi4" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi4/ovl_En_Heishi4_reloc.o" +endseg + +beginseg + name "ovl_En_Zl3" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl3/z_en_zl3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl3/ovl_En_Zl3_reloc.o" +endseg + +beginseg + name "ovl_Boss_Ganon2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganon2/ovl_Boss_Ganon2_reloc.o" +endseg + +beginseg + name "ovl_En_Kakasi" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi/ovl_En_Kakasi_reloc.o" +endseg + +beginseg + name "ovl_En_Takara_Man" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Takara_Man/ovl_En_Takara_Man_reloc.o" +endseg + +beginseg + name "ovl_Obj_Makeoshihiki" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Makeoshihiki/ovl_Obj_Makeoshihiki_reloc.o" +endseg + +beginseg + name "ovl_Oceff_Spot" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Spot/ovl_Oceff_Spot_reloc.o" +endseg + +beginseg + name "ovl_End_Title" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_End_Title/z_end_title.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_End_Title/ovl_End_Title_reloc.o" +endseg + +beginseg + name "ovl_En_Torch" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Torch/z_en_torch.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Torch/ovl_En_Torch_reloc.o" +endseg + +beginseg + name "ovl_Demo_Ec" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ec/ovl_Demo_Ec_reloc.o" +endseg + +beginseg + name "ovl_Shot_Sun" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Shot_Sun/ovl_Shot_Sun_reloc.o" +endseg + +beginseg + name "ovl_En_Dy_Extra" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dy_Extra/ovl_En_Dy_Extra_reloc.o" +endseg + +beginseg + name "ovl_En_Wonder_Talk2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Talk2/ovl_En_Wonder_Talk2_reloc.o" +endseg + +beginseg + name "ovl_En_Ge2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge2/z_en_ge2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge2/ovl_En_Ge2_reloc.o" +endseg + +beginseg + name "ovl_Obj_Roomtimer" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Roomtimer/ovl_Obj_Roomtimer_reloc.o" +endseg + +beginseg + name "ovl_En_Ssh" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ssh/z_en_ssh.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ssh/ovl_En_Ssh_reloc.o" +endseg + +beginseg + name "ovl_En_Sth" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sth/z_en_sth.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sth/ovl_En_Sth_reloc.o" +endseg + +beginseg + name "ovl_Oceff_Wipe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe/ovl_Oceff_Wipe_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Dust" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dust/ovl_Effect_Ss_Dust_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_KiraKira" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_KiraKira/ovl_Effect_Ss_KiraKira_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Bomb" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bomb/ovl_Effect_Ss_Bomb_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Bomb2" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bomb2/ovl_Effect_Ss_Bomb2_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Blast" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Blast/ovl_Effect_Ss_Blast_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_G_Spk" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Spk/ovl_Effect_Ss_G_Spk_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_D_Fire" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_D_Fire/ovl_Effect_Ss_D_Fire_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Bubble" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bubble/ovl_Effect_Ss_Bubble_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_G_Ripple" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Ripple/ovl_Effect_Ss_G_Ripple_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_G_Splash" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Splash/ovl_Effect_Ss_G_Splash_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_G_Magma" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Magma/ovl_Effect_Ss_G_Magma_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_G_Fire" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Fire/ovl_Effect_Ss_G_Fire_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Lightning" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Lightning/ovl_Effect_Ss_Lightning_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Dt_Bubble" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/ovl_Effect_Ss_Dt_Bubble_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Hahen" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Hahen/ovl_Effect_Ss_Hahen_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Stick" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Stick/ovl_Effect_Ss_Stick_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Sibuki" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Sibuki/ovl_Effect_Ss_Sibuki_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Sibuki2" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Sibuki2/ovl_Effect_Ss_Sibuki2_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_G_Magma2" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Magma2/ovl_Effect_Ss_G_Magma2_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Stone1" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Stone1/ovl_Effect_Ss_Stone1_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_HitMark" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_HitMark/ovl_Effect_Ss_HitMark_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Fhg_Flash" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/ovl_Effect_Ss_Fhg_Flash_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_K_Fire" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_K_Fire/ovl_Effect_Ss_K_Fire_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Solder_Srch_Ball" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/ovl_Effect_Ss_Solder_Srch_Ball_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Kakera" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Kakera/ovl_Effect_Ss_Kakera_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Ice_Piece" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/ovl_Effect_Ss_Ice_Piece_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_En_Ice" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_En_Ice/ovl_Effect_Ss_En_Ice_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Fire_Tail" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/ovl_Effect_Ss_Fire_Tail_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_En_Fire" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_En_Fire/ovl_Effect_Ss_En_Fire_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Extra" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Extra/ovl_Effect_Ss_Extra_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Fcircle" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fcircle/ovl_Effect_Ss_Fcircle_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Dead_Db" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Db/ovl_Effect_Ss_Dead_Db_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Dead_Dd" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/ovl_Effect_Ss_Dead_Dd_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Dead_Ds" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/ovl_Effect_Ss_Dead_Ds_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Dead_Sound" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/ovl_Effect_Ss_Dead_Sound_reloc.o" +endseg + +beginseg + name "ovl_Oceff_Storm" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Storm/ovl_Oceff_Storm_reloc.o" +endseg + +beginseg + name "ovl_En_Weiyer" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Weiyer/ovl_En_Weiyer_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot05_Soko" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot05_Soko/ovl_Bg_Spot05_Soko_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_1flift" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_1flift/ovl_Bg_Jya_1flift_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Haheniron" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Haheniron/ovl_Bg_Jya_Haheniron_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot12_Gate" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot12_Gate/ovl_Bg_Spot12_Gate_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot12_Saku" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot12_Saku/ovl_Bg_Spot12_Saku_reloc.o" +endseg + +beginseg + name "ovl_En_Hintnuts" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hintnuts/ovl_En_Hintnuts_reloc.o" +endseg + +beginseg + name "ovl_En_Nutsball" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nutsball/ovl_En_Nutsball_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot00_Break" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot00_Break/ovl_Bg_Spot00_Break_reloc.o" +endseg + +beginseg + name "ovl_En_Shopnuts" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Shopnuts/ovl_En_Shopnuts_reloc.o" +endseg + +beginseg + name "ovl_En_It" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_It/z_en_it.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_It/ovl_En_It_reloc.o" +endseg + +beginseg + name "ovl_En_GeldB" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_GeldB/z_en_geldb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_GeldB/ovl_En_GeldB_reloc.o" +endseg + +beginseg + name "ovl_Oceff_Wipe2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe2/ovl_Oceff_Wipe2_reloc.o" +endseg + +beginseg + name "ovl_Oceff_Wipe3" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe3/ovl_Oceff_Wipe3_reloc.o" +endseg + +beginseg + name "ovl_En_Niw_Girl" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw_Girl/ovl_En_Niw_Girl_reloc.o" +endseg + +beginseg + name "ovl_En_Dog" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dog/z_en_dog.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dog/ovl_En_Dog_reloc.o" +endseg + +beginseg + name "ovl_En_Si" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Si/z_en_si.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Si/ovl_En_Si_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot01_Objects2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Objects2/ovl_Bg_Spot01_Objects2_reloc.o" +endseg + +beginseg + name "ovl_Obj_Comb" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Comb/ovl_Obj_Comb_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot11_Bakudankabe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/ovl_Bg_Spot11_Bakudankabe_reloc.o" +endseg + +beginseg + name "ovl_Obj_Kibako2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Kibako2/ovl_Obj_Kibako2_reloc.o" +endseg + +beginseg + name "ovl_En_Dnt_Demo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Demo/ovl_En_Dnt_Demo_reloc.o" +endseg + +beginseg + name "ovl_En_Dnt_Jiji" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Jiji/ovl_En_Dnt_Jiji_reloc.o" +endseg + +beginseg + name "ovl_En_Dnt_Nomal" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Nomal/ovl_En_Dnt_Nomal_reloc.o" +endseg + +beginseg + name "ovl_En_Guest" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Guest/z_en_guest.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Guest/ovl_En_Guest_reloc.o" +endseg + +beginseg + name "ovl_Bg_Bom_Guard" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bom_Guard/ovl_Bg_Bom_Guard_reloc.o" +endseg + +beginseg + name "ovl_En_Hs2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hs2/z_en_hs2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hs2/ovl_En_Hs2_reloc.o" +endseg + +beginseg + name "ovl_Demo_Kekkai" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kekkai/ovl_Demo_Kekkai_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot08_Bakudankabe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/ovl_Bg_Spot08_Bakudankabe_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot17_Bakudankabe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/ovl_Bg_Spot17_Bakudankabe_reloc.o" +endseg + +beginseg + name "ovl_Obj_Mure3" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure3/ovl_Obj_Mure3_reloc.o" +endseg + +beginseg + name "ovl_En_Tg" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tg/z_en_tg.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tg/ovl_En_Tg_reloc.o" +endseg + +beginseg + name "ovl_En_Mu" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mu/z_en_mu.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mu/ovl_En_Mu_reloc.o" +endseg + +beginseg + name "ovl_En_Go2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Go2/z_en_go2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Go2/ovl_En_Go2_reloc.o" +endseg + +beginseg + name "ovl_En_Wf" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wf/z_en_wf.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wf/ovl_En_Wf_reloc.o" +endseg + +beginseg + name "ovl_En_Skb" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skb/z_en_skb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skb/ovl_En_Skb_reloc.o" +endseg + +beginseg + name "ovl_Demo_Gj" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Gj/ovl_Demo_Gj_reloc.o" +endseg + +beginseg + name "ovl_Demo_Geff" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Geff/ovl_Demo_Geff_reloc.o" +endseg + +beginseg + name "ovl_Bg_Gnd_Firemeiro" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/ovl_Bg_Gnd_Firemeiro_reloc.o" +endseg + +beginseg + name "ovl_Bg_Gnd_Darkmeiro" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/ovl_Bg_Gnd_Darkmeiro_reloc.o" +endseg + +beginseg + name "ovl_Bg_Gnd_Soulmeiro" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/ovl_Bg_Gnd_Soulmeiro_reloc.o" +endseg + +beginseg + name "ovl_Bg_Gnd_Nisekabe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/ovl_Bg_Gnd_Nisekabe_reloc.o" +endseg + +beginseg + name "ovl_Bg_Gnd_Iceblock" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Iceblock/ovl_Bg_Gnd_Iceblock_reloc.o" +endseg + +beginseg + name "ovl_Bg_Ydan_Sp" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Sp/ovl_Bg_Ydan_Sp_reloc.o" +endseg + +beginseg + name "ovl_En_Gb" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gb/z_en_gb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gb/ovl_En_Gb_reloc.o" +endseg + +beginseg + name "ovl_En_Gs" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gs/z_en_gs.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gs/ovl_En_Gs_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mizu_Bwall" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Bwall/ovl_Bg_Mizu_Bwall_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mizu_Shutter" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Shutter/ovl_Bg_Mizu_Shutter_reloc.o" +endseg + +beginseg + name "ovl_En_Daiku_Kakariko" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Daiku_Kakariko/ovl_En_Daiku_Kakariko_reloc.o" +endseg + +beginseg + name "ovl_Bg_Bowl_Wall" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bowl_Wall/ovl_Bg_Bowl_Wall_reloc.o" +endseg + +beginseg + name "ovl_En_Wall_Tubo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wall_Tubo/ovl_En_Wall_Tubo_reloc.o" +endseg + +beginseg + name "ovl_En_Po_Desert" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Desert/ovl_En_Po_Desert_reloc.o" +endseg + +beginseg + name "ovl_En_Crow" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Crow/z_en_crow.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Crow/ovl_En_Crow_reloc.o" +endseg + +beginseg + name "ovl_Door_Killer" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Killer/z_door_killer.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Killer/ovl_Door_Killer_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot11_Oasis" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot11_Oasis/ovl_Bg_Spot11_Oasis_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot18_Futa" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Futa/ovl_Bg_Spot18_Futa_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot18_Shutter" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Shutter/ovl_Bg_Spot18_Shutter_reloc.o" +endseg + +beginseg + name "ovl_En_Ma3" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma3/z_en_ma3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma3/ovl_En_Ma3_reloc.o" +endseg + +beginseg + name "ovl_En_Cow" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Cow/z_en_cow.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Cow/ovl_En_Cow_reloc.o" +endseg + +beginseg + name "ovl_Bg_Ice_Turara" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Turara/ovl_Bg_Ice_Turara_reloc.o" +endseg + +beginseg + name "ovl_Bg_Ice_Shutter" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Shutter/ovl_Bg_Ice_Shutter_reloc.o" +endseg + +beginseg + name "ovl_En_Kakasi2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi2/ovl_En_Kakasi2_reloc.o" +endseg + +beginseg + name "ovl_En_Kakasi3" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi3/ovl_En_Kakasi3_reloc.o" +endseg + +beginseg + name "ovl_Oceff_Wipe4" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe4/ovl_Oceff_Wipe4_reloc.o" +endseg + +beginseg + name "ovl_En_Eg" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Eg/z_en_eg.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Eg/ovl_En_Eg_reloc.o" +endseg + +beginseg + name "ovl_Bg_Menkuri_Nisekabe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/ovl_Bg_Menkuri_Nisekabe_reloc.o" +endseg + +beginseg + name "ovl_En_Zo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zo/z_en_zo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zo/ovl_En_Zo_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Ice_Smoke" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/ovl_Effect_Ss_Ice_Smoke_reloc.o" +endseg + +beginseg + name "ovl_Obj_Makekinsuta" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Makekinsuta/ovl_Obj_Makekinsuta_reloc.o" +endseg + +beginseg + name "ovl_En_Ge3" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge3/z_en_ge3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge3/ovl_En_Ge3_reloc.o" +endseg + +beginseg + name "ovl_Obj_Timeblock" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Timeblock/ovl_Obj_Timeblock_reloc.o" +endseg + +beginseg + name "ovl_Obj_Hamishi" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hamishi/ovl_Obj_Hamishi_reloc.o" +endseg + +beginseg + name "ovl_En_Zl4" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl4/z_en_zl4.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl4/ovl_En_Zl4_reloc.o" +endseg + +beginseg + name "ovl_En_Mm2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mm2/z_en_mm2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mm2/ovl_En_Mm2_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Block" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Block/ovl_Bg_Jya_Block_reloc.o" +endseg + +beginseg + name "ovl_Obj_Warp2block" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Warp2block/ovl_Obj_Warp2block_reloc.o" +endseg + +#else + +beginseg + name "ovl_Arms_Hook" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arms_Hook/ovl_Arms_Hook_reloc.o" +endseg + +beginseg + name "ovl_Arrow_Fire" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Fire/ovl_Arrow_Fire_reloc.o" +endseg + +beginseg + name "ovl_Arrow_Ice" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Ice/ovl_Arrow_Ice_reloc.o" +endseg + +beginseg + name "ovl_Arrow_Light" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Arrow_Light/ovl_Arrow_Light_reloc.o" +endseg + +beginseg + name "ovl_Bg_Bdan_Objects" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bdan_Objects/ovl_Bg_Bdan_Objects_reloc.o" +endseg + +beginseg + name "ovl_Bg_Bdan_Switch" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bdan_Switch/ovl_Bg_Bdan_Switch_reloc.o" +endseg + +beginseg + name "ovl_Bg_Bom_Guard" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bom_Guard/ovl_Bg_Bom_Guard_reloc.o" +endseg + +beginseg + name "ovl_Bg_Bombwall" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bombwall/ovl_Bg_Bombwall_reloc.o" +endseg + +beginseg + name "ovl_Bg_Bowl_Wall" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Bowl_Wall/ovl_Bg_Bowl_Wall_reloc.o" +endseg + +beginseg + name "ovl_Bg_Breakwall" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Breakwall/ovl_Bg_Breakwall_reloc.o" +endseg + +beginseg + name "ovl_Bg_Ddan_Jd" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ddan_Jd/ovl_Bg_Ddan_Jd_reloc.o" +endseg + +beginseg + name "ovl_Bg_Ddan_Kd" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ddan_Kd/ovl_Bg_Ddan_Kd_reloc.o" +endseg + +beginseg + name "ovl_Bg_Dodoago" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Dodoago/ovl_Bg_Dodoago_reloc.o" +endseg + +beginseg + name "ovl_Bg_Dy_Yoseizo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Dy_Yoseizo/ovl_Bg_Dy_Yoseizo_reloc.o" +endseg + +beginseg + name "ovl_Bg_Ganon_Otyuka" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ganon_Otyuka/ovl_Bg_Ganon_Otyuka_reloc.o" +endseg + +beginseg + name "ovl_Bg_Gate_Shutter" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gate_Shutter/ovl_Bg_Gate_Shutter_reloc.o" +endseg + +beginseg + name "ovl_Bg_Gjyo_Bridge" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gjyo_Bridge/ovl_Bg_Gjyo_Bridge_reloc.o" +endseg + +beginseg + name "ovl_Bg_Gnd_Darkmeiro" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/ovl_Bg_Gnd_Darkmeiro_reloc.o" +endseg + +beginseg + name "ovl_Bg_Gnd_Firemeiro" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/ovl_Bg_Gnd_Firemeiro_reloc.o" +endseg + +beginseg + name "ovl_Bg_Gnd_Iceblock" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Iceblock/ovl_Bg_Gnd_Iceblock_reloc.o" +endseg + +beginseg + name "ovl_Bg_Gnd_Nisekabe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/ovl_Bg_Gnd_Nisekabe_reloc.o" +endseg + +beginseg + name "ovl_Bg_Gnd_Soulmeiro" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/ovl_Bg_Gnd_Soulmeiro_reloc.o" +endseg + +beginseg + name "ovl_Bg_Haka" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka/ovl_Bg_Haka_reloc.o" +endseg + +beginseg + name "ovl_Bg_Haka_Gate" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Gate/ovl_Bg_Haka_Gate_reloc.o" +endseg + +beginseg + name "ovl_Bg_Haka_Huta" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Huta/ovl_Bg_Haka_Huta_reloc.o" +endseg + +beginseg + name "ovl_Bg_Haka_Megane" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Megane/ovl_Bg_Haka_Megane_reloc.o" +endseg + +beginseg + name "ovl_Bg_Haka_MeganeBG" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_MeganeBG/ovl_Bg_Haka_MeganeBG_reloc.o" +endseg + +beginseg + name "ovl_Bg_Haka_Sgami" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Sgami/ovl_Bg_Haka_Sgami_reloc.o" +endseg + +beginseg + name "ovl_Bg_Haka_Ship" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Ship/ovl_Bg_Haka_Ship_reloc.o" +endseg + +beginseg + name "ovl_Bg_Haka_Trap" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Trap/ovl_Bg_Haka_Trap_reloc.o" +endseg + +beginseg + name "ovl_Bg_Haka_Tubo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Tubo/ovl_Bg_Haka_Tubo_reloc.o" +endseg + +beginseg + name "ovl_Bg_Haka_Water" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Water/ovl_Bg_Haka_Water_reloc.o" +endseg + +beginseg + name "ovl_Bg_Haka_Zou" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Haka_Zou/ovl_Bg_Haka_Zou_reloc.o" +endseg + +beginseg + name "ovl_Bg_Heavy_Block" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Heavy_Block/ovl_Bg_Heavy_Block_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Curtain" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Curtain/ovl_Bg_Hidan_Curtain_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Dalm" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Dalm/ovl_Bg_Hidan_Dalm_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Firewall" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Firewall/ovl_Bg_Hidan_Firewall_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Fslift" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Fslift/ovl_Bg_Hidan_Fslift_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Fwbig" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Fwbig/ovl_Bg_Hidan_Fwbig_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Hamstep" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Hamstep/ovl_Bg_Hidan_Hamstep_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Hrock" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Hrock/ovl_Bg_Hidan_Hrock_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Kousi" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Kousi/ovl_Bg_Hidan_Kousi_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Kowarerukabe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/ovl_Bg_Hidan_Kowarerukabe_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Rock" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Rock/ovl_Bg_Hidan_Rock_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Rsekizou" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/ovl_Bg_Hidan_Rsekizou_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Sekizou" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Sekizou/ovl_Bg_Hidan_Sekizou_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Sima" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Sima/ovl_Bg_Hidan_Sima_reloc.o" +endseg + +beginseg + name "ovl_Bg_Hidan_Syoku" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Hidan_Syoku/ovl_Bg_Hidan_Syoku_reloc.o" +endseg + +beginseg + name "ovl_Bg_Ice_Objects" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Objects/ovl_Bg_Ice_Objects_reloc.o" +endseg + +beginseg + name "ovl_Bg_Ice_Shelter" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Shelter/ovl_Bg_Ice_Shelter_reloc.o" +endseg + +beginseg + name "ovl_Bg_Ice_Shutter" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Shutter/ovl_Bg_Ice_Shutter_reloc.o" +endseg + +beginseg + name "ovl_Bg_Ice_Turara" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ice_Turara/ovl_Bg_Ice_Turara_reloc.o" +endseg + +beginseg + name "ovl_Bg_Ingate" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ingate/ovl_Bg_Ingate_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_1flift" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_1flift/ovl_Bg_Jya_1flift_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Amishutter" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Amishutter/ovl_Bg_Jya_Amishutter_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Bigmirror" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bigmirror/ovl_Bg_Jya_Bigmirror_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Block" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Block/ovl_Bg_Jya_Block_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Bombchuiwa" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/ovl_Bg_Jya_Bombchuiwa_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Bombiwa" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Bombiwa/ovl_Bg_Jya_Bombiwa_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Cobra" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Cobra/ovl_Bg_Jya_Cobra_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Goroiwa" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Goroiwa/ovl_Bg_Jya_Goroiwa_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Haheniron" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Haheniron/ovl_Bg_Jya_Haheniron_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Ironobj" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Ironobj/ovl_Bg_Jya_Ironobj_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Kanaami" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Kanaami/ovl_Bg_Jya_Kanaami_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Lift" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Lift/ovl_Bg_Jya_Lift_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Megami" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Megami/ovl_Bg_Jya_Megami_reloc.o" +endseg + +beginseg + name "ovl_Bg_Jya_Zurerukabe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/ovl_Bg_Jya_Zurerukabe_reloc.o" +endseg + +beginseg + name "ovl_Bg_Menkuri_Eye" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Eye/ovl_Bg_Menkuri_Eye_reloc.o" +endseg + +beginseg + name "ovl_Bg_Menkuri_Kaiten" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/ovl_Bg_Menkuri_Kaiten_reloc.o" +endseg + +beginseg + name "ovl_Bg_Menkuri_Nisekabe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/ovl_Bg_Menkuri_Nisekabe_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mizu_Bwall" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Bwall/ovl_Bg_Mizu_Bwall_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mizu_Movebg" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Movebg/ovl_Bg_Mizu_Movebg_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mizu_Shutter" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Shutter/ovl_Bg_Mizu_Shutter_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mizu_Uzu" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Uzu/ovl_Bg_Mizu_Uzu_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mizu_Water" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mizu_Water/ovl_Bg_Mizu_Water_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mjin" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mjin/ovl_Bg_Mjin_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mori_Bigst" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Bigst/ovl_Bg_Mori_Bigst_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mori_Elevator" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Elevator/ovl_Bg_Mori_Elevator_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mori_Hashigo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hashigo/ovl_Bg_Mori_Hashigo_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mori_Hashira4" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hashira4/ovl_Bg_Mori_Hashira4_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mori_Hineri" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Hineri/ovl_Bg_Mori_Hineri_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mori_Idomizu" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Idomizu/ovl_Bg_Mori_Idomizu_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mori_Kaitenkabe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/ovl_Bg_Mori_Kaitenkabe_reloc.o" +endseg + +beginseg + name "ovl_Bg_Mori_Rakkatenjo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/ovl_Bg_Mori_Rakkatenjo_reloc.o" +endseg + +beginseg + name "ovl_Bg_Po_Event" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Po_Event/ovl_Bg_Po_Event_reloc.o" +endseg + +beginseg + name "ovl_Bg_Po_Syokudai" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Po_Syokudai/ovl_Bg_Po_Syokudai_reloc.o" +endseg + +beginseg + name "ovl_Bg_Pushbox" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Pushbox/ovl_Bg_Pushbox_reloc.o" +endseg + +beginseg + name "ovl_Bg_Relay_Objects" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Relay_Objects/ovl_Bg_Relay_Objects_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot00_Break" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot00_Break/ovl_Bg_Spot00_Break_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot00_Hanebasi" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/ovl_Bg_Spot00_Hanebasi_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot01_Fusya" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Fusya/ovl_Bg_Spot01_Fusya_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot01_Idohashira" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idohashira/ovl_Bg_Spot01_Idohashira_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot01_Idomizu" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idomizu/ovl_Bg_Spot01_Idomizu_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot01_Idosoko" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Idosoko/ovl_Bg_Spot01_Idosoko_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot01_Objects2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot01_Objects2/ovl_Bg_Spot01_Objects2_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot02_Objects" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot02_Objects/ovl_Bg_Spot02_Objects_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot03_Taki" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot03_Taki/ovl_Bg_Spot03_Taki_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot05_Soko" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot05_Soko/ovl_Bg_Spot05_Soko_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot06_Objects" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot06_Objects/ovl_Bg_Spot06_Objects_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot07_Taki" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot07_Taki/ovl_Bg_Spot07_Taki_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot08_Bakudankabe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/ovl_Bg_Spot08_Bakudankabe_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot08_Iceblock" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot08_Iceblock/ovl_Bg_Spot08_Iceblock_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot09_Obj" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot09_Obj/ovl_Bg_Spot09_Obj_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot11_Bakudankabe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/ovl_Bg_Spot11_Bakudankabe_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot11_Oasis" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot11_Oasis/ovl_Bg_Spot11_Oasis_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot12_Gate" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot12_Gate/ovl_Bg_Spot12_Gate_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot12_Saku" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot12_Saku/ovl_Bg_Spot12_Saku_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot15_Rrbox" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot15_Rrbox/ovl_Bg_Spot15_Rrbox_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot15_Saku" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot15_Saku/ovl_Bg_Spot15_Saku_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot16_Bombstone" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot16_Bombstone/ovl_Bg_Spot16_Bombstone_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot16_Doughnut" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot16_Doughnut/ovl_Bg_Spot16_Doughnut_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot17_Bakudankabe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/ovl_Bg_Spot17_Bakudankabe_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot17_Funen" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot17_Funen/ovl_Bg_Spot17_Funen_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot18_Basket" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Basket/ovl_Bg_Spot18_Basket_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot18_Futa" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Futa/ovl_Bg_Spot18_Futa_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot18_Obj" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Obj/ovl_Bg_Spot18_Obj_reloc.o" +endseg + +beginseg + name "ovl_Bg_Spot18_Shutter" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Spot18_Shutter/ovl_Bg_Spot18_Shutter_reloc.o" +endseg + +beginseg + name "ovl_Bg_Sst_Floor" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Sst_Floor/ovl_Bg_Sst_Floor_reloc.o" +endseg + +beginseg + name "ovl_Bg_Toki_Hikari" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Hikari/ovl_Bg_Toki_Hikari_reloc.o" +endseg + +beginseg + name "ovl_Bg_Toki_Swd" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Toki_Swd/ovl_Bg_Toki_Swd_reloc.o" +endseg + +beginseg + name "ovl_Bg_Treemouth" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Treemouth/ovl_Bg_Treemouth_reloc.o" +endseg + +beginseg + name "ovl_Bg_Umajump" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Umajump/ovl_Bg_Umajump_reloc.o" +endseg + +beginseg + name "ovl_Bg_Vb_Sima" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Vb_Sima/ovl_Bg_Vb_Sima_reloc.o" +endseg + +beginseg + name "ovl_Bg_Ydan_Hasi" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Hasi/ovl_Bg_Ydan_Hasi_reloc.o" +endseg + +beginseg + name "ovl_Bg_Ydan_Maruta" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Maruta/ovl_Bg_Ydan_Maruta_reloc.o" +endseg + +beginseg + name "ovl_Bg_Ydan_Sp" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Ydan_Sp/ovl_Bg_Ydan_Sp_reloc.o" +endseg + +beginseg + name "ovl_Bg_Zg" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Bg_Zg/ovl_Bg_Zg_reloc.o" +endseg + +beginseg + name "ovl_Boss_Dodongo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Dodongo/ovl_Boss_Dodongo_reloc.o" +endseg + +beginseg + name "ovl_Boss_Fd" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Fd/ovl_Boss_Fd_reloc.o" +endseg + +beginseg + name "ovl_Boss_Fd2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Fd2/ovl_Boss_Fd2_reloc.o" +endseg + +beginseg + name "ovl_Boss_Ganon" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganon/ovl_Boss_Ganon_reloc.o" +endseg + +beginseg + name "ovl_Boss_Ganon2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganon2/ovl_Boss_Ganon2_reloc.o" +endseg + +beginseg + name "ovl_Boss_Ganondrof" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Ganondrof/ovl_Boss_Ganondrof_reloc.o" +endseg + +beginseg + name "ovl_Boss_Goma" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Goma/ovl_Boss_Goma_reloc.o" +endseg + +beginseg + name "ovl_Boss_Mo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Mo/ovl_Boss_Mo_reloc.o" +endseg + +beginseg + name "ovl_Boss_Sst" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Sst/ovl_Boss_Sst_reloc.o" +endseg + +beginseg + name "ovl_Boss_Tw" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Tw/ovl_Boss_Tw_reloc.o" +endseg + +beginseg + name "ovl_Boss_Va" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Va/z_boss_va.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Boss_Va/ovl_Boss_Va_reloc.o" +endseg + +beginseg + name "ovl_Demo_6K" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_6K/z_demo_6k.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_6K/ovl_Demo_6K_reloc.o" +endseg + +beginseg + name "ovl_Demo_Du" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Du/z_demo_du.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Du/ovl_Demo_Du_reloc.o" +endseg + +beginseg + name "ovl_Demo_Ec" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ec/ovl_Demo_Ec_reloc.o" +endseg + +beginseg + name "ovl_Demo_Effect" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Effect/ovl_Demo_Effect_reloc.o" +endseg + +beginseg + name "ovl_Demo_Ext" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ext/ovl_Demo_Ext_reloc.o" +endseg + +beginseg + name "ovl_Demo_Geff" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Geff/ovl_Demo_Geff_reloc.o" +endseg + +beginseg + name "ovl_Demo_Gj" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Gj/ovl_Demo_Gj_reloc.o" +endseg + +beginseg + name "ovl_Demo_Go" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Go/z_demo_go.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Go/ovl_Demo_Go_reloc.o" +endseg + +beginseg + name "ovl_Demo_Gt" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Gt/ovl_Demo_Gt_reloc.o" +endseg + +beginseg + name "ovl_Demo_Ik" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Ik/ovl_Demo_Ik_reloc.o" +endseg + +beginseg + name "ovl_Demo_Im" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Im/z_demo_im.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Im/ovl_Demo_Im_reloc.o" +endseg + +beginseg + name "ovl_Demo_Kankyo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data4.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data5.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data6.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data7.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data8.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kankyo/ovl_Demo_Kankyo_reloc.o" +endseg + +beginseg + name "ovl_Demo_Kekkai" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Kekkai/ovl_Demo_Kekkai_reloc.o" +endseg + +beginseg + name "ovl_Demo_Sa" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Sa/ovl_Demo_Sa_reloc.o" +endseg + +beginseg + name "ovl_Demo_Shd" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Shd/ovl_Demo_Shd_reloc.o" +endseg + +beginseg + name "ovl_Demo_Tre_Lgt" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Demo_Tre_Lgt/ovl_Demo_Tre_Lgt_reloc.o" +endseg + +beginseg + name "ovl_Door_Ana" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Ana/z_door_ana.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Ana/ovl_Door_Ana_reloc.o" +endseg + +beginseg + name "ovl_Door_Gerudo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Gerudo/ovl_Door_Gerudo_reloc.o" +endseg + +beginseg + name "ovl_Door_Killer" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Killer/z_door_killer.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Killer/ovl_Door_Killer_reloc.o" +endseg + +beginseg + name "ovl_Door_Shutter" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Shutter/ovl_Door_Shutter_reloc.o" +endseg + +beginseg + name "ovl_Door_Toki" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Toki/z_door_toki.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Toki/ovl_Door_Toki_reloc.o" +endseg + +beginseg + name "ovl_Door_Warp1" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Door_Warp1/ovl_Door_Warp1_reloc.o" +endseg + +beginseg + name "ovl_Efc_Erupc" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Efc_Erupc/ovl_Efc_Erupc_reloc.o" +endseg + +beginseg + name "ovl_Eff_Dust" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Eff_Dust/ovl_Eff_Dust_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Blast" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Blast/ovl_Effect_Ss_Blast_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Bomb" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bomb/ovl_Effect_Ss_Bomb_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Bomb2" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bomb2/ovl_Effect_Ss_Bomb2_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Bubble" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Bubble/ovl_Effect_Ss_Bubble_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_D_Fire" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_D_Fire/ovl_Effect_Ss_D_Fire_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Dead_Db" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Db/ovl_Effect_Ss_Dead_Db_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Dead_Dd" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/ovl_Effect_Ss_Dead_Dd_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Dead_Ds" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/ovl_Effect_Ss_Dead_Ds_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Dead_Sound" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/ovl_Effect_Ss_Dead_Sound_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Dt_Bubble" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/ovl_Effect_Ss_Dt_Bubble_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Dust" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Dust/ovl_Effect_Ss_Dust_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_En_Fire" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_En_Fire/ovl_Effect_Ss_En_Fire_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_En_Ice" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_En_Ice/ovl_Effect_Ss_En_Ice_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Extra" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Extra/ovl_Effect_Ss_Extra_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Fcircle" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fcircle/ovl_Effect_Ss_Fcircle_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Fhg_Flash" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/ovl_Effect_Ss_Fhg_Flash_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Fire_Tail" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/ovl_Effect_Ss_Fire_Tail_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_G_Fire" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Fire/ovl_Effect_Ss_G_Fire_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_G_Magma" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Magma/ovl_Effect_Ss_G_Magma_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_G_Magma2" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Magma2/ovl_Effect_Ss_G_Magma2_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_G_Ripple" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Ripple/ovl_Effect_Ss_G_Ripple_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_G_Spk" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Spk/ovl_Effect_Ss_G_Spk_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_G_Splash" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_G_Splash/ovl_Effect_Ss_G_Splash_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Hahen" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Hahen/ovl_Effect_Ss_Hahen_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_HitMark" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_HitMark/ovl_Effect_Ss_HitMark_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Ice_Piece" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/ovl_Effect_Ss_Ice_Piece_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Ice_Smoke" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/ovl_Effect_Ss_Ice_Smoke_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_K_Fire" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_K_Fire/ovl_Effect_Ss_K_Fire_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Kakera" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Kakera/ovl_Effect_Ss_Kakera_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_KiraKira" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_KiraKira/ovl_Effect_Ss_KiraKira_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Lightning" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Lightning/ovl_Effect_Ss_Lightning_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Sibuki" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Sibuki/ovl_Effect_Ss_Sibuki_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Sibuki2" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Sibuki2/ovl_Effect_Ss_Sibuki2_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Solder_Srch_Ball" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/ovl_Effect_Ss_Solder_Srch_Ball_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Stick" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Stick/ovl_Effect_Ss_Stick_reloc.o" +endseg + +beginseg + name "ovl_Effect_Ss_Stone1" + compress + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.o" + include "$(BUILD_DIR)/src/overlays/effects/ovl_Effect_Ss_Stone1/ovl_Effect_Ss_Stone1_reloc.o" +endseg + +beginseg + name "ovl_Elf_Msg" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Elf_Msg/ovl_Elf_Msg_reloc.o" +endseg + +beginseg + name "ovl_Elf_Msg2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Elf_Msg2/ovl_Elf_Msg2_reloc.o" +endseg + +beginseg + name "ovl_En_Am" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Am/z_en_am.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Am/ovl_En_Am_reloc.o" +endseg + +beginseg + name "ovl_En_Ani" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ani/z_en_ani.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ani/ovl_En_Ani_reloc.o" +endseg + +beginseg + name "ovl_En_Anubice" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Anubice/z_en_anubice.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Anubice/ovl_En_Anubice_reloc.o" +endseg + +beginseg + name "ovl_En_Anubice_Fire" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Anubice_Fire/ovl_En_Anubice_Fire_reloc.o" +endseg + +beginseg + name "ovl_En_Anubice_Tag" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Anubice_Tag/ovl_En_Anubice_Tag_reloc.o" +endseg + +beginseg + name "ovl_En_Arow_Trap" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Arow_Trap/ovl_En_Arow_Trap_reloc.o" +endseg + +beginseg + name "ovl_En_Arrow" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Arrow/z_en_arrow.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Arrow/ovl_En_Arrow_reloc.o" +endseg + +beginseg + name "ovl_En_Attack_Niw" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Attack_Niw/ovl_En_Attack_Niw_reloc.o" +endseg + +beginseg + name "ovl_En_Ba" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ba/z_en_ba.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ba/ovl_En_Ba_reloc.o" +endseg + +beginseg + name "ovl_En_Bb" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bb/z_en_bb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bb/ovl_En_Bb_reloc.o" +endseg + +beginseg + name "ovl_En_Bdfire" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bdfire/ovl_En_Bdfire_reloc.o" +endseg + +beginseg + name "ovl_En_Bigokuta" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bigokuta/ovl_En_Bigokuta_reloc.o" +endseg + +beginseg + name "ovl_En_Bili" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bili/z_en_bili.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bili/ovl_En_Bili_reloc.o" +endseg + +beginseg + name "ovl_En_Bird" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bird/z_en_bird.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bird/ovl_En_Bird_reloc.o" +endseg + +beginseg + name "ovl_En_Blkobj" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Blkobj/ovl_En_Blkobj_reloc.o" +endseg + +beginseg + name "ovl_En_Bom" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom/z_en_bom.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom/ovl_En_Bom_reloc.o" +endseg + +beginseg + name "ovl_En_Bom_Bowl_Man" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Bowl_Man/ovl_En_Bom_Bowl_Man_reloc.o" +endseg + +beginseg + name "ovl_En_Bom_Bowl_Pit" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Bowl_Pit/ovl_En_Bom_Bowl_Pit_reloc.o" +endseg + +beginseg + name "ovl_En_Bom_Chu" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bom_Chu/ovl_En_Bom_Chu_reloc.o" +endseg + +beginseg + name "ovl_En_Bombf" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bombf/z_en_bombf.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bombf/ovl_En_Bombf_reloc.o" +endseg + +beginseg + name "ovl_En_Boom" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Boom/z_en_boom.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Boom/ovl_En_Boom_reloc.o" +endseg + +beginseg + name "ovl_En_Box" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Box/z_en_box.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Box/ovl_En_Box_reloc.o" +endseg + +beginseg + name "ovl_En_Brob" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Brob/z_en_brob.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Brob/ovl_En_Brob_reloc.o" +endseg + +beginseg + name "ovl_En_Bubble" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bubble/z_en_bubble.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bubble/ovl_En_Bubble_reloc.o" +endseg + +beginseg + name "ovl_En_Butte" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Butte/z_en_butte.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Butte/ovl_En_Butte_reloc.o" +endseg + +beginseg + name "ovl_En_Bw" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bw/z_en_bw.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bw/ovl_En_Bw_reloc.o" +endseg + +beginseg + name "ovl_En_Bx" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bx/z_en_bx.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Bx/ovl_En_Bx_reloc.o" +endseg + +beginseg + name "ovl_En_Changer" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Changer/z_en_changer.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Changer/ovl_En_Changer_reloc.o" +endseg + +beginseg + name "ovl_En_Clear_Tag" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Clear_Tag/ovl_En_Clear_Tag_reloc.o" +endseg + +beginseg + name "ovl_En_Cow" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Cow/z_en_cow.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Cow/ovl_En_Cow_reloc.o" +endseg + +beginseg + name "ovl_En_Crow" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Crow/z_en_crow.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Crow/ovl_En_Crow_reloc.o" +endseg + +beginseg + name "ovl_En_Cs" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Cs/z_en_cs.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Cs/ovl_En_Cs_reloc.o" +endseg + +beginseg + name "ovl_En_Daiku" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Daiku/z_en_daiku.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Daiku/ovl_En_Daiku_reloc.o" +endseg + +beginseg + name "ovl_En_Daiku_Kakariko" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Daiku_Kakariko/ovl_En_Daiku_Kakariko_reloc.o" +endseg + +beginseg + name "ovl_En_Dekubaba" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dekubaba/ovl_En_Dekubaba_reloc.o" +endseg + +beginseg + name "ovl_En_Dekunuts" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dekunuts/ovl_En_Dekunuts_reloc.o" +endseg + +beginseg + name "ovl_En_Dh" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dh/z_en_dh.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dh/ovl_En_Dh_reloc.o" +endseg + +beginseg + name "ovl_En_Dha" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dha/z_en_dha.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dha/ovl_En_Dha_reloc.o" +endseg + +beginseg + name "ovl_En_Diving_Game" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Diving_Game/ovl_En_Diving_Game_reloc.o" +endseg + +beginseg + name "ovl_En_Dns" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dns/z_en_dns.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dns/ovl_En_Dns_reloc.o" +endseg + +beginseg + name "ovl_En_Dnt_Demo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Demo/ovl_En_Dnt_Demo_reloc.o" +endseg + +beginseg + name "ovl_En_Dnt_Jiji" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Jiji/ovl_En_Dnt_Jiji_reloc.o" +endseg + +beginseg + name "ovl_En_Dnt_Nomal" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dnt_Nomal/ovl_En_Dnt_Nomal_reloc.o" +endseg + +beginseg + name "ovl_En_Dodojr" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dodojr/ovl_En_Dodojr_reloc.o" +endseg + +beginseg + name "ovl_En_Dodongo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dodongo/ovl_En_Dodongo_reloc.o" +endseg + +beginseg + name "ovl_En_Dog" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dog/z_en_dog.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dog/ovl_En_Dog_reloc.o" +endseg + +beginseg + name "ovl_En_Door" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Door/z_en_door.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Door/ovl_En_Door_reloc.o" +endseg + +beginseg + name "ovl_En_Ds" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ds/z_en_ds.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ds/ovl_En_Ds_reloc.o" +endseg + +beginseg + name "ovl_En_Du" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Du/z_en_du.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Du/ovl_En_Du_reloc.o" +endseg + +beginseg + name "ovl_En_Dy_Extra" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Dy_Extra/ovl_En_Dy_Extra_reloc.o" +endseg + +beginseg + name "ovl_En_Eg" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Eg/z_en_eg.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Eg/ovl_En_Eg_reloc.o" +endseg + +beginseg + name "ovl_En_Eiyer" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Eiyer/ovl_En_Eiyer_reloc.o" +endseg + +beginseg + name "ovl_En_Elf" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Elf/z_en_elf.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Elf/ovl_En_Elf_reloc.o" +endseg + +beginseg + name "ovl_En_Encount1" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Encount1/z_en_encount1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Encount1/ovl_En_Encount1_reloc.o" +endseg + +beginseg + name "ovl_En_Encount2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Encount2/z_en_encount2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Encount2/ovl_En_Encount2_reloc.o" +endseg + +beginseg + name "ovl_En_Ex_Item" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ex_Item/ovl_En_Ex_Item_reloc.o" +endseg + +beginseg + name "ovl_En_Ex_Ruppy" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ex_Ruppy/ovl_En_Ex_Ruppy_reloc.o" +endseg + +beginseg + name "ovl_En_Fd" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fd/z_en_fd.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fd/ovl_En_Fd_reloc.o" +endseg + +beginseg + name "ovl_En_Fd_Fire" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fd_Fire/ovl_En_Fd_Fire_reloc.o" +endseg + +beginseg + name "ovl_En_Fhg_Fire" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fhg_Fire/ovl_En_Fhg_Fire_reloc.o" +endseg + +beginseg + name "ovl_En_Fire_Rock" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fire_Rock/ovl_En_Fire_Rock_reloc.o" +endseg + +beginseg + name "ovl_En_Firefly" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Firefly/z_en_firefly.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Firefly/ovl_En_Firefly_reloc.o" +endseg + +beginseg + name "ovl_En_Fish" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fish/z_en_fish.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fish/ovl_En_Fish_reloc.o" +endseg + +beginseg + name "ovl_En_Floormas" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Floormas/z_en_floormas.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Floormas/ovl_En_Floormas_reloc.o" +endseg + +beginseg + name "ovl_En_Fr" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fr/z_en_fr.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fr/ovl_En_Fr_reloc.o" +endseg + +beginseg + name "ovl_En_Fu" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fu/z_en_fu.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fu/ovl_En_Fu_reloc.o" +endseg + +beginseg + name "ovl_En_Fw" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fw/z_en_fw.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fw/ovl_En_Fw_reloc.o" +endseg + +beginseg + name "ovl_En_Fz" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fz/z_en_fz.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Fz/ovl_En_Fz_reloc.o" +endseg + +beginseg + name "ovl_En_G_Switch" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_G_Switch/ovl_En_G_Switch_reloc.o" +endseg + +beginseg + name "ovl_En_Ganon_Mant" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ganon_Mant/ovl_En_Ganon_Mant_reloc.o" +endseg + +beginseg + name "ovl_En_Ganon_Organ" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ganon_Organ/ovl_En_Ganon_Organ_reloc.o" +endseg + +beginseg + name "ovl_En_Gb" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gb/z_en_gb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gb/ovl_En_Gb_reloc.o" +endseg + +beginseg + name "ovl_En_Ge1" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge1/z_en_ge1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge1/ovl_En_Ge1_reloc.o" +endseg + +beginseg + name "ovl_En_Ge2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge2/z_en_ge2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge2/ovl_En_Ge2_reloc.o" +endseg + +beginseg + name "ovl_En_Ge3" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge3/z_en_ge3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ge3/ovl_En_Ge3_reloc.o" +endseg + +beginseg + name "ovl_En_GeldB" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_GeldB/z_en_geldb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_GeldB/ovl_En_GeldB_reloc.o" +endseg + +beginseg + name "ovl_En_GirlA" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_GirlA/z_en_girla.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_GirlA/ovl_En_GirlA_reloc.o" +endseg + +beginseg + name "ovl_En_Gm" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gm/z_en_gm.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gm/ovl_En_Gm_reloc.o" +endseg + +beginseg + name "ovl_En_Go" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Go/z_en_go.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Go/ovl_En_Go_reloc.o" +endseg + +beginseg + name "ovl_En_Go2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Go2/z_en_go2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Go2/ovl_En_Go2_reloc.o" +endseg + +beginseg + name "ovl_En_Goma" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Goma/z_en_goma.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Goma/ovl_En_Goma_reloc.o" +endseg + +beginseg + name "ovl_En_Goroiwa" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Goroiwa/ovl_En_Goroiwa_reloc.o" +endseg + +beginseg + name "ovl_En_Gs" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gs/z_en_gs.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Gs/ovl_En_Gs_reloc.o" +endseg + +beginseg + name "ovl_En_Guest" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Guest/z_en_guest.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Guest/ovl_En_Guest_reloc.o" +endseg + +beginseg + name "ovl_En_Hata" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hata/z_en_hata.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hata/ovl_En_Hata_reloc.o" +endseg + +beginseg + name "ovl_En_Heishi1" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi1/ovl_En_Heishi1_reloc.o" +endseg + +beginseg + name "ovl_En_Heishi2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi2/ovl_En_Heishi2_reloc.o" +endseg + +beginseg + name "ovl_En_Heishi3" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi3/ovl_En_Heishi3_reloc.o" +endseg + +beginseg + name "ovl_En_Heishi4" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Heishi4/ovl_En_Heishi4_reloc.o" +endseg + +beginseg + name "ovl_En_Hintnuts" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hintnuts/ovl_En_Hintnuts_reloc.o" +endseg + +beginseg + name "ovl_En_Holl" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Holl/z_en_holl.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Holl/ovl_En_Holl_reloc.o" +endseg + +beginseg + name "ovl_En_Honotrap" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Honotrap/ovl_En_Honotrap_reloc.o" +endseg + +beginseg + name "ovl_En_Horse" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse/z_en_horse.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse/ovl_En_Horse_reloc.o" +endseg + +beginseg + name "ovl_En_Horse_Game_Check" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Game_Check/ovl_En_Horse_Game_Check_reloc.o" +endseg + +beginseg + name "ovl_En_Horse_Ganon" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Ganon/ovl_En_Horse_Ganon_reloc.o" +endseg + +beginseg + name "ovl_En_Horse_Link_Child" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Link_Child/ovl_En_Horse_Link_Child_reloc.o" +endseg + +beginseg + name "ovl_En_Horse_Normal" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Normal/ovl_En_Horse_Normal_reloc.o" +endseg + +beginseg + name "ovl_En_Horse_Zelda" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Horse_Zelda/ovl_En_Horse_Zelda_reloc.o" +endseg + +beginseg + name "ovl_En_Hs" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hs/z_en_hs.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hs/ovl_En_Hs_reloc.o" +endseg + +beginseg + name "ovl_En_Hs2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hs2/z_en_hs2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hs2/ovl_En_Hs2_reloc.o" +endseg + +beginseg + name "ovl_En_Hy" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hy/z_en_hy.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Hy/ovl_En_Hy_reloc.o" +endseg + +beginseg + name "ovl_En_Ice_Hono" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ice_Hono/ovl_En_Ice_Hono_reloc.o" +endseg + +beginseg + name "ovl_En_Ik" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ik/z_en_ik.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ik/ovl_En_Ik_reloc.o" +endseg + +beginseg + name "ovl_En_In" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_In/z_en_in.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_In/ovl_En_In_reloc.o" +endseg + +beginseg + name "ovl_En_Insect" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Insect/z_en_insect.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Insect/ovl_En_Insect_reloc.o" +endseg + +beginseg + name "ovl_En_Ishi" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ishi/z_en_ishi.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ishi/ovl_En_Ishi_reloc.o" +endseg + +beginseg + name "ovl_En_It" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_It/z_en_it.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_It/ovl_En_It_reloc.o" +endseg + +beginseg + name "ovl_En_Jj" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/ovl_En_Jj_reloc.o" +endseg + +beginseg + name "ovl_En_Js" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Js/z_en_js.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Js/ovl_En_Js_reloc.o" +endseg + +beginseg + name "ovl_En_Jsjutan" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jsjutan/ovl_En_Jsjutan_reloc.o" +endseg + +beginseg + name "ovl_En_Kakasi" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi/ovl_En_Kakasi_reloc.o" +endseg + +beginseg + name "ovl_En_Kakasi2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi2/ovl_En_Kakasi2_reloc.o" +endseg + +beginseg + name "ovl_En_Kakasi3" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kakasi3/ovl_En_Kakasi3_reloc.o" +endseg + +beginseg + name "ovl_En_Kanban" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kanban/z_en_kanban.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kanban/ovl_En_Kanban_reloc.o" +endseg + +beginseg + name "ovl_En_Karebaba" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Karebaba/ovl_En_Karebaba_reloc.o" +endseg + +beginseg + name "ovl_En_Ko" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ko/z_en_ko.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ko/ovl_En_Ko_reloc.o" +endseg + +beginseg + name "ovl_En_Kusa" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kusa/z_en_kusa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kusa/ovl_En_Kusa_reloc.o" +endseg + +beginseg + name "ovl_En_Kz" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kz/z_en_kz.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Kz/ovl_En_Kz_reloc.o" +endseg + +beginseg + name "ovl_En_Light" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Light/z_en_light.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Light/ovl_En_Light_reloc.o" +endseg + +beginseg + name "ovl_En_Lightbox" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Lightbox/ovl_En_Lightbox_reloc.o" +endseg + +beginseg + name "ovl_En_M_Fire1" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_M_Fire1/ovl_En_M_Fire1_reloc.o" +endseg + +beginseg + name "ovl_En_M_Thunder" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_M_Thunder/ovl_En_M_Thunder_reloc.o" +endseg + +beginseg + name "ovl_En_Ma1" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma1/z_en_ma1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma1/ovl_En_Ma1_reloc.o" +endseg + +beginseg + name "ovl_En_Ma2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma2/z_en_ma2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma2/ovl_En_Ma2_reloc.o" +endseg + +beginseg + name "ovl_En_Ma3" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma3/z_en_ma3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ma3/ovl_En_Ma3_reloc.o" endseg beginseg name "ovl_En_Mag" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mag/z_en_mag.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mag/ovl_En_Mag_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mag/z_en_mag.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mag/ovl_En_Mag_reloc.o" +endseg + +beginseg + name "ovl_En_Mb" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mb/z_en_mb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mb/ovl_En_Mb_reloc.o" +endseg + +beginseg + name "ovl_En_Md" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Md/z_en_md.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Md/ovl_En_Md_reloc.o" +endseg + +beginseg + name "ovl_En_Mk" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mk/z_en_mk.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mk/ovl_En_Mk_reloc.o" +endseg + +beginseg + name "ovl_En_Mm" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mm/z_en_mm.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mm/ovl_En_Mm_reloc.o" +endseg + +beginseg + name "ovl_En_Mm2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mm2/z_en_mm2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mm2/ovl_En_Mm2_reloc.o" +endseg + +beginseg + name "ovl_En_Ms" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ms/z_en_ms.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ms/ovl_En_Ms_reloc.o" +endseg + +beginseg + name "ovl_En_Mu" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mu/z_en_mu.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mu/ovl_En_Mu_reloc.o" +endseg + +beginseg + name "ovl_En_Nb" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nb/z_en_nb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nb/ovl_En_Nb_reloc.o" +endseg + +beginseg + name "ovl_En_Niw" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw/z_en_niw.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw/ovl_En_Niw_reloc.o" +endseg + +beginseg + name "ovl_En_Niw_Girl" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw_Girl/ovl_En_Niw_Girl_reloc.o" +endseg + +beginseg + name "ovl_En_Niw_Lady" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw_Lady/ovl_En_Niw_Lady_reloc.o" +endseg + +beginseg + name "ovl_En_Nutsball" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nutsball/ovl_En_Nutsball_reloc.o" +endseg + +beginseg + name "ovl_En_Nwc" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nwc/z_en_nwc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nwc/ovl_En_Nwc_reloc.o" +endseg + +beginseg + name "ovl_En_Ny" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ny/z_en_ny.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ny/ovl_En_Ny_reloc.o" +endseg + +beginseg + name "ovl_En_OE2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_OE2/z_en_oe2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_OE2/ovl_En_OE2_reloc.o" +endseg + +beginseg + name "ovl_En_Okarina_Effect" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Effect/ovl_En_Okarina_Effect_reloc.o" +endseg + +beginseg + name "ovl_En_Okarina_Tag" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag_cutscene_data.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Tag/ovl_En_Okarina_Tag_reloc.o" +endseg + +beginseg + name "ovl_En_Okuta" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okuta/z_en_okuta.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okuta/ovl_En_Okuta_reloc.o" +endseg + +beginseg + name "ovl_En_Ossan" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ossan/z_en_ossan.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ossan/ovl_En_Ossan_reloc.o" +endseg + +beginseg + name "ovl_En_Owl" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Owl/z_en_owl.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Owl/ovl_En_Owl_reloc.o" +endseg + +beginseg + name "ovl_En_Part" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Part/z_en_part.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Part/ovl_En_Part_reloc.o" +endseg + +beginseg + name "ovl_En_Peehat" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Peehat/z_en_peehat.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Peehat/ovl_En_Peehat_reloc.o" +endseg + +beginseg + name "ovl_En_Po_Desert" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Desert/ovl_En_Po_Desert_reloc.o" +endseg + +beginseg + name "ovl_En_Po_Field" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Field/ovl_En_Po_Field_reloc.o" +endseg + +beginseg + name "ovl_En_Po_Relay" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Relay/ovl_En_Po_Relay_reloc.o" +endseg + +beginseg + name "ovl_En_Po_Sisters" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Sisters/ovl_En_Po_Sisters_reloc.o" +endseg + +beginseg + name "ovl_En_Poh" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Poh/z_en_poh.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Poh/ovl_En_Poh_reloc.o" +endseg + +beginseg + name "ovl_En_Pu_box" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Pu_box/ovl_En_Pu_box_reloc.o" +endseg + +beginseg + name "ovl_En_Rd" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rd/z_en_rd.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rd/ovl_En_Rd_reloc.o" +endseg + +beginseg + name "ovl_En_Reeba" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Reeba/z_en_reeba.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Reeba/ovl_En_Reeba_reloc.o" +endseg + +beginseg + name "ovl_En_River_Sound" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_River_Sound/ovl_En_River_Sound_reloc.o" +endseg + +beginseg + name "ovl_En_Rl" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rl/z_en_rl.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rl/ovl_En_Rl_reloc.o" +endseg + +beginseg + name "ovl_En_Rr" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rr/z_en_rr.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rr/ovl_En_Rr_reloc.o" +endseg + +beginseg + name "ovl_En_Ru1" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ru1/z_en_ru1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ru1/ovl_En_Ru1_reloc.o" +endseg + +beginseg + name "ovl_En_Ru2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ru2/z_en_ru2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ru2/ovl_En_Ru2_reloc.o" +endseg + +beginseg + name "ovl_En_Sa" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sa/z_en_sa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sa/ovl_En_Sa_reloc.o" +endseg + +beginseg + name "ovl_En_Sb" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sb/z_en_sb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sb/ovl_En_Sb_reloc.o" +endseg + +beginseg + name "ovl_En_Scene_Change" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Scene_Change/ovl_En_Scene_Change_reloc.o" +endseg + +beginseg + name "ovl_En_Sda" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sda/z_en_sda.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sda/ovl_En_Sda_reloc.o" +endseg + +beginseg + name "ovl_En_Shopnuts" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Shopnuts/ovl_En_Shopnuts_reloc.o" +endseg + +beginseg + name "ovl_En_Si" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Si/z_en_si.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Si/ovl_En_Si_reloc.o" +endseg + +beginseg + name "ovl_En_Siofuki" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Siofuki/ovl_En_Siofuki_reloc.o" +endseg + +beginseg + name "ovl_En_Skb" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skb/z_en_skb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skb/ovl_En_Skb_reloc.o" +endseg + +beginseg + name "ovl_En_Skj" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skj/z_en_skj.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skj/ovl_En_Skj_reloc.o" +endseg + +beginseg + name "ovl_En_Skjneedle" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skjneedle/ovl_En_Skjneedle_reloc.o" +endseg + +beginseg + name "ovl_En_Ssh" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ssh/z_en_ssh.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ssh/ovl_En_Ssh_reloc.o" +endseg + +beginseg + name "ovl_En_St" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_St/z_en_st.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_St/ovl_En_St_reloc.o" +endseg + +beginseg + name "ovl_En_Sth" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sth/z_en_sth.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sth/ovl_En_Sth_reloc.o" +endseg + +beginseg + name "ovl_En_Stream" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Stream/z_en_stream.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Stream/ovl_En_Stream_reloc.o" +endseg + +beginseg + name "ovl_En_Sw" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sw/z_en_sw.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sw/ovl_En_Sw_reloc.o" +endseg + +beginseg + name "ovl_En_Syateki_Itm" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Itm/ovl_En_Syateki_Itm_reloc.o" +endseg + +beginseg + name "ovl_En_Syateki_Man" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Man/ovl_En_Syateki_Man_reloc.o" +endseg + +beginseg + name "ovl_En_Syateki_Niw" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Niw/ovl_En_Syateki_Niw_reloc.o" +endseg + +beginseg + name "ovl_En_Ta" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ta/z_en_ta.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ta/ovl_En_Ta_reloc.o" +endseg + +beginseg + name "ovl_En_Takara_Man" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Takara_Man/ovl_En_Takara_Man_reloc.o" +endseg + +beginseg + name "ovl_En_Tana" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tana/z_en_tana.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tana/ovl_En_Tana_reloc.o" +endseg + +beginseg + name "ovl_En_Tg" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tg/z_en_tg.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tg/ovl_En_Tg_reloc.o" +endseg + +beginseg + name "ovl_En_Tite" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tite/z_en_tite.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tite/ovl_En_Tite_reloc.o" +endseg + +beginseg + name "ovl_En_Tk" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tk/z_en_tk.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tk/ovl_En_Tk_reloc.o" +endseg + +beginseg + name "ovl_En_Torch" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Torch/z_en_torch.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Torch/ovl_En_Torch_reloc.o" +endseg + +beginseg + name "ovl_En_Torch2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Torch2/z_en_torch2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Torch2/ovl_En_Torch2_reloc.o" +endseg + +beginseg + name "ovl_En_Toryo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Toryo/z_en_toryo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Toryo/ovl_En_Toryo_reloc.o" +endseg + +beginseg + name "ovl_En_Tp" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tp/z_en_tp.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tp/ovl_En_Tp_reloc.o" +endseg + +beginseg + name "ovl_En_Tr" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tr/z_en_tr.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tr/ovl_En_Tr_reloc.o" +endseg + +beginseg + name "ovl_En_Trap" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Trap/z_en_trap.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Trap/ovl_En_Trap_reloc.o" +endseg + +beginseg + name "ovl_En_Tubo_Trap" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tubo_Trap/ovl_En_Tubo_Trap_reloc.o" +endseg + +beginseg + name "ovl_En_Vali" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vali/z_en_vali.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vali/ovl_En_Vali_reloc.o" +endseg + +beginseg + name "ovl_En_Vase" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vase/z_en_vase.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vase/ovl_En_Vase_reloc.o" +endseg + +beginseg + name "ovl_En_Vb_Ball" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vb_Ball/ovl_En_Vb_Ball_reloc.o" +endseg + +beginseg + name "ovl_En_Viewer" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Viewer/z_en_viewer.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Viewer/ovl_En_Viewer_reloc.o" +endseg + +beginseg + name "ovl_En_Vm" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vm/z_en_vm.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vm/ovl_En_Vm_reloc.o" +endseg + +beginseg + name "ovl_En_Wall_Tubo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wall_Tubo/ovl_En_Wall_Tubo_reloc.o" +endseg + +beginseg + name "ovl_En_Wallmas" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wallmas/ovl_En_Wallmas_reloc.o" +endseg + +beginseg + name "ovl_En_Weather_Tag" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Weather_Tag/ovl_En_Weather_Tag_reloc.o" +endseg + +beginseg + name "ovl_En_Weiyer" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Weiyer/ovl_En_Weiyer_reloc.o" +endseg + +beginseg + name "ovl_En_Wf" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wf/z_en_wf.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wf/ovl_En_Wf_reloc.o" +endseg + +beginseg + name "ovl_En_Wonder_Item" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Item/ovl_En_Wonder_Item_reloc.o" +endseg + +beginseg + name "ovl_En_Wonder_Talk" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Talk/ovl_En_Wonder_Talk_reloc.o" +endseg + +beginseg + name "ovl_En_Wonder_Talk2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Talk2/ovl_En_Wonder_Talk2_reloc.o" +endseg + +beginseg + name "ovl_En_Wood02" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wood02/z_en_wood02.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wood02/ovl_En_Wood02_reloc.o" +endseg + +beginseg + name "ovl_En_Xc" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Xc/z_en_xc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Xc/ovl_En_Xc_reloc.o" +endseg + +beginseg + name "ovl_En_Yabusame_Mark" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Yabusame_Mark/ovl_En_Yabusame_Mark_reloc.o" +endseg + +beginseg + name "ovl_En_Yukabyun" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Yukabyun/ovl_En_Yukabyun_reloc.o" +endseg + +beginseg + name "ovl_En_Zf" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zf/z_en_zf.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zf/ovl_En_Zf_reloc.o" +endseg + +beginseg + name "ovl_En_Zl1" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl1/z_en_zl1.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl1/ovl_En_Zl1_reloc.o" +endseg + +beginseg + name "ovl_En_Zl2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl2/z_en_zl2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl2/ovl_En_Zl2_reloc.o" +endseg + +beginseg + name "ovl_En_Zl3" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl3/z_en_zl3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl3/ovl_En_Zl3_reloc.o" +endseg + +beginseg + name "ovl_En_Zl4" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl4/z_en_zl4.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl4/ovl_En_Zl4_reloc.o" +endseg + +beginseg + name "ovl_En_Zo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zo/z_en_zo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zo/ovl_En_Zo_reloc.o" +endseg + +beginseg + name "ovl_En_fHG" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_fHG/z_en_fhg.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_fHG/ovl_En_fHG_reloc.o" +endseg + +beginseg + name "ovl_End_Title" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_End_Title/z_end_title.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_End_Title/ovl_End_Title_reloc.o" +endseg + +beginseg + name "ovl_Fishing" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Fishing/z_fishing.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Fishing/ovl_Fishing_reloc.o" +endseg + +beginseg + name "ovl_Item_B_Heart" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_B_Heart/ovl_Item_B_Heart_reloc.o" +endseg + +beginseg + name "ovl_Item_Etcetera" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Etcetera/ovl_Item_Etcetera_reloc.o" +endseg + +beginseg + name "ovl_Item_Inbox" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Inbox/ovl_Item_Inbox_reloc.o" +endseg + +beginseg + name "ovl_Item_Ocarina" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Ocarina/ovl_Item_Ocarina_reloc.o" +endseg + +beginseg + name "ovl_Item_Shield" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Shield/z_item_shield.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Shield/ovl_Item_Shield_reloc.o" +endseg + +beginseg + name "ovl_Magic_Dark" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Dark/ovl_Magic_Dark_reloc.o" +endseg + +beginseg + name "ovl_Magic_Fire" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Fire/ovl_Magic_Fire_reloc.o" +endseg + +beginseg + name "ovl_Magic_Wind" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Wind/ovl_Magic_Wind_reloc.o" +endseg + +beginseg + name "ovl_Mir_Ray" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Mir_Ray/ovl_Mir_Ray_reloc.o" +endseg + +beginseg + name "ovl_Obj_Bean" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Bean/ovl_Obj_Bean_reloc.o" +endseg + +beginseg + name "ovl_Obj_Blockstop" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Blockstop/ovl_Obj_Blockstop_reloc.o" +endseg + +beginseg + name "ovl_Obj_Bombiwa" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Bombiwa/ovl_Obj_Bombiwa_reloc.o" +endseg + +beginseg + name "ovl_Obj_Comb" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Comb/ovl_Obj_Comb_reloc.o" +endseg + +beginseg + name "ovl_Obj_Dekujr" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Dekujr/ovl_Obj_Dekujr_reloc.o" +endseg + +beginseg + name "ovl_Obj_Elevator" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Elevator/ovl_Obj_Elevator_reloc.o" +endseg + +beginseg + name "ovl_Obj_Hamishi" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hamishi/ovl_Obj_Hamishi_reloc.o" +endseg + +beginseg + name "ovl_Obj_Hana" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hana/ovl_Obj_Hana_reloc.o" +endseg + +beginseg + name "ovl_Obj_Hsblock" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hsblock/ovl_Obj_Hsblock_reloc.o" +endseg + +beginseg + name "ovl_Obj_Ice_Poly" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Ice_Poly/ovl_Obj_Ice_Poly_reloc.o" +endseg + +beginseg + name "ovl_Obj_Kibako" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Kibako/ovl_Obj_Kibako_reloc.o" +endseg + +beginseg + name "ovl_Obj_Kibako2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Kibako2/ovl_Obj_Kibako2_reloc.o" +endseg + +beginseg + name "ovl_Obj_Lift" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Lift/ovl_Obj_Lift_reloc.o" +endseg + +beginseg + name "ovl_Obj_Lightswitch" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Lightswitch/ovl_Obj_Lightswitch_reloc.o" +endseg + +beginseg + name "ovl_Obj_Makekinsuta" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Makekinsuta/ovl_Obj_Makekinsuta_reloc.o" +endseg + +beginseg + name "ovl_Obj_Makeoshihiki" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Makeoshihiki/ovl_Obj_Makeoshihiki_reloc.o" +endseg + +beginseg + name "ovl_Obj_Mure" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure/ovl_Obj_Mure_reloc.o" +endseg + +beginseg + name "ovl_Obj_Mure2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure2/ovl_Obj_Mure2_reloc.o" +endseg + +beginseg + name "ovl_Obj_Mure3" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure3/ovl_Obj_Mure3_reloc.o" +endseg + +beginseg + name "ovl_Obj_Oshihiki" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Oshihiki/ovl_Obj_Oshihiki_reloc.o" +endseg + +beginseg + name "ovl_Obj_Roomtimer" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Roomtimer/ovl_Obj_Roomtimer_reloc.o" +endseg + +beginseg + name "ovl_Obj_Switch" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Switch/ovl_Obj_Switch_reloc.o" +endseg + +beginseg + name "ovl_Obj_Syokudai" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Syokudai/ovl_Obj_Syokudai_reloc.o" +endseg + +beginseg + name "ovl_Obj_Timeblock" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Timeblock/ovl_Obj_Timeblock_reloc.o" +endseg + +beginseg + name "ovl_Obj_Tsubo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Tsubo/ovl_Obj_Tsubo_reloc.o" +endseg + +beginseg + name "ovl_Obj_Warp2block" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Warp2block/ovl_Obj_Warp2block_reloc.o" +endseg + +beginseg + name "ovl_Object_Kankyo" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Object_Kankyo/ovl_Object_Kankyo_reloc.o" +endseg + +beginseg + name "ovl_Oceff_Spot" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Spot/ovl_Oceff_Spot_reloc.o" +endseg + +beginseg + name "ovl_Oceff_Storm" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Storm/ovl_Oceff_Storm_reloc.o" +endseg + +beginseg + name "ovl_Oceff_Wipe" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe/ovl_Oceff_Wipe_reloc.o" +endseg + +beginseg + name "ovl_Oceff_Wipe2" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe2/ovl_Oceff_Wipe2_reloc.o" +endseg + +beginseg + name "ovl_Oceff_Wipe3" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe3/ovl_Oceff_Wipe3_reloc.o" +endseg + +beginseg + name "ovl_Oceff_Wipe4" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe4/ovl_Oceff_Wipe4_reloc.o" +endseg + +beginseg + name "ovl_Shot_Sun" + compress + include "$(BUILD_DIR)/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_Shot_Sun/ovl_Shot_Sun_reloc.o" +endseg + +#endif + +beginseg + name "gameplay_keep" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/gameplay_keep/gameplay_keep.o" + number 4 +endseg + +beginseg + name "gameplay_field_keep" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/gameplay_field_keep/gameplay_field_keep.o" + number 5 +endseg + +beginseg + name "gameplay_dangeon_keep" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.o" + number 5 +endseg + +beginseg + name "gameplay_object_exchange_static" + compress + romalign 0x1000 + include "$(BUILD_DIR)/baserom/gameplay_object_exchange_static.o" +endseg + +beginseg + name "object_link_boy" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_link_boy/object_link_boy.o" + number 6 +endseg + +beginseg + name "object_link_child" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_link_child/object_link_child.o" + number 6 +endseg + +beginseg + name "object_box" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_box/object_box.o" + number 6 +endseg + +beginseg + name "object_human" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_human/object_human.o" + number 6 +endseg + +beginseg + name "object_okuta" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_okuta/object_okuta.o" + number 6 +endseg + +beginseg + name "object_poh" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_poh/object_poh.o" + number 6 +endseg + +beginseg + name "object_wallmaster" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_wallmaster/object_wallmaster.o" + number 6 +endseg + +beginseg + name "object_dy_obj" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_dy_obj/object_dy_obj.o" + number 6 +endseg + +beginseg + name "object_firefly" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_firefly/object_firefly.o" + number 6 +endseg + +beginseg + name "object_dodongo" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_dodongo/object_dodongo.o" + number 6 +endseg + +beginseg + name "object_fire" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_fire/object_fire.o" + number 6 +endseg + +beginseg + name "object_niw" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_niw/object_niw.o" + number 6 +endseg + +beginseg + name "object_tite" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_tite/object_tite.o" + number 6 +endseg + +beginseg + name "object_reeba" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_reeba/object_reeba.o" + number 6 +endseg + +beginseg + name "object_peehat" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_peehat/object_peehat.o" + number 6 +endseg + +beginseg + name "object_kingdodongo" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_kingdodongo/object_kingdodongo.o" + number 6 +endseg + +beginseg + name "object_horse" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_horse/object_horse.o" + number 6 +endseg + +beginseg + name "object_zf" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_zf/object_zf.o" + number 6 +endseg + +beginseg + name "object_goma" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_goma/object_goma.o" + number 6 +endseg + +beginseg + name "object_zl1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_zl1/object_zl1.o" + number 6 +endseg + +beginseg + name "object_gol" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gol/object_gol.o" + number 6 +endseg + +beginseg + name "object_bubble" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bubble/object_bubble.o" + number 6 +endseg + +beginseg + name "object_dodojr" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_dodojr/object_dodojr.o" + number 6 +endseg + +beginseg + name "object_torch2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_torch2/object_torch2.o" + number 6 +endseg + +beginseg + name "object_bl" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bl/object_bl.o" + number 6 +endseg + +beginseg + name "object_tp" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_tp/object_tp.o" + number 6 +endseg + +beginseg + name "object_oA1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oA1/object_oA1.o" + number 6 +endseg + +beginseg + name "object_st" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_st/object_st.o" + number 6 +endseg + +beginseg + name "object_bw" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bw/object_bw.o" + number 6 +endseg + +beginseg + name "object_ei" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ei/object_ei.o" + number 6 +endseg + +beginseg + name "object_horse_normal" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_horse_normal/object_horse_normal.o" + number 6 +endseg + +beginseg + name "object_oB1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oB1/object_oB1.o" + number 6 +endseg + +beginseg + name "object_o_anime" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_o_anime/object_o_anime.o" + number 6 +endseg + +beginseg + name "object_spot04_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot04_objects/object_spot04_objects.o" + number 6 +endseg + +beginseg + name "object_ddan_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ddan_objects/object_ddan_objects.o" + number 6 +endseg + +beginseg + name "object_hidan_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_hidan_objects/object_hidan_objects.o" + number 6 +endseg + +beginseg + name "object_horse_ganon" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_horse_ganon/object_horse_ganon.o" + number 6 +endseg + +beginseg + name "object_oA2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oA2/object_oA2.o" + number 6 +endseg + +beginseg + name "object_spot00_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot00_objects/object_spot00_objects.o" + number 6 +endseg + +beginseg + name "object_mb" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mb/object_mb.o" + number 6 +endseg + +beginseg + name "object_bombf" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bombf/object_bombf.o" + number 6 +endseg + +beginseg + name "object_sk2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_sk2/object_sk2.o" + number 6 +endseg + +beginseg + name "object_oE1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE1/object_oE1.o" + number 6 +endseg + +beginseg + name "object_oE_anime" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE_anime/object_oE_anime.o" + number 6 +endseg + +beginseg + name "object_oE2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE2/object_oE2.o" + number 6 +endseg + +beginseg + name "object_ydan_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ydan_objects/object_ydan_objects.o" + number 6 +endseg + +beginseg + name "object_gnd" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gnd/object_gnd.o" + number 6 +endseg + +beginseg + name "object_am" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_am/object_am.o" + number 6 +endseg + +beginseg + name "object_dekubaba" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_dekubaba/object_dekubaba.o" + number 6 +endseg + +beginseg + name "object_oA3" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oA3/object_oA3.o" + number 6 +endseg + +beginseg + name "object_oA4" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oA4/object_oA4.o" + number 6 +endseg + +beginseg + name "object_oA5" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oA5/object_oA5.o" + number 6 +endseg + +beginseg + name "object_oA6" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oA6/object_oA6.o" + number 6 +endseg + +beginseg + name "object_oA7" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oA7/object_oA7.o" + number 6 +endseg + +beginseg + name "object_jj" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_jj/object_jj.o" + number 6 +endseg + +beginseg + name "object_oA8" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oA8/object_oA8.o" + number 6 +endseg + +beginseg + name "object_oA9" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oA9/object_oA9.o" + number 6 +endseg + +beginseg + name "object_oB2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oB2/object_oB2.o" + number 6 +endseg + +beginseg + name "object_oB3" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oB3/object_oB3.o" + number 6 +endseg + +beginseg + name "object_oB4" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oB4/object_oB4.o" + number 6 +endseg + +beginseg + name "object_horse_zelda" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_horse_zelda/object_horse_zelda.o" + number 6 +endseg + +beginseg + name "object_opening_demo1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_opening_demo1/object_opening_demo1.o" + number 6 +endseg + +beginseg + name "object_warp1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_warp1/object_warp1.o" + number 6 +endseg + +beginseg + name "object_b_heart" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_b_heart/object_b_heart.o" + number 6 +endseg + +beginseg + name "object_dekunuts" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_dekunuts/object_dekunuts.o" + number 6 +endseg + +beginseg + name "object_oE3" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE3/object_oE3.o" + number 6 +endseg + +beginseg + name "object_oE4" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE4/object_oE4.o" + number 6 +endseg + +beginseg + name "object_menkuri_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_menkuri_objects/object_menkuri_objects.o" + number 6 +endseg + +beginseg + name "object_oE5" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE5/object_oE5.o" + number 6 +endseg + +beginseg + name "object_oE6" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE6/object_oE6.o" + number 6 +endseg + +beginseg + name "object_oE7" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE7/object_oE7.o" + number 6 +endseg + +beginseg + name "object_oE8" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE8/object_oE8.o" + number 6 +endseg + +beginseg + name "object_oE9" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE9/object_oE9.o" + number 6 +endseg + +beginseg + name "object_oE10" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE10/object_oE10.o" + number 6 +endseg + +beginseg + name "object_oE11" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE11/object_oE11.o" + number 6 +endseg + +beginseg + name "object_oE12" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE12/object_oE12.o" + number 6 +endseg + +beginseg + name "object_vali" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_vali/object_vali.o" + number 6 +endseg + +beginseg + name "object_oA10" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oA10/object_oA10.o" + number 6 +endseg + +beginseg + name "object_oA11" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oA11/object_oA11.o" + number 6 +endseg + +beginseg + name "object_mizu_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mizu_objects/object_mizu_objects.o" + number 6 +endseg + +beginseg + name "object_fhg" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_fhg/object_fhg.o" + number 6 +endseg + +beginseg + name "object_ossan" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ossan/object_ossan.o" + number 6 +endseg + +beginseg + name "object_mori_hineri1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mori_hineri1/object_mori_hineri1.o" + number 6 +endseg + +beginseg + name "object_Bb" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_Bb/object_Bb.o" + number 6 +endseg + +beginseg + name "object_toki_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_toki_objects/object_toki_objects.o" + number 6 +endseg + +beginseg + name "object_yukabyun" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_yukabyun/object_yukabyun.o" + number 6 +endseg + +beginseg + name "object_zl2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_zl2/object_zl2.o" + number 6 +endseg + +beginseg + name "object_mjin" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mjin/object_mjin.o" + number 6 +endseg + +beginseg + name "object_mjin_flash" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mjin_flash/object_mjin_flash.o" + number 6 +endseg + +beginseg + name "object_mjin_dark" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mjin_dark/object_mjin_dark.o" + number 6 +endseg + +beginseg + name "object_mjin_flame" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mjin_flame/object_mjin_flame.o" + number 6 +endseg + +beginseg + name "object_mjin_ice" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mjin_ice/object_mjin_ice.o" + number 6 +endseg + +beginseg + name "object_mjin_soul" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mjin_soul/object_mjin_soul.o" + number 6 +endseg + +beginseg + name "object_mjin_wind" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mjin_wind/object_mjin_wind.o" + number 6 +endseg + +beginseg + name "object_mjin_oka" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mjin_oka/object_mjin_oka.o" + number 6 +endseg + +beginseg + name "object_haka_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_haka_objects/object_haka_objects.o" + number 6 +endseg + +beginseg + name "object_spot06_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot06_objects/object_spot06_objects.o" + number 6 +endseg + +beginseg + name "object_ice_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ice_objects/object_ice_objects.o" + number 6 +endseg + +beginseg + name "object_relay_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_relay_objects/object_relay_objects.o" + number 6 +endseg + +beginseg + name "object_mori_hineri1a" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mori_hineri1a/object_mori_hineri1a.o" + number 6 +endseg + +beginseg + name "object_mori_hineri2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mori_hineri2/object_mori_hineri2.o" + number 6 +endseg + +beginseg + name "object_mori_hineri2a" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mori_hineri2a/object_mori_hineri2a.o" + number 6 +endseg + +beginseg + name "object_mori_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mori_objects/object_mori_objects.o" + number 6 +endseg + +beginseg + name "object_mori_tex" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mori_tex/object_mori_tex.o" + number 8 +endseg + +beginseg + name "object_spot08_obj" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot08_obj/object_spot08_obj.o" + number 6 +endseg + +beginseg + name "object_warp2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_warp2/object_warp2.o" + number 6 +endseg + +beginseg + name "object_hata" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_hata/object_hata.o" + number 6 +endseg + +beginseg + name "object_bird" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bird/object_bird.o" + number 6 +endseg + +beginseg + name "object_wood02" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_wood02/object_wood02.o" + number 6 +endseg + +beginseg + name "object_lightbox" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_lightbox/object_lightbox.o" + number 6 +endseg + +beginseg + name "object_pu_box" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_pu_box/object_pu_box.o" + number 6 +endseg + +beginseg + name "object_trap" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_trap/object_trap.o" + number 6 +endseg + +beginseg + name "object_vase" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_vase/object_vase.o" + number 6 +endseg + +beginseg + name "object_im" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_im/object_im.o" + number 6 +endseg + +beginseg + name "object_ta" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ta/object_ta.o" + number 6 +endseg + +beginseg + name "object_tk" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_tk/object_tk.o" + number 6 +endseg + +beginseg + name "object_xc" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_xc/object_xc.o" + number 6 +endseg + +beginseg + name "object_vm" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_vm/object_vm.o" + number 6 +endseg + +beginseg + name "object_bv" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bv/object_bv.o" + number 6 +endseg + +beginseg + name "object_hakach_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_hakach_objects/object_hakach_objects.o" + number 6 +endseg + +beginseg + name "object_efc_crystal_light" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_efc_crystal_light/object_efc_crystal_light.o" + number 6 +endseg + +beginseg + name "object_efc_fire_ball" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_efc_fire_ball/object_efc_fire_ball.o" + number 6 +endseg + +beginseg + name "object_efc_flash" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_efc_flash/object_efc_flash.o" + number 6 +endseg + +beginseg + name "object_efc_lgt_shower" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_efc_lgt_shower/object_efc_lgt_shower.o" + number 6 +endseg + +beginseg + name "object_efc_star_field" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_efc_star_field/object_efc_star_field.o" + number 6 +endseg + +beginseg + name "object_god_lgt" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_god_lgt/object_god_lgt.o" + number 6 +endseg + +beginseg + name "object_light_ring" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_light_ring/object_light_ring.o" + number 6 +endseg + +beginseg + name "object_triforce_spot" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_triforce_spot/object_triforce_spot.o" + number 6 +endseg + +beginseg + name "object_medal" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_medal/object_medal.o" + number 6 +endseg + +beginseg + name "object_bdan_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bdan_objects/object_bdan_objects.o" + number 6 +endseg + +beginseg + name "object_sd" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_sd/object_sd.o" + number 6 +endseg + +beginseg + name "object_rd" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_rd/object_rd.o" + number 6 +endseg + +beginseg + name "object_po_sisters" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_po_sisters/object_po_sisters.o" + number 6 +endseg + +beginseg + name "object_heavy_object" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_heavy_object/object_heavy_object.o" + number 6 +endseg + +beginseg + name "object_gndd" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gndd/object_gndd.o" + number 6 +endseg + +beginseg + name "object_fd" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_fd/object_fd.o" + number 6 +endseg + +beginseg + name "object_du" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_du/object_du.o" + number 6 +endseg + +beginseg + name "object_fw" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_fw/object_fw.o" + number 6 +endseg + +beginseg + name "object_horse_link_child" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_horse_link_child/object_horse_link_child.o" + number 6 +endseg + +beginseg + name "object_spot02_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot02_objects/object_spot02_objects.o" + number 6 +endseg + +beginseg + name "object_haka" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_haka/object_haka.o" + number 6 +endseg + +beginseg + name "object_ru1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ru1/object_ru1.o" + number 6 +endseg + +beginseg + name "object_syokudai" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_syokudai/object_syokudai.o" + number 6 +endseg + +beginseg + name "object_fd2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_fd2/object_fd2.o" + number 6 +endseg + +beginseg + name "object_dh" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_dh/object_dh.o" + number 6 +endseg + +beginseg + name "object_rl" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_rl/object_rl.o" + number 6 +endseg + +beginseg + name "object_efc_tw" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_efc_tw/object_efc_tw.o" + number 6 +endseg + +beginseg + name "object_demo_tre_lgt" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_demo_tre_lgt/object_demo_tre_lgt.o" + number 6 +endseg + +beginseg + name "object_gi_key" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_key/object_gi_key.o" + number 6 +endseg + +beginseg + name "object_mir_ray" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mir_ray/object_mir_ray.o" + number 6 +endseg + +beginseg + name "object_brob" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_brob/object_brob.o" + number 6 +endseg + +beginseg + name "object_gi_jewel" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_jewel/object_gi_jewel.o" + number 6 +endseg + +beginseg + name "object_spot09_obj" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot09_obj/object_spot09_obj.o" + number 6 +endseg + +beginseg + name "object_spot18_obj" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot18_obj/object_spot18_obj.o" + number 6 +endseg + +beginseg + name "object_bdoor" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bdoor/object_bdoor.o" + number 6 +endseg + +beginseg + name "object_spot17_obj" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot17_obj/object_spot17_obj.o" + number 6 +endseg + +beginseg + name "object_shop_dungen" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_shop_dungen/object_shop_dungen.o" + number 6 +endseg + +beginseg + name "object_nb" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_nb/object_nb.o" + number 6 +endseg + +beginseg + name "object_mo" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mo/object_mo.o" + number 6 +endseg + +beginseg + name "object_sb" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_sb/object_sb.o" + number 6 +endseg + +beginseg + name "object_gi_melody" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_melody/object_gi_melody.o" + number 6 +endseg + +beginseg + name "object_gi_heart" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_heart/object_gi_heart.o" + number 6 +endseg + +beginseg + name "object_gi_compass" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_compass/object_gi_compass.o" + number 6 +endseg + +beginseg + name "object_gi_bosskey" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_bosskey/object_gi_bosskey.o" + number 6 +endseg + +beginseg + name "object_gi_medal" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_medal/object_gi_medal.o" + number 6 +endseg + +beginseg + name "object_gi_nuts" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_nuts/object_gi_nuts.o" + number 6 +endseg + +beginseg + name "object_sa" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_sa/object_sa.o" + number 6 +endseg + +beginseg + name "object_gi_hearts" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_hearts/object_gi_hearts.o" + number 6 +endseg + +beginseg + name "object_gi_arrowcase" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_arrowcase/object_gi_arrowcase.o" + number 6 +endseg + +beginseg + name "object_gi_bombpouch" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_bombpouch/object_gi_bombpouch.o" + number 6 +endseg + +beginseg + name "object_in" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_in/object_in.o" + number 6 +endseg + +beginseg + name "object_tr" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_tr/object_tr.o" + number 6 +endseg + +beginseg + name "object_spot16_obj" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot16_obj/object_spot16_obj.o" + number 6 +endseg + +beginseg + name "object_oE1s" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE1s/object_oE1s.o" + number 6 +endseg + +beginseg + name "object_oE4s" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oE4s/object_oE4s.o" + number 6 +endseg + +beginseg + name "object_os_anime" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_os_anime/object_os_anime.o" + number 6 +endseg + +beginseg + name "object_gi_bottle" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_bottle/object_gi_bottle.o" + number 6 +endseg + +beginseg + name "object_gi_stick" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_stick/object_gi_stick.o" + number 6 +endseg + +beginseg + name "object_gi_map" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_map/object_gi_map.o" + number 6 +endseg + +beginseg + name "object_oF1d_map" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oF1d_map/object_oF1d_map.o" + number 6 +endseg + +beginseg + name "object_ru2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ru2/object_ru2.o" + number 6 +endseg + +beginseg + name "object_gi_shield_1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_shield_1/object_gi_shield_1.o" + number 6 +endseg + +beginseg + name "object_dekujr" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_dekujr/object_dekujr.o" + number 6 +endseg + +beginseg + name "object_gi_magicpot" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_magicpot/object_gi_magicpot.o" + number 6 +endseg + +beginseg + name "object_gi_bomb_1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_bomb_1/object_gi_bomb_1.o" + number 6 +endseg + +beginseg + name "object_oF1s" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_oF1s/object_oF1s.o" + number 6 +endseg + +beginseg + name "object_ma2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ma2/object_ma2.o" + number 6 +endseg + +beginseg + name "object_gi_purse" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_purse/object_gi_purse.o" + number 6 +endseg + +beginseg + name "object_hni" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_hni/object_hni.o" + number 6 +endseg + +beginseg + name "object_tw" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_tw/object_tw.o" + number 6 +endseg + +beginseg + name "object_rr" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_rr/object_rr.o" + number 6 +endseg + +beginseg + name "object_bxa" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bxa/object_bxa.o" + number 6 +endseg + +beginseg + name "object_anubice" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_anubice/object_anubice.o" + number 6 +endseg + +beginseg + name "object_gi_gerudo" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_gerudo/object_gi_gerudo.o" + number 6 +endseg + +beginseg + name "object_gi_arrow" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_arrow/object_gi_arrow.o" + number 6 +endseg + +beginseg + name "object_gi_bomb_2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_bomb_2/object_gi_bomb_2.o" + number 6 +endseg + +beginseg + name "object_gi_egg" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_egg/object_gi_egg.o" + number 6 +endseg + +beginseg + name "object_gi_scale" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_scale/object_gi_scale.o" + number 6 +endseg + +beginseg + name "object_gi_shield_2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_shield_2/object_gi_shield_2.o" + number 6 +endseg + +beginseg + name "object_gi_hookshot" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_hookshot/object_gi_hookshot.o" + number 6 +endseg + +beginseg + name "object_gi_ocarina" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_ocarina/object_gi_ocarina.o" + number 6 +endseg + +beginseg + name "object_gi_milk" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_milk/object_gi_milk.o" + number 6 +endseg + +beginseg + name "object_ma1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ma1/object_ma1.o" + number 6 +endseg + +beginseg + name "object_ganon" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ganon/object_ganon.o" + number 6 +endseg + +beginseg + name "object_sst" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_sst/object_sst.o" + number 6 +endseg + +beginseg + name "object_ny" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ny/object_ny.o" + number 6 +endseg + +beginseg + name "object_fr" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_fr/object_fr.o" + number 6 +endseg + +beginseg + name "object_gi_pachinko" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_pachinko/object_gi_pachinko.o" + number 6 +endseg + +beginseg + name "object_gi_boomerang" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_boomerang/object_gi_boomerang.o" + number 6 +endseg + +beginseg + name "object_gi_bow" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_bow/object_gi_bow.o" + number 6 +endseg + +beginseg + name "object_gi_glasses" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_glasses/object_gi_glasses.o" + number 6 +endseg + +beginseg + name "object_gi_liquid" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_liquid/object_gi_liquid.o" + number 6 +endseg + +beginseg + name "object_ani" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ani/object_ani.o" + number 6 +endseg + +beginseg + name "object_demo_6k" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_demo_6k/object_demo_6k.o" + number 6 +endseg + +beginseg + name "object_gi_shield_3" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_shield_3/object_gi_shield_3.o" + number 6 +endseg + +beginseg + name "object_gi_letter" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_letter/object_gi_letter.o" + number 6 +endseg + +beginseg + name "object_spot15_obj" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot15_obj/object_spot15_obj.o" + number 6 +endseg + +beginseg + name "object_jya_obj" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_jya_obj/object_jya_obj.o" + number 6 +endseg + +beginseg + name "object_gi_clothes" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_clothes/object_gi_clothes.o" + number 6 +endseg + +beginseg + name "object_gi_bean" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_bean/object_gi_bean.o" + number 6 +endseg + +beginseg + name "object_gi_fish" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_fish/object_gi_fish.o" + number 6 +endseg + +beginseg + name "object_gi_saw" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_saw/object_gi_saw.o" + number 6 +endseg + +beginseg + name "object_gi_hammer" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_hammer/object_gi_hammer.o" + number 6 +endseg + +beginseg + name "object_gi_grass" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_grass/object_gi_grass.o" + number 6 +endseg + +beginseg + name "object_gi_longsword" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_longsword/object_gi_longsword.o" + number 6 +endseg + +beginseg + name "object_spot01_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot01_objects/object_spot01_objects.o" + number 6 +endseg + +beginseg + name "object_md" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_md/object_md.o" + number 6 +endseg + +beginseg + name "object_km1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_km1/object_km1.o" + number 6 +endseg + +beginseg + name "object_kw1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_kw1/object_kw1.o" + number 6 +endseg + +beginseg + name "object_zo" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_zo/object_zo.o" + number 6 +endseg + +beginseg + name "object_kz" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_kz/object_kz.o" + number 6 +endseg + +beginseg + name "object_umajump" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_umajump/object_umajump.o" + number 6 +endseg + +beginseg + name "object_masterkokiri" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_masterkokiri/object_masterkokiri.o" + number 6 +endseg + +beginseg + name "object_masterkokirihead" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_masterkokirihead/object_masterkokirihead.o" + number 6 +endseg + +beginseg + name "object_mastergolon" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mastergolon/object_mastergolon.o" + number 6 +endseg + +beginseg + name "object_masterzoora" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_masterzoora/object_masterzoora.o" + number 6 +endseg + +beginseg + name "object_aob" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_aob/object_aob.o" + number 6 +endseg + +beginseg + name "object_ik" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ik/object_ik.o" + number 6 +endseg + +beginseg + name "object_ahg" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ahg/object_ahg.o" + number 6 +endseg + +beginseg + name "object_cne" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_cne/object_cne.o" + number 6 +endseg + +beginseg + name "object_gi_niwatori" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_niwatori/object_gi_niwatori.o" + number 6 +endseg + +beginseg + name "object_skj" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_skj/object_skj.o" + number 6 +endseg + +beginseg + name "object_gi_bottle_letter" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_bottle_letter/object_gi_bottle_letter.o" + number 6 +endseg + +beginseg + name "object_bji" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bji/object_bji.o" + number 6 +endseg + +beginseg + name "object_bba" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bba/object_bba.o" + number 6 +endseg + +beginseg + name "object_gi_ocarina_0" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_ocarina_0/object_gi_ocarina_0.o" + number 6 +endseg + +beginseg + name "object_ds" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ds/object_ds.o" + number 6 +endseg + +beginseg + name "object_ane" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ane/object_ane.o" + number 6 +endseg + +beginseg + name "object_boj" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_boj/object_boj.o" + number 6 +endseg + +beginseg + name "object_spot03_object" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot03_object/object_spot03_object.o" + number 6 +endseg + +beginseg + name "object_spot07_object" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot07_object/object_spot07_object.o" + number 6 +endseg + +beginseg + name "object_fz" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_fz/object_fz.o" + number 6 +endseg + +beginseg + name "object_bob" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bob/object_bob.o" + number 6 +endseg + +beginseg + name "object_ge1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ge1/object_ge1.o" + number 6 +endseg + +beginseg + name "object_yabusame_point" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_yabusame_point/object_yabusame_point.o" + number 6 +endseg + +beginseg + name "object_gi_boots_2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_boots_2/object_gi_boots_2.o" + number 6 +endseg + +beginseg + name "object_gi_seed" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_seed/object_gi_seed.o" + number 6 +endseg + +beginseg + name "object_gnd_magic" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gnd_magic/object_gnd_magic.o" + number 6 +endseg + +beginseg + name "object_d_elevator" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_d_elevator/object_d_elevator.o" + number 6 +endseg + +beginseg + name "object_d_hsblock" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_d_hsblock/object_d_hsblock.o" + number 6 +endseg + +beginseg + name "object_d_lift" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_d_lift/object_d_lift.o" + number 6 +endseg + +beginseg + name "object_mamenoki" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mamenoki/object_mamenoki.o" + number 6 +endseg + +beginseg + name "object_goroiwa" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_goroiwa/object_goroiwa.o" + number 6 +endseg + +beginseg + name "object_toryo" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_toryo/object_toryo.o" + number 6 +endseg + +beginseg + name "object_daiku" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_daiku/object_daiku.o" + number 6 +endseg + +beginseg + name "object_nwc" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_nwc/object_nwc.o" + number 6 +endseg + +beginseg + name "object_blkobj" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_blkobj/object_blkobj.o" + number 6 +endseg + +beginseg + name "object_gm" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gm/object_gm.o" + number 6 +endseg + +beginseg + name "object_ms" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ms/object_ms.o" + number 6 +endseg + +beginseg + name "object_hs" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_hs/object_hs.o" + number 6 +endseg + +beginseg + name "object_ingate" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ingate/object_ingate.o" + number 6 +endseg + +beginseg + name "object_lightswitch" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_lightswitch/object_lightswitch.o" + number 6 +endseg + +beginseg + name "object_kusa" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_kusa/object_kusa.o" + number 6 +endseg + +beginseg + name "object_tsubo" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_tsubo/object_tsubo.o" + number 6 +endseg + +beginseg + name "object_gi_gloves" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_gloves/object_gi_gloves.o" + number 6 +endseg + +beginseg + name "object_gi_coin" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_coin/object_gi_coin.o" + number 6 +endseg + +beginseg + name "object_kanban" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_kanban/object_kanban.o" + number 6 +endseg + +beginseg + name "object_gjyo_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gjyo_objects/object_gjyo_objects.o" + number 6 +endseg + +beginseg + name "object_owl" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_owl/object_owl.o" + number 6 +endseg + +beginseg + name "object_mk" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mk/object_mk.o" + number 6 +endseg + +beginseg + name "object_fu" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_fu/object_fu.o" + number 6 +endseg + +beginseg + name "object_gi_ki_tan_mask" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_ki_tan_mask/object_gi_ki_tan_mask.o" + number 6 +endseg + +beginseg + name "object_gi_redead_mask" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_redead_mask/object_gi_redead_mask.o" + number 6 +endseg + +beginseg + name "object_gi_skj_mask" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_skj_mask/object_gi_skj_mask.o" + number 6 +endseg + +beginseg + name "object_gi_rabit_mask" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_rabit_mask/object_gi_rabit_mask.o" + number 6 +endseg + +beginseg + name "object_gi_truth_mask" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_truth_mask/object_gi_truth_mask.o" + number 6 +endseg + +beginseg + name "object_ganon_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ganon_objects/object_ganon_objects.o" + number 6 +endseg + +beginseg + name "object_siofuki" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_siofuki/object_siofuki.o" + number 6 +endseg + +beginseg + name "object_stream" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_stream/object_stream.o" + number 6 +endseg + +beginseg + name "object_mm" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mm/object_mm.o" + number 6 +endseg + +beginseg + name "object_fa" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_fa/object_fa.o" + number 6 +endseg + +beginseg + name "object_os" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_os/object_os.o" + number 6 +endseg + +beginseg + name "object_gi_eye_lotion" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_eye_lotion/object_gi_eye_lotion.o" + number 6 +endseg + +beginseg + name "object_gi_powder" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_powder/object_gi_powder.o" + number 6 +endseg + +beginseg + name "object_gi_mushroom" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_mushroom/object_gi_mushroom.o" + number 6 +endseg + +beginseg + name "object_gi_ticketstone" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_ticketstone/object_gi_ticketstone.o" + number 6 +endseg + +beginseg + name "object_gi_brokensword" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_brokensword/object_gi_brokensword.o" + number 6 +endseg + +beginseg + name "object_js" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_js/object_js.o" + number 6 +endseg + +beginseg + name "object_cs" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_cs/object_cs.o" + number 6 +endseg + +beginseg + name "object_gi_prescription" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_prescription/object_gi_prescription.o" + number 6 +endseg + +beginseg + name "object_gi_bracelet" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_bracelet/object_gi_bracelet.o" + number 6 +endseg + +beginseg + name "object_gi_soldout" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_soldout/object_gi_soldout.o" + number 6 +endseg + +beginseg + name "object_gi_frog" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_frog/object_gi_frog.o" + number 6 +endseg + +beginseg + name "object_mag" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mag/object_mag.o" + number 6 +endseg + +beginseg + name "object_door_gerudo" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_door_gerudo/object_door_gerudo.o" + number 6 +endseg + +beginseg + name "object_gt" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gt/object_gt.o" + number 6 +endseg + +beginseg + name "object_efc_erupc" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_efc_erupc/object_efc_erupc.o" + number 6 +endseg + +beginseg + name "object_zl2_anime1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_zl2_anime1/object_zl2_anime1.o" + number 6 +endseg + +beginseg + name "object_zl2_anime2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_zl2_anime2/object_zl2_anime2.o" + number 6 +endseg + +beginseg + name "object_gi_golonmask" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_golonmask/object_gi_golonmask.o" + number 6 +endseg + +beginseg + name "object_gi_zoramask" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_zoramask/object_gi_zoramask.o" + number 6 +endseg + +beginseg + name "object_gi_gerudomask" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_gerudomask/object_gi_gerudomask.o" + number 6 +endseg + +beginseg + name "object_ganon2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ganon2/object_ganon2.o" + number 6 +endseg + +beginseg + name "object_ka" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ka/object_ka.o" + number 6 +endseg + +beginseg + name "object_ts" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ts/object_ts.o" + number 6 +endseg + +beginseg + name "object_zg" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_zg/object_zg.o" + number 6 +endseg + +beginseg + name "object_gi_hoverboots" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_hoverboots/object_gi_hoverboots.o" + number 6 +endseg + +beginseg + name "object_gi_m_arrow" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_m_arrow/object_gi_m_arrow.o" + number 6 +endseg + +beginseg + name "object_ds2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ds2/object_ds2.o" + number 6 +endseg + +beginseg + name "object_ec" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ec/object_ec.o" + number 6 +endseg + +beginseg + name "object_fish" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_fish/object_fish.o" + number 6 +endseg + +beginseg + name "object_gi_sutaru" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_sutaru/object_gi_sutaru.o" + number 6 +endseg + +beginseg + name "object_gi_goddess" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_goddess/object_gi_goddess.o" + number 6 +endseg + +beginseg + name "object_ssh" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ssh/object_ssh.o" + number 6 +endseg + +beginseg + name "object_bigokuta" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bigokuta/object_bigokuta.o" + number 6 +endseg + +beginseg + name "object_bg" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bg/object_bg.o" + number 6 +endseg + +beginseg + name "object_spot05_objects" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot05_objects/object_spot05_objects.o" + number 6 +endseg + +beginseg + name "object_spot12_obj" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot12_obj/object_spot12_obj.o" + number 6 +endseg + +beginseg + name "object_bombiwa" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bombiwa/object_bombiwa.o" + number 6 +endseg + +beginseg + name "object_hintnuts" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_hintnuts/object_hintnuts.o" + number 6 +endseg + +beginseg + name "object_rs" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_rs/object_rs.o" + number 6 +endseg + +beginseg + name "object_spot00_break" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot00_break/object_spot00_break.o" + number 6 +endseg + +beginseg + name "object_gla" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gla/object_gla.o" + number 6 +endseg + +beginseg + name "object_shopnuts" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_shopnuts/object_shopnuts.o" + number 6 +endseg + +beginseg + name "object_geldb" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_geldb/object_geldb.o" + number 6 +endseg + +beginseg + name "object_gr" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gr/object_gr.o" + number 6 +endseg + +beginseg + name "object_dog" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_dog/object_dog.o" + number 6 +endseg + +beginseg + name "object_jya_iron" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_jya_iron/object_jya_iron.o" + number 6 +endseg + +beginseg + name "object_jya_door" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_jya_door/object_jya_door.o" + number 6 +endseg + +beginseg + name "object_spot01_objects2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot01_objects2/object_spot01_objects2.o" + number 6 +endseg + +beginseg + name "object_spot11_obj" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot11_obj/object_spot11_obj.o" + number 6 +endseg + +beginseg + name "object_kibako2" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_kibako2/object_kibako2.o" + number 6 endseg beginseg - name "ovl_En_Mb" + name "object_dns" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mb/z_en_mb.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mb/ovl_En_Mb_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_dns/object_dns.o" + number 6 endseg beginseg - name "ovl_En_Md" + name "object_dnk" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Md/z_en_md.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Md/ovl_En_Md_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_dnk/object_dnk.o" + number 6 endseg beginseg - name "ovl_En_Mk" + name "object_gi_fire" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mk/z_en_mk.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mk/ovl_En_Mk_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_fire/object_gi_fire.o" + number 6 endseg beginseg - name "ovl_En_Mm" + name "object_gi_insect" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mm/z_en_mm.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mm/ovl_En_Mm_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_insect/object_gi_insect.o" + number 6 endseg beginseg - name "ovl_En_Mm2" + name "object_gi_butterfly" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mm2/z_en_mm2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mm2/ovl_En_Mm2_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_butterfly/object_gi_butterfly.o" + number 6 endseg beginseg - name "ovl_En_Ms" + name "object_gi_ghost" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ms/z_en_ms.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ms/ovl_En_Ms_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_ghost/object_gi_ghost.o" + number 6 endseg beginseg - name "ovl_En_Mu" + name "object_gi_soul" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mu/z_en_mu.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mu/ovl_En_Mu_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_soul/object_gi_soul.o" + number 6 endseg beginseg - name "ovl_En_Nb" + name "object_bowl" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nb/z_en_nb.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nb/ovl_En_Nb_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bowl/object_bowl.o" + number 6 endseg beginseg - name "ovl_En_Niw" + name "object_po_field" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw/z_en_niw.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw/ovl_En_Niw_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_po_field/object_po_field.o" + number 6 endseg beginseg - name "ovl_En_Niw_Girl" + name "object_demo_kekkai" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw_Girl/ovl_En_Niw_Girl_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_demo_kekkai/object_demo_kekkai.o" + number 6 endseg beginseg - name "ovl_En_Niw_Lady" + name "object_efc_doughnut" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Niw_Lady/ovl_En_Niw_Lady_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_efc_doughnut/object_efc_doughnut.o" + number 6 endseg beginseg - name "ovl_En_Nutsball" + name "object_gi_dekupouch" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nutsball/ovl_En_Nutsball_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_dekupouch/object_gi_dekupouch.o" + number 6 endseg beginseg - name "ovl_En_Nwc" + name "object_ganon_anime1" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nwc/z_en_nwc.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Nwc/ovl_En_Nwc_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ganon_anime1/object_ganon_anime1.o" + number 6 endseg beginseg - name "ovl_En_Ny" + name "object_ganon_anime2" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ny/z_en_ny.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ny/ovl_En_Ny_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ganon_anime2/object_ganon_anime2.o" + number 6 endseg beginseg - name "ovl_En_OE2" + name "object_ganon_anime3" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_OE2/z_en_oe2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_OE2/ovl_En_OE2_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ganon_anime3/object_ganon_anime3.o" + number 6 endseg beginseg - name "ovl_En_Okarina_Effect" + name "object_gi_rupy" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Effect/ovl_En_Okarina_Effect_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_rupy/object_gi_rupy.o" + number 6 endseg beginseg - name "ovl_En_Okarina_Tag" + name "object_spot01_matoya" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag_cutscene_data.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okarina_Tag/ovl_En_Okarina_Tag_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot01_matoya/object_spot01_matoya.o" + number 6 endseg beginseg - name "ovl_En_Okuta" + name "object_spot01_matoyab" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okuta/z_en_okuta.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Okuta/ovl_En_Okuta_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_spot01_matoyab/object_spot01_matoyab.o" + number 6 endseg beginseg - name "ovl_En_Ossan" + name "object_po_composer" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ossan/z_en_ossan.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ossan/ovl_En_Ossan_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_po_composer/object_po_composer.o" + number 6 endseg beginseg - name "ovl_En_Owl" + name "object_mu" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Owl/z_en_owl.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Owl/ovl_En_Owl_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_mu/object_mu.o" + number 6 endseg beginseg - name "ovl_En_Part" + name "object_wf" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Part/z_en_part.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Part/ovl_En_Part_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_wf/object_wf.o" + number 6 endseg beginseg - name "ovl_En_Peehat" + name "object_skb" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Peehat/z_en_peehat.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Peehat/ovl_En_Peehat_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_skb/object_skb.o" + number 6 endseg beginseg - name "ovl_En_Po_Desert" + name "object_gj" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Desert/ovl_En_Po_Desert_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gj/object_gj.o" + number 6 endseg beginseg - name "ovl_En_Po_Field" + name "object_geff" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Field/ovl_En_Po_Field_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_geff/object_geff.o" + number 6 endseg beginseg - name "ovl_En_Po_Relay" + name "object_haka_door" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Relay/ovl_En_Po_Relay_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_haka_door/object_haka_door.o" + number 6 endseg beginseg - name "ovl_En_Po_Sisters" + name "object_gs" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Po_Sisters/ovl_En_Po_Sisters_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gs/object_gs.o" + number 6 endseg beginseg - name "ovl_En_Poh" + name "object_ps" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Poh/z_en_poh.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Poh/ovl_En_Poh_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ps/object_ps.o" + number 6 endseg beginseg - name "ovl_En_Pu_box" + name "object_bwall" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Pu_box/ovl_En_Pu_box_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_bwall/object_bwall.o" + number 6 +endseg + +beginseg + name "object_crow" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_crow/object_crow.o" + number 6 +endseg + +beginseg + name "object_cow" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_cow/object_cow.o" + number 6 +endseg + +beginseg + name "object_cob" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_cob/object_cob.o" + number 6 +endseg + +beginseg + name "object_gi_sword_1" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_gi_sword_1/object_gi_sword_1.o" + number 6 +endseg + +beginseg + name "object_door_killer" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_door_killer/object_door_killer.o" + number 6 +endseg + +beginseg + name "object_ouke_haka" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_ouke_haka/object_ouke_haka.o" + number 6 +endseg + +beginseg + name "object_timeblock" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_timeblock/object_timeblock.o" + number 6 endseg beginseg - name "ovl_En_Rd" + name "object_zl4" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rd/z_en_rd.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rd/ovl_En_Rd_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/objects/object_zl4/object_zl4.o" + number 6 endseg beginseg - name "ovl_En_Reeba" + name "g_pn_01" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Reeba/z_en_reeba.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Reeba/ovl_En_Reeba_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_01.o" endseg beginseg - name "ovl_En_River_Sound" + name "g_pn_02" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_River_Sound/ovl_En_River_Sound_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_02.o" endseg beginseg - name "ovl_En_Rl" + name "g_pn_03" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rl/z_en_rl.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rl/ovl_En_Rl_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_03.o" endseg beginseg - name "ovl_En_Rr" + name "g_pn_04" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rr/z_en_rr.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Rr/ovl_En_Rr_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_04.o" endseg beginseg - name "ovl_En_Ru1" + name "g_pn_05" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ru1/z_en_ru1.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ru1/ovl_En_Ru1_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_05.o" endseg beginseg - name "ovl_En_Ru2" + name "g_pn_06" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ru2/z_en_ru2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ru2/ovl_En_Ru2_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_06.o" endseg beginseg - name "ovl_En_Sa" + name "g_pn_07" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sa/z_en_sa.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sa/ovl_En_Sa_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_07.o" endseg beginseg - name "ovl_En_Sb" + name "g_pn_08" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sb/z_en_sb.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sb/ovl_En_Sb_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_08.o" endseg beginseg - name "ovl_En_Scene_Change" + name "g_pn_09" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Scene_Change/ovl_En_Scene_Change_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_09.o" endseg beginseg - name "ovl_En_Sda" + name "g_pn_10" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sda/z_en_sda.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sda/ovl_En_Sda_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_10.o" endseg beginseg - name "ovl_En_Shopnuts" + name "g_pn_11" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Shopnuts/ovl_En_Shopnuts_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_11.o" endseg beginseg - name "ovl_En_Si" + name "g_pn_12" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Si/z_en_si.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Si/ovl_En_Si_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_12.o" endseg beginseg - name "ovl_En_Siofuki" + name "g_pn_13" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Siofuki/ovl_En_Siofuki_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_13.o" endseg beginseg - name "ovl_En_Skb" + name "g_pn_14" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skb/z_en_skb.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skb/ovl_En_Skb_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_14.o" endseg beginseg - name "ovl_En_Skj" + name "g_pn_15" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skj/z_en_skj.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skj/ovl_En_Skj_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_15.o" endseg beginseg - name "ovl_En_Skjneedle" + name "g_pn_16" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Skjneedle/ovl_En_Skjneedle_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_16.o" endseg beginseg - name "ovl_En_Ssh" + name "g_pn_17" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ssh/z_en_ssh.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ssh/ovl_En_Ssh_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_17.o" endseg beginseg - name "ovl_En_St" + name "g_pn_18" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_St/z_en_st.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_St/ovl_En_St_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_18.o" endseg beginseg - name "ovl_En_Sth" + name "g_pn_19" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sth/z_en_sth.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sth/ovl_En_Sth_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_19.o" endseg beginseg - name "ovl_En_Stream" + name "g_pn_20" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Stream/z_en_stream.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Stream/ovl_En_Stream_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_20.o" endseg beginseg - name "ovl_En_Sw" + name "g_pn_21" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sw/z_en_sw.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Sw/ovl_En_Sw_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_21.o" endseg beginseg - name "ovl_En_Syateki_Itm" + name "g_pn_22" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Itm/ovl_En_Syateki_Itm_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_22.o" endseg beginseg - name "ovl_En_Syateki_Man" + name "g_pn_23" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Man/ovl_En_Syateki_Man_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_23.o" endseg beginseg - name "ovl_En_Syateki_Niw" + name "g_pn_24" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Syateki_Niw/ovl_En_Syateki_Niw_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_24.o" endseg beginseg - name "ovl_En_Ta" + name "g_pn_25" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ta/z_en_ta.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Ta/ovl_En_Ta_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_25.o" endseg beginseg - name "ovl_En_Takara_Man" + name "g_pn_26" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Takara_Man/ovl_En_Takara_Man_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_26.o" endseg beginseg - name "ovl_En_Tana" + name "g_pn_27" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tana/z_en_tana.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tana/ovl_En_Tana_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_27.o" endseg beginseg - name "ovl_En_Tg" + name "g_pn_28" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tg/z_en_tg.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tg/ovl_En_Tg_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_28.o" endseg beginseg - name "ovl_En_Tite" + name "g_pn_29" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tite/z_en_tite.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tite/ovl_En_Tite_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_29.o" endseg beginseg - name "ovl_En_Tk" + name "g_pn_30" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tk/z_en_tk.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tk/ovl_En_Tk_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_30.o" endseg beginseg - name "ovl_En_Torch" + name "g_pn_31" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Torch/z_en_torch.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Torch/ovl_En_Torch_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_31.o" endseg beginseg - name "ovl_En_Torch2" + name "g_pn_32" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Torch2/z_en_torch2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Torch2/ovl_En_Torch2_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_32.o" endseg beginseg - name "ovl_En_Toryo" + name "g_pn_33" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Toryo/z_en_toryo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Toryo/ovl_En_Toryo_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_33.o" endseg beginseg - name "ovl_En_Tp" + name "g_pn_34" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tp/z_en_tp.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tp/ovl_En_Tp_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_34.o" endseg beginseg - name "ovl_En_Tr" + name "g_pn_35" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tr/z_en_tr.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tr/ovl_En_Tr_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_35.o" endseg beginseg - name "ovl_En_Trap" + name "g_pn_36" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Trap/z_en_trap.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Trap/ovl_En_Trap_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_36.o" endseg beginseg - name "ovl_En_Tubo_Trap" + name "g_pn_37" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tubo_Trap/ovl_En_Tubo_Trap_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_37.o" endseg beginseg - name "ovl_En_Vali" + name "g_pn_38" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vali/z_en_vali.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vali/ovl_En_Vali_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_38.o" endseg beginseg - name "ovl_En_Vase" + name "g_pn_39" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vase/z_en_vase.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vase/ovl_En_Vase_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_39.o" endseg beginseg - name "ovl_En_Vb_Ball" + name "g_pn_40" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vb_Ball/ovl_En_Vb_Ball_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_40.o" endseg beginseg - name "ovl_En_Viewer" + name "g_pn_41" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Viewer/z_en_viewer.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Viewer/ovl_En_Viewer_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_41.o" endseg beginseg - name "ovl_En_Vm" + name "g_pn_42" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vm/z_en_vm.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Vm/ovl_En_Vm_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_42.o" endseg beginseg - name "ovl_En_Wall_Tubo" + name "g_pn_43" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wall_Tubo/ovl_En_Wall_Tubo_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_43.o" endseg beginseg - name "ovl_En_Wallmas" + name "g_pn_44" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wallmas/ovl_En_Wallmas_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_44.o" endseg beginseg - name "ovl_En_Weather_Tag" + name "g_pn_45" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Weather_Tag/ovl_En_Weather_Tag_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_45.o" endseg beginseg - name "ovl_En_Weiyer" + name "g_pn_46" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Weiyer/ovl_En_Weiyer_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_46.o" endseg beginseg - name "ovl_En_Wf" + name "g_pn_47" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wf/z_en_wf.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wf/ovl_En_Wf_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_47.o" endseg beginseg - name "ovl_En_Wonder_Item" + name "g_pn_48" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Item/ovl_En_Wonder_Item_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_48.o" endseg beginseg - name "ovl_En_Wonder_Talk" + name "g_pn_49" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Talk/ovl_En_Wonder_Talk_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_49.o" endseg beginseg - name "ovl_En_Wonder_Talk2" + name "g_pn_50" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wonder_Talk2/ovl_En_Wonder_Talk2_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_50.o" endseg beginseg - name "ovl_En_Wood02" + name "g_pn_51" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wood02/z_en_wood02.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Wood02/ovl_En_Wood02_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_51.o" endseg beginseg - name "ovl_En_Xc" + name "g_pn_52" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Xc/z_en_xc.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Xc/ovl_En_Xc_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_52.o" endseg beginseg - name "ovl_En_Yabusame_Mark" + name "g_pn_53" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Yabusame_Mark/ovl_En_Yabusame_Mark_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_53.o" endseg beginseg - name "ovl_En_Yukabyun" + name "g_pn_54" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Yukabyun/ovl_En_Yukabyun_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_54.o" endseg beginseg - name "ovl_En_Zf" + name "g_pn_55" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zf/z_en_zf.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zf/ovl_En_Zf_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_55.o" endseg beginseg - name "ovl_En_Zl1" + name "g_pn_56" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl1/z_en_zl1.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl1/ovl_En_Zl1_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_56.o" endseg beginseg - name "ovl_En_Zl2" + name "g_pn_57" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl2/z_en_zl2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl2/ovl_En_Zl2_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_57.o" endseg beginseg - name "ovl_En_Zl3" + name "z_select_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl3/z_en_zl3.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl3/ovl_En_Zl3_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/misc/z_select_static/z_select_static.o" + number 1 endseg beginseg - name "ovl_En_Zl4" + name "nintendo_rogo_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl4/z_en_zl4.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zl4/ovl_En_Zl4_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/nintendo_rogo_static/nintendo_rogo_static.o" + number 1 endseg beginseg - name "ovl_En_Zo" + name "title_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zo/z_en_zo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Zo/ovl_En_Zo_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/title_static/title_static.o" + number 1 endseg beginseg - name "ovl_En_fHG" + name "parameter_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_fHG/z_en_fhg.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_fHG/ovl_En_fHG_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/parameter_static/parameter_static.o" + number 2 endseg beginseg - name "ovl_End_Title" + name "vr_fine0_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_End_Title/z_end_title.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_End_Title/ovl_End_Title_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine0_static.o" endseg beginseg - name "ovl_Fishing" + name "vr_fine0_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Fishing/z_fishing.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Fishing/ovl_Fishing_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine0_pal_static.o" endseg beginseg - name "ovl_Item_B_Heart" + name "vr_fine1_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_B_Heart/ovl_Item_B_Heart_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine1_static.o" endseg beginseg - name "ovl_Item_Etcetera" + name "vr_fine1_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Etcetera/ovl_Item_Etcetera_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine1_pal_static.o" endseg beginseg - name "ovl_Item_Inbox" + name "vr_fine2_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Inbox/ovl_Item_Inbox_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine2_static.o" endseg beginseg - name "ovl_Item_Ocarina" + name "vr_fine2_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Ocarina/ovl_Item_Ocarina_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine2_pal_static.o" endseg beginseg - name "ovl_Item_Shield" + name "vr_fine3_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Shield/z_item_shield.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Item_Shield/ovl_Item_Shield_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine3_static.o" endseg beginseg - name "ovl_Magic_Dark" + name "vr_fine3_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Dark/ovl_Magic_Dark_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine3_pal_static.o" endseg beginseg - name "ovl_Magic_Fire" + name "vr_cloud0_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Fire/ovl_Magic_Fire_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud0_static.o" endseg beginseg - name "ovl_Magic_Wind" + name "vr_cloud0_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Magic_Wind/ovl_Magic_Wind_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud0_pal_static.o" endseg beginseg - name "ovl_Mir_Ray" + name "vr_cloud1_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Mir_Ray/ovl_Mir_Ray_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud1_static.o" endseg beginseg - name "ovl_Obj_Bean" + name "vr_cloud1_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Bean/ovl_Obj_Bean_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud1_pal_static.o" endseg beginseg - name "ovl_Obj_Blockstop" + name "vr_cloud2_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Blockstop/ovl_Obj_Blockstop_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud2_static.o" endseg beginseg - name "ovl_Obj_Bombiwa" + name "vr_cloud2_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Bombiwa/ovl_Obj_Bombiwa_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud2_pal_static.o" endseg beginseg - name "ovl_Obj_Comb" + name "vr_cloud3_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Comb/ovl_Obj_Comb_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud3_static.o" endseg beginseg - name "ovl_Obj_Dekujr" + name "vr_cloud3_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Dekujr/ovl_Obj_Dekujr_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud3_pal_static.o" endseg beginseg - name "ovl_Obj_Elevator" + name "vr_holy0_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Elevator/ovl_Obj_Elevator_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_holy0_static.o" endseg beginseg - name "ovl_Obj_Hamishi" + name "vr_holy0_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hamishi/ovl_Obj_Hamishi_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_holy0_pal_static.o" endseg beginseg - name "ovl_Obj_Hana" + name "vr_holy1_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hana/ovl_Obj_Hana_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_holy1_static.o" endseg beginseg - name "ovl_Obj_Hsblock" + name "vr_holy1_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Hsblock/ovl_Obj_Hsblock_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/skyboxes/vr_holy1_pal_static.o" endseg beginseg - name "ovl_Obj_Ice_Poly" + name "vr_MDVR_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Ice_Poly/ovl_Obj_Ice_Poly_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_MDVR_static.o" endseg beginseg - name "ovl_Obj_Kibako" + name "vr_MDVR_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Kibako/ovl_Obj_Kibako_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_MDVR_pal_static.o" endseg beginseg - name "ovl_Obj_Kibako2" + name "vr_MNVR_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Kibako2/ovl_Obj_Kibako2_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_MNVR_static.o" endseg beginseg - name "ovl_Obj_Lift" + name "vr_MNVR_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Lift/ovl_Obj_Lift_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_MNVR_pal_static.o" endseg beginseg - name "ovl_Obj_Lightswitch" + name "vr_RUVR_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Lightswitch/ovl_Obj_Lightswitch_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_RUVR_static.o" endseg beginseg - name "ovl_Obj_Makekinsuta" + name "vr_RUVR_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Makekinsuta/ovl_Obj_Makekinsuta_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_RUVR_pal_static.o" endseg beginseg - name "ovl_Obj_Makeoshihiki" + name "vr_LHVR_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Makeoshihiki/ovl_Obj_Makeoshihiki_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_LHVR_static.o" endseg beginseg - name "ovl_Obj_Mure" + name "vr_LHVR_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure/ovl_Obj_Mure_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_LHVR_pal_static.o" endseg beginseg - name "ovl_Obj_Mure2" + name "vr_KHVR_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure2/ovl_Obj_Mure2_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KHVR_static.o" endseg beginseg - name "ovl_Obj_Mure3" + name "vr_KHVR_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Mure3/ovl_Obj_Mure3_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KHVR_pal_static.o" endseg beginseg - name "ovl_Obj_Oshihiki" + name "vr_K3VR_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Oshihiki/ovl_Obj_Oshihiki_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_K3VR_static.o" endseg beginseg - name "ovl_Obj_Roomtimer" + name "vr_K3VR_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Roomtimer/ovl_Obj_Roomtimer_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_K3VR_pal_static.o" endseg beginseg - name "ovl_Obj_Switch" + name "vr_K4VR_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Switch/ovl_Obj_Switch_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_K4VR_static.o" endseg beginseg - name "ovl_Obj_Syokudai" + name "vr_K4VR_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Syokudai/ovl_Obj_Syokudai_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_K4VR_pal_static.o" endseg beginseg - name "ovl_Obj_Timeblock" + name "vr_K5VR_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Timeblock/ovl_Obj_Timeblock_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_K5VR_static.o" endseg beginseg - name "ovl_Obj_Tsubo" + name "vr_K5VR_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Tsubo/ovl_Obj_Tsubo_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_K5VR_pal_static.o" endseg beginseg - name "ovl_Obj_Warp2block" + name "vr_SP1a_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Obj_Warp2block/ovl_Obj_Warp2block_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_SP1a_static.o" endseg beginseg - name "ovl_Object_Kankyo" + name "vr_SP1a_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Object_Kankyo/ovl_Object_Kankyo_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_SP1a_pal_static.o" endseg beginseg - name "ovl_Oceff_Spot" + name "vr_MLVR_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Spot/ovl_Oceff_Spot_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_MLVR_static.o" endseg beginseg - name "ovl_Oceff_Storm" + name "vr_MLVR_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Storm/ovl_Oceff_Storm_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_MLVR_pal_static.o" endseg beginseg - name "ovl_Oceff_Wipe" + name "vr_KKRVR_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe/ovl_Oceff_Wipe_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KKRVR_static.o" endseg beginseg - name "ovl_Oceff_Wipe2" + name "vr_KKRVR_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe2/ovl_Oceff_Wipe2_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KKRVR_pal_static.o" endseg beginseg - name "ovl_Oceff_Wipe3" + name "vr_KR3VR_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe3/ovl_Oceff_Wipe3_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KR3VR_static.o" endseg beginseg - name "ovl_Oceff_Wipe4" + name "vr_KR3VR_pal_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Oceff_Wipe4/ovl_Oceff_Wipe4_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KR3VR_pal_static.o" endseg beginseg - name "ovl_Shot_Sun" + name "vr_IPVR_static" compress - include "$(BUILD_DIR)/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_Shot_Sun/ovl_Shot_Sun_reloc.o" + romalign 0x1000 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_IPVR_static.o" endseg beginseg - name "gameplay_keep" + name "vr_IPVR_pal_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/gameplay_keep/gameplay_keep.o" - number 4 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_IPVR_pal_static.o" endseg beginseg - name "gameplay_field_keep" + name "vr_KSVR_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/gameplay_field_keep/gameplay_field_keep.o" - number 5 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KSVR_static.o" endseg beginseg - name "gameplay_dangeon_keep" + name "vr_KSVR_pal_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.o" - number 5 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KSVR_pal_static.o" endseg beginseg - name "gameplay_object_exchange_static" + name "vr_GLVR_static" compress romalign 0x1000 - include "$(BUILD_DIR)/baserom/gameplay_object_exchange_static.o" + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_GLVR_static.o" endseg beginseg - name "object_link_boy" + name "vr_GLVR_pal_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_link_boy/object_link_boy.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_GLVR_pal_static.o" endseg beginseg - name "object_link_child" + name "vr_ZRVR_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_link_child/object_link_child.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_ZRVR_static.o" endseg beginseg - name "object_box" + name "vr_ZRVR_pal_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_box/object_box.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_ZRVR_pal_static.o" endseg beginseg - name "object_human" + name "vr_DGVR_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_human/object_human.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_DGVR_static.o" endseg beginseg - name "object_okuta" + name "vr_DGVR_pal_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_okuta/object_okuta.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_DGVR_pal_static.o" endseg beginseg - name "object_poh" + name "vr_ALVR_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_poh/object_poh.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_ALVR_static.o" endseg beginseg - name "object_wallmaster" + name "vr_ALVR_pal_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_wallmaster/object_wallmaster.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_ALVR_pal_static.o" endseg beginseg - name "object_dy_obj" + name "vr_NSVR_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_dy_obj/object_dy_obj.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_NSVR_static.o" endseg beginseg - name "object_firefly" + name "vr_NSVR_pal_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_firefly/object_firefly.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_NSVR_pal_static.o" endseg beginseg - name "object_dodongo" + name "vr_LBVR_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_dodongo/object_dodongo.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_LBVR_static.o" endseg beginseg - name "object_fire" + name "vr_LBVR_pal_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_fire/object_fire.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_LBVR_pal_static.o" endseg beginseg - name "object_niw" + name "vr_TTVR_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_niw/object_niw.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_TTVR_static.o" endseg beginseg - name "object_tite" + name "vr_TTVR_pal_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_tite/object_tite.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_TTVR_pal_static.o" endseg beginseg - name "object_reeba" + name "vr_FCVR_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_reeba/object_reeba.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_FCVR_static.o" endseg beginseg - name "object_peehat" + name "vr_FCVR_pal_static" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_peehat/object_peehat.o" - number 6 + include "$(BUILD_DIR)/assets/textures/backgrounds/vr_FCVR_pal_static.o" endseg beginseg - name "object_kingdodongo" + name "elf_message_field" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_kingdodongo/object_kingdodongo.o" - number 6 + include "$(BUILD_DIR)/src/elf_message/elf_message_field.o" + number 0 endseg beginseg - name "object_horse" + name "elf_message_ydan" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_horse/object_horse.o" - number 6 + include "$(BUILD_DIR)/src/elf_message/elf_message_ydan.o" + number 0 endseg +// Scene files are reordered between versions. On GameCube and iQue, dungeon scenes +// have been moved to the beginning. +#if PLATFORM_N64 + beginseg - name "object_zf" + name "ddan_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_zf/object_zf.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_scene.o" + number 2 +endseg + +beginseg + name "ddan_room_0" + compress + romalign 0x1000 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_0.o" + number 3 endseg beginseg - name "object_goma" + name "ddan_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_goma/object_goma.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_1.o" + number 3 endseg beginseg - name "object_zl1" + name "ddan_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_zl1/object_zl1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_2.o" + number 3 endseg beginseg - name "object_gol" + name "ddan_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gol/object_gol.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_3.o" + number 3 endseg beginseg - name "object_bubble" + name "ddan_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bubble/object_bubble.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_4.o" + number 3 endseg beginseg - name "object_dodojr" + name "ddan_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_dodojr/object_dodojr.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_5.o" + number 3 endseg beginseg - name "object_torch2" + name "ddan_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_torch2/object_torch2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_6.o" + number 3 endseg beginseg - name "object_bl" + name "ddan_room_7" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bl/object_bl.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_7.o" + number 3 endseg beginseg - name "object_tp" + name "ddan_room_8" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_tp/object_tp.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_8.o" + number 3 endseg beginseg - name "object_oA1" + name "ddan_room_9" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oA1/object_oA1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_9.o" + number 3 endseg beginseg - name "object_st" + name "ddan_room_10" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_st/object_st.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_10.o" + number 3 endseg beginseg - name "object_bw" + name "ddan_room_11" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bw/object_bw.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_11.o" + number 3 endseg beginseg - name "object_ei" + name "ddan_room_12" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ei/object_ei.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_12.o" + number 3 endseg beginseg - name "object_horse_normal" + name "ddan_room_13" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_horse_normal/object_horse_normal.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_13.o" + number 3 endseg beginseg - name "object_oB1" + name "ddan_room_14" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oB1/object_oB1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_14.o" + number 3 endseg beginseg - name "object_o_anime" + name "ddan_room_15" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_o_anime/object_o_anime.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_15.o" + number 3 endseg beginseg - name "object_spot04_objects" + name "ddan_room_16" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot04_objects/object_spot04_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan/ddan_room_16.o" + number 3 endseg beginseg - name "object_ddan_objects" + name "spot00_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ddan_objects/object_ddan_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot00/spot00_scene.o" + number 2 endseg beginseg - name "object_hidan_objects" + name "spot00_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_hidan_objects/object_hidan_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot00/spot00_room_0.o" + number 3 endseg beginseg - name "object_horse_ganon" + name "spot01_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_horse_ganon/object_horse_ganon.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot01/spot01_scene.o" + number 2 endseg beginseg - name "object_oA2" + name "spot01_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oA2/object_oA2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot01/spot01_room_0.o" + number 3 endseg beginseg - name "object_spot00_objects" + name "spot02_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot00_objects/object_spot00_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot02/spot02_scene.o" + number 2 endseg beginseg - name "object_mb" + name "spot02_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mb/object_mb.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot02/spot02_room_0.o" + number 3 endseg beginseg - name "object_bombf" + name "spot02_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bombf/object_bombf.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot02/spot02_room_1.o" + number 3 endseg beginseg - name "object_sk2" + name "spot03_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_sk2/object_sk2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot03/spot03_scene.o" + number 2 endseg beginseg - name "object_oE1" + name "spot03_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE1/object_oE1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot03/spot03_room_0.o" + number 3 endseg beginseg - name "object_oE_anime" + name "spot03_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE_anime/object_oE_anime.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot03/spot03_room_1.o" + number 3 endseg beginseg - name "object_oE2" + name "spot04_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE2/object_oE2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot04/spot04_scene.o" + number 2 endseg beginseg - name "object_ydan_objects" + name "spot04_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ydan_objects/object_ydan_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot04/spot04_room_0.o" + number 3 endseg beginseg - name "object_gnd" + name "spot04_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gnd/object_gnd.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot04/spot04_room_1.o" + number 3 endseg beginseg - name "object_am" + name "spot04_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_am/object_am.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot04/spot04_room_2.o" + number 3 endseg beginseg - name "object_dekubaba" + name "spot05_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_dekubaba/object_dekubaba.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot05/spot05_scene.o" + number 2 endseg beginseg - name "object_oA3" + name "spot05_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oA3/object_oA3.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot05/spot05_room_0.o" + number 3 endseg beginseg - name "object_oA4" + name "spot06_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oA4/object_oA4.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot06/spot06_scene.o" + number 2 endseg beginseg - name "object_oA5" + name "spot06_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oA5/object_oA5.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot06/spot06_room_0.o" + number 3 endseg beginseg - name "object_oA6" + name "spot07_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oA6/object_oA6.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot07/spot07_scene.o" + number 2 endseg beginseg - name "object_oA7" + name "spot07_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oA7/object_oA7.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot07/spot07_room_0.o" + number 3 endseg beginseg - name "object_jj" + name "spot07_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_jj/object_jj.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot07/spot07_room_1.o" + number 3 endseg beginseg - name "object_oA8" + name "spot08_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oA8/object_oA8.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot08/spot08_scene.o" + number 2 endseg beginseg - name "object_oA9" + name "spot08_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oA9/object_oA9.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot08/spot08_room_0.o" + number 3 endseg beginseg - name "object_oB2" + name "spot09_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oB2/object_oB2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot09/spot09_scene.o" + number 2 endseg beginseg - name "object_oB3" + name "spot09_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oB3/object_oB3.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot09/spot09_room_0.o" + number 3 endseg beginseg - name "object_oB4" + name "spot10_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oB4/object_oB4.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot10/spot10_scene.o" + number 2 endseg beginseg - name "object_horse_zelda" + name "spot10_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_horse_zelda/object_horse_zelda.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot10/spot10_room_0.o" + number 3 endseg beginseg - name "object_opening_demo1" + name "spot10_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_opening_demo1/object_opening_demo1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot10/spot10_room_1.o" + number 3 endseg beginseg - name "object_warp1" + name "spot10_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_warp1/object_warp1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot10/spot10_room_2.o" + number 3 endseg beginseg - name "object_b_heart" + name "spot10_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_b_heart/object_b_heart.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot10/spot10_room_3.o" + number 3 endseg beginseg - name "object_dekunuts" + name "spot10_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_dekunuts/object_dekunuts.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot10/spot10_room_4.o" + number 3 endseg beginseg - name "object_oE3" + name "spot10_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE3/object_oE3.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot10/spot10_room_5.o" + number 3 endseg beginseg - name "object_oE4" + name "spot10_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE4/object_oE4.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot10/spot10_room_6.o" + number 3 endseg beginseg - name "object_menkuri_objects" + name "spot10_room_7" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_menkuri_objects/object_menkuri_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot10/spot10_room_7.o" + number 3 endseg beginseg - name "object_oE5" + name "spot10_room_8" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE5/object_oE5.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot10/spot10_room_8.o" + number 3 endseg beginseg - name "object_oE6" + name "spot10_room_9" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE6/object_oE6.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot10/spot10_room_9.o" + number 3 endseg beginseg - name "object_oE7" + name "spot11_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE7/object_oE7.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot11/spot11_scene.o" + number 2 endseg beginseg - name "object_oE8" + name "spot11_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE8/object_oE8.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot11/spot11_room_0.o" + number 3 endseg beginseg - name "object_oE9" + name "spot12_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE9/object_oE9.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot12/spot12_scene.o" + number 2 endseg beginseg - name "object_oE10" + name "spot12_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE10/object_oE10.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot12/spot12_room_0.o" + number 3 endseg beginseg - name "object_oE11" + name "spot12_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE11/object_oE11.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot12/spot12_room_1.o" + number 3 endseg beginseg - name "object_oE12" + name "spot13_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE12/object_oE12.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot13/spot13_scene.o" + number 2 endseg beginseg - name "object_vali" + name "spot13_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_vali/object_vali.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot13/spot13_room_0.o" + number 3 endseg beginseg - name "object_oA10" + name "spot13_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oA10/object_oA10.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot13/spot13_room_1.o" + number 3 endseg beginseg - name "object_oA11" + name "spot15_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oA11/object_oA11.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot15/spot15_scene.o" + number 2 endseg beginseg - name "object_mizu_objects" + name "spot15_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mizu_objects/object_mizu_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot15/spot15_room_0.o" + number 3 endseg beginseg - name "object_fhg" + name "spot16_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_fhg/object_fhg.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot16/spot16_scene.o" + number 2 endseg beginseg - name "object_ossan" + name "spot16_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ossan/object_ossan.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot16/spot16_room_0.o" + number 3 endseg beginseg - name "object_mori_hineri1" + name "spot17_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mori_hineri1/object_mori_hineri1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot17/spot17_scene.o" + number 2 endseg beginseg - name "object_Bb" + name "spot17_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_Bb/object_Bb.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot17/spot17_room_0.o" + number 3 endseg beginseg - name "object_toki_objects" + name "spot17_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_toki_objects/object_toki_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot17/spot17_room_1.o" + number 3 endseg beginseg - name "object_yukabyun" + name "spot18_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_yukabyun/object_yukabyun.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot18/spot18_scene.o" + number 2 endseg beginseg - name "object_zl2" + name "spot18_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_zl2/object_zl2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot18/spot18_room_0.o" + number 3 endseg beginseg - name "object_mjin" + name "spot18_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mjin/object_mjin.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot18/spot18_room_1.o" + number 3 endseg beginseg - name "object_mjin_flash" + name "spot18_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mjin_flash/object_mjin_flash.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot18/spot18_room_2.o" + number 3 endseg beginseg - name "object_mjin_dark" + name "spot18_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mjin_dark/object_mjin_dark.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot18/spot18_room_3.o" + number 3 endseg beginseg - name "object_mjin_flame" + name "market_day_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mjin_flame/object_mjin_flame.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/market_day/market_day_scene.o" + number 2 endseg beginseg - name "object_mjin_ice" + name "market_day_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mjin_ice/object_mjin_ice.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/market_day/market_day_room_0.o" + number 3 endseg beginseg - name "object_mjin_soul" + name "market_night_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mjin_soul/object_mjin_soul.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/market_night/market_night_scene.o" + number 2 endseg beginseg - name "object_mjin_wind" + name "market_night_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mjin_wind/object_mjin_wind.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/market_night/market_night_room_0.o" + number 3 endseg beginseg - name "object_mjin_oka" + name "HIDAN_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mjin_oka/object_mjin_oka.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_scene.o" + number 2 endseg beginseg - name "object_haka_objects" + name "HIDAN_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_haka_objects/object_haka_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_0.o" + number 3 endseg beginseg - name "object_spot06_objects" + name "HIDAN_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot06_objects/object_spot06_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_1.o" + number 3 endseg beginseg - name "object_ice_objects" + name "HIDAN_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ice_objects/object_ice_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_2.o" + number 3 endseg beginseg - name "object_relay_objects" + name "HIDAN_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_relay_objects/object_relay_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_3.o" + number 3 endseg beginseg - name "object_mori_hineri1a" + name "HIDAN_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mori_hineri1a/object_mori_hineri1a.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_4.o" + number 3 endseg beginseg - name "object_mori_hineri2" + name "HIDAN_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mori_hineri2/object_mori_hineri2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_5.o" + number 3 endseg beginseg - name "object_mori_hineri2a" + name "HIDAN_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mori_hineri2a/object_mori_hineri2a.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_6.o" + number 3 endseg beginseg - name "object_mori_objects" + name "HIDAN_room_7" compress - romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mori_objects/object_mori_objects.o" - number 6 + romalign 0x1000 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_7.o" + number 3 endseg beginseg - name "object_mori_tex" + name "HIDAN_room_8" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mori_tex/object_mori_tex.o" - number 8 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_8.o" + number 3 endseg beginseg - name "object_spot08_obj" + name "HIDAN_room_9" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot08_obj/object_spot08_obj.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_9.o" + number 3 endseg beginseg - name "object_warp2" + name "HIDAN_room_10" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_warp2/object_warp2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_10.o" + number 3 endseg beginseg - name "object_hata" + name "HIDAN_room_11" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_hata/object_hata.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_11.o" + number 3 endseg beginseg - name "object_bird" + name "HIDAN_room_12" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bird/object_bird.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_12.o" + number 3 endseg beginseg - name "object_wood02" + name "HIDAN_room_13" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_wood02/object_wood02.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_13.o" + number 3 endseg beginseg - name "object_lightbox" + name "HIDAN_room_14" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_lightbox/object_lightbox.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_14.o" + number 3 endseg beginseg - name "object_pu_box" + name "HIDAN_room_15" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_pu_box/object_pu_box.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_15.o" + number 3 endseg beginseg - name "object_trap" + name "HIDAN_room_16" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_trap/object_trap.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_16.o" + number 3 endseg beginseg - name "object_vase" + name "HIDAN_room_17" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_vase/object_vase.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_17.o" + number 3 endseg beginseg - name "object_im" + name "HIDAN_room_18" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_im/object_im.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_18.o" + number 3 endseg beginseg - name "object_ta" + name "HIDAN_room_19" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ta/object_ta.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_19.o" + number 3 endseg beginseg - name "object_tk" + name "HIDAN_room_20" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_tk/object_tk.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_20.o" + number 3 endseg beginseg - name "object_xc" + name "HIDAN_room_21" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_xc/object_xc.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_21.o" + number 3 endseg beginseg - name "object_vm" + name "HIDAN_room_22" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_vm/object_vm.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_22.o" + number 3 endseg beginseg - name "object_bv" + name "HIDAN_room_23" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bv/object_bv.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_23.o" + number 3 endseg beginseg - name "object_hakach_objects" + name "HIDAN_room_24" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_hakach_objects/object_hakach_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_24.o" + number 3 endseg beginseg - name "object_efc_crystal_light" + name "HIDAN_room_25" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_efc_crystal_light/object_efc_crystal_light.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_25.o" + number 3 endseg beginseg - name "object_efc_fire_ball" + name "HIDAN_room_26" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_efc_fire_ball/object_efc_fire_ball.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HIDAN/HIDAN_room_26.o" + number 3 endseg beginseg - name "object_efc_flash" + name "Bmori1_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_efc_flash/object_efc_flash.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_scene.o" + number 2 endseg beginseg - name "object_efc_lgt_shower" + name "Bmori1_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_efc_lgt_shower/object_efc_lgt_shower.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_0.o" + number 3 endseg beginseg - name "object_efc_star_field" + name "Bmori1_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_efc_star_field/object_efc_star_field.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_1.o" + number 3 endseg beginseg - name "object_god_lgt" + name "Bmori1_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_god_lgt/object_god_lgt.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_2.o" + number 3 endseg beginseg - name "object_light_ring" + name "Bmori1_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_light_ring/object_light_ring.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_3.o" + number 3 endseg beginseg - name "object_triforce_spot" + name "Bmori1_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_triforce_spot/object_triforce_spot.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_4.o" + number 3 endseg beginseg - name "object_medal" + name "Bmori1_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_medal/object_medal.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_5.o" + number 3 endseg beginseg - name "object_bdan_objects" + name "Bmori1_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bdan_objects/object_bdan_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_6.o" + number 3 endseg beginseg - name "object_sd" + name "Bmori1_room_7" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_sd/object_sd.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_7.o" + number 3 endseg beginseg - name "object_rd" + name "Bmori1_room_8" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_rd/object_rd.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_8.o" + number 3 endseg beginseg - name "object_po_sisters" + name "Bmori1_room_9" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_po_sisters/object_po_sisters.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_9.o" + number 3 endseg beginseg - name "object_heavy_object" + name "Bmori1_room_10" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_heavy_object/object_heavy_object.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_10.o" + number 3 endseg beginseg - name "object_gndd" + name "Bmori1_room_11" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gndd/object_gndd.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_11.o" + number 3 endseg beginseg - name "object_fd" + name "Bmori1_room_12" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_fd/object_fd.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_12.o" + number 3 endseg beginseg - name "object_du" + name "Bmori1_room_13" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_du/object_du.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_13.o" + number 3 endseg beginseg - name "object_fw" + name "Bmori1_room_14" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_fw/object_fw.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_14.o" + number 3 endseg beginseg - name "object_horse_link_child" + name "Bmori1_room_15" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_horse_link_child/object_horse_link_child.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_15.o" + number 3 endseg beginseg - name "object_spot02_objects" + name "Bmori1_room_16" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot02_objects/object_spot02_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_16.o" + number 3 endseg beginseg - name "object_haka" + name "Bmori1_room_17" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_haka/object_haka.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_17.o" + number 3 endseg beginseg - name "object_ru1" + name "Bmori1_room_18" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ru1/object_ru1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_18.o" + number 3 endseg beginseg - name "object_syokudai" + name "Bmori1_room_19" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_syokudai/object_syokudai.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_19.o" + number 3 endseg beginseg - name "object_fd2" + name "Bmori1_room_20" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_fd2/object_fd2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_20.o" + number 3 endseg beginseg - name "object_dh" + name "Bmori1_room_21" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_dh/object_dh.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_21.o" + number 3 endseg beginseg - name "object_rl" + name "Bmori1_room_22" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_rl/object_rl.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/Bmori1/Bmori1_room_22.o" + number 3 endseg beginseg - name "object_efc_tw" + name "ydan_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_efc_tw/object_efc_tw.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan/ydan_scene.o" + number 2 endseg beginseg - name "object_demo_tre_lgt" + name "ydan_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_demo_tre_lgt/object_demo_tre_lgt.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan/ydan_room_0.o" + number 3 endseg beginseg - name "object_gi_key" + name "ydan_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_key/object_gi_key.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan/ydan_room_1.o" + number 3 endseg beginseg - name "object_mir_ray" + name "ydan_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mir_ray/object_mir_ray.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan/ydan_room_2.o" + number 3 endseg beginseg - name "object_brob" + name "ydan_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_brob/object_brob.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan/ydan_room_3.o" + number 3 endseg beginseg - name "object_gi_jewel" + name "ydan_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_jewel/object_gi_jewel.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan/ydan_room_4.o" + number 3 endseg beginseg - name "object_spot09_obj" + name "ydan_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot09_obj/object_spot09_obj.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan/ydan_room_5.o" + number 3 endseg beginseg - name "object_spot18_obj" + name "ydan_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot18_obj/object_spot18_obj.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan/ydan_room_6.o" + number 3 endseg beginseg - name "object_bdoor" + name "ydan_room_7" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bdoor/object_bdoor.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan/ydan_room_7.o" + number 3 endseg beginseg - name "object_spot17_obj" + name "ydan_room_8" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot17_obj/object_spot17_obj.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan/ydan_room_8.o" + number 3 endseg beginseg - name "object_shop_dungen" + name "ydan_room_9" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_shop_dungen/object_shop_dungen.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan/ydan_room_9.o" + number 3 endseg beginseg - name "object_nb" + name "ydan_room_10" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_nb/object_nb.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan/ydan_room_10.o" + number 3 endseg beginseg - name "object_mo" + name "ydan_room_11" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mo/object_mo.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan/ydan_room_11.o" + number 3 endseg beginseg - name "object_sb" + name "kenjyanoma_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_sb/object_sb.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/kenjyanoma/kenjyanoma_scene.o" + number 2 endseg beginseg - name "object_gi_melody" + name "kenjyanoma_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_melody/object_gi_melody.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/kenjyanoma/kenjyanoma_room_0.o" + number 3 endseg beginseg - name "object_gi_heart" + name "tokinoma_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_heart/object_gi_heart.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/tokinoma/tokinoma_scene.o" + number 2 endseg beginseg - name "object_gi_compass" + name "tokinoma_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_compass/object_gi_compass.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/tokinoma/tokinoma_room_0.o" + number 3 endseg beginseg - name "object_gi_bosskey" + name "tokinoma_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_bosskey/object_gi_bosskey.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/tokinoma/tokinoma_room_1.o" + number 3 endseg beginseg - name "object_gi_medal" + name "link_home_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_medal/object_gi_medal.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/link_home/link_home_scene.o" + number 2 endseg beginseg - name "object_gi_nuts" + name "link_home_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_nuts/object_gi_nuts.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/link_home/link_home_room_0.o" + number 3 endseg beginseg - name "object_sa" + name "kokiri_shop_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_sa/object_sa.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/shops/kokiri_shop/kokiri_shop_scene.o" + number 2 endseg beginseg - name "object_gi_hearts" + name "kokiri_shop_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_hearts/object_gi_hearts.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/shops/kokiri_shop/kokiri_shop_room_0.o" + number 3 endseg beginseg - name "object_gi_arrowcase" + name "MIZUsin_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_arrowcase/object_gi_arrowcase.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_scene.o" + number 2 endseg beginseg - name "object_gi_bombpouch" + name "MIZUsin_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_bombpouch/object_gi_bombpouch.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_0.o" + number 3 endseg beginseg - name "object_in" + name "MIZUsin_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_in/object_in.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_1.o" + number 3 endseg beginseg - name "object_tr" + name "MIZUsin_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_tr/object_tr.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_2.o" + number 3 endseg beginseg - name "object_spot16_obj" + name "MIZUsin_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot16_obj/object_spot16_obj.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_3.o" + number 3 endseg beginseg - name "object_oE1s" + name "MIZUsin_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE1s/object_oE1s.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_4.o" + number 3 endseg beginseg - name "object_oE4s" + name "MIZUsin_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oE4s/object_oE4s.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_5.o" + number 3 endseg beginseg - name "object_os_anime" + name "MIZUsin_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_os_anime/object_os_anime.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_6.o" + number 3 endseg beginseg - name "object_gi_bottle" + name "MIZUsin_room_7" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_bottle/object_gi_bottle.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_7.o" + number 3 endseg beginseg - name "object_gi_stick" + name "MIZUsin_room_8" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_stick/object_gi_stick.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_8.o" + number 3 endseg beginseg - name "object_gi_map" + name "MIZUsin_room_9" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_map/object_gi_map.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_9.o" + number 3 endseg beginseg - name "object_oF1d_map" + name "MIZUsin_room_10" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oF1d_map/object_oF1d_map.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_10.o" + number 3 endseg beginseg - name "object_ru2" + name "MIZUsin_room_11" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ru2/object_ru2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_11.o" + number 3 endseg beginseg - name "object_gi_shield_1" + name "MIZUsin_room_12" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_shield_1/object_gi_shield_1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_12.o" + number 3 endseg beginseg - name "object_dekujr" + name "MIZUsin_room_13" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_dekujr/object_dekujr.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_13.o" + number 3 endseg beginseg - name "object_gi_magicpot" + name "MIZUsin_room_14" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_magicpot/object_gi_magicpot.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_14.o" + number 3 endseg beginseg - name "object_gi_bomb_1" + name "MIZUsin_room_15" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_bomb_1/object_gi_bomb_1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_15.o" + number 3 endseg beginseg - name "object_oF1s" + name "MIZUsin_room_16" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_oF1s/object_oF1s.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_16.o" + number 3 endseg beginseg - name "object_ma2" + name "MIZUsin_room_17" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ma2/object_ma2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_17.o" + number 3 endseg beginseg - name "object_gi_purse" + name "MIZUsin_room_18" compress - romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_purse/object_gi_purse.o" - number 6 + romalign 0x1000 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_18.o" + number 3 endseg beginseg - name "object_hni" + name "MIZUsin_room_19" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_hni/object_hni.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_19.o" + number 3 endseg beginseg - name "object_tw" + name "MIZUsin_room_20" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_tw/object_tw.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_20.o" + number 3 endseg beginseg - name "object_rr" + name "MIZUsin_room_21" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_rr/object_rr.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_21.o" + number 3 endseg beginseg - name "object_bxa" + name "MIZUsin_room_22" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bxa/object_bxa.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin/MIZUsin_room_22.o" + number 3 endseg beginseg - name "object_anubice" + name "kokiri_home_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_anubice/object_anubice.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/kokiri_home/kokiri_home_scene.o" + number 2 endseg beginseg - name "object_gi_gerudo" + name "kokiri_home_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_gerudo/object_gi_gerudo.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/kokiri_home/kokiri_home_room_0.o" + number 3 endseg beginseg - name "object_gi_arrow" + name "kakusiana_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_arrow/object_gi_arrow.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_scene.o" + number 2 endseg beginseg - name "object_gi_bomb_2" + name "kakusiana_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_bomb_2/object_gi_bomb_2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_room_0.o" + number 3 endseg beginseg - name "object_gi_egg" + name "kakusiana_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_egg/object_gi_egg.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_room_1.o" + number 3 endseg beginseg - name "object_gi_scale" + name "kakusiana_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_scale/object_gi_scale.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_room_2.o" + number 3 endseg beginseg - name "object_gi_shield_2" + name "kakusiana_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_shield_2/object_gi_shield_2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_room_3.o" + number 3 endseg beginseg - name "object_gi_hookshot" + name "kakusiana_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_hookshot/object_gi_hookshot.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_room_4.o" + number 3 endseg beginseg - name "object_gi_ocarina" + name "kakusiana_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_ocarina/object_gi_ocarina.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_room_5.o" + number 3 endseg beginseg - name "object_gi_milk" + name "kakusiana_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_milk/object_gi_milk.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_room_6.o" + number 3 endseg beginseg - name "object_ma1" + name "kakusiana_room_7" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ma1/object_ma1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_room_7.o" + number 3 endseg beginseg - name "object_ganon" + name "kakusiana_room_8" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ganon/object_ganon.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_room_8.o" + number 3 endseg beginseg - name "object_sst" + name "kakusiana_room_9" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_sst/object_sst.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_room_9.o" + number 3 endseg beginseg - name "object_ny" + name "kakusiana_room_10" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ny/object_ny.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_room_10.o" + number 3 endseg beginseg - name "object_fr" + name "kakusiana_room_11" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_fr/object_fr.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_room_11.o" + number 3 endseg beginseg - name "object_gi_pachinko" + name "kakusiana_room_12" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_pachinko/object_gi_pachinko.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_room_12.o" + number 3 endseg beginseg - name "object_gi_boomerang" + name "kakusiana_room_13" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_boomerang/object_gi_boomerang.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/kakusiana/kakusiana_room_13.o" + number 3 endseg beginseg - name "object_gi_bow" + name "entra_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_bow/object_gi_bow.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/entra/entra_scene.o" + number 2 endseg beginseg - name "object_gi_glasses" + name "entra_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_glasses/object_gi_glasses.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/entra/entra_room_0.o" + number 3 endseg beginseg - name "object_gi_liquid" + name "bdan_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_liquid/object_gi_liquid.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_scene.o" + number 2 endseg beginseg - name "object_ani" + name "bdan_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ani/object_ani.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_0.o" + number 3 endseg beginseg - name "object_demo_6k" + name "bdan_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_demo_6k/object_demo_6k.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_1.o" + number 3 endseg beginseg - name "object_gi_shield_3" + name "bdan_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_shield_3/object_gi_shield_3.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_2.o" + number 3 endseg beginseg - name "object_gi_letter" + name "bdan_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_letter/object_gi_letter.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_3.o" + number 3 endseg beginseg - name "object_spot15_obj" + name "bdan_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot15_obj/object_spot15_obj.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_4.o" + number 3 endseg beginseg - name "object_jya_obj" + name "bdan_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_jya_obj/object_jya_obj.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_5.o" + number 3 endseg beginseg - name "object_gi_clothes" + name "bdan_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_clothes/object_gi_clothes.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_6.o" + number 3 endseg beginseg - name "object_gi_bean" + name "bdan_room_7" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_bean/object_gi_bean.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_7.o" + number 3 endseg beginseg - name "object_gi_fish" + name "bdan_room_8" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_fish/object_gi_fish.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_8.o" + number 3 endseg beginseg - name "object_gi_saw" + name "bdan_room_9" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_saw/object_gi_saw.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_9.o" + number 3 endseg beginseg - name "object_gi_hammer" + name "bdan_room_10" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_hammer/object_gi_hammer.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_10.o" + number 3 endseg beginseg - name "object_gi_grass" + name "bdan_room_11" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_grass/object_gi_grass.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_11.o" + number 3 endseg beginseg - name "object_gi_longsword" + name "bdan_room_12" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_longsword/object_gi_longsword.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_12.o" + number 3 endseg beginseg - name "object_spot01_objects" + name "bdan_room_13" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot01_objects/object_spot01_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_13.o" + number 3 endseg beginseg - name "object_md" + name "bdan_room_14" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_md/object_md.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_14.o" + number 3 endseg beginseg - name "object_km1" + name "bdan_room_15" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_km1/object_km1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan/bdan_room_15.o" + number 3 endseg beginseg - name "object_kw1" + name "HAKAdan_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_kw1/object_kw1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_scene.o" + number 2 endseg beginseg - name "object_zo" + name "HAKAdan_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_zo/object_zo.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_0.o" + number 3 endseg beginseg - name "object_kz" + name "HAKAdan_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_kz/object_kz.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_1.o" + number 3 endseg beginseg - name "object_umajump" + name "HAKAdan_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_umajump/object_umajump.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_2.o" + number 3 endseg beginseg - name "object_masterkokiri" + name "HAKAdan_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_masterkokiri/object_masterkokiri.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_3.o" + number 3 endseg beginseg - name "object_masterkokirihead" + name "HAKAdan_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_masterkokirihead/object_masterkokirihead.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_4.o" + number 3 endseg beginseg - name "object_mastergolon" + name "HAKAdan_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mastergolon/object_mastergolon.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_5.o" + number 3 endseg beginseg - name "object_masterzoora" + name "HAKAdan_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_masterzoora/object_masterzoora.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_6.o" + number 3 endseg beginseg - name "object_aob" + name "HAKAdan_room_7" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_aob/object_aob.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_7.o" + number 3 endseg beginseg - name "object_ik" + name "HAKAdan_room_8" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ik/object_ik.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_8.o" + number 3 endseg beginseg - name "object_ahg" + name "HAKAdan_room_9" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ahg/object_ahg.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_9.o" + number 3 endseg beginseg - name "object_cne" + name "HAKAdan_room_10" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_cne/object_cne.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_10.o" + number 3 endseg beginseg - name "object_gi_niwatori" + name "HAKAdan_room_11" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_niwatori/object_gi_niwatori.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_11.o" + number 3 endseg beginseg - name "object_skj" + name "HAKAdan_room_12" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_skj/object_skj.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_12.o" + number 3 endseg beginseg - name "object_gi_bottle_letter" + name "HAKAdan_room_13" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_bottle_letter/object_gi_bottle_letter.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_13.o" + number 3 endseg beginseg - name "object_bji" + name "HAKAdan_room_14" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bji/object_bji.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_14.o" + number 3 endseg beginseg - name "object_bba" + name "HAKAdan_room_15" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bba/object_bba.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_15.o" + number 3 endseg beginseg - name "object_gi_ocarina_0" + name "HAKAdan_room_16" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_ocarina_0/object_gi_ocarina_0.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_16.o" + number 3 endseg beginseg - name "object_ds" + name "HAKAdan_room_17" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ds/object_ds.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_17.o" + number 3 endseg beginseg - name "object_ane" + name "HAKAdan_room_18" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ane/object_ane.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_18.o" + number 3 endseg beginseg - name "object_boj" + name "HAKAdan_room_19" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_boj/object_boj.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_19.o" + number 3 endseg beginseg - name "object_spot03_object" + name "HAKAdan_room_20" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot03_object/object_spot03_object.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_20.o" + number 3 endseg beginseg - name "object_spot07_object" + name "HAKAdan_room_21" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot07_object/object_spot07_object.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_21.o" + number 3 endseg beginseg - name "object_fz" + name "HAKAdan_room_22" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_fz/object_fz.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan/HAKAdan_room_22.o" + number 3 endseg beginseg - name "object_bob" + name "moribossroom_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bob/object_bob.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/moribossroom/moribossroom_scene.o" + number 2 endseg beginseg - name "object_ge1" + name "moribossroom_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ge1/object_ge1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/moribossroom/moribossroom_room_0.o" + number 3 endseg beginseg - name "object_yabusame_point" + name "moribossroom_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_yabusame_point/object_yabusame_point.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/moribossroom/moribossroom_room_1.o" + number 3 endseg beginseg - name "object_gi_boots_2" + name "syatekijyou_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_boots_2/object_gi_boots_2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/syatekijyou/syatekijyou_scene.o" + number 2 endseg beginseg - name "object_gi_seed" + name "syatekijyou_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_seed/object_gi_seed.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/syatekijyou/syatekijyou_room_0.o" + number 3 endseg beginseg - name "object_gnd_magic" + name "men_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gnd_magic/object_gnd_magic.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/men/men_scene.o" + number 2 endseg beginseg - name "object_d_elevator" + name "men_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_d_elevator/object_d_elevator.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/men/men_room_0.o" + number 3 endseg beginseg - name "object_d_hsblock" + name "men_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_d_hsblock/object_d_hsblock.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/men/men_room_1.o" + number 3 endseg beginseg - name "object_d_lift" + name "men_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_d_lift/object_d_lift.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/men/men_room_2.o" + number 3 endseg beginseg - name "object_mamenoki" + name "men_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mamenoki/object_mamenoki.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/men/men_room_3.o" + number 3 endseg beginseg - name "object_goroiwa" + name "men_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_goroiwa/object_goroiwa.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/men/men_room_4.o" + number 3 endseg beginseg - name "object_toryo" + name "men_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_toryo/object_toryo.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/men/men_room_5.o" + number 3 endseg beginseg - name "object_daiku" + name "men_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_daiku/object_daiku.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/men/men_room_6.o" + number 3 endseg beginseg - name "object_nwc" + name "men_room_7" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_nwc/object_nwc.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/men/men_room_7.o" + number 3 endseg beginseg - name "object_blkobj" + name "men_room_8" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_blkobj/object_blkobj.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/men/men_room_8.o" + number 3 endseg beginseg - name "object_gm" + name "men_room_9" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gm/object_gm.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/men/men_room_9.o" + number 3 endseg beginseg - name "object_ms" + name "men_room_10" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ms/object_ms.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/men/men_room_10.o" + number 3 endseg beginseg - name "object_hs" + name "shop1_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_hs/object_hs.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/shops/shop1/shop1_scene.o" + number 2 endseg beginseg - name "object_ingate" + name "shop1_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ingate/object_ingate.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/shops/shop1/shop1_room_0.o" + number 3 endseg beginseg - name "object_lightswitch" + name "hairal_niwa_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_lightswitch/object_lightswitch.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/hairal_niwa/hairal_niwa_scene.o" + number 2 endseg beginseg - name "object_kusa" + name "hairal_niwa_room_0" compress - romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_kusa/object_kusa.o" - number 6 + romalign 0x1000 + include "$(BUILD_DIR)/assets/scenes/indoors/hairal_niwa/hairal_niwa_room_0.o" + number 3 endseg beginseg - name "object_tsubo" + name "ganon_tou_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_tsubo/object_tsubo.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/ganon_tou/ganon_tou_scene.o" + number 2 endseg beginseg - name "object_gi_gloves" + name "ganon_tou_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_gloves/object_gi_gloves.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/ganon_tou/ganon_tou_room_0.o" + number 3 endseg beginseg - name "object_gi_coin" + name "market_alley_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_coin/object_gi_coin.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/market_alley/market_alley_scene.o" + number 2 endseg beginseg - name "object_kanban" + name "market_alley_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_kanban/object_kanban.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/market_alley/market_alley_room_0.o" + number 3 endseg beginseg - name "object_gjyo_objects" + name "spot20_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gjyo_objects/object_gjyo_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot20/spot20_scene.o" + number 2 endseg beginseg - name "object_owl" + name "spot20_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_owl/object_owl.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/overworld/spot20/spot20_room_0.o" + number 3 endseg beginseg - name "object_mk" + name "market_ruins_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mk/object_mk.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/market_ruins/market_ruins_scene.o" + number 2 endseg beginseg - name "object_fu" + name "market_ruins_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_fu/object_fu.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/market_ruins/market_ruins_room_0.o" + number 3 endseg beginseg - name "object_gi_ki_tan_mask" + name "entra_n_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_ki_tan_mask/object_gi_ki_tan_mask.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/entra_n/entra_n_scene.o" + number 2 endseg beginseg - name "object_gi_redead_mask" + name "entra_n_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_redead_mask/object_gi_redead_mask.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/entra_n/entra_n_room_0.o" + number 3 endseg beginseg - name "object_gi_skj_mask" + name "enrui_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_skj_mask/object_gi_skj_mask.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/enrui/enrui_scene.o" + number 2 endseg beginseg - name "object_gi_rabit_mask" + name "enrui_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_rabit_mask/object_gi_rabit_mask.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/enrui/enrui_room_0.o" + number 3 endseg beginseg - name "object_gi_truth_mask" + name "market_alley_n_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_truth_mask/object_gi_truth_mask.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/market_alley_n/market_alley_n_scene.o" + number 2 endseg beginseg - name "object_ganon_objects" + name "market_alley_n_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ganon_objects/object_ganon_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/market_alley_n/market_alley_n_room_0.o" + number 3 endseg beginseg - name "object_siofuki" + name "hiral_demo_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_siofuki/object_siofuki.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/hiral_demo/hiral_demo_scene.o" + number 2 endseg beginseg - name "object_stream" + name "hiral_demo_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_stream/object_stream.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/hiral_demo/hiral_demo_room_0.o" + number 3 endseg beginseg - name "object_mm" + name "kokiri_home3_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mm/object_mm.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/kokiri_home3/kokiri_home3_scene.o" + number 2 endseg beginseg - name "object_fa" + name "kokiri_home3_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_fa/object_fa.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/kokiri_home3/kokiri_home3_room_0.o" + number 3 endseg beginseg - name "object_os" + name "jyasinzou_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_os/object_os.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_scene.o" + number 2 endseg beginseg - name "object_gi_eye_lotion" + name "jyasinzou_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_eye_lotion/object_gi_eye_lotion.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_0.o" + number 3 endseg beginseg - name "object_gi_powder" + name "jyasinzou_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_powder/object_gi_powder.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_1.o" + number 3 endseg beginseg - name "object_gi_mushroom" + name "jyasinzou_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_mushroom/object_gi_mushroom.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_2.o" + number 3 endseg beginseg - name "object_gi_ticketstone" + name "jyasinzou_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_ticketstone/object_gi_ticketstone.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_3.o" + number 3 endseg beginseg - name "object_gi_brokensword" + name "jyasinzou_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_brokensword/object_gi_brokensword.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_4.o" + number 3 endseg beginseg - name "object_js" + name "jyasinzou_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_js/object_js.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_5.o" + number 3 endseg beginseg - name "object_cs" + name "jyasinzou_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_cs/object_cs.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_6.o" + number 3 endseg beginseg - name "object_gi_prescription" + name "jyasinzou_room_7" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_prescription/object_gi_prescription.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_7.o" + number 3 endseg beginseg - name "object_gi_bracelet" + name "jyasinzou_room_8" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_bracelet/object_gi_bracelet.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_8.o" + number 3 endseg beginseg - name "object_gi_soldout" + name "jyasinzou_room_9" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_soldout/object_gi_soldout.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_9.o" + number 3 endseg beginseg - name "object_gi_frog" + name "jyasinzou_room_10" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_frog/object_gi_frog.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_10.o" + number 3 endseg beginseg - name "object_mag" + name "jyasinzou_room_11" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mag/object_mag.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_11.o" + number 3 endseg beginseg - name "object_door_gerudo" + name "jyasinzou_room_12" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_door_gerudo/object_door_gerudo.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_12.o" + number 3 endseg beginseg - name "object_gt" + name "jyasinzou_room_13" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gt/object_gt.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_13.o" + number 3 endseg beginseg - name "object_efc_erupc" + name "jyasinzou_room_14" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_efc_erupc/object_efc_erupc.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_14.o" + number 3 endseg beginseg - name "object_zl2_anime1" + name "jyasinzou_room_15" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_zl2_anime1/object_zl2_anime1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_15.o" + number 3 endseg beginseg - name "object_zl2_anime2" + name "jyasinzou_room_16" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_zl2_anime2/object_zl2_anime2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_16.o" + number 3 endseg beginseg - name "object_gi_golonmask" + name "jyasinzou_room_17" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_golonmask/object_gi_golonmask.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_17.o" + number 3 endseg beginseg - name "object_gi_zoramask" + name "jyasinzou_room_18" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_zoramask/object_gi_zoramask.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_18.o" + number 3 endseg beginseg - name "object_gi_gerudomask" + name "jyasinzou_room_19" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_gerudomask/object_gi_gerudomask.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_19.o" + number 3 endseg beginseg - name "object_ganon2" + name "jyasinzou_room_20" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ganon2/object_ganon2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_20.o" + number 3 endseg beginseg - name "object_ka" + name "jyasinzou_room_21" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ka/object_ka.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_21.o" + number 3 endseg beginseg - name "object_ts" + name "jyasinzou_room_22" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ts/object_ts.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_22.o" + number 3 endseg beginseg - name "object_zg" + name "jyasinzou_room_23" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_zg/object_zg.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_23.o" + number 3 endseg beginseg - name "object_gi_hoverboots" + name "jyasinzou_room_24" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_hoverboots/object_gi_hoverboots.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_24.o" + number 3 endseg beginseg - name "object_gi_m_arrow" + name "jyasinzou_room_25" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_m_arrow/object_gi_m_arrow.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_25.o" + number 3 endseg beginseg - name "object_ds2" + name "jyasinzou_room_26" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ds2/object_ds2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_26.o" + number 3 endseg beginseg - name "object_ec" + name "jyasinzou_room_27" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ec/object_ec.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_27.o" + number 3 endseg beginseg - name "object_fish" + name "jyasinzou_room_28" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_fish/object_fish.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinzou/jyasinzou_room_28.o" + number 3 endseg beginseg - name "object_gi_sutaru" + name "ice_doukutu_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_sutaru/object_gi_sutaru.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ice_doukutu/ice_doukutu_scene.o" + number 2 endseg beginseg - name "object_gi_goddess" + name "ice_doukutu_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_goddess/object_gi_goddess.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_0.o" + number 3 endseg beginseg - name "object_ssh" + name "ice_doukutu_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ssh/object_ssh.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_1.o" + number 3 endseg beginseg - name "object_bigokuta" + name "ice_doukutu_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bigokuta/object_bigokuta.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_2.o" + number 3 endseg beginseg - name "object_bg" + name "ice_doukutu_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bg/object_bg.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_3.o" + number 3 endseg beginseg - name "object_spot05_objects" + name "ice_doukutu_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot05_objects/object_spot05_objects.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_4.o" + number 3 endseg beginseg - name "object_spot12_obj" + name "ice_doukutu_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot12_obj/object_spot12_obj.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_5.o" + number 3 endseg beginseg - name "object_bombiwa" + name "ice_doukutu_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bombiwa/object_bombiwa.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_6.o" + number 3 endseg beginseg - name "object_hintnuts" + name "ice_doukutu_room_7" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_hintnuts/object_hintnuts.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_7.o" + number 3 endseg beginseg - name "object_rs" + name "ice_doukutu_room_8" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_rs/object_rs.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_8.o" + number 3 endseg beginseg - name "object_spot00_break" + name "ice_doukutu_room_9" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot00_break/object_spot00_break.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_9.o" + number 3 endseg beginseg - name "object_gla" + name "ice_doukutu_room_10" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gla/object_gla.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_10.o" + number 3 endseg beginseg - name "object_shopnuts" + name "ice_doukutu_room_11" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_shopnuts/object_shopnuts.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_11.o" + number 3 endseg beginseg - name "object_geldb" + name "malon_stable_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_geldb/object_geldb.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/malon_stable/malon_stable_scene.o" + number 2 endseg beginseg - name "object_gr" + name "malon_stable_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gr/object_gr.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/malon_stable/malon_stable_room_0.o" + number 3 endseg beginseg - name "object_dog" + name "kakariko_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_dog/object_dog.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/kakariko/kakariko_scene.o" + number 2 endseg beginseg - name "object_jya_iron" + name "kakariko_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_jya_iron/object_jya_iron.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/kakariko/kakariko_room_0.o" + number 3 endseg beginseg - name "object_jya_door" + name "bdan_boss_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_jya_door/object_jya_door.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan_boss/bdan_boss_scene.o" + number 2 endseg beginseg - name "object_spot01_objects2" + name "bdan_boss_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot01_objects2/object_spot01_objects2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan_boss/bdan_boss_room_0.o" + number 3 endseg beginseg - name "object_spot11_obj" + name "bdan_boss_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot11_obj/object_spot11_obj.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/bdan_boss/bdan_boss_room_1.o" + number 3 endseg beginseg - name "object_kibako2" + name "FIRE_bs_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_kibako2/object_kibako2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/FIRE_bs/FIRE_bs_scene.o" + number 2 endseg beginseg - name "object_dns" + name "FIRE_bs_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_dns/object_dns.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/FIRE_bs/FIRE_bs_room_0.o" + number 3 endseg beginseg - name "object_dnk" + name "FIRE_bs_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_dnk/object_dnk.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/FIRE_bs/FIRE_bs_room_1.o" + number 3 endseg beginseg - name "object_gi_fire" + name "hut_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_fire/object_gi_fire.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/hut/hut_scene.o" + number 2 endseg beginseg - name "object_gi_insect" + name "hut_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_insect/object_gi_insect.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/hut/hut_room_0.o" + number 3 endseg beginseg - name "object_gi_butterfly" + name "daiyousei_izumi_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_butterfly/object_gi_butterfly.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/daiyousei_izumi/daiyousei_izumi_scene.o" + number 2 endseg beginseg - name "object_gi_ghost" + name "daiyousei_izumi_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_ghost/object_gi_ghost.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/daiyousei_izumi/daiyousei_izumi_room_0.o" + number 3 endseg beginseg - name "object_gi_soul" + name "hakaana_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_soul/object_gi_soul.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/hakaana/hakaana_scene.o" + number 2 endseg beginseg - name "object_bowl" + name "hakaana_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bowl/object_bowl.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/misc/hakaana/hakaana_room_0.o" + number 3 endseg beginseg - name "object_po_field" + name "yousei_izumi_tate_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_po_field/object_po_field.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/yousei_izumi_tate/yousei_izumi_tate_scene.o" + number 2 endseg beginseg - name "object_demo_kekkai" + name "yousei_izumi_tate_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_demo_kekkai/object_demo_kekkai.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/yousei_izumi_tate/yousei_izumi_tate_room_0.o" + number 3 endseg beginseg - name "object_efc_doughnut" + name "yousei_izumi_yoko_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_efc_doughnut/object_efc_doughnut.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/yousei_izumi_yoko/yousei_izumi_yoko_scene.o" + number 2 endseg beginseg - name "object_gi_dekupouch" + name "yousei_izumi_yoko_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_dekupouch/object_gi_dekupouch.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/yousei_izumi_yoko/yousei_izumi_yoko_room_0.o" + number 3 endseg beginseg - name "object_ganon_anime1" + name "golon_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ganon_anime1/object_ganon_anime1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/shops/golon/golon_scene.o" + number 2 endseg beginseg - name "object_ganon_anime2" + name "golon_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ganon_anime2/object_ganon_anime2.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/shops/golon/golon_room_0.o" + number 3 endseg beginseg - name "object_ganon_anime3" + name "zoora_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ganon_anime3/object_ganon_anime3.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/shops/zoora/zoora_scene.o" + number 2 endseg beginseg - name "object_gi_rupy" + name "zoora_room_0" compress - romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_rupy/object_gi_rupy.o" - number 6 + romalign 0x1000 + include "$(BUILD_DIR)/assets/scenes/shops/zoora/zoora_room_0.o" + number 3 endseg beginseg - name "object_spot01_matoya" + name "drag_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot01_matoya/object_spot01_matoya.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/shops/drag/drag_scene.o" + number 2 endseg beginseg - name "object_spot01_matoyab" + name "drag_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_spot01_matoyab/object_spot01_matoyab.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/shops/drag/drag_room_0.o" + number 3 endseg beginseg - name "object_po_composer" + name "alley_shop_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_po_composer/object_po_composer.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/shops/alley_shop/alley_shop_scene.o" + number 2 endseg beginseg - name "object_mu" + name "alley_shop_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_mu/object_mu.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/shops/alley_shop/alley_shop_room_0.o" + number 3 endseg beginseg - name "object_wf" + name "night_shop_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_wf/object_wf.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/shops/night_shop/night_shop_scene.o" + number 2 endseg beginseg - name "object_skb" + name "night_shop_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_skb/object_skb.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/shops/night_shop/night_shop_room_0.o" + number 3 endseg beginseg - name "object_gj" + name "impa_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gj/object_gj.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/impa/impa_scene.o" + number 2 endseg beginseg - name "object_geff" + name "impa_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_geff/object_geff.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/impa/impa_room_0.o" + number 3 endseg beginseg - name "object_haka_door" + name "labo_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_haka_door/object_haka_door.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/labo/labo_scene.o" + number 2 endseg beginseg - name "object_gs" + name "labo_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gs/object_gs.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/labo/labo_room_0.o" + number 3 endseg beginseg - name "object_ps" + name "tent_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ps/object_ps.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/tent/tent_scene.o" + number 2 endseg beginseg - name "object_bwall" + name "tent_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_bwall/object_bwall.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/tent/tent_room_0.o" + number 3 endseg beginseg - name "object_crow" + name "nakaniwa_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_crow/object_crow.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/nakaniwa/nakaniwa_scene.o" + number 2 endseg beginseg - name "object_cow" + name "nakaniwa_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_cow/object_cow.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/indoors/nakaniwa/nakaniwa_room_0.o" + number 3 endseg beginseg - name "object_cob" + name "ddan_boss_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_cob/object_cob.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan_boss/ddan_boss_scene.o" + number 2 endseg beginseg - name "object_gi_sword_1" + name "ddan_boss_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_gi_sword_1/object_gi_sword_1.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan_boss/ddan_boss_room_0.o" + number 3 endseg beginseg - name "object_door_killer" + name "ddan_boss_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_door_killer/object_door_killer.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ddan_boss/ddan_boss_room_1.o" + number 3 endseg beginseg - name "object_ouke_haka" + name "ydan_boss_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_ouke_haka/object_ouke_haka.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan_boss/ydan_boss_scene.o" + number 2 endseg beginseg - name "object_timeblock" + name "ydan_boss_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_timeblock/object_timeblock.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan_boss/ydan_boss_room_0.o" + number 3 endseg beginseg - name "object_zl4" + name "ydan_boss_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/objects/object_zl4/object_zl4.o" - number 6 + include "$(BUILD_DIR)/assets/scenes/dungeons/ydan_boss/ydan_boss_room_1.o" + number 3 endseg beginseg - name "g_pn_01" + name "HAKAdan_bs_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_01.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan_bs/HAKAdan_bs_scene.o" + number 2 endseg beginseg - name "g_pn_02" + name "HAKAdan_bs_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_02.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan_bs/HAKAdan_bs_room_0.o" + number 3 endseg beginseg - name "g_pn_03" + name "HAKAdan_bs_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_03.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdan_bs/HAKAdan_bs_room_1.o" + number 3 endseg beginseg - name "g_pn_04" + name "MIZUsin_bs_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_04.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin_bs/MIZUsin_bs_scene.o" + number 2 endseg beginseg - name "g_pn_05" + name "MIZUsin_bs_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_05.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin_bs/MIZUsin_bs_room_0.o" + number 3 endseg beginseg - name "g_pn_06" + name "MIZUsin_bs_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_06.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/MIZUsin_bs/MIZUsin_bs_room_1.o" + number 3 endseg beginseg - name "g_pn_07" + name "ganon_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_07.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon/ganon_scene.o" + number 2 endseg beginseg - name "g_pn_08" + name "ganon_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_08.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon/ganon_room_0.o" + number 3 endseg beginseg - name "g_pn_09" + name "ganon_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_09.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon/ganon_room_1.o" + number 3 endseg beginseg - name "g_pn_10" + name "ganon_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_10.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon/ganon_room_2.o" + number 3 endseg beginseg - name "g_pn_11" + name "ganon_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_11.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon/ganon_room_3.o" + number 3 endseg beginseg - name "g_pn_12" + name "ganon_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_12.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon/ganon_room_4.o" + number 3 endseg beginseg - name "g_pn_13" + name "ganon_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_13.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon/ganon_room_5.o" + number 3 endseg beginseg - name "g_pn_14" + name "ganon_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_14.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon/ganon_room_6.o" + number 3 endseg beginseg - name "g_pn_15" + name "ganon_room_7" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_15.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon/ganon_room_7.o" + number 3 endseg beginseg - name "g_pn_16" + name "ganon_room_8" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_16.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon/ganon_room_8.o" + number 3 endseg beginseg - name "g_pn_17" + name "ganon_room_9" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_17.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon/ganon_room_9.o" + number 3 endseg beginseg - name "g_pn_18" + name "ganon_boss_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_18.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon_boss/ganon_boss_scene.o" + number 2 endseg beginseg - name "g_pn_19" + name "ganon_boss_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_19.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon_boss/ganon_boss_room_0.o" + number 3 endseg beginseg - name "g_pn_20" + name "jyasinboss_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_20.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinboss/jyasinboss_scene.o" + number 2 endseg beginseg - name "g_pn_21" + name "jyasinboss_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_21.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinboss/jyasinboss_room_0.o" + number 3 endseg beginseg - name "g_pn_22" + name "jyasinboss_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_22.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinboss/jyasinboss_room_1.o" + number 3 endseg beginseg - name "g_pn_23" + name "jyasinboss_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_23.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinboss/jyasinboss_room_2.o" + number 3 endseg beginseg - name "g_pn_24" + name "jyasinboss_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_24.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/jyasinboss/jyasinboss_room_3.o" + number 3 endseg beginseg - name "g_pn_25" + name "kokiri_home4_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_25.o" + include "$(BUILD_DIR)/assets/scenes/indoors/kokiri_home4/kokiri_home4_scene.o" + number 2 endseg beginseg - name "g_pn_26" + name "kokiri_home4_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_26.o" + include "$(BUILD_DIR)/assets/scenes/indoors/kokiri_home4/kokiri_home4_room_0.o" + number 3 endseg beginseg - name "g_pn_27" + name "kokiri_home5_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_27.o" + include "$(BUILD_DIR)/assets/scenes/indoors/kokiri_home5/kokiri_home5_scene.o" + number 2 endseg beginseg - name "g_pn_28" + name "kokiri_home5_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_28.o" + include "$(BUILD_DIR)/assets/scenes/indoors/kokiri_home5/kokiri_home5_room_0.o" + number 3 endseg beginseg - name "g_pn_29" + name "ganon_final_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_29.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon_final/ganon_final_scene.o" + number 2 endseg beginseg - name "g_pn_30" + name "ganon_final_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_30.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon_final/ganon_final_room_0.o" + number 3 endseg beginseg - name "g_pn_31" + name "kakariko3_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_31.o" + include "$(BUILD_DIR)/assets/scenes/misc/kakariko3/kakariko3_scene.o" + number 2 endseg beginseg - name "g_pn_32" + name "kakariko3_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_32.o" + include "$(BUILD_DIR)/assets/scenes/misc/kakariko3/kakariko3_room_0.o" + number 3 endseg beginseg - name "g_pn_33" + name "hakasitarelay_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_33.o" + include "$(BUILD_DIR)/assets/scenes/indoors/hakasitarelay/hakasitarelay_scene.o" + number 2 endseg beginseg - name "g_pn_34" + name "hakasitarelay_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_34.o" + include "$(BUILD_DIR)/assets/scenes/indoors/hakasitarelay/hakasitarelay_room_0.o" + number 3 endseg beginseg - name "g_pn_35" + name "hakasitarelay_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_35.o" + include "$(BUILD_DIR)/assets/scenes/indoors/hakasitarelay/hakasitarelay_room_1.o" + number 3 endseg beginseg - name "g_pn_36" + name "hakasitarelay_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_36.o" + include "$(BUILD_DIR)/assets/scenes/indoors/hakasitarelay/hakasitarelay_room_2.o" + number 3 endseg beginseg - name "g_pn_37" + name "hakasitarelay_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_37.o" + include "$(BUILD_DIR)/assets/scenes/indoors/hakasitarelay/hakasitarelay_room_3.o" + number 3 endseg beginseg - name "g_pn_38" + name "hakasitarelay_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_38.o" + include "$(BUILD_DIR)/assets/scenes/indoors/hakasitarelay/hakasitarelay_room_4.o" + number 3 endseg beginseg - name "g_pn_39" + name "hakasitarelay_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_39.o" + include "$(BUILD_DIR)/assets/scenes/indoors/hakasitarelay/hakasitarelay_room_5.o" + number 3 endseg beginseg - name "g_pn_40" + name "hakasitarelay_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_40.o" + include "$(BUILD_DIR)/assets/scenes/indoors/hakasitarelay/hakasitarelay_room_6.o" + number 3 endseg beginseg - name "g_pn_41" + name "shrine_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_41.o" + include "$(BUILD_DIR)/assets/scenes/misc/shrine/shrine_scene.o" + number 2 endseg beginseg - name "g_pn_42" + name "shrine_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_42.o" + include "$(BUILD_DIR)/assets/scenes/misc/shrine/shrine_room_0.o" + number 3 endseg beginseg - name "g_pn_43" + name "turibori_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_43.o" + include "$(BUILD_DIR)/assets/scenes/misc/turibori/turibori_scene.o" + number 2 endseg beginseg - name "g_pn_44" + name "turibori_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_44.o" + include "$(BUILD_DIR)/assets/scenes/misc/turibori/turibori_room_0.o" + number 3 endseg beginseg - name "g_pn_45" + name "shrine_n_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_45.o" + include "$(BUILD_DIR)/assets/scenes/misc/shrine_n/shrine_n_scene.o" + number 2 endseg beginseg - name "g_pn_46" + name "shrine_n_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_46.o" + include "$(BUILD_DIR)/assets/scenes/misc/shrine_n/shrine_n_room_0.o" + number 3 endseg beginseg - name "g_pn_47" + name "shrine_r_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_47.o" + include "$(BUILD_DIR)/assets/scenes/misc/shrine_r/shrine_r_scene.o" + number 2 endseg beginseg - name "g_pn_48" + name "shrine_r_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_48.o" + include "$(BUILD_DIR)/assets/scenes/misc/shrine_r/shrine_r_room_0.o" + number 3 endseg beginseg - name "g_pn_49" + name "ganontika_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_49.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_scene.o" + number 2 endseg beginseg - name "g_pn_50" + name "ganontika_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_50.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_0.o" + number 3 endseg beginseg - name "g_pn_51" + name "ganontika_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_51.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_1.o" + number 3 endseg beginseg - name "g_pn_52" + name "ganontika_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_52.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_2.o" + number 3 endseg beginseg - name "g_pn_53" + name "ganontika_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_53.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_3.o" + number 3 endseg beginseg - name "g_pn_54" + name "ganontika_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_54.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_4.o" + number 3 endseg beginseg - name "g_pn_55" + name "ganontika_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_55.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_5.o" + number 3 endseg beginseg - name "g_pn_56" + name "ganontika_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_56.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_6.o" + number 3 endseg beginseg - name "g_pn_57" + name "ganontika_room_7" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/place_title_cards/g_pn_57.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_7.o" + number 3 endseg beginseg - name "z_select_static" + name "ganontika_room_8" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/misc/z_select_static/z_select_static.o" - number 1 + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_8.o" + number 3 endseg beginseg - name "nintendo_rogo_static" + name "ganontika_room_9" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/nintendo_rogo_static/nintendo_rogo_static.o" - number 1 + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_9.o" + number 3 endseg beginseg - name "title_static" + name "ganontika_room_10" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/title_static/title_static.o" - number 1 + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_10.o" + number 3 endseg beginseg - name "parameter_static" + name "ganontika_room_11" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/parameter_static/parameter_static.o" - number 2 + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_11.o" + number 3 endseg beginseg - name "vr_fine0_static" + name "ganontika_room_12" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine0_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_12.o" + number 3 endseg beginseg - name "vr_fine0_pal_static" + name "ganontika_room_13" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine0_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_13.o" + number 3 endseg beginseg - name "vr_fine1_static" + name "ganontika_room_14" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine1_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_14.o" + number 3 endseg beginseg - name "vr_fine1_pal_static" + name "ganontika_room_15" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine1_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_15.o" + number 3 endseg beginseg - name "vr_fine2_static" + name "ganontika_room_16" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine2_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_16.o" + number 3 endseg beginseg - name "vr_fine2_pal_static" + name "ganontika_room_17" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine2_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_17.o" + number 3 endseg beginseg - name "vr_fine3_static" + name "ganontika_room_18" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine3_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_18.o" + number 3 endseg beginseg - name "vr_fine3_pal_static" + name "ganontika_room_19" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_fine3_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontika/ganontika_room_19.o" + number 3 endseg beginseg - name "vr_cloud0_static" + name "hakaana2_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud0_static.o" + include "$(BUILD_DIR)/assets/scenes/misc/hakaana2/hakaana2_scene.o" + number 2 endseg beginseg - name "vr_cloud0_pal_static" + name "hakaana2_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud0_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/misc/hakaana2/hakaana2_room_0.o" + number 3 endseg beginseg - name "vr_cloud1_static" + name "gerudoway_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud1_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/gerudoway/gerudoway_scene.o" + number 2 endseg beginseg - name "vr_cloud1_pal_static" + name "gerudoway_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud1_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/gerudoway/gerudoway_room_0.o" + number 3 endseg beginseg - name "vr_cloud2_static" + name "gerudoway_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud2_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/gerudoway/gerudoway_room_1.o" + number 3 endseg beginseg - name "vr_cloud2_pal_static" + name "gerudoway_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud2_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/gerudoway/gerudoway_room_2.o" + number 3 endseg beginseg - name "vr_cloud3_static" + name "gerudoway_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud3_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/gerudoway/gerudoway_room_3.o" + number 3 endseg beginseg - name "vr_cloud3_pal_static" + name "gerudoway_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_cloud3_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/gerudoway/gerudoway_room_4.o" + number 3 endseg beginseg - name "vr_holy0_static" + name "gerudoway_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_holy0_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/gerudoway/gerudoway_room_5.o" + number 3 endseg beginseg - name "vr_holy0_pal_static" + name "HAKAdanCH_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_holy0_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_scene.o" + number 2 endseg beginseg - name "vr_holy1_static" + name "HAKAdanCH_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_holy1_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_room_0.o" + number 3 endseg beginseg - name "vr_holy1_pal_static" + name "HAKAdanCH_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/skyboxes/vr_holy1_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_room_1.o" + number 3 endseg beginseg - name "vr_MDVR_static" + name "HAKAdanCH_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_MDVR_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_room_2.o" + number 3 endseg beginseg - name "vr_MDVR_pal_static" + name "HAKAdanCH_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_MDVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_room_3.o" + number 3 endseg beginseg - name "vr_MNVR_static" + name "HAKAdanCH_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_MNVR_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_room_4.o" + number 3 endseg beginseg - name "vr_MNVR_pal_static" + name "HAKAdanCH_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_MNVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_room_5.o" + number 3 endseg beginseg - name "vr_RUVR_static" + name "HAKAdanCH_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_RUVR_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_room_6.o" + number 3 endseg beginseg - name "vr_RUVR_pal_static" + name "hairal_niwa_n_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_RUVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/hairal_niwa_n/hairal_niwa_n_scene.o" + number 2 endseg beginseg - name "vr_LHVR_static" + name "hairal_niwa_n_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_LHVR_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/hairal_niwa_n/hairal_niwa_n_room_0.o" + number 3 endseg beginseg - name "vr_LHVR_pal_static" + name "bowling_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_LHVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/bowling/bowling_scene.o" + number 2 endseg beginseg - name "vr_KHVR_static" + name "bowling_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KHVR_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/bowling/bowling_room_0.o" + number 3 endseg beginseg - name "vr_KHVR_pal_static" + name "hakaana_ouke_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KHVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/misc/hakaana_ouke/hakaana_ouke_scene.o" + number 2 endseg beginseg - name "vr_K3VR_static" + name "hakaana_ouke_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_K3VR_static.o" + include "$(BUILD_DIR)/assets/scenes/misc/hakaana_ouke/hakaana_ouke_room_0.o" + number 3 endseg beginseg - name "vr_K3VR_pal_static" + name "hakaana_ouke_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_K3VR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/misc/hakaana_ouke/hakaana_ouke_room_1.o" + number 3 endseg beginseg - name "vr_K4VR_static" + name "hakaana_ouke_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_K4VR_static.o" + include "$(BUILD_DIR)/assets/scenes/misc/hakaana_ouke/hakaana_ouke_room_2.o" + number 3 endseg beginseg - name "vr_K4VR_pal_static" + name "hylia_labo_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_K4VR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/hylia_labo/hylia_labo_scene.o" + number 2 endseg beginseg - name "vr_K5VR_static" + name "hylia_labo_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_K5VR_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/hylia_labo/hylia_labo_room_0.o" + number 3 endseg beginseg - name "vr_K5VR_pal_static" + name "souko_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_K5VR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/souko/souko_scene.o" + number 2 endseg beginseg - name "vr_SP1a_static" + name "souko_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_SP1a_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/souko/souko_room_0.o" + number 3 endseg beginseg - name "vr_SP1a_pal_static" + name "souko_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_SP1a_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/souko/souko_room_1.o" + number 3 endseg beginseg - name "vr_MLVR_static" + name "souko_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_MLVR_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/souko/souko_room_2.o" + number 3 endseg beginseg - name "vr_MLVR_pal_static" + name "miharigoya_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_MLVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/miharigoya/miharigoya_scene.o" + number 2 endseg beginseg - name "vr_KKRVR_static" + name "miharigoya_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KKRVR_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/miharigoya/miharigoya_room_0.o" + number 3 endseg beginseg - name "vr_KKRVR_pal_static" + name "mahouya_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KKRVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/mahouya/mahouya_scene.o" + number 2 endseg beginseg - name "vr_KR3VR_static" + name "mahouya_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KR3VR_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/mahouya/mahouya_room_0.o" + number 3 endseg beginseg - name "vr_KR3VR_pal_static" + name "takaraya_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KR3VR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/takaraya/takaraya_scene.o" + number 2 endseg beginseg - name "vr_IPVR_static" + name "takaraya_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_IPVR_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/takaraya/takaraya_room_0.o" + number 3 endseg beginseg - name "vr_IPVR_pal_static" + name "takaraya_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_IPVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/takaraya/takaraya_room_1.o" + number 3 endseg beginseg - name "vr_KSVR_static" + name "takaraya_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KSVR_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/takaraya/takaraya_room_2.o" + number 3 endseg beginseg - name "vr_KSVR_pal_static" + name "takaraya_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_KSVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/takaraya/takaraya_room_3.o" + number 3 endseg beginseg - name "vr_GLVR_static" + name "takaraya_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_GLVR_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/takaraya/takaraya_room_4.o" + number 3 endseg beginseg - name "vr_GLVR_pal_static" + name "takaraya_room_5" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_GLVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/takaraya/takaraya_room_5.o" + number 3 endseg beginseg - name "vr_ZRVR_static" + name "takaraya_room_6" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_ZRVR_static.o" + include "$(BUILD_DIR)/assets/scenes/indoors/takaraya/takaraya_room_6.o" + number 3 endseg beginseg - name "vr_ZRVR_pal_static" + name "ganon_sonogo_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_ZRVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon_sonogo/ganon_sonogo_scene.o" + number 2 endseg beginseg - name "vr_DGVR_static" + name "ganon_sonogo_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_DGVR_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon_sonogo/ganon_sonogo_room_0.o" + number 3 endseg beginseg - name "vr_DGVR_pal_static" + name "ganon_sonogo_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_DGVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon_sonogo/ganon_sonogo_room_1.o" + number 3 endseg beginseg - name "vr_ALVR_static" + name "ganon_sonogo_room_2" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_ALVR_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon_sonogo/ganon_sonogo_room_2.o" + number 3 endseg beginseg - name "vr_ALVR_pal_static" + name "ganon_sonogo_room_3" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_ALVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon_sonogo/ganon_sonogo_room_3.o" + number 3 endseg beginseg - name "vr_NSVR_static" + name "ganon_sonogo_room_4" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_NSVR_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon_sonogo/ganon_sonogo_room_4.o" + number 3 endseg beginseg - name "vr_NSVR_pal_static" + name "ganon_demo_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_NSVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon_demo/ganon_demo_scene.o" + number 2 endseg beginseg - name "vr_LBVR_static" + name "ganon_demo_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_LBVR_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganon_demo/ganon_demo_room_0.o" + number 3 endseg beginseg - name "vr_LBVR_pal_static" + name "face_shop_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_LBVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/shops/face_shop/face_shop_scene.o" + number 2 endseg beginseg - name "vr_TTVR_static" + name "face_shop_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_TTVR_static.o" + include "$(BUILD_DIR)/assets/scenes/shops/face_shop/face_shop_room_0.o" + number 3 endseg beginseg - name "vr_TTVR_pal_static" + name "kinsuta_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_TTVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/misc/kinsuta/kinsuta_scene.o" + number 2 endseg beginseg - name "vr_FCVR_static" + name "kinsuta_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_FCVR_static.o" + include "$(BUILD_DIR)/assets/scenes/misc/kinsuta/kinsuta_room_0.o" + number 3 endseg beginseg - name "vr_FCVR_pal_static" + name "ganontikasonogo_scene" compress romalign 0x1000 - include "$(BUILD_DIR)/assets/textures/backgrounds/vr_FCVR_pal_static.o" + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontikasonogo/ganontikasonogo_scene.o" + number 2 endseg beginseg - name "elf_message_field" + name "ganontikasonogo_room_0" compress romalign 0x1000 - include "$(BUILD_DIR)/src/elf_message/elf_message_field.o" - number 0 + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontikasonogo/ganontikasonogo_room_0.o" + number 3 endseg beginseg - name "elf_message_ydan" + name "ganontikasonogo_room_1" compress romalign 0x1000 - include "$(BUILD_DIR)/src/elf_message/elf_message_ydan.o" - number 0 + include "$(BUILD_DIR)/assets/scenes/dungeons/ganontikasonogo/ganontikasonogo_room_1.o" + number 3 endseg +#else + beginseg name "ydan_scene" compress @@ -12099,6 +19624,8 @@ beginseg number 3 endseg +#endif + #if CAN_INCLUDE_TEST_SCENES beginseg name "test01_scene" diff --git a/src/audio/data.c b/src/audio/data.c index 422ad83f57..ddaf03fd7e 100644 --- a/src/audio/data.c +++ b/src/audio/data.c @@ -67,3 +67,5 @@ u8 gSoundModeList[] = { u8 gAudioSpecId = 0; u8 D_80133418 = 0; + +u8 D_8016F0E0[0xA0]; // unused diff --git a/src/audio/debug.inc.c b/src/audio/debug.inc.c index 5af3030f39..29fbd50a3c 100644 --- a/src/audio/debug.inc.c +++ b/src/audio/debug.inc.c @@ -1,9 +1,3 @@ -u32 sDebugPadHold; -u32 sDebugPadBtnLast; -u32 sDebugPadPress; -s32 sAudioUpdateTaskStart; -s32 sAudioUpdateTaskEnd; - f32 D_80131C8C = 0.0f; f32 sAudioUpdateDuration = 0.0f; f32 sAudioUpdateDurationMax = 0.0f; diff --git a/src/audio/general.c b/src/audio/general.c index 176bb7e530..2a25e17bb8 100644 --- a/src/audio/general.c +++ b/src/audio/general.c @@ -1,9 +1,18 @@ #include "ultra64.h" #include "global.h" +#include "versions.h" #define ABS_ALT(x) ((x) < 0 ? -(x) : (x)) -typedef struct { +#if !PLATFORM_N64 +#define AUDIO_PRINTF osSyncPrintf +#elif IDO_PRINTF_WORKAROUND +#define AUDIO_PRINTF(args) (void)0 +#else +#define AUDIO_PRINTF(format, ...) (void)0 +#endif + +typedef struct SfxPlayerState { /* 0x0 */ f32 vol; /* 0x4 */ f32 freqScale; /* 0x8 */ s8 reverb; @@ -13,7 +22,7 @@ typedef struct { /* 0xC */ u8 combFilterGain; } SfxPlayerState; -typedef enum { +typedef enum SfxChannelIndex { /* 0x0 */ SFX_CHANNEL_PLAYER0, // SfxPlayerBank /* 0x1 */ SFX_CHANNEL_PLAYER1, /* 0x2 */ SFX_CHANNEL_PLAYER2, @@ -32,20 +41,20 @@ typedef enum { /* 0xF */ SFX_CHANNEL_VOICE1 } SfxChannelIndex; // playerIdx = 2 -typedef struct { +typedef struct FreqLerp { /* 0x0 */ f32 value; /* 0x4 */ f32 target; /* 0x8 */ f32 step; /* 0xC */ s32 remainingFrames; } FreqLerp; -typedef struct { +typedef struct NatureAmbienceDataIO { /* 0x0 */ u16 playerIO; /* 0x2 */ u16 channelMask; /* 0x4 */ u8 channelIO[3 * 33 + 1]; } NatureAmbienceDataIO; // size = 0x68 -typedef enum { +typedef enum AudioDebugPage { /* 0x0 */ PAGE_NON, /* 0x1 */ PAGE_SOUND_CONTROL, /* 0x2 */ PAGE_SPEC_INFO, // unused @@ -66,12 +75,36 @@ typedef enum { #define SCROLL_PRINT_BUF_SIZE 25 -typedef struct { +typedef struct OcarinaStick { s8 x; s8 y; } OcarinaStick; -u8 gIsLargeSfxBank[7] = { 0, 0, 0, 1, 0, 0, 0 }; +#define DEFINE_SFX(_0, _1, _2, _3, _4, _5) 1 + +u8 gIsLargeSfxBank[7] = { + ( +#include "tables/sfx/playerbank_table.h" + 0) > UINT8_MAX, + ( +#include "tables/sfx/itembank_table.h" + 0) > UINT8_MAX, + ( +#include "tables/sfx/environmentbank_table.h" + 0) > UINT8_MAX, + ( +#include "tables/sfx/enemybank_table.h" + 0) > UINT8_MAX, + ( +#include "tables/sfx/systembank_table.h" + 0) > UINT8_MAX, + ( +#include "tables/sfx/ocarinabank_table.h" + 0) > UINT8_MAX, + ( +#include "tables/sfx/voicebank_table.h" + 0) > UINT8_MAX, +}; +#undef DEFINE_SFX // Only the first row of these is supported by sequence 0. (gSfxChannelLayout is always 0.) u8 gChannelsPerBank[4][7] = { @@ -160,118 +193,13 @@ u8 sSeqModeInput = 0; #define SEQ_FLAG_SKIP_HARP_INTRO (1 << 6) #define SEQ_FLAG_NO_AMBIENCE (1 << 7) +#define DEFINE_SEQUENCE(name, seqId, storageMedium, cachePolicy, seqFlags) seqFlags, +#define DEFINE_SEQUENCE_PTR(seqIdReal, seqId, storageMediumReal, cachePolicyReal, seqFlags) seqFlags, u8 sSeqFlags[] = { - SEQ_FLAG_FANFARE, // NA_BGM_GENERAL_SFX - SEQ_FLAG_ENEMY, // NA_BGM_NATURE_BACKGROUND - 0, // NA_BGM_FIELD_LOGIC - 0, // NA_BGM_FIELD_INIT - 0, // NA_BGM_FIELD_DEFAULT_1 - 0, // NA_BGM_FIELD_DEFAULT_2 - 0, // NA_BGM_FIELD_DEFAULT_3 - 0, // NA_BGM_FIELD_DEFAULT_4 - 0, // NA_BGM_FIELD_DEFAULT_5 - 0, // NA_BGM_FIELD_DEFAULT_6 - 0, // NA_BGM_FIELD_DEFAULT_7 - 0, // NA_BGM_FIELD_DEFAULT_8 - 0, // NA_BGM_FIELD_DEFAULT_9 - 0, // NA_BGM_FIELD_DEFAULT_A - 0, // NA_BGM_FIELD_DEFAULT_B - 0, // NA_BGM_FIELD_ENEMY_INIT - 0, // NA_BGM_FIELD_ENEMY_1 - 0, // NA_BGM_FIELD_ENEMY_2 - 0, // NA_BGM_FIELD_ENEMY_3 - 0, // NA_BGM_FIELD_ENEMY_4 - 0, // NA_BGM_FIELD_STILL_1 - 0, // NA_BGM_FIELD_STILL_2 - 0, // NA_BGM_FIELD_STILL_3 - 0, // NA_BGM_FIELD_STILL_4 - SEQ_FLAG_RESUME_PREV | SEQ_FLAG_ENEMY, // NA_BGM_DUNGEON - SEQ_FLAG_RESUME, // NA_BGM_KAKARIKO_ADULT - 0, // NA_BGM_ENEMY - SEQ_FLAG_NO_AMBIENCE | SEQ_FLAG_RESTORE, // NA_BGM_BOSS - SEQ_FLAG_ENEMY, // NA_BGM_INSIDE_DEKU_TREE - 0, // NA_BGM_MARKET - 0, // NA_BGM_TITLE - SEQ_FLAG_RESUME_PREV, // NA_BGM_LINK_HOUSE - 0, // NA_BGM_GAME_OVER - 0, // NA_BGM_BOSS_CLEAR - SEQ_FLAG_FANFARE, // NA_BGM_ITEM_GET - SEQ_FLAG_FANFARE_GANON, // NA_BGM_OPENING_GANON - SEQ_FLAG_FANFARE, // NA_BGM_HEART_GET - SEQ_FLAG_FANFARE, // NA_BGM_OCA_LIGHT - SEQ_FLAG_ENEMY, // NA_BGM_JABU_JABU - SEQ_FLAG_RESUME, // NA_BGM_KAKARIKO_KID - 0, // NA_BGM_GREAT_FAIRY - 0, // NA_BGM_ZELDA_THEME - SEQ_FLAG_ENEMY, // NA_BGM_FIRE_TEMPLE - SEQ_FLAG_FANFARE, // NA_BGM_OPEN_TRE_BOX - SEQ_FLAG_ENEMY, // NA_BGM_FOREST_TEMPLE - 0, // NA_BGM_COURTYARD - SEQ_FLAG_NO_AMBIENCE, // NA_BGM_GANON_TOWER - 0, // NA_BGM_LONLON - SEQ_FLAG_NO_AMBIENCE, // NA_BGM_GORON_CITY - 0, // NA_BGM_FIELD_MORNING - SEQ_FLAG_FANFARE, // NA_BGM_SPIRITUAL_STONE - SEQ_FLAG_FANFARE, // NA_BGM_OCA_BOLERO - SEQ_FLAG_FANFARE, // NA_BGM_OCA_MINUET - SEQ_FLAG_FANFARE, // NA_BGM_OCA_SERENADE - SEQ_FLAG_FANFARE, // NA_BGM_OCA_REQUIEM - SEQ_FLAG_FANFARE, // NA_BGM_OCA_NOCTURNE - SEQ_FLAG_NO_AMBIENCE | SEQ_FLAG_RESTORE, // NA_BGM_MINI_BOSS - SEQ_FLAG_FANFARE, // NA_BGM_SMALL_ITEM_GET - 0, // NA_BGM_TEMPLE_OF_TIME - SEQ_FLAG_FANFARE, // NA_BGM_EVENT_CLEAR - SEQ_FLAG_RESUME | SEQ_FLAG_ENEMY, // NA_BGM_KOKIRI - SEQ_FLAG_FANFARE, // NA_BGM_OCA_FAIRY_GET - SEQ_FLAG_ENEMY, // NA_BGM_SARIA_THEME - SEQ_FLAG_ENEMY, // NA_BGM_SPIRIT_TEMPLE - 0, // NA_BGM_HORSE - 0, // NA_BGM_HORSE_GOAL - 0, // NA_BGM_INGO - SEQ_FLAG_FANFARE, // NA_BGM_MEDALLION_GET - SEQ_FLAG_FANFARE, // NA_BGM_OCA_SARIA - SEQ_FLAG_FANFARE, // NA_BGM_OCA_EPONA - SEQ_FLAG_FANFARE, // NA_BGM_OCA_ZELDA - SEQ_FLAG_FANFARE, // NA_BGM_OCA_SUNS - SEQ_FLAG_FANFARE, // NA_BGM_OCA_TIME - SEQ_FLAG_FANFARE, // NA_BGM_OCA_STORM - 0, // NA_BGM_NAVI_OPENING - 0, // NA_BGM_DEKU_TREE_CS - 0, // NA_BGM_WINDMILL - 0, // NA_BGM_HYRULE_CS - SEQ_FLAG_RESUME_PREV, // NA_BGM_MINI_GAME - 0, // NA_BGM_SHEIK - SEQ_FLAG_RESUME, // NA_BGM_ZORA_DOMAIN - SEQ_FLAG_FANFARE, // NA_BGM_APPEAR - 0, // NA_BGM_ADULT_LINK - 0, // NA_BGM_MASTER_SWORD - SEQ_FLAG_FANFARE_GANON, // NA_BGM_INTRO_GANON - SEQ_FLAG_RESUME_PREV, // NA_BGM_SHOP - SEQ_FLAG_SKIP_HARP_INTRO, // NA_BGM_CHAMBER_OF_SAGES - SEQ_FLAG_SKIP_HARP_INTRO, // NA_BGM_FILE_SELECT - SEQ_FLAG_ENEMY, // NA_BGM_ICE_CAVERN - SEQ_FLAG_FANFARE, // NA_BGM_DOOR_OF_TIME - SEQ_FLAG_FANFARE, // NA_BGM_OWL - SEQ_FLAG_ENEMY, // NA_BGM_SHADOW_TEMPLE - SEQ_FLAG_ENEMY, // NA_BGM_WATER_TEMPLE - SEQ_FLAG_FANFARE, // NA_BGM_BRIDGE_TO_GANONS - 0, // NA_BGM_OCARINA_OF_TIME - SEQ_FLAG_RESUME | SEQ_FLAG_ENEMY, // NA_BGM_GERUDO_VALLEY - 0, // NA_BGM_POTION_SHOP - 0, // NA_BGM_KOTAKE_KOUME - SEQ_FLAG_NO_AMBIENCE, // NA_BGM_ESCAPE - 0, // NA_BGM_UNDERGROUND - SEQ_FLAG_NO_AMBIENCE, // NA_BGM_GANON_BATTLE_1 - SEQ_FLAG_NO_AMBIENCE, // NA_BGM_GANON_BATTLE_2 - 0, // NA_BGM_END_DEMO - 0, // NA_BGM_STAFF_1 - 0, // NA_BGM_STAFF_2 - 0, // NA_BGM_STAFF_3 - 0, // NA_BGM_STAFF_4 - 0, // NA_BGM_FIRE_BOSS - SEQ_FLAG_RESTORE, // NA_BGM_TIMED_MINI_GAME - 0, // NA_BGM_CUTSCENE_EFFECTS +#include "tables/sequence_table.h" }; +#undef DEFINE_SEQUENCE +#undef DEFINE_SEQUENCE_PTR s8 sSpecReverbs[20] = { 0, 0, 0, 0, 0, 0, 0, 40, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -850,10 +778,13 @@ NatureAmbienceDataIO sNatureAmbienceDataIO[20] = { }, }; -u32 sOcarinaAllowedButtonMask = (BTN_A | BTN_CRIGHT | BTN_CLEFT | BTN_CDOWN | BTN_CUP); +#if !PLATFORM_N64 +u32 sOcarinaAllowedButtonMask = (BTN_A | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT); s32 sOcarinaAButtonMap = BTN_A; s32 sOcarinaCUpButtonMap = BTN_CUP; s32 sOcarinaCDownButtonMap = BTN_CDOWN; +#endif + u8 sIsOcarinaInputEnabled = false; s8 sOcarinaInstrumentId = OCARINA_INSTRUMENT_OFF; u8 sCurOcarinaPitch = OCARINA_PITCH_NONE; @@ -894,151 +825,151 @@ u8 sOcaMemoryGameNumNotes[] = { 5, 6, 8 }; OcarinaNote sOcarinaSongNotes[OCARINA_SONG_MAX][20] = { // OCARINA_SONG_MINUET { - { OCARINA_PITCH_D4, 18, 86, 0, 0, 0 }, - { OCARINA_PITCH_D5, 18, 92, 0, 0, 0 }, - { OCARINA_PITCH_B4, 72, 86, 0, 0, 0 }, - { OCARINA_PITCH_A4, 18, 80, 0, 0, 0 }, - { OCARINA_PITCH_B4, 18, 88, 0, 0, 0 }, - { OCARINA_PITCH_A4, 144, 86, 0, 0, 0 }, + { OCARINA_PITCH_D4, FRAMERATE_CONST(18, 15), 86, 0, 0, 0 }, + { OCARINA_PITCH_D5, FRAMERATE_CONST(18, 15), 92, 0, 0, 0 }, + { OCARINA_PITCH_B4, FRAMERATE_CONST(72, 60), 86, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(18, 15), 80, 0, 0, 0 }, + { OCARINA_PITCH_B4, FRAMERATE_CONST(18, 15), 88, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(144, 120), 86, 0, 0, 0 }, { OCARINA_PITCH_NONE, 0, 86, 0, 0, 0 }, }, // OCARINA_SONG_BOLERO { - { OCARINA_PITCH_F4, 15, 80, 0, 0, 0 }, - { OCARINA_PITCH_D4, 15, 72, 0, 0, 0 }, - { OCARINA_PITCH_F4, 15, 84, 0, 0, 0 }, - { OCARINA_PITCH_D4, 15, 76, 0, 0, 0 }, - { OCARINA_PITCH_A4, 15, 84, 0, 0, 0 }, - { OCARINA_PITCH_F4, 15, 74, 0, 0, 0 }, - { OCARINA_PITCH_A4, 15, 78, 0, 0, 0 }, - { OCARINA_PITCH_F4, 135, 66, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(15, 12), 80, 0, 0, 0 }, + { OCARINA_PITCH_D4, FRAMERATE_CONST(15, 13), 72, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(15, 12), 84, 0, 0, 0 }, + { OCARINA_PITCH_D4, FRAMERATE_CONST(15, 13), 76, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(15, 12), 84, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(15, 13), 74, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(15, 12), 78, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(135, 113), 66, 0, 0, 0 }, { OCARINA_PITCH_NONE, 0, 66, 0, 0, 0 }, }, // OCARINA_SONG_SERENADE { - { OCARINA_PITCH_D4, 36, 60, 0, 0, 0 }, - { OCARINA_PITCH_F4, 36, 78, 0, 0, 0 }, - { OCARINA_PITCH_A4, 33, 82, 0, 0, 0 }, - { OCARINA_PITCH_NONE, 3, 82, 0, 0, 0 }, - { OCARINA_PITCH_A4, 36, 84, 0, 0, 0 }, - { OCARINA_PITCH_B4, 144, 90, 0, 0, 0 }, + { OCARINA_PITCH_D4, FRAMERATE_CONST(36, 30), 60, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(36, 30), 78, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(33, 27), 82, 0, 0, 0 }, + { OCARINA_PITCH_NONE, FRAMERATE_CONST(3, 3), 82, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(36, 30), 84, 0, 0, 0 }, + { OCARINA_PITCH_B4, FRAMERATE_CONST(144, 120), 90, 0, 0, 0 }, { OCARINA_PITCH_NONE, 0, 90, 0, 0, 0 }, }, // OCARINA_SONG_REQUIEM { - { OCARINA_PITCH_D4, 45, 88, 0, 0, 0 }, - { OCARINA_PITCH_F4, 23, 86, 0, 0, 0 }, - { OCARINA_PITCH_D4, 22, 84, 0, 0, 0 }, - { OCARINA_PITCH_A4, 45, 86, 0, 0, 0 }, - { OCARINA_PITCH_F4, 45, 94, 0, 0, 0 }, - { OCARINA_PITCH_D4, 180, 94, 0, 0, 0 }, + { OCARINA_PITCH_D4, FRAMERATE_CONST(45, 37), 88, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(23, 19), 86, 0, 0, 0 }, + { OCARINA_PITCH_D4, FRAMERATE_CONST(22, 19), 84, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(45, 37), 86, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(45, 38), 94, 0, 0, 0 }, + { OCARINA_PITCH_D4, FRAMERATE_CONST(180, 150), 94, 0, 0, 0 }, { OCARINA_PITCH_NONE, 0, 94, 0, 0, 0 }, }, // OCARINA_SONG_NOCTURNE { - { OCARINA_PITCH_B4, 36, 88, 0, 0, 0 }, - { OCARINA_PITCH_A4, 33, 84, 0, 0, 0 }, - { OCARINA_PITCH_NONE, 3, 84, 0, 0, 0 }, - { OCARINA_PITCH_A4, 18, 82, 0, 0, 0 }, - { OCARINA_PITCH_D4, 18, 60, 0, 0, 0 }, - { OCARINA_PITCH_B4, 18, 90, 0, 0, 0 }, - { OCARINA_PITCH_A4, 18, 88, 0, 0, 0 }, - { OCARINA_PITCH_F4, 144, 96, 0, 0, 0 }, + { OCARINA_PITCH_B4, FRAMERATE_CONST(36, 30), 88, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(33, 27), 84, 0, 0, 0 }, + { OCARINA_PITCH_NONE, FRAMERATE_CONST(3, 3), 84, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(18, 15), 82, 0, 0, 0 }, + { OCARINA_PITCH_D4, FRAMERATE_CONST(18, 15), 60, 0, 0, 0 }, + { OCARINA_PITCH_B4, FRAMERATE_CONST(18, 15), 90, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(18, 15), 88, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(144, 120), 96, 0, 0, 0 }, { OCARINA_PITCH_NONE, 0, 96, 0, 0, 0 }, }, // OCARINA_SONG_PRELUDE { - { OCARINA_PITCH_D5, 15, 84, 0, 0, 0 }, - { OCARINA_PITCH_A4, 45, 88, 0, 0, 0 }, - { OCARINA_PITCH_D5, 15, 88, 0, 0, 0 }, - { OCARINA_PITCH_A4, 15, 82, 0, 0, 0 }, - { OCARINA_PITCH_B4, 15, 86, 0, 0, 0 }, - { OCARINA_PITCH_D5, 60, 90, 0, 0, 0 }, - { OCARINA_PITCH_NONE, 75, 90, 0, 0, 0 }, + { OCARINA_PITCH_D5, FRAMERATE_CONST(15, 12), 84, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(45, 38), 88, 0, 0, 0 }, + { OCARINA_PITCH_D5, FRAMERATE_CONST(15, 12), 88, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(15, 13), 82, 0, 0, 0 }, + { OCARINA_PITCH_B4, FRAMERATE_CONST(15, 12), 86, 0, 0, 0 }, + { OCARINA_PITCH_D5, FRAMERATE_CONST(60, 50), 90, 0, 0, 0 }, + { OCARINA_PITCH_NONE, FRAMERATE_CONST(75, 63), 90, 0, 0, 0 }, { OCARINA_PITCH_NONE, 0, 90, 0, 0, 0 }, }, // OCARINA_SONG_SARIAS { - { OCARINA_PITCH_F4, 17, 84, 0, 0, 0 }, - { OCARINA_PITCH_A4, 17, 88, 0, 0, 0 }, - { OCARINA_PITCH_B4, 34, 80, 0, 0, 0 }, - { OCARINA_PITCH_F4, 17, 84, 0, 0, 0 }, - { OCARINA_PITCH_A4, 17, 88, 0, 0, 0 }, - { OCARINA_PITCH_B4, 136, 80, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(17, 14), 84, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(17, 14), 88, 0, 0, 0 }, + { OCARINA_PITCH_B4, FRAMERATE_CONST(34, 28), 80, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(17, 14), 84, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(17, 14), 88, 0, 0, 0 }, + { OCARINA_PITCH_B4, FRAMERATE_CONST(136, 113), 80, 0, 0, 0 }, { OCARINA_PITCH_NONE, 0, 90, 0, 0, 0 }, }, // OCARINA_SONG_EPONAS { - { OCARINA_PITCH_D5, 18, 84, 0, 0, 0 }, - { OCARINA_PITCH_B4, 18, 88, 0, 0, 0 }, - { OCARINA_PITCH_A4, 72, 80, 0, 0, 0 }, - { OCARINA_PITCH_D5, 18, 84, 0, 0, 0 }, - { OCARINA_PITCH_B4, 18, 88, 0, 0, 0 }, - { OCARINA_PITCH_A4, 144, 80, 0, 0, 0 }, + { OCARINA_PITCH_D5, FRAMERATE_CONST(18, 15), 84, 0, 0, 0 }, + { OCARINA_PITCH_B4, FRAMERATE_CONST(18, 15), 88, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(72, 60), 80, 0, 0, 0 }, + { OCARINA_PITCH_D5, FRAMERATE_CONST(18, 15), 84, 0, 0, 0 }, + { OCARINA_PITCH_B4, FRAMERATE_CONST(18, 15), 88, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(144, 120), 80, 0, 0, 0 }, { OCARINA_PITCH_NONE, 0, 90, 0, 0, 0 }, }, // OCARINA_SONG_LULLABY { - { OCARINA_PITCH_B4, 51, 84, 0, 0, 0 }, - { OCARINA_PITCH_D5, 25, 88, 0, 0, 0 }, - { OCARINA_PITCH_A4, 78, 80, 0, 0, 0 }, - { OCARINA_PITCH_B4, 51, 84, 0, 0, 0 }, - { OCARINA_PITCH_D5, 25, 88, 0, 0, 0 }, - { OCARINA_PITCH_A4, 100, 80, 0, 0, 0 }, + { OCARINA_PITCH_B4, FRAMERATE_CONST(51, 42), 84, 0, 0, 0 }, + { OCARINA_PITCH_D5, FRAMERATE_CONST(25, 21), 88, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(78, 65), 80, 0, 0, 0 }, + { OCARINA_PITCH_B4, FRAMERATE_CONST(51, 42), 84, 0, 0, 0 }, + { OCARINA_PITCH_D5, FRAMERATE_CONST(25, 21), 88, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(100, 83), 80, 0, 0, 0 }, { OCARINA_PITCH_NONE, 0, 90, 0, 0, 0 }, }, // OCARINA_SONG_SUNS { - { OCARINA_PITCH_A4, 12, 84, 0, 0, 0 }, - { OCARINA_PITCH_F4, 13, 88, 0, 0, 0 }, - { OCARINA_PITCH_D5, 29, 80, 2, 0, 0 }, - { OCARINA_PITCH_NONE, 9, 84, 0, 0, 0 }, - { OCARINA_PITCH_A4, 12, 84, 0, 0, 0 }, - { OCARINA_PITCH_F4, 13, 88, 0, 0, 0 }, - { OCARINA_PITCH_D5, 120, 80, 3, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(12, 10), 84, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(13, 10), 88, 0, 0, 0 }, + { OCARINA_PITCH_D5, FRAMERATE_CONST(29, 25), 80, 2, 0, 0 }, + { OCARINA_PITCH_NONE, FRAMERATE_CONST(9, 9), 84, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(12, 10), 84, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(13, 10), 88, 0, 0, 0 }, + { OCARINA_PITCH_D5, FRAMERATE_CONST(120, 100), 80, 3, 0, 0 }, { OCARINA_PITCH_NONE, 0, 90, 0, 0, 0 }, }, // OCARINA_SONG_TIME { - { OCARINA_PITCH_A4, 32, 84, 0, 0, 0 }, - { OCARINA_PITCH_D4, 65, 88, 0, 0, 0 }, - { OCARINA_PITCH_F4, 33, 80, 0, 0, 0 }, - { OCARINA_PITCH_A4, 32, 84, 0, 0, 0 }, - { OCARINA_PITCH_D4, 65, 88, 0, 0, 0 }, - { OCARINA_PITCH_F4, 99, 80, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(32, 26), 84, 0, 0, 0 }, + { OCARINA_PITCH_D4, FRAMERATE_CONST(65, 54), 88, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(33, 28), 80, 0, 0, 0 }, + { OCARINA_PITCH_A4, FRAMERATE_CONST(32, 26), 84, 0, 0, 0 }, + { OCARINA_PITCH_D4, FRAMERATE_CONST(65, 54), 88, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(99, 83), 80, 0, 0, 0 }, { OCARINA_PITCH_NONE, 0, 90, 0, 0, 0 }, }, // OCARINA_SONG_STORMS { - { OCARINA_PITCH_D4, 11, 84, 0, 0, 0 }, - { OCARINA_PITCH_F4, 11, 88, 0, 0, 0 }, - { OCARINA_PITCH_D5, 45, 80, 0, 0, 0 }, - { OCARINA_PITCH_D4, 11, 84, 0, 0, 0 }, - { OCARINA_PITCH_F4, 11, 88, 0, 0, 0 }, - { OCARINA_PITCH_D5, 90, 80, 0, 0, 0 }, + { OCARINA_PITCH_D4, FRAMERATE_CONST(11, 9), 84, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(11, 9), 88, 0, 0, 0 }, + { OCARINA_PITCH_D5, FRAMERATE_CONST(45, 37), 80, 0, 0, 0 }, + { OCARINA_PITCH_D4, FRAMERATE_CONST(11, 9), 84, 0, 0, 0 }, + { OCARINA_PITCH_F4, FRAMERATE_CONST(11, 9), 88, 0, 0, 0 }, + { OCARINA_PITCH_D5, FRAMERATE_CONST(90, 75), 80, 0, 0, 0 }, { OCARINA_PITCH_NONE, 0, 90, 0, 0, 0 }, }, // OCARINA_SONG_SCARECROW_SPAWN { - { OCARINA_PITCH_D4, 3, 0, 0, 0, 0 }, + { OCARINA_PITCH_D4, FRAMERATE_CONST(3, 3), 0, 0, 0, 0 }, { OCARINA_PITCH_NONE, 0, 255, 0, 0, 0 }, }, // OCARINA_SONG_MEMORY_GAME { - { OCARINA_PITCH_D4, 3, 0, 0, 0, 0 }, + { OCARINA_PITCH_D4, FRAMERATE_CONST(3, 3), 0, 0, 0, 0 }, { OCARINA_PITCH_NONE, 0, 0, 0, 0, 0 }, }, }; @@ -1260,6 +1191,10 @@ u8 D_8016B9F3; u8 sFanfareStartTimer; u16 sFanfareSeqId; +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) +u16 sPrevAmbienceSeqId; +#endif + OcarinaStaff sPlayingStaff; OcarinaStaff sPlaybackStaff; OcarinaStaff sRecordingStaff; @@ -1284,6 +1219,11 @@ OcarinaNote sScarecrowsLongSongSecondNote; #if IS_DEBUG u8 sIsMalonSinging; f32 sMalonSingingDist; +u32 sDebugPadHold; +u32 sDebugPadBtnLast; +u32 sDebugPadPress; +s32 sAudioUpdateTaskStart; +s32 sAudioUpdateTaskEnd; #endif void PadMgr_RequestPadData(PadMgr* padMgr, Input* inputs, s32 gameRequest); @@ -1295,22 +1235,38 @@ s32 Audio_SetGanonsTowerBgmVolume(u8 targetVol); // =========== Audio Ocarina =========== +#if PLATFORM_N64 + +#define OCARINA_ALLOWED_BUTTON_MASK (BTN_A | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT) +#define OCARINA_A_MAP BTN_A +#define OCARINA_CUP_MAP BTN_CUP +#define OCARINA_CDOWN_MAP BTN_CDOWN + +#else + +#define OCARINA_ALLOWED_BUTTON_MASK sOcarinaAllowedButtonMask +#define OCARINA_A_MAP sOcarinaAButtonMap +#define OCARINA_CUP_MAP sOcarinaCUpButtonMap +#define OCARINA_CDOWN_MAP sOcarinaCDownButtonMap + void AudioOcarina_SetCustomButtonMapping(u8 useCustom) { if (!useCustom) { - osSyncPrintf("AUDIO : Ocarina Control Assign Normal\n"); - sOcarinaAllowedButtonMask = (BTN_A | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT); - sOcarinaAButtonMap = BTN_A; - sOcarinaCUpButtonMap = BTN_CUP; - sOcarinaCDownButtonMap = BTN_CDOWN; + AUDIO_PRINTF("AUDIO : Ocarina Control Assign Normal\n"); + OCARINA_ALLOWED_BUTTON_MASK = (BTN_A | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT); + OCARINA_A_MAP = BTN_A; + OCARINA_CUP_MAP = BTN_CUP; + OCARINA_CDOWN_MAP = BTN_CDOWN; } else { - osSyncPrintf("AUDIO : Ocarina Control Assign Custom\n"); - sOcarinaAllowedButtonMask = (BTN_A | BTN_B | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT); - sOcarinaAButtonMap = BTN_B; - sOcarinaCUpButtonMap = BTN_CDOWN; - sOcarinaCDownButtonMap = BTN_A; + AUDIO_PRINTF("AUDIO : Ocarina Control Assign Custom\n"); + OCARINA_ALLOWED_BUTTON_MASK = (BTN_A | BTN_B | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT); + OCARINA_A_MAP = BTN_B; + OCARINA_CUP_MAP = BTN_CDOWN; + OCARINA_CDOWN_MAP = BTN_A; } } +#endif + void AudioOcarina_ReadControllerInput(void) { Input inputs[MAXCONTROLLERS]; Input* input = &inputs[0]; @@ -1611,7 +1567,7 @@ void AudioOcarina_CheckSongsWithoutMusicStaff(void) { u8 k; if (CHECK_BTN_ANY(sOcarinaInputButtonCur, BTN_L) && - CHECK_BTN_ANY(sOcarinaInputButtonCur, sOcarinaAllowedButtonMask)) { + CHECK_BTN_ANY(sOcarinaInputButtonCur, OCARINA_ALLOWED_BUTTON_MASK)) { AudioOcarina_Start((u16)sOcarinaFlags); return; } @@ -1682,14 +1638,14 @@ void AudioOcarina_PlayControllerInput(u8 unused) { } // Ensures the button pressed to start the ocarina does not also play an ocarina note - if ((sOcarinaInputButtonStart == 0) || ((sOcarinaInputButtonStart & sOcarinaAllowedButtonMask) != - (sOcarinaInputButtonCur & sOcarinaAllowedButtonMask))) { + if ((sOcarinaInputButtonStart == 0) || ((sOcarinaInputButtonStart & OCARINA_ALLOWED_BUTTON_MASK) != + (sOcarinaInputButtonCur & OCARINA_ALLOWED_BUTTON_MASK))) { sOcarinaInputButtonStart = 0; if (1) {} sCurOcarinaPitch = OCARINA_PITCH_NONE; sCurOcarinaButtonIndex = OCARINA_BTN_INVALID; - ocarinaBtnsHeld = (sOcarinaInputButtonCur & sOcarinaAllowedButtonMask) & - (sOcarinaInputButtonPrev & sOcarinaAllowedButtonMask); + ocarinaBtnsHeld = (sOcarinaInputButtonCur & OCARINA_ALLOWED_BUTTON_MASK) & + (sOcarinaInputButtonPrev & OCARINA_ALLOWED_BUTTON_MASK); if (!(sOcarinaInputButtonPress & ocarinaBtnsHeld) && (sOcarinaInputButtonCur != 0)) { sOcarinaInputButtonPress = sOcarinaInputButtonCur; } else { @@ -1697,32 +1653,36 @@ void AudioOcarina_PlayControllerInput(u8 unused) { } // Interprets and transforms controller input into ocarina buttons and notes - if (CHECK_BTN_ANY(sOcarinaInputButtonPress, sOcarinaAButtonMap)) { - osSyncPrintf("Presss NA_KEY_D4 %08x\n", sOcarinaAButtonMap); + if (CHECK_BTN_ANY(sOcarinaInputButtonPress, OCARINA_A_MAP)) { + AUDIO_PRINTF("Presss NA_KEY_D4 %08x\n", OCARINA_A_MAP); sCurOcarinaPitch = OCARINA_PITCH_D4; sCurOcarinaButtonIndex = OCARINA_BTN_A; - } else if (CHECK_BTN_ANY(sOcarinaInputButtonPress, sOcarinaCDownButtonMap)) { - osSyncPrintf("Presss NA_KEY_F4 %08x\n", sOcarinaCDownButtonMap); + } else if (CHECK_BTN_ANY(sOcarinaInputButtonPress, OCARINA_CDOWN_MAP)) { + AUDIO_PRINTF("Presss NA_KEY_F4 %08x\n", OCARINA_CDOWN_MAP); sCurOcarinaPitch = OCARINA_PITCH_F4; sCurOcarinaButtonIndex = OCARINA_BTN_C_DOWN; } else if (CHECK_BTN_ANY(sOcarinaInputButtonPress, BTN_CRIGHT)) { - osSyncPrintf("Presss NA_KEY_A4 %08x\n", BTN_CRIGHT); + AUDIO_PRINTF("Presss NA_KEY_A4 %08x\n", BTN_CRIGHT); sCurOcarinaPitch = OCARINA_PITCH_A4; sCurOcarinaButtonIndex = OCARINA_BTN_C_RIGHT; } else if (CHECK_BTN_ANY(sOcarinaInputButtonPress, BTN_CLEFT)) { - osSyncPrintf("Presss NA_KEY_B4 %08x\n", BTN_CLEFT); + AUDIO_PRINTF("Presss NA_KEY_B4 %08x\n", BTN_CLEFT); sCurOcarinaPitch = OCARINA_PITCH_B4; sCurOcarinaButtonIndex = OCARINA_BTN_C_LEFT; - } else if (CHECK_BTN_ANY(sOcarinaInputButtonPress, sOcarinaCUpButtonMap)) { - osSyncPrintf("Presss NA_KEY_D5 %08x\n", sOcarinaCUpButtonMap); + } else if (CHECK_BTN_ANY(sOcarinaInputButtonPress, OCARINA_CUP_MAP)) { + AUDIO_PRINTF("Presss NA_KEY_D5 %08x\n", OCARINA_CUP_MAP); sCurOcarinaPitch = OCARINA_PITCH_D5; sCurOcarinaButtonIndex = OCARINA_BTN_C_UP; } +#if PLATFORM_N64 + if (sOcarinaInputButtonCur) {} +#endif + // Pressing the R Button will raise the pitch by 1 semitone if ((sCurOcarinaPitch != OCARINA_PITCH_NONE) && CHECK_BTN_ANY(sOcarinaInputButtonCur, BTN_R) && (sRecordingState != OCARINA_RECORD_SCARECROW_SPAWN)) { @@ -1749,6 +1709,9 @@ void AudioOcarina_PlayControllerInput(u8 unused) { } else { // no bending or vibrato for recording state OCARINA_RECORD_SCARECROW_SPAWN sCurOcarinaBendIndex = 0; +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) + sCurOcarinaVibrato = 0; +#endif sCurOcarinaBendFreq = 1.0f; // No bend } @@ -1893,11 +1856,17 @@ void AudioOcarina_PlaybackSong(void) { } // Update vibrato +#if OOT_VERSION < PAL_1_0 || PLATFORM_GC if (sNotePlaybackVibrato != sPlaybackSong[sPlaybackNotePos].vibrato) { sNotePlaybackVibrato = sPlaybackSong[sPlaybackNotePos].vibrato; // Sets vibrato to io port 6 AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, SFX_CHANNEL_OCARINA, 6, sNotePlaybackVibrato); } +#else + sNotePlaybackVibrato = sPlaybackSong[sPlaybackNotePos].vibrato; + // Sets vibrato to io port 6 + AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, SFX_CHANNEL_OCARINA, 6, sNotePlaybackVibrato); +#endif // Update bend if (sNotePlaybackBend != sPlaybackSong[sPlaybackNotePos].bend) { @@ -2178,9 +2147,21 @@ void AudioOcarina_RecordSong(void) { } else if (sRecordOcarinaVolume != sCurOcarinaVolume) { noteChanged = true; } else if (sRecordOcarinaVibrato != sCurOcarinaVibrato) { +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) + if (sRecordingState != OCARINA_RECORD_SCARECROW_SPAWN) { + noteChanged = true; + } +#else noteChanged = true; +#endif } else if (sRecordOcarinaBendIndex != sCurOcarinaBendIndex) { +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) + if (sRecordingState != OCARINA_RECORD_SCARECROW_SPAWN) { + noteChanged = true; + } +#else noteChanged = true; +#endif } if (noteChanged) { @@ -2221,7 +2202,7 @@ s32 AudioOcarina_MemoryGameNextNote(void) { } sOcarinaSongNotes[OCARINA_SONG_MEMORY_GAME][sOcaMemoryGameAppendPos].pitch = randomPitch; - sOcarinaSongNotes[OCARINA_SONG_MEMORY_GAME][sOcaMemoryGameAppendPos].length = 45; + sOcarinaSongNotes[OCARINA_SONG_MEMORY_GAME][sOcaMemoryGameAppendPos].length = FRAMERATE_CONST(45, 38); sOcarinaSongNotes[OCARINA_SONG_MEMORY_GAME][sOcaMemoryGameAppendPos].volume = 0x50; sOcarinaSongNotes[OCARINA_SONG_MEMORY_GAME][sOcaMemoryGameAppendPos].vibrato = 0; sOcarinaSongNotes[OCARINA_SONG_MEMORY_GAME][sOcaMemoryGameAppendPos].bend = 0; @@ -2514,9 +2495,17 @@ f32 Audio_ComputeSfxFreqScale(u8 bankId, u8 entryIdx) { } switch (bankId) { + case BANK_VOICE: +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) + if (((entry->sfxId & 0xFF) < 0x40) && (sAudioBaseFilter2 != 0)) { + phi_v0 = true; + } else if (((entry->sfxId & 0xFF) >= 0x40) && (sAudioExtraFilter2 != 0)) { + phi_v0 = true; + } + break; +#endif case BANK_PLAYER: case BANK_ITEM: - case BANK_VOICE: if (sAudioBaseFilter2 != 0) { phi_v0 = 1; } @@ -2628,6 +2617,9 @@ void Audio_SetSfxProperties(u8 bankId, u8 entryIdx, u8 channelIndex) { f32 behindScreenZ; u8 baseFilter = 0; SfxBankEntry* entry = &gSfxBanks[bankId][entryIdx]; +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) + s32 pad; +#endif switch (bankId) { case BANK_PLAYER: @@ -2666,7 +2658,13 @@ void Audio_SetSfxProperties(u8 bankId, u8 entryIdx, u8 channelIndex) { } } if (sAudioBaseFilter != 0) { - if ((bankId == BANK_ITEM) || (bankId == BANK_PLAYER) || (bankId == BANK_VOICE)) { +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) + if ((bankId == BANK_PLAYER) || (bankId == BANK_ITEM) || + ((bankId == BANK_VOICE) && ((entry->sfxId & 0xFF) < 0x40))) +#else + if ((bankId == BANK_ITEM) || (bankId == BANK_PLAYER) || (bankId == BANK_VOICE)) +#endif + { baseFilter = sAudioBaseFilter; } } @@ -3244,6 +3242,13 @@ void Audio_PlaySceneSequence(u16 seqId) { AUDIOCMD_GLOBAL_STOP_AUDIOCMDS(); } +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) + if (Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_DISABLED) { + Audio_StopSequence(SEQ_PLAYER_BGM_MAIN, 0); + AUDIOCMD_GLOBAL_STOP_AUDIOCMDS(); + } +#endif + if ((sSeqFlags[sPrevSceneSeqId] & SEQ_FLAG_RESUME_PREV) && (sSeqFlags[seqId & 0xFF & 0xFF] & SEQ_FLAG_RESUME)) { // Resume the sequence from the point where it left off last time it was played in the scene if ((sSeqResumePoint & 0x3F) != 0) { @@ -3381,6 +3386,11 @@ void func_800F5B58(void) { if (sPrevMainBgmSeqId == NA_BGM_DISABLED) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0); } else { +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) + if (sPrevMainBgmSeqId == NA_BGM_NATURE_AMBIENCE) { + sPrevMainBgmSeqId = sPrevAmbienceSeqId; + } +#endif SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, sPrevMainBgmSeqId); } @@ -3512,7 +3522,12 @@ void Audio_SetSequenceMode(u8 seqMode) { volumeFadeInTimer); SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_SUB, 10, 8, NA_BGM_ENEMY); - if (seqId != NA_BGM_NATURE_AMBIENCE) { +#if OOT_VERSION < PAL_1_0 || PLATFORM_GC + if (seqId != NA_BGM_NATURE_AMBIENCE) +#else + if (seqId > NA_BGM_NATURE_AMBIENCE) +#endif + { Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_BGM_SUB, (0x7F - sAudioEnemyVol) & 0xFF, 0xA); Audio_SplitBgmChannels(sAudioEnemyVol); @@ -3531,6 +3546,23 @@ void Audio_SetSequenceMode(u8 seqMode) { } sPrevSeqMode = seqMode + 0x80; + } else { +#if OOT_VERSION < NTSC_1_1 || PLATFORM_GC + // Empty +#elif OOT_VERSION < PAL_1_0 + if ((seqMode == SEQ_MODE_ENEMY) && (seqId != NA_BGM_FIELD_LOGIC) && + (Audio_GetActiveSeqId(SEQ_PLAYER_BGM_SUB) == NA_BGM_DISABLED)) { + SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_SUB, 10, 8, NA_BGM_ENEMY); + sPrevSeqMode = seqMode + 0x80; + } +#else + // If both seqMode = sPrevSeqMode = SEQ_MODE_ENEMY + if ((seqMode == SEQ_MODE_ENEMY) && (Audio_GetActiveSeqId(SEQ_PLAYER_BGM_SUB) == NA_BGM_DISABLED) && + (seqId != NA_BGM_DISABLED) && (sSeqFlags[seqId & 0xFF & 0xFF] & SEQ_FLAG_ENEMY)) { + SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_SUB, 10, 8, NA_BGM_ENEMY); + sPrevSeqMode = seqMode + 0x80; + } +#endif } } else { // Hyrule Field will play slightly different background music depending on whether player is standing @@ -3570,11 +3602,23 @@ void Audio_SetBgmEnemyVolume(f32 dist) { sAudioEnemyVol = ((350.0f - adjDist) * 127.0f) / 350.0f; Audio_SetVolumeScale(SEQ_PLAYER_BGM_SUB, VOL_SCALE_INDEX_BGM_SUB, sAudioEnemyVol, 10); - if (gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId != NA_BGM_NATURE_AMBIENCE) { + +#if OOT_VERSION < PAL_1_0 || PLATFORM_GC + if (gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId != NA_BGM_NATURE_AMBIENCE) +#else + if (gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId > NA_BGM_NATURE_AMBIENCE) +#endif + { Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_BGM_SUB, (0x7F - sAudioEnemyVol), 10); } } - if (gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId != NA_BGM_NATURE_AMBIENCE) { + +#if OOT_VERSION < PAL_1_0 || PLATFORM_GC + if (gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId != NA_BGM_NATURE_AMBIENCE) +#else + if (gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId > NA_BGM_NATURE_AMBIENCE) +#endif + { Audio_SplitBgmChannels(sAudioEnemyVol); } } @@ -3887,6 +3931,9 @@ void func_800F6C34(void) { sFanfareStartTimer = 0; D_8016B9F3 = 1; sMalonSingingDisabled = false; +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) + sPrevAmbienceSeqId = NA_BGM_DISABLED; +#endif } void Audio_SetNatureAmbienceChannelIO(u8 channelIdxRange, u8 ioPort, u8 ioData) { @@ -3945,6 +3992,18 @@ void Audio_StartNatureAmbienceSequence(u16 playerIO, u16 channelMask) { } #endif +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) + if ((Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_DISABLED) && + (Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_NATURE_AMBIENCE)) { + Audio_StopSequence(SEQ_PLAYER_BGM_MAIN, 0); + AUDIOCMD_GLOBAL_STOP_AUDIOCMDS(); + } + + if (Audio_GetActiveSeqId(SEQ_PLAYER_BGM_SUB) == (NA_BGM_ENEMY | 0x800)) { + Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_BGM_SUB, 0x7F, 1); + } +#endif + SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_NATURE_AMBIENCE); if (channelIdx) { @@ -3967,6 +4026,12 @@ void Audio_PlayNatureAmbienceSequence(u8 natureAmbienceId) { if ((gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId == NA_BGM_DISABLED) || !(sSeqFlags[gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId & 0xFF & 0xFF] & SEQ_FLAG_NO_AMBIENCE)) { +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) + if (gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId != NA_BGM_NATURE_AMBIENCE) { + sPrevAmbienceSeqId = gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId; + } +#endif + Audio_StartNatureAmbienceSequence(sNatureAmbienceDataIO[natureAmbienceId].playerIO, sNatureAmbienceDataIO[natureAmbienceId].channelMask); diff --git a/src/audio/lib/heap.c b/src/audio/lib/heap.c index f94adee0f5..7041b5464d 100644 --- a/src/audio/lib/heap.c +++ b/src/audio/lib/heap.c @@ -1,5 +1,6 @@ #include "ultra64.h" #include "global.h" +#include "versions.h" void AudioHeap_InitSampleCaches(u32 persistentSampleCacheSize, u32 temporarySampleCacheSize); SampleCacheEntry* AudioHeap_AllocTemporarySampleCacheEntry(u32 size); @@ -915,8 +916,8 @@ void AudioHeap_Init(void) { } // Determine the length of the buffer for storing the audio command list passed to the rsp audio microcode - gAudioCtx.maxAudioCmds = - gAudioCtx.numNotes * 0x10 * gAudioCtx.audioBufferParameters.ticksPerUpdate + spec->numReverbs * 0x18 + 0x140; + gAudioCtx.maxAudioCmds = gAudioCtx.numNotes * 0x10 * gAudioCtx.audioBufferParameters.ticksPerUpdate + + spec->numReverbs * 0x18 + FRAMERATE_CONST(0x140, 0x1C0); // Calculate sizes for various caches on the audio heap persistentSize = @@ -1010,9 +1011,9 @@ void AudioHeap_Init(void) { reverb->sample.medium = MEDIUM_RAM; reverb->sample.size = reverb->windowSize * SAMPLE_SIZE; reverb->sample.sampleAddr = (u8*)reverb->leftRingBuf; - reverb->loop.start = 0; - reverb->loop.count = 1; - reverb->loop.end = reverb->windowSize; + reverb->loop.header.start = 0; + reverb->loop.header.count = 1; + reverb->loop.header.end = reverb->windowSize; if (reverb->downsampleRate != 1) { reverb->unk_0E = 0x8000 / reverb->downsampleRate; @@ -1273,7 +1274,7 @@ void AudioHeap_DiscardSampleCacheEntry(SampleCacheEntry* entry) { s32 sampleBankId2; s32 fontId; - numFonts = gAudioCtx.soundFontTable->numEntries; + numFonts = gAudioCtx.soundFontTable->header.numEntries; for (fontId = 0; fontId < numFonts; fontId++) { sampleBankId1 = gAudioCtx.soundFontList[fontId].sampleBankId1; sampleBankId2 = gAudioCtx.soundFontList[fontId].sampleBankId2; @@ -1330,7 +1331,7 @@ void AudioHeap_DiscardSampleCaches(void) { s32 fontId; s32 j; - numFonts = gAudioCtx.soundFontTable->numEntries; + numFonts = gAudioCtx.soundFontTable->header.numEntries; for (fontId = 0; fontId < numFonts; fontId++) { sampleBankId1 = gAudioCtx.soundFontList[fontId].sampleBankId1; sampleBankId2 = gAudioCtx.soundFontList[fontId].sampleBankId2; @@ -1353,7 +1354,7 @@ void AudioHeap_DiscardSampleCaches(void) { } } -typedef struct { +typedef struct StorageChange { u32 oldAddr; u32 newAddr; u32 size; @@ -1400,7 +1401,7 @@ void AudioHeap_ApplySampleBankCacheInternal(s32 apply, s32 sampleBankId) { s32 pad[4]; sampleBankTable = gAudioCtx.sampleBankTable; - numFonts = gAudioCtx.soundFontTable->numEntries; + numFonts = gAudioCtx.soundFontTable->header.numEntries; change.oldAddr = (u32)AudioHeap_SearchCaches(SAMPLE_TABLE, CACHE_EITHER, sampleBankId); if (change.oldAddr == 0) { return; diff --git a/src/audio/lib/load.c b/src/audio/lib/load.c index 0d2fe051dd..99217c61fc 100644 --- a/src/audio/lib/load.c +++ b/src/audio/lib/load.c @@ -1,5 +1,6 @@ #include "ultra64.h" #include "global.h" +#include "versions.h" #define MK_ASYNC_MSG(retData, tableType, id, loadStatus) \ (((retData) << 24) | ((tableType) << 16) | ((id) << 8) | (loadStatus)) @@ -7,14 +8,14 @@ #define ASYNC_ID(v) ((u8)(v >> 8)) #define ASYNC_LOAD_STATUS(v) ((u8)(v >> 0)) -typedef enum { +typedef enum SlowLoadState { /* 0 */ SLOW_LOAD_STATE_WAITING, /* 1 */ SLOW_LOAD_STATE_START, /* 2 */ SLOW_LOAD_STATE_LOADING, /* 3 */ SLOW_LOAD_STATE_DONE } SlowLoadState; -typedef struct { +typedef struct SampleBankRelocInfo { /* 0x00 */ s32 sampleBankId1; /* 0x04 */ s32 sampleBankId2; /* 0x08 */ s32 baseAddr1; @@ -338,10 +339,10 @@ void AudioLoad_SetSampleFontLoadStatus(s32 sampleBankId, s32 loadStatus) { void AudioLoad_InitTable(AudioTable* table, u32 romAddr, u16 unkMediumParam) { s32 i; - table->unkMediumParam = unkMediumParam; - table->romAddr = romAddr; + table->header.unkMediumParam = unkMediumParam; + table->header.romAddr = romAddr; - for (i = 0; i < table->numEntries; i++) { + for (i = 0; i < table->header.numEntries; i++) { if ((table->entries[i].size != 0) && (table->entries[i].medium == MEDIUM_CART)) { table->entries[i].romAddr += romAddr; } @@ -401,7 +402,7 @@ s32 AudioLoad_SyncLoadSample(Sample* sample, s32 fontId) { if (sample->medium == MEDIUM_UNK) { AudioLoad_SyncDmaUnkMedium((u32)sample->sampleAddr, sampleAddr, sample->size, - gAudioCtx.sampleBankTable->unkMediumParam); + gAudioCtx.sampleBankTable->header.unkMediumParam); } else { AudioLoad_SyncDma((u32)sample->sampleAddr, sampleAddr, sample->size, sample->medium); } @@ -707,7 +708,7 @@ void* AudioLoad_SyncLoad(u32 tableType, u32 id, s32* didAllocate) { *didAllocate = true; if (medium == MEDIUM_UNK) { - AudioLoad_SyncDmaUnkMedium(romAddr, ramAddr, size, (s16)table->unkMediumParam); + AudioLoad_SyncDmaUnkMedium(romAddr, ramAddr, size, (s16)table->header.unkMediumParam); } else { AudioLoad_SyncDma(romAddr, ramAddr, size, medium); } @@ -1066,8 +1067,8 @@ void* AudioLoad_AsyncLoadInner(s32 tableType, s32 id, s32 nChunks, s32 retData, } if (medium == MEDIUM_UNK) { - AudioLoad_StartAsyncLoadUnkMedium((s16)table->unkMediumParam, devAddr, ramAddr, size, medium, nChunks, - retQueue, MK_ASYNC_MSG(retData, tableType, id, loadStatus)); + AudioLoad_StartAsyncLoadUnkMedium((s16)table->header.unkMediumParam, devAddr, ramAddr, size, medium, + nChunks, retQueue, MK_ASYNC_MSG(retData, tableType, id, loadStatus)); } else { AudioLoad_StartAsyncLoad(devAddr, ramAddr, size, medium, nChunks, retQueue, MK_ASYNC_MSG(retData, tableType, realId, loadStatus)); @@ -1149,6 +1150,7 @@ void AudioLoad_Init(void* heap, u32 heapSize) { } // 1000 is a conversion from seconds to milliseconds +#if !OOT_PAL_N64 switch (osTvType) { case OS_TV_PAL: gAudioCtx.maxTempoTvTypeFactors = 1000 * REFRESH_RATE_DEVIATION_PAL / REFRESH_RATE_PAL; @@ -1166,6 +1168,15 @@ void AudioLoad_Init(void* heap, u32 heapSize) { gAudioCtx.refreshRate = REFRESH_RATE_NTSC; break; } +#else + switch (osTvType) { + case OS_TV_PAL: + default: + gAudioCtx.maxTempoTvTypeFactors = 1000 * REFRESH_RATE_DEVIATION_PAL / REFRESH_RATE_PAL; + gAudioCtx.refreshRate = REFRESH_RATE_PAL; + break; + } +#endif AudioThread_InitMesgQueues(); @@ -1195,8 +1206,7 @@ void AudioLoad_Init(void* heap, u32 heapSize) { gAudioCtx.audioHeap = gAudioHeap; gAudioCtx.audioHeapSize = gAudioHeapInitSizes.heapSize; } else { - void** hp = &heap; - gAudioCtx.audioHeap = *hp; + gAudioCtx.audioHeap = heap; gAudioCtx.audioHeapSize = heapSize; } @@ -1214,11 +1224,11 @@ void AudioLoad_Init(void* heap, u32 heapSize) { // Set audio tables pointers gAudioCtx.sequenceTable = (AudioTable*)gSequenceTable; - gAudioCtx.soundFontTable = (AudioTable*)gSoundFontTable; - gAudioCtx.sampleBankTable = (AudioTable*)gSampleBankTable; + gAudioCtx.soundFontTable = &gSoundFontTable; + gAudioCtx.sampleBankTable = &gSampleBankTable; gAudioCtx.sequenceFontTable = gSequenceFontTable; - gAudioCtx.numSequences = gAudioCtx.sequenceTable->numEntries; + gAudioCtx.numSequences = gAudioCtx.sequenceTable->header.numEntries; gAudioCtx.specId = 0; gAudioCtx.resetStatus = 1; // Set reset to immediately initialize the audio heap @@ -1229,7 +1239,7 @@ void AudioLoad_Init(void* heap, u32 heapSize) { AudioLoad_InitTable(gAudioCtx.sequenceTable, (u32)_AudioseqSegmentRomStart, 0); AudioLoad_InitTable(gAudioCtx.soundFontTable, (u32)_AudiobankSegmentRomStart, 0); AudioLoad_InitTable(gAudioCtx.sampleBankTable, (u32)_AudiotableSegmentRomStart, 0); - numFonts = gAudioCtx.soundFontTable->numEntries; + numFonts = gAudioCtx.soundFontTable->header.numEntries; gAudioCtx.soundFontList = AudioHeap_Alloc(&gAudioCtx.initPool, numFonts * sizeof(SoundFont)); for (i = 0; i < numFonts; i++) { @@ -1295,7 +1305,7 @@ s32 AudioLoad_SlowLoadSample(s32 fontId, s32 instId, s8* status) { slowLoad->seqOrFontId = fontId; slowLoad->instId = instId; if (slowLoad->medium == MEDIUM_UNK) { - slowLoad->unkMediumParam = gAudioCtx.sampleBankTable->unkMediumParam; + slowLoad->unkMediumParam = gAudioCtx.sampleBankTable->header.unkMediumParam; } gAudioCtx.slowLoadPos ^= 1; @@ -1439,7 +1449,7 @@ s32 AudioLoad_SlowLoadSeq(s32 seqId, u8* ramAddr, s8* status) { slowLoad->seqOrFontId = seqId; if (slowLoad->medium == MEDIUM_UNK) { - slowLoad->unkMediumParam = seqTable->unkMediumParam; + slowLoad->unkMediumParam = seqTable->header.unkMediumParam; } gAudioCtx.slowLoadPos ^= 1; @@ -1616,7 +1626,7 @@ void AudioLoad_ProcessAsyncLoad(AudioAsyncLoad* asyncLoad, s32 resetStatus) { if (asyncLoad->bytesRemaining < asyncLoad->chunkSize) { if (asyncLoad->medium == MEDIUM_UNK) { AudioLoad_AsyncDmaUnkMedium(asyncLoad->curDevAddr, asyncLoad->curRamAddr, asyncLoad->bytesRemaining, - sampleBankTable->unkMediumParam); + sampleBankTable->header.unkMediumParam); } else { AudioLoad_AsyncDma(asyncLoad, asyncLoad->bytesRemaining); } @@ -1626,7 +1636,7 @@ void AudioLoad_ProcessAsyncLoad(AudioAsyncLoad* asyncLoad, s32 resetStatus) { if (asyncLoad->medium == MEDIUM_UNK) { AudioLoad_AsyncDmaUnkMedium(asyncLoad->curDevAddr, asyncLoad->curRamAddr, asyncLoad->chunkSize, - sampleBankTable->unkMediumParam); + sampleBankTable->header.unkMediumParam); } else { AudioLoad_AsyncDma(asyncLoad, asyncLoad->chunkSize); } @@ -1783,7 +1793,7 @@ void AudioLoad_RelocateFontAndPreloadSamples(s32 fontId, SoundFontData* fontData case false: if (sample->medium == MEDIUM_UNK) { AudioLoad_SyncDmaUnkMedium((u32)sample->sampleAddr, sampleRamAddr, sample->size, - gAudioCtx.sampleBankTable->unkMediumParam); + gAudioCtx.sampleBankTable->header.unkMediumParam); sample->sampleAddr = sampleRamAddr; sample->medium = MEDIUM_RAM; } else { @@ -2039,7 +2049,7 @@ void AudioLoad_PreloadSamplesForFont(s32 fontId, s32 async, SampleBankRelocInfo* case false: if (sample->medium == MEDIUM_UNK) { AudioLoad_SyncDmaUnkMedium((u32)sample->sampleAddr, addr, sample->size, - gAudioCtx.sampleBankTable->unkMediumParam); + gAudioCtx.sampleBankTable->header.unkMediumParam); sample->sampleAddr = addr; sample->medium = MEDIUM_RAM; } else { diff --git a/src/audio/lib/seqplayer.c b/src/audio/lib/seqplayer.c index 620f7a4534..71132797e2 100644 --- a/src/audio/lib/seqplayer.c +++ b/src/audio/lib/seqplayer.c @@ -21,7 +21,7 @@ #define PROCESS_SCRIPT_END -1 -typedef enum { +typedef enum PortamentoMode { /* 0 */ PORTAMENTO_MODE_OFF, /* 1 */ PORTAMENTO_MODE_1, /* 2 */ PORTAMENTO_MODE_2, @@ -435,6 +435,14 @@ void AudioSeq_SequencePlayerDisableAsFinished(SequencePlayer* seqPlayer) { } void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer) { + s32 finished = 0; + +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) + if (seqPlayer->finished == 1) { + finished = 1; + } +#endif + AudioSeq_SequencePlayerDisableChannels(seqPlayer, 0xFFFF); Audio_NotePoolClear(&seqPlayer->notePool); if (!seqPlayer->enabled) { @@ -449,6 +457,11 @@ void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer) { } if (AudioLoad_IsFontLoadComplete(seqPlayer->defaultFont)) { +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) + if (finished == 1) { + AudioHeap_ReleaseNotesForFont(seqPlayer->defaultFont); + } +#endif AudioLoad_SetFontLoadStatus(seqPlayer->defaultFont, LOAD_STATUS_MAYBE_DISCARDABLE); } @@ -946,7 +959,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) { if (layer->delay == 0) { if (layer->tunedSample != NULL) { - time = layer->tunedSample->sample->loop->end; + time = layer->tunedSample->sample->loop->header.end; } else { time = 0.0f; } @@ -1475,16 +1488,14 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) { case 0xE7: cmdArgU16 = (u16)cmdArgs[0]; data = &seqPlayer->seqData[cmdArgU16]; - channel->muteBehavior = data[0]; - data += 3; - channel->noteAllocPolicy = data[-2]; - AudioSeq_SetChannelPriorities(channel, data[-1]); - channel->transposition = (s8)data[0]; - data += 4; - channel->newPan = data[-3]; - channel->panChannelWeight = data[-2]; - channel->targetReverbVol = data[-1]; - channel->reverbIndex = data[0]; + channel->muteBehavior = *data++; + channel->noteAllocPolicy = *data++; + AudioSeq_SetChannelPriorities(channel, *data++); + channel->transposition = (s8)*data++; + channel->newPan = *data++; + channel->panChannelWeight = *data++; + channel->targetReverbVol = *data++; + channel->reverbIndex = *data++; //! @bug: Not marking reverb state as changed channel->changes.s.pan = true; break; diff --git a/src/audio/lib/synthesis.c b/src/audio/lib/synthesis.c index 321bd79a51..d19ed4ae5f 100644 --- a/src/audio/lib/synthesis.c +++ b/src/audio/lib/synthesis.c @@ -14,7 +14,7 @@ #define DMEM_WET_LEFT_CH 0xC80 #define DMEM_WET_RIGHT_CH 0xE20 // = DMEM_WET_LEFT_CH + DMEM_1CH_SIZE -typedef enum { +typedef enum HaasEffectDelaySide { /* 0 */ HAAS_EFFECT_DELAY_NONE, /* 1 */ HAAS_EFFECT_DELAY_LEFT, // Delay left channel so that right channel is heard first /* 2 */ HAAS_EFFECT_DELAY_RIGHT // Delay right channel so that left channel is heard first @@ -643,7 +643,13 @@ Acmd* AudioSynth_DoOneAudioUpdate(s16* aiBuf, s32 aiBufLen, Acmd* cmd, s32 updat aMix(cmd++, DMEM_2CH_SIZE >> 4, reverb->decayRatio + 0x8000, DMEM_WET_LEFT_CH, DMEM_WET_LEFT_CH); // Leak reverb between the left and right channels - if (reverb->leakRtl != 0 || reverb->leakLtr != 0) { + +#if OOT_VERSION < NTSC_1_1 || PLATFORM_GC + if ((reverb->leakRtl != 0) || (reverb->leakLtr != 0)) +#else + if (((reverb->leakRtl != 0) || (reverb->leakLtr != 0)) && (gAudioCtx.soundMode != SOUNDMODE_MONO)) +#endif + { cmd = AudioSynth_LeakReverb(cmd, reverb); } @@ -778,6 +784,13 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS nParts = noteSubEu->bitField1.hasTwoParts + 1; samplesLenFixedPoint = (resamplingRateFixedPoint * aiBufLen * 2) + synthState->samplePosFrac; numSamplesToLoad = samplesLenFixedPoint >> 16; + +#if !(OOT_VERSION < NTSC_1_1 || PLATFORM_GC) + if (numSamplesToLoad == 0) { + skipBytes = false; + } +#endif + synthState->samplePosFrac = samplesLenFixedPoint & 0xFFFF; // Partially-optimized out no-op ifs required for matching. SM64 decomp @@ -796,7 +809,7 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS } else { sample = noteSubEu->tunedSample->sample; loopInfo = sample->loop; - loopEndPos = loopInfo->end; + loopEndPos = loopInfo->header.end; sampleAddr = (u32)sample->sampleAddr; resampledTempLen = 0; @@ -829,7 +842,7 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS if (1) {} if (1) {} if (1) {} - nEntries = SAMPLES_PER_FRAME * sample->book->order * sample->book->numPredictors; + nEntries = SAMPLES_PER_FRAME * sample->book->header.order * sample->book->header.numPredictors; aLoadADPCM(cmd++, nEntries, gAudioCtx.curLoadedBook); } } @@ -861,7 +874,7 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS nSamplesInFirstFrame = nSamplesUntilLoopEnd; } nFramesToDecode = (nSamplesToDecode + SAMPLES_PER_FRAME - 1) / SAMPLES_PER_FRAME; - if (loopInfo->count != 0) { + if (loopInfo->header.count != 0) { // Loop around and restart restart = true; } else { @@ -1019,7 +1032,7 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS } else { if (restart) { synthState->restart = true; - synthState->samplePosInt = loopInfo->start; + synthState->samplePosInt = loopInfo->header.start; } else { synthState->samplePosInt += nSamplesToProcess; } diff --git a/src/audio/lib/thread.c b/src/audio/lib/thread.c index 22afc33fdf..c074f596a1 100644 --- a/src/audio/lib/thread.c +++ b/src/audio/lib/thread.c @@ -1,4 +1,5 @@ #include "global.h" +#include "versions.h" #define SAMPLES_TO_OVERPRODUCE 0x10 #define EXTRA_BUFFERED_AI_SAMPLES_TARGET 0x80 @@ -16,12 +17,19 @@ AudioTask* AudioThread_Update(void) { return AudioThread_UpdateImpl(); } +#if !(OOT_VERSION < PAL_1_0 || PLATFORM_GC) +static s32 sMaxAbiCmdCnt = 0x80; +static AudioTask* sWaitingAudioTask = NULL; +#endif + /** * This is Audio_Update for the audio thread */ AudioTask* AudioThread_UpdateImpl(void) { +#if OOT_VERSION < PAL_1_0 || PLATFORM_GC static s32 sMaxAbiCmdCnt = 0x80; static AudioTask* sWaitingAudioTask = NULL; +#endif u32 samplesRemainingInAi; s32 abiCmdCnt; s32 pad; @@ -795,7 +803,7 @@ s32 func_800E6590(s32 seqPlayerIndex, s32 channelIndex, s32 layerIndex) { if (tunedSample == NULL) { return 0; } - loopEnd = tunedSample->sample->loop->end; + loopEnd = tunedSample->sample->loop->header.end; samplePos = note->synthesisState.samplePosInt; return loopEnd - samplePos; } diff --git a/src/audio/sequence.c b/src/audio/sequence.c index 9a338bf16b..174fbdb32c 100644 --- a/src/audio/sequence.c +++ b/src/audio/sequence.c @@ -26,7 +26,7 @@ Audio_ProcessSeqCmd((SEQCMD_OP_SET_SEQPLAYER_VOLUME << 28) | ((u8)(seqPlayerIndex) << 24) | \ ((u8)(duration) << 16) | ((u8)((volume)*127.0f))); -typedef struct { +typedef struct SeqRequest { /* 0x0 */ u8 seqId; /* 0x1 */ u8 priority; // higher values have higher priority } SeqRequest; // size = 0x2 diff --git a/src/audio/session_config.c b/src/audio/session_config.c index 2178a12e88..8c2824eee4 100644 --- a/src/audio/session_config.c +++ b/src/audio/session_config.c @@ -1,6 +1,5 @@ #include "global.h" -u8 D_8016F0E0[0xA0]; // unused AudioContext gAudioCtx; AudioCustomUpdateFunction gAudioCustomUpdateFunction; s32 D_801755D8[3]; // unused @@ -19,7 +18,11 @@ const TempoData gTempoData = { // Sizes of everything on the init pool #define AI_BUFFERS_SIZE (AIBUF_SIZE * ARRAY_COUNT(gAudioCtx.aiBuffers)) #define SOUNDFONT_LIST_SIZE (NUM_SOUNDFONTS * sizeof(SoundFont)) +#if OOT_VERSION < PAL_1_0 || PLATFORM_GC #define PERMANENT_POOL_SIZE (SFX_SEQ_SIZE + SFX_SOUNDFONT_1_SIZE + SFX_SOUNDFONT_2_SIZE) +#else +#define PERMANENT_POOL_SIZE (SFX_SEQ_SIZE + SFX_SOUNDFONT_1_SIZE + SFX_SOUNDFONT_2_SIZE + 0x10) +#endif const AudioHeapInitSizes gAudioHeapInitSizes = { ALIGN16(sizeof(gAudioHeap) - 0x100), // audio heap size diff --git a/src/audio/sfx.c b/src/audio/sfx.c index 5ed86fe7e3..333f700405 100644 --- a/src/audio/sfx.c +++ b/src/audio/sfx.c @@ -2,7 +2,7 @@ #include "global.h" #include "terminal.h" -typedef struct { +typedef struct SfxRequest { /* 0x00 */ u16 sfxId; /* 0x04 */ Vec3f* pos; /* 0x08 */ u8 token; @@ -11,7 +11,7 @@ typedef struct { /* 0x14 */ s8* reverbAdd; } SfxRequest; // size = 0x18 -typedef struct { +typedef struct UnusedBankLerp { /* 0x00 */ f32 value; /* 0x04 */ f32 target; /* 0x08 */ f32 step; @@ -336,8 +336,11 @@ void Audio_ChooseActiveSfx(u8 bankId) { "flag:%04X ptr:%08X pos:%f-%f-%f" VT_RST "\n", entry->sfxId, entry->posX, entry->posZ, *entry->posX, *entry->posY, *entry->posZ); } + entry->priority = (u32)entry->dist + (SQ(0xFF - sfxImportance) * SQ(76)); +#if OOT_VERSION < NTSC_1_1 || PLATFORM_GC temp3 = entry->sfxId; // fake - entry->priority = (u32)entry->dist + (SQ(0xFF - sfxImportance) * SQ(76)) + temp3 - temp3; + entry->priority = entry->priority + temp3 - temp3; +#endif if (*entry->posZ < 0.0f) { entry->priority += (s32)(-*entry->posZ * 6.0f); } @@ -525,7 +528,7 @@ void Audio_StopSfxByBank(u8 bankId) { Audio_RemoveMatchingSfxRequests(0, &cmp); } -void func_800F8884(u8 bankId, Vec3f* pos) { +void Audio_RemoveSfxFromBankByPos(u8 bankId, Vec3f* pos) { SfxBankEntry* entry; u8 entryIndex = gSfxBanks[bankId][0].next; u8 prevEntryIndex = 0; @@ -549,7 +552,7 @@ void func_800F8884(u8 bankId, Vec3f* pos) { void Audio_StopSfxByPosAndBank(u8 bankId, Vec3f* pos) { SfxBankEntry cmp; - func_800F8884(bankId, pos); + Audio_RemoveSfxFromBankByPos(bankId, pos); cmp.sfxId = bankId << 12; cmp.posX = &pos->x; Audio_RemoveMatchingSfxRequests(1, &cmp); @@ -560,7 +563,7 @@ void Audio_StopSfxByPos(Vec3f* pos) { SfxBankEntry cmp; for (i = 0; i < ARRAY_COUNT(gSfxBanks); i++) { - func_800F8884(i, pos); + Audio_RemoveSfxFromBankByPos(i, pos); } cmp.posX = &pos->x; Audio_RemoveMatchingSfxRequests(2, &cmp); diff --git a/src/audio/sfx_params.c b/src/audio/sfx_params.c index 6269dffa49..7dc1bbd2c7 100644 --- a/src/audio/sfx_params.c +++ b/src/audio/sfx_params.c @@ -1,7 +1,8 @@ #include "ultra64.h" #include "global.h" +#include "versions.h" -#define DEFINE_SFX(_0, importance, distParam, randParam, flags) \ +#define DEFINE_SFX(_0, _1, importance, distParam, randParam, flags) \ { importance, ((((distParam) << SFX_PARAM_01_SHIFT) & SFX_PARAM_01_MASK) | \ (((randParam) << SFX_PARAM_67_SHIFT) & SFX_PARAM_67_MASK) | (flags)) }, diff --git a/src/audio/tables/samplebank_table.c b/src/audio/tables/samplebank_table.c new file mode 100644 index 0000000000..58ebf06f22 --- /dev/null +++ b/src/audio/tables/samplebank_table.c @@ -0,0 +1,50 @@ +#include "attributes.h" +#include "z64audio.h" + +// Symbol definition + +extern AudioTable gSampleBankTable; +#pragma weak gSampleBankTable = sSampleBankTableHeader + +// Externs for table + +#define DEFINE_SAMPLE_BANK(name, medium, cachePolicy) \ + extern u8 name##_Start[]; \ + extern u8 name##_Size[]; +#define DEFINE_SAMPLE_BANK_PTR(index, medium, cachePolicy) /*empty*/ + +#include "assets/audio/samplebank_table.h" + +#undef DEFINE_SAMPLE_BANK +#undef DEFINE_SAMPLE_BANK_PTR + +// Table header + +NO_REORDER AudioTableHeader sSampleBankTableHeader = { +// The table contains the number of samplebanks, count them with the preprocessor +#define DEFINE_SAMPLE_BANK(name, medium, cachePolicy) 1 + +#define DEFINE_SAMPLE_BANK_PTR(index, medium, cachePolicy) 1 + + +#include "assets/audio/samplebank_table.h" + 0, + +#undef DEFINE_SAMPLE_BANK +#undef DEFINE_SAMPLE_BANK_PTR + + 0, + 0x00000000, + { 0, 0, 0, 0, 0, 0, 0, 0 }, +}; + +// Table body + +NO_REORDER AudioTableEntry sSampleBankTableEntries[] = { +#define DEFINE_SAMPLE_BANK(name, medium, cachePolicy) \ + { (u32)name##_Start, (u32)name##_Size, (medium), (cachePolicy), 0, 0, 0 }, +#define DEFINE_SAMPLE_BANK_PTR(index, medium, cachePolicy) { (index), 0, (medium), (cachePolicy), 0, 0, 0 }, + +#include "assets/audio/samplebank_table.h" + +#undef DEFINE_SAMPLE_BANK +#undef DEFINE_SAMPLE_BANK_PTR +}; diff --git a/src/audio/tables/sequence_table.c b/src/audio/tables/sequence_table.c new file mode 100644 index 0000000000..dc3321d2b4 --- /dev/null +++ b/src/audio/tables/sequence_table.c @@ -0,0 +1,52 @@ +#include "attributes.h" +#include "z64audio.h" +#include "versions.h" + +// Symbol definition + +extern AudioTable gSequenceTable; +#pragma weak gSequenceTable = sSequenceTableHeader + +// Externs for table + +#define DEFINE_SEQUENCE(name, seqId, storageMedium, cachePolicy, seqFlags) \ + extern u8 name##_Start[]; \ + extern u8 name##_Size[]; +#define DEFINE_SEQUENCE_PTR(seqIdReal, seqId, storageMediumReal, cachePolicyReal, seqFlags) /*empty*/ + +#include "tables/sequence_table.h" + +#undef DEFINE_SEQUENCE +#undef DEFINE_SEQUENCE_PTR + +// Table header + +NO_REORDER AudioTableHeader sSequenceTableHeader = { +// The table contains the number of sequences, count them with the preprocessor +#define DEFINE_SEQUENCE(name, seqId, storageMedium, cachePolicy, seqFlags) 1 + +#define DEFINE_SEQUENCE_PTR(seqIdReal, seqId, storageMediumReal, cachePolicyReal, seqFlags) 1 + + +#include "tables/sequence_table.h" + +#undef DEFINE_SEQUENCE +#undef DEFINE_SEQUENCE_PTR + 0, + + 0, + 0x00000000, + { 0, 0, 0, 0, 0, 0, 0, 0 }, +}; + +// Table body + +NO_REORDER AudioTableEntry sSequenceTableEntries[] = { +#define DEFINE_SEQUENCE(name, seqId, storageMedium, cachePolicy, seqFlags) \ + { (u32)name##_Start, (u32)name##_Size, (storageMedium), (cachePolicy), 0, 0, 0 }, +#define DEFINE_SEQUENCE_PTR(seqIdReal, seqId, storageMediumReal, cachePolicyReal, seqFlags) \ + { (seqIdReal), 0, (storageMediumReal), (cachePolicyReal), 0, 0, 0 }, + +#include "tables/sequence_table.h" + +#undef DEFINE_SEQUENCE +#undef DEFINE_SEQUENCE_PTR +}; diff --git a/src/audio/tables/soundfont_table.c b/src/audio/tables/soundfont_table.c new file mode 100644 index 0000000000..65d1fc9a52 --- /dev/null +++ b/src/audio/tables/soundfont_table.c @@ -0,0 +1,50 @@ +#include "attributes.h" +#include "z64audio.h" + +// Symbol definition + +extern AudioTable gSoundFontTable; +#pragma weak gSoundFontTable = sSoundFontTableHeader + +// Externs for table + +#define DEFINE_SOUNDFONT(name, medium, cachePolicy, sampleBankNormal, sampleBankDD, nInstruments, nDrums, nSfx) \ + extern u8 name##_Start[]; \ + extern u8 name##_Size[]; + +#include "assets/audio/soundfont_table.h" + +#undef DEFINE_SOUNDFONT + +// Table header + +NO_REORDER AudioTableHeader sSoundFontTableHeader = { +// The table contains the number of soundfonts, count them with the preprocessor +#define DEFINE_SOUNDFONT(name, medium, cachePolicy, sampleBankNormal, sampleBankDD, nInstruments, nDrums, nSfx) 1 + + +#include "assets/audio/soundfont_table.h" + 0, + +#undef DEFINE_SOUNDFONT + + 0, + 0x00000000, + { 0, 0, 0, 0, 0, 0, 0, 0 }, +}; + +// Table body + +NO_REORDER AudioTableEntry sSoundFontTableEntries[] = { +#define DEFINE_SOUNDFONT(name, medium, cachePolicy, sampleBankNormal, sampleBankDD, nInstruments, nDrums, nSfx) \ + { (u32)name##_Start, \ + (u32)name##_Size, \ + (medium), \ + (cachePolicy), \ + ((sampleBankNormal) << 8) | (sampleBankDD), \ + ((nInstruments) << 8) | (nDrums), \ + (nSfx) }, + +#include "assets/audio/soundfont_table.h" + +#undef DEFINE_SOUNDFONT +}; diff --git a/src/boot/assert.c b/src/boot/assert.c index fa206fc360..e58f2cc1e7 100644 --- a/src/boot/assert.c +++ b/src/boot/assert.c @@ -1,4 +1,5 @@ #include "global.h" +#include "fault.h" NORETURN void __assert(const char* assertion, const char* file, int line) { char msg[256]; diff --git a/src/boot/boot_main.c b/src/boot/boot_main.c index 9b9cedb67b..351095c2e7 100644 --- a/src/boot/boot_main.c +++ b/src/boot/boot_main.c @@ -1,5 +1,12 @@ #include "global.h" #include "boot.h" +#include "stack.h" +#if PLATFORM_N64 +#include "cic6105.h" +#endif + +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:128" StackEntry sBootThreadInfo; OSThread sIdleThread; @@ -7,17 +14,19 @@ STACK(sIdleThreadStack, 0x400); StackEntry sIdleThreadInfo; STACK(sBootThreadStack, BOOT_STACK_SIZE); -void cleararena(void) { - bzero(_dmadataSegmentStart, osMemSize - OS_K0_TO_PHYSICAL(_dmadataSegmentStart)); +void bootclear(void) { + bzero(_bootSegmentEnd, osMemSize - OS_K0_TO_PHYSICAL(_bootSegmentEnd)); } void bootproc(void) { StackCheck_Init(&sBootThreadInfo, sBootThreadStack, STACK_TOP(sBootThreadStack), 0, -1, "boot"); osMemSize = osGetMemSize(); - cleararena(); - __osInitialize_common(); - __osInitialize_autodetect(); +#if PLATFORM_N64 + func_80001720(); +#endif + bootclear(); + osInitialize(); gCartHandle = osCartRomInit(); osDriveRomInit(); diff --git a/src/boot/build.c b/src/boot/build.c index 5de9d73d6c..473235189c 100644 --- a/src/boot/build.c +++ b/src/boot/build.c @@ -1,4 +1,5 @@ #include "config.h" +#include "versions.h" #define STRINGIFY(s) #s #define EXPAND_AND_STRINGIFY(s) STRINGIFY(s) @@ -11,4 +12,4 @@ char const gBuildMakeOption[] = "DEBUG"; char const gBuildGitVersion[] = EXPAND_AND_STRINGIFY(PACKAGE_VERSION); -char const gBuildTeam[] = ""; +char const gBuildCreator[] = ""; diff --git a/src/boot/carthandle.c b/src/boot/carthandle.c new file mode 100644 index 0000000000..16d3160b55 --- /dev/null +++ b/src/boot/carthandle.c @@ -0,0 +1,3 @@ +#include "ultra64.h" + +OSPiHandle* gCartHandle = NULL; diff --git a/src/boot/cic6105.c b/src/boot/cic6105.c new file mode 100644 index 0000000000..0d9c8142fb --- /dev/null +++ b/src/boot/cic6105.c @@ -0,0 +1,79 @@ +#pragma increment_block_number "ntsc-1.2:128" + +#include "global.h" +#include "cic6105.h" +#include "fault.h" + +s32 func_80001714(void); + +OSTask D_800067C0_unknown = { + 4, 0, rspbootTextStart, 0x3E8, cic6105TextStart, 0x20, (u64*)gBuildCreator, 8, NULL, 0, NULL, 0, NULL, 0, NULL, 0, +}; + +s32 B_80008EE0; +s32 B_80008EE4; +FaultClient sCIC6105FaultClient; +s32 B_80008EF8; +s32 B_80008EFC; + +void func_800014D0(void) { + R_AUDIOMGR_DEBUG_LEVEL = AUDIOMGR_DEBUG_LEVEL_NO_RSP; +} + +void func_800014E8(void) { + R_AUDIOMGR_DEBUG_LEVEL = AUDIOMGR_DEBUG_LEVEL_NONE; +} + +void CIC6105_FaultClient(void) { + s32 spStatus; + + spStatus = IO_READ(SP_STATUS_REG); + Fault_SetCursor(48, 200); + if (spStatus & SP_STATUS_SIG7) { + Fault_Printf("OCARINA %08x %08x", B_80008EF8, B_80008EFC); + } else { + Fault_Printf("LEGEND %08x %08x", B_80008EF8, B_80008EFC); + } + Fault_SetCursor(40, 184); + Fault_Printf("ROM_F"); + Fault_Printf(" [Creator:%s]", gBuildCreator); + Fault_SetCursor(96, 32); + Fault_Printf("I LOVE YOU %08x", func_80001714()); +} + +void CIC6105_AddFaultClient(void) { + Fault_AddClient(&sCIC6105FaultClient, CIC6105_FaultClient, NULL, NULL); +} + +void CIC6105_RemoveFaultClient(void) { + Fault_RemoveClient(&sCIC6105FaultClient); +} + +void func_80001640(void) { + OSScTask sp38; + OSMesgQueue queue; + OSMesg msg; + + osCreateMesgQueue(&queue, &msg, 1); + sp38.next = NULL; + sp38.flags = OS_SC_NEEDS_RSP; + sp38.msgQueue = &queue; + sp38.msg = (OSMesg)0; + sp38.framebuffer = 0; + sp38.list = D_800067C0_unknown; + osSendMesg(&gScheduler.cmdQueue, &sp38, OS_MESG_BLOCK); + Sched_Notify(&gScheduler); + osRecvMesg(&queue, NULL, 1); + B_80008EF8 = IO_READ(SP_DMEM_START + 0xFF4); + B_80008EFC = IO_READ(SP_DMEM_START + 0xFFC); + func_80001714(); +} + +s32 func_80001714(void) { + return 0; +} + +void func_80001720(void) { + B_80008EE0 = IO_READ(0x002FB1F4); + B_80008EE4 = IO_READ(0x002FE1C0); +} diff --git a/src/libultra/io/driverominit.c b/src/boot/driverominit.c similarity index 100% rename from src/libultra/io/driverominit.c rename to src/boot/driverominit.c diff --git a/src/boot/idle.c b/src/boot/idle.c index 10af3d3a06..0b9a4a1ac0 100644 --- a/src/boot/idle.c +++ b/src/boot/idle.c @@ -1,40 +1,53 @@ #include "global.h" +#include "stack.h" #include "terminal.h" +#include "versions.h" -// For retail BSS ordering, the block number of sMainThread must be 0 or -// just above (the exact upper bound depends on the block numbers assigned to -// extern variables declared in headers). -#pragma increment_block_number 60 +#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-jp:64 gc-jp-ce:64 gc-jp-mq:64 gc-us:64 gc-us-mq:64 ntsc-1.2:64" OSThread sMainThread; +#if OOT_VERSION < PAL_1_0 +STACK(sMainStack, 0x800); +#else STACK(sMainStack, 0x900); +#endif StackEntry sMainStackInfo; OSMesg sPiMgrCmdBuff[50]; OSMesgQueue gPiMgrCmdQueue; OSViMode gViConfigMode; + +#if OOT_VERSION < PAL_1_0 +u8 gViConfigModeType = OS_VI_NTSC_LPN1; +#else u8 gViConfigModeType; +#endif -s8 D_80009430 = 1; -vu8 gViConfigBlack = true; -u8 gViConfigAdditionalScanLines = 0; -u32 gViConfigFeatures = OS_VI_DITHER_FILTER_ON | OS_VI_GAMMA_OFF; -f32 gViConfigXScale = 1.0; -f32 gViConfigYScale = 1.0; +// Unused +void* D_80009410[] = { + osStopThread, __osSetHWIntrRoutine, +#if PLATFORM_N64 + osEPiWriteIo, osEPiReadIo, +#endif + __osSetFpcCsr, __osGetFpcCsr, __osGetHWIntrRoutine, __osSetHWIntrRoutine, osViGetNextFramebuffer, +#if !PLATFORM_N64 + bcmp, +#endif +}; void Main_ThreadEntry(void* arg) { OSTime time; - PRINTF("mainx 実行開始\n"); + PRINTF(T("mainx 実行開始\n", "mainx execution started\n")); DmaMgr_Init(); - PRINTF("codeセグメントロード中..."); + PRINTF(T("codeセグメントロード中...", "code segment loading...")); time = osGetTime(); DMA_REQUEST_SYNC(_codeSegmentStart, (uintptr_t)_codeSegmentRomStart, _codeSegmentRomEnd - _codeSegmentRomStart, "../idle.c", 238); time -= osGetTime(); - PRINTF("\rcodeセグメントロード中...完了\n"); - PRINTF("転送時間 %6.3f\n"); + PRINTF(T("\rcodeセグメントロード中...完了\n", "\rcode segment loading... Done\n")); + PRINTF(T("転送時間 %6.3f\n", "Transfer time %6.3f\n")); bzero(_codeSegmentBssStart, _codeSegmentBssEnd - _codeSegmentBssStart); - PRINTF("codeセグメントBSSクリア完了\n"); + PRINTF(T("codeセグメントBSSクリア完了\n", "code segment BSS cleared\n")); #if ENABLE_HACKER_DEBUG PRINTF("[HackerOoT:Info]: Loading 'debug' segment...\n"); @@ -45,30 +58,38 @@ void Main_ThreadEntry(void* arg) { #endif Main(arg); - PRINTF("mainx 実行終了\n"); + PRINTF(T("mainx 実行終了\n", "mainx execution finished\n")); } void Idle_ThreadEntry(void* arg) { - PRINTF("アイドルスレッド(idleproc)実行開始\n"); - PRINTF("作製者 : %s\n", gBuildTeam); + PRINTF(T("アイドルスレッド(idleproc)実行開始\n", "Idle thread (idleproc) execution started\n")); + PRINTF(T("作製者 : %s\n", "Created by: %s\n"), gBuildCreator); PRINTF("MAKEOPTION: %s\n", gBuildMakeOption); PRINTF(VT_FGCOL(GREEN)); - PRINTF("RAMサイズは %d キロバイトです(osMemSize/osGetMemSize)\n", (s32)osMemSize / 1024); - PRINTF("_bootSegmentEnd(%08x) 以降のRAM領域はクリアされました(boot)\n", _bootSegmentEnd); - PRINTF("Zバッファのサイズは %d キロバイトです\n", 0x96); - PRINTF("ダイナミックバッファのサイズは %d キロバイトです\n", 0x92); - PRINTF("FIFOバッファのサイズは %d キロバイトです\n", 0x60); - PRINTF("YIELDバッファのサイズは %d キロバイトです\n", 3); - PRINTF("オーディオヒープのサイズは %d キロバイトです\n", + PRINTF(T("RAMサイズは %d キロバイトです(osMemSize/osGetMemSize)\n", + "RAM size is %d kilobytes (osMemSize/osGetMemSize)\n"), + (s32)osMemSize / 1024); + PRINTF(T("_bootSegmentEnd(%08x) 以降のRAM領域はクリアされました(boot)\n", + "The RAM area after _bootSegmentEnd(%08x) has been cleared (boot)\n"), + _bootSegmentEnd); + PRINTF(T("Zバッファのサイズは %d キロバイトです\n", "Z buffer size is %d kilobytes\n"), 0x96); + PRINTF(T("ダイナミックバッファのサイズは %d キロバイトです\n", "The dynamic buffer size is %d kilobytes\n"), 0x92); + PRINTF(T("FIFOバッファのサイズは %d キロバイトです\n", "FIFO buffer size is %d kilobytes\n"), 0x60); + PRINTF(T("YIELDバッファのサイズは %d キロバイトです\n", "YIELD buffer size is %d kilobytes\n"), 3); + PRINTF(T("オーディオヒープのサイズは %d キロバイトです\n", "Audio heap size is %d kilobytes\n"), ((intptr_t)&gAudioHeap[ARRAY_COUNT(gAudioHeap)] - (intptr_t)gAudioHeap) / 1024); PRINTF(VT_RST); osCreateViManager(OS_PRIORITY_VIMGR); +#if OOT_VERSION >= PAL_1_0 gViConfigFeatures = OS_VI_GAMMA_OFF | OS_VI_DITHER_FILTER_ON; gViConfigXScale = 1.0f; gViConfigYScale = 1.0f; +#endif +#if OOT_DEBUG + // Allow both 60 Hz and 50 Hz switch (osTvType) { case OS_TV_NTSC: gViConfigModeType = OS_VI_NTSC_LAN1; @@ -85,12 +106,44 @@ void Idle_ThreadEntry(void* arg) { gViConfigMode = osViModeMpalLan1; break; } +#elif !OOT_PAL_N64 + // 60 Hz only (GameCube and NTSC N64) + switch (osTvType) { + case OS_TV_PAL: + case OS_TV_NTSC: + gViConfigModeType = OS_VI_NTSC_LAN1; + gViConfigMode = osViModeNtscLan1; + break; + + case OS_TV_MPAL: + gViConfigModeType = OS_VI_MPAL_LAN1; + gViConfigMode = osViModeMpalLan1; + break; + } +#else + // 50 Hz only (PAL N64) + switch (osTvType) { + case OS_TV_NTSC: + case OS_TV_MPAL: + case OS_TV_PAL: + gViConfigModeType = OS_VI_FPAL_LAN1; + gViConfigMode = osViModeFpalLan1; + gViConfigYScale = 0.833f; + break; + } +#endif +#if OOT_VERSION < PAL_1_0 + osViSetMode(&gViConfigMode); + osViBlack(true); +#else D_80009430 = 1; osViSetMode(&gViConfigMode); ViConfig_UpdateVi(true); osViBlack(true); osViSwapBuffer((void*)0x803DA80); //! @bug Invalid vram address (probably intended to be 0x803DA800) +#endif + osCreatePiManager(OS_PRIORITY_PIMGR, &gPiMgrCmdQueue, sPiMgrCmdBuff, ARRAY_COUNT(sPiMgrCmdBuff)); StackCheck_Init(&sMainStackInfo, sMainStack, STACK_TOP(sMainStack), 0, 0x400, "main"); osCreateThread(&sMainThread, THREAD_ID_MAIN, Main_ThreadEntry, arg, STACK_TOP(sMainStack), THREAD_PRI_MAIN_INIT); diff --git a/src/boot/is_debug.c b/src/boot/is_debug.c index 365e4d8a5f..99fd5284b3 100644 --- a/src/boot/is_debug.c +++ b/src/boot/is_debug.c @@ -48,6 +48,11 @@ void rmonPrintf(const char* fmt, ...) { va_end(args); } +#if OOT_VERSION < PAL_1_0 +void func_800015F4(void) { +} +#endif + #if IS_DEBUG void* is_proutSyncPrintf(void* arg, const char* str, size_t count) { u32 data; diff --git a/src/boot/logutils.c b/src/boot/logutils.c index 1a6331606f..2b5045be4d 100644 --- a/src/boot/logutils.c +++ b/src/boot/logutils.c @@ -1,16 +1,19 @@ #include "global.h" +#include "fault.h" #include "terminal.h" -#if IS_DEBUG +#if PLATFORM_N64 || IS_DEBUG f32 LogUtils_CheckFloatRange(const char* exp, int line, const char* valueName, f32 value, const char* minName, f32 min, const char* maxName, f32 max) { if (value < min || max < value) { - PRINTF("%s %d: range error %s(%f) < %s(%f) < %s(%f)\n", exp, line, minName, min, valueName, value, maxName, - max); + osSyncPrintf("%s %d: range error %s(%f) < %s(%f) < %s(%f)\n", exp, line, minName, min, valueName, value, + maxName, max); } return value; } +#endif +#if OOT_DEBUG s32 LogUtils_CheckIntRange(const char* exp, int line, const char* valueName, s32 value, const char* minName, s32 min, const char* maxName, s32 max) { if (value < min || max < value) { @@ -81,19 +84,24 @@ void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* fi u32 mask = (unk - 1); if (value & mask) { - PRINTF(VT_COL(RED, WHITE) "%s %d:%s(%08x) は バウンダリ(%d)違反です\n" VT_RST, file, line, name, value, unk); + PRINTF(VT_COL(RED, WHITE) T("%s %d:%s(%08x) は バウンダリ(%d)違反です\n", + "%s %d:%s(%08x) is a boundary (%d) violation\n") VT_RST, + file, line, name, value, unk); } } void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, int line) { if (ptr == NULL) { - PRINTF(VT_COL(RED, WHITE) "%s %d:%s は はヌルポインタです\n" VT_RST, file, line, exp); + PRINTF(VT_COL(RED, WHITE) T("%s %d:%s は はヌルポインタです\n", "%s %d:%s is a null pointer\n") VT_RST, file, + line, exp); } } void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, int line) { if (ptr == NULL || (u32)ptr < 0x80000000 || (0x80000000 + osMemSize) <= (u32)ptr) { - PRINTF(VT_COL(RED, WHITE) "%s %d:ポインタ %s(%08x) が異常です\n" VT_RST, file, line, exp, ptr); + PRINTF(VT_COL(RED, WHITE) T("%s %d:ポインタ %s(%08x) が異常です\n", "%s %d: Pointer %s(%08x) is invalid\n") + VT_RST, + file, line, exp, ptr); } } @@ -105,11 +113,15 @@ void LogUtils_LogThreadId(const char* name, int line) { void LogUtils_HungupThread(const char* name, int line) { OSId threadId = osGetThreadId(NULL); - PRINTF("*** HungUp in thread %d, [%s:%d] ***\n", threadId, name, line); +#if PLATFORM_N64 || OOT_DEBUG + osSyncPrintf("*** HungUp in thread %d, [%s:%d] ***\n", threadId, name, line); +#endif Fault_AddHungupAndCrash(name, line); } void LogUtils_ResetHungup(void) { - PRINTF("*** Reset ***\n"); +#if PLATFORM_N64 || OOT_DEBUG + osSyncPrintf("*** Reset ***\n"); +#endif Fault_AddHungupAndCrash("Reset", 0); } diff --git a/src/boot/stackcheck.c b/src/boot/stackcheck.c index 5c8cee3d81..7168bf07ee 100644 --- a/src/boot/stackcheck.c +++ b/src/boot/stackcheck.c @@ -17,14 +17,19 @@ void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 i entry->initValue = initValue; entry->minSpace = minSpace; entry->name = name; + +#if !PLATFORM_N64 iter = sStackInfoListStart; while (iter) { if (iter == entry) { - PRINTF(VT_COL(RED, WHITE) "stackcheck_init: %08x は既にリスト中にある\n" VT_RST, entry); + PRINTF(VT_COL(RED, WHITE) T("stackcheck_init: %08x は既にリスト中にある\n", + "stackcheck_init: %08x is already in the list\n") VT_RST, + entry); return; } iter = iter->next; } +#endif entry->prev = sStackInfoListEnd; entry->next = NULL; @@ -48,6 +53,17 @@ void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 i } void StackCheck_Cleanup(StackEntry* entry) { +#if PLATFORM_N64 + if (!entry->prev) { + sStackInfoListStart = entry->next; + } else { + entry->prev->next = entry->next; + } + + if (!entry->next) { + sStackInfoListEnd = entry->prev; + } +#else u32 inconsistency = false; if (!entry->prev) { @@ -67,11 +83,64 @@ void StackCheck_Cleanup(StackEntry* entry) { inconsistency = true; } } + if (inconsistency) { - PRINTF(VT_COL(RED, WHITE) "stackcheck_cleanup: %08x リスト不整合です\n" VT_RST, entry); + PRINTF(VT_COL(RED, WHITE) T("stackcheck_cleanup: %08x リスト不整合です\n", + "stackcheck_cleanup: %08x list inconsistent\n") VT_RST, + entry); + } +#endif +} + +#if PLATFORM_N64 + +u32 StackCheck_Check(StackEntry* entry) { + if (entry == NULL) { + u32 ret = 0; + StackEntry* iter = sStackInfoListStart; + + while (iter) { + u32 state = StackCheck_Check(iter); + + if (state != STACK_STATUS_OK) { + ret = 1; + } + iter = iter->next; + } + + return ret; + } else { + u32* last; + u32 used; + u32 free; + u32 ret; + + for (last = entry->head; last < entry->tail; last++) { + if (entry->initValue != *last) { + break; + } + } + + used = (uintptr_t)entry->tail - (uintptr_t)last; + free = (uintptr_t)last - (uintptr_t)entry->head; + + if (free == 0) { + ret = STACK_STATUS_OVERFLOW; + } else if (free < (u32)entry->minSpace && entry->minSpace != -1) { + ret = STACK_STATUS_WARNING; + } else { + ret = STACK_STATUS_OK; + } + + osSyncPrintf("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, + free, entry->name != NULL ? entry->name : "(null)"); + + return ret; } } +#else + u32 StackCheck_GetState(StackEntry* entry) { u32* last; u32 used; @@ -139,3 +208,5 @@ u32 StackCheck_Check(StackEntry* entry) { return StackCheck_GetState(entry); } } + +#endif diff --git a/src/boot/viconfig.c b/src/boot/viconfig.c index 4ac95122c7..ae50922e63 100644 --- a/src/boot/viconfig.c +++ b/src/boot/viconfig.c @@ -1,8 +1,12 @@ #include "global.h" #include "terminal.h" -// this should probably go elsewhere but right now viconfig.o is the only object between idle and z_std_dma -OSPiHandle* gCartHandle = NULL; +s8 D_80009430 = 1; +vu8 gViConfigBlack = true; +u8 gViConfigAdditionalScanLines = 0; +u32 gViConfigFeatures = OS_VI_DITHER_FILTER_ON | OS_VI_GAMMA_OFF; +f32 gViConfigXScale = 1.0; +f32 gViConfigYScale = 1.0; void ViConfig_UpdateVi(u32 black) { if (black) { diff --git a/src/boot/vimodepal60lan1.c b/src/boot/vimodepal60lan1.c index de95a66d99..5a7bf692be 100644 --- a/src/boot/vimodepal60lan1.c +++ b/src/boot/vimodepal60lan1.c @@ -23,7 +23,7 @@ OSViMode gCustomViModePal60Lan1 = { { // comRegs VI_CTRL_TYPE_16 | VI_CTRL_GAMMA_DITHER_ON | VI_CTRL_GAMMA_ON | VI_CTRL_DIVOT_ON | VI_CTRL_ANTIALIAS_MODE_1 | - VI_CTRL_PIXEL_ADV(3), // ctrl + VI_CTRL_PIXEL_ADV_3, // ctrl WIDTH(320), // width BURST(58, 30, 4, 69), // burst // Ideally VSYNC would be 525 but this produces marginally-too-slow retraces. 519 is the closest value that diff --git a/src/boot/z_locale.c b/src/boot/z_locale.c index 533806c180..86707020bd 100644 --- a/src/boot/z_locale.c +++ b/src/boot/z_locale.c @@ -1,12 +1,25 @@ #include "global.h" +#include "region.h" #include "terminal.h" +#include "versions.h" -u32 gCurrentRegion = 0; -LocaleCartInfo sCartInfo; +s32 gCurrentRegion = 0; void Locale_Init(void) { +#if PLATFORM_N64 + ALIGNED(4) u8 regionInfo[4]; + u8 countryCode; + + osEPiReadIo(gCartHandle, 0x3C, (u32*)regionInfo); + + countryCode = regionInfo[2]; +#else + static LocaleCartInfo sCartInfo; + u8 countryCode; + osEPiReadIo(gCartHandle, 0x38, &sCartInfo.mediaFormat); osEPiReadIo(gCartHandle, 0x3C, &sCartInfo.regionInfo); +#endif if (sCartInfo.countryCode == '\0') { // Fix-up for region free header @@ -33,18 +46,30 @@ void Locale_Init(void) { case 'E': // "NTSC-U (North America)" gCurrentRegion = REGION_US; break; +#if OOT_VERSION >= PAL_1_0 case 'P': // "PAL (Europe)" gCurrentRegion = REGION_EU; break; +#endif default: PRINTF(VT_COL(RED, WHITE)); - PRINTF("z_locale_init: 日本用かアメリカ用か判別できません\n"); + PRINTF(T("z_locale_init: 日本用かアメリカ用か判別できません\n", + "z_locale_init: Can't tell if it's for Japan or America\n")); +#if OOT_VERSION < NTSC_1_1 + LogUtils_HungupThread("../z_locale.c", 86); +#elif OOT_VERSION < PAL_1_0 + LogUtils_HungupThread("../z_locale.c", 92); +#elif OOT_VERSION < GC_JP + LogUtils_HungupThread("../z_locale.c", 101); +#else LogUtils_HungupThread("../z_locale.c", 118); +#endif PRINTF(VT_RST); break; } - PRINTF("z_locale_init:日本用かアメリカ用か3コンで判断させる\n"); + PRINTF(T("z_locale_init:日本用かアメリカ用か3コンで判断させる\n", + "z_locale_init: Determine whether it is for Japan or America using 3 controls\n")); } void Locale_ResetRegion(void) { @@ -53,7 +78,7 @@ void Locale_ResetRegion(void) { #if IS_DEBUG u32 func_80001F48(void) { - if (gCurrentRegion == REGION_NATIVE) { + if (gCurrentRegion == OOT_REGION) { return 0; } @@ -65,7 +90,7 @@ u32 func_80001F48(void) { } u32 func_80001F8C(void) { - if (gCurrentRegion == REGION_NATIVE) { + if (gCurrentRegion == OOT_REGION) { return 0; } @@ -78,6 +103,6 @@ u32 func_80001F8C(void) { // This function appears to be unused? u32 Locale_IsRegionNative(void) { - return gCurrentRegion == REGION_NATIVE; + return gCurrentRegion == OOT_REGION; } #endif diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index 5cb0f51876..bdbaaa9eb4 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -19,33 +19,45 @@ * to be uncompressed and the request queue and address translation is skipped. */ #include "global.h" +#include "fault.h" +#include "stack.h" #include "terminal.h" #include "compression.h" +#if PLATFORM_N64 +#include "n64dd.h" +#endif + +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:92 pal-1.0:90 pal-1.1:90" StackEntry sDmaMgrStackInfo; OSMesgQueue sDmaMgrMsgQueue; OSMesg sDmaMgrMsgBuf[32]; -OSThread sDmaMgrThread; -STACK(sDmaMgrStack, 0x500); -const char* sDmaMgrCurFileName; -s32 sDmaMgrCurFileLine; u32 gDmaMgrVerbose = 0; size_t gDmaMgrDmaBuffSize = DMAMGR_DEFAULT_BUFSIZE; u32 sDmaMgrIsRomCompressed = false; +OSThread sDmaMgrThread; +STACK(sDmaMgrStack, 0x500); + +#if IS_DEBUG + +const char* sDmaMgrCurFileName; +s32 sDmaMgrCurFileLine; + // dmadata filenames #define DEFINE_DMA_ENTRY(_0, nameString) nameString, -#if IS_DEBUG const char* sDmaMgrFileNames[] = { #include "tables/dmadata_table.h" }; + #endif #undef DEFINE_DMA_ENTRY -#if IS_DEBUG +#if PLATFORM_N64 || IS_DEBUG /** * Compares `str1` and `str2`. * @@ -113,8 +125,9 @@ s32 DmaMgr_DmaRomToRam(uintptr_t rom, void* ram, size_t size) { ioMsg.size = buffSize; if (gDmaMgrVerbose == 10) { - PRINTF("%10lld ノーマルDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), ioMsg.dramAddr, - ioMsg.devAddr, ioMsg.size, MQ_GET_COUNT(&gPiMgrCmdQueue)); + PRINTF(T("%10lld ノーマルDMA %08x %08x %08x (%d)\n", "%10lld Normal DMA %08x %08x %08x (%d)\n"), + OS_CYCLES_TO_USEC(osGetTime()), ioMsg.dramAddr, ioMsg.devAddr, ioMsg.size, + MQ_GET_COUNT(&gPiMgrCmdQueue)); } ret = osEPiStartDma(gCartHandle, &ioMsg, OS_READ); @@ -123,12 +136,14 @@ s32 DmaMgr_DmaRomToRam(uintptr_t rom, void* ram, size_t size) { } if (gDmaMgrVerbose == 10) { - PRINTF("%10lld ノーマルDMA START (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), MQ_GET_COUNT(&gPiMgrCmdQueue)); + PRINTF(T("%10lld ノーマルDMA START (%d)\n", "%10lld Normal DMA START (%d)\n"), + OS_CYCLES_TO_USEC(osGetTime()), MQ_GET_COUNT(&gPiMgrCmdQueue)); } osRecvMesg(&queue, NULL, OS_MESG_BLOCK); if (gDmaMgrVerbose == 10) { - PRINTF("%10lld ノーマルDMA END (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), MQ_GET_COUNT(&gPiMgrCmdQueue)); + PRINTF(T("%10lld ノーマルDMA END (%d)\n", "%10lld Normal DMA END (%d)\n"), + OS_CYCLES_TO_USEC(osGetTime()), MQ_GET_COUNT(&gPiMgrCmdQueue)); } size -= buffSize; @@ -147,8 +162,9 @@ s32 DmaMgr_DmaRomToRam(uintptr_t rom, void* ram, size_t size) { ioMsg.size = size; if (gDmaMgrVerbose == 10) { - PRINTF("%10lld ノーマルDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), ioMsg.dramAddr, - ioMsg.devAddr, ioMsg.size, MQ_GET_COUNT(&gPiMgrCmdQueue)); + PRINTF(T("%10lld ノーマルDMA %08x %08x %08x (%d)\n", "%10lld Normal DMA %08x %08x %08x (%d)\n"), + OS_CYCLES_TO_USEC(osGetTime()), ioMsg.dramAddr, ioMsg.devAddr, ioMsg.size, + MQ_GET_COUNT(&gPiMgrCmdQueue)); } ret = osEPiStartDma(gCartHandle, &ioMsg, OS_READ); @@ -158,7 +174,8 @@ s32 DmaMgr_DmaRomToRam(uintptr_t rom, void* ram, size_t size) { osRecvMesg(&queue, NULL, OS_MESG_BLOCK); if (gDmaMgrVerbose == 10) { - PRINTF("%10lld ノーマルDMA END (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), MQ_GET_COUNT(&gPiMgrCmdQueue)); + PRINTF(T("%10lld ノーマルDMA END (%d)\n", "%10lld Normal DMA END (%d)\n"), OS_CYCLES_TO_USEC(osGetTime()), + MQ_GET_COUNT(&gPiMgrCmdQueue)); } end: @@ -185,9 +202,17 @@ s32 DmaMgr_AudioDmaHandler(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction) { ASSERT(direction == OS_READ, "direction == OS_READ", "../z_std_dma.c", 531); ASSERT(mb != NULL, "mb != NULL", "../z_std_dma.c", 532); +#if PLATFORM_N64 + if (D_80121212) { + while (D_80121214) { + Sleep_Msec(1000); + } + } +#endif + if (gDmaMgrVerbose == 10) { - PRINTF("%10lld サウンドDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), mb->dramAddr, mb->devAddr, - mb->size, MQ_GET_COUNT(&gPiMgrCmdQueue)); + PRINTF(T("%10lld サウンドDMA %08x %08x %08x (%d)\n", "%10lld Sound DMA %08x %08x %08x (%d)\n"), + OS_CYCLES_TO_USEC(osGetTime()), mb->dramAddr, mb->devAddr, mb->size, MQ_GET_COUNT(&gPiMgrCmdQueue)); } ret = osEPiStartDma(pihandle, mb, direction); @@ -205,6 +230,9 @@ s32 DmaMgr_AudioDmaHandler(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction) { * @param size Size of transfer. */ void DmaMgr_DmaFromDriveRom(void* ram, uintptr_t rom, size_t size) { +#if PLATFORM_N64 + s32 pad; +#endif OSPiHandle* handle = osDriveRomInit(); OSMesgQueue queue; OSMesg msg; @@ -245,8 +273,7 @@ NORETURN void DmaMgr_Error(DmaRequest* req, const char* filename, const char* er PRINTF("%c", BEL); PRINTF(VT_FGCOL(RED)); - // "DMA Fatal Error" - PRINTF("DMA致命的エラー(%s)\nROM:%X RAM:%X SIZE:%X %s\n", + PRINTF(T("DMA致命的エラー(%s)\nROM:%X RAM:%X SIZE:%X %s\n", "DMA Fatal Error (%s)\nROM:%X RAM:%X SIZE:%X %s\n"), errorDesc != NULL ? errorDesc : (errorName != NULL ? errorName : "???"), vrom, ram, size, filename != NULL ? filename : "???"); @@ -270,11 +297,17 @@ NORETURN void DmaMgr_Error(DmaRequest* req, const char* filename, const char* er Fault_AddHungupAndCrashImpl(buff1, buff2); } -#define DMA_ERROR(req, filename, errorName, errorDesc, file, line) DmaMgr_Error(req, filename, errorName, errorDesc) +#define DMA_ERROR(req, filename, errorName, errorDesc, file, line1, line2, line3) \ + DmaMgr_Error(req, filename, errorName, errorDesc) +#elif OOT_VERSION < NTSC_1_1 +#define DMA_ERROR(req, filename, errorName, errorDesc, file, line1, line2, line3) Fault_AddHungupAndCrash(file, line1) +#elif OOT_VERSION < GC_JP +#define DMA_ERROR(req, filename, errorName, errorDesc, file, line1, line2, line3) Fault_AddHungupAndCrash(file, line2) #else -#define DMA_ERROR(req, filename, errorName, errorDesc, file, line) Fault_AddHungupAndCrash(file, line) +#define DMA_ERROR(req, filename, errorName, errorDesc, file, line1, line2, line3) Fault_AddHungupAndCrash(file, line3) #endif +#if PLATFORM_GC /** * Searches the filesystem for the entry containing the address `vrom`. Retrieves the name of this entry from * the array of file names. @@ -304,6 +337,7 @@ const char* DmaMgr_FindFileName(uintptr_t vrom) { return NULL; #endif } +#endif const char* DmaMgr_GetFileName(uintptr_t vrom) { #if IS_DEBUG @@ -319,7 +353,9 @@ const char* DmaMgr_GetFileName(uintptr_t vrom) { return NULL; } return ret; -#else +#elif PLATFORM_N64 + return "??"; +#elif PLATFORM_GC return ""; #endif } @@ -333,12 +369,13 @@ void DmaMgr_ProcessRequest(DmaRequest* req) { u8 found = false; DmaEntry* iter; const char* filename; + s32 i = 0; #if IS_DEBUG // Get the filename (for debugging) filename = DmaMgr_GetFileName(vrom); -#else - // An unused empty string is defined in .rodata of retail builds, suggesting it was used near here. +#elif PLATFORM_GC + // An unused empty string is defined in .rodata of GameCube retail builds, suggesting it was used near here. filename = ""; #endif @@ -348,6 +385,15 @@ void DmaMgr_ProcessRequest(DmaRequest* req) { if (vrom >= iter->file.vromStart && vrom < iter->file.vromEnd) { // Found the region this request falls into +#if PLATFORM_N64 + // Based on the MM Debug ROM, these strings are part of the condition for the empty if statement below, + // as `... && DmaMgr_StrCmp("", "kanji") != 0 && DmaMgr_StrCmp("", "link_animetion") != 0` + (void)""; + (void)"kanji"; + (void)""; + (void)"link_animetion"; +#endif + if (0) { // The string is defined in .rodata of debug builds but not used, suggesting a debug print is here // but was optimized out in some way. @@ -361,9 +407,10 @@ void DmaMgr_ProcessRequest(DmaRequest* req) { if (iter->file.vromEnd < vrom + size) { // Error, vrom + size ends up in a different file than it started in - // "DMA transfers cannot cross segment boundaries" DMA_ERROR(req, filename, "Segment Alignment Error", - "セグメント境界をまたがってDMA転送することはできません", "../z_std_dma.c", 726); + T("セグメント境界をまたがってDMA転送することはできません", + "DMA transfers cannot cross segment boundaries"), + "../z_std_dma.c", 575, 578, 726); } DmaMgr_DmaRomToRam(iter->romStart + (vrom - iter->file.vromStart), ram, size); @@ -381,17 +428,19 @@ void DmaMgr_ProcessRequest(DmaRequest* req) { if (vrom != iter->file.vromStart) { // Error, requested vrom is not the start of a file - // "DMA transfer cannot be performed from the middle of a compressed segment" DMA_ERROR(req, filename, "Can't Transfer Segment", - "圧縮されたセグメントの途中からはDMA転送することはできません", "../z_std_dma.c", 746); + T("圧縮されたセグメントの途中からはDMA転送することはできません", + "DMA transfer cannot be performed from the middle of a compressed segment"), + "../z_std_dma.c", 595, 598, 746); } if (size != iter->file.vromEnd - iter->file.vromStart) { // Error, only part of the file was requested - // "It is not possible to DMA only part of a compressed segment" DMA_ERROR(req, filename, "Can't Transfer Segment", - "圧縮されたセグメントの一部だけをDMA転送することはできません", "../z_std_dma.c", 752); + T("圧縮されたセグメントの一部だけをDMA転送することはできません", + "It is not possible to DMA only part of a compressed segment"), + "../z_std_dma.c", 601, 604, 752); } // Reduce the thread priority and decompress the file, the decompression routine handles the DMA @@ -413,6 +462,13 @@ void DmaMgr_ProcessRequest(DmaRequest* req) { } break; } + +#if PLATFORM_N64 + if (i != 0) { + i += 4; + } +#endif + iter++; } @@ -422,15 +478,18 @@ void DmaMgr_ProcessRequest(DmaRequest* req) { if (sDmaMgrIsRomCompressed) { // Error, rom is compressed so DMA may only be requested within the filesystem bounds - // "Corresponding data does not exist" - DMA_ERROR(req, NULL, "DATA DON'T EXIST", "該当するデータが存在しません", "../z_std_dma.c", 771); + DMA_ERROR(req, NULL, "DATA DON'T EXIST", + T("該当するデータが存在しません", "Corresponding data does not exist"), "../z_std_dma.c", 621, + 624, 771); return; } else { // ROM is uncompressed, allow arbitrary DMA even if the region is not marked in the filesystem DmaMgr_DmaRomToRam(vrom, ram, size); if (0) { - PRINTF("No Press ROM:%08X RAM:%08X SIZE:%08X (非公式)\n", vrom, ram, size); + PRINTF(T("No Press ROM:%08X RAM:%08X SIZE:%08X (非公式)\n", + "No Press ROM:%08X RAM:%08X SIZE:%08X (informal)\n"), + vrom, ram, size); } } } @@ -440,8 +499,7 @@ void DmaMgr_ThreadEntry(void* arg) { OSMesg msg; DmaRequest* req; - // "DMA manager thread execution start" - PRINTF("DMAマネージャスレッド実行開始\n"); + PRINTF(T("DMAマネージャスレッド実行開始\n", "DMA manager thread execution start\n")); while (true) { // Wait for DMA Requests to arrive from other threads @@ -452,7 +510,7 @@ void DmaMgr_ThreadEntry(void* arg) { } if (0) { - PRINTF("DMA登録受付 dmap=%08x\n", req); + PRINTF(T("DMA登録受付", "DMA registration acceptance") " dmap=%08x\n", req); } // Process the DMA request @@ -467,8 +525,7 @@ void DmaMgr_ThreadEntry(void* arg) { } } - // "DMA manager thread execution end" - PRINTF("DMAマネージャスレッド実行終了\n"); + PRINTF(T("DMAマネージャスレッド実行終了\n", "DMA manager thread execution end\n")); } /** @@ -494,7 +551,16 @@ s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, // The line numbers for `DMA_ERROR` are only used in retail builds, but this usage was removed so // its line number is unknown. //! @bug `req` is passed to `DMA_ERROR` without rom, ram and size being set - DMA_ERROR(req, NULL, "ILLIGAL DMA-FUNCTION CALL", "パラメータ異常です", "../z_std_dma.c", 0); + DMA_ERROR(req, NULL, "ILLIGAL DMA-FUNCTION CALL", T("パラメータ異常です", "Parameter error"), "../z_std_dma.c", + 0, 0, 0); + } +#endif + +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_70 != NULL)) { + if (B_80121220->unk_70(req, ram, vrom, size, unk, queue, msg) != 0) { + return 0; + } } #endif @@ -510,8 +576,8 @@ s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, sDmaMgrQueueFullLogged++; PRINTF("%c", BEL); PRINTF(VT_FGCOL(RED)); - // "dmaEntryMsgQ is full. Reconsider your queue size." - PRINTF("dmaEntryMsgQが一杯です。キューサイズの再検討をおすすめします。"); + PRINTF(T("dmaEntryMsgQが一杯です。キューサイズの再検討をおすすめします。", + "dmaEntryMsgQ is full. Reconsider your queue size.")); LOG_NUM("(sizeof(dmaEntryMsgBufs) / sizeof(dmaEntryMsgBufs[0]))", ARRAY_COUNT(sDmaMgrMsgBuf), "../z_std_dma.c", 952); PRINTF(VT_RST); @@ -591,7 +657,13 @@ void DmaMgr_Init(void) { PRINTF("_bootSegmentRomStart(%08x) != dma_rom_ad[0].rom_b(%08x)\n", _bootSegmentRomStart, gDmaDataTable[0].file.vromEnd); //! @bug The main code file where fault.c resides is not yet loaded +#if OOT_VERSION < NTSC_1_1 + Fault_AddHungupAndCrash("../z_std_dma.c", 837); +#elif OOT_VERSION < GC_JP + Fault_AddHungupAndCrash("../z_std_dma.c", 840); +#else Fault_AddHungupAndCrash("../z_std_dma.c", 1055); +#endif } // Start the DMA manager diff --git a/src/code/PreRender.c b/src/code/PreRender.c index 83e177c21e..c15981c281 100644 --- a/src/code/PreRender.c +++ b/src/code/PreRender.c @@ -80,7 +80,9 @@ void PreRender_CopyImage(PreRender* this, Gfx** gfxP, void* img, void* imgDst) { s32 lrt; // Make sure that we don't load past the end of the source image - nRows = MIN(rowsRemaining, nRows); + if (nRows > rowsRemaining) { + nRows = rowsRemaining; + } // Determine the upper and lower bounds of the rect to draw ult = curRow; @@ -138,6 +140,7 @@ void PreRender_CopyImageRegionImpl(PreRender* this, Gfx** gfxP) { s32 ult; s32 lrt; s32 uly; + s32 lry; // Make sure that we don't load past the end of the source image if (nRows > rowsRemaining) { @@ -148,6 +151,7 @@ void PreRender_CopyImageRegionImpl(PreRender* this, Gfx** gfxP) { ult = this->ulySave + curRow; lrt = ult + nRows - 1; uly = this->uly + curRow; + lry = uly + nRows - 1; // Load a horizontal strip of the source image in RGBA16 format gDPLoadTextureTile(gfx++, this->fbufSave, G_IM_FMT_RGBA, G_IM_SIZ_16b, this->widthSave, this->height - 1, @@ -155,7 +159,7 @@ void PreRender_CopyImageRegionImpl(PreRender* this, Gfx** gfxP) { G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); // Draw that horizontal strip to the destination image, dsdx is 4 << 10 for COPY mode - gSPTextureRectangle(gfx++, this->ulx << 2, uly << 2, this->lrx << 2, (uly + nRows - 1) << 2, G_TX_RENDERTILE, + gSPTextureRectangle(gfx++, this->ulx << 2, uly << 2, this->lrx << 2, lry << 2, G_TX_RENDERTILE, this->ulxSave << 5, ult << 5, 4 << 10, 1 << 10); curRow += nRows; @@ -213,7 +217,9 @@ void func_800C170C(PreRender* this, Gfx** gfxP, void* buf, void* bufSave, u32 r, s32 lrt; // Make sure that we don't load past the end of the source image - nRows = MIN(rowsRemaining, nRows); + if (nRows > rowsRemaining) { + nRows = rowsRemaining; + } // Determine the upper and lower bounds of the rect to draw ult = curRow; @@ -455,15 +461,16 @@ void func_800C213C(PreRender* this, Gfx** gfxP) { curRow = 0; while (rowsRemaining > 0) { s32 uls = 0; + s32 ult = curRow; s32 lrs = this->width - 1; - s32 ult; s32 lrt; // Make sure that we don't load past the end of the source image - nRows = MIN(rowsRemaining, nRows); + if (nRows > rowsRemaining) { + nRows = rowsRemaining; + } - // Determine the upper and lower bounds of the rect to draw - ult = curRow; + // Determine the lower bound of the rect to draw lrt = curRow + nRows - 1; // Load the frame buffer line @@ -471,11 +478,15 @@ void func_800C213C(PreRender* this, Gfx** gfxP) { this->height, uls, ult, lrs, lrt, 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); + rtile = rtile; // Fake match? + // Load the coverage line gDPLoadMultiTile(gfx++, this->cvgSave, 0x0160, rtile, G_IM_FMT_I, G_IM_SIZ_8b, this->width, this->height, uls, ult, lrs, lrt, 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); + rtile = rtile; // Fake match? + // Draw a texture for which the rgb channels come from the framebuffer and the alpha channel comes from // coverage, modulated by env color gSPTextureRectangle(gfx++, uls << 2, ult << 2, (lrs + 1) << 2, (lrt + 1) << 2, G_TX_RENDERTILE, uls << 5, diff --git a/src/code/audio_thread_manager.c b/src/code/audio_thread_manager.c index a0732d8f2a..fdf6e327f0 100644 --- a/src/code/audio_thread_manager.c +++ b/src/code/audio_thread_manager.c @@ -85,8 +85,8 @@ void AudioMgr_HandleRetrace(AudioMgr* audioMgr) { * @see Audio_PreNMI */ void AudioMgr_HandlePreNMI(AudioMgr* audioMgr) { - // "Audio manager received OS_SC_PRE_NMI_MSG" - PRINTF("オーディオマネージャが OS_SC_PRE_NMI_MSG を受け取りました\n"); + PRINTF( + T("オーディオマネージャが OS_SC_PRE_NMI_MSG を受け取りました\n", "Audio manager received OS_SC_PRE_NMI_MSG\n")); Audio_PreNMI(); } @@ -95,8 +95,7 @@ void AudioMgr_ThreadEntry(void* arg) { IrqMgrClient irqClient; s16* msg = NULL; - // "Start running audio manager thread" - PRINTF("オーディオマネージャスレッド実行開始\n"); + PRINTF(T("オーディオマネージャスレッド実行開始\n", "Start running audio manager thread\n")); // Initialize audio driver Audio_Init(); @@ -158,6 +157,10 @@ void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, Schedule audioMgr->irqMgr = irqMgr; audioMgr->rspTask = NULL; +#if PLATFORM_N64 + R_AUDIOMGR_DEBUG_LEVEL = AUDIOMGR_DEBUG_LEVEL_NO_RSP; +#endif + osCreateMesgQueue(&audioMgr->taskDoneQueue, &audioMgr->taskDoneMsg, 1); osCreateMesgQueue(&audioMgr->interruptQueue, audioMgr->interruptMsgBuf, ARRAY_COUNT(audioMgr->interruptMsgBuf)); osCreateMesgQueue(&audioMgr->initQueue, &audioMgr->initMsg, 1); diff --git a/src/code/code_800430A0.c b/src/code/code_800430A0.c index 4060cc51cf..75eb8d75a9 100644 --- a/src/code/code_800430A0.c +++ b/src/code/code_800430A0.c @@ -42,10 +42,11 @@ void DynaPolyActor_UpdateCarriedActorPos(CollisionContext* colCtx, s32 bgId, Act PRINTF(VT_FGCOL(RED)); //! @bug file and line are not passed to PRINTF - // "Position is not valid" - PRINTF( - "BGCheckCollection_typicalActorPos():位置が妥当ではありません。\npos (%f,%f,%f) file:%s line:%d\n", - pos.x, pos.y, pos.z); + PRINTF(T("BGCheckCollection_typicalActorPos():位置が妥当ではありません。\n" + "pos (%f,%f,%f) file:%s line:%d\n", + "BGCheckCollection_typicalActorPos(): Position is not valid. \n" + "pos (%f,%f,%f) file:%s line:%d\n"), + pos.x, pos.y, pos.z); PRINTF(VT_RST); } #endif diff --git a/src/code/code_80069420.c b/src/code/code_80069420.c index 9a190edcf3..a08567dd65 100644 --- a/src/code/code_80069420.c +++ b/src/code/code_80069420.c @@ -27,7 +27,7 @@ void* MemCpy(void* dest, const void* src, s32 len) { /** * memset: sets `len` bytes to `val` starting at address `dest`. * - * @see There are two other memsets in this codebase, Lib_MemSet(), __osMemset(). + * @see There are two other memsets in this codebase, Lib_MemSet(), memset(). * This one is unused. * * @param dest address to start at diff --git a/src/code/code_80097A00.c b/src/code/code_80097A00.c index eecf74099a..b452a92e16 100644 --- a/src/code/code_80097A00.c +++ b/src/code/code_80097A00.c @@ -285,8 +285,7 @@ u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment) { s32 pad; u16 equipValue = gSaveContext.save.info.equips.equipment & gEquipMasks[equipment]; - // "Erasing equipment item = %d zzz=%d" - PRINTF("装備アイテム抹消 = %d zzz=%d\n", equipment, equipValue); + PRINTF(T("装備アイテム抹消 = %d zzz=%d\n", "Erasing equipment item = %d zzz=%d\n"), equipment, equipValue); if (equipValue) { equipValue >>= gEquipShifts[equipment]; diff --git a/src/code/code_800FC620.c b/src/code/code_800FC620.c index 6db8103006..247c8d725b 100644 --- a/src/code/code_800FC620.c +++ b/src/code/code_800FC620.c @@ -1,4 +1,5 @@ #include "global.h" +#include "libc64/os_malloc.h" typedef void (*arg3_800FC868)(void*); typedef void (*arg3_800FC8D8)(void*, u32); @@ -19,50 +20,73 @@ char sNew[] = "new"; char sNew[] = ""; #endif +#if !PLATFORM_N64 char D_80134488[0x18] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x00, 0x00, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, }; +#endif // possibly some kind of new() function void* func_800FC800(u32 size) { + DECLARE_INTERRUPT_MASK + void* ptr; + + DISABLE_INTERRUPTS(); + if (size == 0) { size = 1; } #if IS_DEBUG - return __osMallocDebug(&gSystemArena, size, sNew, 0); + ptr = __osMallocDebug(&gSystemArena, size, sNew, 0); #else - return __osMalloc(&gSystemArena, size); + ptr = __osMalloc(&gSystemArena, size); #endif + + RESTORE_INTERRUPTS(); + return ptr; } // possibly some kind of delete() function void func_800FC83C(void* ptr) { + DECLARE_INTERRUPT_MASK + + DISABLE_INTERRUPTS(); if (ptr != NULL) { __osFree(&gSystemArena, ptr); } + RESTORE_INTERRUPTS(); } void func_800FC868(void* blk, u32 nBlk, u32 blkSize, arg3_800FC868 arg3) { + DECLARE_INTERRUPT_MASK u32 pos; - for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0)) { + DISABLE_INTERRUPTS(); + for (pos = ((u32)blk & ~0); pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0)) { arg3((void*)pos); } + RESTORE_INTERRUPTS(); } void func_800FC8D8(void* blk, u32 nBlk, s32 blkSize, arg3_800FC8D8 arg3) { + DECLARE_INTERRUPT_MASK u32 pos; - for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0)) { + DISABLE_INTERRUPTS(); + for (pos = ((u32)blk & ~0); pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0)) { arg3((void*)pos, 2); } + RESTORE_INTERRUPTS(); } void* func_800FC948(void* blk, u32 nBlk, u32 blkSize, arg3_800FC948 arg3) { + DECLARE_INTERRUPT_MASK u32 pos; + DISABLE_INTERRUPTS(); + if (blk == NULL) { blk = func_800FC800(nBlk * blkSize); } @@ -74,29 +98,35 @@ void* func_800FC948(void* blk, u32 nBlk, u32 blkSize, arg3_800FC948 arg3) { pos = (u32)pos + (blkSize & ~0); } } + + RESTORE_INTERRUPTS(); return blk; } void func_800FCA18(void* blk, u32 nBlk, u32 blkSize, arg3_800FCA18 arg3, s32 arg4) { + DECLARE_INTERRUPT_MASK u32 pos; u32 end; - if (blk == NULL) { - return; - } - if (arg3 != NULL) { - end = (u32)blk; - pos = (u32)end + (nBlk * blkSize); + DISABLE_INTERRUPTS(); + + if (blk != NULL) { + if (arg3 != NULL) { + end = (u32)blk; + pos = (u32)end + (nBlk * blkSize); - while (pos > end) { - pos -= (s32)(blkSize & ~0); - arg3((void*)pos, 2); + while (pos > end) { + pos -= (s32)(blkSize & ~0); + arg3((void*)pos, 2); + } } - } - if (arg4 != 0) { - func_800FC83C(blk); + if (arg4 != 0) { + func_800FC83C(blk); + } } + + RESTORE_INTERRUPTS(); } void func_800FCB34(void) { @@ -120,6 +150,11 @@ void func_800FCB34(void) { } void SystemHeap_Init(void* start, u32 size) { +#if PLATFORM_N64 + __osMallocInit(&gSystemArena, start, size); +#else SystemArena_Init(start, size); +#endif + func_800FCB34(); } diff --git a/src/code/code_n64dd_800AD410.c b/src/code/code_n64dd_800AD410.c new file mode 100644 index 0000000000..66dcc3cc76 --- /dev/null +++ b/src/code/code_n64dd_800AD410.c @@ -0,0 +1,27 @@ +#include "ultra64.h" +#include "z64dma.h" +#include "segment_symbols.h" +#include "n64dd.h" + +u8 D_80121210; +u8 D_80121211; +u8 D_80121212; +vu8 D_80121213; +vu8 D_80121214; + +void func_800AD410(void) { + if (!D_80121210) { + DmaMgr_RequestSync(_n64ddSegmentStart, (uintptr_t)_n64ddSegmentRomStart, + _n64ddSegmentRomEnd - _n64ddSegmentRomStart); + bzero(_n64ddSegmentBssStart, _n64ddSegmentBssEnd - _n64ddSegmentBssStart); + D_80121210 = true; + D_80121211 = func_801C6E80(); + if (D_80121211) {} + } +} + +void func_800AD488(void) { + if (D_80121210 && (D_80121212 == 0)) { + D_80121210 = false; + } +} diff --git a/src/code/code_n64dd_800AD4C0.c b/src/code/code_n64dd_800AD4C0.c new file mode 100644 index 0000000000..3f1488c66e --- /dev/null +++ b/src/code/code_n64dd_800AD4C0.c @@ -0,0 +1,82 @@ +#include "global.h" +#include "fault.h" +#include "n64dd.h" + +n64ddStruct_800FEE70_pointers D_800FEE70 = { + func_801C7C1C, + NULL, + NULL, + Fault_RemoveClient, + Fault_AddClient, + Fault_DrawText, + Fault_WaitForInput, + Fault_AddHungupAndCrashImpl, + Fault_AddHungupAndCrash, + func_800AD598, + _Printf, + osCreateThread, + osDestroyThread, + osYieldThread, + osStartThread, + osStopThread, + osGetThreadId, + osSetThreadPri, + osGetThreadPri, + osCreateMesgQueue, + osSendMesg, + osJamMesg, + osRecvMesg, + osSetEventMesg, + osGetIntMask, + osSetIntMask, + osInvalDCache, + osInvalICache, + osWritebackDCache, + osWritebackDCacheAll, + osGetTime, + osSetTime, + osSetTimer, + osStopTimer, + &gSaveContext, + DmaMgr_RequestAsync, + DmaMgr_RequestSync, + DmaMgr_DmaFromDriveRom, + Cutscene_HandleEntranceTriggers, + gSegments, + Flags_GetEventChkInf, + Flags_SetEventChkInf, + NULL, // TODO possibly file padding + NULL, +}; + +n64ddStruct_80121220* B_80121220; + +n64ddStruct_80121220* func_800AD4C0(n64ddStruct_80121220* arg0) { + n64ddStruct_800FEE70_pointers* temp_a0 = func_800AD560(); + + if (arg0 != NULL && arg0->unk_00 != NULL) { + arg0->unk_00(temp_a0, arg0); + } + B_80121220 = arg0; + return B_80121220; +} + +void func_800AD51C(void) { + if ((B_80121220 != NULL) && (B_80121220->unk_04 != NULL)) { + B_80121220->unk_04(); + } + B_80121220 = NULL; +} + +n64ddStruct_800FEE70_pointers* func_800AD560(void) { + D_800FEE70.unk_04 = 0; + D_800FEE70.unk_08 = gRegEditor; + D_800FEE70.unk_88 = &gSaveContext; + return &D_800FEE70; +} + +void func_800AD590(void) { +} + +void func_800AD598(s32 arg0, s32 arg1, s32 arg2) { +} diff --git a/src/code/debug_malloc.c b/src/code/debug_malloc.c index 5542e3af61..faf41a230c 100644 --- a/src/code/debug_malloc.c +++ b/src/code/debug_malloc.c @@ -1,4 +1,5 @@ #include "global.h" +#include "libc64/os_malloc.h" #define LOG_SEVERITY_NOLOG 0 #define LOG_SEVERITY_ERROR 2 @@ -14,14 +15,12 @@ s32 gDebugArenaLogSeverity = LOG_SEVERITY_ERROR; void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { if (ptr == NULL) { if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) { - // "%s: %u bytes %s failed\n" - PRINTF("%s: %u バイトの%sに失敗しました\n", name, size, action); + PRINTF(T("%s: %u バイトの%sに失敗しました\n", "%s: %u bytes %s failed\n"), name, size, action); __osDisplayArena(&sDebugArena); return; } } else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { - // "%s: %u bytes %s succeeded\n" - PRINTF("%s: %u バイトの%sに成功しました\n", name, size, action); + PRINTF(T("%s: %u バイトの%sに成功しました\n", "%s: %u bytes %s succeeded\n"), name, size, action); } } @@ -101,8 +100,8 @@ void* DebugArena_Calloc(u32 num, u32 size) { void DebugArena_Display(void) { if (IS_DEBUG_HEAP_ENABLED) { - // "Zelda heap display" ("Zelda" should probably have been changed to "Debug") - PRINTF("ゼルダヒープ表示\n"); + // Likely copypasted from ZeldaArena_Display, should say "Debug" + PRINTF(T("ゼルダヒープ表示\n", "Zelda heap display\n")); __osDisplayArena(&sDebugArena); } } @@ -129,6 +128,6 @@ void DebugArena_Cleanup(void) { __osMallocCleanup(&sDebugArena); } -u8 DebugArena_IsInitialized(void) { +s32 DebugArena_IsInitialized(void) { return __osMallocIsInitialized(&sDebugArena); } diff --git a/src/code/fault.c b/src/code/fault_gc.c similarity index 83% rename from src/code/fault.c rename to src/code/fault_gc.c index c0c6692410..49bd25ff75 100644 --- a/src/code/fault.c +++ b/src/code/fault_gc.c @@ -40,25 +40,23 @@ * DPad-Up may be pressed to enable sending fault pages over osSyncPrintf as well as displaying them on-screen. * DPad-Down disables sending fault pages over osSyncPrintf. */ +#if PLATFORM_GC + +#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-eu-mq-dbg:176 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192" \ + "gc-us-mq:192" + #include "global.h" -#include "terminal.h" #include "alloca.h" +#include "fault.h" +#include "stack.h" +#include "terminal.h" -// For retail BSS ordering, the block number of sFaultInstance must be 0 or -// just above (the exact upper bound depends on the block numbers assigned to -// extern variables declared in headers). -#if OOT_DEBUG -#pragma increment_block_number 0 -#else -#pragma increment_block_number 20 -#endif - -void FaultDrawer_Init(void); -void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled); -void FaultDrawer_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 color); -void FaultDrawer_FillScreen(void); -void FaultDrawer_SetInputCallback(void (*callback)(void)); -void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h); +void Fault_Init(void); +void Fault_SetOsSyncPrintfEnabled(u32 enabled); +void Fault_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 color); +void Fault_FillScreen(void); +void Fault_SetInputCallback(void (*callback)(void)); +void Fault_SetDrawerFB(void* fb, u16 w, u16 h); const char* sExceptionNames[] = { "Interrupt", @@ -91,7 +89,7 @@ STACK(sFaultStack, 0x600); StackEntry sFaultThreadInfo; FaultMgr gFaultMgr; -typedef struct { +typedef struct FaultClientTask { /* 0x00 */ s32 (*callback)(void*, void*); /* 0x04 */ void* arg0; /* 0x08 */ void* arg1; @@ -146,7 +144,8 @@ void Fault_ClientRunTask(FaultClientTask* task) { // Await done while (true) { - osSetTimer(&timer, OS_SEC_TO_CYCLES(1), 0, &queue, (OSMesg)timerMsgVal); + // Wait for 1 second + osSetTimer(&timer, OS_USEC_TO_CYCLES(1000000), 0, &queue, (OSMesg)timerMsgVal); osRecvMesg(&queue, &recMsg, OS_MESG_BLOCK); if (recMsg != (OSMesg)666) { @@ -216,7 +215,9 @@ void Fault_AddClient(FaultClient* client, void* callback, void* arg0, void* arg1 end: osSetIntMask(mask); if (alreadyExists) { - osSyncPrintf(VT_COL(RED, WHITE) "fault_AddClient: %08x は既にリスト中にある\n" VT_RST, client); + osSyncPrintf(VT_COL(RED, WHITE) T("fault_AddClient: %08x は既にリスト中にある\n", + "fault_AddClient: %08x is already in the list\n") VT_RST, + client); } } @@ -252,7 +253,9 @@ void Fault_RemoveClient(FaultClient* client) { osSetIntMask(mask); if (listIsEmpty) { - osSyncPrintf(VT_COL(RED, WHITE) "fault_RemoveClient: %08x リスト不整合です\n" VT_RST, client); + osSyncPrintf(VT_COL(RED, WHITE) T("fault_RemoveClient: %08x リスト不整合です\n", + "fault_RemoveClient: %08x list inconsistency\n") VT_RST, + client); } } @@ -294,7 +297,9 @@ void Fault_AddAddrConvClient(FaultAddrConvClient* client, void* callback, void* end: osSetIntMask(mask); if (alreadyExists) { - osSyncPrintf(VT_COL(RED, WHITE) "fault_AddressConverterAddClient: %08x は既にリスト中にある\n" VT_RST, client); + osSyncPrintf(VT_COL(RED, WHITE) T("fault_AddressConverterAddClient: %08x は既にリスト中にある\n", + "fault_AddressConverterAddClient: %08x is already in the list\n") VT_RST, + client); } } @@ -328,7 +333,8 @@ void Fault_RemoveAddrConvClient(FaultAddrConvClient* client) { osSetIntMask(mask); if (listIsEmpty) { - osSyncPrintf(VT_COL(RED, WHITE) "fault_AddressConverterRemoveClient: %08x は既にリスト中にある\n" VT_RST, + osSyncPrintf(VT_COL(RED, WHITE) T("fault_AddressConverterRemoveClient: %08x は既にリスト中にある\n", + "fault_AddressConverterRemoveClient: %08x is already in the list\n") VT_RST, client); } } @@ -408,11 +414,11 @@ u32 Fault_WaitForInputImpl(void) { } if (pressedBtn == BTN_DUP) { - FaultDrawer_SetOsSyncPrintfEnabled(true); + Fault_SetOsSyncPrintfEnabled(true); } if (pressedBtn == BTN_DDOWN) { - FaultDrawer_SetOsSyncPrintfEnabled(false); + Fault_SetOsSyncPrintfEnabled(false); } } } @@ -425,21 +431,21 @@ void Fault_WaitForInput(void) { } void Fault_DrawRec(s32 x, s32 y, s32 w, s32 h, u16 color) { - FaultDrawer_DrawRecImpl(x, y, x + w - 1, y + h - 1, color); + Fault_DrawRecImpl(x, y, x + w - 1, y + h - 1, color); } void Fault_FillScreenBlack(void) { - FaultDrawer_SetForeColor(GPACK_RGBA5551(255, 255, 255, 1)); - FaultDrawer_SetBackColor(GPACK_RGBA5551(0, 0, 0, 1)); - FaultDrawer_FillScreen(); - FaultDrawer_SetBackColor(GPACK_RGBA5551(0, 0, 0, 0)); + Fault_SetForeColor(GPACK_RGBA5551(255, 255, 255, 1)); + Fault_SetBackColor(GPACK_RGBA5551(0, 0, 0, 1)); + Fault_FillScreen(); + Fault_SetBackColor(GPACK_RGBA5551(0, 0, 0, 0)); } void Fault_FillScreenRed(void) { - FaultDrawer_SetForeColor(GPACK_RGBA5551(255, 255, 255, 1)); - FaultDrawer_SetBackColor(GPACK_RGBA5551(240, 0, 0, 1)); - FaultDrawer_FillScreen(); - FaultDrawer_SetBackColor(GPACK_RGBA5551(0, 0, 0, 0)); + Fault_SetForeColor(GPACK_RGBA5551(255, 255, 255, 1)); + Fault_SetBackColor(GPACK_RGBA5551(240, 0, 0, 1)); + Fault_FillScreen(); + Fault_SetBackColor(GPACK_RGBA5551(0, 0, 0, 0)); } void Fault_DrawCornerRec(u16 color) { @@ -448,21 +454,21 @@ void Fault_DrawCornerRec(u16 color) { void Fault_PrintFReg(s32 idx, f32* value) { u32 raw = *(u32*)value; - s32 exp = ((raw & 0x7F800000) >> 0x17) - 0x7F; + s32 exp = ((raw & 0x7F800000) >> 23) - 127; - if ((exp >= -0x7E && exp < 0x80) || raw == 0) { - FaultDrawer_Printf("F%02d:%14.7e ", idx, *value); + if ((exp > -127 && exp <= 127) || raw == 0) { + Fault_Printf("F%02d:%14.7e ", idx, *value); } else { // Print subnormal floats as their ieee-754 hex representation - FaultDrawer_Printf("F%02d: %08x(16) ", idx, raw); + Fault_Printf("F%02d: %08x(16) ", idx, raw); } } void Fault_LogFReg(s32 idx, f32* value) { u32 raw = *(u32*)value; - s32 exp = ((raw & 0x7F800000) >> 0x17) - 0x7F; + s32 exp = ((raw & 0x7F800000) >> 23) - 127; - if ((exp >= -0x7E && exp < 0x80) || raw == 0) { + if ((exp > -127 && exp <= 127) || raw == 0) { osSyncPrintf("F%02d:%14.7e ", idx, *value); } else { osSyncPrintf("F%02d: %08x(16) ", idx, *(u32*)value); @@ -473,18 +479,18 @@ void Fault_PrintFPCSR(u32 value) { s32 i; u32 flag = FPCSR_CE; - FaultDrawer_Printf("FPCSR:%08xH ", value); + Fault_Printf("FPCSR:%08xH ", value); // Go through each of the six causes and print the name of // the first cause that is set for (i = 0; i < ARRAY_COUNT(sFpExceptionNames); i++) { if (value & flag) { - FaultDrawer_Printf("(%s)", sFpExceptionNames[i]); + Fault_Printf("(%s)", sFpExceptionNames[i]); break; } flag >>= 1; } - FaultDrawer_Printf("\n"); + Fault_Printf("\n"); } void Fault_LogFPCSR(u32 value) { @@ -505,72 +511,72 @@ void Fault_PrintThreadContext(OSThread* thread) { __OSThreadContext* ctx; s16 causeStrIdx = _SHIFTR((u32)thread->context.cause, 2, 5); - if (causeStrIdx == 23) { // Watchpoint + if (causeStrIdx == (EXC_WATCH >> CAUSE_EXCSHIFT)) { causeStrIdx = 16; } - if (causeStrIdx == 31) { // Virtual coherency on data + if (causeStrIdx == (EXC_VCED >> CAUSE_EXCSHIFT)) { causeStrIdx = 17; } - FaultDrawer_FillScreen(); - FaultDrawer_SetCharPad(-2, 4); - FaultDrawer_SetCursor(22, 20); + Fault_FillScreen(); + Fault_SetCharPad(-2, 4); + Fault_SetCursor(22, 20); ctx = &thread->context; - FaultDrawer_Printf("THREAD:%d (%d:%s)\n", thread->id, causeStrIdx, sExceptionNames[causeStrIdx]); - FaultDrawer_SetCharPad(-1, 0); - - FaultDrawer_Printf("PC:%08xH SR:%08xH VA:%08xH\n", (u32)ctx->pc, (u32)ctx->sr, (u32)ctx->badvaddr); - FaultDrawer_Printf("AT:%08xH V0:%08xH V1:%08xH\n", (u32)ctx->at, (u32)ctx->v0, (u32)ctx->v1); - FaultDrawer_Printf("A0:%08xH A1:%08xH A2:%08xH\n", (u32)ctx->a0, (u32)ctx->a1, (u32)ctx->a2); - FaultDrawer_Printf("A3:%08xH T0:%08xH T1:%08xH\n", (u32)ctx->a3, (u32)ctx->t0, (u32)ctx->t1); - FaultDrawer_Printf("T2:%08xH T3:%08xH T4:%08xH\n", (u32)ctx->t2, (u32)ctx->t3, (u32)ctx->t4); - FaultDrawer_Printf("T5:%08xH T6:%08xH T7:%08xH\n", (u32)ctx->t5, (u32)ctx->t6, (u32)ctx->t7); - FaultDrawer_Printf("S0:%08xH S1:%08xH S2:%08xH\n", (u32)ctx->s0, (u32)ctx->s1, (u32)ctx->s2); - FaultDrawer_Printf("S3:%08xH S4:%08xH S5:%08xH\n", (u32)ctx->s3, (u32)ctx->s4, (u32)ctx->s5); - FaultDrawer_Printf("S6:%08xH S7:%08xH T8:%08xH\n", (u32)ctx->s6, (u32)ctx->s7, (u32)ctx->t8); - FaultDrawer_Printf("T9:%08xH GP:%08xH SP:%08xH\n", (u32)ctx->t9, (u32)ctx->gp, (u32)ctx->sp); - FaultDrawer_Printf("S8:%08xH RA:%08xH LO:%08xH\n\n", (u32)ctx->s8, (u32)ctx->ra, (u32)ctx->lo); + Fault_Printf("THREAD:%d (%d:%s)\n", thread->id, causeStrIdx, sExceptionNames[causeStrIdx]); + Fault_SetCharPad(-1, 0); + + Fault_Printf("PC:%08xH SR:%08xH VA:%08xH\n", (u32)ctx->pc, (u32)ctx->sr, (u32)ctx->badvaddr); + Fault_Printf("AT:%08xH V0:%08xH V1:%08xH\n", (u32)ctx->at, (u32)ctx->v0, (u32)ctx->v1); + Fault_Printf("A0:%08xH A1:%08xH A2:%08xH\n", (u32)ctx->a0, (u32)ctx->a1, (u32)ctx->a2); + Fault_Printf("A3:%08xH T0:%08xH T1:%08xH\n", (u32)ctx->a3, (u32)ctx->t0, (u32)ctx->t1); + Fault_Printf("T2:%08xH T3:%08xH T4:%08xH\n", (u32)ctx->t2, (u32)ctx->t3, (u32)ctx->t4); + Fault_Printf("T5:%08xH T6:%08xH T7:%08xH\n", (u32)ctx->t5, (u32)ctx->t6, (u32)ctx->t7); + Fault_Printf("S0:%08xH S1:%08xH S2:%08xH\n", (u32)ctx->s0, (u32)ctx->s1, (u32)ctx->s2); + Fault_Printf("S3:%08xH S4:%08xH S5:%08xH\n", (u32)ctx->s3, (u32)ctx->s4, (u32)ctx->s5); + Fault_Printf("S6:%08xH S7:%08xH T8:%08xH\n", (u32)ctx->s6, (u32)ctx->s7, (u32)ctx->t8); + Fault_Printf("T9:%08xH GP:%08xH SP:%08xH\n", (u32)ctx->t9, (u32)ctx->gp, (u32)ctx->sp); + Fault_Printf("S8:%08xH RA:%08xH LO:%08xH\n\n", (u32)ctx->s8, (u32)ctx->ra, (u32)ctx->lo); Fault_PrintFPCSR(ctx->fpcsr); - FaultDrawer_Printf("\n"); + Fault_Printf("\n"); Fault_PrintFReg(0, &ctx->fp0.f.f_even); Fault_PrintFReg(2, &ctx->fp2.f.f_even); - FaultDrawer_Printf("\n"); + Fault_Printf("\n"); Fault_PrintFReg(4, &ctx->fp4.f.f_even); Fault_PrintFReg(6, &ctx->fp6.f.f_even); - FaultDrawer_Printf("\n"); + Fault_Printf("\n"); Fault_PrintFReg(8, &ctx->fp8.f.f_even); Fault_PrintFReg(10, &ctx->fp10.f.f_even); - FaultDrawer_Printf("\n"); + Fault_Printf("\n"); Fault_PrintFReg(12, &ctx->fp12.f.f_even); Fault_PrintFReg(14, &ctx->fp14.f.f_even); - FaultDrawer_Printf("\n"); + Fault_Printf("\n"); Fault_PrintFReg(16, &ctx->fp16.f.f_even); Fault_PrintFReg(18, &ctx->fp18.f.f_even); - FaultDrawer_Printf("\n"); + Fault_Printf("\n"); Fault_PrintFReg(20, &ctx->fp20.f.f_even); Fault_PrintFReg(22, &ctx->fp22.f.f_even); - FaultDrawer_Printf("\n"); + Fault_Printf("\n"); Fault_PrintFReg(24, &ctx->fp24.f.f_even); Fault_PrintFReg(26, &ctx->fp26.f.f_even); - FaultDrawer_Printf("\n"); + Fault_Printf("\n"); Fault_PrintFReg(28, &ctx->fp28.f.f_even); Fault_PrintFReg(30, &ctx->fp30.f.f_even); - FaultDrawer_Printf("\n"); + Fault_Printf("\n"); - FaultDrawer_SetCharPad(0, 0); + Fault_SetCharPad(0, 0); } void Fault_LogThreadContext(OSThread* thread) { __OSThreadContext* ctx; s16 causeStrIdx = _SHIFTR((u32)thread->context.cause, 2, 5); - if (causeStrIdx == 23) { // Watchpoint + if (causeStrIdx == (EXC_WATCH >> CAUSE_EXCSHIFT)) { causeStrIdx = 16; } - if (causeStrIdx == 31) { // Virtual coherency on data + if (causeStrIdx == (EXC_VCED >> CAUSE_EXCSHIFT)) { causeStrIdx = 17; } @@ -644,7 +650,7 @@ void Fault_Wait5Seconds(void) { do { Fault_Sleep(1000 / 60); - } while ((osGetTime() - start) < OS_SEC_TO_CYCLES(5) + 1); + } while ((osGetTime() - start) <= OS_USEC_TO_CYCLES(5000000)); // 5 seconds sFaultInstance->autoScroll = !DISABLE_CRASH_DBG_AUTOSCROLL; } @@ -673,21 +679,21 @@ void Fault_DrawMemDumpContents(const char* title, uintptr_t addr, u32 arg2) { // Reset screen Fault_FillScreenBlack(); - FaultDrawer_SetCharPad(-2, 0); + Fault_SetCharPad(-2, 0); - FaultDrawer_DrawText(36, 18, "%s %08x", title != NULL ? title : "PrintDump", alignedAddr); + Fault_DrawText(36, 18, "%s %08x", title != NULL ? title : "PrintDump", alignedAddr); // Draw memory page contents if (alignedAddr >= K0BASE && alignedAddr < K2BASE) { for (y = 0; y < 22; y++) { - FaultDrawer_DrawText(24, 28 + y * 9, "%06x", writeAddr); + Fault_DrawText(24, 28 + y * 9, "%06x", writeAddr); for (x = 0; x < 4; x++) { - FaultDrawer_DrawText(82 + x * 52, 28 + y * 9, "%08x", *writeAddr++); + Fault_DrawText(82 + x * 52, 28 + y * 9, "%08x", *writeAddr++); } } } - FaultDrawer_SetCharPad(0, 0); + Fault_SetCharPad(0, 0); } /** @@ -910,15 +916,15 @@ void Fault_DrawStackTrace(OSThread* thread, s32 x, s32 y, s32 height) { uintptr_t pc = thread->context.pc; uintptr_t addr; - FaultDrawer_DrawText(x, y, "SP PC (VPC)"); + Fault_DrawText(x, y, "SP PC (VPC)"); // Backtrace from the current function to the start of the thread for (line = 1; line < height && (ra != 0 || sp != 0) && pc != (uintptr_t)__osCleanupThread; line++) { - FaultDrawer_DrawText(x, y + line * 8, "%08x %08x", sp, pc); + Fault_DrawText(x, y + line * 8, "%08x %08x", sp, pc); // Convert relocated address to virtual address if applicable addr = Fault_ConvertAddress(pc); if (addr != 0) { - FaultDrawer_Printf(" -> %08x", addr); + Fault_Printf(" -> %08x", addr); } // Search one function for the previous function Fault_WalkStack(&sp, &pc, &ra); @@ -949,7 +955,7 @@ void Fault_ResumeThread(OSThread* thread) { thread->context.cause = 0; thread->context.fpcsr = 0; thread->context.pc += sizeof(u32); - *((u32*)thread->context.pc) = 0x0000000D; // write in a break instruction + *(u32*)thread->context.pc = 0x0000000D; // write in a break instruction osWritebackDCache((void*)thread->context.pc, 4); osInvalICache((void*)thread->context.pc, 4); osStartThread(thread); @@ -973,7 +979,7 @@ void Fault_DisplayFrameBuffer(void) { } osViSwapBuffer(fb); - FaultDrawer_SetDrawerFB(fb, SCREEN_WIDTH, SCREEN_HEIGHT); + Fault_SetDrawerFB(fb, SCREEN_WIDTH, SCREEN_HEIGHT); } /** @@ -987,10 +993,10 @@ void Fault_ProcessClients(void) { while (client != NULL) { if (client->callback != NULL) { Fault_FillScreenBlack(); - FaultDrawer_SetCharPad(-2, 0); - FaultDrawer_Printf(FAULT_COLOR(DARK_GRAY) "CallBack (%d) %08x %08x %08x\n" FAULT_COLOR(WHITE), idx++, - client, client->arg0, client->arg1); - FaultDrawer_SetCharPad(0, 0); + Fault_SetCharPad(-2, 0); + Fault_Printf(FAULT_COLOR(DARK_GRAY) "CallBack (%d) %08x %08x %08x\n" FAULT_COLOR(WHITE), idx++, client, + client->arg0, client->arg1); + Fault_SetCharPad(0, 0); Fault_ProcessClient(client->callback, client->arg0, client->arg1); Fault_WaitForInput(); Fault_DisplayFrameBuffer(); @@ -1023,17 +1029,20 @@ void Fault_ThreadEntry(void* arg) { if (msg == FAULT_MSG_CPU_BREAK) { sFaultInstance->msgId = (u32)FAULT_MSG_CPU_BREAK; - osSyncPrintf("フォルトマネージャ:OS_EVENT_CPU_BREAKを受信しました\n"); + osSyncPrintf(T("フォルトマネージャ:OS_EVENT_CPU_BREAKを受信しました\n", + "Fault Manager: OS_EVENT_CPU_BREAK received\n")); } else if (msg == FAULT_MSG_FAULT) { sFaultInstance->msgId = (u32)FAULT_MSG_FAULT; - osSyncPrintf("フォルトマネージャ:OS_EVENT_FAULTを受信しました\n"); + osSyncPrintf( + T("フォルトマネージャ:OS_EVENT_FAULTを受信しました\n", "Fault Manager: OS_EVENT_FAULT received\n")); } else if (msg == FAULT_MSG_UNK) { Fault_UpdatePad(); faultedThread = NULL; continue; } else { sFaultInstance->msgId = (u32)FAULT_MSG_UNK; - osSyncPrintf("フォルトマネージャ:不明なメッセージを受信しました\n"); + osSyncPrintf(T("フォルトマネージャ:不明なメッセージを受信しました\n", + "Fault Manager: Unknown message received\n")); } faultedThread = __osGetCurrFaultedThread(); @@ -1066,8 +1075,8 @@ void Fault_ThreadEntry(void* arg) { // Set auto-scrolling and default colors sFaultInstance->autoScroll = !DISABLE_CRASH_DBG_AUTOSCROLL; - FaultDrawer_SetForeColor(GPACK_RGBA5551(255, 255, 255, 1)); - FaultDrawer_SetBackColor(GPACK_RGBA5551(0, 0, 0, 0)); + Fault_SetForeColor(GPACK_RGBA5551(255, 255, 255, 1)); + Fault_SetBackColor(GPACK_RGBA5551(0, 0, 0, 0)); // Draw pages do { @@ -1077,7 +1086,7 @@ void Fault_ThreadEntry(void* arg) { Fault_WaitForInput(); // Stack trace page Fault_FillScreenBlack(); - FaultDrawer_DrawText(120, 16, "STACK TRACE"); + Fault_DrawText(120, 16, "STACK TRACE"); Fault_DrawStackTrace(faultedThread, 36, 24, 22); Fault_LogStackTrace(faultedThread, 50); Fault_WaitForInput(); @@ -1087,10 +1096,10 @@ void Fault_ThreadEntry(void* arg) { Fault_DrawMemDump(faultedThread->context.pc - 0x100, (uintptr_t)faultedThread->context.sp, 0, 0); // End page Fault_FillScreenRed(); - FaultDrawer_DrawText(64, 80, " CONGRATURATIONS! "); - FaultDrawer_DrawText(64, 90, "All Pages are displayed."); - FaultDrawer_DrawText(64, 100, " THANK YOU! "); - FaultDrawer_DrawText(64, 110, " You are great debugger!"); + Fault_DrawText(64, 80, " CONGRATURATIONS! "); + Fault_DrawText(64, 90, "All Pages are displayed."); + Fault_DrawText(64, 100, " THANK YOU! "); + Fault_DrawText(64, 110, " You are great debugger!"); Fault_WaitForInput(); } while (!sFaultInstance->exit); @@ -1102,14 +1111,14 @@ void Fault_ThreadEntry(void* arg) { void Fault_SetFrameBuffer(void* fb, u16 w, u16 h) { sFaultInstance->fb = fb; - FaultDrawer_SetDrawerFB(fb, w, h); + Fault_SetDrawerFB(fb, w, h); } void Fault_Init(void) { sFaultInstance = &gFaultMgr; bzero(sFaultInstance, sizeof(FaultMgr)); - FaultDrawer_Init(); - FaultDrawer_SetInputCallback(Fault_WaitForInput); + Fault_InitDrawer(); + Fault_SetInputCallback(Fault_WaitForInput); sFaultInstance->exit = false; sFaultInstance->msgId = 0; sFaultInstance->faultHandlerEnabled = false; @@ -1133,9 +1142,9 @@ void Fault_HungupFaultClient(const char* exp1, const char* exp2) { osSyncPrintf("HungUp on Thread %d\n", osGetThreadId(NULL)); osSyncPrintf("%s\n", exp1 != NULL ? exp1 : "(NULL)"); osSyncPrintf("%s\n", exp2 != NULL ? exp2 : "(NULL)"); - FaultDrawer_Printf("HungUp on Thread %d\n", osGetThreadId(NULL)); - FaultDrawer_Printf("%s\n", exp1 != NULL ? exp1 : "(NULL)"); - FaultDrawer_Printf("%s\n", exp2 != NULL ? exp2 : "(NULL)"); + Fault_Printf("HungUp on Thread %d\n", osGetThreadId(NULL)); + Fault_Printf("%s\n", exp1 != NULL ? exp1 : "(NULL)"); + Fault_Printf("%s\n", exp2 != NULL ? exp2 : "(NULL)"); } /** @@ -1167,3 +1176,5 @@ NORETURN void Fault_AddHungupAndCrash(const char* file, int line) { sprintf(msg, "HungUp %s:%d", file, line); Fault_AddHungupAndCrashImpl(msg, NULL); } + +#endif diff --git a/src/code/fault_drawer.c b/src/code/fault_gc_drawer.c similarity index 84% rename from src/code/fault_drawer.c rename to src/code/fault_gc_drawer.c index 5c82b7a0bb..808b258497 100644 --- a/src/code/fault_drawer.c +++ b/src/code/fault_gc_drawer.c @@ -5,9 +5,13 @@ * the crash screen implemented by fault.c */ #include "global.h" +#include "fault.h" #include "terminal.h" +#pragma increment_block_number "gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" -typedef struct { +#if PLATFORM_GC + +typedef struct FaultDrawer { /* 0x00 */ u16* fb; /* 0x04 */ u16 w; /* 0x06 */ u16 h; @@ -99,14 +103,16 @@ FaultDrawer sFaultDrawerDefault = { NULL, }; +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128" + FaultDrawer sFaultDrawer; char D_8016B6C0[0x20]; -void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) { +void Fault_SetOsSyncPrintfEnabled(u32 enabled) { sFaultDrawer.osSyncPrintfEnabled = enabled; } -void FaultDrawer_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 color) { +void Fault_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 color) { u16* fb; s32 x, y; s32 xDiff = sFaultDrawer.w - xStart; @@ -135,7 +141,7 @@ void FaultDrawer_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 col } } -void FaultDrawer_DrawChar(char c) { +void Fault_DrawChar(char c) { u16* fb; s32 x, y; const u32* dataPtr; @@ -168,7 +174,7 @@ void FaultDrawer_DrawChar(char c) { } } -s32 FaultDrawer_ColorToPrintColor(u16 color) { +s32 Fault_ColorToPrintColor(u16 color) { s32 i; for (i = 0; i < ARRAY_COUNT(sFaultDrawer.printColors); i++) { @@ -179,44 +185,44 @@ s32 FaultDrawer_ColorToPrintColor(u16 color) { return -1; } -void FaultDrawer_UpdatePrintColor(void) { +void Fault_UpdatePrintColor(void) { s32 idx; if (sFaultDrawer.osSyncPrintfEnabled) { osSyncPrintf(VT_RST); - idx = FaultDrawer_ColorToPrintColor(sFaultDrawer.foreColor); + idx = Fault_ColorToPrintColor(sFaultDrawer.foreColor); if (idx >= 0 && idx < ARRAY_COUNT(sFaultDrawer.printColors) - 2) { osSyncPrintf(VT_SGR("3%d"), idx); } - idx = FaultDrawer_ColorToPrintColor(sFaultDrawer.backColor); + idx = Fault_ColorToPrintColor(sFaultDrawer.backColor); if (idx >= 0 && idx < ARRAY_COUNT(sFaultDrawer.printColors) - 2) { osSyncPrintf(VT_SGR("4%d"), idx); } } } -void FaultDrawer_SetForeColor(u16 color) { +void Fault_SetForeColor(u16 color) { sFaultDrawer.foreColor = color; - FaultDrawer_UpdatePrintColor(); + Fault_UpdatePrintColor(); } -void FaultDrawer_SetBackColor(u16 color) { +void Fault_SetBackColor(u16 color) { sFaultDrawer.backColor = color; - FaultDrawer_UpdatePrintColor(); + Fault_UpdatePrintColor(); } -void FaultDrawer_SetFontColor(u16 color) { - FaultDrawer_SetForeColor(color | 1); // force alpha to be set +void Fault_SetFontColor(u16 color) { + Fault_SetForeColor(color | 1); // force alpha to be set } -void FaultDrawer_SetCharPad(s8 padW, s8 padH) { +void Fault_SetCharPad(s8 padW, s8 padH) { sFaultDrawer.charWPad = padW; sFaultDrawer.charHPad = padH; } -void FaultDrawer_SetCursor(s32 x, s32 y) { +void Fault_SetCursor(s32 x, s32 y) { if (sFaultDrawer.osSyncPrintfEnabled) { osSyncPrintf(VT_CUP("%d", "%d"), (y - sFaultDrawer.yStart) / (sFaultDrawer.charH + sFaultDrawer.charHPad), (x - sFaultDrawer.xStart) / (sFaultDrawer.charW + sFaultDrawer.charWPad)); @@ -225,17 +231,17 @@ void FaultDrawer_SetCursor(s32 x, s32 y) { sFaultDrawer.cursorY = y; } -void FaultDrawer_FillScreen(void) { +void Fault_FillScreen(void) { if (sFaultDrawer.osSyncPrintfEnabled) { osSyncPrintf(VT_CLS); } - FaultDrawer_DrawRecImpl(sFaultDrawer.xStart, sFaultDrawer.yStart, sFaultDrawer.xEnd, sFaultDrawer.yEnd, - sFaultDrawer.backColor | 1); - FaultDrawer_SetCursor(sFaultDrawer.xStart, sFaultDrawer.yStart); + Fault_DrawRecImpl(sFaultDrawer.xStart, sFaultDrawer.yStart, sFaultDrawer.xEnd, sFaultDrawer.yEnd, + sFaultDrawer.backColor | 1); + Fault_SetCursor(sFaultDrawer.xStart, sFaultDrawer.yStart); } -void* FaultDrawer_PrintCallback(void* arg, const char* str, size_t count) { +void* Fault_PrintCallback(void* arg, const char* str, size_t count) { for (; count != 0; count--, str++) { s32 curXStart; s32 curXEnd; @@ -243,7 +249,7 @@ void* FaultDrawer_PrintCallback(void* arg, const char* str, size_t count) { if (sFaultDrawer.escCode) { sFaultDrawer.escCode = false; if (*str > '0' && *str <= '9') { - FaultDrawer_SetForeColor(sFaultDrawer.printColors[*str - '0']); + Fault_SetForeColor(sFaultDrawer.printColors[*str - '0']); } curXStart = sFaultDrawer.cursorX; @@ -269,7 +275,7 @@ void* FaultDrawer_PrintCallback(void* arg, const char* str, size_t count) { osSyncPrintf("%c", *str); } - FaultDrawer_DrawChar(*str); + Fault_DrawChar(*str); sFaultDrawer.cursorX += sFaultDrawer.charW + sFaultDrawer.charWPad; curXStart = sFaultDrawer.cursorX; @@ -284,7 +290,7 @@ void* FaultDrawer_PrintCallback(void* arg, const char* str, size_t count) { if (sFaultDrawer.yEnd - sFaultDrawer.charH <= sFaultDrawer.cursorY) { if (sFaultDrawer.inputCallback) { sFaultDrawer.inputCallback(); - FaultDrawer_FillScreen(); + Fault_FillScreen(); } sFaultDrawer.cursorY = sFaultDrawer.yStart; } @@ -295,46 +301,48 @@ void* FaultDrawer_PrintCallback(void* arg, const char* str, size_t count) { return arg; } -s32 FaultDrawer_VPrintf(const char* fmt, va_list args) { - return _Printf(FaultDrawer_PrintCallback, &sFaultDrawer, fmt, args); +s32 Fault_VPrintf(const char* fmt, va_list args) { + return _Printf(Fault_PrintCallback, &sFaultDrawer, fmt, args); } -s32 FaultDrawer_Printf(const char* fmt, ...) { +s32 Fault_Printf(const char* fmt, ...) { s32 ret; va_list args; va_start(args, fmt); - ret = FaultDrawer_VPrintf(fmt, args); + ret = Fault_VPrintf(fmt, args); va_end(args); return ret; } -void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) { +void Fault_DrawText(s32 x, s32 y, const char* fmt, ...) { va_list args; va_start(args, fmt); - FaultDrawer_SetCursor(x, y); - FaultDrawer_VPrintf(fmt, args); + Fault_SetCursor(x, y); + Fault_VPrintf(fmt, args); va_end(args); } -void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h) { +void Fault_SetDrawerFB(void* fb, u16 w, u16 h) { sFaultDrawer.fb = fb; sFaultDrawer.w = w; sFaultDrawer.h = h; } -void FaultDrawer_SetInputCallback(void (*callback)(void)) { +void Fault_SetInputCallback(void (*callback)(void)) { sFaultDrawer.inputCallback = callback; } -void FaultDrawer_WritebackFBDCache(void) { +void Fault_WritebackFBDCache(void) { osWritebackDCache(sFaultDrawer.fb, sFaultDrawer.w * sFaultDrawer.h * sizeof(u16)); } -void FaultDrawer_Init(void) { +void Fault_InitDrawer(void) { bcopy(&sFaultDrawerDefault, &sFaultDrawer, sizeof(FaultDrawer)); sFaultDrawer.fb = (u16*)(PHYS_TO_K0(osMemSize) - sizeof(u16[SCREEN_HEIGHT][SCREEN_WIDTH])); } + +#endif diff --git a/src/code/fault_n64.c b/src/code/fault_n64.c new file mode 100644 index 0000000000..5145173e98 --- /dev/null +++ b/src/code/fault_n64.c @@ -0,0 +1,853 @@ +#if PLATFORM_N64 + +#pragma increment_block_number "ntsc-1.2:128 pal-1.0:128 pal-1.1:128" + +#include "global.h" +#include "fault.h" +#include "libc64/os_malloc.h" +#include "stack.h" +#include "terminal.h" + +#pragma increment_block_number "ntsc-1.2:96 pal-1.0:96 pal-1.1:96" + +typedef struct FaultMgr { + OSThread thread; + char unk_1B0[0x400]; + OSMesgQueue queue; + OSMesg msg; + u16* fb; + u16 fbWidth; + u16 fbDepth; + FaultClient* clients; +} FaultMgr; // size = 0x5D8 + +typedef struct FaultCursorCoords { + s32 x; + s32 y; +} FaultCursorCoords; // size = 0x8 + +u32 sFaultDrawerFont[] = { + 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990, + 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000, 0x08BFFB00, 0x0EFFFFC0, + 0x0BF00FB0, 0x0FF00330, 0x0FF00FF0, 0x0FF00220, 0x0CFBBF60, 0x0FFCCE20, 0x0DD44FF0, 0x0FF00220, 0x0FF00FF0, + 0x0FF00330, 0x0CFBBF40, 0x0EF77740, 0x00000000, 0x00000000, 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, + 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, + 0x026EF700, 0x00000000, 0x00000000, 0x08BFFB00, 0x000DE000, 0x0BF00FB0, 0x005DE600, 0x0FF00FF0, 0x055CC660, + 0x0CFBBF60, 0x773FF377, 0x0DD44FF0, 0xBB3FF3BB, 0x0FF00FF0, 0x099CCAA0, 0x0CFBBF40, 0x009DEA00, 0x00000000, + 0x000DE000, 0x04C22C40, 0x028D5020, 0x0CCAACC0, 0x21F91710, 0x04C22C40, 0x12493400, 0x00820800, 0x01975110, + 0x088A8880, 0x04615241, 0x00800800, 0x43117530, 0x00A20800, 0x60055600, 0x00000000, 0x04400040, 0x00221100, + 0x00000080, 0x000FB000, 0x00000880, 0x040DA400, 0x00008800, 0x08CDE880, 0x022AA220, 0x08CDE880, 0x02AA2220, + 0x040DA400, 0x0CD10000, 0x000FB000, 0x8C510000, 0x00221100, 0x81100000, 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, + 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990, 0x05589760, 0x0DD22990, 0x05599770, + 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000, 0x00333300, 0x04489980, 0x033CC330, 0x00CD1088, 0x033CC330, + 0x02BF62A8, 0x00333320, 0x01104C80, 0x01100330, 0x0015C800, 0x033CC330, 0x02673220, 0x003FF300, 0x04409900, + 0x00880000, 0x00000000, 0x05DFFD10, 0x07FFFF60, 0x1CE00EC1, 0x0FF00990, 0x1EE11661, 0x0FF00110, 0x1EF45621, + 0x0FF66710, 0x1EF23661, 0x0FF08990, 0x1EF10FE1, 0x0FF00990, 0x16ECCE21, 0x07FBBB20, 0x01111110, 0x00000000, + 0x09B66FD0, 0x27D88E60, 0x0992ED10, 0x2FF02EE0, 0x099AE510, 0x2FF62EE0, 0x099B7510, 0x2FD64EE0, 0x0DDAE510, + 0x2FD04EE0, 0x0DD2ED10, 0x2FD00EE0, 0x09F66F90, 0x27D99F70, 0x00000000, 0x00000000, 0x07FFFF00, 0x8F711FF0, + 0x2FD00FF0, 0x8F711FF0, 0x2FD00770, 0x8E611EE0, 0x27DDDF60, 0x8E691EE0, 0x27764AA0, 0x8EE99EE0, 0x2FD06E80, + 0x8AE7FEA0, 0x07FA8E60, 0x88277A80, 0x00000000, 0x00000000, 0x077CCFF0, 0x13266011, 0x077CCFF0, 0x03766510, + 0x0239D720, 0x04533540, 0x002FF200, 0x01133110, 0x005FB100, 0x00033000, 0x055EE550, 0x01133110, 0x055EEDD0, + 0x02233000, 0x00088880, 0x8AABB888, 0x00001100, 0x00044510, 0x04623320, 0x00440110, 0x04C89AA0, 0x00EEAB10, + 0x0CE66720, 0x0EF55FB0, 0x0EE00660, 0x0BF62B90, 0x0EE00660, 0x03FC8990, 0x04EEEEA0, 0x00773BB0, 0x00000000, + 0x08888800, 0x09900000, 0x00111000, 0x09922440, 0x00011000, 0x09908800, 0x26EFDE20, 0x099BB540, 0x2EC33CE2, + 0x0D9A2550, 0x2EC33CE2, 0x0DDAA550, 0x2EC33CE2, 0x09D6ED10, 0x26CBBC62, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00011000, 0x05FBFFE0, 0x8E6116E8, 0x0FF40330, 0x8F7117F8, 0x07FC8B30, 0x8E6996E8, + 0x05733BA0, 0x8A6DD6A8, 0x0DD88A20, 0x08A779B2, 0x01100220, 0x00000000, 0x00000080, 0x8A011000, 0x00000800, + 0x80A11000, 0x07744F70, 0x80A99000, 0x0231DF20, 0x84E60004, 0x0027DA20, 0xC8AA4C40, 0x00573B20, 0x00A11800, + 0x05546F50, 0x00A99800, 0x02222080, 0x02001888, +}; + +const char* sExceptionNames[] = { + "Interrupt", + "TLB modification", + "TLB exception on load", + "TLB exception on store", + "Address error on load", + "Address error on store", + "Bus error on inst.", + "Bus error on data", + "System call exception", + "Breakpoint exception", + "Reserved instruction", + "Coprocessor unusable", + "Arithmetic overflow", + "Trap exception", + "Virtual coherency on inst.", + "Floating point exception", + "Watchpoint exception", + "Virtual coherency on data", +}; + +const char* sFpExceptionNames[] = { + "Unimplemented operation", "Invalid operation", "Division by zero", "Overflow", "Underflow", "Inexact operation", +}; + +u16 sFaultFontColor = GPACK_RGBA5551(255, 255, 255, 1); +s32 D_800FF9C4[7] = { 0 }; // Unused + +Input sFaultInputs[MAXCONTROLLERS]; + +FaultMgr gFaultMgr; + +STACK(sFaultStack, 0x400); +StackEntry sFaultStackInfo; +FaultCursorCoords sFaultCursorPos; + +vs32 gFaultExit; +vs32 gFaultMsgId; +vs32 gFaultDisplayEnable; +volatile OSThread* gFaultFaultedThread; + +void Fault_SleepImpl(u32 ms) { + Sleep_Msec(ms); +} + +void Fault_WaitForInputImpl(void) { + Input* inputs = sFaultInputs; + u16 btnPress; + + do { + Fault_SleepImpl(0x10); + PadMgr_RequestPadData(&gPadMgr, inputs, 0); + btnPress = inputs[0].press.button; + } while (!CHECK_BTN_ANY(btnPress, (BTN_A | BTN_B | BTN_START | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT))); +} + +void Fault_WaitForInput(void) { + Fault_WaitForInputImpl(); +} + +void Fault_DrawRec(s32 x, s32 y, s32 w, s32 h, u16 color) { + s32 i; + s32 j; + u16* fbPtr; + + fbPtr = gFaultMgr.fb + (gFaultMgr.fbWidth * y) + x; + + for (i = 0; i < h; i++) { + j = 0; + for (j = 0; j < w; j++) { + *fbPtr = color; + fbPtr++; + } + fbPtr += gFaultMgr.fbWidth - w; + } + osWritebackDCacheAll(); +} + +void Fault_DrawRecBlack(s32 x, s32 y, s32 w, s32 h) { + Fault_DrawRec(x, y, w, h, GPACK_RGBA5551(0, 0, 0, 1)); +} + +void Fault_DrawCharImpl(s32 x, s32 y, char c) { + u32* dataPtr; + s32 shift = c % 4; + s32 i; + s32 j; + u16* fbPtr; + u32 data; + + dataPtr = sFaultDrawerFont + ((c / 8 * 0x10) + ((c & 4) >> 2)); + fbPtr = gFaultMgr.fb + (gFaultMgr.fbWidth * y) + x; + + for (i = 0; i < 8; i++) { + u32 mask; + + mask = (1 << 28) << shift; + data = *dataPtr; + for (j = 0; j < 8; j++) { + if (mask & data) { + *fbPtr = sFaultFontColor; + } + fbPtr++; + mask >>= 4; + } + dataPtr += 2; + fbPtr += gFaultMgr.fbWidth - 8; + } + osWritebackDCacheAll(); +} + +void Fault_DrawChar(s32 x, s32 y, u8 c) { + Fault_DrawCharImpl(x, y, c); +} + +void Fault_DrawCornerRec(u16 color) { + Fault_DrawRec(22, 16, 8, 1, color); +} + +void Fault_DrawCornerRecRed(void) { + Fault_DrawCornerRec(GPACK_RGBA5551(255, 0, 0, 1)); +} + +void Fault_DrawCornerRecYellow(void) { + Fault_DrawCornerRec(GPACK_RGBA5551(255, 255, 0, 1)); +} + +void func_800AE05C(void) { +} + +void* Fault_PrintCallbackDraw(void* arg, const char* str, size_t len) { + FaultCursorCoords* coords = arg; + + for (; len != 0; len--, str++) { + if (*str == '\n') { + coords->x = 320; + } else { + Fault_DrawChar(coords->x, coords->y, *str); + coords->x += 6; + } + if (coords->x > 276) { + coords->x = 22; + coords->y += 8; + if (coords->y > 208) { + Fault_WaitForInputImpl(); + Fault_DrawRecBlack(22, 16, 276, 208); + coords->y = 16; + } + } + } + return coords; +} + +void Fault_DrawText(s32 x, s32 y, const char* fmt, ...) { + va_list args; + FaultCursorCoords coords; + + va_start(args, fmt); + + coords.x = x - 8; + coords.y = y; + _Printf(Fault_PrintCallbackDraw, &coords, fmt, args); + + va_end(args); +} + +void Fault_SetCursor(s32 x, s32 y) { + sFaultCursorPos.x = x; + sFaultCursorPos.y = y; +} + +void func_800AE1F8(void) { + Fault_DrawRecBlack(22, 16, 276, 208); + sFaultCursorPos.x = 22; + sFaultCursorPos.y = 16; +} + +s32 Fault_Printf(const char* fmt, ...) { + s32 ret; + va_list args; + + va_start(args, fmt); + ret = _Printf(Fault_PrintCallbackDraw, &sFaultCursorPos, fmt, args); + va_end(args); + + return ret; +} + +void Fault_PrintFReg(s32 x, s32 y, s32 idx, f32* value) { + u32 raw = *(u32*)value; + s32 exp = ((raw & 0x7F800000) >> 23) - 127; + + if (((exp > -127) && (exp <= 127)) || (raw == 0)) { + Fault_DrawText(x, y, "F%02d:%.7e", idx, *value); + } else { + Fault_DrawText(x, y, "F%02d:-------------", idx); + } +} + +void Fault_LogFReg(s32 idx, f32* value) { + u32 raw = *(u32*)value; + s32 exp = ((raw & 0x7F800000) >> 23) - 127; + + if (((exp >= -0x7E) && (exp < 0x80)) || (raw == 0)) { + osSyncPrintf("F%02d:%.7e ", idx, *value); + } else { + osSyncPrintf("F%02d:------------- ", idx); + } +} + +void Fault_PrintFPCSR(s32 x, s32 y, s32 value) { + s32 i; + u32 mask = FPCSR_CE; + + Fault_DrawText(x, y, "FPCSR:%08xH", value); + + for (i = 0; i < 6; i++) { + if (value & mask) { + Fault_DrawText(x + 100, y, "(%s)", sFpExceptionNames[i]); + break; + } + + mask >>= 1; + } +} + +void Fault_LogFPCSR(s32 value) { + s32 i; + u32 mask = FPCSR_CE; + + osSyncPrintf("FPCSR:%08xH ", value); + + for (i = 0; i < 6; i++) { + if (value & mask) { + osSyncPrintf("(%s)\n", sFpExceptionNames[i]); + break; + } + + mask >>= 1; + } +} + +void Fault_PrintThreadContext(OSThread* thread) { + __OSThreadContext* ctx = &thread->context; + s32 y; + s16 causeStrIdx = _SHIFTR((u32)thread->context.cause, 2, 5); + + if (causeStrIdx == (EXC_WATCH >> CAUSE_EXCSHIFT)) { + causeStrIdx = 16; + } + if (causeStrIdx == (EXC_VCED >> CAUSE_EXCSHIFT)) { + causeStrIdx = 17; + } + + Fault_DrawRecBlack(22, 16, 276, 24); + + y = 20; + Fault_DrawText(30, y, "THREAD:%d (%d:%s)", thread->id, causeStrIdx, sExceptionNames[causeStrIdx]); + + y += 9; + Fault_DrawText(30, y, "PC:%08xH SR:%08xH VA:%08xH", ctx->pc, ctx->sr, ctx->badvaddr); + + y += 13; + Fault_DrawRecBlack(22, 40, 276, 184); + Fault_DrawText(30, y, "AT:%08xH V0:%08xH V1:%08xH", (u32)ctx->at, (u32)ctx->v0, (u32)ctx->v1); + y += 9; + Fault_DrawText(30, y, "A0:%08xH A1:%08xH A2:%08xH", (u32)ctx->a0, (u32)ctx->a1, (u32)ctx->a2); + y += 9; + Fault_DrawText(30, y, "A3:%08xH T0:%08xH T1:%08xH", (u32)ctx->a3, (u32)ctx->t0, (u32)ctx->t1); + y += 9; + Fault_DrawText(30, y, "T2:%08xH T3:%08xH T4:%08xH", (u32)ctx->t2, (u32)ctx->t3, (u32)ctx->t4); + y += 9; + Fault_DrawText(30, y, "T5:%08xH T6:%08xH T7:%08xH", (u32)ctx->t5, (u32)ctx->t6, (u32)ctx->t7); + y += 9; + Fault_DrawText(30, y, "S0:%08xH S1:%08xH S2:%08xH", (u32)ctx->s0, (u32)ctx->s1, (u32)ctx->s2); + y += 9; + Fault_DrawText(30, y, "S3:%08xH S4:%08xH S5:%08xH", (u32)ctx->s3, (u32)ctx->s4, (u32)ctx->s5); + y += 9; + Fault_DrawText(30, y, "S6:%08xH S7:%08xH T8:%08xH", (u32)ctx->s6, (u32)ctx->s7, (u32)ctx->t8); + y += 9; + Fault_DrawText(30, y, "T9:%08xH GP:%08xH SP:%08xH", (u32)ctx->t9, (u32)ctx->gp, (u32)ctx->sp); + y += 9; + Fault_DrawText(30, y, "S8:%08xH RA:%08xH LO:%08xH", (u32)ctx->s8, (u32)ctx->ra, (u32)ctx->lo); + + y += 13; + Fault_PrintFPCSR(30, y, ctx->fpcsr); + + y += 13; + Fault_PrintFReg(30, y, 0, &ctx->fp0.f.f_even); + Fault_PrintFReg(160, y, 2, &ctx->fp2.f.f_even); + y += 9; + Fault_PrintFReg(30, y, 4, &ctx->fp4.f.f_even); + Fault_PrintFReg(160, y, 6, &ctx->fp6.f.f_even); + y += 9; + Fault_PrintFReg(30, y, 8, &ctx->fp8.f.f_even); + Fault_PrintFReg(160, y, 10, &ctx->fp10.f.f_even); + y += 9; + Fault_PrintFReg(30, y, 12, &ctx->fp12.f.f_even); + Fault_PrintFReg(160, y, 14, &ctx->fp14.f.f_even); + y += 9; + Fault_PrintFReg(30, y, 16, &ctx->fp16.f.f_even); + Fault_PrintFReg(160, y, 18, &ctx->fp18.f.f_even); + y += 9; + Fault_PrintFReg(30, y, 20, &ctx->fp20.f.f_even); + Fault_PrintFReg(160, y, 22, &ctx->fp22.f.f_even); + y += 9; + Fault_PrintFReg(30, y, 24, &ctx->fp24.f.f_even); + Fault_PrintFReg(160, y, 26, &ctx->fp26.f.f_even); + y += 9; + Fault_PrintFReg(30, y, 28, &ctx->fp28.f.f_even); + Fault_PrintFReg(160, y, 30, &ctx->fp30.f.f_even); + + osWritebackDCacheAll(); +} + +void Fault_LogThreadContext(OSThread* thread) { + __OSThreadContext* ctx = &thread->context; + s16 causeStrIdx = _SHIFTR((u32)thread->context.cause, 2, 5); + + if (causeStrIdx == (EXC_WATCH >> CAUSE_EXCSHIFT)) { + causeStrIdx = 16; + } + if (causeStrIdx == (EXC_VCED >> CAUSE_EXCSHIFT)) { + causeStrIdx = 17; + } + + osSyncPrintf("\n"); + osSyncPrintf("THREAD ID:%d (%d:%s)\n", thread->id, causeStrIdx, sExceptionNames[causeStrIdx]); + osSyncPrintf("PC:%08xH SR:%08xH VA:%08xH\n", ctx->pc, ctx->sr, ctx->badvaddr); + osSyncPrintf("AT:%08xH V0:%08xH V1:%08xH\n", (u32)ctx->at, (u32)ctx->v0, (u32)ctx->v1); + osSyncPrintf("A0:%08xH A1:%08xH A2:%08xH\n", (u32)ctx->a0, (u32)ctx->a1, (u32)ctx->a2); + osSyncPrintf("A3:%08xH T0:%08xH T1:%08xH\n", (u32)ctx->a3, (u32)ctx->t0, (u32)ctx->t1); + osSyncPrintf("T2:%08xH T3:%08xH T4:%08xH\n", (u32)ctx->t2, (u32)ctx->t3, (u32)ctx->t4); + osSyncPrintf("T5:%08xH T6:%08xH T7:%08xH\n", (u32)ctx->t5, (u32)ctx->t6, (u32)ctx->t7); + osSyncPrintf("S0:%08xH S1:%08xH S2:%08xH\n", (u32)ctx->s0, (u32)ctx->s1, (u32)ctx->s2); + osSyncPrintf("S3:%08xH S4:%08xH S5:%08xH\n", (u32)ctx->s3, (u32)ctx->s4, (u32)ctx->s5); + osSyncPrintf("S6:%08xH S7:%08xH T8:%08xH\n", (u32)ctx->s6, (u32)ctx->s7, (u32)ctx->t8); + osSyncPrintf("T9:%08xH GP:%08xH SP:%08xH\n", (u32)ctx->t9, (u32)ctx->gp, (u32)ctx->sp); + osSyncPrintf("S8:%08xH RA:%08xH LO:%08xH\n", (u32)ctx->s8, (u32)ctx->ra, (u32)ctx->lo); + osSyncPrintf("\n"); + + Fault_LogFPCSR((s32)ctx->fpcsr); + osSyncPrintf("\n"); + Fault_LogFReg(0, &ctx->fp0.f.f_even); + Fault_LogFReg(2, &ctx->fp2.f.f_even); + osSyncPrintf("\n"); + Fault_LogFReg(4, &ctx->fp4.f.f_even); + Fault_LogFReg(6, &ctx->fp6.f.f_even); + osSyncPrintf("\n"); + Fault_LogFReg(8, &ctx->fp8.f.f_even); + Fault_LogFReg(10, &ctx->fp10.f.f_even); + osSyncPrintf("\n"); + Fault_LogFReg(12, &ctx->fp12.f.f_even); + Fault_LogFReg(14, &ctx->fp14.f.f_even); + osSyncPrintf("\n"); + Fault_LogFReg(16, &ctx->fp16.f.f_even); + Fault_LogFReg(18, &ctx->fp18.f.f_even); + osSyncPrintf("\n"); + Fault_LogFReg(20, &ctx->fp20.f.f_even); + Fault_LogFReg(22, &ctx->fp22.f.f_even); + osSyncPrintf("\n"); + Fault_LogFReg(24, &ctx->fp24.f.f_even); + Fault_LogFReg(26, &ctx->fp26.f.f_even); + osSyncPrintf("\n"); + Fault_LogFReg(28, &ctx->fp28.f.f_even); + Fault_LogFReg(30, &ctx->fp30.f.f_even); + osSyncPrintf("\n"); +} + +OSThread* Fault_FindFaultedThread(void) { + OSThread* thread = __osGetActiveQueue(); + + // OS_PRIORITY_THREADTAIL indicates the end of the thread queue + while (thread->priority != OS_PRIORITY_THREADTAIL) { + if (thread->priority > OS_PRIORITY_IDLE && thread->priority < OS_PRIORITY_APPMAX && + (thread->flags & (OS_FLAG_CPU_BREAK | OS_FLAG_FAULT))) { + return thread; + } + thread = thread->tlnext; + } + return NULL; +} + +void Fault_WaitForButtonCombo(void) { + Input* inputs = sFaultInputs; + s32 btnPress; + s32 btnCur; + OSTime comboStartTime; + s32 x; + s32 y; + s32 count; + s32 pad[4]; + + // "KeyWaitB (L R Z Up Down Up Down Left Left Right Right B A START)" + osSyncPrintf(VT_FGCOL(WHITE) T("KeyWaitB (LRZ ", "KeyWaitB (L R Z ") VT_FGCOL(WHITE) T("上", "Up ") + VT_FGCOL(YELLOW) T("下 ", "Down ") VT_FGCOL(YELLOW) T("上", "Up ") VT_FGCOL(WHITE) + T("下 ", "Down ") VT_FGCOL(WHITE) T("左", "Left ") VT_FGCOL(YELLOW) T("左 ", "Left ") + VT_FGCOL(YELLOW) T("右", "Right ") VT_FGCOL(WHITE) T("右 ", "Right ") VT_FGCOL(GREEN) + T("B", "B ") VT_FGCOL(BLUE) T("A", "A ") + VT_FGCOL(RED) "START" VT_FGCOL(WHITE) ")" VT_RST "\n"); + + x = 0; + y = 0; + count = 0; + while (x != 11) { + if ((count % 30) == 1) {} + if ((count % 30) == 0) { + Fault_DrawCornerRecYellow(); + } + count++; + + Fault_SleepImpl(1000 / 60); + PadMgr_RequestPadData(&gPadMgr, inputs, 0); + btnCur = inputs[0].cur.button; + btnPress = inputs[0].press.button; + if ((btnCur == 0) && (y == 1)) { + y = 0; + osSyncPrintf("x=%d y=%d\n", x, y); + } else if (btnPress != 0) { + if (y == 1) { + x = 0; + osSyncPrintf("x=%d y=%d\n", x, y); + } + switch (x) { + case 0: + if ((btnCur == (BTN_Z | BTN_L | BTN_R)) && (btnPress == BTN_Z)) { + x = 1; + y = 1; + comboStartTime = osGetTime(); + } + break; + + case 1: + if (btnPress == BTN_DUP) { + x = 2; + } else { + x = 0; + } + break; + + case 2: + if (btnPress == BTN_CDOWN) { + x = 3; + y = 1; + } else { + x = 0; + } + break; + + case 3: + if (btnPress == BTN_CUP) { + x = 4; + } else { + x = 0; + } + break; + + case 4: + if (btnPress == BTN_DDOWN) { + x = 5; + y = 1; + } else { + x = 0; + } + break; + + case 5: + if (btnPress == BTN_DLEFT) { + x = 6; + } else { + x = 0; + } + break; + + case 6: + if (btnPress == BTN_CLEFT) { + x = 7; + y = 1; + } else { + x = 0; + } + break; + + case 7: + if (btnPress == BTN_CRIGHT) { + x = 8; + } else { + x = 0; + } + break; + + case 8: + if (btnPress == BTN_DRIGHT) { + x = 9; + y = 1; + } else { + x = 0; + } + break; + + case 9: + if (btnPress == (BTN_A | BTN_B)) { + x = 10; + } else if (btnPress == BTN_A) { + x = 91; + } else if (btnPress == BTN_B) { + x = 92; + } else { + x = 0; + } + break; + + case 91: + if (btnPress == BTN_B) { + x = 10; + } else { + x = 0; + } + break; + + case 92: + if (btnPress == BTN_A) { + x = 10; + } else { + x = 0; + } + break; + + case 10: + if ((btnCur == (BTN_A | BTN_B | BTN_START)) && (btnPress == BTN_START)) { + f32 comboTimeSeconds = OS_CYCLES_TO_USEC(osGetTime() - comboStartTime) / 1000000.0f; + + osSyncPrintf(T("入力時間 %f 秒\n", "Input time %f seconds\n"), comboTimeSeconds); + if (comboTimeSeconds <= 50.0f) { + x = 11; + } else { + x = 0; + } + } else { + x = 0; + } + break; + + default: + break; + } + } + } +} + +void func_800AF0E0(void) { + s32 i; + + Fault_DrawRecBlack(22, 16, 276, 208); + Fault_DrawText(40, 30, "SegmentBaseAddress"); + + for (i = 0; i < ARRAY_COUNT(gSegments); i++) { + Fault_DrawText(40, 40 + 8 * i, "%2d:%08x", i, gSegments[i]); + } + Fault_DrawText(40, 180, "Arena_failcnt = %d", gTotalAllocFailures); +} + +void Fault_DrawMemDumpContents(const char* title, void* memory, u32 arg2) { + s32 x; + s32 y; + u32* ptr = (u32*)((uintptr_t)memory & ~3); + + Fault_DrawRecBlack(22, 16, 276, 208); + Fault_DrawText(36, 18, "%s %08x", title != NULL ? title : "PrintDump", ptr); + + if (((uintptr_t)ptr >= PHYS_TO_K0(0x000000)) && ((uintptr_t)ptr <= PHYS_TO_K0(0x400000))) { + for (y = 28; y < 226; y += 9) { + Fault_DrawText(28, y, "%06x", ptr); + for (x = 82; x < 290; x += 52) { + Fault_DrawText(x, y, "%08x", *(ptr++)); + } + } + } +} + +void Fault_DrawMemDumpPC(OSThread* thread) { + u32* pc = (u32*)thread->context.pc; + + if (((uintptr_t)pc >= 0x80000020) && ((uintptr_t)pc <= 0x80400000)) { + Fault_DrawMemDumpContents("PC Trace", pc - 0x20, 0); + } +} + +void Fault_DrawMemDumpSP(OSThread* thread) { + u32* sp = (u32*)(u32)thread->context.sp; + + if (((uintptr_t)sp >= 0x80000020) && ((uintptr_t)sp <= 0x80400000)) { + Fault_DrawMemDumpContents("Stack Trace", sp, 0); + } +} + +void func_800AF3DC(void) { + static s32 B_80122570[16]; + static s32 B_801225B0[8]; // Unused + s32 i; + + Fault_DrawRecBlack(22, 16, 276, 208); + Fault_DrawText(36, 18, "ROM DEBUG"); + + for (i = 0; i < ARRAY_COUNT(B_80122570); i++) { + Fault_DrawText(((i % 4) * 52) + 82, ((i / 4) * 9) + 28, "%08x", B_80122570[i]); + } +} + +void Fault_ResumeThread(OSThread* thread) { + thread->context.cause = 0; + thread->context.fpcsr = 0; + thread->context.pc += sizeof(u32); + *(u32*)thread->context.pc = 0x0000000D; // write in a break instruction + osWritebackDCache((void*)thread->context.pc, 4); + osInvalICache((void*)thread->context.pc, 4); + osStartThread(thread); +} + +void func_800AF558(void) { + osViBlack(false); + if ((uintptr_t)osViGetCurrentFramebuffer() >= 0x80100000) { + gFaultMgr.fb = osViGetCurrentFramebuffer(); + } else { + gFaultMgr.fb = (u16*)(PHYS_TO_K0(osMemSize) - sizeof(u16[SCREEN_HEIGHT][SCREEN_WIDTH])); + osViSwapBuffer(gFaultMgr.fb); + } +} + +void Fault_AddClient(FaultClient* client, void* callback, void* arg0, void* arg1) { + FaultMgr* faultMgr = &gFaultMgr; + OSIntMask mask; + + mask = osSetIntMask(OS_IM_NONE); + + client->callback = callback; + client->arg0 = arg0; + client->arg1 = arg1; + client->next = faultMgr->clients; + faultMgr->clients = client; + + osSetIntMask(mask); +} + +void Fault_RemoveClient(FaultClient* client) { + u32 mask; + FaultClient* iterClient = gFaultMgr.clients; + FaultClient* lastClient = NULL; + + mask = osSetIntMask(OS_IM_NONE); + while (iterClient != NULL) { + if (iterClient == client) { + if (lastClient != NULL) { + lastClient->next = client->next; + } else { + gFaultMgr.clients = client->next; + } + break; + } else { + lastClient = iterClient; + iterClient = iterClient->next; + } + } + osSetIntMask(mask); +} + +void Fault_ProcessClients(void) { + s32 i; + FaultClient* client; + + client = gFaultMgr.clients; + i = 0; + while (client != NULL) { + if (client->callback != NULL) { + Fault_DrawRecBlack(22, 16, 276, 208); + Fault_DrawText(30, 20, "CallBack (%d) %08x %08x %08x", i++, client, client->arg0, client->arg1); + ((void (*)(void*, void*))client->callback)(client->arg0, client->arg1); + Fault_WaitForInput(); + } + client = client->next; + } +} + +#define FAULT_MSG_CPU_BREAK ((OSMesg)1) +#define FAULT_MSG_FAULT ((OSMesg)2) +#define FAULT_MSG_UNK ((OSMesg)3) + +void Fault_ThreadEntry(void* arg0) { + OSMesg msg; + OSThread* faultedThread; + + osSetEventMesg(OS_EVENT_CPU_BREAK, &gFaultMgr.queue, FAULT_MSG_CPU_BREAK); + osSetEventMesg(OS_EVENT_FAULT, &gFaultMgr.queue, FAULT_MSG_FAULT); + while (true) { + do { + osRecvMesg(&gFaultMgr.queue, &msg, OS_MESG_BLOCK); + if (msg == FAULT_MSG_CPU_BREAK) { + gFaultMsgId = (s32)FAULT_MSG_CPU_BREAK; + osSyncPrintf(T("フォルトマネージャ:OS_EVENT_CPU_BREAKを受信しました\n", + "Fault Manager: OS_EVENT_CPU_BREAK received\n")); + } else if (msg == FAULT_MSG_FAULT) { + gFaultMsgId = (s32)FAULT_MSG_FAULT; + osSyncPrintf( + T("フォルトマネージャ:OS_EVENT_FAULTを受信しました\n", "Fault Manager: OS_EVENT_FAULT received\n")); + } else { + gFaultMsgId = (s32)FAULT_MSG_UNK; + osSyncPrintf(T("フォルトマネージャ:不明なメッセージを受信しました\n", + "Fault Manager: Unknown message received\n")); + } + faultedThread = __osGetCurrFaultedThread(); + osSyncPrintf("__osGetCurrFaultedThread()=%08x\n", faultedThread); + if (faultedThread == NULL) { + faultedThread = Fault_FindFaultedThread(); + osSyncPrintf("FindFaultedThread()=%08x\n", faultedThread); + } + } while (faultedThread == NULL); + gFaultFaultedThread = faultedThread; + Fault_LogThreadContext(faultedThread); + osSyncPrintf("%d %s %d:%s = %d\n", osGetThreadId(NULL), "fault.c", 1454, "fault_display_enable", + gFaultDisplayEnable); + while (!gFaultDisplayEnable) { + Fault_SleepImpl(1000); + } + Fault_SleepImpl(500); + Fault_DrawCornerRecRed(); + Fault_WaitForButtonCombo(); + do { + func_800AF558(); + Fault_PrintThreadContext(faultedThread); + Fault_WaitForInput(); + func_800AF0E0(); + Fault_WaitForInput(); + func_800AF3DC(); + Fault_WaitForInput(); + Fault_DrawMemDumpSP(faultedThread); + Fault_WaitForInput(); + Fault_DrawMemDumpPC(faultedThread); + Fault_WaitForInput(); + Fault_ProcessClients(); + } while (!gFaultExit); + while (!gFaultExit) {} + Fault_ResumeThread(faultedThread); + } +} + +void Fault_SetFrameBuffer(void* fb, u16 w, u16 h) { + gFaultMgr.fb = fb; + gFaultMgr.fbWidth = w; + gFaultMgr.fbDepth = h; +} + +void Fault_Init(void) { + gFaultDisplayEnable = 1; + gFaultMgr.fb = (u16*)(PHYS_TO_K0(osMemSize) - sizeof(u16[SCREEN_HEIGHT][SCREEN_WIDTH])); + gFaultMgr.fbWidth = SCREEN_WIDTH; + gFaultMgr.fbDepth = 16; + gFaultMgr.clients = 0; + osCreateMesgQueue(&gFaultMgr.queue, &gFaultMgr.msg, 1); + StackCheck_Init(&sFaultStackInfo, sFaultStack, STACK_TOP(sFaultStack), 0, 0x100, "fault"); + osCreateThread(&gFaultMgr.thread, THREAD_ID_FAULT, Fault_ThreadEntry, NULL, STACK_TOP(sFaultStack), + THREAD_PRI_FAULT); + osStartThread(&gFaultMgr.thread); +} + +void Fault_AddHungupAndCrashImpl(const char* exp1, const char* exp2) { + gFaultMsgId = 4; + osSyncPrintf("HungUp on Thread %d", osGetThreadId(NULL)); + osSyncPrintf("%s\n", exp1 != NULL ? exp1 : "(NULL)"); + osSyncPrintf("%s\n", exp2 != NULL ? exp2 : "(NULL)"); + while (gFaultDisplayEnable == 0) { + Fault_SleepImpl(1000); + } + Fault_SleepImpl(500); + Fault_WaitForButtonCombo(); + do { + func_800AF558(); + Fault_DrawRecBlack(22, 16, 276, 34); + Fault_DrawText(24, 18, "HungUp on Thread %d", osGetThreadId(NULL)); + Fault_DrawText(24, 28, "%s", exp1 != NULL ? exp1 : "(NULL)"); + Fault_DrawText(24, 38, "%s", exp2 != NULL ? exp2 : "(NULL)"); + Fault_WaitForInput(); + Fault_ProcessClients(); + } while (true); +} + +void Fault_AddHungupAndCrash(const char* file, int line) { + char msg[256]; + + sprintf(msg, "HungUp %s:%d", file, line); + Fault_AddHungupAndCrashImpl(msg, NULL); +} + +#endif diff --git a/src/code/flg_set.c b/src/code/flg_set.c index ecdf13d56c..27c2343419 100644 --- a/src/code/flg_set.c +++ b/src/code/flg_set.c @@ -1,6 +1,6 @@ #include "global.h" -typedef struct { +typedef struct FlagSetEntry { /* 0x00 */ u16* value; /* 0x04 */ const char* name; } FlagSetEntry; // size = 0x08 diff --git a/src/code/game.c b/src/code/game.c index 8ae0503010..d84f947fd5 100644 --- a/src/code/game.c +++ b/src/code/game.c @@ -1,5 +1,11 @@ #include "global.h" +#include "fault.h" +#include "libc64/os_malloc.h" #include "terminal.h" +#include "versions.h" +#if PLATFORM_N64 +#include "n64dd.h" +#endif VisCvg sVisCvg; VisZBuf sVisZBuf; @@ -16,10 +22,10 @@ void GameState_FaultPrint(void) { s32 i; PRINTF("last_button=%04x\n", sLastButtonPressed); - FaultDrawer_DrawText(120, 180, "%08x", sLastButtonPressed); + Fault_DrawText(120, 180, "%08x", sLastButtonPressed); for (i = 0; i < ARRAY_COUNT(sBtnChars); i++) { if (sLastButtonPressed & (1 << i)) { - FaultDrawer_DrawText((i * 8) + 120, 190, "%c", sBtnChars[i]); + Fault_DrawText((i * 8) + 120, 190, "%c", sBtnChars[i]); } } } @@ -65,7 +71,11 @@ void GameState_SetFBFilter(Gfx** gfxP) { } void func_800C4344(GameState* gameState) { -#if IS_DEBUG +#if PLATFORM_N64 + if (D_80121212 != 0) { + func_801C7E78(); + } +#elif IS_DEBUG Input* selectedInput; s32 hexDumpSize; u16 inputCompareValue; @@ -194,8 +204,6 @@ void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) { Gfx_Close(polyOpaP, newDList); POLY_OPA_DISP = newDList; - if (1) {} - CLOSE_DISPS(gfxCtx, "../game.c", 800); if (IS_DEBUG && (ENABLE_CAMERA_DEBUGGER || ENABLE_REG_EDITOR)) { @@ -232,12 +240,16 @@ void func_800C49F4(GraphicsContext* gfxCtx) { newDlist = Gfx_Open(polyOpaP = POLY_OPA_DISP); gSPDisplayList(OVERLAY_DISP++, newDlist); +#if PLATFORM_N64 + if (D_80121212 != 0) { + func_801C6EA0(&newDlist); + } +#endif + gSPEndDisplayList(newDlist++); Gfx_Close(polyOpaP, newDlist); POLY_OPA_DISP = newDlist; - if (1) {} - CLOSE_DISPS(gfxCtx, "../game.c", 865); } @@ -255,8 +267,26 @@ void GameState_Update(GameState* gameState) { gameState->main(gameState); Rainbow_Update(&gRainbow); + +#if PLATFORM_N64 + if (D_80121212 != 0) { + func_801C7E78(); + } + if ((B_80121220 != NULL) && (B_80121220->unk_74 != NULL)) { + B_80121220->unk_74(gameState); + } +#endif + func_800C4344(gameState); +#if OOT_VERSION < PAL_1_0 + if (R_VI_MODE_EDIT_STATE != VI_MODE_EDIT_STATE_INACTIVE) { + ViMode_Update(&sViMode, &gameState->input[0]); + gfxCtx->viMode = &sViMode.customViMode; + gfxCtx->viFeatures = sViMode.viFeatures; + } +#endif + #if IS_DEBUG if (SREG(63) == 1u) { if (R_VI_MODE_EDIT_STATE < VI_MODE_EDIT_STATE_INACTIVE) { @@ -278,12 +308,12 @@ void GameState_Update(GameState* gameState) { gfxCtx->xScale = gViConfigXScale; gfxCtx->yScale = gViConfigYScale; - if (SREG(63) == 6 || (SREG(63) == 2u && osTvType == OS_TV_NTSC)) { + if (SREG(63) == 6 || (SREG(63) == 2u && (u32)osTvType == OS_TV_NTSC)) { gfxCtx->viMode = &osViModeNtscLan1; gfxCtx->yScale = 1.0f; } - if (SREG(63) == 5 || (SREG(63) == 2u && osTvType == OS_TV_MPAL)) { + if (SREG(63) == 5 || (SREG(63) == 2u && (u32)osTvType == OS_TV_MPAL)) { gfxCtx->viMode = &osViModeMpalLan1; gfxCtx->yScale = 1.0f; } @@ -350,16 +380,24 @@ void GameState_Update(GameState* gameState) { void GameState_InitArena(GameState* gameState, size_t size) { void* arena; - PRINTF("ハイラル確保 サイズ=%u バイト\n"); // "Hyrule reserved size = %u bytes" + PRINTF(T("ハイラル確保 サイズ=%u バイト\n", "Hyrule reserved size = %u bytes\n"), size); arena = GAME_ALLOC_MALLOC(&gameState->alloc, size, "../game.c", 992); if (arena != NULL) { THA_Init(&gameState->tha, arena, size); - PRINTF("ハイラル確保成功\n"); // "Successful Hyral" + PRINTF(T("ハイラル確保成功\n", "Hyrule successfully secured\n")); } else { THA_Init(&gameState->tha, NULL, 0); - PRINTF("ハイラル確保失敗\n"); // "Failure to secure Hyrule" + PRINTF(T("ハイラル確保失敗\n", "Failure to secure Hyrule\n")); +#if OOT_VERSION < NTSC_1_1 + HUNGUP_AND_CRASH("../game.c", 895); +#elif OOT_VERSION < PAL_1_0 + HUNGUP_AND_CRASH("../game.c", 898); +#elif OOT_VERSION < GC_JP + HUNGUP_AND_CRASH("../game.c", 985); +#else HUNGUP_AND_CRASH("../game.c", 999); +#endif } } @@ -373,29 +411,42 @@ void GameState_Realloc(GameState* gameState, size_t size) { THA_Destroy(&gameState->tha); GameAlloc_Free(alloc, thaStart); - PRINTF("ハイラル一時解放!!\n"); // "Hyrule temporarily released!!" + PRINTF(T("ハイラル一時解放!!\n", "Hyrule temporarily released!!\n")); SystemArena_GetSizes(&systemMaxFree, &systemFree, &systemAlloc); if ((systemMaxFree - 0x10) < size) { PRINTF("%c", BEL); PRINTF(VT_FGCOL(RED)); - // "Not enough memory. Change the hyral size to the largest possible value" - PRINTF("メモリが足りません。ハイラルサイズを可能な最大値に変更します\n"); + PRINTF(T("メモリが足りません。ハイラルサイズを可能な最大値に変更します\n", + "Not enough memory. Change Hyrule size to maximum possible value\n")); PRINTF("(hyral=%08x max=%08x free=%08x alloc=%08x)\n", size, systemMaxFree, systemFree, systemAlloc); PRINTF(VT_RST); size = systemMaxFree - 0x10; } - PRINTF("ハイラル再確保 サイズ=%u バイト\n", size); // "Hyral reallocate size = %u bytes" + PRINTF(T("ハイラル再確保 サイズ=%u バイト\n", "Hyrule reallocate size = %u bytes\n"), size); gameArena = GAME_ALLOC_MALLOC(alloc, size, "../game.c", 1033); if (gameArena != NULL) { THA_Init(&gameState->tha, gameArena, size); - PRINTF("ハイラル再確保成功\n"); // "Successful reacquisition of Hyrule" + PRINTF(T("ハイラル再確保成功\n", "Successful reacquisition of Hyrule\n")); } else { THA_Init(&gameState->tha, NULL, 0); - PRINTF("ハイラル再確保失敗\n"); // "Failure to secure Hyral" + PRINTF(T("ハイラル再確保失敗\n", "Failure to secure Hyrule\n")); + +#if IS_DEBUG + SystemArena_Display(); +#endif + +#if OOT_VERSION < NTSC_1_1 + HUNGUP_AND_CRASH("../game.c", 940); +#elif OOT_VERSION < PAL_1_0 + HUNGUP_AND_CRASH("../game.c", 943); +#elif OOT_VERSION < GC_JP + HUNGUP_AND_CRASH("../game.c", 1030); +#else HUNGUP_AND_CRASH("../game.c", 1044); +#endif } } @@ -403,7 +454,7 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g OSTime startTime; OSTime endTime; - PRINTF("game コンストラクタ開始\n"); // "game constructor start" + PRINTF(T("game コンストラクタ開始\n", "game constructor start\n")); gameState->gfxCtx = gfxCtx; gameState->frames = 0; gameState->main = NULL; @@ -418,23 +469,22 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g { s32 requiredScopeTemp; endTime = osGetTime(); - // "game_set_next_game_null processing time %d us" - PRINTF("game_set_next_game_null 処理時間 %d us\n", OS_CYCLES_TO_USEC(endTime - startTime)); + PRINTF(T("game_set_next_game_null 処理時間 %d us\n", "game_set_next_game_null processing time %d us\n"), + OS_CYCLES_TO_USEC(endTime - startTime)); startTime = endTime; GameAlloc_Init(&gameState->alloc); } endTime = osGetTime(); - // "gamealloc_init processing time %d us" - PRINTF("gamealloc_init 処理時間 %d us\n", OS_CYCLES_TO_USEC(endTime - startTime)); + PRINTF(T("gamealloc_init 処理時間 %d us\n", "gamealloc_init processing time %d us\n"), + OS_CYCLES_TO_USEC(endTime - startTime)); startTime = endTime; GameState_InitArena(gameState, GAMESTATE_ALLOC_SIZE); R_UPDATE_RATE = 3; init(gameState); endTime = osGetTime(); - // "init processing time %d us" - PRINTF("init 処理時間 %d us\n", OS_CYCLES_TO_USEC(endTime - startTime)); + PRINTF(T("init 処理時間 %d us\n", "init processing time %d us\n"), OS_CYCLES_TO_USEC(endTime - startTime)); startTime = endTime; LOG_UTILS_CHECK_NULL_POINTER("this->cleanup", gameState->destroy, "../game.c", 1088); @@ -452,8 +502,8 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g Rumble_Init(); osSendMesg(&gameState->gfxCtx->queue, NULL, OS_MESG_BLOCK); endTime = osGetTime(); - // "Other initialization processing time %d us" - PRINTF("その他初期化 処理時間 %d us\n", OS_CYCLES_TO_USEC(endTime - startTime)); + PRINTF(T("その他初期化 処理時間 %d us\n", "Other initialization processing time %d us\n"), + OS_CYCLES_TO_USEC(endTime - startTime)); #if IS_DEBUG Fault_AddClient(&sGameFaultClient, GameState_FaultPrint, NULL, NULL); @@ -464,11 +514,11 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g Menu_Init(&gDebug.menu); #endif - PRINTF("game コンストラクタ終了\n"); // "game constructor end" + PRINTF(T("game コンストラクタ終了\n", "game constructor end\n")); } void GameState_Destroy(GameState* gameState) { - PRINTF("game デストラクタ開始\n"); // "game destructor start" + PRINTF(T("game デストラクタ開始\n", "game destructor start\n")); AudioMgr_StopAllSfx(); Audio_Update(); osRecvMesg(&gameState->gfxCtx->queue, NULL, OS_MESG_BLOCK); @@ -491,7 +541,7 @@ void GameState_Destroy(GameState* gameState) { THA_Destroy(&gameState->tha); GameAlloc_Cleanup(&gameState->alloc); - PRINTF("game デストラクタ終了\n"); // "game destructor end" + PRINTF(T("game デストラクタ終了\n", "game destructor end\n")); } GameStateFunc GameState_GetInit(GameState* gameState) { @@ -511,17 +561,17 @@ void* GameState_Alloc(GameState* gameState, size_t size, const char* file, int l void* ret; if (THA_IsCrash(&gameState->tha)) { - PRINTF("ハイラルは滅亡している\n"); + PRINTF(T("ハイラルは滅亡している\n", "Hyrule is destroyed\n")); ret = NULL; } else if ((u32)THA_GetRemaining(&gameState->tha) < size) { - // "Hyral on the verge of extinction does not have %d bytes left (%d bytes until extinction)" - PRINTF("滅亡寸前のハイラルには %d バイトの余力もない(滅亡まであと %d バイト)\n", size, - THA_GetRemaining(&gameState->tha)); + PRINTF(T("滅亡寸前のハイラルには %d バイトの余力もない(滅亡まであと %d バイト)\n", + "Hyrule on the verge of extinction does not have %d bytes left (%d bytes until extinction)\n"), + size, THA_GetRemaining(&gameState->tha)); ret = NULL; } else { ret = THA_AllocTailAlign16(&gameState->tha, size); if (THA_IsCrash(&gameState->tha)) { - PRINTF("ハイラルは滅亡してしまった\n"); // "Hyrule has been destroyed" + PRINTF(T("ハイラルは滅亡してしまった\n", "Hyrule has been destroyed\n")); ret = NULL; } } diff --git a/src/code/gfxprint.c b/src/code/gfxprint.c index f66f23bf28..fadc32cc82 100644 --- a/src/code/gfxprint.c +++ b/src/code/gfxprint.c @@ -126,13 +126,23 @@ u8 sGfxPrintFontData[(16 * 256) / 2] = { 0x1B, 0xAA, 0x40, 0x21, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; +#if !PLATFORM_N64 // Can be used to set GFXP_FLAG_ENLARGE by default static u8 sDefaultSpecialFlags; +#endif void GfxPrint_Setup(GfxPrint* this) { - s32 width = 16; - s32 height = 256; + s32 width; + s32 height; s32 i; + s32 pal; + s32 cm; + s32 masks; + s32 maskt; + s32 shift; + s32 line; + s32 tmem = 0; + s32 fmt = G_IM_FMT_CI; gDPPipeSync(this->dList++); gDPSetOtherMode(this->dList++, @@ -140,27 +150,41 @@ void GfxPrint_Setup(GfxPrint* this) { G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2); gDPSetCombineMode(this->dList++, G_CC_DECALRGBA, G_CC_DECALRGBA); - gDPLoadTextureBlock_4b(this->dList++, sGfxPrintFontData, G_IM_FMT_CI, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + width = 16; + height = 256; + cm = G_TX_NOMIRROR | G_TX_WRAP; + masks = G_TX_NOMASK; + maskt = G_TX_NOMASK; + shift = G_TX_NOLOD; + + gDPLoadMultiBlock_4b(this->dList++, sGfxPrintFontData, 0, G_TX_RENDERTILE, G_IM_FMT_CI, width, height, 0, cm, cm, + masks, maskt, shift, shift); gDPLoadTLUT(this->dList++, 64, 0x100, sGfxPrintFontTLUT); for (i = 1; i < 4; i++) { - gDPSetTile(this->dList++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, i * 2, i, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); - gDPSetTileSize(this->dList++, i * 2, 0, 0, 15 << 2, 255 << 2); + gDPSetTile(this->dList++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, i * 2, i, cm, maskt, shift, cm, masks, shift); + gDPSetTileSize(this->dList++, i * 2, 0 << 2, 0 << 2, (width - 1) << 2, (height - 1) << 2); } gDPSetColor(this->dList++, G_SETPRIMCOLOR, this->color.rgba); - gDPLoadMultiTile_4b(this->dList++, sGfxPrintRainbowData, 0, 1, G_IM_FMT_CI, 2, 8, 0, 0, 1, 7, 4, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 1, 3, G_TX_NOLOD, G_TX_NOLOD); - + width = 2; + height = 8; + cm = G_TX_NOMIRROR | G_TX_WRAP; + masks = 1; + maskt = 3; + shift = G_TX_NOLOD; + pal = 4; + line = 1; + + gDPLoadMultiTile_4b(this->dList++, sGfxPrintRainbowData, 0, 1, G_IM_FMT_CI, width, height, 0, 0, width - 1, + height - 1, pal, cm, cm, masks, maskt, shift, shift); gDPLoadTLUT(this->dList++, 16, 0x140, sGfxPrintRainbowTLUT); for (i = 1; i < 4; i++) { - gDPSetTile(this->dList++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, i * 2 + 1, 4, G_TX_NOMIRROR | G_TX_WRAP, 3, - G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD); - gDPSetTileSize(this->dList++, i * 2 + 1, 0, 0, 1 << 2, 7 << 2); + gDPSetTile(this->dList++, fmt, G_IM_SIZ_4b, line, tmem, i * 2 + 1, pal, cm, maskt, shift, cm, masks, shift); + gDPSetTileSize(this->dList++, i * 2 + 1, 0 << 2, 0 << 2, (width - 1) << 2, (height - 1) << 2); } } @@ -217,6 +241,10 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c) { if (this->flags & GFXP_FLAG_SHADOW) { gDPSetColor(this->dList++, G_SETPRIMCOLOR, 0); +#if PLATFORM_N64 + gSPTextureRectangle(this->dList++, this->posX + 4, this->posY + 4, this->posX + 4 + 32, this->posY + 4 + 32, + tile, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1 << 10, 1 << 10); +#else if (this->flags & GFXP_FLAG_ENLARGE) { gSPTextureRectangle(this->dList++, (this->posX + 4) << 1, (this->posY + 4) << 1, WIDE_INCR(this->posX + 4 + 32, -9) << 1, (this->posY + 4 + 32 - 1) << 1, tile, @@ -226,10 +254,15 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c) { this->posY + 4 + 32 - 1, tile, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, WIDE_DIV((1 << 10), WIDE_GET_RATIO), 1 << 10); } +#endif gDPSetColor(this->dList++, G_SETPRIMCOLOR, this->color.rgba); } +#if PLATFORM_N64 + gSPTextureRectangle(this->dList++, this->posX, this->posY, this->posX + 32, this->posY + 32, tile, + (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1 << 10, 1 << 10); +#else if (this->flags & GFXP_FLAG_ENLARGE) { gSPTextureRectangle(this->dList++, this->posX << 1, this->posY << 1, WIDE_INCR(this->posX + 32, -9) << 1, (this->posY + 32 - 1) << 1, tile, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, @@ -238,26 +271,32 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c) { gSPTextureRectangle(this->dList++, this->posX, this->posY, WIDE_INCR(this->posX + 32, -9), this->posY + 32 - 1, tile, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, WIDE_DIV((1 << 10), WIDE_GET_RATIO), 1 << 10); } +#endif this->posX += GFX_CHAR_X_SPACING << 2; } void GfxPrint_PrintChar(GfxPrint* this, u8 c) { +#if PLATFORM_N64 +#define CHAR_PARAM c +#else +#define CHAR_PARAM charParam u8 charParam = c; +#endif if (c == ' ') { this->posX += WIDE_DIV((GFX_CHAR_X_SPACING << 2), WIDE_GET_16_9); } else if (c > ' ' && c < 0x7F) { - GfxPrint_PrintCharImpl(this, charParam); + GfxPrint_PrintCharImpl(this, c); } else if (c >= 0xA0 && c < 0xE0) { if (this->flags & GFXP_FLAG_HIRAGANA) { if (c < 0xC0) { - charParam = c - 0x20; + CHAR_PARAM = c - 0x20; } else { - charParam = c + 0x20; + CHAR_PARAM = c + 0x20; } } - GfxPrint_PrintCharImpl(this, charParam); + GfxPrint_PrintCharImpl(this, CHAR_PARAM); } else { switch (c) { case '\0': @@ -334,11 +373,13 @@ void GfxPrint_Init(GfxPrint* this) { this->flags |= GFXP_FLAG_SHADOW; this->flags |= GFXP_FLAG_UPDATE; +#if !PLATFORM_N64 if (sDefaultSpecialFlags & GFXP_FLAG_ENLARGE) { this->flags |= GFXP_FLAG_ENLARGE; } else { this->flags &= ~GFXP_FLAG_ENLARGE; } +#endif } void GfxPrint_Destroy(GfxPrint* this) { @@ -350,7 +391,9 @@ void GfxPrint_Open(GfxPrint* this, Gfx* dList) { this->dList = dList; GfxPrint_Setup(this); } else { - PRINTF("gfxprint_open:2重オープンです\n"); +#if PLATFORM_N64 || OOT_DEBUG + osSyncPrintf(T("gfxprint_open:2重オープンです\n", "gfxprint_open: Double open\n")); +#endif } } @@ -358,7 +401,9 @@ Gfx* GfxPrint_Close(GfxPrint* this) { Gfx* ret; this->flags &= ~GFXP_FLAG_OPEN; +#if !PLATFORM_N64 gDPPipeSync(this->dList++); +#endif ret = this->dList; this->dList = NULL; diff --git a/src/code/graph.c b/src/code/graph.c index c5e187365b..4657126c4c 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -1,14 +1,24 @@ #include "global.h" +#include "fault.h" #include "terminal.h" +#include "ucode_disas.h" +#include "versions.h" #define GFXPOOL_HEAD_MAGIC 0x1234 #define GFXPOOL_TAIL_MAGIC 0x5678 -#if IS_DEBUG -FaultClient sGraphFaultClient; -#endif +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:192 pal-1.0:192 pal-1.1:192" -CfbInfo sGraphCfbInfos[3]; +/** + * The time at which the previous `Graph_Update` ended. + */ +OSTime sGraphPrevUpdateEndTime; + +/** + * The time at which the previous graphics task was scheduled to run. + */ +OSTime sGraphPrevTaskTimeStart; #if ENABLE_F3DEX3 #define GRAPH_UCODE_GLOBAL_SYMBOL gF3DEX3TextBuffer @@ -21,18 +31,18 @@ u16 (*gWorkBuf)[SCREEN_WIDTH * SCREEN_HEIGHT]; // pointer-to-array, array itself #endif #if IS_DEBUG -FaultClient sGraphUcodeFaultClient; +FaultClient sGraphFaultClient; UCodeInfo D_8012D230[3] = { - { UCODE_F3DZEX, GRAPH_UCODE_GLOBAL_SYMBOL }, - { UCODE_UNK, NULL }, - { UCODE_S2DEX, gspS2DEX2d_fifoTextStart }, + { UCODE_TYPE_F3DZEX, GRAPH_UCODE_GLOBAL_SYMBOL }, + { UCODE_TYPE_UNK, NULL }, + { UCODE_TYPE_S2DEX, gspS2DEX2d_fifoTextStart }, }; UCodeInfo D_8012D248[3] = { - { UCODE_F3DZEX, GRAPH_UCODE_GLOBAL_SYMBOL }, - { UCODE_UNK, NULL }, - { UCODE_S2DEX, gspS2DEX2d_fifoTextStart }, + { UCODE_TYPE_F3DZEX, GRAPH_UCODE_GLOBAL_SYMBOL }, + { UCODE_TYPE_UNK, NULL }, + { UCODE_TYPE_S2DEX, gspS2DEX2d_fifoTextStart }, }; void Graph_FaultClient(void) { @@ -143,10 +153,17 @@ void Graph_Init(GraphicsContext* gfxCtx) { gfxCtx->gfxPoolIdx = 0; gfxCtx->fbIdx = 0; gfxCtx->viMode = NULL; + +#if OOT_VERSION < PAL_1_0 + gfxCtx->viFeatures = 0; +#else gfxCtx->viFeatures = gViConfigFeatures; gfxCtx->xScale = gViConfigXScale; gfxCtx->yScale = gViConfigYScale; +#endif + osCreateMesgQueue(&gfxCtx->queue, gfxCtx->msgBuff, ARRAY_COUNT(gfxCtx->msgBuff)); + #if IS_DEBUG func_800D31F0(); Fault_AddClient(&sGraphFaultClient, Graph_FaultClient, NULL, NULL); @@ -160,31 +177,27 @@ void Graph_Destroy(GraphicsContext* gfxCtx) { #endif } +void Graph_TaskSet00(GraphicsContext* gfxCtx) { #if IS_DEBUG -Gfx* gPrevTaskWorkBuffer = NULL; + static Gfx* sPrevTaskWorkBuffer = NULL; #endif - -void Graph_TaskSet00(GraphicsContext* gfxCtx) { - static s32 sGraphCfbInfoIdx = 0; - - OSTime timeNow; - OSTimer timer; - OSMesg msg; OSTask_t* task = &gfxCtx->task.list.t; OSScTask* scTask = &gfxCtx->task; { - CfbInfo* cfb; + OSTimer timer; + OSMesg msg; + // Schedule a message to be handled in 3 seconds, for RCP timeout osSetTimer(&timer, OS_USEC_TO_CYCLES(3000000), 0, &gfxCtx->queue, (OSMesg)666); osRecvMesg(&gfxCtx->queue, &msg, OS_MESG_BLOCK); osStopTimer(&timer); if (msg == (OSMesg)666) { -#if IS_DEBUG +#if OOT_DEBUG PRINTF(VT_FGCOL(RED)); - PRINTF("RCPが帰ってきませんでした。"); // "RCP did not return." + PRINTF(T("RCPが帰ってきませんでした。", "RCP did not return.")); PRINTF(VT_RST); LogUtils_LogHexDump((void*)PHYS_TO_K1(SP_BASE_REG), 0x20); @@ -192,11 +205,11 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) { LogUtils_LogHexDump(gGfxSPTaskYieldBuffer, sizeof(gGfxSPTaskYieldBuffer)); SREG(6) = -1; - if (gPrevTaskWorkBuffer != NULL) { + if (sPrevTaskWorkBuffer != NULL) { R_HREG_MODE = HREG_MODE_UCODE_DISAS; R_UCODE_DISAS_TOGGLE = 1; R_UCODE_DISAS_LOG_LEVEL = 2; - Graph_DisassembleUCode(gPrevTaskWorkBuffer); + Graph_DisassembleUCode(sPrevTaskWorkBuffer); } #endif @@ -205,50 +218,52 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) { osRecvMesg(&gfxCtx->queue, &msg, OS_MESG_NOBLOCK); -#if IS_DEBUG - gPrevTaskWorkBuffer = gfxCtx->workBuffer; +#if OOT_DEBUG + sPrevTaskWorkBuffer = gfxCtx->workBuffer; #endif + } - if (gfxCtx->callback != NULL) { - gfxCtx->callback(gfxCtx, gfxCtx->callbackParam); - } + if (gfxCtx->callback != NULL) { + gfxCtx->callback(gfxCtx, gfxCtx->callbackParam); + } - task->type = M_GFXTASK; - task->flags = OS_SC_DRAM_DLIST; - task->ucode_boot = SysUcode_GetUCodeBoot(); - task->ucode_boot_size = SysUcode_GetUCodeBootSize(); - task->ucode = SysUcode_GetUCode(); - task->ucode_data = SysUcode_GetUCodeData(); - task->ucode_size = SP_UCODE_SIZE; - task->ucode_data_size = SP_UCODE_DATA_SIZE; - task->dram_stack = gGfxSPTaskStack; - task->dram_stack_size = sizeof(gGfxSPTaskStack); - task->output_buff = gGfxSPTaskOutputBuffer; - task->output_buff_size = gGfxSPTaskOutputBuffer + ARRAY_COUNT(gGfxSPTaskOutputBuffer); - task->data_ptr = (u64*)gfxCtx->workBuffer; - - OPEN_DISPS(gfxCtx, "../graph.c", 828); - task->data_size = (uintptr_t)WORK_DISP - (uintptr_t)gfxCtx->workBuffer; - CLOSE_DISPS(gfxCtx, "../graph.c", 830); - - task->yield_data_ptr = gGfxSPTaskYieldBuffer; - - if (1) {} - - task->yield_data_size = sizeof(gGfxSPTaskYieldBuffer); - - scTask->next = NULL; - scTask->flags = OS_SC_NEEDS_RSP | OS_SC_NEEDS_RDP | OS_SC_SWAPBUFFER | OS_SC_LAST_TASK; - if (R_GRAPH_TASKSET00_FLAGS & 1) { - R_GRAPH_TASKSET00_FLAGS &= ~1; - scTask->flags &= ~OS_SC_SWAPBUFFER; - gfxCtx->fbIdx--; - } + task->type = M_GFXTASK; + task->flags = OS_SC_DRAM_DLIST; + task->ucode_boot = SysUcode_GetUCodeBoot(); + task->ucode_boot_size = SysUcode_GetUCodeBootSize(); + task->ucode = SysUcode_GetUCode(); + task->ucode_data = SysUcode_GetUCodeData(); + task->ucode_size = SP_UCODE_SIZE; + task->ucode_data_size = SP_UCODE_DATA_SIZE; + task->dram_stack = gGfxSPTaskStack; + task->dram_stack_size = sizeof(gGfxSPTaskStack); + task->output_buff = gGfxSPTaskOutputBuffer; + task->output_buff_size = gGfxSPTaskOutputBuffer + ARRAY_COUNT(gGfxSPTaskOutputBuffer); + task->data_ptr = (u64*)gfxCtx->workBuffer; + + OPEN_DISPS(gfxCtx, "../graph.c", 828); + task->data_size = (uintptr_t)WORK_DISP - (uintptr_t)gfxCtx->workBuffer; + CLOSE_DISPS(gfxCtx, "../graph.c", 830); + + task->yield_data_ptr = gGfxSPTaskYieldBuffer; + + task->yield_data_size = sizeof(gGfxSPTaskYieldBuffer); + + scTask->next = NULL; + scTask->flags = OS_SC_NEEDS_RSP | OS_SC_NEEDS_RDP | OS_SC_SWAPBUFFER | OS_SC_LAST_TASK; + if (R_GRAPH_TASKSET00_FLAGS & 1) { + R_GRAPH_TASKSET00_FLAGS &= ~1; + scTask->flags &= ~OS_SC_SWAPBUFFER; + gfxCtx->fbIdx--; + } - scTask->msgQueue = &gfxCtx->queue; - scTask->msg = NULL; + scTask->msgQueue = &gfxCtx->queue; + scTask->msg = NULL; - { s16 pad; } + { + static CfbInfo sGraphCfbInfos[3]; + static s32 sGraphCfbInfoIdx = 0; + CfbInfo* cfb; cfb = &sGraphCfbInfos[sGraphCfbInfoIdx]; @@ -258,20 +273,20 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) { cfb->viMode = gfxCtx->viMode; cfb->viFeatures = gfxCtx->viFeatures; +#if OOT_VERSION >= PAL_1_0 cfb->xScale = gfxCtx->xScale; cfb->yScale = gfxCtx->yScale; +#endif cfb->unk_10 = 0; cfb->updateRate = R_UPDATE_RATE; scTask->framebuffer = cfb; + } - { s16 pad2; } - - gfxCtx->schedMsgQueue = &gScheduler.cmdQueue; + gfxCtx->schedMsgQueue = &gScheduler.cmdQueue; - osSendMesg(&gScheduler.cmdQueue, (OSMesg)scTask, OS_MESG_BLOCK); - Sched_Notify(&gScheduler); - } + osSendMesg(&gScheduler.cmdQueue, (OSMesg)scTask, OS_MESG_BLOCK); + Sched_Notify(&gScheduler); } void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { @@ -334,6 +349,8 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { } if (R_HREG_MODE == HREG_MODE_UCODE_DISAS && R_UCODE_DISAS_TOGGLE != 0) { + static FaultClient sGraphUcodeFaultClient; + if (R_UCODE_DISAS_LOG_MODE == 3) { Fault_AddClient(&sGraphUcodeFaultClient, Graph_UCodeFaultClient, gfxCtx->workBuffer, "do_count_fault"); } @@ -363,36 +380,52 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { if (pool->headMagic != GFXPOOL_HEAD_MAGIC) { //! @bug (?) : "problem = true;" may be missing PRINTF("%c", BEL); - // "Dynamic area head is destroyed" - PRINTF(VT_COL(RED, WHITE) "ダイナミック領域先頭が破壊されています\n" VT_RST); + PRINTF(VT_COL(RED, WHITE) T("ダイナミック領域先頭が破壊されています\n", "Dynamic area head is destroyed\n") + VT_RST); +#if OOT_VERSION < NTSC_1_1 + Fault_AddHungupAndCrash("../graph.c", 937); +#elif OOT_VERSION < PAL_1_0 + Fault_AddHungupAndCrash("../graph.c", 940); +#elif OOT_VERSION < GC_JP + Fault_AddHungupAndCrash("../graph.c", 951); +#else Fault_AddHungupAndCrash("../graph.c", 1070); +#endif } if (pool->tailMagic != GFXPOOL_TAIL_MAGIC) { problem = true; PRINTF("%c", BEL); - // "Dynamic region tail is destroyed" - PRINTF(VT_COL(RED, WHITE) "ダイナミック領域末尾が破壊されています\n" VT_RST); + PRINTF(VT_COL(RED, WHITE) + T("ダイナミック領域末尾が破壊されています\n", "Dynamic region tail is destroyed\n") VT_RST); +#if OOT_VERSION < NTSC_1_1 + Fault_AddHungupAndCrash("../graph.c", 943); +#elif OOT_VERSION < PAL_1_0 + Fault_AddHungupAndCrash("../graph.c", 946); +#elif OOT_VERSION < GC_JP + Fault_AddHungupAndCrash("../graph.c", 957); +#else Fault_AddHungupAndCrash("../graph.c", 1076); +#endif } } if (THGA_IsCrash(&gfxCtx->polyOpa)) { problem = true; PRINTF("%c", BEL); - // "Zelda 0 is dead" - PRINTF(VT_COL(RED, WHITE) "ゼルダ0は死んでしまった(graph_alloc is empty)\n" VT_RST); + PRINTF(VT_COL(RED, WHITE) T("ゼルダ0は死んでしまった(graph_alloc is empty)\n", + "Zelda 0 is dead (graph_alloc is empty)\n") VT_RST); } if (THGA_IsCrash(&gfxCtx->polyXlu)) { problem = true; PRINTF("%c", BEL); - // "Zelda 1 is dead" - PRINTF(VT_COL(RED, WHITE) "ゼルダ1は死んでしまった(graph_alloc is empty)\n" VT_RST); + PRINTF(VT_COL(RED, WHITE) T("ゼルダ1は死んでしまった(graph_alloc is empty)\n", + "Zelda 1 is dead (graph_alloc is empty)\n") VT_RST); } if (THGA_IsCrash(&gfxCtx->overlay)) { problem = true; PRINTF("%c", BEL); - // "Zelda 4 is dead" - PRINTF(VT_COL(RED, WHITE) "ゼルダ4は死んでしまった(graph_alloc is empty)\n" VT_RST); + PRINTF(VT_COL(RED, WHITE) T("ゼルダ4は死んでしまった(graph_alloc is empty)\n", + "Zelda 4 is dead (graph_alloc is empty)\n") VT_RST); } if (!problem) { @@ -412,8 +445,8 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { } if (gIsCtrlr2Valid && PreNmiBuff_IsResetting(gAppNmiBufferPtr) && !gameState->inPreNMIState) { - // "To reset mode" - PRINTF(VT_COL(YELLOW, BLACK) "PRE-NMIによりリセットモードに移行します\n" VT_RST); + PRINTF(VT_COL(YELLOW, BLACK) T("PRE-NMIによりリセットモードに移行します\n", + "PRE-NMI causes the system to transition to reset mode\n") VT_RST); SET_NEXT_GAMESTATE(gameState, PreNMI_Init, PreNMIState); gameState->running = false; } @@ -437,7 +470,7 @@ void Graph_ThreadEntry(void* arg0) { gWorkBuf = (void*)ALIGN64((u32)gWorkBuf); #endif - PRINTF("グラフィックスレッド実行開始\n"); // "Start graphic thread execution" + PRINTF(T("グラフィックスレッド実行開始\n", "Start graphic thread execution\n")); Graph_Init(&gfxCtx); while (nextOvl != NULL) { @@ -445,7 +478,7 @@ void Graph_ThreadEntry(void* arg0) { Overlay_LoadGameState(ovl); size = ovl->instanceSize; - PRINTF("クラスサイズ=%dバイト\n", size); // "Class size = %d bytes" + PRINTF(T("クラスサイズ=%dバイト\n", "Class size = %d bytes\n"), size); gameState = SYSTEM_ARENA_MALLOC(size, "../graph.c", 1196); @@ -453,10 +486,16 @@ void Graph_ThreadEntry(void* arg0) { #if IS_DEBUG char faultMsg[0x50]; - PRINTF("確保失敗\n"); // "Failure to secure" + PRINTF(T("確保失敗\n", "Failure to secure\n")); sprintf(faultMsg, "CLASS SIZE= %d bytes", size); Fault_AddHungupAndCrashImpl("GAME CLASS MALLOC FAILED", faultMsg); +#elif OOT_VERSION < NTSC_1_1 + Fault_AddHungupAndCrash("../graph.c", 1067); +#elif OOT_VERSION < PAL_1_0 + Fault_AddHungupAndCrash("../graph.c", 1070); +#elif OOT_VERSION < GC_JP + Fault_AddHungupAndCrash("../graph.c", 1081); #else Fault_AddHungupAndCrash("../graph.c", 1200); #endif @@ -474,7 +513,7 @@ void Graph_ThreadEntry(void* arg0) { Overlay_FreeGameState(ovl); } Graph_Destroy(&gfxCtx); - PRINTF("グラフィックスレッド実行終了\n"); // "End of graphic thread execution" + PRINTF(T("グラフィックスレッド実行終了\n", "End of graphic thread execution\n")); } void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size) { diff --git a/src/code/irqmgr.c b/src/code/irqmgr.c index 71eaeb4ddb..3a1e3cdf55 100644 --- a/src/code/irqmgr.c +++ b/src/code/irqmgr.c @@ -34,6 +34,7 @@ */ #include "global.h" #include "terminal.h" +#include "versions.h" vu32 gIrqMgrResetStatus = IRQ_RESET_STATUS_IDLE; volatile OSTime sIrqMgrResetTime = 0; @@ -43,9 +44,13 @@ u32 sIrqMgrRetraceCount = 0; // Internal messages #define IRQ_RETRACE_MSG 666 #define IRQ_PRENMI_MSG 669 +#if OOT_VERSION < PAL_1_0 +#define IRQ_PRENMI500_MSG 670 +#else #define IRQ_PRENMI450_MSG 671 #define IRQ_PRENMI480_MSG 672 #define IRQ_PRENMI500_MSG 673 +#endif /** * Registers a client and an associated message queue with the IRQ manager. When an @@ -117,10 +122,10 @@ void IrqMgr_SendMesgToClients(IrqMgr* irqMgr, OSMesg msg) { for (client = irqMgr->clients; client != NULL; client = client->prev) { if (MQ_IS_FULL(client->queue)) { - // "irqmgr_SendMesgForClient: Message queue is overflowing mq=%08x cnt=%d" - PRINTF( - VT_COL(RED, WHITE) "irqmgr_SendMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST, - client->queue, MQ_GET_COUNT(client->queue)); + PRINTF(VT_COL(RED, WHITE) T("irqmgr_SendMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n", + "irqmgr_SendMesgForClient: Message queue is overflowing mq=%08x cnt=%d\n") + VT_RST, + client->queue, MQ_GET_COUNT(client->queue)); } else { osSendMesg(client->queue, msg, OS_MESG_NOBLOCK); } @@ -140,10 +145,9 @@ void IrqMgr_JamMesgToClients(IrqMgr* irqMgr, OSMesg msg) { for (client = irqMgr->clients; client != NULL; client = client->prev) { if (MQ_IS_FULL(client->queue)) { - // "irqmgr_JamMesgForClient: Message queue is overflowing mq=%08x cnt=%d" - PRINTF( - VT_COL(RED, WHITE) "irqmgr_JamMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST, - client->queue, MQ_GET_COUNT(client->queue)); + PRINTF(VT_COL(RED, WHITE) T("irqmgr_JamMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n", + "irqmgr_JamMesgForClient: Message queue is overflowing mq=%08x cnt=%d") VT_RST, + client->queue, MQ_GET_COUNT(client->queue)); } else { //! @bug The function's name suggests this would use osJamMesg rather than osSendMesg, using the //! latter makes this function no different than IrqMgr_SendMesgToClients. @@ -164,29 +168,52 @@ void IrqMgr_HandlePreNMI(IrqMgr* irqMgr) { irqMgr->resetStatus = IRQ_RESET_STATUS_PRENMI; sIrqMgrResetTime = irqMgr->resetTime = osGetTime(); +#if OOT_VERSION < PAL_1_0 + // Schedule a PRENMI500 message to be handled in 500ms + osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(500000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI500_MSG); +#else // Schedule a PRENMI450 message to be handled in 450ms - osSetTimer(&irqMgr->timer, OS_MSEC_TO_CYCLES(450), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI450_MSG); + osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(450000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI450_MSG); +#endif IrqMgr_JamMesgToClients(irqMgr, (OSMesg)&irqMgr->prenmiMsg); } void IrqMgr_CheckStacks(void) { - // "0.5 seconds after PRENMI" - PRINTF("irqmgr.c: PRENMIから0.5秒経過\n"); + PRINTF(T("irqmgr.c: PRENMIから0.5秒経過\n", "irqmgr.c: 0.5 seconds after PRENMI\n")); if (StackCheck_Check(NULL) == STACK_STATUS_OK) { - // "The stack looks ok" - PRINTF("スタックは大丈夫みたいです\n"); + PRINTF(T("スタックは大丈夫みたいです\n", "The stack looks ok\n")); } else { PRINTF("%c", BEL); PRINTF(VT_FGCOL(RED)); - // "Stack overflow or dangerous" - PRINTF("スタックがオーバーフローしたか危険な状態です\n"); - // "Increase stack size early or don't consume stack" - PRINTF("早々にスタックサイズを増やすか、スタックを消費しないようにしてください\n"); + PRINTF(T("スタックがオーバーフローしたか危険な状態です\n", "Stack overflow or dangerous\n")); + PRINTF(T("早々にスタックサイズを増やすか、スタックを消費しないようにしてください\n", + "Increase stack size early or don't consume stack\n")); PRINTF(VT_RST); } } +#if OOT_VERSION < PAL_1_0 + +void IrqMgr_HandlePreNMI500(IrqMgr* irqMgr) { + u64 nmi = IRQ_RESET_STATUS_NMI; // required to match + u32 result; + + gIrqMgrResetStatus = nmi; + irqMgr->resetStatus = IRQ_RESET_STATUS_NMI; + + IrqMgr_SendMesgToClients(irqMgr, (OSMesg)&irqMgr->nmiMsg); + + result = osAfterPreNMI(); + if (result != 0) { + // Schedule another PRENMI500 message to be handled in 1ms + osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(1000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI500_MSG); + } + IrqMgr_CheckStacks(); +} + +#else + void IrqMgr_HandlePreNMI450(IrqMgr* irqMgr) { u64 nmi = IRQ_RESET_STATUS_NMI; // required to match @@ -194,7 +221,7 @@ void IrqMgr_HandlePreNMI450(IrqMgr* irqMgr) { irqMgr->resetStatus = IRQ_RESET_STATUS_NMI; // Schedule a PRENMI480 message to be handled in 30ms - osSetTimer(&irqMgr->timer, OS_MSEC_TO_CYCLES(30), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI480_MSG); + osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(30000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI480_MSG); // Send the NMI event to clients IrqMgr_SendMesgToClients(irqMgr, (OSMesg)&irqMgr->nmiMsg); } @@ -203,16 +230,15 @@ void IrqMgr_HandlePreNMI480(IrqMgr* irqMgr) { u32 result; // Schedule a PRENMI500 message to be handled in 20ms - osSetTimer(&irqMgr->timer, OS_MSEC_TO_CYCLES(20), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI500_MSG); + osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(20000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI500_MSG); result = osAfterPreNMI(); if (result != 0) { - // "osAfterPreNMI returned %d !?" - PRINTF("osAfterPreNMIが %d を返しました!?\n", result); + PRINTF(T("osAfterPreNMIが %d を返しました!?\n", "osAfterPreNMI returned %d !?\n"), result); // osAfterPreNMI failed, try again in 1ms //! @bug setting the same timer for a second time without letting the first one complete breaks //! the timer linked list - osSetTimer(&irqMgr->timer, OS_MSEC_TO_CYCLES(1), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI480_MSG); + osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(1000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI480_MSG); } } @@ -220,6 +246,8 @@ void IrqMgr_HandlePreNMI500(IrqMgr* irqMgr) { IrqMgr_CheckStacks(); } +#endif + /** * Runs on each vertical retrace * @@ -243,55 +271,59 @@ void IrqMgr_ThreadEntry(void* arg) { IrqMgr* irqMgr = (IrqMgr*)arg; u8 exit; - // "Start IRQ manager thread execution" - PRINTF("IRQマネージャスレッド実行開始\n"); + PRINTF(T("IRQマネージャスレッド実行開始\n", "Start IRQ manager thread execution\n")); exit = false; while (!exit) { osRecvMesg(&irqMgr->queue, (OSMesg*)&msg, OS_MESG_BLOCK); switch (msg) { +#if OOT_VERSION < PAL_1_0 + default: + break; +#endif + case IRQ_RETRACE_MSG: IrqMgr_HandleRetrace(irqMgr); break; case IRQ_PRENMI_MSG: PRINTF("PRE_NMI_MSG\n"); - // "Scheduler: Receives PRE_NMI message" - PRINTF("スケジューラ:PRE_NMIメッセージを受信\n"); + PRINTF(T("スケジューラ:PRE_NMIメッセージを受信\n", "Scheduler: Receives PRE_NMI message\n")); IrqMgr_HandlePreNMI(irqMgr); break; +#if OOT_VERSION >= PAL_1_0 case IRQ_PRENMI450_MSG: PRINTF("PRENMI450_MSG\n"); - // "Scheduler: Receives PRENMI450 message" - PRINTF("スケジューラ:PRENMI450メッセージを受信\n"); + PRINTF(T("スケジューラ:PRENMI450メッセージを受信\n", "Scheduler: Receives PRENMI450 message\n")); IrqMgr_HandlePreNMI450(irqMgr); break; case IRQ_PRENMI480_MSG: PRINTF("PRENMI480_MSG\n"); - // "Scheduler: Receives PRENMI480 message" - PRINTF("スケジューラ:PRENMI480メッセージを受信\n"); + PRINTF(T("スケジューラ:PRENMI480メッセージを受信\n", "Scheduler: Receives PRENMI480 message\n")); IrqMgr_HandlePreNMI480(irqMgr); break; +#endif case IRQ_PRENMI500_MSG: PRINTF("PRENMI500_MSG\n"); - // "Scheduler: Receives PRENMI500 message" - PRINTF("スケジューラ:PRENMI500メッセージを受信\n"); + PRINTF(T("スケジューラ:PRENMI500メッセージを受信\n", "Scheduler: Receives PRENMI500 message\n")); IrqMgr_HandlePreNMI500(irqMgr); exit = true; break; +#if OOT_VERSION >= PAL_1_0 default: - // "Unexpected message received" - PRINTF("irqmgr.c:予期しないメッセージを受け取りました(%08x)\n", msg); + PRINTF(T("irqmgr.c:予期しないメッセージを受け取りました(%08x)\n", + "irqmgr.c: Unexpected message received (%08x)\n"), + msg); break; +#endif } } - // "End of IRQ manager thread execution" - PRINTF("IRQマネージャスレッド実行終了\n"); + PRINTF(T("IRQマネージャスレッド実行終了\n", "End of IRQ manager thread execution\n")); } void IrqMgr_Init(IrqMgr* irqMgr, void* stack, OSPri pri, u8 retraceCount) { diff --git a/src/code/jpegdecoder.c b/src/code/jpegdecoder.c index c0c772abd6..a29752511c 100644 --- a/src/code/jpegdecoder.c +++ b/src/code/jpegdecoder.c @@ -1,5 +1,9 @@ #include "global.h" +s32 JpegDecoder_ProcessMcu(JpegHuffmanTable* hTable0, JpegHuffmanTable* hTable1, u16* mcu, s16* unk); +s32 JpegDecoder_ParseNextSymbol(JpegHuffmanTable* hTable, s16* outCoeff, s8* outZeroCount); +u16 JpegDecoder_ReadBits(u8 len); + u8* sJpegBitStreamPtr; u32 sJpegBitStreamByteIdx; u8 sJpegBitStreamBitIdx; diff --git a/src/code/kanread.s b/src/code/kanread.s index 8f35b713bd..a163f9ead7 100644 --- a/src/code/kanread.s +++ b/src/code/kanread.s @@ -23,7 +23,7 @@ * @param sjis Shift-JIS Codepoint of glyph. * @return s32 offset into `kanji` file. * - * @remark Original name: "LeoGetKadr" + * @remark Almost identical to "LeoGetKadr" from libleo. */ LEAF(Kanji_OffsetFromShiftJIS) // Characters with codepoints >= 0x8800 are kanji. Arrangement is regular, diff --git a/src/code/load.c b/src/code/load_gc.c similarity index 67% rename from src/code/load.c rename to src/code/load_gc.c index 27e687ff5a..39662cbcef 100644 --- a/src/code/load.c +++ b/src/code/load_gc.c @@ -8,16 +8,17 @@ size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, voi s32 size = vromEnd - vromStart; if (gOverlayLogSeverity >= 3) { - // "Start loading dynamic link function" - PRINTF("\nダイナミックリンクファンクションのロードを開始します\n"); + PRINTF( + T("\nダイナミックリンクファンクションのロードを開始します\n", "\nStart loading dynamic link function\n")); } size = vromEnd - vromStart; end = (uintptr_t)allocatedRamAddr + size; if (gOverlayLogSeverity >= 3) { - // "DMA transfer of TEXT, DATA, RODATA + rel (%08x-%08x)" - PRINTF("TEXT,DATA,RODATA+relをDMA転送します(%08x-%08x)\n", allocatedRamAddr, end); + PRINTF(T("TEXT,DATA,RODATA+relをDMA転送します(%08x-%08x)\n", + "DMA transfer of TEXT, DATA, RODATA + rel (%08x-%08x)\n"), + allocatedRamAddr, end); } // DMA the overlay, wait until transfer completes @@ -34,7 +35,7 @@ size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, voi } if (gOverlayLogSeverity >= 3) { - PRINTF("リロケーションします\n"); // "Relocate" + PRINTF(T("リロケーションします\n", "Relocate\n")); } // Relocate pointers in overlay code and data @@ -43,8 +44,8 @@ size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, voi // Clear bss if present, bss is located immediately following the relocations if (ovlRelocs->bssSize != 0) { if (gOverlayLogSeverity >= 3) { - // "Clear BSS area (% 08x-% 08x)" - PRINTF("BSS領域をクリアします(%08x-%08x)\n", end, end + ovlRelocs->bssSize); + PRINTF(T("BSS領域をクリアします(%08x-%08x)\n", "Clear BSS area (%08x-%08x)\n"), end, + end + ovlRelocs->bssSize); } bzero((void*)end, ovlRelocs->bssSize); } @@ -52,8 +53,8 @@ size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, voi size = (uintptr_t)(ovlRelocs->relocations + ovlRelocs->nRelocations) - (uintptr_t)ovlRelocs; if (gOverlayLogSeverity >= 3) { - // "Clear REL area (%08x-%08x)" - PRINTF("REL領域をクリアします(%08x-%08x)\n", ovlRelocs, (uintptr_t)ovlRelocs + size); + PRINTF(T("REL領域をクリアします(%08x-%08x)\n", "Clear REL area (%08x-%08x)\n"), ovlRelocs, + (uintptr_t)ovlRelocs + size); } // Clear relocations, this space remains allocated and goes unused @@ -65,8 +66,8 @@ size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, voi osInvalICache(allocatedRamAddr, size); if (gOverlayLogSeverity >= 3) { - // "Finish loading dynamic link function" - PRINTF("ダイナミックリンクファンクションのロードを終了します\n\n"); + PRINTF( + T("ダイナミックリンクファンクションのロードを終了します\n\n", "Finish loading dynamic link function\n\n")); } return size; diff --git a/src/code/loadfragment2.c b/src/code/loadfragment2_gc.c similarity index 100% rename from src/code/loadfragment2.c rename to src/code/loadfragment2_gc.c diff --git a/src/code/loadfragment2_n64.c b/src/code/loadfragment2_n64.c new file mode 100644 index 0000000000..6a06b1ba09 --- /dev/null +++ b/src/code/loadfragment2_n64.c @@ -0,0 +1,209 @@ +/** + * @file loadfragment2_n64.c + * + * This file contains the routine responsible for runtime relocation of dynamically loadable code segments (overlays), + * see the description of Overlay_Relocate for details. + * + * @see Overlay_Relocate + */ +#include "global.h" + +s32 gOverlayLogSeverity = 2; + +// Extract MIPS register rs from an instruction word +#define MIPS_REG_RS(insn) (((insn) >> 0x15) & 0x1F) + +// Extract MIPS register rt from an instruction word +#define MIPS_REG_RT(insn) (((insn) >> 0x10) & 0x1F) + +// Extract MIPS jump target from an instruction word +#define MIPS_JUMP_TARGET(insn) (((insn)&0x03FFFFFF) << 2) + +/** + * Performs runtime relocation of overlay files, loadable code segments. + * + * Overlays are expected to be loadable anywhere in direct-mapped cached (KSEG0) memory, with some appropriate + * alignment requirements; memory addresses in such code must be updated once loaded to execute properly. + * When compiled, overlays are given 'fake' KSEG0 RAM addresses larger than the total possible available main memory + * (>= 0x80800000), such addresses are referred to as Virtual RAM (VRAM) to distinguish them. When loading the overlay, + * the relocation table produced at compile time is consulted to determine where and how to update these VRAM addresses + * to correct RAM addresses based on the location the overlay was loaded at, enabling the code to execute at this + * address as if it were compiled to run at this address. + * + * Each relocation is represented by a packed 32-bit value, formatted in the following way: + * - [31:30] 2-bit section id, taking values from the `RelocSectionId` enum. + * - [29:24] 6-bit relocation type describing which relocation operation should be performed. Same as ELF32 MIPS. + * - [23: 0] 24-bit section-relative offset indicating where in the section to apply this relocation. + * + * @param allocatedRamAddress Memory address the binary was loaded at. + * @param ovlRelocs Overlay relocation section containing overlay section layout and runtime relocations. + * @param vramStart Virtual RAM address that the overlay was compiled at. + */ +void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlRelocs, void* vramStart) { + u32 sections[RELOC_SECTION_MAX]; + u32* relocDataP; + u32 reloc; + uintptr_t relocatedAddress; + u32 i; + u32* luiInstRef; + u32 isLoNeg; + u32* regValP; + //! MIPS ELF relocation does not generally require tracking register values, so at first glance it appears this + //! register tracking was an unnecessary complication. However there is a bug in the IDO compiler that can cause + //! relocations to be emitted in the wrong order under rare circumstances when the compiler attempts to reuse a + //! previous HI16 relocation for a different LO16 relocation as an optimization. This register tracking is likely + //! a workaround to prevent improper matching of unrelated HI16 and LO16 relocations that would otherwise arise + //! due to the incorrect ordering. + u32* luiRefs[32]; + u32 luiVals[32]; + uintptr_t allocu32 = (uintptr_t)allocatedRamAddr; + uintptr_t vramu32 = (uintptr_t)vramStart; + + if (gOverlayLogSeverity >= 3) { + osSyncPrintf("DoRelocation(%08x, %08x, %08x)\n", allocatedRamAddr, ovlRelocs, vramStart); + } + + sections[RELOC_SECTION_NULL] = 0; + sections[RELOC_SECTION_TEXT] = allocu32; + sections[RELOC_SECTION_DATA] = allocu32 + ovlRelocs->textSize; + sections[RELOC_SECTION_RODATA] = sections[RELOC_SECTION_DATA] + ovlRelocs->dataSize; + + for (i = 0; i < ovlRelocs->nRelocations; i++) { + // This will always resolve to a 32-bit aligned address as each section + // containing code or pointers must be aligned to at least 4 bytes and the + // MIPS ABI defines the offset of both 16-bit and 32-bit relocations to be + // the start of the 32-bit word containing the target. + reloc = ovlRelocs->relocations[i]; + relocDataP = (u32*)(sections[RELOC_SECTION(reloc)] + RELOC_OFFSET(reloc)); + + switch (RELOC_TYPE_MASK(reloc)) { + case R_MIPS_32 << RELOC_TYPE_SHIFT: + // Handles 32-bit address relocation, used for things such as jump tables and pointers in data. + // Just relocate the full address + + // Check address is valid for relocation + if ((*relocDataP & 0x0F000000) == 0) { + *relocDataP = *relocDataP - vramu32 + allocu32; + } else if (gOverlayLogSeverity >= 3) { + osSyncPrintf(T("セグメントポインタ32です %08x\n", "Segment pointer 32 %08x\n"), + *relocDataP - vramu32); + } + break; + + case R_MIPS_26 << RELOC_TYPE_SHIFT: + // Handles 26-bit address relocation, used for jumps and jals. + // Extract the address from the target field of the J-type MIPS instruction. + // Relocate the address and update the instruction. + + if (1) { + *relocDataP = + (*relocDataP & 0xFC000000) | + (((PHYS_TO_K0(MIPS_JUMP_TARGET(*relocDataP)) - vramu32 + allocu32) & 0x0FFFFFFF) >> 2); + } else if (gOverlayLogSeverity >= 3) { + osSyncPrintf(T("セグメントポインタ26です %08x\n", "Segment pointer 26 %08x\n"), + PHYS_TO_K0(MIPS_JUMP_TARGET(*relocDataP)) - vramu32); + } + break; + + case R_MIPS_HI16 << RELOC_TYPE_SHIFT: + // Handles relocation for a hi/lo pair, part 1. + // Store the reference to the LUI instruction (hi) using the `rt` register of the instruction. + // This will be updated later in the `R_MIPS_LO16` section. + + luiRefs[(*relocDataP >> 0x10) & 0x1F] = relocDataP; + luiVals[(*relocDataP >> 0x10) & 0x1F] = *relocDataP; + break; + + case R_MIPS_LO16 << RELOC_TYPE_SHIFT: + // Handles relocation for a hi/lo pair, part 2. + // Grab the stored LUI (hi) from the `R_MIPS_HI16` section using the `rs` register of the instruction. + // The full address is calculated, relocated, and then used to update both the LUI and lo instructions. + // If the lo part is negative, add 1 to the LUI value. + // Note: The lo instruction is assumed to have a signed immediate. + + luiInstRef = luiRefs[(*relocDataP >> 0x15) & 0x1F]; + regValP = &luiVals[(*relocDataP >> 0x15) & 0x1F]; + + // Check address is valid for relocation + if ((((*luiInstRef << 0x10) + (s16)*relocDataP) & 0x0F000000) == 0) { + relocatedAddress = ((*regValP << 0x10) + (s16)*relocDataP) - vramu32 + allocu32; + isLoNeg = (relocatedAddress & 0x8000) ? 1 : 0; + *luiInstRef = (*luiInstRef & 0xFFFF0000) | (((relocatedAddress >> 0x10) & 0xFFFF) + isLoNeg); + *relocDataP = (*relocDataP & 0xFFFF0000) | (relocatedAddress & 0xFFFF); + } else if (gOverlayLogSeverity >= 3) { + osSyncPrintf(T("セグメントポインタ16です %08x %08x %08x\n", "Segment pointer 16 %08x %08x %08x\n"), + ((*luiInstRef << 0x10) + (s16)*relocDataP) - vramu32, *luiInstRef, *relocDataP); + } + break; + } + } +} + +size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr) { + s32 pad[2]; + s32 size = vromEnd - vromStart; + uintptr_t end; + OverlayRelocationSection* ovlRelocs; + + if (gOverlayLogSeverity >= 3) { + osSyncPrintf( + T("\nダイナミックリンクファンクションのロードを開始します\n", "\nStart loading dynamic link function\n")); + } + + size = vromEnd - vromStart; + end = (uintptr_t)allocatedRamAddr + size; + + if (gOverlayLogSeverity >= 3) { + osSyncPrintf(T("TEXT,DATA,RODATA+relをDMA転送します(%08x-%08x)\n", + "DMA transfer TEXT, DATA, RODATA+rel (%08x-%08x)\n"), + allocatedRamAddr, end); + } + + DmaMgr_RequestSync(allocatedRamAddr, vromStart, size); + + // The overlay file is expected to contain a 32-bit offset from the end of the file to the start of the + // relocation section. + ovlRelocs = (OverlayRelocationSection*)(end - ((s32*)end)[-1]); + + if (gOverlayLogSeverity >= 3) { + osSyncPrintf("TEXT(%08x), DATA(%08x), RODATA(%08x), BSS(%08x)\n", ovlRelocs->textSize, ovlRelocs->dataSize, + ovlRelocs->rodataSize, (s32)ovlRelocs->bssSize); + } + + if (gOverlayLogSeverity >= 3) { + osSyncPrintf(T("リロケーションします\n", "I will relocate\n")); + } + + Overlay_Relocate(allocatedRamAddr, ovlRelocs, vramStart); + + // Casts suggest bssSize struct variable was an s32, but needs to be a u32 for the GC versions + if ((s32)ovlRelocs->bssSize != 0) { + if (gOverlayLogSeverity >= 3) { + osSyncPrintf(T("BSS領域をクリアします(%08x-%08x)\n", "Clear BSS area (%08x-%08x)\n"), end, + end + (s32)ovlRelocs->bssSize); + } + bzero((void*)end, (s32)ovlRelocs->bssSize); + } + + size = (uintptr_t)vramEnd - (uintptr_t)vramStart; + + osWritebackDCache(allocatedRamAddr, size); + osInvalICache(allocatedRamAddr, size); + + if (gOverlayLogSeverity >= 3) { + osSyncPrintf(T("ダイナミックリンクファンクションのロードを終了します\n\n", + "Finish loading the dynamic link function\n\n")); + } + + return size; +} + +void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd) { + void* allocatedRamAddr = SYSTEM_ARENA_MALLOC_R((intptr_t)vramEnd - (intptr_t)vramStart, "../loadfragment2.c", 31); + + if (allocatedRamAddr != NULL) { + Overlay_Load(vromStart, vromEnd, vramStart, vramEnd, allocatedRamAddr); + } + + return allocatedRamAddr; +} diff --git a/src/code/logseverity.c b/src/code/logseverity_gc.c similarity index 100% rename from src/code/logseverity.c rename to src/code/logseverity_gc.c diff --git a/src/code/main.c b/src/code/main.c index 61756b8424..c2ef9d893e 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -1,5 +1,30 @@ +#include "ultra64.h" +#include "versions.h" + +// Declared before including other headers for BSS ordering +extern uintptr_t gSegments[NUM_SEGMENTS]; + +#pragma increment_block_number "gc-eu:252 gc-eu-mq:252 gc-jp:252 gc-jp-ce:252 gc-jp-mq:252 gc-us:252 gc-us-mq:252" \ + "ntsc-1.2:128 pal-1.0:128 pal-1.1:128" + +extern struct PreNmiBuff* gAppNmiBufferPtr; +extern struct Scheduler gScheduler; +extern struct PadMgr gPadMgr; +extern struct IrqMgr gIrqMgr; + #include "global.h" +#include "fault.h" +#include "segmented_address.h" +#include "stack.h" #include "terminal.h" +#include "versions.h" +#if PLATFORM_N64 +#include "cic6105.h" +#include "n64dd.h" +#endif + +#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160 gc-us-mq:160" \ + "ntsc-1.2:151 pal-1.0:149 pal-1.1:149" extern u8 _buffersSegmentEnd[]; @@ -7,18 +32,19 @@ s32 gScreenWidth = SCREEN_WIDTH; s32 gScreenHeight = SCREEN_HEIGHT; u32 gSystemHeapSize = 0; -// For retail BSS ordering, the block number of gIrqMgr must be greater than the -// the block numbers assigned to extern variables above (declared in variables.h). -#pragma increment_block_number 220 - PreNmiBuff* gAppNmiBufferPtr; Scheduler gScheduler; PadMgr gPadMgr; IrqMgr gIrqMgr; uintptr_t gSegments[NUM_SEGMENTS]; + OSThread sGraphThread; STACK(sGraphStack, 0x1800); +#if OOT_VERSION < PAL_1_0 +STACK(sSchedStack, 0x400); +#else STACK(sSchedStack, 0x600); +#endif STACK(sAudioStack, 0x800); STACK(sPadMgrStack, 0x500); STACK(sIrqMgrStack, 0x500); @@ -27,7 +53,7 @@ StackEntry sSchedStackInfo; StackEntry sAudioStackInfo; StackEntry sPadMgrStackInfo; StackEntry sIrqMgrStackInfo; -AudioMgr gAudioMgr; +AudioMgr sAudioMgr; OSMesgQueue sSerialEventQueue; OSMesg sSerialMsgBuf[1]; @@ -42,9 +68,9 @@ u8 gRDPTimingsExist; #if IS_DEBUG void Main_LogSystemHeap(void) { PRINTF(VT_FGCOL(GREEN)); - // "System heap size% 08x (% dKB) Start address% 08x" - PRINTF("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", gSystemHeapSize, gSystemHeapSize / 1024, - _buffersSegmentEnd); + PRINTF( + T("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", "System heap size %08x (%dKB) Start address %08x\n"), + gSystemHeapSize, gSystemHeapSize / 1024, _buffersSegmentEnd); PRINTF(VT_RST); } #endif @@ -56,19 +82,31 @@ void Main(void* arg) { uintptr_t systemHeapStart; uintptr_t fb; - PRINTF("mainproc 実行開始\n"); // "Start running" + PRINTF(T("mainproc 実行開始\n", "mainproc Start running\n")); IO_WRITE(DPC_STATUS_REG, DPC_CLR_CLOCK_CTR); gScreenWidth = SCREEN_WIDTH; gScreenHeight = SCREEN_HEIGHT; gAppNmiBufferPtr = (PreNmiBuff*)osAppNMIBuffer; PreNmiBuff_Init(gAppNmiBufferPtr); Fault_Init(); +#if PLATFORM_N64 + func_800AD410(); + if (D_80121211 != 0) { + systemHeapStart = (uintptr_t)_n64ddSegmentEnd; + SysCfb_Init(1); + } else { + func_800AD488(); + systemHeapStart = (uintptr_t)_buffersSegmentEnd; + SysCfb_Init(0); + } +#else SysCfb_Init(0); systemHeapStart = (uintptr_t)_buffersSegmentEnd; +#endif fb = (uintptr_t)SysCfb_GetFbPtr(0); gSystemHeapSize = fb - systemHeapStart; - // "System heap initalization" - PRINTF("システムヒープ初期化 %08x-%08x %08x\n", systemHeapStart, fb, gSystemHeapSize); + PRINTF(T("システムヒープ初期化 %08x-%08x %08x\n", "System heap initialization %08x-%08x %08x\n"), systemHeapStart, + fb, gSystemHeapSize); SystemHeap_Init((void*)systemHeapStart, gSystemHeapSize); // initializes the system heap if (IS_DEBUG_HEAP_ENABLED) { @@ -105,24 +143,32 @@ void Main(void* arg) { StackCheck_Init(&sIrqMgrStackInfo, sIrqMgrStack, STACK_TOP(sIrqMgrStack), 0, 0x100, "irqmgr"); IrqMgr_Init(&gIrqMgr, STACK_TOP(sIrqMgrStack), THREAD_PRI_IRQMGR, 1); - PRINTF("タスクスケジューラの初期化\n"); // "Initialize the task scheduler" + PRINTF(T("タスクスケジューラの初期化\n", "Initialize the task scheduler\n")); StackCheck_Init(&sSchedStackInfo, sSchedStack, STACK_TOP(sSchedStack), 0, 0x100, "sched"); Sched_Init(&gScheduler, STACK_TOP(sSchedStack), THREAD_PRI_SCHED, gViConfigModeType, 1, &gIrqMgr); +#if PLATFORM_N64 + CIC6105_AddFaultClient(); + func_80001640(); +#endif + IrqMgr_AddClient(&gIrqMgr, &irqClient, &irqMgrMsgQueue); StackCheck_Init(&sAudioStackInfo, sAudioStack, STACK_TOP(sAudioStack), 0, 0x100, "audio"); - AudioMgr_Init(&gAudioMgr, STACK_TOP(sAudioStack), THREAD_PRI_AUDIOMGR, THREAD_ID_AUDIOMGR, &gScheduler, &gIrqMgr); + AudioMgr_Init(&sAudioMgr, STACK_TOP(sAudioStack), THREAD_PRI_AUDIOMGR, THREAD_ID_AUDIOMGR, &gScheduler, &gIrqMgr); StackCheck_Init(&sPadMgrStackInfo, sPadMgrStack, STACK_TOP(sPadMgrStack), 0, 0x100, "padmgr"); PadMgr_Init(&gPadMgr, &sSerialEventQueue, &gIrqMgr, THREAD_ID_PADMGR, THREAD_PRI_PADMGR, STACK_TOP(sPadMgrStack)); - AudioMgr_WaitForInit(&gAudioMgr); + AudioMgr_WaitForInit(&sAudioMgr); StackCheck_Init(&sGraphStackInfo, sGraphStack, STACK_TOP(sGraphStack), 0, 0x100, "graph"); osCreateThread(&sGraphThread, THREAD_ID_GRAPH, Graph_ThreadEntry, arg, STACK_TOP(sGraphStack), THREAD_PRI_GRAPH); osStartThread(&sGraphThread); + +#if OOT_VERSION >= PAL_1_0 osSetThreadPri(NULL, THREAD_PRI_MAIN); +#endif while (true) { s16* msg = NULL; @@ -131,14 +177,22 @@ void Main(void* arg) { if (msg == NULL) { break; } - if (*msg == OS_SC_PRE_NMI_MSG) { - PRINTF("main.c: リセットされたみたいだよ\n"); // "Looks like it's been reset" - PreNmiBuff_SetReset(gAppNmiBufferPtr); + switch (*msg) { + case OS_SC_PRE_NMI_MSG: + PRINTF(T("main.c: リセットされたみたいだよ\n", "main.c: Looks like it's been reset\n")); +#if OOT_VERSION < PAL_1_0 + StackCheck_Check(NULL); +#endif + PreNmiBuff_SetReset(gAppNmiBufferPtr); + break; } } - PRINTF("mainproc 後始末\n"); // "Cleanup" + PRINTF(T("mainproc 後始末\n", "mainproc Cleanup\n")); osDestroyThread(&sGraphThread); RcpUtils_Reset(); - PRINTF("mainproc 実行終了\n"); // "End of execution" +#if PLATFORM_N64 + CIC6105_RemoveFaultClient(); +#endif + PRINTF(T("mainproc 実行終了\n", "mainproc End of execution\n")); } diff --git a/src/code/mtxuty-cvt.c b/src/code/mtxuty-cvt.c index 1cad0f9091..10f88f7827 100644 --- a/src/code/mtxuty-cvt.c +++ b/src/code/mtxuty-cvt.c @@ -20,5 +20,5 @@ void MtxConv_F2L(Mtx* m1, MtxF* m2) { void MtxConv_L2F(MtxF* m1, Mtx* m2) { LOG_UTILS_CHECK_NULL_POINTER("m1", m1, "../mtxuty-cvt.c", 55); LOG_UTILS_CHECK_NULL_POINTER("m2", m2, "../mtxuty-cvt.c", 56); - guMtxL2F(m1, m2); + guMtxL2F(m1->mf, m2); } diff --git a/src/code/padmgr.c b/src/code/padmgr.c index 94b51b3d13..ecd246033e 100644 --- a/src/code/padmgr.c +++ b/src/code/padmgr.c @@ -29,15 +29,15 @@ * done while waiting for this operation to complete. */ #include "global.h" +#include "fault.h" #include "terminal.h" -#define PADMGR_LOG(controllerNum, msg) \ - if (IS_DEBUG) { \ - PRINTF(VT_FGCOL(YELLOW)); \ - /* padmgr: Controller %d: %s */ \ - PRINTF("padmgr: %dコン: %s\n", (controllerNum) + 1, (msg)); \ - PRINTF(VT_RST); \ - } \ +#define PADMGR_LOG(controllerNum, msg) \ + if (IS_DEBUG) { \ + PRINTF(VT_FGCOL(YELLOW)); \ + PRINTF(T("padmgr: %dコン: %s\n", "padmgr: Controller %d: %s\n"), (controllerNum) + 1, (msg)); \ + PRINTF(VT_RST); \ + } \ (void)0 #define LOG_SEVERITY_NOLOG 0 @@ -73,17 +73,18 @@ OSMesgQueue* PadMgr_AcquireSerialEventQueue(PadMgr* padMgr) { #endif if (gPadMgrLogSeverity >= LOG_SEVERITY_VERBOSE) { - // "serialMsgQ Waiting for lock" - PRINTF("%2d %d serialMsgQロック待ち %08x %08x %08x\n", osGetThreadId(NULL), - MQ_GET_COUNT(&padMgr->serialLockQueue), padMgr, &padMgr->serialLockQueue, &serialEventQueue); + PRINTF(T("%2d %d serialMsgQロック待ち %08x %08x %08x\n", + "%2d %d serialMsgQ Waiting for lock %08x %08x %08x\n"), + osGetThreadId(NULL), MQ_GET_COUNT(&padMgr->serialLockQueue), padMgr, &padMgr->serialLockQueue, + &serialEventQueue); } osRecvMesg(&padMgr->serialLockQueue, (OSMesg*)&serialEventQueue, OS_MESG_BLOCK); if (gPadMgrLogSeverity >= LOG_SEVERITY_VERBOSE) { - // "serialMsgQ Locked" - PRINTF("%2d %d serialMsgQをロックしました %08x\n", osGetThreadId(NULL), - MQ_GET_COUNT(&padMgr->serialLockQueue), serialEventQueue); + PRINTF(T("%2d %d serialMsgQをロックしました %08x\n", + "%2d %d serialMsgQ Locked %08x\n"), + osGetThreadId(NULL), MQ_GET_COUNT(&padMgr->serialLockQueue), serialEventQueue); } return serialEventQueue; @@ -98,17 +99,17 @@ OSMesgQueue* PadMgr_AcquireSerialEventQueue(PadMgr* padMgr) { */ void PadMgr_ReleaseSerialEventQueue(PadMgr* padMgr, OSMesgQueue* serialEventQueue) { if (gPadMgrLogSeverity >= LOG_SEVERITY_VERBOSE) { - // "serialMsgQ Unlock" - PRINTF("%2d %d serialMsgQロック解除します %08x %08x %08x\n", osGetThreadId(NULL), - MQ_GET_COUNT(&padMgr->serialLockQueue), padMgr, &padMgr->serialLockQueue, serialEventQueue); + PRINTF(T("%2d %d serialMsgQロック解除します %08x %08x %08x\n", "%2d %d serialMsgQ Unlock %08x %08x %08x\n"), + osGetThreadId(NULL), MQ_GET_COUNT(&padMgr->serialLockQueue), padMgr, &padMgr->serialLockQueue, + serialEventQueue); } osSendMesg(&padMgr->serialLockQueue, (OSMesg)serialEventQueue, OS_MESG_BLOCK); if (gPadMgrLogSeverity >= LOG_SEVERITY_VERBOSE) { - // "serialMsgQ Unlocked" - PRINTF("%2d %d serialMsgQロック解除しました %08x %08x %08x\n", osGetThreadId(NULL), - MQ_GET_COUNT(&padMgr->serialLockQueue), padMgr, &padMgr->serialLockQueue, serialEventQueue); + PRINTF(T("%2d %d serialMsgQロック解除しました %08x %08x %08x\n", "%2d %d serialMsgQ Unlocked %08x %08x %08x\n"), + osGetThreadId(NULL), MQ_GET_COUNT(&padMgr->serialLockQueue), padMgr, &padMgr->serialLockQueue, + serialEventQueue); } } @@ -151,14 +152,13 @@ void PadMgr_UpdateRumble(PadMgr* padMgr) { if (padMgr->pakType[i] == CONT_PAK_RUMBLE) { if (padMgr->rumbleEnable[i]) { if (padMgr->rumbleTimer[i] < 3) { - // "Rumble pack brrr" - PADMGR_LOG(i, "振動パック ぶるぶるぶるぶる"); + PADMGR_LOG(i, T("振動パック ぶるぶるぶるぶる", "Rumble pak brrr")); if (osMotorStart(&padMgr->rumblePfs[i]) != 0) { padMgr->pakType[i] = CONT_PAK_NONE; - // "A communication error has occurred with the vibration pack" - PADMGR_LOG(i, "振動パックで通信エラーが発生しました"); + PADMGR_LOG(i, T("振動パックで通信エラーが発生しました", + "A communication error has occurred with the rumble pak")); } else { padMgr->rumbleTimer[i] = 3; } @@ -167,14 +167,13 @@ void PadMgr_UpdateRumble(PadMgr* padMgr) { } } else { if (padMgr->rumbleTimer[i] != 0) { - // "Stop vibration pack" - PADMGR_LOG(i, "振動パック 停止"); + PADMGR_LOG(i, T("振動パック 停止", "Stop rumble pak")); if (osMotorStop(&padMgr->rumblePfs[i]) != 0) { padMgr->pakType[i] = CONT_PAK_NONE; - // "A communication error has occurred with the vibration pack" - PADMGR_LOG(i, "振動パックで通信エラーが発生しました"); + PADMGR_LOG(i, T("振動パックで通信エラーが発生しました", + "A communication error has occurred with the rumble pak")); } else { padMgr->rumbleTimer[i]--; } @@ -186,12 +185,11 @@ void PadMgr_UpdateRumble(PadMgr* padMgr) { } else { if (padMgr->pakType[i] != CONT_PAK_NONE) { if (padMgr->pakType[i] == CONT_PAK_RUMBLE || !IS_DEBUG) { - // "It seems that a vibration pack was pulled out" - PADMGR_LOG(i, "振動パックが抜かれたようです"); + PADMGR_LOG(i, T("振動パックが抜かれたようです", "It seems that a rumble pak was pulled out")); padMgr->pakType[i] = CONT_PAK_NONE; } else { - // "It seems that a controller pack that is not a vibration pack was pulled out" - PADMGR_LOG(i, "振動パックではないコントローラパックが抜かれたようです"); + PADMGR_LOG(i, T("振動パックではないコントローラパックが抜かれたようです", + "It seems that a controller pak that is not a rumble pak was pulled out")); padMgr->pakType[i] = CONT_PAK_NONE; } } @@ -213,15 +211,13 @@ void PadMgr_UpdateRumble(PadMgr* padMgr) { osMotorStart(&padMgr->rumblePfs[i]); osMotorStop(&padMgr->rumblePfs[i]); - // "Recognized vibration pack" - PADMGR_LOG(i, "振動パックを認識しました"); + PADMGR_LOG(i, T("振動パックを認識しました", "Recognized rumble pak")); } else if (ret == PFS_ERR_DEVICE) { padMgr->pakType[i] = CONT_PAK_OTHER; } else if (ret == PFS_ERR_CONTRFAIL) { LOG_NUM("++errcnt", ++sRumbleErrorCount, "../padmgr.c", 282); - // "Controller pack communication error" - PADMGR_LOG(i, "コントローラパックの通信エラー"); + PADMGR_LOG(i, T("コントローラパックの通信エラー", "Controller pak communication error")); } } } @@ -241,9 +237,8 @@ void PadMgr_RumbleStop(PadMgr* padMgr) { if (osMotorInit(serialEventQueue, &padMgr->rumblePfs[i], i) == 0) { // If there is a rumble pak attached to this controller, stop it - if (gFaultMgr.msgId == 0 && padMgr->rumbleOnTimer != 0) { - // "Stop rumble pak" - PADMGR_LOG(i, "振動パック 停止"); + if (!FAULT_MSG_ID && padMgr->rumbleOnTimer != 0) { + PADMGR_LOG(i, T("振動パック 停止", "Stop rumble pak")); } osMotorStop(&padMgr->rumblePfs[i]); } @@ -305,16 +300,14 @@ void PadMgr_UpdateInputs(PadMgr* padMgr) { input->cur = *pad; if (!padMgr->ctrlrIsConnected[i]) { padMgr->ctrlrIsConnected[i] = true; - // "Recognized" - PADMGR_LOG(i, "認識しました"); + PADMGR_LOG(i, T("認識しました", "Recognized")); } break; case (CHNL_ERR_OVERRUN >> 4): // Overrun error, reuse previous inputs input->cur = input->prev; LOG_NUM("this->Key_switch[i]", padMgr->ctrlrIsConnected[i], "../padmgr.c", 380); - // "Overrun error occurred" - PADMGR_LOG(i, "オーバーランエラーが発生"); + PADMGR_LOG(i, T("オーバーランエラーが発生", "Overrun error occurred")); break; case (CHNL_ERR_NORESP >> 4): // No response error, take inputs as 0 @@ -327,14 +320,19 @@ void PadMgr_UpdateInputs(PadMgr* padMgr) { padMgr->ctrlrIsConnected[i] = false; padMgr->pakType[i] = CONT_PAK_NONE; padMgr->rumbleTimer[i] = UINT8_MAX; - // "Not responding" - PADMGR_LOG(i, "応答しません"); + PADMGR_LOG(i, T("応答しません", "Not responding")); } break; default: // Unknown error response LOG_HEX("padnow1->errno", pad->errno, "../padmgr.c", 396); +#if OOT_VERSION < NTSC_1_1 + Fault_AddHungupAndCrash("../padmgr.c", 379); +#elif OOT_VERSION < GC_JP + Fault_AddHungupAndCrash("../padmgr.c", 382); +#else Fault_AddHungupAndCrash("../padmgr.c", 397); +#endif break; } @@ -352,8 +350,6 @@ void PadMgr_UpdateInputs(PadMgr* padMgr) { void PadMgr_HandleRetrace(PadMgr* padMgr) { OSMesgQueue* serialEventQueue = PadMgr_AcquireSerialEventQueue(padMgr); - u32 mask; - s32 i; // Begin reading controller data osContStartReadData(serialEventQueue); @@ -388,23 +384,27 @@ void PadMgr_HandleRetrace(PadMgr* padMgr) { PadMgr_ReleaseSerialEventQueue(padMgr, serialEventQueue); - // Update the state of connected controllers - mask = 0; - for (i = 0; i < MAXCONTROLLERS; i++) { - if (padMgr->padStatus[i].errno == 0) { - // Only standard N64 controllers are supported - if (padMgr->padStatus[i].type == CONT_TYPE_NORMAL) { - mask |= 1 << i; - } else { - LOG_HEX("this->pad_status[i].type", padMgr->padStatus[i].type, "../padmgr.c", 458); - // "An unknown type of controller is connected" - PRINTF("知らない種類のコントローラが接続されています\n"); + { + u32 mask = 0; + s32 i; + + // Update the state of connected controllers + for (i = 0; i < MAXCONTROLLERS; i++) { + if (padMgr->padStatus[i].errno == 0) { + // Only standard N64 controllers are supported + if (padMgr->padStatus[i].type == CONT_TYPE_NORMAL) { + mask |= 1 << i; + } else { + LOG_HEX("this->pad_status[i].type", padMgr->padStatus[i].type, "../padmgr.c", 458); + PRINTF(T("知らない種類のコントローラが接続されています\n", + "An unknown type of controller is connected\n")); + } } } + padMgr->validCtrlrsMask = mask; } - padMgr->validCtrlrsMask = mask; - if (gFaultMgr.msgId != 0) { + if (FAULT_MSG_ID != 0) { // If fault is active, no rumble PadMgr_RumbleStop(padMgr); } else if (padMgr->rumbleOffTimer > 0) { @@ -472,13 +472,13 @@ void PadMgr_ThreadEntry(PadMgr* padMgr) { s16* msg = NULL; s32 exit; - PRINTF("コントローラスレッド実行開始\n"); // "Controller thread execution start" + PRINTF(T("コントローラスレッド実行開始\n", "Controller thread execution start")); exit = false; while (!exit) { if (gPadMgrLogSeverity >= LOG_SEVERITY_VERBOSE && MQ_IS_EMPTY(&padMgr->interruptQueue)) { - // "Waiting for controller thread event" - PRINTF("コントローラスレッドイベント待ち %lld\n", OS_CYCLES_TO_USEC(osGetTime())); + PRINTF(T("コントローラスレッドイベント待ち %lld\n", "Waiting for controller thread event %lld\n"), + OS_CYCLES_TO_USEC(osGetTime())); } osRecvMesg(&padMgr->interruptQueue, (OSMesg*)&msg, OS_MESG_BLOCK); @@ -507,11 +507,11 @@ void PadMgr_ThreadEntry(PadMgr* padMgr) { IrqMgr_RemoveClient(padMgr->irqMgr, &padMgr->irqClient); - PRINTF("コントローラスレッド実行終了\n"); // "Controller thread execution end" + PRINTF(T("コントローラスレッド実行終了\n", "Controller thread execution end\n")); } void PadMgr_Init(PadMgr* padMgr, OSMesgQueue* serialEventQueue, IrqMgr* irqMgr, OSId id, OSPri priority, void* stack) { - PRINTF("パッドマネージャ作成 padmgr_Create()\n"); // "Pad Manager creation" + PRINTF(T("パッドマネージャ作成 padmgr_Create()\n", "Pad Manager creation padmgr_Create()\n")); bzero(padMgr, sizeof(PadMgr)); padMgr->irqMgr = irqMgr; diff --git a/src/code/padutils.c b/src/code/padutils.c index 2f0f571620..7a0407ef96 100644 --- a/src/code/padutils.c +++ b/src/code/padutils.c @@ -9,6 +9,10 @@ void func_800FCB70(void) { void PadUtils_ResetPressRel(Input* input) { input->press.button = 0; +#if PLATFORM_N64 + input->press.stick_x = 0; + input->press.stick_y = 0; +#endif input->rel.button = 0; } @@ -65,6 +69,16 @@ s8 PadUtils_GetRelY(Input* input) { return PadUtils_GetRelYImpl(input); } +#if PLATFORM_N64 +s8 PadUtils_GetPressX(Input* input) { + return input->press.stick_x; +} + +s8 PadUtils_GetPressY(Input* input) { + return input->press.stick_y; +} +#endif + void PadUtils_UpdateRelXY(Input* input) { s32 curX = PadUtils_GetCurX(input); s32 curY = PadUtils_GetCurY(input); diff --git a/src/code/rcp_utils.c b/src/code/rcp_utils.c index f017b53e3f..574a1a5df8 100644 --- a/src/code/rcp_utils.c +++ b/src/code/rcp_utils.c @@ -1,18 +1,26 @@ #include "global.h" +#if PLATFORM_N64 || OOT_DEBUG +#define RCP_UTILS_PRINTF osSyncPrintf +#elif IDO_PRINTF_WORKAROUND +#define RCP_UTILS_PRINTF(args) (void)0 +#else +#define RCP_UTILS_PRINTF(format, ...) (void)0 +#endif + #define printSpStatus(x, name) \ if (x & SP_STATUS_##name) \ - PRINTF(#name " ") + RCP_UTILS_PRINTF(#name " ") #define printDpStatus(x, name) \ if (x & DPC_STATUS_##name) \ - PRINTF(#name " ") + RCP_UTILS_PRINTF(#name " ") void RcpUtils_PrintRegisterStatus(void) { u32 spStatus = __osSpGetStatus(); u32 dpStatus = osDpGetStatus(); - PRINTF("osSpGetStatus=%08x: ", spStatus); + RCP_UTILS_PRINTF("osSpGetStatus=%08x: ", spStatus); printSpStatus(spStatus, HALT); printSpStatus(spStatus, BROKE); printSpStatus(spStatus, DMA_BUSY); @@ -28,9 +36,9 @@ void RcpUtils_PrintRegisterStatus(void) { printSpStatus(spStatus, SIG5); printSpStatus(spStatus, SIG6); printSpStatus(spStatus, SIG7); - PRINTF("\n"); + RCP_UTILS_PRINTF("\n"); - PRINTF("osDpGetStatus=%08x:", dpStatus); + RCP_UTILS_PRINTF("osDpGetStatus=%08x:", dpStatus); printDpStatus(dpStatus, XBUS_DMEM_DMA); printDpStatus(dpStatus, FREEZE); printDpStatus(dpStatus, FLUSH); @@ -42,7 +50,7 @@ void RcpUtils_PrintRegisterStatus(void) { printDpStatus(dpStatus, DMA_BUSY); printDpStatus(dpStatus, END_VALID); printDpStatus(dpStatus, START_VALID); - PRINTF("\n"); + RCP_UTILS_PRINTF("\n"); } void RcpUtils_Reset(void) { diff --git a/src/code/relocation.c b/src/code/relocation_gc.c similarity index 97% rename from src/code/relocation.c rename to src/code/relocation_gc.c index eedba8dcdc..f178121c19 100644 --- a/src/code/relocation.c +++ b/src/code/relocation_gc.c @@ -60,7 +60,7 @@ void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlReloc u32 relocatedValue = 0; uintptr_t unrelocatedAddress = 0; uintptr_t relocatedAddress = 0; - s32 pad; + uintptr_t vramu32 = (uintptr_t)vramStart; if (gOverlayLogSeverity >= 3) { PRINTF("DoRelocation(%08x, %08x, %08x)\n", allocatedRamAddr, ovlRelocs, vramStart); @@ -88,7 +88,7 @@ void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlReloc // Check address is valid for relocation if ((*relocDataP & 0x0F000000) == 0) { - relocOffset = *relocDataP - (uintptr_t)vramStart; + relocOffset = *relocDataP - vramu32; relocatedValue = relocOffset + allocu32; relocatedAddress = relocatedValue; unrelocatedAddress = relocData; @@ -101,7 +101,7 @@ void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlReloc // Extract the address from the target field of the J-type MIPS instruction. // Relocate the address and update the instruction. if (1) { - relocOffset = PHYS_TO_K0(MIPS_JUMP_TARGET(*relocDataP)) - (uintptr_t)vramStart; + relocOffset = PHYS_TO_K0(MIPS_JUMP_TARGET(*relocDataP)) - vramu32; unrelocatedAddress = PHYS_TO_K0(MIPS_JUMP_TARGET(*relocDataP)); relocatedValue = (*relocDataP & 0xFC000000) | (((allocu32 + relocOffset) & 0x0FFFFFFF) >> 2); relocatedAddress = PHYS_TO_K0(MIPS_JUMP_TARGET(relocatedValue)); @@ -130,7 +130,7 @@ void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlReloc // Check address is valid for relocation if ((((*regValP << 0x10) + (s16)*relocDataP) & 0x0F000000) == 0) { - relocOffset = ((*regValP << 0x10) + (s16)*relocDataP) - (uintptr_t)vramStart; + relocOffset = ((*regValP << 0x10) + (s16)*relocDataP) - vramu32; isLoNeg = ((relocOffset + allocu32) & 0x8000) ? 1 : 0; // adjust for signed immediate unrelocatedAddress = (*luiInstRef << 0x10) + (s16)relocData; *luiInstRef = @@ -154,7 +154,7 @@ void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlReloc case R_MIPS_LO16 << RELOC_TYPE_SHIFT: if (gOverlayLogSeverity >= 3) { PRINTF("%02d %08x %08x %08x ", dbg, relocDataP, relocatedValue, relocatedAddress); - PRINTF(" %08x %08x %08x %08x\n", (uintptr_t)relocDataP + (uintptr_t)vramStart - allocu32, relocData, + PRINTF(" %08x %08x %08x %08x\n", (uintptr_t)relocDataP + vramu32 - allocu32, relocData, unrelocatedAddress, relocOffset); } // Adding a break prevents matching diff --git a/src/code/sched.c b/src/code/sched.c index c963cedbad..656c4994fd 100644 --- a/src/code/sched.c +++ b/src/code/sched.c @@ -40,6 +40,8 @@ * @see irqmgr.c */ #include "global.h" +#include "fault.h" +#include "versions.h" #define RSP_DONE_MSG 667 #define RDP_DONE_MSG 668 @@ -52,7 +54,7 @@ OSTime sRSPOtherTimeStart; OSTime sRDPTimeStart; #endif -#if IS_DEBUG +#if OOT_VERSION < PAL_1_0 || IS_DEBUG vs32 sSchedDebugPrintfEnabled = false; #define SCHED_DEBUG_PRINTF \ @@ -114,10 +116,29 @@ void Sched_SwapFrameBufferImpl(CfbInfo* cfbInfo) { #endif } +#if OOT_VERSION < PAL_1_0 + if (cfbInfo->viMode != NULL) { + osViSetMode(cfbInfo->viMode); + osViSetSpecialFeatures(cfbInfo->viFeatures); + } + if (1) {} + if (1) {} + if (1) {} + if (1) {} + if (1) {} +#endif + cfbInfo->unk_10 = 0; } void Sched_SwapFrameBuffer(Scheduler* sc, CfbInfo* cfbInfo) { +#if OOT_VERSION < PAL_1_0 + Sched_SwapFrameBufferImpl(cfbInfo); + if (sc->isFirstSwap) { + osViBlack(false); + sc->isFirstSwap = false; + } +#else if (sc->isFirstSwap) { sc->isFirstSwap = false; @@ -126,6 +147,7 @@ void Sched_SwapFrameBuffer(Scheduler* sc, CfbInfo* cfbInfo) { } } Sched_SwapFrameBufferImpl(cfbInfo); +#endif } void Sched_HandlePreNMI(Scheduler* sc) { @@ -171,7 +193,12 @@ void Sched_HandlePreNMI(Scheduler* sc) { void Sched_HandleNMI(Scheduler* sc) { // black the screen and reset the VI y scale just in time for NMI reset +#if OOT_VERSION < PAL_1_0 + osViSetYScale(1.0f); + osViBlack(true); +#else ViConfig_UpdateVi(true); +#endif } /** @@ -185,8 +212,7 @@ void Sched_QueueTask(Scheduler* sc, OSScTask* task) { 463); if (type == M_AUDTASK) { - // "You have entered an audio task" - SCHED_DEBUG_PRINTF("オーディオタスクをエントリしました\n"); + SCHED_DEBUG_PRINTF(T("オーディオタスクをエントリしました\n", "You have entered an audio task\n")); // Add to audio queue if (sc->audioListTail != NULL) { @@ -200,8 +226,7 @@ void Sched_QueueTask(Scheduler* sc, OSScTask* task) { sc->doAudio = true; } else { - // "Entered graph task" - SCHED_DEBUG_PRINTF("グラフタスクをエントリしました\n"); + SCHED_DEBUG_PRINTF(T("グラフタスクをエントリしました\n", "Entered graph task\n")); // Add to graphics queue if (sc->gfxListTail != NULL) { @@ -451,6 +476,13 @@ void Sched_RunTask(Scheduler* sc, OSScTask* spTask, OSScTask* dpTask) { // If the task also uses the RDP, set current running RDP task if (isFirstStartOfMainGfxTask) { +#if OOT_VERSION < PAL_1_0 + // Unknown SCHED_DEBUG_PRINTF calls + if (sSchedDebugPrintfEnabled) {} + if (sSchedDebugPrintfEnabled) {} + if (sSchedDebugPrintfEnabled) {} +#endif + sc->curRDPTask = dpTask; #if !ENABLE_PROFILER sRDPTimeStart = sRSPGfxTimeStart; @@ -496,7 +528,9 @@ void Sched_HandleNotification(Scheduler* sc) { void Sched_HandleRetrace(Scheduler* sc) { SCHED_DEBUG_PRINTF("%08d:scHandleRetrace %08x\n", (u32)OS_CYCLES_TO_USEC(osGetTime()), osViGetCurrentFramebuffer()); +#if OOT_VERSION >= PAL_1_0 ViConfig_UpdateBlack(); +#endif sc->retraceCount++; // Retrace handlers run after VI context swap. The last swap buffer may now be the current buffer. @@ -638,8 +672,7 @@ void Sched_ThreadEntry(void* arg) { Scheduler* sc = (Scheduler*)arg; while (true) { - // "%08d: standby" - SCHED_DEBUG_PRINTF("%08d:待機中\n", (u32)OS_CYCLES_TO_USEC(osGetTime())); + SCHED_DEBUG_PRINTF(T("%08d:待機中\n", "%08d: standby\n"), (u32)OS_CYCLES_TO_USEC(osGetTime())); // Await interrupt messages, either from the OS, IrqMgr, or another thread osRecvMesg(&sc->interruptQueue, &msg, OS_MESG_BLOCK); @@ -684,6 +717,12 @@ void Sched_Init(Scheduler* sc, void* stack, OSPri priority, u8 viModeType, UNK_T // Create message queues for receiving interrupt events and tasks osCreateMesgQueue(&sc->interruptQueue, sc->interruptMsgBuf, ARRAY_COUNT(sc->interruptMsgBuf)); osCreateMesgQueue(&sc->cmdQueue, sc->cmdMsgBuf, ARRAY_COUNT(sc->cmdMsgBuf)); + +#if OOT_VERSION < PAL_1_0 + osViBlack(true); + osViSetSpecialFeatures(OS_VI_DITHER_FILTER_ON | OS_VI_GAMMA_OFF); +#endif + osSetEventMesg(OS_EVENT_SP, &sc->interruptQueue, (OSMesg)RSP_DONE_MSG); osSetEventMesg(OS_EVENT_DP, &sc->interruptQueue, (OSMesg)RDP_DONE_MSG); IrqMgr_AddClient(irqMgr, &sc->irqClient, &sc->interruptQueue); diff --git a/src/code/shrink_window.c b/src/code/shrink_window.c index 66eb73d664..73f92cb261 100644 --- a/src/code/shrink_window.c +++ b/src/code/shrink_window.c @@ -1,6 +1,6 @@ #include "global.h" -typedef enum { +typedef enum LetterboxState { /* 0 */ LETTERBOX_STATE_IDLE, /* 1 */ LETTERBOX_STATE_GROWING, /* 2 */ LETTERBOX_STATE_SHRINKING diff --git a/src/code/sys_cfb.c b/src/code/sys_cfb.c index 66cb3655b4..3e1ea53c09 100644 --- a/src/code/sys_cfb.c +++ b/src/code/sys_cfb.c @@ -1,6 +1,9 @@ #include "global.h" #include "config.h" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "pal-1.1:128" + uintptr_t sSysCfbFbPtr[2]; uintptr_t sSysCfbEnd; @@ -9,26 +12,33 @@ void SysCfb_Init(s32 n64dd) { uintptr_t tmpFbEnd; if (osMemSize >= 0x800000) { - // "8MB or more memory is installed" - PRINTF("8Mバイト以上のメモリが搭載されています\n"); + PRINTF(T("8Mバイト以上のメモリが搭載されています\n", "8MB or more memory is installed\n")); tmpFbEnd = IS_DEBUG_HEAP_ENABLED ? 0x8044BE80 : SYS_CFB_END; if (n64dd == 1) { - PRINTF("RAM 8M mode (N64DD対応)\n"); // "RAM 8M mode (N64DD compatible)" + PRINTF(T("RAM 8M mode (N64DD対応)\n", "RAM 8M mode (N64DD compatible)\n")); #if IS_DEBUG sSysCfbEnd = 0x805FB000; #else sSysCfbEnd = 0x80600000; #endif } else { - // "The margin for this version is %dK bytes" - PRINTF("このバージョンのマージンは %dK バイトです\n", (0x4BC00 / 1024)); + PRINTF(T("このバージョンのマージンは %dK バイトです\n", "The margin for this version is %dK bytes\n"), + (0x4BC00 / 1024)); sSysCfbEnd = tmpFbEnd; } } else if (osMemSize >= 0x400000) { PRINTF("RAM4M mode\n"); sSysCfbEnd = 0x80400000; } else { +#if OOT_VERSION < NTSC_1_1 + LogUtils_HungupThread("../sys_cfb.c", 305); +#elif OOT_VERSION < PAL_1_0 + LogUtils_HungupThread("../sys_cfb.c", 308); +#elif OOT_VERSION < GC_JP + LogUtils_HungupThread("../sys_cfb.c", 322); +#else LogUtils_HungupThread("../sys_cfb.c", 354); +#endif } screenSize = SCREEN_WIDTH * SCREEN_HEIGHT; @@ -36,12 +46,12 @@ void SysCfb_Init(s32 n64dd) { if (1) {} - // "The final address used by the system is %08x" - PRINTF("システムが使用する最終アドレスは %08x です\n", sSysCfbEnd); + PRINTF(T("システムが使用する最終アドレスは %08x です\n", "The final address used by the system is %08x\n"), + sSysCfbEnd); sSysCfbFbPtr[0] = sSysCfbEnd - (screenSize * 4); sSysCfbFbPtr[1] = sSysCfbEnd - (screenSize * 2); - // "Frame buffer addresses are %08x and %08x" - PRINTF("フレームバッファのアドレスは %08x と %08x です\n", sSysCfbFbPtr[0], sSysCfbFbPtr[1]); + PRINTF(T("フレームバッファのアドレスは %08x と %08x です\n", "Frame buffer addresses are %08x and %08x\n"), + sSysCfbFbPtr[0], sSysCfbFbPtr[1]); } void SysCfb_Reset(void) { diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c index 8778594ef4..79c8945bca 100644 --- a/src/code/sys_math3d.c +++ b/src/code/sys_math3d.c @@ -5,9 +5,8 @@ #include "macros.h" #include "sys_math3d.h" -// For retail BSS ordering, the block number of cbf in Math3D_CylVsCylOverlapCenterDist -// must be 0. -#pragma increment_block_number 108 +#pragma increment_block_number "gc-eu:103 gc-eu-mq:103 gc-jp:103 gc-jp-ce:103 gc-jp-mq:103 gc-us:103 gc-us-mq:103" \ + "ntsc-1.2:79 pal-1.0:80 pal-1.1:80" s32 Math3D_LineVsLineClosestTwoPoints(Vec3f* lineAPointA, Vec3f* lineAPointB, Vec3f* lineBPointA, Vec3f* lineBPointB, Vec3f* lineAClosestToB, Vec3f* lineBClosestToA); @@ -129,9 +128,9 @@ void Math3D_LineClosestToPoint(InfiniteLine* line, Vec3f* pos, Vec3f* closestPoi dirVectorLengthSq = Math3D_Vec3fMagnitudeSq(&line->dir); if (IS_ZERO(dirVectorLengthSq)) { PRINTF(VT_COL(YELLOW, BLACK)); - // "Math3D_lineVsPosSuisenCross(): No straight line length" - PRINTF("Math3D_lineVsPosSuisenCross():直線の長さがありません\n"); - PRINTF("cross = pos を返します。\n"); // "Returns cross = pos." + PRINTF(T("Math3D_lineVsPosSuisenCross():直線の長さがありません\n", + "Math3D_lineVsPosSuisenCross(): No straight line length\n")); + PRINTF(T("cross = pos を返します。\n", "Returns cross = pos.\n")); PRINTF(VT_RST); Math_Vec3f_Copy(closestPoint, pos); //! @bug Missing early return @@ -932,8 +931,9 @@ f32 Math3D_Plane(Plane* plane, Vec3f* pointOnPlane) { f32 Math3D_UDistPlaneToPos(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* p) { if (IS_DEBUG && IS_ZERO(sqrtf(SQ(nx) + SQ(ny) + SQ(nz)))) { PRINTF(VT_COL(YELLOW, BLACK)); - // "Math3DLengthPlaneAndPos(): Normal size is near zero %f %f %f" - PRINTF("Math3DLengthPlaneAndPos():法線size がゼロ近いです%f %f %f\n", nx, ny, nz); + PRINTF(T("Math3DLengthPlaneAndPos():法線size がゼロ近いです%f %f %f\n", + "Math3DLengthPlaneAndPos(): Normal size is near zero %f %f %f\n"), + nx, ny, nz); PRINTF(VT_RST); return 0.0f; } @@ -950,8 +950,9 @@ f32 Math3D_DistPlaneToPos(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* p) { normMagnitude = sqrtf(SQ(nx) + SQ(ny) + SQ(nz)); if (IS_ZERO(normMagnitude)) { PRINTF(VT_COL(YELLOW, BLACK)); - // "Math3DSignedLengthPlaneAndPos(): Normal size is close to zero %f %f %f" - PRINTF("Math3DSignedLengthPlaneAndPos():法線size がゼロ近いです%f %f %f\n", nx, ny, nz); + PRINTF(T("Math3DSignedLengthPlaneAndPos():法線size がゼロ近いです%f %f %f\n", + "Math3DSignedLengthPlaneAndPos(): Normal size is close to zero %f %f %f\n"), + nx, ny, nz); PRINTF(VT_RST); return 0.0f; } diff --git a/src/code/sys_math3d_draw.c b/src/code/sys_math3d_draw.c index 4c31d65001..cec402f72e 100644 --- a/src/code/sys_math3d_draw.c +++ b/src/code/sys_math3d_draw.c @@ -183,7 +183,7 @@ void Math3D_DrawSphereImpl(GraphicsContext* gfxCtx, Gfx** gfxP, f32 x, f32 y, f3 Matrix_Translate(x, y, z, MTXMODE_NEW); Matrix_Scale(radius / 128.0f, radius / 128.0f, radius / 128.0f, MTXMODE_APPLY); - gSPMatrix((*gfxP)++, Matrix_NewMtx(gfxCtx, __FILE__, __LINE__), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH); + gSPMatrix((*gfxP)++, Matrix_Finalize(gfxCtx, __FILE__, __LINE__), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH); gSPDisplayList((*gfxP)++, pSphGfx); gSPPopMatrix((*gfxP)++, G_MTX_MODELVIEW); @@ -289,7 +289,7 @@ void Math3D_DrawCylinderImpl(GraphicsContext* gfxCtx, Gfx** gfxP, f32 x, f32 y, Matrix_Translate(x, y, z, MTXMODE_NEW); Matrix_Scale(radius / 128.0f, height / 128.0f, radius / 128.0f, MTXMODE_APPLY); - gSPMatrix((*gfxP)++, Matrix_NewMtx(gfxCtx, __FILE__, __LINE__), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH); + gSPMatrix((*gfxP)++, Matrix_Finalize(gfxCtx, __FILE__, __LINE__), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH); gSPDisplayList((*gfxP)++, pCylGfx); gSPPopMatrix((*gfxP)++, G_MTX_MODELVIEW); diff --git a/src/code/sys_matrix.c b/src/code/sys_matrix.c index d83d642c20..cf82bb9972 100644 --- a/src/code/sys_matrix.c +++ b/src/code/sys_matrix.c @@ -1,4 +1,7 @@ #include "global.h" +#if OOT_DEBUG +#include "fault.h" +#endif // clang-format off Mtx gMtxClear = gdSPDefMtx( @@ -16,6 +19,9 @@ MtxF gMtxFClear = { }; // clang-format on +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "pal-1.1:128" + MtxF* sMatrixStack; // "Matrix_stack" MtxF* sCurrentMatrix; // "Matrix_now" @@ -609,7 +615,7 @@ Mtx* Matrix_ToMtx(Mtx* dest, const char* file, int line) { return Matrix_MtxFToMtx(MATRIX_CHECK_FLOATS(sCurrentMatrix, file, line), dest); } -Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, const char* file, int line) { +Mtx* Matrix_Finalize(GraphicsContext* gfxCtx, const char* file, int line) { return Matrix_ToMtx(GRAPH_ALLOC(gfxCtx, sizeof(Mtx)), file, line); } @@ -619,7 +625,7 @@ Mtx* Matrix_ToMtx(Mtx* dest) { return Matrix_MtxFToMtx(sCurrentMatrix, dest); } -Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx) { +Mtx* Matrix_Finalize(GraphicsContext* gfxCtx) { return Matrix_ToMtx(GRAPH_ALLOC(gfxCtx, sizeof(Mtx))); } @@ -1015,7 +1021,7 @@ void Matrix_SetTranslateUniformScaleMtx(Mtx* mtx, f32 scale, f32 translateX, f32 MtxF mf; Matrix_SetTranslateUniformScaleMtxF(&mf, scale, translateX, translateY, translateZ); - guMtxF2L(&mf, mtx); + guMtxF2L(mf.mf, mtx); } void Matrix_SetTranslateUniformScaleMtx2(Mtx* mtx, f32 scale, f32 translateX, f32 translateY, f32 translateZ) { diff --git a/src/code/sys_ucode.c b/src/code/sys_ucode.c index aa3fa809fb..5ced4d38d6 100644 --- a/src/code/sys_ucode.c +++ b/src/code/sys_ucode.c @@ -1,4 +1,5 @@ #include "global.h" +#include "fault.h" #if !ENABLE_F3DEX3 u64* sDefaultGSPUCodeText = gspF3DZEX2_NoN_PosLight_fifoTextStart; diff --git a/src/code/title_setup.c b/src/code/title_setup.c index c344fcb4f9..fcc6eaa239 100644 --- a/src/code/title_setup.c +++ b/src/code/title_setup.c @@ -1,7 +1,7 @@ #include "global.h" void Setup_InitImpl(SetupState* this) { - PRINTF("ゼルダ共通データ初期化\n"); // "Zelda common data initalization" + PRINTF(T("ゼルダ共通データ初期化\n", "Zelda common data initialization\n")); SaveContext_Init(); this->state.running = false; SET_NEXT_GAMESTATE(&this->state, ConsoleLogo_Init, ConsoleLogoState); diff --git a/src/code/ucode_disas.c b/src/code/ucode_disas.c index 0587da6b75..00f1eab8c2 100644 --- a/src/code/ucode_disas.c +++ b/src/code/ucode_disas.c @@ -1,28 +1,29 @@ #include "global.h" +#include "ucode_disas.h" -typedef struct { +typedef struct F3dzexConst { /* 0x00 */ u32 value; /* 0x04 */ const char* name; } F3dzexConst; // size = 0x8 -typedef struct { +typedef struct F3dzexFlag { /* 0x00 */ u32 value; /* 0x04 */ const char* setName; /* 0x08 */ const char* unsetName; } F3dzexFlag; // size = 0x0C -typedef struct { +typedef struct F3dzexRenderMode { /* 0x00 */ const char* name; /* 0x04 */ u32 value; /* 0x08 */ u32 mask; } F3dzexRenderMode; // size = 0x0C -typedef struct { +typedef struct F3dzexSetModeMacroValue { /* 0x00 */ const char* name; /* 0x04 */ u32 value; } F3dzexSetModeMacroValue; // size = 0x8 -typedef struct { +typedef struct F3dzexSetModeMacro { /* 0x00 */ const char* name; /* 0x04 */ u32 shift; /* 0x08 */ u32 len; @@ -69,7 +70,7 @@ F3dzexFlag sUCodeDisasMtxFlags[] = { F3DZEX_FLAG(G_MTX_PUSH, G_MTX_NOPUSH), }; -typedef enum { +typedef enum CombinerArg { COMBINER_A = 1, COMBINER_B, COMBINER_C, @@ -222,8 +223,8 @@ void UCodeDisas_SetCurUCodeImpl(UCodeDisas* this, void* ptr) { } } if (i >= this->ucodeInfoCount) { - DISAS_LOG("マイクロコードが一致しなかった\n"); // "Microcode did not match" - this->ucodeType = UCODE_NULL; + DISAS_LOG(T("マイクロコードが一致しなかった\n", "Microcode did not match\n")); + this->ucodeType = UCODE_TYPE_NULL; } } @@ -413,7 +414,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { settile.shiftt, (settile.cs << 1) + settile.ms, settile.masks, settile.shifts); if (this->tileSyncRequired) { - DISAS_LOG("### TileSyncが必要です。\n"); + DISAS_LOG(T("### TileSyncが必要です。\n", "### TileSync is required.\n")); this->syncErr++; } } break; @@ -432,7 +433,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { loadtile.th); if (this->loadSyncRequired) { - DISAS_LOG("### LoadSyncが必要です。\n"); + DISAS_LOG(T("### LoadSyncが必要です。\n", "### LoadSync is required.\n")); this->syncErr++; } this->pipeSyncRequired = true; @@ -476,7 +477,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { UCodeDisas_GetCombineAlphaName(setcombine.Ad1, COMBINER_D)); if (this->pipeSyncRequired) { - DISAS_LOG("### PipeSyncが必要です。\n"); + DISAS_LOG(T("### PipeSyncが必要です。\n", "### PipeSync is required.\n")); this->syncErr++; } } break; @@ -529,7 +530,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { this->modeH |= s2; if (this->pipeSyncRequired) { - DISAS_LOG("### PipeSyncが必要です。\n"); + DISAS_LOG(T("### PipeSyncが必要です。\n", "### PipeSync is required.\n")); this->syncErr++; } } break; @@ -571,7 +572,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { this->modeL |= s2; if (this->pipeSyncRequired) { - DISAS_LOG("### PipeSyncが必要です。\n"); + DISAS_LOG(T("### PipeSyncが必要です。\n", "### PipeSync is required.\n")); this->syncErr++; } } break; @@ -582,7 +583,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { this->modeL = curGfx->words.w1; if (this->pipeSyncRequired) { - DISAS_LOG("### PipeSyncが必要です。\n"); + DISAS_LOG(T("### PipeSyncが必要です。\n", "### PipeSync is required.\n")); this->syncErr++; } } break; @@ -632,7 +633,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { (curGfx->dma.len & 0xFFF) + 1, curGfx->setimg.dram, addr); if (this->pipeSyncRequired) { - DISAS_LOG("### PipeSyncが必要です。\n"); + DISAS_LOG(T("### PipeSyncが必要です。\n", "### PipeSync is required.\n")); this->syncErr++; } } break; @@ -641,7 +642,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { DISAS_LOG("gsDPSetDepthImage(0x%08x(0x%08x)),", curGfx->setimg.dram, addr); if (this->pipeSyncRequired) { - DISAS_LOG("### PipeSyncが必要です。\n"); + DISAS_LOG(T("### PipeSyncが必要です。\n", "### PipeSync is required.\n")); this->syncErr++; } } break; @@ -668,7 +669,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { curGfx->setcolor.b, curGfx->setcolor.a); if (this->pipeSyncRequired) { - DISAS_LOG("### PipeSyncが必要です。\n"); + DISAS_LOG(T("### PipeSyncが必要です。\n", "### PipeSync is required.\n")); this->syncErr++; } } break; @@ -678,7 +679,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { curGfx->setcolor.b, curGfx->setcolor.a); if (this->pipeSyncRequired) { - DISAS_LOG("### PipeSyncが必要です。\n"); + DISAS_LOG(T("### PipeSyncが必要です。\n", "### PipeSync is required.\n")); this->syncErr++; } } break; @@ -688,7 +689,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { curGfx->setcolor.b, curGfx->setcolor.a); if (this->pipeSyncRequired) { - DISAS_LOG("### PipeSyncが必要です。\n"); + DISAS_LOG(T("### PipeSyncが必要です。\n", "### PipeSync is required.\n")); this->syncErr++; } } break; @@ -697,7 +698,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { DISAS_LOG("gsDPSetFillColor(0x%08x),", curGfx->setcolor.color); if (this->pipeSyncRequired) { - DISAS_LOG("### PipeSyncが必要です。\n"); + DISAS_LOG(T("### PipeSyncが必要です。\n", "### PipeSync is required.\n")); this->syncErr++; } } break; @@ -706,7 +707,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { DISAS_LOG("gsDPSetPrimDepth(%d, %d),", curGfx->setprimdepth.z, curGfx->setprimdepth.dz); if (this->pipeSyncRequired) { - DISAS_LOG("### PipeSyncが必要です。\n"); + DISAS_LOG(T("### PipeSyncが必要です。\n", "### PipeSync is required.\n")); this->syncErr++; } } break; @@ -721,7 +722,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { DISAS_LOG("gsDPFullSync(),"); if (this->pipeSyncRequired) { - DISAS_LOG("### PipeSyncが必要です。\n"); + DISAS_LOG(T("### PipeSyncが必要です。\n", "### PipeSync is required.\n")); this->syncErr++; } } break; @@ -800,8 +801,8 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { default: { switch (this->ucodeType) { - case UCODE_F3DZEX: - case UCODE_UNK: { + case UCODE_TYPE_F3DZEX: + case UCODE_TYPE_UNK: { switch (cmd) { case G_MTX: { Gdma2 gmtx = ptr->dma2; @@ -1099,7 +1100,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { } } break; - case UCODE_S2DEX: { + case UCODE_TYPE_S2DEX: { switch (cmd) { case G_BG_COPY: { Gwords words = ptr->words; diff --git a/src/code/z_DLF.c b/src/code/z_DLF.c index 42fbc4b476..547dc4bbbd 100644 --- a/src/code/z_DLF.c +++ b/src/code/z_DLF.c @@ -3,7 +3,7 @@ void Overlay_LoadGameState(GameStateOverlay* overlayEntry) { if (overlayEntry->loadedRamAddr != NULL) { - PRINTF("既にリンクされています\n"); // "Already linked" + PRINTF(T("既にリンクされています\n", "Already linked\n")); return; } @@ -14,7 +14,7 @@ void Overlay_LoadGameState(GameStateOverlay* overlayEntry) { overlayEntry->vramStart, overlayEntry->vramEnd); if (overlayEntry->loadedRamAddr == NULL) { - PRINTF("ロードに失敗しました\n"); // "Loading failed" + PRINTF(T("ロードに失敗しました\n", "Loading failed\n")); return; } diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 28eb1f2b96..90808a1c39 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1,14 +1,18 @@ #include "global.h" +#include "fault.h" #include "quake.h" +#include "rand.h" #include "terminal.h" +#include "versions.h" + #include "overlays/actors/ovl_Arms_Hook/z_arms_hook.h" #include "overlays/actors/ovl_En_Part/z_en_part.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "assets/objects/object_bdoor/object_bdoor.h" -// For retail BSS ordering, the block number of sCurCeilingPoly -// must be between 2 and 243 inclusive. +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:0 pal-1.0:0 pal-1.1:0" static CollisionPoly* sCurCeilingPoly; static s32 sCurCeilingBgId; @@ -69,7 +73,7 @@ void ActorShadow_Draw(Actor* actor, Lights* lights, PlayState* play, Gfx* dlist, temp2 = (1.0f - (temp1 * (1.0f / 350))) * actor->shape.shadowScale; Matrix_Scale(actor->scale.x * temp2, 1.0f, actor->scale.z * temp2, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 1588), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_actor.c", 1588); gSPDisplayList(POLY_OPA_DISP++, dlist); CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 1594); @@ -107,7 +111,7 @@ void ActorShadow_DrawFoot(PlayState* play, Light* light, MtxF* arg2, s32 arg3, f Matrix_RotateY(sp58, MTXMODE_APPLY); Matrix_Scale(arg5, 1.0f, arg5 * arg6, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 1687), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_actor.c", 1687); gSPDisplayList(POLY_OPA_DISP++, gFootShadowDL); CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 1693); @@ -235,19 +239,25 @@ void Actor_ProjectPos(PlayState* play, Vec3f* src, Vec3f* xyzDest, f32* cappedIn *cappedInvWDest = (*cappedInvWDest < 1.0f) ? 1.0f : (1.0f / *cappedInvWDest); } -typedef struct { - /* 0x00 */ Color_RGBA8 inner; - /* 0x04 */ Color_RGBA8 outer; -} NaviColor; // size = 0x8 - -NaviColor sNaviColorList[] = { - { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, - { { 255, 255, 255, 255 }, { 0, 0, 255, 0 } }, { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, - { { 150, 150, 255, 255 }, { 150, 150, 255, 0 } }, { { 255, 255, 0, 255 }, { 200, 155, 0, 0 } }, - { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, - { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, { { 255, 255, 0, 255 }, { 200, 155, 0, 0 } }, - { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, - { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, +typedef struct AttentionColor { + /* 0x00 */ Color_RGBA8 primary; // Used for Navi's inner color, lock-on arrow, and lock-on reticle + /* 0x04 */ Color_RGBA8 secondary; // Used for Navi's outer color +} AttentionColor; // size = 0x8 + +AttentionColor sAttentionColors[ACTORCAT_MAX + 1] = { + { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, // ACTORCAT_SWITCH + { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, // ACTORCAT_BG + { { 255, 255, 255, 255 }, { 0, 0, 255, 0 } }, // ACTORCAT_PLAYER + { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, // ACTORCAT_EXPLOSIVE + { { 150, 150, 255, 255 }, { 150, 150, 255, 0 } }, // ACTORCAT_NPC + { { 255, 255, 0, 255 }, { 200, 155, 0, 0 } }, // ACTORCAT_ENEMY + { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, // ACTORCAT_PROP + { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, // ACTORCAT_ITEMACTION + { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, // ACTORCAT_MISC + { { 255, 255, 0, 255 }, { 200, 155, 0, 0 } }, // ACTORCAT_BOSS + { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, // ACTORCAT_DOOR + { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, // ACTORCAT_CHEST + { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, // unused extra entry }; // unused @@ -255,270 +265,321 @@ Gfx D_80115FF0[] = { gsSPEndDisplayList(), }; -void func_8002BE64(TargetContext* targetCtx, s32 index, f32 arg2, f32 arg3, f32 arg4) { - targetCtx->arr_50[index].pos.x = arg2; - targetCtx->arr_50[index].pos.y = arg3; - targetCtx->arr_50[index].pos.z = arg4; - targetCtx->arr_50[index].unk_0C = targetCtx->unk_44; +void Attention_SetReticlePos(Attention* attention, s32 reticleNum, f32 x, f32 y, f32 z) { + attention->lockOnReticles[reticleNum].pos.x = x; + attention->lockOnReticles[reticleNum].pos.y = y; + attention->lockOnReticles[reticleNum].pos.z = z; + + attention->lockOnReticles[reticleNum].radius = attention->reticleRadius; } -void func_8002BE98(TargetContext* targetCtx, s32 actorCategory, PlayState* play) { - TargetContextEntry* entry; - NaviColor* naviColor; +void Attention_InitReticle(Attention* attention, s32 actorCategory, PlayState* play) { + LockOnReticle* reticle; + AttentionColor* attentionColor = &sAttentionColors[actorCategory]; s32 i; - Math_Vec3f_Copy(&targetCtx->targetCenterPos, &play->view.eye); - targetCtx->unk_44 = 500.0f; - targetCtx->unk_48 = 0x100; + Math_Vec3f_Copy(&attention->reticlePos, &play->view.eye); - naviColor = &sNaviColorList[actorCategory]; + attention->reticleRadius = 500.0f; // radius starts wide to zoom in on the actor + attention->reticleFadeAlphaControl = 256; - entry = &targetCtx->arr_50[0]; - for (i = 0; i < ARRAY_COUNT(targetCtx->arr_50); i++) { - func_8002BE64(targetCtx, i, 0.0f, 0.0f, 0.0f); - entry->color.r = naviColor->inner.r; - entry->color.g = naviColor->inner.g; - entry->color.b = naviColor->inner.b; - entry++; + reticle = &attention->lockOnReticles[0]; + + for (i = 0; i < ARRAY_COUNT(attention->lockOnReticles); i++, reticle++) { + Attention_SetReticlePos(attention, i, 0.0f, 0.0f, 0.0f); + + reticle->color.r = attentionColor->primary.r; + reticle->color.g = attentionColor->primary.g; + reticle->color.b = attentionColor->primary.b; } } -void Actor_SetNaviToActor(TargetContext* targetCtx, Actor* actor, s32 actorCategory, PlayState* play) { - NaviColor* naviColor = &sNaviColorList[actorCategory]; - targetCtx->naviRefPos.x = actor->focus.pos.x; - targetCtx->naviRefPos.y = actor->focus.pos.y + (actor->targetArrowOffset * actor->scale.y); - targetCtx->naviRefPos.z = actor->focus.pos.z; - targetCtx->naviInner.r = naviColor->inner.r; - targetCtx->naviInner.g = naviColor->inner.g; - targetCtx->naviInner.b = naviColor->inner.b; - targetCtx->naviInner.a = naviColor->inner.a; - targetCtx->naviOuter.r = naviColor->outer.r; - targetCtx->naviOuter.g = naviColor->outer.g; - targetCtx->naviOuter.b = naviColor->outer.b; - targetCtx->naviOuter.a = naviColor->outer.a; +void Attention_SetNaviState(Attention* attention, Actor* actor, s32 actorCategory, PlayState* play) { + AttentionColor* attentionColor = &sAttentionColors[actorCategory]; + + attention->naviHoverPos.x = actor->focus.pos.x; + attention->naviHoverPos.y = actor->focus.pos.y + (actor->lockOnArrowOffset * actor->scale.y); + attention->naviHoverPos.z = actor->focus.pos.z; + + attention->naviInnerColor.r = attentionColor->primary.r; + attention->naviInnerColor.g = attentionColor->primary.g; + attention->naviInnerColor.b = attentionColor->primary.b; + attention->naviInnerColor.a = attentionColor->primary.a; + + attention->naviOuterColor.r = attentionColor->secondary.r; + attention->naviOuterColor.g = attentionColor->secondary.g; + attention->naviOuterColor.b = attentionColor->secondary.b; + attention->naviOuterColor.a = attentionColor->secondary.a; } -void func_8002C0C0(TargetContext* targetCtx, Actor* actor, PlayState* play) { - targetCtx->arrowPointedActor = targetCtx->targetedActor = targetCtx->unk_8C = targetCtx->bgmEnemy = NULL; +void Attention_Init(Attention* attention, Actor* actor, PlayState* play) { + attention->naviHoverActor = attention->reticleActor = attention->forcedLockOnActor = attention->bgmEnemy = NULL; + + attention->reticleSpinCounter = 0; + attention->curReticle = 0; + attention->naviMoveProgressFactor = 0.0f; - targetCtx->unk_4B = 0; - targetCtx->unk_4C = 0; - targetCtx->unk_40 = 0.0f; - Actor_SetNaviToActor(targetCtx, actor, actor->category, play); - func_8002BE98(targetCtx, actor->category, play); + Attention_SetNaviState(attention, actor, actor->category, play); + Attention_InitReticle(attention, actor->category, play); } -void func_8002C124(TargetContext* targetCtx, PlayState* play) { - Actor* actor = targetCtx->targetedActor; +void Attention_Draw(Attention* attention, PlayState* play) { + Actor* actor; // used for both the reticle actor and arrow hover actor + + actor = attention->reticleActor; OPEN_DISPS(play->state.gfxCtx, "../z_actor.c", 2029); - if (targetCtx->unk_48 != 0) { - TargetContextEntry* entry; - Player* player; - s16 spCE; - f32 var1; - Vec3f projTargetCenter; - s32 spB8; - f32 projTargetCappedInvW; - s32 spB0; - s32 spAC; - f32 var2; + if (attention->reticleFadeAlphaControl != 0) { + LockOnReticle* reticle; + Player* player = GET_PLAYER(play); + s16 alpha; + f32 projectdPosScale; + Vec3f projectedPos; + s32 numReticles; + f32 invW; s32 i; + s32 curReticle; + f32 lockOnScaleX; + s32 triangleIndex; - player = GET_PLAYER(play); - - spCE = 0xFF; - var1 = 1.0f; + alpha = 255; + projectdPosScale = 1.0f; - if (targetCtx->unk_4B != 0) { - spB8 = 1; + if (attention->reticleSpinCounter != 0) { + // Reticle is spinning so it is active, only need to draw one + numReticles = 1; } else { - spB8 = 3; + // Use multiple reticles for the motion blur effect from the reticle + // quickly zooming in on an actor from off screen + numReticles = ARRAY_COUNT(attention->lockOnReticles); } if (actor != NULL) { - Math_Vec3f_Copy(&targetCtx->targetCenterPos, &actor->focus.pos); - var1 = (500.0f - targetCtx->unk_44) / 420.0f; + Math_Vec3f_Copy(&attention->reticlePos, &actor->focus.pos); + projectdPosScale = (500.0f - attention->reticleRadius) / 420.0f; } else { - targetCtx->unk_48 -= 120; - if (targetCtx->unk_48 < 0) { - targetCtx->unk_48 = 0; + // Not locked on, start fading out + attention->reticleFadeAlphaControl -= 120; + + if (attention->reticleFadeAlphaControl < 0) { + attention->reticleFadeAlphaControl = 0; } - spCE = targetCtx->unk_48; + + // `reticleFadeAlphaControl` is only used as an alpha when fading out. + // Otherwise it defaults to 255, set above. + alpha = attention->reticleFadeAlphaControl; } - Actor_ProjectPos(play, &targetCtx->targetCenterPos, &projTargetCenter, &projTargetCappedInvW); + Actor_ProjectPos(play, &attention->reticlePos, &projectedPos, &invW); + + projectedPos.x = ((SCREEN_WIDTH / 2) * (projectedPos.x * invW)) * projectdPosScale; + projectedPos.x = CLAMP(projectedPos.x, -SCREEN_WIDTH, SCREEN_WIDTH); - projTargetCenter.x = (160 * (projTargetCenter.x * projTargetCappedInvW)) * var1; - projTargetCenter.x = CLAMP(projTargetCenter.x, -320.0f, 320.0f); + projectedPos.y = ((SCREEN_HEIGHT / 2) * (projectedPos.y * invW)) * projectdPosScale; + projectedPos.y = CLAMP(projectedPos.y, -SCREEN_HEIGHT, SCREEN_HEIGHT); - projTargetCenter.y = (120 * (projTargetCenter.y * projTargetCappedInvW)) * var1; - projTargetCenter.y = CLAMP(projTargetCenter.y, -240.0f, 240.0f); + projectedPos.z *= projectdPosScale; - projTargetCenter.z = projTargetCenter.z * var1; + attention->curReticle--; - targetCtx->unk_4C--; - if (targetCtx->unk_4C < 0) { - targetCtx->unk_4C = 2; + if (attention->curReticle < 0) { + attention->curReticle = ARRAY_COUNT(attention->lockOnReticles) - 1; } - func_8002BE64(targetCtx, targetCtx->unk_4C, projTargetCenter.x, projTargetCenter.y, projTargetCenter.z); + Attention_SetReticlePos(attention, attention->curReticle, projectedPos.x, projectedPos.y, projectedPos.z); - if (!(player->stateFlags1 & PLAYER_STATE1_6) || (actor != player->unk_664)) { + if (!(player->stateFlags1 & PLAYER_STATE1_TALKING) || (actor != player->focusActor)) { OVERLAY_DISP = Gfx_SetupDL(OVERLAY_DISP, SETUPDL_57); - for (spB0 = 0, spAC = targetCtx->unk_4C; spB0 < spB8; spB0++, spAC = (spAC + 1) % 3) { - entry = &targetCtx->arr_50[spAC]; + for (i = 0, curReticle = attention->curReticle; i < numReticles; + i++, curReticle = (curReticle + 1) % ARRAY_COUNT(attention->lockOnReticles)) { + reticle = &attention->lockOnReticles[curReticle]; - if (entry->unk_0C < 500.0f) { - if (entry->unk_0C <= 120.0f) { - var2 = 0.15f; + if (reticle->radius < 500.0f) { + if (reticle->radius <= 120.0f) { + lockOnScaleX = 0.15f; } else { - var2 = ((entry->unk_0C - 120.0f) * 0.001f) + 0.15f; + lockOnScaleX = ((reticle->radius - 120.0f) * 0.001f) + 0.15f; } - Matrix_Translate(entry->pos.x, entry->pos.y, 0.0f, MTXMODE_NEW); - Matrix_Scale(var2, 0.15f, 1.0f, MTXMODE_APPLY); + Matrix_Translate(reticle->pos.x, reticle->pos.y, 0.0f, MTXMODE_NEW); + Matrix_Scale(lockOnScaleX, 0.15f, 1.0f, MTXMODE_APPLY); - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, entry->color.r, entry->color.g, entry->color.b, (u8)spCE); + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, reticle->color.r, reticle->color.g, reticle->color.b, + (u8)alpha); - Matrix_RotateZ((targetCtx->unk_4B & 0x7F) * (M_PI / 64), MTXMODE_APPLY); + Matrix_RotateZ((attention->reticleSpinCounter & 0x7F) * (M_PI / 64), MTXMODE_APPLY); - for (i = 0; i < 4; i++) { + // Draw the 4 triangles that make up the reticle + for (triangleIndex = 0; triangleIndex < 4; triangleIndex++) { Matrix_RotateZ(M_PI / 2, MTXMODE_APPLY); Matrix_Push(); - Matrix_Translate(entry->unk_0C, entry->unk_0C, 0.0f, MTXMODE_APPLY); - gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 2116), - G_MTX_MODELVIEW | G_MTX_LOAD); - gSPDisplayList(OVERLAY_DISP++, gZTargetLockOnTriangleDL); + Matrix_Translate(reticle->radius, reticle->radius, 0.0f, MTXMODE_APPLY); + MATRIX_FINALIZE_AND_LOAD(OVERLAY_DISP++, play->state.gfxCtx, "../z_actor.c", 2116); + gSPDisplayList(OVERLAY_DISP++, gLockOnReticleTriangleDL); Matrix_Pop(); } } - spCE -= 0xFF / 3; - if (spCE < 0) { - spCE = 0; + alpha -= 255 / ARRAY_COUNT(attention->lockOnReticles); + + if (alpha < 0) { + alpha = 0; } } } } - actor = targetCtx->unk_94; - if ((actor != NULL) && !(actor->flags & ACTOR_FLAG_27)) { - NaviColor* naviColor = &sNaviColorList[actor->category]; + actor = attention->arrowHoverActor; + + if ((actor != NULL) && !(actor->flags & ACTOR_FLAG_LOCK_ON_DISABLED)) { + AttentionColor* attentionColor = &sAttentionColors[actor->category]; POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_7); - Matrix_Translate(actor->focus.pos.x, actor->focus.pos.y + (actor->targetArrowOffset * actor->scale.y) + 17.0f, + Matrix_Translate(actor->focus.pos.x, actor->focus.pos.y + (actor->lockOnArrowOffset * actor->scale.y) + 17.0f, actor->focus.pos.z, MTXMODE_NEW); Matrix_RotateY(BINANG_TO_RAD((u16)(play->gameplayFrames * 3000)), 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); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 2153), G_MTX_MODELVIEW | G_MTX_LOAD); - gSPDisplayList(POLY_XLU_DISP++, gZTargetArrowDL); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, attentionColor->primary.r, attentionColor->primary.g, + attentionColor->primary.b, 255); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_actor.c", 2153); + gSPDisplayList(POLY_XLU_DISP++, gLockOnArrowDL); } CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 2158); } -void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, PlayState* play) { +void Attention_Update(Attention* attention, Player* player, Actor* playerFocusActor, PlayState* play) { s32 pad; - Actor* unkActor; - s32 actorCategory; + Actor* actor; // used for both the Navi hover actor and reticle actor + s32 category; Vec3f projectedFocusPos; f32 cappedInvWDest; - unkActor = NULL; + actor = NULL; - if ((player->unk_664 != NULL) && + if ((player->focusActor != NULL) && (player->controlStickDirections[player->controlStickDataIndex] == PLAYER_STICK_DIR_BACKWARD)) { - targetCtx->unk_94 = NULL; + // Holding backward on the control stick prevents an arrow appearing over the next lock-on actor. + // This helps escape a lock-on loop when using Switch Targeting, but note that this still works for + // Hold Targeting as well. + attention->arrowHoverActor = NULL; } else { - func_80032AF0(play, &play->actorCtx, &unkActor, player); - targetCtx->unk_94 = unkActor; + // Find the next attention actor so Navi and an arrow can hover over it (if applicable) + Attention_FindActor(play, &play->actorCtx, &actor, player); + attention->arrowHoverActor = actor; } - if (targetCtx->unk_8C != NULL) { - unkActor = targetCtx->unk_8C; - targetCtx->unk_8C = NULL; - } else if (actorArg != NULL) { - unkActor = actorArg; + if (attention->forcedLockOnActor != NULL) { + // This lock-on actor takes precedence over anything else + // (this feature is never used in practice) + actor = attention->forcedLockOnActor; + attention->forcedLockOnActor = NULL; + } else if (playerFocusActor != NULL) { + // Stay locked-on to the same actor, if there is one. + // This also makes Navi fly over to the current focus actor, if there is one. + actor = playerFocusActor; } - if (unkActor != NULL) { - actorCategory = unkActor->category; + if (actor != NULL) { + category = actor->category; } else { - actorCategory = player->actor.category; + category = player->actor.category; } - if ((unkActor != targetCtx->arrowPointedActor) || (actorCategory != targetCtx->activeCategory)) { - targetCtx->arrowPointedActor = unkActor; - targetCtx->activeCategory = actorCategory; - targetCtx->unk_40 = 1.0f; + if ((actor != attention->naviHoverActor) || (category != attention->naviHoverActorCategory)) { + // Set Navi to hover over a new actor + attention->naviHoverActor = actor; + attention->naviHoverActorCategory = category; + attention->naviMoveProgressFactor = 1.0f; } - if (unkActor == NULL) { - unkActor = &player->actor; + if (actor == NULL) { + // Setting the actor to Player will make Navi return to him + actor = &player->actor; } - if (Math_StepToF(&targetCtx->unk_40, 0.0f, 0.25f) == 0) { - f32 temp1 = 0.25f / targetCtx->unk_40; - f32 temp2 = unkActor->world.pos.x - targetCtx->naviRefPos.x; - f32 temp3 = - (unkActor->world.pos.y + (unkActor->targetArrowOffset * unkActor->scale.y)) - targetCtx->naviRefPos.y; - f32 temp4 = unkActor->world.pos.z - targetCtx->naviRefPos.z; + if (!Math_StepToF(&attention->naviMoveProgressFactor, 0.0f, 0.25f)) { + f32 moveScale = 0.25f / attention->naviMoveProgressFactor; + f32 x = actor->world.pos.x - attention->naviHoverPos.x; + f32 y = (actor->world.pos.y + (actor->lockOnArrowOffset * actor->scale.y)) - attention->naviHoverPos.y; + f32 z = actor->world.pos.z - attention->naviHoverPos.z; - targetCtx->naviRefPos.x += temp2 * temp1; - targetCtx->naviRefPos.y += temp3 * temp1; - targetCtx->naviRefPos.z += temp4 * temp1; + attention->naviHoverPos.x += x * moveScale; + attention->naviHoverPos.y += y * moveScale; + attention->naviHoverPos.z += z * moveScale; } else { - Actor_SetNaviToActor(targetCtx, unkActor, actorCategory, play); + // Set Navi pos and color after reaching destination + Attention_SetNaviState(attention, actor, category, play); } - if ((actorArg != NULL) && (targetCtx->unk_4B == 0)) { - Actor_ProjectPos(play, &actorArg->focus.pos, &projectedFocusPos, &cappedInvWDest); + if ((playerFocusActor != NULL) && (attention->reticleSpinCounter == 0)) { + Actor_ProjectPos(play, &playerFocusActor->focus.pos, &projectedFocusPos, &cappedInvWDest); + if (((projectedFocusPos.z <= 0.0f) || (1.0f <= fabsf(projectedFocusPos.x * cappedInvWDest))) || (1.0f <= fabsf(projectedFocusPos.y * cappedInvWDest))) { - actorArg = NULL; + // Release the reticle if the actor is off screen. + // It is possible to move far enough away from an actor that it goes off screen, despite being + // locked onto it. In this case the reticle will release, but the lock-on will remain + // because Player is still updating focusActor. + // It is unclear if this is intentional, or if it is a bug and the lock-on as a whole is supposed + // to release. + playerFocusActor = NULL; } } - if (actorArg != NULL) { - if (actorArg != targetCtx->targetedActor) { + if (playerFocusActor != NULL) { + if (playerFocusActor != attention->reticleActor) { s32 lockOnSfxId; - func_8002BE98(targetCtx, actorArg->category, play); - targetCtx->targetedActor = actorArg; + // Set up a new reticle + Attention_InitReticle(attention, playerFocusActor->category, play); + attention->reticleActor = playerFocusActor; - if (actorArg->id == ACTOR_EN_BOOM) { - targetCtx->unk_48 = 0; + if (playerFocusActor->id == ACTOR_EN_BOOM) { + // Don't draw the reticle when locked onto the boomerang. + // Note that it isn't possible to lock onto the boomerang, so this code doesn't do anything. + // This implies that the boomerang camera lock may have been implemented with Z-Targeting at one point, + // but was eventually implemented as its own camera mode instead. + attention->reticleFadeAlphaControl = 0; } - lockOnSfxId = CHECK_FLAG_ALL(actorArg->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2) ? NA_SE_SY_LOCK_ON - : NA_SE_SY_LOCK_ON_HUMAN; + lockOnSfxId = CHECK_FLAG_ALL(playerFocusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) + ? NA_SE_SY_LOCK_ON + : NA_SE_SY_LOCK_ON_HUMAN; Sfx_PlaySfxCentered(lockOnSfxId); } - targetCtx->targetCenterPos.x = actorArg->world.pos.x; - targetCtx->targetCenterPos.y = actorArg->world.pos.y - (actorArg->shape.yOffset * actorArg->scale.y); - targetCtx->targetCenterPos.z = actorArg->world.pos.z; + // Update reticle - if (targetCtx->unk_4B == 0) { - f32 temp5 = (500.0f - targetCtx->unk_44) * 3.0f; - f32 temp6 = (temp5 < 30.0f) ? 30.0f : ((100.0f < temp5) ? 100.0f : temp5); + attention->reticlePos.x = playerFocusActor->world.pos.x; + attention->reticlePos.y = + playerFocusActor->world.pos.y - (playerFocusActor->shape.yOffset * playerFocusActor->scale.y); + attention->reticlePos.z = playerFocusActor->world.pos.z; - if (Math_StepToF(&targetCtx->unk_44, 80.0f, temp6) != 0) { - targetCtx->unk_4B++; + if (attention->reticleSpinCounter == 0) { + f32 step = (500.0f - attention->reticleRadius) * 3.0f; + f32 reticleZoomStep = CLAMP(step, 30.0f, 100.0f); + + if (Math_StepToF(&attention->reticleRadius, 80.0f, reticleZoomStep)) { + // Non-zero counter indicates the reticle is done zooming in + attention->reticleSpinCounter++; } } else { - targetCtx->unk_4B = (targetCtx->unk_4B + 3) | 0x80; - targetCtx->unk_44 = 120.0f; + // Finished zooming in, spin the reticle around the lock-on actor + + // 0x80 is or'd to avoid a value of zero. + // This rotation value gets multiplied by 0x200, which multiplied by 0x80 gives a full turn (0x10000) + attention->reticleSpinCounter = (attention->reticleSpinCounter + 3) | 0x80; + attention->reticleRadius = 120.0f; } } else { - targetCtx->targetedActor = NULL; - Math_StepToF(&targetCtx->unk_44, 500.0f, 80.0f); + // Expand the radius quickly as the reticle is released + attention->reticleActor = NULL; + Math_StepToF(&attention->reticleRadius, 500.0f, 80.0f); } } @@ -688,7 +749,7 @@ void TitleCard_InitPlaceName(PlayState* play, TitleCardContext* titleCtx, void* SceneTableEntry* loadedScene = play->loadedScene; u32 size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart; - if ((size != 0) && (size <= 0x3000)) { + if ((size != 0) && (size <= 0x1000 * LANGUAGE_MAX)) { DMA_REQUEST_SYNC(texture, loadedScene->titleFile.vromStart, size, "../z_actor.c", 2765); } @@ -716,25 +777,38 @@ void TitleCard_Update(PlayState* play, TitleCardContext* titleCtx) { void TitleCard_Draw(PlayState* play, TitleCardContext* titleCtx) { s32 width; s32 height; - s32 unused; - s32 titleX; s32 doubleWidth; - s32 titleY; - s32 titleSecondY; + s32 titleX1; + s32 titleX2; + s32 titleY1; + s32 titleY2; s32 textureLanguageOffset; if (titleCtx->alpha != 0) { width = titleCtx->width; height = titleCtx->height; doubleWidth = width * 2; - titleX = WIDE_INCR((titleCtx->x * 4) - (width * 2), (WIDE_GET_RATIO * 100.0f)); - titleY = (titleCtx->y * 4) - (height * 2); + titleX1 = WIDE_INCR((titleCtx->x * 4) - (width * 2), (WIDE_GET_RATIO * 100.0f)); + titleY1 = (titleCtx->y * 4) - (height * 2); OPEN_DISPS(play->state.gfxCtx, "../z_actor.c", 2824); +#if OOT_NTSC + if (gSaveContext.language == LANGUAGE_JPN) { + textureLanguageOffset = 0; + } else { + textureLanguageOffset = width * height; + } +#else textureLanguageOffset = width * height * gSaveContext.language; - height = (width * height > 0x1000) ? 0x1000 / width : height; - titleSecondY = titleY + (height * 4); +#endif + + if (width * height > 0x1000) { + height = 0x1000 / width; + } + + titleX2 = titleX1 + (doubleWidth * 2); + titleY2 = titleY1 + (height * 4); OVERLAY_DISP = Gfx_SetupDL_52NoCD(OVERLAY_DISP); @@ -745,8 +819,8 @@ void TitleCard_Draw(PlayState* play, TitleCardContext* titleCtx) { width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4) - 1, - G_TX_RENDERTILE, 0, 0, WIDE_DIV((1 << 10), WIDE_GET_RATIO), 1 << 10); + gSPTextureRectangle(OVERLAY_DISP++, titleX1, titleY1, titleX2 - 4, titleY2 - 1, G_TX_RENDERTILE, 0, 0, + WIDE_DIV((1 << 10), WIDE_GET_RATIO), 1 << 10); height = titleCtx->height - height; @@ -756,9 +830,8 @@ void TitleCard_Draw(PlayState* play, TitleCardContext* titleCtx) { G_IM_SIZ_8b, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(OVERLAY_DISP++, titleX, WIDE_INCR(titleSecondY, -1), ((doubleWidth * 2) + titleX) - 4, - titleSecondY + (height * 4) - 1, G_TX_RENDERTILE, 0, 0, - WIDE_DIV((1 << 10), WIDE_GET_RATIO), 1 << 10); + gSPTextureRectangle(OVERLAY_DISP++, titleX1, titleY2, titleX2 - 4, titleY2 + (height * 4) - 1, + G_TX_RENDERTILE, 0, 0, WIDE_DIV((1 << 10), WIDE_GET_RATIO), 1 << 10); } CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 2880); @@ -778,7 +851,7 @@ s32 TitleCard_Clear(PlayState* play, TitleCardContext* titleCtx) { void Actor_Kill(Actor* actor) { actor->draw = NULL; actor->update = NULL; - actor->flags &= ~ACTOR_FLAG_0; + actor->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } void Actor_SetWorldToHome(Actor* actor) { @@ -819,7 +892,7 @@ void Actor_Init(Actor* actor, PlayState* play) { Actor_SetFocus(actor, 0.0f); Math_Vec3f_Copy(&actor->prevPos, &actor->world.pos); Actor_SetScale(actor, 0.01f); - actor->targetMode = 3; + actor->attentionRangeType = ATTENTION_RANGE_3; actor->minVelocityY = -20.0f; actor->xyzDistToPlayerSq = MAXFLOAT; actor->naviEnemyId = NAVI_ENEMY_NONE; @@ -848,8 +921,7 @@ void Actor_Destroy(Actor* actor, PlayState* play) { overlayEntry = actor->overlayEntry; name = overlayEntry->name != NULL ? overlayEntry->name : ""; - // "No Actor class destruct [%s]" - PRINTF("Actorクラス デストラクトがありません [%s]\n" VT_RST, name); + PRINTF(T("Actorクラス デストラクトがありません [%s]\n", "No Actor class destruct [%s]\n") VT_RST, name); #endif } } @@ -980,9 +1052,8 @@ f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint) { /** * Convert `pos` to be relative to the actor's position and yaw, store into `dest`. - * Actor_WorldToActorCoords */ -void func_8002DBD0(Actor* actor, Vec3f* dest, Vec3f* pos) { +void Actor_WorldToActorCoords(Actor* actor, Vec3f* dest, Vec3f* pos) { f32 cosY; f32 sinY; f32 deltaX; @@ -1027,13 +1098,13 @@ int func_8002DD6C(Player* player) { } int func_8002DD78(Player* player) { - return func_8002DD6C(player) && player->unk_834; + return func_8002DD6C(player) && (player->unk_834 != 0); } int func_8002DDA8(PlayState* play) { Player* player = GET_PLAYER(play); - return (player->stateFlags1 & PLAYER_STATE1_11) || func_8002DD78(player); + return (player->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) || func_8002DD78(player); } s32 func_8002DDE4(PlayState* play) { @@ -1060,7 +1131,7 @@ void func_8002DE04(PlayState* play, Actor* actorA, Actor* actorB) { } void func_8002DE74(PlayState* play, Player* player) { - if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_4) && Play_CamIsNotFixed(play)) { + if ((play->roomCtx.curRoom.type != ROOM_TYPE_4) && Play_CamIsNotFixed(play)) { Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_HORSE); } } @@ -1072,7 +1143,8 @@ void Actor_MountHorse(PlayState* play, Player* player, Actor* horse) { } int func_8002DEEC(Player* player) { - return (player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_29)) || (player->csAction != PLAYER_CSACTION_NONE); + return (player->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_29)) || + (player->csAction != PLAYER_CSACTION_NONE); } void func_8002DF18(PlayState* play, Player* player) { @@ -1512,63 +1584,101 @@ PosRot Actor_GetWorldPosShapeRot(Actor* actor) { return worldPosRot; } -f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) { - s16 yawTemp = (s16)(actor->yawTowardsPlayer - 0x8000) - arg2; +/** + * Returns the squared xyz distance from the actor to Player. + * This distance will be weighted if Player is already locked onto another actor. + */ +f32 Attention_WeightedDistToPlayerSq(Actor* actor, Player* player, s16 playerShapeYaw) { + s16 yawTemp = (s16)(actor->yawTowardsPlayer - 0x8000) - playerShapeYaw; s16 yawTempAbs = ABS(yawTemp); - if (player->unk_664 != NULL) { - if ((yawTempAbs > 0x4000) || (actor->flags & ACTOR_FLAG_27)) { + if (player->focusActor != NULL) { + if ((yawTempAbs > 0x4000) || (actor->flags & ACTOR_FLAG_LOCK_ON_DISABLED)) { return MAXFLOAT; } else { - f32 ret = + f32 adjDistSq; + + // The distance returned is scaled down as the player faces more toward the actor. + // At 90 degrees, 100% of the original distance will be returned. + // This scales down linearly to 60% when facing 0 degrees away. + adjDistSq = actor->xyzDistToPlayerSq - actor->xyzDistToPlayerSq * 0.8f * ((0x4000 - yawTempAbs) * (1.0f / 0x8000)); - return ret; + return adjDistSq; } } + // Player has to be facing less than ~60 degrees away from the actor if (yawTempAbs > 0x2AAA) { return MAXFLOAT; } + // Unweighted distSq return actor->xyzDistToPlayerSq; } -typedef struct { - /* 0x0 */ f32 rangeSq; - /* 0x4 */ f32 leashScale; -} TargetRangeParams; // size = 0x8 - -#define TARGET_RANGE(range, leash) \ - { SQ(range), (f32)range / leash } - -TargetRangeParams D_80115FF8[] = { - TARGET_RANGE(70, 140), TARGET_RANGE(170, 255), TARGET_RANGE(280, 5600), TARGET_RANGE(350, 525), - TARGET_RANGE(700, 1050), TARGET_RANGE(1000, 1500), TARGET_RANGE(100, 105.36842), TARGET_RANGE(140, 163.33333), - TARGET_RANGE(240, 576), TARGET_RANGE(280, 280000), +typedef struct AttentionRangeParams { + /* 0x0 */ f32 attentionRangeSq; + /* 0x4 */ f32 lockOnLeashScale; +} AttentionRangeParams; // size = 0x8 + +#define ATTENTION_RANGES(range, lockOnLeashRange) \ + { SQ(range), (f32)range / lockOnLeashRange } + +AttentionRangeParams sAttentionRanges[ATTENTION_RANGE_MAX] = { + ATTENTION_RANGES(70, 140), // ATTENTION_RANGE_0 + ATTENTION_RANGES(170, 255), // ATTENTION_RANGE_1 + ATTENTION_RANGES(280, 5600), // ATTENTION_RANGE_2 + ATTENTION_RANGES(350, 525), // ATTENTION_RANGE_3 + ATTENTION_RANGES(700, 1050), // ATTENTION_RANGE_4 + ATTENTION_RANGES(1000, 1500), // ATTENTION_RANGE_5 + ATTENTION_RANGES(100, 105.36842), // ATTENTION_RANGE_6 + ATTENTION_RANGES(140, 163.33333), // ATTENTION_RANGE_7 + ATTENTION_RANGES(240, 576), // ATTENTION_RANGE_8 + ATTENTION_RANGES(280, 280000), // ATTENTION_RANGE_9 }; -u32 func_8002F090(Actor* actor, f32 arg1) { - return arg1 < D_80115FF8[actor->targetMode].rangeSq; +/** + * Checks if an actor at `distSq` is inside the range specified by its `attentionRangeType`. + * + * Note that this gets used for both the attention range check and for the lock-on leash range check. + * Despite how the data is presented in `sAttentionRanges`, the leash range is stored as a scale factor value. + * When checking the leash range, this scale factor is applied to the input distance and checked against + * the base `attentionRangeSq` value, which was used to initiate the lock-on in the first place. + */ +u32 Attention_ActorIsInRange(Actor* actor, f32 distSq) { + return distSq < sAttentionRanges[actor->attentionRangeType].attentionRangeSq; } -s32 func_8002F0C8(Actor* actor, Player* player, s32 flag) { - if ((actor->update == NULL) || !(actor->flags & ACTOR_FLAG_0)) { +/** + * Returns true if an actor lock-on should be released. + * This function does not actually release the lock-on, as that is Player's responsibility. + * + * If an actor's update function is NULL or `ACTOR_FLAG_ATTENTION_ENABLED` is unset, the lock-on should be released. + * + * There is also a check for Player exceeding the lock-on leash distance. + * Note that this check will be ignored if `ignoreLeash` is true. + * + */ +s32 Attention_ShouldReleaseLockOn(Actor* actor, Player* player, s32 ignoreLeash) { + if ((actor->update == NULL) || !(actor->flags & ACTOR_FLAG_ATTENTION_ENABLED)) { return true; } - if (!flag) { - s16 var = (s16)(actor->yawTowardsPlayer - 0x8000) - player->actor.shape.rot.y; - s16 abs_var = ABS(var); - f32 dist; + if (!ignoreLeash) { + s16 yawDiff = (s16)(actor->yawTowardsPlayer - 0x8000) - player->actor.shape.rot.y; + s16 yawDiffAbs = ABS(yawDiff); + f32 distSq; - if ((player->unk_664 == NULL) && (abs_var > 0x2AAA)) { - dist = MAXFLOAT; + if ((player->focusActor == NULL) && (yawDiffAbs > 0x2AAA)) { + // This function is only called (and is only relevant) when `player->focusActor != NULL`. + // This is unreachable. + distSq = MAXFLOAT; } else { - dist = actor->xyzDistToPlayerSq; + distSq = actor->xyzDistToPlayerSq; } - return !func_8002F090(actor, D_80115FF8[actor->targetMode].leashScale * dist); + return !Attention_ActorIsInRange(actor, sAttentionRanges[actor->attentionRangeType].lockOnLeashScale * distSq); } return false; @@ -1604,7 +1714,7 @@ s32 Actor_OfferTalkExchange(Actor* actor, PlayState* play, f32 xzRange, f32 yRan Player* player = GET_PLAYER(play); if ((player->actor.flags & ACTOR_FLAG_TALK) || ((exchangeItemId != EXCH_ITEM_NONE) && Player_InCsMode(play)) || - (!actor->isTargeted && + (!actor->isLockedOn && ((yRange < fabsf(actor->yDistToPlayer)) || (player->talkActorDistance < actor->xzDistToPlayer) || (xzRange < actor->xzDistToPlayer)))) { return false; @@ -1698,12 +1808,13 @@ u32 Actor_HasParent(Actor* actor, PlayState* play) { s32 Actor_OfferGetItem(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange, f32 yRange) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_12 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | - PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_20 | PLAYER_STATE1_21)) && + if (!(player->stateFlags1 & + (PLAYER_STATE1_DEAD | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_13 | PLAYER_STATE1_14 | + PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_20 | PLAYER_STATE1_21)) && Player_GetExplosiveHeld(player) < 0) { if ((((player->heldActor != NULL) || (actor == player->talkActor)) && (getItemId > GI_NONE) && (getItemId < GI_MAX)) || - (!(player->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_29)))) { + (!(player->stateFlags1 & (PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_29)))) { if ((actor->xzDistToPlayer < xzRange) && (fabsf(actor->yDistToPlayer) < yRange)) { s16 yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y; s32 absYawDiff = ABS(yawDiff); @@ -1772,8 +1883,8 @@ u32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide) { Player* player = GET_PLAYER(play); if (!(player->stateFlags1 & - (PLAYER_STATE1_7 | PLAYER_STATE1_11 | PLAYER_STATE1_12 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | - PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_20 | PLAYER_STATE1_21))) { + (PLAYER_STATE1_DEAD | PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_13 | + PLAYER_STATE1_14 | PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_20 | PLAYER_STATE1_21))) { player->rideActor = horse; player->mountSide = mountSide; return true; @@ -1790,30 +1901,79 @@ s32 Actor_NotMounted(PlayState* play, Actor* horse) { } } -void func_8002F698(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6) { +/** + * Sets the player's knockback properties + * + * @param play + * @param actor source actor applying knockback damage + * @param speed + * @param rot the direction the player will be pushed + * @param yVelocity + * @param type PlayerKnockbackType + * @param damage additional amount of damage to deal to the player + */ +void Actor_SetPlayerKnockback(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 type, u32 damage) { Player* player = GET_PLAYER(play); - player->unk_8A0 = arg6; - player->unk_8A1 = arg5; - player->unk_8A4 = arg2; - player->unk_8A2 = arg3; - player->unk_8A8 = arg4; + player->knockbackDamage = damage; + player->knockbackType = type; + player->knockbackSpeed = speed; + player->knockbackRot = rot; + player->knockbackYVelocity = yVelocity; } -void func_8002F6D4(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5) { - func_8002F698(play, actor, arg2, arg3, arg4, 2, arg5); +/** + * Knocks the player to the ground + * + * @param play + * @param actor source actor applying knockback damage + * @param speed + * @param rot the direction the player will be pushed + * @param yVelocity + * @param damage additional amount of damage to deal to the player + */ +void Actor_SetPlayerKnockbackLarge(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 damage) { + Actor_SetPlayerKnockback(play, actor, speed, rot, yVelocity, PLAYER_KNOCKBACK_LARGE, damage); } -void func_8002F71C(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4) { - func_8002F6D4(play, actor, arg2, arg3, arg4, 0); +/** + * Knocks the player to the ground, without applying additional damage + * + * @param play + * @param actor source actor applying knockback damage + * @param speed + * @param rot the direction the player will be pushed + * @param yVelocity + */ +void Actor_SetPlayerKnockbackLargeNoDamage(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity) { + Actor_SetPlayerKnockbackLarge(play, actor, speed, rot, yVelocity, 0); } -void func_8002F758(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5) { - func_8002F698(play, actor, arg2, arg3, arg4, 1, arg5); +/** + * Knocks the player back while keeping them on their feet + * + * @param play + * @param actor + * @param speed overridden + * @param rot the direction the player will be pushed + * @param yVelocity overridden + * @param damage additional amount of damage to deal to the player + */ +void Actor_SetPlayerKnockbackSmall(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 damage) { + Actor_SetPlayerKnockback(play, actor, speed, rot, yVelocity, PLAYER_KNOCKBACK_SMALL, damage); } -void func_8002F7A0(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4) { - func_8002F758(play, actor, arg2, arg3, arg4, 0); +/** + * Knocks the player back while keeping them on their feet, without applying additional damage + * + * @param play + * @param actor + * @param speed overridden + * @param rot the direction the player will be pushed + * @param yVelocity overridden + */ +void Actor_SetPlayerKnockbackSmallNoDamage(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity) { + Actor_SetPlayerKnockbackSmall(play, actor, speed, rot, yVelocity, 0); } /** @@ -1831,7 +1991,7 @@ void Actor_PlaySfx(Actor* actor, u16 sfxId) { Sfx_PlaySfxAtPos(&actor->projectedPos, sfxId); } -void func_8002F850(PlayState* play, Actor* actor) { +void Actor_PlaySfx_SurfaceBomb(PlayState* play, Actor* actor) { s32 surfaceSfxOffset; if (actor->bgCheckFlags & BGCHECKFLAG_WATER) { @@ -1848,32 +2008,45 @@ void func_8002F850(PlayState* play, Actor* actor) { Sfx_PlaySfxAtPos(&actor->projectedPos, NA_SE_PL_WALK_GROUND + surfaceSfxOffset); } -void func_8002F8F0(Actor* actor, u16 sfxId) { +/** + * Play a sfx at the actor's position using the shared flagged audio system + */ +void Actor_PlaySfx_Flagged2(Actor* actor, u16 sfxId) { actor->sfx = sfxId; - actor->flags |= ACTOR_FLAG_19; - actor->flags &= ~(ACTOR_FLAG_20 | ACTOR_FLAG_21 | ACTOR_FLAG_28); + actor->flags |= ACTOR_FLAG_SFX_ACTOR_POS_2; + actor->flags &= ~(ACTOR_AUDIO_FLAG_SFX_CENTERED_1 | ACTOR_AUDIO_FLAG_SFX_CENTERED_2 | ACTOR_FLAG_SFX_TIMER); } -void func_8002F91C(Actor* actor, u16 sfxId) { +/** + * Play a sfx at the center of the screen using the shared flagged audio system + */ +void Actor_PlaySfx_FlaggedCentered1(Actor* actor, u16 sfxId) { actor->sfx = sfxId; - actor->flags |= ACTOR_FLAG_20; - actor->flags &= ~(ACTOR_FLAG_19 | ACTOR_FLAG_21 | ACTOR_FLAG_28); + actor->flags |= ACTOR_AUDIO_FLAG_SFX_CENTERED_1; + actor->flags &= ~(ACTOR_FLAG_SFX_ACTOR_POS_2 | ACTOR_AUDIO_FLAG_SFX_CENTERED_2 | ACTOR_FLAG_SFX_TIMER); } -void func_8002F948(Actor* actor, u16 sfxId) { +/** + * Play a sfx at the center of the screen using the shared flagged audio system + */ +void Actor_PlaySfx_FlaggedCentered2(Actor* actor, u16 sfxId) { actor->sfx = sfxId; - actor->flags |= ACTOR_FLAG_21; - actor->flags &= ~(ACTOR_FLAG_19 | ACTOR_FLAG_20 | ACTOR_FLAG_28); + actor->flags |= ACTOR_AUDIO_FLAG_SFX_CENTERED_2; + actor->flags &= ~(ACTOR_FLAG_SFX_ACTOR_POS_2 | ACTOR_AUDIO_FLAG_SFX_CENTERED_1 | ACTOR_FLAG_SFX_TIMER); } -void func_8002F974(Actor* actor, u16 sfxId) { - actor->flags &= ~(ACTOR_FLAG_19 | ACTOR_FLAG_20 | ACTOR_FLAG_21 | ACTOR_FLAG_28); +/** + * Play a sfx at the actor's position using the shared flagged audio system + */ +void Actor_PlaySfx_Flagged(Actor* actor, u16 sfxId) { + actor->flags &= ~(ACTOR_FLAG_SFX_ACTOR_POS_2 | ACTOR_AUDIO_FLAG_SFX_CENTERED_1 | ACTOR_AUDIO_FLAG_SFX_CENTERED_2 | + ACTOR_FLAG_SFX_TIMER); actor->sfx = sfxId; } -void func_8002F994(Actor* actor, s32 timer) { - actor->flags |= ACTOR_FLAG_28; - actor->flags &= ~(ACTOR_FLAG_19 | ACTOR_FLAG_20 | ACTOR_FLAG_21); +void Actor_PlaySfx_FlaggedTimer(Actor* actor, s32 timer) { + actor->flags |= ACTOR_FLAG_SFX_TIMER; + actor->flags &= ~(ACTOR_FLAG_SFX_ACTOR_POS_2 | ACTOR_AUDIO_FLAG_SFX_CENTERED_1 | ACTOR_AUDIO_FLAG_SFX_CENTERED_2); // The sfx field is not used for an actual sound effect here. // Instead, it controls the tick speed of the timer sound effect. @@ -1889,7 +2062,7 @@ void func_8002F994(Actor* actor, s32 timer) { // Tests if something hit Jabu Jabu surface, displaying hit splash and playing sfx if true s32 func_8002F9EC(PlayState* play, Actor* actor, CollisionPoly* poly, s32 bgId, Vec3f* pos) { if (SurfaceType_GetFloorType(&play->colCtx, poly, bgId) == FLOOR_TYPE_8) { - play->roomCtx.unk_74[0] = 1; + play->roomCtx.drawParams[0] = 1; CollisionCheck_BlueBlood(play, NULL, pos); Actor_PlaySfx(actor, NA_SE_IT_WALL_HIT_BUYO); return true; @@ -1898,7 +2071,8 @@ s32 func_8002F9EC(PlayState* play, Actor* actor, CollisionPoly* poly, s32 bgId, return false; } -#pragma increment_block_number 22 +#pragma increment_block_number "gc-eu:22 gc-eu-mq:22 gc-jp:22 gc-jp-ce:22 gc-jp-mq:22 gc-us:22 gc-us-mq:22" \ + "ntsc-1.2:22 pal-1.0:22 pal-1.1:22" // Local data used for Farore's Wind light (stored in BSS) LightInfo D_8015BC00; @@ -2067,15 +2241,13 @@ void Actor_DrawFaroresWindPointer(PlayState* play) { gDPSetEnvColor(POLY_XLU_DISP++, 100, 200, 0, 255); Matrix_RotateZ(BINANG_TO_RAD_ALT2((play->gameplayFrames * 1500) & 0xFFFF), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 5458), - G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_actor.c", 5458); gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL); Matrix_Pop(); Matrix_RotateZ(BINANG_TO_RAD_ALT2(~((play->gameplayFrames * 1200) & 0xFFFF)), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 5463), - G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_actor.c", 5463); gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL); } @@ -2130,35 +2302,35 @@ void Actor_InitContext(PlayState* play, ActorContext* actorCtx, ActorEntry* play actorCtx->absoluteSpace = NULL; Actor_SpawnEntry(actorCtx, playerEntry, play); - func_8002C0C0(&actorCtx->targetCtx, actorCtx->actorLists[ACTORCAT_PLAYER].head, play); + Attention_Init(&actorCtx->attention, actorCtx->actorLists[ACTORCAT_PLAYER].head, play); func_8002FA60(play); } u32 sCategoryFreezeMasks[ACTORCAT_MAX] = { // ACTORCAT_SWITCH - PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28, + PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_28, // ACTORCAT_BG - PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28, + PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_28, // ACTORCAT_PLAYER 0, // ACTORCAT_EXPLOSIVE - PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_10 | PLAYER_STATE1_28, + PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_10 | PLAYER_STATE1_28, // ACTORCAT_NPC - PLAYER_STATE1_7, + PLAYER_STATE1_DEAD, // ACTORCAT_ENEMY - PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29, + PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29, // ACTORCAT_PROP - PLAYER_STATE1_7 | PLAYER_STATE1_28, + PLAYER_STATE1_DEAD | PLAYER_STATE1_28, // ACTORCAT_ITEMACTION 0, // ACTORCAT_MISC - PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29, + PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29, // ACTORCAT_BOSS - PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_10 | PLAYER_STATE1_28, + PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_10 | PLAYER_STATE1_28, // ACTORCAT_DOOR 0, // ACTORCAT_CHEST - PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28, + PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_28, }; void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { @@ -2209,7 +2381,7 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { requiredActorFlag = ACTOR_FLAG_25; } - if ((player->stateFlags1 & PLAYER_STATE1_6) && ((player->actor.textId & 0xFF00) != 0x600)) { + if ((player->stateFlags1 & PLAYER_STATE1_TALKING) && ((player->actor.textId & 0xFF00) != 0x600)) { sp74 = player->talkActor; } @@ -2257,14 +2429,14 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { actor->flags &= ~ACTOR_FLAG_24; if ((DECR(actor->freezeTimer) == 0) && (actor->flags & (ACTOR_FLAG_4 | ACTOR_FLAG_6))) { - if (actor == player->unk_664) { - actor->isTargeted = true; + if (actor == player->focusActor) { + actor->isLockedOn = true; } else { - actor->isTargeted = false; + actor->isLockedOn = false; } - if ((actor->targetPriority != 0) && (player->unk_664 == NULL)) { - actor->targetPriority = 0; + if ((actor->attentionPriority != 0) && (player->focusActor == NULL)) { + actor->attentionPriority = 0; } Actor_SetObjectDependency(play, actor); @@ -2286,22 +2458,23 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { } } - actor = player->unk_664; + actor = player->focusActor; if ((actor != NULL) && (actor->update == NULL)) { actor = NULL; - func_8008EDF0(player); + Player_ReleaseLockOn(player); } - if ((actor == NULL) || (player->unk_66C < 5)) { + if ((actor == NULL) || (player->zTargetActiveTimer < 5)) { actor = NULL; - if (actorCtx->targetCtx.unk_4B != 0) { - actorCtx->targetCtx.unk_4B = 0; + + if (actorCtx->attention.reticleSpinCounter != 0) { + actorCtx->attention.reticleSpinCounter = 0; Sfx_PlaySfxCentered(NA_SE_SY_LOCK_OFF); } } - func_8002C7BC(&actorCtx->targetCtx, player, actor, play); + Attention_Update(&actorCtx->attention, player, actor, play); TitleCard_Update(play, &actorCtx->titleCtx); DynaPoly_UpdateBgActorTransforms(play, &play->colCtx.dyna); } @@ -2311,25 +2484,25 @@ void Actor_FaultPrint(Actor* actor, char* command) { char* name; if ((actor == NULL) || (actor->overlayEntry == NULL)) { - FaultDrawer_SetCursor(48, 24); - FaultDrawer_Printf("ACTOR NAME is NULL"); + Fault_SetCursor(48, 24); + Fault_Printf("ACTOR NAME is NULL"); } #if IS_DEBUG overlayEntry = actor->overlayEntry; name = overlayEntry->name != NULL ? overlayEntry->name : ""; - PRINTF("アクターの名前(%08x:%s)\n", actor, name); // "Actor name (%08x:%s)" + PRINTF(T("アクターの名前(%08x:%s)\n", "Actor name (%08x:%s)\n"), actor, name); #else name = ""; #endif if (command != NULL) { - PRINTF("コメント:%s\n", command); // "Command:%s" + PRINTF(T("コメント:%s\n", "Command: %s\n"), command); } - FaultDrawer_SetCursor(48, 24); - FaultDrawer_Printf("ACTOR NAME %08x:%s", actor, name); + Fault_SetCursor(48, 24); + Fault_Printf("ACTOR NAME %08x:%s", actor, name); } void Actor_Draw(PlayState* play, Actor* actor) { @@ -2399,15 +2572,15 @@ void Actor_Draw(PlayState* play, Actor* actor) { Fault_RemoveClient(&faultClient); } -void func_80030ED8(Actor* actor) { - if (actor->flags & ACTOR_FLAG_19) { +void Actor_UpdateFlaggedAudio(Actor* actor) { + if (actor->flags & ACTOR_FLAG_SFX_ACTOR_POS_2) { Audio_PlaySfxGeneral(actor->sfx, &actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - } else if (actor->flags & ACTOR_FLAG_20) { + } else if (actor->flags & ACTOR_AUDIO_FLAG_SFX_CENTERED_1) { Sfx_PlaySfxCentered(actor->sfx); - } else if (actor->flags & ACTOR_FLAG_21) { + } else if (actor->flags & ACTOR_AUDIO_FLAG_SFX_CENTERED_2) { Sfx_PlaySfxCentered2(actor->sfx); - } else if (actor->flags & ACTOR_FLAG_28) { + } else if (actor->flags & ACTOR_FLAG_SFX_TIMER) { func_800F4C58(&gSfxDefaultPos, NA_SE_SY_TIMER - SFX_FLAG, (s8)(actor->sfx - 1)); } else { Sfx_PlaySfxAtPos(&actor->projectedPos, actor->sfx); @@ -2581,7 +2754,7 @@ void func_800315AC(PlayState* play, ActorContext* actorCtx) { if (!IS_DEBUG || (HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(69) == 0)) { if (actor->sfx != 0) { - func_80030ED8(actor); + Actor_UpdateFlaggedAudio(actor); } } @@ -2731,7 +2904,7 @@ void func_80031C3C(ActorContext* actorCtx, PlayState* play) { } } - ACTOR_DEBUG_PRINTF("絶対魔法領域解放\n"); // "Absolute magic field deallocation" + ACTOR_DEBUG_PRINTF(T("絶対魔法領域解放\n", "Absolute magic field deallocation\n")); if (actorCtx->absoluteSpace != NULL) { ZELDA_ARENA_FREE(actorCtx->absoluteSpace, "../z_actor.c", 6731); @@ -2801,24 +2974,24 @@ void Actor_FreeOverlay(ActorOverlay* actorOverlay) { PRINTF(VT_FGCOL(CYAN)); if (actorOverlay->numLoaded == 0) { - ACTOR_DEBUG_PRINTF("アクタークライアントが0になりました\n"); // "Actor client is now 0" + ACTOR_DEBUG_PRINTF(T("アクタークライアントが0になりました\n", "Actor clients are now 0\n")); if (actorOverlay->loadedRamAddr != NULL) { if (actorOverlay->allocType & ACTOROVL_ALLOC_PERSISTENT) { - ACTOR_DEBUG_PRINTF("オーバーレイ解放しません\n"); // "Overlay will not be deallocated" + ACTOR_DEBUG_PRINTF(T("オーバーレイ解放しません\n", "Overlay will not be deallocated\n")); } else if (actorOverlay->allocType & ACTOROVL_ALLOC_ABSOLUTE) { - // "Absolute magic field reserved, so deallocation will not occur" - ACTOR_DEBUG_PRINTF("絶対魔法領域確保なので解放しません\n"); + ACTOR_DEBUG_PRINTF(T("絶対魔法領域確保なので解放しません\n", + "Absolute magic field reserved, so deallocation will not occur\n")); actorOverlay->loadedRamAddr = NULL; } else { - ACTOR_DEBUG_PRINTF("オーバーレイ解放します\n"); // "Overlay deallocated" + ACTOR_DEBUG_PRINTF(T("オーバーレイ解放します\n", "Overlay deallocated\n")); ZELDA_ARENA_FREE(actorOverlay->loadedRamAddr, "../z_actor.c", 6834); actorOverlay->loadedRamAddr = NULL; } } } else { - // "%d of actor client remains" - ACTOR_DEBUG_PRINTF("アクタークライアントはあと %d 残っています\n", actorOverlay->numLoaded); + ACTOR_DEBUG_PRINTF(T("アクタークライアントはあと %d 残っています\n", "%d of actor client remaining\n"), + actorOverlay->numLoaded); } PRINTF(VT_RST); @@ -2828,7 +3001,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos s16 rotY, s16 rotZ, s16 params) { s32 pad; Actor* actor; - ActorInit* actorInit; + ActorProfile* profile; s32 objectSlot; ActorOverlay* overlayEntry; uintptr_t temp; @@ -2844,32 +3017,31 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos overlaySize = (uintptr_t)overlayEntry->vramEnd - (uintptr_t)overlayEntry->vramStart; - // "Actor class addition [%d:%s]" - ACTOR_DEBUG_PRINTF("アクタークラス追加 [%d:%s]\n", actorId, name); + ACTOR_DEBUG_PRINTF(T("アクタークラス追加 [%d:%s]\n", "Actor class addition [%d:%s]\n"), actorId, name); if (actorCtx->total > ACTOR_NUMBER_MAX) { - // "Actor set number exceeded" - PRINTF(VT_COL(YELLOW, BLACK) "Actorセット数オーバー\n" VT_RST); + PRINTF(VT_COL(YELLOW, BLACK) T("Actorセット数オーバー\n", "Actor set number exceeded\n") VT_RST); return NULL; } if (overlayEntry->vramStart == NULL) { - ACTOR_DEBUG_PRINTF("オーバーレイではありません\n"); // "Not an overlay" + ACTOR_DEBUG_PRINTF(T("オーバーレイではありません\n", "Not an overlay\n")); - actorInit = overlayEntry->initInfo; + profile = overlayEntry->profile; } else { if (overlayEntry->loadedRamAddr != NULL) { - ACTOR_DEBUG_PRINTF("既にロードされています\n"); // "Already loaded" + ACTOR_DEBUG_PRINTF(T("既にロードされています\n", "Already loaded\n")); } else { if (overlayEntry->allocType & ACTOROVL_ALLOC_ABSOLUTE) { ASSERT(overlaySize <= ACTOROVL_ABSOLUTE_SPACE_SIZE, "actor_segsize <= AM_FIELD_SIZE", "../z_actor.c", 6934); if (actorCtx->absoluteSpace == NULL) { - // "AMF: absolute magic field" - actorCtx->absoluteSpace = ZELDA_ARENA_MALLOC_R(ACTOROVL_ABSOLUTE_SPACE_SIZE, "AMF:絶対魔法領域", 0); - // "Absolute magic field reservation - %d bytes reserved" - ACTOR_DEBUG_PRINTF("絶対魔法領域確保 %d バイト確保\n", ACTOROVL_ABSOLUTE_SPACE_SIZE); + actorCtx->absoluteSpace = ZELDA_ARENA_MALLOC_R( + ACTOROVL_ABSOLUTE_SPACE_SIZE, T("AMF:絶対魔法領域", "AMF: absolute magic field"), 0); + ACTOR_DEBUG_PRINTF( + T("絶対魔法領域確保 %d バイト確保\n", "Absolute magic field allocation %d bytes allocated\n"), + ACTOROVL_ABSOLUTE_SPACE_SIZE); } overlayEntry->loadedRamAddr = actorCtx->absoluteSpace; @@ -2880,8 +3052,8 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos } if (overlayEntry->loadedRamAddr == NULL) { - // "Cannot reserve actor program memory" - PRINTF(VT_COL(RED, WHITE) "Actorプログラムメモリが確保できません\n" VT_RST); + PRINTF(VT_COL(RED, WHITE) T("Actorプログラムメモリが確保できません\n", + "Cannot reserve actor program memory\n") VT_RST); return NULL; } @@ -2899,30 +3071,30 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos overlayEntry->numLoaded = 0; } - actorInit = (void*)(uintptr_t)((overlayEntry->initInfo != NULL) - ? (void*)((uintptr_t)overlayEntry->initInfo - - (intptr_t)((uintptr_t)overlayEntry->vramStart - - (uintptr_t)overlayEntry->loadedRamAddr)) - : NULL); + profile = (void*)(uintptr_t)((overlayEntry->profile != NULL) + ? (void*)((uintptr_t)overlayEntry->profile - + (intptr_t)((uintptr_t)overlayEntry->vramStart - + (uintptr_t)overlayEntry->loadedRamAddr)) + : NULL); } - objectSlot = Object_GetSlot(&play->objectCtx, actorInit->objectId); + objectSlot = Object_GetSlot(&play->objectCtx, profile->objectId); if ((objectSlot < 0) || - ((actorInit->category == ACTORCAT_ENEMY) && Flags_GetClear(play, play->roomCtx.curRoom.num))) { - // "No data bank!! (profilep->bank=%d)" - PRINTF(VT_COL(RED, WHITE) "データバンク無し!!<データバンク=%d>(profilep->bank=%d)\n" VT_RST, objectSlot, - actorInit->objectId); + ((profile->category == ACTORCAT_ENEMY) && Flags_GetClear(play, play->roomCtx.curRoom.num))) { + PRINTF(VT_COL(RED, WHITE) T("データバンク無し!!<データバンク=%d>(profilep->bank=%d)\n", + "No data bank!! (profilep->bank=%d)\n") VT_RST, + objectSlot, profile->objectId); Actor_FreeOverlay(overlayEntry); return NULL; } - actor = ZELDA_ARENA_MALLOC(actorInit->instanceSize, name, 1); + actor = ZELDA_ARENA_MALLOC(profile->instanceSize, name, 1); if (actor == NULL) { - // "Actor class cannot be reserved! %s " - PRINTF(VT_COL(RED, WHITE) "Actorクラス確保できません! %s <サイズ=%dバイト>\n", VT_RST, name, - actorInit->instanceSize); + PRINTF(VT_COL(RED, WHITE) T("Actorクラス確保できません! %s <サイズ=%dバイト>\n", + "Actor class cannot be reserved! %s \n"), + VT_RST, name, profile->instanceSize); Actor_FreeOverlay(overlayEntry); return NULL; } @@ -2933,35 +3105,38 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos if (1) {} - // "Actor client No. %d" - ACTOR_DEBUG_PRINTF("アクタークライアントは %d 個目です\n", overlayEntry->numLoaded); + ACTOR_DEBUG_PRINTF(T("アクタークライアントは %d 個目です\n", "Actor client No. %d\n"), overlayEntry->numLoaded); - Lib_MemSet((u8*)actor, actorInit->instanceSize, 0); + Lib_MemSet((u8*)actor, profile->instanceSize, 0); actor->overlayEntry = overlayEntry; - actor->id = actorInit->id; - actor->flags = actorInit->flags; + actor->id = profile->id; + actor->flags = profile->flags; - if (actorInit->id == ACTOR_EN_PART) { + if (profile->id == ACTOR_EN_PART) { actor->objectSlot = rotZ; rotZ = 0; } else { actor->objectSlot = objectSlot; } - actor->init = actorInit->init; - actor->destroy = actorInit->destroy; - actor->update = actorInit->update; - actor->draw = actorInit->draw; + actor->init = profile->init; + actor->destroy = profile->destroy; + actor->update = profile->update; + actor->draw = profile->draw; + actor->room = play->roomCtx.curRoom.num; + actor->home.pos.x = posX; actor->home.pos.y = posY; actor->home.pos.z = posZ; + actor->home.rot.x = rotX; actor->home.rot.y = rotY; actor->home.rot.z = rotZ; + actor->params = params; - Actor_AddToCategory(actorCtx, actor, actorInit->category); + Actor_AddToCategory(actorCtx, actor, profile->category); temp = gSegments[6]; Actor_Init(actor, play); @@ -2993,8 +3168,8 @@ void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx) { u8 numActors; s32 i; - transitionActor = play->transiActorCtx.list; - numActors = play->transiActorCtx.numActors; + transitionActor = play->transitionActors.list; + numActors = play->transitionActors.count; for (i = 0; i < numActors; i++) { if (transitionActor->id >= 0) { @@ -3009,7 +3184,7 @@ void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx) { (i << TRANSITION_ACTOR_PARAMS_INDEX_SHIFT) + transitionActor->params); transitionActor->id = -transitionActor->id; - numActors = play->transiActorCtx.numActors; + numActors = play->transitionActors.count; } } transitionActor++; @@ -3032,23 +3207,23 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) { overlayEntry = actor->overlayEntry; name = overlayEntry->name != NULL ? overlayEntry->name : ""; - ACTOR_DEBUG_PRINTF("アクタークラス削除 [%s]\n", name); // "Actor class deleted [%s]" + ACTOR_DEBUG_PRINTF(T("アクタークラス削除 [%s]\n", "Actor class deleted [%s]\n"), name); - if ((player != NULL) && (actor == player->unk_664)) { - func_8008EDF0(player); + if ((player != NULL) && (actor == player->focusActor)) { + Player_ReleaseLockOn(player); Camera_RequestMode(Play_GetCamera(play, Play_GetActiveCamId(play)), CAM_MODE_NORMAL); } - if (actor == actorCtx->targetCtx.arrowPointedActor) { - actorCtx->targetCtx.arrowPointedActor = NULL; + if (actor == actorCtx->attention.naviHoverActor) { + actorCtx->attention.naviHoverActor = NULL; } - if (actor == actorCtx->targetCtx.unk_8C) { - actorCtx->targetCtx.unk_8C = NULL; + if (actor == actorCtx->attention.forcedLockOnActor) { + actorCtx->attention.forcedLockOnActor = NULL; } - if (actor == actorCtx->targetCtx.bgmEnemy) { - actorCtx->targetCtx.bgmEnemy = NULL; + if (actor == actorCtx->attention.bgmEnemy) { + actorCtx->attention.bgmEnemy = NULL; } Audio_StopSfxByPos(&actor->projectedPos); @@ -3059,7 +3234,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) { ZELDA_ARENA_FREE(actor, "../z_actor.c", 7242); if (overlayEntry->vramStart == NULL) { - ACTOR_DEBUG_PRINTF("オーバーレイではありません\n"); // "Not an overlay" + ACTOR_DEBUG_PRINTF(T("オーバーレイではありません\n", "Not an overlay\n")); } else { ASSERT(overlayEntry->loadedRamAddr != NULL, "actor_dlftbl->allocp != NULL", "../z_actor.c", 7251); ASSERT(overlayEntry->numLoaded > 0, "actor_dlftbl->clients > 0", "../z_actor.c", 7252); @@ -3076,58 +3251,88 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) { return newHead; } -int func_80032880(PlayState* play, Actor* actor) { - s16 sp1E; - s16 sp1C; +/** + * Checks that an actor is on-screen enough to be considered an attention actor. + * + * Note that the screen bounds checks are larger than the actual screen region + * to give room for error. + */ +int Attention_ActorOnScreen(PlayState* play, Actor* actor) { + s16 x; + s16 y; + + Actor_GetScreenPos(play, actor, &x, &y); - Actor_GetScreenPos(play, actor, &sp1E, &sp1C); +#define X_LEEWAY 20 +#define Y_LEEWAY 160 - return (sp1E > -20) && (sp1E < 340) && (sp1C > -160) && (sp1C < 400); + return (x > 0 - X_LEEWAY) && (x < SCREEN_WIDTH + X_LEEWAY) && (y > 0 - Y_LEEWAY) && (y < SCREEN_HEIGHT + Y_LEEWAY); } -Actor* D_8015BBE8; -Actor* D_8015BBEC; -f32 D_8015BBF0; -f32 sbgmEnemyDistSq; -s32 D_8015BBF8; -s16 D_8015BBFC; +Actor* sNearestAttentionActor; +Actor* sPrioritizedAttentionActor; +f32 sNearestAttentionActorDistSq; +f32 sBgmEnemyDistSq; +s32 sHighestAttentionPriority; +s16 sAttentionPlayerRotY; -void func_800328D4(PlayState* play, ActorContext* actorCtx, Player* player, u32 actorCategory) { - f32 var; +/** + * Search for attention actors within the specified category. + * + * To be considered an attention actor the actor needs to: + * - Have a non-NULL update function (still active) + * - Not be player (this is technically a redundant check because the PLAYER category is never searched) + * - Have `ACTOR_FLAG_ATTENTION_ENABLED` set + * - Not be the current focus actor + * - Be the closest attention actor found so far + * - Be within range, specified by attentionRangeType + * - Be roughly on-screen + * - Not be blocked by a surface + * + * If an actor has a priority value set and the value is the lowest found so far, it will be set as the prioritized + * attention actor. Otherwise, it is set as the nearest attention actor. + * + * This function is expected to be called with almost every actor category in each cycle. On a new cycle its global + * variables must be reset by the caller, otherwise the information of the previous cycle will be retained. + */ +void Attention_FindActorInCategory(PlayState* play, ActorContext* actorCtx, Player* player, u32 actorCategory) { + f32 distSq; Actor* actor; - Actor* sp84; - CollisionPoly* sp80; - s32 sp7C; - Vec3f sp70; + Actor* playerFocusActor; + CollisionPoly* poly; + s32 bgId; + Vec3f lineTestResultPos; actor = actorCtx->actorLists[actorCategory].head; - sp84 = player->unk_664; + playerFocusActor = player->focusActor; while (actor != NULL) { - if ((actor->update != NULL) && ((Player*)actor != player) && CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_0)) { - - // This block below is for determining the closest actor to player in determining the volume - // used while playing enemy background music - if ((actorCategory == ACTORCAT_ENEMY) && CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2) && - (actor->xyzDistToPlayerSq < SQ(500.0f)) && (actor->xyzDistToPlayerSq < sbgmEnemyDistSq)) { - actorCtx->targetCtx.bgmEnemy = actor; - sbgmEnemyDistSq = actor->xyzDistToPlayerSq; - } - - if (actor != sp84) { - var = func_8002EFC0(actor, player, D_8015BBFC); - if ((var < D_8015BBF0) && func_8002F090(actor, var) && func_80032880(play, actor) && - (!BgCheck_CameraLineTest1(&play->colCtx, &player->actor.focus.pos, &actor->focus.pos, &sp70, &sp80, - 1, 1, 1, 1, &sp7C) || - SurfaceType_IsIgnoredByProjectiles(&play->colCtx, sp80, sp7C))) { - if (actor->targetPriority != 0) { - if (actor->targetPriority < D_8015BBF8) { - D_8015BBEC = actor; - D_8015BBF8 = actor->targetPriority; + if ((actor->update != NULL) && ((Player*)actor != player) && + CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_ATTENTION_ENABLED)) { + if ((actorCategory == ACTORCAT_ENEMY) && + CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) && + (actor->xyzDistToPlayerSq < SQ(500.0f)) && (actor->xyzDistToPlayerSq < sBgmEnemyDistSq)) { + actorCtx->attention.bgmEnemy = actor; + sBgmEnemyDistSq = actor->xyzDistToPlayerSq; + } + + if (actor != playerFocusActor) { + distSq = Attention_WeightedDistToPlayerSq(actor, player, sAttentionPlayerRotY); + + if ((distSq < sNearestAttentionActorDistSq) && Attention_ActorIsInRange(actor, distSq) && + Attention_ActorOnScreen(play, actor) && + (!BgCheck_CameraLineTest1(&play->colCtx, &player->actor.focus.pos, &actor->focus.pos, + &lineTestResultPos, &poly, true, true, true, true, &bgId) || + SurfaceType_IsIgnoredByProjectiles(&play->colCtx, poly, bgId))) { + if (actor->attentionPriority != 0) { + // Lower values are considered higher priority + if (actor->attentionPriority < sHighestAttentionPriority) { + sPrioritizedAttentionActor = actor; + sHighestAttentionPriority = actor->attentionPriority; } } else { - D_8015BBE8 = actor; - D_8015BBF0 = var; + sNearestAttentionActor = actor; + sNearestAttentionActorDistSq = distSq; } } } @@ -3137,45 +3342,54 @@ void func_800328D4(PlayState* play, ActorContext* actorCtx, Player* player, u32 } } -u8 D_801160A0[] = { +u8 sAttentionCategorySearchOrder[] = { ACTORCAT_BOSS, ACTORCAT_ENEMY, ACTORCAT_BG, ACTORCAT_EXPLOSIVE, ACTORCAT_NPC, ACTORCAT_ITEMACTION, ACTORCAT_CHEST, ACTORCAT_SWITCH, ACTORCAT_PROP, ACTORCAT_MISC, ACTORCAT_DOOR, ACTORCAT_SWITCH, }; -Actor* func_80032AF0(PlayState* play, ActorContext* actorCtx, Actor** actorPtr, Player* player) { +/** + * Search for the nearest attention actor by iterating through most actor categories. + * See `Attention_FindActorInCategory` for more details on search criteria. + * + * The actor found is stored in the `attentionActorP` parameter, which is also returned. + * It may be NULL if no actor that fulfills the criteria is found. + */ +Actor* Attention_FindActor(PlayState* play, ActorContext* actorCtx, Actor** attentionActorP, Player* player) { s32 i; - u8* entry; + u8* category; - D_8015BBE8 = D_8015BBEC = NULL; - D_8015BBF0 = sbgmEnemyDistSq = MAXFLOAT; - D_8015BBF8 = 0x7FFFFFFF; + sNearestAttentionActor = sPrioritizedAttentionActor = NULL; + sNearestAttentionActorDistSq = sBgmEnemyDistSq = MAXFLOAT; + sHighestAttentionPriority = INT32_MAX; if (!Player_InCsMode(play)) { - entry = &D_801160A0[0]; - - actorCtx->targetCtx.bgmEnemy = NULL; - D_8015BBFC = player->actor.shape.rot.y; + category = &sAttentionCategorySearchOrder[0]; + actorCtx->attention.bgmEnemy = NULL; + sAttentionPlayerRotY = player->actor.shape.rot.y; + // Search the first 3 actor categories first for an attention actor + // These are Boss, Enemy, and Bg, in order. for (i = 0; i < 3; i++) { - func_800328D4(play, actorCtx, player, *entry); - entry++; + Attention_FindActorInCategory(play, actorCtx, player, *category); + category++; } - if (D_8015BBE8 == NULL) { - for (; i < ARRAY_COUNT(D_801160A0); i++) { - func_800328D4(play, actorCtx, player, *entry); - entry++; + // If no actor in the above categories was found, then try searching in the remaining categories + if (sNearestAttentionActor == NULL) { + for (; i < ARRAY_COUNT(sAttentionCategorySearchOrder); i++) { + Attention_FindActorInCategory(play, actorCtx, player, *category); + category++; } } } - if (D_8015BBE8 == NULL) { - *actorPtr = D_8015BBEC; + if (sNearestAttentionActor == NULL) { + *attentionActorP = sPrioritizedAttentionActor; } else { - *actorPtr = D_8015BBE8; + *attentionActorP = sNearestAttentionActor; } - return *actorPtr; + return *attentionActorP; } /** @@ -3355,7 +3569,12 @@ s32 BodyBreak_SpawnParts(Actor* actor, BodyBreak* bodyBreak, PlayState* play, s1 mtx->zw, 0, 0, objectSlot, type); if (spawnedEnPart != NULL) { +#if OOT_VERSION < PAL_1_0 + //! @bug Wrong rotation order compared to Actor_Draw + Matrix_MtxFToZYXRotS(&bodyBreak->matrices[bodyBreak->count], &spawnedEnPart->actor.shape.rot, 0); +#else Matrix_MtxFToYXZRotS(&bodyBreak->matrices[bodyBreak->count], &spawnedEnPart->actor.shape.rot, 0); +#endif spawnedEnPart->displayList = bodyBreak->dLists[bodyBreak->count]; spawnedEnPart->actor.scale = actor->scale; } @@ -3634,12 +3853,12 @@ s16 Actor_TestFloorInDirection(Actor* actor, PlayState* play, f32 distance, s16 } /** - * Returns true if the player is targeting the provided actor + * Returns true if the player is locked onto the specified actor */ -s32 Actor_IsTargeted(PlayState* play, Actor* actor) { +s32 Actor_IsLockedOn(PlayState* play, Actor* actor) { Player* player = GET_PLAYER(play); - if ((player->stateFlags1 & PLAYER_STATE1_4) && actor->isTargeted) { + if ((player->stateFlags1 & PLAYER_STATE1_HOSTILE_LOCK_ON) && actor->isLockedOn) { return true; } else { return false; @@ -3647,12 +3866,12 @@ s32 Actor_IsTargeted(PlayState* play, Actor* actor) { } /** - * Returns true if the player is targeting an actor other than the provided actor + * Returns true if the player is locked onto an actor other than the specified actor */ -s32 Actor_OtherIsTargeted(PlayState* play, Actor* actor) { +s32 Actor_OtherIsLockedOn(PlayState* play, Actor* actor) { Player* player = GET_PLAYER(play); - if ((player->stateFlags1 & PLAYER_STATE1_4) && !actor->isTargeted) { + if ((player->stateFlags1 & PLAYER_STATE1_HOSTILE_LOCK_ON) && !actor->isLockedOn) { return true; } else { return false; @@ -3683,8 +3902,6 @@ void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_actor.c", 8120); - if (0) {} // Necessary to match - POLY_OPA_DISP = Gfx_SetupDL(POLY_OPA_DISP, SETUPDL_44); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, alpha); @@ -3704,7 +3921,7 @@ void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play) { Matrix_Scale(arg1->x, 1.0f, arg1->z, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 8149), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_actor.c", 8149); gSPDisplayList(POLY_OPA_DISP++, gCircleShadowDL); CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 8155); @@ -3743,7 +3960,7 @@ f32 Rand_CenteredFloat(f32 f) { return (Rand_ZeroOne() - 0.5f) * f; } -typedef struct { +typedef struct DoorLockInfo { /* 0x00 */ f32 chainAngle; /* 0x04 */ f32 chainLength; /* 0x08 */ f32 yShift; @@ -3796,8 +4013,7 @@ void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type) { Matrix_Scale(entry->chainsScale, entry->chainsScale, entry->chainsScale, MTXMODE_APPLY); } - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 8299), - G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_actor.c", 8299); gSPDisplayList(POLY_OPA_DISP++, entry->chainDL); if (i % 2) { @@ -3813,7 +4029,7 @@ void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type) { Matrix_Put(&baseMtxF); Matrix_Scale(frame * 0.1f, frame * 0.1f, frame * 0.1f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 8314), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_actor.c", 8314); gSPDisplayList(POLY_OPA_DISP++, entry->lockDL); CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 8319); @@ -3832,24 +4048,24 @@ void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s1 actor->colorFilterTimer = duration; } -Hilite* func_800342EC(Vec3f* object, PlayState* play) { +void func_800342EC(Vec3f* object, PlayState* play) { Vec3f lightDir; lightDir.x = play->envCtx.dirLight1.params.dir.x; lightDir.y = play->envCtx.dirLight1.params.dir.y; lightDir.z = play->envCtx.dirLight1.params.dir.z; - return func_8002EABC(object, &play->view.eye, &lightDir, play->state.gfxCtx); + func_8002EABC(object, &play->view.eye, &lightDir, play->state.gfxCtx); } -Hilite* func_8003435C(Vec3f* object, PlayState* play) { +void func_8003435C(Vec3f* object, PlayState* play) { Vec3f lightDir; lightDir.x = play->envCtx.dirLight1.params.dir.x; lightDir.y = play->envCtx.dirLight1.params.dir.y; lightDir.z = play->envCtx.dirLight1.params.dir.z; - return func_8002EB44(object, &play->view.eye, &lightDir, play->state.gfxCtx); + func_8002EB44(object, &play->view.eye, &lightDir, play->state.gfxCtx); } /** @@ -3898,7 +4114,7 @@ s32 Npc_UpdateTalking(PlayState* play, Actor* actor, s16* talkState, f32 interac return false; } -typedef struct { +typedef struct NpcTrackingRotLimits { /* 0x00 */ s16 maxHeadYaw; /* 0x02 */ s16 minHeadPitch; /* 0x04 */ s16 maxHeadPitch; @@ -3908,7 +4124,7 @@ typedef struct { /* 0x0C */ u8 rotateYaw; } NpcTrackingRotLimits; // size = 0x10 -typedef struct { +typedef struct NpcTrackingParams { /* 0x00 */ NpcTrackingRotLimits rotLimits; // Fields specific to NPC_TRACKING_PLAYER_AUTO_TURN mode /* 0x10 */ f32 autoTurnDistanceRange; // Max distance to player to enable tracking and auto-turn @@ -4199,10 +4415,10 @@ s16 func_80034DD4(Actor* actor, PlayState* play, s16 arg2, f32 arg3) { } if (arg3 < var) { - actor->flags &= ~ACTOR_FLAG_0; + actor->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Math_SmoothStepToS(&arg2, 0, 6, 0x14, 1); } else { - actor->flags |= ACTOR_FLAG_0; + actor->flags |= ACTOR_FLAG_ATTENTION_ENABLED; Math_SmoothStepToS(&arg2, 0xFF, 6, 0x14, 1); } @@ -5795,7 +6011,7 @@ s32 func_80037D98(PlayState* play, Actor* actor, s16 arg2, s32* arg3) { return false; } - if ((actor->xyzDistToPlayerSq > SQ(160.0f)) && !actor->isTargeted) { + if ((actor->xyzDistToPlayerSq > SQ(160.0f)) && !actor->isLockedOn) { return false; } diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c index c697ddb4c5..c34ae6b3f8 100644 --- a/src/code/z_actor_dlftbls.c +++ b/src/code/z_actor_dlftbls.c @@ -1,4 +1,5 @@ #include "global.h" +#include "fault.h" // Linker symbol declarations (used in the table below) #define DEFINE_ACTOR(name, _1, _2, _3) DECLARE_OVERLAY_SEGMENT(name) @@ -11,9 +12,9 @@ #undef DEFINE_ACTOR_INTERNAL #undef DEFINE_ACTOR_UNSET -// Init Vars declarations (also used in the table below) -#define DEFINE_ACTOR(name, _1, _2, _3) extern ActorInit name##_InitVars; -#define DEFINE_ACTOR_INTERNAL(name, _1, _2, _3) extern ActorInit name##_InitVars; +// Profile declarations (also used in the table below) +#define DEFINE_ACTOR(name, _1, _2, _3) extern ActorProfile name##_Profile; +#define DEFINE_ACTOR_INTERNAL(name, _1, _2, _3) extern ActorProfile name##_Profile; #define DEFINE_ACTOR_UNSET(_0) #include "tables/actor_table.h" @@ -31,15 +32,15 @@ _ovl_##name##SegmentStart, \ _ovl_##name##SegmentEnd, \ NULL, \ - &name##_InitVars, \ + &name##_Profile, \ nameString, \ allocType, \ 0, \ }, -#define DEFINE_ACTOR_INTERNAL(name, _1, allocType, nameString) \ - { \ - ROM_FILE_UNSET, NULL, NULL, NULL, &name##_InitVars, nameString, allocType, 0, \ +#define DEFINE_ACTOR_INTERNAL(name, _1, allocType, nameString) \ + { \ + ROM_FILE_UNSET, NULL, NULL, NULL, &name##_Profile, nameString, allocType, 0, \ }, #else @@ -51,15 +52,15 @@ _ovl_##name##SegmentStart, \ _ovl_##name##SegmentEnd, \ NULL, \ - &name##_InitVars, \ + &name##_Profile, \ NULL, \ allocType, \ 0, \ }, -#define DEFINE_ACTOR_INTERNAL(name, _1, allocType, _3) \ - { \ - ROM_FILE_UNSET, NULL, NULL, NULL, &name##_InitVars, NULL, allocType, 0, \ +#define DEFINE_ACTOR_INTERNAL(name, _1, allocType, _3) \ + { \ + ROM_FILE_UNSET, NULL, NULL, NULL, &name##_Profile, NULL, allocType, 0, \ }, #endif @@ -88,7 +89,7 @@ void ActorOverlayTable_LogPrint(void) { for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < (u32)gMaxActorId; i++, overlayEntry++) { PRINTF("%08x %08x %08x %08x %08x %08x %s\n", overlayEntry->file.vromStart, overlayEntry->file.vromEnd, - overlayEntry->vramStart, overlayEntry->vramEnd, overlayEntry->loadedRamAddr, &overlayEntry->initInfo->id, + overlayEntry->vramStart, overlayEntry->vramEnd, overlayEntry->loadedRamAddr, &overlayEntry->profile->id, overlayEntry->name != NULL ? overlayEntry->name : "?"); } #endif @@ -97,19 +98,47 @@ void ActorOverlayTable_LogPrint(void) { void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) { ActorOverlay* overlayEntry; u32 overlaySize; + uintptr_t ramStart; + uintptr_t ramEnd; + u32 offset; +#if PLATFORM_N64 + uintptr_t pc = gFaultFaultedThread != NULL ? gFaultFaultedThread->context.pc : 0; + uintptr_t ra = gFaultFaultedThread != NULL ? gFaultFaultedThread->context.ra : 0; + u32 i; +#else s32 i; +#endif + +#if PLATFORM_N64 + func_800AE1F8(); - FaultDrawer_SetCharPad(-2, 0); + Fault_Printf("actor_dlftbls %u\n", gMaxActorId); + Fault_Printf("No. RamStart-RamEnd Offset\n"); +#else + Fault_SetCharPad(-2, 0); - FaultDrawer_Printf("actor_dlftbls %u\n", gMaxActorId); - FaultDrawer_Printf("No. RamStart- RamEnd cn Name\n"); + Fault_Printf("actor_dlftbls %u\n", gMaxActorId); + Fault_Printf("No. RamStart- RamEnd cn Name\n"); +#endif for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxActorId; i++, overlayEntry++) { overlaySize = (uintptr_t)overlayEntry->vramEnd - (uintptr_t)overlayEntry->vramStart; - if (overlayEntry->loadedRamAddr != NULL) { - FaultDrawer_Printf("%3d %08x-%08x %3d %s\n", i, overlayEntry->loadedRamAddr, - (uintptr_t)overlayEntry->loadedRamAddr + overlaySize, overlayEntry->numLoaded, - (IS_DEBUG && overlayEntry->name != NULL) ? overlayEntry->name : ""); + ramStart = (uintptr_t)overlayEntry->loadedRamAddr; + ramEnd = ramStart + overlaySize; + offset = (uintptr_t)overlayEntry->vramStart - ramStart; + if (ramStart != 0) { +#if PLATFORM_N64 + Fault_Printf("%3d %08x-%08x %08x", i, ramStart, ramEnd, offset); + if (ramStart <= pc && pc < ramEnd) { + Fault_Printf(" PC:%08x", pc + offset); + } else if (ramStart <= ra && ra < ramEnd) { + Fault_Printf(" RA:%08x", ra + offset); + } + Fault_Printf("\n"); +#else + Fault_Printf("%3d %08x-%08x %3d %s\n", i, ramStart, ramEnd, overlayEntry->numLoaded, + (IS_DEBUG && overlayEntry->name != NULL) ? overlayEntry->name : ""); +#endif } } } diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 884fde7ce6..7fb0d98b64 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -1,6 +1,8 @@ #include "global.h" #include "terminal.h" +#pragma increment_block_number "ntsc-1.2:136" + u16 DynaSSNodeList_GetNextNodeIdx(DynaSSNodeList* nodeList); void BgCheck_GetStaticLookupIndicesFromPos(CollisionContext* colCtx, Vec3f* pos, Vec3i* sector); s32 BgCheck_PosInStaticBoundingBox(CollisionContext* colCtx, Vec3f* pos); @@ -86,9 +88,9 @@ s32 BgCheck_PosErrorCheck(Vec3f* pos, const char* file, int line) { if (pos->x >= BGCHECK_XYZ_ABSMAX || pos->x <= -BGCHECK_XYZ_ABSMAX || pos->y >= BGCHECK_XYZ_ABSMAX || pos->y <= -BGCHECK_XYZ_ABSMAX || pos->z >= BGCHECK_XYZ_ABSMAX || pos->z <= -BGCHECK_XYZ_ABSMAX) { PRINTF(VT_FGCOL(RED)); - // "Position is invalid." - PRINTF("T_BGCheck_PosErrorCheck():位置が妥当ではありません。pos (%f,%f,%f) file:%s line:%d\n", pos->x, pos->y, - pos->z, file, line); + PRINTF(T("T_BGCheck_PosErrorCheck():位置が妥当ではありません。pos (%f,%f,%f) file:%s line:%d\n", + "T_BGCheck_PosErrorCheck(): Position is invalid. pos (%f,%f,%f) file:%s line:%d\n"), + pos->x, pos->y, pos->z, file, line); PRINTF(VT_RST); return true; } @@ -304,8 +306,8 @@ void CollisionPoly_GetVerticesByBgId(CollisionPoly* poly, s32 bgId, CollisionCon if (poly == NULL || bgId > BG_ACTOR_MAX || dest == NULL) { PRINTF(VT_COL(RED, WHITE)); - // "Argument not appropriate. Processing terminated." - PRINTF("T_Polygon_GetVertex_bg_ai(): Error %d %d %d 引数が適切ではありません。処理を終了します。\n", + PRINTF(T("T_Polygon_GetVertex_bg_ai(): Error %d %d %d 引数が適切ではありません。処理を終了します。\n", + "T_Polygon_GetVertex_bg_ai(): Error %d %d %d Argument not appropriate. Processing terminated.\n"), poly == NULL, bgId > BG_ACTOR_MAX, dest == NULL); PRINTF(VT_RST); @@ -1479,7 +1481,7 @@ s32 BgCheck_IsSpotScene(PlayState* play) { return false; } -typedef struct { +typedef struct BgCheckSceneMemEntry { s16 sceneId; u32 memSize; } BgCheckSceneMemEntry; @@ -1518,7 +1520,7 @@ void BgCheck_SetSubdivisionDimension(f32 min, s32 subdivAmount, f32* max, f32* s *max = *subdivLength * subdivAmount + min; } -typedef struct { +typedef struct BgCheckSceneSubdivisionEntry { s16 sceneId; Vec3s subdivAmount; s32 nodeListMax; // if -1, dynamically compute max nodes @@ -1544,19 +1546,17 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader colCtx->colHeader = colHeader; customNodeListMax = -1; - // "/*---------------- BGCheck Buffer Memory Size -------------*/\n" - PRINTF("/*---------------- BGCheck バッファーメモリサイズ -------------*/\n"); + PRINTF(T("/*---------------- BGCheck バッファーメモリサイズ -------------*/\n", + "/*---------------- BGCheck Buffer Memory Size -------------*/\n")); if ((R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT) || (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_TOGGLE_VIEWPOINT) || (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED) || (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_MARKET)) { if (play->sceneId == SCENE_STABLE) { - // "/* BGCheck LonLon Size %dbyte */\n" - PRINTF("/* BGCheck LonLonサイズ %dbyte */\n", 0x3520); + PRINTF(T("/* BGCheck LonLonサイズ %dbyte */\n", "/* BGCheck LonLon Size %dbyte */\n"), 0x3520); colCtx->memSize = 0x3520; } else { - // "/* BGCheck Mini Size %dbyte */\n" - PRINTF("/* BGCheck ミニサイズ %dbyte */\n", 0x4E20); + PRINTF(T("/* BGCheck ミニサイズ %dbyte */\n", "/* BGCheck Mini Size %dbyte */\n"), 0x4E20); colCtx->memSize = 0x4E20; } colCtx->dyna.polyNodesMax = 500; @@ -1567,8 +1567,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader colCtx->subdivAmount.z = 2; } else if (BgCheck_IsSpotScene(play) == true) { colCtx->memSize = 0xF000; - // "/* BGCheck Spot Size %dbyte */\n" - PRINTF("/* BGCheck Spot用サイズ %dbyte */\n", 0xF000); + PRINTF(T("/* BGCheck Spot用サイズ %dbyte */\n", "/* BGCheck Spot Size %dbyte */\n"), 0xF000); colCtx->dyna.polyNodesMax = 1000; colCtx->dyna.polyListMax = 512; colCtx->dyna.vtxListMax = 512; @@ -1581,8 +1580,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader } else { colCtx->memSize = 0x1CC00; } - // "/* BGCheck Normal Size %dbyte */\n" - PRINTF("/* BGCheck ノーマルサイズ %dbyte */\n", colCtx->memSize); + PRINTF(T("/* BGCheck ノーマルサイズ %dbyte */\n", "/* BGCheck Normal Size %dbyte */\n"), colCtx->memSize); colCtx->dyna.polyNodesMax = 1000; colCtx->dyna.polyListMax = 512; colCtx->dyna.vtxListMax = 512; @@ -1608,7 +1606,11 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader colCtx->subdivAmount.z, ALIGNOF_MASK(StaticLookup)); if (colCtx->lookupTbl == NULL) { +#if OOT_VERSION < NTSC_1_1 + LogUtils_HungupThread("../z_bgcheck.c", 4173); +#else LogUtils_HungupThread("../z_bgcheck.c", 4176); +#endif } colCtx->minBounds.x = colCtx->colHeader->minBounds.x; colCtx->minBounds.y = colCtx->colHeader->minBounds.y; @@ -1632,7 +1634,11 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader tblMax = customNodeListMax; } else { if (colCtx->memSize < memSize) { +#if OOT_VERSION < NTSC_1_1 + LogUtils_HungupThread("../z_bgcheck.c", 4227); +#else LogUtils_HungupThread("../z_bgcheck.c", 4230); +#endif } tblMax = (colCtx->memSize - memSize) / sizeof(SSNode); } @@ -1642,7 +1648,8 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader lookupTblMemSize = BgCheck_InitializeStaticLookup(colCtx, play, colCtx->lookupTbl); PRINTF(VT_FGCOL(GREEN)); - PRINTF("/*---結局 BG使用サイズ %dbyte---*/\n", memSize + lookupTblMemSize); + PRINTF(T("/*---結局 BG使用サイズ %dbyte---*/\n", "/*---BG size used in the end %dbyte---*/\n"), + memSize + lookupTblMemSize); PRINTF(VT_RST); DynaPoly_Init(play, &colCtx->dyna); @@ -1662,7 +1669,8 @@ CollisionHeader* BgCheck_GetCollisionHeader(CollisionContext* colCtx, s32 bgId) } if (!(colCtx->dyna.bgActorFlags[bgId] & BGACTOR_IN_USE)) { PRINTF(VT_COL(YELLOW, BLACK)); - PRINTF("T_BGCheck_getBGDataInfo():そのbg_actor_indexは使われておりません。index=%d\n"); + PRINTF(T("T_BGCheck_getBGDataInfo():そのbg_actor_indexは使われておりません。index=%d\n", + "T_BGCheck_getBGDataInfo(): That bg_actor_index is not in use. index=%d\n")); PRINTF(VT_RST); return NULL; } @@ -1714,7 +1722,7 @@ f32 BgCheck_RaycastDownImpl(PlayState* play, CollisionContext* colCtx, u16 xpFla #if IS_DEBUG if (BgCheck_PosErrorCheck(&checkPos, "../z_bgcheck.c", 4410)) { if (actor != NULL) { - PRINTF("こいつ,pself_actor->name %d\n", actor->id); + PRINTF(T("こいつ,pself_actor->name %d\n", "This guy, pself_actor->name %d\n"), actor->id); } } #endif @@ -1967,7 +1975,7 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul if (BgCheck_PosErrorCheck(posNext, "../z_bgcheck.c", 4831) == true || BgCheck_PosErrorCheck(posPrev, "../z_bgcheck.c", 4832) == true) { if (actor != NULL) { - PRINTF("こいつ,pself_actor->name %d\n", actor->id); + PRINTF(T("こいつ,pself_actor->name %d\n", "This guy, pself_actor->name %d\n"), actor->id); } } #endif @@ -2160,7 +2168,7 @@ s32 BgCheck_CheckCeilingImpl(CollisionContext* colCtx, u16 xpFlags, f32* outY, V #if IS_DEBUG if (BgCheck_PosErrorCheck(pos, "../z_bgcheck.c", 5206) == true) { if (actor != NULL) { - PRINTF("こいつ,pself_actor->name %d\n", actor->id); + PRINTF(T("こいつ,pself_actor->name %d\n", "This guy, pself_actor->name %d\n"), actor->id); } } #endif @@ -2234,9 +2242,9 @@ s32 BgCheck_CheckLineImpl(CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, if (BgCheck_PosErrorCheck(posA, "../z_bgcheck.c", 5334) == true || BgCheck_PosErrorCheck(posB, "../z_bgcheck.c", 5335) == true) { if (actor != NULL) { - PRINTF("こいつ,pself_actor->name %d\n", actor->id); + PRINTF(T("こいつ,pself_actor->name %d\n", "This guy, pself_actor->name %d\n"), actor->id); } else { - PRINTF("pself_actor == NULLで犯人不明\n"); + PRINTF(T("pself_actor == NULLで犯人不明\n", "pself_actor == NULL culprit unknown\n")); } } #endif @@ -2455,7 +2463,7 @@ s32 BgCheck_SphVsFirstPolyImpl(CollisionContext* colCtx, u16 xpFlags, CollisionP #if IS_DEBUG if (BgCheck_PosErrorCheck(center, "../z_bgcheck.c", 5852) == true) { if (actor != NULL) { - PRINTF("こいつ,pself_actor->name %d\n", actor->id); + PRINTF(T("こいつ,pself_actor->name %d\n", "This guy, pself_actor->name %d\n"), actor->id); } } #endif @@ -2724,7 +2732,8 @@ s32 DynaPoly_SetBgActor(PlayState* play, DynaCollisionContext* dyna, Actor* acto if (!foundSlot) { PRINTF(VT_FGCOL(RED)); - PRINTF("DynaPolyInfo_setActor():ダイナミックポリゴン 空きインデックスはありません\n"); + PRINTF(T("DynaPolyInfo_setActor():ダイナミックポリゴン 空きインデックスはありません\n", + "DynaPolyInfo_setActor(): Dynamic polygon no free indexes\n")); PRINTF(VT_RST); return BG_ACTOR_MAX; } @@ -2793,14 +2802,17 @@ void DynaPoly_DeleteBgActor(PlayState* play, DynaCollisionContext* dyna, s32 bgI #if IS_DEBUG if (bgId == -1) { PRINTF(VT_FGCOL(GREEN)); - // "The index that should have been deleted(? ) was(== -1), processing aborted." - PRINTF("DynaPolyInfo_delReserve():削除されているはずの(?)\nインデックス(== -1)のため,処理を中止します。\n"); + PRINTF(T("DynaPolyInfo_delReserve():削除されているはずの(?)\n" + "インデックス(== -1)のため,処理を中止します。\n", + "DynaPolyInfo_delReserve():The index that should have been deleted(?)\n" + " was(== -1), processing aborted.\n")); PRINTF(VT_RST); } else { PRINTF(VT_FGCOL(RED)); - // "Unable to deallocate index / index unallocated, processing aborted." - PRINTF("DynaPolyInfo_delReserve():" - "確保していない/出来なかったインデックスの解放のため、処理を中止します。index == %d\n", + PRINTF(T("DynaPolyInfo_delReserve():" + "確保していない/出来なかったインデックスの解放のため、処理を中止します。index == %d\n", + "DynaPolyInfo_delReserve():" + " Unable to deallocate index / index unallocated, processing aborted. index == %d\n"), bgId); PRINTF(VT_RST); } @@ -2862,16 +2874,16 @@ void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s3 #if IS_DEBUG if (!(dyna->polyListMax >= *polyStartIndex + pbgdata->numPolygons)) { PRINTF(VT_FGCOL(RED)); - // "do not use if %d exceeds %d" - PRINTF("DynaPolyInfo_expandSRT():polygon over %dが%dを越えるとダメ\n", *polyStartIndex + pbgdata->numPolygons, - dyna->polyListMax); + PRINTF(T("DynaPolyInfo_expandSRT():polygon over %dが%dを越えるとダメ\n", + "DynaPolyInfo_expandSRT():polygon over do not use if %d exceeds %d\n"), + *polyStartIndex + pbgdata->numPolygons, dyna->polyListMax); } if (!(dyna->vtxListMax >= *vtxStartIndex + pbgdata->numVertices)) { PRINTF(VT_FGCOL(RED)); - // "do not use if %d exceeds %d" - PRINTF("DynaPolyInfo_expandSRT():vertex over %dが%dを越えるとダメ\n", *vtxStartIndex + pbgdata->numVertices, - dyna->vtxListMax); + PRINTF(T("DynaPolyInfo_expandSRT():vertex over %dが%dを越えるとダメ\n", + "DynaPolyInfo_expandSRT():vertex over do not use if %d exceeds %d\n"), + *vtxStartIndex + pbgdata->numVertices, dyna->vtxListMax); } ASSERT(dyna->polyListMax >= *polyStartIndex + pbgdata->numPolygons, @@ -3049,7 +3061,7 @@ void DynaPoly_UpdateContext(PlayState* play, DynaCollisionContext* dyna) { if (dyna->bgActorFlags[i] & BGACTOR_1) { // Initialize BgActor PRINTF(VT_FGCOL(GREEN)); - PRINTF("DynaPolyInfo_setup():削除 index=%d\n", i); + PRINTF(T("DynaPolyInfo_setup():削除 index=%d\n", "DynaPolyInfo_setup(): Delete index=%d\n"), i); PRINTF(VT_RST); dyna->bgActorFlags[i] = 0; @@ -3059,7 +3071,7 @@ void DynaPoly_UpdateContext(PlayState* play, DynaCollisionContext* dyna) { if (dyna->bgActors[i].actor != NULL && dyna->bgActors[i].actor->update == NULL) { // Delete BgActor PRINTF(VT_FGCOL(GREEN)); - PRINTF("DynaPolyInfo_setup():削除 index=%d\n", i); + PRINTF(T("DynaPolyInfo_setup():削除 index=%d\n", "DynaPolyInfo_setup(): Delete index=%d\n"), i); PRINTF(VT_RST); actor = DynaPoly_GetActor(&play->colCtx, i); if (actor == NULL) { diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 6743e1547c..1a1179ae8f 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -4,9 +4,8 @@ #include "terminal.h" #include "overlays/actors/ovl_En_Horse/z_en_horse.h" -// For retail BSS ordering, the block number of D_8015BD7C -// must be between 88 and 123 inclusive. -#pragma increment_block_number 30 +#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \ + "ntsc-1.2:192 pal-1.0:192 pal-1.1:192" s16 Camera_RequestSettingImpl(Camera* camera, s16 requestedSetting, s16 flags); s32 Camera_RequestModeImpl(Camera* camera, s16 requestedMode, u8 forceModeChange); @@ -16,6 +15,12 @@ s32 Camera_UpdateWater(Camera* camera); s32 Camera_QRegInit(void); #endif +#if PLATFORM_N64 +#define CAMERA_CHECK_BTN(input, btn) PadUtils_CheckPressed((input), (btn)) +#else +#define CAMERA_CHECK_BTN(input, btn) CHECK_BTN_ALL((input)->press.button, (btn)) +#endif + #if IS_CAMERA_DEBUG_ENABLED #define CAM_DEBUG_RELOAD_PREG(camera) \ if (R_RELOAD_CAM_PARAMS) { \ @@ -394,6 +399,7 @@ s32 Camera_BGCheckInfo(Camera* camera, Vec3f* from, CamColChk* to) { to->pos.y = to->norm.y + toNewPos.y; to->pos.z = to->norm.z + toNewPos.z; + //! @bug floorBgId is uninitialized if BgCheck_CameraLineTest1 returned true above return floorBgId + 1; } @@ -2916,7 +2922,7 @@ s32 Camera_Battle1(Camera* camera) { sp78 = roData->swingPitchFinal; fov = roData->fov; - if (camera->player->stateFlags1 & PLAYER_STATE1_12) { + if (camera->player->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK) { // charging sword. rwData->unk_10 = Camera_LERPCeilF(CAM_GLOBAL_12 * (1.0f - 0.5f), rwData->unk_10, CAM_UPDATE_RATE_STEP_SCALE_XZ, 0.1f); @@ -3493,7 +3499,7 @@ s32 Camera_KeepOn3(Camera* camera) { roData->yOffset = GET_NEXT_SCALED_RO_DATA(values) * playerHeight * yNormal; roData->minDist = GET_NEXT_RO_DATA(values); roData->maxDist = GET_NEXT_RO_DATA(values); - roData->swingYawInital = GET_NEXT_RO_DATA(values); + roData->swingYawInitial = GET_NEXT_RO_DATA(values); roData->swingYawFinal = GET_NEXT_RO_DATA(values); roData->swingPitchInitial = GET_NEXT_RO_DATA(values); roData->swingPitchFinal = GET_NEXT_RO_DATA(values); @@ -3525,7 +3531,7 @@ s32 Camera_KeepOn3(Camera* camera) { spBC = ((1.0f - temp_f0) * targetToPlayerDir.r) / rwData->animTimer; swingAngle = F32_LERPIMP(roData->swingPitchInitial, roData->swingPitchFinal, temp_f0); atToEyeAdj.pitch = CAM_DEG_TO_BINANG(swingAngle) + ((s16)(-(targetToPlayerDir.pitch * roData->swingPitchAdj))); - swingAngle = F32_LERPIMP(roData->swingYawInital, roData->swingYawFinal, temp_f0); + swingAngle = F32_LERPIMP(roData->swingYawInitial, roData->swingYawFinal, temp_f0); if (roData->interfaceField & KEEPON3_FLAG_4) { if ((s16)(targetToPlayerDir.yaw - atToEyeNextDir.yaw) < 0) { atToEyeAdj.yaw = targetToPlayerDir.yaw + CAM_DEG_TO_BINANG(swingAngle); @@ -3611,14 +3617,14 @@ s32 Camera_KeepOn3(Camera* camera) { func_80043B60(camera); camera->atLERPStepScale = 0.0f; - if (camera->xzSpeed > 0.001f || CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_A) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_B) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CLEFT) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CDOWN) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CUP) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CRIGHT) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_R) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_Z)) { + if (camera->xzSpeed > 0.001f || CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_A) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_B) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CLEFT) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CDOWN) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CUP) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CRIGHT) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_R) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_Z)) { camera->stateFlags |= CAM_STATE_CHECK_BG; camera->stateFlags &= ~CAM_STATE_EXTERNAL_FINISHED; } @@ -3626,7 +3632,8 @@ s32 Camera_KeepOn3(Camera* camera) { return 1; } -#pragma increment_block_number 100 +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:93 pal-1.0:91 pal-1.1:91" s32 Camera_KeepOn4(Camera* camera) { static Vec3f D_8015BD50; @@ -4985,14 +4992,14 @@ s32 Camera_Unique3(Camera* camera) { break; } doorParams->timer3 = 5; - if (camera->xzSpeed > 0.001f || CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_A) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_B) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CLEFT) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CDOWN) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CUP) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CRIGHT) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_R) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_Z)) { + if (camera->xzSpeed > 0.001f || CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_A) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_B) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CLEFT) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CDOWN) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CUP) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CRIGHT) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_R) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_Z)) { camera->animState++; } else { break; @@ -5080,28 +5087,28 @@ s32 Camera_Unique0(Camera* camera) { atPlayerOffset.pitch = -bgCamRot.x; rwData->eyeAndDirection.dir = OLib_VecGeoToVec3f(&atPlayerOffset); Math3D_LineClosestToPoint(&rwData->eyeAndDirection, &playerPosRot->pos, &camera->at); - rwData->initalPos = playerPosRot->pos; + rwData->initialPos = playerPosRot->pos; camera->animState++; } if (player->stateFlags1 & PLAYER_STATE1_29) { - rwData->initalPos = playerPosRot->pos; + rwData->initialPos = playerPosRot->pos; } if (roData->interfaceField & UNIQUE0_FLAG_0) { if (rwData->animTimer > 0) { rwData->animTimer--; - rwData->initalPos = playerPosRot->pos; + rwData->initialPos = playerPosRot->pos; } else if (!(player->stateFlags1 & PLAYER_STATE1_29) && - ((OLib_Vec3fDistXZ(&playerPosRot->pos, &rwData->initalPos) >= 10.0f) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_A) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_B) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CLEFT) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CDOWN) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CUP) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CRIGHT) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_R) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_Z))) { + ((OLib_Vec3fDistXZ(&playerPosRot->pos, &rwData->initialPos) >= 10.0f) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_A) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_B) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CLEFT) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CDOWN) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CUP) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CRIGHT) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_R) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_Z))) { camera->dist = OLib_Vec3fDist(&camera->at, eye); camera->playerToAtOffset.x = camera->at.x - playerPosRot->pos.x; camera->playerToAtOffset.y = camera->at.y - playerPosRot->pos.y; @@ -5117,18 +5124,18 @@ s32 Camera_Unique0(Camera* camera) { sCameraInterfaceField = CAM_INTERFACE_FIELD(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0); } } else { - rwData->initalPos = playerPosRot->pos; + rwData->initialPos = playerPosRot->pos; } if (!(player->stateFlags1 & PLAYER_STATE1_29) && - ((0.001f < camera->xzSpeed) || CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_A) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_B) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CLEFT) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CDOWN) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CUP) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CRIGHT) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_R) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_Z))) { + ((0.001f < camera->xzSpeed) || CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_A) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_B) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CLEFT) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CDOWN) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CUP) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CRIGHT) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_R) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_Z))) { camera->dist = OLib_Vec3fDist(&camera->at, &camera->eye); camera->playerToAtOffset.x = camera->at.x - playerPosRot->pos.x; camera->playerToAtOffset.y = camera->at.y - playerPosRot->pos.y; @@ -5827,9 +5834,8 @@ s32 Camera_Demo1(Camera* camera) { rwData->keyframe = 0; rwData->curFrame = 0.0f; camera->animState++; - // "absolute" : "relative" PRINTF(VT_SGR("1") "%06u:" VT_RST " camera: spline demo: start %s \n", camera->play->state.frames, - *relativeToPlayer == 0 ? "絶対" : "相対"); + *relativeToPlayer == 0 ? T("絶対", "absolute") : T("相対", "relative")); #if IS_CAMERA_DEBUG_ENABLED if (PREG(93)) { @@ -6030,30 +6036,30 @@ s32 Camera_Demo3(Camera* camera) { rwData->unk_0C = 0.1f; sCameraInterfaceField = CAM_INTERFACE_FIELD(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_A, 0); - if (!((rwData->animFrame < 0 || camera->xzSpeed > 0.001f || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_A) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_B) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CLEFT) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CDOWN) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CUP) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CRIGHT) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_R) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_Z)) && - (camera->stateFlags & CAM_STATE_EXTERNAL_FINISHED))) { - goto skipeyeUpdate; - } - FALLTHROUGH; + if ((rwData->animFrame < 0 || camera->xzSpeed > 0.001f || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_A) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_B) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CLEFT) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CDOWN) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CUP) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CRIGHT) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_R) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_Z)) && + (camera->stateFlags & CAM_STATE_EXTERNAL_FINISHED)) { + // clang-format off + // Note: default for switch inside if statement default: - camera->stateFlags |= (CAM_STATE_CHECK_BG | CAM_STATE_CAM_FUNC_FINISH); - camera->stateFlags &= ~CAM_STATE_EXTERNAL_FINISHED; - if (camera->prevBgCamIndex < 0) { - Camera_RequestSettingImpl(camera, camera->prevSetting, CAM_REQUEST_SETTING_IGNORE_PRIORITY); - } else { - Camera_RequestBgCam(camera, camera->prevBgCamIndex); - camera->prevBgCamIndex = -1; + // clang-format on + camera->stateFlags |= (CAM_STATE_CHECK_BG | CAM_STATE_CAM_FUNC_FINISH); + camera->stateFlags &= ~CAM_STATE_EXTERNAL_FINISHED; + if (camera->prevBgCamIndex < 0) { + Camera_RequestSettingImpl(camera, camera->prevSetting, CAM_REQUEST_SETTING_IGNORE_PRIORITY); + } else { + Camera_RequestBgCam(camera, camera->prevBgCamIndex); + camera->prevBgCamIndex = -1; + } + sCameraInterfaceField = CAM_INTERFACE_FIELD(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0); } - sCameraInterfaceField = CAM_INTERFACE_FIELD(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0); - skipeyeUpdate: skipUpdateEye = true; break; } @@ -6076,8 +6082,6 @@ s32 Camera_Demo3(Camera* camera) { camera->animState = 4; } - if (1) {} - if (!skipUpdateEye) { eyeOffset.r = Camera_LERPCeilF(eyeOffset.r, eyeAtOffset.r, rwData->unk_0C, 2.0f); eyeOffset.pitch = Camera_LERPCeilS(eyeOffset.pitch, eyeAtOffset.pitch, rwData->unk_0C, 0xA); @@ -6618,7 +6622,7 @@ s32 Camera_Demo5(Camera* camera) { sp4A = playerhead.rot.y - playerTargetGeo.yaw; if (camera->target->category == ACTORCAT_PLAYER) { framesDiff = camera->play->state.frames - sDemo5PrevAction12Frame; - if (player->stateFlags1 & PLAYER_STATE1_11) { + if (player->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) { // holding object over head. Player_SetCsActionWithHaltedActors(camera->play, camera->target, PLAYER_CSACTION_8); } else if (ABS(framesDiff) > 3000) { @@ -6944,11 +6948,11 @@ s32 Camera_Special4(Camera* camera) { sCameraInterfaceField = CAM_INTERFACE_FIELD(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_NOTHING_ALT, 0); camera->fov = 40.0f; camera->animState++; - rwData->initalTimer = camera->timer; + rwData->initialTimer = camera->timer; } camera->fov = Camera_LERPCeilF(80.0f, camera->fov, 1.0f / *timer, 0.1f); - if ((rwData->initalTimer - *timer) < 0xF) { + if ((rwData->initialTimer - *timer) < 0xF) { (*timer)--; return false; } else { @@ -7055,7 +7059,7 @@ s32 Camera_Special5(Camera* camera) { return true; } -typedef enum { +typedef enum CamElevatorPlatform { /* 0 */ CAM_ELEVATOR_PLATFORM_FIRE_TEMPLE_LOWER_FLOOR, // ACTOR_BG_HIDAN_ROCK /* 1 */ CAM_ELEVATOR_PLATFORM_FIRE_TEMPLE_EAST_TOWER, // ACTOR_BG_HIDAN_FSLIFT /* 2 */ CAM_ELEVATOR_PLATFORM_FIRE_TEMPLE_WEST_TOWER, // ACTOR_BG_HIDAN_SYOKU @@ -7228,7 +7232,7 @@ s32 Camera_Special6(Camera* camera) { // Overwrite hud visibility to CAM_HUD_VISIBILITY_HEARTS_FORCE sCameraInterfaceField = (sCameraInterfaceField & (u16)~CAM_HUD_VISIBILITY_MASK) | CAM_HUD_VISIBILITY(CAM_HUD_VISIBILITY_HEARTS_FORCE); - rwData->initalPlayerY = playerPosRot->pos.y; + rwData->initialPlayerY = playerPosRot->pos.y; rwData->animTimer = 12; *eyeNext = bgCamPos; if (camera->animState == 0) { @@ -7241,7 +7245,7 @@ s32 Camera_Special6(Camera* camera) { timerF = rwData->animTimer; eyePosCalc = *eyeNext; eyePosCalc.x += (playerPosRot->pos.x - eyePosCalc.x) * 0.5f; - eyePosCalc.y += (playerPosRot->pos.y - rwData->initalPlayerY) * 0.2f; + eyePosCalc.y += (playerPosRot->pos.y - rwData->initialPlayerY) * 0.2f; eyeAnim = eyePosCalc; eyeAnim.y = Camera_LERPCeilF(eyePosCalc.y, eye->y, 0.5f, 0.01f); @@ -7267,7 +7271,7 @@ s32 Camera_Special6(Camera* camera) { (sCameraInterfaceField & (u16)~CAM_HUD_VISIBILITY_MASK) | CAM_HUD_VISIBILITY(CAM_HUD_VISIBILITY_ALL); eyePosCalc = *eyeNext; eyePosCalc.x += (playerPosRot->pos.x - eyePosCalc.x) * 0.5f; - eyePosCalc.y += (playerPosRot->pos.y - rwData->initalPlayerY) * 0.2f; + eyePosCalc.y += (playerPosRot->pos.y - rwData->initialPlayerY) * 0.2f; *eye = eyePosCalc; eye->y = Camera_LERPCeilF(eyePosCalc.y, eye->y, 0.5f, 0.01f); @@ -7412,15 +7416,14 @@ s32 Camera_Special9(Camera* camera) { camera->stateFlags |= (CAM_STATE_CAM_FUNC_FINISH | CAM_STATE_BLOCK_BG); sCameraInterfaceField = CAM_INTERFACE_FIELD(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0); - if (camera->xzSpeed > 0.001f || CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_A) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_B) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CLEFT) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CDOWN) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CUP) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CRIGHT) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_R) || - CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_Z) || - (roData->interfaceField & SPECIAL9_FLAG_3)) { + if (camera->xzSpeed > 0.001f || CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_A) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_B) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CLEFT) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CDOWN) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CUP) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_CRIGHT) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_R) || + CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_Z) || (roData->interfaceField & SPECIAL9_FLAG_3)) { Camera_RequestSettingImpl(camera, camera->prevSetting, CAM_REQUEST_SETTING_IGNORE_PRIORITY); camera->stateFlags |= (CAM_STATE_CHECK_WATER | CAM_STATE_CHECK_BG); @@ -7463,7 +7466,7 @@ void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState s16 curUID; s16 j; - __osMemset(camera, 0, sizeof(Camera)); + memset(camera, 0, sizeof(Camera)); if (sInitRegs) { s32 i; @@ -7553,18 +7556,18 @@ void func_80057FC4(Camera* camera) { camera->prevSetting = camera->setting = CAM_SET_FREE0; camera->stateFlags &= ~CAM_STATE_CHECK_BG; } else if (camera->play->roomCtx.curRoom.roomShape->base.type != ROOM_SHAPE_TYPE_IMAGE) { - switch (camera->play->roomCtx.curRoom.behaviorType1) { - case ROOM_BEHAVIOR_TYPE1_1: + switch (camera->play->roomCtx.curRoom.type) { + case ROOM_TYPE_DUNGEON: Camera_ChangeDoorCam(camera, NULL, -99, 0, 0, 18, 10); camera->prevSetting = camera->setting = CAM_SET_DUNGEON0; break; - case ROOM_BEHAVIOR_TYPE1_0: + case ROOM_TYPE_NORMAL: PRINTF("camera: room type: default set field\n"); Camera_ChangeDoorCam(camera, NULL, -99, 0, 0, 18, 10); camera->prevSetting = camera->setting = CAM_SET_NORMAL0; break; default: - PRINTF("camera: room type: default set etc (%d)\n", camera->play->roomCtx.curRoom.behaviorType1); + PRINTF("camera: room type: default set etc (%d)\n", camera->play->roomCtx.curRoom.type); Camera_ChangeDoorCam(camera, NULL, -99, 0, 0, 18, 10); camera->prevSetting = camera->setting = CAM_SET_NORMAL0; camera->stateFlags |= CAM_STATE_CHECK_BG; @@ -7896,7 +7899,7 @@ s32 Camera_UpdateWater(Camera* camera) { s32 Camera_UpdateHotRoom(Camera* camera) { camera->distortionFlags &= ~DISTORTION_HOT_ROOM; - if (camera->play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) { + if (camera->play->roomCtx.curRoom.environmentType == ROOM_ENV_HOT) { camera->distortionFlags |= DISTORTION_HOT_ROOM; } @@ -7912,19 +7915,19 @@ s32 Camera_DbgChangeMode(Camera* camera) { s32 changeDir = 0; if (!gDebugCamEnabled && camera->play->activeCamId == CAM_ID_MAIN) { - if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_CUP)) { + if (CAMERA_CHECK_BTN(&D_8015BD7C->state.input[2], BTN_CUP)) { PRINTF("attention sound URGENCY\n"); Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_URGENCY); } - if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_CDOWN)) { + if (CAMERA_CHECK_BTN(&D_8015BD7C->state.input[2], BTN_CDOWN)) { PRINTF("attention sound NORMAL\n"); Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_ON); } - if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_CRIGHT)) { + if (CAMERA_CHECK_BTN(&D_8015BD7C->state.input[2], BTN_CRIGHT)) { changeDir = 1; } - if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_CLEFT)) { + if (CAMERA_CHECK_BTN(&D_8015BD7C->state.input[2], BTN_CLEFT)) { changeDir = -1; } if (changeDir != 0) { @@ -8187,7 +8190,7 @@ Vec3s Camera_Update(Camera* camera) { } // enable/disable debug cam - if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_START)) { + if (CAMERA_CHECK_BTN(&D_8015BD7C->state.input[2], BTN_START)) { gDebugCamEnabled ^= 1; if (gDebugCamEnabled) { DebugCamera_Enable(&D_8015BD80, camera); @@ -8203,144 +8206,145 @@ Vec3s Camera_Update(Camera* camera) { if (ENABLE_DEBUG_CAM_UPDATE) { PRINTF("camera: debug out\n"); } + return D_8015BD80.sub.unk_104A; + } - OREG(0) &= ~8; + OREG(0) &= ~8; + } #endif - if (camera->status == CAM_STAT_UNK3) { - return camera->inputDir; - } + if (camera->status == CAM_STAT_UNK3) { + return camera->inputDir; + } - numQuakesApplied = Quake_Update(camera, &camShake); + numQuakesApplied = Quake_Update(camera, &camShake); - bgId = numQuakesApplied; // required to match + bgId = numQuakesApplied; // required to match - if ((numQuakesApplied != 0) && (camera->setting != CAM_SET_TURN_AROUND)) { - viewAt.x = camera->at.x + camShake.atOffset.x; - viewAt.y = camera->at.y + camShake.atOffset.y; - viewAt.z = camera->at.z + camShake.atOffset.z; + if ((numQuakesApplied != 0) && (camera->setting != CAM_SET_TURN_AROUND)) { + viewAt.x = camera->at.x + camShake.atOffset.x; + viewAt.y = camera->at.y + camShake.atOffset.y; + viewAt.z = camera->at.z + camShake.atOffset.z; - viewEye.x = camera->eye.x + camShake.eyeOffset.x; - viewEye.y = camera->eye.y + camShake.eyeOffset.y; - viewEye.z = camera->eye.z + camShake.eyeOffset.z; + viewEye.x = camera->eye.x + camShake.eyeOffset.x; + viewEye.y = camera->eye.y + camShake.eyeOffset.y; + viewEye.z = camera->eye.z + camShake.eyeOffset.z; - eyeAtAngle = OLib_Vec3fDiffToVecGeo(&viewEye, &viewAt); - viewUp = Camera_CalcUpFromPitchYawRoll(eyeAtAngle.pitch + camShake.upPitchOffset, - eyeAtAngle.yaw + camShake.upYawOffset, camera->roll); - viewFov = camera->fov + CAM_BINANG_TO_DEG(camShake.fovOffset); - } else { - viewAt = camera->at; - viewEye = camera->eye; - eyeAtAngle = OLib_Vec3fDiffToVecGeo(&viewEye, &viewAt); - viewUp = Camera_CalcUpFromPitchYawRoll(eyeAtAngle.pitch, eyeAtAngle.yaw, camera->roll); - viewFov = camera->fov; - } + eyeAtAngle = OLib_Vec3fDiffToVecGeo(&viewEye, &viewAt); + viewUp = Camera_CalcUpFromPitchYawRoll(eyeAtAngle.pitch + camShake.upPitchOffset, + eyeAtAngle.yaw + camShake.upYawOffset, camera->roll); + viewFov = camera->fov + CAM_BINANG_TO_DEG(camShake.fovOffset); + } else { + viewAt = camera->at; + viewEye = camera->eye; + eyeAtAngle = OLib_Vec3fDiffToVecGeo(&viewEye, &viewAt); + viewUp = Camera_CalcUpFromPitchYawRoll(eyeAtAngle.pitch, eyeAtAngle.yaw, camera->roll); + viewFov = camera->fov; + } - if (camera->viewFlags & CAM_VIEW_UP) { - camera->viewFlags &= ~CAM_VIEW_UP; - viewUp = camera->up; - } else { - camera->up = viewUp; - } + if (camera->viewFlags & CAM_VIEW_UP) { + camera->viewFlags &= ~CAM_VIEW_UP; + viewUp = camera->up; + } else { + camera->up = viewUp; + } - camera->quakeOffset = camShake.eyeOffset; + camera->quakeOffset = camShake.eyeOffset; - Camera_UpdateDistortion(camera); + Camera_UpdateDistortion(camera); - if ((camera->play->sceneId == SCENE_HYRULE_FIELD) && (camera->fov < 59.0f)) { - View_SetScale(&camera->play->view, 0.79f); - } else { - View_SetScale(&camera->play->view, 1.0f); - } - camera->play->view.fovy = viewFov; - View_LookAt(&camera->play->view, &viewEye, &viewAt, &viewUp); - camera->camDir.x = eyeAtAngle.pitch; - camera->camDir.y = eyeAtAngle.yaw; - camera->camDir.z = 0; - - if (sUpdateCameraDirection == 0) { - camera->inputDir.x = eyeAtAngle.pitch; - camera->inputDir.y = eyeAtAngle.yaw; - camera->inputDir.z = 0; - } + if ((camera->play->sceneId == SCENE_HYRULE_FIELD) && (camera->fov < 59.0f)) { + View_SetScale(&camera->play->view, 0.79f); + } else { + View_SetScale(&camera->play->view, 1.0f); + } + camera->play->view.fovy = viewFov; + View_LookAt(&camera->play->view, &viewEye, &viewAt, &viewUp); + camera->camDir.x = eyeAtAngle.pitch; + camera->camDir.y = eyeAtAngle.yaw; + camera->camDir.z = 0; - if (PREG(81)) { - PRINTF("dir (%d) %d(%f) %d(%f) 0(0) \n", sUpdateCameraDirection, camera->inputDir.x, - CAM_BINANG_TO_DEG(camera->inputDir.x), camera->inputDir.y, - CAM_BINANG_TO_DEG(camera->inputDir.y)); - PRINTF("real (%d) %d(%f) %d(%f) 0(0) \n", sUpdateCameraDirection, camera->camDir.x, - CAM_BINANG_TO_DEG(camera->camDir.x), camera->camDir.y, CAM_BINANG_TO_DEG(camera->camDir.y)); - } + if (sUpdateCameraDirection == 0) { + camera->inputDir.x = eyeAtAngle.pitch; + camera->inputDir.y = eyeAtAngle.yaw; + camera->inputDir.z = 0; + } -#if IS_CAMERA_DEBUG_ENABLED - if (camera->timer != -1 && CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_DRIGHT)) { - camera->timer = 0; - } -#endif + if (PREG(81)) { + PRINTF("dir (%d) %d(%f) %d(%f) 0(0) \n", sUpdateCameraDirection, camera->inputDir.x, + CAM_BINANG_TO_DEG(camera->inputDir.x), camera->inputDir.y, CAM_BINANG_TO_DEG(camera->inputDir.y)); + PRINTF("real (%d) %d(%f) %d(%f) 0(0) \n", sUpdateCameraDirection, camera->camDir.x, + CAM_BINANG_TO_DEG(camera->camDir.x), camera->camDir.y, CAM_BINANG_TO_DEG(camera->camDir.y)); + } - if (ENABLE_DEBUG_CAM_UPDATE) { - PRINTF("camera: out (%f %f %f) (%f %f %f)\n", camera->at.x, camera->at.y, camera->at.z, camera->eye.x, - camera->eye.y, camera->eye.z); - PRINTF("camera: dir (%f %d(%f) %d(%f)) (%f)\n", eyeAtAngle.r, eyeAtAngle.pitch, - CAM_BINANG_TO_DEG(eyeAtAngle.pitch), eyeAtAngle.yaw, CAM_BINANG_TO_DEG(eyeAtAngle.yaw), - camera->fov); - if (camera->player != NULL) { - PRINTF("camera: foot(%f %f %f) dist (%f)\n", curPlayerPosRot.pos.x, curPlayerPosRot.pos.y, - curPlayerPosRot.pos.z, camera->dist); - } - } +#if OOT_DEBUG + if (camera->timer != -1 && CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_DRIGHT)) { + camera->timer = 0; + } +#endif - return camera->inputDir; + if (ENABLE_DEBUG_CAM_UPDATE) { + PRINTF("camera: out (%f %f %f) (%f %f %f)\n", camera->at.x, camera->at.y, camera->at.z, camera->eye.x, + camera->eye.y, camera->eye.z); + PRINTF("camera: dir (%f %d(%f) %d(%f)) (%f)\n", eyeAtAngle.r, eyeAtAngle.pitch, + CAM_BINANG_TO_DEG(eyeAtAngle.pitch), eyeAtAngle.yaw, CAM_BINANG_TO_DEG(eyeAtAngle.yaw), camera->fov); + if (camera->player != NULL) { + PRINTF("camera: foot(%f %f %f) dist (%f)\n", curPlayerPosRot.pos.x, curPlayerPosRot.pos.y, + curPlayerPosRot.pos.z, camera->dist); } + } - /** - * When the camera's timer is 0, change the camera to its parent - */ - void Camera_Finish(Camera * camera) { - Camera* mainCam = camera->play->cameraPtrs[CAM_ID_MAIN]; - Player* player = GET_PLAYER(camera->play); - - if (camera->timer == 0) { - Play_ChangeCameraStatus(camera->play, camera->parentCamId, CAM_STAT_ACTIVE); - - if ((camera->parentCamId == CAM_ID_MAIN) && (camera->csId != 0)) { - player->actor.freezeTimer = 0; - player->stateFlags1 &= ~PLAYER_STATE1_29; + return camera->inputDir; +} - if (player->csAction != PLAYER_CSACTION_NONE) { - Player_SetCsActionWithHaltedActors(camera->play, &player->actor, PLAYER_CSACTION_7); - PRINTF("camera: player demo end!!\n"); - } +/** + * When the camera's timer is 0, change the camera to its parent + */ +void Camera_Finish(Camera* camera) { + Camera* mainCam = camera->play->cameraPtrs[CAM_ID_MAIN]; + Player* player = GET_PLAYER(camera->play); - mainCam->stateFlags |= CAM_STATE_EXTERNAL_FINISHED; - } + if (camera->timer == 0) { + Play_ChangeCameraStatus(camera->play, camera->parentCamId, CAM_STAT_ACTIVE); - if (CHILD_CAM(camera)->parentCamId == camera->camId) { - CHILD_CAM(camera)->parentCamId = camera->parentCamId; - } + if ((camera->parentCamId == CAM_ID_MAIN) && (camera->csId != 0)) { + player->actor.freezeTimer = 0; + player->stateFlags1 &= ~PLAYER_STATE1_29; - if (PARENT_CAM(camera)->childCamId == camera->camId) { - PARENT_CAM(camera)->childCamId = camera->childCamId; - } + if (player->csAction != PLAYER_CSACTION_NONE) { + Player_SetCsActionWithHaltedActors(camera->play, &player->actor, PLAYER_CSACTION_7); + PRINTF("camera: player demo end!!\n"); + } - if (PARENT_CAM(camera)->camId == CAM_ID_MAIN) { - PARENT_CAM(camera)->animState = 0; - } + mainCam->stateFlags |= CAM_STATE_EXTERNAL_FINISHED; + } - camera->childCamId = camera->parentCamId = CAM_ID_MAIN; - camera->timer = -1; - camera->play->envCtx.fillScreen = false; + if (CHILD_CAM(camera)->parentCamId == camera->camId) { + CHILD_CAM(camera)->parentCamId = camera->parentCamId; + } - Play_ClearCamera(camera->play, camera->camId); - } + if (PARENT_CAM(camera)->childCamId == camera->camId) { + PARENT_CAM(camera)->childCamId = camera->childCamId; } - s32 Camera_SetNewModeStateFlags(Camera * camera) { - camera->stateFlags |= (CAM_STATE_CHECK_BG | CAM_STATE_EXTERNAL_FINISHED); - camera->stateFlags &= ~(CAM_STATE_EXTERNAL_FINISHED | CAM_STATE_DEMO7); - return true; + if (PARENT_CAM(camera)->camId == CAM_ID_MAIN) { + PARENT_CAM(camera)->animState = 0; } + camera->childCamId = camera->parentCamId = CAM_ID_MAIN; + camera->timer = -1; + camera->play->envCtx.fillScreen = false; + + Play_ClearCamera(camera->play, camera->camId); + } +} + +s32 Camera_SetNewModeStateFlags(Camera* camera) { + camera->stateFlags |= (CAM_STATE_CHECK_BG | CAM_STATE_EXTERNAL_FINISHED); + camera->stateFlags &= ~(CAM_STATE_EXTERNAL_FINISHED | CAM_STATE_DEMO7); + return true; +} + #define CAM_REQUEST_MODE_FORCE_NO_SFX (1 << 0) #define CAM_REQUEST_MODE_SFX_ATTENTION (1 << 1) #define CAM_REQUEST_MODE_Z_TARGET_UNFRIENDLY (1 << 2) @@ -8348,292 +8352,289 @@ Vec3s Camera_Update(Camera* camera) { #define CAM_REQUEST_MODE_SKIP_ANIM_NORMAL_PARALLEL (1 << 4) // never set to #define CAM_REQUEST_MODE_SKIP_ANIM_FIRST_PERSON (1 << 5) - s32 Camera_RequestModeImpl(Camera * camera, s16 requestedMode, u8 forceModeChange) { - static s32 sModeRequestFlags = 0; +s32 Camera_RequestModeImpl(Camera* camera, s16 requestedMode, u8 forceModeChange) { + static s32 sModeRequestFlags = 0; #if IS_CAMERA_DEBUG_ENABLED - if (QREG(89)) { - PRINTF("+=+(%d)+=+ recive request -> %s\n", camera->play->state.frames, - sCameraModeNames[requestedMode]); - } + if (QREG(89)) { + PRINTF("+=+(%d)+=+ recive request -> %s\n", camera->play->state.frames, sCameraModeNames[requestedMode]); + } #endif - if ((camera->stateFlags & CAM_STATE_LOCK_MODE) && !forceModeChange) { - camera->behaviorFlags |= CAM_BEHAVIOR_MODE_VALID; - return -1; - } + if ((camera->stateFlags & CAM_STATE_LOCK_MODE) && !forceModeChange) { + camera->behaviorFlags |= CAM_BEHAVIOR_MODE_VALID; + return -1; + } - if (!((sCameraSettings[camera->setting].unk_00 & 0x3FFFFFFF) & (1 << requestedMode))) { - if (requestedMode == CAM_MODE_FIRST_PERSON) { - PRINTF("camera: error sound\n"); - Sfx_PlaySfxCentered(NA_SE_SY_ERROR); - } + if (!((sCameraSettings[camera->setting].unk_00 & 0x3FFFFFFF) & (1 << requestedMode))) { + if (requestedMode == CAM_MODE_FIRST_PERSON) { + PRINTF("camera: error sound\n"); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); + } - if (camera->mode != CAM_MODE_NORMAL) { + if (camera->mode != CAM_MODE_NORMAL) { #if IS_CAMERA_DEBUG_ENABLED - PRINTF(VT_COL(YELLOW, BLACK) "camera: change camera mode: force NORMAL: %s %s refused\n" VT_RST, - sCameraSettingNames[camera->setting], sCameraModeNames[requestedMode]); + PRINTF(VT_COL(YELLOW, BLACK) "camera: change camera mode: force NORMAL: %s %s refused\n" VT_RST, + sCameraSettingNames[camera->setting], sCameraModeNames[requestedMode]); #endif - camera->mode = CAM_MODE_NORMAL; - Camera_CopyDataToRegs(camera, camera->mode); - Camera_SetNewModeStateFlags(camera); - return 0xC0000000 | requestedMode; - } - - camera->behaviorFlags |= CAM_BEHAVIOR_MODE_VALID; - camera->behaviorFlags |= CAM_BEHAVIOR_MODE_SUCCESS; - return CAM_MODE_NORMAL; - } - - if ((requestedMode == camera->mode) && !forceModeChange) { - camera->behaviorFlags |= CAM_BEHAVIOR_MODE_VALID; - camera->behaviorFlags |= CAM_BEHAVIOR_MODE_SUCCESS; - return -1; - } + camera->mode = CAM_MODE_NORMAL; + Camera_CopyDataToRegs(camera, camera->mode); + Camera_SetNewModeStateFlags(camera); + return 0xC0000000 | requestedMode; + } - camera->behaviorFlags |= CAM_BEHAVIOR_MODE_VALID; - camera->behaviorFlags |= CAM_BEHAVIOR_MODE_SUCCESS; + camera->behaviorFlags |= CAM_BEHAVIOR_MODE_VALID; + camera->behaviorFlags |= CAM_BEHAVIOR_MODE_SUCCESS; + return CAM_MODE_NORMAL; + } - Camera_CopyDataToRegs(camera, requestedMode); + if ((requestedMode == camera->mode) && !forceModeChange) { + camera->behaviorFlags |= CAM_BEHAVIOR_MODE_VALID; + camera->behaviorFlags |= CAM_BEHAVIOR_MODE_SUCCESS; + return -1; + } - sModeRequestFlags = 0; + camera->behaviorFlags |= CAM_BEHAVIOR_MODE_VALID; + camera->behaviorFlags |= CAM_BEHAVIOR_MODE_SUCCESS; - // requested camMode - switch (requestedMode) { - case CAM_MODE_FIRST_PERSON: - sModeRequestFlags = CAM_REQUEST_MODE_SKIP_ANIM_FIRST_PERSON; - break; + Camera_CopyDataToRegs(camera, requestedMode); - case CAM_MODE_Z_TARGET_UNFRIENDLY: - sModeRequestFlags = CAM_REQUEST_MODE_Z_TARGET_UNFRIENDLY; - break; + sModeRequestFlags = 0; - case CAM_MODE_Z_TARGET_FRIENDLY: - if ((camera->target != NULL) && (camera->target->id != ACTOR_EN_BOOM)) { - sModeRequestFlags = CAM_REQUEST_MODE_Z_TARGET_FRIENDLY; - } - break; + // requested camMode + switch (requestedMode) { + case CAM_MODE_FIRST_PERSON: + sModeRequestFlags = CAM_REQUEST_MODE_SKIP_ANIM_FIRST_PERSON; + break; - case CAM_MODE_Z_PARALLEL: - case CAM_MODE_TALK: - case CAM_MODE_Z_AIM: - case CAM_MODE_Z_LEDGE_HANG: - case CAM_MODE_PUSH_PULL: - sModeRequestFlags = CAM_REQUEST_MODE_SFX_ATTENTION; - break; + case CAM_MODE_Z_TARGET_UNFRIENDLY: + sModeRequestFlags = CAM_REQUEST_MODE_Z_TARGET_UNFRIENDLY; + break; - default: - break; + case CAM_MODE_Z_TARGET_FRIENDLY: + if ((camera->target != NULL) && (camera->target->id != ACTOR_EN_BOOM)) { + sModeRequestFlags = CAM_REQUEST_MODE_Z_TARGET_FRIENDLY; } + break; - // If the requested mode is already the same as the current mode, - // then many modes will reset their animState to 10. - switch (camera->mode) { - case CAM_MODE_FIRST_PERSON: - if (sModeRequestFlags & CAM_REQUEST_MODE_SKIP_ANIM_FIRST_PERSON) { - camera->animState = 10; - } - break; - - case CAM_MODE_Z_PARALLEL: - if (sModeRequestFlags & CAM_REQUEST_MODE_SKIP_ANIM_NORMAL_PARALLEL) { - camera->animState = 10; - } - sModeRequestFlags |= CAM_REQUEST_MODE_FORCE_NO_SFX; - break; + case CAM_MODE_Z_PARALLEL: + case CAM_MODE_TALK: + case CAM_MODE_Z_AIM: + case CAM_MODE_Z_LEDGE_HANG: + case CAM_MODE_PUSH_PULL: + sModeRequestFlags = CAM_REQUEST_MODE_SFX_ATTENTION; + break; - case CAM_MODE_CHARGE: - sModeRequestFlags |= CAM_REQUEST_MODE_FORCE_NO_SFX; - break; + default: + break; + } - case CAM_MODE_Z_TARGET_FRIENDLY: - if (sModeRequestFlags & CAM_REQUEST_MODE_Z_TARGET_FRIENDLY) { - camera->animState = 10; - } - sModeRequestFlags |= CAM_REQUEST_MODE_FORCE_NO_SFX; - break; + // If the requested mode is already the same as the current mode, + // then many modes will reset their animState to 10. + switch (camera->mode) { + case CAM_MODE_FIRST_PERSON: + if (sModeRequestFlags & CAM_REQUEST_MODE_SKIP_ANIM_FIRST_PERSON) { + camera->animState = 10; + } + break; - case CAM_MODE_Z_TARGET_UNFRIENDLY: - if (sModeRequestFlags & CAM_REQUEST_MODE_Z_TARGET_UNFRIENDLY) { - camera->animState = 10; - } - sModeRequestFlags |= CAM_REQUEST_MODE_FORCE_NO_SFX; - break; + case CAM_MODE_Z_PARALLEL: + if (sModeRequestFlags & CAM_REQUEST_MODE_SKIP_ANIM_NORMAL_PARALLEL) { + camera->animState = 10; + } + sModeRequestFlags |= CAM_REQUEST_MODE_FORCE_NO_SFX; + break; - case CAM_MODE_Z_AIM: - case CAM_MODE_Z_LEDGE_HANG: - case CAM_MODE_PUSH_PULL: - sModeRequestFlags |= CAM_REQUEST_MODE_FORCE_NO_SFX; - break; + case CAM_MODE_CHARGE: + sModeRequestFlags |= CAM_REQUEST_MODE_FORCE_NO_SFX; + break; - case CAM_MODE_NORMAL: - if (sModeRequestFlags & CAM_REQUEST_MODE_SKIP_ANIM_NORMAL_PARALLEL) { - camera->animState = 10; - } - break; + case CAM_MODE_Z_TARGET_FRIENDLY: + if (sModeRequestFlags & CAM_REQUEST_MODE_Z_TARGET_FRIENDLY) { + camera->animState = 10; + } + sModeRequestFlags |= CAM_REQUEST_MODE_FORCE_NO_SFX; + break; - default: - break; + case CAM_MODE_Z_TARGET_UNFRIENDLY: + if (sModeRequestFlags & CAM_REQUEST_MODE_Z_TARGET_UNFRIENDLY) { + camera->animState = 10; } + sModeRequestFlags |= CAM_REQUEST_MODE_FORCE_NO_SFX; + break; - sModeRequestFlags &= ~CAM_REQUEST_MODE_SKIP_ANIM_NORMAL_PARALLEL; + case CAM_MODE_Z_AIM: + case CAM_MODE_Z_LEDGE_HANG: + case CAM_MODE_PUSH_PULL: + sModeRequestFlags |= CAM_REQUEST_MODE_FORCE_NO_SFX; + break; - // Choose a sound effect to play. - // Having `CAM_REQUEST_MODE_FORCE_NO_SFX` set often means `default` is taken from two bits being set - if (camera->status == CAM_STAT_ACTIVE) { - switch (sModeRequestFlags) { - case CAM_REQUEST_MODE_FORCE_NO_SFX: - Sfx_PlaySfxCentered(NA_SE_NONE); - break; + case CAM_MODE_NORMAL: + if (sModeRequestFlags & CAM_REQUEST_MODE_SKIP_ANIM_NORMAL_PARALLEL) { + camera->animState = 10; + } + break; - case CAM_REQUEST_MODE_SFX_ATTENTION: - if (camera->play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_1) { - Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_URGENCY); - } else { - Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_ON); - } - break; + default: + break; + } - case CAM_REQUEST_MODE_Z_TARGET_UNFRIENDLY: - Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_URGENCY); - break; + sModeRequestFlags &= ~CAM_REQUEST_MODE_SKIP_ANIM_NORMAL_PARALLEL; - case CAM_REQUEST_MODE_Z_TARGET_FRIENDLY: - Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_ON); - break; + // Choose a sound effect to play. + // Having `CAM_REQUEST_MODE_FORCE_NO_SFX` set often means `default` is taken from two bits being set + if (camera->status == CAM_STAT_ACTIVE) { + switch (sModeRequestFlags) { + case CAM_REQUEST_MODE_FORCE_NO_SFX: + Sfx_PlaySfxCentered(NA_SE_NONE); + break; - default: - break; + case CAM_REQUEST_MODE_SFX_ATTENTION: + if (camera->play->roomCtx.curRoom.type == ROOM_TYPE_DUNGEON) { + Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_URGENCY); + } else { + Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_ON); } - } + break; - Camera_SetNewModeStateFlags(camera); - camera->mode = requestedMode; + case CAM_REQUEST_MODE_Z_TARGET_UNFRIENDLY: + Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_URGENCY); + break; - return requestedMode | 0x80000000; - } + case CAM_REQUEST_MODE_Z_TARGET_FRIENDLY: + Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_ON); + break; - s32 Camera_RequestMode(Camera * camera, s16 mode) { - return Camera_RequestModeImpl(camera, mode, false); + default: + break; } + } - s32 Camera_CheckValidMode(Camera * camera, s16 mode) { + Camera_SetNewModeStateFlags(camera); + camera->mode = requestedMode; + + return requestedMode | 0x80000000; +} + +s32 Camera_RequestMode(Camera* camera, s16 mode) { + return Camera_RequestModeImpl(camera, mode, false); +} + +s32 Camera_CheckValidMode(Camera* camera, s16 mode) { #if IS_CAMERA_DEBUG_ENABLED - if (QREG(89) != 0) { - PRINTF("+=+=+=+ recive asking -> %s (%s)\n", sCameraModeNames[mode], - sCameraSettingNames[camera->setting]); - } + if (QREG(89) != 0) { + PRINTF("+=+=+=+ recive asking -> %s (%s)\n", sCameraModeNames[mode], sCameraSettingNames[camera->setting]); + } #endif - if (!(sCameraSettings[camera->setting].validModes & (1 << mode))) { - return 0; - } else if (mode == camera->mode) { - return -1; - } else { - return mode | 0x80000000; - } - } + if (!(sCameraSettings[camera->setting].validModes & (1 << mode))) { + return 0; + } else if (mode == camera->mode) { + return -1; + } else { + return mode | 0x80000000; + } +} - s16 Camera_RequestSettingImpl(Camera * camera, s16 requestedSetting, s16 flags) { - if (camera->behaviorFlags & CAM_BEHAVIOR_SETTING_CHECK_PRIORITY) { - // If a second setting is requested this frame, determine if the setting overwrites the - // current setting through priority - if (((sCameraSettings[camera->setting].unk_00 & 0xF000000) >> 0x18) >= - ((sCameraSettings[requestedSetting].unk_00 & 0xF000000) >> 0x18)) { - camera->behaviorFlags |= CAM_BEHAVIOR_SETTING_VALID; - return -2; - } - } +s16 Camera_RequestSettingImpl(Camera* camera, s16 requestedSetting, s16 flags) { + if (camera->behaviorFlags & CAM_BEHAVIOR_SETTING_CHECK_PRIORITY) { + // If a second setting is requested this frame, determine if the setting overwrites the + // current setting through priority + if (((sCameraSettings[camera->setting].unk_00 & 0xF000000) >> 0x18) >= + ((sCameraSettings[requestedSetting].unk_00 & 0xF000000) >> 0x18)) { + camera->behaviorFlags |= CAM_BEHAVIOR_SETTING_VALID; + return -2; + } + } - if (((requestedSetting == CAM_SET_MEADOW_BIRDS_EYE) || (requestedSetting == CAM_SET_MEADOW_UNUSED)) && - LINK_IS_ADULT && (camera->play->sceneId == SCENE_SACRED_FOREST_MEADOW)) { - camera->behaviorFlags |= CAM_BEHAVIOR_SETTING_VALID; - return -5; - } + if (((requestedSetting == CAM_SET_MEADOW_BIRDS_EYE) || (requestedSetting == CAM_SET_MEADOW_UNUSED)) && + LINK_IS_ADULT && (camera->play->sceneId == SCENE_SACRED_FOREST_MEADOW)) { + camera->behaviorFlags |= CAM_BEHAVIOR_SETTING_VALID; + return -5; + } - if ((requestedSetting == CAM_SET_NONE) || (requestedSetting >= CAM_SET_MAX)) { - PRINTF(VT_COL(RED, WHITE) "camera: error: illegal camera set (%d) !!!!\n" VT_RST, requestedSetting); - return -99; - } + if ((requestedSetting == CAM_SET_NONE) || (requestedSetting >= CAM_SET_MAX)) { + PRINTF(VT_COL(RED, WHITE) "camera: error: illegal camera set (%d) !!!!\n" VT_RST, requestedSetting); + return -99; + } - if ((requestedSetting == camera->setting) && !(flags & CAM_REQUEST_SETTING_FORCE_CHANGE)) { - camera->behaviorFlags |= CAM_BEHAVIOR_SETTING_VALID; - if (!(flags & CAM_REQUEST_SETTING_IGNORE_PRIORITY)) { - camera->behaviorFlags |= CAM_BEHAVIOR_SETTING_CHECK_PRIORITY; - } - return -1; - } + if ((requestedSetting == camera->setting) && !(flags & CAM_REQUEST_SETTING_FORCE_CHANGE)) { + camera->behaviorFlags |= CAM_BEHAVIOR_SETTING_VALID; + if (!(flags & CAM_REQUEST_SETTING_IGNORE_PRIORITY)) { + camera->behaviorFlags |= CAM_BEHAVIOR_SETTING_CHECK_PRIORITY; + } + return -1; + } - camera->behaviorFlags |= CAM_BEHAVIOR_SETTING_VALID; + camera->behaviorFlags |= CAM_BEHAVIOR_SETTING_VALID; - if (!(flags & CAM_REQUEST_SETTING_IGNORE_PRIORITY)) { - camera->behaviorFlags |= CAM_BEHAVIOR_SETTING_CHECK_PRIORITY; - } + if (!(flags & CAM_REQUEST_SETTING_IGNORE_PRIORITY)) { + camera->behaviorFlags |= CAM_BEHAVIOR_SETTING_CHECK_PRIORITY; + } - camera->stateFlags |= (CAM_STATE_CHECK_BG | CAM_STATE_EXTERNAL_FINISHED); - camera->stateFlags &= ~(CAM_STATE_EXTERNAL_FINISHED | CAM_STATE_DEMO7); + camera->stateFlags |= (CAM_STATE_CHECK_BG | CAM_STATE_EXTERNAL_FINISHED); + camera->stateFlags &= ~(CAM_STATE_EXTERNAL_FINISHED | CAM_STATE_DEMO7); - if (!(sCameraSettings[camera->setting].unk_00 & 0x40000000)) { - camera->prevSetting = camera->setting; - } + if (!(sCameraSettings[camera->setting].unk_00 & 0x40000000)) { + camera->prevSetting = camera->setting; + } - if (flags & CAM_REQUEST_SETTING_RESTORE_PREV_BG_CAM_INDEX) { - if (1) {} - camera->bgCamIndex = camera->prevBgCamIndex; - camera->prevBgCamIndex = -1; - } else if (!(flags & CAM_REQUEST_SETTING_PRESERVE_BG_CAM_INDEX)) { - if (!(sCameraSettings[camera->setting].unk_00 & 0x40000000)) { - camera->prevBgCamIndex = camera->bgCamIndex; - } - camera->bgCamIndex = -1; - } + if (flags & CAM_REQUEST_SETTING_RESTORE_PREV_BG_CAM_INDEX) { + if (1) {} + camera->bgCamIndex = camera->prevBgCamIndex; + camera->prevBgCamIndex = -1; + } else if (!(flags & CAM_REQUEST_SETTING_PRESERVE_BG_CAM_INDEX)) { + if (!(sCameraSettings[camera->setting].unk_00 & 0x40000000)) { + camera->prevBgCamIndex = camera->bgCamIndex; + } + camera->bgCamIndex = -1; + } - camera->setting = requestedSetting; + camera->setting = requestedSetting; - if (Camera_RequestModeImpl(camera, camera->mode, true) >= 0) { - Camera_CopyDataToRegs(camera, camera->mode); - } + if (Camera_RequestModeImpl(camera, camera->mode, true) >= 0) { + Camera_CopyDataToRegs(camera, camera->mode); + } #if IS_CAMERA_DEBUG_ENABLED - PRINTF(VT_SGR("1") "%06u:" VT_RST " camera: change camera[%d] set %s\n", camera->play->state.frames, - camera->camId, sCameraSettingNames[camera->setting]); + PRINTF(VT_SGR("1") "%06u:" VT_RST " camera: change camera[%d] set %s\n", camera->play->state.frames, camera->camId, + sCameraSettingNames[camera->setting]); #endif - return requestedSetting; - } + return requestedSetting; +} - s32 Camera_RequestSetting(Camera * camera, s16 setting) { - return Camera_RequestSettingImpl(camera, setting, 0); - } +s32 Camera_RequestSetting(Camera* camera, s16 setting) { + return Camera_RequestSettingImpl(camera, setting, 0); +} - s32 Camera_RequestBgCam(Camera * camera, s32 requestedBgCamIndex) { - s16 requestedCamSetting; - s16 settingChangeSuccessful; +s32 Camera_RequestBgCam(Camera* camera, s32 requestedBgCamIndex) { + s16 requestedCamSetting; + s16 settingChangeSuccessful; - if ((requestedBgCamIndex == -1) || (requestedBgCamIndex == camera->bgCamIndex)) { - camera->behaviorFlags |= CAM_BEHAVIOR_BG_PROCESSED; - return -1; - } + if ((requestedBgCamIndex == -1) || (requestedBgCamIndex == camera->bgCamIndex)) { + camera->behaviorFlags |= CAM_BEHAVIOR_BG_PROCESSED; + return -1; + } - if (!(camera->behaviorFlags & CAM_BEHAVIOR_BG_PROCESSED)) { - requestedCamSetting = Camera_GetBgCamSetting(camera, requestedBgCamIndex); - camera->behaviorFlags |= CAM_BEHAVIOR_BG_PROCESSED; -#if IS_CAMERA_DEBUG_ENABLED - settingChangeSuccessful = Camera_RequestSettingImpl(camera, requestedCamSetting, - CAM_REQUEST_SETTING_PRESERVE_BG_CAM_INDEX | - CAM_REQUEST_SETTING_FORCE_CHANGE) >= 0; - if ((settingChangeSuccessful != CAM_SET_NONE) || - (sCameraSettings[camera->setting].unk_00 & 0x80000000)) { - camera->bgCamIndex = requestedBgCamIndex; - camera->behaviorFlags |= CAM_BEHAVIOR_BG_SUCCESS; - Camera_CopyDataToRegs(camera, camera->mode); - } else if (settingChangeSuccessful < -1) { - //! @bug: `settingChangeSuccessful` is a bool and is likely checking the wrong value. This can never - //! pass. - // The actual return of Camera_RequestSettingImpl or bgCamIndex would make more sense. - PRINTF(VT_COL(RED, WHITE) "camera: error: illegal camera ID (%d) !! (%d|%d|%d)\n" VT_RST, - requestedBgCamIndex, camera->camId, BGCHECK_SCENE, requestedCamSetting); - } + if (!(camera->behaviorFlags & CAM_BEHAVIOR_BG_PROCESSED)) { + requestedCamSetting = Camera_GetBgCamSetting(camera, requestedBgCamIndex); + camera->behaviorFlags |= CAM_BEHAVIOR_BG_PROCESSED; +#if OOT_DEBUG + settingChangeSuccessful = Camera_RequestSettingImpl(camera, requestedCamSetting, + CAM_REQUEST_SETTING_PRESERVE_BG_CAM_INDEX | + CAM_REQUEST_SETTING_FORCE_CHANGE) >= 0; + if ((settingChangeSuccessful != CAM_SET_NONE) || (sCameraSettings[camera->setting].unk_00 & 0x80000000)) { + camera->bgCamIndex = requestedBgCamIndex; + camera->behaviorFlags |= CAM_BEHAVIOR_BG_SUCCESS; + Camera_CopyDataToRegs(camera, camera->mode); + } else if (settingChangeSuccessful < -1) { + //! @bug: `settingChangeSuccessful` is a bool and is likely checking the wrong value. This can never + //! pass. + // The actual return of Camera_RequestSettingImpl or bgCamIndex would make more sense. + PRINTF(VT_COL(RED, WHITE) "camera: error: illegal camera ID (%d) !! (%d|%d|%d)\n" VT_RST, + requestedBgCamIndex, camera->camId, BGCHECK_SCENE, requestedCamSetting); + } #else if ((Camera_RequestSettingImpl(camera, requestedCamSetting, CAM_REQUEST_SETTING_PRESERVE_BG_CAM_INDEX | CAM_REQUEST_SETTING_FORCE_CHANGE) >= @@ -8644,319 +8645,319 @@ Vec3s Camera_Update(Camera* camera) { Camera_CopyDataToRegs(camera, camera->mode); } #endif - return 0x80000000 | requestedBgCamIndex; - } + return 0x80000000 | requestedBgCamIndex; + } - //! @note: no return here, but return is unused - } + //! @note: no return here, but return is unused +} - Vec3s Camera_GetInputDir(Camera * camera) { +Vec3s Camera_GetInputDir(Camera* camera) { #if IS_CAMERA_DEBUG_ENABLED - if (gDebugCamEnabled) { - return D_8015BD80.sub.unk_104A; - } + if (gDebugCamEnabled) { + return D_8015BD80.sub.unk_104A; + } #endif - return camera->inputDir; - } + return camera->inputDir; +} - s16 Camera_GetInputDirPitch(Camera * camera) { - Vec3s dir = Camera_GetInputDir(camera); +s16 Camera_GetInputDirPitch(Camera* camera) { + Vec3s dir = Camera_GetInputDir(camera); - return dir.x; - } + return dir.x; +} - s16 Camera_GetInputDirYaw(Camera * camera) { - Vec3s dir = Camera_GetInputDir(camera); +s16 Camera_GetInputDirYaw(Camera* camera) { + Vec3s dir = Camera_GetInputDir(camera); - return dir.y; - } + return dir.y; +} - Vec3s Camera_GetCamDir(Camera * camera) { +Vec3s Camera_GetCamDir(Camera* camera) { #if IS_CAMERA_DEBUG_ENABLED - if (gDebugCamEnabled) { - return D_8015BD80.sub.unk_104A; - } + if (gDebugCamEnabled) { + return D_8015BD80.sub.unk_104A; + } #endif - return camera->camDir; - } + return camera->camDir; +} - s16 Camera_GetCamDirPitch(Camera * camera) { - Vec3s camDir = Camera_GetCamDir(camera); +s16 Camera_GetCamDirPitch(Camera* camera) { + Vec3s camDir = Camera_GetCamDir(camera); - return camDir.x; - } + return camDir.x; +} - s16 Camera_GetCamDirYaw(Camera * camera) { - Vec3s camDir = Camera_GetCamDir(camera); +s16 Camera_GetCamDirYaw(Camera* camera) { + Vec3s camDir = Camera_GetCamDir(camera); - return camDir.y; - } + return camDir.y; +} - s32 Camera_RequestQuake(Camera * camera, s32 unused, s16 y, s32 duration) { - s16 quakeIndex; +s32 Camera_RequestQuake(Camera* camera, s32 unused, s16 y, s32 duration) { + s16 quakeIndex; - quakeIndex = Quake_Request(camera, QUAKE_TYPE_3); - if (quakeIndex == 0) { - return false; - } - Quake_SetSpeed(quakeIndex, 0x61A8); - Quake_SetPerturbations(quakeIndex, y, 0, 0, 0); - Quake_SetDuration(quakeIndex, duration); - return true; - } + quakeIndex = Quake_Request(camera, QUAKE_TYPE_3); + if (quakeIndex == 0) { + return false; + } + Quake_SetSpeed(quakeIndex, 0x61A8); + Quake_SetPerturbations(quakeIndex, y, 0, 0, 0); + Quake_SetDuration(quakeIndex, duration); + return true; +} - s32 Camera_SetViewParam(Camera * camera, s32 viewFlag, void* param) { - s32 pad[3]; +s32 Camera_SetViewParam(Camera* camera, s32 viewFlag, void* param) { + s32 pad[3]; - if (param != NULL) { - switch (viewFlag) { - case CAM_VIEW_AT: - camera->viewFlags &= ~(CAM_VIEW_AT | CAM_VIEW_TARGET | CAM_VIEW_TARGET_POS); - camera->at = *(Vec3f*)param; - break; + if (param != NULL) { + switch (viewFlag) { + case CAM_VIEW_AT: + camera->viewFlags &= ~(CAM_VIEW_AT | CAM_VIEW_TARGET | CAM_VIEW_TARGET_POS); + camera->at = *(Vec3f*)param; + break; - case CAM_VIEW_TARGET_POS: - camera->viewFlags &= ~(CAM_VIEW_AT | CAM_VIEW_TARGET | CAM_VIEW_TARGET_POS); - camera->targetPosRot.pos = *(Vec3f*)param; - break; + case CAM_VIEW_TARGET_POS: + camera->viewFlags &= ~(CAM_VIEW_AT | CAM_VIEW_TARGET | CAM_VIEW_TARGET_POS); + camera->targetPosRot.pos = *(Vec3f*)param; + break; - case CAM_VIEW_TARGET: - if (camera->setting != CAM_SET_CS_C && camera->setting != CAM_SET_CS_ATTENTION) { - camera->target = (Actor*)param; - camera->viewFlags &= ~(CAM_VIEW_AT | CAM_VIEW_TARGET | CAM_VIEW_TARGET_POS); - } - break; + case CAM_VIEW_TARGET: + if (camera->setting != CAM_SET_CS_C && camera->setting != CAM_SET_CS_ATTENTION) { + camera->target = (Actor*)param; + camera->viewFlags &= ~(CAM_VIEW_AT | CAM_VIEW_TARGET | CAM_VIEW_TARGET_POS); + } + break; - case CAM_VIEW_EYE: - camera->eye = camera->eyeNext = *(Vec3f*)param; - break; + case CAM_VIEW_EYE: + camera->eye = camera->eyeNext = *(Vec3f*)param; + break; - case CAM_VIEW_UP: - camera->up = *(Vec3f*)param; - break; + case CAM_VIEW_UP: + camera->up = *(Vec3f*)param; + break; - case CAM_VIEW_ROLL: - camera->roll = CAM_DEG_TO_BINANG(*(f32*)param); - break; + case CAM_VIEW_ROLL: + camera->roll = CAM_DEG_TO_BINANG(*(f32*)param); + break; - case CAM_VIEW_FOV: - camera->fov = *(f32*)param; - break; + case CAM_VIEW_FOV: + camera->fov = *(f32*)param; + break; - default: - return false; - } - camera->viewFlags |= viewFlag; - } else { + default: return false; - } - return true; } + camera->viewFlags |= viewFlag; + } else { + return false; + } + return true; +} - s32 Camera_UnsetViewFlag(Camera * camera, s16 viewFlag) { - camera->viewFlags &= ~viewFlag; - return true; - } +s32 Camera_UnsetViewFlag(Camera* camera, s16 viewFlag) { + camera->viewFlags &= ~viewFlag; + return true; +} - s32 Camera_OverwriteStateFlags(Camera * camera, s16 stateFlags) { - camera->stateFlags = stateFlags; - return true; - } +s32 Camera_OverwriteStateFlags(Camera* camera, s16 stateFlags) { + camera->stateFlags = stateFlags; + return true; +} - s32 Camera_ResetAnim(Camera * camera) { - camera->animState = 0; - return 1; - } +s32 Camera_ResetAnim(Camera* camera) { + camera->animState = 0; + return 1; +} - s32 Camera_SetCSParams(Camera * camera, CutsceneCameraPoint * atPoints, CutsceneCameraPoint * eyePoints, - Player * player, s16 relativeToPlayer) { - PosRot playerPosRot; +s32 Camera_SetCSParams(Camera* camera, CutsceneCameraPoint* atPoints, CutsceneCameraPoint* eyePoints, Player* player, + s16 relativeToPlayer) { + PosRot playerPosRot; - camera->data0 = atPoints; - camera->data1 = eyePoints; - camera->data2 = relativeToPlayer; + camera->data0 = atPoints; + camera->data1 = eyePoints; + camera->data2 = relativeToPlayer; - if (camera->data2 != 0) { - camera->player = player; - playerPosRot = Actor_GetWorldPosShapeRot(&player->actor); - camera->playerPosRot = playerPosRot; + if (camera->data2 != 0) { + camera->player = player; + playerPosRot = Actor_GetWorldPosShapeRot(&player->actor); + camera->playerPosRot = playerPosRot; - camera->nextBgCamIndex = -1; - camera->xzSpeed = 0.0f; - camera->speedRatio = 0.0f; - } + camera->nextBgCamIndex = -1; + camera->xzSpeed = 0.0f; + camera->speedRatio = 0.0f; + } - return 1; - } + return 1; +} - s16 Camera_SetStateFlag(Camera * camera, s16 stateFlag) { - camera->stateFlags |= stateFlag; - return camera->stateFlags; - } +s16 Camera_SetStateFlag(Camera* camera, s16 stateFlag) { + camera->stateFlags |= stateFlag; + return camera->stateFlags; +} - s16 Camera_UnsetStateFlag(Camera * camera, s16 stateFlag) { - camera->stateFlags &= ~stateFlag; - return camera->stateFlags; - } +s16 Camera_UnsetStateFlag(Camera* camera, s16 stateFlag) { + camera->stateFlags &= ~stateFlag; + return camera->stateFlags; +} - /** - * A bgCamIndex of -99 will save the door params without changing the camera setting - * A bgCamIndex of -1 uses the default door camera setting (CAM_SET_DOORC) - * Otherwise, change the door camera setting by reading the bgCam indexed at bgCamIndex - */ - s32 Camera_ChangeDoorCam(Camera * camera, Actor * doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2, - s16 timer3) { - DoorParams* doorParams = &camera->paramData.doorParams; +/** + * A bgCamIndex of -99 will save the door params without changing the camera setting + * A bgCamIndex of -1 uses the default door camera setting (CAM_SET_DOORC) + * Otherwise, change the door camera setting by reading the bgCam indexed at bgCamIndex + */ +s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2, + s16 timer3) { + DoorParams* doorParams = &camera->paramData.doorParams; - if ((camera->setting == CAM_SET_CS_ATTENTION) || (camera->setting == CAM_SET_DOORC)) { - return 0; - } + if ((camera->setting == CAM_SET_CS_ATTENTION) || (camera->setting == CAM_SET_DOORC)) { + return 0; + } - doorParams->doorActor = doorActor; - doorParams->timer1 = timer1; - doorParams->timer2 = timer2; - doorParams->timer3 = timer3; - doorParams->bgCamIndex = bgCamIndex; + doorParams->doorActor = doorActor; + doorParams->timer1 = timer1; + doorParams->timer2 = timer2; + doorParams->timer3 = timer3; + doorParams->bgCamIndex = bgCamIndex; - if (bgCamIndex == -99) { - Camera_CopyDataToRegs(camera, camera->mode); - return -99; - } + if (bgCamIndex == -99) { + Camera_CopyDataToRegs(camera, camera->mode); + return -99; + } - if (bgCamIndex == -1) { - Camera_RequestSetting(camera, CAM_SET_DOORC); - PRINTF(".... change default door camera (set %d)\n", CAM_SET_DOORC); - } else { - s32 setting = Camera_GetBgCamSetting(camera, bgCamIndex); + if (bgCamIndex == -1) { + Camera_RequestSetting(camera, CAM_SET_DOORC); + PRINTF(".... change default door camera (set %d)\n", CAM_SET_DOORC); + } else { + s32 setting = Camera_GetBgCamSetting(camera, bgCamIndex); - camera->behaviorFlags |= CAM_BEHAVIOR_BG_PROCESSED; + camera->behaviorFlags |= CAM_BEHAVIOR_BG_PROCESSED; - if (Camera_RequestSetting(camera, setting) >= 0) { - camera->bgCamIndex = bgCamIndex; - camera->behaviorFlags |= CAM_BEHAVIOR_BG_SUCCESS; - } + if (Camera_RequestSetting(camera, setting) >= 0) { + camera->bgCamIndex = bgCamIndex; + camera->behaviorFlags |= CAM_BEHAVIOR_BG_SUCCESS; + } - PRINTF("....change door camera ID %d (set %d)\n", camera->bgCamIndex, camera->setting); - } + PRINTF("....change door camera ID %d (set %d)\n", camera->bgCamIndex, camera->setting); + } - Camera_CopyDataToRegs(camera, camera->mode); - return -1; - } + Camera_CopyDataToRegs(camera, camera->mode); + return -1; +} - s32 Camera_Copy(Camera * dstCamera, Camera * srcCamera) { - dstCamera->playerToAtOffset.x = dstCamera->playerToAtOffset.y = dstCamera->playerToAtOffset.z = 0.0f; - dstCamera->atLERPStepScale = 0.1f; - dstCamera->at = srcCamera->at; +s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera) { + dstCamera->playerToAtOffset.x = dstCamera->playerToAtOffset.y = dstCamera->playerToAtOffset.z = 0.0f; + dstCamera->atLERPStepScale = 0.1f; + dstCamera->at = srcCamera->at; - dstCamera->eye = dstCamera->eyeNext = srcCamera->eye; + dstCamera->eye = dstCamera->eyeNext = srcCamera->eye; - dstCamera->dist = OLib_Vec3fDist(&dstCamera->at, &dstCamera->eye); - dstCamera->fov = srcCamera->fov; - dstCamera->roll = srcCamera->roll; - func_80043B60(dstCamera); + dstCamera->dist = OLib_Vec3fDist(&dstCamera->at, &dstCamera->eye); + dstCamera->fov = srcCamera->fov; + dstCamera->roll = srcCamera->roll; + func_80043B60(dstCamera); - if (dstCamera->player != NULL) { - dstCamera->playerPosRot = Actor_GetWorld(&dstCamera->player->actor); - dstCamera->playerToAtOffset.x = dstCamera->at.x - dstCamera->playerPosRot.pos.x; - dstCamera->playerToAtOffset.y = dstCamera->at.y - dstCamera->playerPosRot.pos.y; - dstCamera->playerToAtOffset.z = dstCamera->at.z - dstCamera->playerPosRot.pos.z; - dstCamera->dist = OLib_Vec3fDist(&dstCamera->playerPosRot.pos, &dstCamera->eye); - dstCamera->xzOffsetUpdateRate = 1.0f; - dstCamera->yOffsetUpdateRate = 1.0f; - } - return true; - } + if (dstCamera->player != NULL) { + dstCamera->playerPosRot = Actor_GetWorld(&dstCamera->player->actor); + dstCamera->playerToAtOffset.x = dstCamera->at.x - dstCamera->playerPosRot.pos.x; + dstCamera->playerToAtOffset.y = dstCamera->at.y - dstCamera->playerPosRot.pos.y; + dstCamera->playerToAtOffset.z = dstCamera->at.z - dstCamera->playerPosRot.pos.z; + dstCamera->dist = OLib_Vec3fDist(&dstCamera->playerPosRot.pos, &dstCamera->eye); + dstCamera->xzOffsetUpdateRate = 1.0f; + dstCamera->yOffsetUpdateRate = 1.0f; + } + return true; +} - s32 Camera_IsDebugCamEnabled(void) { +s32 Camera_IsDebugCamEnabled(void) { #if IS_CAMERA_DEBUG_ENABLED - return gDebugCamEnabled; + return gDebugCamEnabled; #else return false; #endif - } +} - Vec3f Camera_GetQuakeOffset(Camera * camera) { - return camera->quakeOffset; - } +Vec3f Camera_GetQuakeOffset(Camera* camera) { + return camera->quakeOffset; +} - void Camera_SetCameraData(Camera * camera, s16 setDataFlags, void* data0, void* data1, s16 data2, s16 data3, - UNK_TYPE arg6) { - if (setDataFlags & 0x1) { - camera->data0 = data0; - } +void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* data1, s16 data2, s16 data3, + UNK_TYPE arg6) { + if (setDataFlags & 0x1) { + camera->data0 = data0; + } - if (setDataFlags & 0x2) { - camera->data1 = data1; - } + if (setDataFlags & 0x2) { + camera->data1 = data1; + } - if (setDataFlags & 0x4) { - camera->data2 = data2; - } + if (setDataFlags & 0x4) { + camera->data2 = data2; + } - if (setDataFlags & 0x8) { - camera->data3 = data3; - } + if (setDataFlags & 0x8) { + camera->data3 = data3; + } - if (setDataFlags & 0x10) { - PRINTF(VT_COL(RED, WHITE) "camera: setCameraData: last argument not alive!\n" VT_RST); - } - } + if (setDataFlags & 0x10) { + PRINTF(VT_COL(RED, WHITE) "camera: setCameraData: last argument not alive!\n" VT_RST); + } +} -#if IS_CAMERA_DEBUG_ENABLED - s32 Camera_QRegInit(void) { - if (!R_RELOAD_CAM_PARAMS) { - QREG(2) = 1; - QREG(10) = -1; - QREG(11) = 100; - QREG(12) = 80; - QREG(20) = 90; - QREG(21) = 10; - QREG(22) = 10; - QREG(23) = 50; - QREG(24) = 6000; - QREG(25) = 240; - QREG(26) = 40; - QREG(27) = 85; - QREG(28) = 55; - QREG(29) = 87; - QREG(30) = 23; - QREG(31) = 20; - QREG(32) = 4; - QREG(33) = 5; - QREG(50) = 1; - QREG(51) = 20; - QREG(52) = 200; - QREG(53) = 1; - QREG(54) = 15; - QREG(55) = 60; - QREG(56) = 15; - QREG(57) = 30; - QREG(58) = 0; - } +#if OOT_DEBUG +s32 Camera_QRegInit(void) { + if (!R_RELOAD_CAM_PARAMS) { + QREG(2) = 1; + QREG(10) = -1; + QREG(11) = 100; + QREG(12) = 80; + QREG(20) = 90; + QREG(21) = 10; + QREG(22) = 10; + QREG(23) = 50; + QREG(24) = 6000; + QREG(25) = 240; + QREG(26) = 40; + QREG(27) = 85; + QREG(28) = 55; + QREG(29) = 87; + QREG(30) = 23; + QREG(31) = 20; + QREG(32) = 4; + QREG(33) = 5; + QREG(50) = 1; + QREG(51) = 20; + QREG(52) = 200; + QREG(53) = 1; + QREG(54) = 15; + QREG(55) = 60; + QREG(56) = 15; + QREG(57) = 30; + QREG(58) = 0; + } - QREG(65) = 50; - return true; - } + QREG(65) = 50; + return true; +} #endif - s32 func_8005B198(void) { - return D_8011D3AC; - } +s32 func_8005B198(void) { + return D_8011D3AC; +} - /** - * Signal to the camera update function through stateFlags that something external has - * finished and is ready for the next camera setting/function - * Different camera update functions will respond differently to this flag being set. - */ - s16 Camera_SetFinishedFlag(Camera * camera) { - camera->stateFlags |= CAM_STATE_EXTERNAL_FINISHED; +/** + * Signal to the camera update function through stateFlags that something external has + * finished and is ready for the next camera setting/function + * Different camera update functions will respond differently to this flag being set. + */ +s16 Camera_SetFinishedFlag(Camera* camera) { + camera->stateFlags |= CAM_STATE_EXTERNAL_FINISHED; - if ((camera->camId == CAM_ID_MAIN) && (camera->play->activeCamId != CAM_ID_MAIN)) { - GET_ACTIVE_CAM(camera->play)->stateFlags |= CAM_STATE_EXTERNAL_FINISHED; - return camera->play->activeCamId; - } + if ((camera->camId == CAM_ID_MAIN) && (camera->play->activeCamId != CAM_ID_MAIN)) { + GET_ACTIVE_CAM(camera->play)->stateFlags |= CAM_STATE_EXTERNAL_FINISHED; + return camera->play->activeCamId; + } - return camera->camId; - } + return camera->camId; +} diff --git a/src/code/z_camera_data.inc.c b/src/code/z_camera_data.inc.c index 8c64d260ab..0676150c69 100644 --- a/src/code/z_camera_data.inc.c +++ b/src/code/z_camera_data.inc.c @@ -1,18 +1,18 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct CameraModeValue { s16 val; s16 dataType; } CameraModeValue; -typedef struct { +typedef struct CameraMode { s16 funcIdx; s16 valueCnt; CameraModeValue* values; } CameraMode; -typedef struct { +typedef struct CameraSetting { union { u32 unk_00; struct { diff --git a/src/code/z_cheap_proc.inc.c b/src/code/z_cheap_proc.inc.c index db646129f4..059f67c02b 100644 --- a/src/code/z_cheap_proc.inc.c +++ b/src/code/z_cheap_proc.inc.c @@ -4,7 +4,7 @@ void Gfx_DrawDListOpa(PlayState* play, Gfx* dlist) { OPEN_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 214); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_cheap_proc.c", 216), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_cheap_proc.c", 216); gSPDisplayList(POLY_OPA_DISP++, dlist); CLOSE_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 219); @@ -14,7 +14,7 @@ void Gfx_DrawDListXlu(PlayState* play, Gfx* dlist) { OPEN_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 228); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_cheap_proc.c", 230), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_cheap_proc.c", 230); gSPDisplayList(POLY_XLU_DISP++, dlist); CLOSE_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 233); diff --git a/src/code/z_collision_btltbls.c b/src/code/z_collision_btltbls.c index 3873cce0d5..1039371f7a 100644 --- a/src/code/z_collision_btltbls.c +++ b/src/code/z_collision_btltbls.c @@ -811,7 +811,7 @@ static DamageTable sDamageTablePresets[] = { // Gets the pointer to one of the 23 preset damage tables. Returns NULL if index is out of range. DamageTable* DamageTable_Get(s32 index) { if (!(0 <= index && index < ARRAY_COUNT(sDamageTablePresets))) { - PRINTF("CollisionBtlTbl_get():インデックスオーバー\n"); // "Index over" + PRINTF(T("CollisionBtlTbl_get():インデックスオーバー\n", "CollisionBtlTbl_get(): Index over\n")); return NULL; } return &sDamageTablePresets[index]; diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 46a9a3ba56..2e29d89161 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1,9 +1,22 @@ -#include "global.h" +#include "gfx.h" +#include "macros.h" +#include "regs.h" +#include "sfx.h" +#include "sys_math3d.h" +#include "sys_matrix.h" #include "terminal.h" - +#include "versions.h" +#include "z64collision_check.h" +#include "z64effect.h" #include "z64frame_advance.h" +#include "zelda_arena.h" +#include "z64play.h" #include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h" +#include "z_lib.h" + +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:104 pal-1.0:104 pal-1.1:104" typedef s32 (*ColChkResetFunc)(PlayState*, Collider*); typedef void (*ColChkApplyFunc)(PlayState*, CollisionCheckContext*, Collider*); @@ -12,10 +25,6 @@ typedef s32 (*ColChkLineFunc)(PlayState*, CollisionCheckContext*, Collider*, Vec #define SAC_ENABLE (1 << 0) -// For retail BSS ordering, the block number of sparkInit in CollisionCheck_BlueBlood -// must be between 183 and 255 inclusive. -#pragma increment_block_number 50 - #if IS_DEBUG /** * Draws a red triangle with vertices vA, vB, and vC. @@ -83,7 +92,7 @@ void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, s32 Collider_InitBase(PlayState* play, Collider* col) { static Collider init = { - NULL, NULL, NULL, NULL, AT_NONE, AC_NONE, OC1_NONE, OC2_NONE, COLTYPE_HIT3, COLSHAPE_MAX, + NULL, NULL, NULL, NULL, AT_NONE, AC_NONE, OC1_NONE, OC2_NONE, COL_MATERIAL_HIT3, COLSHAPE_MAX, }; *col = init; @@ -95,7 +104,7 @@ s32 Collider_DestroyBase(PlayState* play, Collider* col) { } /** - * Uses default OC2_TYPE_1 and COLTYPE_HIT0 + * Uses default OC2_TYPE_1 and COL_MATERIAL_HIT0 */ s32 Collider_SetBaseToActor(PlayState* play, Collider* col, ColliderInitToActor* src) { col->actor = src->actor; @@ -112,7 +121,7 @@ s32 Collider_SetBaseToActor(PlayState* play, Collider* col, ColliderInitToActor* */ s32 Collider_SetBaseType1(PlayState* play, Collider* col, Actor* actor, ColliderInitType1* src) { col->actor = actor; - col->colType = src->colType; + col->colMaterial = src->colMaterial; col->atFlags = src->atFlags; col->acFlags = src->acFlags; col->ocFlags1 = src->ocFlags1; @@ -123,7 +132,7 @@ s32 Collider_SetBaseType1(PlayState* play, Collider* col, Actor* actor, Collider s32 Collider_SetBase(PlayState* play, Collider* col, Actor* actor, ColliderInit* src) { col->actor = actor; - col->colType = src->colType; + col->colMaterial = src->colMaterial; col->atFlags = src->atFlags; col->acFlags = src->acFlags; col->ocFlags1 = src->ocFlags1; @@ -191,11 +200,16 @@ s32 Collider_SetElementDamageInfoAC(PlayState* play, ColliderElementDamageInfoAC s32 Collider_InitElement(PlayState* play, ColliderElement* elem) { static ColliderElement init = { - { 0, 0, 0 }, { 0xFFCFFFFF, 0, 0, { 0, 0, 0 } }, - ELEMTYPE_UNK0, ATELEM_NONE, - ACELEM_NONE, OCELEM_NONE, - NULL, NULL, - NULL, NULL, + { 0, 0, 0 }, + { 0xFFCFFFFF, 0, 0, { 0, 0, 0 } }, + ELEM_MATERIAL_UNK0, + ATELEM_NONE, + ACELEM_NONE, + OCELEM_NONE, + NULL, + NULL, + NULL, + NULL, }; *elem = init; @@ -211,7 +225,7 @@ s32 Collider_DestroyElement(PlayState* play, ColliderElement* elem) { } s32 Collider_SetElement(PlayState* play, ColliderElement* elem, ColliderElementInit* elemInit) { - elem->elemType = elemInit->elemType; + elem->elemMaterial = elemInit->elemMaterial; Collider_SetElementDamageInfoAT(play, &elem->atDmgInfo, &elemInit->atDmgInfo); Collider_SetElementDamageInfoAC(play, &elem->acDmgInfo, &elemInit->acDmgInfo); elem->atElemFlags = elemInit->atElemFlags; @@ -341,7 +355,7 @@ s32 Collider_DestroyJntSph(PlayState* play, ColliderJntSph* jntSph) { /** * Sets up the ColliderJntSph using the values in src, sets it to the actor specified in src, and dynamically allocates - * the element array. Uses default OC2_TYPE_1 and COLTYPE_HIT0. Unused. + * the element array. Uses default OC2_TYPE_1 and COL_MATERIAL_HIT0. Unused. */ s32 Collider_SetJntSphToActor(PlayState* play, ColliderJntSph* dest, ColliderJntSphInitToActor* src) { ColliderJntSphElement* destElem; @@ -354,7 +368,7 @@ s32 Collider_SetJntSphToActor(PlayState* play, ColliderJntSph* dest, ColliderJnt if (dest->elements == NULL) { dest->count = 0; PRINTF(VT_FGCOL(RED)); - PRINTF("ClObjJntSph_set():zelda_malloc()出来ません。\n"); // "Can not." + PRINTF(T("ClObjJntSph_set():zelda_malloc()出来ません。\n", "ClObjJntSph_set():zelda_malloc() Can not.\n")); PRINTF(VT_RST); return false; } @@ -382,7 +396,7 @@ s32 Collider_SetJntSphAllocType1(PlayState* play, ColliderJntSph* dest, Actor* a if (dest->elements == NULL) { dest->count = 0; PRINTF(VT_FGCOL(RED)); - PRINTF("ClObjJntSph_set3():zelda_malloc_出来ません。\n"); // "Can not." + PRINTF(T("ClObjJntSph_set3():zelda_malloc_出来ません。\n", "ClObjJntSph_set3():zelda_malloc_ Can not.\n")); PRINTF(VT_RST); return false; } @@ -410,7 +424,7 @@ s32 Collider_SetJntSphAlloc(PlayState* play, ColliderJntSph* dest, Actor* actor, if (dest->elements == NULL) { dest->count = 0; PRINTF(VT_FGCOL(RED)); - PRINTF("ClObjJntSph_set5():zelda_malloc出来ません\n"); // "Can not." + PRINTF(T("ClObjJntSph_set5():zelda_malloc出来ません\n", "ClObjJntSph_set5():zelda_malloc Can not\n")); PRINTF(VT_RST); return false; } @@ -526,7 +540,7 @@ s32 Collider_DestroyCylinder(PlayState* play, ColliderCylinder* cyl) { /** * Sets up the ColliderCylinder using the values in src and sets it to the actor specified in src. Uses default - * OC2_TYPE_1 and COLTYPE_0. Used only by DekuJr, who sets it to himself anyways. + * OC2_TYPE_1 and COL_MATERIAL_0. Used only by DekuJr, who sets it to himself anyways. */ s32 Collider_SetCylinderToActor(PlayState* play, ColliderCylinder* dest, ColliderCylinderInitToActor* src) { Collider_SetBaseToActor(play, &dest->base, &src->base); @@ -716,7 +730,7 @@ s32 Collider_SetTrisAllocType1(PlayState* play, ColliderTris* dest, Actor* actor if (dest->elements == NULL) { dest->count = 0; PRINTF(VT_FGCOL(RED)); - PRINTF("ClObjTris_set3():zelda_malloc()出来ません\n"); // "Can not." + PRINTF(T("ClObjTris_set3():zelda_malloc()出来ません\n", "ClObjTris_set3():zelda_malloc() Can not\n")); PRINTF(VT_RST); return false; } @@ -742,7 +756,7 @@ s32 Collider_SetTrisAlloc(PlayState* play, ColliderTris* dest, Actor* actor, Col if (dest->elements == NULL) { PRINTF(VT_FGCOL(RED)); - PRINTF("ClObjTris_set5():zelda_malloc出来ません\n"); // "Can not." + PRINTF(T("ClObjTris_set5():zelda_malloc出来ません\n", "ClObjTris_set5():zelda_malloc Can not\n")); PRINTF(VT_RST); dest->count = 0; return false; @@ -1173,8 +1187,8 @@ s32 CollisionCheck_SetAT(PlayState* play, CollisionCheckContext* colChkCtx, Coll return -1; } if (colChkCtx->colATCount >= COLLISION_CHECK_AT_MAX) { - // "Index exceeded and cannot add more" - PRINTF("CollisionCheck_setAT():インデックスがオーバーして追加不能\n"); + PRINTF(T("CollisionCheck_setAT():インデックスがオーバーして追加不能\n", + "CollisionCheck_setAT(): Index exceeded and cannot add more\n")); return -1; } if (colChkCtx->sacFlags & SAC_ENABLE) { @@ -1203,15 +1217,16 @@ s32 CollisionCheck_SetAT_SAC(PlayState* play, CollisionCheckContext* colChkCtx, } if (colChkCtx->sacFlags & SAC_ENABLE) { if (!(index < colChkCtx->colATCount)) { - // "You are trying to register a location that is larger than the total number of data." - PRINTF("CollisionCheck_setAT_SAC():全データ数より大きいところに登録しようとしている。\n"); + PRINTF(T("CollisionCheck_setAT_SAC():全データ数より大きいところに登録しようとしている。\n", + "CollisionCheck_setAT_SAC(): You are trying to register a location that is larger than the total " + "number of data.\n")); return -1; } colChkCtx->colAT[index] = collider; } else { if (!(colChkCtx->colATCount < COLLISION_CHECK_AT_MAX)) { - // "Index exceeded and cannot add more" - PRINTF("CollisionCheck_setAT():インデックスがオーバーして追加不能\n"); + PRINTF(T("CollisionCheck_setAT():インデックスがオーバーして追加不能\n", + "CollisionCheck_setAT(): Index exceeded and cannot add more\n")); return -1; } index = colChkCtx->colATCount; @@ -1244,8 +1259,8 @@ s32 CollisionCheck_SetAC(PlayState* play, CollisionCheckContext* colChkCtx, Coll return -1; } if (colChkCtx->colACCount >= COLLISION_CHECK_AC_MAX) { - // "Index exceeded and cannot add more" - PRINTF("CollisionCheck_setAC():インデックスがオーバして追加不能\n"); + PRINTF(T("CollisionCheck_setAC():インデックスがオーバして追加不能\n", + "CollisionCheck_setAC(): Index exceeded and cannot add more\n")); return -1; } if (colChkCtx->sacFlags & SAC_ENABLE) { @@ -1274,15 +1289,16 @@ s32 CollisionCheck_SetAC_SAC(PlayState* play, CollisionCheckContext* colChkCtx, } if (colChkCtx->sacFlags & SAC_ENABLE) { if (!(index < colChkCtx->colACCount)) { - // "You are trying to register a location that is larger than the total number of data." - PRINTF("CollisionCheck_setAC_SAC():全データ数より大きいところに登録しようとしている。\n"); + PRINTF(T("CollisionCheck_setAC_SAC():全データ数より大きいところに登録しようとしている。\n", + "CollisionCheck_setAC_SAC(): You are trying to register a location that is larger than the total " + "number of data.\n")); return -1; } colChkCtx->colAC[index] = collider; } else { if (!(colChkCtx->colACCount < COLLISION_CHECK_AC_MAX)) { - // "Index exceeded and cannot add more" - PRINTF("CollisionCheck_setAC():インデックスがオーバして追加不能\n"); + PRINTF(T("CollisionCheck_setAC():インデックスがオーバして追加不能\n", + "CollisionCheck_setAC(): Index exceeded and cannot add more\n")); return -1; } index = colChkCtx->colACCount; @@ -1316,8 +1332,8 @@ s32 CollisionCheck_SetOC(PlayState* play, CollisionCheckContext* colChkCtx, Coll return -1; } if (colChkCtx->colOCCount >= COLLISION_CHECK_OC_MAX) { - // "Index exceeded and cannot add more" - PRINTF("CollisionCheck_setOC():インデックスがオーバして追加不能\n"); + PRINTF(T("CollisionCheck_setOC():インデックスがオーバして追加不能\n", + "CollisionCheck_setOC(): Index exceeded and cannot add more\n")); return -1; } if (colChkCtx->sacFlags & SAC_ENABLE) { @@ -1345,16 +1361,17 @@ s32 CollisionCheck_SetOC_SAC(PlayState* play, CollisionCheckContext* colChkCtx, } if (colChkCtx->sacFlags & SAC_ENABLE) { if (!(index < colChkCtx->colOCCount)) { - // "You are trying to register a location that is larger than the total number of data." - PRINTF("CollisionCheck_setOC_SAC():全データ数より大きいところに登録しようとしている。\n"); + PRINTF(T("CollisionCheck_setOC_SAC():全データ数より大きいところに登録しようとしている。\n", + "CollisionCheck_setOC_SAC(): You are trying to register a location that is larger than the total " + "number of data.\n")); return -1; } //! @bug Should be colOC colChkCtx->colAT[index] = collider; } else { if (!(colChkCtx->colOCCount < COLLISION_CHECK_OC_MAX)) { - // "Index exceeded and cannot add more" - PRINTF("CollisionCheck_setOC():インデックスがオーバして追加不能\n"); + PRINTF(T("CollisionCheck_setOC():インデックスがオーバして追加不能\n", + "CollisionCheck_setOC(): Index exceeded and cannot add more\n")); return -1; } index = colChkCtx->colOCCount; @@ -1376,8 +1393,8 @@ s32 CollisionCheck_SetOCLine(PlayState* play, CollisionCheckContext* colChkCtx, Collider_ResetLineOC(play, collider); if (!(colChkCtx->colLineCount < COLLISION_CHECK_OC_LINE_MAX)) { - // "Index exceeded and cannot add more" - PRINTF("CollisionCheck_setOCLine():インデックスがオーバして追加不能\n"); + PRINTF(T("CollisionCheck_setOCLine():インデックスがオーバして追加不能\n", + "CollisionCheck_setOCLine(): Index exceeded and cannot add more\n")); return -1; } index = colChkCtx->colLineCount; @@ -1553,7 +1570,7 @@ void CollisionCheck_RedBloodUnused(PlayState* play, Collider* collider, Vec3f* v void CollisionCheck_HitSolid(PlayState* play, ColliderElement* elem, Collider* collider, Vec3f* hitPos) { s32 flags = elem->atElemFlags & ATELEM_SFX_MASK; - if (flags == ATELEM_SFX_NORMAL && collider->colType != COLTYPE_METAL) { + if (flags == ATELEM_SFX_NORMAL && collider->colMaterial != COL_MATERIAL_METAL) { EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos); if (collider->actor == NULL) { Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, @@ -1562,7 +1579,7 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderElement* elem, Collider* c Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - } else if (flags == ATELEM_SFX_NORMAL) { // collider->colType == COLTYPE_METAL + } else if (flags == ATELEM_SFX_NORMAL) { // collider->colMaterial == COL_MATERIAL_METAL EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_METAL, hitPos); if (collider->actor == NULL) { CollisionCheck_SpawnShieldParticlesMetal(play, hitPos); @@ -1591,20 +1608,20 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderElement* elem, Collider* c } /** - * Plays a hit sound effect for AT colliders attached to Player based on the AC element's elemType. + * Plays a hit sound effect for AT colliders attached to Player based on the AC element's elemMaterial. */ s32 CollisionCheck_SwordHitAudio(Collider* atCol, ColliderElement* acElem) { if (atCol->actor != NULL && atCol->actor->category == ACTORCAT_PLAYER) { - if (acElem->elemType == ELEMTYPE_UNK0) { + if (acElem->elemMaterial == ELEM_MATERIAL_UNK0) { Audio_PlaySfxGeneral(NA_SE_IT_SWORD_STRIKE, &atCol->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - } else if (acElem->elemType == ELEMTYPE_UNK1) { + } else if (acElem->elemMaterial == ELEM_MATERIAL_UNK1) { Audio_PlaySfxGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &atCol->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - } else if (acElem->elemType == ELEMTYPE_UNK2) { + } else if (acElem->elemMaterial == ELEM_MATERIAL_UNK2) { Audio_PlaySfxGeneral(NA_SE_NONE, &atCol->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - } else if (acElem->elemType == ELEMTYPE_UNK3) { + } else if (acElem->elemMaterial == ELEM_MATERIAL_UNK3) { Audio_PlaySfxGeneral(NA_SE_NONE, &atCol->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } @@ -1612,12 +1629,12 @@ s32 CollisionCheck_SwordHitAudio(Collider* atCol, ColliderElement* acElem) { return true; } -typedef struct { +typedef struct HitInfo { /* 0x0 */ u8 blood; /* 0x1 */ u8 effect; } HitInfo; // size = 0x2 -typedef enum { +typedef enum ColChkBloodType { /* 0 */ BLOOD_NONE, /* 1 */ BLOOD_BLUE, /* 2 */ BLOOD_GREEN, @@ -1626,7 +1643,7 @@ typedef enum { /* 5 */ BLOOD_RED2 } ColChkBloodType; -typedef enum { +typedef enum ColChkHitType { /* 0 */ HIT_WHITE, /* 1 */ HIT_DUST, /* 2 */ HIT_RED, @@ -1647,24 +1664,24 @@ static ColChkBloodFunc sBloodFuncs[] = { }; static HitInfo sHitInfo[] = { - { BLOOD_BLUE, HIT_WHITE }, // COLTYPE_HIT0 - { BLOOD_NONE, HIT_DUST }, // COLTYPE_HIT1 - { BLOOD_GREEN, HIT_DUST }, // COLTYPE_HIT2 - { BLOOD_NONE, HIT_WHITE }, // COLTYPE_HIT3 - { BLOOD_WATER, HIT_NONE }, // COLTYPE_HIT4 - { BLOOD_NONE, HIT_RED }, // COLTYPE_HIT5 - { BLOOD_GREEN, HIT_WHITE }, // COLTYPE_HIT6 - { BLOOD_RED, HIT_WHITE }, // COLTYPE_HIT7 - { BLOOD_BLUE, HIT_RED }, // COLTYPE_HIT8 - { BLOOD_NONE, HIT_SOLID }, // COLTYPE_METAL - { BLOOD_NONE, HIT_NONE }, // COLTYPE_NONE - { BLOOD_NONE, HIT_SOLID }, // COLTYPE_WOOD - { BLOOD_NONE, HIT_SOLID }, // COLTYPE_HARD - { BLOOD_NONE, HIT_WOOD }, // COLTYPE_TREE + { BLOOD_BLUE, HIT_WHITE }, // COL_MATERIAL_HIT0 + { BLOOD_NONE, HIT_DUST }, // COL_MATERIAL_HIT1 + { BLOOD_GREEN, HIT_DUST }, // COL_MATERIAL_HIT2 + { BLOOD_NONE, HIT_WHITE }, // COL_MATERIAL_HIT3 + { BLOOD_WATER, HIT_NONE }, // COL_MATERIAL_HIT4 + { BLOOD_NONE, HIT_RED }, // COL_MATERIAL_HIT5 + { BLOOD_GREEN, HIT_WHITE }, // COL_MATERIAL_HIT6 + { BLOOD_RED, HIT_WHITE }, // COL_MATERIAL_HIT7 + { BLOOD_BLUE, HIT_RED }, // COL_MATERIAL_HIT8 + { BLOOD_NONE, HIT_SOLID }, // COL_MATERIAL_METAL + { BLOOD_NONE, HIT_NONE }, // COL_MATERIAL_NONE + { BLOOD_NONE, HIT_SOLID }, // COL_MATERIAL_WOOD + { BLOOD_NONE, HIT_SOLID }, // COL_MATERIAL_HARD + { BLOOD_NONE, HIT_WOOD }, // COL_MATERIAL_TREE }; /** - * Handles hitmarks, blood, and sound effects for each AC collision, determined by the AC collider's colType + * Handles hitmarks, blood, and sound effects for each AC collision, determined by the AC collider's colMaterial */ void CollisionCheck_HitEffects(PlayState* play, Collider* atCol, ColliderElement* atElem, Collider* acCol, ColliderElement* acElem, Vec3f* hitPos) { @@ -1675,12 +1692,12 @@ void CollisionCheck_HitEffects(PlayState* play, Collider* atCol, ColliderElement return; } if (acCol->actor != NULL) { - sBloodFuncs[sHitInfo[acCol->colType].blood](play, acCol, hitPos); + sBloodFuncs[sHitInfo[acCol->colMaterial].blood](play, acCol, hitPos); } if (acCol->actor != NULL) { - if (sHitInfo[acCol->colType].effect == HIT_SOLID) { + if (sHitInfo[acCol->colMaterial].effect == HIT_SOLID) { CollisionCheck_HitSolid(play, atElem, acCol, hitPos); - } else if (sHitInfo[acCol->colType].effect == HIT_WOOD) { + } else if (sHitInfo[acCol->colMaterial].effect == HIT_WOOD) { if (atCol->actor == NULL) { CollisionCheck_SpawnShieldParticles(play, hitPos); Audio_PlaySfxGeneral(NA_SE_IT_REFLECTION_WOOD, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, @@ -1688,8 +1705,8 @@ void CollisionCheck_HitEffects(PlayState* play, Collider* atCol, ColliderElement } else { CollisionCheck_SpawnShieldParticlesWood(play, hitPos, &atCol->actor->projectedPos); } - } else if (sHitInfo[acCol->colType].effect != HIT_NONE) { - EffectSsHitMark_SpawnFixedScale(play, sHitInfo[acCol->colType].effect, hitPos); + } else if (sHitInfo[acCol->colMaterial].effect != HIT_NONE) { + EffectSsHitMark_SpawnFixedScale(play, sHitInfo[acCol->colMaterial].effect, hitPos); if (!(acElem->acElemFlags & ACELEM_NO_SWORD_SFX)) { CollisionCheck_SwordHitAudio(atCol, acElem); } @@ -1743,8 +1760,8 @@ s32 CollisionCheck_SetATvsAC(PlayState* play, Collider* atCol, ColliderElement* acElem->acDmgInfo.hitPos.x = hitPos->x; acElem->acDmgInfo.hitPos.y = hitPos->y; acElem->acDmgInfo.hitPos.z = hitPos->z; - if (!(atElem->atElemFlags & ATELEM_AT_HITMARK) && acCol->colType != COLTYPE_METAL && - acCol->colType != COLTYPE_WOOD && acCol->colType != COLTYPE_HARD) { + if (!(atElem->atElemFlags & ATELEM_AT_HITMARK) && acCol->colMaterial != COL_MATERIAL_METAL && + acCol->colMaterial != COL_MATERIAL_WOOD && acCol->colMaterial != COL_MATERIAL_HARD) { acElem->acElemFlags |= ACELEM_DRAW_HITMARK; } else { CollisionCheck_HitEffects(play, atCol, atElem, acCol, acElem, hitPos); @@ -1831,7 +1848,6 @@ void CollisionCheck_ATJntSphVsACCyl(PlayState* play, CollisionCheckContext* colC Vec3f hitPos; Vec3f atPos; Vec3f acPos; - f32 acToHit; atPos.x = atJntSphElem->dim.worldSphere.center.x; atPos.y = atJntSphElem->dim.worldSphere.center.y; @@ -1840,7 +1856,13 @@ void CollisionCheck_ATJntSphVsACCyl(PlayState* play, CollisionCheckContext* colC acPos.y = acCyl->dim.pos.y; acPos.z = acCyl->dim.pos.z; if (!IS_ZERO(centerDist)) { - acToHit = acCyl->dim.radius / centerDist; + f32 acToHit = acCyl->dim.radius / centerDist; + +#if OOT_VERSION < PAL_1_0 + hitPos.x = ((atPos.x - acPos.x) * acToHit) + acPos.x; + hitPos.y = ((atPos.y - acPos.y) * acToHit) + acPos.y; + hitPos.z = ((atPos.z - acPos.z) * acToHit) + acPos.z; +#else if (acToHit <= 1.0f) { hitPos.x = ((atPos.x - acPos.x) * acToHit) + acPos.x; hitPos.y = ((atPos.y - acPos.y) * acToHit) + acPos.y; @@ -1848,6 +1870,7 @@ void CollisionCheck_ATJntSphVsACCyl(PlayState* play, CollisionCheckContext* colC } else { Math_Vec3f_Copy(&hitPos, &atPos); } +#endif } else { Math_Vec3f_Copy(&hitPos, &atPos); } @@ -1892,7 +1915,13 @@ void CollisionCheck_ATCylVsACJntSph(PlayState* play, CollisionCheckContext* colC acPos.y = acJntSphElem->dim.worldSphere.center.y; acPos.z = acJntSphElem->dim.worldSphere.center.z; if (!IS_ZERO(centerDist)) { - acToHit = acJntSphElem->dim.worldSphere.radius / centerDist; + f32 acToHit = acJntSphElem->dim.worldSphere.radius / centerDist; + +#if OOT_VERSION < PAL_1_0 + hitPos.x = ((atPos.x - acPos.x) * acToHit) + acPos.x; + hitPos.y = ((atPos.y - acPos.y) * acToHit) + acPos.y; + hitPos.z = ((atPos.z - acPos.z) * acToHit) + acPos.z; +#else if (acToHit <= 1.0f) { hitPos.x = ((atPos.x - acPos.x) * acToHit) + acPos.x; hitPos.y = ((atPos.y - acPos.y) * acToHit) + acPos.y; @@ -1900,6 +1929,7 @@ void CollisionCheck_ATCylVsACJntSph(PlayState* play, CollisionCheckContext* colC } else { Math_Vec3f_Copy(&hitPos, &atPos); } +#endif } else { Math_Vec3f_Copy(&hitPos, &atPos); } @@ -2202,6 +2232,9 @@ void CollisionCheck_ATTrisVsACCyl(PlayState* play, CollisionCheckContext* colChk } } +#pragma increment_block_number "gc-eu:252 gc-eu-mq:252 gc-jp:252 gc-jp-ce:252 gc-jp-mq:252 gc-us:252 gc-us-mq:252" \ + "ntsc-1.2:252 pal-1.0:252 pal-1.1:252" + void CollisionCheck_ATCylVsACQuad(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { static TriNorm tri1; static TriNorm tri2; @@ -2255,11 +2288,6 @@ void CollisionCheck_ATCylVsACQuad(PlayState* play, CollisionCheckContext* colChk } } -#if OOT_DEBUG -static s8 sBssDummy0; -static s8 sBssDummy1; -#endif - void CollisionCheck_ATQuadVsACCyl(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { static TriNorm tri1; static TriNorm tri2; @@ -2322,8 +2350,6 @@ void CollisionCheck_ATQuadVsACCyl(PlayState* play, CollisionCheckContext* colChk #if OOT_DEBUG static s8 sBssDummy3; static s8 sBssDummy4; -static s8 sBssDummy5; -static s8 sBssDummy6; #endif void CollisionCheck_ATTrisVsACTris(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, @@ -2697,14 +2723,12 @@ void CollisionCheck_AT(PlayState* play, CollisionCheckContext* colChkCtx) { CollisionCheck_SetHitEffects(play, colChkCtx); } -typedef enum { +typedef enum ColChkMassType { /* 0 */ MASSTYPE_IMMOVABLE, /* 1 */ MASSTYPE_HEAVY, /* 2 */ MASSTYPE_NORMAL } ColChkMassType; -#pragma increment_block_number 253 - /** * Get mass type. Immovable colliders cannot be pushed, while heavy colliders can only be pushed by heavy and immovable * colliders. @@ -2985,8 +3009,8 @@ void CollisionCheck_OC(PlayState* play, CollisionCheckContext* colChkCtx) { } vsFunc = sOCVsFuncs[(*leftColP)->shape][(*rightColP)->shape]; if (vsFunc == NULL) { - // "Not compatible" - PRINTF("CollisionCheck_OC():未対応 %d, %d\n", (*leftColP)->shape, (*rightColP)->shape); + PRINTF(T("CollisionCheck_OC():未対応 %d, %d\n", "CollisionCheck_OC(): Not compatible %d, %d\n"), + (*leftColP)->shape, (*rightColP)->shape); continue; } vsFunc(play, colChkCtx, *leftColP, *rightColP); @@ -3247,8 +3271,9 @@ s32 CollisionCheck_LineOC(PlayState* play, CollisionCheckContext* colChkCtx, Vec } lineCheck = sOCLineCheckFuncs[(*col)->shape]; if (lineCheck == NULL) { - // "type %d not supported" - PRINTF("CollisionCheck_generalLineOcCheck():未対応 %dタイプ\n", (*col)->shape); + PRINTF(T("CollisionCheck_generalLineOcCheck():未対応 %dタイプ\n", + "CollisionCheck_generalLineOcCheck(): type %d not supported\n"), + (*col)->shape); } else { result = lineCheck(play, colChkCtx, (*col), a, b); if (result) { diff --git a/src/code/z_common_data.c b/src/code/z_common_data.c index 112bd09725..d493a68924 100644 --- a/src/code/z_common_data.c +++ b/src/code/z_common_data.c @@ -1,9 +1,9 @@ #include "global.h" +#include "region.h" +#include "versions.h" -// For retail BSS ordering, the block number of D_8015FA88 must be 0 or -// just above (the exact upper bound depends on the block numbers assigned to -// extern variables declared in headers). -#pragma increment_block_number 60 +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:192 pal-1.0:192 pal-1.1:192" ALIGNED(16) SaveContext gSaveContext; u32 D_8015FA88; @@ -25,4 +25,17 @@ void SaveContext_Init(void) { gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT; gSaveContext.prevHudVisibilityMode = HUD_VISIBILITY_ALL; gSaveContext.save.useWidescreen = false; + +#if OOT_NTSC && OOT_VERSION < GC_US + if (gCurrentRegion == REGION_JP) { + gSaveContext.language = LANGUAGE_JPN; + } + if (gCurrentRegion == REGION_US) { + gSaveContext.language = LANGUAGE_ENG; + } +#elif OOT_VERSION == GC_US || OOT_VERSION == GC_US_MQ + gSaveContext.language = LANGUAGE_ENG; +#elif OOT_VERSION == GC_JP_CE + gSaveContext.language = LANGUAGE_JPN; +#endif } diff --git a/src/code/z_construct.c b/src/code/z_construct.c index 8dcf5f7590..374665d385 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -1,4 +1,5 @@ #include "global.h" +#include "versions.h" void Interface_Destroy(PlayState* play) { Map_Destroy(play); @@ -11,8 +12,6 @@ void Interface_Init(PlayState* play) { u32 parameterSize; u16 doActionOffset; u8 timerId; - Color_RGB8 aBtnColor = { 255, 30, 30 }; - Color_RGB8 bBtnColor = { 0, 200, 50 }; gSaveContext.sunsSongState = SUNSSONG_INACTIVE; gSaveContext.nextHudVisibilityMode = gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; @@ -34,8 +33,7 @@ void Interface_Init(PlayState* play) { parameterSize = (uintptr_t)_parameter_staticSegmentRomEnd - (uintptr_t)_parameter_staticSegmentRomStart; - // "Permanent PARAMETER Segment = %x" - PRINTF("常駐PARAMETERセグメント=%x\n", parameterSize); + PRINTF(T("常駐PARAMETERセグメント=%x\n", "Permanent PARAMETER Segment = %x\n"), parameterSize); interfaceCtx->parameterSegment = GAME_STATE_ALLOC(&play->state, parameterSize, "../z_construct.c", 159); @@ -47,24 +45,24 @@ void Interface_Init(PlayState* play) { interfaceCtx->doActionSegment = GAME_STATE_ALLOC(&play->state, 3 * DO_ACTION_TEX_SIZE, "../z_construct.c", 166); - PRINTF("DOアクション テクスチャ初期=%x\n", 3 * DO_ACTION_TEX_SIZE); // "DO Action Texture Initialization" + PRINTF(T("DOアクション テクスチャ初期=%x\n", "DO Action Texture Initialization = %x\n"), 3 * DO_ACTION_TEX_SIZE); PRINTF("parameter->do_actionSegment=%x\n", interfaceCtx->doActionSegment); ASSERT(interfaceCtx->doActionSegment != NULL, "parameter->do_actionSegment != NULL", "../z_construct.c", 169); #if OOT_NTSC if (gSaveContext.language == LANGUAGE_JPN) { - doActionOffset = LANGUAGE_JPN * DO_ACTION_MAX * DO_ACTION_TEX_SIZE; + doActionOffset = (LANGUAGE_JPN * DO_ACTION_MAX + DO_ACTION_ATTACK) * DO_ACTION_TEX_SIZE; } else { - doActionOffset = LANGUAGE_ENG * DO_ACTION_MAX * DO_ACTION_TEX_SIZE; + doActionOffset = (LANGUAGE_ENG * DO_ACTION_MAX + DO_ACTION_ATTACK) * DO_ACTION_TEX_SIZE; } #else if (gSaveContext.language == LANGUAGE_ENG) { - doActionOffset = LANGUAGE_ENG * DO_ACTION_MAX * DO_ACTION_TEX_SIZE; + doActionOffset = (LANGUAGE_ENG * DO_ACTION_MAX + DO_ACTION_ATTACK) * DO_ACTION_TEX_SIZE; } else if (gSaveContext.language == LANGUAGE_GER) { - doActionOffset = LANGUAGE_GER * DO_ACTION_MAX * DO_ACTION_TEX_SIZE; + doActionOffset = (LANGUAGE_GER * DO_ACTION_MAX + DO_ACTION_ATTACK) * DO_ACTION_TEX_SIZE; } else { - doActionOffset = LANGUAGE_FRA * DO_ACTION_MAX * DO_ACTION_TEX_SIZE; + doActionOffset = (LANGUAGE_FRA * DO_ACTION_MAX + DO_ACTION_ATTACK) * DO_ACTION_TEX_SIZE; } #endif @@ -73,17 +71,17 @@ void Interface_Init(PlayState* play) { #if OOT_NTSC if (gSaveContext.language == LANGUAGE_JPN) { - doActionOffset = 3 * DO_ACTION_TEX_SIZE + LANGUAGE_JPN * DO_ACTION_MAX * DO_ACTION_TEX_SIZE; + doActionOffset = (LANGUAGE_JPN * DO_ACTION_MAX + DO_ACTION_RETURN) * DO_ACTION_TEX_SIZE; } else { - doActionOffset = 3 * DO_ACTION_TEX_SIZE + LANGUAGE_ENG * DO_ACTION_MAX * DO_ACTION_TEX_SIZE; + doActionOffset = (LANGUAGE_ENG * DO_ACTION_MAX + DO_ACTION_RETURN) * DO_ACTION_TEX_SIZE; } #else if (gSaveContext.language == LANGUAGE_ENG) { - doActionOffset = 3 * DO_ACTION_TEX_SIZE + LANGUAGE_ENG * DO_ACTION_MAX * DO_ACTION_TEX_SIZE; + doActionOffset = (LANGUAGE_ENG * DO_ACTION_MAX + DO_ACTION_RETURN) * DO_ACTION_TEX_SIZE; } else if (gSaveContext.language == LANGUAGE_GER) { - doActionOffset = 3 * DO_ACTION_TEX_SIZE + LANGUAGE_GER * DO_ACTION_MAX * DO_ACTION_TEX_SIZE; + doActionOffset = (LANGUAGE_GER * DO_ACTION_MAX + DO_ACTION_RETURN) * DO_ACTION_TEX_SIZE; } else { - doActionOffset = 3 * DO_ACTION_TEX_SIZE + LANGUAGE_FRA * DO_ACTION_MAX * DO_ACTION_TEX_SIZE; + doActionOffset = (LANGUAGE_FRA * DO_ACTION_MAX + DO_ACTION_RETURN) * DO_ACTION_TEX_SIZE; } #endif @@ -93,8 +91,8 @@ void Interface_Init(PlayState* play) { interfaceCtx->iconItemSegment = GAME_STATE_ALLOC(&play->state, ICON_ITEM_SEGMENT_SIZE, "../z_construct.c", 190); - // "Icon Item Texture Initialization = %x" - PRINTF("アイコンアイテム テクスチャ初期=%x\n", ICON_ITEM_SEGMENT_SIZE); + PRINTF(T("アイコンアイテム テクスチャ初期=%x\n", "Icon Item Texture Initialization = %x\n"), + ICON_ITEM_SEGMENT_SIZE); PRINTF("parameter->icon_itemSegment=%x\n", interfaceCtx->iconItemSegment); ASSERT(interfaceCtx->iconItemSegment != NULL, "parameter->icon_itemSegment != NULL", "../z_construct.c", 193); @@ -164,42 +162,41 @@ void Interface_Init(PlayState* play) { gSaveContext.timerY[timerId] = 46; // one row of hearts } } - - if ((gSaveContext.timerState >= TIMER_STATE_UP_INIT) && (gSaveContext.timerState <= TIMER_STATE_UP_FREEZE)) { +#if OOT_VERSION < PAL_1_0 + else if ((gSaveContext.timerState >= TIMER_STATE_UP_INIT) && (gSaveContext.timerState <= TIMER_STATE_UP_FREEZE)) +#else + // No "else" + if ((gSaveContext.timerState >= TIMER_STATE_UP_INIT) && (gSaveContext.timerState <= TIMER_STATE_UP_FREEZE)) +#endif + { gSaveContext.timerState = TIMER_STATE_OFF; - // "Timer Stop!!!!!!!!!!!!!!!!!!!!!!" - PRINTF("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", gSaveContext.timerState); + PRINTF(T("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", + "Timer Stop!!!!!!!!!!!!!!!!!!!!! = %d\n"), + gSaveContext.timerState); } - PRINTF("PARAMETER領域=%x\n", parameterSize + 0x5300); // "Parameter Area = %x" + PRINTF(T("PARAMETER領域=%x\n", "Parameter Area = %x\n"), parameterSize + 0x5300); Health_InitMeter(play); Map_Init(play); interfaceCtx->unk_23C = interfaceCtx->unk_242 = 0; - if (N64_BTN_COLORS) { - aBtnColor.r = aBtnColor.b = 0; - aBtnColor.g = 150; - - bBtnColor.r = bBtnColor.g = 90; - bBtnColor.b = 255; - } - R_ITEM_BTN_X(0) = B_BUTTON_X; - R_B_BTN_COLOR(0) = aBtnColor.r; - R_B_BTN_COLOR(1) = aBtnColor.g; - R_B_BTN_COLOR(2) = aBtnColor.b; + R_B_BTN_COLOR(0) = B_BUTTON_R; + R_B_BTN_COLOR(1) = B_BUTTON_G; + R_B_BTN_COLOR(2) = B_BUTTON_B; R_ITEM_ICON_X(0) = B_BUTTON_X; R_ITEM_AMMO_X(0) = B_BUTTON_X + 2; + R_A_BTN_X = A_BUTTON_X; R_A_ICON_X = A_BUTTON_X; - R_A_BTN_COLOR(0) = bBtnColor.r; - R_A_BTN_COLOR(1) = bBtnColor.g; - R_A_BTN_COLOR(2) = bBtnColor.b; + R_A_BTN_COLOR(0) = A_BUTTON_R; + R_A_BTN_COLOR(1) = A_BUTTON_G; + R_A_BTN_COLOR(2) = A_BUTTON_B; } #define TEXTBOX_SEGMENT_SIZE \ @@ -224,7 +221,7 @@ void Message_Init(PlayState* play) { PRINTF("message->fukidashiSegment=%x\n", msgCtx->textboxSegment); - PRINTF("吹き出しgame_alloc=%x\n", TEXTBOX_SEGMENT_SIZE); // "Textbox game_alloc=%x" + PRINTF(T("吹き出しgame_alloc=%x\n", "Textbox game_alloc=%x\n"), TEXTBOX_SEGMENT_SIZE); ASSERT(msgCtx->textboxSegment != NULL, "message->fukidashiSegment != NULL", "../z_construct.c", 352); Font_LoadOrderedFont(&play->msgCtx.font); @@ -260,6 +257,22 @@ void Regs_InitDataImpl(void) { YREG(45) = 236; YREG(46) = 36; YREG(47) = 0; + +#if OOT_NTSC + R_KALEIDO_UNK1(0) = -45; + R_KALEIDO_UNK1(1) = -48; + R_KALEIDO_UNK2(0) = 16; + R_KALEIDO_UNK2(1) = 22; + R_KALEIDO_UNK3(0) = -55; + R_KALEIDO_UNK3(1) = -53; + R_KALEIDO_UNK4(0) = 43; + R_KALEIDO_UNK4(1) = 47; + R_KALEIDO_UNK5(0) = -33; + R_KALEIDO_UNK5(1) = -42; + R_KALEIDO_UNK6(0) = -33; + R_KALEIDO_UNK6(1) = -37; +#else + // Same as above, although these regs are now unused for PAL versions YREG(48) = -45; YREG(49) = -48; YREG(50) = 16; @@ -272,6 +285,8 @@ void Regs_InitDataImpl(void) { YREG(57) = -42; YREG(58) = -33; YREG(59) = -37; +#endif + YREG(60) = 14; YREG(61) = -2; YREG(62) = -2; @@ -311,7 +326,7 @@ void Regs_InitDataImpl(void) { ZREG(10) = 200; ZREG(11) = 0; ZREG(12) = 200; - ZREG(13) = 0; + R_PAUSE_PAGE_SWITCH_FRAME_ADVANCE_ON = false; ZREG(14) = 110; ZREG(15) = 56; ZREG(16) = 1; @@ -363,12 +378,18 @@ void Regs_InitDataImpl(void) { R_START_LABEL_X(2) = 119; #endif - ZREG(61) = 1; - R_C_UP_BTN_X = C_UP_BUTTON_X; - R_C_UP_BTN_Y = C_UP_BUTTON_Y; - ZREG(64) = 20; + R_PAUSE_QUEST_MEDALLION_SHINE_TIME(0) = 1; + //! @bug Overlapping reg usage + R_C_UP_BTN_X = C_UP_BUTTON_X; // R_PAUSE_QUEST_MEDALLION_SHINE_TIME(1) + R_C_UP_BTN_Y = C_UP_BUTTON_Y; // R_PAUSE_QUEST_MEDALLION_SHINE_TIME(2) + R_PAUSE_QUEST_MEDALLION_SHINE_TIME(3) = 20; + ZREG(65) = 21; ZREG(66) = 122; +#if OOT_VERSION < PAL_1_0 + R_START_BTN_X = 132; + R_START_BTN_Y = 17; +#endif R_ITEM_BTN_X(1) = C_LEFT_BUTTON_X; R_ITEM_BTN_X(2) = C_DOWN_BUTTON_X; R_ITEM_BTN_X(3) = C_RIGHT_BUTTON_X; @@ -484,8 +505,8 @@ void Regs_InitDataImpl(void) { XREG(93) = 100; XREG(94) = 160; XREG(95) = 200; - WREG(2) = -6080; - WREG(3) = 9355; + R_PAUSE_PAGES_Y_ORIGIN_2 = -6080; + R_PAUSE_DEPTH_OFFSET = 9355; WREG(4) = 8; WREG(5) = 3; WREG(6) = 8; @@ -546,24 +567,24 @@ void Regs_InitDataImpl(void) { R_A_LABEL_Z(0) = -380; R_A_LABEL_Z(1) = -360; R_A_LABEL_Z(2) = -350; - WREG(49) = -48; - WREG(50) = 16; - WREG(51) = -62; - WREG(52) = 22; - WREG(53) = -84; - WREG(54) = 20; - WREG(55) = -53; - WREG(56) = 40; - WREG(57) = -64; - WREG(58) = 47; - WREG(59) = -84; - WREG(60) = 44; - WREG(61) = -42; - WREG(62) = 32; - WREG(63) = -45; - WREG(64) = -37; - WREG(65) = 30; - WREG(66) = -50; + R_KALEIDO_UNK1(0) = -48; + R_KALEIDO_UNK1(1) = 16; + R_KALEIDO_UNK1(2) = -62; + R_KALEIDO_UNK2(0) = 22; + R_KALEIDO_UNK2(1) = -84; + R_KALEIDO_UNK2(2) = 20; + R_KALEIDO_UNK3(0) = -53; + R_KALEIDO_UNK3(1) = 40; + R_KALEIDO_UNK3(2) = -64; + R_KALEIDO_UNK4(0) = 47; + R_KALEIDO_UNK4(1) = -84; + R_KALEIDO_UNK4(2) = 44; + R_KALEIDO_UNK5(0) = -42; + R_KALEIDO_UNK5(1) = 32; + R_KALEIDO_UNK5(2) = -45; + R_KALEIDO_UNK6(0) = -37; + R_KALEIDO_UNK6(1) = 30; + R_KALEIDO_UNK6(2) = -50; #endif R_DGN_MINIMAP_X = 204; @@ -598,11 +619,12 @@ void Regs_InitDataImpl(void) { R_MINIMAP_COLOR(2) = 255; } - VREG(21) = 0; - VREG(22) = 0; - VREG(23) = 0; - VREG(24) = 0; - VREG(25) = 0; + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_A) = 0; + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_C_DOWN) = 0; + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_C_RIGHT) = 0; + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_C_LEFT) = 0; + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_C_UP) = 0; + VREG(26) = 0; VREG(27) = 0; R_OCARINA_BUTTONS_XPOS = 98; @@ -628,7 +650,7 @@ void Regs_InitDataImpl(void) { R_OCARINA_BUTTONS_YPOS(2) = 176; R_OCARINA_BUTTONS_YPOS(3) = 172; R_OCARINA_BUTTONS_YPOS(4) = 170; - VREG(50) = 30; + R_OCARINA_BUTTONS_APPEAR_ALPHA_STEP = 30; R_OCARINA_BUTTONS_YPOS_OFFSET = 0; VREG(52) = -16; VREG(53) = 230; @@ -638,10 +660,10 @@ void Regs_InitDataImpl(void) { VREG(57) = 255; VREG(58) = 255; VREG(59) = 255; - VREG(60) = 20; - VREG(61) = 100; - VREG(62) = 0; - VREG(63) = 10; + R_KALEIDO_PROMPT_CURSOR_ALPHA_TIMER_BASE = 20; + R_KALEIDO_PROMPT_CURSOR_ALPHA = 100; + R_KALEIDO_PROMPT_CURSOR_ALPHA_STATE = 0; + R_KALEIDO_PROMPT_CURSOR_ALPHA_TIMER = 10; R_ITEM_AMMO_X(1) = C_LEFT_BUTTON_X + 1; R_ITEM_AMMO_X(2) = C_DOWN_BUTTON_X + 1; R_ITEM_AMMO_X(3) = C_RIGHT_BUTTON_X + 1; diff --git a/src/code/z_debug.c b/src/code/z_debug.c index 42435dcdd5..9719dd49b4 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -2,7 +2,7 @@ #include "config.h" // ENABLE_CAMERA_DEBUGGER -typedef struct { +typedef struct DebugCamTextBufferEntry { /* 0x0 */ u8 x; /* 0x1 */ u8 y; /* 0x2 */ u8 colorIndex; @@ -10,11 +10,14 @@ typedef struct { } DebugCamTextBufferEntry; // size = 0x18 // ENABLE_REG_EDITOR -typedef struct { +typedef struct InputCombo { /* 0x0 */ u16 hold; /* 0x2 */ u16 press; } InputCombo; // size = 0x4 +#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \ + "ntsc-1.2:192 pal-1.0:192 pal-1.1:192" + RegEditor* gRegEditor; // ``gRegEditor->data`` is used by non-debug features in normal gameplay // ENABLE_CAMERA_DEBUGGER @@ -184,7 +187,7 @@ void Regs_UpdateEditor(Input* input) { s32 increment; s32 i; - dPadInputCur = input->cur.button & (BTN_DUP | BTN_DLEFT | BTN_DRIGHT | BTN_DDOWN); + dPadInputCur = input->cur.button & (BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT); if (CHECK_BTN_ALL(input->cur.button, BTN_L) || CHECK_BTN_ALL(input->cur.button, BTN_R) || CHECK_BTN_ALL(input->cur.button, BTN_START)) { @@ -335,8 +338,6 @@ void Debug_DrawText(GraphicsContext* gfxCtx) { Gfx_Close(opaStart, gfx); POLY_OPA_DISP = gfx; - if (1) {} - CLOSE_DISPS(gfxCtx, "../z_debug.c", 664); GfxPrint_Destroy(&printer); diff --git a/src/code/z_debug_display.c b/src/code/z_debug_display.c index bd1fa2b652..8e24de6c4d 100644 --- a/src/code/z_debug_display.c +++ b/src/code/z_debug_display.c @@ -5,7 +5,7 @@ #include "global.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" -typedef struct { +typedef struct DebugDispObjectInfo { /* 0x00 */ s16 drawType; // indicates which draw function to use when displaying the object /* 0x04 */ void* drawArg; // segment address (display list or texture) passed to the draw function when called } DebugDispObjectInfo; // size = 0x8 @@ -85,8 +85,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, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_debug_display.c", 189), - G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_debug_display.c", 189); gSPDisplayList(POLY_XLU_DISP++, gDebugSpriteDL); CLOSE_DISPS(play->state.gfxCtx, "../z_debug_display.c", 192); @@ -104,8 +103,7 @@ void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dlist, PlayState* 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); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_debug_display.c", 228), - G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_debug_display.c", 228); gSPDisplayList(POLY_XLU_DISP++, dlist); CLOSE_DISPS(play->state.gfxCtx, "../z_debug_display.c", 231); diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 6f0db62113..0863541277 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -2,6 +2,9 @@ #include "quake.h" #include "z64camera.h" #include "config.h" +#if PLATFORM_N64 +#include "n64dd.h" +#endif #include "assets/scenes/indoors/tokinoma/tokinoma_scene.h" @@ -60,7 +63,7 @@ CutsceneHandler sScriptedCutsceneHandlers[] = { CutsceneHandler_RunScript, // CS_STATE_RUN_UNSTOPPABLE }; -typedef enum { +typedef enum TitleDemoDestination { /* 0 */ TITLE_DEMO_SPIRIT_TEMPLE, /* 1 */ TITLE_DEMO_DEATH_MOUNTAIN_CRATER, /* 2 */ TITLE_DEMO_GANONDORF_HORSE @@ -68,7 +71,7 @@ typedef enum { u8 sTitleDemoDestination = TITLE_DEMO_SPIRIT_TEMPLE; -typedef struct { +typedef struct EntranceCutscene { /* 0x00 */ u16 entrance; // entrance index upon which the cutscene should trigger /* 0x02 */ u8 ageRestriction; // 0 for adult only, 1 for child only, 2 for both ages /* 0x03 */ u8 flag; // eventChkInf flag bound to the entrance cutscene @@ -112,8 +115,9 @@ EntranceCutscene sEntranceCutsceneTable[] = { { ENTR_KOKIRI_FOREST_12, 2, EVENTCHKINF_C6, gKokiriForestDekuSproutCs }, }; -void* sUnusedEntranceCsList[] = { - gDekuTreeIntroCs, gJabuJabuIntroCs, gDcOpeningCs, gMinuetCs, gIceCavernSerenadeCs, gTowerBarrierCs, +void* sCutscenesUnknownList[] = { + gDekuTreeIntroCs, gJabuJabuIntroCs, gDcOpeningCs, gSpiritBossNabooruKnuckleDefeatCs, + gIceCavernSerenadeCs, gTowerBarrierCs, }; // Stores the frame the relevant cam data was last applied on @@ -121,9 +125,8 @@ u16 gCamAtSplinePointsAppliedFrame; u16 gCamEyePointAppliedFrame; u16 gCamAtPointAppliedFrame; -// For retail BSS ordering, the block number of sReturnToCamId must be greater -// than that of gCamAtPointAppliedFrame (declared in variables.h). -#pragma increment_block_number 180 +#pragma increment_block_number "gc-eu:188 gc-eu-mq:176 gc-jp:188 gc-jp-ce:188 gc-jp-mq:176 gc-us:188 gc-us-mq:176" \ + "ntsc-1.2:80 pal-1.0:80 pal-1.1:80" // Cam ID to return to when a scripted cutscene is finished s16 sReturnToCamId; @@ -203,7 +206,7 @@ void Cutscene_UpdateScripted(PlayState* play, CutsceneContext* csCtx) { } if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_IDLE)) { - PRINTF("\nデモ開始要求 発令!"); // "Cutscene start request announcement!" + PRINTF(T("\nデモ開始要求 発令!", "\nDemo start request issued!")); gSaveContext.save.cutsceneIndex = 0xFFFD; gSaveContext.cutsceneTrigger = 1; } @@ -308,8 +311,8 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) { break; case CS_MISC_FADE_KOKIRI_GRASS_ENV_ALPHA: - if (play->roomCtx.unk_74[0] <= 127) { - play->roomCtx.unk_74[0] += 4; + if (play->roomCtx.drawParams[0] <= 127) { + play->roomCtx.drawParams[0] += 4; } break; @@ -322,14 +325,14 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) { break; case CS_MISC_DEKU_TREE_DEATH: - if (play->roomCtx.unk_74[0] < 1650) { - play->roomCtx.unk_74[0] += 20; + if (play->roomCtx.drawParams[0] < 1650) { + play->roomCtx.drawParams[0] += 20; } if (csCtx->curFrame == 783) { Sfx_PlaySfxCentered(NA_SE_EV_DEKU_DEATH); } else if (csCtx->curFrame == 717) { - play->roomCtx.unk_74[0] = 0; + play->roomCtx.drawParams[0] = 0; } break; @@ -342,12 +345,12 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) { break; case CS_MISC_TRIFORCE_FLASH: - if (play->roomCtx.unk_74[1] == 0) { + if (play->roomCtx.drawParams[1] == 0) { Sfx_PlaySfxCentered(NA_SE_EV_TRIFORCE_FLASH); } - if (play->roomCtx.unk_74[1] < 255) { - play->roomCtx.unk_74[1] += 5; + if (play->roomCtx.drawParams[1] < 255) { + play->roomCtx.drawParams[1] += 5; } break; @@ -579,7 +582,7 @@ void CutsceneCmd_Destination(PlayState* play, CutsceneContext* csCtx, CsCmdDesti Audio_SetCutsceneFlag(0); gSaveContext.cutsceneTransitionControl = 1; - PRINTF("\n分岐先指定!!=[%d]番", cmd->destination); // "Future fork designation=No. [%d]" + PRINTF(T("\n分岐先指定!!=[%d]番", "\nBranch destination specified!!=[%d]"), cmd->destination); // `forceRisingButtonAlphas` has a secondary purpose, which is to signal to the title screen actor // that it should display immediately. This occurs when a title screen cutscene that is not the main @@ -1710,6 +1713,9 @@ s32 CutsceneCmd_SetCamAt(PlayState* play, CutsceneContext* csCtx, u8* script, u8 void CutsceneCmd_Text(PlayState* play, CutsceneContext* csCtx, CsCmdText* cmd) { u8 dialogState; +#if PLATFORM_N64 + s32 pad; +#endif s16 endFrame; if ((csCtx->curFrame > cmd->startFrame) && (csCtx->curFrame <= cmd->endFrame)) { @@ -2270,7 +2276,6 @@ void CutsceneHandler_RunScript(PlayState* play, CutsceneContext* csCtx) { Gfx_Close(prevDisplayList, displayList); POLY_OPA_DISP = displayList; - if (1) {} CLOSE_DISPS(play->state.gfxCtx, "../z_demo.c", 4108); } @@ -2305,7 +2310,7 @@ void CutsceneHandler_StopScript(PlayState* play, CutsceneContext* csCtx) { csCtx->actorCues[i] = NULL; } - PRINTF("\n\n\n\n\nやっぱりここかいな"); // "Right here, huh" + PRINTF(T("\n\n\n\n\nやっぱりここかいな", "\n\n\n\n\nThis is it after all")); gSaveContext.save.cutsceneIndex = 0; gSaveContext.gameMode = GAMEMODE_NORMAL; @@ -2464,6 +2469,14 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) { } void Cutscene_SetScript(PlayState* play, void* script) { +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_78 != NULL)) { + if (B_80121220->unk_78(play, script, sCutscenesUnknownList)) { + return; + } + } +#endif + if (SEGMENT_NUMBER(script) != 0) { play->csCtx.script = SEGMENTED_TO_VIRTUAL(script); } else { diff --git a/src/code/z_draw.c b/src/code/z_draw.c index f890804eb3..89b49faf4a 100644 --- a/src/code/z_draw.c +++ b/src/code/z_draw.c @@ -106,7 +106,7 @@ void GetItem_DrawScale(PlayState* play, s16 drawId); void GetItem_DrawBulletBag(PlayState* play, s16 drawId); void GetItem_DrawWallet(PlayState* play, s16 drawId); -typedef struct { +typedef struct DrawItemTableEntry { /* 0x00 */ void (*drawFunc)(PlayState*, s16); /* 0x04 */ Gfx* dlists[8]; } DrawItemTableEntry; // size = 0x24 @@ -385,7 +385,7 @@ void GetItem_DrawMaskOrBombchu(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 556); Gfx_SetupDL_26Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 560), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 560); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); 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); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_5); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 576), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 576); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); 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); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 592), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 592); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); @@ -420,7 +420,7 @@ void GetItem_DrawBlueFire(PlayState* play, s16 drawId) { Matrix_Push(); Matrix_Translate(-8.0f, -2.0f, 0.0f, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 615), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 615); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); Matrix_Pop(); @@ -433,11 +433,11 @@ void GetItem_DrawPoes(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 628); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 632), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 632); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 641), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 641); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPSegment(POLY_XLU_DISP++, 0x08, 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)); Matrix_Push(); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 656), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 656); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); Matrix_Pop(); @@ -459,11 +459,11 @@ void GetItem_DrawFairy(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 670); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 674), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 674); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 683), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 683); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPSegment(POLY_XLU_DISP++, 0x08, 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)); Matrix_Push(); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 698), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 698); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); 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, 1 * (play->state.frames * 2) % 256, 64, 64, 1, 0 * (play->state.frames * 0) % 128, 1 * (play->state.frames * 1) % 128, 32, 32)); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 723), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 723); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 730), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 730); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); 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); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 746), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 746); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); @@ -512,21 +512,21 @@ void GetItem_DrawSkullToken(PlayState* play, s16 drawId) { 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), 0 * (play->state.frames * 0), 32, 64)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 760), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 760); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 765); } void GetItem_DrawEggOrMedallion(PlayState* play, s16 drawId) { - s32 pad; + DrawItemTableEntry* entry = &sDrawItemTable[drawId]; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 772); Gfx_SetupDL_26Opa(play->state.gfxCtx); - 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[1]); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 776); + gSPDisplayList(POLY_OPA_DISP++, entry->dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, entry->dlists[1]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 783); } @@ -537,11 +537,11 @@ void GetItem_DrawCompass(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 811); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 815), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 815); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_5); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 822), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 822); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); 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), 1 * (play->state.frames * 1), 32, 32, 1, -1 * (play->state.frames * 1), 1 * (play->state.frames * 1), 32, 32)); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 845), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 845); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[3]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 855), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 855); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[4]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[5]); @@ -581,7 +581,7 @@ void GetItem_DrawGoronSword(PlayState* play, s16 drawId) { 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)); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 878), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 878); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); 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), 1 * (play->state.frames * 6), 32, 32, 1, 1 * (play->state.frames * 6), 1 * (play->state.frames * 6), 32, 32)); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 901), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 901); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); 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), 1 * -(play->state.frames * 3), 32, 32, 1, 0 * (play->state.frames * 1), 1 * -(play->state.frames * 2), 32, 32)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 924), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 924); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); 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), 1 * (play->state.frames * 1), 32, 32, 1, 0 * (play->state.frames * 0), 1 * (play->state.frames * 1), 32, 32)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 947), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 947); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); 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); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 963), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 963); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 968); @@ -653,25 +653,25 @@ void GetItem_DrawOpa0Xlu1(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 975); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 979), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 979); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 986), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 986); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 991); } void GetItem_DrawXlu01(PlayState* play, s16 drawId) { - s32 pad; + DrawItemTableEntry* entry = &sDrawItemTable[drawId]; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 998); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - 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[1]); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 1002); + gSPDisplayList(POLY_XLU_DISP++, entry->dlists[0]); + gSPDisplayList(POLY_XLU_DISP++, entry->dlists[1]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1008); } @@ -682,12 +682,12 @@ void GetItem_DrawOpa10Xlu2(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1015); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1019), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 1019); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1027), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 1027); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); 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); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1043), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 1043); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1050), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 1050); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); @@ -720,7 +720,7 @@ void GetItem_DrawMagicSpell(PlayState* play, s16 drawId) { 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 * 2), 32, 32)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1074), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 1074); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); @@ -734,7 +734,7 @@ void GetItem_DrawOpa1023(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1088); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1092), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 1092); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]); @@ -749,12 +749,12 @@ void GetItem_DrawOpa10Xlu32(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1108); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1112), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 1112); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1120), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 1120); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); @@ -768,15 +768,13 @@ void GetItem_DrawSmallRupee(PlayState* play, s16 drawId) { Matrix_Scale(0.7f, 0.7f, 0.7f, MTXMODE_APPLY); - if (1) {} - Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1140), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 1140); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1148), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 1148); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); @@ -793,7 +791,7 @@ void GetItem_DrawScale(PlayState* play, s16 drawId) { 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 * 4), 32, 32)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1173), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 1173); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); @@ -803,20 +801,20 @@ void GetItem_DrawScale(PlayState* play, s16 drawId) { } void GetItem_DrawBulletBag(PlayState* play, s16 drawId) { - s32 pad; + DrawItemTableEntry* entry = &sDrawItemTable[drawId]; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1188); Gfx_SetupDL_25Opa(play->state.gfxCtx); - 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[0]); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 1192); + gSPDisplayList(POLY_OPA_DISP++, entry->dlists[1]); + gSPDisplayList(POLY_OPA_DISP++, entry->dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - 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[3]); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[4]); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 1200); + gSPDisplayList(POLY_XLU_DISP++, entry->dlists[2]); + gSPDisplayList(POLY_XLU_DISP++, entry->dlists[3]); + gSPDisplayList(POLY_XLU_DISP++, entry->dlists[4]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1207); } @@ -827,7 +825,7 @@ void GetItem_DrawWallet(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1214); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1218), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 1218); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]); diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c index 47722faaf8..212f5ee7df 100644 --- a/src/code/z_eff_blure.c +++ b/src/code/z_eff_blure.c @@ -12,8 +12,8 @@ void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2) { if (this != NULL) { numElements = this->numElements; if (numElements >= 16) { - // "Blure vertex addition processing: Table over %d" - PRINTF("ブラ─頂点追加処理:テーブルオーバー %d\n", numElements); + PRINTF(T("ブラ─頂点追加処理:テーブルオーバー %d\n", "Blur - vertex addition processing: Table over %d\n"), + numElements); return; } @@ -81,8 +81,8 @@ void EffectBlure_AddSpace(EffectBlure* this) { if (this != NULL) { numElements = this->numElements; if (numElements >= 16) { - // "Blure space addition processing: Table over %d" - PRINTF("ブラ─空白追加処理:テーブルオーバー %d\n", numElements); + PRINTF(T("ブラ─空白追加処理:テーブルオーバー %d\n", "Blur - space addition processing: Table over %d\n"), + numElements); return; } @@ -397,80 +397,80 @@ void EffectBlure_DrawElemNoInterpolation(EffectBlure* this, EffectBlureElement* vtx = GRAPH_ALLOC(gfxCtx, sizeof(Vtx[4])); if (vtx == NULL) { - // "Vertices cannot be secured." - PRINTF("z_eff_blure.c::SQ_NoInterpolate_disp() 頂点確保できず。\n"); - } else { - vtx[0].v = baseVtx; - vtx[1].v = baseVtx; - vtx[2].v = baseVtx; - vtx[3].v = baseVtx; - - ratio = (f32)elem->timer / (f32)this->elemDuration; - EffectBlure_GetComputedValues(this, index, ratio, &sp8C, &sp84, &sp7C, &sp78); - - sp60.x = sp84.x; - sp60.y = sp84.y; - sp60.z = sp84.z; - Math_Vec3f_Diff(&sp60, &sp6C, &sp54); - Math_Vec3f_Scale(&sp54, 10.0f); - vtx[0].v.ob[0] = sp54.x; - vtx[0].v.ob[1] = sp54.y; - vtx[0].v.ob[2] = sp54.z; - vtx[0].v.cn[0] = sp78.r; - vtx[0].v.cn[1] = sp78.g; - vtx[0].v.cn[2] = sp78.b; - vtx[0].v.cn[3] = sp78.a; - - if (1) {} // Necessary to match - - sp60.x = sp8C.x; - sp60.y = sp8C.y; - sp60.z = sp8C.z; - Math_Vec3f_Diff(&sp60, &sp6C, &sp54); - Math_Vec3f_Scale(&sp54, 10.0f); - vtx[1].v.ob[0] = sp54.x; - vtx[1].v.ob[1] = sp54.y; - vtx[1].v.ob[2] = sp54.z; - vtx[1].v.cn[0] = sp7C.r; - vtx[1].v.cn[1] = sp7C.g; - vtx[1].v.cn[2] = sp7C.b; - vtx[1].v.cn[3] = sp7C.a; - - ratio = (f32)(elem + 1)->timer / (f32)this->elemDuration; - EffectBlure_GetComputedValues(this, index + 1, ratio, &sp8C, &sp84, &sp7C, &sp78); - - sp60.x = sp8C.x; - sp60.y = sp8C.y; - sp60.z = sp8C.z; - Math_Vec3f_Diff(&sp60, &sp6C, &sp54); - Math_Vec3f_Scale(&sp54, 10.0f); - vtx[2].v.ob[0] = sp54.x; - vtx[2].v.ob[1] = sp54.y; - vtx[2].v.ob[2] = sp54.z; - vtx[2].v.cn[0] = sp7C.r; - vtx[2].v.cn[1] = sp7C.g; - vtx[2].v.cn[2] = sp7C.b; - vtx[2].v.cn[3] = sp7C.a; - - if (1) {} // Necessary to match - - sp60.x = sp84.x; - sp60.y = sp84.y; - sp60.z = sp84.z; - Math_Vec3f_Diff(&sp60, &sp6C, &sp54); - Math_Vec3f_Scale(&sp54, 10.0f); - vtx[3].v.ob[0] = sp54.x; - vtx[3].v.ob[1] = sp54.y; - vtx[3].v.ob[2] = sp54.z; - vtx[3].v.cn[0] = sp78.r; - vtx[3].v.cn[1] = sp78.g; - vtx[3].v.cn[2] = sp78.b; - vtx[3].v.cn[3] = sp78.a; - - gSPVertex(POLY_XLU_DISP++, vtx, 4, 0); - gSP2Triangles(POLY_XLU_DISP++, 0, 1, 2, 0, 0, 2, 3, 0); + PRINTF(T("z_eff_blure.c::SQ_NoInterpolate_disp() 頂点確保できず。\n", + "z_eff_blure.c::SQ_NoInterpolate_disp() Vertices cannot be secured.\n")); + goto close_disps; } + vtx[0].v = baseVtx; + vtx[1].v = baseVtx; + vtx[2].v = baseVtx; + vtx[3].v = baseVtx; + + ratio = (f32)elem->timer / (f32)this->elemDuration; + EffectBlure_GetComputedValues(this, index, ratio, &sp8C, &sp84, &sp7C, &sp78); + + sp60.x = sp84.x; + sp60.y = sp84.y; + sp60.z = sp84.z; + Math_Vec3f_Diff(&sp60, &sp6C, &sp54); + Math_Vec3f_Scale(&sp54, 10.0f); + vtx[0].v.ob[0] = sp54.x; + vtx[0].v.ob[1] = sp54.y; + vtx[0].v.ob[2] = sp54.z; + vtx[0].v.cn[0] = sp78.r; + vtx[0].v.cn[1] = sp78.g; + vtx[0].v.cn[2] = sp78.b; + vtx[0].v.cn[3] = sp78.a; + + sp60.x = sp8C.x; + sp60.y = sp8C.y; + sp60.z = sp8C.z; + Math_Vec3f_Diff(&sp60, &sp6C, &sp54); + Math_Vec3f_Scale(&sp54, 10.0f); + vtx[1].v.ob[0] = sp54.x; + vtx[1].v.ob[1] = sp54.y; + vtx[1].v.ob[2] = sp54.z; + vtx[1].v.cn[0] = sp7C.r; + vtx[1].v.cn[1] = sp7C.g; + vtx[1].v.cn[2] = sp7C.b; + vtx[1].v.cn[3] = sp7C.a; + + ratio = (f32)(elem + 1)->timer / (f32)this->elemDuration; + EffectBlure_GetComputedValues(this, index + 1, ratio, &sp8C, &sp84, &sp7C, &sp78); + + sp60.x = sp8C.x; + sp60.y = sp8C.y; + sp60.z = sp8C.z; + Math_Vec3f_Diff(&sp60, &sp6C, &sp54); + Math_Vec3f_Scale(&sp54, 10.0f); + vtx[2].v.ob[0] = sp54.x; + vtx[2].v.ob[1] = sp54.y; + vtx[2].v.ob[2] = sp54.z; + vtx[2].v.cn[0] = sp7C.r; + vtx[2].v.cn[1] = sp7C.g; + vtx[2].v.cn[2] = sp7C.b; + vtx[2].v.cn[3] = sp7C.a; + + sp60.x = sp84.x; + sp60.y = sp84.y; + sp60.z = sp84.z; + Math_Vec3f_Diff(&sp60, &sp6C, &sp54); + Math_Vec3f_Scale(&sp54, 10.0f); + vtx[3].v.ob[0] = sp54.x; + vtx[3].v.ob[1] = sp54.y; + vtx[3].v.ob[2] = sp54.z; + vtx[3].v.cn[0] = sp78.r; + vtx[3].v.cn[1] = sp78.g; + vtx[3].v.cn[2] = sp78.b; + vtx[3].v.cn[3] = sp78.a; + + if (1) {} + + gSPVertex(POLY_XLU_DISP++, vtx, 4, 0); + gSP2Triangles(POLY_XLU_DISP++, 0, 1, 2, 0, 0, 2, 3, 0); + +close_disps: CLOSE_DISPS(gfxCtx, "../z_eff_blure.c", 932); } @@ -558,8 +558,8 @@ void EffectBlure_DrawElemHermiteInterpolation(EffectBlure* this, EffectBlureElem vtx = GRAPH_ALLOC(gfxCtx, sizeof(Vtx[16])); if (vtx == NULL) { - // "Vertices cannot be secured." - PRINTF("z_eff_blure.c::SQ_HermiteInterpolate_disp() 頂点確保できず。\n"); + PRINTF(T("z_eff_blure.c::SQ_HermiteInterpolate_disp() 頂点確保できず。\n", + "z_eff_blure.c::SQ_HermiteInterpolate_disp() Vertices cannot be secured.\n")); } else { Math_Vec3f_Diff(&sp1CC, &sp138, &sp158); Math_Vec3f_Scale(&sp158, 10.0f); @@ -761,9 +761,6 @@ void EffectBlure_DrawSimpleVertices(GraphicsContext* gfxCtx, EffectBlure* this, MtxF sp94; f32 scale; s32 i; - s32 j; - - j = 0; for (i = 0; i < this->numElements - 1; i++) { if (this->drawMode == 1) { @@ -773,9 +770,7 @@ void EffectBlure_DrawSimpleVertices(GraphicsContext* gfxCtx, EffectBlure* this, gDPPipeSync(POLY_XLU_DISP++); } - if (1) {} // Necessary to match - - gSPVertex(POLY_XLU_DISP++, &vtx[j], 4, 0); + gSPVertex(POLY_XLU_DISP++, &vtx[4 * i], 4, 0); gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0); if (this->flags & 4) { @@ -801,19 +796,18 @@ void EffectBlure_DrawSimpleVertices(GraphicsContext* gfxCtx, EffectBlure* this, mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp94); if (mtx == NULL) { - // "Forced termination because a matrix cannot be taken" - PRINTF("EffectBlureInfo2_disp_makeDisplayList()マトリックス取れないので,強制終了\n"); + PRINTF(T("EffectBlureInfo2_disp_makeDisplayList()マトリックス取れないので,強制終了\n", + "EffectBlureInfo2_disp_makeDisplayList() Forced termination because a matrix cannot " + "be taken\n")); break; } gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPVertex(POLY_XLU_DISP++, &vtx[j], 4, 0); + gSPVertex(POLY_XLU_DISP++, &vtx[4 * i], 4, 0); gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0); gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } } - - j += 4; } } @@ -853,8 +847,8 @@ void EffectBlure_DrawSimple(EffectBlure* this2, GraphicsContext* gfxCtx) { vtx = GRAPH_ALLOC(gfxCtx, vtxCount * sizeof(Vtx)); if (vtx == NULL) { - // "Vertices cannot be secured. Forced termination" - PRINTF("ブラ─表示:頂点確保できず。強制終了\n"); + PRINTF(T("ブラ─表示:頂点確保できず。強制終了\n", + "Blur - display: vertices cannot be secured. Forced termination\n")); return; } @@ -947,8 +941,7 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) { vtx = GRAPH_ALLOC(gfxCtx, sizeof(Vtx[32])); if (vtx == NULL) { - // "Blure display: Vertex table could not be secured" - PRINTF("ブラ─表示:頂点テーブル確保できず\n"); + PRINTF(T("ブラ─表示:頂点テーブル確保できず\n", "Blur - display: vertex table could not be secured\n")); } else { j = 0; for (i = 0; i < this->numElements; i++) { diff --git a/src/code/z_eff_shield_particle.c b/src/code/z_eff_shield_particle.c index b1e46cadd0..c66934a4ff 100644 --- a/src/code/z_eff_shield_particle.c +++ b/src/code/z_eff_shield_particle.c @@ -19,7 +19,8 @@ void EffectShieldParticle_Init(void* thisx, void* initParamsx) { this->numElements = initParams->numElements; if (this->numElements > ARRAY_COUNT(this->elements)) { PRINTF(VT_FGCOL(RED)); - PRINTF("EffectShieldParticle_ct():パーティクル数がオーバしてます。\n"); + PRINTF(T("EffectShieldParticle_ct():パーティクル数がオーバしてます。\n", + "EffectShieldParticle_ct(): Number of particles exceeded.\n")); PRINTF(VT_RST); return; } diff --git a/src/code/z_eff_spark.c b/src/code/z_eff_spark.c index f741c0a138..a997caa129 100644 --- a/src/code/z_eff_spark.c +++ b/src/code/z_eff_spark.c @@ -10,7 +10,7 @@ void EffectSpark_Init(void* thisx, void* initParamsx) { if ((this != NULL) && (initParams != NULL)) { if ((initParams->uDiv == 0) || (initParams->vDiv == 0)) { - PRINTF("spark():u_div,v_div 0では困る。\n"); // "u_div,v_div 0 is not good." + PRINTF(T("spark():u_div,v_div 0では困る。\n", "spark():u_div,v_div 0 is not good.\n")); return; } @@ -55,7 +55,7 @@ void EffectSpark_Init(void* thisx, void* initParamsx) { this->numElements = (this->uDiv * this->vDiv) + 2; if (this->numElements > ARRAY_COUNT(this->elements)) { - PRINTF("table_sizeオーバー\n"); // "over table_size" + PRINTF(T("table_sizeオーバー\n", "over table_size\n")); return; } @@ -172,9 +172,9 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) { vertices = GRAPH_ALLOC(gfxCtx, this->numElements * sizeof(Vtx[4])); if (vertices == NULL) { - // "Memory Allocation Failure graph_malloc" - PRINTF("EffectSparkInfo_disp():メモリー確保失敗 graph_malloc\n"); - goto end; + PRINTF(T("EffectSparkInfo_disp():メモリー確保失敗 graph_malloc\n", + "EffectSparkInfo_disp(): Memory Allocation Failure graph_malloc\n")); + goto close_disps; } j = 0; @@ -222,45 +222,47 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) { vertices[j].v.tc[0] = 0; vertices[j].v.tc[1] = 1024; vertices[j].v.flag = 0; + j++; - vertices[j + 1].v.ob[0] = 32; - vertices[j + 1].v.ob[1] = 32; - vertices[j + 1].v.ob[2] = 0; - vertices[j + 1].v.cn[0] = sp1CF; - vertices[j + 1].v.cn[1] = sp1CE; - vertices[j + 1].v.cn[2] = sp1CD; - vertices[j + 1].v.cn[3] = sp1CC; - vertices[j + 1].v.tc[0] = 1024; - vertices[j + 1].v.tc[1] = 0; - vertices[j + 1].v.flag = 0; - - vertices[j + 2].v.ob[0] = -32; - vertices[j + 2].v.ob[1] = 32; - vertices[j + 2].v.ob[2] = 0; - vertices[j + 2].v.cn[0] = sp1CB; - vertices[j + 2].v.cn[1] = sp1CA; - vertices[j + 2].v.cn[2] = sp1C9; - vertices[j + 2].v.cn[3] = sp1C8; - vertices[j + 2].v.tc[0] = 0; - vertices[j + 2].v.tc[1] = 0; - vertices[j + 2].v.flag = 0; - - vertices[j + 3].v.ob[0] = 32; - vertices[j + 3].v.ob[1] = -32; - vertices[j + 3].v.ob[2] = 0; - vertices[j + 3].v.cn[0] = sp1C7; - vertices[j + 3].v.cn[1] = sp1C6; - vertices[j + 3].v.cn[2] = sp1C5; - vertices[j + 3].v.cn[3] = sp1C4; - vertices[j + 3].v.tc[0] = 1024; - vertices[j + 3].v.tc[1] = 1024; - vertices[j + 3].v.flag = 0; - - j += 4; + vertices[j].v.ob[0] = 32; + vertices[j].v.ob[1] = 32; + vertices[j].v.ob[2] = 0; + vertices[j].v.cn[0] = sp1CF; + vertices[j].v.cn[1] = sp1CE; + vertices[j].v.cn[2] = sp1CD; + vertices[j].v.cn[3] = sp1CC; + vertices[j].v.tc[0] = 1024; + vertices[j].v.tc[1] = 0; + vertices[j].v.flag = 0; + j++; + + vertices[j].v.ob[0] = -32; + vertices[j].v.ob[1] = 32; + vertices[j].v.ob[2] = 0; + vertices[j].v.cn[0] = sp1CB; + vertices[j].v.cn[1] = sp1CA; + vertices[j].v.cn[2] = sp1C9; + vertices[j].v.cn[3] = sp1C8; + vertices[j].v.tc[0] = 0; + vertices[j].v.tc[1] = 0; + vertices[j].v.flag = 0; + j++; + + vertices[j].v.ob[0] = 32; + vertices[j].v.ob[1] = -32; + vertices[j].v.ob[2] = 0; + vertices[j].v.cn[0] = sp1C7; + vertices[j].v.cn[1] = sp1C6; + vertices[j].v.cn[2] = sp1C5; + vertices[j].v.cn[3] = sp1C4; + vertices[j].v.tc[0] = 1024; + vertices[j].v.tc[1] = 1024; + vertices[j].v.flag = 0; + j++; mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp12C); if (mtx == NULL) { - goto end; + goto close_disps; } gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -271,6 +273,6 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) { gDPPipeSync(POLY_XLU_DISP++); } -end: +close_disps: CLOSE_DISPS(gfxCtx, "../z_eff_spark.c", 498); } diff --git a/src/code/z_eff_ss_dead.c b/src/code/z_eff_ss_dead.c index be283f773c..3c1adf4cb6 100644 --- a/src/code/z_eff_ss_dead.c +++ b/src/code/z_eff_ss_dead.c @@ -23,8 +23,6 @@ void func_80026230(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3) { POLY_OPA_DISP = displayListHead; - if (1) {} // Necessary to match - CLOSE_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 129); } @@ -32,22 +30,24 @@ void func_80026400(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3) { Gfx* displayListHead; f32 cos; - if (arg3 != 0) { - OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 141); +#if !PLATFORM_N64 + if (arg3 == 0) { + return; + } +#endif - cos = Math_CosS((0x4000 / arg3) * arg2); - displayListHead = POLY_OPA_DISP; + OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 141); - gDPPipeSync(displayListHead++); - gDPSetFogColor(displayListHead++, color->r, color->g, color->b, color->a); - gSPFogPosition(displayListHead++, 0, (s16)(2800.0f * ABS(cos)) + 1700); + cos = Math_CosS((0x4000 / arg3) * arg2); + displayListHead = POLY_OPA_DISP; - POLY_OPA_DISP = displayListHead; + gDPPipeSync(displayListHead++); + gDPSetFogColor(displayListHead++, color->r, color->g, color->b, color->a); + gSPFogPosition(displayListHead++, 0, (s16)(2800.0f * ABS(cos)) + 1700); - if (1) {} // Necessary to match + POLY_OPA_DISP = displayListHead; - CLOSE_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 153); - } + CLOSE_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 153); } void func_80026608(PlayState* play) { @@ -84,8 +84,6 @@ void func_80026690(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3) { POLY_XLU_DISP = displayListHead; - if (1) {} // Necessary to match - CLOSE_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 194); } diff --git a/src/code/z_effect.c b/src/code/z_effect.c index 089387b17a..ac2141db0b 100644 --- a/src/code/z_effect.c +++ b/src/code/z_effect.c @@ -146,9 +146,10 @@ void Effect_Add(PlayState* play, s32* pIndex, s32 type, u8 arg3, u8 arg4, void* } if (!slotFound) { - // "EffectAdd(): I cannot secure it. Be careful. Type %d" - PRINTF("EffectAdd():確保できません。注意してください。Type%d\n", type); - PRINTF("エフェクト追加せずに終了します。\n"); // "Exit without adding the effect." + PRINTF(T("EffectAdd():確保できません。注意してください。Type%d\n", + "EffectAdd(): I cannot secure it. Be careful. Type %d\n"), + type); + PRINTF(T("エフェクト追加せずに終了します。\n", "Exit without adding the effect.\n")); } else { sEffectInfoTable[type].init(effect, initParams); status->unk_02 = arg3; @@ -240,7 +241,7 @@ void Effect_Delete(PlayState* play, s32 index) { void Effect_DeleteAll(PlayState* play) { s32 i; - PRINTF("エフェクト総て解放\n"); // "All effect release" + PRINTF(T("エフェクト総て解放\n", "All effects release\n")); for (i = 0; i < SPARK_COUNT; i++) { sEffectContext.sparks[i].status.active = false; @@ -257,5 +258,5 @@ void Effect_DeleteAll(PlayState* play) { sEffectInfoTable[EFFECT_SHIELD_PARTICLE].destroy(&sEffectContext.shieldParticles[i].effect); } - PRINTF("エフェクト総て解放 終了\n"); // "All effects release End" + PRINTF(T("エフェクト総て解放 終了\n", "All effects release End\n")); } diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c index 32570ce43d..ee12c0c2b6 100644 --- a/src/code/z_effect_soft_sprite.c +++ b/src/code/z_effect_soft_sprite.c @@ -174,7 +174,7 @@ void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initParams) { s32 index; u32 overlaySize; EffectSsOverlay* overlayEntry; - EffectSsInit* initInfo; + EffectSsProfile* profile; overlayEntry = &gEffectSsOverlayTable[type]; @@ -189,20 +189,23 @@ void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initParams) { overlaySize = (uintptr_t)overlayEntry->vramEnd - (uintptr_t)overlayEntry->vramStart; if (overlayEntry->vramStart == NULL) { - // "Not an overlay" - PRINTF("EffectSoftSprite2_makeEffect():オーバーレイではありません。\n"); - initInfo = overlayEntry->initInfo; + PRINTF(T("EffectSoftSprite2_makeEffect():オーバーレイではありません。\n", + "EffectSoftSprite2_makeEffect(): Not an overlay.\n")); + profile = overlayEntry->profile; } else { if (overlayEntry->loadedRamAddr == NULL) { overlayEntry->loadedRamAddr = ZELDA_ARENA_MALLOC_R(overlaySize, "../z_effect_soft_sprite.c", 585); if (overlayEntry->loadedRamAddr == NULL) { PRINTF(VT_FGCOL(RED)); - // "The memory of %d byte cannot be secured. Therefore, the program cannot be loaded. - // What a dangerous situation! Naturally, effects will not produced either." - PRINTF("EffectSoftSprite2_makeEffect():zelda_malloc_r()により,%" - "dbyteのメモリ確保ができま\nせん。そのため、プログラムのロードも\n出来ません。ただいま危険" - "な状態です!\nもちろん,エフェクトも出ません。\n", + PRINTF(T("EffectSoftSprite2_makeEffect():zelda_malloc_r()により,%dbyteのメモリ確保ができま\n" + "せん。そのため、プログラムのロードも\n" + "出来ません。ただいま危険な状態です!\n" + "もちろん,エフェクトも出ません。\n", + "EffectSoftSprite2_makeEffect():zelda_malloc_r() The memory of %d byte cannot be\n" + "secured. Therefore, the program\n" + "cannot be loaded. What a dangerous situation!\n" + "Naturally, effects will not be produced either.\n"), overlaySize); PRINTF(VT_RST); return; @@ -218,19 +221,21 @@ void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initParams) { PRINTF(VT_RST); } - initInfo = (void*)(uintptr_t)((overlayEntry->initInfo != NULL) - ? (void*)((uintptr_t)overlayEntry->initInfo - - (intptr_t)((uintptr_t)overlayEntry->vramStart - - (uintptr_t)overlayEntry->loadedRamAddr)) - : NULL); + profile = (void*)(uintptr_t)((overlayEntry->profile != NULL) + ? (void*)((uintptr_t)overlayEntry->profile - + (intptr_t)((uintptr_t)overlayEntry->vramStart - + (uintptr_t)overlayEntry->loadedRamAddr)) + : NULL); } - if (initInfo->init == NULL) { - // "Effects have already been loaded, but the constructor is NULL so the addition will not occur. - // Please fix this. (Waste of memory) %08x %d" - PRINTF("EffectSoftSprite2_makeEffect():すでにエフェクトはロード済みで\nすが," - "コンストラクターがNULLなので追加をやめます。\n直してください。(メモリーの無駄) %08x %d\n", - initInfo, type); + if (profile->init == NULL) { + PRINTF(T("EffectSoftSprite2_makeEffect():すでにエフェクトはロード済みで\n" + "すが,コンストラクターがNULLなので追加をやめます。\n" + "直してください。(メモリーの無駄) %08x %d\n", + "EffectSoftSprite2_makeEffect(): Effects have already been loaded,\n" + "but the constructor is NULL so the addition will not occur.\n" + "Please fix this. (Waste of memory) %08x %d\n"), + profile, type); return; } @@ -240,13 +245,14 @@ void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initParams) { sEffectSsInfo.table[index].type = type; sEffectSsInfo.table[index].priority = priority; - if (initInfo->init(play, index, &sEffectSsInfo.table[index], initParams) == 0) { + if (profile->init(play, index, &sEffectSsInfo.table[index], initParams) == 0) { PRINTF(VT_FGCOL(GREEN)); - // "Construction failed for some reason. The constructor returned an error. - // Ceasing effect addition." - PRINTF("EffectSoftSprite2_makeEffect():" - "何らかの理由でコンストラクト失敗。コンストラクターがエラーを返しました。エフェクトの追加を中" - "止します。\n"); + PRINTF(T("EffectSoftSprite2_makeEffect():" + "何らかの理由でコンストラクト失敗。コンストラクターがエラーを返しました。" + "エフェクトの追加を中止します。\n", + "EffectSoftSprite2_makeEffect(): " + "Construction failed for some reason. The constructor returned an error. " + "Ceasing effect addition.\n")); PRINTF(VT_RST); EffectSs_Reset(&sEffectSsInfo.table[index]); } @@ -308,17 +314,17 @@ void EffectSs_DrawAll(PlayState* play) { (sEffectSsInfo.table[i].pos.y > 32000.0f) || (sEffectSsInfo.table[i].pos.y < -32000.0f) || (sEffectSsInfo.table[i].pos.z > 32000.0f) || (sEffectSsInfo.table[i].pos.z < -32000.0f)) { PRINTF(VT_FGCOL(RED)); - // "Since the position is outside the area, delete it. - // Effect label No. %d: Please respond by the program. - // Here is ==> pos (%f, %f, %f) and the label is in z_effect_soft_sprite_dlftbls.decl." - PRINTF("EffectSoftSprite2_disp():位置が領域外のため " - "削除します。エフェクトラベルNo.%d:プログラムの方で対応をお願いします。ここです ==> " - "pos(%f, %f, %f)で、ラベルはz_effect_soft_sprite_dlftbls.declにあります。\n", + PRINTF(T("EffectSoftSprite2_disp():位置が領域外のため " + "削除します。エフェクトラベルNo.%d:プログラムの方で対応をお願いします。ここです ==> " + "pos(%f, %f, %f)で、ラベルはz_effect_soft_sprite_dlftbls.declにあります。\n", + "EffectSoftSprite2_disp(): Since the position is outside the area, " + "delete it. Effect label No. %d: Please respond by the program. Here is ==> " + "pos(%f, %f, %f) and the label is in z_effect_soft_sprite_dlftbls.decl.\n"), sEffectSsInfo.table[i].type, sEffectSsInfo.table[i].pos.x, sEffectSsInfo.table[i].pos.y, sEffectSsInfo.table[i].pos.z); PRINTF(VT_FGCOL(GREEN)); - // "If you are using pos for something else, consult me." - PRINTF("もし、posを別のことに使っている場合相談に応じます。\n"); + PRINTF(T("もし、posを別のことに使っている場合相談に応じます。\n", + "If you are using pos for something else, consult me.\n")); PRINTF(VT_RST); EffectSs_Delete(&sEffectSsInfo.table[i]); diff --git a/src/code/z_effect_soft_sprite_dlftbls.c b/src/code/z_effect_soft_sprite_dlftbls.c index 3fb498b33f..cb24257c87 100644 --- a/src/code/z_effect_soft_sprite_dlftbls.c +++ b/src/code/z_effect_soft_sprite_dlftbls.c @@ -9,8 +9,8 @@ #undef DEFINE_EFFECT_SS #undef DEFINE_EFFECT_SS_UNSET -// Init Vars declarations (also used in the table below) -#define DEFINE_EFFECT_SS(name, _1) extern EffectSsInit name##_InitVars; +// Profile declarations (also used in the table below) +#define DEFINE_EFFECT_SS(name, _1) extern EffectSsProfile name##_Profile; #define DEFINE_EFFECT_SS_UNSET(_0) #include "tables/effect_ss_table.h" @@ -19,9 +19,9 @@ #undef DEFINE_EFFECT_SS_UNSET // Effect SS Overlay Table definition -#define DEFINE_EFFECT_SS(name, _1) \ - { \ - ROM_FILE(ovl_##name), _ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, NULL, &name##_InitVars, 1, \ +#define DEFINE_EFFECT_SS(name, _1) \ + { \ + ROM_FILE(ovl_##name), _ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, NULL, &name##_Profile, 1, \ }, #define DEFINE_EFFECT_SS_UNSET(_0) \ diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 21c5ebd757..c90a7eb3bb 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -20,7 +20,7 @@ void EnAObj_SetupBlockRot(EnAObj* this, s16 type); void EnAObj_SetupBoulderFragment(EnAObj* this, s16 type); void EnAObj_SetupBlock(EnAObj* this, s16 type); -ActorInit En_A_Obj_InitVars = { +ActorProfile En_A_Obj_Profile = { /**/ ACTOR_EN_A_OBJ, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -34,7 +34,7 @@ ActorInit En_A_Obj_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_ALL, OC1_ON | OC1_TYPE_ALL, @@ -42,7 +42,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -80,7 +80,7 @@ void EnAObj_Init(Actor* thisx, PlayState* play) { EnAObj* this = (EnAObj*)thisx; f32 shadowScale = 6.0f; - this->textId = (thisx->params >> 8) & 0xFF; + this->textId = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; switch (thisx->params) { @@ -132,7 +132,7 @@ void EnAObj_Init(Actor* thisx, PlayState* play) { break; case A_OBJ_UNKNOWN_6: this->focusYoffset = 10.0f; - thisx->flags |= ACTOR_FLAG_0; + thisx->flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->dyna.bgId = 5; thisx->gravity = -2.0f; EnAObj_SetupWaitTalk(this, thisx->params); @@ -145,14 +145,14 @@ void EnAObj_Init(Actor* thisx, PlayState* play) { case A_OBJ_SIGNPOST_OBLONG: case A_OBJ_SIGNPOST_ARROW: thisx->textId = (this->textId & 0xFF) | 0x300; - thisx->targetArrowOffset = 500.0f; - thisx->flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + thisx->lockOnArrowOffset = 500.0f; + thisx->flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; this->focusYoffset = 45.0f; EnAObj_SetupWaitTalk(this, thisx->params); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit); thisx->colChkInfo.mass = MASS_IMMOVABLE; - thisx->targetMode = 0; + thisx->attentionRangeType = ATTENTION_RANGE_0; break; case A_OBJ_BOULDER_FRAGMENT: thisx->gravity = -1.5f; @@ -353,7 +353,7 @@ void EnAObj_Draw(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 1, 60, 60, 60, 50); } - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_a_keep.c", 712), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_a_keep.c", 712); gSPDisplayList(POLY_OPA_DISP++, sDLists[type]); CLOSE_DISPS(play->state.gfxCtx, "../z_en_a_keep.c", 715); diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index c01a538d29..a5dddbb9f3 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -3,6 +3,9 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h" +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-eu-mq-dbg:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128" \ + "gc-us-mq:128 ntsc-1.2:128" + #define FLAGS 0 void EnItem00_Init(Actor* thisx, PlayState* play); @@ -20,7 +23,7 @@ void EnItem00_DrawCollectible(EnItem00* this, PlayState* play); void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play); void EnItem00_DrawHeartPiece(EnItem00* this, PlayState* play); -ActorInit En_Item00_InitVars = { +ActorProfile En_Item00_Profile = { /**/ ACTOR_EN_ITEM00, /**/ ACTORCAT_MISC, /**/ FLAGS, @@ -34,7 +37,7 @@ ActorInit En_Item00_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -42,7 +45,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000010, 0x00, 0x00 }, ATELEM_NONE | ATELEM_SFX_NORMAL, @@ -53,7 +56,7 @@ static ColliderCylinderInit sCylinderInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 2000, ICHAIN_STOP), }; static Color_RGBA8 sEffectPrimColor = { 255, 255, 127, 0 }; @@ -142,10 +145,10 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { f32 yOffset = 980.0f; f32 shadowScale = 6.0f; s32 getItemId = GI_NONE; - s16 spawnParam8000 = this->actor.params & 0x8000; + s16 spawnParam8000 = PARAMS_GET_NOSHIFT(this->actor.params, 15, 1); s32 pad1; - this->collectibleFlag = (this->actor.params & 0x3F00) >> 8; + this->collectibleFlag = PARAMS_GET_S(this->actor.params, 8, 6); this->actor.params &= 0xFF; @@ -832,7 +835,7 @@ void EnItem00_DrawRupee(EnItem00* this, PlayState* play) { texIndex = this->actor.params - 0x10; } - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1562), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_item00.c", 1562); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sRupeeTex[texIndex])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_OPA_DISP++, texIndex); @@ -864,7 +867,7 @@ void EnItem00_DrawCollectible(EnItem00* this, PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sItemDropTex[texIndex])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_OPA_DISP++, texIndex); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1607), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_item00.c", 1607); gSPDisplayList(POLY_OPA_DISP++, gItemDropDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1611); @@ -880,12 +883,12 @@ void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); func_8002EBCC(&this->actor, play, 0); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1634), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_item00.c", 1634); gSPDisplayList(POLY_OPA_DISP++, gHeartPieceExteriorDL); Gfx_SetupDL_25Xlu(play->state.gfxCtx); func_8002ED80(&this->actor, play, 0); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1644), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_item00.c", 1644); gSPDisplayList(POLY_XLU_DISP++, gHeartContainerInteriorDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1647); @@ -901,7 +904,7 @@ void EnItem00_DrawHeartPiece(EnItem00* this, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); func_8002ED80(&this->actor, play, 0); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1670), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_item00.c", 1670); gSPDisplayList(POLY_XLU_DISP++, gHeartPieceInteriorDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1673); diff --git a/src/code/z_face_reaction.c b/src/code/z_face_reaction.c index a06bd4dc85..9864944b1c 100644 --- a/src/code/z_face_reaction.c +++ b/src/code/z_face_reaction.c @@ -112,67 +112,67 @@ u16 sMaskReactionSetTextIds[MASK_REACTION_SET_MAX][PLAYER_MASK_MAX] = { // MASK_REACTION_SET_DANCING_COUPLE { 0x0000, 0x711C, 0x711E, 0x711C, 0x711F, 0x711E, 0x711C, 0x711D, 0x711F }, - // MASK_REACTION_SET_37 + // MASK_REACTION_SET_DOG_LADY { 0x0000, 0x7104, 0x7105, 0x7107, 0x7107, 0x7105, 0x7106, 0x7107, 0x7107 }, - // MASK_REACTION_SET_38 + // MASK_REACTION_SET_WOMAN_3 { 0x0000, 0x7107, 0x7105, 0x7107, 0x7107, 0x7106, 0x7107, 0x7107, 0x7105 }, - // MASK_REACTION_SET_39 + // MASK_REACTION_SET_MAN_1_BEARD { 0x0000, 0x7113, 0x7117, 0x7113, 0x7110, 0x7112, 0x7112, 0x7116, 0x7112 }, - // MASK_REACTION_SET_40 + // MASK_REACTION_SET_MAN_2_BALD { 0x0000, 0x7113, 0x7113, 0x7113, 0x7113, 0x7113, 0x7113, 0x7111, 0x7113 }, - // MASK_REACTION_SET_41 + // MASK_REACTION_SET_MAN_1_SHAVED_BLACK_SHIRT { 0x0000, 0x7113, 0x7117, 0x7113, 0x7110, 0x7112, 0x7112, 0x7116, 0x7112 }, - // MASK_REACTION_SET_42 + // MASK_REACTION_SET_BEGGAR { 0x0000, 0x7117, 0x7117, 0x7117, 0x7117, 0x7117, 0x7117, 0x7117, 0x7113 }, - // MASK_REACTION_SET_43 + // MASK_REACTION_SET_OLD_WOMAN { 0x0000, 0x7101, 0x7100, 0x7102, 0x7103, 0x7101, 0x7100, 0x7102, 0x7103 }, - // MASK_REACTION_SET_44 + // MASK_REACTION_SET_OLD_MAN { 0x0000, 0x7100, 0x7102, 0x7100, 0x7100, 0x7100, 0x7100, 0x7100, 0x7102 }, - // MASK_REACTION_SET_45 + // MASK_REACTION_SET_YOUNG_WOMAN_BROWN_HAIR { 0x0000, 0x710A, 0x7109, 0x7109, 0x710A, 0x710B, 0x7108, 0x7109, 0x710B }, - // MASK_REACTION_SET_46 + // MASK_REACTION_SET_MAN_2_MUSTACHE_RED_SHIRT { 0x0000, 0x7117, 0x7112, 0x7113, 0x7110, 0x710C, 0x7117, 0x710E, 0x7112 }, - // MASK_REACTION_SET_47 + // MASK_REACTION_SET_MAN_2_MUSTACHE_BLUE_SHIRT { 0x0000, 0x710D, 0x710F, 0x710C, 0x7112, 0x710D, 0x710C, 0x710C, 0x710F }, - // MASK_REACTION_SET_48 + // MASK_REACTION_SET_YOUNG_WOMAN_ORANGE_HAIR { 0x0000, 0x710A, 0x7109, 0x711A, 0x710A, 0x7109, 0x7108, 0x710B, 0x7109 }, - // MASK_REACTION_SET_49 + // MASK_REACTION_SET_MAN_2_ALT_MUSTACHE { 0x0000, 0x710C, 0x710F, 0x7113, 0x7110, 0x710D, 0x7112, 0x7116, 0x710D }, - // MASK_REACTION_SET_50 + // MASK_REACTION_SET_MAN_1_BOWL_CUT_PURPLE_SHIRT { 0x0000, 0x7115, 0x7114, 0x7114, 0x7115, 0x7114, 0x7114, 0x7116, 0x7117 }, - // MASK_REACTION_SET_51 + // MASK_REACTION_SET_MAN_2_BEARD { 0x0000, 0x7113, 0x710F, 0x7113, 0x7110, 0x710C, 0x711A, 0x710D, 0x7112 }, - // MASK_REACTION_SET_52 + // MASK_REACTION_SET_OLD_MAN_BALD_BROWN_ROBE { 0x0000, 0x7101, 0x7102, 0x7103, 0x7101, 0x7100, 0x7100, 0x7102, 0x7100 }, - // MASK_REACTION_SET_53 + // MASK_REACTION_SET_MAN_2_MUSTACHE_WHITE_SHIRT { 0x0000, 0x7112, 0x710E, 0x7112, 0x710E, 0x710D, 0x7112, 0x710E, 0x710F }, - // MASK_REACTION_SET_54 + // MASK_REACTION_SET_MAN_1_SHAVED_GREEN_SHIRT { 0x0000, 0x7142, 0x7141, 0x7142, 0x7143, 0x7140, 0x7140, 0x7141, 0x7143 }, - // MASK_REACTION_SET_55 + // MASK_REACTION_SET_WOMAN_2 { 0x0000, 0x713C, 0x713D, 0x713D, 0x713E, 0x713E, 0x713F, 0x713D, 0x713F }, - // MASK_REACTION_SET_56 + // MASK_REACTION_SET_OLD_MAN_BALD_PURPLE_ROBE { 0x0000, 0x7101, 0x7102, 0x7103, 0x7101, 0x7100, 0x7100, 0x7102, 0x7100 }, - // MASK_REACTION_SET_57 + // MASK_REACTION_SET_MAN_1_BOWL_CUT_GREEN_SHIRT { 0x0000, 0x7113, 0x7117, 0x7113, 0x7110, 0x7112, 0x7112, 0x7116, 0x7112 }, // MASK_REACTION_SET_HAGGLING_TOWNSPEOPLE_1 diff --git a/src/code/z_fbdemo.c b/src/code/z_fbdemo.c index 1a3916ffa0..a2b0fb8bf1 100644 --- a/src/code/z_fbdemo.c +++ b/src/code/z_fbdemo.c @@ -90,8 +90,8 @@ void TransitionTile_InitGraphics(TransitionTile* this) { for (row = 0; row < this->rows; row++) { gSPVertex(gfx++, SEGMENT_ADDR(0xA, (u32)row * (this->cols + 1) * sizeof(Vtx)), 2 * (this->cols + 1), 0); - colTex = 0; col2 = 0; + colTex = 0; col = 0; while (col < this->cols) { gDPPipeSync(gfx++); diff --git a/src/code/z_fbdemo_circle.c b/src/code/z_fbdemo_circle.c index 8eaeb5ef03..decaa4861c 100644 --- a/src/code/z_fbdemo_circle.c +++ b/src/code/z_fbdemo_circle.c @@ -1,6 +1,6 @@ #include "global.h" -typedef enum { +typedef enum TransitionCircleDirection { /* 0 */ TRANS_CIRCLE_DIR_IN, /* 1 */ TRANS_CIRCLE_DIR_OUT } TransitionCircleDirection; @@ -164,13 +164,13 @@ void TransitionCircle_Draw(void* thisx, Gfx** gfxP) { gSPSegment(gfx++, 8, this->texture); gDPSetColor(gfx++, G_SETPRIMCOLOR, this->color.rgba); gDPSetColor(gfx++, G_SETENVCOLOR, this->color.rgba); - gSPMatrix(gfx++, &this->projection, G_MTX_PROJECTION | G_MTX_LOAD); + gSPMatrix(gfx++, &this->projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPPerspNormalize(gfx++, this->normal); - gSPMatrix(gfx++, &this->lookAt, G_MTX_PROJECTION | G_MTX_NOPUSH | G_MTX_MUL); + gSPMatrix(gfx++, &this->lookAt, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); if (scale != 1.0f) { guScale(&modelView[0], scale, scale, 1.0f); - gSPMatrix(gfx++, &modelView[0], G_MTX_LOAD); + gSPMatrix(gfx++, &modelView[0], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } if (rot != 0.0f) { diff --git a/src/code/z_fbdemo_fade.c b/src/code/z_fbdemo_fade.c index 1f0843176d..d2cb382f05 100644 --- a/src/code/z_fbdemo_fade.c +++ b/src/code/z_fbdemo_fade.c @@ -1,12 +1,12 @@ #include "global.h" #include "terminal.h" -typedef enum { +typedef enum TransitionFadeDirection { /* 0 */ TRANS_FADE_DIR_IN, /* 1 */ TRANS_FADE_DIR_OUT } TransitionFadeDirection; -typedef enum { +typedef enum TransitionFadeType { /* 0 */ TRANS_FADE_TYPE_NONE, /* 1 */ TRANS_FADE_TYPE_ONE_WAY, /* 2 */ TRANS_FADE_TYPE_FLASH @@ -68,8 +68,8 @@ void TransitionFade_Update(void* thisx, s32 updateRate) { this->isDone = true; } if ((u32)gSaveContext.transFadeDuration == 0) { - // "Divide by 0! Zero is included in ZCommonGet fade_speed" - PRINTF(VT_COL(RED, WHITE) "0除算! ZCommonGet fade_speed に0がはいってる" VT_RST); + PRINTF(VT_COL(RED, WHITE) T("0除算! ZCommonGet fade_speed に0がはいってる", + "Divide by 0! Zero is included in ZCommonGet fade_speed") VT_RST); } alpha = (255.0f * this->timer) / ((void)0, gSaveContext.transFadeDuration); @@ -101,7 +101,12 @@ void TransitionFade_Draw(void* thisx, Gfx** gfxP) { Gfx* gfx; Color_RGBA8_u32* color = &this->color; - if (color->a > 0) { +#if PLATFORM_N64 + if (color->a != 0) +#else + if (color->a > 0) +#endif + { gfx = *gfxP; gSPDisplayList(gfx++, sTransFadeSetupDL); gDPSetPrimColor(gfx++, 0, 0, color->r, color->g, color->b, color->a); diff --git a/src/code/z_fbdemo_triforce.c b/src/code/z_fbdemo_triforce.c index b131d209d9..7bb8862b2d 100644 --- a/src/code/z_fbdemo_triforce.c +++ b/src/code/z_fbdemo_triforce.c @@ -88,10 +88,10 @@ void TransitionTriforce_Draw(void* thisx, Gfx** gfxP) { gSPDisplayList(gfx++, sTransTriforceDL); gDPSetColor(gfx++, G_SETPRIMCOLOR, this->color.rgba); gDPSetCombineMode(gfx++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); - gSPMatrix(gfx++, &this->projection, G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gfx++, &modelView[0], G_MTX_LOAD); - gSPMatrix(gfx++, &modelView[1], G_MTX_NOPUSH | G_MTX_MODELVIEW | G_MTX_MUL); - gSPMatrix(gfx++, &modelView[2], G_MTX_NOPUSH | G_MTX_MODELVIEW | G_MTX_MUL); + gSPMatrix(gfx++, &this->projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gfx++, &modelView[0], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gfx++, &modelView[1], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); + gSPMatrix(gfx++, &modelView[2], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPVertex(gfx++, sTransTriforceVtx, 10, 0); if (!TransitionTriforce_IsDone(this)) { diff --git a/src/code/z_fbdemo_wipe1.c b/src/code/z_fbdemo_wipe1.c index 1170d0bd6d..7b92249b75 100644 --- a/src/code/z_fbdemo_wipe1.c +++ b/src/code/z_fbdemo_wipe1.c @@ -1,6 +1,6 @@ #include "global.h" -typedef enum { +typedef enum TransitionWipeDirection { /* 0 */ TRANS_WIPE_DIR_IN, /* 1 */ TRANS_WIPE_DIR_OUT } TransitionWipeDirection; @@ -89,7 +89,8 @@ void TransitionWipe_Draw(void* thisx, Gfx** gfxP) { Gfx* gfx = *gfxP; Mtx* modelView; TransitionWipe* this = (TransitionWipe*)thisx; - s32 pad[4]; + Color_RGBA8_u32* color; + s32 pad[3]; Gfx* texScroll; modelView = this->modelView[this->frame]; @@ -98,13 +99,18 @@ void TransitionWipe_Draw(void* thisx, Gfx** gfxP) { guScale(&modelView[0], 0.56f, 0.56f, 1.0f); guRotate(&modelView[1], 0.0f, 0.0f, 0.0f, 1.0f); guTranslate(&modelView[2], 0.0f, 0.0f, 0.0f); + gDPPipeSync(gfx++); + texScroll = Gfx_BranchTexScroll(&gfx, this->texX, this->texY, 0, 0); gSPSegment(gfx++, 8, texScroll); - gDPSetPrimColor(gfx++, 0, 0x80, this->color.r, this->color.g, this->color.b, 255); - gSPMatrix(gfx++, &this->projection, G_MTX_LOAD | G_MTX_PROJECTION); + + color = &this->color; + gDPSetPrimColor(gfx++, 0, 0x80, color->r, color->g, color->b, 255); + + gSPMatrix(gfx++, &this->projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPPerspNormalize(gfx++, this->normal); - gSPMatrix(gfx++, &this->lookAt, G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gfx++, &this->lookAt, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); gSPMatrix(gfx++, &modelView[0], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gfx++, &modelView[1], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gfx++, &modelView[2], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/code/z_fcurve_data_skelanime.c b/src/code/z_fcurve_data_skelanime.c index e4d4b8a772..1086adb2ec 100644 --- a/src/code/z_fcurve_data_skelanime.c +++ b/src/code/z_fcurve_data_skelanime.c @@ -77,7 +77,7 @@ void SkelCurve_SetAnim(SkelCurve* skelCurve, CurveAnimationHeader* animation, f3 skelCurve->animation = animation; } -typedef enum { +typedef enum SkelCurveVecType { /* 0 */ SKELCURVE_VEC_TYPE_SCALE, /* 1 */ SKELCURVE_VEC_TYPE_ROTATION, /* 2 */ SKELCURVE_VEC_TYPE_POSIITON, @@ -162,8 +162,6 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelCurve* skelCurve, Ov OPEN_DISPS(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 279); - if (1) {} - Matrix_Push(); if ((overrideLimbDraw == NULL) || @@ -194,8 +192,7 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelCurve* skelCurve, Ov dList = limb->dList[0]; if (dList != NULL) { - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 321), - G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 321); gSPDisplayList(POLY_OPA_DISP++, dList); } } else if (lod == 1) { @@ -203,19 +200,16 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelCurve* skelCurve, Ov dList = limb->dList[0]; if (dList != NULL) { - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 332), - G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 332); gSPDisplayList(POLY_OPA_DISP++, dList); } dList = limb->dList[1]; if (dList != NULL) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 338), - G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 338); gSPDisplayList(POLY_XLU_DISP++, dList); } } else { - // "FcSkeletonInfo_draw_child (): Not supported" - PRINTF("FcSkeletonInfo_draw_child():未対応\n"); + PRINTF(T("FcSkeletonInfo_draw_child():未対応\n", "FcSkeletonInfo_draw_child(): Not supported\n")); } } diff --git a/src/code/z_frame_advance.c b/src/code/z_frame_advance.c index f74dd1de7a..0e593ff6f4 100644 --- a/src/code/z_frame_advance.c +++ b/src/code/z_frame_advance.c @@ -2,6 +2,7 @@ #include "stdbool.h" +#include "controller.h" #include "padmgr.h" #include "macros.h" diff --git a/src/code/z_game_over.c b/src/code/z_game_over.c index ff2f2a57db..e6335307da 100644 --- a/src/code/z_game_over.c +++ b/src/code/z_game_over.c @@ -1,6 +1,7 @@ #include "z64game_over.h" #include "global.h" +#include "versions.h" void GameOver_Init(PlayState* play) { play->gameOverCtx.state = GAMEOVER_INACTIVE; @@ -61,7 +62,12 @@ void GameOver_Update(PlayState* play) { } } +#if OOT_VERSION < PAL_1_1 + gSaveContext.nayrusLoveTimer = 0; +#else gSaveContext.nayrusLoveTimer = 2000; +#endif + gSaveContext.save.info.playerData.naviTimer = 0; gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = NATURE_ID_DISABLED; diff --git a/src/code/z_horse.c b/src/code/z_horse.c index 41fddbccfd..d3d66c3de6 100644 --- a/src/code/z_horse.c +++ b/src/code/z_horse.c @@ -34,7 +34,7 @@ void func_8006D0AC(PlayState* play) { } } -typedef struct { +typedef struct HorseSpawn { /* 0x00 */ s16 sceneId; /* 0x02 */ Vec3s pos; /* 0x08 */ s16 angle; @@ -75,9 +75,8 @@ void func_8006D0EC(PlayState* play, Player* player) { ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 389); } else if ((play->sceneId == gSaveContext.save.info.horseData.sceneId) && (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || DREG(1) != 0)) { - // "Set by existence of horse %d %d %d" - PRINTF("馬存在によるセット %d %d %d\n", gSaveContext.save.info.horseData.sceneId, - Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED), DREG(1)); + PRINTF(T("馬存在によるセット %d %d %d\n", "Set by existence of horse %d %d %d\n"), + gSaveContext.save.info.horseData.sceneId, Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED), DREG(1)); if (func_8006CFC0(gSaveContext.save.info.horseData.sceneId)) { Actor* horseActor = @@ -90,8 +89,9 @@ void func_8006D0EC(PlayState* play, Player* player) { } } else { PRINTF(VT_COL(RED, WHITE)); - // "Horse_SetNormal():%d set spot is no good." - PRINTF("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.save.info.horseData.sceneId); + PRINTF( + T("Horse_SetNormal():%d セットスポットまずいです。\n", "Horse_SetNormal():%d set spot is no good.\n"), + gSaveContext.save.info.horseData.sceneId); PRINTF(VT_RST); func_8006D074(play); } @@ -121,7 +121,7 @@ void func_8006D0EC(PlayState* play, Player* player) { } } -typedef struct { +typedef struct struct_8011F9B8 { /* 0x00 */ s16 sceneId; /* 0x04 */ s32 cutsceneIndex; /* 0x08 */ Vec3s pos; @@ -246,8 +246,9 @@ void func_8006DC68(PlayState* play, Player* player) { if (LINK_IS_ADULT) { if (!func_8006CFC0(gSaveContext.save.info.horseData.sceneId)) { PRINTF(VT_COL(RED, WHITE)); - // "Horse_Set_Check():%d set spot is no good." - PRINTF("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.save.info.horseData.sceneId); + PRINTF( + T("Horse_Set_Check():%d セットスポットまずいです。\n", "Horse_Set_Check():%d set spot is no good.\n"), + gSaveContext.save.info.horseData.sceneId); PRINTF(VT_RST); func_8006D074(play); } diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c index 54edbf19bb..deee31dfde 100644 --- a/src/code/z_jpeg.c +++ b/src/code/z_jpeg.c @@ -178,22 +178,23 @@ void Jpeg_ParseMarkers(u8* ptr, JpegContext* ctx) { case MARKER_SOF: { // Start of Frame, stores important metadata of the image. // Only used for extracting the sampling factors (ctx->mode). - PRINTF("MARKER_SOF %d " - "精度%02x " // "accuracy" - "垂直%d " // "vertical" - "水平%d " // "horizontal" - "compo%02x " - "(1:Y)%d (H0=2,V0=1(422) or 2(420))%02x (量子化テーブル)%02x " - "(2:Cb)%d (H1=1,V1=1)%02x (量子化テーブル)%02x " - "(3:Cr)%d (H2=1,V2=1)%02x (量子化テーブル)%02x\n", + PRINTF(T("MARKER_SOF %d " + "精度%02x 垂直%d 水平%d compo%02x " + "(1:Y)%d (H0=2,V0=1(422) or 2(420))%02x (量子化テーブル)%02x " + "(2:Cb)%d (H1=1,V1=1)%02x (量子化テーブル)%02x " + "(3:Cr)%d (H2=1,V2=1)%02x (量子化テーブル)%02x\n", + "MARKER_SOF %d " + "accuracy%02x vertical%d horizontal%d compo%02x " + "(1:Y)%d (H0=2,V0=1(422) or 2(420))%02x (quantization tables)%02x " + "(2:Cb)%d (H1=1,V1=1)%02x (quantization tables)%02x " + "(3:Cr)%d (H2=1,V2=1)%02x (quantization tables)%02x\n"), Jpeg_GetUnalignedU16(ptr), - ptr[2], // precision - Jpeg_GetUnalignedU16(ptr + 3), // height - Jpeg_GetUnalignedU16(ptr + 5), // width - ptr[7], // component count (assumed to be 3) - ptr[8], ptr[9], ptr[10], // Y component - ptr[11], ptr[12], ptr[13], // Cb component - ptr[14], ptr[15], ptr[16] // Cr component + // precision, height, width, component count (assumed to be 3) + ptr[2], Jpeg_GetUnalignedU16(ptr + 3), Jpeg_GetUnalignedU16(ptr + 5), ptr[7], + // + ptr[8], ptr[9], ptr[10], // Y component + ptr[11], ptr[12], ptr[13], // Cb component + ptr[14], ptr[15], ptr[16] // Cr component ); if (ptr[9] == 0x21) { @@ -220,7 +221,7 @@ void Jpeg_ParseMarkers(u8* ptr, JpegContext* ctx) { break; } default: { - PRINTF("マーカー不明 %02x\n", ptr[-1]); // "Unknown marker" + PRINTF(T("マーカー不明 %02x\n", "Unknown marker %02x\n"), ptr[-1]); ptr += Jpeg_GetUnalignedU16(ptr); break; } @@ -256,8 +257,9 @@ s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize) { curTime = osGetTime(); diff = curTime - time; time = curTime; - // "Wait for synchronization of fifo buffer" - PRINTF("*** fifoバッファの同期待ち time = %6.3f ms ***\n", OS_CYCLES_TO_USEC(diff) / 1000.0f); + PRINTF(T("*** fifoバッファの同期待ち time = %6.3f ms ***\n", + "*** Wait for synchronization of fifo buffer time = %6.3f ms ***\n"), + OS_CYCLES_TO_USEC(diff) / 1000.0f); ctx.workBuf = workBuff; Jpeg_ParseMarkers(data, &ctx); @@ -265,8 +267,9 @@ s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize) { curTime = osGetTime(); diff = curTime - time; time = curTime; - // "Check markers for each segment" - PRINTF("*** 各セグメントのマーカーのチェック time = %6.3f ms ***\n", OS_CYCLES_TO_USEC(diff) / 1000.0f); + PRINTF(T("*** 各セグメントのマーカーのチェック time = %6.3f ms ***\n", + "*** Check markers for each segment time = %6.3f ms ***\n"), + OS_CYCLES_TO_USEC(diff) / 1000.0f); switch (ctx.dqtCount) { case 1: @@ -289,8 +292,8 @@ s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize) { curTime = osGetTime(); diff = curTime - time; time = curTime; - // "Create quantization table" - PRINTF("*** 量子化テーブル作成 time = %6.3f ms ***\n", OS_CYCLES_TO_USEC(diff) / 1000.0f); + PRINTF(T("*** 量子化テーブル作成 time = %6.3f ms ***\n", "*** Create quantization table time = %6.3f ms ***\n"), + OS_CYCLES_TO_USEC(diff) / 1000.0f); switch (ctx.dhtCount) { case 1: @@ -319,8 +322,8 @@ s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize) { curTime = osGetTime(); diff = curTime - time; time = curTime; - // "Huffman table creation" - PRINTF("*** ハフマンテーブル作成 time = %6.3f ms ***\n", OS_CYCLES_TO_USEC(diff) / 1000.0f); + PRINTF(T("*** ハフマンテーブル作成 time = %6.3f ms ***\n", "*** Huffman table creation time = %6.3f ms ***\n"), + OS_CYCLES_TO_USEC(diff) / 1000.0f); decoder.imageData = ctx.imageData; decoder.mode = ctx.mode; @@ -356,8 +359,8 @@ s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize) { curTime = osGetTime(); diff = curTime - time; time = curTime; - // "Unfold & draw" - PRINTF("*** 展開 & 描画 time = %6.3f ms ***\n", OS_CYCLES_TO_USEC(diff) / 1000.0f); + PRINTF(T("*** 展開 & 描画 time = %6.3f ms ***\n", "*** Unfold & draw time = %6.3f ms ***\n"), + OS_CYCLES_TO_USEC(diff) / 1000.0f); return 0; } diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c index 954cbcf3f2..761d1fb9ec 100644 --- a/src/code/z_kaleido_manager.c +++ b/src/code/z_kaleido_manager.c @@ -51,7 +51,8 @@ void KaleidoManager_Init(PlayState* play) { } PRINTF(VT_FGCOL(GREEN)); - PRINTF("KaleidoArea の最大サイズは %d バイトを確保します\n", largestSize); + PRINTF(T("KaleidoArea の最大サイズは %d バイトを確保します\n", "The maximum size of KaleidoArea is %d bytes\n"), + largestSize); PRINTF(VT_RST); sKaleidoAreaPtr = GAME_STATE_ALLOC(&play->state, largestSize, "../z_kaleido_manager.c", 150); @@ -91,7 +92,7 @@ void* KaleidoManager_GetRamAddr(void* vram) { //! @bug Probably missing iter++ here } - PRINTF("異常\n"); // "Abnormal" + PRINTF(T("異常\n", "Abnormal\n")); return NULL; } diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c index bd15f5742d..8a05f1e7d8 100644 --- a/src/code/z_kaleido_scope_call.c +++ b/src/code/z_kaleido_scope_call.c @@ -1,11 +1,9 @@ +#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" \ + "ntsc-1.2:224 pal-1.0:224 pal-1.1:224" + #include "global.h" #include "terminal.h" -// For retail BSS ordering, the block number of sKaleidoScopeUpdateFunc must be 0 or -// just above (the exact upper bound depends on the block numbers assigned to -// extern variables declared in headers). -#pragma increment_block_number 60 - void (*sKaleidoScopeUpdateFunc)(PlayState* play); void (*sKaleidoScopeDrawFunc)(PlayState* play); f32 gBossMarkScale; @@ -21,14 +19,14 @@ void KaleidoScopeCall_LoadPlayer(void) { if (gKaleidoMgrCurOvl != playerActorOvl) { if (gKaleidoMgrCurOvl != NULL) { PRINTF(VT_FGCOL(GREEN)); - PRINTF("カレイド領域 強制排除\n"); // "Kaleido area forced exclusion" + PRINTF(T("カレイド領域 強制排除\n", "Kaleido area forced exclusion\n")); PRINTF(VT_RST); KaleidoManager_ClearOvl(gKaleidoMgrCurOvl); } PRINTF(VT_FGCOL(GREEN)); - PRINTF("プレイヤーアクター搬入\n"); // "Player actor import" + PRINTF(T("プレイヤーアクター搬入\n", "Player actor import\n")); PRINTF(VT_RST); KaleidoManager_LoadOvl(playerActorOvl); @@ -36,8 +34,7 @@ void KaleidoScopeCall_LoadPlayer(void) { } void KaleidoScopeCall_Init(PlayState* play) { - // "Kaleidoscope replacement construction" - PRINTF("カレイド・スコープ入れ替え コンストラクト \n"); + PRINTF(T("カレイド・スコープ入れ替え コンストラクト \n", "Kaleidoscope replacement construction\n")); sKaleidoScopeUpdateFunc = KaleidoManager_GetRamAddr(KaleidoScope_Update); sKaleidoScopeDrawFunc = KaleidoManager_GetRamAddr(KaleidoScope_Draw); @@ -51,8 +48,7 @@ void KaleidoScopeCall_Init(PlayState* play) { } void KaleidoScopeCall_Destroy(PlayState* play) { - // "Kaleidoscope replacement destruction" - PRINTF("カレイド・スコープ入れ替え デストラクト \n"); + PRINTF(T("カレイド・スコープ入れ替え デストラクト \n", "Kaleidoscope replacement destruction\n")); KaleidoSetup_Destroy(play); } @@ -71,7 +67,7 @@ void KaleidoScopeCall_Update(PlayState* play) { R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_SETUP; pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; - pauseCtx->unk_1EC = 0; + pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_APPEARING; pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1; // PAUSE_STATE_WAIT_BG_PRERENDER } } else if (pauseCtx->state == PAUSE_STATE_8) { @@ -82,7 +78,7 @@ void KaleidoScopeCall_Update(PlayState* play) { R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_SETUP; pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; - pauseCtx->unk_1EC = 0; + pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_APPEARING; pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1; // PAUSE_STATE_9 } else if ((pauseCtx->state == PAUSE_STATE_WAIT_BG_PRERENDER) || (pauseCtx->state == PAUSE_STATE_9)) { PRINTF("PR_KAREIDOSCOPE_MODE=%d\n", R_PAUSE_BG_PRERENDER_STATE); @@ -94,16 +90,14 @@ void KaleidoScopeCall_Update(PlayState* play) { if (gKaleidoMgrCurOvl != kaleidoScopeOvl) { if (gKaleidoMgrCurOvl != NULL) { PRINTF(VT_FGCOL(GREEN)); - // "Kaleido area Player Forced Elimination" - PRINTF("カレイド領域 プレイヤー 強制排除\n"); + PRINTF(T("カレイド領域 プレイヤー 強制排除\n", "Kaleido area Player Forced Elimination\n")); PRINTF(VT_RST); KaleidoManager_ClearOvl(gKaleidoMgrCurOvl); } PRINTF(VT_FGCOL(GREEN)); - // "Kaleido area Kaleidoscope loading" - PRINTF("カレイド領域 カレイドスコープ搬入\n"); + PRINTF(T("カレイド領域 カレイドスコープ搬入\n", "Kaleido area Kaleidoscope loading\n")); PRINTF(VT_RST); KaleidoManager_LoadOvl(kaleidoScopeOvl); @@ -114,8 +108,7 @@ void KaleidoScopeCall_Update(PlayState* play) { if (!IS_PAUSED(&play->pauseCtx)) { PRINTF(VT_FGCOL(GREEN)); - // "Kaleido area Kaleidoscope Emission" - PRINTF("カレイド領域 カレイドスコープ排出\n"); + PRINTF(T("カレイド領域 カレイドスコープ排出\n", "Kaleido area Kaleidoscope Emission\n")); PRINTF(VT_RST); KaleidoManager_ClearOvl(kaleidoScopeOvl); diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index 67e7421242..21874c4ecf 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -1,4 +1,7 @@ #include "global.h" +#if PLATFORM_N64 +#include "n64dd.h" +#endif /* * The following three arrays are effectively unused. @@ -57,6 +60,9 @@ f32 sKaleidoSetupRightPageEyeZ[] = { void KaleidoSetup_Update(PlayState* play) { PauseContext* pauseCtx = &play->pauseCtx; Input* input = &play->state.input[0]; +#if PLATFORM_N64 + s32 pad; +#endif if (!IS_PAUSED(pauseCtx) && play->gameOverCtx.state == GAMEOVER_INACTIVE && play->transitionTrigger == TRANS_TRIGGER_OFF && play->transitionMode == TRANS_MODE_OFF && @@ -107,7 +113,7 @@ void KaleidoSetup_Update(PlayState* play) { } if (pauseCtx->state == PAUSE_STATE_WAIT_LETTERBOX) { - WREG(2) = -6240; + R_PAUSE_PAGES_Y_ORIGIN_2 = PAUSE_PAGES_Y_ORIGIN_2_LOWER; R_UPDATE_RATE = 2; if (Letterbox_GetSizeTarget() != 0) { @@ -127,19 +133,19 @@ void KaleidoSetup_Init(PlayState* play) { pauseCtx->eye.x = pauseCtx->eye.y = 0.0f; pauseCtx->eye.z = 64.0f; - pauseCtx->unk_1F0 = 936.0f; - pauseCtx->unk_1F4 = pauseCtx->unk_1F8 = pauseCtx->unk_1FC = pauseCtx->unk_200 = 160.0f; + pauseCtx->promptDepthOffset = 936.0f; + pauseCtx->itemPagePitch = pauseCtx->equipPagePitch = pauseCtx->mapPagePitch = pauseCtx->questPagePitch = 160.0f; pauseCtx->alpha = 0; // mainState = PAUSE_MAIN_STATE_IDLE , pageIndex = PAUSE_ITEM pauseCtx->pageSwitchTimer = pauseCtx->mainState = pauseCtx->nextPageMode = pauseCtx->pageIndex = 0; - pauseCtx->unk_204 = -314.0f; + pauseCtx->promptPitch = -314.0f; pauseCtx->cursorPoint[PAUSE_ITEM] = 0; pauseCtx->cursorPoint[PAUSE_MAP] = VREG(30) + 3; - pauseCtx->cursorPoint[PAUSE_QUEST] = 0; + pauseCtx->cursorPoint[PAUSE_QUEST] = QUEST_MEDALLION_FOREST; pauseCtx->cursorPoint[PAUSE_EQUIP] = 1; pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 10; @@ -170,7 +176,18 @@ void KaleidoSetup_Init(PlayState* play) { pauseCtx->cursorSpecialPos = 0; View_Init(&pauseCtx->view, play->state.gfxCtx); + +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_3C != NULL)) { + B_80121220->unk_3C(); + } +#endif } void KaleidoSetup_Destroy(PlayState* play) { +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_40 != NULL)) { + B_80121220->unk_40(); + } +#endif } diff --git a/src/code/z_kanfont.c b/src/code/z_kanfont.c index 83686a02ed..a4ae98c5b1 100644 --- a/src/code/z_kanfont.c +++ b/src/code/z_kanfont.c @@ -1,7 +1,16 @@ #include "global.h" #include "message_data_static.h" +#include "versions.h" -void func_8006EE50(Font* font, u16 arg1, u16 arg2) { +/** + * Loads a texture from kanji for the requested `character` into the character texture buffer + * at `codePointIndex`. The value of `character` is the SHIFT-JIS encoding of the character. + */ +void Font_LoadCharWide(Font* font, u16 character, u16 codePointIndex) { +#if OOT_NTSC + DmaMgr_RequestSync(&font->charTexBuf[codePointIndex], + (uintptr_t)_kanjiSegmentRomStart + Kanji_OffsetFromShiftJIS(character), FONT_CHAR_TEX_SIZE); +#endif } /** @@ -33,14 +42,34 @@ void Font_LoadMessageBoxIcon(Font* font, u16 icon) { * the font buffer. */ void Font_LoadOrderedFont(Font* font) { + s32 size; s32 len; s32 codePointIndex; s32 fontBufIndex; u32 offset; font->msgOffset = FONT_MESSAGE_OFFSET; - len = font->msgLength = FONT_MESSAGE_LENGTH; + size = font->msgLength = FONT_MESSAGE_LENGTH; + +#if OOT_NTSC + len = (u32)size / 2; + DmaMgr_RequestSync(font->msgBufWide, (uintptr_t)_jpn_message_data_staticSegmentRomStart + font->msgOffset, size); + + fontBufIndex = 0; + for (codePointIndex = 0; font->msgBufWide[codePointIndex] != MESSAGE_WIDE_END; codePointIndex++) { + if (len < codePointIndex) { + return; + } + if (font->msgBufWide[codePointIndex] != MESSAGE_WIDE_NEWLINE) { + offset = Kanji_OffsetFromShiftJIS(font->msgBufWide[codePointIndex]); + DmaMgr_RequestSync(&font->fontBuf[fontBufIndex * 8], (uintptr_t)_kanjiSegmentRomStart + offset, + FONT_CHAR_TEX_SIZE); + fontBufIndex += FONT_CHAR_TEX_SIZE / 8; + } + } +#else + len = size; DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, len, "../z_kanfont.c", 122); @@ -49,7 +78,7 @@ void Font_LoadOrderedFont(Font* font) { fontBufIndex = 0; for (codePointIndex = 0; font->msgBuf[codePointIndex] != MESSAGE_END; codePointIndex++) { if (codePointIndex > (len * 1)) { - PRINTF("ERROR!! エラー!!! error───!!!!\n"); + PRINTF(T("ERROR!! エラー!!! error───!!!!\n", "ERROR!! Error!!! error───!!!!\n")); return; } @@ -62,4 +91,5 @@ void Font_LoadOrderedFont(Font* font) { fontBufIndex += FONT_CHAR_TEX_SIZE / 8; } } +#endif } diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index 138d6e7ad1..42f6990b55 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -1,25 +1,24 @@ +#pragma increment_block_number "gc-eu:244 gc-eu-mq:244 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" \ + "ntsc-1.2:224 pal-1.0:252 pal-1.1:252" + #include "global.h" #include "ultra64.h" #include "terminal.h" +#include "versions.h" #include "z64frame_advance.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" -// For retail BSS ordering, the block number of sLensFlareUnused must be lower -// than the extern variables declared in the header (e.g. gLightningStrike) -// while the block number of sNGameOverLightNode must be higher. -#pragma increment_block_number 80 - -typedef enum { +typedef enum LightningBoltState { /* 0x00 */ LIGHTNING_BOLT_START, /* 0x01 */ LIGHTNING_BOLT_WAIT, /* 0x02 */ LIGHTNING_BOLT_DRAW, /* 0xFF */ LIGHTNING_BOLT_INACTIVE = 0xFF } LightningBoltState; -typedef struct { +typedef struct ZBufValConversionEntry { /* 0x00 */ s32 mantissaShift; // shift applied to the mantissa of the z buffer value /* 0x04 */ s32 base; // 15.3 fixed-point base value for the exponent } ZBufValConversionEntry; // size = 0x8 @@ -44,7 +43,7 @@ u16 gTimeSpeed = 0; u16 sSunScreenDepth = GPACK_ZDZ(G_MAXFBZ, 0); -typedef struct { +typedef struct TimeBasedLightEntry { /* 0x00 */ u16 startTime; /* 0x02 */ u16 endTime; /* 0x04 */ u8 lightSetting; @@ -196,7 +195,7 @@ s16 gLensFlareScale; f32 gLensFlareColorIntensity; s16 gLensFlareGlareStrength; -typedef struct { +typedef struct LightningBolt { /* 0x00 */ u8 state; /* 0x04 */ Vec3f offset; /* 0x10 */ Vec3f pos; @@ -215,10 +214,8 @@ s16 sLightningFlashAlpha; s16 sSunDepthTestX; s16 sSunDepthTestY; -// These variables could be moved farther down in the file to reduce the amount -// of block number padding here, but currently this causes BSS ordering issues -// for debug. -#pragma increment_block_number 217 +#pragma increment_block_number "gc-eu:240 gc-eu-mq:240 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" \ + "ntsc-1.2:224 pal-1.0:240 pal-1.1:240" LightNode* sNGameOverLightNode; LightInfo sNGameOverLightInfo; @@ -447,8 +444,8 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused) sLightningBolts[i].state = LIGHTNING_BOLT_INACTIVE; } - play->roomCtx.unk_74[0] = 0; - play->roomCtx.unk_74[1] = 0; + play->roomCtx.drawParams[0] = 0; + play->roomCtx.drawParams[1] = 0; for (i = 0; i < ARRAY_COUNT(play->csCtx.actorCues); i++) { play->csCtx.actorCues[i] = NULL; @@ -456,8 +453,8 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused) if (Object_GetSlot(&play->objectCtx, OBJECT_GAMEPLAY_FIELD_KEEP) < 0 && !play->envCtx.sunMoonDisabled) { play->envCtx.sunMoonDisabled = true; - // "Sun setting other than field keep! So forced release!" - PRINTF(VT_COL(YELLOW, BLACK) "\n\nフィールド常駐以外、太陽設定!よって強制解除!\n" VT_RST); + PRINTF(VT_COL(YELLOW, BLACK) T("\n\nフィールド常駐以外、太陽設定!よって強制解除!\n", + "\n\nSun setting other than field keep! So forced release!\n") VT_RST); } gCustomLensFlareOn = false; @@ -574,8 +571,8 @@ f32 Environment_LerpWeightAccelDecel(u16 endFrame, u16 startFrame, u16 curFrame, decelDurationF = (s32)decelDuration; if ((startFrameF >= endFrameF) || (accelDurationF + decelDurationF > totalFrames)) { - // "The frame relation between end_frame and start_frame is wrong!!!" - PRINTF(VT_COL(RED, WHITE) "\nend_frameとstart_frameのフレーム関係がおかしい!!!" VT_RST); + PRINTF(VT_COL(RED, WHITE) T("\nend_frameとstart_frameのフレーム関係がおかしい!!!", + "\nThe frame relation between end_frame and start_frame is wrong!!!") VT_RST); PRINTF(VT_COL(RED, WHITE) "\nby get_parcent_forAccelBrake!!!!!!!!!" VT_RST); return 0.0f; @@ -723,8 +720,8 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon #if IS_DEBUG if (newSkybox1Index == 0xFF) { - // "Environment VR data acquisition failed! Report to Sasaki!" - PRINTF(VT_COL(RED, WHITE) "\n環境VRデータ取得失敗! ささきまでご報告を!" VT_RST); + PRINTF(VT_COL(RED, WHITE) T("\n環境VRデータ取得失敗! ささきまでご報告を!", + "\nEnvironment VR data acquisition failed! Report to Sasaki!") VT_RST); } #endif @@ -810,8 +807,8 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon void Environment_EnableUnderwaterLights(PlayState* play, s32 waterLightsIndex) { if (waterLightsIndex == WATERBOX_LIGHT_INDEX_NONE) { waterLightsIndex = 0; - // "Underwater color is not set in the water poly data!" - PRINTF(VT_COL(YELLOW, BLACK) "\n水ポリゴンデータに水中カラーが設定されておりません!" VT_RST); + PRINTF(VT_COL(YELLOW, BLACK) T("\n水ポリゴンデータに水中カラーが設定されておりません!", + "\nUnderwater color is not set in the water poly data!") VT_RST); } if (play->envCtx.lightMode == LIGHT_MODE_TIME) { @@ -965,9 +962,15 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex } //! @bug `gTimeSpeed` is unsigned, it can't be negative +#if OOT_VERSION < PAL_1_0 + if ((((void)0, gSaveContext.save.dayTime) > ((void)0, gSaveContext.skyboxTime)) || + (((void)0, gSaveContext.save.dayTime) < CLOCK_TIME(1, 0) || gTimeSpeed < 0)) +#else if (((((void)0, gSaveContext.sceneLayer) >= 5 || gTimeSpeed != 0) && - ((void)0, gSaveContext.save.dayTime) > gSaveContext.skyboxTime) || - (((void)0, gSaveContext.save.dayTime) < CLOCK_TIME(1, 0) || gTimeSpeed < 0)) { + ((void)0, gSaveContext.save.dayTime) > ((void)0, gSaveContext.skyboxTime)) || + (((void)0, gSaveContext.save.dayTime) < CLOCK_TIME(1, 0) || gTimeSpeed < 0)) +#endif + { gSaveContext.skyboxTime = ((void)0, gSaveContext.save.dayTime); } @@ -994,7 +997,6 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex gSPEndDisplayList(displayList++); Gfx_Close(prevDisplayList, displayList); POLY_OPA_DISP = displayList; - if (1) {} CLOSE_DISPS(play->state.gfxCtx, "../z_kankyo.c", 1690); } #endif @@ -1151,11 +1153,11 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex #if IS_DEBUG if (sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting >= envCtx->numLightSettings) { - // "The color palette setting seems to be wrong!" - PRINTF(VT_COL(RED, WHITE) "\nカラーパレットの設定がおかしいようです!" VT_RST); + PRINTF(VT_COL(RED, WHITE) T("\nカラーパレットの設定がおかしいようです!", + "\nThe color palette setting seems to be wrong!") VT_RST); - // "Palette setting = [] Last palette number = []" - PRINTF(VT_COL(RED, WHITE) "\n設定パレット=[%d] 最後パレット番号=[%d]\n" VT_RST, + PRINTF(VT_COL(RED, WHITE) T("\n設定パレット=[%d] 最後パレット番号=[%d]\n", + "\nPalette setting = [%d] Last palette number = [%d]\n") VT_RST, sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting, envCtx->numLightSettings - 1); } @@ -1230,12 +1232,12 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex #if IS_DEBUG if (envCtx->lightSetting >= envCtx->numLightSettings) { - // "The color palette seems to be wrong!" - PRINTF("\n" VT_FGCOL(RED) "カラーパレットがおかしいようです!"); + PRINTF("\n" VT_FGCOL(RED) + T("カラーパレットがおかしいようです!", "The color palette seems to be wrong!")); - // "Palette setting = [] Last palette number = []" - PRINTF("\n" VT_FGCOL(YELLOW) "設定パレット=[%d] パレット数=[%d]\n" VT_RST, envCtx->lightSetting, - envCtx->numLightSettings); + PRINTF("\n" VT_FGCOL(YELLOW) T("設定パレット=[%d] パレット数=[%d]\n", + "Palette setting = [%d] Last palette number = [%d]\n") VT_RST, + envCtx->lightSetting, envCtx->numLightSettings); } #endif } @@ -1464,7 +1466,7 @@ void Environment_DrawSunAndMoon(PlayState* play) { scale = (color * 2.0f) + 10.0f; Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_kankyo.c", 2364), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_kankyo.c", 2364); Gfx_SetupDL_54Opa(play->state.gfxCtx); gDPSetRenderMode(POLY_OPA_DISP++, G_RM_FOG_PRIM_A, G_RM_XLU_SURF2); gSPDisplayList(POLY_OPA_DISP++, gSunDL); @@ -1484,7 +1486,7 @@ void Environment_DrawSunAndMoon(PlayState* play) { alpha = temp * 255.0f; if (alpha > 0) { - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_kankyo.c", 2406), G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, MATRIX_FINALIZE(play->state.gfxCtx, "../z_kankyo.c", 2406), G_MTX_LOAD); gDPPipeSync(POLY_OPA_DISP++); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 240, 255, 180, alpha); gDPSetEnvColor(POLY_OPA_DISP++, 80, 70, 20, alpha); @@ -1506,7 +1508,7 @@ void Environment_DrawSunLensFlare(PlayState* play, EnvironmentContext* envCtx, V f32 sLensFlareScales[] = { 23.0f, 12.0f, 7.0f, 5.0f, 3.0f, 10.0f, 6.0f, 2.0f, 3.0f, 1.0f }; -typedef enum { +typedef enum LensFlareType { /* 0 */ LENS_FLARE_CIRCLE0, /* 1 */ LENS_FLARE_CIRCLE1, /* 2 */ LENS_FLARE_RING @@ -1598,7 +1600,9 @@ void Environment_DrawLensFlare(PlayState* play, EnvironmentContext* envCtx, View sqrtf((SQ(lookDirX) + SQ(lookDirY) + SQ(lookDirZ)) * (SQ(posDirX) + SQ(posDirY) + SQ(posDirZ))); lensFlareAlphaScaleTarget = cosAngle * 3.5f; - lensFlareAlphaScaleTarget = CLAMP_MAX(lensFlareAlphaScaleTarget, 1.0f); + if (lensFlareAlphaScaleTarget > 1.0f) { + lensFlareAlphaScaleTarget = 1.0f; + } if (!isSun) { lensFlareAlphaScaleTarget = cosAngle; @@ -1646,7 +1650,9 @@ void Environment_DrawLensFlare(PlayState* play, EnvironmentContext* envCtx, View alpha *= 1.0f - fogInfluence; +#if !PLATFORM_N64 if (1) {} +#endif if (!(isOffScreen ^ 0)) { Math_SmoothStepToF(&envCtx->lensFlareAlphaScale, lensFlareAlphaScaleTarget, 0.5f, 0.05f, 0.001f); @@ -1657,8 +1663,7 @@ void Environment_DrawLensFlare(PlayState* play, EnvironmentContext* envCtx, View POLY_XLU_DISP = func_800947AC(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, lensFlareColors[i].r, lensFlareColors[i].g, lensFlareColors[i].b, alpha * envCtx->lensFlareAlphaScale); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_kankyo.c", 2662), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_kankyo.c", 2662); gDPSetCombineLERP(POLY_XLU_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE); @@ -1743,8 +1748,13 @@ void Environment_DrawRain(PlayState* play, View* view, GraphicsContext* gfxCtx) Vec3f windDirection = { 0.0f, 0.0f, 0.0f }; Player* player = GET_PLAYER(play); +#if OOT_VERSION < PAL_1_0 + if (!(play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_CAMERA_IN_WATER)) +#else 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)) +#endif + { OPEN_DISPS(gfxCtx, "../z_kankyo.c", 2799); vec.x = view->at.x - view->eye.x; @@ -1794,8 +1804,7 @@ void Environment_DrawRain(PlayState* play, View* view, GraphicsContext* gfxCtx) Matrix_RotateY(-rotY, MTXMODE_APPLY); Matrix_RotateX(M_PI / 2 - rotX, MTXMODE_APPLY); Matrix_Scale(0.4f, 1.2f, 0.4f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_kankyo.c", 2887), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_kankyo.c", 2887); gSPDisplayList(POLY_XLU_DISP++, gRaindropDL); } @@ -1821,8 +1830,7 @@ void Environment_DrawRain(PlayState* play, View* view, GraphicsContext* gfxCtx) Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY); } - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_kankyo.c", 2940), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_kankyo.c", 2940); gSPDisplayList(POLY_XLU_DISP++, gEffShockwaveDL); } } @@ -2042,8 +2050,7 @@ void Environment_DrawLightning(PlayState* play, s32 unused) { Matrix_Scale(22.0f, 100.0f, 22.0f, MTXMODE_APPLY); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 128); gDPSetEnvColor(POLY_XLU_DISP++, 0, 255, 255, 128); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_kankyo.c", 3333), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_kankyo.c", 3333); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(lightningTextures[sLightningBolts[i].textureIndex])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, sLightningBolts[i].textureIndex); Gfx_SetupDL_61Xlu(play->state.gfxCtx); @@ -2075,9 +2082,9 @@ void Environment_PlaySceneSequence(PlayState* play) { Audio_PlayNatureAmbienceSequence(play->sceneSequences.natureAmbienceId); } } else if (play->sceneSequences.natureAmbienceId == NATURE_ID_NONE) { - // "BGM Configuration" - PRINTF("\n\n\nBGM設定game_play->sound_info.BGM=[%d] old_bgm=[%d]\n\n", play->sceneSequences.seqId, - ((void)0, gSaveContext.seqId)); + PRINTF(T("\n\n\nBGM設定game_play->sound_info.BGM=[%d] old_bgm=[%d]\n\n", + "\n\n\nBGM Configuration game_play->sound_info.BGM=[%d] old_bgm=[%d]\n\n"), + play->sceneSequences.seqId, ((void)0, gSaveContext.seqId)); if (((void)0, gSaveContext.seqId) != play->sceneSequences.seqId) { Audio_PlaySceneSequence(play->sceneSequences.seqId); } @@ -2105,9 +2112,9 @@ void Environment_PlaySceneSequence(PlayState* play) { } PRINTF("\n-----------------\n", ((void)0, gSaveContext.forcedSeqId)); - PRINTF("\n 強制BGM=[%d]", ((void)0, gSaveContext.forcedSeqId)); // "Forced BGM" + PRINTF(T("\n 強制BGM=[%d]", "\n Forced BGM=[%d]"), ((void)0, gSaveContext.forcedSeqId)); PRINTF("\n BGM=[%d]", play->sceneSequences.seqId); - PRINTF("\n エンブ=[%d]", play->sceneSequences.natureAmbienceId); + PRINTF(T("\n エンブ=[%d]", "\n Embed=[%d]"), play->sceneSequences.natureAmbienceId); PRINTF("\n status=[%d]", play->envCtx.timeSeqState); Audio_SetEnvReverb(play->roomCtx.curRoom.echo); @@ -2523,7 +2530,7 @@ void Environment_AdjustLights(PlayState* play, f32 arg1, f32 arg2, f32 arg3, f32 f32 temp; s32 i; - if (play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_5 && Play_CamIsNotFixed(play)) { + if (play->roomCtx.curRoom.type != ROOM_TYPE_BOSS && Play_CamIsNotFixed(play)) { arg1 = CLAMP_MIN(arg1, 0.0f); arg1 = CLAMP_MAX(arg1, 1.0f); diff --git a/src/code/z_lib.c b/src/code/z_lib.c index 5eba9346f5..d5f59a2a86 100644 --- a/src/code/z_lib.c +++ b/src/code/z_lib.c @@ -16,7 +16,7 @@ * - the arguments are in a different order, * - `val` is a `u8` instead of the standard `s32`. * - * @see There are two other memsets in this codebase, __osMemset(), MemSet() + * @see There are two other memsets in this codebase, memset(), MemSet() * * @param dest address to start at * @param len number of bytes to write diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c index 4f8357ae22..950bcad806 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -479,8 +479,8 @@ void Health_DrawMeter(PlayState* play) { f32 wideOffsetX = USE_WIDESCREEN ? (offsetX - (30.f * WIDE_GET_16_9)) : offsetX; Matrix_SetTranslateScaleMtx2( matrix, 1.0f - (0.32f * beatingHeartPulsingSize), 1.0f - (0.32f * beatingHeartPulsingSize), - 1.0f - (0.32f * beatingHeartPulsingSize), -129.7f + wideOffsetX, 94.f - offsetY, 0.0f); - gSPMatrix(OVERLAY_DISP++, matrix, G_MTX_MODELVIEW | G_MTX_LOAD); + 1.0f - (0.32f * beatingHeartPulsingSize), -130.0f + wideOffsetX, 94.5f - offsetY, 0.0f); + gSPMatrix(OVERLAY_DISP++, matrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPVertex(OVERLAY_DISP++, beatingHeartVtx, 4, 0); gSP1Quadrangle(OVERLAY_DISP++, 0, 2, 3, 1, 0); } diff --git a/src/code/z_lights.c b/src/code/z_lights.c index aa6e8968e6..dc72ebb7b7 100644 --- a/src/code/z_lights.c +++ b/src/code/z_lights.c @@ -3,7 +3,7 @@ #define LIGHTS_BUFFER_SIZE 32 -typedef struct { +typedef struct LightsBuffer { /* 0x000 */ s32 numOccupied; /* 0x004 */ s32 searchIndex; /* 0x008 */ LightNode buf[LIGHTS_BUFFER_SIZE]; @@ -412,8 +412,7 @@ void Lights_DrawGlow(PlayState* play) { 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_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_lights.c", 918), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_lights.c", 918); gSPDisplayList(POLY_XLU_DISP++, gGlowCircleDL); } } diff --git a/src/code/z_malloc.c b/src/code/z_malloc.c index cc7310d8d0..4043620eeb 100644 --- a/src/code/z_malloc.c +++ b/src/code/z_malloc.c @@ -1,4 +1,5 @@ #include "global.h" +#include "libc64/os_malloc.h" #define LOG_SEVERITY_NOLOG 0 #define LOG_SEVERITY_ERROR 2 @@ -12,13 +13,11 @@ s32 gZeldaArenaLogSeverity = LOG_SEVERITY_ERROR; void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { if (ptr == NULL) { if (gZeldaArenaLogSeverity >= LOG_SEVERITY_ERROR) { - // "%s: %u bytes %s failed\n" - PRINTF("%s: %u バイトの%sに失敗しました\n", name, size, action); + PRINTF(T("%s: %u バイトの%sに失敗しました\n", "%s: %u bytes %s failed\n"), name, size, action); __osDisplayArena(&sZeldaArena); } } else if (gZeldaArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { - // "%s: %u bytes %s succeeded\n" - PRINTF("%s: %u バイトの%sに成功しました\n", name, size, action); + PRINTF(T("%s: %u バイトの%sに成功しました\n", "%s: %u bytes %s succeeded\n"), name, size, action); } } @@ -30,7 +29,8 @@ void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* void* ZeldaArena_Malloc(u32 size) { void* ptr = __osMalloc(&sZeldaArena, size); - ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc", "確保"); // "Secure" + // TODO re-evaluate "secure" as a translation (in this file and others using "確保") + ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc", T("確保", "Secure")); return ptr; } @@ -38,7 +38,7 @@ void* ZeldaArena_Malloc(u32 size) { void* ZeldaArena_MallocDebug(u32 size, const char* file, int line) { void* ptr = __osMallocDebug(&sZeldaArena, size, file, line); - ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_DEBUG", "確保"); // "Secure" + ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_DEBUG", T("確保", "Secure")); return ptr; } #endif @@ -46,7 +46,7 @@ void* ZeldaArena_MallocDebug(u32 size, const char* file, int line) { void* ZeldaArena_MallocR(u32 size) { void* ptr = __osMallocR(&sZeldaArena, size); - ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_r", "確保"); // "Secure" + ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_r", T("確保", "Secure")); return ptr; } @@ -54,21 +54,21 @@ void* ZeldaArena_MallocR(u32 size) { void* ZeldaArena_MallocRDebug(u32 size, const char* file, int line) { void* ptr = __osMallocRDebug(&sZeldaArena, size, file, line); - ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_r_DEBUG", "確保"); // "Secure" + ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_r_DEBUG", T("確保", "Secure")); return ptr; } #endif void* ZeldaArena_Realloc(void* ptr, u32 newSize) { ptr = __osRealloc(&sZeldaArena, ptr, newSize); - ZELDA_ARENA_CHECK_POINTER(ptr, newSize, "zelda_realloc", "再確保"); // "Re-securing" + ZELDA_ARENA_CHECK_POINTER(ptr, newSize, "zelda_realloc", T("再確保", "Re-securing")); return ptr; } #if IS_DEBUG void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) { ptr = __osReallocDebug(&sZeldaArena, ptr, newSize, file, line); - ZELDA_ARENA_CHECK_POINTER(ptr, newSize, "zelda_realloc_DEBUG", "再確保"); // "Re-securing" + ZELDA_ARENA_CHECK_POINTER(ptr, newSize, "zelda_realloc_DEBUG", T("再確保", "Re-securing")); return ptr; } #endif @@ -92,13 +92,13 @@ void* ZeldaArena_Calloc(u32 num, u32 size) { bzero(ret, n); } - ZELDA_ARENA_CHECK_POINTER(ret, n, "zelda_calloc", "確保"); // "Secure" + ZELDA_ARENA_CHECK_POINTER(ret, n, "zelda_calloc", T("確保", "Secure")); return ret; } #if IS_DEBUG void ZeldaArena_Display(void) { - PRINTF("ゼルダヒープ表示\n"); // "Zelda heap display" + PRINTF(T("ゼルダヒープ表示\n", "Zelda heap display\n")); __osDisplayArena(&sZeldaArena); } #endif @@ -125,6 +125,6 @@ void ZeldaArena_Cleanup(void) { __osMallocCleanup(&sZeldaArena); } -u8 ZeldaArena_IsInitialized(void) { +s32 ZeldaArena_IsInitialized(void) { return __osMallocIsInitialized(&sZeldaArena); } diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index c08dd6eb50..c8a89c66f6 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -2,6 +2,9 @@ #include "terminal.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/textures/parameter_static/parameter_static.h" +#if PLATFORM_N64 +#include "n64dd.h" +#endif MapData* gMapData; @@ -28,9 +31,10 @@ void Map_SetPaletteData(PlayState* play, s16 room) { } PRINTF(VT_FGCOL(YELLOW)); - // "PALETE Set" - PRINTF("PALETEセット 【 i=%x : room=%x 】Room_Inf[%d][4]=%x ( map_palete_no = %d )\n", paletteIndex, room, - mapIndex, gSaveContext.save.info.sceneFlags[mapIndex].rooms, interfaceCtx->mapPaletteIndex); + PRINTF(T("PALETEセット 【 i=%x : room=%x 】Room_Inf[%d][4]=%x ( map_palete_no = %d )\n", + "PALETE Set 【 i=%x : room=%x 】Room_Inf[%d][4]=%x ( map_palete_no = %d )\n"), + paletteIndex, room, mapIndex, gSaveContext.save.info.sceneFlags[mapIndex].rooms, + interfaceCtx->mapPaletteIndex); PRINTF(VT_RST); interfaceCtx->mapPalette[paletteIndex * 2] = 2; @@ -155,19 +159,30 @@ void Map_InitData(PlayState* play, s16 room) { case SCENE_SPIRIT_TEMPLE_BOSS: case SCENE_SHADOW_TEMPLE_BOSS: PRINTF(VT_FGCOL(YELLOW)); - // "Deku Tree Dungeon MAP Texture DMA" - PRINTF("デクの樹ダンジョンMAP テクスチャDMA(%x) scene_id_offset=%d VREG(30)=%d\n", room, mapIndex, - VREG(30)); + PRINTF(T("デクの樹ダンジョンMAP テクスチャDMA(%x) scene_id_offset=%d VREG(30)=%d\n", + "Deku Tree Dungeon MAP Texture DMA(%x) scene_id_offset=%d VREG(30)=%d\n"), + room, mapIndex, VREG(30)); PRINTF(VT_RST); + +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_28 != NULL) && B_80121220->unk_28(play)) { + } else { + DmaMgr_RequestSync(play->interfaceCtx.mapSegment, + (uintptr_t)_map_i_staticSegmentRomStart + + ((gMapData->dgnMinimapTexIndexOffset[mapIndex] + room) * MAP_I_TEX_SIZE), + MAP_I_TEX_SIZE); + } +#else DMA_REQUEST_SYNC(play->interfaceCtx.mapSegment, (uintptr_t)_map_i_staticSegmentRomStart + ((gMapData->dgnMinimapTexIndexOffset[mapIndex] + room) * MAP_I_TEX_SIZE), MAP_I_TEX_SIZE, "../z_map_exp.c", 346); +#endif R_COMPASS_OFFSET_X = WIDE_MULT(WIDE_MULT(gMapData->roomCompassOffsetX[mapIndex][room], WIDE_GET_16_9), WIDE_GET_RATIO); R_COMPASS_OFFSET_Y = gMapData->roomCompassOffsetY[mapIndex][room]; Map_SetFloorPalettesData(play, VREG(30)); - PRINTF("MAP 各階ONチェック\n"); // "MAP Individual Floor ON Check" + PRINTF(T("MAP 各階ONチェック\n", "MAP Individual Floor ON Check\n")); break; } } @@ -205,7 +220,7 @@ void Map_InitRoomData(PlayState* play, s16 room) { interfaceCtx->unk_25A = mapIndex; Map_SetPaletteData(play, room); PRINTF(VT_FGCOL(YELLOW)); - PRINTF("部屋部屋=%d\n", room); // "Room Room = %d" + PRINTF(T("部屋部屋=%d\n", "Room Room = %d\n"), room); PRINTF(VT_RST); Map_InitData(play, room); break; @@ -221,6 +236,16 @@ void Map_InitRoomData(PlayState* play, s16 room) { void Map_Destroy(PlayState* play) { MapMark_ClearPointers(play); + +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_24 != NULL)) { + B_80121220->unk_24(); + } + if ((B_80121220 != NULL) && (B_80121220->unk_1C != NULL)) { + B_80121220->unk_1C(&gMapData); + } +#endif + gMapData = NULL; } @@ -230,13 +255,19 @@ void Map_Init(PlayState* play) { gMapData = &gMapDataTable; +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_18 != NULL)) { + B_80121220->unk_18(&gMapData); + } +#endif + interfaceCtx->unk_258 = -1; interfaceCtx->unk_25A = -1; interfaceCtx->mapSegment = GAME_STATE_ALLOC(&play->state, 0x1000, "../z_map_exp.c", 457); - // "MAP texture initialization scene_data_ID=%d mapSegment=%x" - PRINTF("\n\n\nMAP テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", play->sceneId, - interfaceCtx->mapSegment, play); + PRINTF(T("\n\n\nMAP テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", + "\n\n\nMAP texture initialization scene_data_ID=%d\nmapSegment=%x\n\n"), + play->sceneId, interfaceCtx->mapSegment); ASSERT(interfaceCtx->mapSegment != NULL, "parameter->mapSegment != NULL", "../z_map_exp.c", 459); switch (play->sceneId) { @@ -303,6 +334,11 @@ void Map_Init(PlayState* play) { R_COMPASS_OFFSET_X = gMapData->dgnCompassInfo[mapIndex][2]; R_COMPASS_OFFSET_Y = gMapData->dgnCompassInfo[mapIndex][3]; R_MAP_TEX_INDEX = R_MAP_TEX_INDEX_BASE = gMapData->dgnTexIndexBase[mapIndex]; +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_20 != NULL)) { + B_80121220->unk_20(gMapData); + } +#endif Map_InitRoomData(play, play->roomCtx.curRoom.num); MapMark_Init(play); } @@ -335,8 +371,7 @@ void Minimap_DrawCompassIcons(PlayState* play) { Matrix_RotateX(-1.6f, MTXMODE_APPLY); tempX = (0x7FFF - player->actor.shape.rot.y) / 0x400; Matrix_RotateY(tempX / 10.0f, MTXMODE_APPLY); - gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_map_exp.c", 585), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(OVERLAY_DISP++, play->state.gfxCtx, "../z_map_exp.c", 585); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 255, 0, 255); gSPDisplayList(OVERLAY_DISP++, gCompassArrowDL); @@ -349,8 +384,7 @@ void Minimap_DrawCompassIcons(PlayState* play) { 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_RotateY(sPlayerInitialDirection / 10.0f, MTXMODE_APPLY); - gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_map_exp.c", 603), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(OVERLAY_DISP++, play->state.gfxCtx, "../z_map_exp.c", 603); gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, 200, 0, 0, 255); gSPDisplayList(OVERLAY_DISP++, gCompassArrowDL); @@ -561,9 +595,9 @@ void Map_Update(PlayState* play) { } if (interfaceCtx->mapRoomNum != sLastRoomNum) { - // "Current floor = %d Current room = %x Number of rooms = %d" - PRINTF("現在階=%d 現在部屋=%x 部屋数=%d\n", floor, interfaceCtx->mapRoomNum, - gMapData->switchEntryCount[mapIndex]); + PRINTF(T("現在階=%d 現在部屋=%x 部屋数=%d\n", + "Current floor = %d Current room = %x Number of rooms = %d\n"), + floor, interfaceCtx->mapRoomNum, gMapData->switchEntryCount[mapIndex]); sLastRoomNum = interfaceCtx->mapRoomNum; } @@ -572,8 +606,7 @@ void Map_Update(PlayState* play) { (floor == gMapData->switchFromFloor[mapIndex][i])) { interfaceCtx->mapRoomNum = gMapData->switchToRoom[mapIndex][i]; PRINTF(VT_FGCOL(YELLOW)); - // "Layer switching = %x" - PRINTF("階層切替=%x\n", interfaceCtx->mapRoomNum); + PRINTF(T("階層切替=%x\n", "Layer switching = %x\n"), interfaceCtx->mapRoomNum); PRINTF(VT_RST); Map_InitData(play, interfaceCtx->mapRoomNum); gSaveContext.sunsSongState = SUNSSONG_INACTIVE; diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c index 633a90100f..43485198e4 100644 --- a/src/code/z_map_mark.c +++ b/src/code/z_map_mark.c @@ -1,8 +1,11 @@ #include "global.h" #include "terminal.h" #include "assets/textures/parameter_static/parameter_static.h" +#if PLATFORM_N64 +#include "n64dd.h" +#endif -typedef struct { +typedef struct MapMarkInfo { /* 0x00 */ void* texture; /* 0x04 */ u32 imageFormat; /* 0x08 */ u32 imageSize; @@ -14,7 +17,7 @@ typedef struct { /* 0x20 */ u32 dtdy; } MapMarkInfo; // size = 0x24 -typedef struct { +typedef struct MapMarkDataOverlay { /* 0x00 */ void* loadedRamAddr; // original name: "allocp" /* 0x04 */ RomFile file; /* 0x0C */ void* vramStart; @@ -52,9 +55,21 @@ void MapMark_Init(PlayState* play) { ? (void*)((uintptr_t)overlay->vramTable - (intptr_t)((uintptr_t)overlay->vramStart - (uintptr_t)overlay->loadedRamAddr)) : NULL); + +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_2C != NULL)) { + B_80121220->unk_2C(&sLoadedMarkDataTable); + } +#endif } void MapMark_ClearPointers(PlayState* play) { +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_30 != NULL)) { + B_80121220->unk_30(&sLoadedMarkDataTable); + } +#endif + sMapMarkDataOvl.loadedRamAddr = NULL; sLoadedMarkDataTable = NULL; } @@ -72,8 +87,8 @@ void MapMark_DrawForDungeon(PlayState* play) { interfaceCtx = &play->interfaceCtx; if ((gMapData != NULL) && (play->interfaceCtx.mapRoomNum >= gMapData->dgnMinimapCount[dungeon])) { - // "Room number exceeded, yikes %d/%d MapMarkDraw processing interrupted" - PRINTF(VT_COL(RED, WHITE) "部屋番号がオーバーしてるで,ヤバイで %d/%d \nMapMarkDraw の処理を中断します\n", + PRINTF(VT_COL(RED, WHITE) T("部屋番号がオーバーしてるで,ヤバイで %d/%d \nMapMarkDraw の処理を中断します\n", + "Room number exceeded, yikes %d/%d \nMapMarkDraw processing interrupted\n"), VT_RST, play->interfaceCtx.mapRoomNum, gMapData->dgnMinimapCount[dungeon]); return; } diff --git a/src/code/z_message.c b/src/code/z_message.c index d6b94aebe4..aab75a8ce2 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -1,7 +1,97 @@ #include "global.h" #include "message_data_static.h" #include "terminal.h" +#include "versions.h" #include "assets/textures/parameter_static/parameter_static.h" +#if PLATFORM_N64 +#include "n64dd.h" +#endif + +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:112 pal-1.0:128 pal-1.1:128" + +#if N64_BTN_COLORS +#define OCARINA_BUTTON_A_PRIM_1_R 80 +#define OCARINA_BUTTON_A_PRIM_1_G 150 +#define OCARINA_BUTTON_A_PRIM_1_B 255 +#else +#define OCARINA_BUTTON_A_PRIM_1_R 80 +#define OCARINA_BUTTON_A_PRIM_1_G 255 +#define OCARINA_BUTTON_A_PRIM_1_B 150 +#endif + +#if N64_BTN_COLORS +#define OCARINA_BUTTON_A_PRIM_2_R 100 +#define OCARINA_BUTTON_A_PRIM_2_G 200 +#define OCARINA_BUTTON_A_PRIM_2_B 255 +#else +#define OCARINA_BUTTON_A_PRIM_2_R 100 +#define OCARINA_BUTTON_A_PRIM_2_G 255 +#define OCARINA_BUTTON_A_PRIM_2_B 200 +#endif + +#if N64_BTN_COLORS +#define OCARINA_BUTTON_A_ENV_1_R 10 +#define OCARINA_BUTTON_A_ENV_1_G 10 +#define OCARINA_BUTTON_A_ENV_1_B 10 +#else +#define OCARINA_BUTTON_A_ENV_1_R 10 +#define OCARINA_BUTTON_A_ENV_1_G 10 +#define OCARINA_BUTTON_A_ENV_1_B 10 +#endif + +#if N64_BTN_COLORS +#define OCARINA_BUTTON_A_ENV_2_R 50 +#define OCARINA_BUTTON_A_ENV_2_G 50 +#define OCARINA_BUTTON_A_ENV_2_B 255 +#else +#define OCARINA_BUTTON_A_ENV_2_R 50 +#define OCARINA_BUTTON_A_ENV_2_G 255 +#define OCARINA_BUTTON_A_ENV_2_B 50 +#endif + +#if N64_BTN_COLORS +#define OCARINA_ICON_PRIM_1_R 0 +#define OCARINA_ICON_PRIM_1_G 80 +#define OCARINA_ICON_PRIM_1_B 200 +#else +#define OCARINA_ICON_PRIM_1_R 0 +#define OCARINA_ICON_PRIM_1_G 200 +#define OCARINA_ICON_PRIM_1_B 80 +#endif + +#if N64_BTN_COLORS +#define OCARINA_ICON_PRIM_2_R 50 +#define OCARINA_ICON_PRIM_2_G 130 +#define OCARINA_ICON_PRIM_2_B 255 +#else +#define OCARINA_ICON_PRIM_2_R 50 +#define OCARINA_ICON_PRIM_2_G 255 +#define OCARINA_ICON_PRIM_2_B 130 +#endif + +#if N64_BTN_COLORS +#define OCARINA_ICON_ENV_1_R 0 +#define OCARINA_ICON_ENV_1_G 0 +#define OCARINA_ICON_ENV_1_B 0 +#else +#define OCARINA_ICON_ENV_1_R 0 +#define OCARINA_ICON_ENV_1_G 0 +#define OCARINA_ICON_ENV_1_B 0 +#endif + +#if N64_BTN_COLORS +#define OCARINA_ICON_ENV_2_R 0 +#define OCARINA_ICON_ENV_2_G 130 +#define OCARINA_ICON_ENV_2_B 255 +#else +#define OCARINA_ICON_ENV_2_R 0 +#define OCARINA_ICON_ENV_2_G 255 +#define OCARINA_ICON_ENV_2_B 130 +#endif + +s32 sCharTexSize; +s32 sCharTexScale; s16 sTextFade = false; // original name: key_off_flag ? @@ -17,7 +107,9 @@ u16 sNextTextId = 0; s16 sTextIsCredits = false; +#if PLATFORM_GC && OOT_PAL UNK_TYPE D_8014B30C = 0; +#endif s16 sLastPlayedSong = 0xFF; @@ -161,8 +253,6 @@ s16 gOcarinaSongItemMap[] = { OCARINA_SONG_SARIAS, OCARINA_SONG_SUNS, OCARINA_SONG_TIME, OCARINA_SONG_STORMS, }; -s32 sCharTexSize; -s32 sCharTexScale; s16 sOcarinaButtonAPrimR; s16 sOcarinaButtonAPrimB; s16 sOcarinaButtonAPrimG; @@ -186,17 +276,9 @@ void Message_ResetOcarinaNoteState(void) { sOcarinaButtonAlphaValues[0] = sOcarinaButtonAlphaValues[1] = sOcarinaButtonAlphaValues[2] = sOcarinaButtonAlphaValues[3] = sOcarinaButtonAlphaValues[4] = sOcarinaButtonAlphaValues[5] = sOcarinaButtonAlphaValues[6] = sOcarinaButtonAlphaValues[7] = sOcarinaButtonAlphaValues[8] = 0; - - if (N64_BTN_COLORS) { - sOcarinaButtonAPrimR = 80; - sOcarinaButtonAPrimG = 150; - sOcarinaButtonAPrimB = 255; - } else { - sOcarinaButtonAPrimR = 80; - sOcarinaButtonAPrimG = 255; - sOcarinaButtonAPrimB = 150; - } - + sOcarinaButtonAPrimR = OCARINA_BUTTON_A_PRIM_1_R; + sOcarinaButtonAPrimG = OCARINA_BUTTON_A_PRIM_1_G; + sOcarinaButtonAPrimB = OCARINA_BUTTON_A_PRIM_1_B; sOcarinaButtonAEnvR = 10; sOcarinaButtonAEnvG = 10; sOcarinaButtonAEnvB = 10; @@ -300,6 +382,7 @@ void Message_DrawTextChar(PlayState* play, void* textureImage, Gfx** p) { Gfx* gfx = *p; s16 x = msgCtx->textPosX; s16 y = msgCtx->textPosY; + s32 pad; gDPPipeSync(gfx++); @@ -365,9 +448,75 @@ void Message_GrowTextbox(MessageContext* msgCtx) { R_TEXTBOX_X = (R_TEXTBOX_X_TARGET + R_TEXTBOX_WIDTH_TARGET) - (R_TEXTBOX_WIDTH / 2); } -#if OOT_PAL // TODO: implement NTSC version +#if OOT_NTSC + +void Message_FindMessageJPN(PlayState* play, u16 textId) { + const char* foundSeg; + const char* nextSeg; + const char* seg; + Font* font = &play->msgCtx.font; + MessageTableEntry* messageTableEntry = sJpnMessageEntryTablePtr; + + seg = messageTableEntry->segment; + + while (messageTableEntry->textId != 0xFFFF) { + if (messageTableEntry->textId == textId) { + foundSeg = messageTableEntry->segment; + font->charTexBuf[0] = messageTableEntry->typePos; + messageTableEntry++; + nextSeg = messageTableEntry->segment; + font->msgOffset = foundSeg - seg; + font->msgLength = nextSeg - foundSeg; + return; + } + messageTableEntry++; + } + + messageTableEntry = sJpnMessageEntryTablePtr; + + foundSeg = messageTableEntry->segment; + font->charTexBuf[0] = messageTableEntry->typePos; + messageTableEntry++; + nextSeg = messageTableEntry->segment; + + font->msgOffset = foundSeg - seg; + font->msgLength = nextSeg - foundSeg; +} + +void Message_FindMessageNES(PlayState* play, u16 textId) { + const char* foundSeg; + const char* nextSeg; + const char* seg; + Font* font = &play->msgCtx.font; + MessageTableEntry* messageTableEntry = sNesMessageEntryTablePtr; + + seg = messageTableEntry->segment; + while (messageTableEntry->textId != 0xFFFF) { + if (messageTableEntry->textId == textId) { + foundSeg = messageTableEntry->segment; + font->charTexBuf[0] = messageTableEntry->typePos; + messageTableEntry++; + nextSeg = messageTableEntry->segment; + font->msgOffset = foundSeg - seg; + font->msgLength = nextSeg - foundSeg; + return; + } + messageTableEntry++; + } + + messageTableEntry = sNesMessageEntryTablePtr; + + foundSeg = messageTableEntry->segment; + font->charTexBuf[0] = messageTableEntry->typePos; + messageTableEntry++; + nextSeg = messageTableEntry->segment; + font->msgOffset = foundSeg - seg; + font->msgLength = nextSeg - foundSeg; +} + +#else -void Message_FindMessage(PlayState* play, u16 textId) { +void Message_FindMessagePAL(PlayState* play, u16 textId) { const char* foundSeg; const char* nextSeg; Font* font = &play->msgCtx.font; @@ -386,9 +535,8 @@ void Message_FindMessage(PlayState* play, u16 textId) { nextSeg = messageTableEntry->segment; font->msgOffset = foundSeg - seg; font->msgLength = nextSeg - foundSeg; - // "Message found!!!" - PRINTF(" メッセージが,見つかった!!! = %x " - "(data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n", + PRINTF(T(" メッセージが,見つかった!!! = %x (data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n", + "Message found!!! = %x (data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n"), textId, font->msgOffset, font->msgLength, foundSeg, seg, nextSeg); return; } @@ -407,9 +555,8 @@ void Message_FindMessage(PlayState* play, u16 textId) { nextSeg = *languageSegmentTable; font->msgOffset = foundSeg - seg; font->msgLength = nextSeg - foundSeg; - // "Message found!!!" - PRINTF(" メッセージが,見つかった!!! = %x " - "(data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n", + PRINTF(T(" メッセージが,見つかった!!! = %x (data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n", + "Message found!!! = %x (data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n"), textId, font->msgOffset, font->msgLength, foundSeg, seg, nextSeg); return; } @@ -417,8 +564,7 @@ void Message_FindMessage(PlayState* play, u16 textId) { languageSegmentTable++; } } - // "Message not found!!!" - PRINTF(" メッセージが,見つからなかった!!! = %x\n", textId); + PRINTF(T(" メッセージが,見つからなかった!!! = %x\n", "Message not found!!! = %x\n"), textId); messageTableEntry = sNesMessageEntryTablePtr; if (gSaveContext.language == LANGUAGE_ENG) { @@ -456,8 +602,8 @@ void Message_FindCreditsMessage(PlayState* play, u16 textId) { nextSeg = messageTableEntry->segment; font->msgOffset = foundSeg - seg; font->msgLength = nextSeg - foundSeg; - // "Message found!!!" - PRINTF(" メッセージが,見つかった!!! = %x (data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n", + PRINTF(T(" メッセージが,見つかった!!! = %x (data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n", + "Message found!!! = %x (data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n"), textId, font->msgOffset, font->msgLength, foundSeg, seg, nextSeg); return; } @@ -552,28 +698,17 @@ void Message_SetTextColor(MessageContext* msgCtx, u16 colorParameter) { } void Message_DrawTextboxIcon(PlayState* play, Gfx** p, s16 x, s16 y) { -#if N64_BTN_COLORS static s16 sIconPrimColors[][3] = { - { 0, 80, 200 }, - { 50, 130, 255 }, + { OCARINA_ICON_PRIM_1_R, OCARINA_ICON_PRIM_1_G, OCARINA_ICON_PRIM_1_B }, + { OCARINA_ICON_PRIM_2_R, OCARINA_ICON_PRIM_2_G, OCARINA_ICON_PRIM_2_B }, }; static s16 sIconEnvColors[][3] = { - { 0, 0, 0 }, - { 0, 130, 255 }, - }; -#else - static s16 sIconPrimColors[][3] = { - { 0, 200, 80 }, - { 50, 255, 130 }, + { OCARINA_ICON_ENV_1_R, OCARINA_ICON_ENV_1_G, OCARINA_ICON_ENV_1_B }, + { OCARINA_ICON_ENV_2_R, OCARINA_ICON_ENV_2_G, OCARINA_ICON_ENV_2_B }, }; - static s16 sIconEnvColors[][3] = { - { 0, 0, 0 }, - { 0, 255, 130 }, - }; -#endif - static s16 sIconPrimR = 0; - static s16 sIconPrimG = 200; - static s16 sIconPrimB = 80; + static s16 sIconPrimR = OCARINA_ICON_PRIM_1_R; + static s16 sIconPrimG = OCARINA_ICON_PRIM_1_G; + static s16 sIconPrimB = OCARINA_ICON_PRIM_1_B; static s16 sIconFlashTimer = 12; static s16 sIconFlashColorIdx = 0; static s16 sIconEnvR = 0; @@ -774,7 +909,11 @@ f32 sFontWidths[144] = { 10.0f, // '~' 10.0f, // '‾' 12.0f, // 'À' - 6.0f, // 'î' +#if OOT_NTSC + 12.0f, // 'î' +#else + 6.0f, // 'î' +#endif 12.0f, // 'Â' 12.0f, // 'Ä' 11.0f, // 'Ç' @@ -874,11 +1013,11 @@ void Message_HandleOcarina(PlayState* play) { if (msgCtx->ocarinaAction == OCARINA_ACTION_SCARECROW_LONG_RECORDING) { msgCtx->msgMode = MSGMODE_SCARECROW_LONG_RECORDING_START; - // "Recording Start / Recording Start / Recording Start / Recording Start -> " - PRINTF("録音開始 録音開始 録音開始 録音開始 -> "); + PRINTF(T("録音開始 録音開始 録音開始 録音開始 -> ", + "Recording Start Recording Start Recording Start Recording Start -> ")); } else if (msgCtx->ocarinaAction == OCARINA_ACTION_SCARECROW_LONG_PLAYBACK) { - // "Recording Playback / Recording Playback / Recording Playback / Recording Playback -> " - PRINTF("録音再生 録音再生 録音再生 録音再生 -> "); + PRINTF(T("録音再生 録音再生 録音再生 録音再生 -> ", + "Recording Playback Recording Playback Recording Playback Recording Playback -> ")); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); msgCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); @@ -890,11 +1029,10 @@ void Message_HandleOcarina(PlayState* play) { AudioOcarina_SetPlaybackSong(OCARINA_SONG_SCARECROW_LONG + 1, 1); } else if (msgCtx->ocarinaAction == OCARINA_ACTION_SCARECROW_SPAWN_RECORDING) { msgCtx->msgMode = MSGMODE_SCARECROW_SPAWN_RECORDING_START; - // "8 Note Recording Start / 8 Note Recording Start / 8 Note Recording Start -> " - PRINTF("8音録音開始 8音録音開始 8音録音開始 -> "); + PRINTF(T("8音録音開始 8音録音開始 8音録音開始 -> ", + "8 Note Recording Start 8 Note Recording Start 8 Note Recording Start -> ")); } else if (msgCtx->ocarinaAction == OCARINA_ACTION_SCARECROW_SPAWN_PLAYBACK) { - // "8 Note Playback / 8 Note Playback / 8 Note Playback -> " - PRINTF("8音再生 8音再生 8音再生 -> "); + PRINTF(T("8音再生 8音再生 8音再生 -> ", "8 Note Playback 8 Note Playback 8 Note Playback -> ")); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); msgCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); @@ -906,15 +1044,13 @@ void Message_HandleOcarina(PlayState* play) { AudioOcarina_SetPlaybackSong(OCARINA_SONG_SCARECROW_SPAWN + 1, 1); } else if (msgCtx->ocarinaAction == OCARINA_ACTION_MEMORY_GAME) { msgCtx->msgMode = MSGMODE_MEMORY_GAME_START; - // "Musical Round Start / Musical Round Start / Musical Round Start / Musical Round Start -> " - PRINTF("輪唱開始 輪唱開始 輪唱開始 輪唱開始 -> "); + PRINTF(T("輪唱開始 輪唱開始 輪唱開始 輪唱開始 -> ", + "Musical Round Start Musical Round Start Musical Round Start Musical Round Start -> ")); } else if (msgCtx->ocarinaAction == OCARINA_ACTION_FROGS) { msgCtx->msgMode = MSGMODE_FROGS_START; - // "Frog Chorus / Frog Chorus -> " - PRINTF("カエルの合唱 カエルの合唱 -> "); + PRINTF(T("カエルの合唱 カエルの合唱 -> ", "Frog Chorus Frog Chorus -> ")); } else { - // "Ocarina(%d)" - PRINTF("オカリナ(%d) ", msgCtx->ocarinaAction); + PRINTF(T("オカリナ(%d) ", "Ocarina (%d)"), msgCtx->ocarinaAction); if (msgCtx->ocarinaAction == OCARINA_ACTION_UNK_0 || msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY || msgCtx->ocarinaAction >= OCARINA_ACTION_CHECK_SARIA) { msgCtx->msgMode = MSGMODE_OCARINA_STARTING; @@ -932,8 +1068,332 @@ void Message_HandleOcarina(PlayState* play) { } } +#if OOT_NTSC /** - * Draws the text contents of a textbox, up to the current point that has + * Draws the text contents of a jpn textbox, up to the current point that has + * been scrolled to so far. + */ +void Message_DrawTextWide(PlayState* play, Gfx** gfxP) { + MessageContext* msgCtx = &play->msgCtx; + Font* font = &play->msgCtx.font; + u16 character; + u16 j; + u16 i; + u16 charTexIdx; + Gfx* gfx = *gfxP; + + play->msgCtx.textPosX = R_TEXT_INIT_XPOS; + play->msgCtx.textPosY = R_TEXT_INIT_YPOS; + + if (msgCtx->textBoxType == TEXTBOX_TYPE_NONE_NO_SHADOW) { + msgCtx->textColorR = msgCtx->textColorG = msgCtx->textColorB = 0; + } else { + msgCtx->textColorR = msgCtx->textColorG = msgCtx->textColorB = 255; + } + + msgCtx->unk_E3D0 = 0; + charTexIdx = 0; + + for (i = 0; i < msgCtx->textDrawPos; i++) { + character = msgCtx->msgBufDecodedWide[i]; + + switch (character) { + case MESSAGE_WIDE_NEWLINE: + msgCtx->textPosY += R_TEXT_LINE_SPACING; + msgCtx->textPosX = R_TEXT_INIT_XPOS; + if (msgCtx->choiceNum == 1) { + msgCtx->textPosX += 32; + } + if (msgCtx->choiceNum == 2) { + msgCtx->textPosX += 32; + } + break; + case MESSAGE_WIDE_COLOR: + Message_SetTextColor(msgCtx, msgCtx->msgBufDecodedWide[++i]); + break; + case MESSAGE_WIDE_CHAR_SPACE: + msgCtx->textPosX += MESSAGE_SPACE_WIDTH; + break; + case MESSAGE_WIDE_BOX_BREAK: + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { + if (!sTextboxSkipped) { + Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + msgCtx->msgMode = MSGMODE_TEXT_AWAIT_NEXT; + Font_LoadMessageBoxIcon(&play->msgCtx.font, TEXTBOX_ICON_TRIANGLE); + } else { + msgCtx->msgMode = MSGMODE_TEXT_NEXT_MSG; + msgCtx->textUnskippable = false; + msgCtx->msgBufPos++; + } + } + *gfxP = gfx; + return; + case MESSAGE_WIDE_SHIFT: + msgCtx->textPosX += msgCtx->msgBufDecodedWide[++i]; + break; + case MESSAGE_WIDE_TEXTID: + msgCtx->textboxEndType = TEXTBOX_ENDTYPE_HAS_NEXT; + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { + Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + msgCtx->msgMode = MSGMODE_TEXT_DONE; + Font_LoadMessageBoxIcon(&play->msgCtx.font, TEXTBOX_ICON_TRIANGLE); + } + *gfxP = gfx; + return; + case MESSAGE_WIDE_QUICKTEXT_ENABLE: + if (i + 1 == msgCtx->textDrawPos && (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING || + (msgCtx->msgMode >= MSGMODE_OCARINA_STARTING && + msgCtx->msgMode < MSGMODE_SCARECROW_LONG_RECORDING_START))) { + j = i; + while (true) { + character = msgCtx->msgBufDecodedWide[j]; + if ((character != MESSAGE_WIDE_QUICKTEXT_DISABLE) && (character != MESSAGE_WIDE_PERSISTENT) && + (character != MESSAGE_WIDE_EVENT) && (character != MESSAGE_WIDE_BOX_BREAK_DELAYED) && + (character != MESSAGE_WIDE_AWAIT_BUTTON_PRESS) && (character != MESSAGE_WIDE_BOX_BREAK) && + (character != MESSAGE_WIDE_END)) { + j++; + } else { + break; + } + } + i = j - 1; + msgCtx->textDrawPos = i + 1; + } + FALLTHROUGH; + case MESSAGE_WIDE_QUICKTEXT_DISABLE: + break; + case MESSAGE_WIDE_AWAIT_BUTTON_PRESS: + if (i + 1 == msgCtx->textDrawPos) { + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { + msgCtx->msgMode = MSGMODE_TEXT_AWAIT_INPUT; + Font_LoadMessageBoxIcon(&play->msgCtx.font, TEXTBOX_ICON_TRIANGLE); + } + *gfxP = gfx; + return; + } + break; + case MESSAGE_WIDE_BOX_BREAK_DELAYED: + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { + msgCtx->stateTimer = msgCtx->msgBufDecodedWide[++i]; + msgCtx->msgMode = MSGMODE_TEXT_DELAYED_BREAK; + } + *gfxP = gfx; + return; + case MESSAGE_WIDE_FADE2: + break; + case MESSAGE_WIDE_SFX: + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING && !sMessageHasSetSfx) { + sMessageHasSetSfx = true; + Audio_PlaySfxGeneral(msgCtx->msgBufDecodedWide[i + 1], &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } + i++; + break; + case MESSAGE_WIDE_ITEM_ICON: + i = Message_DrawItemIcon(play, msgCtx->msgBufDecodedWide[i + 1], &gfx, i); + break; + case MESSAGE_WIDE_BACKGROUND: + // clang-format off + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { \ + Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } + // clang-format on + gDPPipeSync(gfx++); + gDPSetCombineMode(gfx++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + gDPSetPrimColor(gfx++, 0, 0, sTextboxBackgroundBackPrimColors[msgCtx->textboxBackgroundBackColorIdx][0], + sTextboxBackgroundBackPrimColors[msgCtx->textboxBackgroundBackColorIdx][1], + sTextboxBackgroundBackPrimColors[msgCtx->textboxBackgroundBackColorIdx][2], + msgCtx->textColorAlpha); + + gDPLoadTextureBlock_4b(gfx++, msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, G_IM_FMT_I, 96, 48, 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); + gSPTextureRectangle( + gfx++, (msgCtx->textPosX + 1) << 2, + (R_TEXTBOX_BG_YPOS + sTextboxBackgroundYOffsets[msgCtx->textboxBackgroundYOffsetIdx]) << 2, + (msgCtx->textPosX + 96 + 1) << 2, + (R_TEXTBOX_BG_YPOS + sTextboxBackgroundYOffsets[msgCtx->textboxBackgroundYOffsetIdx] + 48) << 2, + G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + + gDPLoadTextureBlock_4b(gfx++, msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE + 0x900, G_IM_FMT_I, 96, + 48, 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); + gSPTextureRectangle( + gfx++, (msgCtx->textPosX + 96 + 1) << 2, + (R_TEXTBOX_BG_YPOS + sTextboxBackgroundYOffsets[msgCtx->textboxBackgroundYOffsetIdx]) << 2, + (msgCtx->textPosX + 96 + 1 + 96 + 1) << 2, + (R_TEXTBOX_BG_YPOS + sTextboxBackgroundYOffsets[msgCtx->textboxBackgroundYOffsetIdx] + 48) << 2, + G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + + gDPPipeSync(gfx++); + gDPSetPrimColor(gfx++, 0, 0, sTextboxBackgroundForePrimColors[msgCtx->textboxBackgroundForeColorIdx][0], + sTextboxBackgroundForePrimColors[msgCtx->textboxBackgroundForeColorIdx][1], + sTextboxBackgroundForePrimColors[msgCtx->textboxBackgroundForeColorIdx][2], + msgCtx->textColorAlpha); + + gDPLoadTextureBlock_4b(gfx++, (msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE), G_IM_FMT_I, 96, 48, 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); + gSPTextureRectangle(gfx++, msgCtx->textPosX << 2, R_TEXTBOX_BG_YPOS << 2, (msgCtx->textPosX + 96) << 2, + (R_TEXTBOX_BG_YPOS + 48) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + + gDPLoadTextureBlock_4b(gfx++, (msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE + 0x900), G_IM_FMT_I, + 96, 48, 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); + gSPTextureRectangle(gfx++, (msgCtx->textPosX + 96) << 2, R_TEXTBOX_BG_YPOS << 2, + (msgCtx->textPosX + 192) << 2, (R_TEXTBOX_BG_YPOS + 48) << 2, G_TX_RENDERTILE, 0, 0, + 1 << 10, 1 << 10); + + gDPPipeSync(gfx++); + gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, + PRIMITIVE, 0); + + msgCtx->textPosX += 32; + break; + case MESSAGE_WIDE_TEXT_SPEED: + msgCtx->textDelay = msgCtx->msgBufDecodedWide[++i]; + break; + case MESSAGE_WIDE_UNSKIPPABLE: + msgCtx->textUnskippable = true; + break; + case MESSAGE_WIDE_TWO_CHOICE: + msgCtx->textboxEndType = TEXTBOX_ENDTYPE_2_CHOICE; + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { + msgCtx->choiceTextId = msgCtx->textId; + msgCtx->stateTimer = 4; + msgCtx->choiceIndex = 0; + Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_ARROW); + } + break; + case MESSAGE_WIDE_THREE_CHOICE: + msgCtx->textboxEndType = TEXTBOX_ENDTYPE_3_CHOICE; + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { + msgCtx->choiceTextId = msgCtx->textId; + msgCtx->stateTimer = 4; + msgCtx->choiceIndex = 0; + Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_ARROW); + } + break; + case MESSAGE_WIDE_END: + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { + msgCtx->msgMode = MSGMODE_TEXT_DONE; + if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_DEFAULT) { + Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_SQUARE); + if (play->csCtx.state == CS_STATE_IDLE) { + Interface_SetDoAction(play, DO_ACTION_RETURN); + } + } + } + *gfxP = gfx; + return; + case MESSAGE_WIDE_OCARINA: + if (i + 1 == msgCtx->textDrawPos) { + Message_HandleOcarina(play); + *gfxP = gfx; + return; + } + break; + case MESSAGE_WIDE_FADE: + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { + msgCtx->msgMode = MSGMODE_TEXT_DONE; + msgCtx->textboxEndType = TEXTBOX_ENDTYPE_FADING; + msgCtx->stateTimer = msgCtx->msgBufDecodedWide[++i]; + Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_SQUARE); + if (play->csCtx.state == CS_STATE_IDLE) { + Interface_SetDoAction(play, DO_ACTION_RETURN); + } + } + *gfxP = gfx; + return; + case MESSAGE_WIDE_PERSISTENT: + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { + Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + msgCtx->msgMode = MSGMODE_TEXT_DONE; + msgCtx->textboxEndType = TEXTBOX_ENDTYPE_PERSISTENT; + } + *gfxP = gfx; + return; + case MESSAGE_WIDE_EVENT: + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { + msgCtx->msgMode = MSGMODE_TEXT_DONE; + msgCtx->textboxEndType = TEXTBOX_ENDTYPE_EVENT; + Font_LoadMessageBoxIcon(&play->msgCtx.font, TEXTBOX_ICON_TRIANGLE); + Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } + *gfxP = gfx; + return; + default: + switch (character) { + case MESSAGE_WIDE_CHAR_PARENTHESES_LEFT: + case MESSAGE_WIDE_CHAR_KAGIKAKKO_LEFT: + msgCtx->textPosX -= 6; + break; + case MESSAGE_WIDE_CHAR_NAKATEN: + msgCtx->textPosX -= 3; + break; + case MESSAGE_WIDE_CHAR_QUESTION_MARK: + case MESSAGE_WIDE_CHAR_EXCLAMATION_MARK: + case MESSAGE_WIDE_CHAR_CIRCUMFLEX_ACCENT: + case MESSAGE_WIDE_CHAR_ONE: + msgCtx->textPosX -= 2; + break; + } + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING && i + 1 == msgCtx->textDrawPos && + msgCtx->textDelayTimer == msgCtx->textDelay) { + Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } + Message_DrawTextChar(play, &font->charTexBuf[charTexIdx], &gfx); + charTexIdx += FONT_CHAR_TEX_SIZE; + + switch (character) { + case MESSAGE_WIDE_CHAR_PERIOD: + msgCtx->textPosX += 3; + break; + case MESSAGE_WIDE_CHAR_PARENTHESES_RIGHT: + case MESSAGE_WIDE_CHAR_KAGIKAKKO_RIGHT: + msgCtx->textPosX += 5; + break; + case MESSAGE_WIDE_CHAR_TOUTEN: + case MESSAGE_WIDE_CHAR_KUTEN: + case MESSAGE_WIDE_CHAR_DOUBLE_QUOTATION_MARK_RIGHT: + msgCtx->textPosX += 7; + break; + case MESSAGE_WIDE_CHAR_CIRCUMFLEX_ACCENT: + case MESSAGE_WIDE_CHAR_NUMBER_SIGN: + case MESSAGE_WIDE_CHAR_ASTERISK: + msgCtx->textPosX += 9; + break; + case MESSAGE_WIDE_CHAR_NAKATEN: + msgCtx->textPosX += 10; + break; + default: + msgCtx->textPosX += (s32)(16.0f * (R_TEXT_CHAR_SCALE / 100.0f)); + break; + } + break; + } + } + + if (msgCtx->textDelayTimer == 0) { + msgCtx->textDrawPos = i + 1; + msgCtx->textDelayTimer = msgCtx->textDelay; + } else { + msgCtx->textDelayTimer--; + } + *gfxP = gfx; +} +#endif + +/** + * Draws the text contents of an eng/ger/fra textbox, up to the current point that has * been scrolled to so far. */ void Message_DrawText(PlayState* play, Gfx** gfxP) { @@ -981,7 +1441,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { case MESSAGE_COLOR: Message_SetTextColor(msgCtx, msgCtx->msgBufDecoded[++i] & 0xF); break; - case ' ': + case MESSAGE_CHAR_SPACE: msgCtx->textPosX += WIDE_MULT(MESSAGE_SPACE_WIDTH, WIDE_GET_RATIO); break; case MESSAGE_BOX_BREAK: @@ -1057,20 +1517,18 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { msgCtx->msgMode = MSGMODE_TEXT_DONE; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_FADING; - // "Timer" - PRINTF("タイマー (%x) (%x)", msgCtx->msgBufDecoded[i + 1], msgCtx->msgBufDecoded[i + 2]); + PRINTF(T("タイマー (%x) (%x)", "Timer (%x) (%x)"), msgCtx->msgBufDecoded[i + 1], + msgCtx->msgBufDecoded[i + 2]); msgCtx->stateTimer = msgCtx->msgBufDecoded[++i] << 8; msgCtx->stateTimer |= msgCtx->msgBufDecoded[++i]; - // "Total wct" - PRINTF("合計wct=%x(%d)\n", msgCtx->stateTimer, msgCtx->stateTimer); + PRINTF(T("合計wct=%x(%d)\n", " Total wct=%x(%d)\n"), msgCtx->stateTimer, msgCtx->stateTimer); } *gfxP = gfx; return; case MESSAGE_SFX: if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING && !sMessageHasSetSfx) { sMessageHasSetSfx = true; - // "Sound (SE)" - PRINTF("サウンド(SE)\n"); + PRINTF(T("サウンド(SE)\n", "Sound (SE)\n")); sfxHi = msgCtx->msgBufDecoded[i + 1]; sfxHi <<= 8; Audio_PlaySfxGeneral(sfxHi | msgCtx->msgBufDecoded[i + 2], &gSfxDefaultPos, 4, @@ -1246,8 +1704,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { } void Message_LoadItemIcon(PlayState* play, u16 itemId, s16 y) { - static s16 sIconItem32XOffsets[] = { 74, 74, 74 }; - static s16 sIconItem24XOffsets[] = { 72, 72, 72 }; + static s16 sIconItem32XOffsets[] = LANGUAGE_ARRAY(54, 74, 74, 74); + static s16 sIconItem24XOffsets[] = LANGUAGE_ARRAY(50, 72, 72, 72); MessageContext* msgCtx = &play->msgCtx; InterfaceContext* interfaceCtx = &play->interfaceCtx; @@ -1261,413 +1719,760 @@ void Message_LoadItemIcon(PlayState* play, u16 itemId, s16 y) { R_TEXTBOX_ICON_DIMENSION = ITEM_ICON_WIDTH; // assumes the image is square DMA_REQUEST_SYNC(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, GET_ITEM_ICON_VROM(itemId), ITEM_ICON_SIZE, "../z_message_PAL.c", 1473); - // "Item 32-0" - PRINTF("アイテム32-0\n"); + PRINTF(T("アイテム32-0\n", "Item 32-0\n")); } else { R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem24XOffsets[gSaveContext.language]; R_TEXTBOX_ICON_YPOS = y + ((44 - QUEST_ICON_HEIGHT) / 2); R_TEXTBOX_ICON_DIMENSION = QUEST_ICON_WIDTH; // assumes the image is square DMA_REQUEST_SYNC(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, GET_QUEST_ICON_VROM(itemId), QUEST_ICON_SIZE, "../z_message_PAL.c", 1482); - // "Item 24" - PRINTF("アイテム24=%d (%d) {%d}\n", itemId, itemId - ITEM_KOKIRI_EMERALD, 84); + PRINTF(T("アイテム24=%d (%d) {%d}\n", "Item 24=%d (%d) {%d}\n"), itemId, itemId - ITEM_KOKIRI_EMERALD, 84); } msgCtx->msgBufPos++; msgCtx->choiceNum = 1; } void Message_Decode(PlayState* play) { - u8 curChar; - u8 curChar2; - u16 value; - s32 loadChar; + MessageContext* msgCtx = &play->msgCtx; + Font* font = &play->msgCtx.font; s32 charTexIdx = 0; - s16 playerNameLen; + s16 i; +#if !(PLATFORM_GC && OOT_PAL) + s16 j; +#endif s16 decodedBufPos = 0; s16 numLines = 0; - s16 i; s16 digits[4]; f32 timeInSeconds; - MessageContext* msgCtx = &play->msgCtx; - Font* font = &play->msgCtx.font; + s16 playerNameLen; + s16 loadChar; + u16 value; + u8 curChar; +#if !(PLATFORM_GC && OOT_PAL) + u16 curCharWide; + u8* fontBuf; +#endif + + play->msgCtx.textDelayTimer = 0; + play->msgCtx.textUnskippable = play->msgCtx.textDelay = play->msgCtx.textDelayTimer = 0; + sTextFade = false; + +#if OOT_NTSC + if (gSaveContext.language == LANGUAGE_JPN && !sTextIsCredits) { + // Japanese text (NTSC only) + while (true) { + curCharWide = msgCtx->msgBufDecodedWide[decodedBufPos] = font->msgBufWide[msgCtx->msgBufPos]; + + if (curCharWide == MESSAGE_WIDE_BOX_BREAK || curCharWide == MESSAGE_WIDE_TEXTID || + curCharWide == MESSAGE_WIDE_BOX_BREAK_DELAYED || curCharWide == MESSAGE_WIDE_EVENT || + curCharWide == MESSAGE_WIDE_END) { + // Textbox decoding ends with any of the above text control characters + msgCtx->msgMode = MSGMODE_TEXT_DISPLAYING; + msgCtx->textDrawPos = 1; + R_TEXT_INIT_YPOS = R_TEXTBOX_Y + 6; + if (msgCtx->textBoxType != TEXTBOX_TYPE_NONE_BOTTOM) { + if (numLines == 0) { + R_TEXT_INIT_YPOS = (u16)(R_TEXTBOX_Y + 22); + } else if (numLines == 1) { + R_TEXT_INIT_YPOS = (u16)(R_TEXTBOX_Y + 14); + } + } + if (curCharWide == MESSAGE_WIDE_TEXTID) { + sNextTextId = msgCtx->msgBufDecodedWide[++decodedBufPos] = font->msgBufWide[msgCtx->msgBufPos + 1]; + } + if (curCharWide == MESSAGE_WIDE_BOX_BREAK_DELAYED) { + msgCtx->msgBufDecodedWide[++decodedBufPos] = font->msgBufWide[msgCtx->msgBufPos + 1]; + msgCtx->msgBufPos += 2; + } + msgCtx->decodedTextLen = decodedBufPos; + if (sTextboxSkipped) { + msgCtx->textDrawPos = msgCtx->decodedTextLen; + } + break; + } + if (curCharWide == MESSAGE_WIDE_NAME) { + // Substitute the player name control character for the file's player name. + for (playerNameLen = ARRAY_COUNT(gSaveContext.save.info.playerData.playerName); playerNameLen > 0; + playerNameLen--) { + if (gSaveContext.save.info.playerData.playerName[playerNameLen - 1] != FILENAME_SPACE) { + break; + } + } + for (i = 0; i < playerNameLen; i++) { + curCharWide = gSaveContext.save.info.playerData.playerName[i]; + fontBuf = &font->fontBuf[(curCharWide * 32) << 2]; // fake + msgCtx->msgBufDecodedWide[decodedBufPos + i] = MESSAGE_WIDE_NAME; + + for (j = 0; j < FONT_CHAR_TEX_SIZE; j += 4) { + font->charTexBuf[charTexIdx + j + 0] = fontBuf[j + 0]; + font->charTexBuf[charTexIdx + j + 1] = fontBuf[j + 1]; + font->charTexBuf[charTexIdx + j + 2] = fontBuf[j + 2]; + font->charTexBuf[charTexIdx + j + 3] = fontBuf[j + 3]; + } + charTexIdx += FONT_CHAR_TEX_SIZE; + } + decodedBufPos += playerNameLen - 1; + } else if (curCharWide == MESSAGE_WIDE_MARATHON_TIME || curCharWide == MESSAGE_WIDE_RACE_TIME) { + // Convert the values of the appropriate timer to digits and add the + // digits to the decoded buffer in place of the control character. + digits[0] = digits[1] = digits[2] = 0; + if (curCharWide == MESSAGE_WIDE_RACE_TIME) { + digits[3] = gSaveContext.timerSeconds; + } else { + digits[3] = gSaveContext.subTimerSeconds; + } + while (digits[3] >= 60) { + digits[1]++; + if (digits[1] >= 10) { + digits[0]++; + digits[1] -= 10; + } + digits[3] -= 60; + } + while (digits[3] >= 10) { + digits[2]++; + digits[3] -= 10; + } + + for (i = 0; i < 4; i++) { + Font_LoadCharWide(font, digits[i] + MESSAGE_WIDE_CHAR_ZERO, charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecodedWide[decodedBufPos] = digits[i] + MESSAGE_WIDE_CHAR_ZERO; + decodedBufPos++; + if (i == 1) { + Font_LoadCharWide(font, MESSAGE_WIDE_CHAR_MINUTES, charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecodedWide[decodedBufPos] = MESSAGE_WIDE_CHAR_MINUTES; + decodedBufPos++; + } else if (i == 3) { + Font_LoadCharWide(font, MESSAGE_WIDE_CHAR_SECONDS, charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecodedWide[decodedBufPos] = MESSAGE_WIDE_CHAR_SECONDS; + } + } + } else if (curCharWide == MESSAGE_WIDE_POINTS) { + // Convert the values of the current minigame score to digits and + // add the digits to the decoded buffer in place of the control character. + digits[0] = digits[1] = digits[2] = 0; + digits[3] = gSaveContext.minigameScore; + + while (digits[3] >= 1000) { + digits[0]++; + digits[3] -= 1000; + } + while (digits[3] >= 100) { + digits[1]++; + digits[3] -= 100; + } + while (digits[3] >= 10) { + digits[2]++; + digits[3] -= 10; + } + loadChar = false; + for (i = 0; i < 4; i++) { + if (i == 3 || digits[i] != 0) { + loadChar = true; + } + if (loadChar) { + Font_LoadCharWide(font, digits[i] + MESSAGE_WIDE_CHAR_ZERO, charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecodedWide[decodedBufPos] = digits[i] + MESSAGE_WIDE_CHAR_ZERO; + decodedBufPos++; + } + } + decodedBufPos--; + } else if (curCharWide == MESSAGE_WIDE_TOKENS) { + // Convert the current number of collected gold skulltula tokens to digits and + // add the digits to the decoded buffer in place of the control character. + digits[0] = digits[1] = 0; + digits[2] = gSaveContext.save.info.inventory.gsTokens; + + while (digits[2] >= 100) { + digits[0]++; + digits[2] -= 100; + } + while (digits[2] >= 10) { + digits[1]++; + digits[2] -= 10; + } - play->msgCtx.textDelayTimer = 0; - play->msgCtx.textUnskippable = play->msgCtx.textDelay = play->msgCtx.textDelayTimer = 0; - sTextFade = false; + loadChar = false; + for (i = 0; i < 3; i++) { + if (i == 2 || digits[i] != 0) { + loadChar = true; + } + if (loadChar) { + Font_LoadCharWide(font, digits[i] + MESSAGE_WIDE_CHAR_ZERO, charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecodedWide[decodedBufPos] = digits[i] + MESSAGE_WIDE_CHAR_ZERO; + decodedBufPos++; + } + } + decodedBufPos--; + } else if (curCharWide == MESSAGE_WIDE_FISH_INFO) { + digits[0] = 0; + digits[1] = gSaveContext.minigameScore; - while (true) { - curChar2 = curChar = msgCtx->msgBufDecoded[decodedBufPos] = font->msgBuf[msgCtx->msgBufPos]; - - if (curChar == MESSAGE_BOX_BREAK || curChar == MESSAGE_TEXTID || curChar == MESSAGE_BOX_BREAK_DELAYED || - curChar == MESSAGE_EVENT || curChar == MESSAGE_END) { - // Textbox decoding ends with any of the above text control characters - msgCtx->msgMode = MSGMODE_TEXT_DISPLAYING; - msgCtx->textDrawPos = 1; - R_TEXT_INIT_YPOS = R_TEXTBOX_Y + 8; - PRINTF("JJ=%d\n", numLines); - if (msgCtx->textBoxType != TEXTBOX_TYPE_NONE_BOTTOM) { - if (numLines == 0) { - R_TEXT_INIT_YPOS = (u16)(R_TEXTBOX_Y + 26); - } else if (numLines == 1) { - R_TEXT_INIT_YPOS = (u16)(R_TEXTBOX_Y + 20); - } else if (numLines == 2) { - R_TEXT_INIT_YPOS = (u16)(R_TEXTBOX_Y + 16); + while (digits[1] >= 10) { + digits[0]++; + digits[1] -= 10; } - } - if (curChar2 == MESSAGE_TEXTID) { - PRINTF("NZ_NEXTMSG=%x, %x, %x\n", font->msgBuf[msgCtx->msgBufPos], font->msgBuf[msgCtx->msgBufPos + 1], - font->msgBuf[msgCtx->msgBufPos + 2]); - curChar = msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 1]; - msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 2]; - value = curChar << 8; - sNextTextId = msgCtx->msgBufDecoded[decodedBufPos] | value; - } - if (curChar2 == MESSAGE_BOX_BREAK_DELAYED) { - msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 1]; - msgCtx->msgBufPos += 2; - } - msgCtx->decodedTextLen = decodedBufPos; - if (sTextboxSkipped) { - msgCtx->textDrawPos = msgCtx->decodedTextLen; - } - break; - } else if (curChar == MESSAGE_NAME) { - // Substitute the player name control character for the file's player name. - for (playerNameLen = ARRAY_COUNT(gSaveContext.save.info.playerData.playerName); playerNameLen > 0; - playerNameLen--) { - if (gSaveContext.save.info.playerData.playerName[playerNameLen - 1] != FILENAME_SPACE) { - break; + + for (i = 0; i < 2; i++) { + if (i == 1 || digits[i] != 0) { + Font_LoadCharWide(font, digits[i] + MESSAGE_WIDE_CHAR_ZERO, charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecodedWide[decodedBufPos] = digits[i] + MESSAGE_WIDE_CHAR_ZERO; + decodedBufPos++; + } } - } - // "Name" - PRINTF("\n名前 = "); - for (i = 0; i < playerNameLen; i++) { - curChar2 = gSaveContext.save.info.playerData.playerName[i]; - if (curChar2 == FILENAME_SPACE) { - curChar2 = ' '; - } else if (curChar2 == FILENAME_PERIOD) { - curChar2 = '.'; - } else if (curChar2 == FILENAME_DASH) { - curChar2 = '-'; - } else if (curChar2 <= FILENAME_DIGIT('9')) { - curChar2 -= FILENAME_DIGIT('0'); - curChar2 += '0'; - } else if (curChar2 <= FILENAME_UPPERCASE('Z')) { - curChar2 -= FILENAME_UPPERCASE('A'); - curChar2 += 'A'; - } else if (curChar2 <= FILENAME_LOWERCASE('z')) { - curChar2 -= FILENAME_LOWERCASE('a'); - curChar2 += 'a'; - } - if (curChar2 != ' ') { - Font_LoadChar(font, curChar2 - ' ', charTexIdx); - charTexIdx += FONT_CHAR_TEX_SIZE; + decodedBufPos--; + } else if (curCharWide == MESSAGE_WIDE_HIGHSCORE) { + value = HIGH_SCORE(font->msgBufWide[++msgCtx->msgBufPos] & 0xFF); + if ((font->msgBufWide[msgCtx->msgBufPos] & 0xFF) == HS_FISHING) { + if (LINK_AGE_IN_YEARS == YEARS_CHILD) { + value &= 0x7F; + } else { + value = ((HIGH_SCORE(font->msgBufWide[msgCtx->msgBufPos]) & 0xFF000000) >> 0x18) & 0x7F; + } } - PRINTF("%x ", curChar2); - msgCtx->msgBufDecoded[decodedBufPos] = curChar2; - decodedBufPos++; - } - decodedBufPos--; - } else if (curChar == MESSAGE_MARATHON_TIME || curChar == MESSAGE_RACE_TIME) { - // Convert the values of the appropriate timer to digits and add the - // digits to the decoded buffer in place of the control character. - // "EVENT timer" - PRINTF("\nEVENTタイマー = "); - digits[0] = digits[1] = digits[2] = 0; - if (curChar == MESSAGE_RACE_TIME) { - digits[3] = gSaveContext.timerSeconds; - } else { - digits[3] = gSaveContext.subTimerSeconds; - } + switch (font->msgBufWide[msgCtx->msgBufPos] & 0xFF) { + case HS_HBA: + case HS_POE_POINTS: + case HS_FISHING: + digits[0] = digits[1] = digits[2] = 0; + digits[3] = value; + + while (digits[3] >= 1000) { + digits[0]++; + digits[3] -= 1000; + } + while (digits[3] >= 100) { + digits[1]++; + digits[3] -= 100; + } + while (digits[3] >= 10) { + digits[2]++; + digits[3] -= 10; + } + + loadChar = false; + for (i = 0; i < 4; i++) { + if (i == 3 || digits[i] != 0) { + loadChar = true; + } + if (loadChar) { + Font_LoadCharWide(font, digits[i] + MESSAGE_WIDE_CHAR_ZERO, charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecodedWide[decodedBufPos] = digits[i] + MESSAGE_WIDE_CHAR_ZERO; + decodedBufPos++; + } + } + decodedBufPos--; + break; + case HS_UNK_05: + break; + case HS_HORSE_RACE: + case HS_MARATHON: + case HS_DAMPE_RACE: + digits[0] = digits[1] = digits[2] = 0; + digits[3] = value; + + while (digits[3] >= 60) { + digits[1]++; + if (digits[1] >= 10) { + digits[0]++; + digits[1] -= 10; + } + digits[3] -= 60; + } + while (digits[3] >= 10) { + digits[2]++; + digits[3] -= 10; + } + + for (i = 0; i < 4; i++) { + Font_LoadCharWide(font, digits[i] + MESSAGE_WIDE_CHAR_ZERO, charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecodedWide[decodedBufPos] = digits[i] + MESSAGE_WIDE_CHAR_ZERO; + decodedBufPos++; + if (i == 1) { + Font_LoadCharWide(font, MESSAGE_WIDE_CHAR_MINUTES, charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecodedWide[decodedBufPos] = MESSAGE_WIDE_CHAR_MINUTES; + decodedBufPos++; + } else if (i == 3) { + Font_LoadCharWide(font, MESSAGE_WIDE_CHAR_SECONDS, charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecodedWide[decodedBufPos] = MESSAGE_WIDE_CHAR_SECONDS; + } + } + break; + } + } else if (curCharWide == MESSAGE_WIDE_TIME) { + digits[0] = 0; + timeInSeconds = gSaveContext.save.dayTime * (24.0f * 60.0f / 0x10000); - while (digits[3] >= 60) { - digits[1]++; - if (digits[1] >= 10) { + digits[1] = timeInSeconds / 60.0f; + while (digits[1] >= 10) { digits[0]++; digits[1] -= 10; } - digits[3] -= 60; - } - while (digits[3] >= 10) { - digits[2]++; - digits[3] -= 10; - } + digits[2] = 0; + digits[3] = (s16)timeInSeconds % 60; + while (digits[3] >= 10) { + digits[2]++; + digits[3] -= 10; + } - for (i = 0; i < 4; i++) { - Font_LoadChar(font, digits[i] + '0' - ' ', charTexIdx); - charTexIdx += FONT_CHAR_TEX_SIZE; - msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; - decodedBufPos++; - if (i == 1) { - Font_LoadChar(font, '"' - ' ', charTexIdx); + for (i = 0; i < 4; i++) { + Font_LoadCharWide(font, digits[i] + MESSAGE_WIDE_CHAR_ZERO, charTexIdx); charTexIdx += FONT_CHAR_TEX_SIZE; - msgCtx->msgBufDecoded[decodedBufPos] = '"'; + msgCtx->msgBufDecodedWide[decodedBufPos] = digits[i] + MESSAGE_WIDE_CHAR_ZERO; decodedBufPos++; - } else if (i == 3) { - Font_LoadChar(font, '"' - ' ', charTexIdx); + if (i == 1) { + Font_LoadCharWide(font, MESSAGE_WIDE_CHAR_HOURS, charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecodedWide[decodedBufPos] = MESSAGE_WIDE_CHAR_HOURS; + decodedBufPos++; + } else if (i == 3) { + Font_LoadCharWide(font, MESSAGE_WIDE_CHAR_MINUTES, charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecodedWide[decodedBufPos] = MESSAGE_WIDE_CHAR_MINUTES; + } + } + } else if (curCharWide == MESSAGE_WIDE_ITEM_ICON) { + msgCtx->msgBufDecodedWide[++decodedBufPos] = font->msgBufWide[msgCtx->msgBufPos + 1]; + Message_LoadItemIcon(play, font->msgBufWide[msgCtx->msgBufPos + 1], R_TEXTBOX_Y + 10); + } else if (curCharWide == MESSAGE_WIDE_BACKGROUND) { + msgCtx->textboxBackgroundIdx = font->msgBufWide[msgCtx->msgBufPos + 1] * 2; + msgCtx->textboxBackgroundForeColorIdx = (font->msgBufWide[msgCtx->msgBufPos + 2] & 0xF000) >> 12; + msgCtx->textboxBackgroundBackColorIdx = (font->msgBufWide[msgCtx->msgBufPos + 2] & 0xF00) >> 8; + msgCtx->textboxBackgroundYOffsetIdx = (font->msgBufWide[msgCtx->msgBufPos + 2] & 0xF0) >> 4; + msgCtx->textboxBackgroundUnkArg = font->msgBufWide[msgCtx->msgBufPos + 2] & 0xF; + DmaMgr_RequestSync(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, + (uintptr_t)_message_texture_staticSegmentRomStart + + msgCtx->textboxBackgroundIdx * MESSAGE_TEXTURE_STATIC_TEX_SIZE, + MESSAGE_TEXTURE_STATIC_TEX_SIZE); + DmaMgr_RequestSync(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE + MESSAGE_TEXTURE_STATIC_TEX_SIZE, + (uintptr_t)_message_texture_staticSegmentRomStart + + (msgCtx->textboxBackgroundIdx + 1) * MESSAGE_TEXTURE_STATIC_TEX_SIZE, + MESSAGE_TEXTURE_STATIC_TEX_SIZE); + numLines = 2; + msgCtx->msgBufPos += 2; + R_TEXTBOX_BG_YPOS = R_TEXTBOX_Y + 8; + } else if (curCharWide == MESSAGE_WIDE_COLOR) { + msgCtx->msgBufDecodedWide[++decodedBufPos] = font->msgBufWide[++msgCtx->msgBufPos] & 0xF; + } else if (curCharWide == MESSAGE_WIDE_NEWLINE) { + numLines++; + } else if (curCharWide != MESSAGE_WIDE_QUICKTEXT_ENABLE && curCharWide != MESSAGE_WIDE_QUICKTEXT_DISABLE && + curCharWide != MESSAGE_WIDE_AWAIT_BUTTON_PRESS && curCharWide != MESSAGE_WIDE_OCARINA && + curCharWide != MESSAGE_WIDE_PERSISTENT && curCharWide != MESSAGE_WIDE_UNSKIPPABLE) { + if (curCharWide == MESSAGE_WIDE_FADE) { + sTextFade = true; + msgCtx->msgBufDecodedWide[++decodedBufPos] = font->msgBufWide[++msgCtx->msgBufPos] & 0xFF; + } else if (curCharWide == MESSAGE_WIDE_SHIFT || curCharWide == MESSAGE_WIDE_TEXT_SPEED) { + msgCtx->msgBufDecodedWide[++decodedBufPos] = font->msgBufWide[++msgCtx->msgBufPos] & 0xFF; + } else if (curCharWide == MESSAGE_WIDE_SFX) { + msgCtx->msgBufDecodedWide[++decodedBufPos] = font->msgBufWide[++msgCtx->msgBufPos]; + } else if (curCharWide == MESSAGE_WIDE_TWO_CHOICE) { + msgCtx->choiceNum = 2; + } else if (curCharWide == MESSAGE_WIDE_THREE_CHOICE) { + msgCtx->choiceNum = 3; + R_TEXT_INIT_XPOS += 32; + } else if (curCharWide != MESSAGE_WIDE_CHAR_SPACE) { + Font_LoadCharWide(font, curCharWide, charTexIdx); charTexIdx += FONT_CHAR_TEX_SIZE; - msgCtx->msgBufDecoded[decodedBufPos] = '"'; } } - } else if (curChar == MESSAGE_POINTS) { - // Convert the values of the current minigame score to digits and - // add the digits to the decoded buffer in place of the control character. - // "Yabusame score" - PRINTF("\n流鏑馬スコア = %d\n", gSaveContext.minigameScore); - digits[0] = digits[1] = digits[2] = 0; - digits[3] = gSaveContext.minigameScore; - - while (digits[3] >= 1000) { - digits[0]++; - digits[3] -= 1000; - } - while (digits[3] >= 100) { - digits[1]++; - digits[3] -= 100; - } - while (digits[3] >= 10) { - digits[2]++; - digits[3] -= 10; - } - - loadChar = false; - for (i = 0; i < 4; i++) { - if (i == 3 || digits[i] != 0) { - loadChar = true; + decodedBufPos++; + msgCtx->msgBufPos++; + } + } else +#endif + { + // English text for NTSC, eng/ger/fra text for PAL + while (true) { + curChar = msgCtx->msgBufDecoded[decodedBufPos] = font->msgBuf[msgCtx->msgBufPos]; + + if (curChar == MESSAGE_BOX_BREAK || curChar == MESSAGE_TEXTID || curChar == MESSAGE_BOX_BREAK_DELAYED || + curChar == MESSAGE_EVENT || curChar == MESSAGE_END) { + // Textbox decoding ends with any of the above text control characters + msgCtx->msgMode = MSGMODE_TEXT_DISPLAYING; + msgCtx->textDrawPos = 1; + R_TEXT_INIT_YPOS = R_TEXTBOX_Y + 8; + PRINTF("JJ=%d\n", numLines); + if (msgCtx->textBoxType != TEXTBOX_TYPE_NONE_BOTTOM) { + if (numLines == 0) { + R_TEXT_INIT_YPOS = (u16)(R_TEXTBOX_Y + 26); + } else if (numLines == 1) { + R_TEXT_INIT_YPOS = (u16)(R_TEXTBOX_Y + 20); + } else if (numLines == 2) { + R_TEXT_INIT_YPOS = (u16)(R_TEXTBOX_Y + 16); + } } - if (loadChar) { - Font_LoadChar(font, digits[i] + '0' - ' ', charTexIdx); - msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; - charTexIdx += FONT_CHAR_TEX_SIZE; + if (curChar == MESSAGE_TEXTID) { + PRINTF("NZ_NEXTMSG=%x, %x, %x\n", font->msgBuf[msgCtx->msgBufPos], + font->msgBuf[msgCtx->msgBufPos + 1], font->msgBuf[msgCtx->msgBufPos + 2]); + value = msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 1]; + msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 2]; + value <<= 8; + sNextTextId = msgCtx->msgBufDecoded[decodedBufPos] | value; + } + if (curChar == MESSAGE_BOX_BREAK_DELAYED) { + msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 1]; + msgCtx->msgBufPos += 2; + } + msgCtx->decodedTextLen = decodedBufPos; + if (sTextboxSkipped) { + msgCtx->textDrawPos = msgCtx->decodedTextLen; + } + break; + } else if (curChar == MESSAGE_NAME) { + // Substitute the player name control character for the file's player name. + for (playerNameLen = ARRAY_COUNT(gSaveContext.save.info.playerData.playerName); playerNameLen > 0; + playerNameLen--) { + if (gSaveContext.save.info.playerData.playerName[playerNameLen - 1] != FILENAME_SPACE) { + break; + } + } + PRINTF(T("\n名前 = ", "\nName = ")); + for (i = 0; i < playerNameLen; i++) { + curChar = gSaveContext.save.info.playerData.playerName[i]; + if (curChar == FILENAME_SPACE) { + curChar = ' '; + } else if (curChar == FILENAME_PERIOD) { + curChar = '.'; + } else if (curChar == FILENAME_DASH) { + curChar = '-'; + } else if (curChar <= FILENAME_DIGIT('9')) { + curChar -= FILENAME_DIGIT('0'); + curChar += '0'; + } else if (curChar <= FILENAME_UPPERCASE('Z')) { + curChar -= FILENAME_UPPERCASE('A'); + curChar += 'A'; + } else if (curChar <= FILENAME_LOWERCASE('z')) { + curChar -= FILENAME_LOWERCASE('a'); + curChar += 'a'; + } + if (curChar != ' ') { + Font_LoadChar(font, curChar - ' ', charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + } + PRINTF("%x ", curChar); + msgCtx->msgBufDecoded[decodedBufPos] = curChar; decodedBufPos++; } - } - decodedBufPos--; - } else if (curChar == MESSAGE_TOKENS) { - // Convert the current number of collected gold skulltula tokens to digits and - // add the digits to the decoded buffer in place of the control character. - // "Total number of gold stars" - PRINTF("\n金スタ合計数 = %d", gSaveContext.save.info.inventory.gsTokens); - digits[0] = digits[1] = 0; - digits[2] = gSaveContext.save.info.inventory.gsTokens; - - while (digits[2] >= 100) { - digits[0]++; - digits[2] -= 100; - } - while (digits[2] >= 10) { - digits[1]++; - digits[2] -= 10; - } + decodedBufPos--; + } else if (curChar == MESSAGE_MARATHON_TIME || curChar == MESSAGE_RACE_TIME) { + // Convert the values of the appropriate timer to digits and add the + // digits to the decoded buffer in place of the control character. + PRINTF(T("\nEVENTタイマー = ", "\nEVENT timer = ")); + digits[0] = digits[1] = digits[2] = 0; + if (curChar == MESSAGE_RACE_TIME) { + digits[3] = gSaveContext.timerSeconds; + } else { + digits[3] = gSaveContext.subTimerSeconds; + } - loadChar = false; - for (i = 0; i < 3; i++) { - if (i == 2 || digits[i] != 0) { - loadChar = true; + while (digits[3] >= 60) { + digits[1]++; + if (digits[1] >= 10) { + digits[0]++; + digits[1] -= 10; + } + digits[3] -= 60; } - if (loadChar) { - Font_LoadChar(font, digits[i] + '0' - ' ', charTexIdx); - charTexIdx += FONT_CHAR_TEX_SIZE; - msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; - PRINTF("%x(%x) ", digits[i] + '0' - ' ', digits[i]); - decodedBufPos++; + while (digits[3] >= 10) { + digits[2]++; + digits[3] -= 10; } - } - decodedBufPos--; - } else if (curChar == MESSAGE_FISH_INFO) { - // "Fishing hole fish size" - PRINTF("\n釣り堀魚サイズ = "); - digits[0] = 0; - digits[1] = gSaveContext.minigameScore; - - while (digits[1] >= 10) { - digits[0]++; - digits[1] -= 10; - } - for (i = 0; i < 2; i++) { - if (i == 1 || digits[i] != 0) { + for (i = 0; i < 4; i++) { Font_LoadChar(font, digits[i] + '0' - ' ', charTexIdx); charTexIdx += FONT_CHAR_TEX_SIZE; msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; - PRINTF("%x(%x) ", digits[i] + '0' - ' ', digits[i]); decodedBufPos++; + if (i == 1) { + Font_LoadChar(font, '"' - ' ', charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecoded[decodedBufPos] = '"'; + decodedBufPos++; + } else if (i == 3) { + Font_LoadChar(font, '"' - ' ', charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecoded[decodedBufPos] = '"'; + } } - } - decodedBufPos--; - } else if (curChar == MESSAGE_HIGHSCORE) { - value = HIGH_SCORE((u8)font->msgBuf[++msgCtx->msgBufPos]); - // "Highscore" - PRINTF("ランキング=%d\n", font->msgBuf[msgCtx->msgBufPos]); - if ((font->msgBuf[msgCtx->msgBufPos] & 0xFF) == 2) { - if (LINK_AGE_IN_YEARS == YEARS_CHILD) { - value &= 0x7F; - } else { - PRINTF("HI_SCORE( kanfont->mbuff.nes_mes_buf[message->rdp] & 0xff000000 ) = %x\n", - HIGH_SCORE(font->msgBufWide[msgCtx->msgBufPos] & 0xFF000000)); - value = ((HIGH_SCORE((u8)font->msgBuf[msgCtx->msgBufPos]) & 0xFF000000) >> 0x18) & 0x7F; + } else if (curChar == MESSAGE_POINTS) { + // Convert the values of the current minigame score to digits and + // add the digits to the decoded buffer in place of the control character. + PRINTF(T("\n流鏑馬スコア = %d\n", "\nYabusame score = %d\n"), gSaveContext.minigameScore); + digits[0] = digits[1] = digits[2] = 0; + digits[3] = gSaveContext.minigameScore; + + while (digits[3] >= 1000) { + digits[0]++; + digits[3] -= 1000; } - value = SQ((f32)value) * 0.0036f + 0.5f; - PRINTF("score=%d\n", value); - } - switch (font->msgBuf[msgCtx->msgBufPos] & 0xFF) { - case HS_HBA: - case HS_POE_POINTS: - case HS_FISHING: - digits[0] = digits[1] = digits[2] = 0; - digits[3] = value; - - while (digits[3] >= 1000) { - digits[0]++; - digits[3] -= 1000; - } - while (digits[3] >= 100) { - digits[1]++; - digits[3] -= 100; + while (digits[3] >= 100) { + digits[1]++; + digits[3] -= 100; + } + while (digits[3] >= 10) { + digits[2]++; + digits[3] -= 10; + } + + loadChar = false; + for (i = 0; i < 4; i++) { + if (i == 3 || digits[i] != 0) { + loadChar = true; } - while (digits[3] >= 10) { - digits[2]++; - digits[3] -= 10; + if (loadChar) { + Font_LoadChar(font, digits[i] + '0' - ' ', charTexIdx); + msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; + charTexIdx += FONT_CHAR_TEX_SIZE; + decodedBufPos++; } + } + decodedBufPos--; + } else if (curChar == MESSAGE_TOKENS) { + // Convert the current number of collected gold skulltula tokens to digits and + // add the digits to the decoded buffer in place of the control character. + PRINTF(T("\n金スタ合計数 = %d", "\nTotal number of gold stars = %d"), + gSaveContext.save.info.inventory.gsTokens); + digits[0] = digits[1] = 0; + digits[2] = gSaveContext.save.info.inventory.gsTokens; + + while (digits[2] >= 100) { + digits[0]++; + digits[2] -= 100; + } + while (digits[2] >= 10) { + digits[1]++; + digits[2] -= 10; + } - loadChar = false; - for (i = 0; i < 4; i++) { - if (i == 3 || digits[i] != 0) { - loadChar = true; - } - if (loadChar) { - Font_LoadChar(font, digits[i] + '0' - ' ', charTexIdx); - msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; - charTexIdx += FONT_CHAR_TEX_SIZE; - decodedBufPos++; - } - } - decodedBufPos--; - break; - case HS_UNK_05: - break; - case HS_HORSE_RACE: - case HS_MARATHON: - case HS_DAMPE_RACE: - digits[0] = digits[1] = digits[2] = 0; - digits[3] = value; - - while (digits[3] >= 60) { - digits[1]++; - if (digits[1] >= 10) { - digits[0]++; - digits[1] -= 10; - } - digits[3] -= 60; + loadChar = false; + for (i = 0; i < 3; i++) { + if (i == 2 || digits[i] != 0) { + loadChar = true; } - while (digits[3] >= 10) { - digits[2]++; - digits[3] -= 10; + if (loadChar) { + Font_LoadChar(font, digits[i] + '0' - ' ', charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; + PRINTF("%x(%x) ", digits[i] + '0' - ' ', digits[i]); + decodedBufPos++; } + } + decodedBufPos--; + } else if (curChar == MESSAGE_FISH_INFO) { + PRINTF(T("\n釣り堀魚サイズ = ", "\nFishing hole fish size = ")); + digits[0] = 0; + digits[1] = gSaveContext.minigameScore; + + while (digits[1] >= 10) { + digits[0]++; + digits[1] -= 10; + } - for (i = 0; i < 4; i++) { + for (i = 0; i < 2; i++) { + if (i == 1 || digits[i] != 0) { Font_LoadChar(font, digits[i] + '0' - ' ', charTexIdx); charTexIdx += FONT_CHAR_TEX_SIZE; msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; + PRINTF("%x(%x) ", digits[i] + '0' - ' ', digits[i]); decodedBufPos++; - if (i == 1) { - Font_LoadChar(font, '"' - ' ', charTexIdx); + } + } + decodedBufPos--; + } else if (curChar == MESSAGE_HIGHSCORE) { + value = HIGH_SCORE((u8)font->msgBuf[++msgCtx->msgBufPos]); + PRINTF(T("ランキング=%d\n", "Highscore=%d\n"), font->msgBuf[msgCtx->msgBufPos]); + if ((font->msgBuf[msgCtx->msgBufPos] & 0xFF) == HS_FISHING) { + if (LINK_AGE_IN_YEARS == YEARS_CHILD) { + value &= 0x7F; + } else { + //! @bug Should use msgBuf instead of msgBufWide (copy-paste error from Japanese text + //! handling?), and the mask is applied to the high score index instead of the high score value + //! so this always shows HIGH_SCORE(0). Only the PRINTF is wrong, the following line is correct. + PRINTF("HI_SCORE( kanfont->mbuff.nes_mes_buf[message->rdp] & 0xff000000 ) = %x\n", + HIGH_SCORE(font->msgBufWide[msgCtx->msgBufPos] & 0xFF000000)); + value = ((HIGH_SCORE((u8)font->msgBuf[msgCtx->msgBufPos]) & 0xFF000000) >> 0x18) & 0x7F; + } + value = SQ((f32)value) * 0.0036f + 0.5f; + PRINTF("score=%d\n", value); + } + switch (font->msgBuf[msgCtx->msgBufPos] & 0xFF) { + case HS_HBA: + case HS_POE_POINTS: + case HS_FISHING: + digits[0] = digits[1] = digits[2] = 0; + digits[3] = value; + + while (digits[3] >= 1000) { + digits[0]++; + digits[3] -= 1000; + } + while (digits[3] >= 100) { + digits[1]++; + digits[3] -= 100; + } + while (digits[3] >= 10) { + digits[2]++; + digits[3] -= 10; + } + + loadChar = false; + for (i = 0; i < 4; i++) { + if (i == 3 || digits[i] != 0) { + loadChar = true; + } + if (loadChar) { + Font_LoadChar(font, digits[i] + '0' - ' ', charTexIdx); + msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; + charTexIdx += FONT_CHAR_TEX_SIZE; + decodedBufPos++; + } + } + decodedBufPos--; + break; + case HS_UNK_05: + break; + case HS_HORSE_RACE: + case HS_MARATHON: + case HS_DAMPE_RACE: + digits[0] = digits[1] = digits[2] = 0; + digits[3] = value; + + while (digits[3] >= 60) { + digits[1]++; + if (digits[1] >= 10) { + digits[0]++; + digits[1] -= 10; + } + digits[3] -= 60; + } + while (digits[3] >= 10) { + digits[2]++; + digits[3] -= 10; + } + + for (i = 0; i < 4; i++) { + Font_LoadChar(font, digits[i] + '0' - ' ', charTexIdx); charTexIdx += FONT_CHAR_TEX_SIZE; - msgCtx->msgBufDecoded[decodedBufPos] = '"'; + msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; decodedBufPos++; - } else if (i == 3) { - Font_LoadChar(font, '"' - ' ', charTexIdx); - charTexIdx += FONT_CHAR_TEX_SIZE; - msgCtx->msgBufDecoded[decodedBufPos] = '"'; + if (i == 1) { + Font_LoadChar(font, '"' - ' ', charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecoded[decodedBufPos] = '"'; + decodedBufPos++; + } else if (i == 3) { + Font_LoadChar(font, '"' - ' ', charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecoded[decodedBufPos] = '"'; + } } - } - break; - } - } else if (curChar == MESSAGE_TIME) { - // "Zelda time" - PRINTF("\nゼルダ時間 = "); - digits[0] = 0; - timeInSeconds = gSaveContext.save.dayTime * (24.0f * 60.0f / 0x10000); - - digits[1] = timeInSeconds / 60.0f; - while (digits[1] >= 10) { - digits[0]++; - digits[1] -= 10; - } - digits[2] = 0; - digits[3] = (s16)timeInSeconds % 60; - while (digits[3] >= 10) { - digits[2]++; - digits[3] -= 10; - } + break; + } + } else if (curChar == MESSAGE_TIME) { + PRINTF(T("\nゼルダ時間 = ", "\nZelda time = ")); + digits[0] = 0; + timeInSeconds = gSaveContext.save.dayTime * (24.0f * 60.0f / 0x10000); - for (i = 0; i < 4; i++) { - Font_LoadChar(font, digits[i] + '0' - ' ', charTexIdx); - charTexIdx += FONT_CHAR_TEX_SIZE; - msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; - decodedBufPos++; - if (i == 1) { - Font_LoadChar(font, ':' - ' ', charTexIdx); + digits[1] = timeInSeconds / 60.0f; + while (digits[1] >= 10) { + digits[0]++; + digits[1] -= 10; + } + digits[2] = 0; + digits[3] = (s16)timeInSeconds % 60; + while (digits[3] >= 10) { + digits[2]++; + digits[3] -= 10; + } + + for (i = 0; i < 4; i++) { + Font_LoadChar(font, digits[i] + '0' - ' ', charTexIdx); charTexIdx += FONT_CHAR_TEX_SIZE; - msgCtx->msgBufDecoded[decodedBufPos] = ':'; + msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; decodedBufPos++; + if (i == 1) { + Font_LoadChar(font, ':' - ' ', charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecoded[decodedBufPos] = ':'; + decodedBufPos++; + } } - } - decodedBufPos--; - } else if (curChar == MESSAGE_ITEM_ICON) { - msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 1]; - PRINTF("ITEM_NO=(%d) (%d)\n", msgCtx->msgBufDecoded[decodedBufPos], font->msgBuf[msgCtx->msgBufPos + 1]); - Message_LoadItemIcon(play, font->msgBuf[msgCtx->msgBufPos + 1], R_TEXTBOX_Y + 10); - } else if (curChar == MESSAGE_BACKGROUND) { - msgCtx->textboxBackgroundIdx = font->msgBuf[msgCtx->msgBufPos + 1] * 2; - msgCtx->textboxBackgroundForeColorIdx = (font->msgBuf[msgCtx->msgBufPos + 2] & 0xF0) >> 4; - msgCtx->textboxBackgroundBackColorIdx = font->msgBuf[msgCtx->msgBufPos + 2] & 0xF; - msgCtx->textboxBackgroundYOffsetIdx = (font->msgBuf[msgCtx->msgBufPos + 3] & 0xF0) >> 4; - msgCtx->textboxBackgroundUnkArg = font->msgBuf[msgCtx->msgBufPos + 3] & 0xF; - DMA_REQUEST_SYNC(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, - (uintptr_t)_message_texture_staticSegmentRomStart + - msgCtx->textboxBackgroundIdx * MESSAGE_TEXTURE_STATIC_TEX_SIZE, - MESSAGE_TEXTURE_STATIC_TEX_SIZE, "../z_message_PAL.c", 1830); - DMA_REQUEST_SYNC(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE + MESSAGE_TEXTURE_STATIC_TEX_SIZE, - (uintptr_t)_message_texture_staticSegmentRomStart + - (msgCtx->textboxBackgroundIdx + 1) * MESSAGE_TEXTURE_STATIC_TEX_SIZE, - MESSAGE_TEXTURE_STATIC_TEX_SIZE, "../z_message_PAL.c", 1834); - msgCtx->msgBufPos += 3; - R_TEXTBOX_BG_YPOS = R_TEXTBOX_Y + 8; - numLines = 2; - R_TEXT_INIT_XPOS = 50; - } else if (curChar == MESSAGE_COLOR) { - msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos]; - } else if (curChar == MESSAGE_NEWLINE) { - numLines++; - } else if (curChar != MESSAGE_QUICKTEXT_ENABLE && curChar != MESSAGE_QUICKTEXT_DISABLE && - curChar != MESSAGE_AWAIT_BUTTON_PRESS && curChar != MESSAGE_OCARINA && - curChar != MESSAGE_PERSISTENT && curChar != MESSAGE_UNSKIPPABLE) { - if (curChar == MESSAGE_FADE) { - sTextFade = true; - PRINTF("NZ_TIMER_END (key_off_flag=%d)\n", sTextFade); - msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos]; - } else if (curChar == MESSAGE_FADE2) { - sTextFade = true; - PRINTF("NZ_BGM (key_off_flag=%d)\n", sTextFade); - msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos]; - msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos]; - } else if (curChar == MESSAGE_SHIFT || curChar == MESSAGE_TEXT_SPEED) { - msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos] & 0xFF; - } else if (curChar == MESSAGE_SFX) { - msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos]; + decodedBufPos--; + } else if (curChar == MESSAGE_ITEM_ICON) { + msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 1]; + PRINTF("ITEM_NO=(%d) (%d)\n", msgCtx->msgBufDecoded[decodedBufPos], + font->msgBuf[msgCtx->msgBufPos + 1]); + Message_LoadItemIcon(play, font->msgBuf[msgCtx->msgBufPos + 1], R_TEXTBOX_Y + 10); + } else if (curChar == MESSAGE_BACKGROUND) { + msgCtx->textboxBackgroundIdx = font->msgBuf[msgCtx->msgBufPos + 1] * 2; +#if OOT_VERSION < PAL_1_0 + //! @bug Wrong shift amounts cause textboxBackgroundForeColorIdx and textboxBackgroundBackColorIdx + //! to always be 0. Fortunately MESSAGE_BACKGROUND is only present in unused messages. + msgCtx->textboxBackgroundForeColorIdx = (font->msgBuf[msgCtx->msgBufPos + 2] & 0xF0) >> 12; + msgCtx->textboxBackgroundBackColorIdx = (font->msgBuf[msgCtx->msgBufPos + 2] & 0xF) >> 8; +#else + msgCtx->textboxBackgroundForeColorIdx = (font->msgBuf[msgCtx->msgBufPos + 2] & 0xF0) >> 4; + msgCtx->textboxBackgroundBackColorIdx = font->msgBuf[msgCtx->msgBufPos + 2] & 0xF; +#endif + msgCtx->textboxBackgroundYOffsetIdx = (font->msgBuf[msgCtx->msgBufPos + 3] & 0xF0) >> 4; + msgCtx->textboxBackgroundUnkArg = font->msgBuf[msgCtx->msgBufPos + 3] & 0xF; + DMA_REQUEST_SYNC(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, + (uintptr_t)_message_texture_staticSegmentRomStart + + msgCtx->textboxBackgroundIdx * MESSAGE_TEXTURE_STATIC_TEX_SIZE, + MESSAGE_TEXTURE_STATIC_TEX_SIZE, "../z_message_PAL.c", 1830); + DMA_REQUEST_SYNC(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE + MESSAGE_TEXTURE_STATIC_TEX_SIZE, + (uintptr_t)_message_texture_staticSegmentRomStart + + (msgCtx->textboxBackgroundIdx + 1) * MESSAGE_TEXTURE_STATIC_TEX_SIZE, + MESSAGE_TEXTURE_STATIC_TEX_SIZE, "../z_message_PAL.c", 1834); + msgCtx->msgBufPos += 3; + R_TEXTBOX_BG_YPOS = R_TEXTBOX_Y + 8; + numLines = 2; +#if OOT_PAL + R_TEXT_INIT_XPOS = 50; +#endif + } else if (curChar == MESSAGE_COLOR) { msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos]; - } else if (curChar == MESSAGE_TWO_CHOICE) { - msgCtx->choiceNum = 2; - } else if (curChar == MESSAGE_THREE_CHOICE) { - msgCtx->choiceNum = 3; - } else if (curChar != ' ') { - Font_LoadChar(font, curChar - ' ', charTexIdx); - charTexIdx += FONT_CHAR_TEX_SIZE; + } else if (curChar == MESSAGE_NEWLINE) { + numLines++; + } else if (curChar != MESSAGE_QUICKTEXT_ENABLE && curChar != MESSAGE_QUICKTEXT_DISABLE && + curChar != MESSAGE_AWAIT_BUTTON_PRESS && curChar != MESSAGE_OCARINA && + curChar != MESSAGE_PERSISTENT && curChar != MESSAGE_UNSKIPPABLE) { + if (curChar == MESSAGE_FADE) { + sTextFade = true; + PRINTF("NZ_TIMER_END (key_off_flag=%d)\n", sTextFade); + msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos]; + } else if (curChar == MESSAGE_FADE2) { + sTextFade = true; + PRINTF("NZ_BGM (key_off_flag=%d)\n", sTextFade); + msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos]; + msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos]; + } else if (curChar == MESSAGE_SHIFT || curChar == MESSAGE_TEXT_SPEED) { + msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos] & 0xFF; + } else if (curChar == MESSAGE_SFX) { + msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos]; + msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos]; + } else if (curChar == MESSAGE_TWO_CHOICE) { + msgCtx->choiceNum = 2; + } else if (curChar == MESSAGE_THREE_CHOICE) { + msgCtx->choiceNum = 3; + } else if (curChar != MESSAGE_CHAR_SPACE) { + Font_LoadChar(font, curChar - ' ', charTexIdx); + charTexIdx += FONT_CHAR_TEX_SIZE; + } } + decodedBufPos++; + msgCtx->msgBufPos++; } - decodedBufPos++; - msgCtx->msgBufPos++; } } @@ -1693,6 +2498,12 @@ void Message_OpenText(PlayState* play, u16 textId) { R_TEXT_LINE_SPACING = 6; R_TEXT_INIT_XPOS = 20; YREG(1) = 48; +#if OOT_NTSC + } else if (gSaveContext.language == LANGUAGE_JPN) { + R_TEXT_CHAR_SCALE = 88; + R_TEXT_LINE_SPACING = 18; + R_TEXT_INIT_XPOS = 50; +#endif } else { R_TEXT_CHAR_SCALE = 75; R_TEXT_LINE_SPACING = 12; @@ -1727,25 +2538,93 @@ void Message_OpenText(PlayState* play, u16 textId) { if (sTextIsCredits) { Message_FindCreditsMessage(play, textId); msgCtx->msgLength = font->msgLength; +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_60 != NULL) && B_80121220->unk_60(&play->msgCtx.font)) { + + } else { + DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_staff_message_data_staticSegmentRomStart + font->msgOffset, + font->msgLength); + } +#else DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_staff_message_data_staticSegmentRomStart + font->msgOffset, font->msgLength, "../z_message_PAL.c", 1954); +#endif } else { -#if OOT_PAL // TODO: implement NTSC version +#if OOT_NTSC + if (gSaveContext.language == LANGUAGE_JPN) { + Message_FindMessageJPN(play, textId); + msgCtx->msgLength = font->msgLength; +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_64 != NULL) && B_80121220->unk_64(&play->msgCtx.font)) { + + } else { + DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_jpn_message_data_staticSegmentRomStart + font->msgOffset, + font->msgLength); + } +#else + DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_jpn_message_data_staticSegmentRomStart + font->msgOffset, + font->msgLength); +#endif + } else { + Message_FindMessageNES(play, textId); + msgCtx->msgLength = font->msgLength; +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_68 != NULL) && B_80121220->unk_68(&play->msgCtx.font)) { + + } else { + DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, + font->msgLength); + } +#else + DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, + font->msgLength); +#endif + } +#else if (gSaveContext.language == LANGUAGE_ENG) { - Message_FindMessage(play, textId); + Message_FindMessagePAL(play, textId); msgCtx->msgLength = font->msgLength; +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_64 != NULL) && B_80121220->unk_64(&play->msgCtx.font)) { + + } else { + DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, + font->msgLength); + } +#else DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, font->msgLength, "../z_message_PAL.c", 1966); +#endif } else if (gSaveContext.language == LANGUAGE_GER) { - Message_FindMessage(play, textId); + Message_FindMessagePAL(play, textId); msgCtx->msgLength = font->msgLength; +#if PLATFORM_N64 + //! @bug checks unk_64 != NULL instead of unk_68 != NULL + if ((B_80121220 != NULL) && (B_80121220->unk_64 != NULL) && B_80121220->unk_68(&play->msgCtx.font)) { + + } else { + DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_ger_message_data_staticSegmentRomStart + font->msgOffset, + font->msgLength); + } +#else DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_ger_message_data_staticSegmentRomStart + font->msgOffset, font->msgLength, "../z_message_PAL.c", 1978); +#endif } else { - Message_FindMessage(play, textId); + Message_FindMessagePAL(play, textId); msgCtx->msgLength = font->msgLength; +#if PLATFORM_N64 + //! @bug checks unk_64 != NULL instead of unk_6C_PAL != NULL + if ((B_80121220 != NULL) && (B_80121220->unk_64 != NULL) && B_80121220->unk_6C_PAL(&play->msgCtx.font)) { + + } else { + DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_fra_message_data_staticSegmentRomStart + font->msgOffset, + font->msgLength); + } +#else DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_fra_message_data_staticSegmentRomStart + font->msgOffset, font->msgLength, "../z_message_PAL.c", 1990); +#endif } #endif } @@ -1753,8 +2632,7 @@ void Message_OpenText(PlayState* play, u16 textId) { msgCtx->textBoxType = msgCtx->textBoxProperties >> 4; msgCtx->textBoxPos = msgCtx->textBoxProperties & 0xF; textBoxType = msgCtx->textBoxType; - // "Text Box Type" - PRINTF("吹き出し種類=%d\n", msgCtx->textBoxType); + PRINTF(T("吹き出し種類=%d\n", "Text Box Type = %d\n"), msgCtx->textBoxType); if (textBoxType < TEXTBOX_TYPE_NONE_BOTTOM) { DMA_REQUEST_SYNC(msgCtx->textboxSegment, (uintptr_t)_message_staticSegmentRomStart + @@ -1794,8 +2672,7 @@ void Message_StartTextbox(PlayState* play, u16 textId, Actor* actor) { MessageContext* msgCtx = &play->msgCtx; PRINTF(VT_FGCOL(BLUE)); - // "Message" - PRINTF("めっせーじ=%x(%d)\n", textId, actor); + PRINTF(T("めっせーじ=%x(%d)\n", "Message=%x(%d)\n"), textId, actor); PRINTF(VT_RST); msgCtx->ocarinaAction = 0xFFFF; @@ -1810,10 +2687,12 @@ void Message_StartTextbox(PlayState* play, u16 textId, Actor* actor) { void Message_ContinueTextbox(PlayState* play, u16 textId) { s32 pad; MessageContext* msgCtx = &play->msgCtx; +#if PLATFORM_N64 + s32 pad2[3]; +#endif PRINTF(VT_FGCOL(GREEN)); - // "Message" - PRINTF("めっせーじ=%x message->msg_data\n", textId, msgCtx->msgLength); + PRINTF(T("めっせーじ=%x message->msg_data\n", "Message=%x message->msg_data\n"), textId, msgCtx->msgLength); PRINTF(VT_RST); msgCtx->msgLength = 0; @@ -1875,8 +2754,8 @@ void Message_StartOcarinaImpl(PlayState* play, u16 ocarinaActionId) { Message_ResetOcarinaNoteState(); sLastPlayedSong = msgCtx->unk_E3F2 = msgCtx->lastOcarinaButtonIndex = 0xFF; - // "Ocarina Number" - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ オカリナ番号=%d(%d) ☆☆☆☆☆\n" VT_RST, ocarinaActionId, 2); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ オカリナ番号=%d(%d) ☆☆☆☆☆\n", "☆☆☆☆☆ Ocarina Number = %d(%d) ☆☆☆☆☆\n") VT_RST, + ocarinaActionId, 2); noStopDoAction = false; if (ocarinaActionId >= 0x893) { Message_OpenText(play, ocarinaActionId); // You played the [song name] @@ -1913,8 +2792,7 @@ void Message_StartOcarinaImpl(PlayState* play, u16 ocarinaActionId) { } } msgCtx->talkActor = NULL; - // "Ocarina Mode" - PRINTF("オカリナモード = %d (%x)\n", msgCtx->ocarinaAction, textId); + PRINTF(T("オカリナモード = %d (%x)\n", "Ocarina Mode = %d (%x)\n"), msgCtx->ocarinaAction, textId); msgCtx->textDelayTimer = 0; play->msgCtx.ocarinaMode = OCARINA_MODE_00; R_TEXTBOX_X = 34; @@ -1937,8 +2815,7 @@ void Message_StartOcarinaImpl(PlayState* play, u16 ocarinaActionId) { Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_B_ALT); gSaveContext.hudVisibilityMode = noStopDoAction; } - // "Music Performance Start" - PRINTF("演奏開始\n"); + PRINTF(T("演奏開始\n", "Music Performance Start\n")); if (ocarinaActionId == OCARINA_ACTION_FREE_PLAY || ocarinaActionId == OCARINA_ACTION_CHECK_NOWARP) { msgCtx->msgMode = MSGMODE_OCARINA_STARTING; msgCtx->textBoxType = 0x63; @@ -1950,8 +2827,8 @@ void Message_StartOcarinaImpl(PlayState* play, u16 ocarinaActionId) { Message_Decode(play); msgCtx->msgMode = MSGMODE_MEMORY_GAME_START; } else if (ocarinaActionId == OCARINA_ACTION_SCARECROW_LONG_PLAYBACK) { - // "?????Recording Playback / Recording Playback / Recording Playback / Recording Playback -> " - PRINTF("?????録音再生 録音再生 録音再生 録音再生 -> "); + PRINTF(T("?????録音再生 録音再生 録音再生 録音再生 -> ", + "????? Recording Playback Recording Playback Recording Playback Recording Playback -> ")); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); msgCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); @@ -1964,8 +2841,8 @@ void Message_StartOcarinaImpl(PlayState* play, u16 ocarinaActionId) { gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING); } - for (k = 0, j = 0; j < 48; j++, k += 0x80) { - func_8006EE50(&play->msgCtx.font, 0x8140, k); + for (k = 0, j = 0; j < 48; j++, k += FONT_CHAR_TEX_SIZE) { + Font_LoadCharWide(&play->msgCtx.font, MESSAGE_WIDE_CHAR_SPACE, k); } } @@ -2063,6 +2940,14 @@ void Message_SetView(View* view) { View_ApplyOrthoToOverlay(view); } +#if OOT_NTSC +#define DRAW_TEXT(play, gfx, isCredits) \ + ((gSaveContext.language == LANGUAGE_JPN) && !(isCredits)) ? Message_DrawTextWide(play, gfx) \ + : Message_DrawText(play, gfx) +#else +#define DRAW_TEXT(play, gfx, isCredits) Message_DrawText(play, gfx) +#endif + /** * Draws the textbox in full and updates ocarina state */ @@ -2090,12 +2975,12 @@ void Message_DrawMain(PlayState* play, Gfx** p) { }; #else static s16 sOcarinaButtonAPrimColors[][3] = { - { 80, 255, 150 }, - { 100, 255, 200 }, + { OCARINA_BUTTON_A_PRIM_1_R, OCARINA_BUTTON_A_PRIM_1_G, OCARINA_BUTTON_A_PRIM_1_B }, + { OCARINA_BUTTON_A_PRIM_2_R, OCARINA_BUTTON_A_PRIM_2_G, OCARINA_BUTTON_A_PRIM_2_B }, }; static s16 sOcarinaButtonAEnvColors[][3] = { - { 10, 10, 10 }, - { 50, 255, 50 }, + { OCARINA_BUTTON_A_ENV_1_R, OCARINA_BUTTON_A_ENV_1_G, OCARINA_BUTTON_A_ENV_1_B }, + { OCARINA_BUTTON_A_ENV_2_R, OCARINA_BUTTON_A_ENV_2_G, OCARINA_BUTTON_A_ENV_2_B }, }; #endif static s16 sOcarinaButtonCPrimColors[][3] = { @@ -2153,19 +3038,19 @@ void Message_DrawMain(PlayState* play, Gfx** p) { break; case MSGMODE_TEXT_CONTINUING: if (msgCtx->stateTimer == 1) { - for (j = 0, i = 0; i < 48; i++, j += 0x80) { - func_8006EE50(&play->msgCtx.font, 0x8140, j); + for (j = 0, i = 0; i < 48; i++, j += FONT_CHAR_TEX_SIZE) { + Font_LoadCharWide(&play->msgCtx.font, MESSAGE_WIDE_CHAR_SPACE, j); } - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, sTextIsCredits); } break; case MSGMODE_TEXT_DISPLAYING: case MSGMODE_TEXT_DELAYED_BREAK: - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, sTextIsCredits); break; case MSGMODE_TEXT_AWAIT_INPUT: case MSGMODE_TEXT_AWAIT_NEXT: - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, sTextIsCredits); Message_DrawTextboxIcon(play, &gfx, R_TEXTBOX_END_XPOS, R_TEXTBOX_END_YPOS); break; case MSGMODE_OCARINA_STARTING: @@ -2188,8 +3073,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->ocarinaAction == OCARINA_ACTION_CHECK_NOWARP) { AudioOcarina_Start(sOcarinaSongBitFlags + 0xC000); } else { - // "On Stage Performance" - PRINTF("台上演奏\n"); + PRINTF(T("台上演奏\n", "On Stage Performance\n")); AudioOcarina_Start(sOcarinaSongBitFlags); } } else { @@ -2202,22 +3086,24 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->msgMode = MSGMODE_SONG_DEMONSTRATION_SELECT_INSTRUMENT; } else { AudioOcarina_Start((1 << (msgCtx->ocarinaAction - OCARINA_ACTION_PLAYBACK_MINUET)) + 0x8000); - // "Performance Check" - PRINTF("演奏チェック=%d\n", msgCtx->ocarinaAction - OCARINA_ACTION_PLAYBACK_MINUET); + PRINTF(T("演奏チェック=%d\n", "Performance Check = %d\n"), + msgCtx->ocarinaAction - OCARINA_ACTION_PLAYBACK_MINUET); msgCtx->msgMode = MSGMODE_SONG_PLAYBACK; } if (msgCtx->ocarinaAction != OCARINA_ACTION_FREE_PLAY && msgCtx->ocarinaAction != OCARINA_ACTION_CHECK_NOWARP) { - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, sTextIsCredits); } break; case MSGMODE_OCARINA_PLAYING: msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); if (msgCtx->ocarinaStaff->pos) { PRINTF("locate=%d onpu_pt=%d\n", msgCtx->ocarinaStaff->pos, sOcarinaButtonIndexBufPos); +#if OOT_VERSION >= PAL_1_0 if (msgCtx->ocarinaStaff->pos == 1 && sOcarinaButtonIndexBufPos == 8) { sOcarinaButtonIndexBufPos = 0; } +#endif if (sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) { msgCtx->lastOcarinaButtonIndex = sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->buttonIndex; @@ -2241,8 +3127,9 @@ void Message_DrawMain(PlayState* play, Gfx** p) { &gSfxDefaultReverb); msgCtx->msgMode = MSGMODE_OCARINA_STARTING; } else { - // "Ocarina_Flog Correct Example Performance" - PRINTF("Ocarina_Flog 正解模範演奏=%x\n", msgCtx->lastPlayedSong); + PRINTF(T("Ocarina_Flog 正解模範演奏=%x\n", + "Ocarina_Flog Correct Example Performance = %x\n"), + msgCtx->lastPlayedSong); Message_ContinueTextbox(play, 0x86F); // Ocarina msgCtx->msgMode = MSGMODE_SONG_PLAYED; msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA; @@ -2261,8 +3148,9 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->stateTimer = 10; msgCtx->msgMode = MSGMODE_OCARINA_FAIL; } else { - // "Ocarina_Flog Correct Example Performance" - PRINTF("Ocarina_Flog 正解模範演奏=%x\n", msgCtx->lastPlayedSong); + PRINTF(T("Ocarina_Flog 正解模範演奏=%x\n", + "Ocarina_Flog Correct Example Performance = %x\n"), + msgCtx->lastPlayedSong); Message_ContinueTextbox(play, 0x86F); // Ocarina msgCtx->msgMode = MSGMODE_SONG_PLAYED; msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA; @@ -2273,8 +3161,9 @@ void Message_DrawMain(PlayState* play, Gfx** p) { Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING); } } else if (msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY) { - // "Ocarina_Free Correct Example Performance" - PRINTF("Ocarina_Free 正解模範演奏=%x\n", msgCtx->lastPlayedSong); + PRINTF( + T("Ocarina_Free 正解模範演奏=%x\n", "Ocarina_Free Correct Example Performance = %x\n"), + msgCtx->lastPlayedSong); Message_ContinueTextbox(play, 0x86F); // Ocarina msgCtx->msgMode = MSGMODE_SONG_PLAYED; msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA; @@ -2307,7 +3196,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { } if (msgCtx->ocarinaAction != OCARINA_ACTION_FREE_PLAY && msgCtx->ocarinaAction != OCARINA_ACTION_CHECK_NOWARP) { - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, sTextIsCredits); } break; case MSGMODE_OCARINA_CORRECT_PLAYBACK: @@ -2427,8 +3316,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { if (msgCtx->stateTimer == 0) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); if (msgCtx->msgMode == MSGMODE_OCARINA_CORRECT_PLAYBACK) { - // "Correct Example Performance" - PRINTF("正解模範演奏=%x\n", msgCtx->lastPlayedSong); + PRINTF(T("正解模範演奏=%x\n", "Correct Example Performance = %x\n"), msgCtx->lastPlayedSong); Message_ContinueTextbox(play, 0x86F); // Ocarina msgCtx->msgMode = MSGMODE_SONG_PLAYED; msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA; @@ -2448,27 +3336,25 @@ void Message_DrawMain(PlayState* play, Gfx** p) { play->msgCtx.ocarinaMode = OCARINA_MODE_03; } } - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); break; case MSGMODE_OCARINA_FAIL: case MSGMODE_SONG_PLAYBACK_FAIL: - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); FALLTHROUGH; case MSGMODE_OCARINA_FAIL_NO_TEXT: msgCtx->stateTimer--; if (msgCtx->stateTimer == 0) { R_OCARINA_BUTTONS_YPOS_OFFSET = 1; if (msgCtx->msgMode == MSGMODE_SONG_PLAYBACK_FAIL) { - // "kokokokokoko" - PRINTF("ここここここ\n"); + PRINTF(T("ここここここ\n", "Here here here\n")); Message_ContinueTextbox(play, 0x88B); // red X background Message_Decode(play); msgCtx->msgMode = MSGMODE_SONG_PLAYBACK_NOTES_DROP; } else { msgCtx->msgMode = MSGMODE_OCARINA_NOTES_DROP; } - // "Cancel" - PRINTF("キャンセル\n"); + PRINTF(T("キャンセル\n", "Cancel\n")); } break; case MSGMODE_OCARINA_NOTES_DROP: @@ -2514,7 +3400,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { } break; case MSGMODE_SETUP_DISPLAY_SONG_PLAYED: - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); AudioOcarina_SetPlaybackSong(msgCtx->lastPlayedSong + 1, 1); @@ -2535,8 +3421,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { case MSGMODE_SONG_DEMONSTRATION_SELECT_INSTRUMENT: msgCtx->stateTimer--; if (msgCtx->stateTimer == 0) { - // "ocarina_no=%d Song Chosen=%d" - PRINTF("ocarina_no=%d 選曲=%d\n", msgCtx->ocarinaAction, 0x16); + PRINTF(T("ocarina_no=%d 選曲=%d\n", "ocarina_no=%d Song Chosen=%d\n"), msgCtx->ocarinaAction, + 0x16); if (msgCtx->ocarinaAction < OCARINA_ACTION_TEACH_SARIA) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_HARP); } else if (msgCtx->ocarinaAction == OCARINA_ACTION_TEACH_EPONA) { @@ -2548,34 +3434,34 @@ void Message_DrawMain(PlayState* play, Gfx** p) { } else { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); } - // "Example Performance" - PRINTF("模範演奏=%x\n", msgCtx->ocarinaAction - OCARINA_ACTION_TEACH_MINUET); + PRINTF(T("模範演奏=%x\n", "Example Performance = %x\n"), + msgCtx->ocarinaAction - OCARINA_ACTION_TEACH_MINUET); AudioOcarina_SetPlaybackSong(msgCtx->ocarinaAction - OCARINA_ACTION_TEACH_MINUET + 1, 2); sOcarinaButtonIndexBufPos = 0; msgCtx->msgMode = MSGMODE_SONG_DEMONSTRATION; } - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); break; case MSGMODE_DISPLAY_SONG_PLAYED_TEXT_BEGIN: Message_ContinueTextbox(play, msgCtx->lastPlayedSong + 0x893); // You played [song name] Message_Decode(play); msgCtx->msgMode = MSGMODE_DISPLAY_SONG_PLAYED_TEXT; msgCtx->stateTimer = 20; - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); break; case MSGMODE_DISPLAY_SONG_PLAYED_TEXT: msgCtx->stateTimer--; if (msgCtx->stateTimer == 0) { msgCtx->msgMode = MSGMODE_SONG_PLAYED_ACT_BEGIN; } - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); break; case MSGMODE_SONG_PLAYED_ACT_BEGIN: AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); Message_ResetOcarinaNoteState(); msgCtx->msgMode = MSGMODE_SONG_PLAYED_ACT; msgCtx->stateTimer = 2; - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); break; case MSGMODE_SONG_PLAYED_ACT: msgCtx->stateTimer--; @@ -2655,7 +3541,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { } FALLTHROUGH; case MSGMODE_SONG_DEMONSTRATION_DONE: - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); break; case MSGMODE_SONG_PLAYBACK: msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); @@ -2672,8 +3558,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->msgMode = MSGMODE_SONG_PLAYBACK_SUCCESS; Item_Give(play, ITEM_SONG_MINUET + gOcarinaSongItemMap[msgCtx->ocarinaStaff->state]); PRINTF(VT_FGCOL(YELLOW)); - // "z_message.c Song Acquired" - PRINTF("z_message.c 取得メロディ=%d\n", ITEM_SONG_MINUET + msgCtx->ocarinaStaff->state); + PRINTF(T("z_message.c 取得メロディ=%d\n", "z_message.c Song Acquired = %d\n"), + ITEM_SONG_MINUET + msgCtx->ocarinaStaff->state); PRINTF(VT_RST); msgCtx->stateTimer = 20; Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, @@ -2684,17 +3570,16 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->stateTimer = 10; msgCtx->msgMode = MSGMODE_SONG_PLAYBACK_FAIL; } - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); break; case MSGMODE_OCARINA_AWAIT_INPUT: - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); if (Message_ShouldAdvance(play)) { Message_StartOcarina(play, msgCtx->ocarinaAction); } break; case MSGMODE_SCARECROW_LONG_RECORDING_START: - // "Scarecrow Recording Initialization" - PRINTF("案山子録音 初期化\n"); + PRINTF(T("案山子録音 初期化\n", "Scarecrow Recording Initialization\n")); AudioOcarina_SetRecordingState(OCARINA_RECORD_SCARECROW_LONG); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); msgCtx->ocarinaStaff = AudioOcarina_GetRecordingStaff(); @@ -2702,7 +3587,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { sOcarinaButtonIndexBufLen = 0; Message_ResetOcarinaNoteState(); msgCtx->msgMode = MSGMODE_SCARECROW_LONG_RECORDING_ONGOING; - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); break; case MSGMODE_SCARECROW_LONG_RECORDING_ONGOING: msgCtx->ocarinaStaff = AudioOcarina_GetRecordingStaff(); @@ -2715,8 +3600,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { } sOcarinaButtonIndexBufLen--; } - // "Button Entered" - PRINTF(" 入力ボタン【%d】=%d", sOcarinaButtonIndexBufLen, msgCtx->ocarinaStaff->buttonIndex); + PRINTF(T(" 入力ボタン【%d】=%d", " Button Entered[%d]=%d"), sOcarinaButtonIndexBufLen, + msgCtx->ocarinaStaff->buttonIndex); msgCtx->lastOcarinaButtonIndex = sOcarinaButtonIndexBuf[sOcarinaButtonIndexBufLen] = msgCtx->ocarinaStaff->buttonIndex; sOcarinaButtonIndexBufLen++; @@ -2729,8 +3614,9 @@ void Message_DrawMain(PlayState* play, Gfx** p) { if (msgCtx->ocarinaStaff->state == OCARINA_RECORD_OFF || CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B)) { if (sOcarinaButtonIndexBufLen != 0) { - // "Recording complete!!!!!!!!!" - PRINTF("録音終了!!!!!!!!! message->info->status=%d \n", msgCtx->ocarinaStaff->state); + PRINTF(T("録音終了!!!!!!!!! message->info->status=%d \n", + "Recording complete!!!!!!!!! message->info->status=%d \n"), + msgCtx->ocarinaStaff->state); gSaveContext.save.info.scarecrowLongSongSet = true; } Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, @@ -2740,8 +3626,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->stateTimer = 10; play->msgCtx.ocarinaMode = OCARINA_MODE_04; Message_CloseTextbox(play); - // "Recording complete!!!!!!!!!Recording Complete" - PRINTF("録音終了!!!!!!!!!録音終了\n"); + PRINTF( + T("録音終了!!!!!!!!!録音終了\n", "Recording complete!!!!!!!!! Recording Complete\n")); PRINTF(VT_FGCOL(YELLOW)); PRINTF("\n====================================================================\n"); MemCpy(gSaveContext.save.info.scarecrowLongSong, gScarecrowLongSongPtr, @@ -2752,7 +3638,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { PRINTF(VT_RST); PRINTF("\n====================================================================\n"); } - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); break; case MSGMODE_SCARECROW_LONG_PLAYBACK: case MSGMODE_SCARECROW_SPAWN_PLAYBACK: @@ -2789,7 +3675,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { AudioOcarina_SetRecordingState(OCARINA_RECORD_SCARECROW_SPAWN); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); msgCtx->msgMode = MSGMODE_SCARECROW_SPAWN_RECORDING_ONGOING; - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); break; case MSGMODE_SCARECROW_SPAWN_RECORDING_ONGOING: msgCtx->ocarinaStaff = AudioOcarina_GetRecordingStaff(); @@ -2801,8 +3687,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { sOcarinaButtonIndexBuf[sOcarinaButtonIndexBufPos] = OCARINA_BTN_INVALID; } if (msgCtx->ocarinaStaff->state == OCARINA_RECORD_OFF) { - // "8 Note Recording OK!" - PRINTF("8音録音OK!\n"); + PRINTF(T("8音録音OK!\n", "8 Note Recording OK!\n")); msgCtx->stateTimer = 20; gSaveContext.save.info.scarecrowSpawnSongSet = true; msgCtx->msgMode = MSGMODE_SCARECROW_SPAWN_RECORDING_DONE; @@ -2819,15 +3704,14 @@ void Message_DrawMain(PlayState* play, Gfx** p) { PRINTF("\n====================================================================\n"); } else if (msgCtx->ocarinaStaff->state == OCARINA_RECORD_REJECTED || CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B)) { - // "Played an existing song!!!" - PRINTF("すでに存在する曲吹いた!!! \n"); + PRINTF(T("すでに存在する曲吹いた!!! \n", "Played an existing song!!! \n")); AudioOcarina_SetRecordingState(OCARINA_RECORD_OFF); Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Message_CloseTextbox(play); msgCtx->msgMode = MSGMODE_SCARECROW_SPAWN_RECORDING_FAILED; } - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); break; case MSGMODE_SCARECROW_SPAWN_RECORDING_FAILED: PRINTF("cccccccccccc\n"); @@ -2893,22 +3777,20 @@ void Message_DrawMain(PlayState* play, Gfx** p) { sOcarinaButtonIndexBufPos++; } if (msgCtx->ocarinaStaff->state == 0xFF) { - // "Musical round failed!!!!!!!!!" - PRINTF("輪唱失敗!!!!!!!!!\n"); + PRINTF(T("輪唱失敗!!!!!!!!!\n", "Musical round failed!!!!!!!!!\n")); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->stateTimer = 10; play->msgCtx.ocarinaMode = OCARINA_MODE_03; } else if (msgCtx->ocarinaStaff->state == OCARINA_SONG_MEMORY_GAME) { - // "Musical round succeeded!!!!!!!!!" - PRINTF("輪唱成功!!!!!!!!!\n"); + PRINTF(T("輪唱成功!!!!!!!!!\n", "Musical round succeeded!!!!!!!!!\n")); Audio_PlaySfxGeneral(NA_SE_SY_GET_ITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->msgMode = MSGMODE_MEMORY_GAME_ROUND_SUCCESS; msgCtx->stateTimer = 30; } - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); break; case MSGMODE_MEMORY_GAME_ROUND_SUCCESS: msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); @@ -2931,7 +3813,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { play->msgCtx.ocarinaMode = OCARINA_MODE_0F; } } - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, false); break; case MSGMODE_MEMORY_GAME_START_NEXT_ROUND: if (!Audio_IsSfxPlaying(NA_SE_SY_METRONOME)) { @@ -2963,7 +3845,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { case MSGMODE_FROGS_WAITING: break; case MSGMODE_TEXT_DONE: - Message_DrawText(play, &gfx); + DRAW_TEXT(play, &gfx, sTextIsCredits); switch (msgCtx->textboxEndType) { case TEXTBOX_ENDTYPE_2_CHOICE: @@ -3037,7 +3919,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { if (1) {} if (sOcarinaButtonAlphaValues[i] != 255) { - sOcarinaButtonAlphaValues[i] += VREG(50); + sOcarinaButtonAlphaValues[i] += R_OCARINA_BUTTONS_APPEAR_ALPHA_STEP; if (sOcarinaButtonAlphaValues[i] >= 255) { sOcarinaButtonAlphaValues[i] = 255; } @@ -3151,8 +4033,6 @@ void Message_Draw(PlayState* play) { } #endif - if (1) {} - plusOne = Gfx_Open(polyOpaP = POLY_OPA_DISP); gSPDisplayList(OVERLAY_DISP++, plusOne); Message_DrawMain(play, &plusOne); @@ -3183,6 +4063,9 @@ void Message_Update(PlayState* play) { 0x0400, 0x0400, 0x0200, 0x0000, 0x1038, 0x0008, 0x200A, 0x088B, 0x0007, 0x0009, 0x000A, 0x107E, 0x2008, 0x2007, 0x0015, 0x0016, 0x0017, 0x0003, 0x0000, 0x270B, 0x00C8, 0x012C, 0x012D, 0xFFDA, 0x0014, 0x0016, 0x0014, 0x0016, }; +#if OOT_VERSION < GC_US + static s32 sUnknown = 0; +#endif static u8 D_80153D74 = 0; MessageContext* msgCtx = &play->msgCtx; InterfaceContext* interfaceCtx = &play->interfaceCtx; @@ -3193,6 +4076,12 @@ void Message_Update(PlayState* play) { s16 averageY; s16 playerFocusScreenPosY; s16 actorFocusScreenPosY; +#if OOT_VERSION < GC_US + s32 pad1; +#endif +#if OOT_NTSC && OOT_VERSION < GC_US + s32 pad2; +#endif if (ENABLE_FAST_TEXT) { sTextboxSkipped = true; @@ -3212,8 +4101,8 @@ void Message_Update(PlayState* play) { while (entry->textId != 0xFFFD) { if (entry->textId == R_MESSAGE_DEBUGGER_TEXTID) { - // "The message was found! !! !!" - PRINTF(" メッセージが,見つかった!!! = %x\n", R_MESSAGE_DEBUGGER_TEXTID); + PRINTF(T(" メッセージが,見つかった!!! = %x\n", "The message was found!!! = %x\n"), + R_MESSAGE_DEBUGGER_TEXTID); Message_StartTextbox(play, R_MESSAGE_DEBUGGER_TEXTID, NULL); R_MESSAGE_DEBUGGER_TEXTID++; R_MESSAGE_DEBUGGER_SELECT = 0; @@ -3295,9 +4184,22 @@ void Message_Update(PlayState* play) { R_TEXTBOX_X_TARGET = sTextboxXPositions[var]; R_TEXTBOX_END_YPOS = sTextboxEndIconYOffset[var] + R_TEXTBOX_Y_TARGET; +#if OOT_NTSC + if (gSaveContext.language == LANGUAGE_JPN && !sTextIsCredits) { + R_TEXT_CHOICE_YPOS(0) = R_TEXTBOX_Y_TARGET + 7; + R_TEXT_CHOICE_YPOS(1) = R_TEXTBOX_Y_TARGET + 25; + R_TEXT_CHOICE_YPOS(2) = R_TEXTBOX_Y_TARGET + 43; + + } else { + R_TEXT_CHOICE_YPOS(0) = R_TEXTBOX_Y_TARGET + 20; + R_TEXT_CHOICE_YPOS(1) = R_TEXTBOX_Y_TARGET + 32; + R_TEXT_CHOICE_YPOS(2) = R_TEXTBOX_Y_TARGET + 44; + } +#else R_TEXT_CHOICE_YPOS(0) = R_TEXTBOX_Y_TARGET + 20; R_TEXT_CHOICE_YPOS(1) = R_TEXTBOX_Y_TARGET + 32; R_TEXT_CHOICE_YPOS(2) = R_TEXTBOX_Y_TARGET + 44; +#endif PRINTF("message->msg_disp_type=%x\n", msgCtx->textBoxProperties & 0xF0); if (msgCtx->textBoxType == TEXTBOX_TYPE_NONE_BOTTOM || msgCtx->textBoxType == TEXTBOX_TYPE_NONE_NO_SHADOW) { @@ -3391,7 +4293,15 @@ void Message_Update(PlayState* play) { if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_HAS_NEXT) { Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); +#if OOT_NTSC + if (gSaveContext.language == LANGUAGE_JPN && !sTextIsCredits) { + Message_ContinueTextbox(play, msgCtx->msgBufDecodedWide[msgCtx->textDrawPos]); + } else { + Message_ContinueTextbox(play, sNextTextId); + } +#else Message_ContinueTextbox(play, sNextTextId); +#endif } else { Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -3457,7 +4367,7 @@ void Message_Update(PlayState* play) { // Later, if the ocarina has not been played and another textbox is closed, this handling // for Saria's song will be carried out. player->naviTextId = -0xE0; - player->naviActor->flags |= ACTOR_FLAG_16; + player->naviActor->flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } if (msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY_DONE && (play->msgCtx.ocarinaMode == OCARINA_MODE_01 || play->msgCtx.ocarinaMode == OCARINA_MODE_0B)) { @@ -3490,4 +4400,15 @@ void Message_SetTables(void) { #endif sStaffMessageEntryTablePtr = sStaffMessageEntryTable; + +#if PLATFORM_N64 && OOT_NTSC + if ((B_80121220 != NULL) && (B_80121220->unk_58 != NULL)) { + B_80121220->unk_58(&sJpnMessageEntryTablePtr, &sNesMessageEntryTablePtr, &sStaffMessageEntryTablePtr); + } +#elif PLATFORM_N64 && OOT_PAL + if ((B_80121220 != NULL) && (B_80121220->unk_58 != NULL)) { + B_80121220->unk_58(&sNesMessageEntryTablePtr, &sGerMessageEntryTablePtr, &sFraMessageEntryTablePtr, + &sStaffMessageEntryTablePtr); + } +#endif } diff --git a/src/code/z_olib.c b/src/code/z_olib.c index c1f93a0522..298f151e2c 100644 --- a/src/code/z_olib.c +++ b/src/code/z_olib.c @@ -1,5 +1,5 @@ #include "z64math.h" -#include "fp_math.h" +#include "libc64/math64.h" #include "z_lib.h" /** diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c index f8c5690078..1250bb4fe5 100644 --- a/src/code/z_onepointdemo.c +++ b/src/code/z_onepointdemo.c @@ -1,6 +1,7 @@ #include "global.h" #include "quake.h" #include "terminal.h" +#include "versions.h" #include "overlays/actors/ovl_En_Sw/z_en_sw.h" static s16 sDisableAttention = false; @@ -1858,7 +1859,9 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_RequestCameraSetting(play, subCamId, CAM_SET_CS_3); Player_SetCsActionWithHaltedActors(play, &player->actor, PLAYER_CSACTION_5); OnePointCutscene_SetCsCamPoints(subCam, D_80120304 | 0x2000, D_80120300, D_8012013C, D_8012021C); +#if OOT_VERSION >= PAL_1_0 Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); +#endif OnePointCutscene_Vec3sToVec3f(&mainCam->at, &D_8012013C[D_801202FC - 2].pos); OnePointCutscene_Vec3sToVec3f(&mainCam->eye, &D_8012021C[D_801202FC - 2].pos); D_8012013C[D_801202FC - 3].pos.x += @@ -1874,10 +1877,22 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act D_8012021C[D_801202FC - 3].pos.z += (D_8012021C[D_801202FC - 2].pos.z - D_8012021C[D_801202FC - 3].pos.z) / 2; +#if OOT_VERSION < PAL_1_0 + i = Quake_Request(subCam, QUAKE_TYPE_1); + Quake_SetSpeed(i, 30000); + Quake_SetPerturbations(i, 3, 1, 1, 0); + Quake_SetDuration(i, D_80120300); + + i = Quake_Request(mainCam, QUAKE_TYPE_3); + Quake_SetSpeed(i, 30000); + Quake_SetPerturbations(i, 3, 1, 1, 0); + Quake_SetDuration(i, D_80120300 + 50); +#else i = Quake_Request(mainCam, QUAKE_TYPE_3); Quake_SetSpeed(i, 30000); Quake_SetPerturbations(i, 2, 1, 1, 0); Quake_SetDuration(i, 200); +#endif break; } diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 22a2003ac2..a0a1580ebe 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -1,10 +1,11 @@ #include "global.h" #include "terminal.h" +#include "versions.h" #include "assets/textures/parameter_static/parameter_static.h" #include "assets/textures/do_action_static/do_action_static.h" #include "assets/textures/icon_item_static/icon_item_static.h" -typedef struct { +typedef struct RestrictionFlags { /* 0x00 */ u8 sceneId; /* 0x01 */ u8 flags1; /* 0x02 */ u8 flags2; @@ -634,7 +635,7 @@ void Interface_UpdateHudAlphas(PlayState* play, s16 dimmingAlpha) { break; } - if ((play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_1) && (interfaceCtx->minimapAlpha >= 255)) { + if ((play->roomCtx.curRoom.type == ROOM_TYPE_DUNGEON) && (interfaceCtx->minimapAlpha >= 255)) { interfaceCtx->minimapAlpha = 255; } } @@ -1116,8 +1117,9 @@ void Interface_SetSceneRestrictions(PlayState* play) { interfaceCtx->restrictions.bButton = 0; interfaceCtx->restrictions.hGauge = 0; - // "Data settings related to button display scene_data_ID=%d\n" - PRINTF("ボタン表示関係データ設定 scene_data_ID=%d\n", play->sceneId); + PRINTF( + T("ボタン表示関係データ設定 scene_data_ID=%d\n", "Data settings related to button display scene_data_ID=%d\n"), + play->sceneId); do { sceneId = (u8)play->sceneId; @@ -1386,7 +1388,7 @@ u8 Item_Give(PlayState* play, u8 item) { gSaveContext.save.info.inventory.questItems |= gBitFlags[item - ITEM_MEDALLION_FOREST + QUEST_MEDALLION_FOREST]; PRINTF(VT_FGCOL(YELLOW)); - PRINTF("封印 = %x\n", gSaveContext.save.info.inventory.questItems); // "Seals = %x" + PRINTF(T("封印 = %x\n", "Seals = %x\n"), gSaveContext.save.info.inventory.questItems); PRINTF(VT_RST); if (item == ITEM_MEDALLION_WATER) { @@ -1398,10 +1400,10 @@ u8 Item_Give(PlayState* play, u8 item) { gSaveContext.save.info.inventory.questItems |= gBitFlags[item - ITEM_SONG_MINUET + QUEST_SONG_MINUET]; PRINTF(VT_FGCOL(YELLOW)); - PRINTF("楽譜 = %x\n", gSaveContext.save.info.inventory.questItems); // "Musical scores = %x" - // "Musical scores = %x (%x) (%x)" - PRINTF("楽譜 = %x (%x) (%x)\n", gSaveContext.save.info.inventory.questItems, - gBitFlags[item - ITEM_SONG_MINUET + QUEST_SONG_MINUET], gBitFlags[item - ITEM_SONG_MINUET]); + PRINTF(T("楽譜 = %x\n", "Musical scores = %x\n"), gSaveContext.save.info.inventory.questItems); + PRINTF(T("楽譜 = %x (%x) (%x)\n", "Musical scores = %x (%x) (%x)\n"), + gSaveContext.save.info.inventory.questItems, gBitFlags[item - ITEM_SONG_MINUET + QUEST_SONG_MINUET], + gBitFlags[item - ITEM_SONG_MINUET]); PRINTF(VT_RST); return ITEM_NONE; @@ -1409,7 +1411,7 @@ u8 Item_Give(PlayState* play, u8 item) { gSaveContext.save.info.inventory.questItems |= gBitFlags[item - ITEM_KOKIRI_EMERALD + QUEST_KOKIRI_EMERALD]; PRINTF(VT_FGCOL(YELLOW)); - PRINTF("精霊石 = %x\n", gSaveContext.save.info.inventory.questItems); // "Spiritual Stones = %x" + PRINTF(T("精霊石 = %x\n", "Spiritual Stones = %x\n"), gSaveContext.save.info.inventory.questItems); PRINTF(VT_RST); return ITEM_NONE; @@ -1417,7 +1419,7 @@ u8 Item_Give(PlayState* play, u8 item) { gSaveContext.save.info.inventory.questItems |= gBitFlags[item - ITEM_STONE_OF_AGONY + QUEST_STONE_OF_AGONY]; PRINTF(VT_FGCOL(YELLOW)); - PRINTF("アイテム = %x\n", gSaveContext.save.info.inventory.questItems); // "Items = %x" + PRINTF(T("アイテム = %x\n", "Items = %x\n"), gSaveContext.save.info.inventory.questItems); PRINTF(VT_RST); return ITEM_NONE; @@ -1426,8 +1428,7 @@ u8 Item_Give(PlayState* play, u8 item) { gSaveContext.save.info.inventory.gsTokens++; PRINTF(VT_FGCOL(YELLOW)); - // "N Coins = %x(%d)" - PRINTF("Nコイン = %x(%d)\n", gSaveContext.save.info.inventory.questItems, + PRINTF(T("Nコイン = %x(%d)\n", "N Coins = %x(%d)\n"), gSaveContext.save.info.inventory.questItems, gSaveContext.save.info.inventory.gsTokens); PRINTF(VT_RST); @@ -1618,9 +1619,8 @@ u8 Item_Give(PlayState* play, u8 item) { if (gSaveContext.save.info.inventory.items[slot] == ITEM_NONE) { Inventory_ChangeUpgrade(UPG_DEKU_NUTS, 1); AMMO(ITEM_DEKU_NUT) += sAmmoRefillCounts[item - ITEM_DEKU_NUTS_5]; - // "Deku Nuts %d(%d)=%d BS_count=%d" - PRINTF("デクの実 %d(%d)=%d BS_count=%d\n", item, ITEM_DEKU_NUTS_5, item - ITEM_DEKU_NUTS_5, - sAmmoRefillCounts[item - ITEM_DEKU_NUTS_5]); + PRINTF(T("デクの実 %d(%d)=%d BS_count=%d\n", "Deku Nuts %d(%d)=%d BS_count=%d\n"), item, ITEM_DEKU_NUTS_5, + item - ITEM_DEKU_NUTS_5, sAmmoRefillCounts[item - ITEM_DEKU_NUTS_5]); } else { AMMO(ITEM_DEKU_NUT) += sAmmoRefillCounts[item - ITEM_DEKU_NUTS_5]; if (AMMO(ITEM_DEKU_NUT) > CUR_CAPACITY(UPG_DEKU_NUTS)) { @@ -1629,8 +1629,7 @@ u8 Item_Give(PlayState* play, u8 item) { } item = ITEM_DEKU_NUT; } else if (item == ITEM_BOMB) { - // "Bomb Bomb Bomb Bomb Bomb Bomb Bomb" - PRINTF(" 爆弾 爆弾 爆弾 爆弾 爆弾 爆弾 爆弾 \n"); + PRINTF(T(" 爆弾 爆弾 爆弾 爆弾 爆弾 爆弾 爆弾 \n", "Bomb Bomb Bomb Bomb Bomb Bomb Bomb\n")); if ((AMMO(ITEM_BOMB) += 1) > CUR_CAPACITY(UPG_BOMB_BAG)) { AMMO(ITEM_BOMB) = CUR_CAPACITY(UPG_BOMB_BAG); } @@ -1671,7 +1670,7 @@ u8 Item_Give(PlayState* play, u8 item) { AMMO(ITEM_BOW) = CUR_CAPACITY(UPG_QUIVER); } - PRINTF("%d本 Item_MaxGet=%d\n", AMMO(ITEM_BOW), CUR_CAPACITY(UPG_QUIVER)); + PRINTF(T("%d本 Item_MaxGet=%d\n", "%d books Item_MaxGet=%d\n"), AMMO(ITEM_BOW), CUR_CAPACITY(UPG_QUIVER)); return ITEM_BOW; } else if (item == ITEM_SLINGSHOT) { @@ -1735,16 +1734,20 @@ u8 Item_Give(PlayState* play, u8 item) { gSaveContext.save.info.playerData.health += 0x10; return ITEM_NONE; } else if (item == ITEM_RECOVERY_HEART) { - PRINTF("回復ハート回復ハート回復ハート\n"); // "Recovery Heart" + PRINTF(T("回復ハート回復ハート回復ハート\n", "Recovery Heart Recovery Heart Recovery Heart\n")); Health_ChangeBy(play, 0x10); return item; } else if (item == ITEM_MAGIC_JAR_SMALL) { + // Magic_Fill is only used to store the magicState. + // Setting the state to FILL gets immediately overwritten in Magic_RequestChange. + // I.e. magic is added not filled. +#if OOT_VERSION < PAL_1_0 + Magic_Fill(play); +#else if (gSaveContext.magicState != MAGIC_STATE_ADD) { - // This function is only used to store the magicState. - // Setting the state to FILL gets immediately overwritten in Magic_RequestChange. - // I.e. magic is added not filled Magic_Fill(play); } +#endif Magic_RequestChange(play, 12, MAGIC_ADD); @@ -1755,12 +1758,16 @@ u8 Item_Give(PlayState* play, u8 item) { return item; } else if (item == ITEM_MAGIC_JAR_BIG) { + // Magic_Fill is only used to store the magicState. + // Setting the state to FILL gets immediately overwritten in Magic_RequestChange. + // I.e. magic is added not filled. +#if OOT_VERSION < PAL_1_0 + Magic_Fill(play); +#else if (gSaveContext.magicState != MAGIC_STATE_ADD) { - // This function is only used to store the magicState. - // Setting the state to FILL gets immediately overwritten in Magic_RequestChange. - // I.e. magic is added not filled. Magic_Fill(play); } +#endif Magic_RequestChange(play, 24, MAGIC_ADD); @@ -1793,8 +1800,8 @@ u8 Item_Give(PlayState* play, u8 item) { for (i = 0; i < 4; i++) { if (gSaveContext.save.info.inventory.items[temp + i] == ITEM_BOTTLE_EMPTY) { - // "Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d Empty Bottle=%d Content=%d" - PRINTF("Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d 空瓶=%d 中味=%d\n", + PRINTF(T("Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d 空瓶=%d 中味=%d\n", + "Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d Empty Bottle=%d Content=%d\n"), gSaveContext.save.info.equips.cButtonSlots[0], gSaveContext.save.info.equips.cButtonSlots[1], gSaveContext.save.info.equips.cButtonSlots[2], temp + i, item); @@ -1944,8 +1951,8 @@ u8 Item_CheckObtainability(u8 item) { } else if (item == ITEM_RECOVERY_HEART) { return ITEM_RECOVERY_HEART; } else if ((item == ITEM_MAGIC_JAR_SMALL) || (item == ITEM_MAGIC_JAR_BIG)) { - // "Magic Pot Get_Inf_Table( 25, 0x0100)=%d" - PRINTF("魔法の壷 Get_Inf_Table( 25, 0x0100)=%d\n", GET_INFTABLE(INFTABLE_198)); + PRINTF(T("魔法の壷 Get_Inf_Table( 25, 0x0100)=%d\n", "Magic Pot Get_Inf_Table( 25, 0x0100)=%d\n"), + GET_INFTABLE(INFTABLE_198)); if (!GET_INFTABLE(INFTABLE_198)) { return ITEM_NONE; } else { @@ -2008,7 +2015,7 @@ s32 Inventory_ReplaceItem(PlayState* play, u16 oldItem, u16 newItem) { for (i = 0; i < ARRAY_COUNT(gSaveContext.save.info.inventory.items); i++) { if (gSaveContext.save.info.inventory.items[i] == oldItem) { gSaveContext.save.info.inventory.items[i] = newItem; - PRINTF("アイテム消去(%d)\n", i); // "Item Purge (%d)" + PRINTF(T("アイテム消去(%d)\n", "Item Purge (%d)\n"), i); for (i = 1; i < 4; i++) { if (gSaveContext.save.info.equips.buttonItems[i] == oldItem) { gSaveContext.save.info.equips.buttonItems[i] = newItem; @@ -2084,7 +2091,7 @@ s32 Inventory_ConsumeFairy(PlayState* play) { break; } } - PRINTF("妖精使用=%d\n", bottleSlot); // "Fairy Usage=%d" + PRINTF(T("妖精使用=%d\n", "Fairy Usage=%d\n"), bottleSlot); gSaveContext.save.info.inventory.items[bottleSlot + i] = ITEM_BOTTLE_EMPTY; return true; } @@ -2116,12 +2123,19 @@ void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 l action += DO_ACTION_MAX; } +#if OOT_VERSION >= PAL_1_0 if (gSaveContext.language == 2) { // LANGUAGE_FRA for PAL versions action += DO_ACTION_MAX; } +#endif - if ((action != DO_ACTION_NONE) && (action != DO_ACTION_MAX + DO_ACTION_NONE) && - (action != 2 * DO_ACTION_MAX + DO_ACTION_NONE)) { +#if OOT_VERSION < PAL_1_0 + if ((action != 0 * DO_ACTION_MAX + DO_ACTION_NONE) && (action != 1 * DO_ACTION_MAX + DO_ACTION_NONE)) +#else + if ((action != 0 * DO_ACTION_MAX + DO_ACTION_NONE) && (action != 1 * DO_ACTION_MAX + DO_ACTION_NONE) && + (action != 2 * DO_ACTION_MAX + DO_ACTION_NONE)) +#endif + { osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1); DMA_REQUEST_ASYNC(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE), @@ -2180,9 +2194,11 @@ void Interface_LoadActionLabelB(PlayState* play, u16 action) { action += DO_ACTION_MAX; } +#if OOT_VERSION >= PAL_1_0 if (gSaveContext.language == 2) { // LANGUAGE_FRA for PAL versions action += DO_ACTION_MAX; } +#endif interfaceCtx->unk_1FC = action; @@ -2202,16 +2218,15 @@ s32 Health_ChangeBy(PlayState* play, s16 amount) { u16 heartCount; u16 healthLevel; - // "***** Fluctuation=%d (now=%d, max=%d) ***" - PRINTF("***** 増減=%d (now=%d, max=%d) ***", amount, gSaveContext.save.info.playerData.health, - gSaveContext.save.info.playerData.healthCapacity); + PRINTF(T("***** 増減=%d (now=%d, max=%d) ***", "***** Fluctuation=%d (now=%d, max=%d) ***"), amount, + gSaveContext.save.info.playerData.health, gSaveContext.save.info.playerData.healthCapacity); // clang-format off if (amount > 0) { Audio_PlaySfxGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (gSaveContext.save.info.playerData.isDoubleDefenseAcquired && (amount < 0)) { amount >>= 1; - PRINTF("ハート減少半分!!=%d\n", amount); // "Heart decrease halved!!=%d" + PRINTF(T("ハート減少半分!!=%d\n", "Heart decrease halved!! = %d\n"), amount); } // clang-format on @@ -2234,8 +2249,8 @@ s32 Health_ChangeBy(PlayState* play, s16 amount) { } } - // "Life=%d *** %d ******" - PRINTF(" ライフ=%d *** %d ******\n", gSaveContext.save.info.playerData.health, healthLevel); + PRINTF(T(" ライフ=%d *** %d ******\n", " Life=%d *** %d ******\n"), + gSaveContext.save.info.playerData.health, healthLevel); if (gSaveContext.save.info.playerData.health <= 0) { gSaveContext.save.info.playerData.health = 0; @@ -2254,8 +2269,8 @@ void Rupees_ChangeBy(s16 rupeeChange) { } void Inventory_ChangeAmmo(s16 item, s16 ammoChange) { - // "Item = (%d) Amount = (%d + %d)" - PRINTF("アイテム = (%d) 数 = (%d + %d) ", item, AMMO(item), ammoChange); + PRINTF(T("アイテム = (%d) 数 = (%d + %d) ", "Item = (%d) Amount = (%d + %d) "), item, AMMO(item), + ammoChange); if (item == ITEM_DEKU_STICK) { AMMO(ITEM_DEKU_STICK) += ammoChange; @@ -2309,7 +2324,7 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange) { AMMO(ITEM_MAGIC_BEAN) += ammoChange; } - PRINTF("合計 = (%d)\n", AMMO(item)); // "Total = (%d)" + PRINTF(T("合計 = (%d)\n", "Total = (%d)\n"), AMMO(item)); } void Magic_Fill(PlayState* play) { @@ -2485,8 +2500,8 @@ void Magic_Update(PlayState* play) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - // "Storage MAGIC_NOW=%d (%d)" - PRINTF("蓄電 MAGIC_NOW=%d (%d)\n", gSaveContext.save.info.playerData.magic, gSaveContext.magicFillTarget); + PRINTF(T("蓄電 MAGIC_NOW=%d (%d)\n", "Storage MAGIC_NOW=%d (%d)\n"), + gSaveContext.save.info.playerData.magic, gSaveContext.magicFillTarget); if (gSaveContext.save.info.playerData.magic >= gSaveContext.magicFillTarget) { gSaveContext.save.info.playerData.magic = gSaveContext.magicFillTarget; @@ -2797,7 +2812,9 @@ void Interface_DrawActionLabel(GraphicsContext* gfxCtx, void* texture) { void Interface_DrawItemButtons(PlayState* play) { static void* cUpLabelTextures[] = LANGUAGE_ARRAY(gNaviCUpJPNTex, gNaviCUpENGTex, gNaviCUpENGTex, gNaviCUpENGTex); +#if OOT_VERSION >= PAL_1_0 static s16 startButtonLeftPos[] = { 132, 130, 130 }; +#endif InterfaceContext* interfaceCtx = &play->interfaceCtx; Player* player = GET_PLAYER(play); PauseContext* pauseCtx = &play->pauseCtx; @@ -2847,19 +2864,19 @@ void Interface_DrawItemButtons(PlayState* play) { if (!IS_PAUSE_STATE_GAMEOVER(pauseCtx)) { if (IS_PAUSED(&play->pauseCtx)) { - Color_RGB8 startBtnRGB = { 120, 120, 120 }; - // Start Button Texture, Color & Label gDPPipeSync(OVERLAY_DISP++); - if (N64_BTN_COLORS) { - startBtnRGB.r = 200; - startBtnRGB.g = startBtnRGB.b = 0; - } - -#if OOT_NTSC + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, START_BUTTON_R, START_BUTTON_G, START_BUTTON_B, + interfaceCtx->startAlpha); + +#if OOT_VERSION < PAL_1_0 + gSPTextureRectangle(OVERLAY_DISP++, R_START_BTN_X << 2, R_START_BTN_Y << 2, (R_START_BTN_X + 22) << 2, + (R_START_BTN_Y + 22) << 2, G_TX_RENDERTILE, 0, 0, (s32)(1.4277344 * (1 << 10)), + (s32)(1.4277344 * (1 << 10))); +#elif OOT_NTSC // TODO: widescreen stuff for NTSC - gSPTextureRectangle(OVERLAY_DISP++, 132 << 2, 17 << 2, (132 + 22) << 2, 39 << 2, G_TX_RENDERTILE, 0, 0, - (s32)(1.4277344 * (1 << 10)), (s32)(1.4277344 * (1 << 10))); + gSPTextureRectangle(OVERLAY_DISP++, 132 << 2, 17 << 2, (132 + 22) << 2, (17 + 22) << 2, G_TX_RENDERTILE, 0, + 0, (s32)(1.4277344 * (1 << 10)), (s32)(1.4277344 * (1 << 10))); #else gSPTextureRectangle( OVERLAY_DISP++, @@ -3062,7 +3079,7 @@ void Interface_DrawActionButton(PlayState* play) { Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); - gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_parameter.c", 3177), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(OVERLAY_DISP++, play->state.gfxCtx, "../z_parameter.c", 3177); gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[0], 4, 0); gDPLoadTextureBlock(OVERLAY_DISP++, gButtonBackgroundTex, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, @@ -3335,9 +3352,9 @@ void Interface_Draw(PlayState* play) { } svar2 = rupeeDigitsFirst[CUR_UPG_VALUE(UPG_WALLET)]; - svar5 = rupeeDigitsCount[CUR_UPG_VALUE(UPG_WALLET)]; + svar4 = rupeeDigitsCount[CUR_UPG_VALUE(UPG_WALLET)]; - for (svar1 = 0, svar3 = 42; svar1 < svar5; svar1++, svar2++, svar3 += 8) { + for (svar1 = 0, svar3 = 42; svar1 < svar4; svar1++, svar2++, svar3 += 8) { OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * interfaceCtx->counterDigits[svar2])), 8, 16, svar3, 206, 8, 16, 1 << 10, 1 << 10); @@ -3348,7 +3365,7 @@ void Interface_Draw(PlayState* play) { if ((R_PAUSE_BG_PRERENDER_STATE != PAUSE_BG_PRERENDER_PROCESS) && (R_PAUSE_BG_PRERENDER_STATE != PAUSE_BG_PRERENDER_READY)) { - func_8002C124(&play->actorCtx.targetCtx, play); // Draw Z-Target + Attention_Draw(&play->actorCtx.attention, play); } Gfx_SetupDL_39Overlay(play->state.gfxCtx); @@ -3451,8 +3468,7 @@ void Interface_Draw(PlayState* play) { Matrix_Translate(0.0f, 0.0f, R_A_LABEL_Z(gSaveContext.language) / 10.0f, MTXMODE_NEW); Matrix_Scale(WIDE_N64_MODE(1.0f, 0.1), WIDE_N64_MODE(1.0f, 0.1), WIDE_N64_MODE(1.0f, 0.1), MTXMODE_APPLY); Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); - gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_parameter.c", 3701), - G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(OVERLAY_DISP++, play->state.gfxCtx, "../z_parameter.c", 3701); gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[4], 4, 0); if ((interfaceCtx->unk_1EC < 2) || (interfaceCtx->unk_1EC == 3)) { @@ -3470,8 +3486,9 @@ void Interface_Draw(PlayState* play) { gSPSegment(OVERLAY_DISP++, 0x08, pauseCtx->iconItemSegment); Gfx_SetupDL_42Overlay(play->state.gfxCtx); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM); - gSPMatrix(OVERLAY_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(OVERLAY_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + // PAUSE_CURSOR_QUAD_4 pauseCtx->cursorVtx[16].v.ob[0] = pauseCtx->cursorVtx[18].v.ob[0] = pauseCtx->equipAnimX / 10; pauseCtx->cursorVtx[17].v.ob[0] = pauseCtx->cursorVtx[19].v.ob[0] = pauseCtx->cursorVtx[16].v.ob[0] + WREG(90) / 10; @@ -3482,7 +3499,7 @@ void Interface_Draw(PlayState* play) { if (pauseCtx->equipTargetItem < 0xBF) { // Normal Equip (icon goes from the inventory slot to the C button when equipping it) gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, pauseCtx->equipAnimAlpha); - gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[16], 4, 0); + gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[PAUSE_CURSOR_QUAD_4 * 4], 4, 0); gDPLoadTextureBlock(OVERLAY_DISP++, gItemIcons[pauseCtx->equipTargetItem], G_IM_FMT_RGBA, G_IM_SIZ_32b, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP, @@ -3495,6 +3512,7 @@ void Interface_Draw(PlayState* play) { if ((pauseCtx->equipAnimAlpha > 0) && (pauseCtx->equipAnimAlpha < 255)) { svar1 = (pauseCtx->equipAnimAlpha / 8) / 2; + // PAUSE_CURSOR_QUAD_4 pauseCtx->cursorVtx[16].v.ob[0] = pauseCtx->cursorVtx[18].v.ob[0] = pauseCtx->cursorVtx[16].v.ob[0] - svar1; pauseCtx->cursorVtx[17].v.ob[0] = pauseCtx->cursorVtx[19].v.ob[0] = @@ -3505,7 +3523,7 @@ void Interface_Draw(PlayState* play) { pauseCtx->cursorVtx[16].v.ob[1] - svar1 * 2 - 32; } - gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[16], 4, 0); + gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[PAUSE_CURSOR_QUAD_4 * 4], 4, 0); gDPLoadTextureBlock(OVERLAY_DISP++, gMagicArrowEquipEffectTex, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); @@ -3598,10 +3616,12 @@ void Interface_Draw(PlayState* play) { // Revert any spoiling trade quest items for (svar1 = 0; svar1 < ARRAY_COUNT(gSpoilingItems); svar1++) { if (INV_CONTENT(ITEM_TRADE_ADULT) == gSpoilingItems[svar1]) { +#if OOT_VERSION >= NTSC_1_1 gSaveContext.eventInf[EVENTINF_HORSES_INDEX] &= (u16) ~(EVENTINF_HORSES_STATE_MASK | EVENTINF_HORSES_HORSETYPE_MASK | EVENTINF_HORSES_05_MASK | EVENTINF_HORSES_06_MASK | EVENTINF_HORSES_0F_MASK); PRINTF("EVENT_INF=%x\n", gSaveContext.eventInf[EVENTINF_HORSES_INDEX]); +#endif play->nextEntranceIndex = spoilingItemEntrances[svar1]; INV_CONTENT(gSpoilingItemReverts[svar1]) = gSpoilingItemReverts[svar1]; @@ -3901,7 +3921,12 @@ void Interface_Draw(PlayState* play) { gSaveContext.subTimerSeconds--; PRINTF("TOTAL_EVENT_TM=%d\n", gSaveContext.subTimerSeconds); - if (gSaveContext.subTimerSeconds <= 0) { +#if OOT_VERSION < PAL_1_0 + if (gSaveContext.subTimerSeconds == 0) +#else + if (gSaveContext.subTimerSeconds <= 0) +#endif + { // Out of time if (!Flags_GetSwitch(play, 0x37) || ((play->sceneId != SCENE_GANON_BOSS) && @@ -4243,8 +4268,7 @@ void Interface_Update(PlayState* play) { Audio_PlaySfxGeneral(NA_SE_SY_RUPY_COUNT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { - // "Rupee Amount MAX = %d" - PRINTF("ルピー数MAX = %d\n", CUR_CAPACITY(UPG_WALLET)); + PRINTF(T("ルピー数MAX = %d\n", "Rupee Amount MAX = %d\n"), CUR_CAPACITY(UPG_WALLET)); gSaveContext.save.info.playerData.rupees = CUR_CAPACITY(UPG_WALLET); gSaveContext.rupeeAccumulator = 0; } @@ -4324,7 +4348,7 @@ void Interface_Update(PlayState* play) { gSaveContext.save.info.playerData.magicLevel = gSaveContext.save.info.playerData.isDoubleMagicAcquired + 1; gSaveContext.magicState = MAGIC_STATE_STEP_CAPACITY; PRINTF(VT_FGCOL(YELLOW)); - PRINTF("魔法スター─────ト!!!!!!!!!\n"); // "Magic Start!!!!!!!!!" + PRINTF(T("魔法スター─────ト!!!!!!!!!\n", "Magic Start!!!!!!!!!\n")); PRINTF("MAGIC_MAX=%d\n", gSaveContext.save.info.playerData.magicLevel); PRINTF("MAGIC_NOW=%d\n", gSaveContext.save.info.playerData.magic); PRINTF("Z_MAGIC_NOW_NOW=%d\n", gSaveContext.magicFillTarget); @@ -4417,8 +4441,7 @@ void Interface_Update(PlayState* play) { gTimeSpeed = sPrevTimeSpeed; play->msgCtx.ocarinaMode = OCARINA_MODE_04; } - } else if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_1) && - (interfaceCtx->restrictions.sunsSong != 3)) { + } else if ((play->roomCtx.curRoom.type != ROOM_TYPE_DUNGEON) && (interfaceCtx->restrictions.sunsSong != 3)) { if ((gSaveContext.save.dayTime >= CLOCK_TIME(6, 30)) && (gSaveContext.save.dayTime < CLOCK_TIME(18, 0) + 1)) { gSaveContext.nextDayTime = NEXT_TIME_NIGHT; @@ -4441,9 +4464,11 @@ void Interface_Update(PlayState* play) { play->nextEntranceIndex = gSaveContext.save.entranceIndex; play->transitionTrigger = TRANS_TRIGGER_START; gSaveContext.sunsSongState = SUNSSONG_INACTIVE; +#if OOT_VERSION >= PAL_1_0 func_800F6964(30); gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = NATURE_ID_DISABLED; +#endif } else { gSaveContext.sunsSongState = SUNSSONG_SPECIAL; } diff --git a/src/code/z_play.c b/src/code/z_play.c index 2e36599706..8e9be4926b 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -1,13 +1,20 @@ + #include "global.h" +#include "fault.h" #include "quake.h" #include "terminal.h" #include "config.h" +#include "versions.h" +#if PLATFORM_N64 +#include "n64dd.h" +#endif +#include "z64frame_advance.h" #if INCLUDE_EXAMPLE_SCENE #include "assets/scenes/example/example_scene.h" #endif -#include "z64frame_advance.h" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" TransitionTile gTransitionTile; s32 gTransitionTileState; @@ -173,7 +180,21 @@ void Play_SetupTransition(PlayState* this, s32 transitionType) { break; default: +#if OOT_VERSION < NTSC_1_1 + HUNGUP_AND_CRASH("../z_play.c", 2263); +#elif OOT_VERSION < PAL_1_0 + HUNGUP_AND_CRASH("../z_play.c", 2266); +#elif OOT_VERSION < PAL_1_1 + HUNGUP_AND_CRASH("../z_play.c", 2269); +#elif OOT_VERSION < GC_JP + HUNGUP_AND_CRASH("../z_play.c", 2272); +#elif OOT_VERSION < GC_EU_MQ_DBG + HUNGUP_AND_CRASH("../z_play.c", 2287); +#elif OOT_VERSION < GC_JP_CE HUNGUP_AND_CRASH("../z_play.c", 2290); +#else + HUNGUP_AND_CRASH("../z_play.c", 2293); +#endif break; } } @@ -240,6 +261,12 @@ void Play_Destroy(GameState* thisx) { KaleidoManager_Destroy(); ZeldaArena_Cleanup(); +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_14 != NULL)) { + B_80121220->unk_14(this); + } +#endif + #if IS_DEBUG Fault_RemoveClient(&D_801614B8); #endif @@ -268,7 +295,18 @@ void Play_Init(GameState* thisx) { return; } +#if OOT_DEBUG + SystemArena_Display(); +#endif + GameState_Realloc(&this->state, IS_DEBUG_HEAP_ENABLED ? 0x1D4790 : PLAY_ALLOC_SIZE); + +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_10 != NULL)) { + B_80121220->unk_10(this); + } +#endif + KaleidoManager_Init(this); View_Init(&this->view, gfxCtx); Audio_SetExtraFilter(0); @@ -361,7 +399,15 @@ void Play_Init(GameState* thisx) { PRINTF("\nSCENE_NO=%d COUNTER=%d\n", ((void)0, gSaveContext.save.entranceIndex), gSaveContext.sceneLayer); +#if PLATFORM_N64 + if ((B_80121220 != NULL && B_80121220->unk_54 != NULL && B_80121220->unk_54(this))) { + } else { + Cutscene_HandleEntranceTriggers(this); + } +#else Cutscene_HandleEntranceTriggers(this); +#endif + KaleidoScopeCall_Init(this); Interface_Init(this); @@ -433,8 +479,8 @@ void Play_Init(GameState* thisx) { zAlloc = (uintptr_t)GAME_STATE_ALLOC(&this->state, zAllocSize, "../z_play.c", 2918); zAllocAligned = (zAlloc + 8) & ~0xF; ZeldaArena_Init((void*)zAllocAligned, zAllocSize - (zAllocAligned - zAlloc)); - // "Zelda Heap" - PRINTF("ゼルダヒープ %08x-%08x\n", zAllocAligned, (u8*)zAllocAligned + zAllocSize - (s32)(zAllocAligned - zAlloc)); + PRINTF(T("ゼルダヒープ %08x-%08x\n", "Zelda Heap %08x-%08x\n"), zAllocAligned, + (u8*)zAllocAligned + zAllocSize - (s32)(zAllocAligned - zAlloc)); #if IS_DEBUG Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL); @@ -442,7 +488,8 @@ void Play_Init(GameState* thisx) { Actor_InitContext(this, &this->actorCtx, this->playerEntry); - while (!func_800973FC(this, &this->roomCtx)) { + // Busyloop until the room loads + while (!Room_ProcessRoomRequest(this, &this->roomCtx)) { ; // Empty Loop } @@ -450,7 +497,7 @@ void Play_Init(GameState* thisx) { Camera_InitDataUsingPlayer(&this->mainCamera, player); Camera_RequestMode(&this->mainCamera, CAM_MODE_NORMAL); - playerStartBgCamIndex = player->actor.params & 0xFF; + playerStartBgCamIndex = PARAMS_GET_U(player->actor.params, 0, 8); if (playerStartBgCamIndex != 0xFF) { PRINTF("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartBgCamIndex); Camera_RequestBgCam(&this->mainCamera, playerStartBgCamIndex); @@ -543,7 +590,7 @@ void Play_Update(PlayState* this) { switch (gTransitionTileState) { case TRANS_TILE_PROCESS: if (TransitionTile_Init(&gTransitionTile, 10, 7) == NULL) { - PRINTF("fbdemo_init呼出し失敗!\n"); // "fbdemo_init call failed!" + PRINTF(T("fbdemo_init呼出し失敗!\n", "fbdemo_init call failed!\n")); gTransitionTileState = TRANS_TILE_OFF; } else { gTransitionTile.zBuffer = (u16*)gZBuffer; @@ -576,11 +623,9 @@ void Play_Update(PlayState* this) { // fade out bgm if "continue bgm" flag is not set if (!(gEntranceTable[this->nextEntranceIndex + sceneLayer].field & ENTRANCE_INFO_CONTINUE_BGM_FLAG)) { - // "Sound initialized. 111" - PRINTF("\n\n\nサウンドイニシャル来ました。111"); + PRINTF(T("\n\n\nサウンドイニシャル来ました。111", "\n\n\nSound initialized. 111")); if ((this->transitionType < TRANS_TYPE_MAX) && !Environment_IsForcedSequenceDisabled()) { - // "Sound initialized. 222" - PRINTF("\n\n\nサウンドイニシャル来ました。222"); + PRINTF(T("\n\n\nサウンドイニシャル来ました。222", "\n\n\nSound initialized. 222")); func_800F6964(0x14); gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = NATURE_ID_DISABLED; @@ -932,7 +977,7 @@ void Play_Update(PlayState* this) { } } else { PLAY_LOG(3606); - func_800973FC(this, &this->roomCtx); + Room_ProcessRoomRequest(this, &this->roomCtx); PLAY_LOG(3612); CollisionCheck_AT(this, &this->colChkCtx); @@ -981,11 +1026,11 @@ void Play_Update(PlayState* this) { if (this->viewpoint != VIEWPOINT_NONE) { if (CHECK_BTN_ALL(input[0].press.button, BTN_CUP)) { if (IS_PAUSED(&this->pauseCtx)) { - // "Changing viewpoint is prohibited due to the kaleidoscope" - PRINTF(VT_FGCOL(CYAN) "カレイドスコープ中につき視点変更を禁止しております\n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T("カレイドスコープ中につき視点変更を禁止しております\n", + "Changing viewpoint is prohibited due to the kaleidoscope\n") VT_RST); } else if (Player_InCsMode(this)) { - // "Changing viewpoint is prohibited during the cutscene" - PRINTF(VT_FGCOL(CYAN) "デモ中につき視点変更を禁止しております\n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T("デモ中につき視点変更を禁止しております\n", + "Changing viewpoint is prohibited during the cutscene\n") VT_RST); } else if (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT) { Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -1094,6 +1139,10 @@ void Play_Update(PlayState* this) { } void Play_DrawOverlayElements(PlayState* this) { +#if PLATFORM_N64 + s32 pad; +#endif + if (IS_PAUSED(&this->pauseCtx)) { KaleidoScopeCall_Draw(this); } @@ -1315,7 +1364,12 @@ void Play_Draw(PlayState* this) { TransitionFade_Draw(&this->transitionFadeFlash, &gfxP); - if (gVisMonoColor.a > 0) { +#if PLATFORM_N64 + if (gVisMonoColor.a != 0) +#else + if (gVisMonoColor.a > 0) +#endif + { gPlayVisMono.vis.primColor.rgba = gVisMonoColor.rgba; VisMono_Draw(&gPlayVisMono, &gfxP); } @@ -1684,6 +1738,19 @@ void* Play_LoadFile(PlayState* this, RomFile* file) { return allocp; } +#if PLATFORM_N64 +void* Play_LoadFileFromDiskDrive(PlayState* this, RomFile* file) { + u32 size; + void* allocp; + + size = file->vromEnd - file->vromStart; + allocp = THA_AllocTailAlign16(&this->state.tha, size); + func_801C7C1C(allocp, file->vromStart, size); + + return allocp; +} +#endif + void Play_InitEnvironment(PlayState* this, s16 skyboxId) { Skybox_Init(&this->state, &this->skyboxCtx, skyboxId); Environment_Init(this, &this->envCtx, 0); @@ -1703,34 +1770,62 @@ void Play_InitScene(PlayState* this, s32 spawn) { Object_InitContext(this, &this->objectCtx); LightContext_Init(this, &this->lightCtx); - TransitionActor_InitContext(&this->state, &this->transiActorCtx); - func_80096FD4(this, &this->roomCtx.curRoom); + Scene_ResetTransitionActorList(&this->state, &this->transitionActors); + Room_Init(this, &this->roomCtx.curRoom); R_SCENE_CAM_TYPE = SCENE_CAM_TYPE_DEFAULT; - gSaveContext.worldMapArea = 0; + gSaveContext.worldMapArea = WORLD_MAP_AREA_HYRULE_FIELD; Scene_ExecuteCommands(this, this->sceneSegment); Play_InitEnvironment(this, this->skyboxId); } void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) { - SceneTableEntry* scene = &gSceneTable[sceneId]; + SceneTableEntry* scene; u32 size; +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_48 != NULL)) { + scene = B_80121220->unk_48(sceneId, gSceneTable); + } else { + scene = &gSceneTable[sceneId]; + scene->unk_13 = 0; + } +#else + scene = &gSceneTable[sceneId]; scene->unk_13 = 0; +#endif + this->loadedScene = scene; this->sceneId = sceneId; this->sceneDrawConfig = scene->drawConfig; PRINTF("\nSCENE SIZE %fK\n", (scene->sceneFile.vromEnd - scene->sceneFile.vromStart) / 1024.0f); +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (scene->unk_12 > 0)) { + this->sceneSegment = Play_LoadFileFromDiskDrive(this, &scene->sceneFile); + scene->unk_13 = 1; + } else { + this->sceneSegment = Play_LoadFile(this, &scene->sceneFile); + scene->unk_13 = 0; + } +#else this->sceneSegment = Play_LoadFile(this, &scene->sceneFile); scene->unk_13 = 0; +#endif + ASSERT(this->sceneSegment != NULL, "this->sceneSegment != NULL", "../z_play.c", 4960); gSegments[2] = VIRTUAL_TO_PHYSICAL(this->sceneSegment); Play_InitScene(this, spawn); - size = func_80096FE8(this, &this->roomCtx); +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_0C != NULL)) { + B_80121220->unk_0C(this); + } +#endif + + size = Room_SetupFirstRoom(this, &this->roomCtx); PRINTF("ROOM SIZE=%fK\n", size / 1024.0f); } @@ -2025,11 +2120,13 @@ void Play_LoadToLastEntrance(PlayState* this) { (this->sceneId == SCENE_INSIDE_GANONS_CASTLE_COLLAPSE) || (this->sceneId == SCENE_GANON_BOSS)) { this->nextEntranceIndex = ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_0; Item_Give(this, ITEM_SWORD_MASTER); +#if OOT_VERSION >= PAL_1_1 } else if ((gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_11) || (gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_12) || (gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_13) || (gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_15)) { this->nextEntranceIndex = ENTR_HYRULE_FIELD_6; +#endif } else { this->nextEntranceIndex = gSaveContext.save.entranceIndex; } @@ -2062,7 +2159,7 @@ s32 func_800C0D34(PlayState* this, Actor* actor, s16* yaw) { return 0; } - transitionActor = &this->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(actor)]; + transitionActor = &this->transitionActors.list[GET_TRANSITION_ACTOR_INDEX(actor)]; frontRoom = transitionActor->sides[0].room; if (frontRoom == transitionActor->sides[1].room) { diff --git a/src/code/z_player_call.c b/src/code/z_player_call.c index 1eb12319ca..64680a0d09 100644 --- a/src/code/z_player_call.c +++ b/src/code/z_player_call.c @@ -1,6 +1,10 @@ #include "global.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25 | ACTOR_FLAG_26) +#define FLAGS \ + (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25 | ACTOR_FLAG_26) + +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:128 pal-1.1:128" void (*sPlayerCallInitFunc)(Actor* thisx, PlayState* play); void (*sPlayerCallDestroyFunc)(Actor* thisx, PlayState* play); @@ -17,7 +21,7 @@ void Player_Destroy(Actor* thisx, PlayState* play); void Player_Update(Actor* thisx, PlayState* play); void Player_Draw(Actor* thisx, PlayState* play); -ActorInit Player_InitVars = { +ActorProfile Player_Profile = { /**/ ACTOR_PLAYER, /**/ ACTORCAT_PLAYER, /**/ FLAGS, diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 3ca1e94edc..6f8dfdcea5 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -1,9 +1,12 @@ #include "global.h" +#include "versions.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_link_boy/object_link_boy.h" #include "assets/objects/object_link_child/object_link_child.h" -typedef struct { +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" + +typedef struct BowSlingshotStringData { /* 0x00 */ Gfx* dList; /* 0x04 */ Vec3f pos; } BowSlingshotStringData; // size = 0x10 @@ -11,12 +14,126 @@ typedef struct { FlexSkeletonHeader* gPlayerSkelHeaders[] = { &gLinkAdultSkel, &gLinkChildSkel }; s16 sBootData[PLAYER_BOOTS_MAX][17] = { - { 200, 1000, 300, 700, 550, 270, 600, 350, 800, 600, -100, 600, 590, 750, 125, 200, 130 }, - { 200, 1000, 300, 700, 550, 270, 1000, 0, 800, 300, -160, 600, 590, 750, 125, 200, 130 }, - { 200, 1000, 300, 700, 550, 270, 600, 600, 800, 550, -100, 600, 540, 270, 25, 0, 130 }, - { 200, 1000, 300, 700, 380, 400, 0, 300, 800, 500, -100, 600, 590, 750, 125, 200, 130 }, - { 80, 800, 150, 700, 480, 270, 600, 50, 800, 550, -40, 400, 540, 270, 25, 0, 80 }, - { 200, 1000, 300, 800, 500, 400, 800, 400, 800, 550, -100, 600, 540, 750, 125, 400, 200 }, + // PLAYER_BOOTS_KOKIRI + { + 200, // REG(19) + FRAMERATE_CONST(1000, 1200), // REG(30) + FRAMERATE_CONST(300, 360), // REG(32) + 700, // REG(34) + FRAMERATE_CONST(550, 660), // REG(35) + FRAMERATE_CONST(270, 324), // REG(36) + 600, // REG(37) + FRAMERATE_CONST(350, 420), // REG(38) + 800, // R_DECELERATE_RATE + 600, // R_RUN_SPEED_LIMIT + -100, // REG(68) + 600, // REG(69) + 590, // IREG(66) + 750, // IREG(67) + 125, // IREG(68) + 200, // IREG(69) + FRAMERATE_CONST(130, 156), // MREG(95) + }, + // PLAYER_BOOTS_IRON + { + 200, // REG(19) + FRAMERATE_CONST(1000, 1200), // REG(30) + FRAMERATE_CONST(300, 360), // REG(32) + 700, // REG(34) + FRAMERATE_CONST(550, 660), // REG(35) + FRAMERATE_CONST(270, 324), // REG(36) + 1000, // REG(37) + FRAMERATE_CONST(0, 0), // REG(38) + 800, // R_DECELERATE_RATE + 300, // R_RUN_SPEED_LIMIT + -160, // REG(68) + 600, // REG(69) + 590, // IREG(66) + 750, // IREG(67) + 125, // IREG(68) + 200, // IREG(69) + FRAMERATE_CONST(130, 156), // MREG(95) + }, + // PLAYER_BOOTS_HOVER + { + 200, // REG(19) + FRAMERATE_CONST(1000, 1200), // REG(30) + FRAMERATE_CONST(300, 360), // REG(32) + 700, // REG(34) + FRAMERATE_CONST(550, 660), // REG(35) + FRAMERATE_CONST(270, 324), // REG(36) + 600, // REG(37) + FRAMERATE_CONST(600, 720), // REG(38) + 800, // R_DECELERATE_RATE + 550, // R_RUN_SPEED_LIMIT + -100, // REG(68) + 600, // REG(69) + 540, // IREG(66) + 270, // IREG(67) + 25, // IREG(68) + 0, // IREG(69) + FRAMERATE_CONST(130, 156), // MREG(95) + }, + // PLAYER_BOOTS_INDOOR + { + 200, // REG(19) + FRAMERATE_CONST(1000, 1200), // REG(30) + FRAMERATE_CONST(300, 360), // REG(32) + 700, // REG(34) + FRAMERATE_CONST(380, 456), // REG(35) + FRAMERATE_CONST(400, 480), // REG(36) + 0, // REG(37) + FRAMERATE_CONST(300, 360), // REG(38) + 800, // R_DECELERATE_RATE + 500, // R_RUN_SPEED_LIMIT + -100, // REG(68) + 600, // REG(69) + 590, // IREG(66) + 750, // IREG(67) + 125, // IREG(68) + 200, // IREG(69) + FRAMERATE_CONST(130, 156), // MREG(95) + }, + // PLAYER_BOOTS_IRON_UNDERWATER + { + 80, // REG(19) + FRAMERATE_CONST(800, 960), // REG(30) + FRAMERATE_CONST(150, 180), // REG(32) + 700, // REG(34) + FRAMERATE_CONST(480, 576), // REG(35) + FRAMERATE_CONST(270, 324), // REG(36) + 600, // REG(37) + FRAMERATE_CONST(50, 60), // REG(38) + 800, // R_DECELERATE_RATE + 550, // R_RUN_SPEED_LIMIT + -40, // REG(68) + 400, // REG(69) + 540, // IREG(66) + 270, // IREG(67) + 25, // IREG(68) + 0, // IREG(69) + FRAMERATE_CONST(80, 96), // MREG(95) + }, + // PLAYER_BOOTS_KOKIRI_CHILD + { + 200, // REG(19) + FRAMERATE_CONST(1000, 1200), // REG(30) + FRAMERATE_CONST(300, 360), // REG(32) + 800, // REG(34) + FRAMERATE_CONST(500, 600), // REG(35) + FRAMERATE_CONST(400, 480), // REG(36) + 800, // REG(37) + FRAMERATE_CONST(400, 480), // REG(38) + 800, // R_DECELERATE_RATE + 550, // R_RUN_SPEED_LIMIT + -100, // REG(68) + 600, // REG(69) + 540, // IREG(66) + 750, // IREG(67) + 125, // IREG(68) + 400, // IREG(69) + FRAMERATE_CONST(200, 240), // MREG(95) + }, }; // Used to map item actions to model groups @@ -90,7 +207,7 @@ u8 sActionModelGroups[PLAYER_IA_MAX] = { PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_LENS_OF_TRUTH }; -typedef struct { +typedef struct EnvHazardTextTriggerEntry { /* 0x0 */ u8 flag; /* 0x2 */ u16 textId; } EnvHazardTextTriggerEntry; // size = 0x4 @@ -472,8 +589,8 @@ void Player_SetBootData(PlayState* play, Player* this) { REG(36) = bootRegs[5]; REG(37) = bootRegs[6]; REG(38) = bootRegs[7]; - REG(43) = bootRegs[8]; - REG(45) = bootRegs[9]; + R_DECELERATE_RATE = bootRegs[8]; + R_RUN_SPEED_LIMIT = bootRegs[9]; REG(68) = bootRegs[10]; REG(69) = bootRegs[11]; IREG(66) = bootRegs[12]; @@ -482,15 +599,15 @@ void Player_SetBootData(PlayState* play, Player* this) { IREG(69) = bootRegs[15]; MREG(95) = bootRegs[16]; - if (play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_2) { - REG(45) = 500; + if (play->roomCtx.curRoom.type == ROOM_TYPE_INDOORS) { + R_RUN_SPEED_LIMIT = 500; } } int Player_InBlockingCsMode(PlayState* play, Player* this) { - return (this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_29)) || (this->csAction != PLAYER_CSACTION_NONE) || + return (this->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_29)) || (this->csAction != PLAYER_CSACTION_NONE) || (play->transitionTrigger == TRANS_TRIGGER_START) || (this->stateFlags1 & PLAYER_STATE1_0) || - (this->stateFlags3 & PLAYER_STATE3_7) || + (this->stateFlags3 & PLAYER_STATE3_FLYING_WITH_HOOKSHOT) || ((gSaveContext.magicState != MAGIC_STATE_IDLE) && (Player_ActionToMagicSpell(this, this->itemAction) >= 0)); } @@ -500,8 +617,15 @@ int Player_InCsMode(PlayState* play) { return Player_InBlockingCsMode(play, this) || (this->unk_6AD == 4); } -s32 func_8008E9C4(Player* this) { - return (this->stateFlags1 & PLAYER_STATE1_4); +/** + * Checks if Player is currently locked onto a hostile actor. + * `PLAYER_STATE1_HOSTILE_LOCK_ON` controls Player's "battle" response to hostile actors. + * + * Note that within Player, `Player_UpdateHostileLockOn` exists, which updates the flag and also returns the check. + * Player can use this function instead if the flag should be checked, but not updated. + */ +s32 Player_CheckHostileLockOn(Player* this) { + return (this->stateFlags1 & PLAYER_STATE1_HOSTILE_LOCK_ON); } int Player_IsChildWithHylianShield(Player* this) { @@ -599,32 +723,51 @@ void Player_UpdateBottleHeld(PlayState* play, Player* this, s32 item, s32 itemAc this->itemAction = itemAction; } -void func_8008EDF0(Player* this) { - this->unk_664 = NULL; - this->stateFlags2 &= ~PLAYER_STATE2_13; +void Player_ReleaseLockOn(Player* this) { + this->focusActor = NULL; + this->stateFlags2 &= ~PLAYER_STATE2_LOCK_ON_WITH_SWITCH; } -void func_8008EE08(Player* this) { +/** + * This function aims to clear Z-Target related state when it isn't in use. + * It also handles setting a specific free fall related state that is interntwined with Z-Targeting. + * TODO: Learn more about this and give a name to PLAYER_STATE1_19 + */ +void Player_ClearZTargeting(Player* this) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->stateFlags1 & (PLAYER_STATE1_21 | PLAYER_STATE1_23 | PLAYER_STATE1_27)) || (!(this->stateFlags1 & (PLAYER_STATE1_18 | PLAYER_STATE1_19)) && ((this->actor.world.pos.y - this->actor.floorHeight) < 100.0f))) { - this->stateFlags1 &= ~(PLAYER_STATE1_15 | PLAYER_STATE1_16 | PLAYER_STATE1_17 | PLAYER_STATE1_18 | - PLAYER_STATE1_19 | PLAYER_STATE1_30); + this->stateFlags1 &= ~(PLAYER_STATE1_Z_TARGETING | PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS | PLAYER_STATE1_PARALLEL | + PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_LOCK_ON_FORCED_TO_RELEASE); } else if (!(this->stateFlags1 & (PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_21))) { this->stateFlags1 |= PLAYER_STATE1_19; } - func_8008EDF0(this); + Player_ReleaseLockOn(this); } -void func_8008EEAC(PlayState* play, Actor* actor) { +/** + * Sets the "auto lock-on actor" to lock onto an actor without Player's input. + * This function will first release any existing lock-on or (try to) release parallel. + * + * When using Switch Targeting, it is not possible to carry an auto lock-on actor into a normal + * lock-on when the auto lock-on is finished. + * This is because the `PLAYER_STATE2_LOCK_ON_WITH_SWITCH` flag is never set with an auto lock-on. + * With Hold Targeting it is possible to keep the auto lock-on going by keeping the Z button held down. + * + * The auto lock-on is considered "friendly" even if the actor is actually hostile. If the auto lock-on is hostile, + * Player's battle response will not occur (if he is actionable) and the camera behaves differently. + * When transitioning from auto lock-on to normal lock-on (with Hold Targeting) there will be a noticeable change + * when it switches from "friendly" mode to "hostile" mode. + */ +void Player_SetAutoLockOnActor(PlayState* play, Actor* actor) { Player* this = GET_PLAYER(play); - func_8008EE08(this); - this->unk_664 = actor; - this->unk_684 = actor; - this->stateFlags1 |= PLAYER_STATE1_16; + Player_ClearZTargeting(this); + this->focusActor = actor; + this->autoLockOnActor = actor; + this->stateFlags1 |= PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS; Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, actor); Camera_RequestMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_Z_TARGET_FRIENDLY); } @@ -785,7 +928,7 @@ s32 Player_GetEnvironmentalHazard(PlayState* play) { EnvHazardTextTriggerEntry* triggerEntry; s32 envHazard; - if (play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) { // Room is hot + if (play->roomCtx.curRoom.environmentType == ROOM_ENV_HOT) { // Room is hot envHazard = PLAYER_ENV_HAZARD_HOTROOM - 1; } else if ((this->underwaterTimer > 80) && ((this->currentBoots == PLAYER_BOOTS_IRON) || (this->underwaterTimer >= 300))) { @@ -1039,7 +1182,7 @@ void func_8008F87C(PlayState* play, Player* this, SkelAnime* skelAnime, Vec3f* p s16 temp2; s32 temp3; - if ((this->actor.scale.y >= 0.0f) && !(this->stateFlags1 & PLAYER_STATE1_7) && + if ((this->actor.scale.y >= 0.0f) && !(this->stateFlags1 & PLAYER_STATE1_DEAD) && (Player_ActionToMagicSpell(this, this->itemAction) < 0)) { s32 pad; @@ -1125,13 +1268,14 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx** sCurBodyPartPos = &this->bodyPartsPos[0] - 1; if (!LINK_IS_ADULT) { - if (!(this->skelAnime.moveFlags & ANIM_FLAG_PLAYER_2) || - (this->skelAnime.moveFlags & ANIM_FLAG_UPDATE_XZ)) { + if (!(this->skelAnime.movementFlags & ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT) || + (this->skelAnime.movementFlags & ANIM_FLAG_UPDATE_XZ)) { pos->x *= 0.64f; pos->z *= 0.64f; } - if (!(this->skelAnime.moveFlags & ANIM_FLAG_PLAYER_2) || (this->skelAnime.moveFlags & ANIM_FLAG_UPDATE_Y)) { + if (!(this->skelAnime.movementFlags & ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT) || + (this->skelAnime.movementFlags & ANIM_FLAG_UPDATE_Y)) { pos->y *= 0.64f; } } @@ -1151,22 +1295,22 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx** } if (limbIndex == PLAYER_LIMB_HEAD) { - rot->x += this->unk_6BA; - rot->y -= this->unk_6B8; - rot->z += this->unk_6B6; + rot->x += this->headLimbRot.z; + rot->y -= this->headLimbRot.y; + rot->z += this->headLimbRot.x; } else if (limbIndex == PLAYER_LIMB_UPPER) { - if (this->unk_6B0 != 0) { + if (this->upperLimbYawSecondary != 0) { Matrix_RotateZ(BINANG_TO_RAD(0x44C), MTXMODE_APPLY); - Matrix_RotateY(BINANG_TO_RAD(this->unk_6B0), MTXMODE_APPLY); + Matrix_RotateY(BINANG_TO_RAD(this->upperLimbYawSecondary), MTXMODE_APPLY); } - if (this->unk_6BE != 0) { - Matrix_RotateY(BINANG_TO_RAD(this->unk_6BE), MTXMODE_APPLY); + if (this->upperLimbRot.y != 0) { + Matrix_RotateY(BINANG_TO_RAD(this->upperLimbRot.y), MTXMODE_APPLY); } - if (this->unk_6BC != 0) { - Matrix_RotateX(BINANG_TO_RAD(this->unk_6BC), MTXMODE_APPLY); + if (this->upperLimbRot.x != 0) { + Matrix_RotateX(BINANG_TO_RAD(this->upperLimbRot.x), MTXMODE_APPLY); } - if (this->unk_6C0 != 0) { - Matrix_RotateZ(BINANG_TO_RAD(this->unk_6C0), MTXMODE_APPLY); + if (this->upperLimbRot.z != 0) { + Matrix_RotateZ(BINANG_TO_RAD(this->upperLimbRot.z), MTXMODE_APPLY); } } else if (limbIndex == PLAYER_LIMB_L_THIGH) { s32 pad; @@ -1196,7 +1340,8 @@ s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** if ((sLeftHandType == PLAYER_MODELTYPE_LH_BGS) && (gSaveContext.save.info.playerData.swordHealth <= 0.0f)) { dLists += 4; - } else if ((sLeftHandType == PLAYER_MODELTYPE_LH_BOOMERANG) && (this->stateFlags1 & PLAYER_STATE1_25)) { + } else if ((sLeftHandType == PLAYER_MODELTYPE_LH_BOOMERANG) && + (this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN)) { dLists = gPlayerLeftHandOpenDLs + gSaveContext.save.linkAge; sLeftHandType = PLAYER_MODELTYPE_LH_OPEN; } else if ((this->leftHandType == PLAYER_MODELTYPE_LH_OPEN) && (this->actor.speed > 2.0f) && @@ -1308,17 +1453,17 @@ u8 func_80090480(PlayState* play, ColliderQuad* collider, WeaponInfo* weaponInfo } void Player_UpdateShieldCollider(PlayState* play, Player* this, ColliderQuad* collider, Vec3f* quadSrc) { - static u8 shieldColTypes[PLAYER_SHIELD_MAX] = { - COLTYPE_METAL, - COLTYPE_WOOD, - COLTYPE_METAL, - COLTYPE_METAL, + static u8 shieldColMaterials[PLAYER_SHIELD_MAX] = { + COL_MATERIAL_METAL, + COL_MATERIAL_WOOD, + COL_MATERIAL_METAL, + COL_MATERIAL_METAL, }; if (this->stateFlags1 & PLAYER_STATE1_22) { Vec3f quadDest[4]; - this->shieldQuad.base.colType = shieldColTypes[this->currentShield]; + this->shieldQuad.base.colMaterial = shieldColMaterials[this->currentShield]; Matrix_MultVec3f(&quadSrc[0], &quadDest[0]); Matrix_MultVec3f(&quadSrc[1], &quadDest[1]); @@ -1434,8 +1579,7 @@ void Player_DrawHookshotReticle(PlayState* play, Player* this, f32 arg2) { Matrix_Translate(sp74.x, sp74.y, sp74.z, MTXMODE_NEW); Matrix_Scale(sp60, sp60, sp60, MTXMODE_APPLY); - gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_player_lib.c", 2587), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(OVERLAY_DISP++, play->state.gfxCtx, "../z_player_lib.c", 2587); gSPSegment(OVERLAY_DISP++, 0x06, play->objectCtx.slots[this->actor.objectSlot].segment); gSPDisplayList(OVERLAY_DISP++, gLinkAdultHookshotReticleDL); @@ -1481,8 +1625,8 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve } if (limbIndex == PLAYER_LIMB_L_HAND) { - MtxF sp14C; - Actor* hookedActor; + MtxF leftHandMtx; + Actor* heldActor; Math_Vec3f_Copy(&this->leftHandPos, sCurBodyPartPos); @@ -1505,8 +1649,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve Matrix_RotateZYX(-0x8000, 0, 0x4000, MTXMODE_APPLY); Matrix_Scale(1.0f, this->unk_85C, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_player_lib.c", 2653), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_player_lib.c", 2653); gSPDisplayList(POLY_OPA_DISP++, gLinkChildLinkDekuStickDL); CLOSE_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2656); @@ -1522,12 +1665,16 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve func_80090A28(this, spE4); func_800906D4(play, this, spE4); } else if ((*dList != NULL) && (this->leftHandType == PLAYER_MODELTYPE_LH_BOTTLE)) { + //! @bug When Player is actively using shield, the `itemAction` value will be set to -1. + //! If shield is used at the same time a bottle is in hand, `Player_ActionToBottle` will + //! return -1, which results in an out of bounds access behind the `sBottleColors` array. + //! A value of -1 happens to access `gLinkChildBottleDL` (0x06018478). The last 3 bytes of + //! this pointer are read as a color, which results in a dark teal color used for the bottle. Color_RGB8* bottleColor = &sBottleColors[Player_ActionToBottle(this, this->itemAction)]; OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2710); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_player_lib.c", 2712), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_player_lib.c", 2712); gDPSetEnvColor(POLY_XLU_DISP++, bottleColor->r, bottleColor->g, bottleColor->b, 0); gSPDisplayList(POLY_XLU_DISP++, sBottleDLists[((void)0, gSaveContext.save.linkAge)]); @@ -1535,25 +1682,25 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve } if (this->actor.scale.y >= 0.0f) { - if (!Player_HoldsHookshot(this) && ((hookedActor = this->heldActor) != NULL)) { + if (!Player_HoldsHookshot(this) && ((heldActor = this->heldActor) != NULL)) { if (this->stateFlags1 & PLAYER_STATE1_9) { static Vec3f D_80126128 = { 398.0f, 1419.0f, 244.0f }; - Matrix_MultVec3f(&D_80126128, &hookedActor->world.pos); + Matrix_MultVec3f(&D_80126128, &heldActor->world.pos); Matrix_RotateZYX(0x69E8, -0x5708, 0x458E, MTXMODE_APPLY); - Matrix_Get(&sp14C); - Matrix_MtxFToYXZRotS(&sp14C, &hookedActor->world.rot, 0); - hookedActor->shape.rot = hookedActor->world.rot; - } else if (this->stateFlags1 & PLAYER_STATE1_11) { - Vec3s spB8; + Matrix_Get(&leftHandMtx); + Matrix_MtxFToYXZRotS(&leftHandMtx, &heldActor->world.rot, 0); + heldActor->shape.rot = heldActor->world.rot; + } else if (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) { + Vec3s leftHandRot; - Matrix_Get(&sp14C); - Matrix_MtxFToYXZRotS(&sp14C, &spB8, 0); + Matrix_Get(&leftHandMtx); + Matrix_MtxFToYXZRotS(&leftHandMtx, &leftHandRot, 0); - if (hookedActor->flags & ACTOR_FLAG_17) { - hookedActor->world.rot.x = hookedActor->shape.rot.x = spB8.x - this->unk_3BC.x; + if (heldActor->flags & ACTOR_FLAG_CARRY_X_ROT_INFLUENCE) { + heldActor->world.rot.x = heldActor->shape.rot.x = leftHandRot.x - this->unk_3BC.x; } else { - hookedActor->world.rot.y = hookedActor->shape.rot.y = this->actor.shape.rot.y + this->unk_3BC.y; + heldActor->world.rot.y = heldActor->shape.rot.y = this->actor.shape.rot.y + this->unk_3BC.y; } } } else { @@ -1605,8 +1752,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve Matrix_RotateZ(this->unk_858 * -0.2f, MTXMODE_APPLY); } - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_player_lib.c", 2804), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_player_lib.c", 2804); gSPDisplayList(POLY_XLU_DISP++, stringData->dList); Matrix_Pop(); @@ -1642,7 +1788,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve Matrix_MtxFToYXZRotS(&sp44, &heldActor->world.rot, 0); heldActor->shape.rot = heldActor->world.rot; - if (func_8002DD78(this) != 0) { + if (func_8002DD78(this)) { Matrix_Translate(500.0f, 300.0f, 0.0f, MTXMODE_APPLY); Player_DrawHookshotReticle(play, this, (this->heldItemAction == PLAYER_IA_HOOKSHOT) ? 38600.0f : 77600.0f); @@ -1805,8 +1951,6 @@ void Player_DrawPauseImpl(PlayState* play, void* gameplayKeep, void* linkObject, gSPDisplayList(WORK_DISP++, POLY_OPA_DISP); gSPDisplayList(WORK_DISP++, POLY_XLU_DISP); - { s32 pad[2]; } - gSPSegment(POLY_OPA_DISP++, 0x00, NULL); gDPPipeSync(POLY_OPA_DISP++); @@ -1818,7 +1962,14 @@ void Player_DrawPauseImpl(PlayState* play, void* gameplayKeep, void* linkObject, G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_FILL | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2); - gSPLoadGeometryMode(POLY_OPA_DISP++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH); + + // Also matches if some of the previous graphics commands are moved inside this block too. Possible macro? + if (1) { + s32 pad[2]; + + gSPLoadGeometryMode(POLY_OPA_DISP++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH); + } + gDPSetScissor(POLY_OPA_DISP++, G_SC_NON_INTERLACE, 0, 0, width, height); #if !ENABLE_F3DEX3 diff --git a/src/code/z_prenmi.c b/src/code/z_prenmi.c index d8b6af8e78..2d118fa395 100644 --- a/src/code/z_prenmi.c +++ b/src/code/z_prenmi.c @@ -1,5 +1,6 @@ #include "global.h" #include "terminal.h" +#include "versions.h" void func_80092320(PreNMIState* this) { this->state.running = false; @@ -17,7 +18,12 @@ void PreNMI_Update(PreNMIState* this) { } if (this->timer == 0) { +#if OOT_VERSION < PAL_1_0 + osViSetYScale(1.0f); + osViBlack(true); +#else ViConfig_UpdateVi(true); +#endif func_80092320(this); return; } diff --git a/src/code/z_quake.c b/src/code/z_quake.c index 50cc448bec..4c318b9386 100644 --- a/src/code/z_quake.c +++ b/src/code/z_quake.c @@ -2,7 +2,7 @@ #include "quake.h" #include "terminal.h" -typedef struct { +typedef struct QuakeRequest { /* 0x00 */ s16 index; /* 0x02 */ s16 duration; /* 0x04 */ Camera* cam; @@ -170,7 +170,7 @@ QuakeRequest* Quake_RequestImpl(Camera* camera, u32 type) { s16 index = Quake_GetFreeIndex(); QuakeRequest* req = &sQuakeRequests[index]; - __osMemset(req, 0, sizeof(QuakeRequest)); + memset(req, 0, sizeof(QuakeRequest)); req->cam = camera; req->camId = camera->camId; diff --git a/src/code/z_rcp.c b/src/code/z_rcp.c index 84f27878e1..6f065920e1 100644 --- a/src/code/z_rcp.c +++ b/src/code/z_rcp.c @@ -1018,7 +1018,7 @@ void func_80093C80(PlayState* play) { Gfx_SetupDL_25Opa(gfxCtx); - if (play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_3) { + if (play->roomCtx.curRoom.type == ROOM_TYPE_3) { OPEN_DISPS(gfxCtx, "../z_rcp.c", 1460); gDPSetColorDither(POLY_OPA_DISP++, G_CD_DISABLE); diff --git a/src/code/z_room.c b/src/code/z_room.c index e58846644e..25578a631d 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -1,5 +1,10 @@ #include "global.h" +#include "fault.h" #include "terminal.h" +#include "versions.h" +#if PLATFORM_N64 +#include "n64dd.h" +#endif Vec3f D_801270A0 = { 0.0f, 0.0f, 0.0f }; @@ -44,14 +49,14 @@ void Room_DrawNormal(PlayState* play, Room* room, u32 flags) { func_800342EC(&D_801270A0, play); gSPSegment(POLY_OPA_DISP++, 0x03, room->segment); func_80093C80(play); - gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } if (flags & ROOM_DRAW_XLU) { func_8003435C(&D_801270A0, play); gSPSegment(POLY_XLU_DISP++, 0x03, room->segment); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } roomShape = &room->roomShape->normal; @@ -71,7 +76,7 @@ void Room_DrawNormal(PlayState* play, Room* room, u32 flags) { CLOSE_DISPS(play->state.gfxCtx, "../z_room.c", 239); } -typedef enum { +typedef enum RoomCullableDebugMode { /* 0 */ ROOM_CULL_DEBUG_MODE_OFF, /* 1 */ ROOM_CULL_DEBUG_MODE_UP_TO_TARGET, /* 2 */ ROOM_CULL_DEBUG_MODE_ONLY_TARGET @@ -118,7 +123,7 @@ void Room_DrawCullable(PlayState* play, Room* room, u32 flags) { func_800342EC(&D_801270A0, play); gSPSegment(POLY_OPA_DISP++, 0x03, room->segment); func_80093C80(play); - gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } if (1) {} @@ -127,7 +132,7 @@ void Room_DrawCullable(PlayState* play, Room* room, u32 flags) { func_8003435C(&D_801270A0, play); gSPSegment(POLY_XLU_DISP++, 0x03, room->segment); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } roomShape = &room->roomShape->cullable; @@ -264,25 +269,24 @@ s32 Room_DecodeJpeg(void* data) { OSTime time; if (*(u32*)data == JPEG_MARKER) { - PRINTF("JPEGデータを展開します\n"); // "Expanding jpeg data" - PRINTF("JPEGデータアドレス %08x\n", data); // "Jpeg data address %08x" - // "Work buffer address (Z buffer) %08x" - PRINTF("ワークバッファアドレス(Zバッファ)%08x\n", gZBuffer); + PRINTF(T("JPEGデータを展開します\n", "Expanding jpeg data\n")); + PRINTF(T("JPEGデータアドレス %08x\n", "Jpeg data address %08x\n"), data); + PRINTF(T("ワークバッファアドレス(Zバッファ)%08x\n", "Work buffer address (Z buffer) %08x\n"), gZBuffer); time = osGetTime(); if (!Jpeg_Decode(data, gZBuffer, gGfxSPTaskOutputBuffer, sizeof(gGfxSPTaskOutputBuffer))) { time = osGetTime() - time; - // "Success... I think. time = %6.3f ms" - PRINTF("成功…だと思う。 time = %6.3f ms \n", OS_CYCLES_TO_USEC(time) / 1000.0f); - // "Writing back to original address from work buffer." - PRINTF("ワークバッファから元のアドレスに書き戻します。\n"); - // "If the original buffer size isn't at least 150kB, it will be out of control." - PRINTF("元のバッファのサイズが150キロバイト無いと暴走するでしょう。\n"); + PRINTF(T("成功…だと思う。 time = %6.3f ms \n", "Success... I think. time = %6.3f ms\n"), + OS_CYCLES_TO_USEC(time) / 1000.0f); + PRINTF(T("ワークバッファから元のアドレスに書き戻します。\n", + "Writing back to original address from work buffer.\n")); + PRINTF(T("元のバッファのサイズが150キロバイト無いと暴走するでしょう。\n", + "If the original buffer size isn't at least 150kB, it will be out of control.\n")); bcopy(gZBuffer, data, sizeof(u16[SCREEN_HEIGHT][SCREEN_WIDTH])); } else { - PRINTF("失敗!なんで〜\n"); // "Failure! Why is it 〜" + PRINTF(T("失敗!なんで〜\n", "Failure! Why is it ~\n")); } } @@ -298,6 +302,7 @@ void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 hei bg = (uObjBg*)(gfx + 1); gSPBranchList(gfx, (Gfx*)(bg + 1)); + gfx = (Gfx*)(bg + 1); bg->b.imageX = 0; bg->b.imageW = width * (1 << 2); @@ -312,8 +317,6 @@ void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 hei bg->b.imagePal = 0; bg->b.imageFlip = 0; - gfx = (Gfx*)(bg + 1); - if (fmt == G_IM_FMT_CI) { gDPLoadTLUT(gfx++, tlutCount, 256, tlut); } else { @@ -350,6 +353,14 @@ void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 hei *gfxP = gfx; } +#if OOT_VERSION < PAL_1_0 +void func_8007FF50(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tlutMode, + u16 tlutCount) { + if (1) {} + Room_DrawBackground2D(gfxP, tex, tlut, width, height, fmt, siz, tlutMode, tlutCount, 0.0f, 0.0f); +} +#endif + #define ROOM_IMAGE_NODRAW_BACKGROUND (1 << 0) #define ROOM_IMAGE_NODRAW_OPA (1 << 1) #define ROOM_IMAGE_NODRAW_XLU (1 << 2) @@ -380,7 +391,7 @@ void Room_DrawImageSingle(PlayState* play, Room* room, u32 flags) { if (drawOpa) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, entry->opa); } @@ -389,6 +400,9 @@ void Room_DrawImageSingle(PlayState* play, Room* room, u32 flags) { gfx = POLY_OPA_DISP; +#if OOT_VERSION < PAL_1_0 + if (1) +#endif { Vec3f quakeOffset; @@ -408,7 +422,7 @@ void Room_DrawImageSingle(PlayState* play, Room* room, u32 flags) { if (drawXlu) { gSPSegment(POLY_XLU_DISP++, 0x03, room->segment); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, entry->xlu); } @@ -431,7 +445,7 @@ RoomShapeImageMultiBgEntry* Room_GetImageMultiBgEntry(RoomShapeImageMulti* roomS } player = GET_PLAYER(play); - player->actor.params = (player->actor.params & 0xFF00) | bgCamIndex; + player->actor.params = PARAMS_GET_NOSHIFT(player->actor.params, 8, 8) | bgCamIndex; bgEntry = SEGMENTED_TO_VIRTUAL(roomShapeImageMulti->backgrounds); for (i = 0; i < roomShapeImageMulti->numBackgrounds; i++) { @@ -441,9 +455,18 @@ RoomShapeImageMultiBgEntry* Room_GetImageMultiBgEntry(RoomShapeImageMulti* roomS bgEntry++; } - // "z_room.c: Data consistent with camera id does not exist camid=%d" - PRINTF(VT_COL(RED, WHITE) "z_room.c:カメラIDに一致するデータが存在しません camid=%d\n" VT_RST, bgCamIndex); + PRINTF(VT_COL(RED, WHITE) T("z_room.c:カメラIDに一致するデータが存在しません camid=%d\n", + "z_room.c: Data consistent with camera id does not exist camid=%d\n") VT_RST, + bgCamIndex); +#if OOT_VERSION < NTSC_1_1 + Fault_AddHungupAndCrash("../z_room.c", 724); +#elif OOT_VERSION < PAL_1_0 + Fault_AddHungupAndCrash("../z_room.c", 727); +#elif OOT_VERSION < GC_JP + Fault_AddHungupAndCrash("../z_room.c", 721); +#else LogUtils_HungupThread("../z_room.c", 726); +#endif return NULL; } @@ -480,7 +503,7 @@ void Room_DrawImageMulti(PlayState* play, Room* room, u32 flags) { if (drawOpa) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, dListsEntry->opa); } @@ -489,6 +512,9 @@ void Room_DrawImageMulti(PlayState* play, Room* room, u32 flags) { gfx = POLY_OPA_DISP; +#if OOT_VERSION < PAL_1_0 + if (1) +#endif { Vec3f quakeOffset; @@ -508,7 +534,7 @@ void Room_DrawImageMulti(PlayState* play, Room* room, u32 flags) { if (drawXlu) { gSPSegment(POLY_XLU_DISP++, 0x03, room->segment); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, dListsEntry->xlu); } @@ -523,11 +549,19 @@ void Room_DrawImage(PlayState* play, Room* room, u32 flags) { } else if (roomShape->amountType == ROOM_SHAPE_IMAGE_AMOUNT_MULTI) { Room_DrawImageMulti(play, room, flags); } else { +#if OOT_VERSION < NTSC_1_1 + Fault_AddHungupAndCrash("../z_room.c", 849); +#elif OOT_VERSION < PAL_1_0 + Fault_AddHungupAndCrash("../z_room.c", 852); +#elif OOT_VERSION < GC_JP + Fault_AddHungupAndCrash("../z_room.c", 836); +#else LogUtils_HungupThread("../z_room.c", 841); +#endif } } -void func_80096FD4(PlayState* play, Room* room) { +void Room_Init(PlayState* play, Room* room) { room->num = -1; room->segment = NULL; #if ENABLE_F3DEX3 @@ -535,8 +569,13 @@ void func_80096FD4(PlayState* play, Room* room) { #endif } -u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) { - u32 maxRoomSize = 0; +/** + * Allocates memory for rooms and fetches the first room that the player will spawn into. + * + * @return u32 size of the buffer reserved for room data + */ +u32 Room_SetupFirstRoom(PlayState* play, RoomContext* roomCtx) { + u32 roomBufferSize = 0; u32 roomSize; s32 i; s32 j; @@ -547,25 +586,27 @@ u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) { u32 cumulRoomSize; s32 pad; + // Set roomBufferSize to the largest room { - RomFile* roomList = play->roomList; + RomFile* roomList = play->roomList.romFiles; - for (i = 0; i < play->numRooms; i++) { + for (i = 0; i < play->roomList.count; i++) { roomSize = roomList[i].vromEnd - roomList[i].vromStart; PRINTF("ROOM%d size=%d\n", i, roomSize); - if (maxRoomSize < roomSize) { - maxRoomSize = roomSize; + if (roomBufferSize < roomSize) { + roomBufferSize = roomSize; } } } - if ((u32)play->transiActorCtx.numActors != 0) { - RomFile* roomList = play->roomList; - TransitionActorEntry* transitionActor = &play->transiActorCtx.list[0]; + // If there any rooms are connected, find their combined size and update roomBufferSize if larger + if ((u32)play->transitionActors.count != 0) { + RomFile* roomList = play->roomList.romFiles; + TransitionActorEntry* transitionActor = &play->transitionActors.list[0]; - LOG_NUM("game_play->room_rom_address.num", play->numRooms, "../z_room.c", 912); + LOG_NUM("game_play->room_rom_address.num", play->roomList.count, "../z_room.c", 912); - for (j = 0; j < play->transiActorCtx.numActors; j++) { + for (j = 0; j < play->transitionActors.count; j++) { frontRoom = transitionActor->sides[0].room; backRoom = transitionActor->sides[1].room; frontRoomSize = (frontRoom < 0) ? 0 : roomList[frontRoom].vromEnd - roomList[frontRoom].vromStart; @@ -574,75 +615,110 @@ u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) { PRINTF("DOOR%d=<%d> ROOM1=<%d, %d> ROOM2=<%d, %d>\n", j, cumulRoomSize, frontRoom, frontRoomSize, backRoom, backRoomSize); - if (maxRoomSize < cumulRoomSize) { - maxRoomSize = cumulRoomSize; + if (roomBufferSize < cumulRoomSize) { + roomBufferSize = cumulRoomSize; } transitionActor++; } } PRINTF(VT_FGCOL(YELLOW)); - // "Room buffer size=%08x(%5.1fK)" - PRINTF("部屋バッファサイズ=%08x(%5.1fK)\n", maxRoomSize, maxRoomSize / 1024.0f); - roomCtx->bufPtrs[0] = GAME_STATE_ALLOC(&play->state, maxRoomSize, "../z_room.c", 946); - // "Room buffer initial pointer=%08x" - PRINTF("部屋バッファ開始ポインタ=%08x\n", roomCtx->bufPtrs[0]); - roomCtx->bufPtrs[1] = (void*)((uintptr_t)roomCtx->bufPtrs[0] + maxRoomSize); - // "Room buffer end pointer=%08x" - PRINTF("部屋バッファ終了ポインタ=%08x\n", roomCtx->bufPtrs[1]); + PRINTF(T("部屋バッファサイズ=%08x(%5.1fK)\n", "Room buffer size=%08x(%5.1fK)\n"), roomBufferSize, + roomBufferSize / 1024.0f); + roomCtx->bufPtrs[0] = GAME_STATE_ALLOC(&play->state, roomBufferSize, "../z_room.c", 946); + PRINTF(T("部屋バッファ開始ポインタ=%08x\n", "Room buffer initial pointer=%08x\n"), roomCtx->bufPtrs[0]); + roomCtx->bufPtrs[1] = (void*)((uintptr_t)roomCtx->bufPtrs[0] + roomBufferSize); + PRINTF(T("部屋バッファ終了ポインタ=%08x\n", "Room buffer end pointer=%08x\n"), roomCtx->bufPtrs[1]); PRINTF(VT_RST); - roomCtx->unk_30 = 0; + roomCtx->activeBufPage = 0; roomCtx->status = 0; frontRoom = gSaveContext.respawnFlag > 0 ? ((void)0, gSaveContext.respawn[gSaveContext.respawnFlag - 1].roomIndex) : play->spawnList[play->spawn].room; - func_8009728C(play, roomCtx, frontRoom); - return maxRoomSize; + // Load into a room for the first time. + // Since curRoom was initialized to `room = -1` and `segment = NULL` in Play_InitScene, the previous room + // will also be initialized to the nulled state when this function completes. + Room_RequestNewRoom(play, roomCtx, frontRoom); + + return roomBufferSize; } -s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) { +/** + * Tries to create an asynchronous request to transfer room data into memory. + * If successful, the requested room will be loaded into memory and becomes the new current room; the room that was + * current before becomes the previous room. + * + * Room_RequestNewRoom will be blocked from loading new rooms until Room_ProcessRoomRequest completes room + * initialization. + * + * Calling Room_RequestNewRoom outside of Room_SetupFirstRoom will allow for two rooms being initialized simultaneously. + * This allows an actor like ACTOR_EN_HOLL to seamlessly swap the two rooms as the player moves between them. Calling + * Room_FinishRoomChange afterward will finalize the room swap. + * + * @param roomNum is the id of the room to load. roomNum must NOT be the same id as curRoom.num, since this will create + * duplicate actor instances that cannot be cleaned up by calling Room_FinishRoomChange + * @returns bool false if the request could not be created. + */ +s32 Room_RequestNewRoom(PlayState* play, RoomContext* roomCtx, s32 roomNum) { if (roomCtx->status == 0) { u32 size; roomCtx->prevRoom = roomCtx->curRoom; - func_80096FD4(play, &roomCtx->curRoom); roomCtx->curRoom.num = roomNum; + roomCtx->curRoom.segment = NULL; roomCtx->status = 1; - ASSERT(roomNum < play->numRooms, "read_room_ID < game_play->room_rom_address.num", "../z_room.c", 1009); + ASSERT(roomNum < play->roomList.count, "read_room_ID < game_play->room_rom_address.num", "../z_room.c", 1009); - size = play->roomList[roomNum].vromEnd - play->roomList[roomNum].vromStart; - roomCtx->unk_34 = - (void*)ALIGN16((uintptr_t)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7)); + size = play->roomList.romFiles[roomNum].vromEnd - play->roomList.romFiles[roomNum].vromStart; + roomCtx->roomRequestAddr = (void*)ALIGN16((uintptr_t)roomCtx->bufPtrs[roomCtx->activeBufPage] - + ((size + 8) * roomCtx->activeBufPage + 7)); osCreateMesgQueue(&roomCtx->loadQueue, &roomCtx->loadMsg, 1); - DMA_REQUEST_ASYNC(&roomCtx->dmaRequest, roomCtx->unk_34, play->roomList[roomNum].vromStart, size, 0, - &roomCtx->loadQueue, NULL, "../z_room.c", 1036); - roomCtx->unk_30 ^= 1; +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_08 != NULL)) { + B_80121220->unk_08(play, roomCtx, roomNum); + } else { + DMA_REQUEST_ASYNC(&roomCtx->dmaRequest, roomCtx->roomRequestAddr, + play->roomList.romFiles[roomNum].vromStart, size, 0, &roomCtx->loadQueue, NULL, + "../z_room.c", 1036); + } +#else + DMA_REQUEST_ASYNC(&roomCtx->dmaRequest, roomCtx->roomRequestAddr, play->roomList.romFiles[roomNum].vromStart, + size, 0, &roomCtx->loadQueue, NULL, "../z_room.c", 1036); +#endif + + roomCtx->activeBufPage ^= 1; return true; } return false; } -s32 func_800973FC(PlayState* play, RoomContext* roomCtx) { +/** + * Completes room initialization for the room requested by a call to Room_RequestNewRoom. + * This function does not block the thread if the room data is still being transferred. + * + * @returns bool false if a dma transfer is in progress. + */ +s32 Room_ProcessRoomRequest(PlayState* play, RoomContext* roomCtx) { if (roomCtx->status == 1) { if (osRecvMesg(&roomCtx->loadQueue, NULL, OS_MESG_NOBLOCK) == 0) { roomCtx->status = 0; - roomCtx->curRoom.segment = roomCtx->unk_34; - gSegments[3] = VIRTUAL_TO_PHYSICAL(roomCtx->unk_34); + roomCtx->curRoom.segment = roomCtx->roomRequestAddr; + gSegments[3] = VIRTUAL_TO_PHYSICAL(roomCtx->curRoom.segment); Scene_ExecuteCommands(play, roomCtx->curRoom.segment); Player_SetBootData(play, GET_PLAYER(play)); Actor_SpawnTransitionActors(play, &play->actorCtx); } else { - return 0; + return false; } } - return 1; + return true; } void Room_Draw(PlayState* play, Room* room, u32 flags) { @@ -654,8 +730,17 @@ void Room_Draw(PlayState* play, Room* room, u32 flags) { } } -void func_80097534(PlayState* play, RoomContext* roomCtx) { - func_80096FD4(play, &roomCtx->prevRoom); +/** + * Finalizes a swap between two rooms. + * + * When a new room is created with Room_RequestNewRoom, the previous room and its actors remain in memory. This allows + * an actor like ACTOR_EN_HOLL to seamlessly swap the two rooms as the player moves between them. + */ +void Room_FinishRoomChange(PlayState* play, RoomContext* roomCtx) { + // Delete the previous room + roomCtx->prevRoom.num = -1; + roomCtx->prevRoom.segment = NULL; + func_80031B14(play, &play->actorCtx); Actor_SpawnTransitionActors(play, &play->actorCtx); Map_InitRoomData(play, roomCtx->curRoom.num); diff --git a/src/code/z_sample.c b/src/code/z_sample.c index e76b7ad3e7..b6843823a0 100644 --- a/src/code/z_sample.c +++ b/src/code/z_sample.c @@ -26,7 +26,7 @@ void Sample_Draw(SampleState* this) { Mtx* mtx = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); 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_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } POLY_OPA_DISP = Gfx_SetFog2(POLY_OPA_DISP, 255, 255, 255, 0, 0, 0); diff --git a/src/code/z_scene.c b/src/code/z_scene.c index c3ab55a13f..949e4c9d7b 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -1,6 +1,8 @@ #include "global.h" #include "terminal.h" +#include "versions.h" +SceneCmdHandlerFunc sSceneCmdHandlers[SCENE_CMD_ID_MAX]; RomFile sNaviQuestHintFiles[]; /** @@ -45,6 +47,15 @@ s32 Object_SpawnPersistent(ObjectContext* objectCtx, s16 objectId) { return objectCtx->numEntries - 1; } +// PAL N64 versions reduce the size of object space by 4 KiB in order to give some space back to +// the Zelda arena, which can help prevent an issue where actors fail to spawn in specific areas +// (sometimes referred to as the "Hyrule Field Glitch" although it can happen in more places than Hyrule Field). +#if !OOT_PAL_N64 +#define OBJECT_SPACE_ADJUSTMENT 0 +#else +#define OBJECT_SPACE_ADJUSTMENT (4 * 1024) +#endif + void Object_InitContext(PlayState* play, ObjectContext* objectCtx) { PlayState* play2 = play; s32 pad; @@ -55,21 +66,21 @@ void Object_InitContext(PlayState* play, ObjectContext* objectCtx) { spaceSize = OBJECT_BANK_SIZE; #else if (play2->sceneId == SCENE_HYRULE_FIELD) { - spaceSize = 1000 * 1024; + spaceSize = 1000 * 1024 - OBJECT_SPACE_ADJUSTMENT; } else if (play2->sceneId == SCENE_GANON_BOSS) { if (gSaveContext.sceneLayer != 4) { - spaceSize = 1150 * 1024; + spaceSize = 1150 * 1024 - OBJECT_SPACE_ADJUSTMENT; } else { - spaceSize = 1000 * 1024; + spaceSize = 1000 * 1024 - OBJECT_SPACE_ADJUSTMENT; } } else if (play2->sceneId == SCENE_SPIRIT_TEMPLE_BOSS) { - spaceSize = 1050 * 1024; + spaceSize = 1050 * 1024 - OBJECT_SPACE_ADJUSTMENT; } else if (play2->sceneId == SCENE_CHAMBER_OF_THE_SAGES) { - spaceSize = 1050 * 1024; + spaceSize = 1050 * 1024 - OBJECT_SPACE_ADJUSTMENT; } else if (play2->sceneId == SCENE_GANONDORF_BOSS) { - spaceSize = 1050 * 1024; + spaceSize = 1050 * 1024 - OBJECT_SPACE_ADJUSTMENT; } else { - spaceSize = 1000 * 1024; + spaceSize = 1000 * 1024 - OBJECT_SPACE_ADJUSTMENT; } #endif @@ -81,8 +92,7 @@ void Object_InitContext(PlayState* play, ObjectContext* objectCtx) { } PRINTF(VT_FGCOL(GREEN)); - // "Object exchange bank data %8.3fKB" - PRINTF("オブジェクト入れ替えバンク情報 %8.3fKB\n", spaceSize / 1024.0f); + PRINTF(T("オブジェクト入れ替えバンク情報 %8.3fKB\n", "Object exchange bank data %8.3fKB\n"), spaceSize / 1024.0f); PRINTF(VT_RST); objectCtx->spaceStart = objectCtx->slots[0].segment = @@ -169,8 +179,8 @@ void* func_800982FC(ObjectContext* objectCtx, s32 slot, s16 objectId) { ASSERT(nextPtr < objectCtx->spaceEnd, "nextptr < this->endSegment", "../z_scene.c", 381); - // "Object exchange free size=%08x" - PRINTF("オブジェクト入れ替え空きサイズ=%08x\n", (uintptr_t)objectCtx->spaceEnd - (uintptr_t)nextPtr); + PRINTF(T("オブジェクト入れ替え空きサイズ=%08x\n", "Object exchange free size=%08x\n"), + (uintptr_t)objectCtx->spaceEnd - (uintptr_t)nextPtr); return nextPtr; } @@ -186,11 +196,11 @@ s32 Scene_ExecuteCommands(PlayState* play, SceneCmd* sceneCmd) { break; } - if (cmdCode < ARRAY_COUNT(gSceneCmdHandlers)) { - gSceneCmdHandlers[cmdCode](play, sceneCmd); + if (cmdCode < ARRAY_COUNT(sSceneCmdHandlers)) { + sSceneCmdHandlers[cmdCode](play, sceneCmd); } else { PRINTF(VT_FGCOL(RED)); - PRINTF("code の値が異常です\n"); // "code variable is abnormal" + PRINTF(T("code の値が異常です\n", "code variable is abnormal\n")); PRINTF(VT_RST); } @@ -209,7 +219,7 @@ BAD_RETURN(s32) Scene_CommandPlayerEntryList(PlayState* play, SceneCmd* cmd) { linkObjectId = gLinkObjectIds[((void)0, gSaveContext.save.linkAge)]; - gActorOverlayTable[playerEntry->id].initInfo->objectId = linkObjectId; + gActorOverlayTable[playerEntry->id].profile->objectId = linkObjectId; Object_SpawnPersistent(&play->objectCtx, linkObjectId); } @@ -235,8 +245,8 @@ BAD_RETURN(s32) Scene_CommandCollisionHeader(PlayState* play, SceneCmd* cmd) { } BAD_RETURN(s32) Scene_CommandRoomList(PlayState* play, SceneCmd* cmd) { - play->numRooms = cmd->roomList.length; - play->roomList = SEGMENTED_TO_VIRTUAL(cmd->roomList.data); + play->roomList.count = cmd->roomList.length; + play->roomList.romFiles = SEGMENTED_TO_VIRTUAL(cmd->roomList.data); } BAD_RETURN(s32) Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd) { @@ -255,8 +265,8 @@ BAD_RETURN(s32) Scene_CommandSpecialFiles(PlayState* play, SceneCmd* cmd) { } BAD_RETURN(s32) Scene_CommandRoomBehavior(PlayState* play, SceneCmd* cmd) { - play->roomCtx.curRoom.behaviorType1 = cmd->roomBehavior.gpFlag1; - play->roomCtx.curRoom.behaviorType2 = cmd->roomBehavior.gpFlag2 & 0xFF; + play->roomCtx.curRoom.type = cmd->roomBehavior.gpFlag1; + play->roomCtx.curRoom.environmentType = cmd->roomBehavior.gpFlag2 & 0xFF; play->roomCtx.curRoom.lensMode = (cmd->roomBehavior.gpFlag2 >> 8) & 1; play->msgCtx.disableWarpSongs = (cmd->roomBehavior.gpFlag2 >> 0xA) & 1; } @@ -332,12 +342,12 @@ BAD_RETURN(s32) Scene_CommandPathList(PlayState* play, SceneCmd* cmd) { } BAD_RETURN(s32) Scene_CommandTransitionActorEntryList(PlayState* play, SceneCmd* cmd) { - play->transiActorCtx.numActors = cmd->transiActorList.length; - play->transiActorCtx.list = SEGMENTED_TO_VIRTUAL(cmd->transiActorList.data); + play->transitionActors.count = cmd->transiActorList.length; + play->transitionActors.list = SEGMENTED_TO_VIRTUAL(cmd->transiActorList.data); } -void TransitionActor_InitContext(GameState* state, TransitionActorContext* transiActorCtx) { - transiActorCtx->numActors = 0; +void Scene_ResetTransitionActorList(GameState* state, TransitionActorList* transitionActors) { + transitionActors->count = 0; } BAD_RETURN(s32) Scene_CommandLightSettingsList(PlayState* play, SceneCmd* cmd) { @@ -378,12 +388,21 @@ BAD_RETURN(s32) Scene_CommandTimeSettings(PlayState* play, SceneCmd* cmd) { if (((play->envCtx.sceneTimeSpeed == 0) && (gSaveContext.save.cutsceneIndex < 0xFFF0)) || (gSaveContext.save.entranceIndex == ENTR_LAKE_HYLIA_8)) { +#if OOT_VERSION >= PAL_1_0 gSaveContext.skyboxTime = ((void)0, gSaveContext.save.dayTime); +#endif +#if OOT_VERSION < PAL_1_0 + if ((gSaveContext.skyboxTime > CLOCK_TIME(4, 0)) && (gSaveContext.skyboxTime <= CLOCK_TIME(5, 0))) { + gSaveContext.skyboxTime = CLOCK_TIME(5, 0) + 1; + } else if ((gSaveContext.skyboxTime >= CLOCK_TIME(6, 0)) && (gSaveContext.skyboxTime <= CLOCK_TIME(8, 0))) { + gSaveContext.skyboxTime = CLOCK_TIME(8, 0) + 1; +#else if ((gSaveContext.skyboxTime > CLOCK_TIME(4, 0)) && (gSaveContext.skyboxTime < CLOCK_TIME(6, 30))) { gSaveContext.skyboxTime = CLOCK_TIME(5, 0) + 1; } else if ((gSaveContext.skyboxTime >= CLOCK_TIME(6, 30)) && (gSaveContext.skyboxTime <= CLOCK_TIME(8, 0))) { gSaveContext.skyboxTime = CLOCK_TIME(8, 0) + 1; +#endif } else if ((gSaveContext.skyboxTime >= CLOCK_TIME(16, 0)) && (gSaveContext.skyboxTime <= CLOCK_TIME(17, 0))) { gSaveContext.skyboxTime = CLOCK_TIME(17, 0) + 1; } else if ((gSaveContext.skyboxTime >= CLOCK_TIME(18, 0) + 1) && @@ -437,8 +456,7 @@ BAD_RETURN(s32) Scene_CommandAlternateHeaderList(PlayState* play, SceneCmd* cmd) Scene_ExecuteCommands(play, SEGMENTED_TO_VIRTUAL(altHeader)); (cmd + 1)->base.code = SCENE_CMD_ID_END; } else { - // "Coughh! There is no specified dataaaaa!" - PRINTF("\nげぼはっ! 指定されたデータがないでええっす!"); + PRINTF(T("\nげぼはっ! 指定されたデータがないでええっす!", "\nCoughh! There is no specified dataaaaa!")); if (gSaveContext.sceneLayer == SCENE_LAYER_ADULT_NIGHT) { // Due to the condition above, this is equivalent to accessing altHeaders[SCENE_LAYER_ADULT_DAY - 1] @@ -446,8 +464,7 @@ BAD_RETURN(s32) Scene_CommandAlternateHeaderList(PlayState* play, SceneCmd* cmd) cmd->altHeaders .data))[(gSaveContext.sceneLayer - SCENE_LAYER_ADULT_NIGHT) + SCENE_LAYER_ADULT_DAY - 1]; - // "Using adult day data there!" - PRINTF("\nそこで、大人の昼データを使用するでええっす!!"); + PRINTF(T("\nそこで、大人の昼データを使用するでええっす!!", "\nUsing adult day data there!!")); if (altHeader != NULL) { Scene_ExecuteCommands(play, SEGMENTED_TO_VIRTUAL(altHeader)); @@ -469,7 +486,7 @@ BAD_RETURN(s32) Scene_CommandMiscSettings(PlayState* play, SceneCmd* cmd) { if ((play->sceneId == SCENE_BAZAAR) || (play->sceneId == SCENE_SHOOTING_GALLERY)) { if (LINK_AGE_IN_YEARS == YEARS_ADULT) { - gSaveContext.worldMapArea = 1; + gSaveContext.worldMapArea = WORLD_MAP_AREA_KAKARIKO_VILLAGE; } } @@ -510,7 +527,7 @@ void Scene_SetTransitionForNextEntrance(PlayState* play) { play->transitionType = ENTRANCE_INFO_START_TRANS_TYPE(gEntranceTable[entranceIndex].field); } -SceneCmdHandlerFunc gSceneCmdHandlers[SCENE_CMD_ID_MAX] = { +SceneCmdHandlerFunc sSceneCmdHandlers[SCENE_CMD_ID_MAX] = { Scene_CommandPlayerEntryList, // SCENE_CMD_ID_SPAWN_LIST Scene_CommandActorEntryList, // SCENE_CMD_ID_ACTOR_LIST Scene_CommandUnused2, // SCENE_CMD_ID_UNUSED_2 diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c index eea92648d5..ed5d9017c2 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -1,17 +1,11 @@ #include "global.h" #include "quake.h" -#include "config.h" - -#include "assets/scenes/indoors/miharigoya/miharigoya_scene.h" -#include "assets/scenes/indoors/souko/souko_scene.h" - -#include "assets/scenes/indoors/miharigoya/miharigoya_scene.h" -#include "assets/scenes/indoors/souko/souko_scene.h" - -#include "assets/scenes/indoors/miharigoya/miharigoya_scene.h" -#include "assets/scenes/indoors/souko/souko_scene.h" - +#include "versions.h" #include "z64frame_advance.h" +#include "config.h" +#if PLATFORM_N64 +#include "n64dd.h" +#endif #include "assets/scenes/indoors/miharigoya/miharigoya_scene.h" #include "assets/scenes/indoors/souko/souko_scene.h" @@ -37,6 +31,60 @@ #include "overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h" +void Scene_DrawConfigDefault(PlayState* play); +void Scene_DrawConfigHyruleField(PlayState* play); +void Scene_DrawConfigKakarikoVillage(PlayState* play); +void Scene_DrawConfigZorasRiver(PlayState* play); +void Scene_DrawConfigKokiriForest(PlayState* play); +void Scene_DrawConfigLakeHylia(PlayState* play); +void Scene_DrawConfigZorasDomain(PlayState* play); +void Scene_DrawConfigZorasFountain(PlayState* play); +void Scene_DrawConfigGerudoValley(PlayState* play); +void Scene_DrawConfigLostWoods(PlayState* play); +void Scene_DrawConfigDesertColossus(PlayState* play); +void Scene_DrawConfigGerudosFortress(PlayState* play); +void Scene_DrawConfigHauntedWasteland(PlayState* play); +void Scene_DrawConfigHyruleCastle(PlayState* play); +void Scene_DrawConfigDeathMountainTrail(PlayState* play); +void Scene_DrawConfigDeathMountainCrater(PlayState* play); +void Scene_DrawConfigGoronCity(PlayState* play); +void Scene_DrawConfigLonLonRanch(PlayState* play); +void Scene_DrawConfigFireTemple(PlayState* play); +void Scene_DrawConfigDekuTree(PlayState* play); +void Scene_DrawConfigDodongosCavern(PlayState* play); +void Scene_DrawConfigJabuJabu(PlayState* play); +void Scene_DrawConfigForestTemple(PlayState* play); +void Scene_DrawConfigWaterTemple(PlayState* play); +void Scene_DrawConfigShadowTempleAndWell(PlayState* play); +void Scene_DrawConfigSpiritTemple(PlayState* play); +void Scene_DrawConfigInsideGanonsCastle(PlayState* play); +void Scene_DrawConfigGerudoTrainingGround(PlayState* play); +void Scene_DrawConfigDekuTreeBoss(PlayState* play); +void Scene_DrawConfigWaterTempleBoss(PlayState* play); +void Scene_DrawConfigTempleOfTime(PlayState* play); +void Scene_DrawConfigGrottos(PlayState* play); +void Scene_DrawConfigChamberOfTheSages(PlayState* play); +void Scene_DrawConfigGreatFairyFountain(PlayState* play); +void Scene_DrawConfigShootingGallery(PlayState* play); +void Scene_DrawConfigCastleCourtyardGuards(PlayState* play); +void Scene_DrawConfigOutsideGanonsCastle(PlayState* play); +void Scene_DrawConfigIceCavern(PlayState* play); +void Scene_DrawConfigGanonsTowerCollapseExterior(PlayState* play); +void Scene_DrawConfigFairysFountain(PlayState* play); +void Scene_DrawConfigThievesHideout(PlayState* play); +void Scene_DrawConfigBombchuBowlingAlley(PlayState* play); +void Scene_DrawConfigRoyalFamilysTomb(PlayState* play); +void Scene_DrawConfigLakesideLaboratory(PlayState* play); +void Scene_DrawConfigLonLonBuildings(PlayState* play); +void Scene_DrawConfigMarketGuardHouse(PlayState* play); +void Scene_DrawConfigPotionShopGranny(PlayState* play); +void Scene_DrawConfigCalmWater(PlayState* play); +void Scene_DrawConfigGraveExitLightShining(PlayState* play); +void Scene_DrawConfigBesitu(PlayState* play); +void Scene_DrawConfigFishingPond(PlayState* play); +void Scene_DrawConfigGanonsTowerCollapseInterior(PlayState* play); +void Scene_DrawConfigInsideGanonsCastleCollapse(PlayState* play); + // Entrance Table definition #define DEFINE_ENTRANCE(_0, sceneId, spawn, continueBgm, displayTitleCard, endTransType, startTransType) \ { sceneId, spawn, \ @@ -90,6 +138,75 @@ Gfx sDefaultDisplayList[] = { gsSPEndDisplayList(), }; +#if PLATFORM_N64 // Scene_Draw is at end of file in GC/iQue versions + +SceneDrawConfigFunc sSceneDrawConfigs[SDC_MAX] = { + Scene_DrawConfigDefault, // SDC_DEFAULT + Scene_DrawConfigHyruleField, // SDC_HYRULE_FIELD + Scene_DrawConfigKakarikoVillage, // SDC_KAKARIKO_VILLAGE + Scene_DrawConfigZorasRiver, // SDC_ZORAS_RIVER + Scene_DrawConfigKokiriForest, // SDC_KOKIRI_FOREST + Scene_DrawConfigLakeHylia, // SDC_LAKE_HYLIA + Scene_DrawConfigZorasDomain, // SDC_ZORAS_DOMAIN + Scene_DrawConfigZorasFountain, // SDC_ZORAS_FOUNTAIN + Scene_DrawConfigGerudoValley, // SDC_GERUDO_VALLEY + Scene_DrawConfigLostWoods, // SDC_LOST_WOODS + Scene_DrawConfigDesertColossus, // SDC_DESERT_COLOSSUS + Scene_DrawConfigGerudosFortress, // SDC_GERUDOS_FORTRESS + Scene_DrawConfigHauntedWasteland, // SDC_HAUNTED_WASTELAND + Scene_DrawConfigHyruleCastle, // SDC_HYRULE_CASTLE + Scene_DrawConfigDeathMountainTrail, // SDC_DEATH_MOUNTAIN_TRAIL + Scene_DrawConfigDeathMountainCrater, // SDC_DEATH_MOUNTAIN_CRATER + Scene_DrawConfigGoronCity, // SDC_GORON_CITY + Scene_DrawConfigLonLonRanch, // SDC_LON_LON_RANCH + Scene_DrawConfigFireTemple, // SDC_FIRE_TEMPLE + Scene_DrawConfigDekuTree, // SDC_DEKU_TREE + Scene_DrawConfigDodongosCavern, // SDC_DODONGOS_CAVERN + Scene_DrawConfigJabuJabu, // SDC_JABU_JABU + Scene_DrawConfigForestTemple, // SDC_FOREST_TEMPLE + Scene_DrawConfigWaterTemple, // SDC_WATER_TEMPLE + Scene_DrawConfigShadowTempleAndWell, // SDC_SHADOW_TEMPLE_AND_WELL + Scene_DrawConfigSpiritTemple, // SDC_SPIRIT_TEMPLE + Scene_DrawConfigInsideGanonsCastle, // SDC_INSIDE_GANONS_CASTLE + Scene_DrawConfigGerudoTrainingGround, // SDC_GERUDO_TRAINING_GROUND + Scene_DrawConfigDekuTreeBoss, // SDC_DEKU_TREE_BOSS + Scene_DrawConfigWaterTempleBoss, // SDC_WATER_TEMPLE_BOSS + Scene_DrawConfigTempleOfTime, // SDC_TEMPLE_OF_TIME + Scene_DrawConfigGrottos, // SDC_GROTTOS + Scene_DrawConfigChamberOfTheSages, // SDC_CHAMBER_OF_THE_SAGES + Scene_DrawConfigGreatFairyFountain, // SDC_GREAT_FAIRYS_FOUNTAIN + Scene_DrawConfigShootingGallery, // SDC_SHOOTING_GALLERY + Scene_DrawConfigCastleCourtyardGuards, // SDC_CASTLE_COURTYARD_GUARDS + Scene_DrawConfigOutsideGanonsCastle, // SDC_OUTSIDE_GANONS_CASTLE + Scene_DrawConfigIceCavern, // SDC_ICE_CAVERN + Scene_DrawConfigGanonsTowerCollapseExterior, // SDC_GANONS_TOWER_COLLAPSE_EXTERIOR + Scene_DrawConfigFairysFountain, // SDC_FAIRYS_FOUNTAIN + Scene_DrawConfigThievesHideout, // SDC_THIEVES_HIDEOUT + Scene_DrawConfigBombchuBowlingAlley, // SDC_BOMBCHU_BOWLING_ALLEY + Scene_DrawConfigRoyalFamilysTomb, // SDC_ROYAL_FAMILYS_TOMB + Scene_DrawConfigLakesideLaboratory, // SDC_LAKESIDE_LABORATORY + Scene_DrawConfigLonLonBuildings, // SDC_LON_LON_BUILDINGS + Scene_DrawConfigMarketGuardHouse, // SDC_MARKET_GUARD_HOUSE + Scene_DrawConfigPotionShopGranny, // SDC_POTION_SHOP_GRANNY + Scene_DrawConfigCalmWater, // SDC_CALM_WATER + Scene_DrawConfigGraveExitLightShining, // SDC_GRAVE_EXIT_LIGHT_SHINING + Scene_DrawConfigBesitu, // SDC_BESITU + Scene_DrawConfigFishingPond, // SDC_FISHING_POND + Scene_DrawConfigGanonsTowerCollapseInterior, // SDC_GANONS_TOWER_COLLAPSE_INTERIOR + Scene_DrawConfigInsideGanonsCastleCollapse, // SDC_INSIDE_GANONS_CASTLE_COLLAPSE +}; + +void Scene_Draw(PlayState* play) { + if ((B_80121220 != NULL) && (B_80121220->unk_6C != NULL)) { + B_80121220->unk_6C(play, sSceneDrawConfigs); + return; + } + + sSceneDrawConfigs[play->sceneDrawConfig](play); +} + +#endif + void Scene_DrawConfigDefault(PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 4725); @@ -173,13 +290,13 @@ void Scene_DrawConfigDodongosCavern(PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x0B, displayListHead); gDPPipeSync(displayListHead++); - gDPSetEnvColor(displayListHead++, 255, 255, 255, play->roomCtx.unk_74[BGDODOAGO_EYE_LEFT]); + gDPSetEnvColor(displayListHead++, 255, 255, 255, play->roomCtx.drawParams[BGDODOAGO_EYE_LEFT]); gSPEndDisplayList(displayListHead++); gSPSegment(POLY_OPA_DISP++, 0x0C, displayListHead); gDPPipeSync(displayListHead++); - gDPSetEnvColor(displayListHead++, 255, 255, 255, play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT]); - gSPEndDisplayList(displayListHead); + gDPSetEnvColor(displayListHead++, 255, 255, 255, play->roomCtx.drawParams[BGDODOAGO_EYE_RIGHT]); + gSPEndDisplayList(displayListHead++); CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 4956); } @@ -190,7 +307,7 @@ void Scene_DrawConfigTempleOfTime(PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 5069); - temp = play->roomCtx.unk_74[0] / 255.0f; + temp = play->roomCtx.drawParams[0] / 255.0f; gSPSegment(POLY_XLU_DISP++, 0x08, displayListHead); gSPSegment(POLY_OPA_DISP++, 0x08, displayListHead); @@ -207,7 +324,7 @@ void Scene_DrawConfigTempleOfTime(PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x0A, displayListHead); gSPSegment(POLY_XLU_DISP++, 0x0A, displayListHead); gDPPipeSync(displayListHead++); - gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.unk_74[0]); + gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.drawParams[0]); gSPEndDisplayList(displayListHead++); gSPSegment(POLY_OPA_DISP++, 0x0B, displayListHead); @@ -215,7 +332,7 @@ void Scene_DrawConfigTempleOfTime(PlayState* play) { gDPSetPrimColor(displayListHead++, 0, 0, 89 + (u8)(166.0f * temp), 89 + (u8)(166.0f * temp), 89 + (u8)(166.0f * temp), 255); gDPPipeSync(displayListHead++); - gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.unk_74[0]); + gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.drawParams[0]); gSPEndDisplayList(displayListHead++); gSPSegment(POLY_OPA_DISP++, 0x0C, displayListHead); @@ -223,13 +340,13 @@ void Scene_DrawConfigTempleOfTime(PlayState* play) { gDPSetPrimColor(displayListHead++, 0, 0, 255 + (u8)(179.0f * temp), 255 + (u8)(179.0f * temp), 255 + (u8)(179.0f * temp), 255); gDPPipeSync(displayListHead++); - gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.unk_74[0]); + gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.drawParams[0]); gSPEndDisplayList(displayListHead++); gSPSegment(POLY_OPA_DISP++, 0x0D, displayListHead); gSPSegment(POLY_XLU_DISP++, 0x0D, displayListHead); gDPPipeSync(displayListHead++); - gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.unk_74[1]); + gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.drawParams[1]); gSPEndDisplayList(displayListHead); CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 5145); @@ -279,8 +396,6 @@ void Scene_DrawConfigGrottos(PlayState* play) { void Scene_DrawConfigChamberOfTheSages(PlayState* play) { u32 gameplayFrames; - if (1) {} - OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 5226); gameplayFrames = play->gameplayFrames; @@ -425,10 +540,8 @@ void Scene_DrawConfigWaterTemple(PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 5535); - if (1) {} // Necessary to match - - spB0 = (play->roomCtx.unk_74[1] >> 8) & 0xFF; - spAC = play->roomCtx.unk_74[1] & 0xFF; + spB0 = (play->roomCtx.drawParams[1] >> 8) & 0xFF; + spAC = play->roomCtx.drawParams[1] & 0xFF; gameplayFrames = play->gameplayFrames; #if !OOT_MQ @@ -501,7 +614,7 @@ void Scene_DrawConfigWaterTempleBoss(PlayState* play) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32)); gDPPipeSync(POLY_OPA_DISP++); - gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, play->roomCtx.unk_74[0]); + gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, play->roomCtx.drawParams[0]); gDPPipeSync(POLY_XLU_DISP++); gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 145); @@ -551,8 +664,6 @@ void Scene_DrawConfigOutsideGanonsCastle(PlayState* play) { u32 gameplayFrames; s8 sp83; - if (1) {} // Necessary to match - sp83 = coss(play->gameplayFrames * 1500) >> 8; OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 5894); @@ -607,8 +718,6 @@ void Scene_DrawConfigGanonsTowerCollapseExterior(PlayState* play) { u32 gameplayFrames; s8 sp7B; - if (1) {} // Necessary to match - sp7B = coss((play->gameplayFrames * 1500) & 0xFFFF) >> 8; OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 5968); @@ -653,8 +762,6 @@ void* sIceCavernEntranceTextures[] = { void Scene_DrawConfigIceCavern(PlayState* play) { u32 gameplayFrames; - if (0) {} // Necessary to match - OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 6042); gameplayFrames = play->gameplayFrames; @@ -719,8 +826,6 @@ void Scene_DrawConfigLakesideLaboratory(PlayState* play) { 32, 32)); gSPSegment(POLY_XLU_DISP++, 0x09, Gfx_TexScroll(play->state.gfxCtx, 0, 255 - (gameplayFrames * 10) % 256, 32, 64)); - if (1) {} - gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128); @@ -758,8 +863,6 @@ void* sGTGEntranceTextures[] = { void Scene_DrawConfigGerudoTrainingGround(PlayState* play) { u32 gameplayFrames; - if (0) {} // Necessary to match - OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 6290); gameplayFrames = play->gameplayFrames; @@ -811,7 +914,7 @@ void Scene_DrawConfigFishingPond(PlayState* play) { gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScrollPrimColor(play->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, 255, 255, - 255, play->roomCtx.unk_74[0] + 127)); + 255, play->roomCtx.drawParams[0] + 127)); gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128); @@ -924,8 +1027,6 @@ void* sForestTempleEntranceTextures[] = { void Scene_DrawConfigForestTemple(PlayState* play) { u32 gameplayFrames; - if (0) {} // Necessary to match - OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 6640); gameplayFrames = play->gameplayFrames; @@ -990,24 +1091,21 @@ void Scene_DrawConfigHyruleField(PlayState* play) { gSPSegment(POLY_XLU_DISP++, 0x0A, displayListHead); if ((gSaveContext.save.dayTime > CLOCK_TIME(7, 0)) && (gSaveContext.save.dayTime <= CLOCK_TIME(18, 30))) { - gSPEndDisplayList(displayListHead); + gSPEndDisplayList(displayListHead++); } else { if (gSaveContext.save.dayTime > CLOCK_TIME(18, 30)) { - if (play->roomCtx.unk_74[0] != 255) { - Math_StepToS(&play->roomCtx.unk_74[0], 255, 5); + if (play->roomCtx.drawParams[0] != 255) { + Math_StepToS(&play->roomCtx.drawParams[0], 255, 5); } } else if (gSaveContext.save.dayTime >= CLOCK_TIME(6, 0)) { - if (play->roomCtx.unk_74[0] != 0) { - Math_StepToS(&play->roomCtx.unk_74[0], 0, 10); + if (play->roomCtx.drawParams[0] != 0) { + Math_StepToS(&play->roomCtx.drawParams[0], 0, 10); } } - gDPSetPrimColor(displayListHead++, 0, 0, 255, 255, 255, play->roomCtx.unk_74[0]); - - if (1) {} - + gDPSetPrimColor(displayListHead++, 0, 0, 255, 255, 255, play->roomCtx.drawParams[0]); gSPDisplayList(displayListHead++, spot00_room_0DL_012B20); - gSPEndDisplayList(displayListHead); + gSPEndDisplayList(displayListHead++); } CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 6866); @@ -1052,8 +1150,6 @@ void Scene_DrawConfigZorasRiver(PlayState* play) { (gameplayFrames * 1) % 128, 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); - if (1) {} - gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128); @@ -1073,9 +1169,6 @@ void Scene_DrawConfigKokiriForest(PlayState* play) { spA0 = 500; displayListHead = GRAPH_ALLOC(play->state.gfxCtx, 6 * sizeof(Gfx)); - if (1) {} - if (1) {} - OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 6965); gameplayFrames = play->gameplayFrames; @@ -1095,9 +1188,9 @@ void Scene_DrawConfigKokiriForest(PlayState* play) { gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 128); if (gSaveContext.sceneLayer == 4) { - spA3 = 255 - (u8)play->roomCtx.unk_74[0]; + spA3 = 255 - (u8)play->roomCtx.drawParams[0]; } else if (gSaveContext.sceneLayer == 6) { - spA0 = play->roomCtx.unk_74[0] + 500; + spA0 = play->roomCtx.drawParams[0] + 500; } else if ((!IS_CUTSCENE_LAYER || LINK_IS_ADULT) && GET_EVENTCHKINF(EVENTCHKINF_07)) { spA0 = 2150; } @@ -1111,11 +1204,11 @@ void Scene_DrawConfigKokiriForest(PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x0B, displayListHead); gDPPipeSync(displayListHead++); gDPSetEnvColor(displayListHead++, 128, 128, 128, spA0 * 0.1f); - gSPEndDisplayList(displayListHead); + gSPEndDisplayList(displayListHead++); gSPSegment(POLY_OPA_DISP++, 0x0C, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, (s16)(-play->roomCtx.unk_74[0] * 0.02f), 32, 16, - 1, 0, (s16)(-play->roomCtx.unk_74[0] * 0.02f), 32, 16)); + Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, (s16)(-play->roomCtx.drawParams[0] * 0.02f), 32, + 16, 1, 0, (s16)(-play->roomCtx.drawParams[0] * 0.02f), 32, 16)); CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7044); } @@ -1126,16 +1219,16 @@ void Scene_DrawConfigLakeHylia(PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7058); if (IS_CUTSCENE_LAYER || (LINK_IS_ADULT && !GET_EVENTCHKINF(EVENTCHKINF_69))) { - play->roomCtx.unk_74[0] = 87; + play->roomCtx.drawParams[0] = 87; } gameplayFrames = play->gameplayFrames; gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_TwoTexScrollEnvColor(play->state.gfxCtx, G_TX_RENDERTILE, gameplayFrames, gameplayFrames, 32, 32, 1, - 0, 0, 32, 32, 0, 0, 0, play->roomCtx.unk_74[0] + 168)); + 0, 0, 32, 32, 0, 0, 0, play->roomCtx.drawParams[0] + 168)); gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_TwoTexScrollEnvColor(play->state.gfxCtx, G_TX_RENDERTILE, -gameplayFrames, -gameplayFrames, 32, 32, - 1, 0, 0, 16, 64, 0, 0, 0, play->roomCtx.unk_74[0] + 168)); + 1, 0, 0, 16, 64, 0, 0, 0, play->roomCtx.drawParams[0] + 168)); gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 128); @@ -1187,8 +1280,6 @@ void Scene_DrawConfigZorasFountain(PlayState* play) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, (gameplayFrames * 1) % 128, 32, 32, 1, 0, (gameplayFrames * 1) % 128, 32, 32)); - if (1) {} - gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128); @@ -1235,8 +1326,6 @@ void Scene_DrawConfigGerudoValley(PlayState* play) { void Scene_DrawConfigLostWoods(PlayState* play) { u32 gameplayFrames; - if (0) {} // Necessary to match - OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7274); gameplayFrames = play->gameplayFrames; @@ -1253,12 +1342,12 @@ void Scene_DrawConfigLostWoods(PlayState* play) { gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128); - if ((play->roomCtx.unk_74[0] == 0) && (INV_CONTENT(ITEM_COJIRO) == ITEM_COJIRO)) { - if (play->roomCtx.unk_74[1] == 50) { + if ((play->roomCtx.drawParams[0] == 0) && (INV_CONTENT(ITEM_COJIRO) == ITEM_COJIRO)) { + if (play->roomCtx.drawParams[1] == 50) { Player_PlaySfx(GET_PLAYER(play), NA_SE_EV_CHICKEN_CRY_M); - play->roomCtx.unk_74[0] = 1; + play->roomCtx.drawParams[0] = 1; } - play->roomCtx.unk_74[1]++; + play->roomCtx.drawParams[1]++; } CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7309); @@ -1349,27 +1438,22 @@ void Scene_DrawConfigDeathMountainTrail(PlayState* play) { gSPSegment(POLY_XLU_DISP++, 0x08, displayListHead); - if (1) {} - if ((gSaveContext.save.dayTime > CLOCK_TIME(7, 0)) && (gSaveContext.save.dayTime <= CLOCK_TIME(18, 0))) { - gSPEndDisplayList(displayListHead); + gSPEndDisplayList(displayListHead++); } else { if (gSaveContext.save.dayTime > CLOCK_TIME(18, 0)) { - if (play->roomCtx.unk_74[0] != 255) { - Math_StepToS(&play->roomCtx.unk_74[0], 255, 5); + if (play->roomCtx.drawParams[0] != 255) { + Math_StepToS(&play->roomCtx.drawParams[0], 255, 5); } } else if (gSaveContext.save.dayTime >= CLOCK_TIME(6, 0)) { - if (play->roomCtx.unk_74[0] != 0) { - Math_StepToS(&play->roomCtx.unk_74[0], 0, 10); + if (play->roomCtx.drawParams[0] != 0) { + Math_StepToS(&play->roomCtx.drawParams[0], 0, 10); } } - gDPSetPrimColor(displayListHead++, 0, 0, 255, 255, 255, play->roomCtx.unk_74[0]); - - if (0) {} - + gDPSetPrimColor(displayListHead++, 0, 0, 255, 255, 255, play->roomCtx.drawParams[0]); gSPDisplayList(displayListHead++, spot16_room_0DL_00AA48); - gSPEndDisplayList(displayListHead); + gSPEndDisplayList(displayListHead++); } gDPPipeSync(POLY_OPA_DISP++); @@ -1520,27 +1604,27 @@ void Scene_DrawConfigJabuJabu(PlayState* play) { 1.f + (1 * temp * Math_CosS(D_8012A39C))); View_SetDistortionSpeed(&play->view, 0.95f); - switch (play->roomCtx.unk_74[0]) { + switch (play->roomCtx.drawParams[0]) { case 0: break; case 1: - if (play->roomCtx.unk_74[1] < 1200) { - play->roomCtx.unk_74[1] += 200; + if (play->roomCtx.drawParams[1] < 1200) { + play->roomCtx.drawParams[1] += 200; } else { - play->roomCtx.unk_74[0]++; + play->roomCtx.drawParams[0]++; } break; case 2: - if (play->roomCtx.unk_74[1] > 0) { - play->roomCtx.unk_74[1] -= 30; + if (play->roomCtx.drawParams[1] > 0) { + play->roomCtx.drawParams[1] -= 30; } else { - play->roomCtx.unk_74[1] = 0; - play->roomCtx.unk_74[0] = 0; + play->roomCtx.drawParams[1] = 0; + play->roomCtx.drawParams[0] = 0; } break; } - D_8012A398 += 0.15f + (play->roomCtx.unk_74[1] * 0.001f); + D_8012A398 += 0.15f + (play->roomCtx.drawParams[1] * 0.001f); } if (play->roomCtx.curRoom.num == 2) { @@ -1549,7 +1633,7 @@ void Scene_DrawConfigJabuJabu(PlayState* play) { Matrix_Scale(1.005f, sinf(D_8012A398) * 0.8f, 1.005f, MTXMODE_NEW); } - gSPSegment(POLY_OPA_DISP++, 0x0D, MATRIX_NEW(play->state.gfxCtx, "../z_scene_table.c", 7809)); + gSPSegment(POLY_OPA_DISP++, 0x0D, MATRIX_FINALIZE(play->state.gfxCtx, "../z_scene_table.c", 7809)); CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7811); } @@ -1561,8 +1645,6 @@ void Scene_DrawConfigInsideGanonsCastle(PlayState* play) { gameplayFrames = play->gameplayFrames; - if (1) {} - gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 512, 32, 128, 1, gameplayFrames % 128, @@ -1611,7 +1693,9 @@ void Scene_DrawConfigBesitu(PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7910); } -void (*sSceneDrawConfigs[SDC_MAX])(PlayState*) = { +#if !PLATFORM_N64 // Scene_Draw is at beginning of file in N64 versions + +SceneDrawConfigFunc sSceneDrawConfigs[SDC_MAX] = { Scene_DrawConfigDefault, // SDC_DEFAULT Scene_DrawConfigHyruleField, // SDC_HYRULE_FIELD Scene_DrawConfigKakarikoVillage, // SDC_KAKARIKO_VILLAGE @@ -1668,7 +1752,8 @@ void (*sSceneDrawConfigs[SDC_MAX])(PlayState*) = { }; void Scene_Draw(PlayState* play) { - if ((R_HREG_MODE == HREG_MODE_SCENE_CONFIG) && IS_DEBUG) { +#if IS_DEBUG + if (R_HREG_MODE == HREG_MODE_SCENE_CONFIG) { if (R_SCENE_CONFIG_INIT != HREG_MODE_SCENE_CONFIG) { R_SCENE_CONFIG_INIT = HREG_MODE_SCENE_CONFIG; R_SCENE_CONFIG_DRAW_DEFAULT_DLIST = 1; @@ -1703,4 +1788,9 @@ void Scene_Draw(PlayState* play) { } else { sSceneDrawConfigs[play->sceneDrawConfig](play); } +#else + sSceneDrawConfigs[play->sceneDrawConfig](play); +#endif } + +#endif diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index bef23de1ef..a953bdb214 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -36,13 +36,11 @@ void SkelAnime_DrawLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3 if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); if (dList != NULL) { - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 805), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_skelanime.c", 805); gSPDisplayList(POLY_OPA_DISP++, dList); } } - if (1) {} - if (postLimbDraw != NULL) { postLimbDraw(play, limbIndex, &dList, &rot, arg); } @@ -74,7 +72,7 @@ void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, Over if (skeleton == NULL) { PRINTF(VT_FGCOL(RED)); - PRINTF("Si2_Lod_draw():skelがNULLです。\n"); // "skel is NULL." + PRINTF(T("Si2_Lod_draw():skelがNULLです。\n", "Si2_Lod_draw(): skel is NULL.\n")); PRINTF(VT_RST); return; } @@ -94,7 +92,7 @@ void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, Over if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); if (dList != NULL) { - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 881), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_skelanime.c", 881); gSPDisplayList(POLY_OPA_DISP++, dList); } } @@ -143,7 +141,7 @@ void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton, MATRIX_TO_MTX(*mtx, "../z_skelanime.c", 945); { OPEN_DISPS(play->state.gfxCtx, "../z_skelanime.c", 946); - gSPMatrix(POLY_OPA_DISP++, *mtx, G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, *mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, newDList); CLOSE_DISPS(play->state.gfxCtx, "../z_skelanime.c", 949); } @@ -187,7 +185,7 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable, if (skeleton == NULL) { PRINTF(VT_FGCOL(RED)); - PRINTF("Si2_Lod_draw_SV():skelがNULLです。\n"); // "skel is NULL." + PRINTF(T("Si2_Lod_draw_SV():skelがNULLです。\n", "Si2_Lod_draw_SV(): skel is NULL.\n")); PRINTF(VT_RST); return; } @@ -210,7 +208,7 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable, Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1033); - gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, newDList); mtx++; } else if (limbDList != NULL) { @@ -256,13 +254,11 @@ void SkelAnime_DrawLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3 if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); if (dList != NULL) { - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 1103), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_skelanime.c", 1103); gSPDisplayList(POLY_OPA_DISP++, dList); } } - if (1) {} - if (postLimbDraw != NULL) { postLimbDraw(play, limbIndex, &dList, &rot, arg); } @@ -292,7 +288,7 @@ void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable, Over if (skeleton == NULL) { PRINTF(VT_FGCOL(RED)); - PRINTF("Si2_draw():skelがNULLです。\n"); // "skel is NULL." + PRINTF(T("Si2_draw():skelがNULLです。\n", "Si2_draw(): skel is NULL.\n")); PRINTF(VT_RST); return; } @@ -312,7 +308,7 @@ void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable, Over if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); if (dList != NULL) { - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 1176), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_skelanime.c", 1176); gSPDisplayList(POLY_OPA_DISP++, dList); } } @@ -360,7 +356,7 @@ void SkelAnime_DrawFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { MATRIX_TO_MTX(*limbMatrices, "../z_skelanime.c", 1242); - gSPMatrix(POLY_OPA_DISP++, *limbMatrices, G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, *limbMatrices, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, newDList); (*limbMatrices)++; } else if (limbDList != NULL) { @@ -405,7 +401,7 @@ void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, if (skeleton == NULL) { PRINTF(VT_FGCOL(RED)); - PRINTF("Si2_draw_SV():skelがNULLです。\n"); // "skel is NULL." + PRINTF(T("Si2_draw_SV():skelがNULLです。\n", "Si2_draw_SV(): skel is NULL.\n")); PRINTF(VT_RST); return; } @@ -430,7 +426,7 @@ void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1327); - gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, newDList); mtx++; } else if (limbDList != NULL) { @@ -523,7 +519,7 @@ Gfx* SkelAnime_DrawLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg, &gfx)) { Matrix_TranslateRotateZYX(&pos, &rot); if (dList != NULL) { - gSPMatrix(gfx++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 1489), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(gfx++, play->state.gfxCtx, "../z_skelanime.c", 1489); gSPDisplayList(gfx++, dList); } } @@ -558,8 +554,7 @@ Gfx* SkelAnime_Draw(PlayState* play, void** skeleton, Vec3s* jointTable, Overrid if (skeleton == NULL) { PRINTF(VT_FGCOL(RED)); - // "skel is NULL. Returns NULL." - PRINTF("Si2_draw2():skelがNULLです。NULLを返します。\n"); + PRINTF(T("Si2_draw2():skelがNULLです。NULLを返します。\n", "Si2_draw2(): skel is NULL. Returns NULL.\n")); PRINTF(VT_RST); return NULL; } @@ -579,7 +574,7 @@ Gfx* SkelAnime_Draw(PlayState* play, void** skeleton, Vec3s* jointTable, Overrid if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg, &gfx)) { Matrix_TranslateRotateZYX(&pos, &rot); if (dList != NULL) { - gSPMatrix(gfx++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 1558), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(gfx++, play->state.gfxCtx, "../z_skelanime.c", 1558); gSPDisplayList(gfx++, dList); } } @@ -624,7 +619,7 @@ Gfx* SkelAnime_DrawFlexLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { MATRIX_TO_MTX(*mtx, "../z_skelanime.c", 1623); - gSPMatrix(gfx++, *mtx, G_MTX_LOAD); + gSPMatrix(gfx++, *mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gfx++, newDList); (*mtx)++; } else if (limbDList != NULL) { @@ -667,8 +662,7 @@ Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32 if (skeleton == NULL) { PRINTF(VT_FGCOL(RED)); - // "skel is NULL. Returns NULL." - PRINTF("Si2_draw2_SV():skelがNULLです。NULLを返します。\n"); + PRINTF(T("Si2_draw2_SV():skelがNULLです。NULLを返します。\n", "Si2_draw2_SV(): skel is NULL. Returns NULL.\n")); PRINTF(VT_RST); return NULL; } @@ -689,7 +683,7 @@ Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32 Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1710); - gSPMatrix(gfx++, mtx, G_MTX_LOAD); + gSPMatrix(gfx++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gfx++, newDList); mtx++; } else if (limbDList != NULL) { @@ -824,7 +818,7 @@ void AnimTaskQueue_SetNextGroup(PlayState* play) { * A transformative task is one that will alter the appearance of an animation. * These include Copy, Interp, CopyUsingMap, and CopyUsingMapInverted. * - * LoadPlayerFrame and ActorMove, which don't alter the appearance of an existing animation, + * LoadPlayerFrame and ActorMovement, which don't alter the appearance of an existing animation, * will always run even if a group has its transformative tasks disabled. */ void AnimTaskQueue_DisableTransformTasksForGroup(PlayState* play) { @@ -855,9 +849,14 @@ AnimTask* AnimTaskQueue_NewTask(AnimTaskQueue* animTaskQueue, s32 type) { return task; } +#if PLATFORM_N64 +#define LINK_ANIMATION_OFFSET(addr, offset) \ + (((uintptr_t)_link_animetionSegmentRomStart) + SEGMENT_OFFSET(addr) + (offset)) +#else #define LINK_ANIMATION_OFFSET(addr, offset) \ (((uintptr_t)_link_animetionSegmentRomStart) + ((uintptr_t)(addr)) - ((uintptr_t)_link_animetionSegmentStart) + \ (offset)) +#endif /** * Creates a task which will load a single frame of animation data from the link_animetion file. @@ -961,13 +960,13 @@ void AnimTaskQueue_AddCopyUsingMapInverted(PlayState* play, s32 vecCount, Vec3s* /** * Creates a task which will move an actor according to the translation of its root limb for the current frame. */ -void AnimTaskQueue_AddActorMove(PlayState* play, Actor* actor, SkelAnime* skelAnime, f32 moveDiffScaleY) { +void AnimTaskQueue_AddActorMovement(PlayState* play, Actor* actor, SkelAnime* skelAnime, f32 moveDiffScaleY) { AnimTask* task = AnimTaskQueue_NewTask(&play->animTaskQueue, ANIMTASK_ACTOR_MOVE); if (task != NULL) { - task->data.actorMove.actor = actor; - task->data.actorMove.skelAnime = skelAnime; - task->data.actorMove.diffScaleY = moveDiffScaleY; + task->data.actorMovement.actor = actor; + task->data.actorMovement.skelAnime = skelAnime; + task->data.actorMovement.diffScaleY = moveDiffScaleY; } } @@ -1050,9 +1049,10 @@ void AnimTask_CopyUsingMapInverted(PlayState* play, AnimTaskData* data) { /** * Move an actor according to the translation of its root limb for the current animation frame. + * The actor's current shape yaw will factor into the resulting movement. */ -void AnimTask_ActorMove(PlayState* play, AnimTaskData* data) { - AnimTaskActorMove* task = &data->actorMove; +void AnimTask_ActorMovement(PlayState* play, AnimTaskData* data) { + AnimTaskActorMovement* task = &data->actorMovement; Actor* actor = task->actor; Vec3f diff; @@ -1071,8 +1071,8 @@ typedef void (*AnimTaskFunc)(struct PlayState* play, AnimTaskData* data); */ void AnimTaskQueue_Update(PlayState* play, AnimTaskQueue* animTaskQueue) { static AnimTaskFunc animTaskFuncs[] = { - AnimTask_LoadPlayerFrame, AnimTask_Copy, AnimTask_Interp, AnimTask_CopyUsingMap, - AnimTask_CopyUsingMapInverted, AnimTask_ActorMove, + AnimTask_LoadPlayerFrame, AnimTask_Copy, AnimTask_Interp, AnimTask_CopyUsingMap, + AnimTask_CopyUsingMapInverted, AnimTask_ActorMovement, }; AnimTask* task = animTaskQueue->tasks; @@ -1130,8 +1130,8 @@ void SkelAnime_InitLink(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeade if ((skelAnime->jointTable == NULL) || (skelAnime->morphTable == NULL)) { PRINTF(VT_FGCOL(RED)); - // "Memory allocation error" - PRINTF("Skeleton_Info_Rom_SV_ct メモリアロケーションエラー\n"); + PRINTF(T("Skeleton_Info_Rom_SV_ct メモリアロケーションエラー\n", + "Skeleton_Info_Rom_SV_ct Memory allocation error\n")); PRINTF(VT_RST); } @@ -1444,7 +1444,7 @@ BAD_RETURN(s32) SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHe } if ((skelAnime->jointTable == NULL) || (skelAnime->morphTable == NULL)) { PRINTF(VT_FGCOL(RED)); - PRINTF("Skeleton_Info2_ct メモリアロケーションエラー\n"); // "Memory allocation error" + PRINTF(T("Skeleton_Info2_ct メモリアロケーションエラー\n", "Skeleton_Info2_ct Memory allocation error\n")); PRINTF(VT_RST); } @@ -1477,8 +1477,8 @@ BAD_RETURN(s32) SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSk } if ((skelAnime->jointTable == NULL) || (skelAnime->morphTable == NULL)) { PRINTF(VT_FGCOL(RED)); - // "Memory allocation error" - PRINTF("Skeleton_Info_Rom_SV_ct メモリアロケーションエラー\n"); + PRINTF(T("Skeleton_Info_Rom_SV_ct メモリアロケーションエラー\n", + "Skeleton_Info_Rom_SV_ct Memory allocation error\n")); PRINTF(VT_RST); } @@ -1502,8 +1502,8 @@ BAD_RETURN(s32) SkelAnime_InitSkin(PlayState* play, SkelAnime* skelAnime, Skelet ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 3121); if ((skelAnime->jointTable == NULL) || (skelAnime->morphTable == NULL)) { PRINTF(VT_FGCOL(RED)); - // "Memory allocation error" - PRINTF("Skeleton_Info2_skin2_ct メモリアロケーションエラー\n"); + PRINTF(T("Skeleton_Info2_skin2_ct メモリアロケーションエラー\n", + "Skeleton_Info2_skin2_ct Memory allocation error\n")); PRINTF(VT_RST); } @@ -1839,7 +1839,7 @@ void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle) { f32 cos; // If `ANIM_FLAG_UPDATE_XZ` behaved as expected, it would also be checked here - if (skelAnime->moveFlags & ANIM_FLAG_NO_MOVE) { + if (skelAnime->movementFlags & ANIM_FLAG_ADJUST_STARTING_POS) { diff->x = diff->z = 0.0f; } else { x = skelAnime->jointTable[0].x; @@ -1865,8 +1865,8 @@ void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle) { skelAnime->prevTransl.z = skelAnime->jointTable[0].z; skelAnime->jointTable[0].z = skelAnime->baseTransl.z; - if (skelAnime->moveFlags & ANIM_FLAG_UPDATE_Y) { - if (skelAnime->moveFlags & ANIM_FLAG_NO_MOVE) { + if (skelAnime->movementFlags & ANIM_FLAG_UPDATE_Y) { + if (skelAnime->movementFlags & ANIM_FLAG_ADJUST_STARTING_POS) { diff->y = 0.0f; } else { diff->y = skelAnime->jointTable[0].y - skelAnime->prevTransl.y; @@ -1879,7 +1879,7 @@ void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle) { skelAnime->prevTransl.y = skelAnime->jointTable[0].y; } - skelAnime->moveFlags &= ~ANIM_FLAG_NO_MOVE; + skelAnime->movementFlags &= ~ANIM_FLAG_ADJUST_STARTING_POS; } /** @@ -1896,13 +1896,13 @@ void SkelAnime_Free(SkelAnime* skelAnime, PlayState* play) { if (skelAnime->jointTable != NULL) { ZELDA_ARENA_FREE(skelAnime->jointTable, "../z_skelanime.c", 3729); } else { - PRINTF("now_joint あきまへん!!\n"); // "now_joint is freed! !" + PRINTF(T("now_joint あきまへん!!\n", "now_joint is freed!!\n")); } if (skelAnime->morphTable != NULL) { ZELDA_ARENA_FREE(skelAnime->morphTable, "../z_skelanime.c", 3731); } else { - PRINTF("morf_joint あきまへん!!\n"); // "morf_joint is freed !!" + PRINTF(T("morf_joint あきまへん!!\n", "morf_joint is freed!!\n")); } } diff --git a/src/code/z_skin.c b/src/code/z_skin.c index 69a14f0656..55af9b1e2d 100644 --- a/src/code/z_skin.c +++ b/src/code/z_skin.c @@ -1,5 +1,8 @@ #include "global.h" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "pal-1.1:128" + MtxF gSkinLimbMatrices[60]; // holds matrices for each limb of the skeleton currently being drawn static s32 sUnused; diff --git a/src/code/z_skin_matrix.c b/src/code/z_skin_matrix.c index 46d2fbe4c1..e5d0dfe99b 100644 --- a/src/code/z_skin_matrix.c +++ b/src/code/z_skin_matrix.c @@ -253,7 +253,8 @@ s32 SkinMatrix_Invert(MtxF* src, MtxF* dest) { // Therefore src is a singular matrix (0 determinant). PRINTF(VT_COL(YELLOW, BLACK)); - PRINTF("Skin_Matrix_InverseMatrix():逆行列つくれません\n"); + PRINTF(T("Skin_Matrix_InverseMatrix():逆行列つくれません\n", + "Skin_Matrix_InverseMatrix(): Cannot create inverse matrix\n")); PRINTF(VT_RST); return 2; } @@ -589,7 +590,8 @@ Mtx* SkinMatrix_MtxFToNewMtx(GraphicsContext* gfxCtx, MtxF* src) { Mtx* mtx = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); if (mtx == NULL) { - PRINTF("Skin_Matrix_to_Mtx_new() 確保失敗:NULLを返して終了\n", mtx); + PRINTF(T("Skin_Matrix_to_Mtx_new() 確保失敗:NULLを返して終了\n", + "Skin_Matrix_to_Mtx_new() allocation failed: Return NULL and exit\n")); return NULL; } SkinMatrix_MtxFToMtx(src, mtx); diff --git a/src/code/z_sram.c b/src/code/z_sram.c index bf202e0e4f..67e27fdcd5 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -1,5 +1,6 @@ #include "global.h" #include "terminal.h" +#include "versions.h" #define SLOT_SIZE (sizeof(SaveContext) + 0x28) #define CHECKSUM_SIZE (sizeof(Save) / 2) @@ -10,7 +11,9 @@ #define HEALTH_CAP offsetof(SaveContext, save.info.playerData.healthCapacity) #define QUEST offsetof(SaveContext, save.info.inventory.questItems) #define DEFENSE offsetof(SaveContext, save.info.inventory.defenseHearts) +#if OOT_PAL #define HEALTH offsetof(SaveContext, save.info.playerData.health) +#endif #define SLOT_OFFSET(index) (SRAM_HEADER_SIZE + 0x10 + (index * SLOT_SIZE)) @@ -166,6 +169,18 @@ void Sram_InitNewSave(void) { static SavePlayerData sDebugSavePlayerData = { { 'Z', 'E', 'L', 'D', 'A', 'Z' }, // newf 0, // deaths +#if OOT_VERSION < PAL_1_0 + { + 0x81, // リ + 0x87, // ン + 0x61, // ク + FILENAME_SPACE, + FILENAME_SPACE, + FILENAME_SPACE, + FILENAME_SPACE, + FILENAME_SPACE, + }, // playerName +#else { FILENAME_UPPERCASE('L'), FILENAME_UPPERCASE('I'), @@ -175,7 +190,8 @@ static SavePlayerData sDebugSavePlayerData = { FILENAME_SPACE, FILENAME_SPACE, FILENAME_SPACE, - }, // playerName + }, // playerName +#endif 0, // n64ddFlag 0xE0, // healthCapacity 0xE0, // health @@ -363,9 +379,9 @@ void Sram_OpenSave(SramContext* sramCtx) { u16 j; u8* ptr; - PRINTF("個人File作成\n"); // "Create personal file" + PRINTF(T("個人File作成\n", "Create personal file\n")); i = gSramSlotOffsets[gSaveContext.fileNum]; - PRINTF("ぽいんと=%x(%d)\n", i, gSaveContext.fileNum); // "Point=" + PRINTF(T("ぽいんと=%x(%d)\n", "Point=%x(%d)\n"), i, gSaveContext.fileNum); MemCpy(&gSaveContext, sramCtx->readBuff + i, sizeof(Save)); @@ -496,9 +512,11 @@ void Sram_OpenSave(SramContext* sramCtx) { if (LINK_AGE_IN_YEARS == YEARS_ADULT && !CHECK_OWNED_EQUIP(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_MASTER)) { gSaveContext.save.info.inventory.equipment |= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_MASTER); +#if OOT_VERSION >= NTSC_1_1 gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_MASTER; gSaveContext.save.info.equips.equipment &= ~(0xF << (EQUIP_TYPE_SWORD * 4)); gSaveContext.save.info.equips.equipment |= EQUIP_VALUE_SWORD_MASTER << (EQUIP_TYPE_SWORD * 4); +#endif } for (i = 0; i < ARRAY_COUNT(gSpoilingItems); i++) { @@ -591,7 +609,8 @@ void Sram_VerifyAndLoadAllSaves(FileSelectState* fileSelect, SramContext* sramCt for (slotNum = 0; slotNum < 3; slotNum++) { offset = gSramSlotOffsets[slotNum]; - PRINTF("ぽいんと=%x(%d) SAVE_MAX=%d\n", offset, gSaveContext.fileNum, sizeof(Save)); + PRINTF(T("ぽいんと=%x(%d) SAVE_MAX=%d\n", "Point=%x(%d) SAVE_MAX=%d\n"), offset, gSaveContext.fileNum, + sizeof(Save)); MemCpy(&gSaveContext, sramCtx->readBuff + offset, sizeof(Save)); oldChecksum = gSaveContext.save.info.checksum; @@ -600,11 +619,18 @@ void Sram_VerifyAndLoadAllSaves(FileSelectState* fileSelect, SramContext* sramCt PRINTF("\n============= S(%d) =============\n", slotNum); for (i = newChecksum = j = 0; i < CHECKSUM_SIZE; i++, offset += 2) { +#if OOT_VERSION < PAL_1_0 + if (j) {} + j += 2; + if (j == 0x20) { + j = 0; + } +#endif newChecksum += *ptr++; } - // "SAVE checksum calculation" - PRINTF("\nSAVEチェックサム計算 j=%x mmm=%x ", newChecksum, oldChecksum); + PRINTF(T("\nSAVEチェックサム計算 j=%x mmm=%x ", "\nSAVE checksum calculation j=%x mmm=%x "), + newChecksum, oldChecksum); if (newChecksum != oldChecksum) { // checksum didnt match, try backup save @@ -618,10 +644,18 @@ void Sram_VerifyAndLoadAllSaves(FileSelectState* fileSelect, SramContext* sramCt PRINTF("================= BACK─UP ========================\n"); for (i = newChecksum = j = 0; i < CHECKSUM_SIZE; i++, offset += 2) { +#if OOT_VERSION < PAL_1_0 + if (j) {} + j += 2; + if (j == 0x20) { + j = 0; + } +#endif newChecksum += *ptr++; } - // "(B) SAVE checksum calculation" - PRINTF("\n(B)SAVEチェックサム計算 j=%x mmm=%x ", newChecksum, oldChecksum); + PRINTF(T("\n(B)SAVEチェックサム計算 j=%x mmm=%x ", + "\n(B) SAVE checksum calculation j=%x mmm=%x "), + newChecksum, oldChecksum); if (newChecksum != oldChecksum) { // backup save didnt work, make new save @@ -679,16 +713,17 @@ void Sram_VerifyAndLoadAllSaves(FileSelectState* fileSelect, SramContext* sramCt gSaveContext.save.info.playerData.newf[1], gSaveContext.save.info.playerData.newf[2], gSaveContext.save.info.playerData.newf[3], gSaveContext.save.info.playerData.newf[4], gSaveContext.save.info.playerData.newf[5]); - PRINTF("\nぽいんと=%x(%d+3) check_sum=%x(%x)\n", i, slotNum, gSaveContext.save.info.checksum, - newChecksum); + PRINTF(T("\nぽいんと=%x(%d+3) check_sum=%x(%x)\n", "\npoints=%x(%d+3) check_sum=%x(%x)\n"), i, + slotNum, gSaveContext.save.info.checksum, newChecksum); } i = gSramSlotOffsets[slotNum]; SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000) + i, &gSaveContext, SLOT_SIZE, OS_WRITE); - PRINTF("ぽいんと=%x(%d) check_sum=%x(%x)\n", i, slotNum, gSaveContext.save.info.checksum, newChecksum); + PRINTF(T("ぽいんと=%x(%d) check_sum=%x(%x)\n", "point=%x(%d) check_sum=%x(%x)\n"), i, slotNum, + gSaveContext.save.info.checksum, newChecksum); } else { - PRINTF("\nSAVEデータ OK!!!!\n"); // "SAVE data OK! ! ! !" + PRINTF(T("\nSAVEデータ OK!!!!\n", "\nSAVE data OK!!!!\n")); } } @@ -726,13 +761,17 @@ void Sram_VerifyAndLoadAllSaves(FileSelectState* fileSelect, SramContext* sramCt MemCpy(&fileSelect->defense[1], sramCtx->readBuff + SLOT_OFFSET(1) + DEFENSE, sizeof(fileSelect->defense[0])); MemCpy(&fileSelect->defense[2], sramCtx->readBuff + SLOT_OFFSET(2) + DEFENSE, sizeof(fileSelect->defense[0])); +#if OOT_PAL MemCpy(&fileSelect->health[0], sramCtx->readBuff + SLOT_OFFSET(0) + HEALTH, sizeof(fileSelect->health[0])); MemCpy(&fileSelect->health[1], sramCtx->readBuff + SLOT_OFFSET(1) + HEALTH, sizeof(fileSelect->health[0])); MemCpy(&fileSelect->health[2], sramCtx->readBuff + SLOT_OFFSET(2) + HEALTH, sizeof(fileSelect->health[0])); +#endif PRINTF("f_64dd=%d, %d, %d\n", fileSelect->n64ddFlags[0], fileSelect->n64ddFlags[1], fileSelect->n64ddFlags[2]); PRINTF("heart_status=%d, %d, %d\n", fileSelect->defense[0], fileSelect->defense[1], fileSelect->defense[2]); +#if OOT_PAL PRINTF("now_life=%d, %d, %d\n", fileSelect->health[0], fileSelect->health[1], fileSelect->health[2]); +#endif } void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx) { @@ -774,7 +813,7 @@ void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx) { gSaveContext.save.info.playerData.newf[5] = 'Z'; gSaveContext.save.info.playerData.n64ddFlag = fileSelect->n64ddFlag; - PRINTF("64DDフラグ=%d\n", fileSelect->n64ddFlag); + PRINTF(T("64DDフラグ=%d\n", "64DD flags=%d\n"), fileSelect->n64ddFlag); PRINTF("newf=%x,%x,%x,%x,%x,%x\n", gSaveContext.save.info.playerData.newf[0], gSaveContext.save.info.playerData.newf[1], gSaveContext.save.info.playerData.newf[2], gSaveContext.save.info.playerData.newf[3], gSaveContext.save.info.playerData.newf[4], @@ -793,7 +832,7 @@ void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx) { } gSaveContext.save.info.checksum = checksum; - PRINTF("\nチェックサム=%x\n", gSaveContext.save.info.checksum); // "Checksum = %x" + PRINTF(T("\nチェックサム=%x\n", "\nChecksum = %x\n"), gSaveContext.save.info.checksum); offset = gSramSlotOffsets[gSaveContext.fileNum]; PRINTF("I=%x no=%d\n", offset, gSaveContext.fileNum); @@ -805,7 +844,7 @@ void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx) { SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), sramCtx->readBuff, SRAM_SIZE, OS_WRITE); - PRINTF("SAVE終了\n"); // "SAVE end" + PRINTF(T("SAVE終了\n", "SAVE end\n")); PRINTF("z_common_data.file_no = %d\n", gSaveContext.fileNum); PRINTF("SAVECT=%x, NAME=%x, LIFE=%x, ITEM=%x, SAVE_64DD=%x\n", DEATHS, NAME, HEALTH_CAP, QUEST, N64DD); @@ -821,11 +860,15 @@ void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx) { MemCpy(&fileSelect->n64ddFlags[gSaveContext.fileNum], sramCtx->readBuff + j + N64DD, sizeof(fileSelect->n64ddFlags[0])); MemCpy(&fileSelect->defense[gSaveContext.fileNum], sramCtx->readBuff + j + DEFENSE, sizeof(fileSelect->defense[0])); +#if OOT_PAL MemCpy(&fileSelect->health[gSaveContext.fileNum], sramCtx->readBuff + j + HEALTH, sizeof(fileSelect->health[0])); +#endif PRINTF("f_64dd[%d]=%d\n", gSaveContext.fileNum, fileSelect->n64ddFlags[gSaveContext.fileNum]); PRINTF("heart_status[%d]=%d\n", gSaveContext.fileNum, fileSelect->defense[gSaveContext.fileNum]); +#if OOT_PAL PRINTF("now_life[%d]=%d\n", gSaveContext.fileNum, fileSelect->health[gSaveContext.fileNum]); +#endif } void Sram_EraseSave(FileSelectState* fileSelect, SramContext* sramCtx) { @@ -844,7 +887,7 @@ void Sram_EraseSave(FileSelectState* fileSelect, SramContext* sramCtx) { MemCpy(sramCtx->readBuff + offset, &gSaveContext, sizeof(Save)); SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000) + offset, &gSaveContext, SLOT_SIZE, OS_WRITE); - PRINTF("CLEAR終了\n"); + PRINTF(T("CLEAR終了\n", "CLEAR END\n")); } void Sram_CopySave(FileSelectState* fileSelect, SramContext* sramCtx) { @@ -879,12 +922,14 @@ void Sram_CopySave(FileSelectState* fileSelect, SramContext* sramCtx) { sizeof(fileSelect->n64ddFlags[0])); MemCpy(&fileSelect->defense[fileSelect->copyDestFileIndex], sramCtx->readBuff + offset + DEFENSE, sizeof(fileSelect->defense[0])); +#if OOT_PAL MemCpy(&fileSelect->health[fileSelect->copyDestFileIndex], (sramCtx->readBuff + offset) + HEALTH, sizeof(fileSelect->health[0])); +#endif PRINTF("f_64dd[%d]=%d\n", gSaveContext.fileNum, fileSelect->n64ddFlags[gSaveContext.fileNum]); PRINTF("heart_status[%d]=%d\n", gSaveContext.fileNum, fileSelect->defense[gSaveContext.fileNum]); - PRINTF("COPY終了\n"); // "Copy end" + PRINTF(T("COPY終了\n", "Copy end\n")); } /** @@ -902,23 +947,31 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) { for (i = 0; i < ARRAY_COUNTU(sZeldaMagic) - 3; i++) { if (sZeldaMagic[i + SRAM_HEADER_MAGIC] != sramCtx->readBuff[i + SRAM_HEADER_MAGIC]) { - PRINTF("SRAM破壊!!!!!!\n"); // "SRAM destruction! ! ! ! ! !" + PRINTF(T("SRAM破壊!!!!!!\n", "SRAM destruction!!!!!!\n")); +#if PLATFORM_GC && OOT_PAL gSaveContext.language = sramCtx->readBuff[SRAM_HEADER_LANGUAGE]; +#endif + MemCpy(sramCtx->readBuff, sZeldaMagic, sizeof(sZeldaMagic)); + +#if PLATFORM_GC && OOT_PAL sramCtx->readBuff[SRAM_HEADER_LANGUAGE] = gSaveContext.language; +#endif Sram_WriteSramHeader(sramCtx); } } gSaveContext.audioSetting = sramCtx->readBuff[SRAM_HEADER_SOUND] & 3; gSaveContext.zTargetSetting = sramCtx->readBuff[SRAM_HEADER_ZTARGET] & 1; - gSaveContext.language = sramCtx->readBuff[SRAM_HEADER_LANGUAGE]; +#if OOT_PAL + gSaveContext.language = sramCtx->readBuff[SRAM_HEADER_LANGUAGE]; if (gSaveContext.language >= LANGUAGE_MAX) { gSaveContext.language = LANGUAGE_ENG; sramCtx->readBuff[SRAM_HEADER_LANGUAGE] = gSaveContext.language; Sram_WriteSramHeader(sramCtx); } +#endif #if IS_DEBUG if (CHECK_BTN_ANY(gameState->input[2].cur.button, BTN_DRIGHT)) { @@ -927,12 +980,12 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) { sramCtx->readBuff[i] = i; } SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), sramCtx->readBuff, SRAM_SIZE, OS_WRITE); - PRINTF("SRAM破壊!!!!!!\n"); // "SRAM destruction! ! ! ! ! !" + PRINTF(T("SRAM破壊!!!!!!\n", "SRAM destruction!!!!!!\n")); } #endif - // "GOOD! GOOD! Size = %d + %d = %d" - PRINTF("GOOD!GOOD! サイズ=%d + %d = %d\n", sizeof(SaveInfo), 4, sizeof(SaveInfo) + 4); + PRINTF(T("GOOD!GOOD! サイズ=%d + %d = %d\n", "GOOD! GOOD! Size = %d + %d = %d\n"), sizeof(SaveInfo), 4, + sizeof(SaveInfo) + 4); PRINTF(VT_FGCOL(BLUE)); PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.audioSetting); PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.audioSetting); diff --git a/src/code/z_ss_sram.c b/src/code/z_ss_sram.c index 75c61539a2..dd26d695cb 100644 --- a/src/code/z_ss_sram.c +++ b/src/code/z_ss_sram.c @@ -1,7 +1,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct SsSramContext { /* 0x00 */ OSPiHandle piHandle; /* 0x74 */ OSIoMesg ioMesg; /* 0x8C */ OSMesgQueue msgQueue; diff --git a/src/code/z_view.c b/src/code/z_view.c index e3ab58ff0a..d8869ef57a 100644 --- a/src/code/z_view.c +++ b/src/code/z_view.c @@ -37,7 +37,7 @@ View* View_New(GraphicsContext* gfxCtx) { View* view = SYSTEM_ARENA_MALLOC(sizeof(View), "../z_view.c", 285); if (view != NULL) { - __osMemset(view, 0, sizeof(View)); + memset(view, 0, sizeof(View)); View_Init(view, gfxCtx); } @@ -155,8 +155,8 @@ void View_GetViewport(View* view, Viewport* viewport) { void View_ApplyLetterbox(View* view) { GraphicsContext* gfxCtx = view->gfxCtx; - s32 letterboxSize; s32 pillarboxSize; + s32 letterboxSize; s32 ulx; s32 uly; s32 lrx; @@ -430,9 +430,9 @@ s32 View_ApplyPerspective(View* view) { } s32 View_ApplyOrtho(View* view) { + GraphicsContext* gfxCtx = view->gfxCtx; Vp* vp; Mtx* projection; - GraphicsContext* gfxCtx = view->gfxCtx; OPEN_DISPS(gfxCtx, "../z_view.c", 726); @@ -720,8 +720,9 @@ s32 View_ErrorCheckEyePosition(f32 eyeX, f32 eyeY, f32 eyeZ) { if (error != 0) { PRINTF(VT_FGCOL(RED)); - // "Is too large" - PRINTF("eye が大きすぎます eye=[%8.3f %8.3f %8.3f] error=%d\n", eyeX, eyeY, eyeZ, error); + PRINTF(T("eye が大きすぎます eye=[%8.3f %8.3f %8.3f] error=%d\n", + "eye is too large eye=[%8.3f %8.3f %8.3f] error=%d\n"), + eyeX, eyeY, eyeZ, error); PRINTF(VT_RST); } diff --git a/src/code/z_vimode.c b/src/code/z_vimode.c index d9478867fb..a971810758 100644 --- a/src/code/z_vimode.c +++ b/src/code/z_vimode.c @@ -1,5 +1,6 @@ #include "global.h" #include "ultra64/viint.h" +#include "versions.h" void ViMode_LogPrint(OSViMode* osViMode) { LOG_ADDRESS("osvimodep", osViMode, "../z_vimode.c", 87); @@ -85,7 +86,7 @@ void ViMode_Configure(ViMode* viMode, s32 type, s32 tvType, s32 loRes, s32 antia yScaleHiOddField = modeF ? (loResInterlaced ? (F210(0.75) << 16) : (F210(0.5) << 16)) : 0; viMode->customViMode.type = type; - viMode->customViMode.comRegs.ctrl = VI_CTRL_PIXEL_ADV(3) | VI_CTRL_GAMMA_ON | VI_CTRL_GAMMA_DITHER_ON | + viMode->customViMode.comRegs.ctrl = VI_CTRL_PIXEL_ADV_3 | VI_CTRL_GAMMA_ON | VI_CTRL_GAMMA_DITHER_ON | (!loResDeinterlaced ? VI_CTRL_SERRATE_ON : 0) | (antialiasOn ? VI_CTRL_DIVOT_ON : 0) | (fb32Bit ? VI_CTRL_TYPE_32 : VI_CTRL_TYPE_16); @@ -182,6 +183,7 @@ void ViMode_Save(ViMode* viMode) { R_VI_MODE_EDIT_ULX_ADJ = viMode->leftAdjust; R_VI_MODE_EDIT_LRX_ADJ = viMode->rightAdjust; +#if OOT_VERSION >= PAL_1_0 if (SREG(58) == 1) { SREG(58) = 0; @@ -200,6 +202,7 @@ void ViMode_Save(ViMode* viMode) { break; } } +#endif } void ViMode_Load(ViMode* viMode) { @@ -270,8 +273,18 @@ void ViMode_Update(ViMode* viMode, Input* input) { // Load state from REGs ViMode_Load(viMode); +#if OOT_VERSION < PAL_1_0 + if (viMode->editState == VI_MODE_EDIT_STATE_NEGATIVE_2) { + // Log comparison between the NTSC LAN1 mode and the custom mode + ViMode_LogPrint(&osViModeNtscLan1); + ViMode_LogPrint(&viMode->customViMode); + viMode->editState = VI_MODE_EDIT_STATE_NEGATIVE_1; + } else if ((viMode->editState == VI_MODE_EDIT_STATE_2) || (viMode->editState == VI_MODE_EDIT_STATE_3)) +#else if ((viMode->editState == VI_MODE_EDIT_STATE_ACTIVE) || (viMode->editState == VI_MODE_EDIT_STATE_2) || - (viMode->editState == VI_MODE_EDIT_STATE_3)) { + (viMode->editState == VI_MODE_EDIT_STATE_3)) +#endif + { gScreenWidth = viMode->viWidth; gScreenHeight = viMode->viHeight; @@ -333,6 +346,21 @@ void ViMode_Update(ViMode* viMode, Input* input) { } // Clamp adjustments +#if OOT_VERSION < PAL_1_0 + // Do not allow parts of the framebuffer to end up offscreen + if (viMode->leftAdjust < 0) { + viMode->leftAdjust = 0; + } + if (viMode->upperAdjust < 0) { + viMode->upperAdjust = 0; + } + if (viMode->rightAdjust > 0) { + viMode->rightAdjust = 0; + } + if (viMode->lowerAdjust > 0) { + viMode->lowerAdjust = 0; + } +#else if (viMode->editState >= VI_MODE_EDIT_STATE_2) { // Allow parts of the framebuffer to possibly be offscreen by a small margin if (viMode->leftAdjust < -16) { @@ -362,11 +390,21 @@ void ViMode_Update(ViMode* viMode, Input* input) { viMode->lowerAdjust = 0; } } +#endif // Configure the custom VI mode with the selected settings ViMode_Configure(viMode, OS_VI_MPAL_LPN1, osTvType, viMode->loRes, viMode->antialiasOff, viMode->modeN, viMode->fb16Bit, viMode->viWidth, viMode->viHeight, viMode->leftAdjust, viMode->rightAdjust, viMode->upperAdjust, viMode->lowerAdjust); + +#if OOT_VERSION < PAL_1_0 + if (viMode->editState == VI_MODE_EDIT_STATE_3) { + // Log comparison between the NTSC LAN1 mode and the custom mode + ViMode_LogPrint(&osViModeNtscLan1); + ViMode_LogPrint(&viMode->customViMode); + } +#endif + ViMode_ConfigureFeatures(viMode, viMode->viFeatures); if (viMode->editState == VI_MODE_EDIT_STATE_3) { diff --git a/src/code/z_vismono.c b/src/code/z_vismono.c index b0c91de601..b169f5b026 100644 --- a/src/code/z_vismono.c +++ b/src/code/z_vismono.c @@ -96,8 +96,7 @@ Gfx* VisMono_DesaturateDList(VisMono* this, Gfx* gfx) { // Its position in texture image space is shifted along +S by 2 gDPSetTile(gfx++, G_IM_FMT_CI, G_IM_SIZ_8b, SCREEN_WIDTH * 2 * G_IM_SIZ_8b_LINE_BYTES / 8, 0x0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 0, 0, G_TX_NOMIRROR | G_TX_CLAMP, 0, 0); - gDPSetTileSize(gfx++, G_TX_RENDERTILE, 2 << 2, 0, (SCREEN_WIDTH * 2 + 1) << 2, - (VISMONO_CFBFRAG_HEIGHT - 1) << 2); + gDPSetTileSize(gfx++, G_TX_RENDERTILE, 2 << 2, 0, ((SCREEN_WIDTH * 2) + 1) << 2, (height - 1) << 2); // Set texel 1 to be a CI8 image with width `SCREEN_WIDTH * 2` and height `VISMONO_CFBFRAG_HEIGHT` // Its position in texture image space is shifted along +S by 1 @@ -105,7 +104,7 @@ Gfx* VisMono_DesaturateDList(VisMono* this, Gfx* gfx) { // ignored for CI8 texture sampling. gDPSetTile(gfx++, G_IM_FMT_CI, G_IM_SIZ_8b, SCREEN_WIDTH * 2 * G_IM_SIZ_8b_LINE_BYTES / 8, 0x0, 1, 1, G_TX_NOMIRROR | G_TX_CLAMP, 0, 0, G_TX_NOMIRROR | G_TX_CLAMP, 0, 0); - gDPSetTileSize(gfx++, 1, 1 << 2, 0, (SCREEN_WIDTH * 2) << 2, (VISMONO_CFBFRAG_HEIGHT - 1) << 2); + gDPSetTileSize(gfx++, 1, 1 << 2, 0, (SCREEN_WIDTH * 2) << 2, (height - 1) << 2); // Draw a `SCREEN_WIDTH` wide, `height` high rectangle. // Texture coordinate T (vertical) starts at 0 and changes by one each line (dtdy = 1) diff --git a/src/code/z_viszbuf.c b/src/code/z_viszbuf.c index 3e9f15eb52..5a542bc124 100644 --- a/src/code/z_viszbuf.c +++ b/src/code/z_viszbuf.c @@ -66,6 +66,7 @@ void VisZBuf_Destroy(VisZBuf* this) { void VisZBuf_Draw(VisZBuf* this, Gfx** gfxP) { Gfx* gfx = *gfxP; + s32 pad; u16* zbufFrag = D_0E000000; s32 fmt; s32 y; diff --git a/src/code/z_vr_box.c b/src/code/z_vr_box.c index 9dfe2bbc58..4592a4940f 100644 --- a/src/code/z_vr_box.c +++ b/src/code/z_vr_box.c @@ -2,7 +2,7 @@ #include "terminal.h" #include "z64environment.h" -typedef struct { +typedef struct SkyboxFaceParams { /* 0x000 */ s32 xStart; /* 0x004 */ s32 yStart; /* 0x008 */ s32 zStart; @@ -69,10 +69,10 @@ s32 Skybox_CalculateFace256(SkyboxContext* skyboxCtx, Vtx* roomVtx, s32 roomVtxS s32 k; u16 index; s16 m; + s16 l; s16 ult; s16 uls; s16 vtxIdx; - s16 l; s32 xPoints[9 * 5]; s32 yPoints[9 * 5]; s32 zPoints[9 * 5]; @@ -304,6 +304,8 @@ s32 Skybox_CalculateFace128(SkyboxContext* skyboxCtx, Vtx* roomVtx, s32 roomVtxS break; } + if (1) {} + // Select gfx buffer skyboxCtx->gfx = &skyboxCtx->dListBuf[2 * faceNum][0]; diff --git a/src/compression/yaz0.c b/src/compression/yaz0.c index 2f4701ccd0..8d95170817 100644 --- a/src/compression/yaz0.c +++ b/src/compression/yaz0.c @@ -1,6 +1,9 @@ #include "global.h" #include "compression.h" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:128 pal-1.1:128" + ALIGNED(16) u8 sYaz0DataBuffer[0x400]; u8* sYaz0DataBufferEnd; uintptr_t sYaz0CurRomStart; diff --git a/src/debug/collision_view.c b/src/debug/collision_view.c index f50d2cefb8..43af60fc27 100644 --- a/src/debug/collision_view.c +++ b/src/debug/collision_view.c @@ -1,5 +1,6 @@ #include "global.h" #include "debug.h" +#include "fault.h" #if ENABLE_HACKER_DEBUG diff --git a/src/gcc_fix/missing_gcc_functions.c b/src/gcc_fix/missing_gcc_functions.c index 43e094b35c..729b9845fa 100644 --- a/src/gcc_fix/missing_gcc_functions.c +++ b/src/gcc_fix/missing_gcc_functions.c @@ -26,38 +26,6 @@ int memcmp(const void* s1, const void* s2, size_t n) { return 0; } -void* memset(void* str, int c, size_t n) { - u8* m = str; - size_t i; - - for (i = 0; i < n; i++) { - m[i] = c; - } - - return str; -} - -void* memmove(void* dest, const void* src, size_t len) { - u8* d = dest; - const u8* s = src; - - if (d == s) { - return dest; - } - if (d < s) { - while (len--) { - *d++ = *s++; - } - } else { - d += len - 1; - s += len - 1; - while (len--) { - *d-- = *s--; - } - } - return dest; -} - // Conversions involving 64-bit integer types required by the O32 MIPS ABI. // f32 -> u64, negative values become 0 diff --git a/src/libc/absf.s b/src/libc/absf.s new file mode 100644 index 0000000000..9df0c0a380 --- /dev/null +++ b/src/libc/absf.s @@ -0,0 +1,15 @@ +#include "ultra64/asm.h" + +#if OOT_DEBUG +.set noreorder +#endif + +.section .text + +.balign 16 + +LEAF(absf) + abs.s $f0, $f12 + jr $ra + nop +END(absf) diff --git a/src/code/fmodf.c b/src/libc/fmodf.c similarity index 100% rename from src/code/fmodf.c rename to src/libc/fmodf.c diff --git a/src/code/__osMemmove.c b/src/libc/memmove.c similarity index 82% rename from src/code/__osMemmove.c rename to src/libc/memmove.c index 892fee5eeb..302981f580 100644 --- a/src/code/__osMemmove.c +++ b/src/libc/memmove.c @@ -1,4 +1,4 @@ -#include "global.h" +#include "string.h" /** * memmove: copies `len` bytes from memory starting at `src` to memory starting at `dest`. @@ -11,9 +11,9 @@ * * @return dest */ -void* __osMemmove(void* dest, const void* src, size_t len) { - u8* d = dest; - const u8* s = src; +void* memmove(void* dest, const void* src, size_t len) { + char* d = dest; + const char* s = src; if (d == s) { return dest; diff --git a/src/code/__osMemset.c b/src/libc/memset.c similarity index 67% rename from src/code/__osMemset.c rename to src/libc/memset.c index 703d3a8c1e..31dba02ed8 100644 --- a/src/code/__osMemset.c +++ b/src/libc/memset.c @@ -1,4 +1,4 @@ -#include "global.h" +#include "string.h" /** * memset: sets `len` bytes to `val` starting at address `dest`. @@ -6,13 +6,13 @@ * @see There are two other memsets in this codebase, Lib_MemSet(), MemSet() * * @param dest address to start at - * @param val value to write (s32, but interpreted as u8) + * @param val value to write (int, but interpreted as u8) * @param len number of bytes to write * * @return dest */ -void* __osMemset(void* dest, s32 val, size_t len) { - u8* ptr = dest; +void* memset(void* dest, int val, size_t len) { + char* ptr = dest; while (len--) { *ptr++ = val; diff --git a/src/libc/sqrt.s b/src/libc/sqrt.s new file mode 100644 index 0000000000..b4246ec865 --- /dev/null +++ b/src/libc/sqrt.s @@ -0,0 +1,15 @@ +#include "ultra64/asm.h" + +#if OOT_DEBUG +.set noreorder +#endif + +.section .text + +.balign 16 + +LEAF(sqrt) + sqrt.d $f0, $f12 + jr $ra + nop +END(sqrt) diff --git a/src/code/__osMalloc.c b/src/libc64/__osMalloc_gc.c similarity index 75% rename from src/code/__osMalloc.c rename to src/libc64/__osMalloc_gc.c index db5522ff03..f943acccec 100644 --- a/src/code/__osMalloc.c +++ b/src/libc64/__osMalloc_gc.c @@ -1,18 +1,22 @@ #include "global.h" +#include "fault.h" +#include "libc64/os_malloc.h" #include "terminal.h" +#if PLATFORM_GC + #define FILL_ALLOC_BLOCK_FLAG (1 << 0) #define FILL_FREE_BLOCK_FLAG (1 << 1) #define CHECK_FREE_BLOCK_FLAG (1 << 2) -#define NODE_MAGIC (0x7373) +#define NODE_MAGIC 0x7373 -#define BLOCK_UNINIT_MAGIC (0xAB) -#define BLOCK_UNINIT_MAGIC_32 (0xABABABAB) -#define BLOCK_ALLOC_MAGIC (0xCD) -#define BLOCK_ALLOC_MAGIC_32 (0xCDCDCDCD) -#define BLOCK_FREE_MAGIC (0xEF) -#define BLOCK_FREE_MAGIC_32 (0xEFEFEFEF) +#define BLOCK_UNINIT_MAGIC 0xAB +#define BLOCK_UNINIT_MAGIC_32 0xABABABAB +#define BLOCK_ALLOC_MAGIC 0xCD +#define BLOCK_ALLOC_MAGIC_32 0xCDCDCDCD +#define BLOCK_FREE_MAGIC 0xEF +#define BLOCK_FREE_MAGIC_32 0xEFEFEFEF #define NODE_IS_VALID(node) (((node) != NULL) && ((node)->magic == NODE_MAGIC)) @@ -23,17 +27,19 @@ #define SET_DEBUG_INFO(node, file, line, arena) ArenaImpl_SetDebugInfo(node, file, line, arena) +#define FILL_UNINIT_BLOCK(arena, node, size) memset(node, BLOCK_UNINIT_MAGIC, size) + #define FILL_ALLOC_BLOCK(arena, alloc, size) \ if ((arena)->flag & FILL_ALLOC_BLOCK_FLAG) \ - __osMemset(alloc, BLOCK_ALLOC_MAGIC, size) + memset(alloc, BLOCK_ALLOC_MAGIC, size) #define FILL_FREE_BLOCK_HEADER(arena, node) \ if ((arena)->flag & FILL_FREE_BLOCK_FLAG) \ - __osMemset(node, BLOCK_FREE_MAGIC, sizeof(ArenaNode)) + memset(node, BLOCK_FREE_MAGIC, sizeof(ArenaNode)) #define FILL_FREE_BLOCK_CONTENTS(arena, node) \ if ((arena)->flag & FILL_FREE_BLOCK_FLAG) \ - __osMemset((void*)((u32)(node) + sizeof(ArenaNode)), BLOCK_FREE_MAGIC, (node)->size) + memset((void*)((u32)(node) + sizeof(ArenaNode)), BLOCK_FREE_MAGIC, (node)->size) #define CHECK_FREE_BLOCK(arena, node) \ if ((arena)->flag & CHECK_FREE_BLOCK_FLAG) \ @@ -47,18 +53,19 @@ #define NODE_GET_PREV(node) (NODE_IS_VALID((node)->prev) ? (node)->prev : NULL) #define SET_DEBUG_INFO(node, file, line, arena) (void)0 +#define FILL_UNINIT_BLOCK(arena, node, size) (void)0 #define FILL_ALLOC_BLOCK(arena, alloc, size) (void)0 #define FILL_FREE_BLOCK_HEADER(arena, node) (void)0 #define FILL_FREE_BLOCK_CONTENTS(arena, node) (void)0 #define CHECK_FREE_BLOCK(arena, node) (void)0 // Number of allocation failures across all arenas. -u32 sTotalAllocFailures = 0; +u32 gTotalAllocFailures = 0; // "Arena_failcnt" #define CHECK_ALLOC_FAILURE(arena, ptr) \ do { \ if ((ptr) == NULL) { \ - sTotalAllocFailures++; \ + gTotalAllocFailures++; \ (arena)->allocFailures++; \ } \ } while (0) @@ -67,6 +74,8 @@ u32 sTotalAllocFailures = 0; OSMesg sArenaLockMsg; +void __osMallocAddBlock(Arena* arena, void* start, s32 size); + #if IS_DEBUG u32 __osMalloc_FreeBlockTest_Enable; @@ -126,7 +135,9 @@ ArenaNode* ArenaImpl_GetNextBlock(ArenaNode* node) { ArenaNode* next = node->next; if (next != NULL && (next == NULL || (next->magic != NODE_MAGIC))) { - osSyncPrintf(VT_COL(RED, WHITE) "緊急事態!メモリリーク発見! (block=%08x)\n" VT_RST, next); + osSyncPrintf(VT_COL(RED, WHITE) T("緊急事態!メモリリーク発見! (block=%08x)\n", + "Emergency! Memory leak detected! (block=%08x)\n") VT_RST, + next); next = NULL; node->next = NULL; } @@ -137,7 +148,9 @@ ArenaNode* ArenaImpl_GetPrevBlock(ArenaNode* node) { ArenaNode* prev = node->prev; if (prev != NULL && (prev == NULL || (prev->magic != NODE_MAGIC))) { - osSyncPrintf(VT_COL(RED, WHITE) "緊急事態!メモリリーク発見! (block=%08x)\n" VT_RST, prev); + osSyncPrintf(VT_COL(RED, WHITE) T("緊急事態!メモリリーク発見! (block=%08x)\n", + "Emergency! Memory leak detected! (block=%08x)\n") VT_RST, + prev); prev = NULL; node->prev = NULL; } @@ -159,7 +172,7 @@ ArenaNode* ArenaImpl_GetLastBlock(Arena* arena) { return last; } -void __osMallocInit(Arena* arena, void* start, u32 size) { +void __osMallocInit(Arena* arena, void* start, s32 size) { bzero(arena, sizeof(Arena)); ArenaImpl_LockInit(arena); __osMallocAddBlock(arena, start, size); @@ -178,9 +191,7 @@ void __osMallocAddBlock(Arena* arena, void* start, s32 size) { size2 = (size - diff) & ~0xF; if (size2 > (s32)sizeof(ArenaNode)) { -#if IS_DEBUG - __osMemset(firstNode, BLOCK_UNINIT_MAGIC, size2); -#endif + FILL_UNINIT_BLOCK(arena, firstNode, size2); firstNode->next = NULL; firstNode->prev = NULL; firstNode->size = size2 - sizeof(ArenaNode); @@ -210,7 +221,7 @@ void ArenaImpl_RemoveAllBlocks(Arena* arena) { iter = arena->head; while (iter != NULL) { next = NODE_GET_NEXT(iter); - __osMemset(iter, BLOCK_UNINIT_MAGIC, iter->size + sizeof(ArenaNode)); + memset(iter, BLOCK_UNINIT_MAGIC, iter->size + sizeof(ArenaNode)); iter = next; } @@ -225,7 +236,7 @@ void __osMallocCleanup(Arena* arena) { bzero(arena, sizeof(*arena)); } -u8 __osMallocIsInitialized(Arena* arena) { +s32 __osMallocIsInitialized(Arena* arena) { return arena->isInit; } @@ -243,9 +254,10 @@ void __osMalloc_FreeBlockTest(Arena* arena, ArenaNode* node) { while (iter < end) { if (*iter != BLOCK_UNINIT_MAGIC_32 && *iter != BLOCK_FREE_MAGIC_32) { - osSyncPrintf( - VT_COL(RED, WHITE) "緊急事態!メモリリーク検出! (block=%08x s=%08x e=%08x p=%08x)\n" VT_RST, node, - start, end, iter); + osSyncPrintf(VT_COL(RED, WHITE) + T("緊急事態!メモリリーク検出! (block=%08x s=%08x e=%08x p=%08x)\n", + "Emergency! Memory leak detected! (block=%08x s=%08x e=%08x p=%08x)\n") VT_RST, + node, start, end, iter); __osDisplayArena(arena); return; } @@ -261,9 +273,9 @@ void* __osMalloc_NoLockDebug(Arena* arena, u32 size, const char* file, int line) void* alloc = NULL; ArenaNode* next; - iter = arena->head; size = ALIGN16(size); blockSize = ALIGN16(size) + sizeof(ArenaNode); + iter = arena->head; while (iter != NULL) { if (iter->isFree && iter->size >= size) { @@ -351,6 +363,7 @@ void* __osMallocRDebug(Arena* arena, u32 size, const char* file, int line) { iter = NODE_GET_PREV(iter); } + ArenaImpl_Unlock(arena); return allocR; @@ -369,9 +382,9 @@ void* __osMalloc_NoLock(Arena* arena, u32 size) { iter = arena->head; while (iter != NULL) { - if (iter->isFree && iter->size >= size) { CHECK_FREE_BLOCK(arena, iter); + if (blockSize < iter->size) { newNode = (ArenaNode*)((u32)iter + blockSize); newNode->next = NODE_GET_NEXT(iter); @@ -392,6 +405,7 @@ void* __osMalloc_NoLock(Arena* arena, u32 size) { SET_DEBUG_INFO(iter, NULL, 0, arena); alloc = (void*)((u32)iter + sizeof(ArenaNode)); FILL_ALLOC_BLOCK(arena, alloc, size); + break; } @@ -474,20 +488,21 @@ void __osFree_NoLock(Arena* arena, void* ptr) { } node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode)); - if (node == NULL || node->magic != NODE_MAGIC) { - // "__osFree: Unauthorized release (%08x)" - PRINTF(VT_COL(RED, WHITE) "__osFree:不正解放(%08x)\n" VT_RST, ptr); + if (!NODE_IS_VALID(node)) { + PRINTF(VT_COL(RED, WHITE) T("__osFree:不正解放(%08x)\n", "__osFree: Unauthorized release (%08x)\n") VT_RST, + ptr); return; } if (node->isFree) { - PRINTF(VT_COL(RED, WHITE) "__osFree:二重解放(%08x)\n" VT_RST, ptr); // "__osFree: Double release (%08x)" + PRINTF(VT_COL(RED, WHITE) T("__osFree:二重解放(%08x)\n", "__osFree: Double release (%08x)\n") VT_RST, ptr); return; } #if IS_DEBUG if (arena != node->arena && arena != NULL) { - // "__osFree:Tried to release in a different way than when it was secured (%08x:%08x)" - PRINTF(VT_COL(RED, WHITE) "__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n" VT_RST, arena, - node->arena); + PRINTF(VT_COL(RED, WHITE) + T("__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n", + "__osFree:Tried to release in a different way than when it was secured (%08x:%08x)\n") VT_RST, + arena, node->arena); return; } #endif @@ -539,20 +554,23 @@ void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, int line) { } node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode)); - if (node == NULL || node->magic != NODE_MAGIC) { - // "__osFree: Unauthorized release (%08x)" - PRINTF(VT_COL(RED, WHITE) "__osFree:不正解放(%08x) [%s:%d ]\n" VT_RST, ptr, file, line); + if (!NODE_IS_VALID(node)) { + PRINTF(VT_COL(RED, WHITE) + T("__osFree:不正解放(%08x) [%s:%d ]\n", "__osFree: Unauthorized release (%08x) [%s:%d ]\n") VT_RST, + ptr, file, line); return; } if (node->isFree) { - // "__osFree: Double release (%08x)" - PRINTF(VT_COL(RED, WHITE) "__osFree:二重解放(%08x) [%s:%d ]\n" VT_RST, ptr, file, line); + PRINTF(VT_COL(RED, WHITE) T("__osFree:二重解放(%08x) [%s:%d ]\n", "__osFree: Double release (%08x) [%s:%d ]\n") + VT_RST, + ptr, file, line); return; } if (arena != node->arena && arena != NULL) { - // "__osFree:Tried to release in a different way than when it was secured (%08x:%08x)" - PRINTF(VT_COL(RED, WHITE) "__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n" VT_RST, arena, - node->arena); + PRINTF(VT_COL(RED, WHITE) + T("__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n", + "__osFree:Tried to release in a different way than when it was secured (%08x:%08x)\n") VT_RST, + arena, node->arena); return; } @@ -563,7 +581,6 @@ void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, int line) { FILL_FREE_BLOCK_CONTENTS(arena, node); - newNext = node->next; if ((u32)next == (u32)node + sizeof(ArenaNode) + node->size && next->isFree) { newNext = NODE_GET_NEXT(next); if (newNext != NULL) { @@ -619,14 +636,14 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) { } else { node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode)); if (newSize == node->size) { - // "Does nothing because the memory block size does not change" - osSyncPrintf("メモリブロックサイズが変わらないためなにもしません\n"); + osSyncPrintf(T("メモリブロックサイズが変わらないためなにもしません\n", + "Does nothing because the memory block size does not change\n")); } else if (node->size < newSize) { next = NODE_GET_NEXT(node); sizeDiff = newSize - node->size; if ((u32)next == ((u32)node + node->size + sizeof(ArenaNode)) && next->isFree && next->size >= sizeDiff) { - // "Merge because there is a free block after the current memory block" - osSyncPrintf("現メモリブロックの後ろにフリーブロックがあるので結合します\n"); + osSyncPrintf(T("現メモリブロックの後ろにフリーブロックがあるので結合します\n", + "Merge because there is a free block after the current memory block\n")); next->size -= sizeDiff; overNext = NODE_GET_NEXT(next); newNext = (ArenaNode*)((u32)next + sizeDiff); @@ -635,10 +652,10 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) { } node->next = newNext; node->size = newSize; - __osMemmove(node->next, next, sizeof(ArenaNode)); + memmove(node->next, next, sizeof(ArenaNode)); } else { - // "Allocate a new memory block and move the contents" - osSyncPrintf("新たにメモリブロックを確保して内容を移動します\n"); + osSyncPrintf(T("新たにメモリブロックを確保して内容を移動します\n", + "Allocate a new memory block and move the contents\n")); newAlloc = __osMalloc_NoLock(arena, newSize); if (newAlloc != NULL) { bcopy(ptr, newAlloc, node->size); @@ -651,8 +668,8 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) { if (next2 != NULL && next2->isFree) { blockSize = ALIGN16(newSize) + sizeof(ArenaNode); - // "Increased free block behind current memory block" - osSyncPrintf("現メモリブロックの後ろのフリーブロックを大きくしました\n"); + osSyncPrintf(T("現メモリブロックの後ろのフリーブロックを大きくしました\n", + "Increased free block behind current memory block\n")); newNext2 = (ArenaNode*)((u32)node + blockSize); localCopy = *next2; *newNext2 = localCopy; @@ -666,8 +683,8 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) { } else if (newSize + sizeof(ArenaNode) < node->size) { blockSize = ALIGN16(newSize) + sizeof(ArenaNode); - // "Generated because there is no free block after the current memory block" - osSyncPrintf("現メモリブロックの後ろにフリーブロックがないので生成します\n"); + osSyncPrintf(T("現メモリブロックの後ろにフリーブロックがないので生成します\n", + "Generated because there is no free block after the current memory block\n")); newNext2 = (ArenaNode*)((u32)node + blockSize); newNext2->next = NODE_GET_NEXT(node); newNext2->prev = node; @@ -681,8 +698,8 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) { overNext2->prev = newNext2; } } else { - // "There is no room to generate free blocks" - osSyncPrintf("フリーブロック生成するだけの空きがありません\n"); + osSyncPrintf( + T("フリーブロック生成するだけの空きがありません\n", "There is no room to generate free blocks\n")); ptr = NULL; } } @@ -735,7 +752,7 @@ void __osDisplayArena(Arena* arena) { ArenaNode* next; if (!__osMallocIsInitialized(arena)) { - osSyncPrintf("アリーナは初期化されていません\n"); // "Arena is not initialized" + osSyncPrintf(T("アリーナは初期化されていません\n", "Arena is not initialized\n")); return; } @@ -745,9 +762,9 @@ void __osDisplayArena(Arena* arena) { freeSize = 0; allocatedSize = 0; - osSyncPrintf("アリーナの内容 (0x%08x)\n", arena); // "Arena contents (0x%08x)" - // "Memory node range status size [time s ms us ns: TID: src: line]" - osSyncPrintf("メモリブロック範囲 status サイズ [時刻 s ms us ns: TID:src:行]\n"); + osSyncPrintf(T("アリーナの内容 (0x%08x)\n", "Arena contents (0x%08x)\n"), arena); + osSyncPrintf(T("メモリブロック範囲 status サイズ [時刻 s ms us ns: TID:src:行]\n", + "Memory node range status size [time s ms us ns: TID:src:line]\n")); iter = arena->head; while (iter != NULL) { @@ -755,8 +772,7 @@ void __osDisplayArena(Arena* arena) { next = iter->next; osSyncPrintf("%08x-%08x%c %s %08x", iter, ((u32)iter + sizeof(ArenaNode) + iter->size), (next == NULL) ? '$' : (iter != next->prev ? '!' : ' '), - iter->isFree ? "空き" : "確保", //? "Free" : "Secure" - iter->size); + iter->isFree ? T("空き", "Free") : T("確保", "Secure"), iter->size); if (!iter->isFree) { osSyncPrintf(" [%016llu:%2d:%s:%d]", OS_CYCLES_TO_NSEC(iter->time), iter->threadId, @@ -780,12 +796,10 @@ void __osDisplayArena(Arena* arena) { iter = next; } - // "Total reserved node size 0x%08x bytes" - osSyncPrintf("確保ブロックサイズの合計 0x%08x バイト\n", allocatedSize); - // "Total free node size 0x%08x bytes" - osSyncPrintf("空きブロックサイズの合計 0x%08x バイト\n", freeSize); - // "Maximum free node size 0x%08x bytes" - osSyncPrintf("最大空きブロックサイズ 0x%08x バイト\n", maxFree); + osSyncPrintf(T("確保ブロックサイズの合計 0x%08x バイト\n", "Total reserved node size 0x%08x bytes\n"), + allocatedSize); + osSyncPrintf(T("空きブロックサイズの合計 0x%08x バイト\n", "Total free node size 0x%08x bytes\n"), freeSize); + osSyncPrintf(T("最大空きブロックサイズ 0x%08x バイト\n", "Maximum free node size 0x%08x bytes\n"), maxFree); ArenaImpl_Unlock(arena); } @@ -798,9 +812,9 @@ void ArenaImpl_FaultClient(Arena* arena) { ArenaNode* iter; ArenaNode* next; - FaultDrawer_Printf("ARENA INFO (0x%08x)\n", arena); + Fault_Printf("ARENA INFO (0x%08x)\n", arena); if (!__osMallocIsInitialized(arena)) { - FaultDrawer_Printf("Arena is uninitalized\n", arena); + Fault_Printf("Arena is uninitalized\n", arena); return; } @@ -808,16 +822,16 @@ void ArenaImpl_FaultClient(Arena* arena) { freeSize = 0; allocatedSize = 0; - FaultDrawer_Printf("Memory Block Region status size\n"); + Fault_Printf("Memory Block Region status size\n"); iter = arena->head; while (iter != NULL) { if (iter != NULL && iter->magic == NODE_MAGIC) { next = iter->next; - FaultDrawer_Printf("%08x-%08x%c %s %08x", iter, ((u32)iter + sizeof(ArenaNode) + iter->size), - (!next) ? '$' : (iter != next->prev ? '!' : ' '), iter->isFree ? "F" : "A", iter->size); + Fault_Printf("%08x-%08x%c %s %08x", iter, ((u32)iter + sizeof(ArenaNode) + iter->size), + (!next) ? '$' : (iter != next->prev ? '!' : ' '), iter->isFree ? "F" : "A", iter->size); - FaultDrawer_Printf("\n"); + Fault_Printf("\n"); if (iter->isFree) { freeSize += iter->size; @@ -828,34 +842,36 @@ void ArenaImpl_FaultClient(Arena* arena) { allocatedSize += iter->size; } } else { - FaultDrawer_SetFontColor(0xF801); - FaultDrawer_Printf("%08x Block Invalid\n", iter); + Fault_SetFontColor(0xF801); + Fault_Printf("%08x Block Invalid\n", iter); next = NULL; } iter = next; } - FaultDrawer_SetFontColor(0x7F1); - FaultDrawer_Printf("Total Alloc Block Size %08x\n", allocatedSize); - FaultDrawer_Printf("Total Free Block Size %08x\n", freeSize); - FaultDrawer_Printf("Largest Free Block Size %08x\n", maxFree); + Fault_SetFontColor(0x7F1); + Fault_Printf("Total Alloc Block Size %08x\n", allocatedSize); + Fault_Printf("Total Free Block Size %08x\n", freeSize); + Fault_Printf("Largest Free Block Size %08x\n", maxFree); } -u32 __osCheckArena(Arena* arena) { +s32 __osCheckArena(Arena* arena) { ArenaNode* iter; u32 error = 0; ArenaImpl_Lock(arena); - // "Checking the contents of the arena. . . (%08x)" - osSyncPrintf("アリーナの内容をチェックしています... (%08x)\n", arena); + osSyncPrintf( + T("アリーナの内容をチェックしています... (%08x)\n", "Checking the contents of the arena... (%08x)\n"), + arena); iter = arena->head; while (iter != NULL) { - if (iter && iter->magic == NODE_MAGIC) { - // "Oops!! (%08x %08x)" + //! @bug: Probably intended to be `!NODE_IS_VALID(iter)` + if (NODE_IS_VALID(iter)) { #if IS_DEBUG - osSyncPrintf(VT_COL(RED, WHITE) "おおっと!! (%08x %08x)\n" VT_RST, iter, iter->magic); + osSyncPrintf(VT_COL(RED, WHITE) T("おおっと!! (%08x %08x)\n", "Oops!! (%08x %08x)\n") VT_RST, iter, + iter->magic); #else - osSyncPrintf("おおっと!! (%08x %08x)\n", iter, iter->magic); + osSyncPrintf(T("おおっと!! (%08x %08x)\n", "Oops!! (%08x %08x)\n"), iter, iter->magic); #endif error = 1; break; @@ -863,7 +879,7 @@ u32 __osCheckArena(Arena* arena) { iter = NODE_GET_NEXT(iter); } if (error == 0) { - osSyncPrintf("アリーナはまだ、いけそうです\n"); // "The arena is still going well" + osSyncPrintf(T("アリーナはまだ、いけそうです\n", "The arena is still going well\n")); } ArenaImpl_Unlock(arena); @@ -875,3 +891,5 @@ u8 ArenaImpl_GetAllocFailures(Arena* arena) { return arena->allocFailures; } #endif + +#endif diff --git a/src/libc64/__osMalloc_n64.c b/src/libc64/__osMalloc_n64.c new file mode 100644 index 0000000000..8efb4ec6c8 --- /dev/null +++ b/src/libc64/__osMalloc_n64.c @@ -0,0 +1,474 @@ +#include "global.h" +#include "fault.h" +#include "libc64/os_malloc.h" + +#if PLATFORM_N64 + +#define NODE_MAGIC 0x7373 + +#define NODE_IS_VALID(node) ((node)->magic == NODE_MAGIC) + +#define NODE_GET_NEXT(node) ((node)->next) +#define NODE_GET_PREV(node) ((node)->prev) + +#define SET_DEBUG_INFO(node, f, l, a) \ + { \ + (node)->filename = (f); \ + (node)->line = (l); \ + (node)->threadId = osGetThreadId(NULL); \ + (node)->arena = (a); \ + (node)->time = osGetTime(); \ + } \ + (void)0 + +#define FILL_ALLOC_BLOCK(arena, alloc, size) (void)0 +#define FILL_FREE_BLOCK_HEADER(arena, node) (void)0 +#define FILL_FREE_BLOCK_CONTENTS(arena, node) (void)0 +#define CHECK_FREE_BLOCK(arena, node) (void)0 + +// Number of allocation failures across all arenas. +u32 gTotalAllocFailures = 0; // "Arena_failcnt" + +#define CHECK_ALLOC_FAILURE(arena, ptr) \ + do { \ + if ((ptr) == NULL) { \ + gTotalAllocFailures++; \ + (arena)->allocFailures++; \ + } \ + } while (0) + +void __osMallocInit(Arena* arena, void* start, s32 size) { + ArenaNode* firstNode = (ArenaNode*)ALIGN16((u32)start); + + size -= (u8*)firstNode - (u8*)start; + size &= ~0xF; + + firstNode->next = NULL; + firstNode->prev = NULL; + firstNode->size = size - sizeof(ArenaNode); + firstNode->isFree = true; + firstNode->magic = NODE_MAGIC; + + arena->head = firstNode; + arena->start = start; + arena->size = size; +} + +void __osMallocCleanup(Arena* arena) { + bzero(arena, sizeof(*arena)); +} + +s32 __osMallocIsInitialized(Arena* arena) { + return arena->start != NULL; +} + +void* __osMallocDebug(Arena* arena, u32 size, const char* file, int line) { + ArenaNode* iter; + u32 blockSize; + ArenaNode* newNode; + void* alloc = NULL; + ArenaNode* next; + + size = ALIGN16(size); + blockSize = ALIGN16(size) + sizeof(ArenaNode); + iter = arena->head; + + while (iter != NULL) { + if (iter->isFree && iter->size >= size) { + CHECK_FREE_BLOCK(arena, iter); + + if (blockSize < iter->size) { + newNode = (ArenaNode*)((u32)iter + blockSize); + newNode->next = NODE_GET_NEXT(iter); + newNode->prev = iter; + newNode->size = iter->size - blockSize; + newNode->isFree = true; + newNode->magic = NODE_MAGIC; + + iter->next = newNode; + iter->size = size; + next = NODE_GET_NEXT(newNode); + if (next) { + next->prev = newNode; + } + } + + iter->isFree = false; + SET_DEBUG_INFO(iter, file, line, arena); + alloc = (void*)((u32)iter + sizeof(ArenaNode)); + FILL_ALLOC_BLOCK(arena, alloc, size); + + break; + } + + iter = NODE_GET_NEXT(iter); + } + + CHECK_ALLOC_FAILURE(arena, alloc); + + return alloc; +} + +void* __osMallocRDebug(Arena* arena, u32 size, const char* file, int line) { + ArenaNode* iter; + ArenaNode* newNode; + u32 blockSize; + u32 nodeSize; + ArenaNode* next; + void* allocR = NULL; + ArenaNode* next2; + + size = ALIGN16(size); + + iter = arena->head; + next2 = NODE_GET_NEXT(iter); + while (next2 != NULL) { + iter = next2; + next2 = NODE_GET_NEXT(next2); + } + + while (iter != NULL) { + if (iter->isFree && iter->size >= size) { + CHECK_FREE_BLOCK(arena, iter); + + blockSize = ALIGN16(size) + sizeof(ArenaNode); + nodeSize = iter->size; + if (blockSize < nodeSize) { + newNode = (ArenaNode*)((u32)iter + (iter->size - size)); + newNode->next = NODE_GET_NEXT(iter); + newNode->prev = iter; + newNode->size = size; + newNode->magic = NODE_MAGIC; + + iter->next = newNode; + iter->size -= blockSize; + next = NODE_GET_NEXT(newNode); + if (next) { + next->prev = newNode; + } + iter = newNode; + } + + iter->isFree = false; + SET_DEBUG_INFO(iter, file, line, arena); + allocR = (void*)((u32)iter + sizeof(ArenaNode)); + FILL_ALLOC_BLOCK(arena, allocR, size); + + break; + } + + iter = NODE_GET_PREV(iter); + } + + CHECK_ALLOC_FAILURE(arena, allocR); + + return allocR; +} + +void* __osMalloc(Arena* arena, u32 size) { + ArenaNode* iter; + u32 blockSize; + ArenaNode* newNode; + void* alloc = NULL; + ArenaNode* next; + + size = ALIGN16(size); + blockSize = ALIGN16(size) + sizeof(ArenaNode); + iter = arena->head; + + while (iter != NULL) { + if (iter->isFree && iter->size >= size) { + CHECK_FREE_BLOCK(arena, iter); + + if (blockSize < iter->size) { + newNode = (ArenaNode*)((u32)iter + blockSize); + newNode->next = NODE_GET_NEXT(iter); + newNode->prev = iter; + newNode->size = iter->size - blockSize; + newNode->isFree = true; + newNode->magic = NODE_MAGIC; + + iter->next = newNode; + iter->size = size; + next = NODE_GET_NEXT(newNode); + if (next) { + next->prev = newNode; + } + } + + iter->isFree = false; + SET_DEBUG_INFO(iter, NULL, 0, arena); + alloc = (void*)((u32)iter + sizeof(ArenaNode)); + FILL_ALLOC_BLOCK(arena, alloc, size); + + break; + } + + iter = NODE_GET_NEXT(iter); + } + + CHECK_ALLOC_FAILURE(arena, alloc); + + return alloc; +} + +void* __osMallocR(Arena* arena, u32 size) { + ArenaNode* iter; + ArenaNode* newNode; + u32 blockSize; + u32 nodeSize; + ArenaNode* next; + void* allocR = NULL; + ArenaNode* next2; + + size = ALIGN16(size); + + iter = arena->head; + next2 = NODE_GET_NEXT(iter); + while (next2 != NULL) { + iter = next2; + next2 = NODE_GET_NEXT(next2); + } + + while (iter != NULL) { + if (iter->isFree && iter->size >= size) { + CHECK_FREE_BLOCK(arena, iter); + + blockSize = ALIGN16(size) + sizeof(ArenaNode); + nodeSize = iter->size; + if (blockSize < nodeSize) { + newNode = (ArenaNode*)((u32)iter + (iter->size - size)); + newNode->next = NODE_GET_NEXT(iter); + newNode->prev = iter; + newNode->size = size; + newNode->magic = NODE_MAGIC; + + iter->next = newNode; + iter->size -= blockSize; + next = NODE_GET_NEXT(newNode); + if (next) { + next->prev = newNode; + } + iter = newNode; + } + + iter->isFree = false; + SET_DEBUG_INFO(iter, NULL, 0, arena); + allocR = (void*)((u32)iter + sizeof(ArenaNode)); + FILL_ALLOC_BLOCK(arena, allocR, size); + + break; + } + iter = NODE_GET_PREV(iter); + } + + CHECK_ALLOC_FAILURE(arena, allocR); + + return allocR; +} + +void __osFree(Arena* arena, void* ptr) { + ArenaNode* node; + ArenaNode* next; + ArenaNode* prev; + + if (ptr == NULL) { + return; + } + + node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode)); + if (!NODE_IS_VALID(node)) { + (void)T("__osFree:不正解放(%08x)\n", "__osFree: Unauthorized release (%08x)\n"); + osSetIntMask(OS_IM_ALL); + return; + } + if (node->isFree) { + (void)T("__osFree:二重解放(%08x)\n", "__osFree: Double release (%08x)\n"); + osSetIntMask(OS_IM_ALL); + return; + } + if (arena != node->arena && arena != NULL) { + (void)T("__osFree:arena(%08x)が__osMallocのarena(%08x)と一致しない\n", + "__osFree:arena(%08x) and __osMalloc:arena(%08x) do not match\n"); + } + + node->isFree = true; + SET_DEBUG_INFO(node, NULL, 0, arena); + + if (node->next != NULL) { + next = node->next; + if (next->isFree) { + if (next->next != NULL) { + next->next->prev = node; + } + + node->size += next->size + sizeof(ArenaNode); + node->next = next->next; + } + } + + if (node->prev != NULL) { + prev = node->prev; + if (prev->isFree) { + prev->size += node->size + sizeof(ArenaNode); + prev->next = NODE_GET_NEXT(node); + + if (node->next != NULL) { + node->next->prev = prev; + } + } + } +} + +void __osFreeDebug(Arena* arena, void* ptr, const char* file, int line) { + ArenaNode* node; + ArenaNode* next; + ArenaNode* prev; + + if (ptr == NULL) { + return; + } + + node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode)); + if (!NODE_IS_VALID(node)) { + (void)T("__osFree:不正解放(%08x)\n", "__osFree: Unauthorized release (%08x)\n"); + osSetIntMask(OS_IM_ALL); + return; + } + if (node->isFree) { + (void)T("__osFree:二重解放(%08x)\n", "__osFree: Double release (%08x)\n"); + osSetIntMask(OS_IM_ALL); + return; + } + if (arena != node->arena && arena != NULL) { + (void)T("__osFree:arena(%08x)が__osMallocのarena(%08x)と一致しない\n", + "__osFree:arena(%08x) and __osMalloc:arena(%08x) do not match\n"); + } + + node->isFree = true; + SET_DEBUG_INFO(node, file, line, arena); + + if (node->next != NULL) { + next = node->next; + if (next->isFree) { + if (next->next != NULL) { + next->next->prev = node; + } + + node->size += next->size + sizeof(ArenaNode); + node->next = next->next; + } + } + + if (node->prev != NULL) { + prev = node->prev; + if (prev->isFree) { + prev->size += node->size + sizeof(ArenaNode); + prev->next = NODE_GET_NEXT(node); + + if (node->next != NULL) { + node->next->prev = prev; + } + } + } +} + +void* __osRealloc(Arena* arena, void* ptr, u32 newSize) { + ArenaNode* node; + void* newAlloc; + ArenaNode* next; + ArenaNode* newNext; + u32 sizeDiff; + + (void)"__osRealloc(%08x, %d)\n"; + osSetIntMask(OS_IM_ALL); + + if (ptr == NULL) { + ptr = __osMalloc(arena, newSize); + } else if (newSize == 0) { + __osFree(arena, ptr); + ptr = NULL; + } else { + newSize = ALIGN16(newSize); + node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode)); + if (newSize == node->size) { + // Do nothing + } else if (node->size < newSize) { + next = NODE_GET_NEXT(node); + sizeDiff = newSize - node->size; + if (next != NULL && next->isFree && next->size >= sizeDiff) { + next->size -= sizeDiff; + newNext = (ArenaNode*)((u32)next + sizeDiff); + if (NODE_GET_NEXT(next) != NULL) { + NODE_GET_NEXT(next)->prev = newNext; + } + node->next = newNext; + node->size = newSize; + memmove(node->next, next, sizeof(ArenaNode)); + } else { + newAlloc = __osMalloc(arena, newSize); + if (newAlloc != NULL) { + memcpy(ptr, newAlloc, node->size); + __osFree(arena, ptr); + } + ptr = newAlloc; + } + } else if (newSize < node->size) { + (void)T("メモリブロックの縮小機能はまだインプリメントしていません\n", + "Memory block shrinking functionality is not yet implemented\n"); + } + } + + CHECK_ALLOC_FAILURE(arena, ptr); + + return ptr; +} + +void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, int line) { + return __osRealloc(arena, ptr, newSize); +} + +void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc) { + ArenaNode* iter; + + *outMaxFree = 0; + *outFree = 0; + *outAlloc = 0; + + iter = arena->head; + while (iter != NULL) { + if (iter->isFree) { + *outFree += iter->size; + if (*outMaxFree < iter->size) { + *outMaxFree = iter->size; + } + } else { + *outAlloc += iter->size; + } + + iter = NODE_GET_NEXT(iter); + } +} + +s32 __osCheckArena(Arena* arena) { + ArenaNode* iter; + + (void)T("アリーナの内容をチェックしています... (%08x)\n", "Checking the arena contents... (%08x)\n"); + iter = arena->head; + while (iter != NULL) { + if (!NODE_IS_VALID(iter)) { + (void)T("おおっと!! (%08x %08x)\n", "Oops!! (%08x %08x)\n"); + return 1; + } + iter = NODE_GET_NEXT(iter); + } + + (void)T("アリーナはまだ、いけそうです\n", "The arena is still going well\n"); + return 0; +} + +u8 ArenaImpl_GetAllocFailures(Arena* arena) { + return arena->allocFailures; +} + +#endif diff --git a/src/code/printutils.c b/src/libc64/aprintf.c similarity index 87% rename from src/code/printutils.c rename to src/libc64/aprintf.c index 3fb8cf3672..44cedac975 100644 --- a/src/code/printutils.c +++ b/src/libc64/aprintf.c @@ -1,4 +1,5 @@ -#include "global.h" +#include "libc64/aprintf.h" +#include "ultra64.h" s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args) { return _Printf(*pfn, pfn, fmt, args); diff --git a/src/code/fp.s b/src/libc64/fp.s similarity index 99% rename from src/code/fp.s rename to src/libc64/fp.s index 431348d897..d5b42094a3 100644 --- a/src/code/fp.s +++ b/src/libc64/fp.s @@ -6,6 +6,7 @@ .balign 16 +#if !PLATFORM_N64 DATA(qNaN0x3FFFFF) .word 0x7FBFFFFF ENDDATA(qNaN0x3FFFFF) @@ -17,6 +18,7 @@ ENDDATA(qNaN0x10000) DATA(sNaN0x3FFFFF) .word 0x7FFFFFFF ENDDATA(sNaN0x3FFFFF) +#endif .section .text diff --git a/src/code/system_malloc.c b/src/libc64/malloc.c similarity index 68% rename from src/code/system_malloc.c rename to src/libc64/malloc.c index d593642733..b88f7dc005 100644 --- a/src/code/system_malloc.c +++ b/src/libc64/malloc.c @@ -1,4 +1,7 @@ -#include "global.h" +#include "libc64/malloc.h" +#include "ultra64.h" +#include "macros.h" +#include "libc64/os_malloc.h" #define LOG_SEVERITY_NOLOG 0 #define LOG_SEVERITY_ERROR 2 @@ -12,14 +15,12 @@ s32 gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG; void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { if (ptr == NULL) { if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR) { - // "%s: %u bytes %s failed\n" - PRINTF("%s: %u バイトの%sに失敗しました\n", name, size, action); + PRINTF(T("%s: %u バイトの%sに失敗しました\n", "%s: %u bytes %s failed\n"), name, size, action); __osDisplayArena(&gSystemArena); return; } } else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { - // "%s: %u bytes %s succeeded\n" - PRINTF("%s: %u バイトの%sに成功しました\n", name, size, action); + PRINTF(T("%s: %u バイトの%sに成功しました\n", "%s: %u bytes %s succeeded\n"), name, size, action); } } @@ -29,7 +30,12 @@ void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* #endif void* SystemArena_Malloc(u32 size) { - void* ptr = __osMalloc(&gSystemArena, size); + DECLARE_INTERRUPT_MASK + void* ptr; + + DISABLE_INTERRUPTS(); + ptr = __osMalloc(&gSystemArena, size); + RESTORE_INTERRUPTS(); SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc", "確保"); // "Secure" return ptr; @@ -37,7 +43,12 @@ void* SystemArena_Malloc(u32 size) { #if IS_DEBUG void* SystemArena_MallocDebug(u32 size, const char* file, int line) { - void* ptr = __osMallocDebug(&gSystemArena, size, file, line); + DECLARE_INTERRUPT_MASK + void* ptr; + + DISABLE_INTERRUPTS(); + ptr = __osMallocDebug(&gSystemArena, size, file, line); + RESTORE_INTERRUPTS(); SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_DEBUG", "確保"); // "Secure" return ptr; @@ -45,7 +56,12 @@ void* SystemArena_MallocDebug(u32 size, const char* file, int line) { #endif void* SystemArena_MallocR(u32 size) { - void* ptr = __osMallocR(&gSystemArena, size); + DECLARE_INTERRUPT_MASK + void* ptr; + + DISABLE_INTERRUPTS(); + ptr = __osMallocR(&gSystemArena, size); + RESTORE_INTERRUPTS(); SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_r", "確保"); // "Secure" return ptr; @@ -53,7 +69,12 @@ void* SystemArena_MallocR(u32 size) { #if IS_DEBUG void* SystemArena_MallocRDebug(u32 size, const char* file, int line) { - void* ptr = __osMallocRDebug(&gSystemArena, size, file, line); + DECLARE_INTERRUPT_MASK + void* ptr; + + DISABLE_INTERRUPTS(); + ptr = __osMallocRDebug(&gSystemArena, size, file, line); + RESTORE_INTERRUPTS(); SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_r_DEBUG", "確保"); // "Secure" return ptr; @@ -61,34 +82,56 @@ void* SystemArena_MallocRDebug(u32 size, const char* file, int line) { #endif void* SystemArena_Realloc(void* ptr, u32 newSize) { + DECLARE_INTERRUPT_MASK + + DISABLE_INTERRUPTS(); ptr = __osRealloc(&gSystemArena, ptr, newSize); + RESTORE_INTERRUPTS(); + SYSTEM_ARENA_CHECK_POINTER(ptr, newSize, "realloc", "再確保"); // "Re-securing" return ptr; } #if IS_DEBUG void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) { + DECLARE_INTERRUPT_MASK + + DISABLE_INTERRUPTS(); ptr = __osReallocDebug(&gSystemArena, ptr, newSize, file, line); + RESTORE_INTERRUPTS(); + SYSTEM_ARENA_CHECK_POINTER(ptr, newSize, "realloc_DEBUG", "再確保"); // "Re-securing" return ptr; } #endif void SystemArena_Free(void* ptr) { + DECLARE_INTERRUPT_MASK + + DISABLE_INTERRUPTS(); __osFree(&gSystemArena, ptr); + RESTORE_INTERRUPTS(); } #if IS_DEBUG void SystemArena_FreeDebug(void* ptr, const char* file, int line) { + DECLARE_INTERRUPT_MASK + + DISABLE_INTERRUPTS(); __osFreeDebug(&gSystemArena, ptr, file, line); + RESTORE_INTERRUPTS(); } #endif void* SystemArena_Calloc(u32 num, u32 size) { + DECLARE_INTERRUPT_MASK void* ret; u32 n = num * size; + DISABLE_INTERRUPTS(); ret = __osMalloc(&gSystemArena, n); + RESTORE_INTERRUPTS(); + if (ret != NULL) { bzero(ret, n); } @@ -122,6 +165,6 @@ void SystemArena_Cleanup(void) { __osMallocCleanup(&gSystemArena); } -u8 SystemArena_IsInitialized(void) { +s32 SystemArena_IsInitialized(void) { return __osMallocIsInitialized(&gSystemArena); } diff --git a/src/code/fp_math.c b/src/libc64/math64.c similarity index 69% rename from src/code/fp_math.c rename to src/libc64/math64.c index c429b83e23..85fb4cedf3 100644 --- a/src/code/fp_math.c +++ b/src/libc64/math64.c @@ -1,7 +1,9 @@ #include "z64math.h" #include "macros.h" +#if !PLATFORM_N64 s32 gUseAtanContFrac; +#endif /** * @param angle radians @@ -22,6 +24,16 @@ f32 Math_FCeilF(f32 x) { return ceilf(x); } +#if PLATFORM_N64 +f64 Math_FAbs(f64 x) { + return x < 0.0 ? -x : x; +} + +f32 Math_FAbsF(f32 x) { + return x < 0.0f ? -x : x; +} +#endif + f32 Math_FRoundF(f32 x) { return roundf(x); } @@ -34,6 +46,7 @@ f32 Math_FNearbyIntF(f32 x) { return nearbyintf(x); } +#if !PLATFORM_N64 /* Arctangent approximation using a Taylor series (one quadrant) */ f32 Math_FAtanTaylorQF(f32 x) { static const f32 coeffs[] = { @@ -89,6 +102,7 @@ f32 Math_FAtanTaylorF(f32 x) { return -q; } } +#endif /* Arctangent approximation using a continued fraction */ f32 Math_FAtanContFracF(f32 x) { @@ -98,6 +112,17 @@ f32 Math_FAtanContFracF(f32 x) { f32 sq; s32 i; +#if PLATFORM_N64 + if (x > 1.0f) { + sector = 1; + x = 1.0f / x; + } else if (x < -1.0f) { + sector = -1; + x = 1.0f / x; + } else { + sector = 0; + } +#else if (x >= -1.0f && x <= 1.0f) { sector = 0; } else if (x > 1.0f) { @@ -109,16 +134,35 @@ f32 Math_FAtanContFracF(f32 x) { } else { return qNaN0x10000; } +#endif sq = SQ(x); conv = 0.0f; + +#if PLATFORM_N64 + z = 24.0f; + i = 24; +#else z = 8.0f; - for (i = 8; i != 0; i--) { + i = 8; +#endif + + while (i != 0) { conv = SQ(z) * sq / (2.0f * z + 1.0f + conv); z -= 1.0f; + i--; } - conv = x / (1.0f + conv); +#if PLATFORM_N64 + if (sector > 0) { + return M_PI / 2 - (x / (1.0f + conv)); + } else if (sector < 0) { + return -M_PI / 2 - (x / (1.0f + conv)); + } else { + return x / (1.0f + conv); + } +#else + conv = x / (1.0f + conv); if (sector == 0) { return conv; } else if (sector > 0) { @@ -126,8 +170,10 @@ f32 Math_FAtanContFracF(f32 x) { } else { return -M_PI / 2 - conv; } +#endif } +#if !PLATFORM_N64 /** * @return arctan(x) in radians, in (-pi/2,pi/2) range */ @@ -138,11 +184,33 @@ f32 Math_FAtanF(f32 x) { return Math_FAtanContFracF(x); } } +#endif /** * @return angle to (x,y) from vector (1,0) around (0,0) in radians, in (-pi,pi] range */ f32 Math_FAtan2F(f32 y, f32 x) { +#if PLATFORM_N64 + if (y == 0.0f && x == 0.0f) { + return 0.0f; + } + + if (x == 0.0f) { + if (y < 0.0f) { + return -M_PI / 2; + } else { + return M_PI / 2; + } + } else if (x < 0.0f) { + if (y < 0.0f) { + return -(M_PI - Math_FAtanContFracF(fabs(y / x))); + } else { + return M_PI - Math_FAtanContFracF(fabs(y / x)); + } + } else { // x > 0.0f + return Math_FAtanContFracF(y / x); + } +#else if (x == 0.0f) { if (y == 0.0f) { return 0.0f; @@ -155,11 +223,14 @@ f32 Math_FAtan2F(f32 y, f32 x) { } } else if (x >= 0.0f) { return Math_FAtanF(y / x); - } else if (y < 0.0f) { - return Math_FAtanF(y / x) - M_PI; - } else { - return M_PI - Math_FAtanF(-(y / x)); + } else { // x < 0.0f + if (y < 0.0f) { + return Math_FAtanF(y / x) - M_PI; + } else { + return M_PI - Math_FAtanF(-(y / x)); + } } +#endif } /** diff --git a/src/code/rand.c b/src/libc64/qrand.c similarity index 88% rename from src/code/rand.c rename to src/libc64/qrand.c index baf3965421..69bfa11d72 100644 --- a/src/code/rand.c +++ b/src/libc64/qrand.c @@ -41,7 +41,8 @@ * * @note Original name: qrand.c */ -#include "rand.h" +#include "libc64/qrand.h" +#include "z64math.h" #define RAND_MULTIPLIER 1664525 #define RAND_INCREMENT 1013904223 @@ -53,12 +54,14 @@ */ static u32 sRandInt = 1; +#if !PLATFORM_N64 /** * Space to store a value to be re-interpreted as a float. * * @note Orignal name: __qrand_itemp */ -static fu sRandFloat; +static FloatInt sRandFloat; +#endif /** * Gets the next integer in the sequence of pseudo-random numbers. @@ -66,7 +69,14 @@ static fu sRandFloat; * @note Original name: qrand */ u32 Rand_Next(void) { +#if PLATFORM_N64 + u32 next = sRandInt * RAND_MULTIPLIER + RAND_INCREMENT; + + sRandInt = next; + return next; +#else return sRandInt = sRandInt * RAND_MULTIPLIER + RAND_INCREMENT; +#endif } /** @@ -88,12 +98,24 @@ void Rand_Seed(u32 seed) { * @note Original name: fqrand */ f32 Rand_ZeroOne(void) { +#if PLATFORM_N64 + fu v; + f32 vf; + + // Note this samples the lower 23 bits, effectively reducing the LCG period from 2^32 to 2^23. + // This was fixed in Gamecube versions and Majora's Mask. + v.i = (Rand_Next() & 0x007FFFFF) | 0x3F800000; + vf = v.f - 1.0f; + return vf; +#else sRandInt = sRandInt * RAND_MULTIPLIER + RAND_INCREMENT; // Samples the upper 23 bits to avoid effectively reducing the LCG period. sRandFloat.i = (sRandInt >> 9) | 0x3F800000; return sRandFloat.f - 1.0f; +#endif } +#if !PLATFORM_N64 /** * Returns a pseudo-random floating-point number between -0.5f and 0.5f by the same manner in which Rand_ZeroOne * generates its result. @@ -107,6 +129,7 @@ f32 Rand_Centered(void) { sRandFloat.i = (sRandInt >> 9) | 0x3F800000; return sRandFloat.f - 1.5f; } +#endif //! All functions below are unused variants of the above four, that use a provided random number variable instead of the //! internal `sRandInt` @@ -141,12 +164,23 @@ u32 Rand_Next_Variable(u32* rndNum) { * @note Original name: fqrand_r */ f32 Rand_ZeroOne_Variable(u32* rndNum) { +#if PLATFORM_N64 + fu v; + f32 vf; + u32 next = Rand_Next_Variable(rndNum); + + v.i = (next & 0x007FFFFF) | 0x3F800000; + vf = v.f - 1.0f; + return vf; +#else u32 next = (*rndNum) * RAND_MULTIPLIER + RAND_INCREMENT; sRandFloat.i = ((*rndNum = next) >> 9) | 0x3F800000; return sRandFloat.f - 1.0f; +#endif } +#if !PLATFORM_N64 /** * Generates the next pseudo-random floating-point number between -0.5f and 0.5f from the provided rndNum. * @@ -160,3 +194,4 @@ f32 Rand_Centered_Variable(u32* rndNum) { sRandFloat.i = ((*rndNum = next) >> 9) | 0x3F800000; return sRandFloat.f - 1.5f; } +#endif diff --git a/src/code/sleep.c b/src/libc64/sleep.c similarity index 100% rename from src/code/sleep.c rename to src/libc64/sleep.c diff --git a/src/libultra/libc/sprintf.c b/src/libc64/sprintf.c similarity index 77% rename from src/libultra/libc/sprintf.c rename to src/libc64/sprintf.c index cb80fe39a9..12286697c9 100644 --- a/src/libultra/libc/sprintf.c +++ b/src/libc64/sprintf.c @@ -1,8 +1,13 @@ +#include "libc64/sprintf.h" #include "stdarg.h" -#include "stdio.h" #include "string.h" #include "ultra64/xstdio.h" +#if PLATFORM_N64 +// Generated by CVS "$Id$" keyword +char sSprintfFileInfo[] = "$Id: sprintf.c,v 1.5 1997/03/19 02:28:53 hayakawa Exp $"; +#endif + void* proutSprintf(void* dst, const char* fmt, size_t size) { return (char*)memcpy(dst, fmt, size) + size; } diff --git a/src/libleo/api/bytetolba.c b/src/libleo/api/bytetolba.c new file mode 100644 index 0000000000..9b28baf2f1 --- /dev/null +++ b/src/libleo/api/bytetolba.c @@ -0,0 +1,44 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +s32 LeoByteToLBA(s32 startlba, u32 nbytes, s32* lba) { + u32 reslba; + u32 byte_p_blk; + u16 zone; + u16 vzone; + u8 flag; + + if (!__leoActive) { + return -1; + } + + reslba = 0; + flag = vzone = 1; + startlba += 0x18; + while (nbytes != 0) { + if ((flag != 0) || (LEOVZONE_TBL[LEOdisk_type][vzone] == startlba)) { + vzone = leoLba_to_vzone(startlba); + zone = LEOVZONE_PZONEHD_TBL[LEOdisk_type][vzone]; + if (zone >= 8) { + zone -= 7; + } + byte_p_blk = LEOBYTE_TBL2[zone]; + } + if (nbytes < byte_p_blk) { + nbytes = 0; + } else { + nbytes -= byte_p_blk; + } + reslba++; + startlba++; + if ((nbytes != 0) && ((u32)startlba >= NUM_LBAS + 0x18)) { + return LEO_ERROR_LBA_OUT_OF_RANGE; + } + flag = 0; + } + + *lba = reslba; + return LEO_ERROR_GOOD; +} diff --git a/src/libleo/api/cacreateleomanager.c b/src/libleo/api/cacreateleomanager.c new file mode 100644 index 0000000000..1f2caf6d97 --- /dev/null +++ b/src/libleo/api/cacreateleomanager.c @@ -0,0 +1,81 @@ +#include "global.h" +#include "ultra64/asm.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" +#include "libc/stdint.h" + +s32 LeoCACreateLeoManager(s32 comPri, s32 intPri, OSMesg* cmdBuf, s32 cmdMsgCnt) { + OSPiHandle* driveRomHandle; + OSPiHandle* leoDiskHandle; + volatile LEOCmdInquiry cmdBlockInq; + volatile LEOCmd cmdBlockID; + LEODiskID thisID; + u32 stat; + u32 data; + + if (__leoActive) { + return LEO_ERROR_GOOD; + } + + if (!LeoDriveExist()) { + return LEO_ERROR_DEVICE_COMMUNICATION_FAILURE; + } + + leoDiskHandle = osLeoDiskInit(); + driveRomHandle = osDriveRomInit(); + __leoActive = true; + + __osSetHWIntrRoutine(OS_INTR_CART, __osLeoInterrupt, (u8*)STACK_TOP(leoDiskStack) - FRAMESZ(SZREG * NARGSAVE)); + leoInitialize(comPri, intPri, cmdBuf, cmdMsgCnt); + + if (osResetType == 1) { // NMI + __leoSetReset(); + } + + cmdBlockInq.header.command = 2; + cmdBlockInq.header.reserve1 = 0; + cmdBlockInq.header.control = 0; + cmdBlockInq.header.reserve3 = 0; + leoCommand((void*)&cmdBlockInq); + + { + volatile s32 dummy = (uintptr_t)__osSetHWIntrRoutine & 0xA48D3C; + + while (dummy < 0xE00000) { + dummy += (((uintptr_t)leoCommand & 0xFF) | 0x8A) << 0x10; + } + } + + while (cmdBlockInq.header.status == 8) {} + + if (cmdBlockInq.header.status != 0) { + return GET_ERROR(cmdBlockInq); + } + + __leoVersion.driver = cmdBlockInq.version; + __leoVersion.drive = 6; + __leoVersion.deviceType = cmdBlockInq.devType; + __leoVersion.nDevices = cmdBlockInq.devNum; + + stat = __leoVersion.driver & 0xF; + if (stat == 4) { + LEO_country_code = 0; + } else if ((stat == 3) || (stat == 1)) { + volatile u32 dummy; + + osEPiReadIo(driveRomHandle, 0x9FF00, &data); + data = (data & 0xFF000000) >> 24; + if (data != 4) { + while (true) {} + } + + dummy = 0x32F8EB20; + LEO_country_code = 0x2263EE56; + dummy += (uintptr_t)&__leoActive; + } else { + while (true) {} + } + + return LEO_ERROR_GOOD; +} diff --git a/src/libleo/api/cjcreateleomanager.c b/src/libleo/api/cjcreateleomanager.c new file mode 100644 index 0000000000..e3a5183005 --- /dev/null +++ b/src/libleo/api/cjcreateleomanager.c @@ -0,0 +1,82 @@ +#include "global.h" +#include "ultra64/asm.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" +#include "libc/stdint.h" + +s32 LeoCJCreateLeoManager(s32 comPri, s32 intPri, OSMesg* cmdBuf, s32 cmdMsgCnt) { + OSPiHandle* driveRomHandle; + OSPiHandle* leoDiskHandle; + volatile LEOCmdInquiry cmdBlockInq; + volatile LEOCmd cmdBlockID; + LEODiskID thisID; + u32 stat; + u32 data; + + if (__leoActive) { + return LEO_ERROR_GOOD; + } + + if (!LeoDriveExist()) { + return LEO_ERROR_DEVICE_COMMUNICATION_FAILURE; + } + + leoDiskHandle = osLeoDiskInit(); + driveRomHandle = osDriveRomInit(); + __leoActive = true; + + __osSetHWIntrRoutine(OS_INTR_CART, __osLeoInterrupt, (u8*)STACK_TOP(leoDiskStack) - FRAMESZ(SZREG * NARGSAVE)); + leoInitialize(comPri, intPri, cmdBuf, cmdMsgCnt); + + if (osResetType == 1) { // NMI + __leoSetReset(); + } + + cmdBlockInq.header.command = 2; + cmdBlockInq.header.reserve1 = 0; + cmdBlockInq.header.control = 0; + cmdBlockInq.header.reserve3 = 0; + leoCommand((void*)&cmdBlockInq); + + { + volatile s32 dummy = (uintptr_t)&cmdBlockInq & 0xFFFFFF; + + while (dummy > 0) { + dummy -= ((uintptr_t)__leoSetReset & 0xFFFFFF) | 0x403DF4; + } + } + + while (cmdBlockInq.header.status == 8) {} + + if (cmdBlockInq.header.status != 0) { + return GET_ERROR(cmdBlockInq); + } + + __leoVersion.driver = cmdBlockInq.version; + __leoVersion.drive = 6; + __leoVersion.deviceType = cmdBlockInq.devType; + __leoVersion.nDevices = cmdBlockInq.devNum; + + stat = __leoVersion.driver & 0xF; + if (stat == 4) { + LEO_country_code = 0; + } else if ((stat == 3) || (stat == 1)) { + volatile u32 dummy; + + osEPiReadIo(driveRomHandle, 0x9FF00, &data); + data = (data & 0xFF000000) >> 24; + dummy = 0x3ED98F23; + if (data != 0xC3) { + while (true) {} + } + + dummy *= data; + dummy -= (uintptr_t)&cmdBlockInq; + LEO_country_code = 0xE848D316; + } else { + while (true) {} + } + + return LEO_ERROR_GOOD; +} diff --git a/src/libleo/api/clearqueue.c b/src/libleo/api/clearqueue.c new file mode 100644 index 0000000000..ed5b623280 --- /dev/null +++ b/src/libleo/api/clearqueue.c @@ -0,0 +1,20 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +s32 LeoClearQueue(void) { + LEOCmdClearQueue cmdBlock; + + if (!__leoActive) { + return -1; + } + + cmdBlock.header.command = 1; + cmdBlock.header.reserve1 = 0; + cmdBlock.header.control = 0; + cmdBlock.header.reserve3 = 0; + + leoCommand(&cmdBlock); + return LEO_ERROR_GOOD; +} diff --git a/src/libleo/api/driveexist.c b/src/libleo/api/driveexist.c new file mode 100644 index 0000000000..314a67064e --- /dev/null +++ b/src/libleo/api/driveexist.c @@ -0,0 +1,41 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +u32 LeoDriveExist(void) { + u32 data; + u32 saveMask; + u32 stat; + u32 latency; + u32 pulse; + u32 pageSize; + u32 relDuration; + + __osPiGetAccess(); + + while ((stat = IO_READ(PI_STATUS_REG)) & (PI_STATUS_DMA_BUSY | PI_STATUS_IO_BUSY)) {} + + latency = IO_READ(PI_BSD_DOM1_LAT_REG); + pageSize = IO_READ(PI_BSD_DOM1_PGS_REG); + relDuration = IO_READ(PI_BSD_DOM1_RLS_REG); + pulse = IO_READ(PI_BSD_DOM1_PWD_REG); + + IO_WRITE(PI_BSD_DOM1_LAT_REG, 0xFF); + IO_WRITE(PI_BSD_DOM1_PGS_REG, 0); + IO_WRITE(PI_BSD_DOM1_RLS_REG, 3); + IO_WRITE(PI_BSD_DOM1_PWD_REG, 0xFF); + + data = IO_READ(0x06001010); // Something in the n64dd address space? + + IO_WRITE(PI_BSD_DOM1_LAT_REG, latency); + IO_WRITE(PI_BSD_DOM1_PGS_REG, pageSize); + IO_WRITE(PI_BSD_DOM1_RLS_REG, relDuration); + IO_WRITE(PI_BSD_DOM1_PWD_REG, pulse); + + __osPiRelAccess(); + if (data == 0x2129FFF8) { + return true; + } + return false; +} diff --git a/src/libleo/api/getaadr.s b/src/libleo/api/getaadr.s new file mode 100644 index 0000000000..a36d27a5b3 --- /dev/null +++ b/src/libleo/api/getaadr.s @@ -0,0 +1,332 @@ +#include "ultra64/asm.h" + +.set noat +.set noreorder + +.section .text + +.balign 16 + +LEAF(LeoGetAAdr) + bltz $a0, .out_of_range + slti $at, $a0, 0x908 + beqz $at, .out_of_range + nop + lui $v1, %hi(asc2tbl) + sll $t0, $a0, 2 + addiu $v1, %lo(asc2tbl) + add $t1, $t0, $v1 + lbu $t8, 2($t1) + lhu $t9, 0($t1) + li $at, 0x70000 + andi $t2, $t8, 0xF + addi $t3, $t2, 1 + sw $t3, ($a2) + lb $t0, 3($t1) + srl $t4, $t8, 4 + ori $at, $at, 0xEE80 + andi $t5, $t0, 1 + sll $t6, $t5, 4 + or $t7, $t6, $t4 + sw $t7, ($a1) + sll $v0, $t9, 1 + sra $v1, $t0, 1 + sw $v1, ($a3) + jr $ra + add $v0, $v0, $at +.out_of_range: + jr $ra + li $v0, -1 +END(LeoGetAAdr) + +DATA(asc2tbl) +.word 0x00009D14, 0x00232A14, 0x00296314, 0x002F8A14, 0x00457E18, 0x0063CA14, 0x0084AA14, 0x00A03314 +.word 0x00A45E14, 0x00BB4E14, 0x00CA6514, 0x00D3770E, 0x00E33302, 0x00E78108, 0x00EB2102, 0x00EC6C14 +.word 0x01008A14, 0x01163A14, 0x01217A14, 0x01377A14, 0x014D8A14, 0x01638A14, 0x01798A14, 0x018F7A14 +.word 0x01A58A14, 0x01BB8A14, 0x01D1170E, 0x01D5490E, 0x01DF770E, 0x01EF740A, 0x01F9770E, 0x02097A14 +.word 0x021FDC16, 0x024DBA14, 0x026E7A14, 0x0284BA14, 0x02A59A14, 0x02C16A14, 0x02D26A14, 0x02E3BA14 +.word 0x03048A14, 0x031A1A14, 0x03206A14, 0x03318A14, 0x03476A14, 0x0358CA14, 0x03799A14, 0x0395CA14 +.word 0x03B67A14, 0x03CCCA14, 0x03ED8A14, 0x04037A14, 0x04196A14, 0x042A8A14, 0x0440AA14, 0x045CDA14 +.word 0x04839A14, 0x049F9A14, 0x04BB7A14, 0x04D14D14, 0x04DF5C14, 0x04F33D14, 0x05015216, 0x050681FA +.word 0x050A9D14, 0x052D9810, 0x05449A14, 0x05609810, 0x05779A14, 0x05939810, 0x05AA5A14, 0x05BB9C10 +.word 0x05DC7A14, 0x05F22A14, 0x05F83D14, 0x06067A14, 0x061C2A14, 0x0622D810, 0x06427810, 0x06549810 +.word 0x066B9B10, 0x06899B10, 0x06A74810, 0x06B06810, 0x06BE5A14, 0x06CF770E, 0x06DF870E, 0x06EFB70E +.word 0x0707670E, 0x07138A0E, 0x0729670E, 0x07356D14, 0x074A1F16, 0x07526D14, 0x07675216, 0x076C9D14 +.word 0x078F9D14, 0x07B22A0E, 0x07B88B14, 0x07D08A14, 0x07E69816, 0x07FD9A14, 0x08193F16, 0x08296C14 +.word 0x083D5114, 0x0840CA14, 0x08616614, 0x086C650C, 0x0875830A, 0x087D9D14, 0x08A0CA14, 0x08C14114 +.word 0x08C35318, 0x08C98810, 0x08DB9D14, 0x08FE9D14, 0x09213216, 0x09249A0E, 0x09407A14, 0x0956440E +.word 0x095B3302, 0x095F9D14, 0x09826614, 0x098D650C, 0x09960A15, 0x09C2C514, 0x09D4070F, 0x09F47A0E +.word 0x0A0ABE1C, 0x0A37BE1C, 0x0A64BE1C, 0x0A91BD1A, 0x0ABBBD1A, 0x0AE5BE1C, 0x0B12FA14, 0x0B3EBE14 +.word 0x0B6B7E1C, 0x0B897E1C, 0x0BA77E1C, 0x0BC57D1A, 0x0BE13E1C, 0x0BF04E1C, 0x0BFF4E1C, 0x0C0E5D1A +.word 0x0C239D14, 0x0C469D1A, 0x0C69BE1C, 0x0C96BE1C, 0x0CC3BE1C, 0x0CF0BD1A, 0x0D1ABD1A, 0x0D44770E +.word 0x0D54CC16, 0x0D7B8E1C, 0x0D998E1C, 0x0DB77E1C, 0x0DD57D1A, 0x0DF19D14, 0x0E149D14, 0x0E379A14 +.word 0x0E539B16, 0x0E719B16, 0x0E8F9B16, 0x0EAD9B16, 0x0ECB9A14, 0x0EE79B16, 0x0F050811, 0x0F299B10 +.word 0x0F479B16, 0x0F659B16, 0x0F839B16, 0x0FA19A14, 0x0FBD3B16, 0x0FC93A16, 0x0FD44B16, 0x0FE04A14 +.word 0x0FEB7912, 0x0FFF8B16, 0x10179B16, 0x10359B16, 0x10539B16, 0x10719B16, 0x108F9A14, 0x10AB760C +.word 0x10B99910, 0x10D28B16, 0x10EA8B16, 0x11028B16, 0x111A8A14, 0x11309D14, 0x11539D14, 0x11769D14 +.word 0x11996F18, 0x11B13A14, 0x11BC7514, 0x11C88912, 0x11DC9D16, 0x11FFEA14, 0x1226CA14, 0x12474514 +.word 0x124D4D14, 0x125B4D14, 0x12696614, 0x1274870E, 0x12843404, 0x12899108, 0x128E4204, 0x12916C14 +.word 0x12A5AA14, 0x12C17A14, 0x12D79A14, 0x12F3AA14, 0x130FAA14, 0x132B9B16, 0x1349AA14, 0x1365AA14 +.word 0x1381AA14, 0x139DAA14, 0x13B9370E, 0x13C1390E, 0x13CB770E, 0x13DB750C, 0x13E7770E, 0x13F79A14 +.word 0x1413CC14, 0x143ACA14, 0x145BBA14, 0x147CBA14, 0x149DBA14, 0x14BEBA14, 0x14DFBA14, 0x1500BA14 +.word 0x1521CA14, 0x15426A14, 0x1553AA14, 0x156FCA14, 0x1590AA14, 0x15ACFA14, 0x15D8CA14, 0x15F9BA14 +.word 0x161AAA14, 0x1636CE14, 0x1663CA14, 0x16849A14, 0x16A0CA14, 0x16C1BA14, 0x16E2CA14, 0x1703EA14 +.word 0x172ACA14, 0x174BCA14, 0x176CAA14, 0x17883D14, 0x17966C14, 0x17AA3D14, 0x17B85214, 0x17BD92FC +.word 0x17C55F1A, 0x17DD870E, 0x17EDAA14, 0x1809870E, 0x18199A14, 0x1835970E, 0x18497A14, 0x185F9C10 +.word 0x1880BA14, 0x18A15A14, 0x18B26E14, 0x18C9AA14, 0x18E55A14, 0x18F6F70E, 0x1916A70E, 0x192A970E +.word 0x193EAB0E, 0x195C9B0E, 0x197A770E, 0x198A770E, 0x199A6912, 0x19A9A70E, 0x19BDA60E, 0x19CFD70E +.word 0x19EBA70E, 0x19FFAB0E, 0x1A1D870E, 0x1A2D6D14, 0x1A423F16, 0x1A526D14, 0x1A675214, 0x1A6C6F18 +.word 0x1A846F16, 0x1A9C3A0E, 0x1AA78B14, 0x1ABFAA14, 0x1ADB8614, 0x1AE9BA14, 0x1B0A2F16, 0x1B128A14 +.word 0x1B285214, 0x1B2DBB14, 0x1B516614, 0x1B5C860C, 0x1B6A730A, 0x1B726E16, 0x1B89BB14, 0x1BAD5012 +.word 0x1BAF5316, 0x1BB58910, 0x1BC95F18, 0x1BE15F18, 0x1BF95316, 0x1BFFA90C, 0x1C188A14, 0x1C2E540E +.word 0x1C363404, 0x1C3B6D14, 0x1C506614, 0x1C5B860C, 0x1C690913, 0x1C91C512, 0x1CA3D70E, 0x1CBF9A0E +.word 0x1CDBCD1A, 0x1D05CD1A, 0x1D2FCD1A, 0x1D59CD1A, 0x1D83CD1A, 0x1DADCE1C, 0x1DDA2A15, 0x1E0CBD14 +.word 0x1E36BD1A, 0x1E60BD1A, 0x1E8ABD1A, 0x1EB4BC18, 0x1EDB6D1A, 0x1EF06D1A, 0x1F056D1A, 0x1F1A6D1A +.word 0x1F2F5F1A, 0x1F47BD1A, 0x1F71CD1A, 0x1F9BCD1A, 0x1FC5CD1A, 0x1FEFCD1A, 0x2019CD1A, 0x2043970E +.word 0x2057CB14, 0x207BAD1A, 0x209EBD1A, 0x20C8BD1A, 0x20F2BD1A, 0x211C6F1A, 0x21345F1A, 0x214CAA14 +.word 0x21689B16, 0x21869B16, 0x21A49A14, 0x21C0AA14, 0x21DC9A14, 0x21F89B16, 0x2216D70E, 0x22329B0E +.word 0x22508B16, 0x22689B16, 0x22869A14, 0x22A29A14, 0x22BE5B16, 0x22D05B16, 0x22E25A14, 0x22F35A14 +.word 0x23048912, 0x2318AA14, 0x23349B16, 0x23529B16, 0x23709A14, 0x238C9A14, 0x23A89A14, 0x23C49910 +.word 0x23DD9A10, 0x23F9AB16, 0x2417AB16, 0x2435AA14, 0x2451AA14, 0x246D5F18, 0x24855F18, 0x249DAE14 +.word 0x24C39D14, 0x24E62A14, 0x24EC5314, 0x24F28912, 0x25068D16, 0x2522CA14, 0x2543CA14, 0x25642314 +.word 0x25663C14, 0x25733C14, 0x25806514, 0x2589770E, 0x25993302, 0x259D9006, 0x25A03102, 0x25A26C14 +.word 0x25B69A14, 0x25D26A14, 0x25E38A14, 0x25F99A14, 0x26159A14, 0x26318A14, 0x26478A14, 0x265D9912 +.word 0x26769A14, 0x26928A14, 0x26A8260C, 0x26AC480C, 0x26B5870E, 0x26C5740A, 0x26CF770E, 0x26DF8A14 +.word 0x26F5DC14, 0x2723CA14, 0x2744A912, 0x275DAA14, 0x2779B912, 0x2797A912, 0x27B0A912, 0x27C9BA14 +.word 0x27EAC912, 0x28085912, 0x28179912, 0x2830B912, 0x284E9912, 0x2867D912, 0x288AB912, 0x28A8CA14 +.word 0x28C99912, 0x28E2CD14, 0x290CB912, 0x292A9A14, 0x2946A912, 0x295FB912, 0x297DC912, 0x299B0913 +.word 0x29C3C912, 0x29E1B912, 0x29FF9912, 0x2A183B12, 0x2A246C14, 0x2A383B12, 0x2A445214, 0x2A4981FA +.word 0x2A4D9D14, 0x2A70970E, 0x2A849A14, 0x2AA0770E, 0x2AB09A14, 0x2ACC870E, 0x2ADC6A14, 0x2AED9C10 +.word 0x2B0E9A14, 0x2B2A4912, 0x2B346D12, 0x2B499A14, 0x2B655A14, 0x2B76F70E, 0x2B96A70E, 0x2BAA970E +.word 0x2BBE9B0E, 0x2BDCAB0E, 0x2BFA770E, 0x2C0A770E, 0x2C1A6912, 0x2C29A70E, 0x2C3D970E, 0x2C51C70E +.word 0x2C69A70E, 0x2C7D9B0E, 0x2C9B770E, 0x2CAB5C12, 0x2CBF2F16, 0x2CC76C12, 0x2CDB5214, 0x2CE08D14 +.word 0x2CFC9D14, 0x2D1F2A0E, 0x2D257B14, 0x2D3D9A14, 0x2D599714, 0x2D6DB912, 0x2D8B2F16, 0x2D937A14 +.word 0x2DA95112, 0x2DACCB14, 0x2DD07714, 0x2DE0760C, 0x2DEE730A, 0x2DF69D14, 0x2E19BB14, 0x2E3D5112 +.word 0x2E405316, 0x2E468810, 0x2E589D14, 0x2E7B9D14, 0x2E9E4214, 0x2EA19A0C, 0x2EBD7A14, 0x2ED3440E +.word 0x2ED82302, 0x2EDA8D14, 0x2EF66714, 0x2F02760C, 0x2F100A15, 0x2F3CC614, 0x2F51C70E, 0x2F698A0E +.word 0x2F7FCD1A, 0x2FA9CD1A, 0x2FD3BD1A, 0x2FFDCD1A, 0x3027CC18, 0x304ECE1C, 0x307B0913, 0x30A3BD14 +.word 0x30CDAD1A, 0x30F0BD1A, 0x311ABD1A, 0x3144AC18, 0x31654D1A, 0x31734D1A, 0x31814D1A, 0x318F5C18 +.word 0x31A39D14, 0x31C6BD1A, 0x31F0CD1A, 0x321ACD1A, 0x3244CD1A, 0x326ECD1A, 0x3298CC18, 0x32BFA70E +.word 0x32D3BB14, 0x32F7BD1A, 0x3321CD1A, 0x334BBD1A, 0x3375BC18, 0x339C8D14, 0x33B88D14, 0x33D49A14 +.word 0x33F09A14, 0x340C9A14, 0x34289A14, 0x34449A14, 0x34609912, 0x34799B16, 0x3497C70E, 0x34AF7A0E +.word 0x34C58A14, 0x34DB8A14, 0x34F17A14, 0x35077912, 0x351B5A14, 0x352C5A14, 0x353D5A14, 0x354E6912 +.word 0x355D7912, 0x35719A14, 0x358D8A14, 0x35A38A14, 0x35B98A14, 0x35CF8A14, 0x35E58912, 0x35F9870E +.word 0x36099910, 0x3622AA14, 0x363EAA14, 0x365AAA14, 0x36769912, 0x368F8D14, 0x36AB8D14, 0x36C79D12 +.word 0x36EA6F18, 0x37024912, 0x370C7412, 0x37166B14, 0x37288C14, 0x37427912, 0x37568810, 0x37684412 +.word 0x376D5C12, 0x37815C12, 0x37957612, 0x37A39710, 0x37B74404, 0x37BCA108, 0x37C13306, 0x37C57B14 +.word 0x37DD8912, 0x37F17912, 0x38057912, 0x38198912, 0x382D8912, 0x38417912, 0x38557912, 0x38697912 +.word 0x387D8912, 0x38918912, 0x38A5370E, 0x38AD480C, 0x38B69710, 0x38CA940E, 0x38D79710, 0x38EB7912 +.word 0x38FF8B14, 0x3917A912, 0x39309912, 0x39498912, 0x395D8912, 0x39719912, 0x398A9912, 0x39A39912 +.word 0x39BC9912, 0x39D57912, 0x39E99912, 0x3A029912, 0x3A1B9912, 0x3A34A912, 0x3A4D9912, 0x3A669912 +.word 0x3A7F8912, 0x3A939B12, 0x3AB19912, 0x3ACA8912, 0x3ADE8912, 0x3AF29912, 0x3B0B9912, 0x3B24A912 +.word 0x3B3D8912, 0x3B518912, 0x3B657912, 0x3B794C12, 0x3B867B14, 0x3B9E4C12, 0x3BAB6214, 0x3BB0A2FC +.word 0x3BB85F1A, 0x3BD0870E, 0x3BE09912, 0x3BF9870E, 0x3C098912, 0x3C1D870E, 0x3C2D8912, 0x3C419A0E +.word 0x3C5D8912, 0x3C718A14, 0x3C877D14, 0x3CA39912, 0x3CBC8912, 0x3CD0A70E, 0x3CE4970E, 0x3CF8970E +.word 0x3D0C9B0E, 0x3D2AAB0E, 0x3D48970E, 0x3D5C770E, 0x3D6C8912, 0x3D80970E, 0x3D94970E, 0x3DA8A70E +.word 0x3DBC870E, 0x3DCC9A0E, 0x3DE8770E, 0x3DF86D12, 0x3E0D2F16, 0x3E156D12, 0x3E2A6212, 0x3E2F6F16 +.word 0x3E476F16, 0x3E5F4912, 0x3E697A14, 0x3E7F7912, 0x3E938612, 0x3EA19912, 0x3EBA3F16, 0x3ECA8A12 +.word 0x3EE06112, 0x3EE3A812, 0x3EFA7712, 0x3F0A550C, 0x3F13950E, 0x3F226E16, 0x3F399812, 0x3F506112 +.word 0x3F534316, 0x3F578812, 0x3F695F18, 0x3F815F18, 0x3F995214, 0x3F9E9A0E, 0x3FBA7912, 0x3FCE320C +.word 0x3FD14404, 0x3FD66D14, 0x3FEB7712, 0x3FFB650C, 0x40048710, 0x40148310, 0x401C860E, 0x402A7912 +.word 0x403EAC18, 0x405FAC18, 0x4080AC18, 0x40A1AB16, 0x40BFAB16, 0x40DDAD1A, 0x4100B912, 0x411E8C12 +.word 0x41388C18, 0x41529C18, 0x41739C18, 0x41948B16, 0x41AC7C18, 0x41C67C18, 0x41E07C18, 0x41FA7B16 +.word 0x42125F1A, 0x422AAB16, 0x42489C18, 0x42699C18, 0x428A9C18, 0x42AB9B16, 0x42C99B16, 0x42E7870E +.word 0x42F79A12, 0x43139C18, 0x43349C18, 0x4355AC18, 0x4376AB16, 0x43946F1A, 0x43AC5F1A, 0x43C48912 +.word 0x43D88A14, 0x43EE8A14, 0x44049A14, 0x44209912, 0x44398912, 0x444D8B16, 0x4465970E, 0x44798A0E +.word 0x448F8A14, 0x44A58A14, 0x44BB9A14, 0x44D79912, 0x44F08A14, 0x45068A14, 0x451C7A14, 0x45327912 +.word 0x45468912, 0x455A9912, 0x45738A14, 0x45898A14, 0x459F9912, 0x45B89912, 0x45D19912, 0x45EAA912 +.word 0x46039910, 0x461C9A14, 0x46389A14, 0x46548A14, 0x466A9912, 0x46835F18, 0x469B5F18, 0x46B38C12 +.word 0x46CD3C16, 0x46DA3C16, 0x46E77516, 0x46F39A14, 0x470F7E18, 0x472DDC16, 0x475BBC16, 0x47824516 +.word 0x47884F18, 0x47984F18, 0x47A85516, 0x47B1870E, 0x47C15504, 0x47CA810A, 0x47CE4304, 0x47D28F18 +.word 0x47F29C16, 0x48134B16, 0x481F8B16, 0x48378C16, 0x48519B16, 0x486F8C16, 0x48898C16, 0x48A38B16 +.word 0x48BB8C16, 0x48D58C16, 0x48EF380E, 0x48F84A0E, 0x4903970E, 0x4917850C, 0x4923870E, 0x49337C16 +.word 0x494DCC16, 0x4974BB16, 0x49988B16, 0x49B09C16, 0x49D1AB16, 0x49EF7B16, 0x4A077B16, 0x4A1FBC16 +.word 0x4A46AB16, 0x4A643B16, 0x4A706C16, 0x4A849B16, 0x4AA26B16, 0x4AB4DC16, 0x4AE2AC16, 0x4B03CC16 +.word 0x4B2A8B16, 0x4B42CC16, 0x4B698B16, 0x4B818C16, 0x4B9B7B16, 0x4BB39C16, 0x4BD4BC16, 0x4BFBFC16 +.word 0x4C2FAB16, 0x4C4DAB16, 0x4C6B9B16, 0x4C893E18, 0x4C988C18, 0x4CB24E18, 0x4CC16316, 0x4CC781FC +.word 0x4CCB3C16, 0x4CD8880E, 0x4CEA8D18, 0x4D06680E, 0x4D149D18, 0x4D37880E, 0x4D495C18, 0x4D5D8B0E +.word 0x4D757C18, 0x4D8F3B16, 0x4D9B3F16, 0x4DAB8C18, 0x4DC53C18, 0x4DD2B70E, 0x4DEA770E, 0x4DFA980E +.word 0x4E119B0E, 0x4E2F9B0E, 0x4E4D670E, 0x4E59680E, 0x4E674912, 0x4E71780E, 0x4E83980E, 0x4E9AD80E +.word 0x4EBAA70E, 0x4ECE9B0E, 0x4EEC770E, 0x4EFC5F18, 0x4F142C18, 0x4F1B4F18, 0x4F2B7114, 0x4F2F3C16 +.word 0x4F3C3C10, 0x4F493B0E, 0x4F556A14, 0x4F669C16, 0x4F879810, 0x4F9E9B16, 0x4FBC2C18, 0x4FC38E18 +.word 0x4FE16216, 0x4FE6DC16, 0x50146616, 0x501F7710, 0x502F840C, 0x50393C1A, 0x5046DC16, 0x50747116 +.word 0x50784316, 0x507C8912, 0x50903C14, 0x509D3C14, 0x50AA4316, 0x50AE7B0E, 0x50C6AE16, 0x50EC6610 +.word 0x50F75504, 0x51003C18, 0x510D6616, 0x51188710, 0x5128FC16, 0x515CE616, 0x5175D80E, 0x51958B0E +.word 0x51ADCC18, 0x51D4BC18, 0x51FBBC18, 0x5222BC18, 0x5249CC18, 0x5270BC18, 0x5297FB16, 0x52C79E16 +.word 0x52ED6C18, 0x53016C18, 0x53157C18, 0x532F7C18, 0x53494C18, 0x53564C18, 0x53636C18, 0x53777C18 +.word 0x53913C18, 0x539EAD18, 0x53C1CD18, 0x53EBCD18, 0x5415CD18, 0x543FCD18, 0x5469CC18, 0x5490970E +.word 0x54A4CC16, 0x54CB9D18, 0x54EE9D18, 0x55119D18, 0x55349D18, 0x55573C18, 0x55643C18, 0x55719D18 +.word 0x55948C16, 0x55AE9C16, 0x55CF8C16, 0x55E99B14, 0x56078C16, 0x56219C16, 0x5642C80E, 0x565D6A0E +.word 0x566E8C16, 0x56887C16, 0x56A28C16, 0x56BC7C16, 0x56D64B16, 0x56E24B16, 0x56EE6B16, 0x57007B16 +.word 0x57187B16, 0x57307A14, 0x57469C16, 0x57678C16, 0x57818C16, 0x579B9B14, 0x57B99C16, 0x57DA880E +.word 0x57EC980E, 0x58038C16, 0x581D8C16, 0x58378C16, 0x58518C16, 0x586B3C16, 0x58783C16, 0x58859F16 +.word 0x58AD6F18, 0x58C55C16, 0x58D98516, 0x58E59B14, 0x59038E18, 0x5921BC16, 0x5948AC16, 0x59695516 +.word 0x59724F18, 0x59825F18, 0x599A6516, 0x59A3970E, 0x59B75504, 0x59C0810A, 0x59C43304, 0x59C8AF18 +.word 0x59F09C16, 0x5A115B16, 0x5A239B16, 0x5A418C16, 0x5A5B9B16, 0x5A799C16, 0x5A9A9C16, 0x5ABBAC16 +.word 0x5ADC8C16, 0x5AF69C16, 0x5B17480E, 0x5B206A0E, 0x5B31970E, 0x5B45950C, 0x5B54970E, 0x5B687C16 +.word 0x5B82CC16, 0x5BA9BB16, 0x5BCD9B16, 0x5BEB9C16, 0x5C0CBB16, 0x5C309B16, 0x5C4E9B16, 0x5C6CBC16 +.word 0x5C93BB16, 0x5CB75B16, 0x5CC98C16, 0x5CE3BB16, 0x5D077B16, 0x5D1FDC16, 0x5D4DCC16, 0x5D74DC16 +.word 0x5DA29B16, 0x5DC0CC16, 0x5DE79B16, 0x5E059C16, 0x5E268B16, 0x5E3EAC16, 0x5E5FBC16, 0x5E860C17 +.word 0x5EBABB16, 0x5EDEAB16, 0x5EFCBB16, 0x5F205E18, 0x5F376E18, 0x5F4E6E18, 0x5F655316, 0x5F6B91FC +.word 0x5F706F1A, 0x5F88980E, 0x5F9F9D18, 0x5FC2680E, 0x5FD0AD18, 0x5FF3880E, 0x60056C18, 0x60199B0E +.word 0x60378C18, 0x60515B16, 0x60636F16, 0x607B9C18, 0x609C5C18, 0x60B0C70E, 0x60C8870E, 0x60D8880E +.word 0x60EA9B0E, 0x61089B0E, 0x6126770E, 0x6136680E, 0x61446912, 0x6153780E, 0x6165980E, 0x617CD80E +.word 0x619CA70E, 0x61B0AB0E, 0x61CEA70E, 0x61E26F18, 0x61FA4C18, 0x62076F18, 0x621F7114, 0x62236F18 +.word 0x623B6F16, 0x62534B0E, 0x625F7A14, 0x6275AC16, 0x6296A810, 0x62ADAB16, 0x62CB4C18, 0x62D88E18 +.word 0x62F66216, 0x62FBDC16, 0x63297616, 0x63378710, 0x6347940C, 0x63546F18, 0x636CDC16, 0x639A6116 +.word 0x639D4316, 0x63A19912, 0x63BA6F18, 0x63D26F18, 0x63EA5316, 0x63F09B0E, 0x640E9E16, 0x64346610 +.word 0x643F5504, 0x64486F18, 0x64607616, 0x646E8710, 0x647EFA14, 0x64AAD514, 0x64BFC60C, 0x64D47B0E +.word 0x64ECCC18, 0x6513BC18, 0x653ABC18, 0x6561CC18, 0x6588CC18, 0x65AFBC18, 0x65D6FB16, 0x6606AE16 +.word 0x662C8C18, 0x66468C18, 0x66609C18, 0x66819C18, 0x66A25C18, 0x66B66C18, 0x66CA7C18, 0x66E47C18 +.word 0x66FE6F1A, 0x6716CD18, 0x6740DD18, 0x6771CD18, 0x679BCD18, 0x67C5CD18, 0x67EFDD18, 0x6820A70E +.word 0x6834FC16, 0x6868AD18, 0x688BAD18, 0x68AEAD18, 0x68D1AD18, 0x68F46F1A, 0x690C6F1A, 0x69249D18 +.word 0x69479C16, 0x69689C16, 0x69899C16, 0x69AA9B14, 0x69C89C16, 0x69E99C16, 0x6A0AD80E, 0x6A2A7A0E +.word 0x6A408C16, 0x6A5A8C16, 0x6A748C16, 0x6A8E8C16, 0x6AA85B16, 0x6ABA5B16, 0x6ACC6B16, 0x6ADE6B16 +.word 0x6AF07B16, 0x6B089A14, 0x6B248C16, 0x6B3E9C16, 0x6B5F9C16, 0x6B808B14, 0x6B988C16, 0x6BB2980E +.word 0x6BC9980E, 0x6BE08C16, 0x6BFA8C16, 0x6C148C16, 0x6C2E8C16, 0x6C486F18, 0x6C606F18, 0x6C78AF16 +.word 0x6CA06F18, 0x6CB82A14, 0x6CBE4314, 0x6CC29A14, 0x6CDE8D16, 0x6CFADB14, 0x6D249B14, 0x6D422314 +.word 0x6D445D14, 0x6D594D14, 0x6D675414, 0x6D6F870E, 0x6D7F2402, 0x6D829108, 0x6D872102, 0x6D885A14 +.word 0x6D998B14, 0x6DB15A14, 0x6DC28A14, 0x6DD88B14, 0x6DF08A14, 0x6E068B14, 0x6E1E8B14, 0x6E368A14 +.word 0x6E4C8B14, 0x6E648B14, 0x6E7C270E, 0x6E802A0E, 0x6E86970E, 0x6E9A850C, 0x6EA6970E, 0x6EBA7A14 +.word 0x6ED0DB14, 0x6EFAAA14, 0x6F169A14, 0x6F32AB14, 0x6F509A14, 0x6F6C9A14, 0x6F889A14, 0x6FA4AB14 +.word 0x6FC2AA14, 0x6FDE2A14, 0x6FE47B14, 0x6FFC9A14, 0x70188A14, 0x702EBA14, 0x704F9A14, 0x706BBB14 +.word 0x708F9A14, 0x70ABBB14, 0x70CF9A14, 0x70EB9B14, 0x7109AA14, 0x71259B14, 0x7143AA14, 0x715FEA14 +.word 0x7186AA14, 0x71A2AA14, 0x71BE9A14, 0x71DA3D14, 0x71E87A14, 0x71FE4D14, 0x720C5214, 0x721190FC +.word 0x72145F1A, 0x722C8910, 0x72408B14, 0x72588910, 0x726C7C16, 0x72868910, 0x729A6A14, 0x72AB8C10 +.word 0x72C57A14, 0x72DB2A14, 0x72E14E14, 0x72F07A14, 0x73062A14, 0x730CB810, 0x73277810, 0x73398910 +.word 0x734D8C10, 0x73678C10, 0x73815810, 0x738F7910, 0x73A34A12, 0x73AE780E, 0x73C0870E, 0x73D0B70E +.word 0x73E8770E, 0x73F88B0E, 0x7410770E, 0x74205D14, 0x74352A14, 0x743B6D14, 0x74506114, 0x74536F18 +.word 0x746B6F16, 0x74832A0E, 0x74898B12, 0x74A18B14, 0x74B98710, 0x74C99A14, 0x74E52A14, 0x74EB7E14 +.word 0x75094114, 0x750BBA14, 0x752C5414, 0x7534650C, 0x753D840A, 0x75476E16, 0x755EBA14, 0x757F6114 +.word 0x75823316, 0x7586870E, 0x75965F18, 0x75AE5F18, 0x75C64214, 0x75C99B0E, 0x75E78D14, 0x7603430C +.word 0x76072402, 0x760A6D14, 0x761F5414, 0x7627550C, 0x7630FB14, 0x7660C514, 0x7672E80E, 0x76928A0E +.word 0x76A8AD1A, 0x76CBAD1A, 0x76EEAD1A, 0x7711AD1A, 0x7734AD1A, 0x7757AE1C, 0x777DFA14, 0x77A9AD14 +.word 0x77CC8D1A, 0x77E88D1A, 0x78048D1A, 0x78208C18, 0x783A4D1A, 0x78483D1A, 0x78565D1A, 0x786B5D1A +.word 0x78805F1A, 0x7898AD1A, 0x78BBCE1A, 0x78E8BE1A, 0x7915BE1A, 0x7942BE1A, 0x796FCD18, 0x7999870E +.word 0x79A9BB14, 0x79CD9E1A, 0x79F39E1A, 0x7A199E1A, 0x7A3FAE1A, 0x7A656F1A, 0x7A7D5F1A, 0x7A958B14 +.word 0x7AAD8C16, 0x7AC78C16, 0x7AE18C16, 0x7AFB8B14, 0x7B138B14, 0x7B2B8C16, 0x7B45D910, 0x7B687C10 +.word 0x7B828C16, 0x7B9C8C16, 0x7BB68C16, 0x7BD08B14, 0x7BE84B16, 0x7BF44B16, 0x7C005B16, 0x7C124B16 +.word 0x7C1E7B14, 0x7C367A14, 0x7C4C8C16, 0x7C668C16, 0x7C808C16, 0x7C9A8B14, 0x7CB28B14, 0x7CCA870E +.word 0x7CDA8910, 0x7CEE7C16, 0x7D088C16, 0x7D227C16, 0x7D3C7B14, 0x7D545F18, 0x7D6C5F18, 0x7D848E14 +.word 0x7DA26F16, 0x7DBA3A14, 0x7DC56414, 0x7DCD9A14, 0x7DE98D16, 0x7E05EB14, 0x7E2FBB14, 0x7E533414 +.word 0x7E584D14, 0x7E664D14, 0x7E746414, 0x7E7C870E, 0x7E8C3402, 0x7E91920A, 0x7E993102, 0x7E9B7A14 +.word 0x7EB18B14, 0x7EC95A14, 0x7EDA8A14, 0x7EF08B14, 0x7F088A14, 0x7F1E8B14, 0x7F368B14, 0x7F4E8A14 +.word 0x7F648B14, 0x7F7C9B14, 0x7F9A370E, 0x7FA23A0E, 0x7FADA80E, 0x7FC4960C, 0x7FD6980E, 0x7FED9A14 +.word 0x8009DC16, 0x8037BA14, 0x8058AA14, 0x8074BB14, 0x8098AA14, 0x80B49A14, 0x80D09A14, 0x80ECBB14 +.word 0x8110AA14, 0x812C3A14, 0x81378B14, 0x814FAA14, 0x816B9A14, 0x8187BA14, 0x81A8AA14, 0x81C4BB14 +.word 0x81E89A14, 0x8204BB14, 0x8228AA14, 0x8244AB14, 0x8262AA14, 0x827E9B14, 0x829CAA14, 0x82B8FA14 +.word 0x82E4AA14, 0x8300AA14, 0x831C9A14, 0x83384D14, 0x83466A14, 0x83575D14, 0x836C6216, 0x837190FC +.word 0x83745F18, 0x838C8910, 0x83A09B14, 0x83BE8910, 0x83D29B14, 0x83F09910, 0x84095A14, 0x841A8C10 +.word 0x84348A14, 0x844A3A14, 0x84554E14, 0x84648A14, 0x847A2A14, 0x8480C810, 0x849B8810, 0x84AD9910 +.word 0x84C68C10, 0x84E09C10, 0x85015810, 0x850F8910, 0x85235A14, 0x8534880E, 0x8546870E, 0x8556C70E +.word 0x856E870E, 0x857E8B0E, 0x8596870E, 0x85A65D14, 0x85BB3A14, 0x85C66D14, 0x85DB7216, 0x85E16F18 +.word 0x85F96F14, 0x86113A0E, 0x861C8B12, 0x86348B14, 0x864C8710, 0x865C9A14, 0x86783A14, 0x86838D14 +.word 0x869F6114, 0x86A2BA14, 0x86C36514, 0x86CC750C, 0x86D8950C, 0x86E75F16, 0x86FFBA14, 0x87206114 +.word 0x87234318, 0x8727970E, 0x873B5F16, 0x87535F16, 0x876B4114, 0x876DAB0E, 0x878B9D14, 0x87AE430C +.word 0x87B23402, 0x87B76F16, 0x87CF6514, 0x87D8650C, 0x87E1EC14, 0x880FC512, 0x8821E90E, 0x88448A0E +.word 0x885AAD1A, 0x887DBD1A, 0x88A7BD1A, 0x88D1BD1A, 0x88FBAD1A, 0x891EBE1C, 0x894BFA14, 0x8977AE14 +.word 0x899D9D1A, 0x89C09D1A, 0x89E39D1A, 0x8A069D1A, 0x8A294D1A, 0x8A374D1A, 0x8A456D1A, 0x8A5A6D1A +.word 0x8A6F5F18, 0x8A87AD1A, 0x8AAABE1A, 0x8AD7BE1A, 0x8B04BE1A, 0x8B31BE1A, 0x8B5EBE1A, 0x8B8B870E +.word 0x8B9BBB14, 0x8BBF9E1A, 0x8BE59E1A, 0x8C0BAE1A, 0x8C31AE1A, 0x8C575F18, 0x8C6F5F18, 0x8C878B14 +.word 0x8C9F8B14, 0x8CB79B14, 0x8CD58C16, 0x8CEF8C16, 0x8D098B14, 0x8D219D18, 0x8D44D910, 0x8D678C10 +.word 0x8D818B14, 0x8D999B14, 0x8DB79C16, 0x8DD88B14, 0x8DF05A14, 0x8E015A14, 0x8E125A14, 0x8E236A14 +.word 0x8E348B14, 0x8E4C8B16, 0x8E649B14, 0x8E829B14, 0x8EA09C16, 0x8EC19C16, 0x8EE29B14, 0x8F00870E +.word 0x8F10A910, 0x8F298B14, 0x8F418B14, 0x8F598C16, 0x8F738C16, 0x8F8D5F18, 0x8FA55F18, 0x8FBD8F16 +.word 0x8FDD6F16, 0x8FF54A12, 0x90004312, 0x90049A12, 0x90209C14, 0x9041BA12, 0x90628A12, 0x90782312 +.word 0x907A6C12, 0x908E5C12, 0x90A25412, 0x90AA870C, 0x90BA3300, 0x90BE8006, 0x90C02100, 0x90C17A12 +.word 0x90D78A12, 0x90ED5A12, 0x90FE9A12, 0x911A8A12, 0x91308A12, 0x91469A12, 0x91628A12, 0x91788A12 +.word 0x918E8A12, 0x91A47A12, 0x91BA370E, 0x91C24A0E, 0x91CD980E, 0x91E4940A, 0x91F1980E, 0x92087A12 +.word 0x921ECB14, 0x9242AA12, 0x925E9A12, 0x927ABB14, 0x929EAA12, 0x92BABA12, 0x92DBAA12, 0x92F7BB14 +.word 0x931BBA12, 0x933C4A12, 0x93478A12, 0x935DBA12, 0x937E8A12, 0x9394CA12, 0x93B5AA12, 0x93D1BB14 +.word 0x93F5AA12, 0x9411BB14, 0x9435AA12, 0x94519B14, 0x946F9A12, 0x948BAA12, 0x94A7AA12, 0x94C3DA12 +.word 0x94EABA12, 0x950B9A12, 0x9527BA12, 0x95485C12, 0x955C3A12, 0x95675C12, 0x957B5112, 0x957E80FC +.word 0x95803F18, 0x9590780E, 0x95A29A12, 0x95BE880E, 0x95D09A12, 0x95EC880E, 0x95FE5A12, 0x960F9B0E +.word 0x962D8A12, 0x96434A12, 0x964E6D12, 0x96638A12, 0x96794A12, 0x9684C80E, 0x969F880E, 0x96B1880E +.word 0x96C39B0E, 0x96E18B0E, 0x96F9680E, 0x9707780E, 0x97195A12, 0x972A880E, 0x973C880E, 0x974EA80E +.word 0x9765980E, 0x977C9B0E, 0x979A880E, 0x97AC7C12, 0x97C63A12, 0x97D16C12, 0x97E56112, 0x97E86F18 +.word 0x98004F14, 0x98104A0E, 0x981B8A10, 0x98319A12, 0x984D860E, 0x985B9A12, 0x98774A12, 0x98827D12 +.word 0x989E5112, 0x98A1BA12, 0x98C25514, 0x98CB740A, 0x98D5840A, 0x98DF5F14, 0x98F7BA12, 0x99185112 +.word 0x991B3214, 0x991E870C, 0x992E5F16, 0x99465F16, 0x995E3112, 0x9960BB0E, 0x99848C12, 0x999E330C +.word 0x99A22300, 0x99A46F16, 0x99BC5514, 0x99C5640A, 0x99CDFB14, 0x99FDB412, 0x9A0CD80E, 0x9A2C7A0E +.word 0x9A42AD18, 0x9A65AD18, 0x9A889D18, 0x9AABAD18, 0x9ACEAD18, 0x9AF1AE1A, 0x9B17FA12, 0x9B43BE14 +.word 0x9B70BD18, 0x9B9AAD18, 0x9BBDAD18, 0x9BE0AD18, 0x9C035D18, 0x9C186D18, 0x9C2D6D18, 0x9C426D18 +.word 0x9C573F18, 0x9C67BD18, 0x9C91BD18, 0x9CBBBD18, 0x9CE5BD18, 0x9D0FBD18, 0x9D39BD18, 0x9D63980E +.word 0x9D7ADB14, 0x9DA4AD18, 0x9DC7AD18, 0x9DEAAD18, 0x9E0DAD18, 0x9E305F18, 0x9E485F18, 0x9E608A12 +.word 0x9E768B14, 0x9E8E8B14, 0x9EA68B14, 0x9EBE8B14, 0x9ED68A12, 0x9EEC8C16, 0x9F06D80E, 0x9F267B0E +.word 0x9F3E8B14, 0x9F567B14, 0x9F6E8B14, 0x9F868A12, 0x9F9C3B14, 0x9FA85B14, 0x9FBA5B14, 0x9FCC5A12 +.word 0x9FDD8A12, 0x9FF38B14, 0xA00B8B14, 0xA0238B14, 0xA03B8B14, 0xA0538B14, 0xA06B8A12, 0xA081860C +.word 0xA08F980E, 0xA0A67B14, 0xA0BE8B14, 0xA0D68B14, 0xA0EE8A12, 0xA1045E16, 0xA11B5E16, 0xA1329D12 +.word 0xA1556F1A, 0xA16D1B16, 0xA1735316, 0xA1797B16, 0xA1915D18, 0xA1A67B16, 0xA1BE5B16, 0xA1D02316 +.word 0xA1D22F18, 0xA1DA2F18, 0xA1E23316, 0xA1E6540C, 0xA1EE2404, 0xA1F15008, 0xA1F31204, 0xA1F53A16 +.word 0xA2004B16, 0xA20C2B16, 0xA2124B16, 0xA21E5B16, 0xA2304B16, 0xA23C5B16, 0xA24E4B16, 0xA25A5B16 +.word 0xA26C4B16, 0xA2785B16, 0xA28A1710, 0xA28E280E, 0xA2936810, 0xA2A1530C, 0xA2A75810, 0xA2B54B16 +.word 0xA2C17C18, 0xA2DB5B16, 0xA2ED4B16, 0xA2F96C18, 0xA30D5B16, 0xA31F5B16, 0xA3315C18, 0xA3456C18 +.word 0xA3595B16, 0xA36B2A16, 0xA3714B16, 0xA37D6B16, 0xA38F5B16, 0xA3A17B16, 0xA3B96B16, 0xA3CB6C18 +.word 0xA3DF5B16, 0xA3F16D18, 0xA4065C18, 0xA41A6C18, 0xA42E6A16, 0xA43F5B16, 0xA4516B16, 0xA4638C18 +.word 0xA47D5B16, 0xA48F5B16, 0xA4A15B16, 0xA4B32E16, 0xA4BB3A16, 0xA4C62E16, 0xA4CE531A, 0xA4D470FC +.word 0xA4D65F1C, 0xA4EE4810, 0xA4F75B16, 0xA5095912, 0xA5185B16, 0xA52A5810, 0xA5383C18, 0xA5454B10 +.word 0xA5514B16, 0xA55D2B16, 0xA5632E16, 0xA56B4B16, 0xA5772B16, 0xA57D6810, 0xA58B4810, 0xA5945912 +.word 0xA5A34B10, 0xA5AF5B10, 0xA5C13810, 0xA5CA5912, 0xA5D93A14, 0xA5E44810, 0xA5ED5810, 0xA5FB6810 +.word 0xA6094810, 0xA6125B10, 0xA6245810, 0xA6324E16, 0xA6412E16, 0xA6494E16, 0xA6586116, 0xA65B6C18 +.word 0xA66F5E16, 0xA6862B10, 0xA68C5C14, 0xA6A04B16, 0xA6AC5712, 0xA6B84A16, 0xA6C32B16, 0xA6C94E16 +.word 0xA6D83116, 0xA6DA7B16, 0xA6F23618, 0xA6F9650E, 0xA702440C, 0xA7076B16, 0xA7197B16, 0xA7317016 +.word 0xA7332218, 0xA735570E, 0xA7415F1A, 0xA7595F1A, 0xA7712116, 0xA7725B10, 0xA7845E16, 0xA79B230E +.word 0xA79D2300, 0xA79F6D16, 0xA7B43618, 0xA7BB640C, 0xA7C38B16, 0xA7DB7516, 0xA7E78810, 0xA7F95B10 +.word 0xA80B5E1C, 0xA8225E1C, 0xA8395E1C, 0xA8506E1C, 0xA8675D1A, 0xA87C5F1E, 0xA8948B16, 0xA8AC6F18 +.word 0xA8C45F1E, 0xA8DC5E1C, 0xA8F35F1E, 0xA90B5D1A, 0xA9202E1C, 0xA9282E1C, 0xA9305F1E, 0xA9484D1A +.word 0xA9565F1C, 0xA96E6E1C, 0xA9857E1C, 0xA9A37E1C, 0xA9C17F1E, 0xA9E17E1C, 0xA9FF7D1A, 0xAA1B4810 +.word 0xAA246C18, 0xAA386E1C, 0xAA4F6E1C, 0xAA666F1E, 0xAA7E6D1A, 0xAA936F1C, 0xAAAB5F1C, 0xAAC34B16 +.word 0xAACF5B16, 0xAAE15B16, 0xAAF35C18, 0xAB076B16, 0xAB194A14, 0xAB245C18, 0xAB387810, 0xAB4A4B10 +.word 0xAB565B16, 0xAB685B16, 0xAB7A5C18, 0xAB8E4A14, 0xAB992B16, 0xAB9F2B16, 0xABA55B16, 0xABB74A14 +.word 0xABC24B16, 0xABCE6B16, 0xABE05B16, 0xABF25B16, 0xAC045C18, 0xAC186B16, 0xAC2A4A14, 0xAC35560E +.word 0xAC405810, 0xAC4E5B16, 0xAC604B16, 0xAC6C5C18, 0xAC804A14, 0xAC8B5F1A, 0xACA36F1A, 0xACBB4D14 +.word 0xACC96F1A, 0xACE12C18, 0xACE85318, 0xACEE8C18, 0xAD087E18, 0xAD266B16, 0xAD388C18, 0xAD522318 +.word 0xAD543F18, 0xAD643F18, 0xAD745318, 0xAD7A8710, 0xAD8A2302, 0xAD8C710A, 0xAD902102, 0xAD915E1A +.word 0xADA85B16, 0xADBA4B16, 0xADC65B16, 0xADD85B16, 0xADEA7B16, 0xAE025B16, 0xAE145B16, 0xAE267B16 +.word 0xAE3E5B16, 0xAE505B16, 0xAE622710, 0xAE662910, 0xAE6B7A12, 0xAE81740C, 0xAE8B7A12, 0xAEA16C18 +.word 0xAEB58C18, 0xAECF7C18, 0xAEE96C18, 0xAEFD6C18, 0xAF116C18, 0xAF255C18, 0xAF395C18, 0xAF4D6C18 +.word 0xAF616C18, 0xAF752C18, 0xAF7C6C18, 0xAF908C18, 0xAFAA5C18, 0xAFBE8C18, 0xAFD87C18, 0xAFF26C18 +.word 0xB0066C18, 0xB01A7C18, 0xB0346C18, 0xB0486C18, 0xB05C6C18, 0xB0706C18, 0xB0847C18, 0xB09EAC18 +.word 0xB0BF8C18, 0xB0D98C18, 0xB0F36C18, 0xB1073F1C, 0xB1175E1A, 0xB12E3F1C, 0xB13E5216, 0xB14380FC +.word 0xB1455F1C, 0xB15D5912, 0xB16C5C18, 0xB1805810, 0xB18E5C18, 0xB1A25912, 0xB1B14C18, 0xB1BE5C12 +.word 0xB1D25C18, 0xB1E62C18, 0xB1ED4F18, 0xB1FD6C18, 0xB2112C18, 0xB2187912, 0xB22C5912, 0xB23B5912 +.word 0xB24A5C12, 0xB25E5C12, 0xB2725912, 0xB2815A14, 0xB2924B16, 0xB29E5810, 0xB2AC7810, 0xB2BE8810 +.word 0xB2D07810, 0xB2E27A10, 0xB2F85810, 0xB3065E16, 0xB31D1C18, 0xB3245E16, 0xB33B6116, 0xB33E6C18 +.word 0xB3525E16, 0xB3692B10, 0xB36F6C14, 0xB3837B16, 0xB39B7914, 0xB3AF8B16, 0xB3C71C18, 0xB3CE7D16 +.word 0xB3EA4016, 0xB3EB7B16, 0xB4033618, 0xB40AA912, 0xB423820C, 0xB4296B16, 0xB43B7B16, 0xB4538016 +.word 0xB4553218, 0xB4588A14, 0xB46E3418, 0xB4733418, 0xB4783118, 0xB47A8A10, 0xB4906E16, 0xB4A7430E +.word 0xB4AB2302, 0xB4AD3418, 0xB4B23618, 0xB4B9A912, 0xB4D28B16, 0xB4EA8216, 0xB4F08910, 0xB5046B10 +.word 0xB5167E1C, 0xB5347E1C, 0xB5527F1E, 0xB5727E1C, 0xB5907E1C, 0xB5AE7F1E, 0xB5CE8C18, 0xB5E86E18 +.word 0xB5FF5F1E, 0xB6175F1E, 0xB62F5F1E, 0xB6475E1C, 0xB65E3F1E, 0xB66E3F1E, 0xB67E5F1E, 0xB6964E1C +.word 0xB6A57C18, 0xB6BF7E1C, 0xB6DD6F1E, 0xB6F56F1E, 0xB70D6F1E, 0xB7256F1E, 0xB73D6E1C, 0xB7547812 +.word 0xB7668C18, 0xB7806E1C, 0xB7976E1C, 0xB7AE6E1C, 0xB7C56D1A, 0xB7DA8D1A, 0xB7F68E1C, 0xB8146D1A +.word 0xB8295B16, 0xB83B5B16, 0xB84D5C18, 0xB8616B16, 0xB8735A14, 0xB8845C18, 0xB8988912, 0xB8AC5D12 +.word 0xB8C15B16, 0xB8D35B16, 0xB8E55B16, 0xB8F75A14, 0xB9083B16, 0xB9143B16, 0xB9205B16, 0xB9324A14 +.word 0xB93D5B16, 0xB94F6B16, 0xB9615B16, 0xB9735B16, 0xB9855C18, 0xB9996B16, 0xB9AB5A14, 0xB9BC8710 +.word 0xB9CC7B14, 0xB9E45B16, 0xB9F65B16, 0xBA085B16, 0xBA1A5A14, 0xBA2B7C16, 0xBA455C16, 0xBA597B14 +.word 0xBA716F18, 0xBA893B16, 0xBA956414, 0xBA9D6912, 0xBAAC6D16, 0xBAC17B14, 0xBAD97B14, 0xBAF14414 +.word 0xBAF64D16, 0xBB043D16, 0xBB127912, 0xBB266912, 0xBB353302, 0xBB39610A, 0xBB3C3202, 0xBB3F8D16 +.word 0xBB5B6B16, 0xBB6D5B16, 0xBB7F7B16, 0xBB976B16, 0xBBA97B16, 0xBBC17B16, 0xBBD97B16, 0xBBF16B16 +.word 0xBC037B16, 0xBC1B7B16, 0xBC333810, 0xBC3C3910, 0xBC467C18, 0xBC60730E, 0xBC687C18, 0xBC826B16 +.word 0xBC947B16, 0xBCAC7B16, 0xBCC47B16, 0xBCDC6B16, 0xBCEE7B16, 0xBD067B16, 0xBD1E7B16, 0xBD367B16 +.word 0xBD4E8B16, 0xBD665B16, 0xBD786B16, 0xBD8A8B16, 0xBDA27B16, 0xBDBA7B16, 0xBDD27B16, 0xBDEA6B16 +.word 0xBDFC8B16, 0xBE147C16, 0xBE2E7B16, 0xBE466B16, 0xBE587B16, 0xBE707B16, 0xBE887B16, 0xBEA08B16 +.word 0xBEB87B16, 0xBED07B16, 0xBEE87B16, 0xBF003D18, 0xBF0E8D16, 0xBF2A3D18, 0xBF387114, 0xBF3CA0FA +.word 0xBF3F6F1A, 0xBF577810, 0xBF69AB16, 0xBF878810, 0xBF997B16, 0xBFB17810, 0xBFC36B16, 0xBFD58910 +.word 0xBFE97B16, 0xC0015B16, 0xC0134C16, 0xC0208B16, 0xC0384B16, 0xC0447810, 0xC0567810, 0xC0686810 +.word 0xC0767910, 0xC08A7910, 0xC09E6810, 0xC0AC6810, 0xC0BA5A14, 0xC0CB7810, 0xC0DD7810, 0xC0EF8810 +.word 0xC1018810, 0xC1137910, 0xC1276810, 0xC1354D18, 0xC1432D18, 0xC14A4D18, 0xC1585116, 0xC15B6F1C +.word 0xC2276F16, 0xC23F6F16, 0xC1738A16, 0xC189AB16, 0xC2576F16, 0xC1A7C914, 0xC1C52D16, 0xC1CC6A16 +.word 0xC1DD6116, 0xC26F6F16, 0xC2876F16, 0xC1E07D18, 0xC1FCC40C, 0xC20B7D18, 0xC29F6F16, 0xC2B76F16 +.word 0xC2CF4318, 0xC2D3A914, 0xC2ECA912, 0xC305AB16, 0xC4126F18, 0xC323A910, 0xC33C8914, 0xC350430E +.word 0xC3543404, 0xC359DB14, 0xC383A016, 0xC386DB16, 0xC3B0ED18, 0xC3E1ED18, 0xC42A6F18, 0xC4426F18 +.word 0xC45AA20E, 0xC4624306, 0xC4666D18, 0xC47BA810, 0xC4925A18, 0xC4A35A12, 0xC4B46A18, 0xC4C57A12 +.word 0xC4DB5D18, 0xC4F05D18, 0xC5055D18, 0xC51A6D18, 0xC52FD914, 0xC552D914, 0xC575B914, 0xC593E510 +.word 0xC5A8F50E, 0xC5C07D16, 0xC5DC6D16, 0xC5F1EB14, 0xC61BEB14, 0xC645D912, 0xC668D912, 0xC68BAD16 +.word 0xC6AEAD16, 0xC6D1FA14, 0xC6FD9C16, 0xC71E6F16, 0xC7366F16, 0xC74E6F16, 0xC7666F16, 0xC77E6F16 +.word 0xC796E612, 0xC7AFA810, 0xC7C65118, 0xC7C96318, 0xC7CF3418, 0xC7D44810, 0xC7DDD30E, 0xC7EBA30E +.word 0xC7F55D18, 0xC80AC20E, 0xC8138B16, 0xC82BB912, 0xC8496F1A, 0xC8616F1A, 0xC8796F1A, 0xC8916F1A +.word 0xC8A90F17, 0xC8E9960E, 0xC8FB7810, 0xC90D960E, 0xC91F7810, 0xC9319E14, 0xC957F810, 0xC97B9E16 +.word 0xC9A1F810, 0xC9C5CC14, 0xC9ECDC16, 0xCA1ADC14, 0xCA48DC14, 0xCA76EF16, 0xCAAE070F, 0xCACE070F +.word 0xCAEE8F16, 0xCB0EED14, 0xCB3FED14, 0xCB70ED14, 0xCBA1EF16, 0xCBD9CB12, 0xCBFDCB12, 0xCC21CB12 +ENDDATA(asc2tbl) diff --git a/src/libleo/api/getaadr2.s b/src/libleo/api/getaadr2.s new file mode 100644 index 0000000000..e3ea0868bb --- /dev/null +++ b/src/libleo/api/getaadr2.s @@ -0,0 +1,33 @@ +#include "ultra64/asm.h" + +.set noat +.set noreorder + +.section .text + +.balign 16 + +LEAF(LeoGetAAdr2) + li $at, 0x10000 + srl $t8, $a0, 0xF + ori $at, $at, 0xFFFE + and $v1, $t8, $at + li $at, 0x70000 + ori $at, $at, 0xEE80 + srl $t2, $a0, 0x8 + add $v0, $v1, $at + andi $t3, $t2, 0xF + andi $t5, $a0, 0xFE + addi $t4, $t3, 1 + sll $t6, $t5, 0x18 + andi $t9, $a0, 0x1 + srl $v1, $a0, 0xC + sw $t4, ($a2) + sra $t7, $t6, 0x19 + sll $t8, $t9, 0x4 + andi $t1, $v1, 0xF + sw $t7, ($a3) + or $t2, $t1, $t8 + jr $ra + sw $t2, ($a1) +END(LeoGetAAdr2) diff --git a/src/libleo/api/getkadr.s b/src/libleo/api/getkadr.s new file mode 100644 index 0000000000..22d85cb593 --- /dev/null +++ b/src/libleo/api/getkadr.s @@ -0,0 +1,229 @@ +#include "ultra64/asm.h" + +.set noat +.set noreorder + +.section .text + +.balign 16 + +/** + * int LeoGetKAdr(int sjis); + * + * Returns the storage offset address into the N64 Disk Drive mask ROM for + * a kanji character corresponding to a given 2-byte Shift-JIS codepoint. + * An error value -1 will be returned if `sjis` is outside the range 0x8140 to 0x9872. + * + * A nice Shift-JIS codepoint table: https://uic.io/en/charset/show/shift_jis/ + * The Mask ROM contains the 'Level 1' kanji (0x889F-0x9872), and a reworked + * version of the non-kanji section that includes extra English and Hylian glyphs. + * + * @param sjis Shift-JIS Codepoint of glyph. + * @return int Storage offset address into the N64 Disk Drive mask ROM. + */ +LEAF(LeoGetKAdr) + // Check if the codepoint is in the range 0x8140 to 0x9872. + li $at, 0x8140 + slt $at, $a0, $at + bnez $at, .out_of_range + li $at, 0x9873 + slt $at, $a0, $at + beqz $at, .out_of_range + // Characters with codepoints >= 0x8800 are kanji. Arrangement is regular, + // so convert index directly. + li $at, 0x8800 + slt $at, $a0, $at + bnez $at, .nonkanji + // 0xBC is number of glyphs in one block in the `kanji` file: + // 0x100 possible codepoints with the same byte1 + // - 0x40 unused at beginning + // - 1 unused at 0x7F + // - 3 unused at 0xFD, 0xFE, 0xFF + li $a2, 0xBC + // Get byte1 and adjust so starts at 0 + srl $a1, $a0, 8 + addi $a1, $a1, -0x88 + multu $a2, $a1 + // Get byte2 and adjust so starts at 0 + andi $a3, $a0, 0xFF + addi $a3, $a3, -0x40 + slti $at, $a3, (0x80 - 0x40) + mflo $a2 + // 0x__7F is always empty and elided in the file, so decrement if larger + bnezl $at, .kanji_lower_halfblock + mflo $a2 + addi $a3, $a3, -1 + mflo $a2 +.kanji_lower_halfblock: + addi $a3, $a3, 0x30A + add $a3, $a3, $a2 + jr $ra + sll $v0, $a3, 7 + // returns (0x30A + (adjusted byte2) + (adjusted byte1) * 0xBC) * FONT_CHAR_TEX_SIZE + +// Non-kanji are arranged with irregular gaps, use the lookup table. +.nonkanji: + // Get byte1 and adjust so starts at 0 + srl $a1, $a0, 8 + addi $a1, $a1, -0x81 + multu $a2, $a1 + // Get byte2 and adjust so starts at 0 + andi $a3, $a0, 0xFF + addi $a3, $a3, -0x40 + slti $at, $a3, (0x80 - 0x40) + mflo $a2 + // 0x__7F is always empty and elided in the file, so decrement if larger + bnezl $at, .nonkanji_lower_halfblock + mflo $a2 + addi $a3, $a3, -1 + mflo $a2 +.nonkanji_lower_halfblock: + add $a3, $a3, $a2 + lui $a2, %hi(kantbl) + sll $a3, $a3, 1 + addiu $a2, %lo(kantbl) + add $a3, $a3, $a2 + lh $a2, ($a3) + jr $ra + sll $v0, $a2, 7 + // returns kantbl[(adjusted byte2) + (adjusted byte1) * 0xBC] * FONT_CHAR_TEX_SIZE +.out_of_range: + jr $ra + li $v0, -1 +END(LeoGetKAdr) + +/** + * Nearly equivalent C code (Equivalent for all valid input, will behave differently on overflow due to the use of `add` in the original): + * + * extern u16 kantbl[]; + * + * int LeoGetKAdr(int sjis) { + * u32 byte1; + * u32 byte2; + * + * if (sjis < 0x8140 || sjis > 0x9872) { + * return -1; + * } + * + * byte1 = (u32)sjis >> 8; + * byte2 = sjis & 0xFF; + * + * byte2 -= 0x40; + * if (byte2 >= 0x40) { + * byte2--; + * } + * + * if (sjis >= 0x8800) { + * byte1 -= 0x88; + * return (0x30A + byte2 + byte1 * 0xBC) * FONT_CHAR_TEX_SIZE; + * } else { + * byte1 -= 0x81; + * return kantbl[byte2 + byte1 * 0xBC] * FONT_CHAR_TEX_SIZE; + * } + * } + */ + +/** + * Index table, formatting follows conventional Shift-JIS character table layout, + * with space for the missing 0x__7F,0x__FD,0x__FE,0x__FF entries, and split + * into blocks by high byte. + */ +DATA(kantbl) +// 0x___0 0x___1 0x___2 0x___3 0x___4 0x___5 0x___6 0x___7 0x___8 0x___9 0x___A 0x___B 0x___C 0x___D 0x___E 0x___F +/* 0x814_ */ .half 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F +/* 0x815_ */ .half 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F +/* 0x816_ */ .half 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F +/* 0x817_ */ .half 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E +/* 0x818_ */ .half 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E +/* 0x819_ */ .half 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E +/* 0x81A_ */ .half 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x0000, 0x0000, 0x0000 +/* 0x81B_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073 +/* 0x81C_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x0000 +/* 0x81D_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F +/* 0x81E_ */ .half 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x81F_ */ .half 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0000, 0x0000, 0x0000, 0x0000, 0x0091 + +// 0x___0 0x___1 0x___2 0x___3 0x___4 0x___5 0x___6 0x___7 0x___8 0x___9 0x___A 0x___B 0x___C 0x___D 0x___E 0x___F +/* 0x824_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0092 +/* 0x825_ */ .half 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x826_ */ .half 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB +/* 0x827_ */ .half 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x828_ */ .half 0x0000, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4 +/* 0x829_ */ .half 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x0000, 0x0000, 0x0000, 0x0000, 0x00D0 +/* 0x82A_ */ .half 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0 +/* 0x82B_ */ .half 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0 +/* 0x82C_ */ .half 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, 0x0100 +/* 0x82D_ */ .half 0x0101, 0x0102, 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x0108, 0x0109, 0x010A, 0x010B, 0x010C, 0x010D, 0x010E, 0x010F, 0x0110 +/* 0x82E_ */ .half 0x0111, 0x0112, 0x0113, 0x0114, 0x0115, 0x0116, 0x0117, 0x0118, 0x0119, 0x011A, 0x011B, 0x011C, 0x011D, 0x011E, 0x011F, 0x0120 +/* 0x82F_ */ .half 0x0121, 0x0122, 0x0123, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 + +// 0x___0 0x___1 0x___2 0x___3 0x___4 0x___5 0x___6 0x___7 0x___8 0x___9 0x___A 0x___B 0x___C 0x___D 0x___E 0x___F +/* 0x834_ */ .half 0x0124, 0x0125, 0x0126, 0x0127, 0x0128, 0x0129, 0x012A, 0x012B, 0x012C, 0x012D, 0x012E, 0x012F, 0x0130, 0x0131, 0x0132, 0x0133 +/* 0x835_ */ .half 0x0134, 0x0135, 0x0136, 0x0137, 0x0138, 0x0139, 0x013A, 0x013B, 0x013C, 0x013D, 0x013E, 0x013F, 0x0140, 0x0141, 0x0142, 0x0143 +/* 0x836_ */ .half 0x0144, 0x0145, 0x0146, 0x0147, 0x0148, 0x0149, 0x014A, 0x014B, 0x014C, 0x014D, 0x014E, 0x014F, 0x0150, 0x0151, 0x0152, 0x0153 +/* 0x837_ */ .half 0x0154, 0x0155, 0x0156, 0x0157, 0x0158, 0x0159, 0x015A, 0x015B, 0x015C, 0x015D, 0x015E, 0x015F, 0x0160, 0x0161, 0x0162 +/* 0x838_ */ .half 0x0163, 0x0164, 0x0165, 0x0166, 0x0167, 0x0168, 0x0169, 0x016A, 0x016B, 0x016C, 0x016D, 0x016E, 0x016F, 0x0170, 0x0171, 0x0172 +/* 0x839_ */ .half 0x0173, 0x0174, 0x0175, 0x0176, 0x0177, 0x0178, 0x0179, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x017A +/* 0x83A_ */ .half 0x017B, 0x017C, 0x017D, 0x017E, 0x017F, 0x0180, 0x0181, 0x0182, 0x0183, 0x0184, 0x0185, 0x0186, 0x0187, 0x0188, 0x0189, 0x018A +/* 0x83B_ */ .half 0x018B, 0x018C, 0x018D, 0x018E, 0x018F, 0x0190, 0x0191, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0192 +/* 0x83C_ */ .half 0x0193, 0x0194, 0x0195, 0x0196, 0x0197, 0x0198, 0x0199, 0x019A, 0x019B, 0x019C, 0x019D, 0x019E, 0x019F, 0x01A0, 0x01A1, 0x01A2 +/* 0x83D_ */ .half 0x01A3, 0x01A4, 0x01A5, 0x01A6, 0x01A7, 0x01A8, 0x01A9, 0x01AA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x83E_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x83F_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 + +// 0x___0 0x___1 0x___2 0x___3 0x___4 0x___5 0x___6 0x___7 0x___8 0x___9 0x___A 0x___B 0x___C 0x___D 0x___E 0x___F +/* 0x844_ */ .half 0x01AB, 0x01AC, 0x01AD, 0x01AE, 0x01AF, 0x01B0, 0x01B1, 0x01B2, 0x01B3, 0x01B4, 0x01B5, 0x01B6, 0x01B7, 0x01B8, 0x01B9, 0x01BA +/* 0x845_ */ .half 0x01BB, 0x01BC, 0x01BD, 0x01BE, 0x01BF, 0x01C0, 0x01C1, 0x01C2, 0x01C3, 0x01C4, 0x01C5, 0x01C6, 0x01C7, 0x01C8, 0x01C9, 0x01CA +/* 0x846_ */ .half 0x01CB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x847_ */ .half 0x01CC, 0x01CD, 0x01CE, 0x01CF, 0x01D0, 0x01D1, 0x01D2, 0x01D3, 0x01D4, 0x01D5, 0x01D6, 0x01D7, 0x01D8, 0x01D9, 0x01DA +/* 0x848_ */ .half 0x01DB, 0x01DC, 0x01DD, 0x01DE, 0x01DF, 0x01E0, 0x01E1, 0x01E2, 0x01E3, 0x01E4, 0x01E5, 0x01E6, 0x01E7, 0x01E8, 0x01E9, 0x01EA +/* 0x849_ */ .half 0x01EB, 0x01EC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x01ED +/* 0x84A_ */ .half 0x01EE, 0x01EF, 0x01F0, 0x01F1, 0x01F2, 0x01F3, 0x01F4, 0x01F5, 0x01F6, 0x01F7, 0x01F8, 0x01F9, 0x01FA, 0x01FB, 0x01FC, 0x01FD +/* 0x84B_ */ .half 0x01FE, 0x01FF, 0x0200, 0x0201, 0x0202, 0x0203, 0x0204, 0x0205, 0x0206, 0x0207, 0x0208, 0x0209, 0x020A, 0x020B, 0x020C, 0x020D +/* 0x84C_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x84D_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x84E_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x84F_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 + +// 0x___0 0x___1 0x___2 0x___3 0x___4 0x___5 0x___6 0x___7 0x___8 0x___9 0x___A 0x___B 0x___C 0x___D 0x___E 0x___F +/* 0x854_ */ .half 0x020E, 0x020F, 0x0210, 0x0211, 0x0212, 0x0213, 0x0214, 0x0215, 0x0216, 0x0217, 0x0218, 0x0219, 0x021A, 0x021B, 0x021C, 0x021D +/* 0x855_ */ .half 0x021E, 0x021F, 0x0220, 0x0221, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0222, 0x0223 +/* 0x856_ */ .half 0x0224, 0x0225, 0x0226, 0x0227, 0x0228, 0x0229, 0x022A, 0x022B, 0x022C, 0x022D, 0x022E, 0x022F, 0x0230, 0x0231, 0x0232, 0x0233 +/* 0x857_ */ .half 0x0234, 0x0235, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0236, 0x0237, 0x0238 +/* 0x858_ */ .half 0x0239, 0x023A, 0x023B, 0x023C, 0x023D, 0x023E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x859_ */ .half 0x0000, 0x023F, 0x0240, 0x0241, 0x0242, 0x0243, 0x0244, 0x0245, 0x0246, 0x0247, 0x0248, 0x0000, 0x0000, 0x0000, 0x0000, 0x0249 +/* 0x85A_ */ .half 0x024A, 0x024B, 0x024C, 0x024D, 0x024E, 0x024F, 0x0250, 0x0251, 0x0252, 0x0253, 0x0254, 0x0255, 0x0256, 0x0257, 0x0000, 0x0000 +/* 0x85B_ */ .half 0x0000, 0x0000, 0x0000, 0x0258, 0x0259, 0x025A, 0x025B, 0x025C, 0x025D, 0x025E, 0x025F, 0x0260, 0x0261, 0x0262, 0x0263, 0x0264 +/* 0x85C_ */ .half 0x0265, 0x0266, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x85D_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0267, 0x0268, 0x0269, 0x026A, 0x026B +/* 0x85E_ */ .half 0x026C, 0x026D, 0x026E, 0x026F, 0x0270, 0x0271, 0x0272, 0x0273, 0x0274, 0x0275, 0x0276, 0x0277, 0x0278, 0x0279, 0x027A, 0x027B +/* 0x85F_ */ .half 0x027C, 0x027D, 0x027E, 0x027F, 0x0280, 0x0281, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 + +// 0x___0 0x___1 0x___2 0x___3 0x___4 0x___5 0x___6 0x___7 0x___8 0x___9 0x___A 0x___B 0x___C 0x___D 0x___E 0x___F +/* 0x864_ */ .half 0x0282, 0x0283, 0x0284, 0x0285, 0x0286, 0x0287, 0x0288, 0x0289, 0x028A, 0x028B, 0x028C, 0x028D, 0x028E, 0x028F, 0x0290, 0x0291 +/* 0x865_ */ .half 0x0292, 0x0293, 0x0294, 0x0295, 0x0296, 0x0297, 0x0298, 0x0299, 0x029A, 0x029B, 0x029C, 0x029D, 0x029E, 0x029F, 0x0000, 0x0000 +/* 0x866_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x867_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x868_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x869_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x02A0, 0x02A1, 0x02A2, 0x02A3, 0x02A4 +/* 0x86A_ */ .half 0x02A5, 0x02A6, 0x02A7, 0x02A8, 0x02A9, 0x02AA, 0x02AB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x86B_ */ .half 0x0000, 0x0000, 0x0000, 0x02AC, 0x02AD, 0x02AE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x86C_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x02AF, 0x02B0, 0x02B1, 0x02B2, 0x02B3, 0x02B4, 0x02B5, 0x02B6, 0x02B7 +/* 0x86D_ */ .half 0x02B8, 0x02B9, 0x02BA, 0x02BB, 0x02BC, 0x02BD, 0x02BE, 0x02BF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x86E_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x86F_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 + +// 0x___0 0x___1 0x___2 0x___3 0x___4 0x___5 0x___6 0x___7 0x___8 0x___9 0x___A 0x___B 0x___C 0x___D 0x___E 0x___F +/* 0x874_ */ .half 0x02C0, 0x02C1, 0x02C2, 0x02C3, 0x02C4, 0x02C5, 0x02C6, 0x02C7, 0x02C8, 0x02C9, 0x02CA, 0x02CB, 0x02CC, 0x02CD, 0x02CE, 0x02CF +/* 0x875_ */ .half 0x02D0, 0x02D1, 0x02D2, 0x02D3, 0x02D4, 0x02D5, 0x02D6, 0x02D7, 0x02D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x876_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x877_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x878_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x879_ */ .half 0x0000, 0x02D9, 0x02DA, 0x02DB, 0x02DC, 0x02DD, 0x02DE, 0x02DF, 0x02E0, 0x02E1, 0x02E2, 0x02E3, 0x02E4, 0x02E5, 0x02E6, 0x02E7 +/* 0x87A_ */ .half 0x02E8, 0x02E9, 0x02EA, 0x02EB, 0x02EC, 0x02ED, 0x02EE, 0x02EF, 0x02F0, 0x02F1, 0x02F2, 0x02F3, 0x02F4, 0x02F5, 0x02F6, 0x02F7 +/* 0x87B_ */ .half 0x02F8, 0x02F9, 0x02FA, 0x02FB, 0x02FC, 0x02FD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x02FE, 0x02FF, 0x0300 +/* 0x87C_ */ .half 0x0301, 0x0302, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x87D_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x87E_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0303, 0x0304, 0x0305, 0x0306, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +/* 0x87F_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0307, 0x0308, 0x0309 +ENDDATA(kantbl) diff --git a/src/libleo/api/lbatobyte.c b/src/libleo/api/lbatobyte.c new file mode 100644 index 0000000000..dc5b1f5dbe --- /dev/null +++ b/src/libleo/api/lbatobyte.c @@ -0,0 +1,40 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +s32 LeoLBAToByte(s32 startlba, u32 nlbas, s32* bytes) { + u32 resbytes; + u32 byte_p_blk; + u16 zone; + u16 vzone; + u8 flag; + + if (!__leoActive) { + return -1; + } + + resbytes = 0; + flag = vzone = 1; + startlba += 0x18; + while (nlbas > 0) { + if ((flag != 0) || (LEOVZONE_TBL[LEOdisk_type][vzone] == startlba)) { + vzone = leoLba_to_vzone(startlba); + zone = LEOVZONE_PZONEHD_TBL[LEOdisk_type][vzone]; + if (zone >= 8) { + zone -= 7; + } + byte_p_blk = LEOBYTE_TBL2[zone]; + } + resbytes += byte_p_blk; + nlbas--; + startlba++; + if ((nlbas > 0) && ((u32)startlba >= NUM_LBAS + 0x18)) { + return LEO_ERROR_LBA_OUT_OF_RANGE; + } + flag = 0; + } + + *bytes = resbytes; + return LEO_ERROR_GOOD; +} diff --git a/src/libleo/api/readwrite.c b/src/libleo/api/readwrite.c new file mode 100644 index 0000000000..a4c27d26f9 --- /dev/null +++ b/src/libleo/api/readwrite.c @@ -0,0 +1,33 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +s32 LeoReadWrite(LEOCmd* cmdBlock, s32 direction, u32 LBA, void* vAddr, u32 nLBAs, OSMesgQueue* mq) { + if (!__leoActive) { + return -1; + } + + if (direction == OS_READ) { + cmdBlock->header.command = 5; + } else { + cmdBlock->header.command = 6; + } + + cmdBlock->header.reserve1 = 0; + + if (mq != NULL) { + cmdBlock->header.control = 0x80; + } else { + cmdBlock->header.control = 0; + } + + cmdBlock->header.reserve3 = 0; + cmdBlock->header.post = mq; + cmdBlock->data.readWrite.lba = LBA; + cmdBlock->data.readWrite.transferBlks = nLBAs; + cmdBlock->data.readWrite.buffPtr = vAddr; + + leoCommand(cmdBlock); + return LEO_ERROR_GOOD; +} diff --git a/src/libleo/api/seek.c b/src/libleo/api/seek.c new file mode 100644 index 0000000000..dbbc4651ac --- /dev/null +++ b/src/libleo/api/seek.c @@ -0,0 +1,24 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +s32 LeoSeek(LEOCmd* cmdBlock, u32 lba, OSMesgQueue* mq) { + if (!__leoActive) { + return -1; + } + + cmdBlock->header.command = LEO_COMMAND_READ_DISK_ID; + cmdBlock->header.reserve1 = 0; + cmdBlock->header.control = 0; + cmdBlock->header.reserve3 = 0; + cmdBlock->data.readWrite.lba = lba; + + if (mq != NULL) { + cmdBlock->header.control |= LEO_CONTROL_POST; + cmdBlock->header.post = mq; + } + + leoCommand(cmdBlock); + return LEO_ERROR_GOOD; +} diff --git a/src/libleo/api/spdlmotor.c b/src/libleo/api/spdlmotor.c new file mode 100644 index 0000000000..8c0ffa9ffa --- /dev/null +++ b/src/libleo/api/spdlmotor.c @@ -0,0 +1,38 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +s32 LeoSpdlMotor(LEOCmd* cmdBlock, u8 mode, OSMesgQueue* mq) { + if (!__leoActive) { + return -1; + } + + cmdBlock->header.command = 8; + cmdBlock->header.reserve1 = 0; + + switch (mode) { + case LEO_MOTOR_ACTIVE: + cmdBlock->header.control = 1; + break; + case LEO_MOTOR_STANDBY: + cmdBlock->header.control = 2; + break; + case LEO_MOTOR_SLEEP: + cmdBlock->header.control = 0; + break; + case LEO_MOTOR_BRAKE: + cmdBlock->header.control = 4; + break; + } + + cmdBlock->header.reserve3 = 0; + + if (mq != NULL) { + cmdBlock->header.post = mq; + cmdBlock->header.control |= 0x80; + } + + leoCommand(cmdBlock); + return LEO_ERROR_GOOD; +} diff --git a/src/libleo/api/testunitready.c b/src/libleo/api/testunitready.c new file mode 100644 index 0000000000..f5770f86b7 --- /dev/null +++ b/src/libleo/api/testunitready.c @@ -0,0 +1,28 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +s32 LeoTestUnitReady(u8* status) { + volatile LEOCmdTestUnitReady cmdBlock; + + if (!__leoActive) { + return -1; + } + + if (IO_READ(PI_STATUS_REG) & PI_STATUS_DMA_BUSY) { + return LEO_ERROR_BUSY; + } + + cmdBlock.header.command = 3; + cmdBlock.header.reserve1 = 0; + cmdBlock.header.control = 0; + cmdBlock.header.reserve3 = 0; + + leoCommand((void*)&cmdBlock); + + while (cmdBlock.header.status == 8) {} + + *status = cmdBlock.test; + return GET_ERROR(cmdBlock); +} diff --git a/src/libleo/leo/leo_tbl.c b/src/libleo/leo/leo_tbl.c new file mode 100644 index 0000000000..f4093fbd53 --- /dev/null +++ b/src/libleo/leo/leo_tbl.c @@ -0,0 +1,58 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +const char LEOfirmware_rev[] = "B014A26"; + +const u8 LEOBYTE_TBL1[] = { + 0xE8, 0xD8, 0xD0, 0xC0, 0xB0, 0xA0, 0x90, 0x80, 0x70, +}; + +const u16 LEOBYTE_TBL2[] = { + 0x4D08, 0x47B8, 0x4510, 0x3FC0, 0x3A70, 0x3520, 0x2FD0, 0x2A80, 0x2530, +}; + +const u16 LEOVZONE_TBL[][0x10] = { + { 0x0124, 0x0248, 0x035A, 0x047E, 0x05A2, 0x06B4, 0x07C6, 0x08D8, 0x09EA, 0x0AB6, 0x0B82, 0x0C94, 0x0DA6, 0x0EB8, + 0x0FCA, 0x10DC }, + { 0x0124, 0x0248, 0x035A, 0x046C, 0x057E, 0x06A2, 0x07C6, 0x08D8, 0x09EA, 0x0AFC, 0x0BC8, 0x0C94, 0x0DA6, 0x0EB8, + 0x0FCA, 0x10DC }, + { 0x0124, 0x0248, 0x035A, 0x046C, 0x057E, 0x0690, 0x07A2, 0x08C6, 0x09EA, 0x0AFC, 0x0C0E, 0x0CDA, 0x0DA6, 0x0EB8, + 0x0FCA, 0x10DC }, + { 0x0124, 0x0248, 0x035A, 0x046C, 0x057E, 0x0690, 0x07A2, 0x08B4, 0x09C6, 0x0AEA, 0x0C0E, 0x0D20, 0x0DEC, 0x0EB8, + 0x0FCA, 0x10DC }, + { 0x0124, 0x0248, 0x035A, 0x046C, 0x057E, 0x0690, 0x07A2, 0x08B4, 0x09C6, 0x0AD8, 0x0BEA, 0x0D0E, 0x0E32, 0x0EFE, + 0x0FCA, 0x10DC }, + { 0x0124, 0x0248, 0x035A, 0x046C, 0x057E, 0x0690, 0x07A2, 0x086E, 0x0980, 0x0A92, 0x0BA4, 0x0CB6, 0x0DC8, 0x0EEC, + 0x1010, 0x10DC }, + { 0x0124, 0x0248, 0x035A, 0x046C, 0x057E, 0x0690, 0x07A2, 0x086E, 0x093A, 0x0A4C, 0x0B5E, 0x0C70, 0x0D82, 0x0E94, + 0x0FB8, 0x10DC }, +}; + +const u16 LEOZONE_SCYL_TBL[] = { + 0x0000, 0x009E, 0x013C, 0x01D1, 0x0266, 0x02FB, 0x0390, 0x0425, + 0x0091, 0x012F, 0x01C4, 0x0259, 0x02EE, 0x0383, 0x0418, 0x048A, +}; + +const u8 LEOVZONE_PZONEHD_TBL[][0x10] = { + { 0x00, 0x01, 0x02, 0x09, 0x08, 0x03, 0x04, 0x05, 0x06, 0x07, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A }, + { 0x00, 0x01, 0x02, 0x03, 0x0A, 0x09, 0x08, 0x04, 0x05, 0x06, 0x07, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B }, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x0B, 0x0A, 0x09, 0x08, 0x05, 0x06, 0x07, 0x0F, 0x0E, 0x0D, 0x0C }, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x06, 0x07, 0x0F, 0x0E, 0x0D }, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x0F, 0x0E }, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x0F }, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08 }, +}; + +const u16 LEOZONE_OUTERCYL_TBL[] = { + 0x0000, 0x009E, 0x013C, 0x01D1, 0x0266, 0x02FB, 0x0390, 0x0425, +}; + +const u16 LEORAM_START_LBA[] = { + 0x05A2, 0x07C6, 0x09EA, 0x0C0E, 0x0E32, 0x1010, 0x10DC, +}; + +const s32 LEORAM_BYTE[] = { + 0x024A9DC0, 0x01C226C0, 0x01450F00, 0x00D35680, 0x006CFD40, 0x001DA240, 0x00000000, +}; diff --git a/src/libleo/leo/leoc2_syndrome.c b/src/libleo/leo/leoc2_syndrome.c new file mode 100644 index 0000000000..fe72a3e89e --- /dev/null +++ b/src/libleo/leo/leoc2_syndrome.c @@ -0,0 +1,3 @@ +#include "n64dd.h" + +u8 LEOC2_Syndrome[2][0xE8 * 4]; diff --git a/src/libleo/leo/leoc2ecc.c b/src/libleo/leo/leoc2ecc.c new file mode 100644 index 0000000000..4d268df51b --- /dev/null +++ b/src/libleo/leo/leoc2ecc.c @@ -0,0 +1,495 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +void leoC2_single_ecc(void); +void leoC2_double_ecc(void); +void leoC2_3_ecc(void); +void leoC2_4_ecc(void); +int leoAlpha_mult(int i, int k); +int leoAlpha_div(int i, int k); + +extern u8 LEO_TempBuffer[0xE8]; + +const u8 ganlog[512] = { + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1D, 0x3A, 0x74, 0xE8, 0xCD, 0x87, 0x13, 0x26, 0x4C, 0x98, 0x2D, + 0x5A, 0xB4, 0x75, 0xEA, 0xC9, 0x8F, 0x03, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x9D, 0x27, 0x4E, 0x9C, 0x25, 0x4A, + 0x94, 0x35, 0x6A, 0xD4, 0xB5, 0x77, 0xEE, 0xC1, 0x9F, 0x23, 0x46, 0x8C, 0x05, 0x0A, 0x14, 0x28, 0x50, 0xA0, 0x5D, + 0xBA, 0x69, 0xD2, 0xB9, 0x6F, 0xDE, 0xA1, 0x5F, 0xBE, 0x61, 0xC2, 0x99, 0x2F, 0x5E, 0xBC, 0x65, 0xCA, 0x89, 0x0F, + 0x1E, 0x3C, 0x78, 0xF0, 0xFD, 0xE7, 0xD3, 0xBB, 0x6B, 0xD6, 0xB1, 0x7F, 0xFE, 0xE1, 0xDF, 0xA3, 0x5B, 0xB6, 0x71, + 0xE2, 0xD9, 0xAF, 0x43, 0x86, 0x11, 0x22, 0x44, 0x88, 0x0D, 0x1A, 0x34, 0x68, 0xD0, 0xBD, 0x67, 0xCE, 0x81, 0x1F, + 0x3E, 0x7C, 0xF8, 0xED, 0xC7, 0x93, 0x3B, 0x76, 0xEC, 0xC5, 0x97, 0x33, 0x66, 0xCC, 0x85, 0x17, 0x2E, 0x5C, 0xB8, + 0x6D, 0xDA, 0xA9, 0x4F, 0x9E, 0x21, 0x42, 0x84, 0x15, 0x2A, 0x54, 0xA8, 0x4D, 0x9A, 0x29, 0x52, 0xA4, 0x55, 0xAA, + 0x49, 0x92, 0x39, 0x72, 0xE4, 0xD5, 0xB7, 0x73, 0xE6, 0xD1, 0xBF, 0x63, 0xC6, 0x91, 0x3F, 0x7E, 0xFC, 0xE5, 0xD7, + 0xB3, 0x7B, 0xF6, 0xF1, 0xFF, 0xE3, 0xDB, 0xAB, 0x4B, 0x96, 0x31, 0x62, 0xC4, 0x95, 0x37, 0x6E, 0xDC, 0xA5, 0x57, + 0xAE, 0x41, 0x82, 0x19, 0x32, 0x64, 0xC8, 0x8D, 0x07, 0x0E, 0x1C, 0x38, 0x70, 0xE0, 0xDD, 0xA7, 0x53, 0xA6, 0x51, + 0xA2, 0x59, 0xB2, 0x79, 0xF2, 0xF9, 0xEF, 0xC3, 0x9B, 0x2B, 0x56, 0xAC, 0x45, 0x8A, 0x09, 0x12, 0x24, 0x48, 0x90, + 0x3D, 0x7A, 0xF4, 0xF5, 0xF7, 0xF3, 0xFB, 0xEB, 0xCB, 0x8B, 0x0B, 0x16, 0x2C, 0x58, 0xB0, 0x7D, 0xFA, 0xE9, 0xCF, + 0x83, 0x1B, 0x36, 0x6C, 0xD8, 0xAD, 0x47, 0x8E, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1D, 0x3A, 0x74, + 0xE8, 0xCD, 0x87, 0x13, 0x26, 0x4C, 0x98, 0x2D, 0x5A, 0xB4, 0x75, 0xEA, 0xC9, 0x8F, 0x03, 0x06, 0x0C, 0x18, 0x30, + 0x60, 0xC0, 0x9D, 0x27, 0x4E, 0x9C, 0x25, 0x4A, 0x94, 0x35, 0x6A, 0xD4, 0xB5, 0x77, 0xEE, 0xC1, 0x9F, 0x23, 0x46, + 0x8C, 0x05, 0x0A, 0x14, 0x28, 0x50, 0xA0, 0x5D, 0xBA, 0x69, 0xD2, 0xB9, 0x6F, 0xDE, 0xA1, 0x5F, 0xBE, 0x61, 0xC2, + 0x99, 0x2F, 0x5E, 0xBC, 0x65, 0xCA, 0x89, 0x0F, 0x1E, 0x3C, 0x78, 0xF0, 0xFD, 0xE7, 0xD3, 0xBB, 0x6B, 0xD6, 0xB1, + 0x7F, 0xFE, 0xE1, 0xDF, 0xA3, 0x5B, 0xB6, 0x71, 0xE2, 0xD9, 0xAF, 0x43, 0x86, 0x11, 0x22, 0x44, 0x88, 0x0D, 0x1A, + 0x34, 0x68, 0xD0, 0xBD, 0x67, 0xCE, 0x81, 0x1F, 0x3E, 0x7C, 0xF8, 0xED, 0xC7, 0x93, 0x3B, 0x76, 0xEC, 0xC5, 0x97, + 0x33, 0x66, 0xCC, 0x85, 0x17, 0x2E, 0x5C, 0xB8, 0x6D, 0xDA, 0xA9, 0x4F, 0x9E, 0x21, 0x42, 0x84, 0x15, 0x2A, 0x54, + 0xA8, 0x4D, 0x9A, 0x29, 0x52, 0xA4, 0x55, 0xAA, 0x49, 0x92, 0x39, 0x72, 0xE4, 0xD5, 0xB7, 0x73, 0xE6, 0xD1, 0xBF, + 0x63, 0xC6, 0x91, 0x3F, 0x7E, 0xFC, 0xE5, 0xD7, 0xB3, 0x7B, 0xF6, 0xF1, 0xFF, 0xE3, 0xDB, 0xAB, 0x4B, 0x96, 0x31, + 0x62, 0xC4, 0x95, 0x37, 0x6E, 0xDC, 0xA5, 0x57, 0xAE, 0x41, 0x82, 0x19, 0x32, 0x64, 0xC8, 0x8D, 0x07, 0x0E, 0x1C, + 0x38, 0x70, 0xE0, 0xDD, 0xA7, 0x53, 0xA6, 0x51, 0xA2, 0x59, 0xB2, 0x79, 0xF2, 0xF9, 0xEF, 0xC3, 0x9B, 0x2B, 0x56, + 0xAC, 0x45, 0x8A, 0x09, 0x12, 0x24, 0x48, 0x90, 0x3D, 0x7A, 0xF4, 0xF5, 0xF7, 0xF3, 0xFB, 0xEB, 0xCB, 0x8B, 0x0B, + 0x16, 0x2C, 0x58, 0xB0, 0x7D, 0xFA, 0xE9, 0xCF, 0x83, 0x1B, 0x36, 0x6C, 0xD8, 0xAD, 0x47, 0x8E, 0x01, 0x02 +}; + +const u8 glog[512] = { + 0x00, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1A, 0xC6, 0x03, 0xDF, 0x33, 0xEE, 0x1B, 0x68, 0xC7, 0x4B, 0x04, 0x64, 0xE0, + 0x0E, 0x34, 0x8D, 0xEF, 0x81, 0x1C, 0xC1, 0x69, 0xF8, 0xC8, 0x08, 0x4C, 0x71, 0x05, 0x8A, 0x65, 0x2F, 0xE1, 0x24, + 0x0F, 0x21, 0x35, 0x93, 0x8E, 0xDA, 0xF0, 0x12, 0x82, 0x45, 0x1D, 0xB5, 0xC2, 0x7D, 0x6A, 0x27, 0xF9, 0xB9, 0xC9, + 0x9A, 0x09, 0x78, 0x4D, 0xE4, 0x72, 0xA6, 0x06, 0xBF, 0x8B, 0x62, 0x66, 0xDD, 0x30, 0xFD, 0xE2, 0x98, 0x25, 0xB3, + 0x10, 0x91, 0x22, 0x88, 0x36, 0xD0, 0x94, 0xCE, 0x8F, 0x96, 0xDB, 0xBD, 0xF1, 0xD2, 0x13, 0x5C, 0x83, 0x38, 0x46, + 0x40, 0x1E, 0x42, 0xB6, 0xA3, 0xC3, 0x48, 0x7E, 0x6E, 0x6B, 0x3A, 0x28, 0x54, 0xFA, 0x85, 0xBA, 0x3D, 0xCA, 0x5E, + 0x9B, 0x9F, 0x0A, 0x15, 0x79, 0x2B, 0x4E, 0xD4, 0xE5, 0xAC, 0x73, 0xF3, 0xA7, 0x57, 0x07, 0x70, 0xC0, 0xF7, 0x8C, + 0x80, 0x63, 0x0D, 0x67, 0x4A, 0xDE, 0xED, 0x31, 0xC5, 0xFE, 0x18, 0xE3, 0xA5, 0x99, 0x77, 0x26, 0xB8, 0xB4, 0x7C, + 0x11, 0x44, 0x92, 0xD9, 0x23, 0x20, 0x89, 0x2E, 0x37, 0x3F, 0xD1, 0x5B, 0x95, 0xBC, 0xCF, 0xCD, 0x90, 0x87, 0x97, + 0xB2, 0xDC, 0xFC, 0xBE, 0x61, 0xF2, 0x56, 0xD3, 0xAB, 0x14, 0x2A, 0x5D, 0x9E, 0x84, 0x3C, 0x39, 0x53, 0x47, 0x6D, + 0x41, 0xA2, 0x1F, 0x2D, 0x43, 0xD8, 0xB7, 0x7B, 0xA4, 0x76, 0xC4, 0x17, 0x49, 0xEC, 0x7F, 0x0C, 0x6F, 0xF6, 0x6C, + 0xA1, 0x3B, 0x52, 0x29, 0x9D, 0x55, 0xAA, 0xFB, 0x60, 0x86, 0xB1, 0xBB, 0xCC, 0x3E, 0x5A, 0xCB, 0x59, 0x5F, 0xB0, + 0x9C, 0xA9, 0xA0, 0x51, 0x0B, 0xF5, 0x16, 0xEB, 0x7A, 0x75, 0x2C, 0xD7, 0x4F, 0xAE, 0xD5, 0xE9, 0xE6, 0xE7, 0xAD, + 0xE8, 0x74, 0xD6, 0xF4, 0xEA, 0xA8, 0x50, 0x58, 0xAF, 0xFF, 0x01, 0x19, 0x02, 0x32, 0x1A, 0xC6, 0x03, 0xDF, 0x33, + 0xEE, 0x1B, 0x68, 0xC7, 0x4B, 0x04, 0x64, 0xE0, 0x0E, 0x34, 0x8D, 0xEF, 0x81, 0x1C, 0xC1, 0x69, 0xF8, 0xC8, 0x08, + 0x4C, 0x71, 0x05, 0x8A, 0x65, 0x2F, 0xE1, 0x24, 0x0F, 0x21, 0x35, 0x93, 0x8E, 0xDA, 0xF0, 0x12, 0x82, 0x45, 0x1D, + 0xB5, 0xC2, 0x7D, 0x6A, 0x27, 0xF9, 0xB9, 0xC9, 0x9A, 0x09, 0x78, 0x4D, 0xE4, 0x72, 0xA6, 0x06, 0xBF, 0x8B, 0x62, + 0x66, 0xDD, 0x30, 0xFD, 0xE2, 0x98, 0x25, 0xB3, 0x10, 0x91, 0x22, 0x88, 0x36, 0xD0, 0x94, 0xCE, 0x8F, 0x96, 0xDB, + 0xBD, 0xF1, 0xD2, 0x13, 0x5C, 0x83, 0x38, 0x46, 0x40, 0x1E, 0x42, 0xB6, 0xA3, 0xC3, 0x48, 0x7E, 0x6E, 0x6B, 0x3A, + 0x28, 0x54, 0xFA, 0x85, 0xBA, 0x3D, 0xCA, 0x5E, 0x9B, 0x9F, 0x0A, 0x15, 0x79, 0x2B, 0x4E, 0xD4, 0xE5, 0xAC, 0x73, + 0xF3, 0xA7, 0x57, 0x07, 0x70, 0xC0, 0xF7, 0x8C, 0x80, 0x63, 0x0D, 0x67, 0x4A, 0xDE, 0xED, 0x31, 0xC5, 0xFE, 0x18, + 0xE3, 0xA5, 0x99, 0x77, 0x26, 0xB8, 0xB4, 0x7C, 0x11, 0x44, 0x92, 0xD9, 0x23, 0x20, 0x89, 0x2E, 0x37, 0x3F, 0xD1, + 0x5B, 0x95, 0xBC, 0xCF, 0xCD, 0x90, 0x87, 0x97, 0xB2, 0xDC, 0xFC, 0xBE, 0x61, 0xF2, 0x56, 0xD3, 0xAB, 0x14, 0x2A, + 0x5D, 0x9E, 0x84, 0x3C, 0x39, 0x53, 0x47, 0x6D, 0x41, 0xA2, 0x1F, 0x2D, 0x43, 0xD8, 0xB7, 0x7B, 0xA4, 0x76, 0xC4, + 0x17, 0x49, 0xEC, 0x7F, 0x0C, 0x6F, 0xF6, 0x6C, 0xA1, 0x3B, 0x52, 0x29, 0x9D, 0x55, 0xAA, 0xFB, 0x60, 0x86, 0xB1, + 0xBB, 0xCC, 0x3E, 0x5A, 0xCB, 0x59, 0x5F, 0xB0, 0x9C, 0xA9, 0xA0, 0x51, 0x0B, 0xF5, 0x16, 0xEB, 0x7A, 0x75, 0x2C, + 0xD7, 0x4F, 0xAE, 0xD5, 0xE9, 0xE6, 0xE7, 0xAD, 0xE8, 0x74, 0xD6, 0xF4, 0xEA, 0xA8, 0x50, 0x58, 0xAF, 0xFF +}; + +block_param_form LEOc2_param; + +int leoC2_Correction(void) { + switch (LEOc2_param.err_num) { + case 0: + break; + case 1: + leoC2_single_ecc(); + break; + case 2: + leoC2_double_ecc(); + break; + case 3: + leoC2_3_ecc(); + break; + case 4: + leoC2_4_ecc(); + break; + default: + return 0xFFFF; + } + return 0; +} + +// static +void leoC2_single_ecc(void) { + u8* pointer; + unsigned int byte; + u8* p_s; + + if (LEOc2_param.err_pos[0] < 0x55) { + byte = LEOc2_param.bytes; + pointer = &LEOc2_param.pntr[(LEOc2_param.err_pos[0] + 1) * byte]; + p_s = LEOc2_param.c2buff_e; + + do { + *(--pointer) ^= *(p_s -= 4); + } while (--byte != 0); + } +} + +// static +void leoC2_double_ecc(void) { + unsigned int s0; + unsigned int error_k; + u8* pointer1; + u8* pointer2; + unsigned int k; + unsigned int m; + unsigned int a; + unsigned int d; + unsigned int byte; + u8* p_s; + + k = 0x58 - LEOc2_param.err_pos[0]; + m = 0x58 - LEOc2_param.err_pos[1]; + d = ganlog[k] ^ ganlog[m]; + d = glog[leoAlpha_div(1, d)]; + byte = LEOc2_param.bytes; + + if (LEOc2_param.err_pos[1] < 0x55) { + goto c2_2_2; + } + pointer2 = &LEO_TempBuffer[sizeof(LEO_TempBuffer)]; + if (LEOc2_param.err_pos[0] < 0x55) { + goto c2_2_1; + } + return; + +c2_2_2: + pointer2 = &LEOc2_param.pntr[(LEOc2_param.err_pos[1] + 1) * byte]; +c2_2_1: + pointer1 = &LEOc2_param.pntr[(LEOc2_param.err_pos[0] + 1) * byte]; + p_s = LEOc2_param.c2buff_e; + + do { + p_s -= 4; + s0 = p_s[0]; + if (s0 != 0) { + a = ganlog[m + glog[s0]] ^ p_s[1]; + } else { + a = p_s[1]; + } + pointer1--; + pointer2--; + if (a != 0) { + error_k = ganlog[glog[a] + d]; + *pointer1 ^= error_k; + *pointer2 ^= error_k ^ s0; + } else { + *pointer2 ^= s0; + } + } while (--byte != 0); +} + +// static +void leoC2_3_ecc(void) { + unsigned int s0; + unsigned int error_i; + unsigned int error_j; + unsigned int error_k; + u8* pointer1; + u8* pointer2; + u8* pointer3; + unsigned int byte; + unsigned int ii; + unsigned int jj; + unsigned int kk; + unsigned int c; + unsigned int f; + unsigned int o; + unsigned int b; + unsigned int d; + unsigned int h; + unsigned int a; + unsigned int e; + unsigned int g; + unsigned int p; + u8* p_s; + + ii = 0x58 - LEOc2_param.err_pos[0]; + jj = 0x58 - LEOc2_param.err_pos[1]; + kk = 0x58 - LEOc2_param.err_pos[2]; + ii = ganlog[ii]; + jj = ganlog[jj]; + kk = ganlog[kk]; + c = leoAlpha_mult(kk, kk); + f = leoAlpha_mult(jj, jj); + o = leoAlpha_mult(ii, ii); + b = c ^ f; + d = c ^ o; + h = f ^ o; + a = leoAlpha_mult(jj, c) ^ leoAlpha_mult(kk, f); + e = leoAlpha_mult(kk, o) ^ leoAlpha_mult(ii, c); + g = leoAlpha_mult(jj, o) ^ leoAlpha_mult(ii, f); + c = jj ^ kk; + f = kk ^ ii; + o = ii ^ jj; + p = a ^ e ^ g; + p = leoAlpha_div(1, p); + a = glog[a]; + b = glog[b]; + c = glog[c]; + d = glog[d]; + e = glog[e]; + f = glog[f]; + g = glog[g]; + h = glog[h]; + o = glog[o]; + p = glog[p]; + byte = LEOc2_param.bytes; + if (LEOc2_param.err_pos[2] < 0x55) { + goto c2_3_3; + } + pointer3 = &LEO_TempBuffer[sizeof(LEO_TempBuffer)]; + if (LEOc2_param.err_pos[1] < 0x55) { + goto c2_3_2; + } + pointer2 = &LEO_TempBuffer[sizeof(LEO_TempBuffer)]; + if (LEOc2_param.err_pos[0] < 0x55) { + goto c2_3_1; + } + return; + +c2_3_3: + pointer3 = &LEOc2_param.pntr[(LEOc2_param.err_pos[2] + 1) * byte]; +c2_3_2: + pointer2 = &LEOc2_param.pntr[(LEOc2_param.err_pos[1] + 1) * byte]; +c2_3_1: + pointer1 = &LEOc2_param.pntr[(LEOc2_param.err_pos[0] + 1) * byte]; + p_s = LEOc2_param.c2buff_e; + + do { + p_s -= 4; + s0 = p_s[0]; + if (s0) { + s0 = glog[s0]; + error_i = ganlog[s0 + a]; + error_j = ganlog[s0 + e]; + error_k = ganlog[s0 + g]; + } else { + error_i = error_j = error_k = 0; + } + s0 = p_s[1]; + if (s0) { + s0 = glog[s0]; + error_i ^= ganlog[s0 + b]; + error_j ^= ganlog[s0 + d]; + error_k ^= ganlog[s0 + h]; + } + s0 = p_s[2]; + if (s0) { + s0 = glog[s0]; + error_i ^= ganlog[s0 + c]; + error_j ^= ganlog[s0 + f]; + error_k ^= ganlog[s0 + o]; + } + pointer1--; + pointer2--; + pointer3--; + if (error_i) { + *pointer1 ^= ganlog[glog[error_i] + p]; + } + if (error_j) { + *pointer2 ^= ganlog[glog[error_j] + p]; + } + if (error_k) { + *pointer3 ^= ganlog[glog[error_k] + p]; + } + } while (--byte != 0); +} + +// static +void leoC2_4_ecc(void) { + unsigned int s0; + unsigned int R0; + unsigned int R1; + unsigned int R2; + unsigned int R3; + u8* pointer1; + u8* pointer2; + u8* pointer3; + u8* pointer4; + unsigned int aa; + unsigned int bb; + unsigned int dd; + unsigned int ee; + unsigned int gg; + unsigned int hh; + unsigned int pp; + unsigned int qq; + unsigned int ll; + unsigned int ii; + unsigned int jj; + unsigned int kk; + unsigned int byte; + unsigned int s; + unsigned int a; + unsigned int e; + unsigned int g; + unsigned int p; + unsigned int c; + unsigned int f; + unsigned int o; + unsigned int r; + unsigned int t; + unsigned int u; + unsigned int v; + unsigned int b; + unsigned int d; + unsigned int h; + unsigned int q; + u8* p_s; + + ii = 0x58 - LEOc2_param.err_pos[0]; + jj = 0x58 - LEOc2_param.err_pos[1]; + kk = 0x58 - LEOc2_param.err_pos[2]; + ll = 0x58 - LEOc2_param.err_pos[3]; + + ii = ganlog[ii]; + jj = ganlog[jj]; + kk = ganlog[kk]; + ll = ganlog[ll]; + s = ganlog[0]; + + aa = leoAlpha_div(s, ii); + bb = leoAlpha_div(s, jj); + ee = leoAlpha_div(s, kk); + dd = leoAlpha_div(s, ll); + + a = leoAlpha_mult(bb, ee); + e = leoAlpha_mult(ee, dd); + g = leoAlpha_mult(dd, bb); + p = leoAlpha_mult(dd, aa); + c = leoAlpha_mult(aa, ee); + f = leoAlpha_mult(aa, bb); + + b = a ^ e ^ g; + d = e ^ p ^ c; + h = p ^ f ^ g; + q = f ^ a ^ c; + a = bb ^ ee ^ dd; + e = ee ^ dd ^ aa; + g = dd ^ aa ^ bb; + p = aa ^ bb ^ ee; + + c = leoAlpha_mult(leoAlpha_mult(bb, ee), dd); + f = leoAlpha_mult(leoAlpha_mult(ee, dd), aa); + o = leoAlpha_mult(leoAlpha_mult(dd, aa), bb); + r = leoAlpha_mult(leoAlpha_mult(aa, bb), ee); + + s = leoAlpha_mult(leoAlpha_mult(leoAlpha_div(ii, jj) ^ 1, leoAlpha_div(ii, kk) ^ 1), leoAlpha_div(ii, ll) ^ 1); + s = leoAlpha_div(1, s); + t = leoAlpha_mult(leoAlpha_mult(leoAlpha_div(jj, ii) ^ 1, leoAlpha_div(jj, kk) ^ 1), leoAlpha_div(jj, ll) ^ 1); + t = leoAlpha_div(1, t); + u = leoAlpha_mult(leoAlpha_mult(leoAlpha_div(kk, ii) ^ 1, leoAlpha_div(kk, jj) ^ 1), leoAlpha_div(kk, ll) ^ 1); + u = leoAlpha_div(1, u); + v = leoAlpha_mult(leoAlpha_mult(leoAlpha_div(ll, ii) ^ 1, leoAlpha_div(ll, jj) ^ 1), leoAlpha_div(ll, kk) ^ 1); + v = leoAlpha_div(1, v); + + aa = glog[leoAlpha_mult(a, s)]; + bb = glog[leoAlpha_mult(b, s)]; + c = leoAlpha_mult(c, s); + ee = glog[leoAlpha_mult(e, t)]; + dd = glog[leoAlpha_mult(d, t)]; + f = leoAlpha_mult(f, t); + gg = glog[leoAlpha_mult(g, u)]; + hh = glog[leoAlpha_mult(h, u)]; + o = leoAlpha_mult(o, u); + pp = glog[leoAlpha_mult(p, v)]; + qq = glog[leoAlpha_mult(q, v)]; + r = leoAlpha_mult(r, v); + + s = glog[s]; + c = glog[c]; + t = glog[t]; + f = glog[f]; + u = glog[u]; + o = glog[o]; + v = glog[v]; + r = glog[r]; + + byte = LEOc2_param.bytes; + + if (LEOc2_param.err_pos[3] < 0x55) { + goto c2_4_4; + } + pointer4 = &LEO_TempBuffer[sizeof(LEO_TempBuffer)]; + if (LEOc2_param.err_pos[2] < 0x55) { + goto c2_4_3; + } + pointer3 = &LEO_TempBuffer[sizeof(LEO_TempBuffer)]; + if (LEOc2_param.err_pos[1] < 0x55) { + goto c2_4_2; + } + pointer2 = &LEO_TempBuffer[sizeof(LEO_TempBuffer)]; + if (LEOc2_param.err_pos[0] < 0x55) { + goto c2_4_1; + } + return; + +c2_4_4: + pointer4 = &LEOc2_param.pntr[(LEOc2_param.err_pos[3] + 1) * byte]; +c2_4_3: + pointer3 = &LEOc2_param.pntr[(LEOc2_param.err_pos[2] + 1) * byte]; +c2_4_2: + pointer2 = &LEOc2_param.pntr[(LEOc2_param.err_pos[1] + 1) * byte]; +c2_4_1: + pointer1 = &LEOc2_param.pntr[(LEOc2_param.err_pos[0] + 1) * byte]; + p_s = LEOc2_param.c2buff_e; + + do { + p_s -= 4; + s0 = p_s[0]; + if (!s0) { + R0 = R1 = R2 = R3 = 0; + } else { + s0 = glog[s0]; + R0 = ganlog[s0 + s]; + R1 = ganlog[s0 + t]; + R2 = ganlog[s0 + u]; + R3 = ganlog[s0 + v]; + } + s0 = p_s[1]; + if (s0) { + s0 = glog[s0]; + R0 ^= (!a) ? 0 : ganlog[s0 + aa]; + R1 ^= (!e) ? 0 : ganlog[s0 + ee]; + R2 ^= (!g) ? 0 : ganlog[s0 + gg]; + R3 ^= (!p) ? 0 : ganlog[s0 + pp]; + } + s0 = p_s[2]; + if (s0) { + s0 = glog[s0]; + R0 ^= (!b) ? 0 : ganlog[s0 + bb]; + R1 ^= (!d) ? 0 : ganlog[s0 + dd]; + R2 ^= (!h) ? 0 : ganlog[s0 + hh]; + R3 ^= (!q) ? 0 : ganlog[s0 + qq]; + } + s0 = p_s[3]; + if (s0) { + s0 = glog[s0]; + R0 ^= ganlog[s0 + c]; + R1 ^= ganlog[s0 + f]; + R2 ^= ganlog[s0 + o]; + R3 ^= ganlog[s0 + r]; + } + pointer1--; + pointer2--; + pointer3--; + pointer4--; + if (R0) { + *pointer1 ^= R0; + } + if (R1) { + *pointer2 ^= R1; + } + if (R2) { + *pointer3 ^= R2; + } + if (R3) { + *pointer4 ^= R3; + } + } while (--byte != 0); +} + +// static +int leoAlpha_mult(int i, int k) { + if (i == 0 || k == 0) { + return 0; + } + return ganlog[glog[i] + glog[k]]; +} + +// static +int leoAlpha_div(int i, int k) { + if (i == 0 || k == 0) { + return 0; + } + return ganlog[0xFF + (glog[i] - glog[k])]; +} diff --git a/src/libleo/leo/leocmdex.c b/src/libleo/leo/leocmdex.c new file mode 100644 index 0000000000..ca3101fb0a --- /dev/null +++ b/src/libleo/leo/leocmdex.c @@ -0,0 +1,262 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +extern vu16 LEOrw_flags; + +static void (*cmd_tbl[16])(void) = { + NULL, leoClr_queue, leoInquiry, leoTest_unit_rdy, leoRezero, leoRead, + leoWrite, leoSeek, leoStart_stop, leoRd_capacity, leoTranslate, leoMode_sel, + leoReadDiskId, leoReadTimer, leoSetTimer, leoClr_reset, +}; + +static LEOCmdRead system_read_cmd = { + { LEO_COMMAND_READ, 0, 0, 0, 0, 0, 0, 0, 0 }, 12, 1, 0, 0, +}; + +static const u8 system_lba[8] = { 0, 1, 8, 9, 0, 0, 0, 0 }; + +OSPiHandle* LEOPiInfo; +OSIoMesg LEOPiDmaParam; +s32 currentCommand; + +u8 leoRead_system_area(void); + +void leomain(void* arg0) { + u32 cur_status; + u32 sense_code; + u8 disktype_bak; + + ((u8*)&LEO_country_code)[0] = *(vu8*)OS_PHYSICAL_TO_K1(0x10); + ((u8*)&LEO_country_code)[1] = *(vu8*)OS_PHYSICAL_TO_K1(0x90); + ((u8*)&LEO_country_code)[2] = *(vu8*)OS_PHYSICAL_TO_K1(0x110); + ((u8*)&LEO_country_code)[3] = *(vu8*)OS_PHYSICAL_TO_K1(0x190); + + LEOasic_seq_ctl_shadow = 0; + LEOasic_bm_ctl_shadow = 0; + LEOdrive_flag = 0; + LEOclr_que_flag = 0; + leoInitUnit_atten(); + LEOPiInfo = osLeoDiskInit(); + LEOPiDmaParam.hdr.pri = 1; + LEOPiDmaParam.hdr.retQueue = &LEOdma_que; + osEPiReadIo(LEOPiInfo, ASIC_STATUS, &cur_status); + if (!(cur_status & 0x400000) && (cur_status & 0x06800000)) { + leoDrive_reset(); + } + + while (true) { + osRecvMesg(&LEOcommand_que, (OSMesg*)&LEOcur_command, OS_MESG_BLOCK); + currentCommand = LEOcur_command->header.command; + if (LEOcur_command->header.command == 0) { + leoDrive_reset(); + osRecvMesg(&LEOevent_que, NULL, OS_MESG_NOBLOCK); + continue; + } + + sense_code = leoChk_asic_ready(0x10001); + cur_status = leoChkUnit_atten(); + + do { + if (cur_status == 0) { + if (sense_code == 0) { + continue; + } + } else { + switch (sense_code) { + case 3: + case 37: + case 41: + case 43: + break; + case 49: + if (leoRetUnit_atten() == 43) { + sense_code = 43; + } + break; + default: + sense_code = leoRetUnit_atten(); + } + } + + switch (sense_code) { + case 47: + switch (LEOcur_command->header.command) { + case 2: + case 8: + case 11: + case 12: + case 13: + case 14: + case 15: + continue; + } + break; + case 49: + switch (LEOcur_command->header.command) { + case 2: + case 11: + case 13: + case 14: + case 15: + continue; + default: + sense_code = 42; + } + break; + case 43: + switch (LEOcur_command->header.command) { + case 15: + leoClrUA_RESET(); + FALLTHROUGH; + case 2: + case 13: + case 14: + continue; + } + break; + default: + /* empty */; + } + + if (LEOcur_command->header.command == 3) { + LEOcur_command->data.modeSelect.reserve1 = leoChk_cur_drvmode(); + } + LEOcur_command->header.sense = sense_code; + LEOcur_command->header.status = 2; + goto post_exe; + } while (0); + + if (LEOdrive_flag == 0) { + switch (LEOcur_command->header.command) { + case 2: + case 3: + case 8: + case 11: + case 13: + case 14: + case 15: + break; + default: + if (LEO_country_code == 0) { + osEPiReadIo(LEOPiInfo, ASIC_ID_REG, &cur_status); + if ((cur_status & 0x70000) != 0x40000) { + while (true) {} + } + } + + if (leoRead_system_area() != 0) { + LEOcur_command->header.status = 2; + goto post_exe; + } + + if ((LEOcur_command->header.sense = + leoSend_asic_cmd_w(0xB0001, LEO_sys_data.param.disk_type << 16)) != 0) { + LEOcur_command->header.status = 2; + goto post_exe; + } + + if ((LEO_sys_data.param.disk_type & 0xF0) != 0x10) { + goto invalid_disktype; + } + + LEOdisk_type = (LEO_sys_data.param.disk_type & 0xF); + if (LEOdisk_type >= 7) { + invalid_disktype: + LEOcur_command->header.sense = 0xBU; + LEOcur_command->header.status = 2; + goto post_exe; + } + + LEOdrive_flag = -1; + } + } + + cmd_tbl[LEOcur_command->header.command](); + + post_exe: + if (LEOcur_command->header.control & 0x80) { + osSendMesg(LEOcur_command->header.post, (void*)(s32)LEOcur_command->header.sense, OS_MESG_BLOCK); + } + if (LEOclr_que_flag != 0) { + leoClr_queue(); + } + } +} + +u8 leoRead_system_area(void) { + LEOCmdRead dummy_cmd; + void* backup_pointer; + u32 retry_cntr; + s32 read_mode; + + backup_pointer = LEOcur_command; + LEOcur_command = (LEOCmd*)&dummy_cmd; + read_mode = 0; + retry_cntr = 0; + + while (true) { + LEOdisk_type = 0; + // For lba_to_phys to avoid dealing with alternative tracks on the disk + LEO_sys_data.param.defect_num[0] = 0; + LEOrw_flags = 0x3000; + dummy_cmd = system_read_cmd; + dummy_cmd.buffPtr = &LEO_sys_data; + + if (read_mode == 0) { + // read System LBA 12 (+0, this is an offset value for leoRead_common) + // see system_read_cmd premade struct + leoRead_common(0); + switch (dummy_cmd.header.sense) { + case LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION: + do { + // if expecting a retail disk, LBA 12 is expected to do a read error, if not then freeze + } while (LEO_country_code != 0); + retry_cntr = 0; + read_mode--; + continue; + case LEO_SENSE_UNRECOVERED_READ_ERROR: + do { + // if expecting a development disk, LBA 12 is expected to read correctly, if not then freeze + } while (LEO_country_code == 0); + retry_cntr = 0; + read_mode--; + continue; + } + } else { + // read System LBA 0,1,8,9 (or 2,3,10,11 for dev) + dummy_cmd.lba = system_lba[retry_cntr & 3]; + if (LEO_country_code == 0) { + dummy_cmd.lba += 2; + } + leoRead_common(0); + if (dummy_cmd.header.status == LEO_STATUS_GOOD) { + do { + // if disk country and set country code in libleo mismatch, then freeze + } while (LEO_sys_data.param.country != LEO_country_code); + goto sys_read_end; + } + } + + system_retry: + if (leoChk_err_retry(dummy_cmd.header.sense) != LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION) { + break; + } + if (retry_cntr++ >= 0x40U) { + break; + } + if ((retry_cntr & 7) == 0) { + // Recalibrate drive every 8th tries + if ((dummy_cmd.header.sense = leoSend_asic_cmd_w(0x30001, 0)) == LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION) { + continue; + } + goto system_retry; + } + } + +sys_read_end: + LEOcur_command = backup_pointer; + LEOcur_command->header.sense = dummy_cmd.header.sense; + return GET_ERROR(*LEOcur_command); +} diff --git a/src/libleo/leo/leodiskinit.c b/src/libleo/leo/leodiskinit.c new file mode 100644 index 0000000000..6c11f728e2 --- /dev/null +++ b/src/libleo/leo/leodiskinit.c @@ -0,0 +1,33 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +extern OSPiHandle* __osPiTable; + +OSPiHandle __LeoDiskHandle; +OSPiHandle* __osDiskHandle; + +OSPiHandle* osLeoDiskInit(void) { + u32 saveMask; + + __LeoDiskHandle.type = DEVICE_TYPE_64DD; + __LeoDiskHandle.baseAddress = (u32)OS_PHYSICAL_TO_K1(ASIC_C2_BUFF); + __LeoDiskHandle.latency = 3; + __LeoDiskHandle.pulse = 6; + __LeoDiskHandle.pageSize = 6; + __LeoDiskHandle.relDuration = 2; + __LeoDiskHandle.domain = PI_DOMAIN2; + __LeoDiskHandle.speed = 0; + + bzero(&__LeoDiskHandle.transferInfo, sizeof(__OSTranxInfo)); + saveMask = __osDisableInt(); + + __LeoDiskHandle.next = __osPiTable; + __osPiTable = &__LeoDiskHandle; + __osDiskHandle = &__LeoDiskHandle; + + __osRestoreInt(saveMask); + + return &__LeoDiskHandle; +} diff --git a/src/libleo/leo/leofunc.c b/src/libleo/leo/leofunc.c new file mode 100644 index 0000000000..20809e55f6 --- /dev/null +++ b/src/libleo/leo/leofunc.c @@ -0,0 +1,134 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +static s32 __leoResetCalled = false; +static s32 __leoQueuesCreated = false; + +static OSMesgQueue LEOpost_que; +static OSMesg LEOpost_que_buf[1]; + +void leoInitialize(OSPri compri, OSPri intpri, OSMesg* command_que_buf, u32 cmd_buff_size) { + u32 savedMask; + OSPri oldPri; + OSPri myPri; + OSPri pri; + + if (intpri < compri) { + pri = compri; + } else { + pri = intpri; + } + + oldPri = -1; + + myPri = osGetThreadPri(NULL); + if (myPri < pri) { + oldPri = myPri; + osSetThreadPri(NULL, pri); + } + + savedMask = __osDisableInt(); + + __leoQueuesCreated = true; + osCreateMesgQueue(&LEOcommand_que, command_que_buf, cmd_buff_size); + osCreateMesgQueue(&LEOcontrol_que, LEOcontrol_que_buf, ARRAY_COUNT(LEOcontrol_que_buf)); + osCreateMesgQueue(&LEOevent_que, LEOevent_que_buf, ARRAY_COUNT(LEOevent_que_buf)); + osCreateMesgQueue(&LEOdma_que, LEOdma_que_buf, ARRAY_COUNT(LEOdma_que_buf)); + osCreateMesgQueue(&LEOblock_que, LEOblock_que_buf, ARRAY_COUNT(LEOblock_que_buf)); + osCreateMesgQueue(&LEOpost_que, LEOpost_que_buf, ARRAY_COUNT(LEOpost_que_buf)); + osCreateThread(&LEOcommandThread, 1, leomain, NULL, STACK_TOP(LEOcommandThreadStack), compri); + osStartThread(&LEOcommandThread); + osCreateThread(&LEOinterruptThread, 1, leointerrupt, NULL, STACK_TOP(LEOinterruptThreadStack), intpri); + osStartThread(&LEOinterruptThread); + osSetEventMesg(2, &LEOevent_que, (OSMesg)0x30000); + osSendMesg(&LEOblock_que, NULL, OS_MESG_NOBLOCK); + __osRestoreInt(savedMask); + + if (oldPri != -1) { + osSetThreadPri(NULL, oldPri); + } +} + +void leoCommand(void* cmd_blk_addr) { + if (__leoResetCalled != 0) { + ((LEOCmd*)cmd_blk_addr)->header.status = LEO_STATUS_CHECK_CONDITION; + ((LEOCmd*)cmd_blk_addr)->header.sense = LEO_SENSE_WAITING_NMI; + if ((((LEOCmd*)cmd_blk_addr)->header.control & LEO_CONTROL_POST) != 0) { + osSendMesg(((LEOCmd*)cmd_blk_addr)->header.post, (OSMesg)LEO_SENSE_WAITING_NMI, OS_MESG_BLOCK); + } + return; + } + osRecvMesg(&LEOblock_que, NULL, OS_MESG_BLOCK); + ((LEOCmd*)cmd_blk_addr)->header.status = LEO_STATUS_BUSY; + ((LEOCmd*)cmd_blk_addr)->header.sense = LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION; + + switch (((LEOCmd*)cmd_blk_addr)->header.command) { + case 1: + LEOclr_que_flag = 0xFF; + leoClr_queue(); + LEOclr_que_flag = 0; + ((LEOCmd*)cmd_blk_addr)->header.status = LEO_STATUS_GOOD; + if (((LEOCmd*)cmd_blk_addr)->header.control & LEO_CONTROL_POST) { + osSendMesg(((LEOCmd*)cmd_blk_addr)->header.post, (OSMesg)0, OS_MESG_BLOCK); + } + break; + + case 5: + case 6: + ((LEOCmd*)cmd_blk_addr)->data.readWrite.rwBytes = 0; + goto cmd_queing; + + default: + if ((u32)(((LEOCmd*)cmd_blk_addr)->header.command - 1) >= 0xE) { + ((LEOCmd*)cmd_blk_addr)->header.sense = LEO_SENSE_INVALID_COMMAND_OPERATION_CODE; + ((LEOCmd*)cmd_blk_addr)->header.status = LEO_STATUS_CHECK_CONDITION; + break; + } + + cmd_queing: + if (osSendMesg(&LEOcommand_que, (OSMesg)cmd_blk_addr, OS_MESG_NOBLOCK) != 0) { + ((LEOCmd*)cmd_blk_addr)->header.sense = LEO_SENSE_QUEUE_FULL; + ((LEOCmd*)cmd_blk_addr)->header.status = LEO_STATUS_CHECK_CONDITION; + } + } + osSendMesg(&LEOblock_que, (OSMesg)0, OS_MESG_BLOCK); +} + +static const u8 zero[] = { 0 }; + +void LeoReset(void) { + __leoResetCalled = true; + if (__leoQueuesCreated) { + LEOclr_que_flag = 0xFF; + leoClr_queue(); + LEOclr_que_flag = 0; + osRecvMesg(&LEOevent_que, NULL, OS_MESG_NOBLOCK); + osSendMesg(&LEOevent_que, (OSMesg)0xA0000, OS_MESG_BLOCK); + osSendMesg(&LEOcommand_que, (OSMesg)zero, OS_MESG_BLOCK); + } +} + +s32 __leoSetReset(void) { + leoDrive_reset(); + return 0; +} + +// SENSE or ERROR? +s32 LeoResetClear(void) { + LEOCmdHeader resetclear; + + resetclear.command = 0xF; + resetclear.control = LEO_CONTROL_POST; + resetclear.status = 0; + resetclear.post = &LEOpost_que; + if (osSendMesg(&LEOcommand_que, &resetclear.command, OS_MESG_NOBLOCK) != 0) { + return LEO_SENSE_QUEUE_FULL; + } + osRecvMesg(&LEOpost_que, NULL, OS_MESG_BLOCK); + if (resetclear.status == LEO_STATUS_GOOD) { + return LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION; + } + return resetclear.sense; +} diff --git a/src/libleo/leo/leoglobals.c b/src/libleo/leo/leoglobals.c new file mode 100644 index 0000000000..ca11ec6c4e --- /dev/null +++ b/src/libleo/leo/leoglobals.c @@ -0,0 +1,8 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +s32 __leoActive = false; + +LEOVersion __leoVersion; diff --git a/src/libleo/leo/leoinquiry.c b/src/libleo/leo/leoinquiry.c new file mode 100644 index 0000000000..cfa4f1c27f --- /dev/null +++ b/src/libleo/leo/leoinquiry.c @@ -0,0 +1,23 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +void leoInquiry(void) { + u32 asic_id; + u32 asic_data; + + osEPiReadIo(LEOPiInfo, ASIC_ID_REG, &asic_id); + if (leoSend_asic_cmd_w(0x1B0000, 0) == 0) { + osEPiReadIo(LEOPiInfo, ASIC_DATA, &asic_data); + if (asic_data & 0x10000) { + asic_id |= 0x100000; + } + } + + ((LEOCmdInquiry*)LEOcur_command)->devType = 0; + ((LEOCmdInquiry*)LEOcur_command)->version = asic_id >> 0x10; + ((LEOCmdInquiry*)LEOcur_command)->devNum = 1; + ((LEOCmdInquiry*)LEOcur_command)->leoBiosVer = 0; + LEOcur_command->header.status = LEO_STATUS_GOOD; +} diff --git a/src/libleo/leo/leoint.c b/src/libleo/leo/leoint.c new file mode 100644 index 0000000000..f337b15080 --- /dev/null +++ b/src/libleo/leo/leoint.c @@ -0,0 +1,298 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +extern vu16 LEOrw_flags; + +extern u8 LEOC2_Syndrome[2][0xE8 * 4]; +extern OSIoMesg LEOPiDmaParam; +extern block_param_form LEOc2_param; + +u8 LEOc2ctrl_que_buf[8]; +OSMesgQueue LEOc2ctrl_que; + +u32 read_write_track(void); +u32 leoChk_mecha_int(void); +void leosetup_BM(void); +u32 leochk_err_reg(void); + +void leointerrupt(void* arg) { + u32 result; + u32 tg_blocks; + + osCreateMesgQueue(&LEOc2ctrl_que, (OSMesg*)&LEOc2ctrl_que_buf, 1); + + while (true) { + osStopThread(&LEOinterruptThread); + tg_blocks = LEOcur_command->data.readWrite.transferBlks; + LEOwrite_pointer = LEOcur_command->data.readWrite.buffPtr; + + do { + leoLba_to_phys(LEOtgt_param.lba); + if (LEOrw_flags & 0x8000) { + result = leoSeek_i(1); + } else { + result = leoSeek_i(0); + } + + if (result != 0) { + goto complete; + } + + if (LEOrw_flags & 0x2000) { + LEOtgt_param.rdwr_blocks = 1; + } else if (LEOtgt_param.rdwr_blocks > tg_blocks) { + LEOtgt_param.rdwr_blocks = tg_blocks; + } + LEOtgt_param.lba += LEOtgt_param.rdwr_blocks; + tg_blocks -= LEOtgt_param.rdwr_blocks; + result = read_write_track(); + if (result != 0) { + goto complete; + } + + LEOcur_command->data.readWrite.rwBytes = LEOwrite_pointer - (u8*)LEOcur_command->data.readWrite.buffPtr; + } while (tg_blocks != 0); + result = 0x90000; // Inaccessible? + + complete: + osSendMesg(&LEOcontrol_que, (OSMesg)result, OS_MESG_BLOCK); + } +} + +// static +u32 read_write_track(void) { + u32 message; + u32 block; + u32 retry_cntr; + block_param_form block_param; + + block_param.bytes = LEOtgt_param.sec_bytes; + block_param.blkbytes = LEOtgt_param.blk_bytes; + if (LEOrw_flags & 0x2000) { + // Sector Mode + block_param.blkbytes = block_param.bytes; + } + block_param.pntr = LEOwrite_pointer; + LEOwrite_pointer += block_param.blkbytes; + if (LEOtgt_param.rdwr_blocks == 2) { + LEOwrite_pointer += block_param.blkbytes; + } + retry_cntr = 0; + for (;;) { + LEOPiInfo->transferInfo.transferMode = 1; + LEOPiInfo->transferInfo.blockNum = 0; + LEOPiInfo->transferInfo.block[0].C1ErrNum = 0; + LEOPiInfo->transferInfo.block[0].sectorSize = block_param.bytes; + LEOPiInfo->transferInfo.block[0].dramAddr = block_param.pntr; + LEOPiInfo->transferInfo.block[0].C2Addr = &LEOC2_Syndrome[0]; + if (LEOrw_flags & 0x2000) { + // Sector Mode + LEOtgt_param.rdwr_blocks = 1; + LEOPiInfo->transferInfo.transferMode = 3; + } else if (LEOtgt_param.rdwr_blocks == 2) { + LEOPiInfo->transferInfo.transferMode = 2; + LEOPiInfo->transferInfo.block[1] = LEOPiInfo->transferInfo.block[0]; + LEOPiInfo->transferInfo.block[1].C2Addr = &LEOC2_Syndrome[1]; + LEOPiInfo->transferInfo.block[1].dramAddr = + ((u8*)LEOPiInfo->transferInfo.block[1].dramAddr + block_param.blkbytes); + } + message = leoChk_mecha_int(); + if (message == 0) { + if (LEOrw_flags & 0x8000) { + // Write Mode + leoSet_mseq(1); + } else { + // Read Mode + leoSet_mseq(0); + } + leosetup_BM(); + LEOPiInfo->transferInfo.bmCtlShadow = LEOasic_bm_ctl_shadow; + LEOPiInfo->transferInfo.seqCtlShadow = LEOasic_seq_ctl_shadow; + if (LEOrw_flags & 0x8000) { + u16 bnum; + + LEOPiInfo->transferInfo.cmdType = 1; + osWritebackDCache(block_param.pntr, block_param.blkbytes * LEOtgt_param.rdwr_blocks); + osEPiStartDma(LEOPiInfo, &LEOPiDmaParam, 1); + osRecvMesg(&LEOdma_que, NULL, OS_MESG_BLOCK); + LEOasic_bm_ctl_shadow = LEOPiInfo->transferInfo.bmCtlShadow; + LEOasic_seq_ctl_shadow = LEOPiInfo->transferInfo.seqCtlShadow; + bnum = LEOPiInfo->transferInfo.blockNum; + message = LEOPiInfo->transferInfo.block[bnum].errStatus; + if (message == 0) { + return message; + } + goto track_end; + } else { + if (LEOrw_flags & 0x4000) { + osRecvMesg(&LEOc2ctrl_que, NULL, OS_MESG_BLOCK); + osSendMesg(&LEOc2ctrl_que, NULL, OS_MESG_NOBLOCK); + } + LEOPiInfo->transferInfo.cmdType = 0; + osInvalDCache(block_param.pntr, block_param.blkbytes * LEOtgt_param.rdwr_blocks); + osEPiStartDma(LEOPiInfo, &LEOPiDmaParam, 0); + block = 0; + while (LEOtgt_param.rdwr_blocks != 0) { + osRecvMesg(&LEOdma_que, NULL, OS_MESG_BLOCK); + LEOasic_bm_ctl_shadow = LEOPiInfo->transferInfo.bmCtlShadow; + LEOasic_seq_ctl_shadow = LEOPiInfo->transferInfo.seqCtlShadow; + message = LEOPiInfo->transferInfo.block[block].errStatus; + if (message != 0) { + goto track_end; + } + if (LEOrw_flags & 0x2000) { + return 0; + } + if (LEOPiInfo->transferInfo.block[block].C1ErrNum) { + if (LEOPiInfo->transferInfo.block[block].C1ErrSector[0] < 0x55) { + u8* temp; + u32 c2datasize; + + if (LEOtgt_param.rdwr_blocks == 1) { + osEPiReadIo(LEOPiInfo, ASIC_ERR_SECTOR, &message); + if (message & 0x10000000) { + message = 4; + goto track_end; + } + } + + if (block == 0) { + temp = LEOC2_Syndrome[0]; + } else { + temp = LEOC2_Syndrome[1]; + } + c2datasize = block_param.bytes * 4; + block_param.c2buff_e = temp + c2datasize; + osInvalDCache(temp, c2datasize); + block_param.err_num = LEOPiInfo->transferInfo.block[block].C1ErrNum; + block_param.err_pos[0] = LEOPiInfo->transferInfo.block[block].C1ErrSector[0]; + block_param.err_pos[1] = LEOPiInfo->transferInfo.block[block].C1ErrSector[1]; + block_param.err_pos[2] = LEOPiInfo->transferInfo.block[block].C1ErrSector[2]; + block_param.err_pos[3] = LEOPiInfo->transferInfo.block[block].C1ErrSector[3]; + osRecvMesg(&LEOc2ctrl_que, NULL, OS_MESG_BLOCK); + LEOrw_flags |= 0x4000; + LEOc2_param = block_param; + osSendMesg(&LEOcontrol_que, (OSMesg)0x80000, OS_MESG_BLOCK); + } + } else { + if (LEOtgt_param.rdwr_blocks == 1) { + if ((*(u32*)&LEOC2_Syndrome[block][0x00] | *(u32*)&LEOC2_Syndrome[block][0x04] | + *(u32*)&LEOC2_Syndrome[block][0x08] | *(u32*)&LEOC2_Syndrome[block][0x0C]) != 0) { + message = 0x17; + goto track_end; + } + } + } + block++; + block_param.pntr += block_param.blkbytes; + LEOtgt_param.start_block ^= 1; + LEOtgt_param.rdwr_blocks--; + } + } + return 0; + } + track_end: + if (message == 0x16) { + message = leochk_err_reg(); + } + do_retry: + if (leoChk_err_retry(message) || (LEOrw_flags & 0x1000) || retry_cntr++ == 0x40) { + break; + } + if ((retry_cntr & 7) == 0) { + message = leoSend_asic_cmd_w(0x30001, 0); + if (message != 0) { + goto do_retry; + } + } + if (message == 0x18 || (message == 0x17 && retry_cntr == 0x20)) { + message = leoDetect_index_w(); + if (message != 0) { + goto do_retry; + } + } + if (LEOrw_flags & 0x8000) { + message = leoSeek_i(1); + } else { + message = leoSeek_i(0); + } + if (message != 0) { + goto do_retry; + } + } + return message; +} + +// static +u32 leoChk_mecha_int(void) { + u32 stat = leoWait_mecha_cmd_done(0x10001); + u32 index_stat; + + if (stat == 0) { + osEPiReadIo(LEOPiInfo, ASIC_CUR_TK, &index_stat); + if ((index_stat & 0x60000000) != 0x60000000) { + stat = 0x18; + } + } + return stat; +} + +// static +void leosetup_BM(void) { + osEPiWriteIo(LEOPiInfo, ASIC_BM_CTL, LEOasic_bm_ctl_shadow | 0x10000000); + osEPiWriteIo(LEOPiInfo, ASIC_BM_CTL, LEOasic_bm_ctl_shadow); + + if (LEOtgt_param.start_block != 0) { + LEOasic_bm_ctl_shadow = 0x5A0000; + } else { + LEOasic_bm_ctl_shadow = 0; + } + + if (!(LEOrw_flags & 0x8000)) { + LEOasic_bm_ctl_shadow |= 0x40000000; + } + + if (LEOtgt_param.rdwr_blocks == 2) { + LEOasic_bm_ctl_shadow |= 0x02000000; + } + + osEPiWriteIo(LEOPiInfo, ASIC_BM_CTL, LEOasic_bm_ctl_shadow); +} + +// static +u32 leochk_err_reg(void) { + u32 sense; + u32 index_status; + + osEPiReadIo(LEOPiInfo, ASIC_ERR_SECTOR, &sense); + osEPiWriteIo(LEOPiInfo, ASIC_BM_CTL, LEOasic_bm_ctl_shadow | 0x10000000); + osEPiWriteIo(LEOPiInfo, ASIC_BM_CTL, LEOasic_bm_ctl_shadow); + + if (sense & 0x04000000) { + return LEO_ERROR_EJECTED_ILLEGALLY_RESUME; + } + + if (sense & 0x10000000) { + return LEO_ERROR_DATA_PHASE_ERROR; + } + + if (sense & (0x40000000 | 0x2000000)) { + if (LEOrw_flags & 0x8000) { + return LEO_ERROR_WRITE_FAULT; + } + return LEO_ERROR_UNRECOVERED_READ_ERROR; + } + + if (sense & 0x80000000) { + return LEO_ERROR_NO_REFERENCE_POSITION_FOUND; + } + + osEPiReadIo(LEOPiInfo, ASIC_CUR_TK, &index_status); + if ((index_status & 0x60000000) == 0x60000000) { + return LEO_ERROR_TRACK_FOLLOWING_ERROR; + } + + return LEO_ERROR_NO_REFERENCE_POSITION_FOUND; +} diff --git a/src/libleo/leo/leointerrupt.c b/src/libleo/leo/leointerrupt.c new file mode 100644 index 0000000000..d9e2175ad3 --- /dev/null +++ b/src/libleo/leo/leointerrupt.c @@ -0,0 +1,208 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" +#include "ultra64/internal.h" + +extern OSThread* __osRunQueue; +extern OSHWIntr __OSGlobalIntMask; +void __osLeoAbnormalResume(void); +void __osLeoResume(void); + +STACK(leoDiskStack, 0x1000); + +s32 __osLeoInterrupt(void) { + u32 stat = 0; + volatile u32 pi_stat; + u32 bm_stat; + __OSTranxInfo* info = &__osDiskHandle->transferInfo; + __OSBlockInfo* blockInfo = &info->block[info->blockNum]; + + pi_stat = IO_READ(PI_STATUS_REG); + if (pi_stat & PI_STATUS_DMA_BUSY) { + __OSGlobalIntMask &= ~0x800; + blockInfo->errStatus = 0x1D; + __osLeoResume(); + return 1; + } + + pi_stat = IO_READ(PI_STATUS_REG); + while (pi_stat & (PI_STATUS_DMA_BUSY | PI_STATUS_IO_BUSY)) { + pi_stat = IO_READ(PI_STATUS_REG); + } + + stat = IO_READ(ASIC_STATUS); + if (stat & 0x2000000) { + pi_stat = IO_READ(PI_STATUS_REG); + while (pi_stat & (PI_STATUS_DMA_BUSY | PI_STATUS_IO_BUSY)) { + pi_stat = IO_READ(PI_STATUS_REG); + } + + IO_WRITE(ASIC_BM_CTL, info->bmCtlShadow | 0x1000000); + blockInfo->errStatus = 0; + return 0; + } + if (info->cmdType == 2) { + return 1; + } + if (stat & 0x8000000) { + pi_stat = IO_READ(PI_STATUS_REG); + while (pi_stat & (PI_STATUS_DMA_BUSY | PI_STATUS_IO_BUSY)) { + pi_stat = IO_READ(PI_STATUS_REG); + } + + stat = IO_READ(ASIC_STATUS); + blockInfo->errStatus = 0x16; + __osLeoResume(); + IO_WRITE(PI_STATUS_REG, 2); + __OSGlobalIntMask |= 0x100401; + return 1; + } + if (info->cmdType == 1) { + if (!(stat & 0x40000000)) { + if ((info->sectorNum + 1) != (info->transferMode * 0x55)) { + blockInfo->errStatus = 0x18; + __osLeoAbnormalResume(); + return 1; + } + IO_WRITE(PI_STATUS_REG, 2); + __OSGlobalIntMask |= 0x100401; + blockInfo->errStatus = 0; + __osLeoResume(); + return 1; + } else { + blockInfo->dramAddr = (u8*)(blockInfo->dramAddr) + blockInfo->sectorSize; + info->sectorNum++; + __osEPiRawStartDma(__osDiskHandle, 1, ASIC_SECTOR_BUFF, blockInfo->dramAddr, blockInfo->sectorSize); + return 1; + } + } else if (info->cmdType == 0) { + if (info->transferMode == 3) { + if (((s32)blockInfo->C1ErrNum + 0x11) < info->sectorNum) { + blockInfo->errStatus = 0; + __osLeoAbnormalResume(); + return 1; + } + if ((stat & 0x40000000) == 0) { + blockInfo->errStatus = 0x17; + __osLeoAbnormalResume(); + return 1; + } + } else { + blockInfo->dramAddr = (u8*)(blockInfo->dramAddr) + blockInfo->sectorSize; + } + + bm_stat = IO_READ(ASIC_BM_STATUS); + if (((bm_stat & 0x200000) && (bm_stat & 0x400000)) || (bm_stat & 0x2000000)) { + if (blockInfo->C1ErrNum >= 4) { + if ((info->transferMode != 3) || (info->sectorNum >= 0x53)) { + blockInfo->errStatus = 0x17; + __osLeoAbnormalResume(); + return 1; + } + } else { + int errNum = blockInfo->C1ErrNum; + + blockInfo->C1ErrSector[errNum] = info->sectorNum + 1; + } + blockInfo->C1ErrNum++; + } + + if (stat & 0x10000000) { + if (info->sectorNum != 0x57) { + blockInfo->errStatus = 0x18; + __osLeoAbnormalResume(); + return 1; + } + if ((info->transferMode == 2) && (info->blockNum == 0)) { + info->blockNum = 1; + info->sectorNum = -1; + info->block[1].dramAddr = (u8*)(info->block[1].dramAddr) - info->block[1].sectorSize; + blockInfo->errStatus = 0x16; + } else { + IO_WRITE(PI_STATUS_REG, 2); + __OSGlobalIntMask |= 0x100401; + info->cmdType = 2; + blockInfo->errStatus = 0; + } + __osEPiRawStartDma(__osDiskHandle, 0, ASIC_C2_BUFF, blockInfo->C2Addr, blockInfo->sectorSize * 4); + return 1; + } + if ((info->sectorNum == -1) && (info->transferMode == 2) && (info->blockNum == 1)) { + __OSBlockInfo* bptr = info->block; + + if (bptr->C1ErrNum == 0) { + if (((u32*)bptr->C2Addr)[0] | ((u32*)bptr->C2Addr)[1] | ((u32*)bptr->C2Addr)[2] | + ((u32*)bptr->C2Addr)[3]) { + bptr->errStatus = 0x17; + __osLeoAbnormalResume(); + return 1; + } + } + bptr->errStatus = 0; + __osLeoResume(); + } + info->sectorNum++; + if (stat & 0x40000000) { + if (info->sectorNum >= 0x55) { + blockInfo->errStatus = 0x18; + __osLeoAbnormalResume(); + return 1; + } + __osEPiRawStartDma(__osDiskHandle, 0, ASIC_SECTOR_BUFF, blockInfo->dramAddr, blockInfo->sectorSize); + blockInfo->errStatus = 0; + return 1; + } else if (info->sectorNum < 0x55) { + blockInfo->errStatus = 0x18; + __osLeoAbnormalResume(); + return 1; + } + return 1; + } else { + blockInfo->errStatus = 4; + __osLeoAbnormalResume(); + return 1; + } +} + +// static +void __osLeoAbnormalResume(void) { + __OSTranxInfo* info; + u32 pi_stat; + + info = &__osDiskHandle->transferInfo; + pi_stat = IO_READ(PI_STATUS_REG); + while (pi_stat & (PI_STATUS_DMA_BUSY | PI_STATUS_IO_BUSY)) { + pi_stat = IO_READ(PI_STATUS_REG); + } + + IO_WRITE(ASIC_BM_CTL, info->bmCtlShadow | 0x10000000); + pi_stat = IO_READ(PI_STATUS_REG); + while (pi_stat & (PI_STATUS_DMA_BUSY | PI_STATUS_IO_BUSY)) { + pi_stat = IO_READ(PI_STATUS_REG); + } + + IO_WRITE(ASIC_BM_CTL, info->bmCtlShadow); + __osLeoResume(); + IO_WRITE(PI_STATUS_REG, 2); + __OSGlobalIntMask |= 0x100401; +} + +// static +void __osLeoResume(void) { + __OSEventState* es; + OSMesgQueue* mq; + s32 last; + + es = &__osEventStateTab[8]; + mq = es->queue; + if ((mq == 0) || (mq->validCount >= mq->msgCount)) { + return; + } + last = (mq->first + mq->validCount) % mq->msgCount; + mq->msg[last] = es->msg; + mq->validCount++; + if (mq->mtqueue->next != NULL) { + __osEnqueueThread(&__osRunQueue, __osPopThread(&mq->mtqueue)); + } +} diff --git a/src/libleo/leo/leomecha.c b/src/libleo/leo/leomecha.c new file mode 100644 index 0000000000..861b2970fb --- /dev/null +++ b/src/libleo/leo/leomecha.c @@ -0,0 +1,344 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +extern s32 currentCommand; + +static u32 asic_cur_status; +static u32 unit_atten; + +u8 leoAnalize_asic_status(void) { + u32 curr_stat; + + osEPiReadIo(LEOPiInfo, ASIC_STATUS, &asic_cur_status); + curr_stat = asic_cur_status ^ 0x1000000; + + // 0xFE3C0000? + if (curr_stat & 0x1C3FFFF) { + // 0xFE3E0000? + if (curr_stat & 0x1C1FFFF) { + LEOdrive_flag = 0; + } + if (curr_stat & 0xFFFF) { + return 41; + } + if ((curr_stat & 0xC00000) == 0x800000) { + return 3; + } + if (curr_stat & 0x400000) { + unit_atten |= 2; + return 43; + } + if (curr_stat & 0x1000000) { + return 49; + } + if (curr_stat & 0x10000) { + unit_atten |= 1; + return 47; + } + if (curr_stat & 0x20000) { + return 21; + } + } + return 0; +} + +u8 leoChk_asic_ready(u32 asic_cmd) { + u32 sense_code = leoAnalize_asic_status(); + + switch (sense_code) { + case 47: + if (asic_cmd == 0x80000) { + return 0; + } + case 43: + if (!(asic_cur_status & 0x800000)) { + if (asic_cmd == 0x90000) { + return 0; + } + if (leoRecv_event_mesg(OS_MESG_NOBLOCK) != 0) { + return 37; + } + osEPiWriteIo(LEOPiInfo, ASIC_CMD, 0x90000); + if (leoRecv_event_mesg(OS_MESG_BLOCK) != 0) { + return 37; + } + } + default: + break; + + case 49: + if (asic_cmd & 1) { + break; + } + + case 21: + return 0; + } + return sense_code; +} + +// Which of LEO_ERROR or LEO_SENSE should be used where? +u8 leoChk_done_status(u32 asic_cmd) { + u32 asic_data; + u32 code = leoAnalize_asic_status(); + + switch (code) { + case 43: + case 47: + if (!(asic_cur_status & 0x800000)) { + if (leoRecv_event_mesg(OS_MESG_NOBLOCK) != 0) { + return 37; + } + + osEPiWriteIo(LEOPiInfo, ASIC_CMD, 0x90000); + if (leoRecv_event_mesg(OS_MESG_BLOCK) != 0) { + return 37; + } + } + break; + + case 49: + if (asic_cmd & 1) { + break; + } + return 0; + + case 21: + osEPiWriteIo(LEOPiInfo, ASIC_DATA, 0); + if (leoRecv_event_mesg(OS_MESG_NOBLOCK) != 0) { + return 37; + } + + osEPiWriteIo(LEOPiInfo, ASIC_CMD, 0xC0000); + if (leoRecv_event_mesg(OS_MESG_BLOCK) != 0) { + return 37; + } + + osEPiReadIo(LEOPiInfo, ASIC_DATA, &asic_data); + code = leoChk_asic_ready(0xC0000); + if (code != 0) { + return code; + } + + if (asic_data & 0x10000) { + return 2; + } + if (asic_data & 0x20000) { + return 24; + } + if (asic_data & 0x40000) { + return 1; + } + if (asic_data & 0x80000) { + return 21; + } + if (asic_data & 0x200000) { + return 11; + } + return 41; + + default: + break; + } + + return code; +} + +u8 leoSend_asic_cmd_i(u32 asic_cmd, u32 asic_data) { + u8 status = leoChk_asic_ready(asic_cmd); + + if (status != 0) { + return LEOcur_command->header.sense = status; + } + + osEPiWriteIo(LEOPiInfo, ASIC_DATA, asic_data); + if (leoRecv_event_mesg(OS_MESG_NOBLOCK) != 0) { + return LEOcur_command->header.sense = 37; + } + + osEPiWriteIo(LEOPiInfo, ASIC_CMD, asic_cmd); + return 0; +} + +// Is this using the sense defines? +u8 leoWait_mecha_cmd_done(u32 asic_cmd) { + u32 done_stat; + + if (leoRecv_event_mesg(OS_MESG_BLOCK)) { + return 37; + } + + done_stat = leoChk_done_status(asic_cmd); + if (done_stat != 0) { + return done_stat; + } + + return 0; +} + +u8 leoSend_asic_cmd_w(u32 asic_cmd, u32 asic_data) { + u32 wstatus = leoSend_asic_cmd_i(asic_cmd, asic_data); + + if (wstatus != 0) { + return wstatus; + } + + return leoWait_mecha_cmd_done(asic_cmd); +} + +u8 leoSend_asic_cmd_w_nochkDiskChange(u32 asic_cmd, u32 asic_data) { + u8 status; + u32 done_stat; + + status = leoChk_asic_ready(asic_cmd); + if ((status != 0x2F) && (status != 0)) { + return LEOcur_command->header.sense = status; + } + + osEPiWriteIo(LEOPiInfo, ASIC_DATA, asic_data); + if (leoRecv_event_mesg(OS_MESG_NOBLOCK) != 0) { + return LEOcur_command->header.sense = 0x25; + } + + osEPiWriteIo(LEOPiInfo, ASIC_CMD, asic_cmd); + if (leoRecv_event_mesg(OS_MESG_BLOCK) != 0) { + return 0x25; + } + + done_stat = leoChk_done_status(asic_cmd); + if ((done_stat != 0x2F) && (done_stat != 0)) { + return done_stat; + } + + return 0; +} + +u8 leoDetect_index_w(void) { + return leoSend_asic_cmd_w(0xE0001, 0); +} + +u8 leoRecal_i(void) { + return leoSend_asic_cmd_i(0x30001, 0); +} + +u8 leoRecal_w(void) { + return leoSend_asic_cmd_w(0x30001, 0); +} + +u8 leoSeek_i(u16 rwmode) { + u32 tgt_tk = ((LEOtgt_param.head << 0xC) + LEOtgt_param.cylinder) << 0x10; + + if (rwmode == 0) { + return leoSend_asic_cmd_i(0x10001, tgt_tk); + } else { + return leoSend_asic_cmd_i(0x20001, tgt_tk); + } +} + +u8 leoSeek_w(void) { + u8 sksense = leoSeek_i(0); + + if (sksense != 0) { + return sksense; + } + + return leoWait_mecha_cmd_done(0x10001); +} + +u8 leoRecv_event_mesg(s32 control) { + u32 done_mesg; + + if (osRecvMesg(&LEOevent_que, (OSMesg*)&done_mesg, control) == 0) { + if (done_mesg == 0xA0000) { + leoDrive_reset(); + return -1; + } + } + + return 0; +} + +u32 leoChk_err_retry(u32 sense) { + if ((currentCommand == LEO_COMMAND_READ_DISK_ID) || (currentCommand == LEO_COMMAND_START_STOP)) { + switch (sense) { + case LEO_SENSE_POWERONRESET_DEVICERESET_OCCURED: + unit_atten |= 2; + case LEO_SENSE_DIAGNOSTIC_FAILURE: + case LEO_SENSE_COMMAND_PHASE_ERROR: + case LEO_SENSE_WAITING_NMI: + case LEO_SENSE_DEVICE_COMMUNICATION_FAILURE: + case LEO_SENSE_MEDIUM_NOT_PRESENT: + case LEO_SENSE_EJECTED_ILLEGALLY_RESUME: + LEOdrive_flag = 0; + return -1; + } + } else { + switch (sense) { + case LEO_SENSE_POWERONRESET_DEVICERESET_OCCURED: + unit_atten |= 2; + case LEO_SENSE_MEDIUM_MAY_HAVE_CHANGED: + unit_atten |= 1; + case LEO_SENSE_DIAGNOSTIC_FAILURE: + case LEO_SENSE_COMMAND_PHASE_ERROR: + case LEO_SENSE_WAITING_NMI: + case LEO_SENSE_DEVICE_COMMUNICATION_FAILURE: + case LEO_SENSE_MEDIUM_NOT_PRESENT: + case LEO_SENSE_EJECTED_ILLEGALLY_RESUME: + LEOdrive_flag = 0; + return -1; + } + } + + return 0; +} + +u8 leoChk_cur_drvmode(void) { + u8 devstat = 0; + + if (!(asic_cur_status & 0x1000000)) { + devstat |= 1; + } + if (asic_cur_status & 0x80000) { + devstat |= 2; + } + if (asic_cur_status & 0x100000) { + devstat |= 4; + } + return devstat; +} + +void leoDrive_reset() { + osEPiWriteIo(LEOPiInfo, ASIC_HARD_RESET, 0xAAAA0000); +} + +u32 leoChkUnit_atten(void) { + return unit_atten; +} + +u32 leoRetUnit_atten(void) { + if (unit_atten & 2) { + return 43; + } + if (unit_atten & 1) { + return 47; + } + return 0; +} + +void leoClrUA_RESET(void) { + unit_atten &= ~2; +} + +void leoClrUA_MEDIUM_CHANGED(void) { + unit_atten &= ~1; +} + +void leoSetUA_MEDIUM_CHANGED(void) { + unit_atten |= 1; +} + +void leoInitUnit_atten(void) { + unit_atten = 1; +} diff --git a/src/libleo/leo/leomode_sel.c b/src/libleo/leo/leomode_sel.c new file mode 100644 index 0000000000..cd45fd8350 --- /dev/null +++ b/src/libleo/leo/leomode_sel.c @@ -0,0 +1,27 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +void leoMode_sel(void) { + u32 sense; + + sense = leoSend_asic_cmd_w_nochkDiskChange(0x60000, LEOcur_command->data.time.yearlo << 0x10); + if (sense != LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION) { + goto mselerror; + } + sense = leoSend_asic_cmd_w_nochkDiskChange(0x70000, LEOcur_command->data.time.month << 0x10); + if (sense != LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION) { + goto mselerror; + } + sense = leoSend_asic_cmd_w_nochkDiskChange(0x150000, LEOcur_command->data.readWrite.transferBlks); + if (sense != LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION) { + mselerror: + LEOcur_command->header.sense = sense; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + + LEOcur_command->header.sense = sense; + LEOcur_command->header.status = LEO_STATUS_GOOD; +} diff --git a/src/libleo/leo/leomotor.c b/src/libleo/leo/leomotor.c new file mode 100644 index 0000000000..251ac2a95b --- /dev/null +++ b/src/libleo/leo/leomotor.c @@ -0,0 +1,36 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +void leoStart_stop(void) { + u32 send_cmd; + u8 sense_code; + u8 retry_cntr = 8; + u32 send_data; + + do { + send_data = 0; + if ((LEOcur_command->header.control & 1)) { + send_cmd = 0x50001; + } else if ((LEOcur_command->header.control & 2)) { + send_cmd = 0xD0000; + } else { + if ((LEOcur_command->header.control & 4)) { + send_data = 0x10000; + } + send_cmd = 0x40000; + } + sense_code = leoSend_asic_cmd_w_nochkDiskChange(send_cmd, send_data); + if (sense_code == 0) { + LEOcur_command->header.status = 0; + return; + } + if (leoChk_err_retry(sense_code)) { + break; + } + } while (retry_cntr--); + + LEOcur_command->header.sense = sense_code; + LEOcur_command->header.status = 2; +} diff --git a/src/libleo/leo/leomseq_tbl.c b/src/libleo/leo/leomseq_tbl.c new file mode 100644 index 0000000000..4944e63336 --- /dev/null +++ b/src/libleo/leo/leomseq_tbl.c @@ -0,0 +1,60 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +extern OSIoMesg LEOPiDmaParam; +extern vu16 LEOrw_flags; + +// bss +static u32 mseq_tbl[0x10]; + +// rodata +static const u32 rd_mseq_code[0x10] = { + 0x00010000, 0x00020200, 0x80030100, 0x82040000, 0xA8050000, 0xA0060600, 0x31760000, 0x00020300, + 0, 0, 0, 0, 0, 0, 0, 0x4060000, +}; +static const u32 wt_mseq_code[0x10] = { + 0x40020000, 0x00020000, 0x40130B00, 0x42140100, 0x68050000, 0x50060600, 0x401702FF, 0x01870000, + 0x40020000, 0, 0, 0, 0, 0, 0, 0x40F0000, +}; + +void leoSet_mseq(u16 rwmode) { + const u32* tbl; + u32 sct_byte_x; + u32 sct_byte_u; + u8 i; + + LEOasic_seq_ctl_shadow &= 0xBFFFFFFF; + osEPiWriteIo(LEOPiInfo, ASIC_SEQ_CTL, LEOasic_seq_ctl_shadow); + if (rwmode == 1) { + tbl = wt_mseq_code; + } else { + tbl = rd_mseq_code; + } + for (i = 0; i < 0x10; i++, tbl++) { + mseq_tbl[i] = *tbl; + } + + sct_byte_x = sct_byte_u = LEOtgt_param.sec_bytes - 1; + sct_byte_u += 7; + sct_byte_x <<= 8; + mseq_tbl[4] |= sct_byte_x; + + osWritebackDCache(mseq_tbl, 0x40); + LEOPiDmaParam.dramAddr = mseq_tbl; + LEOPiDmaParam.devAddr = MSEQ_RAM_ADDR; + LEOPiDmaParam.size = 0x40; + LEOPiInfo->transferInfo.cmdType = 2; + osEPiStartDma(LEOPiInfo, &LEOPiDmaParam, 1); + osRecvMesg(&LEOdma_que, NULL, OS_MESG_BLOCK); + osEPiWriteIo(LEOPiInfo, ASIC_SEC_BYTE, (sct_byte_u | 0x5900) << 0x10); + + if (LEOrw_flags & 0x800) { + sct_byte_x += 0x100; + } + + osEPiWriteIo(LEOPiInfo, ASIC_HOST_SECBYTE, sct_byte_x << 8); + LEOasic_seq_ctl_shadow |= 0x40000000; + osEPiWriteIo(LEOPiInfo, ASIC_SEQ_CTL, LEOasic_seq_ctl_shadow); +} diff --git a/src/libleo/leo/leoram.c b/src/libleo/leo/leoram.c new file mode 100644 index 0000000000..7600632482 --- /dev/null +++ b/src/libleo/leo/leoram.c @@ -0,0 +1,41 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +leo_sys_form LEO_sys_data; + +OSThread LEOcommandThread; +OSThread LEOinterruptThread; + +STACK(LEOcommandThreadStack, 0x400); +STACK(LEOinterruptThreadStack, 0x400); + +OSMesgQueue LEOcommand_que; +OSMesgQueue LEOevent_que; +OSMesgQueue LEOcontrol_que; +OSMesgQueue LEOdma_que; +OSMesgQueue LEOblock_que; + +OSMesg LEOevent_que_buf[1]; +OSMesg LEOcontrol_que_buf[1]; +OSMesg LEOdma_que_buf[2]; +OSMesg LEOblock_que_buf[1]; + +u8* LEOwrite_pointer; +LEOCmd* LEOcur_command; + +u32 LEOasic_bm_ctl_shadow; +u32 LEOasic_seq_ctl_shadow; + +u8 LEOdrive_flag; +vu8 LEOclr_que_flag; + +// volatile? +vu16 LEOrw_flags; + +u8 LEOdisk_type; + +tgt_param_form LEOtgt_param; + +u32 LEO_country_code; diff --git a/src/libleo/leo/leord_capa.c b/src/libleo/leo/leord_capa.c new file mode 100644 index 0000000000..d060a64936 --- /dev/null +++ b/src/libleo/leo/leord_capa.c @@ -0,0 +1,17 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +void leoRd_capacity(void) { + if (LEOcur_command->header.control & LEO_CONTROL_WRT) { // Possibly LEO_CONTROL_TBL + LEOcur_command->data.readWrite.lba = LEORAM_START_LBA[LEOdisk_type] - 0x18; + LEOcur_command->data.readWrite.transferBlks = 0x10C3; + LEOcur_command->data.readWrite.buffPtr = (void*)LEORAM_BYTE[LEOdisk_type]; + } else { + LEOcur_command->data.readWrite.lba = 0; + LEOcur_command->data.readWrite.transferBlks = 0x10C3; + LEOcur_command->data.readWrite.buffPtr = (void*)0x3D78F40; // Total capacity, approx. 64.45 MB + } + LEOcur_command->header.status = LEO_STATUS_GOOD; +} diff --git a/src/libleo/leo/leord_diskid.c b/src/libleo/leo/leord_diskid.c new file mode 100644 index 0000000000..fde59bcc9c --- /dev/null +++ b/src/libleo/leo/leord_diskid.c @@ -0,0 +1,54 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +extern vu16 LEOrw_flags; +extern u8 LEO_TempBuffer[0xE8]; + +const u8 leo_disk_id_lba[] = { 14, 15 }; + +LEOCmdRead read_id_cmd = { + { LEO_COMMAND_READ, 0, 0, 0, 0, 0, 0, 0, 0 }, 14, 1, LEO_TempBuffer, 0, +}; + +void leoReadDiskId(void) { + LEOCmdRead dummy_cmd; + u8* temp_pointer; + u32 cntr; + + // Keep Disk ID Command and replace + temp_pointer = (u8*)LEOcur_command; + + // Read Disk ID to Temp Buffer + LEOcur_command = (LEOCmd*)&dummy_cmd; + for (cntr = 0; cntr < (sizeof(leo_disk_id_lba)); cntr++) { + LEOrw_flags = 0x2000; + dummy_cmd = read_id_cmd; + dummy_cmd.lba = leo_disk_id_lba[cntr]; + leoRead_common(0); + if (dummy_cmd.header.sense != LEO_SENSE_UNRECOVERED_READ_ERROR) { + break; + } + } + + // Put back the old ReadDiskID command + LEOcur_command = (LEOCmd*)temp_pointer; + + // Copy Disk ID to buffer pointed by ReadDiskID command + temp_pointer = (u8*)LEOcur_command->data.readdiskid.bufferPointer; + for (cntr = 0; cntr < (sizeof(LEODiskID)); cntr += sizeof(u32)) { + *(u32*)temp_pointer = *((u32*)&LEO_TempBuffer[cntr]); + temp_pointer += sizeof(u32); + } + + // Copy status and sense + LEOcur_command->header.sense = dummy_cmd.header.sense; + LEOcur_command->header.status = dummy_cmd.header.status; + + if (LEOcur_command->header.status == LEO_STATUS_GOOD) { + leoClrUA_MEDIUM_CHANGED(); + } else { + leoSetUA_MEDIUM_CHANGED(); + } +} diff --git a/src/libleo/leo/leoread.c b/src/libleo/leo/leoread.c new file mode 100644 index 0000000000..62017cd159 --- /dev/null +++ b/src/libleo/leo/leoread.c @@ -0,0 +1,70 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +extern vu16 LEOrw_flags; + +void leoRead(void) { + LEOrw_flags = 0; + leoRead_common(0x18); +} + +extern OSMesgQueue LEOc2ctrl_que; + +void leoRead_common(unsigned int offset) { + u32 tg_lba = LEOcur_command->data.readWrite.lba; + u32 tg_blocks = LEOcur_command->data.readWrite.transferBlks; + u32 message; + u16 retry_cnt; + + if ((tg_lba | tg_blocks) & 0xFFFF0000) { + goto invalid_lba; + } + + tg_lba += offset; + if ((tg_lba + tg_blocks) > 0x10DC) { // Unclear what this number represents + invalid_lba: + LEOcur_command->header.sense = LEO_SENSE_LBA_OUT_OF_RANGE; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + + if (tg_blocks == 0) { + if (tg_lba >= 0x10DC) { + goto invalid_lba; + } + LEOcur_command->header.sense = LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION; + LEOcur_command->header.status = LEO_STATUS_GOOD; + return; + } + + LEOtgt_param.lba = tg_lba; + LEOrw_flags &= ~0xC000; + osSendMesg(&LEOc2ctrl_que, NULL, OS_MESG_NOBLOCK); + osStartThread(&LEOinterruptThread); + + for (;;) { + osRecvMesg(&LEOcontrol_que, (OSMesg*)&message, OS_MESG_BLOCK); + + switch (message) { + case 0x90000: + goto read_complete; + + case 0x80000: + leoC2_Correction(); + LEOrw_flags &= ~0x4000; + osSendMesg(&LEOc2ctrl_que, NULL, OS_MESG_NOBLOCK); + break; + + default: + LEOcur_command->header.sense = message; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + } + +read_complete: + LEOcur_command->header.sense = LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION; + LEOcur_command->header.status = LEO_STATUS_GOOD; +} diff --git a/src/libleo/leo/leoreset.c b/src/libleo/leo/leoreset.c new file mode 100644 index 0000000000..ff6e0f9439 --- /dev/null +++ b/src/libleo/leo/leoreset.c @@ -0,0 +1,29 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +void leoClr_queue(void) { + OSMesg clr_cmd; + + while (osRecvMesg(&LEOcommand_que, &clr_cmd, OS_MESG_NOBLOCK) == 0) { + ((LEOCmd*)clr_cmd)->header.sense = LEO_SENSE_COMMAND_TERMINATED; + ((LEOCmd*)clr_cmd)->header.status = LEO_STATUS_CHECK_CONDITION; + if (((LEOCmd*)clr_cmd)->header.control & LEO_CONTROL_POST) { + osSendMesg(((LEOCmd*)clr_cmd)->header.post, (OSMesg)LEO_SENSE_COMMAND_TERMINATED, OS_MESG_BLOCK); + } + } +} + +void leoClr_reset(void) { + u32 code = leoAnalize_asic_status(); + + if ((code == LEO_SENSE_COMMAND_PHASE_ERROR) || (code == LEO_SENSE_DEVICE_COMMUNICATION_FAILURE) || + (code == LEO_SENSE_POWERONRESET_DEVICERESET_OCCURED)) { + LEOcur_command->header.sense = code; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + } else { + LEOcur_command->header.sense = LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION; + LEOcur_command->header.status = LEO_STATUS_GOOD; + } +} diff --git a/src/libleo/leo/leorezero.c b/src/libleo/leo/leorezero.c new file mode 100644 index 0000000000..73b58df765 --- /dev/null +++ b/src/libleo/leo/leorezero.c @@ -0,0 +1,28 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +void leoRezero(void) { + u8 sense_code; + u8 retry_cntr = 8; + + do { + sense_code = leoRecal_w(); + + if (sense_code == LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION) { + LEOtgt_param.cylinder = 0; + LEOtgt_param.head = 0; + LEOtgt_param.zone = 0; + LEOcur_command->header.status = LEO_STATUS_GOOD; + return; + } + + if (leoChk_err_retry(sense_code) != 0) { + break; + } + } while (retry_cntr--); + + LEOcur_command->header.sense = sense_code; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; +} diff --git a/src/libleo/leo/leoseek.c b/src/libleo/leo/leoseek.c new file mode 100644 index 0000000000..566866255e --- /dev/null +++ b/src/libleo/leo/leoseek.c @@ -0,0 +1,33 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +void leoSeek(void) { + u32 tgt_tk; // Unused + u8 sense_code; + u8 retry_cntr = 20; + + if (LEOcur_command->data.seek.lba > LEO_LBA_MAX) { + LEOcur_command->header.sense = LEO_SENSE_LBA_OUT_OF_RANGE; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + + leoLba_to_phys(LEOcur_command->data.seek.lba + 0x18); + + do { + sense_code = leoSeek_w(); + if (sense_code == LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION) { + LEOcur_command->header.status = LEO_STATUS_GOOD; + return; + } + + if (leoChk_err_retry(sense_code) != 0) { + break; + } + } while (retry_cntr--); + + LEOcur_command->header.sense = sense_code; + LEOcur_command->header.status = LEO_SENSE_DIAGNOSTIC_FAILURE; +} diff --git a/src/libleo/leo/leotempbuffer.c b/src/libleo/leo/leotempbuffer.c new file mode 100644 index 0000000000..5016051caf --- /dev/null +++ b/src/libleo/leo/leotempbuffer.c @@ -0,0 +1,3 @@ +#include "n64dd.h" + +u8 LEO_TempBuffer[0xE8]; diff --git a/src/libleo/leo/leotestunit.c b/src/libleo/leo/leotestunit.c new file mode 100644 index 0000000000..a6a6dbdb62 --- /dev/null +++ b/src/libleo/leo/leotestunit.c @@ -0,0 +1,10 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +void leoTest_unit_rdy(void) { + ((LEOCmdTestUnitReady*)LEOcur_command)->test = leoChk_cur_drvmode(); + LEOcur_command->header.sense = LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION; + LEOcur_command->header.status = LEO_STATUS_GOOD; +} diff --git a/src/libleo/leo/leotimer.c b/src/libleo/leo/leotimer.c new file mode 100644 index 0000000000..9ac64bb2bb --- /dev/null +++ b/src/libleo/leo/leotimer.c @@ -0,0 +1,189 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +typedef struct { + /* 0x0 */ u8 year; + /* 0x1 */ u8 month; + /* 0x2 */ u8 day; + /* 0x3 */ u8 hour; + /* 0x4 */ u8 minute; + /* 0x5 */ u8 second; +} __LOCTime; + +u8 __locReadTimer(__LOCTime* time); +u8 __locSetTimer(__LOCTime* time); + +static const u8 ymdupper[6] = { 99, 12, 31, 23, 59, 59 }; +static const u8 dayupper[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; + +void leoReadTimer(void) { + u8* rdparam; + u8 data[4]; + u8 sense_code; + __LOCTime time; + + sense_code = __locReadTimer(&time); + LEOcur_command->data.time.yearlo = time.year; + LEOcur_command->data.time.month = time.month; + LEOcur_command->data.time.day = time.day; + LEOcur_command->data.time.hour = time.hour; + LEOcur_command->data.time.minute = time.minute; + LEOcur_command->data.time.second = time.second; + if (sense_code != 0) { + LEOcur_command->header.sense = sense_code; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + if ((u8)LEOcur_command->data.time.yearlo >= 0x96U) { + LEOcur_command->data.time.yearhi = 0x19; + } else { + LEOcur_command->data.time.yearhi = 0x20; + } + LEOcur_command->header.status = 0; +} + +void leoSetTimer(void) { + LEOCmdReadTimer rd_timer; + u8* p_tmp = &LEOcur_command->data.time.yearlo; + u32 year; + u32 month; + u32 temp; + u32 ymd; + u8 result; + __LOCTime time; + + // Verify values (if they're correct BCD or within limits) + + for (ymd = 0; ymd < 6; ymd++) { + temp = *p_tmp; + + // Verify right nibble (only right nibble for some reason) + if ((temp & 0xF) > 9) { + // nibble is above 0x9 therefore the BCD value is invalid + LEOcur_command->header.sense = LEO_SENSE_ILLEGAL_TIMER_VALUE; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + + // Convert BCD value to binary value + temp = temp - ((temp >> 4) * 6); + + switch (ymd) { + case 2: + // Day value check + if (dayupper[month] < temp && (temp != 0x1D || (year & 3))) { + LEOcur_command->header.sense = LEO_SENSE_ILLEGAL_TIMER_VALUE; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + case 1: + // Month value cannot be 0 + if (temp == 0) { + LEOcur_command->header.sense = LEO_SENSE_ILLEGAL_TIMER_VALUE; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + default: + // Verify max value of each time info + if (ymdupper[ymd] < temp) { + LEOcur_command->header.sense = LEO_SENSE_ILLEGAL_TIMER_VALUE; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + } + + year = month; + month = temp; + p_tmp++; + } + + // Every value has been ymd good, now set the values in hardware + + // Prepare the time info to use + time.year = LEOcur_command->data.time.yearlo; + time.month = LEOcur_command->data.time.month; + time.day = LEOcur_command->data.time.day; + time.hour = LEOcur_command->data.time.hour; + time.minute = LEOcur_command->data.time.minute; + time.second = LEOcur_command->data.time.second; + + // Set the new time + result = __locSetTimer(&time); + if (result != 0) { + LEOcur_command->header.sense = result; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + // Get the time + result = __locReadTimer(&time); + if (result != 0) { + LEOcur_command->header.sense = result; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + // Check if the time is set correctly + if (time.year != LEOcur_command->data.time.yearlo || time.month != LEOcur_command->data.time.month || + time.day != LEOcur_command->data.time.day || time.hour != LEOcur_command->data.time.hour || + time.minute != LEOcur_command->data.time.minute || time.second != LEOcur_command->data.time.second) { + LEOcur_command->header.sense = LEO_SENSE_ILLEGAL_TIMER_VALUE; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + LEOcur_command->header.status = LEO_STATUS_GOOD; +} + +// static +u8 __locReadTimer(__LOCTime* time) { + u32 data; + u8 sense_code; + + sense_code = leoSend_asic_cmd_w_nochkDiskChange(0x140000, 0U); + if (sense_code != 0) { + return sense_code; + } + osEPiReadIo(LEOPiInfo, ASIC_DATA, &data); + time->minute = (u8)((u32)(data & 0xFF000000) >> 0x18); + time->second = (s8)((u32)(data & 0xFF0000) >> 0x10); + sense_code = leoSend_asic_cmd_w_nochkDiskChange(0x130000, 0U); + if (sense_code != 0) { + time->minute = (u8)(time->minute & 0xFF7F); + return sense_code; + } + osEPiReadIo(LEOPiInfo, ASIC_DATA, &data); + time->day = (s8)((u32)(data & 0xFF000000) >> 0x18); + time->hour = (s8)((u32)(data & 0xFF0000) >> 0x10); + sense_code = leoSend_asic_cmd_w_nochkDiskChange(0x120000, 0U); + if (sense_code != 0) { + time->minute = (u8)(time->minute & 0xFF7F); + return sense_code; + } + osEPiReadIo(LEOPiInfo, ASIC_DATA, &data); + sense_code = time->minute; + time->year = (s8)((u32)(data & 0xFF000000) >> 0x18); + time->month = (s8)((u32)(data & 0xFF0000) >> 0x10); + if (sense_code & 0x80) { + time->minute = (u8)(sense_code & 0xFF7F); + return 5; + } + return 0; +} + +// static +u8 __locSetTimer(__LOCTime* time) { + u32 YearMonthX10000h; + u32 DayHourX10000h; + u32 MinuteSecondX10000h; + u8 result; + + YearMonthX10000h = (time->year << 0x18) + (time->month << 0x10); + DayHourX10000h = (time->day << 0x18) + (time->hour << 0x10); + MinuteSecondX10000h = (time->minute << 0x18) + (time->second << 0x10); + if ((result = leoSend_asic_cmd_w_nochkDiskChange(0xF0000, YearMonthX10000h)) != 0 || + (result = leoSend_asic_cmd_w_nochkDiskChange(0x100000, DayHourX10000h)) != 0 || + (result = leoSend_asic_cmd_w_nochkDiskChange(0x110000, MinuteSecondX10000h)) != 0) { + return result; + } + return 0; +} diff --git a/src/libleo/leo/leotranslat.c b/src/libleo/leo/leotranslat.c new file mode 100644 index 0000000000..1f297a792b --- /dev/null +++ b/src/libleo/leo/leotranslat.c @@ -0,0 +1,83 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +void leoTranslate(void) { + u32 lba; + u32 calc_bytes; + u32 calc_blks; + u32 byte_p_blk; + u16 zone; + u16 vzone; + u8 flag; // boolean + + if (LEOcur_command->data.readWrite.lba >= NUM_LBAS) { + LEOcur_command->header.sense = LEO_SENSE_LBA_OUT_OF_RANGE; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + + lba = LEOcur_command->data.readWrite.lba + 0x18; + calc_blks = 0; + calc_bytes = 0; + flag = vzone = 1; + + if (LEOcur_command->header.control & LEO_CONTROL_TBL) { + calc_bytes = LEOcur_command->data.readWrite.transferBlks; + + while (calc_bytes != 0) { + if (flag || (LEOVZONE_TBL[LEOdisk_type][vzone] == lba)) { + vzone = leoLba_to_vzone(lba); + zone = LEOVZONE_PZONEHD_TBL[LEOdisk_type][vzone]; + if (zone >= 8) { + zone -= 7; + } + byte_p_blk = LEOBYTE_TBL2[zone]; + } + + if (calc_bytes < byte_p_blk) { + calc_bytes = 0; + } else { + calc_bytes -= byte_p_blk; + } + calc_blks++; + lba++; + + if ((calc_bytes != 0) && (lba >= 0x10DC)) { + LEOcur_command->header.sense = LEO_SENSE_LBA_OUT_OF_RANGE; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + flag = false; + } + LEOcur_command->data.readWrite.buffPtr = (void*)calc_blks; + } else { + calc_blks = LEOcur_command->data.readWrite.transferBlks; + + while (calc_blks != 0) { + if (flag || (LEOVZONE_TBL[LEOdisk_type][vzone] == lba)) { + vzone = leoLba_to_vzone(lba); + zone = LEOVZONE_PZONEHD_TBL[LEOdisk_type][vzone]; + if (zone >= 8) { + zone -= 7; + } + byte_p_blk = LEOBYTE_TBL2[zone]; + } + + calc_bytes += byte_p_blk; + calc_blks--; + lba++; + + if ((calc_blks != 0) && (lba >= 0x10DC)) { + LEOcur_command->header.sense = LEO_SENSE_LBA_OUT_OF_RANGE; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + flag = false; + } + LEOcur_command->data.readWrite.buffPtr = (void*)calc_bytes; + } + + LEOcur_command->header.status = LEO_STATUS_GOOD; +} diff --git a/src/libleo/leo/leoutil.c b/src/libleo/leo/leoutil.c new file mode 100644 index 0000000000..08f88938cf --- /dev/null +++ b/src/libleo/leo/leoutil.c @@ -0,0 +1,107 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +u16 leoLba_to_phys(u32 lba) { + u16 vzone_num; + u16 zone_slba; + u16 zone_scyl; + u16 zone_tk; + u16 bad_tk_num; + u32 counter; + u16 def_offset; + u16 defect; + u8 def_zone_no; + + // A cylinder track is made of two blocks, so we may be able to only read one of it if the next block is on the next + // cylinder + LEOtgt_param.rdwr_blocks = 2 - (lba & 1); + + // Blocks are interleaved between cylinders + switch (lba & 3) { + case 0: + case 3: + LEOtgt_param.start_block = 0; + break; + default: + LEOtgt_param.start_block = 1; + break; + } + + // Get Virtual & Physical Disk Zones from LBA + vzone_num = leoLba_to_vzone(lba); + + // Set Parameter Disk Head & Zone + LEOtgt_param.zone = def_zone_no = LEOVZONE_PZONEHD_TBL[LEOdisk_type][vzone_num]; + LEOtgt_param.head = 0; + if (LEOtgt_param.zone > 7) { + LEOtgt_param.zone -= 7; + LEOtgt_param.head = 1; + } + + // Get the start cylinder from current zone + zone_scyl = LEOZONE_SCYL_TBL[def_zone_no]; + + // Get Virtual Zone LBA start, if Zone 0, it's LBA 0 + if (vzone_num != 0) { + zone_slba = LEOVZONE_TBL[LEOdisk_type][vzone_num - 1]; + } else { + zone_slba = 0; + } + // Get Cylinder relative of the current Zone + zone_tk = (lba - zone_slba) / 2; + // Calculate Physical Cylinder + if (LEOtgt_param.head != 0) { + LEOtgt_param.cylinder = zone_scyl - zone_tk; + zone_scyl = LEOZONE_OUTERCYL_TBL[LEOtgt_param.zone - 1]; + } else { + LEOtgt_param.cylinder = zone_scyl + zone_tk; + } + + // Get the relative offset to defect tracks for the current zone (if Zone 0, then it's 0) + if ((u32)def_zone_no != 0) { + def_offset = LEO_sys_data.param.defect_num[def_zone_no - 1]; + } else { + def_offset = 0; + } + // Get amount of defect tracks for the current zone + bad_tk_num = LEO_sys_data.param.defect_num[def_zone_no] - def_offset; + + // Skip defective cylinders + while (bad_tk_num != 0) { + defect = zone_scyl + LEO_sys_data.param.defect_data[def_offset]; + if (LEOtgt_param.cylinder < defect) { + break; + } + + LEOtgt_param.cylinder++; + def_offset++; + bad_tk_num--; + } + + // Set sector and block size info + LEOtgt_param.sec_bytes = LEOBYTE_TBL1[LEOtgt_param.zone]; + LEOtgt_param.blk_bytes = LEOBYTE_TBL2[LEOtgt_param.zone]; + + // For development disks + if (LEO_country_code == 0 && lba < 12) { + LEOtgt_param.sec_bytes = 0xC0; + LEOtgt_param.blk_bytes = 0x3FC0; + } + + return 0; +} + +u16 leoLba_to_vzone(u32 lba) { + u16 i; + const u16* ptr = LEOVZONE_TBL[LEOdisk_type]; + + for (i = 0; i < ARRAY_COUNT(LEOVZONE_TBL[LEOdisk_type]); i++, ptr++) { + if (lba < *ptr) { + return i; + } + } + + return 0xFF; +} diff --git a/src/libleo/leo/leowrite.c b/src/libleo/leo/leowrite.c new file mode 100644 index 0000000000..deeafc9ad8 --- /dev/null +++ b/src/libleo/leo/leowrite.c @@ -0,0 +1,54 @@ +#include "global.h" +#include "ultra64/leo.h" +#include "ultra64/leoappli.h" +#include "ultra64/leodrive.h" + +extern u16 LEOrw_flags; // N.B. NOT volatile in this file! + +void leoWrite(void) { + u32 message; + u32 start_lba; + u32 xfer_blk; + u32 write_bytes = 0; + u8 retry_count = 0; + + start_lba = LEOcur_command->data.readWrite.lba; + xfer_blk = LEOcur_command->data.readWrite.transferBlks; + if (((start_lba | xfer_blk) & 0xFFFF0000) != 0) { + goto invalid_lba; + } + + start_lba += 0x18; + if ((start_lba >= 0x10DC) || (start_lba + xfer_blk > 0x10DC)) { + invalid_lba: + LEOcur_command->header.sense = LEO_SENSE_LBA_OUT_OF_RANGE; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + + if (start_lba < LEORAM_START_LBA[LEOdisk_type]) { + LEOcur_command->header.sense = LEO_SENSE_WRITE_PROTECT_ERROR; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + + if (xfer_blk == 0) { + LEOcur_command->header.sense = LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION; + LEOcur_command->header.status = LEO_STATUS_GOOD; + return; + } + + LEOrw_flags = 0x8000; + LEOtgt_param.lba = start_lba; + osStartThread(&LEOinterruptThread); + osRecvMesg(&LEOcontrol_que, (OSMesg*)&message, OS_MESG_BLOCK); + + if (message != 0x90000) { + LEOcur_command->header.sense = message; + LEOcur_command->header.status = LEO_STATUS_CHECK_CONDITION; + return; + } + + LEOcur_command->header.sense = LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION; + LEOcur_command->header.status = LEO_STATUS_GOOD; +} diff --git a/src/libultra/gu/lookat.c b/src/libultra/gu/lookat.c index 5313d3cc3e..e1c7500cf1 100644 --- a/src/libultra/gu/lookat.c +++ b/src/libultra/gu/lookat.c @@ -61,5 +61,5 @@ void guLookAt(Mtx* m, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f guLookAtF(mf, xEye, yEye, zEye, xAt, yAt, zAt, xUp, yUp, zUp); - guMtxF2L((MtxF*)mf, m); + guMtxF2L(mf, m); } diff --git a/src/libultra/gu/lookathil.c b/src/libultra/gu/lookathil.c index b0fbc57ea2..1052c8e7aa 100644 --- a/src/libultra/gu/lookathil.c +++ b/src/libultra/gu/lookathil.c @@ -160,5 +160,5 @@ void guLookAtHilite(Mtx* m, LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, guLookAtHiliteF(mf, l, h, xEye, yEye, zEye, xAt, yAt, zAt, xUp, yUp, zUp, xl1, yl1, zl1, xl2, yl2, zl2, hiliteWidth, hiliteHeight); - guMtxF2L((MtxF*)mf, m); + guMtxF2L(mf, m); } diff --git a/src/libultra/gu/mtxutil.c b/src/libultra/gu/mtxutil.c new file mode 100644 index 0000000000..e9e327f740 --- /dev/null +++ b/src/libultra/gu/mtxutil.c @@ -0,0 +1,63 @@ +#include "global.h" + +void guMtxF2L(f32 mf[4][4], Mtx* m) { + s32 i, j; + s32 e1, e2; + s32 *ai, *af; + + ai = (s32*)&m->m[0][0]; + af = (s32*)&m->m[2][0]; + + for (i = 0; i < 4; i++) { + for (j = 0; j < 2; j++) { + e1 = FTOFIX32(mf[i][j * 2]); + e2 = FTOFIX32(mf[i][j * 2 + 1]); + *(ai++) = (e1 & 0xFFFF0000) | ((e2 >> 16) & 0xFFFF); + *(af++) = ((e1 << 16) & 0xFFFF0000) | (e2 & 0xFFFF); + } + } +} + +void guMtxL2F(f32 mf[4][4], Mtx* m) { + s32 i, j; + u32 e1, e2; + u32 *ai, *af; + s32 q1, q2; + + ai = (u32*)&m->m[0][0]; + af = (u32*)&m->m[2][0]; + + for (i = 0; i < 4; i++) { + for (j = 0; j < 2; j++) { + e1 = (*ai & 0xFFFF0000) | ((*af >> 16) & 0xFFFF); + e2 = ((*(ai++) << 16) & 0xFFFF0000) | (*(af++) & 0xFFFF); + q1 = *((s32*)&e1); + q2 = *((s32*)&e2); + + mf[i][j * 2] = FIX32TOF(q1); + mf[i][j * 2 + 1] = FIX32TOF(q2); + } + } +} + +void guMtxIdentF(f32 mf[4][4]) { + s32 i, j; + + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + if (i == j) { + mf[i][j] = 1.0; + } else { + mf[i][j] = 0.0; + } + } + } +} + +void guMtxIdent(Mtx* m) { + f32 mf[4][4]; + + guMtxIdentF(mf); + + guMtxF2L(mf, m); +} diff --git a/src/libultra/gu/normalize.c b/src/libultra/gu/normalize.c new file mode 100644 index 0000000000..6a0cac0200 --- /dev/null +++ b/src/libultra/gu/normalize.c @@ -0,0 +1,9 @@ +#include "global.h" + +void guNormalize(f32* x, f32* y, f32* z) { + f32 m = 1 / sqrtf(SQ(*x) + SQ(*y) + SQ(*z)); + + *x *= m; + *y *= m; + *z *= m; +} diff --git a/src/libultra/gu/ortho.c b/src/libultra/gu/ortho.c index 517ba1dccc..62b6d79503 100644 --- a/src/libultra/gu/ortho.c +++ b/src/libultra/gu/ortho.c @@ -25,5 +25,5 @@ void guOrtho(Mtx* mtx, f32 left, f32 right, f32 bottom, f32 top, f32 near, f32 f guOrthoF(mf, left, right, bottom, top, near, far, scale); - guMtxF2L((MtxF*)mf, mtx); + guMtxF2L(mf, mtx); } diff --git a/src/libultra/gu/perspective.c b/src/libultra/gu/perspective.c index 21b0e1a0a6..3f700a814a 100644 --- a/src/libultra/gu/perspective.c +++ b/src/libultra/gu/perspective.c @@ -38,5 +38,6 @@ void guPerspective(Mtx* m, u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 f f32 mf[4][4]; guPerspectiveF(mf, perspNorm, fovy, aspect, near, far, scale); - guMtxF2L((MtxF*)mf, m); + + guMtxF2L(mf, m); } diff --git a/src/libultra/gu/position.c b/src/libultra/gu/position.c index 65517139d8..1b9a3525b2 100644 --- a/src/libultra/gu/position.c +++ b/src/libultra/gu/position.c @@ -50,5 +50,5 @@ void guPosition(Mtx* m, f32 rot, f32 pitch, f32 yaw, f32 scale, f32 x, f32 y, f3 guPositionF(mf, rot, pitch, yaw, scale, x, y, z); - guMtxF2L((MtxF*)mf, m); + guMtxF2L(mf, m); } diff --git a/src/libultra/gu/rotate.c b/src/libultra/gu/rotate.c index 064006cdf4..b9108e1bc5 100644 --- a/src/libultra/gu/rotate.c +++ b/src/libultra/gu/rotate.c @@ -8,9 +8,11 @@ void guRotateF(f32 m[4][4], f32 a, f32 x, f32 y, f32 z) { f32 bc; f32 ca; f32 t; +#if !PLATFORM_N64 f32 xs; f32 ys; f32 zs; +#endif guNormalize(&x, &y, &z); @@ -25,9 +27,15 @@ void guRotateF(f32 m[4][4], f32 a, f32 x, f32 y, f32 z) { guMtxIdentF(m); +#if PLATFORM_N64 +#define xs (x * sine) +#define ys (y * sine) +#define zs (z * sine) +#else xs = x * sine; ys = y * sine; zs = z * sine; +#endif t = x * x; m[0][0] = (1 - t) * cosine + t; @@ -47,5 +55,6 @@ void guRotate(Mtx* m, f32 a, f32 x, f32 y, f32 z) { f32 mf[4][4]; guRotateF(mf, a, x, y, z); - guMtxF2L((MtxF*)mf, m); + + guMtxF2L(mf, m); } diff --git a/src/libultra/gu/scale.c b/src/libultra/gu/scale.c new file mode 100644 index 0000000000..525f2fb4c5 --- /dev/null +++ b/src/libultra/gu/scale.c @@ -0,0 +1,18 @@ +#include "global.h" + +void guScaleF(f32 m[4][4], f32 x, f32 y, f32 z) { + guMtxIdentF(m); + + m[0][0] = x; + m[1][1] = y; + m[2][2] = z; + m[3][3] = 1; +} + +void guScale(Mtx* m, f32 x, f32 y, f32 z) { + f32 mf[4][4]; + + guScaleF(mf, x, y, z); + + guMtxF2L(mf, m); +} diff --git a/src/libultra/gu/translate.c b/src/libultra/gu/translate.c new file mode 100644 index 0000000000..2753063d5d --- /dev/null +++ b/src/libultra/gu/translate.c @@ -0,0 +1,17 @@ +#include "global.h" + +void guTranslateF(f32 m[4][4], f32 x, f32 y, f32 z) { + guMtxIdentF(m); + + m[3][0] = x; + m[3][1] = y; + m[3][2] = z; +} + +void guTranslate(Mtx* m, f32 x, f32 y, f32 z) { + f32 mf[4][4]; + + guTranslateF(mf, x, y, z); + + guMtxF2L(mf, m); +} diff --git a/src/libultra/io/contsetch.c b/src/libultra/io/contsetch.c index feab63cdb4..5ced5b6de4 100644 --- a/src/libultra/io/contsetch.c +++ b/src/libultra/io/contsetch.c @@ -7,6 +7,8 @@ * direct SI devices. */ s32 osContSetCh(u8 ch) { + s32 ret = 0; + __osSiGetAccess(); if (ch > MAXCONTROLLERS) { @@ -17,5 +19,5 @@ s32 osContSetCh(u8 ch) { __osContLastCmd = CONT_CMD_END; __osSiRelAccess(); - return 0; + return ret; } diff --git a/src/libultra/io/epidma.c b/src/libultra/io/epidma.c index 28565e72c0..ca57a9d170 100644 --- a/src/libultra/io/epidma.c +++ b/src/libultra/io/epidma.c @@ -2,7 +2,7 @@ #include "ultra64/internal.h" s32 osEPiStartDma(OSPiHandle* handle, OSIoMesg* mb, s32 direction) { - s32 ret; + register s32 ret; if (!__osPiDevMgr.active) { return -1; diff --git a/src/libultra/io/pimgr.c b/src/libultra/io/pimgr.c index e95a6d70ec..db0b19b9ab 100644 --- a/src/libultra/io/pimgr.c +++ b/src/libultra/io/pimgr.c @@ -1,4 +1,5 @@ #include "global.h" +#include "stack.h" #include "ultra64/internal.h" OSDevMgr __osPiDevMgr = { 0 }; diff --git a/src/libultra/io/sptaskyielded.c b/src/libultra/io/sptaskyielded.c index 4fec2a6d51..d04f673c54 100644 --- a/src/libultra/io/sptaskyielded.c +++ b/src/libultra/io/sptaskyielded.c @@ -1,8 +1,8 @@ #include "global.h" u32 osSpTaskYielded(OSTask* task) { - u32 ret; u32 status = __osSpGetStatus(); + u32 ret; if (status & SP_STATUS_YIELDED) { ret = OS_TASK_YIELDED; diff --git a/src/libultra/io/vimgr.c b/src/libultra/io/vimgr.c index b587ac2330..c0a93875da 100644 --- a/src/libultra/io/vimgr.c +++ b/src/libultra/io/vimgr.c @@ -1,4 +1,5 @@ #include "global.h" +#include "stack.h" #include "ultra64/internal.h" OSThread viThread; diff --git a/src/libultra/io/vimodefpallan1.c b/src/libultra/io/vimodefpallan1.c index 5fb019cdfb..37cb5ff557 100644 --- a/src/libultra/io/vimodefpallan1.c +++ b/src/libultra/io/vimodefpallan1.c @@ -16,15 +16,15 @@ OSViMode osViModeFpalLan1 = { { // comRegs VI_CTRL_TYPE_16 | VI_CTRL_GAMMA_DITHER_ON | VI_CTRL_GAMMA_ON | VI_CTRL_DIVOT_ON | VI_CTRL_ANTIALIAS_MODE_1 | - VI_CTRL_PIXEL_ADV(3), // ctrl - WIDTH(320), // width - BURST(58, 30, 4, 69), // burst - VSYNC(625), // vSync - HSYNC(3177, 23), // hSync - LEAP(3183, 3181), // leap - HSTART(128, 768), // hStart - SCALE(2, 0), // xScale - VCURRENT(0), // vCurrent + VI_CTRL_PIXEL_ADV_3, // ctrl + WIDTH(320), // width + BURST(58, 30, 4, 69), // burst + VSYNC(625), // vSync + HSYNC(3177, 23), // hSync + LEAP(3183, 3181), // leap + HSTART(128, 768), // hStart + SCALE(2, 0), // xScale + VCURRENT(0), // vCurrent }, { // fldRegs { diff --git a/src/libultra/io/vimodempallan1.c b/src/libultra/io/vimodempallan1.c index 23d53987b0..bcc4273afb 100644 --- a/src/libultra/io/vimodempallan1.c +++ b/src/libultra/io/vimodempallan1.c @@ -16,15 +16,15 @@ OSViMode osViModeMpalLan1 = { { // comRegs VI_CTRL_TYPE_16 | VI_CTRL_GAMMA_DITHER_ON | VI_CTRL_GAMMA_ON | VI_CTRL_DIVOT_ON | VI_CTRL_ANTIALIAS_MODE_1 | - VI_CTRL_PIXEL_ADV(3), // ctrl - WIDTH(320), // width - BURST(57, 30, 5, 70), // burst - VSYNC(525), // vSync - HSYNC(3089, 4), // hSync - LEAP(3097, 3098), // leap - HSTART(108, 748), // hStart - SCALE(2, 0), // xScale - VCURRENT(0), // vCurrent + VI_CTRL_PIXEL_ADV_3, // ctrl + WIDTH(320), // width + BURST(57, 30, 5, 70), // burst + VSYNC(525), // vSync + HSYNC(3089, 4), // hSync + LEAP(3097, 3098), // leap + HSTART(108, 748), // hStart + SCALE(2, 0), // xScale + VCURRENT(0), // vCurrent }, { // fldRegs { diff --git a/src/libultra/io/vimodentsclan1.c b/src/libultra/io/vimodentsclan1.c index 19a7160ac8..a29d15129f 100644 --- a/src/libultra/io/vimodentsclan1.c +++ b/src/libultra/io/vimodentsclan1.c @@ -16,15 +16,15 @@ OSViMode osViModeNtscLan1 = { { // comRegs VI_CTRL_TYPE_16 | VI_CTRL_GAMMA_DITHER_ON | VI_CTRL_GAMMA_ON | VI_CTRL_DIVOT_ON | VI_CTRL_ANTIALIAS_MODE_1 | - VI_CTRL_PIXEL_ADV(3), // ctrl - WIDTH(320), // width - BURST(57, 34, 5, 62), // burst - VSYNC(525), // vSync - HSYNC(3093, 0), // hSync - LEAP(3093, 3093), // leap - HSTART(108, 748), // hStart - SCALE(2, 0), // xScale - VCURRENT(0), // vCurrent + VI_CTRL_PIXEL_ADV_3, // ctrl + WIDTH(320), // width + BURST(57, 34, 5, 62), // burst + VSYNC(525), // vSync + HSYNC(3093, 0), // hSync + LEAP(3093, 3093), // leap + HSTART(108, 748), // hStart + SCALE(2, 0), // xScale + VCURRENT(0), // vCurrent }, { // fldRegs { diff --git a/src/libultra/io/vimodepallan1.c b/src/libultra/io/vimodepallan1.c index 7a8db603f4..d656dc4f94 100644 --- a/src/libultra/io/vimodepallan1.c +++ b/src/libultra/io/vimodepallan1.c @@ -16,15 +16,15 @@ OSViMode osViModePalLan1 = { { // comRegs VI_CTRL_TYPE_16 | VI_CTRL_GAMMA_DITHER_ON | VI_CTRL_GAMMA_ON | VI_CTRL_DIVOT_ON | VI_CTRL_ANTIALIAS_MODE_1 | - VI_CTRL_PIXEL_ADV(3), // ctrl - WIDTH(320), // width - BURST(58, 30, 4, 69), // burst - VSYNC(625), // vSync - HSYNC(3177, 23), // hSync - LEAP(3183, 3181), // leap - HSTART(128, 768), // hStart - SCALE(2, 0), // xScale - VCURRENT(0), // vCurrent + VI_CTRL_PIXEL_ADV_3, // ctrl + WIDTH(320), // width + BURST(58, 30, 4, 69), // burst + VSYNC(625), // vSync + HSYNC(3177, 23), // hSync + LEAP(3183, 3181), // leap + HSTART(128, 768), // hStart + SCALE(2, 0), // xScale + VCURRENT(0), // vCurrent }, { // fldRegs { diff --git a/src/libultra/libc/absf.c b/src/libultra/libc/absf.c deleted file mode 100644 index 73c99f4602..0000000000 --- a/src/libultra/libc/absf.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "global.h" - -float absf(float n) { -#ifndef __GNUC__ - return fabsf(n); -#else - return __builtin_fabsf(n); -#endif -} diff --git a/src/libultra/libc/sqrt.c b/src/libultra/libc/sqrt.c deleted file mode 100644 index a9a4403a33..0000000000 --- a/src/libultra/libc/sqrt.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "global.h" - -double sqrt(double f) { -#ifndef __GNUC__ - return sqrt(f); -#else - return __builtin_sqrt(f); -#endif -} diff --git a/src/libultra/libc/xldtob.c b/src/libultra/libc/xldtob.c index 662561b4bf..a0ebe5d2d8 100644 --- a/src/libultra/libc/xldtob.c +++ b/src/libultra/libc/xldtob.c @@ -4,8 +4,8 @@ #define BUFF_LEN 0x20 -short _Ldunscale(short*, _Pft*); -void _Genld(_Pft*, char, char*, short, short); +static short _Ldunscale(short*, _Pft*); +static void _Genld(_Pft*, char, char*, short, short); static const double pows[] = { 10e0L, 10e1L, 10e3L, 10e7L, 10e15L, 10e31L, 10e63L, 10e127L, 10e255L }; @@ -156,7 +156,7 @@ void _Ldtob(_Pft* args, char code) { _Genld((_Pft*)args, code, ptr, nsig, exp); } -short _Ldunscale(short* pex, _Pft* px) { +static short _Ldunscale(short* pex, _Pft* px) { unsigned short* ps = (unsigned short*)px; short xchar = (ps[_D0] & _DMASK) >> _DOFF; @@ -176,7 +176,7 @@ short _Ldunscale(short* pex, _Pft* px) { } } -void _Genld(_Pft* px, char code, char* p, short nsig, short xexp) { +static void _Genld(_Pft* px, char code, char* p, short nsig, short xexp) { const char point = '.'; if (nsig <= 0) { diff --git a/src/libultra/libc/xprintf.c b/src/libultra/libc/xprintf.c index 9470e141fe..7fba40b4c4 100644 --- a/src/libultra/libc/xprintf.c +++ b/src/libultra/libc/xprintf.c @@ -40,7 +40,7 @@ char spaces[] = " "; char zeroes[] = "00000000000000000000000000000000"; -void _Putfld(_Pft*, va_list*, char, char*); +static void _Putfld(_Pft*, va_list*, char, char*); int _Printf(PrintCallback pfn, void* arg, const char* fmt, va_list ap) { _Pft x; @@ -121,7 +121,7 @@ int _Printf(PrintCallback pfn, void* arg, const char* fmt, va_list ap) { } } -void _Putfld(_Pft* px, va_list* pap, char code, char* ac) { +static void _Putfld(_Pft* px, va_list* pap, char code, char* ac) { px->n0 = px->nz0 = px->n1 = px->nz1 = px->n2 = px->nz2 = 0; switch (code) { diff --git a/src/libultra/os/exceptasm.s b/src/libultra/os/exceptasm.s index c815e1acc0..62e5814703 100644 --- a/src/libultra/os/exceptasm.s +++ b/src/libultra/os/exceptasm.s @@ -459,6 +459,13 @@ pi: andi $t1, $s1, MI_INTR_PI beqz $t1, dp nop +#if PLATFORM_N64 + // Clear interrupt and mask out pi interrupt + li $t1, PI_STATUS_CLR_INTR + lui $at, %hi(PHYS_TO_K1(PI_STATUS_REG)) + andi $s1, $s1, (MI_INTR_SP | MI_INTR_SI | MI_INTR_AI | MI_INTR_VI | MI_INTR_DP) + sw $t1, %lo(PHYS_TO_K1(PI_STATUS_REG))($at) +#else // Clear interrupt li $t1, PI_STATUS_CLR_INTR lui $at, %hi(PHYS_TO_K1(PI_STATUS_REG)) @@ -479,6 +486,7 @@ pi: // If the callback returns non-zero, don't post a pi event message bnez $v0, skip_pi_mesg nop +#endif no_pi_callback: // Post pi event message jal send_mesg @@ -863,10 +871,12 @@ LEAF(__osPopThread) sw $t9, ($a0) END(__osPopThread) +#if !PLATFORM_N64 LEAF(__osNop) jr $ra nop END(__osNop) +#endif #if ENABLE_PROFILER /** diff --git a/src/libultra/os/getintmask.s b/src/libultra/os/getintmask.s new file mode 100644 index 0000000000..2c6ddc86ed --- /dev/null +++ b/src/libultra/os/getintmask.s @@ -0,0 +1,60 @@ +#include "ultra64/asm.h" +#include "ultra64/R4300.h" +#include "ultra64/rcp.h" +#include "ultra64/exception.h" + +.set noat +.set noreorder + +.section .text + +.balign 16 + +/** + * OSIntMask osGetIntMask(void); + * + * Gets the interrupt enable mask for the current thread. + * Interrupts that are not enabled in the global interrupt mask __OSGlobalIntMask + * are not returned here. The global interrupt mask is OS-internal and is not + * expected to change during runtime. + * + * @bug Some usage of the global interrupt mask is broken both in the + * get/set interrupt mask routines and in the exception handler routines. + * See the comment for osSetIntMask for more details. + */ +LEAF(osGetIntMask) + // Extract interrupt enable bits from current SR + mfc0 $v0, C0_SR + andi $v0, $v0, (SR_IMASK | SR_IE) + // Get value of __OSGlobalIntMask + lui $t0, %hi(__OSGlobalIntMask) + addiu $t0, %lo(__OSGlobalIntMask) + lw $t1, 0($t0) + // Bitwise-OR in the disabled CPU bits of __OSGlobalIntMask + li $at, ~0 + xor $t0, $t1, $at + andi $t0, $t0, SR_IMASK + or $v0, $v0, $t0 + // Fetch MI_INTR_MASK_REG + lui $t1, %hi(PHYS_TO_K1(MI_INTR_MASK_REG)) + lw $t1, %lo(PHYS_TO_K1(MI_INTR_MASK_REG))($t1) + // If there are RCP interrupts masked + beqz $t1, 1f + // Get value of __OSGlobalIntMask + lui $t0, %hi(__OSGlobalIntMask) + addiu $t0, %lo(__OSGlobalIntMask) + lw $t0, 0($t0) + // Bitwise-OR in the disabled RCP bits of __OSGlobalIntMask + srl $t0, $t0, RCP_IMASKSHIFT + li $at, ~0 + xor $t0, $t0, $at + andi $t0, $t0, (RCP_IMASK >> RCP_IMASKSHIFT) + or $t1, $t1, $t0 +1: + // Shift the RCP bits to not conflict with the CPU bits + sll $t2, $t1, RCP_IMASKSHIFT + // OR the CPU and RCP bits together + or $v0, $v0, $t2 + jr $ra + nop +END(osGetIntMask) diff --git a/src/libultra/os/initialize.c b/src/libultra/os/initialize.c index 3266d1e4dd..e985d551d9 100644 --- a/src/libultra/os/initialize.c +++ b/src/libultra/os/initialize.c @@ -1,6 +1,6 @@ #include "global.h" -typedef struct { +typedef struct __osExceptionVector { u32 inst1; // lui $k0, %hi(__osException) u32 inst2; // addiu $k0, $k0, %lo(__osException) u32 inst3; // jr $k0 @@ -16,7 +16,19 @@ OSHWIntr __OSGlobalIntMask = OS_IM_ALL; u32 __osFinalrom; -void __createSpeedParam(void) { +#if PLATFORM_N64 + +#define OSINITIALIZE_FUNC osInitialize +#define SPEED_PARAM_FUNC createSpeedParam + +static void SPEED_PARAM_FUNC(void); + +#else + +#define OSINITIALIZE_FUNC __osInitialize_common +#define SPEED_PARAM_FUNC __createSpeedParam + +void SPEED_PARAM_FUNC(void) { __Dom1SpeedParam.type = DEVICE_TYPE_INIT; __Dom1SpeedParam.latency = IO_READ(PI_BSD_DOM1_LAT_REG); __Dom1SpeedParam.pulse = IO_READ(PI_BSD_DOM1_PWD_REG); @@ -30,13 +42,20 @@ void __createSpeedParam(void) { __Dom2SpeedParam.relDuration = IO_READ(PI_BSD_DOM2_RLS_REG); } -void __osInitialize_common(void) { +#endif + +void OSINITIALIZE_FUNC(void) { u32 pifdata; +#if PLATFORM_N64 + u32 clock = 0; +#endif __osFinalrom = true; __osSetSR(__osGetSR() | SR_CU1); __osSetFpcCsr(FPCSR_FS | FPCSR_EV); +#if !PLATFORM_N64 __osSetWatchLo(0x04900000); +#endif while (__osSiRawReadIo((void*)(PIF_RAM_END - 3), &pifdata)) { ; @@ -52,7 +71,7 @@ void __osInitialize_common(void) { osWritebackDCache((void*)K0BASE, E_VEC - K0BASE + sizeof(__osExceptionVector)); osInvalICache((void*)K0BASE, E_VEC - K0BASE + sizeof(__osExceptionVector)); - __createSpeedParam(); + SPEED_PARAM_FUNC(); osUnmapTLBAll(); osMapTLBRdb(); @@ -82,5 +101,21 @@ void __osInitialize_common(void) { IO_WRITE(AI_BITRATE_REG, AI_MAX_BIT_RATE - 1); } +#if PLATFORM_N64 +static void SPEED_PARAM_FUNC(void) { + __Dom1SpeedParam.type = DEVICE_TYPE_INIT; + __Dom1SpeedParam.latency = IO_READ(PI_BSD_DOM1_LAT_REG); + __Dom1SpeedParam.pulse = IO_READ(PI_BSD_DOM1_PWD_REG); + __Dom1SpeedParam.pageSize = IO_READ(PI_BSD_DOM1_PGS_REG); + __Dom1SpeedParam.relDuration = IO_READ(PI_BSD_DOM1_RLS_REG); + + __Dom2SpeedParam.type = DEVICE_TYPE_INIT; + __Dom2SpeedParam.latency = IO_READ(PI_BSD_DOM2_LAT_REG); + __Dom2SpeedParam.pulse = IO_READ(PI_BSD_DOM2_PWD_REG); + __Dom2SpeedParam.pageSize = IO_READ(PI_BSD_DOM2_PGS_REG); + __Dom2SpeedParam.relDuration = IO_READ(PI_BSD_DOM2_RLS_REG); +} +#else void __osInitialize_autodetect(void) { } +#endif diff --git a/src/libultra/os/setintmask.s b/src/libultra/os/setintmask.s index 3d2bc5b9c9..e48c1b376f 100644 --- a/src/libultra/os/setintmask.s +++ b/src/libultra/os/setintmask.s @@ -99,8 +99,8 @@ ENDDATA(__osRcpImTable) * The returned value is the previous interrupt enable mask so that it can be * restored later. * - * @bug Some usage of the global interrupt mask is broken both in here and in the - * exception handler routines. + * @bug Some usage of the global interrupt mask is broken both in the + * get/set interrupt mask routines and in the exception handler routines. * While a thread is running, the C0_SR interrupt enable bits contain the * interrupt enable bits for the current thread masked by the global * interrupt mask. There is an attempt to recover only the original interrupt diff --git a/src/libultra/os/settime.c b/src/libultra/os/settime.c new file mode 100644 index 0000000000..2be47ed9ed --- /dev/null +++ b/src/libultra/os/settime.c @@ -0,0 +1,5 @@ +#include "global.h" + +void osSetTime(OSTime time) { + __osCurrentTime = time; +} diff --git a/src/libultra/os/settimer.c b/src/libultra/os/settimer.c index 7775b987bf..40e1ba83be 100644 --- a/src/libultra/os/settimer.c +++ b/src/libultra/os/settimer.c @@ -1,11 +1,13 @@ #include "global.h" s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* mq, OSMesg msg) { - UNUSED OSTime time; + OSTime time; +#if !PLATFORM_N64 OSTimer* next; u32 count; u32 value; u32 prevInt; +#endif timer->next = NULL; timer->prev = NULL; @@ -19,6 +21,12 @@ s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* m timer->mq = mq; timer->msg = msg; +#if PLATFORM_N64 + time = __osInsertTimer(timer); + if (__osTimerList->next == timer) { + __osSetTimerIntr(time); + } +#else prevInt = __osDisableInt(); if (__osTimerList->next != __osTimerList) { if (1) {} @@ -38,6 +46,7 @@ s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* m __osSetTimerIntr(__osTimerList->next->value); __osRestoreInt(prevInt); +#endif return 0; } diff --git a/src/libultra/os/timerintr.c b/src/libultra/os/timerintr.c index 7e2e361388..943aca0ffc 100644 --- a/src/libultra/os/timerintr.c +++ b/src/libultra/os/timerintr.c @@ -63,9 +63,11 @@ void __osSetTimerIntr(OSTime time) { OSTime newTime; u32 prevInt; +#if !PLATFORM_N64 if (time < 468) { time = 468; } +#endif prevInt = __osDisableInt(); diff --git a/src/makerom/ipl3.s b/src/makerom/ipl3.s index be02f7e2fc..45f1c8e6f8 100644 --- a/src/makerom/ipl3.s +++ b/src/makerom/ipl3.s @@ -1,4 +1,4 @@ .section .text -.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0x40, 0xFC0 +.incbin "incbin/ipl3" diff --git a/src/makerom/rom_header.s b/src/makerom/rom_header.s index 29d1d2185c..a02462f8b8 100644 --- a/src/makerom/rom_header.s +++ b/src/makerom/rom_header.s @@ -1,23 +1,55 @@ #include "rom_header.h" +#include "region.h" +#include "versions.h" /* 0x00 */ ENDIAN_IDENTIFIER /* 0x01 */ PI_DOMAIN_1_CFG(64, 18, 7, 3) /* 0x04 */ SYSTEM_CLOCK_RATE_SETTING(0xF) /* 0x08 */ ENTRYPOINT(0x80000400) +#if PLATFORM_N64 +/* 0x0C */ LIBULTRA_VERSION(2, 0, I) +#else /* 0x0C */ LIBULTRA_VERSION(2, 0, L) +#endif /* 0x10 */ CHECKSUM() /* 0x18 */ PADDING(8) /* 0x20 */ ROM_NAME("THE LEGEND OF ZELDA") /* 0x34 */ PADDING(7) -#if (defined CONSOLE_WIIVC) || (defined CONSOLE_GC) +#if OOT_NTSC || ((defined CONSOLE_WIIVC) || (defined CONSOLE_GC)) /* 0x3B */ MEDIUM(CARTRIDGE_EXPANDABLE) -/* 0x3C */ GAME_ID("ZL") -/* 0x3E */ REGION(US) -/* 0x3F */ GAME_REVISION(0) #else /* 0x3B */ MEDIUM(CARTRIDGE) +#endif + /* 0x3C */ GAME_ID("ZL") + +#if (defined CONSOLE_WIIVC) || (defined CONSOLE_GC) +/* 0x3E */ REGION(US) +#else +#if OOT_REGION == REGION_NULL /* 0x3E */ REGION(FREE) +#elif OOT_REGION == REGION_US +/* 0x3E */ REGION(US) +#elif OOT_REGION == REGION_JP +/* 0x3E */ REGION(JP) +#elif OOT_REGION == REGION_EU +/* 0x3E */ REGION(PAL) +#endif +#endif + +#if (defined CONSOLE_WIIVC) || (defined CONSOLE_GC) +/* 0x3F */ GAME_REVISION(0) +#else + +#if OOT_VERSION == NTSC_1_0 || OOT_VERSION == PAL_1_0 +/* 0x3F */ GAME_REVISION(0) +#elif OOT_VERSION == NTSC_1_1 || OOT_VERSION == PAL_1_1 +/* 0x3F */ GAME_REVISION(1) +#elif OOT_VERSION == NTSC_1_2 +/* 0x3F */ GAME_REVISION(2) +#else /* 0x3F */ GAME_REVISION(15) -#endif \ No newline at end of file +#endif + +#endif diff --git a/src/n64dd/n64dd_801C8000.c b/src/n64dd/n64dd_801C8000.c new file mode 100644 index 0000000000..9b0a4b3adc --- /dev/null +++ b/src/n64dd/n64dd_801C8000.c @@ -0,0 +1,345 @@ +// Does some command processing +#include "global.h" +#include "n64dd.h" +#include "versions.h" + +void func_801C8554(void); +void func_801C8578(void* arg0, void* arg1, OSId id, void* sp, OSPri pri); +void func_801C8638(void (*arg0)(void*, void*, void*), s32 arg1, void (*arg2)(void*, uintptr_t, size_t)); +void func_801C868C(void* arg0, void* arg1, void* arg2, u8 arg3); +s8 func_801C8770(void); +s32 func_801C87C0(void); +s32 func_801C87FC(void); +s32 func_801C8844(void); +s32 func_801C885C(void); +s32 func_801C88AC(void); +s32 func_801C88FC(void); + +s32 D_801D2E60 = 0; +s32 D_801D2E64 = 0; + +typedef struct struct_801D2E68 { + /* 0x0 */ void (*unk_0)(struct_801E0D18*); + /* 0x4 */ s32 (*unk_4)(struct_801E0D18*); +} struct_801D2E68; // size = 0x8 + +struct_801D2E68 D_801D2E68[5] = { + { func_801C81EC, func_801C91E0 }, { func_801C832C, func_801C9260 }, { func_801C83A0, func_801C9260 }, + { func_801C8414, func_801C9334 }, { func_801C8414, func_801C93C4 }, +}; + +s32 D_801D2E90 = 0; + +OSMesgQueue* B_801E0D10[2]; +struct_801E0D18 B_801E0D18; +OSMesg B_801E0D88[1]; +OSMesg B_801E0D90[8]; +OSThread B_801E0DB0; + +s32 func_801C8000(struct_801D9D50* arg0) { + switch (arg0->unk_00) { + case 0: + if (func_801C8844() != 0) { + return 1; + } + func_801C8554(); + break; + case 1: + func_801C8578(arg0->unk_1C, arg0->unk_20, arg0->unk_24, arg0->unk_28, arg0->unk_2C); + break; + case 2: + func_801C8638(arg0->unk_0C, arg0->unk_10, arg0->unk_14); + break; + case 3: + if (func_801C8844() != 0) { + return 1; + } + func_801C868C(arg0->unk_18, arg0->unk_1C, arg0->unk_20, 1); + break; + case 4: + if (func_801C8844() != 0) { + return 1; + } + func_801C868C(arg0->unk_18, arg0->unk_1C, arg0->unk_20, 2); + break; + case 5: + arg0->unk_08 = func_801C8770(); + return arg0->unk_08; + case 7: + return func_801C87FC(); + case 6: + return func_801C8844(); + case 8: + arg0->unk_04 = func_801C87C0(); + return arg0->unk_04; + case 9: + return func_801C885C(); + case 10: + return func_801C88AC(); + case 11: + return func_801C88FC(); + case 12: + D_801D2EA0 = 0; + break; + case 13: + D_801D2EA0 = 1; + break; + } + return 0; +} + +void func_801C819C(UNK_TYPE arg0) { + if (arg0 != 0) { + D_801D2E60 = 1; + } else { + D_801D2E60 = 2; + } +} + +s32 func_801C81C4(void) { + return D_801D2E60; +} + +s32 func_801C81D4(void) { + return D_801D2E64 == 1; +} + +void func_801C81EC(struct_801E0D18* arg0) { + osCreateMesgQueue(&arg0->unk_1C, B_801E0D88, ARRAY_COUNT(B_801E0D88)); + + if (gCurrentRegion == 1) { + arg0->unk_68 = LeoCJCreateLeoManager(LEO_PRIORITY_WRK, LEO_PRIORITY_INT, B_801E0D90, ARRAY_COUNT(B_801E0D90)); + } else { + arg0->unk_68 = LeoCACreateLeoManager(LEO_PRIORITY_WRK, LEO_PRIORITY_INT, B_801E0D90, ARRAY_COUNT(B_801E0D90)); + } + + if ((arg0->unk_68 == LEO_ERROR_DEVICE_COMMUNICATION_FAILURE) || (arg0->unk_68 == LEO_ERROR_GOOD)) { + D_801D2E64 = 1; + } +} + +void func_801C8298(struct_801E0D18* arg0) { + LEOCmd sp1C; + + // TODO: passing a pointer as a logical block address? + LeoSeek(&sp1C, (u32)&arg0->diskId, &arg0->unk_1C); + osRecvMesg(&arg0->unk_1C, (OSMesg*)&arg0->unk_68, OS_MESG_BLOCK); +} + +void func_801C82E0(struct_801E0D18* arg0) { + LEOCmd sp1C; + + LeoSpdlMotor(&sp1C, 4, &arg0->unk_1C); + osRecvMesg(&arg0->unk_1C, (OSMesg*)&arg0->unk_68, OS_MESG_BLOCK); +} + +void func_801C832C(struct_801E0D18* arg0) { + s32 sp34; + s32 startLBA = arg0->unk_5C; + + if (LeoByteToLBA(startLBA, arg0->unk_60, &sp34) == LEO_ERROR_GOOD) { + OSMesgQueue* sp28 = &arg0->unk_1C; + + LeoReadWrite(&arg0->unk_00, OS_READ, startLBA, (void*)arg0->unk_58, sp34, sp28); + osRecvMesg(sp28, (OSMesg*)&arg0->unk_68, OS_MESG_BLOCK); + } +} + +void func_801C83A0(struct_801E0D18* arg0) { + s32 sp34; + s32 startLBA = arg0->unk_58; + + if (LeoByteToLBA(startLBA, arg0->unk_60, &sp34) == LEO_ERROR_GOOD) { + OSMesgQueue* sp28 = &arg0->unk_1C; + + LeoReadWrite(&arg0->unk_00, OS_WRITE, startLBA, (void*)arg0->unk_5C, sp34, sp28); + osRecvMesg(sp28, (OSMesg*)&arg0->unk_68, OS_MESG_BLOCK); + } +} + +void func_801C8414(struct_801E0D18* arg0) { + arg0->unk_68 = 9; +} + +void func_801C8424(struct_801E0D18* arg0) { + struct_801D2E68* temp_v0; + s32 (*temp_s2)(struct_801E0D18*); + void (*aux)(struct_801E0D18*); + s32 temp_v0_2; + + arg0->unk_68 = -1; + if ((func_801C81D4() != 0) || (arg0->unk_64 == 0)) { + arg0->unk_66 = 1; + temp_v0 = &D_801D2E68[arg0->unk_64]; + aux = temp_v0->unk_0; + temp_s2 = temp_v0->unk_4; + do { + aux(arg0); + temp_v0_2 = temp_s2(arg0); + } while (temp_v0_2 == 2); + arg0->unk_6C = temp_v0_2; + if (arg0->unk_64 == 0) { + func_801C819C(temp_v0_2); + } + arg0->unk_66 = 0; + } +} + +void func_801C84D4(void* arg) { + while (true) { + struct_801E0D18* sp24; + + osRecvMesg(B_801E0D10[0], (OSMesg*)&sp24, OS_MESG_BLOCK); + func_801C8424(sp24); + osSendMesg(B_801E0D10[1], NULL, OS_MESG_BLOCK); + } +} + +void func_801C8554(void) { + osDestroyThread(&B_801E0DB0); +} + +void func_801C8578(void* arg0, void* arg1, OSId id, void* sp, OSPri pri) { + B_801E0D10[0] = (OSMesgQueue*)arg0; + B_801E0D10[1] = (OSMesgQueue*)arg1; + osCreateThread(&B_801E0DB0, id, &func_801C84D4, NULL, sp, pri); + osStartThread(&B_801E0DB0); +} + +void func_801C85F0(struct_801E0D18* arg0, s32 arg1) { + if (arg1 == 1) { + func_801C8424(arg0); + } else { + osSendMesg(B_801E0D10[0], arg0, OS_MESG_BLOCK); + } +} + +void func_801C8638(void (*arg0)(void*, void*, void*), s32 arg1, void (*arg2)(void*, uintptr_t, size_t)) { + s32 var0 = 0; + + func_801C9B50(arg1, arg2); + D_801D2EB4 = arg0; + B_801E0D18.unk_64 = var0; + B_801E0D18.unk_65 = var0; + func_801C85F0(&B_801E0D18, 0); +} + +void func_801C868C(void* arg0, void* arg1, void* arg2, u8 arg3) { + s32 var0 = (s32)arg0; + s32 var1 = (s32)arg1; + s32 var2 = (s32)arg2; + s32 var3 = arg3; + s32 var4 = 4; + + if (D_801D2E90 == 1) { + D_801D2E90 = 0; + B_801E0D18.unk_64 = var4; + func_801C85F0(&B_801E0D18, 1); + if (B_801E0D18.unk_6C == 3 || B_801E0D18.unk_6C == 4) { + return; + } + } + + B_801E0D18.unk_58 = var0; + B_801E0D18.unk_5C = var1; + B_801E0D18.unk_60 = var2; + B_801E0D18.unk_64 = var3; + func_801C85F0(&B_801E0D18, 0); +} + +s32 func_801C873C(struct_801E0D18* arg0) { + u8 sp1F; + + arg0->unk_68 = LeoTestUnitReady(&sp1F); + return !(sp1F & LEO_TEST_UNIT_MR); +} + +s8 func_801C8770(void) { + s32 temp = func_801C873C(&B_801E0D18); + + if (B_801E0D18.unk_68 == LEO_ERROR_BUSY) { + return 0; + } + + if (!temp) { + return 2; + } + + return 1; +} + +s32 func_801C87C0(void) { + if (func_801C8844() == 0) { + if (B_801E0D18.unk_68 != 0) { + return B_801E0D18.unk_68; + } + } + + return -1; +} + +s32 func_801C87FC(void) { + s32* new_var = &B_801E0D18.unk_68; + s32 temp_v0; + + if (func_801C8844() == 0) { + temp_v0 = B_801E0D18.unk_6C; + + if ((temp_v0 == 3) || (temp_v0 == 4)) { + return *new_var; + } + } + + return 0; +} + +s32 func_801C8844(void) { + return B_801E0D18.unk_66 == 1; +} + +s32 func_801C885C(void) { + B_801E0D18.unk_64 = 3; + func_801C85F0(&B_801E0D18, 1); + +#if OOT_VERSION >= NTSC_1_1 + D_801D2E90 = 0; +#endif + + if ((B_801E0D18.unk_6C == 3) || (B_801E0D18.unk_6C == 4)) { + return -1; + } + return B_801E0D18.unk_6C == 0; +} + +s32 func_801C88AC(void) { + s32 phi_v0; + + B_801E0D18.unk_64 = 4; + func_801C85F0(&B_801E0D18, 1); + +#if OOT_VERSION >= NTSC_1_1 + D_801D2E90 = 0; +#endif + + if ((B_801E0D18.unk_6C == 3) || (B_801E0D18.unk_6C == 4)) { + return -1; + } + return B_801E0D18.unk_6C == 0; +} + +s32 func_801C88FC(void) { + s32 temp = 0; + s32 phi_v1; + + if (LeoDriveExist()) { + phi_v1 = 8; + } else { + phi_v1 = 0; + } + + temp = phi_v1 == temp; + + B_801E0D18.unk_68 = phi_v1; + + return temp; +} diff --git a/src/n64dd/n64dd_801C8940.c b/src/n64dd/n64dd_801C8940.c new file mode 100644 index 0000000000..437a23dcf2 --- /dev/null +++ b/src/n64dd/n64dd_801C8940.c @@ -0,0 +1,398 @@ +// Lower-level command processing in a background thread +#include "global.h" +#include "n64dd.h" + +s32 D_801D2EA0 = 0; +u8* D_801D2EA4 = NULL; +s32 D_801D2EA8 = 0; +u8* D_801D2EAC = NULL; +u8* D_801D2EB0 = NULL; +void (*D_801D2EB4)(void*, void*, void*) = NULL; + +s32 B_801E0F60; +s32 B_801E0F64; + +// Set error message title texture? +void func_801C8940(s32 errorNum) { + D_801D2EA4 = func_801C9E28(errorNum); + D_801D2EA8 = 1; +} + +// Clear error message title texture? +void func_801C8974(void) { + if (D_801D2EA8 == 1) { + D_801D2EA4 = func_801C9EC0(); + D_801D2EA8 = 0; + } +} + +// Set error message something +void func_801C89B8(s32 errorNum) { + D_801D2EAC = func_801C9F90(errorNum); + B_801E0F60 = 1; +} + +// Clear error message something +void func_801C89EC(void) { + if (B_801E0F60 == 1) { + D_801D2EAC = func_801C9FFC(); + B_801E0F60 = 0; + } +} + +// Set error message something +void func_801C8A30(s32 errorNum) { + D_801D2EB0 = func_801CA030(errorNum); + B_801E0F64 = 1; +} + +// Clear error message something +void func_801C8A64(void) { + if (B_801E0F64 == 1) { + D_801D2EB0 = func_801CA070(); + B_801E0F64 = 0; + } +} + +void func_801C8AA8(void) { + osRecvMesg(B_801E0D10[1], NULL, OS_MESG_NOBLOCK); + + if ((D_801D2EB4 != NULL) && (D_801D2EA0 == 0)) { + u32 temp_v0 = osSetIntMask(OS_IM_NONE); + void* sp20 = D_801D2EA4; + void* sp1C = D_801D2EAC; + void* sp18 = D_801D2EB0; + + D_801D2EA4 = NULL; + D_801D2EAC = NULL; + D_801D2EB0 = NULL; + osSetIntMask(temp_v0); + D_801D2EB4(sp20, sp1C, sp18); + } +} + +void func_801C8B58(s32 arg0, s32 arg1, s32 arg2) { + func_801C8940(arg0); + func_801C89B8(arg1); + func_801C8A30(arg2); +} + +void func_801C8B90(void) { + func_801C8974(); + func_801C89EC(); + func_801C8A64(); +} + +s32 func_801C8BC0(struct_801E0D18* arg0) { + if ((arg0->unk_68 < 0x25) || (arg0->unk_68 >= 0x29)) { + if ((arg0->unk_68 != 0x1F) && (arg0->unk_68 != 0x20)) { + func_801C8940(arg0->unk_68); + func_801C89B8(3); + } + } + LeoClearQueue(); + return 4; +} + +s32 func_801C8C1C(struct_801E0D18* arg0) { + s32 var_s0; + + do { + var_s0 = 0; + Sleep_Msec(60); + func_801C82E0(arg0); + + switch (arg0->unk_68) { + case 0x2A: + func_801C8A64(); + return 0; + case 0x22: + func_801C8A64(); + LeoClearQueue(); + return 3; + case 0: + func_801C8A30(6); + FALLTHROUGH; + case 0x23: + var_s0 = 1; + break; + } + } while (var_s0 != 0); + + func_801C8A64(); + return func_801C8BC0(arg0); +} + +s32 func_801C8CEC(struct_801E0D18* arg0) { + switch (arg0->unk_68) { + case 0x22: + func_801C8B90(); + LeoClearQueue(); + return 3; + case 0x2: + func_801C8940(arg0->unk_68); + func_801C8A30(5); + return 9; + case 0x0: + func_801C8B90(); + return 0; + case 0x2B: + if (arg0->unk_65 == 0) { + func_801C8B90(); + arg0->unk_65 = 2; + return 1; + } + FALLTHROUGH; + default: + func_801C8B90(); + return func_801C8BC0(arg0); + case 0x23: + return 9; + } +} + +s32 func_801C8DC0(struct_801E0D18* arg0) { + s32 temp_v0; + + while (true) { + func_801C8298(arg0); + switch (arg0->unk_68) { + case 0x31: + func_801C8940(arg0->unk_68); + func_801C89B8(2); + return 5; + case 0x2A: + func_801C8B90(); + return 5; + } + temp_v0 = func_801C8CEC(arg0); + if (temp_v0 != 9) { + return temp_v0; + } + Sleep_Msec(60); + } +} + +s32 func_801C8E70(struct_801E0D18* arg0) { + s32 temp_a0; + s32 temp_v0; + + while (true) { + Sleep_Msec(60); + func_801C8298(arg0); + + switch (arg0->unk_68) { + case 0x23: + continue; + case 0x31: + func_801C8940(arg0->unk_68); + func_801C89B8(2); + FALLTHROUGH; + case 0x2A: + func_801C8A30(4); + continue; + } + + temp_v0 = func_801C8CEC(arg0); + if (temp_v0 != 9) { + return temp_v0; + } + } +} + +s32 func_801C8F1C(struct_801E0D18* arg0) { + if (D_801D2E54 != NULL) { + return D_801D2E54(arg0); + } + return 1; +} + +s32 func_801C8F58(struct_801E0D18* arg0) { + s32 temp_v0; + + while (true) { + temp_v0 = func_801C8E70(arg0); + if (temp_v0 == 3 || temp_v0 == 4) { + return temp_v0; + } + + // Fake match? + if ((temp_v0 & 0xFFFFFFFF) == 0) { + if (func_801C8F1C(arg0) != 0) { + return 2; + } + func_801C89B8(1); + temp_v0 = func_801C8C1C(arg0); + if (temp_v0 != 0) { + return temp_v0; + } + func_801C89EC(); + } + } +} + +s32 func_801C9000(struct_801E0D18* arg0) { + s32 phi_s0; + s32 temp_s4; + + while (true) { + phi_s0 = func_801C8E70(arg0); + if (phi_s0 == 3 || phi_s0 == 4) { + return phi_s0; + } + + // Fake match? + if ((phi_s0 & 0xFFFFFFFF) == 0) { + func_801C8B90(); + + temp_s4 = func_801C8F1C(arg0); + if (temp_s4 == 3 || temp_s4 == 4) {} + if (temp_s4 != 0) { + return 2; + } + + func_801C89B8(1); + + phi_s0 = func_801C8C1C(arg0); + if (phi_s0 == 3 || phi_s0 == 4) {} + if (phi_s0 != 0) { + return phi_s0; + } + + func_801C89EC(); + if (temp_s4 != 0) { + return phi_s0; + } + } + } +} + +s32 func_801C90C4(struct_801E0D18* arg0) { + func_801C8940(arg0->unk_68); + func_801C89B8(2); + return func_801C9000(arg0); +} + +s32 func_801C90FC(struct_801E0D18* arg0) { + func_801C8940(arg0->unk_68); + return func_801C9000(arg0); +} + +s32 func_801C912C(struct_801E0D18* arg0) { + s32 i = 0; + s32 temp_v0; + + do { + LeoResetClear(); + + temp_v0 = func_801C8DC0(arg0); + if (temp_v0 == 3 || temp_v0 == 4) { + return temp_v0; + } + if (temp_v0 != 1) { + if (temp_v0 == 0) { + return temp_v0; + } else { + return temp_v0; + } + } + + Sleep_Msec(250); + } while (i++ < 30); + + return func_801C8BC0(arg0); +} + +s32 func_801C91E0(struct_801E0D18* arg0) { + if (arg0->unk_68 == 0x29) { + return func_801C8BC0(arg0); + } + + if (osMemSize < 0x800000) { + // LEO_ERROR_RAMPACK_NOT_CONNECTED? + func_801C8B58(0x2C, 0, 3); + return 4; + } + + if (func_801C912C(arg0) == 0) { + D_801D2E90 = 1; + } + return 0; +} + +s32 func_801C9260(struct_801E0D18* arg0) { + s32 temp_v0; + + switch (arg0->unk_68) { + case 0x17: + func_801C873C(arg0); + temp_v0 = func_801C8C1C(arg0); + if (temp_v0 != 0) { + return temp_v0; + } + func_801C8B90(); + return 2; + + case 0x2: + return func_801C8F58(arg0); + + case 0x22: + LeoClearQueue(); + return 3; + + case 0x31: + return func_801C90C4(arg0); + + case 0x2F: + return func_801C9000(arg0); + + case 0x2A: + return func_801C90FC(arg0); + + case 0x0: + return 0; + + case 0x23: + return 2; + } + + return func_801C8BC0(arg0); +} + +s32 func_801C9334(struct_801E0D18* arg0) { + while (true) { + u32 temp_v0 = func_801C8DC0(arg0); + + if (temp_v0 == 3 || temp_v0 == 4 || temp_v0 == 5) { + return temp_v0; + } + + // Fake match? + if ((temp_v0 & 0xFFFFFFFF) == 0) { + if (func_801C8F1C(arg0) != 0) { + return 0; + } + return 7; + } + + if (1) {} + } +} + +s32 func_801C93C4(struct_801E0D18* arg0) { + s32 temp_v0; + s32 temp_v0_2; + + while (true) { + temp_v0_2 = func_801C9334(arg0); + if (temp_v0_2 != 7) { + return temp_v0_2; + } + func_801C89B8(1); + temp_v0 = func_801C8C1C(arg0); + if (temp_v0 != 0) { + return temp_v0; + } + func_801C89EC(); + } +} diff --git a/src/n64dd/n64dd_801C9440.c b/src/n64dd/n64dd_801C9440.c new file mode 100644 index 0000000000..2d0b1b5c01 --- /dev/null +++ b/src/n64dd/n64dd_801C9440.c @@ -0,0 +1,264 @@ +// Some text-handling functions +#include "global.h" +#include "n64dd.h" +#include "versions.h" + +void (*D_801D2EC0)(void*, uintptr_t, size_t) = NULL; + +s32 B_801E0F70; + +/** + * Seems to work out if a pair of bytes is a valid EUC-JP character, although there may be additions to the font that + * make the strange first check make more sense. + * + * @param bytes Array 2 bytes to test + * @return boolean + */ +int func_801C9440(u8* bytes) { + // This is every possible first byte. May make more sense what was intended with the font files? + if (((*bytes >= 0x8E) && (*bytes <= 0xFE)) || ((*bytes != 0x8F) && (*bytes != 0xA0))) { + bytes++; + return (*bytes >= 0xA0) && (*bytes <= 0xFE); + } + return false; +} + +/** + * A crude check for a valid 2-byte Shift-JIS character + * + * @param bytes Array containing a pair of bytes to test + * @return boolean + */ +int func_801C9494(u8* bytes) { + // Allowable first bytes. + if (((*bytes >= 0x81) && (*bytes <= 0x9F)) || ((*bytes >= 0xE0) && (*bytes <= 0xFC))) { + bytes++; + // Allowable second bytes. + return (*bytes >= 0x40) && (*bytes <= 0xFC) && *bytes != 0x7F; + } + return false; +} + +// Extracts 2 bytes from a bytepacked big-endian short. +void func_801C94F8(u8* arg0, u16 arg1) { + arg0[0] = arg1 >> 8; + arg0[1] = arg1 & 0xFF; +} + +// Convert EUC-JP to JIS X 0208 +u16 func_801C9514(u16 eucjpCh) { + return eucjpCh - 0x8080; +} + +/** + * Converts a JIS X 0208 codepoint to a Shift-JIS one. + * + * @param jisCodepoint Two bytes, each between 0x21 and 0x7E, packed big-endian into a short. + * @return u16 Shift-JIS character representation (expected to be big-endian) + */ +u16 func_801C9534(u16 jisCodepoint) { + u8 hiByte = (jisCodepoint >> 8) & 0xFF; + u8 loByte = jisCodepoint & 0xFF; + + if (hiByte & 1) { + loByte += 0x1F; + if (loByte >= 0x7F) { + loByte++; + } + } else { + loByte += 0x7E; + } + + hiByte = (hiByte - 0x21) / 2 + 0x81; + if (hiByte >= 0xA0) { + hiByte += 0x40; + } + + return (hiByte << 8) + loByte; +} + +void func_801C95C0(void* arg0, uintptr_t arg1, size_t arg2) { + if (D_801D2EC0 != NULL) { + D_801D2EC0(arg0, arg1, arg2); + } +} + +s32 func_801C95F0(u8* arg0) { + return LeoGetKAdr(func_801C9534(func_801C9514((arg0[0] << 8) | arg0[1]))) + DDROM_FONT_START; +} + +s32 func_801C963C(s32* arg0, int* dx, int* dy, int* cy, u8 arg4) { + s32 temp_v0; + s32 temp_v1; + + u16 temp = arg4 - 0x20; + temp += 0xC0 * B_801E0F70; + + temp_v0 = LeoGetAAdr(temp, dx, dy, cy); + temp_v1 = temp_v0 & 0xF; + *arg0 = (temp_v0 - temp_v1) + DDROM_FONT_START; + return temp_v1; +} + +s32 func_801C969C(void* arg0, int* dx, int* dy, int* cy, u8* arg4) { + s32 sp24; + s32 phi_v1; + + if (func_801C9440(arg4)) { + sp24 = func_801C95F0(arg4); + *dx = 16; + *dy = 16; + *cy = 11; + phi_v1 = 0; + } else { + phi_v1 = func_801C963C(&sp24, dx, dy, cy, *arg4); + } + + func_801C95C0(arg0, sp24, 0x80); + return phi_v1; +} + +// return boolean +s32 func_801C9740(u8* arg0, s32 arg1, u8 arg2) { + if (arg1 == 1) { + *arg0 = arg2 << 4; + return false; + } else { + *arg0 |= arg2; + return true; + } +} + +u8* func_801C9778(u8* arg0, s32* arg1, s32 arg2) { + arg0 += (arg2 >> 1); + + if (((*arg1 == 1) && !(arg2 & 1)) || ((*arg1 == 0) && (arg2 & 1))) { + arg0 += arg2 & 1; + *arg1 = 1; + } else { + *arg1 = 0; + } + return arg0; +} + +s32 func_801C97C4(u8** arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, u8* arg5, s32 dx, s32 dy, s32 cy) { + u8* var_fp; + u8* var_s0; + s32 var_s1; + s32 x; + s32 sp4C; + s32 var_s4; + s32 sp44; + + sp4C = arg2; + sp44 = dx + arg3 + arg4; + var_s4 = 1; + var_fp = func_801C9778(*arg0, &sp4C, arg3); + arg1 >>= 1; + var_fp += ((11 - cy) * arg1); + if (dx & 1) { + dx++; + } + while (dy--) { + var_s0 = var_fp; + var_s1 = sp4C; + for (x = 0; x < dx; x++) { + if (var_s4 == 1) { + if (func_801C9740(var_s0, var_s1, *arg5 >> 4)) { + var_s0++; + } + } else { + if (func_801C9740(var_s0, var_s1, *arg5 & 0xF)) { + var_s0++; + } + arg5++; + } + var_s4 ^= 1; + var_s1 ^= 1; + } + var_fp += arg1; + } + *arg0 = func_801C9778(*arg0, &arg2, sp44); + return arg2; +} + +void func_801C9954(u8* bytes, s32* arg1, s32* arg2) { + u8 prevCh; + u8 nextCh; + + if (func_801C9440(bytes)) { + *arg1 = *arg2 = 0; + return; + } + + *arg1 = *arg2 = 0; + + prevCh = bytes[-1]; + nextCh = bytes[1]; + + switch (bytes[0]) { + case ' ': + *arg1 = *arg2 = 0; + return; + + case 'I': + case 'i': +#if OOT_NTSC + *arg2 = 2; + if (1) {} +#endif + + *arg1 = 2; + *arg2 = 2; + + if (prevCh == ' ') { + *arg1 = 0; + } + if (nextCh == ' ') { + *arg2 = 0; + } + return; + } + +#if OOT_NTSC + *arg2 = 1; + if (1) {} +#endif + + *arg1 = 1; + *arg2 = 1; +} + +void func_801C9A10(u8* arg0, s32 arg1, u8* str) { + u8 sp80[0xA0]; + u8* temp_s1; + int dx; + int dy; + int cy; + s32 var_s2; + s32 sp68; + s32 sp64; + s32 temp_v1; + + temp_s1 = (u8*)((((uintptr_t)&sp80 + 0xF) / 0x10) * 0x10); + var_s2 = 1; + if (str != NULL) { + while (*str != '\0') { + func_801C9954(str, &sp68, &sp64); + temp_v1 = func_801C969C(temp_s1, &dx, &dy, &cy, str); + if (dx & 1) { + dx++; + } + var_s2 = func_801C97C4(&arg0, arg1, var_s2, sp68, sp64, &temp_s1[temp_v1], dx, dy, cy); + if (func_801C9440(str)) { + str++; + } + str++; + } + } +} + +void func_801C9B50(s32 arg0, void (*arg1)(void*, uintptr_t, size_t)) { + B_801E0F70 = arg0; + D_801D2EC0 = arg1; +} diff --git a/src/n64dd/n64dd_801C9B70.c b/src/n64dd/n64dd_801C9B70.c new file mode 100644 index 0000000000..d7d2f63849 --- /dev/null +++ b/src/n64dd/n64dd_801C9B70.c @@ -0,0 +1,172 @@ +// User-facing error handling +#include "global.h" +#include "n64dd.h" + +u8 B_801E0F80[0x600]; +u8 B_801E1580[0x2800]; +u8 B_801E3D80[0x1400]; + +/** + * Converts a number in decimal to a hexadecimal number with the same digits, e.g. 1234 -> 0x1234. + * + * Will only work on nonnegative numbers. + * + * @param decNumber Number in decimal to convert, e.g. 1234 + * @return s32 Hexadecimal number with the same digits as decNumber, e.g. 0x1234 + */ +s32 func_801C9B70(s32 decNumber) { + s32 currPlaceValue; + s32 currExponent = 0; + s32 accumulatedHexDigits = 0; + s32 remainingDecDigits; + + // Nothing to do if only one digit. + if (decNumber < 10) { + return decNumber; + } + + // Find the place value / exponent of the most significant digit in decNumber. + for (currPlaceValue = 1; 10 * currPlaceValue <= decNumber; currPlaceValue *= 10) { + currExponent++; + } + + remainingDecDigits = decNumber; + + // Transfer the digits to hex one at a time. + while (currExponent--) { + // Place the most significant remaining digit at the end of the hex output. + accumulatedHexDigits |= remainingDecDigits / currPlaceValue; + accumulatedHexDigits *= 0x10; // Shift left one hex digit. + + remainingDecDigits %= currPlaceValue; // Remove most significant of the remaining digits. + + currPlaceValue /= 10; + } + + accumulatedHexDigits += remainingDecDigits; // Only one digit left in the remainingDecDigits. + return accumulatedHexDigits; +} + +// n64ddError_GetLanguage +s32 func_801C9C48(void) { + return (gCurrentRegion == 1) ? 0 : 1; +} + +// n64ddError_Memset +void func_801C9C74(u8* dest, u8 value, u32 count) { + while (count--) { + *dest++ = value; + } +} + +// n64ddError_GetErrorHeader +const char* func_801C9CA4(void) { + return D_801D2ED0[func_801C9C48()]; +} + +// n64ddError_WriteNumberJP +// Writes a 2-digit number to the char buffer provided +// Character indices for numbers in the error code (EUC-JP) +void func_801C9CD4(u8* buf, s32 number) { + s32 temp_v0 = func_801C9B70(number); + u16 character; + + if (number >= 10) { + character = ((temp_v0 >> 4) + 0xA3B0); // '0' + } else { + character = 0xA1A1; // ' ' + } + + func_801C94F8(buf, character); + buf += 2; + func_801C94F8(buf, ((temp_v0 & 0xF) + 0xA3B0)); // '0' +} + +// n64ddError_WriteNumberEN +// Writes a 2-digit number to the char buffer provided +// Character indices for numbers in the error code (ASCII) +void func_801C9D54(u8* buf, s32 number) { + s32 temp_v0 = func_801C9B70(number); + + if (number >= 10) { + *buf = (temp_v0 >> 4) + '0'; + } else { + *buf = ' '; + } + buf++; + *buf = (temp_v0 & 0xF) + '0'; +} + +void func_801C9DB8(u8* arg0, s32 errorNum) { + u8* errorHeader = (u8*)func_801C9CA4(); + + //! @bug: both of these functions will write to the pointer target, but errorHeader points to a string literal, + //! which is meant to be const. + if (gCurrentRegion == 1) { + func_801C9CD4(&errorHeader[12], errorNum); + } else { + func_801C9D54(&errorHeader[13], errorNum); + } + func_801C9A10(arg0, 192, errorHeader); +} + +u8* func_801C9E28(s32 errorNum) { + func_801C9EC0(); + + if (errorNum == 41) { + return (u8*)gN64DDError41Texs[func_801C9C48()]; + } + + // 31,32, 37,38,39,40 + if (((errorNum >= 37) && (errorNum < 41)) || (errorNum == 31) || (errorNum == 32)) { + return B_801E0F80; + } else { + func_801C9DB8(B_801E0F80, errorNum); + return B_801E0F80; + } +} + +// Clear something +u8* func_801C9EC0(void) { + func_801C9C74(B_801E0F80, 0, 0x600); + return B_801E0F80; +} + +// Prints the error message body (?) +void func_801C9EF4(u8* arg0, s32 errorNum, s32 lineCount) { + s32 i; + + for (i = 0; i < lineCount; i++, arg0 += 0xA00) { + u8* line = (u8*)D_801D2EE0[func_801C9C48()][errorNum][i]; + + if (1) {} + func_801C9A10(arg0, 320, line); + } +} + +u8* func_801C9F90(s32 errorNum) { + func_801C9FFC(); + if (errorNum == 3) { + return (u8*)gN64DDPleaseReadManualTexs[func_801C9C48()]; + } + func_801C9EF4(B_801E1580, errorNum, 4); + return B_801E1580; +} + +// Clear something +u8* func_801C9FFC(void) { + func_801C9C74(B_801E1580, 0, 0x2800); + return B_801E1580; +} + +u8* func_801CA030(s32 errorNum) { + func_801CA070(); + func_801C9EF4(B_801E3D80, errorNum, 2); + return B_801E3D80; +} + +// Clear something +u8* func_801CA070(void) { + func_801C9C74(B_801E3D80, 0, 0x1400); + return B_801E3D80; +} diff --git a/src/n64dd/n64dd_801CA0B0.c b/src/n64dd/n64dd_801CA0B0.c new file mode 100644 index 0000000000..8758e0fd62 --- /dev/null +++ b/src/n64dd/n64dd_801CA0B0.c @@ -0,0 +1,243 @@ +#include "global.h" +#include "n64dd.h" + +// Draws text to framebuffer +typedef struct struct_801CA704 { + /* 0x00 */ PrintCallback callback; + /* 0x04 */ void* charTexBuf; + /* 0x08 */ u16 unk_08; + /* 0x0A */ u16 posX; + /* 0x0C */ u16 posY; + /* 0x10 */ Color_RGBA8_u32 color; + /* 0x14 */ u16 baseX; + /* 0x16 */ u16 baseY; + /* 0x18 */ u16 endX; + /* 0x1A */ u16 endY; + /* 0x1C */ u8 sjisPrevByte; + /* 0x20 */ void* frameBuf; + /* 0x24 */ u16 screenWidth; + /* 0x26 */ u16 screenHeight; +} struct_801CA704; + +// clang-format off +u32 D_801D8BE0[0x5F] = { + 0x00009D14, 0x00232A14, 0x00296314, 0x002F8A14, 0x00457E18, 0x0063CA14, 0x0084AA14, 0x00A03314, + 0x00A45E14, 0x00BB4E14, 0x00CA6514, 0x00D3770E, 0x00E33302, 0x00E78108, 0x00EB2102, 0x00EC6C14, + 0x01008A14, 0x01163A14, 0x01217A14, 0x01377A14, 0x014D8A14, 0x01638A14, 0x01798A14, 0x018F7A14, + 0x01A58A14, 0x01BB8A14, 0x01D1170E, 0x01D5490E, 0x01DF770E, 0x01EF740A, 0x01F9770E, 0x02097A14, + 0x021FDC16, 0x024DBA14, 0x026E7A14, 0x0284BA14, 0x02A59A14, 0x02C16A14, 0x02D26A14, 0x02E3BA14, + 0x03048A14, 0x031A1A14, 0x03206A14, 0x03318A14, 0x03476A14, 0x0358CA14, 0x03799A14, 0x0395CA14, + 0x03B67A14, 0x03CCCA14, 0x03ED8A14, 0x04037A14, 0x04196A14, 0x042A8A14, 0x0440AA14, 0x045CDA14, + 0x04839A14, 0x049F9A14, 0x04BB7A14, 0x04D14D14, 0x04DF5C14, 0x04F33D14, 0x05015216, 0x050681FA, + 0x050A9D14, 0x052D9810, 0x05449A14, 0x05609810, 0x05779A14, 0x05939810, 0x05AA5A14, 0x05BB9C10, + 0x05DC7A14, 0x05F22A14, 0x05F83D14, 0x06067A14, 0x061C2A14, 0x0622D810, 0x06427810, 0x06549810, + 0x066B9B10, 0x06899B10, 0x06A74810, 0x06B06810, 0x06BE5A14, 0x06CF770E, 0x06DF870E, 0x06EFB70E, + 0x0707670E, 0x07138A0E, 0x0729670E, 0x07356D14, 0x074A1F16, 0x07526D14, 0x07675216, +}; +// clang-format on + +// Loads character texture to buffer +s32 func_801CA0B0(s32 charCode, void* charTexBuf, int* dx, int* dy, int* cy) { + s32 offset; + OSPiHandle* handle; + OSMesgQueue queue; + OSMesg msgBuf[1]; + OSIoMesg mesg; + + handle = osDriveRomInit(); + if (charCode >= 0x20 && charCode < 0x7F) { // ASCII + offset = LeoGetAAdr2(D_801D8BE0[charCode - 0x20], dx, dy, cy); + } else if (charCode >= 0x8140) { // Shift-JIS + offset = LeoGetKAdr(charCode); + *dx = 16; + *dy = 16; + *cy = 11; + } else { + return -1; + } + + osCreateMesgQueue(&queue, msgBuf, ARRAY_COUNT(msgBuf)); + + // clang-format off + mesg.hdr.retQueue = &queue; \ + mesg.devAddr = offset + DDROM_FONT_START; \ + mesg.dramAddr = charTexBuf; \ + mesg.size = 0x80; \ + mesg.hdr.pri = 0; + // clang-format on + + handle->transferInfo.cmdType = 2; + osEPiStartDma(handle, &mesg, 0); + osRecvMesg(&queue, NULL, OS_MESG_BLOCK); + + return 0; +} + +const u16 D_801D9390[16] = { + 0x0001, 0x1085, 0x2109, 0x318D, 0x4211, 0x5295, 0x6319, 0x739D, + 0x8C63, 0x9CE7, 0xAD6B, 0xBDEF, 0xCE73, 0xDEF7, 0xEF7B, 0xFFFF, +}; + +// Maps 4-bit intensity to a 16-bit color +u16 func_801CA1D4(u32 arg0) { + return D_801D9390[arg0 % ARRAY_COUNT(D_801D9390)]; +} + +void func_801CA1F0(void* charTexBuf, s32 posX, s32 posY, s32 dx, s32 dy, s32 cy, void* frameBuf, s32 screenWidth) { + s32 intensity; + s32 x; + s32 y; + u8* src = charTexBuf; + u16* dst = frameBuf; + + for (y = 0; y < dy; y++) { + for (x = 0; x < dx; x++) { + if (!(x & 1)) { + intensity = *src >> 4; + } else { + intensity = *src & 0xF; + src++; + } + dst[posX + x + ((posY + (11 - cy) + y) * screenWidth)] = func_801CA1D4(intensity); + } + if (dx & 1) { + src++; + } + } +} + +void func_801CA2F8(struct_801CA704* arg0, u32 r, u32 g, u32 b, u32 a) { + arg0->color.r = r; + arg0->color.g = g; + arg0->color.b = b; + arg0->color.a = a; +} + +void func_801CA314(struct_801CA704* arg0, s32 arg1, s32 arg2) { + arg0->posX = arg0->baseX + arg1; + arg0->posY = arg0->baseY + arg2; +} + +void func_801CA334(struct_801CA704* arg0, s32 baseX, s32 baseY, s32 endX, s32 endY) { + arg0->baseX = baseX; + arg0->baseY = baseY; + arg0->endX = endX; + arg0->endY = endY; +} + +void func_801CA350(struct_801CA704* arg0, void* frameBuf, s32 screenWidth, s32 screenHeight) { + arg0->frameBuf = (u8*)frameBuf + 0x20000000; + arg0->screenWidth = screenWidth; + arg0->screenHeight = screenHeight; + func_801CA334(arg0, 0, 0, screenWidth - 1, screenHeight - 1); +} + +void func_801CA3B4(struct_801CA704* arg0, void* charTexBuf, s32 arg2) { + arg0->charTexBuf = (u8*)charTexBuf + 0x20000000; + arg0->unk_08 = arg2; +} + +void func_801CA3CC(struct_801CA704* arg0, char c) { + s32 charCode; + int dx; + int dy; + int cy; + + if (arg0->sjisPrevByte != 0) { + charCode = (arg0->sjisPrevByte << 8) | c; + } else { + if (c >= 0x80 && c < 0x99) { + arg0->sjisPrevByte = c; + return; + } + charCode = c; + } + + arg0->sjisPrevByte = 0; + if (func_801CA0B0(charCode, arg0->charTexBuf, &dx, &dy, &cy) == 0) { + if (arg0->posX + dx > arg0->endX) { + arg0->posX = arg0->baseX; + if (arg0->posY + 16 > arg0->endY) { + arg0->posY = arg0->baseY; + } else { + arg0->posY += 16; + } + } + func_801CA1F0(arg0->charTexBuf, arg0->posX, arg0->posY, dx, dy, cy, arg0->frameBuf, arg0->screenWidth); + arg0->posX += (dx == 16 ? dx : dx + 2); + } +} + +void func_801CA4F4(struct_801CA704* arg0, char c) { + if (c >= ' ' && c <= 0xFF) { + func_801CA3CC(arg0, c); + } else { + switch (c) { + case '\n': + arg0->posY += 32; + FALLTHROUGH; + case '\r': + arg0->posX = arg0->baseX; + break; + case '\t': + do { + func_801CA3CC(arg0, ' '); + } while ((arg0->posX - arg0->baseX) % 256); + break; + case '\0': + break; + } + } +} + +void func_801CA5BC(struct_801CA704* arg0, const char* str, s32 arg2, size_t count) { + const char* s = str; + s32 n = arg2 * count; + + while (n != 0) { + func_801CA4F4(arg0, *s++); + n--; + } +} + +void func_801CA618(struct_801CA704* arg0, const char* str) { + while (*str != 0) { + func_801CA4F4(arg0, *str++); + } +} + +void* func_801CA670(void* arg, const char* str, size_t count) { + func_801CA5BC(arg, str, 1, count); + return arg; +} + +void func_801CA6A0(struct_801CA704* arg0) { + arg0->callback = &func_801CA670; + arg0->posX = 0; + arg0->posY = 0; + arg0->baseX = 0; + arg0->baseY = 0; + arg0->endX = 0; + arg0->endY = 0; + arg0->color.rgba = 0; + arg0->sjisPrevByte = 0; + arg0->charTexBuf = NULL; +} + +void func_801CA6D8(struct_801CA704* arg0) { +} + +s32 func_801CA6E4(struct_801CA704* arg0, const char* fmt, va_list args) { + return PrintUtils_VPrintf(&arg0->callback, fmt, args); +} + +s32 func_801CA704(struct_801CA704* arg0, const char* fmt, ...) { + s32 ret; + va_list args; + + va_start(args, fmt); + ret = func_801CA6E4(arg0, fmt, args); + va_end(args); + + return ret; +} diff --git a/src/n64dd/n64dd_data_buffer.c b/src/n64dd/n64dd_data_buffer.c new file mode 100644 index 0000000000..6aacae2d57 --- /dev/null +++ b/src/n64dd/n64dd_data_buffer.c @@ -0,0 +1,5 @@ +#include "global.h" +#include "n64dd.h" + +// Buffer used for reading from the disk? +u8 B_801DC000[0x4D10]; diff --git a/src/n64dd/n64dd_error_bodies.c b/src/n64dd/n64dd_error_bodies.c new file mode 100644 index 0000000000..757e1afb6b --- /dev/null +++ b/src/n64dd/n64dd_error_bodies.c @@ -0,0 +1,47 @@ +#include "global.h" +#include "n64dd.h" + +const char* D_801D2EE0[2][8][4] = { + { + { "  メモリー拡張パックが正しく差し込", "  んでありますか?        ", NULL, NULL }, + { "  間違ったディスクが差し込まれてい", "  る可能性があります。正しいディス", + "  クに交換してください。     ", NULL }, + { "  注意:アクセスランプ点滅中にディ", "  スクを抜かないでください。詳しく", + "  は、取扱説明書をお読みください。", NULL }, + { "  詳しくは、取扱説明書をお読みくだ", "  さい。             ", NULL, NULL }, + { "   ディスクを差し込んでください。", NULL, NULL, NULL }, + { "  ディスクを差し込み直してください。", NULL, NULL, NULL }, + { "   ディスクを取り出してください。", NULL, NULL, NULL }, + { NULL, NULL, NULL, NULL }, + }, + { + { + " Are you sure the Expansion", + " Pak is inserted correctly?", + NULL, + NULL, + }, + { + " Check to see if the proper", + " disk is inserted.", + " Please insert the disk the", + " correct disk.", + }, + { + " Do not remove the disk when", + " the access light is flashing.", + " Please read the instruction", + " manual for details.", + }, + { + " Please read the instruction", + " manual for details.", + NULL, + NULL, + }, + { " Please insert a disk.", NULL, NULL, NULL }, + { " Please insert the disk again.", NULL, NULL, NULL }, + { " Please remove the disk.", NULL, NULL, NULL }, + { NULL, NULL, NULL, NULL }, + }, +}; diff --git a/src/n64dd/n64dd_error_headers.c b/src/n64dd/n64dd_error_headers.c new file mode 100644 index 0000000000..b14d80fba5 --- /dev/null +++ b/src/n64dd/n64dd_error_headers.c @@ -0,0 +1,5 @@ +#include "global.h" +#include "n64dd.h" + +// Padding in .rodata suggests that these are in a separate file +const char* D_801D2ED0[4] = { "エラー番号   ", "Error Number ", NULL, NULL }; diff --git a/src/n64dd/n64dd_error_textures.c b/src/n64dd/n64dd_error_textures.c new file mode 100644 index 0000000000..037ed7835b --- /dev/null +++ b/src/n64dd/n64dd_error_textures.c @@ -0,0 +1,23 @@ +#include "ultra64.h" + +#if PLATFORM_N64 + +u64 gN64DDError41Texs[2][0x600 / sizeof(u64)] = { + { +#include "assets/n64dd/error_textures/n64dd_error_41_jpn.i4.inc.c" + }, + { +#include "assets/n64dd/error_textures/n64dd_error_41_eng.i4.inc.c" + }, +}; + +u64 gN64DDPleaseReadManualTexs[2][0x2800 / sizeof(u64)] = { + { +#include "assets/n64dd/error_textures/n64dd_please_read_manual_jpn.i4.inc.c" + }, + { +#include "assets/n64dd/error_textures/n64dd_please_read_manual_eng.i4.inc.c" + }, +}; + +#endif diff --git a/src/n64dd/z_n64dd.c b/src/n64dd/z_n64dd.c new file mode 100644 index 0000000000..a2fd113309 --- /dev/null +++ b/src/n64dd/z_n64dd.c @@ -0,0 +1,586 @@ +// Main interface for the 64DD from the rest of the game. Starts background +// threads and provides functions to submit commands to them. +#include "global.h" +#include "fault.h" +#include "n64dd.h" +#include "stack.h" +#include "versions.h" + +#pragma increment_block_number "ntsc-1.2:128 pal-1.0:128 pal-1.1:128" + +typedef struct struct_801D9C30 { + /* 0x000 */ s32 unk_000; // disk start + /* 0x004 */ s32 unk_004; // disk end + /* 0x008 */ uintptr_t unk_008; // ram start + /* 0x00C */ uintptr_t unk_00C; // ram end + /* 0x010 */ UNK_PTR unk_010; + /* 0x014 */ char unk_014[0x104]; +} struct_801D9C30; // size = 0x118 + +typedef struct struct_801D9B90 { + /* 0x00 */ OSMesg unk_00[30]; + /* 0x78 */ OSMesgQueue unk_78; + /* 0x90 */ IrqMgrClient unk_90; + /* 0x98 */ IrqMgr* unk_98; +} struct_801D9B90; // size = 0x9C + +s32 func_801C7A1C(struct_801E0D18* arg0); + +void* D_801D2E50 = &B_801DC000; +s32 (*D_801D2E54)(struct_801E0D18*) = func_801C7A1C; + +struct_801D9B90 B_801D9B90; +struct_801D9C30 B_801D9C30; +struct_801D9C30* B_801D9D48; +struct_801D9D50 B_801D9D50; +OSMesgQueue B_801D9D80; +OSMesgQueue B_801D9D98; +OSMesg B_801D9DB0[1]; +OSMesg B_801D9DB4[1]; +volatile u8 B_801D9DB8; +volatile OSTime B_801D9DC0; +s32 B_801D9DC8; // 1 if disk gameName is correct, 2 otherwise +void* B_801D9DCC; +void* B_801D9DD0; +void* B_801D9DD4; +OSThread B_801D9DD8; +STACK(B_801D9F88, 0x1000); +StackEntry B_801DAF88; +STACK(B_801DAFA8, 0x1000); +StackEntry B_801DBFA8; +UNK_TYPE B_801DBFC4; // unused? + +u32 func_801C6E80(void) { +#if OOT_NTSC + return LeoDriveExist(); +#else + return 0; +#endif +} + +void func_801C6EA0(Gfx** gfxP) { +} + +void func_801C6EAC(void) { + if (D_80121214 == 0) { + func_800F6BDC(); + D_80121214 = 1; + } +} + +s32 func_801C6EF0(void) { + return D_80121214 != 0; +} + +s32 func_801C6F08(void) { + if (D_80121214 != 0) { + return 1; + } + return 1; +} + +void func_801C6F30(void) { + func_801C6EAC(); + while (func_801C6F08() == 0) { + Sleep_Usec(16666); // 100000 / 6 + } +} + +void func_801C6F78(void) { + if (D_80121214 != 0) { + D_80121214 = 0; + func_800F6B3C(); + } +} + +// boolean +s32 func_801C6FAC(void) { + if (D_80121213 == 0) { + return false; + } else { + D_80121213 = 0; + return true; + } +} + +void func_801C6FD8(void) { + while (!func_801C6FAC()) { + Sleep_Usec(16666); // 100000 / 6 + } +} + +// Adds a HungupAndCrash +void func_801C7018(void) { + if (D_80121213 != 0) { +#if OOT_VERSION < NTSC_1_1 + Fault_AddHungupAndCrash("../z_n64dd.c", 503); +#elif OOT_VERSION < PAL_1_0 + Fault_AddHungupAndCrash("../z_n64dd.c", 551); +#else + Fault_AddHungupAndCrash("../z_n64dd.c", 573); +#endif + } + D_80121213 = 1; +} + +s32 func_801C7064(void) { + B_801D9D50.unk_00 = 5; + return (&func_801C8000)(&B_801D9D50); +} + +s32 func_801C7098(void) { + s32 phi_v1; + +#if OOT_VERSION < PAL_1_0 + if (0) {} +#endif + + B_801D9D50.unk_00 = 10; + phi_v1 = (&func_801C8000)(&B_801D9D50); + if (phi_v1 < 0) { + func_800D31A0(); + } + return phi_v1; +} + +s32 func_801C70E4(void) { + return B_801D9DC8 == 1; +} + +// Used by EnMag and FileChoose +s32 func_801C70FC(void) { + return func_801C70E4(); +} + +void func_801C711C(void* arg) { + static void* B_801DBFC8; + struct_801D9B90* arg0 = (struct_801D9B90*)arg; + s16* sp58; + s32 var_s0; + void* temp_v0; + + sp58 = NULL; + arg0->unk_98 = &gIrqMgr; + osCreateMesgQueue(&arg0->unk_78, arg0->unk_00, ARRAY_COUNT(arg0->unk_00)); + IrqMgr_AddClient(arg0->unk_98, &arg0->unk_90, &arg0->unk_78); + var_s0 = 0; + do { + osRecvMesg(&arg0->unk_78, (OSMesg*)&sp58, OS_MESG_BLOCK); + switch (*sp58) { + case 1: + temp_v0 = osViGetNextFramebuffer(); + if (B_801DBFC8 != temp_v0) { + B_801DBFC8 = temp_v0; + B_801D9DB8 = 1; + } + func_801C8AA8(); + break; + case 4: + LeoReset(); + break; + case 3: + var_s0 = 1; + break; + } + } while (var_s0 == 0); + IrqMgr_RemoveClient(arg0->unk_98, &arg0->unk_90); +} + +#if OOT_VERSION >= NTSC_1_1 +void func_801C7B28_ne2(void) { + s32 temp; + + if (B_801D9DC0 != 0) { + temp = (osGetTime() - B_801D9DC0) * 64 / 3000; + if (1000000 - temp > 0) { + Sleep_Usec(1000000 - temp); + } + } +} +#endif + +void func_801C7268(void) { + s32 pad; + s32 sp20; + s32 sp1C; + + sp20 = func_801C6EF0(); + if (sp20 == 0) { + func_801C6F30(); + } + B_801D9DB8 = 1; + B_801D9DC0 = 0; + if (func_801C7064() == 1) { + func_801C7098(); + } else if (B_801D9DC8 != 0) { + B_801D9DC8 = 0; + } +#if OOT_VERSION < NTSC_1_1 + if (B_801D9DC0 != 0) { + sp1C = (osGetTime() - B_801D9DC0) * 64 / 3000; + + // Remnants from debug statements? + (void)(osGetTime() - B_801D9DC0); + (void)((osGetTime() - B_801D9DC0) * 64 / 3000); + (void)((osGetTime() - B_801D9DC0) * 64 / 3000); + + if (1000000 - sp1C > 0) { + Sleep_Usec(1000000 - sp1C); + } + } +#else + if (D_801D2EA8 == 1 || B_801E0F60 == 1 || B_801E0F64 == 1) { + B_801D9DC0 = osGetTime(); + } + func_801C7B28_ne2(); +#endif + if (sp20 == 0) { + func_801C6F78(); + } +} + +// Clears framebuffer +void func_801C7438(void* arg0) { + u16* var_v0; + + for (var_v0 = (u16*)arg0; var_v0 < (u16*)arg0 + SCREEN_WIDTH * SCREEN_HEIGHT; var_v0++) { + *var_v0 = 1; + } +} + +void func_801C746C(void* arg0, void* arg1, void* arg2) { + void* sp2C; + + if (arg0 != NULL || arg1 != NULL || arg2 != NULL) { + sp2C = (u8*)osViGetNextFramebuffer() + 0x20000000; + if ((u32)sp2C & 0xFFFFFF) { + if (B_801D9DB8 != 0) { + B_801D9DB8 = 0; + func_801C7438(sp2C); + B_801D9DC0 = osGetTime(); + } + if (arg0 != NULL) { + func_801CA1F0(arg0, 96, 32, 192, 16, 11, sp2C, SCREEN_WIDTH); + } + if (arg1 != NULL) { + func_801CA1F0(arg1, 0, 80, 320, 64, 11, sp2C, SCREEN_WIDTH); + } + if (arg2 != NULL) { + func_801CA1F0(arg2, 0, 176, 320, 32, 11, sp2C, SCREEN_WIDTH); + } +#if OOT_VERSION < PAL_1_0 + osViBlack(0); +#endif + } + } +} + +void func_801C75BC(void* arg0, void* arg1, void* arg2) { + s32 temp; + + if (arg0 == NULL && arg1 == NULL && arg2 == NULL) { + return; + } + + if (B_801D9DB8) {} + + if (arg0 != 0) { + B_801D9DCC = arg0; + } + if (arg1 != 0) { + B_801D9DD0 = arg1; + } + if (arg2 != 0) { + B_801D9DD4 = arg2; + } + func_801C746C(arg0, arg1, arg2); +} + +void func_801C761C(void) { + Sleep_Msec(100); + func_801C746C(B_801D9DCC, B_801D9DD0, B_801D9DD4); +} + +s32 func_801C7658(void) { + if (D_80121212 != 0) { + return 0; + } + +#if OOT_VERSION < PAL_1_0 + StackCheck_Init(&B_801DAF88, B_801D9F88, STACK_TOP(B_801D9F88), 0, 0x100, "ddmsg"); + osCreateThread(&B_801D9DD8, THREAD_ID_DDMSG, &func_801C711C, &B_801D9B90, STACK_TOP(B_801D9F88), THREAD_PRI_DDMSG); + osStartThread(&B_801D9DD8); +#endif + + osCreateMesgQueue(&B_801D9D80, B_801D9DB0, ARRAY_COUNT(B_801D9DB0)); + osCreateMesgQueue(&B_801D9D98, B_801D9DB4, ARRAY_COUNT(B_801D9DB4)); + + StackCheck_Init(&B_801DBFA8, B_801DAFA8, STACK_TOP(B_801DAFA8), 0, 0x100, "n64dd"); + + B_801D9D50.unk_1C = &B_801D9D80; + B_801D9D50.unk_20 = &B_801D9D98; + B_801D9D50.unk_24 = THREAD_ID_N64DD; + B_801D9D50.unk_28 = STACK_TOP(B_801DAFA8); + B_801D9D50.unk_2C = THREAD_PRI_N64DD; + B_801D9D50.unk_00 = 1; + + (&func_801C8000)(&B_801D9D50); + + D_80121213 = 1; + func_801C6FD8(); + + B_801D9D50.unk_00 = 2; + B_801D9D50.unk_10 = 6; + B_801D9D50.unk_14 = &DmaMgr_DmaFromDriveRom; + B_801D9D50.unk_0C = &func_801C75BC; + (&func_801C8000)(&B_801D9D50); + + B_801D9D50.unk_00 = 13; + (&func_801C8000)(&B_801D9D50); + +#if OOT_VERSION >= PAL_1_0 + StackCheck_Init(&B_801DAF88, B_801D9F88, STACK_TOP(B_801D9F88), 0, 0x100, "ddmsg"); + osCreateThread(&B_801D9DD8, THREAD_ID_DDMSG, &func_801C711C, &B_801D9B90, STACK_TOP(B_801D9F88), THREAD_PRI_DDMSG); + osStartThread(&B_801D9DD8); +#endif + + return 0; +} + +s32 func_801C7818(void) { +#if OOT_VERSION >= NTSC_1_1 + B_801D9DB8 = 1; + B_801D9DC0 = 0; +#endif + + B_801D9D50.unk_00 = 12; + (&func_801C8000)(&B_801D9D50); + + while (func_801C81C4() == 0) { + // the number 16666 sounds like it could be 1 frame (at 60 frames per second) + Sleep_Usec(1000000 * 1 / 60); + } + +#if OOT_VERSION >= NTSC_1_1 + if (D_801D2EA8 == 1 || B_801E0F60 == 1 || B_801E0F64 == 1) { + B_801D9DC0 = osGetTime(); + } + func_801C7B28_ne2(); +#endif + + if (func_801C81C4() != 2) { + func_801C761C(); + func_800D31A0(); + return -3; + } + + func_801C7018(); + D_80121212 = 1; + return 0; +} + +s32 func_801C78B8(void) { + s32 phi_v1 = func_801C7658(); + + if (phi_v1 == 0) { + phi_v1 = func_801C7818(); + } + return phi_v1; +} + +s32 func_801C78F0(void) { + B_801D9D50.unk_00 = 0; + return (&func_801C8000)(&B_801D9D50); +} + +void func_801C7920(s32 arg0, void* arg1, s32 arg2) { + B_801D9D50.unk_18 = arg1; + B_801D9D50.unk_1C = (void*)arg0; + B_801D9D50.unk_20 = (void*)arg2; + B_801D9D50.unk_00 = 3; + (&func_801C8000)(&B_801D9D50); + osGetTime(); + B_801D9D50.unk_00 = 6; + while ((&func_801C8000)(&B_801D9D50) != 0) { + Sleep_Usec(16666); // 100000 / 6 + } + B_801D9D50.unk_00 = 7; + if ((&func_801C8000)(&B_801D9D50) != 0) { + func_800D31A0(); + } +} + +void func_801C79CC(void* arg0, s32 arg1, s32 arg2) { + B_801D9D50.unk_18 = arg0; + B_801D9D50.unk_1C = (void*)arg1; + B_801D9D50.unk_20 = (void*)arg2; + B_801D9D50.unk_00 = 4; + (&func_801C8000)(&B_801D9D50); +} + +void func_801C7A10(LEODiskID* arg0) { +} + +// Checks diskId, sets B_801D9DC8 and returns true if diskId is correct +s32 func_801C7A1C(struct_801E0D18* arg0) { + static LEODiskID B_801DBFD0; + static s32 B_801DBFF0; // bool + + func_801C7A10(&arg0->diskId); + if (!B_801DBFF0) { +#if OOT_NTSC + if (bcmp(arg0->diskId.gameName, "EZLJ", 4) == 0 || bcmp(arg0->diskId.gameName, "EZLE", 4) == 0) +#else + if (bcmp(arg0->diskId.gameName, "EZLP", 4) == 0) +#endif + { + B_801DBFD0 = arg0->diskId; + B_801DBFF0 = true; + B_801D9DC8 = 1; + } else { + B_801D9DC8 = 2; + } + } else if (bcmp(&B_801DBFD0, &arg0->diskId, sizeof(LEODiskID)) == 0) { + B_801D9DC8 = 1; + } else { + B_801D9DC8 = 2; + } + return B_801D9DC8 == 1; +} + +// Translates byte position to LBA and byte offset +s32 func_801C7B48(s32 arg0, s32* arg1, s32* arg2) { + s32 sp2C; + s32 temp_v0_2; + s32 sp24; + s32 sp20; + s32 temp_v0; + + temp_v0_2 = LeoByteToLBA(1, arg0 + 1, &sp2C); + if (temp_v0_2 != LEO_ERROR_GOOD) { + return temp_v0_2; + } + sp24 = sp2C - 1; + if (sp2C == 1) { + sp20 = 0; + } else { + temp_v0 = LeoLBAToByte(1, sp24, &sp20); + if (temp_v0 != LEO_ERROR_GOOD) { + return temp_v0; + } + } + *arg1 = sp24 + 1; + *arg2 = arg0 - sp20; + return LEO_ERROR_GOOD; +} + +s32 func_801C7BEC(s32 startLBA) { + s32 bytes; + + if (LeoLBAToByte(startLBA, 1, &bytes) == LEO_ERROR_GOOD) { + return bytes; + } + return 0; +} + +// Copies bytes from disk to arg0 +void func_801C7C1C(void* dest, s32 offset, s32 size) { + s32 sp5C; + s32 sp58; + s32 sp54; + s32 sp50; + void* sp4C; + s32 var_s0; + s32 var_s1; + s32 temp_v1_2; + + func_801C6FD8(); + func_801C6F30(); + B_801D9DB8 = 1; + B_801D9DC0 = 0; + func_801C7B48(offset, &sp5C, &sp54); + func_801C7B48(offset + size, &sp58, &sp50); + sp4C = D_801D2E50; + if (sp5C == sp58) { + func_801C7920(sp5C, sp4C, func_801C7BEC(sp5C)); + bcopy((u8*)sp4C + sp54, dest, size); + } else { + var_s1 = 0; + func_801C7920(sp5C, sp4C, func_801C7BEC(sp5C)); + bcopy((u8*)sp4C + sp54, dest, func_801C7BEC(sp5C) - sp54); + if (sp5C + 1 < sp58) { + for (var_s0 = sp5C + 1; var_s0 < sp58; var_s0++) { + var_s1 += func_801C7BEC(var_s0); + } + func_801C7920(sp5C + 1, (u8*)dest + func_801C7BEC(sp5C) - sp54, var_s1); + } + if (sp50 > 0) { + func_801C7920(sp58, sp4C, func_801C7BEC(sp58)); + bcopy((u8*)sp4C, (u8*)dest + func_801C7BEC(sp5C) - sp54 + var_s1, sp50); + } + } +#if OOT_VERSION < NTSC_1_1 + if (B_801D9DC0 != 0) { + temp_v1_2 = (osGetTime() - B_801D9DC0) * 64 / 3000; + if (1000000 - temp_v1_2 > 0) { + Sleep_Usec(1000000 - temp_v1_2); + } + } +#else + func_801C7B28_ne2(); +#endif + func_801C7018(); + func_801C6F78(); +} + +void func_801C7E78(void) { +} + +s32 func_801C7E80(void) { + s32 sp24; + s32 sp20; + s32 sp1C; + uintptr_t sp18; + + if (B_801D9D48 != NULL) { + return -1; + } + B_801D9D48 = &B_801D9C30; + func_801C7C1C(B_801D9D48, 0x1060, 0x118); + sp24 = B_801D9D48->unk_004 - B_801D9D48->unk_000; + sp20 = B_801D9D48->unk_00C - B_801D9D48->unk_008; + sp18 = B_801D9D48->unk_008 + sp24; + func_801C7C1C((void*)B_801D9D48->unk_008, B_801D9D48->unk_000, sp24); + bzero((void*)sp18, sp20 - sp24); + func_800AD4C0(B_801D9D48->unk_010); + return 0; +} + +s32 func_801C7F24(void) { + uintptr_t temp_a0; + struct_801D9C30* temp_v0; + + if (B_801D9D48 == 0) { + return -1; + } + + // Function from code + func_800AD51C(); + + temp_v0 = B_801D9D48; + temp_a0 = temp_v0->unk_008; + bzero((void*)temp_a0, temp_v0->unk_00C - temp_a0); + bzero(B_801D9D48, sizeof(struct_801D9C30)); + B_801D9D48 = 0; + return 0; +} + +void n64dd_SetDiskVersion(s32 arg0) { + if (arg0 != 0) { + if (B_801D9D48 == 0) { + func_801C7E80(); + } + } else if (B_801D9D48 != 0) { + func_801C7F24(); + } +} diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index 9552c45460..63f929d43e 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -11,7 +11,7 @@ void ArmsHook_Draw(Actor* thisx, PlayState* play); void ArmsHook_Wait(ArmsHook* this, PlayState* play); void ArmsHook_Shoot(ArmsHook* this, PlayState* play); -ActorInit Arms_Hook_InitVars = { +ActorProfile Arms_Hook_Profile = { /**/ ACTOR_ARMS_HOOK, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -25,7 +25,7 @@ ActorInit Arms_Hook_InitVars = { static ColliderQuadInit sQuadInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_PLAYER, AC_NONE, OC1_NONE, @@ -33,7 +33,7 @@ static ColliderQuadInit sQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000080, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_NEAREST | ATELEM_SFX_NORMAL, @@ -121,7 +121,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) { if (Player_HoldsHookshot(player)) { if ((player->itemAction != player->heldItemAction) || (player->actor.flags & ACTOR_FLAG_TALK) || - ((player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_26)))) { + ((player->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_26)))) { this->timer = 0; ArmsHook_DetachHookFromActor(this); Math_Vec3f_Copy(&this->actor.world.pos, &player->unk_3C8); @@ -146,11 +146,11 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { return; } - func_8002F8F0(&player->actor, NA_SE_IT_HOOKSHOT_CHAIN - SFX_FLAG); + Actor_PlaySfx_Flagged2(&player->actor, NA_SE_IT_HOOKSHOT_CHAIN - SFX_FLAG); ArmsHook_CheckForCancel(this); if ((this->timer != 0) && (this->collider.base.atFlags & AT_HIT) && - (this->collider.elem.atHitElem->elemType != ELEMTYPE_UNK4)) { + (this->collider.elem.atHitElem->elemMaterial != ELEM_MATERIAL_UNK4)) { Actor* touchedActor = this->collider.base.at; if ((touchedActor->update != NULL) && (touchedActor->flags & (ACTOR_FLAG_9 | ACTOR_FLAG_10))) { @@ -287,7 +287,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else if (CHECK_BTN_ANY(play->state.input[0].press.button, - (BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN))) { + (BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT))) { this->timer = 0; } } @@ -328,8 +328,7 @@ void ArmsHook_Draw(Actor* thisx, PlayState* play) { func_80090480(play, &this->collider, &this->hookInfo, &hookNewTip, &hookNewBase); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_arms_hook.c", 895), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_arms_hook.c", 895); gSPDisplayList(POLY_OPA_DISP++, gLinkAdultHookshotTipDL); Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Math_Vec3f_Diff(&player->unk_3C8, &this->actor.world.pos, &sp78); @@ -338,8 +337,7 @@ void ArmsHook_Draw(Actor* thisx, PlayState* play) { Matrix_RotateY(Math_FAtan2F(sp78.x, sp78.z), MTXMODE_APPLY); Matrix_RotateX(Math_FAtan2F(-sp78.y, sp5C), MTXMODE_APPLY); Matrix_Scale(0.015f, 0.015f, sqrtf(SQ(sp78.y) + sp58) * 0.01f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_arms_hook.c", 910), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_arms_hook.c", 910); gSPDisplayList(POLY_OPA_DISP++, gLinkAdultHookshotChainDL); CLOSE_DISPS(play->state.gfxCtx, "../z_arms_hook.c", 913); diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c index afc9cc19c6..d75efab0c9 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -20,7 +20,7 @@ void ArrowFire_Hit(ArrowFire* this, PlayState* play); #include "assets/overlays/ovl_Arrow_Fire/ovl_Arrow_Fire.c" -ActorInit Arrow_Fire_InitVars = { +ActorProfile Arrow_Fire_Profile = { /**/ ACTOR_ARROW_FIRE, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -74,7 +74,7 @@ void ArrowFire_Charge(ArrowFire* this, PlayState* play) { this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; - func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_FIRE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_PL_ARROW_CHARGE_FIRE - SFX_FLAG); // if arrow has no parent, player has fired the arrow if (arrow->actor.parent == NULL) { @@ -241,8 +241,7 @@ void ArrowFire_Draw(Actor* thisx, PlayState* play2) { } Matrix_Scale(this->radius * 0.2f, this->unk_158 * 4.0f, this->radius * 0.2f, MTXMODE_APPLY); Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_arrow_fire.c", 666), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_arrow_fire.c", 666); gSPDisplayList(POLY_XLU_DISP++, sMaterialDL); gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 255 - (stateFrames * 2) % 256, 0, 64, 32, 1, diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index ff8e88896e..010a110a13 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -21,7 +21,7 @@ void ArrowIce_Hit(ArrowIce* this, PlayState* play); #include "assets/overlays/ovl_Arrow_Ice/ovl_Arrow_Ice.c" -ActorInit Arrow_Ice_InitVars = { +ActorProfile Arrow_Ice_Profile = { /**/ ACTOR_ARROW_ICE, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -75,7 +75,7 @@ void ArrowIce_Charge(ArrowIce* this, PlayState* play) { this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; - func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_ICE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_PL_ARROW_CHARGE_ICE - SFX_FLAG); // if arrow has no parent, player has fired the arrow if (arrow->actor.parent == NULL) { @@ -239,8 +239,7 @@ void ArrowIce_Draw(Actor* thisx, PlayState* play) { } Matrix_Scale(this->radius * 0.2f, this->unk_160 * 3.0f, this->radius * 0.2f, MTXMODE_APPLY); Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_arrow_ice.c", 660), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_arrow_ice.c", 660); gSPDisplayList(POLY_XLU_DISP++, sMaterialDL); gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 511 - (stateFrames * 5) % 512, 0, 128, 32, 1, diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c index fb96f1124b..9a0691649b 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -21,7 +21,7 @@ void ArrowLight_Hit(ArrowLight* this, PlayState* play); #include "assets/overlays/ovl_Arrow_Light/ovl_Arrow_Light.c" -ActorInit Arrow_Light_InitVars = { +ActorProfile Arrow_Light_Profile = { /**/ ACTOR_ARROW_LIGHT, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -74,7 +74,7 @@ void ArrowLight_Charge(ArrowLight* this, PlayState* play) { this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; - func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_LIGHT - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_PL_ARROW_CHARGE_LIGHT - SFX_FLAG); // if arrow has no parent, player has fired the arrow if (arrow->actor.parent == NULL) { @@ -237,8 +237,7 @@ void ArrowLight_Draw(Actor* thisx, PlayState* play) { } Matrix_Scale(this->radius * 0.2f, this->unk_160 * 4.0f, this->radius * 0.2f, MTXMODE_APPLY); Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_arrow_light.c", 648), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_arrow_light.c", 648); gSPDisplayList(POLY_XLU_DISP++, sMaterialDL); gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 511 - (stateFrames * 5) % 512, 0, 4, 32, 1, diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index bd1270ab2f..055f93e200 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -10,12 +10,12 @@ #define FLAGS ACTOR_FLAG_4 -typedef enum { +typedef enum BgBdanObjectsPropertyGetter { JABU_OBJECTS_GET_PROP_CAM_SETTING_NORMAL0 = 0, JABU_OBJECTS_GET_PROP_CAM_SETTING_DUNGEON1 = 3, JABU_OBJECTS_GET_PROP_WATCHED_BIGOCTO_INTRO_CUTSCENE = 4 } BgBdanObjectsPropertyGetter; -typedef enum { +typedef enum BgBdanObjectsPropertySetter { JABU_OBJECTS_SET_PROP_CAM_SETTING_NORMAL1 = 1, JABU_OBJECTS_SET_PROP_CAM_SETTING_DUNGEON0 = 2, JABU_OBJECTS_SET_PROP_WATCHED_BIGOCTO_INTRO_CUTSCENE = 4 @@ -43,7 +43,7 @@ void BgBdanObjects_WaitForTimerExpired(BgBdanObjects* this, PlayState* play); void BgBdanObjects_WaitForPlayerOnTop(BgBdanObjects* this, PlayState* play); void BgBdanObjects_FallToLowerPos(BgBdanObjects* this, PlayState* play); -ActorInit Bg_Bdan_Objects_InitVars = { +ActorProfile Bg_Bdan_Objects_Profile = { /**/ ACTOR_BG_BDAN_OBJECTS, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -57,7 +57,7 @@ ActorInit Bg_Bdan_Objects_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -65,7 +65,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_HARD, @@ -95,7 +95,7 @@ s32 BgBdanObjects_GetProperty(BgBdanObjects* this, s32 arg1) { case JABU_OBJECTS_GET_PROP_CAM_SETTING_DUNGEON1: return this->cameraSetting == CAM_SET_DUNGEON1; default: - PRINTF("Bg_Bdan_Objects_Get_Contact_Ru1\nそんな受信モードは無い%d!!!!!!!!\n"); + PRINTF("Bg_Bdan_Objects_Get_Contact_Ru1\nそんな受信モードは無い%d!!!!!!!!\n", arg1); return -1; } } @@ -112,7 +112,7 @@ void BgBdanObjects_SetProperty(BgBdanObjects* this, s32 arg1) { SET_INFTABLE(INFTABLE_146); break; default: - PRINTF("Bg_Bdan_Objects_Set_Contact_Ru1\nそんな送信モードは無い%d!!!!!!!!\n"); + PRINTF("Bg_Bdan_Objects_Set_Contact_Ru1\nそんな送信モードは無い%d!!!!!!!!\n", arg1); } } @@ -123,7 +123,7 @@ void BgBdanObjects_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - this->var.switchFlag = (thisx->params >> 8) & 0x3F; + this->var.switchFlag = PARAMS_GET_U(thisx->params, 8, 6); thisx->params &= 0xFF; if (thisx->params == JABU_OBJECTS_TYPE_WATERBOX_HEIGHT_CHANGER) { thisx->flags |= ACTOR_FLAG_4 | ACTOR_FLAG_5; @@ -232,7 +232,7 @@ void BgBdanObjects_OctoPlatform_RaiseToUpperPosition(BgBdanObjects* this, PlaySt Rumble_Request(0.0f, 120, 20, 10); this->timer = 11; } - func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_RISING - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_BUYOSTAND_RISING - SFX_FLAG); } } @@ -283,7 +283,7 @@ void BgBdanObjects_OctoPlatform_DescendWithBigOcto(BgBdanObjects* this, PlayStat player->actor.world.rot.y = player->actor.shape.rot.y; Rumble_Request(0.0f, 255, 30, 150); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_FALL - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_BUYOSTAND_FALL - SFX_FLAG); if (this->timer != 0) { this->timer--; } @@ -360,7 +360,7 @@ void BgBdanObjects_RaiseToUpperPosition(BgBdanObjects* this, PlayState* play) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A); this->actionFunc = BgBdanObjects_DoNothing; } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_RISING - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_BUYOSTAND_RISING - SFX_FLAG); } } @@ -411,12 +411,12 @@ void BgBdanObjects_ChangeWaterBoxLevel(BgBdanObjects* this, PlayState* play) { Flags_UnsetSwitch(play, this->var.switchFlag); this->actionFunc = BgBdanObjects_WaitForSwitch; } - func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } else { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 75.0f, 0.5f)) { this->actionFunc = BgBdanObjects_WaitForTimerExpired; } - func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } play->colCtx.colHeader->waterBoxes[7].ySurface = this->dyna.actor.world.pos.y; } @@ -425,7 +425,7 @@ void BgBdanObjects_WaitForTimerExpired(BgBdanObjects* this, PlayState* play) { if (this->timer != 0) { this->timer--; } - func_8002F994(&this->dyna.actor, this->timer); // play ticking sound effect + Actor_PlaySfx_FlaggedTimer(&this->dyna.actor, this->timer); // play ticking sound effect if (this->timer == 0) { this->actionFunc = BgBdanObjects_ChangeWaterBoxLevel; } @@ -454,7 +454,7 @@ void BgBdanObjects_FallToLowerPos(BgBdanObjects* this, PlayState* play) { // Using `CAM_ID_NONE` here defaults to the active camera Play_CopyCamera(play, CAM_ID_MAIN, CAM_ID_NONE); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_FALL - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_BUYOSTAND_FALL - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h index 62c5392811..6c802bb3f6 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h @@ -6,7 +6,7 @@ struct BgBdanObjects; -typedef enum { +typedef enum BgBdanObjectsType { JABU_OBJECTS_TYPE_BIG_OCTO_PLATFORM, JABU_OBJECTS_TYPE_SMALL_AUTO_ELEVATOR, JABU_OBJECTS_TYPE_WATERBOX_HEIGHT_CHANGER, diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index d4a4a6fc0f..adb0353a7e 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -42,7 +42,7 @@ void func_8086DCE8(BgBdanSwitch* this, PlayState* play); void func_8086DDA8(BgBdanSwitch* this); void func_8086DDC0(BgBdanSwitch* this, PlayState* play); -ActorInit Bg_Bdan_Switch_InitVars = { +ActorProfile Bg_Bdan_Switch_Profile = { /**/ ACTOR_BG_BDAN_SWITCH, /**/ ACTORCAT_SWITCH, /**/ FLAGS, @@ -57,7 +57,7 @@ ActorInit Bg_Bdan_Switch_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xEFC1FFFE, 0x00, 0x00 }, ATELEM_NONE, @@ -70,7 +70,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -120,7 +120,7 @@ void func_8086D0EC(BgBdanSwitch* this) { this->unk_1CC += 0xFA0; } - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case BLUE: case YELLOW_HEAVY: case YELLOW: @@ -143,7 +143,7 @@ void BgBdanSwitch_Init(Actor* thisx, PlayState* play) { s16 type; s32 flag; - type = this->dyna.actor.params & 0xFF; + type = PARAMS_GET_U(this->dyna.actor.params, 0, 8); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); if (type == YELLOW_TALL_1 || type == YELLOW_TALL_2) { this->dyna.actor.scale.z = 0.05f; @@ -164,12 +164,12 @@ void BgBdanSwitch_Init(Actor* thisx, PlayState* play) { case YELLOW_TALL_1: case YELLOW_TALL_2: BgBdanSwitch_InitCollision(this, play); - this->dyna.actor.flags |= ACTOR_FLAG_0; - this->dyna.actor.targetMode = 4; + this->dyna.actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; + this->dyna.actor.attentionRangeType = ATTENTION_RANGE_4; break; } - flag = Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + flag = Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); switch (type) { case BLUE: @@ -206,7 +206,7 @@ void BgBdanSwitch_Init(Actor* thisx, PlayState* play) { void BgBdanSwitch_Destroy(Actor* thisx, PlayState* play) { BgBdanSwitch* this = (BgBdanSwitch*)thisx; - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case BLUE: case YELLOW_HEAVY: case YELLOW: @@ -223,9 +223,9 @@ void func_8086D4B4(BgBdanSwitch* this, PlayState* play) { s32 pad; s32 type; - if (!Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { - type = this->dyna.actor.params & 0xFF; - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { + type = PARAMS_GET_U(this->dyna.actor.params, 0, 8); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); if (type == BLUE || type == YELLOW_TALL_2) { OnePointCutscene_AttentionSetSfx(play, &this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR); } else { @@ -235,9 +235,9 @@ void func_8086D4B4(BgBdanSwitch* this, PlayState* play) { } void func_8086D548(BgBdanSwitch* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { - Flags_UnsetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); - if ((this->dyna.actor.params & 0xFF) == YELLOW_TALL_2) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { + Flags_UnsetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == YELLOW_TALL_2) { OnePointCutscene_AttentionSetSfx(play, &this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR); } } @@ -249,7 +249,7 @@ void func_8086D5C4(BgBdanSwitch* this) { } void func_8086D5E0(BgBdanSwitch* this, PlayState* play) { - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case BLUE: if (func_800435B4(&this->dyna)) { func_8086D67C(this); @@ -288,7 +288,7 @@ void func_8086D730(BgBdanSwitch* this) { } void func_8086D754(BgBdanSwitch* this, PlayState* play) { - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case BLUE: if (!func_800435B4(&this->dyna)) { if (this->unk_1D8 <= 0) { @@ -300,7 +300,7 @@ void func_8086D754(BgBdanSwitch* this, PlayState* play) { } break; case YELLOW: - if (!Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { func_8086D7FC(this); } break; @@ -410,7 +410,7 @@ void func_8086DB4C(BgBdanSwitch* this) { } void func_8086DB68(BgBdanSwitch* this, PlayState* play) { - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { default: return; case YELLOW_TALL_1: @@ -451,9 +451,9 @@ void func_8086DCCC(BgBdanSwitch* this) { } void func_8086DCE8(BgBdanSwitch* this, PlayState* play) { - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case YELLOW_TALL_1: - if (!Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { func_8086DDA8(this); } break; @@ -473,7 +473,8 @@ void func_8086DDA8(BgBdanSwitch* this) { } void func_8086DDC0(BgBdanSwitch* this, PlayState* play) { - if ((((this->dyna.actor.params & 0xFF) != YELLOW_TALL_2) || (func_8005B198() == this->dyna.actor.category)) || + if (((PARAMS_GET_U(this->dyna.actor.params, 0, 8) != YELLOW_TALL_2) || + (func_8005B198() == this->dyna.actor.category)) || (this->unk_1DA <= 0)) { this->unk_1C8 += 0.3f; if (this->unk_1C8 >= 2.0f) { @@ -493,7 +494,7 @@ void BgBdanSwitch_Update(Actor* thisx, PlayState* play) { } this->actionFunc(this, play); func_8086D0EC(this); - type = this->dyna.actor.params & 0xFF; + type = PARAMS_GET_U(this->dyna.actor.params, 0, 8); if (type != 3 && type != 4) { this->unk_1D8--; } else { @@ -519,7 +520,7 @@ void func_8086DF58(BgBdanSwitch* this, PlayState* play, Gfx* dlist) { void BgBdanSwitch_Draw(Actor* thisx, PlayState* play) { BgBdanSwitch* this = (BgBdanSwitch*)thisx; - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case YELLOW_HEAVY: case YELLOW: func_8086DF58(this, play, gJabuYellowFloorSwitchDL); diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h index cc0d7ccebc..b7914a4f0d 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h @@ -4,8 +4,7 @@ #include "ultra64.h" #include "global.h" -// BgBdanSwitch.actor.params & 0xFF -typedef enum { +typedef enum BgBdanSwitchType { /* 0x00 */ BLUE, /* 0x01 */ YELLOW_HEAVY, /* 0x02 */ YELLOW, diff --git a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c index 44950a46cd..729dd81552 100644 --- a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c +++ b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c @@ -17,7 +17,7 @@ void BgBomGuard_Update(Actor* thisx, PlayState* play); void func_8086E638(BgBomGuard* this, PlayState* play); -ActorInit Bg_Bom_Guard_InitVars = { +ActorProfile Bg_Bom_Guard_Profile = { /**/ ACTOR_BG_BOM_GUARD, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c index ff7ebd99c2..82daa4e13e 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c @@ -23,7 +23,7 @@ void func_8086EE94(BgBombwall* this, PlayState* play); static ColliderTrisElementInit sTrisElementsInit[3] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x40000048, 0x00, 0x00 }, ATELEM_NONE, @@ -34,7 +34,7 @@ static ColliderTrisElementInit sTrisElementsInit[3] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x40000048, 0x00, 0x00 }, ATELEM_NONE, @@ -45,7 +45,7 @@ static ColliderTrisElementInit sTrisElementsInit[3] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x40000048, 0x00, 0x00 }, ATELEM_NONE, @@ -58,7 +58,7 @@ static ColliderTrisElementInit sTrisElementsInit[3] = { static ColliderTrisInit sTrisInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -69,7 +69,7 @@ static ColliderTrisInit sTrisInit = { sTrisElementsInit, }; -ActorInit Bg_Bombwall_InitVars = { +ActorProfile Bg_Bombwall_Profile = { /**/ ACTOR_BG_BOMBWALL, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -122,7 +122,7 @@ void BgBombwall_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); Actor_SetScale(&this->dyna.actor, 0.1f); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { func_8086EE94(this, play); } else { BgBombwall_InitDynapoly(this, play); @@ -213,7 +213,7 @@ void func_8086ED70(BgBombwall* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; func_8086EDFC(this, play); - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); } else if (this->dyna.actor.xzDistToPlayer < 600.0f) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } @@ -232,7 +232,7 @@ void func_8086EE40(BgBombwall* this, PlayState* play) { } else { func_8086EE94(this, play); - if (((this->dyna.actor.params >> 0xF) & 1) != 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 15, 1) != 0) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } } diff --git a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c index 3fdafb1444..fa3de785f4 100644 --- a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c +++ b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c @@ -24,7 +24,7 @@ void BgBowlWall_FallDoEffects(BgBowlWall* this, PlayState* play); void BgBowlWall_FinishFall(BgBowlWall* this, PlayState* play); void BgBowlWall_Reset(BgBowlWall* this, PlayState* play); -ActorInit Bg_Bowl_Wall_InitVars = { +ActorProfile Bg_Bowl_Wall_Profile = { /**/ ACTOR_BG_BOWL_WALL, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -207,8 +207,7 @@ void BgBowlWall_Draw(Actor* thisx, PlayState* play2) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x8, Gfx_TexScroll(play->state.gfxCtx, 0, -2 * (frames = play->state.frames), 16, 16)); gDPPipeSync(POLY_OPA_DISP++); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_bowl_wall.c", 453), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_bowl_wall.c", 453); if (this->dyna.actor.params == 0) { gSPDisplayList(POLY_OPA_DISP++, gBowlingRound1WallDL); diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index ef92c82eec..4999abd966 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -11,7 +11,7 @@ #define FLAGS ACTOR_FLAG_4 -typedef struct { +typedef struct BombableWallInfo { /* 0x00 */ CollisionHeader* colHeader; /* 0x04 */ Gfx* dList; /* 0x08 */ s8 colType; @@ -26,7 +26,7 @@ void BgBreakwall_WaitForObject(BgBreakwall* this, PlayState* play); void BgBreakwall_Wait(BgBreakwall* this, PlayState* play); void BgBreakwall_LavaCoverMove(BgBreakwall* this, PlayState* play); -ActorInit Bg_Breakwall_InitVars = { +ActorProfile Bg_Breakwall_Profile = { /**/ ACTOR_BG_BREAKWALL, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -40,7 +40,7 @@ ActorInit Bg_Breakwall_InitVars = { static ColliderQuadInit sQuadInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER, OC1_NONE, @@ -48,7 +48,7 @@ static ColliderQuadInit sQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000048, 0x00, 0x00 }, { 0x00000048, 0x00, 0x00 }, ATELEM_NONE, @@ -79,7 +79,7 @@ void BgBreakwall_SetupAction(BgBreakwall* this, BgBreakwallActionFunc actionFunc void BgBreakwall_Init(Actor* thisx, PlayState* play) { BgBreakwall* this = (BgBreakwall*)thisx; s32 pad; - s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF; + s32 wallType = (u8)PARAMS_GET_U(this->dyna.actor.params, 13, 2); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 0); @@ -91,7 +91,7 @@ void BgBreakwall_Init(Actor* thisx, PlayState* play) { } if (this->bombableWallDList != NULL) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -203,7 +203,7 @@ Actor* BgBreakwall_SpawnFragments(PlayState* play, BgBreakwall* this, Vec3f* pos void BgBreakwall_WaitForObject(BgBreakwall* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { CollisionHeader* colHeader = NULL; - s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF; + s32 wallType = (u8)PARAMS_GET_U(this->dyna.actor.params, 13, 2); this->dyna.actor.objectSlot = this->requiredObjectSlot; Actor_SetObjectDependency(play, &this->dyna.actor); @@ -227,7 +227,7 @@ void BgBreakwall_WaitForObject(BgBreakwall* this, PlayState* play) { void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { Vec3f effectPos; - s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF; + s32 wallType = (u8)PARAMS_GET_U(this->dyna.actor.params, 13, 2); DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); effectPos.y = effectPos.z = effectPos.x = 0.0f; @@ -240,7 +240,7 @@ void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) { } BgBreakwall_SpawnFragments(play, this, &effectPos, 0.0f, 6.4f, 5.0f, 1, 2.0f); - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); if (wallType == BWALL_KD_FLOOR) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_EXPLOSION); @@ -297,8 +297,7 @@ void BgBreakwall_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_breakwall.c", 767); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_breakwall.c", 771), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_breakwall.c", 771); gSPDisplayList(POLY_OPA_DISP++, this->bombableWallDList); if (this->colType >= 0) { diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h index 6880026c2a..c6dcab1b4f 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h @@ -17,7 +17,7 @@ typedef struct BgBreakwall { /* 0x01EC */ BgBreakwallActionFunc actionFunc; } BgBreakwall; // size = 0x01F0 -typedef enum { +typedef enum BombableWallType { /* 0 */ BWALL_DC_ENTRANCE, // When exploded it will play the Dodongo's Cavern intro cutscene /* 1 */ BWALL_WALL, // Used a lot in Dodongo's Cavern and other places /* 2 */ BWALL_KD_FLOOR, // Used in the King Dodongo boss room diff --git a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c index cf0746a99a..dc5a1cba23 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c +++ b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c @@ -17,7 +17,7 @@ void BgDdanJd_Draw(Actor* thisx, PlayState* play); void BgDdanJd_Idle(BgDdanJd* this, PlayState* play); void BgDdanJd_Move(BgDdanJd* this, PlayState* play); -ActorInit Bg_Ddan_Jd_InitVars = { +ActorProfile Bg_Ddan_Jd_Profile = { /**/ ACTOR_BG_DDAN_JD, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -33,7 +33,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -typedef enum { +typedef enum BgDdanJdState { /* 0 */ STATE_GO_BOTTOM, /* 1 */ STATE_GO_MIDDLE_FROM_BOTTOM, /* 2 */ STATE_GO_MIDDLE_FROM_TOP, @@ -146,7 +146,7 @@ void BgDdanJd_MoveEffects(BgDdanJd* this, PlayState* play) { func_80033480(play, &dustPos, 5.0f, 1, 20, 60, 1); } if (this->ySpeed == SHORTCUT_Y_SPEED) { - func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c index f5396acc28..3fe150cc6f 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c +++ b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c @@ -18,7 +18,7 @@ void BgDdanKd_CheckForExplosions(BgDdanKd* this, PlayState* play); void BgDdanKd_LowerStairs(BgDdanKd* this, PlayState* play); void BgDdanKd_DoNothing(BgDdanKd* this, PlayState* play); -ActorInit Bg_Ddan_Kd_InitVars = { +ActorProfile Bg_Ddan_Kd_Profile = { /**/ ACTOR_BG_DDAN_KD, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -32,7 +32,7 @@ ActorInit Bg_Ddan_Kd_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_ALL, OC1_NONE, @@ -40,7 +40,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index d1ccf08fc0..b8e3cfa33b 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -20,7 +20,7 @@ void BgDodoago_OpenJaw(BgDodoago* this, PlayState* play); void BgDodoago_DoNothing(BgDodoago* this, PlayState* play); void BgDodoago_LightOneEye(BgDodoago* this, PlayState* play); -ActorInit Bg_Dodoago_InitVars = { +ActorProfile Bg_Dodoago_Profile = { /**/ ACTOR_BG_DODOAGO, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -34,7 +34,7 @@ ActorInit Bg_Dodoago_InitVars = { static ColliderCylinderInit sColCylinderInitMain = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_ALL, OC1_NONE, @@ -42,7 +42,7 @@ static ColliderCylinderInit sColCylinderInitMain = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -54,7 +54,7 @@ static ColliderCylinderInit sColCylinderInitMain = { static ColliderCylinderInit sColCylinderInitLeftRight = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_NO_PUSH | OC1_TYPE_ALL, @@ -62,7 +62,7 @@ static ColliderCylinderInit sColCylinderInitLeftRight = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -118,10 +118,10 @@ void BgDodoago_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); ActorShape_Init(&this->dyna.actor.shape, 0.0f, NULL, 0.0f); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { BgDodoago_SetupAction(this, BgDodoago_DoNothing); this->dyna.actor.shape.rot.x = 0x1333; - play->roomCtx.unk_74[BGDODOAGO_EYE_LEFT] = play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] = 255; + play->roomCtx.drawParams[BGDODOAGO_EYE_LEFT] = play->roomCtx.drawParams[BGDODOAGO_EYE_RIGHT] = 255; return; } @@ -154,15 +154,15 @@ void BgDodoago_WaitExplosives(BgDodoago* this, PlayState* play) { ? BGDODOAGO_EYE_RIGHT : BGDODOAGO_EYE_LEFT; - if (((play->roomCtx.unk_74[BGDODOAGO_EYE_LEFT] == 255) && (this->state == BGDODOAGO_EYE_RIGHT)) || - ((play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] == 255) && (this->state == BGDODOAGO_EYE_LEFT))) { - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + if (((play->roomCtx.drawParams[BGDODOAGO_EYE_LEFT] == 255) && (this->state == BGDODOAGO_EYE_RIGHT)) || + ((play->roomCtx.drawParams[BGDODOAGO_EYE_RIGHT] == 255) && (this->state == BGDODOAGO_EYE_LEFT))) { + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); this->state = 0; Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); BgDodoago_SetupAction(this, BgDodoago_OpenJaw); OnePointCutscene_Init(play, 3380, 160, &this->dyna.actor, CAM_ID_MAIN); - } else if (play->roomCtx.unk_74[this->state] == 0) { + } else if (play->roomCtx.drawParams[this->state] == 0) { OnePointCutscene_Init(play, 3065, 40, &this->dyna.actor, CAM_ID_MAIN); BgDodoago_SetupAction(this, BgDodoago_LightOneEye); Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, @@ -212,14 +212,14 @@ void BgDodoago_OpenJaw(BgDodoago* this, PlayState* play) { s32 i; // make both eyes red (one already is) - if (play->roomCtx.unk_74[BGDODOAGO_EYE_LEFT] < 255) { - play->roomCtx.unk_74[BGDODOAGO_EYE_LEFT] += 5; + if (play->roomCtx.drawParams[BGDODOAGO_EYE_LEFT] < 255) { + play->roomCtx.drawParams[BGDODOAGO_EYE_LEFT] += 5; } - if (play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] < 255) { - play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] += 5; + if (play->roomCtx.drawParams[BGDODOAGO_EYE_RIGHT] < 255) { + play->roomCtx.drawParams[BGDODOAGO_EYE_RIGHT] += 5; } - if (play->roomCtx.unk_74[BGDODOAGO_EYE_LEFT] != 255 || play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] != 255) { + if (play->roomCtx.drawParams[BGDODOAGO_EYE_LEFT] != 255 || play->roomCtx.drawParams[BGDODOAGO_EYE_RIGHT] != 255) { sTimer--; return; } @@ -260,9 +260,9 @@ void BgDodoago_DoNothing(BgDodoago* this, PlayState* play) { } void BgDodoago_LightOneEye(BgDodoago* this, PlayState* play) { - play->roomCtx.unk_74[this->state] += 5; + play->roomCtx.drawParams[this->state] += 5; - if (play->roomCtx.unk_74[this->state] == 255) { + if (play->roomCtx.drawParams[this->state] == 255) { BgDodoago_SetupAction(this, BgDodoago_WaitExplosives); } } @@ -296,9 +296,9 @@ void BgDodoago_Update(Actor* thisx, PlayState* play) { } } else { sTimer++; - Flags_GetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); if (!sDisableBombCatcher && sTimer > 140) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { // this prevents clearing the actor's parent pointer, effectively disabling the bomb catcher sDisableBombCatcher++; } else { @@ -314,8 +314,7 @@ void BgDodoago_Draw(Actor* thisx, PlayState* play) { if (Flags_GetEventChkInf(EVENTCHKINF_B0)) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_dodoago.c", 677), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_dodoago.c", 677); gSPDisplayList(POLY_OPA_DISP++, gDodongoLowerJawDL); } diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h index 02603c6d01..2c8e873ba7 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef enum { +typedef enum BgDodoagoEye { /* 0 */ BGDODOAGO_EYE_LEFT, /* 1 */ BGDODOAGO_EYE_RIGHT } BgDodoagoEye; diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index 09e4443651..ac55dc86c8 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -7,19 +7,24 @@ #include "z_bg_dy_yoseizo.h" #include "assets/objects/object_dy_obj/object_dy_obj.h" #include "terminal.h" +#include "versions.h" #include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h" #include "assets/scenes/indoors/yousei_izumi_yoko/yousei_izumi_yoko_scene.h" #include "assets/scenes/indoors/daiyousei_izumi/daiyousei_izumi_scene.h" +#if OOT_VERSION < NTSC_1_1 +#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) +#else #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25) +#endif -typedef enum { +typedef enum BgDyYoseizoRewardType { /* 0 */ FAIRY_UPGRADE_MAGIC, /* 1 */ FAIRY_UPGRADE_DOUBLE_MAGIC, /* 2 */ FAIRY_UPGRADE_DOUBLE_DEFENSE } BgDyYoseizoRewardType; -typedef enum { +typedef enum BgDyYoseizoSpellType { /* 0 */ FAIRY_SPELL_FARORES_WIND, /* 1 */ FAIRY_SPELL_DINS_FIRE, /* 2 */ FAIRY_SPELL_NAYRUS_LOVE @@ -54,7 +59,7 @@ void BgDyYoseizo_DrawEffects(BgDyYoseizo* this, PlayState* play); static s32 sUnusedGetItemIds[] = { GI_FARORES_WIND, GI_NAYRUS_LOVE, GI_DINS_FIRE }; -ActorInit Bg_Dy_Yoseizo_InitVars = { +ActorProfile Bg_Dy_Yoseizo_Profile = { /**/ ACTOR_BG_DY_YOSEIZO, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -85,13 +90,30 @@ void BgDyYoseizo_Init(Actor* thisx, PlayState* play2) { PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 大妖精の泉 ☆☆☆☆☆ %d\n" VT_RST, play->spawn); SkelAnime_InitFlex(play, &this->skelAnime, &gGreatFairySkel, &gGreatFairySittingTransitionAnim, this->jointTable, this->morphTable, 28); +#if OOT_VERSION < NTSC_1_1 + if (!gSaveContext.save.info.playerData.isMagicAcquired && (this->fountainType != FAIRY_UPGRADE_MAGIC)) { + Actor_Kill(&this->actor); + return; + } +#endif } else { // "Stone/Jewel Fairy Fountain" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 石妖精の泉 ☆☆☆☆☆ %d\n" VT_RST, play->spawn); SkelAnime_InitFlex(play, &this->skelAnime, &gGreatFairySkel, &gGreatFairyLayingDownTransitionAnim, this->jointTable, this->morphTable, 28); +#if OOT_VERSION < NTSC_1_1 + if (!gSaveContext.save.info.playerData.isMagicAcquired) { + Actor_Kill(&this->actor); + return; + } +#endif } + +#if OOT_VERSION < NTSC_1_1 + this->actionFunc = BgDyYoseizo_ChooseType; +#else this->actionFunc = BgDyYoseizo_CheckMagicAcquired; +#endif } void BgDyYoseizo_Destroy(Actor* thisx, PlayState* play) { @@ -177,6 +199,7 @@ void BgDyYoseizo_Bob(BgDyYoseizo* this, PlayState* play) { } } +#if OOT_VERSION >= NTSC_1_1 void BgDyYoseizo_CheckMagicAcquired(BgDyYoseizo* this, PlayState* play) { if (Flags_GetSwitch(play, 0x38)) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; @@ -195,10 +218,22 @@ void BgDyYoseizo_CheckMagicAcquired(BgDyYoseizo* this, PlayState* play) { this->actionFunc = BgDyYoseizo_ChooseType; } } +#endif void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) { s32 givingReward; +#if OOT_VERSION < NTSC_1_1 + if (!Flags_GetSwitch(play, 0x38)) { + return; + } + + if (play->msgCtx.ocarinaMode != OCARINA_MODE_04) { + Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1); + return; + } +#endif + Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1); // "Mode" PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ もうど ☆☆☆☆☆ %d\n" VT_RST, play->msgCtx.ocarinaMode); @@ -315,12 +350,16 @@ void BgDyYoseizo_SetupSpinGrow_NoReward(BgDyYoseizo* this, PlayState* play) { } Actor_PlaySfx(&this->actor, NA_SE_VO_FR_LAUGH_0); +#if OOT_VERSION >= NTSC_1_1 Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1); +#endif this->actionFunc = BgDyYoseizo_SpinGrow_NoReward; } void BgDyYoseizo_SpinGrow_NoReward(BgDyYoseizo* this, PlayState* play) { +#if OOT_VERSION >= NTSC_1_1 Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1); +#endif Math_ApproachF(&this->actor.world.pos.y, this->grownHeight, this->heightFraction, 100.0f); Math_ApproachF(&this->scale, 0.035f, this->scaleFraction, 0.005f); Math_ApproachF(&this->heightFraction, 0.8f, 0.1f, 0.02f); @@ -346,7 +385,9 @@ void BgDyYoseizo_SpinGrow_NoReward(BgDyYoseizo* this, PlayState* play) { void BgDyYoseizo_CompleteSpinGrow_NoReward(BgDyYoseizo* this, PlayState* play) { f32 curFrame = this->skelAnime.curFrame; +#if OOT_VERSION >= NTSC_1_1 Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1); +#endif if ((this->frameCount * 1273.0f) <= this->bobTimer) { this->bobTimer = 0.0f; @@ -360,7 +401,9 @@ void BgDyYoseizo_CompleteSpinGrow_NoReward(BgDyYoseizo* this, PlayState* play) { } void BgDyYoseizo_SetupGreetPlayer_NoReward(BgDyYoseizo* this, PlayState* play) { +#if OOT_VERSION >= NTSC_1_1 Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1); +#endif if (play->sceneId == SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC) { this->frameCount = Animation_GetLastFrame(&gGreatFairySittingAnim); @@ -380,7 +423,9 @@ void BgDyYoseizo_SetupGreetPlayer_NoReward(BgDyYoseizo* this, PlayState* play) { } void BgDyYoseizo_GreetPlayer_NoReward(BgDyYoseizo* this, PlayState* play) { +#if OOT_VERSION >= NTSC_1_1 Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1); +#endif this->bobTimer = this->skelAnime.curFrame * 1273.0f; if ((this->frameCount * 1273.0f) <= this->bobTimer) { @@ -1029,8 +1074,7 @@ void BgDyYoseizo_DrawEffects(BgDyYoseizo* this, PlayState* play) { Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); Matrix_RotateZ(effect->roll, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_bg_dy_yoseizo.c", 1810), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_bg_dy_yoseizo.c", 1810); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGreatFairyParticleModelDL)); } } diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h index a1b6765931..fd7aebb3a4 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h @@ -12,7 +12,7 @@ typedef void (*BgDyYoseizoActionFunc)(struct BgDyYoseizo*, PlayState*); #define BG_DY_YOSEIZO_EFFECT_COUNT 200 -typedef struct { +typedef struct BgDyYoseizoEffect { /* 0x00 */ u8 alive; // drawn if 1, respawn if 0 /* 0x04 */ Vec3f pos; /* 0x10 */ Vec3f velocity; diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c index 7cf14989c1..edfb09d522 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c @@ -10,7 +10,7 @@ #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) -typedef enum { +typedef enum FlashState { /* 0x00 */ FLASH_NONE, /* 0x01 */ FLASH_GROW, /* 0x02 */ FLASH_SHRINK @@ -25,7 +25,7 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, PlayState* play); void BgGanonOtyuka_Fall(BgGanonOtyuka* this, PlayState* play); void BgGanonOtyuka_DoNothing(Actor* thisx, PlayState* play); -ActorInit Bg_Ganon_Otyuka_InitVars = { +ActorProfile Bg_Ganon_Otyuka_Profile = { /**/ ACTOR_BG_GANON_OTYUKA, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -297,8 +297,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, PlayState* play) { phi_s1 = sPlatformTopDL; } } - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_ganon_otyuka.c", 766), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_ganon_otyuka.c", 766); gSPDisplayList(POLY_OPA_DISP++, phi_s2); if (phi_s1 != NULL) { @@ -310,8 +309,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, PlayState* play) { Matrix_Push(); Matrix_Translate(sSideCenters[i].x, 0.0f, sSideCenters[i].z, MTXMODE_APPLY); Matrix_RotateY(sSideAngles[i], MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_ganon_otyuka.c", 785), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_ganon_otyuka.c", 785); gSPDisplayList(POLY_OPA_DISP++, sPlatformSideDL); Matrix_Pop(); } @@ -345,8 +343,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, PlayState* play) { Matrix_Translate(sSideCenters[i].x, 0.0f, sSideCenters[i].z, MTXMODE_APPLY); Matrix_RotateY(sSideAngles[i], MTXMODE_APPLY); Matrix_Scale(0.3f, platform->flashYScale * 0.3f, 0.3f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_ganon_otyuka.c", 847), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_ganon_otyuka.c", 847); gSPDisplayList(POLY_XLU_DISP++, sFlashDL); Matrix_Pop(); } diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index af27042725..8988aea020 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -20,7 +20,7 @@ void func_80878300(BgGateShutter* this, PlayState* play); void func_808783AC(BgGateShutter* this, PlayState* play); void func_808783D4(BgGateShutter* this, PlayState* play); -ActorInit Bg_Gate_Shutter_InitVars = { +ActorProfile Bg_Gate_Shutter_Profile = { /**/ ACTOR_BG_GATE_SHUTTER, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -126,8 +126,7 @@ void BgGateShutter_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_gate_shutter.c", 328), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_gate_shutter.c", 328); gSPDisplayList(POLY_OPA_DISP++, gKakarikoGuardGateDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_gate_shutter.c", 333); diff --git a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c index e8bcca20b1..4a67c02d13 100644 --- a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c +++ b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c @@ -19,7 +19,7 @@ void func_808787A4(BgGjyoBridge* this, PlayState* play); void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, PlayState* play); void BgGjyoBridge_SpawnBridge(BgGjyoBridge* this, PlayState* play); -ActorInit Bg_Gjyo_Bridge_InitVars = { +ActorProfile Bg_Gjyo_Bridge_Profile = { /**/ ACTOR_BG_GJYO_BRIDGE, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -96,21 +96,21 @@ void BgGjyoBridge_Update(Actor* thisx, PlayState* play) { } void BgGjyoBridge_Draw(Actor* thisx, PlayState* play) { - BgGjyoBridge* this = (BgGjyoBridge*)thisx; + PlayState* play2 = (PlayState*)play; OPEN_DISPS(play->state.gfxCtx, "../z_bg_gjyo_bridge.c", 260); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPSegment(POLY_XLU_DISP++, 8, - Gfx_TexScroll(play->state.gfxCtx, play->gameplayFrames & 127, play->gameplayFrames * -3 & 127, 32, 32)); + gSPSegment( + POLY_XLU_DISP++, 8, + Gfx_TexScroll(play->state.gfxCtx, play2->gameplayFrames & 127, play2->gameplayFrames * -3 & 127, 32, 32)); gSPSegment(POLY_XLU_DISP++, 9, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, -play->gameplayFrames & 127, 32, 32, 1, 0, - play->gameplayFrames & 127, 32, 32)); + Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, -play2->gameplayFrames & 127, 32, 32, 1, 0, + play2->gameplayFrames & 127, 32, 32)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_gjyo_bridge.c", 281), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_gjyo_bridge.c", 281); gSPDisplayList(POLY_XLU_DISP++, gRainbowBridgeDL); diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c index 287cd60ea0..801475e3f3 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c @@ -21,7 +21,7 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play); void BgGndDarkmeiro_UpdateStaticBlock(BgGndDarkmeiro* this, PlayState* play); void BgGndDarkmeiro_UpdateSwitchBlock(BgGndDarkmeiro* this, PlayState* play); -ActorInit Bg_Gnd_Darkmeiro_InitVars = { +ActorProfile Bg_Gnd_Darkmeiro_Profile = { /**/ ACTOR_BG_GND_DARKMEIRO, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -52,7 +52,7 @@ void BgGndDarkmeiro_Init(Actor* thisx, PlayState* play2) { this->updateFunc = BgGndDarkmeiro_Noop; Actor_SetScale(&this->dyna.actor, 0.1f); - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case DARKMEIRO_INVISIBLE_PATH: this->dyna.actor.draw = BgGndDarkmeiro_DrawInvisiblePath; this->dyna.actor.flags |= ACTOR_FLAG_REACT_TO_LENS; @@ -60,14 +60,14 @@ void BgGndDarkmeiro_Init(Actor* thisx, PlayState* play2) { case DARKMEIRO_CLEAR_BLOCK: CollisionHeader_GetVirtual(&gClearBlockCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - if (((this->dyna.actor.params >> 8) & 0x3F) == 0x3F) { + if (PARAMS_GET_U(this->dyna.actor.params, 8, 6) == 0x3F) { this->updateFunc = BgGndDarkmeiro_UpdateStaticBlock; this->dyna.actor.draw = BgGndDarkmeiro_DrawStaticBlock; } else { this->actionFlags = this->timer1 = this->timer2 = 0; thisx->draw = BgGndDarkmeiro_DrawSwitchBlock; this->updateFunc = BgGndDarkmeiro_UpdateSwitchBlock; - if (!Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); } else { this->timer1 = 64; @@ -79,18 +79,18 @@ void BgGndDarkmeiro_Init(Actor* thisx, PlayState* play2) { this->actionFlags = this->timer1 = this->timer2 = 0; this->updateFunc = BgGndDarkmeiro_UpdateBlockTimer; thisx->draw = NULL; - if (Flags_GetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 1)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6) + 1)) { this->timer1 = 64; this->actionFlags |= 4; } - if (Flags_GetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 2)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6) + 2)) { this->timer2 = 64; this->actionFlags |= 8; } if ((this->timer1 != 0) || (this->timer2 != 0)) { - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); } else { - Flags_UnsetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_UnsetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); } break; } @@ -100,7 +100,7 @@ void BgGndDarkmeiro_Destroy(Actor* thisx, PlayState* play2) { PlayState* play = play2; BgGndDarkmeiro* this = (BgGndDarkmeiro*)thisx; - if ((this->dyna.actor.params & 0xFF) != 1) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) != 1) { return; } @@ -113,12 +113,12 @@ void BgGndDarkmeiro_Noop(BgGndDarkmeiro* this, PlayState* play) { void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { s16 timeLeft; - if (Flags_GetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 1)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6) + 1)) { if (this->actionFlags & 4) { if (this->timer1 > 0) { this->timer1--; } else { - Flags_UnsetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 1); + Flags_UnsetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6) + 1); this->actionFlags &= ~4; } } else { @@ -129,12 +129,12 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { } } - if (Flags_GetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 2)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6) + 2)) { if (this->actionFlags & 8) { if (this->timer2 > 0) { this->timer2--; } else { - Flags_UnsetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 2); + Flags_UnsetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6) + 2); this->actionFlags &= ~8; } } else { @@ -147,12 +147,12 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { timeLeft = CLAMP_MIN(this->timer1, this->timer2); if (timeLeft > 0) { - func_8002F994(&this->dyna.actor, timeLeft); + Actor_PlaySfx_FlaggedTimer(&this->dyna.actor, timeLeft); } if ((this->timer1 >= 64) || (this->timer2 >= 64)) { - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); } else { - Flags_UnsetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_UnsetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); } } @@ -164,7 +164,7 @@ void BgGndDarkmeiro_UpdateSwitchBlock(BgGndDarkmeiro* this, PlayState* play) { this->timer1--; } - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { this->timer1 = 64; } diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h index 0899a3abab..39fb42a3aa 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h @@ -16,7 +16,7 @@ typedef struct BgGndDarkmeiro { /* 0x016C */ BgGndDarkmeiroUpdateFunc updateFunc; } BgGndDarkmeiro; // size = 0x0170 -typedef enum { +typedef enum DarkmeiroType { /* 0 */ DARKMEIRO_INVISIBLE_PATH, // Textures for the invisible path in shadow trial. /* 1 */ DARKMEIRO_CLEAR_BLOCK, /* Clear blocks appear when their switch flag is set and diff --git a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c index 809158c8a3..9f97b57541 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c @@ -18,7 +18,7 @@ void BgGndFiremeiro_Sink(BgGndFiremeiro* this, PlayState* play); void BgGndFiremeiro_Shake(BgGndFiremeiro* this, PlayState* play); void BgGndFiremeiro_Rise(BgGndFiremeiro* this, PlayState* play); -ActorInit Bg_Gnd_Firemeiro_InitVars = { +ActorProfile Bg_Gnd_Firemeiro_Profile = { /**/ ACTOR_BG_GND_FIREMEIRO, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -72,7 +72,7 @@ void BgGndFiremeiro_Sink(BgGndFiremeiro* this, PlayState* play) { this->dyna.actor.world.pos.y = sunkHeight; } - func_8002F948(&this->dyna.actor, NA_SE_EV_ROLL_STAND_2 - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->dyna.actor, NA_SE_EV_ROLL_STAND_2 - SFX_FLAG); } if (this->timer > 0) { @@ -143,8 +143,7 @@ void BgGndFiremeiro_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_gnd_firemeiro.c", 280); Gfx_SetupDL_37Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_gnd_firemeiro.c", 282), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_gnd_firemeiro.c", 282); gSPDisplayList(POLY_OPA_DISP++, gFireTrialPlatformDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_gnd_firemeiro.c", 285); diff --git a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c index 2f347fada9..75e44cb218 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c @@ -9,7 +9,7 @@ #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) -typedef enum { +typedef enum BgGndIceblockAction { /* 0 */ GNDICE_IDLE, /* 1 */ GNDICE_FALL, /* 2 */ GNDICE_HOLE @@ -23,7 +23,7 @@ void BgGndIceblock_Draw(Actor* thisx, PlayState* play); void BgGndIceblock_Idle(BgGndIceblock* this, PlayState* play); void BgGndIceblock_Slide(BgGndIceblock* this, PlayState* play); -ActorInit Bg_Gnd_Iceblock_InitVars = { +ActorProfile Bg_Gnd_Iceblock_Profile = { /**/ ACTOR_BG_GND_ICEBLOCK, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -339,7 +339,7 @@ void BgGndIceblock_Slide(BgGndIceblock* this, PlayState* play) { pos.x = thisx->world.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) + (Math_CosS(this->dyna.unk_158) * spread); pos.z = thisx->world.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) - (Math_SinS(this->dyna.unk_158) * spread); func_8002829C(play, &pos, &velocity, &sZeroVec, &sWhite, &sGray, 250, Rand_S16Offset(40, 15)); - func_8002F974(thisx, NA_SE_PL_SLIP_ICE_LEVEL - SFX_FLAG); + Actor_PlaySfx_Flagged(thisx, NA_SE_PL_SLIP_ICE_LEVEL - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c index a6766c62af..3c100311d0 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c @@ -14,7 +14,7 @@ void BgGndNisekabe_Destroy(Actor* thisx, PlayState* play); void BgGndNisekabe_Update(Actor* thisx, PlayState* play); void BgGndNisekabe_Draw(Actor* thisx, PlayState* play); -ActorInit Bg_Gnd_Nisekabe_InitVars = { +ActorProfile Bg_Gnd_Nisekabe_Profile = { /**/ ACTOR_BG_GND_NISEKABE, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -53,7 +53,7 @@ void BgGndNisekabe_Draw(Actor* thisx, PlayState* play) { gGanonsCastleScrubsFakeWallDL, }; BgGndNisekabe* this = (BgGndNisekabe*)thisx; - u32 index = this->actor.params & 0xFF; + u32 index = PARAMS_GET_U(this->actor.params, 0, 8); if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { Gfx_DrawDListXlu(play, dLists[index]); diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c index 05cf7cde56..17a3ea4508 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c @@ -19,7 +19,7 @@ void func_8087AF38(BgGndSoulmeiro* this, PlayState* play); void func_8087B284(BgGndSoulmeiro* this, PlayState* play); void func_8087B350(BgGndSoulmeiro* this, PlayState* play); -ActorInit Bg_Gnd_Soulmeiro_InitVars = { +ActorProfile Bg_Gnd_Soulmeiro_Profile = { /**/ ACTOR_BG_GND_SOULMEIRO, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -33,7 +33,7 @@ ActorInit Bg_Gnd_Soulmeiro_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -41,7 +41,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x00 }, { 0x00020800, 0x00, 0x00 }, ATELEM_NONE, @@ -65,12 +65,12 @@ void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actionFunc = NULL; - switch (this->actor.params & 0xFF) { + switch (PARAMS_GET_U(this->actor.params, 0, 8)) { case 0: Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actionFunc = func_8087B284; - if (Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 9); @@ -83,7 +83,7 @@ void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play) { break; case 1: case 2: - if (Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { this->actor.draw = BgGndSoulmeiro_Draw; } else { this->actor.draw = NULL; @@ -96,7 +96,7 @@ void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play) { void BgGndSoulmeiro_Destroy(Actor* thisx, PlayState* play) { BgGndSoulmeiro* this = (BgGndSoulmeiro*)thisx; - if ((this->actor.params & 0xFF) == 0) { + if (PARAMS_GET_U(this->actor.params, 0, 8) == 0) { Collider_DestroyCylinder(play, &this->collider); } } @@ -112,13 +112,13 @@ void func_8087AF38(BgGndSoulmeiro* this, PlayState* play) { } if (this->unk_198 == 20) { - Flags_SetSwitch(play, (thisx->params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6)); thisx->draw = NULL; } // This should be this->unk_198 == 0, this is required to match if (!this->unk_198) { - Flags_SetSwitch(play, (thisx->params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6)); Actor_Kill(&this->actor); Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, 0, 0, 0, 9); @@ -162,7 +162,7 @@ void func_8087AF38(BgGndSoulmeiro* this, PlayState* play) { void func_8087B284(BgGndSoulmeiro* this, PlayState* play) { s32 pad; - if (!Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { this->actor.draw = BgGndSoulmeiro_Draw; if (this->collider.base.acFlags & AC_HIT) { Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, @@ -177,7 +177,7 @@ void func_8087B284(BgGndSoulmeiro* this, PlayState* play) { } void func_8087B350(BgGndSoulmeiro* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { this->actor.draw = BgGndSoulmeiro_Draw; } else { this->actor.draw = NULL; @@ -198,7 +198,7 @@ void BgGndSoulmeiro_Draw(Actor* thisx, PlayState* play) { gSpiritTrialLightSourceDL, gSpiritTrialLightFloorDL, }; - s32 params = thisx->params & 0xFF; + s32 params = PARAMS_GET_U(thisx->params, 0, 8); if (1) {} @@ -206,8 +206,7 @@ void BgGndSoulmeiro_Draw(Actor* thisx, PlayState* play) { case 0: OPEN_DISPS(play->state.gfxCtx, "../z_bg_gnd_soulmeiro.c", 398); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_gnd_soulmeiro.c", 400), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_gnd_soulmeiro.c", 400); gSPDisplayList(POLY_XLU_DISP++, dLists[params]); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_gnd_soulmeiro.c", 403); break; diff --git a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c index 43e2d8c90d..7e2401acb1 100644 --- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -14,13 +14,13 @@ void BgHaka_Destroy(Actor* thisx, PlayState* play); void BgHaka_Update(Actor* thisx, PlayState* play); void BgHaka_Draw(Actor* thisx, PlayState* play); -void func_8087B758(BgHaka* this, Player* player); -void func_8087B7E8(BgHaka* this, PlayState* play); -void func_8087B938(BgHaka* this, PlayState* play); -void func_8087BAAC(BgHaka* this, PlayState* play); -void func_8087BAE4(BgHaka* this, PlayState* play); +void BgHaka_CheckPlayerOnDirtPatch(BgHaka* this, Player* player); +void BgHaka_IdleClosed(BgHaka* this, PlayState* play); +void BgHaka_Pull(BgHaka* this, PlayState* play); +void BgHaka_IdleOpened(BgHaka* this, PlayState* play); +void BgHaka_IdleLockedClosed(BgHaka* this, PlayState* play); -ActorInit Bg_Haka_InitVars = { +ActorProfile Bg_Haka_Profile = { /**/ ACTOR_BG_HAKA, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -46,7 +46,7 @@ void BgHaka_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); CollisionHeader_GetVirtual(&gGravestoneCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - this->actionFunc = func_8087B7E8; + this->actionFunc = BgHaka_IdleClosed; } void BgHaka_Destroy(Actor* thisx, PlayState* play) { @@ -55,16 +55,16 @@ void BgHaka_Destroy(Actor* thisx, PlayState* play) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); } -void func_8087B758(BgHaka* this, Player* player) { - Vec3f sp1C; +void BgHaka_CheckPlayerOnDirtPatch(BgHaka* this, Player* player) { + Vec3f playerRelativePos; - func_8002DBD0(&this->dyna.actor, &sp1C, &player->actor.world.pos); - if (fabsf(sp1C.x) < 34.6f && sp1C.z > -112.8f && sp1C.z < -36.0f) { + Actor_WorldToActorCoords(&this->dyna.actor, &playerRelativePos, &player->actor.world.pos); + if (fabsf(playerRelativePos.x) < 34.6f && playerRelativePos.z > -112.8f && playerRelativePos.z < -36.0f) { player->stateFlags2 |= PLAYER_STATE2_FORCE_SAND_FLOOR_SOUND; } } -void func_8087B7E8(BgHaka* this, PlayState* play) { +void BgHaka_IdleClosed(BgHaka* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->dyna.unk_150 != 0.0f) { @@ -73,8 +73,8 @@ void func_8087B7E8(BgHaka* this, PlayState* play) { player->stateFlags2 &= ~PLAYER_STATE2_4; if (!Play_InCsMode(play)) { Message_StartTextbox(play, 0x5073, NULL); - this->dyna.actor.params = 100; - this->actionFunc = func_8087BAE4; + this->dyna.actor.params = 100; // Used as a cooldown for displaying Graveyard Boy's warning + this->actionFunc = BgHaka_IdleLockedClosed; } } else if (0.0f < this->dyna.unk_150 || (play->sceneId == SCENE_LAKE_HYLIA && !LINK_IS_ADULT && !Flags_GetSwitch(play, 0x23))) { @@ -82,24 +82,25 @@ void func_8087B7E8(BgHaka* this, PlayState* play) { player->stateFlags2 &= ~PLAYER_STATE2_4; } else { this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y + 0x8000; - this->actionFunc = func_8087B938; + this->actionFunc = BgHaka_Pull; } } - func_8087B758(this, player); + BgHaka_CheckPlayerOnDirtPatch(this, player); } -void func_8087B938(BgHaka* this, PlayState* play) { +void BgHaka_Pull(BgHaka* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 sp38; + s32 reachedMaxPullDist; this->dyna.actor.speed += 0.05f; this->dyna.actor.speed = CLAMP_MAX(this->dyna.actor.speed, 1.5f); - sp38 = Math_StepToF(&this->dyna.actor.minVelocityY, 60.0f, this->dyna.actor.speed); + // minVelocityY is used to keep track of the distance pulled from home + reachedMaxPullDist = Math_StepToF(&this->dyna.actor.minVelocityY, 60.0f, this->dyna.actor.speed); this->dyna.actor.world.pos.x = Math_SinS(this->dyna.actor.world.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.z = Math_CosS(this->dyna.actor.world.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.home.pos.z; - if (sp38 != 0) { + if (reachedMaxPullDist) { this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~PLAYER_STATE2_4; if (this->dyna.actor.params == 1) { @@ -108,12 +109,12 @@ void func_8087B938(BgHaka* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_POH, this->dyna.actor.home.pos.x, this->dyna.actor.home.pos.y, this->dyna.actor.home.pos.z, 0, this->dyna.actor.shape.rot.y, 0, 1); } - this->actionFunc = func_8087BAAC; + this->actionFunc = BgHaka_IdleOpened; } - func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); } -void func_8087BAAC(BgHaka* this, PlayState* play) { +void BgHaka_IdleOpened(BgHaka* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->dyna.unk_150 != 0.0f) { @@ -122,7 +123,7 @@ void func_8087BAAC(BgHaka* this, PlayState* play) { } } -void func_8087BAE4(BgHaka* this, PlayState* play) { +void BgHaka_IdleLockedClosed(BgHaka* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 pad; @@ -134,9 +135,9 @@ void func_8087BAE4(BgHaka* this, PlayState* play) { player->stateFlags2 &= ~PLAYER_STATE2_4; } if (this->dyna.actor.params == 0) { - this->actionFunc = func_8087B7E8; + this->actionFunc = BgHaka_IdleClosed; } - func_8087B758(this, player); + BgHaka_CheckPlayerOnDirtPatch(this, player); } void BgHaka_Update(Actor* thisx, PlayState* play) { @@ -151,12 +152,10 @@ void BgHaka_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_haka.c", 406), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_haka.c", 406); gSPDisplayList(POLY_OPA_DISP++, gGravestoneStoneDL); Matrix_Translate(0.0f, 0.0f, thisx->minVelocityY * 10.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_haka.c", 416), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_haka.c", 416); gSPDisplayList(POLY_XLU_DISP++, gGravestoneEarthDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_haka.c", 421); diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index ed45e2cfc8..3b5985d8f1 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -52,7 +52,7 @@ static f32 sStatueDistToPlayer = 0; static s16 sStatueRotY; -ActorInit Bg_Haka_Gate_InitVars = { +ActorProfile Bg_Haka_Gate_Profile = { /**/ ACTOR_BG_HAKA_GATE, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -74,7 +74,7 @@ void BgHakaGate_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; DynaPolyActor_Init(&this->dyna, 0); if (thisx->params == BGHAKAGATE_SKULL) { @@ -194,7 +194,7 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, PlayState* play) { this->vTurnRateDeg10 = CLAMP_MAX(this->vTurnRateDeg10, 5); turnFinished = Math_StepToS(&this->vTurnAngleDeg10, 600, this->vTurnRateDeg10); turnAngle = this->vTurnAngleDeg10 * this->vTurnDirection; - this->dyna.actor.shape.rot.y = (this->vRotYDeg10 + turnAngle) * 0.1f * (0x10000 / 360.0f); + this->dyna.actor.shape.rot.y = DEG_TO_BINANG((this->vRotYDeg10 + turnAngle) * 0.1f); if ((player->stateFlags2 & PLAYER_STATE2_4) && (sStatueDistToPlayer > 0.0f)) { player->actor.world.pos.x = this->dyna.actor.home.pos.x + @@ -215,7 +215,7 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, PlayState* play) { this->actionFunc = BgHakaGate_StatueIdle; this->dyna.unk_150 = 0.0f; } - func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); } void BgHakaGate_FloorClosed(BgHakaGate* this, PlayState* play) { @@ -277,7 +277,7 @@ void BgHakaGate_GateOpen(BgHakaGate* this, PlayState* play) { this->dyna.actor.flags &= ~ACTOR_FLAG_4; this->actionFunc = BgHakaGate_DoNothing; } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); } } @@ -326,11 +326,8 @@ void BgHakaGate_DrawFlame(BgHakaGate* this, PlayState* play) { Matrix_RotateY(BINANG_TO_RAD(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play))), MTXMODE_APPLY); scale = this->vFlameScale * 0.00001f; - if (1) {} - Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_haka_gate.c", 744), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_haka_gate.c", 744); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_haka_gate.c", 749); } @@ -356,15 +353,13 @@ void BgHakaGate_Draw(Actor* thisx, PlayState* play) { Matrix_Translate(0.0f, 0.0f, -2000.0f, MTXMODE_APPLY); Matrix_RotateX(BINANG_TO_RAD(this->vOpenAngle), MTXMODE_APPLY); Matrix_Translate(0.0f, 0.0f, 2000.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_haka_gate.c", 788), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_haka_gate.c", 788); gSPDisplayList(POLY_OPA_DISP++, object_haka_objects_DL_010A10); Matrix_Put(¤tMtxF); Matrix_Translate(0.0f, 0.0f, 2000.0f, MTXMODE_APPLY); Matrix_RotateX(BINANG_TO_RAD(-this->vOpenAngle), MTXMODE_APPLY); Matrix_Translate(0.0f, 0.0f, -2000.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_haka_gate.c", 796), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_haka_gate.c", 796); gSPDisplayList(POLY_OPA_DISP++, object_haka_objects_DL_010C10); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_haka_gate.c", 800); } else { diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h index d111c64b76..1297692754 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h @@ -19,7 +19,7 @@ typedef struct BgHakaGate { /* 0x0172 */ s16 actionVar5; } BgHakaGate; // size = 0x0174 -typedef enum { +typedef enum BgHakaGateType { BGHAKAGATE_STATUE, BGHAKAGATE_FLOOR, BGHAKAGATE_GATE, diff --git a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c index b1d38adc98..e660ccd38a 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c +++ b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c @@ -24,7 +24,7 @@ void BgHakaHuta_SlideOpen(BgHakaHuta* this, PlayState* play); void func_8087D720(BgHakaHuta* this, PlayState* play); void BgHakaHuta_DoNothing(BgHakaHuta* this, PlayState* play); -ActorInit Bg_Haka_Huta_InitVars = { +ActorProfile Bg_Haka_Huta_Profile = { /**/ ACTOR_BG_HAKA_HUTA, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -49,7 +49,7 @@ void BgHakaHuta_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); CollisionHeader_GetVirtual(&gBotwCoffinLidCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - this->unk_16A = (thisx->params >> 8) & 0xFF; + this->unk_16A = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if (Flags_GetSwitch(play, thisx->params)) { this->counter = -1; diff --git a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c index 39082dcb64..3d6de9f415 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c +++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c @@ -19,7 +19,7 @@ void func_8087DB24(BgHakaMegane* this, PlayState* play); void func_8087DBF0(BgHakaMegane* this, PlayState* play); void BgHakaMegane_DoNothing(BgHakaMegane* this, PlayState* play); -ActorInit Bg_Haka_Megane_InitVars = { +ActorProfile Bg_Haka_Megane_Profile = { /**/ ACTOR_BG_HAKA_MEGANE, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c index 6c8e3bf119..3bcaac0071 100644 --- a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c +++ b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c @@ -23,7 +23,7 @@ void func_8087E288(BgHakaMeganeBG* this, PlayState* play); void func_8087E2D8(BgHakaMeganeBG* this, PlayState* play); void func_8087E34C(BgHakaMeganeBG* this, PlayState* play); -ActorInit Bg_Haka_MeganeBG_InitVars = { +ActorProfile Bg_Haka_MeganeBG_Profile = { /**/ ACTOR_BG_HAKA_MEGANEBG, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -59,7 +59,7 @@ void BgHakaMeganeBG_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->unk_168 = (thisx->params >> 8) & 0xFF; + this->unk_168 = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if (thisx->params == 2) { @@ -147,7 +147,7 @@ void func_8087E10C(BgHakaMeganeBG* this, PlayState* play) { if (!Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 640.0f, this->dyna.actor.velocity.y)) { - func_8002F974(&this->dyna.actor, NA_SE_EV_CHINETRAP_DOWN - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_CHINETRAP_DOWN - SFX_FLAG); } if (this->unk_16A == 0) { @@ -159,7 +159,7 @@ void func_8087E10C(BgHakaMeganeBG* this, PlayState* play) { void func_8087E1E0(BgHakaMeganeBG* this, PlayState* play) { Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 16.0f / 3.0f); - func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG); if (this->unk_16A != 0) { this->unk_16A--; @@ -173,7 +173,7 @@ void func_8087E1E0(BgHakaMeganeBG* this, PlayState* play) { void func_8087E258(BgHakaMeganeBG* this, PlayState* play) { this->dyna.actor.shape.rot.y += 0x180; - func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); } void func_8087E288(BgHakaMeganeBG* this, PlayState* play) { @@ -190,7 +190,7 @@ void func_8087E2D8(BgHakaMeganeBG* this, PlayState* play) { Actor_SetFocus(&this->dyna.actor, 50.0f); this->actionFunc = func_8087E34C; } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_OPEN); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_METALDOOR_OPEN); } } diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c index c96055ac4a..4bb944cb9d 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c @@ -8,9 +8,9 @@ #include "assets/objects/object_haka_objects/object_haka_objects.h" #include "assets/objects/object_ice_objects/object_ice_objects.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4) -typedef enum { +typedef enum SpinningScytheTrapMode { /* 0 */ SCYTHE_TRAP_SHADOW_TEMPLE, /* 1 */ SCYTHE_TRAP_SHADOW_TEMPLE_INVISIBLE, /* 2 */ SCYTHE_TRAP_ICE_CAVERN @@ -26,7 +26,7 @@ void BgHakaSgami_Draw(Actor* thisx, PlayState* play); void BgHakaSgami_SetupSpin(BgHakaSgami* this, PlayState* play); void BgHakaSgami_Spin(BgHakaSgami* this, PlayState* play); -ActorInit Bg_Haka_Sgami_InitVars = { +ActorProfile Bg_Haka_Sgami_Profile = { /**/ ACTOR_BG_HAKA_SGAMI, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -41,7 +41,7 @@ ActorInit Bg_Haka_Sgami_InitVars = { static ColliderTrisElementInit sTrisElementsInit[4] = { { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -52,7 +52,7 @@ static ColliderTrisElementInit sTrisElementsInit[4] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -63,7 +63,7 @@ static ColliderTrisElementInit sTrisElementsInit[4] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -74,7 +74,7 @@ static ColliderTrisElementInit sTrisElementsInit[4] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -87,7 +87,7 @@ static ColliderTrisElementInit sTrisElementsInit[4] = { static ColliderTrisInit sTrisInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -100,7 +100,7 @@ static ColliderTrisInit sTrisInit = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -108,7 +108,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -122,7 +122,7 @@ static CollisionCheckInfoInit sColChkInfoInit = { 0, 80, 130, MASS_IMMOVABLE }; static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE), - ICHAIN_U8(targetMode, 4, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_4, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; @@ -138,8 +138,8 @@ void BgHakaSgami_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); - this->unk_151 = thisx->params & 0xFF; - thisx->params = (thisx->params >> 8) & 0xFF; + this->unk_151 = PARAMS_GET_U(thisx->params, 0, 8); + thisx->params = PARAMS_GET_U(thisx->params, 8, 8); if (this->unk_151 != 0) { thisx->flags |= ACTOR_FLAG_REACT_TO_LENS; @@ -170,7 +170,7 @@ void BgHakaSgami_Init(Actor* thisx, PlayState* play) { if (thisx->params == SCYTHE_TRAP_SHADOW_TEMPLE) { this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_HAKA_OBJECTS); - thisx->flags &= ~ACTOR_FLAG_0; + thisx->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else { this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_ICE_OBJECTS); this->colliderScytheCenter.dim.radius = 30; @@ -282,14 +282,14 @@ void BgHakaSgami_Spin(BgHakaSgami* this, PlayState* play) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderScythe.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderScytheCenter.base); - func_8002F974(&this->actor, NA_SE_EV_ROLLCUTTER_MOTOR - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_ROLLCUTTER_MOTOR - SFX_FLAG); } void BgHakaSgami_Update(Actor* thisx, PlayState* play) { BgHakaSgami* this = (BgHakaSgami*)thisx; Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29)) || + if (!(player->stateFlags1 & (PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29)) || (this->actionFunc == BgHakaSgami_SetupSpin)) { this->actionFunc(this, play); } diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c index 19e7e18a74..2a8eadb18e 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c @@ -21,7 +21,7 @@ void BgHakaShip_SetupCrash(BgHakaShip* this, PlayState* play); void BgHakaShip_CrashShake(BgHakaShip* this, PlayState* play); void BgHakaShip_CrashFall(BgHakaShip* this, PlayState* play); -ActorInit Bg_Haka_Ship_InitVars = { +ActorProfile Bg_Haka_Ship_Profile = { /**/ ACTOR_BG_HAKA_SHIP, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -44,7 +44,7 @@ void BgHakaShip_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - this->switchFlag = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); this->dyna.actor.params &= 0xFF; if (this->dyna.actor.params == 0) { @@ -164,7 +164,7 @@ void BgHakaShip_CrashShake(BgHakaShip* this, PlayState* play) { this->dyna.actor.gravity = -1.0f; this->actionFunc = BgHakaShip_CrashFall; } - func_8002F974(&this->dyna.actor, NA_SE_EV_BLOCKSINK - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_BLOCKSINK - SFX_FLAG); } void BgHakaShip_CrashFall(BgHakaShip* this, PlayState* play) { @@ -205,23 +205,19 @@ void BgHakaShip_Draw(Actor* thisx, PlayState* play) { if (1) {} if (this->dyna.actor.params == 0) { - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_haka_ship.c", 534), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_haka_ship.c", 534); gSPDisplayList(POLY_OPA_DISP++, object_haka_objects_DL_00D330); angleTemp = BINANG_TO_RAD(this->yOffset); Matrix_Translate(-3670.0f, 620.0f, 1150.0f, MTXMODE_APPLY); Matrix_RotateZ(angleTemp, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_haka_ship.c", 547), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_haka_ship.c", 547); gSPDisplayList(POLY_OPA_DISP++, object_haka_objects_DL_005A70); Matrix_Translate(0.0f, 0.0f, -2300.0f, MTXMODE_APPLY); Matrix_RotateZ(-(2.0f * angleTemp), MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_haka_ship.c", 556), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_haka_ship.c", 556); gSPDisplayList(POLY_OPA_DISP++, object_haka_objects_DL_005A70); } else { - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_haka_ship.c", 562), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_haka_ship.c", 562); gSPDisplayList(POLY_OPA_DISP++, object_haka_objects_DL_00E910); } diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c index c65a1a2f0a..2210299c76 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c @@ -29,7 +29,7 @@ void func_80880D68(BgHakaTrap* this); static UNK_TYPE D_80880F30 = 0; -ActorInit Bg_Haka_Trap_InitVars = { +ActorProfile Bg_Haka_Trap_Profile = { /**/ ACTOR_BG_HAKA_TRAP, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -43,7 +43,7 @@ ActorInit Bg_Haka_Trap_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -51,7 +51,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -64,7 +64,7 @@ static ColliderCylinderInit sCylinderInit = { static ColliderTrisElementInit sTrisElementsInit[2] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00020000, 0x00, 0x00 }, ATELEM_NONE, @@ -75,7 +75,7 @@ static ColliderTrisElementInit sTrisElementsInit[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00020000, 0x00, 0x00 }, ATELEM_NONE, @@ -88,7 +88,7 @@ static ColliderTrisElementInit sTrisElementsInit[2] = { static ColliderTrisInit sTrisInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -208,7 +208,7 @@ void func_8087FFC0(BgHakaTrap* this, PlayState* play) { f32 zNonNegative; Player* player = GET_PLAYER(play); - func_8002DBD0(&this->dyna.actor, &sp28, &player->actor.world.pos); + Actor_WorldToActorCoords(&this->dyna.actor, &sp28, &player->actor.world.pos); sine = Math_SinS(this->dyna.actor.shape.rot.y); cosine = Math_CosS(this->dyna.actor.shape.rot.y); @@ -232,7 +232,7 @@ void func_808801B8(BgHakaTrap* this, PlayState* play) { if ((D_80880F30 == 0) && (!Player_InCsMode(play))) { if (!Math_StepToF(&this->dyna.actor.world.pos.x, this->dyna.actor.home.pos.x, 0.5f)) { - func_8002F974(&this->dyna.actor, NA_SE_EV_TRAP_OBJ_SLIDE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_TRAP_OBJ_SLIDE - SFX_FLAG); } else if (this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL) { D_80881018 |= 1; } else if (this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL_2) { @@ -262,7 +262,7 @@ void func_808802D8(BgHakaTrap* this, PlayState* play) { this->timer--; } - func_8002F974(&this->dyna.actor, NA_SE_EV_BURN_OUT - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_BURN_OUT - SFX_FLAG); for (i = 0; i < 2; i++) { f32 rand = Rand_ZeroOne(); @@ -385,7 +385,7 @@ void func_808806BC(BgHakaTrap* this, PlayState* play) { } if (this->dyna.actor.velocity.y >= 0.01f) { - func_8002F974(&this->dyna.actor, NA_SE_EV_CHINETRAP_DOWN - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_CHINETRAP_DOWN - SFX_FLAG); } if (this->timer == 0) { @@ -431,7 +431,7 @@ void func_808809E4(BgHakaTrap* this, PlayState* play, s16 arg2) { Player* player = GET_PLAYER(play); Vec3f sp18; - func_8002DBD0(&this->dyna.actor, &sp18, &player->actor.world.pos); + Actor_WorldToActorCoords(&this->dyna.actor, &sp18, &player->actor.world.pos); if ((fabsf(sp18.x) < 70.0f) && (fabsf(sp18.y) < 100.0f) && (sp18.z < 500.0f) && (GET_PLAYER(play)->currentBoots != PLAYER_BOOTS_IRON)) { @@ -455,7 +455,7 @@ void func_80880AE8(BgHakaTrap* this, PlayState* play) { this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z; if (this->dyna.actor.world.rot.z >= 0x1801) { - func_8002F974(&this->dyna.actor, NA_SE_EV_WIND_TRAP - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_WIND_TRAP - SFX_FLAG); } func_808809E4(this, play, this->dyna.actor.world.rot.z); @@ -466,7 +466,7 @@ void func_80880C0C(BgHakaTrap* this, PlayState* play) { this->timer--; } - func_8002F974(&this->dyna.actor, NA_SE_EV_WIND_TRAP - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_WIND_TRAP - SFX_FLAG); if (this->timer == 0) { this->timer = 1; diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h index 111e08e242..a6a34dd426 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef enum { +typedef enum HakaTrapType { /* 0x00 */ HAKA_TRAP_GUILLOTINE_SLOW, /* 0x01 */ HAKA_TRAP_SPIKED_BOX, /* 0x02 */ HAKA_TRAP_SPIKED_WALL, diff --git a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c index c499e31915..de6dd98196 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c @@ -18,7 +18,7 @@ void BgHakaTubo_Draw(Actor* thisx, PlayState* play); void BgHakaTubo_Idle(BgHakaTubo* this, PlayState* play); void BgHakaTubo_DropCollectible(BgHakaTubo* this, PlayState* play); -ActorInit Bg_Haka_Tubo_InitVars = { +ActorProfile Bg_Haka_Tubo_Profile = { /**/ ACTOR_BG_HAKA_TUBO, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -32,7 +32,7 @@ ActorInit Bg_Haka_Tubo_InitVars = { static ColliderCylinderInit sPotColliderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -40,7 +40,7 @@ static ColliderCylinderInit sPotColliderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -52,7 +52,7 @@ static ColliderCylinderInit sPotColliderInit = { static ColliderCylinderInit sFlamesColliderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_ON | OC1_TYPE_PLAYER, @@ -60,7 +60,7 @@ static ColliderCylinderInit sFlamesColliderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000008, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -114,7 +114,7 @@ void BgHakaTubo_Idle(BgHakaTubo* this, PlayState* play) { // Colliding with flame circle if (this->flamesCollider.base.atFlags & AT_HIT) { this->flamesCollider.base.atFlags &= ~AT_HIT; - func_8002F71C(play, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsPlayer, 5.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsPlayer, 5.0f); } // Colliding with collider inside the pot if (this->potCollider.base.acFlags & AC_HIT) { @@ -197,7 +197,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, PlayState* play) { Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } else { // Drops a small key and sets a collect flag - collectibleParams = ((this->dyna.actor.params & 0x3F) << 8) | ITEM00_SMALL_KEY; + collectibleParams = (PARAMS_GET_U(this->dyna.actor.params, 0, 6) << 8) | ITEM00_SMALL_KEY; Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } if (collectibleParams != -1) { @@ -228,14 +228,12 @@ void BgHakaTubo_DrawFlameCircle(BgHakaTubo* this, PlayState* play) { MTXMODE_NEW); Matrix_RotateY(BINANG_TO_RAD(this->dyna.actor.shape.rot.y), MTXMODE_APPLY); Matrix_Scale(0.07f, 0.04f, 0.07f, MTXMODE_APPLY); - if (1) {} gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 0, 170, 255, 255); gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 255); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, this->fireScroll & 127, 0, 32, 64, 1, 0, (this->fireScroll * -15) & 0xFF, 32, 64)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_haka_tubo.c", 497), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_haka_tubo.c", 497); gSPDisplayList(POLY_XLU_DISP++, gEffFireCircleDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_haka_tubo.c", 501); diff --git a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c index e40af64939..be7a79332d 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c +++ b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c @@ -18,7 +18,7 @@ void BgHakaWater_LowerWater(BgHakaWater* this, PlayState* play); void BgHakaWater_Wait(BgHakaWater* this, PlayState* play); void BgHakaWater_ChangeWaterLevel(BgHakaWater* this, PlayState* play); -ActorInit Bg_Haka_Water_InitVars = { +ActorProfile Bg_Haka_Water_Profile = { /**/ ACTOR_BG_HAKA_WATER, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -85,9 +85,9 @@ void BgHakaWater_ChangeWaterLevel(BgHakaWater* this, PlayState* play) { } if (this->actor.home.pos.y < this->actor.world.pos.y) { - func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } else { - func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f) != 0) { @@ -125,8 +125,7 @@ void BgHakaWater_Draw(Actor* thisx, PlayState* play) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play->gameplayFrames % 128, play->gameplayFrames % 128, 32, 32, 1, 0, (0 - play->gameplayFrames) % 128, 32, 32)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_haka_water.c", 312), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_haka_water.c", 312); gSPDisplayList(POLY_XLU_DISP++, gBotwWaterRingDL); Matrix_Translate(0.0f, 92.0f, -1680.0f, MTXMODE_NEW); @@ -138,8 +137,7 @@ void BgHakaWater_Draw(Actor* thisx, PlayState* play) { gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)(5.1f * temp)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_haka_water.c", 328), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_haka_water.c", 328); gSPDisplayList(POLY_XLU_DISP++, gBotwWaterFallDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_haka_water.c", 332); diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c index 781dd579b4..9b7ed31904 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c @@ -10,7 +10,7 @@ #define FLAGS ACTOR_FLAG_4 -typedef enum { +typedef enum ShadowTempleAssetsType { /* 0x0 */ STA_GIANT_BIRD_STATUE, /* 0x1 */ STA_BOMBABLE_SKULL_WALL, /* 0x2 */ STA_BOMBABLE_RUBBLE, @@ -34,7 +34,7 @@ void BgHakaZou_DoNothing(BgHakaZou* this, PlayState* play); static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -42,7 +42,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -54,7 +54,7 @@ static ColliderCylinderInit sCylinderInit = { static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; -ActorInit Bg_Haka_Zou_InitVars = { +ActorProfile Bg_Haka_Zou_Profile = { /**/ ACTOR_BG_HAKA_ZOU, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -77,7 +77,7 @@ void BgHakaZou_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if (thisx->params == STA_UNKNOWN) { diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index 85549a63d7..ab1b72b4d1 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -5,6 +5,7 @@ */ #include "z_bg_heavy_block.h" +#include "global.h" #include "assets/objects/object_heavy_object/object_heavy_object.h" #include "quake.h" #include "terminal.h" @@ -27,7 +28,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play); void BgHeavyBlock_Land(BgHeavyBlock* this, PlayState* play); void BgHeavyBlock_DoNothing(BgHeavyBlock* this, PlayState* play); -ActorInit Bg_Heavy_Block_InitVars = { +ActorProfile Bg_Heavy_Block_Profile = { /**/ ACTOR_BG_HEAVY_BLOCK, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -76,7 +77,7 @@ void BgHeavyBlock_InitPiece(BgHeavyBlock* this, f32 scale) { void BgHeavyBlock_SetupDynapoly(BgHeavyBlock* this, PlayState* play) { s32 pad[2]; CollisionHeader* colHeader = NULL; - this->dyna.actor.flags |= ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_17; + this->dyna.actor.flags |= ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_CARRY_X_ROT_INFLUENCE; DynaPolyActor_Init(&this->dyna, 0); CollisionHeader_GetVirtual(&gHeavyBlockCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); @@ -94,7 +95,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { thisx->params |= 4; } - switch (thisx->params & 0xFF) { + switch (PARAMS_GET_U(thisx->params, 0, 8)) { case HEAVYBLOCK_BIG_PIECE: thisx->draw = BgHeavyBlock_DrawPiece; this->actionFunc = BgHeavyBlock_MovePiece; @@ -114,7 +115,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { case HEAVYBLOCK_BREAKABLE: BgHeavyBlock_SetupDynapoly(this, play); - if (Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6))) { Actor_Kill(thisx); return; } @@ -124,7 +125,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: BgHeavyBlock_SetupDynapoly(this, play); - if (Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6))) { this->actionFunc = BgHeavyBlock_DoNothing; thisx->shape.rot.x = thisx->world.rot.x = 0x8AD0; thisx->shape.rot.y = thisx->world.rot.y = 0xC000; @@ -151,7 +152,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { void BgHeavyBlock_Destroy(Actor* thisx, PlayState* play) { BgHeavyBlock* this = (BgHeavyBlock*)thisx; - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case HEAVYBLOCK_BIG_PIECE: break; case HEAVYBLOCK_SMALL_PIECE: @@ -320,7 +321,7 @@ void BgHeavyBlock_Wait(BgHeavyBlock* this, PlayState* play) { if (Actor_HasParent(&this->dyna.actor, play)) { this->timer = 0; - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case HEAVYBLOCK_BREAKABLE: OnePointCutscene_Init(play, 4020, 270, &this->dyna.actor, CAM_ID_MAIN); break; @@ -393,10 +394,10 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) { if (this->dyna.actor.home.pos.y <= yIntersect) { Rumble_Request(0.0f, 255, 60, 4); - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case HEAVYBLOCK_BREAKABLE: BgHeavyBlock_SpawnPieces(this, play); - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); Actor_Kill(&this->dyna.actor); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); @@ -420,7 +421,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) { Quake_SetDuration(quakeIndex, 40); this->actionFunc = BgHeavyBlock_Land; - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); break; case HEAVYBLOCK_UNBREAKABLE: Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U); @@ -457,7 +458,7 @@ void BgHeavyBlock_Land(BgHeavyBlock* this, PlayState* play) { this->dyna.actor.world.pos = this->dyna.actor.home.pos; Actor_MoveXZGravity(&this->dyna.actor); this->dyna.actor.home.pos = this->dyna.actor.world.pos; - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: BgHeavyBlock_SpawnDust(play, Rand_CenteredFloat(30.0f) + 1678.0f, Rand_ZeroFloat(100.0f) + 1286.0f, Rand_CenteredFloat(30.0f) + 552.0f, 0.0f, 0.0f, 0.0f, 0); @@ -505,15 +506,14 @@ void BgHeavyBlock_Draw(Actor* thisx, PlayState* play) { Matrix_MultVec3f(&D_80884ED4, &thisx->home.pos); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_heavy_block.c", 931), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_heavy_block.c", 931); gSPDisplayList(POLY_OPA_DISP++, gHeavyBlockEntirePillarDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_heavy_block.c", 935); } void BgHeavyBlock_DrawPiece(Actor* thisx, PlayState* play) { - switch (thisx->params & 0xFF) { + switch (PARAMS_GET_U(thisx->params, 0, 8)) { case HEAVYBLOCK_BIG_PIECE: Matrix_Translate(50.0f, -260.0f, -20.0f, MTXMODE_APPLY); Gfx_DrawDListOpa(play, gHeavyBlockBigPieceDL); diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h index c6c21d2dfb..a93f5cc3a0 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h @@ -2,11 +2,11 @@ #define Z_BG_HEAVY_BLOCK_H #include "ultra64.h" -#include "global.h" +#include "z64actor.h" struct BgHeavyBlock; -typedef void (*BgHeavyBlockActionFunc)(struct BgHeavyBlock*, PlayState*); +typedef void (*BgHeavyBlockActionFunc)(struct BgHeavyBlock*, struct PlayState*); typedef struct BgHeavyBlock { /* 0x0000 */ DynaPolyActor dyna; @@ -16,7 +16,7 @@ typedef struct BgHeavyBlock { /* 0x0174 */ BgHeavyBlockActionFunc actionFunc; } BgHeavyBlock; // size = 0x0178 -typedef enum { +typedef enum HeavyBlockType { /* 0x00 */ HEAVYBLOCK_UNBREAKABLE, /* 0x01 */ HEAVYBLOCK_BREAKABLE, /* 0x02 */ HEAVYBLOCK_BIG_PIECE, diff --git a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c index 3ac82ceb5c..91b5a96031 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c @@ -21,7 +21,7 @@ void BgHidanCurtain_TurnOn(BgHidanCurtain* this, PlayState* play); void BgHidanCurtain_TurnOff(BgHidanCurtain* this, PlayState* play); void BgHidanCurtain_WaitForTimer(BgHidanCurtain* this, PlayState* play); -typedef struct { +typedef struct BgHidanCurtainParams { /* 0x00 */ s16 radius; /* 0x02 */ s16 height; /* 0x04 */ f32 scale; @@ -31,7 +31,7 @@ typedef struct { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_ON | OC1_TYPE_PLAYER, @@ -39,7 +39,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -53,7 +53,7 @@ static CollisionCheckInfoInit sCcInfoInit = { 1, 80, 100, MASS_IMMOVABLE }; static BgHidanCurtainParams sHCParams[] = { { 81, 144, 0.090f, 144.0f, 5.0f }, { 46, 88, 0.055f, 88.0f, 3.0f } }; -ActorInit Bg_Hidan_Curtain_InitVars = { +ActorProfile Bg_Hidan_Curtain_Profile = { /**/ ACTOR_BG_HIDAN_CURTAIN, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -72,7 +72,7 @@ void BgHidanCurtain_Init(Actor* thisx, PlayState* play) { PRINTF("Curtain (arg_data 0x%04x)\n", this->actor.params); Actor_SetFocus(&this->actor, 20.0f); - this->type = (thisx->params >> 0xC) & 0xF; + this->type = PARAMS_GET_U(thisx->params, 12, 4); if (this->type > 6) { // "Type is not set" PRINTF("Error : object のタイプが設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_hidan_curtain.c", 352, @@ -83,7 +83,7 @@ void BgHidanCurtain_Init(Actor* thisx, PlayState* play) { this->size = ((this->type == 2) || (this->type == 4)) ? 1 : 0; hcParams = &sHCParams[this->size]; - this->treasureFlag = (thisx->params >> 6) & 0x3F; + this->treasureFlag = PARAMS_GET_U(thisx->params, 6, 6); thisx->params &= 0x3F; if (IS_DEBUG && ((this->actor.params < 0) || (this->actor.params > 0x3F))) { @@ -196,7 +196,7 @@ void BgHidanCurtain_WaitForTimer(BgHidanCurtain* this, PlayState* play) { this->actionFunc = BgHidanCurtain_TurnOn; } if ((this->type == 1) || (this->type == 3)) { - func_8002F994(&this->actor, this->timer); + Actor_PlaySfx_FlaggedTimer(&this->actor, this->timer); } } @@ -212,7 +212,7 @@ void BgHidanCurtain_Update(Actor* thisx, PlayState* play2) { } else { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; - func_8002F71C(play, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 1.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 1.0f); } if ((this->type == 4) || (this->type == 5)) { this->actor.world.pos.y = (2.0f * this->actor.home.pos.y) - hcParams->riseDist - this->actor.world.pos.y; @@ -230,7 +230,7 @@ void BgHidanCurtain_Update(Actor* thisx, PlayState* play2) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); if (!IS_CUTSCENE_LAYER) { - func_8002F974(&this->actor, NA_SE_EV_FIRE_PILLAR_S - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_FIRE_PILLAR_S - SFX_FLAG); } } else if ((this->type == 1) && Flags_GetTreasure(play, this->treasureFlag)) { Actor_Kill(&this->actor); @@ -253,8 +253,7 @@ void BgHidanCurtain_Draw(Actor* thisx, PlayState* play) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, this->texScroll & 0x7F, 0, 0x20, 0x40, 1, 0, (this->texScroll * -0xF) & 0xFF, 0x20, 0x40)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_hidan_curtain.c", 698), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_hidan_curtain.c", 698); gSPDisplayList(POLY_XLU_DISP++, gEffFireCircleDL); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c index 16e1d80423..83e984ee7b 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c @@ -17,7 +17,7 @@ void BgHidanDalm_Draw(Actor* thisx, PlayState* play); void BgHidanDalm_Wait(BgHidanDalm* this, PlayState* play); void BgHidanDalm_Shrink(BgHidanDalm* this, PlayState* play); -ActorInit Bg_Hidan_Dalm_InitVars = { +ActorProfile Bg_Hidan_Dalm_Profile = { /**/ ACTOR_BG_HIDAN_DALM, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -32,7 +32,7 @@ ActorInit Bg_Hidan_Dalm_InitVars = { static ColliderTrisElementInit sTrisElementInit[4] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, ATELEM_NONE, @@ -43,7 +43,7 @@ static ColliderTrisElementInit sTrisElementInit[4] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, ATELEM_NONE, @@ -54,7 +54,7 @@ static ColliderTrisElementInit sTrisElementInit[4] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, ATELEM_NONE, @@ -65,7 +65,7 @@ static ColliderTrisElementInit sTrisElementInit[4] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, ATELEM_NONE, @@ -78,7 +78,7 @@ static ColliderTrisElementInit sTrisElementInit[4] = { static ColliderTrisInit sTrisInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -106,7 +106,7 @@ void BgHidanDalm_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, thisx, &sTrisInit, this->colliderItems); - this->switchFlag = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if (Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(thisx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index fcf260aee9..1b367c2ebf 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -21,7 +21,7 @@ void BgHidanFirewall_Erupt(BgHidanFirewall* this, PlayState* play); void BgHidanFirewall_Collide(BgHidanFirewall* this, PlayState* play); void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, PlayState* play); -ActorInit Bg_Hidan_Firewall_InitVars = { +ActorProfile Bg_Hidan_Firewall_Profile = { /**/ ACTOR_BG_HIDAN_FIREWALL, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -35,7 +35,7 @@ ActorInit Bg_Hidan_Firewall_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_ON | OC1_TYPE_PLAYER, @@ -43,7 +43,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -81,12 +81,12 @@ void BgHidanFirewall_Destroy(Actor* thisx, PlayState* play) { s32 BgHidanFirewall_CheckProximity(BgHidanFirewall* this, PlayState* play) { Player* player; - Vec3f distance; + Vec3f playerRelativePos; player = GET_PLAYER(play); - func_8002DBD0(&this->actor, &distance, &player->actor.world.pos); + Actor_WorldToActorCoords(&this->actor, &playerRelativePos, &player->actor.world.pos); - if (fabsf(distance.x) < 100.0f && fabsf(distance.z) < 120.0f) { + if (fabsf(playerRelativePos.x) < 100.0f && fabsf(playerRelativePos.z) < 120.0f) { return 1; } return 0; @@ -132,44 +132,44 @@ void BgHidanFirewall_Collide(BgHidanFirewall* this, PlayState* play) { phi_a3 = this->actor.shape.rot.y + 0x8000; } - func_8002F71C(play, &this->actor, 5.0f, phi_a3, 1.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 5.0f, phi_a3, 1.0f); } void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, PlayState* play) { Player* player; - Vec3f sp30; + Vec3f playerRelativePos; f32 temp_ret; f32 sp28; f32 phi_f0; player = GET_PLAYER(play); - func_8002DBD0(&this->actor, &sp30, &player->actor.world.pos); - if (sp30.x < -70.0f) { - sp30.x = -70.0f; + Actor_WorldToActorCoords(&this->actor, &playerRelativePos, &player->actor.world.pos); + if (playerRelativePos.x < -70.0f) { + playerRelativePos.x = -70.0f; } else { - if (70.0f < sp30.x) { + if (70.0f < playerRelativePos.x) { phi_f0 = 70.0f; } else { - phi_f0 = sp30.x; + phi_f0 = playerRelativePos.x; } - sp30.x = phi_f0; + playerRelativePos.x = phi_f0; } if (this->actor.params == 0) { - if (0.0f < sp30.z) { - sp30.z = -25.0f; + if (0.0f < playerRelativePos.z) { + playerRelativePos.z = -25.0f; this->actor.params = -1; } else { - sp30.z = 25.0f; + playerRelativePos.z = 25.0f; this->actor.params = 1; } } else { - sp30.z = this->actor.params * 25.0f; + playerRelativePos.z = this->actor.params * 25.0f; } sp28 = Math_SinS(this->actor.shape.rot.y); temp_ret = Math_CosS(this->actor.shape.rot.y); - this->collider.dim.pos.x = this->actor.world.pos.x + sp30.x * temp_ret + sp30.z * sp28; - this->collider.dim.pos.z = this->actor.world.pos.z - sp30.x * sp28 + sp30.z * temp_ret; + this->collider.dim.pos.x = this->actor.world.pos.x + playerRelativePos.x * temp_ret + playerRelativePos.z * sp28; + this->collider.dim.pos.z = this->actor.world.pos.z - playerRelativePos.x * sp28 + playerRelativePos.z * temp_ret; } void BgHidanFirewall_Update(Actor* thisx, PlayState* play) { @@ -188,7 +188,7 @@ void BgHidanFirewall_Update(Actor* thisx, PlayState* play) { BgHidanFirewall_ColliderFollowPlayer(this, play); CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - func_8002F974(&this->actor, NA_SE_EV_FIRE_PLATE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_FIRE_PLATE - SFX_FLAG); } } @@ -209,8 +209,7 @@ void BgHidanFirewall_Draw(Actor* thisx, PlayState* play) { IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, this->unk_150); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x01, 255, 255, 0, 150); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 255); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_hidan_firewall.c", 458), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_hidan_firewall.c", 458); gSPDisplayList(POLY_XLU_DISP++, gFireTempleFireballUpperHalfDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_hidan_firewall.c", 463); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c index 846903cfb1..1b4ecb10eb 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c @@ -18,7 +18,7 @@ void BgHidanFslift_Idle(BgHidanFslift* this, PlayState* play); void BgHidanFslift_Descend(BgHidanFslift* this, PlayState* play); void BgHidanFslift_Ascend(BgHidanFslift* this, PlayState* play); -ActorInit Bg_Hidan_Fslift_InitVars = { +ActorProfile Bg_Hidan_Fslift_Profile = { /**/ ACTOR_BG_HIDAN_FSLIFT, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -102,7 +102,7 @@ void BgHidanFslift_Descend(BgHidanFslift* this, PlayState* play) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); BgHidanFslift_SetupIdle(this); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG); } BgHidanFslift_SetHookshotTargetPos(this); } @@ -113,7 +113,7 @@ void BgHidanFslift_Ascend(BgHidanFslift* this, PlayState* play) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); BgHidanFslift_SetupIdle(this); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG); } } else { BgHidanFslift_SetupIdle(this); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c index 170f0677ba..b8d0e63402 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c @@ -11,7 +11,7 @@ #define FLAGS ACTOR_FLAG_4 -typedef enum { +typedef enum HidanFwbigMoveState { /* 0 */ FWBIG_MOVE, /* 1 */ FWBIG_RESET, /* 2 */ FWBIG_KILL @@ -31,7 +31,7 @@ void BgHidanFwbig_WaitForTimer(BgHidanFwbig* this, PlayState* play); void BgHidanFwbig_WaitForPlayer(BgHidanFwbig* this, PlayState* play); void BgHidanFwbig_Move(BgHidanFwbig* this, PlayState* play); -ActorInit Bg_Hidan_Fwbig_InitVars = { +ActorProfile Bg_Hidan_Fwbig_Profile = { /**/ ACTOR_BG_HIDAN_FWBIG, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -45,7 +45,7 @@ ActorInit Bg_Hidan_Fwbig_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_ON | OC1_TYPE_PLAYER, @@ -53,7 +53,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -76,7 +76,7 @@ void BgHidanFwbig_Init(Actor* thisx, PlayState* play2) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; - this->direction = (u16)(thisx->params >> 8); + this->direction = (u16)PARAMS_GET_NOMASK(thisx->params, 8); thisx->params &= 0xFF; if (this->direction != 0) { this->actor.home.pos.x = 1560.0f; @@ -170,7 +170,7 @@ void BgHidanFwbig_WaitForTimer(BgHidanFwbig* this, PlayState* play) { if (this->timer == 0) { this->actionFunc = BgHidanFwbig_Rise; } - func_8002F994(&this->actor, this->timer); + Actor_PlaySfx_FlaggedTimer(&this->actor, this->timer); } void BgHidanFwbig_WaitForPlayer(BgHidanFwbig* this, PlayState* play) { @@ -195,25 +195,25 @@ void BgHidanFwbig_Move(BgHidanFwbig* this, PlayState* play) { void BgHidanFwbig_MoveCollider(BgHidanFwbig* this, PlayState* play) { Player* player = GET_PLAYER(play); - Vec3f projPos; + Vec3f playerRelativePos; f32 cs; f32 sn; - func_8002DBD0(&this->actor, &projPos, &player->actor.world.pos); - projPos.z = ((projPos.z >= 0.0f) ? 1.0f : -1.0f) * 25.0f * -1.0f; + Actor_WorldToActorCoords(&this->actor, &playerRelativePos, &player->actor.world.pos); + playerRelativePos.z = ((playerRelativePos.z >= 0.0f) ? 1.0f : -1.0f) * 25.0f * -1.0f; if (this->direction == 0) { - projPos.x = CLAMP(projPos.x, -360.0f, 360.0f); + playerRelativePos.x = CLAMP(playerRelativePos.x, -360.0f, 360.0f); } else { - projPos.x = CLAMP(projPos.x, -500.0f, 500.0f); + playerRelativePos.x = CLAMP(playerRelativePos.x, -500.0f, 500.0f); } sn = Math_SinS(this->actor.shape.rot.y); cs = Math_CosS(this->actor.shape.rot.y); - this->collider.dim.pos.x = this->actor.world.pos.x + (projPos.x * cs) + (projPos.z * sn); - this->collider.dim.pos.z = this->actor.world.pos.z - (projPos.x * sn) + (projPos.z * cs); + this->collider.dim.pos.x = this->actor.world.pos.x + (playerRelativePos.x * cs) + (playerRelativePos.z * sn); + this->collider.dim.pos.z = this->actor.world.pos.z - (playerRelativePos.x * sn) + (playerRelativePos.z * cs); this->collider.dim.pos.y = this->actor.world.pos.y; - this->actor.world.rot.y = (projPos.z < 0.0f) ? this->actor.shape.rot.y : this->actor.shape.rot.y + 0x8000; + this->actor.world.rot.y = (playerRelativePos.z < 0.0f) ? this->actor.shape.rot.y : this->actor.shape.rot.y + 0x8000; } void BgHidanFwbig_Update(Actor* thisx, PlayState* play) { @@ -222,7 +222,7 @@ void BgHidanFwbig_Update(Actor* thisx, PlayState* play) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; - func_8002F71C(play, &this->actor, 5.0f, this->actor.world.rot.y, 1.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 5.0f, this->actor.world.rot.y, 1.0f); if (this->direction != 0) { this->actionFunc = BgHidanFwbig_Lower; } @@ -236,9 +236,9 @@ void BgHidanFwbig_Update(Actor* thisx, PlayState* play) { if ((this->actor.home.pos.y - 200.0f) < this->actor.world.pos.y) { if (!IS_CUTSCENE_LAYER) { - func_8002F974(&this->actor, NA_SE_EV_BURNING - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_BURNING - SFX_FLAG); } else if ((s16)this->actor.world.pos.x == -513) { - func_8002F974(&this->actor, NA_SE_EV_FLAME_OF_FIRE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_FLAME_OF_FIRE - SFX_FLAG); } BgHidanFwbig_MoveCollider(this, play); CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); @@ -268,8 +268,7 @@ void BgHidanFwbig_Draw(Actor* thisx, PlayState* play) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play->gameplayFrames % 0x80, 0, 0x20, 0x40, 1, 0, (u8)(play->gameplayFrames * -15), 0x20, 0x40)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_hidan_fwbig.c", 660), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_hidan_fwbig.c", 660); gSPDisplayList(POLY_XLU_DISP++, gFireTempleBigFireWallDL); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index 2e6bf978f7..77971798c0 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -5,6 +5,7 @@ */ #include "z_bg_hidan_hamstep.h" +#include "versions.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" #include "quake.h" @@ -28,7 +29,7 @@ static f32 sYPosOffsets[] = { static ColliderTrisElementInit sTrisElementsInit[2] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, ATELEM_NONE, @@ -39,7 +40,7 @@ static ColliderTrisElementInit sTrisElementsInit[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, ATELEM_NONE, @@ -52,7 +53,7 @@ static ColliderTrisElementInit sTrisElementsInit[2] = { static ColliderTrisInit sTrisInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -63,7 +64,7 @@ static ColliderTrisInit sTrisInit = { sTrisElementsInit, }; -ActorInit Bg_Hidan_Hamstep_InitVars = { +ActorProfile Bg_Hidan_Hamstep_Profile = { /**/ ACTOR_BG_HIDAN_HAMSTEP, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -113,7 +114,7 @@ s32 BgHidanHamstep_SpawnChildren(BgHidanHamstep* this, PlayState* play2) { pos.z = (((i * 160.0f) + 60.0f) * cos) + this->dyna.actor.home.pos.z; params = (i + 1) & 0xFF; - params |= (this->dyna.actor.params & 0xFF00); + params |= PARAMS_GET_NOSHIFT(this->dyna.actor.params, 8, 8); step = (BgHidanHamstep*)Actor_SpawnAsChild(&play->actorCtx, &step->dyna.actor, play, ACTOR_BG_HIDAN_HAMSTEP, pos.x, pos.y, pos.z, this->dyna.actor.world.rot.x, @@ -138,7 +139,7 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if ((this->dyna.actor.params & 0xFF) == 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) { Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->colliderItems); @@ -152,7 +153,7 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { } } - if ((this->dyna.actor.params & 0xFF) == 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) { CollisionHeader_GetVirtual(&gFireTempleStoneStep1Col, &colHeader); } else { CollisionHeader_GetVirtual(&gFireTempleStoneStep2Col, &colHeader); @@ -160,16 +161,16 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0xFF)) { - if ((this->dyna.actor.params & 0xFF) == 0) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 8))) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + (-20.0f); BgHidanHamstep_SetupAction(this, 4); } else { this->dyna.actor.world.pos.y = - sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y; + sYPosOffsets[PARAMS_GET_U(this->dyna.actor.params, 0, 8) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 4); } - } else if ((this->dyna.actor.params & 0xFF) == 0) { + } else if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) { BgHidanHamstep_SetupAction(this, 0); } else { BgHidanHamstep_SetupAction(this, 2); @@ -178,7 +179,7 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { this->dyna.actor.gravity = -1.2f; this->dyna.actor.minVelocityY = -12.0f; - if ((this->dyna.actor.params & 0xFF) == 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) { // "Fire Temple Object [Hammer Step] appears" PRINTF("◯◯◯炎の神殿オブジェクト【ハンマーステップ】出現\n"); if (BgHidanHamstep_SpawnChildren(this, play) == 0) { @@ -201,7 +202,7 @@ void BgHidanHamstep_Destroy(Actor* thisx, PlayState* play) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); - if ((this->dyna.actor.params & 0xFF) == 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) { Collider_DestroyTris(play, &this->collider); } } @@ -232,7 +233,7 @@ void func_80888638(BgHidanHamstep* this, PlayState* play) { BgHidanHamstep* child = (BgHidanHamstep*)this->dyna.actor.child; while (child != NULL) { - if ((child->dyna.actor.params & 0xFF) != 0) { + if (PARAMS_GET_U(child->dyna.actor.params, 0, 8) != 0) { func_808884C8(child, play); } child = (BgHidanHamstep*)child->dyna.actor.child; @@ -242,7 +243,7 @@ void func_80888638(BgHidanHamstep* this, PlayState* play) { void func_80888694(BgHidanHamstep* this, BgHidanHamstep* parent) { BgHidanHamstep* child; - if ((this->dyna.actor.params & 0xFF) >= 2) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) >= 2) { if (parent->dyna.actor.world.pos.y < this->dyna.actor.world.pos.y) { this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y; } else if ((this->dyna.actor.world.pos.y - parent->dyna.actor.world.pos.y) < -100.0f) { @@ -267,7 +268,7 @@ void func_80888734(BgHidanHamstep* this) { if (parent != NULL) { this->dyna.actor.velocity.y = parent->dyna.actor.velocity.y; - if ((this->dyna.actor.params & 0xFF) == 1) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 1) { this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y - 100.0f; } else { this->dyna.actor.world.pos.y += (this->dyna.actor.velocity.y * frameDivisor); @@ -283,7 +284,7 @@ void func_808887C4(BgHidanHamstep* this, PlayState* play) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_HAMMER_SWITCH); this->collider.base.acFlags = AC_NONE; BgHidanHamstep_SetupAction(this, 1); - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0xFF); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 8)); } else { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } @@ -329,9 +330,9 @@ void func_808889B8(BgHidanHamstep* this, PlayState* play) { func_80888734(this); if ((parent->action == 4) || ((parent->action == 3) && (parent->unk_244 >= 5))) { - if ((this->dyna.actor.params & 0xFF) == 1) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 1) { this->dyna.actor.world.pos.y = - sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y; + sYPosOffsets[PARAMS_GET_U(this->dyna.actor.params, 0, 8) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 4); } else { BgHidanHamstep_SetupAction(this, 3); @@ -348,7 +349,7 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { func_80888694(this, (BgHidanHamstep*)this->dyna.actor.parent); #if IS_DEBUG - if (((this->dyna.actor.params & 0xFF) <= 0) || ((this->dyna.actor.params & 0xFF) >= 6)) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) <= 0 || PARAMS_GET_U(this->dyna.actor.params, 0, 8) >= 6) { // "[Hammer Step] arg_data strange (arg_data = %d)" PRINTF("【ハンマーステップ】 arg_data おかしい (arg_data = %d)", this->dyna.actor.params); PRINTF("%s %d\n", "../z_bg_hidan_hamstep.c", 696); @@ -356,13 +357,13 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { #endif if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) <= - sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1]) && + sYPosOffsets[PARAMS_GET_U(this->dyna.actor.params, 0, 8) - 1]) && (this->dyna.actor.velocity.y <= 0.0f)) { this->unk_244++; if (this->unk_244 >= 7) { this->dyna.actor.world.pos.y = - sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y; + sYPosOffsets[PARAMS_GET_U(this->dyna.actor.params, 0, 8) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 3); } else { this->dyna.actor.velocity.y *= -0.24f; @@ -379,9 +380,11 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { Rumble_Request(SQ(100.0f), 255, 20, 150); func_808884C8(this, play); - if ((this->dyna.actor.params & 0xFF) == 5) { +#if OOT_VERSION >= PAL_1_0 + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 5) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } +#endif PRINTF("B(%d)\n", this->dyna.actor.params); } @@ -403,10 +406,9 @@ void BgHidanHamstep_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_hidan_hamstep.c", 787), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_hidan_hamstep.c", 787); - if ((thisx->params & 0xFF) == 0) { + if (PARAMS_GET_U(thisx->params, 0, 8) == 0) { gSPDisplayList(POLY_OPA_DISP++, gFireTempleStoneStep1DL); } else { gSPDisplayList(POLY_OPA_DISP++, gFireTempleStoneStep2DL); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c index d2f5a4f8c6..3ef030dedd 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c @@ -18,7 +18,7 @@ void func_8088960C(BgHidanHrock* this, PlayState* play); void func_808896B8(BgHidanHrock* this, PlayState* play); void func_808894A4(BgHidanHrock* this, PlayState* play); -ActorInit Bg_Hidan_Hrock_InitVars = { +ActorProfile Bg_Hidan_Hrock_Profile = { /**/ ACTOR_BG_HIDAN_HROCK, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -33,7 +33,7 @@ ActorInit Bg_Hidan_Hrock_InitVars = { static ColliderTrisElementInit sTrisElementsInit[2] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, ATELEM_NONE, @@ -44,7 +44,7 @@ static ColliderTrisElementInit sTrisElementsInit[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, ATELEM_NONE, @@ -57,7 +57,7 @@ static ColliderTrisElementInit sTrisElementsInit[2] = { static ColliderTrisInit sTrisInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -85,8 +85,8 @@ void BgHidanHrock_Init(Actor* thisx, PlayState* play) { Vec3f* vtx; Actor_ProcessInitChain(thisx, sInitChain); - this->unk_16A = thisx->params & 0x3F; - thisx->params = (thisx->params >> 8) & 0xFF; + this->unk_16A = PARAMS_GET_U(thisx->params, 0, 6); + thisx->params = PARAMS_GET_U(thisx->params, 8, 8); Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, thisx, &sTrisInit, this->colliderItems); DynaPolyActor_Init(&this->dyna, 0); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index df811c7c45..c5414e5b39 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -23,7 +23,7 @@ void func_80889D28(BgHidanKousi* this, PlayState* play); static f32 D_80889E40[] = { 120.0f, 150.0f, 150.0f }; -ActorInit Bg_Hidan_Kousi_InitVars = { +ActorProfile Bg_Hidan_Kousi_Profile = { /**/ ACTOR_BG_HIDAN_KOUSI, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -69,21 +69,21 @@ void BgHidanKousi_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); Actor_SetFocus(thisx, 50.0f); - PRINTF("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, thisx->params & 0xFF, - ((s32)thisx->params >> 8) & 0xFF); + PRINTF("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, + PARAMS_GET_U(thisx->params, 0, 8), PARAMS_GET_U((s32)thisx->params, 8, 8)); Actor_ProcessInitChain(thisx, sInitChain); #if IS_DEBUG - if (((thisx->params & 0xFF) < 0) || ((thisx->params & 0xFF) >= 3)) { + if (PARAMS_GET_U(thisx->params, 0, 8) < 0 || PARAMS_GET_U(thisx->params, 0, 8) >= 3) { PRINTF("arg_data おかしい 【格子】\n"); } #endif - CollisionHeader_GetVirtual(sMetalFencesCollisions[thisx->params & 0xFF], &colHeader); + CollisionHeader_GetVirtual(sMetalFencesCollisions[PARAMS_GET_U(thisx->params, 0, 8)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - thisx->world.rot.y = D_80889E7C[this->dyna.actor.params & 0xFF] + thisx->shape.rot.y; - if (Flags_GetSwitch(play, (thisx->params >> 8) & 0xFF)) { + thisx->world.rot.y = D_80889E7C[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] + thisx->shape.rot.y; + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 8))) { func_80889ACC(this); BgHidanKousi_SetupAction(this, func_80889D28); } else { @@ -99,15 +99,15 @@ void BgHidanKousi_Destroy(Actor* thisx, PlayState* play) { void func_80889ACC(BgHidanKousi* this) { s32 pad[2]; Vec3s* rot = &this->dyna.actor.world.rot; - f32 temp1 = D_80889E40[this->dyna.actor.params & 0xFF] * Math_SinS(rot->y); - f32 temp2 = D_80889E40[this->dyna.actor.params & 0xFF] * Math_CosS(rot->y); + f32 temp1 = D_80889E40[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] * Math_SinS(rot->y); + f32 temp2 = D_80889E40[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] * Math_CosS(rot->y); this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x + temp1; this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z + temp2; } void func_80889B5C(BgHidanKousi* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0xFF)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 8))) { BgHidanKousi_SetupAction(this, func_80889BC0); OnePointCutscene_Attention(play, &this->dyna.actor); this->unk_168 = 0xC8; @@ -128,18 +128,18 @@ void func_80889C18(BgHidanKousi* this, PlayState* play) { BgHidanKousi_SetupAction(this, func_80889C90); } Actor_MoveXZGravity(&this->dyna.actor); - func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); } void func_80889C90(BgHidanKousi* this, PlayState* play) { Actor_UpdatePos(&this->dyna.actor); - if (D_80889E40[this->dyna.actor.params & 0xFF] < + if (D_80889E40[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] < Math_Vec3f_DistXYZ(&this->dyna.actor.home.pos, &this->dyna.actor.world.pos)) { func_80889ACC(this); BgHidanKousi_SetupAction(this, func_80889D28); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); } } @@ -157,9 +157,8 @@ void BgHidanKousi_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_hidan_kousi.c", 354), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, sMetalFencesDLs[thisx->params & 0xFF]); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_hidan_kousi.c", 354); + gSPDisplayList(POLY_OPA_DISP++, sMetalFencesDLs[PARAMS_GET_U(thisx->params, 0, 8)]); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_hidan_kousi.c", 359); } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c index d9ce7e6ab2..05e513a461 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c @@ -11,7 +11,7 @@ #define FLAGS 0 -typedef enum { +typedef enum FireTempleBombableObjectsType { /* 0 */ CRACKED_STONE_FLOOR, /* 1 */ BOMBABLE_WALL, /* 2 */ LARGE_BOMBABLE_WALL @@ -22,7 +22,7 @@ void BgHidanKowarerukabe_Destroy(Actor* thisx, PlayState* play); void BgHidanKowarerukabe_Update(Actor* thisx, PlayState* play); void BgHidanKowarerukabe_Draw(Actor* thisx, PlayState* play); -ActorInit Bg_Hidan_Kowarerukabe_InitVars = { +ActorProfile Bg_Hidan_Kowarerukabe_Profile = { /**/ ACTOR_BG_HIDAN_KOWARERUKABE, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -43,7 +43,7 @@ static Gfx* sBreakableWallDLists[] = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -56,7 +56,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -77,9 +77,9 @@ void BgHidanKowarerukabe_InitDynaPoly(BgHidanKowarerukabe* this, PlayState* play CollisionHeader* colHeader = NULL; s32 pad2; - if (collisionHeaders[this->dyna.actor.params & 0xFF] != NULL) { + if (collisionHeaders[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] != NULL) { DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(collisionHeaders[this->dyna.actor.params & 0xFF], &colHeader); + CollisionHeader_GetVirtual(collisionHeaders[PARAMS_GET_U(this->dyna.actor.params, 0, 8)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); } else { this->dyna.bgId = BGACTOR_NEG_ONE; @@ -94,14 +94,15 @@ void BgHidanKowarerukabe_InitColliderSphere(BgHidanKowarerukabe* this, PlayState Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems); - this->collider.elements[0].dim.modelSphere.radius = sphereRadii[this->dyna.actor.params & 0xFF]; - this->collider.elements[0].dim.modelSphere.center.y = sphereYPositions[this->dyna.actor.params & 0xFF]; + this->collider.elements[0].dim.modelSphere.radius = sphereRadii[PARAMS_GET_U(this->dyna.actor.params, 0, 8)]; + this->collider.elements[0].dim.modelSphere.center.y = sphereYPositions[PARAMS_GET_U(this->dyna.actor.params, 0, 8)]; } void BgHidanKowarerukabe_OffsetActorYPos(BgHidanKowarerukabe* this) { static f32 actorYPosOffsets[] = { 0.7f, 0.0f, 0.0f }; - this->dyna.actor.world.pos.y = actorYPosOffsets[this->dyna.actor.params & 0xFF] + this->dyna.actor.home.pos.y; + this->dyna.actor.world.pos.y = + actorYPosOffsets[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] + this->dyna.actor.home.pos.y; } static InitChainEntry sInitChain[] = { @@ -115,8 +116,8 @@ void BgHidanKowarerukabe_Init(Actor* thisx, PlayState* play) { BgHidanKowarerukabe_InitDynaPoly(this, play); - if (((this->dyna.actor.params & 0xFF) < CRACKED_STONE_FLOOR) || - ((this->dyna.actor.params & 0xFF) > LARGE_BOMBABLE_WALL)) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) < CRACKED_STONE_FLOOR || + PARAMS_GET_U(this->dyna.actor.params, 0, 8) > LARGE_BOMBABLE_WALL) { // "Error: Fire Temple Breakable Walls. arg_data I can't determine the (%s %d)(arg_data 0x%04x)" PRINTF("Error : 炎の神殿 壊れる壁 の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n", "../z_bg_hidan_kowarerukabe.c", 254, this->dyna.actor.params); @@ -124,7 +125,7 @@ void BgHidanKowarerukabe_Init(Actor* thisx, PlayState* play) { return; } - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -283,7 +284,7 @@ void BgHidanKowarerukabe_LargeWallBreak(BgHidanKowarerukabe* this, PlayState* pl } void BgHidanKowarerukabe_Break(BgHidanKowarerukabe* this, PlayState* play) { - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case CRACKED_STONE_FLOOR: BgHidanKowarerukabe_FloorBreak(this, play); break; @@ -304,9 +305,9 @@ void BgHidanKowarerukabe_Update(Actor* thisx, PlayState* play) { if (Actor_GetCollidedExplosive(play, &this->collider.base) != NULL) { BgHidanKowarerukabe_Break(this, play); - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); - if ((this->dyna.actor.params & 0xFF) == 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) { SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_EXPLOSION); } else { SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); @@ -327,9 +328,8 @@ void BgHidanKowarerukabe_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_hidan_kowarerukabe.c", 568), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, sBreakableWallDLists[this->dyna.actor.params & 0xFF]); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_hidan_kowarerukabe.c", 568); + gSPDisplayList(POLY_OPA_DISP++, sBreakableWallDLists[PARAMS_GET_U(this->dyna.actor.params, 0, 8)]); Collider_UpdateSpheres(0, &this->collider); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index ef6bb43867..02d864f83f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -29,7 +29,7 @@ void func_8088BC40(PlayState* play, BgHidanRock* this); static Vec3f D_8088BF60 = { 3310.0f, 120.0f, 0.0f }; -ActorInit Bg_Hidan_Rock_InitVars = { +ActorProfile Bg_Hidan_Rock_Profile = { /**/ ACTOR_BG_HIDAN_ROCK, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -43,7 +43,7 @@ ActorInit Bg_Hidan_Rock_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -51,7 +51,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -74,10 +74,10 @@ void BgHidanRock_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - this->type = thisx->params & 0xFF; + this->type = PARAMS_GET_U(thisx->params, 0, 8); this->unk_169 = 0; - thisx->params = ((thisx->params) >> 8) & 0xFF; + thisx->params = PARAMS_GET_U(thisx->params, 8, 8); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit); @@ -157,7 +157,7 @@ void func_8088B268(BgHidanRock* this, PlayState* play) { this->timer = 5; } - func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); } else { player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; @@ -369,8 +369,7 @@ void func_8088BC40(PlayState* play, BgHidanRock* this) { Matrix_Scale(6.0f, this->unk_16C, 6.0f, MTXMODE_APPLY); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sVerticalFlamesTexs[play->gameplayFrames & 7])); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_hidan_rock.c", 853), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_hidan_rock.c", 853); gSPDisplayList(POLY_XLU_DISP++, gFireTempleBigVerticalFlameDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_hidan_rock.c", 857); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c index 3303036963..0b4df94e12 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c @@ -14,7 +14,7 @@ void BgHidanRsekizou_Destroy(Actor* thisx, PlayState* play); void BgHidanRsekizou_Update(Actor* thisx, PlayState* play); void BgHidanRsekizou_Draw(Actor* thisx, PlayState* play); -ActorInit Bg_Hidan_Rsekizou_InitVars = { +ActorProfile Bg_Hidan_Rsekizou_Profile = { /**/ ACTOR_BG_HIDAN_RSEKIZOU, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -29,7 +29,7 @@ ActorInit Bg_Hidan_Rsekizou_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[6] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -40,7 +40,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -51,7 +51,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -62,7 +62,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -73,7 +73,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -84,7 +84,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -97,7 +97,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[6] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -178,7 +178,7 @@ void BgHidanRsekizou_Update(Actor* thisx, PlayState* play) { } CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); - func_8002F974(&this->dyna.actor, NA_SE_EV_FIRE_PILLAR - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_FIRE_PILLAR - SFX_FLAG); } Gfx* BgHidanRsekizou_DrawFireball(PlayState* play, BgHidanRsekizou* this, s16 frame, MtxF* mf, s32 a, @@ -234,8 +234,7 @@ void BgHidanRsekizou_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_hidan_rsekizou.c", 568), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_hidan_rsekizou.c", 568); gSPDisplayList(POLY_OPA_DISP++, gFireTempleSpinningFlamethrowerDL); Matrix_MtxFCopy(&mf, &gMtxFClear); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c index 5cfaa8ce9c..e5051d0461 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c @@ -17,7 +17,7 @@ void BgHidanSekizou_Draw(Actor* thisx, PlayState* play2); void func_8088D434(BgHidanSekizou* this, PlayState* play); void func_8088D720(BgHidanSekizou* this, PlayState* play); -ActorInit Bg_Hidan_Sekizou_InitVars = { +ActorProfile Bg_Hidan_Sekizou_Profile = { /**/ ACTOR_BG_HIDAN_SEKIZOU, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -32,7 +32,7 @@ ActorInit Bg_Hidan_Sekizou_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[6] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -43,7 +43,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -54,7 +54,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -65,7 +65,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -76,7 +76,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -87,7 +87,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -100,7 +100,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[6] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_ON | OC1_TYPE_PLAYER, @@ -259,7 +259,7 @@ void func_8088D750(BgHidanSekizou* this, PlayState* play) { phi_a3 = -0x4000; } } - func_8002F71C(play, &this->dyna.actor, 5.0f, phi_a3, 1.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->dyna.actor, 5.0f, phi_a3, 1.0f); } void BgHidanSekizou_Update(Actor* thisx, PlayState* play2) { @@ -284,20 +284,20 @@ void BgHidanSekizou_Update(Actor* thisx, PlayState* play2) { if (this->unk_168[0] > 0) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - func_8002F974(&this->dyna.actor, NA_SE_EV_FIRE_PILLAR - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_FIRE_PILLAR - SFX_FLAG); } } else { if ((this->unk_168[0] > 0) || (this->unk_168[1] > 0) || (this->unk_168[2] > 0) || (this->unk_168[3] > 0)) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - func_8002F974(&this->dyna.actor, NA_SE_EV_FIRE_PILLAR - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_FIRE_PILLAR - SFX_FLAG); } } } -Gfx* func_8088D9F4(PlayState* play, BgHidanSekizou* this, s16 arg2, MtxF* arg3, f32 arg4, f32 arg5, s16 arg6, +Gfx* func_8088D9F4(PlayState* play, BgHidanSekizou* this, s16 arg2, MtxF* mtx, f32 arg4, f32 arg5, s16 arg6, Gfx* arg7) { - f32 temp_f0; + MtxF* mtx2; f32 temp_f2; f32 phi_f12; IF_F3DEX3_DONT_SKIP_TEX_INIT(); @@ -314,14 +314,15 @@ Gfx* func_8088D9F4(PlayState* play, BgHidanSekizou* this, s16 arg2, MtxF* arg3, gDPSetPrimColor(arg7++, 0, 1, 255, 255, 0, 150); gDPSetEnvColor(arg7++, 255, 0, 0, 255); - arg3->xx = arg3->yy = arg3->zz = (0.7f * phi_f12) + 0.5f; + mtx2 = mtx; + mtx2->xx = mtx2->yy = mtx2->zz = (0.7f * phi_f12) + 0.5f; - temp_f2 = (arg3->xx * 10.0f * phi_f12) + 20.0f; - arg3->xw = (temp_f2 * arg4) + this->dyna.actor.world.pos.x; - arg3->yw = this->dyna.actor.world.pos.y + 30.0f + (.7f * phi_f12); - arg3->zw = (temp_f2 * arg5) + this->dyna.actor.world.pos.z; + temp_f2 = ((mtx2->xx * 10.0f) * phi_f12) + 20.0f; + mtx2->xw = (temp_f2 * arg4) + this->dyna.actor.world.pos.x; + mtx2->yw = this->dyna.actor.world.pos.y + 30.0f + (.7f * phi_f12); + mtx2->zw = (temp_f2 * arg5) + this->dyna.actor.world.pos.z; gSPMatrix(arg7++, - Matrix_MtxFToMtx(MATRIX_CHECK_FLOATS(arg3, "../z_bg_hidan_sekizou.c", 711), + Matrix_MtxFToMtx(MATRIX_CHECK_FLOATS(mtx2, "../z_bg_hidan_sekizou.c", 711), GRAPH_ALLOC(play->state.gfxCtx, sizeof(Mtx))), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -399,8 +400,7 @@ void BgHidanSekizou_Draw(Actor* thisx, PlayState* play2) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_hidan_sekizou.c", 827); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_hidan_sekizou.c", 831), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_hidan_sekizou.c", 831); if (this->dyna.actor.params == 0) { gSPDisplayList(POLY_OPA_DISP++, gFireTempleStationaryFlamethrowerShortDL); } else { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c index 860557a76d..7c52b3e66a 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c @@ -21,7 +21,7 @@ void func_8088E760(BgHidanSima* this, PlayState* play); void func_8088E7A8(BgHidanSima* this, PlayState* play); void func_8088E90C(BgHidanSima* this); -ActorInit Bg_Hidan_Sima_InitVars = { +ActorProfile Bg_Hidan_Sima_Profile = { /**/ ACTOR_BG_HIDAN_SIMA, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -36,7 +36,7 @@ ActorInit Bg_Hidan_Sima_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[2] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -47,7 +47,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -60,7 +60,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[2] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -188,7 +188,7 @@ void func_8088E7A8(BgHidanSima* this, PlayState* play) { this->timer = 20; this->actionFunc = func_8088E760; } - func_8002F974(&this->dyna.actor, NA_SE_EV_FIRE_PILLAR - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_FIRE_PILLAR - SFX_FLAG); } void func_8088E90C(BgHidanSima* this) { @@ -226,9 +226,9 @@ void BgHidanSima_Update(Actor* thisx, PlayState* play) { Gfx* func_8088EB54(PlayState* play, BgHidanSima* this, Gfx* gfx) { MtxF mtxF; - s32 phi_s5; s32 s3; s32 v0; + s32 phi_s5; f32 cos; f32 sin; s32 pad[2]; @@ -282,8 +282,7 @@ void BgHidanSima_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_hidan_sima.c", 641); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_hidan_sima.c", 645), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_hidan_sima.c", 645); if (this->dyna.actor.params == 0) { gSPDisplayList(POLY_OPA_DISP++, gFireTempleStonePlatform1DL); } else { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c index e69cca84aa..b5d5f4f372 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c @@ -18,7 +18,7 @@ void func_8088F4B8(BgHidanSyoku* this, PlayState* play); void func_8088F514(BgHidanSyoku* this, PlayState* play); void func_8088F62C(BgHidanSyoku* this, PlayState* play); -ActorInit Bg_Hidan_Syoku_InitVars = { +ActorProfile Bg_Hidan_Syoku_Profile = { /**/ ACTOR_BG_HIDAN_SYOKU, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -74,7 +74,7 @@ void func_8088F514(BgHidanSyoku* this, PlayState* play) { if (this->timer == 0) { func_8088F47C(this); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG); } } @@ -86,7 +86,7 @@ void func_8088F5A0(BgHidanSyoku* this, PlayState* play) { if (this->timer == 0) { func_8088F47C(this); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c index 56b3d62ad8..f257aa5ef4 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c +++ b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c @@ -23,7 +23,7 @@ static Color_RGBA8 sWhite = { 250, 250, 250, 255 }; static Color_RGBA8 sGray = { 180, 180, 180, 255 }; static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; -ActorInit Bg_Ice_Objects_InitVars = { +ActorProfile Bg_Ice_Objects_Profile = { /**/ ACTOR_BG_ICE_OBJECTS, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -192,7 +192,7 @@ void BgIceObjects_Slide(BgIceObjects* this, PlayState* play) { pos.x = thisx->world.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) + (Math_CosS(this->dyna.unk_158) * spread); pos.z = thisx->world.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) - (Math_SinS(this->dyna.unk_158) * spread); func_8002829C(play, &pos, &velocity, &sZeroVec, &sWhite, &sGray, 250, Rand_S16Offset(40, 15)); - func_8002F974(thisx, NA_SE_PL_SLIP_ICE_LEVEL - SFX_FLAG); + Actor_PlaySfx_Flagged(thisx, NA_SE_PL_SLIP_ICE_LEVEL - SFX_FLAG); } BgIceObjects_CheckPits(this, play); } diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index 644efc3855..86829d0ce1 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -9,8 +9,8 @@ #define FLAGS 0 -#define BGICESHELTER_GET_TYPE(thisx) (((thisx)->params >> 8) & 7) -#define BGICESHELTER_NO_SWITCH_FLAG(thisx) (((thisx)->params >> 6) & 1) +#define BGICESHELTER_GET_TYPE(thisx) PARAMS_GET_U((thisx)->params, 8, 3) +#define BGICESHELTER_NO_SWITCH_FLAG(thisx) PARAMS_GET_U((thisx)->params, 6, 1) void BgIceShelter_Init(Actor* thisx, PlayState* play); void BgIceShelter_Destroy(Actor* thisx, PlayState* play); @@ -23,7 +23,7 @@ void BgIceShelter_SetupMelt(BgIceShelter* this); void BgIceShelter_Idle(BgIceShelter* this, PlayState* play); void BgIceShelter_Melt(BgIceShelter* this, PlayState* play); -ActorInit Bg_Ice_Shelter_InitVars = { +ActorProfile Bg_Ice_Shelter_Profile = { /**/ ACTOR_BG_ICE_SHELTER, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -42,7 +42,7 @@ static Color_RGBA8 sSteamEnvColor = { 180, 180, 180, 255 }; static ColliderCylinderInit sCylinderInit1 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_OTHER, OC1_ON | OC1_TYPE_ALL, @@ -50,7 +50,7 @@ static ColliderCylinderInit sCylinderInit1 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -62,7 +62,7 @@ static ColliderCylinderInit sCylinderInit1 = { static ColliderCylinderInit sCylinderInit2 = { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, @@ -70,7 +70,7 @@ static ColliderCylinderInit sCylinderInit2 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFF6, 0x00, 0x00 }, ATELEM_NONE, @@ -183,7 +183,8 @@ void BgIceShelter_Init(Actor* thisx, PlayState* play) { this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; // The only red ice actor in the game that doesn't use a switch flag is the one for King Zora - if (!BGICESHELTER_NO_SWITCH_FLAG(&this->dyna.actor) && (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F))) { + if (!BGICESHELTER_NO_SWITCH_FLAG(&this->dyna.actor) && + (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)))) { Actor_Kill(&this->dyna.actor); return; } @@ -432,7 +433,7 @@ void BgIceShelter_Melt(BgIceShelter* this, PlayState* play) { if (this->alpha <= 0) { if (!BGICESHELTER_NO_SWITCH_FLAG(&this->dyna.actor)) { - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); } if (type == RED_ICE_KING_ZORA) { @@ -457,8 +458,7 @@ void BgIceShelter_Draw(Actor* thisx, PlayState* play2) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_ice_shelter.c", 751), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_ice_shelter.c", 751); switch (BGICESHELTER_GET_TYPE(&this->dyna.actor)) { case RED_ICE_LARGE: diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h index 7fb4a0514b..765b017b32 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h @@ -8,7 +8,7 @@ struct BgIceShelter; typedef void (*BgIceShelterActionFunc)(struct BgIceShelter*, PlayState*); -typedef enum { +typedef enum RedIceType { /* 0 */ RED_ICE_LARGE, // Large red ice block /* 1 */ RED_ICE_SMALL, // Small red ice block /* 2 */ RED_ICE_PLATFORM, // Complex structure that can be climbed and walked on. Unused in vanilla OoT, used in MQ to cover the Ice Cavern Map chest diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c index 0d8f5a34d2..a27d455caf 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c @@ -18,7 +18,7 @@ void func_80891CF4(BgIceShutter* this, PlayState* play); void func_80891D6C(BgIceShutter* this, PlayState* play); void func_80891DD4(BgIceShutter* this, PlayState* play); -ActorInit Bg_Ice_Shutter_InitVars = { +ActorProfile Bg_Ice_Shutter_Profile = { /**/ ACTOR_BG_ICE_SHUTTER, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -53,8 +53,8 @@ void BgIceShutter_Init(Actor* thisx, PlayState* play) { colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 0); - sp28 = this->dyna.actor.params & 0xFF; - this->dyna.actor.params = (this->dyna.actor.params >> 8) & 0xFF; + sp28 = PARAMS_GET_U(this->dyna.actor.params, 0, 8); + this->dyna.actor.params = PARAMS_GET_U(this->dyna.actor.params, 8, 8); CollisionHeader_GetVirtual(&object_ice_objects_Col_002854, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); if (sp28 == 2) { diff --git a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c index 30a2c281c8..a9a560bc09 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c +++ b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c @@ -22,7 +22,7 @@ void BgIceTurara_Regrow(BgIceTurara* this, PlayState* play); static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -30,7 +30,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x4FC007CA, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -40,7 +40,7 @@ static ColliderCylinderInit sCylinderInit = { { 13, 120, 0, { 0, 0, 0 } }, }; -ActorInit Bg_Ice_Turara_InitVars = { +ActorProfile Bg_Ice_Turara_Profile = { /**/ ACTOR_BG_ICE_TURARA, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h index a869888a8b..eaa6cc843f 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h +++ b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h @@ -8,7 +8,7 @@ struct BgIceTurara; typedef void (*BgIceTuraraActionFunc)(struct BgIceTurara*, PlayState*); -typedef enum { +typedef enum BgIceTuraraType { /* 0 */ TURARA_STALAGMITE, /* 1 */ TURARA_STALACTITE, /* 2 */ TURARA_STALACTITE_REGROW diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index 81e75edbdc..a9dd2adfa5 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -17,7 +17,7 @@ void BgInGate_Draw(Actor* thisx, PlayState* play); void func_80892890(BgInGate* this, PlayState* play); void BgInGate_DoNothing(BgInGate* this, PlayState* play); -ActorInit Bg_Ingate_InitVars = { +ActorProfile Bg_Ingate_Profile = { /**/ ACTOR_BG_INGATE, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -51,7 +51,8 @@ void BgInGate_Init(Actor* thisx, PlayState* play) { } Actor_SetScale(&this->dyna.actor, 0.1f); - if (((this->dyna.actor.params & 1) != 0) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6)) { + if ((PARAMS_GET_U(this->dyna.actor.params, 0, 1) != 0) && + (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6)) { play->csCtx.curFrame = 0; BgInGate_SetupAction(this, func_80892890); } else { @@ -72,7 +73,7 @@ void func_80892890(BgInGate* this, PlayState* play) { if (play->csCtx.curFrame >= 50) { phi0 = 0x4000; - if ((this->dyna.actor.params & 2) == 0) { + if (!PARAMS_GET_NOSHIFT(this->dyna.actor.params, 1, 1)) { phi0 = -0x4000; } this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y + phi0; @@ -86,7 +87,7 @@ void func_80892890(BgInGate* this, PlayState* play) { } csFrames = (Math_SinS(csFrames) * 16384.0f); phi1 = csFrames; - if ((this->dyna.actor.params & 2) == 0) { + if (!PARAMS_GET_NOSHIFT(this->dyna.actor.params, 1, 1)) { phi1 = -phi1; } this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y + phi1; @@ -107,8 +108,7 @@ void BgInGate_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_ingate.c", 245), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_ingate.c", 245); gSPDisplayList(POLY_OPA_DISP++, gIngoGateDL); diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index d6efc13ea4..f8d136a07b 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -25,7 +25,7 @@ void BgJya1flift_DelayMove(BgJya1flift* this, PlayState* play); static u8 sIsSpawned = false; -ActorInit Bg_Jya_1flift_InitVars = { +ActorProfile Bg_Jya_1flift_Profile = { /**/ ACTOR_BG_JYA_1FLIFT, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -39,7 +39,7 @@ ActorInit Bg_Jya_1flift_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -47,7 +47,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -105,7 +105,7 @@ void BgJya1flift_Init(Actor* thisx, PlayState* play) { BgJya1flift_InitDynapoly(this, play, &g1fliftCol, 0); Actor_ProcessInitChain(thisx, sInitChain); BgJya1flift_InitCollision(thisx, play); - if (Flags_GetSwitch(play, (thisx->params & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) { LINK_AGE_IN_YEARS == YEARS_ADULT ? BgJya1flift_ChangeDirection(this) : BgJya1flift_SetupDoNothing(this); } else { BgJya1flift_SetupWaitForSwitch(this); @@ -131,7 +131,7 @@ void BgJya1flift_SetupWaitForSwitch(BgJya1flift* this) { } void BgJya1flift_WaitForSwitch(BgJya1flift* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->dyna.actor.params & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { BgJya1flift_ChangeDirection(this); } } @@ -165,7 +165,7 @@ void BgJya1flift_Move(BgJya1flift* this, PlayState* play) { BgJya1flift_ResetMoveDelay(this); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c index e021ed63a1..4280759bac 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c +++ b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c @@ -23,7 +23,7 @@ void func_808934C0(BgJyaAmishutter* this); void func_808934FC(BgJyaAmishutter* this); void func_8089350C(BgJyaAmishutter* this); -ActorInit Bg_Jya_Amishutter_InitVars = { +ActorProfile Bg_Jya_Amishutter_Profile = { /**/ ACTOR_BG_JYA_AMISHUTTER, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -93,7 +93,7 @@ void func_80893438(BgJyaAmishutter* this) { func_808934B0(this); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); } } @@ -116,7 +116,7 @@ void func_8089350C(BgJyaAmishutter* this) { BgJyaAmishutter_SetupWaitForPlayer(this); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c index bb7284b9ad..ce7e6d4b0e 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c @@ -16,7 +16,7 @@ void BgJyaBigmirror_Draw(Actor* thisx, PlayState* play); static u8 sIsSpawned = false; -ActorInit Bg_Jya_Bigmirror_InitVars = { +ActorProfile Bg_Jya_Bigmirror_Profile = { /**/ ACTOR_BG_JYA_BIGMIRROR, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -28,7 +28,7 @@ ActorInit Bg_Jya_Bigmirror_InitVars = { /**/ BgJyaBigmirror_Draw, }; -typedef struct { +typedef struct BigMirrorDataEntry { /* 0x00 */ Vec3f pos; /* 0x0C */ s16 params; /* 0x0E */ s16 solvedRotY; @@ -220,16 +220,13 @@ void BgJyaBigmirror_DrawLightBeam(Actor* thisx, PlayState* play) { Matrix_SetTranslateRotateYXZ(this->actor.world.pos.x, this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, &this->actor.shape.rot); Matrix_Scale(0.1f, (this->liftHeight * -(1.0f / 1280.0f)) + (1779.4f / 1280.0f), 0.1f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_jya_bigmirror.c", 457), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_jya_bigmirror.c", 457); gSPDisplayList(POLY_XLU_DISP++, gBigMirror1DL); if (lift != NULL) { - if (1) {} Matrix_SetTranslateRotateYXZ(lift->world.pos.x, lift->world.pos.y, lift->world.pos.z, &D_80893F4C); Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_jya_bigmirror.c", 467), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_jya_bigmirror.c", 467); gSPDisplayList(POLY_XLU_DISP++, gBigMirror2DL); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h index 90647a7a8a..52f2b95930 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h @@ -14,7 +14,7 @@ struct BgJyaBigmirror; -typedef struct { +typedef struct BigmirrorCobra { /* 0x00 */ BgJyaCobra* cobra; /* 0x04 */ s16 rotY; } BigmirrorCobra; // size = 0x08 diff --git a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c index e4155e4f8b..d7aaafba54 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c +++ b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c @@ -14,7 +14,7 @@ void BgJyaBlock_Destroy(Actor* thisx, PlayState* play); void BgJyaBlock_Update(Actor* thisx, PlayState* play); void BgJyaBlock_Draw(Actor* thisx, PlayState* play); -ActorInit Bg_Jya_Block_InitVars = { +ActorProfile Bg_Jya_Block_Profile = { /**/ ACTOR_BG_JYA_BLOCK, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -43,7 +43,7 @@ void BgJyaBlock_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if ((LINK_AGE_IN_YEARS != YEARS_CHILD) || !Flags_GetSwitch(play, thisx->params & 0x3F)) { + if ((LINK_AGE_IN_YEARS != YEARS_CHILD) || !Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) { Actor_Kill(&this->dyna.actor); } } @@ -68,8 +68,7 @@ void BgJyaBlock_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gPushBlockGrayTex)); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_jya_block.c", 153), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_jya_block.c", 153); gDPSetEnvColor(POLY_OPA_DISP++, 232, 210, 176, 255); gSPDisplayList(POLY_OPA_DISP++, gPushBlockDL); diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c index b4c2d6158b..061ef48fd1 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c @@ -1,7 +1,7 @@ #include "z_bg_jya_bombchuiwa.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "assets/objects/object_jya_obj/object_jya_obj.h" -#define FLAGS ACTOR_FLAG_0 +#define FLAGS ACTOR_FLAG_ATTENTION_ENABLED void BgJyaBombchuiwa_Init(Actor* thisx, PlayState* play); void BgJyaBombchuiwa_Destroy(Actor* thisx, PlayState* play2); @@ -14,7 +14,7 @@ void func_808949B8(BgJyaBombchuiwa* this, PlayState* play); void BgJyaBombchuiwa_CleanUpAfterExplosion(BgJyaBombchuiwa* this, PlayState* play); void BgJyaBombchuiwa_SpawnLightRay(BgJyaBombchuiwa* this, PlayState* play); -ActorInit Bg_Jya_Bombchuiwa_InitVars = { +ActorProfile Bg_Jya_Bombchuiwa_Profile = { /**/ ACTOR_BG_JYA_BOMBCHUIWA, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -29,7 +29,7 @@ ActorInit Bg_Jya_Bombchuiwa_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -42,7 +42,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_2, @@ -54,7 +54,7 @@ static ColliderJntSphInit sJntSphInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 3, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_3, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE), @@ -78,7 +78,7 @@ void BgJyaBombchuiwa_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); BgJyaBombchuiwa_SetupCollider(this, play); - if (Flags_GetSwitch(play, this->actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6))) { BgJyaBombchuiwa_SpawnLightRay(this, play); } else { BgJyaBombchuiwa_SetupWaitForExplosion(this, play); @@ -162,7 +162,7 @@ void BgJyaBombchuiwa_CleanUpAfterExplosion(BgJyaBombchuiwa* this, PlayState* pla BgJyaBombchuiwa_SetDrawFlags(this, 4); this->lightRayIntensity = 0.3f; this->timer = 0; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } void func_808949B8(BgJyaBombchuiwa* this, PlayState* play) { @@ -198,8 +198,7 @@ void BgJyaBombchuiwa_Update(Actor* thisx, PlayState* play) { void BgJyaBombchuiwa_DrawRock(PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_jya_bombchuiwa.c", 436); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_jya_bombchuiwa.c", 439), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_jya_bombchuiwa.c", 439); gSPDisplayList(POLY_XLU_DISP++, gBombchuiwa2DL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_jya_bombchuiwa.c", 443); } @@ -209,8 +208,7 @@ void BgJyaBombchuiwa_DrawLight(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_jya_bombchuiwa.c", 453); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_jya_bombchuiwa.c", 457), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_jya_bombchuiwa.c", 457); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, CLAMP_MAX((u32)(this->lightRayIntensity * 153.0f), 153)); gSPDisplayList(POLY_XLU_DISP++, gBombchuiwaLight1DL); gDPPipeSync(POLY_XLU_DISP++); diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index 9f64b58fe4..ade7e39273 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -16,7 +16,7 @@ void BgJyaBombiwa_Destroy(Actor* thisx, PlayState* play); void BgJyaBombiwa_Update(Actor* thisx, PlayState* play); void BgJyaBombiwa_Draw(Actor* thisx, PlayState* play); -ActorInit Bg_Jya_Bombiwa_InitVars = { +ActorProfile Bg_Jya_Bombiwa_Profile = { /**/ ACTOR_BG_JYA_BOMBIWA, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -31,7 +31,7 @@ ActorInit Bg_Jya_Bombiwa_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -44,7 +44,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -91,17 +91,17 @@ void BgJyaBombiwa_InitCollider(BgJyaBombiwa* this, PlayState* play) { void BgJyaBombiwa_Init(Actor* thisx, PlayState* play) { BgJyaBombiwa* this = (BgJyaBombiwa*)thisx; - if ((this->dyna.actor.params & 0x3F) != 0x29) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 6) != 0x29) { PRINTF(VT_COL(YELLOW, BLACK)); // "Warning: Switch Number changed (%s %d)(SW %d)" PRINTF("Warning : Switch Number が変更された(%s %d)(SW %d)\n", "../z_bg_jya_bombiwa.c", 218, - this->dyna.actor.params & 0x3F); + PARAMS_GET_U(this->dyna.actor.params, 0, 6)); PRINTF(VT_RST); } BgJyaBombiwa_SetupDynaPoly(this, play, &gBombiwaCol, 0); BgJyaBombiwa_InitCollider(this, play); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); } else { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -167,7 +167,7 @@ void BgJyaBombiwa_Update(Actor* thisx, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { BgJyaBombiwa_Break(this, play); - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Actor_Kill(&this->dyna.actor); } else { diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 2de2264bd3..800a1b2855 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -18,7 +18,7 @@ void func_80896ABC(BgJyaCobra* this, PlayState* play); #include "assets/overlays/ovl_Bg_Jya_Cobra/ovl_Bg_Jya_Cobra.c" -ActorInit Bg_Jya_Cobra_InitVars = { +ActorProfile Bg_Jya_Cobra_Profile = { /**/ ACTOR_BG_JYA_COBRA, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -153,7 +153,7 @@ void func_80895A70(BgJyaCobra* this) { BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent; MirRay* mirRay; - switch (this->dyna.actor.params & 3) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 2)) { case 0: mirRay = (MirRay*)this->dyna.actor.child; if (mirRay == NULL) { @@ -186,7 +186,7 @@ void func_80895A70(BgJyaCobra* this) { mirRay->unLit = 0; Math_Vec3f_Copy(&mirRay->sourcePt, &this->unk_180); Matrix_RotateY(BINANG_TO_RAD(this->dyna.actor.shape.rot.y), MTXMODE_NEW); - Matrix_RotateX(BINANG_TO_RAD(D_80897308[this->dyna.actor.params & 3]), MTXMODE_APPLY); + Matrix_RotateX(BINANG_TO_RAD(D_80897308[PARAMS_GET_U(this->dyna.actor.params, 0, 2)]), MTXMODE_APPLY); sp28.x = 0.0f; sp28.y = 0.0; sp28.z = this->unk_190 * 2800.0f; @@ -212,14 +212,14 @@ void func_80895C74(BgJyaCobra* this, PlayState* play) { BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent; f32 phi_f0; - if ((params & 3) == 2 && mirror != NULL && + if (PARAMS_GET_U(params, 0, 2) == 2 && mirror != NULL && (!(mirror->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED) || !(mirror->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED))) { Math_StepToF(&this->unk_18C, 0.0f, 0.05f); } else { this->unk_18C = 1.0f; - if (D_80897310[params & 3]) { - phi_v0 = this->dyna.actor.shape.rot.y - D_80897314[params & 3]; + if (D_80897310[PARAMS_GET_U(params, 0, 2)]) { + phi_v0 = this->dyna.actor.shape.rot.y - D_80897314[PARAMS_GET_U(params, 0, 2)]; phi_v0 = ABS(phi_v0); if (phi_v0 < 0x2000 && phi_v0 != -0x8000) { this->unk_18C += (phi_v0 - 0x2000) * (3.0f / 0x4000); @@ -234,9 +234,9 @@ void func_80895C74(BgJyaCobra* this, PlayState* play) { this->unk_180.y = this->dyna.actor.world.pos.y + 57.0f; this->unk_180.z = this->dyna.actor.world.pos.z; - if ((params & 3) == 0) { + if (PARAMS_GET_U(params, 0, 2) == 0) { this->unk_190 = 0.1f; - } else if ((params & 3) == 1) { + } else if (PARAMS_GET_U(params, 0, 2) == 1) { phi_f0 = 0.1f; phi_v0 = this->dyna.actor.shape.rot.y - 0x8000; if (phi_v0 < 0x500 && phi_v0 > -0x500) { @@ -249,7 +249,7 @@ void func_80895C74(BgJyaCobra* this, PlayState* play) { } } Math_StepToF(&this->unk_190, phi_f0, 0.04f); - } else if ((params & 3) == 2) { + } else if (PARAMS_GET_U(params, 0, 2) == 2) { phi_f0 = 0.1f; phi_v0 = this->dyna.actor.shape.rot.y - 0x8000; if (phi_v0 < 0x500 && phi_v0 > -0x500) { @@ -286,8 +286,8 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) { Lib_MemSet(shadowTex, COBRA_SHADOW_TEX_SIZE, 0); Matrix_RotateX((M_PI / 4), MTXMODE_NEW); - rotY = !(this->dyna.actor.params & 3) ? (this->dyna.actor.shape.rot.y + 0x4000) - : (this->dyna.actor.shape.rot.y - 0x4000); + rotY = !PARAMS_GET_U(this->dyna.actor.params, 0, 2) ? (this->dyna.actor.shape.rot.y + 0x4000) + : (this->dyna.actor.shape.rot.y - 0x4000); Matrix_RotateY(BINANG_TO_RAD(rotY), MTXMODE_APPLY); Matrix_Scale(0.9f, 0.9f, 0.9f, MTXMODE_APPLY); @@ -408,21 +408,22 @@ void BgJyaCobra_Init(Actor* thisx, PlayState* play) { BgJyaCobra_InitDynapoly(this, play, &gCobraCol, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (!(this->dyna.actor.params & 3) && Flags_GetSwitch(play, ((s32)this->dyna.actor.params >> 8) & 0x3F)) { + if (!PARAMS_GET_U(this->dyna.actor.params, 0, 2) && + Flags_GetSwitch(play, PARAMS_GET_U((s32)this->dyna.actor.params, 8, 6))) { this->dyna.actor.world.rot.y = this->dyna.actor.home.rot.y = this->dyna.actor.shape.rot.y = 0; } - if (!(this->dyna.actor.params & 3)) { + if (!PARAMS_GET_U(this->dyna.actor.params, 0, 2)) { BgJyaCobra_SpawnRay(this, play); } func_80896918(this, play); - if ((this->dyna.actor.params & 3) == 1 || (this->dyna.actor.params & 3) == 2) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 2) == 1 || PARAMS_GET_U(this->dyna.actor.params, 0, 2) == 2) { this->dyna.actor.room = -1; } - if ((this->dyna.actor.params & 3) == 1) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 2) == 1) { BgJyaCobra_UpdateShadowFromTop(this); } @@ -516,7 +517,7 @@ void func_80896ABC(BgJyaCobra* this, PlayState* play) { } this->dyna.unk_150 = 0.0f; - func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); } void BgJyaCobra_Update(Actor* thisx, PlayState* play2) { @@ -528,7 +529,7 @@ void BgJyaCobra_Update(Actor* thisx, PlayState* play2) { func_80895C74(this, play); func_80895A70(this); - if ((this->dyna.actor.params & 3) == 0 || (this->dyna.actor.params & 3) == 2) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 2) == 0 || PARAMS_GET_U(this->dyna.actor.params, 0, 2) == 2) { BgJyaCobra_UpdateShadowFromSide(this); } } @@ -537,8 +538,7 @@ void func_80896CB4(PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_jya_cobra.c", 864); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_jya_cobra.c", 867), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_jya_cobra.c", 867); gSPDisplayList(POLY_XLU_DISP++, gCobra2DL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_jya_cobra.c", 872); @@ -551,14 +551,13 @@ void func_80896D78(BgJyaCobra* this, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_jya_cobra.c", 924); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - sp44.x = D_80897308[this->dyna.actor.params & 3] + this->dyna.actor.shape.rot.x; + sp44.x = D_80897308[PARAMS_GET_U(this->dyna.actor.params, 0, 2)] + this->dyna.actor.shape.rot.x; sp44.y = this->dyna.actor.shape.rot.y; sp44.z = this->dyna.actor.shape.rot.z; Matrix_SetTranslateRotateYXZ(this->unk_180.x, this->unk_180.y, this->unk_180.z, &sp44); Matrix_Scale(0.1f, 0.1f, this->unk_190, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_jya_cobra.c", 939), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_jya_cobra.c", 939); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s32)(this->unk_18C * 140.0f)); gSPDisplayList(POLY_XLU_DISP++, gCobra3DL); @@ -567,7 +566,7 @@ void func_80896D78(BgJyaCobra* this, PlayState* play) { void BgJyaCobra_DrawShadow(BgJyaCobra* this, PlayState* play) { s32 pad; - s16 params = this->dyna.actor.params & 3; + s16 params = PARAMS_GET_U(this->dyna.actor.params, 0, 2); Vec3f sp64; Vec3s* phi_a3; @@ -596,8 +595,7 @@ void BgJyaCobra_DrawShadow(BgJyaCobra* this, PlayState* play) { Matrix_Translate(0.0f, 0.0f, 40.0f, MTXMODE_APPLY); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 120); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_jya_cobra.c", 994), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_jya_cobra.c", 994); gDPLoadTextureBlock(POLY_XLU_DISP++, COBRA_SHADOW_TEX_PTR(this), G_IM_FMT_I, G_IM_SIZ_8b, COBRA_SHADOW_TEX_WIDTH, COBRA_SHADOW_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, @@ -618,7 +616,7 @@ void BgJyaCobra_Draw(Actor* thisx, PlayState* play) { func_80896D78(this, play); } - if ((this->dyna.actor.params & 3) == 2) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 2) == 2) { BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent; if (mirror != NULL && (mirror->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED) && diff --git a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c index 7ab065bd3e..9e2a0d9ad4 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c @@ -23,7 +23,7 @@ void BgJyaGoroiwa_SetupMove(BgJyaGoroiwa* this); void BgJyaGoroiwa_UpdateRotation(BgJyaGoroiwa* this); void BgJyaGoroiwa_UpdateCollider(BgJyaGoroiwa* this); -ActorInit Bg_Jya_Goroiwa_InitVars = { +ActorProfile Bg_Jya_Goroiwa_Profile = { /**/ ACTOR_BG_JYA_GOROIWA, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -38,7 +38,7 @@ ActorInit Bg_Jya_Goroiwa_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -51,7 +51,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -152,7 +152,7 @@ void BgJyaGoroiwa_Move(BgJyaGoroiwa* this, PlayState* play) { thisx->world.rot.y += 0x8000; } - func_8002F6D4(play, thisx, 2.0f, thisx->yawTowardsPlayer, 0.0f, 0); + Actor_SetPlayerKnockbackLarge(play, thisx, 2.0f, thisx->yawTowardsPlayer, 0.0f, 0); Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_BODY_HIT); this->yOffsetSpeed = 10.0f; @@ -200,7 +200,7 @@ void BgJyaGoroiwa_Update(Actor* thisx, PlayState* play) { s32 bgId; Vec3f checkPos; - if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29))) { + if (!(player->stateFlags1 & (PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29))) { this->actionFunc(this, play); BgJyaGoroiwa_UpdateRotation(this); checkPos.x = this->actor.world.pos.x; diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c index 93e972e2e6..0f100259bd 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c +++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c @@ -22,7 +22,7 @@ void BgJyaHaheniron_PillarCrumble(BgJyaHaheniron* this, PlayState* play); void BgJyaHaheniron_SetupRubbleCollide(BgJyaHaheniron* this); void BgJyaHaheniron_RubbleCollide(BgJyaHaheniron* this, PlayState* play); -ActorInit Bg_Jya_Haheniron_InitVars = { +ActorProfile Bg_Jya_Haheniron_Profile = { /**/ ACTOR_BG_JYA_HAHENIRON, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -37,7 +37,7 @@ ActorInit Bg_Jya_Haheniron_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -50,7 +50,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON, OC1_NONE, diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c index 7526ae9a1f..d74c0abdec 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c @@ -24,7 +24,7 @@ void BgJyaIronobj_SpawnThroneParticles(BgJyaIronobj* this, PlayState* play, EnIk static int sUnused = 0; -ActorInit Bg_Jya_Ironobj_InitVars = { +ActorProfile Bg_Jya_Ironobj_Profile = { /**/ ACTOR_BG_JYA_IRONOBJ, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -40,7 +40,7 @@ static Gfx* sOpaDL[] = { gPillarDL, gThroneDL }; static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_NONE, @@ -48,7 +48,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -84,7 +84,7 @@ void BgJyaIronobj_InitCylinder(BgJyaIronobj* this, PlayState* play) { Collider_InitCylinder(play, colCylinder); Collider_SetCylinder(play, colCylinder, &this->dyna.actor, &sCylinderInit); - if ((this->dyna.actor.params & 1) == 1) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 1) == 1) { this->colCylinder.dim.radius = 40; this->colCylinder.dim.height = 100; } @@ -108,7 +108,7 @@ void BgJyaIronobj_SpawnPillarParticles(BgJyaIronobj* this, PlayState* play, EnIk #if IS_DEBUG if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) { - PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 233, enIk->unk_2FF); + PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 233); return; } #endif @@ -174,7 +174,7 @@ void BgJyaIronobj_SpawnThroneParticles(BgJyaIronobj* this, PlayState* play, EnIk #if IS_DEBUG if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) { - PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 362, enIk->unk_2FF); + PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 362); return; } #endif @@ -227,7 +227,7 @@ void BgJyaIronobj_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); BgJyaIronobj_InitCylinder(this, play); - CollisionHeader_GetVirtual(sCollisionHeaders[thisx->params & 1], &colHeader); + CollisionHeader_GetVirtual(sCollisionHeaders[PARAMS_GET_U(thisx->params, 0, 1)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); func_808992D8(this); } @@ -253,7 +253,7 @@ void func_808992E8(BgJyaIronobj* this, PlayState* play) { actor = this->colCylinder.base.ac; this->colCylinder.base.acFlags &= ~AC_HIT; if (actor != NULL && actor->id == ACTOR_EN_IK) { - particleFunc[this->dyna.actor.params & 1](this, play, (EnIk*)actor); + particleFunc[PARAMS_GET_U(this->dyna.actor.params, 0, 1)](this, play, (EnIk*)actor); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR); dropPos.x = this->dyna.actor.world.pos.x; dropPos.y = this->dyna.actor.world.pos.y + 20.0f; @@ -277,5 +277,5 @@ void BgJyaIronobj_Update(Actor* thisx, PlayState* play) { } void BgJyaIronobj_Draw(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, sOpaDL[thisx->params & 1]); + Gfx_DrawDListOpa(play, sOpaDL[PARAMS_GET_U(thisx->params, 0, 1)]); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index e46feba384..76925e2aae 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -21,7 +21,7 @@ void func_8089993C(BgJyaKanaami* this); void func_80899950(BgJyaKanaami* this, PlayState* play); void func_80899A08(BgJyaKanaami* this); -ActorInit Bg_Jya_Kanaami_InitVars = { +ActorProfile Bg_Jya_Kanaami_Profile = { /**/ ACTOR_BG_JYA_KANAAMI, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -63,7 +63,7 @@ void BgJyaKanaami_Init(Actor* thisx, PlayState* play) { BgJyaKanaami_InitDynaPoly(this, play, &gKanaamiCol, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { func_80899A08(this); } else { func_80899880(this); @@ -83,7 +83,7 @@ void func_80899880(BgJyaKanaami* this) { } void func_80899894(BgJyaKanaami* this, PlayState* play) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) || this->unk_16A > 0) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) || this->unk_16A > 0) { if (this->dyna.actor.world.pos.x > -1000.0f && this->unk_16A == 0) { OnePointCutscene_Init(play, 3450, -99, &this->dyna.actor, CAM_ID_MAIN); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index 5462ee6dc1..8b3375967e 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -22,7 +22,7 @@ void BgJyaLift_Move(BgJyaLift* this, PlayState* play); static s16 sIsSpawned = false; -ActorInit Bg_Jya_Lift_InitVars = { +ActorProfile Bg_Jya_Lift_Profile = { /**/ ACTOR_BG_JYA_LIFT, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -63,7 +63,7 @@ void BgJyaLift_Init(Actor* thisx, PlayState* play) { PRINTF("女神リフト CT\n"); BgJyaLift_InitDynapoly(this, play, &gLiftCol, 0); Actor_ProcessInitChain(thisx, sInitChain); - if (Flags_GetSwitch(play, (thisx->params & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) { BgJyaLift_SetFinalPosY(this); } else { BgJyaLift_SetInitPosY(this); @@ -92,7 +92,7 @@ void BgJyaLift_SetInitPosY(BgJyaLift* this) { } void BgJyaLift_DelayMove(BgJyaLift* this, PlayState* play) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) || (this->moveDelay > 0)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) || (this->moveDelay > 0)) { this->moveDelay++; if (this->moveDelay >= 20) { OnePointCutscene_Init(play, 3430, -99, &this->dyna.actor, CAM_ID_MAIN); @@ -119,7 +119,7 @@ void BgJyaLift_Move(BgJyaLift* this, PlayState* play) { BgJyaLift_SetFinalPosY(this); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c index f4bd5ebcff..eed3074280 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c @@ -20,7 +20,7 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, PlayState* play); void BgJyaMegami_SetupExplode(BgJyaMegami* this); void BgJyaMegami_Explode(BgJyaMegami* this, PlayState* play); -ActorInit Bg_Jya_Megami_InitVars = { +ActorProfile Bg_Jya_Megami_Profile = { /**/ ACTOR_BG_JYA_MEGAMI, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -35,7 +35,7 @@ ActorInit Bg_Jya_Megami_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00200000, 0x00, 0x00 }, ATELEM_NONE, @@ -48,7 +48,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -59,7 +59,7 @@ static ColliderJntSphInit sJntSphInit = { sJntSphElementsInit, }; -typedef struct { +typedef struct BgJyaMegamiPieceInit { /* 0x00 */ Vec3f unk_00; /* 0x0C */ f32 velX; /* 0x10 */ s16 rotVelX; @@ -161,7 +161,7 @@ void BgJyaMegami_Init(Actor* thisx, PlayState* play) { BgJyaMegami_InitDynaPoly(this, play, &GMegamiCol, 0); BgJyaMegami_InitCollider(this, play); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); } else { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -190,12 +190,12 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, PlayState* play) { if (play->gameplayFrames % 4 == 0) { BgJyaMegami_SetupSpawnEffect(this, play, (this->crumbleIndex * 0.04f) + 0.05f); } - func_8002F974(&this->dyna.actor, NA_SE_EV_FACE_CRUMBLE_SLOW - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_FACE_CRUMBLE_SLOW - SFX_FLAG); } else if (this->lightTimer > 0) { this->lightTimer--; } if (this->lightTimer > 40) { - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); BgJyaMegami_SetupExplode(this); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_EXPLOSION); OnePointCutscene_Init(play, 3440, -99, &this->dyna.actor, CAM_ID_MAIN); @@ -308,8 +308,7 @@ void BgJyaMegami_DrawFace(BgJyaMegami* this, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sRightSideCrumbles[this->crumbleIndex])); gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sLeftSideCrumbles[this->crumbleIndex])); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_jya_megami.c", 716), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_jya_megami.c", 716); gSPDisplayList(POLY_OPA_DISP++, gMegami1DL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_jya_megami.c", 720); @@ -340,8 +339,7 @@ void BgJyaMegami_DrawExplode(BgJyaMegami* this, PlayState* play) { Matrix_Translate(sPiecesInit[i].unk_00.x * -10.0f, sPiecesInit[i].unk_00.y * -10.0f, sPiecesInit[i].unk_00.z * -10.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_jya_megami.c", 778), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_jya_megami.c", 778); gSPDisplayList(POLY_OPA_DISP++, sDLists[i]); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h index a85222c940..b24f236013 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h @@ -8,7 +8,7 @@ struct BgJyaMegami; typedef void (*BgJyaMegamiActionFunc)(struct BgJyaMegami*, PlayState*); -typedef struct { +typedef struct BgJyaMegamiPiece { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f vel; /* 0x18 */ s16 rotVelX; diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c index 1da563d865..35cae9c9f5 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c +++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c @@ -23,7 +23,7 @@ void func_8089B870(BgJyaZurerukabe* this, PlayState* play); static f32 D_8089B9C0[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; -ActorInit Bg_Jya_Zurerukabe_InitVars = { +ActorProfile Bg_Jya_Zurerukabe_Profile = { /**/ ACTOR_BG_JYA_ZURERUKABE, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -97,13 +97,13 @@ void func_8089B4C8(BgJyaZurerukabe* this, PlayState* play) { case 3: case 5: if (fabsf(D_8089B9C0[D_8089BA30[i]]) > 1.0f) { - func_8002F6D4(play, &this->dyna.actor, 1.5f, this->dyna.actor.shape.rot.y, 0.0f, 0); + Actor_SetPlayerKnockbackLarge(play, &this->dyna.actor, 1.5f, this->dyna.actor.shape.rot.y, 0.0f, 0); } break; case 1: case 4: if (fabsf(D_8089B9C0[D_8089BA30[i]] - D_8089B9C0[D_8089BA30[i + 1]]) > 1.0f) { - func_8002F6D4(play, &this->dyna.actor, 1.5f, this->dyna.actor.shape.rot.y, 0.0f, 0); + Actor_SetPlayerKnockbackLarge(play, &this->dyna.actor, 1.5f, this->dyna.actor.shape.rot.y, 0.0f, 0); } break; } @@ -170,7 +170,7 @@ void func_8089B870(BgJyaZurerukabe* this, PlayState* play) { } D_8089B9C0[this->unk_168] = D_8089BA08[this->unk_168] * this->unk_16E; - func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); } void BgJyaZurerukabe_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c index a39b2e8aed..4e2dea2a9c 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c @@ -14,7 +14,7 @@ void BgMenkuriEye_Destroy(Actor* thisx, PlayState* play); void BgMenkuriEye_Update(Actor* thisx, PlayState* play); void BgMenkuriEye_Draw(Actor* thisx, PlayState* play); -ActorInit Bg_Menkuri_Eye_InitVars = { +ActorProfile Bg_Menkuri_Eye_Profile = { /**/ ACTOR_BG_MENKURI_EYE, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -31,7 +31,7 @@ static s32 sNumEyesShot; static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0x00000000, 0x00, 0x00 }, { 0x0001F820, 0x00, 0x00 }, ATELEM_NONE, @@ -44,7 +44,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -133,8 +133,7 @@ void BgMenkuriEye_Draw(Actor* thisx, PlayState* play) { Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_RotateZYX(this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, MTXMODE_APPLY); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_menkuri_eye.c", 331), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_menkuri_eye.c", 331); gSPDisplayList(POLY_XLU_DISP++, gGTGEyeStatueEyeDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_menkuri_eye.c", 335); diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c index b7fa437b80..95b9bbb95d 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c @@ -14,7 +14,7 @@ void BgMenkuriKaiten_Destroy(Actor* thisx, PlayState* play); void BgMenkuriKaiten_Update(Actor* thisx, PlayState* play); void BgMenkuriKaiten_Draw(Actor* thisx, PlayState* play); -ActorInit Bg_Menkuri_Kaiten_InitVars = { +ActorProfile Bg_Menkuri_Kaiten_Profile = { /**/ ACTOR_BG_MENKURI_KAITEN, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -51,7 +51,7 @@ void BgMenkuriKaiten_Update(Actor* thisx, PlayState* play) { BgMenkuriKaiten* this = (BgMenkuriKaiten*)thisx; if (!Flags_GetSwitch(play, this->dyna.actor.params) && DynaPolyActor_IsPlayerAbove(&this->dyna)) { - func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); this->dyna.actor.shape.rot.y += 0x80; } } diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c index 0d3c4635e2..589ecd6d7a 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c @@ -14,7 +14,7 @@ void BgMenkuriNisekabe_Destroy(Actor* thisx, PlayState* play); void BgMenkuriNisekabe_Update(Actor* thisx, PlayState* play); void BgMenkuriNisekabe_Draw(Actor* thisx, PlayState* play); -ActorInit Bg_Menkuri_Nisekabe_InitVars = { +ActorProfile Bg_Menkuri_Nisekabe_Profile = { /**/ ACTOR_BG_MENKURI_NISEKABE, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -49,7 +49,7 @@ void BgMenkuriNisekabe_Update(Actor* thisx, PlayState* play) { void BgMenkuriNisekabe_Draw(Actor* thisx, PlayState* play) { BgMenkuriNisekabe* this = (BgMenkuriNisekabe*)thisx; - u32 index = this->actor.params & 0xFF; + u32 index = PARAMS_GET_U(this->actor.params, 0, 8); if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { Gfx_DrawDListXlu(play, sDLists[index]); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index 2eaf22b9ec..6c16b95e61 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -19,7 +19,7 @@ void BgMizuBwall_Idle(BgMizuBwall* this, PlayState* play); void BgMizuBwall_Break(BgMizuBwall* this, PlayState* play); void BgMizuBwall_DoNothing(BgMizuBwall* this, PlayState* play); -ActorInit Bg_Mizu_Bwall_InitVars = { +ActorProfile Bg_Mizu_Bwall_Profile = { /**/ ACTOR_BG_MIZU_BWALL, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -34,7 +34,7 @@ ActorInit Bg_Mizu_Bwall_InitVars = { static ColliderTrisElementInit sTrisElementInitFloor[2] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -45,7 +45,7 @@ static ColliderTrisElementInit sTrisElementInitFloor[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -58,7 +58,7 @@ static ColliderTrisElementInit sTrisElementInitFloor[2] = { static ColliderTrisInit sTrisInitFloor = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -72,7 +72,7 @@ static ColliderTrisInit sTrisInitFloor = { static ColliderTrisElementInit sTrisElementInitRutoWall[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -85,7 +85,7 @@ static ColliderTrisElementInit sTrisElementInitRutoWall[1] = { static ColliderTrisInit sTrisInitRutoWall = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -99,7 +99,7 @@ static ColliderTrisInit sTrisInitRutoWall = { static ColliderTrisElementInit sTrisElementInitWall[2] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -110,7 +110,7 @@ static ColliderTrisElementInit sTrisElementInitWall[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -123,7 +123,7 @@ static ColliderTrisElementInit sTrisElementInitWall[2] = { static ColliderTrisInit sTrisInitUnusedWall = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -136,7 +136,7 @@ static ColliderTrisInit sTrisInitUnusedWall = { static ColliderTrisInit sTrisInitStingerWall = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -176,12 +176,12 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->yRot = this->dyna.actor.world.pos.y; - this->dList = sDLists[(u16)this->dyna.actor.params & 0xF]; + this->dList = sDLists[PARAMS_GET_U((u16)this->dyna.actor.params, 0, 4)]; DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - CollisionHeader_GetVirtual(sColHeaders[(u16)this->dyna.actor.params & 0xF], &colHeader); + CollisionHeader_GetVirtual(sColHeaders[PARAMS_GET_U((u16)this->dyna.actor.params, 0, 4)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - switch ((u16)this->dyna.actor.params & 0xF) { + switch (PARAMS_GET_U((u16)this->dyna.actor.params, 0, 4)) { case MIZUBWALL_FLOOR: { f32 sin; f32 cos; @@ -190,7 +190,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { Vec3f offset; Vec3f vtx[3]; - if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -229,7 +229,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { Vec3f offset; Vec3f vtx[3]; - if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -268,7 +268,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { Vec3f offset; Vec3f vtx[3]; - if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -309,7 +309,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { Vec3f offset; Vec3f vtx[3]; - if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -351,7 +351,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { Vec3f offset; Vec3f vtx[3]; - if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -444,7 +444,7 @@ void BgMizuBwall_SpawnDebris(BgMizuBwall* this, PlayState* play) { Vec3f debrisOffsets[15]; for (i = 0; i < ARRAY_COUNT(debrisOffsets); i++) { - switch ((u16)this->dyna.actor.params & 0xF) { + switch (PARAMS_GET_U((u16)this->dyna.actor.params, 0, 4)) { case MIZUBWALL_FLOOR: debrisOffsets[i].x = (Rand_ZeroOne() * 80.0f) - 40.0f; debrisOffsets[i].y = Rand_ZeroOne() * 0; @@ -484,7 +484,7 @@ void BgMizuBwall_Idle(BgMizuBwall* this, PlayState* play) { BgMizuBwall_SetAlpha(this, play); if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Flags_SetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 8, 6)); this->breakTimer = 1; DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; @@ -522,7 +522,6 @@ void BgMizuBwall_Draw(Actor* thisx, PlayState* play2) { u32 frames; OPEN_DISPS(play->state.gfxCtx, "../z_bg_mizu_bwall.c", 1095); - if (1) {} frames = play->gameplayFrames; Gfx_SetupDL_25Opa(play->state.gfxCtx); @@ -538,7 +537,7 @@ void BgMizuBwall_Draw(Actor* thisx, PlayState* play2) { gSPSegment(POLY_OPA_DISP++, 0x0B, Gfx_TwoTexScrollEnvColor(play->state.gfxCtx, G_TX_RENDERTILE, 3 * frames, 0, 0x20, 0x20, 1, 0, 0, 0x20, 0x20, 0, 0, 0, this->scrollAlpha4)); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mizu_bwall.c", 1129), 2); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_mizu_bwall.c", 1129); if (this->dList != NULL) { gSPDisplayList(POLY_OPA_DISP++, this->dList); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h index 37c0fe2b3b..d5eeaad344 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h @@ -23,7 +23,7 @@ typedef struct BgMizuBwall { /* 0x02B8 */ Gfx* dList; } BgMizuBwall; // size = 0x02BC -typedef enum { +typedef enum BgMizuBwallType { MIZUBWALL_FLOOR, MIZUBWALL_RUTO_ROOM, MIZUBWALL_UNUSED, diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c index 9e78921ae4..96583b843f 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c @@ -10,11 +10,11 @@ #define FLAGS ACTOR_FLAG_4 -#define MOVEBG_TYPE(params) (((u16)(params) >> 0xC) & 0xF) -#define MOVEBG_FLAGS(params) ((u16)(params)&0x3F) -#define MOVEBG_PATH_ID(params) (((u16)(params) >> 0x8) & 0xF) -#define MOVEBG_POINT_ID(params) ((u16)(params)&0xF) -#define MOVEBG_SPEED(params) (((u16)(params) >> 0x4) & 0xF) +#define MOVEBG_TYPE(params) PARAMS_GET_U((u16)(params), 12, 4) +#define MOVEBG_FLAGS(params) PARAMS_GET_U((u16)(params), 0, 6) +#define MOVEBG_PATH_ID(params) PARAMS_GET_U((u16)(params), 8, 4) +#define MOVEBG_POINT_ID(params) PARAMS_GET_U((u16)(params), 0, 4) +#define MOVEBG_SPEED(params) PARAMS_GET_U((u16)(params), 4, 4) void BgMizuMovebg_Init(Actor* thisx, PlayState* play); void BgMizuMovebg_Destroy(Actor* thisx, PlayState* play); @@ -25,7 +25,7 @@ void BgMizuMovebg_UpdateMain(BgMizuMovebg* this, PlayState* play); void BgMizuMovebg_UpdateHookshotPlatform(BgMizuMovebg* this, PlayState* play); s32 BgMizuMovebg_SetPosFromPath(Path* pathList, Vec3f* pos, s32 pathId, s32 pointId); -ActorInit Bg_Mizu_Movebg_InitVars = { +ActorProfile Bg_Mizu_Movebg_Profile = { /**/ ACTOR_BG_MIZU_MOVEBG, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -290,9 +290,9 @@ void BgMizuMovebg_UpdateMain(BgMizuMovebg* this, PlayState* play) { } if (this->sfxFlags & 2) { if (this->dyna.actor.room == 0) { - func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); } else { - func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); } } } @@ -312,7 +312,7 @@ void BgMizuMovebg_UpdateMain(BgMizuMovebg* this, PlayState* play) { this->sfxFlags |= 2; } if (this->sfxFlags & 2) { - func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); } } break; @@ -330,7 +330,7 @@ void BgMizuMovebg_UpdateMain(BgMizuMovebg* this, PlayState* play) { this->dyna.actor.child->world.pos.x = this->dyna.actor.world.pos.x + offsetPos.x; this->dyna.actor.child->world.pos.y = this->dyna.actor.world.pos.y + offsetPos.y; this->dyna.actor.child->world.pos.z = this->dyna.actor.world.pos.z + offsetPos.z; - this->dyna.actor.child->flags &= ~ACTOR_FLAG_0; + this->dyna.actor.child->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } break; } @@ -367,7 +367,7 @@ void BgMizuMovebg_UpdateHookshotPlatform(BgMizuMovebg* this, PlayState* play) { this->sfxFlags |= 1; } if (this->sfxFlags & 1) { - func_8002F948(&this->dyna.actor, NA_SE_EV_ROLL_STAND_2 - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->dyna.actor, NA_SE_EV_ROLL_STAND_2 - SFX_FLAG); } } @@ -382,8 +382,6 @@ void BgMizuMovebg_Draw(Actor* thisx, PlayState* play2) { PlayState* play = play2; u32 frames; - if (1) {} - OPEN_DISPS(play->state.gfxCtx, "../z_bg_mizu_movebg.c", 754); frames = play->gameplayFrames; @@ -405,8 +403,7 @@ void BgMizuMovebg_Draw(Actor* thisx, PlayState* play2) { Gfx_TwoTexScrollEnvColor(play->state.gfxCtx, G_TX_RENDERTILE, frames * 3, 0, 32, 32, 1, 0, 0, 32, 32, 0, 0, 0, this->scrollAlpha4)); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mizu_movebg.c", 788), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_mizu_movebg.c", 788); if (this->dList != NULL) { gSPDisplayList(POLY_OPA_DISP++, this->dList); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c index a547fde73c..44a2f7cce6 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c @@ -13,7 +13,7 @@ void BgMizuShutter_WaitForSwitch(BgMizuShutter* this, PlayState* play); void BgMizuShutter_Move(BgMizuShutter* this, PlayState* play); void BgMizuShutter_WaitForCutscene(BgMizuShutter* this, PlayState* play); -ActorInit Bg_Mizu_Shutter_InitVars = { +ActorProfile Bg_Mizu_Shutter_Profile = { /**/ ACTOR_BG_MIZU_SHUTTER, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -52,30 +52,30 @@ void BgMizuShutter_Init(Actor* thisx, PlayState* play) { s32 pad3; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->displayList = sDisplayLists[BGMIZUSHUTTER_SIZE_PARAM(&this->dyna.actor)]; + this->displayList = sDisplayLists[BGMIZUSHUTTER_GET_SIZE(&this->dyna.actor)]; DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - CollisionHeader_GetVirtual(sCollisionHeaders[BGMIZUSHUTTER_SIZE_PARAM(&this->dyna.actor)], &colHeader); + CollisionHeader_GetVirtual(sCollisionHeaders[BGMIZUSHUTTER_GET_SIZE(&this->dyna.actor)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - if ((BGMIZUSHUTTER_SIZE_PARAM(&this->dyna.actor) == BGMIZUSHUTTER_SMALL) || - (BGMIZUSHUTTER_SIZE_PARAM(&this->dyna.actor) == BGMIZUSHUTTER_LARGE)) { + if ((BGMIZUSHUTTER_GET_SIZE(&this->dyna.actor) == BGMIZUSHUTTER_SMALL) || + (BGMIZUSHUTTER_GET_SIZE(&this->dyna.actor) == BGMIZUSHUTTER_LARGE)) { this->closedPos = this->dyna.actor.world.pos; this->timer = 0; - this->timerMax = BGMIZUSHUTTER_TIMER_PARAM(&this->dyna.actor) * 20; + this->timerMax = BGMIZUSHUTTER_GET_TIMER(&this->dyna.actor) * 20; Matrix_RotateY(BINANG_TO_RAD(this->dyna.actor.world.rot.y), MTXMODE_NEW); Matrix_RotateX(BINANG_TO_RAD(this->dyna.actor.world.rot.x), MTXMODE_APPLY); Matrix_RotateZ(BINANG_TO_RAD(this->dyna.actor.world.rot.z), MTXMODE_APPLY); - Matrix_MultVec3f(&sDisplacements[BGMIZUSHUTTER_SIZE_PARAM(&this->dyna.actor)], &this->openPos); + Matrix_MultVec3f(&sDisplacements[BGMIZUSHUTTER_GET_SIZE(&this->dyna.actor)], &this->openPos); this->openPos.x += this->dyna.actor.world.pos.x; this->openPos.y += this->dyna.actor.world.pos.y; this->openPos.z += this->dyna.actor.world.pos.z; if (this->timerMax != 0x3F * 20) { - Flags_UnsetSwitch(play, BGMIZUSHUTTER_SWITCH_PARAM(&this->dyna.actor)); + Flags_UnsetSwitch(play, BGMIZUSHUTTER_GET_SWITCH(&this->dyna.actor)); this->dyna.actor.world.pos = this->closedPos; } - if (Flags_GetSwitch(play, BGMIZUSHUTTER_SWITCH_PARAM(&this->dyna.actor))) { + if (Flags_GetSwitch(play, BGMIZUSHUTTER_GET_SWITCH(&this->dyna.actor))) { this->dyna.actor.world.pos = this->openPos; this->actionFunc = BgMizuShutter_WaitForTimer; } else { @@ -92,7 +92,7 @@ void BgMizuShutter_Destroy(Actor* thisx, PlayState* play) { } void BgMizuShutter_WaitForSwitch(BgMizuShutter* this, PlayState* play) { - if (Flags_GetSwitch(play, BGMIZUSHUTTER_SWITCH_PARAM(&this->dyna.actor))) { + if (Flags_GetSwitch(play, BGMIZUSHUTTER_GET_SWITCH(&this->dyna.actor))) { if (ABS(this->dyna.actor.world.rot.x) > 0x2C60) { OnePointCutscene_Init(play, 4510, -99, &this->dyna.actor, CAM_ID_MAIN); } else { @@ -111,7 +111,7 @@ void BgMizuShutter_WaitForCutscene(BgMizuShutter* this, PlayState* play) { } void BgMizuShutter_Move(BgMizuShutter* this, PlayState* play) { - if (Flags_GetSwitch(play, BGMIZUSHUTTER_SWITCH_PARAM(&this->dyna.actor))) { + if (Flags_GetSwitch(play, BGMIZUSHUTTER_GET_SWITCH(&this->dyna.actor))) { Math_SmoothStepToF(&this->dyna.actor.world.pos.x, this->openPos.x, 1.0f, 4.0f, 0.1f); Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->openPos.y, 1.0f, 4.0f, 0.1f); Math_SmoothStepToF(&this->dyna.actor.world.pos.z, this->openPos.z, 1.0f, 4.0f, 0.1f); @@ -138,10 +138,10 @@ void BgMizuShutter_Move(BgMizuShutter* this, PlayState* play) { void BgMizuShutter_WaitForTimer(BgMizuShutter* this, PlayState* play) { if (this->timerMax != 0x3F * 20) { this->timer--; - func_8002F994(&this->dyna.actor, this->timer); + Actor_PlaySfx_FlaggedTimer(&this->dyna.actor, this->timer); if (this->timer == 0) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_METALDOOR_CLOSE); - Flags_UnsetSwitch(play, BGMIZUSHUTTER_SWITCH_PARAM(&this->dyna.actor)); + Flags_UnsetSwitch(play, BGMIZUSHUTTER_GET_SWITCH(&this->dyna.actor)); this->actionFunc = BgMizuShutter_Move; } } @@ -160,8 +160,7 @@ void BgMizuShutter_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_mizu_shutter.c", 410); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mizu_shutter.c", 415), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_mizu_shutter.c", 415); if (this->displayList != NULL) { gSPDisplayList(POLY_OPA_DISP++, this->displayList); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h index 58f822fdbe..cc42e4ddf3 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h @@ -4,10 +4,11 @@ #include "ultra64.h" #include "global.h" -#define BGMIZUSHUTTER_SIZE_PARAM(thisx) (((u16)(thisx)->params >> 0xC) & 0xF) -#define BGMIZUSHUTTER_TIMER_PARAM(thisx) (((u16)(thisx)->params >> 0x6) & 0x3F) -#define BGMIZUSHUTTER_SWITCH_PARAM(thisx) (((u16)(thisx)->params >> 0x0) & 0x3F) -#define BGMIZUSHUTTER_PARAMS(size, timer, switchFlag) (((size) << 0xC) | ((timer) << 0x6) | (switchFlag)) +#define BGMIZUSHUTTER_GET_SIZE(thisx) PARAMS_GET_U((u16)(thisx)->params, 12, 4) +#define BGMIZUSHUTTER_GET_TIMER(thisx) PARAMS_GET_U((u16)(thisx)->params, 6, 6) +#define BGMIZUSHUTTER_GET_SWITCH(thisx) PARAMS_GET_U((u16)(thisx)->params, 0, 6) + +#define BGMIZUSHUTTER_PARAMS(size, timer, switchFlag) (((size) << 12) | ((timer) << 6) | (switchFlag)) struct BgMizuShutter; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c index 8d9ebd8556..1810d0bd2d 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c @@ -16,7 +16,7 @@ void BgMizuUzu_Draw(Actor* thisx, PlayState* play); void func_8089F788(BgMizuUzu* this, PlayState* play); -ActorInit Bg_Mizu_Uzu_InitVars = { +ActorProfile Bg_Mizu_Uzu_Profile = { /**/ ACTOR_BG_MIZU_UZU, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c index b9495198a4..219d47b246 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c @@ -17,7 +17,7 @@ void BgMizuWater_Draw(Actor* thisx, PlayState* play); void BgMizuWater_WaitForAction(BgMizuWater* this, PlayState* play); void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, PlayState* play); -typedef struct { +typedef struct WaterLevel { s32 switchFlag; s32 yDiff; } WaterLevel; @@ -29,7 +29,7 @@ static WaterLevel sWaterLevels[] = { { WATER_TEMPLE_WATER_F1_FLAG, WATER_TEMPLE_WATER_F1_Y - WATER_TEMPLE_WATER_F3_Y }, }; -ActorInit Bg_Mizu_Water_InitVars = { +ActorProfile Bg_Mizu_Water_Profile = { /**/ ACTOR_BG_MIZU_WATER, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -98,8 +98,8 @@ void BgMizuWater_Init(Actor* thisx, PlayState* play) { s32 waterLevelActionIndex; waterBoxes = play->colCtx.colHeader->waterBoxes; - this->type = this->actor.params & 0xFF; - this->switchFlag = (this->actor.params >> 8) & 0xFF; + this->type = PARAMS_GET_U(this->actor.params, 0, 8); + this->switchFlag = PARAMS_GET_U(this->actor.params, 8, 8); Actor_ProcessInitChain(&this->actor, sInitChain); initialActorY = this->actor.world.pos.y; this->baseY = initialActorY; @@ -238,7 +238,7 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, PlayState* play) { } if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 5.0f)) { - play->roomCtx.unk_74[0] = 0; + play->roomCtx.drawParams[0] = 0; this->actionFunc = BgMizuWater_WaitForAction; Message_CloseTextbox(play); } @@ -253,7 +253,7 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, PlayState* play) { this->targetY = this->baseY; } if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 1.0f)) { - play->roomCtx.unk_74[0] = 0; + play->roomCtx.drawParams[0] = 0; this->actionFunc = BgMizuWater_WaitForAction; } waterBoxes[6].ySurface = this->actor.world.pos.y; @@ -265,7 +265,7 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, PlayState* play) { this->targetY = this->baseY; } if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 1.0f)) { - play->roomCtx.unk_74[0] = 0; + play->roomCtx.drawParams[0] = 0; this->actionFunc = BgMizuWater_WaitForAction; } waterBoxes[8].ySurface = this->actor.world.pos.y; @@ -277,7 +277,7 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, PlayState* play) { this->targetY = this->baseY; } if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 1.0f)) { - play->roomCtx.unk_74[0] = 0; + play->roomCtx.drawParams[0] = 0; this->actionFunc = BgMizuWater_WaitForAction; } waterBoxes[16].ySurface = this->actor.world.pos.y; @@ -286,10 +286,10 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, PlayState* play) { if (this->targetY < this->actor.world.pos.y) { Rumble_Request(0.0f, 120, 20, 10); - func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } else if (this->targetY > this->actor.world.pos.y) { Rumble_Request(0.0f, 120, 20, 10); - func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } } @@ -323,7 +323,7 @@ void BgMizuWater_Update(Actor* thisx, PlayState* play) { unk1 = 255 - (s32)((posY - WATER_TEMPLE_WATER_F2_Y) / (WATER_TEMPLE_WATER_F3_Y - WATER_TEMPLE_WATER_F2_Y) * (255 - 160)); } - play->roomCtx.unk_74[1] = ((u8)unk0 << 8) | (unk1 & 0xFF); + play->roomCtx.drawParams[1] = ((u8)unk0 << 8) | (unk1 & 0xFF); } this->actionFunc(this, play); @@ -341,8 +341,7 @@ void BgMizuWater_Draw(Actor* thisx, PlayState* play) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, -gameplayFrames * 1, gameplayFrames * 1, 32, 32, 1, 0, -gameplayFrames * 1, 32, 32)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mizu_water.c", 749), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_mizu_water.c", 749); gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 128); diff --git a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c index 4463a4f79b..7dd37baf58 100644 --- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c +++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c @@ -24,7 +24,7 @@ void BgMjin_Draw(Actor* thisx, PlayState* play); void func_808A0850(BgMjin* this, PlayState* play); void BgMjin_DoNothing(BgMjin* this, PlayState* play); -ActorInit Bg_Mjin_InitVars = { +ActorProfile Bg_Mjin_Profile = { /**/ ACTOR_BG_MJIN, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -119,8 +119,7 @@ void BgMjin_Draw(Actor* thisx, PlayState* play) { } Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mjin.c", 285), - G_MTX_NOPUSH | G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_mjin.c", 285); gSPDisplayList(POLY_OPA_DISP++, dlist); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_mjin.c", 288); diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index dab97a76ae..f3e270f964 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -28,7 +28,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, PlayState* play); void BgMoriBigst_StalfosPairFight(BgMoriBigst* this, PlayState* play); void BgMoriBigst_SetupDone(BgMoriBigst* this, PlayState* play); -ActorInit Bg_Mori_Bigst_InitVars = { +ActorProfile Bg_Mori_Bigst_Profile = { /**/ ACTOR_BG_MORI_BIGST, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -75,7 +75,7 @@ void BgMoriBigst_Init(Actor* thisx, PlayState* play) { // "mori (bigST.keyceiling)" PRINTF("mori (bigST.鍵型天井)(arg : %04x)(sw %d)(noE %d)(roomC %d)(playerPosY %f)\n", this->dyna.actor.params, - Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F), + Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)), Flags_GetTempClear(play, this->dyna.actor.room), Flags_GetClear(play, this->dyna.actor.room), GET_PLAYER(play)->actor.world.pos.y); BgMoriBigst_InitDynapoly(this, play, &gMoriBigstCol, 0); @@ -88,7 +88,7 @@ void BgMoriBigst_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->dyna.actor); return; } - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; } else { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 270.0f; @@ -114,7 +114,7 @@ void BgMoriBigst_WaitForMoriTex(BgMoriBigst* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->moriTexObjectSlot)) { thisx->draw = BgMoriBigst_Draw; if (Flags_GetClear(play, thisx->room) && (GET_PLAYER(play)->actor.world.pos.y > 700.0f)) { - if (Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6))) { BgMoriBigst_SetupDone(this, play); } else { BgMoriBigst_SetupStalfosFight(this, play); @@ -219,7 +219,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, PlayState* play) { void BgMoriBigst_StalfosPairFight(BgMoriBigst* this, PlayState* play) { if ((this->dyna.actor.home.rot.z == 0) && !Player_InCsMode(play)) { - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); BgMoriBigst_SetupDone(this, play); } } @@ -253,8 +253,7 @@ void BgMoriBigst_Draw(Actor* thisx, PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mori_bigst.c", 548), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_mori_bigst.c", 548); gSPDisplayList(POLY_OPA_DISP++, gMoriBigstDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_mori_bigst.c", 553); diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index fb3ddac693..cc5729dc09 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -19,7 +19,7 @@ void BgMoriElevator_MoveAboveGround(BgMoriElevator* this, PlayState* play); static s16 sIsSpawned = false; -ActorInit Bg_Mori_Elevator_InitVars = { +ActorProfile Bg_Mori_Elevator_Profile = { /**/ ACTOR_BG_MORI_ELEVATOR, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -139,7 +139,7 @@ void BgMoriElevator_SetupWaitAfterInit(BgMoriElevator* this) { void BgMoriElevator_WaitAfterInit(BgMoriElevator* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->moriTexObjectSlot)) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { if (play->roomCtx.curRoom.num == 2) { this->dyna.actor.world.pos.y = 73.0f; BgMoriElevator_SetupSetPosition(this); @@ -214,12 +214,12 @@ void BgMoriElevator_SetPosition(BgMoriElevator* this, PlayState* play) { } else if ((play->roomCtx.curRoom.num == 17) && (-275.0f < this->dyna.actor.world.pos.y)) { this->targetY = -779.0f; BgMoriElevator_StopMovement(this); - } else if ((play->roomCtx.curRoom.num == 2) && Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) && + } else if ((play->roomCtx.curRoom.num == 2) && Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) && (this->unk_16C == 0)) { this->targetY = 73.0f; func_808A1C30(this); - } else if ((play->roomCtx.curRoom.num == 2) && !Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) && - (this->unk_16C != 0)) { + } else if ((play->roomCtx.curRoom.num == 2) && + !Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) && (this->unk_16C != 0)) { this->targetY = 233.0f; func_808A1CF4(this, play); } @@ -249,7 +249,7 @@ void BgMoriElevator_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); this->unk_170 = this->dyna.interactFlags; - this->unk_16C = Flags_GetSwitch(play, (thisx->params & 0x3F)); + this->unk_16C = Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6)); } void BgMoriElevator_Draw(Actor* thisx, PlayState* play) { @@ -260,8 +260,7 @@ void BgMoriElevator_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mori_elevator.c", 580), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_mori_elevator.c", 580); gSPDisplayList(POLY_OPA_DISP++, gMoriElevatorDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_mori_elevator.c", 584); diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c index 69eed856ff..ea0654b066 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c @@ -24,7 +24,7 @@ void BgMoriHashigo_SetupLadderFall(BgMoriHashigo* this); void BgMoriHashigo_LadderFall(BgMoriHashigo* this, PlayState* play); void BgMoriHashigo_SetupLadderRest(BgMoriHashigo* this); -ActorInit Bg_Mori_Hashigo_InitVars = { +ActorProfile Bg_Mori_Hashigo_Profile = { /**/ ACTOR_BG_MORI_HASHIGO, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -39,7 +39,7 @@ ActorInit Bg_Mori_Hashigo_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0x00000000, 0x00, 0x00 }, { 0x0001F820, 0x00, 0x00 }, ATELEM_NONE, @@ -52,7 +52,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -64,9 +64,12 @@ static ColliderJntSphInit sJntSphInit = { }; static InitChainEntry sInitChainClasp[] = { - ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 3, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 40, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), + ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_3, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 40, ICHAIN_CONTINUE), + ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), }; static InitChainEntry sInitChainLadder[] = { @@ -135,7 +138,7 @@ s32 BgMoriHashigo_SpawnLadder(BgMoriHashigo* this, PlayState* play) { s32 BgMoriHashigo_InitClasp(BgMoriHashigo* this, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChainClasp); - this->dyna.actor.flags |= ACTOR_FLAG_0; + this->dyna.actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; Actor_SetFocus(&this->dyna.actor, 55.0f); BgMoriHashigo_InitCollider(this, play); if ((this->dyna.actor.params == HASHIGO_CLASP) && !BgMoriHashigo_SpawnLadder(this, play)) { @@ -286,11 +289,9 @@ void BgMoriHashigo_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_hashigo.c", 516); Gfx_SetupDL_25Opa(play->state.gfxCtx); - if (1) {} gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mori_hashigo.c", 521), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_mori_hashigo.c", 521); switch (this->dyna.actor.params) { case HASHIGO_CLASP: diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h index 5e957f4035..4e6e93a5de 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h @@ -18,7 +18,7 @@ typedef struct BgMoriHashigo { /* 0x01CC */ s8 moriTexObjectSlot; } BgMoriHashigo; // size = 0x01D0 -typedef enum { +typedef enum HasigoType { /* -1 */ HASHIGO_CLASP = -1, /* 0 */ HASHIGO_LADDER } HasigoType; diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c index 9d3dcbae81..f09948a29a 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c @@ -21,7 +21,7 @@ void BgMoriHashira4_PillarsRotate(BgMoriHashira4* this, PlayState* play); void BgMoriHashira4_GateWait(BgMoriHashira4* this, PlayState* play); void BgMoriHashira4_GateOpen(BgMoriHashira4* this, PlayState* play); -ActorInit Bg_Mori_Hashira4_InitVars = { +ActorProfile Bg_Mori_Hashira4_Profile = { /**/ ACTOR_BG_MORI_HASHIRA4, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -71,7 +71,7 @@ void BgMoriHashira4_Init(Actor* thisx, PlayState* play) { s32 pad; BgMoriHashira4* this = (BgMoriHashira4*)thisx; - this->switchFlag = (this->dyna.actor.params >> 8) & 0x3F; + this->switchFlag = PARAMS_GET_U(this->dyna.actor.params, 8, 6); this->dyna.actor.params &= 0xFF; if (this->dyna.actor.params == 0) { @@ -167,8 +167,7 @@ void BgMoriHashira4_Draw(Actor* thisx, PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mori_hashira4.c", 344), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_mori_hashira4.c", 344); gSPDisplayList(POLY_OPA_DISP++, sDisplayLists[this->dyna.actor.params]); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_mori_hashira4.c", 348); diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index b6c0d9c9bb..3e346641eb 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -5,6 +5,7 @@ */ #include "z_bg_mori_hineri.h" +#include "versions.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_box/object_box.h" #include "assets/objects/object_mori_hineri1/object_mori_hineri1.h" @@ -29,7 +30,7 @@ void func_808A3D58(BgMoriHineri* this, PlayState* play); static s16 sSubCamId = CAM_ID_NONE; -ActorInit Bg_Mori_Hineri_InitVars = { +ActorProfile Bg_Mori_Hineri_Profile = { /**/ ACTOR_BG_MORI_HINERI, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -61,16 +62,16 @@ void BgMoriHineri_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - switchFlagParam = this->dyna.actor.params & 0x3F; - t6 = this->dyna.actor.params & 0x4000; + switchFlagParam = PARAMS_GET_U(this->dyna.actor.params, 0, 6); + t6 = PARAMS_GET_NOSHIFT(this->dyna.actor.params, 14, 1); if (t6 != 0) { this->switchFlag = switchFlagParam; } else { - this->switchFlag = ((this->dyna.actor.params >> 8) & 0x3F); + this->switchFlag = PARAMS_GET_U(this->dyna.actor.params, 8, 6); this->switchFlag = (Flags_GetSwitch(play, this->switchFlag)) ? 1 : 0; } - this->dyna.actor.params = ((this->dyna.actor.params & 0x8000) >> 0xE); + this->dyna.actor.params = TWISTED_HALLWAY_GET_PARAM_15(&this->dyna.actor); if (Flags_GetSwitch(play, switchFlagParam)) { if (this->dyna.actor.params == 0) { this->dyna.actor.params = 1; @@ -203,7 +204,9 @@ void func_808A3E54(BgMoriHineri* this, PlayState* play) { this->moriHineriObjectSlot = objectSlot; this->dyna.actor.params ^= 1; sSubCamId = SUB_CAM_ID_DONE; +#if OOT_VERSION >= PAL_1_0 Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); +#endif } else { this->dyna.actor.draw = NULL; this->actionFunc = func_808A3D58; @@ -211,7 +214,7 @@ void func_808A3E54(BgMoriHineri* this, PlayState* play) { } } if ((sSubCamId >= CAM_ID_SUB_FIRST) && ((GET_ACTIVE_CAM(play)->eye.z - this->dyna.actor.world.pos.z) < 1100.0f)) { - func_8002F948(&this->dyna.actor, NA_SE_EV_FLOOR_ROLLING - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->dyna.actor, NA_SE_EV_FLOOR_ROLLING - SFX_FLAG); } } @@ -223,15 +226,14 @@ void BgMoriHineri_Update(Actor* thisx, PlayState* play) { void BgMoriHineri_DrawHallAndRoom(Actor* thisx, PlayState* play) { BgMoriHineri* this = (BgMoriHineri*)thisx; - s32 pad; + PlayState* play2 = (PlayState*)play; MtxF mtx; OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_hineri.c", 611); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mori_hineri.c", 618), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPSegment(POLY_OPA_DISP++, 0x08, play2->objectCtx.slots[this->moriTexObjectSlot].segment); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play2->state.gfxCtx, "../z_bg_mori_hineri.c", 618); gSPDisplayList(POLY_OPA_DISP++, sDLists[this->dyna.actor.params]); if (this->boxObjectSlot > 0) { Matrix_Get(&mtx); @@ -245,31 +247,28 @@ void BgMoriHineri_DrawHallAndRoom(Actor* thisx, PlayState* play) { } Matrix_RotateZYX(0, -0x8000, this->dyna.actor.shape.rot.z, MTXMODE_APPLY); Matrix_Translate(0.0f, -50.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mori_hineri.c", 652), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_mori_hineri.c", 652); gSPDisplayList(POLY_OPA_DISP++, gDungeonDoorDL); } - if ((this->boxObjectSlot > 0) && ((this->boxObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_BOX)) > 0) && - Object_IsLoaded(&play->objectCtx, this->boxObjectSlot)) { - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->boxObjectSlot].segment); + if ((this->boxObjectSlot > 0) && ((this->boxObjectSlot = Object_GetSlot(&play2->objectCtx, OBJECT_BOX)) > 0) && + Object_IsLoaded(&play2->objectCtx, this->boxObjectSlot)) { + gSPSegment(POLY_OPA_DISP++, 0x06, play2->objectCtx.slots[this->boxObjectSlot].segment); gSPSegment(POLY_OPA_DISP++, 0x08, &D_80116280[2]); Matrix_Put(&mtx); Matrix_Translate(147.0f, -245.0f, -453.0f, MTXMODE_APPLY); Matrix_RotateY(M_PI / 2, MTXMODE_APPLY); Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mori_hineri.c", 689), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_mori_hineri.c", 689); gSPDisplayList(POLY_OPA_DISP++, gTreasureChestBossKeyChestFrontDL); Matrix_Put(&mtx); Matrix_Translate(167.0f, -218.0f, -453.0f, MTXMODE_APPLY); - if (Flags_GetTreasure(play, 0xE)) { + if (Flags_GetTreasure(play2, 0xE)) { Matrix_RotateZ(BINANG_TO_RAD(0x3500), MTXMODE_APPLY); } else { Matrix_RotateZ(M_PI, MTXMODE_APPLY); } Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mori_hineri.c", 703), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_mori_hineri.c", 703); gSPDisplayList(POLY_OPA_DISP++, gTreasureChestBossKeyChestSideAndTopDL); } diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h index 8d4323e630..468bb29656 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h @@ -6,6 +6,9 @@ struct BgMoriHineri; +// Due to a unique access pattern, this param cannot use the generic "PARAMS_GET_U" macros +#define TWISTED_HALLWAY_GET_PARAM_15(thisx) (((thisx)->params & (NBITS_TO_MASK(1) << (15))) >> ((15) - (1))) + typedef void (*BgMoriHineriActionFunc)(struct BgMoriHineri*, PlayState*); typedef struct BgMoriHineri { diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c index 0af410e5f0..507f92e73c 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c @@ -21,7 +21,7 @@ void BgMoriIdomizu_Main(BgMoriIdomizu* this, PlayState* play); static s16 sIsSpawned = false; -ActorInit Bg_Mori_Idomizu_InitVars = { +ActorProfile Bg_Mori_Idomizu_Profile = { /**/ ACTOR_BG_MORI_IDOMIZU, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -58,7 +58,7 @@ void BgMoriIdomizu_Init(Actor* thisx, PlayState* play) { this->actor.scale.z = 1.0f; this->actor.world.pos.x = 119.0f; this->actor.world.pos.z = -1820.0f; - this->prevSwitchFlagSet = Flags_GetSwitch(play, this->actor.params & 0x3F); + this->prevSwitchFlagSet = Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6)); if (this->prevSwitchFlagSet != 0) { this->actor.world.pos.y = -282.0f; BgMoriIdomizu_SetWaterLevel(play, -282); @@ -111,7 +111,7 @@ void BgMoriIdomizu_Main(BgMoriIdomizu* this, PlayState* play) { s32 switchFlagSet; roomNum = play->roomCtx.curRoom.num; - switchFlagSet = Flags_GetSwitch(play, thisx->params & 0x3F); + switchFlagSet = Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6)); if (switchFlagSet) { this->targetWaterLevel = -282.0f; } else { @@ -165,8 +165,7 @@ void BgMoriIdomizu_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mori_idomizu.c", 360), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_mori_idomizu.c", 360); gSPSegment(POLY_XLU_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment); diff --git a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c index 41a12366b4..261196640c 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c +++ b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c @@ -20,7 +20,7 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, PlayState* play); void BgMoriKaitenkabe_SetupRotate(BgMoriKaitenkabe* this); void BgMoriKaitenkabe_Rotate(BgMoriKaitenkabe* this, PlayState* play); -ActorInit Bg_Mori_Kaitenkabe_InitVars = { +ActorProfile Bg_Mori_Kaitenkabe_Profile = { /**/ ACTOR_BG_MORI_KAITENKABE, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -142,7 +142,7 @@ void BgMoriKaitenkabe_Rotate(BgMoriKaitenkabe* this, PlayState* play) { thisx->world.rot.y = thisx->shape.rot.y = thisx->home.rot.y; Sfx_PlaySfxCentered2(NA_SE_EV_STONEDOOR_STOP); } else { - rotY = this->rotYdeg * (0x10000 / 360.0f); + rotY = DEG_TO_BINANG(this->rotYdeg); thisx->world.rot.y = thisx->shape.rot.y = thisx->home.rot.y + rotY; Sfx_PlaySfxCentered2(NA_SE_EV_WALL_SLIDE - SFX_FLAG); } @@ -172,8 +172,7 @@ void BgMoriKaitenkabe_Draw(Actor* thisx, PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mori_kaitenkabe.c", 352), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_mori_kaitenkabe.c", 352); gSPDisplayList(POLY_OPA_DISP++, gMoriKaitenkabeDL); diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c index 3c2474c41f..4d8799783c 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c @@ -28,7 +28,7 @@ void BgMoriRakkatenjo_Rise(BgMoriRakkatenjo* this, PlayState* play); static s16 sCamSetting = CAM_SET_NONE; -ActorInit Bg_Mori_Rakkatenjo_InitVars = { +ActorProfile Bg_Mori_Rakkatenjo_Profile = { /**/ ACTOR_BG_MORI_RAKKATENJO, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -232,8 +232,7 @@ void BgMoriRakkatenjo_Draw(Actor* thisx, PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mori_rakkatenjo.c", 502), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_mori_rakkatenjo.c", 502); gSPDisplayList(POLY_OPA_DISP++, gMoriRakkatenjoDL); diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index f5fb613bab..017f18606d 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -28,7 +28,7 @@ void BgPoEvent_PaintingAppear(BgPoEvent* this, PlayState* play); void BgPoEvent_PaintingPresent(BgPoEvent* this, PlayState* play); void BgPoEvent_PaintingBurn(BgPoEvent* this, PlayState* play); -ActorInit Bg_Po_Event_InitVars = { +ActorProfile Bg_Po_Event_Profile = { /**/ ACTOR_BG_PO_EVENT, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -43,7 +43,7 @@ ActorInit Bg_Po_Event_InitVars = { static ColliderTrisElementInit sTrisElementsInit[2] = { { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0x00000000, 0x00, 0x00 }, { 0x0001F820, 0x00, 0x00 }, ATELEM_NONE, @@ -54,7 +54,7 @@ static ColliderTrisElementInit sTrisElementsInit[2] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0x00000000, 0x00, 0x00 }, { 0x0001F820, 0x00, 0x00 }, ATELEM_NONE, @@ -67,7 +67,7 @@ static ColliderTrisElementInit sTrisElementsInit[2] = { static ColliderTrisInit sTrisInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -196,8 +196,8 @@ void BgPoEvent_Init(Actor* thisx, PlayState* play) { BgPoEvent* this = (BgPoEvent*)thisx; Actor_ProcessInitChain(thisx, sInitChain); - this->type = (thisx->params >> 8) & 0xF; - this->index = (thisx->params >> 0xC) & 0xF; + this->type = PARAMS_GET_U(thisx->params, 8, 4); + this->index = PARAMS_GET_U(thisx->params, 12, 4); thisx->params &= 0x3F; if (this->type >= 2) { @@ -410,7 +410,7 @@ void BgPoEvent_BlockPush(BgPoEvent* this, PlayState* play) { BgPoEvent_CheckBlock(this); BgPoEvent_CheckBlock((BgPoEvent*)this->dyna.actor.parent); } - func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); } void BgPoEvent_BlockReset(BgPoEvent* this, PlayState* play) { @@ -612,8 +612,7 @@ void BgPoEvent_Draw(Actor* thisx, PlayState* play) { } gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, alpha); } - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_po_event.c", 1501), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_po_event.c", 1501); gSPDisplayList(POLY_OPA_DISP++, displayLists[this->type]); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_po_event.c", 1508); diff --git a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c index 5c379a538c..9dae9b2a5d 100644 --- a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c +++ b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c @@ -10,7 +10,7 @@ #define FLAGS 0 -typedef enum { +typedef enum PoeFlameColor { POE_FLAME_PURPLE, // Meg POE_FLAME_RED, // Joelle POE_FLAME_BLUE, // Beth @@ -26,7 +26,7 @@ void BgPoSyokudai_Draw(Actor* thisx, PlayState* play); static ColliderCylinderInit sCylinderInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -34,7 +34,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -58,7 +58,7 @@ static Color_RGBA8 sEnvColors[] = { { 0, 150, 0, 255 }, }; -ActorInit Bg_Po_Syokudai_InitVars = { +ActorProfile Bg_Po_Syokudai_Profile = { /**/ ACTOR_BG_PO_SYOKUDAI, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -80,7 +80,7 @@ void BgPoSyokudai_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); - this->flameColor = (thisx->params >> 8) & 0xFF; + this->flameColor = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0x3F; thisx->colChkInfo.mass = MASS_IMMOVABLE; @@ -135,7 +135,7 @@ void BgPoSyokudai_Update(Actor* thisx, PlayState* play) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); if (Flags_GetSwitch(play, this->actor.params)) { - func_8002F974(&this->actor, NA_SE_EV_TORCH - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_TORCH - SFX_FLAG); } this->flameTextureScroll++; } @@ -150,8 +150,7 @@ void BgPoSyokudai_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_po_syokudai.c", 315); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_po_syokudai.c", 319), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_po_syokudai.c", 319); gSPDisplayList(POLY_OPA_DISP++, gGoldenTorchDL); if (Flags_GetSwitch(play, this->actor.params)) { @@ -180,8 +179,7 @@ void BgPoSyokudai_Draw(Actor* thisx, PlayState* play) { MTXMODE_APPLY); Matrix_Scale(0.0027f, 0.0027f, 0.0027f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_po_syokudai.c", 368), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_po_syokudai.c", 368); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); } CLOSE_DISPS(play->state.gfxCtx, "../z_bg_po_syokudai.c", 373); diff --git a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c index ef5e59d667..7d9ef63e60 100644 --- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c +++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c @@ -16,7 +16,7 @@ void BgPushbox_Draw(Actor* thisx, PlayState* play); void BgPushbox_UpdateImpl(BgPushbox* this, PlayState* play); -ActorInit Bg_Pushbox_InitVars = { +ActorProfile Bg_Pushbox_Profile = { /**/ ACTOR_BG_PUSHBOX, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -81,8 +81,7 @@ void BgPushbox_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_pushbox.c", 263); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_pushbox.c", 269), - G_MTX_NOPUSH | G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_pushbox.c", 269); gSPDisplayList(POLY_OPA_DISP++, gBlockSmallDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_pushbox.c", 272); diff --git a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index 680f6e12e6..3b1f559479 100644 --- a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -9,7 +9,7 @@ #define FLAGS ACTOR_FLAG_4 -typedef enum { +typedef enum WindmillSetpiecesMode { /* 0 */ WINDMILL_ROTATING_GEAR, /* 1 */ WINDMILL_DAMPE_STONE_DOOR } WindmillSetpiecesMode; @@ -26,7 +26,7 @@ void BgRelayObjects_DoNothing(BgRelayObjects* this, PlayState* play); void func_808A932C(BgRelayObjects* this, PlayState* play); void func_808A939C(BgRelayObjects* this, PlayState* play); -ActorInit Bg_Relay_Objects_InitVars = { +ActorProfile Bg_Relay_Objects_Profile = { /**/ ACTOR_BG_RELAY_OBJECTS, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -50,8 +50,8 @@ void BgRelayObjects_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = thisx->params & 0x3F; - thisx->params = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET_U(thisx->params, 0, 6); + thisx->params = PARAMS_GET_U(thisx->params, 8, 8); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS | DYNA_TRANSFORM_ROT_Y); if (thisx->params == WINDMILL_ROTATING_GEAR) { CollisionHeader_GetVirtual(&gWindmillRotatingPlatformCol, &colHeader); @@ -134,7 +134,7 @@ void func_808A91AC(BgRelayObjects* this, PlayState* play) { if (this->timer != 0) { this->timer--; } - func_8002F994(&this->dyna.actor, this->timer); + Actor_PlaySfx_FlaggedTimer(&this->dyna.actor, this->timer); } if ((this->timer == 0) || (this->unk_169 == play->roomCtx.curRoom.num)) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE); diff --git a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c index a16c96b91d..2ad49f6e71 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c @@ -14,7 +14,7 @@ void BgSpot00Break_Destroy(Actor* thisx, PlayState* play); void BgSpot00Break_Update(Actor* thisx, PlayState* play); void BgSpot00Break_Draw(Actor* thisx, PlayState* play); -ActorInit Bg_Spot00_Break_InitVars = { +ActorProfile Bg_Spot00_Break_Profile = { /**/ ACTOR_BG_SPOT00_BREAK, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c index 1fafea47cd..501d0f430b 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c @@ -10,7 +10,7 @@ #define FLAGS ACTOR_FLAG_4 -typedef enum { +typedef enum DrawbridgeType { /* -1 */ DT_DRAWBRIDGE = -1, /* 0 */ DT_CHAIN_1, /* 1 */ DT_CHAIN_2 @@ -25,7 +25,7 @@ void BgSpot00Hanebasi_DrawbridgeWait(BgSpot00Hanebasi* this, PlayState* play); void BgSpot00Hanebasi_DrawbridgeRiseAndFall(BgSpot00Hanebasi* this, PlayState* play); void BgSpot00Hanebasi_SetTorchLightInfo(BgSpot00Hanebasi* this, PlayState* play); -ActorInit Bg_Spot00_Hanebasi_InitVars = { +ActorProfile Bg_Spot00_Hanebasi_Profile = { /**/ ACTOR_BG_SPOT00_HANEBASI, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -177,13 +177,13 @@ void BgSpot00Hanebasi_DrawbridgeRiseAndFall(BgSpot00Hanebasi* this, PlayState* p if (this->actionFunc == BgSpot00Hanebasi_DrawbridgeWait) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE_STOP); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG); } } else { if (this->actionFunc == BgSpot00Hanebasi_DrawbridgeWait) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN - SFX_FLAG); } } } @@ -277,8 +277,7 @@ void BgSpot00Hanebasi_DrawTorches(Actor* thisx, PlayState* play2) { Matrix_RotateY(angle, MTXMODE_APPLY); Matrix_Scale(sTorchFlameScale, sTorchFlameScale, sTorchFlameScale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot00_hanebasi.c", 674), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_spot00_hanebasi.c", 674); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); } @@ -293,8 +292,7 @@ void BgSpot00Hanebasi_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot00_hanebasi.c", 702), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_spot00_hanebasi.c", 702); if (thisx->params == DT_DRAWBRIDGE) { gSPDisplayList(POLY_OPA_DISP++, gHyruleFieldCastleDrawbridgeDL); diff --git a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c index f2306ac6b7..9dde534fa8 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c @@ -16,7 +16,7 @@ void BgSpot01Fusya_Draw(Actor* thisx, PlayState* play); void func_808AAA50(BgSpot01Fusya* this, PlayState* play); -ActorInit Bg_Spot01_Fusya_InitVars = { +ActorProfile Bg_Spot01_Fusya_Profile = { /**/ ACTOR_BG_SPOT01_FUSYA, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -79,8 +79,7 @@ void BgSpot01Fusya_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot01_fusya.c", 214), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_spot01_fusya.c", 214); gSPDisplayList(POLY_OPA_DISP++, gKakarikoWindmillSailsDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_spot01_fusya.c", 219); diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c index a8e6ce6559..475940dd53 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c @@ -36,7 +36,7 @@ static BgSpot01IdohashiraDrawFunc sDrawFuncs[] = { func_808AB700, }; -ActorInit Bg_Spot01_Idohashira_InitVars = { +ActorProfile Bg_Spot01_Idohashira_Profile = { /**/ ACTOR_BG_SPOT01_IDOHASHIRA, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -324,8 +324,7 @@ void func_808AB700(BgSpot01Idohashira* this, PlayState* play) { Gfx_SetupDL_25Opa(localGfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(localGfxCtx, "../z_bg_spot01_idohashira.c", 699), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, localGfxCtx, "../z_bg_spot01_idohashira.c", 699); func_808AAF34(this, play); gSPDisplayList(POLY_OPA_DISP++, gKakarikoWellArchDL); diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c index 4b1ec00adf..b709fc11e3 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c @@ -16,7 +16,7 @@ void BgSpot01Idomizu_Draw(Actor* thisx, PlayState* play); void func_808ABB84(BgSpot01Idomizu* this, PlayState* play); -ActorInit Bg_Spot01_Idomizu_InitVars = { +ActorProfile Bg_Spot01_Idomizu_Profile = { /**/ ACTOR_BG_SPOT01_IDOMIZU, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -73,8 +73,7 @@ void BgSpot01Idomizu_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot01_idomizu.c", 232), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_spot01_idomizu.c", 232); frames = play->state.frames; gSPSegment(POLY_XLU_DISP++, 0x08, diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c index 0acc4f2073..964416c0b0 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c @@ -16,7 +16,7 @@ void BgSpot01Idosoko_Draw(Actor* thisx, PlayState* play); void func_808ABF54(BgSpot01Idosoko* this, PlayState* play); -ActorInit Bg_Spot01_Idosoko_InitVars = { +ActorProfile Bg_Spot01_Idosoko_Profile = { /**/ ACTOR_BG_SPOT01_IDOSOKO, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -73,8 +73,7 @@ void BgSpot01Idosoko_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot01_idosoko.c", 166), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_spot01_idosoko.c", 166); gSPDisplayList(POLY_OPA_DISP++, gKakarikoBOTWStoneDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_spot01_idosoko.c", 171); diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c index 63697a0a80..6b35c92126 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c @@ -18,7 +18,7 @@ void func_808AC2BC(BgSpot01Objects2* this, PlayState* play); void func_808AC474(BgSpot01Objects2* this, PlayState* play); void func_808AC4A4(Actor* thisx, PlayState* play); -ActorInit Bg_Spot01_Objects2_InitVars = { +ActorProfile Bg_Spot01_Objects2_Profile = { /**/ ACTOR_BG_SPOT01_OBJECTS2, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -45,7 +45,7 @@ static Gfx* D_808AC510[] = { void BgSpot01Objects2_Init(Actor* thisx, PlayState* play) { BgSpot01Objects2* this = (BgSpot01Objects2*)thisx; - switch (this->dyna.actor.params & 7) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 3)) { case 0: case 1: case 2: @@ -99,7 +99,7 @@ void func_808AC2BC(BgSpot01Objects2* this, PlayState* play) { this->dyna.actor.objectSlot = this->requiredObjectSlot; DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - switch (this->dyna.actor.params & 7) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 3)) { case 4: // Shooting gallery CollisionHeader_GetVirtual(&gKakarikoShootingGalleryCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); @@ -108,10 +108,10 @@ void func_808AC2BC(BgSpot01Objects2* this, PlayState* play) { CollisionHeader_GetVirtual(&object_spot01_matoyab_col, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); if (IS_DAY) { - func_808AC22C(play->pathList, &position, ((s32)thisx->params >> 8) & 0xFF, 0); + func_808AC22C(play->pathList, &position, PARAMS_GET_U((s32)thisx->params, 8, 8), 0); Actor_SpawnAsChild(&play->actorCtx, thisx, play, ACTOR_EN_DAIKU_KAKARIKO, position.x, position.y, position.z, thisx->world.rot.x, thisx->world.rot.y, thisx->world.rot.z, - ((((s32)thisx->params >> 8) & 0xFF) << 8) + 1); + (PARAMS_GET_U((s32)thisx->params, 8, 8) << 8) + 1); } break; case 0: // Potion Shop Poster @@ -135,5 +135,5 @@ void BgSpot01Objects2_Update(Actor* thisx, PlayState* play) { } void func_808AC4A4(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, D_808AC510[thisx->params & 7]); + Gfx_DrawDListOpa(play, D_808AC510[PARAMS_GET_U(thisx->params, 0, 3)]); } diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index 1f1f9da166..811ce475ce 100644 --- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -31,7 +31,7 @@ static void* D_808AD850[] = { object_spot02_objects_Tex_0102B0, object_spot02_objects_Tex_010EB0, object_spot02_objects_Tex_011AB0, }; -ActorInit Bg_Spot02_Objects_InitVars = { +ActorProfile Bg_Spot02_Objects_Profile = { /**/ ACTOR_BG_SPOT02_OBJECTS, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -53,8 +53,8 @@ void BgSpot02Objects_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); - this->unk_16B = (u16)(thisx->params >> 8); - thisx->params = (u16)(thisx->params & 0xFF); + this->unk_16B = (u16)PARAMS_GET_NOMASK(thisx->params, 8); + thisx->params = (u16)PARAMS_GET_U(thisx->params, 0, 8); switch (thisx->params) { case 0: @@ -178,7 +178,7 @@ void func_808ACB58(BgSpot02Objects* this, PlayState* play) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); this->actionFunc = func_808AC8FC; } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_WALL_MOVE_SP - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_WALL_MOVE_SP - SFX_FLAG); } } @@ -255,8 +255,7 @@ void func_808ACCB8(Actor* thisx, PlayState* play2) { gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, redPrim, greenPrim, bluePrim, 255); gDPSetEnvColor(POLY_XLU_DISP++, redEnv, greenEnv, blueEnv, 255); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot02_objects.c", 679), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_spot02_objects.c", 679); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_808AD850[this->unk_16A])); gDPPipeSync(POLY_XLU_DISP++); gSPDisplayList(POLY_XLU_DISP++, object_spot02_objects_DL_0126F0); @@ -315,8 +314,7 @@ void func_808AD450(Actor* thisx, PlayState* play2) { gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 170, 128); gDPSetEnvColor(POLY_XLU_DISP++, 150, 120, 0, 128); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot02_objects.c", 795), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_spot02_objects.c", 795); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 2 * this->timer, -3 * this->timer, 32, 64, 1, 4 * this->timer, -6 * this->timer, 32, 64)); diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c index 78d1e3d376..12d6cced10 100644 --- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c @@ -16,7 +16,7 @@ void BgSpot03Taki_Draw(Actor* thisx, PlayState* play); void func_808ADEF0(BgSpot03Taki* this, PlayState* play); -ActorInit Bg_Spot03_Taki_InitVars = { +ActorProfile Bg_Spot03_Taki_Profile = { /**/ ACTOR_BG_SPOT03_TAKI, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -47,7 +47,7 @@ void BgSpot03Taki_Init(Actor* thisx, PlayState* play) { s16 pad; CollisionHeader* colHeader = NULL; - this->switchFlag = (this->dyna.actor.params & 0x3F); + this->switchFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 6); DynaPolyActor_Init(&this->dyna, 0); CollisionHeader_GetVirtual(&object_spot03_object_Col_000C98, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); @@ -122,8 +122,7 @@ void BgSpot03Taki_Draw(Actor* thisx, PlayState* play) { gameplayFrames = play->gameplayFrames; - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot03_taki.c", 325), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_spot03_taki.c", 325); Gfx_SetupDL_25Xlu(play->state.gfxCtx); @@ -147,8 +146,6 @@ void BgSpot03Taki_Draw(Actor* thisx, PlayState* play) { gSPDisplayList(POLY_XLU_DISP++, object_spot03_object_DL_001580); - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_bg_spot03_taki.c", 358); this->bufferIndex = this->bufferIndex == 0; diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h index 3055fb7f87..f6e3daab16 100644 --- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h +++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef enum { +typedef enum BgSpot03TakiState { WATERFALL_CLOSED, WATERFALL_OPENING_IDLE, WATERFALL_OPENING_ANIMATED, diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c index 681a512d87..843b3e5235 100644 --- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c +++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c @@ -17,7 +17,7 @@ void func_808AE5A8(BgSpot05Soko* this, PlayState* play); void func_808AE5B4(BgSpot05Soko* this, PlayState* play); void func_808AE630(BgSpot05Soko* this, PlayState* play); -ActorInit Bg_Spot05_Soko_InitVars = { +ActorProfile Bg_Spot05_Soko_Profile = { /**/ ACTOR_BG_SPOT05_SOKO, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -45,7 +45,7 @@ void BgSpot05Soko_Init(Actor* thisx, PlayState* play) { s32 pad2; Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; DynaPolyActor_Init(&this->dyna, 0); if (thisx->params == 0) { diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index acba75f76a..aa5b56024b 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -9,14 +9,14 @@ #define FLAGS ACTOR_FLAG_9 -typedef enum { +typedef enum LakeHyliaObjectsType { /* 0x0 */ LHO_WATER_TEMPLE_ENTRACE_GATE, /* 0x1 */ LHO_WATER_TEMPLE_ENTRANCE_LOCK, /* 0x2 */ LHO_WATER_PLANE, /* 0x3 */ LHO_ICE_BLOCK } LakeHyliaObjectsType; -typedef enum { +typedef enum LakeHyliaWaterBoxIndices { /* 0x0 */ LHWB_GERUDO_VALLEY_RIVER_UPPER, // entrance from Gerudo Valley /* 0x1 */ LHWB_GERUDO_VALLEY_RIVER_LOWER, // river flowing from Gerudo Valley /* 0x2 */ LHWB_MAIN_1, // main water box @@ -44,7 +44,7 @@ void BgSpot06Objects_LockFloat(BgSpot06Objects* this, PlayState* play); void BgSpot06Objects_WaterPlaneCutsceneWait(BgSpot06Objects* this, PlayState* play); void BgSpot06Objects_WaterPlaneCutsceneRise(BgSpot06Objects* this, PlayState* play); -ActorInit Bg_Spot06_Objects_InitVars = { +ActorProfile Bg_Spot06_Objects_Profile = { /**/ ACTOR_BG_SPOT06_OBJECTS, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -59,7 +59,7 @@ ActorInit Bg_Spot06_Objects_InitVars = { static ColliderJntSphElementInit sJntSphItemsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000080, 0x00, 0x00 }, ATELEM_NONE, @@ -72,7 +72,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -96,8 +96,8 @@ void BgSpot06Objects_Init(Actor* thisx, PlayState* play) { s32 pad; CollisionHeader* colHeader = NULL; - this->switchFlag = thisx->params & 0xFF; - thisx->params = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET_U(thisx->params, 0, 8); + thisx->params = PARAMS_GET_U(thisx->params, 8, 8); PRINTF("spot06 obj nthisx->arg_data=[%d]", thisx->params); @@ -256,7 +256,7 @@ void BgSpot06Objects_GateOpen(BgSpot06Objects* this, PlayState* play) { this->timer = 0; Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); } } @@ -432,8 +432,7 @@ void BgSpot06Objects_DrawLakeHyliaWater(BgSpot06Objects* this, PlayState* play) Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot06_objects.c", 850), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_spot06_objects.c", 850); gameplayFrames = play->state.frames; @@ -506,5 +505,5 @@ void BgSpot06Objects_WaterPlaneCutsceneRise(BgSpot06Objects* this, PlayState* pl play->colCtx.colHeader->waterBoxes[LHWB_MAIN_2].ySurface = this->dyna.actor.world.pos.y; } - func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } diff --git a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c index c88235dbfd..76d6ce04e7 100644 --- a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c @@ -5,6 +5,7 @@ */ #include "z_bg_spot07_taki.h" +#include "versions.h" #include "assets/objects/object_spot07_object/object_spot07_object.h" #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) @@ -16,7 +17,7 @@ void BgSpot07Taki_Draw(Actor* thisx, PlayState* play); void BgSpot07Taki_DoNothing(BgSpot07Taki* this, PlayState* play); -ActorInit Bg_Spot07_Taki_InitVars = { +ActorProfile Bg_Spot07_Taki_Profile = { /**/ ACTOR_BG_SPOT07_TAKI, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -73,8 +74,7 @@ void BgSpot07Taki_Draw(Actor* thisx, PlayState* play) { frames = play->gameplayFrames; if (LINK_IS_ADULT) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot07_taki.c", 177), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_spot07_taki.c", 177); if (this->dyna.actor.params == 0) { gSPDisplayList(POLY_OPA_DISP++, object_spot07_object_DL_001CF0); } else { @@ -83,8 +83,7 @@ void BgSpot07Taki_Draw(Actor* thisx, PlayState* play) { } Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot07_taki.c", 191), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_spot07_taki.c", 191); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, ((frames * -1) & 0x7F), ((frames * 1) & 0x7F), 32, @@ -93,10 +92,19 @@ void BgSpot07Taki_Draw(Actor* thisx, PlayState* play) { if (!LINK_IS_ADULT) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 128); if (this->dyna.actor.params == 0) { +#if !OOT_PAL_N64 + //! @bug 64x64 texture is scrolled mod 128 instead of mod 256 (i.e. 64 << G_TEXTURE_IMAGE_FRAC), + // so there is a noticeable jump when the scrolling wraps around gSPSegment(POLY_XLU_DISP++, 0x09, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, ((frames * -1) & 0x7F), ((frames * -3) & 0xFF), 64, 64, 1, ((frames * 1) & 0x7F), ((frames * -3) & 0xFF), 64, 64)); +#else + gSPSegment(POLY_XLU_DISP++, 0x09, + Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, ((frames * -1) & 0xFF), + ((frames * -3) & 0xFF), 64, 64, 1, ((frames * 1) & 0xFF), + ((frames * -3) & 0xFF), 64, 64)); +#endif gSPSegment(POLY_XLU_DISP++, 0x0A, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, frames * 0, ((frames * 3) & 0x1FF), 32, 128, 1, frames * 0, ((frames * 3) & 0x1FF), 32, 128)); diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c index 3015e90151..39126bcde9 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c @@ -19,7 +19,7 @@ void BgSpot08Bakudankabe_Draw(Actor* thisx, PlayState* play); void func_808B02D0(BgSpot08Bakudankabe* this, PlayState* play); void func_808B0324(BgSpot08Bakudankabe* this, PlayState* play); -ActorInit Bg_Spot08_Bakudankabe_InitVars = { +ActorProfile Bg_Spot08_Bakudankabe_Profile = { /**/ ACTOR_BG_SPOT08_BAKUDANKABE, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -34,7 +34,7 @@ ActorInit Bg_Spot08_Bakudankabe_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -45,7 +45,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -56,7 +56,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -69,7 +69,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -162,7 +162,7 @@ void BgSpot08Bakudankabe_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); - if (Flags_GetSwitch(play, (this->dyna.actor.params & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -184,7 +184,7 @@ void BgSpot08Bakudankabe_Update(Actor* thisx, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { func_808B0324(this, play); - Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c index ab98d0d207..6d209a6251 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c @@ -22,7 +22,7 @@ void BgSpot08Iceblock_SetupFloatOrbitingTwins(BgSpot08Iceblock* this); void BgSpot08Iceblock_FloatOrbitingTwins(BgSpot08Iceblock* this, PlayState* play); void BgSpot08Iceblock_SetupNoAction(BgSpot08Iceblock* this); -ActorInit Bg_Spot08_Iceblock_InitVars = { +ActorProfile Bg_Spot08_Iceblock_Profile = { /**/ ACTOR_BG_SPOT08_ICEBLOCK, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -59,7 +59,7 @@ void BgSpot08Iceblock_InitDynaPoly(BgSpot08Iceblock* this, PlayState* play, Coll // Sets params to 0x10 (medium, nonrotating) if not in the cases listed. void BgSpot08Iceblock_CheckParams(BgSpot08Iceblock* this) { - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case 0xFF: this->dyna.actor.params = 0x10; break; @@ -90,7 +90,7 @@ void BgSpot08Iceblock_SinkUnderPlayer(BgSpot08Iceblock* this) { f32 target; f32 step; - switch (this->dyna.actor.params & 0xF0) { + switch (PARAMS_GET_NOSHIFT(this->dyna.actor.params, 4, 4)) { case 0: step = 0.15f; break; @@ -177,7 +177,7 @@ void BgSpot08Iceblock_Roll(BgSpot08Iceblock* this, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case 0x11: // Medium nonrotating rollDataIndex = 0; break; @@ -262,7 +262,7 @@ void BgSpot08Iceblock_SpawnTwinFloe(BgSpot08Iceblock* this, PlayState* play) { sin = Math_SinS(this->dyna.actor.home.rot.y) * 100.0f; cos = Math_CosS(this->dyna.actor.home.rot.y) * 100.0f; - if (!(this->dyna.actor.params & 0x100)) { + if (!PARAMS_GET_NOSHIFT(this->dyna.actor.params, 8, 1)) { Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_BG_SPOT08_ICEBLOCK, this->dyna.actor.home.pos.x, this->dyna.actor.home.pos.y, this->dyna.actor.home.pos.z, this->dyna.actor.home.rot.x, this->dyna.actor.home.rot.y, this->dyna.actor.home.rot.z, @@ -291,7 +291,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { PRINTF("(spot08 流氷)(arg_data 0x%04x)\n", this->dyna.actor.params); BgSpot08Iceblock_CheckParams(this); - switch (this->dyna.actor.params & 0x200) { + switch (PARAMS_GET_NOSHIFT(this->dyna.actor.params, 9, 1)) { case 0: colHeader = &gZorasFountainIcebergCol; break; @@ -300,7 +300,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { break; } - switch (this->dyna.actor.params & 0xF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 4)) { case 2: case 3: BgSpot08Iceblock_InitDynaPoly(this, play, colHeader, DYNA_TRANSFORM_POS | DYNA_TRANSFORM_ROT_Y); @@ -317,7 +317,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - switch (this->dyna.actor.params & 0xF0) { + switch (PARAMS_GET_NOSHIFT(this->dyna.actor.params, 4, 4)) { case 0: Actor_SetScale(&this->dyna.actor, 0.2f); break; @@ -334,7 +334,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { this->surfaceNormal.y = 1.0f; this->rotationAxis.x = 1.0f; - switch (this->dyna.actor.params & 0xF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 4)) { case 0: case 1: BgSpot08Iceblock_SetupFloatNonrotating(this); @@ -395,7 +395,7 @@ void BgSpot08Iceblock_FloatOrbitingTwins(BgSpot08Iceblock* this, PlayState* play BgSpot08Iceblock_SetWaterline(this); // parent handles rotations of both - if (!(this->dyna.actor.params & 0x100)) { + if (!PARAMS_GET_NOSHIFT(this->dyna.actor.params, 8, 1)) { this->dyna.actor.world.rot.y += 0x190; sin = Math_SinS(this->dyna.actor.world.rot.y) * 100.0f; cos = Math_CosS(this->dyna.actor.world.rot.y) * 100.0f; @@ -436,7 +436,7 @@ void BgSpot08Iceblock_Draw(Actor* thisx, PlayState* play) { Gfx* dList; BgSpot08Iceblock* this = (BgSpot08Iceblock*)thisx; - switch (this->dyna.actor.params & 0x200) { + switch (PARAMS_GET_NOSHIFT(this->dyna.actor.params, 9, 1)) { case 0: dList = gZorasFountainIcebergDL; break; diff --git a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c index 6df0a26576..2cce032344 100644 --- a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c @@ -18,7 +18,7 @@ s32 func_808B1AE0(BgSpot09Obj* this, PlayState* play); s32 func_808B1BA0(BgSpot09Obj* this, PlayState* play); s32 func_808B1BEC(BgSpot09Obj* this, PlayState* play); -ActorInit Bg_Spot09_Obj_InitVars = { +ActorProfile Bg_Spot09_Obj_Profile = { /**/ ACTOR_BG_SPOT09_OBJ, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -173,8 +173,7 @@ void BgSpot09Obj_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot09_obj.c", 391), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_spot09_obj.c", 391); gSPDisplayList(POLY_XLU_DISP++, gCarpentersTentEntranceDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_spot09_obj.c", 396); diff --git a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c index 68f723fcec..43dd1e73b9 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c @@ -16,7 +16,7 @@ void BgSpot11Bakudankabe_Destroy(Actor* thisx, PlayState* play); void BgSpot11Bakudankabe_Update(Actor* thisx, PlayState* play); void BgSpot11Bakudankabe_Draw(Actor* thisx, PlayState* play); -ActorInit Bg_Spot11_Bakudankabe_InitVars = { +ActorProfile Bg_Spot11_Bakudankabe_Profile = { /**/ ACTOR_BG_SPOT11_BAKUDANKABE, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -30,7 +30,7 @@ ActorInit Bg_Spot11_Bakudankabe_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -38,7 +38,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -113,7 +113,7 @@ void BgSpot11Bakudankabe_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); - if (Flags_GetSwitch(play, (this->dyna.actor.params & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -136,7 +136,7 @@ void BgSpot11Bakudankabe_Update(Actor* thisx, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { func_808B2218(this, play); - Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); SfxSource_PlaySfxAtFixedWorldPos(play, &D_808B2738, 40, NA_SE_EV_WALL_BROKEN); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c index ff7c8e28ba..4218cc79fd 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c @@ -20,7 +20,7 @@ void func_808B29F0(BgSpot11Oasis* this, PlayState* play); void func_808B2AA8(BgSpot11Oasis* this); void func_808B2AB8(BgSpot11Oasis* this, PlayState* play); -ActorInit Bg_Spot11_Oasis_InitVars = { +ActorProfile Bg_Spot11_Oasis_Profile = { /**/ ACTOR_BG_SPOT11_OASIS, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -153,8 +153,7 @@ void BgSpot11Oasis_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_spot11_oasis.c", 327); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot11_oasis.c", 331), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_spot11_oasis.c", 331); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 127 - (gameplayFrames % 128), (gameplayFrames * 1) % 128, 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c index cd5f89b845..0666980533 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c @@ -24,7 +24,7 @@ void func_808B318C(BgSpot12Gate* this, PlayState* play); void func_808B3274(BgSpot12Gate* this); void func_808B3298(BgSpot12Gate* this, PlayState* play); -ActorInit Bg_Spot12_Gate_InitVars = { +ActorProfile Bg_Spot12_Gate_Profile = { /**/ ACTOR_BG_SPOT12_GATE, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -67,7 +67,7 @@ void BgSpot12Gate_Init(Actor* thisx, PlayState* play) { BgSpot12Gate_InitDynaPoly(this, play, &gGerudoFortressWastelandGateCol, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { func_808B3274(this); } else { func_808B30C0(this); @@ -86,7 +86,7 @@ void func_808B30C0(BgSpot12Gate* this) { } void func_808B30D8(BgSpot12Gate* this, PlayState* play) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { func_808B3134(this); OnePointCutscene_Init(play, 4160, -99, &this->dyna.actor, CAM_ID_MAIN); } @@ -125,7 +125,7 @@ void func_808B318C(BgSpot12Gate* this, PlayState* play) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index a242940b81..13b1deeea6 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -21,7 +21,7 @@ void func_808B3604(BgSpot12Saku* this, PlayState* play); void func_808B3714(BgSpot12Saku* this); void func_808B37AC(BgSpot12Saku* this, PlayState* play); -ActorInit Bg_Spot12_Saku_InitVars = { +ActorProfile Bg_Spot12_Saku_Profile = { /**/ ACTOR_BG_SPOT12_SAKU, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -63,7 +63,7 @@ void BgSpot12Saku_Init(Actor* thisx, PlayState* play) { func_808B3420(this, play, &gGerudoFortressGTGShutterCol, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { func_808B3714(this); } else { func_808B3550(this); @@ -84,7 +84,7 @@ void func_808B3550(BgSpot12Saku* this) { } void func_808B357C(BgSpot12Saku* this, PlayState* play) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { func_808B35E4(this); this->timer = 20; OnePointCutscene_Init(play, 4170, -99, &this->dyna.actor, CAM_ID_MAIN); @@ -109,7 +109,7 @@ void func_808B3604(BgSpot12Saku* this, PlayState* play) { func_808B3714(this); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index 77a31675d9..27572deef0 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -25,7 +25,7 @@ void func_808B44CC(BgSpot15Rrbox* this, PlayState* play); static s16 D_808B4590 = 0; -ActorInit Bg_Spot15_Rrbox_InitVars = { +ActorProfile Bg_Spot15_Rrbox_Profile = { /**/ ACTOR_BG_SPOT15_RRBOX, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -126,7 +126,7 @@ void BgSpot15Rrbox_Init(Actor* thisx, PlayState* play) { func_808B3960(this, play, &gLonLonMilkCrateCol, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); func_808B3A34(this); - if (Flags_GetSwitch(play, (this->dyna.actor.params & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { func_808B44B8(this, play); this->dyna.actor.world.pos = D_808B45C4[D_808B4590]; D_808B4590++; diff --git a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c index 3432321a91..ca52b057bb 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c @@ -18,7 +18,7 @@ void func_808B4930(BgSpot15Saku* this, PlayState* play); void func_808B4978(BgSpot15Saku* this, PlayState* play); void func_808B4A04(BgSpot15Saku* this, PlayState* play); -ActorInit Bg_Spot15_Saku_InitVars = { +ActorProfile Bg_Spot15_Saku_Profile = { /**/ ACTOR_BG_SPOT15_SAKU, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -98,8 +98,7 @@ void BgSpot15Saku_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot15_saku.c", 263), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_spot15_saku.c", 263); gSPDisplayList(POLY_XLU_DISP++, gLonLonCorralFenceDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_spot15_saku.c", 268); diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index 46fbcc207e..669f17ab47 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -36,7 +36,7 @@ static s16 D_808B5DD8[][10] = { static ColliderJntSphElementInit sJntSphElementsInit[] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFF6, 0x00, 0x00 }, ATELEM_NONE, @@ -49,7 +49,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -62,7 +62,7 @@ static ColliderJntSphInit sJntSphInit = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -70,7 +70,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -109,7 +109,7 @@ static s16 D_808B5EB0[][7] = { { 0x0014, 0x0050, 0x0032, 0x0000, 0x0096, 0x00C8, 0x0008 }, }; -ActorInit Bg_Spot16_Bombstone_InitVars = { +ActorProfile Bg_Spot16_Bombstone_Profile = { /**/ ACTOR_BG_SPOT16_BOMBSTONE, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -144,8 +144,8 @@ static f32 D_808B6074[] = { 66.0f, 51.0f, 48.0f, 36.0f, 21.0f }; static s16 D_808B6088[] = { 0, 1, 2, 3, 4 }; void func_808B4C30(BgSpot16Bombstone* this) { - this->switchFlag = (this->actor.params >> 8) & 0x3F; - this->actor.params &= 0xFF; + this->switchFlag = PARAMS_GET_U(this->actor.params, 8, 6); + this->actor.params = PARAMS_GET_U(this->actor.params, 0, 8); } void func_808B4C4C(BgSpot16Bombstone* this, PlayState* play) { @@ -416,7 +416,7 @@ void func_808B57E0(BgSpot16Bombstone* this, PlayState* play) { OnePointCutscene_Init(play, 4180, sTimer, NULL, CAM_ID_MAIN); } } - } else if (player->stateFlags1 & PLAYER_STATE1_11) { + } else if (player->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) { playerHeldActor = player->heldActor; if (playerHeldActor != NULL && playerHeldActor->category == ACTORCAT_EXPLOSIVE && playerHeldActor->id == ACTOR_EN_BOMBF) { @@ -543,8 +543,7 @@ void BgSpot16Bombstone_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot16_bombstone.c", 1257), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_spot16_bombstone.c", 1257); if (this->actor.params == 0xFF) { // The boulder is intact diff --git a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c index 8f60a33980..ece0d3d6d4 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c @@ -18,7 +18,7 @@ void BgSpot16Doughnut_Draw(Actor* thisx, PlayState* play); void BgSpot16Doughnut_UpdateExpanding(Actor* thisx, PlayState* play); void BgSpot16Doughnut_DrawExpanding(Actor* thisx, PlayState* play); -ActorInit Bg_Spot16_Doughnut_InitVars = { +ActorProfile Bg_Spot16_Doughnut_Profile = { /**/ ACTOR_BG_SPOT16_DOUGHNUT, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -125,10 +125,7 @@ void BgSpot16Doughnut_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); - if (1) {} - - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot16_doughnut.c", 213), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_spot16_doughnut.c", 213); if (this->fireFlag & 1) { gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, scroll * (-1), 0, 16, 32, 1, scroll, @@ -152,8 +149,7 @@ void BgSpot16Doughnut_DrawExpanding(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot16_doughnut.c", 248), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_spot16_doughnut.c", 248); gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->envColorAlpha); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255); gSPDisplayList(POLY_XLU_DISP++, gDeathMountainCloudCircleNormalDL); diff --git a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c index fe22885a6e..7d2166dd73 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c @@ -16,7 +16,7 @@ void BgSpot17Bakudankabe_Destroy(Actor* thisx, PlayState* play); void BgSpot17Bakudankabe_Update(Actor* thisx, PlayState* play); void BgSpot17Bakudankabe_Draw(Actor* thisx, PlayState* play); -ActorInit Bg_Spot17_Bakudankabe_InitVars = { +ActorProfile Bg_Spot17_Bakudankabe_Profile = { /**/ ACTOR_BG_SPOT17_BAKUDANKABE, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -96,7 +96,7 @@ void BgSpot17Bakudankabe_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); - if (Flags_GetSwitch(play, (this->dyna.actor.params & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -115,7 +115,7 @@ void BgSpot17Bakudankabe_Update(Actor* thisx, PlayState* play) { BgSpot17Bakudankabe* this = (BgSpot17Bakudankabe*)thisx; if (this->dyna.actor.xzDistToPlayer < 650.0f && func_80033684(play, &this->dyna.actor) != NULL) { func_808B6BC0(this, play); - Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); @@ -123,16 +123,15 @@ void BgSpot17Bakudankabe_Update(Actor* thisx, PlayState* play) { } void BgSpot17Bakudankabe_Draw(Actor* thisx, PlayState* play) { - s32 pad; - s8 r = coss(play->gameplayFrames * 1500) >> 8; - s8 g = coss(play->gameplayFrames * 1500) >> 8; + PlayState* play2 = (PlayState*)play; + s8 r = coss(play2->gameplayFrames * 1500) >> 8; + s8 g = coss(play2->gameplayFrames * 1500) >> 8; OPEN_DISPS(play->state.gfxCtx, "../z_bg_spot17_bakudankabe.c", 269); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot17_bakudankabe.c", 273), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_spot17_bakudankabe.c", 273); r = (r >> 1) + 0xC0; g = (g >> 1) + 0xC0; @@ -147,8 +146,7 @@ void BgSpot17Bakudankabe_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot17_bakudankabe.c", 290), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_spot17_bakudankabe.c", 290); gSPDisplayList(POLY_XLU_DISP++, gCraterBombableWallCracksDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_spot17_bakudankabe.c", 295); diff --git a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c index b8c93658cf..8fbdd14048 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c @@ -15,7 +15,7 @@ void BgSpot17Funen_Update(Actor* thisx, PlayState* play); void func_808B746C(Actor* thisx, PlayState* play); void func_808B7478(Actor* thisx, PlayState* play); -ActorInit Bg_Spot17_Funen_InitVars = { +ActorProfile Bg_Spot17_Funen_Profile = { /**/ ACTOR_BG_SPOT17_FUNEN, /**/ ACTORCAT_SWITCH, /**/ FLAGS, @@ -60,14 +60,11 @@ void func_808B7478(Actor* thisx, PlayState* play) { Matrix_RotateY((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) - thisx->shape.rot.y + 0x8000) * 9.58738019108e-05f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_spot17_funen.c", 161), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_spot17_funen.c", 161); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, (0 - play->gameplayFrames) & 0x7F, 0x20, 0x20, 1, 0, (0 - play->gameplayFrames) & 0x7F, 0x20, 0x20)); gSPDisplayList(POLY_XLU_DISP++, gCraterSmokeConeDL); - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_bg_spot17_funen.c", 176); } diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index 92d1f9671a..d41f0d86b9 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -22,7 +22,7 @@ void func_808B7D50(BgSpot18Basket* this, PlayState* play); void func_808B7FC0(BgSpot18Basket* this, PlayState* play); void func_808B81A0(BgSpot18Basket* this, PlayState* play); -ActorInit Bg_Spot18_Basket_InitVars = { +ActorProfile Bg_Spot18_Basket_Profile = { /**/ ACTOR_BG_SPOT18_BASKET, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -37,7 +37,7 @@ ActorInit Bg_Spot18_Basket_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[2] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -48,7 +48,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -61,7 +61,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[2] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -144,7 +144,7 @@ void BgSpot18Basket_Init(Actor* thisx, PlayState* play) { this->dyna.actor.home.pos.y += 0.01f; this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { func_808B7BB0(this); return; } @@ -174,7 +174,7 @@ void func_808B7AEC(BgSpot18Basket* this) { } void func_808B7AFC(BgSpot18Basket* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { OnePointCutscene_Init(play, 4220, 80, &this->dyna.actor, CAM_ID_MAIN); func_808B7B58(this); } @@ -230,7 +230,7 @@ void func_808B7BCC(BgSpot18Basket* this, PlayState* play) { } } } - func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); } void func_808B7D38(BgSpot18Basket* this) { @@ -382,15 +382,15 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) { } } } else if (this->unk_218 == 2) { - if ((this->unk_21A != 0) || Flags_GetCollectible(play, (actor->params & 0x3F))) { + if ((this->unk_21A != 0) || Flags_GetCollectible(play, PARAMS_GET_U(actor->params, 0, 6))) { collectible = Item_DropCollectible(play, &tempVector, ITEM00_RUPEE_PURPLE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; collectible->actor.world.rot.y = D_808B85E4[1]; } } else { - collectible = - Item_DropCollectible(play, &tempVector, ((actor->params & 0x3F) << 8) | ITEM00_HEART_PIECE); + collectible = Item_DropCollectible(play, &tempVector, + (PARAMS_GET_U(actor->params, 0, 6) << 8) | ITEM00_HEART_PIECE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; collectible->actor.world.rot.y = D_808B85E4[1]; diff --git a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c index 158856409d..c321d5c550 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c @@ -14,7 +14,7 @@ void BgSpot18Futa_Destroy(Actor* thisx, PlayState* play); void BgSpot18Futa_Update(Actor* thisx, PlayState* play); void BgSpot18Futa_Draw(Actor* thisx, PlayState* play); -ActorInit Bg_Spot18_Futa_InitVars = { +ActorProfile Bg_Spot18_Futa_Profile = { /**/ ACTOR_BG_SPOT18_FUTA, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index 4c284b9b15..4156815ddf 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -30,7 +30,7 @@ void func_808B8F08(BgSpot18Obj* this, PlayState* play); void func_808B9030(BgSpot18Obj* this); void func_808B9040(BgSpot18Obj* this, PlayState* play); -ActorInit Bg_Spot18_Obj_InitVars = { +ActorProfile Bg_Spot18_Obj_Profile = { /**/ ACTOR_BG_SPOT18_OBJ, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -101,13 +101,13 @@ s32 func_808B8910(BgSpot18Obj* this, PlayState* play) { return 0; } - switch (D_808B90F0[this->dyna.actor.params & 0xF][age]) { + switch (D_808B90F0[PARAMS_GET_U(this->dyna.actor.params, 0, 4)][age]) { case 0: case 1: - if (D_808B90F0[this->dyna.actor.params & 0xF][age] == 0) { + if (D_808B90F0[PARAMS_GET_U(this->dyna.actor.params, 0, 4)][age] == 0) { PRINTF("出現しない Object (0x%04x)\n", this->dyna.actor.params); } - return D_808B90F0[this->dyna.actor.params & 0xF][age]; + return D_808B90F0[PARAMS_GET_U(this->dyna.actor.params, 0, 4)][age]; case 2: PRINTF("Error : Obj出現判定が設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 202, this->dyna.actor.params); @@ -120,7 +120,7 @@ s32 func_808B8910(BgSpot18Obj* this, PlayState* play) { } s32 func_808B8A5C(BgSpot18Obj* this, PlayState* play) { - Actor_SetScale(&this->dyna.actor, D_808B90F4[this->dyna.actor.params & 0xF]); + Actor_SetScale(&this->dyna.actor, D_808B90F4[PARAMS_GET_U(this->dyna.actor.params, 0, 4)]); return 1; } @@ -129,13 +129,13 @@ s32 func_808B8A98(BgSpot18Obj* this, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(D_808B90FC[this->dyna.actor.params & 0xF], &colHeader); + CollisionHeader_GetVirtual(D_808B90FC[PARAMS_GET_U(this->dyna.actor.params, 0, 4)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); return 1; } s32 func_808B8B08(BgSpot18Obj* this, PlayState* play) { - this->dyna.actor.flags |= D_808B9104[this->dyna.actor.params & 0xF]; + this->dyna.actor.flags |= D_808B9104[PARAMS_GET_U(this->dyna.actor.params, 0, 4)]; return 1; } @@ -155,7 +155,7 @@ s32 func_808B8BB4(BgSpot18Obj* this, PlayState* play) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { func_808B9030(this); - } else if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + } else if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { func_808B9030(this); this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z; @@ -172,8 +172,8 @@ s32 func_808B8C90(BgSpot18Obj* this, PlayState* play) { } s32 func_808B8CC8(BgSpot18Obj* this, PlayState* play) { - if ((D_808B913C[this->dyna.actor.params & 0xF] != NULL) && - (!D_808B913C[this->dyna.actor.params & 0xF](this, play))) { + if ((D_808B913C[PARAMS_GET_U(this->dyna.actor.params, 0, 4)] != NULL) && + (!D_808B913C[PARAMS_GET_U(this->dyna.actor.params, 0, 4)](this, play))) { return 0; } return 1; @@ -255,11 +255,11 @@ void func_808B8F08(BgSpot18Obj* this, PlayState* play) { this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z; this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~PLAYER_STATE2_4; - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); } } @@ -281,5 +281,5 @@ void BgSpot18Obj_Update(Actor* thisx, PlayState* play) { } void BgSpot18Obj_Draw(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, sDlists[thisx->params & 0xF]); + Gfx_DrawDListOpa(play, sDlists[PARAMS_GET_U(thisx->params, 0, 4)]); } diff --git a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c index c4ce8ce190..789921509e 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c @@ -20,7 +20,7 @@ void func_808B9618(BgSpot18Shutter* this, PlayState* play); void func_808B9698(BgSpot18Shutter* this, PlayState* play); void func_808B971C(BgSpot18Shutter* this, PlayState* play); -ActorInit Bg_Spot18_Shutter_InitVars = { +ActorProfile Bg_Spot18_Shutter_Profile = { /**/ ACTOR_BG_SPOT18_SHUTTER, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -39,7 +39,7 @@ static InitChainEntry sInitChain[] = { void BgSpot18Shutter_Init(Actor* thisx, PlayState* play) { s32 pad; BgSpot18Shutter* this = (BgSpot18Shutter*)thisx; - s32 param = (this->dyna.actor.params >> 8) & 1; + s32 param = PARAMS_GET_U(this->dyna.actor.params, 8, 1); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); @@ -54,7 +54,7 @@ void BgSpot18Shutter_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_808B9618; } } else { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { this->actionFunc = func_808B95AC; this->dyna.actor.world.pos.y += 180.0f; } else { @@ -85,7 +85,7 @@ void func_808B95AC(BgSpot18Shutter* this, PlayState* play) { } void func_808B95B8(BgSpot18Shutter* this, PlayState* play) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { Actor_SetFocus(&this->dyna.actor, 70.0f); OnePointCutscene_Attention(play, &this->dyna.actor); this->actionFunc = func_808B9698; @@ -95,7 +95,7 @@ void func_808B95B8(BgSpot18Shutter* this, PlayState* play) { void func_808B9618(BgSpot18Shutter* this, PlayState* play) { if (GET_INFTABLE(INFTABLE_109)) { Actor_SetFocus(&this->dyna.actor, 70.0f); - if (((this->dyna.actor.params >> 8) & 1) == 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 8, 1) == 0) { this->actionFunc = func_808B9698; } else { this->actionFunc = func_808B971C; @@ -109,7 +109,7 @@ void func_808B9698(BgSpot18Shutter* this, PlayState* play) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); this->actionFunc = func_808B95AC; } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_STONE_STATUE_OPEN - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_STONE_STATUE_OPEN - SFX_FLAG); } } @@ -125,7 +125,7 @@ void func_808B971C(BgSpot18Shutter* this, PlayState* play) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); this->actionFunc = func_808B95AC; } else { - func_8002F974(&this->dyna.actor, NA_SE_EV_STONE_STATUE_OPEN - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_STONE_STATUE_OPEN - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c index c9c30b37a6..d328a2379b 100644 --- a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c +++ b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c @@ -16,7 +16,7 @@ void BgSstFloor_Draw(Actor* thisx, PlayState* play); static s32 sUnkValues[] = { 0, 0, 0 }; // Unused, probably a zero vector -ActorInit Bg_Sst_Floor_InitVars = { +ActorProfile Bg_Sst_Floor_Profile = { /**/ ACTOR_BG_SST_FLOOR, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -128,8 +128,7 @@ void BgSstFloor_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Matrix_Scale(1.0f, this->drumHeight * -0.0025f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_sst_floor.c", 283), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_sst_floor.c", 283); gSPDisplayList(POLY_OPA_DISP++, gBongoDrumDL); diff --git a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h index 04c9dcab66..9149f9214b 100644 --- a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h +++ b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h @@ -13,7 +13,7 @@ typedef struct BgSstFloor { /* 0x0168 */ s16 drumHeight; } BgSstFloor; // size = 0x016C -typedef enum { +typedef enum BgSstFloorParams { /* 0 */ BONGOFLOOR_REST, /* 1 */ BONGOFLOOR_HIT } BgSstFloorParams; diff --git a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c index eafa885cb2..f24ed0c28a 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c +++ b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c @@ -15,13 +15,13 @@ void BgTokiHikari_Update(Actor* thisx, PlayState* play); void BgTokiHikari_Draw(Actor* thisx, PlayState* play); void BgTokiHikari_DoNothing(BgTokiHikari* this, PlayState* play); -void func_808BA018(BgTokiHikari* this, PlayState* play); +void func_808BA018(Actor* thisx, PlayState* play); void func_808BA204(BgTokiHikari* this, PlayState* play); void func_808BA22C(BgTokiHikari* this, PlayState* play); void func_808BA274(BgTokiHikari* this, PlayState* play); -void func_808BA2CC(BgTokiHikari* this, PlayState* play); +void func_808BA2CC(Actor* thisx, PlayState* play); -ActorInit Bg_Toki_Hikari_InitVars = { +ActorProfile Bg_Toki_Hikari_Profile = { /**/ ACTOR_BG_TOKI_HIKARI, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -69,37 +69,33 @@ void BgTokiHikari_Update(Actor* thisx, PlayState* play) { } void BgTokiHikari_Draw(Actor* thisx, PlayState* play) { - BgTokiHikari* this = (BgTokiHikari*)thisx; - - switch (this->actor.params) { + switch (thisx->params) { case 0: - func_808BA018(this, play); + func_808BA018(thisx, play); break; case 1: - func_808BA2CC(this, play); + func_808BA2CC(thisx, play); break; } } -void func_808BA018(BgTokiHikari* this, PlayState* play) { - s32 pad; +void func_808BA018(Actor* thisx, PlayState* play) { + PlayState* play2 = (PlayState*)play; OPEN_DISPS(play->state.gfxCtx, "../z_bg_toki_hikari.c", 246); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_toki_hikari.c", 252), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_toki_hikari.c", 252); if (LINK_IS_ADULT) { gSPDisplayList(POLY_OPA_DISP++, object_toki_objects_DL_008190); } else { gSPDisplayList(POLY_OPA_DISP++, object_toki_objects_DL_007E20); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPSegment(POLY_XLU_DISP++, 8, Gfx_TexScroll(play->state.gfxCtx, 0, play->gameplayFrames % 128, 64, 32)); + gSPSegment(POLY_XLU_DISP++, 8, Gfx_TexScroll(play->state.gfxCtx, 0, play2->gameplayFrames % 128, 64, 32)); - gSPSegment(POLY_XLU_DISP++, 9, Gfx_TexScroll(play->state.gfxCtx, 0, play->gameplayFrames % 128, 64, 32)); + gSPSegment(POLY_XLU_DISP++, 9, Gfx_TexScroll(play->state.gfxCtx, 0, play2->gameplayFrames % 128, 64, 32)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_toki_hikari.c", 278), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_toki_hikari.c", 278); gSPDisplayList(POLY_XLU_DISP++, object_toki_objects_DL_007EE0); } @@ -107,7 +103,7 @@ void func_808BA018(BgTokiHikari* this, PlayState* play) { } void func_808BA204(BgTokiHikari* this, PlayState* play) { - if (play->roomCtx.unk_74[1] != 0) { + if (play->roomCtx.drawParams[1] != 0) { this->actionFunc = func_808BA22C; } } @@ -130,8 +126,9 @@ void func_808BA274(BgTokiHikari* this, PlayState* play) { } } -void func_808BA2CC(BgTokiHikari* this, PlayState* play) { - s32 pad[2]; +void func_808BA2CC(Actor* thisx, PlayState* play) { + BgTokiHikari* this = (BgTokiHikari*)thisx; + s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_bg_toki_hikari.c", 350); Matrix_Translate(0.0f, 276.0f, 1122.0f, MTXMODE_NEW); @@ -145,8 +142,7 @@ void func_808BA2CC(BgTokiHikari* this, PlayState* play) { gDPSetEnvColor(POLY_XLU_DISP++, (u8)(this->unk_14C * 155.0f) + 100, (u8)(255.0f * this->unk_14C), 0, 128); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_toki_hikari.c", 382), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_toki_hikari.c", 382); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, -2 * (play->gameplayFrames & 0x7F), 0, 0x20, 0x40, @@ -161,8 +157,7 @@ void func_808BA2CC(BgTokiHikari* this, PlayState* play) { gDPSetEnvColor(POLY_XLU_DISP++, (u8)(this->unk_14C * 255.0f), (u8)(this->unk_14C * 255.0f), (u8)(this->unk_14C * 255.0f), (u8)(200.0f * this->unk_14C)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_toki_hikari.c", 415), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_toki_hikari.c", 415); gSPDisplayList(POLY_XLU_DISP++, object_toki_objects_DL_0009C0); Matrix_Pop(); @@ -173,8 +168,7 @@ void func_808BA2CC(BgTokiHikari* this, PlayState* play) { gDPSetEnvColor(POLY_XLU_DISP++, (u8)(this->unk_14C * 255.0f), (u8)(this->unk_14C * 255.0f), (u8)(this->unk_14C * 255.0f), (u8)(200.0f * this->unk_14C)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_toki_hikari.c", 437), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_toki_hikari.c", 437); gSPDisplayList(POLY_XLU_DISP++, &object_toki_objects_DL_0009C0[10]); Matrix_Pop(); diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 3f8968a84c..e25280ed0b 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -22,7 +22,7 @@ extern CutsceneData D_808BB2F0[]; extern CutsceneData D_808BB7A0[]; extern CutsceneData D_808BBD90[]; -ActorInit Bg_Toki_Swd_InitVars = { +ActorProfile Bg_Toki_Swd_Profile = { /**/ ACTOR_BG_TOKI_SWD, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -36,7 +36,7 @@ ActorInit Bg_Toki_Swd_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -44,7 +44,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -77,7 +77,7 @@ void BgTokiSwd_Init(Actor* thisx, PlayState* play) { } if (gSaveContext.sceneLayer == 5) { - play->roomCtx.unk_74[0] = 0xFF; + play->roomCtx.drawParams[0] = 0xFF; } Collider_InitCylinder(play, &this->collider); @@ -119,10 +119,10 @@ void func_808BAF40(BgTokiSwd* this, PlayState* play) { } } if (gSaveContext.sceneLayer == 5) { - if (play->roomCtx.unk_74[0] > 0) { - play->roomCtx.unk_74[0]--; + if (play->roomCtx.drawParams[0] > 0) { + play->roomCtx.drawParams[0]--; } else { - play->roomCtx.unk_74[0] = 0; + play->roomCtx.drawParams[0] = 0; } } } @@ -146,8 +146,8 @@ void func_808BB0AC(BgTokiSwd* this, PlayState* play) { } void func_808BB128(BgTokiSwd* this, PlayState* play) { - if (CutsceneFlags_Get(play, 1) && (play->roomCtx.unk_74[0] < 0xFF)) { - play->roomCtx.unk_74[0] += 5; + if (CutsceneFlags_Get(play, 1) && (play->roomCtx.drawParams[0] < 0xFF)) { + play->roomCtx.drawParams[0] += 5; } } @@ -170,8 +170,7 @@ void BgTokiSwd_Draw(Actor* thisx, PlayState* play2) { func_8002EBCC(&this->actor, play, 0); gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_TexScroll(play->state.gfxCtx, 0, -(play->gameplayFrames % 0x80), 32, 32)); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_toki_swd.c", 742), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_toki_swd.c", 742); gSPDisplayList(POLY_OPA_DISP++, object_toki_objects_DL_001BD0); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_toki_swd.c", 776); diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index cdbbba7ef2..ef0e25f404 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -5,6 +5,7 @@ */ #include "z_bg_treemouth.h" +#include "versions.h" #include "assets/objects/object_spot04_objects/object_spot04_objects.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" @@ -29,7 +30,7 @@ extern CutsceneData D_808BD2A0[]; extern CutsceneData D_808BD520[]; extern CutsceneData D_808BD790[]; -ActorInit Bg_Treemouth_InitVars = { +ActorProfile Bg_Treemouth_Profile = { /**/ ACTOR_BG_TREEMOUTH, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -42,7 +43,7 @@ ActorInit Bg_Treemouth_InitVars = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_5, ICHAIN_CONTINUE), ICHAIN_VEC3F(scale, 1, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 8000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 300, ICHAIN_CONTINUE), @@ -142,9 +143,9 @@ void func_808BC8B8(BgTreemouth* this, PlayState* play) { if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(EVENTCHKINF_0C)) { if (Actor_IsFacingAndNearPlayer(&this->dyna.actor, 1658.0f, 0x7530)) { - this->dyna.actor.flags |= ACTOR_FLAG_0; - if (this->dyna.actor.isTargeted) { - this->dyna.actor.flags &= ~ACTOR_FLAG_0; + this->dyna.actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; + if (this->dyna.actor.isLockedOn) { + this->dyna.actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; play->csCtx.script = D_808BD2A0; gSaveContext.cutsceneTrigger = 1; BgTreemouth_SetupAction(this, func_808BC9EC); @@ -235,7 +236,12 @@ void BgTreemouth_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - if (!IS_CUTSCENE_LAYER || LINK_IS_ADULT) { +#if OOT_VERSION < PAL_1_0 + if (!IS_CUTSCENE_LAYER) +#else + if (!IS_CUTSCENE_LAYER || LINK_IS_ADULT) +#endif + { if (GET_EVENTCHKINF(EVENTCHKINF_07)) { alpha = 2150; } @@ -243,12 +249,11 @@ void BgTreemouth_Draw(Actor* thisx, PlayState* play) { } if (gSaveContext.sceneLayer == 6) { - alpha = (play->roomCtx.unk_74[0] + 0x1F4); + alpha = (play->roomCtx.drawParams[0] + 0x1F4); } gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, alpha * 0.1f); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_treemouth.c", 932), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_treemouth.c", 932); gSPDisplayList(POLY_OPA_DISP++, gDekuTreeMouthDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_treemouth.c", 937); diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c index 4df2aa2184..822a9ddd59 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c @@ -14,7 +14,7 @@ void BgUmaJump_Destroy(Actor* thisx, PlayState* play); void BgUmaJump_Update(Actor* thisx, PlayState* play); void BgUmaJump_Draw(Actor* thisx, PlayState* play); -ActorInit Bg_Umajump_InitVars = { +ActorProfile Bg_Umajump_Profile = { /**/ ACTOR_BG_UMAJUMP, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c index 6381343658..87e6c54ed4 100644 --- a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c +++ b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c @@ -15,7 +15,7 @@ void BgVbSima_Destroy(Actor* thisx, PlayState* play); void BgVbSima_Update(Actor* thisx, PlayState* play); void BgVbSima_Draw(Actor* thisx, PlayState* play); -ActorInit Bg_Vb_Sima_InitVars = { +ActorProfile Bg_Vb_Sima_Profile = { /**/ ACTOR_BG_VB_SIMA, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -151,8 +151,7 @@ void BgVbSima_Update(Actor* thisx, PlayState* play) { void BgVbSima_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_vb_sima.c", 285); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_vb_sima.c", 291), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_vb_sima.c", 291); gSPDisplayList(POLY_OPA_DISP++, gVolvagiaPlatformDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_vb_sima.c", 296); } diff --git a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h index 42fdf5cfb5..c279ae393c 100644 --- a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h +++ b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h @@ -6,7 +6,7 @@ struct BgVbSima; -typedef enum { +typedef enum BgVbSimaSignal { /* 0 */ VBSIMA_STAND, /* 1 */ VBSIMA_COLLAPSE, /* 2 */ VBSIMA_KILL diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c index 0b32afe5ee..020b056bb4 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c @@ -21,7 +21,7 @@ void BgYdanHasi_MoveWater(BgYdanHasi* this, PlayState* play); void BgYdanHasi_DecWaterTimer(BgYdanHasi* this, PlayState* play); void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, PlayState* play); -ActorInit Bg_Ydan_Hasi_InitVars = { +ActorProfile Bg_Ydan_Hasi_Profile = { /**/ ACTOR_BG_YDAN_HASI, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -44,8 +44,8 @@ void BgYdanHasi_Init(Actor* thisx, PlayState* play) { WaterBox* waterBox; Actor_ProcessInitChain(thisx, sInitChain); - this->type = ((thisx->params >> 8) & 0x3F); - thisx->params &= 0xFF; + this->type = PARAMS_GET_U(thisx->params, 8, 6); + thisx->params = PARAMS_GET_U(thisx->params, 0, 8); waterBox = &play->colCtx.colHeader->waterBoxes[1]; DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); if (thisx->params == HASI_WATER) { @@ -113,12 +113,12 @@ void BgYdanHasi_MoveWater(BgYdanHasi* this, PlayState* play) { Flags_UnsetSwitch(play, this->type); this->actionFunc = BgYdanHasi_InitWater; } - func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } else { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 47.0f, 0.5f)) { this->actionFunc = BgYdanHasi_DecWaterTimer; } - func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } waterBox = &play->colCtx.colHeader->waterBoxes[1]; waterBox->ySurface = this->dyna.actor.world.pos.y; @@ -128,7 +128,7 @@ void BgYdanHasi_DecWaterTimer(BgYdanHasi* this, PlayState* play) { if (this->timer != 0) { this->timer--; } - func_8002F994(&this->dyna.actor, this->timer); + Actor_PlaySfx_FlaggedTimer(&this->dyna.actor, this->timer); if (this->timer == 0) { this->actionFunc = BgYdanHasi_MoveWater; } @@ -153,13 +153,13 @@ void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, PlayState* play) { this->dyna.actor.draw = NULL; this->actionFunc = BgYdanHasi_SetupThreeBlocks; } else { - func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); } } else if (!Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 120.0f, 3.0f)) { - func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); } else { - func_8002F994(&this->dyna.actor, this->timer); + Actor_PlaySfx_FlaggedTimer(&this->dyna.actor, this->timer); } } @@ -183,8 +183,7 @@ void BgYdanHasi_Draw(Actor* thisx, PlayState* play) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, -play->gameplayFrames % 128, play->gameplayFrames % 128, 0x20, 0x20, 1, play->gameplayFrames % 128, play->gameplayFrames % 128, 0x20, 0x20)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_ydan_hasi.c", 592), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_ydan_hasi.c", 592); gSPDisplayList(POLY_XLU_DISP++, gDTWaterPlaneDL); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_ydan_hasi.c", 597); diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h index 63105ab48c..616cd4250a 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h +++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h @@ -15,7 +15,7 @@ typedef struct BgYdanHasi { /* 0x016A */ s16 timer; //Also used as an offset for the water blocks Y position for a "bobbing" effect } BgYdanHasi; // size = 0x016C -typedef enum { +typedef enum HasiType { /* 0 */ HASI_WATER_BLOCK, /* 1 */ HASI_WATER, /* 2 */ HASI_THREE_BLOCKS diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c index 9d141c2975..2b799465ce 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c @@ -20,7 +20,7 @@ void func_808BF078(BgYdanMaruta* this, PlayState* play); void func_808BF108(BgYdanMaruta* this, PlayState* play); void func_808BF1EC(BgYdanMaruta* this, PlayState* play); -ActorInit Bg_Ydan_Maruta_InitVars = { +ActorProfile Bg_Ydan_Maruta_Profile = { /**/ ACTOR_BG_YDAN_MARUTA, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -35,7 +35,7 @@ ActorInit Bg_Ydan_Maruta_InitVars = { static ColliderTrisElementInit sTrisElementsInit[2] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x00, 0x04 }, { 0x00000004, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_WOOD, @@ -46,7 +46,7 @@ static ColliderTrisElementInit sTrisElementsInit[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x00, 0x04 }, { 0x00000004, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_WOOD, @@ -59,7 +59,7 @@ static ColliderTrisElementInit sTrisElementsInit[2] = { static ColliderTrisInit sTrisInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -88,8 +88,8 @@ void BgYdanMaruta_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->elements); - this->switchFlag = this->dyna.actor.params & 0xFFFF; - thisx->params = (thisx->params >> 8) & 0xFF; // thisx is required to match here + this->switchFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 16); + thisx->params = PARAMS_GET_U(thisx->params, 8, 8); // thisx is required to match here if (this->dyna.actor.params == 0) { triInit = &sTrisElementsInit[0]; @@ -137,11 +137,11 @@ void BgYdanMaruta_Destroy(Actor* thisx, PlayState* play) { void func_808BEFF4(BgYdanMaruta* this, PlayState* play) { if (this->collider.base.atFlags & AT_HIT) { - func_8002F71C(play, &this->dyna.actor, 7.0f, this->dyna.actor.shape.rot.y, 6.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->dyna.actor, 7.0f, this->dyna.actor.shape.rot.y, 6.0f); } this->dyna.actor.shape.rot.x += 0x360; CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); - func_8002F974(&this->dyna.actor, NA_SE_EV_TOGE_STICK_ROLLING - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_TOGE_STICK_ROLLING - SFX_FLAG); } void func_808BF078(BgYdanMaruta* this, PlayState* play) { @@ -178,7 +178,7 @@ void func_808BF108(BgYdanMaruta* this, PlayState* play) { this->dyna.actor.world.pos.x = (Math_CosS(this->dyna.actor.shape.rot.y) * temp) + this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.z = (Math_SinS(this->dyna.actor.shape.rot.y) * temp) + this->dyna.actor.home.pos.z; - func_8002F974(&this->dyna.actor, NA_SE_EV_TRAP_OBJ_SLIDE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_TRAP_OBJ_SLIDE - SFX_FLAG); } void func_808BF1EC(BgYdanMaruta* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c index 1a5d2e3664..6e5a1010fb 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c @@ -19,12 +19,12 @@ void BgYdanSp_FloorWebIdle(BgYdanSp* this, PlayState* play); void BgYdanSp_BurnWallWeb(BgYdanSp* this, PlayState* play); void BgYdanSp_WallWebIdle(BgYdanSp* this, PlayState* play); -typedef enum { +typedef enum BgYdanSpType { /* 0 */ WEB_FLOOR, /* 1 */ WEB_WALL } BgYdanSpType; -ActorInit Bg_Ydan_Sp_InitVars = { +ActorProfile Bg_Ydan_Sp_Profile = { /**/ ACTOR_BG_YDAN_SP, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -39,7 +39,7 @@ ActorInit Bg_Ydan_Sp_InitVars = { static ColliderTrisElementInit sTrisItemsInit[2] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x00 }, { 0x00020800, 0x00, 0x00 }, ATELEM_NONE, @@ -50,7 +50,7 @@ static ColliderTrisElementInit sTrisItemsInit[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x00 }, { 0x00020800, 0x00, 0x00 }, ATELEM_NONE, @@ -63,7 +63,7 @@ static ColliderTrisElementInit sTrisItemsInit[2] = { static ColliderTrisInit sTrisInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -91,9 +91,9 @@ void BgYdanSp_Init(Actor* thisx, PlayState* play) { f32 nSinsX; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->isDestroyedSwitchFlag = thisx->params & 0x3F; - this->burnSwitchFlag = (thisx->params >> 6) & 0x3F; - this->dyna.actor.params = (thisx->params >> 0xC) & 0xF; + this->isDestroyedSwitchFlag = PARAMS_GET_U(thisx->params, 0, 6); + this->burnSwitchFlag = PARAMS_GET_U(thisx->params, 6, 6); + this->dyna.actor.params = PARAMS_GET_U(thisx->params, 12, 4); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); Collider_InitTris(play, &this->trisCollider); Collider_SetTris(play, &this->trisCollider, &this->dyna.actor, &sTrisInit, this->trisColliderItems); @@ -395,7 +395,7 @@ void BgYdanSp_WallWebIdle(BgYdanSp* this, PlayState* play) { this->dyna.actor.home.pos.y = this->dyna.actor.world.pos.y + 80.0f; BgYdanSp_BurnWeb(this, play); } else if (player->heldItemAction == PLAYER_IA_DEKU_STICK && player->unk_860 != 0) { - func_8002DBD0(&this->dyna.actor, &sp30, &player->meleeWeaponInfo[0].tip); + Actor_WorldToActorCoords(&this->dyna.actor, &sp30, &player->meleeWeaponInfo[0].tip); if (fabsf(sp30.x) < 100.0f && sp30.z < 1.0f && sp30.y < 200.0f) { OnePointCutscene_Init(play, 3020, 40, &this->dyna.actor, CAM_ID_MAIN); Math_Vec3f_Copy(&this->dyna.actor.home.pos, &player->meleeWeaponInfo[0].tip); @@ -418,20 +418,16 @@ void BgYdanSp_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_ydan_sp.c", 781); - if (1) {} - Gfx_SetupDL_25Xlu(play->state.gfxCtx); if (thisx->params == WEB_WALL) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_ydan_sp.c", 787), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_ydan_sp.c", 787); gSPDisplayList(POLY_XLU_DISP++, gDTWebWallDL); } else if (this->actionFunc == BgYdanSp_FloorWebBroken) { Matrix_Get(&mtxF); if (this->timer == 40) { Matrix_Translate(0.0f, (thisx->home.pos.y - thisx->world.pos.y) * 10.0f, 0.0f, MTXMODE_APPLY); Matrix_Scale(1.0f, ((thisx->home.pos.y - thisx->world.pos.y) + 10.0f) * 0.1f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_ydan_sp.c", 808), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_ydan_sp.c", 808); gSPDisplayList(POLY_XLU_DISP++, gDTWebFloorDL); } for (i = 0; i < 8; i++) { @@ -439,15 +435,13 @@ void BgYdanSp_Draw(Actor* thisx, PlayState* play) { Matrix_RotateZYX(-0x5A0, i * 0x2000, 0, MTXMODE_APPLY); Matrix_Translate(0.0f, 700.0f, -900.0f, MTXMODE_APPLY); Matrix_Scale(3.5f, 5.0f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_ydan_sp.c", 830), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_ydan_sp.c", 830); gSPDisplayList(POLY_XLU_DISP++, gDTUnknownWebDL); } } else { Matrix_Translate(0.0f, (thisx->home.pos.y - thisx->world.pos.y) * 10.0f, 0.0f, MTXMODE_APPLY); Matrix_Scale(1.0f, ((thisx->home.pos.y - thisx->world.pos.y) + 10.0f) * 0.1f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_ydan_sp.c", 849), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_bg_ydan_sp.c", 849); gSPDisplayList(POLY_XLU_DISP++, gDTWebFloorDL); } diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index 18f026c33b..d5d3244348 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -35,7 +35,7 @@ static BgZgDrawFunc sDrawFuncs[] = { func_808C0EEC, }; -ActorInit Bg_Zg_InitVars = { +ActorProfile Bg_Zg_Profile = { /**/ ACTOR_BG_ZG, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -59,18 +59,28 @@ void func_808C0C50(BgZg* this) { } s32 func_808C0C98(BgZg* this, PlayState* play) { - s32 flag = (this->dyna.actor.params >> 8) & 0xFF; + s32 flag = PARAMS_GET_U(this->dyna.actor.params, 8, 8); return Flags_GetSwitch(play, flag); } s32 func_808C0CC8(BgZg* this) { - s32 flag = this->dyna.actor.params & 0xFF; + s32 flag = PARAMS_GET_U(this->dyna.actor.params, 0, 8); return flag; } void func_808C0CD4(BgZg* this, PlayState* play) { +#if PLATFORM_N64 + // Anti-piracy check, bars will not open if the check fails. + // The address 0x000002E8 is near the start of RDRAM, and is written when IPL3 copies itself to + // RDRAM after RDRAM has been initialized. Specifically, this is an instruction from some + // embedded RSP code at offset 0x7F8 into IPL3 (0xC86E2000 disassembles to `lqv $v14[0], ($3)`). + if (IO_READ(0x000002E8) != 0xC86E2000) { + return; + } +#endif + if (func_808C0C98(this, play) != 0) { this->action = 1; func_808C0C50(this); @@ -125,8 +135,7 @@ void func_808C0EEC(BgZg* this, PlayState* play) { OPEN_DISPS(localGfxCtx, "../z_bg_zg.c", 311); Gfx_SetupDL_25Opa(localGfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(localGfxCtx, "../z_bg_zg.c", 315), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, localGfxCtx, "../z_bg_zg.c", 315); gSPDisplayList(POLY_OPA_DISP++, gTowerCollapseBarsDL); CLOSE_DISPS(localGfxCtx, "../z_bg_zg.c", 320); diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index a502fb6f2e..53c58c143f 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -3,7 +3,7 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "assets/scenes/dungeons/ddan_boss/ddan_boss_room_1.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) void BossDodongo_Init(Actor* thisx, PlayState* play); void BossDodongo_Destroy(Actor* thisx, PlayState* play); @@ -33,7 +33,7 @@ f32 func_808C50A8(BossDodongo* this, PlayState* play); void BossDodongo_DrawEffects(PlayState* play); void BossDodongo_UpdateEffects(PlayState* play); -ActorInit Boss_Dodongo_InitVars = { +ActorProfile Boss_Dodongo_Profile = { /**/ ACTOR_EN_DODONGO, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -48,10 +48,10 @@ ActorInit Boss_Dodongo_InitVars = { #include "z_boss_dodongo_data.inc.c" static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_5, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, NAVI_ENEMY_KING_DODONGO, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3000.0f, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 8200.0f, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 8200.0f, ICHAIN_STOP), }; void func_808C1190(s16* arg0, u8* arg1, s16 arg2) { @@ -217,7 +217,7 @@ void BossDodongo_Init(Actor* thisx, PlayState* play) { } } - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } void BossDodongo_Destroy(Actor* thisx, PlayState* play) { @@ -476,7 +476,7 @@ void BossDodongo_SetupWalk(BossDodongo* this) { this->unk_1AA = 0; this->actionFunc = BossDodongo_Walk; this->unk_1DA = 0; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->unk_1E4 = 0.0f; } @@ -1085,8 +1085,7 @@ s32 BossDodongo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve Matrix_RotateX(-(this->unk_25C[limbIndex] * 0.115f), MTXMODE_APPLY); } - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_dodongo.c", 3822), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_boss_dodongo.c", 3822); gSPDisplayList(POLY_OPA_DISP++, *dList); Matrix_Pop(); @@ -1279,7 +1278,7 @@ void BossDodongo_SetupDeathCutscene(BossDodongo* this) { Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_K_DEAD); this->unk_1DA = 0; this->csState = 0; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); this->unk_1BC = 1; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1); } @@ -1693,8 +1692,7 @@ void BossDodongo_DrawEffects(PlayState* play) { Matrix_Translate(eff->unk_00.x, eff->unk_00.y, eff->unk_00.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(eff->unk_2C, eff->unk_2C, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_dodongo.c", 5253), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_dodongo.c", 5253); gSPDisplayList(POLY_XLU_DISP++, object_kingdodongo_DL_009DD0); } } diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h index 13ccf61d8f..dc5398598d 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h @@ -10,7 +10,7 @@ typedef void (*BossDodongoActionFunc)(struct BossDodongo*, PlayState*); #define BOSS_DODONGO_EFFECT_COUNT 80 -typedef struct { +typedef struct BossDodongoEffect { /* 0x00 */ Vec3f unk_00; /* 0x0C */ Vec3f unk_0C; /* 0x18 */ Vec3f unk_18; diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo_data.inc.c b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo_data.inc.c index 189b0b94fc..d4ac8f7f03 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo_data.inc.c +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo_data.inc.c @@ -13,7 +13,7 @@ static u8 D_808C7000[] = { static ColliderJntSphElementInit sJntSphElementsInit[19] = { { { - ELEMTYPE_UNK3, + ELEM_MATERIAL_UNK3, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -24,7 +24,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK3, + ELEM_MATERIAL_UNK3, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -35,7 +35,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -46,7 +46,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -57,7 +57,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -68,7 +68,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -79,7 +79,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -90,7 +90,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -101,7 +101,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -112,7 +112,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -123,7 +123,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -134,7 +134,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -145,7 +145,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -156,7 +156,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -167,7 +167,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -178,7 +178,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -189,7 +189,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -200,7 +200,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -211,7 +211,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -224,7 +224,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index cfd845a849..cd32d075c5 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -12,22 +12,22 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) -typedef enum { +typedef enum BossFdIntroFlyState { /* 0 */ INTRO_FLY_EMERGE, /* 1 */ INTRO_FLY_HOLE, /* 2 */ INTRO_FLY_CAMERA, /* 3 */ INTRO_FLY_RETRAT } BossFdIntroFlyState; -typedef enum { +typedef enum BossFdManeIndex { /* 0 */ MANE_CENTER, /* 1 */ MANE_RIGHT, /* 2 */ MANE_LEFT } BossFdManeIndex; -typedef enum { +typedef enum BossFdEyeState { /* 0 */ EYE_OPEN, /* 1 */ EYE_HALF, /* 2 */ EYE_CLOSED @@ -44,7 +44,7 @@ void BossFd_Wait(BossFd* this, PlayState* play); void BossFd_UpdateEffects(BossFd* this, PlayState* play); void BossFd_DrawBody(PlayState* play, BossFd* this); -ActorInit Boss_Fd_InitVars = { +ActorProfile Boss_Fd_Profile = { /**/ ACTOR_BOSS_FD, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -59,10 +59,10 @@ ActorInit Boss_Fd_InitVars = { #include "z_boss_fd_colchk.inc.c" static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_5, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, NAVI_ENEMY_VOLVAGIA, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 0, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 0, ICHAIN_STOP), }; void BossFd_SpawnEmber(BossFdEffect* effect, Vec3f* position, Vec3f* velocity, Vec3f* acceleration, f32 scale) { @@ -1277,9 +1277,9 @@ void BossFd_Effects(BossFd* this, PlayState* play) { } if ((this->actor.world.pos.y < 90.0f) || (700.0f < this->actor.world.pos.y) || (this->actionFunc == BossFd_Wait)) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } } @@ -1485,7 +1485,7 @@ void BossFd_UpdateEffects(BossFd* this, PlayState* play) { diff.z = player->actor.world.pos.z - effect->pos.z; if ((this->timers[3] == 0) && (sqrtf(SQ(diff.x) + SQ(diff.y) + SQ(diff.z)) < 20.0f)) { this->timers[3] = 50; - func_8002F6D4(play, NULL, 5.0f, effect->kbAngle, 0.0f, 0x30); + Actor_SetPlayerKnockbackLarge(play, NULL, 5.0f, effect->kbAngle, 0.0f, 0x30); if (!player->bodyIsBurning) { s16 i2; @@ -1546,8 +1546,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_fd.c", 4046), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_fd.c", 4046); gSPDisplayList(POLY_XLU_DISP++, gVolvagiaEmberModelDL); } } @@ -1567,8 +1566,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, PlayState* play) { Matrix_RotateX(effect->vFdFxRotX, MTXMODE_APPLY); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_fd.c", 4068), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_boss_fd.c", 4068); gSPDisplayList(POLY_OPA_DISP++, gVolvagiaDebrisModelDL); } } @@ -1589,8 +1587,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, PlayState* play) { Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_fd.c", 4104), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_fd.c", 4104); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTex[effect->timer2])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, effect->timer2); gSPDisplayList(POLY_XLU_DISP++, gVolvagiaDustModelDL); @@ -1613,8 +1610,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, PlayState* play) { Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_fd.c", 4154), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_fd.c", 4154); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTex[effect->timer2])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, effect->timer2); gSPDisplayList(POLY_XLU_DISP++, gVolvagiaDustModelDL); @@ -1636,8 +1632,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, PlayState* play) { Matrix_RotateX(effect->vFdFxRotX, MTXMODE_APPLY); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_fd.c", 4192), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_fd.c", 4192); gSPDisplayList(POLY_XLU_DISP++, gVolvagiaSkullPieceModelDL); } } @@ -1771,8 +1766,7 @@ void BossFd_DrawMane(PlayState* play, BossFd* this, Vec3f* manePos, Vec3f* maneR Matrix_Scale(maneScale[maneIndex] * (0.01f - (i * 0.0008f)), maneScale[maneIndex] * (0.01f - (i * 0.0008f)), 0.01f, MTXMODE_APPLY); Matrix_RotateX(-M_PI / 2.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_fd.c", 4480), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_fd.c", 4480); gSPDisplayList(POLY_XLU_DISP++, gVolvagiaManeModelDL); } @@ -1913,8 +1907,7 @@ void BossFd_DrawBody(PlayState* play, BossFd* this) { spD4 = spD8 = spD8 * sp84; } Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_fd.c", 4768), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_boss_fd.c", 4768); gSPDisplayList(POLY_OPA_DISP++, gVolvagiaRibsDL); if (this->bodyFallApart[i] == 1) { @@ -1962,7 +1955,7 @@ void BossFd_DrawBody(PlayState* play, BossFd* this) { SkelAnime_DrawOpa(play, this->skelAnimeHead.skeleton, this->skelAnimeHead.jointTable, BossFd_OverrideHeadDraw, BossFd_PostHeadDraw, &this->actor); PRINTF("SK\n"); - { + if (1) { Vec3f spB0 = { 0.0f, 1700.0f, 7000.0f }; Vec3f spA4 = { -1000.0f, 700.0f, 7000.0f }; diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h index d855c6c93b..dd1cbc8f0a 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h @@ -8,7 +8,7 @@ struct BossFd; typedef void (*BossFdActionFunc)(struct BossFd*, PlayState*); -typedef enum { +typedef enum BossFdActionState { /* -1 */ BOSSFD_WAIT_INTRO = -1, /* 0 */ BOSSFD_FLY_MAIN, /* 1 */ BOSSFD_FLY_HOLE, @@ -26,7 +26,7 @@ typedef enum { /* 205 */ BOSSFD_SKULL_BURN } BossFdActionState; -typedef enum { +typedef enum BossFdCutsceneState { /* 0 */ BFD_CS_NONE, /* 1 */ BFD_CS_WAIT, /* 2 */ BFD_CS_START, @@ -38,7 +38,7 @@ typedef enum { #define BOSSFD_EFFECT_COUNT 180 -typedef struct { +typedef struct BossFdEffect { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; @@ -58,7 +58,7 @@ typedef struct { #define vFdFxRotY bFdFxFloat2 #define vFdFxYStop bFdFxFloat2 -typedef enum { +typedef enum BossFdEffectType { /* 0 */ BFD_FX_NONE, /* 1 */ BFD_FX_EMBER, /* 2 */ BFD_FX_DEBRIS, @@ -67,13 +67,13 @@ typedef enum { /* 5 */ BFD_FX_SKULL_PIECE } BossFdEffectType; -typedef struct { +typedef struct BossFdMane { /* 0x000 */ Vec3f pos[30]; /* 0x168 */ f32 scale[30]; /* 0x1E0 */ Vec3f head; } BossFdMane; // size = 0x1EC -typedef enum { +typedef enum BossFdS16Var { /* 0 */ BFD_ACTION_STATE, /* 1 */ BFD_MOVE_TIMER, /* 2 */ BFD_VAR_TIMER, @@ -96,7 +96,7 @@ typedef enum { /* 19 */ BFD_SHORT_COUNT } BossFdS16Var; -typedef enum { +typedef enum BossFdF32Var { /* 0 */ BFD_TEX1_SCROLL_X, /* 1 */ BFD_TEX1_SCROLL_Y, /* 2 */ BFD_TEX2_SCROLL_X, diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd_colchk.inc.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd_colchk.inc.c index 2e437fdf83..83aa550fde 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd_colchk.inc.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd_colchk.inc.c @@ -3,7 +3,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { { { - ELEMTYPE_UNK3, + ELEM_MATERIAL_UNK3, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -14,7 +14,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -25,7 +25,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -36,7 +36,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -47,7 +47,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -58,7 +58,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -69,7 +69,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -80,7 +80,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -91,7 +91,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -102,7 +102,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -113,7 +113,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -124,7 +124,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -135,7 +135,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -146,7 +146,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -157,7 +157,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -168,7 +168,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -179,7 +179,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -190,7 +190,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -201,7 +201,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -214,7 +214,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[19] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c index 7a0895bdc1..f3f47695c6 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -10,9 +10,9 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) -typedef enum { +typedef enum BossFd2CutsceneState { /* 0 */ DEATH_START, /* 1 */ DEATH_RETREAT, /* 2 */ DEATH_HANDOFF, @@ -21,7 +21,7 @@ typedef enum { /* 5 */ DEATH_FINISH } BossFd2CutsceneState; -typedef enum { +typedef enum BossFd2EyeState { /* 0 */ EYE_OPEN, /* 1 */ EYE_HALF, /* 2 */ EYE_CLOSED @@ -46,7 +46,7 @@ void BossFd2_Damaged(BossFd2* this, PlayState* play); void BossFd2_Death(BossFd2* this, PlayState* play); void BossFd2_Wait(BossFd2* this, PlayState* play); -ActorInit Boss_Fd2_InitVars = { +ActorProfile Boss_Fd2_Profile = { /**/ ACTOR_BOSS_FD2, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -67,10 +67,10 @@ static Vec3f sHoleLocations[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_5, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, NAVI_ENEMY_VOLVAGIA, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 0, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 0, ICHAIN_STOP), }; void BossFd2_SpawnDebris(PlayState* play, BossFdEffect* effect, Vec3f* position, Vec3f* velocity, Vec3f* acceleration, @@ -295,7 +295,7 @@ void BossFd2_Emerge(BossFd2* this, PlayState* play) { case 2: Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x7D0); if ((this->timers[0] == 1) && (this->actor.xzDistToPlayer < 120.0f)) { - func_8002F6D4(play, &this->actor, 3.0f, this->actor.yawTowardsPlayer, 2.0f, 0x20); + Actor_SetPlayerKnockbackLarge(play, &this->actor, 3.0f, this->actor.yawTowardsPlayer, 2.0f, 0x20); Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT); } if (Animation_OnFrame(&this->skelAnime, this->fwork[FD2_END_FRAME])) { @@ -612,7 +612,7 @@ void BossFd2_SetupDeath(BossFd2* this, PlayState* play) { Animation_Change(&this->skelAnime, &gHoleVolvagiaDamagedAnim, 1.0f, 0.0f, this->fwork[FD2_END_FRAME], ANIMMODE_ONCE_INTERP, -3.0f); this->actionFunc = BossFd2_Death; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->deathState = DEATH_START; } @@ -822,11 +822,11 @@ void BossFd2_CollisionCheck(BossFd2* this, PlayState* play) { } } if (!bossFd->faceExposed) { - this->collider.elements[0].base.elemType = ELEMTYPE_UNK2; - this->collider.base.colType = COLTYPE_METAL; + this->collider.elements[0].base.elemMaterial = ELEM_MATERIAL_UNK2; + this->collider.base.colMaterial = COL_MATERIAL_METAL; } else { - this->collider.elements[0].base.elemType = ELEMTYPE_UNK3; - this->collider.base.colType = COLTYPE_HIT3; + this->collider.elements[0].base.elemMaterial = ELEM_MATERIAL_UNK3; + this->collider.base.colMaterial = COL_MATERIAL_HIT3; } if (this->collider.elements[0].base.acElemFlags & ACELEM_HIT) { @@ -995,9 +995,9 @@ void BossFd2_Update(Actor* thisx, PlayState* play2) { this->fwork[FD2_TEX2_SCROLL_X] += 3.0f; this->fwork[FD2_TEX2_SCROLL_Y] -= 2.0f; if (this->actor.focus.pos.y < 90.0f) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } } @@ -1147,8 +1147,7 @@ void BossFd2_UpdateMane(BossFd2* this, PlayState* play, Vec3f* head, Vec3f* pos, xyScale = (0.01f - (i * 0.0009f)) * spE8[i] * scale[i]; Matrix_Scale(xyScale, xyScale, 0.01f * spE8[i], MTXMODE_APPLY); Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_fd2.c", 2498), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_fd2.c", 2498); gSPDisplayList(POLY_XLU_DISP++, gHoleVolvagiaManeModelDL); } Matrix_Pop(); diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h index f7d4b795fc..f2d3ff45ad 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h @@ -8,14 +8,14 @@ struct BossFd2; typedef void (*BossFd2ActionFunc)(struct BossFd2*, PlayState*); -typedef enum { +typedef enum BossFd2Signal { /* 0 */ FD2_SIGNAL_NONE, /* 1 */ FD2_SIGNAL_FLY, /* 2 */ FD2_SIGNAL_DEATH, /* 100 */ FD2_SIGNAL_GROUND = 100 } BossFd2Signal; -typedef struct { +typedef struct BossFd2Mane { /* 0x000 */ Vec3f rot[10]; /* 0x078 */ Vec3f pos[10]; /* 0x0F0 */ Vec3f pull[10]; @@ -23,7 +23,7 @@ typedef struct { /* 0x190 */ Vec3f head; } BossFd2Mane; // size = 0x19C -typedef enum { +typedef enum BossFd2S16Var { /* 0 */ FD2_TURN_TO_LINK, /* 1 */ FD2_ACTION_STATE, /* 2 */ FD2_UNK_TIMER, @@ -39,7 +39,7 @@ typedef enum { /* 19 */ FD2_SHORT_COUNT = 19 } BossFd2S16Var; -typedef enum { +typedef enum BossFd2F32Var { /* 0 */ FD2_TEX1_SCROLL_X, /* 1 */ FD2_TEX1_SCROLL_Y, /* 2 */ FD2_TEX2_SCROLL_X, diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2_colchk.inc.c b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2_colchk.inc.c index 4ec5065401..1098d44c3f 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2_colchk.inc.c +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2_colchk.inc.c @@ -3,7 +3,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[9] = { { { - ELEMTYPE_UNK3, + ELEM_MATERIAL_UNK3, { 0xFFCFFFFF, 0x00, 0x20 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_NONE, @@ -14,7 +14,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[9] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x20 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -25,7 +25,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[9] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x20 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -36,7 +36,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[9] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x20 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -47,7 +47,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[9] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x20 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -58,7 +58,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[9] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x20 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -69,7 +69,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[9] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x20 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -80,7 +80,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[9] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x20 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -91,7 +91,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[9] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x20 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -104,7 +104,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[9] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 5a040f3aa7..4b3cfe82d9 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -1,4 +1,5 @@ #include "z_boss_ganon.h" +#include "versions.h" #include "assets/overlays/ovl_Boss_Ganon/ovl_Boss_Ganon.h" #include "overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h" #include "overlays/actors/ovl_En_Zl3/z_en_zl3.h" @@ -9,7 +10,7 @@ #include "assets/objects/object_ganon_anime2/object_ganon_anime2.h" #include "assets/scenes/dungeons/ganon_boss/ganon_boss_scene.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) void BossGanon_Init(Actor* thisx, PlayState* play2); void BossGanon_Destroy(Actor* thisx, PlayState* play); @@ -45,7 +46,7 @@ void BossGanon_UpdateEffects(PlayState* play); s32 BossGanon_CheckFallingPlatforms(BossGanon* this, PlayState* play, Vec3f* checkPos); -ActorInit Boss_Ganon_InitVars = { +ActorProfile Boss_Ganon_Profile = { /**/ ACTOR_BOSS_GANON, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -59,7 +60,7 @@ ActorInit Boss_Ganon_InitVars = { static ColliderCylinderInit sDorfCylinderInit = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -67,7 +68,7 @@ static ColliderCylinderInit sDorfCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -79,7 +80,7 @@ static ColliderCylinderInit sDorfCylinderInit = { static ColliderCylinderInit sLightBallCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -87,7 +88,7 @@ static ColliderCylinderInit sLightBallCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK6, + ELEM_MATERIAL_UNK6, { 0x00100700, 0x00, 0x08 }, { 0x0D900740, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -100,21 +101,22 @@ static ColliderCylinderInit sLightBallCylinderInit = { static u8 D_808E4C58[] = { 0, 12, 10, 12, 14, 16, 12, 14, 16, 12, 14, 16, 12, 14, 16, 10, 16, 14 }; static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; -// For retail BSS ordering, the block number of sGanondorf must be 0 or just above. - -// TODO: There's probably a way to do this with less padding by spreading the variables out and moving -// data around. It would be easier if we had more options for controlling BSS ordering in debug. -#pragma increment_block_number 50 +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:0" \ + "pal-1.0:0 pal-1.1:0" static EnGanonMant* sCape; -#pragma increment_block_number 200 +// TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving +// data around. It would be easier if we had more options for controlling BSS ordering in debug. +#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \ + "ntsc-1.2:128 pal-1.0:128 pal-1.1:128" static s32 sSeed1; static s32 sSeed2; static s32 sSeed3; -#pragma increment_block_number 200 +#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \ + "ntsc-1.2:128 pal-1.0:128 pal-1.1:128" static BossGanon* sGanondorf; @@ -122,7 +124,7 @@ static EnZl3* sZelda; #define BOSSGANON_EFFECT_COUNT 200 -typedef struct { +typedef struct GanondorfEffect { /* 0x00 */ u8 type; /* 0x01 */ u8 timer; /* 0x04 */ Vec3f pos; @@ -338,10 +340,10 @@ void BossGanon_SetAnimationObject(BossGanon* this, PlayState* play, s32 objectId } static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_5, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, NAVI_ENEMY_GANONDORF, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 0, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 0, ICHAIN_STOP), }; void BossGanon_Init(Actor* thisx, PlayState* play2) { @@ -394,7 +396,7 @@ void BossGanon_Init(Actor* thisx, PlayState* play2) { 0, 0, 1); Actor_ChangeCategory(play, &play->actorCtx, thisx, ACTORCAT_BOSS); } else { - thisx->flags &= ~ACTOR_FLAG_0; + thisx->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->fwork[GDF_FWORK_1] = 255.0f; if (thisx->params >= 0xC8) { @@ -504,7 +506,7 @@ void BossGanon_SetupIntroCutscene(BossGanon* this, PlayState* play) { } } -typedef struct { +typedef struct CutsceneCameraPosition { /* 0x00 */ Vec3s eye; /* 0x06 */ Vec3s at; } CutsceneCameraPosition; // size = 0x12 @@ -1225,15 +1227,10 @@ void BossGanon_ShatterWindows(u8 windowShatterState) { } void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { - static Color_RGBA8 bloodPrimColor = { 0, 120, 0, 255 }; - static Color_RGBA8 bloodEnvColor = { 0, 120, 0, 255 }; s16 i; u8 moveCam = false; Player* player = GET_PLAYER(play); s16 pad; - Vec3f sp98; - Vec3f sp8C; - Vec3f sp80; gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment); @@ -1336,6 +1333,17 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_GANON_TOKETU); } else { if (Animation_OnFrame(&this->skelAnime, this->fwork[GDF_FWORK_1] - 16.0f)) { + Vec3f sp98; + Vec3f sp8C; +#if OOT_VERSION < PAL_1_0 + Color_RGBA8 bloodPrimColor = { 120, 0, 0, 255 }; + Color_RGBA8 bloodEnvColor = { 120, 0, 0, 255 }; +#else + static Color_RGBA8 bloodPrimColor = { 0, 120, 0, 255 }; + static Color_RGBA8 bloodEnvColor = { 0, 120, 0, 255 }; +#endif + Vec3f sp80; + for (i = 0; i < 40; i++) { sp98.x = Rand_CenteredFloat(5.0f); sp98.y = Rand_CenteredFloat(1.5f) + 1.0f; @@ -2380,7 +2388,7 @@ void BossGanon_SetupBlock(BossGanon* this, PlayState* play) { } void BossGanon_Block(BossGanon* this, PlayState* play) { - this->collider.base.colType = 9; + this->collider.base.colMaterial = COL_MATERIAL_METAL; SkelAnime_Update(&this->skelAnime); sCape->backPush = -9.0f; sCape->backSwayMagnitude = 0.25f; @@ -2523,7 +2531,7 @@ void BossGanon_Vulnerable(BossGanon* this, PlayState* play) { Vec3f sp40; if (this->timers[3] == 0) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } SkelAnime_Update(&this->skelAnime); @@ -2673,7 +2681,7 @@ void BossGanon_SetupDamaged(BossGanon* this, PlayState* play) { } void BossGanon_Damaged(BossGanon* this, PlayState* play) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; SkelAnime_Update(&this->skelAnime); @@ -2831,10 +2839,10 @@ void BossGanon_Update(Actor* thisx, PlayState* play2) { } } - this->collider.base.colType = 3; + this->collider.base.colMaterial = COL_MATERIAL_HIT3; sCape->gravity = -3.0f; this->shockGlow = false; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->unk_1A2++; this->unk_1A4++; @@ -3272,8 +3280,7 @@ void BossGanon_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* OPEN_DISPS(play->state.gfxCtx, "../z_boss_ganon.c", 7191); Matrix_MultVec3f(&D_808E4DB8, &this->unk_208); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_ganon.c", 7196), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_ganon.c", 7196); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanondorfEyesDL)); CLOSE_DISPS(play->state.gfxCtx, "../z_boss_ganon.c", 7198); @@ -3366,8 +3373,7 @@ void BossGanon_DrawShock(BossGanon* this, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(this->unk_49C[i], this->unk_49C[i], this->unk_49C[i], MTXMODE_APPLY); Matrix_RotateZ(Rand_CenteredFloat(M_PI), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 7384), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 7384); gSPDisplayList(POLY_XLU_DISP++, gGanondorfSquareDL); } } else { @@ -3380,8 +3386,7 @@ void BossGanon_DrawShock(BossGanon* this, PlayState* play) { Matrix_RotateZ(Rand_CenteredFloat(M_PI), MTXMODE_APPLY); } - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 7401), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 7401); if (this->shockGlow) { gSPSegment(POLY_XLU_DISP++, 0x08, @@ -3423,8 +3428,7 @@ void BossGanon_DrawHandLightBall(BossGanon* this, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(this->handLightBallScale, this->handLightBallScale, this->handLightBallScale, MTXMODE_APPLY); Matrix_RotateZ(this->unk_258, 1); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 7510), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 7510); gSPDisplayList(POLY_XLU_DISP++, gGanondorfSquareDL); alpha = ((this->unk_1A2 % 2) != 0) ? 100 : 80; @@ -3432,8 +3436,7 @@ void BossGanon_DrawHandLightBall(BossGanon* this, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 155, alpha); Matrix_Translate(this->unk_260.x, 0.0f, this->unk_260.z, MTXMODE_NEW); Matrix_Scale(this->handLightBallScale * 0.75f, 1.0f, this->handLightBallScale * 0.75f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gameState->gfxCtx, "../z_boss_ganon.c", 7531), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gameState->gfxCtx, "../z_boss_ganon.c", 7531); gSPDisplayList(POLY_XLU_DISP++, gGanondorfLightCoreDL); CLOSE_DISPS(gfxCtx, "../z_boss_ganon.c", 7534); @@ -3460,16 +3463,14 @@ void BossGanon_DrawBigMagicCharge(BossGanon* this, PlayState* play) { Matrix_Translate(this->unk_278.x, this->unk_278.y, this->unk_278.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(this->unk_28C, this->unk_28C, this->unk_28C, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 7588), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 7588); gSPDisplayList(POLY_XLU_DISP++, gGanondorfLightFlecksDL); // background circle texture Matrix_Translate(this->unk_278.x, this->unk_278.y, this->unk_278.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(this->unk_284, this->unk_284, this->unk_284, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 7601), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 7601); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 0, 100, (s8)this->unk_288); gSPSegment(POLY_XLU_DISP++, 0x09, Gfx_TwoTexScroll(gameState->gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x20, 1, 0, this->unk_1A2 * -4, @@ -3493,8 +3494,7 @@ void BossGanon_DrawBigMagicCharge(BossGanon* this, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(this->unk_2D0, this->unk_2D0, this->unk_2D0, MTXMODE_APPLY); Matrix_RotateZ((this->unk_1A2 * 10.0f) / 1000.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 7673), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 7673); gSPDisplayList(POLY_XLU_DISP++, gGanondorfSquareDL); BossGanon_InitRand(this->unk_1AA + 1, 0x71AC, 0x263A); @@ -3514,15 +3514,12 @@ void BossGanon_DrawBigMagicCharge(BossGanon* this, PlayState* play) { Matrix_RotateZ(xzRot, MTXMODE_APPLY); Matrix_Translate(0.0f, 0.0f, 50.0f, MTXMODE_APPLY); Matrix_Scale(4.0f, 4.0f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 7713), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 7713); gSPDisplayList(POLY_XLU_DISP++, gGanondorfLightRayTriDL); Matrix_Pop(); } - if (1) {} - CLOSE_DISPS(gfxCtx, "../z_boss_ganon.c", 7721); } } @@ -3569,8 +3566,7 @@ void BossGanon_DrawTriforce(BossGanon* this, PlayState* play) { } Matrix_Scale(this->fwork[GDF_TRIFORCE_SCALE], this->fwork[GDF_TRIFORCE_SCALE], 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gameState->gfxCtx, "../z_boss_ganon.c", 7779), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gameState->gfxCtx, "../z_boss_ganon.c", 7779); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanondorfTriforceDL)); Matrix_Pop(); @@ -3604,8 +3600,7 @@ void BossGanon_DrawDarkVortex(BossGanon* this, PlayState* play) { Matrix_Scale(this->fwork[GDF_VORTEX_SCALE], this->fwork[GDF_VORTEX_SCALE], this->fwork[GDF_VORTEX_SCALE], MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gameState->gfxCtx, "../z_boss_ganon.c", 7841), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gameState->gfxCtx, "../z_boss_ganon.c", 7841); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanondorfVortexDL)); Matrix_Pop(); @@ -3778,8 +3773,7 @@ void BossGanon_DrawShadowTexture(void* tex, BossGanon* this, PlayState* play) { } Matrix_Scale(0.95000005f, 1.0f, 0.95000005f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gameState->gfxCtx, "../z_boss_ganon.c", 8396), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gameState->gfxCtx, "../z_boss_ganon.c", 8396); gSPDisplayList(POLY_OPA_DISP++, gGanondorfShadowSetupDL); gDPLoadTextureBlock(POLY_OPA_DISP++, tex, G_IM_FMT_I, G_IM_SIZ_8b, 64, 64, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD); @@ -3995,7 +3989,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) { } else { if (sqrtf(SQ(xDistFromLink) + SQ(yDistFromLink) + SQ(zDistFromLink)) <= 25.0f) { spBA = 5; - func_8002F6D4(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, 0x30); + Actor_SetPlayerKnockbackLarge(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, 0x30); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_GANON_HIT_THUNDER); ganondorf->timers[2] = 20; @@ -4149,8 +4143,7 @@ void BossGanon_LightBall_Draw(Actor* thisx, PlayState* play) { Matrix_Push(); Matrix_Translate(this->actor.world.pos.x, this->actor.floorHeight, this->actor.world.pos.z, MTXMODE_NEW); Matrix_Scale(this->actor.scale.x * 0.75f, 1.0f, this->actor.scale.z * 0.75f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_ganon.c", 9875), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_ganon.c", 9875); gSPDisplayList(POLY_XLU_DISP++, gGanondorfLightCoreDL); Matrix_Pop(); @@ -4165,8 +4158,7 @@ void BossGanon_LightBall_Draw(Actor* thisx, PlayState* play) { Matrix_Push(); Matrix_RotateY(i * (M_PI / 8), MTXMODE_APPLY); Matrix_RotateZ(this->fwork[GDF_FWORK_0], MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_ganon.c", 9899), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_ganon.c", 9899); gSPDisplayList(POLY_XLU_DISP++, gGanondorfSquareDL); Matrix_Pop(); @@ -4174,13 +4166,10 @@ void BossGanon_LightBall_Draw(Actor* thisx, PlayState* play) { } else if (this->unk_1A8 == 0) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_RotateZ((this->actor.shape.rot.z / (f32)0x8000) * 3.1416f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_ganon.c", 9907), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_ganon.c", 9907); gSPDisplayList(POLY_XLU_DISP++, gGanondorfSquareDL); } - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_boss_ganon.c", 9911); } @@ -4302,8 +4291,7 @@ void func_808E229C(Actor* thisx, PlayState* play2) { this->actor.scale.z * (1.0f - (i * 0.07000001f)), MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_RotateZ(((2.0f * (i * M_PI)) / 10.0f) + BINANG_TO_RAD_ALT(this->actor.shape.rot.z), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_ganon.c", 10109), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_ganon.c", 10109); gSPDisplayList(POLY_XLU_DISP++, gGanondorfSquareDL); } @@ -4473,7 +4461,7 @@ void func_808E2544(Actor* thisx, PlayState* play) { this->actor.speed = 0.0f; if (dorf->timers[2] == 0) { - func_8002F6D4(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, 0x50); + Actor_SetPlayerKnockbackLarge(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, 0x50); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_GANON_HIT_THUNDER); dorf->timers[2] = 20; @@ -4595,8 +4583,7 @@ void func_808E324C(Actor* thisx, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(10.0f, 10.0f, 10.0f, MTXMODE_APPLY); Matrix_RotateZ(Rand_CenteredFloat(M_PI), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_ganon.c", 10534), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_ganon.c", 10534); gSPDisplayList(POLY_XLU_DISP++, gGanondorfLightBallMaterialDL); gSPDisplayList(POLY_XLU_DISP++, gGanondorfSquareDL); @@ -4796,7 +4783,8 @@ void BossGanon_UpdateEffects(PlayState* play) { if (((eff->scale * 150.0f) < distToPlayer) && (distToPlayer < (eff->scale * 300.0f))) { eff->timer = 150; - func_8002F6D4(play, &sGanondorf->actor, 7.0f, sGanondorf->actor.yawTowardsPlayer, 0.0f, 0x20); + Actor_SetPlayerKnockbackLarge(play, &sGanondorf->actor, 7.0f, + sGanondorf->actor.yawTowardsPlayer, 0.0f, 0x20); } } } @@ -4811,17 +4799,20 @@ static void* sLightningTextures[] = { gGanondorfLightning12Tex, }; -static u8 sLightningPrimColors[] = { - 0, 0, 0, 255, 255, 255, 231, 250, 231, 208, 245, 208, 185, 240, 185, 162, 235, 162, 139, 230, - 139, 115, 225, 115, 92, 220, 92, 69, 215, 69, 46, 210, 46, 23, 205, 23, 0, 200, 0, +static u8 sLightningPrimColors[13][3] = { + { 0, 0, 0 }, { 255, 255, 255 }, { 231, 250, 231 }, { 208, 245, 208 }, { 185, 240, 185 }, + { 162, 235, 162 }, { 139, 230, 139 }, { 115, 225, 115 }, { 92, 220, 92 }, { 69, 215, 69 }, + { 46, 210, 46 }, { 23, 205, 23 }, { 0, 200, 0 }, }; -static u8 sLightningEnvColors[] = { - 0, 0, 0, 255, 255, 0, 240, 231, 23, 226, 208, 46, 212, 185, 69, 198, 162, 92, - 184, 139, 115, 170, 115, 139, 156, 92, 162, 142, 69, 185, 128, 46, 208, 114, 23, 231, - 100, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +static u8 sLightningEnvColors[13][3] = { + { 0, 0, 0 }, { 255, 255, 0 }, { 240, 231, 23 }, { 226, 208, 46 }, { 212, 185, 69 }, + { 198, 162, 92 }, { 184, 139, 115 }, { 170, 115, 139 }, { 156, 92, 162 }, { 142, 69, 185 }, + { 128, 46, 208 }, { 114, 23, 231 }, { 100, 0, 255 }, }; +static s32 sUnknown[3] = { 0 }; + void BossGanon_DrawEffects(PlayState* play) { u8 materialFlag = 0; s16 i; @@ -4850,8 +4841,7 @@ void BossGanon_DrawEffects(PlayState* play) { Matrix_Scale(eff->scale, eff->scale, eff->scale, MTXMODE_APPLY); Matrix_RotateY(eff->unk_48, MTXMODE_APPLY); Matrix_RotateX(eff->unk_44, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 10898), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_boss_ganon.c", 10898); gSPDisplayList(POLY_OPA_DISP++, gGanondorfWindowShardModelDL); } } @@ -4872,8 +4862,7 @@ void BossGanon_DrawEffects(PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(eff->scale, eff->scale, 1.0f, MTXMODE_APPLY); Matrix_RotateZ(eff->unk_3C, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 10932), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 10932); gSPDisplayList(POLY_XLU_DISP++, gGanondorfSquareDL); } } @@ -4896,8 +4885,7 @@ void BossGanon_DrawEffects(PlayState* play) { Matrix_RotateZ(eff->unk_3C, MTXMODE_APPLY); Matrix_Scale(eff->scale, eff->scale, eff->unk_38 * eff->scale, MTXMODE_APPLY); Matrix_RotateX(M_PI / 2, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 10971), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 10971); gSPDisplayList(POLY_XLU_DISP++, gGanondorfSquareDL); } } @@ -4922,8 +4910,7 @@ void BossGanon_DrawEffects(PlayState* play) { Matrix_Scale(eff->scale, eff->scale, 1.0f, MTXMODE_APPLY); Matrix_RotateX(eff->unk_3C * 1.3f, MTXMODE_APPLY); Matrix_RotateZ(eff->unk_3C, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 11023), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 11023); gSPDisplayList(POLY_XLU_DISP++, gGanondorfShockDL); } } @@ -4933,18 +4920,16 @@ void BossGanon_DrawEffects(PlayState* play) { for (i = 0; i < 150; i++, eff++) { if (eff->type == GDF_EFF_LIGHTNING) { gDPPipeSync(POLY_XLU_DISP++); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, sLightningPrimColors[(eff->timer * 3) + 0], - sLightningPrimColors[(eff->timer * 3) + 1], sLightningPrimColors[(eff->timer * 3) + 2], - 255); - gDPSetEnvColor(POLY_XLU_DISP++, sLightningEnvColors[(eff->timer * 3) + 0], - sLightningEnvColors[(eff->timer * 3) + 1], sLightningEnvColors[(eff->timer * 3) + 2], 0); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, sLightningPrimColors[eff->timer][0], + sLightningPrimColors[eff->timer][1], sLightningPrimColors[eff->timer][2], 255); + gDPSetEnvColor(POLY_XLU_DISP++, sLightningEnvColors[eff->timer][0], sLightningEnvColors[eff->timer][1], + sLightningEnvColors[eff->timer][2], 0); Matrix_Translate(sGanondorf->unk_260.x, sGanondorf->unk_260.y, sGanondorf->unk_260.z, MTXMODE_NEW); Matrix_RotateY(eff->unk_48, MTXMODE_APPLY); Matrix_RotateZ(eff->unk_3C, MTXMODE_APPLY); Matrix_Scale(eff->scale, eff->scale, eff->scale, MTXMODE_APPLY); Matrix_RotateY(eff->unk_44, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 11074), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 11074); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sLightningTextures[eff->timer])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, eff->timer); gSPDisplayList(POLY_XLU_DISP++, gGanondorfLightningDL); @@ -4963,8 +4948,7 @@ void BossGanon_DrawEffects(PlayState* play) { eff->timer * 2, eff->timer * -20, 32, 32)); Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW); Matrix_Scale(eff->scale, eff->unk_40 * eff->scale, eff->scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 11121), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 11121); gSPDisplayList(POLY_XLU_DISP++, gGanondorfImpactDarkDL); } } @@ -4981,8 +4965,7 @@ void BossGanon_DrawEffects(PlayState* play) { eff->timer * 2, eff->timer * -20, 32, 32)); Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW); Matrix_Scale(eff->scale, eff->unk_40 * eff->scale, eff->scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 11165), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 11165); gSPDisplayList(POLY_XLU_DISP++, gGanondorfImpactLightDL); } } @@ -5000,8 +4983,7 @@ void BossGanon_DrawEffects(PlayState* play) { Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW); Matrix_Scale((eff->scale * 200.0f) / 1500.0f, (eff->unk_40 * 200.0f) / 1500.0f, (eff->scale * 200.0f) / 1500.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 11209), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 11209); gSPDisplayList(POLY_XLU_DISP++, gGanondorfShockwaveDL); } } @@ -5019,8 +5001,7 @@ void BossGanon_DrawEffects(PlayState* play) { Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(eff->scale, eff->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 11250), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_ganon.c", 11250); gSPDisplayList(POLY_XLU_DISP++, gGanondorfDotDL); } } diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h index 85bbc27f12..e0f093455b 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h @@ -8,7 +8,7 @@ struct BossGanon; typedef void (*BossGanonActionFunc)(struct BossGanon*, PlayState*); -typedef enum { +typedef enum GanondorfLimb { /* 0 */ GANONDORF_LIMB_NONE, /* 1 */ GANONDORF_LIMB_ROOT, /* 2 */ GANONDORF_LIMB_TORSO, @@ -38,7 +38,7 @@ typedef enum { /* 26 */ GANONDORF_LIMB_MAX } GanondorfLimb; -typedef enum { +typedef enum GanondorfFwork { /* 0 */ GDF_FWORK_0, /* 1 */ GDF_FWORK_1, /* 2 */ GDF_CENTER_POS, @@ -52,19 +52,19 @@ typedef enum { /* 10 */ GDF_FWORK_MAX } GanondorfFwork; -typedef enum { +typedef enum WindowShatterState { /* 0 */ GDF_WINDOW_SHATTER_OFF, /* 1 */ GDF_WINDOW_SHATTER_PARTIAL, /* 2 */ GDF_WINDOW_SHATTER_FULL } WindowShatterState; -typedef enum { +typedef enum GanondorfShockType { /* 0 */ GDF_SHOCK_DORF_YELLOW, /* 1 */ GDF_SHOCK_PLAYER_YELLOW, /* 2 */ GDF_SHOCK_PLAYER_PURPLE } GanondorfShockType; -typedef enum { +typedef enum GanondorfEffectType { /* 0 */ GDF_EFF_NONE, /* 1 */ GDF_EFF_SPARKLE, /* 2 */ GDF_EFF_LIGHT_RAY, @@ -77,7 +77,7 @@ typedef enum { /* 9 */ GDF_EFF_WINDOW_SHARD } GanondorfEffectType; -typedef enum { +typedef enum GanondorfTriforceType { /* 0 */ GDF_TRIFORCE_PLAYER, /* 1 */ GDF_TRIFORCE_ZELDA, /* 2 */ GDF_TRIFORCE_DORF diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index ced201f7b1..8255e36d0b 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -1,4 +1,5 @@ #include "z_boss_ganon2.h" +#include "versions.h" #include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h" #include "overlays/actors/ovl_Demo_Gj/z_demo_gj.h" #include "overlays/actors/ovl_En_Zl3/z_en_zl3.h" @@ -6,8 +7,24 @@ #include "assets/objects/object_ganon2/object_ganon2.h" #include "assets/objects/object_ganon_anime3/object_ganon_anime3.h" #include "assets/objects/object_geff/object_geff.h" +#include "assets/overlays/ovl_Boss_Ganon2/ovl_Boss_Ganon2.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) + +#define BOSS_GANON2_EFFECT_COUNT 100 + +typedef struct BossGanon2Effect { + /* 0x00 */ u8 type; + /* 0x01 */ u8 unk_01; + /* 0x04 */ Vec3f position; + /* 0x10 */ Vec3f velocity; + /* 0x1C */ Vec3f accel; + /* 0x28 */ char unk_28[0x6]; + /* 0x2E */ s16 unk_2E; + /* 0x30 */ char unk_30[0x4]; + /* 0x34 */ f32 scale; + /* 0x38 */ Vec3f unk_38; +} BossGanon2Effect; // size = 0x44 void BossGanon2_Init(Actor* thisx, PlayState* play); void BossGanon2_Destroy(Actor* thisx, PlayState* play); @@ -32,7 +49,7 @@ void BossGanon2_DrawEffects(PlayState* play); void BossGanon2_GenShadowTexture(void* shadowTexture, BossGanon2* this, PlayState* play); void BossGanon2_DrawShadowTexture(void* shadowTexture, BossGanon2* this, PlayState* play); -ActorInit Boss_Ganon2_InitVars = { +ActorProfile Boss_Ganon2_Profile = { /**/ ACTOR_BOSS_GANON2, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -44,7 +61,265 @@ ActorInit Boss_Ganon2_InitVars = { /**/ BossGanon2_Draw, }; -#include "z_boss_ganon2_data.inc.c" +static Vec3f D_80906D60 = { 0.0f, 0.0f, 0.0f }; + +static Vec3f D_80906D6C = { 0.0f, 0.0f, 500.0f }; + +static u8 D_80906D78 = 0; + +static ColliderJntSphElementInit sJntSphItemsInit1[] = { + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 2, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 3, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 4, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 5, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 6, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 7, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 8, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 9, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 10, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 11, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 12, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 13, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 14, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 15, { { 0, 0, 0 }, 30 }, 100 }, + }, +}; + +static ColliderJntSphInit sJntSphInit1 = { + { + COL_MATERIAL_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_FIRST_ONLY | OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + ARRAY_COUNT(sJntSphItemsInit1), + sJntSphItemsInit1, +}; + +static ColliderJntSphElementInit sJntSphItemsInit2[] = { + { + { + ELEM_MATERIAL_UNK2, + { 0xFFCFFFFF, 0x00, 0x40 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 15, { { 0, 0, 0 }, 45 }, 100 }, + }, + { + { + ELEM_MATERIAL_UNK2, + { 0xFFCFFFFF, 0x00, 0x40 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + ATELEM_ON | ATELEM_SFX_NORMAL, + ACELEM_ON, + OCELEM_ON, + }, + { 16, { { 0, 0, 0 }, 45 }, 100 }, + }, +}; + +static ColliderJntSphInit sJntSphInit2 = { + { + COL_MATERIAL_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + ARRAY_COUNT(sJntSphItemsInit2), + sJntSphItemsInit2, +}; + +static Vec3f D_8090EB20; + +static EnZl3* sZelda; + +static Actor* D_8090EB30; + +// unused +static UNK_TYPE D_8090EB34; + +static BossGanon2Effect sEffects[BOSS_GANON2_EFFECT_COUNT]; + +static s32 sSeed1; +static s32 sSeed2; +static s32 sSeed3; + +// unused +static UNK_TYPE D_809105DC; + +static Vec3f D_809105D8[4]; + +static Vec3f D_80910608[4]; + +static s8 D_80910638; void BossGanon2_InitRand(s32 seedInit0, s32 seedInit1, s32 seedInit2) { sSeed1 = seedInit0; @@ -175,7 +450,7 @@ void func_808FD4D4(BossGanon2* this, PlayState* play, s16 arg2, s16 arg3) { void func_808FD5C4(BossGanon2* this, PlayState* play) { this->actionFunc = func_808FD5F4; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.world.pos.y = -3000.0f; } @@ -882,7 +1157,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { this->unk_337 = 1; func_808FFDB0(this, play); this->unk_1A2[1] = 50; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; sZelda->unk_3C8 = 7; } break; @@ -910,8 +1185,8 @@ void func_808FF898(BossGanon2* this, PlayState* play) { if (actor->id == ACTOR_DEMO_GJ) { DemoGj* gj = (DemoGj*)actor; - if (((actor->params & 0xFF) == 0x10) || ((actor->params & 0xFF) == 0x11) || - ((actor->params & 0xFF) == 0x16)) { + if ((PARAMS_GET_U(actor->params, 0, 8) == 0x10) || (PARAMS_GET_U(actor->params, 0, 8) == 0x11) || + (PARAMS_GET_U(actor->params, 0, 8) == 0x16)) { if (SQ(this->unk_218.x - gj->dyna.actor.world.pos.x) + SQ(this->unk_218.z - gj->dyna.actor.world.pos.z) < SQ(100.0f)) { @@ -951,8 +1226,8 @@ s32 func_808FFA24(BossGanon2* this, PlayState* play) { if (actor->id == ACTOR_DEMO_GJ) { DemoGj* gj = (DemoGj*)actor; - if (((actor->params & 0xFF) == 0x10) || ((actor->params & 0xFF) == 0x11) || - ((actor->params & 0xFF) == 0x16)) { + if ((PARAMS_GET_U(actor->params, 0, 8) == 0x10) || (PARAMS_GET_U(actor->params, 0, 8) == 0x11) || + (PARAMS_GET_U(actor->params, 0, 8) == 0x16)) { if (SQ(this->actor.world.pos.x - gj->dyna.actor.world.pos.x) + SQ(this->actor.world.pos.z - gj->dyna.actor.world.pos.z) < SQ(200.0f)) { @@ -1054,7 +1329,7 @@ void func_808FFDB0(BossGanon2* this, PlayState* play) { } this->unk_336 = 1; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->unk_228 = 1.0f; this->unk_224 = 1.0f; } else { @@ -1405,7 +1680,12 @@ void func_80900890(BossGanon2* this, PlayState* play) { f32 temp_f2 = -200.0f - player->actor.world.pos.x; f32 temp_f12 = -200.0f - player->actor.world.pos.z; - if (sqrtf(SQ(temp_f2) + SQ(temp_f12)) <= 784.0f) { +#if OOT_VERSION < NTSC_1_2 + if (sqrtf(SQ(temp_f2) + SQ(temp_f12)) <= 800.0f) +#else + if (sqrtf(SQ(temp_f2) + SQ(temp_f12)) <= 784.0f) +#endif + { Animation_MorphToPlayOnce(&this->skelAnime, &gGanonGetUpAnim, 0.0f); this->unk_194 = Animation_GetLastFrame(&gGanonGetUpAnim); this->unk_1AC = 2; @@ -1442,12 +1722,18 @@ void func_80901020(BossGanon2* this, PlayState* play) { void func_8090109C(BossGanon2* this, PlayState* play) { u8 i; + Vec3f velocity; + Vec3f accel; +#if OOT_VERSION < PAL_1_0 + Color_RGBA8 sPrimColor = { 120, 0, 0, 255 }; + Color_RGBA8 sEnvColor = { 120, 0, 0, 255 }; +#else + static Color_RGBA8 sPrimColor = { 0, 120, 0, 255 }; + static Color_RGBA8 sEnvColor = { 0, 120, 0, 255 }; +#endif + Vec3f pos; for (i = 0; i < 70; i++) { - Vec3f velocity; - Vec3f accel; - Vec3f pos; - velocity.x = Rand_CenteredFloat(50.0f); velocity.y = Rand_CenteredFloat(10.0f) + 5.0f; velocity.z = Rand_CenteredFloat(50.0f); @@ -1461,6 +1747,18 @@ void func_8090109C(BossGanon2* this, PlayState* play) { } } +static Vec3f D_8090702C[] = { + { 10.0f, -10.0f, 0.0f }, + { 0.0f, 0.0f, -60.0f }, + { 70.0f, -30.0f, 10.0f }, +}; + +static Vec3f D_80907050[] = { + { -20.0f, 0.0f, 0.0f }, + { -15.0f, 0.0f, 10.0f }, + { -16.0f, -12.0f, 40.0f }, +}; + void func_8090120C(BossGanon2* this, PlayState* play) { Player* player; f32 temp_f14; @@ -1853,7 +2151,8 @@ void func_80902348(BossGanon2* this, PlayState* play) { phi_v0_2 = 0; } - func_8002F6D4(play, &this->actor, 15.0f, this->actor.yawTowardsPlayer + phi_v0_2, 2.0f, 0); + Actor_SetPlayerKnockbackLarge(play, &this->actor, 15.0f, this->actor.yawTowardsPlayer + phi_v0_2, 2.0f, + 0); sZelda->unk_3C8 = 8; this->unk_316 = 10; break; @@ -1868,13 +2167,18 @@ void func_80902348(BossGanon2* this, PlayState* play) { temp_f2 = -200.0f - player->actor.world.pos.x; temp_f12 = -200.0f - player->actor.world.pos.z; - if (sqrtf(SQ(temp_f2) + SQ(temp_f12)) > 784.0f) { +#if OOT_VERSION < PAL_1_0 + if (sqrtf(SQ(temp_f2) + SQ(temp_f12)) > 800.0f) +#else + if (sqrtf(SQ(temp_f2) + SQ(temp_f12)) > 784.0f) +#endif + { for (j = 0; j < PLAYER_BODYPART_MAX; j++) { player->bodyFlameTimers[j] = Rand_S16Offset(0, 200); } player->bodyIsBurning = true; - func_8002F6D4(play, &this->actor, 10.0f, Math_Atan2S(temp_f12, temp_f2), 0.0f, 0x10); + Actor_SetPlayerKnockbackLarge(play, &this->actor, 10.0f, Math_Atan2S(temp_f12, temp_f2), 0.0f, 0x10); sZelda->unk_3C8 = 8; } } @@ -1960,6 +2264,8 @@ void BossGanon2_CollisionCheck(BossGanon2* this, PlayState* play) { } } +static s16 D_80907074[] = { 0, 1, 2, 2, 1, 0 }; + void BossGanon2_Update(Actor* thisx, PlayState* play) { BossGanon2* this = (BossGanon2*)thisx; s32 pad; @@ -2198,6 +2504,11 @@ void BossGanon2_Update(Actor* thisx, PlayState* play) { BossGanon2_UpdateEffects(this, play); } +static s16 D_80907080 = 0; + +static u8 D_80907084[] = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 }; +static u8 D_80907090[] = { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 }; + void func_809034E4(Vec3f* arg0, Vec3f* arg1) { Vtx* vtx; Vec3f sp2D0; @@ -2408,8 +2719,7 @@ void func_80903F38(BossGanon2* this, PlayState* play) { gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, D_80907080); Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_NEW); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_ganon2.c", 5117), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_ganon2.c", 5117); gSPDisplayList(POLY_XLU_DISP++, gGanonSwordTrailDL); } @@ -2430,9 +2740,12 @@ void func_80904108(BossGanon2* this, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 200, 0, (s8)this->unk_324); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128); Matrix_Translate(-200.0f, 1086.0f, -200.0f, MTXMODE_NEW); +#if OOT_VERSION < PAL_1_0 + Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY); +#else Matrix_Scale(0.098000005f, 0.1f, 0.098000005f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gameState->gfxCtx, "../z_boss_ganon2.c", 5183), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); +#endif + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gameState->gfxCtx, "../z_boss_ganon2.c", 5183); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanonFireRingDL)); Matrix_Pop(); @@ -2479,14 +2792,12 @@ void func_80904340(BossGanon2* this, PlayState* play) { Matrix_RotateY(M_PI, MTXMODE_APPLY); } - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gameState->gfxCtx, "../z_boss_ganon2.c", 5250), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gameState->gfxCtx, "../z_boss_ganon2.c", 5250); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanonLightningDL)); } } Matrix_Pop(); - if (1) {} CLOSE_DISPS(gameState->gfxCtx, "../z_boss_ganon2.c", 5255); } @@ -2504,8 +2815,7 @@ void func_8090464C(BossGanon2* this, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_RotateZ(-0.2f, MTXMODE_APPLY); Matrix_Scale(0.6f, 0.6f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gameState->gfxCtx, "../z_boss_ganon2.c", 5290), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gameState->gfxCtx, "../z_boss_ganon2.c", 5290); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanonTriforceDL)); Matrix_Pop(); @@ -2544,6 +2854,25 @@ s32 BossGanon2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec return 0; } +static s8 D_8090709C[] = { + 0xFF, 0xFF, 0x01, 0xFF, 0x03, 0x04, 0xFF, 0xFF, 0x05, 0xFF, 0x06, 0x07, 0xFF, 0xFF, 0x08, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0xFF, 0xFF, 0x02, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0x00, +}; + +static s8 D_809070CC[] = { + 0xFF, 0xFF, 0x01, 0xFF, 0x03, 0x04, 0xFF, 0xFF, 0x05, 0xFF, 0x06, 0x07, 0xFF, 0xFF, 0x08, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0xFF, 0xFF, 0x02, 0x0C, 0x0D, 0x0E, 0x09, 0x0A, 0x0B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, +}; + +static Vec3f D_809070FC = { 0.0f, 0.0f, 5000.0f }; +static Vec3f D_80907108 = { 0.0f, 2000.0f, 0.0f }; +static Vec3f D_80907114 = { 0.0f, 2000.0f, 0.0f }; +static Vec3f D_80907120 = { 0.0f, 0.0f, 17000.0f }; +static Vec3f D_8090712C = { 0.0f, 0.0f, 3000.0f }; +static Vec3f D_80907138 = { 0.0f, 0.0f, 0.0f }; + void BossGanon2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { s8 pad; s8 temp_v0; @@ -2582,15 +2911,13 @@ void BossGanon2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* if ((limbIndex == GANON_LIMB_LEFT_SWORD) || (limbIndex == GANON_LIMB_RIGHT_SWORD)) { Matrix_Push(); Matrix_Scale(this->unk_224, this->unk_224, this->unk_224, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_ganon2.c", 5522), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_boss_ganon2.c", 5522); gSPDisplayList(POLY_OPA_DISP++, *dList); Matrix_Pop(); } else if ((limbIndex == GANON_LIMB_LEFT_HORN) || (limbIndex == GANON_LIMB_RIGHT_HORN)) { Matrix_Push(); Matrix_Scale(this->unk_228, this->unk_228, this->unk_228, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_ganon2.c", 5533), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_boss_ganon2.c", 5533); gSPDisplayList(POLY_OPA_DISP++, *dList); Matrix_Pop(); } @@ -2634,14 +2961,11 @@ void func_80904D88(BossGanon2* this, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(this->unk_30C, this->unk_30C, this->unk_30C, MTXMODE_APPLY); Matrix_RotateZ(Rand_CenteredFloat(M_PI), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gameState->gfxCtx, "../z_boss_ganon2.c", 5618), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gameState->gfxCtx, "../z_boss_ganon2.c", 5618); gSPDisplayList(POLY_XLU_DISP++, gGanonLightOrbModelDL); } } - if (1) {} - CLOSE_DISPS(gameState->gfxCtx, "../z_boss_ganon2.c", 5622); } @@ -2660,12 +2984,10 @@ void func_80904FC8(BossGanon2* this, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(this->unk_384, this->unk_384, this->unk_384, MTXMODE_APPLY); Matrix_RotateZ(this->unk_388, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gameState->gfxCtx, "../z_boss_ganon2.c", 5661), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gameState->gfxCtx, "../z_boss_ganon2.c", 5661); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanonLightOrbModelDL)); Matrix_RotateZ(this->unk_388 * -2.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gameState->gfxCtx, "../z_boss_ganon2.c", 5664), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gameState->gfxCtx, "../z_boss_ganon2.c", 5664); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanonLightOrbModelDL)); } @@ -2701,8 +3023,7 @@ void func_8090523C(BossGanon2* this, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(200.0f * phi_f20, 200.0f * phi_f20, 1.0f, MTXMODE_APPLY); Matrix_RotateZ(Rand_ZeroFloat(2.0f * M_PI), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gameState->gfxCtx, "../z_boss_ganon2.c", 5721), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gameState->gfxCtx, "../z_boss_ganon2.c", 5721); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanonLightOrbModelDL)); } } @@ -2710,6 +3031,13 @@ void func_8090523C(BossGanon2* this, PlayState* play) { CLOSE_DISPS(gameState->gfxCtx, "../z_boss_ganon2.c", 5725); } +static s8 D_80907144[] = { + 0xFF, 0xFF, 0x01, 0xFF, 0x03, 0x04, 0x05, 0xFF, 0x06, 0x07, 0x08, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x02, 0x0C, 0x0D, 0x0E, 0x09, 0x0A, 0x0B, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, +}; + +static Vec3f D_80907164 = { 800.0f, 420.0f, 100.0f }; + void BossGanon2_PostLimbDraw2(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { s8 temp_v1 = D_80907144[limbIndex]; BossGanon2* this = (BossGanon2*)thisx; @@ -2720,8 +3048,7 @@ void BossGanon2_PostLimbDraw2(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s if (limbIndex == GANONDORF_LIMB_JEWEL) { OPEN_DISPS(play->state.gfxCtx, "../z_boss_ganon2.c", 5749); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_ganon2.c", 5752), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_ganon2.c", 5752); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanondorfEyesDL)); CLOSE_DISPS(play->state.gfxCtx, "../z_boss_ganon2.c", 5754); @@ -2748,8 +3075,7 @@ void func_80905674(BossGanon2* this, PlayState* play) { Matrix_RotateY(-M_PI / 4.0f, MTXMODE_APPLY); Matrix_Scale(0.040000003f, 0.040000003f, this->unk_380, MTXMODE_APPLY); Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gameState->gfxCtx, "../z_boss_ganon2.c", 5814), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gameState->gfxCtx, "../z_boss_ganon2.c", 5814); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanonZeldaMagicDL)); Matrix_Pop(); @@ -2757,6 +3083,14 @@ void func_80905674(BossGanon2* this, PlayState* play) { } } +static void* sEyeTextures[] = { + gGanonEyeOpenTex, + gGanonEyeHalfTex, + gGanonEyeClosedTex, +}; + +static Vec3f D_8090717C = { 0.0f, -2000.0f, 0.0f }; + void BossGanon2_Draw(Actor* thisx, PlayState* play) { void* shadowTexture = GRAPH_ALLOC(play->state.gfxCtx, 4096); BossGanon2* this = (BossGanon2*)thisx; @@ -2788,8 +3122,7 @@ void BossGanon2_Draw(Actor* thisx, PlayState* play) { Matrix_Translate(0.0f, -4000.0f, 4000.0f, MTXMODE_APPLY); Matrix_RotateX(this->unk_394, MTXMODE_APPLY); Matrix_Translate(0.0f, 4000.0f, -4000.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_ganon2.c", 5910), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_boss_ganon2.c", 5910); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, BossGanon2_OverrideLimbDraw, BossGanon2_PostLimbDraw, this); @@ -2928,8 +3261,7 @@ void BossGanon2_DrawEffects(PlayState* play) { Matrix_Scale(0.03f, 0.03f, 0.03f, MTXMODE_APPLY); Matrix_RotateY(effect->unk_38.z, MTXMODE_APPLY); Matrix_RotateX(effect->unk_38.y, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_ganon2.c", 6116), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_boss_ganon2.c", 6116); gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_TexScroll(play->state.gfxCtx, 0, 0 - (play->gameplayFrames & 0x7F), 32, 32)); gSPDisplayList(POLY_OPA_DISP++, gGanonMasterSwordDL); @@ -2946,8 +3278,7 @@ void BossGanon2_DrawEffects(PlayState* play) { Matrix_Translate(effect->position.x + temp_f0, 1086.0f, (effect->position.z - 1.0f) + temp_f0, MTXMODE_NEW); Matrix_RotateY(angle, MTXMODE_APPLY); Matrix_Scale(1.0f, 0.0f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_ganon2.c", 6155), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_ganon2.c", 6155); gSPDisplayList(POLY_XLU_DISP++, gGanonMasterSwordShadowDL); } } @@ -2965,8 +3296,7 @@ void BossGanon2_DrawEffects(PlayState* play) { Matrix_RotateY(effect->unk_38.z, MTXMODE_APPLY); Matrix_RotateX(effect->unk_38.y, MTXMODE_APPLY); Matrix_RotateZ(effect->unk_38.x, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_ganon2.c", 6179), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_boss_ganon2.c", 6179); gSPDisplayList(POLY_OPA_DISP++, gGanonRubbleDL); } } @@ -2974,6 +3304,13 @@ void BossGanon2_DrawEffects(PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_boss_ganon2.c", 6185); } +static s16 D_80907188[] = { 1, 2, 3, 3, 2, 1 }; +static s16 D_80907194[] = { 2, 3, 4, 4, 4, 3, 2 }; +static s16 D_809071A4[] = { 2, 3, 4, 4, 4, 4, 3, 2 }; +static s16 D_809071B4[] = { 2, 4, 5, 5, 6, 6, 6, 6, 5, 5, 4, 2 }; +static s16 D_809071CC[] = { 1, -1, 1, 1, 3, 4, 1, 6, 7, 2, 9, 10, 2, 12, 13 }; +static u8 D_809071EC[] = { 3, 2, 2, 1, 3, 3, 1, 3, 3, 1, 0, 3, 1, 0, 3 }; + void func_80906538(BossGanon2* this, u8* shadowTexture, f32 arg2) { s16 temp_t0; s16 temp_v0; @@ -3085,8 +3422,7 @@ void BossGanon2_DrawShadowTexture(void* shadowTexture, BossGanon2* this, PlaySta gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); Matrix_Translate(this->actor.world.pos.x, this->actor.floorHeight, this->actor.world.pos.z - 20.0f, MTXMODE_NEW); Matrix_Scale(1.65f, 1.0f, 1.65f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gameState->gfxCtx, "../z_boss_ganon2.c", 6457), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gameState->gfxCtx, "../z_boss_ganon2.c", 6457); gSPDisplayList(POLY_OPA_DISP++, gGanonShadowMaterialDL); gDPLoadTextureBlock(POLY_OPA_DISP++, shadowTexture, G_IM_FMT_I, G_IM_SIZ_8b, 64, 64, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD); @@ -3094,3 +3430,8 @@ void BossGanon2_DrawShadowTexture(void* shadowTexture, BossGanon2* this, PlaySta CLOSE_DISPS(gfxCtx, "../z_boss_ganon2.c", 6479); } + +// padding +static u32 D_809071FC[2] = { 0 }; + +#include "assets/overlays/ovl_Boss_Ganon2/ovl_Boss_Ganon2.c" diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h index 2248b41350..4c4c6f6fbe 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h @@ -8,7 +8,7 @@ struct BossGanon2; typedef void (*BossGanon2ActionFunc)(struct BossGanon2*, PlayState*); -typedef enum { +typedef enum GanonLimb { /* 0 */ GANON_LIMB_NONE, /* 1 */ GANON_LIMB_ROOT, /* 2 */ GANON_LIMB_TORSO, diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2_data.inc.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2_data.inc.c deleted file mode 100644 index f31a974108..0000000000 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2_data.inc.c +++ /dev/null @@ -1,358 +0,0 @@ -#include "z_boss_ganon2.h" -#include "overlays/actors/ovl_En_Zl3/z_en_zl3.h" -#include "assets/objects/object_ganon2/object_ganon2.h" - -#define BOSS_GANON2_EFFECT_COUNT 100 - -typedef struct { - /* 0x00 */ u8 type; - /* 0x01 */ u8 unk_01; - /* 0x04 */ Vec3f position; - /* 0x10 */ Vec3f velocity; - /* 0x1C */ Vec3f accel; - /* 0x28 */ char unk_28[0x6]; - /* 0x2E */ s16 unk_2E; - /* 0x30 */ char unk_30[0x4]; - /* 0x34 */ f32 scale; - /* 0x38 */ Vec3f unk_38; -} BossGanon2Effect; // size = 0x44 - -static Vec3f D_80906D60 = { 0.0f, 0.0f, 0.0f }; - -static Vec3f D_80906D6C = { 0.0f, 0.0f, 500.0f }; - -static u8 D_80906D78 = 0; - -static ColliderJntSphElementInit sJntSphItemsInit1[] = { - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 0, { { 0, 0, 0 }, 30 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 30 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 2, { { 0, 0, 0 }, 30 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 3, { { 0, 0, 0 }, 20 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 4, { { 0, 0, 0 }, 20 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 5, { { 0, 0, 0 }, 20 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 6, { { 0, 0, 0 }, 20 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 7, { { 0, 0, 0 }, 20 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 8, { { 0, 0, 0 }, 20 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 9, { { 0, 0, 0 }, 20 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 10, { { 0, 0, 0 }, 20 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 11, { { 0, 0, 0 }, 20 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 12, { { 0, 0, 0 }, 20 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 13, { { 0, 0, 0 }, 20 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x10 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 14, { { 0, 0, 0 }, 20 }, 100 }, - }, - { - { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x00, 0x00 }, - { 0xFFCFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 15, { { 0, 0, 0 }, 30 }, 100 }, - }, -}; - -static ColliderJntSphInit sJntSphInit1 = { - { - COLTYPE_METAL, - AT_ON | AT_TYPE_ENEMY, - AC_ON | AC_TYPE_PLAYER, - OC1_ON | OC1_TYPE_PLAYER, - OC2_FIRST_ONLY | OC2_TYPE_1, - COLSHAPE_JNTSPH, - }, - ARRAY_COUNT(sJntSphItemsInit1), - sJntSphItemsInit1, -}; - -static ColliderJntSphElementInit sJntSphItemsInit2[] = { - { - { - ELEMTYPE_UNK2, - { 0xFFCFFFFF, 0x00, 0x40 }, - { 0xFFDFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 15, { { 0, 0, 0 }, 45 }, 100 }, - }, - { - { - ELEMTYPE_UNK2, - { 0xFFCFFFFF, 0x00, 0x40 }, - { 0xFFDFFFFF, 0x00, 0x00 }, - ATELEM_ON | ATELEM_SFX_NORMAL, - ACELEM_ON, - OCELEM_ON, - }, - { 16, { { 0, 0, 0 }, 45 }, 100 }, - }, -}; - -static ColliderJntSphInit sJntSphInit2 = { - { - COLTYPE_METAL, - AT_ON | AT_TYPE_ENEMY, - AC_ON | AC_TYPE_PLAYER, - OC1_ON | OC1_TYPE_PLAYER, - OC2_TYPE_1, - COLSHAPE_JNTSPH, - }, - ARRAY_COUNT(sJntSphItemsInit2), - sJntSphItemsInit2, -}; - -static Color_RGBA8 sPrimColor = { 0, 120, 0, 255 }; - -static Color_RGBA8 sEnvColor = { 0, 120, 0, 255 }; - -static Vec3f D_8090702C[] = { - { 10.0f, -10.0f, 0.0f }, - { 0.0f, 0.0f, -60.0f }, - { 70.0f, -30.0f, 10.0f }, -}; - -static Vec3f D_80907050[] = { - { -20.0f, 0.0f, 0.0f }, - { -15.0f, 0.0f, 10.0f }, - { -16.0f, -12.0f, 40.0f }, -}; - -static s16 D_80907074[] = { 0, 1, 2, 2, 1, 0 }; - -static s16 D_80907080 = 0; - -static u8 D_80907084[] = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 }; - -static u8 D_80907090[] = { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 }; - -static s8 D_8090709C[] = { - 0xFF, 0xFF, 0x01, 0xFF, 0x03, 0x04, 0xFF, 0xFF, 0x05, 0xFF, 0x06, 0x07, 0xFF, 0xFF, 0x08, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x00, 0xFF, 0xFF, 0x02, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0x00, -}; - -static s8 D_809070CC[] = { - 0xFF, 0xFF, 0x01, 0xFF, 0x03, 0x04, 0xFF, 0xFF, 0x05, 0xFF, 0x06, 0x07, 0xFF, 0xFF, 0x08, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x00, 0xFF, 0xFF, 0x02, 0x0C, 0x0D, 0x0E, 0x09, 0x0A, 0x0B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, -}; - -static Vec3f D_809070FC = { 0.0f, 0.0f, 5000.0f }; - -static Vec3f D_80907108 = { 0.0f, 2000.0f, 0.0f }; - -static Vec3f D_80907114 = { 0.0f, 2000.0f, 0.0f }; - -static Vec3f D_80907120 = { 0.0f, 0.0f, 17000.0f }; - -static Vec3f D_8090712C = { 0.0f, 0.0f, 3000.0f }; - -static Vec3f D_80907138 = { 0.0f, 0.0f, 0.0f }; - -static s8 D_80907144[] = { - 0xFF, 0xFF, 0x01, 0xFF, 0x03, 0x04, 0x05, 0xFF, 0x06, 0x07, 0x08, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0x02, 0x0C, 0x0D, 0x0E, 0x09, 0x0A, 0x0B, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, -}; - -static Vec3f D_80907164 = { 800.0f, 420.0f, 100.0f }; - -static void* sEyeTextures[] = { - gGanonEyeOpenTex, - gGanonEyeHalfTex, - gGanonEyeClosedTex, -}; - -static Vec3f D_8090717C = { 0.0f, -2000.0f, 0.0f }; - -static s16 D_80907188[] = { 1, 2, 3, 3, 2, 1 }; - -static s16 D_80907194[] = { 2, 3, 4, 4, 4, 3, 2 }; - -static s16 D_809071A4[] = { 2, 3, 4, 4, 4, 4, 3, 2 }; - -static s16 D_809071B4[] = { 2, 4, 5, 5, 6, 6, 6, 6, 5, 5, 4, 2 }; - -static s16 D_809071CC[] = { 1, -1, 1, 1, 3, 4, 1, 6, 7, 2, 9, 10, 2, 12, 13 }; - -static u8 D_809071EC[] = { 3, 2, 2, 1, 3, 3, 1, 3, 3, 1, 0, 3, 1, 0, 3 }; - -// padding -static u32 D_809071FC[2] = { 0 }; - -#include "assets/overlays/ovl_Boss_Ganon2/ovl_Boss_Ganon2.c" - -static Vec3f D_8090EB20; - -static EnZl3* sZelda; - -static Actor* D_8090EB30; - -// unused -static UNK_TYPE D_8090EB34; - -static BossGanon2Effect sEffects[BOSS_GANON2_EFFECT_COUNT]; - -static s32 sSeed1; -static s32 sSeed2; -static s32 sSeed3; - -// unused -static UNK_TYPE D_809105DC; - -static Vec3f D_809105D8[4]; - -static Vec3f D_80910608[4]; - -static s8 D_80910638; diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index dae6502be4..7a8f1a7bf6 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -12,9 +12,9 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) -typedef enum { +typedef enum BossGanondrofDeathState { /* 0 */ NOT_DEAD, /* 1 */ DEATH_START, /* 2 */ DEATH_THROES, @@ -24,24 +24,24 @@ typedef enum { /* 6 */ DEATH_FINISH } BossGanondrofDeathState; -typedef enum { +typedef enum BossGanondrofThrowAction { /* 0 */ THROW_NORMAL, /* 1 */ THROW_SLOW } BossGanondrofThrowAction; -typedef enum { +typedef enum BossGanondrofStunnedAction { /* 0 */ STUNNED_FALL, /* 1 */ STUNNED_GROUND } BossGanondrofStunnedAction; -typedef enum { +typedef enum BossGanondrofChargeAction { /* 0 */ CHARGE_WINDUP, /* 1 */ CHARGE_START, /* 2 */ CHARGE_ATTACK, /* 3 */ CHARGE_FINISH } BossGanondrofChargeAction; -typedef enum { +typedef enum BossGanondrofDeathAction { /* 0 */ DEATH_SPASM, /* 1 */ DEATH_LIMP, /* 2 */ DEATH_HUNCHED @@ -69,7 +69,7 @@ void BossGanondrof_Charge(BossGanondrof* this, PlayState* play); void BossGanondrof_Stunned(BossGanondrof* this, PlayState* play); void BossGanondrof_Death(BossGanondrof* this, PlayState* play); -ActorInit Boss_Ganondrof_InitVars = { +ActorProfile Boss_Ganondrof_Profile = { /**/ ACTOR_BOSS_GANONDROF, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -83,7 +83,7 @@ ActorInit Boss_Ganondrof_InitVars = { static ColliderCylinderInit sCylinderInitBody = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -91,7 +91,7 @@ static ColliderCylinderInit sCylinderInitBody = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -103,7 +103,7 @@ static ColliderCylinderInit sCylinderInitBody = { static ColliderCylinderInit sCylinderInitSpear = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -111,7 +111,7 @@ static ColliderCylinderInit sCylinderInitSpear = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x30 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -199,10 +199,10 @@ static void* sLimbTex_rgba16_16x32[] = { gPhantomGanonLimbTex_00AA80, gPhantomGa static void* sMouthTex_ci8_16x16[] = { gPhantomGanonMouthTex, gPhantomGanonSmileTex }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_5, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, NAVI_ENEMY_PHANTOM_GANON_PHASE_1, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 0, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 0, ICHAIN_STOP), }; static Vec3f sAudioVec = { 0.0f, 0.0f, 50.0f }; @@ -296,7 +296,7 @@ void BossGanondrof_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->colliderSpear); Collider_SetCylinder(play, &this->colliderBody, &this->actor, &sCylinderInitBody); Collider_SetCylinder(play, &this->colliderSpear, &this->actor, &sCylinderInitSpear); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if (Flags_GetClear(play, play->roomCtx.curRoom.num)) { Actor_Kill(&this->actor); Actor_Spawn(&play->actorCtx, play, ACTOR_DOOR_WARP1, GND_BOSSROOM_CENTER_X, GND_BOSSROOM_CENTER_Y, @@ -438,7 +438,7 @@ void BossGanondrof_Paintings(BossGanondrof* this, PlayState* play) { EnfHG* horseTemp; Animation_MorphToPlayOnce(&this->skelAnime, &gPhantomGanonRideSpearRaiseAnim, -2.0f); - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; horseTemp = (EnfHG*)this->actor.child; Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_FHG_FIRE, this->spearTip.x, this->spearTip.y, this->spearTip.z, 30, FHGFIRE_LIGHT_GREEN, 0, FHGFIRE_SPEAR_LIGHT); @@ -449,7 +449,7 @@ void BossGanondrof_Paintings(BossGanondrof* this, PlayState* play) { Animation_MorphToPlayOnce(&this->skelAnime, &gPhantomGanonRideSpearResetAnim, -2.0f); } else if (horse->bossGndSignal == FHG_RIDE) { Animation_MorphToLoop(&this->skelAnime, &gPhantomGanonRideAnim, -2.0f); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } PRINTF("RUN 3\n"); @@ -476,7 +476,7 @@ void BossGanondrof_Paintings(BossGanondrof* this, PlayState* play) { void BossGanondrof_SetupNeutral(BossGanondrof* this, f32 arg1) { Animation_MorphToLoop(&this->skelAnime, &gPhantomGanonNeutralAnim, arg1); this->actionFunc = BossGanondrof_Neutral; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->fwork[GND_FLOAT_SPEED] = 0.0f; this->timers[0] = (s16)(Rand_ZeroOne() * 64.0f) + 30; } @@ -773,7 +773,7 @@ void BossGanondrof_SetupBlock(BossGanondrof* this, PlayState* play) { } void BossGanondrof_Block(BossGanondrof* this, PlayState* play) { - this->colliderBody.base.colType = COLTYPE_METAL; + this->colliderBody.base.colMaterial = COL_MATERIAL_METAL; SkelAnime_Update(&this->skelAnime); this->actor.world.pos.x += this->actor.velocity.x; this->actor.world.pos.z += this->actor.velocity.z; @@ -802,7 +802,7 @@ void BossGanondrof_Charge(BossGanondrof* this, PlayState* play) { f32 dxCenter = thisx->world.pos.x - GND_BOSSROOM_CENTER_X; f32 dzCenter = thisx->world.pos.z - GND_BOSSROOM_CENTER_Z; - this->colliderBody.base.colType = COLTYPE_METAL; + this->colliderBody.base.colMaterial = COL_MATERIAL_METAL; SkelAnime_Update(&this->skelAnime); switch (this->work[GND_ACTION_STATE]) { case CHARGE_WINDUP: @@ -931,7 +931,7 @@ void BossGanondrof_SetupDeath(BossGanondrof* this, PlayState* play) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1); Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_DEAD); this->deathState = DEATH_START; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->work[GND_VARIANCE_TIMER] = 0; this->shockTimer = 50; } @@ -1298,7 +1298,7 @@ void BossGanondrof_Update(Actor* thisx, PlayState* play) { PRINTF("MOVE START %d\n", this->actor.params); this->actor.flags &= ~ACTOR_FLAG_10; - this->colliderBody.base.colType = COLTYPE_HIT3; + this->colliderBody.base.colMaterial = COL_MATERIAL_HIT3; if (this->killActor) { Actor_Kill(&this->actor); return; @@ -1520,7 +1520,6 @@ void BossGanondrof_Draw(Actor* thisx, PlayState* play) { BossGanondrof_PostLimbDraw, this); PRINTF("DRAW 22\n"); POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP); - if (1) {} CLOSE_DISPS(play->state.gfxCtx, "../z_boss_ganondrof.c", 3814); PRINTF("DRAW END %d\n", this->actor.params); } diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h index e334123a98..142aea02b6 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h @@ -15,7 +15,7 @@ typedef void (*BossGanondrofActionFunc)(struct BossGanondrof*, PlayState*); #define GND_BOSSROOM_CENTER_Y -33.0f #define GND_BOSSROOM_CENTER_Z -3315.0f -typedef enum { +typedef enum BossGanondrofFlyMode { /* 0 */ GND_FLY_PAINTING, /* 1 */ GND_FLY_NEUTRAL, /* 2 */ GND_FLY_VOLLEY, @@ -23,13 +23,13 @@ typedef enum { /* 4 */ GND_FLY_CHARGE } BossGanondrofFlyMode; -typedef enum { +typedef enum BossGanondrofEyeState { /* 0 */ GND_EYESTATE_NONE, /* 1 */ GND_EYESTATE_FADE, /* 2 */ GND_EYESTATE_BRIGHTEN } BossGanondrofEyeState; -typedef enum { +typedef enum BossGanondrofS16Var { /* 0 */ GND_VARIANCE_TIMER, /* 1 */ GND_US_1, /* 2 */ GND_US_2, @@ -51,7 +51,7 @@ typedef enum { /* 20 */ GND_SHORT_COUNT = 20 } BossGanondrofS16Var; -typedef enum { +typedef enum BossGanondrofF32Var { /* 0 */ GND_FLOAT_SPEED, /* 1 */ GND_END_FRAME, /* 2 */ GND_EYE_BRIGHTNESS, diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index bdbf0fcf03..9b52c8a52f 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -4,18 +4,18 @@ #include "overlays/actors/ovl_Door_Shutter/z_door_shutter.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) // IRIS_FOLLOW: gohma looks towards the player (iris rotation) // BONUS_IFRAMES: gain invincibility frames when the player does something (throwing things?), or // randomly (see BossGoma_UpdateEye) -typedef enum { +typedef enum GohmaEyeState { EYESTATE_IRIS_FOLLOW_BONUS_IFRAMES, // default, allows not drawing lens and iris when eye is closed EYESTATE_IRIS_NO_FOLLOW_NO_IFRAMES, EYESTATE_IRIS_FOLLOW_NO_IFRAMES } GohmaEyeState; -typedef enum { +typedef enum GohmaVisualState { VISUALSTATE_RED, // main/eye: red VISUALSTATE_DEFAULT, // main: greenish cyan, blinks with dark gray every 16 frames; eye: white VISUALSTATE_DEFEATED, // main/eye: dark gray @@ -49,7 +49,7 @@ void BossGoma_WallClimb(BossGoma* this, PlayState* play); void BossGoma_CeilingMoveToCenter(BossGoma* this, PlayState* play); void BossGoma_SpawnChildGohma(BossGoma* this, PlayState* play, s16 i); -ActorInit Boss_Goma_InitVars = { +ActorProfile Boss_Goma_Profile = { /**/ ACTOR_BOSS_GOMA, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -64,7 +64,7 @@ ActorInit Boss_Goma_InitVars = { static ColliderJntSphElementInit sColliderJntSphElementInit[13] = { { { - ELEMTYPE_UNK3, + ELEM_MATERIAL_UNK3, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -75,7 +75,7 @@ static ColliderJntSphElementInit sColliderJntSphElementInit[13] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -86,7 +86,7 @@ static ColliderJntSphElementInit sColliderJntSphElementInit[13] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -97,7 +97,7 @@ static ColliderJntSphElementInit sColliderJntSphElementInit[13] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -108,7 +108,7 @@ static ColliderJntSphElementInit sColliderJntSphElementInit[13] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -119,7 +119,7 @@ static ColliderJntSphElementInit sColliderJntSphElementInit[13] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -130,7 +130,7 @@ static ColliderJntSphElementInit sColliderJntSphElementInit[13] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -141,7 +141,7 @@ static ColliderJntSphElementInit sColliderJntSphElementInit[13] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -152,7 +152,7 @@ static ColliderJntSphElementInit sColliderJntSphElementInit[13] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -163,7 +163,7 @@ static ColliderJntSphElementInit sColliderJntSphElementInit[13] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -174,7 +174,7 @@ static ColliderJntSphElementInit sColliderJntSphElementInit[13] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -185,7 +185,7 @@ static ColliderJntSphElementInit sColliderJntSphElementInit[13] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -196,7 +196,7 @@ static ColliderJntSphElementInit sColliderJntSphElementInit[13] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -209,7 +209,7 @@ static ColliderJntSphElementInit sColliderJntSphElementInit[13] = { static ColliderJntSphInit sColliderJntSphInit = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -333,7 +333,7 @@ void BossGoma_ClearPixels(u8* clearPixelTable, s16 i) { } static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, NAVI_ENEMY_GOHMA, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_STOP), }; @@ -404,7 +404,7 @@ void BossGoma_SetupDefeated(BossGoma* this, PlayState* play) { this->noBackfaceCulling = false; this->framesUntilNextAction = 1200; this->actionState = 0; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); this->actor.speed = 0.0f; this->actor.shape.shadowScale = 0.0f; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1); @@ -627,7 +627,7 @@ void BossGoma_SetupEncounterState4(BossGoma* this, PlayState* play) { player = GET_PLAYER(play); this->actionState = 4; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; Cutscene_StartManual(play, &play->csCtx); Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1); this->subCamId = Play_CreateSubCamera(play); @@ -718,7 +718,7 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) { this->framesUntilNextAction = 50; this->timer = 80; this->frameCount = 0; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; FALLTHROUGH; case 2: // zoom on player from room center // room entrance, towards center @@ -2005,8 +2005,7 @@ s32 BossGoma_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f if (*dList != NULL) { Matrix_Push(); Matrix_Scale(this->eyeIrisScaleX, this->eyeIrisScaleY, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_goma.c", 4815), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_boss_goma.c", 4815); gSPDisplayList(POLY_OPA_DISP++, *dList); Matrix_Pop(); } @@ -2026,8 +2025,7 @@ s32 BossGoma_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f Matrix_Scale(this->tailLimbsScale[limbIndex - BOSSGOMA_LIMB_TAIL4], this->tailLimbsScale[limbIndex - BOSSGOMA_LIMB_TAIL4], this->tailLimbsScale[limbIndex - BOSSGOMA_LIMB_TAIL4], MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_goma.c", 4836), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_boss_goma.c", 4836); gSPDisplayList(POLY_OPA_DISP++, *dList); Matrix_Pop(); } diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h index 399fa722b1..5931f9ca3d 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h @@ -8,7 +8,7 @@ struct BossGoma; typedef void (*BossGomaActionFunc)(struct BossGoma*, PlayState*); -typedef enum { +typedef enum BossGomaLimb { /* 0 */ BOSSGOMA_LIMB_NONE, /* 1 */ BOSSGOMA_LIMB_ROOT1, /* 2 */ BOSSGOMA_LIMB_ROOT2, diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 94021d0ee1..1849c7e41e 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -10,7 +10,10 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "pal-1.0:128 pal-1.1:128" + +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) #define MO_WATER_LEVEL(play) play->colCtx.colHeader->waterBoxes[0].ySurface @@ -20,7 +23,7 @@ #define BOSS_MO_EFFECT_COUNT 300 -typedef struct { +typedef struct BossMoEffect { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f vel; /* 0x18 */ Vec3f accel; @@ -57,9 +60,9 @@ void BossMo_DrawEffects(BossMoEffect* effect, PlayState* play); void BossMo_SetupTentacle(BossMo* this, PlayState* play); void BossMo_Tentacle(BossMo* this, PlayState* play); -void BossMo_Unknown(void); +void BossMo_SfxTest(void); -typedef enum { +typedef enum BossMoEffectType { /* 0 */ MO_FX_NONE, /* 1 */ MO_FX_SMALL_RIPPLE, /* 2 */ MO_FX_BIG_RIPPLE, @@ -70,7 +73,7 @@ typedef enum { /* 7 */ MO_FX_BUBBLE } BossMoEffectType; -typedef enum { +typedef enum BossMoTentState { /* 0 */ MO_TENT_READY, /* 1 */ MO_TENT_SWING, /* 2 */ MO_TENT_ATTACK, @@ -90,7 +93,7 @@ typedef enum { /* 206 */ MO_TENT_DEATH_6 } BossMoTentState; -typedef enum { +typedef enum BossMoCoreState { /* -11 */ MO_CORE_UNUSED = -11, /* 0 */ MO_CORE_MOVE = 0, /* 1 */ MO_CORE_MAKE_TENT, @@ -102,7 +105,7 @@ typedef enum { /* 21 */ MO_CORE_INTRO_REVEAL } BossMoCoreState; -typedef enum { +typedef enum BossMoCsState { /* 0 */ MO_BATTLE, /* 1 */ MO_INTRO_WAIT, /* 2 */ MO_INTRO_START, @@ -118,7 +121,7 @@ typedef enum { /* 150 */ MO_DEATH_MO_CORE_BURST = 150 } BossMoCsState; -ActorInit Boss_Mo_InitVars = { +ActorProfile Boss_Mo_Profile = { /**/ ACTOR_BOSS_MO, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -188,7 +191,7 @@ s32 BossMo_NearLand(Vec3f* pos, f32 margin) { void BossMo_SpawnRipple(BossMoEffect* effect, Vec3f* pos, f32 scale, f32 maxScale, s16 maxAlpha, s16 countLimit, u8 type) { - static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; + static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; s16 i; for (i = 0; i < countLimit; i++, effect++) { @@ -196,8 +199,8 @@ void BossMo_SpawnRipple(BossMoEffect* effect, Vec3f* pos, f32 scale, f32 maxScal effect->stopTimer = 0; effect->type = type; effect->pos = *pos; - effect->vel = zeroVec; - effect->accel = zeroVec; + effect->vel = sZeroVec; + effect->accel = sZeroVec; effect->scale = scale * 0.0025f; effect->fwork[MO_FX_MAX_SIZE] = maxScale * 0.0025f; if (scale > 300.0f) { @@ -292,10 +295,10 @@ static s16 sAttackRot[41] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_5, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, NAVI_ENEMY_MORPHA, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 0, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 0, ICHAIN_STOP), }; static Vec3f sAudioZeroVec = { 0.0f, 0.0f, 0.0f }; @@ -335,7 +338,7 @@ void BossMo_Init(Actor* thisx, PlayState* play2) { Flags_SetSwitch(play, 0x14); sMorphaCore = this; MO_WATER_LEVEL(play) = this->waterLevel = MO_WATER_LEVEL(play); - play->roomCtx.unk_74[0] = 0xA0; + play->roomCtx.drawParams[0] = 0xA0; play->specialEffects = sEffects; for (i = 0; i < BOSS_MO_EFFECT_COUNT; i++) { sEffects[i].type = MO_FX_NONE; @@ -355,7 +358,7 @@ void BossMo_Init(Actor* thisx, PlayState* play2) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, 0.0f, -280.0f, 0.0f, 0, 0, 0, WARP_DUNGEON_ADULT); Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, -200.0f, -280.0f, 0.0f, 0, 0, 0, 0); - play->roomCtx.unk_74[0] = 0xFF; + play->roomCtx.drawParams[0] = 0xFF; MO_WATER_LEVEL(play) = -500; return; } @@ -378,7 +381,7 @@ void BossMo_Init(Actor* thisx, PlayState* play2) { } else { Actor_SetScale(&this->actor, 0.01f); BossMo_SetupTentacle(this, play); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; MO_WATER_LEVEL(play) = -50; this->waterTexAlpha = 90.0f; this->actor.world.pos.y = MO_WATER_LEVEL(play); @@ -524,7 +527,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { } switch (this->work[MO_TENT_ACTION_STATE]) { case MO_TENT_WAIT: - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if (this == sMorphaTent2) { this->work[MO_TENT_ACTION_STATE] = MO_TENT_SPAWN; this->timers[0] = 70; @@ -823,7 +826,8 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { player->actor.parent = NULL; player->csAction = PLAYER_CSACTION_NONE; if (this->timers[0] == 0) { - func_8002F6D4(play, &this->actor, 20.0f, this->actor.shape.rot.y + 0x8000, 10.0f, 0); + Actor_SetPlayerKnockbackLarge(play, &this->actor, 20.0f, this->actor.shape.rot.y + 0x8000, + 10.0f, 0); } } this->timers[0] = 75; @@ -917,7 +921,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { Vec3f spFC; Vec3f spF0; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Math_ApproachF(&this->baseAlpha, 0.0, 1.0f, 5.0f); for (indS1 = 0; indS1 < 40; indS1++) { indS0 = sTentSpawnIndex[(s16)Rand_ZeroFloat(20.9f)]; @@ -961,7 +965,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { } break; case MO_TENT_DESPAWN: - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Math_ApproachF(&this->baseAlpha, 0, 1.0f, 5.0f); if ((this->baseAlpha <= 0.5f) && (this->timers[0] == 0)) { this->meltIndex = 0; @@ -988,7 +992,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { case MO_TENT_DEATH_3: this->baseBubblesTimer = 20; Math_ApproachF(&sMorphaCore->waterLevel, -300.0f, 0.1f, 0.8f); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; for (indS1 = 0; indS1 < 41; indS1++) { sin = Math_SinS(((s16)this->fwork[MO_TENT_SWING_LAG_X] * indS1) + this->xSwing); tempf1 = this->fwork[MO_TENT_SWING_SIZE_X] * (indS1 * 0.025f * sin); @@ -1355,8 +1359,8 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) { this->subCamFov = 60.0f; this->actor.world.pos = sMorphaTent1->actor.world.pos; this->work[MO_TENT_ACTION_STATE] = MO_CORE_INTRO_REVEAL; - this->actor.flags &= ~ACTOR_FLAG_0; - sMorphaTent1->actor.flags |= ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; + sMorphaTent1->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; goto intro_reveal; } sMorphaTent1->xSwing = 0xCEC; @@ -1567,7 +1571,7 @@ void BossMo_DeathCs(BossMo* this, PlayState* play) { Rand_ZeroFloat(0.08f) + 0.13f); } this->drawActor = false; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Actor_PlaySfx(&this->actor, NA_SE_EN_MOFER_CORE_JUMP); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 70, NA_SE_EN_MOFER_LASTVOICE); } @@ -1709,9 +1713,9 @@ void BossMo_DeathCs(BossMo* this, PlayState* play) { } } if (sMorphaCore->waterLevel < -200.0f) { - play->roomCtx.unk_74[0]++; - if (play->roomCtx.unk_74[0] >= 0xFF) { - play->roomCtx.unk_74[0] = 0xFF; + play->roomCtx.drawParams[0]++; + if (play->roomCtx.drawParams[0] >= 0xFF) { + play->roomCtx.drawParams[0] = 0xFF; } } if (sMorphaCore->waterLevel < -250.0f) { @@ -1808,7 +1812,7 @@ void BossMo_CoreCollisionCheck(BossMo* this, PlayState* play) { sMorphaTent1->cutScale = 1.0f; sMorphaTent1->work[MO_TENT_ACTION_STATE] = MO_TENT_CUT; sMorphaTent1->timers[0] = 40; - sMorphaTent1->actor.flags &= ~ACTOR_FLAG_0; + sMorphaTent1->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if (player->actor.parent == &sMorphaTent1->actor) { player->av2.actionVar2 = 0x65; player->actor.parent = NULL; @@ -1875,7 +1879,7 @@ void BossMo_Core(BossMo* this, PlayState* play) { if ((this->csState != MO_BATTLE) && (this->csState < MO_DEATH_START)) { BossMo_IntroCs(this, play); if (this->work[MO_TENT_ACTION_STATE] == MO_CORE_INTRO_WAIT) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; return; } } else if (this->csState >= MO_DEATH_START) { @@ -1908,7 +1912,7 @@ void BossMo_Core(BossMo* this, PlayState* play) { } switch (this->work[MO_TENT_ACTION_STATE]) { case MO_CORE_MOVE: - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; if ((this->timers[0] == 0) && ((sMorphaTent1->work[MO_TENT_ACTION_STATE] == MO_TENT_WAIT) || (sMorphaTent1->work[MO_TENT_ACTION_STATE] == MO_TENT_READY)) && @@ -1947,7 +1951,7 @@ void BossMo_Core(BossMo* this, PlayState* play) { } break; case MO_CORE_STUNNED: - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; if (this->timers[0] == 0) { this->work[MO_TENT_ACTION_STATE] = MO_CORE_MOVE; this->timers[0] = 30; @@ -1964,7 +1968,7 @@ void BossMo_Core(BossMo* this, PlayState* play) { if (this->timers[0] == 0) { switch (this->work[MO_TENT_ACTION_STATE]) { case MO_CORE_ATTACK: - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->work[MO_CORE_POS_IN_TENT]++; if (sMorphaTent1->work[MO_TENT_ACTION_STATE] == MO_TENT_ATTACK) { temp = (s16)(Math_SinS(this->work[MO_TENT_MOVE_TIMER] * 0x300) * 10.0f) + 15; @@ -1989,7 +1993,7 @@ void BossMo_Core(BossMo* this, PlayState* play) { this->timers[0] = 0; break; case MO_CORE_INTRO_REVEAL: - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->work[MO_CORE_POS_IN_TENT]++; temp = (s16)(Math_SinS(this->work[MO_TENT_MOVE_TIMER] * 0x500) * 10.0f) + 15; if (this->work[MO_CORE_POS_IN_TENT] >= temp) { @@ -2256,9 +2260,12 @@ void BossMo_UpdateCore(Actor* thisx, PlayState* play) { } BossMo_UpdateEffects(this, play); if (player->actor.parent != NULL) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } - BossMo_Unknown(); + +#if !PLATFORM_N64 + BossMo_SfxTest(); +#endif } void BossMo_UpdateTent(Actor* thisx, PlayState* play) { @@ -2440,7 +2447,7 @@ static Gfx* sTentDLists[41] = { }; void BossMo_DrawTentacle(BossMo* this, PlayState* play) { - static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; + static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; s16 i; s16 notCut; s16 index; @@ -2532,17 +2539,16 @@ void BossMo_DrawTentacle(BossMo* this, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(phi_f22, phi_f22, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_mo.c", 6511), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_boss_mo.c", 6511); gSPDisplayList(POLY_OPA_DISP++, gMorphaBubbleDL); Matrix_Pop(); } - Matrix_MultVec3f(&zeroVec, &this->tentPos[i]); + Matrix_MultVec3f(&sZeroVec, &this->tentPos[i]); if (i == 36) { - Matrix_MultVec3f(&zeroVec, &this->actor.focus.pos); + Matrix_MultVec3f(&sZeroVec, &this->actor.focus.pos); } if (i == 24) { MtxF sp98; @@ -2592,8 +2598,7 @@ void BossMo_DrawWater(BossMo* this, PlayState* play) { gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, 80); Matrix_Scale(0.5f, 1.0f, 0.5f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_mo.c", 6675), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_mo.c", 6675); gSPDisplayList(POLY_XLU_DISP++, gMorphaWaterDL); @@ -2623,8 +2628,7 @@ void BossMo_DrawCore(Actor* thisx, PlayState* play) { Matrix_RotateX(this->work[MO_TENT_MOVE_TIMER] * 0.5f, MTXMODE_APPLY); Matrix_RotateZ(this->work[MO_TENT_MOVE_TIMER] * 0.8f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_mo.c", 6735), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_mo.c", 6735); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 255, (s8)this->baseAlpha); @@ -2661,8 +2665,7 @@ void BossMo_DrawCore(Actor* thisx, PlayState* play) { Matrix_Translate(this->actor.world.pos.x, groundLevel, this->actor.world.pos.z, MTXMODE_NEW); Matrix_Scale(0.23f, 1.0f, 0.23f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_mo.c", 6820), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_mo.c", 6820); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gCircleShadowDL)); } @@ -2720,8 +2723,7 @@ void BossMo_DrawCore(Actor* thisx, PlayState* play) { Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY); Matrix_Scale(0.05f, 1.0f, 0.05f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_mo.c", 6941), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_mo.c", 6941); gSPDisplayList(POLY_XLU_DISP++, gMorphaWaterDL); } @@ -2753,7 +2755,6 @@ void BossMo_DrawTent(Actor* thisx, PlayState* play) { if (this->drawActor) { BossMo_DrawTentacle(this, play); } - if (1) {} CLOSE_DISPS(play->state.gfxCtx, "../z_boss_mo.c", 7023); } @@ -2934,8 +2935,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, PlayState* play) { Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_Scale(effect->scale, 1.0f, effect->scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_mo.c", 7294), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_mo.c", 7294); gSPDisplayList(POLY_XLU_DISP++, gEffWaterRippleDL); } @@ -2957,8 +2957,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, PlayState* play) { Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_Scale(effect->scale, 1.0f, effect->scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_mo.c", 7330), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_mo.c", 7330); gSPDisplayList(POLY_XLU_DISP++, gEffShockwaveDL); } @@ -2986,8 +2985,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->scale / effect->fwork[MO_FX_STRETCH], effect->fwork[MO_FX_STRETCH] * effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_mo.c", 7373), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_mo.c", 7373); gSPDisplayList(POLY_XLU_DISP++, gMorphaDropletModelDL); } @@ -3012,8 +3010,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, PlayState* play) { Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_Scale(effect->scale, 1.0f, effect->scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_mo.c", 7441), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_mo.c", 7441); gSPDisplayList(POLY_XLU_DISP++, gMorphaWetSpotModelDL); } @@ -3036,8 +3033,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, PlayState* play) { Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_mo.c", 7476), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_boss_mo.c", 7476); gSPDisplayList(POLY_OPA_DISP++, gMorphaBubbleDL); } @@ -3047,9 +3043,10 @@ void BossMo_DrawEffects(BossMoEffect* effect, PlayState* play) { CLOSE_DISPS(gfxCtx, "../z_boss_mo.c", 7482); } -void BossMo_Unknown(void) { +#if !PLATFORM_N64 +void BossMo_SfxTest(void) { // Appears to be a test function for sound effects. - static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; + static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; static u16 unkSfx[] = { // Walking NA_SE_PL_WALK_GROUND + SURFACE_SFX_OFFSET_DIRT, @@ -3593,10 +3590,11 @@ void BossMo_Unknown(void) { if (BREG(32) != 0) { BREG(32)--; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1); - Sfx_PlaySfxAtPos(&zeroVec, unkSfx[BREG(33)]); + Sfx_PlaySfxAtPos(&sZeroVec, unkSfx[BREG(33)]); } if (BREG(34) != 0) { BREG(34) = 0; SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, BREG(35)); } } +#endif diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h index 310a45ce9c..1b7641817e 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h @@ -8,7 +8,7 @@ struct BossMo; typedef void (*BossMoActionFunc)(struct BossMo*, PlayState*); -typedef enum { +typedef enum BossMoTentS16Var { /* 0 */ MO_TENT_ACTION_STATE, /* 1 */ MO_TENT_MOVE_TIMER, /* 2 */ MO_TENT_VAR_TIMER, @@ -21,7 +21,7 @@ typedef enum { /* 9 */ MO_TENT_SHORT_MAX } BossMoTentS16Var; -typedef enum { +typedef enum BossMoCoreS16Var { /* 0 */ MO_CORE_ACTION_STATE, /* 1 */ MO_CORE_MOVE_TIMER, /* 2 */ MO_CORE_VAR_TIMER, @@ -34,7 +34,7 @@ typedef enum { /* 9 */ MO_CORE_SHORT_MAX } BossMoCoreS16Var; -typedef enum { +typedef enum BossMoTentF32Var { /* 0 */ MO_TENT_SWING_LAG_X, /* 1 */ MO_TENT_SWING_SIZE_X, /* 2 */ MO_TENT_SWING_RATE_X, @@ -45,7 +45,7 @@ typedef enum { /* 7 */ MO_TENT_FLOAT_MAX } BossMoTentF32Var; -typedef enum { +typedef enum BossMoCoreF32Var { /* 0 */ MO_CORE_INTRO_WATER_ALPHA, /* 1 */ MO_CORE_FLOAT_MAX } BossMoCoreF32Var; diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo_colchk.inc.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo_colchk.inc.c index 0ae73dadb6..58d807607c 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo_colchk.inc.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo_colchk.inc.c @@ -4,7 +4,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -15,7 +15,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -26,7 +26,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -37,7 +37,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -48,7 +48,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -59,7 +59,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -70,7 +70,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -81,7 +81,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -92,7 +92,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -103,7 +103,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -114,7 +114,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -125,7 +125,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -136,7 +136,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -147,7 +147,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -158,7 +158,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -169,7 +169,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -180,7 +180,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -191,7 +191,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -202,7 +202,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { }, { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -215,7 +215,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[19] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -228,7 +228,7 @@ static ColliderJntSphInit sJntSphInit = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -236,7 +236,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFDFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index dd2136039d..85b20fa613 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -5,12 +5,16 @@ */ #include "z_boss_sst.h" +#include "versions.h" #include "assets/objects/object_sst/object_sst.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_10) +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "pal-1.0:128 pal-1.1:128" + +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_10) #define vParity actionVar #define vVanish actionVar @@ -24,7 +28,7 @@ #define ROOM_CENTER_Y 0.0f #define ROOM_CENTER_Z 0.0f -typedef enum { +typedef enum BossSstHandState { /* 0 */ HAND_WAIT, /* 1 */ HAND_BEAT, /* 2 */ HAND_RETREAT, @@ -39,7 +43,7 @@ typedef enum { /* 11 */ HAND_DEATH } BossSstHandState; -typedef enum { +typedef enum BossSstEffectMode { /* 0 */ BONGO_NULL, /* 1 */ BONGO_ICE, /* 2 */ BONGO_SHOCKWAVE, @@ -49,7 +53,7 @@ typedef enum { void BossSst_Init(Actor* thisx, PlayState* play2); void BossSst_Destroy(Actor* thisx, PlayState* play); void BossSst_UpdateHand(Actor* thisx, PlayState* play); -void BossSst_UpdateHead(Actor* thisx, PlayState* play); +void BossSst_UpdateHead(Actor* thisx, PlayState* play2); void BossSst_DrawHand(Actor* thisx, PlayState* play); void BossSst_DrawHead(Actor* thisx, PlayState* play); void BossSst_UpdateEffects(Actor* thisx, PlayState* play); @@ -234,7 +238,7 @@ static Color_RGBA8 sBodyColor = { 255, 255, 255, 255 }; static Color_RGBA8 sStaticColor = { 0, 0, 0, 255 }; static s32 sHandState[] = { HAND_WAIT, HAND_WAIT }; -ActorInit Boss_Sst_InitVars = { +ActorProfile Boss_Sst_Profile = { /**/ ACTOR_BOSS_SST, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -259,7 +263,7 @@ static AnimationHeader* sHandHangPoses[] = { &gBongoLeftHandHangPoseAnim, &gBong static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_BONGO_BONGO, ICHAIN_CONTINUE), - ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_5, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 20, ICHAIN_STOP), }; @@ -302,11 +306,11 @@ void BossSst_Init(Actor* thisx, PlayState* play2) { sHands[LEFT]->actor.child = &sHands[RIGHT]->actor; sHands[RIGHT]->actor.child = &sHands[LEFT]->actor; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.update = BossSst_UpdateHead; this->actor.draw = BossSst_DrawHead; this->radius = -650.0f; - this->actor.targetArrowOffset = 4000.0f; + this->actor.lockOnArrowOffset = 4000.0f; BossSst_HeadSetupLurk(this); Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_BOSS); } @@ -326,8 +330,8 @@ void BossSst_Init(Actor* thisx, PlayState* play2) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 95.0f); this->handZPosMod = -3500; - this->actor.targetArrowOffset = 5000.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.lockOnArrowOffset = 5000.0f; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; BossSst_HandSetupWait(this); } } @@ -365,7 +369,7 @@ void BossSst_HeadSetupIntro(BossSst* this, PlayState* play) { player->actor.world.pos.z = sRoomCenter.z; player->speedXZ = 0.0f; player->actor.shape.rot.y = -0x8000; - player->zTargetYaw = -0x8000; + player->parallelYaw = -0x8000; player->yaw = -0x8000; player->actor.velocity.y = 0.0f; player->fallStartHeight = 0; @@ -401,8 +405,8 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) { } if (this->timer == 0) { - sHands[RIGHT]->actor.flags |= ACTOR_FLAG_0; - sHands[LEFT]->actor.flags |= ACTOR_FLAG_0; + sHands[RIGHT]->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; + sHands[LEFT]->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; player->stateFlags1 &= ~PLAYER_STATE1_5; Cutscene_StopManual(play, &play->csCtx); Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_7); @@ -425,7 +429,7 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) { player->actor.world.pos.z = sRoomCenter.z; player->speedXZ = 0; player->actor.shape.rot.y = -0x8000; - player->zTargetYaw = -0x8000; + player->parallelYaw = -0x8000; player->yaw = -0x8000; } @@ -658,7 +662,7 @@ void BossSst_HeadNeutral(BossSst* this, PlayState* play) { Player* player = GET_PLAYER(play); if ((player->actor.world.pos.y > -50.0f) && - !(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14))) { + !(player->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_13 | PLAYER_STATE1_14))) { sHands[Rand_ZeroOne() <= 0.5f]->ready = true; BossSst_HeadSetupWait(this); } else { @@ -766,7 +770,7 @@ void BossSst_HeadCharge(BossSst* this, PlayState* play) { this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); sHands[LEFT]->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); sHands[RIGHT]->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); - func_8002F71C(play, &this->actor, 10.0f, this->actor.shape.rot.y, 5.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 10.0f, this->actor.shape.rot.y, 5.0f); Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_BODY_HIT); } } @@ -1055,8 +1059,8 @@ void BossSst_HeadDeath(BossSst* this, PlayState* play) { player->actor.world.pos.z = sRoomCenter.z + (400.0f * Math_CosS(this->actor.shape.rot.y)) - (Math_SinS(this->actor.shape.rot.y) * -120.0f); player->actor.shape.rot.y = Actor_WorldYawTowardPoint(&player->actor, &sRoomCenter); - func_8002DBD0(&this->actor, &sSubCamEye, &GET_ACTIVE_CAM(play)->eye); - func_8002DBD0(&this->actor, &sSubCamAt, &GET_ACTIVE_CAM(play)->at); + Actor_WorldToActorCoords(&this->actor, &sSubCamEye, &GET_ACTIVE_CAM(play)->eye); + Actor_WorldToActorCoords(&this->actor, &sSubCamAt, &GET_ACTIVE_CAM(play)->at); this->radius = -350.0f; this->actor.world.pos.x = sRoomCenter.x - (Math_SinS(this->actor.shape.rot.y) * 350.0f); this->actor.world.pos.z = sRoomCenter.z - (Math_CosS(this->actor.shape.rot.y) * 350.0f); @@ -1247,7 +1251,7 @@ void BossSst_HandWait(BossSst* this, PlayState* play) { } if ((this->timer == 0) && (player->actor.world.pos.y > -50.0f) && - !(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14))) { + !(player->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_13 | PLAYER_STATE1_14))) { BossSst_HandSelectAttack(this); } } else if (sHead->actionFunc == BossSst_HeadNeutral) { @@ -1399,7 +1403,7 @@ void BossSst_HandSetupRetreat(BossSst* this) { Animation_MorphToPlayOnce(&this->skelAnime, sHandHangPoses[this->actor.params], 10.0f); this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); this->colliderJntSph.base.acFlags |= AC_ON; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; BossSst_HandSetInvulnerable(this, false); this->timer = 0; this->actionFunc = BossSst_HandRetreat; @@ -1431,7 +1435,7 @@ void BossSst_HandRetreat(BossSst* this, PlayState* play) { inPosition = Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x200); inPosition &= Math_ScaledStepToS(&this->actor.shape.rot.z, this->actor.home.rot.z, 0x200); inPosition &= Math_ScaledStepToS(&this->handYRotMod, 0, 0x800); - func_8002F974(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); if ((Math_SmoothStepToF(&this->actor.world.pos.y, ROOM_CENTER_Y + 250.0f, 0.5f, 70.0f, 5.0f) < 1.0f) && inPosition && (diff < 10.0f)) { this->timer = 8; @@ -1466,7 +1470,7 @@ void BossSst_HandReadySlam(BossSst* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.x, -0x1000, 0x100); Math_ApproachF(&this->actor.world.pos.x, player->actor.world.pos.x, 0.5f, 40.0f); Math_ApproachF(&this->actor.world.pos.z, player->actor.world.pos.z, 0.5f, 40.0f); - func_8002F974(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); } } @@ -1521,7 +1525,7 @@ void BossSst_HandSlam(BossSst* this, PlayState* play) { player->actor.world.pos.z = (Math_CosS(this->actor.yawTowardsPlayer) * 100.0f) + this->actor.world.pos.z; this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); - func_8002F71C(play, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 0.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 0.0f); } Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x200); @@ -1551,7 +1555,7 @@ void BossSst_HandReadySweep(BossSst* this, PlayState* play) { if (inPosition) { BossSst_HandSetupSweep(this); } else { - func_8002F974(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); } } @@ -1581,7 +1585,8 @@ void BossSst_HandSweep(BossSst* this, PlayState* play) { this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); this->ready = true; - func_8002F71C(play, &this->actor, 5.0f, this->actor.shape.rot.y - (this->vParity * 0x3800), 0.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 5.0f, + this->actor.shape.rot.y - (this->vParity * 0x3800), 0.0f); Player_PlaySfx(player, NA_SE_PL_BODY_HIT); newTargetYaw = this->actor.shape.rot.y - (this->vParity * 0x1400); if (((s16)(newTargetYaw - this->targetYaw) * this->vParity) > 0) { @@ -1640,11 +1645,11 @@ void BossSst_HandPunch(BossSst* this, PlayState* play) { BossSst_HandSetupRetreat(this); } else if (this->colliderJntSph.base.atFlags & AT_HIT) { Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_BODY_HIT); - func_8002F71C(play, &this->actor, 10.0f, this->actor.shape.rot.y, 5.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 10.0f, this->actor.shape.rot.y, 5.0f); BossSst_HandSetupRetreat(this); } - func_8002F974(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); } void BossSst_HandSetupReadyClap(BossSst* this) { @@ -1744,7 +1749,7 @@ void BossSst_HandClap(BossSst* this, PlayState* play) { } this->ready = true; } else { - func_8002F974(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); } this->actor.world.pos.x = (Math_SinS(this->actor.shape.rot.y) * this->radius) + sHead->actor.world.pos.x; @@ -1835,7 +1840,7 @@ void BossSst_HandGrab(BossSst* this, PlayState* play) { } else { this->actor.speed *= 1.26f; this->actor.speed = CLAMP_MAX(this->actor.speed, 70.0f); - func_8002F974(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); } if (this->colliderJntSph.base.atFlags & AT_HIT) { @@ -1958,11 +1963,11 @@ void BossSst_HandSwing(BossSst* this, PlayState* play) { BossSst_HandReleasePlayer(this, play, false); player->actor.world.pos.x += 70.0f * Math_SinS(this->actor.shape.rot.y); player->actor.world.pos.z += 70.0f * Math_CosS(this->actor.shape.rot.y); - func_8002F71C(play, &this->actor, 15.0f, this->actor.shape.rot.y, 2.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 15.0f, this->actor.shape.rot.y, 2.0f); Player_PlaySfx(player, NA_SE_PL_BODY_HIT); } - func_8002F974(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); } void BossSst_HandSetupReel(BossSst* this) { @@ -2023,7 +2028,7 @@ void BossSst_HandReadyShake(BossSst* this, PlayState* play) { if ((diff < 30.0f) && inPosition) { BossSst_HandSetupShake(this); } else { - func_8002F974(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); } } @@ -2053,7 +2058,7 @@ void BossSst_HandShake(BossSst* this, PlayState* play) { this->timer = 80; } } else if (this->timer == 0) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; BossSst_HandSetupSlam(this); } } @@ -2080,7 +2085,7 @@ void BossSst_HandReadyCharge(BossSst* this, PlayState* play) { this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); OTHER_HAND(this)->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); sHead->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); - func_8002F71C(play, &this->actor, 10.0f, this->actor.shape.rot.y, 5.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 10.0f, this->actor.shape.rot.y, 5.0f); Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_BODY_HIT); } } @@ -2278,7 +2283,7 @@ void BossSst_HandRecover(BossSst* this, PlayState* play) { this->ready = true; } } - func_8002F974(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); } void BossSst_HandSetupFrozen(BossSst* this) { @@ -2404,7 +2409,7 @@ void BossSst_HandBreakIce(BossSst* this, PlayState* play) { BossSst_HandSetupRetreat(this); } - func_8002F974(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); } void BossSst_HandGrabPlayer(BossSst* this, PlayState* play) { @@ -2430,7 +2435,7 @@ void BossSst_HandReleasePlayer(BossSst* this, PlayState* play, s32 dropPlayer) { this->colliderJntSph.base.ocFlags1 |= OC1_ON; OTHER_HAND(this)->colliderJntSph.base.ocFlags1 |= OC1_ON; if (dropPlayer) { - func_8002F71C(play, &this->actor, 0.0f, this->actor.shape.rot.y, 0.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 0.0f, this->actor.shape.rot.y, 0.0f); } } } @@ -2507,10 +2512,10 @@ void BossSst_HandSetDamage(BossSst* this, s32 damage) { void BossSst_HandSetInvulnerable(BossSst* this, s32 isInv) { this->colliderJntSph.base.acFlags &= ~AC_HIT; if (isInv) { - this->colliderJntSph.base.colType = COLTYPE_HARD; + this->colliderJntSph.base.colMaterial = COL_MATERIAL_HARD; this->colliderJntSph.base.acFlags |= AC_HARD; } else { - this->colliderJntSph.base.colType = COLTYPE_HIT0; + this->colliderJntSph.base.colMaterial = COL_MATERIAL_HIT0; this->colliderJntSph.base.acFlags &= ~AC_HARD; } } @@ -2520,7 +2525,7 @@ void BossSst_HeadSfx(BossSst* this, u16 sfxId) { } void BossSst_HandCollisionCheck(BossSst* this, PlayState* play) { - if ((this->colliderJntSph.base.acFlags & AC_HIT) && (this->colliderJntSph.base.colType != COLTYPE_HARD)) { + if ((this->colliderJntSph.base.acFlags & AC_HIT) && (this->colliderJntSph.base.colMaterial != COL_MATERIAL_HARD)) { s32 bothHands = true; this->colliderJntSph.base.acFlags &= ~AC_HIT; @@ -2534,7 +2539,7 @@ void BossSst_HandCollisionCheck(BossSst* this, PlayState* play) { BossSst_HandSetupRetreat(OTHER_HAND(this)); } - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if (this->actor.colChkInfo.damageEffect == 3) { BossSst_HandSetupFrozen(this); } else { @@ -2604,10 +2609,16 @@ void BossSst_UpdateHand(Actor* thisx, PlayState* play) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderJntSph.base); } +#if OOT_VERSION < NTSC_1_2 + if (this->colliderJntSph.base.acFlags & AC_ON) { + CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base); + } +#else if ((sHead->actionFunc != BossSst_HeadLurk) && (sHead->actionFunc != BossSst_HeadIntro) && (this->colliderJntSph.base.acFlags & AC_ON)) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base); } +#endif if (this->colliderJntSph.base.ocFlags1 & OC1_ON) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base); @@ -2636,12 +2647,12 @@ void BossSst_UpdateHand(Actor* thisx, PlayState* play) { BossSst_UpdateEffects(&this->actor, play); } -void BossSst_UpdateHead(Actor* thisx, PlayState* play) { - s32 pad; +void BossSst_UpdateHead(Actor* thisx, PlayState* play2) { + PlayState* play = (PlayState*)play2; BossSst* this = (BossSst*)thisx; - func_8002DBD0(&this->actor, &sHandOffsets[RIGHT], &sHands[RIGHT]->actor.world.pos); - func_8002DBD0(&this->actor, &sHandOffsets[LEFT], &sHands[LEFT]->actor.world.pos); + Actor_WorldToActorCoords(&this->actor, &sHandOffsets[RIGHT], &sHands[RIGHT]->actor.world.pos); + Actor_WorldToActorCoords(&this->actor, &sHandOffsets[LEFT], &sHands[LEFT]->actor.world.pos); sHandYawOffsets[LEFT] = sHands[LEFT]->actor.shape.rot.y - thisx->shape.rot.y; sHandYawOffsets[RIGHT] = sHands[RIGHT]->actor.shape.rot.y - thisx->shape.rot.y; @@ -2660,12 +2671,19 @@ void BossSst_UpdateHead(Actor* thisx, PlayState* play) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderJntSph.base); } +#if OOT_VERSION < NTSC_1_2 + if (this->colliderCyl.base.acFlags & AC_ON) { + CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCyl.base); + } + CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base); +#else if ((this->actionFunc != BossSst_HeadLurk) && (this->actionFunc != BossSst_HeadIntro)) { if (this->colliderCyl.base.acFlags & AC_ON) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCyl.base); } CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base); } +#endif if (this->colliderJntSph.base.ocFlags1 & OC1_ON) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base); @@ -2676,9 +2694,9 @@ void BossSst_UpdateHead(Actor* thisx, PlayState* play) { ((this->actionFunc == BossSst_HeadReadyCharge) || (this->actionFunc == BossSst_HeadCharge) || (this->actionFunc == BossSst_HeadFrozenHand) || (this->actionFunc == BossSst_HeadStunned) || (this->actionFunc == BossSst_HeadVulnerable) || (this->actionFunc == BossSst_HeadDamage))) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } else { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } if (this->actionFunc == BossSst_HeadCharge) { @@ -2914,8 +2932,7 @@ void BossSst_DrawHead(Actor* thisx, PlayState* play) { this->actor.world.pos.z + vanishMaskOffset.z, MTXMODE_NEW); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_sst.c", 6934), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_sst.c", 6934); gSPDisplayList(POLY_XLU_DISP++, sIntroVanishDList); } @@ -3150,7 +3167,7 @@ void BossSst_UpdateEffects(Actor* thisx, PlayState* play) { } void BossSst_DrawEffects(Actor* thisx, PlayState* play) { - s32 pad; + PlayState* play2 = (PlayState*)play; BossSst* this = (BossSst*)thisx; s32 i; BossSstEffect* effect; @@ -3161,15 +3178,15 @@ void BossSst_DrawEffects(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); if (this->effectMode == BONGO_ICE) { gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, play->gameplayFrames % 256, 0x20, 0x10, - 1, 0, (play->gameplayFrames * 2) % 256, 0x40, 0x20)); + Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, play2->gameplayFrames % 256, 0x20, 0x10, + 1, 0, (play2->gameplayFrames * 2) % 256, 0x40, 0x20)); gDPSetEnvColor(POLY_XLU_DISP++, 0, 50, 100, this->effects[0].alpha); gSPDisplayList(POLY_XLU_DISP++, gBongoIceCrystalDL); for (i = 0; i < 18; i++) { effect = &this->effects[i]; if (effect->move) { - func_8003435C(&effect->pos, play); + func_8003435C(&effect->pos, play2); if (this->effects[0].status != 0) { Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); } else { @@ -3181,8 +3198,7 @@ void BossSst_DrawEffects(Actor* thisx, PlayState* play) { Matrix_RotateZYX(effect->rot.x, effect->rot.y, effect->rot.z, MTXMODE_APPLY); Matrix_Scale(effect->scale * 0.001f, effect->scale * 0.001f, effect->scale * 0.001f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_sst.c", 7350), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_sst.c", 7350); gSPDisplayList(POLY_XLU_DISP++, gBongoIceShardDL); } } @@ -3191,8 +3207,8 @@ void BossSst_DrawEffects(Actor* thisx, PlayState* play) { gDPPipeSync(POLY_XLU_DISP++); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play->gameplayFrames % 128, 0, 0x20, 0x40, - 1, 0, (play->gameplayFrames * -15) % 256, 0x20, 0x40)); + Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play2->gameplayFrames % 128, 0, 0x20, 0x40, + 1, 0, (play2->gameplayFrames * -15) % 256, 0x20, 0x40)); for (i = 0; i < 3; i++, scaleY -= 0.001f) { effect = &this->effects[i]; @@ -3204,8 +3220,7 @@ void BossSst_DrawEffects(Actor* thisx, PlayState* play) { gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 30, 0, 30, effect->alpha * effect->move); gDPSetEnvColor(POLY_XLU_DISP++, 30, 0, 30, 0); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_sst.c", 7396), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_sst.c", 7396); gSPDisplayList(POLY_XLU_DISP++, gEffFireCircleDL); } } @@ -3218,8 +3233,7 @@ void BossSst_DrawEffects(Actor* thisx, PlayState* play) { Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_Scale(effect->scale * 0.001f, 1.0f, effect->scale * 0.001f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_sst.c", 7423), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_sst.c", 7423); gSPDisplayList(POLY_XLU_DISP++, sShadowDList); effect++; } diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h index 0524abaab2..f064f2b842 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h @@ -10,7 +10,7 @@ typedef void (*BossSstActionFunc)(struct BossSst*, PlayState*); #define BOSS_SST_EFFECT_COUNT 18 -typedef struct { +typedef struct BossSstEffect { /* 0x0000 */ Vec3f pos; /* 0x0010 */ Vec3f vel; /* 0x0018 */ Vec3s rot; @@ -20,7 +20,7 @@ typedef struct { /* 0x0024 */ u8 alpha; } BossSstEffect; // size = 0x28 -typedef struct { +typedef struct BossSstHandTrail { /* 0x0000 */ PosRot world; /* 0x0014 */ f32 zPosMod; /* 0x0018 */ s16 yRotMod; @@ -54,7 +54,7 @@ typedef struct BossSst { /* 0x09D4 */ BossSstHandTrail handTrails[7]; } BossSst; // size = 0x0A98 -typedef enum { +typedef enum BossSstType { /* -1 */ BONGO_HEAD = -1, /* 0 */ BONGO_LEFT_HAND, /* 1 */ BONGO_RIGHT_HAND diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst_colchk.inc.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst_colchk.inc.c index f73bfac8ec..cc06356aa8 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst_colchk.inc.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst_colchk.inc.c @@ -3,7 +3,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHand[11] = { { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -14,7 +14,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHand[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -25,7 +25,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHand[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -36,7 +36,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHand[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -47,7 +47,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHand[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -58,7 +58,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHand[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -69,7 +69,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHand[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -80,7 +80,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHand[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -91,7 +91,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHand[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -102,7 +102,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHand[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -113,7 +113,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHand[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -126,7 +126,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHand[11] = { static ColliderJntSphInit sJntSphInitHand = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_TYPE_ALL, @@ -140,7 +140,7 @@ static ColliderJntSphInit sJntSphInitHand = { static ColliderJntSphElementInit sJntSphItemsInitHead[11] = { { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x30 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -151,7 +151,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHead[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x30 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -162,7 +162,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHead[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x30 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -173,7 +173,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHead[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x30 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -184,7 +184,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHead[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x30 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -195,7 +195,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHead[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x30 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -206,7 +206,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHead[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x30 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -217,7 +217,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHead[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x30 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -228,7 +228,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHead[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x30 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -239,7 +239,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHead[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x30 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -250,7 +250,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHead[11] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x30 }, { 0x00000080, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -263,7 +263,7 @@ static ColliderJntSphElementInit sJntSphItemsInitHead[11] = { static ColliderJntSphInit sJntSphInitHead = { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_TYPE_ENEMY, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_TYPE_ALL, @@ -276,7 +276,7 @@ static ColliderJntSphInit sJntSphInitHead = { static ColliderCylinderInit sCylinderInitHead = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_NONE | AC_TYPE_PLAYER, OC1_NONE, @@ -284,7 +284,7 @@ static ColliderCylinderInit sCylinderInitHead = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -296,7 +296,7 @@ static ColliderCylinderInit sCylinderInitHead = { static ColliderCylinderInit sCylinderInitHand = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -304,7 +304,7 @@ static ColliderCylinderInit sCylinderInitHand = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x04, 0x10 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 2f9c32a68f..72b07e4e01 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -3,9 +3,9 @@ #include "assets/objects/object_tw/object_tw.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) -typedef enum { +typedef enum TwEffType { /* 0 */ TWEFF_NONE, /* 1 */ TWEFF_DOT, /* 2 */ TWEFF_2, @@ -19,13 +19,13 @@ typedef enum { /* 10 */ TWEFF_SHLD_HIT } TwEffType; -typedef enum { +typedef enum EffectWork { /* 0 */ EFF_ARGS, /* 1 */ EFF_UNKS1, /* 2 */ EFF_WORK_MAX } EffectWork; -typedef enum { +typedef enum EffectFWork { /* 0 */ EFF_SCALE, /* 1 */ EFF_DIST, /* 2 */ EFF_ROLL, @@ -33,7 +33,7 @@ typedef enum { /* 4 */ EFF_FWORK_MAX } EffectFWork; -typedef enum { +typedef enum TwinrovaType { /* 0x00 */ TW_KOTAKE, /* 0x01 */ TW_KOUME, /* 0x02 */ TW_TWINROVA, @@ -47,7 +47,7 @@ typedef enum { #define BOSS_TW_EFFECT_COUNT 150 -typedef struct { +typedef struct BossTwEffect { /* 0x0000 */ u8 type; /* 0x0001 */ u8 frame; /* 0x0004 */ Vec3f pos; @@ -116,7 +116,7 @@ void BossTw_TwinrovaChargeBlast(BossTw* this, PlayState* play); void BossTw_TwinrovaSetupSpin(BossTw* this, PlayState* play); void BossTw_UpdateEffects(PlayState* play); -ActorInit Boss_Tw_InitVars = { +ActorProfile Boss_Tw_Profile = { /**/ ACTOR_BOSS_TW, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -133,7 +133,7 @@ static Vec3f sZeroVector = { 0.0f, 0.0f, 0.0f }; static ColliderCylinderInit sCylinderInitBlasts = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ALL, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -141,7 +141,7 @@ static ColliderCylinderInit sCylinderInitBlasts = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x30 }, { 0x00100000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -153,7 +153,7 @@ static ColliderCylinderInit sCylinderInitBlasts = { static ColliderCylinderInit sCylinderInitKoumeKotake = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -161,7 +161,7 @@ static ColliderCylinderInit sCylinderInitKoumeKotake = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x20 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -173,7 +173,7 @@ static ColliderCylinderInit sCylinderInitKoumeKotake = { static ColliderCylinderInit sCylinderInitTwinrova = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -181,7 +181,7 @@ static ColliderCylinderInit sCylinderInitTwinrova = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x20 }, { 0xFFCDFFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -201,9 +201,9 @@ static Vec3f sTwinrovaPillarPos[] = { static u8 sTwInitialized = false; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_5, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 0, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 0, ICHAIN_STOP), }; static s8 sEnvType; @@ -233,7 +233,7 @@ static s16 D_8094C87C; static u8 D_8094C87E; static BossTwEffect sEffects[BOSS_TW_EFFECT_COUNT]; -void BossTw_AddDotEffect(PlayState* play, Vec3f* initalPos, Vec3f* initalSpeed, Vec3f* accel, f32 scale, s16 args, +void BossTw_AddDotEffect(PlayState* play, Vec3f* initialPos, Vec3f* initialSpeed, Vec3f* accel, f32 scale, s16 args, s16 countLimit) { s16 i; BossTwEffect* eff; @@ -241,8 +241,8 @@ void BossTw_AddDotEffect(PlayState* play, Vec3f* initalPos, Vec3f* initalSpeed, for (i = 0, eff = play->specialEffects; i < countLimit; i++, eff++) { if (eff->type == TWEFF_NONE) { eff->type = TWEFF_DOT; - eff->pos = *initalPos; - eff->curSpeed = *initalSpeed; + eff->pos = *initialPos; + eff->curSpeed = *initialSpeed; eff->accel = *accel; eff->workf[EFF_SCALE] = scale / 1000.0f; eff->alpha = 255; @@ -253,7 +253,7 @@ void BossTw_AddDotEffect(PlayState* play, Vec3f* initalPos, Vec3f* initalSpeed, } } -void BossTw_AddDmgCloud(PlayState* play, s16 type, Vec3f* initialPos, Vec3f* initalSpeed, Vec3f* accel, f32 scale, +void BossTw_AddDmgCloud(PlayState* play, s16 type, Vec3f* initialPos, Vec3f* initialSpeed, Vec3f* accel, f32 scale, s16 alpha, s16 args, s16 countLimit) { s16 i; BossTwEffect* eff; @@ -262,7 +262,7 @@ void BossTw_AddDmgCloud(PlayState* play, s16 type, Vec3f* initialPos, Vec3f* ini if (eff->type == TWEFF_NONE) { eff->type = type; eff->pos = *initialPos; - eff->curSpeed = *initalSpeed; + eff->curSpeed = *initialSpeed; eff->accel = *accel; eff->workf[EFF_SCALE] = scale / 1000.0f; eff->work[EFF_ARGS] = args; @@ -273,7 +273,7 @@ void BossTw_AddDmgCloud(PlayState* play, s16 type, Vec3f* initialPos, Vec3f* ini } } -void BossTw_AddRingEffect(PlayState* play, Vec3f* initalPos, f32 scale, f32 arg3, s16 alpha, s16 args, s16 arg6, +void BossTw_AddRingEffect(PlayState* play, Vec3f* initialPos, f32 scale, f32 arg3, s16 alpha, s16 args, s16 arg6, s16 countLimit) { s16 i; BossTwEffect* eff; @@ -281,7 +281,7 @@ void BossTw_AddRingEffect(PlayState* play, Vec3f* initalPos, f32 scale, f32 arg3 for (i = 0, eff = play->specialEffects; i < countLimit; i++, eff++) { if (eff->type == TWEFF_NONE) { eff->type = TWEFF_RING; - eff->pos = *initalPos; + eff->pos = *initialPos; eff->curSpeed = sZeroVector; eff->accel = sZeroVector; eff->workf[EFF_SCALE] = scale * 0.0025f; @@ -320,15 +320,15 @@ void BossTw_AddPlayerFreezeEffect(PlayState* play, Actor* target) { } } -void BossTw_AddFlameEffect(PlayState* play, Vec3f* initalPos, Vec3f* initalSpeed, Vec3f* accel, f32 scale, s16 args) { +void BossTw_AddFlameEffect(PlayState* play, Vec3f* initialPos, Vec3f* initialSpeed, Vec3f* accel, f32 scale, s16 args) { s16 i; BossTwEffect* eff; for (i = 0, eff = play->specialEffects; i < BOSS_TW_EFFECT_COUNT; i++, eff++) { if (eff->type == TWEFF_NONE) { eff->type = TWEFF_FLAME; - eff->pos = *initalPos; - eff->curSpeed = *initalSpeed; + eff->pos = *initialPos; + eff->curSpeed = *initialSpeed; eff->accel = *accel; eff->workf[EFF_SCALE] = scale / 1000.0f; eff->work[EFF_ARGS] = args; @@ -362,7 +362,7 @@ void BossTw_AddMergeFlameEffect(PlayState* play, Vec3f* initialPos, f32 scale, f } } -void BossTw_AddShieldBlastEffect(PlayState* play, Vec3f* initalPos, Vec3f* initalSpeed, Vec3f* accel, f32 scale, +void BossTw_AddShieldBlastEffect(PlayState* play, Vec3f* initialPos, Vec3f* initialSpeed, Vec3f* accel, f32 scale, f32 arg5, s16 alpha, s16 args) { s16 i; BossTwEffect* eff; @@ -370,8 +370,8 @@ void BossTw_AddShieldBlastEffect(PlayState* play, Vec3f* initalPos, Vec3f* inita for (i = 0, eff = play->specialEffects; i < BOSS_TW_EFFECT_COUNT; i++, eff++) { if (eff->type == TWEFF_NONE) { eff->type = TWEFF_SHLD_BLST; - eff->pos = *initalPos; - eff->curSpeed = *initalSpeed; + eff->pos = *initialPos; + eff->curSpeed = *initialSpeed; eff->accel = *accel; eff->workf[EFF_SCALE] = scale / 1000.0f; eff->workf[EFF_DIST] = arg5 / 1000.0f; @@ -457,7 +457,7 @@ void BossTw_Init(Actor* thisx, PlayState* play2) { Actor_SetScale(&this->actor, 0.01f); this->actor.update = BossTw_BlastUpdate; this->actor.draw = BossTw_BlastDraw; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInitBlasts); @@ -484,7 +484,7 @@ void BossTw_Init(Actor* thisx, PlayState* play2) { } Actor_SetScale(&this->actor, 2.5 * 0.01f); - this->actor.colChkInfo.mass = 255; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.colChkInfo.health = 0; Collider_InitCylinder(play, &this->collider); @@ -646,7 +646,7 @@ void BossTw_SetupFlyTo(BossTw* this, PlayState* play) { BossTw* otherTw = (BossTw*)this->actor.parent; this->unk_5F8 = 1; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = BossTw_FlyTo; this->rotateSpeed = 0.0f; Animation_MorphToLoop(&this->skelAnime, &gTwinrovaKotakeKoumeFlyAnim, -10.0f); @@ -804,7 +804,7 @@ s32 BossTw_BeamHitPlayerCheck(BossTw* this, PlayState* play) { if (sTwinrovaPtr->timers[2] == 0) { sTwinrovaPtr->timers[2] = 150; this->beamDist = sqrtf(SQ(offset.x) + SQ(offset.y) + SQ(offset.z)); - func_8002F6D4(play, &this->actor, 3.0f, this->actor.shape.rot.y, 0.0f, 0x20); + Actor_SetPlayerKnockbackLarge(play, &this->actor, 3.0f, this->actor.shape.rot.y, 0.0f, 0x20); if (this->actor.params == TW_KOTAKE) { if (sFreezeState == 0) { @@ -1438,7 +1438,7 @@ void BossTw_SetupSpin(BossTw* this, PlayState* play) { void BossTw_Spin(BossTw* this, PlayState* play) { if (this->timers[0] != 0) { - this->collider.base.colType = COLTYPE_METAL; + this->collider.base.colMaterial = COL_MATERIAL_METAL; this->actor.shape.rot.y -= 0x3000; if ((this->timers[0] % 4) == 0) { @@ -1470,7 +1470,7 @@ void BossTw_SetupWait(BossTw* this, PlayState* play) { this->actionFunc = BossTw_Wait; this->visible = false; this->actor.world.pos.y = -2000.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } void BossTw_Wait(BossTw* this, PlayState* play) { @@ -1632,7 +1632,7 @@ void BossTw_TwinrovaMergeCS(BossTw* this, PlayState* play) { this->csState1 = 1; this->visible = true; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.shape.rot.y = 0; BossTw_SetupWait(sKotakePtr, play); BossTw_SetupWait(sKoumePtr, play); @@ -1753,11 +1753,11 @@ void BossTw_SetupCSWait(BossTw* this, PlayState* play) { this->actionFunc = BossTw_CSWait; this->visible = false; this->actor.world.pos.y = -2000.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } /** - * Do nothing while waiting for the inital cutscene to start + * Do nothing while waiting for the initial cutscene to start */ void BossTw_CSWait(BossTw* this, PlayState* play) { } @@ -1766,7 +1766,7 @@ void BossTw_TwinrovaSetupIntroCS(BossTw* this, PlayState* play) { this->actionFunc = BossTw_TwinrovaIntroCS; this->visible = false; this->actor.world.pos.y = -2000.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } void BossTw_TwinrovaIntroCS(BossTw* this, PlayState* play) { @@ -2372,7 +2372,7 @@ void BossTw_TwinrovaSetupDeathCS(BossTw* this, PlayState* play) { this->actionFunc = BossTw_TwinrovaDeathCS; Animation_MorphToLoop(&this->skelAnime, &gTwinrovaDamageAnim, -3.0f); this->actor.world.rot.y = this->actor.shape.rot.y; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->csState2 = this->csState1 = 0; this->work[CS_TIMER_1] = this->work[CS_TIMER_2] = 0; this->work[INVINC_TIMER] = 10000; @@ -2670,7 +2670,7 @@ void BossTw_TwinrovaDeathCS(BossTw* this, PlayState* play) { this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, TW_DEATHBALL_KOUME); Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_BOSS_TW, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, TW_DEATHBALL_KOTAKE); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } } Actor_SetScale(&this->actor, this->actor.scale.x); @@ -2723,7 +2723,7 @@ void BossTw_TwinrovaDeathCS(BossTw* this, PlayState* play) { sKoumePtr->work[YAW_TGT] = sKotakePtr->work[YAW_TGT] = sKoumePtr->actor.shape.rot.x = sKotakePtr->actor.shape.rot.x = sKoumePtr->actor.shape.rot.y = sKotakePtr->actor.shape.rot.y = 0; Player_SetCsActionWithHaltedActors(play, &sKoumePtr->actor, PLAYER_CSACTION_1); - sKoumePtr->actor.flags |= ACTOR_FLAG_0; + sKoumePtr->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } break; case 2: @@ -2848,7 +2848,7 @@ void BossTw_Update(Actor* thisx, PlayState* play) { s16 i; s32 pad; - this->collider.base.colType = COLTYPE_HIT3; + this->collider.base.colMaterial = COL_MATERIAL_HIT3; Math_ApproachF(&this->fogR, play->lightCtx.fogColor[0], 1.0f, 10.0f); Math_ApproachF(&this->fogG, play->lightCtx.fogColor[1], 1.0f, 10.0f); Math_ApproachF(&this->fogB, play->lightCtx.fogColor[2], 1.0f, 10.0f); @@ -2976,7 +2976,7 @@ void BossTw_TwinrovaUpdate(Actor* thisx, PlayState* play2) { this->actor.flags &= ~ACTOR_FLAG_10; this->unk_5F8 = 0; - this->collider.base.colType = COLTYPE_HIT3; + this->collider.base.colMaterial = COL_MATERIAL_HIT3; Math_ApproachF(&this->fogR, play->lightCtx.fogColor[0], 1.0f, 10.0f); Math_ApproachF(&this->fogG, play->lightCtx.fogColor[1], 1.0f, 10.0f); @@ -3223,8 +3223,7 @@ void BossTw_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot Matrix_MultVec3f(&D_8094A950, &this->crownPos); if (this->unk_5F8 != 0) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 6190), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 6190); if (this->actor.params == TW_KOTAKE) { gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaKotakeIceHairDL)); } else { @@ -3241,8 +3240,7 @@ void BossTw_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot Matrix_MultVec3f(&D_8094A95C[4], &this->scepterFlamePos[4]); if (this->scepterAlpha > 0.0f) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 6221), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 6221); if (this->actor.params == TW_KOTAKE) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 225, 255, (s16)this->scepterAlpha); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaKotakeIceBroomHeadDL)); @@ -3270,8 +3268,7 @@ void func_80941BC0(BossTw* this, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); Matrix_Translate(this->groundBlastPos2.x, this->groundBlastPos2.y, this->groundBlastPos2.z, MTXMODE_NEW); Matrix_Scale(this->workf[UNK_F12], this->workf[UNK_F12], this->workf[UNK_F12], MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 6358), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 6358); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s16)this->workf[UNK_F11]); gDPSetEnvColor(POLY_XLU_DISP++, 0, 40, 30, 80); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIcePoolDL)); @@ -3282,12 +3279,10 @@ void func_80941BC0(BossTw* this, PlayState* play) { (u32)this->workf[UNK_F16] & 0x3F, (this->work[CS_TIMER_2] * 4) & 0x3F, 0x10, 0x10)); Matrix_Push(); Matrix_RotateY(this->workf[UNK_F15], MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 6423), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 6423); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIcePoolShineDL)); Matrix_Pop(); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 6427), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 6427); gSPSegment(POLY_XLU_DISP++, 0xD, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, this->work[CS_TIMER_2] & 0x7F, (this->work[CS_TIMER_2] * 8) & 0xFF, 0x20, 0x40, 1, @@ -3299,8 +3294,6 @@ void func_80941BC0(BossTw* this, PlayState* play) { gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaEffectHaloDL)); Matrix_Pop(); - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 6461); } @@ -3317,16 +3310,14 @@ void func_80942180(BossTw* this, PlayState* play) { gSPSegment(POLY_XLU_DISP++, 8, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (-this->work[CS_TIMER_1]) & 0x7F, 0, 0x20, 0x20, 1, (this->work[CS_TIMER_1] * 2) & 0x7F, 0, 0x20, 0x20)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 6497), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 6497); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 100, 40, 00, (s16)this->workf[KM_GRND_CRTR_A]); gDPPipeSync(POLY_XLU_DISP++); gDPSetEnvColor(POLY_XLU_DISP++, 255, 245, 255, 128); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaFirePoolDL)); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 6514), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 6514); gSPSegment(POLY_XLU_DISP++, 8, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, this->work[CS_TIMER_1] & 0x7F, (-this->work[CS_TIMER_1] * 6) & 0xFF, 0x20, 0x40, 1, @@ -3343,8 +3334,7 @@ void func_80942180(BossTw* this, PlayState* play) { gDPPipeSync(POLY_XLU_DISP++); gDPSetEnvColor(POLY_XLU_DISP++, 200, 235, 240, 128); Matrix_Scale(this->workf[KM_GD_FLM_SCL], this->workf[KM_GD_FLM_SCL], this->workf[KM_GD_FLM_SCL], MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 6575), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 6575); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaBigFlameDL)); Matrix_Pop(); @@ -3366,8 +3356,7 @@ void func_809426F0(BossTw* this, PlayState* play) { Matrix_Scale(this->spawnPortalScale / 2000.0f, this->spawnPortalScale / 2000.0f, this->spawnPortalScale / 2000.0f, MTXMODE_APPLY); Matrix_RotateZ(this->portalRotation, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 6614), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 6614); if (this->actor.params == TW_KOTAKE) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 135, 175, 165, (s16)this->spawnPortalAlpha); @@ -3398,8 +3387,7 @@ void func_809426F0(BossTw* this, PlayState* play) { (u8)((-this->work[CS_TIMER_2] * 15) + (i * 50)), 0x20, 0x40, 1, 0, 0, 0x20, 0x20)); Matrix_Scale(0.4f, 0.4f, 0.4f, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 6751), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 6751); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaFireDL)); Matrix_Pop(); } @@ -3413,45 +3401,46 @@ void func_80942C70(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 6765); - if (this->beamDist != 0.0f) { - Matrix_Push(); - gSPSegment(POLY_XLU_DISP++, 0xC, - Gfx_TexScroll(play->state.gfxCtx, 0, (u8)(this->work[CS_TIMER_1] * -0xF), 0x20, 0x40)); - alpha = this->beamScale * 100.0f * 255.0f; + if (this->beamDist == 0.0f) { + goto close_disps; + } - if (this->actor.params == TW_KOUME) { - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 60, alpha); - gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128); - } else { - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, alpha); - gDPSetEnvColor(POLY_XLU_DISP++, 100, 100, 255, 128); - } + Matrix_Push(); + gSPSegment(POLY_XLU_DISP++, 0xC, + Gfx_TexScroll(play->state.gfxCtx, 0, (u8)(this->work[CS_TIMER_1] * -0xF), 0x20, 0x40)); + alpha = this->beamScale * 100.0f * 255.0f; - Matrix_Translate(this->beamOrigin.x, this->beamOrigin.y, this->beamOrigin.z, MTXMODE_NEW); - Matrix_RotateY(this->beamYaw, MTXMODE_APPLY); - Matrix_RotateX(this->beamPitch, MTXMODE_APPLY); - Matrix_RotateZ(this->beamRoll, MTXMODE_APPLY); - Matrix_Scale(this->beamScale, this->beamScale, (this->beamDist * 0.01f * 98.0f) / 20000.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 6846), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); - gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaBeamDL)); + if (this->actor.params == TW_KOUME) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 60, alpha); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128); + } else { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, alpha); + gDPSetEnvColor(POLY_XLU_DISP++, 100, 100, 255, 128); + } - if (this->beamReflectionDist > 10.0f) { - Matrix_Translate(this->beamReflectionOrigin.x, this->beamReflectionOrigin.y, this->beamReflectionOrigin.z, - MTXMODE_NEW); - Matrix_RotateY(this->beamReflectionYaw, MTXMODE_APPLY); - Matrix_RotateX(this->beamReflectionPitch, MTXMODE_APPLY); - Matrix_RotateZ(this->beamRoll, MTXMODE_APPLY); - Matrix_Scale(this->beamScale, this->beamScale, (this->beamReflectionDist * 0.01f * 100.0f) / 20000.0f, - MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 6870), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); - gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaBeamDL)); - } + Matrix_Translate(this->beamOrigin.x, this->beamOrigin.y, this->beamOrigin.z, MTXMODE_NEW); + Matrix_RotateY(this->beamYaw, MTXMODE_APPLY); + Matrix_RotateX(this->beamPitch, MTXMODE_APPLY); + Matrix_RotateZ(this->beamRoll, MTXMODE_APPLY); + Matrix_Scale(this->beamScale, this->beamScale, (this->beamDist * 0.01f * 98.0f) / 20000.0f, MTXMODE_APPLY); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 6846); + gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaBeamDL)); - Matrix_Pop(); + if (this->beamReflectionDist > 10.0f) { + Matrix_Translate(this->beamReflectionOrigin.x, this->beamReflectionOrigin.y, this->beamReflectionOrigin.z, + MTXMODE_NEW); + Matrix_RotateY(this->beamReflectionYaw, MTXMODE_APPLY); + Matrix_RotateX(this->beamReflectionPitch, MTXMODE_APPLY); + Matrix_RotateZ(this->beamRoll, MTXMODE_APPLY); + Matrix_Scale(this->beamScale, this->beamScale, (this->beamReflectionDist * 0.01f * 100.0f) / 20000.0f, + MTXMODE_APPLY); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 6870); + gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaBeamDL)); } + Matrix_Pop(); + +close_disps: CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 6878); } @@ -3464,16 +3453,14 @@ void func_80943028(Actor* thisx, PlayState* play) { Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y + 57.0f, this->actor.world.pos.z, MTXMODE_NEW); Matrix_Scale(this->workf[UNK_F17], this->workf[UNK_F17], this->workf[UNK_F17], MTXMODE_APPLY); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 6908), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 6908); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaHaloDL)); Gfx_SetupDL_44Xlu(play->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 200); Matrix_Translate(this->actor.world.pos.x, 240.0f, this->actor.world.pos.z, MTXMODE_NEW); Matrix_Scale((this->actor.scale.x * 4000.0f) / 100.0f, 1.0f, (this->actor.scale.x * 4000.0f) / 100.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 6926), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 6926); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gCircleShadowDL)); Matrix_Pop(); @@ -3565,8 +3552,6 @@ void BossTw_Draw(Actor* thisx, PlayState* play2) { } } - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 7123); } @@ -3668,8 +3653,7 @@ void BossTw_TwinrovaPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve case TWINROVA_LIMB_BROOM_FIRE_TRAIL: Matrix_Push(); Matrix_Scale(this->workf[UNK_F12], this->workf[UNK_F12], this->workf[UNK_F12], MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 7295), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 7295); Matrix_Pop(); gSPDisplayList(POLY_XLU_DISP++, *dList); break; @@ -3719,8 +3703,7 @@ void BossTw_ShieldChargeDraw(BossTw* this, PlayState* play) { if (temp_t0 != 0) { Matrix_Mult(&player->shieldMf, MTXMODE_NEW); Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 7362), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 7362); temp_a0 = (Math_SinS(this->work[CS_TIMER_1] * 2730 * temp_t0) * D_8094C854 * 0.5f) + (D_8094C854 * 0.5f); if (sShieldFireCharge != 0) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 245, 255, temp_a0); @@ -3760,8 +3743,7 @@ void BossTw_ShieldChargeDraw(BossTw* this, PlayState* play) { Matrix_Mult(&player->shieldMf, MTXMODE_NEW); Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 7486), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 7486); if (sShieldFireCharge != 0) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 220, 20, (s16)D_8094C858); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 20, 110); @@ -3796,29 +3778,25 @@ void BossTw_SpawnPortalDraw(BossTw* this, PlayState* play) { Matrix_Translate(0.0f, 232.0f, -600.0f, MTXMODE_NEW); Matrix_Scale(this->spawnPortalScale, this->spawnPortalScale, this->spawnPortalScale, MTXMODE_APPLY); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, (s16)this->spawnPortalAlpha); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 7582), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 7582); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaSpawnPortalShadowDL)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 135, 175, 165, (s16)this->spawnPortalAlpha); Matrix_Translate(0.0f, 2.0f, 0.0f, MTXMODE_APPLY); Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 7596), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 7596); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaKotakeMagicSigilDL)); Matrix_Translate(0.0f, 232.0f, 600.0f, MTXMODE_NEW); Matrix_Scale(this->spawnPortalScale, this->spawnPortalScale, this->spawnPortalScale, MTXMODE_APPLY); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, (s16)this->spawnPortalAlpha); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 7617), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 7617); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaSpawnPortalShadowDL)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 0, (s16)this->spawnPortalAlpha); Matrix_Translate(0.0f, 2.0f, 0.0f, MTXMODE_APPLY); Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 7631), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 7631); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaKoumeMagicSigilDL)); Matrix_Pop(); @@ -3837,8 +3815,7 @@ void func_80944C50(BossTw* this, PlayState* play) { Matrix_Scale(0.35f, 0.35f, 0.35f, MTXMODE_APPLY); Matrix_Push(); Matrix_Scale(this->workf[UNK_F19], this->workf[UNK_F19], this->workf[UNK_F19], MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 7671), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 7671); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaLightCircleDL)); Matrix_Pop(); @@ -3846,8 +3823,7 @@ void func_80944C50(BossTw* this, PlayState* play) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, -sKoumePtr->work[CS_TIMER_1] * 2, 0, 0x20, 0x20, 1, -sKoumePtr->work[CS_TIMER_1] * 2, 0, 0x20, 0x40)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s16)this->workf[UNK_F18] / 2); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 7694), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 7694); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaLightRaysDL)); gSPSegment(POLY_XLU_DISP++, 8, @@ -3860,8 +3836,7 @@ void func_80944C50(BossTw* this, PlayState* play) { scale = CLAMP_MAX(scale, 1.0f); Matrix_Scale(scale, 1.0f, scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 7728), - G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 7728); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaLightPillarDL)); Matrix_Pop(); @@ -4464,8 +4439,7 @@ void BossTw_BlastDraw(Actor* thisx, PlayState* play2) { Matrix_Scale(this->actor.scale.x * scaleFactor, this->actor.scale.y * scaleFactor, this->actor.scale.z * scaleFactor, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 8865), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 8865); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaFireDL)); } break; @@ -4488,8 +4462,7 @@ void BossTw_BlastDraw(Actor* thisx, PlayState* play2) { Matrix_Scale(this->actor.scale.x * scaleFactor, this->actor.scale.y * scaleFactor, this->actor.scale.z * scaleFactor, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 9004), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 9004); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceModelDL)); } break; @@ -4528,8 +4501,7 @@ void BossTw_DrawDeathBall(Actor* thisx, PlayState* play2) { Matrix_Scale(this->actor.scale.x * scaleFactor, this->actor.scale.y * scaleFactor, this->actor.scale.z * scaleFactor, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 9071), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 9071); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaFireDL)); } } else { @@ -4548,8 +4520,7 @@ void BossTw_DrawDeathBall(Actor* thisx, PlayState* play2) { Matrix_Scale(this->actor.scale.x * scaleFactor, this->actor.scale.y * scaleFactor, this->actor.scale.z * scaleFactor, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_tw.c", 9107), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_tw.c", 9107); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceModelDL)); } } @@ -4926,8 +4897,7 @@ void BossTw_DrawEffects(PlayState* play) { Matrix_Translate(currentEffect->pos.x, currentEffect->pos.y, currentEffect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(currentEffect->workf[EFF_SCALE], currentEffect->workf[EFF_SCALE], 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_tw.c", 9617), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_tw.c", 9617); gSPDisplayList(POLY_XLU_DISP++, gTwinrovaMagicParticleModelDL); } @@ -4951,8 +4921,7 @@ void BossTw_DrawEffects(PlayState* play) { Matrix_Translate(currentEffect->pos.x, currentEffect->pos.y, currentEffect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(currentEffect->workf[EFF_SCALE], currentEffect->workf[EFF_SCALE], 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_tw.c", 9660), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_tw.c", 9660); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceModelDL)); } currentEffect++; @@ -4976,8 +4945,7 @@ void BossTw_DrawEffects(PlayState* play) { Matrix_Translate(currentEffect->pos.x, currentEffect->pos.y, currentEffect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(currentEffect->workf[EFF_SCALE], currentEffect->workf[EFF_SCALE], 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_tw.c", 9709), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_tw.c", 9709); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaFireDL)); } @@ -5019,8 +4987,7 @@ void BossTw_DrawEffects(PlayState* play) { Matrix_RotateZ(currentEffect->workf[EFF_ROLL], MTXMODE_APPLY); Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY); Matrix_Scale(currentEffect->workf[EFF_SCALE], 1.0f, currentEffect->workf[EFF_SCALE], MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_tw.c", 9775), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_tw.c", 9775); gDPSetRenderMode(POLY_XLU_DISP++, G_RM_PASS, G_RM_AA_ZB_XLU_SURF2); gSPClearGeometryMode(POLY_XLU_DISP++, G_CULL_BACK | G_FOG); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaEffectHaloDL)); @@ -5067,8 +5034,7 @@ void BossTw_DrawEffects(PlayState* play) { currentEffect->workf[EFF_SCALE], MTXMODE_APPLY); Matrix_RotateY(BossTw_RandZeroOne() * M_PI, MTXMODE_APPLY); Matrix_RotateX((BossTw_RandZeroOne() - 0.5f) * M_PI * 0.5f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_tw.c", 9855), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_tw.c", 9855); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceModelDL)); } } @@ -5096,8 +5062,7 @@ void BossTw_DrawEffects(PlayState* play) { Matrix_Translate(currentEffect->pos.x, currentEffect->pos.y, currentEffect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(currentEffect->workf[EFF_SCALE], currentEffect->workf[EFF_SCALE], 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_tw.c", 9911), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_tw.c", 9911); if (currentEffect->work[EFF_ARGS] == 0) { gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceModelDL)); @@ -5432,7 +5397,7 @@ void BossTw_TwinrovaSetupSpin(BossTw* this, PlayState* play) { void BossTw_TwinrovaSpin(BossTw* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (this->timers[0] != 0) { - this->collider.base.colType = COLTYPE_METAL; + this->collider.base.colMaterial = COL_MATERIAL_METAL; this->actor.shape.rot.y -= 0x3000; if ((this->timers[0] % 4) == 0) { diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h index 14190e917c..eb2a4ef74c 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h @@ -8,7 +8,7 @@ struct BossTw; typedef void (*BossTwActionFunc)(struct BossTw* this, PlayState* play); -typedef enum { +typedef enum TwWork { /* 0 */ CS_TIMER_1, /* 1 */ CS_TIMER_2, /* 2 */ TW_PLLR_IDX, @@ -25,7 +25,7 @@ typedef enum { /* 13 */ WORK_MAX } TwWork; -typedef enum { +typedef enum TwFwork { /* 0 */ OUTR_CRWN_TX_X1, /* 1 */ OUTR_CRWN_TX_X2, /* 2 */ INNR_CRWN_TX_X1, @@ -55,7 +55,7 @@ typedef enum { /* 26 */ FWORK_MAX } TwFwork; -typedef enum { +typedef enum TwinrovaKotakeKoumeLimb { /* 0 */ TWINROVA_KOTAKE_KOUME_LIMB_NONE, /* 1 */ TWINROVA_KOTAKE_KOUME_LIMB_PELVIS, /* 2 */ TWINROVA_KOTAKE_KOUME_LIMB_LEFT_THIGH, @@ -86,7 +86,7 @@ typedef enum { /* 27 */ TWINROVA_KOTAKE_KOUME_LIMB_MAX } TwinrovaKotakeKoumeLimb; -typedef enum { +typedef enum TwinrovaLimb { /* 0 */ TWINROVA_LIMB_NONE, /* 1 */ TWINROVA_LIMB_PELVIS, /* 2 */ TWINROVA_LIMB_SASH_1, diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index dc1d521c5e..f8f6d45c2b 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -9,7 +9,10 @@ #include "overlays/actors/ovl_En_Boom/z_en_boom.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:128 pal-1.0:128 pal-1.1:128" + +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) #define GET_BODY(this) ((BossVa*)(this)->actor.parent) #define vaGorePulse offset.x @@ -41,7 +44,7 @@ typedef struct BossVaEffect { /* 0x54 */ struct BossVa* parent; } BossVaEffect; // size = 0x58 -typedef enum { +typedef enum BossVaEffectType { /* 0 */ VA_NONE, /* 1 */ VA_LARGE_SPARK, /* 2 */ VA_BLAST_SPARK, @@ -53,7 +56,7 @@ typedef enum { /* 8 */ VA_GORE } BossVaEffectType; -typedef enum { +typedef enum BossVaSparkMode { /* 1 */ SPARK_TETHER = 1, /* 2 */ SPARK_BARI, /* 3 */ SPARK_BLAST, @@ -62,25 +65,25 @@ typedef enum { /* 6 */ SPARK_LINK } BossVaSparkMode; -typedef enum { +typedef enum BossVaBloodMode { /* 0 */ BLOOD_DROPLET, /* 1 */ BLOOD_SPLATTER, /* 2 */ BLOOD_SPOT } BossVaBloodMode; -typedef enum { +typedef enum BossVaTumorMode { /* 0 */ TUMOR_UNUSED, /* 1 */ TUMOR_BODY, /* 2 */ TUMOR_ARM } BossVaTumorMode; -typedef enum { +typedef enum BossVaGoreMode { /* 0 */ GORE_PERMANENT, /* 1 */ GORE_FLOOR, /* 2 */ GORE_FADING } BossVaGoreMode; -typedef enum { +typedef enum BossVaCutscene { /* -5 */ INTRO_UNUSED_START = -5, /* -4 */ INTRO_START, /* -3 */ INTRO_LOOK_DOOR, @@ -188,7 +191,7 @@ void BossVa_SpawnBloodDroplets(PlayState* play, BossVaEffect* effect, Vec3f* pos void BossVa_Tumor(PlayState* play, BossVa* this, s32 count, s16 scale, f32 xzSpread, f32 ySpread, u8 mode, f32 range, u8 fixed); -ActorInit Boss_Va_InitVars = { +ActorProfile Boss_Va_Profile = { /**/ ACTOR_BOSS_VA, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -202,7 +205,7 @@ ActorInit Boss_Va_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -210,7 +213,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFEF, 0x03, 0x08 }, { 0x00000010, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -223,7 +226,7 @@ static ColliderCylinderInit sCylinderInit = { static ColliderJntSphElementInit sJntSphElementsInitSupport[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000010, 0x00, 0x00 }, ATELEM_NONE, @@ -236,7 +239,7 @@ static ColliderJntSphElementInit sJntSphElementsInitSupport[1] = { static ColliderJntSphInit sJntSphInitSupport = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -250,7 +253,7 @@ static ColliderJntSphInit sJntSphInitSupport = { static ColliderJntSphElementInit sJntSphElementsInitBari[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x03, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -263,7 +266,7 @@ static ColliderJntSphElementInit sJntSphElementsInitBari[1] = { static ColliderJntSphInit sJntSphInitBari = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -276,7 +279,7 @@ static ColliderJntSphInit sJntSphInitBari = { static ColliderQuadInit sQuadInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -284,7 +287,7 @@ static ColliderQuadInit sQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x03, 0x04 }, { 0x00000010, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL | ATELEM_UNK7, @@ -581,7 +584,7 @@ void BossVa_Init(Actor* thisx, PlayState* play2) { s16 warpId; Actor_SetScale(&this->actor, 0.1f); - this->actor.targetMode = 5; + this->actor.attentionRangeType = ATTENTION_RANGE_5; this->actor.colChkInfo.mass = MASS_IMMOVABLE; switch (this->actor.params) { @@ -756,7 +759,7 @@ void BossVa_SetupIntro(BossVa* this) { Animation_Change(&this->skelAnime, &gBarinadeBodyAnim, 1.0f, lastFrame, lastFrame, ANIMMODE_ONCE, 0.0f); this->actor.shape.yOffset = -450.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; BossVa_SetupAction(this, BossVa_BodyIntro); } @@ -1048,7 +1051,7 @@ void BossVa_SetupBodyPhase1(BossVa* this) { Animation_Change(&this->skelAnime, &gBarinadeBodyAnim, 1.0f, lastFrame, lastFrame, ANIMMODE_ONCE, 0.0f); this->actor.shape.yOffset = -450.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->timer = 25; sBodyState = 0x80; BossVa_SetupAction(this, BossVa_BodyPhase1); @@ -1069,7 +1072,7 @@ void BossVa_BodyPhase1(BossVa* this, PlayState* play) { if (this->colliderBody.base.atFlags & AT_HIT) { this->colliderBody.base.atFlags &= ~AT_HIT; if (this->colliderBody.base.at == &player->actor) { - func_8002F71C(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); } } @@ -1115,7 +1118,7 @@ void BossVa_SetupBodyPhase2(BossVa* this, PlayState* play) { } this->invincibilityTimer = 0; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; BossVa_SetupAction(this, BossVa_BodyPhase2); } @@ -1159,7 +1162,7 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) { sPhase2Timer = (sPhase2Timer + 0x18) & 0xFFF0; if (this->colliderBody.base.at == &player->actor) { - func_8002F71C(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT); } } @@ -1181,10 +1184,10 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.z, this->actor.world.rot.z, 1, 0xC8, 0); Math_SmoothStepToF(&this->actor.shape.yOffset, -1000.0f, 1.0f, 20.0f, 0.0f); if (!(sPhase2Timer & 0x100)) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = 1.0f; } else { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = 0.0f; } @@ -1235,7 +1238,7 @@ void BossVa_BodyPhase3(BossVa* this, PlayState* play) { if (this->colliderBody.base.atFlags & AT_HIT) { this->colliderBody.base.atFlags &= ~AT_HIT; if (this->colliderBody.base.at == &player->actor) { - func_8002F71C(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); this->actor.world.rot.y += (s16)Rand_CenteredFloat(0x2EE0) + 0x8000; Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT); } @@ -1247,7 +1250,7 @@ void BossVa_BodyPhase3(BossVa* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_FAINT); sBodyState = 1; this->timer = 131; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else { sBodyState = 0; if (this->timer == 0) { @@ -1257,7 +1260,7 @@ void BossVa_BodyPhase3(BossVa* this, PlayState* play) { } Math_SmoothStepToF(&this->actor.speed, 3.0f, 1.0f, 0.15f, 0.0f); } - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } else { this->timer--; if (this->timer < 35) { @@ -1332,7 +1335,7 @@ void BossVa_BodyPhase3(BossVa* this, PlayState* play) { void BossVa_SetupBodyPhase4(BossVa* this, PlayState* play) { this->unk_1AC = 0; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->vaBodySpinRate = this->unk_1AC; this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->timer2 = (s16)(Rand_ZeroOne() * 150.0f) + 300; @@ -1356,7 +1359,7 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) { if (this->colliderBody.base.atFlags & AT_HIT) { this->colliderBody.base.atFlags &= ~AT_HIT; if (this->colliderBody.base.at == &player->actor) { - func_8002F71C(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); this->actor.world.rot.y += (s16)Rand_CenteredFloat(0x2EE0) + 0x8000; Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT); } @@ -1511,7 +1514,7 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) { void BossVa_SetupBodyDeath(BossVa* this, PlayState* play) { func_800F436C(&this->actor.projectedPos, NA_SE_EN_BALINADE_LEVEL - SFX_FLAG, 1.0f); - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1); this->vaCamRotMod = 0xC31; sCsState = DEATH_START; @@ -1800,7 +1803,7 @@ void BossVa_SupportCut(BossVa* this, PlayState* play) { lastFrame = Animation_GetLastFrame(&gBarinadeSupportDetachedAnim); Animation_Change(&this->skelAnime, &gBarinadeSupportDetachedAnim, 1.0f, 0.0f, lastFrame, ANIMMODE_LOOP_INTERP, 0.0f); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } if ((this->timer == 0) && (sCsState < DEATH_START)) { @@ -1854,7 +1857,7 @@ void BossVa_SupportCut(BossVa* this, PlayState* play) { void BossVa_SetupStump(BossVa* this, PlayState* play) { Animation_Change(&this->skelAnime, &gBarinadeStumpAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gBarinadeStumpAnim), ANIMMODE_ONCE, 0.0f); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; BossVa_SetupAction(this, BossVa_Stump); } @@ -1873,7 +1876,7 @@ void BossVa_SetupZapperIntro(BossVa* this, PlayState* play) { Animation_Change(&this->skelAnime, &gBarinadeZapperIdleAnim, 1.0f, lastFrame - 1.0f, lastFrame, ANIMMODE_LOOP_INTERP, -6.0f); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; BossVa_SetupAction(this, BossVa_ZapperIntro); } @@ -1900,7 +1903,7 @@ void BossVa_SetupZapperAttack(BossVa* this, PlayState* play) { Animation_Change(&this->skelAnime, &gBarinadeZapperIdleAnim, 1.0f, lastFrame - 1.0f, lastFrame, ANIMMODE_LOOP_INTERP, -6.0f); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; BossVa_SetupAction(this, BossVa_ZapperAttack); } @@ -2399,7 +2402,7 @@ void BossVa_SetupBariIntro(BossVa* this, PlayState* play) { this->actor.world.pos.y = sInitPosOffsets[this->actor.params + 10].y + this->actor.home.pos.y; this->actor.world.pos.z = sInitPosOffsets[this->actor.params + 10].z + this->actor.home.pos.z; this->timer = 45; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; BossVa_SetupAction(this, BossVa_BariIntro); } @@ -2521,7 +2524,7 @@ void BossVa_SetupBariPhase3Attack(BossVa* this, PlayState* play) { this->unk_1F0 = 0x78; this->unk_1A0 = 60.0f; this->unk_1A8 = 0.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; BossVa_SetupAction(this, BossVa_BariPhase3Attack); } @@ -2543,7 +2546,8 @@ void BossVa_BariPhase3Attack(BossVa* this, PlayState* play) { this->vaBariUnused.y += this->vaBariUnused.z; if ((this->colliderLightning.base.atFlags & AT_HIT) || (this->colliderSph.base.atFlags & AT_HIT)) { if ((this->colliderLightning.base.at == &player->actor) || (this->colliderSph.base.at == &player->actor)) { - func_8002F71C(play, &this->actor, 8.0f, GET_BODY(this)->actor.yawTowardsPlayer, 8.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, GET_BODY(this)->actor.yawTowardsPlayer, + 8.0f); Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT); this->colliderSph.base.at = NULL; this->colliderLightning.base.at = NULL; @@ -2608,7 +2612,7 @@ void BossVa_SetupBariPhase2Attack(BossVa* this, PlayState* play) { this->unk_1F0 = 0x78; this->unk_1A0 = 60.0f; this->unk_1A8 = 0.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; BossVa_SetupAction(this, BossVa_BariPhase2Attack); } @@ -2638,7 +2642,8 @@ void BossVa_BariPhase2Attack(BossVa* this, PlayState* play) { if ((this->colliderLightning.base.atFlags & AT_HIT) || (this->colliderSph.base.atFlags & AT_HIT)) { if ((this->colliderLightning.base.at == &player->actor) || (this->colliderSph.base.at == &player->actor)) { - func_8002F71C(play, &this->actor, 8.0f, GET_BODY(this)->actor.yawTowardsPlayer, 8.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, GET_BODY(this)->actor.yawTowardsPlayer, + 8.0f); Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT); this->colliderSph.base.at = NULL; this->colliderLightning.base.at = NULL; @@ -2658,8 +2663,8 @@ void BossVa_BariPhase2Attack(BossVa* this, PlayState* play) { if (!(sPhase2Timer & 0x100) && (GET_BODY(this)->actor.colorFilterTimer == 0)) { sp4C = 200.0f; BossVa_Spark(play, this, 1, 125, 15.0f, 7.0f, SPARK_TETHER, 1.0f, true); - this->actor.flags &= ~ACTOR_FLAG_0; - if (this->actor.params & 1) { + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; + if (PARAMS_GET_U(this->actor.params, 0, 1)) { sp4C = -200.0f; } @@ -2681,7 +2686,7 @@ void BossVa_BariPhase2Attack(BossVa* this, PlayState* play) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderLightning.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderSph.base); } else { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; Math_SmoothStepToS(&this->unk_1AC, sp50 + 150, 1, 0x3C, 0); if (GET_BODY(this)->actor.colorFilterTimer == 0) { Math_SmoothStepToF(&this->unk_1A0, 180.0f, 1.0f, 1.5f, 0.0f); @@ -2722,7 +2727,7 @@ void BossVa_BariPhase2Attack(BossVa* this, PlayState* play) { } void BossVa_SetupBariPhase3Stunned(BossVa* this, PlayState* play) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->timer = GET_BODY(this)->timer; Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, this->timer); BossVa_SetupAction(this, BossVa_BariPhase3Stunned); @@ -2755,7 +2760,7 @@ void BossVa_BariPhase3Stunned(BossVa* this, PlayState* play) { } else { BossVa_Spark(play, this, 1, 85, 15.0f, 0.0f, SPARK_TETHER, 1.0f, true); if (this->timer2 >= 0x10) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->timer2 = 0x80; BossVa_SetupAction(this, BossVa_BariPhase3Attack); } @@ -2764,7 +2769,7 @@ void BossVa_BariPhase3Stunned(BossVa* this, PlayState* play) { } void BossVa_SetupBariDeath(BossVa* this) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->timer = 30; Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_BL_DEAD); this->isDead++; @@ -2782,7 +2787,7 @@ void BossVa_SetupDoor(BossVa* this, PlayState* play) { if (sCsState >= INTRO_SPAWN_BARI) { sDoorState = 100; } - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; BossVa_SetupAction(this, BossVa_Door); } @@ -2894,12 +2899,10 @@ void BossVa_BodyPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* Matrix_MultVec3f(&sp78, &this->unk_1D8); } else if ((limbIndex >= 10) && (limbIndex < 20) && (sBodyBari[limbIndex - 10] != 0)) { if (((limbIndex >= 16) || (limbIndex == 10)) && (sFightPhase <= PHASE_3)) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_va.c", 4208), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_va.c", 4208); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_008BB8); } else if ((limbIndex >= 11) && (sFightPhase <= PHASE_2)) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_va.c", 4212), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_va.c", 4212); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_008BB8); } @@ -2913,12 +2916,10 @@ void BossVa_BodyPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* gSPSegment(POLY_XLU_DISP++, 0x09, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, (play->gameplayFrames * 10) % 128, 16, 32, 1, 0, (play->gameplayFrames * 5) % 128, 16, 32)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_va.c", 4232), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_va.c", 4232); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_008D70); } else if ((*dList != NULL) && (limbIndex >= 29) && (limbIndex < 56)) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_va.c", 4236), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_va.c", 4236); gSPDisplayList(POLY_XLU_DISP++, *dList); } else if ((limbIndex == 24) && (sCsState < DEATH_START)) { sp78.x = (this->actor.shape.yOffset + 450.0f) + -140.0f; @@ -3140,17 +3141,13 @@ void BossVa_BariPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* gSPSegment(POLY_XLU_DISP++, 0x0A, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, (play->gameplayFrames * 10) % 32, 16, 32, 1, 0, (play->gameplayFrames * -5) % 32, 16, 32)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_va.c", 4508), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_va.c", 4508); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_000FA0); } else if ((limbIndex == 3) || (limbIndex == 4)) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_va.c", 4512), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_boss_va.c", 4512); gSPDisplayList(POLY_XLU_DISP++, *dList); } - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_boss_va.c", 4517); } @@ -3513,8 +3510,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_RotateZ((effect->rot.z / (f32)0x8000) * 3.1416f, MTXMODE_APPLY); Matrix_Scale(effect->scale * 0.0185f, effect->scale * 0.0185f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_va.c", 4976), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_va.c", 4976); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_015710); } } @@ -3532,8 +3528,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, PlayState* play) { Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY); Matrix_RotateZ((effect->rot.z / (f32)0x8000) * 3.1416f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_va.c", 5002), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_va.c", 5002); gDPPipeSync(POLY_XLU_DISP++); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sSparkBallTex[effect->mode])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, effect->mode); @@ -3570,8 +3565,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, PlayState* play) { Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); gDPPipeSync(POLY_XLU_DISP++); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_va.c", 5052), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_va.c", 5052); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_009468); } } @@ -3593,8 +3587,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, PlayState* play) { Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_va.c", 5080), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_boss_va.c", 5080); gSPDisplayList(POLY_OPA_DISP++, gBarinadeDL_012948); } } @@ -3625,8 +3618,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, PlayState* play) { Matrix_RotateY(-(effect->offset.x * 0.13f), MTXMODE_APPLY); Matrix_RotateX(-(effect->offset.x * 0.115f), MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_va.c", 5124), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_boss_va.c", 5124); gSPDisplayList(POLY_OPA_DISP++, gBarinadeDL_012C50); } } @@ -3648,8 +3640,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, PlayState* play) { Matrix_RotateZYX(effect->rot.x, effect->rot.y, 0, MTXMODE_APPLY); Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_va.c", 5152), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_va.c", 5152); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_013638); } } @@ -3670,8 +3661,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, PlayState* play) { Matrix_RotateZ((effect->rot.z / (f32)0x8000) * 3.1416f, MTXMODE_APPLY); Matrix_Scale(effect->scale * 0.02f, effect->scale * 0.02f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_va.c", 5180), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_va.c", 5180); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_015710); } } @@ -3692,8 +3682,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, PlayState* play) { Matrix_RotateY((effect->rot.y / (f32)0x8000) * 3.1416f, MTXMODE_APPLY); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_va.c", 5208), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_boss_va.c", 5208); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_008F70); } } @@ -3988,8 +3977,7 @@ void BossVa_DrawDoor(PlayState* play, s16 scale) { Matrix_RotateZ(segAngle, MTXMODE_APPLY); Matrix_Translate(0.0f, doorPieceLength[i] * yScale, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_va.c", 5621), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_boss_va.c", 5621); gSPDisplayList(POLY_OPA_DISP++, doorPieceDispList[i]); segAngle -= M_PI / 4; } diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.h b/src/overlays/actors/ovl_Boss_Va/z_boss_va.h index 3b5a1ab826..f5e6c8a896 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.h +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.h @@ -47,7 +47,7 @@ typedef struct BossVa { /* 0x0338 */ ColliderQuad colliderLightning; } BossVa; // size = 0x03B8 -typedef enum { +typedef enum BossVaParam { /* -1 */ BOSSVA_BODY = -1, /* 0 */ BOSSVA_SUPPORT_1, /* 1 */ BOSSVA_SUPPORT_2, diff --git a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c index c2b949c27c..1887f64672 100644 --- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -37,7 +37,7 @@ void func_80968B70(Actor* thisx, PlayState* play); void func_80968FB0(Actor* thisx, PlayState* play); void func_809691BC(Demo6K* this, PlayState* play, s32 cueChannel); -ActorInit Demo_6K_InitVars = { +ActorProfile Demo_6K_Profile = { /**/ ACTOR_DEMO_6K, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -207,11 +207,11 @@ void Demo6K_WaitForObject(Demo6K* this, PlayState* play) { void func_80966E04(Demo6K* this, PlayState* play) { if (play->csCtx.curFrame > 214) { - func_8002F948(&this->actor, NA_SE_EV_LIGHT_GATHER - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->actor, NA_SE_EV_LIGHT_GATHER - SFX_FLAG); } if (play->csCtx.curFrame > 264) { - func_8002F948(&this->actor, NA_SE_EV_GOD_LIGHTBALL_2 - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->actor, NA_SE_EV_GOD_LIGHTBALL_2 - SFX_FLAG); } if ((play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.actorCues[6] != NULL) && @@ -222,8 +222,8 @@ void func_80966E04(Demo6K* this, PlayState* play) { void func_80966E98(Demo6K* this, PlayState* play) { if (play->csCtx.curFrame < 353) { - func_8002F948(&this->actor, NA_SE_EV_LIGHT_GATHER - SFX_FLAG); - func_8002F948(&this->actor, NA_SE_EV_GOD_LIGHTBALL_2 - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->actor, NA_SE_EV_LIGHT_GATHER - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->actor, NA_SE_EV_GOD_LIGHTBALL_2 - SFX_FLAG); } if (play->csCtx.curFrame == 342) { @@ -300,7 +300,7 @@ void func_8096712C(Demo6K* this, PlayState* play) { this->timer2++; if ((play->sceneId == SCENE_INSIDE_GANONS_CASTLE) && (play->csCtx.curFrame < D_8096932C[this->actor.params - 3])) { - func_8002F974(&this->actor, NA_SE_EV_LIGHT_GATHER - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_LIGHT_GATHER - SFX_FLAG); } } @@ -465,7 +465,7 @@ void func_80967AD0(Demo6K* this, PlayState* play) { if ((play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.actorCues[1] != NULL)) { if (play->csCtx.actorCues[1]->id == 2) { this->unk_170++; - func_8002F948(&this->actor, NA_SE_EV_RAINBOW_SHOWER - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->actor, NA_SE_EV_RAINBOW_SHOWER - SFX_FLAG); } func_809691BC(this, play, 1); @@ -571,27 +571,22 @@ void func_80967FFC(Actor* thisx, PlayState* play) { { s32 i; - s32 pad; - Color_RGB8 colors[6][2] = { - { { 255, 170, 255 }, { 255, 0, 100 } }, { { 255, 255, 170 }, { 0, 255, 0 } }, - { { 255, 255, 170 }, { 255, 255, 0 } }, { { 255, 170, 255 }, { 50, 0, 255 } }, - { { 255, 255, 170 }, { 255, 100, 0 } }, { { 170, 255, 255 }, { 0, 100, 255 } }, + s32 j; + Color_RGB8 colors[12] = { + { 255, 170, 255 }, { 255, 0, 100 }, { 255, 255, 170 }, { 0, 255, 0 }, { 255, 255, 170 }, { 255, 255, 0 }, + { 255, 170, 255 }, { 50, 0, 255 }, { 255, 255, 170 }, { 255, 100, 0 }, { 170, 255, 255 }, { 0, 100, 255 }, }; Matrix_RotateZ(-M_PI / 2, MTXMODE_APPLY); - for (i = 0; i < 6; i++) { + for (i = 0, j = 0; i < 6; i++, j += 2) { Matrix_RotateZ(M_PI / 3, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_6k.c", 1115), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_6k.c", 1115); gDPPipeSync(POLY_XLU_DISP++); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, colors[i][0].r, colors[i][0].g, colors[i][0].b, 255); - gDPSetEnvColor(POLY_XLU_DISP++, colors[i][1].r, colors[i][1].g, colors[i][1].b, 255); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, colors[j + 0].r, colors[j + 0].g, colors[j + 0].b, 255); + gDPSetEnvColor(POLY_XLU_DISP++, colors[j + 1].r, colors[j + 1].g, colors[j + 1].b, 255); gSPDisplayList(POLY_XLU_DISP++, object_demo_6k_DL_0022B0); } - - // required to avoid optimizing out i - if ((s16)i) {} } CLOSE_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1127); @@ -628,8 +623,7 @@ void func_80968298(Actor* thisx, PlayState* play) { } Matrix_RotateX(-M_PI / 2, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_6k.c", 1170), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_6k.c", 1170); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 210, 210, 210, 255); gDPSetEnvColor(POLY_XLU_DISP++, 100, 100, 100, 255); gSPSegment(POLY_XLU_DISP++, 0x08, @@ -638,8 +632,7 @@ void func_80968298(Actor* thisx, PlayState* play) { (timer1 * 12) & 0xFFF, 64, 32)); gSPDisplayList(POLY_XLU_DISP++, object_demo_6k_DL_0039D0); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_6k.c", 1189), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_6k.c", 1189); Gfx_SetupDL_25Xlu(play->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(POLY_XLU_DISP++, 50, 50, 50, 255); @@ -669,13 +662,11 @@ void func_8096865C(Actor* thisx, PlayState* play) { Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); Matrix_Push(); Matrix_RotateZ(DEG_TO_RAD(this->timer2 * 6), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_6k.c", 1230), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_6k.c", 1230); gSPDisplayList(POLY_XLU_DISP++, displayList); Matrix_Pop(); Matrix_RotateZ(DEG_TO_RAD(-(f32)(this->timer2 * 6)), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_6k.c", 1236), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_6k.c", 1236); gSPDisplayList(POLY_XLU_DISP++, displayList); } @@ -706,8 +697,7 @@ void func_809688C4(Actor* thisx, PlayState* play2) { this->unk_234[i] * D_8096931C[(frames + i) & 3], this->unk_234[i] * D_8096931C[(frames + i) & 3], MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_6k.c", 1297), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_6k.c", 1297); gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL); Matrix_Pop(); } @@ -725,15 +715,12 @@ void func_80968B70(Actor* thisx, PlayState* play) { u8 primColor[4]; u8 envColor[3]; - if (1) {} - OPEN_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1316); Gfx_SetupDL_25Xlu(play->state.gfxCtx); Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); Matrix_RotateX(M_PI / 2, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_6k.c", 1322), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_6k.c", 1322); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0xFF - ((timer2 * 2) & 0xFF), 0, 32, 32, 1, 0xFF - ((timer2 * 2) & 0xFF), (timer2 * 15) & 0x3FF, 16, 64)); @@ -781,14 +768,12 @@ void func_80968FB0(Actor* thisx, PlayState* play) { scaleFactor = ((s16)D_809693CC[(frames * 4) & 0xF] * 0.01f) + 1.0f; Matrix_Scale(this->actor.scale.x * scaleFactor, this->actor.scale.y * scaleFactor, this->actor.scale.z * scaleFactor, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_6k.c", 1394), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_6k.c", 1394); gSPSegment(POLY_XLU_DISP++, 0x08, displayList); gDPPipeSync(displayList++); - if (displayList) {} gDPSetPrimColor(displayList++, 0, 0x80, 255, 255, 255, this->unk_293); gDPSetRenderMode(displayList++, G_RM_PASS, G_RM_ZB_CLD_SURF2); - gSPEndDisplayList(displayList++); + gSPEndDisplayList(displayList); gDPSetEnvColor(POLY_XLU_DISP++, 255, 200, 0, 255); gSPDisplayList(POLY_XLU_DISP++, gGlowCircleSmallDL); diff --git a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c index 83955865d8..f5f8b9c196 100644 --- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c +++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c @@ -1042,7 +1042,7 @@ void DemoDu_Draw(Actor* thisx, PlayState* play) { sDrawFuncs[this->drawIndex](thisx, play); } -ActorInit Demo_Du_InitVars = { +ActorProfile Demo_Du_Profile = { /**/ ACTOR_DEMO_DU, /**/ ACTORCAT_NPC, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c index c3d0e6327b..0d6ba9ed5d 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c @@ -44,7 +44,7 @@ void DemoEc_Destroy(Actor* thisx, PlayState* play); void DemoEc_Update(Actor* thisx, PlayState* play); void DemoEc_Draw(Actor* thisx, PlayState* play); -typedef enum { +typedef enum DemoEcUpdateMode { /* 00 */ EC_UPDATE_COMMON, /* 01 */ EC_UPDATE_INGO, /* 02 */ EC_UPDATE_TALON, @@ -76,7 +76,7 @@ typedef enum { /* 28 */ EC_UPDATE_MALON } DemoEcUpdateMode; -typedef enum { +typedef enum DemoEcDrawconfig { /* 00 */ EC_DRAW_COMMON, /* 01 */ EC_DRAW_INGO, /* 02 */ EC_DRAW_TALON, @@ -176,20 +176,20 @@ void DemoEc_UpdateBgFlags(DemoEc* this, PlayState* play) { } void func_8096D594(DemoEc* this, PlayState* play) { - this->skelAnime.moveFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; - AnimTaskQueue_AddActorMove(play, &this->actor, &this->skelAnime, 1.0f); + this->skelAnime.movementFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; + AnimTaskQueue_AddActorMovement(play, &this->actor, &this->skelAnime, 1.0f); } void func_8096D5D4(DemoEc* this, PlayState* play) { this->skelAnime.baseTransl = this->skelAnime.jointTable[0]; this->skelAnime.prevTransl = this->skelAnime.jointTable[0]; - this->skelAnime.moveFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; - AnimTaskQueue_AddActorMove(play, &this->actor, &this->skelAnime, 1.0f); + this->skelAnime.movementFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; + AnimTaskQueue_AddActorMovement(play, &this->actor, &this->skelAnime, 1.0f); } void func_8096D64C(DemoEc* this, PlayState* play) { - this->skelAnime.moveFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; - AnimTaskQueue_AddActorMove(play, &this->actor, &this->skelAnime, 1.0f); + this->skelAnime.movementFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; + AnimTaskQueue_AddActorMovement(play, &this->actor, &this->skelAnime, 1.0f); } void DemoEc_UpdateEyes(DemoEc* this) { @@ -504,7 +504,7 @@ void DemoEc_DrawKokiriGirl(DemoEc* this, PlayState* play) { } void DemoEc_InitOldMan(DemoEc* this, PlayState* play) { DemoEc_UseDrawObject(this, play); - DemoEc_InitSkelAnime(this, play, &object_bji_Skel_0000F0); + DemoEc_InitSkelAnime(this, play, &gHylianOldManSkel); DemoEc_UseAnimationObject(this, play); DemoEc_ChangeAnimation(this, &gDemoEcOldManAnim, 0, 0.0f, false); func_8096D5D4(this, play); @@ -522,9 +522,9 @@ void DemoEc_UpdateOldMan(DemoEc* this, PlayState* play) { void DemoEc_DrawOldMan(DemoEc* this, PlayState* play) { static void* eyeTextures[] = { - object_bji_Tex_0005FC, - object_bji_Tex_0009FC, - object_bji_Tex_000DFC, + gHylianOldManEyeOpenTex, + gHylianOldManEyeHalfTex, + gHylianOldManEyeClosedTex, }; static u8 color1[] = { 0, 50, 100, 255 }; static u8 color2[] = { 0, 50, 160, 255 }; @@ -536,7 +536,7 @@ void DemoEc_DrawOldMan(DemoEc* this, PlayState* play) { void DemoEc_InitBeardedMan(DemoEc* this, PlayState* play) { DemoEc_UseDrawObject(this, play); - DemoEc_InitSkelAnime(this, play, &object_ahg_Skel_0000F0); + DemoEc_InitSkelAnime(this, play, &gHylianMan1Skel); DemoEc_UseAnimationObject(this, play); DemoEc_ChangeAnimation(this, &gDemoEcOldManAnim, 0, 0.0f, false); func_8096D5D4(this, play); @@ -554,9 +554,9 @@ void DemoEc_UpdateBeardedMan(DemoEc* this, PlayState* play) { void DemoEc_DrawBeardedMan(DemoEc* this, PlayState* play) { static void* eyeTextures[] = { - object_ahg_Tex_00057C, - object_ahg_Tex_00067C, - object_ahg_Tex_00077C, + gHylianMan1BeardedEyeOpenTex, + gHylianMan1BeardedEyeHalfTex, + gHylianMan1BeardedEyeClosedTex, }; static u8 color1[] = { 255, 255, 255, 255 }; static u8 color2[] = { 255, 255, 255, 255 }; @@ -568,7 +568,7 @@ void DemoEc_DrawBeardedMan(DemoEc* this, PlayState* play) { void DemoEc_InitWoman(DemoEc* this, PlayState* play) { DemoEc_UseDrawObject(this, play); - DemoEc_InitSkelAnime(this, play, &object_bob_Skel_0000F0); + DemoEc_InitSkelAnime(this, play, &gHylianWoman2Skel); DemoEc_UseAnimationObject(this, play); DemoEc_ChangeAnimation(this, &gDemoEcOldManAnim, 0, 0.0f, false); func_8096D5D4(this, play); @@ -586,9 +586,9 @@ void DemoEc_UpdateWoman(DemoEc* this, PlayState* play) { void DemoEc_DrawWoman(DemoEc* this, PlayState* play) { static void* eyeTextures[] = { - object_bob_Tex_0007C8, - object_bob_Tex_000FC8, - object_bob_Tex_0017C8, + gHylianWoman2EyeOpenTex, + gHylianWoman2EyeHalfTex, + gHylianWoman2EyeClosedTex, }; s32 eyeTexIndex = this->eyeTexIndex; void* eyeTexture = eyeTextures[eyeTexIndex]; @@ -598,7 +598,7 @@ void DemoEc_DrawWoman(DemoEc* this, PlayState* play) { void DemoEc_InitOldWoman(DemoEc* this, PlayState* play) { DemoEc_UseDrawObject(this, play); - DemoEc_InitSkelAnime(this, play, &object_bba_Skel_0000F0); + DemoEc_InitSkelAnime(this, play, &gHylianOldWomanSkel); DemoEc_UseAnimationObject(this, play); DemoEc_ChangeAnimation(this, &gDemoEcOldManAnim, 0, 0.0f, false); func_8096D5D4(this, play); @@ -614,7 +614,7 @@ void DemoEc_UpdateOldWoman(DemoEc* this, PlayState* play) { } void DemoEc_DrawOldWoman(DemoEc* this, PlayState* play) { - DemoEc_DrawSkeleton(this, play, &object_bba_Tex_0004C8, NULL, NULL, NULL); + DemoEc_DrawSkeleton(this, play, &gHylianOldWomanEyeTex, NULL, NULL, NULL); } void DemoEc_InitBossCarpenter(DemoEc* this, PlayState* play) { @@ -1369,7 +1369,7 @@ void DemoEc_Draw(Actor* thisx, PlayState* play) { } } -ActorInit Demo_Ec_InitVars = { +ActorProfile Demo_Ec_Profile = { /**/ ACTOR_DEMO_EC, /**/ ACTORCAT_NPC, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index e5db2e88a0..0467318591 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -1,5 +1,6 @@ #include "z_demo_effect.h" #include "terminal.h" +#include "versions.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_efc_crystal_light/object_efc_crystal_light.h" #include "assets/objects/object_efc_fire_ball/object_efc_fire_ball.h" @@ -62,7 +63,7 @@ void DemoEffect_SetStartPosFromCue(DemoEffect* this, PlayState* play, s32 cueCha void DemoEffect_SetPosRotFromCue(DemoEffect* this, PlayState* play, s32 cueChannel, s32 shouldUpdateFacing); void DemoEffect_MoveTowardCuePos(DemoEffect* this, PlayState* play, s32 cueChannel, f32 speed); -ActorInit Demo_Effect_InitVars = { +ActorProfile Demo_Effect_Profile = { /**/ ACTOR_DEMO_EFFECT, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -170,8 +171,8 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) { DemoEffect* crystalLight; DemoEffect* lightRing; - effectType = (this->actor.params & 0x00FF); - lightEffect = ((this->actor.params & 0xF000) >> 12); + effectType = PARAMS_GET_S(this->actor.params, 0, 8); + lightEffect = PARAMS_GET_S(this->actor.params, 12, 4); PRINTF(VT_FGCOL(CYAN) " no = %d\n" VT_RST, effectType); @@ -357,16 +358,16 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) { case DEMO_EFFECT_LIGHTRING_EXPANDING: this->initDrawFunc = DemoEffect_DrawLightRing; this->initUpdateFunc = DemoEffect_UpdateLightRingExpanding; - this->lightRing.timer = 20; - this->lightRing.timerIncrement = 4; + this->lightRing.timer = FRAMERATE_CONST(20, 6); + this->lightRing.timerIncrement = FRAMERATE_CONST(4, 5); this->lightRing.alpha = 255; break; case DEMO_EFFECT_LIGHTRING_TRIFORCE: this->initDrawFunc = DemoEffect_DrawLightRing; this->initUpdateFunc = DemoEffect_UpdateLightRingTriforce; - this->lightRing.timer = 20; - this->lightRing.timerIncrement = 4; + this->lightRing.timer = FRAMERATE_CONST(20, 6); + this->lightRing.timerIncrement = FRAMERATE_CONST(4, 5); this->lightRing.alpha = 0; this->cueChannel = 4; break; @@ -374,8 +375,8 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) { case DEMO_EFFECT_LIGHTRING_SHRINKING: this->initDrawFunc = DemoEffect_DrawLightRing; this->initUpdateFunc = DemoEffect_UpdateLightRingShrinking; - this->lightRing.timer = 351; - this->lightRing.timerIncrement = 2; + this->lightRing.timer = FRAMERATE_CONST(351, 405); + this->lightRing.timerIncrement = FRAMERATE_CONST(2, 3); this->lightRing.alpha = 0; break; @@ -504,7 +505,7 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) { void DemoEffect_Destroy(Actor* thisx, PlayState* play) { DemoEffect* this = (DemoEffect*)thisx; - s32 effectType = (this->actor.params & 0x00FF); + s32 effectType = PARAMS_GET_S(this->actor.params, 0, 8); if (effectType == DEMO_EFFECT_TIMEWARP_MASTERSWORD || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL) { @@ -661,7 +662,7 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, PlayState* play) { * 3) Timeblock is cleared with the Song of Time (Large and Small have different versions of Timewarp) */ void DemoEffect_InitTimeWarp(DemoEffect* this, PlayState* play) { - s32 effectType = (this->actor.params & 0x00FF); + s32 effectType = PARAMS_GET_S(this->actor.params, 0, 8); if (!SkelCurve_Init(play, &this->skelCurve, &gTimeWarpSkel, &gTimeWarpAnim)) { ASSERT(0, "0", "../z_demo_effect.c", 1283); @@ -756,7 +757,7 @@ void DemoEffect_UpdateTimeWarpReturnFromChamberOfSages(DemoEffect* this, PlaySta DemoEffect_TimewarpShrink(shrinkProgress * 5.0f); } - func_8002F948(&this->actor, NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->actor, NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); } /** @@ -773,14 +774,14 @@ void DemoEffect_UpdateTimeWarpTimeblock(DemoEffect* this, PlayState* play) { shrinkProgress = (100 - this->timeWarp.shrinkTimer) * 0.010f; scale = shrinkProgress * 0.14f; - if ((this->actor.params & 0x00FF) == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL) { + if (PARAMS_GET_S(this->actor.params, 0, 8) == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL) { scale *= 0.6f; } this->actor.scale.x = scale; this->actor.scale.z = scale; DemoEffect_TimewarpShrink(shrinkProgress); - func_8002F948(&this->actor, NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->actor, NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); return; } @@ -793,7 +794,7 @@ void DemoEffect_UpdateTimeWarpTimeblock(DemoEffect* this, PlayState* play) { * This is an Update Func that is only ran for one frame. */ void DemoEffect_InitTimeWarpTimeblock(DemoEffect* this, PlayState* play) { - func_8002F948(&this->actor, NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(&this->actor, NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); if (SkelCurve_Update(play, &this->skelCurve)) { SkelCurve_SetAnim(&this->skelCurve, &gTimeWarpAnim, 1.0f, 60.0f, 59.0f, 0.0f); @@ -834,7 +835,7 @@ void DemoEffect_UpdateTriforceSpot(DemoEffect* this, PlayState* play) { } if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0 && gSaveContext.sceneLayer == 6 && - play->csCtx.curFrame == 143) { + play->csCtx.curFrame == FRAMERATE_CONST(143, 120)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_RING_EXPLOSION); } } @@ -846,6 +847,9 @@ void DemoEffect_UpdateTriforceSpot(DemoEffect* this, PlayState* play) { */ void DemoEffect_UpdateLightRingShrinking(DemoEffect* this, PlayState* play) { if (this->lightRing.timer < this->lightRing.timerIncrement) { +#if OOT_VERSION < PAL_1_0 + this->lightRing.timer = 0; +#endif Actor_Kill(&this->actor); this->lightRing.timer = 0; } else { @@ -959,10 +963,18 @@ void DemoEffect_InitCreationFireball(DemoEffect* this, PlayState* play) { Actor* parent = this->actor.parent; this->actor.world.rot.y = parent->shape.rot.y; - this->fireBall.timer = 50; - this->actor.speed = 1.5f; - this->actor.minVelocityY = -1.5f; + + this->fireBall.timer = FRAMERATE_CONST(50, 42); + this->actor.speed = FRAMERATE_CONST(1.5f, 1.8f); + +#if OOT_VERSION < PAL_1_0 this->actor.gravity = -0.03f; + this->actor.minVelocityY = -1.5f; +#else + this->actor.minVelocityY = FRAMERATE_CONST(-1.5f, -2.5f); + this->actor.gravity = FRAMERATE_CONST(-0.03f, -0.05f); +#endif + this->updateFunc = DemoEffect_UpdateCreationFireball; } @@ -1016,7 +1028,7 @@ void DemoEffect_UpdateLightEffect(DemoEffect* this, PlayState* play) { u16 pad; s32 isLargeSize; - isLargeSize = ((this->actor.params & 0x0F00) >> 8); + isLargeSize = PARAMS_GET_S(this->actor.params, 8, 4); if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.actorCues[this->cueChannel] != NULL) { DemoEffect_SetPosRotFromCue(this, play, this->cueChannel, 0); @@ -1093,7 +1105,7 @@ void DemoEffect_UpdateLightEffect(DemoEffect* this, PlayState* play) { /** * Update action for the Lgt Shower Actor. - * The Lgt Shower Actor is the green light effect spawned by Farore in the Kokiri Forst creation cutscene. + * The Lgt Shower Actor is the green light effect spawned by Farore in the Kokiri Forest creation cutscene. * This function updates the scale and alpha of the Actor. */ void DemoEffect_UpdateLgtShower(DemoEffect* this, PlayState* play) { @@ -1134,22 +1146,22 @@ void DemoEffect_UpdateGodLgtDin(DemoEffect* this, PlayState* play) { if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0) { switch (gSaveContext.sceneLayer) { case 4: - if (play->csCtx.curFrame == 288) { + if (play->csCtx.curFrame == FRAMERATE_CONST(288, 240)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_PASS); } - if (play->csCtx.curFrame == 635) { + if (play->csCtx.curFrame == FRAMERATE_CONST(635, 535)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_PASS); } break; case 6: - if (play->csCtx.curFrame == 55) { + if (play->csCtx.curFrame == FRAMERATE_CONST(55, 25)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); } break; case 11: - if (play->csCtx.curFrame == 350) { + if (play->csCtx.curFrame == FRAMERATE_CONST(350, 353)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); } break; @@ -1189,19 +1201,18 @@ void DemoEffect_UpdateGodLgtNayru(DemoEffect* this, PlayState* play) { if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0) { switch (gSaveContext.sceneLayer) { case 4: - if (play->csCtx.curFrame == 298) { + if (play->csCtx.curFrame == FRAMERATE_CONST(298, 248)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_PASS); } break; - case 6: - if (play->csCtx.curFrame == 105) { + if (play->csCtx.curFrame == FRAMERATE_CONST(105, 88)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); } break; case 11: - if (play->csCtx.curFrame == 360) { + if (play->csCtx.curFrame == FRAMERATE_CONST(360, 362)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); } break; @@ -1209,10 +1220,10 @@ void DemoEffect_UpdateGodLgtNayru(DemoEffect* this, PlayState* play) { } if (gSaveContext.save.entranceIndex == ENTR_DEATH_MOUNTAIN_TRAIL_0 && gSaveContext.sceneLayer == 4) { - if (play->csCtx.curFrame == 72) { + if (play->csCtx.curFrame == FRAMERATE_CONST(72, 57)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); } - if (play->csCtx.curFrame == 80) { + if (play->csCtx.curFrame == FRAMERATE_CONST(80, 72)) { Audio_PlayCutsceneEffectsSequence(SEQ_CS_EFFECTS_NAYRU_MAGIC); } } @@ -1249,19 +1260,19 @@ void DemoEffect_UpdateGodLgtFarore(DemoEffect* this, PlayState* play) { if (gSaveContext.save.entranceIndex == ENTR_CUTSCENE_MAP_0) { switch (gSaveContext.sceneLayer) { case 4: - if (play->csCtx.curFrame == 315) { + if (play->csCtx.curFrame == FRAMERATE_CONST(315, 265)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_PASS); } break; case 6: - if (play->csCtx.curFrame == 80) { + if (play->csCtx.curFrame == FRAMERATE_CONST(80, 60)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); } break; case 11: - if (play->csCtx.curFrame == 370) { + if (play->csCtx.curFrame == FRAMERATE_CONST(370, 371)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); } break; @@ -1494,10 +1505,10 @@ void DemoEffect_JewelSparkle(DemoEffect* this, PlayState* play, s32 spawnerCount void DemoEffect_PlayJewelSfx(DemoEffect* this, PlayState* play) { if (!DemoEffect_CheckForCue(this, play, 1)) { if (this->actor.params == sSfxJewelId[0]) { - func_8002F974(&this->actor, NA_SE_EV_SPIRIT_STONE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_SPIRIT_STONE - SFX_FLAG); } else if (sSfxJewelId[0] == 0) { sSfxJewelId[0] = this->actor.params; - func_8002F974(&this->actor, NA_SE_EV_SPIRIT_STONE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_SPIRIT_STONE - SFX_FLAG); } } } @@ -1662,10 +1673,8 @@ void DemoEffect_DrawJewel(Actor* thisx, PlayState* play2) { if (!frames) {} gSPSegment(POLY_OPA_DISP++, 8, Gfx_TexScroll(play->state.gfxCtx, (u8)frames, (u8)frames, 16, 16)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2597), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2599), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 2597); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 2599); Gfx_SetupDL_25Xlu(play->state.gfxCtx); func_8002ED80(&this->actor, play, 0); gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, this->primXluColor[0], this->primXluColor[1], @@ -1706,24 +1715,21 @@ void DemoEffect_DrawCrystalLight(Actor* thisx, PlayState* play) { Matrix_RotateY(0.0f, MTXMODE_APPLY); Matrix_RotateX(DEG_TO_RAD(11), MTXMODE_APPLY); Matrix_Translate(0.0f, 150.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2661), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 2661); gSPDisplayList(POLY_XLU_DISP++, gCrystalLightDL); Matrix_Pop(); Matrix_Push(); Matrix_RotateY(DEG_TO_RAD(120), MTXMODE_APPLY); Matrix_RotateX(DEG_TO_RAD(11), MTXMODE_APPLY); Matrix_Translate(0.0f, 150.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2672), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 2672); gSPDisplayList(POLY_XLU_DISP++, gCrystalLightDL); Matrix_Pop(); Matrix_Push(); Matrix_RotateY(DEG_TO_RAD(240), MTXMODE_APPLY); Matrix_RotateX(DEG_TO_RAD(11), MTXMODE_APPLY); Matrix_Translate(0.0f, 150.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2683), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 2683); gSPDisplayList(POLY_XLU_DISP++, gCrystalLightDL); Matrix_Pop(); CLOSE_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2688); @@ -1737,8 +1743,7 @@ void DemoEffect_DrawFireBall(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 64, 64, 255, 200, 0, 255); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 255); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2709), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 2709); gSPMatrix(POLY_XLU_DISP++, play->billboardMtx, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPSegment(POLY_XLU_DISP++, 8, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 32, 32, 1, 0, @@ -1781,8 +1786,7 @@ void DemoEffect_DrawGodLgt(Actor* thisx, PlayState* play) { gDPSetEnvColor(POLY_XLU_DISP++, this->envXluColor[0], this->envXluColor[1], this->envXluColor[2], 255); Gfx_SetupDL_25Xlu(play->state.gfxCtx); Matrix_Push(); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2801), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 2801); gSPDisplayList(POLY_XLU_DISP++, gGoldenGoddessAuraDL); Gfx_SetupDL_25Opa(play->state.gfxCtx); func_8002EBCC(&this->actor, play, 0); @@ -1798,8 +1802,7 @@ void DemoEffect_DrawGodLgt(Actor* thisx, PlayState* play) { Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, -140.0f, 0.0f, MTXMODE_APPLY); Matrix_Scale(0.03f, 0.03f, 0.03f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2824), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 2824); gSPDisplayList(POLY_OPA_DISP++, gGoldenGoddessBodyDL); } @@ -1829,14 +1832,12 @@ void DemoEffect_DrawLightEffect(Actor* thisx, PlayState* play) { Matrix_Push(); Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); Matrix_RotateZ(DEG_TO_RAD(this->light.rotation), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2866), - G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 2866); gSPDisplayList(POLY_XLU_DISP++, flashDList); Matrix_Pop(); Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); Matrix_RotateZ(DEG_TO_RAD(-(f32)this->light.rotation), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2874), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 2874); gSPDisplayList(POLY_XLU_DISP++, flashDList); } } @@ -1854,8 +1855,7 @@ void DemoEffect_DrawBlueOrb(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); Matrix_RotateZ(BINANG_TO_RAD(this->blueOrb.rotation), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2901), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 2901); this->blueOrb.rotation += 0x01F4; gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL); CLOSE_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2907); @@ -1870,8 +1870,7 @@ void DemoEffect_DrawLgtShower(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 64, 64, 255, 255, 160, this->lgtShower.alpha); gDPSetEnvColor(POLY_XLU_DISP++, 50, 200, 0, 255); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2927), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 2927); gSPSegment(POLY_XLU_DISP++, 8, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (frames * 5) % 1024, 0, 256, 64, 1, (frames * 10) % 128, 512 - ((frames * 50) % 512), 32, 16)); @@ -1889,8 +1888,7 @@ void DemoEffect_DrawLightRing(Actor* thisx, PlayState* play2) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, 170, 255, 255, this->lightRing.alpha); gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, 255); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2963), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 2963); gSPSegment(POLY_XLU_DISP++, 8, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (frames * 5) % 64, 512 - ((frames * 2) % 512) - 1, 16, 128, 1, 0, 0, 8, 1024)); @@ -1913,8 +1911,7 @@ void DemoEffect_DrawTriforceSpot(Actor* thisx, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EV_AURORA - SFX_FLAG); Matrix_Push(); Matrix_Scale(1.0f, 2.4f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 3011), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 3011); gSPSegment(POLY_XLU_DISP++, 9, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 256 - ((frames * 4) % 256) - 1, 64, 64, 1, 0, 256 - ((frames * 2) % 256) - 1, 64, 32)); @@ -1928,16 +1925,14 @@ void DemoEffect_DrawTriforceSpot(Actor* thisx, PlayState* play) { if (this->triforceSpot.triforceSpotOpacity != 0) { Actor_PlaySfx(&this->actor, NA_SE_EV_TRIFORCE - SFX_FLAG); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 3042), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 3042); if (this->triforceSpot.triforceSpotOpacity < 250) { func_8002ED80(&this->actor, play, 0); Gfx_SetupDL_25Xlu(play->state.gfxCtx); gDPSetRenderMode(POLY_XLU_DISP++, G_RM_PASS, G_RM_AA_ZB_XLU_SURF2); Matrix_RotateY(BINANG_TO_RAD(this->triforceSpot.rotation), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 3053), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 3053); gSPSegment(POLY_XLU_DISP++, 8, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 32, 16, 1, 0, 0, 16, 8)); gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, 255, 255, 160, this->triforceSpot.triforceSpotOpacity); @@ -1948,8 +1943,7 @@ void DemoEffect_DrawTriforceSpot(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gDPSetRenderMode(POLY_OPA_DISP++, G_RM_PASS, G_RM_AA_ZB_OPA_SURF2); Matrix_RotateY(BINANG_TO_RAD(this->triforceSpot.rotation), MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 3085), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_demo_effect.c", 3085); gSPSegment(POLY_OPA_DISP++, 8, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 32, 16, 1, 0, 0, 16, 8)); gDPSetPrimColor(POLY_OPA_DISP++, 128, 128, 255, 255, 160, 255); @@ -2005,7 +1999,7 @@ s32 DemoEffect_OverrideLimbDrawTimeWarp(PlayState* play, SkelCurve* skelCurve, s void DemoEffect_DrawTimeWarp(Actor* thisx, PlayState* play) { GraphicsContext* gfxCtx = play->state.gfxCtx; DemoEffect* this = (DemoEffect*)thisx; - u8 effectType = (this->actor.params & 0x00FF); + u8 effectType = PARAMS_GET_S(this->actor.params, 0, 8); if (effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL || CutsceneFlags_Get(play, 1) || IS_CUTSCENE_LAYER || gSaveContext.save.entranceIndex == ENTR_TEMPLE_OF_TIME_4) { diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h index 2e7263e58c..d3c2768bdb 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h @@ -8,71 +8,71 @@ struct DemoEffect; typedef void (*DemoEffectFunc)(struct DemoEffect*, PlayState*); -typedef struct { +typedef struct DemoEffectFireBall { /* 0x00 */ u8 timer; } DemoEffectFireBall; -typedef struct { +typedef struct DemoEffectBlueOrb { /* 0x00 */ u8 alpha; /* 0x01 */ u8 scale; /* 0x02 */ u8 pad; /* 0x04 */ s16 rotation; } DemoEffectBlueOrb; -typedef struct { +typedef struct DemoEffectLight { /* 0x00 */ u8 alpha; /* 0x01 */ u8 scaleFlag; /* 0x02 */ u8 flicker; /* 0x04 */ s16 rotation; } DemoEffectLight; -typedef struct { +typedef struct DemoEffectLgtShower { /* 0x00 */ u8 alpha; } DemoEffectLgtShower; -typedef struct { +typedef struct DemoEffectGodLgt { /* 0x00 */ u8 type; /* 0x01 */ u8 lightRingSpawnDelay; /* 0x02 */ u8 rotation; /* 0x04 */ s16 lightRingSpawnTimer; } DemoEffectGodLgt; -typedef struct { +typedef struct DemoEffectLightRing { /* 0x00 */ u8 timerIncrement; /* 0x01 */ u8 alpha; /* 0x02 */ u8 pad; /* 0x04 */ s16 timer; } DemoEffectLightRing; -typedef struct { +typedef struct DemoEffectTriforceSpot { /* 0x00 */ u8 triforceSpotOpacity; /* 0x01 */ u8 lightColumnOpacity; /* 0x02 */ u8 crystalLightOpacity; /* 0x04 */ s16 rotation; } DemoEffectTriforceSpot; -typedef struct { +typedef struct DemoEffectGetItem { /* 0x00 */ u8 isPositionInit; /* 0x01 */ u8 isLoaded; /* 0x02 */ u8 drawId; /* 0x04 */ s16 rotation; } DemoEffectGetItem; -typedef struct { +typedef struct DemoEffectTimeWarp { /* 0x00 */ u8 pad; /* 0x01 */ u8 pad2; /* 0x02 */ u8 pad3; /* 0x04 */ s16 shrinkTimer; } DemoEffectTimeWarp; -typedef struct { +typedef struct DemoEffectJewel { /* 0x00 */ u8 type; /* 0x01 */ u8 isPositionInit; /* 0x02 */ u8 alpha; /* 0x04 */ s16 timer; } DemoEffectJewel; -typedef struct { +typedef struct DemoEffectDust { /* 0x00 */ u8 timer; } DemoEffectDust; @@ -108,7 +108,7 @@ typedef struct DemoEffect { } DemoEffect; // size = 0x01A0 // These names come from the objects that correspond to this actor type. -typedef enum { +typedef enum DemoEffectType { /* 0x00 */ DEMO_EFFECT_CRYSTAL_LIGHT, /* 0x01 */ DEMO_EFFECT_FIRE_BALL, /* 0x02 */ DEMO_EFFECT_BLUE_ORB, // Object is in GAMEPLAY_KEEP. Not a name from object. It's a blue orb. @@ -138,7 +138,7 @@ typedef enum { /* 0x1A */ DEMO_EFFECT_MAX_TYPE } DemoEffectType; -typedef enum { +typedef enum DemoEffectLightColor { /* 0x00 */ DEMO_EFFECT_LIGHT_RED, /* 0x01 */ DEMO_EFFECT_LIGHT_BLUE, /* 0x02 */ DEMO_EFFECT_LIGHT_GREEN, @@ -148,7 +148,7 @@ typedef enum { /* 0x06 */ DEMO_EFFECT_LIGHT_GREEN2 } DemoEffectLightColor; -typedef enum { +typedef enum DemoEffectGodLgtType { /* 0x00 */ GOD_LGT_DIN, /* 0x01 */ GOD_LGT_NAYRU, /* 0x02 */ GOD_LGT_FARORE diff --git a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c index b80f419979..94bda4604b 100644 --- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c +++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c @@ -10,13 +10,13 @@ #define FLAGS ACTOR_FLAG_4 -typedef enum { +typedef enum DemoExtAction { /* 0x00 */ EXT_WAIT, /* 0x01 */ EXT_MAINTAIN, /* 0x02 */ EXT_DISPELL } DemoExtAction; -typedef enum { +typedef enum DemoExtDrawMode { /* 0x00 */ EXT_DRAW_NOTHING, /* 0x01 */ EXT_DRAW_VORTEX } DemoExtDrawMode; @@ -191,6 +191,7 @@ void DemoExt_DrawVortex(Actor* thisx, PlayState* play) { s16* curScroll; Vec3f* scale; + curScroll = this->curScroll; scale = &this->scale; gfxCtx = play->state.gfxCtx; mtx = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); @@ -206,8 +207,6 @@ void DemoExt_DrawVortex(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, kREG(33) + 128, kREG(25) + 140, kREG(26) + 80, kREG(27) + 140, this->primAlpha); gDPSetEnvColor(POLY_XLU_DISP++, kREG(29) + 90, kREG(30) + 50, kREG(31) + 95, this->envAlpha); - - curScroll = this->curScroll; gSPSegment( POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(gfxCtx, 0, curScroll[0], curScroll[1], 0x40, 0x40, 1, curScroll[2], curScroll[3], 0x40, 0x40)); @@ -236,7 +235,7 @@ void DemoExt_Draw(Actor* thisx, PlayState* play) { } } -ActorInit Demo_Ext_InitVars = { +ActorProfile Demo_Ext_Profile = { /**/ ACTOR_DEMO_EXT, /**/ ACTORCAT_NPC, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c index e3f0565eb4..3f8aff556b 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c @@ -42,7 +42,7 @@ static DemoGeffDrawFunc sDrawFuncs[] = { func_80978344, }; -ActorInit Demo_Geff_InitVars = { +ActorProfile Demo_Geff_Profile = { /**/ ACTOR_DEMO_GEFF, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -76,7 +76,8 @@ void func_80977EA8(PlayState* play, Gfx* dlist) { Gfx_SetupDL_25Opa(gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_demo_geff.c", 183), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(POLY_OPA_DISP++, MATRIX_FINALIZE(gfxCtx, "../z_demo_geff.c", 183), + G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, dlist); gSPPopMatrix(POLY_OPA_DISP++, G_MTX_MODELVIEW); diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index b19eed0f27..40d1682acb 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -17,14 +17,14 @@ void DemoGj_Draw(Actor* thisx, PlayState* play); static ColliderCylinderInitType1 sCylinderInit1 = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -36,14 +36,14 @@ static ColliderCylinderInitType1 sCylinderInit1 = { static ColliderCylinderInitType1 sCylinderInit2 = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -55,14 +55,14 @@ static ColliderCylinderInitType1 sCylinderInit2 = { static ColliderCylinderInitType1 sCylinderInit3 = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -77,23 +77,23 @@ typedef void (*DemoGjDrawFunc)(DemoGj*, PlayState*); // bits 11-15 s32 DemoGj_GetCollectibleType(DemoGj* this) { - s32 params = this->dyna.actor.params >> 0xB; + s32 type = PARAMS_GET_U(this->dyna.actor.params, 11, 5); - return params & 0x1F; + return type; } // bits 8-10 s32 DemoGj_GetCollectibleAmount(DemoGj* this) { - s32 params = this->dyna.actor.params >> 0x8; + s32 amount = PARAMS_GET_U(this->dyna.actor.params, 8, 3); - return params & 7; + return amount; } // bits 0-7 s32 DemoGj_GetType(DemoGj* this) { - s32 params = this->dyna.actor.params; + s32 type = PARAMS_GET_U(this->dyna.actor.params, 0, 8); - return params & 0xFF; + return type; } void DemoGj_InitCylinder(DemoGj* this, PlayState* play, ColliderCylinder* cylinder, @@ -270,7 +270,7 @@ void DemoGj_DrawCommon(DemoGj* this, PlayState* play, Gfx* displayList) { Gfx_SetupDL_25Opa(gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_demo_gj.c", 1165), + gSPMatrix(POLY_OPA_DISP++, MATRIX_FINALIZE(gfxCtx, "../z_demo_gj.c", 1165), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, displayList); @@ -1415,7 +1415,7 @@ void DemoGj_Init(Actor* thisx, PlayState* play) { default: // "Demo_Gj_Actor_ct There is no such argument!!!!!!!!!!!!!!!!!!!!!!" - PRINTF(VT_FGCOL(RED) "Demo_Gj_Actor_ct そんな引数は無い!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST, play, this); + PRINTF(VT_FGCOL(RED) "Demo_Gj_Actor_ct そんな引数は無い!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); Actor_Kill(&this->dyna.actor); } } @@ -1457,7 +1457,7 @@ void DemoGj_Draw(Actor* thisx, PlayState* play) { sDrawFuncs[this->drawConfig](this, play); } -ActorInit Demo_Gj_InitVars = { +ActorProfile Demo_Gj_Profile = { /**/ ACTOR_DEMO_GJ, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h index 928e92c19c..a29362c9e8 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h @@ -28,7 +28,7 @@ typedef struct DemoGj { * bits 8-10: The amount of collectible that will be dropped when killed. * bits 0- 7: A value of the enum DemoGjType. */ -typedef enum { +typedef enum DemoGjType { /* 04 */ DEMOGJ_TYPE_AROUNDARENA = 4, // This is the indestructible rubble around the arena. This actor keeps alive the whole fight. /* 08 */ DEMOGJ_TYPE_RUBBLE_PILE_1 = 8, // DEMOGJ_TYPE_RUBBLE_PILE_X are the rubbles from where Ganondorf rises. When he transforms into Ganon these are removed from the scene (Actor_Kill). /* 09 */ DEMOGJ_TYPE_RUBBLE_PILE_2, diff --git a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c index 432b8ce63d..2a6ac15c52 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -37,7 +37,7 @@ static DemoGoDrawFunc D_8097D468[] = { func_8097D29C, }; -ActorInit Demo_Go_InitVars = { +ActorProfile Demo_Go_Profile = { /**/ ACTOR_DEMO_GO, /**/ ACTORCAT_NPC, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c index 9fb56c1d65..10ffc6248c 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c @@ -629,11 +629,11 @@ void DemoGt_Update8(DemoGt* this, PlayState* play) { func_8097EF00(this, play); } -void DemoGt_Draw1(DemoGt* this, PlayState* play) { +void DemoGt_Draw1(Actor* thisx, PlayState* play) { s32 pad; GraphicsContext* gfxCtx = play->state.gfxCtx; u32 gameplayFrames = play->gameplayFrames; - s16 pad2[2]; + DemoGt* this = (DemoGt*)thisx; s16 spC6; f32 spC0; f32 spBC; @@ -859,21 +859,22 @@ void DemoGt_Update9(DemoGt* this, PlayState* play) { func_8097FD70(this, play); } -void DemoGt_Draw2(DemoGt* this, PlayState* play) { +void DemoGt_Draw2(Actor* thisx, PlayState* play) { GraphicsContext* gfxCtx = play->state.gfxCtx; s32* unk198; s32* unk178; - s32 pad; + DemoGt* this = (DemoGt*)thisx; OPEN_DISPS(gfxCtx, "../z_demo_gt_part2.c", 470); Gfx_SetupDL_25Opa(gfxCtx); unk198 = this->unk_198; unk178 = this->unk_178; + if (1) {} gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_TwoTexScrollEnvColor(gfxCtx, 0, 0, unk198[0], 0x20, 0x40, 1, 0, unk198[1], 0x20, 0x40, unk178[0], unk178[1], unk178[2], 128)); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_demo_gt_part2.c", 485), + gSPMatrix(POLY_OPA_DISP++, MATRIX_FINALIZE(gfxCtx, "../z_demo_gt_part2.c", 485), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gTowerCollapseCsCollapsedStructureInnerDL); gSPPopMatrix(POLY_OPA_DISP++, G_MTX_MODELVIEW); @@ -1179,13 +1180,13 @@ void DemoGt_Update10(DemoGt* this, PlayState* play) { func_80980C90(this, play); } -void DemoGt_Draw3(DemoGt* this, PlayState* play) { +void DemoGt_Draw3(Actor* thisx, PlayState* play) { GraphicsContext* gfxCtx = play->state.gfxCtx; OPEN_DISPS(gfxCtx, "../z_demo_gt_part3.c", 1026); Gfx_SetupDL_25Opa(gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_demo_gt_part3.c", 1028), + gSPMatrix(POLY_OPA_DISP++, MATRIX_FINALIZE(gfxCtx, "../z_demo_gt_part3.c", 1028), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gTowerCollapseCsCollapsedStructureOuterDL); gSPPopMatrix(POLY_OPA_DISP++, G_MTX_MODELVIEW); @@ -1258,11 +1259,11 @@ void DemoGt_Update16(DemoGt* this, PlayState* play) { } } -void DemoGt_Draw4(DemoGt* this, PlayState* play2) { +void DemoGt_Draw4(Actor* thisx, PlayState* play2) { GraphicsContext* gfxCtx; PlayState* play = play2; u16 csCurFrame = play->csCtx.curFrame; - s32 pad; + DemoGt* this = (DemoGt*)thisx; s16 sp76; f32 sp70; f32 sp6C; @@ -1307,7 +1308,7 @@ void DemoGt_Draw4(DemoGt* this, PlayState* play2) { Matrix_Pop(); Gfx_SetupDL_25Opa(gfxCtx); - gSPMatrix(POLY_OPA_DISP++, sp60, (G_MTX_PUSH | G_MTX_LOAD) | G_MTX_MODELVIEW); + gSPMatrix(POLY_OPA_DISP++, sp60, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gTowerCollapseCsStandalonePillarDL); gSPPopMatrix(POLY_OPA_DISP++, G_MTX_MODELVIEW); @@ -1380,9 +1381,9 @@ void DemoGt_Update17(DemoGt* this, PlayState* play) { } } -void DemoGt_Draw5(DemoGt* this, PlayState* play) { +void DemoGt_Draw5(Actor* thisx, PlayState* play) { GraphicsContext* gfxCtx; - s32 pad; + DemoGt* this = (DemoGt*)thisx; s16 sp76; f32 sp70; f32 sp6C; @@ -1477,9 +1478,9 @@ void DemoGt_Update18(DemoGt* this, PlayState* play) { } } -void DemoGt_Draw6(DemoGt* this, PlayState* play) { - DemoGt* this2 = this; - s16 sp78 = this2->unk_172; +void DemoGt_Draw6(Actor* thisx, PlayState* play) { + DemoGt* this = (DemoGt*)thisx; + s16 sp78 = this->unk_172; f32 sp74; f32 sp70; s16 sp6E; @@ -1569,8 +1570,8 @@ void DemoGt_Update14(DemoGt* this, PlayState* play) { func_80981CEC(this, play); } -void DemoGt_Draw7(DemoGt* this, PlayState* play) { - DemoGt* this2 = this; +void DemoGt_Draw7(Actor* thisx, PlayState* play) { + DemoGt* this = (DemoGt*)thisx; GraphicsContext* gfxCtx = play->state.gfxCtx; s16 sp6E; f32 sp68; @@ -1582,7 +1583,7 @@ void DemoGt_Draw7(DemoGt* this, PlayState* play) { Vec3f sp44; f32 sp40; - sp6E = this2->unk_172; + sp6E = this->unk_172; sp68 = fabsf(BINANG_TO_RAD(sp6E)); sp64 = kREG(75); sp62 = kREG(74) + 0x7FEC; @@ -1660,8 +1661,8 @@ void DemoGt_Update15(DemoGt* this, PlayState* play) { func_809820AC(this, play); } -void DemoGt_Draw8(DemoGt* this, PlayState* play) { - DemoGt* this2 = this; +void DemoGt_Draw8(Actor* thisx, PlayState* play) { + DemoGt* this = (DemoGt*)thisx; GraphicsContext* gfxCtx = play->state.gfxCtx; s16 sp6E; f32 sp68; @@ -1673,7 +1674,7 @@ void DemoGt_Draw8(DemoGt* this, PlayState* play) { Vec3f sp44; f32 sp40; - sp6E = this2->unk_172; + sp6E = this->unk_172; sp68 = fabsf(BINANG_TO_RAD(sp6E)); sp64 = kREG(78); sp62 = kREG(77) + 0xBE80; @@ -1762,7 +1763,7 @@ void DemoGt_Init(Actor* thisx, PlayState* play) { } } -void DemoGt_Draw0(DemoGt* this, PlayState* play) { +void DemoGt_Draw0(Actor* thisx, PlayState* play) { } static DemoGtDrawFunc sDrawFuncs[] = { @@ -1780,10 +1781,10 @@ void DemoGt_Draw(Actor* thisx, PlayState* play) { return; } - drawFunc(this, play); + drawFunc(thisx, play); } -ActorInit Demo_Gt_InitVars = { +ActorProfile Demo_Gt_Profile = { /**/ ACTOR_DEMO_GT, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h index 83cae1cc18..18b968b15c 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h @@ -7,7 +7,7 @@ struct DemoGt; typedef void (*DemoGtUpdateFunc)(struct DemoGt*, PlayState*); -typedef void (*DemoGtDrawFunc)(struct DemoGt*, PlayState*); +typedef void (*DemoGtDrawFunc)(Actor*, PlayState*); typedef struct DemoGt { /* 0x0000 */ DynaPolyActor dyna; diff --git a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c index fcb7817e65..88cdaa7203 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -54,12 +54,12 @@ s32 DemoIk_CheckForCue(PlayState* play, u16 cueId, s32 cueChannel) { } void DemoIk_SetMove(DemoIk* this, PlayState* play) { - this->skelAnime.moveFlags |= ANIM_FLAG_UPDATE_XZ; - AnimTaskQueue_AddActorMove(play, &this->actor, &this->skelAnime, 1.0f); + this->skelAnime.movementFlags |= ANIM_FLAG_UPDATE_XZ; + AnimTaskQueue_AddActorMovement(play, &this->actor, &this->skelAnime, 1.0f); } void DemoIk_EndMove(DemoIk* this) { - this->skelAnime.moveFlags &= ~ANIM_FLAG_UPDATE_XZ; + this->skelAnime.movementFlags &= ~ANIM_FLAG_UPDATE_XZ; } f32 DemoIk_GetCurFrame(DemoIk* this) { @@ -266,13 +266,11 @@ void DemoIk_Type1PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s if (limbIndex == 1) { switch (this->actor.params) { case 0: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_demo_ik_inArmer.c", 390), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_demo_ik_inArmer.c", 390); gSPDisplayList(POLY_XLU_DISP++, gIronKnuckleArmorRivetAndSymbolDL); break; case 2: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_demo_ik_inArmer.c", 396), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_demo_ik_inArmer.c", 396); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016F88); break; } @@ -423,23 +421,19 @@ void DemoIk_Type2PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s if (limbIndex == 1 && (frame >= 30.0f)) { switch (this->actor.params) { case 3: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_demo_ik_inFace.c", 274), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_demo_ik_inFace.c", 274); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_017028); break; case 4: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_demo_ik_inFace.c", 280), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_demo_ik_inFace.c", 280); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_017170); break; case 5: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_demo_ik_inFace.c", 286), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_demo_ik_inFace.c", 286); gSPDisplayList(POLY_XLU_DISP++, gIronKnuckleArmorRivetAndSymbolDL); break; default: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_demo_ik_inFace.c", 292), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_demo_ik_inFace.c", 292); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016CD8); break; } @@ -503,7 +497,7 @@ void DemoIk_Draw(Actor* thisx, PlayState* play) { sDrawFuncs[this->drawMode](this, play); } -ActorInit Demo_Ik_InitVars = { +ActorProfile Demo_Ik_Profile = { /**/ ACTOR_DEMO_IK, /**/ ACTORCAT_NPC, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index 00db512d31..6dea40452e 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -11,7 +11,7 @@ #include "assets/objects/object_im/object_im.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4) void DemoIm_Init(Actor* thisx, PlayState* play); void DemoIm_Destroy(Actor* thisx, PlayState* play); @@ -64,7 +64,7 @@ static u32 D_8098783C = 0; static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_PLAYER, @@ -92,7 +92,7 @@ static DemoImDrawFunc sDrawFuncs[] = { DemoIm_DrawTranslucent, }; -ActorInit Demo_Im_InitVars = { +ActorProfile Demo_Im_Profile = { /**/ ACTOR_DEMO_IM, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -861,7 +861,7 @@ s32 func_80986A5C(DemoIm* this, PlayState* play) { } s32 func_80986AD0(DemoIm* this, PlayState* play) { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; if (!Actor_TalkOfferAccepted(&this->actor, play)) { this->actor.textId = 0x708E; Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play); @@ -957,7 +957,7 @@ void func_80986DC8(DemoIm* this, PlayState* play) { DemoIm_UpdateSkelAnime(this); func_80984BE0(this); func_80984E58(this, play); - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); } void func_80986E20(DemoIm* this, PlayState* play) { @@ -1004,7 +1004,7 @@ void func_80986FA8(DemoIm* this, PlayState* play) { DemoIm_UpdateSkelAnime(this); func_80984BE0(this); func_80984E58(this, play); - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); DemoIm_UpdateCollider(this, play); func_80986CFC(this, play); } @@ -1122,7 +1122,7 @@ void DemoIm_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); DemoIm_InitCollider(thisx, play); SkelAnime_InitFlex(play, &this->skelAnime, &gImpaSkel, NULL, this->jointTable, this->morphTable, 17); - thisx->flags &= ~ACTOR_FLAG_0; + thisx->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; switch (this->actor.params) { case 2: diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.h b/src/overlays/actors/ovl_Demo_Im/z_demo_im.h index 93fb427ddf..94744969be 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.h +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.h @@ -9,7 +9,7 @@ struct DemoIm; typedef void (*DemoImActionFunc)(struct DemoIm*, PlayState*); typedef void (*DemoImDrawFunc)(struct DemoIm*, PlayState*); -typedef enum { +typedef enum ImpaLimb { /* 0x00 */ IMPA_LIMB_NONE, /* 0x01 */ IMPA_LIMB_ROOT, /* 0x02 */ IMPA_LIMB_TORSO, diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index f2f1941750..9cb632da8a 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -1,9 +1,14 @@ #include "z_demo_kankyo.h" +#include "global.h" +#include "versions.h" #include "z64cutscene_commands.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_efc_star_field/object_efc_star_field.h" #include "assets/objects/object_toki_objects/object_toki_objects.h" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:128" + #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) void DemoKankyo_Init(Actor* thisx, PlayState* play); @@ -14,7 +19,7 @@ void DemoKankyo_Draw(Actor* thisx, PlayState* play); void DemoKankyo_SetupType(DemoKankyo* this, PlayState* play); void DemoKankyo_UpdateClouds(DemoKankyo* this, PlayState* play); void DemoKankyo_UpdateRock(DemoKankyo* this, PlayState* play); -void DemoKankyo_DoNothing2(DemoKankyo* this, PlayState* play); +void DemoKankyo_UpdateWarpIn(DemoKankyo* this, PlayState* play); void DemoKankyo_UpdateDoorOfTime(DemoKankyo* this, PlayState* play); void DemoKankyo_DoNothing(DemoKankyo* this, PlayState* play); void DemoKankyo_KillDoorOfTimeCollision(DemoKankyo* this, PlayState* play); @@ -40,7 +45,7 @@ extern CutsceneData gChildWarpOutCS[]; extern CutsceneData gChildWarpInToTCS[]; extern CutsceneData gChildWarpOutToTCS[]; -ActorInit Demo_Kankyo_InitVars = { +ActorProfile Demo_Kankyo_Profile = { /**/ ACTOR_DEMO_KANKYO, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -236,7 +241,7 @@ void DemoKankyo_Init(Actor* thisx, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_TOKI, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x0000); } else { - play->roomCtx.unk_74[1] = 0xFF; + play->roomCtx.drawParams[1] = 0xFF; Actor_Kill(&this->actor); } break; @@ -355,7 +360,7 @@ void DemoKankyo_SetupType(DemoKankyo* this, PlayState* play) { } } gSaveContext.cutsceneTrigger = 1; - DemoKankyo_SetupAction(this, DemoKankyo_DoNothing2); + DemoKankyo_SetupAction(this, DemoKankyo_UpdateWarpIn); break; case DEMOKANKYO_BLUE_RAIN: case DEMOKANKYO_SPARKLES: @@ -367,7 +372,11 @@ void DemoKankyo_SetupType(DemoKankyo* this, PlayState* play) { void DemoKankyo_DoNothing(DemoKankyo* this, PlayState* play) { } -void DemoKankyo_DoNothing2(DemoKankyo* this, PlayState* play) { +void DemoKankyo_UpdateWarpIn(DemoKankyo* this, PlayState* play) { +#if OOT_VERSION < PAL_1_0 + Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); +#endif DemoKankyo_SetupAction(this, DemoKankyo_DoNothing); } @@ -625,8 +634,7 @@ void DemoKankyo_DrawRain(Actor* thisx, PlayState* play) { } Matrix_Translate(translateX, translateY, translateZ, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_kankyo.c", 1344), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_kankyo.c", 1344); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_20); gSPDisplayList(POLY_XLU_DISP++, object_efc_star_field_DL_000080); } @@ -648,8 +656,7 @@ void DemoKankyo_DrawRock(Actor* thisx, PlayState* play) { Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 155, 55, 255); gDPSetEnvColor(POLY_OPA_DISP++, 155, 255, 55, 255); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_kankyo.c", 1404), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_demo_kankyo.c", 1404); gSPDisplayList(POLY_OPA_DISP++, object_efc_star_field_DL_000DE0); CLOSE_DISPS(play->state.gfxCtx, "../z_demo_kankyo.c", 1409); @@ -679,8 +686,7 @@ void DemoKankyo_DrawClouds(Actor* thisx, PlayState* play) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 255); gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE); gDPSetColorDither(POLY_XLU_DISP++, G_AD_NOTPATTERN | G_CD_MAGICSQ); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_kankyo.c", 1461), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_kankyo.c", 1461); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gDust5Tex)); Gfx_SetupDL_61Xlu(play->state.gfxCtx); @@ -700,12 +706,10 @@ void DemoKankyo_DrawDoorOfTime(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Matrix_Translate(-this->unk_150[0].unk_18, 0.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_kankyo.c", 1492), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_demo_kankyo.c", 1492); gSPDisplayList(POLY_OPA_DISP++, object_toki_objects_DL_007440); Matrix_Translate(this->unk_150[0].unk_18 + this->unk_150[0].unk_18, 0.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_kankyo.c", 1497), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_demo_kankyo.c", 1497); gSPDisplayList(POLY_OPA_DISP++, object_toki_objects_DL_007578); CLOSE_DISPS(play->state.gfxCtx, "../z_demo_kankyo.c", 1501); @@ -721,8 +725,7 @@ void DemoKankyo_DrawLightPlane(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TexScroll(play->state.gfxCtx, 0, play->state.frames & 0x7F, 64, 32)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_kankyo.c", 1529), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_kankyo.c", 1529); gSPDisplayList(POLY_XLU_DISP++, object_toki_objects_DL_008390); } @@ -764,11 +767,11 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { static u32 D_8098CF94; static Vec3f D_8098CF98; + PlayState* play2 = (PlayState*)play; s16 i; f32 temp_f22; DemoKankyo* this = (DemoKankyo*)thisx; - Gfx* disp; - Player* player = GET_PLAYER(play); + Player* player = GET_PLAYER(play2); Vec3f camPos; f32 translateX; f32 translateY; @@ -800,17 +803,19 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { &this->unk_150[i].unk_1C) != 0) { this->unk_150[i].unk_22++; } - if (play->sceneId == SCENE_TEMPLE_OF_TIME && play->csCtx.curFrame == 25) { + if (play2->sceneId == SCENE_TEMPLE_OF_TIME && play2->csCtx.curFrame == 25) { this->unk_150[i].unk_22++; } } else { +#if OOT_VERSION >= PAL_1_0 Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP_OUT - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); +#endif if (func_800BB2B4(&camPos, &sWarpRoll, &sWarpFoV, sWarpInCameraPoints, &this->unk_150[i].unk_20, &this->unk_150[i].unk_1C) != 0) { this->unk_150[i].unk_22++; } - if (D_8098CF84 < play->csCtx.curFrame && this->actor.params == DEMOKANKYO_WARP_OUT) { + if (D_8098CF84 < play2->csCtx.curFrame && this->actor.params == DEMOKANKYO_WARP_OUT) { this->unk_150[i].unk_22++; } } @@ -820,11 +825,11 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { case 2: if (this->actor.params == DEMOKANKYO_WARP_OUT) { if (i == 0) { - Environment_WarpSongLeave(play); + Environment_WarpSongLeave(play2); this->unk_150[i].unk_22++; } - } else if (i + 1 == this->sparkleCounter && play->csCtx.state == CS_STATE_IDLE) { - Interface_SetSubTimerToFinalSecond(play); + } else if (i + 1 == this->sparkleCounter && play2->csCtx.state == CS_STATE_IDLE) { + Interface_SetSubTimerToFinalSecond(play2); Actor_Kill(&this->actor); } break; @@ -862,7 +867,6 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { translateZ = this->unk_150[i].unk_C.z + this->unk_150[i].unk_0.z; if (this->unk_150[i].unk_22 < 2) { - disp = (Gfx*)(uintptr_t)gEffFlash1DL; // necessary to match but probably fake if (linkAge != LINK_AGE_ADULT) { Matrix_Translate(translateX, translateY, translateZ, MTXMODE_NEW); } else { @@ -873,9 +877,9 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { this->unk_150[i].unk_18 * (0.018f * temp_f22), MTXMODE_APPLY); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 255, 255); if (this->actor.params == DEMOKANKYO_WARP_OUT) { - gDPSetEnvColor(POLY_XLU_DISP++, sWarpSparkleEnvColors[play->msgCtx.lastPlayedSong].r, - sWarpSparkleEnvColors[play->msgCtx.lastPlayedSong].g, - sWarpSparkleEnvColors[play->msgCtx.lastPlayedSong].b, 255); + gDPSetEnvColor(POLY_XLU_DISP++, sWarpSparkleEnvColors[play2->msgCtx.lastPlayedSong].r, + sWarpSparkleEnvColors[play2->msgCtx.lastPlayedSong].g, + sWarpSparkleEnvColors[play2->msgCtx.lastPlayedSong].b, 255); } else { s8 respawnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data; @@ -883,11 +887,10 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { sWarpSparkleEnvColors[respawnData].g, sWarpSparkleEnvColors[respawnData].b, 255); } Gfx_SetupDL_25Xlu(play->state.gfxCtx); - Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); + Matrix_Mult(&play2->billboardMtxF, MTXMODE_APPLY); Matrix_RotateZ(DEG_TO_RAD(this->unk_150[i].unk_24), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_kankyo.c", 2011), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, disp); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_kankyo.c", 2011); + gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL); this->unk_150[i].unk_24 += 0x190; } } @@ -989,8 +992,7 @@ void DemoKankyo_DrawSparkles(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); Matrix_RotateZ(DEG_TO_RAD(this->unk_150[i].unk_24), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_kankyo.c", 2572), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_kankyo.c", 2572); gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL); this->unk_150[i].unk_24 += 0x190; } diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h index 0103812c6f..06501904ac 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h @@ -2,13 +2,13 @@ #define Z_DEMO_KANKYO_H #include "ultra64.h" -#include "global.h" +#include "z64actor.h" struct DemoKankyo; -typedef void (*DemoKankyoActionFunc)(struct DemoKankyo*, PlayState*); +typedef void (*DemoKankyoActionFunc)(struct DemoKankyo*, struct PlayState*); -typedef enum { +typedef enum DemoKankyoType { /* 0x00 */ DEMOKANKYO_BLUE_RAIN, /* 0x01 */ DEMOKANKYO_BLUE_RAIN_2, /* 0x02 */ DEMOKANKYO_ROCK_1, @@ -29,7 +29,7 @@ typedef enum { /* 0x11 */ DEMOKANKYO_SPARKLES } DemoKankyoType; -typedef struct { +typedef struct DemoKankyoUnk150 { /* 0x00 */ Vec3f unk_0; /* 0x0C */ Vec3f unk_C; /* 0x18 */ f32 unk_18; // For Door of Time, this is the amount to translate it by used for when it's opening diff --git a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c index 9568574a4b..21f7a4c763 100644 --- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -21,7 +21,7 @@ void DemoKekkai_DrawTrialBarrier(Actor* thisx, PlayState* play2); void DemoKekkai_TowerBarrier(DemoKekkai* this, PlayState* play); -ActorInit Demo_Kekkai_InitVars = { +ActorProfile Demo_Kekkai_Profile = { /**/ ACTOR_DEMO_KEKKAI, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -35,7 +35,7 @@ ActorInit Demo_Kekkai_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -43,7 +43,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x07, 0x04 }, { 0x00002000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -178,7 +178,7 @@ void DemoKekkai_TowerBarrier(DemoKekkai* this, PlayState* play) { } } if (!(this->sfxFlag & 1)) { - func_8002F974(&this->actor, NA_SE_EV_TOWER_BARRIER - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_TOWER_BARRIER - SFX_FLAG); } } @@ -188,7 +188,7 @@ void DemoKekkai_Update(Actor* thisx, PlayState* play2) { if (this->energyAlpha > 0.99f) { if ((this->collider1.base.atFlags & AT_HIT) || (this->collider2.base.atFlags & AT_HIT)) { - func_8002F71C(play, &this->actor, 6.0f, this->actor.yawTowardsPlayer, 6.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 6.0f, this->actor.yawTowardsPlayer, 6.0f); } CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider1.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider1.base); @@ -226,7 +226,7 @@ void DemoKekkai_TrialBarrierDispel(Actor* thisx, PlayState* play) { this->orbScale = 0.0f; } if (this->orbScale != 0.0f) { - func_8002F974(&this->actor, NA_SE_EV_TOWER_ENERGY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_TOWER_ENERGY - SFX_FLAG); } this->timer++; } @@ -246,7 +246,7 @@ void DemoKekkai_TrialBarrierIdle(Actor* thisx, PlayState* play) { DemoKekkai* this = (DemoKekkai*)thisx; if (this->collider1.base.atFlags & AT_HIT) { - func_8002F71C(play, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 5.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 5.0f); } CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider1.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider1.base); @@ -260,7 +260,7 @@ void DemoKekkai_TrialBarrierIdle(Actor* thisx, PlayState* play) { gSaveContext.cutsceneTrigger = 1; } CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider2.base); - func_8002F974(&this->actor, NA_SE_EV_TOWER_ENERGY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_TOWER_ENERGY - SFX_FLAG); } void DemoKekkai_DrawTrialBarrier(Actor* thisx, PlayState* play2) { @@ -298,15 +298,13 @@ void DemoKekkai_DrawTrialBarrier(Actor* thisx, PlayState* play2) { Matrix_Translate(0.0f, 1200.0f, 0.0f, MTXMODE_APPLY); Matrix_Scale(this->orbScale, this->orbScale, this->orbScale, MTXMODE_APPLY); Matrix_Translate(0.0f, -1200.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_kekkai.c", 639), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_kekkai.c", 639); gSPSegment(POLY_XLU_DISP++, 0x09, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, frames * 5, frames * -10, 0x20, 0x20, 1, frames * 5, frames * -10, 0x20, 0x20)); gSPDisplayList(POLY_XLU_DISP++, gTrialBarrierOrbDL); Matrix_Pop(); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_kekkai.c", 656), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_kekkai.c", 656); gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0x00, 0x80, 50, 0, 100, 255); gSPSegment(POLY_XLU_DISP++, 0x0A, @@ -333,8 +331,7 @@ void DemoKekkai_DrawTowerBarrier(Actor* thisx, PlayState* play) { scroll = (s32)this->barrierScroll & 0xFFFF; OPEN_DISPS(play->state.gfxCtx, "../z_demo_kekkai.c", 705); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_kekkai.c", 707), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_kekkai.c", 707); gDPSetPrimColor(POLY_XLU_DISP++, 0x00, 0x80, 255, 170, 255, 255); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, scroll * 2, scroll * -4, 0x20, 0x40, 1, scroll * 2, diff --git a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h index c6711097e4..8e396c4ec6 100644 --- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h +++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h @@ -21,7 +21,7 @@ typedef struct DemoKekkai { /* 0x01F8 */ DemoKekkaiUpdateFunc updateFunc; } DemoKekkai; // size = 0x01FC -typedef enum { +typedef enum DemoKekkaiType { /* 0 */ KEKKAI_TOWER, /* 1 */ KEKKAI_WATER, /* 2 */ KEKKAI_LIGHT, diff --git a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c index 5107668b81..305288d43c 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c @@ -44,7 +44,7 @@ void DemoSa_DrawNothing(DemoSa* this, PlayState* play); void DemoSa_DrawOpa(DemoSa* this, PlayState* play); void DemoSa_DrawXlu(DemoSa* this, PlayState* play); -typedef enum { +typedef enum SariaEyeState { /* 0 */ SARIA_EYE_OPEN, /* 1 */ SARIA_EYE_HALF, /* 2 */ SARIA_EYE_CLOSED, @@ -52,7 +52,7 @@ typedef enum { /* 4 */ SARIA_EYE_SAD } SariaEyeState; -typedef enum { +typedef enum SariaMouthState { /* 0 */ SARIA_MOUTH_CLOSED2, /* 1 */ SARIA_MOUTH_SUPRISED, /* 2 */ SARIA_MOUTH_CLOSED, @@ -87,7 +87,7 @@ static DemoSaDrawFunc sDrawFuncs[] = { DemoSa_DrawXlu, }; -ActorInit Demo_Sa_InitVars = { +ActorProfile Demo_Sa_Profile = { /**/ ACTOR_DEMO_SA, /**/ ACTORCAT_NPC, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c index 19272d5042..2b373bec30 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c @@ -15,7 +15,7 @@ void DemoShd_Draw(Actor* thisx, PlayState* play); void func_80991298(DemoShd* this, PlayState* play); -ActorInit Demo_Shd_InitVars = { +ActorProfile Demo_Shd_Profile = { /**/ ACTOR_DEMO_SHD, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -101,8 +101,7 @@ void DemoShd_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_shd.c", 729), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_demo_shd.c", 729); gSPDisplayList(POLY_XLU_DISP++, D_809932D0); if (this->unk_14C & 1) { @@ -117,7 +116,5 @@ void DemoShd_Draw(Actor* thisx, PlayState* play) { gSPDisplayList(POLY_XLU_DISP++, D_809934B8); } - if (1) {} // Necessary to match - CLOSE_DISPS(play->state.gfxCtx, "../z_demo_shd.c", 762); } diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c index cd6966eb05..d71810b23d 100644 --- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c +++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c @@ -14,7 +14,7 @@ void func_80993754(DemoTreLgt* this); void func_8099375C(DemoTreLgt* this, PlayState* play); void func_809937B4(DemoTreLgt* this, PlayState* play, f32 currentFrame); -typedef struct { +typedef struct DemoTreLgtInfo { /* 0x00 */ f32 startFrame; /* 0x04 */ f32 endFrame; /* 0x08 */ f32 unk_08; @@ -26,7 +26,7 @@ static DemoTreLgtInfo sDemoTreLgtInfo[] = { { 1.0f, 136.0f, 220.0f, 50.0f }, }; -ActorInit Demo_Tre_Lgt_InitVars = { +ActorProfile Demo_Tre_Lgt_Profile = { /**/ ACTOR_DEMO_TRE_LGT, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h index bd8e2e4df8..0cad6996d9 100644 --- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h +++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h @@ -17,7 +17,7 @@ typedef struct DemoTreLgt { /* 0x0178 */ u8 status; } DemoTreLgt; // size = 0x017C -typedef enum { +typedef enum DemoTreLgtAction { /* 0x00 */ DEMO_TRE_LGT_ACTION_WAIT, // wait until animation is needed /* 0x01 */ DEMO_TRE_LGT_ACTION_ANIMATE } DemoTreLgtAction; diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 5487a20b4c..7ad6013661 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -18,7 +18,7 @@ void DoorAna_WaitClosed(DoorAna* this, PlayState* play); void DoorAna_WaitOpen(DoorAna* this, PlayState* play); void DoorAna_GrabPlayer(DoorAna* this, PlayState* play); -ActorInit Door_Ana_InitVars = { +ActorProfile Door_Ana_Profile = { /**/ ACTOR_DOOR_ANA, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -32,7 +32,7 @@ ActorInit Door_Ana_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -40,7 +40,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0x00000048, 0x00, 0x00 }, ATELEM_NONE, @@ -66,9 +66,9 @@ void DoorAna_Init(Actor* thisx, PlayState* play) { this->actor.shape.rot.z = 0; this->actor.shape.rot.y = this->actor.shape.rot.z; // init block for grottos that are initially "hidden" (require explosives/hammer/song of storms to open) - if ((this->actor.params & 0x300) != 0) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 8, 2) != 0) { // only allocate collider for grottos that need bombing/hammering open - if ((this->actor.params & 0x200) != 0) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 9, 1) != 0) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); } else { @@ -79,14 +79,14 @@ void DoorAna_Init(Actor* thisx, PlayState* play) { } else { DoorAna_SetupAction(this, DoorAna_WaitOpen); } - this->actor.targetMode = 0; + this->actor.attentionRangeType = ATTENTION_RANGE_0; } void DoorAna_Destroy(Actor* thisx, PlayState* play) { DoorAna* this = (DoorAna*)thisx; // free collider if it has one - if ((this->actor.params & 0x200) != 0) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 9, 1) != 0) { Collider_DestroyCylinder(play, &this->collider); } } @@ -95,7 +95,7 @@ void DoorAna_Destroy(Actor* thisx, PlayState* play) { void DoorAna_WaitClosed(DoorAna* this, PlayState* play) { u32 openGrotto = false; - if (!(this->actor.params & 0x200)) { + if (!PARAMS_GET_NOSHIFT(this->actor.params, 9, 1)) { // opening with song of storms if (this->actor.xyzDistToPlayerSq < SQ(200.0f) && CutsceneFlags_Get(play, 5)) { openGrotto = true; @@ -128,13 +128,13 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) { player = GET_PLAYER(play); if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f)) { - if ((this->actor.targetMode != 0) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && + if ((this->actor.attentionRangeType != 0) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && (player->stateFlags1 & PLAYER_STATE1_31) && (player->av1.actionVar1 == 0)) { - destinationIdx = ((this->actor.params >> 0xC) & 7) - 1; + destinationIdx = PARAMS_GET_U(this->actor.params, 12, 3) - 1; Play_SetupRespawnPoint(play, RESPAWN_MODE_RETURN, 0x4FF); gSaveContext.respawn[RESPAWN_MODE_RETURN].pos.y = this->actor.world.pos.y; gSaveContext.respawn[RESPAWN_MODE_RETURN].yaw = this->actor.home.rot.y; - gSaveContext.respawn[RESPAWN_MODE_RETURN].data = this->actor.params & 0xFFFF; + gSaveContext.respawn[RESPAWN_MODE_RETURN].data = PARAMS_GET_U(this->actor.params, 0, 16); if (destinationIdx < 0) { destinationIdx = this->actor.home.rot.z + 1; } @@ -145,9 +145,9 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) { this->actor.xzDistToPlayer <= 15.0f && -50.0f <= this->actor.yDistToPlayer && this->actor.yDistToPlayer <= 15.0f) { player->stateFlags1 |= PLAYER_STATE1_31; - this->actor.targetMode = 1; + this->actor.attentionRangeType = ATTENTION_RANGE_1; } else { - this->actor.targetMode = 0; + this->actor.attentionRangeType = ATTENTION_RANGE_0; } } } @@ -177,8 +177,7 @@ void DoorAna_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_door_ana.c", 440); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_door_ana.c", 446), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_door_ana.c", 446); gSPDisplayList(POLY_XLU_DISP++, gGrottoDL); CLOSE_DISPS(play->state.gfxCtx, "../z_door_ana.c", 449); diff --git a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c index 160a159596..360f4aedec 100644 --- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c +++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c @@ -19,7 +19,7 @@ s32 func_80994750(DoorGerudo* this, PlayState* play); void func_8099496C(DoorGerudo* this, PlayState* play); void func_809949C8(DoorGerudo* this, PlayState* play); -ActorInit Door_Gerudo_InitVars = { +ActorProfile Door_Gerudo_Profile = { /**/ ACTOR_DOOR_GERUDO, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -44,7 +44,7 @@ void DoorGerudo_Init(Actor* thisx, PlayState* play) { CollisionHeader_GetVirtual(&gGerudoCellDoorCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - if (Flags_GetSwitch(play, thisx->params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) { this->actionFunc = func_8099485C; thisx->world.pos.y = thisx->home.pos.y + 200.0f; } else { @@ -67,7 +67,7 @@ f32 func_809946BC(PlayState* play, DoorGerudo* this, f32 arg2, f32 arg3, f32 arg playerPos.x = player->actor.world.pos.x; playerPos.y = player->actor.world.pos.y + arg2; playerPos.z = player->actor.world.pos.z; - func_8002DBD0(&this->dyna.actor, &sp1C, &playerPos); + Actor_WorldToActorCoords(&this->dyna.actor, &sp1C, &playerPos); if ((arg3 < fabsf(sp1C.x)) || (arg4 < fabsf(sp1C.y))) { return MAXFLOAT; @@ -100,7 +100,7 @@ void func_8099485C(DoorGerudo* this, PlayState* play) { if (this->isActive) { this->actionFunc = func_8099496C; gSaveContext.save.info.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1; - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK); } else { s32 direction = func_80994750(this, play); @@ -110,7 +110,7 @@ void func_8099485C(DoorGerudo* this, PlayState* play) { if (gSaveContext.save.info.inventory.dungeonKeys[gSaveContext.mapIndex] <= 0) { player->naviTextId = -0x203; - } else if (!Flags_GetCollectible(play, (this->dyna.actor.params >> 8) & 0x1F)) { + } else if (!Flags_GetCollectible(play, PARAMS_GET_U(this->dyna.actor.params, 8, 5))) { player->naviTextId = -0x225; } else { player->doorType = PLAYER_DOORTYPE_SLIDING; @@ -147,8 +147,7 @@ void DoorGerudo_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_door_gerudo.c", 365), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_door_gerudo.c", 365); gSPDisplayList(POLY_OPA_DISP++, gGerudoCellDoorDL); if (this->unk_166 != 0) { diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 26630ef776..01e2762657 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -13,7 +13,7 @@ #define FLAGS ACTOR_FLAG_4 -typedef enum { +typedef enum DoorKillerBehaviour { /* 0 */ DOOR_KILLER_DOOR, /* 1 */ DOOR_KILLER_RUBBLE_PIECE_1, /* 2 */ DOOR_KILLER_RUBBLE_PIECE_2, @@ -29,7 +29,7 @@ void DoorKiller_WaitForObject(DoorKiller* this, PlayState* play); void DoorKiller_DrawDoor(Actor* thisx, PlayState* play); void DoorKiller_DrawRubble(Actor* thisx, PlayState* play); -ActorInit Door_Killer_InitVars = { +ActorProfile Door_Killer_Profile = { /**/ ACTOR_DOOR_KILLER, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -43,7 +43,7 @@ ActorInit Door_Killer_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -51,7 +51,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0x0001FFEE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -64,7 +64,7 @@ static ColliderCylinderInit sCylinderInit = { static ColliderJntSphElementInit sJntSphItemsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -77,7 +77,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -121,7 +121,7 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) { this->openAnim = 0; this->playerIsOpening = false; - switch ((u8)(this->actor.params & 0xFF)) { + switch ((u8)PARAMS_GET_U(this->actor.params, 0, 8)) { case DOOR_KILLER_DOOR: // `jointTable` is used for both the `jointTable` and `morphTable` args here. Because this actor doesn't // play any animations it does not cause problems, but it would need to be changed otherwise. @@ -144,8 +144,8 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) { this->colliderJntSph.elements[0].dim.worldSphere.center.z = (s16)this->actor.world.pos.z; // If tied to a switch flag and that switch flag is already set, kill the actor. - if ((((this->actor.params >> 8) & 0x3F) != 0x3F) && - Flags_GetSwitch(play, ((this->actor.params >> 8) & 0x3F))) { + if ((PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) && + Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { Actor_Kill(&this->actor); } break; @@ -180,7 +180,7 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) { void DoorKiller_Destroy(Actor* thisx, PlayState* play) { DoorKiller* this = (DoorKiller*)thisx; - if ((thisx->params & 0xFF) == DOOR_KILLER_DOOR) { + if (PARAMS_GET_U(thisx->params, 0, 8) == DOOR_KILLER_DOOR) { Collider_DestroyCylinder(play, &this->colliderCylinder); Collider_DestroyJntSph(play, &this->colliderJntSph); } @@ -241,7 +241,7 @@ void DoorKiller_SetAC(DoorKiller* this, PlayState* play) { } void DoorKiller_Die(DoorKiller* this, PlayState* play) { - s32 switchFlag = (this->actor.params >> 8) & 0x3F; + s32 switchFlag = PARAMS_GET_U(this->actor.params, 8, 6); // Can set a switch flag on death based on params if (switchFlag != 0x3F) { @@ -349,11 +349,11 @@ void DoorKiller_FallOver(DoorKiller* this, PlayState* play) { if (!(this->hasHitPlayerOrGround & 1)) { Vec3f playerPosRelToDoor; Player* player = GET_PLAYER(play); - func_8002DBD0(&this->actor, &playerPosRelToDoor, &player->actor.world.pos); + Actor_WorldToActorCoords(&this->actor, &playerPosRelToDoor, &player->actor.world.pos); if ((fabsf(playerPosRelToDoor.y) < 20.0f) && (fabsf(playerPosRelToDoor.x) < 20.0f) && (playerPosRelToDoor.z < 100.0f) && (playerPosRelToDoor.z > 0.0f)) { this->hasHitPlayerOrGround |= 1; - func_8002F6D4(play, &this->actor, 6.0f, this->actor.yawTowardsPlayer, 6.0f, 16); + Actor_SetPlayerKnockbackLarge(play, &this->actor, 6.0f, this->actor.yawTowardsPlayer, 6.0f, 0x10); Actor_PlaySfx(&this->actor, NA_SE_EN_KDOOR_HIT); Player_PlaySfx(player, NA_SE_PL_BODY_HIT); } @@ -411,7 +411,7 @@ void DoorKiller_Wait(DoorKiller* this, PlayState* play) { Vec3f playerPosRelToDoor; s16 angleToFacingPlayer; - func_8002DBD0(&this->actor, &playerPosRelToDoor, &player->actor.world.pos); + Actor_WorldToActorCoords(&this->actor, &playerPosRelToDoor, &player->actor.world.pos); // playerIsOpening is set by player if (this->playerIsOpening) { @@ -472,7 +472,7 @@ void DoorKiller_UpdateTexture(Actor* thisx, PlayState* play) { void DoorKiller_WaitForObject(DoorKiller* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { DoorKiller_UpdateTexture(&this->actor, play); - switch (this->actor.params & 0xFF) { + switch (PARAMS_GET_U(this->actor.params, 0, 8)) { case DOOR_KILLER_DOOR: this->actionFunc = DoorKiller_Wait; this->actor.draw = DoorKiller_DrawDoor; @@ -515,7 +515,7 @@ void DoorKiller_DrawDoor(Actor* thisx, PlayState* play) { void DoorKiller_DrawRubble(Actor* thisx, PlayState* play) { static Gfx* dLists[] = { object_door_killer_DL_001250, object_door_killer_DL_001550, object_door_killer_DL_0017B8, object_door_killer_DL_001A58 }; - s32 rubblePieceIndex = (thisx->params & 0xFF) - 1; + s32 rubblePieceIndex = PARAMS_GET_U(thisx->params, 0, 8) - 1; DoorKiller* this = (DoorKiller*)thisx; if ((this->timer >= 20) || ((this->timer & 1) == 0)) { diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.h b/src/overlays/actors/ovl_Door_Killer/z_door_killer.h index 1b32564504..597624df1e 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.h +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.h @@ -9,7 +9,7 @@ * ((params >> 8) & 0x3F) == 0x3F means no switch flag is checked / set */ -typedef struct { +typedef struct DoorKillerTextureEntry { /* 0x00 */ s16 objectId; /* 0x04 */ void* texture; } DoorKillerTextureEntry; // size 0x8 diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 4926bdc7b8..1cfb4255d3 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -7,6 +7,7 @@ #include "z_door_shutter.h" #include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h" #include "quake.h" +#include "versions.h" #include "assets/objects/object_gnd/object_gnd.h" #include "assets/objects/object_goma/object_goma.h" @@ -48,7 +49,7 @@ void DoorShutter_GohmaBlockFall(DoorShutter* this, PlayState* play); void DoorShutter_GohmaBlockBounce(DoorShutter* this, PlayState* play); void DoorShutter_PhantomGanonBarsRaise(DoorShutter* this, PlayState* play); -ActorInit Door_Shutter_InitVars = { +ActorProfile Door_Shutter_Profile = { /**/ ACTOR_DOOR_SHUTTER, /**/ ACTORCAT_DOOR, /**/ FLAGS, @@ -60,7 +61,7 @@ ActorInit Door_Shutter_InitVars = { /**/ DoorShutter_Draw, }; -typedef enum { +typedef enum DoorShutterGfxType { /* 0 */ DOORSHUTTER_GFX_DEKU_TREE_1, /* 1 */ DOORSHUTTER_GFX_DEKU_TREE_2, /* 2 */ DOORSHUTTER_GFX_DODONGOS_CAVERN, @@ -83,7 +84,7 @@ typedef enum { /* 19 */ DOORSHUTTER_GFX_ROYAL_FAMILYS_TOMB } DoorShutterGfxType; -typedef enum { +typedef enum DoorShutterStyleType { /* -1 */ DOORSHUTTER_STYLE_FROM_SCENE = -1, // Style is taken from `sSceneInfo` /* 0 */ DOORSHUTTER_STYLE_PHANTOM_GANON, /* 1 */ DOORSHUTTER_STYLE_GOHMA_BLOCK, @@ -104,7 +105,7 @@ typedef enum { /* 16 */ DOORSHUTTER_STYLE_ROYAL_FAMILYS_TOMB } DoorShutterStyleType; -typedef struct { +typedef struct DoorShutterStyleInfo { s16 objectId; u8 gfxType1; u8 gfxType2; @@ -215,7 +216,7 @@ static DoorShutterStyleInfo sStyleInfo[] = { }, }; -typedef struct { +typedef struct DoorShutterGfxInfo { /* 0x0000 */ Gfx* doorDL; /* 0x0004 */ Gfx* barsDL; /* 0x0008 */ u8 barsOpenOffsetY; @@ -225,14 +226,22 @@ typedef struct { } DoorShutterGfxInfo; static DoorShutterGfxInfo sGfxInfo[] = { - { gDTDungeonDoor1DL, gDoorMetalBarsDL, 130, 12, 20, 15 }, // DOORSHUTTER_GFX_DEKU_TREE_1 - { gDTDungeonDoor2DL, gDoorMetalBarsDL, 130, 12, 20, 15 }, // DOORSHUTTER_GFX_DEKU_TREE_2 - { gDodongoDoorDL, gDodongoBarsDL, 240, 14, 70, 15 }, // DOORSHUTTER_GFX_DODONGOS_CAVERN - { gJabuDoorSection1DL, gJabuWebDoorDL, 0, 110, 50, 15 }, // DOORSHUTTER_GFX_JABU_JABU - { gPhantomGanonBarsDL, NULL, 130, 12, 50, 15 }, // DOORSHUTTER_GFX_PHANTOM_GANON_BARS - { gGohmaDoorDL, NULL, 130, 12, 50, 15 }, // DOORSHUTTER_GFX_GOHMA_BLOCK - { gSpiritDoorDL, gJyaDoorMetalBarsDL, 240, 14, 50, 15 }, // DOORSHUTTER_GFX_SPIRIT_TEMPLE - { gBossDoorDL, NULL, 130, 12, 50, 15 }, // DOORSHUTTER_GFX_BOSS_DOOR + { gDTDungeonDoor1DL, gDoorMetalBarsDL, 130, 12, 20, 15 }, // DOORSHUTTER_GFX_DEKU_TREE_1 + { gDTDungeonDoor2DL, gDoorMetalBarsDL, 130, 12, 20, 15 }, // DOORSHUTTER_GFX_DEKU_TREE_2 + { gDodongoDoorDL, gDodongoBarsDL, 240, 14, 70, 15 }, // DOORSHUTTER_GFX_DODONGOS_CAVERN +#if OOT_VERSION < NTSC_1_1 + { gJabuDoorSection1DL, gJabuWebDoorDL, 0, 110, 70, 15 }, // DOORSHUTTER_GFX_JABU_JABU + { gPhantomGanonBarsDL, NULL, 130, 12, 70, 15 }, // DOORSHUTTER_GFX_PHANTOM_GANON_BARS + { gGohmaDoorDL, NULL, 130, 12, 70, 15 }, // DOORSHUTTER_GFX_GOHMA_BLOCK + { gSpiritDoorDL, gJyaDoorMetalBarsDL, 240, 14, 50, 15 }, // DOORSHUTTER_GFX_SPIRIT_TEMPLE + { gBossDoorDL, NULL, 130, 12, 70, 15 }, // DOORSHUTTER_GFX_BOSS_DOOR +#else + { gJabuDoorSection1DL, gJabuWebDoorDL, 0, 110, 50, 15 }, // DOORSHUTTER_GFX_JABU_JABU + { gPhantomGanonBarsDL, NULL, 130, 12, 50, 15 }, // DOORSHUTTER_GFX_PHANTOM_GANON_BARS + { gGohmaDoorDL, NULL, 130, 12, 50, 15 }, // DOORSHUTTER_GFX_GOHMA_BLOCK + { gSpiritDoorDL, gJyaDoorMetalBarsDL, 240, 14, 50, 15 }, // DOORSHUTTER_GFX_SPIRIT_TEMPLE + { gBossDoorDL, NULL, 130, 12, 50, 15 }, // DOORSHUTTER_GFX_BOSS_DOOR +#endif { gDungeonDoorDL, gDoorMetalBarsDL, 130, 12, 20, 15 }, // DOORSHUTTER_GFX_GENERIC { gFireTempleDoorFrontDL, gDoorMetalBarsDL, 130, 12, 20, 15 }, // DOORSHUTTER_GFX_FIRE_TEMPLE_1 { gFireTempleDoorBackDL, gDoorMetalBarsDL, 130, 12, 20, 15 }, // DOORSHUTTER_GFX_FIRE_TEMPLE_2 @@ -269,7 +278,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneDownward, 400, ICHAIN_STOP), }; -typedef struct { +typedef struct DoorShutterSceneInfo { s16 sceneId; u8 styleType; } DoorShutterSceneInfo; @@ -295,7 +304,7 @@ static DoorShutterSceneInfo sSceneInfo[] = { { -1, DOORSHUTTER_STYLE_GENERIC }, }; -typedef enum { +typedef enum DoorShutterBossDoorTexIndex { /* 0 */ DOORSHUTTER_BOSSDOORTEX_0, /* 1 */ DOORSHUTTER_BOSSDOORTEX_FIRE, /* 2 */ DOORSHUTTER_BOSSDOORTEX_WATER, @@ -305,7 +314,7 @@ typedef enum { /* 6 */ DOORSHUTTER_BOSSDOORTEX_SPIRIT } DoorShutterBossDoorTexIndex; -typedef struct { +typedef struct DoorShutterBossDoorInfo { s16 dungeonSceneId; s16 bossSceneId; u8 texIndex; @@ -350,7 +359,7 @@ void DoorShutter_SetupAction(DoorShutter* this, DoorShutterActionFunc actionFunc * @return true if the door is barred */ s32 DoorShutter_SetupDoor(DoorShutter* this, PlayState* play) { - TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(&this->dyna.actor)]; + TransitionActorEntry* transitionEntry = &play->transitionActors.list[GET_TRANSITION_ACTOR_INDEX(&this->dyna.actor)]; s8 frontRoom = transitionEntry->sides[0].room; s32 doorType = this->doorType; DoorShutterStyleInfo* styleInfo = &sStyleInfo[this->styleType]; @@ -462,7 +471,7 @@ void DoorShutter_Destroy(Actor* thisx, PlayState* play) { if (this->dyna.actor.room >= 0) { s32 transitionActorId = GET_TRANSITION_ACTOR_INDEX(&this->dyna.actor); - play->transiActorCtx.list[transitionActorId].id *= -1; + play->transitionActors.list[transitionActorId].id *= -1; } } @@ -508,7 +517,7 @@ f32 DoorShutter_GetPlayerDistance(PlayState* play, DoorShutter* this, f32 offset playerPos.y = player->actor.world.pos.y + offsetY; playerPos.z = player->actor.world.pos.z; - func_8002DBD0(&this->dyna.actor, &relPlayerPos, &playerPos); + Actor_WorldToActorCoords(&this->dyna.actor, &relPlayerPos, &playerPos); if (fabsf(relPlayerPos.x) > maxDistSides || fabsf(relPlayerPos.y) > maxDistY) { return MAXFLOAT; @@ -800,8 +809,8 @@ void DoorShutter_SetupClosed(DoorShutter* this, PlayState* play) { if (this->dyna.actor.room >= 0) { Vec3f relPlayerPos; - func_8002DBD0(&this->dyna.actor, &relPlayerPos, &player->actor.world.pos); - this->dyna.actor.room = play->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(&this->dyna.actor)] + Actor_WorldToActorCoords(&this->dyna.actor, &relPlayerPos, &player->actor.world.pos); + this->dyna.actor.room = play->transitionActors.list[GET_TRANSITION_ACTOR_INDEX(&this->dyna.actor)] .sides[(relPlayerPos.z < 0.0f) ? 0 : 1] .room; if (room != this->dyna.actor.room) { @@ -809,14 +818,14 @@ void DoorShutter_SetupClosed(DoorShutter* this, PlayState* play) { play->roomCtx.curRoom = play->roomCtx.prevRoom; play->roomCtx.prevRoom = tempRoom; - play->roomCtx.unk_30 ^= 1; + play->roomCtx.activeBufPage ^= 1; } - func_80097534(play, &play->roomCtx); + Room_FinishRoomChange(play, &play->roomCtx); Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, 0x0EFF); } this->isActive = false; this->dyna.actor.velocity.y = 0.0f; - if (DoorShutter_SetupDoor(this, play) && !(player->stateFlags1 & PLAYER_STATE1_11)) { + if (DoorShutter_SetupDoor(this, play) && !(player->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR)) { // The door is barred behind the player DoorShutter_SetupAction(this, DoorShutter_WaitPlayerSurprised); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_2); @@ -906,7 +915,7 @@ void DoorShutter_Update(Actor* thisx, PlayState* play) { DoorShutter* this = (DoorShutter*)thisx; Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_10 | PLAYER_STATE1_28)) || + if (!(player->stateFlags1 & (PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_10 | PLAYER_STATE1_28)) || (this->actionFunc == DoorShutter_WaitForObject)) { this->actionFunc(this, play); } @@ -935,8 +944,7 @@ Gfx* DoorShutter_DrawJabuJabuDoor(PlayState* play, DoorShutter* this, Gfx* gfx) Matrix_Scale(1.0f, yScale, 1.0f, MTXMODE_APPLY); } - gSPMatrix(gfx++, MATRIX_NEW(play->state.gfxCtx, "../z_door_shutter.c", 1991), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(gfx++, play->state.gfxCtx, "../z_door_shutter.c", 1991); gSPDisplayList(gfx++, sJabuDoorDLists[i]); angle -= 2 * M_PI / ARRAY_COUNT(sJabuDoorDLists); @@ -973,20 +981,19 @@ s32 DoorShutter_ShouldDraw(DoorShutter* this, PlayState* play) { void DoorShutter_Draw(Actor* thisx, PlayState* play) { DoorShutter* this = (DoorShutter*)thisx; - if (1) {} if (1) {} //! @bug This actor is not fully initialized until the required object dependency is loaded. //! In most cases, the check for objectSlot to equal requiredObjectSlot prevents the actor //! from drawing until initialization is complete. However if the required object is the same as the - //! object dependency listed in init vars (gameplay_keep in this case), the check will pass even though + //! object dependency listed in the actor profile (gameplay_keep in this case), the check will pass even though //! initialization has not completed. When this happens, it will try to draw the display list of the //! first entry in `sGfxInfo`, which will likely crash the game. //! This only matters in very specific scenarios, when the door is unculled on the first possible frame //! after spawning. It will try to draw without having run update yet. //! //! The best way to fix this issue (and what was done in Majora's Mask) is to null out the draw function in - //! the init vars for the actor, and only set draw after initialization is complete. + //! the profile for the actor, and only set draw after initialization is complete. if (this->dyna.actor.objectSlot == this->requiredObjectSlot && (this->styleType == DOORSHUTTER_STYLE_PHANTOM_GANON || DoorShutter_ShouldDraw(this, play))) { @@ -1006,14 +1013,13 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) { gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255.0f * scale); // no purpose? Matrix_Translate(0, 0, gfxInfo->barsOffsetZ, MTXMODE_APPLY); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_door_shutter.c", 2069), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_door_shutter.c", 2069); gSPDisplayList(POLY_OPA_DISP++, gfxInfo->barsDL); } } else { if (gfxInfo->barsDL != NULL) { TransitionActorEntry* transitionEntry = - &play->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(&this->dyna.actor)]; + &play->transitionActors.list[GET_TRANSITION_ACTOR_INDEX(&this->dyna.actor)]; if (play->roomCtx.prevRoom.num >= 0 || transitionEntry->sides[0].room == transitionEntry->sides[1].room) { @@ -1028,14 +1034,12 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) { } else if (this->doorType == SHUTTER_BOSS) { gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sBossDoorTextures[this->bossDoorTexIndex])); } - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_door_shutter.c", 2109), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_door_shutter.c", 2109); gSPDisplayList(POLY_OPA_DISP++, gfxInfo->doorDL); if (this->barsClosedAmount != 0.0f && gfxInfo->barsDL != NULL) { Matrix_Translate(0, gfxInfo->barsOpenOffsetY * (1.0f - this->barsClosedAmount), gfxInfo->barsOffsetZ, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_door_shutter.c", 2119), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_door_shutter.c", 2119); gSPDisplayList(POLY_OPA_DISP++, gfxInfo->barsDL); } } diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h index 3eb39148c2..83660c5930 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h @@ -20,12 +20,12 @@ * */ -#define DOORSHUTTER_GET_TYPE(actor) (((actor)->params >> 6) & 0xF) -#define DOORSHUTTER_GET_SWITCH_FLAG(actor) ((actor)->params & 0x3F) +#define DOORSHUTTER_GET_TYPE(actor) PARAMS_GET_U((actor)->params, 6, 4) +#define DOORSHUTTER_GET_SWITCH_FLAG(actor) PARAMS_GET_U((actor)->params, 0, 6) #define DOORSHUTTER_PARAMS(type, switchFlag) ((((type) & 0xF) << 6) | ((switchFlag) & 0x3F)) -typedef enum { +typedef enum DoorShutterType { /* 0x00 */ SHUTTER, /* 0x01 */ SHUTTER_FRONT_CLEAR, /* 0x02 */ SHUTTER_FRONT_SWITCH, diff --git a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c index 726f0f5d1d..e2e6ada56b 100644 --- a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c +++ b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c @@ -13,7 +13,7 @@ void DoorToki_Init(Actor* thisx, PlayState* play); void DoorToki_Destroy(Actor* thisx, PlayState* play); void DoorToki_Update(Actor* thisx, PlayState* play); -ActorInit Door_Toki_InitVars = { +ActorProfile Door_Toki_Profile = { /**/ ACTOR_DOOR_TOKI, /**/ ACTORCAT_BG, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index dbddf17995..b5ff0dbaaf 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -32,7 +32,7 @@ void DoorWarp1_DoNothing(DoorWarp1* this, PlayState* play); void DoorWarp1_ChooseInitialAction(DoorWarp1* this, PlayState* play); void DoorWarp1_FloatPlayer(DoorWarp1* this, PlayState* play); -ActorInit Door_Warp1_InitVars = { +ActorProfile Door_Warp1_Profile = { /**/ ACTOR_DOOR_WARP1, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -167,7 +167,7 @@ void DoorWarp1_SetupWarp(DoorWarp1* this, PlayState* play) { gSaveContext.save.entranceIndex == ENTR_DESERT_COLOSSUS_8 || gSaveContext.save.entranceIndex == ENTR_GRAVEYARD_8) && !IS_CUTSCENE_LAYER) || - (GET_PLAYER(play)->actor.params & 0xF00) != 0x200) { + PARAMS_GET_NOSHIFT(GET_PLAYER(play)->actor.params, 8, 4) != 0x200) { Actor_Kill(&this->actor); } if (Actor_WorldDistXZToActor(&player->actor, &this->actor) > 100.0f) { @@ -960,7 +960,7 @@ void DoorWarp1_DrawWarp(DoorWarp1* this, PlayState* play) { gDPSetColorDither(POLY_XLU_DISP++, G_AD_NOTPATTERN | G_CD_MAGICSQ); Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y + 1.0f, this->actor.world.pos.z, MTXMODE_NEW); - gSPSegment(POLY_XLU_DISP++, 0x0A, MATRIX_NEW(play->state.gfxCtx, "../z_door_warp1.c", 2247)); + gSPSegment(POLY_XLU_DISP++, 0x0A, MATRIX_FINALIZE(play->state.gfxCtx, "../z_door_warp1.c", 2247)); Matrix_Push(); gSPSegment(POLY_XLU_DISP++, 0x08, @@ -971,7 +971,7 @@ void DoorWarp1_DrawWarp(DoorWarp1* this, PlayState* play) { Matrix_Translate(0.0f, this->unk_194 * 230.0f, 0.0f, MTXMODE_APPLY); xzScale = (((f32)this->unk_1AE * spE8) / 100.0f) + 1.0f; Matrix_Scale(xzScale, 1.0f, xzScale, MTXMODE_APPLY); - gSPSegment(POLY_XLU_DISP++, 0x09, MATRIX_NEW(play->state.gfxCtx, "../z_door_warp1.c", 2267)); + gSPSegment(POLY_XLU_DISP++, 0x09, MATRIX_FINALIZE(play->state.gfxCtx, "../z_door_warp1.c", 2267)); gSPDisplayList(POLY_XLU_DISP++, gWarpPortalDL); Matrix_Pop(); @@ -1009,7 +1009,7 @@ void DoorWarp1_DrawWarp(DoorWarp1* this, PlayState* play) { xzScale = (((f32)this->unk_1B0 * spE4) / 100.0f) + 1.0f; Matrix_Scale(xzScale, 1.0f, xzScale, MTXMODE_APPLY); - gSPSegment(POLY_XLU_DISP++, 0x09, MATRIX_NEW(play->state.gfxCtx, "../z_door_warp1.c", 2336)); + gSPSegment(POLY_XLU_DISP++, 0x09, MATRIX_FINALIZE(play->state.gfxCtx, "../z_door_warp1.c", 2336)); gSPDisplayList(POLY_XLU_DISP++, gWarpPortalDL); } diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h index 09e00fbfd0..b41e952e89 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h @@ -6,7 +6,7 @@ struct DoorWarp1; -typedef enum { +typedef enum DoorWarp1Type { /* -2 */ WARP_BLUE_CRYSTAL = -2, /* -1 */ WARP_DUNGEON_ADULT, /* 0 */ WARP_DUNGEON_CHILD, @@ -22,7 +22,7 @@ typedef enum { /* 10 */ WARP_RED } DoorWarp1Type; -typedef enum { +typedef enum DoorWarp1RutoState { /* 0 */ WARP_BLUE_RUTO_STATE_INITIAL, // initial, warp doesn't work yet /* 1 */ WARP_BLUE_RUTO_STATE_READY, // set by ruto, warp can work now /* 2 */ WARP_BLUE_RUTO_STATE_ENTERED, // set by warp, player has stepped into the warp diff --git a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c index cd2dbef96d..3aa35ec587 100644 --- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c +++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c @@ -14,7 +14,7 @@ void EfcErupc_UpdateEffects(EfcErupc* this, PlayState* play); void EfcErupc_SpawnEffect(EfcErupcEffect* effect, Vec3f* pos, Vec3f* vel, Vec3f* accel, f32 scaleFactor); void EfcErupc_InitEffects(EfcErupcEffect* effect); -ActorInit Efc_Erupc_InitVars = { +ActorProfile Efc_Erupc_Profile = { /**/ ACTOR_EFC_ERUPC, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -132,8 +132,7 @@ void EfcErupc_Draw(Actor* thisx, PlayState* play) { Matrix_Push(); Matrix_Scale(0.8f, 0.8f, 0.8f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_efc_erupc.c", 321), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_efc_erupc.c", 321); if (play->csCtx.state != CS_STATE_IDLE) { if ((play->csCtx.actorCues[1] != NULL) && (play->csCtx.actorCues[1]->id == 2)) { @@ -142,8 +141,7 @@ void EfcErupc_Draw(Actor* thisx, PlayState* play) { } Matrix_Pop(); Matrix_Scale(3.4f, 3.4f, 3.4f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_efc_erupc.c", 333), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_efc_erupc.c", 333); if (play->csCtx.state != CS_STATE_IDLE) { CsCmdActorCue* cue = play->csCtx.actorCues[2]; @@ -177,8 +175,7 @@ void EfcErupc_DrawEffects(EfcErupcEffect* effect, PlayState* play) { Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_efc_erupc.c", 393), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_efc_erupc.c", 393); gSPDisplayList(POLY_XLU_DISP++, object_efc_erupc_DL_0027D8); } } diff --git a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h index 4c9a1edaf6..6d14c32d76 100644 --- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h +++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h @@ -10,7 +10,7 @@ typedef void (*EfcErupcActionFunc)(struct EfcErupc*, PlayState*); #define EFC_ERUPC_EFFECT_COUNT 100 -typedef struct { +typedef struct EfcErupcEffect { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f vel; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c index 289fee6a8a..907f6d096d 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -22,7 +22,7 @@ void EffDust_UpdateFunc_8099DFC0(EffDust* this, PlayState* play); void EffDust_DrawFunc_8099E4F4(Actor* thisx, PlayState* play2); void EffDust_DrawFunc_8099E784(Actor* thisx, PlayState* play2); -ActorInit Eff_Dust_InitVars = { +ActorProfile Eff_Dust_Profile = { /**/ ACTOR_EFF_DUST, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -180,7 +180,7 @@ void EffDust_UpdateFunc_8099DFC0(EffDust* this, PlayState* play) { s32 i; s32 j; - if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & PLAYER_STATE1_12)) { + if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK)) { if (this->life != 0) { this->life--; } else { @@ -294,8 +294,7 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, PlayState* play2) { Matrix_Scale(this->scalingFactor, this->scalingFactor, this->scalingFactor, MTXMODE_APPLY); Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_dust.c", 449), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_dust.c", 449); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL)); } @@ -351,8 +350,7 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, PlayState* play2) { Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_dust.c", 506), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_dust.c", 506); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL)); } diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h index d5eeaffed4..e77a8e0223 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h @@ -23,7 +23,7 @@ typedef struct EffDust { /* 0x0564 */ EffDustDrawFunc drawFunc; } EffDust; // size = 0x0568 -typedef enum { +typedef enum EffDustType { /* 0x00 */ EFF_DUST_TYPE_0, /* 0x01 */ EFF_DUST_TYPE_1, /* 0x02 */ EFF_DUST_TYPE_2, diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index bb00233e97..d79327fc67 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -5,6 +5,7 @@ */ #include "z_elf_msg.h" +#include "global.h" #include "terminal.h" #include "overlays/actors/ovl_En_Elf/z_en_elf.h" @@ -20,7 +21,7 @@ void ElfMsg_Draw(Actor* thisx, PlayState* play); void ElfMsg_CallNaviCuboid(ElfMsg* this, PlayState* play); void ElfMsg_CallNaviCylinder(ElfMsg* this, PlayState* play); -ActorInit Elf_Msg_InitVars = { +ActorProfile Elf_Msg_Profile = { /**/ ACTOR_ELF_MSG, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -53,21 +54,21 @@ s32 ElfMsg_KillCheck(ElfMsg* this, PlayState* play) { if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) && Flags_GetSwitch(play, this->actor.world.rot.y - 1)) { LOG_STRING("共倒れ", "../z_elf_msg.c", 161); // "Mutual destruction" - if (((this->actor.params >> 8) & 0x3F) != 0x3F) { - Flags_SetSwitch(play, (this->actor.params >> 8) & 0x3F); + if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return 1; } else if ((this->actor.world.rot.y == -1) && Flags_GetClear(play, this->actor.room)) { LOG_STRING("共倒れ", "../z_elf_msg.c", 172); // "Mutual destruction" - if (((this->actor.params >> 8) & 0x3F) != 0x3F) { - Flags_SetSwitch(play, (this->actor.params >> 8) & 0x3F); + if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return 1; - } else if (((this->actor.params >> 8) & 0x3F) == 0x3F) { + } else if (PARAMS_GET_U(this->actor.params, 8, 6) == 0x3F) { return 0; - } else if (Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { + } else if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { Actor_Kill(&this->actor); return 1; } @@ -78,7 +79,7 @@ void ElfMsg_Init(Actor* thisx, PlayState* play) { ElfMsg* this = (ElfMsg*)thisx; // "Conditions for Elf Tag disappearing" - PRINTF(VT_FGCOL(CYAN) "\nエルフ タグ 消える条件 %d" VT_RST "\n", (thisx->params >> 8) & 0x3F); + PRINTF(VT_FGCOL(CYAN) "\nエルフ タグ 消える条件 %d" VT_RST "\n", PARAMS_GET_U(thisx->params, 8, 6)); PRINTF(VT_FGCOL(CYAN) "\nthisx->shape.angle.sy = %d\n" VT_RST, thisx->shape.rot.y); if (thisx->shape.rot.y >= 0x41) { // "Conditions for Elf Tag appearing" @@ -100,7 +101,7 @@ void ElfMsg_Init(Actor* thisx, PlayState* play) { thisx->scale.y = thisx->world.rot.z * 0.04f; } - if (thisx->params & 0x4000) { + if (PARAMS_GET_NOSHIFT(thisx->params, 14, 1)) { ElfMsg_SetupAction(this, ElfMsg_CallNaviCuboid); } else { ElfMsg_SetupAction(this, ElfMsg_CallNaviCylinder); @@ -115,10 +116,10 @@ void ElfMsg_Destroy(Actor* thisx, PlayState* play) { s32 ElfMsg_GetMessageId(ElfMsg* this) { // Negative message ID forces link to talk to Navi - if (this->actor.params & 0x8000) { - return (this->actor.params & 0xFF) + 0x100; + if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { + return PARAMS_GET_U(this->actor.params, 0, 8) + 0x100; } else { - return -((this->actor.params & 0xFF) + 0x100); + return -(PARAMS_GET_U(this->actor.params, 0, 8) + 0x100); } } @@ -156,8 +157,8 @@ void ElfMsg_Update(Actor* thisx, PlayState* play) { if (!ElfMsg_KillCheck(this, play)) { if (Actor_TalkOfferAccepted(&this->actor, play)) { - if (((this->actor.params >> 8) & 0x3F) != 0x3F) { - Flags_SetSwitch(play, (this->actor.params >> 8) & 0x3F); + if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return; @@ -180,17 +181,16 @@ void ElfMsg_Draw(Actor* thisx, PlayState* play) { } Gfx_SetupDL_25Opa(play->state.gfxCtx); - if (thisx->params & 0x8000) { + if (PARAMS_GET_NOSHIFT(thisx->params, 15, 1)) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 100, 100, R_NAVI_MSG_REGION_ALPHA); } else { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, R_NAVI_MSG_REGION_ALPHA); } - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_elf_msg.c", 448), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_elf_msg.c", 448); gSPDisplayList(POLY_XLU_DISP++, D_809AD278); - if (thisx->params & 0x4000) { + if (PARAMS_GET_NOSHIFT(thisx->params, 14, 1)) { gSPDisplayList(POLY_XLU_DISP++, sCubeDL); } else { gSPDisplayList(POLY_XLU_DISP++, sCylinderDL); diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h index ba523060f1..c95cbb527f 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h @@ -2,11 +2,11 @@ #define Z_ELF_MSG_H #include "ultra64.h" -#include "global.h" +#include "z64actor.h" struct ElfMsg; -typedef void (*ElfMsgActionFunc)(struct ElfMsg*, PlayState*); +typedef void (*ElfMsgActionFunc)(struct ElfMsg*, struct PlayState*); typedef struct ElfMsg { /* 0x0000 */ Actor actor; diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index e449fd3cff..20b044a05c 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -20,7 +20,7 @@ s32 ElfMsg2_GetMessageId(ElfMsg2* this); void ElfMsg2_WaitUntilActivated(ElfMsg2* this, PlayState* play); void ElfMsg2_WaitForTextRead(ElfMsg2* this, PlayState* play); -ActorInit Elf_Msg2_InitVars = { +ActorProfile Elf_Msg2_Profile = { /**/ ACTOR_ELF_MSG2, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -53,21 +53,21 @@ s32 ElfMsg2_KillCheck(ElfMsg2* this, PlayState* play) { if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) && Flags_GetSwitch(play, this->actor.world.rot.y - 1)) { LOG_STRING("共倒れ", "../z_elf_msg2.c", 171); // "Mutual destruction" - if (((this->actor.params >> 8) & 0x3F) != 0x3F) { - Flags_SetSwitch(play, ((this->actor.params >> 8) & 0x3F)); + if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return 1; } else if ((this->actor.world.rot.y == -1) && Flags_GetClear(play, this->actor.room)) { LOG_STRING("共倒れ2", "../z_elf_msg2.c", 182); // "Mutual destruction 2" - if (((this->actor.params >> 8) & 0x3F) != 0x3F) { - Flags_SetSwitch(play, ((this->actor.params >> 8) & 0x3F)); + if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return 1; - } else if (((this->actor.params >> 8) & 0x3F) == 0x3F) { + } else if (PARAMS_GET_U(this->actor.params, 8, 6) == 0x3F) { return 0; - } else if (Flags_GetSwitch(play, ((this->actor.params >> 8) & 0x3F))) { + } else if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { LOG_STRING("共倒れ", "../z_elf_msg2.c", 192); // "Mutual destruction" Actor_Kill(&this->actor); return 1; @@ -81,14 +81,14 @@ void ElfMsg2_Init(Actor* thisx, PlayState* play) { PRINTF(VT_FGCOL(CYAN) " Elf_Msg2_Actor_ct %04x\n\n" VT_RST, this->actor.params); if (!ElfMsg2_KillCheck(this, play)) { if ((this->actor.world.rot.x > 0) && (this->actor.world.rot.x < 8)) { - this->actor.targetMode = this->actor.world.rot.x - 1; + this->actor.attentionRangeType = this->actor.world.rot.x - 1; } Actor_ProcessInitChain(thisx, sInitChain); if (this->actor.world.rot.y >= 0x41) { ElfMsg2_SetupAction(this, ElfMsg2_WaitUntilActivated); } else { ElfMsg2_SetupAction(this, ElfMsg2_WaitForTextRead); - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_18; // Make actor targetable and Navi-checkable + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP; this->actor.textId = ElfMsg2_GetMessageId(this); } this->actor.shape.rot.x = this->actor.shape.rot.y = this->actor.shape.rot.z = 0; @@ -99,7 +99,7 @@ void ElfMsg2_Destroy(Actor* thisx, PlayState* play) { } s32 ElfMsg2_GetMessageId(ElfMsg2* this) { - return (this->actor.params & 0xFF) + 0x100; + return PARAMS_GET_U(this->actor.params, 0, 8) + 0x100; } /** @@ -112,7 +112,7 @@ void ElfMsg2_WaitForTextClose(ElfMsg2* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { if (this->actor.world.rot.z != 1) { Actor_Kill(&this->actor); - switchFlag = (this->actor.params >> 8) & 0x3F; + switchFlag = PARAMS_GET_U(this->actor.params, 8, 6); if (switchFlag != 0x3F) { Flags_SetSwitch(play, switchFlag); } @@ -140,7 +140,7 @@ void ElfMsg2_WaitUntilActivated(ElfMsg2* this, PlayState* play) { if ((this->actor.world.rot.y >= 0x41) && (this->actor.world.rot.y <= 0x80) && (Flags_GetSwitch(play, (this->actor.world.rot.y - 0x41)))) { ElfMsg2_SetupAction(this, ElfMsg2_WaitForTextRead); - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_18; // Make actor targetable and Navi-checkable + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP; this->actor.textId = ElfMsg2_GetMessageId(this); } } @@ -165,8 +165,7 @@ void ElfMsg2_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 100, 100, 255, R_NAVI_MSG_REGION_ALPHA); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_elf_msg2.c", 362), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_elf_msg2.c", 362); gSPDisplayList(POLY_XLU_DISP++, D_809ADC38); gSPDisplayList(POLY_XLU_DISP++, sCubeDL); diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index bed0a0be6f..8fa4faae0d 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -8,7 +8,7 @@ #include "assets/objects/object_am/object_am.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_26) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_26) void EnAm_Init(Actor* thisx, PlayState* play); void EnAm_Destroy(Actor* thisx, PlayState* play); @@ -28,7 +28,7 @@ void EnAm_Ricochet(EnAm* this, PlayState* play); void EnAm_Stunned(EnAm* this, PlayState* play); void EnAm_RecoilFromDamage(EnAm* this, PlayState* play); -typedef enum { +typedef enum ArmosBehavior { /* 00 */ AM_BEHAVIOR_NONE, /* 01 */ AM_BEHAVIOR_DAMAGED, /* 03 */ AM_BEHAVIOR_DO_NOTHING = 3, @@ -39,7 +39,7 @@ typedef enum { /* 10 */ AM_BEHAVIOR_AGGRO = 10 } ArmosBehavior; -ActorInit En_Am_InitVars = { +ActorProfile En_Am_Profile = { /**/ ACTOR_EN_AM, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -53,7 +53,7 @@ ActorInit En_Am_InitVars = { static ColliderCylinderInit sHurtCylinderInit = { { - COLTYPE_HIT5, + COL_MATERIAL_HIT5, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -61,7 +61,7 @@ static ColliderCylinderInit sHurtCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -73,7 +73,7 @@ static ColliderCylinderInit sHurtCylinderInit = { static ColliderCylinderInit sBlockCylinderInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, @@ -81,7 +81,7 @@ static ColliderCylinderInit sBlockCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00400106, 0x00, 0x00 }, ATELEM_NONE, @@ -93,7 +93,7 @@ static ColliderCylinderInit sBlockCylinderInit = { static ColliderQuadInit sQuadInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -101,7 +101,7 @@ static ColliderQuadInit sQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -111,8 +111,8 @@ static ColliderQuadInit sQuadInit = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -typedef enum { - /* 0 */ AM_DMGEFF_NONE, // used by anything that cant kill the armos +typedef enum ArmosDamageEffect { + /* 0 */ AM_DMGEFF_NONE, // used by anything that can't kill the armos /* 1 */ AM_DMGEFF_NUT, /* 6 */ AM_DMGEFF_STUN = 6, // doesn't include deku nuts /* 13 */ AM_DMGEFF_ICE = 13, @@ -158,7 +158,7 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_ARMOS, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -4000, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 5300, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 5300, ICHAIN_STOP), }; void EnAm_SetupAction(EnAm* this, EnAmActionFunc actionFunc) { @@ -284,7 +284,7 @@ void EnAm_SetupStatue(EnAm* this) { f32 lastFrame = Animation_GetLastFrame(&gArmosRicochetAnim); Animation_Change(&this->skelAnime, &gArmosRicochetAnim, 0.0f, lastFrame, lastFrame, ANIMMODE_LOOP, 0.0f); - this->dyna.actor.flags &= ~ACTOR_FLAG_0; + this->dyna.actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->behavior = AM_BEHAVIOR_DO_NOTHING; this->dyna.actor.speed = 0.0f; EnAm_SetupAction(this, EnAm_Statue); @@ -385,7 +385,7 @@ void EnAm_Sleep(EnAm* this, PlayState* play) { if (this->textureBlend >= 240) { this->attackTimer = 200; this->textureBlend = 255; - this->dyna.actor.flags |= ACTOR_FLAG_0; + this->dyna.actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->dyna.actor.shape.yOffset = 0.0f; EnAm_SetupLunge(this); } else { @@ -406,7 +406,7 @@ void EnAm_Sleep(EnAm* this, PlayState* play) { this->textureBlend -= 10; } else { this->textureBlend = 0; - this->dyna.actor.flags &= ~ACTOR_FLAG_0; + this->dyna.actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if (this->dyna.bgId < 0) { this->unk_264 = 0; diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.h b/src/overlays/actors/ovl_En_Am/z_en_am.h index 61e9042f9e..8bac3338da 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.h +++ b/src/overlays/actors/ovl_En_Am/z_en_am.h @@ -30,7 +30,7 @@ typedef struct EnAm { /* 0x030C */ ColliderQuad hitCollider; } EnAm; // size = 0x038C -typedef enum { +typedef enum ArmosType { /* 0 */ ARMOS_STATUE, /* 1 */ ARMOS_ENEMY } ArmosType; diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 1e9dbb9333..6b493aa874 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -7,7 +7,7 @@ #include "z_en_ani.h" #include "assets/objects/object_ani/object_ani.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnAni_Init(Actor* thisx, PlayState* play); void EnAni_Destroy(Actor* thisx, PlayState* play); @@ -26,7 +26,7 @@ void func_809B0994(EnAni* this, PlayState* play); void func_809B0A28(EnAni* this, PlayState* play); void func_809B0A6C(EnAni* this, PlayState* play); -ActorInit En_Ani_InitVars = { +ActorProfile En_Ani_Profile = { /**/ ACTOR_EN_ANI, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -40,7 +40,7 @@ ActorInit En_Ani_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, @@ -48,7 +48,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index a370e6b36a..f6742f9810 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -10,7 +10,7 @@ #include "overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) void EnAnubice_Init(Actor* thisx, PlayState* play); void EnAnubice_Destroy(Actor* thisx, PlayState* play); @@ -25,7 +25,7 @@ void EnAnubice_SetupShootFireball(EnAnubice* this, PlayState* play); void EnAnubice_ShootFireball(EnAnubice* this, PlayState* play); void EnAnubice_Die(EnAnubice* this, PlayState* play); -ActorInit En_Anubice_InitVars = { +ActorProfile En_Anubice_Profile = { /**/ ACTOR_EN_ANUBICE, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -39,7 +39,7 @@ ActorInit En_Anubice_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -47,7 +47,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -57,7 +57,7 @@ static ColliderCylinderInit sCylinderInit = { { 29, 103, 0, { 0, 0, 0 } }, }; -typedef enum { +typedef enum AnubiceDamageEffect { /* 0x0 */ ANUBICE_DMGEFF_NONE, /* 0x2 */ ANUBICE_DMGEFF_FIRE = 2, /* 0xF */ ANUBICE_DMGEFF_0xF = 0xF // Treated the same as ANUBICE_DMGEFF_NONE in code @@ -146,9 +146,9 @@ void EnAnubice_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.shape.yOffset = -4230.0f; this->focusHeightOffset = 0.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->home = this->actor.world.pos; - this->actor.targetMode = 3; + this->actor.attentionRangeType = ATTENTION_RANGE_3; this->actionFunc = EnAnubice_FindFlameCircles; } @@ -193,7 +193,7 @@ void EnAnubice_FindFlameCircles(EnAnubice* this, PlayState* play) { } this->hasSearchedForFlameCircles = true; } - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnAnubice_SetupIdle; } } @@ -374,7 +374,7 @@ void EnAnubice_Update(Actor* thisx, PlayState* play) { (fabsf(this->flameCircles[i]->actor.world.pos.z - this->actor.world.pos.z) < 60.0f) && (flameCircle->timer != 0)) { Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Enemy_StartFinishingBlow(play, &this->actor); Actor_PlaySfx(&this->actor, NA_SE_EN_ANUBIS_DEAD); this->actionFunc = EnAnubice_SetupDie; @@ -386,7 +386,7 @@ void EnAnubice_Update(Actor* thisx, PlayState* play) { this->collider.base.acFlags &= ~AC_HIT; if (this->actor.colChkInfo.damageEffect == ANUBICE_DMGEFF_FIRE) { Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Enemy_StartFinishingBlow(play, &this->actor); Actor_PlaySfx(&this->actor, NA_SE_EN_ANUBIS_DEAD); this->actionFunc = EnAnubice_SetupDie; @@ -484,8 +484,7 @@ void EnAnubice_PostLimbDraw(struct PlayState* play, s32 limbIndex, Gfx** dList, if (limbIndex == ANUBICE_LIMB_HEAD) { OPEN_DISPS(play->state.gfxCtx, "../z_en_anubice.c", 853); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_anubice.c", 856), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_anubice.c", 856); gSPDisplayList(POLY_XLU_DISP++, gAnubiceEyesDL); Matrix_MultVec3f(&pos, &this->headPos); diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h index 73f70a6845..5f3ec8b134 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h @@ -9,7 +9,7 @@ struct EnAnubice; typedef void (*EnAnubiceActionFunc)(struct EnAnubice*, struct PlayState*); -typedef enum { +typedef enum AnubiceLimbs { /* 0 */ ANUBICE_LIMB_NONE, /* 1 */ ANUBICE_LIMB_ROOT, /* 2 */ ANUBICE_LIMB_BODY_ROOT, diff --git a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c index 19851e173b..1b2a1e0185 100644 --- a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c +++ b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c @@ -19,7 +19,7 @@ void func_809B26EC(EnAnubiceFire* this, PlayState* play); void func_809B27D8(EnAnubiceFire* this, PlayState* play); void func_809B2B48(EnAnubiceFire* this, PlayState* play); -ActorInit En_Anubice_Fire_InitVars = { +ActorProfile En_Anubice_Fire_Profile = { /**/ ACTOR_EN_ANUBICE_FIRE, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -33,7 +33,7 @@ ActorInit En_Anubice_Fire_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -41,7 +41,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -243,8 +243,7 @@ void EnAnubiceFire_Draw(Actor* thisx, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_RotateZ(this->actor.world.rot.z + i * 1000.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_anubice_fire.c", 546), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_anubice_fire.c", 546); gSPDisplayList(POLY_XLU_DISP++, gAnubiceFireAttackDL); } diff --git a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c index b76b38f06b..00e84f0970 100644 --- a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c +++ b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c @@ -17,7 +17,7 @@ void EnAnubiceTag_Draw(Actor* thisx, PlayState* play); void EnAnubiceTag_SpawnAnubis(EnAnubiceTag* this, PlayState* play); void EnAnubiceTag_ManageAnubis(EnAnubiceTag* this, PlayState* play); -ActorInit En_Anubice_Tag_InitVars = { +ActorProfile En_Anubice_Tag_Profile = { /**/ ACTOR_EN_ANUBICE_TAG, /**/ ACTORCAT_SWITCH, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c b/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c index 84bed0a06e..60b2121000 100644 --- a/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c +++ b/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c @@ -12,7 +12,7 @@ void EnArowTrap_Init(Actor* thisx, PlayState* play); void EnArowTrap_Destroy(Actor* thisx, PlayState* play); void EnArowTrap_Update(Actor* thisx, PlayState* play); -ActorInit En_Arow_Trap_InitVars = { +ActorProfile En_Arow_Trap_Profile = { /**/ ACTOR_EN_AROW_TRAP, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index 75aa432f7f..34bc646bd6 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -5,6 +5,7 @@ */ #include "z_en_arrow.h" +#include "global.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) @@ -19,7 +20,7 @@ void EnArrow_Fly(EnArrow* this, PlayState* play); void func_809B45E0(EnArrow* this, PlayState* play); void func_809B4640(EnArrow* this, PlayState* play); -ActorInit En_Arrow_InitVars = { +ActorProfile En_Arrow_Profile = { /**/ ACTOR_EN_ARROW, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -33,7 +34,7 @@ ActorInit En_Arrow_InitVars = { static ColliderQuadInit sColliderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_PLAYER, AC_NONE, OC1_NONE, @@ -41,7 +42,7 @@ static ColliderQuadInit sColliderInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000020, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_NEAREST | ATELEM_SFX_NONE, @@ -282,7 +283,7 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) { } else { EffectSsHitMark_SpawnCustomScale(play, 0, 150, &this->actor.world.pos); - if (atTouched && (this->collider.elem.atHitElem->elemType != ELEMTYPE_UNK4)) { + if (atTouched && (this->collider.elem.atHitElem->elemMaterial != ELEM_MATERIAL_UNK4)) { hitActor = this->collider.base.at; if ((hitActor->update != NULL) && !(this->collider.base.atFlags & AT_BOUNCED) && @@ -482,8 +483,7 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) { Matrix_RotateZ((this->actor.speed == 0.0f) ? 0.0f : BINANG_TO_RAD((play->gameplayFrames & 0xFF) * 4000), MTXMODE_APPLY); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_arrow.c", 1374), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_arrow.c", 1374); gSPDisplayList(POLY_XLU_DISP++, gEffSparklesDL); Matrix_Pop(); Matrix_RotateY(BINANG_TO_RAD(this->actor.world.rot.y), MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h index 9dee2f8f04..ba974c2105 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h @@ -2,11 +2,12 @@ #define Z_EN_ARROW_H #include "ultra64.h" -#include "global.h" +#include "z64actor.h" +#include "z64player.h" struct EnArrow; -typedef void (*EnArrowActionFunc)(struct EnArrow*, PlayState*); +typedef void (*EnArrowActionFunc)(struct EnArrow*, struct PlayState*); typedef struct EnArrow { /* 0x0000 */ Actor actor; @@ -25,7 +26,7 @@ typedef struct EnArrow { /* 0x025C */ EnArrowActionFunc actionFunc; } EnArrow; // size = 0x0260 -typedef enum { +typedef enum ArrowType { /* -10 */ ARROW_CS_NUT = -10, // cutscene deku nuts are allowed to update in blocking mode /* -1 */ ARROW_NORMAL_SILENT = -1, // normal arrow that does not make a sound when being shot /* 0 */ ARROW_NORMAL_LIT, // normal arrow lit on fire diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index a045dd41bd..d1b915ee45 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -5,6 +5,7 @@ */ #include "z_en_attack_niw.h" +#include "versions.h" #include "assets/objects/object_niw/object_niw.h" #include "overlays/actors/ovl_En_Niw/z_en_niw.h" @@ -19,7 +20,7 @@ void func_809B5670(EnAttackNiw* this, PlayState* play); void func_809B5C18(EnAttackNiw* this, PlayState* play); void func_809B59B0(EnAttackNiw* this, PlayState* play); -ActorInit En_Attack_Niw_InitVars = { +ActorProfile En_Attack_Niw_Profile = { /**/ ACTOR_EN_ATTACK_NIW, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -32,9 +33,9 @@ ActorInit En_Attack_Niw_InitVars = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 1, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_1, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 0, ICHAIN_STOP), }; void EnAttackNiw_Init(Actor* thisx, PlayState* play) { @@ -53,7 +54,7 @@ void EnAttackNiw_Init(Actor* thisx, PlayState* play) { this->unk_298.y = Rand_CenteredFloat(10.0f); this->unk_298.z = Rand_CenteredFloat(100.0f); Actor_SetScale(&this->actor, 0.01f); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.shape.rot.y = this->actor.world.rot.y = (Rand_ZeroOne() - 0.5f) * 60000.0f; this->actionFunc = func_809B5670; } @@ -359,8 +360,14 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) { if (this->actor.xyzDistToPlayerSq < SQ(tmpf1)) { cucco = (EnNiw*)this->actor.parent; if ((this->actor.parent->update != NULL) && (this->actor.parent != NULL) && (cucco != NULL) && - (cucco->timer9 == 0) && (player->invincibilityTimer == 0)) { - func_8002F6D4(play, &this->actor, 2.0f, this->actor.world.rot.y, 0.0f, 0x10); + (cucco->timer9 == 0) && +#if OOT_VERSION < NTSC_1_1 + !(player->stateFlags1 & PLAYER_STATE1_26) +#else + (player->invincibilityTimer == 0) +#endif + ) { + Actor_SetPlayerKnockbackLarge(play, &this->actor, 2.0f, this->actor.world.rot.y, 0.0f, 0x10); cucco->timer9 = 0x46; } } diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 133cffe450..9662ec26ac 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -7,7 +7,7 @@ #include "z_en_ba.h" #include "assets/objects/object_bxa/object_bxa.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) void EnBa_Init(Actor* thisx, PlayState* play); void EnBa_Destroy(Actor* thisx, PlayState* play); @@ -23,7 +23,7 @@ void EnBa_RecoilFromDamage(EnBa* this, PlayState* play); void EnBa_Die(EnBa* this, PlayState* play); void EnBa_SetupSwingAtPlayer(EnBa* this); -ActorInit En_Ba_InitVars = { +ActorProfile En_Ba_Profile = { /**/ ACTOR_EN_BA, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -40,7 +40,7 @@ static Vec3f D_809B8080 = { 0.0f, 0.0f, 32.0f }; static ColliderJntSphElementInit sJntSphElementInit[2] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000010, 0x00, 0x00 }, ATELEM_NONE, @@ -51,7 +51,7 @@ static ColliderJntSphElementInit sJntSphElementInit[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -64,7 +64,7 @@ static ColliderJntSphElementInit sJntSphElementInit[2] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -85,7 +85,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_PARASITIC_TENTACLE, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 1500, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 2500, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 0, ICHAIN_STOP), }; void EnBa_Init(Actor* thisx, PlayState* play) { @@ -103,8 +103,8 @@ void EnBa_Init(Actor* thisx, PlayState* play) { this->unk_158[i].y = this->actor.world.pos.y - (i + 1) * 32.0f; } - this->actor.targetMode = 4; - this->upperParams = (thisx->params >> 8) & 0xFF; + this->actor.attentionRangeType = ATTENTION_RANGE_4; + this->upperParams = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if (this->actor.params < EN_BA_DEAD_BLOB) { @@ -146,7 +146,7 @@ void EnBa_Idle(EnBa* this, PlayState* play) { if ((this->actor.colChkInfo.mass == MASS_IMMOVABLE) && (this->actor.xzDistToPlayer > 175.0f)) { Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 330.0f, 1.0f, 7.0f, 0.0f); } else { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 100.0f, 1.0f, 10.0f, 0.0f); } this->unk_2FC = this->actor.world.pos; @@ -311,7 +311,7 @@ void EnBa_SwingAtPlayer(EnBa* this, PlayState* play) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; if (this->collider.base.at == &player->actor) { - func_8002F71C(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); } } @@ -402,7 +402,7 @@ void func_809B75A0(EnBa* this, PlayState* play2) { Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_RotateZYX(this->actor.shape.rot.x - 0x8000, this->actor.shape.rot.y, 0, MTXMODE_APPLY); Matrix_MultVec3f(&D_809B8080, &this->unk_158[0]); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; for (i = 5; i < 13; i++) { Math_SmoothStepToS(&this->unk_2A8[i].x, this->unk_2A8[5].x, 1, this->unk_31C, 0); Math_SmoothStepToS(&this->unk_2A8[i].y, this->unk_2A8[5].y, 1, this->unk_31C, 0); @@ -499,22 +499,17 @@ void EnBa_Draw(Actor* thisx, PlayState* play) { Matrix_RotateZYX(this->unk_2A8[i].x, this->unk_2A8[i].y, this->unk_2A8[i].z, MTXMODE_APPLY); Matrix_Scale(this->unk_200[i].x, this->unk_200[i].y, this->unk_200[i].z, MTXMODE_APPLY); if ((i == 6) || (i == 13)) { - if (mtx) {} - switch (i) { - case 13: - Collider_UpdateSpheres(i, &this->collider); - break; - default: - Matrix_Scale(0.5f, 0.5f, 1.0f, MTXMODE_APPLY); - Collider_UpdateSpheres(8, &this->collider); - break; + if (i == 13) { + Collider_UpdateSpheres(i, &this->collider); + } else { + Matrix_Scale(0.5f, 0.5f, 1.0f, MTXMODE_APPLY); + Collider_UpdateSpheres(8, &this->collider); } } MATRIX_TO_MTX(mtx, "../z_en_ba.c", 970); } Matrix_Pop(); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ba.c", 973), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_ba.c", 973); gSPDisplayList(POLY_OPA_DISP++, object_bxa_DL_000890); } else { gSPSegment(POLY_OPA_DISP++, 0x08, @@ -522,8 +517,7 @@ void EnBa_Draw(Actor* thisx, PlayState* play) { (play->gameplayFrames * 2) % 128, 32, 32, 1, (play->gameplayFrames * -5) % 128, (play->gameplayFrames * -5) % 128, 32, 32)); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 125, 100, 255); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ba.c", 991), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_ba.c", 991); gSPDisplayList(POLY_OPA_DISP++, object_bxa_DL_001D80); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_ba.c", 995); diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.h b/src/overlays/actors/ovl_En_Ba/z_en_ba.h index d19368c199..f39fa33995 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.h +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.h @@ -8,7 +8,7 @@ struct EnBa; typedef void (*EnBaActionFunc)(struct EnBa*, PlayState*); -typedef enum { +typedef enum EnBaType { /* 0x00 */ EN_BA_TENTACLE_RED, /* 0x01 */ EN_BA_TENTACLE_GREEN, /* 0x02 */ EN_BA_TENTACLE_GRAY, diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 2c05b09977..e337512755 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -8,7 +8,7 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_Bb/object_Bb.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_24) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_24) #define vBombHopPhase actionVar1 #define vTrailIdx actionVar1 @@ -16,7 +16,7 @@ #define vMoveAngleY actionVar2 #define vFlameTimer actionVar2 -typedef enum { +typedef enum EnBbAction { /* 0 */ BB_DAMAGE, /* 1 */ BB_KILL, /* 2 */ BB_FLAME_TRAIL, @@ -29,24 +29,24 @@ typedef enum { /* 9 */ BB_GREEN } EnBbAction; -typedef enum { +typedef enum EnBbMoveMode { /* 0 */ BBMOVE_NORMAL, /* 1 */ BBMOVE_NOCLIP, /* 2 */ BBMOVE_HIDDEN } EnBbMoveMode; -typedef enum { +typedef enum EnBbBlueActionState { /* 0 */ BBBLUE_NORMAL, /* 1 */ BBBLUE_AGGRO } EnBbBlueActionState; -typedef enum { +typedef enum EnBbRedActionState { /* 0 */ BBRED_WAIT, /* 1 */ BBRED_ATTACK, /* 2 */ BBRED_HIDE } EnBbRedActionState; -typedef enum { +typedef enum EnBbGreenActionState { /* 0 */ BBGREEN_FLAME_ON, /* 1 */ BBGREEN_FLAME_OFF } EnBbGreenActionState; @@ -195,7 +195,7 @@ static DamageTable sDamageTableWhite = { /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; -ActorInit En_Bb_InitVars = { +ActorProfile En_Bb_Profile = { /**/ ACTOR_EN_BB, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -210,7 +210,7 @@ ActorInit En_Bb_InitVars = { static ColliderJntSphElementInit sJntSphElementInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -223,7 +223,7 @@ static ColliderJntSphElementInit sJntSphElementInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -235,7 +235,7 @@ static ColliderJntSphInit sJntSphInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 10, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 10, ICHAIN_STOP), }; void EnBb_SetupAction(EnBb* this, EnBbActionFunc actionFunc) { @@ -319,15 +319,15 @@ void EnBb_Init(Actor* thisx, PlayState* play) { Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, thisx, &sJntSphInit, this->elements); - this->actionState = thisx->params >> 8; + this->actionState = PARAMS_GET_NOMASK(thisx->params, 8); - if (thisx->params & 0x80) { + if (PARAMS_GET_NOSHIFT(thisx->params, 7, 1)) { thisx->params |= 0xFF00; } if (thisx->params <= ENBB_BLUE) { ActorShape_Init(&thisx->shape, 200.0f, ActorShadow_DrawCircle, 35.0f); } - if (thisx->params & 0xFF00) { + if (PARAMS_GET_NOSHIFT(thisx->params, 8, 8)) { this->timer = 0; this->flameScaleY = 80.0f; this->flameScaleX = 100.0f; @@ -412,7 +412,7 @@ void EnBb_SetupFlameTrail(EnBb* this) { this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; this->actor.speed = 0.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnBb_SetupAction(this, EnBb_FlameTrail); } @@ -700,7 +700,7 @@ void EnBb_Down(EnBb* this, PlayState* play) { this->moveMode = BBMOVE_HIDDEN; this->timer = 10; this->actionState++; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->action = BB_RED; EnBb_SetupAction(this, EnBb_Red); return; @@ -765,7 +765,7 @@ void EnBb_SetupRed(PlayState* play, EnBb* this) { this->actor.home.pos = this->actor.world.pos; this->actor.velocity.y = this->actor.gravity = this->actor.speed = 0.0f; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } this->action = BB_RED; EnBb_SetupAction(this, EnBb_Red); @@ -799,7 +799,7 @@ void EnBb_Red(EnBb* this, PlayState* play) { case BBRED_ATTACK: if (this->timer == 0) { this->moveMode = BBMOVE_NORMAL; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } this->bobPhase += Rand_ZeroOne(); Math_SmoothStepToF(&this->flameScaleY, 80.0f, 1.0f, 10.0f, 0.0f); @@ -818,7 +818,7 @@ void EnBb_Red(EnBb* this, PlayState* play) { this->moveMode = BBMOVE_HIDDEN; this->timer = 10; this->actionState++; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else { this->actor.velocity.y *= -1.06f; if (this->actor.velocity.y > 13.0f) { @@ -1128,7 +1128,7 @@ void EnBb_Stunned(EnBb* this, PlayState* play) { EnBb_SetupDown(this); } } else { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnBb_SetupDeath(this, play); } } @@ -1194,7 +1194,7 @@ void EnBb_CollisionCheck(EnBb* this, PlayState* play) { } } if (this->actor.colChkInfo.health == 0) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if (this->actor.params == ENBB_RED) { EnBb_KillFlameTrail(this); } @@ -1339,8 +1339,7 @@ void EnBb_Draw(Actor* thisx, PlayState* play) { BINANG_TO_RAD((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) - this->actor.shape.rot.y + 0x8000)), MTXMODE_APPLY); Matrix_Scale(this->flameScaleX * 0.01f, this->flameScaleY * 0.01f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_bb.c", 2106), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_bb.c", 2106); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); } else { Matrix_MultVec3f(&blureBase1, &blureVtx1); diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.h b/src/overlays/actors/ovl_En_Bb/z_en_bb.h index 3e3d9be467..9908690e06 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.h +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.h @@ -46,7 +46,7 @@ typedef struct EnBb { /* 0x0324 */ Actor* targetActor; } EnBb; // size = 0x0328 -typedef enum { +typedef enum EnBbType { ENBB_GREEN_BIG = -5, ENBB_GREEN, ENBB_WHITE, diff --git a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c index ad807fc428..b16cd52dbd 100644 --- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c +++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c @@ -18,7 +18,7 @@ void EnBdfire_DrawFire(EnBdfire* this, PlayState* play); void func_809BC2A4(EnBdfire* this, PlayState* play); void func_809BC598(EnBdfire* this, PlayState* play); -ActorInit En_Bdfire_InitVars = { +ActorProfile En_Bdfire_Profile = { /**/ 0, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -171,7 +171,7 @@ void func_809BC598(EnBdfire* this, PlayState* play) { player->bodyFlameTimers[i] = Rand_S16Offset(0, 200); } player->bodyIsBurning = true; - func_8002F6D4(play, &this->actor, 20.0f, this->actor.world.rot.y, 0.0f, 8); + Actor_SetPlayerKnockbackLarge(play, &this->actor, 20.0f, this->actor.world.rot.y, 0.0f, 8); PRINTF("POWER\n"); } } @@ -209,8 +209,7 @@ void EnBdfire_DrawFire(EnBdfire* this, PlayState* play) { gSPSegment(POLY_XLU_DISP++, 8, SEGMENTED_TO_VIRTUAL(D_809BCB10[texIndex])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, texIndex); Matrix_Translate(0.0f, 11.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_bdfire.c", 647), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_bdfire.c", 647); gSPDisplayList(POLY_XLU_DISP++, object_kingdodongo_DL_01D950); CLOSE_DISPS(play->state.gfxCtx, "../z_en_bdfire.c", 651); } diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 54248862c1..de7141aa3a 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -1,7 +1,7 @@ #include "z_en_bigokuta.h" #include "assets/objects/object_bigokuta/object_bigokuta.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) void EnBigokuta_Init(Actor* thisx, PlayState* play); void EnBigokuta_Destroy(Actor* thisx, PlayState* play); @@ -30,7 +30,7 @@ static Color_RGBA8 sEffectPrimColor = { 255, 255, 255, 255 }; static Color_RGBA8 sEffectEnvColor = { 100, 255, 255, 255 }; static Vec3f sEffectPosAccel = { 0.0f, 0.0f, 0.0f }; -ActorInit En_Bigokuta_InitVars = { +ActorProfile En_Bigokuta_Profile = { /**/ ACTOR_EN_BIGOKUTA, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -45,7 +45,7 @@ ActorInit En_Bigokuta_InitVars = { static ColliderJntSphElementInit sJntSphElementInit[1] = { { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_HARD, @@ -58,7 +58,7 @@ static ColliderJntSphElementInit sJntSphElementInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -71,7 +71,7 @@ static ColliderJntSphInit sJntSphInit = { static ColliderCylinderInit sCylinderInit[] = { { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -79,7 +79,7 @@ static ColliderCylinderInit sCylinderInit[] = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x08 }, { 0xFFCFFFE7, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_HARD, @@ -88,7 +88,7 @@ static ColliderCylinderInit sCylinderInit[] = { }, { 50, 100, 0, { 30, 0, 12 } } }, { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -96,7 +96,7 @@ static ColliderCylinderInit sCylinderInit[] = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x20000000, 0x00, 0x08 }, { 0xFFCFFFE7, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_HARD, @@ -144,8 +144,8 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), - ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 2000, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), ICHAIN_F32(gravity, -1, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, NAVI_ENEMY_BIGOCTO, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 33, ICHAIN_STOP), @@ -244,7 +244,7 @@ void func_809BCF68(EnBigokuta* this, PlayState* play) { } EffectSsGSplash_Spawn(play, &effectPos, NULL, NULL, 1, 800); if (this->actionFunc != func_809BE4A4) { - func_8002F974(&this->actor, NA_SE_EN_DAIOCTA_SPLASH - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_DAIOCTA_SPLASH - SFX_FLAG); } } @@ -383,7 +383,7 @@ void func_809BD6B8(EnBigokuta* this) { void func_809BD768(EnBigokuta* this) { this->unk_194 = Rand_ZeroOne() < 0.5f ? -1 : 1; this->unk_19A = 0; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->cylinder[0].base.atFlags &= ~AT_ON; Actor_PlaySfx(&this->actor, NA_SE_EN_DAIOCTA_SINK); this->actionFunc = func_809BE4A4; @@ -498,7 +498,7 @@ void func_809BDC08(EnBigokuta* this, PlayState* play) { } phi_v1 = (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) - 180.0f) * (8.0f / 15); - func_8002DBD0(&this->actor, &sp28, &player->actor.world.pos); + Actor_WorldToActorCoords(&this->actor, &sp28, &player->actor.world.pos); if (fabsf(sp28.x) > 263.0f || ((sp28.z > 0.0f) && !Actor_IsFacingPlayer(&this->actor, 0x1B00) && !Player_IsFacingActor(&this->actor, 0x2000, play))) { phi_v1 -= 0x80; @@ -684,7 +684,7 @@ void func_809BE4A4(EnBigokuta* this, PlayState* play) { void func_809BE518(EnBigokuta* this, PlayState* play) { if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 10.0f)) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; func_809BD3F8(this); } } @@ -731,7 +731,7 @@ void func_809BE798(EnBigokuta* this, PlayState* play) { } else { effectRot = -0x6000; } - func_8002F71C(play, &this->actor, 10.0f, this->actor.world.rot.y + effectRot, 5.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 10.0f, this->actor.world.rot.y + effectRot, 5.0f); if (this->actionFunc == func_809BDC08) { func_809BD4A4(this); this->unk_196 = 40; @@ -837,7 +837,6 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, temp_f0, temp_f0, temp_f0, 255); - if (1) {} CLOSE_DISPS(play->state.gfxCtx, "../z_en_bigokuta.c", 1945); } } else if (limbIndex == 10) { @@ -849,7 +848,6 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec } gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, intensity, intensity, intensity, intensity); - if (1) {} CLOSE_DISPS(play->state.gfxCtx, "../z_en_bigokuta.c", 1972); } else if (limbIndex == 17 && this->actionFunc == func_809BE26C) { if (this->unk_198 < 5) { diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index b7b4d5d760..f7bbd05f0c 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -5,9 +5,10 @@ */ #include "z_en_bili.h" +#include "versions.h" #include "assets/objects/object_bl/object_bl.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_14) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_14) void EnBili_Init(Actor* thisx, PlayState* play); void EnBili_Destroy(Actor* thisx, PlayState* play); @@ -28,7 +29,7 @@ void EnBili_Die(EnBili* this, PlayState* play); void EnBili_Stunned(EnBili* this, PlayState* play); void EnBili_Frozen(EnBili* this, PlayState* play); -ActorInit En_Bili_InitVars = { +ActorProfile En_Bili_Profile = { /**/ ACTOR_EN_BILI, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -42,7 +43,7 @@ ActorInit En_Bili_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT8, + COL_MATERIAL_HIT8, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -50,7 +51,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x03, 0x08 }, { 0xFFCFFFFF, 0x01, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -62,7 +63,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 9, 28, -20, 30 }; -typedef enum { +typedef enum BiriDamageEffect { /* 0x0 */ BIRI_DMGEFF_NONE, /* 0x1 */ BIRI_DMGEFF_DEKUNUT, /* 0x2 */ BIRI_DMGEFF_FIRE, @@ -108,7 +109,7 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_BIRI, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 2000, ICHAIN_STOP), }; void EnBili_Init(Actor* thisx, PlayState* play) { @@ -227,7 +228,7 @@ void EnBili_SetupBurnt(EnBili* this) { void EnBili_SetupDie(EnBili* this) { this->timer = 18; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnBili_Die; this->actor.speed = 0.0f; } @@ -374,7 +375,7 @@ void EnBili_DischargeLightning(EnBili* this, PlayState* play) { } SkelAnime_Update(&this->skelAnime); - func_8002F974(&this->actor, NA_SE_EN_BIRI_SPARK - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_BIRI_SPARK - SFX_FLAG); if (this->timer != 0) { this->timer--; @@ -536,7 +537,12 @@ void EnBili_Frozen(EnBili* this, PlayState* play) { this->actor.gravity = -1.0f; } - if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { +#if OOT_VERSION < NTSC_1_1 + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) || (this->actor.floorHeight == BGCHECK_Y_MIN)) +#else + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) +#endif + { this->actor.colorFilterTimer = 0; EnBili_SetupDie(this); } else { @@ -555,7 +561,7 @@ void EnBili_UpdateDamage(EnBili* this, PlayState* play) { if (Actor_ApplyDamage(&this->actor) == 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_BIRI_DEAD); Enemy_StartFinishingBlow(play, &this->actor); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } damageEffect = this->actor.colChkInfo.damageEffect; diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.h b/src/overlays/actors/ovl_En_Bili/z_en_bili.h index eac275950f..0882a288c0 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.h +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.h @@ -8,7 +8,7 @@ struct EnBili; typedef void (*EnBiliActionFunc)(struct EnBili*, PlayState*); -typedef enum { +typedef enum EnBiliLimb { /* 0 */ EN_BILI_LIMB_NONE, /* 1 */ EN_BILI_LIMB_ROOT, /* 2 */ EN_BILI_LIMB_INNER_HOOD, @@ -29,7 +29,7 @@ typedef struct EnBili { /* 0x01D4 */ ColliderCylinder collider; } EnBili; // size = 0x0220 -typedef enum { +typedef enum EnBiliType { /* -1 */ EN_BILI_TYPE_NORMAL = -1, /* 0 */ EN_BILI_TYPE_VALI_SPAWNED, /* 1 */ EN_BILI_TYPE_DYING diff --git a/src/overlays/actors/ovl_En_Bird/z_en_bird.c b/src/overlays/actors/ovl_En_Bird/z_en_bird.c index 77db59284c..6ca50edeeb 100644 --- a/src/overlays/actors/ovl_En_Bird/z_en_bird.c +++ b/src/overlays/actors/ovl_En_Bird/z_en_bird.c @@ -19,7 +19,7 @@ void EnBird_Move(EnBird* this, PlayState* play); void EnBird_Idle(EnBird* this, PlayState* play); void EnBird_SetupIdle(EnBird* this, s16 params); -ActorInit En_Bird_InitVars = { +ActorProfile En_Bird_Profile = { /**/ ACTOR_EN_BIRD, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -32,7 +32,7 @@ ActorInit En_Bird_InitVars = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 5600, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 5600, ICHAIN_STOP), }; void EnBird_SetupAction(EnBird* this, EnBirdActionFunc actionFunc) { diff --git a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c index 59a2e76bf8..a42e48252a 100644 --- a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c +++ b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c @@ -19,7 +19,7 @@ void EnBlkobj_SpawnDarkLink(EnBlkobj* this, PlayState* play); void EnBlkobj_DarkLinkFight(EnBlkobj* this, PlayState* play); void EnBlkobj_DoNothing(EnBlkobj* this, PlayState* play); -ActorInit En_Blkobj_InitVars = { +ActorProfile En_Blkobj_Profile = { /**/ ACTOR_EN_BLKOBJ, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -159,8 +159,7 @@ void EnBlkobj_Draw(Actor* thisx, PlayState* play) { gSPSegment( POLY_XLU_DISP++, 0x0D, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, gameplayFrames, 0, 32, 32, 1, gameplayFrames, 0, 32, 32)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_blkobj.c", 363), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_blkobj.c", 363); if (this->alpha != 0) { EnBlkobj_DrawAlpha(play, gIllusionRoomNormalDL, this->alpha); diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index 2a9d34de64..120bbaa1b2 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -18,7 +18,7 @@ void EnBom_Draw(Actor* thisx, PlayState* play); void EnBom_Move(EnBom* this, PlayState* play); void EnBom_WaitForRelease(EnBom* this, PlayState* play); -ActorInit En_Bom_InitVars = { +ActorProfile En_Bom_Profile = { /**/ ACTOR_EN_BOM, /**/ ACTORCAT_EXPLOSIVE, /**/ FLAGS, @@ -32,7 +32,7 @@ ActorInit En_Bom_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER, OC1_ON | OC1_TYPE_ALL, @@ -40,7 +40,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0x0003F828, 0x00, 0x00 }, ATELEM_NONE, @@ -53,7 +53,7 @@ static ColliderCylinderInit sCylinderInit = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000008, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -66,7 +66,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_ON | AT_TYPE_ALL, AC_NONE, OC1_NONE, @@ -79,7 +79,7 @@ static ColliderJntSphInit sJntSphInit = { static InitChainEntry sInitChain[] = { ICHAIN_VEC3F(scale, 0, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -4000, ICHAIN_STOP), }; @@ -147,7 +147,7 @@ void EnBom_Move(EnBom* this, PlayState* play) { } else { Math_StepToF(&this->actor.speed, 0.0f, 1.0f); if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (this->actor.velocity.y < -3.0f)) { - func_8002F850(play, &this->actor); + Actor_PlaySfx_SurfaceBomb(play, &this->actor); this->actor.velocity.y *= -0.3f; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH; } else if (this->timer >= 4) { @@ -207,11 +207,11 @@ void EnBom_Explode(EnBom* this, PlayState* play) { if (this->timer == 0) { player = GET_PLAYER(play); - if ((player->stateFlags1 & PLAYER_STATE1_11) && (player->heldActor == &this->actor)) { + if ((player->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (player->heldActor == &this->actor)) { player->actor.child = NULL; player->heldActor = NULL; player->interactRangeActor = NULL; - player->stateFlags1 &= ~PLAYER_STATE1_11; + player->stateFlags1 &= ~PLAYER_STATE1_CARRYING_ACTOR; } Actor_Kill(&this->actor); @@ -359,10 +359,6 @@ void EnBom_Draw(Actor* thisx, PlayState* play) { s32 pad; EnBom* this = (EnBom*)thisx; -#if IS_DEBUG - if (1) {} -#endif - OPEN_DISPS(play->state.gfxCtx, "../z_en_bom.c", 913); if (thisx->params == BOMB_BODY) { @@ -370,12 +366,10 @@ void EnBom_Draw(Actor* thisx, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); func_8002EBCC(thisx, play, 0); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_bom.c", 928), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_bom.c", 928); gSPDisplayList(POLY_OPA_DISP++, gBombCapDL); Matrix_RotateZYX(0x4000, 0, 0, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_bom.c", 934), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_bom.c", 934); gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, (s16)this->flashIntensity, 0, 40, 255); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, (s16)this->flashIntensity, 0, 40, 255); diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.h b/src/overlays/actors/ovl_En_Bom/z_en_bom.h index aebadfa064..df49b0ce1e 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.h +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.h @@ -20,7 +20,7 @@ typedef struct EnBom { /* 0x0204 */ EnBomActionFunc actionFunc; } EnBom; // size = 0x0208 -typedef enum { +typedef enum EnBomType { /* 0x00 */ BOMB_BODY, /* 0x01 */ BOMB_EXPLOSION } EnBomType; diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 3907b579f5..bf2f41c6c1 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -4,9 +4,10 @@ #include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h" #include "assets/objects/object_bg/object_bg.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_27) +#define FLAGS \ + (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_LOCK_ON_DISABLED) -typedef enum { +typedef enum BombchuGirlEyeMode { /* 0 */ CHU_GIRL_EYES_ASLEEP, /* 1 */ CHU_GIRL_EYES_OPEN_SLOWLY, /* 2 */ CHU_GIRL_EYES_BLINK_RAPIDLY, @@ -34,7 +35,7 @@ void EnBomBowlMan_SetupChooseShowPrize(EnBomBowlMan* this, PlayState* play); void EnBomBowlMan_ChooseShowPrize(EnBomBowlMan* this, PlayState* play); void EnBomBowlMan_BeginPlayGame(EnBomBowlMan* this, PlayState* play); -ActorInit En_Bom_Bowl_Man_InitVars = { +ActorProfile En_Bom_Bowl_Man_Profile = { /**/ ACTOR_EN_BOM_BOWL_MAN, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -77,7 +78,7 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play2) { } this->prizeSelect = (s16)Rand_ZeroFloat(4.99f); - this->actor.targetMode = 1; + this->actor.attentionRangeType = ATTENTION_RANGE_1; this->actionFunc = EnBomBowlMan_SetupWaitAsleep; } @@ -416,7 +417,7 @@ void EnBomBowlMan_ChooseShowPrize(EnBomBowlMan* this, PlayState* play) { this->exItem = (EnExItem*)Actor_SpawnAsChild( &play->actorCtx, &this->actor, play, ACTOR_EN_EX_ITEM, sPrizePosOffset[this->prizeIndex].x + 148.0f, sPrizePosOffset[this->prizeIndex].y + 40.0f, sPrizePosOffset[this->prizeIndex].z + 300.0f, 0, - sPrizeRot[this->prizeIndex], 0, this->prizeIndex + EXITEM_COUNTER); + sPrizeRot[this->prizeIndex], 0, this->prizeIndex + EXITEM_BOMB_BAG_COUNTER); if (!this->startedPlaying) { this->bowlPit = (EnBomBowlPit*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c index a1fa88b631..3e8ff39453 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c @@ -20,7 +20,7 @@ void EnBomBowlPit_Reset(EnBomBowlPit* this, PlayState* play); static s32 sGetItemIds[] = { GI_BOMB_BAG_30, GI_HEART_PIECE, GI_BOMBCHUS_10, GI_BOMBS_1, GI_RUPEE_PURPLE }; -ActorInit En_Bom_Bowl_Pit_InitVars = { +ActorProfile En_Bom_Bowl_Pit_Profile = { /**/ ACTOR_EN_BOM_BOWL_PIT, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index a0b95d2200..f5deec7285 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -15,7 +15,7 @@ void EnBomChu_WaitForRelease(EnBomChu* this, PlayState* play); void EnBomChu_Move(EnBomChu* this, PlayState* play); void EnBomChu_WaitForKill(EnBomChu* this, PlayState* play); -ActorInit En_Bom_Chu_InitVars = { +ActorProfile En_Bom_Chu_Profile = { /**/ ACTOR_EN_BOM_CHU, /**/ ACTORCAT_EXPLOSIVE, /**/ FLAGS, @@ -30,7 +30,7 @@ ActorInit En_Bom_Chu_InitVars = { static ColliderJntSphElementInit sJntSphElemInit[] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -43,7 +43,7 @@ static ColliderJntSphElementInit sJntSphElemInit[] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_1 | OC1_TYPE_2, @@ -55,7 +55,7 @@ static ColliderJntSphInit sJntSphInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 1000 * BOMBCHU_SCALE, ICHAIN_STOP), }; @@ -234,8 +234,8 @@ void EnBomChu_WaitForRelease(EnBomChu* this, PlayState* play) { //! @bug there is no NULL check on the floor poly. If the player is out of bounds the floor poly will be NULL //! and will cause a crash inside this function. EnBomChu_UpdateFloorPoly(this, this->actor.floorPoly, play); - this->actor.flags |= ACTOR_FLAG_0; // make chu targetable - func_8002F850(play, &this->actor); + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; // make chu targetable + Actor_PlaySfx_SurfaceBomb(play, &this->actor); this->actionFunc = EnBomChu_Move; } } @@ -342,7 +342,7 @@ void EnBomChu_Move(EnBomChu* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 0x800); Math_ScaledStepToS(&this->actor.shape.rot.z, this->actor.world.rot.z, 0x800); - func_8002F8F0(&this->actor, NA_SE_IT_BOMBCHU_MOVE - SFX_FLAG); + Actor_PlaySfx_Flagged2(&this->actor, NA_SE_IT_BOMBCHU_MOVE - SFX_FLAG); } void EnBomChu_WaitForKill(EnBomChu* this, PlayState* play) { @@ -508,8 +508,7 @@ void EnBomChu_Draw(Actor* thisx, PlayState* play) { gDPSetEnvColor(POLY_OPA_DISP++, 9.0f + (colorIntensity * 209.0f), 9.0f + (colorIntensity * 34.0f), 35.0f + (colorIntensity * -35.0f), 255); Matrix_Translate(this->visualJitter * (1.0f / BOMBCHU_SCALE), 0.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_bom_chu.c", 956), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_bom_chu.c", 956); gSPDisplayList(POLY_OPA_DISP++, gBombchuDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_bom_chu.c", 961); diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index 36860ca1cc..87ed4120d4 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -8,7 +8,7 @@ #include "assets/objects/object_bombf/object_bombf.h" #include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4) void EnBombf_Init(Actor* thisx, PlayState* play); void EnBombf_Destroy(Actor* thisx, PlayState* play); @@ -21,7 +21,7 @@ void EnBombf_WaitForRelease(EnBombf* this, PlayState* play); void EnBombf_Explode(EnBombf* this, PlayState* play); void EnBombf_SetupGrowBomb(EnBombf* this, s16 params); -ActorInit En_Bombf_InitVars = { +ActorProfile En_Bombf_Profile = { /**/ ACTOR_EN_BOMBF, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -35,7 +35,7 @@ ActorInit En_Bombf_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER, OC1_ON | OC1_TYPE_ALL, @@ -43,7 +43,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0x0003F828, 0x00, 0x00 }, ATELEM_NONE, @@ -56,7 +56,7 @@ static ColliderCylinderInit sCylinderInit = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000008, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -69,7 +69,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ALL, AC_NONE, OC1_NONE, @@ -109,7 +109,7 @@ void EnBombf_Init(Actor* thisx, PlayState* play) { thisx->colChkInfo.cylRadius = 10.0f; thisx->colChkInfo.cylHeight = 10; - thisx->targetMode = 0; + thisx->attentionRangeType = ATTENTION_RANGE_0; if (thisx->params == BOMBFLOWER_BODY) { this->timer = 140; @@ -117,7 +117,7 @@ void EnBombf_Init(Actor* thisx, PlayState* play) { thisx->gravity = -1.5f; Actor_ChangeCategory(play, &play->actorCtx, thisx, ACTORCAT_EXPLOSIVE); thisx->colChkInfo.mass = 200; - thisx->flags &= ~ACTOR_FLAG_0; + thisx->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnBombf_SetupAction(this, EnBombf_Move); } else { thisx->colChkInfo.mass = MASS_IMMOVABLE; @@ -157,13 +157,13 @@ void EnBombf_GrowBomb(EnBombf* this, PlayState* play) { this->timer = 180; this->flowerBombScale = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_PL_PULL_UP_ROCK); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else { player->actor.child = NULL; player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~PLAYER_STATE1_11; + player->stateFlags1 &= ~PLAYER_STATE1_CARRYING_ACTOR; } } else if (this->bombCollider.base.acFlags & AC_HIT) { this->bombCollider.base.acFlags &= ~AC_HIT; @@ -175,7 +175,7 @@ void EnBombf_GrowBomb(EnBombf* this, PlayState* play) { bombFlower->isFuseEnabled = true; bombFlower->timer = 0; this->timer = 180; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->flowerBombScale = 0.0f; } } @@ -186,7 +186,7 @@ void EnBombf_GrowBomb(EnBombf* this, PlayState* play) { if (bombFlower != NULL) { bombFlower->timer = 100; this->timer = 180; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->flowerBombScale = 0.0f; } } else { @@ -197,7 +197,7 @@ void EnBombf_GrowBomb(EnBombf* this, PlayState* play) { player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~PLAYER_STATE1_11; + player->stateFlags1 &= ~PLAYER_STATE1_CARRYING_ACTOR; this->actor.world.pos = this->actor.home.pos; } } @@ -206,7 +206,7 @@ void EnBombf_GrowBomb(EnBombf* this, PlayState* play) { if (this->timer == 0) { this->flowerBombScale += 0.05f; if (this->flowerBombScale >= 1.0f) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } } @@ -215,7 +215,7 @@ void EnBombf_GrowBomb(EnBombf* this, PlayState* play) { player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~PLAYER_STATE1_11; + player->stateFlags1 &= ~PLAYER_STATE1_CARRYING_ACTOR; this->actor.world.pos = this->actor.home.pos; } } @@ -238,7 +238,7 @@ void EnBombf_Move(EnBombf* this, PlayState* play) { } else { Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 1.5f, 0.0f); if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (this->actor.velocity.y < -6.0f)) { - func_8002F850(play, &this->actor); + Actor_PlaySfx_SurfaceBomb(play, &this->actor); this->actor.velocity.y *= -0.5f; } else if (this->timer >= 4) { Actor_OfferCarry(&this->actor, play); @@ -299,11 +299,11 @@ void EnBombf_Explode(EnBombf* this, PlayState* play) { if (this->timer == 0) { player = GET_PLAYER(play); - if ((player->stateFlags1 & PLAYER_STATE1_11) && (player->heldActor == &this->actor)) { + if ((player->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (player->heldActor == &this->actor)) { player->actor.child = NULL; player->heldActor = NULL; player->interactRangeActor = NULL; - player->stateFlags1 &= ~PLAYER_STATE1_11; + player->stateFlags1 &= ~PLAYER_STATE1_CARRYING_ACTOR; } Actor_Kill(&this->actor); @@ -472,8 +472,7 @@ Gfx* EnBombf_NewMtxDList(GraphicsContext* gfxCtx, PlayState* play) { displayList = GRAPH_ALLOC(gfxCtx, 5 * sizeof(Gfx)); displayListHead = displayList; Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(displayListHead++, MATRIX_NEW(gfxCtx, "../z_en_bombf.c", 1021), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(displayListHead++, gfxCtx, "../z_en_bombf.c", 1021); gSPEndDisplayList(displayListHead++); return displayList; } @@ -488,8 +487,7 @@ void EnBombf_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); if (thisx->params != BOMBFLOWER_BODY) { - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_bombf.c", 1041), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_bombf.c", 1041); gSPDisplayList(POLY_OPA_DISP++, gBombFlowerLeavesDL); gSPDisplayList(POLY_OPA_DISP++, gBombFlowerBaseLeavesDL); @@ -500,15 +498,12 @@ void EnBombf_Draw(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 200, 255, 200, 255); gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, (s16)this->flashIntensity, 20, 10, 0); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_bombf.c", 1054), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_bombf.c", 1054); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(EnBombf_NewMtxDList(play->state.gfxCtx, play))); gSPDisplayList(POLY_OPA_DISP++, gBombFlowerBombAndSparkDL); } else { Collider_UpdateSpheres(0, &this->explosionCollider); } - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_en_bombf.c", 1063); } diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h index 226dfebefb..14bc9c6ece 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h @@ -22,7 +22,7 @@ typedef struct EnBombf { /* 0x020C */ f32 flowerBombScale; } EnBombf; // size = 0x0210 -typedef enum { +typedef enum EnBombfType { /* 0xFFFF */ BOMBFLOWER_FLOWER = -1, /* 0x0000 */ BOMBFLOWER_BODY, /* 0x0001 */ BOMBFLOWER_EXPLOSION diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index e5697f91c6..56f6bd3452 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -5,6 +5,7 @@ */ #include "z_en_boom.h" +#include "global.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) @@ -16,7 +17,7 @@ void EnBoom_Draw(Actor* thisx, PlayState* play); void EnBoom_Fly(EnBoom* this, PlayState* play); -ActorInit En_Boom_InitVars = { +ActorProfile En_Boom_Profile = { /**/ ACTOR_EN_BOOM, /**/ ACTORCAT_MISC, /**/ FLAGS, @@ -30,7 +31,7 @@ ActorInit En_Boom_InitVars = { static ColliderQuadInit sQuadInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_PLAYER, AC_NONE, OC1_NONE, @@ -38,7 +39,7 @@ static ColliderQuadInit sQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000010, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_NEAREST | ATELEM_SFX_NORMAL, @@ -49,7 +50,7 @@ static ColliderQuadInit sQuadInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(targetMode, 5, ICHAIN_CONTINUE), + ICHAIN_S8(attentionRangeType, ATTENTION_RANGE_5, ICHAIN_CONTINUE), ICHAIN_VEC3S(shape.rot, 0, ICHAIN_STOP), }; @@ -138,7 +139,7 @@ void EnBoom_Fly(EnBoom* this, PlayState* play) { if ((target != &player->actor) && ((target->update == NULL) || (ABS(yawDiff) > 0x4000))) { //! @bug This condition is why the boomerang will randomly fly off in a the down left direction sometimes. - // If the actor targetted is not Link and the difference between the 2 y angles is greater than 0x4000, + // If the actor targeted is not Link and the difference between the 2 y angles is greater than 0x4000, // the moveTo pointer is nulled and it flies off in a seemingly random direction. this->moveTo = NULL; } else { @@ -150,7 +151,7 @@ void EnBoom_Fly(EnBoom* this, PlayState* play) { // Set xyz speed, move forward, and play the boomerang sound effect Actor_SetProjectileSpeed(&this->actor, 12.0f); Actor_MoveXZGravity(&this->actor); - func_8002F974(&this->actor, NA_SE_IT_BOOMERANG_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_IT_BOOMERANG_FLY - SFX_FLAG); // If the boomerang collides with EnItem00 or a Skulltula token, set grabbed pointer to pick it up collided = this->collider.base.atFlags & AT_HIT; @@ -186,7 +187,7 @@ void EnBoom_Fly(EnBoom* this, PlayState* play) { } } // Set player flags and kill the boomerang beacause Link caught it. - player->stateFlags1 &= ~PLAYER_STATE1_25; + player->stateFlags1 &= ~PLAYER_STATE1_BOOMERANG_THROWN; Actor_Kill(&this->actor); } } else { @@ -268,11 +269,8 @@ void EnBoom_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Matrix_RotateY(BINANG_TO_RAD(this->activeTimer * 12000), MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_boom.c", 601), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_boom.c", 601); gSPDisplayList(POLY_OPA_DISP++, gBoomerangRefDL); - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_en_boom.c", 604); } diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.h b/src/overlays/actors/ovl_En_Boom/z_en_boom.h index 4284063726..7a211880a4 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.h +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.h @@ -2,11 +2,12 @@ #define Z_EN_BOOM_H #include "ultra64.h" -#include "global.h" +#include "z64actor.h" +#include "z64player.h" struct EnBoom; -typedef void (*EnBoomActionFunc)(struct EnBoom*, PlayState*); +typedef void (*EnBoomActionFunc)(struct EnBoom*, struct PlayState*); typedef struct EnBoom { /* 0x0000 */ Actor actor; diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index c8077659e9..012ab4fd60 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -1,4 +1,5 @@ #include "z_en_box.h" +#include "global.h" #include "overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h" #include "assets/objects/object_box/object_box.h" @@ -30,7 +31,7 @@ when set, gets cleared next EnBox_Update call and clip to the floor */ #define ENBOX_MOVE_STICK_TO_GROUND (1 << 4) -typedef enum { +typedef enum EnBoxStateUnk1FB { ENBOX_STATE_0, // waiting for player near / player available / player ? (IDLE) ENBOX_STATE_1, // used only temporarily, maybe "player is ready" ? ENBOX_STATE_2 // waiting for something message context-related @@ -50,7 +51,7 @@ void EnBox_AppearAnimation(EnBox* this, PlayState* play); void EnBox_WaitOpen(EnBox* this, PlayState* play); void EnBox_Open(EnBox* this, PlayState* play); -ActorInit En_Box_InitVars = { +ActorProfile En_Box_Profile = { /**/ ACTOR_EN_BOX, /**/ ACTORCAT_CHEST, /**/ FLAGS, @@ -66,7 +67,7 @@ static AnimationHeader* sAnimations[4] = { &gTreasureChestAnim_00024C, &gTreasur &gTreasureChestAnim_00043C, &gTreasureChestAnim_00043C }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 0, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_0, ICHAIN_STOP), }; static UNK_TYPE sUnused; @@ -109,7 +110,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) { DynaPoly_DisableCeilingCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->movementFlags = 0; - this->type = thisx->params >> 12 & 0xF; + this->type = PARAMS_GET_U(thisx->params, 12, 4); this->iceSmokeTimer = 0; this->unk_1FB = ENBOX_STATE_0; this->dyna.actor.gravity = -5.5f; @@ -118,7 +119,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) { if (play) {} // helps the compiler store play2 into s1 - if (Flags_GetTreasure(play, this->dyna.actor.params & 0x1F)) { + if (Flags_GetTreasure(play, PARAMS_GET_U(this->dyna.actor.params, 0, 5))) { this->alpha = 255; this->iceSmokeTimer = 100; EnBox_SetupAction(this, EnBox_Open); @@ -264,7 +265,7 @@ void EnBox_Fall(EnBox* this, PlayState* play) { } void EnBox_FallOnSwitchFlag(EnBox* this, PlayState* play) { - s32 treasureFlag = this->dyna.actor.params & 0x1F; + s32 treasureFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 5); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { Actor_SetClosestSecretDistance(&this->dyna.actor, play); @@ -283,7 +284,7 @@ void EnBox_FallOnSwitchFlag(EnBox* this, PlayState* play) { // used for types 9, 10 void func_809C9700(EnBox* this, PlayState* play) { - s32 treasureFlag = this->dyna.actor.params & 0x1F; + s32 treasureFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 5); Player* player = GET_PLAYER(play); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { @@ -320,7 +321,7 @@ void func_809C9700(EnBox* this, PlayState* play) { } void EnBox_AppearOnSwitchFlag(EnBox* this, PlayState* play) { - s32 treasureFlag = this->dyna.actor.params & 0x1F; + s32 treasureFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 5); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { Actor_SetClosestSecretDistance(&this->dyna.actor, play); @@ -334,7 +335,7 @@ void EnBox_AppearOnSwitchFlag(EnBox* this, PlayState* play) { } void EnBox_AppearOnRoomClear(EnBox* this, PlayState* play) { - s32 treasureFlag = this->dyna.actor.params & 0x1F; + s32 treasureFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 5); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { Actor_SetClosestSecretDistance(&this->dyna.actor, play); @@ -417,16 +418,16 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) { Audio_PlayFanfare(NA_BGM_OPEN_TRE_BOX | 0x900); } } - PRINTF("Actor_Environment_Tbox_On() %d\n", this->dyna.actor.params & 0x1F); - Flags_SetTreasure(play, this->dyna.actor.params & 0x1F); + PRINTF("Actor_Environment_Tbox_On() %d\n", PARAMS_GET_U(this->dyna.actor.params, 0, 5)); + Flags_SetTreasure(play, PARAMS_GET_U(this->dyna.actor.params, 0, 5)); } else { player = GET_PLAYER(play); - func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.world.pos); + Actor_WorldToActorCoords(&this->dyna.actor, &sp4C, &player->actor.world.pos); if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f && Player_IsFacingActor(&this->dyna.actor, 0x3000, play)) { - Actor_OfferGetItemNearby(&this->dyna.actor, play, 0 - (this->dyna.actor.params >> 5 & 0x7F)); + Actor_OfferGetItemNearby(&this->dyna.actor, play, -PARAMS_GET_U(this->dyna.actor.params, 5, 7)); } - if (Flags_GetTreasure(play, this->dyna.actor.params & 0x1F)) { + if (Flags_GetTreasure(play, PARAMS_GET_U(this->dyna.actor.params, 0, 5))) { EnBox_SetupAction(this, EnBox_Open); } } @@ -486,7 +487,7 @@ void EnBox_SpawnIceSmoke(EnBox* this, PlayState* play) { f32 f0; this->iceSmokeTimer++; - func_8002F974(&this->dyna.actor, NA_SE_EN_MIMICK_BREATH - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EN_MIMICK_BREATH - SFX_FLAG); if (Rand_ZeroOne() < 0.3f) { f0 = 2.0f * Rand_ZeroOne() - 1.0f; pos = this->dyna.actor.world.pos; @@ -537,7 +538,7 @@ void EnBox_Update(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->dyna.actor, 40.0f); } - if ((this->dyna.actor.params >> 5 & 0x7F) == GI_ICE_TRAP && this->actionFunc == EnBox_Open && + if (PARAMS_GET_U(this->dyna.actor.params, 5, 7) == GI_ICE_TRAP && this->actionFunc == EnBox_Open && this->skelanime.curFrame > 45 && this->iceSmokeTimer < 100) { EnBox_SpawnIceSmoke(this, play); } @@ -548,16 +549,14 @@ void EnBox_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, s32 pad; if (limbIndex == 1) { - gSPMatrix((*gfx)++, MATRIX_NEW(play->state.gfxCtx, "../z_en_box.c", 1492), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD((*gfx)++, play->state.gfxCtx, "../z_en_box.c", 1492); if (this->type != ENBOX_TYPE_DECORATED_BIG) { gSPDisplayList((*gfx)++, gTreasureChestChestFrontDL); } else { gSPDisplayList((*gfx)++, gTreasureChestBossKeyChestFrontDL); } } else if (limbIndex == 3) { - gSPMatrix((*gfx)++, MATRIX_NEW(play->state.gfxCtx, "../z_en_box.c", 1502), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD((*gfx)++, play->state.gfxCtx, "../z_en_box.c", 1502); if (this->type != ENBOX_TYPE_DECORATED_BIG) { gSPDisplayList((*gfx)++, gTreasureChestChestSideAndLidDL); } else { diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.h b/src/overlays/actors/ovl_En_Box/z_en_box.h index 6ab9b6c0fb..1604b0d1bc 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.h +++ b/src/overlays/actors/ovl_En_Box/z_en_box.h @@ -2,16 +2,16 @@ #define Z_EN_BOX_H #include "ultra64.h" -#include "global.h" +#include "z64actor.h" #define ENBOX_TREASURE_FLAG_UNK_MIN 20 #define ENBOX_TREASURE_FLAG_UNK_MAX 32 struct EnBox; -typedef void (*EnBoxActionFunc)(struct EnBox*, PlayState*); +typedef void (*EnBoxActionFunc)(struct EnBox*, struct PlayState*); -typedef enum { +typedef enum EnBoxType { /* only values 1-11 are used explicitly, other values (like 0) default to another separate behavior */ diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.c b/src/overlays/actors/ovl_En_Brob/z_en_brob.c index 58bd6d52e0..89edf9c5f6 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -7,7 +7,7 @@ #include "z_en_brob.h" #include "assets/objects/object_brob/object_brob.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) void EnBrob_Init(Actor* thisx, PlayState* play); void EnBrob_Destroy(Actor* thisx, PlayState* play); @@ -22,7 +22,7 @@ void EnBrob_Stunned(EnBrob* this, PlayState* play); void EnBrob_MoveDown(EnBrob* this, PlayState* play); void EnBrob_Shock(EnBrob* this, PlayState* play); -ActorInit En_Brob_InitVars = { +ActorProfile En_Brob_Profile = { /**/ ACTOR_EN_BROB, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -36,7 +36,7 @@ ActorInit En_Brob_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -44,7 +44,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0xFFCFFFFF, 0x03, 0x08 }, { 0xFFCFFFFF, 0x01, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -70,18 +70,17 @@ void EnBrob_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->colliders[1]); Collider_SetCylinder(play, &this->colliders[1], &this->dyna.actor, &sCylinderInit); CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); - - if (((thisx->params >> 8) & 0xFF) == 0) { + if (PARAMS_GET_U(thisx->params, 8, 8) == 0) { Actor_SetScale(&this->dyna.actor, 0.01f); thisx->params &= 0xFF; if (thisx->params != 0xFF) { - thisx->scale.y *= (thisx->params & 0xFF) * (1.0f / 30.0f); + thisx->scale.y *= PARAMS_GET_U(thisx->params, 0, 8) * (1.0f / 30.0f); } } else { Actor_SetScale(&this->dyna.actor, 0.005f); thisx->params &= 0xFF; if (thisx->params != 0xFF) { - thisx->scale.y *= (thisx->params & 0xFF) * (2.0f / 30.0f); + thisx->scale.y *= PARAMS_GET_U(thisx->params, 0, 8) * (2.0f / 30.0f); } } @@ -92,7 +91,7 @@ void EnBrob_Init(Actor* thisx, PlayState* play) { this->colliders[1].dim.height *= thisx->scale.y; this->colliders[1].dim.yShift *= thisx->scale.y; this->actionFunc = NULL; - thisx->flags &= ~ACTOR_FLAG_0; + thisx->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnBrob_SetupIdle(this, play); } @@ -152,7 +151,8 @@ void EnBrob_Idle(EnBrob* this, PlayState* play) { } if (this->timer == 0) { if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { - func_8002F71C(play, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsPlayer, 1.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsPlayer, + 1.0f); EnBrob_SetupMoveUp(this, play); } else if (this->dyna.actor.xzDistToPlayer < 300.0f) { EnBrob_SetupMoveUp(this, play); @@ -278,7 +278,8 @@ void EnBrob_Update(Actor* thisx, PlayState* play2) { if (this->actionFunc == EnBrob_MoveUp && !(this->colliders[0].base.atFlags & AT_BOUNCED) && !(this->colliders[1].base.atFlags & AT_BOUNCED)) { - func_8002F71C(play, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsPlayer, 1.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsPlayer, + 1.0f); } else if (this->actionFunc != EnBrob_MoveUp) { EnBrob_SetupShock(this); } diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 902520173b..466ebfce65 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -1,7 +1,7 @@ #include "z_en_bubble.h" #include "assets/objects/object_bubble/object_bubble.h" -#define FLAGS ACTOR_FLAG_0 +#define FLAGS ACTOR_FLAG_ATTENTION_ENABLED void EnBubble_Init(Actor* thisx, PlayState* play); void EnBubble_Destroy(Actor* thisx, PlayState* play); @@ -12,7 +12,7 @@ void EnBubble_Wait(EnBubble* this, PlayState* play); void EnBubble_Pop(EnBubble* this, PlayState* play); void EnBubble_Regrow(EnBubble* this, PlayState* play); -ActorInit En_Bubble_InitVars = { +ActorProfile En_Bubble_Profile = { /**/ ACTOR_EN_BUBBLE, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -27,7 +27,7 @@ ActorInit En_Bubble_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[2] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x04 }, { 0xFFCFD753, 0x00, 0x00 }, ATELEM_NONE, @@ -38,7 +38,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00002824, 0x00, 0x00 }, ATELEM_NONE, @@ -51,7 +51,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[2] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -76,7 +76,7 @@ void EnBubble_SetDimensions(EnBubble* this, f32 dim) { f32 c; f32 d; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; Actor_SetScale(&this->actor, 1.0f); this->actor.shape.yOffset = 16.0f; this->graphicRotSpeed = 16.0f; @@ -115,7 +115,7 @@ void EnBubble_DamagePlayer(EnBubble* this, PlayState* play) { s32 damage = -this->colliderSphere.elements[0].base.atDmgInfo.damage; play->damagePlayer(play, damage); - func_8002F7A0(play, &this->actor, 6.0f, this->actor.yawTowardsPlayer, 6.0f); + Actor_SetPlayerKnockbackSmallNoDamage(play, &this->actor, 6.0f, this->actor.yawTowardsPlayer, 6.0f); } s32 EnBubble_Explosion(EnBubble* this, PlayState* play) { @@ -145,7 +145,7 @@ s32 EnBubble_Explosion(EnBubble* this, PlayState* play) { &sEffectEnvColor, Rand_S16Offset(100, 50), 0x19, 0); } Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0x50); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; return Rand_S16Offset(90, 60); } @@ -405,7 +405,7 @@ void EnBubble_Update(Actor* thisx, PlayState* play) { void EnBubble_Draw(Actor* thisx, PlayState* play) { EnBubble* this = (EnBubble*)thisx; - u32 pad; + PlayState* play2 = (PlayState*)play; OPEN_DISPS(play->state.gfxCtx, "../z_en_bubble.c", 1175); @@ -413,20 +413,17 @@ void EnBubble_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); Math_SmoothStepToF(&this->graphicRotSpeed, 16.0f, 0.2f, 1000.0f, 0.0f); Math_SmoothStepToF(&this->graphicEccentricity, 0.08f, 0.2f, 1000.0f, 0.0f); - Matrix_ReplaceRotation(&play->billboardMtxF); + Matrix_ReplaceRotation(&play2->billboardMtxF); Matrix_Scale(this->expansionWidth + 1.0f, this->expansionHeight + 1.0f, 1.0f, MTXMODE_APPLY); Matrix_RotateZ(DEG_TO_RAD((f32)play->state.frames) * this->graphicRotSpeed, MTXMODE_APPLY); Matrix_Scale(this->graphicEccentricity + 1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_RotateZ(DEG_TO_RAD(-(f32)play->state.frames) * this->graphicRotSpeed, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_bubble.c", 1220), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_bubble.c", 1220); gSPDisplayList(POLY_XLU_DISP++, gBubbleDL); } - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_en_bubble.c", 1226); if (this->actionFunc != EnBubble_Disappear) { diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/src/overlays/actors/ovl_En_Butte/z_en_butte.c index e91e59d47c..4a93d3f8dd 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -27,7 +27,7 @@ void EnButte_WaitToDie(EnButte* this, PlayState* play); static ColliderJntSphElementInit sJntSphElementsInit[] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x000, 0x00 }, ATELEM_NONE, @@ -38,7 +38,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { }; static ColliderJntSphInit sColliderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_1, @@ -49,7 +49,7 @@ static ColliderJntSphInit sColliderInit = { sJntSphElementsInit, }; -ActorInit En_Butte_InitVars = { +ActorProfile En_Butte_Profile = { /**/ ACTOR_EN_BUTTE, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -61,7 +61,7 @@ ActorInit En_Butte_InitVars = { /**/ EnButte_Draw, }; -typedef struct { +typedef struct EnButteFlightParams { /* 0x00 */ s16 minTime; /* 0x02 */ s16 maxTime; /* 0x04 */ f32 speedXZTarget; @@ -129,8 +129,7 @@ void EnButte_DrawTransformationEffect(EnButte* this, PlayState* play) { Matrix_SetTranslateRotateYXZ(this->actor.focus.pos.x + sp5C.x, this->actor.focus.pos.y + sp5C.y, this->actor.focus.pos.z + sp5C.z, &camDir); Matrix_Scale(sTransformationEffectScale, sTransformationEffectScale, sTransformationEffectScale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_choo.c", 317), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_choo.c", 317); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 200, 200, 180, alpha); gDPSetEnvColor(POLY_XLU_DISP++, 200, 200, 210, 255); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffFlash1DL)); @@ -154,7 +153,7 @@ void EnButte_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); - if ((this->actor.params & 1) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 1) == 1) { this->actor.uncullZoneScale = 200.0f; } @@ -268,7 +267,7 @@ void EnButte_FlyAround(EnButte* this, PlayState* play) { EnButte_SelectFlightParams(this, &sFlyAroundParams[this->flightParamsIdx]); } - if (((this->actor.params & 1) == 1) && (player->heldItemAction == PLAYER_IA_DEKU_STICK) && + if ((PARAMS_GET_U(this->actor.params, 0, 1) == 1) && (player->heldItemAction == PLAYER_IA_DEKU_STICK) && (this->swordDownTimer <= 0) && ((Math3D_Dist2DSq(player->actor.world.pos.x, player->actor.world.pos.z, this->actor.home.pos.x, this->actor.home.pos.z) < SQ(120.0f)) || @@ -396,7 +395,7 @@ void EnButte_Update(Actor* thisx, PlayState* play) { this->unk_25E += 0x1000; this->unk_260 += 0x600; - if ((this->actor.params & 1) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 1) == 1) { if (GET_PLAYER(play)->meleeWeaponState == 0) { if (this->swordDownTimer > 0) { this->swordDownTimer--; @@ -427,7 +426,7 @@ void EnButte_Draw(Actor* thisx, PlayState* play) { Collider_UpdateSpheres(0, &this->collider); } - if (((this->actor.params & 1) == 1) && (this->actionFunc == EnButte_TransformIntoFairy)) { + if ((PARAMS_GET_U(this->actor.params, 0, 1) == 1) && (this->actionFunc == EnButte_TransformIntoFairy)) { EnButte_DrawTransformationEffect(this, play); } } diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 5380555405..b05855a7cb 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -5,10 +5,11 @@ */ #include "z_en_bw.h" +#include "versions.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_bw/object_bw.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) void EnBw_Init(Actor* thisx, PlayState* play); void EnBw_Destroy(Actor* thisx, PlayState* play); @@ -33,7 +34,7 @@ void func_809D0268(EnBw* this, PlayState* play); void func_809D03CC(EnBw* this); void func_809D0424(EnBw* this, PlayState* play); -ActorInit En_Bw_InitVars = { +ActorProfile En_Bw_Profile = { /**/ ACTOR_EN_BW, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -47,7 +48,7 @@ ActorInit En_Bw_InitVars = { static ColliderCylinderInit sCylinderInit1 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -55,7 +56,7 @@ static ColliderCylinderInit sCylinderInit1 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x01, 0x08 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -67,7 +68,7 @@ static ColliderCylinderInit sCylinderInit1 = { static ColliderCylinderInit sCylinderInit2 = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -75,7 +76,7 @@ static ColliderCylinderInit sCylinderInit2 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -137,7 +138,9 @@ void EnBw_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.health = 6; +#if OOT_VERSION >= PAL_1_0 this->actor.colChkInfo.mass = MASS_HEAVY; +#endif this->actor.focus.pos = this->actor.world.pos; func_809CE9A8(this); this->color1.a = this->color1.r = 255; @@ -573,7 +576,7 @@ void func_809CFF98(EnBw* this, PlayState* play) { void func_809D00F4(EnBw* this) { this->unk_220 = 0; this->unk_222 = 40; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLEWALK_DEAD); EnBw_SetupAction(this, func_809D014C); @@ -828,8 +831,7 @@ s32 EnBw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po Matrix_RotateZ(-(this->unk_258 * 0.1f), MTXMODE_APPLY); Matrix_RotateY(-(this->unk_258 * 0.13f), MTXMODE_APPLY); Matrix_RotateX(-(this->unk_258 * 0.115f), MTXMODE_APPLY); - gSPMatrix((*gfx)++, MATRIX_NEW(play->state.gfxCtx, "../z_en_bw.c", 1388), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD((*gfx)++, play->state.gfxCtx, "../z_en_bw.c", 1388); gSPDisplayList((*gfx)++, *dList); Matrix_Pop(); return 1; @@ -890,8 +892,7 @@ void EnBw_Draw(Actor* thisx, PlayState* play2) { gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, 255); Matrix_Scale(this->unk_248 * 0.01f, this->unk_248 * 0.01f, this->unk_248 * 0.01f, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_bw.c", 1500), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_bw.c", 1500); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); if (this->iceTimer != 0) { @@ -907,7 +908,5 @@ void EnBw_Draw(Actor* thisx, PlayState* play2) { } } - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_en_bw.c", 1521); } diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.h b/src/overlays/actors/ovl_En_Bw/z_en_bw.h index dfd70e440a..5f74f70c4d 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.h +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.h @@ -7,7 +7,7 @@ struct EnBw; typedef void (*EnBwActionFunc)(struct EnBw*, PlayState*); -typedef enum { +typedef enum TorchSlugLimb { /* 0 */ TORCH_SLUG_LIMB_NONE, /* 1 */ TORCH_SLUG_LIMB_BODY, /* 2 */ TORCH_SLUG_LIMB_LEFT_EYESTALK_ROOT_ROOT, diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.c b/src/overlays/actors/ovl_En_Bx/z_en_bx.c index c0c9fb7038..91b701d0d7 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c @@ -14,7 +14,7 @@ void EnBx_Destroy(Actor* thisx, PlayState* play); void EnBx_Update(Actor* thisx, PlayState* play); void EnBx_Draw(Actor* thisx, PlayState* play); -ActorInit En_Bx_InitVars = { +ActorProfile En_Bx_Profile = { /**/ ACTOR_EN_BX, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -28,7 +28,7 @@ ActorInit En_Bx_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -36,7 +36,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0xFFCFFFFF, 0x03, 0x04 }, { 0xFFCFFFFF, 0x01, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -48,7 +48,7 @@ static ColliderCylinderInit sCylinderInit = { static ColliderQuadInit sQuadInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -56,7 +56,7 @@ static ColliderQuadInit sQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x03, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -71,7 +71,7 @@ void EnBx_Init(Actor* thisx, PlayState* play) { Vec3f sp48 = { 0.015f, 0.015f, 0.015f }; Vec3f sp3C = { 0.0f, 0.0f, 0.0f }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 5300, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 5300, ICHAIN_STOP), }; s32 i; s32 pad; @@ -99,7 +99,7 @@ void EnBx_Init(Actor* thisx, PlayState* play) { thisx->colChkInfo.mass = MASS_IMMOVABLE; this->unk_14C = 0; thisx->uncullZoneDownward = 2000.0f; - if (Flags_GetSwitch(play, (thisx->params >> 8) & 0xFF)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 8))) { Actor_Kill(&this->actor); } thisx->params &= 0xFF; @@ -141,19 +141,19 @@ void EnBx_Update(Actor* thisx, PlayState* play) { (&player->actor == this->collider.base.ac) || (&player->actor == this->colliderQuad.base.at)) { tmp33 = player->invincibilityTimer & 0xFF; tmp32 = thisx->world.rot.y; - if (!(thisx->params & 0x80)) { + if (!PARAMS_GET_NOSHIFT(thisx->params, 7, 1)) { tmp32 = thisx->yawTowardsPlayer; } if ((&player->actor != this->collider.base.at) && (&player->actor != this->collider.base.ac) && (&player->actor != this->colliderQuad.base.at) && (player->invincibilityTimer <= 0)) { - if (player->invincibilityTimer < -39) { + if (player->invincibilityTimer <= -40) { player->invincibilityTimer = 0; } else { player->invincibilityTimer = 0; play->damagePlayer(play, -4); } } - func_8002F71C(play, &this->actor, 6.0f, tmp32, 6.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 6.0f, tmp32, 6.0f); player->invincibilityTimer = tmp33; } @@ -190,7 +190,7 @@ void EnBx_Update(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(thisx, &this->collider); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); - if (thisx->params & 0x80) { + if (PARAMS_GET_NOSHIFT(thisx->params, 7, 1)) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderQuad.base); } } @@ -212,14 +212,13 @@ void EnBx_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x0C, mtx); - gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_809D2560[this->actor.params & 0x7F])); + gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_809D2560[PARAMS_GET_U(this->actor.params, 0, 7)])); gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 16, 16, 1, 0, (play->gameplayFrames * -10) % 128, 32, 32)); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_bx.c", 478), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_bx.c", 478); - if (this->actor.params & 0x80) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 7, 1)) { func_809D1D0C(&this->actor, play); } diff --git a/src/overlays/actors/ovl_En_Changer/z_en_changer.c b/src/overlays/actors/ovl_En_Changer/z_en_changer.c index 5a7ec629c7..417c7c88fe 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.c +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.c @@ -11,7 +11,7 @@ #define FLAGS 0 -typedef enum { +typedef enum ChangerChestSide { /* 0 */ CHEST_LEFT, /* 1 */ CHEST_RIGHT } ChangerChestSide; @@ -24,7 +24,7 @@ void EnChanger_Wait(EnChanger* this, PlayState* play); void EnChanger_OpenChests(EnChanger* this, PlayState* play); void EnChanger_SetHeartPieceFlag(EnChanger* this, PlayState* play); -ActorInit En_Changer_InitVars = { +ActorProfile En_Changer_Profile = { /**/ ACTOR_EN_CHANGER, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -194,7 +194,7 @@ void EnChanger_Init(Actor* thisx, PlayState* play2) { ((this->rightChestNum & 0x1F) << 8) + (rightChestItem & 0xFF)); } - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnChanger_Wait; } @@ -204,7 +204,7 @@ void EnChanger_Wait(EnChanger* this, PlayState* play) { Flags_SetTreasure(play, this->rightChestNum & 0x1F); this->actionFunc = EnChanger_OpenChests; } else if (this->rightChest->unk_1F4 != 0) { - this->chestOpened = CHEST_RIGHT; + this->selectedChest = CHEST_RIGHT; this->timer = 80; Flags_SetTreasure(play, this->leftChestNum & 0x1F); this->actionFunc = EnChanger_OpenChests; @@ -216,8 +216,8 @@ void EnChanger_OpenChests(EnChanger* this, PlayState* play) { f32 zPos; f32 yPos; f32 xPos; - s16 temp_s0; - s16 temp_s0_2; + s16 selectedChest; + s16 unopenedChestItemType; EnBox* left; EnBox* right; @@ -225,22 +225,26 @@ void EnChanger_OpenChests(EnChanger* this, PlayState* play) { right = this->rightChest; if (this->timer == 0) { - temp_s0_2 = temp_s0 = this->chestOpened; // Required to use the right registers + // `unopenedChestItemType` being set here is required for matching, but doesn't do anything useful + unopenedChestItemType = selectedChest = this->selectedChest; - switch (temp_s0_2) { + switch (selectedChest) { case CHEST_LEFT: xPos = right->dyna.actor.world.pos.x; yPos = right->dyna.actor.world.pos.y; zPos = right->dyna.actor.world.pos.z; if (this->rightChestGetItemId == GI_DOOR_KEY) { - Actor_Spawn(&play->actorCtx, play, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, 0xF); + Actor_Spawn(&play->actorCtx, play, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, + EXITEM_SMALL_KEY_CHEST); Flags_SetSwitch(play, 0x32); } else { - temp_s0_2 = (s16)(this->rightChestGetItemId - GI_RUPEE_GREEN_LOSE) + EXITEM_CHEST; + unopenedChestItemType = + (s16)(this->rightChestGetItemId - GI_RUPEE_GREEN_LOSE) + EXITEM_GREEN_RUPEE_CHEST; // "Open right treasure (chest)" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 右宝開く ☆☆☆☆☆ %d\n" VT_RST, temp_s0_2); - Actor_Spawn(&play->actorCtx, play, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, temp_s0_2); + PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 右宝開く ☆☆☆☆☆ %d\n" VT_RST, unopenedChestItemType); + Actor_Spawn(&play->actorCtx, play, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, + unopenedChestItemType); } break; case CHEST_RIGHT: @@ -249,13 +253,16 @@ void EnChanger_OpenChests(EnChanger* this, PlayState* play) { zPos = left->dyna.actor.world.pos.z; if (this->leftChestGetItemId == GI_DOOR_KEY) { - Actor_Spawn(&play->actorCtx, play, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, 0xF); + Actor_Spawn(&play->actorCtx, play, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, + EXITEM_SMALL_KEY_CHEST); Flags_SetSwitch(play, 0x32); } else { - temp_s0_2 = (s16)(this->leftChestGetItemId - 0x72) + 0xA; + unopenedChestItemType = + (s16)(this->leftChestGetItemId - GI_RUPEE_GREEN_LOSE) + EXITEM_GREEN_RUPEE_CHEST; // "Open left treasure (chest)" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 左宝開く ☆☆☆☆☆ %d\n" VT_RST, temp_s0_2); - Actor_Spawn(&play->actorCtx, play, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, temp_s0_2); + PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 左宝開く ☆☆☆☆☆ %d\n" VT_RST, unopenedChestItemType); + Actor_Spawn(&play->actorCtx, play, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, + unopenedChestItemType); } break; } diff --git a/src/overlays/actors/ovl_En_Changer/z_en_changer.h b/src/overlays/actors/ovl_En_Changer/z_en_changer.h index b5209109ef..75281b2343 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.h +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.h @@ -19,7 +19,7 @@ typedef struct EnChanger { /* 0x015E */ s16 rightChestNum; /* 0x0160 */ s16 leftChestGetItemId; /* 0x0162 */ s16 rightChestGetItemId; - /* 0x0164 */ s16 chestOpened; + /* 0x0164 */ s16 selectedChest; /* 0x0166 */ s16 timer; /* 0x0168 */ s16 roomChestsOpened; } EnChanger; // size = 0x016C diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index a47186b62a..e83dbc2dc8 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -1,6 +1,6 @@ #include "z_en_clear_tag.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) void EnClearTag_Init(Actor* thisx, PlayState* play); void EnClearTag_Destroy(Actor* thisx, PlayState* play); @@ -18,7 +18,7 @@ void EnClearTag_CreateFlashEffect(PlayState* play, Vec3f* position, f32 scale, f void EnClearTag_CalculateFloorTangent(EnClearTag* this); -ActorInit En_Clear_Tag_InitVars = { +ActorProfile En_Clear_Tag_Profile = { /**/ ACTOR_EN_CLEAR_TAG, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -36,7 +36,7 @@ static Vec3f sZeroVector = { 0.0f, 0.0f, 0.0f }; static ColliderCylinderInit sArwingCylinderInit = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -44,7 +44,7 @@ static ColliderCylinderInit sArwingCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFDFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -56,7 +56,7 @@ static ColliderCylinderInit sArwingCylinderInit = { static ColliderCylinderInit sLaserCylinderInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -64,7 +64,7 @@ static ColliderCylinderInit sLaserCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFDFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -250,8 +250,8 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sLaserCylinderInit); Actor_PlaySfx(&this->actor, NA_SE_IT_SWORD_REFLECT_MG); } else { // Initialize the Arwing. - this->actor.flags |= ACTOR_FLAG_0; - this->actor.targetMode = 5; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; + this->actor.attentionRangeType = ATTENTION_RANGE_5; Collider_SetCylinder(play, &this->collider, &this->actor, &sArwingCylinderInit); this->actor.colChkInfo.health = 3; @@ -431,7 +431,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) { Math_ApproachZeroF(&this->roll, 0.1f, 0.2f); } - // Calculate a vector towards the targetted position. + // Calculate a vector towards the targeted position. vectorToTargetX = this->targetPosition.x - this->actor.world.pos.x; vectorToTargetY = this->targetPosition.y - this->actor.world.pos.y; vectorToTargetZ = this->targetPosition.z - this->actor.world.pos.z; @@ -537,7 +537,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) { if (this->drawMode != CLEAR_TAG_DRAW_MODE_ARWING) { this->drawMode = CLEAR_TAG_DRAW_MODE_EFFECT; this->deathTimer = 70; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else { Actor_Kill(&this->actor); } @@ -680,7 +680,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) { /** * EnClear_Tag draw function. * Laser clear tag type will draw two lasers. - * Arwing clear tage types will draw the Arwing, the backfire, and a shadow. + * Arwing clear tag types will draw the Arwing, the backfire, and a shadow. */ void EnClearTag_Draw(Actor* thisx, PlayState* play) { s32 pad; @@ -695,13 +695,11 @@ void EnClearTag_Draw(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 255, 0, 255); Matrix_Translate(25.0f, 0.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_clear_tag.c", 1004), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_clear_tag.c", 1004); gSPDisplayList(POLY_XLU_DISP++, gArwingLaserDL); Matrix_Translate(-50.0f, 0.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_clear_tag.c", 1011), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_clear_tag.c", 1011); gSPDisplayList(POLY_XLU_DISP++, gArwingLaserDL); } else { // Draw the Arwing itself. @@ -718,8 +716,7 @@ void EnClearTag_Draw(Actor* thisx, PlayState* play) { Matrix_RotateY(yRotation, MTXMODE_APPLY); } Matrix_RotateZ(this->roll, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_clear_tag.c", 1030), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_clear_tag.c", 1030); gSPDisplayList(POLY_OPA_DISP++, gArwingDL); // Draw the Arwing Backfire @@ -732,8 +729,7 @@ void EnClearTag_Draw(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 200, 155); gDPPipeSync(POLY_XLU_DISP++); gDPSetEnvColor(POLY_XLU_DISP++, 255, 50, 0, 0); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_clear_tag.c", 1067), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_clear_tag.c", 1067); gSPDisplayList(POLY_XLU_DISP++, gArwingBackfireDL); // Draw the Arwing shadow. @@ -756,8 +752,7 @@ void EnClearTag_Draw(Actor* thisx, PlayState* play) { Matrix_RotateY(yRotation, MTXMODE_APPLY); } Matrix_RotateZ(this->roll, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_clear_tag.c", 1104), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_clear_tag.c", 1104); gSPDisplayList(POLY_XLU_DISP++, gArwingShadowDL); } } @@ -914,8 +909,7 @@ void EnClearTag_DrawEffects(PlayState* play) { Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY); Matrix_RotateY(effect->rotationY, MTXMODE_APPLY); Matrix_RotateX(effect->rotationX, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_en_clear_tag.c", 1307), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_en_clear_tag.c", 1307); gSPDisplayList(POLY_OPA_DISP++, gArwingDebrisEffectDL); } } @@ -938,8 +932,7 @@ void EnClearTag_DrawEffects(PlayState* play) { Matrix_RotateX(effect->floorTangent.x, MTXMODE_APPLY); Matrix_RotateZ(effect->floorTangent.z, MTXMODE_APPLY); Matrix_Scale(effect->scale + effect->scale, 1.0f, effect->scale * 2.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_clear_tag.c", 1342), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_clear_tag.c", 1342); gSPDisplayList(POLY_XLU_DISP++, gArwingFlashEffectGroundDL); } } @@ -968,8 +961,7 @@ void EnClearTag_DrawEffects(PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, 20.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_clear_tag.c", 1392), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_clear_tag.c", 1392); gSPDisplayList(POLY_XLU_DISP++, gArwingFireEffectDL); } } @@ -994,8 +986,7 @@ void EnClearTag_DrawEffects(PlayState* play) { Matrix_Translate(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_clear_tag.c", 1439), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_clear_tag.c", 1439); gSPDisplayList(POLY_XLU_DISP++, gArwingFireEffectDL); } } @@ -1017,8 +1008,7 @@ void EnClearTag_DrawEffects(PlayState* play) { Matrix_Translate(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_clear_tag.c", 1470), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_clear_tag.c", 1470); gSPDisplayList(POLY_XLU_DISP++, gArwingFlashEffectDL); } } diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h index b817cdc008..945a5462d6 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h @@ -6,13 +6,13 @@ struct EnClearTag; -typedef enum { +typedef enum ClearTagType { /* 0x00 */ CLEAR_TAG_CUTSCENE_ARWING = 0, /* 0x01 */ CLEAR_TAG_ARWING = 1, /* 0x64 */ CLEAR_TAG_LASER = 100 } ClearTagType; -typedef enum { +typedef enum ClearTagState { /* 0x00 */ CLEAR_TAG_STATE_FLYING = 0, /* 0x01 */ CLEAR_TAG_STATE_TARGET_LOCKED = 1, /* 0x02 */ CLEAR_TAG_STATE_DEMO = 2, @@ -20,19 +20,19 @@ typedef enum { /* 0x64 */ CLEAR_TAG_STATE_LASER = 100 } ClearTagState; -typedef enum { +typedef enum ClearTagDemoMode { /* 0x00 */ CLEAR_TAG_CUTSCENE_MODE_NONE, /* 0x01 */ CLEAR_TAG_CUTSCENE_MODE_SETUP, /* 0x02 */ CLEAR_TAG_CUTSCENE_MODE_PLAY } ClearTagDemoMode; -typedef enum { +typedef enum ClearTagDrawMode { /* 0x00 */ CLEAR_TAG_DRAW_MODE_ARWING, /* 0x01 */ CLEAR_TAG_DRAW_MODE_ALL, /* 0x02 */ CLEAR_TAG_DRAW_MODE_EFFECT } ClearTagDrawMode; -typedef enum { +typedef enum ClearTagEffectType { /* 0x00 */ CLEAR_TAG_EFFECT_AVAILABLE, /* 0x01 */ CLEAR_TAG_EFFECT_DEBRIS, /* 0x02 */ CLEAR_TAG_EFFECT_FIRE, @@ -40,7 +40,7 @@ typedef enum { /* 0x04 */ CLEAR_TAG_EFFECT_FLASH } ClearTagEffectType; -typedef enum { +typedef enum ClearTagTimers { /* 0x00 */ CLEAR_TAG_TIMER_ARWING_UPDATE_STATE = 0, /* 0x00 */ CLEAR_TAG_TIMER_LASER_DEATH = 0, /* 0x01 */ CLEAR_TAG_TIMER_ARWING_ENTER_LOCKED_ON, diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index a9e667089f..30d16077f5 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -6,7 +6,7 @@ #include "z_en_cow.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnCow_Init(Actor* thisx, PlayState* play); void EnCow_Destroy(Actor* thisx, PlayState* play); @@ -26,7 +26,7 @@ void EnCow_DrawTail(Actor* thisx, PlayState* play); void EnCow_UpdateTail(Actor* thisx, PlayState* play); void EnCow_IdleTail(EnCow* this, PlayState* play); -ActorInit En_Cow_InitVars = { +ActorProfile En_Cow_Profile = { /**/ ACTOR_EN_COW, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -40,7 +40,7 @@ ActorInit En_Cow_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, @@ -48,7 +48,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -146,7 +146,7 @@ void EnCow_Init(Actor* thisx, PlayState* play) { COW_TYPE_TAIL); this->animationTimer = Rand_ZeroFloat(1000.0f) + 40.0f; this->breathTimer = 0; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; R_EPONAS_SONG_PLAYED = false; break; @@ -158,7 +158,7 @@ void EnCow_Init(Actor* thisx, PlayState* play) { this->actor.draw = EnCow_DrawTail; this->actionFunc = EnCow_IdleTail; EnCow_SetTailPos(this); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->animationTimer = (u16)Rand_ZeroFloat(1000.0f) + 40.0f; break; } @@ -217,7 +217,7 @@ void EnCow_UpdateAnimation(EnCow* this, PlayState* play) { void EnCow_TalkEnd(EnCow* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Message_CloseTextbox(play); this->actionFunc = EnCow_Idle; } @@ -225,7 +225,7 @@ void EnCow_TalkEnd(EnCow* this, PlayState* play) { void EnCow_GiveMilkEnd(EnCow* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->actionFunc = EnCow_Idle; } } @@ -241,7 +241,7 @@ void EnCow_GiveMilkWait(EnCow* this, PlayState* play) { void EnCow_GiveMilk(EnCow* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Message_CloseTextbox(play); this->actionFunc = EnCow_GiveMilkWait; Actor_OfferGetItem(&this->actor, play, GI_MILK, 10000.0f, 100.0f); @@ -264,7 +264,7 @@ void EnCow_Talk(EnCow* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, play)) { this->actionFunc = EnCow_CheckForEmptyBottle; } else { - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Actor_OfferTalk(&this->actor, play, 170.0f); this->actor.textId = 0x2006; } @@ -290,7 +290,7 @@ void EnCow_Idle(EnCow* this, PlayState* play) { (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 25000)) { R_EPONAS_SONG_PLAYED = false; this->actionFunc = EnCow_Talk; - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Actor_OfferTalk(&this->actor, play, 170.0f); this->actor.textId = 0x2006; } else { diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.h b/src/overlays/actors/ovl_En_Cow/z_en_cow.h index 145d937f68..cdec79fca8 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.h +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.h @@ -10,12 +10,12 @@ #define COW_GET_TYPE(thisx) ((thisx)->actor.params) -typedef enum { +typedef enum CowType { /* 0 */ COW_TYPE_BODY, /* 1 */ COW_TYPE_TAIL } CowType; -typedef enum { +typedef enum CowCollider { /* 0 */ COW_COLLIDER_FRONT, /* 1 */ COW_COLLIDER_REAR, /* 2 */ COW_COLLIDER_MAX diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index fc6f9474e2..54c261ccd9 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -1,7 +1,7 @@ #include "z_en_crow.h" #include "assets/objects/object_crow/object_crow.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_14) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_14) void EnCrow_Init(Actor* thisx, PlayState* play); void EnCrow_Destroy(Actor* thisx, PlayState* play); @@ -18,7 +18,7 @@ void EnCrow_Damaged(EnCrow* this, PlayState* play); static Vec3f sZeroVecAccel = { 0.0f, 0.0f, 0.0f }; -ActorInit En_Crow_InitVars = { +ActorProfile En_Crow_Profile = { /**/ ACTOR_EN_CROW, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -33,7 +33,7 @@ ActorInit En_Crow_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_HARD, @@ -46,7 +46,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -100,7 +100,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneScale, 3000, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, NAVI_ENEMY_GUAY, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -200, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 2000, ICHAIN_STOP), }; static Vec3f sHeadVec = { 2500.0f, 0.0f, 0.0f }; @@ -153,7 +153,7 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) { this->actor.world.pos.y += 20.0f * scale; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.shape.yOffset = 0.0f; - this->actor.targetArrowOffset = 0.0f; + this->actor.lockOnArrowOffset = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_DEAD); if (this->actor.colChkInfo.damageEffect == 3) { // Ice arrows @@ -218,7 +218,7 @@ void EnCrow_SetupRespawn(EnCrow* this) { this->actor.shape.rot.z = 0; this->timer = 300; this->actor.shape.yOffset = 2000; - this->actor.targetArrowOffset = 2000.0f; + this->actor.lockOnArrowOffset = 2000.0f; this->actor.draw = NULL; this->actionFunc = EnCrow_Respawn; } @@ -400,7 +400,7 @@ void EnCrow_Respawn(EnCrow* this, PlayState* play) { target = 0.01f; } if (Math_StepToF(&this->actor.scale.x, target, target * 0.1f)) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.flags &= ~ACTOR_FLAG_4; this->actor.colChkInfo.health = 1; EnCrow_SetupFlyIdle(this); @@ -418,7 +418,7 @@ void EnCrow_UpdateDamage(EnCrow* this, PlayState* play) { EnCrow_SetupTurnAway(this); } else { Actor_ApplyDamage(&this->actor); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Enemy_StartFinishingBlow(play, &this->actor); EnCrow_SetupDamaged(this, play); } diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index d99e291207..807abac5ec 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -2,7 +2,7 @@ #include "assets/objects/object_cs/object_cs.h" #include "assets/objects/object_link_child/object_link_child.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnCs_Init(Actor* thisx, PlayState* play); void EnCs_Destroy(Actor* thisx, PlayState* play); @@ -15,7 +15,7 @@ void EnCs_Wait(EnCs* this, PlayState* play); s32 EnCs_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx); void EnCs_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx); -ActorInit En_Cs_InitVars = { +ActorProfile En_Cs_Profile = { /**/ ACTOR_EN_CS, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -29,7 +29,7 @@ ActorInit En_Cs_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -37,7 +37,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -84,7 +84,7 @@ static DamageTable sDamageTable[] = { /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; -typedef enum { +typedef enum EnCsAnimation { /* 0 */ ENCS_ANIM_0, /* 1 */ ENCS_ANIM_1, /* 2 */ ENCS_ANIM_2, @@ -143,8 +143,8 @@ void EnCs_Init(Actor* thisx, PlayState* play) { Animation_GetLastFrame(sAnimationInfo[ENCS_ANIM_0].animation), sAnimationInfo[ENCS_ANIM_0].mode, sAnimationInfo[ENCS_ANIM_0].morphFrames); - this->actor.targetMode = 6; - this->path = this->actor.params & 0xFF; + this->actor.attentionRangeType = ATTENTION_RANGE_6; + this->path = PARAMS_GET_U(this->actor.params, 0, 8); this->unk_1EC = 0; // This variable is unused anywhere else this->talkState = 0; this->currentAnimIndex = -1; @@ -477,7 +477,7 @@ void EnCs_Draw(Actor* thisx, PlayState* play) { Mtx* mtx; Matrix_Put(&this->spookyMaskMtx); - mtx = MATRIX_NEW(play->state.gfxCtx, "../z_en_cs.c", 1000); + mtx = MATRIX_FINALIZE(play->state.gfxCtx, "../z_en_cs.c", 1000); gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[linkChildObjectSlot].segment); gSPSegment(POLY_OPA_DISP++, 0x0D, mtx - 7); gSPDisplayList(POLY_OPA_DISP++, gLinkChildSpookyMaskDL); diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index c99af39956..0f84c7784a 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -2,9 +2,9 @@ #include "overlays/actors/ovl_En_GeldB/z_en_geldb.h" #include "assets/objects/object_daiku/object_daiku.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) -typedef struct { +typedef struct EnDaikuEscapeSubCamParam { Vec3f eyePosDeltaLocal; s32 maxFramesActive; } EnDaikuEscapeSubCamParam; @@ -20,7 +20,7 @@ typedef struct { // the gerudo guard was defeated #define ENDAIKU_STATEFLAG_GERUDODEFEATED (1 << 4) -typedef enum { +typedef enum EnDaikuTalkState { /* 0 */ ENDAIKU_STATE_CAN_TALK, /* 2 */ ENDAIKU_STATE_TALKING = 2, /* 3 */ ENDAIKU_STATE_NO_TALK @@ -41,7 +41,7 @@ void EnDaiku_EscapeRun(EnDaiku* this, PlayState* play); s32 EnDaiku_OverrideLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx); void EnDaiku_PostLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3s* rot, void* thisx); -ActorInit En_Daiku_InitVars = { +ActorProfile En_Daiku_Profile = { /**/ ACTOR_EN_DAIKU, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -55,7 +55,7 @@ ActorInit En_Daiku_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -63,7 +63,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -110,7 +110,7 @@ static DamageTable sDamageTable = { /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; -typedef enum { +typedef enum EnDaikuAnimation { /* 0 */ ENDAIKU_ANIM_SHOUT, /* 1 */ ENDAIKU_ANIM_STAND, /* 2 */ ENDAIKU_ANIM_CELEBRATE, @@ -152,13 +152,13 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { s32 noKill = true; s32 isFree = false; - if ((this->actor.params & 3) == 0 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(0))) { + if (PARAMS_GET_U(this->actor.params, 0, 2) == 0 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(0))) { isFree = true; - } else if ((this->actor.params & 3) == 1 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(1))) { + } else if (PARAMS_GET_U(this->actor.params, 0, 2) == 1 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(1))) { isFree = true; - } else if ((this->actor.params & 3) == 2 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(2))) { + } else if (PARAMS_GET_U(this->actor.params, 0, 2) == 2 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(2))) { isFree = true; - } else if ((this->actor.params & 3) == 3 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(3))) { + } else if (PARAMS_GET_U(this->actor.params, 0, 2) == 3 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(3))) { isFree = true; } @@ -189,7 +189,7 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->currentAnimIndex = -1; this->runSpeed = 5.0f; this->initRot = this->actor.world.rot; @@ -200,7 +200,7 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { this->stateFlags |= ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2; this->actionFunc = EnDaiku_Jailed; } else { - if ((this->actor.params & 3) == 1 || (this->actor.params & 3) == 3) { + if (PARAMS_GET_U(this->actor.params, 0, 2) == 1 || PARAMS_GET_U(this->actor.params, 0, 2) == 3) { EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_SIT, &this->currentAnimIndex); this->stateFlags |= ENDAIKU_STATEFLAG_1; } else { @@ -295,7 +295,7 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) { this->actor.textId = 0x6007; } } else if (play->sceneId == SCENE_CARPENTERS_TENT) { - switch (this->actor.params & 3) { + switch (PARAMS_GET_U(this->actor.params, 0, 2)) { case 0: if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) { this->actor.textId = 0x6060; @@ -367,7 +367,7 @@ void EnDaiku_Jailed(EnDaiku* this, PlayState* play) { this->actionFunc = EnDaiku_WaitFreedom; } else if (!(this->stateFlags & ENDAIKU_STATEFLAG_GERUDOFIGHTING) && !gerudo->invisible) { this->stateFlags |= ENDAIKU_STATEFLAG_GERUDOFIGHTING; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); } } @@ -378,8 +378,8 @@ void EnDaiku_Jailed(EnDaiku* this, PlayState* play) { void EnDaiku_WaitFreedom(EnDaiku* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F)) { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; EnDaiku_UpdateText(this, play); } } @@ -400,14 +400,14 @@ void EnDaiku_InitEscape(EnDaiku* this, PlayState* play) { this->stateFlags &= ~(ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2); gSaveContext.save.info.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] |= - EVENTCHKINF_CARPENTERS_FREE_MASK(this->actor.params & 3); + EVENTCHKINF_CARPENTERS_FREE_MASK(PARAMS_GET_U(this->actor.params, 0, 2)); this->actor.gravity = -1.0f; - this->escapeSubCamTimer = sEscapeSubCamParams[this->actor.params & 3].maxFramesActive; + this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].maxFramesActive; EnDaiku_InitSubCamera(this, play); exitLoop = false; - path = &play->pathList[this->actor.params >> 4 & 0xF]; + path = &play->pathList[PARAMS_GET_U(this->actor.params, 4, 4)]; while (!exitLoop) { pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint; dx = pointPos->x - this->actor.world.pos.x; @@ -444,11 +444,11 @@ void EnDaiku_InitSubCamera(EnDaiku* this, PlayState* play) { Vec3f eyePosDeltaWorld; this->subCamActive = true; - this->escapeSubCamTimer = sEscapeSubCamParams[this->actor.params & 3].maxFramesActive; + this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].maxFramesActive; - eyePosDeltaLocal.x = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.x; - eyePosDeltaLocal.y = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.y; - eyePosDeltaLocal.z = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.z; + eyePosDeltaLocal.x = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].eyePosDeltaLocal.x; + eyePosDeltaLocal.y = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].eyePosDeltaLocal.y; + eyePosDeltaLocal.z = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].eyePosDeltaLocal.z; Matrix_RotateY(BINANG_TO_RAD(this->actor.world.rot.y), MTXMODE_NEW); Matrix_MultVec3f(&eyePosDeltaLocal, &eyePosDeltaWorld); @@ -524,7 +524,7 @@ void EnDaiku_EscapeRun(EnDaiku* this, PlayState* play) { f32 dxz; Vec3s* pointPos; - path = &play->pathList[this->actor.params >> 4 & 0xF]; + path = &play->pathList[PARAMS_GET_U(this->actor.params, 4, 4)]; pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint; dx = pointPos->x - this->actor.world.pos.x; dz = pointPos->z - this->actor.world.pos.z; @@ -594,21 +594,19 @@ void EnDaiku_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - if ((thisx->params & 3) == 0) { + if (PARAMS_GET_U(thisx->params, 0, 2) == 0) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 10, 70, 255); - } else if ((thisx->params & 3) == 1) { + } else if (PARAMS_GET_U(thisx->params, 0, 2) == 1) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 200, 255, 255); - } else if ((thisx->params & 3) == 2) { + } else if (PARAMS_GET_U(thisx->params, 0, 2) == 2) { gDPSetEnvColor(POLY_OPA_DISP++, 0, 230, 70, 255); - } else if ((thisx->params & 3) == 3) { + } else if (PARAMS_GET_U(thisx->params, 0, 2) == 3) { gDPSetEnvColor(POLY_OPA_DISP++, 200, 0, 150, 255); } SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnDaiku_OverrideLimbDraw, EnDaiku_PostLimbDraw, this); - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_en_daiku.c", 1255); } @@ -639,7 +637,7 @@ void EnDaiku_PostLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3s* rot, vo if (limb == 15) { // head Matrix_MultVec3f(&targetPosHeadLocal, &this->actor.focus.pos); - gSPDisplayList(POLY_OPA_DISP++, hairDLists[this->actor.params & 3]); + gSPDisplayList(POLY_OPA_DISP++, hairDLists[PARAMS_GET_U(this->actor.params, 0, 2)]); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_daiku.c", 1330); diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index f5e31493c3..2612749b4e 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -7,9 +7,9 @@ #include "z_en_daiku_kakariko.h" #include "assets/objects/object_daiku/object_daiku.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) -typedef enum { +typedef enum KakarikoCarpenterType { /* 0x0 */ CARPENTER_ICHIRO, // Red and purple pants, normal hair /* 0x1 */ CARPENTER_SABOORO, // Light blue pants /* 0x2 */ CARPENTER_JIRO, // Green pants @@ -24,7 +24,7 @@ void EnDaikuKakariko_Draw(Actor* thisx, PlayState* play); void EnDaikuKakariko_Wait(EnDaikuKakariko* this, PlayState* play); void EnDaikuKakariko_Run(EnDaikuKakariko* this, PlayState* play); -ActorInit En_Daiku_Kakariko_InitVars = { +ActorProfile En_Daiku_Kakariko_Profile = { /**/ ACTOR_EN_DAIKU_KAKARIKO, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -38,7 +38,7 @@ ActorInit En_Daiku_Kakariko_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -46,7 +46,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -93,7 +93,7 @@ static DamageTable sDamageTable = { /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; -typedef enum { +typedef enum EnDaikuKakarikoAnimation { /* 0 */ ENDAIKUKAKARIKO_ANIM_0, /* 1 */ ENDAIKUKAKARIKO_ANIM_1, /* 2 */ ENDAIKUKAKARIKO_ANIM_2, @@ -124,7 +124,7 @@ void EnDaikuKakariko_ChangeAnim(EnDaikuKakariko* this, s32 index, s32* currentIn } void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) { - static u16 initFlags[] = { 0x0080, 0x00B0, 0x0070, 0x0470 }; // List of inital values for this->flags + static u16 initFlags[] = { 0x0080, 0x00B0, 0x0070, 0x0470 }; // List of initial values for this->flags EnDaikuKakariko* this = (EnDaikuKakariko*)thisx; s32 pad; @@ -133,7 +133,7 @@ void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) { case SCENE_KAKARIKO_VILLAGE: if (IS_DAY) { this->flags |= 1; - this->flags |= initFlags[this->actor.params & 3]; + this->flags |= initFlags[PARAMS_GET_U(this->actor.params, 0, 2)]; } break; case SCENE_KAKARIKO_CENTER_GUEST_HOUSE: @@ -172,7 +172,7 @@ void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) { this->actor.gravity = 0.0f; this->runSpeed = 3.0f; this->actor.uncullZoneForward = 1200.0f; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->currentAnimIndex = -1; if (this->flags & 0x40) { @@ -184,7 +184,8 @@ void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnDaikuKakariko_Run; } else { if (this->flags & 8) { - if (((this->actor.params & 3) == CARPENTER_SABOORO) || ((this->actor.params & 3) == CARPENTER_SHIRO)) { + if ((PARAMS_GET_U(this->actor.params, 0, 2) == CARPENTER_SABOORO) || + (PARAMS_GET_U(this->actor.params, 0, 2) == CARPENTER_SHIRO)) { EnDaikuKakariko_ChangeAnim(this, ENDAIKUKAKARIKO_ANIM_5, &this->currentAnimIndex); this->flags |= 0x800; } else { @@ -244,10 +245,11 @@ void EnDaikuKakariko_HandleTalking(EnDaikuKakariko* this, PlayState* play) { if ((sp26 >= 0) && (sp26 <= 320) && (sp24 >= 0) && (sp24 <= 240) && (this->talkState == 0) && (Actor_OfferTalk(&this->actor, play, 100.0f) == 1)) { - this->actor.textId = MaskReaction_GetTextId(play, sMaskReactionSets[this->actor.params & 3]); + this->actor.textId = + MaskReaction_GetTextId(play, sMaskReactionSets[PARAMS_GET_U(this->actor.params, 0, 2)]); if (this->actor.textId == 0) { - switch (this->actor.params & 3) { + switch (PARAMS_GET_U(this->actor.params, 0, 2)) { case 0: if (this->flags & 8) { this->actor.textId = 0x5076; @@ -364,7 +366,7 @@ void EnDaikuKakariko_Run(EnDaikuKakariko* this, PlayState* play) { s32 run; do { - path = &play->pathList[(this->actor.params >> 8) & 0xFF]; + path = &play->pathList[PARAMS_GET_U(this->actor.params, 8, 8)]; pathPos = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->waypoint]; xDist = pathPos->x - this->actor.world.pos.x; zDist = pathPos->z - this->actor.world.pos.z; @@ -536,7 +538,7 @@ void EnDaikuKakariko_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, V if (limbIndex == 15) { Matrix_MultVec3f(&unkVec, &this->actor.focus.pos); - gSPDisplayList(POLY_OPA_DISP++, carpenterHeadDLists[this->actor.params & 3]); + gSPDisplayList(POLY_OPA_DISP++, carpenterHeadDLists[PARAMS_GET_U(this->actor.params, 0, 2)]); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_daiku_kakariko.c", 1113); @@ -549,20 +551,18 @@ void EnDaikuKakariko_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - if ((thisx->params & 3) == CARPENTER_ICHIRO) { + if (PARAMS_GET_U(thisx->params, 0, 2) == CARPENTER_ICHIRO) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 10, 70, 255); - } else if ((thisx->params & 3) == CARPENTER_SABOORO) { + } else if (PARAMS_GET_U(thisx->params, 0, 2) == CARPENTER_SABOORO) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 200, 255, 255); - } else if ((thisx->params & 3) == CARPENTER_JIRO) { + } else if (PARAMS_GET_U(thisx->params, 0, 2) == CARPENTER_JIRO) { gDPSetEnvColor(POLY_OPA_DISP++, 0, 230, 70, 255); - } else if ((thisx->params & 3) == CARPENTER_SHIRO) { + } else if (PARAMS_GET_U(thisx->params, 0, 2) == CARPENTER_SHIRO) { gDPSetEnvColor(POLY_OPA_DISP++, 200, 0, 150, 255); } SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnDaikuKakariko_OverrideLimbDraw, EnDaikuKakariko_PostLimbDraw, thisx); - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_en_daiku_kakariko.c", 1151); } diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index 265e58cc00..1e89ac5ff8 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -3,7 +3,7 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) void EnDekubaba_Init(Actor* thisx, PlayState* play); void EnDekubaba_Destroy(Actor* thisx, PlayState* play); @@ -29,7 +29,7 @@ void EnDekubaba_DeadStickDrop(EnDekubaba* this, PlayState* play); static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; -ActorInit En_Dekubaba_InitVars = { +ActorProfile En_Dekubaba_Profile = { /**/ ACTOR_EN_DEKUBABA, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -44,7 +44,7 @@ ActorInit En_Dekubaba_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[7] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_HARD, @@ -55,7 +55,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[7] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -66,7 +66,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[7] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -77,7 +77,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[7] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -88,7 +88,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[7] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -99,7 +99,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[7] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -110,7 +110,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[7] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -123,7 +123,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[7] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -136,7 +136,7 @@ static ColliderJntSphInit sJntSphInit = { static CollisionCheckInfoInit sColChkInfoInit = { 2, 25, 25, MASS_IMMOVABLE }; -typedef enum { +typedef enum DekuBabaDamageEffect { /* 0x0 */ DEKUBABA_DMGEFF_NONE, /* 0x1 */ DEKUBABA_DMGEFF_DEKUNUT, /* 0x2 */ DEKUBABA_DMGEFF_FIRE, @@ -217,7 +217,7 @@ static DamageTable sBigDekuBabaDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 1500, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 1500, ICHAIN_STOP), }; void EnDekubaba_Init(Actor* thisx, PlayState* play) { @@ -249,7 +249,7 @@ void EnDekubaba_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo(&this->actor.colChkInfo, &sBigDekuBabaDamageTable, &sColChkInfoInit); this->actor.colChkInfo.health = 4; this->actor.naviEnemyId = NAVI_ENEMY_BIG_DEKU_BABA; - this->actor.targetMode = 2; + this->actor.attentionRangeType = ATTENTION_RANGE_2; } else { this->size = 1.0f; @@ -263,7 +263,7 @@ void EnDekubaba_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDekuBabaDamageTable, &sColChkInfoInit); this->actor.naviEnemyId = NAVI_ENEMY_DEKU_BABA; - this->actor.targetMode = 1; + this->actor.attentionRangeType = ATTENTION_RANGE_1; } EnDekubaba_SetupWait(this); @@ -299,7 +299,7 @@ void EnDekubaba_SetupWait(EnDekubaba* this) { Actor_SetScale(&this->actor, this->size * 0.01f * 0.5f); - this->collider.base.colType = COLTYPE_HARD; + this->collider.base.colMaterial = COL_MATERIAL_HARD; this->collider.base.acFlags |= AC_HARD; this->timer = 45; @@ -326,7 +326,7 @@ void EnDekubaba_SetupGrow(EnDekubaba* this) { this->collider.elements[i].base.ocElemFlags |= OCELEM_ON; } - this->collider.base.colType = COLTYPE_HIT6; + this->collider.base.colMaterial = COL_MATERIAL_HIT6; this->collider.base.acFlags &= ~AC_HARD; Actor_PlaySfx(&this->actor, NA_SE_EN_DUMMY482); this->actionFunc = EnDekubaba_Grow; @@ -955,7 +955,7 @@ void EnDekubaba_PrunedSomersault(EnDekubaba* this, PlayState* play) { ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) || (this->actor.bgCheckFlags & BGCHECKFLAG_WALL))) { this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = 0.0f; this->actor.speed = 0.0f; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, this->size * 3.0f, 0, this->size * 12.0f, this->size * 5.0f, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); } @@ -1034,7 +1034,7 @@ void EnDekubaba_UpdateDamage(EnDekubaba* this, PlayState* play) { this->collider.base.acFlags &= ~AC_HIT; Actor_SetDropFlagJntSph(&this->actor, &this->collider, true); - if ((this->collider.base.colType != COLTYPE_HARD) && + if ((this->collider.base.colMaterial != COL_MATERIAL_HARD) && ((this->actor.colChkInfo.damageEffect != DEKUBABA_DMGEFF_NONE) || (this->actor.colChkInfo.damage != 0))) { phi_s0 = this->actor.colChkInfo.health - this->actor.colChkInfo.damage; @@ -1082,7 +1082,7 @@ void EnDekubaba_UpdateDamage(EnDekubaba* this, PlayState* play) { } else { return; } - } else if ((play->actorCtx.unk_02 != 0) && (this->collider.base.colType != COLTYPE_HARD) && + } else if ((play->actorCtx.unk_02 != 0) && (this->collider.base.colMaterial != COL_MATERIAL_HARD) && (this->actionFunc != EnDekubaba_StunnedVertical) && (this->actionFunc != EnDekubaba_Hit) && (this->actor.colChkInfo.health != 0)) { this->actor.colChkInfo.health--; @@ -1157,8 +1157,7 @@ void EnDekubaba_DrawStemRetracted(EnDekubaba* this, PlayState* play) { MTXMODE_NEW); Matrix_RotateZYX(this->stemSectionAngle[0], this->actor.shape.rot.y, 0, MTXMODE_APPLY); Matrix_Scale(horizontalScale, horizontalScale, horizontalScale, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_dekubaba.c", 2461), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_dekubaba.c", 2461); gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStemTopDL); Actor_SetFocus(&this->actor, 0.0f); @@ -1202,8 +1201,7 @@ void EnDekubaba_DrawStemExtended(EnDekubaba* this, PlayState* play) { Matrix_Put(&mtx); Matrix_RotateZYX(this->stemSectionAngle[i], this->actor.shape.rot.y, 0, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_dekubaba.c", 2533), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_dekubaba.c", 2533); gSPDisplayList(POLY_OPA_DISP++, stemDLists[i]); @@ -1237,8 +1235,7 @@ void EnDekubaba_DrawStemBasePruned(EnDekubaba* this, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_dekubaba.c", 2579); Matrix_RotateZYX(this->stemSectionAngle[2], this->actor.shape.rot.y, 0, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_dekubaba.c", 2586), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_dekubaba.c", 2586); gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStemBaseDL); Collider_UpdateSpheres(55, &this->collider); @@ -1260,8 +1257,7 @@ void EnDekubaba_DrawBaseShadow(EnDekubaba* this, PlayState* play) { horizontalScale = this->size * 0.15f; Matrix_Scale(horizontalScale, 1.0f, horizontalScale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_dekubaba.c", 2710), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_dekubaba.c", 2710); gSPDisplayList(POLY_XLU_DISP++, gCircleShadowDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_dekubaba.c", 2715); } @@ -1278,7 +1274,6 @@ void EnDekubaba_Draw(Actor* thisx, PlayState* play) { EnDekubaba* this = (EnDekubaba*)thisx; f32 scale; - if (1) {} OPEN_DISPS(play->state.gfxCtx, "../z_en_dekubaba.c", 2752); Gfx_SetupDL_25Opa(play->state.gfxCtx); @@ -1296,8 +1291,7 @@ void EnDekubaba_Draw(Actor* thisx, PlayState* play) { Matrix_Translate(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, MTXMODE_NEW); Matrix_RotateY(BINANG_TO_RAD(this->actor.home.rot.y), MTXMODE_APPLY); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_dekubaba.c", 2780), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_dekubaba.c", 2780); gSPDisplayList(POLY_OPA_DISP++, gDekuBabaBaseLeavesDL); if (this->actionFunc == EnDekubaba_PrunedSomersault) { @@ -1311,8 +1305,7 @@ void EnDekubaba_Draw(Actor* thisx, PlayState* play) { // Display solid until 40 frames left, then blink until killed. } else if ((this->timer > 40) || ((this->timer % 2) != 0)) { Matrix_Translate(0.0f, 0.0f, 200.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_dekubaba.c", 2797), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_dekubaba.c", 2797); gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStickDropDL); } diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h index b6e5243e95..b1d53307ce 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h @@ -8,7 +8,7 @@ struct EnDekubaba; typedef void (*EnDekubabaActionFunc)(struct EnDekubaba*, PlayState*); -typedef enum { +typedef enum DekuBabaType { /* 0 */ DEKUBABA_NORMAL, /* 1 */ DEKUBABA_BIG } DekuBabaType; diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 6e14eba6ce..c21d760eb9 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -8,7 +8,7 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "assets/objects/object_dekunuts/object_dekunuts.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) #define DEKUNUTS_FLOWER 10 @@ -30,7 +30,7 @@ void EnDekunuts_BeDamaged(EnDekunuts* this, PlayState* play); void EnDekunuts_BeStunned(EnDekunuts* this, PlayState* play); void EnDekunuts_Die(EnDekunuts* this, PlayState* play); -ActorInit En_Dekunuts_InitVars = { +ActorProfile En_Dekunuts_Profile = { /**/ ACTOR_EN_DEKUNUTS, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -44,7 +44,7 @@ ActorInit En_Dekunuts_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -52,7 +52,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -102,7 +102,7 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_MAD_SCRUB, ICHAIN_CONTINUE), ICHAIN_F32(gravity, -1, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 2600, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 2600, ICHAIN_STOP), }; void EnDekunuts_Init(Actor* thisx, PlayState* play) { @@ -111,7 +111,7 @@ void EnDekunuts_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); if (thisx->params == DEKUNUTS_FLOWER) { - thisx->flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); + thisx->flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); } else { ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 35.0f); SkelAnime_Init(play, &this->skelAnime, &gDekuNutsSkel, &gDekuNutsStandAnim, this->jointTable, this->morphTable, @@ -119,7 +119,7 @@ void EnDekunuts_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); - this->shotsPerRound = ((thisx->params >> 8) & 0xFF); + this->shotsPerRound = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if ((this->shotsPerRound == 0xFF) || (this->shotsPerRound == 0)) { this->shotsPerRound = 1; @@ -178,7 +178,7 @@ void EnDekunuts_SetupBurrow(EnDekunuts* this) { void EnDekunuts_SetupBeginRun(EnDekunuts* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gDekuNutsUnburrowAnim, -3.0f); this->collider.dim.height = 37; - this->actor.colChkInfo.mass = 0x32; + this->actor.colChkInfo.mass = 50; Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DAMAGE); this->collider.base.acFlags &= ~AC_ON; this->actionFunc = EnDekunuts_BeginRun; @@ -446,7 +446,7 @@ void EnDekunuts_ColliderCheck(EnDekunuts* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; Actor_SetDropFlag(&this->actor, &this->collider.elem, true); - if (this->actor.colChkInfo.mass == 0x32) { + if (this->actor.colChkInfo.mass == 50) { if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (this->actor.colChkInfo.damageEffect != 1) { if (this->actor.colChkInfo.damageEffect == 2) { diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/src/overlays/actors/ovl_En_Dh/z_en_dh.c index ccf7f4af2c..0936c81d77 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -1,9 +1,9 @@ #include "z_en_dh.h" #include "assets/objects/object_dh/object_dh.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_10) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_10) -typedef enum { +typedef enum EnDhAction { /* 0 */ DH_WAIT, /* 1 */ DH_RETREAT, /* 2 */ DH_BURROW, @@ -31,7 +31,7 @@ void EnDh_Burrow(EnDh* this, PlayState* play); void EnDh_Damage(EnDh* this, PlayState* play); void EnDh_Death(EnDh* this, PlayState* play); -ActorInit En_Dh_InitVars = { +ActorProfile En_Dh_Profile = { /**/ ACTOR_EN_DH, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -45,7 +45,7 @@ ActorInit En_Dh_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -53,7 +53,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -66,7 +66,7 @@ static ColliderCylinderInit sCylinderInit = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -79,7 +79,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -127,7 +127,7 @@ static DamageTable D_809EC620 = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_DEAD_HAND, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3500, ICHAIN_STOP), }; @@ -148,7 +148,7 @@ void EnDh_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = LINK_IS_ADULT ? 14 : 20; this->alpha = this->unk_258 = 255; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Collider_InitCylinder(play, &this->collider1); Collider_SetCylinder(play, &this->collider1, &this->actor, &sCylinderInit); Collider_InitJntSph(play, &this->collider2); @@ -206,7 +206,7 @@ void EnDh_Wait(EnDh* this, PlayState* play) { if ((this->actor.params >= ENDH_START_ATTACK_GRAB) || (this->actor.params <= ENDH_HANDS_KILLED_4)) { switch (this->actionState) { case 0: - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.flags &= ~ACTOR_FLAG_REACT_TO_LENS; this->actionState++; @@ -233,7 +233,7 @@ void EnDh_Wait(EnDh* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x7D0, 0); SkelAnime_Update(&this->skelAnime); if (this->actor.params != ENDH_START_ATTACK_BOMB) { - func_8008EEAC(play, &this->actor); + Player_SetAutoLockOnActor(play, &this->actor); } } } @@ -330,7 +330,7 @@ void EnDh_Attack(EnDh* this, PlayState* play) { this->actionState++; } else if (this->collider2.base.atFlags & AT_HIT) { this->collider2.base.atFlags &= ~AT_HIT; - func_8002F71C(play, &this->actor, 8.0f, this->actor.shape.rot.y, 8.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, this->actor.shape.rot.y, 8.0f); } break; case 3: @@ -366,7 +366,7 @@ void EnDh_SetupBurrow(EnDh* this) { this->actor.world.rot.y = this->actor.shape.rot.y; this->dirtWavePhase = 0; this->actionState = 0; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Actor_PlaySfx(&this->actor, NA_SE_EN_DEADHAND_HIDE); EnDh_SetupAction(this, EnDh_Burrow); } @@ -437,7 +437,7 @@ void EnDh_SetupDeath(EnDh* this) { Animation_MorphToPlayOnce(&this->skelAnime, &object_dh_Anim_0032BC, -1.0f); this->curAction = DH_DEATH; this->timer = 300; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = 0.0f; func_800F5B58(); this->actor.params = ENDH_DEATH; @@ -579,8 +579,7 @@ void EnDh_Draw(Actor* thisx, PlayState* play) { Matrix_Translate(0.0f, -this->actor.shape.yOffset, 0.0f, MTXMODE_APPLY); Matrix_Scale(this->dirtWaveSpread * 0.01f, this->dirtWaveHeight * 0.01f, this->dirtWaveSpread * 0.01f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_dh.c", 1160), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_dh.c", 1160); gSPDisplayList(POLY_XLU_DISP++, object_dh_DL_007FC0); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_dh.c", 1166); diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.h b/src/overlays/actors/ovl_En_Dh/z_en_dh.h index afe0ffddea..21872aafce 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.h +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.h @@ -32,7 +32,7 @@ typedef struct EnDh { /* 0x0320 */ f32 dirtWaveAlpha; } EnDh; // size = 0x0324 -typedef enum { +typedef enum EnDhParams { ENDH_HANDS_KILLED_4 = -4, ENDH_HANDS_KILLED_3, ENDH_HANDS_KILLED_2, diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/src/overlays/actors/ovl_En_Dha/z_en_dha.c index 17ec0b85ef..3d31717cd6 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -5,10 +5,11 @@ */ #include "z_en_dha.h" +#include "versions.h" #include "overlays/actors/ovl_En_Dh/z_en_dh.h" #include "assets/objects/object_dh/object_dh.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) void EnDha_Init(Actor* thisx, PlayState* play); void EnDha_Destroy(Actor* thisx, PlayState* play); @@ -23,7 +24,7 @@ void EnDha_SetupDeath(EnDha* this); void EnDha_Die(EnDha* this, PlayState* play); void EnDha_UpdateHealth(EnDha* this, PlayState* play); -ActorInit En_Dha_InitVars = { +ActorProfile En_Dha_Profile = { /**/ ACTOR_EN_DHA, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -73,7 +74,7 @@ static DamageTable sDamageTable = { static ColliderJntSphElementInit sJntSphElementsInit[] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -84,7 +85,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -95,7 +96,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -106,7 +107,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -117,7 +118,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -130,7 +131,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_1, @@ -143,7 +144,7 @@ static ColliderJntSphInit sJntSphInit = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_DEAD_HANDS_HAND, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_STOP), }; @@ -166,7 +167,7 @@ void EnDha_Init(Actor* thisx, PlayState* play) { this->limbAngleX[0] = -0x4000; Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItem); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnDha_SetupWait(this); } @@ -242,11 +243,20 @@ void EnDha_Wait(EnDha* this, PlayState* play) { this->handAngle.y -= this->actor.shape.rot.y + this->limbAngleY; this->handAngle.x -= this->actor.shape.rot.x + this->limbAngleX[0] + this->limbAngleX[1]; } else { +#if OOT_VERSION < NTSC_1_1 + // Empty +#elif OOT_VERSION < PAL_1_0 + if ((player->stateFlags2 & PLAYER_STATE2_7) && (&this->actor == player->actor.parent)) { + player->stateFlags2 &= ~PLAYER_STATE2_7; + player->actor.parent = NULL; + } +#else if ((player->stateFlags2 & PLAYER_STATE2_7) && (&this->actor == player->actor.parent)) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->av2.actionVar2 = 200; } +#endif if (this->actor.home.rot.z != 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_DEADHAND_HAND_AT); @@ -285,7 +295,9 @@ void EnDha_Wait(EnDha* this, PlayState* play) { if ((player->stateFlags2 & PLAYER_STATE2_7) && (&this->actor == player->actor.parent)) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; +#if OOT_VERSION >= PAL_1_0 player->av2.actionVar2 = 200; +#endif } this->actor.home.rot.z = 1; @@ -306,7 +318,9 @@ void EnDha_TakeDamage(EnDha* this, PlayState* play) { if ((player->stateFlags2 & PLAYER_STATE2_7) && (&this->actor == player->actor.parent)) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; +#if OOT_VERSION >= PAL_1_0 player->av2.actionVar2 = 200; +#endif } Math_SmoothStepToS(&this->limbAngleX[1], 0, 1, 2000, 0); @@ -344,7 +358,9 @@ void EnDha_Die(EnDha* this, PlayState* play) { if ((player->stateFlags2 & PLAYER_STATE2_7) && (&this->actor == player->actor.parent)) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; +#if OOT_VERSION >= PAL_1_0 player->av2.actionVar2 = 200; +#endif } Math_SmoothStepToS(&this->limbAngleX[1], 0, 1, 0x7D0, 0); diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index d0ba252073..9ed06293c0 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -9,7 +9,7 @@ #include "assets/objects/object_zo/object_zo.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) void EnDivingGame_Init(Actor* thisx, PlayState* play); void EnDivingGame_Destroy(Actor* thisx, PlayState* play); @@ -33,7 +33,7 @@ void func_809EEA00(EnDivingGame* this, PlayState* play); void func_809EEA90(EnDivingGame* this, PlayState* play); void func_809EEAF8(EnDivingGame* this, PlayState* play); -ActorInit En_Diving_Game_InitVars = { +ActorProfile En_Diving_Game_Profile = { /**/ ACTOR_EN_DIVING_GAME, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -50,7 +50,7 @@ static u8 D_809EF0B0 = false; static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -58,7 +58,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE | ATELEM_SFX_NORMAL, @@ -93,7 +93,7 @@ void EnDivingGame_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); } else { D_809EF0B0 = true; - this->actor.targetMode = 0; + this->actor.attentionRangeType = ATTENTION_RANGE_0; this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actionFunc = func_809EDCB0; } diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h index 177111b16b..c873e075e3 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h @@ -49,13 +49,13 @@ typedef struct EnDivingGame { /* 0x034C */ ColliderCylinder collider; } EnDivingGame; // size = 0x0398 -typedef enum { +typedef enum EnDivingGamePhase { /* 0 */ ENDIVINGGAME_PHASE_ENDED, /* 1 */ ENDIVINGGAME_PHASE_1, // Player has not received the scale. /* 2 */ ENDIVINGGAME_PHASE_2 // Player got the scale and there are 10 rupees thrown. } EnDivingGamePhase; -typedef enum { +typedef enum EnDivingGameState { /* 0 */ ENDIVINGGAME_STATE_NOTPLAYING, /* 1 */ ENDIVINGGAME_STATE_AWARDPRIZE, // Waiting to give the scale to player. /* 2 */ ENDIVINGGAME_STATE_PLAYING diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 315f6d50cb..3617c2f50e 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -7,7 +7,7 @@ #include "z_en_dns.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnDns_Init(Actor* thisx, PlayState* play); void EnDns_Destroy(Actor* thisx, PlayState* play); @@ -42,7 +42,7 @@ void EnDns_SetupNoSaleBurrow(EnDns* this, PlayState* play); void EnDns_Burrow(EnDns* this, PlayState* play); void EnDns_PostBurrow(EnDns* this, PlayState* play); -ActorInit En_Dns_InitVars = { +ActorProfile En_Dns_Profile = { /**/ ACTOR_EN_DNS, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -56,14 +56,14 @@ ActorInit En_Dns_InitVars = { static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -115,8 +115,8 @@ static DnsItemEntry* sItemEntries[] = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_BUSINESS_SCRUB, ICHAIN_CONTINUE), - ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 30, ICHAIN_STOP), }; static AnimationMinimalInfo sAnimationInfo[] = { @@ -346,10 +346,10 @@ void EnDns_Idle(EnDns* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, play)) { this->actionFunc = EnDns_Talk; } else { - if ((this->collider.base.ocFlags1 & OC1_HIT) || this->actor.isTargeted) { - this->actor.flags |= ACTOR_FLAG_16; + if ((this->collider.base.ocFlags1 & OC1_HIT) || this->actor.isLockedOn) { + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } else { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } if (this->actor.xzDistToPlayer < 130.0f) { Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play); @@ -435,7 +435,7 @@ void EnDns_SetupBurrow(EnDns* this, PlayState* play) { this->dnsItemEntry->payment(this); this->dropCollectible = true; this->isColliderEnabled = false; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnDns_ChangeAnim(this, DNS_ANIM_BURROW); this->actionFunc = EnDns_Burrow; } @@ -443,7 +443,7 @@ void EnDns_SetupBurrow(EnDns* this, PlayState* play) { this->dnsItemEntry->payment(this); this->dropCollectible = true; this->isColliderEnabled = false; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnDns_ChangeAnim(this, DNS_ANIM_BURROW); this->actionFunc = EnDns_Burrow; } @@ -452,7 +452,7 @@ void EnDns_SetupBurrow(EnDns* this, PlayState* play) { void EnDns_SetupNoSaleBurrow(EnDns* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { this->isColliderEnabled = false; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnDns_ChangeAnim(this, DNS_ANIM_BURROW); this->actionFunc = EnDns_Burrow; } diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.h b/src/overlays/actors/ovl_En_Dns/z_en_dns.h index a6ef632230..d86e96eb43 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.h +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.h @@ -7,7 +7,7 @@ #define DNS_GET_TYPE(thisx) ((thisx)->params) -typedef enum { +typedef enum EnDnsType { /* 0 */ DNS_TYPE_DEKU_NUTS_5, /* 1 */ DNS_TYPE_DEKU_STICKS_1, /* 2 */ DNS_TYPE_HEART_PIECE, @@ -21,7 +21,7 @@ typedef enum { /* 10 */ DNS_TYPE_DEKU_NUT_UPGRADE } EnDnsType; -typedef enum { +typedef enum EnDnsCanBuyResult { /* 0 */ DNS_CANBUY_RESULT_NEED_RUPEES, /* 1 */ DNS_CANBUY_RESULT_CAPACITY_FULL, /* 2 */ DNS_CANBUY_RESULT_SUCCESS_NEW_ITEM, @@ -29,7 +29,7 @@ typedef enum { /* 4 */ DNS_CANBUY_RESULT_SUCCESS } EnDnsCanBuyResult; -typedef enum { +typedef enum EnDnsAnimation { /* 0 */ DNS_ANIM_IDLE, /* 1 */ DNS_ANIM_BURROW, /* 2 */ DNS_ANIM_IDLE_TRANSITION @@ -41,7 +41,7 @@ typedef void (*EnDnsActionFunc)(struct EnDns*, PlayState*); typedef u32 (*EnDnsCanBuyFunc)(struct EnDns*); typedef void (*EnDnsPaymentFunc)(struct EnDns*); -typedef struct { +typedef struct DnsItemEntry { /* 0x00 */ s16 itemPrice; /* 0x02 */ u16 itemAmount; /* 0x04 */ s32 getItemId; diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index 87e6673745..6ca6fa8337 100644 --- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -12,7 +12,7 @@ #define FLAGS 0 -typedef enum { +typedef enum EnDntDemoResults { /* 0 */ DNT_LIKE, /* 1 */ DNT_HATE, /* 2 */ DNT_LOVE @@ -26,7 +26,7 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play); void EnDntDemo_Results(EnDntDemo* this, PlayState* play); void EnDntDemo_Prize(EnDntDemo* this, PlayState* play); -ActorInit En_Dnt_Demo_InitVars = { +ActorProfile En_Dnt_Demo_Profile = { /**/ ACTOR_EN_DNT_DEMO, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -98,7 +98,7 @@ void EnDntDemo_Init(Actor* thisx, PlayState* play2) { PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ じじじじじじじじじじい ☆☆☆☆☆ %x\n" VT_RST, this->leader); } this->subCamId = SUB_CAM_ID_DONE; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnDntDemo_Judge; } diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h index 6597530e2e..d17efc5892 100644 --- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h +++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h @@ -25,7 +25,7 @@ typedef struct EnDntDemo { /* 0x01FC */ struct EnDntJiji* leader; } EnDntDemo; // size = 0x0200 -typedef enum { +typedef enum EnDntSignal { /* 0 */ DNT_SIGNAL_NONE, /* 1 */ DNT_SIGNAL_LOOK, /* 2 */ DNT_SIGNAL_CELEBRATE, @@ -35,27 +35,27 @@ typedef enum { /* 6 */ DNT_SIGNAL_UNUSED } EnDntSignal; -typedef enum { +typedef enum EnDntLeaderAction { /* 0 */ DNT_LEADER_ACTION_NONE, /* 1 */ DNT_LEADER_ACTION_UP, /* 2 */ DNT_LEADER_ACTION_UNUSED, /* 3 */ DNT_LEADER_ACTION_ATTACK } EnDntLeaderAction; -typedef enum { +typedef enum EnDntLeaderSignal { /* 0 */ DNT_LEADER_SIGNAL_NONE, /* 1 */ DNT_LEADER_SIGNAL_UP, /* 2 */ DNT_LEADER_SIGNAL_BURROW, /* 3 */ DNT_LEADER_SIGNAL_RETURN } EnDntLeaderSignal; -typedef enum { +typedef enum EnDntPrize { /* 0 */ DNT_PRIZE_NONE, /* 1 */ DNT_PRIZE_NUTS, /* 2 */ DNT_PRIZE_STICK } EnDntPrize; -typedef enum { +typedef enum EnDntAction { /* 0 */ DNT_ACTION_NONE, /* 1 */ DNT_ACTION_DANCE, /* 2 */ DNT_ACTION_ATTACK, diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index eb354cf91b..71942c91aa 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -10,7 +10,7 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) void EnDntJiji_Init(Actor* thisx, PlayState* play); void EnDntJiji_Destroy(Actor* thisx, PlayState* play); @@ -39,7 +39,7 @@ void EnDntJiji_GivePrize(EnDntJiji* this, PlayState* play); void EnDntJiji_Hide(EnDntJiji* this, PlayState* play); void EnDntJiji_Return(EnDntJiji* this, PlayState* play); -ActorInit En_Dnt_Jiji_InitVars = { +ActorProfile En_Dnt_Jiji_Profile = { /**/ ACTOR_EN_DNT_JIJI, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -53,7 +53,7 @@ ActorInit En_Dnt_Jiji_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -61,7 +61,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -82,9 +82,9 @@ void EnDntJiji_Init(Actor* thisx, PlayState* play) { PRINTF("\n\n"); // "Deku Scrub mask show elder" PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ デグナッツお面品評会長老 ☆☆☆☆☆ %x\n" VT_RST, this->stage); - this->actor.flags &= ~ACTOR_FLAG_0; - this->actor.colChkInfo.mass = 0xFF; - this->actor.targetMode = 6; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->actionFunc = EnDntJiji_SetFlower; this->actor.gravity = -2.0f; } @@ -116,7 +116,7 @@ void EnDntJiji_Wait(EnDntJiji* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if ((this->timer == 1) && (this->actor.xzDistToPlayer < 150.0f) && !Play_InCsMode(play) && - !(player->stateFlags1 & PLAYER_STATE1_11)) { + !(player->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR)) { OnePointCutscene_Init(play, 2230, -99, &this->actor, CAM_ID_MAIN); this->timer = 0; Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); @@ -221,7 +221,7 @@ void EnDntJiji_SetupCower(EnDntJiji* this, PlayState* play) { } else { this->getItemId = GI_DEKU_NUT_UPGRADE_40; } - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.textId = 0x10DB; this->unused = 5; this->actionFunc = EnDntJiji_Cower; @@ -302,7 +302,7 @@ void EnDntJiji_GivePrize(EnDntJiji* this, PlayState* play) { this->stage->leaderSignal = DNT_SIGNAL_RETURN; } } - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if (!this->unburrow) { this->actionFunc = EnDntJiji_SetupHide; } else { @@ -441,8 +441,7 @@ void EnDntJiji_Draw(Actor* thisx, PlayState* play) { Matrix_Pop(); Matrix_Translate(this->flowerPos.x, this->flowerPos.y, this->flowerPos.z, MTXMODE_NEW); Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_dnt_jiji.c", 1040), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_dnt_jiji.c", 1040); gSPDisplayList(POLY_OPA_DISP++, gDntJijiFlowerDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_dnt_jiji.c", 1043); } diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index ff9f9cc71a..2863aa1f80 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -12,6 +12,7 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "assets/objects/object_hintnuts/object_hintnuts.h" #include "terminal.h" +#include "versions.h" #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) @@ -39,6 +40,10 @@ void EnDntNomal_TargetGivePrize(EnDntNomal* this, PlayState* play); void EnDntNomal_TargetReturn(EnDntNomal* this, PlayState* play); void EnDntNomal_TargetBurrow(EnDntNomal* this, PlayState* play); +#if OOT_PAL_N64 +void EnDntNomal_DoNothing(EnDntNomal* this, PlayState* play); +#endif + void EnDntNomal_SetupStageWait(EnDntNomal* this, PlayState* play); void EnDntNomal_SetupStageCelebrate(EnDntNomal* this, PlayState* play); void EnDntNomal_SetupStageDance(EnDntNomal* this, PlayState* play); @@ -56,7 +61,7 @@ void EnDntNomal_StageAttackHide(EnDntNomal* this, PlayState* play); void EnDntNomal_StageAttack(EnDntNomal* this, PlayState* play); void EnDntNomal_StageReturn(EnDntNomal* this, PlayState* play); -ActorInit En_Dnt_Nomal_InitVars = { +ActorProfile En_Dnt_Nomal_Profile = { /**/ ACTOR_EN_DNT_NOMAL, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -70,7 +75,7 @@ ActorInit En_Dnt_Nomal_InitVars = { static ColliderCylinderInit sBodyCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -78,7 +83,7 @@ static ColliderCylinderInit sBodyCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -90,7 +95,7 @@ static ColliderCylinderInit sBodyCylinderInit = { static ColliderQuadInit sTargetQuadInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -98,7 +103,7 @@ static ColliderQuadInit sTargetQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, ATELEM_NONE, @@ -122,8 +127,8 @@ void EnDntNomal_Init(Actor* thisx, PlayState* play) { if (this->type < ENDNTNOMAL_TARGET) { this->type = ENDNTNOMAL_TARGET; } - this->actor.flags &= ~ACTOR_FLAG_0; - this->actor.colChkInfo.mass = 0xFF; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->objectId = -1; if (this->type == ENDNTNOMAL_TARGET) { PRINTF("\n\n"); @@ -235,7 +240,12 @@ void EnDntNomal_TargetWait(EnDntNomal* this, PlayState* play) { this->targetVtx[3].z = targetZ - 24.0f; SkelAnime_Update(&this->skelAnime); - if ((this->targetQuad.base.acFlags & AC_HIT) || BREG(0)) { +#if OOT_VERSION < PAL_1_0 + if (this->targetQuad.base.acFlags & AC_HIT) +#else + if ((this->targetQuad.base.acFlags & AC_HIT) || BREG(0)) +#endif + { this->targetQuad.base.acFlags &= ~AC_HIT; dx = fabsf(targetX - this->targetQuad.elem.acDmgInfo.hitPos.x); @@ -411,10 +421,23 @@ void EnDntNomal_TargetBurrow(EnDntNomal* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (frame >= this->endFrame) { +#if !OOT_PAL_N64 this->actionFunc = EnDntNomal_SetupTargetWait; +#else + this->hitCounter = 0; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; + Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos); + this->actionFunc = EnDntNomal_DoNothing; +#endif } } +#if OOT_PAL_N64 +void EnDntNomal_DoNothing(EnDntNomal* this, PlayState* play) { +} +#endif + void EnDntNomal_SetupStageWait(EnDntNomal* this, PlayState* play) { if (this->timer3 == 0) { this->endFrame = (f32)Animation_GetLastFrame(&gDntStageHideAnim); @@ -653,7 +676,7 @@ void EnDntNomal_SetupStageAttack(EnDntNomal* this, PlayState* play) { if (this->timer3 == 0) { this->endFrame = (f32)Animation_GetLastFrame(&gDntStageSpitAnim); Animation_Change(&this->skelAnime, &gDntStageSpitAnim, 1.0f, 0.0f, this->endFrame, ANIMMODE_ONCE, -10.0f); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->isSolid = true; this->timer2 = 0; Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); @@ -869,8 +892,7 @@ void EnDntNomal_DrawStageScrub(Actor* thisx, PlayState* play) { gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, sLeafColors[this->type - ENDNTNOMAL_STAGE].r, sLeafColors[this->type - ENDNTNOMAL_STAGE].g, sLeafColors[this->type - ENDNTNOMAL_STAGE].b, 255); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_dnt_nomal.c", 1814), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_dnt_nomal.c", 1814); gSPDisplayList(POLY_OPA_DISP++, gDntStageFlowerDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_dnt_nomal.c", 1817); if (this->actionFunc == EnDntNomal_StageCelebrate) { @@ -886,8 +908,7 @@ void EnDntNomal_DrawTargetScrub(Actor* thisx, PlayState* play) { SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, EnDntNomal_PostLimbDraw, this); Matrix_Translate(this->flowerPos.x, this->flowerPos.y, this->flowerPos.z, MTXMODE_NEW); Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_dnt_nomal.c", 1848), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_dnt_nomal.c", 1848); gSPDisplayList(POLY_OPA_DISP++, gHintNutsFlowerDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_dnt_nomal.c", 1851); } diff --git a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index f5f5940881..0090a17cd3 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -8,7 +8,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "assets/objects/object_dodojr/object_dodojr.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) void EnDodojr_Init(Actor* thisx, PlayState* play); void EnDodojr_Destroy(Actor* thisx, PlayState* play); @@ -31,7 +31,7 @@ void EnDodojr_DeathSequence(EnDodojr* this, PlayState* play); void EnDodojr_WaitFreezeFrames(EnDodojr* this, PlayState* play); void EnDodojr_EatBomb(EnDodojr* this, PlayState* play); -ActorInit En_Dodojr_InitVars = { +ActorProfile En_Dodojr_Profile = { /**/ ACTOR_EN_DODOJR, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -45,7 +45,7 @@ ActorInit En_Dodojr_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -53,7 +53,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFC5FFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -63,7 +63,7 @@ static ColliderCylinderInit sCylinderInit = { { 18, 20, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInit = { 1, 2, 25, 25, 0xFF }; +static CollisionCheckInfoInit2 sColChkInit = { 1, 2, 25, 25, MASS_IMMOVABLE }; void EnDodojr_Init(Actor* thisx, PlayState* play) { EnDodojr* this = (EnDodojr*)thisx; @@ -76,7 +76,7 @@ void EnDodojr_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(4), &sColChkInit); this->actor.naviEnemyId = NAVI_ENEMY_BABY_DODONGO; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Actor_SetScale(&this->actor, 0.02f); @@ -203,7 +203,7 @@ void EnDodojr_SetupJumpAttackBounce(EnDodojr* this) { void EnDodojr_SetupDespawn(EnDodojr* this) { this->actor.shape.shadowDraw = NULL; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.home.pos = this->actor.world.pos; this->actor.speed = 0.0f; this->actor.gravity = -0.8f; @@ -315,7 +315,7 @@ s32 EnDodojr_IsPlayerWithinAttackRange(EnDodojr* this) { void EnDodojr_SetupStandardDeathBounce(EnDodojr* this) { Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_M_DEAD); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnDodojr_SetupFlipBounce(this); this->actionFunc = EnDodojr_StandardDeathBounce; } @@ -400,7 +400,7 @@ void EnDodojr_WaitUnderground(EnDodojr* this, PlayState* play) { -10.0f); Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_M_UP); this->actor.world.pos.y -= 60.0f; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.world.rot.x -= 0x4000; this->actor.shape.rot.x = this->actor.world.rot.x; this->dustPos = this->actor.world.pos; @@ -477,7 +477,7 @@ void EnDodojr_EatBomb(EnDodojr* this, PlayState* play) { void EnDodojr_SwallowBomb(EnDodojr* this, PlayState* play) { if (DECR(this->timer) == 0) { EnDodojr_DoSwallowedBombEffects(this); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnDodojr_SetupFlipBounce(this); this->actionFunc = EnDodojr_SwallowedBombDeathBounce; } diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index 6ae9701d53..0a4242d020 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -3,9 +3,9 @@ #include "overlays/actors/ovl_En_Bombf/z_en_bombf.h" #include "assets/objects/object_dodongo/object_dodongo.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) -typedef enum { +typedef enum EnDodongoActionState { DODONGO_SWEEP_TAIL, DODONGO_SWALLOW_BOMB, DODONGO_DEATH, @@ -36,7 +36,7 @@ void EnDodongo_Stunned(EnDodongo* this, PlayState* play); void EnDodongo_Death(EnDodongo* this, PlayState* play); void EnDodongo_SweepTail(EnDodongo* this, PlayState* play); -ActorInit En_Dodongo_InitVars = { +ActorProfile En_Dodongo_Profile = { /**/ ACTOR_EN_DODONGO, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -51,7 +51,7 @@ ActorInit En_Dodongo_InitVars = { static ColliderJntSphElementInit sBodyElementsInit[6] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -62,7 +62,7 @@ static ColliderJntSphElementInit sBodyElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -73,7 +73,7 @@ static ColliderJntSphElementInit sBodyElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -84,7 +84,7 @@ static ColliderJntSphElementInit sBodyElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -95,7 +95,7 @@ static ColliderJntSphElementInit sBodyElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -106,7 +106,7 @@ static ColliderJntSphElementInit sBodyElementsInit[6] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x0D800691, 0x00, 0x00 }, ATELEM_NONE, @@ -119,7 +119,7 @@ static ColliderJntSphElementInit sBodyElementsInit[6] = { static ColliderJntSphInit sBodyJntSphInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -133,7 +133,7 @@ static ColliderJntSphInit sBodyJntSphInit = { static ColliderTrisElementInit sHardElementsInit[3] = { { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0xF24BF96E, 0x00, 0x00 }, ATELEM_NONE, @@ -144,7 +144,7 @@ static ColliderTrisElementInit sHardElementsInit[3] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0xFFCBF96E, 0x00, 0x00 }, ATELEM_NONE, @@ -155,7 +155,7 @@ static ColliderTrisElementInit sHardElementsInit[3] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0xFFCBF96E, 0x00, 0x00 }, ATELEM_NONE, @@ -168,7 +168,7 @@ static ColliderTrisElementInit sHardElementsInit[3] = { static ColliderTrisInit sHardTrisInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, @@ -181,7 +181,7 @@ static ColliderTrisInit sHardTrisInit = { static ColliderQuadInit sAttackQuadInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -189,7 +189,7 @@ static ColliderQuadInit sAttackQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x01, 0x10 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL | ATELEM_UNK7, @@ -301,14 +301,14 @@ void EnDodongo_SpawnBombSmoke(EnDodongo* this, PlayState* play) { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_DODONGO, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 2800, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 2800, ICHAIN_STOP), }; void EnDodongo_Init(Actor* thisx, PlayState* play) { EnDodongo* this = (EnDodongo*)thisx; EffectBlureInit1 blureInit; - this->actor.targetMode = 3; + this->actor.attentionRangeType = ATTENTION_RANGE_3; Actor_ProcessInitChain(&this->actor, sInitChain); this->bombSmokePrimColor.r = this->bombSmokePrimColor.g = this->bombSmokeEnvColor.r = 255; this->bombSmokePrimColor.a = this->bombSmokeEnvColor.a = 200; @@ -563,12 +563,12 @@ void EnDodongo_Walk(EnDodongo* this, PlayState* play) { if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 400.0f) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x1F4, 0); - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; if ((this->actor.xzDistToPlayer < 100.0f) && (yawDiff < 0x1388) && (this->actor.yDistToPlayer < 60.0f)) { EnDodongo_SetupBreatheFire(this); } } else { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if ((Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) > 150.0f) || (this->retreatTimer != 0)) { s16 yawToHome = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); @@ -663,7 +663,7 @@ void EnDodongo_SetupDeath(EnDodongo* this, PlayState* play) { this->timer = 0; Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_DEAD); this->actionState = DODONGO_DEATH; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = 0.0f; EnDodongo_SetupAction(this, EnDodongo_Death); } diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h index f29c644eba..664b175799 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h @@ -39,7 +39,7 @@ typedef struct EnDodongo { /* 0x05A8 */ ColliderJntSphElement sphElements[6]; } EnDodongo; // size = 0x0728 -typedef enum { +typedef enum EnDodongoParam { EN_DODONGO_NORMAL = -1, EN_DODONGO_SMOKE_DEATH } EnDodongoParam; diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c index be4c04dd9e..49b8c83ba3 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -21,7 +21,7 @@ void EnDog_RunAway(EnDog* this, PlayState* play); void EnDog_FaceLink(EnDog* this, PlayState* play); void EnDog_Wait(EnDog* this, PlayState* play); -ActorInit En_Dog_InitVars = { +ActorProfile En_Dog_Profile = { /**/ ACTOR_EN_DOG, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -35,7 +35,7 @@ ActorInit En_Dog_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -43,7 +43,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -55,7 +55,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, 50 }; -typedef enum { +typedef enum EnDogAnimation { /* 0 */ ENDOG_ANIM_0, /* 1 */ ENDOG_ANIM_1, /* 2 */ ENDOG_ANIM_2, @@ -77,7 +77,7 @@ static AnimationInfo sAnimationInfo[] = { { &gDogBow2Anim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -6.0f }, }; -typedef enum { +typedef enum DogBehavior { /* 0x00 */ DOG_WALK, /* 0x01 */ DOG_RUN, /* 0x02 */ DOG_BARK, @@ -190,7 +190,7 @@ s8 EnDog_CanFollow(EnDog* this, PlayState* play) { if (gSaveContext.dogParams != 0) { return 0; } - gSaveContext.dogParams = (this->actor.params & 0x7FFF); + gSaveContext.dogParams = PARAMS_GET_S(this->actor.params, 0, 15); return 1; } @@ -248,12 +248,12 @@ void EnDog_Init(Actor* thisx, PlayState* play) { SkelAnime_InitFlex(play, &this->skelAnime, &gDogSkel, NULL, this->jointTable, this->morphTable, 13); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENDOG_ANIM_0); - if ((this->actor.params & 0x8000) == 0) { - this->actor.params = (this->actor.params & 0xF0FF) | ((((this->actor.params & 0x0F00) >> 8) + 1) << 8); + if (!PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { + this->actor.params = (this->actor.params & ~(0xF << 8)) | ((PARAMS_GET_S(this->actor.params, 8, 4) + 1) << 8); } followingDog = ((gSaveContext.dogParams & 0x0F00) >> 8); - if (followingDog == ((this->actor.params & 0x0F00) >> 8) && ((this->actor.params & 0x8000) == 0)) { + if (followingDog == PARAMS_GET_S(this->actor.params, 8, 4) && !PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { Actor_Kill(&this->actor); return; } @@ -264,16 +264,16 @@ void EnDog_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.0075f); this->waypoint = 0; this->actor.gravity = -1.0f; - this->path = Path_GetByIndex(play, (this->actor.params & 0x00F0) >> 4, 0xF); + this->path = Path_GetByIndex(play, PARAMS_GET_S(this->actor.params, 4, 4), 0xF); switch (play->sceneId) { case SCENE_MARKET_NIGHT: - if ((!gSaveContext.dogIsLost) && (((this->actor.params & 0x0F00) >> 8) == 1)) { + if ((!gSaveContext.dogIsLost) && PARAMS_GET_S(this->actor.params, 8, 4) == 1) { Actor_Kill(&this->actor); } break; case SCENE_DOG_LADY_HOUSE: // Richard's Home - if (!(this->actor.params & 0x8000)) { + if (!PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { if (!gSaveContext.dogIsLost) { this->nextBehavior = DOG_SIT; this->actionFunc = EnDog_Wait; @@ -287,7 +287,7 @@ void EnDog_Init(Actor* thisx, PlayState* play) { break; } - if (this->actor.params & 0x8000) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { this->nextBehavior = DOG_WALK; this->actionFunc = EnDog_FollowPlayer; } else { @@ -477,8 +477,9 @@ void EnDog_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gDPPipeSync(POLY_OPA_DISP++); - gDPSetEnvColor(POLY_OPA_DISP++, colors[this->actor.params & 0xF].r, colors[this->actor.params & 0xF].g, - colors[this->actor.params & 0xF].b, colors[this->actor.params & 0xF].a); + gDPSetEnvColor(POLY_OPA_DISP++, colors[PARAMS_GET_S(this->actor.params, 0, 4)].r, + colors[PARAMS_GET_S(this->actor.params, 0, 4)].g, colors[PARAMS_GET_S(this->actor.params, 0, 4)].b, + colors[PARAMS_GET_S(this->actor.params, 0, 4)].a); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnDog_OverrideLimbDraw, EnDog_PostLimbDraw, this); diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index 7a087c0b91..301b804966 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -5,6 +5,7 @@ */ #include "z_en_door.h" +#include "global.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" @@ -32,7 +33,7 @@ void EnDoor_AjarOpen(EnDoor* this, PlayState* play); void EnDoor_AjarClose(EnDoor* this, PlayState* play); void EnDoor_Open(EnDoor* this, PlayState* play); -ActorInit En_Door_InitVars = { +ActorProfile En_Door_Profile = { /**/ ACTOR_EN_DOOR, /**/ ACTORCAT_DOOR, /**/ FLAGS, @@ -44,13 +45,13 @@ ActorInit En_Door_InitVars = { /**/ EnDoor_Draw, }; -typedef struct { +typedef struct EnDoorInfo { /* 0x00 */ s16 sceneId; /* 0x02 */ u8 dListIndex; /* 0x04 */ s16 objectId; } EnDoorInfo; -typedef enum { +typedef enum EnDoorDListIndex { /* 0 */ DOOR_DL_DEFAULT, /* 1 */ DOOR_DL_FIRE_TEMPLE, /* 2 */ DOOR_DL_WATER_TEMPLE, @@ -73,7 +74,7 @@ static EnDoorInfo sDoorInfo[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 0, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_0, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_STOP), }; @@ -144,7 +145,7 @@ void EnDoor_Init(Actor* thisx, PlayState* play2) { } // Double doors - if (ENDOOR_IS_DOUBLE_DOOR(&this->actor)) { + if (ENDOOR_GET_IS_DOUBLE_DOOR(&this->actor)) { EnDoor* other; xOffset = Math_CosS(this->actor.shape.rot.y) * 30.0f; @@ -152,7 +153,7 @@ void EnDoor_Init(Actor* thisx, PlayState* play2) { other = (EnDoor*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_DOOR, this->actor.world.pos.x + xOffset, this->actor.world.pos.y, this->actor.world.pos.z - zOffset, 0, this->actor.shape.rot.y + 0x8000, 0, - this->actor.params & ~ENDOOR_PARAMS_DOUBLE_DOOR_FLAG); + this->actor.params & ~ENDOOR_PARAMS_IS_DOUBLE_DOOR_MASK); if (other != NULL) { other->unk_192 = 1; } @@ -166,7 +167,7 @@ void EnDoor_Destroy(Actor* thisx, PlayState* play) { TransitionActorEntry* transitionEntry; EnDoor* this = (EnDoor*)thisx; - transitionEntry = &play->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(&this->actor)]; + transitionEntry = &play->transitionActors.list[GET_TRANSITION_ACTOR_INDEX(&this->actor)]; if (transitionEntry->id < 0) { transitionEntry->id = -transitionEntry->id; } @@ -206,7 +207,7 @@ void EnDoor_SetupType(EnDoor* this, PlayState* play) { doorType = DOOR_SCENEEXIT; } else { this->actionFunc = EnDoor_WaitForCheck; - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_27; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_LOCK_ON_DISABLED; } } // Replace the door type it was loaded with by the new type @@ -220,7 +221,7 @@ void EnDoor_Idle(EnDoor* this, PlayState* play) { Vec3f playerPosRelToDoor; doorType = ENDOOR_GET_TYPE(&this->actor); - func_8002DBD0(&this->actor, &playerPosRelToDoor, &player->actor.world.pos); + Actor_WorldToActorCoords(&this->actor, &playerPosRelToDoor, &player->actor.world.pos); if (this->playerIsOpening) { this->actionFunc = EnDoor_Open; Animation_PlayOnceSetSpeed(&this->skelAnime, sDoorAnims[this->openAnim], @@ -334,12 +335,16 @@ s32 EnDoor_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* TransitionActorEntry* transitionEntry; Gfx** doorDLists = sDoorDLists[this->dListIndex]; - transitionEntry = &play->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(&this->actor)]; + transitionEntry = &play->transitionActors.list[GET_TRANSITION_ACTOR_INDEX(&this->actor)]; rot->z += this->actor.world.rot.y; if ((play->roomCtx.prevRoom.num >= 0) || (transitionEntry->sides[0].room == transitionEntry->sides[1].room)) { // Draw the side of the door that is visible to the camera +#if OOT_VERSION < NTSC_1_1 + s16 rotDiff = this->actor.shape.rot.y + rot->z - Math_Vec3f_Yaw(&play->view.eye, &this->actor.world.pos); +#else s16 rotDiff = this->actor.shape.rot.y + this->skelAnime.jointTable[3].z + rot->z - Math_Vec3f_Yaw(&play->view.eye, &this->actor.world.pos); +#endif *dList = (ABS(rotDiff) < 0x4000) ? doorDLists[0] : doorDLists[1]; } else { diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.h b/src/overlays/actors/ovl_En_Door/z_en_door.h index 58ff784ee5..4b4f95c466 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.h +++ b/src/overlays/actors/ovl_En_Door/z_en_door.h @@ -2,7 +2,7 @@ #define Z_EN_DOOR_H #include "ultra64.h" -#include "global.h" +#include "z64actor.h" /** * Actor Parameters @@ -22,16 +22,18 @@ * */ -#define ENDOOR_PARAMS_TYPE_SHIFT 7 -#define ENDOOR_PARAMS_TYPE_MASK (7 << ENDOOR_PARAMS_TYPE_SHIFT) -#define ENDOOR_GET_TYPE(thisx) ((thisx)->params >> ENDOOR_PARAMS_TYPE_SHIFT & 7) -#define ENDOOR_PARAMS_DOUBLE_DOOR_FLAG 0x40 -#define ENDOOR_IS_DOUBLE_DOOR(thisx) ((thisx)->params & ENDOOR_PARAMS_DOUBLE_DOOR_FLAG) -#define ENDOOR_GET_LOCKED_SWITCH_FLAG(thisx) ((thisx)->params & 0x3F) -#define ENDOOR_GET_CHECKABLE_TEXT_ID(thisx) ((thisx)->params & 0x3F) +#define ENDOOR_PARAMS_TYPE_SHIFT 7 +#define ENDOOR_PARAMS_TYPE_MASK PARAMS_MAKE_MASK(7, 3) +#define ENDOOR_GET_TYPE(thisx) PARAMS_GET_U((thisx)->params, 7, 3) +#define ENDOOR_PARAMS_IS_DOUBLE_DOOR_MASK PARAMS_MAKE_MASK(6, 1) +#define ENDOOR_GET_IS_DOUBLE_DOOR(thisx) PARAMS_GET_NOSHIFT((thisx)->params, 6, 1) -typedef enum { +#define ENDOOR_GET_LOCKED_SWITCH_FLAG(thisx) PARAMS_GET_U((thisx)->params, 0, 6) + +#define ENDOOR_GET_CHECKABLE_TEXT_ID(thisx) PARAMS_GET_U((thisx)->params, 0, 6) + +typedef enum EnDoorType { /* 0x00 */ DOOR_ROOMLOAD, // loads rooms /* 0x01 */ DOOR_LOCKED, // small key locked door /* 0x02 */ DOOR_ROOMLOAD2, // loads rooms @@ -44,7 +46,7 @@ typedef enum { struct EnDoor; -typedef void (*EnDoorActionFunc)(struct EnDoor*, PlayState*); +typedef void (*EnDoorActionFunc)(struct EnDoor*, struct PlayState*); typedef struct EnDoor { /* 0x0000 */ DOOR_ACTOR_BASE; diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 3d8e0e57ce..b3899ae0b8 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -7,7 +7,7 @@ #include "z_en_ds.h" #include "assets/objects/object_ds/object_ds.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnDs_Init(Actor* thisx, PlayState* play); void EnDs_Destroy(Actor* thisx, PlayState* play); @@ -16,7 +16,7 @@ void EnDs_Draw(Actor* thisx, PlayState* play); void EnDs_Wait(EnDs* this, PlayState* play); -ActorInit En_Ds_InitVars = { +ActorProfile En_Ds_Profile = { /**/ ACTOR_EN_DS, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -41,9 +41,9 @@ void EnDs_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.013f); this->actionFunc = EnDs_Wait; - this->actor.targetMode = 1; + this->actor.attentionRangeType = ATTENTION_RANGE_1; this->unk_1E8 = 0; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->unk_1E4 = 0.0f; } @@ -53,7 +53,7 @@ void EnDs_Destroy(Actor* thisx, PlayState* play) { void EnDs_Talk(EnDs* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { this->actionFunc = EnDs_Wait; - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } this->unk_1E8 |= 1; } @@ -70,7 +70,7 @@ void EnDs_TalkAfterGiveOddPotion(EnDs* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, play)) { this->actionFunc = EnDs_Talk; } else { - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Actor_OfferTalk(&this->actor, play, 1000.0f); } } @@ -188,7 +188,7 @@ void EnDs_OfferBluePotion(EnDs* this, PlayState* play) { return; case 2: // have 100 rupees and empty bottle Rupees_ChangeBy(-100); - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Actor_OfferGetItem(&this->actor, play, GI_BOTTLE_POTION_BLUE, 10000.0f, 50.0f); this->actionFunc = EnDs_GiveBluePotion; return; diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.c b/src/overlays/actors/ovl_En_Du/z_en_du.c index 65f4b90bf6..c8e747e31e 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -2,7 +2,7 @@ #include "assets/objects/object_du/object_du.h" #include "assets/scenes/overworld/spot18/spot18_scene.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_25) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_25) void EnDu_Init(Actor* thisx, PlayState* play); void EnDu_Destroy(Actor* thisx, PlayState* play); @@ -22,7 +22,7 @@ void func_809FEC70(EnDu* this, PlayState* play); void func_809FECE4(EnDu* this, PlayState* play); void func_809FEB08(EnDu* this, PlayState* play); -ActorInit En_Du_InitVars = { +ActorProfile En_Du_Profile = { /**/ ACTOR_EN_DU, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -36,7 +36,7 @@ ActorInit En_Du_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -44,7 +44,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -56,7 +56,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -typedef enum { +typedef enum EnDuAnimation { /* 0 */ ENDU_ANIM_0, /* 1 */ ENDU_ANIM_1, /* 2 */ ENDU_ANIM_2, @@ -289,7 +289,7 @@ void EnDu_Init(Actor* thisx, PlayState* play) { } Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENDU_ANIM_0); Actor_SetScale(&this->actor, 0.01f); - this->actor.targetMode = 1; + this->actor.attentionRangeType = ATTENTION_RANGE_1; this->interactInfo.talkState = NPC_TALK_STATE_IDLE; if (gSaveContext.save.cutsceneIndex >= 0xFFF0) { diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index 0f9fb333e9..784e28e072 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -18,7 +18,7 @@ void EnDyExtra_Draw(Actor* thisx, PlayState* play); void EnDyExtra_WaitForTrigger(EnDyExtra* this, PlayState* play); void EnDyExtra_FallAndKill(EnDyExtra* this, PlayState* play); -ActorInit En_Dy_Extra_InitVars = { +ActorProfile En_Dy_Extra_Profile = { /**/ ACTOR_EN_DY_EXTRA, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -116,8 +116,7 @@ void EnDyExtra_Draw(Actor* thisx, PlayState* play) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 2, 0, 0x20, 0x40, 1, play->state.frames, play->state.frames * -8, 0x10, 0x10)); gDPPipeSync(POLY_XLU_DISP++); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_dy_extra.c", 307), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_dy_extra.c", 307); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, primColors[this->type].r, primColors[this->type].g, primColors[this->type].b, 255); gDPSetEnvColor(POLY_XLU_DISP++, envColors[this->type].r, envColors[this->type].g, envColors[this->type].b, 128); diff --git a/src/overlays/actors/ovl_En_Eg/z_en_eg.c b/src/overlays/actors/ovl_En_Eg/z_en_eg.c index 252eb3c001..20751b94bf 100644 --- a/src/overlays/actors/ovl_En_Eg/z_en_eg.c +++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.c @@ -22,7 +22,7 @@ static EnEgActionFunc sActionFuncs[] = { func_809FFDC8, }; -ActorInit En_Eg_InitVars = { +ActorProfile En_Eg_Profile = { /**/ ACTOR_EN_EG, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index ebfa1c6e11..63e509986b 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -1,7 +1,7 @@ #include "z_en_eiyer.h" #include "assets/objects/object_ei/object_ei.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) void EnEiyer_Init(Actor* thisx, PlayState* play); void EnEiyer_Destroy(Actor* thisx, PlayState* play); @@ -35,7 +35,7 @@ void EnEiyer_Die(EnEiyer* this, PlayState* play); void EnEiyer_Dead(EnEiyer* this, PlayState* play); void EnEiyer_Stunned(EnEiyer* this, PlayState* play); -ActorInit En_Eiyer_InitVars = { +ActorProfile En_Eiyer_Profile = { /**/ ACTOR_EN_EIYER, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -49,7 +49,7 @@ ActorInit En_Eiyer_InitVars = { static ColliderCylinderInit sColCylInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -57,7 +57,7 @@ static ColliderCylinderInit sColCylInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x04, 0x08 }, { 0x00000019, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_HARD, @@ -107,7 +107,7 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_STINGER, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 5, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 2500, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 2500, ICHAIN_STOP), }; /** @@ -200,7 +200,7 @@ void EnEiyer_SetupAppearFromGround(EnEiyer* this) { this->collider.base.atFlags &= ~AT_ON; this->collider.base.acFlags &= ~AC_ON; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_IGNORE_QUAKE); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_IGNORE_QUAKE); this->actor.shape.shadowScale = 0.0f; this->actor.shape.yOffset = 0.0f; this->actionFunc = EnEiyer_AppearFromGround; @@ -216,11 +216,11 @@ void EnEiyer_SetupUnderground(EnEiyer* this) { this->collider.base.acFlags |= AC_ON; this->actor.flags &= ~ACTOR_FLAG_4; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } void EnEiyer_SetupInactive(EnEiyer* this) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnEiyer_Inactive; } @@ -445,7 +445,7 @@ void EnEiyer_Glide(EnEiyer* this, PlayState* play) { EnEiyer_SetupStartAttack(this); } - func_8002F974(&this->actor, NA_SE_EN_EIER_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_EIER_FLY - SFX_FLAG); } void EnEiyer_StartAttack(EnEiyer* this, PlayState* play) { @@ -469,7 +469,7 @@ void EnEiyer_StartAttack(EnEiyer* this, PlayState* play) { this->actor.world.rot.x = -this->actor.shape.rot.x; Math_StepToF(&this->actor.speed, 5.0f, 0.3f); Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 2, 0x71C); - func_8002F974(&this->actor, NA_SE_EN_EIER_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_EIER_FLY - SFX_FLAG); } void EnEiyer_DiveAttack(EnEiyer* this, PlayState* play) { @@ -484,7 +484,7 @@ void EnEiyer_DiveAttack(EnEiyer* this, PlayState* play) { this->collider.base.atFlags &= ~(AT_ON | AT_HIT); } - func_8002F974(&this->actor, NA_SE_EN_EIER_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_EIER_FLY - SFX_FLAG); } void EnEiyer_Land(EnEiyer* this, PlayState* play) { @@ -608,7 +608,7 @@ void EnEiyer_UpdateDamage(EnEiyer* this, PlayState* play) { if (Actor_ApplyDamage(&this->actor) == 0) { Enemy_StartFinishingBlow(play, &this->actor); Actor_PlaySfx(&this->actor, NA_SE_EN_EIER_DEAD); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } // If underground, one hit kill @@ -672,7 +672,7 @@ void EnEiyer_Update(Actor* thisx, PlayState* play) { } } - if (this->actor.flags & ACTOR_FLAG_0) { + if (this->actor.flags & ACTOR_FLAG_ATTENTION_ENABLED) { this->actor.focus.pos.x = this->actor.world.pos.x + Math_SinS(this->actor.shape.rot.y) * 12.5f; this->actor.focus.pos.z = this->actor.world.pos.z + Math_CosS(this->actor.shape.rot.y) * 12.5f; this->actor.focus.pos.y = this->actor.world.pos.y; diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 70f9ccd120..6ce5d545bf 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -5,6 +5,7 @@ */ #include "z_en_elf.h" +#include "global.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25) @@ -54,7 +55,7 @@ void func_80A0461C(EnElf* this, PlayState* play); void EnElf_SpawnSparkles(EnElf* this, PlayState* play, s32 sparkleLife); void EnElf_GetCuePos(Vec3f* dest, PlayState* play, s32 cueChannel); -ActorInit En_Elf_InitVars = { +ActorProfile En_Elf_Profile = { /**/ ACTOR_EN_ELF, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -80,7 +81,7 @@ static Color_RGBAf sOuterColors[] = { { 255.0f, 50.0f, 100.0f, 255.0f }, }; -typedef struct { +typedef struct FairyColorFlags { u8 r, g, b; } FairyColorFlags; @@ -838,7 +839,7 @@ void func_80A03CF8(EnElf* this, PlayState* play) { Vec3f nextPos; Vec3f prevPos; Player* player = GET_PLAYER(play); - Actor* arrowPointedActor; + Actor* naviHoverActor; f32 xScale; f32 distFromPlayerHat; @@ -935,11 +936,11 @@ void func_80A03CF8(EnElf* this, PlayState* play) { break; default: func_80A029A8(this, 1); - nextPos = play->actorCtx.targetCtx.naviRefPos; + nextPos = play->actorCtx.attention.naviHoverPos; nextPos.y += (1500.0f * this->actor.scale.y); - arrowPointedActor = play->actorCtx.targetCtx.arrowPointedActor; + naviHoverActor = play->actorCtx.attention.naviHoverActor; - if (arrowPointedActor != NULL) { + if (naviHoverActor != NULL) { func_80A03148(this, &nextPos, 0.0f, 20.0f, 0.2f); if (this->actor.speed >= 5.0f) { @@ -1000,12 +1001,12 @@ void EnElf_ChangeColor(Color_RGBAf* dest, Color_RGBAf* newColor, Color_RGBAf* cu } void func_80A04414(EnElf* this, PlayState* play) { - Actor* arrowPointedActor = play->actorCtx.targetCtx.arrowPointedActor; + Actor* naviHoverActor = play->actorCtx.attention.naviHoverActor; Player* player = GET_PLAYER(play); f32 transitionRate; u16 sfxId; - if (play->actorCtx.targetCtx.unk_40 != 0.0f) { + if (play->actorCtx.attention.naviMoveProgressFactor != 0.0f) { this->unk_2C6 = 0; this->unk_29C = 1.0f; @@ -1015,34 +1016,34 @@ void func_80A04414(EnElf* this, PlayState* play) { } else { if (this->unk_2C6 == 0) { - if ((arrowPointedActor == NULL) || - (Math_Vec3f_DistXYZ(&this->actor.world.pos, &play->actorCtx.targetCtx.naviRefPos) < 50.0f)) { + if ((naviHoverActor == NULL) || + (Math_Vec3f_DistXYZ(&this->actor.world.pos, &play->actorCtx.attention.naviHoverPos) < 50.0f)) { this->unk_2C6 = 1; } } else if (this->unk_29C != 0.0f) { if (Math_StepToF(&this->unk_29C, 0.0f, 0.25f) != 0) { - this->innerColor = play->actorCtx.targetCtx.naviInner; - this->outerColor = play->actorCtx.targetCtx.naviOuter; + this->innerColor = play->actorCtx.attention.naviInnerColor; + this->outerColor = play->actorCtx.attention.naviOuterColor; } else { transitionRate = 0.25f / this->unk_29C; - EnElf_ChangeColor(&this->innerColor, &play->actorCtx.targetCtx.naviInner, &this->innerColor, + EnElf_ChangeColor(&this->innerColor, &play->actorCtx.attention.naviInnerColor, &this->innerColor, transitionRate); - EnElf_ChangeColor(&this->outerColor, &play->actorCtx.targetCtx.naviOuter, &this->outerColor, + EnElf_ChangeColor(&this->outerColor, &play->actorCtx.attention.naviOuterColor, &this->outerColor, transitionRate); } } } if (this->fairyFlags & 1) { - if ((arrowPointedActor == NULL) || (player->unk_664 == NULL)) { + if ((naviHoverActor == NULL) || (player->focusActor == NULL)) { this->fairyFlags ^= 1; } } else { - if ((arrowPointedActor != NULL) && (player->unk_664 != NULL)) { - if (arrowPointedActor->category == ACTORCAT_NPC) { + if ((naviHoverActor != NULL) && (player->focusActor != NULL)) { + if (naviHoverActor->category == ACTORCAT_NPC) { sfxId = NA_SE_VO_NAVY_HELLO; } else { - sfxId = (arrowPointedActor->category == ACTORCAT_ENEMY) ? NA_SE_VO_NAVY_ENEMY : NA_SE_VO_NAVY_HEAR; + sfxId = (naviHoverActor->category == ACTORCAT_ENEMY) ? NA_SE_VO_NAVY_ENEMY : NA_SE_VO_NAVY_HEAR; } if (this->unk_2C7 == 0) { @@ -1056,7 +1057,7 @@ void func_80A04414(EnElf* this, PlayState* play) { void func_80A0461C(EnElf* this, PlayState* play) { s32 temp; - Actor* arrowPointedActor; + Actor* naviHoverActor; Player* player = GET_PLAYER(play); if (play->csCtx.state != CS_STATE_IDLE) { @@ -1081,7 +1082,7 @@ void func_80A0461C(EnElf* this, PlayState* play) { } } else { - arrowPointedActor = play->actorCtx.targetCtx.arrowPointedActor; + naviHoverActor = play->actorCtx.attention.naviHoverActor; // `R_SCENE_CAM_TYPE` is not a bit field, but this conditional checks for a specific bit. // This `& 0x10` check will pass for either `SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT`, `SCENE_CAM_TYPE_FIXED`, or @@ -1092,10 +1093,10 @@ void func_80A0461C(EnElf* this, PlayState* play) { ((R_SCENE_CAM_TYPE & 0x10) && Play_CheckViewpoint(play, VIEWPOINT_PIVOT))) { temp = 12; this->unk_2C0 = 100; - } else if (arrowPointedActor == NULL || arrowPointedActor->category == ACTORCAT_NPC) { - if (arrowPointedActor != NULL) { + } else if (naviHoverActor == NULL || naviHoverActor->category == ACTORCAT_NPC) { + if (naviHoverActor != NULL) { this->unk_2C0 = 100; - player->stateFlags2 |= PLAYER_STATE2_20; + player->stateFlags2 |= PLAYER_STATE2_NAVI_ACTIVE; temp = 0; } else { switch (this->unk_2A8) { @@ -1116,7 +1117,7 @@ void func_80A0461C(EnElf* this, PlayState* play) { this->unk_2AE--; temp = 7; } else { - player->stateFlags2 |= PLAYER_STATE2_20; + player->stateFlags2 |= PLAYER_STATE2_NAVI_ACTIVE; temp = 0; } } else { @@ -1146,7 +1147,7 @@ void func_80A0461C(EnElf* this, PlayState* play) { switch (temp) { case 0: - if (!(player->stateFlags2 & PLAYER_STATE2_20)) { + if (!(player->stateFlags2 & PLAYER_STATE2_NAVI_ACTIVE)) { temp = 7; if (this->unk_2C7 == 0) { Actor_PlaySfx(&this->actor, NA_SE_EV_NAVY_VANISH); @@ -1154,7 +1155,7 @@ void func_80A0461C(EnElf* this, PlayState* play) { } break; case 8: - if (player->stateFlags2 & PLAYER_STATE2_20) { + if (player->stateFlags2 & PLAYER_STATE2_NAVI_ACTIVE) { func_80A0299C(this, 0x32); this->unk_2C0 = 42; temp = 11; @@ -1164,10 +1165,10 @@ void func_80A0461C(EnElf* this, PlayState* play) { } break; case 7: - player->stateFlags2 &= ~PLAYER_STATE2_20; + player->stateFlags2 &= ~PLAYER_STATE2_NAVI_ACTIVE; break; default: - player->stateFlags2 |= PLAYER_STATE2_20; + player->stateFlags2 |= PLAYER_STATE2_NAVI_ACTIVE; break; } } @@ -1219,20 +1220,19 @@ void func_80A04D90(EnElf* this, PlayState* play) { void func_80A04DE4(EnElf* this, PlayState* play) { Vec3f headCopy; Player* player = GET_PLAYER(play); - Vec3f naviRefPos; + Vec3f pos; if (this->fairyFlags & 0x10) { - naviRefPos = play->actorCtx.targetCtx.naviRefPos; - - if ((player->unk_664 == NULL) || (&player->actor == player->unk_664) || (&this->actor == player->unk_664)) { - naviRefPos.x = - player->bodyPartsPos[PLAYER_BODYPART_HEAD].x + (Math_SinS(player->actor.shape.rot.y) * 20.0f); - naviRefPos.y = player->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 5.0f; - naviRefPos.z = - player->bodyPartsPos[PLAYER_BODYPART_HEAD].z + (Math_CosS(player->actor.shape.rot.y) * 20.0f); + pos = play->actorCtx.attention.naviHoverPos; + + if ((player->focusActor == NULL) || (&player->actor == player->focusActor) || + (&this->actor == player->focusActor)) { + pos.x = player->bodyPartsPos[PLAYER_BODYPART_HEAD].x + (Math_SinS(player->actor.shape.rot.y) * 20.0f); + pos.y = player->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 5.0f; + pos.z = player->bodyPartsPos[PLAYER_BODYPART_HEAD].z + (Math_CosS(player->actor.shape.rot.y) * 20.0f); } - this->actor.focus.pos = naviRefPos; + this->actor.focus.pos = pos; this->fairyFlags &= ~0x10; } @@ -1378,7 +1378,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) { EnElf* this = (EnElf*)thisx; if (player->naviTextId == 0) { - if (player->unk_664 == NULL) { + if (player->focusActor == NULL) { #if IS_DEBUG if (((gSaveContext.save.info.playerData.naviTimer >= 600) && (gSaveContext.save.info.playerData.naviTimer <= 3000)) || @@ -1397,7 +1397,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) { } } else if (player->naviTextId < 0) { // trigger dialog instantly for negative message IDs - thisx->flags |= ACTOR_FLAG_16; + thisx->flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } if (Actor_TalkOfferAccepted(thisx, play)) { @@ -1418,7 +1418,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) { this->elfMsg->actor.flags |= ACTOR_FLAG_TALK; } - thisx->flags &= ~ACTOR_FLAG_16; + thisx->flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } else { this->actionFunc(this, play); thisx->shape.rot.y = this->unk_2BC; diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.h b/src/overlays/actors/ovl_En_Elf/z_en_elf.h index cc2bfd3961..2190065f71 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.h +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.h @@ -2,13 +2,14 @@ #define Z_EN_ELF_H #include "ultra64.h" -#include "global.h" +#include "z64actor.h" +#include "z64light.h" #include "overlays/actors/ovl_Elf_Msg/z_elf_msg.h" struct EnElf; -typedef void (*EnElfActionFunc)(struct EnElf*, PlayState*); -typedef void (*EnElfUnkFunc)(struct EnElf*, PlayState*); +typedef void (*EnElfActionFunc)(struct EnElf*, struct PlayState*); +typedef void (*EnElfUnkFunc)(struct EnElf*, struct PlayState*); typedef struct EnElf { /* 0x0000 */ Actor actor; @@ -44,7 +45,7 @@ typedef struct EnElf { /* 0x02CC */ EnElfActionFunc actionFunc; } EnElf; // size = 0x02D0 -typedef enum { +typedef enum FairyType { /* 0x00 */ FAIRY_NAVI, /* 0x01 */ FAIRY_REVIVE_BOTTLE, /* 0x02 */ FAIRY_HEAL_TIMED, diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index 8e1029ba2f..dbc75012ac 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -2,7 +2,7 @@ #include "terminal.h" #include "overlays/actors/ovl_En_Tite/z_en_tite.h" -#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_27) +#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_LOCK_ON_DISABLED) void EnEncount1_Init(Actor* thisx, PlayState* play); void EnEncount1_Update(Actor* thisx, PlayState* play); @@ -14,7 +14,7 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, PlayState* play); static s16 sLeeverAngles[] = { 0x0000, 0x2710, 0x7148, 0x8EB8, 0xD8F0 }; static f32 sLeeverDists[] = { 200.0f, 170.0f, 120.0f, 120.0f, 170.0f }; -ActorInit En_Encount1_InitVars = { +ActorProfile En_Encount1_Profile = { /**/ ACTOR_EN_ENCOUNT1, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -33,20 +33,19 @@ void EnEncount1_Init(Actor* thisx, PlayState* play) { if (this->actor.params <= 0) { PRINTF("\n\n"); - // "Input error death!" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 入力エラーデッス! ☆☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 入力エラーデッス! ☆☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 入力エラーデッス! ☆☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 入力エラーデッス! ☆☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 入力エラーデッス! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 入力エラーデッス! ☆☆☆☆☆ \n", "☆☆☆☆☆ Input error death! ☆☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 入力エラーデッス! ☆☆☆☆☆ \n", "☆☆☆☆☆ Input error death! ☆☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 入力エラーデッス! ☆☆☆☆☆ \n", "☆☆☆☆☆ Input error death! ☆☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 入力エラーデッス! ☆☆☆☆☆ \n", "☆☆☆☆☆ Input error death! ☆☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 入力エラーデッス! ☆☆☆☆☆ \n", "☆☆☆☆☆ Input error death! ☆☆☆☆☆ \n") VT_RST); PRINTF("\n\n"); Actor_Kill(&this->actor); return; } - this->spawnType = (this->actor.params >> 0xB) & 0x1F; - this->maxCurSpawns = (this->actor.params >> 6) & 0x1F; - this->maxTotalSpawns = this->actor.params & 0x3F; + this->spawnType = PARAMS_GET_U(this->actor.params, 11, 5); + this->maxCurSpawns = PARAMS_GET_U(this->actor.params, 6, 5); + this->maxTotalSpawns = PARAMS_GET_U(this->actor.params, 0, 6); this->curNumSpawn = this->totalNumSpawn = 0; spawnRange = 120.0f + (40.0f * this->actor.world.rot.z); this->spawnRange = spawnRange; @@ -54,19 +53,20 @@ void EnEncount1_Init(Actor* thisx, PlayState* play) { if (1) {} PRINTF("\n\n"); - // "It's an enemy spawner!" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 敵発生ゾーンでた! ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); - // "Type" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 種類\t\t ☆☆☆☆☆ %d\n" VT_RST, this->spawnType); - // "Maximum number of simultaneous spawns" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 最大同時発生数 ☆☆☆☆☆ %d\n" VT_RST, this->maxCurSpawns); - // "Maximum number of spawns" - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 最大発生数 \t ☆☆☆☆☆ %d\n" VT_RST, this->maxTotalSpawns); - // "Spawn check range" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生チェック範囲 ☆☆☆☆☆ %f\n" VT_RST, this->spawnRange); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 敵発生ゾーンでた! ☆☆☆☆☆ %x\n", "☆☆☆☆☆ It's an enemy spawner! ☆☆☆☆☆ %x\n") VT_RST, + this->actor.params); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 種類\t\t ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Type\t\t ☆☆☆☆☆ %d\n") VT_RST, this->spawnType); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 最大同時発生数 ☆☆☆☆☆ %d\n", + "☆☆☆☆☆ Maximum number of simultaneous spawns ☆☆☆☆☆ %d\n") VT_RST, + this->maxCurSpawns); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ 最大発生数 \t ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Maximum number of spawns \t ☆☆☆☆☆ %d\n") + VT_RST, + this->maxTotalSpawns); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生チェック範囲 ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Spawn check range ☆☆☆☆☆ %f\n") VT_RST, + this->spawnRange); PRINTF("\n\n"); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; switch (this->spawnType) { case SPAWNER_LEEVER: this->timer = 30; @@ -168,10 +168,9 @@ void EnEncount1_SpawnLeevers(EnEncount1* this, PlayState* play) { this->maxCurSpawns = (s16)Rand_ZeroFloat(2.99f) + 1; } } else { - // "Cannot spawn!" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n" VT_RST); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n" VT_RST); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n", "☆☆☆☆☆ Cannot spawn! ☆☆☆☆☆\n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n", "☆☆☆☆☆ Cannot spawn! ☆☆☆☆☆\n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n", "☆☆☆☆☆ Cannot spawn! ☆☆☆☆☆\n") VT_RST); break; } } @@ -212,10 +211,9 @@ void EnEncount1_SpawnTektites(EnEncount1* this, PlayState* play) { this->curNumSpawn++; this->totalNumSpawn++; } else { - // "Cannot spawn!" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n" VT_RST); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n" VT_RST); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n", "☆☆☆☆☆ Cannot spawn! ☆☆☆☆☆\n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n", "☆☆☆☆☆ Cannot spawn! ☆☆☆☆☆\n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n", "☆☆☆☆☆ Cannot spawn! ☆☆☆☆☆\n") VT_RST); } } } @@ -317,10 +315,9 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, PlayState* play) { this->totalNumSpawn++; } } else { - // "Cannot spawn!" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n" VT_RST); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n" VT_RST); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n", "☆☆☆☆☆ Cannot spawn! ☆☆☆☆☆\n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n", "☆☆☆☆☆ Cannot spawn! ☆☆☆☆☆\n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n", "☆☆☆☆☆ Cannot spawn! ☆☆☆☆☆\n") VT_RST); break; } } diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h index 5fffa776ca..f21cb42942 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h @@ -30,7 +30,7 @@ typedef struct EnEncount1 { /* 0x016C */ EnReeba* bigLeever; } EnEncount1; // size = 0x0170 -typedef enum { +typedef enum EnEncount1type { /* 0 */ SPAWNER_LEEVER, /* 1 */ SPAWNER_TEKTITE, /* 2 */ SPAWNER_STALCHILDREN, diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index cab41eec90..972f06b6f7 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -6,7 +6,7 @@ #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) -typedef enum { +typedef enum Encount2State { /* 0x0 */ ENCOUNT2_INACTIVE, /* 0x1 */ ENCOUNT2_ACTIVE_DEATH_MOUNTAIN, /* 0x2 */ ENCOUNT2_ACTIVE_GANONS_TOWER @@ -23,7 +23,7 @@ void EnEncount2_SpawnEffect(EnEncount2* this, Vec3f* position, f32 scale); void EnEncount2_DrawEffects(Actor* thisx, PlayState* play); void EnEncount2_UpdateEffects(EnEncount2* this, PlayState* play); -ActorInit En_Encount2_InitVars = { +ActorProfile En_Encount2_Profile = { /**/ ACTOR_EN_ENCOUNT2, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -361,8 +361,7 @@ void EnEncount2_DrawEffects(Actor* thisx, PlayState* play) { Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 155, 55, 255); gDPSetEnvColor(POLY_OPA_DISP++, 155, 255, 55, 255); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_encount2.c", 669), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_encount2.c", 669); gSPDisplayList(POLY_OPA_DISP++, object_efc_star_field_DL_000DE0); } } diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h index 7141abd17d..c3e0a0655e 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h @@ -10,7 +10,7 @@ typedef void (*EnEncount2ActionFunc)(struct EnEncount2*, PlayState*); #define EN_ENCOUNT2_EFFECT_COUNT 50 -typedef struct { +typedef struct EnEncount2Effect { /* 0x0000 */ Vec3f pos; /* 0x000C */ f32 scale; /* 0x0010 */ u8 isAlive; diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 060f97435b..53507b0e39 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -32,7 +32,7 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, PlayState* play); void EnExItem_TargetPrizeGive(EnExItem* this, PlayState* play); void EnExItem_TargetPrizeFinish(EnExItem* this, PlayState* play); -ActorInit En_Ex_Item_InitVars = { +ActorProfile En_Ex_Item_Profile = { /**/ ACTOR_EN_EX_ITEM, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -51,9 +51,9 @@ void EnExItem_Init(Actor* thisx, PlayState* play) { s32 pad; EnExItem* this = (EnExItem*)thisx; - this->actor.flags &= ~ACTOR_FLAG_0; - this->type = this->actor.params & 0xFF; - this->unusedParam = (this->actor.params >> 8) & 0xFF; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; + this->type = PARAMS_GET_U(this->actor.params, 0, 8); + this->unusedParam = PARAMS_GET_U(this->actor.params, 8, 8); PRINTF("\n\n"); // "What will come out?" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ なにがでるかな? ☆☆☆☆☆ %d\n" VT_RST, this->type); @@ -122,11 +122,11 @@ void EnExItem_WaitForObject(EnExItem* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { // "End of transfer" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params, this); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params, this); - PRINTF(VT_FGCOL(BLUE) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params, this); - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params, this); - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n\n" VT_RST, this->actor.params, this); + PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); + PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); + PRINTF(VT_FGCOL(BLUE) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); + PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); + PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n\n" VT_RST, this->actor.params); this->actor.objectSlot = this->requiredObjectSlot; this->actor.draw = EnExItem_Draw; this->stopRotate = false; @@ -503,8 +503,7 @@ void EnExItem_DrawKey(EnExItem* this, PlayState* play, s32 index) { OPEN_DISPS(play->state.gfxCtx, "../z_en_ex_item.c", 880); Gfx_SetupDL_41Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ex_item.c", 887), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_ex_item.c", 887); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(keySegments[index])); gSPDisplayList(POLY_OPA_DISP++, gItemDropDL); diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h index 6c6ff404a7..1dd06afcbd 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h @@ -29,7 +29,7 @@ typedef struct EnExItem { /* 0x0180 */ EnExItemLightFunc unk_180; } EnExItem; // size = 0x0184 -typedef enum { +typedef enum EnExItemType { /* 0 */ EXITEM_BOMB_BAG_BOWLING, /* 1 */ EXITEM_HEART_PIECE_BOWLING, /* 2 */ EXITEM_BOMBCHUS_BOWLING, @@ -52,8 +52,4 @@ typedef enum { /* 19 */ EXITEM_BULLET_BAG } EnExItemType; -#define EXITEM_COUNTER 5 -#define EXITEM_CHEST 10 -#define EXITEM_MAGIC 16 - #endif diff --git a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c index e01eb9985f..6db126576b 100644 --- a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c +++ b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c @@ -28,7 +28,7 @@ static s16 sRupeeValues[] = { 1, 5, 20, 500, 50, }; -ActorInit En_Ex_Ruppy_InitVars = { +ActorProfile En_Ex_Ruppy_Profile = { /**/ ACTOR_EN_EX_RUPPY, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -105,7 +105,7 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) { this->unk_15A = this->actor.world.rot.z; this->actor.world.rot.z = 0; this->timer = 30; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnExRuppy_DropIntoWater; break; @@ -123,7 +123,7 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) { PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ わーなーコイン ☆☆☆☆☆ \n" VT_RST); this->actor.shape.shadowScale = 6.0f; this->actor.shape.yOffset = 700.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnExRuppy_WaitToBlowUp; break; @@ -145,13 +145,13 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) { PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ ノーマルルピー ☆☆☆☆☆ \n" VT_RST); this->actor.shape.shadowScale = 6.0f; this->actor.shape.yOffset = 700.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnExRuppy_WaitAsCollectible; break; case 4: // Progress markers in the shooting gallery this->actor.gravity = -3.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Actor_SetScale(&this->actor, 0.01f); this->actor.shape.shadowScale = 6.0f; this->actor.shape.yOffset = -700.0f; @@ -302,7 +302,7 @@ void EnExRuppy_Kill(EnExRuppy* this, PlayState* play) { } } -typedef struct { +typedef struct EnExRuppyParentActor { /* 0x000 */ Actor actor; /* 0x14C */ char unk_14C[0x11A]; /* 0x226 */ s16 unk_226; @@ -338,7 +338,7 @@ void EnExRuppy_WaitToBlowUp(EnExRuppy* this, PlayState* play) { explosionScaleStep = 6; } EffectSsBomb2_SpawnLayered(play, &this->actor.world.pos, &velocity, &accel, explosionScale, explosionScaleStep); - func_8002F71C(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f); Actor_PlaySfx(&this->actor, NA_SE_IT_BOMB_EXPLOSION); Actor_Kill(&this->actor); } @@ -388,8 +388,7 @@ void EnExRuppy_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); func_8002EBCC(thisx, play, 0); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ex_ruppy.c", 780), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_ex_ruppy.c", 780); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(rupeeTextures[this->colorIdx])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_OPA_DISP++, this->colorIdx); gSPDisplayList(POLY_OPA_DISP++, gRupeeDL); diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/src/overlays/actors/ovl_En_Fd/z_en_fd.c index ad2698b3dc..88d7ef024d 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -5,13 +5,11 @@ */ #include "z_en_fd.h" +#include "versions.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_fw/object_fw.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_9) - -#define FLG_COREDEAD (0x4000) -#define FLG_COREDONE (0x8000) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_9) void EnFd_Init(Actor* thisx, PlayState* play); void EnFd_Destroy(Actor* thisx, PlayState* play); @@ -30,7 +28,7 @@ void EnFd_DrawEffectsDots(EnFd* this, PlayState* play); void EnFd_DrawEffectsFlames(EnFd* this, PlayState* play); void EnFd_Land(EnFd* this, PlayState* play); -ActorInit En_Fd_InitVars = { +ActorProfile En_Fd_Profile = { /**/ ACTOR_EN_FD, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -42,11 +40,17 @@ ActorInit En_Fd_InitVars = { /**/ EnFd_Draw, }; +#if OOT_VERSION < NTSC_1_1 +#define FLARE_DANCER_BODY_DMG 0x00 +#else +#define FLARE_DANCER_BODY_DMG 0x04 +#endif + static ColliderJntSphElementInit sJntSphElementsInit[12] = { { { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x01, 0x04 }, + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x01, FLARE_DANCER_BODY_DMG }, { 0x00040088, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, ACELEM_ON | ACELEM_HOOKABLE, @@ -56,8 +60,8 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x01, 0x04 }, + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x01, FLARE_DANCER_BODY_DMG }, { 0x00040008, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, ACELEM_ON, @@ -67,8 +71,8 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x01, 0x04 }, + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x01, FLARE_DANCER_BODY_DMG }, { 0x00040008, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, ACELEM_ON, @@ -78,8 +82,8 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x01, 0x04 }, + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x01, FLARE_DANCER_BODY_DMG }, { 0x00040008, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, ACELEM_ON, @@ -89,8 +93,8 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x01, 0x04 }, + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x01, FLARE_DANCER_BODY_DMG }, { 0x00040008, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, ACELEM_ON, @@ -100,8 +104,8 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x01, 0x04 }, + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x01, FLARE_DANCER_BODY_DMG }, { 0x00040008, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, ACELEM_ON, @@ -111,8 +115,8 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x01, 0x04 }, + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x01, FLARE_DANCER_BODY_DMG }, { 0x00040008, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, ACELEM_ON, @@ -122,8 +126,8 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x01, 0x04 }, + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x01, FLARE_DANCER_BODY_DMG }, { 0x00040008, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, ACELEM_ON, @@ -133,8 +137,8 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x01, 0x04 }, + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x01, FLARE_DANCER_BODY_DMG }, { 0x00040008, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, ACELEM_ON, @@ -144,8 +148,8 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x01, 0x04 }, + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x01, FLARE_DANCER_BODY_DMG }, { 0x00040008, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, ACELEM_ON, @@ -155,8 +159,8 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x01, 0x04 }, + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x01, FLARE_DANCER_BODY_DMG }, { 0x00040008, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, ACELEM_ON, @@ -166,8 +170,8 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, - { 0xFFCFFFFF, 0x01, 0x04 }, + ELEM_MATERIAL_UNK0, + { 0xFFCFFFFF, 0x01, FLARE_DANCER_BODY_DMG }, { 0x00040008, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, ACELEM_ON, @@ -179,7 +183,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -192,7 +196,7 @@ static ColliderJntSphInit sJntSphInit = { static CollisionCheckInfoInit2 sColChkInit = { 24, 2, 25, 25, MASS_IMMOVABLE }; -typedef enum { +typedef enum EnFdAnimation { /* 0 */ ENFD_ANIM_0, /* 1 */ ENFD_ANIM_1, /* 2 */ ENFD_ANIM_2, @@ -237,7 +241,7 @@ void EnFd_SpawnChildFire(EnFd* this, PlayState* play, s16 fireCnt, s16 color) { s32 i; for (i = 0; i < fireCnt; i++) { - s16 angle = (s16)((((i * 360.0f) / fireCnt) * (0x10000 / 360.0f))) + this->actor.yawTowardsPlayer; + s16 angle = DEG_TO_BINANG((i * 360.0f) / fireCnt) + this->actor.yawTowardsPlayer; Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_FD_FIRE, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, angle, 0, (color << 0xF) | i); } @@ -291,7 +295,7 @@ s32 EnFd_ColliderCheck(EnFd* this, PlayState* play) { return false; } this->invincibilityTimer = 30; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Actor_PlaySfx(&this->actor, NA_SE_EN_FLAME_DAMAGE); Enemy_StartFinishingBlow(play, &this->actor); return true; @@ -306,7 +310,8 @@ s32 EnFd_ColliderCheck(EnFd* this, PlayState* play) { } this->attackTimer = 30; Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT); - func_8002F71C(play, &this->actor, this->actor.speed + 2.0f, this->actor.yawTowardsPlayer, 6.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, this->actor.speed + 2.0f, + this->actor.yawTowardsPlayer, 6.0f); } return false; } @@ -328,7 +333,7 @@ s32 EnFd_CanSeeActor(EnFd* this, Actor* actor, PlayState* play) { return false; } - // Check to see if the angle between this facing angle and `actor` is withing ~40 degrees + // Check to see if the angle between this facing angle and `actor` is within ~40 degrees angle = (f32)Math_Vec3f_Yaw(&this->actor.world.pos, &actor->world.pos) - this->actor.shape.rot.y; if (ABS(angle) > 0x1C70) { return false; @@ -455,7 +460,7 @@ void EnFd_Init(Actor* thisx, PlayState* play) { Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colSphs); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0xF), &sColChkInit); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.flags |= ACTOR_FLAG_24; Actor_SetScale(&this->actor, 0.01f); this->firstUpdateFlag = true; @@ -488,7 +493,7 @@ void EnFd_SpinAndGrow(EnFd* this, PlayState* play) { this->actor.velocity.y = 6.0f; this->actor.scale.y = 0.01f; this->actor.world.rot.y ^= 0x8000; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = 8.0f; Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENFD_ANIM_1); this->actionFunc = EnFd_JumpToGround; @@ -528,10 +533,10 @@ void EnFd_SpinAndSpawnFire(EnFd* this, PlayState* play) { f32 tgtSpeed; f32 rotSpeed; - if ((this->spinTimer < 31) && (this->invincibilityTimer == 0)) { - func_8002F974(&this->actor, NA_SE_EN_FLAME_FIRE_ATTACK - SFX_FLAG); + if ((this->spinTimer <= 30) && (this->invincibilityTimer == 0)) { + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_FLAME_FIRE_ATTACK - SFX_FLAG); } else { - func_8002F974(&this->actor, NA_SE_EN_FLAME_ROLL - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_FLAME_ROLL - SFX_FLAG); } if (DECR(this->spinTimer) != 0) { @@ -620,13 +625,16 @@ void EnFd_Run(EnFd* this, PlayState* play) { EnFd_GetPosAdjAroundCircle(&adjPos, this, this->runRadius, this->runDir); Math_SmoothStepToS(&this->actor.shape.rot.y, RAD_TO_BINANG(Math_FAtan2F(adjPos.x, adjPos.z)), 4, 0xFA0, 1); this->actor.world.rot = this->actor.shape.rot; - func_8002F974(&this->actor, NA_SE_EN_FLAME_RUN - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_FLAME_RUN - SFX_FLAG); if (this->skelAnime.curFrame == 6.0f || this->skelAnime.curFrame == 13.0f || this->skelAnime.curFrame == 28.0f) { Actor_PlaySfx(&this->actor, NA_SE_EN_FLAME_KICK); } Math_SmoothStepToF(&this->actor.speed, 8.0f, 0.1f, 1.0f, 0.0f); } +#define FLG_COREDEAD (0x4000) +#define FLG_COREDONE (0x8000) + /** * En_Fw will set `this` params when it is done with its action. * It will set FLG_COREDONE when the core has returned to `this`'s initial @@ -638,9 +646,9 @@ void EnFd_WaitForCore(EnFd* this, PlayState* play) { if (this->spinTimer == 0) { Actor_Kill(&this->actor); } - } else if (this->actor.params & FLG_COREDONE) { + } else if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { // FLG_COREDONE this->actionFunc = EnFd_Reappear; - } else if (this->actor.params & FLG_COREDEAD) { + } else if (PARAMS_GET_NOSHIFT(this->actor.params, 14, 1)) { // FLG_COREDEAD this->actor.params = 0; this->spinTimer = 30; } @@ -663,7 +671,7 @@ void EnFd_Update(Actor* thisx, PlayState* play) { if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_13)) { // has been hookshoted if (EnFd_SpawnCore(this, play)) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->invincibilityTimer = 30; Actor_PlaySfx(&this->actor, NA_SE_EN_FLAME_DAMAGE); Enemy_StartFinishingBlow(play, &this->actor); @@ -771,7 +779,6 @@ void EnFd_Draw(Actor* thisx, PlayState* play) { EnFd_DrawEffectsFlames(this, play); Matrix_Pop(); if (this->actionFunc != EnFd_Reappear && !(this->fadeAlpha < 0.9f)) { - if (1) {} Gfx_SetupDL_25Xlu(play->state.gfxCtx); clampedHealth = CLAMP(thisx->colChkInfo.health - 1, 0, 23) / 8; gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, primColors[clampedHealth].r, primColors[clampedHealth].g, @@ -788,6 +795,9 @@ void EnFd_Draw(Actor* thisx, PlayState* play) { SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnFd_OverrideLimbDraw, EnFd_PostLimbDraw, this, POLY_XLU_DISP); } + + if (this->fadeAlpha) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_fd.c", 1822); } @@ -904,8 +914,7 @@ void EnFd_DrawEffectsFlames(EnFd* this, PlayState* play) { Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(eff->scale, eff->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_fd.c", 2006), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_fd.c", 2006); idx = eff->timer * (8.0f / eff->initialTimer); gSPSegment(POLY_XLU_DISP++, 0x8, SEGMENTED_TO_VIRTUAL(dustTextures[idx])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, idx); @@ -942,8 +951,7 @@ void EnFd_DrawEffectsDots(EnFd* this, PlayState* play) { Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(eff->scale, eff->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_fd.c", 2064), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_fd.c", 2064); gSPDisplayList(POLY_XLU_DISP++, gFlareDancerTriangleParticleDL); } diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.h b/src/overlays/actors/ovl_En_Fd/z_en_fd.h index 8f7f831709..3559410526 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.h +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.h @@ -8,7 +8,7 @@ struct EnFd; typedef void (*EnFdActionFunc)(struct EnFd* this, PlayState* play); -typedef enum { +typedef enum FDEffectType { FD_EFFECT_NONE, FD_EFFECT_FLAME, FD_EFFECT_DOT @@ -16,7 +16,7 @@ typedef enum { #define EN_FD_EFFECT_COUNT 200 -typedef struct { +typedef struct EnFdEffect { /* 0x0000 */ u8 type; /* 0x0001 */ u8 timer; /* 0x0002 */ u8 initialTimer; diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c index d15f8c58aa..472ff44b25 100644 --- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c +++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c @@ -1,7 +1,7 @@ #include "z_en_fd_fire.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) void EnFdFire_Init(Actor* thisx, PlayState* play); void EnFdFire_Destroy(Actor* thisx, PlayState* play); @@ -12,7 +12,7 @@ void func_80A0E70C(EnFdFire* this, PlayState* play); void EnFdFire_DanceTowardsPlayer(EnFdFire* this, PlayState* play); void EnFdFire_WaitToDie(EnFdFire* this, PlayState* play); -ActorInit En_Fd_Fire_InitVars = { +ActorProfile En_Fd_Fire_Profile = { /**/ ACTOR_EN_FD_FIRE, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -26,7 +26,7 @@ ActorInit En_Fd_Fire_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -34,7 +34,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x01, 0x08 }, { 0x0D840008, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -128,7 +128,7 @@ void EnFdFire_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInit); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.gravity = -0.6f; this->actor.speed = 5.0f; this->actor.velocity.y = 12.0f; @@ -155,7 +155,7 @@ void func_80A0E70C(EnFdFire* this, PlayState* play) { this->actor.velocity = velocity; this->actor.speed = 0.0f; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; - if (this->actor.params & 0x8000) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { this->deathTimer = 200; this->actionFunc = EnFdFire_DanceTowardsPlayer; } else { @@ -179,7 +179,7 @@ void EnFdFire_DanceTowardsPlayer(EnFdFire* this, PlayState* play) { Vec3f pos; s16 idx; - idx = ((play->state.frames / 10) + (this->actor.params & 0x7FFF)) % ARRAY_COUNT(angles); + idx = ((play->state.frames / 10) + PARAMS_GET_S(this->actor.params, 0, 15)) % ARRAY_COUNT(angles); pos = player->actor.world.pos; pos.x += 120.0f * sinf(angles[idx]); pos.z += 120.0f * cosf(angles[idx]); @@ -248,14 +248,11 @@ void EnFdFire_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_fd_fire.c", 572); - Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); - sp8E = Math_Vec3f_Yaw(&scale, &this->actor.velocity) - Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)); + Matrix_Translate(thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, MTXMODE_NEW); + sp8E = Math_Vec3f_Yaw(&scale, &thisx->velocity) - Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)); sp84 = fabsf(Math_CosS(sp8E)); sp88 = Math_SinS(sp8E); - sp80 = Math_Vec3f_DistXZ(&scale, &this->actor.velocity) / 1.5f; - if (1) {} - if (1) {} - if (1) {} + sp80 = Math_Vec3f_DistXZ(&scale, &thisx->velocity) / 1.5f; Matrix_RotateY(BINANG_TO_RAD((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x8000)), MTXMODE_APPLY); Matrix_RotateZ(DEG_TO_RAD((sp88 * -10.0f) * sp80), MTXMODE_APPLY); scale.x = scale.y = scale.z = this->scale * 0.001f; @@ -265,20 +262,17 @@ void EnFdFire_Draw(Actor* thisx, PlayState* play) { sp84 = 0.1f; } Matrix_Scale(1.0f, sp84, 1.0f / sp84, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_fd_fire.c", 623), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_fd_fire.c", 623); Gfx_SetupDL_25Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x8, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x40, 1, 0, play->state.frames * this->tile2Y, 0x20, 0x80)); - gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, primColors[((this->actor.params & 0x8000) >> 0xF)].r, - primColors[((this->actor.params & 0x8000) >> 0xF)].g, - primColors[((this->actor.params & 0x8000) >> 0xF)].b, - primColors[((this->actor.params & 0x8000) >> 0xF)].a); - gDPSetEnvColor(POLY_XLU_DISP++, envColors[((this->actor.params & 0x8000) >> 0xF)].r, - envColors[((this->actor.params & 0x8000) >> 0xF)].g, - envColors[((this->actor.params & 0x8000) >> 0xF)].b, - envColors[((this->actor.params & 0x8000) >> 0xF)].a); + gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, primColors[PARAMS_GET_S(thisx->params, 15, 1)].r, + primColors[PARAMS_GET_S(thisx->params, 15, 1)].g, primColors[PARAMS_GET_S(thisx->params, 15, 1)].b, + primColors[PARAMS_GET_S(thisx->params, 15, 1)].a); + gDPSetEnvColor(POLY_XLU_DISP++, envColors[PARAMS_GET_S(thisx->params, 15, 1)].r, + envColors[PARAMS_GET_S(thisx->params, 15, 1)].g, envColors[PARAMS_GET_S(thisx->params, 15, 1)].b, + envColors[PARAMS_GET_S(thisx->params, 15, 1)].a); gDPPipeSync(POLY_XLU_DISP++); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index 8d0a8f2a63..a76c0b8783 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -13,19 +13,19 @@ #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) -typedef enum { +typedef enum StrikeMode { /* 0 */ STRIKE_INIT, /* 10 */ STRIKE_BURST = 10, /* 11 */ STRIKE_TRAILS } StrikeMode; -typedef enum { +typedef enum TrailMode { /* 0 */ TRAIL_INIT, /* 1 */ TRAIL_APPEAR, /* 2 */ TRAIL_DISSIPATE } TrailMode; -typedef enum { +typedef enum BallKillMode { /* 0 */ BALL_FIZZLE, /* 1 */ BALL_BURST, /* 2 */ BALL_IMPACT @@ -44,7 +44,7 @@ void EnFhgFire_SpearLight(EnFhgFire* this, PlayState* play); void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play); void EnFhgFire_PhantomWarp(EnFhgFire* this, PlayState* play); -ActorInit En_Fhg_Fire_InitVars = { +ActorProfile En_Fhg_Fire_Profile = { /**/ 0, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -58,7 +58,7 @@ ActorInit En_Fhg_Fire_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -66,7 +66,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK6, + ELEM_MATERIAL_UNK6, { 0x00100700, 0x03, 0x20 }, { 0x0D900700, 0x00, 0x00 }, ATELEM_ON, @@ -535,7 +535,8 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { if ((bossGnd->flyMode >= GND_FLY_VOLLEY) && (this->work[FHGFIRE_RETURN_COUNT] >= 2)) { Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_LAUGH); } - func_8002F698(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, 3, 0x10); + Actor_SetPlayerKnockback(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, + PLAYER_KNOCKBACK_LARGE_SHOCK, 0x10); } break; case FHGFIRE_LIGHT_BLUE: @@ -713,8 +714,7 @@ void EnFhgFire_Draw(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s8)this->fwork[FHGFIRE_ALPHA]); gDPSetEnvColor(POLY_XLU_DISP++, 165, 255, 75, 0); gDPPipeSync(POLY_XLU_DISP++); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_fhg_fire.c", 1745), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_fhg_fire.c", 1745); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gPhantomLightningBlastDL)); } else if ((this->actor.params == FHGFIRE_SPEAR_LIGHT) || (this->actor.params == FHGFIRE_ENERGY_BALL)) { PRINTF("yari hikari draw 1\n"); @@ -729,8 +729,7 @@ void EnFhgFire_Draw(Actor* thisx, PlayState* play) { } gDPPipeSync(POLY_XLU_DISP++); Matrix_RotateZ((this->actor.shape.rot.z / (f32)0x8000) * 3.1416f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_fhg_fire.c", 1801), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_fhg_fire.c", 1801); gSPDisplayList(POLY_XLU_DISP++, gPhantomEnergyBallDL); } else if ((this->actor.params == FHGFIRE_WARP_EMERGE) || (this->actor.params == FHGFIRE_WARP_RETREAT) || (this->actor.params == FHGFIRE_WARP_DEATH)) { @@ -738,8 +737,7 @@ void EnFhgFire_Draw(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, (u8)this->fwork[FHGFIRE_WARP_ALPHA]); gDPSetEnvColor(POLY_XLU_DISP++, 90, 50, 95, (s8)(this->fwork[FHGFIRE_WARP_ALPHA] * 0.5f)); gDPPipeSync(POLY_XLU_DISP++); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_fhg_fire.c", 1833), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_fhg_fire.c", 1833); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (s16)this->fwork[FHGFIRE_WARP_TEX_1_X], (s16)this->fwork[FHGFIRE_WARP_TEX_1_Y], 0x40, 0x40, 1, @@ -753,8 +751,7 @@ void EnFhgFire_Draw(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s8)this->fwork[FHGFIRE_ALPHA]); gDPSetEnvColor(POLY_XLU_DISP++, 0, 255, 30, 0); gDPPipeSync(POLY_XLU_DISP++); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_fhg_fire.c", 1892), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_fhg_fire.c", 1892); gSPDisplayList(POLY_XLU_DISP++, gPhantomLightningDL); PRINTF("FF DRAW 2\n"); } diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h index 2f43770770..ac2682aaf1 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h @@ -8,7 +8,7 @@ struct EnFhgFire; typedef void (*EnFhgFireUpdateFunc)(struct EnFhgFire*, PlayState*); -typedef enum { +typedef enum FhgFireParam { /* 1 */ FHGFIRE_LIGHTNING_STRIKE = 1, /* 35 */ FHGFIRE_LIGHTNING_SHOCK = 35, /* 36 */ FHGFIRE_LIGHTNING_BURST, @@ -20,13 +20,13 @@ typedef enum { /* 100 */ FHGFIRE_LIGHTNING_TRAIL = 100 } FhgFireParam; -typedef enum { +typedef enum FhgLightMode { /* 0 */ FHGFIRE_LIGHT_GREEN, /* 1 */ FHGFIRE_LIGHT_BLUE, /* 2 */ FHGFIRE_LIGHT_REFLECT } FhgLightMode; -typedef enum { +typedef enum FhgFireS16Var { /* 0 */ FHGFIRE_TIMER, /* 1 */ FHGFIRE_FX_TIMER, /* 2 */ FHGFIRE_US_2, @@ -37,7 +37,7 @@ typedef enum { /* 7 */ FHGFIRE_SHORT_COUNT } FhgFireS16Var; -typedef enum { +typedef enum FhgFireF32Var { /* 0 */ FHGFIRE_ALPHA, /* 1 */ FHGFIRE_UF_1, /* 2 */ FHGFIRE_UF_2, diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c index cc5a1ff017..9b7ab4a089 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c @@ -15,7 +15,7 @@ void FireRock_WaitOnFloor(EnFireRock* this, PlayState* play); void EnFireRock_Fall(EnFireRock* this, PlayState* play); void EnFireRock_SpawnMoreBrokenPieces(EnFireRock* this, PlayState* play); -ActorInit En_Fire_Rock_InitVars = { +ActorProfile En_Fire_Rock_Profile = { /**/ ACTOR_EN_FIRE_ROCK, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -29,7 +29,7 @@ ActorInit En_Fire_Rock_InitVars = { static ColliderCylinderInit D_80A12CA0 = { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -37,7 +37,7 @@ static ColliderCylinderInit D_80A12CA0 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x09, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -49,7 +49,7 @@ static ColliderCylinderInit D_80A12CA0 = { static ColliderCylinderInit D_80A12CCC = { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -57,7 +57,7 @@ static ColliderCylinderInit D_80A12CCC = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x01, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -367,7 +367,7 @@ void EnFireRock_Update(Actor* thisx, PlayState* play) { this->collider.base.atFlags &= ~AT_HIT; if (this->collider.base.at == playerActor) { if (!(player->stateFlags1 & PLAYER_STATE1_26)) { - func_8002F758(play, thisx, 2.0f, -player->actor.world.rot.y, 3.0f, 4); + Actor_SetPlayerKnockbackSmall(play, thisx, 2.0f, -player->actor.world.rot.y, 3.0f, 4); } return; } @@ -396,8 +396,7 @@ void EnFireRock_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 155, 55, 255); gDPSetEnvColor(POLY_OPA_DISP++, 155, 255, 55, 255); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_fire_rock.c", 768), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_fire_rock.c", 768); gSPDisplayList(POLY_OPA_DISP++, object_efc_star_field_DL_000DE0); CLOSE_DISPS(play->state.gfxCtx, "../z_en_fire_rock.c", 773); } diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h index 3530cecb75..6e387bdb39 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h @@ -6,7 +6,7 @@ #include "overlays/actors/ovl_En_Encount2/z_en_encount2.h" -typedef enum { +typedef enum EnFireRockType { /* 0x00 */ FIRE_ROCK_SPAWNED_FALLING1, /* 0x01 */ FIRE_ROCK_BROKEN_PIECE1, /* 0x02 */ FIRE_ROCK_BROKEN_PIECE2, diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 760140aed5..e1d31a3213 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -5,10 +5,11 @@ */ #include "z_en_firefly.h" +#include "versions.h" #include "assets/objects/object_firefly/object_firefly.h" #include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_14) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_14) void EnFirefly_Init(Actor* thisx, PlayState* play); void EnFirefly_Destroy(Actor* thisx, PlayState* play); @@ -28,13 +29,13 @@ void EnFirefly_FrozenFall(EnFirefly* this, PlayState* play); void EnFirefly_Perch(EnFirefly* this, PlayState* play); void EnFirefly_DisturbDiveAttack(EnFirefly* this, PlayState* play); -typedef enum { +typedef enum KeeseAuraType { /* 0 */ KEESE_AURA_NONE, /* 1 */ KEESE_AURA_FIRE, /* 2 */ KEESE_AURA_ICE } KeeseAuraType; -ActorInit En_Firefly_InitVars = { +ActorProfile En_Firefly_Profile = { /**/ ACTOR_EN_FIREFLY, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -49,7 +50,7 @@ ActorInit En_Firefly_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x01, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_HARD, @@ -62,7 +63,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -112,8 +113,8 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 5, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -500, ICHAIN_CONTINUE), - ICHAIN_F32(minVelocityY, -4, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 4000, ICHAIN_STOP), + ICHAIN_F32(minVelocityY, -4, ICHAIN_CONTINUE), ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 4000, ICHAIN_STOP), }; void EnFirefly_Extinguish(EnFirefly* this) { @@ -146,7 +147,7 @@ void EnFirefly_Init(Actor* thisx, PlayState* play) { Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - if ((this->actor.params & 0x8000) != 0) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1) != 0) { this->actor.flags |= ACTOR_FLAG_REACT_TO_LENS; if (1) {} this->actor.draw = EnFirefly_DrawInvisible; @@ -553,7 +554,12 @@ void EnFirefly_Stunned(EnFirefly* this, PlayState* play) { } void EnFirefly_FrozenFall(EnFirefly* this, PlayState* play) { - if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { +#if OOT_VERSION < NTSC_1_1 + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) || (this->actor.floorHeight == BGCHECK_Y_MIN)) +#else + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) +#endif + { this->actor.colorFilterTimer = 0; EnFirefly_SetupDie(this); } else { @@ -625,7 +631,7 @@ void EnFirefly_UpdateDamage(EnFirefly* this, PlayState* play) { if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (Actor_ApplyDamage(&this->actor) == 0) { Enemy_StartFinishingBlow(play, &this->actor); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } damageEffect = this->actor.colChkInfo.damageEffect; diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h index 862779e189..165cc5c26e 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h @@ -24,7 +24,7 @@ typedef struct EnFirefly { /* 0x0344 */ ColliderJntSphElement colliderItems[1]; } EnFirefly; // size = 0x0374 -typedef enum { +typedef enum KeeseType { /* 0 */ KEESE_FIRE_FLY, /* 1 */ KEESE_FIRE_PERCH, /* 2 */ KEESE_NORMAL_FLY, diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index e008be1d2d..ccc27510e2 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -5,6 +5,7 @@ */ #include "z_en_fish.h" +#include "global.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "terminal.h" @@ -40,7 +41,7 @@ static f32 D_80A17018 = 0.0f; static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -53,7 +54,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -64,7 +65,7 @@ static ColliderJntSphInit sJntSphInit = { sJntSphElementsInit, }; -ActorInit En_Fish_InitVars = { +ActorProfile En_Fish_Profile = { /**/ ACTOR_EN_FISH, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.h b/src/overlays/actors/ovl_En_Fish/z_en_fish.h index 7169077b58..01cdbd0b36 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.h +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.h @@ -2,11 +2,11 @@ #define Z_EN_FISH_H #include "ultra64.h" -#include "global.h" +#include "z64actor.h" struct EnFish; -typedef void (*EnFishActionFunc)(struct EnFish*, PlayState*); +typedef void (*EnFishActionFunc)(struct EnFish*, struct PlayState*); typedef struct EnFish { /* 0x0000 */ Actor actor; @@ -23,7 +23,7 @@ typedef struct EnFish { /* 0x0250 */ s32 unk_250; // Set to 0 or 5, arg5 of Actor_UpdateBgCheckInfo } EnFish; // size = 0x0254 -typedef enum { +typedef enum EnFishType { /* -1 */ FISH_SWIMMING_RESPAWNING = -1, // Used in Zora's Domain; code only uses not 0 or 1, runs away from Player /* 0 */ FISH_DROPPED, /* 1 */ FISH_SWIMMING_UNIQUE // Used in grottos diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 41dd2cfdc5..9483d29d19 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -7,7 +7,7 @@ #include "z_en_floormas.h" #include "assets/objects/object_wallmaster/object_wallmaster.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_10) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_10) #define SPAWN_INVISIBLE 0x8000 #define SPAWN_SMALL 0x10 @@ -44,7 +44,7 @@ void EnFloormas_Stand(EnFloormas* this, PlayState* play); void EnFloormas_BigDecideAction(EnFloormas* this, PlayState* play); void EnFloormas_Charge(EnFloormas* this, PlayState* play); -ActorInit En_Floormas_InitVars = { +ActorProfile En_Floormas_Profile = { /**/ ACTOR_EN_FLOORMAS, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -58,7 +58,7 @@ ActorInit En_Floormas_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -66,7 +66,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x04, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_HARD, @@ -115,7 +115,7 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_FLOORMASTER, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 5500, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 5500, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_STOP), }; @@ -133,7 +133,7 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); this->zOffset = -1600; - invisble = this->actor.params & SPAWN_INVISIBLE; + invisble = PARAMS_GET_NOSHIFT(this->actor.params, 15, 1); // SPAWN_INVISIBLE // s16 cast needed this->actor.params &= (s16) ~(SPAWN_INVISIBLE); @@ -144,7 +144,7 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { if (this->actor.params == SPAWN_SMALL) { this->actor.draw = NULL; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnFloormas_SmallWait; } else { // spawn first small floormaster @@ -181,13 +181,13 @@ void EnFloormas_Destroy(Actor* thisx, PlayState* play) { } void EnFloormas_MakeInvulnerable(EnFloormas* this) { - this->collider.base.colType = COLTYPE_HARD; + this->collider.base.colMaterial = COL_MATERIAL_HARD; this->collider.base.acFlags |= AC_HARD; this->actionTarget = 0x28; } void EnFloormas_MakeVulnerable(EnFloormas* this) { - this->collider.base.colType = COLTYPE_HIT0; + this->collider.base.colMaterial = COL_MATERIAL_HIT0; this->actionTarget = 0; this->collider.base.acFlags &= ~AC_HARD; } @@ -345,7 +345,7 @@ void EnFloormas_SetupGrabLink(EnFloormas* this, Player* player) { f32 xzDelta; Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.0f, 36.0f, 45.0f, ANIMMODE_ONCE, -3.0f); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; EnFloormas_MakeInvulnerable(this); @@ -384,7 +384,7 @@ void EnFloormas_SetupSmallWait(EnFloormas* this) { } this->actor.draw = NULL; this->actionFunc = EnFloormas_SmallWait; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_4); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4); } void EnFloormas_SetupTakeDamage(EnFloormas* this) { @@ -580,7 +580,7 @@ void EnFloormas_Slide(EnFloormas* this, PlayState* play) { func_800286CC(play, &pos, &velocity, &accel, 450, 100); - func_8002F974(&this->actor, NA_SE_EN_FLOORMASTER_SLIDING - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_FLOORMASTER_SLIDING - SFX_FLAG); } void EnFloormas_Charge(EnFloormas* this, PlayState* play) { @@ -662,7 +662,7 @@ void EnFloormas_Land(EnFloormas* this, PlayState* play) { void EnFloormas_Split(EnFloormas* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (SkelAnime_Update(&this->skelAnime)) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->smallActionTimer = 50; EnFloormas_SetupStand(this); } @@ -804,7 +804,7 @@ void EnFloormas_GrabLink(EnFloormas* this, PlayState* play) { this->actor.shape.rot.x = 0; this->actor.velocity.y = 6.0f; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = -3.0f; EnFloormas_SetupLand(this); } else { @@ -927,7 +927,7 @@ void EnFloormas_Merge(EnFloormas* this, PlayState* play) { } } } - func_8002F974(&this->actor, NA_SE_EN_FLOORMASTER_RESTORE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_FLOORMASTER_RESTORE - SFX_FLAG); } void EnFloormas_SmallWait(EnFloormas* this, PlayState* play) { @@ -980,7 +980,7 @@ void EnFloormas_ColliderCheck(EnFloormas* this, PlayState* play) { this->collider.base.acFlags &= ~AC_HIT; Actor_SetDropFlag(&this->actor, &this->collider.elem, true); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { - if (this->collider.base.colType != COLTYPE_HARD) { + if (this->collider.base.colMaterial != COL_MATERIAL_HARD) { isSmall = false; if (this->actor.scale.x < 0.01f) { isSmall = true; @@ -996,7 +996,7 @@ void EnFloormas_ColliderCheck(EnFloormas* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_DEAD); } Enemy_StartFinishingBlow(play, &this->actor); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else if (this->actor.colChkInfo.damage != 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_DAMAGE); } @@ -1063,7 +1063,7 @@ void EnFloormas_Update(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->actor, this->actor.scale.x * 2500.0f); - if (this->collider.base.colType == COLTYPE_HARD) { + if (this->collider.base.colMaterial == COL_MATERIAL_HARD) { if (this->actionTarget != 0) { this->actionTarget--; } @@ -1092,7 +1092,7 @@ void EnFloormas_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* Matrix_RotateY(DEG_TO_RAD(60), MTXMODE_APPLY); Matrix_RotateZ(DEG_TO_RAD(15), MTXMODE_APPLY); Matrix_Scale(2.0f, 2.0f, 2.0f, MTXMODE_APPLY); - gSPMatrix((*gfx)++, MATRIX_NEW(play->state.gfxCtx, "../z_en_floormas.c", 2299), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD((*gfx)++, play->state.gfxCtx, "../z_en_floormas.c", 2299); gSPDisplayList((*gfx)++, gWallmasterFingerDL); Matrix_Pop(); } @@ -1106,14 +1106,14 @@ void EnFloormas_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_floormas.c", 2318); Gfx_SetupDL_25Opa(play->state.gfxCtx); - if (this->collider.base.colType == COLTYPE_HARD) { + if (this->collider.base.colMaterial == COL_MATERIAL_HARD) { func_80026230(play, &sMergeColor, this->actionTarget % 0x28, 0x28); } POLY_OPA_DISP = SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnFloormas_OverrideLimbDraw, EnFloormas_PostLimbDraw, this, POLY_OPA_DISP); - if (this->collider.base.colType == COLTYPE_HARD) { + if (this->collider.base.colMaterial == COL_MATERIAL_HARD) { func_80026608(play); } @@ -1126,13 +1126,13 @@ void EnFloormas_DrawHighlighted(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_floormas.c", 2352); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - if (this->collider.base.colType == COLTYPE_HARD) { + if (this->collider.base.colMaterial == COL_MATERIAL_HARD) { func_80026690(play, &sMergeColor, this->actionTarget % 0x28, 0x28); } POLY_XLU_DISP = SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnFloormas_OverrideLimbDraw, EnFloormas_PostLimbDraw, this, POLY_XLU_DISP); - if (this->collider.base.colType == COLTYPE_HARD) { + if (this->collider.base.colMaterial == COL_MATERIAL_HARD) { func_80026A6C(play); } diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 0046c82245..5fb1e395e8 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -3,7 +3,7 @@ #include "terminal.h" #include "assets/objects/object_fr/object_fr.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_25) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_25) void EnFr_Init(Actor* thisx, PlayState* play); void EnFr_Destroy(Actor* thisx, PlayState* play); @@ -77,18 +77,18 @@ sEnFrPointers.flags = 1 to 11: - 5: frog 0 (Yellow) - 7: frog 2 (Red) - 9: frog 4 (White) - - Will proceed when counter reachers 11 + - Will proceed when counter reaches 11 sEnFrPointers.flags = 12 - Deactivate frogs, frogs will jump back into the water */ -typedef struct { +typedef struct EnFrPointers { u8 flags; EnFr* frogs[5]; } EnFrPointers; -typedef struct { +typedef struct LogSpotToFromWater { f32 xzDist; f32 yaw; f32 yDist; @@ -133,7 +133,7 @@ static s32 sSongToFrog[] = { FROG_PURPLE, FROG_WHITE, FROG_YELLOW, FROG_BLUE, FROG_RED, }; -ActorInit En_Fr_InitVars = { +ActorProfile En_Fr_Profile = { /**/ ACTOR_EN_FR, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -168,8 +168,8 @@ static s16 sTimerFrogSong[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 30, ICHAIN_STOP), }; // Counter to Coordinate Frog jumping out of water one at a time @@ -236,7 +236,7 @@ void EnFr_Init(Actor* thisx, PlayState* play) { this->actor.destroy = NULL; this->actor.draw = NULL; this->actor.update = EnFr_UpdateIdle; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_4); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4); this->actor.flags &= ~0; Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP); this->actor.textId = 0x40AC; @@ -321,7 +321,7 @@ void EnFr_Update(Actor* thisx, PlayState* play) { this->posButterflyLight.x = this->posButterfly.x = this->posLogSpot.x; this->posButterflyLight.y = this->posButterfly.y = this->posLogSpot.y + 50.0f; this->posButterflyLight.z = this->posButterfly.z = this->posLogSpot.z; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } } @@ -1053,8 +1053,7 @@ void EnFr_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, OPEN_DISPS(play->state.gfxCtx, "../z_en_fr.c", 1735); Matrix_Push(); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_fr.c", 1738), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_fr.c", 1738); gSPDisplayList(POLY_OPA_DISP++, *dList); Matrix_Pop(); CLOSE_DISPS(play->state.gfxCtx, "../z_en_fr.c", 1741); diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.h b/src/overlays/actors/ovl_En_Fr/z_en_fr.h index 2bd6fa41a9..95a365dd9b 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.h +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.h @@ -9,7 +9,7 @@ struct EnFr; typedef void (*EnFrActionFunc)(struct EnFr*, PlayState*); typedef void (*EnFrBlinkFunc)(struct EnFr*); -typedef enum { +typedef enum FrogType { /* 0 */ FROG_YELLOW, // Middle /* 1 */ FROG_BLUE, // Front Left /* 2 */ FROG_RED, // Front Right @@ -17,7 +17,7 @@ typedef enum { /* 4 */ FROG_WHITE // Back Right } FrogType; -typedef enum { +typedef enum FrogSongType { /* 0 */ FROG_ZL, /* 1 */ FROG_EPONA, /* 2 */ FROG_SARIA, diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 9f10084857..798d7e509d 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -8,7 +8,7 @@ #include "assets/objects/object_fu/object_fu.h" #include "assets/scenes/indoors/hakasitarelay/hakasitarelay_scene.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_25) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_25) #define FU_RESET_LOOK_ANGLE (1 << 0) #define FU_WAIT (1 << 1) @@ -28,7 +28,7 @@ void func_80A1DBA0(EnFu* this, PlayState* play); void func_80A1DBD4(EnFu* this, PlayState* play); void func_80A1DB60(EnFu* this, PlayState* play); -ActorInit En_Fu_InitVars = { +ActorProfile En_Fu_Profile = { /**/ ACTOR_EN_FU, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -42,7 +42,7 @@ ActorInit En_Fu_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, @@ -50,7 +50,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -66,7 +66,7 @@ static Vec3f sMtxSrc = { 0.0f, }; -typedef enum { +typedef enum EnFuFace { /* 0x00 */ FU_FACE_CALM, /* 0x01 */ FU_FACE_MAD } EnFuFace; @@ -92,7 +92,7 @@ void EnFu_Init(Actor* thisx, PlayState* play) { this->skelanime.playSpeed = 2.0f; } this->behaviorFlags = 0; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; } void EnFu_Destroy(Actor* thisx, PlayState* play) { @@ -167,11 +167,11 @@ void func_80A1DBD4(EnFu* this, PlayState* play) { if (play->msgCtx.ocarinaMode >= OCARINA_MODE_04) { this->actionFunc = EnFu_WaitAdult; play->msgCtx.ocarinaMode = OCARINA_MODE_04; - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); this->actionFunc = func_80A1DB60; - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; play->csCtx.script = SEGMENTED_TO_VIRTUAL(gSongOfStormsCs); gSaveContext.cutsceneTrigger = 1; Item_Give(play, ITEM_SONG_STORMS); diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.h b/src/overlays/actors/ovl_En_Fu/z_en_fu.h index f8135e64c4..dbbcacfc54 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.h +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.h @@ -8,7 +8,7 @@ struct EnFu; typedef void (*EnFuActionFunc)(struct EnFu*, PlayState*); -typedef enum { +typedef enum EnFuLimb { /* 0x00 */ FU_LIMB_ROOT, /* 0x01 */ FU_LIMB_TORSO, /* 0x02 */ FU_LIMB_LEFT_THIGH, diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.c b/src/overlays/actors/ovl_En_Fw/z_en_fw.c index dcd3abc643..8bb1dda068 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -9,7 +9,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_9) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_9) void EnFw_Init(Actor* thisx, PlayState* play); void EnFw_Destroy(Actor* thisx, PlayState* play); @@ -24,7 +24,7 @@ void EnFw_Run(EnFw* this, PlayState* play); void EnFw_JumpToParentInitPos(EnFw* this, PlayState* play); void EnFw_TurnToParentInitPos(EnFw* this, PlayState* play); -ActorInit En_Fw_InitVars = { +ActorProfile En_Fw_Profile = { /**/ ACTOR_EN_FW, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -39,7 +39,7 @@ ActorInit En_Fw_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x04 }, { 0xFFCFFFFE, 0x00, 0x00 }, ATELEM_NONE, @@ -52,7 +52,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -65,7 +65,7 @@ static ColliderJntSphInit sJntSphInit = { static CollisionCheckInfoInit2 D_80A1FB94 = { 8, 2, 25, 25, MASS_IMMOVABLE }; -typedef enum { +typedef enum EnFwAnimation { /* 0 */ ENFW_ANIM_0, /* 1 */ ENFW_ANIM_1, /* 2 */ ENFW_ANIM_2 @@ -481,8 +481,7 @@ void EnFw_DrawEffects(EnFw* this, PlayState* play) { Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(eff->scale, eff->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_fw.c", 1229), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_fw.c", 1229); idx = eff->timer * (8.0f / eff->initialTimer); gSPSegment(POLY_XLU_DISP++, 0x8, SEGMENTED_TO_VIRTUAL(dustTextures[idx])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, idx); diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.h b/src/overlays/actors/ovl_En_Fw/z_en_fw.h index 79ccf12d9c..7940a98157 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.h +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.h @@ -10,7 +10,7 @@ typedef void (*EnFwActionFunc)(struct EnFw* this, PlayState* play); #define EN_FW_EFFECT_COUNT 20 -typedef struct { +typedef struct EnFwEffect { /* 0x0000 */ u8 type; /* 0x0001 */ u8 timer; /* 0x0002 */ u8 initialTimer; diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index 3e4b6ec492..c7b14455b3 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -1,7 +1,7 @@ #include "z_en_fz.h" #include "assets/objects/object_fz/object_fz.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_10) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_10) void EnFz_Init(Actor* thisx, PlayState* play); void EnFz_Destroy(Actor* thisx, PlayState* play); @@ -45,7 +45,7 @@ void EnFz_SpawnIceSmokeFreeze(EnFz* this, Vec3f* pos, Vec3f* velocity, Vec3f* ac void EnFz_UpdateIceSmoke(EnFz* this, PlayState* play); void EnFz_DrawEffects(EnFz* this, PlayState* play); -ActorInit En_Fz_InitVars = { +ActorProfile En_Fz_Profile = { /**/ ACTOR_EN_FZ, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -59,14 +59,14 @@ ActorInit En_Fz_InitVars = { static ColliderCylinderInitType1 sCylinderInit1 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCE0FDB, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -78,14 +78,14 @@ static ColliderCylinderInitType1 sCylinderInit1 = { static ColliderCylinderInitType1 sCylinderInit2 = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x00 }, { 0x0001F024, 0x00, 0x00 }, ATELEM_NONE, @@ -97,14 +97,14 @@ static ColliderCylinderInitType1 sCylinderInit2 = { static ColliderCylinderInitType1 sCylinderInit3 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x02, 0x08 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -151,8 +151,8 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_FREEZARD, ICHAIN_CONTINUE), - ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 30, ICHAIN_STOP), }; void EnFz_Init(Actor* thisx, PlayState* play) { @@ -173,7 +173,7 @@ void EnFz_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.008f); this->actor.colChkInfo.mass = MASS_IMMOVABLE; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->unusedTimer1 = 0; this->unusedCounter = 0; this->updateBgInfo = true; @@ -389,7 +389,7 @@ void EnFz_SetYawTowardsPlayer(EnFz* this) { void EnFz_SetupDisappear(EnFz* this) { this->state = 2; this->isFreezing = false; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnFz_Disappear; } @@ -447,7 +447,7 @@ void EnFz_SetupAimForMove(EnFz* this) { this->timer = 40; this->updateBgInfo = true; this->isFreezing = true; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnFz_AimForMove; this->actor.gravity = -1.0f; } @@ -510,7 +510,7 @@ void EnFz_BlowSmoke(EnFz* this, PlayState* play) { } else if (this->timer >= 11) { isTimerMod8 = false; primAlpha = 150; - func_8002F974(&this->actor, NA_SE_EN_FREEZAD_BREATH - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_FREEZAD_BREATH - SFX_FLAG); if ((this->timer - 10) < 16) { // t < 26 primAlpha = (this->timer * 10) - 100; @@ -554,7 +554,7 @@ void EnFz_SetupDespawn(EnFz* this, PlayState* play) { this->updateBgInfo = true; this->isFreezing = false; this->isDespawning = true; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->isActive = false; this->timer = 60; Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP); @@ -572,7 +572,7 @@ void EnFz_SetupMelt(EnFz* this) { this->state = 3; this->isFreezing = false; this->isDespawning = true; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = 0.0f; this->speedXZ = 0.0f; this->actionFunc = EnFz_Melt; @@ -603,7 +603,7 @@ void EnFz_SetupBlowSmokeStationary(EnFz* this) { this->timer = 40; this->updateBgInfo = true; this->isFreezing = true; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnFz_BlowSmokeStationary; this->actor.gravity = -1.0f; } @@ -622,7 +622,7 @@ void EnFz_BlowSmokeStationary(EnFz* this, PlayState* play) { } else { isTimerMod8 = false; primAlpha = 150; - func_8002F974(&this->actor, NA_SE_EN_FREEZAD_BREATH - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_FREEZAD_BREATH - SFX_FLAG); if ((this->counter & 0x3F) >= 48) { primAlpha = 630 - ((this->counter & 0x3F) * 10); @@ -722,8 +722,6 @@ void EnFz_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_fz.c", 1167); - if (1) {} - if (this->actor.colChkInfo.health == 0) { index = 2; } @@ -734,8 +732,7 @@ void EnFz_Draw(Actor* thisx, PlayState* play) { gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, play->state.frames & 0x7F, 32, 32, 1, 0, (2 * play->state.frames) & 0x7F, 32, 32)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_fz.c", 1183), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_fz.c", 1183); gDPSetCombineLERP(POLY_XLU_DISP++, TEXEL1, PRIMITIVE, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIMITIVE, TEXEL0, PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, COMBINED, 0, ENVIRONMENT, 0); gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, 155, 255, 255, 255); @@ -884,8 +881,7 @@ void EnFz_DrawEffects(EnFz* this, PlayState* play) { Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->xyScale, effect->xyScale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_fz.c", 1424), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_fz.c", 1424); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gFreezardSteamDL)); } diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.h b/src/overlays/actors/ovl_En_Fz/z_en_fz.h index dafada3d25..a7fa2d7134 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.h +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.h @@ -9,7 +9,7 @@ struct EnFz; typedef void (*EnFzActionFunc)(struct EnFz*, PlayState*); typedef void (*EnFzSpawnIceSmokeFunc)(struct EnFz*); -typedef struct { +typedef struct EnFzEffect { /* 0x0000 */ u8 type; // 0,1,2: State of freezard (1 not freezing, 2 freezing) /* 0x0001 */ u8 timer; // increments primAlphaState after reaching 7 (freezing), used in Gfx_TwoTexScroll /* 0x0004 */ Vec3f pos; // Random position within 20.0f of actor diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index dfb9f989e7..1be4c0de36 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -14,7 +14,7 @@ #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) -typedef enum { +typedef enum GSwitchMoveState { /* 0 */ MOVE_TARGET, /* 1 */ MOVE_HOME } GSwitchMoveState; @@ -41,7 +41,7 @@ static s16 sCollectedCount = 0; static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -49,7 +49,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -64,7 +64,7 @@ static s16 sRupeeTypes[] = { ITEM00_RUPEE_GREEN, ITEM00_RUPEE_BLUE, ITEM00_RUPEE_RED, ITEM00_RUPEE_ORANGE, ITEM00_RUPEE_PURPLE, }; -ActorInit En_G_Switch_InitVars = { +ActorProfile En_G_Switch_Profile = { /**/ ACTOR_EN_G_SWITCH, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -82,8 +82,8 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { if (play) {} - this->type = (this->actor.params >> 0xC) & 0xF; - this->switchFlag = this->actor.params & 0x3F; + this->type = PARAMS_GET_U(this->actor.params, 12, 4); + this->switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); this->numEffects = EN_GSWITCH_EFFECT_COUNT; // "index" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ インデックス ☆☆☆☆☆ %x\n" VT_RST, this->type); @@ -95,7 +95,9 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { // "parent switch spawn" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 親スイッチ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); sCollectedCount = 0; - this->silverCount = this->actor.params >> 6; + // Ideally the following two lines would be + // this->silverCount = PARAMS_GET_U(this->actor.params, 6, 6); + this->silverCount = PARAMS_GET_NOMASK(this->actor.params, 6); this->silverCount &= 0x3F; // "maximum number of checks" PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 最大チェック数 ☆☆☆☆☆ %d\n" VT_RST, this->silverCount); @@ -454,17 +456,14 @@ void EnGSwitch_Update(Actor* thisx, PlayState* play) { } void EnGSwitch_DrawPot(Actor* thisx, PlayState* play) { - s32 pad; + PlayState* play2 = (PlayState*)play; EnGSwitch* this = (EnGSwitch*)thisx; if (!this->broken) { OPEN_DISPS(play->state.gfxCtx, "../z_en_g_switch.c", 918); - if (1) {} - - Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_g_switch.c", 925), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + Gfx_SetupDL_25Opa(play2->state.gfxCtx); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_g_switch.c", 925); gSPDisplayList(POLY_OPA_DISP++, object_tsubo_DL_0017C0); CLOSE_DISPS(play->state.gfxCtx, "../z_en_g_switch.c", 928); } @@ -475,24 +474,22 @@ static void* sRupeeTextures[] = { }; void EnGSwitch_DrawRupee(Actor* thisx, PlayState* play) { - s32 pad; + PlayState* play2 = (PlayState*)play; EnGSwitch* this = (EnGSwitch*)thisx; IF_F3DEX3_DONT_SKIP_TEX_INIT(); - if (1) {} if (!this->broken) { OPEN_DISPS(play->state.gfxCtx, "../z_en_g_switch.c", 951); Gfx_SetupDL_25Opa(play->state.gfxCtx); func_8002EBCC(&this->actor, play, 0); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_g_switch.c", 957), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_g_switch.c", 957); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sRupeeTextures[this->colorIdx])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_OPA_DISP++, this->colorIdx); gSPDisplayList(POLY_OPA_DISP++, gRupeeDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_g_switch.c", 961); } if (this->type == ENGSWITCH_TARGET_RUPEE) { - EnGSwitch_DrawEffects(this, play); + EnGSwitch_DrawEffects(this, play2); } } @@ -570,8 +567,7 @@ void EnGSwitch_DrawEffects(EnGSwitch* this, PlayState* play) { Matrix_RotateX(effect->rot.x, MTXMODE_APPLY); Matrix_RotateY(effect->rot.y, MTXMODE_APPLY); Matrix_RotateZ(effect->rot.z, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_g_switch.c", 1088), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_g_switch.c", 1088); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sRupeeTextures[effect->colorIdx])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_OPA_DISP++, effect->colorIdx); gSPDisplayList(POLY_OPA_DISP++, gRupeeDL); diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h index 3631d11704..58e19ea9c1 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h @@ -8,7 +8,7 @@ struct EnGSwitch; typedef void (*EnGSwitchActionFunc)(struct EnGSwitch*, PlayState*); -typedef enum { +typedef enum EnGSwitchMoveMode { /* 0 */ GSWITCH_NONE, /* 1 */ GSWITCH_APPEAR, /* 2 */ GSWITCH_THROW, @@ -17,7 +17,7 @@ typedef enum { /* 5 */ GSWITCH_RIGHT } EnGSwitchMoveMode; -typedef enum { +typedef enum EnGSwitchType { /* 0 */ ENGSWITCH_SILVER_TRACKER, /* 1 */ ENGSWITCH_SILVER_RUPEE, /* 2 */ ENGSWITCH_ARCHERY_POT, @@ -26,7 +26,7 @@ typedef enum { #define EN_GSWITCH_EFFECT_COUNT 100 -typedef struct { +typedef struct EnGSwitchEffect { /* 0x00 */ Vec3f pos; /* 0x0C */ s16 scale; /* 0x0E */ s16 timer; diff --git a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c index 2ccb862d62..0153109acd 100644 --- a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c +++ b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c @@ -14,7 +14,7 @@ void EnGanonMant_Destroy(Actor* thisx, PlayState* play); void EnGanonMant_Update(Actor* thisx, PlayState* play); void EnGanonMant_Draw(Actor* thisx, PlayState* play); -ActorInit En_Ganon_Mant_InitVars = { +ActorProfile En_Ganon_Mant_Profile = { /**/ ACTOR_EN_GANON_MANT, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -38,7 +38,7 @@ static s16 sTearSizesSmall[] = { 0, 0, 0, 0, 0, 0, 0, }; -typedef struct { +typedef struct TearShape { s16* tearAreaSizes; s16 count; } TearShape; // size = 0x8 @@ -102,7 +102,7 @@ static u64 sForceAlignment = 0; void EnGanonMant_Init(Actor* thisx, PlayState* play) { EnGanonMant* this = (EnGanonMant*)thisx; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } void EnGanonMant_Destroy(Actor* thisx, PlayState* play) { @@ -361,8 +361,7 @@ void EnGanonMant_DrawCloak(PlayState* play, EnGanonMant* this) { Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_NEW); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ganon_mant.c", 572), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_ganon_mant.c", 572); // set texture gSPDisplayList(POLY_OPA_DISP++, gMantMaterialDL); @@ -426,7 +425,7 @@ void EnGanonMant_Draw(Actor* thisx, PlayState* play) { midpoint.y = rightPos->y + yDiff * 0.5f; midpoint.z = rightPos->z + zDiff * 0.5f; - // Calculte base orientation for chosen endpoints + // Calculate base orientation for chosen endpoints yaw = Math_Atan2F(zDiff, xDiff); pitch = -Math_Atan2F(sqrtf(SQ(xDiff) + SQ(zDiff)), yDiff); diffHalfDist = sqrtf(SQ(xDiff) + SQ(yDiff) + SQ(zDiff)) * 0.5f; diff --git a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h index 3b416e59eb..f319bfbf83 100644 --- a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h +++ b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h @@ -9,7 +9,7 @@ struct EnGanonMant; #define GANON_MANT_NUM_JOINTS 12 #define GANON_MANT_NUM_STRANDS 12 -typedef struct { +typedef struct MantStrand { /* 0x000 */ Vec3f root; // root position along the collar /* 0x00C */ Vec3f joints[GANON_MANT_NUM_JOINTS]; // "joints" for deforming the cloak, stemming from root and propagating down the cloak /* 0x090 */ Vec3f rotations[GANON_MANT_NUM_JOINTS]; // normal vector rotations, x and y only diff --git a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c index a4c93dea9c..1a36f849ac 100644 --- a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c +++ b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c @@ -14,7 +14,7 @@ void EnGanonOrgan_Destroy(Actor* thisx, PlayState* play); void EnGanonOrgan_Update(Actor* thisx, PlayState* play); void EnGanonOrgan_Draw(Actor* thisx, PlayState* play); -ActorInit En_Ganon_Organ_InitVars = { +ActorProfile En_Ganon_Organ_Profile = { /**/ ACTOR_EN_GANON_ORGAN, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -31,7 +31,7 @@ static u64 sForceAlignment = 0; #include "assets/overlays/ovl_En_Ganon_Organ/ovl_En_Ganon_Organ.c" void EnGanonOrgan_Init(Actor* thisx, PlayState* play) { - thisx->flags &= ~ACTOR_FLAG_0; + thisx->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } void EnGanonOrgan_Destroy(Actor* thisx, PlayState* play) { @@ -65,11 +65,9 @@ Gfx* func_80A280BC(GraphicsContext* gfxCtx, BossGanon* dorf) { displayList = GRAPH_ALLOC(gfxCtx, 4 * sizeof(Gfx)); displayListHead = displayList; gDPPipeSync(displayListHead++); - if (1) {} - if (1) {} gDPSetEnvColor(displayListHead++, 25, 20, 0, dorf->organAlpha); gDPSetRenderMode(displayListHead++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2); - gSPEndDisplayList(displayListHead); + gSPEndDisplayList(displayListHead++); return displayList; } @@ -79,13 +77,10 @@ Gfx* func_80A28148(GraphicsContext* gfxCtx, BossGanon* dorf) { displayList = GRAPH_ALLOC(gfxCtx, 4 * sizeof(Gfx)); displayListHead = displayList; - gDPPipeSync(displayListHead++); - if (1) {} - if (1) {} gDPSetEnvColor(displayListHead++, 0, 0, 0, dorf->organAlpha); gDPSetRenderMode(displayListHead++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2); - gSPEndDisplayList(displayListHead); + gSPEndDisplayList(displayListHead++); return displayList; } @@ -104,8 +99,7 @@ void EnGanonOrgan_Draw(Actor* thisx, PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x09, EnGanonOrgan_EmptyDList(play->state.gfxCtx)); } Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_NEW); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ganon_organ.c", 221), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_ganon_organ.c", 221); gSPDisplayList(POLY_OPA_DISP++, sRoomOrganAndFloorDL); gSPDisplayList(POLY_OPA_DISP++, sRoomStatuesDL); diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/src/overlays/actors/ovl_En_Gb/z_en_gb.c index bbad43c838..8488152086 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -7,7 +7,7 @@ #include "z_en_gb.h" #include "assets/objects/object_ps/object_ps.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnGb_Init(Actor* thisx, PlayState* play); void EnGb_Destroy(Actor* thisx, PlayState* play); @@ -26,7 +26,7 @@ void func_80A2FC0C(EnGb* this, PlayState* play); void EnGb_DrawCagedSouls(EnGb* this, PlayState* play); void EnGb_UpdateCagedSouls(EnGb* this, PlayState* play); -ActorInit En_Gb_InitVars = { +ActorProfile En_Gb_Profile = { /**/ ACTOR_EN_GB, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -46,14 +46,14 @@ static EnGbCagedSoulInfo sCagedSoulInfo[] = { static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -66,14 +66,14 @@ static ColliderCylinderInitType1 sCylinderInit = { static ColliderCylinderInitType1 sBottlesCylindersInit[] = { { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -84,14 +84,14 @@ static ColliderCylinderInitType1 sBottlesCylindersInit[] = { }, { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -102,14 +102,14 @@ static ColliderCylinderInitType1 sBottlesCylindersInit[] = { }, { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -121,8 +121,8 @@ static ColliderCylinderInitType1 sBottlesCylindersInit[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 6, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 2200, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_6, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 2200, ICHAIN_STOP), }; // relative positions of poe souls @@ -176,7 +176,7 @@ void EnGb_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); Actor_SetScale(&this->dyna.actor, 0.01f); - this->dyna.actor.colChkInfo.mass = 0xFF; + this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; this->dyna.actor.speed = 0.0f; this->dyna.actor.velocity.y = 0.0f; this->dyna.actor.gravity = -1.0f; @@ -547,8 +547,7 @@ void EnGb_DrawCagedSouls(EnGb* this, PlayState* play) { } Matrix_Scale(0.007f, 0.007f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_gb.c", 955), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_gb.c", 955); gSPDisplayList(POLY_XLU_DISP++, gPoeSellerCagedSoulDL); Matrix_Pop(); diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.h b/src/overlays/actors/ovl_En_Gb/z_en_gb.h index 99694a59e9..4005075c4c 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.h +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.h @@ -8,14 +8,14 @@ struct EnGb; typedef void (*EnGbActionFunc)(struct EnGb*, PlayState*); -typedef struct { +typedef struct EnGbCagedSoulInfo { /* 0x00 */ Color_RGBA8 prim; /* 0x04 */ Color_RGBA8 env; /* 0x08 */ void* texture; /* 0x0C */ s16 timerMultiplier; } EnGbCagedSoulInfo; // size = 0x10 -typedef struct { +typedef struct EnGbCagedSoul { /* 0x00 */ u8 infoIdx; /* 0x01 */ u8 unk_1; /* 0x02 */ u8 unk_2; diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 405cfc0664..6147ab7a25 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -8,14 +8,14 @@ #include "terminal.h" #include "assets/objects/object_ge1/object_ge1.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) #define GE1_STATE_TALKING (1 << 0) #define GE1_STATE_GIVE_QUIVER (1 << 1) #define GE1_STATE_IDLE_ANIM (1 << 2) #define GE1_STATE_STOP_FIDGET (1 << 3) -typedef enum { +typedef enum EnGe1Hairstyle { /* 00 */ GE1_HAIR_BOB, /* 01 */ GE1_HAIR_STRAIGHT, /* 02 */ GE1_HAIR_SPIKY @@ -39,7 +39,7 @@ void EnGe1_Wait_Archery(EnGe1* this, PlayState* play); void EnGe1_CueUpAnimation(EnGe1* this); void EnGe1_StopFidget(EnGe1* this); -ActorInit En_Ge1_InitVars = { +ActorProfile En_Ge1_Profile = { /**/ ACTOR_EN_GE1, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -53,7 +53,7 @@ ActorInit En_Ge1_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, @@ -61,7 +61,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000702, 0x00, 0x00 }, ATELEM_NONE, @@ -98,12 +98,12 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->animation = &gGerudoWhiteIdleAnim; this->animFunc = EnGe1_CueUpAnimation; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; Actor_SetScale(&this->actor, 0.01f); this->actor.uncullZoneForward = ((play->sceneId == SCENE_GERUDO_VALLEY) ? 1000.0f : 1200.0f); - switch (this->actor.params & 0xFF) { + switch (PARAMS_GET_U(this->actor.params, 0, 8)) { case GE1_TYPE_GATE_GUARD: this->hairstyle = GE1_HAIR_SPIKY; @@ -146,7 +146,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); return; } - this->actor.targetMode = 3; + this->actor.attentionRangeType = ATTENTION_RANGE_3; this->hairstyle = GE1_HAIR_BOB; // "Horseback archery Gerudo EVENT_INF(0) =" PRINTF(VT_FGCOL(CYAN) "やぶさめ ゲルド EVENT_INF(0) = %x\n" VT_RST, gSaveContext.eventInf[0]); @@ -329,7 +329,7 @@ void EnGe1_WaitTillOpened_GTGGuard(EnGe1* this, PlayState* play) { void EnGe1_Open_GTGGuard(EnGe1* this, PlayState* play) { if (this->stateFlags & GE1_STATE_IDLE_ANIM) { this->actionFunc = EnGe1_WaitTillOpened_GTGGuard; - Flags_SetSwitch(play, (this->actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); this->cutsceneTimer = 50; Message_CloseTextbox(play); } else if ((this->skelAnime.curFrame == 15.0f) || (this->skelAnime.curFrame == 19.0f)) { @@ -422,7 +422,7 @@ void EnGe1_WaitUntilGateOpened_GateOp(EnGe1* this, PlayState* play) { void EnGe1_OpenGate_GateOp(EnGe1* this, PlayState* play) { if (this->stateFlags & GE1_STATE_IDLE_ANIM) { this->actionFunc = EnGe1_WaitUntilGateOpened_GateOp; - Flags_SetSwitch(play, (this->actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); this->cutsceneTimer = 50; Message_CloseTextbox(play); } else if ((this->skelAnime.curFrame == 15.0f) || (this->skelAnime.curFrame == 19.0f)) { @@ -444,7 +444,7 @@ void EnGe1_SetupOpenGate_GateOp(EnGe1* this, PlayState* play) { } void EnGe1_CheckGate_GateOp(EnGe1* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { EnGe1_SetTalkAction(this, play, 0x6018, 100.0f, EnGe1_WaitGateOpen_GateOp); } else { EnGe1_SetTalkAction(this, play, 0x6017, 100.0f, EnGe1_SetupOpenGate_GateOp); @@ -518,7 +518,7 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, PlayState* play) { s32 getItemId; if (Actor_TextboxIsClosing(&this->actor, play)) { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->actionFunc = EnGe1_WaitTillItemGiven_Archery; } @@ -545,7 +545,7 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, PlayState* play) { void EnGe1_TalkWinPrize_Archery(EnGe1* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, play)) { this->actionFunc = EnGe1_BeginGiveItem_Archery; - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } else { Actor_OfferTalk(&this->actor, play, 200.0f); } @@ -567,7 +567,7 @@ void EnGe1_BeginGame_Archery(EnGe1* this, PlayState* play) { Actor* horse; if ((Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play)) { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; switch (play->msgCtx.choiceIndex) { case 0: @@ -627,7 +627,7 @@ void EnGe1_TalkAfterGame_Archery(EnGe1* this, PlayState* play) { // With the current `SaveContext` struct definition, the expression in the debug string is an out-of-bounds read, // see the other occurrence of this for more details. LOG_NUM("z_common_data.memory.information.room_inf[127][ 0 ]", HIGH_SCORE(HS_HBA), "../z_en_ge1.c", 1111); - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; if (HIGH_SCORE(HS_HBA) < gSaveContext.minigameScore) { HIGH_SCORE(HS_HBA) = gSaveContext.minigameScore; diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h index f286ce3146..7fb1692f62 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h @@ -9,7 +9,7 @@ struct EnGe1; typedef void (*EnGe1AnimFunc)(struct EnGe1*); typedef void (*EnGe1ActionFunc)(struct EnGe1*, PlayState*); -typedef enum { +typedef enum EnGe1Type { /* 0x00 */ GE1_TYPE_GATE_GUARD, /* 0x01 */ GE1_TYPE_GATE_OPERATOR, /* 0x04 */ GE1_TYPE_NORMAL = 4, @@ -18,7 +18,7 @@ typedef enum { /* 0x46 */ GE1_TYPE_TRAINING_GROUNDS_GUARD } EnGe1Type; -typedef enum { +typedef enum EnGe1Limb { /* 00 */ GE1_LIMB_NONE, /* 01 */ GE1_LIMB_WAIST, /* 02 */ GE1_LIMB_L_THIGH, diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 40b2b9df58..da5b380082 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -8,20 +8,20 @@ #include "terminal.h" #include "assets/objects/object_gla/object_gla.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) #define GE2_STATE_ANIMCOMPLETE (1 << 1) #define GE2_STATE_KO (1 << 2) #define GE2_STATE_CAPTURING (1 << 3) #define GE2_STATE_TALKED (1 << 4) -typedef enum { +typedef enum EnGe2Type { /* 0 */ GE2_TYPE_PATROLLING, /* 1 */ GE2_TYPE_STATIONARY, /* 2 */ GE2_TYPE_GERUDO_CARD_GIVER } EnGe2Type; -typedef enum { +typedef enum EnGe2Action { /* 0 */ GE2_ACTION_WALK, /* 1 */ GE2_ACTION_ABOUTTURN, /* 2 */ GE2_ACTION_TURNPLAYERSPOTTED, @@ -55,7 +55,7 @@ void EnGe2_UpdateFriendly(Actor* thisx, PlayState* play); void EnGe2_UpdateAfterTalk(Actor* thisx, PlayState* play); void EnGe2_UpdateStunned(Actor* thisx, PlayState* play2); -ActorInit En_Ge2_InitVars = { +ActorProfile En_Ge2_Profile = { /**/ ACTOR_EN_GE2, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -69,7 +69,7 @@ ActorInit En_Ge2_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -77,7 +77,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x000007A2, 0x00, 0x00 }, ATELEM_NONE, @@ -133,26 +133,26 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { this->actor.world.rot.z = 0; this->actor.shape.rot.z = 0; - switch (thisx->params & 0xFF) { + switch (PARAMS_GET_S(thisx->params, 0, 8)) { case GE2_TYPE_PATROLLING: EnGe2_ChangeAction(this, GE2_ACTION_WALK); if (EnGe2_CheckCarpentersFreed()) { this->actor.update = EnGe2_UpdateFriendly; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; } break; case GE2_TYPE_STATIONARY: EnGe2_ChangeAction(this, GE2_ACTION_STAND); if (EnGe2_CheckCarpentersFreed()) { this->actor.update = EnGe2_UpdateFriendly; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; } break; case GE2_TYPE_GERUDO_CARD_GIVER: EnGe2_ChangeAction(this, GE2_ACTION_WAITLOOKATPLAYER); this->actor.update = EnGe2_UpdateAfterTalk; this->actionFunc = EnGe2_ForceTalk; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; break; default: ASSERT(0, "0", "../z_en_ge2.c", 418); @@ -166,7 +166,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { this->actor.minVelocityY = -4.0f; this->actor.gravity = -1.0f; this->walkDirection = this->actor.world.rot.y; - this->walkDuration = ((thisx->params & 0xFF00) >> 8) * 10; + this->walkDuration = PARAMS_GET_S(thisx->params, 8, 8) * 10; } void EnGe2_Destroy(Actor* thisx, PlayState* play) { @@ -298,7 +298,7 @@ void EnGe2_KnockedOut(EnGe2* this, PlayState* play) { s32 effectAngle; Vec3f effectPos; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if (this->stateFlags & GE2_STATE_ANIMCOMPLETE) { effectAngle = (play->state.frames) * 0x2800; effectPos.x = this->actor.focus.pos.x + (Math_CosS(effectAngle) * 5.0f); @@ -426,7 +426,7 @@ void EnGe2_LookAtPlayer(EnGe2* this, PlayState* play) { void EnGe2_SetActionAfterTalk(EnGe2* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { - switch (this->actor.params & 0xFF) { + switch (PARAMS_GET_S(this->actor.params, 0, 8)) { case GE2_TYPE_PATROLLING: EnGe2_ChangeAction(this, GE2_ACTION_ABOUTTURN); break; @@ -438,7 +438,7 @@ void EnGe2_SetActionAfterTalk(EnGe2* this, PlayState* play) { break; } this->actor.update = EnGe2_UpdateFriendly; - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } EnGe2_TurnToFacePlayer(this, play); } @@ -459,7 +459,7 @@ void EnGe2_WaitTillCardGiven(EnGe2* this, PlayState* play) { void EnGe2_GiveCard(EnGe2* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->actionFunc = EnGe2_WaitTillCardGiven; Actor_OfferGetItem(&this->actor, play, GI_GERUDOS_CARD, 10000.0f, 50.0f); } @@ -471,7 +471,7 @@ void EnGe2_ForceTalk(EnGe2* this, PlayState* play) { this->actionFunc = EnGe2_GiveCard; } else { this->actor.textId = 0x6004; - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Actor_OfferTalkExchange(&this->actor, play, 300.0f, 300.0f, EXCH_ITEM_NONE); } EnGe2_LookAtPlayer(this, play); @@ -521,7 +521,7 @@ void EnGe2_UpdateFriendly(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (Actor_TalkOfferAccepted(&this->actor, play)) { - if ((this->actor.params & 0xFF) == GE2_TYPE_PATROLLING) { + if (PARAMS_GET_S(this->actor.params, 0, 8) == GE2_TYPE_PATROLLING) { this->actor.speed = 0.0f; EnGe2_ChangeAction(this, GE2_ACTION_WAITLOOKATPLAYER); } @@ -578,7 +578,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { EnGe2_SetupCapturePlayer(this, play); } - if (((this->actor.params & 0xFF) == GE2_TYPE_STATIONARY) && (this->actor.xzDistToPlayer < 100.0f)) { + if ((PARAMS_GET_S(this->actor.params, 0, 8) == GE2_TYPE_STATIONARY) && (this->actor.xzDistToPlayer < 100.0f)) { // "Discovered!" PRINTF(VT_FGCOL(GREEN) "発見!!!!!!!!!!!!\n" VT_RST); EnGe2_SetupCapturePlayer(this, play); @@ -586,7 +586,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { } if (!(this->stateFlags & GE2_STATE_KO)) { - paramsType = this->actor.params & 0xFF; // Not necessary, but looks a bit nicer + paramsType = PARAMS_GET_S(this->actor.params, 0, 8); // Not necessary, but looks a bit nicer if ((paramsType == GE2_TYPE_PATROLLING) || (paramsType == GE2_TYPE_STATIONARY)) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } @@ -595,7 +595,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { if (EnGe2_CheckCarpentersFreed() && !(this->stateFlags & GE2_STATE_KO)) { this->actor.update = EnGe2_UpdateFriendly; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; } } @@ -621,7 +621,7 @@ void EnGe2_UpdateStunned(Actor* thisx, PlayState* play2) { if (EnGe2_CheckCarpentersFreed()) { this->actor.update = EnGe2_UpdateFriendly; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->actor.colorFilterTimer = 0; } else if (this->actor.colorFilterTimer == 0) { this->actor.update = EnGe2_Update; diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index df33dc59e3..c49252ace7 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -6,8 +6,9 @@ #include "z_en_ge3.h" #include "assets/objects/object_geldb/object_geldb.h" +#include "versions.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) void EnGe3_Init(Actor* thisx, PlayState* play2); void EnGe3_Destroy(Actor* thisx, PlayState* play); @@ -18,7 +19,7 @@ void EnGe3_WaitLookAtPlayer(EnGe3* this, PlayState* play); void EnGe3_ForceTalk(EnGe3* this, PlayState* play); void EnGe3_UpdateWhenNotTalking(Actor* thisx, PlayState* play); -ActorInit En_Ge3_InitVars = { +ActorProfile En_Ge3_Profile = { /**/ ACTOR_EN_GE3, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -32,7 +33,7 @@ ActorInit En_Ge3_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -40,7 +41,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000722, 0x00, 0x00 }, ATELEM_NONE, @@ -80,7 +81,7 @@ void EnGe3_Init(Actor* thisx, PlayState* play2) { EnGe3_ChangeAction(this, 0); this->actionFunc = EnGe3_ForceTalk; this->unk_30C = 0; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->actor.minVelocityY = -4.0f; this->actor.gravity = -1.0f; } @@ -127,7 +128,7 @@ void EnGe3_Wait(EnGe3* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { this->actionFunc = EnGe3_WaitLookAtPlayer; this->actor.update = EnGe3_UpdateWhenNotTalking; - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } EnGe3_TurnToFacePlayer(this, play); } @@ -148,7 +149,7 @@ void EnGe3_WaitTillCardGiven(EnGe3* this, PlayState* play) { void EnGe3_GiveCard(EnGe3* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->actionFunc = EnGe3_WaitTillCardGiven; Actor_OfferGetItem(&this->actor, play, GI_GERUDOS_CARD, 10000.0f, 50.0f); } @@ -163,7 +164,7 @@ void EnGe3_ForceTalk(EnGe3* this, PlayState* play) { this->unk_30C |= 4; } this->actor.textId = 0x6004; - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Actor_OfferTalkExchange(&this->actor, play, 300.0f, 300.0f, EXCH_ITEM_NONE); } EnGe3_LookAtPlayer(this, play); @@ -237,9 +238,11 @@ s32 EnGe3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p // Turn head case GELDB_LIMB_HEAD: rot->x += this->headRot.y; +#if OOT_VERSION >= PAL_1_1 FALLTHROUGH; - // This is a hack to fix the color-changing clothes this Gerudo has on N64 versions default: + // This is a hack to fix a bug present before PAL 1.1, where the actor's clothes can change color + // depending on what was drawn earlier in the frame. OPEN_DISPS(play->state.gfxCtx, "../z_en_ge3.c", 547); switch (limbIndex) { case GELDB_LIMB_NECK: @@ -260,6 +263,7 @@ s32 EnGe3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p break; } CLOSE_DISPS(play->state.gfxCtx, "../z_en_ge3.c", 566); +#endif break; } return false; diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 8ef486c42c..4c1a386975 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -7,9 +7,9 @@ #include "z_en_geldb.h" #include "assets/objects/object_geldb/object_geldb.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) -typedef enum { +typedef enum EnGeldBAction { /* 0 */ GELDB_WAIT, /* 1 */ GELDB_DEFEAT, /* 2 */ GELDB_DAMAGED, @@ -69,7 +69,7 @@ void EnGeldB_Block(EnGeldB* this, PlayState* play); void EnGeldB_Sidestep(EnGeldB* this, PlayState* play); void EnGeldB_Defeated(EnGeldB* this, PlayState* play); -ActorInit En_GeldB_InitVars = { +ActorProfile En_GeldB_Profile = { /**/ ACTOR_EN_GELDB, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -83,7 +83,7 @@ ActorInit En_GeldB_InitVars = { static ColliderCylinderInit sBodyCylInit = { { - COLTYPE_HIT5, + COL_MATERIAL_HIT5, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -91,7 +91,7 @@ static ColliderCylinderInit sBodyCylInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -104,7 +104,7 @@ static ColliderCylinderInit sBodyCylInit = { static ColliderTrisElementInit sBlockTrisElementsInit[2] = { { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0xFFC1FFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -115,7 +115,7 @@ static ColliderTrisElementInit sBlockTrisElementsInit[2] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0xFFC1FFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -128,7 +128,7 @@ static ColliderTrisElementInit sBlockTrisElementsInit[2] = { static ColliderTrisInit sBlockTrisInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, @@ -141,7 +141,7 @@ static ColliderTrisInit sBlockTrisInit = { static ColliderQuadInit sSwordQuadInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -149,7 +149,7 @@ static ColliderQuadInit sSwordQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL | ATELEM_UNK7, @@ -159,7 +159,7 @@ static ColliderQuadInit sSwordQuadInit = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -typedef enum { +typedef enum EnGeldBDamageEffects { /* 0x0 */ GELDB_DMG_NORMAL, /* 0x1 */ GELDB_DMG_STUN, /* 0x6 */ GELDB_DMG_UNK_6 = 0x6, @@ -204,7 +204,7 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3000, ICHAIN_STOP), }; @@ -228,7 +228,7 @@ void EnGeldB_Init(Actor* thisx, PlayState* play) { thisx->colChkInfo.cylRadius = 50; thisx->colChkInfo.cylHeight = 100; thisx->naviEnemyId = NAVI_ENEMY_GERUDO_THIEF; - this->keyFlag = thisx->params & 0xFF00; + this->keyFlag = PARAMS_GET_NOSHIFT(thisx->params, 8, 8); thisx->params &= 0xFF; this->blinkState = 0; this->unkFloat = 10.0f; @@ -334,7 +334,7 @@ s32 EnGeldB_ReactToPlayer(PlayState* play, EnGeldB* this, s16 arg2) { } else { s16 angleToFacingLink = player->actor.shape.rot.y - thisx->shape.rot.y; - if ((thisx->xzDistToPlayer <= 45.0f) && !Actor_OtherIsTargeted(play, thisx) && + if ((thisx->xzDistToPlayer <= 45.0f) && !Actor_OtherIsLockedOn(play, thisx) && ((play->gameplayFrames & 7) || (ABS(angleToFacingLink) < 0x38E0))) { EnGeldB_SetupSlash(this); return true; @@ -355,7 +355,7 @@ void EnGeldB_SetupWait(EnGeldB* this) { this->action = GELDB_WAIT; this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH); this->actor.gravity = -2.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnGeldB_SetupAction(this, EnGeldB_Wait); } @@ -372,7 +372,7 @@ void EnGeldB_Wait(EnGeldB* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_DOWN); this->skelAnime.playSpeed = 1.0f; this->actor.world.pos.y = this->actor.floorHeight; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.focus.pos = this->actor.world.pos; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH; this->actor.velocity.y = 0.0f; @@ -456,7 +456,7 @@ void EnGeldB_Ready(EnGeldB* this, PlayState* play) { if (Actor_IsFacingPlayer(&this->actor, 30 * 0x10000 / 360)) { if ((210.0f > this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 150.0f) && (Rand_ZeroOne() < 0.3f)) { - if (Actor_OtherIsTargeted(play, &this->actor) || (Rand_ZeroOne() > 0.5f) || + if (Actor_OtherIsLockedOn(play, &this->actor) || (Rand_ZeroOne() > 0.5f) || (ABS(angleToLink) < 0x38E0)) { EnGeldB_SetupRollForward(this); } else { @@ -525,10 +525,10 @@ void EnGeldB_Advance(EnGeldB* this, PlayState* play) { EnGeldB_SetupReady(this); } } else if (this->actor.xzDistToPlayer < 90.0f) { - if (!Actor_OtherIsTargeted(play, &this->actor) && + if (!Actor_OtherIsLockedOn(play, &this->actor) && (Rand_ZeroOne() > 0.03f || (this->actor.xzDistToPlayer <= 45.0f && facingAngletoLink < 0x38E0))) { EnGeldB_SetupSlash(this); - } else if (Actor_OtherIsTargeted(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { + } else if (Actor_OtherIsLockedOn(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { EnGeldB_SetupRollBack(this); } else { EnGeldB_SetupCircle(this); @@ -537,7 +537,7 @@ void EnGeldB_Advance(EnGeldB* this, PlayState* play) { if (!EnGeldB_ReactToPlayer(play, this, 0)) { if ((this->actor.xzDistToPlayer < 210.0f) && (this->actor.xzDistToPlayer > 150.0f) && Actor_IsFacingPlayer(&this->actor, 0x71C)) { - if (Actor_IsTargeted(play, &this->actor)) { + if (Actor_IsLockedOn(play, &this->actor)) { if (Rand_ZeroOne() > 0.5f) { EnGeldB_SetupRollForward(this); } else { @@ -588,7 +588,7 @@ void EnGeldB_RollForward(EnGeldB* this, PlayState* play) { if (ABS(facingAngleToLink) < 0x38E0) { this->lookTimer = 20; } - } else if (!Actor_OtherIsTargeted(play, &this->actor) && + } else if (!Actor_OtherIsLockedOn(play, &this->actor) && (Rand_ZeroOne() > 0.5f || (ABS(facingAngleToLink) < 0x3FFC))) { EnGeldB_SetupSlash(this); } else { @@ -728,10 +728,10 @@ void EnGeldB_Circle(EnGeldB* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_BREATH); } if ((Math_CosS(angleBehindLink - this->actor.shape.rot.y) < -0.85f) && - !Actor_OtherIsTargeted(play, &this->actor) && (this->actor.xzDistToPlayer <= 45.0f)) { + !Actor_OtherIsLockedOn(play, &this->actor) && (this->actor.xzDistToPlayer <= 45.0f)) { EnGeldB_SetupSlash(this); } else if (--this->timer == 0) { - if (Actor_OtherIsTargeted(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { + if (Actor_OtherIsLockedOn(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { EnGeldB_SetupRollBack(this); } else { EnGeldB_SetupReady(this); @@ -827,7 +827,7 @@ void EnGeldB_SpinDodge(EnGeldB* this, PlayState* play) { if (this->timer == 0) { this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (!EnGeldB_DodgeRanged(play, this)) { - if (!Actor_OtherIsTargeted(play, &this->actor) && (this->actor.xzDistToPlayer <= 70.0f)) { + if (!Actor_OtherIsLockedOn(play, &this->actor) && (this->actor.xzDistToPlayer <= 70.0f)) { EnGeldB_SetupSlash(this); } else { EnGeldB_SetupRollBack(this); @@ -923,7 +923,7 @@ void EnGeldB_SpinAttack(EnGeldB* this, PlayState* play) { } else if (this->swordCollider.base.atFlags & AT_HIT) { this->swordCollider.base.atFlags &= ~AT_HIT; if (&player->actor == this->swordCollider.base.at) { - func_8002F71C(play, &this->actor, 6.0f, this->actor.yawTowardsPlayer, 6.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 6.0f, this->actor.yawTowardsPlayer, 6.0f); this->spinAttackState = 2; Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_24); Message_StartTextbox(play, 0x6003, &this->actor); @@ -994,7 +994,7 @@ void EnGeldB_SetupRollBack(EnGeldB* this) { void EnGeldB_RollBack(EnGeldB* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { - if (!Actor_OtherIsTargeted(play, &this->actor) && (this->actor.xzDistToPlayer < 170.0f) && + if (!Actor_OtherIsLockedOn(play, &this->actor) && (this->actor.xzDistToPlayer < 170.0f) && (this->actor.xzDistToPlayer > 140.0f) && (Rand_ZeroOne() < 0.2f)) { EnGeldB_SetupSpinAttack(this); } else if (play->gameplayFrames & 1) { @@ -1077,7 +1077,7 @@ void EnGeldB_Damaged(EnGeldB* this, PlayState* play) { (this->actor.xzDistToPlayer < 90.0f)) { EnGeldB_SetupJump(this); } else if (!EnGeldB_DodgeRanged(play, this)) { - if ((this->actor.xzDistToPlayer <= 45.0f) && !Actor_OtherIsTargeted(play, &this->actor) && + if ((this->actor.xzDistToPlayer <= 45.0f) && !Actor_OtherIsLockedOn(play, &this->actor) && (play->gameplayFrames & 7)) { EnGeldB_SetupSlash(this); } else { @@ -1114,7 +1114,7 @@ void EnGeldB_Jump(EnGeldB* this, PlayState* play) { this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->actor.world.pos.y = this->actor.floorHeight; - if (!Actor_OtherIsTargeted(play, &this->actor)) { + if (!Actor_OtherIsLockedOn(play, &this->actor)) { EnGeldB_SetupSlash(this); } else { EnGeldB_SetupReady(this); @@ -1160,7 +1160,7 @@ void EnGeldB_Block(EnGeldB* this, PlayState* play) { } } else { angleFacingLink = player->actor.shape.rot.y - this->actor.shape.rot.y; - if (!Actor_OtherIsTargeted(play, &this->actor) && + if (!Actor_OtherIsLockedOn(play, &this->actor) && ((play->gameplayFrames & 1) || (ABS(angleFacingLink) < 0x38E0))) { EnGeldB_SetupSlash(this); } else { @@ -1291,12 +1291,12 @@ void EnGeldB_Sidestep(EnGeldB* this, PlayState* play) { s16 angleFacingPlayer2 = player2->actor.shape.rot.y - this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y; - if ((this->actor.xzDistToPlayer <= 45.0f) && !Actor_OtherIsTargeted(play, &this->actor) && + if ((this->actor.xzDistToPlayer <= 45.0f) && !Actor_OtherIsLockedOn(play, &this->actor) && (!(play->gameplayFrames & 3) || (ABS(angleFacingPlayer2) < 0x38E0))) { EnGeldB_SetupSlash(this); } else if ((210.0f > this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 150.0f) && !(play->gameplayFrames & 1)) { - if (Actor_OtherIsTargeted(play, &this->actor) || (Rand_ZeroOne() > 0.5f) || + if (Actor_OtherIsLockedOn(play, &this->actor) || (Rand_ZeroOne() > 0.5f) || (ABS(angleFacingPlayer2) < 0x38E0)) { EnGeldB_SetupRollForward(this); } else { @@ -1328,7 +1328,7 @@ void EnGeldB_SetupDefeated(EnGeldB* this) { this->invisible = true; } this->action = GELDB_DEFEAT; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_DEAD); EnGeldB_SetupAction(this, EnGeldB_Defeated); } @@ -1567,7 +1567,6 @@ void EnGeldB_Draw(Actor* thisx, PlayState* play) { EnGeldB* this = (EnGeldB*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_geldB.c", 2672); - if (1) {} if ((this->spinAttackState >= 2) && SkelAnime_Update(&this->skelAnime)) { if (this->spinAttackState == 2) { diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h index 149f8ac0aa..8ca9f1ac6a 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h @@ -6,7 +6,7 @@ struct EnGeldB; -typedef enum { +typedef enum EnGeldBLimb { /* 0x00 */ GELDB_LIMB_NONE, /* 0x01 */ GELDB_LIMB_ROOT, /* 0x02 */ GELDB_LIMB_TORSO, diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 1b1d4f5412..e8a0603a5f 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -7,7 +7,7 @@ #include "z_en_girla.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) void EnGirlA_Init(Actor* thisx, PlayState* play); void EnGirlA_Destroy(Actor* thisx, PlayState* play); @@ -67,7 +67,7 @@ void EnGirlA_BuyEvent_ObtainBombchuPack(PlayState* play, EnGirlA* this); void EnGirlA_BuyEvent_GoronTunic(PlayState* play, EnGirlA* this); void EnGirlA_BuyEvent_ZoraTunic(PlayState* play, EnGirlA* this); -ActorInit En_GirlA_InitVars = { +ActorProfile En_GirlA_Profile = { /**/ ACTOR_EN_GIRLA, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -141,7 +141,7 @@ static s16 sMaskShopItems[8] = { static u16 sMaskShopFreeToBorrowTextIds[5] = { 0x70B6, 0x70B5, 0x70B4, 0x70B7, 0x70BB }; -typedef struct { +typedef struct ShopItemEntry { /* 0x00 */ s16 objID; /* 0x02 */ s16 giDrawId; /* 0x04 */ void (*hiliteFunc)(Actor*, PlayState*, s32); @@ -1058,7 +1058,7 @@ void EnGirlA_WaitForObject(EnGirlA* this, PlayState* play) { this->hiliteFunc = itemEntry->hiliteFunc; this->giDrawId = itemEntry->giDrawId; PRINTF("%s(%2d)\n", sShopItemDescriptions[params], params); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Actor_SetScale(&this->actor, 0.25f); this->actor.shape.yOffset = 24.0f; this->actor.shape.shadowScale = 4.0f; diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h index 65725c5c1e..971d0109c4 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h @@ -35,7 +35,7 @@ typedef struct EnGirlA { /* 0x01D0 */ EnGirlA3Func hiliteFunc; } EnGirlA; // size = 0x01D4 -typedef enum { +typedef enum EnGirlAShopItem { /* 0x00 */ SI_DEKU_NUTS_5, /* 0x01 */ SI_ARROWS_30, /* 0x02 */ SI_ARROWS_50, @@ -89,7 +89,7 @@ typedef enum { /* 0x32 */ SI_MAX } EnGirlAShopItem; -typedef enum { +typedef enum EnGirlACanBuyResult { /* 0 */ CANBUY_RESULT_SUCCESS_FANFARE, /* 1 */ CANBUY_RESULT_SUCCESS, /* 2 */ CANBUY_RESULT_CANT_GET_NOW, diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 46f0a2ec00..f26c6db2ec 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -9,7 +9,7 @@ #include "assets/objects/object_gm/object_gm.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) void EnGm_Init(Actor* thisx, PlayState* play); void EnGm_Destroy(Actor* thisx, PlayState* play); @@ -26,7 +26,7 @@ void EnGm_ProcessChoiceIndex(EnGm* this, PlayState* play); void func_80A3DF00(EnGm* this, PlayState* play); void func_80A3DF60(EnGm* this, PlayState* play); -ActorInit En_Gm_InitVars = { +ActorProfile En_Gm_Profile = { /**/ ACTOR_EN_GM, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -40,14 +40,14 @@ ActorInit En_Gm_InitVars = { static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -58,8 +58,8 @@ static ColliderCylinderInitType1 sCylinderInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_5, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 30, ICHAIN_STOP), }; void EnGm_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index abed41329c..dedacead3d 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -3,7 +3,7 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_oF1d_map/object_oF1d_map.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_5) void EnGo_Init(Actor* thisx, PlayState* play); void EnGo_Destroy(Actor* thisx, PlayState* play); @@ -34,7 +34,7 @@ void EnGo_SpawnEffectDust(EnGo* this, Vec3f* pos, Vec3f* velocity, Vec3f* accel, void EnGo_UpdateEffects(EnGo* this); void EnGo_DrawEffects(EnGo* this, PlayState* play); -ActorInit En_Go_InitVars = { +ActorProfile En_Go_Profile = { /**/ ACTOR_EN_GO, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -48,7 +48,7 @@ ActorInit En_Go_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -56,7 +56,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -68,7 +68,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -typedef enum { +typedef enum EnGoAnimation { /* 0 */ ENGO_ANIM_0, /* 1 */ ENGO_ANIM_1, /* 2 */ ENGO_ANIM_2, @@ -89,7 +89,7 @@ void EnGo_SetupAction(EnGo* this, EnGoActionFunc actionFunc) { u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { Player* player = GET_PLAYER(play); - switch (thisx->params & 0xF0) { + switch (PARAMS_GET_NOSHIFT(thisx->params, 4, 4)) { case 0x90: if (gSaveContext.save.info.playerData.bgsFlag) { return 0x305E; @@ -133,7 +133,7 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { } } case 0x10: - if (Flags_GetSwitch(play, thisx->params >> 8)) { + if (Flags_GetSwitch(play, PARAMS_GET_NOMASK(thisx->params, 8))) { return 0x3052; } else { return 0x3051; @@ -349,26 +349,30 @@ s32 EnGo_UpdateTalking(PlayState* play, Actor* thisx, s16* talkState, f32 intera void EnGo_ChangeAnim(EnGo* this, s32 index) { Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, - sAnimationInfo[index].playSpeed * ((this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f), 0.0f, - Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode, + sAnimationInfo[index].playSpeed * + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f), + 0.0f, Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode, sAnimationInfo[index].morphFrames); } s32 EnGo_IsActorSpawned(EnGo* this, PlayState* play) { if (((this->actor.params) & 0xF0) == 0x90) { return true; - } else if (play->sceneId == SCENE_FIRE_TEMPLE && !Flags_GetSwitch(play, (this->actor.params) >> 8) && - LINK_IS_ADULT && (this->actor.params & 0xF0) == 0x10) { + } else if (play->sceneId == SCENE_FIRE_TEMPLE && !Flags_GetSwitch(play, PARAMS_GET_NOMASK(this->actor.params, 8)) && + LINK_IS_ADULT && PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x10) { return true; - } else if (play->sceneId == SCENE_GORON_CITY && LINK_IS_ADULT && (this->actor.params & 0xF0) == 0x00) { + } else if (play->sceneId == SCENE_GORON_CITY && LINK_IS_ADULT && + PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x00) { return true; } else if (play->sceneId == SCENE_DEATH_MOUNTAIN_TRAIL && LINK_IS_CHILD && - ((this->actor.params & 0xF0) == 0x20 || (this->actor.params & 0xF0) == 0x30 || - (this->actor.params & 0xF0) == 0x40)) { + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x20 || + PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x30 || + PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x40)) { return true; } else if (play->sceneId == SCENE_GORON_CITY && LINK_IS_CHILD && - ((this->actor.params & 0xF0) == 0x50 || (this->actor.params & 0xF0) == 0x60 || - (this->actor.params & 0xF0) == 0x70)) { + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x50 || + PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x60 || + PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x70)) { return true; } else { return false; @@ -376,7 +380,7 @@ s32 EnGo_IsActorSpawned(EnGo* this, PlayState* play) { } f32 EnGo_GetPlayerTrackingYOffset(EnGo* this) { - switch (this->actor.params & 0xF0) { + switch (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4)) { case 0x00: return 10.0f; case 0x20: @@ -426,7 +430,7 @@ s32 EnGo_IsCameraModified(EnGo* this, PlayState* play) { } xyzDistSq = (this->actor.scale.x / 0.01f) * SQ(100.0f); - if ((this->actor.params & 0xF0) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) { Camera_RequestSetting(mainCam, CAM_SET_DIRECTED_YAW); xyzDistSq *= 4.8f; } @@ -467,11 +471,11 @@ s32 EnGo_FollowPath(EnGo* this, PlayState* play) { f32 xDist; f32 zDist; - if ((this->actor.params & 0xF) == 15) { + if (PARAMS_GET_U(this->actor.params, 0, 4) == 15) { return false; } - path = &play->pathList[this->actor.params & 0xF]; + path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 4)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->unk_218; xDist = pointPos->x - this->actor.world.pos.x; @@ -484,9 +488,9 @@ s32 EnGo_FollowPath(EnGo* this, PlayState* play) { this->unk_218 = 0; } - if ((this->actor.params & 0xF0) != 0x00) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) != 0x00) { return true; - } else if (Flags_GetSwitch(play, this->actor.params >> 8)) { + } else if (Flags_GetSwitch(play, PARAMS_GET_NOMASK(this->actor.params, 8))) { return true; } else if (this->unk_218 >= this->actor.shape.rot.z) { this->unk_218 = 0; @@ -502,10 +506,10 @@ s32 EnGo_SetMovedPos(EnGo* this, PlayState* play) { Path* path; Vec3s* pointPos; - if ((this->actor.params & 0xF) == 0xF) { + if (PARAMS_GET_U(this->actor.params, 0, 4) == 0xF) { return false; } else { - path = &play->pathList[this->actor.params & 0xF]; + path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 4)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += (path->count - 1); this->actor.world.pos.x = pointPos->x; @@ -579,11 +583,11 @@ void func_80A3F908(EnGo* this, PlayState* play) { interactRange = (this->collider.dim.radius + 30.0f); interactRange *= (this->actor.scale.x / 0.01f); - if ((this->actor.params & 0xF0) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) { interactRange *= 4.8f; } - if ((this->actor.params & 0xF0) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) { dialogStarted = EnGo_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, interactRange, EnGo_GetTextID, EnGo_UpdateTalkState); } else { @@ -591,7 +595,7 @@ void func_80A3F908(EnGo* this, PlayState* play) { EnGo_GetTextID, EnGo_UpdateTalkState); } - if (((this->actor.params & 0xF0) == 0x90) && (dialogStarted == true)) { + if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) && (dialogStarted == true)) { if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_BROKEN_GORONS_SWORD) { if (func_8002F368(play) == EXCH_ITEM_BROKEN_GORONS_SWORD) { if (GET_INFTABLE(INFTABLE_B4)) { @@ -634,17 +638,17 @@ void EnGo_Init(Actor* thisx, PlayState* play) { return; } - if ((this->actor.params & 0xF0) && ((this->actor.params & 0xF0) != 0x90)) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) && (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) != 0x90)) { this->actor.flags &= ~ACTOR_FLAG_4; this->actor.flags &= ~ACTOR_FLAG_5; } EnGo_ChangeAnim(this, ENGO_ANIM_0); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->interactInfo.talkState = NPC_TALK_STATE_IDLE; this->actor.gravity = -1.0f; - switch (this->actor.params & 0xF0) { + switch (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4)) { case 0x00: Actor_SetScale(&this->actor, 0.008f); if (CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON)) { @@ -674,7 +678,7 @@ void EnGo_Init(Actor* thisx, PlayState* play) { EnGo_SetupAction(this, func_80A3FEB4); break; case 0x90: - this->actor.targetMode = 5; + this->actor.attentionRangeType = ATTENTION_RANGE_5; Actor_SetScale(&this->actor, 0.16f); EnGo_SetupAction(this, EnGo_CurledUp); break; @@ -710,7 +714,7 @@ void EnGo_StopRolling(EnGo* this, PlayState* play) { if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER; play->damagePlayer(play, -4); - func_8002F71C(play, &this->actor, 4.0f, this->actor.yawTowardsPlayer, 6.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.yawTowardsPlayer, 6.0f); this->unk_20E = 0x10; } } @@ -746,7 +750,7 @@ void func_80A4008C(EnGo* this, PlayState* play) { } void EnGo_GoronLinkRolling(EnGo* this, PlayState* play) { - if ((EnGo_FollowPath(this, play) == true) && Flags_GetSwitch(play, this->actor.params >> 8) && + if ((EnGo_FollowPath(this, play) == true) && Flags_GetSwitch(play, PARAMS_GET_NOMASK(this->actor.params, 8)) && (this->unk_218 == 0)) { this->actor.speed = 0.0f; EnGo_SetupAction(this, func_80A4008C); @@ -769,10 +773,10 @@ void EnGo_CurledUp(EnGo* this, PlayState* play) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->skelAnime.playSpeed = 0.1f; - this->skelAnime.playSpeed *= (this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f; + this->skelAnime.playSpeed *= PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f; EnGo_SetupAction(this, EnGo_WakeUp); - if ((this->actor.params & 0xF0) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) { OnePointCutscene_Init(play, 4200, -99, &this->actor, CAM_ID_MAIN); } } @@ -782,8 +786,9 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { f32 frame; if (this->skelAnime.playSpeed != 0.0f) { - Math_SmoothStepToF(&this->skelAnime.playSpeed, ((this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f) * 0.5f, 0.1f, - 1000.0f, 0.1f); + Math_SmoothStepToF(&this->skelAnime.playSpeed, + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f) * 0.5f, 0.1f, 1000.0f, + 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -792,7 +797,7 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { } else { this->skelAnime.curFrame = 12.0f; this->skelAnime.playSpeed = 0.0f; - if ((this->actor.params & 0xF0) != 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) != 0x90) { this->unk_212 = 30; return; } @@ -813,8 +818,9 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { void func_80A40494(EnGo* this, PlayState* play) { f32 frame; - Math_SmoothStepToF(&this->skelAnime.playSpeed, ((this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f) * -0.5f, 0.1f, - 1000.0f, 0.1f); + Math_SmoothStepToF(&this->skelAnime.playSpeed, + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f) * -0.5f, 0.1f, 1000.0f, + 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -835,8 +841,8 @@ void func_80A405CC(EnGo* this, PlayState* play) { f32 frame; lastFrame = Animation_GetLastFrame(&gGoronAnim_004930); - Math_SmoothStepToF(&this->skelAnime.playSpeed, (this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f, 0.1f, 1000.0f, - 0.1f); + Math_SmoothStepToF(&this->skelAnime.playSpeed, PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f, + 0.1f, 1000.0f, 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -845,7 +851,7 @@ void func_80A405CC(EnGo* this, PlayState* play) { this->skelAnime.curFrame = lastFrame; this->skelAnime.playSpeed = 0.0f; this->unk_212 = Rand_S16Offset(30, 30); - if (((this->actor.params & 0xF0) == 0x40) && !GET_INFTABLE(INFTABLE_EB)) { + if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x40) && !GET_INFTABLE(INFTABLE_EB)) { EnGo_SetupAction(this, func_80A40B1C); } else { EnGo_SetupAction(this, EnGo_BiggoronActionFunc); @@ -854,7 +860,8 @@ void func_80A405CC(EnGo* this, PlayState* play) { } void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { - if (((this->actor.params & 0xF0) == 0x90) && (this->interactInfo.talkState == NPC_TALK_STATE_ACTION)) { + if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) && + (this->interactInfo.talkState == NPC_TALK_STATE_ACTION)) { if (gSaveContext.save.info.playerData.bgsFlag) { this->interactInfo.talkState = NPC_TALK_STATE_IDLE; } else { @@ -873,7 +880,8 @@ void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { EnGo_GetItem(this, play); } } - } else if (((this->actor.params & 0xF0) == 0) && (this->interactInfo.talkState == NPC_TALK_STATE_ACTION)) { + } else if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0) && + (this->interactInfo.talkState == NPC_TALK_STATE_ACTION)) { EnGo_SetupAction(this, EnGo_GetItem); play->msgCtx.stateTimer = 4; play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; @@ -881,7 +889,7 @@ void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { if ((DECR(this->unk_212) == 0) && !EnGo_IsCameraModified(this, play)) { EnGo_ReverseAnimation(this); this->skelAnime.playSpeed = -0.1f; - this->skelAnime.playSpeed *= (this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f; + this->skelAnime.playSpeed *= PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f; EnGo_SetupAction(this, func_80A408D8); } } @@ -891,8 +899,9 @@ void func_80A408D8(EnGo* this, PlayState* play) { f32 frame; if (this->skelAnime.playSpeed != 0.0f) { - Math_SmoothStepToF(&this->skelAnime.playSpeed, ((this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f) * -1.0f, - 0.1f, 1000.0f, 0.1f); + Math_SmoothStepToF(&this->skelAnime.playSpeed, + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f) * -1.0f, 0.1f, 1000.0f, + 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; if (frame >= 12.0f) { @@ -900,7 +909,7 @@ void func_80A408D8(EnGo* this, PlayState* play) { } else { this->skelAnime.curFrame = 12.0f; this->skelAnime.playSpeed = 0.0f; - if ((this->actor.params & 0xF0) != 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) != 0x90) { this->unk_212 = 30; return; } @@ -951,7 +960,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { EnGo_SetupAction(this, func_80A40C78); } else { this->unk_20C = 0; - if ((this->actor.params & 0xF0) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) { if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_CLAIM_CHECK) { getItemId = GI_SWORD_BIGGORON; this->unk_20C = 1; @@ -964,7 +973,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { } } - if ((this->actor.params & 0xF0) == 0) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0) { getItemId = GI_TUNIC_GORON; } @@ -977,7 +986,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { void func_80A40C78(EnGo* this, PlayState* play) { if (this->interactInfo.talkState == NPC_TALK_STATE_ITEM_GIVEN) { EnGo_SetupAction(this, EnGo_BiggoronActionFunc); - if ((this->actor.params & 0xF0) != 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) != 0x90) { this->interactInfo.talkState = NPC_TALK_STATE_IDLE; } else if (this->unk_20C) { this->interactInfo.talkState = NPC_TALK_STATE_IDLE; @@ -1048,8 +1057,7 @@ void EnGo_DrawCurledUp(EnGo* this, PlayState* play) { Matrix_Push(); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_go.c", 2326), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_go.c", 2326); gSPDisplayList(POLY_OPA_DISP++, gGoronDL_00BD80); @@ -1068,8 +1076,7 @@ void EnGo_DrawRolling(EnGo* this, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Matrix_RotateZYX((s16)(play->state.frames * ((s16)this->actor.speed * 1400)), 0, this->actor.shape.rot.z, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_go.c", 2368), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_go.c", 2368); gSPDisplayList(POLY_OPA_DISP++, gGoronDL_00C140); Matrix_MultVec3f(&D_80A41BC0, &this->actor.focus.pos); Matrix_Pop(); @@ -1218,8 +1225,7 @@ void EnGo_DrawEffects(EnGo* this, PlayState* play) { Matrix_Translate(dustEffect->pos.x, dustEffect->pos.y, dustEffect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(dustEffect->scale, dustEffect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_go.c", 2664), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_go.c", 2664); index = dustEffect->timer * (8.0f / dustEffect->initialTimer); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTex[index])); diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.h b/src/overlays/actors/ovl_En_Go/z_en_go.h index e18efcf811..b769cff78f 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.h +++ b/src/overlays/actors/ovl_En_Go/z_en_go.h @@ -25,7 +25,7 @@ typedef s16 (*callback2_80A3ED24)(PlayState*, struct EnGo*); #define EN_GO_EFFECT_COUNT 20 -typedef struct { +typedef struct EnGoEffect { /* 0x0000 */ u8 type; /* 0x0001 */ u8 timer; /* 0x0002 */ u8 initialTimer; diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index c7e1f0e96d..422e32bad8 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -3,8 +3,9 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_oF1d_map/object_oF1d_map.h" #include "quake.h" +#include "versions.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_5) /* FLAGS @@ -32,15 +33,6 @@ INFTABLE_10F - (not on cloud modding) INFTABLE_11E - Bomb bag upgrade obtained from rolling Goron -EnGo -pathIndex: this->actor.params & 0xF -Goron: this->actor.params & 0xF0 - -EnGo2 -(this->actor.params & 0x3E0) >> 5 -(this->actor.params & 0xFC00) >> 0xA - Gorons in Fire Temple -this->actor.params & 0x1F - Gorons only move when this->interactInfo.talkState == NPC_TALK_STATE_IDLE */ @@ -74,7 +66,7 @@ static Vec3f sAccel = { 0.0f, 0.3f, 0.0f }; static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -82,7 +74,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, ATELEM_NONE, @@ -94,7 +86,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -ActorInit En_Go2_InitVars = { +ActorProfile En_Go2_Profile = { /**/ ACTOR_EN_GO2, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -125,7 +117,7 @@ static f32 sPlayerTrackingYOffsets[14][2] = { { 20.0f, 20.0f }, { 20.0f, 20.0f }, { 20.0f, 20.0f }, { 20.0f, 20.0f }, }; -typedef enum { +typedef enum EnGo2Animation { /* 0 */ ENGO2_ANIM_0, /* 1 */ ENGO2_ANIM_1, /* 2 */ ENGO2_ANIM_2, @@ -243,8 +235,7 @@ void EnGo2_DrawEffects(EnGo2* this, PlayState* play) { Matrix_Translate(dustEffect->pos.x, dustEffect->pos.y, dustEffect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(dustEffect->scale, dustEffect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_go2_eff.c", 137), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_go2_eff.c", 137); index = dustEffect->timer * (8.0f / dustEffect->initialTimer); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sDustTex[index])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, index); @@ -298,7 +289,7 @@ s32 EnGo2_GetDialogState(EnGo2* this, PlayState* play) { } u16 EnGo2_GoronFireGenericGetTextId(EnGo2* this) { - switch ((this->actor.params & 0xFC00) >> 0xA) { + switch (PARAMS_GET_S(this->actor.params, 10, 6)) { case 3: return 0x3069; case 5: @@ -583,7 +574,11 @@ s16 EnGo2_UpdateTalkStateGoronDmtBiggoron(PlayState* play, EnGo2* this) { u8 dialogState = this->dialogState; switch (EnGo2_GetDialogState(this, play)) { +#if OOT_VERSION < PAL_1_0 + case TEXT_STATE_CLOSING: +#else case TEXT_STATE_DONE: +#endif if (this->actor.textId == 0x305E) { if (!gSaveContext.save.info.playerData.bgsFlag) { EnGo2_GetItem(this, play, GI_SWORD_BIGGORON); @@ -643,7 +638,7 @@ s16 EnGo2_UpdateTalkStateGoronDmtBiggoron(PlayState* play, EnGo2* this) { } u16 EnGo2_GetTextIdGoronFireGeneric(PlayState* play, EnGo2* this) { - if (Flags_GetSwitch(play, (this->actor.params & 0xFC00) >> 0xA)) { + if (Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 10, 6))) { return 0x3071; } else { return 0x3051; @@ -743,7 +738,7 @@ u16 EnGo2_GetTextId(PlayState* play, Actor* thisx) { if (textId != 0) { return textId; } else { - switch (this->actor.params & 0x1F) { + switch (PARAMS_GET_S(this->actor.params, 0, 5)) { case GORON_CITY_ROLLING_BIG: return EnGo2_GetTextIdGoronCityRollingBig(play, this); case GORON_CITY_LINK: @@ -781,7 +776,7 @@ u16 EnGo2_GetTextId(PlayState* play, Actor* thisx) { s16 EnGo2_UpdateTalkState(PlayState* play, Actor* thisx) { EnGo2* this = (EnGo2*)thisx; - switch (this->actor.params & 0x1F) { + switch (PARAMS_GET_S(this->actor.params, 0, 5)) { case GORON_CITY_ROLLING_BIG: return EnGo2_UpdateTalkStateGoronCityRollingBig(play, this); case GORON_CITY_LINK: @@ -819,10 +814,11 @@ s16 EnGo2_UpdateTalkState(PlayState* play, Actor* thisx) { } s32 func_80A44790(EnGo2* this, PlayState* play) { - if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON && (this->actor.params & 0x1F) != GORON_CITY_ROLLING_BIG) { + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BIGGORON && + PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG) { return Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->interactRange, EnGo2_GetTextId, EnGo2_UpdateTalkState); - } else if (((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) && + } else if ((PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) && !(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) { return false; } else { @@ -840,18 +836,18 @@ s32 func_80A44790(EnGo2* this, PlayState* play) { } void EnGo2_SetColliderDim(EnGo2* this) { - u8 index = this->actor.params & 0x1F; + u8 index = PARAMS_GET_S(this->actor.params, 0, 5); this->collider.dim.radius = D_80A4816C[index].radius; this->collider.dim.height = D_80A4816C[index].height; } void EnGo2_SetShape(EnGo2* this) { - u8 index = this->actor.params & 0x1F; + u8 index = PARAMS_GET_S(this->actor.params, 0, 5); this->actor.shape.shadowScale = D_80A481F8[index].shape_unk_10; Actor_SetScale(&this->actor, D_80A481F8[index].scale); - this->actor.targetMode = D_80A481F8[index].actor_unk_1F; + this->actor.attentionRangeType = D_80A481F8[index].actor_unk_1F; this->interactRange = D_80A481F8[index].interactRange; this->interactRange += this->collider.dim.radius; } @@ -863,10 +859,10 @@ void EnGo2_CheckCollision(EnGo2* this, PlayState* play) { pos.x = this->actor.world.pos.x; pos.y = this->actor.world.pos.y; pos.z = this->actor.world.pos.z; - xzDist = D_80A4816C[this->actor.params & 0x1F].xzDist; + xzDist = D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].xzDist; pos.x += (s16)(xzDist * Math_SinS(this->actor.shape.rot.y)); pos.z += (s16)(xzDist * Math_CosS(this->actor.shape.rot.y)); - pos.y += D_80A4816C[this->actor.params & 0x1F].yDist; + pos.y += D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].yDist; this->collider.dim.pos = pos; CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); @@ -884,7 +880,7 @@ s32 func_80A44AB0(EnGo2* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 arg2; - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { return false; } else { if ((this->actionFunc != EnGo2_SlowRolling) && (this->actionFunc != EnGo2_ReverseRolling) && @@ -910,7 +906,7 @@ s32 func_80A44AB0(EnGo2* this, PlayState* play) { arg2 = this->actionFunc == EnGo2_ContinueRolling ? 1.5f : this->actor.speed * 1.5f; play->damagePlayer(play, -4); - func_8002F71C(play, &this->actor, arg2, this->actor.yawTowardsPlayer, 6.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, arg2, this->actor.yawTowardsPlayer, 6.0f); Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT); this->collider.base.ocFlags1 &= ~OC1_TYPE_PLAYER; } @@ -964,16 +960,16 @@ s32 func_80A44D84(EnGo2* this) { s32 EnGo2_IsWakingUp(EnGo2* this) { s16 yawDiff; - f32 xyzDist = (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; - f32 yDist = (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; + f32 xyzDist = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; + f32 yDist = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; s16 yawDiffAbs; - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { if (!(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; return false; } else { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; return true; } } @@ -1005,8 +1001,9 @@ s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 arg1, f32 arg2, s16 arg3) { } if (this->unk_59C >= 2) { - Actor_PlaySfx(&this->actor, (this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG ? NA_SE_EN_GOLON_LAND_BIG - : NA_SE_EN_DODO_M_GND); + Actor_PlaySfx(&this->actor, (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG) + ? NA_SE_EN_GOLON_LAND_BIG + : NA_SE_EN_DODO_M_GND); } this->unk_59C--; @@ -1028,7 +1025,7 @@ s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 arg1, f32 arg2, s16 arg3) { void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { u16 textId; - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { if (gSaveContext.save.info.playerData.bgsFlag) { if (func_8002F368(play) == EXCH_ITEM_CLAIM_CHECK) { this->actor.textId = 0x3003; @@ -1092,7 +1089,7 @@ void func_80A45288(EnGo2* this, PlayState* play) { if (this->actionFunc != EnGo2_GoronFireGenericAction) { this->interactInfo.trackPos = player->actor.world.pos; this->interactInfo.yOffset = - sPlayerTrackingYOffsets[this->actor.params & 0x1F][((void)0, gSaveContext.save.linkAge)]; + sPlayerTrackingYOffsets[PARAMS_GET_S(this->actor.params, 0, 5)][((void)0, gSaveContext.save.linkAge)]; Npc_TrackPoint(&this->actor, &this->interactInfo, 4, this->trackingMode); } if ((this->actionFunc != EnGo2_SetGetItem) && (this->isAwake == true)) { @@ -1125,7 +1122,7 @@ void EnGo2_RollForward(EnGo2* this) { } void func_80A454CC(EnGo2* this) { - switch (this->actor.params & 0x1F) { + switch (PARAMS_GET_S(this->actor.params, 0, 5)) { case GORON_CITY_ROLLING_BIG: case GORON_DMT_DC_ENTRANCE: case GORON_CITY_ENTRANCE: @@ -1147,8 +1144,8 @@ void func_80A454CC(EnGo2* this) { } f32 EnGo2_GetTargetXZSpeed(EnGo2* this) { - f32 yDist = (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; - s32 index = this->actor.params & 0x1F; + f32 yDist = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; + s32 index = PARAMS_GET_S(this->actor.params, 0, 5); if (index == GORON_CITY_LINK && (fabsf(this->actor.yDistToPlayer) < yDist) && (this->actor.xzDistToPlayer < 400.0f)) { @@ -1161,7 +1158,7 @@ f32 EnGo2_GetTargetXZSpeed(EnGo2* this) { s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) { Camera* mainCam = play->cameraPtrs[CAM_ID_MAIN]; - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { if (EnGo2_IsWakingUp(this)) { Camera_RequestSetting(mainCam, CAM_SET_DIRECTED_YAW); Camera_UnsetStateFlag(mainCam, CAM_STATE_CHECK_BG); @@ -1171,9 +1168,11 @@ s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) { } } - if ((this->actor.params & 0x1F) == GORON_FIRE_GENERIC || (this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG || - (this->actor.params & 0x1F) == GORON_CITY_STAIRWELL || (this->actor.params & 0x1F) == GORON_DMT_BIGGORON || - (this->actor.params & 0x1F) == GORON_MARKET_BAZAAR) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_FIRE_GENERIC || + PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG || + PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_STAIRWELL || + PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON || + PARAMS_GET_S(this->actor.params, 0, 5) == GORON_MARKET_BAZAAR) { return true; } else if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON)) { return true; @@ -1197,7 +1196,7 @@ void EnGo2_DefaultWakingUp(EnGo2* this) { } void EnGo2_WakingUp(EnGo2* this) { - f32 xyzDist = (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; + f32 xyzDist = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; s32 isTrue = true; xyzDist = SQ(xyzDist); @@ -1220,7 +1219,7 @@ void EnGo2_BiggoronWakingUp(EnGo2* this) { } void EnGo2_SelectGoronWakingUp(EnGo2* this) { - switch (this->actor.params & 0x1F) { + switch (PARAMS_GET_S(this->actor.params, 0, 5)) { case GORON_DMT_BOMB_FLOWER: this->isAwake = true; this->trackingMode = EnGo2_IsWakingUp(this) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE; @@ -1275,7 +1274,7 @@ void EnGo2_EyeMouthTexState(EnGo2* this) { void EnGo2_SitDownAnimation(EnGo2* this) { if ((this->skelAnime.playSpeed != 0.0f) && (this->skelAnime.animation == &gGoronAnim_004930)) { if (this->skelAnime.playSpeed > 0.0f && this->skelAnime.curFrame == 14.0f) { - if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BIGGORON) { Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_SIT_DOWN); } else { func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_SIT_DOWN, 60); @@ -1293,7 +1292,7 @@ void EnGo2_SitDownAnimation(EnGo2* this) { } void EnGo2_GetDustData(EnGo2* this, s32 index2) { - s32 index1 = (this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG ? 1 : 0; + s32 index1 = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG ? 1 : 0; EnGo2DustEffectData* dustEffectData = &sDustEffectData[index1][index2]; EnGo2_SpawnDust(this, dustEffectData->initialTimer, dustEffectData->scale, dustEffectData->scaleStep, @@ -1301,8 +1300,8 @@ void EnGo2_GetDustData(EnGo2* this, s32 index2) { } void EnGo2_RollingAnimation(EnGo2* this, PlayState* play) { - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { - this->actor.flags &= ~ACTOR_FLAG_0; + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_10); this->skelAnime.playSpeed = -0.5f; } else { @@ -1318,13 +1317,13 @@ void EnGo2_RollingAnimation(EnGo2* this, PlayState* play) { void EnGo2_WakeUp(EnGo2* this, PlayState* play) { if (this->skelAnime.playSpeed == 0.0f) { - if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BIGGORON) { Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_WAKE_UP); } else { func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_WAKE_UP, 60); } } - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { OnePointCutscene_Init(play, 4200, -99, &this->actor, CAM_ID_MAIN); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_10); this->skelAnime.playSpeed = 0.5f; @@ -1345,7 +1344,8 @@ void EnGo2_GetItemAnimation(EnGo2* this, PlayState* play) { } void EnGo2_SetupRolling(EnGo2* this, PlayState* play) { - if ((this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG || (this->actor.params & 0x1F) == GORON_CITY_LINK) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG || + PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_LINK) { this->collider.elem.acElemFlags = ACELEM_ON; this->actor.speed = GET_INFTABLE(INFTABLE_11E) ? 6.0f : 3.6000001f; } else { @@ -1361,8 +1361,9 @@ void EnGo2_SetupRolling(EnGo2* this, PlayState* play) { void EnGo2_StopRolling(EnGo2* this, PlayState* play) { EnBom* bomb; - if (((this->actor.params & 0x1F) != GORON_CITY_ROLLING_BIG) && ((this->actor.params & 0x1F) != GORON_CITY_LINK)) { - if ((this->actor.params & 0x1F) == GORON_DMT_ROLLING_SMALL) { + if ((PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG) && + (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_LINK)) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_ROLLING_SMALL) { bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); if (bomb != NULL) { @@ -1382,20 +1383,21 @@ void EnGo2_StopRolling(EnGo2* this, PlayState* play) { } s32 EnGo2_IsFreeingGoronInFire(EnGo2* this, PlayState* play) { - if ((this->actor.params & 0x1F) != GORON_FIRE_GENERIC) { + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_FIRE_GENERIC) { return false; } // shaking curled up this->actor.world.pos.x += (play->state.frames & 1) ? 1.0f : -1.0f; - if (Flags_GetSwitch(play, (this->actor.params & 0xFC00) >> 0xA)) { + if (Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 10, 6))) { return true; } return false; } s32 EnGo2_IsGoronDmtBombFlower(EnGo2* this) { - if ((this->actor.params & 0x1F) != GORON_DMT_BOMB_FLOWER || this->interactInfo.talkState != NPC_TALK_STATE_ACTION) { + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BOMB_FLOWER || + this->interactInfo.talkState != NPC_TALK_STATE_ACTION) { return false; } @@ -1408,7 +1410,7 @@ s32 EnGo2_IsGoronDmtBombFlower(EnGo2* this) { } s32 EnGo2_IsGoronRollingBig(EnGo2* this, PlayState* play) { - if ((this->actor.params & 0x1F) != GORON_CITY_ROLLING_BIG || + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG || (this->interactInfo.talkState != NPC_TALK_STATE_ACTION)) { return false; } @@ -1419,7 +1421,8 @@ s32 EnGo2_IsGoronRollingBig(EnGo2* this, PlayState* play) { } s32 EnGo2_IsGoronFireGeneric(EnGo2* this) { - if ((this->actor.params & 0x1F) != GORON_FIRE_GENERIC || this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_FIRE_GENERIC || + this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { return false; } this->actionFunc = EnGo2_GoronFireGenericAction; @@ -1427,7 +1430,7 @@ s32 EnGo2_IsGoronFireGeneric(EnGo2* this) { } s32 EnGo2_IsGoronLinkReversing(EnGo2* this) { - if ((this->actor.params & 0x1F) != GORON_CITY_LINK || (this->waypoint >= this->unk_216) || + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_LINK || (this->waypoint >= this->unk_216) || !EnGo2_IsWakingUp(this)) { return false; } @@ -1450,7 +1453,7 @@ s32 EnGo2_IsRolling(EnGo2* this) { void EnGo2_GoronLinkAnimation(EnGo2* this, PlayState* play) { s32 animation = ARRAY_COUNT(sAnimationInfo); - if ((this->actor.params & 0x1F) == GORON_CITY_LINK) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_LINK) { if ((this->actor.textId == 0x3035 && this->unk_20C == 0) || (this->actor.textId == 0x3036 && this->unk_20C == 0)) { if (this->skelAnime.animation != &gGoronAnim_000D5C) { @@ -1503,7 +1506,8 @@ void EnGo2_GoronFireClearCamera(EnGo2* this, PlayState* play) { void EnGo2_BiggoronAnimation(EnGo2* this) { if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_BROKEN_GORONS_SWORD && INV_CONTENT(ITEM_TRADE_ADULT) <= ITEM_EYE_DROPS && - (this->actor.params & 0x1F) == GORON_DMT_BIGGORON && this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { + PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON && + this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { if (DECR(this->animTimer) == 0) { this->animTimer = Rand_S16Offset(30, 30); func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_EYE_BIG, 60); @@ -1522,7 +1526,7 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); // Not GORON_CITY_ROLLING_BIG, GORON_CITY_LINK, GORON_DMT_BIGGORON - switch (this->actor.params & 0x1F) { + switch (PARAMS_GET_S(this->actor.params, 0, 5)) { case GORON_FIRE_GENERIC: case GORON_DMT_BOMB_FLOWER: case GORON_DMT_ROLLING_SMALL: @@ -1550,8 +1554,8 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { this->waypoint = 0; this->unk_216 = this->actor.shape.rot.z; this->trackingMode = NPC_TRACKING_NONE; - this->path = Path_GetByIndex(play, (this->actor.params & 0x3E0) >> 5, 0x1F); - switch (this->actor.params & 0x1F) { + this->path = Path_GetByIndex(play, PARAMS_GET_S(this->actor.params, 5, 5), 0x1F); + switch (PARAMS_GET_S(this->actor.params, 0, 5)) { case GORON_CITY_ENTRANCE: case GORON_CITY_ISLAND: case GORON_CITY_LOWEST_FLOOR: @@ -1579,19 +1583,21 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnGo2_CurledUp; } } else { +#if OOT_VERSION >= PAL_1_1 CLEAR_INFTABLE(INFTABLE_10C); - this->collider.dim.height = (D_80A4816C[this->actor.params & 0x1F].height * 0.6f); +#endif + this->collider.dim.height = (D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].height * 0.6f); EnGo2_SetupRolling(this, play); this->isAwake = true; } break; case GORON_CITY_ROLLING_BIG: case GORON_DMT_ROLLING_SMALL: - this->collider.dim.height = (D_80A4816C[this->actor.params & 0x1F].height * 0.6f); + this->collider.dim.height = (D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].height * 0.6f); EnGo2_SetupRolling(this, play); break; case GORON_FIRE_GENERIC: - if (Flags_GetSwitch(play, (this->actor.params & 0xFC00) >> 0xA)) { + if (Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 10, 6))) { Actor_Kill(&this->actor); } else { this->isAwake = true; @@ -1600,7 +1606,7 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { break; case GORON_DMT_BIGGORON: this->actor.shape.shadowDraw = NULL; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if ((INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_BROKEN_GORONS_SWORD) && (INV_CONTENT(ITEM_TRADE_ADULT) <= ITEM_EYE_DROPS)) { this->eyeMouthTexState = 1; @@ -1627,12 +1633,12 @@ void EnGo2_Destroy(Actor* thisx, PlayState* play) { } void EnGo2_CurledUp(EnGo2* this, PlayState* play) { - u8 index = this->actor.params & 0x1F; + u8 index = PARAMS_GET_S(this->actor.params, 0, 5); s16 height; s32 quakeIndex; if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); Quake_SetSpeed(quakeIndex, -0x3CB0); Quake_SetPerturbations(quakeIndex, 8, 0, 0, 0); @@ -1655,13 +1661,13 @@ void EnGo2_CurledUp(EnGo2* this, PlayState* play) { this->isAwake = false; EnGo2_WakeUp(this, play); } - if (((this->actor.params & 0x1F) != GORON_FIRE_GENERIC) && EnGo2_IsWakingUp(this)) { + if ((PARAMS_GET_S(this->actor.params, 0, 5) != GORON_FIRE_GENERIC) && EnGo2_IsWakingUp(this)) { EnGo2_WakeUp(this, play); } } void func_80A46B40(EnGo2* this, PlayState* play) { - u8 index = (this->actor.params & 0x1F); + u8 index = PARAMS_GET_S(this->actor.params, 0, 5); f32 height; if (this->unk_211 == true) { @@ -1678,8 +1684,8 @@ void func_80A46B40(EnGo2* this, PlayState* play) { } } else { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { - this->actor.flags |= ACTOR_FLAG_0; + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } func_80A454CC(this); this->unk_211 = true; @@ -1716,7 +1722,8 @@ void EnGo2_GoronRollingBigContinueRolling(EnGo2* this, PlayState* play) { void EnGo2_ContinueRolling(EnGo2* this, PlayState* play) { f32 float1 = 1000.0f; - if (((this->actor.params & 0x1F) != GORON_DMT_ROLLING_SMALL || !(this->actor.xyzDistToPlayerSq > SQ(float1))) && + if ((PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_ROLLING_SMALL || + !(this->actor.xyzDistToPlayerSq > SQ(float1))) && DECR(this->animTimer) == 0) { this->actionFunc = EnGo2_SlowRolling; this->actor.speed *= 0.5f; // slowdown @@ -1737,7 +1744,7 @@ void EnGo2_SlowRolling(EnGo2* this, PlayState* play) { EnGo2_GetDustData(this, 3); } orientation = EnGo2_Orient(this, play); - index = this->actor.params & 0x1F; + index = PARAMS_GET_S(this->actor.params, 0, 5); if (index != GORON_CITY_LINK) { if ((index == GORON_DMT_ROLLING_SMALL) && (orientation == 1) && (this->waypoint == 0)) { EnGo2_StopRolling(this, play); @@ -1756,7 +1763,7 @@ void EnGo2_GroundRolling(EnGo2* this, PlayState* play) { if (EnGo2_IsRollingOnGround(this, 4, 8.0f, 0)) { EnGo2_GetDustData(this, 0); if (this->unk_59C == 0) { - switch (this->actor.params & 0x1F) { + switch (PARAMS_GET_S(this->actor.params, 0, 5)) { case GORON_CITY_LINK: this->goronState = 0; this->actionFunc = EnGo2_GoronLinkStopRolling; @@ -1789,7 +1796,9 @@ void EnGo2_ReverseRolling(EnGo2* this, PlayState* play) { void EnGo2_SetupGetItem(EnGo2* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { +#if OOT_VERSION >= PAL_1_0 this->actor.parent = NULL; +#endif this->actionFunc = EnGo2_SetGetItem; } else { Actor_OfferGetItem(&this->actor, play, this->getItemId, this->actor.xzDistToPlayer + 1.0f, @@ -1826,7 +1835,7 @@ void EnGo2_BiggoronEyedrops(EnGo2* this, PlayState* play) { switch (this->goronState) { case 0: Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_5); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.shape.rot.y += 0x5B0; this->trackingMode = NPC_TRACKING_NONE; this->animTimer = this->skelAnime.endFrame + 60.0f + 60.0f; // eyeDrops animation timer @@ -1857,7 +1866,7 @@ void EnGo2_BiggoronEyedrops(EnGo2* this, PlayState* play) { } if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_1); - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->trackingMode = NPC_TRACKING_HEAD_AND_TORSO; this->skelAnime.playSpeed = 0.0f; this->skelAnime.curFrame = this->skelAnime.endFrame; @@ -1938,9 +1947,9 @@ void EnGo2_GoronFireGenericAction(EnGo2* this, PlayState* play) { } else { this->animTimer = 0; this->actor.speed = 0.0f; - if ((((this->actor.params & 0xFC00) >> 0xA) != 1) && (((this->actor.params & 0xFC00) >> 0xA) != 2) && - (((this->actor.params & 0xFC00) >> 0xA) != 4) && (((this->actor.params & 0xFC00) >> 0xA) != 5) && - (((this->actor.params & 0xFC00) >> 0xA) != 9) && (((this->actor.params & 0xFC00) >> 0xA) != 11)) { + if ((PARAMS_GET_S(this->actor.params, 10, 6) != 1) && (PARAMS_GET_S(this->actor.params, 10, 6) != 2) && + (PARAMS_GET_S(this->actor.params, 10, 6) != 4) && (PARAMS_GET_S(this->actor.params, 10, 6) != 5) && + (PARAMS_GET_S(this->actor.params, 10, 6) != 9) && (PARAMS_GET_S(this->actor.params, 10, 6) != 11)) { this->goronState++; } this->goronState++; @@ -1979,9 +1988,13 @@ void EnGo2_Update(Actor* thisx, PlayState* play) { EnGo2_RollForward(this); Actor_UpdateBgCheckInfo(play, &this->actor, this->collider.dim.height * 0.5f, this->collider.dim.radius * 0.6f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); +#if OOT_VERSION < PAL_1_0 + func_80A44AB0(this, play); +#else if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { func_80A44AB0(this, play); } +#endif this->actionFunc(this, play); if (this->unk_211 == true) { func_80034F54(play, this->unk_226, this->unk_24A, 18); @@ -1996,8 +2009,7 @@ s32 EnGo2_DrawCurledUp(EnGo2* this, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_go2.c", 2881); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_go2.c", 2884), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_go2.c", 2884); gSPDisplayList(POLY_OPA_DISP++, gGoronDL_00BD80); CLOSE_DISPS(play->state.gfxCtx, "../z_en_go2.c", 2889); Matrix_MultVec3f(&D_80A48554, &this->actor.focus.pos); @@ -2014,8 +2026,7 @@ s32 EnGo2_DrawRolling(EnGo2* this, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); speedXZ = this->actionFunc == EnGo2_ReverseRolling ? 0.0f : this->actor.speed; Matrix_RotateZYX((play->state.frames * ((s16)speedXZ * 1400)), 0, this->actor.shape.rot.z, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_go2.c", 2926), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_go2.c", 2926); gSPDisplayList(POLY_OPA_DISP++, gGoronDL_00C140); CLOSE_DISPS(play->state.gfxCtx, "../z_en_go2.c", 2930); Matrix_MultVec3f(&D_80A48560, &this->actor.focus.pos); diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.h b/src/overlays/actors/ovl_En_Go2/z_en_go2.h index e152841366..9651f6bfeb 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.h +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.h @@ -9,7 +9,7 @@ struct EnGo2; typedef void (*EnGo2ActionFunc)(struct EnGo2*, PlayState*); -typedef enum { +typedef enum GoronType { /* 0x00 */ GORON_CITY_ROLLING_BIG, /* 0x01 */ GORON_CITY_LINK, /* 0x02 */ GORON_DMT_BIGGORON, @@ -41,7 +41,7 @@ typedef enum { // /* 0x0B */ GORON_FIRE_HIGHEST -typedef struct { +typedef struct EnGo2DataStruct1 { s16 unused; s16 yDist; s16 xzDist; @@ -49,14 +49,14 @@ typedef struct { s16 height; } EnGo2DataStruct1; // size = 0xA -typedef struct { +typedef struct EnGo2DataStruct2 { f32 shape_unk_10; f32 scale; s8 actor_unk_1F; f32 interactRange; } EnGo2DataStruct2; // size = 0x10 -typedef struct { +typedef struct EnGo2DustEffectData { u8 initialTimer; f32 scale; f32 scaleStep; diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index 1734511c51..ceb7b3649d 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -4,7 +4,7 @@ #include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) void EnGoma_Init(Actor* thisx, PlayState* play); void EnGoma_Destroy(Actor* thisx, PlayState* play); @@ -42,7 +42,7 @@ void EnGoma_SetupLand(EnGoma* this); void EnGoma_SetupJump(EnGoma* this); void EnGoma_SetupStunned(EnGoma* this, PlayState* play); -ActorInit En_Goma_InitVars = { +ActorProfile En_Goma_Profile = { /**/ ACTOR_BOSS_GOMA, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -56,7 +56,7 @@ ActorInit En_Goma_InitVars = { static ColliderCylinderInit D_80A4B7A0 = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -64,7 +64,7 @@ static ColliderCylinderInit D_80A4B7A0 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFDFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -76,7 +76,7 @@ static ColliderCylinderInit D_80A4B7A0 = { static ColliderCylinderInit D_80A4B7CC = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -84,7 +84,7 @@ static ColliderCylinderInit D_80A4B7CC = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFDFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -98,10 +98,10 @@ static u8 sSpawnNum = 0; static Vec3f sDeadEffectVel = { 0.0f, 0.0f, 0.0f }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 3, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_3, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, NAVI_ENEMY_GOHMA_LARVA, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 0, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 20, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 20, ICHAIN_STOP), }; void EnGoma_Init(Actor* thisx, PlayState* play) { @@ -119,10 +119,10 @@ void EnGoma_Init(Actor* thisx, PlayState* play) { this->gomaType = ENGOMA_BOSSLIMB; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); this->actionTimer = this->actor.params + 150; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else if (params >= 10) { // Debris when hatching this->actor.gravity = -1.3f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionTimer = 50; this->gomaType = ENGOMA_HATCH_DEBRIS; this->eggScale = 1.0f; @@ -366,7 +366,7 @@ void EnGoma_SetupDie(EnGoma* this) { } this->invincibilityTimer = 100; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } void EnGoma_Die(EnGoma* this, PlayState* play) { @@ -756,6 +756,7 @@ s32 EnGoma_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* 255); if (limbIndex == GOMA_LIMB_EYE_IRIS_ROOT1) { + if (1) {} rot->x += this->eyePitch; rot->y += this->eyeYaw; } else if (limbIndex == GOMA_LIMB_BODY && this->hurtTimer != 0) { @@ -819,23 +820,20 @@ void EnGoma_Draw(Actor* thisx, PlayState* play) { Matrix_RotateY(-(this->eggSquishAngle * 0.15f), MTXMODE_APPLY); Matrix_Translate(0.0f, this->eggYOffset, 0.0f, MTXMODE_APPLY); Matrix_RotateX(this->eggPitch, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_goma.c", 2101), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_goma.c", 2101); gSPDisplayList(POLY_OPA_DISP++, gObjectGolEggDL); Matrix_Pop(); break; case ENGOMA_HATCH_DEBRIS: - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_goma.c", 2107), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_goma.c", 2107); gSPDisplayList(POLY_OPA_DISP++, gBrownFragmentDL); break; case ENGOMA_BOSSLIMB: if (this->bossLimbDL != NULL) { gSPSegment(POLY_OPA_DISP++, 0x08, EnGoma_NoBackfaceCullingDlist(play->state.gfxCtx)); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_goma.c", 2114), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_goma.c", 2114); gSPDisplayList(POLY_OPA_DISP++, this->bossLimbDL); } break; diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.h b/src/overlays/actors/ovl_En_Goma/z_en_goma.h index b04162acad..a0a97f20fb 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.h +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef enum { +typedef enum GomaType { /* 0 */ ENGOMA_NORMAL, /* 1 */ ENGOMA_EGG, /* 2 */ ENGOMA_HATCH_DEBRIS, @@ -15,7 +15,7 @@ struct EnGoma; typedef void (*EnGomaActionFunc)(struct EnGoma*, PlayState*); -typedef enum { +typedef enum EnGomaLimb { /* 0 */ GOMA_LIMB_NONE, /* 1 */ GOMA_LIMB_ROOT1, /* 2 */ GOMA_LIMB_ROOT2, diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index a60d6e4e1c..02ef24bac8 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -43,7 +43,7 @@ void EnGoroiwa_MoveUp(EnGoroiwa* this, PlayState* play); void EnGoroiwa_SetupMoveDown(EnGoroiwa* this); void EnGoroiwa_MoveDown(EnGoroiwa* this, PlayState* play); -ActorInit En_Goroiwa_InitVars = { +ActorProfile En_Goroiwa_Profile = { /**/ ACTOR_EN_GOROIWA, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -58,7 +58,7 @@ ActorInit En_Goroiwa_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -71,7 +71,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -97,7 +97,7 @@ void EnGoroiwa_UpdateCollider(EnGoroiwa* this) { Sphere16* worldSphere = &this->collider.elements[0].dim.worldSphere; worldSphere->center.x = this->actor.world.pos.x; - worldSphere->center.y = this->actor.world.pos.y + yOffsets[(this->actor.params >> 10) & 1]; + worldSphere->center.y = this->actor.world.pos.y + yOffsets[PARAMS_GET_U(this->actor.params, 10, 1)]; worldSphere->center.z = this->actor.world.pos.z; } @@ -147,7 +147,7 @@ void EnGoroiwa_SetSpeed(EnGoroiwa* this, PlayState* play) { } void EnGoroiwa_FaceNextWaypoint(EnGoroiwa* this, PlayState* play) { - Path* path = &play->pathList[this->actor.params & 0xFF]; + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; Vec3s* nextPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3f nextPosF; @@ -159,8 +159,8 @@ void EnGoroiwa_FaceNextWaypoint(EnGoroiwa* this, PlayState* play) { } void EnGoroiwa_GetPrevWaypointDiff(EnGoroiwa* this, PlayState* play, Vec3f* dest) { - s16 loopMode = (this->actor.params >> 8) & 3; - Path* path = &play->pathList[this->actor.params & 0xFF]; + s16 loopMode = PARAMS_GET_U(this->actor.params, 8, 2); + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; s16 prevWaypoint = this->currentWaypoint - this->pathDirection; Vec3s* prevPointPos; Vec3s* currentPointPos; @@ -187,7 +187,7 @@ void EnGoroiwa_GetPrevWaypointDiff(EnGoroiwa* this, PlayState* play, Vec3f* dest } void EnGoroiw_CheckEndOfPath(EnGoroiwa* this) { - s16 loopMode = (this->actor.params >> 8) & 3; + s16 loopMode = PARAMS_GET_U(this->actor.params, 8, 2); if (this->nextWaypoint < 0) { if (loopMode == ENGOROIWA_LOOPMODE_ONEWAY || loopMode == ENGOROIWA_LOOPMODE_ONEWAY_BREAK) { @@ -225,14 +225,14 @@ void EnGoroiwa_ReverseDirection(EnGoroiwa* this) { } void EnGoroiwa_InitPath(EnGoroiwa* this, PlayState* play) { - this->endWaypoint = play->pathList[this->actor.params & 0xFF].count - 1; + this->endWaypoint = play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)].count - 1; this->currentWaypoint = 0; this->nextWaypoint = 1; this->pathDirection = 1; } void EnGoroiwa_TeleportToWaypoint(EnGoroiwa* this, PlayState* play, s32 waypoint) { - Path* path = &play->pathList[this->actor.params & 0xFF]; + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; Vec3s* pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + waypoint; this->actor.world.pos.x = pointPos->x; @@ -247,7 +247,7 @@ void EnGoroiwa_InitRotation(EnGoroiwa* this) { s32 EnGoroiwa_GetAscendDirection(EnGoroiwa* this, PlayState* play) { s32 pad; - Path* path = &play->pathList[this->actor.params & 0xFF]; + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint; @@ -313,7 +313,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) { Math_StepToF(&this->actor.speed, EN_GOROIWA_SPEED(this), 0.3f); Actor_UpdateVelocityXZGravity(&this->actor); - path = &play->pathList[this->actor.params & 0xFF]; + path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; result = true; result &= Math_StepToF(&this->actor.world.pos.x, nextPointPos->x, fabsf(this->actor.velocity.x)); @@ -323,7 +323,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) { } s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) { - Path* path = &play->pathList[this->actor.params & 0xFF]; + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; s32 pad; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint; @@ -355,7 +355,7 @@ s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) { s32 EnGoroiwa_MoveUpToNextWaypoint(EnGoroiwa* this, PlayState* play) { s32 pad; - Path* path = &play->pathList[this->actor.params & 0xFF]; + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Math_StepToF(&this->actor.velocity.y, EN_GOROIWA_SPEED(this) * 0.5f, 0.18f); @@ -366,7 +366,7 @@ s32 EnGoroiwa_MoveUpToNextWaypoint(EnGoroiwa* this, PlayState* play) { s32 EnGoroiwa_MoveDownToNextWaypoint(EnGoroiwa* this, PlayState* play) { s32 pad; - Path* path = &play->pathList[this->actor.params & 0xFF]; + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; f32 nextPointY; f32 thisY; @@ -485,7 +485,7 @@ void EnGoroiwa_UpdateRotation(EnGoroiwa* this, PlayState* play) { } void EnGoroiwa_NextWaypoint(EnGoroiwa* this, PlayState* play) { - s16 loopMode = (this->actor.params >> 8) & 3; + s16 loopMode = PARAMS_GET_U(this->actor.params, 8, 2); EnGoroiwa_SetNextWaypoint(this); @@ -509,7 +509,7 @@ void EnGoroiwa_SpawnFragments(EnGoroiwa* this, PlayState* play) { f32 cos1; f32 sin1; f32 sin2; - s16 yOffsetIdx = (this->actor.params >> 10) & 1; + s16 yOffsetIdx = PARAMS_GET_U(this->actor.params, 10, 1); s32 i; for (i = 0, angle1 = 0; i < 16; i++, angle1 += 0x4E20) { @@ -548,7 +548,7 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); EnGoroiwa_InitCollider(this, play); - pathIdx = this->actor.params & 0xFF; + pathIdx = PARAMS_GET_U(this->actor.params, 0, 8); if (pathIdx == 0xFF) { // "Error: Invalid arg_data" PRINTF("Error : arg_data が不正(%s %d)(arg_data 0x%04x)\n", "../z_en_gr.c", 1033, this->actor.params); @@ -562,7 +562,8 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { return; } CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - ActorShape_Init(&this->actor.shape, yOffsets[(this->actor.params >> 10) & 1], ActorShadow_DrawCircle, 9.4f); + ActorShape_Init(&this->actor.shape, yOffsets[PARAMS_GET_U(this->actor.params, 10, 1)], ActorShadow_DrawCircle, + 9.4f); this->actor.shape.shadowAlpha = 200; EnGoroiwa_SetSpeed(this, play); EnGoroiwa_InitPath(this, play); @@ -571,8 +572,9 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { EnGoroiwa_FaceNextWaypoint(this, play); EnGoroiwa_SetupRoll(this); // "(Goroiwa)" - PRINTF("(ごろ岩)(arg 0x%04x)(rail %d)(end %d)(bgc %d)(hit %d)\n", this->actor.params, this->actor.params & 0xFF, - (this->actor.params >> 8) & 3, (this->actor.params >> 10) & 1, this->actor.home.rot.z & 1); + PRINTF("(ごろ岩)(arg 0x%04x)(rail %d)(end %d)(bgc %d)(hit %d)\n", this->actor.params, + PARAMS_GET_U(this->actor.params, 0, 8), PARAMS_GET_U(this->actor.params, 8, 2), + PARAMS_GET_U(this->actor.params, 10, 1), this->actor.home.rot.z & 1); } void EnGoroiwa_Destroy(Actor* thisx, PlayState* play2) { @@ -602,22 +604,22 @@ void EnGoroiwa_Roll(EnGoroiwa* this, PlayState* play) { yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; if (yawDiff > -0x4000 && yawDiff < 0x4000) { this->stateFlags |= ENGOROIWA_PLAYER_IN_THE_WAY; - if (((this->actor.params >> 10) & 1) || (this->actor.home.rot.z & 1) != 1) { + if (PARAMS_GET_U(this->actor.params, 10, 1) || (this->actor.home.rot.z & 1) != 1) { EnGoroiwa_ReverseDirection(this); EnGoroiwa_FaceNextWaypoint(this, play); } } - func_8002F6D4(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0); + Actor_SetPlayerKnockbackLarge(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0); PRINTF(VT_FGCOL(CYAN)); PRINTF("Player ぶっ飛ばし\n"); // "Player knocked down" PRINTF(VT_RST); - onHitSetupFuncs[(this->actor.params >> 10) & 1](this); + onHitSetupFuncs[PARAMS_GET_U(this->actor.params, 10, 1)](this); Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_BODY_HIT); if ((this->actor.home.rot.z & 1) == 1) { this->collisionDisabledTimer = 50; } - } else if (moveFuncs[(this->actor.params >> 10) & 1](this, play)) { - loopMode = (this->actor.params >> 8) & 3; + } else if (moveFuncs[PARAMS_GET_U(this->actor.params, 10, 1)](this, play)) { + loopMode = PARAMS_GET_U(this->actor.params, 8, 2); if (loopMode == ENGOROIWA_LOOPMODE_ONEWAY_BREAK && (this->nextWaypoint == 0 || this->nextWaypoint == this->endWaypoint)) { EnGoroiwa_SpawnFragments(this, play); @@ -626,7 +628,7 @@ void EnGoroiwa_Roll(EnGoroiwa* this, PlayState* play) { if ((loopMode == ENGOROIWA_LOOPMODE_ROUNDTRIP) && (this->currentWaypoint == 0 || this->currentWaypoint == this->endWaypoint)) { EnGoroiwa_SetupWait(this); - } else if (!((this->actor.params >> 10) & 1) && this->currentWaypoint != 0 && + } else if (!PARAMS_GET_U(this->actor.params, 10, 1) && this->currentWaypoint != 0 && this->currentWaypoint != this->endWaypoint) { ascendDirection = EnGoroiwa_GetAscendDirection(this, play); if (ascendDirection > 0) { @@ -693,7 +695,7 @@ void EnGoroiwa_SetupMoveUp(EnGoroiwa* this) { void EnGoroiwa_MoveUp(EnGoroiwa* this, PlayState* play) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; - func_8002F6D4(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 4); + Actor_SetPlayerKnockbackLarge(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 4); Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_BODY_HIT); if ((this->actor.home.rot.z & 1) == 1) { this->collisionDisabledTimer = 50; @@ -718,7 +720,7 @@ void EnGoroiwa_SetupMoveDown(EnGoroiwa* this) { void EnGoroiwa_MoveDown(EnGoroiwa* this, PlayState* play) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; - func_8002F6D4(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 4); + Actor_SetPlayerKnockbackLarge(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 4); Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_BODY_HIT); if ((this->actor.home.rot.z & 1) == 1) { this->collisionDisabledTimer = 50; @@ -737,12 +739,12 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) { s32 pad; s32 bgId; - if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29))) { + if (!(player->stateFlags1 & (PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29))) { if (this->collisionDisabledTimer > 0) { this->collisionDisabledTimer--; } this->actionFunc(this, play); - switch ((this->actor.params >> 10) & 1) { + switch (PARAMS_GET_U(this->actor.params, 10, 1)) { case 1: Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 64e7dbfef6..af8376cddb 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -9,7 +9,7 @@ #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_25) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_25) void EnGs_Init(Actor* thisx, PlayState* play); void EnGs_Destroy(Actor* thisx, PlayState* play); @@ -21,7 +21,7 @@ void func_80A4F700(EnGs* this, PlayState* play); void func_80A4F77C(EnGs* this); -ActorInit En_Gs_InitVars = { +ActorProfile En_Gs_Profile = { /**/ ACTOR_EN_GS, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -35,7 +35,7 @@ ActorInit En_Gs_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -43,7 +43,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -102,7 +102,7 @@ void EnGs_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit); CollisionCheck_SetInfo2(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); - thisx->targetMode = 6; + thisx->attentionRangeType = ATTENTION_RANGE_6; this->unk_1D8 = thisx->world.pos; this->actionFunc = func_80A4F734; this->unk_1B4[0].x = 1.0f; @@ -123,7 +123,7 @@ s32 func_80A4E3EC(EnGs* this, PlayState* play) { if (Message_ShouldAdvance(play)) { switch (this->actor.textId) { case 0x2054: - this->actor.textId = (this->actor.params & 0xFF) + 0x400; + this->actor.textId = PARAMS_GET_U(this->actor.params, 0, 8) + 0x400; ret = 1; break; default: @@ -169,7 +169,7 @@ void func_80A4E470(EnGs* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); } this->unk_19D = 0; - Flags_SetSwitch(play, (this->actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_01) { player->stateFlags2 |= PLAYER_STATE2_23; } @@ -240,7 +240,7 @@ void func_80A4EA08(EnGs* this, PlayState* play) { this->unk_200 = 0; this->unk_19F = 1; } else if (this->unk_19F == 1) { - this->unk_1A0[0].z = (((this->unk_200 % 8) / 8.0f) * 360.0f) * (0x10000 / 360.0f); + this->unk_1A0[0].z = DEG_TO_BINANG(((this->unk_200 % 8) / 8.0f) * 360.0f); this->unk_1A0[1].z = -this->unk_1A0[0].z; if (func_80A4E754(this, play, &this->unk_1E8, &this->unk_1EC, &this->unk_200, 0.8f, 0.005f, 0.001f, 7, 0) == 0.0f) { @@ -353,7 +353,7 @@ void func_80A4ED34(EnGs* this, PlayState* play) { (s16)Rand_ZeroFloat(50.0f) + 200, 40, 15); } - func_8002F974(&this->actor, NA_SE_EV_FIRE_PILLAR - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_FIRE_PILLAR - SFX_FLAG); if (this->unk_200++ >= 40) { this->unk_19E |= 0x10; this->actor.flags |= ACTOR_FLAG_4; @@ -380,7 +380,7 @@ void func_80A4ED34(EnGs* this, PlayState* play) { this->unk_19E |= 8; this->actionFunc = func_80A4F700; } else { - func_8002F974(&this->actor, NA_SE_EV_STONE_LAUNCH - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_STONE_LAUNCH - SFX_FLAG); } Actor_MoveXZGravity(&this->actor); @@ -408,14 +408,14 @@ void func_80A4F13C(EnGs* this, PlayState* play) { if (this->unk_19F == 1) { Math_SmoothStepToF(&this->unk_1F0, this->unk_1F4, 1.0f, 0.1f, 0.001f); tmpf1 = Math_SmoothStepToF(&this->unk_1E8, this->unk_1EC, 1.0f, this->unk_1F0, 0.001f); - this->unk_1A0[0].y += (s32)(this->unk_1E8 * (0x10000 / 360.0f)); + this->unk_1A0[0].y += DEG_TO_BINANG2(this->unk_1E8); if (tmpf1 == 0.0f) { this->unk_200 = 0; this->unk_19F = 2; } } if (this->unk_19F == 2) { - this->unk_1A0[0].y += (s32)(this->unk_1E8 * (0x10000 / 360.0f)); + this->unk_1A0[0].y += DEG_TO_BINANG2(this->unk_1E8); if (this->unk_200++ > 40) { this->unk_1E8 = this->unk_1B4[0].y - 1.0f; this->unk_1EC = 1.5f; @@ -426,7 +426,7 @@ void func_80A4F13C(EnGs* this, PlayState* play) { } } if (this->unk_19F == 3) { - this->unk_1A0[0].y += 0x4000; + this->unk_1A0[0].y += DEG_TO_BINANG2(90.0f); tmpf1 = Math_SmoothStepToF(&this->unk_1E8, this->unk_1EC, 0.8f, 0.2f, 0.001f); Math_SmoothStepToF(&this->unk_1F0, this->unk_1F4, 0.8f, 0.2f, 0.001f); this->unk_1B4[0].x = this->unk_1F0 + 1.0f; @@ -438,7 +438,7 @@ void func_80A4F13C(EnGs* this, PlayState* play) { } } if (this->unk_19F == 4) { - tmpf1 = Math_SmoothStepToF(&this->unk_1E8, this->unk_1EC, 0.8f, 16384.0f, 3640.0f); + tmpf1 = Math_SmoothStepToF(&this->unk_1E8, this->unk_1EC, 0.8f, DEG_TO_BINANG2(90.0f), DEG_TO_BINANG2(20.0f)); this->unk_1A0[0].y += (s16)this->unk_1E8; if (tmpf1 == 0.0f) { @@ -458,7 +458,7 @@ void func_80A4F13C(EnGs* this, PlayState* play) { tmp -= 0xFFFF; } this->unk_1E8 = tmp; - tmpf1 = Math_SmoothStepToF(&this->unk_1E8, this->unk_1EC, 0.8f, 3640.0f, 0.001f); + tmpf1 = Math_SmoothStepToF(&this->unk_1E8, this->unk_1EC, 0.8f, DEG_TO_BINANG2(20.0f), 0.001f); this->unk_1A0[0].y = this->unk_1E8; if (tmpf1 == 0.0f) { this->unk_1E8 = this->unk_1B4[0].y - 1.0f; @@ -499,7 +499,7 @@ void func_80A4F700(EnGs* this, PlayState* play) { } void func_80A4F734(EnGs* this, PlayState* play) { - if (!Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { func_80A4E470(this, play); } } @@ -587,8 +587,7 @@ void EnGs_Draw(Actor* thisx, PlayState* play) { Matrix_RotateZ(BINANG_TO_RAD(this->unk_1A0[1].z), MTXMODE_APPLY); } - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_gs.c", 1064), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_gs.c", 1064); gSPDisplayList(POLY_OPA_DISP++, gGossipStoneMaterialDL); if (this->unk_19E & 4) { @@ -607,8 +606,7 @@ void EnGs_Draw(Actor* thisx, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(0.05f, -0.05f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_gs.c", 1087), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_gs.c", 1087); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x40, 1, 0, -frames * 0x14, 0x20, 0x80)); diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/src/overlays/actors/ovl_En_Guest/z_en_guest.c index a122de078a..e302681584 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -9,7 +9,7 @@ #include "assets/objects/object_boj/object_boj.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) void EnGuest_Init(Actor* thisx, PlayState* play); void EnGuest_Destroy(Actor* thisx, PlayState* play); @@ -20,7 +20,7 @@ void func_80A50518(EnGuest* this, PlayState* play); void func_80A5057C(EnGuest* this, PlayState* play); void func_80A505CC(Actor* thisx, PlayState* play); -ActorInit En_Guest_InitVars = { +ActorProfile En_Guest_Profile = { /**/ ACTOR_EN_GUEST, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -34,7 +34,7 @@ ActorInit En_Guest_InitVars = { static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -45,8 +45,8 @@ static ColliderCylinderInitType1 sCylinderInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 6, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_6, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 500, ICHAIN_STOP), }; void EnGuest_Init(Actor* thisx, PlayState* play) { @@ -80,8 +80,7 @@ void EnGuest_Update(Actor* thisx, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_4; Actor_ProcessInitChain(&this->actor, sInitChain); - SkelAnime_InitFlex(play, &this->skelAnime, &object_boj_Skel_0000F0, NULL, this->jointTable, this->morphTable, - 16); + SkelAnime_InitFlex(play, &this->skelAnime, &gHylianMan2Skel, NULL, this->jointTable, this->morphTable, 16); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment); Animation_Change(&this->skelAnime, &gObjOsAnim_42AC, 1.0f, 0.0f, Animation_GetLastFrame(&gObjOsAnim_42AC), ANIMMODE_LOOP, 0.0f); @@ -186,7 +185,7 @@ s32 EnGuest_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* OPEN_DISPS(play->state.gfxCtx, "../z_en_guest.c", 352); if (limbIndex == 15) { - *dList = object_boj_DL_0059B0; + *dList = gHylianMan2BeardedHeadDL; Matrix_Translate(1400.0f, 0.0f, 0.0f, MTXMODE_APPLY); limbRot = this->interactInfo.headRot; Matrix_RotateX(BINANG_TO_RAD_ALT(limbRot.y), MTXMODE_APPLY); @@ -212,9 +211,9 @@ s32 EnGuest_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* void EnGuest_Draw(Actor* thisx, PlayState* play) { static void* D_80A50BA4[] = { - object_boj_Tex_0005FC, - object_boj_Tex_0006FC, - object_boj_Tex_0007FC, + gHylianMan2MustachedEyeOpenTex, + gHylianMan2MustachedEyeHalfTex, + gHylianMan2MustachedEyeClosedTex, }; EnGuest* this = (EnGuest*)thisx; s32 pad; diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.c b/src/overlays/actors/ovl_En_Hata/z_en_hata.c index dcf9aca99b..a339b3c3f4 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.c +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.c @@ -14,7 +14,7 @@ void EnHata_Destroy(Actor* thisx, PlayState* play); void EnHata_Update(Actor* thisx, PlayState* play2); void EnHata_Draw(Actor* thisx, PlayState* play); -ActorInit En_Hata_InitVars = { +ActorProfile En_Hata_Profile = { /**/ ACTOR_EN_HATA, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -29,7 +29,7 @@ ActorInit En_Hata_InitVars = { // Unused Collider and CollisionCheck data static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -37,7 +37,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000080, 0x00, 0x00 }, ATELEM_NONE | ATELEM_SFX_NORMAL, diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.h b/src/overlays/actors/ovl_En_Hata/z_en_hata.h index f208b1e019..e098bcaab3 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.h +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.h @@ -5,7 +5,7 @@ #include "global.h" -typedef enum { +typedef enum EnHataLimb { /* 0x00 */ FLAGPOLE_LIMB_NONE, /* 0x01 */ FLAGPOLE_LIMB_POLE_BASE, /* 0x02 */ FLAGPOLE_LIMB_POLE, @@ -30,7 +30,7 @@ typedef enum { /* 0x15 */ FLAGPOLE_LIMB_MAX } EnHataLimb; -typedef struct { +typedef struct EnHata { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ SkelAnime skelAnime; /* 0x01A8 */ ColliderCylinder collider; // Unused, but indicated by the form of the unused data diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index fb4fbd167d..42588c5580 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -31,7 +31,7 @@ void EnHeishi1_WaitNight(EnHeishi1* this, PlayState* play); static s32 sPlayerIsCaught = false; -ActorInit En_Heishi1_InitVars = { +ActorProfile En_Heishi1_Profile = { /**/ 0, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -72,8 +72,8 @@ void EnHeishi1_Init(Actor* thisx, PlayState* play2) { Actor_SetScale(&this->actor, 0.01f); SkelAnime_Init(play, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable, this->morphTable, 17); - this->type = (this->actor.params >> 8) & 0xFF; - this->path = this->actor.params & 0xFF; + this->type = PARAMS_GET_U(this->actor.params, 8, 8); + this->path = PARAMS_GET_U(this->actor.params, 0, 8); for (i = 0; i < ARRAY_COUNT(sAnimParamsInit[0]); i++) { this->animParams[i] = sAnimParamsInit[this->type][i]; diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 762fa5d6c6..b1ee099721 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -12,7 +12,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnHeishi2_Init(Actor* thisx, PlayState* play); void EnHeishi2_Destroy(Actor* thisx, PlayState* play); @@ -50,7 +50,7 @@ void func_80A546DC(EnHeishi2* this, PlayState* play); void func_80A541FC(EnHeishi2* this, PlayState* play); void func_80A53DF8(EnHeishi2* this, PlayState* play); -ActorInit En_Heishi2_InitVars = { +ActorProfile En_Heishi2_Profile = { /**/ ACTOR_EN_HEISHI2, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -64,7 +64,7 @@ ActorInit En_Heishi2_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -72,7 +72,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -87,12 +87,12 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { EnHeishi2* this = (EnHeishi2*)thisx; Actor_SetScale(&this->actor, 0.01f); - this->type = this->actor.params & 0xFF; + this->type = PARAMS_GET_U(this->actor.params, 0, 8); this->actor.colChkInfo.mass = MASS_IMMOVABLE; if ((this->type == 6) || (this->type == 9)) { this->actor.draw = EnHeishi2_DrawKingGuard; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP); if (this->type == 6) { this->actionFunc = EnHeishi2_DoNothing1; @@ -112,7 +112,7 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; Collider_DestroyCylinder(play, &this->collider); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_4; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4; this->actionFunc = func_80A544AC; } } else { @@ -126,7 +126,7 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { this->collider.dim.yShift = 0; this->collider.dim.radius = 15; this->collider.dim.height = 70; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; switch (this->type) { @@ -143,19 +143,20 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { // "Peep hole soldier!" PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 覗き穴奥兵士ふぃ〜 ☆☆☆☆☆ \n" VT_RST); Collider_DestroyCylinder(play, collider); - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); this->actionFunc = EnHeishi_DoNothing2; break; } - this->unk_2F0 = (this->actor.params >> 8) & 0xFF; + this->unk_2F0 = PARAMS_GET_U(this->actor.params, 8, 8); PRINTF("\n\n"); // "Soldier Set 2 Completed!" PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 兵士2セット完了! ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); // "Identification Completed!" PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了! ☆☆☆☆☆ %d\n" VT_RST, this->type); // "Message completed!" - PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, (this->actor.params >> 8) & 0xF); + PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, + PARAMS_GET_U(this->actor.params, 8, 4)); } } @@ -639,7 +640,7 @@ void func_80A544AC(EnHeishi2* this, PlayState* play) { this->actor.world.rot.z = this->actor.shape.rot.z; if (this->actor.shape.rot.z < -6000) { Message_StartTextbox(play, 0x708F, NULL); - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->actionFunc = func_80A5455C; this->unk_2E4 = 0.0f; } @@ -830,8 +831,7 @@ void EnHeishi2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* void EnHeishi2_DrawKingGuard(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_heishi2.c", 1772); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_heishi2.c", 1774), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_heishi2.c", 1774); gSPDisplayList(POLY_OPA_DISP++, gHeishiKingGuardDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_heishi2.c", 1777); @@ -856,7 +856,7 @@ void EnHeishi2_Draw(Actor* thisx, PlayState* play2) { Matrix_Put(&this->mtxf_330); Matrix_Translate(-570.0f, 0.0f, 0.0f, MTXMODE_APPLY); Matrix_RotateZ(DEG_TO_RAD(70), MTXMODE_APPLY); - mtx = MATRIX_NEW(play->state.gfxCtx, "../z_en_heishi2.c", 1820) - 7; + mtx = MATRIX_FINALIZE(play->state.gfxCtx, "../z_en_heishi2.c", 1820) - 7; gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[linkChildObjectSlot].segment); gSPSegment(POLY_OPA_DISP++, 0x0D, mtx); diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index c38744ea2b..7dc72a610b 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -7,6 +7,7 @@ #include "z_en_heishi3.h" #include "assets/objects/object_sd/object_sd.h" #include "terminal.h" +#include "versions.h" #define FLAGS 0 @@ -25,7 +26,7 @@ void func_80A55BD4(EnHeishi3* this, PlayState* play); static s16 sPlayerCaught = 0; -ActorInit En_Heishi3_InitVars = { +ActorProfile En_Heishi3_Profile = { /**/ ACTOR_EN_HEISHI3, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -39,7 +40,7 @@ ActorInit En_Heishi3_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -47,7 +48,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -73,7 +74,7 @@ void EnHeishi3_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_Init(play, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable, this->morphTable, 17); this->actor.colChkInfo.mass = MASS_IMMOVABLE; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); // "Castle Gate Soldier - Power Up" @@ -134,6 +135,9 @@ void EnHeishi3_StandSentinelInGrounds(EnHeishi3* this, PlayState* play) { Sfx_PlaySfxCentered(NA_SE_SY_FOUND); PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発見! ☆☆☆☆☆ \n" VT_RST); // "Discovered!" Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1); +#if OOT_PAL_N64 + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4; +#endif this->actionFunc = EnHeishi3_CatchStart; } } @@ -162,6 +166,9 @@ void EnHeishi3_StandSentinelInCastle(EnHeishi3* this, PlayState* play) { Sfx_PlaySfxCentered(NA_SE_SY_FOUND); PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発見! ☆☆☆☆☆ \n" VT_RST); // "Discovered!" Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1); +#if OOT_PAL_N64 + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4; +#endif this->actionFunc = EnHeishi3_CatchStart; } } diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index c02946ac22..51588714c8 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -2,7 +2,7 @@ #include "assets/objects/object_sd/object_sd.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnHeishi4_Init(Actor* thisx, PlayState* play); void EnHeishi4_Destroy(Actor* thisx, PlayState* play); @@ -21,7 +21,7 @@ void func_80A56994(EnHeishi4* this, PlayState* play); void func_80A56A50(EnHeishi4* this, PlayState* play); void func_80A56ACC(EnHeishi4* this, PlayState* play); -ActorInit En_Heishi4_InitVars = { +ActorProfile En_Heishi4_Profile = { /**/ ACTOR_EN_HEISHI4, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -37,7 +37,7 @@ static u32 sMaskReactionSets[] = { MASK_REACTION_SET_HEISHI4_1, MASK_REACTION_SE static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -45,7 +45,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -59,10 +59,10 @@ void EnHeishi4_Init(Actor* thisx, PlayState* play) { EnHeishi4* this = (EnHeishi4*)thisx; Actor_SetScale(thisx, 0.01f); - this->type = thisx->params & 0xFF; + this->type = PARAMS_GET_U(thisx->params, 0, 8); thisx->colChkInfo.mass = MASS_IMMOVABLE; this->pos = thisx->world.pos; - thisx->targetMode = 6; + thisx->attentionRangeType = ATTENTION_RANGE_6; if (this->type == HEISHI4_AT_MARKET_DYING) { this->height = 30.0f; ActorShape_Init(&thisx->shape, 0.0f, NULL, 30.0f); @@ -93,11 +93,11 @@ void EnHeishi4_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80A56544; break; } - this->unk_27C = (thisx->params >> 8) & 0xFF; + this->unk_27C = PARAMS_GET_U(thisx->params, 8, 8); PRINTF("\n\n"); PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 兵士2セット完了! ☆☆☆☆☆ %d\n" VT_RST, thisx->params); PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了!\t ☆☆☆☆☆ %d\n" VT_RST, this->type); - PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, (thisx->params >> 8) & 0xF); + PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, PARAMS_GET_U(thisx->params, 8, 4)); PRINTF("\n\n"); } diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h index 0bc2fc99d4..48e09ca458 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef enum { +typedef enum Heishi4Type { /* 0x00 */ HEISHI4_AT_KAKARIKO_ENTRANCE, /* 0x04 */ HEISHI4_AT_IMPAS_HOUSE = 4, /* 0x07 */ HEISHI4_AT_MARKET_DYING = 7, diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 08468d132b..2b2b65d392 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -7,7 +7,7 @@ #include "z_en_hintnuts.h" #include "assets/objects/object_hintnuts/object_hintnuts.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) void EnHintnuts_Init(Actor* thisx, PlayState* play); void EnHintnuts_Destroy(Actor* thisx, PlayState* play); @@ -27,7 +27,7 @@ void EnHintnuts_Talk(EnHintnuts* this, PlayState* play); void EnHintnuts_Leave(EnHintnuts* this, PlayState* play); void EnHintnuts_Freeze(EnHintnuts* this, PlayState* play); -ActorInit En_Hintnuts_InitVars = { +ActorProfile En_Hintnuts_Profile = { /**/ ACTOR_EN_HINTNUTS, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -41,7 +41,7 @@ ActorInit En_Hintnuts_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -49,7 +49,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -66,7 +66,7 @@ static s16 sPuzzleCounter = 0; static InitChainEntry sInitChain[] = { ICHAIN_F32(gravity, -1, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, NAVI_ENEMY_DEKU_SCRUB, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 2600, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 2600, ICHAIN_STOP), }; void EnHintnuts_Init(Actor* thisx, PlayState* play) { @@ -75,7 +75,7 @@ void EnHintnuts_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); if (this->actor.params == 0xA) { - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); } else { ActorShape_Init(&this->actor.shape, 0x0, ActorShadow_DrawCircle, 35.0f); SkelAnime_Init(play, &this->skelAnime, &gHintNutsSkel, &gHintNutsStandAnim, this->jointTable, this->morphTable, @@ -83,7 +83,7 @@ void EnHintnuts_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - Actor_SetTextWithPrefix(play, &this->actor, (this->actor.params >> 8) & 0xFF); + Actor_SetTextWithPrefix(play, &this->actor, PARAMS_GET_U(this->actor.params, 8, 8)); this->textIdCopy = this->actor.textId; this->actor.params &= 0xFF; sPuzzleCounter = 0; @@ -110,8 +110,8 @@ void EnHintnuts_Destroy(Actor* thisx, PlayState* play) { void EnHintnuts_HitByScrubProjectile1(EnHintnuts* this, PlayState* play) { if (this->actor.textId != 0 && this->actor.category == ACTORCAT_ENEMY && ((this->actor.params == 0) || (sPuzzleCounter == 2))) { - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_BG); } } @@ -204,7 +204,7 @@ void EnHintnuts_SetupLeave(EnHintnuts* this, PlayState* play) { void EnHintnuts_SetupFreeze(EnHintnuts* this) { Animation_PlayLoop(&this->skelAnime, &gHintNutsFreezeAnim); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 100); this->actor.colorFilterTimer = 1; this->animFlagAndTimer = 0; @@ -323,10 +323,10 @@ void EnHintnuts_BeginFreeze(EnHintnuts* this, PlayState* play) { void EnHintnuts_CheckProximity(EnHintnuts* this, PlayState* play) { if (this->actor.category != ACTORCAT_ENEMY) { - if ((this->collider.base.ocFlags1 & OC1_HIT) || this->actor.isTargeted) { - this->actor.flags |= ACTOR_FLAG_16; + if ((this->collider.base.ocFlags1 & OC1_HIT) || this->actor.isLockedOn) { + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } else { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } if (this->actor.xzDistToPlayer < 130.0f) { this->actor.textId = this->textIdCopy; @@ -377,8 +377,9 @@ void EnHintnuts_Run(EnHintnuts* this, PlayState* play) { fabsf(this->actor.world.pos.y - this->actor.home.pos.y) < 2.0f) { this->actor.speed = 0.0f; if (this->actor.category == ACTORCAT_BG) { - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_16); - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_2; + this->actor.flags &= + ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED); + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE; Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); } EnHintnuts_SetupBurrow(this); @@ -449,7 +450,7 @@ void EnHintnuts_Freeze(EnHintnuts* this, PlayState* play) { if (this->animFlagAndTimer == 1) { Actor_Kill(&this->actor); } else { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.flags &= ~ACTOR_FLAG_4; this->actor.colChkInfo.health = sColChkInfoInit.health; this->actor.colorFilterTimer = 0; diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c index 403f92d926..af3defe56d 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -76,7 +76,7 @@ void EnHoll_VerticalBgCover(EnHoll* this, PlayState* play); void EnHoll_VerticalInvisible(EnHoll* this, PlayState* play); void EnHoll_HorizontalBgCoverSwitchFlag(EnHoll* this, PlayState* play); -ActorInit En_Holl_InitVars = { +ActorProfile En_Holl_Profile = { /**/ ACTOR_EN_HOLL, /**/ ACTORCAT_DOOR, /**/ FLAGS, @@ -133,7 +133,7 @@ void EnHoll_Init(Actor* thisx, PlayState* play) { void EnHoll_Destroy(Actor* thisx, PlayState* play) { s32 transitionActorIndex = GET_TRANSITION_ACTOR_INDEX(thisx); - TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[transitionActorIndex]; + TransitionActorEntry* transitionEntry = &play->transitionActors.list[transitionActorIndex]; transitionEntry->id = -transitionEntry->id; } @@ -145,7 +145,7 @@ void EnHoll_SwapRooms(PlayState* play) { tempRoom = roomCtx->curRoom; roomCtx->curRoom = roomCtx->prevRoom; roomCtx->prevRoom = tempRoom; - play->roomCtx.unk_30 ^= 1; + play->roomCtx.activeBufPage ^= 1; } /** @@ -186,7 +186,7 @@ void EnHoll_HorizontalVisibleNarrow(EnHoll* this, PlayState* play) { f32 orthogonalDistToPlayer; s32 transitionActorIndex; - func_8002DBD0(&this->actor, &relPlayerPos, &player->actor.world.pos); + Actor_WorldToActorCoords(&this->actor, &relPlayerPos, &player->actor.world.pos); this->side = (relPlayerPos.z < 0.0f) ? 0 : 1; orthogonalDistToPlayer = fabsf(relPlayerPos.z); if (relPlayerPos.y > ENHOLL_H_Y_MIN && relPlayerPos.y < ENHOLL_H_Y_MAX && @@ -196,14 +196,14 @@ void EnHoll_HorizontalVisibleNarrow(EnHoll* this, PlayState* play) { transitionActorIndex = GET_TRANSITION_ACTOR_INDEX(&this->actor); if (orthogonalDistToPlayer > sHorizontalVisibleNarrowTriggerDists[triggerDistsIndex][1]) { if (play->roomCtx.prevRoom.num >= 0 && play->roomCtx.status == 0) { - this->actor.room = play->transiActorCtx.list[transitionActorIndex].sides[this->side].room; + this->actor.room = play->transitionActors.list[transitionActorIndex].sides[this->side].room; EnHoll_SwapRooms(play); - func_80097534(play, &play->roomCtx); + Room_FinishRoomChange(play, &play->roomCtx); } } else { - this->actor.room = play->transiActorCtx.list[transitionActorIndex].sides[this->side ^ 1].room; + this->actor.room = play->transitionActors.list[transitionActorIndex].sides[this->side ^ 1].room; if (play->roomCtx.prevRoom.num < 0) { - func_8009728C(play, &play->roomCtx, this->actor.room); + Room_RequestNewRoom(play, &play->roomCtx, this->actor.room); } else { this->planeAlpha = (255.0f / (sHorizontalVisibleNarrowTriggerDists[triggerDistsIndex][2] - @@ -227,7 +227,7 @@ void EnHoll_HorizontalInvisible(EnHoll* this, PlayState* play) { f32 hollHalfWidth; f32 orthogonalDistToSubject; - func_8002DBD0(&this->actor, &relSubjectPos, useViewEye ? &play->view.eye : &player->actor.world.pos); + Actor_WorldToActorCoords(&this->actor, &relSubjectPos, useViewEye ? &play->view.eye : &player->actor.world.pos); hollHalfWidth = (ENHOLL_GET_TYPE(&this->actor) == ENHOLL_H_INVISIBLE_NARROW) ? ENHOLL_H_HALFWIDTH_NARROW : ENHOLL_H_HALFWIDTH; @@ -239,14 +239,14 @@ void EnHoll_HorizontalInvisible(EnHoll* this, PlayState* play) { orthogonalDistToSubject > ENHOLL_H_INVISIBLE_LOAD_DEPTH_MIN))) { s32 transitionActorIndex = GET_TRANSITION_ACTOR_INDEX(&this->actor); s32 side = (relSubjectPos.z < 0.0f) ? 0 : 1; - TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[transitionActorIndex]; + TransitionActorEntry* transitionEntry = &play->transitionActors.list[transitionActorIndex]; s32 room = transitionEntry->sides[side].room; this->actor.room = room; if (isKokiriLayer8) {} if (this->actor.room != play->roomCtx.curRoom.num) { if (room) {} - if (func_8009728C(play, &play->roomCtx, this->actor.room)) { + if (Room_RequestNewRoom(play, &play->roomCtx, this->actor.room)) { EnHoll_SetupAction(this, EnHoll_WaitRoomLoaded); } } @@ -273,11 +273,11 @@ void EnHoll_VerticalDownBgCoverLarge(EnHoll* this, PlayState* play) { } if (absYDistToPlayer < ENHOLL_V_DOWN_LOAD_YDIST) { - this->actor.room = play->transiActorCtx.list[transitionActorIndex].sides[1].room; + this->actor.room = play->transitionActors.list[transitionActorIndex].sides[1].room; Math_SmoothStepToF(&player->actor.world.pos.x, this->actor.world.pos.x, 1.0f, 50.0f, 10.0f); Math_SmoothStepToF(&player->actor.world.pos.z, this->actor.world.pos.z, 1.0f, 50.0f, 10.0f); if (this->actor.room != play->roomCtx.curRoom.num && - func_8009728C(play, &play->roomCtx, this->actor.room)) { + Room_RequestNewRoom(play, &play->roomCtx, this->actor.room)) { EnHoll_SetupAction(this, EnHoll_WaitRoomLoaded); this->resetBgCoverAlpha = true; player->actor.speed = 0.0f; @@ -308,9 +308,9 @@ void EnHoll_VerticalBgCover(EnHoll* this, PlayState* play) { s32 transitionActorIndex = GET_TRANSITION_ACTOR_INDEX(&this->actor); s32 side = (this->actor.yDistToPlayer > 0.0f) ? 0 : 1; - this->actor.room = play->transiActorCtx.list[transitionActorIndex].sides[side].room; + this->actor.room = play->transitionActors.list[transitionActorIndex].sides[side].room; if (this->actor.room != play->roomCtx.curRoom.num && - func_8009728C(play, &play->roomCtx, this->actor.room)) { + Room_RequestNewRoom(play, &play->roomCtx, this->actor.room)) { EnHoll_SetupAction(this, EnHoll_WaitRoomLoaded); this->resetBgCoverAlpha = true; } @@ -334,9 +334,9 @@ void EnHoll_VerticalInvisible(EnHoll* this, PlayState* play) { absYDistToPlayer > ENHOLL_V_INVISIBLE_LOAD_YDIST_MIN) { transitionActorIndex = GET_TRANSITION_ACTOR_INDEX(&this->actor); side = (this->actor.yDistToPlayer > 0.0f) ? 0 : 1; - this->actor.room = play->transiActorCtx.list[transitionActorIndex].sides[side].room; + this->actor.room = play->transitionActors.list[transitionActorIndex].sides[side].room; if (this->actor.room != play->roomCtx.curRoom.num && - func_8009728C(play, &play->roomCtx, this->actor.room)) { + Room_RequestNewRoom(play, &play->roomCtx, this->actor.room)) { EnHoll_SetupAction(this, EnHoll_WaitRoomLoaded); } } @@ -355,7 +355,7 @@ void EnHoll_HorizontalBgCoverSwitchFlag(EnHoll* this, PlayState* play) { Vec3f relPlayerPos; f32 orthogonalDistToPlayer; - func_8002DBD0(&this->actor, &relPlayerPos, &player->actor.world.pos); + Actor_WorldToActorCoords(&this->actor, &relPlayerPos, &player->actor.world.pos); orthogonalDistToPlayer = fabsf(relPlayerPos.z); if (ENHOLL_H_Y_MIN < relPlayerPos.y && relPlayerPos.y < ENHOLL_H_Y_MAX && @@ -375,9 +375,9 @@ void EnHoll_HorizontalBgCoverSwitchFlag(EnHoll* this, PlayState* play) { if (orthogonalDistToPlayer < ENHOLL_H_SWITCHFLAG_LOAD_DEPTH) { s32 side = (relPlayerPos.z < 0.0f) ? 0 : 1; - this->actor.room = play->transiActorCtx.list[transitionActorIndex].sides[side].room; + this->actor.room = play->transitionActors.list[transitionActorIndex].sides[side].room; if (this->actor.room != play->roomCtx.curRoom.num && - func_8009728C(play, &play->roomCtx, this->actor.room)) { + Room_RequestNewRoom(play, &play->roomCtx, this->actor.room)) { EnHoll_SetupAction(this, EnHoll_WaitRoomLoaded); } } @@ -392,7 +392,7 @@ void EnHoll_HorizontalBgCoverSwitchFlag(EnHoll* this, PlayState* play) { void EnHoll_WaitRoomLoaded(EnHoll* this, PlayState* play) { if (!EnHoll_IsKokiriLayer8() && play->roomCtx.status == 0) { - func_80097534(play, &play->roomCtx); + Room_FinishRoomChange(play, &play->roomCtx); if (play->bgCoverAlpha == 0) { this->resetBgCoverAlpha = false; } @@ -429,8 +429,7 @@ void EnHoll_Draw(Actor* thisx, PlayState* play) { Matrix_RotateY(M_PI, MTXMODE_APPLY); } - gSPMatrix(gfxP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_holl.c", 824), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(gfxP++, play->state.gfxCtx, "../z_en_holl.c", 824); gDPSetPrimColor(gfxP++, 0, 0, 0, 0, 0, (u8)this->planeAlpha); gSPDisplayList(gfxP++, sPlaneDL); diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.h b/src/overlays/actors/ovl_En_Holl/z_en_holl.h index cbc4ddb39e..2c87dc346b 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.h +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.h @@ -4,8 +4,8 @@ #include "ultra64.h" #include "global.h" -#define ENHOLL_GET_TYPE(thisx) (((thisx)->params >> 6) & 7) -#define ENHOLL_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x3F) +#define ENHOLL_GET_TYPE(thisx) PARAMS_GET_U((thisx)->params, 6, 3) +#define ENHOLL_GET_SWITCH_FLAG(thisx) PARAMS_GET_U((thisx)->params, 0, 6) /** * Two kinds of holls: @@ -23,7 +23,7 @@ * Bg Cover: The background geometry (e.g. room geometry but not actors) fades black as the player approaches. * Invisible: Approaching the holl does not cause any particular visual effect. */ -typedef enum { +typedef enum EnHollType { /* 0 */ ENHOLL_H_VISIBLE_NARROW, /* 1 */ ENHOLL_V_DOWN_BGCOVER_LARGE, // Only allows downwards transitions. 500 units radius. Used in fire temple drops. /* 2 */ ENHOLL_V_INVISIBLE, diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c index 8e3a20b269..e0a1f34432 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -14,7 +14,7 @@ #define HONOTRAP_AC_ACTIVE (1 << 1) #define HONOTRAP_OC_ACTIVE (1 << 2) -typedef enum { +typedef enum EnHonotrapEyeState { /* 0 */ HONOTRAP_EYE_OPEN, /* 1 */ HONOTRAP_EYE_HALF, /* 2 */ HONOTRAP_EYE_CLOSE, @@ -48,7 +48,7 @@ void EnHonotrap_FlameChase(EnHonotrap* this, PlayState* play); void EnHonotrap_SetupFlameVanish(EnHonotrap* this); void EnHonotrap_FlameVanish(EnHonotrap* this, PlayState* play); -ActorInit En_Honotrap_InitVars = { +ActorProfile En_Honotrap_Profile = { /**/ ACTOR_EN_HONOTRAP, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -63,7 +63,7 @@ ActorInit En_Honotrap_InitVars = { static ColliderTrisElementInit sTrisElementsInit[2] = { { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, ATELEM_NONE, @@ -74,7 +74,7 @@ static ColliderTrisElementInit sTrisElementsInit[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, ATELEM_NONE, @@ -87,7 +87,7 @@ static ColliderTrisElementInit sTrisElementsInit[2] = { static ColliderTrisInit sTrisInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -100,7 +100,7 @@ static ColliderTrisInit sTrisInit = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -108,7 +108,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00100000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -142,7 +142,7 @@ void EnHonotrap_GetNormal(Vec3f* normal, Vec3f* vec) { f32 magnitude = Math3D_Vec3fMagnitude(vec); if (magnitude < 0.001f) { - PRINTF("Warning : vector size zero (%s %d)\n", "../z_en_honotrap.c", 328, normal); + PRINTF("Warning : vector size zero (%s %d)\n", "../z_en_honotrap.c", 328); normal->x = normal->y = 0.0f; normal->z = 1.0f; @@ -319,7 +319,7 @@ void EnHonotrap_SetupFlameDrop(EnHonotrap* this) { void EnHonotrap_FlameDrop(EnHonotrap* this, PlayState* play) { if ((this->collider.cyl.base.atFlags & AT_HIT) || (this->timer <= 0)) { if ((this->collider.cyl.base.atFlags & AT_HIT) && !(this->collider.cyl.base.atFlags & AT_BOUNCED)) { - func_8002F71C(play, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 0.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 0.0f); } this->actor.velocity.x = this->actor.velocity.y = this->actor.velocity.z = 0.0f; EnHonotrap_SetupFlameVanish(this); @@ -500,8 +500,7 @@ void EnHonotrap_DrawEye(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sSilverEyeTextures[this->eyeState])); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_honotrap.c", 987), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_honotrap.c", 987); gSPDisplayList(POLY_OPA_DISP++, gEyeSwitch2DL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_honotrap.c", 991); @@ -522,8 +521,7 @@ void EnHonotrap_DrawFlame(Actor* thisx, PlayState* play) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); Matrix_RotateY(BINANG_TO_RAD((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) - this->actor.shape.rot.y + 0x8000)), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_honotrap.c", 1024), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_honotrap.c", 1024); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_honotrap.c", 1028); diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h index f9e3908bfe..f1b085686c 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h @@ -8,7 +8,7 @@ struct EnHonotrap; typedef void (*EnHonotrapActionFunc)(struct EnHonotrap*, PlayState*); -typedef union { +typedef union EnHonotrapCollider { struct { /* 0x00 */ ColliderTris tris; /* 0x20 */ ColliderTrisElement elements[2]; @@ -29,7 +29,7 @@ typedef struct EnHonotrap { /* 0x0240 */ u8 colChkFlags; } EnHonotrap; // size = 0x0244 -typedef enum { +typedef enum EnHonotrapType { HONOTRAP_TYPE_EYE, HONOTRAP_TYPE_FLAME_MOVE, HONOTRAP_TYPE_FLAME_DROP diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 43937fd02a..843427fc8b 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -5,6 +5,8 @@ */ #include "z_en_horse.h" +#include "global.h" +#include "versions.h" #include "overlays/actors/ovl_En_In/z_en_in.h" #include "assets/objects/object_horse/object_horse.h" #include "assets/objects/object_hni/object_hni.h" @@ -66,7 +68,7 @@ static f32 sPlaybackSpeeds[] = { 2.0f / 3.0f, 2.0f / 3.0f, 1.0f, 1.0f, 1.0f, 1.0 static SkeletonHeader* sSkeletonHeaders[] = { &gEponaSkel, &gHorseIngoSkel }; -ActorInit En_Horse_InitVars = { +ActorProfile En_Horse_Profile = { /**/ ACTOR_EN_HORSE, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -80,7 +82,7 @@ ActorInit En_Horse_InitVars = { static ColliderCylinderInit sCylinderInit1 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_TYPE_PLAYER, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -88,7 +90,7 @@ static ColliderCylinderInit sCylinderInit1 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000400, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -100,7 +102,7 @@ static ColliderCylinderInit sCylinderInit1 = { static ColliderCylinderInit sCylinderInit2 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -108,7 +110,7 @@ static ColliderCylinderInit sCylinderInit2 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -121,7 +123,7 @@ static ColliderCylinderInit sCylinderInit2 = { static ColliderJntSphElementInit sJntSphItemsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, ATELEM_NONE, @@ -134,7 +136,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -147,7 +149,7 @@ static ColliderJntSphInit sJntSphInit = { static CollisionCheckInfoInit D_80A65F38 = { 10, 35, 100, MASS_HEAVY }; -typedef struct { +typedef struct EnHorseSpawnpoint { /* 0x0 */ s16 sceneId; /* 0x2 */ Vec3s pos; /* 0x8 */ s16 angle; @@ -329,7 +331,7 @@ static EnHorseSpawnpoint sHorseSpawns[] = { { SCENE_LON_LON_RANCH, 907, 0, -2336, 0 }, }; -typedef struct { +typedef struct BridgeJumpPoint { /* 0x00 */ s16 zMin; /* 0x02 */ s16 zMax; /* 0x04 */ s16 xMin; @@ -345,7 +347,7 @@ static BridgeJumpPoint sBridgeJumps[] = { { -195, -40, -240, -120, -360, 0x4000, 0x7D0, 270, -52, -117 }, }; -typedef struct { +typedef struct RaceWaypoint { /* 0x0 */ s16 x; /* 0x2 */ s16 y; /* 0x4 */ s16 z; @@ -353,7 +355,7 @@ typedef struct { /* 0x8 */ s16 angle; } RaceWaypoint; // size = 0xA -typedef struct { +typedef struct RaceInfo { /* 0x0 */ s32 numWaypoints; /* 0x4 */ RaceWaypoint* waypoints; } RaceInfo; // size = 0x8 @@ -403,7 +405,7 @@ static EnHorseCsFunc sCutsceneActionFuncs[] = { NULL, EnHorse_CsMoveToPoint, EnHorse_CsJump, EnHorse_CsRearing, EnHorse_CsWarpMoveToPoint, EnHorse_CsWarpRearing, }; -typedef struct { +typedef struct CsActionEntry { /* 0x0 */ s32 cueId; /* 0x4 */ s32 csFuncIdx; } CsActionEntry; // size = 0x8 @@ -699,8 +701,10 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) { this->actor.world.rot.y = sHorseSpawns[i].angle; this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor); spawn = true; +#if OOT_VERSION >= PAL_1_0 SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->actor.world.pos, &this->actor.projectedPos, &this->actor.projectedW); +#endif } } } @@ -720,7 +724,7 @@ void EnHorse_ResetRace(EnHorse* this, PlayState* play) { s32 EnHorse_PlayerCanMove(EnHorse* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((player->stateFlags1 & PLAYER_STATE1_0) || func_8002DD78(GET_PLAYER(play)) == 1 || + if ((player->stateFlags1 & PLAYER_STATE1_0) || func_8002DD78(GET_PLAYER(play)) == true || (player->stateFlags1 & PLAYER_STATE1_20) || ((this->stateFlags & ENHORSE_FLAG_19) && !this->inRace) || this->action == ENHORSE_ACT_HBA || player->actor.flags & ACTOR_FLAG_TALK || play->csCtx.state != CS_STATE_IDLE) { @@ -756,7 +760,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { DREG(4) = 70; } - if (this->actor.params & 0x8000) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { this->actor.params &= ~0x8000; this->type = HORSE_HNI; @@ -1738,8 +1742,10 @@ void EnHorse_Inactive(EnHorse* this, PlayState* play2) { if (R_EPONAS_SONG_PLAYED && this->type == HORSE_EPONA) { R_EPONAS_SONG_PLAYED = false; if (EnHorse_Spawn(this, play) != 0) { +#if OOT_VERSION >= PAL_1_0 Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); +#endif this->stateFlags &= ~ENHORSE_INACTIVE; gSaveContext.save.info.horseData.sceneId = play->sceneId; @@ -1814,8 +1820,10 @@ void EnHorse_Idle(EnHorse* this, PlayState* play) { R_EPONAS_SONG_PLAYED = false; if (!func_80A5BBBC(play, this, &this->actor.world.pos)) { if (EnHorse_Spawn(this, play)) { +#if OOT_VERSION >= PAL_1_0 Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); +#endif this->followTimer = 0; EnHorse_SetFollowAnimation(this, play); Camera_SetViewParam(play->cameraPtrs[CAM_ID_MAIN], CAM_VIEW_TARGET, &this->actor); @@ -1928,6 +1936,12 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { this->skin.skelAnime.playSpeed = 1.0f; this->stateFlags &= ~ENHORSE_LAND2_SOUND; this->unk_21C = this->unk_228; +#if OOT_VERSION < PAL_1_0 + if (this->stateFlags & ENHORSE_DRAW) { + Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } +#endif } else if (this->stateFlags & ENHORSE_TURNING_TO_PLAYER) { this->actor.world.rot.y += this->followPlayerTurnSpeed; this->actor.shape.rot.y = this->actor.world.rot.y; @@ -3594,9 +3608,9 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { } if (thisx->speed == 0.0f && !(this->stateFlags & ENHORSE_FLAG_19)) { - thisx->colChkInfo.mass = 0xFF; + thisx->colChkInfo.mass = MASS_IMMOVABLE; } else { - thisx->colChkInfo.mass = 0xFE; + thisx->colChkInfo.mass = MASS_HEAVY; } if (thisx->speed >= 5.0f) { diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.h b/src/overlays/actors/ovl_En_Horse/z_en_horse.h index 785ddc8a9e..e4c98beb2e 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.h +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.h @@ -2,9 +2,10 @@ #define Z_EN_HORSE_H #include "ultra64.h" -#include "global.h" +#include "z64actor.h" +#include "z64skin.h" -typedef enum { +typedef enum EnHorseAction { /* 0 */ ENHORSE_ACT_FROZEN, /* 1 */ ENHORSE_ACT_INACTIVE, /* 2 */ ENHORSE_ACT_IDLE, @@ -63,7 +64,7 @@ typedef enum { struct EnHorse; -typedef enum { +typedef enum EnHorsePlayerDir { /* 0 */ PLAYER_DIR_FRONT_R, /* 1 */ PLAYER_DIR_FRONT_L, /* 2 */ PLAYER_DIR_BACK_R, @@ -72,7 +73,7 @@ typedef enum { /* 5 */ PLAYER_DIR_SIDE_L } EnHorsePlayerDir; -typedef enum { +typedef enum EnHorseAnimationIndex { /* 0 */ ENHORSE_ANIM_IDLE, /* 1 */ ENHORSE_ANIM_WHINNEY, /* 2 */ ENHORSE_ANIM_STOPPING, @@ -84,12 +85,12 @@ typedef enum { /* 8 */ ENHORSE_ANIM_HIGH_JUMP } EnHorseAnimationIndex; -typedef enum { +typedef enum HorseType { /* 0 */ HORSE_EPONA, /* 1 */ HORSE_HNI } HorseType; -typedef void (*EnHorsePostdrawFunc)(struct EnHorse*, PlayState*); +typedef void (*EnHorsePostdrawFunc)(struct EnHorse*, struct PlayState*); typedef struct EnHorse { /* 0x0000 */ Actor actor; diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c index 53c09dc472..839b25df2b 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c @@ -20,7 +20,7 @@ #define INGORACE_SET_TIMER (1 << 1) #define INGORACE_INGO_MOVE (1 << 2) -typedef enum { +typedef enum HorseGameIngoRaceResult { /* 0 */ INGORACE_NO_RESULT, /* 1 */ INGORACE_PLAYER_WIN, /* 2 */ INGORACE_INGO_WIN, @@ -35,7 +35,7 @@ typedef enum { #define MALONRACE_PLAYER_START (1 << 5) #define MALONRACE_PLAYER_ON_MARK (1 << 6) -typedef enum { +typedef enum HorseGameMalonRaceResult { /* 0 */ MALONRACE_NO_RESULT, /* 1 */ MALONRACE_SUCCESS, /* 2 */ MALONRACE_TIME_UP, @@ -48,7 +48,7 @@ void EnHorseGameCheck_Destroy(Actor* thisx, PlayState* play); void EnHorseGameCheck_Update(Actor* thisx, PlayState* play); void EnHorseGameCheck_Draw(Actor* thisx, PlayState* play); -ActorInit En_Horse_Game_Check_InitVars = { +ActorProfile En_Horse_Game_Check_Profile = { /**/ ACTOR_EN_HORSE_GAME_CHECK, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -90,7 +90,11 @@ s32 EnHorseGameCheck_InitIngoRace(EnHorseGameCheckBase* base, PlayState* play) { this->ingoHorse = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -250.0f, 1.0f, -1650.0f, 0, 0x4000, 0, 0x8003); if (this->ingoHorse == NULL) { +#if OOT_VERSION < NTSC_1_1 + LogUtils_HungupThread("../z_en_horse_game_check.c", 382); +#else LogUtils_HungupThread("../z_en_horse_game_check.c", 385); +#endif } this->startTimer = 0; this->finishTimer = 0; diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h index 2ef1d2b9a9..96834860e3 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h @@ -54,7 +54,7 @@ typedef union EnHorseGameCheck { EnHorseGameCheckMalonRace malon; } EnHorseGameCheck; // size = 0x01A4 -typedef enum { +typedef enum EnHorseGameCheckType { /* 0 */ HORSEGAME_NONE, /* 1 */ HORSEGAME_INGO_RACE, /* 2 */ HORSEGAME_GERUDO_ARCHERY, diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c index 0b324c3089..0612993947 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c @@ -9,7 +9,7 @@ #define FLAGS ACTOR_FLAG_4 -typedef struct { +typedef struct unk_D_80A69248 { /* 0x0 */ Vec3s unk_0; /* 0x6 */ u8 unk_6; } unk_D_80A69248; // size = 0x8 @@ -23,7 +23,7 @@ void func_80A68AC4(EnHorseGanon* this); void func_80A68AF0(EnHorseGanon* this, PlayState* play); void func_80A68DB0(EnHorseGanon* this, PlayState* play); -ActorInit En_Horse_Ganon_InitVars = { +ActorProfile En_Horse_Ganon_Profile = { /**/ ACTOR_EN_HORSE_GANON, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -44,7 +44,7 @@ static f32 splaySpeeds[] = { 2.0f / 3.0f, 2.0f / 3.0f, 1.0f, 1.0f, 1.0f, 2.0f / static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -52,7 +52,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -65,7 +65,7 @@ static ColliderCylinderInit sCylinderInit = { static ColliderJntSphElementInit sJntSphElementsInit[] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -78,7 +78,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c index 698a026306..a626ae27f3 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c @@ -19,7 +19,7 @@ void func_80A69EC0(EnHorseLinkChild* this); void func_80A6A4DC(EnHorseLinkChild* this); void func_80A6A724(EnHorseLinkChild* this); -ActorInit En_Horse_Link_Child_InitVars = { +ActorProfile En_Horse_Link_Child_Profile = { /**/ ACTOR_EN_HORSE_LINK_CHILD, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -38,14 +38,14 @@ static AnimationHeader* sAnimations[] = { static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -58,7 +58,7 @@ static ColliderCylinderInitType1 sCylinderInit = { static ColliderJntSphElementInit sJntSphElementInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -71,7 +71,7 @@ static ColliderJntSphElementInit sJntSphElementInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index 443dcf15c3..79e8998762 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -10,17 +10,17 @@ #define FLAGS 0 -typedef struct { +typedef struct EnHorseNormalUnkStruct1 { Vec3s pos; u8 unk_06; // this may be a s16 if the always-0 following byte is actually not padding } EnHorseNormalUnkStruct1; -typedef struct { +typedef struct EnHorseNormalUnkStruct2 { s32 len; EnHorseNormalUnkStruct1* items; } EnHorseNormalUnkStruct2; -typedef enum { +typedef enum EnHorseNormalAction { /* 0x00 */ HORSE_CYCLE_ANIMATIONS, /* 0x01 */ HORSE_WANDER, /* 0x02 */ HORSE_WAIT, @@ -39,7 +39,7 @@ void func_80A6BCEC(EnHorseNormal* this); void func_80A6C4CC(EnHorseNormal* this); void func_80A6C6B0(EnHorseNormal* this); -ActorInit En_Horse_Normal_InitVars = { +ActorProfile En_Horse_Normal_Profile = { /**/ ACTOR_EN_HORSE_NORMAL, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -59,7 +59,7 @@ static AnimationHeader* sAnimations[] = { static ColliderCylinderInit sCylinderInit1 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -67,7 +67,7 @@ static ColliderCylinderInit sCylinderInit1 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -79,7 +79,7 @@ static ColliderCylinderInit sCylinderInit1 = { static ColliderCylinderInit sCylinderInit2 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -87,7 +87,7 @@ static ColliderCylinderInit sCylinderInit2 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -100,7 +100,7 @@ static ColliderCylinderInit sCylinderInit2 = { static ColliderJntSphElementInit sJntSphElementsInit[] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -113,7 +113,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -259,7 +259,7 @@ void EnHorseNormal_Init(Actor* thisx, PlayState* play) { Skin_Init(play, &this->skin, &gHorseNormalSkel, &gHorseNormalIdleAnim); Animation_PlayOnce(&this->skin.skelAnime, sAnimations[this->animationIdx]); } - if ((this->actor.params & 0xF0) == 0x10 && (this->actor.params & 0xF) != 0xF) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x10 && PARAMS_GET_U(this->actor.params, 0, 4) != 0xF) { func_80A6B91C(this, play); } else { func_80A6BC48(this); @@ -286,7 +286,7 @@ void func_80A6B91C(EnHorseNormal* this, PlayState* play) { } void EnHorseNormal_FollowPath(EnHorseNormal* this, PlayState* play) { - Path* path = &play->pathList[this->actor.params & 0xF]; + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 4)]; Vec3s* pointPos = SEGMENTED_TO_VIRTUAL(path->points); f32 dx; f32 dz; @@ -720,7 +720,7 @@ void EnHorseNormal_Draw(Actor* thisx, PlayState* play2) { temp_f0_4 = (1.0f - (distFromGround * 0.01f)) * this->actor.shape.shadowScale; Matrix_Scale(this->actor.scale.x * temp_f0_4, 1.0f, this->actor.scale.z * temp_f0_4, MTXMODE_APPLY); Matrix_RotateY(BINANG_TO_RAD(cloneRotY), MTXMODE_APPLY); - mtx = MATRIX_NEW(play->state.gfxCtx, "../z_en_horse_normal.c", 2329); + mtx = MATRIX_FINALIZE(play->state.gfxCtx, "../z_en_horse_normal.c", 2329); if (mtx != NULL) { gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gHorseShadowDL); diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c index e3da728e85..dd8068cd2c 100644 --- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c +++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c @@ -18,7 +18,7 @@ void EnHorseZelda_Stop(EnHorseZelda* this, PlayState* play); void EnHorseZelda_Gallop(EnHorseZelda* this, PlayState* play); void EnHorseZelda_SetupStop(EnHorseZelda* this); -ActorInit En_Horse_Zelda_InitVars = { +ActorProfile En_Horse_Zelda_Profile = { /**/ ACTOR_EN_HORSE_ZELDA, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -36,14 +36,14 @@ static f32 splaySpeeds[] = { 2.0f / 3.0f }; static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -56,7 +56,7 @@ static ColliderCylinderInitType1 sCylinderInit = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -69,7 +69,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -82,7 +82,7 @@ static ColliderJntSphInit sJntSphInit = { static CollisionCheckInfoInit sColChkInfoInit = { 10, 35, 100, MASS_HEAVY }; -typedef struct { +typedef struct HorsePosSpeed { /* 0x0 */ Vec3s pos; /* 0x6 */ u8 speedXZ; } HorsePosSpeed; // size = 0x8 diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index 09b1da8dda..b5c521da2d 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -8,7 +8,7 @@ #include "terminal.h" #include "assets/objects/object_hs/object_hs.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnHs_Init(Actor* thisx, PlayState* play); void EnHs_Destroy(Actor* thisx, PlayState* play); @@ -18,7 +18,7 @@ void EnHs_Draw(Actor* thisx, PlayState* play); void func_80A6E9AC(EnHs* this, PlayState* play); void func_80A6E6B0(EnHs* this, PlayState* play); -ActorInit En_Hs_InitVars = { +ActorProfile En_Hs_Profile = { /**/ ACTOR_EN_HS, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -32,7 +32,7 @@ ActorInit En_Hs_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, @@ -40,7 +40,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -89,7 +89,7 @@ void EnHs_Init(Actor* thisx, PlayState* play) { } this->unk_2A8 = 0; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; } void EnHs_Destroy(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c index d84e35c4ef..b1b04107f0 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -8,7 +8,7 @@ #include "terminal.h" #include "assets/objects/object_hs/object_hs.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnHs2_Init(Actor* thisx, PlayState* play); void EnHs2_Destroy(Actor* thisx, PlayState* play); @@ -16,7 +16,7 @@ void EnHs2_Update(Actor* thisx, PlayState* play); void EnHs2_Draw(Actor* thisx, PlayState* play); void func_80A6F1A4(EnHs2* this, PlayState* play); -ActorInit En_Hs2_InitVars = { +ActorProfile En_Hs2_Profile = { /**/ ACTOR_EN_HS2, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -30,7 +30,7 @@ ActorInit En_Hs2_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, @@ -38,7 +38,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -63,7 +63,7 @@ void EnHs2_Init(Actor* thisx, PlayState* play) { PRINTF(VT_FGCOL(CYAN) " ヒヨコの店(子人の時) \n" VT_RST); this->actionFunc = func_80A6F1A4; this->unk_2A8 = 0; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; } void EnHs2_Destroy(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index 37e0666f3e..9ac751d4e7 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -5,6 +5,7 @@ */ #include "z_en_hy.h" +#include "versions.h" #include "assets/objects/object_aob/object_aob.h" #include "assets/objects/object_ahg/object_ahg.h" #include "assets/objects/object_bob/object_bob.h" @@ -15,24 +16,24 @@ #include "assets/objects/object_cob/object_cob.h" #include "assets/objects/object_os_anime/object_os_anime.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) void EnHy_Init(Actor* thisx, PlayState* play); void EnHy_Destroy(Actor* thisx, PlayState* play); void EnHy_Update(Actor* thisx, PlayState* play); void EnHy_Draw(Actor* thisx, PlayState* play); -void EnHy_InitImpl(EnHy* this, PlayState* play); -void func_80A7134C(EnHy* this, PlayState* play); -void func_80A71530(EnHy* this, PlayState* play); -void func_80A711B4(EnHy* this, PlayState* play); -void func_80A712C0(EnHy* this, PlayState* play); -void func_80A710F8(EnHy* this, PlayState* play); -void func_80A7127C(EnHy* this, PlayState* play); +void EnHy_WaitForObjects(EnHy* this, PlayState* play); +void EnHy_Pace(EnHy* this, PlayState* play); +void EnHy_FinishGivingDogFoundReward(EnHy* this, PlayState* play); +void EnHy_Walk(EnHy* this, PlayState* play); +void EnHy_SetupPace(EnHy* this, PlayState* play); +void EnHy_WatchDog(EnHy* this, PlayState* play); +void EnHy_Fidget(EnHy* this, PlayState* play); void EnHy_DoNothing(EnHy* this, PlayState* play); -void func_80A714C4(EnHy* this, PlayState* play); +void EnHy_WaitDogFoundRewardGiven(EnHy* this, PlayState* play); -ActorInit En_Hy_InitVars = { +ActorProfile En_Hy_Profile = { /**/ ACTOR_EN_HY, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -46,7 +47,7 @@ ActorInit En_Hy_InitVars = { static ColliderCylinderInit sColCylInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -54,7 +55,7 @@ static ColliderCylinderInit sColCylInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -67,85 +68,113 @@ static ColliderCylinderInit sColCylInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; // NULL-terminated arrays of eye textures -static void* sEyeTexturesAOB[] = { gDogLadyEyeOpenTex, gDogLadyEyeHalfTex, gDogLadyEyeClosedTex, NULL }; -static void* sEyeTexturesAHG7[] = { object_ahg_Tex_00057C, object_ahg_Tex_00067C, object_ahg_Tex_00077C, NULL }; -static void* sEyeTexturesBBA[] = { object_bba_Tex_0004C8, NULL }; -static void* sEyeTexturesBJI13[] = { object_bji_Tex_0005FC, object_bji_Tex_0009FC, object_bji_Tex_000DFC, NULL }; -static void* sEyeTexturesBOJ2[] = { object_boj_Tex_0005FC, object_boj_Tex_0006FC, object_boj_Tex_0007FC, NULL }; -static void* sEyeTexturesBOB[] = { object_bob_Tex_0007C8, object_bob_Tex_000FC8, object_bob_Tex_0017C8, NULL }; - -typedef struct { - /* 0x00 */ s16 objectId; - /* 0x04 */ Gfx* headDList; - /* 0x08 */ void** eyeTextures; +static void* sHylianWoman1EyeTextures[] = { + gHylianWoman1EyeOpenTex, + gHylianWoman1EyeHalfTex, + gHylianWoman1EyeClosedTex, + NULL, +}; +static void* sHylianMan1EyeTextures[] = { + gHylianMan1BeardedEyeOpenTex, + gHylianMan1BeardedEyeHalfTex, + gHylianMan1BeardedEyeClosedTex, + NULL, +}; +static void* sHylainOldWomanEyeTextures[] = { + gHylianOldWomanEyeTex, + NULL, +}; +static void* sHylianOldManEyeTextures[] = { + gHylianOldManEyeOpenTex, + gHylianOldManEyeHalfTex, + gHylianOldManEyeClosedTex, + NULL, +}; +static void* sHylianMan2EyeTextures[] = { + gHylianMan2MustachedEyeOpenTex, + gHylianMan2MustachedEyeHalfTex, + gHylianMan2MustachedEyeClosedTex, + NULL, +}; +static void* sHylianWoman2EyeTextures[] = { + gHylianWoman2EyeOpenTex, + gHylianWoman2EyeHalfTex, + gHylianWoman2EyeClosedTex, + NULL, +}; + +typedef struct EnHyHeadInfo { + /* 0x0 */ s16 objectId; + /* 0x4 */ Gfx* headDList; + /* 0x8 */ void** eyeTextures; } EnHyHeadInfo; // size = 0xC typedef enum { - /* 0 */ ENHY_HEAD_AOB, - /* 1 */ ENHY_HEAD_BOB, - /* 2 */ ENHY_HEAD_BOJ_2, - /* 3 */ ENHY_HEAD_BOJ_3, - /* 4 */ ENHY_HEAD_BOJ_4, - /* 5 */ ENHY_HEAD_BOJ_5, - /* 6 */ ENHY_HEAD_BOJ_6, - /* 7 */ ENHY_HEAD_AHG_7, - /* 8 */ ENHY_HEAD_AHG_8, - /* 9 */ ENHY_HEAD_AHG_9, - /* 10 */ ENHY_HEAD_BBA, - /* 11 */ ENHY_HEAD_CNE_11, - /* 12 */ ENHY_HEAD_CNE_12, - /* 13 */ ENHY_HEAD_BJI_13, - /* 14 */ ENHY_HEAD_BJI_14, - /* 15 */ ENHY_HEAD_COB + /* 0 */ ENHY_HEAD_WOMAN_1, + /* 1 */ ENHY_HEAD_WOMAN_2, + /* 2 */ ENHY_HEAD_MAN_2_MUSTACHE, + /* 3 */ ENHY_HEAD_MAN_2_BALD, + /* 4 */ ENHY_HEAD_MAN_2_LONG_HAIR, + /* 5 */ ENHY_HEAD_MAN_2_ALT_MUSTACHE, + /* 6 */ ENHY_HEAD_MAN_2_BEARD, + /* 7 */ ENHY_HEAD_MAN_1_BEARD, + /* 8 */ ENHY_HEAD_MAN_1_SHAVED, + /* 9 */ ENHY_HEAD_MAN_1_BOWL_CUT, + /* 10 */ ENHY_HEAD_OLD_WOMAN, + /* 11 */ ENHY_HEAD_YOUNG_WOMAN_BROWN_HAIR, + /* 12 */ ENHY_HEAD_YOUNG_WOMAN_ORANGE_HAIR, + /* 13 */ ENHY_HEAD_OLD_MAN, + /* 14 */ ENHY_HEAD_OLD_MAN_BALD, + /* 15 */ ENHY_HEAD_WOMAN_3 } EnHyHeadIndex; static EnHyHeadInfo sHeadInfo[] = { - /* ENHY_HEAD_AOB */ { OBJECT_AOB, gDogLadyHeadDL, sEyeTexturesAOB }, - /* ENHY_HEAD_BOB */ { OBJECT_BOB, object_bob_DL_003B78, sEyeTexturesBOB }, - /* ENHY_HEAD_BOJ_2 */ { OBJECT_BOJ, object_boj_DL_0026F0, sEyeTexturesBOJ2 }, - /* ENHY_HEAD_BOJ_3 */ { OBJECT_BOJ, object_boj_DL_0052E0, NULL }, - /* ENHY_HEAD_BOJ_4 */ { OBJECT_BOJ, object_boj_DL_005528, NULL }, - /* ENHY_HEAD_BOJ_5 */ { OBJECT_BOJ, object_boj_DL_005738, NULL }, - /* ENHY_HEAD_BOJ_6 */ { OBJECT_BOJ, object_boj_DL_0059B0, NULL }, - /* ENHY_HEAD_AHG_7 */ { OBJECT_AHG, object_ahg_DL_0030F0, sEyeTexturesAHG7 }, - /* ENHY_HEAD_AHG_8 */ { OBJECT_AHG, object_ahg_DL_005508, NULL }, - /* ENHY_HEAD_AHG_9 */ { OBJECT_AHG, object_ahg_DL_005728, NULL }, - /* ENHY_HEAD_BBA */ { OBJECT_BBA, object_bba_DL_002948, sEyeTexturesBBA }, - /* ENHY_HEAD_CNE_11 */ { OBJECT_CNE, gCneHeadBrownHairDL, NULL }, - /* ENHY_HEAD_CNE_12 */ { OBJECT_CNE, gCneHeadOrangeHairDL, NULL }, - /* ENHY_HEAD_BJI_13 */ { OBJECT_BJI, object_bji_DL_002560, sEyeTexturesBJI13 }, - /* ENHY_HEAD_BJI_14 */ { OBJECT_BJI, object_bji_DL_003F68, NULL }, - /* ENHY_HEAD_COB */ { OBJECT_COB, object_cob_DL_001300, NULL }, + /* ENHY_HEAD_WOMAN_1 */ { OBJECT_AOB, gHylianWoman1HeadDL, sHylianWoman1EyeTextures }, + /* ENHY_HEAD_WOMAN_2 */ { OBJECT_BOB, gHylianWoman2HeadDL, sHylianWoman2EyeTextures }, + /* ENHY_HEAD_MAN_2_MUSTACHE */ { OBJECT_BOJ, gHylianMan2MustachedHeadDL, sHylianMan2EyeTextures }, + /* ENHY_HEAD_MAN_2_BALD */ { OBJECT_BOJ, gHylianMan2BaldHeadDL, NULL }, + /* ENHY_HEAD_MAN_2_LONG_HAIR */ { OBJECT_BOJ, gHylianMan2LongHairHeadDL, NULL }, + /* ENHY_HEAD_MAN_2_ALT_MUSTACHE */ { OBJECT_BOJ, gHylianMan2AltMustachedHeadDL, NULL }, + /* ENHY_HEAD_MAN_2_BEARD */ { OBJECT_BOJ, gHylianMan2BeardedHeadDL, NULL }, + /* ENHY_HEAD_MAN_1_BEARD */ { OBJECT_AHG, gHylianMan1BeardedHeadDL, sHylianMan1EyeTextures }, + /* ENHY_HEAD_MAN_1_SHAVED */ { OBJECT_AHG, gHylianMan1ShavedHeadDL, NULL }, + /* ENHY_HEAD_MAN_1_BOWL_CUT */ { OBJECT_AHG, gHylianMan1BowlCutHeadDL, NULL }, + /* ENHY_HEAD_OLD_WOMAN */ { OBJECT_BBA, gHylianOldWomanHeadDL, sHylainOldWomanEyeTextures }, + /* ENHY_HEAD_YOUNG_WOMAN_BROWN_HAIR */ { OBJECT_CNE, gHylianYoungWomanBrownHairHeadDL, NULL }, + /* ENHY_HEAD_YOUNG_WOMAN_ORANGE_HAIR */ { OBJECT_CNE, gHylianYoungWomanOrangeHairHeadDL, NULL }, + /* ENHY_HEAD_OLD_MAN */ { OBJECT_BJI, gHylianOldManHeadDL, sHylianOldManEyeTextures }, + /* ENHY_HEAD_OLD_MAN_BALD */ { OBJECT_BJI, gHylianOldManBaldHeadDL, NULL }, + /* ENHY_HEAD_WOMAN_3 */ { OBJECT_COB, gHylianWoman3HeadDL, NULL }, }; -typedef struct { - /* 0x00 */ s16 objectId; - /* 0x04 */ FlexSkeletonHeader* skeleton; +typedef struct EnHySkeletonInfo { + /* 0x0 */ s16 objectId; + /* 0x4 */ FlexSkeletonHeader* skeleton; } EnHySkeletonInfo; // size = 0x8 typedef enum { - /* 0 */ ENHY_SKEL_AOB, - /* 1 */ ENHY_SKEL_BOB, - /* 2 */ ENHY_SKEL_BOJ, - /* 3 */ ENHY_SKEL_AHG, - /* 4 */ ENHY_SKEL_BBA, - /* 5 */ ENHY_SKEL_CNE, - /* 6 */ ENHY_SKEL_BJI, - /* 7 */ ENHY_SKEL_COB + /* 0 */ ENHY_SKEL_WOMAN_1, + /* 1 */ ENHY_SKEL_WOMAN_2, + /* 2 */ ENHY_SKEL_MAN_2, + /* 3 */ ENHY_SKEL_MAN_1, + /* 4 */ ENHY_SKEL_OLD_WOMAN, + /* 5 */ ENHY_SKEL_YOUNG_WOMAN, + /* 6 */ ENHY_SKEL_OLD_MAN, + /* 7 */ ENHY_SKEL_WOMAN_3 } EnHySkeletonIndex; static EnHySkeletonInfo sSkeletonInfo[] = { - /* ENHY_SKEL_AOB */ { OBJECT_AOB, &gDogLadySkel }, - /* ENHY_SKEL_BOB */ { OBJECT_BOB, &object_bob_Skel_0000F0 }, - /* ENHY_SKEL_BOJ */ { OBJECT_BOJ, &object_boj_Skel_0000F0 }, - /* ENHY_SKEL_AHG */ { OBJECT_AHG, &object_ahg_Skel_0000F0 }, - /* ENHY_SKEL_BBA */ { OBJECT_BBA, &object_bba_Skel_0000F0 }, - /* ENHY_SKEL_CNE */ { OBJECT_CNE, &gCneSkel }, - /* ENHY_SKEL_BJI */ { OBJECT_BJI, &object_bji_Skel_0000F0 }, - /* ENHY_SKEL_COB */ { OBJECT_COB, &object_cob_Skel_0021F8 }, + /* ENHY_SKEL_WOMAN_1 */ { OBJECT_AOB, &gHylianWoman1Skel }, + /* ENHY_SKEL_WOMAN_2 */ { OBJECT_BOB, &gHylianWoman2Skel }, + /* ENHY_SKEL_MAN_2 */ { OBJECT_BOJ, &gHylianMan2Skel }, + /* ENHY_SKEL_MAN_1 */ { OBJECT_AHG, &gHylianMan1Skel }, + /* ENHY_SKEL_OLD_WOMAN */ { OBJECT_BBA, &gHylianOldWomanSkel }, + /* ENHY_SKEL_YOUNG_WOMAN */ { OBJECT_CNE, &gHylianYoungWomanSkel }, + /* ENHY_SKEL_OLD_MAN */ { OBJECT_BJI, &gHylianOldManSkel }, + /* ENHY_SKEL_WOMAN_3 */ { OBJECT_COB, &gHylianWoman3Skel }, }; -typedef enum { +typedef enum EnHyAnimationIndex { /* 0 */ ENHY_ANIM_0, /* 1 */ ENHY_ANIM_1, /* 2 */ ENHY_ANIM_2, @@ -176,193 +205,340 @@ typedef enum { } EnHyAnimationIndex; static AnimationInfo sAnimationInfo[] = { - /* ENHY_ANIM_0 */ { &gObjOsAnim_092C, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_1 */ { &gObjOsAnim_0228, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_2 */ { &gObjOsAnim_4CF4, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_3 */ { &gObjOsAnim_16EC, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_4 */ { &gObjOsAnim_265C, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_5 */ { &gObjOsAnim_42AC, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_6 */ { &gObjOsAnim_28DC, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_7 */ { &gObjOsAnim_2160, 1.0f, 0.0f, -1.0f, 0x00, -10.0f }, - /* ENHY_ANIM_8 */ { &gObjOsAnim_265C, 1.0f, 0.0f, -1.0f, 0x00, -10.0f }, - /* ENHY_ANIM_9 */ { &gObjOsAnim_4E90, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_10 */ { &gObjOsAnim_1E7C, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_11 */ { &gObjOsAnim_0170, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_12 */ { &gObjOsAnim_00B4, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_13 */ { &gObjOsAnim_3D84, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_14 */ { &gObjOsAnim_41F8, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_15 */ { &gObjOsAnim_300C, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_16 */ { &gObjOsAnim_31B0, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_17 */ { &gObjOsAnim_31B0, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, - /* ENHY_ANIM_18 */ { &gObjOsAnim_2D0C, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_19 */ { &gObjOsAnim_2DC0, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_20 */ { &gObjOsAnim_4408, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_21 */ { &gObjOsAnim_1F18, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_22 */ { &gObjOsAnim_4F28, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, - /* ENHY_ANIM_23 */ { &gObjOsAnim_33B4, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, - /* ENHY_ANIM_24 */ { &gObjOsAnim_12E8, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, - /* ENHY_ANIM_25 */ { &gObjOsAnim_0FE4, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, - /* ENHY_ANIM_26 */ { &gObjOsAnim_0BFC, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, + /* ENHY_ANIM_0 */ { &gObjOsAnim_092C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_1 */ { &gObjOsAnim_0228, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_2 */ { &gObjOsAnim_4CF4, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_3 */ { &gObjOsAnim_16EC, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_4 */ { &gObjOsAnim_265C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_5 */ { &gObjOsAnim_42AC, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_6 */ { &gObjOsAnim_28DC, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_7 */ { &gObjOsAnim_2160, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f }, + /* ENHY_ANIM_8 */ { &gObjOsAnim_265C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f }, + /* ENHY_ANIM_9 */ { &gObjOsAnim_4E90, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_10 */ { &gObjOsAnim_1E7C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_11 */ { &gObjOsAnim_0170, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_12 */ { &gObjOsAnim_00B4, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_13 */ { &gObjOsAnim_3D84, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_14 */ { &gObjOsAnim_41F8, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_15 */ { &gObjOsAnim_300C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_16 */ { &gObjOsAnim_31B0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_17 */ { &gObjOsAnim_31B0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -8.0f }, + /* ENHY_ANIM_18 */ { &gObjOsAnim_2D0C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_19 */ { &gObjOsAnim_2DC0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_20 */ { &gObjOsAnim_4408, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_21 */ { &gObjOsAnim_1F18, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_22 */ { &gObjOsAnim_4F28, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + /* ENHY_ANIM_23 */ { &gObjOsAnim_33B4, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -8.0f }, + /* ENHY_ANIM_24 */ { &gObjOsAnim_12E8, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -8.0f }, + /* ENHY_ANIM_25 */ { &gObjOsAnim_0FE4, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -8.0f }, + /* ENHY_ANIM_26 */ { &gObjOsAnim_0BFC, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -8.0f }, }; -typedef struct { - /* 0x00 */ u8 headInfoIndex; // EnHyHeadIndex - /* 0x01 */ u8 skelInfoIndex2; // EnHySkeletonIndex, see EnHy.objectSlotSkel2 - /* 0x02 */ Color_RGBA8 envColorSeg8; - /* 0x06 */ u8 skelInfoIndex1; // EnHySkeletonIndex, see EnHy.objectSlotSkel1 - /* 0x07 */ Color_RGBA8 envColorSeg9; - /* 0x0B */ u8 animInfoIndex; // EnHyAnimationIndex -} EnHyModelInfo; // size = 0xC +typedef struct EnHyModelInfo { + /* 0x0 */ u8 headInfoIndex; // EnHyHeadIndex + /* 0x1 */ u8 upperSkelInfoIndex; // EnHySkeletonIndex, see EnHy.objectSlotUpperSkel + /* 0x2 */ Color_RGBA8 envColorSeg8; + /* 0x6 */ u8 lowerSkelInfoIndex; // EnHySkeletonIndex, see EnHy.objectSlotLowerSkel + /* 0x7 */ Color_RGBA8 envColorSeg9; + /* 0xB */ u8 animInfoIndex; // EnHyAnimationIndex +} EnHyModelInfo; // size = 0xC static EnHyModelInfo sModelInfo[] = { - /* ENHY_TYPE_AOB */ - { ENHY_HEAD_AOB, ENHY_SKEL_AOB, { 255, 255, 255, 255 }, ENHY_SKEL_AOB, { 255, 255, 255, 255 }, ENHY_ANIM_0 }, - /* ENHY_TYPE_COB */ - { ENHY_HEAD_COB, ENHY_SKEL_COB, { 255, 255, 255, 255 }, ENHY_SKEL_COB, { 255, 255, 255, 255 }, ENHY_ANIM_22 }, - /* ENHY_TYPE_AHG_2 */ - { ENHY_HEAD_AHG_7, ENHY_SKEL_AHG, { 255, 255, 255, 255 }, ENHY_SKEL_AHG, { 255, 255, 255, 255 }, ENHY_ANIM_1 }, - /* ENHY_TYPE_BOJ_3 */ - { ENHY_HEAD_BOJ_3, ENHY_SKEL_BOJ, { 255, 255, 255, 0 }, ENHY_SKEL_BOJ, { 55, 55, 255, 0 }, ENHY_ANIM_15 }, - /* ENHY_TYPE_AHG_4 */ - { ENHY_HEAD_AHG_8, ENHY_SKEL_AHG, { 0, 0, 0, 0 }, ENHY_SKEL_AHG, { 255, 0, 0, 0 }, ENHY_ANIM_11 }, - /* ENHY_TYPE_BOJ_5 */ - { ENHY_HEAD_BOJ_4, ENHY_SKEL_BOJ, { 50, 80, 0, 0 }, ENHY_SKEL_BOJ, { 50, 80, 0, 0 }, ENHY_ANIM_16 }, - /* ENHY_TYPE_BBA */ - { ENHY_HEAD_BBA, ENHY_SKEL_BBA, { 255, 255, 255, 255 }, ENHY_SKEL_BBA, { 255, 255, 255, 255 }, ENHY_ANIM_10 }, - /* ENHY_TYPE_BJI_7 */ - { ENHY_HEAD_BJI_13, ENHY_SKEL_BJI, { 0, 50, 160, 0 }, ENHY_SKEL_BJI, { 255, 255, 255, 0 }, ENHY_ANIM_4 }, - /* ENHY_TYPE_CNE_8 */ - { ENHY_HEAD_CNE_11, ENHY_SKEL_CNE, { 160, 180, 255, 0 }, ENHY_SKEL_CNE, { 160, 180, 255, 0 }, ENHY_ANIM_9 }, - /* ENHY_TYPE_BOJ_9 */ - { ENHY_HEAD_BOJ_2, ENHY_SKEL_BOJ, { 220, 0, 80, 0 }, ENHY_SKEL_BOJ, { 255, 255, 255, 0 }, ENHY_ANIM_13 }, - /* ENHY_TYPE_BOJ_10 */ - { ENHY_HEAD_BOJ_2, ENHY_SKEL_BOJ, { 0, 130, 220, 0 }, ENHY_SKEL_BOJ, { 255, 255, 255, 0 }, ENHY_ANIM_14 }, - /* ENHY_TYPE_CNE_11 */ - { ENHY_HEAD_CNE_12, ENHY_SKEL_CNE, { 70, 160, 230, 0 }, ENHY_SKEL_CNE, { 255, 255, 100, 0 }, ENHY_ANIM_20 }, - /* ENHY_TYPE_BOJ_12 */ - { ENHY_HEAD_BOJ_5, ENHY_SKEL_BOJ, { 150, 60, 90, 0 }, ENHY_SKEL_BOJ, { 255, 240, 150, 0 }, ENHY_ANIM_18 }, - /* ENHY_TYPE_AHG_13 */ - { ENHY_HEAD_AHG_9, ENHY_SKEL_AHG, { 200, 180, 255, 0 }, ENHY_SKEL_AHG, { 200, 180, 255, 0 }, ENHY_ANIM_12 }, - /* ENHY_TYPE_BOJ_14 */ - { ENHY_HEAD_BOJ_6, ENHY_SKEL_BOJ, { 140, 255, 110, 0 }, ENHY_SKEL_BOJ, { 255, 255, 255, 0 }, ENHY_ANIM_19 }, - /* ENHY_TYPE_BJI_15 */ - { ENHY_HEAD_BJI_14, ENHY_SKEL_BJI, { 130, 70, 20, 0 }, ENHY_SKEL_BJI, { 130, 180, 255, 0 }, ENHY_ANIM_21 }, - /* ENHY_TYPE_BOJ_16 */ - { ENHY_HEAD_BOJ_2, ENHY_SKEL_BOJ, { 255, 255, 255, 255 }, ENHY_SKEL_BOJ, { 255, 255, 255, 255 }, ENHY_ANIM_5 }, - /* ENHY_TYPE_AHG_17 */ - { ENHY_HEAD_AHG_8, ENHY_SKEL_AHG, { 90, 100, 20, 255 }, ENHY_SKEL_AHG, { 100, 140, 50, 255 }, ENHY_ANIM_11 }, - /* ENHY_TYPE_BOB_18 */ - { ENHY_HEAD_BOB, ENHY_SKEL_BOB, { 255, 255, 255, 255 }, ENHY_SKEL_BOB, { 255, 255, 255, 255 }, ENHY_ANIM_6 }, - /* ENHY_TYPE_BJI_19 */ - { ENHY_HEAD_BJI_14, ENHY_SKEL_BJI, { 160, 0, 100, 0 }, ENHY_SKEL_BJI, { 70, 130, 210, 0 }, ENHY_ANIM_21 }, - /* ENHY_TYPE_AHG_20 */ - { ENHY_HEAD_AHG_9, ENHY_SKEL_AHG, { 160, 230, 0, 0 }, ENHY_SKEL_AHG, { 0, 150, 110, 0 }, ENHY_ANIM_12 }, + /* ENHY_TYPE_DOG_LADY */ + { + ENHY_HEAD_WOMAN_1, + ENHY_SKEL_WOMAN_1, + { 255, 255, 255, 255 }, + ENHY_SKEL_WOMAN_1, + { 255, 255, 255, 255 }, + ENHY_ANIM_0, + }, + /* ENHY_TYPE_WOMAN_3 */ + { + ENHY_HEAD_WOMAN_3, + ENHY_SKEL_WOMAN_3, + { 255, 255, 255, 255 }, + ENHY_SKEL_WOMAN_3, + { 255, 255, 255, 255 }, + ENHY_ANIM_22, + }, + /* ENHY_TYPE_MAN_1_BEARD */ + { + ENHY_HEAD_MAN_1_BEARD, + ENHY_SKEL_MAN_1, + { 255, 255, 255, 255 }, + ENHY_SKEL_MAN_1, + { 255, 255, 255, 255 }, + ENHY_ANIM_1, + }, + /* ENHY_TYPE_MAN_2_BALD */ + { + ENHY_HEAD_MAN_2_BALD, + ENHY_SKEL_MAN_2, + { 255, 255, 255, 0 }, + ENHY_SKEL_MAN_2, + { 55, 55, 255, 0 }, + ENHY_ANIM_15, + }, + /* ENHY_TYPE_MAN_1_SHAVED_BLACK_SHIRT */ + { + ENHY_HEAD_MAN_1_SHAVED, + ENHY_SKEL_MAN_1, + { 0, 0, 0, 0 }, + ENHY_SKEL_MAN_1, + { 255, 0, 0, 0 }, + ENHY_ANIM_11, + }, + /* ENHY_TYPE_BEGGAR */ + { + ENHY_HEAD_MAN_2_LONG_HAIR, + ENHY_SKEL_MAN_2, + { 50, 80, 0, 0 }, + ENHY_SKEL_MAN_2, + { 50, 80, 0, 0 }, + ENHY_ANIM_16, + }, + /* ENHY_TYPE_OLD_WOMAN */ + { + ENHY_HEAD_OLD_WOMAN, + ENHY_SKEL_OLD_WOMAN, + { 255, 255, 255, 255 }, + ENHY_SKEL_OLD_WOMAN, + { 255, 255, 255, 255 }, + ENHY_ANIM_10, + }, + /* ENHY_TYPE_OLD_MAN */ + { + ENHY_HEAD_OLD_MAN, + ENHY_SKEL_OLD_MAN, + { 0, 50, 160, 0 }, + ENHY_SKEL_OLD_MAN, + { 255, 255, 255, 0 }, + ENHY_ANIM_4, + }, + /* ENHY_TYPE_YOUNG_WOMAN_BROWN_HAIR */ + { + ENHY_HEAD_YOUNG_WOMAN_BROWN_HAIR, + ENHY_SKEL_YOUNG_WOMAN, + { 160, 180, 255, 0 }, + ENHY_SKEL_YOUNG_WOMAN, + { 160, 180, 255, 0 }, + ENHY_ANIM_9, + }, + /* ENHY_TYPE_MAN_2_MUSTACHE_RED_SHIRT */ + { + ENHY_HEAD_MAN_2_MUSTACHE, + ENHY_SKEL_MAN_2, + { 220, 0, 80, 0 }, + ENHY_SKEL_MAN_2, + { 255, 255, 255, 0 }, + ENHY_ANIM_13, + }, + /* ENHY_TYPE_MAN_2_MUSTACHE_BLUE_SHIRT */ + { + ENHY_HEAD_MAN_2_MUSTACHE, + ENHY_SKEL_MAN_2, + { 0, 130, 220, 0 }, + ENHY_SKEL_MAN_2, + { 255, 255, 255, 0 }, + ENHY_ANIM_14, + }, + /* ENHY_TYPE_YOUNG_WOMAN_ORANGE_HAIR */ + { + ENHY_HEAD_YOUNG_WOMAN_ORANGE_HAIR, + ENHY_SKEL_YOUNG_WOMAN, + { 70, 160, 230, 0 }, + ENHY_SKEL_YOUNG_WOMAN, + { 255, 255, 100, 0 }, + ENHY_ANIM_20, + }, + /* ENHY_TYPE_MAN_2_ALT_MUSTACHE */ + { + ENHY_HEAD_MAN_2_ALT_MUSTACHE, + ENHY_SKEL_MAN_2, + { 150, 60, 90, 0 }, + ENHY_SKEL_MAN_2, + { 255, 240, 150, 0 }, + ENHY_ANIM_18, + }, + /* ENHY_TYPE_MAN_1_BOWL_CUT_PURPLE_SHIRT */ + { + ENHY_HEAD_MAN_1_BOWL_CUT, + ENHY_SKEL_MAN_1, + { 200, 180, 255, 0 }, + ENHY_SKEL_MAN_1, + { 200, 180, 255, 0 }, + ENHY_ANIM_12, + }, + /* ENHY_TYPE_MAN_2_BEARD */ + { + ENHY_HEAD_MAN_2_BEARD, + ENHY_SKEL_MAN_2, + { 140, 255, 110, 0 }, + ENHY_SKEL_MAN_2, + { 255, 255, 255, 0 }, + ENHY_ANIM_19, + }, + /* ENHY_TYPE_OLD_MAN_BALD_BROWN_ROBE */ + { + ENHY_HEAD_OLD_MAN_BALD, + ENHY_SKEL_OLD_MAN, + { 130, 70, 20, 0 }, + ENHY_SKEL_OLD_MAN, + { 130, 180, 255, 0 }, + ENHY_ANIM_21, + }, + /* ENHY_TYPE_MAN_2_MUSTACHE_WHITE_SHIRT */ + { + ENHY_HEAD_MAN_2_MUSTACHE, + ENHY_SKEL_MAN_2, + { 255, 255, 255, 255 }, + ENHY_SKEL_MAN_2, + { 255, 255, 255, 255 }, + ENHY_ANIM_5, + }, + /* ENHY_TYPE_MAN_1_SHAVED_GREEN_SHIRT */ + { + ENHY_HEAD_MAN_1_SHAVED, + ENHY_SKEL_MAN_1, + { 90, 100, 20, 255 }, + ENHY_SKEL_MAN_1, + { 100, 140, 50, 255 }, + ENHY_ANIM_11, + }, + /* ENHY_TYPE_WOMAN_2 */ + { + ENHY_HEAD_WOMAN_2, + ENHY_SKEL_WOMAN_2, + { 255, 255, 255, 255 }, + ENHY_SKEL_WOMAN_2, + { 255, 255, 255, 255 }, + ENHY_ANIM_6, + }, + /* ENHY_TYPE_OLD_MAN_BALD_PURPLE_ROBE */ + { + ENHY_HEAD_OLD_MAN_BALD, + ENHY_SKEL_OLD_MAN, + { 160, 0, 100, 0 }, + ENHY_SKEL_OLD_MAN, + { 70, 130, 210, 0 }, + ENHY_ANIM_21, + }, + /* ENHY_TYPE_MAN_1_BOWL_CUT_GREEN_SHIRT */ + { + ENHY_HEAD_MAN_1_BOWL_CUT, + ENHY_SKEL_MAN_1, + { 160, 230, 0, 0 }, + ENHY_SKEL_MAN_1, + { 0, 150, 110, 0 }, + ENHY_ANIM_12, + }, }; -typedef struct { - /* 0x00 */ Vec3s offset; - /* 0x06 */ s16 radius; - /* 0x08 */ s16 height; +typedef struct EnHyColliderInfo { + /* 0x0 */ Vec3s offset; + /* 0x6 */ s16 radius; + /* 0x8 */ s16 height; } EnHyColliderInfo; // size 0xA static EnHyColliderInfo sColliderInfo[] = { - /* ENHY_TYPE_AOB */ { { 0, 0, 4 }, 24, 70 }, - /* ENHY_TYPE_COB */ { { 0, 0, 8 }, 28, 62 }, - /* ENHY_TYPE_AHG_2 */ { { 0, 0, 4 }, 20, 60 }, - /* ENHY_TYPE_BOJ_3 */ { { 0, 0, 2 }, 20, 60 }, - /* ENHY_TYPE_AHG_4 */ { { 0, 0, -2 }, 20, 60 }, - /* ENHY_TYPE_BOJ_5 */ { { 0, 0, 8 }, 24, 40 }, - /* ENHY_TYPE_BBA */ { { 0, 0, 10 }, 26, 40 }, - /* ENHY_TYPE_BJI_7 */ { { 0, 0, 12 }, 26, 58 }, - /* ENHY_TYPE_CNE_8 */ { { 0, 0, 2 }, 18, 68 }, - /* ENHY_TYPE_BOJ_9 */ { { 0, 0, 4 }, 20, 60 }, - /* ENHY_TYPE_BOJ_10 */ { { 0, 0, 4 }, 20, 60 }, - /* ENHY_TYPE_CNE_11 */ { { 0, 0, 6 }, 20, 64 }, - /* ENHY_TYPE_BOJ_12 */ { { 0, 0, 0 }, 18, 60 }, - /* ENHY_TYPE_AHG_13 */ { { 0, 0, 0 }, 16, 60 }, - /* ENHY_TYPE_BOJ_14 */ { { 0, 0, 0 }, 16, 64 }, - /* ENHY_TYPE_BJI_15 */ { { 0, 0, 8 }, 20, 58 }, - /* ENHY_TYPE_BOJ_16 */ { { 4, 0, 0 }, 18, 62 }, - /* ENHY_TYPE_AHG_17 */ { { 4, 0, 0 }, 18, 62 }, - /* ENHY_TYPE_BOB_18 */ { { 0, 0, 8 }, 28, 62 }, - /* ENHY_TYPE_BJI_19 */ { { 0, 0, 0 }, 16, 60 }, - /* ENHY_TYPE_AHG_20 */ { { 0, 0, 8 }, 20, 58 }, + /* ENHY_TYPE_DOG_LADY */ { { 0, 0, 4 }, 24, 70 }, + /* ENHY_TYPE_WOMAN_3 */ { { 0, 0, 8 }, 28, 62 }, + /* ENHY_TYPE_MAN_1_BEARD */ { { 0, 0, 4 }, 20, 60 }, + /* ENHY_TYPE_MAN_2_BALD */ { { 0, 0, 2 }, 20, 60 }, + /* ENHY_TYPE_MAN_1_SHAVED_BLACK_SHIRT */ { { 0, 0, -2 }, 20, 60 }, + /* ENHY_TYPE_BEGGAR */ { { 0, 0, 8 }, 24, 40 }, + /* ENHY_TYPE_OLD_WOMAN */ { { 0, 0, 10 }, 26, 40 }, + /* ENHY_TYPE_OLD_MAN */ { { 0, 0, 12 }, 26, 58 }, + /* ENHY_TYPE_YOUNG_WOMAN_BROWN_HAIR */ { { 0, 0, 2 }, 18, 68 }, + /* ENHY_TYPE_MAN_2_MUSTACHE_RED_SHIRT */ { { 0, 0, 4 }, 20, 60 }, + /* ENHY_TYPE_MAN_2_MUSTACHE_BLUE_SHIRT */ { { 0, 0, 4 }, 20, 60 }, + /* ENHY_TYPE_YOUNG_WOMAN_ORANGE_HAIR */ { { 0, 0, 6 }, 20, 64 }, + /* ENHY_TYPE_MAN_2_ALT_MUSTACHE */ { { 0, 0, 0 }, 18, 60 }, + /* ENHY_TYPE_MAN_1_BOWL_CUT_PURPLE_SHIRT */ { { 0, 0, 0 }, 16, 60 }, + /* ENHY_TYPE_MAN_2_BEARD */ { { 0, 0, 0 }, 16, 64 }, + /* ENHY_TYPE_OLD_MAN_BALD_BROWN_ROBE */ { { 0, 0, 8 }, 20, 58 }, + /* ENHY_TYPE_MAN_2_MUSTACHE_WHITE_SHIRT */ { { 4, 0, 0 }, 18, 62 }, + /* ENHY_TYPE_MAN_1_SHAVED_GREEN_SHIRT */ { { 4, 0, 0 }, 18, 62 }, + /* ENHY_TYPE_WOMAN_2 */ { { 0, 0, 8 }, 28, 62 }, + /* ENHY_TYPE_OLD_MAN_BALD_PURPLE_ROBE */ { { 0, 0, 0 }, 16, 60 }, + /* ENHY_TYPE_MAN_1_BOWL_CUT_GREEN_SHIRT */ { { 0, 0, 8 }, 20, 58 }, }; -typedef struct { +typedef struct EnHyPlayerTrackingInfo { /* 0x00 */ u8 presetIndex; /* 0x04 */ f32 childYOffset; /* 0x08 */ f32 adultYOffset; } EnHyPlayerTrackingInfo; // size = 0xC static EnHyPlayerTrackingInfo sPlayerTrackingInfo[] = { - /* ENHY_TYPE_AOB */ { 0x06, 20.0f, 10.0f }, - /* ENHY_TYPE_COB */ { 0x06, 20.0f, 10.0f }, - /* ENHY_TYPE_AHG_2 */ { 0x07, 40.0f, 20.0f }, - /* ENHY_TYPE_BOJ_3 */ { 0x06, 20.0f, 10.0f }, - /* ENHY_TYPE_AHG_4 */ { 0x07, 40.0f, 20.0f }, - /* ENHY_TYPE_BOJ_5 */ { 0x08, 0.0f, -20.0f }, - /* ENHY_TYPE_BBA */ { 0x09, 20.0f, 0.0f }, - /* ENHY_TYPE_BJI_7 */ { 0x09, 20.0f, 0.0f }, - /* ENHY_TYPE_CNE_8 */ { 0x06, 20.0f, 10.0f }, - /* ENHY_TYPE_BOJ_9 */ { 0x06, 20.0f, 10.0f }, - /* ENHY_TYPE_BOJ_10 */ { 0x06, 20.0f, 10.0f }, - /* ENHY_TYPE_CNE_11 */ { 0x06, 20.0f, 10.0f }, - /* ENHY_TYPE_BOJ_12 */ { 0x00, 0.0f, 0.0f }, - /* ENHY_TYPE_AHG_13 */ { 0x06, 20.0f, 10.0f }, - /* ENHY_TYPE_BOJ_14 */ { 0x06, 20.0f, 10.0f }, - /* ENHY_TYPE_BJI_15 */ { 0x0A, 20.0f, 0.0f }, - /* ENHY_TYPE_BOJ_16 */ { 0x06, 20.0f, 10.0f }, - /* ENHY_TYPE_AHG_17 */ { 0x06, 20.0f, 10.0f }, - /* ENHY_TYPE_BOB_18 */ { 0x06, 20.0f, 10.0f }, - /* ENHY_TYPE_BJI_19 */ { 0x06, 20.0f, 10.0f }, - /* ENHY_TYPE_AHG_20 */ { 0x0A, 20.0f, 0.0f }, + /* ENHY_TYPE_DOG_LADY */ { 6, 20.0f, 10.0f }, + /* ENHY_TYPE_WOMAN_3 */ { 6, 20.0f, 10.0f }, + /* ENHY_TYPE_MAN_1_BEARD */ { 7, 40.0f, 20.0f }, + /* ENHY_TYPE_MAN_2_BALD */ { 6, 20.0f, 10.0f }, + /* ENHY_TYPE_MAN_1_SHAVED_BLACK_SHIRT */ { 7, 40.0f, 20.0f }, + /* ENHY_TYPE_BEGGAR */ { 8, 0.0f, -20.0f }, + /* ENHY_TYPE_OLD_WOMAN */ { 9, 20.0f, 0.0f }, + /* ENHY_TYPE_OLD_MAN */ { 9, 20.0f, 0.0f }, + /* ENHY_TYPE_YOUNG_WOMAN_BROWN_HAIR */ { 6, 20.0f, 10.0f }, + /* ENHY_TYPE_MAN_2_MUSTACHE_RED_SHIRT */ { 6, 20.0f, 10.0f }, + /* ENHY_TYPE_MAN_2_MUSTACHE_BLUE_SHIRT */ { 6, 20.0f, 10.0f }, + /* ENHY_TYPE_YOUNG_WOMAN_ORANGE_HAIR */ { 6, 20.0f, 10.0f }, + /* ENHY_TYPE_MAN_2_ALT_MUSTACHE */ { 0, 0.0f, 0.0f }, + /* ENHY_TYPE_MAN_1_BOWL_CUT_PURPLE_SHIRT */ { 6, 20.0f, 10.0f }, + /* ENHY_TYPE_MAN_2_BEARD */ { 6, 20.0f, 10.0f }, + /* ENHY_TYPE_OLD_MAN_BALD_BROWN_ROBE */ { 10, 20.0f, 0.0f }, + /* ENHY_TYPE_MAN_2_MUSTACHE_WHITE_SHIRT */ { 6, 20.0f, 10.0f }, + /* ENHY_TYPE_MAN_1_SHAVED_GREEN_SHIRT */ { 6, 20.0f, 10.0f }, + /* ENHY_TYPE_WOMAN_2 */ { 6, 20.0f, 10.0f }, + /* ENHY_TYPE_OLD_MAN_BALD_PURPLE_ROBE */ { 6, 20.0f, 10.0f }, + /* ENHY_TYPE_MAN_1_BOWL_CUT_GREEN_SHIRT */ { 10, 20.0f, 0.0f }, }; -typedef struct { +typedef struct EnHyInit2Info { /* 0x00 */ f32 shadowScale; /* 0x04 */ Vec3f modelOffset; /* 0x10 */ f32 scale; - /* 0x14 */ s8 targetMode; + /* 0x14 */ s8 attentionRangeType; /* 0x18 */ f32 interactRange; } EnHyInit2Info; // size = 0x1C static EnHyInit2Info sInit2Info[] = { - /* ENHY_TYPE_AOB */ { 36.0f, { 0.0f, 0.0f, 600.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_COB */ { 40.0f, { -100.0f, 0.0f, 400.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_AHG_2 */ { 22.0f, { 0.0f, 0.0f, -200.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_BOJ_3 */ { 20.0f, { -100.0f, 0.0f, 0.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_AHG_4 */ { 22.0f, { 0.0f, 0.0f, 0.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_BOJ_5 */ { 21.0f, { 0.0f, 0.0f, 0.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_BBA */ { 25.0f, { -100.0f, 0.0f, 600.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_BJI_7 */ { 28.0f, { -100.0f, 0.0f, 800.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_CNE_8 */ { 17.0f, { 0.0f, 0.0f, 700.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_BOJ_9 */ { 18.0f, { 0.0f, 0.0f, 100.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_BOJ_10 */ { 18.0f, { 0.0f, 0.0f, -200.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_CNE_11 */ { 17.0f, { 0.0f, 0.0f, 700.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_BOJ_12 */ { 21.0f, { 0.0f, 0.0f, -300.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_AHG_13 */ { 20.0f, { 0.0f, 0.0f, -200.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_BOJ_14 */ { 18.0f, { -200.0f, 0.0f, -200.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_BJI_15 */ { 27.0f, { -100.0f, 0.0f, 800.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_BOJ_16 */ { 19.0f, { 400.0f, 0.0f, 0.0f }, 0.01f, 0x04, 30.0f }, - /* ENHY_TYPE_AHG_17 */ { 19.0f, { 400.0f, 0.0f, 0.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_BOB_18 */ { 40.0f, { -100.0f, 0.0f, 400.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_BJI_19 */ { 17.0f, { 0.0f, 0.0f, 700.0f }, 0.01f, 0x06, 30.0f }, - /* ENHY_TYPE_AHG_20 */ { 20.0f, { 0.0f, 0.0f, -200.0f }, 0.01f, 0x06, 30.0f }, + /* ENHY_TYPE_DOG_LADY */ { 36.0f, { 0.0f, 0.0f, 600.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_WOMAN_3 */ { 40.0f, { -100.0f, 0.0f, 400.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_MAN_1_BEARD */ { 22.0f, { 0.0f, 0.0f, -200.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_MAN_2_BALD */ { 20.0f, { -100.0f, 0.0f, 0.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_MAN_1_SHAVED_BLACK_SHIRT */ { 22.0f, { 0.0f, 0.0f, 0.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_BEGGAR */ { 21.0f, { 0.0f, 0.0f, 0.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_OLD_WOMAN */ { 25.0f, { -100.0f, 0.0f, 600.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_OLD_MAN */ { 28.0f, { -100.0f, 0.0f, 800.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_YOUNG_WOMAN_BROWN_HAIR */ { 17.0f, { 0.0f, 0.0f, 700.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_MAN_2_MUSTACHE_RED_SHIRT */ { 18.0f, { 0.0f, 0.0f, 100.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_MAN_2_MUSTACHE_BLUE_SHIRT */ { 18.0f, { 0.0f, 0.0f, -200.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_YOUNG_WOMAN_ORANGE_HAIR */ { 17.0f, { 0.0f, 0.0f, 700.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_MAN_2_ALT_MUSTACHE */ { 21.0f, { 0.0f, 0.0f, -300.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_MAN_1_BOWL_CUT_PURPLE_SHIRT */ { 20.0f, { 0.0f, 0.0f, -200.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_MAN_2_BEARD */ { 18.0f, { -200.0f, 0.0f, -200.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_OLD_MAN_BALD_BROWN_ROBE */ { 27.0f, { -100.0f, 0.0f, 800.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_MAN_2_MUSTACHE_WHITE_SHIRT */ { 19.0f, { 400.0f, 0.0f, 0.0f }, 0.01f, 4, 30.0f }, + /* ENHY_TYPE_MAN_1_SHAVED_GREEN_SHIRT */ { 19.0f, { 400.0f, 0.0f, 0.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_WOMAN_2 */ { 40.0f, { -100.0f, 0.0f, 400.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_OLD_MAN_BALD_PURPLE_ROBE */ { 17.0f, { 0.0f, 0.0f, 700.0f }, 0.01f, 6, 30.0f }, + /* ENHY_TYPE_MAN_1_BOWL_CUT_GREEN_SHIRT */ { 20.0f, { 0.0f, 0.0f, -200.0f }, 0.01f, 6, 30.0f }, }; s32 EnHy_FindSkelAndHeadObjects(EnHy* this, PlayState* play) { - u8 headInfoIndex = sModelInfo[this->actor.params & 0x7F].headInfoIndex; - u8 skelInfoIndex2 = sModelInfo[this->actor.params & 0x7F].skelInfoIndex2; - u8 skelInfoIndex1 = sModelInfo[this->actor.params & 0x7F].skelInfoIndex1; + u8 headInfoIndex = sModelInfo[ENHY_GET_TYPE(&this->actor)].headInfoIndex; + u8 upperSkelInfoIndex = sModelInfo[ENHY_GET_TYPE(&this->actor)].upperSkelInfoIndex; + u8 lowerSkelInfoIndex = sModelInfo[ENHY_GET_TYPE(&this->actor)].lowerSkelInfoIndex; - this->objectSlotSkel1 = Object_GetSlot(&play->objectCtx, sSkeletonInfo[skelInfoIndex1].objectId); - if (this->objectSlotSkel1 < 0) { + this->objectSlotLowerSkel = Object_GetSlot(&play->objectCtx, sSkeletonInfo[lowerSkelInfoIndex].objectId); + if (this->objectSlotLowerSkel < 0) { return false; } - this->objectSlotSkel2 = Object_GetSlot(&play->objectCtx, sSkeletonInfo[skelInfoIndex2].objectId); - if (this->objectSlotSkel2 < 0) { + this->objectSlotUpperSkel = Object_GetSlot(&play->objectCtx, sSkeletonInfo[upperSkelInfoIndex].objectId); + if (this->objectSlotUpperSkel < 0) { return false; } @@ -375,11 +551,11 @@ s32 EnHy_FindSkelAndHeadObjects(EnHy* this, PlayState* play) { } s32 EnHy_AreSkelAndHeadObjectsLoaded(EnHy* this, PlayState* play) { - if (!Object_IsLoaded(&play->objectCtx, this->objectSlotSkel1)) { + if (!Object_IsLoaded(&play->objectCtx, this->objectSlotLowerSkel)) { return false; } - if (!Object_IsLoaded(&play->objectCtx, this->objectSlotSkel2)) { + if (!Object_IsLoaded(&play->objectCtx, this->objectSlotUpperSkel)) { return false; } @@ -408,8 +584,8 @@ s32 EnHy_IsOsAnimeObjectLoaded(EnHy* this, PlayState* play) { return true; } -void func_80A6F7CC(EnHy* this, PlayState* play, s32 getItemId) { - this->unkGetItemId = getItemId; +void EnHy_GiveItem(EnHy* this, PlayState* play, s32 getItemId) { + this->getItemId = getItemId; Actor_OfferGetItem(&this->actor, play, getItemId, this->actor.xzDistToPlayer + 1.0f, fabsf(this->actor.yDistToPlayer) + 1.0f); } @@ -417,19 +593,19 @@ void func_80A6F7CC(EnHy* this, PlayState* play, s32 getItemId) { u16 EnHy_GetTextId(PlayState* play, Actor* thisx) { Player* player = GET_PLAYER(play); EnHy* this = (EnHy*)thisx; - u16 textId = MaskReaction_GetTextId(play, MASK_REACTION_SET_37 + (this->actor.params & 0x7F)); + u16 textId = MaskReaction_GetTextId(play, ENHY_GET_TYPE(&this->actor) + MASK_REACTION_SET_DOG_LADY); if (textId != 0) { - if ((this->actor.params & 0x7F) == ENHY_TYPE_BOJ_5) { + if (ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_BEGGAR) { player->exchangeItemId = EXCH_ITEM_BOTTLE_BLUE_FIRE; } return textId; } - switch (this->actor.params & 0x7F) { - case ENHY_TYPE_AOB: + switch (ENHY_GET_TYPE(&this->actor)) { + case ENHY_TYPE_DOG_LADY: if (play->sceneId == SCENE_KAKARIKO_CENTER_GUEST_HOUSE) { - return (this->unk_330 & EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_MASK) + return (this->talonEventChkInf & EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_MASK) ? 0x508D : (GET_INFTABLE(INFTABLE_CB) ? 0x508C : 0x508B); } else if (play->sceneId == SCENE_MARKET_DAY) { @@ -438,7 +614,7 @@ u16 EnHy_GetTextId(PlayState* play, Actor* thisx) { s16 followingDog = (gSaveContext.dogParams & 0xF00) >> 8; if (followingDog != 0) { - this->unk_215 = false; + this->playedSfx = false; return (followingDog == 1) ? 0x709F : 0x709E; } else { return 0x709D; @@ -446,13 +622,15 @@ u16 EnHy_GetTextId(PlayState* play, Actor* thisx) { } else { return 0x70A0; } - case ENHY_TYPE_COB: + + case ENHY_TYPE_WOMAN_3: if (GET_EVENTCHKINF(EVENTCHKINF_80)) { return GET_INFTABLE(INFTABLE_C1) ? 0x7017 : 0x7045; } else { return GET_INFTABLE(INFTABLE_C0) ? 0x7017 : 0x7016; } - case ENHY_TYPE_AHG_2: + + case ENHY_TYPE_MAN_1_BEARD: if (play->sceneId == SCENE_KAKARIKO_CENTER_GUEST_HOUSE) { return 0x5086; } else if (play->sceneId == SCENE_KAKARIKO_VILLAGE) { @@ -468,16 +646,21 @@ u16 EnHy_GetTextId(PlayState* play, Actor* thisx) { } else { return 0x701A; } - case ENHY_TYPE_BOJ_3: + + case ENHY_TYPE_MAN_2_BALD: return GET_EVENTCHKINF(EVENTCHKINF_80) ? (GET_INFTABLE(INFTABLE_C4) ? 0x7001 : 0x70EB) : 0x7001; - case ENHY_TYPE_AHG_4: + + case ENHY_TYPE_MAN_1_SHAVED_BLACK_SHIRT: return GET_EVENTCHKINF(EVENTCHKINF_80) ? 0x704B : (GET_INFTABLE(INFTABLE_C5) ? 0x7024 : 0x7023); - case ENHY_TYPE_BOJ_5: + + case ENHY_TYPE_BEGGAR: player->exchangeItemId = EXCH_ITEM_BOTTLE_BLUE_FIRE; return 0x700C; - case ENHY_TYPE_BBA: + + case ENHY_TYPE_OLD_WOMAN: return GET_EVENTCHKINF(EVENTCHKINF_80) ? 0x704A : (GET_INFTABLE(INFTABLE_C6) ? 0x7022 : 0x7021); - case ENHY_TYPE_BJI_7: + + case ENHY_TYPE_OLD_MAN: if (play->sceneId == SCENE_KAKARIKO_CENTER_GUEST_HOUSE) { return 0x5088; } else if (play->sceneId == SCENE_KAKARIKO_VILLAGE) { @@ -485,13 +668,15 @@ u16 EnHy_GetTextId(PlayState* play, Actor* thisx) { } else { return GET_EVENTCHKINF(EVENTCHKINF_80) ? 0x704D : (GET_INFTABLE(INFTABLE_C7) ? 0x7028 : 0x7027); } - case ENHY_TYPE_CNE_8: + + case ENHY_TYPE_YOUNG_WOMAN_BROWN_HAIR: if (GET_EVENTCHKINF(EVENTCHKINF_80)) { return GET_INFTABLE(INFTABLE_C9) ? 0x701E : 0x7048; } else { return GET_INFTABLE(INFTABLE_C8) ? 0x701E : 0x701D; } - case ENHY_TYPE_BOJ_9: + + case ENHY_TYPE_MAN_2_MUSTACHE_RED_SHIRT: if (play->sceneId == SCENE_KAKARIKO_CENTER_GUEST_HOUSE) { return GET_EVENTCHKINF(EVENTCHKINF_AA) ? 0x5082 : 0x5081; } else if (play->sceneId == SCENE_KAKARIKO_VILLAGE) { @@ -499,32 +684,44 @@ u16 EnHy_GetTextId(PlayState* play, Actor* thisx) { } else { return GET_EVENTCHKINF(EVENTCHKINF_80) ? 0x7049 : (GET_INFTABLE(INFTABLE_CA) ? 0x7020 : 0x701F); } - case ENHY_TYPE_BOJ_10: + + case ENHY_TYPE_MAN_2_MUSTACHE_BLUE_SHIRT: if (play->sceneId == SCENE_IMPAS_HOUSE) { return GET_EVENTCHKINF(EVENTCHKINF_AA) ? 0x507E : 0x507D; } else if (play->sceneId == SCENE_KAKARIKO_VILLAGE) { return CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) ? 0x507C : 0x507B; } else { +#if OOT_VERSION < NTSC_1_1 + return GET_EVENTCHKINF(EVENTCHKINF_80) ? 0x7046 : (GET_INFTABLE(INFTABLE_CB) ? 0x7019 : 0x7018); +#else return GET_EVENTCHKINF(EVENTCHKINF_80) ? 0x7046 : (GET_INFTABLE(INFTABLE_CD) ? 0x7019 : 0x7018); +#endif } - case ENHY_TYPE_CNE_11: + + case ENHY_TYPE_YOUNG_WOMAN_ORANGE_HAIR: return GET_INFTABLE(INFTABLE_MALON_SPAWNED_AT_HYRULE_CASTLE) ? (GET_INFTABLE(INFTABLE_CC) ? 0x7014 : 0x70A4) : 0x7014; - case ENHY_TYPE_BOJ_12: + + case ENHY_TYPE_MAN_2_ALT_MUSTACHE: if (play->sceneId == SCENE_KAKARIKO_VILLAGE) { return !IS_DAY ? 0x5084 : 0x5083; } else { return GET_EVENTCHKINF(EVENTCHKINF_80) ? 0x7044 : 0x7015; } - case ENHY_TYPE_AHG_13: + + case ENHY_TYPE_MAN_1_BOWL_CUT_PURPLE_SHIRT: return 0x7055; - case ENHY_TYPE_BOJ_14: + + case ENHY_TYPE_MAN_2_BEARD: return 0x7089; - case ENHY_TYPE_BJI_15: + + case ENHY_TYPE_OLD_MAN_BALD_BROWN_ROBE: return 0x708A; - case ENHY_TYPE_BOJ_16: + + case ENHY_TYPE_MAN_2_MUSTACHE_WHITE_SHIRT: return 0x700E; - case ENHY_TYPE_AHG_17: + + case ENHY_TYPE_MAN_1_SHAVED_GREEN_SHIRT: if (!LINK_IS_ADULT) { if (IS_DAY) { return GET_INFTABLE(INFTABLE_160) ? 0x5058 : 0x5057; @@ -536,18 +733,22 @@ u16 EnHy_GetTextId(PlayState* play, Actor* thisx) { } else { return 0x5058; } - case ENHY_TYPE_BOB_18: + + case ENHY_TYPE_WOMAN_2: if (!LINK_IS_ADULT) { return GET_EVENTCHKINF(EVENTCHKINF_80) ? 0x505F : (GET_INFTABLE(INFTABLE_163) ? 0x505E : 0x505D); } else { - return (this->unk_330 & EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_MASK) + return (this->talonEventChkInf & EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_MASK) ? 0x5062 : (GET_INFTABLE(INFTABLE_164) ? 0x5061 : 0x5060); } - case ENHY_TYPE_BJI_19: + + case ENHY_TYPE_OLD_MAN_BALD_PURPLE_ROBE: return 0x7120; - case ENHY_TYPE_AHG_20: + + case ENHY_TYPE_MAN_1_BOWL_CUT_GREEN_SHIRT: return 0x7121; + default: return 0; } @@ -567,17 +768,19 @@ s16 EnHy_UpdateTalkState(PlayState* play, Actor* thisx) { case TEXT_STATE_8: case TEXT_STATE_9: return NPC_TALK_STATE_TALKING; + case TEXT_STATE_DONE_FADING: switch (this->actor.textId) { case 0x709E: case 0x709F: - if (!this->unk_215) { + if (!this->playedSfx) { Audio_PlaySfxGeneral(this->actor.textId == 0x709F ? NA_SE_SY_CORRECT_CHIME : NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - this->unk_215 = true; + this->playedSfx = true; } break; + case 0x70F0: case 0x70F1: case 0x70F2: @@ -589,6 +792,7 @@ s16 EnHy_UpdateTalkState(PlayState* play, Actor* thisx) { break; } return NPC_TALK_STATE_TALKING; + case TEXT_STATE_CLOSING: switch (this->actor.textId) { case 0x70F0: @@ -599,86 +803,113 @@ s16 EnHy_UpdateTalkState(PlayState* play, Actor* thisx) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENHY_ANIM_17); Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE_EMPTY, PLAYER_IA_BOTTLE); break; + case 0x7016: SET_INFTABLE(INFTABLE_C0); break; + case 0x7045: SET_INFTABLE(INFTABLE_C1); break; + case 0x701B: SET_INFTABLE(INFTABLE_C2); break; + case 0x7047: SET_INFTABLE(INFTABLE_C3); break; + case 0x70EB: SET_INFTABLE(INFTABLE_C4); break; + case 0x7023: SET_INFTABLE(INFTABLE_C5); break; + case 0x7021: SET_INFTABLE(INFTABLE_C6); break; + case 0x7027: SET_INFTABLE(INFTABLE_C7); break; + case 0x701D: SET_INFTABLE(INFTABLE_C8); break; + case 0x7048: SET_INFTABLE(INFTABLE_C9); break; + case 0x701F: SET_INFTABLE(INFTABLE_CA); break; + case 0x7018: +#if OOT_VERSION < NTSC_1_1 + SET_INFTABLE(INFTABLE_CB); +#else SET_INFTABLE(INFTABLE_CD); +#endif break; + case 0x70A4: SET_INFTABLE(INFTABLE_CC); break; + case 0x5057: SET_INFTABLE(INFTABLE_160); break; + case 0x5059: SET_INFTABLE(INFTABLE_161); break; + case 0x505B: SET_INFTABLE(INFTABLE_162); break; + case 0x505D: SET_INFTABLE(INFTABLE_163); break; + case 0x5060: SET_INFTABLE(INFTABLE_164); break; + case 0x508B: SET_INFTABLE(INFTABLE_CB); break; + case 0x709E: gSaveContext.dogParams = 0; break; + case 0x709F: - func_80A6F7CC(this, play, GET_INFTABLE(INFTABLE_191) ? GI_RUPEE_BLUE : GI_HEART_PIECE); - this->actionFunc = func_80A714C4; + EnHy_GiveItem(this, play, GET_INFTABLE(INFTABLE_191) ? GI_RUPEE_BLUE : GI_HEART_PIECE); + this->actionFunc = EnHy_WaitDogFoundRewardGiven; break; } return NPC_TALK_STATE_IDLE; + case TEXT_STATE_EVENT: if (!Message_ShouldAdvance(play)) { return NPC_TALK_STATE_TALKING; } else { return NPC_TALK_STATE_ACTION; } - } - return NPC_TALK_STATE_TALKING; + default: + return NPC_TALK_STATE_TALKING; + } } void EnHy_UpdateEyes(EnHy* this) { if (DECR(this->nextEyeIndexTimer) == 0) { - u8 headInfoIndex = sModelInfo[this->actor.params & 0x7F].headInfoIndex; + u8 headInfoIndex = sModelInfo[ENHY_GET_TYPE(&this->actor)].headInfoIndex; this->curEyeIndex++; if ((sHeadInfo[headInfoIndex].eyeTextures != NULL) && @@ -690,18 +921,18 @@ void EnHy_UpdateEyes(EnHy* this) { } void EnHy_InitCollider(EnHy* this) { - u8 type = this->actor.params & 0x7F; + u8 type = ENHY_GET_TYPE(&this->actor); this->collider.dim.radius = sColliderInfo[type].radius; this->collider.dim.height = sColliderInfo[type].height; } void EnHy_InitSetProperties(EnHy* this) { - u8 type = this->actor.params & 0x7F; + u8 type = ENHY_GET_TYPE(&this->actor); this->actor.shape.shadowScale = sInit2Info[type].shadowScale; Actor_SetScale(&this->actor, sInit2Info[type].scale); - this->actor.targetMode = sInit2Info[type].targetMode; + this->actor.attentionRangeType = sInit2Info[type].attentionRangeType; this->modelOffset = sInit2Info[type].modelOffset; this->interactRange = sInit2Info[type].interactRange; this->interactRange += this->collider.dim.radius; @@ -713,17 +944,17 @@ void EnHy_UpdateCollider(EnHy* this, PlayState* play) { pos.x = this->actor.world.pos.x; pos.y = this->actor.world.pos.y; pos.z = this->actor.world.pos.z; - pos.x += sColliderInfo[this->actor.params & 0x7F].offset.x; - pos.y += sColliderInfo[this->actor.params & 0x7F].offset.y; - pos.z += sColliderInfo[this->actor.params & 0x7F].offset.z; + pos.x += sColliderInfo[ENHY_GET_TYPE(&this->actor)].offset.x; + pos.y += sColliderInfo[ENHY_GET_TYPE(&this->actor)].offset.y; + pos.z += sColliderInfo[ENHY_GET_TYPE(&this->actor)].offset.z; this->collider.dim.pos = pos; CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } -void func_80A70834(EnHy* this, PlayState* play) { +void EnHy_OfferBuyBottledItem(EnHy* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((this->actor.params & 0x7F) == ENHY_TYPE_BOJ_5) { + if (ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_BEGGAR) { if (!Inventory_HasSpecificBottle(ITEM_BOTTLE_BLUE_FIRE) && !Inventory_HasSpecificBottle(ITEM_BOTTLE_BUG) && !Inventory_HasSpecificBottle(ITEM_BOTTLE_FISH)) { switch (func_8002F368(play)) { @@ -732,6 +963,7 @@ void func_80A70834(EnHy* this, PlayState* play) { case EXCH_ITEM_BOTTLE_RUTOS_LETTER: this->actor.textId = 0x70EF; break; + default: if (Player_GetMask(play) == PLAYER_MASK_NONE) { this->actor.textId = 0x70ED; @@ -743,12 +975,15 @@ void func_80A70834(EnHy* this, PlayState* play) { case EXCH_ITEM_BOTTLE_BLUE_FIRE: this->actor.textId = 0x70F0; break; + case EXCH_ITEM_BOTTLE_FISH: this->actor.textId = 0x70F1; break; + case EXCH_ITEM_BOTTLE_BUG: this->actor.textId = 0x70F2; break; + default: if (Player_GetMask(play) == PLAYER_MASK_NONE) { this->actor.textId = 0x700C; @@ -761,30 +996,34 @@ void func_80A70834(EnHy* this, PlayState* play) { } } -void func_80A70978(EnHy* this, PlayState* play) { +void EnHy_UpdateNPC(EnHy* this, PlayState* play) { Player* player = GET_PLAYER(play); s16 trackingMode; - switch (this->actor.params & 0x7F) { - case ENHY_TYPE_BOJ_3: - case ENHY_TYPE_BJI_7: - case ENHY_TYPE_BOJ_9: - case ENHY_TYPE_BOJ_10: + switch (ENHY_GET_TYPE(&this->actor)) { + case ENHY_TYPE_MAN_2_BALD: + case ENHY_TYPE_OLD_MAN: + case ENHY_TYPE_MAN_2_MUSTACHE_RED_SHIRT: + case ENHY_TYPE_MAN_2_MUSTACHE_BLUE_SHIRT: trackingMode = (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) ? NPC_TRACKING_NONE : NPC_TRACKING_HEAD_AND_TORSO; break; - case ENHY_TYPE_BOJ_12: + + case ENHY_TYPE_MAN_2_ALT_MUSTACHE: trackingMode = NPC_TRACKING_NONE; break; - case ENHY_TYPE_AHG_2: - case ENHY_TYPE_AHG_17: + + case ENHY_TYPE_MAN_1_BEARD: + case ENHY_TYPE_MAN_1_SHAVED_GREEN_SHIRT: trackingMode = NPC_TRACKING_FULL_BODY; break; - case ENHY_TYPE_AOB: - case ENHY_TYPE_BOB_18: + + case ENHY_TYPE_DOG_LADY: + case ENHY_TYPE_WOMAN_2: trackingMode = (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_FULL_BODY; break; + default: trackingMode = NPC_TRACKING_HEAD_AND_TORSO; break; @@ -793,46 +1032,50 @@ void func_80A70978(EnHy* this, PlayState* play) { this->interactInfo.trackPos = player->actor.world.pos; if (LINK_IS_ADULT) { - this->interactInfo.yOffset = sPlayerTrackingInfo[this->actor.params & 0x7F].adultYOffset; + this->interactInfo.yOffset = sPlayerTrackingInfo[ENHY_GET_TYPE(&this->actor)].adultYOffset; } else { - this->interactInfo.yOffset = sPlayerTrackingInfo[this->actor.params & 0x7F].childYOffset; + this->interactInfo.yOffset = sPlayerTrackingInfo[ENHY_GET_TYPE(&this->actor)].childYOffset; } - Npc_TrackPoint(&this->actor, &this->interactInfo, sPlayerTrackingInfo[this->actor.params & 0x7F].presetIndex, + Npc_TrackPoint(&this->actor, &this->interactInfo, sPlayerTrackingInfo[ENHY_GET_TYPE(&this->actor)].presetIndex, trackingMode); if (Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->interactRange, EnHy_GetTextId, EnHy_UpdateTalkState)) { - func_80A70834(this, play); + EnHy_OfferBuyBottledItem(this, play); } } s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { switch (play->sceneId) { case SCENE_KAKARIKO_VILLAGE: - if (!((this->actor.params & 0x7F) == ENHY_TYPE_BOJ_9 || (this->actor.params & 0x7F) == ENHY_TYPE_BOJ_10 || - (this->actor.params & 0x7F) == ENHY_TYPE_BOJ_12 || (this->actor.params & 0x7F) == ENHY_TYPE_AHG_2 || - (this->actor.params & 0x7F) == ENHY_TYPE_BJI_7)) { + if (!(ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_MAN_2_MUSTACHE_RED_SHIRT || + ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_MAN_2_MUSTACHE_BLUE_SHIRT || + ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_MAN_2_ALT_MUSTACHE || + ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_MAN_1_BEARD || + ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_OLD_MAN)) { return true; } else if (!LINK_IS_ADULT) { return true; - } else if ((this->actor.params & 0x7F) != ENHY_TYPE_BOJ_12 && IS_NIGHT) { + } else if (ENHY_GET_TYPE(&this->actor) != ENHY_TYPE_MAN_2_ALT_MUSTACHE && IS_NIGHT) { return false; } else { return true; } + case SCENE_IMPAS_HOUSE: - if ((this->actor.params & 0x7F) != ENHY_TYPE_BOJ_10) { + if (ENHY_GET_TYPE(&this->actor) != ENHY_TYPE_MAN_2_MUSTACHE_BLUE_SHIRT) { return true; } else if (LINK_IS_CHILD) { return false; - } else if ((this->actor.params & 0x7F) == ENHY_TYPE_BOJ_10 && IS_DAY) { + } else if (ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_MAN_2_MUSTACHE_BLUE_SHIRT && IS_DAY) { return false; } else { return true; } + case SCENE_DOG_LADY_HOUSE: - if ((this->actor.params & 0x7F) != ENHY_TYPE_AOB) { + if (ENHY_GET_TYPE(&this->actor) != ENHY_TYPE_DOG_LADY) { return true; } else if (IS_DAY) { return false; @@ -840,11 +1083,11 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { return true; } case SCENE_KAKARIKO_CENTER_GUEST_HOUSE: - if ((this->actor.params & 0x7F) == ENHY_TYPE_AOB) { + if (ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_DOG_LADY) { return !LINK_IS_ADULT ? false : true; - } else if (!((this->actor.params & 0x7F) == ENHY_TYPE_BOJ_9 || - (this->actor.params & 0x7F) == ENHY_TYPE_AHG_2 || - (this->actor.params & 0x7F) == ENHY_TYPE_BJI_7)) { + } else if (!(ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_MAN_2_MUSTACHE_RED_SHIRT || + ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_MAN_1_BEARD || + ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_OLD_MAN)) { return true; } else if (IS_DAY) { return false; @@ -853,9 +1096,10 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { } else { return true; } + case SCENE_BACK_ALLEY_DAY: case SCENE_BACK_ALLEY_NIGHT: - if ((this->actor.params & 0x7F) != ENHY_TYPE_BOJ_14) { + if (ENHY_GET_TYPE(&this->actor) != ENHY_TYPE_MAN_2_BEARD) { return true; } else if (IS_NIGHT) { return false; @@ -864,22 +1108,25 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { } else { return true; } + default: - switch (this->actor.params & 0x7F) { - case ENHY_TYPE_BJI_19: - case ENHY_TYPE_AHG_20: + switch (ENHY_GET_TYPE(&this->actor)) { + case ENHY_TYPE_OLD_MAN_BALD_PURPLE_ROBE: + case ENHY_TYPE_MAN_1_BOWL_CUT_GREEN_SHIRT: if (LINK_IS_ADULT) { return false; } + FALLTHROUGH; + default: + return true; } - return true; } } void EnHy_Init(Actor* thisx, PlayState* play) { EnHy* this = (EnHy*)thisx; - if ((this->actor.params & 0x7F) >= ENHY_TYPE_MAX || !EnHy_FindOsAnimeObject(this, play) || + if ((ENHY_GET_TYPE(&this->actor) >= ENHY_TYPE_MAX) || !EnHy_FindOsAnimeObject(this, play) || !EnHy_FindSkelAndHeadObjects(this, play)) { Actor_Kill(&this->actor); } @@ -888,7 +1135,7 @@ void EnHy_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); } - this->actionFunc = EnHy_InitImpl; + this->actionFunc = EnHy_WaitForObjects; } void EnHy_Destroy(Actor* thisx, PlayState* play) { @@ -897,20 +1144,20 @@ void EnHy_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->collider); } -void EnHy_InitImpl(EnHy* this, PlayState* play) { +void EnHy_WaitForObjects(EnHy* this, PlayState* play) { if (EnHy_IsOsAnimeObjectLoaded(this, play) && EnHy_AreSkelAndHeadObjectsLoaded(this, play)) { - this->actor.objectSlot = this->objectSlotSkel1; + this->actor.objectSlot = this->objectSlotLowerSkel; gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->actor.objectSlot].segment); SkelAnime_InitFlex(play, &this->skelAnime, - sSkeletonInfo[sModelInfo[this->actor.params & 0x7F].skelInfoIndex1].skeleton, NULL, - this->jointTable, this->morphTable, 16); + sSkeletonInfo[sModelInfo[ENHY_GET_TYPE(&this->actor)].lowerSkelInfoIndex].skeleton, NULL, + this->jointTable, this->morphTable, ENHY_LIMB_MAX); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotOsAnime].segment); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sColCylInit); EnHy_InitCollider(this); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, sModelInfo[this->actor.params & 0x7F].animInfoIndex); + Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, sModelInfo[ENHY_GET_TYPE(&this->actor)].animInfoIndex); if ((play->sceneId == SCENE_BACK_ALLEY_DAY) || (play->sceneId == SCENE_MARKET_DAY)) { this->actor.flags &= ~ACTOR_FLAG_4; @@ -918,51 +1165,55 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) { } if (play->sceneId == SCENE_KAKARIKO_CENTER_GUEST_HOUSE) { - this->unk_330 = gSaveContext.save.info.eventChkInf[EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_INDEX]; + this->talonEventChkInf = gSaveContext.save.info.eventChkInf[EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_INDEX]; } EnHy_InitSetProperties(this); - this->path = Path_GetByIndex(play, (this->actor.params & 0x780) >> 7, 15); + this->path = Path_GetByIndex(play, ENHY_GET_PATH_INDEX(&this->actor), 15); - switch (this->actor.params & 0x7F) { - case ENHY_TYPE_BOJ_3: + switch (ENHY_GET_TYPE(&this->actor)) { + case ENHY_TYPE_MAN_2_BALD: if (this->path != NULL) { this->actor.speed = 3.0f; } - this->actionFunc = func_80A711B4; + this->actionFunc = EnHy_Walk; break; - case ENHY_TYPE_BJI_7: + + case ENHY_TYPE_OLD_MAN: this->pathReverse = false; - this->actionFunc = func_80A712C0; + this->actionFunc = EnHy_SetupPace; break; - case ENHY_TYPE_AOB: + + case ENHY_TYPE_DOG_LADY: if (play->sceneId == SCENE_MARKET_DAY) { - this->actionFunc = func_80A710F8; + this->actionFunc = EnHy_WatchDog; break; } FALLTHROUGH; - case ENHY_TYPE_COB: - case ENHY_TYPE_AHG_2: - case ENHY_TYPE_AHG_4: - case ENHY_TYPE_BBA: - case ENHY_TYPE_CNE_8: - case ENHY_TYPE_AHG_13: - case ENHY_TYPE_BOJ_14: - case ENHY_TYPE_BJI_15: - case ENHY_TYPE_BOJ_16: - case ENHY_TYPE_AHG_17: - case ENHY_TYPE_BOB_18: - case ENHY_TYPE_BJI_19: - case ENHY_TYPE_AHG_20: - this->actionFunc = func_80A7127C; + case ENHY_TYPE_WOMAN_3: + case ENHY_TYPE_MAN_1_BEARD: + case ENHY_TYPE_MAN_1_SHAVED_BLACK_SHIRT: + case ENHY_TYPE_OLD_WOMAN: + case ENHY_TYPE_YOUNG_WOMAN_BROWN_HAIR: + case ENHY_TYPE_MAN_1_BOWL_CUT_PURPLE_SHIRT: + case ENHY_TYPE_MAN_2_BEARD: + case ENHY_TYPE_OLD_MAN_BALD_BROWN_ROBE: + case ENHY_TYPE_MAN_2_MUSTACHE_WHITE_SHIRT: + case ENHY_TYPE_MAN_1_SHAVED_GREEN_SHIRT: + case ENHY_TYPE_WOMAN_2: + case ENHY_TYPE_OLD_MAN_BALD_PURPLE_ROBE: + case ENHY_TYPE_MAN_1_BOWL_CUT_GREEN_SHIRT: + this->actionFunc = EnHy_Fidget; break; - case ENHY_TYPE_BOJ_5: - case ENHY_TYPE_BOJ_9: - case ENHY_TYPE_BOJ_10: - case ENHY_TYPE_CNE_11: - case ENHY_TYPE_BOJ_12: + + case ENHY_TYPE_BEGGAR: + case ENHY_TYPE_MAN_2_MUSTACHE_RED_SHIRT: + case ENHY_TYPE_MAN_2_MUSTACHE_BLUE_SHIRT: + case ENHY_TYPE_YOUNG_WOMAN_ORANGE_HAIR: + case ENHY_TYPE_MAN_2_ALT_MUSTACHE: this->actionFunc = EnHy_DoNothing; break; + default: Actor_Kill(&this->actor); break; @@ -970,7 +1221,7 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) { } } -void func_80A710F8(EnHy* this, PlayState* play) { +void EnHy_WatchDog(EnHy* this, PlayState* play) { if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) { if (this->skelAnime.animation != &gObjOsAnim_0BFC) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENHY_ANIM_26); @@ -984,7 +1235,7 @@ void func_80A710F8(EnHy* this, PlayState* play) { } } -void func_80A711B4(EnHy* this, PlayState* play) { +void EnHy_Walk(EnHy* this, PlayState* play) { s16 yaw; f32 distSq; @@ -1000,24 +1251,24 @@ void func_80A711B4(EnHy* this, PlayState* play) { } } -void func_80A7127C(EnHy* this, PlayState* play) { - func_80034F54(play, this->unk_21C, this->unk_23C, 16); +void EnHy_Fidget(EnHy* this, PlayState* play) { + func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16); } void EnHy_DoNothing(EnHy* this, PlayState* play) { } -void func_80A712C0(EnHy* this, PlayState* play) { +void EnHy_SetupPace(EnHy* this, PlayState* play) { if ((this->actor.xzDistToPlayer <= 100.0f) && (this->path != NULL)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENHY_ANIM_7); this->actor.speed = 0.4f; - this->actionFunc = func_80A7134C; + this->actionFunc = EnHy_Pace; } - func_80034F54(play, this->unk_21C, this->unk_23C, 16); + func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16); } -void func_80A7134C(EnHy* this, PlayState* play) { +void EnHy_Pace(EnHy* this, PlayState* play) { s16 yaw; f32 distSq; @@ -1051,23 +1302,24 @@ void func_80A7134C(EnHy* this, PlayState* play) { } } -void func_80A714C4(EnHy* this, PlayState* play) { +void EnHy_WaitDogFoundRewardGiven(EnHy* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - this->actionFunc = func_80A71530; + this->actionFunc = EnHy_FinishGivingDogFoundReward; } else { - Actor_OfferGetItem(&this->actor, play, this->unkGetItemId, this->actor.xzDistToPlayer + 1.0f, + Actor_OfferGetItem(&this->actor, play, this->getItemId, this->actor.xzDistToPlayer + 1.0f, fabsf(this->actor.yDistToPlayer) + 1.0f); } } -void func_80A71530(EnHy* this, PlayState* play) { +void EnHy_FinishGivingDogFoundReward(EnHy* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - switch (this->unkGetItemId) { + switch (this->getItemId) { case GI_HEART_PIECE: gSaveContext.dogParams = 0; gSaveContext.dogIsLost = false; SET_INFTABLE(INFTABLE_191); break; + case GI_RUPEE_BLUE: Rupees_ChangeBy(5); gSaveContext.dogParams = 0; @@ -1075,14 +1327,14 @@ void func_80A71530(EnHy* this, PlayState* play) { break; } - this->actionFunc = func_80A7127C; + this->actionFunc = EnHy_Fidget; } } void EnHy_Update(Actor* thisx, PlayState* play) { EnHy* this = (EnHy*)thisx; - if (this->actionFunc != EnHy_InitImpl) { + if (this->actionFunc != EnHy_WaitForObjects) { gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotOsAnime].segment); SkelAnime_Update(&this->skelAnime); EnHy_UpdateEyes(this); @@ -1095,7 +1347,7 @@ void EnHy_Update(Actor* thisx, PlayState* play) { } this->actionFunc(this, play); - func_80A70978(this, play); + EnHy_UpdateNPC(this, play); EnHy_UpdateCollider(this, play); } @@ -1103,26 +1355,26 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po EnHy* this = (EnHy*)thisx; s32 pad; Vec3s limbRot; - u8 i; - void* ptr; + u8 headInfoIndex; + void* eyeTex; OPEN_DISPS(play->state.gfxCtx, "../z_en_hy.c", 2170); - if (limbIndex == 15) { + if (limbIndex == ENHY_LIMB_HEAD) { gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectSlotHead].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotHead].segment); - i = sModelInfo[this->actor.params & 0x7F].headInfoIndex; - *dList = sHeadInfo[i].headDList; + headInfoIndex = sModelInfo[ENHY_GET_TYPE(&this->actor)].headInfoIndex; + *dList = sHeadInfo[headInfoIndex].headDList; - if (sHeadInfo[i].eyeTextures != NULL) { - ptr = sHeadInfo[i].eyeTextures[this->curEyeIndex]; - gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(ptr)); + if (sHeadInfo[headInfoIndex].eyeTextures != NULL) { + eyeTex = sHeadInfo[headInfoIndex].eyeTextures[this->curEyeIndex]; + gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(eyeTex)); } - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotSkel1].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotLowerSkel].segment); } - if (limbIndex == 15) { + if (limbIndex == ENHY_LIMB_HEAD) { Matrix_Translate(1400.0f, 0.0f, 0.0f, MTXMODE_APPLY); limbRot = this->interactInfo.headRot; Matrix_RotateX(BINANG_TO_RAD_ALT(limbRot.y), MTXMODE_APPLY); @@ -1130,19 +1382,18 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po Matrix_Translate(-1400.0f, 0.0f, 0.0f, MTXMODE_APPLY); } - if (limbIndex == 8) { + if (limbIndex == ENHY_LIMB_TORSO) { limbRot = this->interactInfo.torsoRot; Matrix_RotateX(BINANG_TO_RAD_ALT(-limbRot.y), MTXMODE_APPLY); Matrix_RotateZ(BINANG_TO_RAD_ALT(limbRot.x), MTXMODE_APPLY); } - if ((limbIndex == 8) || (limbIndex == 9) || (limbIndex == 12)) { - rot->y += Math_SinS(this->unk_21C[limbIndex]) * 200.0f; - rot->z += Math_CosS(this->unk_23C[limbIndex]) * 200.0f; + if ((limbIndex == ENHY_LIMB_TORSO) || (limbIndex == ENHY_LIMB_LEFT_UPPER_ARM) || + (limbIndex == ENHY_LIMB_RIGHT_UPPER_ARM)) { + rot->y += Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f; + rot->z += Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f; } - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_en_hy.c", 2228); return false; @@ -1151,34 +1402,33 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po void EnHy_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { EnHy* this = (EnHy*)thisx; s32 pad; - Vec3f sp3C = { 400.0f, 0.0f, 0.0f }; + Vec3f focusOffset = { 400.0f, 0.0f, 0.0f }; OPEN_DISPS(play->state.gfxCtx, "../z_en_hy.c", 2255); - if (limbIndex == 7) { - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectSlotSkel2].segment); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotSkel2].segment); + if (limbIndex == ENHY_LIMB_RIGHT_FOOT) { + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectSlotUpperSkel].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotUpperSkel].segment); } - if ((this->actor.params & 0x7F) == ENHY_TYPE_BOJ_3 && limbIndex == 8) { - gSPDisplayList(POLY_OPA_DISP++, object_boj_DL_005BC8); + if (ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_MAN_2_BALD && limbIndex == ENHY_LIMB_TORSO) { + gSPDisplayList(POLY_OPA_DISP++, gHylianMan2BagDL); } - if (limbIndex == 15) { - Matrix_MultVec3f(&sp3C, &this->actor.focus.pos); + if (limbIndex == ENHY_LIMB_HEAD) { + Matrix_MultVec3f(&focusOffset, &this->actor.focus.pos); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_hy.c", 2281); } -Gfx* EnHy_SetEnvColor(GraphicsContext* play, u8 envR, u8 envG, u8 envB, u8 envA) { - Gfx* dList; +Gfx* EnHy_SetEnvColor(GraphicsContext* gfxCtx, u8 envR, u8 envG, u8 envB, u8 envA) { + Gfx* gfx = GRAPH_ALLOC(gfxCtx, 2 * sizeof(Gfx)); - dList = GRAPH_ALLOC(play, 2 * sizeof(Gfx)); - gDPSetEnvColor(dList, envR, envG, envB, envA); - gSPEndDisplayList(dList + 1); + gDPSetEnvColor(&gfx[0], envR, envG, envB, envA); + gSPEndDisplayList(&gfx[1]); - return dList; + return gfx; } void EnHy_Draw(Actor* thisx, PlayState* play) { @@ -1189,34 +1439,30 @@ void EnHy_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_hy.c", 2318); - if (this->actionFunc != EnHy_InitImpl) { + if (this->actionFunc != EnHy_WaitForObjects) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Matrix_Translate(this->modelOffset.x, this->modelOffset.y, this->modelOffset.z, MTXMODE_APPLY); - envColorSeg8 = sModelInfo[this->actor.params & 0x7F].envColorSeg8; - envColorSeg9 = sModelInfo[this->actor.params & 0x7F].envColorSeg9; - - switch (this->actor.params & 0x7F) { - // ENHY_TYPE_AOB - // ENHY_TYPE_COB - case ENHY_TYPE_AHG_2: - case ENHY_TYPE_BOJ_3: - case ENHY_TYPE_AHG_4: - case ENHY_TYPE_BOJ_5: - // ENHY_TYPE_BBA - case ENHY_TYPE_BJI_7: - case ENHY_TYPE_CNE_8: - case ENHY_TYPE_BOJ_9: - case ENHY_TYPE_BOJ_10: - case ENHY_TYPE_CNE_11: - case ENHY_TYPE_BOJ_12: - case ENHY_TYPE_AHG_13: - case ENHY_TYPE_BOJ_14: - case ENHY_TYPE_BJI_15: - case ENHY_TYPE_BOJ_16: - case ENHY_TYPE_AHG_17: - // ENHY_TYPE_BOB_18 - case ENHY_TYPE_BJI_19: - case ENHY_TYPE_AHG_20: + envColorSeg8 = sModelInfo[ENHY_GET_TYPE(&this->actor)].envColorSeg8; + envColorSeg9 = sModelInfo[ENHY_GET_TYPE(&this->actor)].envColorSeg9; + + switch (ENHY_GET_TYPE(&this->actor)) { + case ENHY_TYPE_MAN_1_BEARD: + case ENHY_TYPE_MAN_2_BALD: + case ENHY_TYPE_MAN_1_SHAVED_BLACK_SHIRT: + case ENHY_TYPE_BEGGAR: + case ENHY_TYPE_OLD_MAN: + case ENHY_TYPE_YOUNG_WOMAN_BROWN_HAIR: + case ENHY_TYPE_MAN_2_MUSTACHE_RED_SHIRT: + case ENHY_TYPE_MAN_2_MUSTACHE_BLUE_SHIRT: + case ENHY_TYPE_YOUNG_WOMAN_ORANGE_HAIR: + case ENHY_TYPE_MAN_2_ALT_MUSTACHE: + case ENHY_TYPE_MAN_1_BOWL_CUT_PURPLE_SHIRT: + case ENHY_TYPE_MAN_2_BEARD: + case ENHY_TYPE_OLD_MAN_BALD_BROWN_ROBE: + case ENHY_TYPE_MAN_2_MUSTACHE_WHITE_SHIRT: + case ENHY_TYPE_MAN_1_SHAVED_GREEN_SHIRT: + case ENHY_TYPE_OLD_MAN_BALD_PURPLE_ROBE: + case ENHY_TYPE_MAN_1_BOWL_CUT_GREEN_SHIRT: gSPSegment(POLY_OPA_DISP++, 0x08, EnHy_SetEnvColor(play->state.gfxCtx, envColorSeg8.r, envColorSeg8.g, envColorSeg8.b, envColorSeg8.a)); @@ -1224,11 +1470,12 @@ void EnHy_Draw(Actor* thisx, PlayState* play) { EnHy_SetEnvColor(play->state.gfxCtx, envColorSeg9.r, envColorSeg9.g, envColorSeg9.b, envColorSeg9.a)); - if ((this->actor.params & 0x7F) == ENHY_TYPE_CNE_8 || (this->actor.params & 0x7F) == ENHY_TYPE_CNE_11) { - if ((this->actor.params & 0x7F) == ENHY_TYPE_CNE_8) { + if (ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_YOUNG_WOMAN_BROWN_HAIR || + ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_YOUNG_WOMAN_ORANGE_HAIR) { + if (ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_YOUNG_WOMAN_BROWN_HAIR) { envColorSeg10 = envColorSeg8; } - if ((this->actor.params & 0x7F) == ENHY_TYPE_CNE_11) { + if (ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_YOUNG_WOMAN_ORANGE_HAIR) { envColorSeg10.r = envColorSeg10.g = envColorSeg10.b = 255; envColorSeg10.a = 0; } @@ -1237,6 +1484,13 @@ void EnHy_Draw(Actor* thisx, PlayState* play) { envColorSeg10.a)); } break; + + // ENHY_TYPE_DOG_LADY + // ENHY_TYPE_WOMAN_3 + // ENHY_TYPE_OLD_WOMAN + // ENHY_TYPE_WOMAN_2 + default: + break; } SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.h b/src/overlays/actors/ovl_En_Hy/z_en_hy.h index 760ed9dfed..00aa85bbce 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.h +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.h @@ -4,31 +4,54 @@ #include "ultra64.h" #include "global.h" -typedef enum { - /* 0 */ ENHY_TYPE_AOB, - /* 1 */ ENHY_TYPE_COB, - /* 2 */ ENHY_TYPE_AHG_2, - /* 3 */ ENHY_TYPE_BOJ_3, - /* 4 */ ENHY_TYPE_AHG_4, - /* 5 */ ENHY_TYPE_BOJ_5, - /* 6 */ ENHY_TYPE_BBA, - /* 7 */ ENHY_TYPE_BJI_7, - /* 8 */ ENHY_TYPE_CNE_8, - /* 9 */ ENHY_TYPE_BOJ_9, - /* 10 */ ENHY_TYPE_BOJ_10, - /* 11 */ ENHY_TYPE_CNE_11, - /* 12 */ ENHY_TYPE_BOJ_12, - /* 13 */ ENHY_TYPE_AHG_13, - /* 14 */ ENHY_TYPE_BOJ_14, - /* 15 */ ENHY_TYPE_BJI_15, - /* 16 */ ENHY_TYPE_BOJ_16, - /* 17 */ ENHY_TYPE_AHG_17, - /* 18 */ ENHY_TYPE_BOB_18, - /* 19 */ ENHY_TYPE_BJI_19, - /* 20 */ ENHY_TYPE_AHG_20, +#define ENHY_GET_TYPE(thisx) PARAMS_GET_S((thisx)->params, 0, 7) +#define ENHY_GET_PATH_INDEX(thisx) PARAMS_GET_S((thisx)->params, 7, 4) + +typedef enum EnHyType { + /* 0 */ ENHY_TYPE_DOG_LADY, + /* 1 */ ENHY_TYPE_WOMAN_3, + /* 2 */ ENHY_TYPE_MAN_1_BEARD, + /* 3 */ ENHY_TYPE_MAN_2_BALD, + /* 4 */ ENHY_TYPE_MAN_1_SHAVED_BLACK_SHIRT, + /* 5 */ ENHY_TYPE_BEGGAR, + /* 6 */ ENHY_TYPE_OLD_WOMAN, + /* 7 */ ENHY_TYPE_OLD_MAN, + /* 8 */ ENHY_TYPE_YOUNG_WOMAN_BROWN_HAIR, + /* 9 */ ENHY_TYPE_MAN_2_MUSTACHE_RED_SHIRT, + /* 10 */ ENHY_TYPE_MAN_2_MUSTACHE_BLUE_SHIRT, + /* 11 */ ENHY_TYPE_YOUNG_WOMAN_ORANGE_HAIR, + /* 12 */ ENHY_TYPE_MAN_2_ALT_MUSTACHE, + /* 13 */ ENHY_TYPE_MAN_1_BOWL_CUT_PURPLE_SHIRT, + /* 14 */ ENHY_TYPE_MAN_2_BEARD, + /* 15 */ ENHY_TYPE_OLD_MAN_BALD_BROWN_ROBE, + /* 16 */ ENHY_TYPE_MAN_2_MUSTACHE_WHITE_SHIRT, + /* 17 */ ENHY_TYPE_MAN_1_SHAVED_GREEN_SHIRT, + /* 18 */ ENHY_TYPE_WOMAN_2, + /* 19 */ ENHY_TYPE_OLD_MAN_BALD_PURPLE_ROBE, + /* 20 */ ENHY_TYPE_MAN_1_BOWL_CUT_GREEN_SHIRT, /* 21 */ ENHY_TYPE_MAX } EnHyType; +typedef enum EnHyLimb { + /* 0x00 */ ENHY_LIMB_NONE, + /* 0x01 */ ENHY_LIMB_PELVIS, + /* 0x02 */ ENHY_LIMB_LEFT_THIGH, + /* 0x03 */ ENHY_LIMB_LEFT_SHIN, + /* 0x04 */ ENHY_LIMB_LEFT_FOOT, + /* 0x05 */ ENHY_LIMB_RIGHT_THIGH, + /* 0x06 */ ENHY_LIMB_RIGHT_SHIN, + /* 0x07 */ ENHY_LIMB_RIGHT_FOOT, + /* 0x08 */ ENHY_LIMB_TORSO, + /* 0x09 */ ENHY_LIMB_LEFT_UPPER_ARM, + /* 0x0A */ ENHY_LIMB_LEFT_FOREARM, + /* 0x0B */ ENHY_LIMB_LEFT_HAND, + /* 0x0C */ ENHY_LIMB_RIGHT_UPPER_ARM, + /* 0x0D */ ENHY_LIMB_RIGHT_FOREARM, + /* 0x0E */ ENHY_LIMB_RIGHT_HAND, + /* 0x0F */ ENHY_LIMB_HEAD, + /* 0x10 */ ENHY_LIMB_MAX +} EnHyLimb; + struct EnHy; typedef void (*EnHyActionFunc)(struct EnHy*, PlayState*); @@ -40,25 +63,25 @@ typedef struct EnHy { /* 0x0194 */ char unk_194; // unused /* 0x0195 */ u8 pathReverse; /* 0x0196 */ s8 objectSlotHead; - /* 0x0197 */ s8 objectSlotSkel2; // 7 < limb < 15 (upper part?) (always same as objectSlotSkel1) - /* 0x0198 */ s8 objectSlotSkel1; // sets the object used when drawing the skeleton for limb <= 7 (lower part?) + /* 0x0197 */ s8 objectSlotUpperSkel; // upper body limbs object, 7 < limb < 15 (always same as objectSlotLowerSkel), + /* 0x0198 */ s8 objectSlotLowerSkel; // lower body limbs object, limb <= 7 /* 0x0199 */ s8 objectSlotOsAnime; /* 0x019C */ ColliderCylinder collider; /* 0x01E8 */ NpcInteractInfo interactInfo; /* 0x0210 */ Path* path; /* 0x0214 */ s8 waypoint; - /* 0x0215 */ s8 unk_215; + /* 0x0215 */ s8 playedSfx; /* 0x0216 */ char unk_216[2]; // unused /* 0x0218 */ s16 curEyeIndex; /* 0x021A */ s16 nextEyeIndexTimer; - /* 0x021C */ s16 unk_21C[16]; // bodyWiggleY ? - /* 0x023C */ s16 unk_23C[16]; // bodyWiggleZ ? + /* 0x021C */ s16 fidgetTableY[16]; + /* 0x023C */ s16 fidgetTableZ[16]; /* 0x025C */ f32 interactRange; - /* 0x0260 */ s32 unkGetItemId; + /* 0x0260 */ s32 getItemId; /* 0x0264 */ Vec3f modelOffset; - /* 0x0270 */ Vec3s jointTable[16]; - /* 0x02D0 */ Vec3s morphTable[16]; - /* 0x0330 */ u16 unk_330; + /* 0x0270 */ Vec3s jointTable[ENHY_LIMB_MAX]; + /* 0x02D0 */ Vec3s morphTable[ENHY_LIMB_MAX]; + /* 0x0330 */ u16 talonEventChkInf; } EnHy; // size = 0x0334 #endif diff --git a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c index a03d2cfd06..7964c5020f 100644 --- a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c +++ b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c @@ -24,7 +24,7 @@ void EnIceHono_SetupActionDroppedFlame(EnIceHono* this); void EnIceHono_SetupActionSpreadFlames(EnIceHono* this); void EnIceHono_SetupActionSmallFlame(EnIceHono* this); -ActorInit En_Ice_Hono_InitVars = { +ActorProfile En_Ice_Hono_Profile = { /**/ ACTOR_EN_ICE_HONO, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -38,7 +38,7 @@ ActorInit En_Ice_Hono_InitVars = { static ColliderCylinderInit sCylinderInitCapturableFlame = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -46,7 +46,7 @@ static ColliderCylinderInit sCylinderInitCapturableFlame = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -58,7 +58,7 @@ static ColliderCylinderInit sCylinderInitCapturableFlame = { static ColliderCylinderInit sCylinderInitDroppedFlame = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_OTHER, AC_NONE, OC1_ON | OC1_TYPE_2, @@ -66,7 +66,7 @@ static ColliderCylinderInit sCylinderInitDroppedFlame = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -77,8 +77,8 @@ static ColliderCylinderInit sCylinderInitDroppedFlame = { }; static InitChainEntry sInitChainCapturableFlame[] = { - ICHAIN_U8(targetMode, 0, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 60, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_0, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 60, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP), @@ -105,7 +105,7 @@ void EnIceHono_InitCapturableFlame(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChainCapturableFlame); Actor_SetScale(&this->actor, 0.0074f); - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; Actor_SetFocus(&this->actor, 10.0f); Collider_InitCylinder(play, &this->collider); @@ -221,7 +221,7 @@ void EnIceHono_CapturableFlame(EnIceHono* this, PlayState* play) { if (this->actor.xzDistToPlayer < 200.0f) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } - func_8002F8F0(&this->actor, NA_SE_EV_FIRE_PILLAR_S - SFX_FLAG); + Actor_PlaySfx_Flagged2(&this->actor, NA_SE_EV_FIRE_PILLAR_S - SFX_FLAG); } void EnIceHono_SetupActionDroppedFlame(EnIceHono* this) { @@ -348,7 +348,7 @@ void EnIceHono_Update(Actor* thisx, PlayState* play) { this->timer--; } if (this->actor.params == 0) { - func_8002F8F0(&this->actor, NA_SE_IT_FLAME - SFX_FLAG); + Actor_PlaySfx_Flagged2(&this->actor, NA_SE_IT_FLAME - SFX_FLAG); } if ((this->actor.params == -1) || (this->actor.params == 0)) { this->unk_154 += 0x1111; @@ -391,8 +391,7 @@ void EnIceHono_Draw(Actor* thisx, PlayState* play) { Matrix_RotateY(BINANG_TO_RAD((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) - this->actor.shape.rot.y + 0x8000)), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ice_hono.c", 718), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_ice_hono.c", 718); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_ice_hono.c", 722); diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index da82e07253..69644f547f 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -8,6 +8,7 @@ #include "assets/scenes/dungeons/jyasinboss/jyasinboss_scene.h" #include "assets/objects/object_ik/object_ik.h" #include "terminal.h" +#include "versions.h" #define FLAGS ACTOR_FLAG_4 @@ -15,7 +16,7 @@ typedef void (*EnIkDrawFunc)(struct EnIk*, PlayState*); #define ARMOR_BROKEN (1 << 0) -typedef enum { +typedef enum EnIkCsAction { /* 0x00 */ IK_CS_ACTION_0, /* 0x01 */ IK_CS_ACTION_1, /* 0x02 */ IK_CS_ACTION_2, @@ -24,13 +25,13 @@ typedef enum { /* 0x05 */ IK_CS_ACTION_5 } EnIkCsAction; -typedef enum { +typedef enum EnIkCsDrawMode { /* 0x00 */ IK_CS_DRAW_NOTHING, /* 0x01 */ IK_CS_DRAW_INTRO, /* 0x02 */ IK_CS_DRAW_DEFEAT } EnIkCsDrawMode; -typedef enum { +typedef enum EnIkDamageEffect { /* 0x0 */ EN_IK_DMGEFF_NONE, /* 0x6 */ EN_IK_DMGEFF_ELEMENTAL_MAGIC = 0x6, /* 0xD */ EN_IK_DMGEFF_SPARKS_NO_DMG = 0xD, @@ -67,7 +68,7 @@ void EnIk_StartDefeatCutscene(Actor* thisx, PlayState* play); static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -75,7 +76,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -88,7 +89,7 @@ static ColliderCylinderInit sCylinderInit = { static ColliderTrisElementInit sTrisElementsInit[2] = { { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0xFFC3FFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -99,7 +100,7 @@ static ColliderTrisElementInit sTrisElementsInit[2] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0xFFC3FFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -112,7 +113,7 @@ static ColliderTrisElementInit sTrisElementsInit[2] = { static ColliderTrisInit sTrisInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, @@ -125,7 +126,7 @@ static ColliderTrisInit sTrisInit = { static ColliderQuadInit sQuadInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -133,7 +134,7 @@ static ColliderQuadInit sQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x20000000, 0x00, 0x40 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL | ATELEM_UNK7, @@ -313,7 +314,7 @@ void EnIk_StandUp(EnIk* this, PlayState* play) { } if (SkelAnime_Update(&this->skelAnime)) { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_2; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE; EnIk_SetupWalkOrRun(this); } } @@ -321,7 +322,7 @@ void EnIk_StandUp(EnIk* this, PlayState* play) { void EnIk_SetupIdle(EnIk* this) { f32 endFrame = Animation_GetLastFrame(&object_ik_Anim_00DD50); - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_2; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE; this->unk_2F8 = 4; this->actor.speed = 0.0f; Animation_Change(&this->skelAnime, &object_ik_Anim_00DD50, 0.0f, 0.0f, endFrame, ANIMMODE_LOOP, 4.0f); @@ -757,9 +758,11 @@ void EnIk_UpdateDamage(EnIk* this, PlayState* play) { } else if (this->actor.colChkInfo.health <= 10) { Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_BOSS); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EN_LAST_DAMAGE); +#if !OOT_PAL_N64 if (this->switchFlag != 0xFF) { Flags_SetSwitch(play, this->switchFlag); } +#endif return; } else if (prevHealth == 50) { Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); @@ -817,7 +820,7 @@ void EnIk_UpdateEnemy(Actor* thisx, PlayState* play) { prevInvincibilityTimer = player->invincibilityTimer; if (player->invincibilityTimer <= 0) { - if (player->invincibilityTimer < -39) { + if (player->invincibilityTimer <= -40) { player->invincibilityTimer = 0; } else { player->invincibilityTimer = 0; @@ -826,7 +829,7 @@ void EnIk_UpdateEnemy(Actor* thisx, PlayState* play) { } } - func_8002F71C(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); player->invincibilityTimer = prevInvincibilityTimer; } } @@ -931,8 +934,7 @@ void EnIk_PostLimbDrawEnemy(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* BODYBREAK_OBJECT_SLOT_DEFAULT); } if (limbIndex == IRON_KNUCKLE_LIMB_HELMET_ARMOR) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ik_inFight.c", 1217), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_ik_inFight.c", 1217); if (this->actor.params != IK_TYPE_NABOORU) { gSPDisplayList(POLY_XLU_DISP++, gIronKnuckleHelmetMarkingDL); } else { @@ -970,29 +972,25 @@ void EnIk_PostLimbDrawEnemy(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* switch (limbIndex) { case IRON_KNUCKLE_LIMB_UPPER_LEFT_PAULDRON: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ik_inFight.c", 1270), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_ik_inFight.c", 1270); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016F88); break; case IRON_KNUCKLE_LIMB_UPPER_RIGHT_PAULDRON: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ik_inFight.c", 1275), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_ik_inFight.c", 1275); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016EE8); break; case IRON_KNUCKLE_LIMB_CHEST_ARMOR_FRONT: if (!(this->drawArmorFlag & ARMOR_BROKEN)) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ik_inFight.c", 1281), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_ik_inFight.c", 1281); gSPDisplayList(POLY_XLU_DISP++, gIronKnuckleArmorRivetAndSymbolDL); } break; case IRON_KNUCKLE_LIMB_CHEST_ARMOR_BACK: if (!(this->drawArmorFlag & ARMOR_BROKEN)) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ik_inFight.c", 1288), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_ik_inFight.c", 1288); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016CD8); } break; @@ -1236,6 +1234,9 @@ void EnIk_CsAction4(EnIk* this, PlayState* play) { void EnIk_CsAction5(EnIk* this, PlayState* play) { if (EnIk_GetCue(play, 4) == NULL) { +#if OOT_PAL_N64 + Flags_SetSwitch(play, this->switchFlag); +#endif Actor_Kill(&this->actor); } } @@ -1262,21 +1263,18 @@ void EnIk_PostLimbDrawDefeat(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* EnIk* this = (EnIk*)thisx; if (EnIk_GetAnimCurFrame(&this->actor) < 30.0f) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_ik_inAwake.c", 267), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_ik_inAwake.c", 267); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016D88); } } break; case IRON_KNUCKLE_DEFEAT_LIMB_UPPER_LEFT_PAULDRON: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_ik_inAwake.c", 274), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_ik_inAwake.c", 274); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016F88); break; case IRON_KNUCKLE_DEFEAT_LIMB_UPPER_RIGHT_PAULDRON: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_ik_inAwake.c", 280), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_ik_inAwake.c", 280); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016EE8); break; @@ -1284,8 +1282,7 @@ void EnIk_PostLimbDrawDefeat(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* EnIk* this = (EnIk*)thisx; if (EnIk_GetAnimCurFrame(&this->actor) < 30.0f) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_ik_inAwake.c", 288), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_ik_inAwake.c", 288); gSPDisplayList(POLY_XLU_DISP++, gIronKnuckleArmorRivetAndSymbolDL); } } break; @@ -1294,8 +1291,7 @@ void EnIk_PostLimbDrawDefeat(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* EnIk* this = (EnIk*)thisx; if (EnIk_GetAnimCurFrame(&this->actor) < 30.0f) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_ik_inAwake.c", 297), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_ik_inAwake.c", 297); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016CD8); } } break; @@ -1435,32 +1431,27 @@ void EnIk_PostLimbDrawIntro(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* switch (limbIndex) { case IRON_KNUCKLE_LIMB_HELMET_ARMOR: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_ik_inConfrontion.c", 575), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_ik_inConfrontion.c", 575); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016D88); break; case IRON_KNUCKLE_LIMB_UPPER_LEFT_PAULDRON: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_ik_inConfrontion.c", 581), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_ik_inConfrontion.c", 581); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016F88); break; case IRON_KNUCKLE_LIMB_UPPER_RIGHT_PAULDRON: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_ik_inConfrontion.c", 587), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_ik_inConfrontion.c", 587); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016EE8); break; case IRON_KNUCKLE_LIMB_CHEST_ARMOR_FRONT: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_ik_inConfrontion.c", 593), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_ik_inConfrontion.c", 593); gSPDisplayList(POLY_XLU_DISP++, gIronKnuckleArmorRivetAndSymbolDL); break; case IRON_KNUCKLE_LIMB_CHEST_ARMOR_BACK: - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_ik_inConfrontion.c", 599), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_ik_inConfrontion.c", 599); gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016CD8); break; } @@ -1522,7 +1513,7 @@ void EnIk_CsInit(EnIk* this, PlayState* play) { void EnIk_ChangeToEnemy(EnIk* this, PlayState* play) { this->actor.update = EnIk_UpdateEnemy; this->actor.draw = EnIk_DrawEnemy; - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_2; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE; SET_EVENTCHKINF(EVENTCHKINF_3B); Actor_SetScale(&this->actor, 0.012f); EnIk_SetupIdle(this); @@ -1558,7 +1549,7 @@ void EnIk_Init(Actor* thisx, PlayState* play) { } } -ActorInit En_Ik_InitVars = { +ActorProfile En_Ik_Profile = { /**/ ACTOR_EN_IK, /**/ ACTORCAT_BOSS, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.h b/src/overlays/actors/ovl_En_Ik/z_en_ik.h index efdb9f02d9..70c45063b5 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.h +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.h @@ -8,18 +8,18 @@ struct EnIk; typedef void (*EnIkActionFunc)(struct EnIk*, PlayState*); -#define IK_GET_UPPER_PARAMS(thisx) ((thisx)->params & 0xFF00) -#define IK_GET_ARMOR_TYPE(thisx) ((thisx)->params & 0xFF) -#define IK_GET_SWITCH_FLAG(thisx) (((thisx)->params >> 8) & 0xFF) +#define IK_GET_UPPER_PARAMS(thisx) PARAMS_GET_NOSHIFT(this->actor.params, 8, 8) +#define IK_GET_ARMOR_TYPE(thisx) PARAMS_GET_U((thisx)->params, 0, 8) +#define IK_GET_SWITCH_FLAG(thisx) PARAMS_GET_U((thisx)->params, 8, 8) -typedef enum { +typedef enum EnIkType { /* 0 */ IK_TYPE_NABOORU, /* 1 */ IK_TYPE_SILVER, /* 2 */ IK_TYPE_BLACK, /* 3 */ IK_TYPE_WHITE } EnIkType; -typedef enum { +typedef enum IronKnuckleLimb { /* 0x00 */ IRON_KNUCKLE_LIMB_NONE, /* 0x01 */ IRON_KNUCKLE_LIMB_ROOT, /* 0x02 */ IRON_KNUCKLE_LIMB_LOWER_BODY, @@ -55,7 +55,7 @@ typedef enum { // This skeleton is only used in the defeat cutscene that reveals Nabooru under the armor. // The only difference between this skeleton and the main one is that the head and helmet armor limbs are swapped. -typedef enum { +typedef enum IronKnuckleDefeatLimb { /* 0x00 */ IRON_KNUCKLE_DEFEAT_LIMB_NONE, /* 0x01 */ IRON_KNUCKLE_DEFEAT_LIMB_ROOT, /* 0x02 */ IRON_KNUCKLE_DEFEAT_LIMB_LOWER_BODY, diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index 5e63760b25..acb7c46e39 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -1,8 +1,9 @@ #include "z_en_in.h" +#include "versions.h" #include "overlays/actors/ovl_En_Horse/z_en_horse.h" #include "assets/objects/object_in/object_in.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) void EnIn_Init(Actor* thisx, PlayState* play); void EnIn_Destroy(Actor* thisx, PlayState* play); @@ -24,7 +25,7 @@ void func_80A7A940(EnIn* this, PlayState* play); void func_80A7AA40(EnIn* this, PlayState* play); void func_80A7A4BC(EnIn* this, PlayState* play); -ActorInit En_In_InitVars = { +ActorProfile En_In_Profile = { /**/ ACTOR_EN_IN, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -38,7 +39,7 @@ ActorInit En_In_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -46,7 +47,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -58,7 +59,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -typedef enum { +typedef enum EnInAnimation { /* 0 */ ENIN_ANIM_0, /* 1 */ ENIN_ANIM_1, /* 2 */ ENIN_ANIM_2, @@ -337,8 +338,8 @@ void func_80A795C8(EnIn* this, PlayState* play) { void func_80A79690(SkelAnime* skelAnime, EnIn* this, PlayState* play) { if (skelAnime->baseTransl.y < skelAnime->jointTable[0].y) { - skelAnime->moveFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; - AnimTaskQueue_AddActorMove(play, &this->actor, skelAnime, 1.0f); + skelAnime->movementFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; + AnimTaskQueue_AddActorMovement(play, &this->actor, skelAnime, 1.0f); } } @@ -467,7 +468,7 @@ void func_80A79C78(EnIn* this, PlayState* play) { player->rideActor->freezeTimer = 10; } player->actor.freezeTimer = 10; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Letterbox_SetSizeTarget(32); Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING_ALT); } @@ -503,7 +504,7 @@ void EnIn_Destroy(Actor* thisx, PlayState* play) { } // This function does not actually wait since it waits for OBJECT_IN, -// but the object is already loaded at this point from being set in the ActorInit data +// but the object is already loaded at this point from being set in the ActorProfile data void EnIn_WaitForObject(EnIn* this, PlayState* play) { s32 sp3C = 0; @@ -518,7 +519,7 @@ void EnIn_WaitForObject(EnIn* this, PlayState* play) { return; } Actor_SetScale(&this->actor, 0.01f); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->interactInfo.talkState = NPC_TALK_STATE_IDLE; this->actionFunc = func_80A7A4BC; @@ -577,7 +578,7 @@ void EnIn_WaitForObject(EnIn* this, PlayState* play) { gSaveContext.eventInf[EVENTINF_HORSES_INDEX] = 0; break; case EVENTINF_HORSES_STATE_1: - this->actor.targetMode = 3; + this->actor.attentionRangeType = ATTENTION_RANGE_3; EnIn_ChangeAnim(this, ENIN_ANIM_2); this->actionFunc = func_80A7A568; Interface_SetTimer(60); @@ -593,7 +594,7 @@ void EnIn_WaitForObject(EnIn* this, PlayState* play) { break; case EVENTINF_HORSES_STATE_5: case EVENTINF_HORSES_STATE_6: - this->actor.targetMode = 3; + this->actor.attentionRangeType = ATTENTION_RANGE_3; EnIn_ChangeAnim(this, ENIN_ANIM_6); this->unk_1EC = 8; this->actionFunc = func_80A7AA40; @@ -698,10 +699,10 @@ void func_80A7A568(EnIn* this, PlayState* play) { void func_80A7A770(EnIn* this, PlayState* play) { if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } else if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { Rupees_ChangeBy(-50); - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; EnIn_ChangeAnim(this, ENIN_ANIM_3); this->actionFunc = func_80A7A848; SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_7); @@ -736,7 +737,7 @@ void func_80A7A848(EnIn* this, PlayState* play) { void func_80A7A940(EnIn* this, PlayState* play) { if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; return; } if (this->unk_1EC != 0) { @@ -746,7 +747,7 @@ void func_80A7A940(EnIn* this, PlayState* play) { } } if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; func_80A79BAC(this, play, 2, TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST)); SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_2); SET_EVENTINF_HORSES_0F(1); @@ -933,18 +934,28 @@ void EnIn_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->actionFunc != func_80A7A304) { func_80A79AB4(this, play); +#if OOT_VERSION < PAL_1_0 + Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, + ((this->actor.attentionRangeType == 6) ? 80.0f : 320.0f) + this->collider.dim.radius, + EnIn_GetTextId, EnIn_UpdateTalkState); + if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) { + this->unk_1FA = this->unk_1F8; + this->unk_1F8 = Message_GetState(&play->msgCtx); + } +#else if ((gSaveContext.subTimerSeconds < 6) && (gSaveContext.subTimerState != SUBTIMER_STATE_OFF) && this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { if (Actor_TalkOfferAccepted(&this->actor, play)) {} } else { Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, - ((this->actor.targetMode == 6) ? 80.0f : 320.0f) + this->collider.dim.radius, + ((this->actor.attentionRangeType == 6) ? 80.0f : 320.0f) + this->collider.dim.radius, EnIn_GetTextId, EnIn_UpdateTalkState); if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) { this->unk_1FA = this->unk_1F8; this->unk_1F8 = Message_GetState(&play->msgCtx); } } +#endif func_80A795C8(this, play); } } diff --git a/src/overlays/actors/ovl_En_In/z_en_in.h b/src/overlays/actors/ovl_En_In/z_en_in.h index 57baa280d4..84b5db8bac 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.h +++ b/src/overlays/actors/ovl_En_In/z_en_in.h @@ -8,7 +8,7 @@ struct EnIn; typedef void (*EnInActionFunc)(struct EnIn*, PlayState*); -typedef enum { +typedef enum IngoLimb { /* 0x00 */ INGO_LIMB_NONE, /* 0x01 */ INGO_LIMB_ROOT, /* 0x02 */ INGO_LEFT_THIGH_LIMB, diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index 9140aef7b0..991c9de3ca 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -5,6 +5,7 @@ */ #include "z_en_insect.h" +#include "global.h" #include "terminal.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -42,7 +43,7 @@ static s16 sCaughtCount = 0; */ static s16 sDroppedCount = 0; -ActorInit En_Insect_InitVars = { +ActorProfile En_Insect_Profile = { /**/ ACTOR_EN_INSECT, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -57,7 +58,7 @@ ActorInit En_Insect_InitVars = { static ColliderJntSphElementInit sColliderItemInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -70,7 +71,7 @@ static ColliderJntSphElementInit sColliderItemInit[1] = { static ColliderJntSphInit sColliderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_1, @@ -99,7 +100,7 @@ static InitChainEntry sInitChain[] = { }; void EnInsect_InitFlags(EnInsect* this) { - this->insectFlags = sInitInsectFlags[this->actor.params & 3]; + this->insectFlags = sInitInsectFlags[PARAMS_GET_U(this->actor.params, 0, 2)]; } f32 EnInsect_XZDistanceSquared(Vec3f* v1, Vec3f* v2) { @@ -187,7 +188,7 @@ void EnInsect_Init(Actor* thisx, PlayState* play2) { Actor_ProcessInitChain(&this->actor, sInitChain); EnInsect_InitFlags(this); - type = this->actor.params & 3; + type = PARAMS_GET_U(this->actor.params, 0, 2); SkelAnime_Init(play, &this->skelAnime, &gBugSkel, &gBugCrawlAnim, this->jointTable, this->morphTable, 24); Collider_InitJntSph(play, &this->collider); @@ -242,7 +243,7 @@ void EnInsect_Destroy(Actor* thisx, PlayState* play) { s16 type; EnInsect* this = (EnInsect*)thisx; - type = this->actor.params & 3; + type = PARAMS_GET_U(this->actor.params, 0, 2); Collider_DestroyJntSph(play, &this->collider); if ((type == INSECT_TYPE_FIRST_DROPPED || type == INSECT_TYPE_EXTRA_DROPPED) && sDroppedCount > 0) { sDroppedCount--; @@ -261,7 +262,7 @@ void EnInsect_SlowDown(EnInsect* this, PlayState* play) { s16 type; f32 playSpeed; - type = this->actor.params & 3; + type = PARAMS_GET_U(this->actor.params, 0, 2); Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.1f, 0.5f, 0.0f); @@ -297,7 +298,7 @@ void EnInsect_Crawl(EnInsect* this, PlayState* play) { s32 pad1; s32 pad2; s16 yaw; - s16 type = this->actor.params & 3; + s16 type = PARAMS_GET_U(this->actor.params, 0, 2); Math_SmoothStepToF(&this->actor.speed, 1.5f, 0.1f, 0.5f, 0.0f); @@ -469,7 +470,7 @@ void EnInsect_WalkOnWater(EnInsect* this, PlayState* play) { s16 type; Vec3f ripplePoint; - type = this->actor.params & 3; + type = PARAMS_GET_U(this->actor.params, 0, 2); if (this->actionTimer > 80) { Math_StepToF(&this->actor.speed, 0.6f, 0.08f); @@ -571,7 +572,7 @@ void EnInsect_Dropped(EnInsect* this, PlayState* play) { f32 sp34; sp50 = 0; - type = this->actor.params & 3; + type = PARAMS_GET_U(this->actor.params, 0, 2); if (this->soilActor != NULL) { distanceSq = Math3D_Vec3fDistSq(&this->actor.world.pos, &this->soilActor->actor.world.pos); @@ -672,8 +673,8 @@ void EnInsect_Dropped(EnInsect* this, PlayState* play) { !(this->insectFlags & INSECT_FLAG_7)) { if (this->unk_32A >= 15) { if (this->soilActor != NULL) { - if (!(GET_GS_FLAGS(((this->soilActor->actor.params >> 8) & 0x1F) - 1) & - (this->soilActor->actor.params & 0xFF))) { + if (!(GET_GS_FLAGS(PARAMS_GET_U(this->soilActor->actor.params, 8, 5) - 1) & + PARAMS_GET_U(this->soilActor->actor.params, 0, 8))) { Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } } @@ -764,7 +765,7 @@ void EnInsect_Update(Actor* thisx, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; - tmp = this->actor.params & 3; + tmp = PARAMS_GET_U(this->actor.params, 0, 2); if (tmp == INSECT_TYPE_FIRST_DROPPED || tmp == INSECT_TYPE_EXTRA_DROPPED) { Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.h b/src/overlays/actors/ovl_En_Insect/z_en_insect.h index 2e1931bee4..31d2c1d050 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.h +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.h @@ -2,12 +2,12 @@ #define Z_EN_INSECT_H #include "ultra64.h" -#include "global.h" +#include "z64actor.h" #include "overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h" struct EnInsect; -typedef void (*EnInsectActionFunc)(struct EnInsect*, PlayState*); +typedef void (*EnInsectActionFunc)(struct EnInsect*, struct PlayState*); #define INSECT_FLAG_0 (1 << 0) #define INSECT_FLAG_1 (1 << 1) @@ -39,7 +39,7 @@ typedef struct EnInsect { /* 0x032A */ u8 unk_32A; } EnInsect; // size = 0x032C -typedef enum { +typedef enum EnInsectType { /* 0 */ INSECT_TYPE_PERMANENT, /* 1 */ INSECT_TYPE_SPAWNED, /* 2 */ INSECT_TYPE_FIRST_DROPPED, diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 52fc523783..e0e0dc1d50 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -11,7 +11,7 @@ #include "quake.h" #include "terminal.h" -#define FLAGS ACTOR_FLAG_23 +#define FLAGS ACTOR_FLAG_THROW_ONLY void EnIshi_Init(Actor* thisx, PlayState* play); void EnIshi_Destroy(Actor* thisx, PlayState* play2); @@ -32,7 +32,7 @@ void EnIshi_SpawnDustLarge(EnIshi* this, PlayState* play); static s16 sRotSpeedX = 0; static s16 sRotSpeedY = 0; -ActorInit En_Ishi_InitVars = { +ActorProfile En_Ishi_Profile = { /**/ ACTOR_EN_ISHI, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -62,7 +62,7 @@ static EnIshiEffectSpawnFunc sDustSpawnFuncs[] = { EnIshi_SpawnDustSmall, EnIshi static ColliderCylinderInit sCylinderInits[] = { { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -70,7 +70,7 @@ static ColliderCylinderInit sCylinderInits[] = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFFE, 0x00, 0x00 }, ATELEM_NONE, @@ -81,7 +81,7 @@ static ColliderCylinderInit sCylinderInits[] = { }, { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -89,7 +89,7 @@ static ColliderCylinderInit sCylinderInits[] = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFF6, 0x00, 0x00 }, ATELEM_NONE, @@ -106,7 +106,7 @@ void EnIshi_InitCollider(Actor* thisx, PlayState* play) { EnIshi* this = (EnIshi*)thisx; Collider_InitCylinder(play, &this->collider); - Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInits[this->actor.params & 1]); + Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInits[PARAMS_GET_U(this->actor.params, 0, 1)]); Collider_UpdateCylinder(&this->actor, &this->collider); } @@ -249,8 +249,8 @@ void EnIshi_SpawnDustLarge(EnIshi* this, PlayState* play) { void EnIshi_DropCollectible(EnIshi* this, PlayState* play) { s16 dropParams; - if ((this->actor.params & 1) == ROCK_SMALL) { - dropParams = (this->actor.params >> 8) & 0xF; + if (PARAMS_GET_U(this->actor.params, 0, 1) == ROCK_SMALL) { + dropParams = PARAMS_GET_U(this->actor.params, 8, 4); if (dropParams >= 0xD) { dropParams = 0; @@ -308,7 +308,7 @@ static InitChainEntry sInitChains[][5] = { void EnIshi_Init(Actor* thisx, PlayState* play) { EnIshi* this = (EnIshi*)thisx; - s16 type = this->actor.params & 1; + s16 type = PARAMS_GET_U(this->actor.params, 0, 1); Actor_ProcessInitChain(&this->actor, sInitChains[type]); if (play->csCtx.state != CS_STATE_IDLE) { @@ -319,14 +319,13 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { } Actor_SetScale(&this->actor, sRockScales[type]); EnIshi_InitCollider(&this->actor, play); - if ((type == ROCK_LARGE) && - Flags_GetSwitch(play, ((this->actor.params >> 0xA) & 0x3C) | ((this->actor.params >> 6) & 3))) { + if ((type == ROCK_LARGE) && Flags_GetSwitch(play, ISHI_GET_SWITCH_FLAG(&this->actor))) { Actor_Kill(&this->actor); return; } CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); this->actor.shape.yOffset = D_80A7FA20[type]; - if (!((this->actor.params >> 5) & 1) && !EnIshi_SnapToFloor(this, play, 0.0f)) { + if (!PARAMS_GET_U(this->actor.params, 5, 1) && !EnIshi_SnapToFloor(this, play, 0.0f)) { Actor_Kill(&this->actor); return; } @@ -347,12 +346,12 @@ void EnIshi_SetupWait(EnIshi* this) { void EnIshi_Wait(EnIshi* this, PlayState* play) { static u16 liftSfxIds[] = { NA_SE_PL_PULL_UP_ROCK, NA_SE_PL_PULL_UP_BIGROCK }; s32 pad; - s16 type = this->actor.params & 1; + s16 type = PARAMS_GET_U(this->actor.params, 0, 1); if (Actor_HasParent(&this->actor, play)) { EnIshi_SetupLiftedUp(this); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, liftSfxIds[type]); - if ((this->actor.params >> 4) & 1) { + if (PARAMS_GET_U(this->actor.params, 4, 1)) { EnIshi_SpawnBugs(this, play); } } else if ((this->collider.base.acFlags & AC_HIT) && (type == ROCK_SMALL) && @@ -389,12 +388,12 @@ void EnIshi_SetupLiftedUp(EnIshi* this) { void EnIshi_LiftedUp(EnIshi* this, PlayState* play) { if (Actor_HasNoParent(&this->actor, play)) { this->actor.room = play->roomCtx.curRoom.num; - if ((this->actor.params & 1) == ROCK_LARGE) { - Flags_SetSwitch(play, ((this->actor.params >> 0xA) & 0x3C) | ((this->actor.params >> 6) & 3)); + if (PARAMS_GET_U(this->actor.params, 0, 1) == ROCK_LARGE) { + Flags_SetSwitch(play, ISHI_GET_SWITCH_FLAG(&this->actor)); } EnIshi_SetupFly(this); EnIshi_Fall(this); - func_80A7ED94(&this->actor.velocity, D_80A7FA28[this->actor.params & 1]); + func_80A7ED94(&this->actor.velocity, D_80A7FA28[PARAMS_GET_U(this->actor.params, 0, 1)]); Actor_UpdatePos(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 7.5f, 35.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_6 | @@ -405,7 +404,7 @@ void EnIshi_LiftedUp(EnIshi* this, PlayState* play) { void EnIshi_SetupFly(EnIshi* this) { this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speed; this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speed; - if ((this->actor.params & 1) == ROCK_SMALL) { + if (PARAMS_GET_U(this->actor.params, 0, 1) == ROCK_SMALL) { sRotSpeedX = (Rand_ZeroOne() - 0.5f) * 16000.0f; sRotSpeedY = (Rand_ZeroOne() - 0.5f) * 2400.0f; } else { @@ -418,7 +417,7 @@ void EnIshi_SetupFly(EnIshi* this) { void EnIshi_Fly(EnIshi* this, PlayState* play) { s32 pad; - s16 type = this->actor.params & 1; + s16 type = PARAMS_GET_U(this->actor.params, 0, 1); s32 pad2; s32 quakeIndex; Vec3f contactPos; @@ -488,8 +487,7 @@ void EnIshi_DrawLarge(EnIshi* this, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_ishi.c", 1050); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ishi.c", 1055), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_ishi.c", 1055); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); gSPDisplayList(POLY_OPA_DISP++, gSilverRockDL); @@ -501,5 +499,5 @@ static EnIshiDrawFunc sDrawFuncs[] = { EnIshi_DrawSmall, EnIshi_DrawLarge }; void EnIshi_Draw(Actor* thisx, PlayState* play) { EnIshi* this = (EnIshi*)thisx; - sDrawFuncs[this->actor.params & 1](this, play); + sDrawFuncs[PARAMS_GET_U(this->actor.params, 0, 1)](this, play); } diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h index 3ce7c72bf3..f4469ea7bc 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h @@ -4,7 +4,21 @@ #include "ultra64.h" #include "global.h" -typedef enum { +// The switch flag value for this actor is constructed in a unique way. +// There are two separate param values which get OR'd together to create one final switch flag index. +// These two values are separated within the overall actor param value. See below: +// +// | A B C D | _ _ _ _ | E F | _ _ _ _ _ _ | +// 16 12 8 6 0 +// After the OR operation, the final switch flag is constructed to form "0bABCDEF" +// +// Due to the unique form of access to obtain the upper bits of the switch flag, `ISHI_GET_SWITCH_FLAG_UPPER` +// cannot use the generic `PARAMS_GET_U` macros. +#define ISHI_GET_SWITCH_FLAG_UPPER(thisx) ((((thisx)->params) >> (12 - 2)) & (NBITS_TO_MASK(4) << 2)) +#define ISHI_GET_SWITCH_FLAG_LOWER(thisx) PARAMS_GET_U((thisx)->params, 6, 2) +#define ISHI_GET_SWITCH_FLAG(thisx) (ISHI_GET_SWITCH_FLAG_UPPER(thisx) | ISHI_GET_SWITCH_FLAG_LOWER(thisx)) + +typedef enum EnIshiType { /* 0x00 */ ROCK_SMALL, /* 0x01 */ ROCK_LARGE } EnIshiType; diff --git a/src/overlays/actors/ovl_En_It/z_en_it.c b/src/overlays/actors/ovl_En_It/z_en_it.c index 39c0a913d4..312ceec96e 100644 --- a/src/overlays/actors/ovl_En_It/z_en_it.c +++ b/src/overlays/actors/ovl_En_It/z_en_it.c @@ -14,7 +14,7 @@ void EnIt_Update(Actor* thisx, PlayState* play); static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_NO_PUSH, @@ -22,7 +22,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -34,7 +34,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -ActorInit En_It_InitVars = { +ActorProfile En_It_Profile = { /**/ ACTOR_EN_IT, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Jj/z_en_jj.c b/src/overlays/actors/ovl_En_Jj/z_en_jj.c index 9162737dc4..999e97cd24 100644 --- a/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -10,7 +10,7 @@ #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) -typedef enum { +typedef enum EnJjEyeState { /* 0 */ JABUJABU_EYE_OPEN, /* 1 */ JABUJABU_EYE_HALF, /* 2 */ JABUJABU_EYE_CLOSED, @@ -28,7 +28,7 @@ void EnJj_WaitForFish(EnJj* this, PlayState* play); void EnJj_BeginCutscene(EnJj* this, PlayState* play); void EnJj_RemoveDust(EnJj* this, PlayState* play); -ActorInit En_Jj_InitVars = { +ActorProfile En_Jj_Profile = { /**/ ACTOR_EN_JJ, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -48,7 +48,7 @@ static s32 sUnused2[] = { 0, 0 }; static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -56,7 +56,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000004, 0x00, 0x00 }, ATELEM_NONE, diff --git a/src/overlays/actors/ovl_En_Jj/z_en_jj.h b/src/overlays/actors/ovl_En_Jj/z_en_jj.h index 3d5a9dc154..c5d6241204 100644 --- a/src/overlays/actors/ovl_En_Jj/z_en_jj.h +++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.h @@ -26,7 +26,7 @@ typedef struct EnJj { /* 0x0311 */ u8 extraBlinkTotal; } EnJj; // size = 0x0314 -typedef enum { +typedef enum EnJjType { /* -1 */ JABUJABU_MAIN = -1, // Head, drawn body, handles updating /* 0 */ JABUJABU_COLLISION, // Static collision for body /* 1 */ JABUJABU_UNUSED_COLLISION // Shaped like a screen diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.c b/src/overlays/actors/ovl_En_Js/z_en_js.c index 667ebf7404..6cd5163aec 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -7,7 +7,7 @@ #include "z_en_js.h" #include "assets/objects/object_js/object_js.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnJs_Init(Actor* thisx, PlayState* play); void EnJs_Destroy(Actor* thisx, PlayState* play); @@ -16,7 +16,7 @@ void EnJs_Draw(Actor* thisx, PlayState* play); void func_80A89304(EnJs* this, PlayState* play); -ActorInit En_Js_InitVars = { +ActorProfile En_Js_Profile = { /**/ ACTOR_EN_JS, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -30,7 +30,7 @@ ActorInit En_Js_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, @@ -38,7 +38,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -103,7 +103,7 @@ void func_80A89008(EnJs* this) { void func_80A89078(EnJs* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { func_80A89008(this); - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } } @@ -119,7 +119,7 @@ void func_80A8910C(EnJs* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { this->actor.textId = 0x6078; En_Js_SetupAction(this, func_80A890C0); - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } } diff --git a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c index f6fcd43c62..6650e31715 100644 --- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c +++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c @@ -7,14 +7,14 @@ #include "z_en_jsjutan.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnJsjutan_Init(Actor* thisx, PlayState* play); void EnJsjutan_Destroy(Actor* thisx, PlayState* play); void EnJsjutan_Update(Actor* thisx, PlayState* play2); void EnJsjutan_Draw(Actor* thisx, PlayState* play2); -ActorInit En_Jsjutan_InitVars = { +ActorProfile En_Jsjutan_Profile = { /**/ ACTOR_EN_JSJUTAN, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -40,7 +40,7 @@ void EnJsjutan_Init(Actor* thisx, PlayState* play) { s32 pad; CollisionHeader* header = NULL; - this->dyna.actor.flags &= ~ACTOR_FLAG_0; + this->dyna.actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; DynaPolyActor_Init(&this->dyna, 0); CollisionHeader_GetVirtual(&sCol, &header); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, header); @@ -407,8 +407,7 @@ void EnJsjutan_Draw(Actor* thisx, PlayState* play2) { Matrix_Translate(thisx->world.pos.x, 3.0f, thisx->world.pos.z, MTXMODE_NEW); Matrix_Scale(thisx->scale.x, 1.0f, thisx->scale.z, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_jsjutan.c", 782), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_jsjutan.c", 782); // Draws the carpet's shadow texture. gSPDisplayList(POLY_OPA_DISP++, sShadowMaterialDL); @@ -426,8 +425,7 @@ void EnJsjutan_Draw(Actor* thisx, PlayState* play2) { Matrix_Translate(thisx->world.pos.x, this->unk_168 + 3.0f, thisx->world.pos.z, MTXMODE_NEW); Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_jsjutan.c", 805), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_jsjutan.c", 805); // Draws the carpet's texture. gSPDisplayList(POLY_OPA_DISP++, sCarpetMaterialDL); diff --git a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h index f9d85b6d06..63a694bad6 100644 --- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h +++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h @@ -16,7 +16,7 @@ typedef struct EnJsjutan { /* 0x0175 */ u8 unk_175; // setup flag? } EnJsjutan; // size = 0x0178 -typedef enum { +typedef enum EnJsjutanType { /* 0 */ ENJSJUTAN_TYPE_00, /* 1 */ ENJSJUTAN_TYPE_01 } EnJsjutanType; diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 0d7cd9d831..c82d070bcf 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -8,7 +8,7 @@ #include "terminal.h" #include "assets/objects/object_ka/object_ka.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_25) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_25) void EnKakasi_Init(Actor* thisx, PlayState* play); void EnKakasi_Destroy(Actor* thisx, PlayState* play); @@ -24,7 +24,7 @@ void func_80A8FAA4(EnKakasi* this, PlayState* play); static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -32,7 +32,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -42,7 +42,7 @@ static ColliderCylinderInit sCylinderInit = { { 20, 70, 0, { 0, 0, 0 } }, }; -ActorInit En_Kakasi_InitVars = { +ActorProfile En_Kakasi_Profile = { /**/ ACTOR_EN_KAKASI, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -69,7 +69,7 @@ void EnKakasi_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; SkelAnime_InitFlex(play, &this->skelanime, &object_ka_Skel_0065B0, &object_ka_Anim_000214, NULL, NULL, 0); this->rot = this->actor.world.rot; diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index a3dd8a23ac..923c871434 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -8,11 +8,11 @@ #include "terminal.h" #include "assets/objects/object_ka/object_ka.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25 | ACTOR_FLAG_27) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25 | ACTOR_FLAG_LOCK_ON_DISABLED) static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -20,7 +20,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -41,7 +41,7 @@ void func_80A904D8(EnKakasi2* this, PlayState* play); void func_80A90578(EnKakasi2* this, PlayState* play); void func_80A906C4(EnKakasi2* this, PlayState* play); -ActorInit En_Kakasi2_InitVars = { +ActorProfile En_Kakasi2_Profile = { /**/ ACTOR_EN_KAKASI2, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -63,13 +63,13 @@ void EnKakasi2_Init(Actor* thisx, PlayState* play) { // "Visit Umeda" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 梅田参号見参! ☆☆☆☆☆ \n" VT_RST); - this->switchFlag = this->actor.params & 0x3F; - spawnRangeY = (this->actor.params >> 6) & 0xFF; + this->switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); + spawnRangeY = PARAMS_GET_U(this->actor.params, 6, 8); spawnRangeXZ = this->actor.world.rot.z; if (this->switchFlag == 0x3F) { this->switchFlag = -1; } - this->actor.targetMode = 4; + this->actor.attentionRangeType = ATTENTION_RANGE_4; this->maxSpawnDistance.x = (spawnRangeY * 40.0f) + 40.0f; this->maxSpawnDistance.y = (spawnRangeXZ * 40.0f) + 40.0f; @@ -127,7 +127,7 @@ void func_80A90264(EnKakasi2* this, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); SkelAnime_InitFlex(play, &this->skelAnime, &object_ka_Skel_0065B0, &object_ka_Anim_000214, NULL, NULL, 0); OnePointCutscene_Attention(play, &this->actor); - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_27; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_LOCK_ON_DISABLED; Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); if (this->switchFlag >= 0) { @@ -156,7 +156,7 @@ void func_80A90264(EnKakasi2* this, PlayState* play) { OnePointCutscene_Attention(play, &this->actor); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_27; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_LOCK_ON_DISABLED; this->actionFunc = func_80A904D8; } } diff --git a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c index 669596dd81..1cc893ad5e 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -8,7 +8,7 @@ #include "terminal.h" #include "assets/objects/object_ka/object_ka.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_25) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_25) void EnKakasi3_Init(Actor* thisx, PlayState* play); void EnKakasi3_Destroy(Actor* thisx, PlayState* play); @@ -28,7 +28,7 @@ void func_80A91A90(EnKakasi3* this, PlayState* play); static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -36,7 +36,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -46,7 +46,7 @@ static ColliderCylinderInit sCylinderInit = { { 20, 70, 0, { 0, 0, 0 } }, }; -ActorInit En_Kakasi3_InitVars = { +ActorProfile En_Kakasi3_Profile = { /**/ ACTOR_EN_KAKASI3, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -71,7 +71,7 @@ void EnKakasi3_Init(Actor* thisx, PlayState* play) { PRINTF("\n\n"); // "Obonur" -- Related to the name of the scarecrow (Bonooru) PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ おーボヌール ☆☆☆☆☆ \n" VT_RST); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index d86ae429a0..c2631f471b 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -5,11 +5,12 @@ */ #include "z_en_kanban.h" +#include "global.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_kanban/object_kanban.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) #define PART_UPPER_LEFT (1 << 0) #define PART_LEFT_UPPER (1 << 1) @@ -29,7 +30,7 @@ #define UPPERRIGHT_HALF (PART_POST_UPPER | PART_UPPER_RIGHT | PART_RIGHT_UPPER | PART_UPPER_LEFT | PART_RIGHT_LOWER) #define ALL_PARTS (LEFT_HALF | RIGHT_HALF | PART_POST_UPPER | PART_POST_LOWER) -typedef enum { +typedef enum EnKanbanActionState { ENKANBAN_SIGN, ENKANBAN_AIR, ENKANBAN_UNUSED, @@ -38,7 +39,7 @@ typedef enum { ENKANBAN_REPAIR } EnKanbanActionState; -typedef enum { +typedef enum EnKanbanPiece { PIECE_WHOLE_SIGN, PIECE_UPPER_HALF, PIECE_LOWER_HALF, @@ -61,7 +62,7 @@ typedef enum { PIECE_OTHER = 100 } EnKanbanPiece; -typedef enum { +typedef enum EnKanbanCutType { CUT_POST, CUT_VERT_L, CUT_HORIZ, @@ -75,7 +76,7 @@ void EnKanban_Destroy(Actor* thisx, PlayState* play); void EnKanban_Update(Actor* thisx, PlayState* play2); void EnKanban_Draw(Actor* thisx, PlayState* play); -ActorInit En_Kanban_InitVars = { +ActorProfile En_Kanban_Profile = { /**/ ACTOR_EN_KANBAN, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -89,7 +90,7 @@ ActorInit En_Kanban_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -97,7 +98,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -213,8 +214,8 @@ void EnKanban_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); if (this->actor.params != ENKANBAN_PIECE) { - this->actor.targetMode = 0; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.attentionRangeType = ATTENTION_RANGE_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); PRINTF("KANBAN ARG %x\n", this->actor.params); @@ -286,7 +287,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { this->zTargetTimer--; } if (this->zTargetTimer == 1) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } if (this->partFlags == 0xFFFF) { EnKanban_Message(this, play); @@ -404,7 +405,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { piece->direction = -1; } piece->airTimer = 100; - piece->actor.flags &= ~ACTOR_FLAG_0; + piece->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; piece->actor.flags |= ACTOR_FLAG_25; this->cutMarkTimer = 5; Actor_PlaySfx(&this->actor, NA_SE_IT_SWORD_STRIKE); @@ -416,7 +417,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); if (this->actor.xzDistToPlayer > 500.0f) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->partFlags = 0xFFFF; } if (this->cutMarkTimer != 0) { @@ -779,7 +780,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { ((pDiff + yDiff + rDiff + this->spinRot.x + this->spinRot.z) == 0) && (this->floorRot.x == 0.0f) && (this->floorRot.z == 0.0f)) { signpost->partFlags |= this->partFlags; - signpost->actor.flags |= ACTOR_FLAG_0; + signpost->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; Actor_Kill(&this->actor); } } break; @@ -834,8 +835,7 @@ void EnKanban_Draw(Actor* thisx, PlayState* play) { Matrix_RotateX(BINANG_TO_RAD_ALT(this->spinRot.x), MTXMODE_APPLY); Matrix_RotateY(BINANG_TO_RAD_ALT(this->spinRot.z), MTXMODE_APPLY); Matrix_Translate(this->offset.x, this->offset.y, this->offset.z - 100.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_kanban.c", 1715), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_kanban.c", 1715); for (i = 0; i < ARRAY_COUNT(sPartFlags); i++) { if (sPartFlags[i] & this->partFlags) { gSPDisplayList(POLY_OPA_DISP++, sDisplayLists[i]); @@ -843,8 +843,7 @@ void EnKanban_Draw(Actor* thisx, PlayState* play) { } } else { Matrix_Translate(0.0f, 0.0f, -100.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_kanban.c", 1725), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_kanban.c", 1725); if (this->partFlags == 0xFFFF) { gSPDisplayList(POLY_OPA_DISP++, gSignRectangularDL); } else { @@ -863,8 +862,7 @@ void EnKanban_Draw(Actor* thisx, PlayState* play) { gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0x00, 0x00, 255, 255, 255, this->cutMarkAlpha); gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 150, 0); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_kanban.c", 1773), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_kanban.c", 1773); gSPDisplayList(POLY_XLU_DISP++, object_kanban_DL_001630); } } @@ -902,8 +900,7 @@ void EnKanban_Draw(Actor* thisx, PlayState* play) { Matrix_RotateX(BINANG_TO_RAD_ALT(this->spinRot.x), MTXMODE_APPLY); Matrix_RotateY(BINANG_TO_RAD_ALT(this->spinRot.z), MTXMODE_APPLY); Matrix_Translate(this->offset.x, this->offset.y, this->offset.z, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_kanban.c", 1833), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_kanban.c", 1833); for (i = 0; i < 0x400; i++) { if (sShadowTexFlags[i] & this->partFlags) { diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h index 15e8781750..36efa211df 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h @@ -2,7 +2,7 @@ #define Z_EN_KANBAN_H #include "ultra64.h" -#include "global.h" +#include "z64actor.h" struct EnKanban; diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index 53fb55984d..f17108e82e 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -9,7 +9,7 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) void EnKarebaba_Init(Actor* thisx, PlayState* play); void EnKarebaba_Destroy(Actor* thisx, PlayState* play); @@ -29,7 +29,7 @@ void EnKarebaba_Dead(EnKarebaba* this, PlayState* play); void EnKarebaba_Regrow(EnKarebaba* this, PlayState* play); void EnKarebaba_Upright(EnKarebaba* this, PlayState* play); -ActorInit En_Karebaba_InitVars = { +ActorProfile En_Karebaba_Profile = { /**/ ACTOR_EN_KAREBABA, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -43,7 +43,7 @@ ActorInit En_Karebaba_InitVars = { static ColliderCylinderInit sBodyColliderInit = { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -51,7 +51,7 @@ static ColliderCylinderInit sBodyColliderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -63,7 +63,7 @@ static ColliderCylinderInit sBodyColliderInit = { static ColliderCylinderInit sHeadColliderInit = { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -71,7 +71,7 @@ static ColliderCylinderInit sHeadColliderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_HARD, @@ -84,8 +84,8 @@ static ColliderCylinderInit sHeadColliderInit = { static CollisionCheckInfoInit sColCheckInfoInit = { 1, 15, 80, MASS_HEAVY }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 2500, ICHAIN_CONTINUE), - ICHAIN_U8(targetMode, 1, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 2500, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_1, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, NAVI_ENEMY_WITHERED_DEKU_BABA, ICHAIN_STOP), }; @@ -123,7 +123,7 @@ void EnKarebaba_Destroy(Actor* thisx, PlayState* play) { void EnKarebaba_ResetCollider(EnKarebaba* this) { this->bodyCollider.dim.radius = 7; this->bodyCollider.dim.height = 25; - this->bodyCollider.base.colType = COLTYPE_HARD; + this->bodyCollider.base.colMaterial = COL_MATERIAL_HARD; this->bodyCollider.base.acFlags |= AC_HARD; this->bodyCollider.elem.acDmgInfo.dmgFlags = DMG_DEFAULT; this->headCollider.dim.height = 25; @@ -153,7 +153,7 @@ void EnKarebaba_SetupAwaken(EnKarebaba* this) { void EnKarebaba_SetupUpright(EnKarebaba* this) { if (this->actionFunc != EnKarebaba_Spin) { Actor_SetScale(&this->actor, 0.01f); - this->bodyCollider.base.colType = COLTYPE_HIT6; + this->bodyCollider.base.colMaterial = COL_MATERIAL_HIT6; this->bodyCollider.base.acFlags &= ~AC_HARD; this->bodyCollider.elem.acDmgInfo.dmgFlags = !LINK_IS_ADULT ? ((DMG_SWORD | DMG_BOOMERANG) & ~DMG_JUMP_MASTER) : (DMG_SWORD | DMG_BOOMERANG); @@ -328,7 +328,7 @@ void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) { ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) || (this->actor.bgCheckFlags & BGCHECKFLAG_WALL))) { this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = 0.0f; this->actor.speed = 0.0f; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); } @@ -400,7 +400,7 @@ void EnKarebaba_Regrow(EnKarebaba* this, PlayState* play) { if (this->actor.params == 20) { this->actor.flags &= ~ACTOR_FLAG_4; - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_2; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE; Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); EnKarebaba_SetupIdle(this); } @@ -450,8 +450,7 @@ void EnKarebaba_DrawBaseShadow(EnKarebaba* this, PlayState* play) { func_80038A28(this->boundFloor, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, &mf); Matrix_Mult(&mf, MTXMODE_NEW); Matrix_Scale(0.15f, 1.0f, 0.15f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_karebaba.c", 1029), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_karebaba.c", 1029); gSPDisplayList(POLY_XLU_DISP++, gCircleShadowDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_karebaba.c", 1034); @@ -471,10 +470,9 @@ void EnKarebaba_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); if (this->actionFunc == EnKarebaba_DeadItemDrop) { - if (this->actor.params > 40 || (this->actor.params & 1)) { + if (this->actor.params > 40 || PARAMS_GET_U(this->actor.params, 0, 1)) { Matrix_Translate(0.0f, 0.0f, 200.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_karebaba.c", 1066), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_karebaba.c", 1066); gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStickDropDL); } } else if (this->actionFunc != EnKarebaba_Dead) { @@ -499,8 +497,7 @@ void EnKarebaba_Draw(Actor* thisx, PlayState* play) { for (i = 0; i < stemSections; i++) { Matrix_Translate(0.0f, 0.0f, -2000.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_karebaba.c", 1116), - G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_karebaba.c", 1116); gSPDisplayList(POLY_OPA_DISP++, stemDLists[i]); if (i == 0 && this->actionFunc == EnKarebaba_Dying) { @@ -520,14 +517,12 @@ void EnKarebaba_Draw(Actor* thisx, PlayState* play) { Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); Matrix_RotateY(BINANG_TO_RAD(this->actor.home.rot.y), MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_karebaba.c", 1144), - G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_karebaba.c", 1144); gSPDisplayList(POLY_OPA_DISP++, gDekuBabaBaseLeavesDL); if (this->actionFunc == EnKarebaba_Dying) { Matrix_RotateZYX(-0x4000, (s16)(this->actor.shape.rot.y - this->actor.home.rot.y), 0, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_karebaba.c", 1155), - G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_karebaba.c", 1155); gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStemBaseDL); } diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 6436d55c0c..cbe494dee1 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -10,11 +10,12 @@ #include "assets/objects/object_km1/object_km1.h" #include "assets/objects/object_kw1/object_kw1.h" #include "terminal.h" +#include "versions.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) -#define ENKO_TYPE (this->actor.params & 0xFF) -#define ENKO_PATH ((this->actor.params & 0xFF00) >> 8) +#define ENKO_TYPE PARAMS_GET_S(this->actor.params, 0, 8) +#define ENKO_PATH PARAMS_GET_S(this->actor.params, 8, 8) void EnKo_Init(Actor* thisx, PlayState* play); void EnKo_Destroy(Actor* thisx, PlayState* play); @@ -30,7 +31,7 @@ void func_80A99560(EnKo* this, PlayState* play); s32 func_80A98ECC(EnKo* this, PlayState* play); -ActorInit En_Ko_InitVars = { +ActorProfile En_Ko_Profile = { /**/ ACTOR_EN_KO, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -44,7 +45,7 @@ ActorInit En_Ko_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -52,7 +53,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -67,7 +68,7 @@ static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static void* sFaEyes[] = { gFaEyeOpenTex, gFaEyeHalfTex, gFaEyeClosedTex, NULL }; static void* sKw1Eyes[] = { gKw1EyeOpenTex, gKw1EyeHalfTex, gKw1EyeClosedTex, NULL }; -typedef struct { +typedef struct EnKoHead { /* 0x0 */ s16 objectId; /* 0x4 */ Gfx* dList; /* 0x8 */ void** eyeTextures; @@ -79,7 +80,7 @@ static EnKoHead sHead[] = { { OBJECT_FA, gFaDL, sFaEyes }, }; -typedef struct { +typedef struct EnKoSkeleton { /* 0x0 */ s16 objectId; /* 0x4 */ FlexSkeletonHeader* flexSkeletonHeader; } EnKoSkeleton; // size = 0x8 @@ -89,7 +90,7 @@ static EnKoSkeleton sSkeleton[2] = { { OBJECT_KW1, &gKw1Skel }, }; -typedef enum { +typedef enum EnKoAnimation { /* 0 */ ENKO_ANIM_BLOCKING_NOMORPH, /* 1 */ ENKO_ANIM_BLOCKING_NOMORPH_STATIC, /* 2 */ ENKO_ANIM_STANDUP_1, @@ -202,7 +203,7 @@ static u8 sOsAnimeLookup[13][5] = { ENKO_ANIM_IDLE_NOMORPH }, }; -typedef struct { +typedef struct EnKoModelInfo { /* 0x0 */ u8 headId; /* 0x1 */ u8 bodyId; /* 0x4 */ Color_RGBA8 tunicColor; @@ -210,7 +211,7 @@ typedef struct { /* 0xC */ Color_RGBA8 bootsColor; } EnKoModelInfo; // size = 0x10 -typedef enum { +typedef enum KokiriGender { /* 0 */ KO_BOY, /* 1 */ KO_GIRL, /* 2 */ KO_FADO @@ -232,8 +233,8 @@ static EnKoModelInfo sModelInfo[] = { /* ENKO_TYPE_CHILD_FADO */ { KO_FADO, KO_GIRL, { 70, 190, 60, 255 }, KO_GIRL, { 100, 30, 0, 255 } }, }; -typedef struct { - /* 0x0 */ s8 targetMode; +typedef struct EnKoInteractInfo { + /* 0x0 */ s8 attentionRangeType; /* 0x4 */ f32 lookDist; // extended by collider radius /* 0x8 */ f32 appearDist; } EnKoInteractInfo; // size = 0xC @@ -585,7 +586,11 @@ s16 EnKo_UpdateTalkState(PlayState* play, Actor* thisx) { Message_ContinueTextbox(play, this->actor.textId); break; case 0x10B7: +#if OOT_VERSION < NTSC_1_1 + SET_INFTABLE(INFTABLE_B6); +#else SET_INFTABLE(INFTABLE_BC); +#endif FALLTHROUGH; case 0x10B8: this->actor.textId = (play->msgCtx.choiceIndex == 0) ? 0x10BA : 0x10B9; @@ -976,7 +981,11 @@ void func_80A9877C(EnKo* this, PlayState* play) { this->actor.textId = INV_CONTENT(ITEM_TRADE_ADULT) > ITEM_ODD_POTION ? 0x10B9 : 0x10DF; if (func_8002F368(play) == EXCH_ITEM_ODD_POTION) { +#if OOT_VERSION < NTSC_1_1 + this->actor.textId = GET_INFTABLE(INFTABLE_B6) ? 0x10B8 : 0x10B7; +#else this->actor.textId = GET_INFTABLE(INFTABLE_BC) ? 0x10B8 : 0x10B7; +#endif this->unk_210 = 0; } player->actor.textId = this->actor.textId; @@ -1073,7 +1082,7 @@ void func_80A98CD8(EnKo* this) { s32 type = ENKO_TYPE; EnKoInteractInfo* info = &sInteractInfo[type]; - this->actor.targetMode = info->targetMode; + this->actor.attentionRangeType = info->attentionRangeType; this->lookDist = info->lookDist; this->lookDist += this->collider.dim.radius; this->appearDist = info->appearDist; @@ -1106,9 +1115,9 @@ void func_80A98DB4(EnKo* this, PlayState* play) { Math_SmoothStepToF(&this->modelAlpha, (this->appearDist < dist) ? 0.0f : 255.0f, 0.3f, 40.0f, 1.0f); if (this->modelAlpha < 10.0f) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } } @@ -1251,7 +1260,7 @@ void func_80A995CC(EnKo* this, PlayState* play) { this->actor.world.pos.z += 80.0f * Math_CosS(homeYawToPlayer); this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE || !this->actor.isTargeted) { + if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE || !this->actor.isLockedOn) { temp_f2 = fabsf((f32)this->actor.yawTowardsPlayer - homeYawToPlayer) * 0.001f * 3.0f; if (temp_f2 < 1.0f) { this->skelAnime.playSpeed = 1.0f; diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.h b/src/overlays/actors/ovl_En_Ko/z_en_ko.h index a33ac3e38c..08aff76f1d 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.h +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.h @@ -32,7 +32,7 @@ typedef struct EnKo { /* 0x0304 */ s16 unk_304[16]; } EnKo; // size = 0x0324 -typedef enum { +typedef enum KokiriChildren { ENKO_TYPE_CHILD_0, ENKO_TYPE_CHILD_1, ENKO_TYPE_CHILD_2, @@ -49,7 +49,7 @@ typedef enum { ENKO_TYPE_CHILD_MAX } KokiriChildren; -typedef enum { +typedef enum KokiriForestQuestState { ENKO_FQS_CHILD_START, ENKO_FQS_CHILD_STONE, ENKO_FQS_CHILD_SARIA, diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index c5924df2b2..f2882cad3d 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -12,7 +12,7 @@ #include "assets/objects/object_kusa/object_kusa.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_23) +#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_THROW_ONLY) void EnKusa_Init(Actor* thisx, PlayState* play); void EnKusa_Destroy(Actor* thisx, PlayState* play2); @@ -41,7 +41,7 @@ static s16 rotSpeedX = 0; static s16 rotSpeedYtarget = 0; static s16 rotSpeedY = 0; -ActorInit En_Kusa_InitVars = { +ActorProfile En_Kusa_Profile = { /**/ ACTOR_EN_KUSA, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -57,7 +57,7 @@ static s16 sObjectIds[] = { OBJECT_GAMEPLAY_FIELD_KEEP, OBJECT_KUSA, OBJECT_KUSA static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_2, @@ -65,7 +65,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x4FC00758, 0x00, 0x00 }, ATELEM_NONE, @@ -126,10 +126,10 @@ s32 EnKusa_SnapToFloor(EnKusa* this, PlayState* play, f32 yOffset) { void EnKusa_DropCollectible(EnKusa* this, PlayState* play) { s16 dropParams; - switch (this->actor.params & 3) { + switch (PARAMS_GET_U(this->actor.params, 0, 2)) { case ENKUSA_TYPE_0: case ENKUSA_TYPE_2: - dropParams = (this->actor.params >> 8) & 0xF; + dropParams = PARAMS_GET_U(this->actor.params, 8, 4); if (dropParams >= 0xD) { dropParams = 0; @@ -253,7 +253,7 @@ void EnKusa_Init(Actor* thisx, PlayState* play) { return; } - this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[thisx->params & 3]); + this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[PARAMS_GET_U(thisx->params, 0, 2)]); if (this->requiredObjectSlot < 0) { // "Bank danger!" @@ -307,11 +307,11 @@ void EnKusa_Main(EnKusa* this, PlayState* play) { EnKusa_DropCollectible(this, play); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); - if ((this->actor.params >> 4) & 1) { + if (PARAMS_GET_U(this->actor.params, 4, 1)) { EnKusa_SpawnBugs(this, play); } - if ((this->actor.params & 3) == ENKUSA_TYPE_0) { + if (PARAMS_GET_U(this->actor.params, 0, 2) == ENKUSA_TYPE_0) { Actor_Kill(&this->actor); return; } @@ -379,7 +379,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { } EnKusa_SpawnFragments(this, play); EnKusa_DropCollectible(this, play); - switch (this->actor.params & 3) { + switch (PARAMS_GET_U(this->actor.params, 0, 2)) { case ENKUSA_TYPE_0: case ENKUSA_TYPE_2: Actor_Kill(&this->actor); @@ -424,7 +424,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { } void EnKusa_SetupCut(EnKusa* this) { - switch (this->actor.params & 3) { + switch (PARAMS_GET_U(this->actor.params, 0, 2)) { case ENKUSA_TYPE_2: EnKusa_SetupAction(this, EnKusa_DoNothing); break; @@ -504,6 +504,6 @@ void EnKusa_Draw(Actor* thisx, PlayState* play) { if (this->actor.flags & ACTOR_FLAG_ENKUSA_CUT) { Gfx_DrawDListOpa(play, object_kusa_DL_0002E0); } else { - Gfx_DrawDListOpa(play, dLists[thisx->params & 3]); + Gfx_DrawDListOpa(play, dLists[PARAMS_GET_U(thisx->params, 0, 2)]); } } diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h index 8c8423223c..4a895fe15a 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h @@ -8,7 +8,7 @@ struct EnKusa; typedef void (*EnKusaActionFunc)(struct EnKusa*, PlayState*); -typedef enum { +typedef enum EnKusaType { /* 0 */ ENKUSA_TYPE_0, /* 1 */ ENKUSA_TYPE_1, /* 2 */ ENKUSA_TYPE_2 diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index ce431636a1..9160bc41b1 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -5,9 +5,10 @@ */ #include "z_en_kz.h" +#include "versions.h" #include "assets/objects/object_kz/object_kz.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnKz_Init(Actor* thisx, PlayState* play); void EnKz_Destroy(Actor* thisx, PlayState* play); @@ -22,7 +23,7 @@ void EnKz_Wait(EnKz* this, PlayState* play); void EnKz_SetupGetItem(EnKz* this, PlayState* play); void EnKz_StartTimer(EnKz* this, PlayState* play); -ActorInit En_Kz_InitVars = { +ActorProfile En_Kz_Profile = { /**/ ACTOR_EN_KZ, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -36,7 +37,7 @@ ActorInit En_Kz_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -44,7 +45,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -56,7 +57,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -typedef enum { +typedef enum EnKzAnimation { /* 0 */ ENKZ_ANIM_0, /* 1 */ ENKZ_ANIM_1, /* 2 */ ENKZ_ANIM_2 @@ -120,6 +121,27 @@ s16 EnKz_UpdateTalkState(PlayState* play, Actor* thisx) { s16 talkState = NPC_TALK_STATE_TALKING; switch (Message_GetState(&play->msgCtx)) { + case TEXT_STATE_NONE: + case TEXT_STATE_DONE_HAS_NEXT: + break; +#if OOT_VERSION < PAL_1_0 + case TEXT_STATE_CLOSING: + talkState = NPC_TALK_STATE_IDLE; + switch (this->actor.textId) { + case 0x4012: + SET_INFTABLE(INFTABLE_139); + FALLTHROUGH; + case 0x401B: + talkState = NPC_TALK_STATE_ACTION; + break; + case 0x401F: + SET_INFTABLE(INFTABLE_139); + break; + } + break; +#else + case TEXT_STATE_CLOSING: + break; case TEXT_STATE_DONE: talkState = NPC_TALK_STATE_IDLE; switch (this->actor.textId) { @@ -135,6 +157,7 @@ s16 EnKz_UpdateTalkState(PlayState* play, Actor* thisx) { break; } break; +#endif case TEXT_STATE_DONE_FADING: if (this->actor.textId != 0x4014) { if (this->actor.textId == 0x401B && !this->sfxPlayed) { @@ -154,7 +177,9 @@ s16 EnKz_UpdateTalkState(PlayState* play, Actor* thisx) { } if (this->actor.textId == 0x4014) { if (play->msgCtx.choiceIndex == 0) { +#if OOT_VERSION >= PAL_1_0 EnKz_SetupGetItem(this, play); +#endif talkState = NPC_TALK_STATE_ACTION; } else { this->actor.textId = 0x4016; @@ -167,9 +192,13 @@ s16 EnKz_UpdateTalkState(PlayState* play, Actor* thisx) { talkState = NPC_TALK_STATE_ACTION; } break; - case TEXT_STATE_NONE: - case TEXT_STATE_DONE_HAS_NEXT: - case TEXT_STATE_CLOSING: +#if OOT_VERSION < PAL_1_0 + case TEXT_STATE_DONE: + if (Message_ShouldAdvance(play)) { + talkState = NPC_TALK_STATE_ITEM_GIVEN; + } + break; +#endif case TEXT_STATE_SONG_DEMO_DONE: case TEXT_STATE_8: case TEXT_STATE_9: @@ -206,6 +235,7 @@ s32 EnKz_UpdateTalking(PlayState* play, Actor* thisx, s16* talkState, f32 intera return true; } +#if OOT_VERSION >= PAL_1_0 if (*talkState != NPC_TALK_STATE_IDLE) { *talkState = updateTalkState(play, thisx); return false; @@ -214,17 +244,25 @@ s32 EnKz_UpdateTalking(PlayState* play, Actor* thisx, s16* talkState, f32 intera yaw = Math_Vec3f_Yaw(&thisx->home.pos, &player->actor.world.pos); yaw -= thisx->shape.rot.y; if ((fabsf(yaw) > 1638.0f) || (thisx->xzDistToPlayer < 265.0f)) { - thisx->flags &= ~ACTOR_FLAG_0; + thisx->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; return false; } - thisx->flags |= ACTOR_FLAG_0; + thisx->flags |= ACTOR_FLAG_ATTENTION_ENABLED; +#endif Actor_GetScreenPos(play, thisx, &x, &y); if (!((x >= -30) && (x < 361) && (y >= -10) && (y < 241))) { return false; } +#if OOT_VERSION < PAL_1_0 + if (*talkState != NPC_TALK_STATE_IDLE) { + *talkState = updateTalkState(play, thisx); + return false; + } +#endif + xzDistToPlayer = thisx->xzDistToPlayer; thisx->xzDistToPlayer = Math_Vec3f_DistXZ(&thisx->home.pos, &player->actor.world.pos); if (Actor_OfferTalk(thisx, play, interactRange) == 0) { @@ -239,6 +277,17 @@ s32 EnKz_UpdateTalking(PlayState* play, Actor* thisx, s16* talkState, f32 intera void func_80A9CB18(EnKz* this, PlayState* play) { Player* player = GET_PLAYER(play); + f32 yaw; + +#if OOT_VERSION < PAL_1_0 + yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &player->actor.world.pos); + yaw -= this->actor.shape.rot.y; + if (fabsf(yaw) > 1820.0f) { + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; + return; + } + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; +#endif if (EnKz_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, 340.0f, EnKz_GetTextId, EnKz_UpdateTalkState)) { @@ -259,11 +308,15 @@ void func_80A9CB18(EnKz* this, PlayState* play) { this->actor.textId = 0x4014; this->sfxPlayed = false; player->actor.textId = this->actor.textId; +#if OOT_VERSION >= PAL_1_0 this->isTrading = true; +#endif return; } +#if OOT_VERSION >= PAL_1_0 this->isTrading = false; +#endif if (GET_INFTABLE(INFTABLE_139)) { this->actor.textId = CHECK_QUEST_ITEM(QUEST_SONG_SERENADE) ? 0x4045 : 0x401A; player->actor.textId = this->actor.textId; @@ -281,11 +334,11 @@ s32 EnKz_FollowPath(EnKz* this, PlayState* play) { f32 pathDiffX; f32 pathDiffZ; - if ((this->actor.params & 0xFF00) == 0xFF00) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 8, 8) == 0xFF00) { return 0; } - path = &play->pathList[(this->actor.params & 0xFF00) >> 8]; + path = &play->pathList[PARAMS_GET_S(this->actor.params, 8, 8)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; @@ -307,11 +360,11 @@ s32 EnKz_SetMovedPos(EnKz* this, PlayState* play) { Path* path; Vec3s* lastPointPos; - if ((this->actor.params & 0xFF00) == 0xFF00) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 8, 8) == 0xFF00) { return 0; } - path = &play->pathList[(this->actor.params & 0xFF00) >> 8]; + path = &play->pathList[PARAMS_GET_S(this->actor.params, 8, 8)]; lastPointPos = SEGMENTED_TO_VIRTUAL(path->points); lastPointPos += path->count - 1; @@ -332,7 +385,7 @@ void EnKz_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); Actor_SetScale(&this->actor, 0.01); - this->actor.targetMode = 3; + this->actor.attentionRangeType = ATTENTION_RANGE_3; this->interactInfo.talkState = NPC_TALK_STATE_IDLE; Animation_ChangeByInfo(&this->skelanime, sAnimationInfo, ENKZ_ANIM_0); @@ -420,6 +473,9 @@ void EnKz_StopMweep(EnKz* this, PlayState* play) { void EnKz_Wait(EnKz* this, PlayState* play) { if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { +#if OOT_VERSION < PAL_1_0 + this->interactInfo.talkState = NPC_TALK_STATE_IDLE; +#endif this->actionFunc = EnKz_SetupGetItem; EnKz_SetupGetItem(this, play); } else { @@ -437,7 +493,11 @@ void EnKz_SetupGetItem(EnKz* this, PlayState* play) { this->interactInfo.talkState = NPC_TALK_STATE_TALKING; this->actionFunc = EnKz_StartTimer; } else { +#if OOT_VERSION < PAL_1_0 + getItemId = func_8002F368(play) == EXCH_ITEM_PRESCRIPTION ? GI_EYEBALL_FROG : GI_TUNIC_ZORA; +#else getItemId = this->isTrading == true ? GI_EYEBALL_FROG : GI_TUNIC_ZORA; +#endif yRange = fabsf(this->actor.yDistToPlayer) + 1.0f; xzRange = this->actor.xzDistToPlayer + 1.0f; Actor_OfferGetItem(&this->actor, play, getItemId, xzRange, yRange); @@ -445,7 +505,12 @@ void EnKz_SetupGetItem(EnKz* this, PlayState* play) { } void EnKz_StartTimer(EnKz* this, PlayState* play) { - if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { +#if OOT_VERSION < PAL_1_0 + if (this->interactInfo.talkState == NPC_TALK_STATE_ITEM_GIVEN) +#else + if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) +#endif + { if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_EYEBALL_FROG) { Interface_SetSubTimer(180); CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE); @@ -467,9 +532,13 @@ void EnKz_Update(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelanime); EnKz_UpdateEyes(this); Actor_MoveXZGravity(&this->actor); +#if OOT_VERSION < PAL_1_0 + func_80A9CB18(this, play); +#else if (this->actionFunc != EnKz_StartTimer) { func_80A9CB18(this, play); } +#endif this->actionFunc(this, play); } diff --git a/src/overlays/actors/ovl_En_Light/z_en_light.c b/src/overlays/actors/ovl_En_Light/z_en_light.c index 3eeba75217..33d671a95f 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.c +++ b/src/overlays/actors/ovl_En_Light/z_en_light.c @@ -16,7 +16,7 @@ void EnLight_Update(Actor* thisx, PlayState* play); void EnLight_Draw(Actor* thisx, PlayState* play); void EnLight_UpdateSwitch(Actor* thisx, PlayState* play); -ActorInit En_Light_InitVars = { +ActorProfile En_Light_Profile = { /**/ ACTOR_EN_LIGHT, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -28,7 +28,7 @@ ActorInit En_Light_InitVars = { /**/ EnLight_Draw, }; -typedef struct { +typedef struct FlameParams { /* 0x00 */ Color_RGBA8 primColor; /* 0x04 */ Color_RGB8 envColor; /* 0x07 */ u8 scale; @@ -60,10 +60,10 @@ void EnLight_Init(Actor* thisx, PlayState* play) { } this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); - Actor_SetScale(&this->actor, D_80A9E840[this->actor.params & 0xF].scale * 0.0001f); + Actor_SetScale(&this->actor, D_80A9E840[PARAMS_GET_S(this->actor.params, 0, 4)].scale * 0.0001f); this->timer = (s32)(Rand_ZeroOne() * 255.0f); - if ((this->actor.params & 0x400) != 0) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 10, 1)) { this->actor.update = EnLight_UpdateSwitch; } } @@ -92,7 +92,7 @@ void EnLight_Update(Actor* thisx, PlayState* play) { s16 radius; EnLight* this = (EnLight*)thisx; - flameParams = &D_80A9E840[this->actor.params & 0xF]; + flameParams = &D_80A9E840[PARAMS_GET_S(this->actor.params, 0, 4)]; intensity = (Rand_ZeroOne() * 0.5f) + 0.5f; radius = (this->actor.params < 0) ? 100 : 300; Lights_PointSetColorAndRadius(&this->lightInfo, (flameParams->primColor.r * intensity), @@ -111,11 +111,11 @@ void EnLight_UpdateSwitch(Actor* thisx, PlayState* play) { EnLight* this = (EnLight*)thisx; f32 scale; - flameParams = &D_80A9E840[this->actor.params & 0xF]; + flameParams = &D_80A9E840[PARAMS_GET_S(this->actor.params, 0, 4)]; scale = this->actor.scale.x / ((f32)flameParams->scale * 0.0001); - if ((this->actor.params & 0x800) != 0) { - if (Flags_GetSwitch(play, (this->actor.params & 0x3F0) >> 4)) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 11, 1)) { + if (Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 4, 6))) { Math_StepToF(&scale, 1.0f, 0.05f); } else { if (scale < 0.1f) { @@ -125,7 +125,7 @@ void EnLight_UpdateSwitch(Actor* thisx, PlayState* play) { Math_StepToF(&scale, 0.0f, 0.05f); } } else { - if (Flags_GetSwitch(play, (this->actor.params & 0x3F0) >> 4)) { + if (Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 4, 6))) { if (scale < 0.1f) { Actor_SetScale(&this->actor, 0.0f); return; @@ -156,7 +156,7 @@ void EnLight_Draw(Actor* thisx, PlayState* play) { if (1) {} - flameParams = &D_80A9E840[this->actor.params & 0xF]; + flameParams = &D_80A9E840[PARAMS_GET_S(this->actor.params, 0, 4)]; OPEN_DISPS(play->state.gfxCtx, "../z_en_light.c", 441); @@ -184,13 +184,12 @@ void EnLight_Draw(Actor* thisx, PlayState* play) { Matrix_RotateY(BINANG_TO_RAD((s16)((Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) - this->actor.shape.rot.y) + 0x8000)), MTXMODE_APPLY); - if (this->actor.params & 1) { + if (PARAMS_GET_S(this->actor.params, 0, 1)) { Matrix_RotateY(M_PI, MTXMODE_APPLY); } Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_light.c", 488), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_light.c", 488); gSPDisplayList(POLY_XLU_DISP++, dList); CLOSE_DISPS(play->state.gfxCtx, "../z_en_light.c", 491); diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c index f89e7dc765..ab27f30954 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c @@ -14,7 +14,7 @@ void EnLightbox_Destroy(Actor* thisx, PlayState* play); void EnLightbox_Update(Actor* thisx, PlayState* play); void EnLightbox_Draw(Actor* thisx, PlayState* play); -ActorInit En_Lightbox_InitVars = { +ActorProfile En_Lightbox_Profile = { /**/ ACTOR_EN_LIGHTBOX, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -53,7 +53,7 @@ void EnLightbox_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 6.0f); this->dyna.interactFlags = 0; this->dyna.transformFlags = 0; - thisx->targetMode = 0; + thisx->attentionRangeType = ATTENTION_RANGE_0; thisx->gravity = -2.0f; CollisionHeader_GetVirtual(&object_lightbox_Col_001F10, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); diff --git a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c index 5de6557784..9acedc1552 100644 --- a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c +++ b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c @@ -12,7 +12,7 @@ void EnMFire1_Init(Actor* thisx, PlayState* play); void EnMFire1_Destroy(Actor* thisx, PlayState* play); void EnMFire1_Update(Actor* thisx, PlayState* play); -ActorInit En_M_Fire1_InitVars = { +ActorProfile En_M_Fire1_Profile = { /**/ ACTOR_EN_M_FIRE1, /**/ ACTORCAT_MISC, /**/ FLAGS, @@ -26,7 +26,7 @@ ActorInit En_M_Fire1_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_PLAYER, AC_NONE, OC1_NONE, @@ -34,7 +34,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000001, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 2bc4831539..eb7745aa86 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -12,7 +12,7 @@ void func_80A9F314(PlayState* play, f32 arg1); void func_80A9F408(EnMThunder* this, PlayState* play); void func_80A9F9B4(EnMThunder* this, PlayState* play); -ActorInit En_M_Thunder_InitVars = { +ActorProfile En_M_Thunder_Profile = { /**/ ACTOR_EN_M_THUNDER, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -26,7 +26,7 @@ ActorInit En_M_Thunder_InitVars = { static ColliderCylinderInit D_80AA0420 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_PLAYER, AC_NONE, OC1_NONE, @@ -34,7 +34,7 @@ static ColliderCylinderInit D_80AA0420 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000001, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -59,7 +59,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &D_80AA0420); - this->unk_1C7 = (this->actor.params & 0xFF) - 1; + this->unk_1C7 = PARAMS_GET_S(this->actor.params, 0, 8) - 1; Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 255, 255, 255, 0); this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); @@ -78,8 +78,8 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) { if (player->stateFlags2 & PLAYER_STATE2_17) { if (!gSaveContext.save.info.playerData.isMagicAcquired || (gSaveContext.magicState != MAGIC_STATE_IDLE) || - (((this->actor.params & 0xFF00) >> 8) && - !(Magic_RequestChange(play, (this->actor.params & 0xFF00) >> 8, MAGIC_CONSUME_NOW)))) { + (PARAMS_GET_S(this->actor.params, 8, 8) && + !(Magic_RequestChange(play, PARAMS_GET_S(this->actor.params, 8, 8), MAGIC_CONSUME_NOW)))) { Audio_PlaySfxGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Audio_PlaySfxGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, @@ -135,7 +135,7 @@ void func_80A9F350(EnMThunder* this, PlayState* play) { return; } - if (!(player->stateFlags1 & PLAYER_STATE1_12)) { + if (!(player->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK)) { Actor_Kill(&this->actor); } } @@ -151,8 +151,8 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { if (this->unk_1CA == 0) { if (player->unk_858 >= 0.1f) { if ((gSaveContext.magicState != MAGIC_STATE_IDLE) || - (((this->actor.params & 0xFF00) >> 8) && - !(Magic_RequestChange(play, (this->actor.params & 0xFF00) >> 8, MAGIC_CONSUME_WAIT_PREVIEW)))) { + (PARAMS_GET_S(this->actor.params, 8, 8) && + !(Magic_RequestChange(play, PARAMS_GET_S(this->actor.params, 8, 8), MAGIC_CONSUME_WAIT_PREVIEW)))) { func_80A9F350(this, play); func_80A9EFE0(this, func_80A9F350); this->unk_1C8 = 0; @@ -185,7 +185,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { return; } else { player->stateFlags2 &= ~PLAYER_STATE2_17; - if ((this->actor.params & 0xFF00) >> 8) { + if (PARAMS_GET_S(this->actor.params, 8, 8)) { gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP; } if (player->unk_858 < 0.85f) { @@ -218,7 +218,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { } } - if (!(player->stateFlags1 & PLAYER_STATE1_12)) { + if (!(player->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK)) { if (this->actor.child != NULL) { this->actor.child->parent = NULL; } @@ -330,8 +330,7 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) { OPEN_DISPS(play->state.gfxCtx, "../z_en_m_thunder.c", 844); Gfx_SetupDL_25Xlu(play->state.gfxCtx); Matrix_Scale(0.02f, 0.02f, 0.02f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_m_thunder.c", 853), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_m_thunder.c", 853); switch (this->unk_1C6) { case 0: @@ -388,8 +387,7 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) { phi_t1 = 0x14; } Matrix_Scale(1.0f, phi_f14, phi_f14, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_m_thunder.c", 960), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_m_thunder.c", 960); gSPSegment(POLY_XLU_DISP++, 0x09, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (play->gameplayFrames * 5) & 0xFF, 0, 0x20, 0x20, diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index 26795a516b..403613d826 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -7,7 +7,7 @@ #include "z_en_ma1.h" #include "assets/objects/object_ma1/object_ma1.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25) void EnMa1_Init(Actor* thisx, PlayState* play); void EnMa1_Destroy(Actor* thisx, PlayState* play); @@ -23,7 +23,7 @@ void EnMa1_TeachSong(EnMa1* this, PlayState* play); void EnMa1_WaitForPlayback(EnMa1* this, PlayState* play); void EnMa1_DoNothing(EnMa1* this, PlayState* play); -ActorInit En_Ma1_InitVars = { +ActorProfile En_Ma1_Profile = { /**/ ACTOR_EN_MA1, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -37,7 +37,7 @@ ActorInit En_Ma1_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -45,7 +45,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -57,7 +57,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -typedef enum { +typedef enum EnMa1Animation { /* 0 */ MALON_ANIM_IDLE_NOMORPH, /* 1 */ MALON_ANIM_IDLE, /* 2 */ MALON_ANIM_SING_NOMORPH, @@ -269,7 +269,7 @@ void EnMa1_Init(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); Actor_SetScale(&this->actor, 0.01f); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->interactInfo.talkState = NPC_TALK_STATE_IDLE; if (!GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) || CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) { @@ -348,7 +348,7 @@ void EnMa1_IdleTeachSong(EnMa1* this, PlayState* play) { this->actor.textId = 0x2061; Message_StartTextbox(play, this->actor.textId, NULL); this->interactInfo.talkState = NPC_TALK_STATE_TALKING; - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->actionFunc = EnMa1_StartTeachSong; } else if (this->actor.xzDistToPlayer < 30.0f + this->collider.dim.radius) { player->stateFlags2 |= PLAYER_STATE2_23; @@ -361,7 +361,7 @@ void EnMa1_StartTeachSong(EnMa1* this, PlayState* play) { if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_MALON); Message_StartOcarina(play, OCARINA_ACTION_TEACH_EPONA); - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->actionFunc = EnMa1_TeachSong; } } diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index d840a4b538..10ed772e4c 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -1,7 +1,7 @@ #include "z_en_ma2.h" #include "assets/objects/object_ma2/object_ma2.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25) void EnMa2_Init(Actor* thisx, PlayState* play); void EnMa2_Destroy(Actor* thisx, PlayState* play); @@ -17,7 +17,7 @@ void func_80AA204C(EnMa2* this, PlayState* play); void func_80AA20E4(EnMa2* this, PlayState* play); void func_80AA21C8(EnMa2* this, PlayState* play); -ActorInit En_Ma2_InitVars = { +ActorProfile En_Ma2_Profile = { /**/ ACTOR_EN_MA2, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -31,7 +31,7 @@ ActorInit En_Ma2_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -39,7 +39,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -51,7 +51,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -typedef enum { +typedef enum EnMa2Animation { /* 0 */ ENMA2_ANIM_0, /* 1 */ ENMA2_ANIM_1, /* 2 */ ENMA2_ANIM_2, @@ -242,7 +242,7 @@ void EnMa2_Init(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); Actor_SetScale(&this->actor, 0.01f); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->interactInfo.talkState = NPC_TALK_STATE_IDLE; } @@ -255,7 +255,7 @@ void EnMa2_Destroy(Actor* thisx, PlayState* play) { void func_80AA2018(EnMa2* this, PlayState* play) { if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->interactInfo.talkState = NPC_TALK_STATE_IDLE; } } @@ -298,10 +298,10 @@ void func_80AA21C8(EnMa2* this, PlayState* play) { player->stateFlags2 |= PLAYER_STATE2_23; } else { if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Message_CloseTextbox(play); } else { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->actionFunc = func_80AA2018; } } diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h index b207e8e7c3..390c61da21 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h @@ -8,7 +8,7 @@ struct EnMa2; typedef void (*EnMa2ActionFunc)(struct EnMa2*, PlayState*); -typedef enum { +typedef enum AdultMalonLimb { /* 0x00 */ MALON_ADULT_LIMB_NONE, /* 0x01 */ MALON_ADULT_ROOT_LIMB, /* 0x02 */ MALON_ADULT_LOWER_CONTROL_LIMB, diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c index 2bbc185636..6b7297223a 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -6,8 +6,9 @@ #include "z_en_ma3.h" #include "assets/objects/object_ma2/object_ma2.h" +#include "versions.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_5) void EnMa3_Init(Actor* thisx, PlayState* play); void EnMa3_Destroy(Actor* thisx, PlayState* play); @@ -20,7 +21,7 @@ s32 func_80AA2F28(EnMa3* this); void EnMa3_UpdateEyes(EnMa3* this); void func_80AA3200(EnMa3* this, PlayState* play); -ActorInit En_Ma3_InitVars = { +ActorProfile En_Ma3_Profile = { /**/ ACTOR_EN_MA3, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -34,7 +35,7 @@ ActorInit En_Ma3_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -42,7 +43,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -54,7 +55,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -typedef enum { +typedef enum EnMa3Animation { /* 0 */ ENMA3_ANIM_0, /* 1 */ ENMA3_ANIM_1, /* 2 */ ENMA3_ANIM_2, @@ -77,7 +78,7 @@ u16 EnMa3_GetTextId(PlayState* play, Actor* thisx) { if (GET_EVENTINF(EVENTINF_HORSES_0A)) { gSaveContext.timerSeconds = gSaveContext.timerSeconds; - thisx->flags |= ACTOR_FLAG_16; + thisx->flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; if (((void)0, gSaveContext.timerSeconds) > 210) { return 0x208E; @@ -155,7 +156,7 @@ s16 EnMa3_UpdateTalkState(PlayState* play, Actor* thisx) { FALLTHROUGH; case 0x208E: CLEAR_EVENTINF(EVENTINF_HORSES_0A); - thisx->flags &= ~ACTOR_FLAG_16; + thisx->flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; talkState = NPC_TALK_STATE_IDLE; gSaveContext.timerState = TIMER_STATE_STOP; break; @@ -282,11 +283,48 @@ void EnMa3_Destroy(Actor* thisx, PlayState* play) { void func_80AA3200(EnMa3* this, PlayState* play) { if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->interactInfo.talkState = NPC_TALK_STATE_IDLE; } } +#if OOT_PAL_N64 +// Same as Npc_UpdateTalking, but with an additional check for the subtimer state +s32 EnMa3_UpdateTalking(PlayState* play, Actor* actor, s16* talkState, f32 interactRange, NpcGetTextIdFunc getTextId, + NpcUpdateTalkStateFunc updateTalkState) { + s16 x; + s16 y; + + if (Actor_TalkOfferAccepted(actor, play)) { + *talkState = NPC_TALK_STATE_TALKING; + return true; + } + + if (*talkState != NPC_TALK_STATE_IDLE) { + *talkState = updateTalkState(play, actor); + return false; + } + + Actor_GetScreenPos(play, actor, &x, &y); + if ((x < 0) || (x > SCREEN_WIDTH) || (y < 0) || (y > SCREEN_HEIGHT)) { + // Actor is offscreen + return false; + } + + if ((gSaveContext.subTimerState != 0) && (gSaveContext.subTimerSeconds < 6)) { + return false; + } + + if (!Actor_OfferTalk(actor, play, interactRange)) { + return false; + } + + actor->textId = getTextId(play, actor); + + return false; +} +#endif + void EnMa3_Update(Actor* thisx, PlayState* play) { EnMa3* this = (EnMa3*)thisx; s32 pad; @@ -297,8 +335,16 @@ void EnMa3_Update(Actor* thisx, PlayState* play) { EnMa3_UpdateEyes(this); this->actionFunc(this, play); func_80AA2E54(this, play); + +#if !OOT_PAL_N64 Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->collider.dim.radius + 150.0f, EnMa3_GetTextId, EnMa3_UpdateTalkState); +#else + EnMa3_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->collider.dim.radius + 150.0f, + EnMa3_GetTextId, EnMa3_UpdateTalkState); +#endif + +#if OOT_VERSION >= PAL_1_0 if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { if (this->isNotSinging) { // Turn on singing @@ -310,6 +356,7 @@ void EnMa3_Update(Actor* thisx, PlayState* play) { Audio_ToggleMalonSinging(true); this->isNotSinging = true; } +#endif } s32 EnMa3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h index 3edf65f096..2b9dea812d 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h @@ -8,7 +8,7 @@ struct EnMa3; typedef void (*EnMa3ActionFunc)(struct EnMa3*, PlayState*); -typedef enum { +typedef enum AdultMalonLimb { /* 0x00 */ MALON_ADULT_LIMB_NONE, /* 0x01 */ MALON_ADULT_LIMB_ROOT, /* 0x02 */ MALON_ADULT_LIMB_LOWER_CONTROL, diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index df0c4ff331..653ea2934c 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -5,7 +5,12 @@ */ #include "z_en_mag.h" +#include "versions.h" #include "assets/objects/object_mag/object_mag.h" +#if PLATFORM_N64 +#include "n64dd.h" +#endif +#include "versions.h" #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) @@ -14,7 +19,7 @@ void EnMag_Destroy(Actor* thisx, PlayState* play); void EnMag_Update(Actor* thisx, PlayState* play); void EnMag_Draw(Actor* thisx, PlayState* play); -ActorInit En_Mag_InitVars = { +ActorProfile En_Mag_Profile = { /**/ ACTOR_EN_MAG, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -28,6 +33,34 @@ ActorInit En_Mag_InitVars = { static s16 sDelayTimer = 0; +#if OOT_VERSION < GC_US +void EnMag_ResetSram(void) { + static u8 buffer[0x2000]; + + bzero(buffer, 0x800); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000800), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8001000), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8001800), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8002000), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8002800), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8003000), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8003800), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8004000), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8004800), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8005000), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8005800), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8006000), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8006800), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8007000), buffer, 0x800, 1); + SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8007800), buffer, 0x800, 1); + + gSaveContext.audioSetting = 0; + gSaveContext.zTargetSetting = 0; + func_800F6700(gSaveContext.audioSetting); +} +#endif + void EnMag_Init(Actor* thisx, PlayState* play) { EnMag* this = (EnMag*)thisx; @@ -109,10 +142,58 @@ void EnMag_Init(Actor* thisx, PlayState* play) { void EnMag_Destroy(Actor* thisx, PlayState* play) { } +#if OOT_VERSION < GC_US +void EnMag_CheckSramResetCode(PlayState* play, EnMag* this) { + static s32 sSramResetCode[] = { + BTN_DUP, BTN_DDOWN, BTN_DLEFT, BTN_DRIGHT, BTN_START, BTN_B, BTN_CDOWN, + BTN_L, BTN_CRIGHT, BTN_CLEFT, BTN_A, BTN_CUP, BTN_R, BTN_Z, + }; + s32 var_v1; + + var_v1 = + play->state.input[2].cur.button & (BTN_A | BTN_B | BTN_Z | BTN_START | BTN_DUP | BTN_DDOWN | BTN_DLEFT | + BTN_DRIGHT | BTN_L | BTN_R | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT); + if (this->unk_E31C == var_v1) { + this->unk_E320--; + if (this->unk_E320 < 0) { + this->unk_E320 = 1; + } else { + var_v1 ^= this->unk_E31C; + } + } else { + this->unk_E320 = 16; + this->unk_E31C = var_v1; + } + + if (this->unk_E316 < 4) { + if (sSramResetCode[this->unk_E316] & var_v1) { + this->unk_E316++; + } else if (var_v1 != 0) { + this->unk_E316 = 0; + } + } else { + if (CHECK_BTN_ALL(play->state.input[2].press.button, sSramResetCode[this->unk_E316])) { + this->unk_E316++; + } else if (var_v1 != 0) { + this->unk_E316 = 0; + } + } + + if (this->unk_E316 == ARRAY_COUNT(sSramResetCode)) { + EnMag_ResetSram(); + this->unk_E316 = 0; + } +} +#endif + void EnMag_Update(Actor* thisx, PlayState* play) { s32 pad[2]; EnMag* this = (EnMag*)thisx; +#if OOT_VERSION < GC_US + EnMag_CheckSramResetCode(play, this); +#endif + if (gSaveContext.fileNum != 0xFEDC) { if (this->globalState < MAG_STATE_DISPLAY) { if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START) || @@ -178,8 +259,13 @@ void EnMag_Update(Actor* thisx, PlayState* play) { if (this->globalState == MAG_STATE_FADE_IN) { if (this->effectFadeInState == 0) { +#if PLATFORM_N64 + this->effectPrimLodFrac += 0.8f; + this->effectAlpha += 6.375f; +#else this->effectAlpha += 6.375f; this->effectPrimLodFrac += 0.8f; +#endif this->effectPrimColor[0] += 6.375f; this->effectPrimColor[1] += 3.875f; @@ -203,6 +289,9 @@ void EnMag_Update(Actor* thisx, PlayState* play) { this->effectFadeInState = 1; } } else if (this->effectFadeInState == 1) { +#if PLATFORM_N64 + this->effectPrimLodFrac += 2.4f; +#endif #if !OOT_MQ this->effectPrimColor[2] += -2.125f; this->effectEnvColor[1] += -3.875f; @@ -210,8 +299,9 @@ void EnMag_Update(Actor* thisx, PlayState* play) { this->effectPrimColor[0] += -2.125f; this->effectEnvColor[0] += -1.375f; #endif - +#if !PLATFORM_N64 this->effectPrimLodFrac += 2.4f; +#endif this->effectFadeInTimer--; @@ -341,16 +431,17 @@ void EnMag_DrawImageRGBA32(Gfx** gfxP, s16 centerX, s16 centerY, u8* source, u32 curTexture = source; rectLeft = centerX - (width / 2); rectTop = centerY - (height / 2); - textureHeight = 4096 / (width << 2); remainingSize = (width * height) << 2; + textureHeight = 4096 / (width << 2); textureSize = (width * textureHeight) << 2; textureCount = remainingSize / textureSize; if ((remainingSize % textureSize) != 0) { textureCount += 1; } - gDPSetTileCustom(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_32b, width, textureHeight, 0, G_TX_NOMIRROR | G_TX_CLAMP, - G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gDPSetTileCustom(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 0, 0, width - 1, textureHeight - 1, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); remainingSize -= textureSize; @@ -372,7 +463,7 @@ void EnMag_DrawImageRGBA32(Gfx** gfxP, s16 centerX, s16 centerY, u8* source, u32 textureHeight = remainingSize / (s32)(width << 2); remainingSize -= textureSize; - gDPSetTileCustom(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_32b, width, textureHeight, 0, + gDPSetTileCustom(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 0, 0, width - 1, textureHeight - 1, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); } @@ -384,6 +475,32 @@ void EnMag_DrawImageRGBA32(Gfx** gfxP, s16 centerX, s16 centerY, u8* source, u32 *gfxP = gfx; } +#if PLATFORM_N64 +void func_80AEEA48_unknown(Gfx** gfxP, s16 arg1, s16 arg2, u32 arg3) { + if ((D_80121212 != 0) && (func_801C70FC() != 0)) { + Gfx* gfx = *gfxP; + s32 temp_a3 = (arg1 + 0x40) << 2; + s32 temp_t0 = (arg2 + 5) << 2; + + gDPPipeSync(gfx++); + gDPSetCycleType(gfx++, G_CYC_1CYCLE); + gDPSetRenderMode(gfx++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + gDPSetCombineLERP(gfx++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, + ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetPrimColor(gfx++, 0x00, 0x00, 255, 255, 255, arg3); + gDPSetEnvColor(gfx++, 48, 36, 146, 255); + gDPLoadTextureBlock(gfx++, gTitleDiskTex, G_IM_FMT_IA, G_IM_SIZ_8b, 48, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); + gSPTextureRectangle(gfx++, temp_a3, temp_t0, temp_a3 + (48 << 2), temp_t0 + (16 << 2), G_TX_RENDERTILE, 0, 0, + (1 << 10), (1 << 10)); + gDPPipeSync(gfx++); + gDPSetCycleType(gfx++, G_CYC_2CYCLE); + + *gfxP = gfx; + } +} +#endif + void EnMag_DrawCharTexture(Gfx** gfxP, u8* texture, s32 rectLeft, s32 rectTop) { Gfx* gfx = *gfxP; @@ -402,8 +519,10 @@ void EnMag_DrawCharTexture(Gfx** gfxP, u8* texture, s32 rectLeft, s32 rectTop) { // Title logo is shifted to the left in Master Quest #if !OOT_MQ #define LOGO_X_SHIFT 0 +#define JPN_SUBTITLE_X_SHIFT 0 #else #define LOGO_X_SHIFT (-8) +#define JPN_SUBTITLE_X_SHIFT (-32) #endif void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) { @@ -464,6 +583,9 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) { if ((s16)this->mainAlpha != 0) { EnMag_DrawImageRGBA32(&gfx, WIDE_INCR(160 + LOGO_X_SHIFT, 20), 100, (u8*)gTitleZeldaShieldLogoTex, 160, 160); +#if PLATFORM_N64 + func_80AEEA48_unknown(&gfx, 160, 100, (u32)this->mainAlpha); +#endif } Gfx_SetupDL_39Ptr(&gfx); @@ -506,8 +628,17 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) { #if OOT_MQ gDPPipeSync(gfx++); gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, (s16)this->subAlpha); - +#if OOT_VERSION == GC_JP_MQ + EnMag_DrawImageRGBA32(&gfx, 235, 149, (u8*)gTitleUraLogoTex, 40, 40); +#elif OOT_VERSION == GC_US_MQ + if (gSaveContext.language == LANGUAGE_JPN) { + EnMag_DrawImageRGBA32(&gfx, 235, 149, (u8*)gTitleUraLogoTex, 40, 40); + } else { + EnMag_DrawImageRGBA32(&gfx, WIDE_INCR(174, 10), 145, (u8*)gTitleMasterQuestSubtitleTex, 128, 32); + } +#else EnMag_DrawImageRGBA32(&gfx, WIDE_INCR(174, 10), 145, (u8*)gTitleMasterQuestSubtitleTex, 128, 32); +#endif #endif } @@ -523,8 +654,15 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) { } gDPSetCombineLERP(gfx++, TEXEL1, PRIMITIVE, PRIM_LOD_FRAC, TEXEL0, 0, 0, 0, TEXEL0, PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, COMBINED, 0, PRIMITIVE, 0); + +#if !OOT_MQ gDPSetPrimColor(gfx++, 0, 0x80, 255, 255, 170, (s16)this->subAlpha); gDPSetEnvColor(gfx++, 255, 150, 0, 255); +#else + gDPSetPrimColor(gfx++, 0, 0x80, 170, 255, 255, (s16)this->subAlpha); + gDPSetEnvColor(gfx++, ZREG(34), 100 + ZREG(35), 255 + ZREG(36), 255); +#endif + if ((s16)this->subAlpha != 0) { gDPLoadTextureBlock(gfx++, gTitleTitleJPNTex, G_IM_FMT_I, G_IM_SIZ_8b, 128, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, @@ -533,7 +671,8 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) { G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, 2, 1); gDPSetTileSize(gfx++, 1, this->unk_E30C & 0x7F, this->effectScroll & 0x7F, (this->unk_E30C & 0x7F) + ((32 - 1) << 2), (this->effectScroll & 0x7F) + ((32 - 1) << 2)); - gSPTextureRectangle(gfx++, 424, 576, 424 + 512, 576 + 64, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPTextureRectangle(gfx++, 424 + JPN_SUBTITLE_X_SHIFT, 576, 424 + JPN_SUBTITLE_X_SHIFT + 512, 576 + 64, + G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); } } #endif @@ -547,7 +686,15 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) { (s16)this->copyrightAlpha); if ((s16)this->copyrightAlpha != 0) { -#if OOT_NTSC +#if PLATFORM_N64 + gDPLoadTextureBlock(gfx++, gTitleCopyright1998Tex, G_IM_FMT_IA, G_IM_SIZ_8b, 128, 16, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); +#elif OOT_VERSION < GC_US + gDPLoadTextureBlock(gfx++, gTitleCopyright19982002Tex, G_IM_FMT_IA, G_IM_SIZ_8b, 160, 16, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); +#elif OOT_NTSC if (gSaveContext.language == LANGUAGE_JPN) { gDPLoadTextureBlock(gfx++, gTitleCopyright19982002Tex, G_IM_FMT_IA, G_IM_SIZ_8b, 160, 16, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, @@ -563,8 +710,12 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) { G_TX_NOLOD, G_TX_NOLOD); #endif +#if PLATFORM_N64 + gSPTextureRectangle(gfx++, 94 << 2, 198 << 2, 222 << 2, 214 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); +#else gSPTextureRectangle(gfx++, WIDE_INCR((78 << 2), (u16)(WIDE_GET_RATIO * 100.0f)), 198 << 2, 238 << 2, 214 << 2, G_TX_RENDERTILE, 0, 0, WIDE_DIV((1 << 10), WIDE_GET_RATIO), 1 << 10); +#endif } if (gSaveContext.fileNum == 0xFEDC) { diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.h b/src/overlays/actors/ovl_En_Mag/z_en_mag.h index a9f1b9d144..e7c516c629 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.h +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.h @@ -32,7 +32,7 @@ typedef struct EnMag { /* 0xE324 */ char unk_E324[0x0004]; } EnMag; // size = 0xE328 -typedef enum { +typedef enum EnMagGlobalState { /* 0x00 */ MAG_STATE_INITIAL, /* 0x01 */ MAG_STATE_FADE_IN, /* 0x02 */ MAG_STATE_DISPLAY, diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 92f3aac854..ac745b9dbf 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -6,6 +6,7 @@ #include "z_en_mb.h" #include "assets/objects/object_mb/object_mb.h" +#include "versions.h" /* * This actor can have three behaviors: @@ -14,9 +15,9 @@ * - "Spear Patrol" (variable 0xPP00 PP=pathId): uses a spear, patrols following a path, charges */ -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) -typedef enum { +typedef enum EnMbType { /* -1 */ ENMB_TYPE_SPEAR_GUARD = -1, /* 0 */ ENMB_TYPE_CLUB, /* 1 */ ENMB_TYPE_SPEAR_PATROL @@ -29,7 +30,7 @@ typedef enum { #define ENMB_ATTACK_CLUB_LEFT 3 /* Spear and Club moblins use a different skeleton but the limbs are organized the same */ -typedef enum { +typedef enum EnMbLimb { /* 1 */ ENMB_LIMB_ROOT = 1, /* 3 */ ENMB_LIMB_WAIST = 3, /* 6 */ ENMB_LIMB_CHEST = 6, @@ -53,7 +54,7 @@ void EnMb_Destroy(Actor* thisx, PlayState* play); void EnMb_Update(Actor* thisx, PlayState* play); void EnMb_Draw(Actor* thisx, PlayState* play); -ActorInit En_Mb_InitVars = { +ActorProfile En_Mb_Profile = { /**/ ACTOR_EN_MB, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -91,7 +92,7 @@ void EnMb_ClubDamaged(EnMb* this, PlayState* play); static ColliderCylinderInit sBodyColliderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -99,7 +100,7 @@ static ColliderCylinderInit sBodyColliderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -112,7 +113,7 @@ static ColliderCylinderInit sBodyColliderInit = { static ColliderTrisElementInit sFrontShieldingTrisInit[2] = { { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -123,7 +124,7 @@ static ColliderTrisElementInit sFrontShieldingTrisInit[2] = { }, { { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -136,7 +137,7 @@ static ColliderTrisElementInit sFrontShieldingTrisInit[2] = { static ColliderTrisInit sFrontShieldingInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, @@ -149,7 +150,7 @@ static ColliderTrisInit sFrontShieldingInit = { static ColliderQuadInit sAttackColliderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -157,7 +158,7 @@ static ColliderQuadInit sAttackColliderInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -167,7 +168,7 @@ static ColliderQuadInit sAttackColliderInit = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -typedef enum { +typedef enum EnMbDamageEffect { /* 0x0 */ ENMB_DMGEFF_IGNORE, /* 0x1 */ ENMB_DMGEFF_STUN, /* 0x5 */ ENMB_DMGEFF_FREEZE = 0x5, @@ -248,7 +249,7 @@ static DamageTable sClubMoblinDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_MOBLIN, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 5300, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 5300, ICHAIN_STOP), }; void EnMb_SetupAction(EnMb* this, EnMbActionFunc actionFunc) { @@ -307,7 +308,7 @@ void EnMb_Init(Actor* thisx, PlayState* play) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFeet, 90.0f); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.naviEnemyId += NAVI_ENEMY_MOBLIN_CLUB - NAVI_ENEMY_MOBLIN; EnMb_SetupClubWaitPlayerNear(this); break; @@ -316,14 +317,14 @@ void EnMb_Init(Actor* thisx, PlayState* play) { this->morphTable, 28); Actor_SetScale(&this->actor, 0.014f); - this->path = (thisx->params & 0xFF00) >> 8; + this->path = PARAMS_GET_S(thisx->params, 8, 8); this->actor.params = ENMB_TYPE_SPEAR_PATROL; this->waypoint = 0; this->actor.colChkInfo.health = 1; this->actor.colChkInfo.mass = MASS_HEAVY; this->maxHomeDist = 350.0f; this->playerDetectionRange = 1750.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnMb_SetupSpearPatrolTurnTowardsWaypoint(this, play); break; } @@ -574,7 +575,7 @@ void EnMb_SetupClubDamagedWhileKneeling(EnMb* this) { void EnMb_SetupClubDead(EnMb* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gEnMbClubFallOnItsBackAnim, -4.0f); this->state = ENMB_STATE_CLUB_DEAD; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->bodyCollider.dim.height = 80; this->bodyCollider.dim.radius = 95; this->timer1 = 30; @@ -604,8 +605,10 @@ void EnMb_Stunned(EnMb* this, PlayState* play) { if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; +#if OOT_VERSION >= PAL_1_0 player->av2.actionVar2 = 200; - func_8002F71C(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); +#endif + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); this->attack = ENMB_ATTACK_NONE; } @@ -713,17 +716,21 @@ void EnMb_ClubWaitAfterAttack(EnMb* this, PlayState* play) { * Slow down, charge again if the player is near, or resume walking. */ void EnMb_SpearPatrolEndCharge(EnMb* this, PlayState* play) { +#if OOT_VERSION >= PAL_1_0 Player* player = GET_PLAYER(play); +#endif f32 lastFrame; s16 relYawFromPlayer; s16 yawPlayerToWaypoint; +#if OOT_VERSION >= PAL_1_0 if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->av2.actionVar2 = 200; - func_8002F71C(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); } +#endif if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 1.5f, 0.0f); @@ -839,8 +846,9 @@ void EnMb_ClubAttack(EnMb* this, PlayState* play) { } } - func_8002F71C(play, &this->actor, (650.0f - this->actor.xzDistToPlayer) * 0.04f + 4.0f, - this->actor.world.rot.y, 8.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, + (650.0f - this->actor.xzDistToPlayer) * 0.04f + 4.0f, + this->actor.world.rot.y, 8.0f); player->invincibilityTimer = prevPlayerInvincibilityTimer; } @@ -910,7 +918,7 @@ void EnMb_SpearPatrolPrepareAndCharge(EnMb* this, PlayState* play) { if (this->attackCollider.base.at == &player->actor) { if (!endCharge && !(player->stateFlags2 & PLAYER_STATE2_7)) { if (player->invincibilityTimer < 0) { - if (player->invincibilityTimer < -39) { + if (player->invincibilityTimer <= -40) { player->invincibilityTimer = 0; } else { player->invincibilityTimer = 0; @@ -943,13 +951,26 @@ void EnMb_SpearPatrolPrepareAndCharge(EnMb* this, PlayState* play) { if (endCharge) { if (hasHitPlayer || (player->stateFlags2 & PLAYER_STATE2_7)) { +#if OOT_VERSION < PAL_1_0 + player->stateFlags2 &= ~PLAYER_STATE2_7; + this->attackCollider.base.atFlags &= ~AT_HIT; + player->actor.parent = NULL; + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); +#elif OOT_VERSION < NTSC_1_2 + player->stateFlags2 &= ~PLAYER_STATE2_7; + this->attackCollider.base.atFlags &= ~AT_HIT; + player->actor.parent = NULL; + player->av2.actionVar2 = 200; + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); +#else this->attackCollider.base.atFlags &= ~AT_HIT; if (player->stateFlags2 & PLAYER_STATE2_7) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->av2.actionVar2 = 200; - func_8002F71C(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); } +#endif } this->attack = ENMB_ATTACK_NONE; this->actor.speed = -10.0f; @@ -1012,13 +1033,26 @@ void EnMb_SpearPatrolImmediateCharge(EnMb* this, PlayState* play) { if (endCharge) { if (hasHitPlayer || (player->stateFlags2 & PLAYER_STATE2_7)) { +#if OOT_VERSION < PAL_1_0 + this->attackCollider.base.atFlags &= ~AT_HIT; + player->stateFlags2 &= ~PLAYER_STATE2_7; + player->actor.parent = NULL; + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); +#elif OOT_VERSION < NTSC_1_2 + this->attackCollider.base.atFlags &= ~AT_HIT; + player->stateFlags2 &= ~PLAYER_STATE2_7; + player->actor.parent = NULL; + player->av2.actionVar2 = 200; + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); +#else this->attackCollider.base.atFlags &= ~AT_HIT; if (player->stateFlags2 & PLAYER_STATE2_7) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->av2.actionVar2 = 200; - func_8002F71C(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); } +#endif this->attack = ENMB_ATTACK_NONE; this->actor.speed = -10.0f; EnMb_SetupSpearPatrolEndCharge(this); @@ -1134,12 +1168,12 @@ void EnMb_SpearGuardWalk(EnMb* this, PlayState* play) { if (this->timer3 == 0 && Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < this->playerDetectionRange) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x2EE, 0); - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; if (this->actor.xzDistToPlayer < 500.0f && relYawTowardsPlayer < 0x1388) { EnMb_SetupSpearPrepareAndCharge(this); } } else { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if (Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) > this->maxHomeDist || this->timer2 != 0) { yawTowardsHome = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); Math_SmoothStepToS(&this->actor.world.rot.y, yawTowardsHome, 1, 0x2EE, 0); @@ -1286,22 +1320,35 @@ void EnMb_SetupSpearDead(EnMb* this) { this->timer1 = 30; this->state = ENMB_STATE_SPEAR_SPEARPATH_DAMAGED; Actor_PlaySfx(&this->actor, NA_SE_EN_MORIBLIN_DEAD); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnMb_SetupAction(this, EnMb_SpearDead); } void EnMb_SpearDead(EnMb* this, PlayState* play) { +#if OOT_VERSION >= NTSC_1_1 Player* player = GET_PLAYER(play); +#endif Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f); +#if OOT_VERSION < NTSC_1_1 + // Empty +#elif OOT_VERSION < PAL_1_0 + if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { + player->stateFlags2 &= ~PLAYER_STATE2_7; + player->actor.parent = NULL; + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); + this->attack = ENMB_ATTACK_NONE; + } +#else if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->av2.actionVar2 = 200; - func_8002F71C(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); this->attack = ENMB_ATTACK_NONE; } +#endif if (SkelAnime_Update(&this->skelAnime)) { if (this->timer1 > 0) { @@ -1381,8 +1428,10 @@ void EnMb_CheckColliding(EnMb* this, PlayState* play) { if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; +#if OOT_VERSION >= PAL_1_0 player->av2.actionVar2 = 200; - func_8002F71C(play, &this->actor, 6.0f, this->actor.world.rot.y, 6.0f); +#endif + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 6.0f, this->actor.world.rot.y, 6.0f); } this->damageEffect = this->actor.colChkInfo.damageEffect; this->attack = ENMB_ATTACK_NONE; diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.h b/src/overlays/actors/ovl_En_Mb/z_en_mb.h index 6ce94942d5..66afb9eeb1 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.h +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.h @@ -8,7 +8,7 @@ struct EnMb; typedef void (*EnMbActionFunc)(struct EnMb*, PlayState*); -typedef enum { +typedef enum EnMbState { /* 0 */ ENMB_STATE_SPEAR_SPEARPATH_DAMAGED, /* 1 */ ENMB_STATE_CLUB_DEAD, /* 2 */ ENMB_STATE_CLUB_KNEELING_DAMAGED, diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index 7d33ed89e2..008352b145 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -8,7 +8,7 @@ #include "assets/objects/object_md/object_md.h" #include "overlays/actors/ovl_En_Elf/z_en_elf.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_25) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_25) void EnMd_Init(Actor* thisx, PlayState* play); void EnMd_Destroy(Actor* thisx, PlayState* play); @@ -21,7 +21,7 @@ void func_80AAB948(EnMd* this, PlayState* play); void func_80AABC10(EnMd* this, PlayState* play); void func_80AABD0C(EnMd* this, PlayState* play); -ActorInit En_Md_InitVars = { +ActorProfile En_Md_Profile = { /**/ ACTOR_EN_MD, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -35,7 +35,7 @@ ActorInit En_Md_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -43,7 +43,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -55,7 +55,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -typedef enum { +typedef enum EnMdAnimation { /* 0 */ ENMD_ANIM_0, /* 1 */ ENMD_ANIM_1, /* 2 */ ENMD_ANIM_2, @@ -592,11 +592,11 @@ u8 EnMd_FollowPath(EnMd* this, PlayState* play) { f32 pathDiffX; f32 pathDiffZ; - if ((this->actor.params & 0xFF00) == 0xFF00) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 8, 8) == 0xFF00) { return 0; } - path = &play->pathList[(this->actor.params & 0xFF00) >> 8]; + path = &play->pathList[PARAMS_GET_S(this->actor.params, 8, 8)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; @@ -619,11 +619,11 @@ u8 EnMd_SetMovedPos(EnMd* this, PlayState* play) { Path* path; Vec3s* lastPointPos; - if ((this->actor.params & 0xFF00) == 0xFF00) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 8, 8) == 0xFF00) { return 0; } - path = &play->pathList[(this->actor.params & 0xFF00) >> 8]; + path = &play->pathList[PARAMS_GET_S(this->actor.params, 8, 8)]; lastPointPos = SEGMENTED_TO_VIRTUAL(path->points); lastPointPos += path->count - 1; @@ -667,7 +667,7 @@ void EnMd_Init(Actor* thisx, PlayState* play) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_0); Actor_SetScale(&this->actor, 0.01f); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->alpha = 255; Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_ELF, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, FAIRY_KOKIRI); diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.h b/src/overlays/actors/ovl_En_Md/z_en_md.h index d3075a821f..57b693a39a 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.h +++ b/src/overlays/actors/ovl_En_Md/z_en_md.h @@ -6,7 +6,7 @@ struct EnMd; -typedef enum { +typedef enum EnMdLimb { ENMD_LIMB_NONE, ENMD_LIMB_ROOT, ENMD_LIMB_WAIST, diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c index 5b8e26d91c..ab748fe164 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -7,7 +7,7 @@ #include "z_en_mk.h" #include "assets/objects/object_mk/object_mk.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) void EnMk_Init(Actor* thisx, PlayState* play); void EnMk_Destroy(Actor* thisx, PlayState* play); @@ -16,7 +16,7 @@ void EnMk_Draw(Actor* thisx, PlayState* play); void EnMk_Wait(EnMk* this, PlayState* play); -ActorInit En_Mk_InitVars = { +ActorProfile En_Mk_Profile = { /**/ ACTOR_EN_MK, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -30,7 +30,7 @@ ActorInit En_Mk_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, @@ -38,7 +38,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -60,13 +60,13 @@ void EnMk_Init(Actor* thisx, PlayState* play) { Animation_PlayLoop(&this->skelAnime, &object_mk_Anim_000D88); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); this->actionFunc = EnMk_Wait; this->flags = 0; this->swimFlag = 0; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; if (GET_ITEMGETINF(ITEMGETINF_10)) { this->flags |= 4; @@ -81,7 +81,7 @@ void EnMk_Destroy(Actor* thisx, PlayState* play) { void func_80AACA40(EnMk* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->actionFunc = EnMk_Wait; } diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index 2375b5e6ca..1053bfb0af 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -8,9 +8,9 @@ #include "assets/objects/object_mm/object_mm.h" #include "assets/objects/object_link_child/object_link_child.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) -typedef enum { +typedef enum RunningManAnimIndex { /* 0 */ RM_ANIM_RUN, /* 1 */ RM_ANIM_SIT, /* 2 */ RM_ANIM_SIT_WAIT, @@ -20,7 +20,7 @@ typedef enum { /* 6 */ RM_ANIM_HAPPY // plays when you sell him the bunny hood } RunningManAnimIndex; -typedef enum { +typedef enum RunningManMouthTex { /* 0 */ RM_MOUTH_CLOSED, /* 1 */ RM_MOUTH_OPEN } RunningManMouthTex; @@ -39,7 +39,7 @@ s32 func_80AADA70(void); s32 EnMm_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx); void EnMm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void*); -ActorInit En_Mm_InitVars = { +ActorProfile En_Mm_Profile = { /**/ ACTOR_EN_MM, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -53,7 +53,7 @@ ActorInit En_Mm_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -61,7 +61,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -115,7 +115,7 @@ static AnimationSpeedInfo sAnimationInfo[] = { { &gRunningManHappyAnim, 1.0f, ANIMMODE_LOOP, -12.0f }, }; -typedef struct { +typedef struct EnMmPathInfo { /* 0x00 */ s32 unk_00; /* 0x04 */ s32 unk_04; /* 0x08 */ s32 unk_08; @@ -173,10 +173,10 @@ void EnMm_Init(Actor* thisx, PlayState* play) { Animation_GetLastFrame(sAnimationInfo[RM_ANIM_RUN].animation), sAnimationInfo[RM_ANIM_RUN].mode, sAnimationInfo[RM_ANIM_RUN].morphFrames); - this->path = this->actor.params & 0xFF; + this->path = PARAMS_GET_U(this->actor.params, 0, 8); this->unk_1F0 = 2; this->unk_1E8 = 0; - this->actor.targetMode = 2; + this->actor.attentionRangeType = ATTENTION_RANGE_2; this->actor.gravity = -1.0f; this->speedXZ = 3.0f; this->unk_204 = this->actor.objectSlot; @@ -334,7 +334,7 @@ s32 func_80AADEF0(EnMm* this, PlayState* play) { xDiff = waypointPos.x - this->actor.world.pos.x; zDiff = waypointPos.z - this->actor.world.pos.z; - this->yawToWaypoint = (s32)(Math_FAtan2F(xDiff, zDiff) * (0x8000 / M_PI)); + this->yawToWaypoint = RAD_TO_BINANG2(Math_FAtan2F(xDiff, zDiff)); this->distToWaypoint = sqrtf(SQ(xDiff) + SQ(zDiff)); while ((this->distToWaypoint <= 10.44f) && (this->unk_1E8 != 0)) { @@ -379,7 +379,7 @@ s32 func_80AADEF0(EnMm* this, PlayState* play) { xDiff = waypointPos.x - this->actor.world.pos.x; zDiff = waypointPos.z - this->actor.world.pos.z; - this->yawToWaypoint = (s32)(Math_FAtan2F(xDiff, zDiff) * (0x8000 / M_PI)); + this->yawToWaypoint = RAD_TO_BINANG2(Math_FAtan2F(xDiff, zDiff)); this->distToWaypoint = sqrtf(SQ(xDiff) + SQ(zDiff)); } @@ -462,7 +462,7 @@ void func_80AAE294(EnMm* this, PlayState* play) { } if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { - func_8002F71C(play, &this->actor, 3.0f, this->actor.yawTowardsPlayer, 4.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 3.0f, this->actor.yawTowardsPlayer, 4.0f); } } } @@ -531,7 +531,7 @@ void EnMm_Draw(Actor* thisx, PlayState* play) { mtx = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Mtx) * 2); Matrix_Put(&this->unk_208); - mtx2 = MATRIX_NEW(play->state.gfxCtx, "../z_en_mm.c", 1111); + mtx2 = MATRIX_FINALIZE(play->state.gfxCtx, "../z_en_mm.c", 1111); gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[linkChildObjectSlot].segment); gSPSegment(POLY_OPA_DISP++, 0x0B, mtx); @@ -558,8 +558,6 @@ void EnMm_Draw(Actor* thisx, PlayState* play) { } } - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_en_mm.c", 1141); } diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index 74636b9e24..f4876f70ed 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -8,9 +8,9 @@ #include "terminal.h" #include "assets/objects/object_mm/object_mm.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) -typedef enum { +typedef enum RunningManAnimIndex { /* 0 */ RM2_ANIM_RUN, /* 1 */ RM2_ANIM_SIT, /* 2 */ RM2_ANIM_SIT_WAIT, @@ -20,7 +20,7 @@ typedef enum { /* 6 */ RM2_ANIM_HAPPY // plays when you sell him the bunny hood } RunningManAnimIndex; -typedef enum { +typedef enum RunningManMouthTex { /* 0 */ RM2_MOUTH_CLOSED, /* 1 */ RM2_MOUTH_OPEN } RunningManMouthTex; @@ -35,7 +35,7 @@ void func_80AAF668(EnMm2* this, PlayState* play); s32 EnMm2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx); void EnMm2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx); -ActorInit En_Mm2_InitVars = { +ActorProfile En_Mm2_Profile = { /**/ ACTOR_EN_MM2, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -49,7 +49,7 @@ ActorInit En_Mm2_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -57,7 +57,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000004, 0x00, 0x00 }, ATELEM_NONE, @@ -136,7 +136,7 @@ void EnMm2_Init(Actor* thisx, PlayState* play2) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->mouthTexIndex = RM2_MOUTH_CLOSED; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->unk_1F4 |= 1; this->actor.gravity = -1.0f; if (this->actor.params == 1) { diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index 9feb9d43bc..35796e1eb7 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -7,7 +7,7 @@ #include "z_en_ms.h" #include "assets/objects/object_ms/object_ms.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnMs_Init(Actor* thisx, PlayState* play); void EnMs_Destroy(Actor* thisx, PlayState* play); @@ -20,7 +20,7 @@ void EnMs_Talk(EnMs* this, PlayState* play); void EnMs_Sell(EnMs* this, PlayState* play); void EnMs_TalkAfterPurchase(EnMs* this, PlayState* play); -ActorInit En_Ms_InitVars = { +ActorProfile En_Ms_Profile = { /**/ ACTOR_EN_MS, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -34,7 +34,7 @@ ActorInit En_Ms_InitVars = { static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -53,8 +53,8 @@ static u16 sOfferTextIDs[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 500, ICHAIN_STOP), }; void EnMs_SetOfferText(EnMs* this, PlayState* play) { @@ -163,7 +163,7 @@ void EnMs_Update(Actor* thisx, PlayState* play) { this->activeTimer++; Actor_SetFocus(&this->actor, 20.0f); - this->actor.targetArrowOffset = 500.0f; + this->actor.lockOnArrowOffset = 500.0f; Actor_SetScale(&this->actor, 0.015f); SkelAnime_Update(&this->skelAnime); this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Mu/z_en_mu.c b/src/overlays/actors/ovl_En_Mu/z_en_mu.c index d6a8f2af01..4e50a89e08 100644 --- a/src/overlays/actors/ovl_En_Mu/z_en_mu.c +++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.c @@ -7,7 +7,7 @@ #include "z_en_mu.h" #include "assets/objects/object_mu/object_mu.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnMu_Init(Actor* thisx, PlayState* play); void EnMu_Destroy(Actor* thisx, PlayState* play); @@ -19,7 +19,7 @@ s16 EnMu_UpdateTalkState(PlayState* play, Actor* thisx); static ColliderCylinderInit D_80AB0BD0 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -27,7 +27,7 @@ static ColliderCylinderInit D_80AB0BD0 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -39,7 +39,7 @@ static ColliderCylinderInit D_80AB0BD0 = { static CollisionCheckInfoInit2 D_80AB0BFC = { 0, 0, 0, 0, MASS_IMMOVABLE }; -ActorInit En_Mu_InitVars = { +ActorProfile En_Mu_Profile = { /**/ ACTOR_EN_MU, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -139,7 +139,7 @@ void EnMu_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &D_80AB0BD0); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &D_80AB0BFC); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; Actor_SetScale(&this->actor, 0.01f); EnMu_Interact(this, play); EnMu_SetupAction(this, EnMu_Pose); diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index 7d219eae6e..4f4b8fc283 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -11,7 +11,7 @@ #define FLAGS ACTOR_FLAG_4 -typedef enum { +typedef enum EnNbAction { /* 0x00 */ NB_CHAMBER_INIT, /* 0x01 */ NB_CHAMBER_UNDERGROUND, /* 0x02 */ NB_CHAMBER_APPEAR, @@ -45,7 +45,7 @@ typedef enum { /* 0x1E */ NB_ACTION_30 } EnNbAction; -typedef enum { +typedef enum EnNbDrawMode { /* 0x00 */ NB_DRAW_NOTHING, /* 0x01 */ NB_DRAW_DEFAULT, /* 0x02 */ NB_DRAW_HIDE, @@ -60,14 +60,14 @@ void EnNb_Draw(Actor* thisx, PlayState* play); static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_PLAYER, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -90,15 +90,15 @@ static s32 D_80AB4318 = 0; #include "z_en_nb_cutscene_data.inc.c" s32 EnNb_GetPath(EnNb* this) { - s32 path = this->actor.params >> 8; + s32 path = PARAMS_GET_U(this->actor.params, 8, 8); - return path & 0xFF; + return path; } s32 EnNb_GetType(EnNb* this) { - s32 type = this->actor.params; + s32 type = PARAMS_GET_U(this->actor.params, 0, 8); - return type & 0xFF; + return type; } void EnNb_UpdatePath(EnNb* this, PlayState* play) { @@ -756,8 +756,8 @@ void EnNb_InitDemo6KInConfrontation(EnNb* this, PlayState* play) { } void func_80AB2688(EnNb* this, PlayState* play) { - this->skelAnime.moveFlags |= ANIM_FLAG_UPDATE_XZ; - AnimTaskQueue_AddActorMove(play, &this->actor, &this->skelAnime, 1.0f); + this->skelAnime.movementFlags |= ANIM_FLAG_UPDATE_XZ; + AnimTaskQueue_AddActorMovement(play, &this->actor, &this->skelAnime, 1.0f); } void func_80AB26C8(EnNb* this) { @@ -1134,7 +1134,7 @@ void EnNb_CrawlspaceSpawnCheck(EnNb* this, PlayState* play) { EnNb_SetCurrentAnim(this, &gNabooruStandingHandsOnHipsAnim, 0, 0.0f, 0); this->headTurnFlag = 1; - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; this->actor.world.pos = this->finalPos; this->action = NB_IDLE_AFTER_TALK; this->drawMode = NB_DRAW_DEFAULT; @@ -1214,7 +1214,7 @@ void EnNb_SetupIdleCrawlspace(EnNb* this, s32 animFinished) { if (animFinished) { EnNb_SetCurrentAnim(this, &gNabooruStandingHandsOnHipsAnim, 0, -8.0f, 0); this->headTurnFlag = 1; - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; this->action = NB_IDLE_CRAWLSPACE; } } @@ -1225,7 +1225,7 @@ void func_80AB3838(EnNb* this, PlayState* play) { this->action = NB_IN_DIALOG; } else { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; if (!GET_INFTABLE(INFTABLE_16C)) { this->actor.textId = 0x601D; @@ -1241,7 +1241,7 @@ void EnNb_SetupPathMovement(EnNb* this, PlayState* play) { EnNb_SetCurrentAnim(this, &gNabooruStandingToWalkingTransitionAnim, 2, -8.0f, 0); SET_EVENTCHKINF(EVENTCHKINF_94); this->action = NB_IN_PATH; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); } void EnNb_SetTextIdAsChild(EnNb* this, PlayState* play) { @@ -1261,7 +1261,7 @@ void EnNb_SetTextIdAsChild(EnNb* this, PlayState* play) { } this->action = NB_IDLE_CRAWLSPACE; } - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); } else if ((Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play)) { choiceIndex = play->msgCtx.choiceIndex; @@ -1319,7 +1319,7 @@ void func_80AB3B04(EnNb* this, PlayState* play) { this->action = NB_ACTION_30; } else { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; this->actor.textId = MaskReaction_GetTextId(play, MASK_REACTION_SET_NABOORU); if (this->actor.textId == 0) { @@ -1333,7 +1333,7 @@ void func_80AB3B04(EnNb* this, PlayState* play) { void func_80AB3B7C(EnNb* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { this->action = NB_IDLE_AFTER_TALK; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); } } @@ -1558,7 +1558,7 @@ void EnNb_Draw(Actor* thisx, PlayState* play) { sDrawFuncs[this->drawMode](this, play); } -ActorInit En_Nb_InitVars = { +ActorProfile En_Nb_Profile = { /**/ ACTOR_EN_NB, /**/ ACTORCAT_NPC, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.h b/src/overlays/actors/ovl_En_Nb/z_en_nb.h index 89429df6b9..997af0f573 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.h +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.h @@ -6,7 +6,7 @@ struct EnNb; -typedef enum { +typedef enum EnNbLimb { /* 0x00 */ NB_LIMB_NONE, /* 0x01 */ NB_LIMB_ROOT, /* 0x02 */ NB_LIMB_L_THIGH, @@ -55,7 +55,7 @@ typedef struct EnNb { /* 0x0300 */ NpcInteractInfo interactInfo; } EnNb; // size = 0x0328 -typedef enum { +typedef enum EnNbType { /* 0x02 */ NB_TYPE_DEMO02 = 2, /* 0x03 */ NB_TYPE_KIDNAPPED, /* 0x04 */ NB_TYPE_KNUCKLE, diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index e24f78be87..96c00b42e6 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -8,8 +8,9 @@ #include "assets/objects/object_niw/object_niw.h" #include "overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h" #include "terminal.h" +#include "versions.h" -#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_23) +#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_THROW_ONLY) void EnNiw_Init(Actor* thisx, PlayState* play); void EnNiw_Destroy(Actor* thisx, PlayState* play); @@ -36,7 +37,7 @@ void EnNiw_DrawEffects(EnNiw* this, PlayState* play); static s16 D_80AB85E0 = 0; -ActorInit En_Niw_InitVars = { +ActorProfile En_Niw_Profile = { /**/ ACTOR_EN_NIW, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -75,7 +76,7 @@ static u8 sUpperRiverSpawned = false; static ColliderCylinderInit sCylinderInit1 = { { - COLTYPE_HIT5, + COL_MATERIAL_HIT5, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON, @@ -83,7 +84,7 @@ static ColliderCylinderInit sCylinderInit1 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -95,7 +96,7 @@ static ColliderCylinderInit sCylinderInit1 = { static ColliderCylinderInit sCylinderInit2 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -103,7 +104,7 @@ static ColliderCylinderInit sCylinderInit2 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -114,9 +115,9 @@ static ColliderCylinderInit sCylinderInit2 = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 6, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_6, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 0, ICHAIN_STOP), }; void EnNiw_Init(Actor* thisx, PlayState* play) { @@ -151,7 +152,7 @@ void EnNiw_Init(Actor* thisx, PlayState* play) { } Actor_ProcessInitChain(&this->actor, sInitChain); - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoSkel, &gCuccoAnim, this->jointTable, this->morphTable, 16); @@ -213,7 +214,7 @@ void EnNiw_Init(Actor* thisx, PlayState* play) { FALLTHROUGH; case 0xE: this->actor.colChkInfo.mass = 0; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; break; case 4: this->actor.gravity = 0.0f; @@ -461,7 +462,7 @@ void func_80AB6450(EnNiw* this, PlayState* play) { this->sfxTimer1 = 30; this->path = 0; this->timer4 = 30; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = 0.0f; this->actionFunc = func_80AB6BF8; } else { @@ -483,7 +484,7 @@ void func_80AB6570(EnNiw* this, PlayState* play) { this->sfxTimer1 = 30; this->path = 0; this->timer4 = 30; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = 0.0f; this->actionFunc = func_80AB6BF8; return; @@ -644,7 +645,7 @@ void func_80AB6BF8(EnNiw* this, PlayState* play) { this->actor.shape.rot.z = 0; this->actor.shape.rot.y = this->actor.shape.rot.z; this->actor.shape.rot.x = this->actor.shape.rot.z; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = func_80AB6D08; } func_80AB5BF8(this, play, 2); @@ -692,7 +693,7 @@ void func_80AB6D08(EnNiw* this, PlayState* play) { this->sfxTimer1 = 30; this->path = 0; this->timer4 = 30; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = 0.0f; this->actionFunc = func_80AB6BF8; } else { @@ -799,7 +800,7 @@ void func_80AB714C(EnNiw* this, PlayState* play) { if (this->timer5 == 0) { this->timer7 = 10; this->unk_2E4 = this->actor.yawTowardsPlayer; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = func_80AB7204; } @@ -1055,8 +1056,13 @@ void EnNiw_Update(Actor* thisx, PlayState* play) { dist = 20.0f; - if (this->unk_2A8 != 0 && thisx->xyzDistToPlayerSq < SQ(dist) && player->invincibilityTimer == 0) { - func_8002F6D4(play, &this->actor, 2.0f, thisx->world.rot.y, 0.0f, 0x10); +#if OOT_VERSION < NTSC_1_1 + if (this->unk_2A8 != 0 && thisx->xyzDistToPlayerSq < SQ(dist) && !(player->stateFlags1 & PLAYER_STATE1_26)) +#else + if (this->unk_2A8 != 0 && thisx->xyzDistToPlayerSq < SQ(dist) && player->invincibilityTimer == 0) +#endif + { + Actor_SetPlayerKnockbackLarge(play, &this->actor, 2.0f, thisx->world.rot.y, 0.0f, 0x10); } func_80AB747C(this, play); @@ -1200,8 +1206,7 @@ void EnNiw_DrawEffects(EnNiw* this, PlayState* play) { Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); Matrix_RotateZ(effect->unk_30, MTXMODE_APPLY); Matrix_Translate(0.0f, -1000.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_niw.c", 1913), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_niw.c", 1913); gSPDisplayList(POLY_XLU_DISP++, gCuccoEffectFeatherModelDL); } } diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.h b/src/overlays/actors/ovl_En_Niw/z_en_niw.h index 5f1ab9c809..283b6a52cd 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.h +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.h @@ -8,7 +8,7 @@ struct EnNiw; typedef void (*EnNiwActionFunc)(struct EnNiw*, PlayState*); -typedef struct { +typedef struct EnNiwEffect { /* 0x0000 */ u8 type; /* 0x0004 */ Vec3f pos; /* 0x0010 */ Vec3f vel; diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index 33c98d4f8f..dab07959e4 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -8,7 +8,7 @@ #include "assets/objects/object_gr/object_gr.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) void EnNiwGirl_Init(Actor* thisx, PlayState* play); void EnNiwGirl_Destroy(Actor* thisx, PlayState* play); @@ -19,7 +19,7 @@ void EnNiwGirl_Talk(EnNiwGirl* this, PlayState* play); void func_80AB94D0(EnNiwGirl* this, PlayState* play); void func_80AB9210(EnNiwGirl* this, PlayState* play); -ActorInit En_Niw_Girl_InitVars = { +ActorProfile En_Niw_Girl_Profile = { /**/ ACTOR_EN_NIW_GIRL, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -33,7 +33,7 @@ ActorInit En_Niw_Girl_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -41,7 +41,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -61,11 +61,11 @@ void EnNiwGirl_Init(Actor* thisx, PlayState* play) { SkelAnime_InitFlex(play, &this->skelAnime, &gNiwGirlSkel, &gNiwGirlRunAnim, this->jointTable, this->morphTable, 17); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; if (this->actor.params < 0) { this->actor.params = 0; } - this->path = ((this->actor.params >> 8) & 0xFF); + this->path = PARAMS_GET_U(this->actor.params, 8, 8); this->actor.gravity = -3.0f; Matrix_RotateY(BINANG_TO_RAD_ALT(this->actor.shape.rot.y), MTXMODE_NEW); vec2.x = vec2.y = vec2.z = 0.0f; @@ -96,7 +96,7 @@ void EnNiwGirl_Destroy(Actor* thisx, PlayState* play) { void EnNiwGirl_Jump(EnNiwGirl* this, PlayState* play) { f32 frameCount = Animation_GetLastFrame(&gNiwGirlRunAnim); Animation_Change(&this->skelAnime, &gNiwGirlRunAnim, 1.0f, 0.0f, frameCount, 0, -10.0f); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = func_80AB9210; } @@ -137,7 +137,7 @@ void func_80AB9210(EnNiwGirl* this, PlayState* play) { void EnNiwGirl_Talk(EnNiwGirl* this, PlayState* play) { Animation_Change(&this->skelAnime, &gNiwGirlJumpAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gNiwGirlJumpAnim), 0, -10.0f); - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.textId = 0x7000; if (GET_EVENTCHKINF(EVENTCHKINF_80) && (this->unk_27A == 0)) { this->actor.textId = 0x70EA; diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 72c5812185..3f3176f5de 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -3,8 +3,9 @@ #include "assets/objects/object_os_anime/object_os_anime.h" #include "overlays/actors/ovl_En_Niw/z_en_niw.h" #include "terminal.h" +#include "versions.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) void EnNiwLady_Init(Actor* thisx, PlayState* play); void EnNiwLady_Destroy(Actor* thisx, PlayState* play); @@ -25,7 +26,7 @@ void func_80ABA244(EnNiwLady* this, PlayState* play); void func_80ABA654(EnNiwLady* this, PlayState* play); void func_80ABAD7C(EnNiwLady* this, PlayState* play); -ActorInit En_Niw_Lady_InitVars = { +ActorProfile En_Niw_Lady_Profile = { /**/ ACTOR_EN_NIW_LADY, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -48,7 +49,7 @@ static s16 D_80ABB3B4[] = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -56,7 +57,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -165,7 +166,7 @@ void func_80AB9F24(EnNiwLady* this, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->unk_272 = 0; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->actor.draw = EnNiwLady_Draw; switch (this->unk_278) { case 0: @@ -259,6 +260,7 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ this->message_end_code ☆☆ %d\n" VT_RST, this->unk_262); PRINTF("\n\n"); if (MaskReaction_GetTextId(play, MASK_REACTION_SET_CUCCO_LADY) == 0) { +#if OOT_VERSION >= NTSC_1_1 if (this->actor.textId == 0x503C) { Sfx_PlaySfxCentered(NA_SE_SY_ERROR); this->unk_26C = 2; @@ -266,6 +268,7 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { this->actionFunc = func_80ABA654; return; } +#endif this->unk_26E = phi_s1 + 1; if (phi_s1 == 7) { Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); @@ -286,6 +289,13 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { if (this->unk_26A != this->cuccosInPen) { if (this->cuccosInPen < this->unk_26A) { Sfx_PlaySfxCentered(NA_SE_SY_ERROR); +#if OOT_VERSION < NTSC_1_1 + if (phi_s1 == 9) { + this->unk_26C = 2; + this->unk_262 = TEXT_STATE_EVENT; + this->actionFunc = func_80ABA654; + } +#endif } else if (phi_s1 + 1 < 9) { Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index 1d05b78c35..d2f6fbdea6 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -22,7 +22,7 @@ void EnNutsball_Draw(Actor* thisx, PlayState* play); void func_80ABBB34(EnNutsball* this, PlayState* play); void func_80ABBBA8(EnNutsball* this, PlayState* play); -ActorInit En_Nutsball_InitVars = { +ActorProfile En_Nutsball_Profile = { /**/ ACTOR_EN_NUTSBALL, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -36,7 +36,7 @@ ActorInit En_Nutsball_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -44,7 +44,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_WOOD, @@ -147,7 +147,7 @@ void EnNutsball_Update(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); s32 pad; - if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29)) || + if (!(player->stateFlags1 & (PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29)) || (this->actionFunc == func_80ABBB34)) { this->actionFunc(this, play); @@ -172,7 +172,7 @@ void EnNutsball_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); Matrix_RotateZ(this->actor.home.rot.z * 9.58738e-05f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_nutsball.c", 333), G_MTX_MODELVIEW | G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_nutsball.c", 333); gSPDisplayList(POLY_OPA_DISP++, sDLists[NUTSBALL_GET_TYPE(&this->actor)]); CLOSE_DISPS(play->state.gfxCtx, "../z_en_nutsball.c", 337); diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h index aaf85a6571..00fe77a05c 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h @@ -6,7 +6,7 @@ #define NUTSBALL_GET_TYPE(thisx) ((thisx)->params) -typedef enum { +typedef enum EnNutsballType { /* 0 */ EN_NUTSBALL_TYPE_DEKUNUTS, /* 1 */ EN_NUTSBALL_TYPE_HINTNUTS, /* 2 */ EN_NUTSBALL_TYPE_SHOPNUTS, diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c index b6942de606..00ba57f4ad 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -25,12 +25,12 @@ void EnNwc_Idle(EnNwc* this, PlayState* play); #define CHICK_BG_FLOOR (1 << 0) #define CHICK_BG_WALL (1 << 1) -typedef enum { +typedef enum ChickTypes { /* 0 */ CHICK_NONE, /* 1 */ CHICK_NORMAL } ChickTypes; -ActorInit En_Nwc_InitVars = { +ActorProfile En_Nwc_Profile = { /**/ ACTOR_EN_NWC, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -44,7 +44,7 @@ ActorInit En_Nwc_InitVars = { static ColliderJntSphElementInit sJntSphElementInit = { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -56,7 +56,7 @@ static ColliderJntSphElementInit sJntSphElementInit = { static ColliderJntSphInitType1 sJntSphInit = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -171,7 +171,7 @@ void EnNwc_DrawChicks(EnNwc* this, PlayState* play) { Matrix_SetTranslateRotateYXZ(chick->pos.x, chick->pos.y + chick->height, chick->pos.z, &chick->rot); Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY); - mtx = MATRIX_NEW(play->state.gfxCtx, "../z_en_nwc.c", 346); + mtx = MATRIX_FINALIZE(play->state.gfxCtx, "../z_en_nwc.c", 346); gDPSetEnvColor(dList1++, 0, 100, 255, 255); gSPMatrix(dList1++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(dList1++, gCuccoChickBodyDL); @@ -193,8 +193,7 @@ void EnNwc_DrawChicks(EnNwc* this, PlayState* play) { Matrix_Put(&floorMat); Matrix_RotateY(BINANG_TO_RAD(chick->rot.y), MTXMODE_APPLY); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_nwc.c", 388), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_nwc.c", 388); gSPDisplayList(POLY_XLU_DISP++, gCuccoChickShadowDL); } } diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/src/overlays/actors/ovl_En_Ny/z_en_ny.c index 38e717dd66..e31bd37d52 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -1,7 +1,7 @@ #include "z_en_ny.h" #include "assets/objects/object_ny/object_ny.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) void EnNy_Init(Actor* thisx, PlayState* play); void EnNy_Destroy(Actor* thisx, PlayState* play); @@ -23,7 +23,7 @@ void EnNy_SetupDie(EnNy* this, PlayState* play); void EnNy_DrawDeathEffect(Actor* thisx, PlayState* play); void func_80ABD3B8(EnNy* this, f32, f32); -ActorInit En_Ny_InitVars = { +ActorProfile En_Ny_Profile = { /**/ ACTOR_EN_NY, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -38,7 +38,7 @@ ActorInit En_Ny_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x04, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -51,7 +51,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sColliderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -99,8 +99,8 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_SPIKE, ICHAIN_CONTINUE), - ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 30, ICHAIN_STOP), }; void EnNy_Init(Actor* thisx, PlayState* play) { @@ -138,9 +138,9 @@ void EnNy_Init(Actor* thisx, PlayState* play) { // "Dummy new initials" PRINTF("ダミーニュウ イニシャル[ %d ] !!\n", this->actor.params); PRINTF("En_Ny_actor_move2[ %x ] !!\n", EnNy_UpdateUnused); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.update = EnNy_UpdateUnused; - this->collider.base.colType = COLTYPE_METAL; + this->collider.base.colMaterial = COL_MATERIAL_METAL; } } @@ -225,7 +225,7 @@ void EnNy_Move(EnNy* this, PlayState* play) { s32 stoneTimer; if (!(this->unk_1F0 < this->actor.depthInWater)) { - func_8002F974(&this->actor, NA_SE_EN_NYU_MOVE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_NYU_MOVE - SFX_FLAG); } func_80ABCD40(this); stoneTimer = this->stoneTimer; @@ -331,7 +331,7 @@ s32 EnNy_CollisionCheck(EnNy* this, PlayState* play) { this->stoneTimer = 0; if (this->actor.colChkInfo.health == 0) { this->actor.shape.shadowAlpha = 0; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->unk_1D0 = sp3F; Enemy_StartFinishingBlow(play, &this->actor); return 1; @@ -531,8 +531,7 @@ void EnNy_Draw(Actor* thisx, PlayState* play) { Collider_UpdateSpheres(0, &this->collider); func_8002ED80(&this->actor, play, 1); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ny.c", 845), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_ny.c", 845); gDPPipeSync(POLY_XLU_DISP++); gDPSetRenderMode(POLY_XLU_DISP++, G_RM_PASS, G_RM_AA_ZB_XLU_SURF2); gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->unk_1D8); @@ -545,8 +544,7 @@ void EnNy_Draw(Actor* thisx, PlayState* play) { Matrix_Scale(this->unk_1E0, this->unk_1E0, this->unk_1E0, MTXMODE_APPLY); func_8002EBCC(&this->actor, play, 1); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ny.c", 868), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_ny.c", 868); gSPDisplayList(POLY_OPA_DISP++, gEnNySpikeDL); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_ny.c", 872); @@ -584,8 +582,7 @@ void EnNy_DrawDeathEffect(Actor* thisx, PlayState* play) { Matrix_Translate(temp->x, temp->y, temp->z, MTXMODE_NEW); scale = this->actor.scale.x * 0.4f * (1.0f + (i * 0.04f)); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ny.c", 912), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_ny.c", 912); gSPDisplayList(POLY_OPA_DISP++, gEnNyRockBodyDL); } } diff --git a/src/overlays/actors/ovl_En_OE2/z_en_oe2.c b/src/overlays/actors/ovl_En_OE2/z_en_oe2.c index 641f47d0fd..f89eb3ce99 100644 --- a/src/overlays/actors/ovl_En_OE2/z_en_oe2.c +++ b/src/overlays/actors/ovl_En_OE2/z_en_oe2.c @@ -6,7 +6,7 @@ #include "z_en_oe2.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnOE2_Init(Actor* thisx, PlayState* play); void EnOE2_Destroy(Actor* thisx, PlayState* play); @@ -15,7 +15,7 @@ void EnOE2_Draw(Actor* thisx, PlayState* play); void EnOE2_DoNothing(EnOE2* this, PlayState* play); -ActorInit En_OE2_InitVars = { +ActorProfile En_OE2_Profile = { /**/ ACTOR_EN_OE2, /**/ ACTORCAT_NPC, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c index 9c15c270ad..7c3d6e11e9 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c @@ -6,6 +6,7 @@ #include "z_en_okarina_effect.h" #include "terminal.h" +#include "versions.h" #include "z64frame_advance.h" @@ -18,7 +19,7 @@ void EnOkarinaEffect_Update(Actor* thisx, PlayState* play); void EnOkarinaEffect_TriggerStorm(EnOkarinaEffect* this, PlayState* play); void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, PlayState* play); -ActorInit En_Okarina_Effect_InitVars = { +ActorProfile En_Okarina_Effect_Profile = { /**/ ACTOR_EN_OKARINA_EFFECT, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -38,8 +39,13 @@ void EnOkarinaEffect_Destroy(Actor* thisx, PlayState* play) { EnOkarinaEffect* this = (EnOkarinaEffect*)thisx; play->envCtx.precipitation[PRECIP_SOS_MAX] = 0; +#if OOT_VERSION < PAL_1_0 + if ((gWeatherMode == WEATHER_MODE_CLEAR) && (play->envCtx.stormRequest == STORM_REQUEST_START)) +#else if ((gWeatherMode != WEATHER_MODE_RAIN) && (gWeatherMode != WEATHER_MODE_HEAVY_RAIN) && - (play->envCtx.stormRequest == STORM_REQUEST_START)) { + (play->envCtx.stormRequest == STORM_REQUEST_START)) +#endif + { play->envCtx.stormRequest = STORM_REQUEST_STOP; Environment_StopStormNatureAmbience(play); } diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index ae781817e9..5fef46e214 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -8,6 +8,7 @@ #include "assets/scenes/misc/hakaana_ouke/hakaana_ouke_scene.h" #include "assets/scenes/overworld/spot02/spot02_scene.h" #include "terminal.h" +#include "versions.h" #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_25) @@ -22,7 +23,7 @@ void func_80ABF0CC(EnOkarinaTag* this, PlayState* play); void func_80ABF4C8(EnOkarinaTag* this, PlayState* play); void func_80ABF7CC(EnOkarinaTag* this, PlayState* play); -ActorInit En_Okarina_Tag_InitVars = { +ActorProfile En_Okarina_Tag_Profile = { /**/ ACTOR_EN_OKARINA_TAG, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -46,10 +47,10 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) { PRINTF("\n\n"); // "Ocarina tag outbreak" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ オカリナタグ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); - this->actor.flags &= ~ACTOR_FLAG_0; - this->type = (this->actor.params >> 0xA) & 0x3F; - this->ocarinaSong = (this->actor.params >> 6) & 0xF; - this->switchFlag = this->actor.params & 0x3F; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; + this->type = PARAMS_GET_U(this->actor.params, 10, 6); + this->ocarinaSong = PARAMS_GET_U(this->actor.params, 6, 4); + this->switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); if (this->switchFlag == 0x3F) { this->switchFlag = -1; } @@ -57,7 +58,7 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) { this->ocarinaSong = 0; this->unk_158 = 1; } - this->actor.targetMode = 1; + this->actor.attentionRangeType = ATTENTION_RANGE_1; if (this->actor.world.rot.z > 0) { this->interactRange = this->actor.world.rot.z * 40.0f; } @@ -116,7 +117,7 @@ void func_80ABEF2C(EnOkarinaTag* this, PlayState* play) { } if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else { if ((this->ocarinaSong != 6) || (gSaveContext.save.info.scarecrowSpawnSongSet)) { if (player->stateFlags2 & PLAYER_STATE2_24) { @@ -158,10 +159,14 @@ void func_80ABF0CC(EnOkarinaTag* this, PlayState* play) { if (play->sceneId == SCENE_WATER_TEMPLE) { play->msgCtx.msgMode = MSGMODE_PAUSED; } +#if OOT_VERSION < NTSC_1_1 + play->msgCtx.ocarinaMode = OCARINA_MODE_04; +#else if ((play->sceneId != SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC) && (play->sceneId != SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS)) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; } +#endif Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); this->actionFunc = func_80ABEF2C; return; @@ -198,7 +203,7 @@ void func_80ABF28C(EnOkarinaTag* this, PlayState* play) { if ((this->ocarinaSong != 6) || (gSaveContext.save.info.scarecrowSpawnSongSet)) { if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else if (((this->type != 4) || !GET_EVENTCHKINF(EVENTCHKINF_4B)) && ((this->type != 6) || !GET_EVENTCHKINF(EVENTCHKINF_1D)) && (this->actor.xzDistToPlayer < (90.0f + this->interactRange)) && diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 3b4bbb26fc..45b047f53f 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -1,7 +1,7 @@ #include "z_en_okuta.h" #include "assets/objects/object_okuta/object_okuta.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) void EnOkuta_Init(Actor* thisx, PlayState* play); void EnOkuta_Destroy(Actor* thisx, PlayState* play); @@ -19,7 +19,7 @@ void EnOkuta_Die(EnOkuta* this, PlayState* play); void EnOkuta_Freeze(EnOkuta* this, PlayState* play); void EnOkuta_ProjectileFly(EnOkuta* this, PlayState* play); -ActorInit En_Okuta_InitVars = { +ActorProfile En_Okuta_Profile = { /**/ ACTOR_EN_OKUTA, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -33,7 +33,7 @@ ActorInit En_Okuta_InitVars = { static ColliderCylinderInit sProjectileColliderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -41,7 +41,7 @@ static ColliderCylinderInit sProjectileColliderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_HARD, @@ -53,7 +53,7 @@ static ColliderCylinderInit sProjectileColliderInit = { static ColliderCylinderInit sOctorockColliderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -61,7 +61,7 @@ static ColliderCylinderInit sOctorockColliderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -110,7 +110,7 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_OCTOROK, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 6500, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 6500, ICHAIN_STOP), }; void EnOkuta_Init(Actor* thisx, PlayState* play) { @@ -121,7 +121,7 @@ void EnOkuta_Init(Actor* thisx, PlayState* play) { s32 floorBgId; Actor_ProcessInitChain(thisx, sInitChain); - this->numShots = (thisx->params >> 8) & 0xFF; + this->numShots = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if (thisx->params == 0) { SkelAnime_Init(play, &this->skelAnime, &gOctorokSkel, &gOctorokAppearAnim, this->jointTable, this->morphTable, @@ -145,7 +145,7 @@ void EnOkuta_Init(Actor* thisx, PlayState* play) { EnOkuta_SetupWaitToAppear(this); } else { ActorShape_Init(&thisx->shape, 1100.0f, ActorShadow_DrawCircle, 18.0f); - thisx->flags &= ~ACTOR_FLAG_0; + thisx->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; thisx->flags |= ACTOR_FLAG_4; Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, thisx, &sProjectileColliderInit); @@ -197,7 +197,7 @@ void EnOkuta_SpawnRipple(EnOkuta* this, PlayState* play) { void EnOkuta_SetupWaitToAppear(EnOkuta* this) { this->actor.draw = NULL; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnOkuta_WaitToAppear; this->actor.world.pos.y = this->actor.home.pos.y; } @@ -205,7 +205,7 @@ void EnOkuta_SetupWaitToAppear(EnOkuta* this) { void EnOkuta_SetupAppear(EnOkuta* this, PlayState* play) { this->actor.draw = EnOkuta_Draw; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; Animation_PlayOnce(&this->skelAnime, &gOctorokAppearAnim); EnOkuta_SpawnBubbles(this, play); this->actionFunc = EnOkuta_Appear; @@ -559,7 +559,7 @@ void EnOkuta_ColliderCheck(EnOkuta* this, PlayState* play) { if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { Enemy_StartFinishingBlow(play, &this->actor); this->actor.colChkInfo.health = 0; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if (this->actor.colChkInfo.damageEffect == 3) { EnOkuta_SetupFreeze(this); } else { @@ -578,7 +578,7 @@ void EnOkuta_Update(Actor* thisx, PlayState* play2) { Vec3f prevPos; s32 canRestorePrevPos; - if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29))) { + if (!(player->stateFlags1 & (PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29))) { if (this->actor.params == 0) { EnOkuta_ColliderCheck(this, play); if (!WaterBox_GetSurfaceImpl(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, @@ -715,8 +715,7 @@ void EnOkuta_Draw(Actor* thisx, PlayState* play) { Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); Matrix_RotateZ(BINANG_TO_RAD(this->actor.home.rot.z), MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_okuta.c", 1657), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_okuta.c", 1657); gSPDisplayList(POLY_OPA_DISP++, gOctorokProjectileDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_okuta.c", 1662); diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index aa931effef..596ef6fc23 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -14,7 +14,19 @@ #include "assets/objects/object_masterzoora/object_masterzoora.h" #include "assets/objects/object_masterkokirihead/object_masterkokirihead.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) + +#if !PLATFORM_GC +#define CURSOR_COLOR_R 0 +#define CURSOR_COLOR_G 80 +#define CURSOR_COLOR_B 255 +#define CURSOR_COLOR_A 255 +#else +#define CURSOR_COLOR_R 0 +#define CURSOR_COLOR_G 255 +#define CURSOR_COLOR_B 80 +#define CURSOR_COLOR_A 255 +#endif void EnOssan_Init(Actor* thisx, PlayState* play); void EnOssan_Destroy(Actor* thisx, PlayState* play); @@ -100,7 +112,7 @@ void EnOssan_SetStateGiveDiscountDialog(PlayState* play, EnOssan* this); #define CURSOR_INVALID 0xFF -ActorInit En_Ossan_InitVars = { +ActorProfile En_Ossan_Profile = { /**/ ACTOR_EN_OSSAN, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -115,14 +127,14 @@ ActorInit En_Ossan_InitVars = { // Unused collider static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE | ATELEM_SFX_NORMAL, @@ -157,7 +169,7 @@ static char* sShopkeeperPrintName[] = { }; #endif -typedef struct { +typedef struct ShopkeeperObjInfo { /* 0x00 */ s16 objId; /* 0x02 */ s16 unk_02; /* 0x04 */ s16 unk_04; @@ -188,7 +200,7 @@ static f32 sShopkeeperScale[] = { 0.01f, 0.011f, 0.0105f, 0.011f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, }; -typedef struct { +typedef struct ShopItem { /* 0x00 */ s16 shopItemIndex; /* 0x02 */ s16 xOffset; /* 0x04 */ s16 yOffset; @@ -312,8 +324,8 @@ static EnOssanGetGirlAParamsFunc sShopItemReplaceFunc[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 500, ICHAIN_STOP), }; // When selecting an item to buy, this is the position the item moves to @@ -1882,10 +1894,10 @@ void EnOssan_UpdateCursorAnim(EnOssan* this) { this->cursorAnimState = 0; } } - this->cursorColorR = ColChanMix(0, 0.0f, t); - this->cursorColorG = ColChanMix(255, 80.0f, t); - this->cursorColorB = ColChanMix(80, 0.0f, t); - this->cursorColorA = ColChanMix(255, 0.0f, t); + this->cursorColorR = ColChanMix(CURSOR_COLOR_R, 0.0f, t); + this->cursorColorG = ColChanMix(CURSOR_COLOR_G, 80.0f, t); + this->cursorColorB = ColChanMix(CURSOR_COLOR_B, 0.0f, t); + this->cursorColorA = ColChanMix(CURSOR_COLOR_A, 0.0f, t); this->cursorAnimTween = t; } @@ -2142,10 +2154,10 @@ void EnOssan_InitActionFunc(EnOssan* this, PlayState* play) { this->cursorIndex = 0; this->cursorZ = 1.5f; - this->cursorColorR = 0; - this->cursorColorG = 255; - this->cursorColorB = 80; - this->cursorColorA = 255; + this->cursorColorR = CURSOR_COLOR_R; + this->cursorColorG = CURSOR_COLOR_G; + this->cursorColorB = CURSOR_COLOR_B; + this->cursorColorA = CURSOR_COLOR_A; this->cursorAnimTween = 0; this->cursorAnimState = 0; @@ -2193,7 +2205,7 @@ void EnOssan_InitActionFunc(EnOssan* this, PlayState* play) { this->blinkTimer = 20; this->eyeTextureIdx = 0; this->blinkFunc = EnOssan_WaitForBlink; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnOssan_SetupAction(this, EnOssan_MainActionFunc); } } diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h index 236e47e866..c2101e9d9e 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -14,7 +14,7 @@ typedef void (*EnOssanInitFunc)(struct EnOssan*, PlayState*); typedef s16 (*EnOssanGetGirlAParamsFunc)(s16); typedef void (*EnOssanStateFunc)(struct EnOssan*, PlayState*, Player*); -typedef struct { +typedef struct StickDirectionPrompt { /* 0x00 */ u32 stickColorR; /* 0x04 */ u32 stickColorG; /* 0x08 */ u32 stickColorB; @@ -83,7 +83,7 @@ typedef struct EnOssan { /* 0x02D4 */ f32 cameraFaceAngle; // stored in degrees } EnOssan; // size = 0x02D8 -typedef enum { +typedef enum OssanType { /* 00 */ OSSAN_TYPE_KOKIRI, /* 01 */ OSSAN_TYPE_KAKARIKO_POTION, /* 02 */ OSSAN_TYPE_BOMBCHUS, @@ -97,7 +97,7 @@ typedef enum { /* 10 */ OSSAN_TYPE_MASK } OssanType; -typedef enum { +typedef enum EnOssanState { /* 00 */ OSSAN_STATE_IDLE, /* 01 */ OSSAN_STATE_START_CONVERSATION, /* 02 */ OSSAN_STATE_FACING_SHOPKEEPER, @@ -127,7 +127,7 @@ typedef enum { /* 26 */ OSSAN_STATE_DISCOUNT_DIALOG // Hylian Shield Discount } EnOssanState; -typedef enum { +typedef enum EnOssanHappyMaskState { OSSAN_HAPPY_STATE_REQUEST_PAYMENT_KEATON_MASK, OSSAN_HAPPY_STATE_REQUEST_PAYMENT_SPOOKY_MASK, OSSAN_HAPPY_STATE_REQUEST_PAYMENT_SKULL_MASK, diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index b67d863e31..78b170c63d 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -10,7 +10,7 @@ #include "assets/scenes/overworld/spot16/spot16_scene.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) void EnOwl_Init(Actor* thisx, PlayState* play); void EnOwl_Destroy(Actor* thisx, PlayState* play); @@ -44,7 +44,7 @@ void func_80ACB680(EnOwl* this, PlayState* play); void func_80ACC460(EnOwl* this); void func_80ACBEA0(EnOwl*, PlayState*); -typedef enum { +typedef enum EnOwlType { /* 0x00 */ OWL_DEFAULT, /* 0x01 */ OWL_OUTSIDE_KOKIRI, /* 0x02 */ OWL_HYRULE_CASTLE, @@ -60,12 +60,12 @@ typedef enum { /* 0x0C */ OWL_LOST_WOODS_POSTSARIA } EnOwlType; -typedef enum { +typedef enum EnOwlMessageChoice { /* 0x00 */ OWL_REPEAT, /* 0x01 */ OWL_OK } EnOwlMessageChoice; -ActorInit En_Owl_InitVars = { +ActorProfile En_Owl_Profile = { /**/ ACTOR_EN_OWL, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -79,7 +79,7 @@ ActorInit En_Owl_InitVars = { static ColliderCylinderInit sOwlCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, @@ -87,7 +87,7 @@ static ColliderCylinderInit sOwlCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -119,23 +119,23 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sOwlCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.minVelocityY = -10.0f; - this->actor.targetArrowOffset = 500.0f; + this->actor.lockOnArrowOffset = 500.0f; EnOwl_ChangeMode(this, EnOwl_WaitDefault, func_80ACC540, &this->skelAnime2, &gOwlPerchAnim, 0.0f); this->actionFlags = this->unk_406 = this->unk_409 = 0; this->unk_405 = 4; this->unk_404 = this->unk_407 = 0; this->unk_408 = 4; - owlType = (this->actor.params & 0xFC0) >> 6; - switchFlag = (this->actor.params & 0x3F); + owlType = PARAMS_GET_S(this->actor.params, 6, 6); + switchFlag = PARAMS_GET_S(this->actor.params, 0, 6); if (this->actor.params == 0xFFF) { owlType = OWL_OUTSIDE_KOKIRI; switchFlag = 0x20; } - // "conversation owl %4x no = %d, sv = %d" - PRINTF(VT_FGCOL(CYAN) " 会話フクロウ %4x no = %d, sv = %d\n" VT_RST, this->actor.params, owlType, switchFlag); + PRINTF(VT_FGCOL(CYAN) T(" 会話フクロウ %4x no = %d, sv = %d\n", " conversation owl %4x no = %d, sv = %d\n") VT_RST, + this->actor.params, owlType, switchFlag); if ((owlType != OWL_DEFAULT) && (switchFlag < 0x20) && Flags_GetSwitch(play, switchFlag)) { - PRINTF("savebitでフクロウ退避\n"); // "Save owl with savebit" + PRINTF(T("savebitでフクロウ退避\n", "Save owl with savebit\n")); Actor_Kill(&this->actor); return; } @@ -160,7 +160,7 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { case OWL_KAKARIKO: if (GET_EVENTCHKINF(EVENTCHKINF_40)) { // has zelda's letter - PRINTF("フクロウ退避\n"); // "Owl evacuation" + PRINTF(T("フクロウ退避\n", "Owl evacuation\n")); Actor_Kill(&this->actor); return; } @@ -170,7 +170,7 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { case OWL_HYLIA_GERUDO: if (GET_EVENTCHKINF(EVENTCHKINF_43)) { // has ocarina of time - PRINTF("フクロウ退避\n"); // "Owl evacuation" + PRINTF(T("フクロウ退避\n", "Owl evacuation\n")); Actor_Kill(&this->actor); return; } @@ -182,7 +182,7 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { case OWL_ZORA_RIVER: if (GET_EVENTCHKINF(EVENTCHKINF_39) || !GET_EVENTCHKINF(EVENTCHKINF_40)) { // opened zora's domain or has zelda's letter - PRINTF("フクロウ退避\n"); // "Owl evacuation" + PRINTF(T("フクロウ退避\n", "Owl evacuation\n")); Actor_Kill(&this->actor); return; } @@ -204,7 +204,7 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { break; case OWL_LOST_WOODS_PRESARIA: if (!CHECK_QUEST_ITEM(QUEST_SONG_LULLABY)) { - PRINTF("フクロウ退避\n"); // "Owl evacuation" + PRINTF(T("フクロウ退避\n", "Owl evacuation\n")); Actor_Kill(&this->actor); return; } @@ -212,7 +212,7 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { break; case OWL_LOST_WOODS_POSTSARIA: if (!CHECK_QUEST_ITEM(QUEST_SONG_SARIA)) { - PRINTF("フクロウ退避\n"); // "Owl evacuation" + PRINTF(T("フクロウ退避\n", "Owl evacuation\n")); Actor_Kill(&this->actor); return; } @@ -222,8 +222,8 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { // Outside kokiri forest PRINTF(VT_FGCOL(CYAN)); PRINTF("no = %d \n", owlType); - // "Unfinished owl unfinished owl unfinished owl" - PRINTF("未完成のフクロウ未完成のフクロウ未完成のフクロウ\n"); + PRINTF(T("未完成のフクロウ未完成のフクロウ未完成のフクロウ\n", + "Unfinished owl unfinished owl unfinished owl\n")); PRINTF(VT_RST); this->actionFlags |= 2; this->unk_3EE = 0x20; @@ -276,7 +276,7 @@ s32 EnOwl_CheckInitTalk(EnOwl* this, PlayState* play, u16 textId, f32 targetDist this->actor.textId = textId; distCheck = (flags & 2) ? 200.0f : 1000.0f; if (this->actor.xzDistToPlayer < targetDist) { - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Actor_OfferTalkExchange(&this->actor, play, targetDist, distCheck, EXCH_ITEM_NONE); } return false; @@ -302,7 +302,7 @@ void func_80ACA5C8(EnOwl* this) { } void func_80ACA62C(EnOwl* this, PlayState* play) { - s32 switchFlag = this->actor.params & 0x3F; + s32 switchFlag = PARAMS_GET_S(this->actor.params, 0, 6); if (switchFlag < 0x20) { Flags_SetSwitch(play, switchFlag); @@ -342,7 +342,7 @@ void func_80ACA76C(EnOwl* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 0); func_80ACA62C(this, play); - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } } @@ -358,7 +358,7 @@ void func_80ACA7E0(EnOwl* this, PlayState* play) { func_80ACA71C(this); this->actionFunc = func_80ACA690; } - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } } @@ -552,7 +552,7 @@ void func_80ACB03C(EnOwl* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 0); func_80ACA62C(this, play); - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } } @@ -728,7 +728,7 @@ void func_80ACB748(EnOwl* this, PlayState* play) { static Vec3f D_80ACD62C = { 0.0f, 0.0f, 0.0f }; f32 dist; f32 weight; - s32 owlType = (this->actor.params & 0xFC0) >> 6; + s32 owlType = PARAMS_GET_S(this->actor.params, 6, 6); dist = Math3D_Vec3f_DistXYZ(&this->eye, &play->view.eye) / 45.0f; this->eye.x = play->view.eye.x; @@ -926,14 +926,14 @@ void func_80ACC00C(EnOwl* this, PlayState* play) { if (this->actor.xzDistToPlayer < 50.0f) { if (!Play_InCsMode(play)) { - owlType = (this->actor.params & 0xFC0) >> 6; + owlType = PARAMS_GET_S(this->actor.params, 6, 6); PRINTF(VT_FGCOL(CYAN)); - PRINTF("%dのフクロウ\n", owlType); // "%d owl" + PRINTF(T("%dのフクロウ\n", "%d owl\n"), owlType); PRINTF(VT_RST); switch (owlType) { case 7: PRINTF(VT_FGCOL(CYAN)); - PRINTF("SPOT 06 の デモがはしった\n"); // "Demo of SPOT 06 has been completed" + PRINTF(T("SPOT 06 の デモがはしった\n", "Demo of SPOT 06 has been completed\n")); PRINTF(VT_RST); play->csCtx.script = SEGMENTED_TO_VIRTUAL(gLakeHyliaOwlCs); this->actor.draw = NULL; @@ -1057,7 +1057,7 @@ s32 func_80ACC5CC(EnOwl* this) { } s32 func_80ACC624(EnOwl* this, PlayState* play) { - s32 switchFlag = (this->actor.params & 0xFC0) >> 6; + s32 switchFlag = PARAMS_GET_S(this->actor.params, 6, 6); if (play->sceneId != SCENE_DESERT_COLOSSUS) { return true; @@ -1084,8 +1084,8 @@ void EnOwl_Update(Actor* thisx, PlayState* play) { this->actionFlags &= ~8; this->actionFunc(this, play); if (this->actor.update == NULL) { - // "Owl disappears" - PRINTF("フクロウ消滅!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("フクロウ消滅!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n", + "Owl disappears!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n")); return; } diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.c b/src/overlays/actors/ovl_En_Part/z_en_part.c index 63219d2f0c..9651575806 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.c +++ b/src/overlays/actors/ovl_En_Part/z_en_part.c @@ -15,7 +15,7 @@ void EnPart_Destroy(Actor* thisx, PlayState* play); void EnPart_Update(Actor* thisx, PlayState* play); void EnPart_Draw(Actor* thisx, PlayState* play); -ActorInit En_Part_InitVars = { +ActorProfile En_Part_Profile = { /**/ ACTOR_EN_PART, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -196,8 +196,9 @@ void func_80ACE5C8(EnPart* this, PlayState* play) { play->damagePlayer(play, -8); } } - func_8002F71C(play, this->actor.parent, (650.0f - this->actor.parent->xzDistToPlayer) * 0.04f + 4.0f, - this->actor.parent->world.rot.y, 8.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, this->actor.parent, + (650.0f - this->actor.parent->xzDistToPlayer) * 0.04f + 4.0f, + this->actor.parent->world.rot.y, 8.0f); player->invincibilityTimer = prevInvincibilityTimer; this->timer = 1; } @@ -313,8 +314,7 @@ void EnPart_Draw(Actor* thisx, PlayState* play) { } if (this->displayList != NULL) { - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_part.c", 696), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_part.c", 696); gSPDisplayList(POLY_OPA_DISP++, this->displayList); } diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 8fa9e1a490..2543995736 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -3,7 +3,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_24) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_24) #define GROUND_HOVER_HEIGHT 75.0f #define MAX_LARVA 3 @@ -40,7 +40,7 @@ void EnPeehat_Adult_StateDie(EnPeehat* this, PlayState* play); void EnPeehat_SetStateExplode(EnPeehat* this); void EnPeehat_StateExplode(EnPeehat* this, PlayState* play); -ActorInit En_Peehat_InitVars = { +ActorProfile En_Peehat_Profile = { /**/ ACTOR_EN_PEEHAT, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -54,7 +54,7 @@ ActorInit En_Peehat_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_WOOD, + COL_MATERIAL_WOOD, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -62,7 +62,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -75,7 +75,7 @@ static ColliderCylinderInit sCylinderInit = { static ColliderJntSphElementInit sJntSphElemInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -88,7 +88,7 @@ static ColliderJntSphElementInit sJntSphElemInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -101,7 +101,7 @@ static ColliderJntSphInit sJntSphInit = { static ColliderQuadInit sQuadInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, @@ -109,7 +109,7 @@ static ColliderQuadInit sQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -119,7 +119,7 @@ static ColliderQuadInit sQuadInit = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -typedef enum { +typedef enum DamageEffect { /* 00 */ PEAHAT_DMG_EFF_ATTACK = 0, /* 06 */ PEAHAT_DMG_EFF_LIGHT_ICE_ARROW = 6, /* 12 */ PEAHAT_DMG_EFF_FIRE = 12, @@ -163,7 +163,7 @@ static DamageTable sDamageTable = { /* Unknown 2 */ DMG_ENTRY(0, PEAHAT_DMG_EFF_ATTACK), }; -typedef enum { +typedef enum PeahatState { /* 00 */ PEAHAT_STATE_DYING, /* 01 */ PEAHAT_STATE_EXPLODE, /* 03 */ PEAHAT_STATE_3 = 3, @@ -180,7 +180,7 @@ typedef enum { } PeahatState; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 700, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 700, ICHAIN_STOP), }; void EnPeehat_SetupAction(EnPeehat* this, EnPeehatActionFunc actionFunc) { @@ -223,7 +223,7 @@ void EnPeehat_Init(Actor* thisx, PlayState* play) { this->xzDistToRise = 2800.0f; this->xzDistMax = 1400.0f; EnPeehat_Flying_SetStateGround(this); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; break; case PEAHAT_TYPE_LARVA: this->actor.scale.x = this->actor.scale.z = 0.006f; @@ -322,7 +322,7 @@ void EnPeehat_Ground_SetStateGround(EnPeehat* this) { void EnPeehat_Ground_StateGround(EnPeehat* this, PlayState* play) { if (IS_DAY) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; if (this->riseDelayTimer == 0) { if (this->actor.xzDistToPlayer < this->xzDistToRise) { EnPeehat_Ground_SetStateRise(this); @@ -332,7 +332,7 @@ void EnPeehat_Ground_StateGround(EnPeehat* this, PlayState* play) { this->riseDelayTimer--; } } else { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Math_SmoothStepToF(&this->actor.shape.yOffset, -1000.0f, 1.0f, 50.0f, 0.0f); if (this->unk_2D4 != 0) { this->unk_2D4--; @@ -1021,8 +1021,7 @@ s32 EnPeehat_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f Matrix_RotateZ(-(this->jiggleRot * 0.1f), MTXMODE_APPLY); Matrix_RotateY(-(this->jiggleRot * 0.13f), MTXMODE_APPLY); Matrix_RotateX(-(this->jiggleRot * 0.115f), MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_peehat.c", 1959), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_peehat.c", 1959); gSPDisplayList(POLY_OPA_DISP++, *dList); Matrix_Pop(); CLOSE_DISPS(play->state.gfxCtx, "../z_en_peehat.c", 1963); @@ -1055,8 +1054,7 @@ void EnPeehat_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* r } Matrix_RotateY(3.2f + damageYRot, MTXMODE_APPLY); Matrix_Scale(0.3f, 0.2f, 0.2f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_peehat.c", 1990), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_peehat.c", 1990); gSPDisplayList(POLY_OPA_DISP++, *dList); Matrix_Pop(); CLOSE_DISPS(play->state.gfxCtx, "../z_en_peehat.c", 1994); diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h index 706ec34bb1..2449fc3405 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef enum { +typedef enum PeahatType { /* -1 */ PEAHAT_TYPE_GROUNDED = -1, /* 0 */ PEAHAT_TYPE_FLYING = 0, /* 1 */ PEAHAT_TYPE_LARVA = 1 diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index 3f814e796d..d6c5348862 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -19,7 +19,7 @@ void EnPoDesert_WaitForPlayer(EnPoDesert* this, PlayState* play); void EnPoDesert_MoveToNextPoint(EnPoDesert* this, PlayState* play); void EnPoDesert_Disappear(EnPoDesert* this, PlayState* play); -ActorInit En_Po_Desert_InitVars = { +ActorProfile En_Po_Desert_Profile = { /**/ ACTOR_EN_PO_DESERT, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -33,7 +33,7 @@ ActorInit En_Po_Desert_InitVars = { static ColliderCylinderInit sColliderInit = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -41,7 +41,7 @@ static ColliderCylinderInit sColliderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -54,7 +54,7 @@ static ColliderCylinderInit sColliderInit = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_POE_WASTELAND, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 3200, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 3200, ICHAIN_STOP), }; void EnPoDesert_Init(Actor* thisx, PlayState* play) { @@ -74,7 +74,7 @@ void EnPoDesert_Init(Actor* thisx, PlayState* play) { 255, 255, 255, 200); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 37.0f); this->currentPathPoint = 1; - this->actor.params = (this->actor.params >> 8) & 0xFF; + this->actor.params = PARAMS_GET_U(this->actor.params, 8, 8); this->targetY = this->actor.world.pos.y; EnPoDesert_SetNextPathPoint(this, play); } @@ -130,7 +130,7 @@ void EnPoDesert_UpdateSpeedModifier(EnPoDesert* this) { } void EnPoDesert_WaitForPlayer(EnPoDesert* this, PlayState* play) { - func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); if (this->actor.xzDistToPlayer < 200.0f && (this->currentPathPoint != 2 || play->actorCtx.lensActive)) { if (this->currentPathPoint == 2) { if (Play_InCsMode(play)) { @@ -161,7 +161,7 @@ void EnPoDesert_MoveToNextPoint(EnPoDesert* this, PlayState* play) { this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y + 0x8000, 5, 0x400); this->actor.speed = sinf(this->speedModifier * (M_PI / 32.0f)) * 2.5f + 5.5f; - func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); this->targetY = this->actor.home.pos.y - ((temp_f20 * this->yDiff) / this->initDistToNextPoint); if (temp_f20 < 40.0f) { if (this->currentPathPoint != 0) { @@ -197,11 +197,11 @@ void EnPoDesert_Update(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); if (play->actorCtx.lensActive) { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_REACT_TO_LENS; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_REACT_TO_LENS; this->actor.shape.shadowDraw = ActorShadow_DrawCircle; } else { this->actor.shape.shadowDraw = NULL; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_REACT_TO_LENS); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_REACT_TO_LENS); } } @@ -237,8 +237,7 @@ void EnPoDesert_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { gDPPipeSync((*gfxP)++); gDPSetEnvColor((*gfxP)++, color.r, color.g, color.b, 255); - gSPMatrix((*gfxP)++, MATRIX_NEW(play->state.gfxCtx, "../z_en_po_desert.c", 523), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD((*gfxP)++, play->state.gfxCtx, "../z_en_po_desert.c", 523); gSPDisplayList((*gfxP)++, gPoeFieldLanternDL); gSPDisplayList((*gfxP)++, gPoeFieldLanternTopDL); gDPPipeSync((*gfxP)++); diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index f67ce8d4ef..8c694c46fd 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -8,7 +8,8 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_po_field/object_po_field.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_IGNORE_QUAKE) +#define FLAGS \ + (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_IGNORE_QUAKE) void EnPoField_Init(Actor* thisx, PlayState* play); void EnPoField_Destroy(Actor* thisx, PlayState* play); @@ -33,7 +34,7 @@ void EnPoField_SoulDisappear(EnPoField* this, PlayState* play); void EnPoField_SoulInteract(EnPoField* this, PlayState* play); void EnPoField_SpawnFlame(EnPoField* this); -ActorInit En_Po_Field_InitVars = { +ActorProfile En_Po_Field_Profile = { /**/ ACTOR_EN_PO_FIELD, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -47,7 +48,7 @@ ActorInit En_Po_Field_InitVars = { static ColliderCylinderInit D_80AD7080 = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -55,7 +56,7 @@ static ColliderCylinderInit D_80AD7080 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -67,7 +68,7 @@ static ColliderCylinderInit D_80AD7080 = { static ColliderCylinderInit D_80AD70AC = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -75,7 +76,7 @@ static ColliderCylinderInit D_80AD70AC = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -127,7 +128,7 @@ static s32 sNumSpawned = 0; static Vec3f sFieldMiddle = { -1000.0f, 0.0f, 6500.0f }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 3200, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 3200, ICHAIN_STOP), }; static Vec3f D_80AD7114 = { 0.0f, 3.0f, 0.0f }; @@ -141,6 +142,8 @@ static EnPoFieldInfo sPoFieldInfo[2] = { static Vec3f D_80AD714C = { 0.0f, 1400.0f, 0.0f }; +#pragma increment_block_number "gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128 ntsc-1.2:128" + static Vec3s sSpawnPositions[10]; static u8 sSpawnSwitchFlags[10]; static MtxF sLimb7Mtx; @@ -153,7 +156,7 @@ void EnPoField_Init(Actor* thisx, PlayState* play) { sSpawnPositions[sNumSpawned].x = this->actor.world.pos.x; sSpawnPositions[sNumSpawned].y = this->actor.world.pos.y; sSpawnPositions[sNumSpawned].z = this->actor.world.pos.z; - sSpawnSwitchFlags[sNumSpawned] = this->actor.params & 0xFF; + sSpawnSwitchFlags[sNumSpawned] = PARAMS_GET_U(this->actor.params, 0, 8); sNumSpawned++; } if (sNumSpawned >= 2) { @@ -192,7 +195,7 @@ void EnPoField_SetupWaitForSpawn(EnPoField* this, PlayState* play) { Lights_PointSetColorAndRadius(&this->lightInfo, 0, 0, 0, 0); this->actionTimer = 200; Actor_SetScale(&this->actor, 0.0f); - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_16); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED); this->collider.base.acFlags &= ~AC_ON; this->collider.base.ocFlags1 = OC1_ON | OC1_TYPE_ALL; this->actor.colChkInfo.health = D_80AD70D8.health; @@ -241,7 +244,7 @@ void EnPoField_SetupCirclePlayer(EnPoField* this, PlayState* play) { Math_Vec3f_Copy(&this->actor.home.pos, &player->actor.world.pos); this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (this->actionFunc != EnPoField_Damage) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actionTimer = 600; this->unk_194 = 32; } @@ -254,7 +257,7 @@ void EnPoField_SetupFlee(EnPoField* this) { this->actionFunc = EnPoField_Flee; this->actor.speed = 12.0f; if (this->actionFunc != EnPoField_Damage) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000; this->actionTimer = 2000; this->unk_194 = 32; @@ -276,7 +279,7 @@ void EnPoField_SetupDamage(EnPoField* this) { void EnPoField_SetupDeath(EnPoField* this) { this->actionTimer = 0; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.naviEnemyId = NAVI_ENEMY_NONE; @@ -342,7 +345,7 @@ void func_80AD4384(EnPoField* this) { this->actor.textId = 0x5005; this->actionTimer = 400; this->unk_194 = 32; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = func_80AD58D4; } @@ -494,7 +497,7 @@ void EnPoField_CirclePlayer(EnPoField* this, PlayState* play) { EnPoField_SpawnFlame(this); } EnPoField_CorrectYPos(this, play); - func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); } void EnPoField_Flee(EnPoField* this, PlayState* play) { @@ -522,7 +525,7 @@ void EnPoField_Flee(EnPoField* this, PlayState* play) { } else { EnPoField_CorrectYPos(this, play); } - func_8002F974(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); } void EnPoField_Damage(EnPoField* this, PlayState* play) { @@ -652,15 +655,15 @@ void func_80AD58D4(EnPoField* this, PlayState* play) { } if (this->actionTimer == 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH); - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; EnPoField_SetupSoulDisappear(this); return; } if (this->collider.base.ocFlags1 & OC1_HIT) { - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play); } else { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } this->actor.world.pos.y = Math_SinS(this->unk_194 * 0x800) * 5.0f + this->actor.home.pos.y; @@ -689,7 +692,7 @@ void EnPoField_SoulInteract(EnPoField* this, PlayState* play) { if (this->actor.textId != 0x5005) { EnPoField_SoulUpdateProperties(this, -13); } else { - func_8002F974(&this->actor, NA_SE_EN_PO_BIG_CRY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_BIG_CRY - SFX_FLAG); } if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) { if (Message_ShouldAdvance(play)) { @@ -792,12 +795,9 @@ void EnPoField_DrawFlame(EnPoField* this, PlayState* play) { Matrix_Scale((this->flameScale * 0.7f) + 0.00090000004f, (0.003f - this->flameScale) + 0.003f, 0.003f, MTXMODE_APPLY); } - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_po_field.c", 1709), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_po_field.c", 1709); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_en_po_field.c", 1712); } } @@ -897,8 +897,7 @@ void EnPoField_PostLimDraw2(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* EnPoField* this = (EnPoField*)thisx; if (this->actionFunc == EnPoField_Death && this->actionTimer >= 2 && limbIndex == 8) { - gSPMatrix((*gfxP)++, MATRIX_NEW(play->state.gfxCtx, "../z_en_po_field.c", 1916), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD((*gfxP)++, play->state.gfxCtx, "../z_en_po_field.c", 1916); gSPDisplayList((*gfxP)++, gPoeFieldBurnDL); } if (limbIndex == 7) { @@ -949,8 +948,7 @@ void EnPoField_Draw(Actor* thisx, PlayState* play) { gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, this->soulColor.r, this->soulColor.g, this->soulColor.b, 255); Matrix_Put(&sLimb7Mtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_po_field.c", 2033), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_po_field.c", 2033); gSPDisplayList(POLY_OPA_DISP++, gPoeFieldLanternDL); gSPDisplayList(POLY_OPA_DISP++, gPoeFieldLanternTopDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_po_field.c", 2039); @@ -981,8 +979,7 @@ void EnPoField_DrawSoul(Actor* thisx, PlayState* play) { Lights_PointGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->soulColor.r, this->soulColor.g, this->soulColor.b, 200); gDPSetEnvColor(POLY_OPA_DISP++, this->soulColor.r, this->soulColor.g, this->soulColor.b, 255); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_po_field.c", 2104), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_po_field.c", 2104); gSPDisplayList(POLY_OPA_DISP++, gPoeFieldLanternDL); gSPDisplayList(POLY_OPA_DISP++, gPoeFieldLanternTopDL); } else { @@ -995,13 +992,10 @@ void EnPoField_DrawSoul(Actor* thisx, PlayState* play) { this->lightColor.a); gDPSetEnvColor(POLY_XLU_DISP++, this->lightColor.r, this->lightColor.g, this->lightColor.b, 255); Matrix_RotateY((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x8000) * 9.58738e-05f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_po_field.c", 2143), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_po_field.c", 2143); gSPDisplayList(POLY_XLU_DISP++, gPoeFieldSoulDL); } - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_en_po_field.c", 2149); EnPoField_DrawFlame(this, play); } diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h index 7f5273e744..f07a9233d7 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h @@ -8,12 +8,12 @@ struct EnPoField; typedef void (*EnPoFieldActionFunc)(struct EnPoField*, PlayState*); -typedef enum { +typedef enum EnPoFieldSize { EN_PO_FIELD_SMALL, EN_PO_FIELD_BIG } EnPoFieldSize; -typedef struct { +typedef struct EnPoFieldInfo { /* 0x0000 */ Color_RGB8 primColor; /* 0x0003 */ Color_RGB8 lightColor; /* 0x0006 */ Color_RGB8 envColor; diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index 4106c8f0cd..e79cec70c7 100644 --- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -8,7 +8,9 @@ #include "overlays/actors/ovl_En_Honotrap/z_en_honotrap.h" #include "assets/objects/object_tk/object_tk.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_16) +#define FLAGS \ + (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_IGNORE_QUAKE | \ + ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED) void EnPoRelay_Init(Actor* thisx, PlayState* play); void EnPoRelay_Destroy(Actor* thisx, PlayState* play); @@ -33,7 +35,7 @@ static Vec3s D_80AD8C30[] = { { 0x0B4E, 0xFE66, 0xF87E }, { 0x0B4A, 0xFE66, 0xF97A }, { 0x0B4A, 0xFE98, 0xF9FC }, { 0x0BAE, 0xFE98, 0xF9FC }, }; -ActorInit En_Po_Relay_InitVars = { +ActorProfile En_Po_Relay_Profile = { /**/ ACTOR_EN_PO_RELAY, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -47,7 +49,7 @@ ActorInit En_Po_Relay_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -55,7 +57,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -69,7 +71,7 @@ static s32 D_80AD8D24 = 0; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_DAMPES_GHOST, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 1500, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 1500, ICHAIN_STOP), }; static Vec3f D_80AD8D30 = { 0.0f, 1.5f, 0.0f }; @@ -140,14 +142,14 @@ void EnPoRelay_SetupRace(EnPoRelay* this) { Interface_SetTimer(0); this->hookshotSlotFull = INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE; this->unk_19A = Actor_WorldYawTowardPoint(&this->actor, &vec); - this->actor.flags |= ACTOR_FLAG_27; + this->actor.flags |= ACTOR_FLAG_LOCK_ON_DISABLED; Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH); this->actionFunc = EnPoRelay_Race; } void EnPoRelay_SetupEndRace(EnPoRelay* this) { this->actor.world.rot.y = this->actor.home.rot.y + 0xC000; - this->actor.flags &= ~ACTOR_FLAG_27; + this->actor.flags &= ~ACTOR_FLAG_LOCK_ON_DISABLED; this->actor.speed = 0.0f; this->actionFunc = EnPoRelay_EndRace; } @@ -160,14 +162,14 @@ void EnPoRelay_CorrectY(EnPoRelay* this) { void EnPoRelay_Idle(EnPoRelay* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100); if (Actor_TalkOfferAccepted(&this->actor, play)) { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->actionFunc = EnPoRelay_Talk; } else if (this->actor.xzDistToPlayer < 250.0f) { - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->actor.textId = this->textId; Actor_OfferTalk(&this->actor, play, 250.0f); } - func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); } void EnPoRelay_Talk(EnPoRelay* this, PlayState* play) { @@ -177,7 +179,7 @@ void EnPoRelay_Talk(EnPoRelay* this, PlayState* play) { this->textId = this->actor.textId; EnPoRelay_SetupRace(this); } - func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); } void EnPoRelay_Race(EnPoRelay* this, PlayState* play) { @@ -249,7 +251,7 @@ void EnPoRelay_Race(EnPoRelay* this, PlayState* play) { } } this->unk_19A = Actor_WorldYawTowardPoint(&this->actor, &vec); - func_8002F974(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); } void EnPoRelay_EndRace(EnPoRelay* this, PlayState* play) { @@ -263,7 +265,7 @@ void EnPoRelay_EndRace(EnPoRelay* this, PlayState* play) { this->actor.textId = this->textId; Actor_OfferTalk(&this->actor, play, 250.0f); } - func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); } void EnPoRelay_Talk2(EnPoRelay* this, PlayState* play) { @@ -283,7 +285,7 @@ void EnPoRelay_Talk2(EnPoRelay* this, PlayState* play) { this->actionTimer = 0; this->actionFunc = EnPoRelay_DisappearAndReward; } - func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); } void EnPoRelay_DisappearAndReward(EnPoRelay* this, PlayState* play) { @@ -385,15 +387,13 @@ void EnPoRelay_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, this->lightColor.r, this->lightColor.g, this->lightColor.b, 128); gSPDisplayList(POLY_OPA_DISP++, gDampeLanternDL); - if (1) {} CLOSE_DISPS(play->state.gfxCtx, "../z_en_po_relay.c", 901); Matrix_MultVec3f(&D_80AD8D48, &vec); Lights_PointNoGlowSetInfo(&this->lightInfo, vec.x, vec.y, vec.z, this->lightColor.r, this->lightColor.g, this->lightColor.b, 200); } else if (limbIndex == 8) { OPEN_DISPS(play->state.gfxCtx, "../z_en_po_relay.c", 916); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_po_relay.c", 918), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_po_relay.c", 918); gSPDisplayList(POLY_OPA_DISP++, gDampeHaloDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_po_relay.c", 922); } diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 1315e00b98..a648327dc6 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -8,7 +8,9 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_po_sisters/object_po_sisters.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_9 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_14) +#define FLAGS \ + (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_9 | ACTOR_FLAG_IGNORE_QUAKE | \ + ACTOR_FLAG_14) void EnPoSisters_Init(Actor* thisx, PlayState* play); void EnPoSisters_Destroy(Actor* thisx, PlayState* play); @@ -61,7 +63,7 @@ static Color_RGBA8 D_80ADD700[4] = { { 0, 150, 0, 255 }, }; -ActorInit En_Po_Sisters_InitVars = { +ActorProfile En_Po_Sisters_Profile = { /**/ ACTOR_EN_PO_SISTERS, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -75,7 +77,7 @@ ActorInit En_Po_Sisters_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -83,7 +85,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x4FC7FFEA, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -134,7 +136,7 @@ static s32 D_80ADD784 = 0; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 7, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 6000, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 6000, ICHAIN_STOP), }; static Vec3f sZeroVector = { 0.0f, 0.0f, 0.0f }; @@ -191,17 +193,17 @@ void EnPoSisters_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - this->unk_194 = (thisx->params >> 8) & 3; + this->unk_194 = PARAMS_GET_U(thisx->params, 8, 2); this->actor.naviEnemyId = this->unk_194 + NAVI_ENEMY_POE_SISTER_MEG; if (1) {} - this->unk_195 = (thisx->params >> 0xA) & 3; + this->unk_195 = PARAMS_GET_U(thisx->params, 10, 2); this->unk_196 = 32; this->unk_197 = 20; this->unk_198 = 1; this->unk_199 = 32; this->unk_294 = 110.0f; - this->actor.flags &= ~ACTOR_FLAG_0; - if (this->actor.params & 0x1000) { + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; + if (PARAMS_GET_NOSHIFT(this->actor.params, 12, 1)) { func_80ADA094(this, play); } else if (this->unk_194 == 0) { if (this->unk_195 == 0) { @@ -209,7 +211,7 @@ void EnPoSisters_Init(Actor* thisx, PlayState* play) { func_80AD9AA8(this, play); } else { this->actor.flags &= ~(ACTOR_FLAG_9 | ACTOR_FLAG_14); - this->collider.elem.elemType = ELEMTYPE_UNK4; + this->collider.elem.elemMaterial = ELEM_MATERIAL_UNK4; this->collider.elem.acDmgInfo.dmgFlags |= DMG_DEKU_NUT; this->collider.base.ocFlags1 = OC1_NONE; func_80AD9C24(this, NULL); @@ -265,7 +267,7 @@ void func_80AD943C(EnPoSisters* this) { void func_80AD944C(EnPoSisters* this) { if (this->unk_22E.a != 0) { - this->collider.base.colType = COLTYPE_METAL; + this->collider.base.colMaterial = COL_MATERIAL_METAL; this->collider.base.acFlags |= AC_HARD; } Animation_MorphToLoop(&this->skelAnime, &gPoeSistersAttackAnim, -5.0f); @@ -278,7 +280,7 @@ void func_80AD944C(EnPoSisters* this) { void func_80AD94E0(EnPoSisters* this) { this->actor.speed = 5.0f; if (this->unk_194 == 0) { - this->collider.base.colType = COLTYPE_METAL; + this->collider.base.colMaterial = COL_MATERIAL_METAL; this->collider.base.acFlags |= AC_HARD; Animation_MorphToLoop(&this->skelAnime, &gPoeSistersAttackAnim, -5.0f); } @@ -292,7 +294,7 @@ void func_80AD9568(EnPoSisters* this) { Animation_MorphToLoop(&this->skelAnime, &gPoeSistersFloatAnim, -3.0f); this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; if (this->unk_194 != 0) { - this->collider.base.colType = COLTYPE_HIT3; + this->collider.base.colMaterial = COL_MATERIAL_HIT3; this->collider.base.acFlags &= ~AC_HARD; } this->actionFunc = func_80ADA9E8; @@ -376,7 +378,7 @@ void func_80AD99D4(EnPoSisters* this, PlayState* play) { this->actor.speed = 0.0f; this->actor.world.pos.y += 42.0f; this->actor.shape.yOffset = -6000.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->unk_199 = 0; this->actionFunc = func_80ADAFC0; OnePointCutscene_Init(play, 3190, 999, &this->actor, CAM_ID_MAIN); @@ -426,10 +428,10 @@ void func_80AD9C24(EnPoSisters* this, PlayState* play) { Vec3f vec; this->actor.draw = NULL; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->unk_19C = 100; this->unk_199 = 32; - this->collider.base.colType = COLTYPE_HIT3; + this->collider.base.colMaterial = COL_MATERIAL_HIT3; this->collider.base.acFlags &= ~AC_HARD; if (play != NULL) { vec.x = this->actor.world.pos.x; @@ -485,7 +487,7 @@ void func_80AD9F1C(EnPoSisters* this) { this->unk_19A = 300; this->unk_19C = 3; this->unk_199 |= 9; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = func_80ADB770; } @@ -507,7 +509,7 @@ void func_80ADA028(EnPoSisters* this) { Animation_MorphToLoop(&this->skelAnime, &gPoeSistersSwayAnim, -3.0f); this->unk_22E.a = 255; this->unk_199 |= 0x15; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = func_80ADBBF4; this->actor.speed = 0.0f; } @@ -589,9 +591,9 @@ void func_80ADA35C(EnPoSisters* this, PlayState* play) { this->actor.world.pos.y += (2.0f + 0.5f * Rand_ZeroOne()) * Math_SinS(this->unk_196 * 0x800); if (this->unk_22E.a == 255 && this->actionFunc != func_80ADA8C0 && this->actionFunc != func_80ADA7F0) { if (this->actionFunc == func_80ADAC70) { - func_8002F974(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); } else { - func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); } } } @@ -671,7 +673,7 @@ void func_80ADA8C0(EnPoSisters* this, PlayState* play) { this->actor.shape.rot.y += (384.0f * this->skelAnime.endFrame) * 3.0f; if (this->unk_19A == 0 && ABS((s16)(this->actor.shape.rot.y - this->actor.world.rot.y)) < 0x1000) { if (this->unk_194 != 0) { - this->collider.base.colType = COLTYPE_HIT3; + this->collider.base.colMaterial = COL_MATERIAL_HIT3; this->collider.base.acFlags &= ~AC_HARD; func_80AD93C4(this); } else { @@ -997,7 +999,7 @@ void func_80ADB9F0(EnPoSisters* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { this->unk_22E.a = 255; if (this->unk_194 == 3) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.home.pos.x = 1992.0f; this->actor.home.pos.z = -1440.0f; this->unk_199 |= 0x18; @@ -1048,7 +1050,7 @@ void func_80ADBC88(EnPoSisters* this, PlayState* play) { func_80ADA10C(this); } } - func_8002F974(&this->actor, NA_SE_EV_TORCH - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_TORCH - SFX_FLAG); } void func_80ADBD38(EnPoSisters* this, PlayState* play) { @@ -1108,7 +1110,7 @@ void func_80ADBF58(EnPoSisters* this, PlayState* play) { } void func_80ADC034(EnPoSisters* this, PlayState* play) { - if (this->actor.isTargeted && this->unk_22E.a == 255) { + if (this->actor.isLockedOn && this->unk_22E.a == 255) { if (this->unk_197 != 0) { this->unk_197--; } @@ -1145,7 +1147,7 @@ void func_80ADC10C(EnPoSisters* this, PlayState* play) { sp24.z = this->actor.world.pos.z; Item_DropCollectible(play, &sp24, ITEM00_ARROWS_SMALL); } - } else if (this->collider.base.colType == 9 || + } else if (this->collider.base.colMaterial == COL_MATERIAL_METAL || (this->actor.colChkInfo.damageEffect == 0 && this->actor.colChkInfo.damage == 0)) { if (this->unk_194 == 0) { this->actor.freezeTimer = 0; @@ -1302,8 +1304,7 @@ void EnPoSisters_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s s32 pad; if (this->actionFunc == func_80ADAFC0 && this->unk_19A >= 8 && limbIndex == 9) { - gSPMatrix((*gfxP)++, MATRIX_NEW(play->state.gfxCtx, "../z_en_po_sisters.c", 2876), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD((*gfxP)++, play->state.gfxCtx, "../z_en_po_sisters.c", 2876); gSPDisplayList((*gfxP)++, gPoSistersBurnDL); } if (limbIndex == 8 && this->actionFunc != func_80ADB2B8) { @@ -1340,13 +1341,13 @@ void EnPoSisters_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s void EnPoSisters_Draw(Actor* thisx, PlayState* play) { EnPoSisters* this = (EnPoSisters*)thisx; - u8 phi_s5; + s32 pad1; f32 phi_f20; s32 i; - u8 spE7; + u8 phi_s5; Color_RGBA8* temp_s1 = &D_80ADD700[this->unk_194]; Color_RGBA8* temp_s7 = &D_80ADD6F0[this->unk_194]; - s32 pad; + s32 pad2; OPEN_DISPS(play->state.gfxCtx, "../z_en_po_sisters.c", 2989); func_80ADC55C(this); @@ -1367,8 +1368,7 @@ void EnPoSisters_Draw(Actor* thisx, PlayState* play) { } if (!(this->unk_199 & 0x80)) { Matrix_Put(&this->unk_2F8); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_po_sisters.c", 3034), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_po_sisters.c", 3034); gSPDisplayList(POLY_OPA_DISP++, gPoSistersTorchDL); } gSPSegment(POLY_XLU_DISP++, 0x08, @@ -1390,11 +1390,10 @@ void EnPoSisters_Draw(Actor* thisx, PlayState* play) { phi_s5 = ((32 - this->unk_19A) * 255) / 32; phi_f20 = 0.0035f; } else if (this->actionFunc == func_80ADBC88) { - //! @bug uninitialised spE7 - phi_s5 = spE7; + // phi_s5 initialized in loop below phi_f20 = 0.0027f; } else { - phi_s5 = spE7; + // phi_s5 initialized in loop below phi_f20 = this->actor.scale.x * 0.5f; } for (i = 0; i < this->unk_198; i++) { @@ -1411,8 +1410,7 @@ void EnPoSisters_Draw(Actor* thisx, PlayState* play) { phi_f20 = CLAMP(phi_f20, 0.5f, 0.8f) * 0.007f; } Matrix_Scale(phi_f20, phi_f20, phi_f20, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_po_sisters.c", 3132), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_po_sisters.c", 3132); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_po_sisters.c", 3139); diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index 10af760994..7a415baff6 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -8,7 +8,7 @@ #include "assets/objects/object_poh/object_poh.h" #include "assets/objects/object_po_composer/object_po_composer.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_IGNORE_QUAKE) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_IGNORE_QUAKE) void EnPoh_Init(Actor* thisx, PlayState* play); void EnPoh_Destroy(Actor* thisx, PlayState* play); @@ -42,7 +42,7 @@ void EnPoh_TalkComposer(EnPoh* this, PlayState* play); static s16 D_80AE1A50 = 0; -ActorInit En_Poh_InitVars = { +ActorProfile En_Poh_Profile = { /**/ ACTOR_EN_POH, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -56,7 +56,7 @@ ActorInit En_Poh_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -64,7 +64,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -77,7 +77,7 @@ static ColliderCylinderInit sCylinderInit = { static ColliderJntSphElementInit D_80AE1AA0[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -90,7 +90,7 @@ static ColliderJntSphElementInit D_80AE1AA0[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT3, + COL_MATERIAL_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -175,7 +175,7 @@ static Color_RGBA8 D_80AE1B54 = { 90, 85, 50, 255 }; static Color_RGBA8 D_80AE1B58 = { 100, 90, 100, 255 }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 3200, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 3200, ICHAIN_STOP), }; static Vec3f D_80AE1B60 = { 0.0f, 3.0f, 0.0f }; @@ -315,7 +315,7 @@ void func_80ADE368(EnPoh* this) { void EnPoh_SetupInitialAction(EnPoh* this) { this->lightColor.a = 0; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if (this->infoIdx == EN_POH_INFO_NORMAL) { Animation_PlayOnceSetSpeed(&this->skelAnime, &gPoeAppearAnim, 0.0f); this->actionFunc = func_80ADEF38; @@ -333,7 +333,7 @@ void func_80ADE48C(EnPoh* this) { this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_198 = 0; this->actor.naviEnemyId = NAVI_ENEMY_NONE; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = func_80ADF15C; } @@ -435,7 +435,7 @@ void EnPoh_Talk(EnPoh* this, PlayState* play) { } this->unk_198 = 200; this->unk_195 = 32; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = func_80ADFE80; } @@ -488,7 +488,7 @@ void func_80ADEAC4(EnPoh* this, PlayState* play) { EnPoh_SetupIdle(this); } if (this->lightColor.a == 255) { - func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); } } @@ -510,7 +510,7 @@ void EnPoh_Idle(EnPoh* this, PlayState* play) { } } if (this->lightColor.a == 255) { - func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); } } @@ -539,7 +539,7 @@ void func_80ADEC9C(EnPoh* this, PlayState* play) { EnPoh_SetupAttack(this); } if (this->lightColor.a == 255) { - func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); } } @@ -578,7 +578,7 @@ void func_80ADEF38(EnPoh* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { this->lightColor.a = 255; this->visibilityTimer = Rand_S16Offset(700, 300); - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; EnPoh_SetupIdle(this); } else if (this->skelAnime.curFrame > 10.0f) { this->lightColor.a = ((this->skelAnime.curFrame - 10.0f) * 0.05f) * 255.0f; @@ -593,7 +593,7 @@ void EnPoh_ComposerAppear(EnPoh* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { this->lightColor.a = 255; this->visibilityTimer = Rand_S16Offset(700, 300); - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; EnPoh_SetupIdle(this); } else { this->lightColor.a = CLAMP_MAX((s32)(this->skelAnime.curFrame * 25.5f), 255); @@ -708,7 +708,7 @@ void func_80ADF894(EnPoh* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; EnPoh_SetupIdle(this); } - func_8002F974(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); } void EnPoh_Death(EnPoh* this, PlayState* play) { @@ -773,14 +773,14 @@ void func_80ADFE80(EnPoh* this, PlayState* play) { } if (this->unk_198 == 0) { func_80ADE950(this, 1); - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; return; } if (this->colliderCyl.base.ocFlags1 & OC1_HIT) { - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play); } else { - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCyl.base); } this->actor.world.pos.y = Math_SinS(this->unk_195 * 0x800) * 5.0f + this->actor.home.pos.y; @@ -808,7 +808,7 @@ void EnPoh_TalkRegular(EnPoh* this, PlayState* play) { if (this->actor.textId != 0x5005) { func_80ADFA90(this, -13); } else { - func_8002F974(&this->actor, NA_SE_EN_PO_BIG_CRY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_BIG_CRY - SFX_FLAG); } if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) { if (Message_ShouldAdvance(play)) { @@ -834,7 +834,7 @@ void EnPoh_TalkRegular(EnPoh* this, PlayState* play) { } void EnPoh_TalkComposer(EnPoh* this, PlayState* play) { - func_8002F974(&this->actor, NA_SE_EN_PO_BIG_CRY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PO_BIG_CRY - SFX_FLAG); if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) { if (Message_ShouldAdvance(play)) { if (play->msgCtx.choiceIndex == 0) { @@ -883,7 +883,7 @@ void EnPoh_UpdateVisibility(EnPoh* this) { this->visibilityTimer--; } if (this->lightColor.a == 255) { - if (this->actor.isTargeted) { + if (this->actor.isLockedOn) { this->unk_194++; this->unk_194 = CLAMP_MAX(this->unk_194, 20); } else { @@ -1045,8 +1045,7 @@ void EnPoh_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Collider_UpdateSpheres(limbIndex, &this->colliderSph); if (this->actionFunc == func_80ADF15C && this->unk_198 >= 2 && limbIndex == this->info->unk_7) { - gSPMatrix((*gfxP)++, MATRIX_NEW(play->state.gfxCtx, "../z_en_poh.c", 2460), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD((*gfxP)++, play->state.gfxCtx, "../z_en_poh.c", 2460); gSPDisplayList((*gfxP)++, this->info->burnDisplayList); } if (limbIndex == this->info->unk_6) { @@ -1088,8 +1087,7 @@ void EnPoh_DrawRegular(Actor* thisx, PlayState* play) { gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, this->envColor.r, this->envColor.g, this->envColor.b, 255); Matrix_Put(&this->unk_368); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_poh.c", 2676), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_poh.c", 2676); gSPDisplayList(POLY_OPA_DISP++, this->info->lanternDisplayList); CLOSE_DISPS(play->state.gfxCtx, "../z_en_poh.c", 2681); } @@ -1139,8 +1137,7 @@ void EnPoh_DrawComposer(Actor* thisx, PlayState* play) { gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, this->envColor.r, this->envColor.g, this->envColor.b, 255); Matrix_Put(&this->unk_368); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_poh.c", 2787), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_poh.c", 2787); gSPDisplayList(POLY_OPA_DISP++, this->info->lanternDisplayList); gSPDisplayList(POLY_OPA_DISP++, gPoeComposerLanternBottomDL); gDPPipeSync(POLY_OPA_DISP++); @@ -1169,8 +1166,7 @@ void EnPoh_DrawSoul(Actor* thisx, PlayState* play) { gDPSetEnvColor(POLY_OPA_DISP++, this->envColor.r, this->envColor.g, this->envColor.b, 255); Lights_PointGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->envColor.r, this->envColor.g, this->envColor.b, 200); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_poh.c", 2854), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_poh.c", 2854); gSPDisplayList(POLY_OPA_DISP++, this->info->lanternDisplayList); if (this->infoIdx == EN_POH_INFO_COMPOSER) { Color_RGBA8* envColor = (this->actor.params == EN_POH_SHARP) ? &D_80AE1B4C : &D_80AE1B50; @@ -1190,8 +1186,7 @@ void EnPoh_DrawSoul(Actor* thisx, PlayState* play) { this->info->primColor.b, this->lightColor.a); gDPSetEnvColor(POLY_XLU_DISP++, this->lightColor.r, this->lightColor.g, this->lightColor.b, 255); Matrix_RotateY((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x8000) * 9.58738e-05f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_poh.c", 2910), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_poh.c", 2910); gSPDisplayList(POLY_XLU_DISP++, this->info->soulDisplayList); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_poh.c", 2916); diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.h b/src/overlays/actors/ovl_En_Poh/z_en_poh.h index 1a44a60e81..749047b75f 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.h +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.h @@ -8,19 +8,19 @@ struct EnPoh; typedef void (*EnPohActionFunc)(struct EnPoh*, PlayState*); -typedef enum { +typedef enum EnPohType { EN_POH_NORMAL, EN_POH_RUPEE, EN_POH_SHARP, EN_POH_FLAT } EnPohType; -typedef enum { +typedef enum EnPohInfoType { EN_POH_INFO_NORMAL, EN_POH_INFO_COMPOSER } EnPohInfoType; -typedef struct { +typedef struct EnPohInfo { /* 0x0000 */ Color_RGB8 primColor; /* 0x0003 */ Color_RGB8 lightColor; /* 0x0006 */ u8 unk_6; // limb index diff --git a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c index b141965c37..d9441d5506 100644 --- a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c +++ b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c @@ -14,7 +14,7 @@ void EnPubox_Destroy(Actor* thisx, PlayState* play); void EnPubox_Update(Actor* thisx, PlayState* play); void EnPubox_Draw(Actor* thisx, PlayState* play); -ActorInit En_Pu_box_InitVars = { +ActorProfile En_Pu_box_Profile = { /**/ ACTOR_EN_PU_BOX, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -53,7 +53,7 @@ void EnPubox_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 6.0f); this->dyna.interactFlags = 0; this->dyna.transformFlags = 0; - thisx->targetMode = 1; + thisx->attentionRangeType = ATTENTION_RANGE_1; thisx->gravity = -2.0f; CollisionHeader_GetVirtual(&gBlockMediumCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index cae3ead4ee..dfb43d8860 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -1,7 +1,7 @@ #include "z_en_rd.h" #include "assets/objects/object_rd/object_rd.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_10) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_10) void EnRd_Init(Actor* thisx, PlayState* play); void EnRd_Destroy(Actor* thisx, PlayState* play); @@ -29,7 +29,7 @@ void EnRd_Damaged(EnRd* this, PlayState* play); void EnRd_Dead(EnRd* this, PlayState* play); void EnRd_Stunned(EnRd* this, PlayState* play); -typedef enum { +typedef enum EnRdAction { /* 0 */ REDEAD_ACTION_IDLE, /* 1 */ REDEAD_ACTION_STUNNED, /* 2 */ REDEAD_ACTION_WALK_TO_HOME, @@ -44,7 +44,7 @@ typedef enum { /* 11 */ REDEAD_ACTION_RISE_FROM_COFFIN } EnRdAction; -typedef enum { +typedef enum EnRdGrabState { /* 0 */ REDEAD_GRAB_START, /* 1 */ REDEAD_GRAB_INITIAL_DAMAGE, /* 2 */ REDEAD_GRAB_ATTACK, @@ -52,7 +52,7 @@ typedef enum { /* 4 */ REDEAD_GRAB_END } EnRdGrabState; -ActorInit En_Rd_InitVars = { +ActorProfile En_Rd_Profile = { /**/ ACTOR_EN_RD, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -66,7 +66,7 @@ ActorInit En_Rd_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -74,7 +74,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -84,7 +84,7 @@ static ColliderCylinderInit sCylinderInit = { { 20, 70, 0, { 0, 0, 0 } }, }; -typedef enum { +typedef enum EnRdDamageEffect { /* 0x0 */ REDEAD_DMGEFF_NONE, // Does not interact with the Gibdo/Redead at all /* 0x1 */ REDEAD_DMGEFF_HOOKSHOT, // Stuns the Gibdo/Redead /* 0x6 */ REDEAD_DMGEFF_ICE_MAGIC = 0x6, // Does not interact with the Gibdo/Redead at all @@ -129,7 +129,7 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3500, ICHAIN_STOP), }; @@ -142,7 +142,7 @@ void EnRd_Init(Actor* thisx, PlayState* play) { EnRd* this = (EnRd*)thisx; Actor_ProcessInitChain(thisx, sInitChain); - this->actor.targetMode = 0; + this->actor.attentionRangeType = ATTENTION_RANGE_0; this->actor.colChkInfo.damageTable = &sDamageTable; ActorShape_Init(&thisx->shape, 0.0f, NULL, 0.0f); this->upperBodyYRotation = this->headYRotation = 0; @@ -151,9 +151,9 @@ void EnRd_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = 8; this->alpha = this->unk_31D = 255; - this->rdFlags = REDEAD_GET_FLAGS(thisx); + this->rdFlags = REDEAD_GET_RDFLAGS(thisx); - if (this->actor.params & 0x80) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 7, 1)) { this->actor.params |= 0xFF00; } else { this->actor.params &= 0xFF; @@ -355,14 +355,23 @@ void EnRd_WalkToPlayer(EnRd* this, PlayState* play) { } if ((ABS(yaw) < 0x1554) && (Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 150.0f)) { - if (!(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_18 | + if (!(player->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_21)) && !(player->stateFlags2 & PLAYER_STATE2_7)) { if (this->playerStunWaitTimer == 0) { if (!(this->rdFlags & 0x80)) { player->actor.freezeTimer = 40; - func_8008EEAC(play, &this->actor); - GET_PLAYER(play)->unk_684 = &this->actor; + + // `player->actor.freezeTimer` gets set above which will prevent Player from updating. + // Because of this, he cannot update things related to Z-Targeting. + // If Player can't update, `player->zTargetActiveTimer` won't update, which means + // the Attention system will not be notified of a new actor lock-on occurring. + // So, no reticle will appear. But the camera will still focus on the actor. + Player_SetAutoLockOnActor(play, &this->actor); + + // This is redundant, `autoLockOnActor` gets set by `Player_SetAutoLockOnActor` above + GET_PLAYER(play)->autoLockOnActor = &this->actor; + Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150); } @@ -382,7 +391,7 @@ void EnRd_WalkToPlayer(EnRd* this, PlayState* play) { Actor_IsFacingPlayer(&this->actor, 0x38E3)) { player->actor.freezeTimer = 0; if (play->grabPlayer(play, player)) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnRd_SetupGrab(this); } } else if (this->actor.params > REDEAD_TYPE_DOES_NOT_MOURN_IF_WALKING) { @@ -430,11 +439,11 @@ void EnRd_WalkToHome(EnRd* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); - if (!(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_18 | + if (!(player->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_21)) && !(player->stateFlags2 & PLAYER_STATE2_7) && (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) < 150.0f)) { - this->actor.targetMode = 0; + this->actor.attentionRangeType = ATTENTION_RANGE_0; EnRd_SetupWalkToPlayer(this, play); } else if (this->actor.params > REDEAD_TYPE_DOES_NOT_MOURN_IF_WALKING) { if (this->actor.parent != NULL) { @@ -579,8 +588,8 @@ void EnRd_Grab(EnRd* this, PlayState* play) { if (!LINK_IS_ADULT) { Math_SmoothStepToF(&this->actor.shape.yOffset, 0, 1.0f, 400.0f, 0.0f); } - this->actor.targetMode = 0; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.attentionRangeType = ATTENTION_RANGE_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->playerStunWaitTimer = 0xA; this->grabWaitTimer = 0xF; EnRd_SetupWalkToPlayer(this, play); @@ -606,7 +615,9 @@ void EnRd_AttemptPlayerFreeze(EnRd* this, PlayState* play) { if (!(this->rdFlags & 0x80)) { player->actor.freezeTimer = 60; Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150); - func_8008EEAC(play, &this->actor); + + // The same note mentioned with this function call in `EnRd_WalkToPlayer` applies here too + Player_SetAutoLockOnActor(play, &this->actor); } Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_AIM); @@ -650,7 +661,7 @@ void EnRd_SetupDamaged(EnRd* this) { this->actor.speed = -2.0f; } - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->action = REDEAD_ACTION_DAMAGED; EnRd_SetupAction(this, EnRd_Damaged); @@ -685,7 +696,7 @@ void EnRd_SetupDead(EnRd* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadDeathAnim, -1.0f); this->action = REDEAD_ACTION_DEAD; this->timer = 300; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DEAD); EnRd_SetupAction(this, EnRd_Dead); @@ -994,7 +1005,5 @@ void EnRd_Draw(Actor* thisx, PlayState* play) { func_80033C30(&thisPos, &sShadowScale, this->alpha, play); } - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_en_rd.c", 1735); } diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.h b/src/overlays/actors/ovl_En_Rd/z_en_rd.h index 864dc13a99..4c46a5e1e1 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.h +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.h @@ -8,9 +8,9 @@ struct EnRd; typedef void (*EnRdActionFunc)(struct EnRd*, PlayState*); -#define REDEAD_GET_FLAGS(thisx) (((thisx)->params & 0xFF00) >> 8) +#define REDEAD_GET_RDFLAGS(thisx) PARAMS_GET_S((thisx)->params, 8, 8) -typedef enum { +typedef enum RedeadGibdoLimb { /* 0 */ REDEAD_GIBDO_LIMB_NONE, /* 1 */ REDEAD_GIBDO_LIMB_ROOT, /* 2 */ REDEAD_GIBDO_LIMB_LEFT_LEG_ROOT, @@ -40,7 +40,7 @@ typedef enum { /* 26 */ REDEAD_GIBDO_LIMB_MAX } RedeadGibdoLimb; -typedef enum { +typedef enum EnRdType { /* -3 */ REDEAD_TYPE_GIBDO_RISING_OUT_OF_COFFIN = -3, /* -2 */ REDEAD_TYPE_GIBDO, /* -1 */ REDEAD_TYPE_DOES_NOT_MOURN, diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index b89ed2e9cc..555ef5c749 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -10,7 +10,7 @@ #include "terminal.h" #include "assets/objects/object_reeba/object_reeba.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_27) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_LOCK_ON_DISABLED) void EnReeba_Init(Actor* thisx, PlayState* play); void EnReeba_Destroy(Actor* thisx, PlayState* play); @@ -30,7 +30,7 @@ void EnReeba_Die(EnReeba* this, PlayState* play); void EnReeba_Stunned(EnReeba* this, PlayState* play); void EnReeba_StunDie(EnReeba* this, PlayState* play); -typedef enum { +typedef enum LeeverDamageEffect { /* 0x00 */ LEEVER_DMGEFF_NONE, // used by anything that cant kill the Leever /* 0x01 */ LEEVER_DMGEFF_UNK, // used by "unknown 1" attack /* 0x03 */ LEEVER_DMGEFF_ICE = 3, @@ -75,7 +75,7 @@ static DamageTable sDamageTable = { /* Unknown 2 */ DMG_ENTRY(0, LEEVER_DMGEFF_NONE), }; -ActorInit En_Reeba_InitVars = { +ActorProfile En_Reeba_Profile = { /**/ ACTOR_EN_REEBA, /**/ ACTORCAT_MISC, /**/ FLAGS, @@ -89,7 +89,7 @@ ActorInit En_Reeba_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT5, + COL_MATERIAL_HIT5, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -97,7 +97,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x08, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -113,7 +113,7 @@ void EnReeba_Init(Actor* thisx, PlayState* play) { s32 surfaceType; this->actor.naviEnemyId = NAVI_ENEMY_LEEVER; - this->actor.targetMode = 3; + this->actor.attentionRangeType = ATTENTION_RANGE_3; this->actor.gravity = -3.5f; this->actor.focus.pos = this->actor.world.pos; SkelAnime_Init(play, &this->skelanime, &object_reeba_Skel_001EE8, &object_reeba_Anim_0001E4, this->jointTable, @@ -192,7 +192,7 @@ void EnReeba_SetupSurface(EnReeba* this, PlayState* play) { this->waitTimer = 20; } - this->actor.flags &= ~ACTOR_FLAG_27; + this->actor.flags &= ~ACTOR_FLAG_LOCK_ON_DISABLED; this->actor.world.pos.y = this->actor.floorHeight; if (this->type != LEEVER_TYPE_SMALL) { @@ -278,7 +278,7 @@ void EnReeba_Move(EnReeba* this, PlayState* play) { } void EnReeba_SetupMoveBig(EnReeba* this, PlayState* play) { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_2; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE; this->actionfunc = EnReeba_MoveBig; } @@ -341,8 +341,8 @@ void EnReeba_Recoiled(EnReeba* this, PlayState* play) { void EnReeba_SetupSink(EnReeba* this, PlayState* play) { this->stunType = LEEVER_STUN_NONE; Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); - this->actor.flags |= ACTOR_FLAG_27; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); + this->actor.flags |= ACTOR_FLAG_LOCK_ON_DISABLED; + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); this->actionfunc = EnReeba_Sink; } @@ -393,8 +393,8 @@ void EnReeba_SetupStunned(EnReeba* this, PlayState* play) { this->waitTimer = 14; this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.speed = -8.0f; - this->actor.flags |= ACTOR_FLAG_27; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); + this->actor.flags |= ACTOR_FLAG_LOCK_ON_DISABLED; + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); this->actionfunc = EnReeba_Stunned; } @@ -463,7 +463,7 @@ void EnReeba_SetupDie(EnReeba* this, PlayState* play) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); this->waitTimer = 14; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionfunc = EnReeba_Die; } diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h index 06bb946d2c..36173bf355 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h @@ -30,7 +30,7 @@ typedef struct EnReeba { /* 0x0290 */ ColliderCylinder collider; } EnReeba; // size = 0x02DC -typedef enum { +typedef enum LeeverType { /* 0 */ LEEVER_TYPE_SMALL, /* 1 */ LEEVER_TYPE_BIG } LeeverType; diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c index 19b867eb8c..8aa760ecaf 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c @@ -13,7 +13,7 @@ void EnRiverSound_Destroy(Actor* thisx, PlayState* play); void EnRiverSound_Update(Actor* thisx, PlayState* play); void EnRiverSound_Draw(Actor* thisx, PlayState* play); -ActorInit En_River_Sound_InitVars = { +ActorProfile En_River_Sound_Profile = { /**/ ACTOR_EN_RIVER_SOUND, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -29,8 +29,8 @@ void EnRiverSound_Init(Actor* thisx, PlayState* play) { EnRiverSound* this = (EnRiverSound*)thisx; this->playSfx = false; - this->pathIndex = (this->actor.params >> 8) & 0xFF; - this->actor.params &= 0xFF; + this->pathIndex = PARAMS_GET_U(this->actor.params, 8, 8); + this->actor.params = PARAMS_GET_U(this->actor.params, 0, 8); if (this->actor.params >= RS_GANON_TOWER_0) { // Incrementally increase volume of NA_BGM_GANON_TOWER for each new room during the climb of Ganon's Tower @@ -226,7 +226,7 @@ void EnRiverSound_Update(Actor* thisx, PlayState* play) { } } } else if ((thisx->params == RS_GORON_CITY_SARIAS_SONG) || (thisx->params == RS_GREAT_FAIRY)) { - func_8002DBD0(&player->actor, &thisx->home.pos, &thisx->world.pos); + Actor_WorldToActorCoords(&player->actor, &thisx->home.pos, &thisx->world.pos); } else if (play->sceneId == SCENE_DODONGOS_CAVERN_BOSS && Flags_GetClear(play, thisx->room)) { Actor_Kill(thisx); } diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h index be6d04e65e..c647185217 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h @@ -13,7 +13,7 @@ typedef struct EnRiverSound { /* 0x014E */ s16 pathIndex; } EnRiverSound; // size = 0x0150 -typedef enum { +typedef enum RiverSoundType { /* 0x00 */ RS_RIVER_DEFAULT_LOW_FREQ, /* 0x01 */ RS_SMALL_WATERFALL, /* 0x02 */ RS_LAVA_BUBBLES_1, diff --git a/src/overlays/actors/ovl_En_Rl/z_en_rl.c b/src/overlays/actors/ovl_En_Rl/z_en_rl.c index ba8cf7dc0e..b30b967ef8 100644 --- a/src/overlays/actors/ovl_En_Rl/z_en_rl.c +++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.c @@ -394,7 +394,7 @@ void EnRl_Draw(Actor* thisx, PlayState* play) { sDrawFuncs[this->drawConfig](this, play); } -ActorInit En_Rl_InitVars = { +ActorProfile En_Rl_Profile = { /**/ ACTOR_EN_RL, /**/ ACTORCAT_NPC, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index 850ea93d5a..83366209be 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -7,15 +7,16 @@ #include "z_en_rr.h" #include "assets/objects/object_rr/object_rr.h" #include "terminal.h" +#include "versions.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_10) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_10) #define RR_MESSAGE_SHIELD (1 << 0) #define RR_MESSAGE_TUNIC (1 << 1) #define RR_MOUTH 4 #define RR_BASE 0 -typedef enum { +typedef enum EnRrReachState { /* 0 */ REACH_NONE, /* 1 */ REACH_EXTEND, /* 2 */ REACH_STOP, @@ -24,7 +25,7 @@ typedef enum { /* 5 */ REACH_CLOSE } EnRrReachState; -typedef enum { +typedef enum EnRrDamageEffect { /* 0x0 */ RR_DMG_NONE, /* 0x1 */ RR_DMG_STUN, /* 0x2 */ RR_DMG_FIRE, @@ -37,7 +38,7 @@ typedef enum { /* 0xF */ RR_DMG_NORMAL } EnRrDamageEffect; -typedef enum { +typedef enum EnRrDropType { /* 0 */ RR_DROP_RANDOM_RUPEE, /* 1 */ RR_DROP_MAGIC, /* 2 */ RR_DROP_ARROW, @@ -64,7 +65,7 @@ void EnRr_Death(EnRr* this, PlayState* play); void EnRr_Retreat(EnRr* this, PlayState* play); void EnRr_Stunned(EnRr* this, PlayState* play); -ActorInit En_Rr_InitVars = { +ActorProfile En_Rr_Profile = { /**/ ACTOR_EN_RR, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -85,14 +86,14 @@ static char* sDropNames[] = { static ColliderCylinderInitType1 sCylinderInit1 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -104,14 +105,14 @@ static ColliderCylinderInitType1 sCylinderInit1 = { static ColliderCylinderInitType1 sCylinderInit2 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_NO_PUSH | OC1_TYPE_PLAYER, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -158,8 +159,8 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_LIKE_LIKE, ICHAIN_CONTINUE), - ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 30, ICHAIN_STOP), }; void EnRr_Init(Actor* thisx, PlayState* play2) { @@ -254,7 +255,7 @@ void EnRr_SetupGrabPlayer(EnRr* this, Player* player) { s32 i; this->grabTimer = 100; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->ocTimer = 8; this->hasPlayer = true; this->reachState = 0; @@ -289,7 +290,7 @@ void EnRr_SetupReleasePlayer(EnRr* this, PlayState* play) { u8 shield; u8 tunic; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->hasPlayer = false; this->ocTimer = 110; this->segMoveRate = 0.0f; @@ -324,7 +325,7 @@ void EnRr_SetupReleasePlayer(EnRr* this, PlayState* play) { break; } PRINTF(VT_FGCOL(YELLOW) "%s[%d] : Rr_Catch_Cancel" VT_RST "\n", "../z_en_rr.c", 650); - func_8002F6D4(play, &this->actor, 4.0f, this->actor.shape.rot.y, 12.0f, 8); + Actor_SetPlayerKnockbackLarge(play, &this->actor, 4.0f, this->actor.shape.rot.y, 12.0f, 8); if (this->actor.colorFilterTimer == 0) { this->actionFunc = EnRr_Approach; Actor_PlaySfx(&this->actor, NA_SE_EN_LIKE_THROW); @@ -381,7 +382,7 @@ void EnRr_SetupDeath(EnRr* this) { } this->actionFunc = EnRr_Death; Actor_PlaySfx(&this->actor, NA_SE_EN_LIKE_DEAD); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } void EnRr_SetupStunned(EnRr* this) { @@ -480,11 +481,16 @@ void EnRr_CollisionCheck(EnRr* this, PlayState* play) { if (this->actor.colChkInfo.health == 0) { this->dropType = RR_DROP_RANDOM_RUPEE; } +#if OOT_VERSION < NTSC_1_1 + this->effectTimer = 20; + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, 80); +#else if (this->actor.colorFilterTimer == 0) { this->effectTimer = 20; Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, 80); } +#endif EnRr_SetupStunned(this); return; case RR_DMG_LIGHT_MAGIC: // Unused light magic @@ -866,8 +872,7 @@ void EnRr_Draw(Actor* thisx, PlayState* play) { Matrix_Scale((1.0f + this->bodySegs[RR_BASE].scaleMod.x) * this->bodySegs[RR_BASE].scale.x, (1.0f + this->bodySegs[RR_BASE].scaleMod.y) * this->bodySegs[RR_BASE].scale.y, (1.0f + this->bodySegs[RR_BASE].scaleMod.z) * this->bodySegs[RR_BASE].scale.z, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_rr.c", 1501), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_rr.c", 1501); Matrix_Pop(); zeroVec.x = 0.0f; @@ -901,20 +906,18 @@ void EnRr_Draw(Actor* thisx, PlayState* play) { s32 offIndex; this->actor.colorFilterTimer++; - if ((effectTimer & 1) != 0) { - return; - } - - segIndex = 4 - (effectTimer >> 2); - offIndex = (effectTimer >> 1) & 3; - - effectPos.x = this->effectPos[segIndex].x + sEffectOffsets[offIndex].x + Rand_CenteredFloat(10.0f); - effectPos.y = this->effectPos[segIndex].y + sEffectOffsets[offIndex].y + Rand_CenteredFloat(10.0f); - effectPos.z = this->effectPos[segIndex].z + sEffectOffsets[offIndex].z + Rand_CenteredFloat(10.0f); - if (this->actor.colorFilterParams & 0x4000) { - EffectSsEnFire_SpawnVec3f(play, &this->actor, &effectPos, 100, 0, 0, -1); - } else { - EffectSsEnIce_SpawnFlyingVec3f(play, &this->actor, &effectPos, 150, 150, 150, 250, 235, 245, 255, 3.0f); + if ((effectTimer & 1) == 0) { + segIndex = 4 - (effectTimer >> 2); + offIndex = (effectTimer >> 1) & 3; + + effectPos.x = this->effectPos[segIndex].x + sEffectOffsets[offIndex].x + Rand_CenteredFloat(10.0f); + effectPos.y = this->effectPos[segIndex].y + sEffectOffsets[offIndex].y + Rand_CenteredFloat(10.0f); + effectPos.z = this->effectPos[segIndex].z + sEffectOffsets[offIndex].z + Rand_CenteredFloat(10.0f); + if (this->actor.colorFilterParams & 0x4000) { + EffectSsEnFire_SpawnVec3f(play, &this->actor, &effectPos, 100, 0, 0, -1); + } else { + EffectSsEnIce_SpawnFlyingVec3f(play, &this->actor, &effectPos, 150, 150, 150, 250, 235, 245, 255, 3.0f); + } } } } diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.h b/src/overlays/actors/ovl_En_Rr/z_en_rr.h index aa1f782073..44ac232668 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.h +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.h @@ -8,7 +8,7 @@ struct EnRr; typedef void (*EnRrActionFunc)(struct EnRr*, PlayState*); -typedef struct { +typedef struct EnRrBodySegment { /* 0x00 */ f32 height; /* 0x04 */ f32 heightTarget; /* 0x08 */ Vec3f scale; diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 46ff8a3e57..2dcacdc42e 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -7,9 +7,10 @@ #include "z_en_ru1.h" #include "assets/objects/object_ru1/object_ru1.h" #include "terminal.h" +#include "versions.h" #include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_4 | ACTOR_FLAG_26) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4 | ACTOR_FLAG_26) void EnRu1_Init(Actor* thisx, PlayState* play); void EnRu1_Destroy(Actor* thisx, PlayState* play); @@ -71,7 +72,7 @@ void EnRu1_DrawXlu(EnRu1* this, PlayState* play); static ColliderCylinderInitType1 sCylinderInit1 = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_PLAYER, @@ -83,7 +84,7 @@ static ColliderCylinderInitType1 sCylinderInit1 = { static ColliderCylinderInitType1 sCylinderInit2 = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_ON | AT_TYPE_PLAYER, AC_NONE, OC1_ON | OC1_TYPE_PLAYER, @@ -132,7 +133,7 @@ static EnRu1DrawFunc sDrawFuncs[] = { EnRu1_DrawXlu, }; -ActorInit En_Ru1_InitVars = { +ActorProfile En_Ru1_Profile = { /**/ ACTOR_EN_RU1, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -189,13 +190,13 @@ void func_80AEADD8(EnRu1* this) { } u8 func_80AEADE0(EnRu1* this) { - u8 params = this->actor.params >> 8; + u8 params = PARAMS_GET_U(this->actor.params, 8, 8); return params; } u8 func_80AEADF0(EnRu1* this) { - s16 params = this->actor.params; + u8 params = PARAMS_GET_U(this->actor.params, 0, 8); return params; } @@ -324,7 +325,7 @@ Actor* func_80AEB124(PlayState* play) { Actor* actorIt = play->actorCtx.actorLists[ACTORCAT_BOSS].head; while (actorIt != NULL) { - if ((actorIt->id == ACTOR_DEMO_EFFECT) && ((actorIt->params & 0xFF) == DEMO_EFFECT_JEWEL_ZORA)) { + if ((actorIt->id == ACTOR_DEMO_EFFECT) && (PARAMS_GET_U(actorIt->params, 0, 8) == DEMO_EFFECT_JEWEL_ZORA)) { return actorIt; } actorIt = actorIt->next; @@ -391,17 +392,17 @@ s32 EnRu1_UpdateSkelAnime(EnRu1* this) { } void func_80AEB364(EnRu1* this, PlayState* play) { - this->skelAnime.moveFlags |= ANIM_FLAG_UPDATE_XZ; - AnimTaskQueue_AddActorMove(play, &this->actor, &this->skelAnime, 1.0f); + this->skelAnime.movementFlags |= ANIM_FLAG_UPDATE_XZ; + AnimTaskQueue_AddActorMovement(play, &this->actor, &this->skelAnime, 1.0f); } void func_80AEB3A4(EnRu1* this, PlayState* play) { - this->skelAnime.moveFlags |= ANIM_FLAG_UPDATE_XZ; + this->skelAnime.movementFlags |= ANIM_FLAG_UPDATE_XZ; func_80AEB364(this, play); } void func_80AEB3CC(EnRu1* this) { - this->skelAnime.moveFlags &= ~ANIM_FLAG_UPDATE_XZ; + this->skelAnime.movementFlags &= ~ANIM_FLAG_UPDATE_XZ; } void func_80AEB3DC(EnRu1* this, PlayState* play) { @@ -462,8 +463,8 @@ void func_80AEB6E0(EnRu1* this, PlayState* play) { SkelAnime* skelAnime = &this->skelAnime; if (skelAnime->baseTransl.y < skelAnime->jointTable[0].y) { - skelAnime->moveFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; - AnimTaskQueue_AddActorMove(play, &this->actor, skelAnime, 1.0f); + skelAnime->movementFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; + AnimTaskQueue_AddActorMovement(play, &this->actor, skelAnime, 1.0f); } } @@ -473,13 +474,13 @@ void func_80AEB738(EnRu1* this, PlayState* play) { skelAnime->baseTransl = skelAnime->jointTable[0]; skelAnime->prevTransl = skelAnime->jointTable[0]; if (skelAnime->baseTransl.y < skelAnime->jointTable[0].y) { - skelAnime->moveFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; - AnimTaskQueue_AddActorMove(play, &this->actor, skelAnime, 1.0f); + skelAnime->movementFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; + AnimTaskQueue_AddActorMovement(play, &this->actor, skelAnime, 1.0f); } } void func_80AEB7D0(EnRu1* this) { - this->skelAnime.moveFlags &= ~(ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y); + this->skelAnime.movementFlags &= ~(ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y); } f32 func_80AEB7E0(CsCmdActorCue* cue, PlayState* play) { @@ -1505,7 +1506,7 @@ void func_80AEE050(EnRu1* this) { s32 func_80AEE264(EnRu1* this, PlayState* play) { if (!Actor_TalkOfferAccepted(&this->actor, play)) { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; if (GET_INFTABLE(INFTABLE_143)) { this->actor.textId = 0x404E; Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play); @@ -1529,7 +1530,7 @@ void func_80AEE2F8(EnRu1* this, PlayState* play) { floorBgId = this->actor.floorBgId; dynaPolyActor = DynaPoly_GetActor(&play->colCtx, floorBgId); if ((dynaPolyActor != NULL) && (dynaPolyActor->actor.id == ACTOR_BG_BDAN_SWITCH)) { - if (((dynaPolyActor->actor.params >> 8) & 0x3F) == 0x38) { + if (PARAMS_GET_U(dynaPolyActor->actor.params, 8, 6) == 0x38) { SET_INFTABLE(INFTABLE_140); return; } @@ -1657,7 +1658,7 @@ void func_80AEE7C4(EnRu1* this, PlayState* play) { *unk_370 = 0.0f; } else { player = GET_PLAYER(play); - if (player->stateFlags2 & PLAYER_STATE2_28) { + if (player->stateFlags2 & PLAYER_STATE2_IDLE_FIDGET) { this->unk_370 += 1.0f; if (this->action != 32) { if (*unk_370 > 30.0f) { @@ -1837,7 +1838,7 @@ s32 func_80AEF0BC(EnRu1* this, PlayState* play) { Animation_Change(&this->skelAnime, &gRutoChildSitAnim, 1.0f, 0, frameCount, ANIMMODE_ONCE, -8.0f); play->msgCtx.msgMode = MSGMODE_PAUSED; this->action = 26; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); return true; } return false; @@ -1877,7 +1878,7 @@ void func_80AEF29C(EnRu1* this, PlayState* play) { void func_80AEF2AC(EnRu1* this, PlayState* play) { this->action = 24; this->drawConfig = 1; - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; } void func_80AEF2D0(EnRu1* this, PlayState* play) { @@ -2034,9 +2035,13 @@ void func_80AEF890(EnRu1* this, PlayState* play) { void func_80AEF930(EnRu1* this, PlayState* play) { if (func_80AEB104(this) == 3) { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; this->actor.textId = 0x4048; +#if !OOT_PAL_N64 Message_ContinueTextbox(play, this->actor.textId); +#else + Message_StartTextbox(play, this->actor.textId, NULL); +#endif func_80AEF4A8(this, play); this->action = 43; this->drawConfig = 0; @@ -2132,7 +2137,7 @@ void func_80AEFC54(EnRu1* this, PlayState* play) { this->action = 41; this->unk_28C = EnRu1_FindSwitch(play); func_80AEB0EC(this, 1); - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); } else { Actor_Kill(&this->actor); } @@ -2160,7 +2165,7 @@ void func_80AEFD38(EnRu1* this, PlayState* play) { s32 func_80AEFDC0(EnRu1* this, PlayState* play) { if (!Actor_TalkOfferAccepted(&this->actor, play)) { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; this->actor.textId = MaskReaction_GetTextId(play, MASK_REACTION_SET_RUTO); if (this->actor.textId == 0) { this->actor.textId = 0x402C; @@ -2173,7 +2178,7 @@ s32 func_80AEFDC0(EnRu1* this, PlayState* play) { s32 func_80AEFE38(EnRu1* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); return true; } return false; diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h index 29570c980e..8223bfda43 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h @@ -57,7 +57,7 @@ typedef struct EnRu1 { /* 0x0374 */ NpcInteractInfo interactInfo; } EnRu1; // size = 0x039C -typedef enum { +typedef enum RutoLimb { /* 0 */ RUTO_CHILD_NONE, /* 1 */ RUTO_CHILD_ROOT, /* 2 */ RUTO_CHILD_LEFT_THIGH, diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 98e705ce76..325d4d2347 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -45,7 +45,7 @@ void func_80AF2AB4(EnRu2* this, PlayState* play); static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -79,7 +79,7 @@ static EnRu2DrawFunc sDrawFuncs[] = { func_80AF321C, }; -ActorInit En_Ru2_InitVars = { +ActorProfile En_Ru2_Profile = { /**/ ACTOR_EN_RU2, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -127,15 +127,15 @@ void func_80AF2608(EnRu2* this) { } s32 func_80AF2690(EnRu2* this) { - s32 params_shift = this->actor.params >> 8; + s32 params_shift = PARAMS_GET_U(this->actor.params, 8, 8); - return params_shift & 0xFF; + return params_shift; } s32 func_80AF26A0(EnRu2* this) { - s16 params = this->actor.params; + s32 params = PARAMS_GET_U(this->actor.params, 0, 8); - return params & 0xFF; + return params; } #if IS_DEBUG diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c index d60aa4e40c..bd7f2d3b4f 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -4,7 +4,7 @@ #include "assets/scenes/overworld/spot04/spot04_scene.h" #include "assets/scenes/overworld/spot05/spot05_scene.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_25) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_25) void EnSa_Init(Actor* thisx, PlayState* play); void EnSa_Destroy(Actor* thisx, PlayState* play); @@ -17,7 +17,7 @@ void func_80AF683C(EnSa* this, PlayState* play); void func_80AF68E4(EnSa* this, PlayState* play); void func_80AF6B20(EnSa* this, PlayState* play); -typedef enum { +typedef enum SariaEyeState { /* 0 */ SARIA_EYE_OPEN, /* 1 */ SARIA_EYE_HALF, /* 2 */ SARIA_EYE_CLOSED, @@ -25,7 +25,7 @@ typedef enum { /* 4 */ SARIA_EYE_SAD } SariaEyeState; -typedef enum { +typedef enum SariaMouthState { /* 0 */ SARIA_MOUTH_CLOSED2, /* 1 */ SARIA_MOUTH_SUPRISED, /* 2 */ SARIA_MOUTH_CLOSED, @@ -33,7 +33,7 @@ typedef enum { /* 4 */ SARIA_MOUTH_FROWNING } SariaMouthState; -ActorInit En_Sa_InitVars = { +ActorProfile En_Sa_Profile = { /**/ ACTOR_EN_SA, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -47,7 +47,7 @@ ActorInit En_Sa_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -55,7 +55,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -67,7 +67,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -typedef enum { +typedef enum EnSaAnimation1 { /* 0 */ ENSA_ANIM1_0, /* 1 */ ENSA_ANIM1_1, /* 2 */ ENSA_ANIM1_2, @@ -97,7 +97,7 @@ static AnimationFrameCountInfo sAnimationInfo1[] = { { &gSariaPlayingOcarinaAnim, 1.0f, ANIMMODE_LOOP, 0.0f }, }; -typedef enum { +typedef enum EnSaAnimation2 { /* 0 */ ENSA_ANIM2_0, /* 1 */ ENSA_ANIM2_1, /* 2 */ ENSA_ANIM2_2, @@ -521,7 +521,7 @@ void EnSa_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->interactInfo.talkState = NPC_TALK_STATE_IDLE; this->alpha = 255; this->unk_21A = this->actor.shape.rot; diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index df531b2b7c..647d321273 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -8,7 +8,7 @@ #include "terminal.h" #include "assets/objects/object_sb/object_sb.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) void EnSb_Init(Actor* thisx, PlayState* play); void EnSb_Destroy(Actor* thisx, PlayState* play); @@ -25,7 +25,7 @@ void EnSb_Lunge(EnSb* this, PlayState* play); void EnSb_Bounce(EnSb* this, PlayState* play); void EnSb_Cooldown(EnSb* this, PlayState* play); -ActorInit En_Sb_InitVars = { +ActorProfile En_Sb_Profile = { /**/ ACTOR_EN_SB, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -39,7 +39,7 @@ ActorInit En_Sb_InitVars = { static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -86,8 +86,8 @@ static DamageTable sDamageTable[] = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_SHELL_BLADE, ICHAIN_CONTINUE), - ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 30, ICHAIN_STOP), }; static Vec3f sFlamePosOffsets[] = { @@ -97,7 +97,7 @@ static Vec3f sFlamePosOffsets[] = { { 0.0f, 0.0f, -5.0f }, }; -typedef enum { +typedef enum ShellbladeBehavior { /* 0x00 */ SHELLBLADE_OPEN, /* 0x01 */ SHELLBLADE_WAIT_CLOSED, /* 0x02 */ SHELLBLADE_WAIT_OPEN, diff --git a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c index 0bc1a11879..26d322f9b5 100644 --- a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c +++ b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c @@ -15,7 +15,7 @@ void EnSceneChange_Draw(Actor* thisx, PlayState* play); void EnSceneChange_DoNothing(EnSceneChange* this, PlayState* play); -ActorInit En_Scene_Change_InitVars = { +ActorProfile En_Scene_Change_Profile = { /**/ ACTOR_EN_SCENE_CHANGE, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Sda/z_en_sda.c b/src/overlays/actors/ovl_En_Sda/z_en_sda.c index 7a3b1c81fd..4452c86610 100644 --- a/src/overlays/actors/ovl_En_Sda/z_en_sda.c +++ b/src/overlays/actors/ovl_En_Sda/z_en_sda.c @@ -17,7 +17,7 @@ void func_80AF95C4(EnSda* this, u8* shadowTexture, Player* player, PlayState* pl void func_80AF9C70(u8* shadowTexture, Player* player, PlayState* play); void func_80AF8F60(Player* player, u8* shadowTexture, f32 arg2); -ActorInit En_Sda_InitVars = { +ActorProfile En_Sda_Profile = { /**/ ACTOR_EN_SDA, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -351,8 +351,7 @@ void func_80AF9C70(u8* shadowTexture, Player* player, PlayState* play) { 20.0f; Matrix_Translate(tempx, 0.0f, tempz, MTXMODE_APPLY); Matrix_Scale(((BREG(56) - 250) / 1000.0f) + 0.6f, 1.0f, ((BREG(59) - 250) / 1000.0f) + 0.6f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_sda.c", 860), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_sda.c", 860); gSPDisplayList(POLY_XLU_DISP++, D_80AFA3D8); gDPLoadTextureBlock(POLY_XLU_DISP++, shadowTexture, G_IM_FMT_I, G_IM_SIZ_8b, 0x40, 0x40, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD); @@ -360,8 +359,7 @@ void func_80AF9C70(u8* shadowTexture, Player* player, PlayState* play) { for (phi_s1 = 0; phi_s1 < KREG(78); phi_s1++) { Matrix_Scale((KREG(79) / 100.0f) + 1.0f, 1.0f, (KREG(79) / 100.0f) + 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_sda.c", 877), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_sda.c", 877); gSPDisplayList(POLY_XLU_DISP++, D_80AFA3F8); } PRINTF("SDA D 2\n"); diff --git a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c index b351d6888d..8eb853a808 100644 --- a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -6,7 +6,7 @@ #include "z_en_shopnuts.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) void EnShopnuts_Init(Actor* thisx, PlayState* play); void EnShopnuts_Destroy(Actor* thisx, PlayState* play); @@ -21,7 +21,7 @@ void EnShopnuts_ThrowNut(EnShopnuts* this, PlayState* play); void EnShopnuts_Burrow(EnShopnuts* this, PlayState* play); void EnShopnuts_SpawnSalesman(EnShopnuts* this, PlayState* play); -ActorInit En_Shopnuts_InitVars = { +ActorProfile En_Shopnuts_Profile = { /**/ ACTOR_EN_SHOPNUTS, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -35,7 +35,7 @@ ActorInit En_Shopnuts_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -43,7 +43,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -58,7 +58,7 @@ static CollisionCheckInfoInit sColChkInfoInit = { 1, 20, 40, MASS_HEAVY }; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_BUSINESS_SCRUB, ICHAIN_CONTINUE), ICHAIN_F32(gravity, -1, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 2600, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 2600, ICHAIN_STOP), }; void EnShopnuts_Init(Actor* thisx, PlayState* play) { @@ -322,8 +322,7 @@ void EnShopnuts_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* } Matrix_Scale(x, y, z, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_shopnuts.c", 714), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_shopnuts.c", 714); gSPDisplayList(POLY_OPA_DISP++, gBusinessScrubNoseDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_shopnuts.c", 717); diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.c b/src/overlays/actors/ovl_En_Si/z_en_si.c index 33c7ce2f21..ece2b71957 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -6,7 +6,7 @@ #include "z_en_si.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_9) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_9) void EnSi_Init(Actor* thisx, PlayState* play); void EnSi_Destroy(Actor* thisx, PlayState* play); @@ -20,7 +20,7 @@ void func_80AFB950(EnSi* this, PlayState* play); static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_NO_PUSH | OC1_TYPE_ALL, @@ -28,7 +28,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000090, 0x00, 0x00 }, ATELEM_NONE, @@ -40,7 +40,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 D_80AFBADC = { 0, 0, 0, 0, MASS_IMMOVABLE }; -ActorInit En_Si_InitVars = { +ActorProfile En_Si_Profile = { /**/ ACTOR_EN_SI, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -132,7 +132,7 @@ void func_80AFB950(EnSi* this, PlayState* play) { if (!DISABLE_PLAYER_FREEZE && Message_GetState(&play->msgCtx) != TEXT_STATE_CLOSING) { player->actor.freezeTimer = 10; } else { - SET_GS_FLAGS((this->actor.params & 0x1F00) >> 8, this->actor.params & 0xFF); + SET_GS_FLAGS(PARAMS_GET_S(this->actor.params, 8, 5), PARAMS_GET_S(this->actor.params, 0, 8)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c index 0d28bea18f..20a655101a 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c @@ -18,7 +18,7 @@ void func_80AFC34C(EnSiofuki* this, PlayState* play); void func_80AFC544(EnSiofuki* this, PlayState* play); void func_80AFC478(EnSiofuki* this, PlayState* play); -ActorInit En_Siofuki_InitVars = { +ActorProfile En_Siofuki_Profile = { /**/ ACTOR_EN_SIOFUKI, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -51,7 +51,7 @@ void EnSiofuki_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); this->sfxFlags |= 1; - type = ((u16)thisx->params >> 0xC) & 0xF; + type = PARAMS_GET_U((u16)thisx->params, 12, 4); if (!((type == 0) || (type == 1))) { Actor_Kill(thisx); return; @@ -81,13 +81,13 @@ void EnSiofuki_Init(Actor* thisx, PlayState* play) { thisx->shape.rot.y = 0; thisx->shape.rot.z = 0; - type = ((u16)thisx->params >> 0xC) & 0xF; + type = PARAMS_GET_U((u16)thisx->params, 12, 4); if (type == EN_SIOFUKI_RAISING) { this->currentHeight = 10.0f; this->targetHeight = 10.0f; this->actionFunc = func_80AFC34C; } else if (type == EN_SIOFUKI_LOWERING) { - if (Flags_GetTreasure(play, (u16)thisx->params & 0x3F)) { + if (Flags_GetTreasure(play, PARAMS_GET_U((u16)thisx->params, 0, 6))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; this->actionFunc = func_80AFC544; @@ -190,8 +190,8 @@ void func_80AFC218(EnSiofuki* this, PlayState* play) { this->timer--; if (this->timer < 0) { - Flags_UnsetSwitch(play, ((u16)this->dyna.actor.params >> 6) & 0x3F); - switch (((u16)this->dyna.actor.params >> 0xC) & 0xF) { + Flags_UnsetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 6, 6)); + switch (PARAMS_GET_U((u16)this->dyna.actor.params, 12, 4)) { case EN_SIOFUKI_RAISING: this->targetHeight = 10.0f; this->actionFunc = func_80AFC34C; @@ -202,14 +202,14 @@ void func_80AFC218(EnSiofuki* this, PlayState* play) { break; } } else { - func_8002F994(&this->dyna.actor, this->timer); + Actor_PlaySfx_FlaggedTimer(&this->dyna.actor, this->timer); } - if (((((u16)this->dyna.actor.params >> 0xC) & 0xF) == EN_SIOFUKI_LOWERING) && - Flags_GetTreasure(play, (u16)this->dyna.actor.params & 0x3F)) { + if ((PARAMS_GET_U((u16)this->dyna.actor.params, 12, 4) == EN_SIOFUKI_LOWERING) && + Flags_GetTreasure(play, PARAMS_GET_U((u16)this->dyna.actor.params, 0, 6))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; - Flags_UnsetSwitch(play, ((u16)this->dyna.actor.params >> 6) & 0x3F); + Flags_UnsetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 6, 6)); this->actionFunc = func_80AFC544; } } @@ -219,7 +219,7 @@ void func_80AFC34C(EnSiofuki* this, PlayState* play) { func_80AFBE8C(this, play); func_80AFC1D0(this, play); - if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 6) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 6, 6))) { this->targetHeight = 400.0f; this->timer = 300; this->actionFunc = func_80AFC218; @@ -238,7 +238,7 @@ void func_80AFC3C8(EnSiofuki* this, PlayState* play) { this->actionFunc = func_80AFC218; } - if (Flags_GetTreasure(play, (u16)this->dyna.actor.params & 0x3F)) { + if (Flags_GetTreasure(play, PARAMS_GET_U((u16)this->dyna.actor.params, 0, 6))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; this->actionFunc = func_80AFC544; @@ -250,14 +250,14 @@ void func_80AFC478(EnSiofuki* this, PlayState* play) { func_80AFBE8C(this, play); func_80AFC1D0(this, play); - if (((u16)this->dyna.actor.params >> 0xC & 0xF) == EN_SIOFUKI_LOWERING) { - if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 6) & 0x3F)) { + if (PARAMS_GET_U((u16)this->dyna.actor.params, 12, 4) == EN_SIOFUKI_LOWERING) { + if (Flags_GetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 6, 6))) { this->timer = 20; this->actionFunc = func_80AFC3C8; OnePointCutscene_Init(play, 5010, 40, &this->dyna.actor, CAM_ID_MAIN); } - if (Flags_GetTreasure(play, (u16)this->dyna.actor.params & 0x3F)) { + if (Flags_GetTreasure(play, PARAMS_GET_U((u16)this->dyna.actor.params, 0, 6))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; this->actionFunc = func_80AFC544; @@ -286,21 +286,18 @@ void EnSiofuki_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); Matrix_Translate(0.0f, this->unk_170, 0.0f, MTXMODE_APPLY); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_siofuki.c", 662), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_siofuki.c", 662); x = gameplayFrames * 15; y = gameplayFrames * -15; gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, x, y, 64, 64, 1, x, y, 64, 64)); gSPDisplayList(POLY_XLU_DISP++, object_siofuki_DL_000B70); - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_en_siofuki.c", 674); if (this->sfxFlags & 1) { f32 heightRatio; - switch (((u16)thisx->params >> 0xC) & 0xF) { + switch (PARAMS_GET_U((u16)thisx->params, 12, 4)) { case EN_SIOFUKI_RAISING: heightRatio = (this->currentHeight - 10.0f) / (400.0f - 10.0f); func_800F436C(&thisx->projectedPos, NA_SE_EV_FOUNTAIN - SFX_FLAG, 1.0f + heightRatio); diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h index b291c5cd2a..23074bfac1 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef enum { +typedef enum EnSiofukiType { /* 0x00 */ EN_SIOFUKI_RAISING, /* 0x01 */ EN_SIOFUKI_LOWERING } EnSiofukiType; diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index c484ee2068..da5b8bd4bc 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -8,9 +8,9 @@ #include "overlays/actors/ovl_En_Encount1/z_en_encount1.h" #include "assets/objects/object_skb/object_skb.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) -typedef enum { +typedef enum StalchildBehavior { SKB_BEHAVIOR_BURIED, SKB_BEHAVIOR_DYING, SKB_BEHAVIOR_DAMAGED, @@ -43,7 +43,7 @@ void EnSkb_Death(EnSkb* this, PlayState* play); static ColliderJntSphElementInit sJntSphElementsInit[2] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -54,7 +54,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -67,7 +67,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[2] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -113,7 +113,7 @@ static DamageTable sDamageTable = { /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; -ActorInit En_Skb_InitVars = { +ActorProfile En_Skb_Profile = { /**/ ACTOR_EN_SKB, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -149,7 +149,7 @@ void EnSkb_SpawnDebris(PlayState* play, EnSkb* this, Vec3f* spawnPos) { } static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_STOP), }; @@ -160,7 +160,7 @@ void EnSkb_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.damageTable = &sDamageTable; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); this->actor.focus.pos = this->actor.world.pos; - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = 2; this->actor.shape.yOffset = -8000.0f; SkelAnime_Init(play, &this->skelAnime, &gStalchildSkel, &gStalchildUncurlingAnim, this->jointTable, @@ -210,7 +210,7 @@ void EnSkb_DecideNextAction(EnSkb* this) { void EnSkb_SetupRiseFromGround(EnSkb* this) { Animation_PlayOnceSetSpeed(&this->skelAnime, &gStalchildUncurlingAnim, 1.0f); this->actionState = SKB_BEHAVIOR_BURIED; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Actor_PlaySfx(&this->actor, NA_SE_EN_RIVA_APPEAR); EnSkb_SetupAction(this, EnSkb_RiseFromGround); } @@ -220,7 +220,7 @@ void EnSkb_RiseFromGround(EnSkb* this, PlayState* play) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; } else { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } Math_SmoothStepToF(&this->actor.shape.yOffset, 0.0f, 1.0f, 800.0f, 0.0f); Math_SmoothStepToF(&this->actor.shape.shadowScale, 25.0f, 1.0f, 2.5f, 0.0f); @@ -237,7 +237,7 @@ void EnSkb_SetupDespawn(EnSkb* this) { Animation_GetLastFrame(&gStalchildUncurlingAnim), 0.0f, ANIMMODE_ONCE, -4.0f); this->actionState = SKB_BEHAVIOR_BURIED; this->setColliderAT = false; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); EnSkb_SetupAction(this, EnSkb_Despawn); @@ -416,7 +416,7 @@ void EnSkb_SetupDeath(EnSkb* this, PlayState* play) { this->actor.speed = -6.0f; } this->actionState = SKB_BEHAVIOR_DYING; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; BodyBreak_Alloc(&this->bodyBreak, 18, play); this->breakFlags |= 4; EffectSsDeadSound_SpawnStationary(play, &this->actor.projectedPos, NA_SE_EN_STALKID_DEAD, 1, 1, 0x28); diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 46b7798b88..33203ceffc 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -2,7 +2,7 @@ #include "overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h" #include "assets/objects/object_skj/object_skj.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_25) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_25) void EnSkj_Init(Actor* thisx, PlayState* play2); void EnSkj_Destroy(Actor* thisx, PlayState* play); @@ -95,7 +95,7 @@ void EnSkj_SetupWaitInRange(EnSkj* this); #define songFailTimer multiuseTimer #define battleExitTimer multiuseTimer -typedef enum { +typedef enum SkullKidAnim { /* 0 */ SKJ_ANIM_BACKFLIP, /* 1 */ SKJ_ANIM_SHOOT_NEEDLE, /* 2 */ SKJ_ANIM_PLAY_FLUTE, @@ -108,18 +108,18 @@ typedef enum { /* 9 */ SKJ_ANIM_WAIT } SkullKidAnim; -typedef enum { +typedef enum SkullKidStumpSide { /* 0 */ SKULL_KID_LEFT, /* 1 */ SKULL_KID_RIGHT } SkullKidStumpSide; -typedef enum { +typedef enum SkullKidOcarinaGameState { /* 0 */ SKULL_KID_OCARINA_WAIT, /* 1 */ SKULL_KID_OCARINA_PLAY_NOTES, /* 2 */ SKULL_KID_OCARINA_LEAVE_GAME } SkullKidOcarinaGameState; -typedef enum { +typedef enum SkullKidAction { /* 00 */ SKJ_ACTION_FADE, /* 01 */ SKJ_ACTION_WAIT_TO_SHOOT_NEEDLE, /* 02 */ SKJ_ACTION_SARIA_SONG_IDLE, @@ -151,7 +151,7 @@ typedef enum { /* 28 */ SKJ_ACTION_OCARINA_GAME_LEAVE } SkullKidAction; -typedef struct { +typedef struct EnSkjUnkStruct { u8 unk_0; EnSkj* skullkid; } EnSkjUnkStruct; @@ -159,7 +159,7 @@ typedef struct { static EnSkjUnkStruct sSmallStumpSkullKid = { 0, NULL }; static EnSkjUnkStruct sOcarinaMinigameSkullKids[] = { { 0, NULL }, { 0, NULL } }; -ActorInit En_Skj_InitVars = { +ActorProfile En_Skj_Profile = { /**/ ACTOR_EN_SKJ, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -173,14 +173,14 @@ ActorInit En_Skj_InitVars = { static ColliderCylinderInitType1 D_80B01678 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x0, 0x08 }, { 0xFFCFFFFF, 0x0, 0x0 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -278,8 +278,8 @@ static EnSkjActionFunc sActionFuncs[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 30, ICHAIN_STOP), }; static s32 D_80B01EA0; // gets set if ACTOR_FLAG_TALK is set @@ -360,7 +360,7 @@ void EnSkj_SetNaviId(EnSkj* this) { } void EnSkj_Init(Actor* thisx, PlayState* play2) { - s16 type = (thisx->params >> 0xA) & 0x3F; + s16 type = PARAMS_GET_U(thisx->params, 10, 6); EnSkj* this = (EnSkj*)thisx; PlayState* play = play2; s32 pad; @@ -373,7 +373,7 @@ void EnSkj_Init(Actor* thisx, PlayState* play2) { this->actor.destroy = NULL; this->actor.draw = NULL; this->actor.update = EnSkj_SariasSongShortStumpUpdate; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); this->actor.flags |= 0; Actor_ChangeCategory(play, &play->actorCtx, thisx, ACTORCAT_PROP); break; @@ -384,7 +384,7 @@ void EnSkj_Init(Actor* thisx, PlayState* play2) { this->actor.destroy = NULL; this->actor.draw = NULL; this->actor.update = EnSkj_OcarinaMinigameShortStumpUpdate; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); this->actor.flags |= 0; Actor_ChangeCategory(play, &play->actorCtx, thisx, ACTORCAT_PROP); this->actor.focus.pos.x = 1230.0f; @@ -406,8 +406,8 @@ void EnSkj_Init(Actor* thisx, PlayState* play2) { SkelAnime_InitFlex(play, &this->skelAnime, &gSkullKidSkel, &gSkullKidPlayFluteAnim, this->jointTable, this->morphTable, 19); if ((type >= 0) && (type < 3)) { - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_NPC); } @@ -416,7 +416,7 @@ void EnSkj_Init(Actor* thisx, PlayState* play2) { } if ((type > 0) && (type < 3)) { - this->actor.targetMode = 7; + this->actor.attentionRangeType = ATTENTION_RANGE_7; this->posCopy = this->actor.world.pos; sOcarinaMinigameSkullKids[type - 1].unk_0 = 1; sOcarinaMinigameSkullKids[type - 1].skullkid = this; @@ -1211,14 +1211,14 @@ void EnSkj_SariasSongWaitForTextClear(EnSkj* this, PlayState* play) { } void EnSkj_OcarinaGameSetupWaitForPlayer(EnSkj* this) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnSkj_ChangeAnim(this, SKJ_ANIM_WAIT); EnSkj_SetupAction(this, SKJ_ACTION_OCARINA_GAME_WAIT_FOR_PLAYER); } void EnSkj_OcarinaGameWaitForPlayer(EnSkj* this, PlayState* play) { if (this->playerInRange) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; EnSkj_SetupAction(this, SKJ_ACTION_OCARINA_GAME_IDLE); } } @@ -1614,8 +1614,7 @@ void EnSkj_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Gfx_SetupDL_25Opa(play->state.gfxCtx); Matrix_Push(); Matrix_RotateZYX(-0x4000, 0, 0, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_skj.c", 2430), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_skj.c", 2430); gSPDisplayList(POLY_OPA_DISP++, gSkullKidSkullMaskDL); Matrix_Pop(); } diff --git a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c index df3f584f91..14da6adb97 100644 --- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c +++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c @@ -7,7 +7,7 @@ #include "z_en_skjneedle.h" #include "assets/objects/object_skj/object_skj.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_9) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_9) void EnSkjneedle_Init(Actor* thisx, PlayState* play); void EnSkjneedle_Destroy(Actor* thisx, PlayState* play); @@ -16,7 +16,7 @@ void EnSkjneedle_Draw(Actor* thisx, PlayState* play); s32 EnSkjNeedle_CollisionCheck(EnSkjneedle* this); -ActorInit En_Skjneedle_InitVars = { +ActorProfile En_Skjneedle_Profile = { /**/ ACTOR_EN_SKJNEEDLE, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -30,14 +30,14 @@ ActorInit En_Skjneedle_InitVars = { static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_HIT1, + COL_MATERIAL_HIT1, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -48,8 +48,8 @@ static ColliderCylinderInitType1 sCylinderInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 30, ICHAIN_STOP), }; void EnSkjneedle_Init(Actor* thisx, PlayState* play) { @@ -59,7 +59,7 @@ void EnSkjneedle_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinderType1(play, &this->collider, &this->actor, &sCylinderInit); ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 20.0f); - thisx->flags &= ~ACTOR_FLAG_0; + thisx->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Actor_SetScale(&this->actor, 0.01f); } @@ -104,8 +104,7 @@ void EnSkjneedle_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_skj_needle.c", 200); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_skj_needle.c", 205), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_skj_needle.c", 205); gSPDisplayList(POLY_OPA_DISP++, gSkullKidNeedleDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_skj_needle.c", 210); diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index e7b9d3ee0f..3d9c998742 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -1,14 +1,14 @@ #include "z_en_ssh.h" #include "assets/objects/object_ssh/object_ssh.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) #define SSH_STATE_STUNNED (1 << 0) #define SSH_STATE_GROUND_START (1 << 2) #define SSH_STATE_ATTACKED (1 << 3) #define SSH_STATE_SPIN (1 << 4) -typedef enum { +typedef enum EnSshAnimation { SSH_ANIM_UNK0, // Unused animation. Possibly being knocked back? SSH_ANIM_UP, SSH_ANIM_WAIT, @@ -30,7 +30,7 @@ void EnSsh_Start(EnSsh* this, PlayState* play); #include "assets/overlays/ovl_En_Ssh/ovl_En_Ssh.c" -ActorInit En_Ssh_InitVars = { +ActorProfile En_Ssh_Profile = { /**/ ACTOR_EN_SSH, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -44,7 +44,7 @@ ActorInit En_Ssh_InitVars = { static ColliderCylinderInit sCylinderInit1 = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -52,7 +52,7 @@ static ColliderCylinderInit sCylinderInit1 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -66,7 +66,7 @@ static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; static ColliderCylinderInit sCylinderInit2 = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -74,7 +74,7 @@ static ColliderCylinderInit sCylinderInit2 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -87,7 +87,7 @@ static ColliderCylinderInit sCylinderInit2 = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -100,7 +100,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -205,9 +205,9 @@ void EnSsh_InitColliders(EnSsh* this, PlayState* play) { this->colCylinder[1].elem.acDmgInfo.dmgFlags = DMG_DEFAULT & ~(DMG_ARROW | DMG_MAGIC_FIRE | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_EXPLOSIVE | DMG_DEKU_NUT) & ~(DMG_MAGIC_LIGHT | DMG_MAGIC_ICE); - this->colCylinder[2].base.colType = COLTYPE_METAL; + this->colCylinder[2].base.colMaterial = COL_MATERIAL_METAL; this->colCylinder[2].elem.acElemFlags = ACELEM_ON | ACELEM_HOOKABLE | ACELEM_NO_AT_INFO; - this->colCylinder[2].elem.elemType = ELEMTYPE_UNK2; + this->colCylinder[2].elem.elemMaterial = ELEM_MATERIAL_UNK2; this->colCylinder[2].elem.acDmgInfo.dmgFlags = DMG_DEFAULT & ~(DMG_ARROW | DMG_MAGIC_FIRE | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_EXPLOSIVE | DMG_DEKU_NUT); @@ -471,7 +471,7 @@ s32 EnSsh_CheckHitPlayer(EnSsh* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_STALTU_ROLL); Actor_PlaySfx(&this->actor, NA_SE_VO_ST_ATTACK); play->damagePlayer(play, -8); - func_8002F71C(play, &this->actor, 4.0f, this->actor.yawTowardsPlayer, 6.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.yawTowardsPlayer, 6.0f); this->hitCount--; return true; } diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index b7983ad59b..8c79f61db2 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -7,7 +7,7 @@ #include "z_en_st.h" #include "assets/objects/object_st/object_st.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) void EnSt_Init(Actor* thisx, PlayState* play); void EnSt_Destroy(Actor* thisx, PlayState* play); @@ -23,7 +23,7 @@ void EnSt_FinishBouncing(EnSt* this, PlayState* play); #include "assets/overlays/ovl_En_St/ovl_En_St.c" -ActorInit En_St_InitVars = { +ActorProfile En_St_Profile = { /**/ ACTOR_EN_ST, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -37,7 +37,7 @@ ActorInit En_St_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -45,7 +45,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -59,7 +59,7 @@ static CollisionCheckInfoInit2 sColChkInit = { 2, 0, 0, 0, MASS_IMMOVABLE }; static ColliderCylinderInit sCylinderInit2 = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -67,7 +67,7 @@ static ColliderCylinderInit sCylinderInit2 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -80,7 +80,7 @@ static ColliderCylinderInit sCylinderInit2 = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -93,7 +93,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -104,7 +104,7 @@ static ColliderJntSphInit sJntSphInit = { sJntSphElementsInit, }; -typedef enum { +typedef enum EnStAnimation { /* 0 */ ENST_ANIM_0, /* 1 */ ENST_ANIM_1, /* 2 */ ENST_ANIM_2, @@ -291,9 +291,9 @@ void EnSt_InitColliders(EnSt* this, PlayState* play) { DMG_DEFAULT & ~(DMG_MAGIC_FIRE | DMG_ARROW | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT) & ~(DMG_MAGIC_LIGHT | DMG_MAGIC_ICE); - this->colCylinder[2].base.colType = COLTYPE_METAL; + this->colCylinder[2].base.colMaterial = COL_MATERIAL_METAL; this->colCylinder[2].elem.acElemFlags = ACELEM_ON | ACELEM_HOOKABLE | ACELEM_NO_AT_INFO; - this->colCylinder[2].elem.elemType = ELEMTYPE_UNK2; + this->colCylinder[2].elem.elemMaterial = ELEM_MATERIAL_UNK2; this->colCylinder[2].elem.acDmgInfo.dmgFlags = DMG_DEFAULT & ~(DMG_MAGIC_FIRE | DMG_ARROW | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT); @@ -352,7 +352,7 @@ s32 EnSt_SetCylinderOC(EnSt* this, PlayState* play) { cyloffsets[i].z *= this->colliderScale; Matrix_Push(); Matrix_Translate(cylPos.x, cylPos.y, cylPos.z, MTXMODE_NEW); - Matrix_RotateY(BINANG_TO_RAD_ALT(this->initalYaw), MTXMODE_APPLY); + Matrix_RotateY(BINANG_TO_RAD_ALT(this->initialYaw), MTXMODE_APPLY); Matrix_MultVec3f(&cyloffsets[i], &cylPos); Matrix_Pop(); this->colCylinder[i + 3].dim.pos.x = cylPos.x; @@ -404,7 +404,7 @@ s32 EnSt_CheckHitPlayer(EnSt* this, PlayState* play) { this->gaveDamageSpinTimer = 30; play->damagePlayer(play, -8); Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT); - func_8002F71C(play, &this->actor, 4.0f, this->actor.yawTowardsPlayer, 6.0f); + Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.yawTowardsPlayer, 6.0f); return true; } @@ -467,7 +467,7 @@ s32 EnSt_CheckHitBackside(EnSt* this, PlayState* play) { return false; } Enemy_StartFinishingBlow(play, &this->actor); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->groundBounces = 3; this->deathTimer = 20; this->actor.gravity = -1.0f; @@ -623,7 +623,7 @@ void EnSt_UpdateYaw(EnSt* this, PlayState* play) { // calculate the new yaw to or away from the player. rot = this->actor.shape.rot; - yawTarget = (this->actionFunc == EnSt_WaitOnGround ? this->actor.yawTowardsPlayer : this->initalYaw); + yawTarget = (this->actionFunc == EnSt_WaitOnGround ? this->actor.yawTowardsPlayer : this->initialYaw); yawDiff = rot.y - (yawTarget ^ yawDir); if (ABS(yawDiff) <= 0x4000) { Math_SmoothStepToS(&rot.y, yawTarget ^ yawDir, 4, 0x2000, 1); @@ -714,7 +714,7 @@ s32 EnSt_IsCloseToPlayer(EnSt* this, PlayState* play) { return true; } -s32 EnSt_IsCloseToInitalPos(EnSt* this) { +s32 EnSt_IsCloseToInitialPos(EnSt* this) { f32 velY = this->actor.velocity.y; f32 checkY = this->actor.world.pos.y + (velY * 2.0f); @@ -802,7 +802,7 @@ void EnSt_Init(Actor* thisx, PlayState* play) { this->actor.flags |= ACTOR_FLAG_24; EnSt_SetColliderScale(this); this->actor.gravity = 0.0f; - this->initalYaw = this->actor.world.rot.y; + this->initialYaw = this->actor.world.rot.y; EnSt_SetupAction(this, EnSt_StartOnCeilingOrGround); } @@ -926,7 +926,7 @@ void EnSt_ReturnToCeiling(EnSt* this, PlayState* play) { // player came back into range EnSt_SetDropAnimAndVel(this); EnSt_SetupAction(this, EnSt_MoveToGround); - } else if (EnSt_IsCloseToInitalPos(this)) { + } else if (EnSt_IsCloseToInitialPos(this)) { // the Skulltula is close to the initial postion. EnSt_SetWaitingAnimation(this); EnSt_SetupAction(this, EnSt_WaitOnCeiling); diff --git a/src/overlays/actors/ovl_En_St/z_en_st.h b/src/overlays/actors/ovl_En_St/z_en_st.h index 5b65c82e42..4200ca0d32 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.h +++ b/src/overlays/actors/ovl_En_St/z_en_st.h @@ -15,7 +15,7 @@ typedef struct EnSt { /* 0x0194 */ ColliderCylinder colCylinder[6]; /* 0x035C */ ColliderJntSph colSph; /* 0x037C */ ColliderJntSphElement colSphItems[1]; - /* 0x03BC */ s16 initalYaw; + /* 0x03BC */ s16 initialYaw; /* 0x03BE */ s16 deathYawTarget; /* 0x03C0 */ s16 groundBounces; /* 0x03C2 */ s16 animFrames; diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 66416baba9..acf8e5885a 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -9,7 +9,7 @@ #include "assets/objects/object_ahg/object_ahg.h" #include "assets/objects/object_boj/object_boj.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) void EnSth_Init(Actor* thisx, PlayState* play); void EnSth_Destroy(Actor* thisx, PlayState* play); @@ -22,7 +22,7 @@ void EnSth_ParentRewardObtainedWait(EnSth* this, PlayState* play); void EnSth_RewardUnobtainedWait(EnSth* this, PlayState* play); void EnSth_ChildRewardObtainedWait(EnSth* this, PlayState* play); -ActorInit En_Sth_InitVars = { +ActorProfile En_Sth_Profile = { /**/ ACTOR_EN_STH, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -38,7 +38,7 @@ ActorInit En_Sth_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, @@ -46,7 +46,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -61,8 +61,7 @@ static s16 sObjectIds[6] = { }; static FlexSkeletonHeader* sSkeletons[6] = { - &object_ahg_Skel_0000F0, &object_boj_Skel_0000F0, &object_boj_Skel_0000F0, - &object_boj_Skel_0000F0, &object_boj_Skel_0000F0, &object_boj_Skel_0000F0, + &gHylianMan1Skel, &gHylianMan2Skel, &gHylianMan2Skel, &gHylianMan2Skel, &gHylianMan2Skel, &gHylianMan2Skel, }; static AnimationHeader* sAnimations[6] = { @@ -131,7 +130,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) { EnSth_SetupAction(this, EnSth_WaitForObject); this->actor.draw = NULL; this->unk_2B2 = 0; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; } void EnSth_SetupShapeColliderUpdate2AndDraw(EnSth* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.c b/src/overlays/actors/ovl_En_Stream/z_en_stream.c index cc6cf457d5..57ff345d61 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c @@ -15,7 +15,7 @@ void EnStream_Update(Actor* thisx, PlayState* play); void EnStream_Draw(Actor* thisx, PlayState* play); void EnStream_WaitForPlayer(EnStream* this, PlayState* play); -ActorInit En_Stream_InitVars = { +ActorProfile En_Stream_Profile = { /**/ ACTOR_EN_STREAM, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -38,7 +38,7 @@ void EnStream_SetupAction(EnStream* this, EnStreamActionFunc actionFunc) { void EnStream_Init(Actor* thisx, PlayState* play) { EnStream* this = (EnStream*)thisx; - this->unk_150 = thisx->params & 0xFF; + this->unk_150 = PARAMS_GET_U(thisx->params, 0, 8); Actor_ProcessInitChain(thisx, sInitChain); if ((this->unk_150 != 0) && (this->unk_150 == 1)) { thisx->scale.y = 0.01f; @@ -124,7 +124,7 @@ void EnStream_Update(Actor* thisx, PlayState* play) { EnStream* this = (EnStream*)thisx; this->actionFunc(this, play); - func_8002F948(thisx, NA_SE_EV_WHIRLPOOL - SFX_FLAG); + Actor_PlaySfx_FlaggedCentered2(thisx, NA_SE_EV_WHIRLPOOL - SFX_FLAG); } void EnStream_Draw(Actor* thisx, PlayState* play) { @@ -133,8 +133,7 @@ void EnStream_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_stream.c", 295); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_stream.c", 299), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_stream.c", 299); multipliedFrames = frames * 20; gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, frames * 30, -multipliedFrames, 0x40, 0x40, 1, diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 6ffffd208c..2e1091eda7 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -1,7 +1,7 @@ #include "z_en_sw.h" #include "assets/objects/object_st/object_st.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) void EnSw_Init(Actor* thisx, PlayState* play); void EnSw_Destroy(Actor* thisx, PlayState* play); @@ -20,7 +20,7 @@ void func_80B0D3AC(EnSw* this, PlayState* play); void func_80B0DB00(EnSw* this, PlayState* play); void func_80B0D878(EnSw* this, PlayState* play); -ActorInit En_Sw_InitVars = { +ActorProfile En_Sw_Profile = { /**/ ACTOR_EN_SW, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -34,20 +34,20 @@ ActorInit En_Sw_InitVars = { static ColliderJntSphElementInit sJntSphItemsInit[1] = { { - { ELEMTYPE_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFC3FFFE, 0x00, 0x00 }, 0x01, 0x05, 0x01 }, + { ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFC3FFFE, 0x00, 0x00 }, 0x01, 0x05, 0x01 }, { 2, { { 0, -300, 0 }, 21 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_HIT6, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { COL_MATERIAL_HIT6, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, 1, sJntSphItemsInit, }; static CollisionCheckInfoInit2 D_80B0F074 = { 1, 2, 25, 25, MASS_IMMOVABLE }; -typedef enum { +typedef enum EnSwAnimation { /* 0 */ ENSW_ANIM_0, /* 1 */ ENSW_ANIM_1, /* 2 */ ENSW_ANIM_2, @@ -220,18 +220,18 @@ void EnSw_Init(Actor* thisx, PlayState* play) { Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; s32 pad; - if (thisx->params & 0x8000) { - phi_v0 = (((thisx->params - 0x8000) & 0xE000) >> 0xD) + 1; - thisx->params = (thisx->params & 0x1FFF) | (phi_v0 << 0xD); + if (PARAMS_GET_NOSHIFT(thisx->params, 15, 1)) { + phi_v0 = PARAMS_GET_S(thisx->params - 0x8000, 13, 3) + 1; + thisx->params = PARAMS_GET_S(thisx->params, 0, 13) | (phi_v0 << 0xD); } - if (((thisx->params & 0xE000) >> 0xD) > 0) { - phi_v0 = ((thisx->params & 0x1F00) >> 8) - 1; - thisx->params = (thisx->params & 0xE0FF) | (phi_v0 << 8); + if (PARAMS_GET_S(thisx->params, 13, 3) > 0) { + phi_v0 = PARAMS_GET_S(thisx->params, 8, 5) - 1; + thisx->params = (thisx->params & ~(0x1F << 8)) | (phi_v0 << 8); } // Check to see if this gold skull token has already been retrieved. - if (GET_GS_FLAGS((thisx->params & 0x1F00) >> 8) & (thisx->params & 0xFF)) { + if (GET_GS_FLAGS(PARAMS_GET_S(thisx->params, 8, 5)) & PARAMS_GET_S(thisx->params, 0, 8)) { Actor_Kill(&this->actor); return; } @@ -244,7 +244,7 @@ void EnSw_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0xE), &D_80B0F074); this->actor.scale.x = 0.02f; - if (((thisx->params & 0xE000) >> 0xD) == 0) { + if (PARAMS_GET_S(thisx->params, 13, 3) == 0) { this->actor.world.rot.x = 0; this->actor.world.rot.z = 0; thisx->shape.rot = this->actor.world.rot; @@ -266,12 +266,12 @@ void EnSw_Init(Actor* thisx, PlayState* play) { func_80B0C0CC(this, play, 1); } - if (((thisx->params & 0xE000) >> 0xD) >= 3) { + if (PARAMS_GET_S(thisx->params, 13, 3) >= 3) { Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - switch ((thisx->params & 0xE000) >> 0xD) { + switch (PARAMS_GET_S(thisx->params, 13, 3)) { case 3: case 4: this->unk_360 = 1; @@ -286,7 +286,7 @@ void EnSw_Init(Actor* thisx, PlayState* play) { this->collider.elements[0].base.atDmgInfo.damage *= 2; this->actor.naviEnemyId = NAVI_ENEMY_GOLD_SKULLTULA; this->actor.colChkInfo.health *= 2; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; break; default: Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); @@ -299,11 +299,11 @@ void EnSw_Init(Actor* thisx, PlayState* play) { this->actor.home.pos = this->actor.world.pos; thisx->shape.rot = this->actor.world.rot; - if (((thisx->params & 0xE000) >> 0xD) >= 3) { + if (PARAMS_GET_S(thisx->params, 13, 3) >= 3) { this->unk_38C = 0x28; this->unk_394 = 1; this->actionFunc = func_80B0D364; - } else if (((thisx->params & 0xE000) >> 0xD) == 0) { + } else if (PARAMS_GET_S(thisx->params, 13, 3) == 0) { this->actionFunc = func_80B0E5E0; } else { this->actionFunc = func_80B0D590; @@ -319,7 +319,7 @@ void EnSw_Destroy(Actor* thisx, PlayState* play) { s32 func_80B0C9F0(EnSw* this, PlayState* play) { s32 phi_v1 = false; - if (this->actor.xyzDistToPlayerSq < SQ(400.0f) && ((this->actor.params & 0xE000) >> 0xD) == 0 && + if (this->actor.xyzDistToPlayerSq < SQ(400.0f) && PARAMS_GET_S(this->actor.params, 13, 3) == 0 && play->actorCtx.unk_02 != 0) { this->actor.colChkInfo.damage = this->actor.colChkInfo.health; @@ -336,7 +336,7 @@ s32 func_80B0C9F0(EnSw* this, PlayState* play) { return true; } Enemy_StartFinishingBlow(play, &this->actor); - if (((this->actor.params & 0xE000) >> 0xD) != 0) { + if (PARAMS_GET_S(this->actor.params, 13, 3) != 0) { this->skelAnime.playSpeed = 8.0f; if ((play->state.frames & 1) == 0) { this->unk_420 = 0.1f; @@ -353,7 +353,7 @@ s32 func_80B0C9F0(EnSw* this, PlayState* play) { this->unk_38A = 2; this->actor.shape.shadowScale = 16.0f; this->actor.gravity = -1.0f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = func_80B0DB00; } @@ -370,7 +370,7 @@ s32 func_80B0C9F0(EnSw* this, PlayState* play) { } void func_80B0CBE8(EnSw* this, PlayState* play) { - if ((((this->actor.params & 0xE000) >> 0xD) > 0) && (this->actionFunc != func_80B0D590)) { + if ((PARAMS_GET_S(this->actor.params, 13, 3) > 0) && (this->actionFunc != func_80B0D590)) { if (this->unk_392 != 0) { this->unk_392--; } @@ -438,8 +438,8 @@ void func_80B0CEA8(EnSw* this, PlayState* play) { Camera* activeCam = GET_ACTIVE_CAM(play); if (!(Math_Vec3f_DistXYZ(&this->actor.world.pos, &activeCam->eye) >= 380.0f)) { - Actor_PlaySfx(&this->actor, - ((this->actor.params & 0xE000) >> 0xD) > 0 ? NA_SE_EN_STALGOLD_ROLL : NA_SE_EN_STALWALL_ROLL); + Actor_PlaySfx(&this->actor, (PARAMS_GET_S(this->actor.params, 13, 3) > 0) ? NA_SE_EN_STALGOLD_ROLL + : NA_SE_EN_STALWALL_ROLL); } } } @@ -483,7 +483,7 @@ void func_80B0D14C(EnSw* this, PlayState* play, s32 cnt) { } void func_80B0D364(EnSw* this, PlayState* play) { - if (((this->actor.params & 0xE000) >> 0xD) == 4) { + if (PARAMS_GET_S(this->actor.params, 13, 3) == 4) { this->unk_38C = 0; this->actionFunc = func_80B0D3AC; } else { @@ -536,7 +536,7 @@ void func_80B0D3AC(EnSw* this, PlayState* play) { void func_80B0D590(EnSw* this, PlayState* play) { f32 sp2C; - if (((this->actor.params & 0xE000) >> 0xD) == 2) { + if (PARAMS_GET_S(this->actor.params, 13, 3) == 2) { if (this->actor.scale.x < 0.0139999995f) { this->collider.elements[0].base.atElemFlags = ATELEM_NONE; this->collider.elements[0].base.acElemFlags = ACELEM_NONE; @@ -560,7 +560,7 @@ void func_80B0D590(EnSw* this, PlayState* play) { this->unk_420 = ((play->state.frames % 2) == 0) ? 0.1f : -0.1f; this->unk_38A = 1; this->unk_38C = Rand_S16Offset(30, 60); - if (((this->actor.params & 0xE000) >> 0xD) != 0) { + if (PARAMS_GET_S(this->actor.params, 13, 3) != 0) { this->unk_38C *= 2; this->unk_420 *= 2.0f; } @@ -571,7 +571,7 @@ void func_80B0D590(EnSw* this, PlayState* play) { this->unk_38E = Rand_S16Offset(15, 30); this->unk_38A = 0; this->skelAnime.playSpeed = 0.0f; - if (((this->actor.params & 0xE000) >> 0xD) != 0) { + if (PARAMS_GET_S(this->actor.params, 13, 3) != 0) { this->unk_38E /= 2; } } else if (this->unk_38A != 0) { @@ -581,7 +581,7 @@ void func_80B0D590(EnSw* this, PlayState* play) { if (this->skelAnime.playSpeed > 0.0f) { func_80B0CEA8(this, play); } - if (((this->actor.params & 0xE000) >> 0xD) != 0) { + if (PARAMS_GET_S(this->actor.params, 13, 3) != 0) { this->skelAnime.playSpeed *= 2.0f; } } else { @@ -910,7 +910,7 @@ s32 EnSw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po OPEN_DISPS(play->state.gfxCtx, "../z_en_sw.c", 2084); - if (((this->actor.params & 0xE000) >> 0xD) != 0) { + if (PARAMS_GET_S(this->actor.params, 13, 3) != 0) { switch (limbIndex) { case 23: *dList = object_st_DL_004788; @@ -1001,7 +1001,7 @@ void EnSw_Draw(Actor* thisx, PlayState* play) { EnSw* this = (EnSw*)thisx; Color_RGBA8 sp30 = { 184, 0, 228, 255 }; - if (((this->actor.params & 0xE000) >> 0xD) != 0) { + if (PARAMS_GET_S(this->actor.params, 13, 3) != 0) { Matrix_RotateX(DEG_TO_RAD(-80), MTXMODE_APPLY); if (this->actor.colChkInfo.health != 0) { Matrix_Translate(0.0f, 0.0f, 200.0f, MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c index 7bc74fe59a..5532ffe3e1 100644 --- a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c +++ b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c @@ -6,7 +6,7 @@ #define FLAGS ACTOR_FLAG_4 -typedef enum { +typedef enum EnSyatekItemRound { SYATEKI_ROUND_GREEN_APPEAR, SYATEKI_ROUND_BLUE_SEQUENTIAL, SYATEKI_ROUND_GREEN_THROW, @@ -27,7 +27,7 @@ void EnSyatekiItm_CheckTargets(EnSyatekiItm* this, PlayState* play); void EnSyatekiItm_CleanupGame(EnSyatekiItm* this, PlayState* play); void EnSyatekiItm_EndGame(EnSyatekiItm* this, PlayState* play); -ActorInit En_Syateki_Itm_InitVars = { +ActorProfile En_Syateki_Itm_Profile = { /**/ ACTOR_EN_SYATEKI_ITM, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h index c7e01a776b..c670208bec 100644 --- a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h +++ b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h @@ -8,14 +8,14 @@ struct EnSyatekiItm; typedef void (*EnSyatekiItmActionFunc)(struct EnSyatekiItm*, PlayState*); -typedef enum { +typedef enum EnSyatekiSignal { /* 0 */ ENSYATEKI_NONE, /* 1 */ ENSYATEKI_START, /* 2 */ ENSYATEKI_END, /* 3 */ ENSYATEKI_RESULTS } EnSyatekiSignal; -typedef enum { +typedef enum EnSyatekiHitState { /* 0 */ ENSYATEKIHIT_NONE, /* 1 */ ENSYATEKIHIT_MISS, /* 2 */ ENSYATEKIHIT_HIT diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 4afe186840..8068310a5e 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -3,9 +3,9 @@ #include "overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h" #include "assets/objects/object_ossan/object_ossan.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_27) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_LOCK_ON_DISABLED) -typedef enum { +typedef enum EnSyatekiManGameResult { /* 0 */ SYATEKI_RESULT_NONE, /* 1 */ SYATEKI_RESULT_WINNER, /* 2 */ SYATEKI_RESULT_ALMOST, @@ -13,7 +13,7 @@ typedef enum { /* 4 */ SYATEKI_RESULT_REFUSE } EnSyatekiManGameResult; -typedef enum { +typedef enum EnSyatekiManTextIdx { /* 0 */ SYATEKI_TEXT_CHOICE, /* 1 */ SYATEKI_TEXT_START_GAME, /* 2 */ SYATEKI_TEXT_NO_RUPEES, @@ -44,7 +44,7 @@ void EnSyatekiMan_Blink(EnSyatekiMan* this); void EnSyatekiMan_SetBgm(void); #endif -ActorInit En_Syateki_Man_InitVars = { +ActorProfile En_Syateki_Man_Profile = { /**/ ACTOR_EN_SYATEKI_MAN, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -160,7 +160,7 @@ void EnSyatekiMan_Init(Actor* thisx, PlayState* play) { PRINTF("\n\n"); // "Old man appeared!! Muhohohohohohohon" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 親父登場!!むほほほほほほほーん ☆☆☆☆☆ \n" VT_RST); - this->actor.targetMode = 1; + this->actor.attentionRangeType = ATTENTION_RANGE_1; Actor_SetScale(&this->actor, 0.01f); SkelAnime_InitFlex(play, &this->skelAnime, &gObjectOssanSkel, &gObjectOssanAnim_000338, this->jointTable, this->morphTable, 9); @@ -415,7 +415,7 @@ void EnSyatekiMan_FinishPrize(EnSyatekiMan* this, PlayState* play) { } this->gameResult = SYATEKI_RESULT_NONE; this->actor.parent = this->tempGallery; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnSyatekiMan_SetupIdle; } } @@ -430,7 +430,7 @@ void EnSyatekiMan_RestartGame(EnSyatekiMan* this, PlayState* play) { this->gameResult = SYATEKI_RESULT_NONE; this->actionFunc = EnSyatekiMan_WaitForGame; // "Let's try again! Baby!" - PRINTF(VT_FGCOL(BLUE) "再挑戦だぜ!ベイビー!" VT_RST "\n", this); + PRINTF(VT_FGCOL(BLUE) "再挑戦だぜ!ベイビー!" VT_RST "\n"); } } } diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index 9da826cd60..566a866f9a 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -26,7 +26,7 @@ void EnSyatekiNiw_ExitArchery(EnSyatekiNiw* this, PlayState* play); void EnSyatekiNiw_SpawnFeather(EnSyatekiNiw* this, Vec3f* pos, Vec3f* vel, Vec3f* accel, f32 scale); -ActorInit En_Syateki_Niw_InitVars = { +ActorProfile En_Syateki_Niw_Profile = { /**/ ACTOR_EN_SYATEKI_NIW, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -40,7 +40,7 @@ ActorInit En_Syateki_Niw_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT5, + COL_MATERIAL_HIT5, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -48,7 +48,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -59,16 +59,16 @@ static ColliderCylinderInit sCylinderInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 1, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_1, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 0, ICHAIN_STOP), }; void EnSyatekiNiw_Init(Actor* thisx, PlayState* play) { EnSyatekiNiw* this = (EnSyatekiNiw*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoSkel, &gCuccoAnim, this->jointTable, this->morphTable, 16); @@ -782,8 +782,7 @@ void EnSyatekiNiw_DrawEffects(EnSyatekiNiw* this, PlayState* play) { Matrix_RotateZ(effect->rot, MTXMODE_APPLY); Matrix_Translate(0.0f, -1000.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_syateki_niw.c", 1251), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_syateki_niw.c", 1251); gSPDisplayList(POLY_XLU_DISP++, gCuccoEffectFeatherModelDL); } } diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h index 5f1cfcf723..0ec9b9914a 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h @@ -8,7 +8,7 @@ struct EnSyatekiNiw; typedef void (*EnSyatekiNiwActionFunc)(struct EnSyatekiNiw*, PlayState*); -typedef struct { +typedef struct EnSyatekiNiwEffect { /* 0x00 */ u8 state; /* 0x0C */ Vec3f pos; /* 0x10 */ Vec3f vel; @@ -34,7 +34,7 @@ typedef struct EnSyatekiNiw { /* 0x025A */ s16 archeryTimer; /* 0x025C */ s16 hopTimer; // intervals of jumping /* 0x025E */ s16 movementTimer; // intervals of changing location - /* 0x0260 */ s16 sootTimer; // cucco is covered in soot, smoke emmits + /* 0x0260 */ s16 sootTimer; // cucco is covered in soot, smoke emits /* 0x0262 */ s16 cluckTimer; // intervals of clucking SFX /* 0x0264 */ f32 headRotXTarget; /* 0x0268 */ f32 rightWingRotXTarget; @@ -70,7 +70,7 @@ typedef struct EnSyatekiNiw { /* 0x0348 */ EnSyatekiNiwEffect effects[EN_SYATEKI_NIW_EFFECT_COUNT]; // feather particles } EnSyatekiNiw; // size = 0x0460 -typedef enum { +typedef enum EnSyatekiMinigame { SYATEKI_MINIGAME_ARCHERY, // unused archery game behavior SYATEKI_MINIGAME_ALLEY // Bombchu Alley behavior } EnSyatekiMinigame; diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index b9575cf6eb..6990af1ac8 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -8,7 +8,7 @@ #include "terminal.h" #include "assets/objects/object_ta/object_ta.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) #define TALON_STATE_FLAG_TRACKING_PLAYER (1 << 0) #define TALON_STATE_FLAG_GIVING_MILK_REFILL (1 << 1) @@ -21,14 +21,14 @@ #define TALON_STATE_FLAG_RAISING_HANDS (1 << 8) #define TALON_STATE_FLAG_RESTORE_BGM_ON_DESTROY (1 << 9) -typedef enum { +typedef enum TalonEyeIndex { /* 0 */ TALON_EYE_INDEX_OPEN, /* 1 */ TALON_EYE_INDEX_HALF, /* 2 */ TALON_EYE_INDEX_CLOSED, /* 3 */ TALON_EYE_INDEX_MAX } TalonEyeIndex; -typedef enum { +typedef enum TalonCanBuyMilkResult { /* 0 */ TALON_CANBUYMILK_NOT_ENOUGH_RUPEES, /* 1 */ TALON_CANBUYMILK_NO_EMPTY_BOTTLE, /* 2 */ TALON_CANBUYMILK_SUCCESS @@ -57,7 +57,7 @@ void EnTa_AnimSleeping(EnTa* this); void EnTa_AnimSitSleeping(EnTa* this); void EnTa_AnimRunToEnd(EnTa* this); -ActorInit En_Ta_InitVars = { +ActorProfile En_Ta_Profile = { /**/ ACTOR_EN_TA, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -71,7 +71,7 @@ ActorInit En_Ta_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -79,7 +79,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000004, 0x00, 0x00 }, ATELEM_NONE, @@ -148,7 +148,7 @@ void EnTa_Init(Actor* thisx, PlayState* play2) { this->blinkTimer = 20; this->blinkFunc = EnTa_BlinkWaitUntilNext; Actor_SetScale(&this->actor, 0.01f); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->actor.velocity.y = -4.0f; this->actor.minVelocityY = -4.0f; this->actor.gravity = -1.0f; @@ -622,7 +622,7 @@ s32 EnTa_IsPlayerHoldingSuperCucco(EnTa* this, PlayState* play, s32 cuccoIdx) { Player* player = GET_PLAYER(play); Actor* interactRangeActor; - if (player->stateFlags1 & PLAYER_STATE1_11) { + if (player->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) { interactRangeActor = player->interactRangeActor; if (interactRangeActor != NULL && interactRangeActor->id == ACTOR_EN_NIW && interactRangeActor == &this->superCuccos[cuccoIdx]->actor) { @@ -658,7 +658,7 @@ void EnTa_TalkFoundSuperCucco(EnTa* this, PlayState* play) { if (player->heldActor == &this->superCuccos[lastFoundSuperCuccoIdx]->actor) { player->heldActor = NULL; } - player->stateFlags1 &= ~PLAYER_STATE1_11; + player->stateFlags1 &= ~PLAYER_STATE1_CARRYING_ACTOR; this->superCuccos[lastFoundSuperCuccoIdx] = NULL; } this->stateFlags |= TALON_STATE_FLAG_TRACKING_PLAYER; @@ -668,7 +668,7 @@ void EnTa_IdleFoundSuperCucco(EnTa* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, play)) { this->actionFunc = EnTa_TalkFoundSuperCucco; // Unset auto-talking - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } else { Actor_OfferTalk(&this->actor, play, 1000.0f); } @@ -784,7 +784,7 @@ void EnTa_RunCuccoGame(EnTa* this, PlayState* play) { this->actionFunc = EnTa_IdleFoundSuperCucco; // Automatically talk to player - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Actor_OfferTalk(&this->actor, play, 1000.0f); return; } @@ -1130,9 +1130,9 @@ void EnTa_IdleAfterCuccoGameFinished(EnTa* this, PlayState* play) { this->actionFunc = EnTa_TalkAfterCuccoGameWon; break; } - this->actor.flags &= ~ACTOR_FLAG_16; + this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } else { - this->actor.flags |= ACTOR_FLAG_16; + this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Actor_OfferTalk(&this->actor, play, 1000.0f); } this->stateFlags |= TALON_STATE_FLAG_TRACKING_PLAYER; diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.h b/src/overlays/actors/ovl_En_Ta/z_en_ta.h index 8f7e1f8b5c..eeab7dc775 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.h +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.h @@ -12,13 +12,13 @@ typedef void (*EnTaActionFunc)(struct EnTa*, PlayState*); typedef void (*EnTaBlinkFunc)(struct EnTa*); typedef void (*EnTaAnimFunc)(struct EnTa*); -typedef enum { +typedef enum EnTaType { /* 0xFFFF */ ENTA_CHILD_ERA = -1, /* 0x0001 */ ENTA_IN_KAKARIKO = 1, /* 0x0002 */ ENTA_RETURNED_FROM_KAKARIKO } EnTaType; -typedef enum { +typedef enum EnTaLimb { /* 0x00 */ ENTA_LIMB_NONE, /* 0x01 */ ENTA_LIMB_ROOT, /* 0x02 */ ENTA_LIMB_LEFT_THIGH, diff --git a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c index b0c4c92495..87e2b836ea 100644 --- a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c +++ b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c @@ -6,9 +6,11 @@ #include "z_en_takara_man.h" #include "terminal.h" +#include "versions.h" #include "assets/objects/object_ts/object_ts.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_27) +#define FLAGS \ + (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_LOCK_ON_DISABLED) void EnTakaraMan_Init(Actor* thisx, PlayState* play); void EnTakaraMan_Destroy(Actor* thisx, PlayState* play); @@ -22,7 +24,7 @@ void func_80B17934(EnTakaraMan* this, PlayState* play); void func_80B17A6C(EnTakaraMan* this, PlayState* play); void func_80B17AC4(EnTakaraMan* this, PlayState* play); -ActorInit En_Takara_Man_InitVars = { +ActorProfile En_Takara_Man_Profile = { /**/ ACTOR_EN_TAKARA_MAN, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -66,7 +68,7 @@ void EnTakaraMan_Init(Actor* thisx, PlayState* play) { this->originalRoomNum = thisx->room; thisx->room = -1; thisx->world.rot.y = thisx->shape.rot.y = -0x4E20; - thisx->targetMode = 1; + thisx->attentionRangeType = ATTENTION_RANGE_1; this->actionFunc = func_80B176E0; } @@ -113,11 +115,11 @@ void func_80B1778C(EnTakaraMan* this, PlayState* play) { absYawDiff = ABS(yawDiff); if (absYawDiff < 0x4300) { if (play->roomCtx.curRoom.num != this->originalRoomNum) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->unk_218 = 0; } else { if (!this->unk_218) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->unk_218 = 1; } Actor_OfferTalk(&this->actor, play, 100.0f); @@ -160,7 +162,11 @@ void func_80B17A6C(EnTakaraMan* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actionFunc = func_80B17AC4; } else { +#if OOT_VERSION < NTSC_1_1 + Actor_OfferGetItem(&this->actor, play, GI_SMALL_KEY, 2000.0f, 1000.0f); +#else Actor_OfferGetItem(&this->actor, play, GI_DOOR_KEY, 2000.0f, 1000.0f); +#endif } } diff --git a/src/overlays/actors/ovl_En_Tana/z_en_tana.c b/src/overlays/actors/ovl_En_Tana/z_en_tana.c index d0fe9cc39f..fec4be1e3b 100644 --- a/src/overlays/actors/ovl_En_Tana/z_en_tana.c +++ b/src/overlays/actors/ovl_En_Tana/z_en_tana.c @@ -7,7 +7,7 @@ #include "z_en_tana.h" #include "assets/objects/object_shop_dungen/object_shop_dungen.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnTana_Init(Actor* thisx, PlayState* play); void EnTana_Destroy(Actor* thisx, PlayState* play); @@ -15,7 +15,7 @@ void EnTana_Update(Actor* thisx, PlayState* play); void EnTana_DrawWoodenShelves(Actor* thisx, PlayState* play); void EnTana_DrawStoneShelves(Actor* thisx, PlayState* play); -ActorInit En_Tana_InitVars = { +ActorProfile En_Tana_Profile = { /**/ ACTOR_EN_TANA, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -63,7 +63,7 @@ void EnTana_Init(Actor* thisx, PlayState* play) { PRINTF("☆☆☆ %s ☆☆☆\n", sShelfTypes[thisx->params]); Actor_SetScale(thisx, 1.0f); - thisx->flags &= ~ACTOR_FLAG_0; + thisx->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; thisx->draw = sDrawFuncs[thisx->params]; } @@ -79,8 +79,7 @@ void EnTana_DrawWoodenShelves(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_tana.c", 148); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_tana.c", 152), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_tana.c", 152); gSPDisplayList(POLY_OPA_DISP++, sShelfDLists[thisx->params]); CLOSE_DISPS(play->state.gfxCtx, "../z_en_tana.c", 157); @@ -93,8 +92,7 @@ void EnTana_DrawStoneShelves(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sStoneTextures[thisx->params])); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_tana.c", 169), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_tana.c", 169); gSPDisplayList(POLY_OPA_DISP++, sShelfDLists[thisx->params]); CLOSE_DISPS(play->state.gfxCtx, "../z_en_tana.c", 174); diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index 96a2a2e87b..b3a7fc6ccf 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -7,7 +7,7 @@ #include "z_en_test.h" #include "assets/objects/object_sk2/object_sk2.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) void EnTest_Init(Actor* thisx, PlayState* play); void EnTest_Destroy(Actor* thisx, PlayState* play); @@ -125,7 +125,7 @@ static u8 sUpperBodyLimbCopyMap[] = { false, // STALFOS_LIMB_WAIST }; -ActorInit En_Test_InitVars = { +ActorProfile En_Test_Profile = { /**/ ACTOR_EN_TEST, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -139,7 +139,7 @@ ActorInit En_Test_InitVars = { static ColliderCylinderInit sBodyColliderInit = { { - COLTYPE_HIT5, + COL_MATERIAL_HIT5, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -147,7 +147,7 @@ static ColliderCylinderInit sBodyColliderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -159,7 +159,7 @@ static ColliderCylinderInit sBodyColliderInit = { static ColliderCylinderInit sShieldColliderInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, @@ -167,7 +167,7 @@ static ColliderCylinderInit sShieldColliderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFC1FFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -179,7 +179,7 @@ static ColliderCylinderInit sShieldColliderInit = { static ColliderQuadInit sSwordColliderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -187,7 +187,7 @@ static ColliderQuadInit sSwordColliderInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL | ATELEM_UNK7, @@ -197,7 +197,7 @@ static ColliderQuadInit sSwordColliderInit = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -typedef enum { +typedef enum StalfosDamageEffect { /* 0x0 */ STALFOS_DMGEFF_NORMAL, /* 0x1 */ STALFOS_DMGEFF_STUN, /* 0x6 */ STALFOS_DMGEFF_FIREMAGIC = 6, @@ -243,7 +243,7 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_STALFOS, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 500, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 500, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 15, ICHAIN_CONTINUE), ICHAIN_F32(scale.y, 0, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1500, ICHAIN_STOP), @@ -335,7 +335,7 @@ void EnTest_ChooseRandomAction(EnTest* this, PlayState* play) { case 5: case 6: if ((this->actor.xzDistToPlayer < 220.0f) && (this->actor.xzDistToPlayer > 170.0f) && - Actor_IsFacingPlayer(&this->actor, 0x71C) && Actor_IsTargeted(play, &this->actor)) { + Actor_IsFacingPlayer(&this->actor, 0x71C) && Actor_IsLockedOn(play, &this->actor)) { EnTest_SetupJumpslash(this); break; } @@ -395,7 +395,7 @@ void EnTest_ChooseAction(EnTest* this, PlayState* play) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnTest_SetupJumpBack(this); } else if ((this->actor.xzDistToPlayer < 220.0f) && (this->actor.xzDistToPlayer > 170.0f)) { - if (Actor_IsFacingPlayer(&this->actor, 0x71C) && !Actor_IsTargeted(play, &this->actor)) { + if (Actor_IsFacingPlayer(&this->actor, 0x71C) && !Actor_IsLockedOn(play, &this->actor)) { EnTest_SetupJumpslash(this); } } else { @@ -404,8 +404,8 @@ void EnTest_ChooseAction(EnTest* this, PlayState* play) { } else { if (this->actor.xzDistToPlayer < 110.0f) { if (Rand_ZeroOne() > 0.2f) { - if (player->stateFlags1 & PLAYER_STATE1_4) { - if (this->actor.isTargeted) { + if (player->stateFlags1 & PLAYER_STATE1_HOSTILE_LOCK_ON) { + if (this->actor.isLockedOn) { EnTest_SetupSlashDown(this); } else { func_808627C4(this, play); @@ -429,7 +429,7 @@ void EnTest_SetupWaitGround(EnTest* this) { this->timer = 15; this->actor.scale.y = 0.0f; this->actor.world.pos.y = this->actor.home.pos.y - 3.5f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnTest_SetupAction(this, EnTest_WaitGround); } @@ -459,7 +459,7 @@ void EnTest_SetupWaitAbove(EnTest* this) { this->unk_7C8 = 0; this->actor.world.pos.y = this->actor.home.pos.y + 150.0f; Actor_SetScale(&this->actor, 0.0f); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnTest_SetupAction(this, EnTest_WaitAbove); } @@ -469,7 +469,7 @@ void EnTest_WaitAbove(EnTest* this, PlayState* play) { if ((this->actor.xzDistToPlayer < 200.0f) && (ABS(this->actor.yDistToPlayer) < 450.0f)) { EnTest_SetupAction(this, EnTest_Fall); - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; Actor_SetScale(&this->actor, 0.015f); } @@ -512,7 +512,7 @@ void EnTest_Idle(EnTest* this, PlayState* play) { if (Actor_IsFacingPlayer(&this->actor, 0x1555)) { if ((this->actor.xzDistToPlayer < 220.0f) && (this->actor.xzDistToPlayer > 160.0f) && (Rand_ZeroOne() < 0.3f)) { - if (Actor_IsTargeted(play, &this->actor)) { + if (Actor_IsLockedOn(play, &this->actor)) { EnTest_SetupJumpslash(this); } else { func_808627C4(this, play); @@ -578,7 +578,7 @@ void EnTest_WalkAndBlock(EnTest* this, PlayState* play) { if (!EnTest_ReactToProjectile(play, this)) { this->timer++; - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { checkDist = 150.0f; } @@ -659,13 +659,13 @@ void EnTest_WalkAndBlock(EnTest* this, PlayState* play) { if ((this->actor.xzDistToPlayer < 220.0f) && (this->actor.xzDistToPlayer > 160.0f) && (Actor_IsFacingPlayer(&this->actor, 0x71C))) { - if (Actor_IsTargeted(play, &this->actor)) { + if (Actor_IsLockedOn(play, &this->actor)) { if (Rand_ZeroOne() < 0.1f) { EnTest_SetupJumpslash(this); return; } } else if (player->heldItemAction != PLAYER_IA_NONE) { - if (this->actor.isTargeted) { + if (this->actor.isLockedOn) { if ((play->gameplayFrames % 2) != 0) { func_808627C4(this, play); return; @@ -690,8 +690,8 @@ void EnTest_WalkAndBlock(EnTest* this, PlayState* play) { if (this->actor.xzDistToPlayer < 110.0f) { if (Rand_ZeroOne() > 0.2f) { - if (player->stateFlags1 & PLAYER_STATE1_4) { - if (this->actor.isTargeted) { + if (player->stateFlags1 & PLAYER_STATE1_HOSTILE_LOCK_ON) { + if (this->actor.isLockedOn) { EnTest_SetupSlashDown(this); } else { func_808627C4(this, play); @@ -845,7 +845,7 @@ void func_80860F84(EnTest* this, PlayState* play) { } } - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { checkDist = 200.0f; } @@ -975,8 +975,8 @@ void EnTest_SlashDownEnd(EnTest* this, PlayState* play) { if ((ABS(yawDiff) > 0x3E80) && (this->actor.params != STALFOS_TYPE_CEILING)) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnTest_SetupJumpBack(this); - } else if (player->stateFlags1 & PLAYER_STATE1_4) { - if (this->actor.isTargeted) { + } else if (player->stateFlags1 & PLAYER_STATE1_HOSTILE_LOCK_ON) { + if (this->actor.isLockedOn) { EnTest_SetupSlashDown(this); } else if ((play->gameplayFrames % 2) != 0) { func_808627C4(this, play); @@ -1067,7 +1067,7 @@ void EnTest_JumpBack(EnTest* this, PlayState* play) { this->timer = (Rand_ZeroOne() * 5.0f) + 5.0f; } } - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } } else if (this->skelAnime.curFrame == (this->skelAnime.endFrame - 4.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_M_GND); @@ -1345,7 +1345,7 @@ void EnTest_Stunned(EnTest* this, PlayState* play) { // a variation of sidestep void func_808627C4(EnTest* this, PlayState* play) { - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { func_80860EC0(this); return; } @@ -1421,7 +1421,7 @@ void func_808628C8(EnTest* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y + 0x3FFF; - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { checkDist = 200.0f; } @@ -1457,9 +1457,9 @@ void func_808628C8(EnTest* this, PlayState* play) { } if (this->timer == 0) { - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { EnTest_SetupIdle(this); - } else if (Actor_IsTargeted(play, &this->actor)) { + } else if (Actor_IsLockedOn(play, &this->actor)) { if (!EnTest_ReactToProjectile(play, this)) { EnTest_ChooseAction(this, play); } @@ -1489,7 +1489,7 @@ void func_80862DBC(EnTest* this, PlayState* play) { this->swordState = -1; } - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if (this->actor.params == STALFOS_TYPE_5) { Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP); @@ -1518,7 +1518,7 @@ void func_80862E6C(EnTest* this, PlayState* play) { } this->actor.child = NULL; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; EnTest_SetupJumpBack(this); } else if ((this->actor.params == STALFOS_TYPE_5) && !Actor_FindNearby(play, &this->actor, ACTOR_EN_TEST, ACTORCAT_ENEMY, 8000.0f)) { @@ -1537,7 +1537,7 @@ void func_80862FA8(EnTest* this, PlayState* play) { Animation_PlayOnce(&this->skelAnime, &gStalfosFallOverBackwardsAnim); Actor_PlaySfx(&this->actor, NA_SE_EN_STAL_DEAD); this->unk_7DE = 0; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.colorFilterTimer = 0; this->actor.speed = 0.0f; @@ -1571,7 +1571,7 @@ void func_808630F0(EnTest* this, PlayState* play) { this->actor.speed = 0.0f; if (this->actor.params <= STALFOS_TYPE_CEILING) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnTest_SetupAction(this, func_8086318C); } else { func_80862DBC(this, play); @@ -1593,7 +1593,7 @@ void func_8086318C(EnTest* this, PlayState* play) { void EnTest_SetupRecoil(EnTest* this) { this->swordState = 0; - this->skelAnime.moveFlags = ANIM_FLAG_UPDATE_Y; + this->skelAnime.movementFlags = ANIM_FLAG_UPDATE_Y; this->unk_7C8 = 0x13; this->skelAnime.playSpeed = -1.0f; this->skelAnime.startFrame = this->skelAnime.curFrame; @@ -1811,10 +1811,10 @@ void EnTest_Update(Actor* thisx, PlayState* play) { if (this->actor.params == STALFOS_TYPE_INVISIBLE) { if (play->actorCtx.lensActive) { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_REACT_TO_LENS; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_REACT_TO_LENS; this->actor.shape.shadowDraw = ActorShadow_DrawFeet; } else { - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_REACT_TO_LENS); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_REACT_TO_LENS); this->actor.shape.shadowDraw = NULL; } } @@ -2007,7 +2007,7 @@ s32 EnTest_ReactToProjectile(PlayState* play, EnTest* this) { } if (Math_Vec3f_DistXYZ(&this->actor.world.pos, &projectileActor->world.pos) < 200.0f) { - if (Actor_IsTargeted(play, &this->actor) && (projectileActor->id == ACTOR_ARMS_HOOK)) { + if (Actor_IsLockedOn(play, &this->actor) && (projectileActor->id == ACTOR_ARMS_HOOK)) { EnTest_SetupJumpUp(this); } else if (ABS(yawToProjectile) < 0x2000) { EnTest_SetupStopAndBlock(this); @@ -2020,7 +2020,7 @@ s32 EnTest_ReactToProjectile(PlayState* play, EnTest* this) { return true; } - if (Actor_IsTargeted(play, &this->actor) && (projectileActor->id == ACTOR_ARMS_HOOK)) { + if (Actor_IsLockedOn(play, &this->actor) && (projectileActor->id == ACTOR_ARMS_HOOK)) { EnTest_SetupJumpUp(this); return true; } diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.h b/src/overlays/actors/ovl_En_Test/z_en_test.h index 3ddf9f7238..397682cd5a 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.h +++ b/src/overlays/actors/ovl_En_Test/z_en_test.h @@ -8,7 +8,7 @@ struct EnTest; typedef void (*EnTestActionFunc)(struct EnTest*, PlayState*); -typedef enum { +typedef enum StalfosLimb { /* 0x00 */ STALFOS_LIMB_NONE, /* 0x01 */ STALFOS_LIMB_ROOT, /* 0x02 */ STALFOS_LIMB_UPPERBODY_ROOT, @@ -102,7 +102,7 @@ typedef struct EnTest { /* 0x8DC */ ColliderCylinder shieldCollider; } EnTest; // size = 0x928 -typedef enum { +typedef enum StalfosType { /* 0 */ STALFOS_TYPE_INVISIBLE, /* 1 */ STALFOS_TYPE_1, /* 2 */ STALFOS_TYPE_2, diff --git a/src/overlays/actors/ovl_En_Tg/z_en_tg.c b/src/overlays/actors/ovl_En_Tg/z_en_tg.c index 403ea500f9..42f32f0eb7 100644 --- a/src/overlays/actors/ovl_En_Tg/z_en_tg.c +++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.c @@ -7,7 +7,7 @@ #include "z_en_tg.h" #include "assets/objects/object_mu/object_mu.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnTg_Init(Actor* thisx, PlayState* play); void EnTg_Destroy(Actor* thisx, PlayState* play); @@ -18,7 +18,7 @@ void EnTg_SpinIfNotTalking(EnTg* this, PlayState* play); static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -26,7 +26,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -38,7 +38,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -ActorInit En_Tg_InitVars = { +ActorProfile En_Tg_Profile = { /**/ ACTOR_EN_TG, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -115,7 +115,7 @@ void EnTg_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; Actor_SetScale(&this->actor, 0.01f); this->nextDialogue = play->state.frames % 2; this->actionFunc = EnTg_SpinIfNotTalking; diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index f9ab171274..eb28e6a164 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -10,7 +10,7 @@ #include "terminal.h" #include "assets/objects/object_tite/object_tite.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) // EnTite_Idle #define vIdleTimer actionVar1 @@ -23,7 +23,7 @@ #define vOnBackTimer actionVar1 #define vLegTwitchTimer actionVar2 -typedef enum { +typedef enum EnTiteAction { /* 0x0 */ TEKTITE_DEATH_CRY, /* 0x1 */ TEKTITE_UNK_1, /* 0x2 */ TEKTITE_UNK_2, @@ -39,14 +39,14 @@ typedef enum { /* 0xC */ TEKTITE_MOVE_TOWARD_PLAYER } EnTiteAction; -typedef enum { +typedef enum EnTiteAttackState { /* 0x0 */ TEKTITE_BEGIN_LUNGE, /* 0x1 */ TEKTITE_MID_LUNGE, /* 0x2 */ TEKTITE_LANDED, /* 0x2 */ TEKTITE_SUBMERGED } EnTiteAttackState; -typedef enum { +typedef enum EnTiteFlipState { /* 0x0 */ TEKTITE_INITIAL, /* 0x1 */ TEKTITE_UNFLIPPED, /* 0x2 */ TEKTITE_FLIPPED @@ -74,7 +74,7 @@ void EnTite_FallApart(EnTite* this, PlayState* play); void EnTite_FlipOnBack(EnTite* this, PlayState* play); void EnTite_FlipUpright(EnTite* this, PlayState* play); -ActorInit En_Tite_InitVars = { +ActorProfile En_Tite_Profile = { /**/ ACTOR_EN_TITE, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -89,7 +89,7 @@ ActorInit En_Tite_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -102,7 +102,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT6, + COL_MATERIAL_HIT6, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -150,7 +150,7 @@ static DamageTable sDamageTable[] = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_RED_TEKTITE, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_F32(minVelocityY, -40, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_STOP), }; @@ -177,7 +177,7 @@ void EnTite_Init(Actor* thisx, PlayState* play) { EnTite* this = (EnTite*)thisx; Actor_ProcessInitChain(thisx, sInitChain); - thisx->targetMode = 3; + thisx->attentionRangeType = ATTENTION_RANGE_3; Actor_SetScale(thisx, 0.01f); SkelAnime_Init(play, &this->skelAnime, &object_tite_Skel_003A20, &object_tite_Anim_0012E4, this->jointTable, this->morphTable, 25); diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.h b/src/overlays/actors/ovl_En_Tite/z_en_tite.h index 2faaadf9cb..a049cabaae 100755 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.h +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.h @@ -8,7 +8,7 @@ struct EnTite; typedef void (*EnTiteActionFunc)(struct EnTite*, PlayState*); -typedef enum { +typedef enum EnTiteType { /* -2 */ TEKTITE_BLUE = -2, /* -1 */ TEKTITE_RED } EnTiteType; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 5d6ae8c752..6950eb6cb2 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -8,7 +8,7 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_tk/object_tk.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnTk_Init(Actor* thisx, PlayState* play); void EnTk_Destroy(Actor* thisx, PlayState* play); @@ -20,7 +20,7 @@ void EnTk_Rest(EnTk* this, PlayState* play); void EnTk_Walk(EnTk* this, PlayState* play); void EnTk_Dig(EnTk* this, PlayState* play); -ActorInit En_Tk_InitVars = { +ActorProfile En_Tk_Profile = { /**/ ACTOR_EN_TK, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -113,8 +113,7 @@ void EnTkEff_Draw(EnTk* this, PlayState* play) { Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(eff->size, eff->size, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_tk_eff.c", 140), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_tk_eff.c", 140); imageIdx = eff->timeLeft * ((f32)ARRAY_COUNT(dustTextures) / eff->timeTotal); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTextures[imageIdx])); @@ -141,7 +140,7 @@ s32 EnTkEff_CreateDflt(EnTk* this, Vec3f* pos, u8 duration, f32 size, f32 growth static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -149,7 +148,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -499,7 +498,7 @@ void EnTk_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->actor.gravity = -0.1f; this->currentReward = -1; this->currentSpot = NULL; diff --git a/src/overlays/actors/ovl_En_Torch/z_en_torch.c b/src/overlays/actors/ovl_En_Torch/z_en_torch.c index 95623b0de9..e60e16c0de 100644 --- a/src/overlays/actors/ovl_En_Torch/z_en_torch.c +++ b/src/overlays/actors/ovl_En_Torch/z_en_torch.c @@ -10,7 +10,7 @@ void EnTorch_Init(Actor* thisx, PlayState* play); -ActorInit En_Torch_InitVars = { +ActorProfile En_Torch_Profile = { /**/ ACTOR_EN_TORCH, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 8c3c1c90a8..41ed3883e7 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -6,10 +6,11 @@ #include "z_en_torch2.h" #include "assets/objects/object_torch2/object_torch2.h" +#include "versions.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) -typedef enum { +typedef enum EnTorch2ActionStates { /* 0 */ ENTORCH2_WAIT, /* 1 */ ENTORCH2_ATTACK, /* 2 */ ENTORCH2_DEATH, @@ -21,7 +22,7 @@ void EnTorch2_Destroy(Actor* thisx, PlayState* play); void EnTorch2_Update(Actor* thisx, PlayState* play2); void EnTorch2_Draw(Actor* thisx, PlayState* play2); -ActorInit En_Torch2_InitVars = { +ActorProfile En_Torch2_Profile = { /**/ ACTOR_EN_TORCH2, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -103,7 +104,7 @@ void EnTorch2_Init(Actor* thisx, PlayState* play2) { this->cylinder.base.acFlags = AC_ON | AC_TYPE_PLAYER; this->meleeWeaponQuads[0].base.atFlags = this->meleeWeaponQuads[1].base.atFlags = AT_ON | AT_TYPE_ENEMY; this->meleeWeaponQuads[0].base.acFlags = this->meleeWeaponQuads[1].base.acFlags = AC_ON | AC_HARD | AC_TYPE_PLAYER; - this->meleeWeaponQuads[0].base.colType = this->meleeWeaponQuads[1].base.colType = COLTYPE_METAL; + this->meleeWeaponQuads[0].base.colMaterial = this->meleeWeaponQuads[1].base.colMaterial = COL_MATERIAL_METAL; this->meleeWeaponQuads[0].elem.atDmgInfo.damage = this->meleeWeaponQuads[1].elem.atDmgInfo.damage = 8; this->meleeWeaponQuads[0].elem.acElemFlags = this->meleeWeaponQuads[1].elem.acElemFlags = ACELEM_ON; this->shieldQuad.base.atFlags = AT_ON | AT_TYPE_ENEMY; @@ -218,7 +219,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { this->skelAnime.playSpeed = 0.0f; this->actor.world.pos.x = (Math_SinS(this->actor.world.rot.y) * 25.0f) + sSpawnPoint.x; this->actor.world.pos.z = (Math_CosS(this->actor.world.rot.y) * 25.0f) + sSpawnPoint.z; - if ((this->actor.xzDistToPlayer <= 120.0f) || Actor_IsTargeted(play, &this->actor) || + if ((this->actor.xzDistToPlayer <= 120.0f) || Actor_IsLockedOn(play, &this->actor) || (attackItem != NULL)) { if (attackItem != NULL) { sDodgeRollState = 1; @@ -327,7 +328,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { player->skelAnime.curFrame = 3.0f; sStickAngle = this->actor.yawTowardsPlayer + 0x8000; sSwordJumpTimer = sSwordJumpState = 0; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } else if (sSwordJumpState == 1) { if (sSwordJumpTimer < 16) { EnTorch2_SwingSword(play, input, this); @@ -355,12 +356,12 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { if ((this->meleeWeaponState == 0) && (sCounterState == 0) && (player->invincibilityTimer == 0) && (player->meleeWeaponAnimation == PLAYER_MWA_STAB_1H) && - (this->actor.xzDistToPlayer <= 85.0f) && Actor_IsTargeted(play, &this->actor)) { + (this->actor.xzDistToPlayer <= 85.0f) && Actor_IsLockedOn(play, &this->actor)) { sStickTilt = 0.0f; sSwordJumpState = 1; player->stateFlags3 |= PLAYER_STATE3_2; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; sSwordJumpTimer = 27; player->meleeWeaponState = 0; player->speedXZ = 0.0f; @@ -407,7 +408,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { sStickAngle = thisx->yawTowardsPlayer; if ((90.0f >= this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 70.0f) && (ABS(sp5A) >= 0x7800) && - (this->actor.isTargeted || !(player->stateFlags1 & PLAYER_STATE1_22))) { + (this->actor.isLockedOn || !(player->stateFlags1 & PLAYER_STATE1_22))) { EnTorch2_SwingSword(play, input, this); } else { f32 sp50 = 0.0f; @@ -422,7 +423,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { } else if (this->actor.xzDistToPlayer <= 50 + sp50) { sStickTilt = 127.0f; sStickAngle = this->actor.yawTowardsPlayer; - if (!this->actor.isTargeted) { + if (!this->actor.isLockedOn) { Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); } } else if (this->actor.xzDistToPlayer > 100.0f + sp50) { @@ -432,7 +433,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { (this->actor.xzDistToPlayer >= 280.0f)) { sStickTilt = 127.0f; sStickAngle = this->actor.yawTowardsPlayer; - if (!this->actor.isTargeted) { + if (!this->actor.isLockedOn) { Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); } @@ -443,7 +444,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { !EnTorch2_SwingSword(play, input, this)) { sStickAngle = this->actor.yawTowardsPlayer; sStickTilt = 127.0f; - if (!this->actor.isTargeted) { + if (!this->actor.isLockedOn) { Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); } } @@ -486,13 +487,18 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { input->cur.stick_x = input->cur.stick_y = 0; if ((this->invincibilityTimer > 0) && (this->actor.world.pos.y < (this->actor.floorHeight - 160.0f))) { this->stateFlags3 &= ~PLAYER_STATE3_0; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->invincibilityTimer = 0; this->actor.velocity.y = 0.0f; this->actor.world.pos.y = sSpawnPoint.y + 40.0f; this->actor.world.pos.x = (Math_SinS(player->actor.shape.rot.y) * -120.0f) + player->actor.world.pos.x; this->actor.world.pos.z = (Math_CosS(player->actor.shape.rot.y) * -120.0f) + player->actor.world.pos.z; - if (Actor_WorldDistXYZToPoint(&this->actor, &sSpawnPoint) > 800.0f) { +#if OOT_VERSION < NTSC_1_2 + if (Actor_WorldDistXYZToPoint(&this->actor, &sSpawnPoint) > 1000.0f) +#else + if (Actor_WorldDistXYZToPoint(&this->actor, &sSpawnPoint) > 800.0f) +#endif + { f32 sp50 = Rand_ZeroOne() * 20.0f; s16 sp4E = Rand_CenteredFloat(4000.0f); @@ -506,7 +512,9 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { } else { this->actor.world.pos.y = this->actor.floorHeight; } +#if OOT_VERSION >= NTSC_1_2 Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); +#endif play->func_11D54(this, play); sActionState = ENTORCH2_ATTACK; sStickTilt = 0.0f; @@ -572,12 +580,12 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { if (!Actor_ApplyDamage(&this->actor)) { func_800F5B58(); - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); - this->unk_8A1 = 2; - this->unk_8A4 = 6.0f; - this->unk_8A8 = 6.0f; - this->unk_8A0 = this->actor.colChkInfo.damage; - this->unk_8A2 = this->actor.yawTowardsPlayer + 0x8000; + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); + this->knockbackType = PLAYER_KNOCKBACK_LARGE; + this->knockbackSpeed = 6.0f; + this->knockbackYVelocity = 6.0f; + this->knockbackDamage = this->actor.colChkInfo.damage; + this->knockbackRot = this->actor.yawTowardsPlayer + 0x8000; sDeathFlag++; sActionState = ENTORCH2_DEATH; Enemy_StartFinishingBlow(play, &this->actor); @@ -592,12 +600,12 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, 80); } } else { - this->actor.flags &= ~ACTOR_FLAG_0; - this->unk_8A0 = this->actor.colChkInfo.damage; - this->unk_8A1 = 1; - this->unk_8A8 = 6.0f; - this->unk_8A4 = 8.0f; - this->unk_8A2 = this->actor.yawTowardsPlayer + 0x8000; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; + this->knockbackDamage = this->actor.colChkInfo.damage; + this->knockbackType = PLAYER_KNOCKBACK_SMALL; + this->knockbackYVelocity = 6.0f; + this->knockbackSpeed = 8.0f; + this->knockbackRot = this->actor.yawTowardsPlayer + 0x8000; Actor_SetDropFlag(&this->actor, &this->cylinder.elem, true); this->stateFlags3 &= ~PLAYER_STATE3_2; this->stateFlags3 |= PLAYER_STATE3_0; @@ -610,7 +618,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { } } this->actor.colChkInfo.damage = 0; - this->unk_8A0 = 0; + this->knockbackDamage = PLAYER_KNOCKBACK_NONE; } // Handles being frozen by a deku nut @@ -697,11 +705,11 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { sDodgeRollState = (this->invincibilityTimer > 0) ? 2 : 0; } if (this->invincibilityTimer != 0) { - this->cylinder.base.colType = COLTYPE_NONE; - this->cylinder.elem.elemType = ELEMTYPE_UNK5; + this->cylinder.base.colMaterial = COL_MATERIAL_NONE; + this->cylinder.elem.elemMaterial = ELEM_MATERIAL_UNK5; } else { - this->cylinder.base.colType = COLTYPE_HIT5; - this->cylinder.elem.elemType = ELEMTYPE_UNK1; + this->cylinder.base.colMaterial = COL_MATERIAL_HIT5; + this->cylinder.elem.elemMaterial = ELEM_MATERIAL_UNK1; } /* * Handles the jump movement onto Link's sword. Dark Link doesn't move during the diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index 38e5f46d53..4b27209fca 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -7,7 +7,7 @@ #include "z_en_toryo.h" #include "assets/objects/object_toryo/object_toryo.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnToryo_Init(Actor* thisx, PlayState* play); void EnToryo_Destroy(Actor* thisx, PlayState* play); @@ -18,7 +18,7 @@ void EnToryo_Idle(EnToryo* this, PlayState* play); s32 EnToryo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx); void EnToryo_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx); -ActorInit En_Toryo_InitVars = { +ActorProfile En_Toryo_Profile = { /**/ ACTOR_EN_TORYO, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -32,7 +32,7 @@ ActorInit En_Toryo_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -40,7 +40,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -127,7 +127,7 @@ void EnToryo_Init(Actor* thisx, PlayState* play) { Animation_GetLastFrame(sEnToryoAnimation.animation), sEnToryoAnimation.mode, sEnToryoAnimation.morphFrames); this->stateFlags |= 8; - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->actionFunc = EnToryo_Idle; } @@ -248,7 +248,7 @@ u32 EnToryo_ReactToExchangeItem(EnToryo* this, PlayState* play) { ret = 0x200F; } } - //! @bug return value may be unitialized + //! @bug return value may be uninitialized return ret; } @@ -367,7 +367,7 @@ void EnToryo_Update(Actor* thisx, PlayState* play) { } rot = thisx->yawTowardsPlayer - thisx->shape.rot.y; - if ((rot < 14563.0f) && (rot > -14563.0f)) { + if ((rot < DEG_TO_BINANG2(80.0f)) && (rot > DEG_TO_BINANG2(-80.0f))) { Npc_TrackPoint(thisx, &this->interactInfo, 0, NPC_TRACKING_HEAD_AND_TORSO); } else { Npc_TrackPoint(thisx, &this->interactInfo, 0, NPC_TRACKING_NONE); diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c index cf99f6eca4..cadc1f45da 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -5,6 +5,7 @@ */ #include "z_en_tp.h" +#include "versions.h" #include "assets/objects/object_tp/object_tp.h" #define FLAGS 0 @@ -29,7 +30,7 @@ void EnTp_Head_Wait(EnTp* this, PlayState* play); void EnTp_Head_SetupBurrowReturnHome(EnTp* this); void EnTp_Head_BurrowReturnHome(EnTp* this, PlayState* play); -typedef enum { +typedef enum TailpasaranAction { /* 0 */ TAILPASARAN_ACTION_FRAGMENT_FADE, /* 1 */ TAILPASARAN_ACTION_DIE, /* 2 */ TAILPASARAN_ACTION_TAIL_FOLLOWHEAD, @@ -39,7 +40,7 @@ typedef enum { /* 9 */ TAILPASARAN_ACTION_HEAD_BURROWRETURNHOME } TailpasaranAction; -ActorInit En_Tp_InitVars = { +ActorProfile En_Tp_Profile = { /**/ ACTOR_EN_TP, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -54,7 +55,7 @@ ActorInit En_Tp_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x03, 0x08 }, { 0xFFCFFFFF, 0x01, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -67,7 +68,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_HIT1, + COL_MATERIAL_HIT1, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -78,7 +79,7 @@ static ColliderJntSphInit sJntSphInit = { sJntSphElementsInit, }; -typedef enum { +typedef enum TailpasaranDamageEffect { /* 00 */ TAILPASARAN_DMGEFF_NONE, /* 01 */ TAILPASARAN_DMGEFF_DEKUNUT, /* 14 */ TAILPASARAN_DMGEFF_SHOCKING = 14, // Kills the Tailpasaran but shocks Player @@ -121,7 +122,7 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 10, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 10, ICHAIN_STOP), }; void EnTp_SetupAction(EnTp* this, EnTpActionFunc actionFunc) { @@ -136,7 +137,7 @@ void EnTp_Init(Actor* thisx, PlayState* play2) { s32 i; Actor_ProcessInitChain(&this->actor, sInitChain); - this->actor.targetMode = 3; + this->actor.attentionRangeType = ATTENTION_RANGE_3; this->actor.colChkInfo.damageTable = &sDamageTable; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.14f); this->unk_150 = 0; @@ -153,7 +154,7 @@ void EnTp_Init(Actor* thisx, PlayState* play2) { this->collider.elements[0].dim.modelSphere.radius = this->collider.elements[0].dim.worldSphere.radius = 8; EnTp_Head_SetupWait(this); this->actor.focus.pos = this->actor.world.pos; - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4; Actor_SetScale(&this->actor, 1.5f); for (i = 0; i <= 6; i++) { @@ -170,7 +171,7 @@ void EnTp_Init(Actor* thisx, PlayState* play2) { Actor_SetScale(&next->actor, 0.3f); if (i == 2) { - next->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4; + next->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4; next->unk_150 = 1; // Why? } @@ -211,13 +212,13 @@ void EnTp_Tail_FollowHead(EnTp* this, PlayState* play) { } } else { if (this->unk_150 != 0) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; } if (this->head->unk_150 != 0) { this->actor.speed = this->red = this->actor.velocity.y = this->heightPhase = 0.0f; if (this->actor.world.pos.y < this->head->actor.home.pos.y) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } this->actor.world.pos = this->actor.parent->prevPos; @@ -319,7 +320,12 @@ void EnTp_Die(EnTp* this, PlayState* play) { 255, 1, 9, 1); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x50); } else { - for (i = 0; i < 1; i++) { +#if OOT_VERSION < NTSC_1_1 + for (i = 0; i < 2; i++) +#else + for (i = 0; i < 1; i++) +#endif + { now = (EnTp*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_TP, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, TAILPASARAN_FRAGMENT); @@ -350,7 +356,7 @@ void EnTp_Fragment_SetupFade(EnTp* this) { this->actor.velocity.x = (Rand_ZeroOne() - 0.5f) * 1.5f; this->actor.velocity.y = (Rand_ZeroOne() - 0.5f) * 1.5f; this->actor.velocity.z = (Rand_ZeroOne() - 0.5f) * 1.5f; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; EnTp_SetupAction(this, EnTp_Fragment_Fade); } @@ -594,7 +600,7 @@ void EnTp_UpdateDamage(EnTp* this, PlayState* play) { } if (this->actor.colChkInfo.health == 0) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; head = this->head; if (head->actor.params <= TAILPASARAN_HEAD) { @@ -744,8 +750,7 @@ void EnTp_Draw(Actor* thisx, PlayState* play) { if ((thisx->params <= TAILPASARAN_HEAD) || (thisx->params == TAILPASARAN_HEAD_DYING)) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_tp.c", 1459), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_tp.c", 1459); gSPDisplayList(POLY_OPA_DISP++, gTailpasaranHeadDL); Matrix_Translate(0.0f, 0.0f, 8.0f, MTXMODE_APPLY); @@ -761,8 +766,7 @@ void EnTp_Draw(Actor* thisx, PlayState* play) { gDPPipeSync(POLY_XLU_DISP++); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gTailpasaranTailSegmentTex)); gDPPipeSync(POLY_XLU_DISP++); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_tp.c", 1480), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_tp.c", 1480); gSPDisplayList(POLY_XLU_DISP++, gTailpasaranTailSegmentDL); } } diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.h b/src/overlays/actors/ovl_En_Tp/z_en_tp.h index 03ae0d9fd8..f878ab934a 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.h +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.h @@ -28,7 +28,7 @@ typedef struct EnTp { /* 0x01D4 */ struct EnTp* head; } EnTp; // size = 0x01D8 -typedef enum { +typedef enum EnTpType { /* -1 */ TAILPASARAN_HEAD = -1, // Used when scenes spawn them: code only cares about < 0 /* 0 */ TAILPASARAN_TAIL, /* 10 */ TAILPASARAN_FRAGMENT = 10, diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/src/overlays/actors/ovl_En_Tr/z_en_tr.c index fa9a5fca8e..e2d612d61b 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -23,7 +23,7 @@ void EnTr_SetRotFromCue(EnTr* this, PlayState* play, s32 cueChannel); void func_80B24038(EnTr* this, PlayState* play, s32 cueChannel); void EnTr_SetStartPosRotFromCue(EnTr* this, PlayState* play, s32 cueChannel); -ActorInit En_Tr_InitVars = { +ActorProfile En_Tr_Profile = { /**/ ACTOR_EN_TR, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -135,7 +135,7 @@ void EnTr_CrySpellcast(EnTr* this, PlayState* play) { } else if (this->actor.child != NULL) { this->actor.child = NULL; } - func_8002F974(&this->actor, NA_SE_EN_TWINROBA_FLY_DEMO - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_TWINROBA_FLY_DEMO - SFX_FLAG); } void EnTr_DoNothing(EnTr* this, PlayState* play) { @@ -170,7 +170,7 @@ void EnTr_ChooseAction2(EnTr* this, PlayState* play) { EnTr_SetRotFromCue(this, play, this->cueChannel); break; } - func_8002F974(&this->actor, NA_SE_EN_TWINROBA_FLY_DEMO - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_TWINROBA_FLY_DEMO - SFX_FLAG); } } } @@ -200,7 +200,7 @@ void EnTr_FlyKidnapCutscene(EnTr* this, PlayState* play) { } if (play->csCtx.curFrame < 670) { - func_8002F974(&this->actor, NA_SE_EN_TWINROBA_FLY_DEMO - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_TWINROBA_FLY_DEMO - SFX_FLAG); } } } @@ -291,7 +291,7 @@ void EnTr_Reappear(EnTr* this, PlayState* play) { if (this->timer > 0) { this->timer--; } - func_8002F974(&this->actor, NA_SE_EN_TWINROBA_FLY_DEMO - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_TWINROBA_FLY_DEMO - SFX_FLAG); } void EnTr_WaitToReappear(EnTr* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.h b/src/overlays/actors/ovl_En_Tr/z_en_tr.h index c3c5f74ae0..faf45d7400 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.h +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.h @@ -8,7 +8,7 @@ struct EnTr; typedef void (*EnTrActionFunc)(struct EnTr*, PlayState*); -typedef enum { +typedef enum KotakeKoumeLimb { /* 0 */ KOTAKE_KOUME_LIMB_NONE, /* 1 */ KOTAKE_KOUME_LIMB_PELVIS, /* 2 */ KOTAKE_KOUME_LIMB_LEFT_THIGH, @@ -53,7 +53,7 @@ typedef struct EnTr { /* 0x02E4 */ AnimationHeader* animation; } EnTr; // size = 0x02E8 -typedef enum { +typedef enum TwinrovaType { /* 0 */ TR_KOUME, /* 1 */ TR_KOTAKE } TwinrovaType; diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.c b/src/overlays/actors/ovl_En_Trap/z_en_trap.c index 6c21a07c25..420e5a1ca1 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c @@ -34,7 +34,7 @@ void EnTrap_Destroy(Actor* thisx, PlayState* play); void EnTrap_Update(Actor* thisx, PlayState* play); void EnTrap_Draw(Actor* thisx, PlayState* play); -ActorInit En_Trap_InitVars = { +ActorProfile En_Trap_Profile = { /**/ ACTOR_EN_TRAP, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -48,14 +48,14 @@ ActorInit En_Trap_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_NO_PUSH | OC1_TYPE_1 | OC1_TYPE_2, OC2_TYPE_1, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00001000, 0x00, 0x00 }, ATELEM_NONE, ACELEM_ON, OCELEM_ON }, + { ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00001000, 0x00, 0x00 }, ATELEM_NONE, ACELEM_ON, OCELEM_ON }, { 30, 20, 0, { 0, 0, 0 } }, }; @@ -67,7 +67,7 @@ void EnTrap_Init(Actor* thisx, PlayState* play) { EnTrap* this = (EnTrap*)thisx; ColliderCylinder* unused = &this->collider; // required to match - this->upperParams = (thisx->params >> 8) & 0xFF; + this->upperParams = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; Actor_SetScale(thisx, 0.1f); thisx->gravity = -2.0f; @@ -112,8 +112,8 @@ void EnTrap_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit); ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 0.0f); - thisx->targetMode = 3; - thisx->colChkInfo.mass = 0xFF; + thisx->attentionRangeType = ATTENTION_RANGE_3; + thisx->colChkInfo.mass = MASS_IMMOVABLE; } void EnTrap_Destroy(Actor* thisx, PlayState* play) { @@ -175,7 +175,7 @@ void EnTrap_Update(Actor* thisx, PlayState* play) { angleToKnockPlayer = thisx->yawTowardsPlayer; } play->damagePlayer(play, -4); - func_8002F7A0(play, thisx, 6.0f, angleToKnockPlayer, 6.0f); + Actor_SetPlayerKnockbackSmallNoDamage(play, thisx, 6.0f, angleToKnockPlayer, 6.0f); this->playerDmgTimer = 15; } if (thisx->params & SPIKETRAP_MODE_LINEAR) { diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index 9d40aa022f..c122d39684 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -22,7 +22,7 @@ void EnTuboTrap_Fly(EnTuboTrap* this, PlayState* play); static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -30,7 +30,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -40,7 +40,7 @@ static ColliderCylinderInit sCylinderInit = { { 9, 23, 0, { 0 } }, }; -ActorInit En_Tubo_Trap_InitVars = { +ActorProfile En_Tubo_Trap_Profile = { /**/ ACTOR_EN_TUBO_TRAP, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -72,10 +72,10 @@ void EnTuboTrap_Destroy(Actor* thisx, PlayState* play) { void EnTuboTrap_DropCollectible(EnTuboTrap* this, PlayState* play) { s16 params = this->actor.params; - s16 dropType = (params >> 6) & 0x3FF; + s16 dropType = PARAMS_GET_U(params, 6, 10); if (dropType >= 0 && dropType < ITEM00_MAX) { - Item_DropCollectible(play, &this->actor.world.pos, dropType | ((params & 0x3F) << 8)); + Item_DropCollectible(play, &this->actor.world.pos, dropType | (PARAMS_GET_U(params, 0, 6) << 8)); } } @@ -229,7 +229,7 @@ void EnTuboTrap_WaitForProximity(EnTuboTrap* this, PlayState* play) { if (this->actor.xzDistToPlayer < 200.0f && this->actor.world.pos.y <= player->actor.world.pos.y) { Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; targetHeight = 40.0f + -10.0f * gSaveContext.save.linkAge; this->targetY = player->actor.world.pos.y + targetHeight; diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c index b48c0e3e20..be03eb1644 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -7,7 +7,7 @@ #include "z_en_vali.h" #include "assets/objects/object_vali/object_vali.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_IGNORE_QUAKE) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_IGNORE_QUAKE) void EnVali_Init(Actor* thisx, PlayState* play); void EnVali_Destroy(Actor* thisx, PlayState* play); @@ -29,7 +29,7 @@ void EnVali_Stunned(EnVali* this, PlayState* play); void EnVali_Frozen(EnVali* this, PlayState* play); void EnVali_ReturnToLurk(EnVali* this, PlayState* play); -ActorInit En_Vali_InitVars = { +ActorProfile En_Vali_Profile = { /**/ ACTOR_EN_VALI, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -43,7 +43,7 @@ ActorInit En_Vali_InitVars = { static ColliderQuadInit sQuadInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -51,7 +51,7 @@ static ColliderQuadInit sQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x07, 0x08 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -63,7 +63,7 @@ static ColliderQuadInit sQuadInit = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT8, + COL_MATERIAL_HIT8, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -71,7 +71,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x07, 0x08 }, { 0xFFCFFFFF, 0x01, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -83,7 +83,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit sColChkInfoInit = { 2, 18, 32, MASS_HEAVY }; -typedef enum { +typedef enum BariDamageEffect { /* 0x0 */ BARI_DMGEFF_NONE, /* 0x1 */ BARI_DMGEFF_STUN, /* 0x2 */ BARI_DMGEFF_FIRE, @@ -130,7 +130,7 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_BARI, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 5000, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 5000, ICHAIN_STOP), }; void EnVali_Init(Actor* thisx, PlayState* play) { @@ -154,7 +154,7 @@ void EnVali_Init(Actor* thisx, PlayState* play) { EnVali_SetupLurk(this); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.floorHeight = BgCheck_EntityRaycastDown4(&play->colCtx, &this->actor.floorPoly, &bgId, &this->actor, &this->actor.world.pos); this->actor.params = BARI_TYPE_NORMAL; @@ -181,7 +181,7 @@ void EnVali_SetupLurk(EnVali* this) { void EnVali_SetupDropAppear(EnVali* this) { this->actor.draw = EnVali_Draw; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.velocity.y = 1.0f; this->actionFunc = EnVali_DropAppear; } @@ -209,7 +209,7 @@ void EnVali_SetupFloatIdle(EnVali* this) { */ void EnVali_SetupAttacked(EnVali* this) { this->lightningTimer = 20; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->bodyCollider.base.acFlags &= ~AC_ON; this->actionFunc = EnVali_Attacked; } @@ -248,7 +248,7 @@ void EnVali_SetupDivideAndDie(EnVali* this, PlayState* play) { this->timer = Rand_S16Offset(10, 10); this->bodyCollider.base.acFlags &= ~AC_ON; SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_BARI_SPLIT); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.draw = NULL; this->actionFunc = EnVali_DivideAndDie; } @@ -275,7 +275,7 @@ void EnVali_SetupFrozen(EnVali* this) { void EnVali_SetupReturnToLurk(EnVali* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gBariLurkingAnim, 10.0f); this->actor.flags |= ACTOR_FLAG_4; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnVali_ReturnToLurk; } @@ -301,7 +301,7 @@ void EnVali_DischargeLightning(EnVali* this, PlayState* play) { } } - func_8002F974(&this->actor, NA_SE_EN_BIRI_SPARK - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_BIRI_SPARK - SFX_FLAG); } void EnVali_Lurk(EnVali* this, PlayState* play) { @@ -347,7 +347,7 @@ void EnVali_FloatIdle(EnVali* this, PlayState* play) { curFrame = ((curFrame > 40) ? (80 - curFrame) : curFrame); - this->actor.shape.rot.y += (s16)((curFrame + 4) * 0.4f * (0x10000 / 360.0f)); + this->actor.shape.rot.y += DEG_TO_BINANG((curFrame + 4) * 0.4f); if (this->actor.xzDistToPlayer > 250.0f) { EnVali_SetupReturnToLurk(this); } @@ -361,7 +361,7 @@ void EnVali_Attacked(EnVali* this, PlayState* play) { EnVali_DischargeLightning(this, play); if (this->lightningTimer == 0) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->bodyCollider.base.acFlags |= AC_ON; if (this->actor.params == BARI_TYPE_SWORD_DAMAGE) { EnVali_SetupRetaliate(this); @@ -502,7 +502,7 @@ void EnVali_UpdateDamage(EnVali* this, PlayState* play) { if (Actor_ApplyDamage(&this->actor) == 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_BARI_DEAD); Enemy_StartFinishingBlow(play, &this->actor); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else if ((this->actor.colChkInfo.damageEffect != BARI_DMGEFF_STUN) && (this->actor.colChkInfo.damageEffect != BARI_DMGEFF_SLINGSHOT)) { Actor_PlaySfx(&this->actor, NA_SE_EN_BARI_DAMAGE); @@ -729,8 +729,7 @@ void EnVali_DrawBody(EnVali* this, PlayState* play) { EnVali_PulseInsides(this, curFrame, &scale); Matrix_Scale(scale.x, scale.y, scale.z, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_vali.c", 1436), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_vali.c", 1436); gSPDisplayList(POLY_XLU_DISP++, gBariInnerHoodDL); Matrix_Put(&mtx); @@ -739,20 +738,17 @@ void EnVali_DrawBody(EnVali* this, PlayState* play) { cos = Math_CosS(this->actor.shape.rot.y); sin = Math_SinS(this->actor.shape.rot.y); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_vali.c", 1446), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_vali.c", 1446); gSPDisplayList(POLY_XLU_DISP++, gBariNucleusDL); Matrix_Translate((506.0f * cos) + (372.0f * sin), 1114.0f, (372.0f * cos) - (506.0f * sin), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_vali.c", 1455), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_vali.c", 1455); gSPDisplayList(POLY_XLU_DISP++, gBariNucleusDL); Matrix_Translate((-964.0f * cos) - (804.0f * sin), -108.0f, (-804.0f * cos) + (964.0f * sin), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_vali.c", 1463), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_vali.c", 1463); gSPDisplayList(POLY_XLU_DISP++, gBariNucleusDL); Matrix_Put(&mtx); @@ -762,8 +758,7 @@ void EnVali_DrawBody(EnVali* this, PlayState* play) { EnVali_PulseOutside(this, curFrame, &scale); Matrix_Scale(scale.x, scale.y, scale.z, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_vali.c", 1471), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_vali.c", 1471); gSPDisplayList(POLY_XLU_DISP++, gBariOuterHoodDL); Matrix_Put(&mtx); diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.h b/src/overlays/actors/ovl_En_Vali/z_en_vali.h index 0c94d92288..c5df42825b 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.h +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.h @@ -8,7 +8,7 @@ struct EnVali; typedef void (*EnValiActionFunc)(struct EnVali*, PlayState*); -typedef enum { +typedef enum EnValiLimb { /* 0x00 */ EN_VALI_LIMB_NONE, /* 0x01 */ EN_VALI_LIMB_NUCLEUS_BASE, /* 0x02 */ EN_VALI_LIMB_NUCLEUS, @@ -57,7 +57,7 @@ typedef struct EnVali { /* 0x03FC */ ColliderCylinder bodyCollider; } EnVali; // size = 0x0448 -typedef enum { +typedef enum EnValiType { /* 0 */ BARI_TYPE_NORMAL, /* 1 */ BARI_TYPE_SWORD_DAMAGE } EnValiType; diff --git a/src/overlays/actors/ovl_En_Vase/z_en_vase.c b/src/overlays/actors/ovl_En_Vase/z_en_vase.c index c411371c24..065013bb52 100644 --- a/src/overlays/actors/ovl_En_Vase/z_en_vase.c +++ b/src/overlays/actors/ovl_En_Vase/z_en_vase.c @@ -13,7 +13,7 @@ void EnVase_Init(Actor* thisx, PlayState* play); void EnVase_Destroy(Actor* thisx, PlayState* play); void EnVase_Draw(Actor* thisx, PlayState* play); -ActorInit En_Vase_InitVars = { +ActorProfile En_Vase_Profile = { /**/ ACTOR_EN_VASE, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c index 695b88014b..1a8f8d2275 100644 --- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c +++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c @@ -16,7 +16,7 @@ void EnVbBall_Destroy(Actor* thisx, PlayState* play); void EnVbBall_Update(Actor* thisx, PlayState* play2); void EnVbBall_Draw(Actor* thisx, PlayState* play); -ActorInit En_Vb_Ball_InitVars = { +ActorProfile En_Vb_Ball_Profile = { /**/ 0, /**/ ACTORCAT_BOSS, /**/ FLAGS, @@ -30,7 +30,7 @@ ActorInit En_Vb_Ball_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -38,7 +38,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK6, + ELEM_MATERIAL_UNK6, { 0x00100700, 0x00, 0x20 }, { 0x00100700, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -134,7 +134,7 @@ void EnVbBall_UpdateBones(EnVbBall* this, PlayState* play) { this->actor.velocity.x = sinf(angle) * 10.0f; this->actor.velocity.z = cosf(angle) * 10.0f; this->actor.velocity.y *= -0.5f; - if (this->actor.params & 1) { + if (PARAMS_GET_U(this->actor.params, 0, 1)) { Audio_PlaySfxGeneral(NA_SE_EN_VALVAISA_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } @@ -303,8 +303,7 @@ void EnVbBall_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_vb_ball.c", 604); if (1) {} // needed for match Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_vb_ball.c", 607), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_vb_ball.c", 607); if (this->actor.params >= 200) { gSPDisplayList(POLY_OPA_DISP++, SEGMENTED_TO_VIRTUAL(gVolvagiaRibsDL)); @@ -315,8 +314,7 @@ void EnVbBall_Draw(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, (s8)this->shadowOpacity); Matrix_Translate(this->actor.world.pos.x, 100.0f, this->actor.world.pos.z, MTXMODE_NEW); Matrix_Scale(this->shadowSize, 1.0f, this->shadowSize, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_vb_ball.c", 626), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_vb_ball.c", 626); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gCircleShadowDL)); } diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c index 1c459b1e53..0b0594ed86 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -31,7 +31,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play); static u8 sHorseSfxPlayed = false; -ActorInit En_Viewer_InitVars = { +ActorProfile En_Viewer_Profile = { /**/ ACTOR_EN_VIEWER, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -95,7 +95,7 @@ void EnViewer_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); EnViewer_SetupAction(this, EnViewer_InitImpl); sHorseSfxPlayed = false; - type = this->actor.params >> 8; + type = PARAMS_GET_NOMASK(this->actor.params, 8); this->unused = 0; this->state = 0; this->isVisible = false; @@ -114,7 +114,7 @@ void EnViewer_Destroy(Actor* thisx, PlayState* play) { void EnViewer_InitAnimGanondorfOrZelda(EnViewer* this, PlayState* play, void* skeletonHeaderSeg, AnimationHeader* anim) { - s16 type = this->actor.params >> 8; + s16 type = PARAMS_GET_NOMASK(this->actor.params, 8); if (type == ENVIEWER_TYPE_2_ZELDA || type == ENVIEWER_TYPE_3_GANONDORF || type == ENVIEWER_TYPE_5_GANONDORF || type == ENVIEWER_TYPE_7_GANONDORF || type == ENVIEWER_TYPE_8_GANONDORF || type == ENVIEWER_TYPE_9_GANONDORF) { @@ -142,7 +142,7 @@ void EnViewer_InitAnimHorse(EnViewer* this, PlayState* play, void* skeletonHeade u8 type; Skin_Init(play, &this->skin, skeletonHeaderSeg, anim); - type = this->actor.params >> 8; + type = PARAMS_GET_NOMASK(this->actor.params, 8); if (!(type == ENVIEWER_TYPE_3_GANONDORF || type == ENVIEWER_TYPE_4_HORSE_GANONDORF || type == ENVIEWER_TYPE_7_GANONDORF || type == ENVIEWER_TYPE_8_GANONDORF || type == ENVIEWER_TYPE_9_GANONDORF)) { @@ -166,7 +166,7 @@ static ActorShadowFunc sShadowDrawFuncs[] = { }; void EnViewer_InitImpl(EnViewer* this, PlayState* play) { - EnViewerInitData* initData = &sInitData[this->actor.params >> 8]; + EnViewerInitData* initData = &sInitData[PARAMS_GET_NOMASK(this->actor.params, 8)]; s32 skelObjectSlot = Object_GetSlot(&play->objectCtx, initData->skeletonObject); ASSERT(skelObjectSlot >= 0, "bank_ID >= 0", "../z_en_viewer.c", 576); @@ -194,7 +194,7 @@ void EnViewer_InitImpl(EnViewer* this, PlayState* play) { static s16 sTimer = 0; void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) { - u8 type = this->actor.params >> 8; + u8 type = PARAMS_GET_NOMASK(this->actor.params, 8); u16 csCurFrame; s32 animationEnded; @@ -513,8 +513,7 @@ void EnViewer_Ganondorf9PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList if (limbIndex == GANONDORF_LIMB_JEWEL) { OPEN_DISPS(play->state.gfxCtx, "../z_en_viewer.c", 1365); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_viewer.c", 1370), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_viewer.c", 1370); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanondorfEyesDL)); CLOSE_DISPS(play->state.gfxCtx, "../z_en_viewer.c", 1372); } @@ -534,7 +533,7 @@ void EnViewer_DrawGanondorf(EnViewer* this, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_viewer.c", 1405); - type = this->actor.params >> 8; + type = PARAMS_GET_NOMASK(this->actor.params, 8); if (type == ENVIEWER_TYPE_3_GANONDORF || type == ENVIEWER_TYPE_5_GANONDORF || type == ENVIEWER_TYPE_7_GANONDORF || type == ENVIEWER_TYPE_8_GANONDORF) { @@ -704,7 +703,7 @@ void EnViewer_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_viewer.c", 1760); if (this->isVisible) { - type = this->actor.params >> 8; + type = PARAMS_GET_NOMASK(this->actor.params, 8); if (type <= ENVIEWER_TYPE_2_ZELDA) { // zelda's horse, impa and zelda if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.actorCues[0] != NULL) { Gfx_SetupDL_25Opa(play->state.gfxCtx); @@ -723,7 +722,7 @@ void EnViewer_UpdatePosition(EnViewer* this, PlayState* play) { Vec3f startPos; Vec3f endPos; f32 lerpFactor; - s16 type = this->actor.params >> 8; + s16 type = PARAMS_GET_NOMASK(this->actor.params, 8); if (type <= ENVIEWER_TYPE_2_ZELDA) { // zelda's horse, impa and zelda if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.actorCues[0] != NULL && @@ -859,8 +858,7 @@ void EnViewer_DrawFireEffects(EnViewer* this2, PlayState* play) { (10 * i - 20 * play->state.frames) % 512, 32, 128)); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 170, 255); gDPSetEnvColor(POLY_XLU_DISP++, 255, 50, 00, 255); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_viewer.c", 2027), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_viewer.c", 2027); gSPMatrix(POLY_XLU_DISP++, &D_01000000, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); } @@ -872,7 +870,7 @@ void EnViewer_UpdateGanondorfCape(PlayState* play, EnViewer* this) { Vec3f forearmModelOffset; Vec3f forearmWorldOffset; - if ((this->actor.params >> 8) != ENVIEWER_TYPE_5_GANONDORF) { + if (PARAMS_GET_NOMASK(this->actor.params, 8) != ENVIEWER_TYPE_5_GANONDORF) { return; } diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h index fee5fe7620..de2bf8ba27 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h @@ -10,7 +10,7 @@ typedef void (*EnViewerActionFunc)(struct EnViewer*, PlayState*); typedef void (*EnViewerDrawFunc)(struct EnViewer*, PlayState*); typedef void (*EnViewerInitAnimFunc)(struct EnViewer*, PlayState*, void*, AnimationHeader*); -typedef enum { +typedef enum EnViewerType { /* 0 */ ENVIEWER_TYPE_0_HORSE_ZELDA, /* 1 */ ENVIEWER_TYPE_1_IMPA, /* 2 */ ENVIEWER_TYPE_2_ZELDA, @@ -23,20 +23,20 @@ typedef enum { /* 9 */ ENVIEWER_TYPE_9_GANONDORF } EnViewerType; -typedef enum { +typedef enum EnViewerDrawType { /* 0 */ ENVIEWER_DRAW_GANONDORF, /* 1 */ ENVIEWER_DRAW_HORSE, /* 2 */ ENVIEWER_DRAW_ZELDA, /* 3 */ ENVIEWER_DRAW_IMPA } EnViewerDrawType; -typedef enum { +typedef enum EnViewerShadowType { /* 0 */ ENVIEWER_SHADOW_NONE, /* 1 */ ENVIEWER_SHADOW_CIRCLE, /* 2 */ ENVIEWER_SHADOW_HORSE } EnViewerShadowType; -typedef struct { +typedef struct EnViewerInitData { /* 0x00 */ s16 skeletonObject; /* 0x02 */ s16 animObject; /* 0x04 */ u8 scale; // divided by 100.0f @@ -48,7 +48,7 @@ typedef struct { /* 0x10 */ AnimationHeader* anim; } EnViewerInitData; // size = 0x14 -typedef struct { +typedef struct EnViewerFireEffect { /* 0x00 */ Vec3f startPos; /* 0x0C */ Vec3f endPos; /* 0x18 */ Vec3f pos; @@ -58,7 +58,7 @@ typedef struct { /* 0x30 */ u8 state; } EnViewerFireEffect; // size = 0x34 -typedef enum { +typedef enum YoungGanondorfLimb { /* 0 */ YOUNG_GANONDORF_LIMB_NONE, /* 1 */ YOUNG_GANONDORF_LIMB_ROOT, /* 2 */ YOUNG_GANONDORF_LIMB_TORSO, diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index 25f13383ca..1fe315ae2f 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -9,7 +9,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4) void EnVm_Init(Actor* thisx, PlayState* play); void EnVm_Destroy(Actor* thisx, PlayState* play); @@ -23,7 +23,7 @@ void EnVm_Attack(EnVm* this, PlayState* play); void EnVm_Stun(EnVm* this, PlayState* play); void EnVm_Die(EnVm* this, PlayState* play); -ActorInit En_Vm_InitVars = { +ActorProfile En_Vm_Profile = { /**/ ACTOR_EN_VM, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -37,7 +37,7 @@ ActorInit En_Vm_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -45,7 +45,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -57,7 +57,7 @@ static ColliderCylinderInit sCylinderInit = { static ColliderQuadInit sQuadInit1 = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, @@ -65,7 +65,7 @@ static ColliderQuadInit sQuadInit1 = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL | ATELEM_UNK7, @@ -77,7 +77,7 @@ static ColliderQuadInit sQuadInit1 = { static ColliderQuadInit sQuadInit2 = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -85,7 +85,7 @@ static ColliderQuadInit sQuadInit2 = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -142,7 +142,7 @@ void EnVm_Init(Actor* thisx, PlayState* play) { Collider_SetQuad(play, &this->colliderQuad1, thisx, &sQuadInit1); Collider_InitQuad(play, &this->colliderQuad2); Collider_SetQuad(play, &this->colliderQuad2, thisx, &sQuadInit2); - this->beamSightRange = (thisx->params >> 8) * 40.0f; + this->beamSightRange = PARAMS_GET_NOMASK(thisx->params, 8) * 40.0f; thisx->params &= 0xFF; thisx->naviEnemyId = NAVI_ENEMY_BEAMOS; @@ -529,16 +529,14 @@ void EnVm_Draw(Actor* thisx, PlayState* play2) { if (this->unk_260 >= 3) { Matrix_Translate(this->beamPos3.x, this->beamPos3.y + 10.0f, this->beamPos3.z, MTXMODE_NEW); Matrix_Scale(0.8f, 0.8f, 0.8f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_vm.c", 1033), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_vm.c", 1033); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 168); Gfx_SetupDL_60NoCDXlu(play->state.gfxCtx); gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 0); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80B2EB88[play->gameplayFrames % 8])); gSPDisplayList(POLY_XLU_DISP++, gEffEnemyDeathFlameDL); Matrix_RotateY(32767.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_vm.c", 1044), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_vm.c", 1044); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80B2EB88[(play->gameplayFrames + 4) % 8])); gSPDisplayList(POLY_XLU_DISP++, gEffEnemyDeathFlameDL); } @@ -546,8 +544,7 @@ void EnVm_Draw(Actor* thisx, PlayState* play2) { Matrix_Translate(this->beamPos1.x, this->beamPos1.y, this->beamPos1.z, MTXMODE_NEW); Matrix_RotateZYX(this->beamRot.x, this->beamRot.y, this->beamRot.z, MTXMODE_APPLY); Matrix_Scale(this->beamScale.x * 0.1f, this->beamScale.x * 0.1f, this->beamScale.z * 0.0015f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_vm.c", 1063), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_vm.c", 1063); gSPDisplayList(POLY_OPA_DISP++, gBeamosLaserDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_vm.c", 1068); diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.h b/src/overlays/actors/ovl_En_Vm/z_en_vm.h index 2be67637c5..5b0fe1629e 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.h +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.h @@ -32,7 +32,7 @@ typedef struct EnVm { /* 0x0334 */ ColliderQuad colliderQuad2; } EnVm; // size = 0x03B4 -typedef enum { +typedef enum BeamosType { /* 0x00 */ BEAMOS_LARGE, /* 0x01 */ BEAMOS_SMALL } BeamosType; diff --git a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c index d346026247..39708d3be5 100644 --- a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c +++ b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c @@ -21,7 +21,7 @@ void EnWallTubo_FindGirl(EnWallTubo* this, PlayState* play); void EnWallTubo_DetectChu(EnWallTubo* this, PlayState* play); void EnWallTubo_SetWallFall(EnWallTubo* this, PlayState* play); -ActorInit En_Wall_Tubo_InitVars = { +ActorProfile En_Wall_Tubo_Profile = { /**/ ACTOR_EN_WALL_TUBO, /**/ ACTORCAT_PROP, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 645b077de7..7346278053 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -8,7 +8,7 @@ #include "assets/objects/object_wallmaster/object_wallmaster.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) #define TIMER_SCALE ((f32)OS_CLOCK_RATE / 10000000000) @@ -38,7 +38,7 @@ void EnWallmas_WaitForSwitchFlag(EnWallmas* this, PlayState* play); void EnWallmas_Stun(EnWallmas* this, PlayState* play); void EnWallmas_Walk(EnWallmas* this, PlayState* play); -ActorInit En_Wallmas_InitVars = { +ActorProfile En_Wallmas_Profile = { /**/ ACTOR_EN_WALLMAS, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -52,7 +52,7 @@ ActorInit En_Wallmas_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -60,7 +60,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -109,7 +109,7 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_WALLMASTER, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 5500, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 5500, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1500, ICHAIN_STOP), }; @@ -124,8 +124,8 @@ void EnWallmas_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit); CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); - this->switchFlag = (u8)(thisx->params >> 0x8); - thisx->params &= 0xFF; + this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); + thisx->params = PARAMS_GET_U(thisx->params, 0, 8); if (thisx->params == WMT_FLAG) { if (Flags_GetSwitch(play, this->switchFlag) != 0) { @@ -150,7 +150,7 @@ void EnWallmas_Destroy(Actor* thisx, PlayState* play) { void EnWallmas_TimerInit(EnWallmas* this, PlayState* play) { Player* player = GET_PLAYER(play); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.flags |= ACTOR_FLAG_5; this->timer = 0x82; this->actor.velocity.y = 0.0f; @@ -171,7 +171,7 @@ void EnWallmas_SetupDrop(EnWallmas* this, PlayState* play) { this->actor.world.pos.y = player->actor.world.pos.y + 300.0f; this->actor.world.rot.y = player->actor.shape.rot.y + 0x8000; this->actor.floorHeight = player->actor.floorHeight; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.flags &= ~ACTOR_FLAG_5; this->actionFunc = EnWallmas_Drop; } @@ -266,7 +266,7 @@ void EnWallmas_SetupTakePlayer(EnWallmas* this, PlayState* play) { void EnWallmas_ProximityOrSwitchInit(EnWallmas* this) { this->timer = 0; this->actor.draw = NULL; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if (this->actor.params == WMT_PROXIMITY) { this->actionFunc = EnWallmas_WaitForProximity; } else { @@ -512,7 +512,7 @@ void EnWallmas_ColUpdate(EnWallmas* this, PlayState* play) { if (Actor_ApplyDamage(&this->actor) == 0) { Enemy_StartFinishingBlow(play, &this->actor); Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_DEAD); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else { if (this->actor.colChkInfo.damage != 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_DAMAGE); @@ -606,11 +606,9 @@ void EnWallmas_DrawXlu(EnWallmas* this, PlayState* play) { } Matrix_Scale(xzScale, 1.0f, xzScale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_wallmas.c", 1421), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_wallmas.c", 1421); gSPDisplayList(POLY_XLU_DISP++, gCircleShadowDL); - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_en_wallmas.c", 1426); } @@ -637,7 +635,7 @@ void EnWallMas_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* Matrix_RotateZ(DEG_TO_RAD(15), MTXMODE_APPLY); Matrix_Scale(2.0f, 2.0f, 2.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_wallmas.c", 1489), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_wallmas.c", 1489); gSPDisplayList(POLY_OPA_DISP++, gWallmasterFingerDL); Matrix_Pop(); diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h index 8b2f8d7ba9..c82df375dc 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef enum { +typedef enum WallmasType { /* 0x00 */ WMT_TIMER, /* 0x01 */ WMT_PROXIMITY, /* 0x02 */ WMT_FLAG diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index 01a3000706..3346708dd3 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -6,6 +6,7 @@ #include "z_en_weather_tag.h" #include "terminal.h" +#include "versions.h" #define FLAGS ACTOR_FLAG_4 @@ -31,7 +32,7 @@ void EnWeatherTag_EnabledRainThunder(EnWeatherTag* this, PlayState* play); #define WEATHER_TAG_RANGE100(x) ((x >> 8) * 100.0f) -ActorInit En_Weather_Tag_InitVars = { +ActorProfile En_Weather_Tag_Profile = { /**/ ACTOR_EN_WEATHER_TAG, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -53,9 +54,9 @@ void EnWeatherTag_Destroy(Actor* thisx, PlayState* play) { void EnWeatherTag_Init(Actor* thisx, PlayState* play) { EnWeatherTag* this = (EnWeatherTag*)thisx; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; - switch (this->actor.params & 0xF) { + switch (PARAMS_GET_U(this->actor.params, 0, 4)) { case EN_WEATHER_TAG_TYPE_CLOUDY_MARKET: PRINTF("\n\n"); // "☆☆☆☆☆ (;o;) About ☆☆☆☆☆☆" @@ -140,8 +141,13 @@ u8 WeatherTag_CheckEnableWeatherEffect(EnWeatherTag* this, PlayState* play, u8 s if (play->envCtx.stormRequest == STORM_REQUEST_NONE && ((play->envCtx.lightMode != LIGHT_MODE_TIME) || (play->envCtx.lightConfig != 1 && !play->envCtx.changeLightEnabled))) { +#if OOT_VERSION >= PAL_1_0 gInterruptSongOfStorms = false; +#endif if (gWeatherMode != weatherMode) { +#if OOT_VERSION < PAL_1_0 + gInterruptSongOfStorms = false; +#endif gWeatherMode = weatherMode; if (play->envCtx.stormRequest == STORM_REQUEST_NONE) { play->envCtx.changeSkyboxState = CHANGE_SKYBOX_REQUESTED; diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h index ec7c177341..ccfc0e3f67 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h @@ -14,7 +14,7 @@ typedef struct EnWeatherTag { /* 0x0150 */ char unk_150[0x04]; } EnWeatherTag; // size = 0x0154 -typedef enum { +typedef enum EnWeatherTagType { /* 0x00 */ EN_WEATHER_TAG_TYPE_CLOUDY_MARKET, /* 0x01 */ EN_WEATHER_TAG_TYPE_CLOUDY_LON_LON_RANCH, /* 0x02 */ EN_WEATHER_TAG_TYPE_SNOW_ZORAS_DOMAIN, diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index ecf2ffb554..3d3387fcd2 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -7,7 +7,7 @@ #include "z_en_weiyer.h" #include "assets/objects/object_ei/object_ei.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) void EnWeiyer_Init(Actor* thisx, PlayState* play); void EnWeiyer_Destroy(Actor* thisx, PlayState* play); @@ -26,7 +26,7 @@ void func_80B332B4(EnWeiyer* this, PlayState* play); void func_80B33338(EnWeiyer* this, PlayState* play); void func_80B3349C(EnWeiyer* this, PlayState* play); -ActorInit En_Weiyer_InitVars = { +ActorProfile En_Weiyer_Profile = { /**/ ACTOR_EN_WEIYER, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -40,7 +40,7 @@ ActorInit En_Weiyer_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -48,7 +48,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_HARD, @@ -98,7 +98,7 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, NAVI_ENEMY_STINGER, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 3, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 2500, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 2500, ICHAIN_STOP), }; void EnWeiyer_Init(Actor* thisx, PlayState* play) { @@ -571,7 +571,7 @@ void func_80B3368C(EnWeiyer* this, PlayState* play) { } else if (Actor_ApplyDamage(&this->actor) == 0) { Enemy_StartFinishingBlow(play, &this->actor); Actor_PlaySfx(&this->actor, NA_SE_EN_EIER_DEAD); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; func_80B32724(this); } else { func_80B325A0(this); diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index a0088fc699..acb8b32bbe 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -9,7 +9,7 @@ #include "overlays/actors/ovl_En_Encount1/z_en_encount1.h" #include "assets/objects/object_wf/object_wf.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) void EnWf_Init(Actor* thisx, PlayState* play); void EnWf_Destroy(Actor* thisx, PlayState* play); @@ -46,7 +46,7 @@ s32 EnWf_DodgeRanged(PlayState* play, EnWf* this); static ColliderJntSphElementInit sJntSphItemsInit[4] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -57,7 +57,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[4] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -68,7 +68,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[4] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xFFC1FFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -79,7 +79,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[4] = { }, { { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xFFC1FFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -92,7 +92,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[4] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -105,7 +105,7 @@ static ColliderJntSphInit sJntSphInit = { static ColliderCylinderInit sBodyCylinderInit = { { - COLTYPE_HIT5, + COL_MATERIAL_HIT5, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -113,7 +113,7 @@ static ColliderCylinderInit sBodyCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -125,7 +125,7 @@ static ColliderCylinderInit sBodyCylinderInit = { static ColliderCylinderInit sTailCylinderInit = { { - COLTYPE_HIT5, + COL_MATERIAL_HIT5, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -133,7 +133,7 @@ static ColliderCylinderInit sTailCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -143,7 +143,7 @@ static ColliderCylinderInit sTailCylinderInit = { { 15, 20, -15, { 0, 0, 0 } }, }; -typedef enum { +typedef enum EnWfDamageEffect { /* 0 */ ENWF_DMGEFF_NONE, /* 1 */ ENWF_DMGEFF_STUN, /* 6 */ ENWF_DMGEFF_ICE_MAGIC = 6, @@ -187,7 +187,7 @@ static DamageTable sDamageTable = { /* Unknown 2 */ DMG_ENTRY(0, ENWF_DMGEFF_NONE), }; -ActorInit En_Wf_InitVars = { +ActorProfile En_Wf_Profile = { /**/ ACTOR_EN_WF, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -200,7 +200,7 @@ ActorInit En_Wf_InitVars = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3000, ICHAIN_STOP), }; @@ -220,7 +220,7 @@ void EnWf_Init(Actor* thisx, PlayState* play) { thisx->colChkInfo.health = 8; thisx->colChkInfo.cylRadius = 50; thisx->colChkInfo.cylHeight = 100; - this->switchFlag = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; this->eyeIndex = 0; this->unk_2F4 = 10.0f; // Set and not used @@ -354,7 +354,7 @@ s32 EnWf_ChangeAction(PlayState* play, EnWf* this, s16 mustChoose) { playerFacingAngleDiff = player->actor.shape.rot.y - this->actor.shape.rot.y; - if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsTargeted(play, &this->actor) && + if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsLockedOn(play, &this->actor) && (((play->gameplayFrames % 8) != 0) || (ABS(playerFacingAngleDiff) < 0x38E0))) { EnWf_SetupSlash(this); return true; @@ -372,7 +372,7 @@ void EnWf_SetupWaitToAppear(EnWf* this) { this->actionTimer = 20; this->unk_300 = false; this->action = WOLFOS_ACTION_WAIT_TO_APPEAR; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.scale.y = 0.0f; this->actor.gravity = 0.0f; EnWf_SetupAction(this, EnWf_WaitToAppear); @@ -384,7 +384,7 @@ void EnWf_WaitToAppear(EnWf* this, PlayState* play) { if (this->actor.xzDistToPlayer < 240.0f) { this->actionTimer = 5; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; if ((this->actor.params != WOLFOS_NORMAL) && (this->switchFlag != 0xFF)) { func_800F5ACC(NA_BGM_MINI_BOSS); @@ -502,7 +502,7 @@ void EnWf_RunAtPlayer(EnWf* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x2EE, 0); this->actor.world.rot.y = this->actor.shape.rot.y; - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { baseRange = 150.0f; } @@ -542,10 +542,10 @@ void EnWf_RunAtPlayer(EnWf* this, PlayState* play) { } else if (this->actor.xzDistToPlayer < (90.0f + baseRange)) { s16 temp_v1 = player->actor.shape.rot.y - this->actor.shape.rot.y; - if (!Actor_OtherIsTargeted(play, &this->actor) && + if (!Actor_OtherIsLockedOn(play, &this->actor) && ((Rand_ZeroOne() > 0.03f) || ((this->actor.xzDistToPlayer <= 80.0f) && (ABS(temp_v1) < 0x38E0)))) { EnWf_SetupSlash(this); - } else if (Actor_OtherIsTargeted(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { + } else if (Actor_OtherIsLockedOn(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { EnWf_SetupBackflipAway(this); } else { EnWf_SetupRunAroundPlayer(this); @@ -658,7 +658,7 @@ void EnWf_RunAroundPlayer(EnWf* this, PlayState* play) { } } - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { baseRange = 150.0f; } @@ -696,14 +696,14 @@ void EnWf_RunAroundPlayer(EnWf* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_CRY); } - if ((Math_CosS(angle1 - this->actor.shape.rot.y) < -0.85f) && !Actor_OtherIsTargeted(play, &this->actor) && + if ((Math_CosS(angle1 - this->actor.shape.rot.y) < -0.85f) && !Actor_OtherIsLockedOn(play, &this->actor) && (this->actor.xzDistToPlayer <= 80.0f)) { EnWf_SetupSlash(this); } else { this->actionTimer--; if (this->actionTimer == 0) { - if (Actor_OtherIsTargeted(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { + if (Actor_OtherIsLockedOn(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { EnWf_SetupBackflipAway(this); } else { EnWf_SetupWait(this); @@ -747,7 +747,7 @@ void EnWf_Slash(EnWf* this, PlayState* play) { this->slashStatus = 0; } - if (((curFrame == 15) && !Actor_IsTargeted(play, &this->actor) && + if (((curFrame == 15) && !Actor_IsLockedOn(play, &this->actor) && (!Actor_IsFacingPlayer(&this->actor, 0x2000) || (this->actor.xzDistToPlayer >= 100.0f))) || SkelAnime_Update(&this->skelAnime)) { if ((curFrame != 15) && (this->actionTimer != 0)) { @@ -850,7 +850,7 @@ void EnWf_SetupBackflipAway(EnWf* this) { void EnWf_BackflipAway(EnWf* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { - if (!Actor_OtherIsTargeted(play, &this->actor) && (this->actor.xzDistToPlayer < 170.0f) && + if (!Actor_OtherIsLockedOn(play, &this->actor) && (this->actor.xzDistToPlayer < 170.0f) && (this->actor.xzDistToPlayer > 140.0f) && (Rand_ZeroOne() < 0.2f)) { EnWf_SetupRunAtPlayer(this, play); } else if ((play->gameplayFrames % 2) != 0) { @@ -940,7 +940,7 @@ void EnWf_Damaged(EnWf* this, PlayState* play) { (this->actor.xzDistToPlayer < 120.0f)) { EnWf_SetupSomersaultAndAttack(this); } else if (!EnWf_DodgeRanged(play, this)) { - if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsTargeted(play, &this->actor) && + if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsLockedOn(play, &this->actor) && ((play->gameplayFrames % 8) != 0)) { EnWf_SetupSlash(this); } else if (Rand_ZeroOne() > 0.5f) { @@ -985,7 +985,7 @@ void EnWf_SomersaultAndAttack(EnWf* this, PlayState* play) { this->actor.speed = this->actor.velocity.y = 0.0f; this->actor.world.pos.y = this->actor.floorHeight; - if (!Actor_OtherIsTargeted(play, &this->actor)) { + if (!Actor_OtherIsLockedOn(play, &this->actor)) { EnWf_SetupSlash(this); } else { EnWf_SetupWait(this); @@ -1035,7 +1035,7 @@ void EnWf_Blocking(EnWf* this, PlayState* play) { } else { s16 angleFacingLink = player->actor.shape.rot.y - this->actor.shape.rot.y; - if (!Actor_OtherIsTargeted(play, &this->actor) && + if (!Actor_OtherIsLockedOn(play, &this->actor) && (((play->gameplayFrames % 2) != 0) || (ABS(angleFacingLink) < 0x38E0))) { EnWf_SetupSlash(this); } else { @@ -1114,7 +1114,7 @@ void EnWf_Sidestep(EnWf* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { baseRange = 150.0f; } @@ -1159,7 +1159,7 @@ void EnWf_Sidestep(EnWf* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; - if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsTargeted(play, &this->actor) && + if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsLockedOn(play, &this->actor) && (((play->gameplayFrames % 4) == 0) || (ABS(angleDiff2) < 0x38E0))) { EnWf_SetupSlash(this); } else { @@ -1191,7 +1191,7 @@ void EnWf_SetupDie(EnWf* this) { } this->action = WOLFOS_ACTION_DIE; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionTimer = this->skelAnime.animLength; Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_DEAD); EnWf_SetupAction(this, EnWf_Die); @@ -1267,7 +1267,9 @@ void EnWf_UpdateDamage(EnWf* this, PlayState* play) { if (this->actor.colChkInfo.damageEffect != ENWF_DMGEFF_ICE_MAGIC) { this->damageEffect = this->actor.colChkInfo.damageEffect; Actor_SetDropFlag(&this->actor, &this->colliderCylinderBody.elem, true); +#if OOT_VERSION >= PAL_1_0 this->slashStatus = 0; +#endif if ((this->actor.colChkInfo.damageEffect == ENWF_DMGEFF_STUN) || (this->actor.colChkInfo.damageEffect == ENWF_DMGEFF_UNDEF)) { diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.h b/src/overlays/actors/ovl_En_Wf/z_en_wf.h index 36afdccf5e..83e46e6d19 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.h +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.h @@ -8,7 +8,7 @@ struct EnWf; typedef void (*EnWfActionFunc)(struct EnWf*, PlayState*); -typedef enum { +typedef enum EnWfLimb { /* 0 */ WOLFOS_LIMB_NONE, /* 1 */ WOLFOS_LIMB_ROOT, /* 2 */ WOLFOS_LIMB_BACK_LEFT_THIGH, @@ -34,7 +34,7 @@ typedef enum { /* 22 */ WOLFOS_LIMB_MAX } EnWfLimb; -typedef enum { +typedef enum EnWfAction { /* 0 */ WOLFOS_ACTION_WAIT_TO_APPEAR, /* 2 */ WOLFOS_ACTION_DIE = 2, /* 3 */ WOLFOS_ACTION_DAMAGED, @@ -83,7 +83,7 @@ typedef struct EnWf { /* 0x04D4 */ Vec3s unk_4D4; } EnWf; // size = 0x04DC -typedef enum { +typedef enum EnWfType { /* 0 */ WOLFOS_NORMAL, /* 1 */ WOLFOS_WHITE } EnWfType; diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c index 293b7f6abe..a096e84c08 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c @@ -23,7 +23,7 @@ void EnWonderItem_RollDrop(EnWonderItem* this, PlayState* play); static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -31,7 +31,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -41,7 +41,7 @@ static ColliderCylinderInit sCylinderInit = { { 20, 30, 0, { 0, 0, 0 } }, }; -ActorInit En_Wonder_Item_InitVars = { +ActorProfile En_Wonder_Item_Profile = { /**/ ACTOR_EN_WONDER_ITEM, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -53,7 +53,7 @@ ActorInit En_Wonder_Item_InitVars = { /**/ NULL, }; -#pragma increment_block_number 1 +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0" static Vec3f sTagPointsFree[9]; static Vec3f sTagPointsOrdered[9]; @@ -120,17 +120,18 @@ void EnWonderItem_Init(Actor* thisx, PlayState* play) { s16 tagIndex; PRINTF("\n\n"); - // "Mysterious mystery, very mysterious" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 不思議不思議まか不思議 \t ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); - this->actor.flags &= ~ACTOR_FLAG_0; - - this->wonderMode = (this->actor.params >> 0xB) & 0x1F; - this->itemDrop = (this->actor.params >> 6) & 0x1F; - this->switchFlag = this->actor.params & 0x3F; + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 不思議不思議まか不思議 \t ☆☆☆☆☆ %x\n", + "☆☆☆☆☆ Mysterious mystery, very mysterious \t ☆☆☆☆☆ %x\n") VT_RST, + this->actor.params); + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; + + this->wonderMode = PARAMS_GET_U(this->actor.params, 11, 5); + this->itemDrop = PARAMS_GET_U(this->actor.params, 6, 5); + this->switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); if (this->switchFlag == 0x3F) { this->switchFlag = -1; } - this->actor.targetMode = 1; + this->actor.attentionRangeType = ATTENTION_RANGE_1; if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ You are Shock! ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); Actor_Kill(&this->actor); @@ -321,8 +322,8 @@ void EnWonderItem_BombSoldier(EnWonderItem* this, PlayState* play) { this->collider.base.acFlags &= ~AC_HIT; if (Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HEISHI2, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.yawTowardsPlayer, 0, 9) != NULL) { - // "Careless soldier spawned" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ うっかり兵セット完了 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ うっかり兵セット完了 ☆☆☆☆☆ \n", "☆☆☆☆☆ Careless soldier spawned ☆☆☆☆☆ \n") + VT_RST); } if (this->switchFlag >= 0) { Flags_SetSwitch(play, this->switchFlag); diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h index 117b763c63..4aca3ffe0a 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h @@ -29,7 +29,7 @@ typedef struct EnWonderItem { /* 0x01CC */ char unk_1CC[4]; } EnWonderItem; // size = 0x01D0 -typedef enum { +typedef enum EnWonderItemMode { /* 0 */ WONDERITEM_MULTITAG_FREE, /* 1 */ WONDERITEM_TAG_POINT_FREE, /* 2 */ WONDERITEM_PROXIMITY_DROP, @@ -42,7 +42,7 @@ typedef enum { /* 9 */ WONDERITEM_ROLL_DROP } EnWonderItemMode; -typedef enum { +typedef enum EnWonderItemDrop { /* 0 */ WONDERITEM_DROP_NUTS, /* 1 */ WONDERITEM_DROP_HEART_PIECE, /* 2 */ WONDERITEM_DROP_MAGIC_LARGE, diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c index 56fdd5b046..783d1f6011 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c @@ -7,7 +7,7 @@ #include "z_en_wonder_talk.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_27) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_LOCK_ON_DISABLED) void EnWonderTalk_Init(Actor* thisx, PlayState* play); void EnWonderTalk_Destroy(Actor* thisx, PlayState* play); @@ -17,7 +17,7 @@ void func_80B391CC(EnWonderTalk* this, PlayState* play); void func_80B395F0(EnWonderTalk* this, PlayState* play); void func_80B3943C(EnWonderTalk* this, PlayState* play); -ActorInit En_Wonder_Talk_InitVars = { +ActorProfile En_Wonder_Talk_Profile = { /**/ ACTOR_EN_WONDER_TALK, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -39,13 +39,13 @@ void EnWonderTalk_Init(Actor* thisx, PlayState* play) { // "Special conversation" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 特殊会話くん ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); - this->unk_150 = (this->actor.params >> 0xB) & 0x1F; - this->unk_152 = (this->actor.params >> 6) & 0x1F; - this->switchFlag = this->actor.params & 0x3F; + this->unk_150 = PARAMS_GET_U(this->actor.params, 11, 5); + this->unk_152 = PARAMS_GET_U(this->actor.params, 6, 5); + this->switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); if (this->switchFlag == 0x3F) { this->switchFlag = -1; } - this->actor.targetMode = 1; + this->actor.attentionRangeType = ATTENTION_RANGE_1; if (this->switchFlag >= 0) { if (Flags_GetSwitch(play, this->switchFlag)) { PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ You are Shock! ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); @@ -143,7 +143,7 @@ void func_80B3943C(EnWonderTalk* this, PlayState* play) { this->actionFunc = func_80B395F0; } else { if (this->switchFlag >= 0) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Flags_SetSwitch(play, this->switchFlag); } this->actionFunc = func_80B391CC; @@ -175,7 +175,7 @@ void func_80B3943C(EnWonderTalk* this, PlayState* play) { void func_80B395F0(EnWonderTalk* this, PlayState* play) { if (this->unk_156 == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play)) { if (this->switchFlag >= 0) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Flags_SetSwitch(play, this->switchFlag); } switch (this->unk_150) { diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c index b70a8cf185..b657da9feb 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c @@ -7,7 +7,7 @@ #include "z_en_wonder_talk2.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_27) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_LOCK_ON_DISABLED) void EnWonderTalk2_Init(Actor* thisx, PlayState* play); void EnWonderTalk2_Destroy(Actor* thisx, PlayState* play); @@ -19,7 +19,7 @@ void func_80B3A15C(EnWonderTalk2* this, PlayState* play); void func_80B3A3D4(EnWonderTalk2* this, PlayState* play); void EnWonderTalk2_DoNothing(EnWonderTalk2* this, PlayState* play); -ActorInit En_Wonder_Talk2_InitVars = { +ActorProfile En_Wonder_Talk2_Profile = { /**/ ACTOR_EN_WONDER_TALK2, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -43,7 +43,7 @@ void EnWonderTalk2_Init(Actor* thisx, PlayState* play) { PRINTF("\n\n"); // "Transparent message" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 透明メッセージ君 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); - this->baseMsgId = (this->actor.params >> 6) & 0xFF; + this->baseMsgId = PARAMS_GET_U(this->actor.params, 6, 8); if (this->actor.world.rot.z > 0) { s32 rangeIndex = 0; s16 rotZmod10 = this->actor.world.rot.z; @@ -58,13 +58,13 @@ void EnWonderTalk2_Init(Actor* thisx, PlayState* play) { rangeIndex = 0; } - this->actor.targetMode = D_80B3A8E0[rangeIndex]; + this->actor.attentionRangeType = D_80B3A8E0[rangeIndex]; PRINTF("\n\n"); // "originally?" PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 元は? ☆☆☆☆☆ %d\n" VT_RST, this->actor.world.rot.z); // "The range is?" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ レンジは? ☆☆☆☆☆ %d\n" VT_RST, this->actor.targetMode); + PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ レンジは? ☆☆☆☆☆ %d\n" VT_RST, this->actor.attentionRangeType); // "Is the range?" PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ は、範囲わ? ☆☆☆☆☆ %f\n" VT_RST, this->triggerRange); PRINTF("\n\n"); @@ -73,8 +73,8 @@ void EnWonderTalk2_Init(Actor* thisx, PlayState* play) { } this->initPos = this->actor.world.pos; - this->switchFlag = (this->actor.params & 0x3F); - this->talkMode = ((this->actor.params >> 0xE) & 3); + this->switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); + this->talkMode = PARAMS_GET_U(this->actor.params, 14, 2); if (this->switchFlag == 0x3F) { this->switchFlag = -1; @@ -91,7 +91,7 @@ void EnWonderTalk2_Init(Actor* thisx, PlayState* play) { this->talkMode = 4; } if (this->talkMode == 3) { - this->actor.flags &= ~ACTOR_FLAG_27; + this->actor.flags &= ~ACTOR_FLAG_LOCK_ON_DISABLED; this->actionFunc = EnWonderTalk2_DoNothing; } else { this->actionFunc = func_80B3A10C; @@ -114,7 +114,7 @@ void func_80B3A15C(EnWonderTalk2* this, PlayState* play) { this->unk_158++; if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { if (!this->unk_15A) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->unk_15A = true; } } else if (Actor_TalkOfferAccepted(&this->actor, play)) { @@ -193,7 +193,7 @@ void func_80B3A3D4(EnWonderTalk2* this, PlayState* play) { if (this->talkMode == 4) { this->unk_15A = true; } - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_4); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_7); this->unk_156 = true; this->actionFunc = func_80B3A4F8; @@ -208,7 +208,7 @@ void func_80B3A4F8(EnWonderTalk2* this, PlayState* play) { this->unk_158++; if (this->switchFlag >= 0 && Flags_GetSwitch(play, this->switchFlag)) { if (!this->unk_15A) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->unk_15A = true; } } else if ((this->talkMode != 4) || !this->unk_15A) { @@ -235,7 +235,7 @@ void func_80B3A4F8(EnWonderTalk2* this, PlayState* play) { // "Processing range" PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 処理範囲 %f\n" VT_RST, this->triggerRange); // "What is your range?" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ レンジは? \t\t %d\n" VT_RST, this->actor.targetMode); + PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ レンジは? \t\t %d\n" VT_RST, this->actor.attentionRangeType); PRINTF("\n\n"); PRINTF("\n\n"); switch (this->talkMode) { @@ -256,7 +256,7 @@ void func_80B3A4F8(EnWonderTalk2* this, PlayState* play) { if (!this->unk_156) { Message_StartTextbox(play, this->actor.textId, NULL); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_4; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4; this->actionFunc = func_80B3A3D4; } diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index 6845d39837..f893a1b06c 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -18,13 +18,13 @@ void EnWood02_Draw(Actor* thisx, PlayState* play); * WOOD_SPAWN_SPAWNER is also used by some individual trees: EnWood02_Update also checks for parent before running any * despawning code. * */ -typedef enum { +typedef enum WoodSpawnType { /* 0 */ WOOD_SPAWN_NORMAL, /* 1 */ WOOD_SPAWN_SPAWNED, /* 2 */ WOOD_SPAWN_SPAWNER } WoodSpawnType; -typedef enum { +typedef enum WoodDrawType { /* 0 */ WOOD_DRAW_TREE_CONICAL, /* 1 */ WOOD_DRAW_TREE_OVAL, /* 2 */ WOOD_DRAW_TREE_KAKARIKO_ADULT, @@ -33,7 +33,7 @@ typedef enum { /* 5 */ WOOD_DRAW_LEAF_YELLOW } WoodDrawType; -ActorInit En_Wood02_InitVars = { +ActorProfile En_Wood02_Profile = { /**/ ACTOR_EN_WOOD02, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -47,7 +47,7 @@ ActorInit En_Wood02_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_TREE, + COL_MATERIAL_TREE, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -55,7 +55,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK5, + ELEM_MATERIAL_UNK5, { 0x00000000, 0x00, 0x00 }, { 0x0FC0074A, 0x00, 0x00 }, ATELEM_NONE, @@ -70,7 +70,7 @@ static f32 sSpawnDistance[] = { 707.0f, 525.0f, 510.0f, 500.0f, 566.0f, 141.0f } static s16 sSpawnAngle[] = { 0x1FFF, 0x4C9E, 0x77F5, 0xA5C9, 0xD6C3, 0xA000 }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 5600, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 5600, ICHAIN_STOP), }; static Gfx* D_80B3BF54[] = { @@ -169,7 +169,7 @@ void EnWood02_Init(Actor* thisx, PlayState* play2) { spawnType = WOOD_SPAWN_NORMAL; actorScale = 1.0f; - this->unk_14C = (this->actor.params >> 8) & 0xFF; + this->unk_14C = PARAMS_GET_U(this->actor.params, 8, 8); if (this->actor.home.rot.z != 0) { this->actor.home.rot.z = (this->actor.home.rot.z << 8) | this->unk_14C; @@ -446,13 +446,11 @@ void EnWood02_Draw(Actor* thisx, PlayState* play) { } else if (D_80B3BF70[this->drawType & 0xF] != NULL) { Gfx_DrawDListOpa(play, D_80B3BF54[this->drawType & 0xF]); gDPSetEnvColor(POLY_XLU_DISP++, red, green, blue, 0); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_wood02.c", 808), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_wood02.c", 808); gSPDisplayList(POLY_XLU_DISP++, D_80B3BF70[this->drawType & 0xF]); } else { Gfx_SetupDL_25Xlu(gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_en_wood02.c", 814), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_en_wood02.c", 814); gSPDisplayList(POLY_XLU_DISP++, D_80B3BF54[this->drawType & 0xF]); } diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h index 85ec12a5b8..14ca5b967e 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h @@ -17,7 +17,7 @@ typedef struct EnWood02 { // Types with SPAWNED in the name are those that can be managed by a spawner, however the actor allows you to spawn them // on their own without a spawner as well. -typedef enum { +typedef enum WoodType { /* 0x00 */ WOOD_TREE_CONICAL_LARGE, /* 0x01 */ WOOD_TREE_CONICAL_MEDIUM, /* 0x02 */ WOOD_TREE_CONICAL_SMALL, diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 17ca714742..1e04ef2966 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -14,8 +14,8 @@ #include "assets/scenes/dungeons/ice_doukutu/ice_doukutu_scene.h" #include "terminal.h" -// For retail BSS ordering, the block number of sSfxPos -// must be between 0 and 213 inclusive. +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:0" \ + "pal-1.0:0 pal-1.1:0" #define FLAGS ACTOR_FLAG_4 @@ -33,14 +33,14 @@ void EnXc_DrawSquintingEyes(Actor* thisx, PlayState* play); static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_PLAYER, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -254,25 +254,25 @@ void func_80B3C8CC(EnXc* this, PlayState* play) { SkelAnime* skelAnime = &this->skelAnime; if (skelAnime->jointTable[0].y >= skelAnime->baseTransl.y) { - skelAnime->moveFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; - AnimTaskQueue_AddActorMove(play, &this->actor, skelAnime, 1.0f); + skelAnime->movementFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; + AnimTaskQueue_AddActorMovement(play, &this->actor, skelAnime, 1.0f); } } void func_80B3C924(EnXc* this, PlayState* play) { - this->skelAnime.moveFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; - AnimTaskQueue_AddActorMove(play, &this->actor, &this->skelAnime, 1.0f); + this->skelAnime.movementFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; + AnimTaskQueue_AddActorMovement(play, &this->actor, &this->skelAnime, 1.0f); } void func_80B3C964(EnXc* this, PlayState* play) { this->skelAnime.baseTransl = this->skelAnime.jointTable[0]; this->skelAnime.prevTransl = this->skelAnime.jointTable[0]; - this->skelAnime.moveFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; - AnimTaskQueue_AddActorMove(play, &this->actor, &this->skelAnime, 1.0f); + this->skelAnime.movementFlags |= ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y; + AnimTaskQueue_AddActorMovement(play, &this->actor, &this->skelAnime, 1.0f); } void func_80B3C9DC(EnXc* this) { - this->skelAnime.moveFlags &= ~(ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y); + this->skelAnime.movementFlags &= ~(ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y); } void func_80B3C9EC(EnXc* this) { @@ -1396,7 +1396,8 @@ void func_80B3F3D8(void) { Sfx_PlaySfxCentered2(NA_SE_PL_SKIP); } -#pragma increment_block_number 20 +#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-jp:64 gc-jp-ce:64 gc-jp-mq:64 gc-us:64 gc-us-mq:64" \ + "ntsc-1.2:64 pal-1.0:64 pal-1.1:64" void EnXc_PlayDiveSFX(Vec3f* src, PlayState* play) { static Vec3f D_80B42DA0; @@ -2208,7 +2209,7 @@ void EnXc_SetupDialogueAction(EnXc* this, PlayState* play) { this->action = SHEIK_ACTION_IN_DIALOGUE; } else { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; if (INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE) { this->actor.textId = 0x7010; } else { @@ -2221,7 +2222,7 @@ void EnXc_SetupDialogueAction(EnXc* this, PlayState* play) { void func_80B41798(EnXc* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { this->action = SHEIK_ACTION_BLOCK_PEDESTAL; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); } } @@ -2456,7 +2457,7 @@ void EnXc_Draw(Actor* thisx, PlayState* play) { } } -ActorInit En_Xc_InitVars = { +ActorProfile En_Xc_Profile = { /**/ ACTOR_EN_XC, /**/ ACTORCAT_NPC, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.h b/src/overlays/actors/ovl_En_Xc/z_en_xc.h index beac1a859b..c01b98a842 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.h +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.h @@ -9,7 +9,7 @@ struct EnXc; typedef void (*EnXcActionFunc)(struct EnXc*, PlayState*); typedef void (*EnXcDrawFunc)(struct Actor*, PlayState*); -typedef enum { +typedef enum EnXcType { /* 0 */ SHEIK_TYPE_0, /* 1 */ SHEIK_TYPE_1, /* 2 */ SHEIK_TYPE_2, @@ -22,7 +22,7 @@ typedef enum { /* 9 */ SHEIK_TYPE_9 } EnXcType; -typedef enum { +typedef enum EnXcDrawMode { /* 0 */ SHEIK_DRAW_NOTHING, /* 1 */ SHEIK_DRAW_DEFAULT, /* 2 */ SHEIK_DRAW_PULLING_OUT_HARP, @@ -31,7 +31,7 @@ typedef enum { /* 5 */ SHEIK_DRAW_SQUINT } EnXcDrawMode; -typedef enum { +typedef enum EnXcAction { /* 00 */ SHEIK_ACTION_INIT, /* 01 */ SHEIK_ACTION_WAIT, /* 02 */ SHEIK_ACTION_GRACEFUL_FALL, diff --git a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c index 7f05638f03..ddaea28848 100644 --- a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c +++ b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c @@ -16,7 +16,7 @@ void func_80B42F74(EnYabusameMark* this, PlayState* play); static ColliderQuadInit sQuadInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -24,7 +24,7 @@ static ColliderQuadInit sQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, ATELEM_NONE | ATELEM_SFX_NORMAL, @@ -34,7 +34,7 @@ static ColliderQuadInit sQuadInit = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -ActorInit En_Yabusame_Mark_InitVars = { +ActorProfile En_Yabusame_Mark_Profile = { /**/ ACTOR_EN_YABUSAME_MARK, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -80,9 +80,9 @@ void EnYabusameMark_Init(Actor* thisx, PlayState* play) { PRINTF("\n\n"); PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ やぶさめまと ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->typeIndex = this->actor.params; - this->actor.targetMode = 5; + this->actor.attentionRangeType = ATTENTION_RANGE_5; PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 種類インデックス \t ☆☆☆☆☆ %d\n" VT_RST, this->typeIndex); switch (this->typeIndex) { case 0: diff --git a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c index c133bde62b..8ac0995c59 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c @@ -18,7 +18,7 @@ void func_80B43A94(EnYukabyun* this, PlayState* play); void func_80B43AD4(EnYukabyun* this, PlayState* play); void func_80B43B6C(EnYukabyun* this, PlayState* play); -ActorInit En_Yukabyun_InitVars = { +ActorProfile En_Yukabyun_Profile = { /**/ ACTOR_EN_YUKABYUN, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -32,7 +32,7 @@ ActorInit En_Yukabyun_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_NO_PUSH | OC1_TYPE_ALL, @@ -40,7 +40,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_HARD, @@ -52,7 +52,7 @@ static ColliderCylinderInit sCylinderInit = { static InitChainEntry sInitChain[] = { ICHAIN_VEC3F(scale, 1, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 16, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 16, ICHAIN_STOP), }; static void* D_80B43F64[] = { gFloorTileEnemyTopTex, gFloorTileEnemyBottomTex }; @@ -80,7 +80,7 @@ void func_80B43A94(EnYukabyun* this, PlayState* play) { this->unk_150--; } if (this->unk_150 == 0) { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_IGNORE_QUAKE; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE; this->actionfunc = func_80B43AD4; } } @@ -94,7 +94,7 @@ void func_80B43AD4(EnYukabyun* this, PlayState* play) { this->actionfunc = func_80B43B6C; } Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 30.0f, 1.0f); - func_8002F974(&this->actor, NA_SE_EN_YUKABYUN_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_YUKABYUN_FLY - SFX_FLAG); } void func_80B43B6C(EnYukabyun* this, PlayState* play) { @@ -103,7 +103,7 @@ void func_80B43B6C(EnYukabyun* this, PlayState* play) { Actor_Kill(&this->actor); return; } - func_8002F974(&this->actor, NA_SE_EN_YUKABYUN_FLY - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_YUKABYUN_FLY - SFX_FLAG); } void EnYukabyun_Break(EnYukabyun* this, PlayState* play) { @@ -122,7 +122,7 @@ void EnYukabyun_Update(Actor* thisx, PlayState* play) { this->collider.base.atFlags &= ~AT_HIT; this->collider.base.acFlags &= ~AC_HIT; this->collider.base.ocFlags1 &= ~OC1_HIT; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_EN_OCTAROCK_ROCK); this->actionfunc = EnYukabyun_Break; } @@ -150,8 +150,7 @@ void EnYukabyun_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80B43F64[this->unk_152])); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_yukabyun.c", 373), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_en_yukabyun.c", 373); gSPDisplayList(POLY_OPA_DISP++, gFloorTileEnemyDL); CLOSE_DISPS(play->state.gfxCtx, "../z_en_yukabyun.c", 378); diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 05ef602b33..9c50186329 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -7,7 +7,7 @@ #include "z_en_zf.h" #include "assets/objects/object_zf/object_zf.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4) void EnZf_Init(Actor* thisx, PlayState* play); void EnZf_Destroy(Actor* thisx, PlayState* play); @@ -99,7 +99,7 @@ static Vec3f sPlatformPositions[] = { static s16 D_80B4A1B0 = 0; static s16 D_80B4A1B4 = 1; -ActorInit En_Zf_InitVars = { +ActorProfile En_Zf_Profile = { /**/ ACTOR_EN_ZF, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -113,7 +113,7 @@ ActorInit En_Zf_InitVars = { static ColliderCylinderInit sBodyCylinderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -121,7 +121,7 @@ static ColliderCylinderInit sBodyCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -133,7 +133,7 @@ static ColliderCylinderInit sBodyCylinderInit = { static ColliderQuadInit sSwordQuadInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, @@ -141,7 +141,7 @@ static ColliderQuadInit sSwordQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL | ATELEM_UNK7, @@ -151,7 +151,7 @@ static ColliderQuadInit sSwordQuadInit = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -typedef enum { +typedef enum EnZfDamageEffect { /* 0x0 */ ENZF_DMGEFF_NONE, /* 0x1 */ ENZF_DMGEFF_STUN, /* 0x6 */ ENZF_DMGEFF_IMMUNE = 6, // Skips damage code, but also skips the top half of Update @@ -195,7 +195,7 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 15, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3500, ICHAIN_STOP), }; @@ -282,13 +282,13 @@ void EnZf_Init(Actor* thisx, PlayState* play) { f32 posDiff; Actor_ProcessInitChain(thisx, sInitChain); - thisx->targetMode = 3; - this->clearFlag = (thisx->params & 0xFF00) >> 8; + thisx->attentionRangeType = ATTENTION_RANGE_3; + this->clearFlag = PARAMS_GET_S(thisx->params, 8, 8); /* Strip the top byte of params */ thisx->params &= 0xFF; /* Return the params to their original value if they were originally negative, i.e. 0xFFFF or 0xFFFE */ - if (thisx->params & 0x80) { + if (PARAMS_GET_NOSHIFT(thisx->params, 7, 1)) { thisx->params |= 0xFF00; } @@ -539,7 +539,7 @@ s16 EnZf_FindNextPlatformTowardsPlayer(Vec3f* pos, s16 curPlatform, s16 arg2, Pl // Player not targeting this or another EnZf? s32 EnZf_CanAttack(PlayState* play, EnZf* this) { - Actor* targetedActor; + Actor* playerFocusActor; Player* player = GET_PLAYER(play); if (this->actor.params >= ENZF_TYPE_LIZALFOS_MINIBOSS_A) { // miniboss @@ -549,20 +549,20 @@ s32 EnZf_CanAttack(PlayState* play, EnZf* this) { return true; } } else { - if (!Actor_OtherIsTargeted(play, &this->actor)) { + if (!Actor_OtherIsLockedOn(play, &this->actor)) { return true; } if (this->actor.params == ENZF_TYPE_DINOLFOS) { - targetedActor = player->unk_664; - if (targetedActor == NULL) { + playerFocusActor = player->focusActor; + if (playerFocusActor == NULL) { return false; } else { - if (targetedActor->category != ACTORCAT_ENEMY) { + if (playerFocusActor->category != ACTORCAT_ENEMY) { return true; } - if (targetedActor->id != ACTOR_EN_ZF) { + if (playerFocusActor->id != ACTOR_EN_ZF) { return false; - } else if (targetedActor->colorFilterTimer != 0) { + } else if (playerFocusActor->colorFilterTimer != 0) { return true; } } @@ -648,7 +648,7 @@ void EnZf_SetupDropIn(EnZf* this) { this->hopAnimIndex = 1; this->action = ENZF_ACTION_DROP_IN; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnZf_SetupAction(this, EnZf_DropIn); } @@ -656,7 +656,7 @@ void EnZf_SetupDropIn(EnZf* this) { void EnZf_DropIn(EnZf* this, PlayState* play) { if (this->unk_3F0 == 1) { Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_CRY); - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; if (this->actor.params == ENZF_TYPE_LIZALFOS_MINIBOSS_A) { func_800F5ACC(NA_BGM_MINI_BOSS); @@ -668,7 +668,7 @@ void EnZf_DropIn(EnZf* this, PlayState* play) { this->unk_3F0--; } else if (this->actor.xzDistToPlayer <= 160.0f) { this->unk_3F0 = 0; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_CRY); } @@ -836,7 +836,7 @@ void EnZf_ApproachPlayer(EnZf* this, PlayState* play) { } } - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { sp40 = 100.0f; } @@ -897,7 +897,7 @@ void EnZf_ApproachPlayer(EnZf* this, PlayState* play) { if ((this->actor.xzDistToPlayer < 180.0f) && (this->actor.xzDistToPlayer > 160.0f) && Actor_IsFacingPlayer(&this->actor, 0x71C)) { - if (Actor_IsTargeted(play, &this->actor)) { + if (Actor_IsLockedOn(play, &this->actor)) { if (Rand_ZeroOne() < 0.1f) { this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; EnZf_SetupJumpForward(this); @@ -1113,7 +1113,7 @@ void func_80B463E4(EnZf* this, PlayState* play) { } } - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { baseRange = 100.0f; } @@ -1223,8 +1223,9 @@ void EnZf_Slash(EnZf* this, PlayState* play) { if (yawDiff > 16000) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; func_80B483E4(this, play); - } else if (player->stateFlags1 & (PLAYER_STATE1_4 | PLAYER_STATE1_13 | PLAYER_STATE1_14)) { - if (this->actor.isTargeted) { + } else if (player->stateFlags1 & + (PLAYER_STATE1_HOSTILE_LOCK_ON | PLAYER_STATE1_13 | PLAYER_STATE1_14)) { + if (this->actor.isLockedOn) { EnZf_SetupSlash(this); } else { func_80B483E4(this, play); @@ -1827,7 +1828,7 @@ void EnZf_CircleAroundPlayer(EnZf* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y + 0x4000; - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { baseRange = 100.0f; } @@ -1926,7 +1927,7 @@ void EnZf_SetupDie(EnZf* this) { } this->action = ENZF_ACTION_DIE; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; if (D_80B4A1B4 != -1) { if (this->actor.prev != NULL) { diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.h b/src/overlays/actors/ovl_En_Zf/z_en_zf.h index b9bcea8000..c5ade78544 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.h +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.h @@ -8,14 +8,14 @@ struct EnZf; typedef void (*EnZfActionFunc)(struct EnZf*, PlayState*); -typedef enum { +typedef enum EnZfType { /* -2 */ ENZF_TYPE_DINOLFOS = -2, /* -1 */ ENZF_TYPE_LIZALFOS_LONE, // Not a miniboss, e.g. Spirit Temple /* 0 */ ENZF_TYPE_LIZALFOS_MINIBOSS_A, // Pair with B /* 1 */ ENZF_TYPE_LIZALFOS_MINIBOSS_B // Pair with A } EnZfType; -typedef enum { +typedef enum EnZfAction { /* 0 */ ENZF_ACTION_DROP_IN, /* 3 */ ENZF_ACTION_3 = 3, // stop and choose action? /* 5 */ ENZF_ACTION_APPROACH_PLAYER = 5, @@ -36,7 +36,7 @@ typedef enum { /* 22 */ ENZF_ACTION_JUMP_UP } EnZfAction; -typedef enum { +typedef enum EnZfLimb { /* 0x00 */ ENZF_LIMB_NONE, /* 0x01 */ ENZF_LIMB_ROOT, /* 0x02 */ ENZF_LIMB_BODY_ROOT, diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c index 1780cc1c9b..7a9edb9c67 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c @@ -7,7 +7,7 @@ #include "z_en_zl1.h" #include "assets/objects/object_zl1/object_zl1.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) void EnZl1_Init(Actor* thisx, PlayState* play); void EnZl1_Destroy(Actor* thisx, PlayState* play); @@ -27,7 +27,7 @@ extern CutsceneData D_80B4C5D0[]; #include "z_en_zl1_camera_data.inc.c" -ActorInit En_Zl1_InitVars = { +ActorProfile En_Zl1_Profile = { /**/ ACTOR_EN_ZL1, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -41,7 +41,7 @@ ActorInit En_Zl1_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -49,7 +49,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -85,7 +85,7 @@ void EnZl1_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); Actor_SetScale(&this->actor, 0.01f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); - this->actor.targetMode = 0; + this->actor.attentionRangeType = ATTENTION_RANGE_0; if (IS_CUTSCENE_LAYER) { frameCount = Animation_GetLastFrame(&gChildZelda1Anim_00438); @@ -345,8 +345,8 @@ void func_80B4B834(CsCmdActorCue* cue, Vec3f* dest) { } void func_80B4B874(EnZl1* this, PlayState* play) { - this->skelAnime.moveFlags |= ANIM_FLAG_UPDATE_XZ; - AnimTaskQueue_AddActorMove(play, &this->actor, &this->skelAnime, 1.0f); + this->skelAnime.movementFlags |= ANIM_FLAG_UPDATE_XZ; + AnimTaskQueue_AddActorMovement(play, &this->actor, &this->skelAnime, 1.0f); } void func_80B4B8B4(EnZl1* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index 18fa97b712..fdb12d3b10 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -87,7 +87,7 @@ static EnZl2DrawFunc sDrawFuncs[] = { func_80B525D4, }; -ActorInit En_Zl2_InitVars = { +ActorProfile En_Zl2_Profile = { /**/ ACTOR_EN_ZL2, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -447,17 +447,25 @@ void func_80B4F230(EnZl2* this, s16 arg1, s32 arg2) { s32 func_80B4F45C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx, Gfx** gfx) { s32 pad; EnZl2* this = (EnZl2*)thisx; - Mtx* sp74; - MtxF sp34; - Vec3s sp2C; - s16 pad2; - s16* unk_1DC = this->unk_1DC; if (limbIndex == 14) { - sp74 = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Mtx) * 7); + Mtx* sp74 = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Mtx) * 7); + MtxF sp34; + Vec3s sp2C; + s16 pad2; + s16* unk_1DC = this->unk_1DC; + gSPSegment((*gfx)++, 0x0C, sp74); Matrix_Push(); + +#if PLATFORM_N64 + // Anti-piracy check, Zelda's hair is misshapen if the check fails + if (osCicId != 6105) { + Matrix_Scale(2.0f, 0.5f, 2.0f, MTXMODE_APPLY); + } +#endif + Matrix_Translate(pos->x, pos->y, pos->z, MTXMODE_APPLY); Matrix_RotateZYX(rot->x, rot->y, rot->z, MTXMODE_APPLY); Matrix_Push(); @@ -574,8 +582,7 @@ void EnZl2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Matrix_Translate(180.0f, 979.0f, -375.0f, MTXMODE_APPLY); Matrix_RotateZYX(-0x5DE7, -0x53E9, 0x3333, MTXMODE_APPLY); Matrix_Scale(1.2f, 1.2f, 1.2f, MTXMODE_APPLY); - gSPMatrix((*gfx)++, MATRIX_NEW(play->state.gfxCtx, "../z_en_zl2.c", 1253), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD((*gfx)++, play->state.gfxCtx, "../z_en_zl2.c", 1253); gSPDisplayList((*gfx)++, gZelda2OcarinaDL); } Matrix_Pop(); diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index fc6eaab909..dec42825e6 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -25,14 +25,14 @@ void func_80B59AD0(EnZl3* this, PlayState* play); static ColliderCylinderInitType1 sCylinderInit = { { - COLTYPE_HIT0, + COL_MATERIAL_HIT0, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_PLAYER, COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -740,21 +740,21 @@ void EnZl3_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, } s32 func_80B54DB4(EnZl3* this) { - s32 params = this->actor.params >> 8; + s32 params = PARAMS_GET_U(this->actor.params, 8, 8); - return params & 0xFF; + return params; } s32 func_80B54DC4(EnZl3* this) { - s32 params = this->actor.params >> 4; + s32 params = PARAMS_GET_U(this->actor.params, 4, 4); - return params & 0xF; + return params; } s32 func_80B54DD4(EnZl3* this) { - s32 params = this->actor.params; + s32 params = PARAMS_GET_U(this->actor.params, 0, 4); - return params & 0xF; + return params; } void func_80B54DE0(EnZl3* this, PlayState* play) { @@ -1027,7 +1027,7 @@ void func_80B55780(EnZl3* this, PlayState* play) { this->drawConfig = 1; PRINTF("ゼルダ姫のEn_Zl3_Actor_inFinal2_Initは通った!!!!!!!!!!!!!!!!!!!!!!!!!\n"); EnZl3_setMouthIndex(this, 1); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } void func_80B55808(EnZl3* this) { @@ -1126,8 +1126,8 @@ void func_80B55C4C(EnZl3* this, s32 arg1) { void func_80B55C70(EnZl3* this) { func_80B54E14(this, &gZelda2Anime2Anim_008684, 2, -8.0f, 0); this->action = 12; - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } void func_80B55CCC(EnZl3* this, s32 arg1) { @@ -1140,20 +1140,20 @@ void func_80B55D00(EnZl3* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, play)) { this->action = 13; } else if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) <= 0x4300) { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.textId = 0x70D5; Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play); } else { - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } } void func_80B55DB0(EnZl3* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->action = 12; } } @@ -1199,14 +1199,14 @@ void func_80B55F6C(EnZl3* this, PlayState* play) { BossGanon2* bossGanon2 = func_80B53488(this, play); if ((bossGanon2 != NULL) && (bossGanon2->unk_324 <= (10.0f / 81.0f))) { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.textId = 0x7059; Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play); } } else { - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } } @@ -1231,8 +1231,8 @@ void func_80B56090(EnZl3* this, s32 arg1) { void func_80B56108(EnZl3* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->action = 16; } } @@ -1261,22 +1261,22 @@ void func_80B56214(EnZl3* this, PlayState* play) { if (bossGanon2 != NULL) { if (bossGanon2->unk_324 <= (10.0f / 81.0f)) { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actor.textId = 0x7059; Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play); } } } else { - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } } void func_80B562F4(EnZl3* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { - this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->action = 20; } } @@ -1715,7 +1715,7 @@ void func_80B57350(EnZl3* this, PlayState* play) { s16 temp_v0 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (ABS(temp_v0) <= 0x4300) { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; this->actor.textId = func_80B572F0(play); Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play); } @@ -2084,7 +2084,7 @@ void func_80B58014(EnZl3* this, PlayState* play) { this->action = 34; this->unk_3D0 = 0; func_80B57AE0(this, play); - } else if ((invincibilityTimer > 0) || (player->fallDistance >= 0x33)) { + } else if ((invincibilityTimer > 0) || (player->fallDistance >= 51)) { func_80B54E14(this, &gZelda2Anime2Anim_007664, 0, -11.0f, 0); this->action = 30; func_80B537E8(this); @@ -2239,7 +2239,7 @@ s32 func_80B5899C(EnZl3* this, PlayState* play) { Player* player = GET_PLAYER(play); s8 invincibilityTimer = player->invincibilityTimer; - if ((invincibilityTimer > 0) || (player->fallDistance >= 0x33)) { + if ((invincibilityTimer > 0) || (player->fallDistance >= 51)) { func_80B54E14(this, &gZelda2Anime2Anim_007664, 2, -11.0f, 0); this->action = 35; func_80B56DC8(this); @@ -2556,7 +2556,7 @@ void func_80B59828(EnZl3* this, PlayState* play) { if (func_80B59698(this, play) || (!func_80B56EE4(this, play) && func_80B57890(this, play))) { func_80B54E14(this, &gZelda2Anime2Anim_009FBC, 0, 0.0f, 0); - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; func_80B56F10(this, play); newRotY = func_80B571A8(this); this->actor.shape.rot.y = newRotY; @@ -2802,7 +2802,7 @@ void EnZl3_Draw(Actor* thisx, PlayState* play) { sDrawFuncs[this->drawConfig](this, play); } -ActorInit En_Zl3_InitVars = { +ActorProfile En_Zl3_Profile = { /**/ ACTOR_EN_ZL3, /**/ ACTORCAT_NPC, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index fb6cbd9ec0..22f558ea5f 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -8,9 +8,9 @@ #include "assets/objects/object_zl4/object_zl4.h" #include "assets/scenes/indoors/nakaniwa/nakaniwa_scene.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4) -typedef enum { +typedef enum EnZl4CutsceneState { /* 0 */ ZL4_CS_WAIT, /* 1 */ ZL4_CS_START, /* 2 */ ZL4_CS_MEET, @@ -22,7 +22,7 @@ typedef enum { /* 8 */ ZL4_CS_PLAN } EnZl4CutsceneState; -typedef enum { +typedef enum EnZl4EyeExpression { /* 0 */ ZL4_EYES_NEUTRAL, /* 1 */ ZL4_EYES_SHUT, /* 2 */ ZL4_EYES_LOOK_LEFT, @@ -32,14 +32,14 @@ typedef enum { /* 6 */ ZL4_EYES_OPEN } EnZl4EyeExpression; -typedef enum { +typedef enum EnZl4MouthExpression { /* 0 */ ZL4_MOUTH_NEUTRAL, /* 1 */ ZL4_MOUTH_HAPPY, /* 2 */ ZL4_MOUTH_WORRIED, /* 3 */ ZL4_MOUTH_SURPRISED } EnZl4MouthExpression; -typedef enum { +typedef enum EnZl4EyeState { /* 0 */ ZL4_EYE_OPEN, /* 1 */ ZL4_EYE_BLINK, /* 2 */ ZL4_EYE_SHUT, @@ -58,7 +58,7 @@ void EnZl4_Cutscene(EnZl4* this, PlayState* play); void EnZl4_Idle(EnZl4* this, PlayState* play); void EnZl4_TheEnd(EnZl4* this, PlayState* play); -ActorInit En_Zl4_InitVars = { +ActorProfile En_Zl4_Profile = { /**/ ACTOR_EN_ZL4, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -72,7 +72,7 @@ ActorInit En_Zl4_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -80,7 +80,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -92,7 +92,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -typedef enum { +typedef enum EnZl4Animation { /* 0 */ ZL4_ANIM_0, /* 1 */ ZL4_ANIM_1, /* 2 */ ZL4_ANIM_2, @@ -298,8 +298,8 @@ void EnZl4_UpdateFace(EnZl4* this) { } void EnZl4_SetMove(EnZl4* this, PlayState* play) { - this->skelAnime.moveFlags |= ANIM_FLAG_UPDATE_XZ; - AnimTaskQueue_AddActorMove(play, &this->actor, &this->skelAnime, 1.0f); + this->skelAnime.movementFlags |= ANIM_FLAG_UPDATE_XZ; + AnimTaskQueue_AddActorMovement(play, &this->actor, &this->skelAnime, 1.0f); } void func_80B5BB78(EnZl4* this, PlayState* play) { @@ -367,7 +367,7 @@ void EnZl4_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); Actor_SetScale(&this->actor, 0.01f); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->actor.textId = -1; this->eyeExpression = this->mouthExpression = ZL4_MOUTH_NEUTRAL; diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 8b6b591233..fd78e537e2 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -7,9 +7,9 @@ #include "z_en_zo.h" #include "assets/objects/object_zo/object_zo.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) -typedef enum { +typedef enum EnZoEffectType { /* 0 */ ENZO_EFFECT_NONE, /* 1 */ ENZO_EFFECT_RIPPLE, /* 2 */ ENZO_EFFECT_SPLASH, @@ -172,7 +172,7 @@ void EnZo_UpdateEffectsSplashes(EnZo* this) { void EnZo_DrawEffectsRipples(EnZo* this, PlayState* play) { EnZoEffect* effect; s16 i; - u8 materialFlag; + s16 materialFlag; effect = this->effects; OPEN_DISPS(play->state.gfxCtx, "../z_en_zo_eff.c", 217); @@ -194,8 +194,7 @@ void EnZo_DrawEffectsRipples(EnZo* this, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, effect->color.a); Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_Scale(effect->scale, 1.0f, effect->scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_zo_eff.c", 242), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_zo_eff.c", 242); gSPDisplayList(POLY_XLU_DISP++, gZoraRipplesModelDL); } @@ -229,8 +228,7 @@ void EnZo_DrawEffectsBubbles(EnZo* this, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_zo_eff.c", 281), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_zo_eff.c", 281); gSPDisplayList(POLY_XLU_DISP++, gZoraBubblesModelDL); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_zo_eff.c", 286); @@ -260,8 +258,7 @@ void EnZo_DrawEffectsSplashes(EnZo* this, PlayState* play) { Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_zo_eff.c", 325), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_en_zo_eff.c", 325); gSPDisplayList(POLY_XLU_DISP++, gZoraSplashesModelDL); } @@ -279,7 +276,7 @@ void EnZo_TreadWaterRipples(EnZo* this, f32 scale, f32 targetScale, u8 alpha) { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -287,7 +284,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -299,7 +296,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -ActorInit En_Zo_InitVars = { +ActorProfile En_Zo_Profile = { /**/ ACTOR_EN_ZO, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -311,7 +308,7 @@ ActorInit En_Zo_InitVars = { /**/ EnZo_Draw, }; -typedef enum { +typedef enum EnZoAnimation { /* 0 */ ENZO_ANIM_0, /* 1 */ ENZO_ANIM_1, /* 2 */ ENZO_ANIM_2, @@ -363,7 +360,7 @@ u16 EnZo_GetTextId(PlayState* play, Actor* thisx) { return textId; } - switch (thisx->params & 0x3F) { + switch (PARAMS_GET_U(thisx->params, 0, 6)) { case 8: if (GET_EVENTCHKINF(EVENTCHKINF_30)) { return 0x402A; @@ -581,14 +578,14 @@ void EnZo_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInit); - if (LINK_IS_ADULT && ((this->actor.params & 0x3F) == 8)) { + if (LINK_IS_ADULT && (PARAMS_GET_U(this->actor.params, 0, 6) == 8)) { Actor_Kill(&this->actor); return; } Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENZO_ANIM_2); Actor_SetScale(&this->actor, 0.01f); - this->actor.targetMode = 6; + this->actor.attentionRangeType = ATTENTION_RANGE_6; this->dialogRadius = this->collider.dim.radius + 30.0f; this->trackingMode = NPC_TRACKING_NONE; this->canSpeak = false; @@ -596,7 +593,7 @@ void EnZo_Init(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, this->collider.dim.height * 0.5f, this->collider.dim.radius, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); - if (this->actor.depthInWater < 54.0f || (this->actor.params & 0x3F) == 8) { + if (this->actor.depthInWater < 54.0f || PARAMS_GET_U(this->actor.params, 0, 6) == 8) { this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->actor.shape.shadowScale = 24.0f; Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENZO_ANIM_1); @@ -604,7 +601,7 @@ void EnZo_Init(Actor* thisx, PlayState* play) { this->alpha = 255.0f; this->actionFunc = EnZo_Standing; } else { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnZo_Submerged; } } @@ -646,7 +643,7 @@ void EnZo_Surface(EnZo* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EV_OUT_OF_WATER); EnZo_SpawnSplashes(this); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENZO_ANIM_3); - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnZo_TreadWater; this->actor.velocity.y = 0.0f; this->alpha = 255.0f; @@ -696,7 +693,7 @@ void EnZo_Dive(EnZo* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Actor_PlaySfx(&this->actor, NA_SE_EV_DIVE_WATER); EnZo_SpawnSplashes(this); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.velocity.y = -4.0f; this->skelAnime.playSpeed = 0.0f; } diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.h b/src/overlays/actors/ovl_En_Zo/z_en_zo.h index 28eebdf464..837dd260cb 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.h +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.h @@ -8,7 +8,7 @@ struct EnZo; #define EN_ZO_EFFECT_COUNT 15 -typedef struct { +typedef struct EnZoEffect { /* 0x00 */ u8 type; /* 0x04 */ f32 scale; /* 0x08 */ f32 targetScale; diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c index de1bc675fc..f47520e573 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -12,12 +12,12 @@ #define FLAGS ACTOR_FLAG_4 -typedef struct { +typedef struct EnfHGPainting { /* 0x00 */ Vec3f pos; /* 0x0C */ s16 yRot; } EnfHGPainting; // size = 0x10 -typedef enum { +typedef enum EnfHGIntroState { /* 0 */ INTRO_WAIT, /* 1 */ INTRO_START, /* 2 */ INTRO_FENCE, @@ -45,7 +45,7 @@ void EnfHG_Damage(EnfHG* this, PlayState* play); void EnfHG_Retreat(EnfHG* this, PlayState* play); void EnfHG_Done(EnfHG* this, PlayState* play); -ActorInit En_fHG_InitVars = { +ActorProfile En_fHG_Profile = { /**/ ACTOR_EN_FHG, /**/ ACTORCAT_BG, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.h b/src/overlays/actors/ovl_En_fHG/z_en_fhg.h index 2bde639715..5432f82341 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.h +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.h @@ -8,7 +8,7 @@ struct EnfHG; typedef void (*EnfHGActionFunc)(struct EnfHG*, PlayState*); -typedef enum { +typedef enum EnfHGSignal { /* 0 */ FHG_NO_SIGNAL, /* 1 */ FHG_RAISE_SPEAR, /* 2 */ FHG_REAR, diff --git a/src/overlays/actors/ovl_End_Title/z_end_title.c b/src/overlays/actors/ovl_End_Title/z_end_title.c index 9c71f7e813..6772d76810 100644 --- a/src/overlays/actors/ovl_End_Title/z_end_title.c +++ b/src/overlays/actors/ovl_End_Title/z_end_title.c @@ -5,6 +5,7 @@ */ #include "z_end_title.h" +#include "versions.h" #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) @@ -14,7 +15,7 @@ void EndTitle_Update(Actor* thisx, PlayState* play); void EndTitle_DrawFull(Actor* thisx, PlayState* play); void EndTitle_DrawNintendoLogo(Actor* thisx, PlayState* play); -ActorInit End_Title_InitVars = { +ActorProfile End_Title_Profile = { /**/ ACTOR_END_TITLE, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -87,7 +88,7 @@ void EndTitle_DrawFull(Actor* thisx, PlayState* play) { Matrix_RotateX(BINANG_TO_RAD(0xBB8), MTXMODE_APPLY); Matrix_RotateY(0.0f, MTXMODE_APPLY); Matrix_RotateZ(0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_end_title.c", 412), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_end_title.c", 412); gSPDisplayList(POLY_XLU_DISP++, sTriforceDL); CLOSE_DISPS(play->state.gfxCtx, "../z_end_title.c", 417); @@ -95,14 +96,14 @@ void EndTitle_DrawFull(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_end_title.c", 419); // Draw title cards on the screen - if ((csCurFrame > 890) && (this->endAlpha < 200)) { - this->endAlpha += 7; + if ((csCurFrame > FRAMERATE_CONST(890, 740)) && (this->endAlpha < 200)) { + this->endAlpha += FRAMERATE_CONST(7, 8); } - if ((csCurFrame > 810) && (this->tlozAlpha < 200)) { - this->tlozAlpha += 15; + if ((csCurFrame > FRAMERATE_CONST(810, 675)) && (this->tlozAlpha < 200)) { + this->tlozAlpha += FRAMERATE_CONST(15, 18); } - if ((csCurFrame > 850) && (this->ootAlpha < 200)) { - this->ootAlpha += 15; + if ((csCurFrame > FRAMERATE_CONST(850, 710)) && (this->ootAlpha < 200)) { + this->ootAlpha += FRAMERATE_CONST(15, 18); } OVERLAY_DISP = Gfx_SetupDL_64(OVERLAY_DISP); @@ -139,7 +140,7 @@ void EndTitle_DrawNintendoLogo(Actor* thisx, PlayState* play) { s32 pad; s32 csCurFrame = play->csCtx.curFrame; - if ((csCurFrame >= 1101) && (this->endAlpha < 255)) { + if ((csCurFrame > FRAMERATE_CONST(1100, 950)) && (this->endAlpha < 255)) { this->endAlpha += 3; } diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 24825379f0..c55b296791 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -8,11 +8,35 @@ #include "overlays/actors/ovl_En_Kanban/z_en_kanban.h" #include "assets/objects/object_fish/object_fish.h" +#include "libc64/math64.h" +#include "attributes.h" +#include "controller.h" +#include "gfx.h" +#include "gfx_setupdl.h" #include "ichain.h" +#include "letterbox.h" +#include "rand.h" +#include "regs.h" +#include "rumble.h" +#include "segmented_address.h" +#include "seqcmd.h" +#include "sequence.h" +#include "sfx.h" +#include "sys_math.h" +#include "sys_matrix.h" #include "terminal.h" +#include "versions.h" +#include "z64audio.h" +#include "z64play.h" +#include "z64player.h" +#include "z64skin_matrix.h" +#include "z_lib.h" +#if PLATFORM_N64 +#include "cic6105.h" +#endif -// For retail BSS ordering, the block number of sStreamSfxProjectedPos must be 0. -#pragma increment_block_number 208 +#pragma increment_block_number "gc-eu:180 gc-eu-mq:180 gc-jp:180 gc-jp-ce:180 gc-jp-mq:180 gc-us:180 gc-us-mq:180" \ + "ntsc-1.2:128 pal-1.0:128 pal-1.1:128" #define FLAGS ACTOR_FLAG_4 @@ -31,14 +55,14 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2); void Fishing_DrawFish(Actor* thisx, PlayState* play); void Fishing_DrawOwner(Actor* thisx, PlayState* play); -typedef struct { +typedef struct FishingFishInit { /* 0x00 */ u8 isLoach; /* 0x02 */ Vec3s pos; /* 0x08 */ u8 baseLength; /* 0x0C */ f32 perception; } FishingFishInit; // size = 0x10 -typedef enum { +typedef enum FishingEffectType { /* 0x00 */ FS_EFF_NONE, /* 0x01 */ FS_EFF_RIPPLE, /* 0x02 */ FS_EFF_DUST_SPLASH, @@ -52,7 +76,7 @@ typedef enum { #define FISHING_EFFECT_COUNT 130 -typedef struct { +typedef struct FishingEffect { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f vel; /* 0x18 */ Vec3f accel; @@ -68,7 +92,7 @@ typedef struct { #define POND_PROP_COUNT 140 -typedef enum { +typedef enum FishingPropType { /* 0x00 */ FS_PROP_NONE, /* 0x01 */ FS_PROP_REED, /* 0x02 */ FS_PROP_LILY_PAD, @@ -77,12 +101,12 @@ typedef enum { /* 0x23 */ FS_PROP_INIT_STOP = 0x23 } FishingPropType; -typedef struct { +typedef struct FishingPropInit { /* 0x00 */ u8 type; /* 0x02 */ Vec3s pos; } FishingPropInit; // size = 0x08 -typedef struct { +typedef struct FishingProp { /* 0x00 */ Vec3f pos; /* 0x0C */ f32 rotX; /* 0x10 */ f32 rotY; @@ -97,14 +121,14 @@ typedef struct { /* 0x38 */ f32 drawDistance; } FishingProp; // size = 0x3C -typedef enum { +typedef enum FishingGroupFishType { /* 0x00 */ FS_GROUP_FISH_NONE, /* 0x01 */ FS_GROUP_FISH_NORMAL } FishingGroupFishType; #define GROUP_FISH_COUNT 60 -typedef struct { +typedef struct FishingGroupFish { /* 0x00 */ u8 type; /* 0x02 */ s16 timer; /* 0x04 */ Vec3f pos; @@ -122,7 +146,7 @@ typedef struct { /* 0x44 */ u8 shouldDraw; } FishingGroupFish; // size = 0x48 -typedef enum { +typedef enum FishingLureTypes { /* 0x00 */ FS_LURE_STOCK, /* 0x01 */ FS_LURE_UNK, // hinted at with an "== 1" /* 0x02 */ FS_LURE_SINKING @@ -131,7 +155,7 @@ typedef enum { #define LINE_SEG_COUNT 200 #define SINKING_LURE_SEG_COUNT 20 -ActorInit Fishing_InitVars = { +ActorProfile Fishing_Profile = { /**/ ACTOR_FISHING, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -167,7 +191,7 @@ static s32 sFishingTimePlayed = 0; static s16 sOwnerTheftTimer = 0; -typedef enum { +typedef enum FishingOwnerHair { /* 0x00 */ FS_OWNER_BALD, /* 0x01 */ FS_OWNER_CAPPED, /* 0x02 */ FS_OWNER_HAIR @@ -201,7 +225,7 @@ static u8 sSinkingLureFound = false; static ColliderJntSphElementInit sJntSphElementsInit[12] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -212,7 +236,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -223,7 +247,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -234,7 +258,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -245,7 +269,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -256,7 +280,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -267,7 +291,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -278,7 +302,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -289,7 +313,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -300,7 +324,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -311,7 +335,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -322,7 +346,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -335,7 +359,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[12] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_TYPE_ENEMY, AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -375,7 +399,7 @@ static s16 sFishingPlayingState; static s16 sLureTimer; // AND'd for various effects/checks static s16 D_80B7E0B0; static s16 D_80B7E0B2; -static s16 sRodCastTimer; // used for the inital line casting +static s16 sRodCastTimer; // used for the initial line casting static u8 sLureEquipped; static Vec3f sLurePos; static Vec3f sLureDrawPos; @@ -827,8 +851,8 @@ static FishingFishInit sFishInits[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_5, ICHAIN_CONTINUE), + ICHAIN_F32(lockOnArrowOffset, 0, ICHAIN_STOP), }; void Fishing_Init(Actor* thisx, PlayState* play2) { @@ -853,7 +877,14 @@ void Fishing_Init(Actor* thisx, PlayState* play2) { if (thisx->params < EN_FISH_PARAM) { FishingGroupFish* fish; +#if PLATFORM_N64 + // Anti-piracy check, if the check fails the line can't be reeled in if + // a fish is caught and the fish will always let go after 50 frames. + sReelLock = !(B_80008EE0 == 0xAD090010); +#else sReelLock = 0; +#endif + sFishingMain = this; Collider_InitJntSph(play, &sFishingMain->collider); Collider_SetJntSph(play, &sFishingMain->collider, thisx, &sJntSphInit, sFishingMain->colliderElements); @@ -875,7 +906,7 @@ void Fishing_Init(Actor* thisx, PlayState* play2) { thisx->focus.pos = thisx->world.pos; thisx->focus.pos.y += 75.0f; - thisx->flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + thisx->flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; if (sLinkAge != LINK_AGE_CHILD) { if (HIGH_SCORE(HS_FISHING) & HS_FISH_STOLE_HAT) { @@ -911,10 +942,10 @@ void Fishing_Init(Actor* thisx, PlayState* play2) { sFishGameNumber = (HIGH_SCORE(HS_FISHING) & (HS_FISH_PLAYED * 255)) >> 0x10; if ((sFishGameNumber & 7) == 7) { - play->roomCtx.unk_74[0] = 90; + play->roomCtx.drawParams[0] = 90; sFishingFoggy = 1; } else { - play->roomCtx.unk_74[0] = 40; + play->roomCtx.drawParams[0] = 40; sFishingFoggy = 0; } @@ -1020,8 +1051,8 @@ void Fishing_Init(Actor* thisx, PlayState* play2) { if (thisx->params == EN_FISH_AQUARIUM) { this->fishState = 100; Actor_ChangeCategory(play, &play->actorCtx, thisx, ACTORCAT_PROP); - thisx->targetMode = 0; - thisx->flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; + thisx->attentionRangeType = ATTENTION_RANGE_0; + thisx->flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); } else { this->fishState = 10; @@ -1236,8 +1267,7 @@ void Fishing_DrawEffects(FishingEffect* effect, PlayState* play) { Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_Scale(effect->scale, 1.0f, effect->scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 2305), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fishing.c", 2305); gSPDisplayList(POLY_XLU_DISP++, gFishingRippleModelDL); } @@ -1260,8 +1290,7 @@ void Fishing_DrawEffects(FishingEffect* effect, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 2346), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fishing.c", 2346); gSPDisplayList(POLY_XLU_DISP++, gFishingDustSplashModelDL); } @@ -1288,8 +1317,7 @@ void Fishing_DrawEffects(FishingEffect* effect, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 2394), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_fishing.c", 2394); gSPDisplayList(POLY_OPA_DISP++, gFishingWaterDustModelDL); } @@ -1311,8 +1339,7 @@ void Fishing_DrawEffects(FishingEffect* effect, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 2423), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fishing.c", 2423); gSPDisplayList(POLY_XLU_DISP++, gFishingBubbleModelDL); } @@ -1336,8 +1363,7 @@ void Fishing_DrawEffects(FishingEffect* effect, PlayState* play) { Matrix_RotateZ(effect->rot.z, MTXMODE_APPLY); Matrix_Scale(0.002f, 1.0f, 0.1f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 2467), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fishing.c", 2467); gSPDisplayList(POLY_XLU_DISP++, gFishingRainDropModelDL); } @@ -1360,8 +1386,7 @@ void Fishing_DrawEffects(FishingEffect* effect, PlayState* play) { Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_Scale(effect->scale, 1.0f, effect->scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 2504), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fishing.c", 2504); gSPDisplayList(POLY_XLU_DISP++, gFishingRippleModelDL); } @@ -1389,8 +1414,7 @@ void Fishing_DrawEffects(FishingEffect* effect, PlayState* play) { Matrix_RotateY(rotY, MTXMODE_APPLY); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 2541), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fishing.c", 2541); gSPDisplayList(POLY_XLU_DISP++, gFishingRainSplashModelDL); } @@ -1406,8 +1430,7 @@ void Fishing_DrawEffects(FishingEffect* effect, PlayState* play) { Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY); Matrix_Translate(-1250.0f, 0.0f, 0.0f, MTXMODE_APPLY); Matrix_RotateX(M_PI / 2, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 2560), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_fishing.c", 2560); gSPDisplayList(POLY_OPA_DISP++, gFishingOwnerHatDL); } @@ -1431,8 +1454,7 @@ void Fishing_DrawStreamSplash(PlayState* play) { Matrix_Translate(670.0f, -24.0f, -600.0f, MTXMODE_NEW); Matrix_Scale(0.02f, 1.0f, 0.02f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 2598), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fishing.c", 2598); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gFishingStreamSplashDL)); CLOSE_DISPS(play->state.gfxCtx, "../z_fishing.c", 2613); @@ -1662,14 +1684,12 @@ void Fishing_DrawLureHook(PlayState* play, Vec3f* pos, Vec3f* refPos, u8 hookInd Matrix_Scale(0.0039999997f, 0.0039999997f, 0.005f, MTXMODE_APPLY); Matrix_RotateY(M_PI, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 3029), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_fishing.c", 3029); gSPDisplayList(POLY_OPA_DISP++, gFishingLureHookDL); Matrix_RotateZ(M_PI / 2, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 3034), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_fishing.c", 3034); gSPDisplayList(POLY_OPA_DISP++, gFishingLureHookDL); if ((hookIndex == 1) && (sIsOwnersHatHooked)) { @@ -1698,8 +1718,7 @@ void Fishing_DrawLureHook(PlayState* play, Vec3f* pos, Vec3f* refPos, u8 hookInd Matrix_Translate(-1250.0f, 0.0f, 0.0f, MTXMODE_APPLY); Matrix_RotateX(M_PI / 2, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 3085), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_fishing.c", 3085); gSPDisplayList(POLY_OPA_DISP++, gFishingOwnerHatDL); } @@ -1799,8 +1818,7 @@ void Fishing_DrawSinkingLure(PlayState* play) { Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 3239), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_fishing.c", 3239); gSPDisplayList(POLY_OPA_DISP++, gFishingSinkingLureSegmentModelDL); } } @@ -1816,8 +1834,7 @@ void Fishing_DrawSinkingLure(PlayState* play) { Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 3265), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fishing.c", 3265); gSPDisplayList(POLY_XLU_DISP++, gFishingSinkingLureSegmentModelDL); } } @@ -1881,8 +1898,7 @@ void Fishing_DrawLureAndLine(PlayState* play, Vec3f* linePos, Vec3f* lineRot) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 3369), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_fishing.c", 3369); gSPDisplayList(POLY_OPA_DISP++, gFishingLureFloatDL); posSrc.x = -850.0f; @@ -1929,8 +1945,7 @@ void Fishing_DrawLureAndLine(PlayState* play, Vec3f* linePos, Vec3f* lineRot) { Matrix_RotateX(rx, MTXMODE_APPLY); Matrix_Scale(sFishingLineScale, 1.0f, dist, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 3444), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fishing.c", 3444); gSPDisplayList(POLY_XLU_DISP++, gFishingLineModelDL); } else { for (i = spooled; i < LINE_SEG_COUNT - 1; i++) { @@ -1957,8 +1972,7 @@ void Fishing_DrawLureAndLine(PlayState* play, Vec3f* linePos, Vec3f* lineRot) { Matrix_RotateX(rx, MTXMODE_APPLY); Matrix_Scale(sFishingLineScale, 1.0f, dist, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 3475), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fishing.c", 3475); gSPDisplayList(POLY_XLU_DISP++, gFishingLineModelDL); break; } @@ -1968,8 +1982,7 @@ void Fishing_DrawLureAndLine(PlayState* play, Vec3f* linePos, Vec3f* lineRot) { Matrix_RotateX((lineRot + i)->x, MTXMODE_APPLY); Matrix_Scale(sFishingLineScale, 1.0f, 0.005f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 3492), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fishing.c", 3492); gSPDisplayList(POLY_XLU_DISP++, gFishingLineModelDL); } } @@ -2106,8 +2119,7 @@ void Fishing_DrawRod(PlayState* play) { Matrix_Push(); Matrix_Scale(sRodScales[i], sRodScales[i], 0.52f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 3809), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_fishing.c", 3809); if (i < 5) { gDPLoadTextureBlock(POLY_OPA_DISP++, gFishingRodSegmentBlackTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 8, 0, @@ -2898,7 +2910,7 @@ void Fishing_HandleAquariumDialog(Fishing* this, PlayState* play) { if (!this->isAquariumMessage) { if (this->aquariumWaitTimer == 0) { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; if (Actor_TalkOfferAccepted(&this->actor, play)) { sFishLengthToWeigh = sFishingRecordLength; @@ -2908,7 +2920,7 @@ void Fishing_HandleAquariumDialog(Fishing* this, PlayState* play) { } } else { this->aquariumWaitTimer--; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } } else if (Actor_TextboxIsClosing(&this->actor, play)) { this->isAquariumMessage = false; @@ -2961,9 +2973,9 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { if ((D_80B7E0B0 != 0) || (sSubCamId != SUB_CAM_ID_DONE) || ((player->actor.world.pos.z > 1150.0f) && (this->fishState != 100))) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else { - this->actor.flags |= ACTOR_FLAG_0; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; if (sRodCastState != 0) { if (D_80B7E0B2 == 0) { this->actor.focus.pos = sLurePos; @@ -3185,7 +3197,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { if (sLureEquipped == FS_LURE_SINKING) { func_80B70ED4(this, input); } else { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } break; @@ -3222,7 +3234,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { if (sLureEquipped == FS_LURE_SINKING) { func_80B70ED4(this, input); } else { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } } break; @@ -3268,7 +3280,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { this->fishTargetPos.z = Rand_ZeroFloat(50.0f); } - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; break; case -2: @@ -3306,7 +3318,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { } Math_ApproachF(&this->rotationStep, 2048.0f, 1.0f, 128.0f); - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } break; @@ -4475,8 +4487,7 @@ void Fishing_DrawPondProps(PlayState* play) { Matrix_RotateX(prop->rotX, MTXMODE_APPLY); Matrix_RotateY(prop->reedAngle, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 7726), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fishing.c", 7726); gSPDisplayList(POLY_XLU_DISP++, gFishingReedModelDL); } } @@ -4497,8 +4508,7 @@ void Fishing_DrawPondProps(PlayState* play) { Matrix_Translate(prop->pos.x, prop->pos.y, prop->pos.z, MTXMODE_NEW); Matrix_Scale(prop->scale, prop->scale, prop->scale, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 7748), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_fishing.c", 7748); gSPDisplayList(POLY_OPA_DISP++, gFishingWoodPostModelDL); } } @@ -4522,8 +4532,7 @@ void Fishing_DrawPondProps(PlayState* play) { Matrix_Translate(0.0f, 0.0f, 20.0f, MTXMODE_APPLY); Matrix_RotateY(prop->rotY, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 7774), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fishing.c", 7774); gSPDisplayList(POLY_XLU_DISP++, gFishingLilyPadModelDL); } } @@ -4545,8 +4554,7 @@ void Fishing_DrawPondProps(PlayState* play) { Matrix_Scale(prop->scale, prop->scale, prop->scale, MTXMODE_APPLY); Matrix_RotateY(prop->rotY, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 7798), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_fishing.c", 7798); gSPDisplayList(POLY_OPA_DISP++, gFishingRockModelDL); } } @@ -4556,8 +4564,6 @@ void Fishing_DrawPondProps(PlayState* play) { Matrix_Pop(); - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_fishing.c", 7805); } @@ -4763,25 +4769,22 @@ void Fishing_DrawGroupFishes(PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_fishing.c", 8048); for (i = 0; i < GROUP_FISH_COUNT; i++, fish++) { - if (fish->type == FS_GROUP_FISH_NONE) { - continue; - } - - if (!materialFlag) { - gSPDisplayList(POLY_OPA_DISP++, gFishingGroupFishMaterialDL); - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 155, 255); - materialFlag++; - } + if (fish->type != FS_GROUP_FISH_NONE) { + if (!materialFlag) { + gSPDisplayList(POLY_OPA_DISP++, gFishingGroupFishMaterialDL); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 155, 255); + materialFlag++; + } - if (fish->shouldDraw) { - Matrix_Translate(fish->pos.x, fish->pos.y, fish->pos.z, MTXMODE_NEW); - Matrix_RotateY(BINANG_TO_RAD_ALT2((f32)fish->unk_3E), MTXMODE_APPLY); - Matrix_RotateX(BINANG_TO_RAD_ALT2(-(f32)fish->unk_3C), MTXMODE_APPLY); - Matrix_Scale(fish->scaleX * scale, scale, scale, MTXMODE_APPLY); + if (fish->shouldDraw) { + Matrix_Translate(fish->pos.x, fish->pos.y, fish->pos.z, MTXMODE_NEW); + Matrix_RotateY(BINANG_TO_RAD_ALT2((f32)fish->unk_3E), MTXMODE_APPLY); + Matrix_RotateX(BINANG_TO_RAD_ALT2(-(f32)fish->unk_3C), MTXMODE_APPLY); + Matrix_Scale(fish->scaleX * scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 8093), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, gFishingGroupFishModelDL); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_fishing.c", 8093); + gSPDisplayList(POLY_OPA_DISP++, gFishingGroupFishModelDL); + } } } @@ -5190,9 +5193,9 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { SkelAnime_Update(&this->skelAnime); if ((sOwnerTheftTimer != 0) || (Message_GetState(&play->msgCtx) != TEXT_STATE_NONE)) { - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } else { - this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_5; + this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_5; } if ((this->actor.xzDistToPlayer < 120.0f) || (Message_GetState(&play->msgCtx) != TEXT_STATE_NONE)) { @@ -5759,8 +5762,18 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &sStreamSfxPos, &sStreamSfxProjectedPos, &sProjectedW); Sfx_PlaySfxAtPos(&sStreamSfxProjectedPos, NA_SE_EV_WATER_WALL - SFX_FLAG); - // convert length to weight. Theoretical max of 59 lbs (127^2*.0036+.5) + +#if OOT_NTSC + if (gSaveContext.language == LANGUAGE_JPN) { + gSaveContext.minigameScore = sFishLengthToWeigh; + } else { + // Convert length to weight. Theoretical max of 59 lbs (127^2*.0036+.5) + gSaveContext.minigameScore = (SQ((f32)sFishLengthToWeigh) * 0.0036f) + 0.5f; + } +#else + // Same as above, but for PAL gSaveContext.minigameScore = (SQ((f32)sFishLengthToWeigh) * 0.0036f) + 0.5f; +#endif #if IS_DEBUG if (BREG(26) != 0) { @@ -5813,8 +5826,7 @@ void Fishing_DrawOwner(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - if ((this->actor.projectedPos.z < 1500.0f) && - (fabsf(this->actor.projectedPos.x) < (100.0f + this->actor.projectedPos.z))) { + if ((thisx->projectedPos.z < 1500.0f) && (fabsf(thisx->projectedPos.x) < (100.0f + thisx->projectedPos.z))) { gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sFishingOwnerEyeTexs[this->unk_160])); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, @@ -5859,10 +5871,8 @@ void Fishing_DrawOwner(Actor* thisx, PlayState* play) { Matrix_Translate(130.0f, 40.0f, 1300.0f, MTXMODE_NEW); Matrix_Scale(0.08f, 0.12f, 0.14f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 9297), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fishing.c", 9298), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_fishing.c", 9297); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_fishing.c", 9298); gSPDisplayList(POLY_OPA_DISP++, gFishingAquariumBottomDL); gSPDisplayList(POLY_XLU_DISP++, gFishingAquariumContainerDL); diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c index f6d21ef419..bd581b2aa1 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c @@ -16,7 +16,7 @@ void ItemBHeart_Draw(Actor* thisx, PlayState* play); void func_80B85264(ItemBHeart* this, PlayState* play); -ActorInit Item_B_Heart_InitVars = { +ActorProfile Item_B_Heart_Profile = { /**/ ACTOR_ITEM_B_HEART, /**/ ACTORCAT_MISC, /**/ FLAGS, @@ -94,14 +94,12 @@ void ItemBHeart_Draw(Actor* thisx, PlayState* play) { if (flag) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_item_b_heart.c", 551), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_item_b_heart.c", 551); gSPDisplayList(POLY_XLU_DISP++, gGiHeartBorderDL); gSPDisplayList(POLY_XLU_DISP++, gGiHeartContainerDL); } else { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_item_b_heart.c", 557), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_item_b_heart.c", 557); gSPDisplayList(POLY_OPA_DISP++, gGiHeartBorderDL); gSPDisplayList(POLY_OPA_DISP++, gGiHeartContainerDL); } diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index a1d99a01af..83f282da0d 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -22,7 +22,7 @@ void ItemEtcetera_MoveFireArrowDown(ItemEtcetera* this, PlayState* play); void func_80B85B28(ItemEtcetera* this, PlayState* play); void ItemEtcetera_UpdateFireArrow(ItemEtcetera* this, PlayState* play); -ActorInit Item_Etcetera_InitVars = { +ActorProfile Item_Etcetera_Profile = { /**/ ACTOR_ITEM_ETCETERA, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -96,7 +96,7 @@ void ItemEtcetera_Init(Actor* thisx, PlayState* play) { s32 type; s32 objectSlot; - type = this->actor.params & 0xFF; + type = PARAMS_GET_U(this->actor.params, 0, 8); PRINTF("no = %d\n", type); objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[type]); PRINTF("bank_ID = %d\n", objectSlot); @@ -152,7 +152,7 @@ void ItemEtcetera_WaitForObject(ItemEtcetera* this, PlayState* play) { void func_80B85824(ItemEtcetera* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - if ((this->actor.params & 0xFF) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 8) == 1) { SET_EVENTCHKINF(EVENTCHKINF_31); Flags_SetSwitch(play, 0xB); } @@ -164,7 +164,7 @@ void func_80B85824(ItemEtcetera* this, PlayState* play) { void func_80B858B4(ItemEtcetera* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - if ((this->actor.params & 0xFF) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 8) == 1) { SET_EVENTCHKINF(EVENTCHKINF_31); Flags_SetSwitch(play, 0xB); } @@ -206,7 +206,7 @@ void ItemEtcetera_MoveFireArrowDown(ItemEtcetera* this, PlayState* play) { } void func_80B85B28(ItemEtcetera* this, PlayState* play) { - if (Flags_GetTreasure(play, (this->actor.params >> 8) & 0x1F)) { + if (Flags_GetTreasure(play, PARAMS_GET_U(this->actor.params, 8, 5))) { Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h index a77192c797..c5054884bd 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h @@ -18,7 +18,7 @@ typedef struct ItemEtcetera { /* 0x015C */ ItemEtceteraActionFunc actionFunc; } ItemEtcetera; // size = 0x0160 -typedef enum { +typedef enum ItemEtceteraType { /* 0x00 */ ITEM_ETC_BOTTLE, /* 0x01 */ ITEM_ETC_LETTER, /* 0x02 */ ITEM_ETC_SHIELD_HYLIAN, diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c index 3935fa1ea8..e1b21b2a85 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c @@ -6,7 +6,7 @@ #include "z_item_inbox.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void ItemInbox_Init(Actor* thisx, PlayState* play); void ItemInbox_Destroy(Actor* thisx, PlayState* play); @@ -15,7 +15,7 @@ void ItemInbox_Draw(Actor* thisx, PlayState* play); void ItemInbox_Wait(ItemInbox* this, PlayState* play); -ActorInit Item_Inbox_InitVars = { +ActorProfile Item_Inbox_Profile = { /**/ ACTOR_ITEM_INBOX, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -38,7 +38,7 @@ void ItemInbox_Destroy(Actor* thisx, PlayState* play) { } void ItemInbox_Wait(ItemInbox* this, PlayState* play) { - if (Flags_GetTreasure(play, (this->actor.params >> 8) & 0x1F)) { + if (Flags_GetTreasure(play, PARAMS_GET_U(this->actor.params, 8, 5))) { Actor_Kill(&this->actor); } } @@ -54,5 +54,5 @@ void ItemInbox_Draw(Actor* thisx, PlayState* play) { func_8002EBCC(&this->actor, play, 0); func_8002ED80(&this->actor, play, 0); - GetItem_Draw(play, this->actor.params & 0xFF); + GetItem_Draw(play, PARAMS_GET_U(this->actor.params, 0, 8)); } diff --git a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index c7394227eb..00d7eab43e 100644 --- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -22,7 +22,7 @@ void func_80B864EC(ItemOcarina* this, PlayState* play); void func_80B865E0(ItemOcarina* this, PlayState* play); void ItemOcarina_DoNothing(ItemOcarina* this, PlayState* play); -ActorInit Item_Ocarina_InitVars = { +ActorProfile Item_Ocarina_Profile = { /**/ ACTOR_ITEM_OCARINA, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c index cf51ce3d28..22c18b7713 100644 --- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c +++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c @@ -20,7 +20,7 @@ void func_80B86BC8(ItemShield* this, PlayState* play); static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -28,7 +28,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000004, 0x00, 0x00 }, ATELEM_NONE, @@ -38,7 +38,7 @@ static ColliderCylinderInit sCylinderInit = { { 15, 15, 0, { 0, 0, 0 } }, }; -ActorInit Item_Shield_InitVars = { +ActorProfile Item_Shield_Profile = { /**/ ACTOR_ITEM_SHIELD, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -223,8 +223,7 @@ void ItemShield_Draw(Actor* thisx, PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x0C, gCullBackDList); } Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_item_shield.c", 460), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_item_shield.c", 460); gSPDisplayList(POLY_OPA_DISP++, SEGMENTED_TO_VIRTUAL(gLinkChildDekuShieldDL)); CLOSE_DISPS(play->state.gfxCtx, "../z_item_shield.c", 465); } diff --git a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c index 2d3053bfc0..6049a19a27 100644 --- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c +++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c @@ -18,7 +18,7 @@ void MagicDark_DiamondDraw(Actor* thisx, PlayState* play); void MagicDark_DimLighting(PlayState* play, f32 intensity); -ActorInit Magic_Dark_InitVars = { +ActorProfile Magic_Dark_Profile = { /**/ ACTOR_MAGIC_DARK, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -133,9 +133,9 @@ void MagicDark_DiamondUpdate(Actor* thisx, PlayState* play) { gSaveContext.nayrusLoveTimer = nayrusLoveTimer + 1; if (nayrusLoveTimer < 1100) { - func_8002F974(thisx, NA_SE_PL_MAGIC_SOUL_NORMAL - SFX_FLAG); + Actor_PlaySfx_Flagged(thisx, NA_SE_PL_MAGIC_SOUL_NORMAL - SFX_FLAG); } else { - func_8002F974(thisx, NA_SE_PL_MAGIC_SOUL_FLASH - SFX_FLAG); + Actor_PlaySfx_Flagged(thisx, NA_SE_PL_MAGIC_SOUL_FLASH - SFX_FLAG); } } @@ -144,7 +144,7 @@ void MagicDark_DimLighting(PlayState* play, f32 intensity) { f32 colorScale; f32 fogScale; - if (play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_5) { + if (play->roomCtx.curRoom.type != ROOM_TYPE_BOSS) { intensity = CLAMP_MIN(intensity, 0.0f); intensity = CLAMP_MAX(intensity, 1.0f); fogScale = intensity - 0.2f; @@ -178,7 +178,7 @@ void MagicDark_OrbUpdate(Actor* thisx, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); - func_8002F974(&this->actor, NA_SE_PL_MAGIC_SOUL_BALL - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_PL_MAGIC_SOUL_BALL - SFX_FLAG); if (this->timer < 35) { MagicDark_DimLighting(play, this->timer * (1 / 45.0f)); Math_SmoothStepToF(&thisx->scale.x, this->scale * (1 / 12.000001f), 0.05f, 0.01f, 0.0001f); @@ -225,8 +225,7 @@ void MagicDark_DiamondDraw(Actor* thisx, PlayState* play) { Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); Matrix_RotateY(BINANG_TO_RAD(this->actor.shape.rot.y), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_magic_dark.c", 553), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_magic_dark.c", 553); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 170, 255, 255, (s32)(this->primAlpha * 0.6f) & 0xFF); gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, 128); gSPDisplayList(POLY_XLU_DISP++, sDiamondMaterialDL); @@ -240,10 +239,10 @@ void MagicDark_DiamondDraw(Actor* thisx, PlayState* play) { } void MagicDark_OrbDraw(Actor* thisx, PlayState* play) { - MagicDark* this = (MagicDark*)thisx; + PlayState* play2 = (PlayState*)play; Vec3f pos; - Player* player = GET_PLAYER(play); - s32 pad; + Player* player = GET_PLAYER(play2); + MagicDark* this = (MagicDark*)thisx; f32 sp6C = play->state.frames & 0x1F; if (this->timer < 32) { @@ -263,11 +262,11 @@ void MagicDark_OrbDraw(Actor* thisx, PlayState* play) { return; } - pos.x -= (this->actor.scale.x * 300.0f * Math_SinS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play))) * - Math_CosS(Camera_GetCamDirPitch(GET_ACTIVE_CAM(play)))); - pos.y -= (this->actor.scale.x * 300.0f * Math_SinS(Camera_GetCamDirPitch(GET_ACTIVE_CAM(play)))); - pos.z -= (this->actor.scale.x * 300.0f * Math_CosS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play))) * - Math_CosS(Camera_GetCamDirPitch(GET_ACTIVE_CAM(play)))); + pos.x -= (this->actor.scale.x * 300.0f * Math_SinS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play2))) * + Math_CosS(Camera_GetCamDirPitch(GET_ACTIVE_CAM(play2)))); + pos.y -= (this->actor.scale.x * 300.0f * Math_SinS(Camera_GetCamDirPitch(GET_ACTIVE_CAM(play2)))); + pos.z -= (this->actor.scale.x * 300.0f * Math_CosS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play2))) * + Math_CosS(Camera_GetCamDirPitch(GET_ACTIVE_CAM(play2)))); OPEN_DISPS(play->state.gfxCtx, "../z_magic_dark.c", 619); @@ -276,16 +275,14 @@ void MagicDark_OrbDraw(Actor* thisx, PlayState* play) { gDPSetEnvColor(POLY_XLU_DISP++, 0, 150, 255, 255); Matrix_Translate(pos.x, pos.y, pos.z, MTXMODE_NEW); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); + Matrix_Mult(&play2->billboardMtxF, MTXMODE_APPLY); Matrix_Push(); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_magic_dark.c", 632), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_magic_dark.c", 632); Matrix_RotateZ(sp6C * (M_PI / 32), MTXMODE_APPLY); gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL); Matrix_Pop(); Matrix_RotateZ(-sp6C * (M_PI / 32), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_magic_dark.c", 639), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_magic_dark.c", 639); gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL); CLOSE_DISPS(play->state.gfxCtx, "../z_magic_dark.c", 643); diff --git a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c index e861cc84e0..3895bac8be 100644 --- a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c +++ b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c @@ -15,14 +15,14 @@ void MagicFire_Draw(Actor* thisx, PlayState* play); void MagicFire_UpdateBeforeCast(Actor* thisx, PlayState* play); -typedef enum { +typedef enum MagicFireAction { /* 0x00 */ DF_ACTION_INITIALIZE, /* 0x01 */ DF_ACTION_EXPAND_SLOWLY, /* 0x02 */ DF_ACTION_STOP_EXPANDING, /* 0x03 */ DF_ACTION_EXPAND_QUICKLY } MagicFireAction; -typedef enum { +typedef enum MagicFireScreenTint { /* 0x00 */ DF_SCREEN_TINT_NONE, /* 0x01 */ DF_SCREEN_TINT_FADE_IN, /* 0x02 */ DF_SCREEN_TINT_MAINTAIN, @@ -30,7 +30,7 @@ typedef enum { /* 0x04 */ DF_SCREEN_TINT_FINISHED } MagicFireScreenTint; -ActorInit Magic_Fire_InitVars = { +ActorProfile Magic_Fire_Profile = { /**/ ACTOR_MAGIC_FIRE, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -46,7 +46,7 @@ ActorInit Magic_Fire_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_PLAYER, AC_NONE, OC1_NONE, @@ -54,7 +54,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00020000, 0x00, 0x01 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -237,8 +237,7 @@ void MagicFire_Draw(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, 255, 200, 0, (u8)(this->alphaMultiplier * 255)); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, (u8)(this->alphaMultiplier * 255)); Matrix_Scale(0.15f, 0.15f, 0.15f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_magic_fire.c", 715), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_magic_fire.c", 715); gDPPipeSync(POLY_XLU_DISP++); gSPTexture(POLY_XLU_DISP++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gDPSetTextureLUT(POLY_XLU_DISP++, G_TT_NONE); diff --git a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c index 38458db6b9..f8a9e829e2 100644 --- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c +++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c @@ -19,7 +19,7 @@ void MagicWind_FadeOut(MagicWind* this, PlayState* play); void MagicWind_WaitAtFullSize(MagicWind* this, PlayState* play); void MagicWind_Grow(MagicWind* this, PlayState* play); -ActorInit Magic_Wind_InitVars = { +ActorProfile Magic_Wind_Profile = { /**/ ACTOR_MAGIC_WIND, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index 8c200e3dac..4bb8ce0cf6 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -17,7 +17,7 @@ void MirRay_Draw(Actor* thisx, PlayState* play); s32 MirRay_CheckInFrustum(Vec3f* vecA, Vec3f* vecB, f32 pointx, f32 pointy, f32 pointz, s16 radiusA, s16 radiusB); // Locations of light beams in sMirRayData -typedef enum { +typedef enum MirRayBeamLocations { /* 0 */ MIRRAY_SPIRIT_BOMBCHUIWAROOM_DOWNLIGHT, /* 1 */ MIRRAY_SPIRIT_SUNBLOCKROOM_DOWNLIGHT, /* 2 */ MIRRAY_SPIRIT_SINGLECOBRAROOM_DOWNLIGHT, @@ -30,7 +30,7 @@ typedef enum { /* 9 */ MIRRAY_GANONSCASTLE_SPIRITTRIAL_DOWNLIGHT } MirRayBeamLocations; -ActorInit Mir_Ray_InitVars = { +ActorProfile Mir_Ray_Profile = { /**/ ACTOR_MIR_RAY, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -46,7 +46,7 @@ static u8 D_80B8E670 = 0; static ColliderQuadInit sQuadInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_PLAYER, AC_NONE, OC1_NONE, @@ -54,7 +54,7 @@ static ColliderQuadInit sQuadInit = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00200000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -67,7 +67,7 @@ static ColliderQuadInit sQuadInit = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00200000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -80,7 +80,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_PLAYER, AC_NONE, OC1_NONE, @@ -136,7 +136,7 @@ void MirRay_MakeShieldLight(MirRay* this, PlayState* play) { player->actor.world.pos.y + 30.0f, player->actor.world.pos.z, this->sourceEndRad, this->poolEndRad)) { - if (dataEntry->params & 8) { // Light beams from mirrors + if (PARAMS_GET_NOSHIFT(dataEntry->params, 3, 1)) { // Light beams from mirrors Math_Vec3f_Diff(&player->actor.world.pos, &this->sourcePt, &reflectionPt); } else { // Light beams from windows Math_Vec3f_Diff(&this->poolPt, &this->sourcePt, &reflectionPt); @@ -207,10 +207,10 @@ void MirRay_Init(Actor* thisx, PlayState* play) { this->shieldCorners[5].x = 758.0f; this->shieldCorners[5].y = -800.0f; - if (dataEntry->params & 2) { + if (PARAMS_GET_NOSHIFT(dataEntry->params, 1, 1)) { Collider_InitJntSph(play, &this->colliderSph); Collider_SetJntSph(play, &this->colliderSph, &this->actor, &sJntSphInit, &this->colliderSphItem); - if (!(dataEntry->params & 4)) { // Beams not from mirrors + if (!PARAMS_GET_NOSHIFT(dataEntry->params, 2, 1)) { // Beams not from mirrors MirRay_SetupCollider(this); } } @@ -256,7 +256,7 @@ void MirRay_Update(Actor* thisx, PlayState* play) { MirRay_MakeShieldLight(this, play); if (this->reflectIntensity > 0.0f) { - func_8002F8F0(&player->actor, NA_SE_IT_SHIELD_BEAM - SFX_FLAG); + Actor_PlaySfx_Flagged2(&player->actor, NA_SE_IT_SHIELD_BEAM - SFX_FLAG); } } } @@ -472,7 +472,7 @@ void MirRay_Draw(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); s32 i; MirRayShieldReflection reflection[6]; - s32 temp; + s32 pad; this->reflectIntensity = 0.0f; if ((D_80B8E670 == 0) && !this->unLit && Player_HasMirrorShieldSetToDraw(play)) { @@ -483,9 +483,8 @@ void MirRay_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); Matrix_Scale(1.0f, 1.0f, this->reflectIntensity * 5.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_mir_ray.c", 972), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 150, (s16)(temp = this->reflectIntensity * 100.0f)); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_mir_ray.c", 972); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 150, (s32)(this->reflectIntensity * 100.0f) & 0xFF); gSPDisplayList(POLY_XLU_DISP++, gShieldBeamGlowDL); MirRay_SetupReflectionPolys(this, play, reflection); MirRay_RemoveSimilarReflections(reflection); @@ -506,8 +505,7 @@ void MirRay_Draw(Actor* thisx, PlayState* play) { Matrix_Translate(reflection[i].pos.x, reflection[i].pos.y, reflection[i].pos.z, MTXMODE_NEW); Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY); Matrix_Mult(&reflection[i].mtx, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_mir_ray.c", 1006), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_mir_ray.c", 1006); gDPSetRenderMode(POLY_XLU_DISP++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_DECAL2); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 150, reflection[0].opacity); gSPDisplayList(POLY_XLU_DISP++, gShieldBeamImageDL); diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h index 0f645cb4f8..4e93149075 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h @@ -6,7 +6,7 @@ struct MirRay; -typedef struct { +typedef struct MirRayDataEntry { /* 0x00 */ Vec3s sourcePoint; /* 0x06 */ Vec3s poolPoint; // point at center of light pool on floor for windows and BigMirror, same as source point for Cobra Mirror /* 0x0C */ s16 sourceEndRadius; // Radius of beam frustum at the source end @@ -19,7 +19,7 @@ typedef struct { /* 0x1F */ u8 params; } MirRayDataEntry; // size = 0x20 -typedef struct { +typedef struct MirRayShieldReflection { /* 0x00 */ Vec3f pos; /* 0x0C */ MtxF mtx; /* 0x4C */ CollisionPoly* reflectionPoly; diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index b99e05c11e..ec93a28ad9 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -72,7 +72,7 @@ void ObjBean_WaitForStepOff(ObjBean* this, PlayState* play); static ObjBean* D_80B90E30 = NULL; -ActorInit Obj_Bean_InitVars = { +ActorProfile Obj_Bean_Profile = { /**/ ACTOR_OBJ_BEAN, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -86,7 +86,7 @@ ActorInit Obj_Bean_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_PLAYER, @@ -94,7 +94,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -104,7 +104,7 @@ static ColliderCylinderInit sCylinderInit = { { 64, 30, -31, { 0, 0, 0 } }, }; -typedef struct { +typedef struct BeenSpeedInfo { f32 velocity; f32 accel; } BeenSpeedInfo; @@ -227,13 +227,13 @@ void ObjBean_SetDrawMode(ObjBean* this, u8 drawFlag) { } void ObjBean_SetupPathCount(ObjBean* this, PlayState* play) { - this->pathCount = play->pathList[(this->dyna.actor.params >> 8) & 0x1F].count - 1; + this->pathCount = play->pathList[PARAMS_GET_U(this->dyna.actor.params, 8, 5)].count - 1; this->currentPointIndex = 0; this->nextPointIndex = 1; } void ObjBean_SetupPath(ObjBean* this, PlayState* play) { - Path* path = &play->pathList[(this->dyna.actor.params >> 8) & 0x1F]; + Path* path = &play->pathList[PARAMS_GET_U(this->dyna.actor.params, 8, 5)]; Math_Vec3s_ToVec3f(&this->pathPoints, SEGMENTED_TO_VIRTUAL(path->points)); } @@ -245,7 +245,7 @@ void ObjBean_FollowPath(ObjBean* this, PlayState* play) { Vec3s* nextPathPoint; Math_StepToF(&this->dyna.actor.speed, sBeanSpeeds[this->unk_1F6].velocity, sBeanSpeeds[this->unk_1F6].accel); - path = &play->pathList[(this->dyna.actor.params >> 8) & 0x1F]; + path = &play->pathList[PARAMS_GET_U(this->dyna.actor.params, 8, 5)]; nextPathPoint = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->nextPointIndex]; Math_Vec3s_ToVec3f(&pathPointsFloat, nextPathPoint); @@ -469,8 +469,8 @@ void ObjBean_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); if (LINK_AGE_IN_YEARS == YEARS_ADULT) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) || (IS_DEBUG && mREG(1) == 1)) { - path = (this->dyna.actor.params >> 8) & 0x1F; + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) || (IS_DEBUG && mREG(1) == 1)) { + path = PARAMS_GET_U(this->dyna.actor.params, 8, 5); if (path == 0x1F) { PRINTF(VT_COL(RED, WHITE)); // "No path data?" @@ -504,7 +504,8 @@ void ObjBean_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->dyna.actor); return; } - } else if ((Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) != 0) || (IS_DEBUG && mREG(1) == 1)) { + } else if ((Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) != 0) || + (IS_DEBUG && mREG(1) == 1)) { ObjBean_SetupWaitForWater(this); } else { ObjBean_SetupWaitForBean(this); @@ -538,7 +539,7 @@ void ObjBean_WaitForBean(ObjBean* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->dyna.actor, play)) { if (func_8002F368(play) == EXCH_ITEM_MAGIC_BEAN) { func_80B8FE00(this); - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); } } else { Actor_OfferTalkExchangeEquiCylinder(&this->dyna.actor, play, 40.0f, EXCH_ITEM_MAGIC_BEAN); @@ -579,7 +580,7 @@ void func_80B8FEAC(ObjBean* this, PlayState* play) { } else { this->timer = 1; } - func_8002F974(&this->dyna.actor, NA_SE_PL_PLANT_GROW_UP - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_PL_PLANT_GROW_UP - SFX_FLAG); } void func_80B8FF50(ObjBean* this) { @@ -675,7 +676,7 @@ void ObjBean_GrowWaterPhase2(ObjBean* this, PlayState* play) { if (this->stalkSizeMultiplier >= 0.1f) { // 100 Frames ObjBean_SetupGrowWaterPhase3(this); } - func_8002F974(&this->dyna.actor, NA_SE_PL_PLANT_TALLER - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_PL_PLANT_TALLER - SFX_FLAG); } void ObjBean_SetupGrowWaterPhase3(ObjBean* this) { @@ -784,7 +785,7 @@ void ObjBean_Fly(ObjBean* this, PlayState* play) { } else if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { - func_8002F974(&this->dyna.actor, NA_SE_PL_PLANT_MOVE - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_PL_PLANT_MOVE - SFX_FLAG); if (play->sceneId == SCENE_LOST_WOODS) { Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_LOST_WOODS); diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c index c908d7c3ff..cb7cba62c0 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c @@ -13,7 +13,7 @@ void ObjBlockstop_Init(Actor* thisx, PlayState* play); void ObjBlockstop_Destroy(Actor* thisx, PlayState* play); void ObjBlockstop_Update(Actor* thisx, PlayState* play); -ActorInit Obj_Blockstop_InitVars = { +ActorProfile Obj_Blockstop_Profile = { /**/ ACTOR_OBJ_BLOCKSTOP, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -50,8 +50,8 @@ void ObjBlockstop_Update(Actor* thisx, PlayState* play) { dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId); if (dynaPolyActor != NULL && dynaPolyActor->actor.id == ACTOR_OBJ_OSHIHIKI) { - if ((dynaPolyActor->actor.params & 0x000F) == PUSHBLOCK_HUGE_START_ON || - (dynaPolyActor->actor.params & 0x000F) == PUSHBLOCK_HUGE_START_OFF) { + if (PARAMS_GET_U(dynaPolyActor->actor.params, 0, 4) == PUSHBLOCK_HUGE_START_ON || + PARAMS_GET_U(dynaPolyActor->actor.params, 0, 4) == PUSHBLOCK_HUGE_START_OFF) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } else { Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index dc7cd70d92..bf6a5ebf4f 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -18,7 +18,7 @@ void ObjBombiwa_Draw(Actor* thisx, PlayState* play); void ObjBombiwa_Break(ObjBombiwa* this, PlayState* play); -ActorInit Obj_Bombiwa_InitVars = { +ActorProfile Obj_Bombiwa_Profile = { /**/ ACTOR_OBJ_BOMBIWA, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -32,7 +32,7 @@ ActorInit Obj_Bombiwa_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -40,7 +40,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFFE, 0x00, 0x00 }, ATELEM_NONE, @@ -74,7 +74,7 @@ void ObjBombiwa_InitCollision(Actor* thisx, PlayState* play) { void ObjBombiwa_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); ObjBombiwa_InitCollision(thisx, play); - if ((Flags_GetSwitch(play, thisx->params & 0x3F) != 0)) { + if ((Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6)) != 0)) { Actor_Kill(thisx); } else { CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); @@ -127,9 +127,9 @@ void ObjBombiwa_Update(Actor* thisx, PlayState* play) { if ((func_80033684(play, &this->actor) != NULL) || ((this->collider.base.acFlags & AC_HIT) && (this->collider.elem.acHitElem->atDmgInfo.dmgFlags & DMG_HAMMER))) { ObjBombiwa_Break(this, play); - Flags_SetSwitch(play, this->actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6)); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 80, NA_SE_EV_WALL_BROKEN); - if (((this->actor.params >> 0xF) & 1) != 0) { + if (PARAMS_GET_U(this->actor.params, 15, 1) != 0) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index 1c071363cf..0198ddfc8f 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -20,7 +20,7 @@ void ObjComb_ChooseItemDrop(ObjComb* this, PlayState* play); void ObjComb_SetupWait(ObjComb* this); void ObjComb_Wait(ObjComb* this, PlayState* play); -ActorInit Obj_Comb_InitVars = { +ActorProfile Obj_Comb_Profile = { /**/ ACTOR_OBJ_COMB, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -35,7 +35,7 @@ ActorInit Obj_Comb_InitVars = { static ColliderJntSphElementInit sJntSphElementsInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x4001FFFE, 0x00, 0x00 }, ATELEM_NONE, @@ -48,7 +48,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { static ColliderJntSphInit sJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, @@ -128,14 +128,14 @@ void ObjComb_Break(ObjComb* this, PlayState* play) { } void ObjComb_ChooseItemDrop(ObjComb* this, PlayState* play) { - s16 params = this->actor.params & 0x1F; + s16 params = PARAMS_GET_U(this->actor.params, 0, 5); if ((params > 0) || (params < ITEM00_MAX)) { // conditional always true. May have been intended to be && if (params == ITEM00_HEART_PIECE) { - if (Flags_GetCollectible(play, (this->actor.params >> 8) & 0x3F)) { + if (Flags_GetCollectible(play, PARAMS_GET_U(this->actor.params, 8, 6))) { params = -1; } else { - params = (params | (((this->actor.params >> 8) & 0x3F) << 8)); + params = (params | (PARAMS_GET_U(this->actor.params, 8, 6) << 8)); } } else if (Rand_ZeroOne() < 0.5f) { params = -1; @@ -216,8 +216,7 @@ void ObjComb_Draw(Actor* thisx, PlayState* play) { Matrix_Translate(0, -(this->actor.scale.y * 118.0f), 0, MTXMODE_APPLY); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_comb.c", 394), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_obj_comb.c", 394); gSPDisplayList(POLY_OPA_DISP++, gFieldBeehiveDL); diff --git a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c index 3d24be0958..3a0d603aae 100644 --- a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c +++ b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c @@ -7,7 +7,7 @@ #include "z_obj_dekujr.h" #include "assets/objects/object_dekujr/object_dekujr.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void ObjDekujr_Init(Actor* thisx, PlayState* play); void ObjDekujr_Destroy(Actor* thisx, PlayState* play); @@ -16,7 +16,7 @@ void ObjDekujr_Draw(Actor* thisx, PlayState* play); void ObjDekujr_ComeUp(ObjDekujr* this, PlayState* play); -ActorInit Obj_Dekujr_InitVars = { +ActorProfile Obj_Dekujr_Profile = { /**/ ACTOR_OBJ_DEKUJR, /**/ ACTORCAT_NPC, /**/ FLAGS, @@ -163,16 +163,14 @@ void ObjDekujr_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_dekujr.c", 379), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_obj_dekujr.c", 379); gSPDisplayList(POLY_OPA_DISP++, object_dekujr_DL_0030D0); frameCount = play->state.frames; gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, frameCount % 128, 0, 32, 32, 1, frameCount % 128, 0, 32, 32)); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_dekujr.c", 399), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_obj_dekujr.c", 399); gSPDisplayList(POLY_XLU_DISP++, object_dekujr_DL_0032D8); CLOSE_DISPS(play->state.gfxCtx, "../z_obj_dekujr.c", 409); diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c index 6cea4d4079..961a707a68 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c @@ -19,7 +19,7 @@ void func_80B92C80(ObjElevator* this, PlayState* play); void func_80B92D20(ObjElevator* this); void func_80B92D44(ObjElevator* this, PlayState* play); -ActorInit Obj_Elevator_InitVars = { +ActorProfile Obj_Elevator_Profile = { /**/ ACTOR_OBJ_ELEVATOR, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -66,9 +66,9 @@ void ObjElevator_Init(Actor* thisx, PlayState* play) { f32 temp_f0; func_80B92B08(this, play, &object_d_elevator_Col_000360, DYNA_TRANSFORM_POS); - Actor_SetScale(thisx, sScales[thisx->params & 1]); + Actor_SetScale(thisx, sScales[PARAMS_GET_U(thisx->params, 0, 1)]); Actor_ProcessInitChain(thisx, sInitChain); - temp_f0 = (thisx->params >> 8) & 0xF; + temp_f0 = PARAMS_GET_U(thisx->params, 8, 4); this->unk_16C = temp_f0 + temp_f0; func_80B92C5C(this); PRINTF("(Dungeon Elevator)(arg_data 0x%04x)\n", thisx->params); @@ -91,7 +91,7 @@ void func_80B92C80(ObjElevator* this, PlayState* play) { if ((this->dyna.interactFlags & DYNA_INTERACT_PLAYER_ON_TOP) && !(this->unk_170 & DYNA_INTERACT_PLAYER_ON_TOP)) { sub = thisx->world.pos.y - thisx->home.pos.y; if (fabsf(sub) < 0.1f) { - this->unk_168 = thisx->home.pos.y + ((thisx->params >> 0xC) & 0xF) * 80.0f; + this->unk_168 = thisx->home.pos.y + (PARAMS_GET_U(thisx->params, 12, 4)) * 80.0f; } else { this->unk_168 = thisx->home.pos.y; } diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index 3eb9e3347d..ba43d40a46 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -14,7 +14,7 @@ void ObjHamishi_Destroy(Actor* thisx, PlayState* play2); void ObjHamishi_Update(Actor* thisx, PlayState* play); void ObjHamishi_Draw(Actor* thisx, PlayState* play); -ActorInit Obj_Hamishi_InitVars = { +ActorProfile Obj_Hamishi_Profile = { /**/ ACTOR_OBJ_HAMISHI, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -28,7 +28,7 @@ ActorInit Obj_Hamishi_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -36,7 +36,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFF6, 0x00, 0x00 }, ATELEM_NONE, @@ -149,7 +149,7 @@ void ObjHamishi_Init(Actor* thisx, PlayState* play) { ObjHamishi_InitCollision(&this->actor, play); CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - if (Flags_GetSwitch(play, this->actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6))) { Actor_Kill(&this->actor); return; } @@ -180,7 +180,7 @@ void ObjHamishi_Update(Actor* thisx, PlayState* play) { } else { ObjHamishi_Break(this, play); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); - Flags_SetSwitch(play, this->actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6)); Actor_Kill(&this->actor); } } else { @@ -198,8 +198,7 @@ void ObjHamishi_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_hamishi.c", 404), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_obj_hamishi.c", 404); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 170, 130, 255); gSPDisplayList(POLY_OPA_DISP++, gSilverRockDL); diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c index 6dea87f6b3..11b671c4b4 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -14,7 +14,7 @@ void ObjHana_Destroy(Actor* thisx, PlayState* play); void ObjHana_Update(Actor* thisx, PlayState* play); void ObjHana_Draw(Actor* thisx, PlayState* play); -ActorInit Obj_Hana_InitVars = { +ActorProfile Obj_Hana_Profile = { /**/ ACTOR_OBJ_HANA, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -28,7 +28,7 @@ ActorInit Obj_Hana_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, @@ -36,7 +36,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, ATELEM_NONE, @@ -48,7 +48,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE }; -typedef struct { +typedef struct HanaParams { /* 0x00 */ Gfx* dList; /* 0x04 */ f32 scale; /* 0x08 */ f32 yOffset; @@ -71,7 +71,7 @@ static InitChainEntry sInitChain[] = { void ObjHana_Init(Actor* thisx, PlayState* play) { ObjHana* this = (ObjHana*)thisx; - s16 type = this->actor.params & 3; + s16 type = PARAMS_GET_U(this->actor.params, 0, 2); HanaParams* params = &sHanaParams[type]; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -94,7 +94,7 @@ void ObjHana_Init(Actor* thisx, PlayState* play) { void ObjHana_Destroy(Actor* thisx, PlayState* play) { ObjHana* this = (ObjHana*)thisx; - if (sHanaParams[this->actor.params & 3].radius >= 0) { + if (sHanaParams[PARAMS_GET_U(this->actor.params, 0, 2)].radius >= 0) { Collider_DestroyCylinder(play, &this->collider); } } @@ -102,11 +102,11 @@ void ObjHana_Destroy(Actor* thisx, PlayState* play) { void ObjHana_Update(Actor* thisx, PlayState* play) { ObjHana* this = (ObjHana*)thisx; - if (sHanaParams[this->actor.params & 3].radius >= 0 && this->actor.xzDistToPlayer < 400.0f) { + if (sHanaParams[PARAMS_GET_U(this->actor.params, 0, 2)].radius >= 0 && this->actor.xzDistToPlayer < 400.0f) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } } void ObjHana_Draw(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, sHanaParams[thisx->params & 3].dList); + Gfx_DrawDListOpa(play, sHanaParams[PARAMS_GET_U(thisx->params, 0, 2)].dList); } diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index d1367a4b4d..e85d123ced 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -21,7 +21,7 @@ void func_80B93D90(ObjHsblock* this); void func_80B93DB0(ObjHsblock* this); void func_80B93E38(ObjHsblock* this); -ActorInit Obj_Hsblock_InitVars = { +ActorProfile Obj_Hsblock_Profile = { /**/ ACTOR_OBJ_HSBLOCK, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -52,11 +52,11 @@ void ObjHsblock_SetupAction(ObjHsblock* this, ObjHsblockActionFunc actionFunc) { this->actionFunc = actionFunc; } -void func_80B93B68(ObjHsblock* this, PlayState* play, CollisionHeader* collision, s32 moveFlags) { +void func_80B93B68(ObjHsblock* this, PlayState* play, CollisionHeader* collision, s32 transformFlags) { s32 pad; CollisionHeader* colHeader = NULL; - DynaPolyActor_Init(&this->dyna, moveFlags); + DynaPolyActor_Init(&this->dyna, transformFlags); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); @@ -71,7 +71,7 @@ void func_80B93B68(ObjHsblock* this, PlayState* play, CollisionHeader* collision } void func_80B93BF0(ObjHsblock* this, PlayState* play) { - if ((this->dyna.actor.params >> 5) & 1) { + if (PARAMS_GET_U(this->dyna.actor.params, 5, 1)) { Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_OBJ_ICE_POLY, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, 1); @@ -81,17 +81,17 @@ void func_80B93BF0(ObjHsblock* this, PlayState* play) { void ObjHsblock_Init(Actor* thisx, PlayState* play) { ObjHsblock* this = (ObjHsblock*)thisx; - func_80B93B68(this, play, sCollisionHeaders[thisx->params & 3], 0); + func_80B93B68(this, play, sCollisionHeaders[PARAMS_GET_U(thisx->params, 0, 2)], 0); Actor_ProcessInitChain(thisx, sInitChain); func_80B93BF0(this, play); - switch (thisx->params & 3) { + switch (PARAMS_GET_U(thisx->params, 0, 2)) { case 0: case 2: func_80B93D90(this); break; case 1: - if (Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6))) { func_80B93D90(this); } else { func_80B93DB0(this); @@ -122,7 +122,7 @@ void func_80B93DB0(ObjHsblock* this) { } void func_80B93DF4(ObjHsblock* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { func_80B93E38(this); } } @@ -147,7 +147,7 @@ void ObjHsblock_Update(Actor* thisx, PlayState* play) { if (this->actionFunc != NULL) { this->actionFunc(this, play); } - Actor_SetFocus(thisx, D_80B940C0[thisx->params & 3]); + Actor_SetFocus(thisx, D_80B940C0[PARAMS_GET_U(thisx->params, 0, 2)]); } void ObjHsblock_Draw(Actor* thisx, PlayState* play) { @@ -158,8 +158,7 @@ void ObjHsblock_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_hsblock.c", 369), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_obj_hsblock.c", 369); if (play->sceneId == SCENE_FIRE_TEMPLE) { color = &sFireTempleColor; @@ -178,7 +177,7 @@ void ObjHsblock_Draw(Actor* thisx, PlayState* play) { } gDPSetEnvColor(POLY_OPA_DISP++, color->r, color->g, color->b, 255); - gSPDisplayList(POLY_OPA_DISP++, sDLists[thisx->params & 3]); + gSPDisplayList(POLY_OPA_DISP++, sDLists[PARAMS_GET_U(thisx->params, 0, 2)]); CLOSE_DISPS(play->state.gfxCtx, "../z_obj_hsblock.c", 399); } diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index 736ba66f77..18b90b5584 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -17,7 +17,7 @@ void ObjIcePoly_Draw(Actor* thisx, PlayState* play); void ObjIcePoly_Idle(ObjIcePoly* this, PlayState* play); void ObjIcePoly_Melt(ObjIcePoly* this, PlayState* play); -ActorInit Obj_Ice_Poly_InitVars = { +ActorProfile Obj_Ice_Poly_Profile = { /**/ ACTOR_OBJ_ICE_POLY, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -31,7 +31,7 @@ ActorInit Obj_Ice_Poly_InitVars = { static ColliderCylinderInit sCylinderInitIce = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -39,7 +39,7 @@ static ColliderCylinderInit sCylinderInitIce = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x02, 0x00 }, { 0x00020800, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NONE, @@ -51,7 +51,7 @@ static ColliderCylinderInit sCylinderInitIce = { static ColliderCylinderInit sCylinderInitHard = { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, @@ -59,7 +59,7 @@ static ColliderCylinderInit sCylinderInitHard = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x4E01F7F6, 0x00, 0x00 }, ATELEM_NONE, @@ -77,7 +77,7 @@ static Color_RGBA8 sColorGray = { 180, 180, 180, 255 }; void ObjIcePoly_Init(Actor* thisx, PlayState* play) { ObjIcePoly* this = (ObjIcePoly*)thisx; - this->unk_151 = (thisx->params >> 8) & 0xFF; + this->unk_151 = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if (thisx->params < 0 || thisx->params >= 3) { Actor_Kill(thisx); @@ -197,8 +197,7 @@ void ObjIcePoly_Draw(Actor* thisx, PlayState* play) { func_8002ED80(&this->actor, play, 0); Matrix_RotateZYX(0x500, 0, -0x500, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_ice_poly.c", 428), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_obj_ice_poly.c", 428); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, play->gameplayFrames % 0x100, 0x20, 0x10, 1, 0, (play->gameplayFrames * 2) % 0x100, 0x40, 0x20)); diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index 63b9fb1170..f3b101e48e 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -22,7 +22,7 @@ void ObjKibako_Held(ObjKibako* this, PlayState* play); void ObjKibako_SetupThrown(ObjKibako* this); void ObjKibako_Thrown(ObjKibako* this, PlayState* play); -ActorInit Obj_Kibako_InitVars = { +ActorProfile Obj_Kibako_Profile = { /**/ ACTOR_OBJ_KIBAKO, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -36,7 +36,7 @@ ActorInit Obj_Kibako_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_PLAYER, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -44,7 +44,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000002, 0x00, 0x01 }, { 0x4FC00748, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -66,9 +66,9 @@ static InitChainEntry sInitChain[] = { void ObjKibako_SpawnCollectible(ObjKibako* this, PlayState* play) { s16 collectible; - collectible = this->actor.params & 0x1F; + collectible = PARAMS_GET_U(this->actor.params, 0, 5); if ((collectible >= 0) && (collectible < ITEM00_MAX)) { - Item_DropCollectible(play, &this->actor.world.pos, collectible | (((this->actor.params >> 8) & 0x3F) << 8)); + Item_DropCollectible(play, &this->actor.world.pos, collectible | (PARAMS_GET_U(this->actor.params, 8, 6) << 8)); } } diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c index bfcc4bbf26..58e578c059 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -17,7 +17,7 @@ void ObjKibako2_Draw(Actor* thisx, PlayState* play); void ObjKibako2_Idle(ObjKibako2* this, PlayState* play); void ObjKibako2_Kill(ObjKibako2* this, PlayState* play); -ActorInit Obj_Kibako2_InitVars = { +ActorProfile Obj_Kibako2_Profile = { /**/ ACTOR_OBJ_KIBAKO2, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -31,7 +31,7 @@ ActorInit Obj_Kibako2_InitVars = { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -39,7 +39,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, ATELEM_NONE, @@ -159,7 +159,7 @@ void ObjKibako2_Idle(ObjKibako2* this, PlayState* play) { void ObjKibako2_Kill(ObjKibako2* this, PlayState* play) { s16 params = this->dyna.actor.params; - if ((params & 0x8000) == 0) { + if (PARAMS_GET_NOSHIFT(params, 15, 1) == 0) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_SW, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, this->dyna.actor.shape.rot.y, 0, params | 0x8000); } diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index 0112cc09c8..f60b32d5c6 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -24,7 +24,7 @@ void ObjLift_Wait(ObjLift* this, PlayState* play); void ObjLift_Shake(ObjLift* this, PlayState* play); void ObjLift_Fall(ObjLift* this, PlayState* play); -ActorInit Obj_Lift_InitVars = { +ActorProfile Obj_Lift_Profile = { /**/ ACTOR_OBJ_LIFT, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -38,7 +38,7 @@ ActorInit Obj_Lift_InitVars = { static s16 sFallTimerDurations[] = { 0, 10, 20, 30, 40, 50, 60 }; -typedef struct { +typedef struct ObjLiftFramgentScale { /* 0x00 */ s16 x; /* 0x02 */ s16 z; } ObjLiftFramgentScale; // size = 0x4 @@ -100,9 +100,9 @@ void ObjLift_SpawnFragments(ObjLift* this, PlayState* play) { OBJECT_D_LIFT, gCollapsingPlatformDL); } - if (((this->dyna.actor.params >> 1) & 1) == 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 1, 1) == 0) { func_80033480(play, &this->dyna.actor.world.pos, 120.0f, 12, 120, 100, 1); - } else if (((this->dyna.actor.params >> 1) & 1) == 1) { + } else if (PARAMS_GET_U(this->dyna.actor.params, 1, 1) == 1) { func_80033480(play, &this->dyna.actor.world.pos, 60.0f, 8, 60, 100, 1); } } @@ -112,12 +112,12 @@ void ObjLift_Init(Actor* thisx, PlayState* play) { ObjLift_InitDynaPoly(this, play, &gCollapsingPlatformCol, DYNA_TRANSFORM_POS); - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 2) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 2, 6))) { Actor_Kill(&this->dyna.actor); return; } - Actor_SetScale(&this->dyna.actor, sScales[(this->dyna.actor.params >> 1) & 1]); + Actor_SetScale(&this->dyna.actor, sScales[PARAMS_GET_U(this->dyna.actor.params, 1, 1)]); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->shakeOrientation.x = Rand_ZeroOne() * 65535.5f; this->shakeOrientation.y = Rand_ZeroOne() * 65535.5f; @@ -133,7 +133,7 @@ void ObjLift_Destroy(Actor* thisx, PlayState* play) { } void ObjLift_SetupWait(ObjLift* this) { - this->timer = sFallTimerDurations[(this->dyna.actor.params >> 8) & 7]; + this->timer = sFallTimerDurations[PARAMS_GET_U(this->dyna.actor.params, 8, 3)]; ObjLift_SetupAction(this, ObjLift_Wait); } @@ -143,7 +143,7 @@ void ObjLift_Wait(ObjLift* this, PlayState* play) { if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { if (this->timer <= 0) { - if (((this->dyna.actor.params >> 8) & 7) == 7) { + if (PARAMS_GET_U(this->dyna.actor.params, 8, 3) == 7) { ObjLift_SetupFall(this); } else { quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_1); @@ -154,7 +154,7 @@ void ObjLift_Wait(ObjLift* this, PlayState* play) { } } } else { - this->timer = sFallTimerDurations[(this->dyna.actor.params >> 8) & 7]; + this->timer = sFallTimerDurations[PARAMS_GET_U(this->dyna.actor.params, 8, 3)]; } } @@ -199,15 +199,15 @@ void ObjLift_Fall(ObjLift* this, PlayState* play) { Actor_MoveXZGravity(&this->dyna.actor); Math_Vec3f_Copy(&pos, &this->dyna.actor.prevPos); - pos.y += sMaxFallDistances[(this->dyna.actor.params >> 1) & 1]; + pos.y += sMaxFallDistances[PARAMS_GET_U(this->dyna.actor.params, 1, 1)]; this->dyna.actor.floorHeight = BgCheck_EntityRaycastDown4(&play->colCtx, &this->dyna.actor.floorPoly, &bgId, &this->dyna.actor, &pos); if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= - (sMaxFallDistances[(this->dyna.actor.params >> 1) & 1] - 0.001f)) { + (sMaxFallDistances[PARAMS_GET_U(this->dyna.actor.params, 1, 1)] - 0.001f)) { ObjLift_SpawnFragments(this, play); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 20, NA_SE_EV_BOX_BREAK); - Flags_SetSwitch(play, (this->dyna.actor.params >> 2) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 2, 6)); Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index bb3bb56331..6f723d292a 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -11,7 +11,7 @@ #define FLAGS ACTOR_FLAG_4 -typedef enum { +typedef enum FaceTextureIndex { /* 0x00 */ FACE_EYES_CLOSED, /* 0x01 */ FACE_EYES_OPEN, /* 0x02 */ FACE_EYES_OPEN_SMILING @@ -35,7 +35,7 @@ void ObjLightswitch_DisappearDelay(ObjLightswitch* this, PlayState* play); void ObjLightswitch_SetupDisappear(ObjLightswitch* this); void ObjLightswitch_Disappear(ObjLightswitch* this, PlayState* play); -ActorInit Obj_Lightswitch_InitVars = { +ActorProfile Obj_Lightswitch_Profile = { /**/ ACTOR_OBJ_LIGHTSWITCH, /**/ ACTORCAT_SWITCH, /**/ FLAGS, @@ -50,7 +50,7 @@ ActorInit Obj_Lightswitch_InitVars = { static ColliderJntSphElementInit sColliderJntSphElementInit[] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00200000, 0x00, 0x00 }, ATELEM_NONE, @@ -62,7 +62,7 @@ static ColliderJntSphElementInit sColliderJntSphElementInit[] = { }; static ColliderJntSphInit sColliderJntSphInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -104,10 +104,10 @@ void ObjLightswitch_SetSwitchFlag(ObjLightswitch* this, PlayState* play) { Actor* thisx = &this->actor; // required s32 type; - if (!Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F)) { - type = this->actor.params >> 4 & 3; + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { + type = PARAMS_GET_U(this->actor.params, 4, 2); - Flags_SetSwitch(play, this->actor.params >> 8 & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); if (type == OBJLIGHTSWITCH_TYPE_1) { OnePointCutscene_AttentionSetSfx(play, thisx, NA_SE_SY_TRE_BOX_APPEAR); @@ -120,10 +120,10 @@ void ObjLightswitch_SetSwitchFlag(ObjLightswitch* this, PlayState* play) { } void ObjLightswitch_ClearSwitchFlag(ObjLightswitch* this, PlayState* play) { - if (Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F)) { - Flags_UnsetSwitch(play, this->actor.params >> 8 & 0x3F); + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { + Flags_UnsetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); - if ((this->actor.params >> 4 & 3) == OBJLIGHTSWITCH_TYPE_1) { + if (PARAMS_GET_U(this->actor.params, 4, 2) == OBJLIGHTSWITCH_TYPE_1) { OnePointCutscene_AttentionSetSfx(play, &this->actor, NA_SE_SY_TRE_BOX_APPEAR); } } @@ -161,13 +161,13 @@ void ObjLightswitch_SpawnDisappearEffects(ObjLightswitch* this, PlayState* play) void ObjLightswitch_Init(Actor* thisx, PlayState* play) { ObjLightswitch* this = (ObjLightswitch*)thisx; - s32 switchFlagSet = Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F); + s32 switchFlagSet = Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); s32 removeSelf = false; Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetFocus(&this->actor, 0.0f); if (switchFlagSet) { - if ((this->actor.params >> 4 & 3) == OBJLIGHTSWITCH_TYPE_BURN) { + if (PARAMS_GET_U(this->actor.params, 4, 2) == OBJLIGHTSWITCH_TYPE_BURN) { removeSelf = true; } else { ObjLightswitch_SetupOn(this); @@ -175,7 +175,7 @@ void ObjLightswitch_Init(Actor* thisx, PlayState* play) { } else { ObjLightswitch_SetupOff(this); } - if ((this->actor.params & 1) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 1) == 1) { if (switchFlagSet) { Math_Vec3f_Copy(&this->actor.world.pos, &D_80B97F68); Math_Vec3f_Copy(&this->actor.home.pos, &D_80B97F68); @@ -221,7 +221,7 @@ void ObjLightswitch_SetupOff(ObjLightswitch* this) { } void ObjLightswitch_Off(ObjLightswitch* this, PlayState* play) { - switch (this->actor.params >> 4 & 3) { + switch (PARAMS_GET_U(this->actor.params, 4, 2)) { case OBJLIGHTSWITCH_TYPE_STAY_ON: case OBJLIGHTSWITCH_TYPE_2: if (this->collider.base.acFlags & AC_HIT) { @@ -288,9 +288,9 @@ void ObjLightswitch_SetupOn(ObjLightswitch* this) { } void ObjLightswitch_On(ObjLightswitch* this, PlayState* play) { - switch (this->actor.params >> 4 & 3) { + switch (PARAMS_GET_U(this->actor.params, 4, 2)) { case OBJLIGHTSWITCH_TYPE_STAY_ON: - if (!Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { ObjLightswitch_SetupTurnOff(this); } break; @@ -324,7 +324,7 @@ void ObjLightswitch_SetupTurnOff(ObjLightswitch* this) { } void ObjLightswitch_TurnOff(ObjLightswitch* this, PlayState* play) { - if ((this->actor.params >> 4 & 3) != OBJLIGHTSWITCH_TYPE_1 || func_8005B198() == this->actor.category || + if (PARAMS_GET_U(this->actor.params, 4, 2) != OBJLIGHTSWITCH_TYPE_1 || func_8005B198() == this->actor.category || this->toggleDelay <= 0) { this->timer--; @@ -378,7 +378,7 @@ void ObjLightswitch_Update(Actor* thisx, PlayState* play2) { this->actionFunc(this, play); if (this->actor.update != NULL) { - if ((this->actor.params & 1) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 1) == 1) { this->actor.world.pos.x = this->actor.child->world.pos.x; this->actor.world.pos.y = this->actor.child->world.pos.y + 60.0f; this->actor.world.pos.z = this->actor.child->world.pos.z; @@ -392,8 +392,8 @@ void ObjLightswitch_Update(Actor* thisx, PlayState* play2) { } } -void ObjLightswitch_DrawOpa(ObjLightswitch* this, PlayState* play) { - Actor* child; +void ObjLightswitch_DrawOpa(Actor* thisx, PlayState* play) { + ObjLightswitch* this = (ObjLightswitch*)thisx; Vec3f pos; Vec3s rot; @@ -404,46 +404,42 @@ void ObjLightswitch_DrawOpa(ObjLightswitch* this, PlayState* play) { (u8)(this->alpha >> 6)); gSPSegment(POLY_OPA_DISP++, 0x09, &D_80116280[2]); - if ((this->actor.params & 1) == 1) { - child = this->actor.child; - this->actor.world.pos.x = child->world.pos.x; - this->actor.world.pos.y = child->world.pos.y + 60.0f; - this->actor.world.pos.z = child->world.pos.z; - Math_Vec3f_Copy(&pos, &this->actor.world.pos); - Matrix_SetTranslateRotateYXZ(pos.x, pos.y, pos.z, &this->actor.shape.rot); - Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); + if (PARAMS_GET_U(thisx->params, 0, 1) == 1) { + thisx->world.pos.x = thisx->child->world.pos.x; + thisx->world.pos.y = thisx->child->world.pos.y + 60.0f; + thisx->world.pos.z = thisx->child->world.pos.z; + Math_Vec3f_Copy(&pos, &thisx->world.pos); + Matrix_SetTranslateRotateYXZ(pos.x, pos.y, pos.z, &thisx->shape.rot); + Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY); } else { - pos.x = this->actor.world.pos.x; - pos.y = this->actor.world.pos.y + this->actor.shape.yOffset * this->actor.scale.y; - pos.z = this->actor.world.pos.z; + pos.x = thisx->world.pos.x; + pos.y = thisx->world.pos.y + thisx->shape.yOffset * thisx->scale.y; + pos.z = thisx->world.pos.z; } - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_lightswitch.c", 841), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_obj_lightswitch.c", 841); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sFaceTextures[this->faceTextureIndex])); gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000260); - rot.x = this->actor.shape.rot.x; - rot.y = this->actor.shape.rot.y; - rot.z = this->actor.shape.rot.z + this->flameRingRot; + rot.x = thisx->shape.rot.x; + rot.y = thisx->shape.rot.y; + rot.z = thisx->shape.rot.z + this->flameRingRot; Matrix_SetTranslateRotateYXZ(pos.x, pos.y, pos.z, &rot); - Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_lightswitch.c", 859), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_obj_lightswitch.c", 859); gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000398); - rot.z = this->actor.shape.rot.z - this->flameRingRot; + rot.z = thisx->shape.rot.z - this->flameRingRot; Matrix_SetTranslateRotateYXZ(pos.x, pos.y, pos.z, &rot); - Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_lightswitch.c", 873), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_obj_lightswitch.c", 873); gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000408); CLOSE_DISPS(play->state.gfxCtx, "../z_obj_lightswitch.c", 878); } -void ObjLightswitch_DrawXlu(ObjLightswitch* this, PlayState* play) { - s32 pad; +void ObjLightswitch_DrawXlu(Actor* thisx, PlayState* play) { + ObjLightswitch* this = (ObjLightswitch*)thisx; Vec3f sp68; Vec3s sp60; @@ -454,30 +450,27 @@ void ObjLightswitch_DrawXlu(ObjLightswitch* this, PlayState* play) { (u8)(this->alpha >> 6)); gSPSegment(POLY_XLU_DISP++, 0x09, D_80116280); - sp68.x = this->actor.world.pos.x; - sp68.y = this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y); - sp68.z = this->actor.world.pos.z; + sp68.x = thisx->world.pos.x; + sp68.y = thisx->world.pos.y + (thisx->shape.yOffset * thisx->scale.y); + sp68.z = thisx->world.pos.z; - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_lightswitch.c", 912), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_obj_lightswitch.c", 912); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sFaceTextures[this->faceTextureIndex])); gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000260); - sp60.x = this->actor.shape.rot.x; - sp60.y = this->actor.shape.rot.y; - sp60.z = this->actor.shape.rot.z + this->flameRingRot; + sp60.x = thisx->shape.rot.x; + sp60.y = thisx->shape.rot.y; + sp60.z = thisx->shape.rot.z + this->flameRingRot; Matrix_SetTranslateRotateYXZ(sp68.x, sp68.y, sp68.z, &sp60); - Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_lightswitch.c", 930), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_obj_lightswitch.c", 930); gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000398); - sp60.z = this->actor.shape.rot.z - this->flameRingRot; + sp60.z = thisx->shape.rot.z - this->flameRingRot; Matrix_SetTranslateRotateYXZ(sp68.x, sp68.y, sp68.z, &sp60); - Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_lightswitch.c", 944), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_obj_lightswitch.c", 944); gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000408); CLOSE_DISPS(play->state.gfxCtx, "../z_obj_lightswitch.c", 949); @@ -487,13 +480,13 @@ void ObjLightswitch_Draw(Actor* thisx, PlayState* play) { ObjLightswitch* this = (ObjLightswitch*)thisx; s32 alpha = this->alpha >> 6 & 0xFF; - if ((this->actor.params & 1) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 1) == 1) { Collider_UpdateSpheres(0, &this->collider); } - if ((this->actor.params >> 4 & 3) == OBJLIGHTSWITCH_TYPE_BURN && (alpha > 0 || alpha < 255)) { - ObjLightswitch_DrawXlu(this, play); + if (PARAMS_GET_U(this->actor.params, 4, 2) == OBJLIGHTSWITCH_TYPE_BURN && (alpha > 0 || alpha < 255)) { + ObjLightswitch_DrawXlu(thisx, play); } else { - ObjLightswitch_DrawOpa(this, play); + ObjLightswitch_DrawOpa(thisx, play); } } diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h index b8420f2d4e..78af71ed99 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h @@ -8,7 +8,7 @@ struct ObjLightswitch; typedef void (*ObjLightswitchActionFunc)(struct ObjLightswitch*, PlayState*); -typedef enum { +typedef enum ObjLightswitch_Type { /* 0 */ OBJLIGHTSWITCH_TYPE_STAY_ON, // doesn't turn off unless the switch flag is cleared some other way /* 1 */ OBJLIGHTSWITCH_TYPE_1, // turns on and off /* 2 */ OBJLIGHTSWITCH_TYPE_2, // turns on and off diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c index 2e4abf070e..e909134128 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -5,6 +5,7 @@ */ #include "z_obj_makekinsuta.h" +#include "global.h" #include "terminal.h" #define FLAGS ACTOR_FLAG_4 @@ -15,7 +16,7 @@ void ObjMakekinsuta_Update(Actor* thisx, PlayState* play); void func_80B98320(ObjMakekinsuta* this, PlayState* play); void ObjMakekinsuta_DoNothing(ObjMakekinsuta* this, PlayState* play); -ActorInit Obj_Makekinsuta_InitVars = { +ActorProfile Obj_Makekinsuta_Profile = { /**/ ACTOR_OBJ_MAKEKINSUTA, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -30,7 +31,7 @@ ActorInit Obj_Makekinsuta_InitVars = { void ObjMakekinsuta_Init(Actor* thisx, PlayState* play) { ObjMakekinsuta* this = (ObjMakekinsuta*)thisx; - if ((this->actor.params & 0x6000) == 0x4000) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 13, 2) == 0x4000) { PRINTF(VT_FGCOL(BLUE)); // "Gold Star Enemy(arg_data %x)" PRINTF("金スタ発生敵(arg_data %x)\n", this->actor.params); diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h index 5cd76798c1..0ac9b7ab84 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h @@ -2,11 +2,11 @@ #define Z_OBJ_MAKEKINSUTA_H #include "ultra64.h" -#include "global.h" +#include "z64actor.h" struct ObjMakekinsuta; -typedef void (*ObjMakekinsutaActionFunc)(struct ObjMakekinsuta*, PlayState*); +typedef void (*ObjMakekinsutaActionFunc)(struct ObjMakekinsuta*, struct PlayState*); typedef struct ObjMakekinsuta { /* 0x000 */ Actor actor; diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c index 98f5d45fbc..eeaf2bdd60 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -13,7 +13,7 @@ void ObjMakeoshihiki_Init(Actor* thisx, PlayState* play); void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play); -ActorInit Obj_Makeoshihiki_InitVars = { +ActorProfile Obj_Makeoshihiki_Profile = { /**/ ACTOR_OBJ_MAKEOSHIHIKI, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -25,7 +25,7 @@ ActorInit Obj_Makeoshihiki_InitVars = { /**/ ObjMakeoshihiki_Draw, }; -typedef struct { +typedef struct BlockConfig { /* 0x00 */ Vec3f posVecs[3]; /* 0x24 */ u8 unk_24[3]; /* 0x27 */ u8 color; @@ -59,9 +59,9 @@ void ObjMakeoshihiki_Init(Actor* thisx, PlayState* play) { s32 typeIdx; Vec3f* spawnPos; - if (!((thisx->params >> 6) & 1) && Flags_GetSwitch(play, thisx->params & 0x3F)) { + if (!PARAMS_GET_U(thisx->params, 6, 1) && Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) { typeIdx = 1; - } else if (!((thisx->params >> 0xE) & 1) && Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) { + } else if (!PARAMS_GET_U(thisx->params, 14, 1) && Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6))) { typeIdx = 2; } else { typeIdx = 0; @@ -96,10 +96,10 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) { for (i = 0; i < 3; i++) { if (Math3D_Vec3fDistSq(&thisx->child->world.pos, &block->posVecs[i]) < 0.001f) { if (block->unk_24[i] & 1) { - if ((thisx->params >> 6) & 1) { + if (PARAMS_GET_U(thisx->params, 6, 1)) { sfxCond1 = false; } else { - if (Flags_GetSwitch(play, thisx->params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) { cond = true; } else { cond = false; @@ -107,10 +107,10 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) { sfxCond1 = sFlags[i][0] ^ cond; } - if ((thisx->params >> 0xE) & 1) { + if (PARAMS_GET_U(thisx->params, 14, 1)) { sfxCond2 = false; } else { - if (Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6))) { cond2 = true; } else { cond2 = false; @@ -123,8 +123,8 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) { } } - sFlagSwitchFuncs[sFlags[i][0]](play, thisx->params & 0x3F); - sFlagSwitchFuncs[sFlags[i][1]](play, (thisx->params >> 8) & 0x3F); + sFlagSwitchFuncs[sFlags[i][0]](play, PARAMS_GET_U(thisx->params, 0, 6)); + sFlagSwitchFuncs[sFlags[i][1]](play, PARAMS_GET_U(thisx->params, 8, 6)); if (block->unk_24[i] & 2) { ((ObjOshihiki*)thisx->child)->cantMove = true; diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index 0ecf75fcd1..607d3e10a5 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -19,7 +19,7 @@ void ObjMure_ActiveState(ObjMure* this, PlayState* play); s32 ObjMure_GetMaxChildSpawns(ObjMure* this); -ActorInit Obj_Mure_InitVars = { +ActorProfile Obj_Mure_Profile = { /**/ ACTOR_OBJ_MURE, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -31,7 +31,7 @@ ActorInit Obj_Mure_InitVars = { /**/ NULL, }; -typedef enum { +typedef enum ObjMureType { /* 0 */ OBJMURE_TYPE_GRASS, /* 1 */ OBJMURE_TYPE_UNDEFINED, /* 2 */ OBJMURE_TYPE_FISH, @@ -39,7 +39,7 @@ typedef enum { /* 4 */ OBJMURE_TYPE_BUTTERFLY } ObjMureType; -typedef enum { +typedef enum ObjMureChildState { /* 0 */ OBJMURE_CHILD_STATE_0, /* 1 */ OBJMURE_CHILD_STATE_1, // Dead /* 2 */ OBJMURE_CHILD_STATE_2 @@ -89,10 +89,10 @@ s32 ObjMure_SetCulling(Actor* thisx, PlayState* play) { void ObjMure_Init(Actor* thisx, PlayState* play) { ObjMure* this = (ObjMure*)thisx; - this->chNum = (thisx->params >> 0xC) & 0x0F; - this->ptn = (thisx->params >> 8) & 0x07; - this->svNum = (thisx->params >> 5) & 0x03; - this->type = thisx->params & 0x1F; + this->chNum = PARAMS_GET_U(thisx->params, 12, 4); + this->ptn = PARAMS_GET_U(thisx->params, 8, 3); + this->svNum = PARAMS_GET_U(thisx->params, 5, 2); + this->type = PARAMS_GET_U(thisx->params, 0, 5); if (this->ptn >= 4) { PRINTF("Error 群れな敵 (%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 237, thisx->params); diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c index 21c3ca6eb4..7539520b3d 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -10,7 +10,7 @@ typedef void (*ObjMure2SetPosFunc)(Vec3f* vec, ObjMure2* this); -typedef struct { +typedef struct Mure2sScatteredShrubInfo { s16 radius; s16 angle; } Mure2sScatteredShrubInfo; @@ -28,7 +28,7 @@ void ObjMure2_SetupWait(ObjMure2* this); void func_80B9A658(ObjMure2* this); void func_80B9A6E8(ObjMure2* this); -ActorInit Obj_Mure2_InitVars = { +ActorProfile Obj_Mure2_Profile = { /**/ ACTOR_OBJ_MURE2, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -52,7 +52,7 @@ void ObjMure2_SetPosShrubCircle(Vec3f* vec, ObjMure2* this) { s32 i; Math_Vec3f_Copy(vec, &this->actor.world.pos); - for (i = 1; i < D_80B9A818[this->actor.params & 3]; i++) { + for (i = 1; i < D_80B9A818[PARAMS_GET_U(this->actor.params, 0, 2)]; i++) { Math_Vec3f_Copy(vec + i, &this->actor.world.pos); (vec + i)->x += (80.0f * Math_SinS((i - 1) * 0x2000)); (vec + i)->z += (80.0f * Math_CosS((i - 1) * 0x2000)); @@ -67,7 +67,7 @@ static Mure2sScatteredShrubInfo sScatteredShrubInfo[] = { void ObjMure2_SetPosShrubScattered(Vec3f* vec, ObjMure2* this) { s32 i; - for (i = 0; i < D_80B9A818[this->actor.params & 3]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET_U(this->actor.params, 0, 2)]; i++) { Math_Vec3f_Copy(vec + i, &this->actor.world.pos); (vec + i)->x += (sScatteredShrubInfo[i].radius * Math_CosS(sScatteredShrubInfo[i].angle)); (vec + i)->z -= (sScatteredShrubInfo[i].radius * Math_SinS(sScatteredShrubInfo[i].angle)); @@ -77,7 +77,7 @@ void ObjMure2_SetPosShrubScattered(Vec3f* vec, ObjMure2* this) { void ObjMure2_SetPosRockCircle(Vec3f* vec, ObjMure2* this) { s32 i; - for (i = 0; i < D_80B9A818[this->actor.params & 3]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET_U(this->actor.params, 0, 2)]; i++) { Math_Vec3f_Copy(vec + i, &this->actor.world.pos); (vec + i)->x += (80.0f * Math_SinS(i * 0x2000)); (vec + i)->z += (80.0f * Math_CosS(i * 0x2000)); @@ -86,12 +86,12 @@ void ObjMure2_SetPosRockCircle(Vec3f* vec, ObjMure2* this) { void ObjMure2_SetActorSpawnParams(s16* params, ObjMure2* this) { static s16 actorSpawnParams[] = { 0, 0, 0 }; - s16 dropTable = (this->actor.params >> 8) & 0xF; + s16 dropTable = PARAMS_GET_U(this->actor.params, 8, 4); if (dropTable >= 13) { dropTable = 0; } - *params = actorSpawnParams[this->actor.params & 3] & 0xF0FF; + *params = actorSpawnParams[PARAMS_GET_U(this->actor.params, 0, 2)] & 0xF0FF; *params |= (dropTable << 8); } @@ -101,7 +101,7 @@ void ObjMure2_SpawnActors(ObjMure2* this, PlayState* play) { ObjMure2_SetPosShrubScattered, ObjMure2_SetPosRockCircle, }; - s32 actorNum = this->actor.params & 3; + s32 actorNum = PARAMS_GET_U(this->actor.params, 0, 2); s32 i; Vec3f spawnPos[12]; s16 params; @@ -130,7 +130,7 @@ void ObjMure2_SpawnActors(ObjMure2* this, PlayState* play) { void ObjMure2_CleanupAndDie(ObjMure2* this, PlayState* play) { s32 i; - for (i = 0; i < D_80B9A818[this->actor.params & 3]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET_U(this->actor.params, 0, 2)]; i++) { if (((this->currentActorNum >> i) & 1) == 0) { if (this->actorSpawnPtrList[i] != NULL) { if (Actor_HasParent(this->actorSpawnPtrList[i], play)) { @@ -149,7 +149,7 @@ void ObjMure2_CleanupAndDie(ObjMure2* this, PlayState* play) { void func_80B9A534(ObjMure2* this) { s32 i; - for (i = 0; i < D_80B9A818[this->actor.params & 3]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET_U(this->actor.params, 0, 2)]; i++) { if (this->actorSpawnPtrList[i] != NULL && (((this->currentActorNum >> i) & 1) == 0) && (this->actorSpawnPtrList[i]->update == NULL)) { this->currentActorNum |= (1 << i); @@ -188,7 +188,7 @@ void func_80B9A658(ObjMure2* this) { void func_80B9A668(ObjMure2* this, PlayState* play) { if (Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z) < - (sDistSquared1[this->actor.params & 3] * this->unk_184)) { + (sDistSquared1[PARAMS_GET_U(this->actor.params, 0, 2)] * this->unk_184)) { this->actor.flags |= ACTOR_FLAG_4; ObjMure2_SpawnActors(this, play); func_80B9A6E8(this); @@ -201,7 +201,7 @@ void func_80B9A6E8(ObjMure2* this) { void func_80B9A6F8(ObjMure2* this, PlayState* play) { func_80B9A534(this); - if ((sDistSquared2[this->actor.params & 3] * this->unk_184) <= + if ((sDistSquared2[PARAMS_GET_U(this->actor.params, 0, 2)] * this->unk_184) <= Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z)) { this->actor.flags &= ~ACTOR_FLAG_4; ObjMure2_CleanupAndDie(this, play); diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c index a535314609..1ed11535ca 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c @@ -19,7 +19,7 @@ void func_80B9AF64(ObjMure3* this, PlayState* play); void func_80B9AFEC(ObjMure3* this); void func_80B9AFFC(ObjMure3* this, PlayState* play); -ActorInit Obj_Mure3_InitVars = { +ActorProfile Obj_Mure3_Profile = { /**/ ACTOR_OBJ_MURE3, /**/ ACTORCAT_BG, /**/ FLAGS, @@ -104,7 +104,7 @@ void func_80B9ABA0(ObjMure3* this, PlayState* play) { } void func_80B9ACE4(ObjMure3* this, PlayState* play) { - s16 count = sRupeeCounts[(this->actor.params >> 13) & 7]; + s16 count = sRupeeCounts[PARAMS_GET_U(this->actor.params, 13, 3)]; s32 i; EnItem00** collectible; @@ -123,7 +123,7 @@ void func_80B9ACE4(ObjMure3* this, PlayState* play) { } void func_80B9ADCC(ObjMure3* this, PlayState* play) { - s16 count = sRupeeCounts[(this->actor.params >> 13) & 7]; + s16 count = sRupeeCounts[PARAMS_GET_U(this->actor.params, 13, 3)]; s32 i; for (i = 0; i < count; i++) { @@ -131,7 +131,7 @@ void func_80B9ADCC(ObjMure3* this, PlayState* play) { if ((*collectible != NULL) && !((this->unk_16C >> i) & 1)) { if (Actor_HasParent(&(*collectible)->actor, play)) { - Flags_SetSwitch(play, this->actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6)); } if ((*collectible)->actor.update == NULL) { this->unk_16C |= (1 << i); @@ -145,7 +145,7 @@ void ObjMure3_Init(Actor* thisx, PlayState* play) { s32 pad; ObjMure3* this = (ObjMure3*)thisx; - if (Flags_GetSwitch(play, this->actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6))) { Actor_Kill(&this->actor); return; } @@ -173,7 +173,7 @@ void func_80B9AF64(ObjMure3* this, PlayState* play) { if (Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z) < SQ(1150.0f)) { this->actor.flags |= ACTOR_FLAG_4; - spawnFuncs[(this->actor.params >> 13) & 7](this, play); + spawnFuncs[PARAMS_GET_U(this->actor.params, 13, 3)](this, play); func_80B9AFEC(this); } } diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index d6916c4151..5aacdad56a 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -24,7 +24,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play); void ObjOshihiki_SetupFall(ObjOshihiki* this, PlayState* play); void ObjOshihiki_Fall(ObjOshihiki* this, PlayState* play); -ActorInit Obj_Oshihiki_InitVars = { +ActorProfile Obj_Oshihiki_Profile = { /**/ ACTOR_OBJ_OSHIHIKI, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -116,7 +116,7 @@ s32 ObjOshihiki_StrongEnough(ObjOshihiki* this) { return 0; } strength = Player_GetStrength(); - switch (this->dyna.actor.params & 0xF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_SMALL_START_OFF: @@ -183,16 +183,16 @@ s32 ObjOshihiki_NoSwitchPress(ObjOshihiki* this, DynaPolyActor* dyna, PlayState* if (dyna == NULL) { return 1; } else if (dyna->actor.id == ACTOR_OBJ_SWITCH) { - dynaSwitchFlag = (dyna->actor.params >> 8) & 0x3F; - switch (dyna->actor.params & 0x33) { - case 0x20: // Normal blue switch - if ((dynaSwitchFlag == ((this->dyna.actor.params >> 8) & 0x3F)) && + dynaSwitchFlag = PARAMS_GET_U(dyna->actor.params, 8, 6); + switch (dyna->actor.params & 0x33) { // Does not fit any standard params getter macro + case 0x20: // Normal blue switch + if ((dynaSwitchFlag == PARAMS_GET_U(this->dyna.actor.params, 8, 6)) && Flags_GetSwitch(play, dynaSwitchFlag)) { return 0; } break; case 0x30: // Inverse blue switch - if ((dynaSwitchFlag == ((this->dyna.actor.params >> 8) & 0x3F)) && + if ((dynaSwitchFlag == PARAMS_GET_U(this->dyna.actor.params, 8, 6)) && !Flags_GetSwitch(play, dynaSwitchFlag)) { return 0; } @@ -203,7 +203,7 @@ s32 ObjOshihiki_NoSwitchPress(ObjOshihiki* this, DynaPolyActor* dyna, PlayState* } void ObjOshihiki_CheckType(ObjOshihiki* this, PlayState* play) { - switch (this->dyna.actor.params & 0xF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_LARGE_START_ON: @@ -223,11 +223,11 @@ void ObjOshihiki_CheckType(ObjOshihiki* this, PlayState* play) { } void ObjOshihiki_SetScale(ObjOshihiki* this, PlayState* play) { - Actor_SetScale(&this->dyna.actor, sScales[this->dyna.actor.params & 0xF]); + Actor_SetScale(&this->dyna.actor, sScales[PARAMS_GET_U(this->dyna.actor.params, 0, 4)]); } void ObjOshihiki_SetTexture(ObjOshihiki* this, PlayState* play) { - switch (this->dyna.actor.params & 0xF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_SMALL_START_OFF: @@ -247,7 +247,7 @@ void ObjOshihiki_SetTexture(ObjOshihiki* this, PlayState* play) { void ObjOshihiki_SetColor(ObjOshihiki* this, PlayState* play2) { PlayState* play = play2; - s16 paramsColorIdx = (this->dyna.actor.params >> 6) & 3; + s16 paramsColorIdx = PARAMS_GET_U(this->dyna.actor.params, 6, 2); Color_RGB8* color = &this->color; Color_RGB8* src; s32 i; @@ -276,9 +276,9 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play2) { ObjOshihiki_CheckType(this, play); - if ((((this->dyna.actor.params >> 8) & 0xFF) >= 0) && (((this->dyna.actor.params >> 8) & 0xFF) <= 0x3F)) { - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { - switch (this->dyna.actor.params & 0xF) { + if ((PARAMS_GET_U(this->dyna.actor.params, 8, 8) >= 0) && (PARAMS_GET_U(this->dyna.actor.params, 8, 8) <= 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_LARGE_START_ON: @@ -287,7 +287,7 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play2) { return; } } else { - switch (this->dyna.actor.params & 0xF) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_OFF: case PUSHBLOCK_MEDIUM_START_OFF: case PUSHBLOCK_LARGE_START_OFF: @@ -646,8 +646,7 @@ void ObjOshihiki_Draw(Actor* thisx, PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(this->texture)); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_OPA_DISP++, this->texture); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_oshihiki.c", 1308), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_obj_oshihiki.c", 1308); #if IS_DEBUG switch (play->sceneId) { diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h index ac4a135c4c..90dce5ca45 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h @@ -6,7 +6,7 @@ struct ObjOshihiki; -typedef enum { +typedef enum PushBlockType { /* 0 */ PUSHBLOCK_SMALL_START_ON, /* 1 */ PUSHBLOCK_MEDIUM_START_ON, /* 2 */ PUSHBLOCK_LARGE_START_ON, diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 1f52d5c886..5648c809ca 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -15,7 +15,7 @@ void ObjRoomtimer_Update(Actor* thisx, PlayState* play); void func_80B9D054(ObjRoomtimer* this, PlayState* play); void func_80B9D0B0(ObjRoomtimer* this, PlayState* play); -ActorInit Obj_Roomtimer_InitVars = { +ActorProfile Obj_Roomtimer_Profile = { /**/ ACTOR_OBJ_ROOMTIMER, /**/ ACTORCAT_ENEMY, /**/ FLAGS, @@ -29,18 +29,12 @@ ActorInit Obj_Roomtimer_InitVars = { void ObjRoomtimer_Init(Actor* thisx, PlayState* play) { ObjRoomtimer* this = (ObjRoomtimer*)thisx; - s16 params = this->actor.params; - this->switchFlag = (params >> 10) & 0x3F; - this->actor.params = params & 0x3FF; - params = this->actor.params; + this->switchFlag = PARAMS_GET_U(this->actor.params, 10, 6); + this->actor.params = PARAMS_GET_U(this->actor.params, 0, 10); - if (params != 0x3FF) { - if (params > 600) { - this->actor.params = 600; - } else { - this->actor.params = params; - } + if (this->actor.params != 0x3FF) { + this->actor.params = CLAMP_MAX(this->actor.params, 600); } this->actionFunc = func_80B9D054; diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index 7fe417d62d..85dfce4bcc 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -10,10 +10,11 @@ #define FLAGS ACTOR_FLAG_4 -#define OBJSWITCH_TYPE(thisx) ((thisx)->params & 7) -#define OBJSWITCH_SUBTYPE(thisx) (((thisx)->params >> 4) & 7) -#define OBJSWITCH_SWITCH_FLAG(thisx) (((thisx)->params >> 8) & 0x3F) -#define OBJSWITCH_FROZEN(thisx) (((thisx)->params >> 7) & 1) +#define OBJSWITCH_TYPE(thisx) PARAMS_GET_U((thisx)->params, 0, 3) +#define OBJSWITCH_SUBTYPE(thisx) PARAMS_GET_U((thisx)->params, 4, 3) +#define OBJSWITCH_SWITCH_FLAG(thisx) PARAMS_GET_U((thisx)->params, 8, 6) +#define OBJSWITCH_FROZEN(thisx) PARAMS_GET_U((thisx)->params, 7, 1) + #define OBJSWITCH_FROZEN_FLAG (1 << 7) void ObjSwitch_Init(Actor* thisx, PlayState* play); @@ -50,7 +51,7 @@ void ObjSwitch_CrystalOn(ObjSwitch* this, PlayState* play); void ObjSwitch_CrystalTurnOffInit(ObjSwitch* this); void ObjSwitch_CrystalTurnOff(ObjSwitch* this, PlayState* play); -ActorInit Obj_Switch_InitVars = { +ActorProfile Obj_Switch_Profile = { /**/ ACTOR_OBJ_SWITCH, /**/ ACTORCAT_SWITCH, /**/ FLAGS, @@ -73,7 +74,7 @@ static f32 sFocusHeights[] = { static ColliderTrisElementInit sRustyFloorTrisElementsInit[2] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, ATELEM_NONE, @@ -84,7 +85,7 @@ static ColliderTrisElementInit sRustyFloorTrisElementsInit[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, ATELEM_NONE, @@ -97,7 +98,7 @@ static ColliderTrisElementInit sRustyFloorTrisElementsInit[2] = { static ColliderTrisInit sRustyFloorTrisInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -111,7 +112,7 @@ static ColliderTrisInit sRustyFloorTrisInit = { static ColliderTrisElementInit sEyeTrisElementsInit[2] = { { { - ELEMTYPE_UNK4, + ELEM_MATERIAL_UNK4, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, ATELEM_NONE, @@ -122,7 +123,7 @@ static ColliderTrisElementInit sEyeTrisElementsInit[2] = { }, { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, ATELEM_NONE, @@ -135,7 +136,7 @@ static ColliderTrisElementInit sEyeTrisElementsInit[2] = { static ColliderTrisInit sEyeTrisInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -149,7 +150,7 @@ static ColliderTrisInit sEyeTrisInit = { static ColliderJntSphElementInit sCrystalJntSphElementInit[1] = { { { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xEFC1FFFE, 0x00, 0x00 }, ATELEM_NONE, @@ -162,7 +163,7 @@ static ColliderJntSphElementInit sCrystalJntSphElementInit[1] = { static ColliderJntSphInit sCrystalJntSphInit = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -290,11 +291,8 @@ void ObjSwitch_UpdateTwoTexScrollXY(ObjSwitch* this) { void ObjSwitch_Init(Actor* thisx, PlayState* play) { ObjSwitch* this = (ObjSwitch*)thisx; - s32 isSwitchFlagSet; - s32 type; - - isSwitchFlagSet = Flags_GetSwitch(play, OBJSWITCH_SWITCH_FLAG(&this->dyna.actor)); - type = OBJSWITCH_TYPE(&this->dyna.actor); + s32 isSwitchFlagSet = Flags_GetSwitch(play, OBJSWITCH_SWITCH_FLAG(&this->dyna.actor)); + s32 type = OBJSWITCH_TYPE(&this->dyna.actor); if (type == OBJSWITCH_TYPE_FLOOR || type == OBJSWITCH_TYPE_FLOOR_RUSTY) { ObjSwitch_InitDynaPoly(this, play, &gFloorSwitchCol, DYNA_TRANSFORM_POS); @@ -317,8 +315,8 @@ void ObjSwitch_Init(Actor* thisx, PlayState* play) { } if (type == OBJSWITCH_TYPE_CRYSTAL_TARGETABLE) { - this->dyna.actor.flags |= ACTOR_FLAG_0; - this->dyna.actor.targetMode = 4; + this->dyna.actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; + this->dyna.actor.attentionRangeType = ATTENTION_RANGE_4; } this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -741,7 +739,7 @@ void ObjSwitch_Update(Actor* thisx, PlayState* play) { } } -void ObjSwitch_DrawFloor(ObjSwitch* this, PlayState* play) { +void ObjSwitch_DrawFloor(Actor* thisx, PlayState* play) { static Gfx* floorSwitchDLists[] = { gFloorSwitch1DL, // OBJSWITCH_SUBTYPE_ONCE gFloorSwitch3DL, // OBJSWITCH_SUBTYPE_TOGGLE @@ -749,14 +747,14 @@ void ObjSwitch_DrawFloor(ObjSwitch* this, PlayState* play) { gFloorSwitch2DL, // OBJSWITCH_SUBTYPE_HOLD_INVERTED }; - Gfx_DrawDListOpa(play, floorSwitchDLists[OBJSWITCH_SUBTYPE(&this->dyna.actor)]); + Gfx_DrawDListOpa(play, floorSwitchDLists[OBJSWITCH_SUBTYPE(thisx)]); } -void ObjSwitch_DrawFloorRusty(ObjSwitch* this, PlayState* play) { +void ObjSwitch_DrawFloorRusty(Actor* thisx, PlayState* play) { Gfx_DrawDListOpa(play, gRustyFloorSwitchDL); } -void ObjSwitch_DrawEye(ObjSwitch* this, PlayState* play) { +void ObjSwitch_DrawEye(Actor* thisx, PlayState* play) { static void* eyeTextures[][4] = { // OBJSWITCH_SUBTYPE_ONCE { gEyeSwitchGoldOpenTex, gEyeSwitchGoldOpeningTex, gEyeSwitchGoldClosingTex, gEyeSwitchGoldClosedTex }, @@ -767,15 +765,14 @@ void ObjSwitch_DrawEye(ObjSwitch* this, PlayState* play) { gEyeSwitch1DL, // OBJSWITCH_SUBTYPE_ONCE gEyeSwitch2DL, // OBJSWITCH_SUBTYPE_TOGGLE }; - s32 pad; + ObjSwitch* this = (ObjSwitch*)thisx; s32 subType = OBJSWITCH_SUBTYPE(&this->dyna.actor); IF_F3DEX3_DONT_SKIP_TEX_INIT(); OPEN_DISPS(play->state.gfxCtx, "../z_obj_switch.c", 1459); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_switch.c", 1462), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_obj_switch.c", 1462); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTextures[subType][this->eyeTexIndex])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_OPA_DISP++, 4 * subType + this->eyeTexIndex); gSPDisplayList(POLY_OPA_DISP++, eyeSwitchDLs[subType]); @@ -783,7 +780,7 @@ void ObjSwitch_DrawEye(ObjSwitch* this, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_obj_switch.c", 1471); } -void ObjSwitch_DrawCrystal(ObjSwitch* this, PlayState* play) { +void ObjSwitch_DrawCrystal(Actor* thisx, PlayState* play) { static Gfx* xluDLists[] = { gCrystalSwitchCoreXluDL, // OBJSWITCH_SUBTYPE_ONCE gCrystalSwitchDiamondXluDL, // OBJSWITCH_SUBTYPE_TOGGLE @@ -798,21 +795,17 @@ void ObjSwitch_DrawCrystal(ObjSwitch* this, PlayState* play) { NULL, // OBJSWITCH_SUBTYPE_HOLD_INVERTED gCrystalSwitchCoreOpaDL // OBJSWITCH_SUBTYPE_SYNC }; - s32 pad1; - s32 pad2; - s32 subType; + ObjSwitch* this = (ObjSwitch*)thisx; + s32 pad; IF_F3DEX3_DONT_SKIP_TEX_INIT(); + s32 subType = OBJSWITCH_SUBTYPE(&this->dyna.actor); - subType = OBJSWITCH_SUBTYPE(&this->dyna.actor); func_8002ED80(&this->dyna.actor, play, 0); - if (1) {} - OPEN_DISPS(play->state.gfxCtx, "../z_obj_switch.c", 1494); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_switch.c", 1497), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_obj_switch.c", 1497); gSPDisplayList(POLY_XLU_DISP++, xluDLists[subType]); CLOSE_DISPS(play->state.gfxCtx, "../z_obj_switch.c", 1502); @@ -820,8 +813,7 @@ void ObjSwitch_DrawCrystal(ObjSwitch* this, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_obj_switch.c", 1507); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_switch.c", 1511), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_obj_switch.c", 1511); if (subType == OBJSWITCH_SUBTYPE_TOGGLE) { gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(this->crystalSubtype1texture)); @@ -837,7 +829,7 @@ void ObjSwitch_DrawCrystal(ObjSwitch* this, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_obj_switch.c", 1533); } -static ObjSwitchActionFunc sDrawFuncs[] = { +static ObjSwitchDrawFunc sDrawFuncs[] = { ObjSwitch_DrawFloor, // OBJSWITCH_TYPE_FLOOR ObjSwitch_DrawFloorRusty, // OBJSWITCH_TYPE_FLOOR_RUSTY ObjSwitch_DrawEye, // OBJSWITCH_TYPE_EYE @@ -846,7 +838,5 @@ static ObjSwitchActionFunc sDrawFuncs[] = { }; void ObjSwitch_Draw(Actor* thisx, PlayState* play) { - ObjSwitch* this = (ObjSwitch*)thisx; - - sDrawFuncs[OBJSWITCH_TYPE(&this->dyna.actor)](this, play); + sDrawFuncs[OBJSWITCH_TYPE(thisx)](thisx, play); } diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h index 8c12a9c85c..b6fb243f70 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h @@ -7,8 +7,9 @@ struct ObjSwitch; typedef void (*ObjSwitchActionFunc)(struct ObjSwitch*, PlayState*); +typedef void (*ObjSwitchDrawFunc)(Actor*, PlayState*); -typedef enum { +typedef enum ObjSwitchType { /* 0 */ OBJSWITCH_TYPE_FLOOR, /* 1 */ OBJSWITCH_TYPE_FLOOR_RUSTY, /* 2 */ OBJSWITCH_TYPE_EYE, @@ -16,7 +17,7 @@ typedef enum { /* 4 */ OBJSWITCH_TYPE_CRYSTAL_TARGETABLE } ObjSwitchType; -typedef enum { +typedef enum ObjSwitchSubType { /* 0 */ OBJSWITCH_SUBTYPE_ONCE, // Switches that can only be turned on (On -> Flag Set) /* 1 */ OBJSWITCH_SUBTYPE_TOGGLE, // Switches that can be turned on and off (On -> Flag Set, Off -> Flag Cleared) /* 2 */ OBJSWITCH_SUBTYPE_HOLD, // Floor Types only, released when not stood on (Down -> Flag Set, Up -> Flag Cleared) @@ -24,12 +25,12 @@ typedef enum { /* 4 */ OBJSWITCH_SUBTYPE_SYNC // Crystal Types only, syncs with the Switch Flag (On -> Flag Set, Off -> Flag Cleared) } ObjSwitchSubType; -typedef struct { +typedef struct ObjSwitchJntSph { /* 0x00 */ ColliderJntSph col; /* 0x20 */ ColliderJntSphElement items[1]; } ObjSwitchJntSph; -typedef struct { +typedef struct ObjSwitchTris { /* 0x00 */ ColliderTris col; /* 0x20 */ ColliderTrisElement items[2]; } ObjSwitchTris; diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index 7ea6b73d30..c6ff95c34c 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -16,7 +16,7 @@ void ObjSyokudai_Destroy(Actor* thisx, PlayState* play); void ObjSyokudai_Update(Actor* thisx, PlayState* play2); void ObjSyokudai_Draw(Actor* thisx, PlayState* play); -ActorInit Obj_Syokudai_InitVars = { +ActorProfile Obj_Syokudai_Profile = { /**/ ACTOR_OBJ_SYOKUDAI, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -30,7 +30,7 @@ ActorInit Obj_Syokudai_InitVars = { static ColliderCylinderInit sCylInitStand = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -38,7 +38,7 @@ static ColliderCylinderInit sCylInitStand = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00100000, 0x00, 0x00 }, { 0xEE01FFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -50,7 +50,7 @@ static ColliderCylinderInit sCylInitStand = { static ColliderCylinderInit sCylInitFlame = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, @@ -58,7 +58,7 @@ static ColliderCylinderInit sCylInitFlame = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000000, 0x00, 0x00 }, { 0x00020820, 0x00, 0x00 }, ATELEM_NONE, @@ -78,17 +78,17 @@ static InitChainEntry sInitChain[] = { static s32 sLitTorchCount; void ObjSyokudai_Init(Actor* thisx, PlayState* play) { - static u8 sColTypesStand[] = { 0x09, 0x0B, 0x0B }; + static u8 sColMaterialsStand[] = { COL_MATERIAL_METAL, COL_MATERIAL_WOOD, COL_MATERIAL_WOOD }; s32 pad; ObjSyokudai* this = (ObjSyokudai*)thisx; - s32 torchType = this->actor.params & 0xF000; + s32 torchType = PARAMS_GET_NOSHIFT(this->actor.params, 12, 4); Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); Collider_InitCylinder(play, &this->colliderStand); Collider_SetCylinder(play, &this->colliderStand, &this->actor, &sCylInitStand); - this->colliderStand.base.colType = sColTypesStand[this->actor.params >> 0xC]; + this->colliderStand.base.colMaterial = sColMaterialsStand[PARAMS_GET_NOMASK(this->actor.params, 12)]; Collider_InitCylinder(play, &this->colliderFlame); Collider_SetCylinder(play, &this->colliderFlame, &this->actor, &sCylInitFlame); @@ -99,7 +99,8 @@ void ObjSyokudai_Init(Actor* thisx, PlayState* play) { this->actor.world.pos.z, 255, 255, 180, -1); this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); - if ((this->actor.params & 0x400) || ((torchType != 2) && Flags_GetSwitch(play, this->actor.params & 0x3F))) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 10, 1) || + ((torchType != 2) && Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6)))) { this->litTimer = -1; } @@ -120,9 +121,9 @@ void ObjSyokudai_Destroy(Actor* thisx, PlayState* play) { void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { PlayState* play = play2; ObjSyokudai* this = (ObjSyokudai*)thisx; - s32 torchCount = (this->actor.params >> 6) & 0xF; - s32 switchFlag = this->actor.params & 0x3F; - s32 torchType = this->actor.params & 0xF000; + s32 torchCount = PARAMS_GET_U(this->actor.params, 6, 4); + s32 switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); + s32 torchType = PARAMS_GET_NOSHIFT(this->actor.params, 12, 4); s32 litTimeScale; WaterBox* dummy; f32 waterSurface; @@ -153,7 +154,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { } else { player = GET_PLAYER(play); interactionType = 0; - if (this->actor.params & 0x400) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 10, 1)) { this->litTimer = -1; } if (torchCount != 0) { @@ -251,7 +252,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { lightRadius = (this->litTimer * 200.0f) / 20.0f; } brightness = (u8)(Rand_ZeroOne() * 127.0f) + 128; - func_8002F974(&this->actor, NA_SE_EV_TORCH - SFX_FLAG); + Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_TORCH - SFX_FLAG); } Lights_PointSetColorAndRadius(&this->lightInfo, brightness, brightness, 0, lightRadius); this->flameTexScroll++; @@ -263,15 +264,14 @@ void ObjSyokudai_Draw(Actor* thisx, PlayState* play) { ObjSyokudai* this = (ObjSyokudai*)thisx; s32 timerMax; - timerMax = (((this->actor.params >> 6) & 0xF) * 50) + 100; + timerMax = PARAMS_GET_U(this->actor.params, 6, 4) * 50 + 100; OPEN_DISPS(play->state.gfxCtx, "../z_obj_syokudai.c", 707); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_syokudai.c", 714), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_obj_syokudai.c", 714); - gSPDisplayList(POLY_OPA_DISP++, displayLists[(u16)this->actor.params >> 0xC]); + gSPDisplayList(POLY_OPA_DISP++, displayLists[PARAMS_GET_NOMASK((u16)this->actor.params, 12)]); if (this->litTimer != 0) { f32 flameScale = 1.0f; @@ -283,8 +283,6 @@ void ObjSyokudai_Draw(Actor* thisx, PlayState* play) { } flameScale *= 0.0027f; - if (1) {} - Gfx_SetupDL_25Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, @@ -301,8 +299,7 @@ void ObjSyokudai_Draw(Actor* thisx, PlayState* play) { MTXMODE_APPLY); Matrix_Scale(flameScale, flameScale, flameScale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_syokudai.c", 745), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_obj_syokudai.c", 745); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); } diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c index a081e363c2..c29b73daa2 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -7,7 +7,7 @@ #include "z_obj_timeblock.h" #include "assets/objects/object_timeblock/object_timeblock.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_4 | ACTOR_FLAG_25 | ACTOR_FLAG_27) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4 | ACTOR_FLAG_25 | ACTOR_FLAG_LOCK_ON_DISABLED) void ObjTimeblock_Init(Actor* thisx, PlayState* play); void ObjTimeblock_Destroy(Actor* thisx, PlayState* play); @@ -25,7 +25,7 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play); void ObjTimeblock_AltBehaviorVisible(ObjTimeblock* this, PlayState* play); void ObjTimeblock_AltBehaviourNotVisible(ObjTimeblock* this, PlayState* play); -ActorInit Obj_Timeblock_InitVars = { +ActorProfile Obj_Timeblock_Profile = { /**/ ACTOR_OBJ_TIMEBLOCK, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -37,7 +37,7 @@ ActorInit Obj_Timeblock_InitVars = { /**/ ObjTimeblock_Draw, }; -typedef struct { +typedef struct ObjTimeblockSizeOptions { /* 0x00 */ f32 scale; /* 0x04 */ f32 height; /* 0x08 */ s16 demoEffectParams; @@ -51,7 +51,7 @@ static ObjTimeblockSizeOptions sSizeOptions[] = { static f32 sRanges[] = { 60.0, 100.0, 140.0, 180.0, 220.0, 260.0, 300.0, 300.0 }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_2, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1800, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 300, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 1500, ICHAIN_STOP), @@ -63,11 +63,11 @@ static Color_RGB8 sPrimColors[] = { }; u32 ObjTimeblock_CalculateIsVisible(ObjTimeblock* this) { - if (!((this->dyna.actor.params >> 10) & 1)) { + if (!PARAMS_GET_U(this->dyna.actor.params, 10, 1)) { if (this->unk_177 == 0) { return this->unk_175; } else { - u8 temp = ((this->dyna.actor.params >> 15) & 1) ? true : false; + u8 temp = PARAMS_GET_U(this->dyna.actor.params, 15, 1) ? true : false; if (this->unk_177 == 1) { return this->unk_174 ^ temp; @@ -78,14 +78,14 @@ u32 ObjTimeblock_CalculateIsVisible(ObjTimeblock* this) { } } } else { - return (((this->dyna.actor.params >> 15) & 1) ? true : false) ^ this->unk_174; + return (PARAMS_GET_U(this->dyna.actor.params, 15, 1) ? true : false) ^ this->unk_174; } } void ObjTimeblock_SpawnDemoEffect(ObjTimeblock* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_EFFECT, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, 0, 0, - sSizeOptions[(this->dyna.actor.params >> 8) & 1].demoEffectParams); + sSizeOptions[PARAMS_GET_U(this->dyna.actor.params, 8, 1)].demoEffectParams); } void ObjTimeblock_ToggleSwitchFlag(PlayState* play, s32 flag) { @@ -109,23 +109,23 @@ void ObjTimeblock_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - Actor_SetScale(&this->dyna.actor, sSizeOptions[(this->dyna.actor.params >> 8) & 1].scale); + Actor_SetScale(&this->dyna.actor, sSizeOptions[PARAMS_GET_U(this->dyna.actor.params, 8, 1)].scale); - if ((this->dyna.actor.params >> 6) & 1) { + if (PARAMS_GET_U(this->dyna.actor.params, 6, 1)) { this->unk_177 = 0; } else { - this->unk_177 = ((this->dyna.actor.params & 0x3F) < 0x38) ? 2 : 1; + this->unk_177 = (PARAMS_GET_U(this->dyna.actor.params, 0, 6) < 0x38) ? 2 : 1; } this->songObserverFunc = ObjTimeblock_WaitForOcarina; - Actor_SetFocus(&this->dyna.actor, sSizeOptions[(this->dyna.actor.params >> 8) & 1].height); + Actor_SetFocus(&this->dyna.actor, sSizeOptions[PARAMS_GET_U(this->dyna.actor.params, 8, 1)].height); - this->unk_174 = (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) ? true : false; - this->unk_175 = ((this->dyna.actor.params >> 15) & 1) ? true : false; + this->unk_174 = (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) ? true : false; + this->unk_175 = PARAMS_GET_U(this->dyna.actor.params, 15, 1) ? true : false; this->isVisible = ObjTimeblock_CalculateIsVisible(this); - if (!((this->dyna.actor.params >> 10) & 1)) { + if (!PARAMS_GET_U(this->dyna.actor.params, 10, 1)) { ObjTimeblock_SetupNormal(this); } else if (this->isVisible) { ObjTimeblock_SetupAltBehaviorVisible(this); @@ -135,8 +135,8 @@ void ObjTimeblock_Init(Actor* thisx, PlayState* play) { // "Block of time" PRINTF("時のブロック ( %04xH save:%d color:%d range:%d move:%d)\n", (u16)this->dyna.actor.params, - this->unk_177, this->dyna.actor.home.rot.z & 7, (this->dyna.actor.params >> 11) & 7, - (this->dyna.actor.params >> 10) & 1); + this->unk_177, this->dyna.actor.home.rot.z & 7, PARAMS_GET_U(this->dyna.actor.params, 11, 3), + PARAMS_GET_U(this->dyna.actor.params, 10, 1)); } void ObjTimeblock_Destroy(Actor* thisx, PlayState* play) { @@ -151,14 +151,14 @@ u8 ObjTimeblock_PlayerIsInRange(ObjTimeblock* this, PlayState* play) { return false; } - if (this->dyna.actor.xzDistToPlayer <= sRanges[(this->dyna.actor.params >> 11) & 7]) { - Vec3f distance; + if (this->dyna.actor.xzDistToPlayer <= sRanges[PARAMS_GET_U(this->dyna.actor.params, 11, 3)]) { + Vec3f playerRelativePos; f32 blockSize; - func_8002DBD0(&this->dyna.actor, &distance, &GET_PLAYER(play)->actor.world.pos); + Actor_WorldToActorCoords(&this->dyna.actor, &playerRelativePos, &GET_PLAYER(play)->actor.world.pos); blockSize = this->dyna.actor.scale.x * 50.0f + 6.0f; // Return true if player's xz position is not inside the block - if (blockSize < fabsf(distance.x) || blockSize < fabsf(distance.z)) { + if (blockSize < fabsf(playerRelativePos.x) || blockSize < fabsf(playerRelativePos.z)) { return true; } } @@ -225,7 +225,7 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play) { if (this->unk_177 == 0) { this->dyna.actor.params ^= 0x8000; } else { - ObjTimeblock_ToggleSwitchFlag(play, this->dyna.actor.params & 0x3F); + ObjTimeblock_ToggleSwitchFlag(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); } } @@ -234,9 +234,9 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play) { this->demoEffectFirstPartTimer--; if (this->demoEffectFirstPartTimer == 0) { if (this->unk_177 == 0) { - this->unk_175 = ((this->dyna.actor.params >> 15) & 1) ? true : false; + this->unk_175 = PARAMS_GET_U(this->dyna.actor.params, 15, 1) ? true : false; } else { - this->unk_174 = (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) ? true : false; + this->unk_174 = (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) ? true : false; } } } @@ -253,7 +253,7 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play) { } void func_80BA06AC(ObjTimeblock* this, PlayState* play) { - s32 switchFlag = this->dyna.actor.params & 0x3F; + s32 switchFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 6); this->unk_172 = play->msgCtx.lastPlayedSong; @@ -277,7 +277,7 @@ void ObjTimeblock_AltBehaviorVisible(ObjTimeblock* this, PlayState* play) { OnePointCutscene_Attention(play, &this->dyna.actor); // "Time Block Attention Camera (frame counter)" PRINTF("◯◯◯◯ Time Block 注目カメラ (frame counter %d)\n", play->state.frames); - ObjTimeblock_ToggleSwitchFlag(play, this->dyna.actor.params & 0x3F); + ObjTimeblock_ToggleSwitchFlag(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); } func_80BA06AC(this, play); @@ -296,10 +296,11 @@ void ObjTimeblock_SetupAltBehaviourNotVisible(ObjTimeblock* this) { } void ObjTimeblock_AltBehaviourNotVisible(ObjTimeblock* this, PlayState* play) { - s32 switchFlag = this->dyna.actor.params & 0x3F; + s32 switchFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 6); s8 switchFlagIsSet = (Flags_GetSwitch(play, switchFlag)) ? true : false; - if (this->unk_176 ^ switchFlagIsSet && switchFlagIsSet ^ (((this->dyna.actor.params >> 15) & 1) ? true : false)) { + if (this->unk_176 ^ switchFlagIsSet && + switchFlagIsSet ^ (PARAMS_GET_U(this->dyna.actor.params, 15, 1) ? true : false)) { if (this->demoEffectTimer <= 0) { ObjTimeblock_SpawnDemoEffect(this, play); this->demoEffectTimer = 160; @@ -337,8 +338,7 @@ void ObjTimeblock_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_obj_timeblock.c", 762); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_timeblock.c", 766), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_obj_timeblock.c", 766); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, primColor->r, primColor->g, primColor->b, 255); gSPDisplayList(POLY_OPA_DISP++, gSongOfTimeBlockDL); diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 7c05c22fa5..d88f5c7142 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -9,7 +9,7 @@ #include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "assets/objects/object_tsubo/object_tsubo.h" -#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_23) +#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_THROW_ONLY) void ObjTsubo_Init(Actor* thisx, PlayState* play); void ObjTsubo_Destroy(Actor* thisx, PlayState* play2); @@ -36,7 +36,7 @@ static s16 D_80BA1B54 = 0; static s16 D_80BA1B58 = 0; static s16 D_80BA1B5C = 0; -ActorInit Obj_Tsubo_InitVars = { +ActorProfile Obj_Tsubo_Profile = { /**/ ACTOR_OBJ_TSUBO, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -56,7 +56,7 @@ static Gfx* D_80BA1B8C[] = { gPotFragmentDL, object_tsubo_DL_001960 }; static ColliderCylinderInit sCylinderInit = { { - COLTYPE_HARD, + COL_MATERIAL_HARD, AT_ON | AT_TYPE_PLAYER, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -64,7 +64,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000002, 0x00, 0x01 }, { 0x4FC1FFFE, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -83,10 +83,10 @@ static InitChainEntry sInitChain[] = { }; void ObjTsubo_SpawnCollectible(ObjTsubo* this, PlayState* play) { - s16 dropParams = this->actor.params & 0x1F; + s16 dropParams = PARAMS_GET_U(this->actor.params, 0, 5); if ((dropParams >= 0) && (dropParams < ITEM00_MAX)) { - Item_DropCollectible(play, &this->actor.world.pos, (dropParams | (((this->actor.params >> 9) & 0x3F) << 8))); + Item_DropCollectible(play, &this->actor.world.pos, dropParams | (PARAMS_GET_U(this->actor.params, 9, 6) << 8)); } } @@ -135,7 +135,7 @@ void ObjTsubo_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); return; } - this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[(this->actor.params >> 8) & 1]); + this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[PARAMS_GET_U(this->actor.params, 8, 1)]); if (this->requiredObjectSlot < 0) { PRINTF("Error : バンク危険! (arg_data 0x%04x)(%s %d)\n", this->actor.params, "../z_obj_tsubo.c", 410); Actor_Kill(&this->actor); @@ -183,7 +183,8 @@ void ObjTsubo_AirBreak(ObjTsubo* this, PlayState* play) { } EffectSsKakera_Spawn(play, &pos, &velocity, &this->actor.world.pos, -240, arg5, 10, 10, 0, (Rand_ZeroOne() * 95.0f) + 15.0f, 0, 32, 60, KAKERA_COLOR_NONE, - sObjectIds[(this->actor.params >> 8) & 1], D_80BA1B8C[(this->actor.params >> 8) & 1]); + sObjectIds[PARAMS_GET_U(this->actor.params, 8, 1)], + D_80BA1B8C[PARAMS_GET_U(this->actor.params, 8, 1)]); } func_80033480(play, &this->actor.world.pos, 30.0f, 4, 20, 50, 1); } @@ -212,7 +213,8 @@ void ObjTsubo_WaterBreak(ObjTsubo* this, PlayState* play) { phi_s0 = (Rand_ZeroOne() < .2f) ? 64 : 32; EffectSsKakera_Spawn(play, &pos, &velocity, &this->actor.world.pos, -180, phi_s0, 30, 30, 0, (Rand_ZeroOne() * 95.0f) + 15.0f, 0, 32, 70, KAKERA_COLOR_NONE, - sObjectIds[(this->actor.params >> 8) & 1], D_80BA1B8C[(this->actor.params >> 8) & 1]); + sObjectIds[PARAMS_GET_U(this->actor.params, 8, 1)], + D_80BA1B8C[PARAMS_GET_U(this->actor.params, 8, 1)]); } } @@ -338,5 +340,5 @@ void ObjTsubo_Update(Actor* thisx, PlayState* play) { } void ObjTsubo_Draw(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, D_80BA1B84[(thisx->params >> 8) & 1]); + Gfx_DrawDListOpa(play, D_80BA1B84[PARAMS_GET_U(thisx->params, 8, 1)]); } diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c index 73919d7d30..dcb3428672 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -8,7 +8,7 @@ #include "assets/objects/object_timeblock/object_timeblock.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_4 | ACTOR_FLAG_25 | ACTOR_FLAG_27) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_4 | ACTOR_FLAG_25 | ACTOR_FLAG_LOCK_ON_DISABLED) void ObjWarp2block_Init(Actor* thisx, PlayState* play2); void ObjWarp2block_Destroy(Actor* thisx, PlayState* play); @@ -28,7 +28,7 @@ void func_80BA24F8(ObjWarp2block* this, PlayState* play); void func_80BA2600(ObjWarp2block* this); void func_80BA2610(ObjWarp2block* this, PlayState* play); -ActorInit Obj_Warp2block_InitVars = { +ActorProfile Obj_Warp2block_Profile = { /**/ ACTOR_OBJ_WARP2BLOCK, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -40,7 +40,7 @@ ActorInit Obj_Warp2block_InitVars = { /**/ ObjWarp2block_Draw, }; -typedef struct { +typedef struct Warp2BlockSpawnData { /* 0x00 */ f32 scale; /* 0x04 */ f32 focus; /* 0x08 */ s16 params; @@ -66,11 +66,11 @@ static Color_RGB8 sColors[] = { void ObjWarp2block_Spawn(ObjWarp2block* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_EFFECT, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, - this->dyna.actor.world.pos.z, 0, 0, 0, sSpawnData[(this->dyna.actor.params >> 8) & 1].params); + this->dyna.actor.world.pos.z, 0, 0, 0, sSpawnData[PARAMS_GET_U(this->dyna.actor.params, 8, 1)].params); Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_EFFECT, this->dyna.actor.child->world.pos.x, this->dyna.actor.child->world.pos.y, this->dyna.actor.child->world.pos.z, 0, 0, 0, - sSpawnData[(this->dyna.actor.child->params >> 8) & 1].params); + sSpawnData[PARAMS_GET_U(this->dyna.actor.child->params, 8, 1)].params); } s32 func_80BA1ECC(ObjWarp2block* this, PlayState* play) { @@ -83,17 +83,17 @@ s32 func_80BA1ECC(ObjWarp2block* this, PlayState* play) { Vec3f sp20; f32 temp_f2; - if ((this->dyna.actor.xzDistToPlayer <= sDistances[(((this->dyna.actor.params >> 0xB) & 7))]) || - (temp_a3->xzDistToPlayer <= sDistances[(((temp_a3->params >> 0xB) & 7))])) { + if ((this->dyna.actor.xzDistToPlayer <= sDistances[PARAMS_GET_U(this->dyna.actor.params, 11, 3)]) || + (temp_a3->xzDistToPlayer <= sDistances[PARAMS_GET_U(temp_a3->params, 11, 3)])) { - func_8002DBD0(&this->dyna.actor, &sp20, &player->actor.world.pos); + Actor_WorldToActorCoords(&this->dyna.actor, &sp20, &player->actor.world.pos); temp_f2 = (this->dyna.actor.scale.x * 50.0f) + 6.0f; if (!(temp_f2 < fabsf(sp20.x)) && !(temp_f2 < fabsf(sp20.z))) { return 0; } - func_8002DBD0(temp_a3, &sp20, &player->actor.world.pos); + Actor_WorldToActorCoords(temp_a3, &sp20, &player->actor.world.pos); temp_f2 = (temp_a3->scale.x * 50.0f) + 6.0f; if (!(temp_f2 < fabsf(sp20.x)) && !(temp_f2 < fabsf(sp20.z))) { @@ -140,14 +140,15 @@ void ObjWarp2block_SwapWithChild(ObjWarp2block* this, PlayState* play) { this->dyna.actor.focus.rot = this->dyna.actor.child->focus.rot; this->dyna.actor.child->focus.rot = tempRot; - temp = this->dyna.actor.params & 0x7FFF; - this->dyna.actor.params = (this->dyna.actor.params & 0x8000) | (this->dyna.actor.child->params & 0x7FFF); - this->dyna.actor.child->params = (this->dyna.actor.child->params & 0x8000) | (temp & 0x7FFF); + temp = PARAMS_GET_U(this->dyna.actor.params, 0, 15); + this->dyna.actor.params = + PARAMS_GET_NOSHIFT(this->dyna.actor.params, 15, 1) | PARAMS_GET_U(this->dyna.actor.child->params, 0, 15); + this->dyna.actor.child->params = PARAMS_GET_NOSHIFT(this->dyna.actor.child->params, 15, 1) | (temp & 0x7FFF); if (Math3D_Vec3fDistSq(&this->dyna.actor.world.pos, &this->dyna.actor.home.pos) < 0.01f) { - Flags_UnsetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_UnsetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); } else { - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); } } @@ -201,13 +202,13 @@ void ObjWarp2block_Init(Actor* thisx, PlayState* play2) { this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = 0; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - Actor_SetScale(&this->dyna.actor, sSpawnData[(this->dyna.actor.params >> 8) & 1].scale); + Actor_SetScale(&this->dyna.actor, sSpawnData[PARAMS_GET_U(this->dyna.actor.params, 8, 1)].scale); this->func_168 = func_80BA2218; - Actor_SetFocus(&this->dyna.actor, sSpawnData[(this->dyna.actor.params >> 8) & 1].focus); + Actor_SetFocus(&this->dyna.actor, sSpawnData[PARAMS_GET_U(this->dyna.actor.params, 8, 1)].focus); - if ((this->dyna.actor.params >> 0xF) & 1) { + if (PARAMS_GET_U(this->dyna.actor.params, 15, 1)) { func_80BA24E8(this); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { this->dyna.actor.draw = NULL; } DynaPolyActor_Init(&this->dyna, 0); @@ -217,13 +218,14 @@ void ObjWarp2block_Init(Actor* thisx, PlayState* play2) { ObjWarp2block_SetInactive(this); } - PRINTF("時のブロック(ワープ2) ( %04xH color:%d range:%d)\n", this->dyna.actor.params & 0xFFFF, - this->dyna.actor.home.rot.z & 7, (this->dyna.actor.params >> 0xB) & 7); + PRINTF("時のブロック(ワープ2) ( %04xH color:%d range:%d)\n", + PARAMS_GET_U(this->dyna.actor.params, 0, 16), this->dyna.actor.home.rot.z & 7, + PARAMS_GET_U(this->dyna.actor.params, 11, 3)); } void ObjWarp2block_Destroy(Actor* thisx, PlayState* play) { ObjWarp2block* this = (ObjWarp2block*)thisx; - if ((this->dyna.actor.params >> 0xF) & 1) { + if (PARAMS_GET_U(this->dyna.actor.params, 15, 1)) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); } } @@ -244,10 +246,10 @@ void func_80BA24F8(ObjWarp2block* this, PlayState* play) { Actor* current = play->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; while (current != NULL) { - if (current->id == ACTOR_OBJ_WARP2BLOCK && !((current->params >> 0xF) & 1) && - ((this->dyna.actor.params & 0x3F) == (current->params & 0x3F))) { + if (current->id == ACTOR_OBJ_WARP2BLOCK && !PARAMS_GET_U(current->params, 15, 1) && + (PARAMS_GET_U(this->dyna.actor.params, 0, 6) == PARAMS_GET_U(current->params, 0, 6))) { this->dyna.actor.child = current; - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { ObjWarp2block_SwapWithChild(this, play); this->dyna.actor.draw = ObjWarp2block_Draw; } @@ -307,8 +309,7 @@ void ObjWarp2block_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_obj_warp2block.c", 584); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_warp2block.c", 588), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_obj_warp2block.c", 588); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sp44->r, sp44->g, sp44->b, 255); gSPDisplayList(POLY_OPA_DISP++, gSongOfTimeBlockDL); diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index 83bdcea4fd..6833366bec 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -43,7 +43,7 @@ static void* D_80BA5900[] = { gEffSunGraveSpark5Tex, gEffSunGraveSpark6Tex, gEffSunGraveSpark7Tex, gEffSunGraveSpark8Tex, }; -ActorInit Object_Kankyo_InitVars = { +ActorProfile Object_Kankyo_Profile = { /**/ ACTOR_OBJECT_KANKYO, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -571,7 +571,7 @@ void ObjectKankyo_DrawFairies(Actor* thisx, PlayState* play2) { Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); Matrix_RotateZ(DEG_TO_RAD(play->state.frames * 20.0f), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_object_kankyo.c", 913), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_object_kankyo.c", 913); gSPDisplayList(POLY_XLU_DISP++, gKokiriDustMoteModelDL); } CLOSE_DISPS(play->state.gfxCtx, "../z_object_kankyo.c", 922); @@ -692,7 +692,6 @@ void ObjectKankyo_DrawSnow(Actor* thisx, PlayState* play2) { break; } - if (1) {} if (1) {} Matrix_Translate(this->effects[i].base.x + this->effects[i].pos.x, this->effects[i].base.y + this->effects[i].pos.y, @@ -703,12 +702,12 @@ void ObjectKankyo_DrawSnow(Actor* thisx, PlayState* play2) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 200, 200, 180); gDPSetEnvColor(POLY_XLU_DISP++, 200, 200, 200, 180); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_object_kankyo.c", 1107), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_object_kankyo.c", 1107); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gDust5Tex)); Gfx_SetupDL_61Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, &D_01000000, G_MTX_MODELVIEW | G_MTX_NOPUSH | G_MTX_MUL); + gSPMatrix(POLY_XLU_DISP++, &D_01000000, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPPipeSync(POLY_XLU_DISP++); @@ -764,11 +763,11 @@ void ObjectKankyo_DrawLightning(Actor* thisx, PlayState* play) { Matrix_Scale(2.0f, 5.0f, 2.0f, MTXMODE_APPLY); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 128); gDPSetEnvColor(POLY_XLU_DISP++, 0, 255, 255, 128); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_object_kankyo.c", 1213), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_object_kankyo.c", 1213); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEffLightningTextures[this->effects[0].timer])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, this->effects[0].timer); Gfx_SetupDL_61Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, &D_01000000, G_MTX_MODELVIEW | G_MTX_NOPUSH | G_MTX_MUL); + gSPMatrix(POLY_XLU_DISP++, &D_01000000, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPPipeSync(POLY_XLU_DISP++); gSPDisplayList(POLY_XLU_DISP++, gEffLightningDL); gDPPipeSync(POLY_XLU_DISP++); @@ -862,10 +861,8 @@ void ObjectKankyo_DrawSunGraveSpark(Actor* thisx, PlayState* play2) { (u8)(255 * this->effects[0].amplitude), 255 - (u8)(255 * this->effects[0].amplitude), this->effects[0].alpha); - if (1) {} - Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_object_kankyo.c", 1416), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_object_kankyo.c", 1416); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80BA5900[this->effects[0].timer])); gDPPipeSync(POLY_XLU_DISP++); @@ -943,7 +940,7 @@ void ObjectKankyo_DrawBeams(Actor* thisx, PlayState* play2) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, sBeamPrimColors[i].r, sBeamPrimColors[i].g, sBeamPrimColors[i].b, 128); gDPSetEnvColor(POLY_XLU_DISP++, sBeamEnvColors[i].r, sBeamEnvColors[i].g, sBeamEnvColors[i].b, 128); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_object_kankyo.c", 1586), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_object_kankyo.c", 1586); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 5, play->state.frames * 10, 32, 64, 1, play->state.frames * 5, diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c index 4220f879e4..dd421a8128 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -16,7 +16,7 @@ void OceffSpot_Draw(Actor* thisx, PlayState* play); void OceffSpot_GrowCylinder(OceffSpot* this, PlayState* play); -ActorInit Oceff_Spot_InitVars = { +ActorProfile Oceff_Spot_Profile = { /**/ ACTOR_OCEFF_SPOT, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -154,8 +154,7 @@ void OceffSpot_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_oceff_spot.c", 469), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_oceff_spot.c", 469); gSPDisplayList(POLY_XLU_DISP++, sCylinderMaterialDL); gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, scroll * 2, scroll * (-2), 32, 32, 1, 0, scroll * (-8), 32, 32)); diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c index 0df7ced428..931b67930f 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -18,7 +18,7 @@ void OceffStorm_Draw2(Actor* thisx, PlayState* play); void OceffStorm_DefaultAction(OceffStorm* this, PlayState* play); void OceffStorm_UnkAction(OceffStorm* this, PlayState* play); -ActorInit Oceff_Storm_InitVars = { +ActorProfile Oceff_Storm_Profile = { /**/ ACTOR_OCEFF_STORM, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -162,8 +162,7 @@ void OceffStorm_Draw(Actor* thisx, PlayState* play) { vtxPtr[0].v.cn[3] = vtxPtr[6].v.cn[3] = vtxPtr[16].v.cn[3] = vtxPtr[25].v.cn[3] = this->vtxAlpha >> 1; vtxPtr[10].v.cn[3] = vtxPtr[22].v.cn[3] = this->vtxAlpha; - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_oceff_storm.c", 498), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_oceff_storm.c", 498); gSPDisplayList(POLY_XLU_DISP++, sCylinderMaterialDL); gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, scroll * 4, (0 - scroll) * 8, diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index b4a696fecd..986abc8b17 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -14,7 +14,7 @@ void OceffWipe_Destroy(Actor* thisx, PlayState* play); void OceffWipe_Update(Actor* thisx, PlayState* play); void OceffWipe_Draw(Actor* thisx, PlayState* play); -ActorInit Oceff_Wipe_InitVars = { +ActorProfile Oceff_Wipe_Profile = { /**/ ACTOR_OCEFF_WIPE, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -108,8 +108,7 @@ void OceffWipe_Draw(Actor* thisx, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Translate(0.0f, 0.0f, -z, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_oceff_wipe.c", 375), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_oceff_wipe.c", 375); if (this->actor.params != OCEFF_WIPE_ZL) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 170, 255, 255, 255); @@ -124,7 +123,5 @@ void OceffWipe_Draw(Actor* thisx, PlayState* play) { 32, 1, 0 - scroll, scroll * (-2), 32, 32)); gSPDisplayList(POLY_XLU_DISP++, sFrustumDL); - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_oceff_wipe.c", 398); } diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h index 0b26239bad..9e5131737c 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef enum { +typedef enum OceffWipeType { /* 0x00 */ OCEFF_WIPE_ZL, /* 0x01 */ OCEFF_WIPE_SOT } OceffWipeType; diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index 1f659aa1d3..1c07cdbf1f 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -14,7 +14,7 @@ void OceffWipe2_Destroy(Actor* thisx, PlayState* play); void OceffWipe2_Update(Actor* thisx, PlayState* play); void OceffWipe2_Draw(Actor* thisx, PlayState* play); -ActorInit Oceff_Wipe2_InitVars = { +ActorProfile Oceff_Wipe2_Profile = { /**/ ACTOR_OCEFF_WIPE2, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -96,8 +96,7 @@ void OceffWipe2_Draw(Actor* thisx, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Translate(0.0f, 0.0f, -z, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_oceff_wipe2.c", 400), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_oceff_wipe2.c", 400); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 170, 255); gDPSetEnvColor(POLY_XLU_DISP++, 255, 100, 0, 128); diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index f9fdd00cb5..5473c3da47 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -14,7 +14,7 @@ void OceffWipe3_Destroy(Actor* thisx, PlayState* play); void OceffWipe3_Update(Actor* thisx, PlayState* play); void OceffWipe3_Draw(Actor* thisx, PlayState* play); -ActorInit Oceff_Wipe3_InitVars = { +ActorProfile Oceff_Wipe3_Profile = { /**/ ACTOR_OCEFF_WIPE3, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -97,8 +97,7 @@ void OceffWipe3_Draw(Actor* thisx, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Translate(0.0f, 0.0f, -z, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_oceff_wipe3.c", 353), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_oceff_wipe3.c", 353); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 170, 255); gDPSetEnvColor(POLY_XLU_DISP++, 100, 200, 0, 128); diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index 954992a60f..445e395ff0 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -14,7 +14,7 @@ void OceffWipe4_Destroy(Actor* thisx, PlayState* play); void OceffWipe4_Update(Actor* thisx, PlayState* play); void OceffWipe4_Draw(Actor* thisx, PlayState* play); -ActorInit Oceff_Wipe4_InitVars = { +ActorProfile Oceff_Wipe4_Profile = { /**/ ACTOR_OCEFF_WIPE4, /**/ ACTORCAT_ITEMACTION, /**/ FLAGS, @@ -95,8 +95,7 @@ void OceffWipe4_Draw(Actor* thisx, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Translate(0.0f, 0.0f, -z, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_oceff_wipe4.c", 324), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_oceff_wipe4.c", 324); if (this->actor.params == OCEFF_WIPE4_UNUSED) { gSPDisplayList(POLY_XLU_DISP++, sUnusedMaterialDL); diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h index 6187289345..3986c1fce5 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef enum { +typedef enum OceffWipe4Type { /* 0x00 */ OCEFF_WIPE4_SCARECROWS, /* 0x01 */ OCEFF_WIPE4_UNUSED } OceffWipe4Type; diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index a6afa9baa9..3b8f64972f 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -10,7 +10,7 @@ #include "assets/scenes/overworld/spot06/spot06_scene.h" #include "terminal.h" -#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void ShotSun_Init(Actor* thisx, PlayState* play); void ShotSun_Destroy(Actor* thisx, PlayState* play); @@ -21,7 +21,7 @@ void ShotSun_TriggerFairy(ShotSun* this, PlayState* play); void ShotSun_UpdateFairySpawner(ShotSun* this, PlayState* play); void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play); -ActorInit Shot_Sun_InitVars = { +ActorProfile Shot_Sun_Profile = { /**/ ACTOR_SHOT_SUN, /**/ ACTORCAT_PROP, /**/ FLAGS, @@ -33,7 +33,7 @@ ActorInit Shot_Sun_InitVars = { /**/ NULL, }; -typedef enum { +typedef enum FairySpawnerState { /* 0 */ SPAWNER_OUT_OF_RANGE, /* 1 */ SPAWNER_OCARINA_START, /* 2 */ SPAWNER_OCARINA_PLAYING @@ -41,7 +41,7 @@ typedef enum { static ColliderCylinderInit sCylinderInit = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, @@ -49,7 +49,7 @@ static ColliderCylinderInit sCylinderInit = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK0, + ELEM_MATERIAL_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000020, 0x00, 0x00 }, ATELEM_NONE, @@ -65,24 +65,24 @@ void ShotSun_Init(Actor* thisx, PlayState* play) { // "Ocarina secret occurrence" PRINTF("%d ---- オカリナの秘密発生!!!!!!!!!!!!!\n", this->actor.params); - params = this->actor.params & 0xFF; + params = PARAMS_GET_U(this->actor.params, 0, 8); if (params == 0x40 || params == 0x41) { this->fairySpawnerState = SPAWNER_OUT_OF_RANGE; this->actor.flags |= ACTOR_FLAG_4; this->actor.flags |= ACTOR_FLAG_25; this->actionFunc = ShotSun_UpdateFairySpawner; - this->actor.flags |= ACTOR_FLAG_27; + this->actor.flags |= ACTOR_FLAG_LOCK_ON_DISABLED; } else { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actionFunc = ShotSun_UpdateHyliaSun; - this->actor.flags &= ~ACTOR_FLAG_0; + this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } } void ShotSun_Destroy(Actor* thisx, PlayState* play) { ShotSun* this = (ShotSun*)thisx; - s32 params = this->actor.params & 0xFF; + s32 params = PARAMS_GET_U(this->actor.params, 0, 8); if (params != 0x40 && params != 0x41) { Collider_DestroyCylinder(play, &this->collider); @@ -90,7 +90,7 @@ void ShotSun_Destroy(Actor* thisx, PlayState* play) { } void ShotSun_SpawnFairy(ShotSun* this, PlayState* play) { - s32 params = this->actor.params & 0xFF; + s32 params = PARAMS_GET_U(this->actor.params, 0, 8); s32 fairyType; if (this->timer > 0) { @@ -128,7 +128,7 @@ void ShotSun_TriggerFairy(ShotSun* this, PlayState* play) { void ShotSun_UpdateFairySpawner(ShotSun* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 pad; - s32 params = this->actor.params & 0xFF; + s32 params = PARAMS_GET_U(this->actor.params, 0, 8); if (Math3D_Vec3fDistSq(&this->actor.world.pos, &player->actor.world.pos) > SQ(150.0f)) { this->fairySpawnerState = SPAWNER_OUT_OF_RANGE; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 958351e75c..334c9704f8 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -7,10 +7,10 @@ #include "ultra64.h" #include "global.h" #include "quake.h" +#include "versions.h" #include "overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h" #include "overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h" -#include "overlays/actors/ovl_Door_Shutter/z_door_shutter.h" #include "overlays/actors/ovl_En_Boom/z_en_boom.h" #include "overlays/actors/ovl_En_Arrow/z_en_arrow.h" #include "overlays/actors/ovl_En_Box/z_en_box.h" @@ -29,7 +29,7 @@ // This is called "adjusted" for now. #define PLAYER_ANIM_ADJUSTED_SPEED (2.0f / 3.0f) -typedef struct { +typedef struct GetItemEntry { /* 0x00 */ u8 itemId; /* 0x01 */ u8 field; // various bit-packed data /* 0x02 */ s8 gi; // defines the draw id and chest opening animation @@ -46,24 +46,17 @@ typedef struct { #define GET_ITEM_NONE \ { ITEM_NONE, 0, 0, 0, OBJECT_INVALID } -typedef struct { +typedef struct ExplosiveInfo { /* 0x00 */ u8 itemId; /* 0x02 */ s16 actorId; } ExplosiveInfo; // size = 0x04 -typedef struct { - /* 0x00 */ s16 actorId; - /* 0x02 */ u8 itemId; - /* 0x03 */ u8 itemAction; - /* 0x04 */ u8 textId; -} BottleCatchInfo; // size = 0x06 - -typedef struct { +typedef struct BottleDropInfo { /* 0x00 */ s16 actorId; /* 0x02 */ s16 actorParams; } BottleDropInfo; // size = 0x04 -typedef struct { +typedef struct FallImpactInfo { /* 0x00 */ s8 damage; /* 0x01 */ u8 rumbleStrength; /* 0x02 */ u8 rumbleDuration; @@ -71,21 +64,21 @@ typedef struct { /* 0x04 */ u16 sfxId; } FallImpactInfo; // size = 0x06 -typedef struct { +typedef struct SpecialRespawnInfo { /* 0x00 */ Vec3f pos; /* 0x0C */ s16 yaw; } SpecialRespawnInfo; // size = 0x10 -typedef enum { - /* 1 */ ANIMSFX_TYPE_1 = 1, - /* 2 */ ANIMSFX_TYPE_2, - /* 3 */ ANIMSFX_TYPE_3, - /* 4 */ ANIMSFX_TYPE_4, - /* 5 */ ANIMSFX_TYPE_5, - /* 6 */ ANIMSFX_TYPE_6, - /* 7 */ ANIMSFX_TYPE_7, - /* 8 */ ANIMSFX_TYPE_8, - /* 9 */ ANIMSFX_TYPE_9 +typedef enum AnimSfxType { + /* 1 */ ANIMSFX_TYPE_GENERAL = 1, + /* 2 */ ANIMSFX_TYPE_FLOOR, + /* 3 */ ANIMSFX_TYPE_FLOOR_BY_AGE, + /* 4 */ ANIMSFX_TYPE_VOICE, + /* 5 */ ANIMSFX_TYPE_LANDING, // `AnimSfxEntry.sfxId` is ignored. Adjusted for Iron Boots if needed. + /* 6 */ ANIMSFX_TYPE_RUNNING, // `AnimSfxEntry.sfxId` is ignored. Adjusted for Iron Boots if needed. + /* 7 */ ANIMSFX_TYPE_JUMPING, // `AnimSfxEntry.sfxId` is ignored. Adjusted for Iron Boots if needed. + /* 8 */ ANIMSFX_TYPE_WALKING, // `AnimSfxEntry.sfxId` is ignored. Adjusted for Iron Boots if needed. + /* 9 */ ANIMSFX_TYPE_UNKNOWN // `AnimSfxEntry.sfxId` is ignored. Only used in the intro cutscene. } AnimSfxType; #define ANIMSFX_SHIFT_TYPE(type) ((type) << 11) @@ -95,29 +88,22 @@ typedef enum { #define ANIMSFX_GET_TYPE(data) ((data)&0x7800) #define ANIMSFX_GET_FRAME(data) ((data)&0x7FF) -typedef struct { +typedef struct AnimSfxEntry { /* 0x00 */ u16 sfxId; /* 0x02 */ s16 data; } AnimSfxEntry; // size = 0x04 -typedef struct { +typedef struct struct_808551A4 { /* 0x00 */ u16 unk_00; /* 0x02 */ s16 unk_02; } struct_808551A4; // size = 0x04 -typedef struct { +typedef struct ItemChangeInfo { /* 0x00 */ LinkAnimationHeader* anim; /* 0x04 */ u8 changeFrame; } ItemChangeInfo; // size = 0x08 -typedef struct { - /* 0x00 */ LinkAnimationHeader* unk_00; - /* 0x04 */ LinkAnimationHeader* unk_04; - /* 0x08 */ u8 unk_08; - /* 0x09 */ u8 unk_09; -} struct_80854554; // size = 0x0C - -typedef struct { +typedef struct struct_80854190 { /* 0x00 */ LinkAnimationHeader* unk_00; /* 0x04 */ LinkAnimationHeader* unk_04; /* 0x08 */ LinkAnimationHeader* unk_08; @@ -125,13 +111,13 @@ typedef struct { /* 0x0D */ u8 unk_0D; } struct_80854190; // size = 0x10 -typedef struct { +typedef struct struct_80854578 { /* 0x00 */ LinkAnimationHeader* anim; /* 0x04 */ f32 unk_04; /* 0x04 */ f32 unk_08; } struct_80854578; // size = 0x0C -typedef struct { +typedef struct struct_80854B18 { /* 0x00 */ s8 type; /* 0x04 */ union { void* ptr; @@ -236,7 +222,9 @@ void func_808521F4(PlayState* play, Player* this, CsCmdActorCue* cue); void func_80852234(PlayState* play, Player* this, CsCmdActorCue* cue); void func_8085225C(PlayState* play, Player* this, CsCmdActorCue* cue); void func_80852280(PlayState* play, Player* this, CsCmdActorCue* cue); +#if OOT_VERSION >= PAL_1_0 void func_80852358(PlayState* play, Player* this, CsCmdActorCue* cue); +#endif void func_80852388(PlayState* play, Player* this, CsCmdActorCue* cue); void func_80852298(PlayState* play, Player* this, CsCmdActorCue* cue); void func_80852328(PlayState* play, Player* this, CsCmdActorCue* cue); @@ -263,18 +251,18 @@ s32 func_80852F38(PlayState* play, Player* this); s32 Player_TryCsAction(PlayState* play, Actor* actor, s32 csAction); void func_80853080(Player* this, PlayState* play); s32 Player_InflictDamage(PlayState* play, s32 damage); -void func_80853148(PlayState* play, Actor* actor); +void Player_StartTalking(PlayState* play, Actor* actor); u32 Player_GetGIAllocSize(); void Player_Action_80840450(Player* this, PlayState* play); void Player_Action_808407CC(Player* this, PlayState* play); -void Player_Action_80840BC8(Player* this, PlayState* play); +void Player_Action_Idle(Player* this, PlayState* play); void Player_Action_80840DE4(Player* this, PlayState* play); void Player_Action_808414F8(Player* this, PlayState* play); void Player_Action_8084170C(Player* this, PlayState* play); void Player_Action_808417FC(Player* this, PlayState* play); void Player_Action_8084193C(Player* this, PlayState* play); -void Player_Action_80841BA8(Player* this, PlayState* play); +void Player_Action_TurnInPlace(Player* this, PlayState* play); void Player_Action_80842180(Player* this, PlayState* play); void Player_Action_8084227C(Player* this, PlayState* play); void Player_Action_8084279C(Player* this, PlayState* play); @@ -288,7 +276,7 @@ void Player_Action_80843954(Player* this, PlayState* play); void Player_Action_80843A38(Player* this, PlayState* play); void Player_Action_80843CEC(Player* this, PlayState* play); void Player_Action_8084411C(Player* this, PlayState* play); -void Player_Action_80844708(Player* this, PlayState* play); +void Player_Action_Roll(Player* this, PlayState* play); void Player_Action_80844A44(Player* this, PlayState* play); void Player_Action_80844AF4(Player* this, PlayState* play); void Player_Action_80844E68(Player* this, PlayState* play); @@ -306,7 +294,7 @@ void Player_Action_80846408(Player* this, PlayState* play); void Player_Action_808464B0(Player* this, PlayState* play); void Player_Action_80846578(Player* this, PlayState* play); void Player_Action_8084B1D8(Player* this, PlayState* play); -void Player_Action_8084B530(Player* this, PlayState* play); +void Player_Action_Talk(Player* this, PlayState* play); void Player_Action_8084B78C(Player* this, PlayState* play); void Player_Action_8084B898(Player* this, PlayState* play); void Player_Action_8084B9E4(Player* this, PlayState* play); @@ -331,11 +319,11 @@ void Player_Action_8084E604(Player* this, PlayState* play); void Player_Action_8084E6D4(Player* this, PlayState* play); void Player_Action_8084E9AC(Player* this, PlayState* play); void Player_Action_8084EAC0(Player* this, PlayState* play); -void Player_Action_8084ECA4(Player* this, PlayState* play); +void Player_Action_SwingBottle(Player* this, PlayState* play); void Player_Action_8084EED8(Player* this, PlayState* play); void Player_Action_8084EFC0(Player* this, PlayState* play); -void Player_Action_8084F104(Player* this, PlayState* play); -void Player_Action_8084F390(Player* this, PlayState* play); +void Player_Action_ExchangeItem(Player* this, PlayState* play); +void Player_Action_SlideOnSlope(Player* this, PlayState* play); void Player_Action_8084F608(Player* this, PlayState* play); void Player_Action_8084F698(Player* this, PlayState* play); void Player_Action_8084F710(Player* this, PlayState* play); @@ -357,22 +345,22 @@ void Player_Action_CsAction(Player* this, PlayState* play); // .bss part 1 -// For retail BSS ordering, the block number of sDogSpawnPos in Player_Update -// must be between 0 and 53 inclusive. - -// TODO: There's probably a way to do this with less padding by spreading the variables out and moving -// data around. It would be easier if we had more options for controlling BSS ordering in debug. -#pragma increment_block_number 30 +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:128 pal-1.0:128 pal-1.1:128" static s32 D_80858AA0; -#pragma increment_block_number 250 +// TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving +// data around. It would be easier if we had more options for controlling BSS ordering in debug. +#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \ + "ntsc-1.2:192 pal-1.0:192 pal-1.1:192" -static s32 D_80858AA4; +static s32 sSavedCurrentMask; static Vec3f sInteractWallCheckResult; static Input* sControlInput; -#pragma increment_block_number 50 +#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160 gc-us-mq:160" \ + "ntsc-1.2:128 pal-1.0:128 pal-1.1:128" // .data @@ -514,8 +502,8 @@ static s16 sControlStickAngle = 0; static s16 sControlStickWorldYaw = 0; static s32 sUpperBodyIsBusy = false; // see `Player_UpdateUpperBody` static s32 sFloorType = FLOOR_TYPE_0; -static f32 D_808535E8 = 1.0f; -static f32 D_808535EC = 1.0f; +static f32 sWaterSpeedFactor = 1.0f; // Set to 0.5f in water, 1.0f otherwise. Influences different speed values. +static f32 sInvWaterSpeedFactor = 1.0f; // Inverse of `sWaterSpeedFactor` (1.0f / sWaterSpeedFactor) static u32 sTouchedWallFlags = 0; static u32 sConveyorSpeed = CONVEYOR_SPEED_DISABLED; static s16 sIsFloorConveyor = false; @@ -1119,80 +1107,181 @@ static LinkAnimationHeader* D_80853D4C[][3] = { &gPlayerAnim_link_fighter_Rside_jump_endR }, }; -static LinkAnimationHeader* D_80853D7C[][2] = { +typedef enum FidgetType { + /* 0x00 */ FIDGET_LOOK_AROUND, // ROOM_ENV_DEFAULT + /* 0x01 */ FIDGET_COLD, // ROOM_ENV_COLD + /* 0x02 */ FIDGET_WARM, // ROOM_ENV_WARM + /* 0x03 */ FIDGET_HOT, // ROOM_ENV_HOT (same animations as FIDGET_WARM) + /* 0x04 */ FIDGET_STRETCH_1, // ROOM_ENV_UNK_STRETCH_1 + /* 0x05 */ FIDGET_STRETCH_2, // ROOM_ENV_UNK_STRETCH_1 (same animations as FIDGET_STRETCH_1) + /* 0x06 */ FIDGET_STRETCH_3, // ROOM_ENV_UNK_STRETCH_1 (same animations as FIDGET_STRETCH_1) + /* 0x07 */ FIDGET_CRIT_HEALTH_START, + /* 0x08 */ FIDGET_CRIT_HEALTH_LOOP, + /* 0x09 */ FIDGET_SWORD_SWING, + /* 0x0A */ FIDGET_ADJUST_TUNIC, + /* 0x0B */ FIDGET_TAP_FEET, + /* 0x0C */ FIDGET_ADJUST_SHIELD, + /* 0x0D */ FIDGET_SWORD_SWING_TWO_HAND +} FidgetType; + +static LinkAnimationHeader* sFidgetAnimations[][2] = { + // FIDGET_LOOK_AROUND { &gPlayerAnim_link_normal_wait_typeA_20f, &gPlayerAnim_link_normal_waitF_typeA_20f }, + + // FIDGET_COLD { &gPlayerAnim_link_normal_wait_typeC_20f, &gPlayerAnim_link_normal_waitF_typeC_20f }, + + // FIDGET_WARM { &gPlayerAnim_link_normal_wait_typeB_20f, &gPlayerAnim_link_normal_waitF_typeB_20f }, + + // FIDGET_HOT { &gPlayerAnim_link_normal_wait_typeB_20f, &gPlayerAnim_link_normal_waitF_typeB_20f }, + + // FIDGET_STRETCH_1 { &gPlayerAnim_link_wait_typeD_20f, &gPlayerAnim_link_waitF_typeD_20f }, + + // FIDGET_STRETCH_2 { &gPlayerAnim_link_wait_typeD_20f, &gPlayerAnim_link_waitF_typeD_20f }, + + // FIDGET_STRETCH_3 { &gPlayerAnim_link_wait_typeD_20f, &gPlayerAnim_link_waitF_typeD_20f }, + + // FIDGET_CRIT_HEALTH_START { &gPlayerAnim_link_wait_heat1_20f, &gPlayerAnim_link_waitF_heat1_20f }, + + // FIDGET_CRIT_HEALTH_LOOP { &gPlayerAnim_link_wait_heat2_20f, &gPlayerAnim_link_waitF_heat2_20f }, + + // FIDGET_SWORD_SWING { &gPlayerAnim_link_wait_itemD1_20f, &gPlayerAnim_link_wait_itemD1_20f }, + + // FIDGET_ADJUST_TUNIC { &gPlayerAnim_link_wait_itemA_20f, &gPlayerAnim_link_waitF_itemA_20f }, + + // FIDGET_TAP_FEET { &gPlayerAnim_link_wait_itemB_20f, &gPlayerAnim_link_waitF_itemB_20f }, + + // FIDGET_ADJUST_SHIELD { &gPlayerAnim_link_wait_itemC_20f, &gPlayerAnim_link_wait_itemC_20f }, + + // FIDGET_SWORD_SWING_TWO_HAND { &gPlayerAnim_link_wait_itemD2_20f, &gPlayerAnim_link_wait_itemD2_20f } }; -static AnimSfxEntry D_80853DEC[] = { - { NA_SE_VO_LI_SNEEZE, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 8) }, +static AnimSfxEntry sFidgetAnimSfxSneeze[] = { + { NA_SE_VO_LI_SNEEZE, -ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 8) }, }; -static AnimSfxEntry D_80853DF0[] = { - { NA_SE_VO_LI_SWEAT, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 18) }, +static AnimSfxEntry sFidgetAnimSfxSweat[] = { + { NA_SE_VO_LI_SWEAT, -ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 18) }, }; -static AnimSfxEntry D_80853DF4[] = { - { NA_SE_VO_LI_BREATH_REST, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 13) }, +static AnimSfxEntry sFidgetAnimSfxCritHealthStart[] = { + { NA_SE_VO_LI_BREATH_REST, -ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 13) }, }; -static AnimSfxEntry D_80853DF8[] = { - { NA_SE_VO_LI_BREATH_REST, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 10) }, +static AnimSfxEntry sFidgetAnimSfxCritHealthLoop[] = { + { NA_SE_VO_LI_BREATH_REST, -ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 10) }, }; -static AnimSfxEntry D_80853DFC[] = { - { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_1, 44) }, { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_1, 48) }, - { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_1, 52) }, { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_1, 56) }, - { NA_SE_PL_CALM_HIT, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 60) }, +static AnimSfxEntry sFidgetAnimSfxTunic[] = { + { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 44) }, + { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 48) }, + { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 52) }, + { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 56) }, + { NA_SE_PL_CALM_HIT, -ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 60) }, }; -static AnimSfxEntry D_80853E10[] = { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 25) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 30) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 44) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 48) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 52) }, { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_8, 56) }, +static AnimSfxEntry sFidgetAnimSfxTapFeet[] = { + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 25) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 30) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 44) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 48) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 52) }, { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 56) }, }; -static AnimSfxEntry D_80853E28[] = { - { NA_SE_IT_SHIELD_POSTURE, ANIMSFX_DATA(ANIMSFX_TYPE_1, 16) }, - { NA_SE_IT_SHIELD_POSTURE, ANIMSFX_DATA(ANIMSFX_TYPE_1, 20) }, - { NA_SE_IT_SHIELD_POSTURE, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 70) }, +static AnimSfxEntry sFidgetAnimSfxShield[] = { + { NA_SE_IT_SHIELD_POSTURE, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 16) }, + { NA_SE_IT_SHIELD_POSTURE, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 20) }, + { NA_SE_IT_SHIELD_POSTURE, -ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 70) }, }; -static AnimSfxEntry D_80853E34[] = { - { NA_SE_IT_HAMMER_SWING, ANIMSFX_DATA(ANIMSFX_TYPE_1, 10) }, - { NA_SE_VO_LI_AUTO_JUMP, ANIMSFX_DATA(ANIMSFX_TYPE_4, 10) }, - { NA_SE_IT_SWORD_SWING, ANIMSFX_DATA(ANIMSFX_TYPE_1, 22) }, - { NA_SE_VO_LI_SWORD_N, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 22) }, +static AnimSfxEntry sFidgetAnimSfxSword[] = { + { NA_SE_IT_HAMMER_SWING, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 10) }, + { NA_SE_VO_LI_AUTO_JUMP, ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 10) }, + { NA_SE_IT_SWORD_SWING, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 22) }, + { NA_SE_VO_LI_SWORD_N, -ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 22) }, }; -static AnimSfxEntry D_80853E44[] = { - { NA_SE_IT_SWORD_SWING, ANIMSFX_DATA(ANIMSFX_TYPE_1, 39) }, - { NA_SE_VO_LI_SWORD_N, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 39) }, +static AnimSfxEntry sFidgetAnimSfxSwordTwoHand[] = { + { NA_SE_IT_SWORD_SWING, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 39) }, + { NA_SE_VO_LI_SWORD_N, -ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 39) }, }; -static AnimSfxEntry D_80853E4C[] = { - { NA_SE_VO_LI_RELAX, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 20) }, +static AnimSfxEntry sFidgetAnimSfxStretch[] = { + { NA_SE_VO_LI_RELAX, -ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 20) }, }; -static AnimSfxEntry* D_80853E50[] = { - D_80853DEC, D_80853DF0, D_80853DF4, D_80853DF8, D_80853DFC, D_80853E10, - D_80853E28, D_80853E34, D_80853E44, D_80853E4C, NULL, +typedef enum FidgetAnimSfxType { + /* 0x0 */ FIDGET_ANIMSFX_NONE, + /* 0x1 */ FIDGET_ANIMSFX_SNEEZE, + /* 0x2 */ FIDGET_ANIMSFX_SWEAT, + /* 0x3 */ FIDGET_ANIMSFX_CRIT_HEALTH_START, + /* 0x4 */ FIDGET_ANIMSFX_CRIT_HEALTH_LOOP, + /* 0x5 */ FIDGET_ANIMSFX_TUNIC, + /* 0x6 */ FIDGET_ANIMSFX_TAP_FEET, + /* 0x7 */ FIDGET_ANIMSFX_SHIELD, + /* 0x8 */ FIDGET_ANIMSFX_SWORD, + /* 0x9 */ FIDGET_ANIMSFX_SWORD_TWO_HAND, + /* 0xA */ FIDGET_ANIMSFX_STRETCH +} FidgetAnimSfxType; + +static AnimSfxEntry* sFidgetAnimSfxLists[] = { + sFidgetAnimSfxSneeze, // FIDGET_ANIMSFX_SNEEZE + sFidgetAnimSfxSweat, // FIDGET_ANIMSFX_SWEAT + sFidgetAnimSfxCritHealthStart, // FIDGET_ANIMSFX_CRIT_HEALTH_START + sFidgetAnimSfxCritHealthLoop, // FIDGET_ANIMSFX_CRIT_HEALTH_LOOP + sFidgetAnimSfxTunic, // FIDGET_ANIMSFX_TUNIC + sFidgetAnimSfxTapFeet, // FIDGET_ANIMSFX_TAP_FEET + sFidgetAnimSfxShield, // FIDGET_ANIMSFX_SHIELD + sFidgetAnimSfxSword, // FIDGET_ANIMSFX_SWORD + sFidgetAnimSfxSwordTwoHand, // FIDGET_ANIMSFX_SWORD_TWO_HAND + sFidgetAnimSfxStretch, // FIDGET_ANIMSFX_STRETCH + NULL, // unused entry }; -static u8 D_80853E7C[] = { - 0, 0, 1, 1, 2, 2, 2, 2, 10, 10, 10, 10, 10, 10, 3, 3, 4, 4, 8, 8, 5, 5, 6, 6, 7, 7, 9, 9, 0, +/** + * The indices in this array correspond 1 to 1 with the entries of sFidgetAnimations. + * There is also an extra FIDGET_ANIMSFX_NONE at the end that doesn't correspond to any animation. + */ +static u8 sFidgetAnimSfxTypes[] = { + FIDGET_ANIMSFX_NONE, // FIDGET_LOOK_AROUND + FIDGET_ANIMSFX_NONE, // FIDGET_LOOK_AROUND (sword/shield in hand) + FIDGET_ANIMSFX_SNEEZE, // FIDGET_COLD + FIDGET_ANIMSFX_SNEEZE, // FIDGET_COLD (sword/shield in hand) + FIDGET_ANIMSFX_SWEAT, // FIDGET_WARM + FIDGET_ANIMSFX_SWEAT, // FIDGET_WARM (sword/shield in hand) + FIDGET_ANIMSFX_SWEAT, // FIDGET_HOT + FIDGET_ANIMSFX_SWEAT, // FIDGET_HOT (sword/shield in hand) + FIDGET_ANIMSFX_STRETCH, // FIDGET_STRETCH_1 + FIDGET_ANIMSFX_STRETCH, // FIDGET_STRETCH_1 (sword/shield in hand) + FIDGET_ANIMSFX_STRETCH, // FIDGET_STRETCH_2 + FIDGET_ANIMSFX_STRETCH, // FIDGET_STRETCH_2 (sword/shield in hand) + FIDGET_ANIMSFX_STRETCH, // FIDGET_STRETCH_3 + FIDGET_ANIMSFX_STRETCH, // FIDGET_STRETCH_3 (sword/shield in hand) + FIDGET_ANIMSFX_CRIT_HEALTH_START, // FIDGET_CRIT_HEALTH_START + FIDGET_ANIMSFX_CRIT_HEALTH_START, // FIDGET_CRIT_HEALTH_START (sword/shield in hand) + FIDGET_ANIMSFX_CRIT_HEALTH_LOOP, // FIDGET_CRIT_HEALTH_LOOP + FIDGET_ANIMSFX_CRIT_HEALTH_LOOP, // FIDGET_CRIT_HEALTH_LOOP (sword/shield in hand) + FIDGET_ANIMSFX_SWORD, // FIDGET_SWORD_SWING + FIDGET_ANIMSFX_SWORD, // FIDGET_SWORD_SWING (sword/shield in hand) + FIDGET_ANIMSFX_TUNIC, // FIDGET_ADJUST_TUNIC + FIDGET_ANIMSFX_TUNIC, // FIDGET_ADJUST_TUNIC (sword/shield in hand) + FIDGET_ANIMSFX_TAP_FEET, // FIDGET_TAP_FEET + FIDGET_ANIMSFX_TAP_FEET, // FIDGET_TAP_FEET (sword/shield in hand) + FIDGET_ANIMSFX_SHIELD, // FIDGET_ADJUST_SHIELD + FIDGET_ANIMSFX_SHIELD, // FIDGET_ADJUST_SHIELD (sword/shield in hand) + FIDGET_ANIMSFX_SWORD_TWO_HAND, // FIDGET_SWORD_SWING_TWO_HAND + FIDGET_ANIMSFX_SWORD_TWO_HAND, // FIDGET_SWORD_SWING_TWO_HAND (sword/shield in hand) + FIDGET_ANIMSFX_NONE, // unused, doesnt correspond to any animation }; // Used to map item IDs to item actions @@ -1401,7 +1490,7 @@ static void (*sItemActionInitFuncs[])(PlayState* play, Player* this) = { Player_InitDefaultIA, // PLAYER_IA_LENS_OF_TRUTH }; -typedef enum { +typedef enum ItemChangeType { /* 0 */ PLAYER_ITEM_CHG_0, /* 1 */ PLAYER_ITEM_CHG_1, /* 2 */ PLAYER_ITEM_CHG_2, @@ -1631,7 +1720,7 @@ BAD_RETURN(s32) func_80832224(Player* this) { this->unk_6AD = 0; } -s32 func_8083224C(PlayState* play) { +s32 Player_IsTalking(PlayState* play) { Player* this = GET_PLAYER(play); return CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_TALK); @@ -1653,7 +1742,7 @@ void Player_AnimPlayOnceAdjusted(PlayState* play, Player* this, LinkAnimationHea LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, anim, PLAYER_ANIM_ADJUSTED_SPEED); } -void func_808322FC(Player* this) { +void Player_ApplyYawFromAnim(Player* this) { this->actor.shape.rot.y += this->skelAnime.jointTable[1].y; this->skelAnime.jointTable[1].y = 0; } @@ -1686,24 +1775,32 @@ void Player_DetachHeldActor(PlayState* play, Player* this) { this->heldActor = NULL; this->interactRangeActor = NULL; heldActor->parent = NULL; - this->stateFlags1 &= ~PLAYER_STATE1_11; + this->stateFlags1 &= ~PLAYER_STATE1_CARRYING_ACTOR; +#if OOT_VERSION < NTSC_1_1 + if (Player_GetExplosiveHeld(this) >= 0) { + Player_InitItemAction(play, this, PLAYER_IA_NONE); + this->heldItemId = ITEM_NONE_FE; + } +#endif } +#if OOT_VERSION >= NTSC_1_1 if (Player_GetExplosiveHeld(this) >= 0) { Player_InitItemAction(play, this, PLAYER_IA_NONE); this->heldItemId = ITEM_NONE_FE; } +#endif } void func_80832440(PlayState* play, Player* this) { - if ((this->stateFlags1 & PLAYER_STATE1_11) && (this->heldActor == NULL)) { + if ((this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (this->heldActor == NULL)) { if (this->interactRangeActor != NULL) { if (this->getItemId == GI_NONE) { - this->stateFlags1 &= ~PLAYER_STATE1_11; + this->stateFlags1 &= ~PLAYER_STATE1_CARRYING_ACTOR; this->interactRangeActor = NULL; } } else { - this->stateFlags1 &= ~PLAYER_STATE1_11; + this->stateFlags1 &= ~PLAYER_STATE1_CARRYING_ACTOR; } } @@ -1765,7 +1862,7 @@ void Player_RequestRumble(Player* this, s32 sourceStrength, s32 duration, s32 de } } -void func_80832698(Player* this, u16 sfxId) { +void Player_PlayVoiceSfx(Player* this, u16 sfxId) { if (this->actor.category == ACTORCAT_PLAYER) { Player_PlaySfx(this, sfxId + this->ageProperties->unk_92); } else { @@ -1783,53 +1880,53 @@ void func_808326F0(Player* this) { } } -u16 func_8083275C(Player* this, u16 sfxId) { +u16 Player_ApplyFloorSfxOffset(Player* this, u16 sfxId) { return sfxId + this->floorSfxOffset; } -void func_80832770(Player* this, u16 sfxId) { - Player_PlaySfx(this, func_8083275C(this, sfxId)); +void Player_PlayFloorSfx(Player* this, u16 sfxId) { + Player_PlaySfx(this, Player_ApplyFloorSfxOffset(this, sfxId)); } -u16 func_808327A4(Player* this, u16 sfxId) { +u16 Player_ApplyFloorAndAgeSfxOffsets(Player* this, u16 sfxId) { return sfxId + this->floorSfxOffset + this->ageProperties->unk_94; } -void func_808327C4(Player* this, u16 sfxId) { - Player_PlaySfx(this, func_808327A4(this, sfxId)); +void Player_PlayFloorSfxByAge(Player* this, u16 sfxId) { + Player_PlaySfx(this, Player_ApplyFloorAndAgeSfxOffsets(this, sfxId)); } -void func_808327F8(Player* this, f32 arg1) { +void Player_PlaySteppingSfx(Player* this, f32 pitchAdjustment) { s32 sfxId; if (this->currentBoots == PLAYER_BOOTS_IRON) { sfxId = NA_SE_PL_WALK_GROUND + SURFACE_SFX_OFFSET_IRON_BOOTS; } else { - sfxId = func_808327A4(this, NA_SE_PL_WALK_GROUND); + sfxId = Player_ApplyFloorAndAgeSfxOffsets(this, NA_SE_PL_WALK_GROUND); } - func_800F4010(&this->actor.projectedPos, sfxId, arg1); + func_800F4010(&this->actor.projectedPos, sfxId, pitchAdjustment); } -void func_80832854(Player* this) { +void Player_PlayJumpingSfx(Player* this) { s32 sfxId; if (this->currentBoots == PLAYER_BOOTS_IRON) { sfxId = NA_SE_PL_JUMP + SURFACE_SFX_OFFSET_IRON_BOOTS; } else { - sfxId = func_808327A4(this, NA_SE_PL_JUMP); + sfxId = Player_ApplyFloorAndAgeSfxOffsets(this, NA_SE_PL_JUMP); } Player_PlaySfx(this, sfxId); } -void func_808328A0(Player* this) { +void Player_PlayLandingSfx(Player* this) { s32 sfxId; if (this->currentBoots == PLAYER_BOOTS_IRON) { sfxId = NA_SE_PL_LAND + SURFACE_SFX_OFFSET_IRON_BOOTS; } else { - sfxId = func_808327A4(this, NA_SE_PL_LAND); + sfxId = Player_ApplyFloorAndAgeSfxOffsets(this, NA_SE_PL_LAND); } Player_PlaySfx(this, sfxId); @@ -1861,26 +1958,29 @@ void Player_ProcessAnimSfxList(Player* this, AnimSfxEntry* entry) { s32 type = ANIMSFX_GET_TYPE(absData); if (LinkAnimation_OnFrame(&this->skelAnime, fabsf(ANIMSFX_GET_FRAME(absData)))) { - if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_1)) { + if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_GENERAL)) { Player_PlaySfx(this, entry->sfxId); - } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_2)) { - func_80832770(this, entry->sfxId); - } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_3)) { - func_808327C4(this, entry->sfxId); - } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_4)) { - func_80832698(this, entry->sfxId); - } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_5)) { - func_808328A0(this); - } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_6)) { - func_808327F8(this, 6.0f); - } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_7)) { - func_80832854(this); - } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_8)) { - func_808327F8(this, 0.0f); - } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_9)) { + } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_FLOOR)) { + Player_PlayFloorSfx(this, entry->sfxId); + } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_FLOOR_BY_AGE)) { + Player_PlayFloorSfxByAge(this, entry->sfxId); + } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_VOICE)) { + Player_PlayVoiceSfx(this, entry->sfxId); + } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_LANDING)) { + Player_PlayLandingSfx(this); + } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_RUNNING)) { + Player_PlaySteppingSfx(this, 6.0f); + } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_JUMPING)) { + Player_PlayJumpingSfx(this); + } else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_WALKING)) { + Player_PlaySteppingSfx(this, 0.0f); + } +#if OOT_VERSION >= PAL_1_0 + else if (type == ANIMSFX_SHIFT_TYPE(ANIMSFX_TYPE_UNKNOWN)) { func_800F4010(&this->actor.projectedPos, NA_SE_PL_WALK_GROUND + SURFACE_SFX_OFFSET_WOOD + this->ageProperties->unk_94, 0.0f); } +#endif } cont = (entry->data >= 0); // stop processing if `data` is negative @@ -1918,13 +2018,14 @@ s32 func_80832CB0(PlayState* play, Player* this, LinkAnimationHeader* anim) { } } -void Player_SkelAnimeResetPrevTranslRot(Player* this) { +void Player_ResetAnimMovement(Player* this) { this->skelAnime.prevTransl = this->skelAnime.baseTransl; this->skelAnime.prevRot = this->actor.shape.rot.y; } -void Player_SkelAnimeResetPrevTranslRotAgeScale(Player* this) { - Player_SkelAnimeResetPrevTranslRot(this); +void Player_ResetAnimMovementScaledByAge(Player* this) { + Player_ResetAnimMovement(this); + this->skelAnime.prevTransl.x *= this->ageProperties->unk_08; this->skelAnime.prevTransl.y *= this->ageProperties->unk_08; this->skelAnime.prevTransl.z *= this->ageProperties->unk_08; @@ -1934,71 +2035,115 @@ void Player_ZeroRootLimbYaw(Player* this) { this->skelAnime.jointTable[1].y = 0; } -void func_80832DBC(Player* this) { - if (this->skelAnime.moveFlags != 0) { - func_808322FC(this); +/** + * Finishes "AnimMovement" by resetting various aspects of Player's SkelAnime structure. + * + * This function is called in Player_SetupAction so it will run on every action change, but + * it can also be called within action functions to change animations in the middle of an action. + */ +void Player_FinishAnimMovement(Player* this) { + if (this->skelAnime.movementFlags != 0) { + Player_ApplyYawFromAnim(this); + this->skelAnime.jointTable[0].x = this->skelAnime.baseTransl.x; this->skelAnime.jointTable[0].z = this->skelAnime.baseTransl.z; - if (this->skelAnime.moveFlags & ANIM_FLAG_PLAYER_SETMOVE) { - if (this->skelAnime.moveFlags & ANIM_FLAG_UPDATE_Y) { + + if (this->skelAnime.movementFlags & ANIM_FLAG_ENABLE_MOVEMENT) { + if (this->skelAnime.movementFlags & ANIM_FLAG_UPDATE_Y) { this->skelAnime.jointTable[0].y = this->skelAnime.prevTransl.y; } } else { this->skelAnime.jointTable[0].y = this->skelAnime.baseTransl.y; } - Player_SkelAnimeResetPrevTranslRot(this); - this->skelAnime.moveFlags = 0; + + Player_ResetAnimMovement(this); + + this->skelAnime.movementFlags = 0; } } -void func_80832E48(Player* this, s32 flags) { - Vec3f pos; +/** + * This is a reimplementation of `AnimTask_ActorMovement`. + * + * This achieves the same goal as `AnimTask_ActorMovement`but it adds + * the ability to scale the resulting movement according to age. + * + * When using the AnimTask variant, age specific scaling can only be applied visually + * to the root bone position and does not affect world position. + */ +void Player_ApplyAnimMovementScaledByAge(Player* this, s32 movementFlags) { + Vec3f diff; - this->skelAnime.moveFlags = flags; + this->skelAnime.movementFlags = movementFlags; this->skelAnime.prevTransl = this->skelAnime.baseTransl; - SkelAnime_UpdateTranslation(&this->skelAnime, &pos, this->actor.shape.rot.y); - if (flags & 1) { + SkelAnime_UpdateTranslation(&this->skelAnime, &diff, this->actor.shape.rot.y); + + if (movementFlags & ANIM_FLAG_UPDATE_XZ) { if (!LINK_IS_ADULT) { - pos.x *= 0.64f; - pos.z *= 0.64f; + diff.x *= 0.64f; + diff.z *= 0.64f; } - this->actor.world.pos.x += pos.x * this->actor.scale.x; - this->actor.world.pos.z += pos.z * this->actor.scale.z; + + this->actor.world.pos.x += diff.x * this->actor.scale.x; + this->actor.world.pos.z += diff.z * this->actor.scale.z; } - if (flags & 2) { - if (!(flags & 4)) { - pos.y *= this->ageProperties->unk_08; + if (movementFlags & ANIM_FLAG_UPDATE_Y) { + if (!(movementFlags & ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT)) { + diff.y *= this->ageProperties->unk_08; } - this->actor.world.pos.y += pos.y * this->actor.scale.y; + + this->actor.world.pos.y += diff.y * this->actor.scale.y; } - func_808322FC(this); + Player_ApplyYawFromAnim(this); } -#define ANIM_REPLACE_APPLY_FLAG_8 (1 << 8) -#define ANIM_REPLACE_APPLY_FLAG_9 (1 << 9) +#define PLAYER_ANIM_MOVEMENT_RESET (1 << 8) +#define PLAYER_ANIM_MOVEMENT_RESET_BY_AGE (1 << 9) -void Player_AnimReplaceApplyFlags(PlayState* play, Player* this, s32 flags) { - if (flags & ANIM_REPLACE_APPLY_FLAG_9) { - Player_SkelAnimeResetPrevTranslRotAgeScale(this); - } else if ((flags & ANIM_REPLACE_APPLY_FLAG_8) || (this->skelAnime.moveFlags != 0)) { - Player_SkelAnimeResetPrevTranslRot(this); - } else { +/** + * Starts "AnimMovement" so that Player will move according to the translation and rotation specified + * by the animation that is playing. + * + * The `flags` field can be any of the SkelAnime system's `ANIM_FLAG_` flags, as well as Player-specific + * `PLAYER_ANIM_MOVEMENT_` flags. + * + * For AnimMovement features to be enabled, it is usually required to pass `ANIM_FLAG_ENABLE_MOVEMENT` + * as one of the flags, but there are a few niche cases where it can be desirable to omit it + * (for example to use `ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT` without any actual AnimMovement). + * + * Note: AnimMovement is always disabled during every action change. + * This means the order that functions are called matters. + * `Player_StartAnimMovement` must be called *after* a call to `Player_SetupAction`. + */ +void Player_StartAnimMovement(PlayState* play, Player* this, s32 flags) { + if (flags & PLAYER_ANIM_MOVEMENT_RESET_BY_AGE) { + Player_ResetAnimMovementScaledByAge(this); + } else if ((flags & PLAYER_ANIM_MOVEMENT_RESET) || (this->skelAnime.movementFlags != 0)) { + // If AnimMovement is already in use when this function is called and + // `PLAYER_ANIM_MOVEMENT_RESET_BY_AGE` is not set, then this case will be used. + Player_ResetAnimMovement(this); + } else { + // Default case used when AnimMovement was not enabled previously. + // This sets prevTransl and prevRot to Players current translation and yaw. this->skelAnime.prevTransl = this->skelAnime.jointTable[0]; this->skelAnime.prevRot = this->actor.shape.rot.y; } - this->skelAnime.moveFlags = flags & 0xFF; + // Remove Player specific flags by masking the lower byte before setting to `skelAnime.movementFlags` + this->skelAnime.movementFlags = flags & 0xFF; + Player_ZeroSpeedXZ(this); AnimTaskQueue_DisableTransformTasksForGroup(play); } +// TODO: Change all of these wrapper functions below to use "AnimMovement" instead of "AnimReplace" void Player_AnimReplacePlayOnceSetSpeed(PlayState* play, Player* this, LinkAnimationHeader* anim, s32 flags, f32 playbackSpeed) { LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, anim, playbackSpeed); - Player_AnimReplaceApplyFlags(play, this, flags); + Player_StartAnimMovement(play, this, flags); } void Player_AnimReplacePlayOnce(PlayState* play, Player* this, LinkAnimationHeader* anim, s32 flags) { @@ -2011,13 +2156,14 @@ void Player_AnimReplacePlayOnceAdjusted(PlayState* play, Player* this, LinkAnima void Player_AnimReplaceNormalPlayOnceAdjusted(PlayState* play, Player* this, LinkAnimationHeader* anim) { Player_AnimReplacePlayOnceAdjusted(play, this, anim, - ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_NO_MOVE); + ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_ADJUST_STARTING_POS); } void Player_AnimReplacePlayLoopSetSpeed(PlayState* play, Player* this, LinkAnimationHeader* anim, s32 flags, f32 playbackSpeed) { LinkAnimation_PlayLoopSetSpeed(play, &this->skelAnime, anim, playbackSpeed); - Player_AnimReplaceApplyFlags(play, this, flags); + Player_StartAnimMovement(play, this, flags); } void Player_AnimReplacePlayLoop(PlayState* play, Player* this, LinkAnimationHeader* anim, s32 flags) { @@ -2030,7 +2176,8 @@ void Player_AnimReplacePlayLoopAdjusted(PlayState* play, Player* this, LinkAnima void Player_AnimReplaceNormalPlayLoopAdjusted(PlayState* play, Player* this, LinkAnimationHeader* anim) { Player_AnimReplacePlayLoopAdjusted(play, this, anim, - ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_NO_MOVE); + ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_ADJUST_STARTING_POS); } void Player_ProcessControlStick(PlayState* play, Player* this) { @@ -2059,7 +2206,7 @@ void Player_ProcessControlStick(PlayState* play, Player* this) { } void func_8083328C(PlayState* play, Player* this, LinkAnimationHeader* linkAnim) { - LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, linkAnim, D_808535E8); + LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, linkAnim, sWaterSpeedFactor); } int func_808332B8(Player* this) { @@ -2067,7 +2214,7 @@ int func_808332B8(Player* this) { } s32 func_808332E4(Player* this) { - return (this->stateFlags1 & PLAYER_STATE1_24); + return (this->stateFlags1 & PLAYER_STATE1_USING_BOOMERANG); } void func_808332F4(Player* this, PlayState* play) { @@ -2076,29 +2223,51 @@ void func_808332F4(Player* this, PlayState* play) { this->unk_862 = ABS(giEntry->gi); } -LinkAnimationHeader* func_80833338(Player* this) { +/** + * Get the appropriate Idle animation based on current `modelAnimType`. + * This is the default idle animation. + * + * For fidget idle animations (which can for example, change based on environment) + * see `sFidgetAnimations`. + */ +LinkAnimationHeader* Player_GetIdleAnim(Player* this) { return GET_PLAYER_ANIM(PLAYER_ANIMGROUP_wait, this->modelAnimType); } -s32 func_80833350(Player* this) { - if (func_80833338(this) != this->skelAnime.animation) { - LinkAnimationHeader** entry; +/** + * Return values for `Player_CheckForIdleAnim` + */ +#define IDLE_ANIM_DEFAULT -1 +#define IDLE_ANIM_NONE 0 +// Fidget idle anims are returned by index. See `sFidgetAnimations` and `FidgetType`. + +/** + * Checks if the current animation is an idle animation. + * If the current animation is a fidget animation, the index into + * `sFidgetAnimations` is returned (plus one). + * If the current animation is a default idle animation, -1 is returned. + * Lastly if the current animation is neither of these, 0 is returned. + */ +s32 Player_CheckForIdleAnim(Player* this) { + if (Player_GetIdleAnim(this) != this->skelAnime.animation) { + LinkAnimationHeader** fidgetAnim; s32 i; - for (i = 0, entry = &D_80853D7C[0][0]; i < 28; i++, entry++) { - if (this->skelAnime.animation == *entry) { + for (i = 0, fidgetAnim = &sFidgetAnimations[0][0]; i < ARRAY_COUNT_2D(sFidgetAnimations); i++, fidgetAnim++) { + if (this->skelAnime.animation == *fidgetAnim) { return i + 1; } } - return 0; + + return IDLE_ANIM_NONE; } - return -1; + return IDLE_ANIM_DEFAULT; } -void func_808333FC(Player* this, s32 arg1) { - if (D_80853E7C[arg1] != 0) { - Player_ProcessAnimSfxList(this, D_80853E50[D_80853E7C[arg1] - 1]); +void Player_ProcessFidgetAnimSfxList(Player* this, s32 fidgetAnimIndex) { + if (sFidgetAnimSfxTypes[fidgetAnimIndex] != FIDGET_ANIMSFX_NONE) { + Player_ProcessAnimSfxList(this, sFidgetAnimSfxLists[sFidgetAnimSfxTypes[fidgetAnimIndex] - 1]); } } @@ -2164,12 +2333,22 @@ void Player_SetUpperActionFunc(Player* this, UpperActionFunc upperActionFunc) { func_808326F0(this); } +#if OOT_VERSION < NTSC_1_1 +s32 Player_GetMeleeWeaponHeld2(Player* this) { + return Player_GetMeleeWeaponHeld(this); +} +#else +#define Player_GetMeleeWeaponHeld2 Player_GetMeleeWeaponHeld +#endif + void Player_InitItemActionWithAnim(PlayState* play, Player* this, s8 itemAction) { LinkAnimationHeader* current = this->skelAnime.animation; LinkAnimationHeader** iter = D_80853914 + this->modelAnimType; u32 animGroup; - this->stateFlags1 &= ~(PLAYER_STATE1_3 | PLAYER_STATE1_24); + // This is redundant, the same two flags get unset in + // `Player_InitItemAction` called below. + this->stateFlags1 &= ~(PLAYER_STATE1_3 | PLAYER_STATE1_USING_BOOMERANG); for (animGroup = 0; animGroup < PLAYER_ANIMGROUP_MAX; animGroup++) { if (current == *iter) { @@ -2200,6 +2379,14 @@ s8 Player_ItemToItemAction(s32 item) { void Player_InitDefaultIA(PlayState* play, Player* this) { } +#if OOT_VERSION < NTSC_1_1 +s32 Player_HoldsTwoHandedWeapon2(Player* this) { + return Player_HoldsTwoHandedWeapon(this); +} +#else +#define Player_HoldsTwoHandedWeapon2 Player_HoldsTwoHandedWeapon +#endif + void Player_InitDekuStickIA(PlayState* play, Player* this) { this->unk_85C = 1.0f; } @@ -2222,7 +2409,7 @@ void Player_InitExplosiveIA(PlayState* play, Player* this) { ExplosiveInfo* explosiveInfo; Actor* spawnedActor; - if (this->stateFlags1 & PLAYER_STATE1_11) { + if (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) { Player_PutAwayHeldItem(play, this); return; } @@ -2247,7 +2434,7 @@ void Player_InitExplosiveIA(PlayState* play, Player* this) { this->heldActor = spawnedActor; this->getItemId = GI_NONE; this->unk_3BC.y = spawnedActor->shape.rot.y - this->actor.shape.rot.y; - this->stateFlags1 |= PLAYER_STATE1_11; + this->stateFlags1 |= PLAYER_STATE1_CARRYING_ACTOR; } } @@ -2261,7 +2448,7 @@ void Player_InitHookshotIA(PlayState* play, Player* this) { } void Player_InitBoomerangIA(PlayState* play, Player* this) { - this->stateFlags1 |= PLAYER_STATE1_24; + this->stateFlags1 |= PLAYER_STATE1_USING_BOOMERANG; } void Player_InitItemAction(PlayState* play, Player* this, s8 itemAction) { @@ -2272,7 +2459,9 @@ void Player_InitItemAction(PlayState* play, Player* this, s8 itemAction) { this->heldItemAction = this->itemAction = itemAction; this->modelGroup = this->nextModelGroup; - this->stateFlags1 &= ~(PLAYER_STATE1_3 | PLAYER_STATE1_24); +#if OOT_VERSION >= NTSC_1_1 + this->stateFlags1 &= ~(PLAYER_STATE1_3 | PLAYER_STATE1_USING_BOOMERANG); +#endif sItemActionInitFuncs[itemAction](play, this); @@ -2308,43 +2497,89 @@ void func_80833A20(Player* this, s32 newMeleeWeaponState) { if (!((this->meleeWeaponAnimation >= PLAYER_MWA_FLIPSLASH_START) && (this->meleeWeaponAnimation <= PLAYER_MWA_JUMPSLASH_FINISH))) { - func_80832698(this, voiceSfx); + Player_PlayVoiceSfx(this, voiceSfx); } } this->meleeWeaponState = newMeleeWeaponState; } -s32 func_80833B2C(Player* this) { - if (this->stateFlags1 & (PLAYER_STATE1_16 | PLAYER_STATE1_17 | PLAYER_STATE1_30)) { - return 1; +/** + * This function checks for friendly (non-hostile) Z-Target related states. + * For hostile related lock-on states, see `Player_UpdateHostileLockOn` and `Player_CheckHostileLockOn`. + * + * Note that `PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS` will include all `focusActor` use cases that relate to + * friendly actors. This function can return true when talking to an actor, for example. + * Despite that, this function is only relevant in the context of actor lock-on, which is a subset of actor focus. + * This is why the function name states `FriendlyLockOn` instead of `FriendlyActorFocus`. + * + * There is a special case that allows hostile actors to be treated as "friendly" if Player is carrying another actor + * See relevant code in `Player_UpdateZTargeting` for more details. + * + * Additionally, `PLAYER_STATE1_LOCK_ON_FORCED_TO_RELEASE` will be set very briefly in some conditions when + * a lock-on is forced to release. In these niche cases, this function will apply to both friendly and hostile actors. + * Overall, it is safe to assume that this specific state flag is not very relevant for this function's use cases. + */ +s32 Player_FriendlyLockOnOrParallel(Player* this) { + if (this->stateFlags1 & + (PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS | PLAYER_STATE1_PARALLEL | PLAYER_STATE1_LOCK_ON_FORCED_TO_RELEASE)) { + return true; } else { - return 0; + return false; } } -s32 func_80833B54(Player* this) { - if ((this->unk_664 != NULL) && CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2)) { - this->stateFlags1 |= PLAYER_STATE1_4; - return 1; - } +/** + * Checks the current state of `focusActor` and if it is a hostile actor (if applicable). + * If so, sets `PLAYER_STATE1_HOSTILE_LOCK_ON` which will control Player's "battle" response to + * hostile actors. This includes affecting how movement is handled, and enabling a "fighting" set + * of animations. + * + * Note that `Player_CheckHostileLockOn` also exists to check if there is currently a hostile lock-on actor. + * This function differs in that it first updates the flag if appropriate, then returns the same information. + * + * @return true if there is currently a hostile lock-on actor, false otherwise + */ +s32 Player_UpdateHostileLockOn(Player* this) { + if ((this->focusActor != NULL) && + CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) { + this->stateFlags1 |= PLAYER_STATE1_HOSTILE_LOCK_ON; - if (this->stateFlags1 & PLAYER_STATE1_4) { - this->stateFlags1 &= ~PLAYER_STATE1_4; - if (this->speedXZ == 0.0f) { - this->yaw = this->actor.shape.rot.y; + return true; + } else { + if (this->stateFlags1 & PLAYER_STATE1_HOSTILE_LOCK_ON) { + this->stateFlags1 &= ~PLAYER_STATE1_HOSTILE_LOCK_ON; + + // sync world and shape yaw when not moving + if (this->speedXZ == 0.0f) { + this->yaw = this->actor.shape.rot.y; + } } - } - return 0; + return false; + } } -int func_80833BCC(Player* this) { - return func_8008E9C4(this) || func_80833B2C(this); +/** + * Returns true if currently Z-Targeting, false if not. + * Z-Targeting here is a blanket term that covers both the "actor lock-on" and "parallel" states. + * + * This variant of the function calls `Player_CheckHostileLockOn`, which does not update the hostile + * lock-on actor state. + */ +int Player_IsZTargeting(Player* this) { + return Player_CheckHostileLockOn(this) || Player_FriendlyLockOnOrParallel(this); } -int func_80833C04(Player* this) { - return func_80833B54(this) || func_80833B2C(this); +/** + * Returns true if currently Z-Targeting, false if not. + * Z-Targeting here is a blanket term that covers both the "actor lock-on" and "parallel" states. + * + * This variant of the function calls `Player_UpdateHostileLockOn`, which updates the hostile + * lock-on actor state before checking its state. + */ +int Player_IsZTargetingWithHostileUpdate(Player* this) { + return Player_UpdateHostileLockOn(this) || Player_FriendlyLockOnOrParallel(this); } void func_80833C3C(Player* this) { @@ -2407,7 +2642,7 @@ void Player_ProcessItemButtons(Player* this, PlayState* play) { } } - if (!(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_29)) && !func_8008F128(this)) { + if (!(this->stateFlags1 & (PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_29)) && !func_8008F128(this)) { if (this->itemAction >= PLAYER_IA_FISHING_POLE) { if (!Player_ItemIsInUse(this, B_BTN_ITEM) && !Player_ItemIsInUse(this, C_BTN_ITEM(0)) && !Player_ItemIsInUse(this, C_BTN_ITEM(1)) && !Player_ItemIsInUse(this, C_BTN_ITEM(2))) { @@ -2495,7 +2730,10 @@ void Player_StartChangingHeldItem(Player* this, PlayState* play) { } void Player_UpdateItems(Player* this, PlayState* play) { - if ((this->actor.category == ACTORCAT_PLAYER) && !(this->stateFlags1 & PLAYER_STATE1_START_CHANGING_HELD_ITEM) && + if ((this->actor.category == ACTORCAT_PLAYER) && +#if OOT_VERSION >= NTSC_1_1 + !(this->stateFlags1 & PLAYER_STATE1_START_CHANGING_HELD_ITEM) && +#endif ((this->heldItemAction == this->itemAction) || (this->stateFlags1 & PLAYER_STATE1_22)) && (gSaveContext.save.info.playerData.health != 0) && (play->csCtx.state == CS_STATE_IDLE) && (this->csAction == PLAYER_CSACTION_NONE) && (play->shootingGalleryStatus == 0) && @@ -2595,7 +2833,7 @@ void func_80834644(PlayState* play, Player* this) { Player_SetUpperActionFunc(this, sItemActionUpdateFuncs[this->heldItemAction]); this->unk_834 = 0; - this->unk_6AC = 0; + this->idleType = PLAYER_IDLE_DEFAULT; Player_DetachHeldActor(play, this); this->stateFlags1 &= ~PLAYER_STATE1_START_CHANGING_HELD_ITEM; } @@ -2617,8 +2855,8 @@ s32 func_80834758(PlayState* play, Player* this) { if (!(this->stateFlags1 & (PLAYER_STATE1_22 | PLAYER_STATE1_23 | PLAYER_STATE1_29)) && (play->shootingGalleryStatus == 0) && (this->heldItemAction == this->itemAction) && - (this->currentShield != PLAYER_SHIELD_NONE) && !Player_IsChildWithHylianShield(this) && func_80833BCC(this) && - CHECK_BTN_ALL(sControlInput->cur.button, BTN_R)) { + (this->currentShield != PLAYER_SHIELD_NONE) && !Player_IsChildWithHylianShield(this) && + Player_IsZTargeting(this) && CHECK_BTN_ALL(sControlInput->cur.button, BTN_R)) { anim = func_808346C4(play, this); frame = Animation_GetLastFrame(anim); @@ -2661,7 +2899,7 @@ void Player_WaitToFinishItemChange(PlayState* play, Player* this) { Player_FinishItemChange(play, this); } - func_80833B54(this); + Player_UpdateHostileLockOn(this); } s32 func_8083499C(Player* this, PlayState* play) { @@ -2675,7 +2913,7 @@ s32 func_8083499C(Player* this, PlayState* play) { } /** - * The actual sword weapon is not handled here. See `Player_ActionChange_7` for melee weapon usage. + * The actual sword weapon is not handled here. See `Player_ActionHandler_7` for melee weapon usage. * This upper body action allows for shielding or changing held items while a sword is in hand. */ s32 Player_UpperAction_Sword(Player* this, PlayState* play) { @@ -2693,16 +2931,16 @@ s32 Player_UpperAction_ChangeHeldItem(Player* this, PlayState* play) { (sUseHeldItem || ((this->modelAnimType != PLAYER_ANIMTYPE_3) && (play->shootingGalleryStatus == 0)))))) { Player_SetUpperActionFunc(this, sItemActionUpdateFuncs[this->heldItemAction]); this->unk_834 = 0; - this->unk_6AC = 0; + this->idleType = PLAYER_IDLE_DEFAULT; sHeldItemButtonIsHeldDown = sUseHeldItem; return this->upperActionFunc(this, play); } - if (func_80833350(this) != 0) { + if (Player_CheckForIdleAnim(this) != IDLE_ANIM_NONE) { Player_WaitToFinishItemChange(play, this); - Player_AnimPlayOnce(play, this, func_80833338(this)); - this->unk_6AC = 0; + Player_AnimPlayOnce(play, this, Player_GetIdleAnim(this)); + this->idleType = PLAYER_IDLE_DEFAULT; } else { Player_WaitToFinishItemChange(play, this); } @@ -2746,7 +2984,7 @@ s32 func_80834C74(Player* this, PlayState* play) { Player_SetUpperActionFunc(this, sItemActionUpdateFuncs[this->heldItemAction]); LinkAnimation_PlayLoop(play, &this->upperSkelAnime, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_wait, this->modelAnimType)); - this->unk_6AC = 0; + this->idleType = PLAYER_IDLE_DEFAULT; this->upperActionFunc(this, play); return false; @@ -2777,7 +3015,7 @@ s32 func_80834D2C(Player* this, PlayState* play) { if (this->stateFlags1 & PLAYER_STATE1_23) { Player_AnimPlayLoop(play, this, &gPlayerAnim_link_uma_anim_walk); - } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !func_80833B54(this)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !Player_UpdateHostileLockOn(this)) { Player_AnimPlayLoop(play, this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_wait, this->modelAnimType)); } @@ -2791,12 +3029,12 @@ int func_80834E44(PlayState* play) { int func_80834E7C(PlayState* play) { return (play->shootingGalleryStatus != 0) && ((play->shootingGalleryStatus < 0) || - CHECK_BTN_ANY(sControlInput->cur.button, BTN_A | BTN_B | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)); + CHECK_BTN_ANY(sControlInput->cur.button, BTN_A | BTN_B | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT)); } s32 func_80834EB8(Player* this, PlayState* play) { if ((this->unk_6AD == 0) || (this->unk_6AD == 2)) { - if (func_80833BCC(this) || + if (Player_IsZTargeting(this) || (Camera_CheckValidMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_AIM_ADULT) == 0)) { return 1; } @@ -2807,7 +3045,7 @@ s32 func_80834EB8(Player* this, PlayState* play) { } s32 func_80834F2C(Player* this, PlayState* play) { - if ((this->doorType == PLAYER_DOORTYPE_NONE) && !(this->stateFlags1 & PLAYER_STATE1_25)) { + if ((this->doorType == PLAYER_DOORTYPE_NONE) && !(this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN)) { if (sUseHeldItem || func_80834E44(play)) { if (func_80834D2C(this, play)) { return func_80834EB8(this, play); @@ -2892,10 +3130,10 @@ s32 func_808351D4(Player* this, PlayState* play) { sp2C = 1; } - Math_ScaledStepToS(&this->unk_6C0, 1200, 400); - this->unk_6AE |= 0x100; + Math_ScaledStepToS(&this->upperLimbRot.z, 1200, 400); + this->unk_6AE_rotFlags |= UNK6AE_ROT_UPPER_Z; - if ((this->unk_836 == 0) && (func_80833350(this) == 0) && + if ((this->unk_836 == 0) && (Player_CheckForIdleAnim(this) == IDLE_ANIM_NONE) && (this->skelAnime.animation == &gPlayerAnim_link_bow_side_walk)) { LinkAnimation_PlayOnce(play, &this->upperSkelAnime, D_808543CC[sp2C]); this->unk_836 = -1; @@ -2955,7 +3193,7 @@ s32 func_808353D8(Player* this, PlayState* play) { this->unk_834--; } - if (func_80833BCC(this) || (this->unk_6AD != 0) || (this->stateFlags1 & PLAYER_STATE1_20)) { + if (Player_IsZTargeting(this) || (this->unk_6AD != 0) || (this->stateFlags1 & PLAYER_STATE1_20)) { if (this->unk_834 == 0) { this->unk_834++; } @@ -2984,15 +3222,16 @@ s32 func_80835588(Player* this, PlayState* play) { return true; } -void func_808355DC(Player* this) { - this->stateFlags1 |= PLAYER_STATE1_17; +void Player_SetParallel(Player* this) { + this->stateFlags1 |= PLAYER_STATE1_PARALLEL; - if (!(this->skelAnime.moveFlags & ANIM_FLAG_OVERRIDE_MOVEMENT) && + if (!(this->skelAnime.movementFlags & ANIM_FLAG_OVERRIDE_MOVEMENT) && (this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && (sShapeYawToTouchedWall < 0x2000)) { + // snap to the wall this->yaw = this->actor.shape.rot.y = this->actor.wallYaw + 0x8000; } - this->zTargetYaw = this->actor.shape.rot.y; + this->parallelYaw = this->actor.shape.rot.y; } s32 func_80835644(PlayState* play, Player* this, Actor* arg2) { @@ -3013,21 +3252,35 @@ void func_80835688(Player* this, PlayState* play) { } s32 Player_UpperAction_CarryActor(Player* this, PlayState* play) { +#if OOT_VERSION >= NTSC_1_1 Actor* heldActor = this->heldActor; if (heldActor == NULL) { func_80834644(play, this); } +#endif if (func_80834758(play, this)) { return true; } - if (this->stateFlags1 & PLAYER_STATE1_11) { + if (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) { +#if OOT_VERSION < NTSC_1_1 + Actor* heldActor; +#endif + if (LinkAnimation_Update(play, &this->upperSkelAnime)) { LinkAnimation_PlayLoop(play, &this->upperSkelAnime, &gPlayerAnim_link_normal_carryB_wait); } +#if OOT_VERSION < NTSC_1_1 + heldActor = this->heldActor; + if (heldActor == NULL) { + func_80834644(play, this); + return true; + } +#endif + if ((heldActor->id == ACTOR_EN_NIW) && (this->actor.velocity.y <= 0.0f)) { this->actor.minVelocityY = -2.0f; this->actor.gravity = -0.5f; @@ -3049,7 +3302,7 @@ s32 func_80835800(Player* this, PlayState* play) { return true; } - if (this->stateFlags1 & PLAYER_STATE1_25) { + if (this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN) { Player_SetUpperActionFunc(this, func_80835B60); } else if (func_80834F2C(this, play)) { return true; @@ -3098,22 +3351,25 @@ s32 func_808359FC(Player* this, PlayState* play) { } else if (LinkAnimation_OnFrame(&this->upperSkelAnime, 6.0f)) { f32 posX = (Math_SinS(this->actor.shape.rot.y) * 10.0f) + this->actor.world.pos.x; f32 posZ = (Math_CosS(this->actor.shape.rot.y) * 10.0f) + this->actor.world.pos.z; - s32 yaw = (this->unk_664 != NULL) ? this->actor.shape.rot.y + 14000 : this->actor.shape.rot.y; + s32 yaw = (this->focusActor != NULL) ? this->actor.shape.rot.y + 14000 : this->actor.shape.rot.y; EnBoom* boomerang = (EnBoom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOOM, posX, this->actor.world.pos.y + 30.0f, posZ, this->actor.focus.rot.x, yaw, 0, 0); this->boomerangActor = &boomerang->actor; + if (boomerang != NULL) { - boomerang->moveTo = this->unk_664; + boomerang->moveTo = this->focusActor; boomerang->returnTimer = 20; - this->stateFlags1 |= PLAYER_STATE1_25; - if (!func_8008E9C4(this)) { - func_808355DC(this); + this->stateFlags1 |= PLAYER_STATE1_BOOMERANG_THROWN; + + if (!Player_CheckHostileLockOn(this)) { + Player_SetParallel(this); } + this->unk_A73 = 4; Player_PlaySfx(this, NA_SE_IT_BOOMERANG_THROW); - func_80832698(this, NA_SE_VO_LI_SWORD_N); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_SWORD_N); } } @@ -3125,12 +3381,12 @@ s32 func_80835B60(Player* this, PlayState* play) { return true; } - if (!(this->stateFlags1 & PLAYER_STATE1_25)) { + if (!(this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN)) { Player_SetUpperActionFunc(this, func_80835C08); LinkAnimation_PlayOnce(play, &this->upperSkelAnime, &gPlayerAnim_link_boom_catch); func_808357E8(this, gPlayerLeftHandBoomerangDLs); Player_PlaySfx(this, NA_SE_PL_CATCH_BOOMERANG); - func_80832698(this, NA_SE_VO_LI_SWORD_N); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_SWORD_N); return true; } @@ -3164,45 +3420,63 @@ s32 Player_SetupAction(PlayState* play, Player* this, PlayerActionFunc actionFun func_8008EC70(this); } - if (!(flags & 1) && !(this->stateFlags1 & PLAYER_STATE1_11)) { + if (!(flags & 1) && !(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR)) { func_80834644(play, this); this->stateFlags1 &= ~PLAYER_STATE1_22; } - func_80832DBC(this); + Player_FinishAnimMovement(this); - this->stateFlags1 &= ~(PLAYER_STATE1_2 | PLAYER_STATE1_6 | PLAYER_STATE1_26 | PLAYER_STATE1_28 | PLAYER_STATE1_29 | - PLAYER_STATE1_31); - this->stateFlags2 &= ~(PLAYER_STATE2_19 | PLAYER_STATE2_27 | PLAYER_STATE2_28); - this->stateFlags3 &= ~(PLAYER_STATE3_1 | PLAYER_STATE3_3 | PLAYER_STATE3_7); + this->stateFlags1 &= ~(PLAYER_STATE1_2 | PLAYER_STATE1_TALKING | PLAYER_STATE1_26 | PLAYER_STATE1_28 | + PLAYER_STATE1_29 | PLAYER_STATE1_31); + this->stateFlags2 &= ~(PLAYER_STATE2_19 | PLAYER_STATE2_27 | PLAYER_STATE2_IDLE_FIDGET); + this->stateFlags3 &= ~(PLAYER_STATE3_1 | PLAYER_STATE3_3 | PLAYER_STATE3_FLYING_WITH_HOOKSHOT); this->av1.actionVar1 = 0; this->av2.actionVar2 = 0; - this->unk_6AC = 0; + this->idleType = PLAYER_IDLE_DEFAULT; func_808326F0(this); return 1; } -void func_80835DAC(PlayState* play, Player* this, PlayerActionFunc actionFunc, s32 flags) { - s32 temp; +/** + * Calls `Player_SetupAction` to setup a new action, but takes extra measures to + * preserve AnimMovement while doing so. + */ +void Player_SetupActionPreserveAnimMovement(PlayState* play, Player* this, PlayerActionFunc actionFunc, s32 flags) { + s32 savedMovementFlags; + + savedMovementFlags = this->skelAnime.movementFlags; + + // Setting `skelAnime.movementFlags` to 0 will prevent `Player_FinishAnimMovement` from ending + // AnimMovement when `Player_SetupAction` is called. + this->skelAnime.movementFlags = 0; - temp = this->skelAnime.moveFlags; - this->skelAnime.moveFlags = 0; Player_SetupAction(play, this, actionFunc, flags); - this->skelAnime.moveFlags = temp; + this->skelAnime.movementFlags = savedMovementFlags; } -void func_80835DE4(PlayState* play, Player* this, PlayerActionFunc actionFunc, s32 flags) { - s32 temp; +/** + * Calls `Player_SetupAction` to setup a new action, but takes extra measures to + * preserve the current itemAction while doing so. + * + * Note that `itemAction` must be PLAYER_IA_NONE or higher for the action change to take place. + */ +void Player_SetupActionPreserveItemAction(PlayState* play, Player* this, PlayerActionFunc actionFunc, s32 flags) { + s32 savedItemAction; + + if (this->itemAction >= PLAYER_IA_NONE) { + savedItemAction = this->itemAction; - if (this->itemAction >= 0) { - temp = this->itemAction; + // Setting `itemAction` to `heldItemAction` will prevent `func_8008EC70` from running when + // `Player_SetupAction` is called. this->itemAction = this->heldItemAction; + Player_SetupAction(play, this, actionFunc, flags); - this->itemAction = temp; + this->itemAction = savedItemAction; Player_SetModels(this, Player_ActionToModelGroup(this, this->itemAction)); } } @@ -3301,7 +3575,7 @@ void Player_UseItem(PlayState* play, Player* this, s32 item) { } else if (((itemAction >= PLAYER_IA_OCARINA_FAIRY) && (itemAction <= PLAYER_IA_OCARINA_OF_TIME)) || (itemAction >= PLAYER_IA_BOTTLE_FISH)) { // Handle "cutscene items" - if (!func_8008E9C4(this) || + if (!Player_CheckHostileLockOn(this) || ((itemAction >= PLAYER_IA_BOTTLE_POTION_RED) && (itemAction <= PLAYER_IA_BOTTLE_FAIRY))) { TitleCard_Clear(play, &play->actorCtx.titleCtx); this->unk_6AD = 4; @@ -3341,7 +3615,7 @@ void func_80836448(PlayState* play, Player* this, LinkAnimationHeader* anim) { Player_SetupAction(play, this, cond ? Player_Action_8084E368 : Player_Action_80843CEC, 0); - this->stateFlags1 |= PLAYER_STATE1_7; + this->stateFlags1 |= PLAYER_STATE1_DEAD; Player_AnimPlayOnce(play, this, anim); if (anim == &gPlayerAnim_link_derth_rebirth) { @@ -3349,7 +3623,7 @@ void func_80836448(PlayState* play, Player* this, LinkAnimationHeader* anim) { } func_80832224(this); - func_80832698(this, NA_SE_VO_LI_DOWN); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_DOWN); if (this->actor.category == ACTORCAT_PLAYER) { Audio_SetBgmVolumeOffDuringFanfare(); @@ -3399,17 +3673,17 @@ int Player_CanUpdateItems(Player* this) { s32 Player_UpdateUpperBody(Player* this, PlayState* play) { if (!(this->stateFlags1 & PLAYER_STATE1_23) && (this->actor.parent != NULL) && Player_HoldsHookshot(this)) { Player_SetupAction(play, this, Player_Action_80850AEC, 1); - this->stateFlags3 |= PLAYER_STATE3_7; + this->stateFlags3 |= PLAYER_STATE3_FLYING_WITH_HOOKSHOT; Player_AnimPlayOnce(play, this, &gPlayerAnim_link_hook_fly_start); - Player_AnimReplaceApplyFlags(play, this, - ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_PLAYER_SETMOVE | - ANIM_FLAG_NO_MOVE | ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_StartAnimMovement(play, this, + ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_ADJUST_STARTING_POS | ANIM_FLAG_OVERRIDE_MOVEMENT); func_80832224(this); this->yaw = this->actor.shape.rot.y; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->hoverBootsTimer = 0; - this->unk_6AE |= 0x43; - func_80832698(this, NA_SE_VO_LI_LASH); + this->unk_6AE_rotFlags |= UNK6AE_ROT_FOCUS_X | UNK6AE_ROT_FOCUS_Y | UNK6AE_ROT_UPPER_X; + Player_PlayVoiceSfx(this, NA_SE_VO_LI_LASH); return true; } @@ -3427,14 +3701,14 @@ s32 Player_UpdateUpperBody(Player* this, PlayState* play) { if (this->upperAnimInterpWeight != 0.0f) { // The functionality contained within this block of code is never used in practice // because `upperAnimInterpWeight` is always 0. - if ((func_80833350(this) == 0) || (this->speedXZ != 0.0f)) { + if ((Player_CheckForIdleAnim(this) == IDLE_ANIM_NONE) || (this->speedXZ != 0.0f)) { AnimTaskQueue_AddCopyUsingMapInverted(play, this->skelAnime.limbCount, this->upperSkelAnime.jointTable, this->skelAnime.jointTable, sUpperBodyLimbCopyMap); } Math_StepToF(&this->upperAnimInterpWeight, 0.0f, 0.25f); AnimTaskQueue_AddInterp(play, this->skelAnime.limbCount, this->skelAnime.jointTable, this->upperSkelAnime.jointTable, 1.0f - this->upperAnimInterpWeight); - } else if ((func_80833350(this) == 0) || (this->speedXZ != 0.0f)) { + } else if ((Player_CheckForIdleAnim(this) == IDLE_ANIM_NONE) || (this->speedXZ != 0.0f)) { // Only copy the upper body animation to the upper body limbs in the main skeleton. // Doing so allows the main skeleton to play its own animation for the lower body limbs. AnimTaskQueue_AddCopyUsingMap(play, this->skelAnime.limbCount, this->skelAnime.jointTable, @@ -3471,23 +3745,23 @@ s32 Player_SetupWaitForPutAway(PlayState* play, Player* this, AfterPutAwayFunc a * This does not affect the direction Player will move in. * * There are 3 modes shape yaw can be updated with, based on player state: - * - Lock on: Rotates Player to face the lock on target. - * - Parallel: Rotates Player to face the Parallel angle, set by `func_808355DC` when Z is pressed. + * - Lock on: Rotates Player to face the current lock on target. + * - Parallel: Rotates Player to face the current Parallel angle, set when Z-Targeting without an actor lock-on * - Normal: Rotates Player to face `this->yaw`, the direction he is currently moving */ void Player_UpdateShapeYaw(Player* this, PlayState* play) { s16 previousYaw = this->actor.shape.rot.y; if (!(this->stateFlags2 & (PLAYER_STATE2_5 | PLAYER_STATE2_6))) { - Actor* unk_664 = this->unk_664; + Actor* focusActor = this->focusActor; - if ((unk_664 != NULL) && - ((play->actorCtx.targetCtx.unk_4B != 0) || (this->actor.category != ACTORCAT_PLAYER))) { - Math_ScaledStepToS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &unk_664->focus.pos), + if ((focusActor != NULL) && + ((play->actorCtx.attention.reticleSpinCounter != 0) || (this->actor.category != ACTORCAT_PLAYER))) { + Math_ScaledStepToS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &focusActor->focus.pos), 4000); - } else if ((this->stateFlags1 & PLAYER_STATE1_17) && + } else if ((this->stateFlags1 & PLAYER_STATE1_PARALLEL) && !(this->stateFlags2 & (PLAYER_STATE2_5 | PLAYER_STATE2_6))) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->zTargetYaw, 4000); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->parallelYaw, 4000); } } else if (!(this->stateFlags2 & PLAYER_STATE2_6)) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->yaw, 2000); @@ -3496,152 +3770,234 @@ void Player_UpdateShapeYaw(Player* this, PlayState* play) { this->unk_87C = this->actor.shape.rot.y - previousYaw; } -s32 func_808369C8(s16* pValue, s16 arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5) { - s16 temp1; - s16 temp2; - s16 temp3; +/** + * Step a value by `step` to a `target` value. + * Constrains the value to be no further than `constraintRange` from `constraintMid` (accounting for wrapping). + * Constrains the value to be no further than `overflowRange` from 0. + * If this second constraint is enforced, return how much the value was past by the range, or return 0. + * + * @return The amount by which the value overflowed the absolute range defined by `overflowRange` + */ +s32 Player_ScaledStepBinangClamped(s16* pValue, s16 target, s16 step, s16 overflowRange, s16 constraintMid, + s16 constraintRange) { + s16 diff; + s16 clampedDiff; + s16 valueBeforeOverflowClamp; - temp1 = temp2 = arg4 - *pValue; - temp2 = CLAMP(temp2, -arg5, arg5); - *pValue += (s16)(temp1 - temp2); + // Clamp value to [constraintMid - constraintRange , constraintMid + constraintRange] + // This is more involved than a simple `CLAMP`, to account for binang wrapping + diff = clampedDiff = constraintMid - *pValue; + clampedDiff = CLAMP(clampedDiff, -constraintRange, constraintRange); + *pValue += (s16)(diff - clampedDiff); - Math_ScaledStepToS(pValue, arg1, arg2); + Math_ScaledStepToS(pValue, target, step); - temp3 = *pValue; - if (*pValue < -arg3) { - *pValue = -arg3; - } else if (*pValue > arg3) { - *pValue = arg3; + valueBeforeOverflowClamp = *pValue; + if (*pValue < -overflowRange) { + *pValue = -overflowRange; + } else if (*pValue > overflowRange) { + *pValue = overflowRange; } - return temp3 - *pValue; + return valueBeforeOverflowClamp - *pValue; } s32 func_80836AB8(Player* this, s32 arg1) { - s16 sp36; - s16 var; - - var = this->actor.shape.rot.y; - if (arg1 != 0) { - var = this->actor.focus.rot.y; - this->unk_6BC = this->actor.focus.rot.x; - this->unk_6AE |= 0x41; - } else { - func_808369C8(&this->unk_6BC, - func_808369C8(&this->unk_6B6, this->actor.focus.rot.x, 600, 10000, this->actor.focus.rot.x, 0), - 200, 4000, this->unk_6B6, 10000); - sp36 = this->actor.focus.rot.y - var; - func_808369C8(&sp36, 0, 200, 24000, this->unk_6BE, 8000); - var = this->actor.focus.rot.y - sp36; - func_808369C8(&this->unk_6B8, sp36 - this->unk_6BE, 200, 8000, sp36, 8000); - func_808369C8(&this->unk_6BE, sp36, 200, 8000, this->unk_6B8, 8000); - this->unk_6AE |= 0xD9; - } - - return var; -} - -// Update things related to Z Targeting -void func_80836BEC(Player* this, PlayState* play) { - s32 sp1C = 0; - s32 zTrigPressed = CHECK_BTN_ALL(sControlInput->cur.button, BTN_Z); - Actor* actorToTarget; + s16 targetUpperBodyYaw; + s16 yaw; + + yaw = this->actor.shape.rot.y; + if (arg1) { + yaw = this->actor.focus.rot.y; + this->upperLimbRot.x = this->actor.focus.rot.x; + this->unk_6AE_rotFlags |= UNK6AE_ROT_FOCUS_X | UNK6AE_ROT_UPPER_X; + } else { + // Step the head pitch to the focus pitch. + // If the head cannot be pitched enough, pitch the upper body. + Player_ScaledStepBinangClamped(&this->upperLimbRot.x, + Player_ScaledStepBinangClamped(&this->headLimbRot.x, this->actor.focus.rot.x, + 600, 10000, this->actor.focus.rot.x, 0), + 200, 4000, this->headLimbRot.x, 10000); + + // Step the upper body and head yaw to the focus yaw. + // Eventually prefers turning the upper body rather than the head. + targetUpperBodyYaw = this->actor.focus.rot.y - yaw; + Player_ScaledStepBinangClamped(&targetUpperBodyYaw, 0, 200, 24000, this->upperLimbRot.y, 8000); + yaw = this->actor.focus.rot.y - targetUpperBodyYaw; + Player_ScaledStepBinangClamped(&this->headLimbRot.y, targetUpperBodyYaw - this->upperLimbRot.y, 200, 8000, + targetUpperBodyYaw, 8000); + Player_ScaledStepBinangClamped(&this->upperLimbRot.y, targetUpperBodyYaw, 200, 8000, this->headLimbRot.y, 8000); + + this->unk_6AE_rotFlags |= + UNK6AE_ROT_FOCUS_X | UNK6AE_ROT_HEAD_X | UNK6AE_ROT_HEAD_Y | UNK6AE_ROT_UPPER_X | UNK6AE_ROT_UPPER_Y; + } + + return yaw; +} + +/** + * Updates state related to Z-Targeting. + * + * Z-Targeting is an umbrella term for two main states: + * - Actor Lock-on: Player has locked onto an actor, a reticle appears, both Player and the camera focus on the actor. + * - Parallel: Player and the camera keep facing the same angle from when Z was pressed. Can snap to walls. + * This state occurs when there are no actors available to lock onto. + * + * First this function updates `zTargetActiveTimer`. For most Z-Target related states to update, this + * timer has to have a non-zero value. Additionally, the timer must have a value of 5 or greater + * for the Attention system to recognize that an actor lock-on is active. + * + * Following this, a next lock-on actor is chosen. If there is currently no actor lock-on active, the actor + * Navi is hovering over will be chosen. If there is an active lock-on, the next available + * lock-on will be the actor with an arrow hovering above it. + * + * If the above regarding actor lock-on does not occur, then Z-Parallel can begin. + * + * Lastly, the function handles updating general "actor focus" state. This applies to non Z-Target states + * like talking to an actor. If the current focus actor is not considered "hostile", then + * `PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS` can be set. This flag being set will trigger `Player_UpdateCamAndSeqModes` + * to make the camera focus on the current focus actor. + */ +void Player_UpdateZTargeting(Player* this, PlayState* play) { + s32 ignoreLeash = false; + s32 zButtonHeld = CHECK_BTN_ALL(sControlInput->cur.button, BTN_Z); + Actor* nextLockOnActor; s32 pad; - s32 holdTarget; - s32 cond; + s32 usingHoldTargeting; + s32 isTalking; - if (!zTrigPressed) { - this->stateFlags1 &= ~PLAYER_STATE1_30; + if (!zButtonHeld) { + this->stateFlags1 &= ~PLAYER_STATE1_LOCK_ON_FORCED_TO_RELEASE; } if ((play->csCtx.state != CS_STATE_IDLE) || (this->csAction != PLAYER_CSACTION_NONE) || - (this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_29)) || (this->stateFlags3 & PLAYER_STATE3_7)) { - this->unk_66C = 0; - } else if (zTrigPressed || (this->stateFlags2 & PLAYER_STATE2_13) || (this->unk_684 != NULL)) { - if (this->unk_66C <= 5) { - this->unk_66C = 5; + (this->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_29)) || + (this->stateFlags3 & PLAYER_STATE3_FLYING_WITH_HOOKSHOT)) { + // Don't allow Z-Targeting in various states + this->zTargetActiveTimer = 0; + } else if (zButtonHeld || (this->stateFlags2 & PLAYER_STATE2_LOCK_ON_WITH_SWITCH) || + (this->autoLockOnActor != NULL)) { + // While a lock-on is active, decrement the timer and hold it at 5. + // Values under 5 indicate a lock-on has ended and will make the reticle release. + // See usage toward the end of `Actor_UpdateAll`. + // + // `zButtonHeld` will also be true for Parallel. This is necessary because the timer + // needs to be non-zero for `Player_SetParallel` to be able to run below. + if (this->zTargetActiveTimer <= 5) { + this->zTargetActiveTimer = 5; } else { - this->unk_66C--; + this->zTargetActiveTimer--; } - } else if (this->stateFlags1 & PLAYER_STATE1_17) { - this->unk_66C = 0; - } else if (this->unk_66C != 0) { - this->unk_66C--; + } else if (this->stateFlags1 & PLAYER_STATE1_PARALLEL) { + // If the above code block which checks `zButtonHeld` is not taken, that means Z has been released. + // In that case, setting `zTargetActiveTimer` to 0 will stop Parallel if it is currently active. + this->zTargetActiveTimer = 0; + } else if (this->zTargetActiveTimer != 0) { + this->zTargetActiveTimer--; } - if (this->unk_66C >= 6) { - sp1C = 1; + if (this->zTargetActiveTimer >= 6) { + // When a lock-on is started, `zTargetActiveTimer` will be set to 15 and then immediately start decrementing + // down to 5. During this 10 frame period, set `ignoreLeash` so that the lock-on will temporarily + // have an infinite leash distance. + // This gives time for the reticle to settle while it locks on, even if the player leaves the leash range. + ignoreLeash = true; } - cond = func_8083224C(play); - if (cond || (this->unk_66C != 0) || (this->stateFlags1 & (PLAYER_STATE1_12 | PLAYER_STATE1_25))) { - if (!cond) { - if (!(this->stateFlags1 & PLAYER_STATE1_25) && + isTalking = Player_IsTalking(play); + + if (isTalking || (this->zTargetActiveTimer != 0) || + (this->stateFlags1 & (PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_BOOMERANG_THROWN))) { + if (!isTalking) { + if (!(this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN) && ((this->heldItemAction != PLAYER_IA_FISHING_POLE) || (this->unk_860 == 0)) && CHECK_BTN_ALL(sControlInput->press.button, BTN_Z)) { - if (this->actor.category == ACTORCAT_PLAYER) { - actorToTarget = play->actorCtx.targetCtx.arrowPointedActor; + // The next lock-on actor defaults to the actor Navi is hovering over. + // This may change to the arrow hover actor below. + nextLockOnActor = play->actorCtx.attention.naviHoverActor; } else { - actorToTarget = &GET_PLAYER(play)->actor; + // Dark Link will always lock onto the player. + nextLockOnActor = &GET_PLAYER(play)->actor; } - holdTarget = (gSaveContext.zTargetSetting != 0) || (this->actor.category != ACTORCAT_PLAYER); - this->stateFlags1 |= PLAYER_STATE1_15; + // Get saved Z Target setting. + // Dark Link uses Hold Targeting. + usingHoldTargeting = (gSaveContext.zTargetSetting != 0) || (this->actor.category != ACTORCAT_PLAYER); - if ((actorToTarget != NULL) && !(actorToTarget->flags & ACTOR_FLAG_27)) { - if ((actorToTarget == this->unk_664) && (this->actor.category == ACTORCAT_PLAYER)) { - actorToTarget = play->actorCtx.targetCtx.unk_94; + this->stateFlags1 |= PLAYER_STATE1_Z_TARGETING; + + if ((nextLockOnActor != NULL) && !(nextLockOnActor->flags & ACTOR_FLAG_LOCK_ON_DISABLED)) { + + // Navi hovers over the current lock-on actor, so `nextLockOnActor` and `focusActor` + // will be the same if already locked on. + // In this case, `nextLockOnActor` will be the arrow hover actor instead. + if ((nextLockOnActor == this->focusActor) && (this->actor.category == ACTORCAT_PLAYER)) { + nextLockOnActor = play->actorCtx.attention.arrowHoverActor; } - if (actorToTarget != this->unk_664) { - if (!holdTarget) { - this->stateFlags2 |= PLAYER_STATE2_13; + if (nextLockOnActor != this->focusActor) { + // Set new lock-on + + if (!usingHoldTargeting) { + this->stateFlags2 |= PLAYER_STATE2_LOCK_ON_WITH_SWITCH; } - this->unk_664 = actorToTarget; - this->unk_66C = 15; - this->stateFlags2 &= ~(PLAYER_STATE2_1 | PLAYER_STATE2_21); + + this->focusActor = nextLockOnActor; + this->zTargetActiveTimer = 15; + this->stateFlags2 &= ~(PLAYER_STATE2_CAN_ACCEPT_TALK_OFFER | PLAYER_STATE2_21); } else { - if (!holdTarget) { - func_8008EDF0(this); + if (!usingHoldTargeting) { + Player_ReleaseLockOn(this); } } - this->stateFlags1 &= ~PLAYER_STATE1_30; + this->stateFlags1 &= ~PLAYER_STATE1_LOCK_ON_FORCED_TO_RELEASE; } else { - if (!(this->stateFlags1 & (PLAYER_STATE1_17 | PLAYER_STATE1_30))) { - func_808355DC(this); + // Lock-on was not started above. Set Parallel Mode. + if (!(this->stateFlags1 & (PLAYER_STATE1_PARALLEL | PLAYER_STATE1_LOCK_ON_FORCED_TO_RELEASE))) { + Player_SetParallel(this); } } } - if (this->unk_664 != NULL) { - if ((this->actor.category == ACTORCAT_PLAYER) && (this->unk_664 != this->unk_684) && - func_8002F0C8(this->unk_664, this, sp1C)) { - func_8008EDF0(this); - this->stateFlags1 |= PLAYER_STATE1_30; - } else if (this->unk_664 != NULL) { - this->unk_664->targetPriority = 40; + if (this->focusActor != NULL) { + if ((this->actor.category == ACTORCAT_PLAYER) && (this->focusActor != this->autoLockOnActor) && + Attention_ShouldReleaseLockOn(this->focusActor, this, ignoreLeash)) { + Player_ReleaseLockOn(this); + this->stateFlags1 |= PLAYER_STATE1_LOCK_ON_FORCED_TO_RELEASE; + } else if (this->focusActor != NULL) { + this->focusActor->attentionPriority = 40; } - } else if (this->unk_684 != NULL) { - this->unk_664 = this->unk_684; + } else if (this->autoLockOnActor != NULL) { + // Because of the previous if condition above, `autoLockOnActor` does not take precedence + // over `focusActor` if it already exists. + // However, `autoLockOnActor` is expected to be set with `Player_SetAutoLockOnActor` + // which will release any existing lock-on before setting the new one. + this->focusActor = this->autoLockOnActor; } } - if (this->unk_664 != NULL) { - this->stateFlags1 &= ~(PLAYER_STATE1_16 | PLAYER_STATE1_17); - if ((this->stateFlags1 & PLAYER_STATE1_11) || - !CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2)) { - this->stateFlags1 |= PLAYER_STATE1_16; + if (this->focusActor != NULL) { + this->stateFlags1 &= ~(PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS | PLAYER_STATE1_PARALLEL); + + // Check if an actor is not hostile, aka "friendly", to set `PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS`. + // + // When carrying another actor, `PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS` will be set even if the actor + // is hostile. This is a special case to allow Player to have more freedom of movement and be able + // to throw a carried actor at the lock-on actor, even if it is hostile. + if ((this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) || + !CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) { + this->stateFlags1 |= PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS; } } else { - if (this->stateFlags1 & PLAYER_STATE1_17) { - this->stateFlags2 &= ~PLAYER_STATE2_13; + if (this->stateFlags1 & PLAYER_STATE1_PARALLEL) { + this->stateFlags2 &= ~PLAYER_STATE2_LOCK_ON_WITH_SWITCH; } else { - func_8008EE08(this); + Player_ClearZTargeting(this); } } } else { - func_8008EE08(this); + Player_ClearZTargeting(this); } } @@ -3728,8 +4084,14 @@ s32 Player_CalcSpeedAndYawFromControlStick(PlayState* play, Player* this, f32* o return false; } -s32 func_8083721C(Player* this) { - return Math_StepToF(&this->speedXZ, 0.0f, REG(43) / 100.0f); +/** + * Steps speed toward zero to at a rate defined by current boot data. + * After zero is reached, speed will be held at zero. + * + * @return true if speed is 0, false otherwise + */ +s32 Player_DecelerateToZero(Player* this) { + return Math_StepToF(&this->speedXZ, 0.0f, R_DECELERATE_RATE / 100.0f); } /** @@ -3750,13 +4112,13 @@ s32 Player_GetMovementSpeedAndYaw(Player* this, f32* outSpeedTarget, s16* outYaw if (!Player_CalcSpeedAndYawFromControlStick(play, this, outSpeedTarget, outYawTarget, speedMode)) { *outYawTarget = this->actor.shape.rot.y; - if (this->unk_664 != NULL) { - if ((play->actorCtx.targetCtx.unk_4B != 0) && !(this->stateFlags2 & PLAYER_STATE2_6)) { - *outYawTarget = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_664->focus.pos); + if (this->focusActor != NULL) { + if ((play->actorCtx.attention.reticleSpinCounter != 0) && !(this->stateFlags2 & PLAYER_STATE2_6)) { + *outYawTarget = Math_Vec3f_Yaw(&this->actor.world.pos, &this->focusActor->focus.pos); return false; } - } else if (func_80833B2C(this)) { - *outYawTarget = this->zTargetYaw; + } else if (Player_FriendlyLockOnOrParallel(this)) { + *outYawTarget = this->parallelYaw; } return false; @@ -3766,137 +4128,143 @@ s32 Player_GetMovementSpeedAndYaw(Player* this, f32* outSpeedTarget, s16* outYaw } } -typedef enum { - /* 0 */ PLAYER_ACTION_CHG_0, - /* 1 */ PLAYER_ACTION_CHG_1, - /* 2 */ PLAYER_ACTION_CHG_2, - /* 3 */ PLAYER_ACTION_CHG_3, - /* 4 */ PLAYER_ACTION_CHG_4, - /* 5 */ PLAYER_ACTION_CHG_5, - /* 6 */ PLAYER_ACTION_CHG_6, - /* 7 */ PLAYER_ACTION_CHG_7, - /* 8 */ PLAYER_ACTION_CHG_8, - /* 9 */ PLAYER_ACTION_CHG_9, - /* 10 */ PLAYER_ACTION_CHG_10, - /* 11 */ PLAYER_ACTION_CHG_11, - /* 12 */ PLAYER_ACTION_CHG_12, - /* 13 */ PLAYER_ACTION_CHG_13 -} ActionChangeIndex; - -static s8 sActionChangeList1[] = { - PLAYER_ACTION_CHG_13, PLAYER_ACTION_CHG_2, PLAYER_ACTION_CHG_4, PLAYER_ACTION_CHG_9, - PLAYER_ACTION_CHG_10, PLAYER_ACTION_CHG_11, PLAYER_ACTION_CHG_8, -PLAYER_ACTION_CHG_7, +typedef enum ActionHandlerIndex { + /* 0 */ PLAYER_ACTION_HANDLER_0, + /* 1 */ PLAYER_ACTION_HANDLER_1, + /* 2 */ PLAYER_ACTION_HANDLER_2, + /* 3 */ PLAYER_ACTION_HANDLER_3, + /* 4 */ PLAYER_ACTION_HANDLER_TALK, + /* 5 */ PLAYER_ACTION_HANDLER_5, + /* 6 */ PLAYER_ACTION_HANDLER_ROLL, + /* 7 */ PLAYER_ACTION_HANDLER_7, + /* 8 */ PLAYER_ACTION_HANDLER_8, + /* 9 */ PLAYER_ACTION_HANDLER_9, + /* 10 */ PLAYER_ACTION_HANDLER_10, + /* 11 */ PLAYER_ACTION_HANDLER_11, + /* 12 */ PLAYER_ACTION_HANDLER_12, + /* 13 */ PLAYER_ACTION_HANDLER_13 +} ActionHandlerIndex; + +static s8 sActionHandlerList1[] = { + PLAYER_ACTION_HANDLER_13, PLAYER_ACTION_HANDLER_2, PLAYER_ACTION_HANDLER_TALK, PLAYER_ACTION_HANDLER_9, + PLAYER_ACTION_HANDLER_10, PLAYER_ACTION_HANDLER_11, PLAYER_ACTION_HANDLER_8, -PLAYER_ACTION_HANDLER_7, }; -static s8 sActionChangeList2[] = { - PLAYER_ACTION_CHG_13, PLAYER_ACTION_CHG_1, PLAYER_ACTION_CHG_2, PLAYER_ACTION_CHG_5, - PLAYER_ACTION_CHG_3, PLAYER_ACTION_CHG_4, PLAYER_ACTION_CHG_9, PLAYER_ACTION_CHG_10, - PLAYER_ACTION_CHG_11, PLAYER_ACTION_CHG_7, PLAYER_ACTION_CHG_8, -PLAYER_ACTION_CHG_6, +static s8 sActionHandlerList2[] = { + PLAYER_ACTION_HANDLER_13, PLAYER_ACTION_HANDLER_1, PLAYER_ACTION_HANDLER_2, PLAYER_ACTION_HANDLER_5, + PLAYER_ACTION_HANDLER_3, PLAYER_ACTION_HANDLER_TALK, PLAYER_ACTION_HANDLER_9, PLAYER_ACTION_HANDLER_10, + PLAYER_ACTION_HANDLER_11, PLAYER_ACTION_HANDLER_7, PLAYER_ACTION_HANDLER_8, -PLAYER_ACTION_HANDLER_ROLL, }; -static s8 sActionChangeList3[] = { - PLAYER_ACTION_CHG_13, PLAYER_ACTION_CHG_1, PLAYER_ACTION_CHG_2, PLAYER_ACTION_CHG_3, - PLAYER_ACTION_CHG_4, PLAYER_ACTION_CHG_9, PLAYER_ACTION_CHG_10, PLAYER_ACTION_CHG_11, - PLAYER_ACTION_CHG_8, PLAYER_ACTION_CHG_7, -PLAYER_ACTION_CHG_6, +static s8 sActionHandlerList3[] = { + PLAYER_ACTION_HANDLER_13, PLAYER_ACTION_HANDLER_1, PLAYER_ACTION_HANDLER_2, PLAYER_ACTION_HANDLER_3, + PLAYER_ACTION_HANDLER_TALK, PLAYER_ACTION_HANDLER_9, PLAYER_ACTION_HANDLER_10, PLAYER_ACTION_HANDLER_11, + PLAYER_ACTION_HANDLER_8, PLAYER_ACTION_HANDLER_7, -PLAYER_ACTION_HANDLER_ROLL, }; -static s8 sActionChangeList4[] = { - PLAYER_ACTION_CHG_13, PLAYER_ACTION_CHG_2, PLAYER_ACTION_CHG_4, PLAYER_ACTION_CHG_9, - PLAYER_ACTION_CHG_10, PLAYER_ACTION_CHG_11, PLAYER_ACTION_CHG_8, -PLAYER_ACTION_CHG_7, +static s8 sActionHandlerList4[] = { + PLAYER_ACTION_HANDLER_13, PLAYER_ACTION_HANDLER_2, PLAYER_ACTION_HANDLER_TALK, PLAYER_ACTION_HANDLER_9, + PLAYER_ACTION_HANDLER_10, PLAYER_ACTION_HANDLER_11, PLAYER_ACTION_HANDLER_8, -PLAYER_ACTION_HANDLER_7, }; -static s8 sActionChangeList5[] = { - PLAYER_ACTION_CHG_13, PLAYER_ACTION_CHG_2, PLAYER_ACTION_CHG_4, PLAYER_ACTION_CHG_9, PLAYER_ACTION_CHG_10, - PLAYER_ACTION_CHG_11, PLAYER_ACTION_CHG_12, PLAYER_ACTION_CHG_8, -PLAYER_ACTION_CHG_7, +static s8 sActionHandlerList5[] = { + PLAYER_ACTION_HANDLER_13, PLAYER_ACTION_HANDLER_2, PLAYER_ACTION_HANDLER_TALK, + PLAYER_ACTION_HANDLER_9, PLAYER_ACTION_HANDLER_10, PLAYER_ACTION_HANDLER_11, + PLAYER_ACTION_HANDLER_12, PLAYER_ACTION_HANDLER_8, -PLAYER_ACTION_HANDLER_7, }; -static s8 sActionChangeList6[] = { - -PLAYER_ACTION_CHG_7, +static s8 sActionHandlerListTurnInPlace[] = { + -PLAYER_ACTION_HANDLER_7, }; -static s8 sActionChangeList7[] = { - PLAYER_ACTION_CHG_0, PLAYER_ACTION_CHG_11, PLAYER_ACTION_CHG_1, PLAYER_ACTION_CHG_2, - PLAYER_ACTION_CHG_3, PLAYER_ACTION_CHG_5, PLAYER_ACTION_CHG_4, PLAYER_ACTION_CHG_9, - PLAYER_ACTION_CHG_8, PLAYER_ACTION_CHG_7, -PLAYER_ACTION_CHG_6, +static s8 sActionHandlerListIdle[] = { + PLAYER_ACTION_HANDLER_0, PLAYER_ACTION_HANDLER_11, PLAYER_ACTION_HANDLER_1, PLAYER_ACTION_HANDLER_2, + PLAYER_ACTION_HANDLER_3, PLAYER_ACTION_HANDLER_5, PLAYER_ACTION_HANDLER_TALK, PLAYER_ACTION_HANDLER_9, + PLAYER_ACTION_HANDLER_8, PLAYER_ACTION_HANDLER_7, -PLAYER_ACTION_HANDLER_ROLL, }; -static s8 sActionChangeList8[] = { - PLAYER_ACTION_CHG_0, PLAYER_ACTION_CHG_11, PLAYER_ACTION_CHG_1, PLAYER_ACTION_CHG_2, - PLAYER_ACTION_CHG_3, PLAYER_ACTION_CHG_12, PLAYER_ACTION_CHG_5, PLAYER_ACTION_CHG_4, - PLAYER_ACTION_CHG_9, PLAYER_ACTION_CHG_8, PLAYER_ACTION_CHG_7, -PLAYER_ACTION_CHG_6, +static s8 sActionHandlerList8[] = { + PLAYER_ACTION_HANDLER_0, PLAYER_ACTION_HANDLER_11, PLAYER_ACTION_HANDLER_1, PLAYER_ACTION_HANDLER_2, + PLAYER_ACTION_HANDLER_3, PLAYER_ACTION_HANDLER_12, PLAYER_ACTION_HANDLER_5, PLAYER_ACTION_HANDLER_TALK, + PLAYER_ACTION_HANDLER_9, PLAYER_ACTION_HANDLER_8, PLAYER_ACTION_HANDLER_7, -PLAYER_ACTION_HANDLER_ROLL, }; -static s8 sActionChangeList9[] = { - PLAYER_ACTION_CHG_13, PLAYER_ACTION_CHG_1, PLAYER_ACTION_CHG_2, PLAYER_ACTION_CHG_3, PLAYER_ACTION_CHG_12, - PLAYER_ACTION_CHG_5, PLAYER_ACTION_CHG_4, PLAYER_ACTION_CHG_9, PLAYER_ACTION_CHG_10, PLAYER_ACTION_CHG_11, - PLAYER_ACTION_CHG_8, PLAYER_ACTION_CHG_7, -PLAYER_ACTION_CHG_6, +static s8 sActionHandlerList9[] = { + PLAYER_ACTION_HANDLER_13, PLAYER_ACTION_HANDLER_1, PLAYER_ACTION_HANDLER_2, PLAYER_ACTION_HANDLER_3, + PLAYER_ACTION_HANDLER_12, PLAYER_ACTION_HANDLER_5, PLAYER_ACTION_HANDLER_TALK, PLAYER_ACTION_HANDLER_9, + PLAYER_ACTION_HANDLER_10, PLAYER_ACTION_HANDLER_11, PLAYER_ACTION_HANDLER_8, PLAYER_ACTION_HANDLER_7, + -PLAYER_ACTION_HANDLER_ROLL, }; -static s8 sActionChangeList10[] = { - PLAYER_ACTION_CHG_10, - PLAYER_ACTION_CHG_8, - -PLAYER_ACTION_CHG_7, +static s8 sActionHandlerList10[] = { + PLAYER_ACTION_HANDLER_10, + PLAYER_ACTION_HANDLER_8, + -PLAYER_ACTION_HANDLER_7, }; -static s8 sActionChangeList11[] = { - PLAYER_ACTION_CHG_0, - PLAYER_ACTION_CHG_12, - PLAYER_ACTION_CHG_5, - -PLAYER_ACTION_CHG_4, +static s8 sActionHandlerList11[] = { + PLAYER_ACTION_HANDLER_0, + PLAYER_ACTION_HANDLER_12, + PLAYER_ACTION_HANDLER_5, + -PLAYER_ACTION_HANDLER_TALK, }; -s32 Player_ActionChange_0(Player* this, PlayState* play); -s32 Player_ActionChange_1(Player* this, PlayState* play); -s32 Player_ActionChange_2(Player* this, PlayState* play); -s32 Player_ActionChange_3(Player* this, PlayState* play); -s32 Player_ActionChange_4(Player* this, PlayState* play); -s32 Player_ActionChange_5(Player* this, PlayState* play); -s32 Player_ActionChange_6(Player* this, PlayState* play); -s32 Player_ActionChange_7(Player* this, PlayState* play); -s32 Player_ActionChange_8(Player* this, PlayState* play); -s32 Player_ActionChange_9(Player* this, PlayState* play); -s32 Player_ActionChange_10(Player* this, PlayState* play); -s32 Player_ActionChange_11(Player* this, PlayState* play); -s32 Player_ActionChange_12(Player* this, PlayState* play); -s32 Player_ActionChange_13(Player* this, PlayState* play); - -static s32 (*sActionChangeFuncs[])(Player* this, PlayState* play) = { - /* PLAYER_ACTION_CHG_0 */ Player_ActionChange_0, - /* PLAYER_ACTION_CHG_1 */ Player_ActionChange_1, - /* PLAYER_ACTION_CHG_2 */ Player_ActionChange_2, - /* PLAYER_ACTION_CHG_3 */ Player_ActionChange_3, - /* PLAYER_ACTION_CHG_4 */ Player_ActionChange_4, - /* PLAYER_ACTION_CHG_5 */ Player_ActionChange_5, - /* PLAYER_ACTION_CHG_6 */ Player_ActionChange_6, - /* PLAYER_ACTION_CHG_7 */ Player_ActionChange_7, - /* PLAYER_ACTION_CHG_8 */ Player_ActionChange_8, - /* PLAYER_ACTION_CHG_9 */ Player_ActionChange_9, - /* PLAYER_ACTION_CHG_10 */ Player_ActionChange_10, - /* PLAYER_ACTION_CHG_11 */ Player_ActionChange_11, - /* PLAYER_ACTION_CHG_12 */ Player_ActionChange_12, - /* PLAYER_ACTION_CHG_13 */ Player_ActionChange_13, +s32 Player_ActionHandler_0(Player* this, PlayState* play); +s32 Player_ActionHandler_1(Player* this, PlayState* play); +s32 Player_ActionHandler_2(Player* this, PlayState* play); +s32 Player_ActionHandler_3(Player* this, PlayState* play); +s32 Player_ActionHandler_Talk(Player* this, PlayState* play); +s32 Player_ActionHandler_5(Player* this, PlayState* play); +s32 Player_ActionHandler_Roll(Player* this, PlayState* play); +s32 Player_ActionHandler_7(Player* this, PlayState* play); +s32 Player_ActionHandler_8(Player* this, PlayState* play); +s32 Player_ActionHandler_9(Player* this, PlayState* play); +s32 Player_ActionHandler_10(Player* this, PlayState* play); +s32 Player_ActionHandler_11(Player* this, PlayState* play); +s32 Player_ActionHandler_12(Player* this, PlayState* play); +s32 Player_ActionHandler_13(Player* this, PlayState* play); + +static s32 (*sActionHandlerFuncs[])(Player* this, PlayState* play) = { + Player_ActionHandler_0, // PLAYER_ACTION_HANDLER_0 + Player_ActionHandler_1, // PLAYER_ACTION_HANDLER_1 + Player_ActionHandler_2, // PLAYER_ACTION_HANDLER_2 + Player_ActionHandler_3, // PLAYER_ACTION_HANDLER_3 + Player_ActionHandler_Talk, // PLAYER_ACTION_HANDLER_TALK + Player_ActionHandler_5, // PLAYER_ACTION_HANDLER_5 + Player_ActionHandler_Roll, // PLAYER_ACTION_HANDLER_ROLL + Player_ActionHandler_7, // PLAYER_ACTION_HANDLER_7 + Player_ActionHandler_8, // PLAYER_ACTION_HANDLER_8 + Player_ActionHandler_9, // PLAYER_ACTION_HANDLER_9 + Player_ActionHandler_10, // PLAYER_ACTION_HANDLER_10 + Player_ActionHandler_11, // PLAYER_ACTION_HANDLER_11 + Player_ActionHandler_12, // PLAYER_ACTION_HANDLER_12 + Player_ActionHandler_13, // PLAYER_ACTION_HANDLER_13 }; /** - * This function processes "Action Change Lists", which run various functions that - * check if it is appropriate to change to a new action. + * This function processes "Action Handler Lists". + * + * An Action Handler is a function that "listens" for certain conditions or the right time + * to change to a certain action. These can include actions triggered manually by the player + * or actions that happen automatically, given some other condition(s). * - * Action Change Lists are a list of indices for the `sActionChangeFuncs` array. - * The functions are ran in order until one of them returns true, or the end of the list is reached. - * An Action Change index having a negative value indicates that it is the last member in the list. + * Action Handler Lists are a list of indices for the `sActionHandlerFuncs` array. + * The Action Handlers are ran in order until one of them returns true, or the end of the list is reached. + * An Action Handler index having a negative value indicates that it is the last member in the list. * - * Because these lists are processed sequentially, the order of the indices in the list determines its priority. + * Because these lists are processed sequentially, the order of the indices in the list + * determines an Action Handler's priority. * - * If the `updateUpperBody` argument is true, Player's upper body will update before the Action Change List - * is processed. This allows for Item Action functions to run. + * If the `updateUpperBody` argument is true, Player's upper body will update before the Action Handler List + * is processed. This allows for Item Action functions to run, for example. * * @return true if a new action has been chosen * */ -s32 Player_TryActionChangeList(PlayState* play, Player* this, s8* actionChangeList, s32 updateUpperBody) { +s32 Player_TryActionHandlerList(PlayState* play, Player* this, s8* actionHandlerList, s32 updateUpperBody) { s32 i; - if (!(this->stateFlags1 & (PLAYER_STATE1_0 | PLAYER_STATE1_7 | PLAYER_STATE1_29))) { + if (!(this->stateFlags1 & (PLAYER_STATE1_0 | PLAYER_STATE1_DEAD | PLAYER_STATE1_29))) { if (updateUpperBody) { sUpperBodyIsBusy = Player_UpdateUpperBody(this, play); @@ -3906,22 +4274,22 @@ s32 Player_TryActionChangeList(PlayState* play, Player* this, s8* actionChangeLi } if (func_8008F128(this)) { - this->unk_6AE |= 0x41; + this->unk_6AE_rotFlags |= UNK6AE_ROT_FOCUS_X | UNK6AE_ROT_UPPER_X; return true; } if (!(this->stateFlags1 & PLAYER_STATE1_START_CHANGING_HELD_ITEM) && (Player_UpperAction_ChangeHeldItem != this->upperActionFunc)) { - // Process all entries in the Action Change List with a positive index - while (*actionChangeList >= 0) { - if (sActionChangeFuncs[*actionChangeList](this, play)) { + // Process all entries in the Action Handler List with a positive index + while (*actionHandlerList >= 0) { + if (sActionHandlerFuncs[*actionHandlerList](this, play)) { return true; } - actionChangeList++; + actionHandlerList++; } // Try the last entry in the list. Negate the index to make it positive again. - if (sActionChangeFuncs[-(*actionChangeList)](this, play)) { + if (sActionHandlerFuncs[-(*actionHandlerList)](this, play)) { return true; } } @@ -3930,7 +4298,7 @@ s32 Player_TryActionChangeList(PlayState* play, Player* this, s8* actionChangeLi return false; } -typedef enum { +typedef enum PlayerActionInterruptResult { /* -1 */ PLAYER_INTERRUPT_NONE = -1, /* 0 */ PLAYER_INTERRUPT_NEW_ACTION, /* 1 */ PLAYER_INTERRUPT_MOVE @@ -3939,14 +4307,14 @@ typedef enum { /** * An Action Interrupt allows for ending an action early, toward the end of an animation. * - * First, `sActionChangeList7` will be checked to see if any of those actions should be used. - * It should be noted that the `updateUpperBody` argument passed to `Player_TryActionChangeList` + * First, `sActionHandlerListIdle` will be checked to see if any of those actions should be used. + * It should be noted that the `updateUpperBody` argument passed to `Player_TryActionHandlerList` * is `true`. This means that an item can be used during the interrupt window. * - * If no actions from the Action Change List are used, then the control stick is checked to see if + * If no actions from the Action Handler List are used, then the control stick is checked to see if * any movement should occur. * - * Note that while this function can set up a new action with `sActionChangeList7`, this function + * Note that while this function can set up a new action with `sActionHandlerListIdle`, this function * will not set up an appropriate action for moving. * It is the callers responsibility to react accordingly to `PLAYER_INTERRUPT_MOVE`. * @@ -3958,7 +4326,7 @@ s32 Player_TryActionInterrupt(PlayState* play, Player* this, SkelAnime* skelAnim s16 yawTarget; if ((skelAnime->endFrame - frameRange) <= skelAnime->curFrame) { - if (Player_TryActionChangeList(play, this, sActionChangeList7, true)) { + if (Player_TryActionHandlerList(play, this, sActionHandlerListIdle, true)) { return PLAYER_INTERRUPT_NEW_ACTION; } @@ -3977,7 +4345,7 @@ void func_80837530(PlayState* play, Player* this, s32 arg2) { this->unk_858 = 0.5f; } - this->stateFlags1 |= PLAYER_STATE1_12; + this->stateFlags1 |= PLAYER_STATE1_CHARGING_SPIN_ATTACK; if (this->actor.category == ACTORCAT_PLAYER) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_M_THUNDER, this->bodyPartsPos[PLAYER_BODYPART_WAIST].x, @@ -4078,7 +4446,7 @@ s32 func_80837818(Player* this) { sp18 = PLAYER_MWA_SPIN_ATTACK_1H; } else { if (controlStickDirection <= PLAYER_STICK_DIR_NONE) { - if (func_80833BCC(this)) { + if (Player_IsZTargeting(this)) { sp18 = PLAYER_MWA_FORWARD_SLASH_1H; } else { sp18 = PLAYER_MWA_RIGHT_SLASH_1H; @@ -4089,7 +4457,7 @@ s32 func_80837818(Player* this) { if (sp18 == PLAYER_MWA_STAB_1H) { this->stateFlags2 |= PLAYER_STATE2_30; - if (!func_80833BCC(this)) { + if (!Player_IsZTargeting(this)) { sp18 = PLAYER_MWA_FORWARD_SLASH_1H; } } @@ -4147,8 +4515,8 @@ void func_80837948(PlayState* play, Player* this, s32 arg2) { Player_AnimPlayOnceAdjusted(play, this, D_80854190[arg2].unk_00); if ((arg2 != PLAYER_MWA_FLIPSLASH_START) && (arg2 != PLAYER_MWA_JUMPSLASH_START)) { - Player_AnimReplaceApplyFlags(play, this, - ANIM_REPLACE_APPLY_FLAG_9 | ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_PLAYER_SETMOVE); + Player_StartAnimMovement(play, this, + PLAYER_ANIM_MOVEMENT_RESET_BY_AGE | ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_ENABLE_MOVEMENT); } this->yaw = this->actor.shape.rot.y; @@ -4169,23 +4537,46 @@ void func_80837948(PlayState* play, Player* this, s32 arg2) { func_80837918(this, 1, dmgFlags); } -void func_80837AE0(Player* this, s32 timer) { +/** + * Gives the player intangibility frames. Used for when the player takes damage. + * + * If the player is already intangible, it will be overridden by the new intangibility duration. + * If the player is already invunerable, no intangibility will be applied. + * + * @param timer must be a positive value representing the number of intangibility frames. + * @note Intangibility prevents taking damage and responses to damage like knockback, while invulnerability only + * prevents taking damage. + */ +void Player_SetIntangibility(Player* this, s32 timer) { if (this->invincibilityTimer >= 0) { this->invincibilityTimer = timer; - this->unk_88F = 0; + this->damageFlickerAnimCounter = 0; } } -void func_80837AFC(Player* this, s32 timer) { +/** + * Gives the player invulnerability frames. Used for when the player performs a dodging maneuver like a roll. + * + * If the player is already intangible, they will become invulnerable instead. + * If the player is already invulnerable, the longer of the two invulnerability periods is kept. + * + * @param timer must be a negative value representing the number of invulnerability frames. + * @note Intangibility prevents taking damage and responses to damage like knockback, while invulnerability only + * prevents taking damage. + */ +void Player_SetInvulnerability(Player* this, s32 timer) { if (this->invincibilityTimer > timer) { this->invincibilityTimer = timer; } - this->unk_88F = 0; + this->damageFlickerAnimCounter = 0; } +/** + * @return false if player is out of health + */ s32 func_80837B18(PlayState* play, Player* this, s32 damage) { if ((this->invincibilityTimer != 0) || (this->actor.category != ACTORCAT_PLAYER)) { - return 1; + return true; } return Health_ChangeBy(play, damage); @@ -4193,7 +4584,7 @@ s32 func_80837B18(PlayState* play, Player* this, s32 damage) { void func_80837B60(Player* this) { this->skelAnime.prevTransl = this->skelAnime.jointTable[0]; - func_80832E48(this, ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y); + Player_ApplyAnimMovementScaledByAge(this, ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y); } void func_80837B9C(Player* this, PlayState* play) { @@ -4211,7 +4602,8 @@ static LinkAnimationHeader* D_808544B0[] = { &gPlayerAnim_link_normal_back_hit, &gPlayerAnim_link_anchor_back_hitR, }; -void func_80837C0C(PlayState* play, Player* this, s32 arg2, f32 arg3, f32 arg4, s16 arg5, s32 arg6) { +void func_80837C0C(PlayState* play, Player* this, s32 damageResponseType, f32 speed, f32 yVelocity, s16 yRot, + s32 invincibilityTimer) { LinkAnimationHeader* anim = NULL; LinkAnimationHeader** sp28; @@ -4231,9 +4623,9 @@ void func_80837C0C(PlayState* play, Player* this, s32 arg2, f32 arg3, f32 arg4, return; } - func_80837AE0(this, arg6); + Player_SetIntangibility(this, invincibilityTimer); - if (arg2 == 3) { + if (damageResponseType == PLAYER_HIT_RESPONSE_ICE_TRAP) { Player_SetupAction(play, this, Player_Action_8084FB10, 0); anim = &gPlayerAnim_link_normal_ice_down; @@ -4242,8 +4634,8 @@ void func_80837C0C(PlayState* play, Player* this, s32 arg2, f32 arg3, f32 arg4, Player_RequestRumble(this, 255, 10, 40, 0); Player_PlaySfx(this, NA_SE_PL_FREEZE_S); - func_80832698(this, NA_SE_VO_LI_FREEZE); - } else if (arg2 == 4) { + Player_PlayVoiceSfx(this, NA_SE_VO_LI_FREEZE); + } else if (damageResponseType == PLAYER_HIT_RESPONSE_ELECTRIC_SHOCK) { Player_SetupAction(play, this, Player_Action_8084FBF4, 0); Player_RequestRumble(this, 255, 80, 150, 0); @@ -4253,7 +4645,7 @@ void func_80837C0C(PlayState* play, Player* this, s32 arg2, f32 arg3, f32 arg4, this->av2.actionVar2 = 20; } else { - arg5 -= this->actor.shape.rot.y; + yRot -= this->actor.shape.rot.y; if (this->stateFlags1 & PLAYER_STATE1_27) { Player_SetupAction(play, this, Player_Action_8084E30C, 0); Player_RequestRumble(this, 180, 20, 50, 0); @@ -4263,8 +4655,10 @@ void func_80837C0C(PlayState* play, Player* this, s32 arg2, f32 arg3, f32 arg4, anim = &gPlayerAnim_link_swimer_swim_hit; - func_80832698(this, NA_SE_VO_LI_DAMAGE_S); - } else if ((arg2 == 1) || (arg2 == 2) || !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + Player_PlayVoiceSfx(this, NA_SE_VO_LI_DAMAGE_S); + } else if ((damageResponseType == PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE) || + (damageResponseType == PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL) || + !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21))) { Player_SetupAction(play, this, Player_Action_8084377C, 0); @@ -4273,7 +4667,7 @@ void func_80837C0C(PlayState* play, Player* this, s32 arg2, f32 arg3, f32 arg4, Player_RequestRumble(this, 255, 20, 150, 0); func_80832224(this); - if (arg2 == 2) { + if (damageResponseType == PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL) { this->av2.actionVar2 = 4; this->actor.speed = 3.0f; @@ -4281,32 +4675,32 @@ void func_80837C0C(PlayState* play, Player* this, s32 arg2, f32 arg3, f32 arg4, this->actor.velocity.y = 6.0f; Player_AnimChangeFreeze(play, this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_damage_run, this->modelAnimType)); - func_80832698(this, NA_SE_VO_LI_DAMAGE_S); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_DAMAGE_S); } else { - this->actor.speed = arg3; - this->speedXZ = arg3; - this->actor.velocity.y = arg4; + this->actor.speed = speed; + this->speedXZ = speed; + this->actor.velocity.y = yVelocity; - if (ABS(arg5) > 0x4000) { + if (ABS(yRot) > 0x4000) { anim = &gPlayerAnim_link_normal_front_downA; } else { anim = &gPlayerAnim_link_normal_back_downA; } if ((this->actor.category != ACTORCAT_PLAYER) && (this->actor.colChkInfo.health == 0)) { - func_80832698(this, NA_SE_VO_BL_DOWN); + Player_PlayVoiceSfx(this, NA_SE_VO_BL_DOWN); } else { - func_80832698(this, NA_SE_VO_LI_FALL_L); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_FALL_L); } } this->hoverBootsTimer = 0; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; } else { - if ((this->speedXZ > 4.0f) && !func_8008E9C4(this)) { + if ((this->speedXZ > 4.0f) && !Player_CheckHostileLockOn(this)) { this->unk_890 = 20; Player_RequestRumble(this, 120, 20, 10, 0); - func_80832698(this, NA_SE_VO_LI_DAMAGE_S); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_DAMAGE_S); return; } @@ -4323,23 +4717,23 @@ void func_80837C0C(PlayState* play, Player* this, s32 arg2, f32 arg3, f32 arg4, sp28 += 4; } - if (ABS(arg5) <= 0x4000) { + if (ABS(yRot) <= 0x4000) { sp28 += 2; } - if (func_8008E9C4(this)) { + if (Player_CheckHostileLockOn(this)) { sp28 += 1; } anim = *sp28; - func_80832698(this, NA_SE_VO_LI_DAMAGE_S); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_DAMAGE_S); } - this->actor.shape.rot.y += arg5; + this->actor.shape.rot.y += yRot; this->yaw = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y; - if (ABS(arg5) > 0x4000) { + if (ABS(yRot) > 0x4000) { this->actor.shape.rot.y += 0x8000; } } @@ -4390,7 +4784,7 @@ void func_80838280(Player* this) { if (this->actor.colChkInfo.acHitEffect == 1) { func_8083821C(this); } - func_80832698(this, NA_SE_VO_LI_FALL_L); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_FALL_L); } void func_808382BC(Player* this) { @@ -4414,7 +4808,7 @@ s32 func_808382DC(Player* this, PlayState* play) { if (sp68 || (this->actor.bgCheckFlags & BGCHECKFLAG_CRUSHED) || (sFloorType == FLOOR_TYPE_9) || (this->stateFlags2 & PLAYER_STATE2_31)) { - func_80832698(this, NA_SE_VO_LI_DAMAGE_S); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_DAMAGE_S); if (sp68) { Play_TriggerRespawn(play); @@ -4442,20 +4836,26 @@ s32 func_808382DC(Player* this, PlayState* play) { Play_TriggerVoidOut(play); } - func_80832698(this, NA_SE_VO_LI_TAKEN_AWAY); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_TAKEN_AWAY); play->haltAllActors = true; Sfx_PlaySfxCentered(NA_SE_OC_ABYSS); - } else if ((this->unk_8A1 != 0) && ((this->unk_8A1 >= 2) || (this->invincibilityTimer == 0))) { - u8 sp5C[] = { 2, 1, 1 }; + } else if ((this->knockbackType != PLAYER_KNOCKBACK_NONE) && + ((this->knockbackType >= PLAYER_KNOCKBACK_LARGE) || (this->invincibilityTimer == 0))) { + u8 knockbackResponse[] = { + PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL, + PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE, + PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE, + }; func_80838280(this); - if (this->unk_8A1 == 3) { + if (this->knockbackType == PLAYER_KNOCKBACK_LARGE_SHOCK) { this->bodyShockTimer = 40; } - this->actor.colChkInfo.damage += this->unk_8A0; - func_80837C0C(play, this, sp5C[this->unk_8A1 - 1], this->unk_8A4, this->unk_8A8, this->unk_8A2, 20); + this->actor.colChkInfo.damage += this->knockbackDamage; + func_80837C0C(play, this, knockbackResponse[this->knockbackType - 1], this->knockbackSpeed, + this->knockbackYVelocity, this->knockbackRot, 20); } else { sp64 = (this->shieldQuad.base.acFlags & AC_BOUNCED) != 0; @@ -4519,16 +4919,16 @@ s32 func_808382DC(Player* this, PlayState* play) { } if (this->stateFlags1 & PLAYER_STATE1_27) { - sp4C = 0; + sp4C = PLAYER_HIT_RESPONSE_NONE; } else if (this->actor.colChkInfo.acHitEffect == 2) { - sp4C = 3; + sp4C = PLAYER_HIT_RESPONSE_ICE_TRAP; } else if (this->actor.colChkInfo.acHitEffect == 3) { - sp4C = 4; + sp4C = PLAYER_HIT_RESPONSE_ELECTRIC_SHOCK; } else if (this->actor.colChkInfo.acHitEffect == 4) { - sp4C = 1; + sp4C = PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE; } else { func_80838280(this); - sp4C = 0; + sp4C = PLAYER_HIT_RESPONSE_NONE; } func_80837C0C(play, this, sp4C, 4.0f, 5.0f, Actor_WorldYawTowardActor(ac, &this->actor), 20); @@ -4546,7 +4946,7 @@ s32 func_808382DC(Player* this, PlayState* play) { ((this->currentTunic != PLAYER_TUNIC_GORON) || (this->floorTypeTimer >= D_808544F4[sp48])))) { this->floorTypeTimer = 0; this->actor.colChkInfo.damage = 4; - func_80837C0C(play, this, 0, 4.0f, 5.0f, this->actor.shape.rot.y, 20); + func_80837C0C(play, this, PLAYER_HIT_RESPONSE_NONE, 4.0f, 5.0f, this->actor.shape.rot.y, 20); } else { return 0; } @@ -4564,12 +4964,12 @@ void func_80838940(Player* this, LinkAnimationHeader* anim, f32 arg2, PlayState* Player_AnimPlayOnceAdjusted(play, this, anim); } - this->actor.velocity.y = arg2 * D_808535E8; + this->actor.velocity.y = arg2 * sWaterSpeedFactor; this->hoverBootsTimer = 0; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; - func_80832854(this); - func_80832698(this, sfxId); + Player_PlayJumpingSfx(this); + Player_PlayVoiceSfx(this, sfxId); this->stateFlags1 |= PLAYER_STATE1_18; } @@ -4578,13 +4978,13 @@ void func_808389E8(Player* this, LinkAnimationHeader* anim, f32 arg2, PlayState* func_80838940(this, anim, arg2, play, NA_SE_VO_LI_SWORD_N); } -s32 Player_ActionChange_12(Player* this, PlayState* play) { +s32 Player_ActionHandler_12(Player* this, PlayState* play) { s32 sp3C; LinkAnimationHeader* anim; f32 sp34; f32 temp; - if (!(this->stateFlags1 & PLAYER_STATE1_11) && (this->ledgeClimbType >= PLAYER_LEDGE_CLIMB_2) && + if (!(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (this->ledgeClimbType >= PLAYER_LEDGE_CLIMB_2) && (!(this->stateFlags1 & PLAYER_STATE1_27) || (this->ageProperties->unk_14 > this->yDistToLedge))) { sp3C = 0; @@ -4682,7 +5082,7 @@ void func_80838E70(PlayState* play, Player* this, f32 arg2, s16 arg3) { this->unk_450.x = (Math_SinS(arg3) * arg2) + this->actor.world.pos.x; this->unk_450.z = (Math_CosS(arg3) * arg2) + this->actor.world.pos.z; - Player_AnimPlayOnce(play, this, func_80833338(this)); + Player_AnimPlayOnce(play, this, Player_GetIdleAnim(this)); } void func_80838F18(PlayState* play, Player* this) { @@ -4702,7 +5102,7 @@ s32 func_80838FB8(PlayState* play, Player* this) { if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (this->stateFlags1 & PLAYER_STATE1_31)) { func_80838F5C(play, this); Player_AnimPlayLoop(play, this, &gPlayerAnim_link_normal_landing_wait); - func_80832698(this, NA_SE_VO_LI_FALL_S); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_FALL_S); Sfx_PlaySfxCentered2(NA_SE_OC_SECRET_WARP_IN); return 1; } @@ -4723,7 +5123,7 @@ s32 func_80838FB8(PlayState* play, Player* this) { * * Note: grottos and normal fairy fountains use `ENTR_RETURN_GROTTO` */ -s16 sReturnEntranceGroupData[] = { +static s16 sReturnEntranceGroupData[] = { // ENTR_RETURN_GREAT_FAIRYS_FOUNTAIN_MAGIC /* 0 */ ENTR_DEATH_MOUNTAIN_TRAIL_4, // from Magic Fairy Fountain /* 1 */ ENTR_DEATH_MOUNTAIN_CRATER_3, // from Double Magic Fairy Fountain @@ -4754,7 +5154,7 @@ s16 sReturnEntranceGroupData[] = { /** * The values are indices into `sReturnEntranceGroupData` marking the start of each group */ -u8 sReturnEntranceGroupIndices[] = { +static u8 sReturnEntranceGroupIndices[] = { 11, // ENTR_RETURN_GREAT_FAIRYS_FOUNTAIN_SPELLS 9, // ENTR_RETURN_SHOOTING_GALLERY 3, // ENTR_RETURN_2 @@ -4770,7 +5170,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol if (this->actor.category == ACTORCAT_PLAYER) { exitIndex = 0; - if (!(this->stateFlags1 & PLAYER_STATE1_7) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && + if (!(this->stateFlags1 & PLAYER_STATE1_DEAD) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && (this->csAction == PLAYER_CSACTION_NONE) && !(this->stateFlags1 & PLAYER_STATE1_0) && (((poly != NULL) && (exitIndex = SurfaceType_GetExitIndex(&play->colCtx, poly, bgId), exitIndex != 0)) || (func_8083816C(sFloorType) && (this->floorProperty == FLOOR_PROPERTY_12)))) { @@ -4947,7 +5347,7 @@ s32 Player_PosVsWallLineTest(PlayState* play, Player* this, Vec3f* offset, Colli return BgCheck_EntityLineTest1(&play->colCtx, &posA, &posB, posResult, wallPoly, true, false, false, true, bgId); } -s32 Player_ActionChange_1(Player* this, PlayState* play) { +s32 Player_ActionHandler_1(Player* this, PlayState* play) { Actor* attachedActor; s32 pad3; s32 doorDirection; @@ -4958,14 +5358,14 @@ s32 Player_ActionChange_1(Player* this, PlayState* play) { s32 frontRoom; if ((this->doorType != PLAYER_DOORTYPE_NONE) && - (!(this->stateFlags1 & PLAYER_STATE1_11) || + (!(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) || ((this->heldActor != NULL) && (this->heldActor->id == ACTOR_EN_RU1)))) { if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) || (Player_Action_8084F9A0 == this->actionFunc)) { doorActor = this->doorActor; if (this->doorType <= PLAYER_DOORTYPE_AJAR) { doorActor->textId = 0xD0; - func_80853148(play, doorActor); + Player_StartTalking(play, doorActor); return 0; } @@ -5002,7 +5402,7 @@ s32 Player_ActionChange_1(Player* this, PlayState* play) { if (this->doorTimer != 0) { this->av2.actionVar2 = 0; - Player_AnimChangeOnceMorph(play, this, func_80833338(this)); + Player_AnimChangeOnceMorph(play, this, Player_GetIdleAnim(this)); this->skelAnime.endFrame = 0.0f; } else { this->speedXZ = 0.1f; @@ -5010,7 +5410,7 @@ s32 Player_ActionChange_1(Player* this, PlayState* play) { if (slidingDoor->dyna.actor.category == ACTORCAT_DOOR) { this->cv.slidingDoorBgCamIndex = - play->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(&slidingDoor->dyna.actor)] + play->transitionActors.list[GET_TRANSITION_ACTOR_INDEX(&slidingDoor->dyna.actor)] .sides[(doorDirection > 0) ? 0 : 1] .bgCamIndex; @@ -5057,10 +5457,10 @@ s32 Player_ActionChange_1(Player* this, PlayState* play) { } func_80832224(this); - Player_AnimReplaceApplyFlags(play, this, - ANIM_REPLACE_APPLY_FLAG_9 | ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | - ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | - ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_StartAnimMovement(play, this, + PLAYER_ANIM_MOVEMENT_RESET_BY_AGE | ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | + ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_OVERRIDE_MOVEMENT); // If this door is the second half of a double door (spawned as child) if (doorActor->parent != NULL) { @@ -5093,21 +5493,22 @@ s32 Player_ActionChange_1(Player* this, PlayState* play) { } } else { Camera_ChangeDoorCam(Play_GetCamera(play, CAM_ID_MAIN), doorActor, - play->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(doorActor)] + play->transitionActors.list[GET_TRANSITION_ACTOR_INDEX(doorActor)] .sides[(doorDirection > 0) ? 0 : 1] .bgCamIndex, - 0, 38.0f * D_808535EC, 26.0f * D_808535EC, 10.0f * D_808535EC); + 0, 38.0f * sInvWaterSpeedFactor, 26.0f * sInvWaterSpeedFactor, + 10.0f * sInvWaterSpeedFactor); } } } if ((this->doorType != PLAYER_DOORTYPE_FAKE) && (doorActor->category == ACTORCAT_DOOR)) { - frontRoom = play->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(doorActor)] + frontRoom = play->transitionActors.list[GET_TRANSITION_ACTOR_INDEX(doorActor)] .sides[(doorDirection > 0) ? 0 : 1] .room; if ((frontRoom >= 0) && (frontRoom != play->roomCtx.curRoom.num)) { - func_8009728C(play, &play->roomCtx, frontRoom); + Room_RequestNewRoom(play, &play->roomCtx, frontRoom); } } @@ -5144,14 +5545,14 @@ void func_80839E88(Player* this, PlayState* play) { void func_80839F30(Player* this, PlayState* play) { Player_SetupAction(play, this, Player_Action_808407CC, 1); - Player_AnimChangeOnceMorph(play, this, func_80833338(this)); + Player_AnimChangeOnceMorph(play, this, Player_GetIdleAnim(this)); this->yaw = this->actor.shape.rot.y; } void func_80839F90(Player* this, PlayState* play) { - if (func_8008E9C4(this)) { + if (Player_CheckHostileLockOn(this)) { func_80839E88(this, play); - } else if (func_80833B2C(this)) { + } else if (Player_FriendlyLockOnOrParallel(this)) { func_80839F30(this, play); } else { func_80853080(this, play); @@ -5161,12 +5562,12 @@ void func_80839F90(Player* this, PlayState* play) { void func_80839FFC(Player* this, PlayState* play) { PlayerActionFunc actionFunc; - if (func_8008E9C4(this)) { + if (Player_CheckHostileLockOn(this)) { actionFunc = Player_Action_80840450; - } else if (func_80833B2C(this)) { + } else if (Player_FriendlyLockOnOrParallel(this)) { actionFunc = Player_Action_808407CC; } else { - actionFunc = Player_Action_80840BC8; + actionFunc = Player_Action_Idle; } Player_SetupAction(play, this, actionFunc, 1); @@ -5174,7 +5575,8 @@ void func_80839FFC(Player* this, PlayState* play) { void func_8083A060(Player* this, PlayState* play) { func_80839FFC(this, play); - if (func_8008E9C4(this)) { + + if (Player_CheckHostileLockOn(this)) { this->av2.actionVar2 = 1; } } @@ -5204,7 +5606,7 @@ void func_8083A0F4(PlayState* play, Player* this) { Player_SetupAction(play, this, Player_Action_80846120, 0); this->stateFlags1 |= PLAYER_STATE1_29; anim = &gPlayerAnim_link_normal_heavy_carry; - } else if ((interactActorId == ACTOR_EN_ISHI) && ((interactRangeActor->params & 0xF) == 1)) { + } else if ((interactActorId == ACTOR_EN_ISHI) && (PARAMS_GET_U(interactRangeActor->params, 0, 4) == 1)) { Player_SetupAction(play, this, Player_Action_80846260, 0); anim = &gPlayerAnim_link_silver_carry; } else if (((interactActorId == ACTOR_EN_BOMBF) || (interactActorId == ACTOR_EN_KUSA)) && @@ -5225,23 +5627,23 @@ void func_8083A0F4(PlayState* play, Player* this) { } } else { func_80839F90(this, play); - this->stateFlags1 &= ~PLAYER_STATE1_11; + this->stateFlags1 &= ~PLAYER_STATE1_CARRYING_ACTOR; } } -void func_8083A2F8(PlayState* play, Player* this) { - func_80835DAC(play, this, Player_Action_8084B530, 0); +void Player_SetupTalk(PlayState* play, Player* this) { + Player_SetupActionPreserveAnimMovement(play, this, Player_Action_Talk, 0); - this->stateFlags1 |= PLAYER_STATE1_6 | PLAYER_STATE1_29; + this->stateFlags1 |= PLAYER_STATE1_TALKING | PLAYER_STATE1_29; if (this->actor.textId != 0) { Message_StartTextbox(play, this->actor.textId, this->talkActor); - this->unk_664 = this->talkActor; + this->focusActor = this->talkActor; } } void func_8083A360(PlayState* play, Player* this) { - func_80835DAC(play, this, Player_Action_8084CC98, 0); + Player_SetupActionPreserveAnimMovement(play, this, Player_Action_8084CC98, 0); } void func_8083A388(PlayState* play, Player* this) { @@ -5252,7 +5654,7 @@ void func_8083A3B0(PlayState* play, Player* this) { s32 sp1C = this->av2.actionVar2; s32 sp18 = this->av1.actionVar1; - func_80835DAC(play, this, Player_Action_8084BF1C, 0); + Player_SetupActionPreserveAnimMovement(play, this, Player_Action_8084BF1C, 0); this->actor.velocity.y = 0.0f; this->av2.actionVar2 = sp1C; @@ -5260,11 +5662,11 @@ void func_8083A3B0(PlayState* play, Player* this) { } void func_8083A40C(PlayState* play, Player* this) { - func_80835DAC(play, this, Player_Action_8084C760, 0); + Player_SetupActionPreserveAnimMovement(play, this, Player_Action_8084C760, 0); } void func_8083A434(PlayState* play, Player* this) { - func_80835DAC(play, this, Player_Action_8084E6D4, 0); + Player_SetupActionPreserveAnimMovement(play, this, Player_Action_8084E6D4, 0); this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_29; @@ -5315,7 +5717,7 @@ void func_8083A5C4(PlayState* play, Player* this, CollisionPoly* arg2, f32 arg3, this->actor.shape.rot.y = this->yaw = Math_Atan2S(nz, nx); func_80832224(this); - Player_SkelAnimeResetPrevTranslRot(this); + Player_ResetAnimMovement(this); } s32 func_8083A6AC(Player* this, PlayState* play) { @@ -5369,20 +5771,20 @@ s32 func_8083A6AC(Player* this, PlayState* play) { this->actor.shape.rot.y = this->yaw; this->stateFlags1 |= PLAYER_STATE1_21; - Player_AnimReplaceApplyFlags(play, this, - ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_PLAYER_2 | - ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_NO_MOVE | - ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_StartAnimMovement(play, this, + ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | + ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_ADJUST_STARTING_POS | ANIM_FLAG_OVERRIDE_MOVEMENT); this->av2.actionVar2 = -1; this->av1.actionVar1 = sp50; } else { this->stateFlags1 |= PLAYER_STATE1_13; - this->stateFlags1 &= ~PLAYER_STATE1_17; + this->stateFlags1 &= ~PLAYER_STATE1_PARALLEL; } Player_PlaySfx(this, NA_SE_PL_SLIPDOWN); - func_80832698(this, NA_SE_VO_LI_HANG); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_HANG); return 1; } } @@ -5417,7 +5819,8 @@ void func_8083AA10(Player* this, PlayState* play) { return; } - if (!(this->stateFlags3 & PLAYER_STATE3_1) && !(this->skelAnime.moveFlags & ANIM_FLAG_OVERRIDE_MOVEMENT) && + if (!(this->stateFlags3 & PLAYER_STATE3_1) && + !(this->skelAnime.movementFlags & ANIM_FLAG_OVERRIDE_MOVEMENT) && (Player_Action_8084411C != this->actionFunc) && (Player_Action_80844A44 != this->actionFunc)) { if ((sPrevFloorProperty == FLOOR_PROPERTY_7) || (this->meleeWeaponState != 0)) { @@ -5444,7 +5847,8 @@ void func_8083AA10(Player* this, PlayState* play) { (sYDistToFloor > 20.0f) && (this->meleeWeaponState == 0) && (ABS(sp5C) < 0x2000) && (this->speedXZ > 3.0f)) { - if ((sPrevFloorProperty == FLOOR_PROPERTY_11) && !(this->stateFlags1 & PLAYER_STATE1_11)) { + if ((sPrevFloorProperty == FLOOR_PROPERTY_11) && + !(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR)) { sp40 = func_808396F4(play, this, &D_8085451C, &sp44, &sp58, &sp54); sp3C = this->actor.world.pos.y; @@ -5532,7 +5936,7 @@ void func_8083AE40(Player* this, s16 objectId) { } void func_8083AF44(PlayState* play, Player* this, s32 magicSpell) { - func_80835DE4(play, this, Player_Action_808507F4, 0); + Player_SetupActionPreserveItemAction(play, this, Player_Action_808507F4, 0); this->av1.actionVar1 = magicSpell - 3; @@ -5555,8 +5959,8 @@ void func_8083AF44(PlayState* play, Player* this, s32 magicSpell) { } void func_8083B010(Player* this) { - this->actor.focus.rot.x = this->actor.focus.rot.z = this->unk_6B6 = this->unk_6B8 = this->unk_6BA = this->unk_6BC = - this->unk_6BE = this->unk_6C0 = 0; + this->actor.focus.rot.x = this->actor.focus.rot.z = this->headLimbRot.x = this->headLimbRot.y = + this->headLimbRot.z = this->upperLimbRot.x = this->upperLimbRot.y = this->upperLimbRot.z = 0; this->actor.focus.rot.y = this->actor.shape.rot.y; } @@ -5599,7 +6003,7 @@ static LinkAnimationHeader* D_80854548[] = { &gPlayerAnim_link_normal_take_out, }; -s32 Player_ActionChange_13(Player* this, PlayState* play) { +s32 Player_ActionHandler_13(Player* this, PlayState* play) { s32 sp2C; s32 sp28; GetItemEntry* giEntry; @@ -5617,7 +6021,7 @@ s32 Player_ActionChange_13(Player* this, PlayState* play) { } else { Player_SetupAction(play, this, Player_Action_8085063C, 1); this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29; - Player_AnimPlayOnce(play, this, func_80833338(this)); + Player_AnimPlayOnce(play, this, Player_GetIdleAnim(this)); func_80835EA4(play, 4); } @@ -5635,14 +6039,14 @@ s32 Player_ActionChange_13(Player* this, PlayState* play) { (this->exchangeItemId == EXCH_ITEM_BOTTLE_BLUE_FIRE))))))) { if ((play->actorCtx.titleCtx.delayTimer == 0) && (play->actorCtx.titleCtx.alpha == 0)) { - func_80835DE4(play, this, Player_Action_8084F104, 0); + Player_SetupActionPreserveItemAction(play, this, Player_Action_ExchangeItem, 0); if (sp2C >= 0) { giEntry = &sGetItemTable[D_80854528[sp2C] - 1]; func_8083AE40(this, giEntry->objectId); } - this->stateFlags1 |= PLAYER_STATE1_6 | PLAYER_STATE1_28 | PLAYER_STATE1_29; + this->stateFlags1 |= PLAYER_STATE1_TALKING | PLAYER_STATE1_28 | PLAYER_STATE1_29; if (sp2C >= 0) { sp2C = sp2C + 1; @@ -5662,13 +6066,13 @@ s32 Player_ActionChange_13(Player* this, PlayState* play) { (this->itemAction == PLAYER_IA_MAGIC_BEAN))) { if (this->exchangeItemId == EXCH_ITEM_MAGIC_BEAN) { Inventory_ChangeAmmo(ITEM_MAGIC_BEAN, -1); - func_80835DE4(play, this, Player_Action_8084279C, 0); + Player_SetupActionPreserveItemAction(play, this, Player_Action_8084279C, 0); this->stateFlags1 |= PLAYER_STATE1_29; this->av2.actionVar2 = 0x50; this->av1.actionVar1 = -1; } talkActor->flags |= ACTOR_FLAG_TALK; - this->unk_664 = this->talkActor; + this->focusActor = this->talkActor; } else if (sp2C == EXCH_ITEM_BOTTLE_RUTOS_LETTER) { this->av1.actionVar1 = 1; this->actor.textId = 0x4005; @@ -5697,20 +6101,20 @@ s32 Player_ActionChange_13(Player* this, PlayState* play) { sp2C = Player_ActionToBottle(this, this->itemAction); if (sp2C >= 0) { if (sp2C == 0xC) { - func_80835DE4(play, this, Player_Action_8084EED8, 0); + Player_SetupActionPreserveItemAction(play, this, Player_Action_8084EED8, 0); Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_bottle_bug_out); func_80835EA4(play, 3); } else if ((sp2C > 0) && (sp2C < 4)) { - func_80835DE4(play, this, Player_Action_8084EFC0, 0); + Player_SetupActionPreserveItemAction(play, this, Player_Action_8084EFC0, 0); Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_bottle_fish_out); func_80835EA4(play, (sp2C == 1) ? 1 : 5); } else { - func_80835DE4(play, this, Player_Action_8084EAC0, 0); + Player_SetupActionPreserveItemAction(play, this, Player_Action_8084EAC0, 0); Player_AnimChangeOnceMorphAdjusted(play, this, &gPlayerAnim_link_bottle_drink_demo_start); func_80835EA4(play, 2); } } else { - func_80835DE4(play, this, Player_Action_8084E3C4, 0); + Player_SetupActionPreserveItemAction(play, this, Player_Action_8084E3C4, 0); Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_normal_okarina_start); this->stateFlags2 |= PLAYER_STATE2_27; func_80835EA4(play, (this->unk_6A8 != NULL) ? 0x5B : 0x5A); @@ -5745,80 +6149,112 @@ s32 Player_ActionChange_13(Player* this, PlayState* play) { return 0; } -s32 Player_ActionChange_4(Player* this, PlayState* play) { - Actor* sp34 = this->talkActor; - Actor* sp30 = this->unk_664; - Actor* sp2C = NULL; - s32 sp28 = 0; - s32 sp24; +s32 Player_ActionHandler_Talk(Player* this, PlayState* play) { + Actor* talkOfferActor = this->talkActor; + Actor* lockOnActor = this->focusActor; + Actor* cUpTalkActor = NULL; + s32 forceTalkToNavi = false; + s32 canTalkToLockOnWithCUp; + + canTalkToLockOnWithCUp = + (lockOnActor != NULL) && + (CHECK_FLAG_ALL(lockOnActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP) || + (lockOnActor->naviEnemyId != NAVI_ENEMY_NONE)); - sp24 = (sp30 != NULL) && - (CHECK_FLAG_ALL(sp30->flags, ACTOR_FLAG_0 | ACTOR_FLAG_18) || (sp30->naviEnemyId != NAVI_ENEMY_NONE)); + if (canTalkToLockOnWithCUp || (this->naviTextId != 0)) { + // If `naviTextId` is negative and outside the 0x2XX range, talk to Navi instantly + forceTalkToNavi = (this->naviTextId < 0) && ((ABS(this->naviTextId) & 0xFF00) != 0x200); - if (sp24 || (this->naviTextId != 0)) { - sp28 = (this->naviTextId < 0) && ((ABS(this->naviTextId) & 0xFF00) != 0x200); - if (sp28 || !sp24) { - sp2C = this->naviActor; - if (sp28) { - sp30 = NULL; - sp34 = NULL; + if (forceTalkToNavi || !canTalkToLockOnWithCUp) { + // If `lockOnActor` can't be talked to with c-up, the only option left is Navi + cUpTalkActor = this->naviActor; + + if (forceTalkToNavi) { + // Clearing these pointers guarantees that `cUpTalkActor` will take priority + lockOnActor = NULL; + talkOfferActor = NULL; } } else { - sp2C = sp30; + // Navi is not the talk actor, so the only option left for talking with c-up is `lockOnActor` + // (though, `lockOnActor` may be NULL at this point). + cUpTalkActor = lockOnActor; } } - if ((sp34 != NULL) || (sp2C != NULL)) { - if ((sp30 == NULL) || (sp30 == sp34) || (sp30 == sp2C)) { - if (!(this->stateFlags1 & PLAYER_STATE1_11) || - ((this->heldActor != NULL) && (sp28 || (sp34 == this->heldActor) || (sp2C == this->heldActor) || - ((sp34 != NULL) && (sp34->flags & ACTOR_FLAG_16))))) { - if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->stateFlags1 & PLAYER_STATE1_23) || - (func_808332B8(this) && !(this->stateFlags2 & PLAYER_STATE2_10))) { + if ((talkOfferActor != NULL) || (cUpTalkActor != NULL)) { + if ((lockOnActor != NULL) && (lockOnActor != talkOfferActor) && (lockOnActor != cUpTalkActor)) { + goto dont_talk; + } - if (sp34 != NULL) { - this->stateFlags2 |= PLAYER_STATE2_1; - if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) || (sp34->flags & ACTOR_FLAG_16)) { - sp2C = NULL; - } else if (sp2C == NULL) { - return 0; - } - } + if (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) { + if ((this->heldActor == NULL) || + (!forceTalkToNavi && (talkOfferActor != this->heldActor) && (cUpTalkActor != this->heldActor) && + ((talkOfferActor == NULL) || !(talkOfferActor->flags & ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED)))) { + goto dont_talk; + } + } - if (sp2C != NULL) { - if (!sp28) { - this->stateFlags2 |= PLAYER_STATE2_21; - } + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { + if (!(this->stateFlags1 & PLAYER_STATE1_23) && + !(func_808332B8(this) && !(this->stateFlags2 & PLAYER_STATE2_10))) { + goto dont_talk; + } + } - if (!CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) && !sp28) { - return 0; - } + if (talkOfferActor != NULL) { + // At this point the talk offer can be accepted. + // "Speak" or "Check" will appear on the A button in the HUD. + this->stateFlags2 |= PLAYER_STATE2_CAN_ACCEPT_TALK_OFFER; - sp34 = sp2C; - this->talkActor = NULL; + if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) || + (talkOfferActor->flags & ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED)) { + // Talk Offer has been accepted. + // Clearing `cUpTalkActor` guarantees that `talkOfferActor` is the actor that will be spoken to + cUpTalkActor = NULL; + } else if (cUpTalkActor == NULL) { + return false; + } + } - if (sp28 || !sp24) { - sp2C->textId = ABS(this->naviTextId); - } else { - if (sp2C->naviEnemyId != NAVI_ENEMY_NONE) { - sp2C->textId = sp2C->naviEnemyId + 0x600; - } - } - } + if (cUpTalkActor != NULL) { + if (!forceTalkToNavi) { + this->stateFlags2 |= PLAYER_STATE2_21; + } - this->currentMask = D_80858AA4; - func_80853148(play, sp34); - return 1; - } + if (!CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) && !forceTalkToNavi) { + return false; + } + + talkOfferActor = cUpTalkActor; + this->talkActor = NULL; + + if (forceTalkToNavi || !canTalkToLockOnWithCUp) { + cUpTalkActor->textId = ABS(this->naviTextId); + } else if (cUpTalkActor->naviEnemyId != NAVI_ENEMY_NONE) { + cUpTalkActor->textId = cUpTalkActor->naviEnemyId + 0x600; } } + + // `sSavedCurrentMask` saves the current mask just before the current action runs on this frame. + // This saved mask value is then restored just before starting a conversation. + // + // This handles an edge case where a conversation is started on the same frame that a mask was taken on or off. + // Because Player updates early before most actors, the text ID being offered comes from the previous frame. + // If a mask was taken on or off the same frame this function runs, the wrong text will be used. + // This is especially important to prevent unwanted behavior with regards to mask trading. + this->currentMask = sSavedCurrentMask; + + Player_StartTalking(play, talkOfferActor); + + return true; } - return 0; +dont_talk: + return false; } s32 func_8083B8F4(Player* this, PlayState* play) { - if (!(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_23)) && + if (!(this->stateFlags1 & (PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_23)) && Camera_CheckValidMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_FIRST_PERSON)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (func_808332B8(this) && (this->actor.depthInWater < this->ageProperties->unk_2C))) { @@ -5830,16 +6266,18 @@ s32 func_8083B8F4(Player* this, PlayState* play) { return 0; } -s32 Player_ActionChange_0(Player* this, PlayState* play) { +s32 Player_ActionHandler_0(Player* this, PlayState* play) { if (this->unk_6AD != 0) { - Player_ActionChange_13(this, play); + Player_ActionHandler_13(this, play); return 1; } - if ((this->unk_664 != NULL) && (CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_0 | ACTOR_FLAG_18) || - (this->unk_664->naviEnemyId != NAVI_ENEMY_NONE))) { + if ((this->focusActor != NULL) && + (CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP) || + (this->focusActor->naviEnemyId != NAVI_ENEMY_NONE))) { this->stateFlags2 |= PLAYER_STATE2_21; - } else if ((this->naviTextId == 0) && !func_8008E9C4(this) && CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) && + } else if ((this->naviTextId == 0) && !Player_CheckHostileLockOn(this) && + CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) && (R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT) && (R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_FIXED_TOGGLE_VIEWPOINT) && !func_8083B8F4(this, play)) { Sfx_PlaySfxCentered(NA_SE_SY_ERROR); @@ -5861,8 +6299,8 @@ void func_8083BA90(PlayState* play, Player* this, s32 arg2, f32 xzSpeed, f32 yVe this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->hoverBootsTimer = 0; - func_80832854(this); - func_80832698(this, NA_SE_VO_LI_SWORD_L); + Player_PlayJumpingSfx(this); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_SWORD_L); } s32 func_8083BB20(Player* this) { @@ -5885,22 +6323,22 @@ s32 func_8083BBA0(Player* this, PlayState* play) { return 0; } -void func_8083BC04(Player* this, PlayState* play) { - Player_SetupAction(play, this, Player_Action_80844708, 0); +void Player_SetupRoll(Player* this, PlayState* play) { + Player_SetupAction(play, this, Player_Action_Roll, 0); LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_landing_roll, this->modelAnimType), - 1.25f * D_808535E8); + FRAMERATE_CONST(1.25f, 1.5f) * sWaterSpeedFactor); } -s32 func_8083BC7C(Player* this, PlayState* play) { +s32 Player_TryRoll(Player* this, PlayState* play) { if ((this->controlStickDirections[this->controlStickDataIndex] == PLAYER_STICK_DIR_FORWARD) && (sFloorType != FLOOR_TYPE_7)) { - func_8083BC04(this, play); + Player_SetupRoll(this, play); - return 1; + return true; } - return 0; + return false; } void func_8083BCD0(Player* this, PlayState* play, s32 controlStickDirection) { @@ -5920,27 +6358,27 @@ void func_8083BCD0(Player* this, PlayState* play, s32 controlStickDirection) { Player_PlaySfx(this, ((controlStickDirection << 0xE) == 0x8000) ? NA_SE_PL_ROLL : NA_SE_PL_SKIP); } -s32 Player_ActionChange_10(Player* this, PlayState* play) { +s32 Player_ActionHandler_10(Player* this, PlayState* play) { s32 controlStickDirection; - if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && - (play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_2) && (sFloorType != FLOOR_TYPE_7) && + if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && (play->roomCtx.curRoom.type != ROOM_TYPE_INDOORS) && + (sFloorType != FLOOR_TYPE_7) && (SurfaceType_GetFloorEffect(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) != FLOOR_EFFECT_1)) { controlStickDirection = this->controlStickDirections[this->controlStickDataIndex]; if (controlStickDirection <= PLAYER_STICK_DIR_FORWARD) { - if (func_80833BCC(this)) { + if (Player_IsZTargeting(this)) { if (this->actor.category != ACTORCAT_PLAYER) { if (controlStickDirection <= PLAYER_STICK_DIR_NONE) { func_808389E8(this, &gPlayerAnim_link_normal_jump, REG(69) / 100.0f, play); } else { - func_8083BC04(this, play); + Player_SetupRoll(this, play); } } else { if ((Player_GetMeleeWeaponHeld(this) != 0) && Player_CanUpdateItems(this)) { func_8083BA90(play, this, PLAYER_MWA_JUMPSLASH_START, 5.0f, 5.0f); } else { - func_8083BC04(this, play); + Player_SetupRoll(this, play); } } @@ -5992,13 +6430,13 @@ void func_8083C0B8(Player* this, PlayState* play) { } void func_8083C0E8(Player* this, PlayState* play) { - Player_SetupAction(play, this, Player_Action_80840BC8, 1); - Player_AnimPlayOnce(play, this, func_80833338(this)); + Player_SetupAction(play, this, Player_Action_Idle, 1); + Player_AnimPlayOnce(play, this, Player_GetIdleAnim(this)); this->yaw = this->actor.shape.rot.y; } void func_8083C148(Player* this, PlayState* play) { - if (!(this->stateFlags3 & PLAYER_STATE3_7)) { + if (!(this->stateFlags3 & PLAYER_STATE3_FLYING_WITH_HOOKSHOT)) { func_8083B010(this); if (this->stateFlags1 & PLAYER_STATE1_27) { func_80838F18(play, this); @@ -6013,29 +6451,40 @@ void func_8083C148(Player* this, PlayState* play) { this->stateFlags1 &= ~(PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_20); } -s32 Player_ActionChange_6(Player* this, PlayState* play) { - if (!func_80833B54(this) && !sUpperBodyIsBusy && !(this->stateFlags1 & PLAYER_STATE1_23) && +/** + * Handles setting up a roll if it is appropriate. + * + * If a roll is not applicable, there are two extra behaviors that could occur: + * - If an item is currently held in hand, it can be put away. + * - Navi can be toggled on and off. + * She will either appear and fly around Link's head, or disappear by flying back into his hat + * + * These extra behaviors are not new actions themselves, so they will result in `false` being returned + * even if they occur. + */ +s32 Player_ActionHandler_Roll(Player* this, PlayState* play) { + if (!Player_UpdateHostileLockOn(this) && !sUpperBodyIsBusy && !(this->stateFlags1 & PLAYER_STATE1_23) && CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) { - if (func_8083BC7C(this, play)) { - return 1; - } - if ((this->unk_837 == 0) && (this->heldItemAction >= PLAYER_IA_SWORD_MASTER)) { + if (Player_TryRoll(this, play)) { + return true; + } else if ((this->putAwayCooldownTimer == 0) && (this->heldItemAction >= PLAYER_IA_SWORD_MASTER)) { Player_UseItem(play, this, ITEM_NONE); } else { - this->stateFlags2 ^= PLAYER_STATE2_20; + this->stateFlags2 ^= PLAYER_STATE2_NAVI_ACTIVE; } } - return 0; + return false; } -s32 Player_ActionChange_11(Player* this, PlayState* play) { +s32 Player_ActionHandler_11(Player* this, PlayState* play) { LinkAnimationHeader* anim; f32 frame; if ((play->shootingGalleryStatus == 0) && (this->currentShield != PLAYER_SHIELD_NONE) && CHECK_BTN_ALL(sControlInput->cur.button, BTN_R) && - (Player_IsChildWithHylianShield(this) || (!func_80833B2C(this) && (this->unk_664 == NULL)))) { + (Player_IsChildWithHylianShield(this) || + (!Player_FriendlyLockOnOrParallel(this) && (this->focusActor == NULL)))) { func_80832318(this); Player_DetachHeldActor(play, this); @@ -6051,20 +6500,20 @@ s32 Player_ActionChange_11(Player* this, PlayState* play) { } if (anim != this->skelAnime.animation) { - if (func_8008E9C4(this)) { + if (Player_CheckHostileLockOn(this)) { this->unk_86C = 1.0f; } else { this->unk_86C = 0.0f; func_80833C3C(this); } - this->unk_6BC = this->unk_6BE = this->unk_6C0 = 0; + this->upperLimbRot.x = this->upperLimbRot.y = this->upperLimbRot.z = 0; } frame = Animation_GetLastFrame(anim); LinkAnimation_Change(play, &this->skelAnime, anim, 1.0f, frame, frame, ANIMMODE_ONCE, 0.0f); if (Player_IsChildWithHylianShield(this)) { - Player_AnimReplaceApplyFlags(play, this, ANIM_FLAG_PLAYER_2); + Player_StartAnimMovement(play, this, ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT); } Player_PlaySfx(this, NA_SE_IT_SHIELD_POSTURE); @@ -6080,7 +6529,7 @@ s32 func_8083C484(Player* this, f32* arg1, s16* arg2) { s16 yaw = this->yaw - *arg2; if (ABS(yaw) > 0x6000) { - if (func_8083721C(this)) { + if (Player_DecelerateToZero(this)) { *arg1 = 0.0f; *arg2 = this->yaw; } else { @@ -6097,10 +6546,10 @@ void func_8083C50C(Player* this) { } } -s32 Player_ActionChange_8(Player* this, PlayState* play) { +s32 Player_ActionHandler_8(Player* this, PlayState* play) { if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) { - if (!(this->stateFlags1 & PLAYER_STATE1_22) && (Player_GetMeleeWeaponHeld(this) != 0) && (this->unk_844 == 1) && - (this->heldItemAction != PLAYER_IA_DEKU_STICK)) { + if (!(this->stateFlags1 & PLAYER_STATE1_22) && (Player_GetMeleeWeaponHeld2(this) != 0) && + (this->unk_844 == 1) && (this->heldItemAction != PLAYER_IA_DEKU_STICK)) { if ((this->heldItemAction != PLAYER_IA_SWORD_BIGGORON) || (gSaveContext.save.info.playerData.swordHealth > 0.0f)) { func_808377DC(play, this); @@ -6115,8 +6564,8 @@ s32 Player_ActionChange_8(Player* this, PlayState* play) { } s32 func_8083C61C(PlayState* play, Player* this) { - if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_2) && - (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (AMMO(ITEM_DEKU_NUT) != 0)) { + if ((play->roomCtx.curRoom.type != ROOM_TYPE_INDOORS) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + (AMMO(ITEM_DEKU_NUT) != 0)) { Player_SetupAction(play, this, Player_Action_8084E604, 0); Player_AnimPlayOnce(play, this, &gPlayerAnim_link_normal_light_bom); this->unk_6AD = 0; @@ -6126,24 +6575,31 @@ s32 func_8083C61C(PlayState* play, Player* this) { return 0; } -static struct_80854554 D_80854554[] = { - { &gPlayerAnim_link_bottle_bug_miss, &gPlayerAnim_link_bottle_bug_in, 2, 3 }, - { &gPlayerAnim_link_bottle_fish_miss, &gPlayerAnim_link_bottle_fish_in, 5, 3 }, +typedef struct BottleSwingInfo { + /* 0x00 */ LinkAnimationHeader* missAnimation; + /* 0x04 */ LinkAnimationHeader* catchAnimation; + /* 0x08 */ u8 firstActiveFrame; + /* 0x09 */ u8 numActiveFrames; +} BottleSwingInfo; // size = 0x0C + +static BottleSwingInfo sBottleSwingInfo[] = { + { &gPlayerAnim_link_bottle_bug_miss, &gPlayerAnim_link_bottle_bug_in, 2, 3 }, // on land + { &gPlayerAnim_link_bottle_fish_miss, &gPlayerAnim_link_bottle_fish_in, 5, 3 }, // in water }; s32 func_8083C6B8(PlayState* play, Player* this) { if (sUseHeldItem) { if (Player_GetBottleHeld(this) >= 0) { - Player_SetupAction(play, this, Player_Action_8084ECA4, 0); + Player_SetupAction(play, this, Player_Action_SwingBottle, 0); if (this->actor.depthInWater > 12.0f) { - this->av2.actionVar2 = 1; + this->av2.inWater = true; } - Player_AnimPlayOnceAdjusted(play, this, D_80854554[this->av2.actionVar2].unk_00); + Player_AnimPlayOnceAdjusted(play, this, sBottleSwingInfo[this->av2.inWater].missAnimation); Player_PlaySfx(this, NA_SE_IT_SWORD_SWING); - func_80832698(this, NA_SE_VO_LI_AUTO_JUMP); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_AUTO_JUMP); return 1; } @@ -6152,15 +6608,26 @@ s32 func_8083C6B8(PlayState* play, Player* this) { rodCheckPos.y += 50.0f; +#if OOT_VERSION < NTSC_1_1 + if (BgCheck_SphVsFirstPoly(&play->colCtx, &rodCheckPos, 20.0f)) +#else if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.world.pos.z > 1300.0f) || - BgCheck_SphVsFirstPoly(&play->colCtx, &rodCheckPos, 20.0f)) { + BgCheck_SphVsFirstPoly(&play->colCtx, &rodCheckPos, 20.0f)) +#endif + { Sfx_PlaySfxCentered(NA_SE_SY_ERROR); return 0; } +#if OOT_VERSION < NTSC_1_1 + this->unk_860 = 1; + Player_SetupAction(play, this, Player_Action_80850C68, 0); +#else Player_SetupAction(play, this, Player_Action_80850C68, 0); this->unk_860 = 1; Player_ZeroSpeedXZ(this); +#endif + Player_AnimPlayOnce(play, this, &gPlayerAnim_link_fishing_throw); return 1; } else { @@ -6174,7 +6641,7 @@ s32 func_8083C6B8(PlayState* play, Player* this) { void func_8083C858(Player* this, PlayState* play) { PlayerActionFunc actionFunc; - if (func_80833BCC(this)) { + if (Player_IsZTargeting(this)) { actionFunc = Player_Action_8084227C; } else { actionFunc = Player_Action_80842180; @@ -6276,11 +6743,14 @@ void func_8083CD00(Player* this, PlayState* play) { LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, &gPlayerAnim_link_anchor_back_brake, 2.0f); } -void func_8083CD54(PlayState* play, Player* this, s16 yaw) { +void Player_SetupTurnInPlace(PlayState* play, Player* this, s16 yaw) { this->yaw = yaw; - Player_SetupAction(play, this, Player_Action_80841BA8, 1); - this->unk_87E = 1200; - this->unk_87E *= D_808535E8; + + Player_SetupAction(play, this, Player_Action_TurnInPlace, 1); + + this->turnRate = 1200; + this->turnRate *= sWaterSpeedFactor; // slow turn rate by half when in water + LinkAnimation_Change(play, &this->skelAnime, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_45_turn, this->modelAnimType), 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f); } @@ -6288,7 +6758,7 @@ void func_8083CD54(PlayState* play, Player* this, s16 yaw) { void func_8083CE0C(Player* this, PlayState* play) { LinkAnimationHeader* anim; - Player_SetupAction(play, this, Player_Action_80840BC8, 1); + Player_SetupAction(play, this, Player_Action_Idle, 1); if (this->unk_870 < 0.5f) { anim = GET_PLAYER_ANIM(PLAYER_ANIMGROUP_waitR2wait, this->modelAnimType); @@ -6334,7 +6804,12 @@ s32 func_8083CFA8(PlayState* play, Player* this, f32 arg2, s32 splashScale) { splashPos.z = this->bodyPartsPos[PLAYER_BODYPART_WAIST].z; sp34 = this->actor.world.pos.y; if (WaterBox_GetSurface1(play, &play->colCtx, splashPos.x, splashPos.z, &sp34, &sp38)) { - if ((sp34 - this->actor.world.pos.y) < 100.0f) { +#if OOT_VERSION < PAL_1_0 + if ((sp34 - this->actor.world.pos.y) < 80.0f) +#else + if ((sp34 - this->actor.world.pos.y) < 100.0f) +#endif + { splashType = (sp3C <= 10.0f) ? 0 : 1; splashPos.y = sp34; EffectSsGSplash_Spawn(play, &splashPos, NULL, NULL, splashType, splashScale); @@ -6389,7 +6864,7 @@ s32 func_8083D12C(PlayState* play, Player* this, Input* arg2) { Player_SetupAction(play, this, Player_Action_8084E1EC, 1); if (this->stateFlags1 & PLAYER_STATE1_10) { - this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_11 | PLAYER_STATE1_29; + this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_29; } this->av2.actionVar2 = 2; @@ -6397,7 +6872,7 @@ s32 func_8083D12C(PlayState* play, Player* this, Input* arg2) { func_80832340(play, this); Player_AnimChangeOnceMorph(play, this, - (this->stateFlags1 & PLAYER_STATE1_11) + (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) ? &gPlayerAnim_link_swimer_swim_get : &gPlayerAnim_link_swimer_swim_deep_end); @@ -6444,7 +6919,7 @@ void func_8083D36C(PlayState* play, Player* this) { Player_PlaySfx(this, NA_SE_EV_DIVE_INTO_WATER); if (this->fallDistance > 800.0f) { - func_80832698(this, NA_SE_VO_LI_CLIMB_END); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_CLIMB_END); } } } @@ -6480,8 +6955,8 @@ void func_8083D53C(PlayState* play, Player* this) { return; } } else if ((this->stateFlags1 & PLAYER_STATE1_27) && (this->actor.depthInWater < this->ageProperties->unk_24)) { - if ((this->skelAnime.moveFlags == 0) && (this->currentBoots != PLAYER_BOOTS_IRON)) { - func_8083CD54(play, this, this->actor.shape.rot.y); + if ((this->skelAnime.movementFlags == 0) && (this->currentBoots != PLAYER_BOOTS_IRON)) { + Player_SetupTurnInPlace(play, this, this->actor.shape.rot.y); } func_8083D0A8(play, this, this->actor.velocity.y); } @@ -6491,7 +6966,7 @@ void func_8083D53C(PlayState* play, Player* this) { void func_8083D6EC(PlayState* play, Player* this) { Vec3f ripplePos; - this->actor.minVelocityY = -20.0f; + this->actor.minVelocityY = FRAMERATE_CONST(-20.0f, -24.0f); this->actor.gravity = REG(68) / 100.0f; if (func_8083816C(sFloorType)) { @@ -6587,19 +7062,22 @@ void func_8083D6EC(PlayState* play, Player* this) { } s32 func_8083DB98(Player* this, s32 arg1) { - Actor* unk_664 = this->unk_664; - Vec3f sp30; - s16 sp2E; - s16 sp2C; - - sp30.x = this->actor.world.pos.x; - sp30.y = this->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f; - sp30.z = this->actor.world.pos.z; - sp2E = Math_Vec3f_Pitch(&sp30, &unk_664->focus.pos); - sp2C = Math_Vec3f_Yaw(&sp30, &unk_664->focus.pos); - Math_SmoothStepToS(&this->actor.focus.rot.y, sp2C, 4, 10000, 0); - Math_SmoothStepToS(&this->actor.focus.rot.x, sp2E, 4, 10000, 0); - this->unk_6AE |= 2; + Actor* focusActor = this->focusActor; + Vec3f playerHeadPos; + s16 targetFocusRotX; + s16 targetFocusRotY; + + playerHeadPos.x = this->actor.world.pos.x; + playerHeadPos.y = this->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f; + playerHeadPos.z = this->actor.world.pos.z; + + targetFocusRotX = Math_Vec3f_Pitch(&playerHeadPos, &focusActor->focus.pos); + targetFocusRotY = Math_Vec3f_Yaw(&playerHeadPos, &focusActor->focus.pos); + + Math_SmoothStepToS(&this->actor.focus.rot.y, targetFocusRotY, 4, 10000, 0); + Math_SmoothStepToS(&this->actor.focus.rot.x, targetFocusRotX, 4, 10000, 0); + + this->unk_6AE_rotFlags |= UNK6AE_ROT_FOCUS_Y; return func_80836AB8(this, arg1); } @@ -6612,11 +7090,11 @@ void func_8083DC54(Player* this, PlayState* play) { f32 temp1; Vec3f sp34; - if (this->unk_664 != NULL) { + if (this->focusActor != NULL) { if (func_8002DD78(this) || func_808334B4(this)) { - func_8083DB98(this, 1); + func_8083DB98(this, true); } else { - func_8083DB98(this, 0); + func_8083DB98(this, false); } return; } @@ -6639,22 +7117,22 @@ void func_8083DC54(Player* this, PlayState* play) { void func_8083DDC8(Player* this, PlayState* play) { if (!func_8002DD78(this) && !func_808334B4(this) && (this->speedXZ > 5.0f)) { - s16 temp1; - s16 temp2; + s16 targetPitch; + s16 targetRoll; - temp1 = this->speedXZ * 200.0f; - temp2 = (s16)(this->yaw - this->actor.shape.rot.y) * this->speedXZ * 0.1f; + targetPitch = this->speedXZ * 200.0f; + targetRoll = (s16)(this->yaw - this->actor.shape.rot.y) * this->speedXZ * 0.1f; - temp1 = CLAMP(temp1, -4000, 4000); - temp2 = CLAMP(-temp2, -4000, 4000); + targetPitch = CLAMP(targetPitch, -4000, 4000); + targetRoll = CLAMP(-targetRoll, -4000, 4000); - Math_ScaledStepToS(&this->unk_6BC, temp1, 900); - this->unk_6B6 = -(f32)this->unk_6BC * 0.5f; + Math_ScaledStepToS(&this->upperLimbRot.x, targetPitch, 900); + this->headLimbRot.x = -(f32)this->upperLimbRot.x * 0.5f; - Math_ScaledStepToS(&this->unk_6BA, temp2, 300); - Math_ScaledStepToS(&this->unk_6C0, temp2, 200); + Math_ScaledStepToS(&this->headLimbRot.z, targetRoll, 300); + Math_ScaledStepToS(&this->upperLimbRot.z, targetRoll, 200); - this->unk_6AE |= 0x168; + this->unk_6AE_rotFlags |= UNK6AE_ROT_HEAD_X | UNK6AE_ROT_HEAD_Z | UNK6AE_ROT_UPPER_X | UNK6AE_ROT_UPPER_Z; } else { func_8083DC54(this, play); } @@ -6687,7 +7165,7 @@ static struct_80854578 D_80854578[] = { { &gPlayerAnim_link_uma_right_up, -34.16f, 7.91f }, }; -s32 Player_ActionChange_3(Player* this, PlayState* play) { +s32 Player_ActionHandler_3(Player* this, PlayState* play) { EnHorse* rideActor = (EnHorse*)this->rideActor; if ((rideActor != NULL) && CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) { @@ -6724,9 +7202,9 @@ s32 Player_ActionChange_3(Player* this, PlayState* play) { Actor_MountHorse(play, this, &rideActor->actor); Player_AnimPlayOnce(play, this, D_80854578[temp].anim); - Player_AnimReplaceApplyFlags(play, this, - ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_PLAYER_SETMOVE | - ANIM_FLAG_NO_MOVE | ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_StartAnimMovement(play, this, + ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_ADJUST_STARTING_POS | ANIM_FLAG_OVERRIDE_MOVEMENT); this->actor.parent = this->rideActor; func_80832224(this); @@ -6747,7 +7225,7 @@ void Player_GetSlopeDirection(CollisionPoly* floorPoly, Vec3f* slopeNormal, s16* } s32 Player_HandleSlopes(PlayState* play, Player* this, CollisionPoly* floorPoly) { - static LinkAnimationHeader* sSlopeSlipAnims[] = { + static LinkAnimationHeader* sSlopeSlideAnims[] = { &gPlayerAnim_link_normal_down_slope_slip, &gPlayerAnim_link_normal_up_slope_slip, }; @@ -6759,7 +7237,7 @@ s32 Player_HandleSlopes(PlayState* play, Player* this, CollisionPoly* floorPoly) f32 slopeSlowdownSpeedStep; s16 velYawToDownwardSlope; - if (!Player_InBlockingCsMode(play, this) && (Player_Action_8084F390 != this->actionFunc) && + if (!Player_InBlockingCsMode(play, this) && (Player_Action_SlideOnSlope != this->actionFunc) && (SurfaceType_GetFloorEffect(&play->colCtx, floorPoly, this->actor.floorBgId) == FLOOR_EFFECT_1)) { // Get direction of movement relative to the downward direction of the slope playerVelYaw = Math_Atan2S(this->actor.velocity.z, this->actor.velocity.x); @@ -6779,14 +7257,14 @@ s32 Player_HandleSlopes(PlayState* play, Player* this, CollisionPoly* floorPoly) this->pushedYaw = downwardSlopeYaw; Math_StepToF(&this->pushedSpeed, slopeSlowdownSpeed, slopeSlowdownSpeedStep); } else { - // moving downward on the slope, causing player to slip - Player_SetupAction(play, this, Player_Action_8084F390, 0); + // moving downward on the slope, causing player to slip and then slide down + Player_SetupAction(play, this, Player_Action_SlideOnSlope, 0); func_80832564(play, this); if (sFloorShapePitch >= 0) { - this->av1.actionVar1 = 1; + this->av1.facingUpSlope = true; } - Player_AnimChangeLoopMorph(play, this, sSlopeSlipAnims[this->av1.actionVar1]); + Player_AnimChangeLoopMorph(play, this, sSlopeSlideAnims[this->av1.actionVar1]); this->speedXZ = sqrtf(SQ(this->actor.velocity.x) + SQ(this->actor.velocity.z)); this->yaw = playerVelYaw; return true; @@ -6824,7 +7302,7 @@ void func_8083E4C4(PlayState* play, Player* this, GetItemEntry* giEntry) { #define DEBUG_iREG_67 0 #endif -s32 Player_ActionChange_2(Player* this, PlayState* play) { +s32 Player_ActionHandler_2(Player* this, PlayState* play) { Actor* interactedActor; if (DEBUG_iREG_67 || @@ -6857,7 +7335,7 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { func_80835EA4(play, 9); } - this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_11 | PLAYER_STATE1_29; + this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_29; func_80832224(this); return 1; } @@ -6865,8 +7343,8 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { func_8083E4C4(play, this, giEntry); this->getItemId = GI_NONE; } - } else if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && !(this->stateFlags1 & PLAYER_STATE1_11) && - !(this->stateFlags2 & PLAYER_STATE2_10)) { + } else if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && + !(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && !(this->stateFlags2 & PLAYER_STATE2_10)) { if (this->getItemId != GI_NONE) { GetItemEntry* giEntry = &sGetItemTable[-this->getItemId - 1]; EnBox* chest = (EnBox*)interactedActor; @@ -6880,7 +7358,7 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { } Player_SetupWaitForPutAway(play, this, func_8083A434); - this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_11 | PLAYER_STATE1_29; + this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_29; func_8083AE40(this, giEntry->objectId); this->actor.world.pos.x = chest->dyna.actor.world.pos.x - (Math_SinS(chest->dyna.actor.shape.rot.y) * 29.4343f); @@ -6892,10 +7370,10 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { if ((giEntry->itemId != ITEM_NONE) && (giEntry->gi >= 0) && (Item_CheckObtainability(giEntry->itemId) == ITEM_NONE)) { Player_AnimPlayOnceAdjusted(play, this, this->ageProperties->unk_98); - Player_AnimReplaceApplyFlags(play, this, - ANIM_REPLACE_APPLY_FLAG_9 | ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | - ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | - ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_StartAnimMovement(play, this, + PLAYER_ANIM_MOVEMENT_RESET_BY_AGE | ANIM_FLAG_UPDATE_XZ | + ANIM_FLAG_UPDATE_Y | ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | + ANIM_FLAG_ENABLE_MOVEMENT | ANIM_FLAG_OVERRIDE_MOVEMENT); chest->unk_1F4 = 1; Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_SLOW_CHEST_CS); } else { @@ -6924,7 +7402,7 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { } else { s32 strength = Player_GetStrength(); - if ((interactedActor->id == ACTOR_EN_ISHI) && ((interactedActor->params & 0xF) == 1) && + if ((interactedActor->id == ACTOR_EN_ISHI) && (PARAMS_GET_U(interactedActor->params, 0, 4) == 1) && (strength < PLAYER_STR_SILVER_G)) { return 0; } @@ -6933,7 +7411,7 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { } func_80832224(this); - this->stateFlags1 |= PLAYER_STATE1_11; + this->stateFlags1 |= PLAYER_STATE1_CARRYING_ACTOR; return 1; } } @@ -6947,20 +7425,29 @@ void func_8083EA94(Player* this, PlayState* play) { Player_AnimPlayOnce(play, this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_throw, this->modelAnimType)); } -s32 func_8083EAF0(Player* this, Actor* actor) { - if ((actor != NULL) && !(actor->flags & ACTOR_FLAG_23) && +/** + * Checks if an actor can be thrown or dropped. + * It is assumed that the `actor` argument is the actor currently being carried. + * + * @return true if it can be thrown, false if it can be dropped. + */ +s32 Player_CanThrowCarriedActor(Player* this, Actor* actor) { + // If the actor arg is null, true will be returned. + // It doesn't make sense for a non-existent actor to be thrown or dropped, so + // the safety check should happen before this function is even called. + if ((actor != NULL) && !(actor->flags & ACTOR_FLAG_THROW_ONLY) && ((this->speedXZ < 1.1f) || (actor->id == ACTOR_EN_BOM_CHU))) { - return 0; + return false; } - return 1; + return true; } -s32 Player_ActionChange_9(Player* this, PlayState* play) { - if ((this->stateFlags1 & PLAYER_STATE1_11) && (this->heldActor != NULL) && - CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) { +s32 Player_ActionHandler_9(Player* this, PlayState* play) { + if ((this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (this->heldActor != NULL) && + CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT)) { if (!func_80835644(play, this, this->heldActor)) { - if (!func_8083EAF0(this, this->heldActor)) { + if (!Player_CanThrowCarriedActor(this, this->heldActor)) { Player_SetupAction(play, this, Player_Action_808464B0, 1); Player_AnimPlayOnce(play, this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_put, this->modelAnimType)); } else { @@ -7071,10 +7558,10 @@ s32 func_8083EC18(Player* this, PlayState* play, u32 wallFlags) { func_80832224(this); Math_Vec3f_Copy(&this->actor.prevPos, &this->actor.world.pos); Player_AnimPlayOnce(play, this, anim); - Player_AnimReplaceApplyFlags(play, this, - ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_PLAYER_2 | - ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_NO_MOVE | - ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_StartAnimMovement(play, this, + ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | + ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_ADJUST_STARTING_POS | ANIM_FLAG_OVERRIDE_MOVEMENT); return true; } @@ -7086,7 +7573,7 @@ s32 func_8083EC18(Player* this, PlayState* play, u32 wallFlags) { } void func_8083F070(Player* this, LinkAnimationHeader* anim, PlayState* play) { - func_80835DAC(play, this, Player_Action_8084C5F8, 0); + Player_SetupActionPreserveAnimMovement(play, this, Player_Action_8084C5F8, 0); LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, anim, (4.0f / 3.0f)); } @@ -7153,9 +7640,10 @@ s32 Player_TryEnteringCrawlspace(Player* this, PlayState* play, u32 interactWall func_80832224(this); this->actor.prevPos = this->actor.world.pos; Player_AnimPlayOnce(play, this, &gPlayerAnim_link_child_tunnel_start); - Player_AnimReplaceApplyFlags(play, this, - ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | - ANIM_FLAG_NO_MOVE | ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_StartAnimMovement(play, this, + ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | + ANIM_FLAG_ENABLE_MOVEMENT | ANIM_FLAG_ADJUST_STARTING_POS | + ANIM_FLAG_OVERRIDE_MOVEMENT); return true; } @@ -7218,7 +7706,7 @@ s32 func_8083F524(PlayState* play, Player* this) { /** * Two exit walls are placed at each end of the crawlspace, separate to the two entrance walls used to enter the - * crawlspace. These front and back exit walls are futher into the crawlspace than the front and + * crawlspace. These front and back exit walls are further into the crawlspace than the front and * back entrance walls. When player interacts with either of these two interior exit walls, start the leaving-crawlspace * cutscene and return true. Else, return false */ @@ -7243,9 +7731,10 @@ s32 Player_TryLeavingCrawlspace(Player* this, PlayState* play) { // Leaving a crawlspace forwards this->actor.shape.rot.y = this->actor.wallYaw + 0x8000; Player_AnimPlayOnce(play, this, &gPlayerAnim_link_child_tunnel_end); - Player_AnimReplaceApplyFlags(play, this, - ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | - ANIM_FLAG_NO_MOVE | ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_StartAnimMovement(play, this, + ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | + ANIM_FLAG_ENABLE_MOVEMENT | ANIM_FLAG_ADJUST_STARTING_POS | + ANIM_FLAG_OVERRIDE_MOVEMENT); OnePointCutscene_Init(play, 9601, 999, NULL, CAM_ID_MAIN); } else { // Leaving a crawlspace backwards @@ -7253,9 +7742,10 @@ s32 Player_TryLeavingCrawlspace(Player* this, PlayState* play) { LinkAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_child_tunnel_start, -1.0f, Animation_GetLastFrame(&gPlayerAnim_link_child_tunnel_start), 0.0f, ANIMMODE_ONCE, 0.0f); - Player_AnimReplaceApplyFlags(play, this, - ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | - ANIM_FLAG_NO_MOVE | ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_StartAnimMovement(play, this, + ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | + ANIM_FLAG_ENABLE_MOVEMENT | ANIM_FLAG_ADJUST_STARTING_POS | + ANIM_FLAG_OVERRIDE_MOVEMENT); OnePointCutscene_Init(play, 9602, 999, NULL, CAM_ID_MAIN); } @@ -7280,11 +7770,11 @@ void func_8083F72C(Player* this, LinkAnimationHeader* anim, PlayState* play) { this->actor.shape.rot.y = this->yaw = this->actor.wallYaw + 0x8000; } -s32 Player_ActionChange_5(Player* this, PlayState* play) { +s32 Player_ActionHandler_5(Player* this, PlayState* play) { DynaPolyActor* wallPolyActor; - if (!(this->stateFlags1 & PLAYER_STATE1_11) && (this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && - (sShapeYawToTouchedWall < 0x3000)) { + if (!(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && + (this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && (sShapeYawToTouchedWall < 0x3000)) { if (((this->speedXZ > 0.0f) && func_8083EC18(this, play, sTouchedWallFlags)) || Player_TryEnteringCrawlspace(this, play, sTouchedWallFlags)) { @@ -7308,7 +7798,7 @@ s32 Player_ActionChange_5(Player* this, PlayState* play) { } Player_SetupWaitForPutAway(play, this, func_8083A0F4); - this->stateFlags1 |= PLAYER_STATE1_11; + this->stateFlags1 |= PLAYER_STATE1_CARRYING_ACTOR; this->interactRangeActor = &wallPolyActor->actor; this->getItemId = GI_NONE; this->yaw = this->actor.wallYaw + 0x8000; @@ -7383,7 +7873,7 @@ s32 func_8083FBC0(Player* this, PlayState* play) { } func_8083FB7C(this, play); - func_80832698(this, NA_SE_VO_LI_AUTO_JUMP); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_AUTO_JUMP); return true; } @@ -7391,7 +7881,7 @@ s32 func_8083FC68(Player* this, f32 arg1, s16 arg2) { f32 sp1C = (s16)(arg2 - this->actor.shape.rot.y); f32 temp; - if (this->unk_664 != NULL) { + if (this->focusActor != NULL) { func_8083DB98(this, func_8002DD78(this) || func_808334B4(this)); } @@ -7407,10 +7897,10 @@ s32 func_8083FC68(Player* this, f32 arg1, s16 arg2) { } s32 func_8083FD78(Player* this, f32* arg1, s16* arg2, PlayState* play) { - s16 sp2E = *arg2 - this->zTargetYaw; + s16 sp2E = *arg2 - this->parallelYaw; u16 sp2C = ABS(sp2E); - if ((func_8002DD78(this) || func_808334B4(this)) && (this->unk_664 == NULL)) { + if ((func_8002DD78(this) || func_808334B4(this)) && (this->focusActor == NULL)) { *arg1 *= Math_SinS(sp2C); if (*arg1 != 0.0f) { @@ -7419,14 +7909,14 @@ s32 func_8083FD78(Player* this, f32* arg1, s16* arg2, PlayState* play) { *arg2 = this->actor.shape.rot.y; } - if (this->unk_664 != NULL) { - func_8083DB98(this, 1); + if (this->focusActor != NULL) { + func_8083DB98(this, true); } else { Math_SmoothStepToS(&this->actor.focus.rot.x, sControlInput->rel.stick_y * 240.0f, 14, 4000, 30); - func_80836AB8(this, 1); + func_80836AB8(this, true); } } else { - if (this->unk_664 != NULL) { + if (this->focusActor != NULL) { return func_8083FC68(this, *arg1, *arg2); } else { func_8083DC54(this, play); @@ -7525,9 +8015,9 @@ void func_8084029C(Player* this, f32 arg1) { if ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->hoverBootsTimer != 0)) { - func_8002F8F0(&this->actor, NA_SE_PL_HOBBERBOOTS_LV - SFX_FLAG); + Actor_PlaySfx_Flagged2(&this->actor, NA_SE_PL_HOBBERBOOTS_LV - SFX_FLAG); } else if (func_8084021C(this->unk_868, arg1, 29.0f, 10.0f) || func_8084021C(this->unk_868, arg1, 29.0f, 24.0f)) { - func_808327F8(this, this->speedXZ); + Player_PlaySteppingSfx(this, this->speedXZ); if (this->speedXZ > 4.0f) { this->stateFlags2 |= PLAYER_STATE2_3; } @@ -7560,7 +8050,7 @@ void Player_Action_80840450(Player* this, PlayState* play) { if (this->av2.actionVar2 != 0) { if (LinkAnimation_Update(play, &this->skelAnime)) { - func_80832DBC(this); + Player_FinishAnimMovement(this); Player_AnimPlayLoop(play, this, func_808334E4(this)); this->av2.actionVar2 = 0; this->stateFlags3 &= ~PLAYER_STATE3_3; @@ -7570,10 +8060,11 @@ void Player_Action_80840450(Player* this, PlayState* play) { func_808401B0(play, this); } - func_8083721C(this); + Player_DecelerateToZero(this); - if (!Player_TryActionChangeList(play, this, sActionChangeList1, true)) { - if (!func_80833B54(this) && (!func_80833B2C(this) || (func_80834B5C != this->upperActionFunc))) { + if (!Player_TryActionHandlerList(play, this, sActionHandlerList1, true)) { + if (!Player_UpdateHostileLockOn(this) && + (!Player_FriendlyLockOnOrParallel(this) || (func_80834B5C != this->upperActionFunc))) { func_8083CF10(this, play); return; } @@ -7632,20 +8123,20 @@ void Player_Action_808407CC(Player* this, PlayState* play) { s32 temp3; if (LinkAnimation_Update(play, &this->skelAnime)) { - func_80832DBC(this); - Player_AnimPlayOnce(play, this, func_80833338(this)); + Player_FinishAnimMovement(this); + Player_AnimPlayOnce(play, this, Player_GetIdleAnim(this)); } - func_8083721C(this); + Player_DecelerateToZero(this); - if (!Player_TryActionChangeList(play, this, sActionChangeList2, true)) { - if (func_80833B54(this)) { + if (!Player_TryActionHandlerList(play, this, sActionHandlerList2, true)) { + if (Player_UpdateHostileLockOn(this)) { func_8083CEAC(this, play); return; } - if (!func_80833B2C(this)) { - func_80835DAC(play, this, Player_Action_80840BC8, 1); + if (!Player_FriendlyLockOnOrParallel(this)) { + Player_SetupActionPreserveAnimMovement(play, this, Player_Action_Idle, 1); this->yaw = this->actor.shape.rot.y; return; } @@ -7683,96 +8174,134 @@ void Player_Action_808407CC(Player* this, PlayState* play) { temp3 = ABS(temp2); if (temp3 > 800) { - func_8083CD54(play, this, yawTarget); + Player_SetupTurnInPlace(play, this, yawTarget); } } } -void func_808409CC(PlayState* play, Player* this) { +void Player_ChooseNextIdleAnim(PlayState* play, Player* this) { LinkAnimationHeader* anim; - LinkAnimationHeader** animPtr; + LinkAnimationHeader** fidgetAnimPtr; s32 heathIsCritical; - s32 sp38; - s32 sp34; + s32 fidgetType; + s32 commonType; - if ((this->unk_664 != NULL) || - (!(heathIsCritical = Health_IsCritical()) && ((this->unk_6AC = (this->unk_6AC + 1) & 1) != 0))) { - this->stateFlags2 &= ~PLAYER_STATE2_28; - anim = func_80833338(this); + if ((this->focusActor != NULL) || + (!(heathIsCritical = Health_IsCritical()) && ((this->idleType = (this->idleType + 1) & 1) != 0))) { + this->stateFlags2 &= ~PLAYER_STATE2_IDLE_FIDGET; + anim = Player_GetIdleAnim(this); } else { - this->stateFlags2 |= PLAYER_STATE2_28; - if (this->stateFlags1 & PLAYER_STATE1_11) { - anim = func_80833338(this); + this->stateFlags2 |= PLAYER_STATE2_IDLE_FIDGET; + + if (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) { + // Default idle animation will play if carrying an actor. + // Note that in this case, `PLAYER_STATE2_IDLE_FIDGET` is still set even though the + // animation that plays isn't a fidget animation. + anim = Player_GetIdleAnim(this); } else { - sp38 = play->roomCtx.curRoom.behaviorType2; + // Pick fidget type based on room behavior. + // This may be changed below. + fidgetType = play->roomCtx.curRoom.environmentType; + if (heathIsCritical) { - if (this->unk_6AC >= 0) { - sp38 = 7; - this->unk_6AC = -1; + if (this->idleType >= PLAYER_IDLE_DEFAULT) { + fidgetType = FIDGET_CRIT_HEALTH_START; + + // When health is critical, `idleType` will not be updated. + // It will stay as `PLAYER_IDLE_CRIT_HEALTH` until health is no longer critical. + this->idleType = PLAYER_IDLE_CRIT_HEALTH; } else { - sp38 = 8; + // Keep looping the critical health animation until critical health ends + fidgetType = FIDGET_CRIT_HEALTH_LOOP; } } else { - sp34 = Rand_ZeroOne() * 5.0f; - if (sp34 < 4) { - if (((sp34 != 0) && (sp34 != 3)) || ((this->rightHandType == PLAYER_MODELTYPE_RH_SHIELD) && - ((sp34 == 3) || (Player_GetMeleeWeaponHeld(this) != 0)))) { - if ((sp34 == 0) && Player_HoldsTwoHandedWeapon(this)) { - sp34 = 4; + commonType = Rand_ZeroOne() * 5; + + // There is a 4/5 chance that a common fidget type will be considered. + // However it may get rejected by the conditions below. + // The type determined by `curRoom.environmentType` will be used if a common type is + // rejected. + if (commonType < 4) { + // `FIDGET_ADJUST_TUNIC` and `FIDGET_TAP_FEET` are accepted unconditionally. + // The sword and shield related common types have extra restrictions. + // + // Note that `FIDGET_SWORD_SWING` is the first common fidget type, which is why + // all operations are done relative to this type. + if (((commonType + FIDGET_SWORD_SWING != FIDGET_SWORD_SWING) && + (commonType + FIDGET_SWORD_SWING != FIDGET_ADJUST_SHIELD)) || + ((this->rightHandType == PLAYER_MODELTYPE_RH_SHIELD) && + ((commonType + FIDGET_SWORD_SWING == FIDGET_ADJUST_SHIELD) || + (Player_GetMeleeWeaponHeld2(this) != 0)))) { + //! @bug It is possible for `FIDGET_ADJUST_SHIELD` to be used even if + //! a shield is not currently equipped. This is because of how being shieldless + //! is implemented. There is no sword-only model type, only + //! `PLAYER_MODELGROUP_SWORD_AND_SHIELD` exists. Therefore, the right hand type will be + //! `PLAYER_MODELTYPE_RH_SHIELD` if sword is in hand, even if no shield is equipped. + if ((commonType + FIDGET_SWORD_SWING == FIDGET_SWORD_SWING) && + Player_HoldsTwoHandedWeapon(this)) { + //! @bug This code is unreachable. + //! The check above groups the `Player_GetMeleeWeaponHeld2` check and + //! `PLAYER_MODELTYPE_RH_SHIELD` conditions together, meaning sword and shield must be + //! in hand. However shield is not in hand when using a two handed melee weapon. + commonType = FIDGET_SWORD_SWING_TWO_HAND - FIDGET_SWORD_SWING; } - sp38 = sp34 + 9; + + fidgetType = FIDGET_SWORD_SWING + commonType; } } } - animPtr = &D_80853D7C[sp38][0]; + + fidgetAnimPtr = &sFidgetAnimations[fidgetType][0]; + if (this->modelAnimType != PLAYER_ANIMTYPE_1) { - animPtr = &D_80853D7C[sp38][1]; + fidgetAnimPtr = &sFidgetAnimations[fidgetType][1]; } - anim = *animPtr; + + anim = *fidgetAnimPtr; } } - LinkAnimation_Change(play, &this->skelAnime, anim, (2.0f / 3.0f) * D_808535E8, 0.0f, Animation_GetLastFrame(anim), - ANIMMODE_ONCE, -6.0f); + LinkAnimation_Change(play, &this->skelAnime, anim, (2.0f / 3.0f) * sWaterSpeedFactor, 0.0f, + Animation_GetLastFrame(anim), ANIMMODE_ONCE, -6.0f); } -void Player_Action_80840BC8(Player* this, PlayState* play) { - s32 sp44; - s32 sp40; +void Player_Action_Idle(Player* this, PlayState* play) { + s32 idleAnimResult = Player_CheckForIdleAnim(this); + s32 animDone = LinkAnimation_Update(play, &this->skelAnime); f32 speedTarget; s16 yawTarget; - s16 temp; - - sp44 = func_80833350(this); - sp40 = LinkAnimation_Update(play, &this->skelAnime); + s16 yawDiff; - if (sp44 > 0) { - func_808333FC(this, sp44 - 1); + if (idleAnimResult > IDLE_ANIM_NONE) { + Player_ProcessFidgetAnimSfxList(this, idleAnimResult - 1); } - if (sp40 != 0) { - if (this->av2.actionVar2 != 0) { - if (DECR(this->av2.actionVar2) == 0) { + if (animDone) { + if (this->av2.fallDamageStunTimer != 0) { + if (DECR(this->av2.fallDamageStunTimer) == 0) { this->skelAnime.endFrame = this->skelAnime.animLength - 1.0f; } + + // Offset model y position. + // Depending on if the timer is even or odd, the offset will be 40 or -40 model space units. this->skelAnime.jointTable[0].y = - (this->skelAnime.jointTable[0].y + ((this->av2.actionVar2 & 1) * 0x50)) - 0x28; + (this->skelAnime.jointTable[0].y + ((this->av2.fallDamageStunTimer & 1) * 80)) - 40; } else { - func_80832DBC(this); - func_808409CC(play, this); + Player_FinishAnimMovement(this); + Player_ChooseNextIdleAnim(play, this); } } - func_8083721C(this); + Player_DecelerateToZero(this); - if (this->av2.actionVar2 == 0) { - if (!Player_TryActionChangeList(play, this, sActionChangeList7, true)) { - if (func_80833B54(this)) { + if (this->av2.fallDamageStunTimer == 0) { + if (!Player_TryActionHandlerList(play, this, sActionHandlerListIdle, true)) { + if (Player_UpdateHostileLockOn(this)) { func_8083CEAC(this, play); return; } - if (func_80833B2C(this)) { + if (Player_FriendlyLockOnOrParallel(this)) { func_80839F30(this, play); return; } @@ -7784,15 +8313,17 @@ void Player_Action_80840BC8(Player* this, PlayState* play) { return; } - temp = yawTarget - this->actor.shape.rot.y; - if (ABS(temp) > 800) { - func_8083CD54(play, this, yawTarget); + yawDiff = yawTarget - this->actor.shape.rot.y; + + if (ABS(yawDiff) > 800) { + Player_SetupTurnInPlace(play, this, yawTarget); return; } Math_ScaledStepToS(&this->actor.shape.rot.y, yawTarget, 1200); this->yaw = this->actor.shape.rot.y; - if (func_80833338(this) == this->skelAnime.animation) { + + if (Player_GetIdleAnim(this) == this->skelAnime.animation) { func_8083DC54(this, play); } } @@ -7836,16 +8367,16 @@ void Player_Action_80840DE4(Player* this, PlayState* play) { LinkAnimation_Update(play, &this->skelAnime); if (LinkAnimation_OnFrame(&this->skelAnime, 0.0f) || LinkAnimation_OnFrame(&this->skelAnime, frames * 0.5f)) { - func_808327F8(this, this->speedXZ); + Player_PlaySteppingSfx(this, this->speedXZ); } - if (!Player_TryActionChangeList(play, this, sActionChangeList3, true)) { - if (func_80833B54(this)) { + if (!Player_TryActionHandlerList(play, this, sActionHandlerList3, true)) { + if (Player_UpdateHostileLockOn(this)) { func_8083CEAC(this, play); return; } - if (!func_80833B2C(this)) { + if (!Player_FriendlyLockOnOrParallel(this)) { func_80853080(this, play); return; } @@ -7944,7 +8475,7 @@ s32 func_80841458(Player* this, f32* arg1, s16* arg2, PlayState* play) { } if (*arg1 != 0.0f) { - if (func_8083721C(this)) { + if (Player_DecelerateToZero(this)) { *arg1 = 0.0f; *arg2 = this->yaw; } else { @@ -7962,8 +8493,8 @@ void Player_Action_808414F8(Player* this, PlayState* play) { func_80841138(this, play); - if (!Player_TryActionChangeList(play, this, sActionChangeList4, true)) { - if (!func_80833C04(this)) { + if (!Player_TryActionHandlerList(play, this, sActionHandlerList4, true)) { + if (!Player_IsZTargetingWithHostileUpdate(this)) { func_8083C8DC(this, play, this->yaw); return; } @@ -8005,9 +8536,9 @@ void Player_Action_8084170C(Player* this, PlayState* play) { s16 yawTarget; sp34 = LinkAnimation_Update(play, &this->skelAnime); - func_8083721C(this); + Player_DecelerateToZero(this); - if (!Player_TryActionChangeList(play, this, sActionChangeList4, true)) { + if (!Player_TryActionHandlerList(play, this, sActionHandlerList4, true)) { Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); if (this->speedXZ == 0.0f) { @@ -8027,7 +8558,7 @@ void Player_Action_808417FC(Player* this, PlayState* play) { sp1C = LinkAnimation_Update(play, &this->skelAnime); - if (!Player_TryActionChangeList(play, this, sActionChangeList4, true)) { + if (!Player_TryActionHandlerList(play, this, sActionHandlerList4, true)) { if (sp1C != 0) { func_80839F30(this, play); } @@ -8054,15 +8585,15 @@ void Player_Action_8084193C(Player* this, PlayState* play) { func_80841860(play, this); - if (!Player_TryActionChangeList(play, this, sActionChangeList5, true)) { - if (!func_80833C04(this)) { + if (!Player_TryActionHandlerList(play, this, sActionHandlerList5, true)) { + if (!Player_IsZTargetingWithHostileUpdate(this)) { func_8083C858(this, play); return; } Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); - if (func_80833B2C(this)) { + if (Player_FriendlyLockOnOrParallel(this)) { temp1 = func_8083FD78(this, &speedTarget, &yawTarget, play); } else { temp1 = func_8083FC68(this, speedTarget, yawTarget); @@ -8071,13 +8602,13 @@ void Player_Action_8084193C(Player* this, PlayState* play) { if (temp1 > 0) { func_8083C858(this, play); } else if (temp1 < 0) { - if (func_80833B2C(this)) { + if (Player_FriendlyLockOnOrParallel(this)) { func_8083CB2C(this, yawTarget, play); } else { func_8083CBF0(this, yawTarget, play); } } else if ((this->speedXZ < 3.6f) && (speedTarget < 4.0f)) { - if (!func_8008E9C4(this) && func_80833B2C(this)) { + if (!Player_CheckHostileLockOn(this) && Player_FriendlyLockOnOrParallel(this)) { func_8083CB94(this, play); } else { func_80839F90(this, play); @@ -8104,14 +8635,21 @@ void Player_Action_8084193C(Player* this, PlayState* play) { } } -void Player_Action_80841BA8(Player* this, PlayState* play) { +/** + * Turn in place until the angle pointed to by the control stick is reached. + * + * This is the state that the speedrunning community refers to as "ESS" or "ESS Position". + * See the bug comment below and https://www.zeldaspeedruns.com/oot/tech/extended-superslide + * for more information. + */ +void Player_Action_TurnInPlace(Player* this, PlayState* play) { f32 speedTarget; s16 yawTarget; LinkAnimation_Update(play, &this->skelAnime); - if (Player_HoldsTwoHandedWeapon(this)) { - AnimTaskQueue_AddLoadPlayerFrame(play, func_80833338(this), 0, this->skelAnime.limbCount, + if (Player_HoldsTwoHandedWeapon2(this)) { + AnimTaskQueue_AddLoadPlayerFrame(play, Player_GetIdleAnim(this), 0, this->skelAnime.limbCount, this->skelAnime.morphTable); AnimTaskQueue_AddCopyUsingMap(play, this->skelAnime.limbCount, this->skelAnime.jointTable, this->skelAnime.morphTable, sUpperBodyLimbCopyMap); @@ -8119,11 +8657,19 @@ void Player_Action_80841BA8(Player* this, PlayState* play) { Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_CURVED, play); - if (!Player_TryActionChangeList(play, this, sActionChangeList6, true)) { + //! @bug This action does not handle xzSpeed in any capacity. + //! Player's current speed value will be maintained the entire time this action is running. + //! This is the core bug that allows many different glitches to manifest. + //! + //! One possible fix is to kill all speed instantly in `Player_SetupTurnInPlace`. + //! Another possible fix is to gradually kill speed by calling `Player_DecelerateToZero` + //! here, which plenty of other "standing" actions do. + + if (!Player_TryActionHandlerList(play, this, sActionHandlerListTurnInPlace, true)) { if (speedTarget != 0.0f) { this->actor.shape.rot.y = yawTarget; func_8083C858(this, play); - } else if (Math_ScaledStepToS(&this->actor.shape.rot.y, yawTarget, this->unk_87E)) { + } else if (Math_ScaledStepToS(&this->actor.shape.rot.y, yawTarget, this->turnRate)) { func_8083C0E8(this, play); } @@ -8237,8 +8783,8 @@ void Player_Action_80842180(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_5; func_80841EE4(this, play); - if (!Player_TryActionChangeList(play, this, sActionChangeList8, true)) { - if (func_80833C04(this)) { + if (!Player_TryActionHandlerList(play, this, sActionHandlerList8, true)) { + if (Player_IsZTargetingWithHostileUpdate(this)) { func_8083C858(this, play); return; } @@ -8267,8 +8813,8 @@ void Player_Action_8084227C(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_5; func_80841EE4(this, play); - if (!Player_TryActionChangeList(play, this, sActionChangeList9, true)) { - if (!func_80833C04(this)) { + if (!Player_TryActionHandlerList(play, this, sActionHandlerList9, true)) { + if (!Player_IsZTargetingWithHostileUpdate(this)) { func_8083C858(this, play); return; } @@ -8276,9 +8822,9 @@ void Player_Action_8084227C(Player* this, PlayState* play) { Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); if (!func_8083C484(this, &speedTarget, &yawTarget)) { - if ((func_80833B2C(this) && (speedTarget != 0.0f) && + if ((Player_FriendlyLockOnOrParallel(this) && (speedTarget != 0.0f) && (func_8083FD78(this, &speedTarget, &yawTarget, play) <= 0)) || - (!func_80833B2C(this) && (func_8083FC68(this, speedTarget, yawTarget) <= 0))) { + (!Player_FriendlyLockOnOrParallel(this) && (func_8083FC68(this, speedTarget, yawTarget) <= 0))) { func_80839F90(this, play); return; } @@ -8300,8 +8846,8 @@ void Player_Action_808423EC(Player* this, PlayState* play) { sp34 = LinkAnimation_Update(play, &this->skelAnime); - if (!Player_TryActionChangeList(play, this, sActionChangeList5, true)) { - if (!func_80833C04(this)) { + if (!Player_TryActionHandlerList(play, this, sActionHandlerList5, true)) { + if (!Player_IsZTargetingWithHostileUpdate(this)) { func_8083C858(this, play); return; } @@ -8309,7 +8855,7 @@ void Player_Action_808423EC(Player* this, PlayState* play) { Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); if ((this->skelAnime.morphWeight == 0.0f) && (this->skelAnime.curFrame > 5.0f)) { - func_8083721C(this); + Player_DecelerateToZero(this); if ((this->skelAnime.curFrame > 10.0f) && (func_8083FC68(this, speedTarget, yawTarget) < 0)) { func_8083CBF0(this, yawTarget, play); @@ -8330,9 +8876,9 @@ void Player_Action_8084251C(Player* this, PlayState* play) { sp34 = LinkAnimation_Update(play, &this->skelAnime); - func_8083721C(this); + Player_DecelerateToZero(this); - if (!Player_TryActionChangeList(play, this, sActionChangeList10, true)) { + if (!Player_TryActionHandlerList(play, this, sActionHandlerList10, true)) { Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); if (this->speedXZ == 0.0f) { @@ -8379,7 +8925,7 @@ void Player_Action_8084279C(Player* this, PlayState* play) { func_80832CB0(play, this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_check_wait, this->modelAnimType)); if (DECR(this->av2.actionVar2) == 0) { - if (!Player_ActionChange_13(this, play)) { + if (!Player_ActionHandler_13(this, play)) { func_8083A098(this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_check_end, this->modelAnimType), play); } @@ -8399,11 +8945,11 @@ s32 func_8084285C(Player* this, f32 arg1, f32 arg2, f32 arg3) { } s32 func_808428D8(Player* this, PlayState* play) { - if (!Player_IsChildWithHylianShield(this) && (Player_GetMeleeWeaponHeld(this) != 0) && sUseHeldItem) { + if (!Player_IsChildWithHylianShield(this) && (Player_GetMeleeWeaponHeld2(this) != 0) && sUseHeldItem) { Player_AnimPlayOnce(play, this, &gPlayerAnim_link_normal_defense_kiru); this->av1.actionVar1 = 1; this->meleeWeaponAnimation = PLAYER_MWA_STAB_1H; - this->yaw = this->actor.shape.rot.y + this->unk_6BE; + this->yaw = this->actor.shape.rot.y + this->upperLimbRot.y; return 1; } @@ -8411,7 +8957,8 @@ s32 func_808428D8(Player* this, PlayState* play) { } int func_80842964(Player* this, PlayState* play) { - return Player_ActionChange_13(this, play) || Player_ActionChange_4(this, play) || Player_ActionChange_2(this, play); + return Player_ActionHandler_13(this, play) || Player_ActionHandler_Talk(this, play) || + Player_ActionHandler_2(this, play); } void Player_RequestQuake(PlayState* play, s32 speed, s32 y, s32 duration) { @@ -8486,7 +9033,7 @@ void func_80842D20(PlayState* play, Player* this) { func_80832440(play, this); Player_SetupAction(play, this, Player_Action_808505DC, 0); - if (func_8008E9C4(this)) { + if (Player_CheckHostileLockOn(this)) { sp28 = 2; } else { sp28 = 0; @@ -8582,7 +9129,8 @@ s32 func_80842DF4(PlayState* play, Player* this) { if (this->actor.colChkInfo.atHitEffect == 1) { this->actor.colChkInfo.damage = 8; - func_80837C0C(play, this, 4, 0.0f, 0.0f, this->actor.shape.rot.y, 20); + func_80837C0C(play, this, PLAYER_HIT_RESPONSE_ELECTRIC_SHOCK, 0.0f, 0.0f, this->actor.shape.rot.y, + 20); return 1; } } @@ -8607,7 +9155,7 @@ void Player_Action_80843188(Player* this, PlayState* play) { this->stateFlags1 &= ~PLAYER_STATE1_22; } - func_8083721C(this); + Player_DecelerateToZero(this); if (this->av2.actionVar2 != 0) { f32 sp54; @@ -8637,14 +9185,14 @@ void Player_Action_80843188(Player* this, PlayState* play) { sp48 = 100; } - sp46 = ABS(sp4A - this->unk_6BE) * 0.25f; + sp46 = ABS(sp4A - this->upperLimbRot.y) * 0.25f; if (sp46 < 50) { sp46 = 50; } Math_ScaledStepToS(&this->actor.focus.rot.x, sp4C, sp48); - this->unk_6BC = this->actor.focus.rot.x; - Math_ScaledStepToS(&this->unk_6BE, sp4A, sp46); + this->upperLimbRot.x = this->actor.focus.rot.x; + Math_ScaledStepToS(&this->upperLimbRot.y, sp4A, sp46); if (this->av1.actionVar1 != 0) { if (!func_80842DF4(play, this)) { @@ -8656,7 +9204,7 @@ void Player_Action_80843188(Player* this, PlayState* play) { this->av1.actionVar1 = 0; } } else if (!func_80842964(this, play)) { - if (Player_ActionChange_11(this, play)) { + if (Player_ActionHandler_11(this, play)) { func_808428D8(this, play); } else { this->stateFlags1 &= ~PLAYER_STATE1_22; @@ -8667,7 +9215,7 @@ void Player_Action_80843188(Player* this, PlayState* play) { LinkAnimation_Change(play, &this->skelAnime, &gPlayerAnim_clink_normal_defense_ALL, 1.0f, Animation_GetLastFrame(&gPlayerAnim_clink_normal_defense_ALL), 0.0f, ANIMMODE_ONCE, 0.0f); - Player_AnimReplaceApplyFlags(play, this, ANIM_FLAG_PLAYER_2); + Player_StartAnimMovement(play, this, ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT); } else { if (this->itemAction < 0) { func_8008EC70(this); @@ -8686,7 +9234,7 @@ void Player_Action_80843188(Player* this, PlayState* play) { this->stateFlags1 |= PLAYER_STATE1_22; Player_SetModelsForHoldingShield(this); - this->unk_6AE |= 0xC1; + this->unk_6AE_rotFlags |= UNK6AE_ROT_FOCUS_X | UNK6AE_ROT_UPPER_X | UNK6AE_ROT_UPPER_Y; } void Player_Action_808435C4(Player* this, PlayState* play) { @@ -8694,7 +9242,7 @@ void Player_Action_808435C4(Player* this, PlayState* play) { LinkAnimationHeader* anim; f32 frames; - func_8083721C(this); + Player_DecelerateToZero(this); if (this->av1.actionVar1 == 0) { sUpperBodyIsBusy = Player_UpdateUpperBody(this, play); @@ -8721,7 +9269,7 @@ void Player_Action_808435C4(Player* this, PlayState* play) { void Player_Action_8084370C(Player* this, PlayState* play) { s32 interruptResult; - func_8083721C(this); + Player_DecelerateToZero(this); interruptResult = Player_TryActionInterrupt(play, this, &this->skelAnime, 16.0f); @@ -8736,14 +9284,15 @@ void Player_Action_8084377C(Player* this, PlayState* play) { func_808382BC(this); - if (!(this->stateFlags1 & PLAYER_STATE1_29) && (this->av2.actionVar2 == 0) && (this->unk_8A1 != 0)) { - s16 temp = this->actor.shape.rot.y - this->unk_8A2; + if (!(this->stateFlags1 & PLAYER_STATE1_29) && (this->av2.actionVar2 == 0) && + (this->knockbackType != PLAYER_KNOCKBACK_NONE)) { + s16 temp = this->actor.shape.rot.y - this->knockbackRot; - this->yaw = this->actor.shape.rot.y = this->unk_8A2; - this->speedXZ = this->unk_8A4; + this->yaw = this->actor.shape.rot.y = this->knockbackRot; + this->speedXZ = this->knockbackSpeed; if (ABS(temp) > 0x4000) { - this->actor.shape.rot.y = this->unk_8A2 + 0x8000; + this->actor.shape.rot.y = this->knockbackRot + 0x8000; } if (this->actor.velocity.y < 0.0f) { @@ -8759,7 +9308,7 @@ void Player_Action_8084377C(Player* this, PlayState* play) { func_80853080(this, play); } } else if ((this->stateFlags1 & PLAYER_STATE1_29) || - (!(this->cylinder.base.acFlags & AC_HIT) && (this->unk_8A1 == 0))) { + (!(this->cylinder.base.acFlags & AC_HIT) && (this->knockbackType == PLAYER_KNOCKBACK_NONE))) { if (this->stateFlags1 & PLAYER_STATE1_29) { this->av2.actionVar2++; } else { @@ -8770,12 +9319,12 @@ void Player_Action_8084377C(Player* this, PlayState* play) { Player_AnimPlayOnce(play, this, (this->yaw != this->actor.shape.rot.y) ? &gPlayerAnim_link_normal_front_downB : &gPlayerAnim_link_normal_back_downB); - func_80832698(this, NA_SE_VO_LI_FREEZE); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_FREEZE); } } if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { - func_80832770(this, NA_SE_PL_BOUND); + Player_PlayFloorSfx(this, NA_SE_PL_BOUND); } } @@ -8783,7 +9332,7 @@ void Player_Action_80843954(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_5 | PLAYER_STATE2_6; func_808382BC(this); - func_8083721C(this); + Player_DecelerateToZero(this); if (LinkAnimation_Update(play, &this->skelAnime) && (this->speedXZ == 0.0f)) { if (this->stateFlags1 & PLAYER_STATE1_29) { @@ -8800,10 +9349,12 @@ void Player_Action_80843954(Player* this, PlayState* play) { } } +#if OOT_VERSION >= PAL_1_0 static AnimSfxEntry D_808545DC[] = { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 20) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_8, 30) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 20) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 30) }, }; +#endif void Player_Action_80843A38(Player* this, PlayState* play) { s32 interruptResult; @@ -8822,7 +9373,9 @@ void Player_Action_80843A38(Player* this, PlayState* play) { } } +#if OOT_VERSION >= PAL_1_0 Player_ProcessAnimSfxList(this, D_808545DC); +#endif } static Vec3f D_808545E4 = { 0.0f, 0.0f, 5.0f }; @@ -8844,14 +9397,14 @@ void func_80843AE8(PlayState* play, Player* this) { this->av2.actionVar2 = -1; } } else if (gSaveContext.healthAccumulator == 0) { - this->stateFlags1 &= ~PLAYER_STATE1_7; + this->stateFlags1 &= ~PLAYER_STATE1_DEAD; if (this->stateFlags1 & PLAYER_STATE1_27) { func_80838F18(play, this); } else { func_80853080(this, play); } this->unk_A87 = 20; - func_80837AFC(this, -20); + Player_SetInvulnerability(this, -20); Audio_SetBgmVolumeOnDuringFanfare(); } } else if (this->av1.actionVar1 != 0) { @@ -8865,22 +9418,22 @@ void func_80843AE8(PlayState* play, Player* this) { } static AnimSfxEntry D_808545F0[] = { - { NA_SE_PL_BOUND, ANIMSFX_DATA(ANIMSFX_TYPE_2, 60) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 140) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 164) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_8, 170) }, + { NA_SE_PL_BOUND, ANIMSFX_DATA(ANIMSFX_TYPE_FLOOR, 60) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 140) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 164) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 170) }, }; void Player_Action_80843CEC(Player* this, PlayState* play) { if (this->currentTunic != PLAYER_TUNIC_GORON) { - if ((play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) || (sFloorType == FLOOR_TYPE_9) || + if ((play->roomCtx.curRoom.environmentType == ROOM_ENV_HOT) || (sFloorType == FLOOR_TYPE_9) || ((func_80838144(sFloorType) >= 0) && !func_80042108(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId))) { func_8083821C(this); } } - func_8083721C(this); + Player_DecelerateToZero(this); if (LinkAnimation_Update(play, &this->skelAnime)) { if (this->actor.category == ACTORCAT_PLAYER) { @@ -8891,15 +9444,18 @@ void Player_Action_80843CEC(Player* this, PlayState* play) { if (this->skelAnime.animation == &gPlayerAnim_link_derth_rebirth) { Player_ProcessAnimSfxList(this, D_808545F0); - } else if (this->skelAnime.animation == &gPlayerAnim_link_normal_electric_shock_end) { + } +#if OOT_VERSION >= PAL_1_0 + else if (this->skelAnime.animation == &gPlayerAnim_link_normal_electric_shock_end) { if (LinkAnimation_OnFrame(&this->skelAnime, 88.0f)) { - func_80832770(this, NA_SE_PL_BOUND); + Player_PlayFloorSfx(this, NA_SE_PL_BOUND); } } +#endif } void func_80843E14(Player* this, u16 sfxId) { - func_80832698(this, sfxId); + Player_PlayVoiceSfx(this, sfxId); if ((this->heldActor != NULL) && (this->heldActor->id == ACTOR_EN_RU1)) { Actor_PlaySfx(this->heldActor, NA_SE_VO_RT_FALL); @@ -8912,19 +9468,19 @@ static FallImpactInfo D_80854600[] = { }; s32 func_80843E64(PlayState* play, Player* this) { - s32 sp34; + s32 fallDistance; if ((sFloorType == FLOOR_TYPE_6) || (sFloorType == FLOOR_TYPE_9)) { - sp34 = 0; + fallDistance = 0; } else { - sp34 = this->fallDistance; + fallDistance = this->fallDistance; } Math_StepToF(&this->speedXZ, 0.0f, 1.0f); this->stateFlags1 &= ~(PLAYER_STATE1_18 | PLAYER_STATE1_19); - if (sp34 >= 400) { + if (fallDistance >= 400) { s32 impactIndex; FallImpactInfo* impactInfo; @@ -8940,31 +9496,31 @@ s32 func_80843E64(PlayState* play, Player* this) { return -1; } - func_80837AE0(this, 40); + Player_SetIntangibility(this, 40); Player_RequestQuake(play, 32967, 2, 30); Player_RequestRumble(this, impactInfo->rumbleStrength, impactInfo->rumbleDuration, impactInfo->rumbleDecreaseRate, 0); Player_PlaySfx(this, NA_SE_PL_BODY_HIT); - func_80832698(this, impactInfo->sfxId); + Player_PlayVoiceSfx(this, impactInfo->sfxId); return impactIndex + 1; } - if (sp34 > 200) { - sp34 *= 2; + if (fallDistance > 200) { + fallDistance *= 2; - if (sp34 > 255) { - sp34 = 255; + if (fallDistance > 255) { + fallDistance = 255; } - Player_RequestRumble(this, (u8)sp34, (u8)(sp34 * 0.1f), (u8)sp34, 0); + Player_RequestRumble(this, (u8)fallDistance, (u8)(fallDistance * 0.1f), (u8)fallDistance, 0); if (sFloorType == FLOOR_TYPE_6) { - func_80832698(this, NA_SE_VO_LI_CLIMB_END); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_CLIMB_END); } } - func_808328A0(this); + Player_PlayLandingSfx(this); return 0; } @@ -8978,7 +9534,7 @@ void func_8084409C(PlayState* play, Player* this, f32 speedXZ, f32 velocityY) { heldActor->velocity.y = velocityY; func_80834644(play, this); Player_PlaySfx(this, NA_SE_PL_THROW); - func_80832698(this, NA_SE_VO_LI_SWORD_N); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_SWORD_N); } } @@ -8988,7 +9544,7 @@ void Player_Action_8084411C(Player* this, PlayState* play) { if (gSaveContext.respawn[RESPAWN_MODE_TOP].data > 40) { this->actor.gravity = 0.0f; - } else if (func_8008E9C4(this)) { + } else if (Player_CheckHostileLockOn(this)) { this->actor.gravity = -1.2f; } @@ -8997,11 +9553,11 @@ void Player_Action_8084411C(Player* this, PlayState* play) { if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Actor* heldActor; - if (this->stateFlags1 & PLAYER_STATE1_11) { + if (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) { heldActor = this->heldActor; if (!func_80835644(play, this, heldActor) && (heldActor->id == ACTOR_EN_NIW) && - CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) { + CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT)) { func_8084409C(play, this, this->speedXZ + 2.0f, this->actor.velocity.y + 2.0f); } } @@ -9036,7 +9592,8 @@ void Player_Action_8084411C(Player* this, PlayState* play) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && !(this->stateFlags2 & PLAYER_STATE2_19) && - !(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_27)) && (this->speedXZ > 0.0f)) { + !(this->stateFlags1 & (PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_27)) && + (this->speedXZ > 0.0f)) { if ((this->yDistToLedge >= 150.0f) && (this->controlStickDirections[this->controlStickDataIndex] == PLAYER_STICK_DIR_FORWARD)) { func_8083EC18(this, play, sTouchedWallFlags); @@ -9045,9 +9602,9 @@ void Player_Action_8084411C(Player* this, PlayState* play) { (70.0f * this->ageProperties->unk_08))) { AnimTaskQueue_DisableTransformTasksForGroup(play); if (this->stateFlags1 & PLAYER_STATE1_2) { - func_80832698(this, NA_SE_VO_LI_HOOKSHOT_HANG); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_HOOKSHOT_HANG); } else { - func_80832698(this, NA_SE_VO_LI_HANG); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_HANG); } this->actor.world.pos.y += this->yDistToLedge; func_8083A5C4(play, this, this->actor.wallPoly, this->distToInteractWall, @@ -9064,22 +9621,22 @@ void Player_Action_8084411C(Player* this, PlayState* play) { s32 sp3C; if (this->stateFlags2 & PLAYER_STATE2_19) { - if (func_8008E9C4(this)) { + if (Player_CheckHostileLockOn(this)) { anim = D_80853D4C[this->av1.actionVar1][2]; } else { anim = D_80853D4C[this->av1.actionVar1][1]; } } else if (this->skelAnime.animation == &gPlayerAnim_link_normal_run_jump) { anim = &gPlayerAnim_link_normal_run_jump_end; - } else if (func_8008E9C4(this)) { + } else if (Player_CheckHostileLockOn(this)) { anim = &gPlayerAnim_link_anchor_landingR; func_80833C3C(this); } else if (this->fallDistance <= 80) { anim = GET_PLAYER_ANIM(PLAYER_ANIMGROUP_short_landing, this->modelAnimType); } else if ((this->fallDistance < 800) && (this->controlStickDirections[this->controlStickDataIndex] == PLAYER_STICK_DIR_FORWARD) && - !(this->stateFlags1 & PLAYER_STATE1_11)) { - func_8083BC04(this, play); + !(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR)) { + Player_SetupRoll(this, play); return; } @@ -9088,10 +9645,15 @@ void Player_Action_8084411C(Player* this, PlayState* play) { if (sp3C > 0) { func_8083A098(this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_landing, this->modelAnimType), play); this->skelAnime.endFrame = 8.0f; + + // `func_8083A098` above can choose from a few different "idle" action variants. + // However `fallDamageStunTimer` is only processed by `Player_Action_Idle`. + // This means it is possible for the stun to not take effect + // (for example, by holding Z when landing). if (sp3C == 1) { - this->av2.actionVar2 = 10; + this->av2.fallDamageStunTimer = 10; } else { - this->av2.actionVar2 = 20; + this->av2.fallDamageStunTimer = 20; } } else if (sp3C == 0) { func_8083A098(this, anim, play); @@ -9099,17 +9661,17 @@ void Player_Action_8084411C(Player* this, PlayState* play) { } } -static AnimSfxEntry D_8085460C[] = { - { NA_SE_VO_LI_SWORD_N, ANIMSFX_DATA(ANIMSFX_TYPE_4, 1) }, - { NA_SE_PL_WALK_GROUND, ANIMSFX_DATA(ANIMSFX_TYPE_3, 6) }, - { NA_SE_PL_ROLL, ANIMSFX_DATA(ANIMSFX_TYPE_1, 6) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_5, 18) }, +static AnimSfxEntry sRollAnimSfxList[] = { + { NA_SE_VO_LI_SWORD_N, ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 1) }, + { NA_SE_PL_WALK_GROUND, ANIMSFX_DATA(ANIMSFX_TYPE_FLOOR_BY_AGE, 6) }, + { NA_SE_PL_ROLL, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 6) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_LANDING, 18) }, }; -void Player_Action_80844708(Player* this, PlayState* play) { - Actor* cylinderOc; +void Player_Action_Roll(Player* this, PlayState* play) { + Actor* ocCollidedActor; s32 interruptResult; - s32 sp44; + s32 animDone; DynaPolyActor* wallPolyActor; s32 pad; f32 speedTarget; @@ -9117,37 +9679,42 @@ void Player_Action_80844708(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_5; - cylinderOc = NULL; - sp44 = LinkAnimation_Update(play, &this->skelAnime); + ocCollidedActor = NULL; + animDone = LinkAnimation_Update(play, &this->skelAnime); if (LinkAnimation_OnFrame(&this->skelAnime, 8.0f)) { - func_80837AFC(this, -10); + Player_SetInvulnerability(this, FRAMERATE_CONST(-10, -8)); } - if (func_80842964(this, play) == 0) { - if (this->av2.actionVar2 != 0) { + if (!func_80842964(this, play)) { + if (this->av2.bonked) { Math_StepToF(&this->speedXZ, 0.0f, 2.0f); interruptResult = Player_TryActionInterrupt(play, this, &this->skelAnime, 5.0f); if ((interruptResult != PLAYER_INTERRUPT_NEW_ACTION) && - ((interruptResult >= PLAYER_INTERRUPT_MOVE) || sp44)) { + ((interruptResult >= PLAYER_INTERRUPT_MOVE) || animDone)) { func_8083A060(this, play); } } else { + // Must have a speed of 7 or above to be able to bonk into something if (this->speedXZ >= 7.0f) { if (((this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && (sWorldYawToTouchedWall < 0x2000)) || ((this->cylinder.base.ocFlags1 & OC1_HIT) && - (cylinderOc = this->cylinder.base.oc, - ((cylinderOc->id == ACTOR_EN_WOOD02) && - (ABS((s16)(this->actor.world.rot.y - cylinderOc->yawTowardsPlayer)) > 0x6000))))) { - - if (cylinderOc != NULL) { - cylinderOc->home.rot.y = 1; + (ocCollidedActor = this->cylinder.base.oc, + ((ocCollidedActor->id == ACTOR_EN_WOOD02) && + (ABS((s16)(this->actor.world.rot.y - ocCollidedActor->yawTowardsPlayer)) > 0x6000))))) { + if (ocCollidedActor != NULL) { + // The EN_WOOD02 actor uses home y rotation as a flag to signal that it has been + // bonked into and should try to spawn a drop. + ocCollidedActor->home.rot.y = 1; } else if (this->actor.wallBgId != BGCHECK_SCENE) { wallPolyActor = DynaPoly_GetActor(&play->colCtx, this->actor.wallBgId); + if ((wallPolyActor != NULL) && (wallPolyActor->actor.id == ACTOR_OBJ_KIBAKO2)) { + // The OBJ_KIBAKO2 actor uses home z rotation as a flag to signal that it has been + // bonked into and should break. wallPolyActor->actor.home.rot.z = 1; } } @@ -9157,21 +9724,27 @@ void Player_Action_80844708(Player* this, PlayState* play) { Player_RequestQuake(play, 33267, 3, 12); Player_RequestRumble(this, 255, 20, 150, 0); Player_PlaySfx(this, NA_SE_PL_BODY_HIT); - func_80832698(this, NA_SE_VO_LI_CLIMB_END); - this->av2.actionVar2 = 1; + Player_PlayVoiceSfx(this, NA_SE_VO_LI_CLIMB_END); + this->av2.bonked = true; + return; } } - if ((this->skelAnime.curFrame < 15.0f) || !Player_ActionChange_7(this, play)) { + if ((this->skelAnime.curFrame < 15.0f) || !Player_ActionHandler_7(this, play)) { if (this->skelAnime.curFrame >= 20.0f) { func_8083A060(this, play); + return; } Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_CURVED, play); + // `speedTarget` at this point is the speed that would be used for regular walking. + // Rolling speed is 1.5 times faster than what the walking speed would be for the current control stick + // input. speedTarget *= 1.5f; + if ((speedTarget < 3.0f) || (this->controlStickDirections[this->controlStickDataIndex] != PLAYER_STICK_DIR_FORWARD)) { speedTarget = 3.0f; @@ -9180,10 +9753,10 @@ void Player_Action_80844708(Player* this, PlayState* play) { func_8083DF68(this, speedTarget, this->actor.shape.rot.y); if (func_8084269C(play, this)) { - func_8002F8F0(&this->actor, NA_SE_PL_ROLL_DUST - SFX_FLAG); + Actor_PlaySfx_Flagged2(&this->actor, NA_SE_PL_ROLL_DUST - SFX_FLAG); } - Player_ProcessAnimSfxList(this, D_8085460C); + Player_ProcessAnimSfxList(this, sRollAnimSfxList); } } } @@ -9200,7 +9773,7 @@ void Player_Action_80844A44(Player* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.colChkInfo.damage = 0x10; - func_80837C0C(play, this, 1, 4.0f, 5.0f, this->actor.shape.rot.y, 20); + func_80837C0C(play, this, PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE, 4.0f, 5.0f, this->actor.shape.rot.y, 20); } } @@ -9226,7 +9799,7 @@ void Player_Action_80844AF4(Player* this, PlayState* play) { this->meleeWeaponAnimation += 2; func_80837948(play, this, this->meleeWeaponAnimation); this->unk_845 = 3; - func_808328A0(this); + Player_PlayLandingSfx(this); } } } @@ -9245,7 +9818,7 @@ s32 func_80844BE4(Player* this, PlayState* play) { } func_80837948(play, this, temp); - func_80837AFC(this, -8); + Player_SetInvulnerability(this, -8); this->stateFlags2 |= PLAYER_STATE2_17; if (this->controlStickDirections[this->controlStickDataIndex] == PLAYER_STICK_DIR_FORWARD) { @@ -9290,17 +9863,17 @@ void Player_Action_80844E68(Player* this, PlayState* play) { s16 yawTarget; s32 temp; - this->stateFlags1 |= PLAYER_STATE1_12; + this->stateFlags1 |= PLAYER_STATE1_CHARGING_SPIN_ATTACK; if (LinkAnimation_Update(play, &this->skelAnime)) { - func_80832DBC(this); - func_808355DC(this); - this->stateFlags1 &= ~PLAYER_STATE1_17; + Player_FinishAnimMovement(this); + Player_SetParallel(this); + this->stateFlags1 &= ~PLAYER_STATE1_PARALLEL; Player_AnimPlayLoop(play, this, D_80854360[Player_HoldsTwoHandedWeapon(this)]); this->av2.actionVar2 = -1; } - func_8083721C(this); + Player_DecelerateToZero(this); if (!func_80842964(this, play) && (this->av2.actionVar2 != 0)) { func_80844E3C(this); @@ -9342,7 +9915,7 @@ void Player_Action_80845000(Player* this, PlayState* play) { sp5C = fabsf(this->speedXZ); sp58 = sp5C * 1.5f; - this->stateFlags1 |= PLAYER_STATE1_12; + this->stateFlags1 |= PLAYER_STATE1_CHARGING_SPIN_ATTACK; if (sp58 < 1.5f) { sp58 = 1.5f; @@ -9404,7 +9977,7 @@ void Player_Action_80845308(Player* this, PlayState* play) { sp5C = fabsf(this->speedXZ); - this->stateFlags1 |= PLAYER_STATE1_12; + this->stateFlags1 |= PLAYER_STATE1_CHARGING_SPIN_ATTACK; if (sp5C == 0.0f) { sp5C = ABS(this->unk_87C) * 0.0015f; @@ -9512,7 +10085,11 @@ void Player_Action_80845668(Player* this, PlayState* play) { if (LinkAnimation_OnFrame(&this->skelAnime, 30.0f)) { func_8083D0A8(play, this, 10.0f); } +#if OOT_VERSION < PAL_1_0 + temp3 = 68.0f; +#else temp3 = 50.0f; +#endif } else if (this->skelAnime.animation == &gPlayerAnim_link_normal_150step_up) { temp3 = 30.0f; } else if (this->skelAnime.animation == &gPlayerAnim_link_normal_100step_up) { @@ -9520,13 +10097,13 @@ void Player_Action_80845668(Player* this, PlayState* play) { } if (LinkAnimation_OnFrame(&this->skelAnime, temp3)) { - func_808328A0(this); - func_80832698(this, NA_SE_VO_LI_CLIMB_END); + Player_PlayLandingSfx(this); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_CLIMB_END); } if ((this->skelAnime.animation == &gPlayerAnim_link_normal_100step_up) || (this->skelAnime.curFrame > 5.0f)) { if (this->av2.actionVar2 == 0) { - func_80832854(this); + Player_PlayJumpingSfx(this); this->av2.actionVar2 = 1; } Math_StepToF(&this->actor.shape.yOffset, 0.0f, 150.0f); @@ -9555,7 +10132,8 @@ void Player_Action_WaitForPutAway(Player* this, PlayState* play) { // The other conditions listed will force the put away delay function to run instantly if carrying an actor. // This is necessary because the UpperAction for carrying actors will always return true while holding // the actor, so `!Player_UpdateUpperBody` could never pass. - if (((this->stateFlags1 & PLAYER_STATE1_11) && (this->heldActor != NULL) && (this->getItemId == GI_NONE)) || + if (((this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (this->heldActor != NULL) && + (this->getItemId == GI_NONE)) || !Player_UpdateUpperBody(this, play)) { this->afterPutAwayFunc(play, this); } @@ -9629,7 +10207,7 @@ s32 func_80845C68(PlayState* play, s32 arg1) { } void Player_Action_80845CA4(Player* this, PlayState* play) { - if (!Player_ActionChange_13(this, play)) { + if (!Player_ActionHandler_13(this, play)) { if (this->av2.actionVar2 == 0) { LinkAnimation_Update(play, &this->skelAnime); @@ -9638,7 +10216,7 @@ void Player_Action_80845CA4(Player* this, PlayState* play) { this->av2.actionVar2 = 1; } } else if (this->av1.actionVar1 == 0) { - f32 sp3C = 5.0f * D_808535E8; + f32 sp3C = 5.0f * sWaterSpeedFactor; s32 temp = func_80845BA0(play, this, &sp3C, -1); if (temp < 30) { @@ -9676,14 +10254,14 @@ void Player_Action_80845CA4(Player* this, PlayState* play) { Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN)); func_80845C68(play, gSaveContext.respawn[RESPAWN_MODE_DOWN].data); - if (!Player_ActionChange_4(this, play)) { + if (!Player_ActionHandler_Talk(this, play)) { func_8083CF5C(this, play); } } } } - if (this->stateFlags1 & PLAYER_STATE1_11) { + if (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) { Player_UpdateUpperBody(this, play); } } @@ -9705,7 +10283,7 @@ void Player_Action_80845EF8(Player* this, PlayState* play) { } else { func_8083C0E8(this, play); if (play->roomCtx.prevRoom.num >= 0) { - func_80097534(play, &play->roomCtx); + Room_FinishRoomChange(play, &play->roomCtx); } Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN)); Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, 0xDFF); @@ -9719,7 +10297,7 @@ void Player_Action_80845EF8(Player* this, PlayState* play) { } void Player_Action_80846050(Player* this, PlayState* play) { - func_8083721C(this); + Player_DecelerateToZero(this); if (LinkAnimation_Update(play, &this->skelAnime)) { func_80839F90(this, play); @@ -9742,13 +10320,13 @@ void Player_Action_80846050(Player* this, PlayState* play) { } static AnimSfxEntry D_8085461C[] = { - { NA_SE_VO_LI_SWORD_L, ANIMSFX_DATA(ANIMSFX_TYPE_4, 49) }, - { NA_SE_VO_LI_SWORD_N, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 230) }, + { NA_SE_VO_LI_SWORD_L, ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 49) }, + { NA_SE_VO_LI_SWORD_N, -ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 230) }, }; void Player_Action_80846120(Player* this, PlayState* play) { if (LinkAnimation_Update(play, &this->skelAnime) && (this->av2.actionVar2++ > 20)) { - if (!Player_ActionChange_13(this, play)) { + if (!Player_ActionHandler_13(this, play)) { func_8083A098(this, &gPlayerAnim_link_normal_heavy_carry_end, play); } } else if (LinkAnimation_OnFrame(&this->skelAnime, 41.0f)) { @@ -9757,7 +10335,7 @@ void Player_Action_80846120(Player* this, PlayState* play) { this->heldActor = &heavyBlock->dyna.actor; this->actor.child = &heavyBlock->dyna.actor; heavyBlock->dyna.actor.parent = &this->actor; - func_8002DBD0(&heavyBlock->dyna.actor, &heavyBlock->unk_164, &this->leftHandPos); + Actor_WorldToActorCoords(&heavyBlock->dyna.actor, &heavyBlock->unk_164, &this->leftHandPos); } else if (LinkAnimation_OnFrame(&this->skelAnime, 229.0f)) { Actor* heldActor = this->heldActor; @@ -9772,7 +10350,7 @@ void Player_Action_80846120(Player* this, PlayState* play) { } void Player_Action_80846260(Player* this, PlayState* play) { - func_8083721C(this); + Player_DecelerateToZero(this); if (LinkAnimation_Update(play, &this->skelAnime)) { Player_AnimPlayLoop(play, this, &gPlayerAnim_link_silver_wait); @@ -9785,9 +10363,9 @@ void Player_Action_80846260(Player* this, PlayState* play) { this->actor.child = interactRangeActor; interactRangeActor->parent = &this->actor; } else if (LinkAnimation_OnFrame(&this->skelAnime, 25.0f)) { - func_80832698(this, NA_SE_VO_LI_SWORD_L); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_SWORD_L); } - } else if (CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) { + } else if (CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT)) { Player_SetupAction(play, this, Player_Action_80846358, 1); Player_AnimPlayOnce(play, this, &gPlayerAnim_link_silver_throw); } @@ -9807,7 +10385,7 @@ void Player_Action_80846358(Player* this, PlayState* play) { heldActor->velocity.y = 20.0f; func_80834644(play, this); Player_PlaySfx(this, NA_SE_PL_THROW); - func_80832698(this, NA_SE_VO_LI_SWORD_N); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_SWORD_N); } } @@ -9822,14 +10400,14 @@ void Player_Action_80846408(Player* this, PlayState* play) { this->av2.actionVar2--; if (this->av2.actionVar2 == 0) { func_8083A098(this, &gPlayerAnim_link_normal_nocarry_free_end, play); - this->stateFlags1 &= ~PLAYER_STATE1_11; - func_80832698(this, NA_SE_VO_LI_DAMAGE_S); + this->stateFlags1 &= ~PLAYER_STATE1_CARRYING_ACTOR; + Player_PlayVoiceSfx(this, NA_SE_VO_LI_DAMAGE_S); } } } void Player_Action_808464B0(Player* this, PlayState* play) { - func_8083721C(this); + Player_DecelerateToZero(this); if (LinkAnimation_Update(play, &this->skelAnime)) { func_80839F90(this, play); @@ -9854,7 +10432,7 @@ void Player_Action_80846578(Player* this, PlayState* play) { f32 speedTarget; s16 yawTarget; - func_8083721C(this); + Player_DecelerateToZero(this); if (LinkAnimation_Update(play, &this->skelAnime) || ((this->skelAnime.curFrame >= 8.0f) && @@ -9870,7 +10448,7 @@ void Player_Action_80846578(Player* this, PlayState* play) { static ColliderCylinderInit D_80854624 = { { - COLTYPE_HIT5, + COL_MATERIAL_HIT5, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, @@ -9878,7 +10456,7 @@ static ColliderCylinderInit D_80854624 = { COLSHAPE_CYLINDER, }, { - ELEMTYPE_UNK1, + ELEM_MATERIAL_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_NONE, @@ -9890,7 +10468,7 @@ static ColliderCylinderInit D_80854624 = { static ColliderQuadInit D_80854650 = { { - COLTYPE_NONE, + COL_MATERIAL_NONE, AT_ON | AT_TYPE_PLAYER, AC_NONE, OC1_NONE, @@ -9898,7 +10476,7 @@ static ColliderQuadInit D_80854650 = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00000100, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -9910,7 +10488,7 @@ static ColliderQuadInit D_80854650 = { static ColliderQuadInit D_808546A0 = { { - COLTYPE_METAL, + COL_MATERIAL_METAL, AT_ON | AT_TYPE_PLAYER, AC_ON | AC_HARD | AC_TYPE_ENEMY, OC1_NONE, @@ -9918,7 +10496,7 @@ static ColliderQuadInit D_808546A0 = { COLSHAPE_QUAD, }, { - ELEMTYPE_UNK2, + ELEM_MATERIAL_UNK2, { 0x00100000, 0x00, 0x00 }, { 0xDFCFFFFF, 0x00, 0x00 }, ATELEM_ON | ATELEM_SFX_NORMAL, @@ -9976,9 +10554,10 @@ void func_808467D4(PlayState* play, Player* this) { this->yaw = this->actor.shape.rot.y = -0x8000; LinkAnimation_Change(play, &this->skelAnime, this->ageProperties->unk_A0, 2.0f / 3.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f); - Player_AnimReplaceApplyFlags(play, this, - ANIM_REPLACE_APPLY_FLAG_9 | ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | - ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_StartAnimMovement(play, this, + PLAYER_ANIM_MOVEMENT_RESET_BY_AGE | ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | + ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_OVERRIDE_MOVEMENT); if (LINK_IS_ADULT) { func_80846720(play, this, 0); } @@ -9987,9 +10566,9 @@ void func_808467D4(PlayState* play, Player* this) { void func_808468A8(PlayState* play, Player* this) { Player_SetupAction(play, this, Player_Action_8084F9A0, 0); - Player_AnimReplaceApplyFlags(play, this, - ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_PLAYER_SETMOVE | - ANIM_FLAG_NO_MOVE | ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_StartAnimMovement(play, this, + ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_ADJUST_STARTING_POS | ANIM_FLAG_OVERRIDE_MOVEMENT); } void func_808468E8(PlayState* play, Player* this) { @@ -10001,7 +10580,7 @@ void func_808468E8(PlayState* play, Player* this) { } void func_80846978(PlayState* play, Player* this) { - func_80837C0C(play, this, 1, 2.0f, 2.0f, this->actor.shape.rot.y + 0x8000, 0); + func_80837C0C(play, this, PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE, 2.0f, 2.0f, this->actor.shape.rot.y + 0x8000, 0); } void func_808469BC(PlayState* play, Player* this) { @@ -10024,7 +10603,7 @@ void func_80846A68(PlayState* play, Player* this) { } static InitChainEntry sInitChain[] = { - ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP), + ICHAIN_F32(lockOnArrowOffset, 500, ICHAIN_STOP), }; static EffectBlureInit2 D_8085470C = { @@ -10044,7 +10623,7 @@ void Player_InitCommon(Player* this, PlayState* play, FlexSkeletonHeader* skelHe SkelAnime_InitLink(play, &this->skelAnime, skelHeader, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_wait, this->modelAnimType), 9, this->jointTable, this->morphTable, PLAYER_LIMB_MAX); this->skelAnime.baseTransl = sSkeletonBaseTransl; - SkelAnime_InitLink(play, &this->upperSkelAnime, skelHeader, func_80833338(this), 9, this->upperJointTable, + SkelAnime_InitLink(play, &this->upperSkelAnime, skelHeader, Player_GetIdleAnim(this), 9, this->upperJointTable, this->upperMorphTable, PLAYER_LIMB_MAX); this->upperSkelAnime.baseTransl = sSkeletonBaseTransl; @@ -10124,7 +10703,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { play->tryPlayerCsAction = Player_TryCsAction; play->func_11D54 = func_80853080; play->damagePlayer = Player_InflictDamage; - play->talkWithPlayer = func_80853148; + play->talkWithPlayer = Player_StartTalking; thisx->room = -1; this->ageProperties = &sAgeProperties[gSaveContext.save.linkAge]; @@ -10142,8 +10721,11 @@ void Player_Init(Actor* thisx, PlayState* play2) { } else { ASSERT(giAllocSize < GI_ALLOC_SIZE, "[HackerOoT:ERROR]: GI Object larger than the allocated size.", __FILE__, __LINE__); + // `giObjectSegment` is used for both "get item" objects and title cards. The maximum size for + // get item objects is 0x2000 (see the assert in func_8083AE40), and the maximum size for + // title cards is 0x1000 * LANGUAGE_MAX since each title card image includes all languages. this->giObjectSegment = - (void*)(((uintptr_t)ZELDA_ARENA_MALLOC(GI_ALLOC_SIZE, "../z_player.c", 17175) + 8) & ~0xF); + (void*)(((uintptr_t)ZELDA_ARENA_MALLOC(0x1000 * LANGUAGE_MAX + 8, "../z_player.c", 17175) + 8) & ~0xF); } respawnFlag = gSaveContext.respawnFlag; @@ -10180,7 +10762,12 @@ void Player_Init(Actor* thisx, PlayState* play2) { (gEntranceTable[((void)0, gSaveContext.save.entranceIndex) + ((void)0, gSaveContext.sceneLayer)].field & ENTRANCE_INFO_DISPLAY_TITLE_CARD_FLAG) && ((play->sceneId != SCENE_DODONGOS_CAVERN) || GET_EVENTCHKINF(EVENTCHKINF_B0)) && - ((play->sceneId != SCENE_BOMBCHU_SHOP) || GET_EVENTCHKINF(EVENTCHKINF_25))) { +#if OOT_VERSION < PAL_1_0 + ((play->sceneId != SCENE_BOMBCHU_BOWLING_ALLEY) || GET_EVENTCHKINF(EVENTCHKINF_25)) +#else + ((play->sceneId != SCENE_BOMBCHU_SHOP) || GET_EVENTCHKINF(EVENTCHKINF_25)) +#endif + ) { TitleCard_InitPlaceName(play, &play->actorCtx.titleCtx, this->giObjectSegment, 160, 120, 144, 24, 20); } } @@ -10188,7 +10775,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { } if (func_80845C68(play, (respawnFlag == 2) ? 1 : 0) == 0) { - gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = (thisx->params & 0xFF) | 0xD00; + gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = PARAMS_GET_S(thisx->params, 0, 8) | 0xD00; } gSaveContext.respawn[RESPAWN_MODE_DOWN].data = 1; @@ -10197,7 +10784,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { gSaveContext.save.info.infTable[INFTABLE_1AX_INDEX] |= gBitFlags[play->sceneId]; } - initMode = (thisx->params & 0xF00) >> 8; + initMode = PARAMS_GET_S(thisx->params, 8, 4); if ((initMode == 5) || (initMode == 6)) { if (gSaveContext.save.cutsceneIndex >= 0xFFF0) { initMode = 13; @@ -10230,60 +10817,60 @@ void Player_Init(Actor* thisx, PlayState* play2) { MREG(64) = 0; } -void func_808471F4(s16* pValue) { +void Player_ApproachZeroBinang(s16* pValue) { s16 step; - step = (ABS(*pValue) * 100.0f) / 1000.0f; + step = ABS(*pValue) * 100.0f / 1000.0f; step = CLAMP(step, 400, 4000); Math_ScaledStepToS(pValue, 0, step); } void func_80847298(Player* this) { - if (!(this->unk_6AE & 2)) { - s16 sp26 = this->actor.focus.rot.y - this->actor.shape.rot.y; + if (!(this->unk_6AE_rotFlags & UNK6AE_ROT_FOCUS_Y)) { + s16 diff = this->actor.focus.rot.y - this->actor.shape.rot.y; - func_808471F4(&sp26); - this->actor.focus.rot.y = this->actor.shape.rot.y + sp26; + Player_ApproachZeroBinang(&diff); + this->actor.focus.rot.y = this->actor.shape.rot.y + diff; } - if (!(this->unk_6AE & 1)) { - func_808471F4(&this->actor.focus.rot.x); + if (!(this->unk_6AE_rotFlags & UNK6AE_ROT_FOCUS_X)) { + Player_ApproachZeroBinang(&this->actor.focus.rot.x); } - if (!(this->unk_6AE & 8)) { - func_808471F4(&this->unk_6B6); + if (!(this->unk_6AE_rotFlags & UNK6AE_ROT_HEAD_X)) { + Player_ApproachZeroBinang(&this->headLimbRot.x); } - if (!(this->unk_6AE & 0x40)) { - func_808471F4(&this->unk_6BC); + if (!(this->unk_6AE_rotFlags & UNK6AE_ROT_UPPER_X)) { + Player_ApproachZeroBinang(&this->upperLimbRot.x); } - if (!(this->unk_6AE & 4)) { - func_808471F4(&this->actor.focus.rot.z); + if (!(this->unk_6AE_rotFlags & UNK6AE_ROT_FOCUS_Z)) { + Player_ApproachZeroBinang(&this->actor.focus.rot.z); } - if (!(this->unk_6AE & 0x10)) { - func_808471F4(&this->unk_6B8); + if (!(this->unk_6AE_rotFlags & UNK6AE_ROT_HEAD_Y)) { + Player_ApproachZeroBinang(&this->headLimbRot.y); } - if (!(this->unk_6AE & 0x20)) { - func_808471F4(&this->unk_6BA); + if (!(this->unk_6AE_rotFlags & UNK6AE_ROT_HEAD_Z)) { + Player_ApproachZeroBinang(&this->headLimbRot.z); } - if (!(this->unk_6AE & 0x80)) { - if (this->unk_6B0 != 0) { - func_808471F4(&this->unk_6B0); + if (!(this->unk_6AE_rotFlags & UNK6AE_ROT_UPPER_Y)) { + if (this->upperLimbYawSecondary != 0) { + Player_ApproachZeroBinang(&this->upperLimbYawSecondary); } else { - func_808471F4(&this->unk_6BE); + Player_ApproachZeroBinang(&this->upperLimbRot.y); } } - if (!(this->unk_6AE & 0x100)) { - func_808471F4(&this->unk_6C0); + if (!(this->unk_6AE_rotFlags & UNK6AE_ROT_UPPER_Z)) { + Player_ApproachZeroBinang(&this->upperLimbRot.z); } - this->unk_6AE = 0; + this->unk_6AE_rotFlags = 0; } static f32 D_80854784[] = { 120.0f, 240.0f, 360.0f }; @@ -10311,10 +10898,10 @@ void Player_UpdateInterface(PlayState* play, Player* this) { } } else if ((Player_Action_8084E3C4 != this->actionFunc) && !(this->stateFlags2 & PLAYER_STATE2_CRAWLING)) { if ((this->doorType != PLAYER_DOORTYPE_NONE) && - (!(this->stateFlags1 & PLAYER_STATE1_11) || + (!(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) || ((heldActor != NULL) && (heldActor->id == ACTOR_EN_RU1)))) { doAction = DO_ACTION_OPEN; - } else if ((!(this->stateFlags1 & PLAYER_STATE1_11) || (heldActor == NULL)) && + } else if ((!(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) || (heldActor == NULL)) && (interactRangeActor != NULL) && ((!sp1C && (this->getItemId == GI_NONE)) || ((this->getItemId < 0) && !(this->stateFlags1 & PLAYER_STATE1_27)))) { @@ -10332,7 +10919,7 @@ void Player_UpdateInterface(PlayState* play, Player* this) { doAction = DO_ACTION_CLIMB; } else if ((this->stateFlags1 & PLAYER_STATE1_23) && !EN_HORSE_CHECK_4((EnHorse*)this->rideActor) && (Player_Action_8084D3E4 != this->actionFunc)) { - if ((this->stateFlags2 & PLAYER_STATE2_1) && (this->talkActor != NULL)) { + if ((this->stateFlags2 & PLAYER_STATE2_CAN_ACCEPT_TALK_OFFER) && (this->talkActor != NULL)) { if (this->talkActor->category == ACTORCAT_NPC) { doAction = DO_ACTION_SPEAK; } else { @@ -10341,7 +10928,7 @@ void Player_UpdateInterface(PlayState* play, Player* this) { } else if (!func_8002DD78(this) && !(this->stateFlags1 & PLAYER_STATE1_20)) { doAction = DO_ACTION_FASTER; } - } else if ((this->stateFlags2 & PLAYER_STATE2_1) && (this->talkActor != NULL)) { + } else if ((this->stateFlags2 & PLAYER_STATE2_CAN_ACCEPT_TALK_OFFER) && (this->talkActor != NULL)) { if (this->talkActor->category == ACTORCAT_NPC) { doAction = DO_ACTION_SPEAK; } else { @@ -10352,10 +10939,10 @@ void Player_UpdateInterface(PlayState* play, Player* this) { doAction = DO_ACTION_DOWN; } else if (this->stateFlags2 & PLAYER_STATE2_DO_ACTION_ENTER) { doAction = DO_ACTION_ENTER; - } else if ((this->stateFlags1 & PLAYER_STATE1_11) && (this->getItemId == GI_NONE) && + } else if ((this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (this->getItemId == GI_NONE) && (heldActor != NULL)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (heldActor->id == ACTOR_EN_NIW)) { - if (func_8083EAF0(this, heldActor) == 0) { + if (!Player_CanThrowCarriedActor(this, heldActor)) { doAction = DO_ACTION_DROP; } else { doAction = DO_ACTION_THROW; @@ -10373,22 +10960,22 @@ void Player_UpdateInterface(PlayState* play, Player* this) { doAction = sDiveNumberDoActions[sp24]; } else if (sp1C && !(this->stateFlags2 & PLAYER_STATE2_10)) { doAction = DO_ACTION_DIVE; - } else if (!sp1C && (!(this->stateFlags1 & PLAYER_STATE1_22) || func_80833BCC(this) || + } else if (!sp1C && (!(this->stateFlags1 & PLAYER_STATE1_22) || Player_IsZTargeting(this) || !Player_IsChildWithHylianShield(this))) { if ((!(this->stateFlags1 & PLAYER_STATE1_14) && (controlStickDirection <= PLAYER_STICK_DIR_FORWARD) && - (func_8008E9C4(this) || - ((sFloorType != FLOOR_TYPE_7) && - (func_80833B2C(this) || ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_2) && - !(this->stateFlags1 & PLAYER_STATE1_22) && - (controlStickDirection == PLAYER_STICK_DIR_FORWARD))))))) { + (Player_CheckHostileLockOn(this) || + ((sFloorType != FLOOR_TYPE_7) && (Player_FriendlyLockOnOrParallel(this) || + ((play->roomCtx.curRoom.type != ROOM_TYPE_INDOORS) && + !(this->stateFlags1 & PLAYER_STATE1_22) && + (controlStickDirection == PLAYER_STICK_DIR_FORWARD))))))) { doAction = DO_ACTION_ATTACK; - } else if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_2) && func_80833BCC(this) && + } else if ((play->roomCtx.curRoom.type != ROOM_TYPE_INDOORS) && Player_IsZTargeting(this) && (controlStickDirection >= PLAYER_STICK_DIR_LEFT)) { doAction = DO_ACTION_JUMP; } else if ((this->heldItemAction >= PLAYER_IA_SWORD_MASTER) || - ((this->stateFlags2 & PLAYER_STATE2_20) && - (play->actorCtx.targetCtx.arrowPointedActor == NULL))) { + ((this->stateFlags2 & PLAYER_STATE2_NAVI_ACTIVE) && + (play->actorCtx.attention.naviHoverActor == NULL))) { doAction = DO_ACTION_PUTAWAY; } } @@ -10396,16 +10983,18 @@ void Player_UpdateInterface(PlayState* play, Player* this) { } if (doAction != DO_ACTION_PUTAWAY) { - this->unk_837 = 20; - } else if (this->unk_837 != 0) { + this->putAwayCooldownTimer = 20; + } else if (this->putAwayCooldownTimer != 0) { + // Replace the "Put Away" Do Action label with a blank label while + // the cooldown timer is counting down doAction = DO_ACTION_NONE; - this->unk_837--; + this->putAwayCooldownTimer--; } Interface_SetDoAction(play, doAction); if (this->stateFlags2 & PLAYER_STATE2_21) { - if (this->unk_664 != NULL) { + if (this->focusActor != NULL) { Interface_SetNaviCall(play, 0x1E); } else { Interface_SetNaviCall(play, 0x1D); @@ -10459,7 +11048,7 @@ s32 Player_UpdateHoverBoots(Player* this) { } /** - * Peforms various tasks related to scene collision. + * Performs various tasks related to scene collision. * * This includes: * - Update BgCheckInfo, parameters adjusted due to various state flags @@ -10804,7 +11393,7 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) { void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) { u8 seqMode; s32 pad; - Actor* unk_664; + Actor* focusActor; s32 camMode; if (this->actor.category == ACTORCAT_PLAYER) { @@ -10813,18 +11402,18 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) { if (this->csAction != PLAYER_CSACTION_NONE) { Camera_RequestMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_NORMAL); } else if (!(this->stateFlags1 & PLAYER_STATE1_20)) { - if ((this->actor.parent != NULL) && (this->stateFlags3 & PLAYER_STATE3_7)) { + if ((this->actor.parent != NULL) && (this->stateFlags3 & PLAYER_STATE3_FLYING_WITH_HOOKSHOT)) { camMode = CAM_MODE_HOOKSHOT_FLY; Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, this->actor.parent); } else if (Player_Action_8084377C == this->actionFunc) { camMode = CAM_MODE_STILL; } else if (this->stateFlags2 & PLAYER_STATE2_8) { camMode = CAM_MODE_PUSH_PULL; - } else if ((unk_664 = this->unk_664) != NULL) { + } else if ((focusActor = this->focusActor) != NULL) { if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_TALK)) { camMode = CAM_MODE_TALK; - } else if (this->stateFlags1 & PLAYER_STATE1_16) { - if (this->stateFlags1 & PLAYER_STATE1_25) { + } else if (this->stateFlags1 & PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS) { + if (this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN) { camMode = CAM_MODE_FOLLOW_BOOMERANG; } else { camMode = CAM_MODE_Z_TARGET_FRIENDLY; @@ -10832,19 +11421,19 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) { } else { camMode = CAM_MODE_Z_TARGET_UNFRIENDLY; } - Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, unk_664); - } else if (this->stateFlags1 & PLAYER_STATE1_12) { + Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, focusActor); + } else if (this->stateFlags1 & PLAYER_STATE1_CHARGING_SPIN_ATTACK) { camMode = CAM_MODE_CHARGE; - } else if (this->stateFlags1 & PLAYER_STATE1_25) { + } else if (this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN) { camMode = CAM_MODE_FOLLOW_BOOMERANG; Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, this->boomerangActor); } else if (this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14)) { - if (func_80833B2C(this)) { + if (Player_FriendlyLockOnOrParallel(this)) { camMode = CAM_MODE_Z_LEDGE_HANG; } else { camMode = CAM_MODE_LEDGE_HANG; } - } else if (this->stateFlags1 & (PLAYER_STATE1_17 | PLAYER_STATE1_30)) { + } else if (this->stateFlags1 & (PLAYER_STATE1_PARALLEL | PLAYER_STATE1_LOCK_ON_FORCED_TO_RELEASE)) { if (func_8002DD78(this) || func_808334B4(this)) { camMode = CAM_MODE_Z_AIM; } else if (this->stateFlags1 & PLAYER_STATE1_21) { @@ -10878,9 +11467,9 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) { seqMode = SEQ_MODE_STILL; } - if (play->actorCtx.targetCtx.bgmEnemy != NULL) { + if (play->actorCtx.attention.bgmEnemy != NULL) { seqMode = SEQ_MODE_ENEMY; - Audio_SetBgmEnemyVolume(sqrtf(play->actorCtx.targetCtx.bgmEnemy->xyzDistToPlayerSq)); + Audio_SetBgmEnemyVolume(sqrtf(play->actorCtx.attention.bgmEnemy->xyzDistToPlayerSq)); } if (play->sceneId != SCENE_FISHING_POND) { @@ -10942,7 +11531,7 @@ void Player_UpdateBodyShock(PlayState* play, Player* this) { shockPos.z = (Rand_CenteredFloat(5.0f) + randBodyPart->z) - this->actor.world.pos.z; EffectSsFhgFlash_SpawnShock(play, &this->actor, &shockPos, shockScale, FHGFLASH_SHOCK_PLAYER); - func_8002F8F0(&this->actor, NA_SE_PL_SPARK - SFX_FLAG); + Actor_PlaySfx_Flagged2(&this->actor, NA_SE_PL_SPARK - SFX_FLAG); } } @@ -11142,8 +11731,8 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { this->unk_A73--; } - if (this->unk_88E != 0) { - this->unk_88E--; + if (this->textboxBtnCooldownTimer != 0) { + this->textboxBtnCooldownTimer--; } if (this->unk_A87 != 0) { @@ -11161,7 +11750,8 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { } Player_UpdateInterface(play, this); - func_80836BEC(this, play); + + Player_UpdateZTargeting(this, play); if ((this->heldItemAction == PLAYER_IA_DEKU_STICK) && (this->unk_860 != 0)) { Player_UpdateBurningDekuStick(play, this); @@ -11220,9 +11810,9 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { func_8083A360(play, this); this->stateFlags1 |= PLAYER_STATE1_23; Player_AnimPlayOnce(play, this, &gPlayerAnim_link_uma_wait_1); - Player_AnimReplaceApplyFlags(play, this, - ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_PLAYER_SETMOVE | - ANIM_FLAG_NO_MOVE | ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_StartAnimMovement(play, this, + ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_ADJUST_STARTING_POS | ANIM_FLAG_OVERRIDE_MOVEMENT); this->av2.actionVar2 = 99; } @@ -11247,7 +11837,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { func_8084FF7C(this); } - if (!(this->skelAnime.moveFlags & ANIM_FLAG_OVERRIDE_MOVEMENT)) { + if (!(this->skelAnime.movementFlags & ANIM_FLAG_OVERRIDE_MOVEMENT)) { if (((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (sFloorType == FLOOR_TYPE_5) && (this->currentBoots != PLAYER_BOOTS_IRON)) || ((this->currentBoots == PLAYER_BOOTS_HOVER) && @@ -11402,11 +11992,12 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { func_8083D6EC(play, this); - if ((this->unk_664 == NULL) && (this->naviTextId == 0)) { - this->stateFlags2 &= ~(PLAYER_STATE2_1 | PLAYER_STATE2_21); + if ((this->focusActor == NULL) && (this->naviTextId == 0)) { + this->stateFlags2 &= ~(PLAYER_STATE2_CAN_ACCEPT_TALK_OFFER | PLAYER_STATE2_21); } - this->stateFlags1 &= ~(PLAYER_STATE1_SWINGING_BOTTLE | PLAYER_STATE1_9 | PLAYER_STATE1_12 | PLAYER_STATE1_22); + this->stateFlags1 &= + ~(PLAYER_STATE1_SWINGING_BOTTLE | PLAYER_STATE1_9 | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_22); this->stateFlags2 &= ~(PLAYER_STATE2_0 | PLAYER_STATE2_2 | PLAYER_STATE2_3 | PLAYER_STATE2_5 | PLAYER_STATE2_6 | PLAYER_STATE2_8 | PLAYER_STATE2_FORCE_SAND_FLOOR_SOUND | PLAYER_STATE2_12 | PLAYER_STATE2_14 | PLAYER_STATE2_DO_ACTION_ENTER | PLAYER_STATE2_22 | PLAYER_STATE2_26); @@ -11416,14 +12007,15 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { Player_ProcessControlStick(play, this); if (this->stateFlags1 & PLAYER_STATE1_27) { - D_808535E8 = 0.5f; + sWaterSpeedFactor = 0.5f; } else { - D_808535E8 = 1.0f; + sWaterSpeedFactor = 1.0f; } - D_808535EC = 1.0f / D_808535E8; + sInvWaterSpeedFactor = 1.0f / sWaterSpeedFactor; + sUseHeldItem = sHeldItemButtonIsHeldDown = false; - D_80858AA4 = this->currentMask; + sSavedCurrentMask = this->currentMask; if (!(this->stateFlags3 & PLAYER_STATE3_2)) { this->actionFunc(this, play); @@ -11431,10 +12023,11 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { Player_UpdateCamAndSeqModes(play, this); - if (this->skelAnime.moveFlags & ANIM_FLAG_PLAYER_SETMOVE) { - AnimTaskQueue_AddActorMove(play, &this->actor, &this->skelAnime, - (this->skelAnime.moveFlags & ANIM_FLAG_PLAYER_2) ? 1.0f - : this->ageProperties->unk_08); + if (this->skelAnime.movementFlags & ANIM_FLAG_ENABLE_MOVEMENT) { + AnimTaskQueue_AddActorMovement(play, &this->actor, &this->skelAnime, + (this->skelAnime.movementFlags & ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT) + ? 1.0f + : this->ageProperties->unk_08); } Player_UpdateShapeYaw(this, play); @@ -11447,7 +12040,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { this->exchangeItemId = EXCH_ITEM_NONE; } - if (!(this->stateFlags1 & PLAYER_STATE1_11)) { + if (!(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR)) { this->interactRangeActor = NULL; this->getItemDirection = 0x6000; } @@ -11468,8 +12061,8 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { temp_f0 = this->actor.world.pos.y - this->actor.prevPos.y; this->doorType = PLAYER_DOORTYPE_NONE; - this->unk_8A1 = 0; - this->unk_684 = NULL; + this->knockbackType = PLAYER_KNOCKBACK_NONE; + this->autoLockOnActor = NULL; phi_f12 = ((this->bodyPartsPos[PLAYER_BODYPART_L_FOOT].y + this->bodyPartsPos[PLAYER_BODYPART_R_FOOT].y) * 0.5f) + @@ -11492,11 +12085,11 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { Collider_UpdateCylinder(&this->actor, &this->cylinder); if (!(this->stateFlags2 & PLAYER_STATE2_14)) { - if (!(this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_23))) { + if (!(this->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_23))) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->cylinder.base); } - if (!(this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_26)) && (this->invincibilityTimer <= 0)) { + if (!(this->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_26)) && (this->invincibilityTimer <= 0)) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->cylinder.base); if (this->invincibilityTimer < 0) { @@ -11513,7 +12106,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); Math_Vec3f_Copy(&this->unk_A88, &this->bodyPartsPos[PLAYER_BODYPART_WAIST]); - if (this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29)) { + if (this->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29)) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; } else { this->actor.colChkInfo.mass = 50; @@ -11580,7 +12173,9 @@ void Player_Update(Actor* thisx, PlayState* play) { } else { input = play->state.input[0]; - if (this->unk_88E != 0) { + if (this->textboxBtnCooldownTimer != 0) { + // Prevent the usage of A/B/C-up. + // Helps avoid accidental inputs when mashing to close the final textbox. input.cur.button &= ~(BTN_A | BTN_B | BTN_CUP); input.press.button &= ~(BTN_A | BTN_B | BTN_CUP); } @@ -11600,7 +12195,7 @@ skip_update:; } } -typedef struct { +typedef struct BunnyEarKinematics { /* 0x0 */ Vec3s rot; /* 0x6 */ Vec3s angVel; } BunnyEarKinematics; // size = 0xC @@ -11674,8 +12269,7 @@ void Player_DrawGameplay(PlayState* play, Player* this, s32 lod, Gfx* cullDList, this->actor.world.pos.z, &D_80854864); Matrix_Scale(4.0f, 4.0f, 4.0f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_player.c", 19317), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_player.c", 19317); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 16, 32, 1, 0, (play->gameplayFrames * -15) % 128, 16, 32)); @@ -11685,8 +12279,6 @@ void Player_DrawGameplay(PlayState* play, Player* this, s32 lod, Gfx* cullDList, } } - if (1) {} - CLOSE_DISPS(play->state.gfxCtx, "../z_player.c", 19328); } @@ -11701,8 +12293,8 @@ void Player_Draw(Actor* thisx, PlayState* play2) { s32 lod = 0; s32 pad; -#if (ENABLE_LINK_LOD) - if ((this->csAction != PLAYER_CSACTION_NONE) || (func_8008E9C4(this) && 0) || +#if ENABLE_LINK_LOD + if ((this->csAction != PLAYER_CSACTION_NONE) || (Player_CheckHostileLockOn(this) && 0) || (this->actor.projectedPos.z < 160.0f)) { lod = 0; } else { @@ -11714,9 +12306,9 @@ void Player_Draw(Actor* thisx, PlayState* play2) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); if (this->invincibilityTimer > 0) { - this->unk_88F += CLAMP(50 - this->invincibilityTimer, 8, 40); - POLY_OPA_DISP = - Gfx_SetFog2(POLY_OPA_DISP, 255, 0, 0, 0, 0, 4000 - (s32)(Math_CosS(this->unk_88F * 256) * 2000.0f)); + this->damageFlickerAnimCounter += CLAMP(50 - this->invincibilityTimer, 8, 40); + POLY_OPA_DISP = Gfx_SetFog2(POLY_OPA_DISP, 255, 0, 0, 0, 0, + 4000 - (s32)(Math_CosS(this->damageFlickerAnimCounter * 256) * 2000.0f)); } func_8002EBCC(&this->actor, play, 0); @@ -11775,8 +12367,7 @@ void Player_Draw(Actor* thisx, PlayState* play2) { 32, 1, 0, (play->gameplayFrames * -2) % 128, 32, 32)); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_player.c", 19459), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_player.c", 19459); gDPSetEnvColor(POLY_XLU_DISP++, 0, 50, 100, 255); gSPDisplayList(POLY_XLU_DISP++, gEffIceFragment3DL); } @@ -11809,7 +12400,7 @@ s16 func_8084ABD8(PlayState* play, Player* this, s32 arg2, s16 arg3) { s16 temp2; s16 temp3; - if (!func_8002DD78(this) && !func_808334B4(this) && (arg2 == 0)) { + if (!func_8002DD78(this) && !func_808334B4(this) && !arg2) { temp2 = sControlInput->rel.stick_y * 240.0f; Math_SmoothStepToS(&this->actor.focus.rot.x, temp2, 14, 4000, 30); @@ -11831,7 +12422,7 @@ s16 func_8084ABD8(PlayState* play, Player* this, s32 arg2, s16 arg3) { this->actor.focus.rot.y = CLAMP(temp2, -temp1, temp1) + this->actor.shape.rot.y; } - this->unk_6AE |= 2; + this->unk_6AE_rotFlags |= UNK6AE_ROT_FOCUS_Y; return func_80836AB8(this, (play->shootingGalleryStatus != 0) || func_8002DD78(this) || func_808334B4(this)) - arg3; } @@ -11863,7 +12454,7 @@ void func_8084B000(Player* this) { f32 phi_f14; f32 depthInWater; - phi_f14 = -5.0f; + phi_f14 = FRAMERATE_CONST(-5.0f, -6.0f); phi_f16 = this->ageProperties->unk_28; if (this->actor.velocity.y < 0.0f) { @@ -11878,11 +12469,11 @@ void func_8084B000(Player* this) { } phi_f18 = -0.1f - phi_f16; } else { - if (!(this->stateFlags1 & PLAYER_STATE1_7) && (this->currentBoots == PLAYER_BOOTS_IRON) && - (this->actor.velocity.y >= -3.0f)) { + if (!(this->stateFlags1 & PLAYER_STATE1_DEAD) && (this->currentBoots == PLAYER_BOOTS_IRON) && + (this->actor.velocity.y >= FRAMERATE_CONST(-3.0f, -3.6f))) { phi_f18 = -0.2f; } else { - phi_f14 = 2.0f; + phi_f14 = FRAMERATE_CONST(2.0f, 2.4f); if (this->actor.velocity.y >= 0.0f) { phi_f16 = 0.0f; } else { @@ -11908,17 +12499,19 @@ void func_8084B000(Player* this) { void func_8084B158(PlayState* play, Player* this, Input* input, f32 arg3) { f32 temp; + f32 limit; if ((input != NULL) && CHECK_BTN_ANY(input->press.button, BTN_A | BTN_B)) { - temp = 1.0f; + temp = limit = FRAMERATE_CONST(1.0f, 1.2f); } else { - temp = 0.5f; + temp = FRAMERATE_CONST(0.5f, 0.6f); + limit = FRAMERATE_CONST(1.0f, 1.2f); } temp *= arg3; - if (temp < 1.0f) { - temp = 1.0f; + if (temp < limit) { + temp = limit; } this->skelAnime.playSpeed = temp; @@ -11930,7 +12523,7 @@ void Player_Action_8084B1D8(Player* this, PlayState* play) { func_8084B000(this); func_8084AEEC(this, &this->speedXZ, 0, this->actor.shape.rot.y); } else { - func_8083721C(this); + Player_DecelerateToZero(this); } if ((this->unk_6AD == 2) && (func_8002DD6C(this) || func_808332E4(this))) { @@ -11938,19 +12531,21 @@ void Player_Action_8084B1D8(Player* this, PlayState* play) { } if ((this->csAction != PLAYER_CSACTION_NONE) || (this->unk_6AD == 0) || (this->unk_6AD >= 4) || - func_80833B54(this) || (this->unk_664 != NULL) || (func_8083AD4C(play, this) == CAM_MODE_NORMAL) || - (((this->unk_6AD == 2) && (CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_R) || - func_80833B2C(this) || (!func_8002DD78(this) && !func_808334B4(this)))) || + Player_UpdateHostileLockOn(this) || (this->focusActor != NULL) || + (func_8083AD4C(play, this) == CAM_MODE_NORMAL) || + (((this->unk_6AD == 2) && + (CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_R) || Player_FriendlyLockOnOrParallel(this) || + (!func_8002DD78(this) && !func_808334B4(this)))) || ((this->unk_6AD == 1) && CHECK_BTN_ANY(sControlInput->press.button, - BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)))) { + BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT)))) { func_8083C148(this, play); Sfx_PlaySfxCentered(NA_SE_SY_CAMERA_ZOOM_UP); } else if ((DECR(this->av2.actionVar2) == 0) || (this->unk_6AD != 2)) { if (func_8008F128(this)) { - this->unk_6AE |= 0x43; + this->unk_6AE_rotFlags |= UNK6AE_ROT_FOCUS_X | UNK6AE_ROT_FOCUS_Y | UNK6AE_ROT_UPPER_X; } else { - this->actor.shape.rot.y = func_8084ABD8(play, this, 0, 0); + this->actor.shape.rot.y = func_8084ABD8(play, this, false, 0); } } @@ -11967,7 +12562,7 @@ s32 func_8084B3CC(PlayState* play, Player* this) { } this->stateFlags1 |= PLAYER_STATE1_20; - Player_AnimPlayOnce(play, this, func_80833338(this)); + Player_AnimPlayOnce(play, this, Player_GetIdleAnim(this)); Player_ZeroSpeedXZ(this); func_8083B010(this); return 1; @@ -11986,28 +12581,29 @@ s32 func_8084B4D4(PlayState* play, Player* this) { this->stateFlags3 &= ~PLAYER_STATE3_5; func_8084B498(this); this->unk_6AD = 4; - Player_ActionChange_13(this, play); + Player_ActionHandler_13(this, play); return 1; } return 0; } -void Player_Action_8084B530(Player* this, PlayState* play) { +void Player_Action_Talk(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_5; + Player_UpdateUpperBody(this, play); if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { this->actor.flags &= ~ACTOR_FLAG_TALK; - if (!CHECK_FLAG_ALL(this->talkActor->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2)) { - this->stateFlags2 &= ~PLAYER_STATE2_13; + if (!CHECK_FLAG_ALL(this->talkActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) { + this->stateFlags2 &= ~PLAYER_STATE2_LOCK_ON_WITH_SWITCH; } Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN)); if (!func_8084B4D4(play, this) && !func_8084B3CC(play, this) && !Player_StartCsAction(play, this)) { - if ((this->talkActor != this->interactRangeActor) || !Player_ActionChange_2(this, play)) { + if ((this->talkActor != this->interactRangeActor) || !Player_ActionHandler_2(this, play)) { if (this->stateFlags1 & PLAYER_STATE1_23) { s32 sp24 = this->av2.actionVar2; func_8083A360(play, this); @@ -12020,7 +12616,7 @@ void Player_Action_8084B530(Player* this, PlayState* play) { } } - this->unk_88E = 10; + this->textboxBtnCooldownTimer = 10; return; } @@ -12028,21 +12624,22 @@ void Player_Action_8084B530(Player* this, PlayState* play) { Player_Action_8084CC98(this, play); } else if (func_808332B8(this)) { Player_Action_8084D610(this, play); - } else if (!func_8008E9C4(this) && LinkAnimation_Update(play, &this->skelAnime)) { - if (this->skelAnime.moveFlags != 0) { - func_80832DBC(this); + } else if (!Player_CheckHostileLockOn(this) && LinkAnimation_Update(play, &this->skelAnime)) { + if (this->skelAnime.movementFlags != 0) { + Player_FinishAnimMovement(this); + if ((this->talkActor->category == ACTORCAT_NPC) && (this->heldItemAction != PLAYER_IA_FISHING_POLE)) { Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_normal_talk_free); } else { - Player_AnimPlayLoop(play, this, func_80833338(this)); + Player_AnimPlayLoop(play, this, Player_GetIdleAnim(this)); } } else { Player_AnimPlayLoopAdjusted(play, this, &gPlayerAnim_link_normal_talk_free_wait); } } - if (this->unk_664 != NULL) { - this->yaw = this->actor.shape.rot.y = func_8083DB98(this, 0); + if (this->focusActor != NULL) { + this->yaw = this->actor.shape.rot.y = func_8083DB98(this, false); } } @@ -12078,8 +12675,8 @@ void func_8084B840(PlayState* play, Player* this, f32 arg2) { } static AnimSfxEntry D_80854870[] = { - { NA_SE_PL_SLIP, ANIMSFX_DATA(ANIMSFX_TYPE_2, 3) }, - { NA_SE_PL_SLIP, -ANIMSFX_DATA(ANIMSFX_TYPE_2, 21) }, + { NA_SE_PL_SLIP, ANIMSFX_DATA(ANIMSFX_TYPE_FLOOR, 3) }, + { NA_SE_PL_SLIP, -ANIMSFX_DATA(ANIMSFX_TYPE_FLOOR, 21) }, }; void Player_Action_8084B898(Player* this, PlayState* play) { @@ -12089,7 +12686,7 @@ void Player_Action_8084B898(Player* this, PlayState* play) { this->av2.actionVar2 = 1; } else if (this->av2.actionVar2 == 0) { if (LinkAnimation_OnFrame(&this->skelAnime, 11.0f)) { - func_80832698(this, NA_SE_VO_LI_PUSH); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_PUSH); } } @@ -12119,8 +12716,8 @@ void Player_Action_8084B898(Player* this, PlayState* play) { } static AnimSfxEntry D_80854878[] = { - { NA_SE_PL_SLIP, ANIMSFX_DATA(ANIMSFX_TYPE_2, 4) }, - { NA_SE_PL_SLIP, -ANIMSFX_DATA(ANIMSFX_TYPE_2, 24) }, + { NA_SE_PL_SLIP, ANIMSFX_DATA(ANIMSFX_TYPE_FLOOR, 4) }, + { NA_SE_PL_SLIP, -ANIMSFX_DATA(ANIMSFX_TYPE_FLOOR, 24) }, }; static Vec3f D_80854880 = { 0.0f, 26.0f, -40.0f }; @@ -12135,7 +12732,7 @@ void Player_Action_8084B9E4(Player* this, PlayState* play) { } else { if (this->av2.actionVar2 == 0) { if (LinkAnimation_OnFrame(&this->skelAnime, 11.0f)) { - func_80832698(this, NA_SE_VO_LI_PUSH); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_PUSH); } if (!IS_DEBUG) {} } else { @@ -12203,7 +12800,7 @@ void Player_Action_8084BBE4(Player* this, PlayState* play) { } if (LinkAnimation_OnFrame(&this->skelAnime, temp)) { - func_80832770(this, NA_SE_PL_WALK_GROUND); + Player_PlayFloorSfx(this, NA_SE_PL_WALK_GROUND); if (this->skelAnime.animation == &gPlayerAnim_link_normal_fall) { this->av1.actionVar1 = 1; } else { @@ -12243,17 +12840,17 @@ void Player_Action_8084BDFC(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_6; if (LinkAnimation_Update(play, &this->skelAnime)) { - func_80832E48(this, ANIM_FLAG_UPDATE_XZ); + Player_ApplyAnimMovementScaledByAge(this, ANIM_FLAG_UPDATE_XZ); func_8083C0E8(this, play); return; } if (LinkAnimation_OnFrame(&this->skelAnime, this->skelAnime.endFrame - 6.0f)) { - func_808328A0(this); + Player_PlayLandingSfx(this); } else if (LinkAnimation_OnFrame(&this->skelAnime, this->skelAnime.endFrame - 34.0f)) { this->stateFlags1 &= ~(PLAYER_STATE1_13 | PLAYER_STATE1_14); Player_PlaySfx(this, NA_SE_PL_CLIMB_CLIFF); - func_80832698(this, NA_SE_VO_LI_CLIMB_END); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_CLIMB_END); } } @@ -12411,9 +13008,9 @@ static f32 D_80854898[] = { 10.0f, 20.0f }; static f32 D_808548A0[] = { 40.0f, 50.0f }; static AnimSfxEntry D_808548A8[] = { - { NA_SE_PL_WALK_GROUND + SURFACE_SFX_OFFSET_WOOD, ANIMSFX_DATA(ANIMSFX_TYPE_1, 10) }, - { NA_SE_PL_WALK_GROUND + SURFACE_SFX_OFFSET_WOOD, ANIMSFX_DATA(ANIMSFX_TYPE_1, 20) }, - { NA_SE_PL_WALK_GROUND + SURFACE_SFX_OFFSET_WOOD, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 30) }, + { NA_SE_PL_WALK_GROUND + SURFACE_SFX_OFFSET_WOOD, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 10) }, + { NA_SE_PL_WALK_GROUND + SURFACE_SFX_OFFSET_WOOD, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 20) }, + { NA_SE_PL_WALK_GROUND + SURFACE_SFX_OFFSET_WOOD, -ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 30) }, }; void Player_Action_8084C5F8(Player* this, PlayState* play) { @@ -12454,17 +13051,17 @@ void Player_Action_8084C5F8(Player* this, PlayState* play) { // Most material and sfxOffsets share identical enum values, // so this will mostly result in the correct sfx played, but not in all cases, such as carpet and ice. this->floorSfxOffset = SurfaceType_GetMaterial(&play->colCtx, groundPoly, bgId); - func_808328A0(this); + Player_PlayLandingSfx(this); } } } static AnimSfxEntry D_808548B4[] = { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 40) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 48) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 56) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 64) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 72) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 80) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 88) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 96) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_6, 104) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 40) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 48) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 56) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 64) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 72) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 80) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 88) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 96) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 104) }, }; /** @@ -12477,8 +13074,8 @@ void Player_Action_8084C760(Player* this, PlayState* play) { if (LinkAnimation_Update(play, &this->skelAnime)) { if (!(this->stateFlags1 & PLAYER_STATE1_0)) { // While inside a crawlspace, player's skeleton does not move - if (this->skelAnime.moveFlags != 0) { - this->skelAnime.moveFlags = 0; + if (this->skelAnime.movementFlags != 0) { + this->skelAnime.movementFlags = 0; return; } @@ -12495,11 +13092,11 @@ void Player_Action_8084C760(Player* this, PlayState* play) { } static AnimSfxEntry D_808548D8[] = { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 10) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 18) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 26) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 34) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 52) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 60) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 68) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 76) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_6, 84) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 10) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 18) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 26) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 34) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 52) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 60) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 68) }, { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 76) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 84) }, }; /** @@ -12578,7 +13175,7 @@ s32 func_8084C9BC(Player* this, PlayState* play) { if (EN_HORSE_CHECK_1(rideActor) || (EN_HORSE_CHECK_4(rideActor) && CHECK_BTN_ALL(sControlInput->press.button, BTN_A))) { rideActor->actor.child = NULL; - func_80835DAC(play, this, Player_Action_8084D3E4, 0); + Player_SetupActionPreserveAnimMovement(play, this, Player_Action_8084D3E4, 0); this->unk_878 = sp34 - rideActor->actor.world.pos.y; Player_AnimPlayOnce(play, this, (this->mountSide < 0) ? &gPlayerAnim_link_uma_left_down @@ -12649,10 +13246,14 @@ static u8 D_80854998[2][2] = { static Vec3s D_8085499C = { -69, 7146, -266 }; static AnimSfxEntry D_808549A4[] = { - { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_1, 48) }, { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_1, 58) }, - { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_1, 68) }, { NA_SE_PL_CALM_PAT, ANIMSFX_DATA(ANIMSFX_TYPE_1, 92) }, - { NA_SE_PL_CALM_PAT, ANIMSFX_DATA(ANIMSFX_TYPE_1, 110) }, { NA_SE_PL_CALM_PAT, ANIMSFX_DATA(ANIMSFX_TYPE_1, 126) }, - { NA_SE_PL_CALM_PAT, ANIMSFX_DATA(ANIMSFX_TYPE_1, 132) }, { NA_SE_PL_CALM_PAT, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 136) }, + { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 48) }, + { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 58) }, + { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 68) }, + { NA_SE_PL_CALM_PAT, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 92) }, + { NA_SE_PL_CALM_PAT, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 110) }, + { NA_SE_PL_CALM_PAT, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 126) }, + { NA_SE_PL_CALM_PAT, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 132) }, + { NA_SE_PL_CALM_PAT, -ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 136) }, }; void Player_Action_8084CC98(Player* this, PlayState* play) { @@ -12714,7 +13315,7 @@ void Player_Action_8084CC98(Player* this, PlayState* play) { } if (this->av2.actionVar2 == 1) { - if (sUpperBodyIsBusy || func_8083224C(play)) { + if (sUpperBodyIsBusy || Player_IsTalking(play)) { Player_AnimPlayOnce(play, this, &gPlayerAnim_link_uma_wait_3); } else if (LinkAnimation_Update(play, &this->skelAnime)) { this->av2.actionVar2 = 99; @@ -12749,8 +13350,8 @@ void Player_Action_8084CC98(Player* this, PlayState* play) { this->yaw = this->actor.shape.rot.y = rideActor->actor.shape.rot.y; if ((this->csAction != PLAYER_CSACTION_NONE) || - (!func_8083224C(play) && ((rideActor->actor.speed != 0.0f) || !Player_ActionChange_4(this, play)) && - !Player_ActionChange_6(this, play))) { + (!Player_IsTalking(play) && ((rideActor->actor.speed != 0.0f) || !Player_ActionHandler_Talk(this, play)) && + !Player_ActionHandler_Roll(this, play))) { if (!sUpperBodyIsBusy) { if (this->av1.actionVar1 != 0) { if (LinkAnimation_Update(play, &this->upperSkelAnime)) { @@ -12761,7 +13362,7 @@ void Player_Action_8084CC98(Player* this, PlayState* play) { if (this->upperSkelAnime.animation == &gPlayerAnim_link_uma_stop_muti) { if (LinkAnimation_OnFrame(&this->upperSkelAnime, 23.0f)) { Player_PlaySfx(this, NA_SE_IT_LASH); - func_80832698(this, NA_SE_VO_LI_LASH); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_LASH); } AnimTaskQueue_AddCopy(play, this->skelAnime.limbCount, this->skelAnime.jointTable, @@ -12769,7 +13370,7 @@ void Player_Action_8084CC98(Player* this, PlayState* play) { } else { if (LinkAnimation_OnFrame(&this->upperSkelAnime, 10.0f)) { Player_PlaySfx(this, NA_SE_IT_LASH); - func_80832698(this, NA_SE_VO_LI_LASH); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_LASH); } AnimTaskQueue_AddCopyUsingMap(play, this->skelAnime.limbCount, this->skelAnime.jointTable, @@ -12795,34 +13396,34 @@ void Player_Action_8084CC98(Player* this, PlayState* play) { if (this->stateFlags1 & PLAYER_STATE1_20) { if ((func_8083AD4C(play, this) == CAM_MODE_NORMAL) || CHECK_BTN_ANY(sControlInput->press.button, BTN_A) || - func_80833BCC(this)) { + Player_IsZTargeting(this)) { this->unk_6AD = 0; this->stateFlags1 &= ~PLAYER_STATE1_20; } else { - this->unk_6BE = func_8084ABD8(play, this, 1, -5000) - this->actor.shape.rot.y; - this->unk_6BE += 5000; - this->unk_6B0 = -5000; + this->upperLimbRot.y = func_8084ABD8(play, this, true, -5000) - this->actor.shape.rot.y; + this->upperLimbRot.y += 5000; + this->upperLimbYawSecondary = -5000; } return; } if ((this->csAction != PLAYER_CSACTION_NONE) || - (!func_8084C9BC(this, play) && !Player_ActionChange_13(this, play))) { - if (this->unk_664 != NULL) { - if (func_8002DD78(this) != 0) { - this->unk_6BE = func_8083DB98(this, 1) - this->actor.shape.rot.y; - this->unk_6BE = CLAMP(this->unk_6BE, -0x4AAA, 0x4AAA); - this->actor.focus.rot.y = this->actor.shape.rot.y + this->unk_6BE; - this->unk_6BE += 5000; - this->unk_6AE |= 0x80; + (!func_8084C9BC(this, play) && !Player_ActionHandler_13(this, play))) { + if (this->focusActor != NULL) { + if (func_8002DD78(this)) { + this->upperLimbRot.y = func_8083DB98(this, true) - this->actor.shape.rot.y; + this->upperLimbRot.y = CLAMP(this->upperLimbRot.y, -0x4AAA, 0x4AAA); + this->actor.focus.rot.y = this->actor.shape.rot.y + this->upperLimbRot.y; + this->upperLimbRot.y += 5000; + this->unk_6AE_rotFlags |= UNK6AE_ROT_UPPER_Y; } else { - func_8083DB98(this, 0); + func_8083DB98(this, false); } } else { - if (func_8002DD78(this) != 0) { - this->unk_6BE = func_8084ABD8(play, this, 1, -5000) - this->actor.shape.rot.y; - this->unk_6BE += 5000; - this->unk_6B0 = -5000; + if (func_8002DD78(this)) { + this->upperLimbRot.y = func_8084ABD8(play, this, true, -5000) - this->actor.shape.rot.y; + this->upperLimbRot.y += 5000; + this->upperLimbYawSecondary = -5000; } } } @@ -12830,9 +13431,9 @@ void Player_Action_8084CC98(Player* this, PlayState* play) { } static AnimSfxEntry D_808549C4[] = { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_5, 0) }, - { NA_SE_PL_GET_OFF_HORSE, ANIMSFX_DATA(ANIMSFX_TYPE_1, 10) }, - { NA_SE_PL_SLIPDOWN, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 25) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_LANDING, 0) }, + { NA_SE_PL_GET_OFF_HORSE, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 10) }, + { NA_SE_PL_SLIPDOWN, -ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 25) }, }; void Player_Action_8084D3E4(Player* this, PlayState* play) { @@ -12857,16 +13458,16 @@ void Player_Action_8084D3E4(Player* this, PlayState* play) { Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_NORMAL0); if (this->mountSide < 0) { - D_808549C4[0].data = ANIMSFX_DATA(ANIMSFX_TYPE_5, 40); + D_808549C4[0].data = ANIMSFX_DATA(ANIMSFX_TYPE_LANDING, 40); } else { - D_808549C4[0].data = ANIMSFX_DATA(ANIMSFX_TYPE_5, 29); + D_808549C4[0].data = ANIMSFX_DATA(ANIMSFX_TYPE_LANDING, 29); } Player_ProcessAnimSfxList(this, D_808549C4); } } static AnimSfxEntry D_808549D0[] = { - { NA_SE_PL_SWIM, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 0) }, + { NA_SE_PL_SWIM, -ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 0) }, }; void func_8084D530(Player* this, f32* arg1, f32 arg2, s16 arg3) { @@ -12889,7 +13490,7 @@ void Player_Action_8084D610(Player* this, PlayState* play) { func_80832CB0(play, this, &gPlayerAnim_link_swimer_swim_wait); func_8084B000(this); - if (!func_8083224C(play) && !Player_TryActionChangeList(play, this, sActionChangeList11, true) && + if (!Player_IsTalking(play) && !Player_TryActionHandlerList(play, this, sActionHandlerList11, true) && !func_8083D12C(play, this, sControlInput)) { f32 speedTarget; s16 yawTarget; @@ -12904,7 +13505,7 @@ void Player_Action_8084D610(Player* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_8083A098(this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_short_landing, this->modelAnimType), play); - func_808328A0(this); + Player_PlayLandingSfx(this); } } else { Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); @@ -12916,7 +13517,7 @@ void Player_Action_8084D610(Player* this, PlayState* play) { return; } - if (func_80833C04(this)) { + if (Player_IsZTargetingWithHostileUpdate(this)) { func_8084D5CC(play, this); } else { func_8084D574(play, this, yawTarget); @@ -12929,7 +13530,7 @@ void Player_Action_8084D610(Player* this, PlayState* play) { } void Player_Action_8084D7C4(Player* this, PlayState* play) { - if (!Player_ActionChange_13(this, play)) { + if (!Player_ActionHandler_13(this, play)) { this->stateFlags2 |= PLAYER_STATE2_5; func_8084B158(play, this, NULL, this->speedXZ); @@ -12951,14 +13552,14 @@ void Player_Action_8084D84C(Player* this, PlayState* play) { func_8084B158(play, this, sControlInput, this->speedXZ); func_8084B000(this); - if (!Player_TryActionChangeList(play, this, sActionChangeList11, true) && + if (!Player_TryActionHandlerList(play, this, sActionHandlerList11, true) && !func_8083D12C(play, this, sControlInput)) { Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); temp = this->actor.shape.rot.y - yawTarget; if ((speedTarget == 0.0f) || (ABS(temp) > 0x6000) || (this->currentBoots == PLAYER_BOOTS_IRON)) { func_80838F18(play, this); - } else if (func_80833C04(this)) { + } else if (Player_IsZTargetingWithHostileUpdate(this)) { func_8084D5CC(play, this); } @@ -13011,13 +13612,13 @@ void Player_Action_8084DAB4(Player* this, PlayState* play) { func_8084B158(play, this, sControlInput, this->speedXZ); func_8084B000(this); - if (!Player_TryActionChangeList(play, this, sActionChangeList11, true) && + if (!Player_TryActionHandlerList(play, this, sActionHandlerList11, true) && !func_8083D12C(play, this, sControlInput)) { Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); if (speedTarget == 0.0f) { func_80838F18(play, this); - } else if (!func_80833C04(this)) { + } else if (!Player_IsZTargetingWithHostileUpdate(this)) { func_8084D574(play, this, yawTarget); } else { func_8084D980(play, this, &speedTarget, &yawTarget); @@ -13043,7 +13644,7 @@ void Player_Action_8084DC48(Player* this, PlayState* play) { this->actor.gravity = 0.0f; Player_UpdateUpperBody(this, play); - if (!Player_ActionChange_13(this, play)) { + if (!Player_ActionHandler_13(this, play)) { if (this->currentBoots == PLAYER_BOOTS_IRON) { func_80838F18(play, this); return; @@ -13058,14 +13659,14 @@ void Player_Action_8084DC48(Player* this, PlayState* play) { this->actor.velocity.y = -2.0f; } - func_8083721C(this); + Player_DecelerateToZero(this); return; } func_8084B158(play, this, sControlInput, this->actor.velocity.y); this->unk_6C2 = 16000; - if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A) && !Player_ActionChange_2(this, play) && + if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A) && !Player_ActionHandler_2(this, play) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.depthInWater < D_80854784[CUR_UPG_VALUE(UPG_SCALE)])) { func_8084DBC4(play, this, -2.0f); @@ -13085,7 +13686,7 @@ void Player_Action_8084DC48(Player* this, PlayState* play) { } else if (!func_8083D12C(play, this, sControlInput)) { sp2C = (this->av2.actionVar2 * 0.018f) + 4.0f; - if (this->stateFlags1 & PLAYER_STATE1_11) { + if (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) { sControlInput = NULL; } @@ -13103,14 +13704,14 @@ void Player_Action_8084DC48(Player* this, PlayState* play) { void func_8084DF6C(PlayState* play, Player* this) { this->unk_862 = 0; - this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11); + this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_CARRYING_ACTOR); this->getItemId = GI_NONE; Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN)); } void func_8084DFAC(PlayState* play, Player* this) { func_8084DF6C(play, this); - func_808322FC(this); + Player_ApplyYawFromAnim(this); func_8083C0E8(this, play); this->yaw = this->actor.shape.rot.y; } @@ -13179,7 +13780,7 @@ void Player_Action_8084E1EC(Player* this, PlayState* play) { func_80832340(play, this); func_80835EA4(play, 8); } else if (LinkAnimation_OnFrame(&this->skelAnime, 5.0f)) { - func_80832698(this, NA_SE_VO_LI_BREATH_DRINK); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_BREATH_DRINK); } } @@ -13236,12 +13837,12 @@ void Player_Action_8084E3C4(Player* this, PlayState* play) { Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN)); if ((this->talkActor != NULL) && (this->talkActor == this->unk_6A8)) { - func_80853148(play, this->talkActor); + Player_StartTalking(play, this->talkActor); } else if (this->naviTextId < 0) { this->talkActor = this->naviActor; this->naviActor->textId = -this->naviTextId; - func_80853148(play, this->talkActor); - } else if (!Player_ActionChange_13(this, play)) { + Player_StartTalking(play, this->talkActor); + } else if (!Player_ActionHandler_13(this, play)) { func_8083A098(this, &gPlayerAnim_link_normal_okarina_end, play); } @@ -13281,17 +13882,17 @@ void Player_Action_8084E604(Player* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ARROW, this->bodyPartsPos[PLAYER_BODYPART_R_HAND].x, this->bodyPartsPos[PLAYER_BODYPART_R_HAND].y, this->bodyPartsPos[PLAYER_BODYPART_R_HAND].z, 4000, this->actor.shape.rot.y, 0, ARROW_NUT); - func_80832698(this, NA_SE_VO_LI_SWORD_N); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_SWORD_N); } - func_8083721C(this); + Player_DecelerateToZero(this); } static AnimSfxEntry D_808549E0[] = { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_7, 87) }, - { NA_SE_VO_LI_CLIMB_END, ANIMSFX_DATA(ANIMSFX_TYPE_4, 87) }, - { NA_SE_VO_LI_AUTO_JUMP, ANIMSFX_DATA(ANIMSFX_TYPE_4, 69) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_5, 123) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_JUMPING, 87) }, + { NA_SE_VO_LI_CLIMB_END, ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 87) }, + { NA_SE_VO_LI_AUTO_JUMP, ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 69) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_LANDING, 123) }, }; void Player_Action_8084E6D4(Player* this, PlayState* play) { @@ -13313,7 +13914,7 @@ void Player_Action_8084E6D4(Player* this, PlayState* play) { this->exchangeItemId = EXCH_ITEM_NONE; if (func_8084B4D4(play, this) == 0) { - func_80853148(play, this->talkActor); + Player_StartTalking(play, this->talkActor); } } else { func_8084DFAC(play, this); @@ -13321,10 +13922,10 @@ void Player_Action_8084E6D4(Player* this, PlayState* play) { } } } else { - func_80832DBC(this); + Player_FinishAnimMovement(this); if (this->getItemId == GI_ICE_TRAP) { - this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11); + this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_CARRYING_ACTOR); if (this->getItemId != GI_ICE_TRAP) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, @@ -13332,7 +13933,7 @@ void Player_Action_8084E6D4(Player* this, PlayState* play) { func_8083C0E8(this, play); } else { this->actor.colChkInfo.damage = 0; - func_80837C0C(play, this, 3, 0.0f, 0.0f, 0, 20); + func_80837C0C(play, this, PLAYER_HIT_RESPONSE_ICE_TRAP, 0.0f, 0.0f, 0, 20); } return; } @@ -13365,17 +13966,19 @@ void Player_Action_8084E6D4(Player* this, PlayState* play) { } static AnimSfxEntry D_808549F0[] = { - { NA_SE_IT_MASTER_SWORD_SWING, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 60) }, + { NA_SE_IT_MASTER_SWORD_SWING, -ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 60) }, }; void func_8084E988(Player* this) { Player_ProcessAnimSfxList(this, D_808549F0); } +#if OOT_VERSION >= PAL_1_0 static AnimSfxEntry D_808549F4[] = { - { NA_SE_VO_LI_AUTO_JUMP, ANIMSFX_DATA(ANIMSFX_TYPE_4, 5) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_5, 15) }, + { NA_SE_VO_LI_AUTO_JUMP, ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 5) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_LANDING, 15) }, }; +#endif void Player_Action_8084E9AC(Player* this, PlayState* play) { if (LinkAnimation_Update(play, &this->skelAnime)) { @@ -13389,15 +13992,23 @@ void Player_Action_8084E9AC(Player* this, PlayState* play) { } } else { if (LINK_IS_ADULT && LinkAnimation_OnFrame(&this->skelAnime, 158.0f)) { - func_80832698(this, NA_SE_VO_LI_SWORD_N); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_SWORD_N); return; } +#if OOT_VERSION < PAL_1_0 + if (!LINK_IS_ADULT && LinkAnimation_OnFrame(&this->skelAnime, 5.0f)) { + Player_PlayVoiceSfx(this, NA_SE_VO_LI_AUTO_JUMP); + } else if (LINK_IS_ADULT) { + func_8084E988(this); + } +#else if (!LINK_IS_ADULT) { Player_ProcessAnimSfxList(this, D_808549F4); } else { func_8084E988(this); } +#endif } } @@ -13452,72 +14063,89 @@ void Player_Action_8084EAC0(Player* this, PlayState* play) { this->av2.actionVar2 = 2; Player_UpdateBottleHeld(play, this, ITEM_BOTTLE_EMPTY, PLAYER_IA_BOTTLE); } - func_80832698(this, NA_SE_VO_LI_DRINK - SFX_FLAG); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_DRINK - SFX_FLAG); } else if ((this->av2.actionVar2 == 2) && LinkAnimation_OnFrame(&this->skelAnime, 29.0f)) { - func_80832698(this, NA_SE_VO_LI_BREATH_DRINK); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_BREATH_DRINK); } } -static BottleCatchInfo sBottleCatchInfos[] = { - { ACTOR_EN_ELF, ITEM_BOTTLE_FAIRY, PLAYER_IA_BOTTLE_FAIRY, 0x46 }, - { ACTOR_EN_FISH, ITEM_BOTTLE_FISH, PLAYER_IA_BOTTLE_FISH, 0x47 }, - { ACTOR_EN_ICE_HONO, ITEM_BOTTLE_BLUE_FIRE, PLAYER_IA_BOTTLE_FIRE, 0x5D }, - { ACTOR_EN_INSECT, ITEM_BOTTLE_BUG, PLAYER_IA_BOTTLE_BUG, 0x7A }, +typedef enum BottleCatchType { + BOTTLE_CATCH_NONE, // This type does not have an associated entry in `sBottleCatchInfo` + BOTTLE_CATCH_FAIRY, + BOTTLE_CATCH_FISH, + BOTTLE_CATCH_BLUE_FIRE, + BOTTLE_CATCH_BUGS +} BottleCatchType; + +typedef struct BottleCatchInfo { + /* 0x00 */ s16 actorId; + /* 0x02 */ u8 itemId; + /* 0x03 */ u8 itemAction; + /* 0x04 */ u8 textId; +} BottleCatchInfo; // size = 0x06 + +static BottleCatchInfo sBottleCatchInfo[] = { + { ACTOR_EN_ELF, ITEM_BOTTLE_FAIRY, PLAYER_IA_BOTTLE_FAIRY, 0x46 }, // BOTTLE_CATCH_FAIRY + { ACTOR_EN_FISH, ITEM_BOTTLE_FISH, PLAYER_IA_BOTTLE_FISH, 0x47 }, // BOTTLE_CATCH_FISH + { ACTOR_EN_ICE_HONO, ITEM_BOTTLE_BLUE_FIRE, PLAYER_IA_BOTTLE_FIRE, 0x5D }, // BOTTLE_CATCH_BLUE_FIRE + { ACTOR_EN_INSECT, ITEM_BOTTLE_BUG, PLAYER_IA_BOTTLE_BUG, 0x7A }, // BOTTLE_CATCH_BUGS }; -void Player_Action_8084ECA4(Player* this, PlayState* play) { - struct_80854554* sp24; - BottleCatchInfo* catchInfo; - s32 temp; - s32 i; +void Player_Action_SwingBottle(Player* this, PlayState* play) { + // Action Variable 2 has two separate uses within the same action. + // After it is used as `inWater` here, it will be used for `startedTextbox` below. + // The two usages will never overlap, so this won't cause any issues. + BottleSwingInfo* swingEntry = &sBottleSwingInfo[this->av2.inWater]; - sp24 = &D_80854554[this->av2.actionVar2]; - func_8083721C(this); + Player_DecelerateToZero(this); if (LinkAnimation_Update(play, &this->skelAnime)) { - if (this->av1.actionVar1 != 0) { - if (this->av2.actionVar2 == 0) { - Message_StartTextbox(play, sBottleCatchInfos[this->av1.actionVar1 - 1].textId, &this->actor); + if (this->av1.bottleCatchType != BOTTLE_CATCH_NONE) { + if (!this->av2.startedTextbox) { + // 1 is subtracted because `sBottleCatchInfo` does not have an entry for `BOTTLE_CATCH_NONE` + Message_StartTextbox(play, sBottleCatchInfo[this->av1.bottleCatchType - 1].textId, &this->actor); Audio_PlayFanfare(NA_BGM_ITEM_GET | 0x900); - this->av2.actionVar2 = 1; + this->av2.startedTextbox = true; } else if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { - this->av1.actionVar1 = 0; + this->av1.bottleCatchType = BOTTLE_CATCH_NONE; Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN)); } } else { func_8083C0E8(this, play); } - } else { - if (this->av1.actionVar1 == 0) { - temp = this->skelAnime.curFrame - sp24->unk_08; + } else if (this->av1.bottleCatchType == BOTTLE_CATCH_NONE) { + s32 activeFrame = this->skelAnime.curFrame - swingEntry->firstActiveFrame; - if (temp >= 0) { - if (sp24->unk_09 >= temp) { - if (this->av2.actionVar2 != 0) { - if (temp == 0) { - Player_PlaySfx(this, NA_SE_IT_SCOOP_UP_WATER); - } - } + if (activeFrame >= 0 && activeFrame <= swingEntry->numActiveFrames) { + if (this->av2.inWater && activeFrame == 0) { + // Play water scoop sound on the first active frame, if applicable + Player_PlaySfx(this, NA_SE_IT_SCOOP_UP_WATER); + } - if (this->interactRangeActor != NULL) { - catchInfo = &sBottleCatchInfos[0]; - for (i = 0; i < ARRAY_COUNT(sBottleCatchInfos); i++, catchInfo++) { - if (this->interactRangeActor->id == catchInfo->actorId) { - break; - } - } + // `interactRangeActor` will be set by the Get Item system. See `Actor_OfferGetItem`. + if (this->interactRangeActor != NULL) { + BottleCatchInfo* catchInfo = &sBottleCatchInfo[0]; + s32 i; - if (i < ARRAY_COUNT(sBottleCatchInfos)) { - this->av1.actionVar1 = i + 1; - this->av2.actionVar2 = 0; - this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29; - this->interactRangeActor->parent = &this->actor; - Player_UpdateBottleHeld(play, this, catchInfo->itemId, ABS(catchInfo->itemAction)); - Player_AnimPlayOnceAdjusted(play, this, sp24->unk_04); - func_80835EA4(play, 4); - } + // Try to find an `interactRangeActor` with the same ID as an entry in `sBottleCatchInfo` + for (i = 0; i < ARRAY_COUNT(sBottleCatchInfo); i++, catchInfo++) { + if (this->interactRangeActor->id == catchInfo->actorId) { + break; } } + + if (i < ARRAY_COUNT(sBottleCatchInfo)) { + // 1 is added because `sBottleCatchInfo` does not have an entry for `BOTTLE_CATCH_NONE` + this->av1.bottleCatchType = i + 1; + + this->av2.startedTextbox = false; + this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29; + this->interactRangeActor->parent = &this->actor; + + Player_UpdateBottleHeld(play, this, catchInfo->itemId, ABS(catchInfo->itemAction)); + Player_AnimPlayOnceAdjusted(play, this, swingEntry->catchAnimation); + func_80835EA4(play, 4); + } } } } @@ -13556,12 +14184,12 @@ static BottleDropInfo D_80854A28[] = { }; static AnimSfxEntry D_80854A34[] = { - { NA_SE_VO_LI_AUTO_JUMP, ANIMSFX_DATA(ANIMSFX_TYPE_4, 38) }, - { NA_SE_EV_BOTTLE_CAP_OPEN, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 40) }, + { NA_SE_VO_LI_AUTO_JUMP, ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 38) }, + { NA_SE_EV_BOTTLE_CAP_OPEN, -ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 40) }, }; void Player_Action_8084EFC0(Player* this, PlayState* play) { - func_8083721C(this); + Player_DecelerateToZero(this); if (LinkAnimation_Update(play, &this->skelAnime)) { func_8083C0E8(this, play); @@ -13581,10 +14209,10 @@ void Player_Action_8084EFC0(Player* this, PlayState* play) { } static AnimSfxEntry D_80854A3C[] = { - { NA_SE_PL_PUT_OUT_ITEM, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 30) }, + { NA_SE_PL_PUT_OUT_ITEM, -ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 30) }, }; -void Player_Action_8084F104(Player* this, PlayState* play) { +void Player_Action_ExchangeItem(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_5; if (LinkAnimation_Update(play, &this->skelAnime)) { @@ -13598,7 +14226,7 @@ void Player_Action_8084F104(Player* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_TALK; } - func_80853148(play, talkActor); + Player_StartTalking(play, talkActor); } else { GetItemEntry* giEntry = &sGetItemTable[D_80854528[this->exchangeItemId - 1] - 1]; @@ -13634,8 +14262,8 @@ void Player_Action_8084F104(Player* this, PlayState* play) { Player_ProcessAnimSfxList(this, D_80854A3C); } - if ((this->av1.actionVar1 == 0) && (this->unk_664 != NULL)) { - this->yaw = this->actor.shape.rot.y = func_8083DB98(this, 0); + if ((this->av1.actionVar1 == 0) && (this->focusActor != NULL)) { + this->yaw = this->actor.shape.rot.y = func_8083DB98(this, false); } } @@ -13652,22 +14280,20 @@ void Player_Action_8084F308(Player* this, PlayState* play) { } } -void Player_Action_8084F390(Player* this, PlayState* play) { - CollisionPoly* floorPoly; - f32 sp50; - f32 sp4C; - f32 sp48; - s16 downwardSlopeYaw; - s16 sp44; - Vec3f slopeNormal; - +void Player_Action_SlideOnSlope(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_5 | PLAYER_STATE2_6; LinkAnimation_Update(play, &this->skelAnime); func_8084269C(play, this); func_800F4138(&this->actor.projectedPos, NA_SE_PL_SLIP_LEVEL - SFX_FLAG, this->actor.speed); - if (Player_ActionChange_13(this, play) == 0) { - floorPoly = this->actor.floorPoly; + if (Player_ActionHandler_13(this, play) == 0) { + CollisionPoly* floorPoly = this->actor.floorPoly; + f32 xzSpeedTarget; + f32 xzSpeedIncrStep; + f32 xzSpeedDecrStep; + s16 downwardSlopeYaw; + s16 shapeYawTarget; + Vec3f slopeNormal; if (floorPoly == NULL) { func_80837B9C(this, play); @@ -13676,42 +14302,42 @@ void Player_Action_8084F390(Player* this, PlayState* play) { Player_GetSlopeDirection(floorPoly, &slopeNormal, &downwardSlopeYaw); - sp44 = downwardSlopeYaw; - if (this->av1.actionVar1 != 0) { - sp44 = downwardSlopeYaw + 0x8000; + shapeYawTarget = downwardSlopeYaw; + if (this->av1.facingUpSlope) { + shapeYawTarget = downwardSlopeYaw + 0x8000; } if (this->speedXZ < 0) { downwardSlopeYaw += 0x8000; } - sp50 = (1.0f - slopeNormal.y) * 40.0f; - sp50 = CLAMP(sp50, 0, 10.0f); - sp4C = (sp50 * sp50) * 0.015f; - sp48 = slopeNormal.y * 0.01f; + xzSpeedTarget = (1.0f - slopeNormal.y) * 40.0f; + xzSpeedTarget = CLAMP(xzSpeedTarget, 0, 10.0f); + xzSpeedIncrStep = SQ(xzSpeedTarget) * 0.015f; + xzSpeedDecrStep = slopeNormal.y * 0.01f; if (SurfaceType_GetFloorEffect(&play->colCtx, floorPoly, this->actor.floorBgId) != FLOOR_EFFECT_1) { - sp50 = 0; - sp48 = slopeNormal.y * 10.0f; + xzSpeedTarget = 0; + xzSpeedDecrStep = slopeNormal.y * 10.0f; } - if (sp4C < 1.0f) { - sp4C = 1.0f; + if (xzSpeedIncrStep < 1.0f) { + xzSpeedIncrStep = 1.0f; } - if (Math_AsymStepToF(&this->speedXZ, sp50, sp4C, sp48) && (sp50 == 0)) { - LinkAnimationHeader* anim; + if (Math_AsymStepToF(&this->speedXZ, xzSpeedTarget, xzSpeedIncrStep, xzSpeedDecrStep) && (xzSpeedTarget == 0)) { + LinkAnimationHeader* slideAnimation; - if (this->av1.actionVar1 == 0) { - anim = GET_PLAYER_ANIM(PLAYER_ANIMGROUP_down_slope_slip_end, this->modelAnimType); + if (!this->av1.facingUpSlope) { + slideAnimation = GET_PLAYER_ANIM(PLAYER_ANIMGROUP_down_slope_slip_end, this->modelAnimType); } else { - anim = GET_PLAYER_ANIM(PLAYER_ANIMGROUP_up_slope_slip_end, this->modelAnimType); + slideAnimation = GET_PLAYER_ANIM(PLAYER_ANIMGROUP_up_slope_slip_end, this->modelAnimType); } - func_8083A098(this, anim, play); + func_8083A098(this, slideAnimation, play); } Math_SmoothStepToS(&this->yaw, downwardSlopeYaw, 10, 4000, 800); - Math_ScaledStepToS(&this->actor.shape.rot.y, sp44, 2000); + Math_ScaledStepToS(&this->actor.shape.rot.y, shapeYawTarget, 2000); } } @@ -13740,7 +14366,7 @@ void Player_Action_8084F710(Player* this, PlayState* play) { if (this->av2.actionVar2 == 0) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->skelAnime.endFrame = this->skelAnime.animLength - 1.0f; - func_808328A0(this); + Player_PlayLandingSfx(this); this->av2.actionVar2 = 1; } } else { @@ -13793,7 +14419,7 @@ void Player_Action_8084F88C(Player* this, PlayState* play) { } void Player_Action_8084F9A0(Player* this, PlayState* play) { - Player_ActionChange_1(this, play); + Player_ActionHandler_1(this, play); } void Player_Action_8084F9C0(Player* this, PlayState* play) { @@ -13815,8 +14441,8 @@ void Player_Action_8084FA54(Player* this, PlayState* play) { LinkAnimation_Update(play, &this->skelAnime); Player_UpdateUpperBody(this, play); - this->unk_6BE = func_8084ABD8(play, this, 1, 0) - this->actor.shape.rot.y; - this->unk_6AE |= 0x80; + this->upperLimbRot.y = func_8084ABD8(play, this, true, 0) - this->actor.shape.rot.y; + this->unk_6AE_rotFlags |= UNK6AE_ROT_UPPER_Y; if (play->shootingGalleryStatus < 0) { play->shootingGalleryStatus++; @@ -13846,7 +14472,7 @@ void Player_Action_8084FB10(Player* this, PlayState* play) { } else { if (LinkAnimation_Update(play, &this->skelAnime)) { func_80839F90(this, play); - func_80837AFC(this, -20); + Player_SetInvulnerability(this, -20); } } } @@ -13862,7 +14488,7 @@ void Player_Action_8084FBF4(Player* this, PlayState* play) { } this->bodyShockTimer = 40; - func_8002F8F0(&this->actor, NA_SE_VO_LI_TAKEN_AWAY - SFX_FLAG + this->ageProperties->unk_92); + Actor_PlaySfx_Flagged2(&this->actor, NA_SE_VO_LI_TAKEN_AWAY - SFX_FLAG + this->ageProperties->unk_92); } #if IS_DEBUG @@ -14100,7 +14726,7 @@ void Player_UpdateBunnyEars(Player* this) { } } -s32 Player_ActionChange_7(Player* this, PlayState* play) { +s32 Player_ActionHandler_7(Player* this, PlayState* play) { if (func_8083C6B8(play, this) == 0) { if (func_8083BB20(this) != 0) { s32 sp24 = func_80837818(this); @@ -14144,18 +14770,18 @@ void Player_Action_808502D0(Player* this, PlayState* play) { func_8083C50C(this); if (LinkAnimation_Update(play, &this->skelAnime)) { - if (!Player_ActionChange_7(this, play)) { - u8 sp43 = this->skelAnime.moveFlags; + if (!Player_ActionHandler_7(this, play)) { + u8 sp43 = this->skelAnime.movementFlags; LinkAnimationHeader* sp3C; - if (func_8008E9C4(this)) { + if (Player_CheckHostileLockOn(this)) { sp3C = sp44->unk_08; } else { sp3C = sp44->unk_04; } func_80832318(this); - this->skelAnime.moveFlags = 0; + this->skelAnime.movementFlags = 0; if ((sp3C == &gPlayerAnim_link_fighter_Lpower_jump_kiru_end) && (this->modelAnimType != PLAYER_ANIMTYPE_3)) { @@ -14164,7 +14790,7 @@ void Player_Action_808502D0(Player* this, PlayState* play) { func_8083A098(this, sp3C, play); - this->skelAnime.moveFlags = sp43; + this->skelAnime.movementFlags = sp43; this->stateFlags3 |= PLAYER_STATE3_3; } } else if (this->heldItemAction == PLAYER_IA_HAMMER) { @@ -14178,7 +14804,7 @@ void Player_Action_808502D0(Player* this, PlayState* play) { sp2C = this->actor.world.pos.y - shockwavePos.y; Math_ScaledStepToS(&this->actor.focus.rot.x, Math_Atan2S(45.0f, sp2C), 800); - func_80836AB8(this, 1); + func_80836AB8(this, true); if ((((this->meleeWeaponAnimation == PLAYER_MWA_HAMMER_FORWARD) && LinkAnimation_OnFrame(&this->skelAnime, 7.0f)) || @@ -14195,7 +14821,7 @@ void Player_Action_808502D0(Player* this, PlayState* play) { void Player_Action_808505DC(Player* this, PlayState* play) { LinkAnimation_Update(play, &this->skelAnime); - func_8083721C(this); + Player_DecelerateToZero(this); if (this->skelAnime.curFrame >= 6.0f) { func_80839FFC(this, play); @@ -14325,25 +14951,25 @@ void Player_Action_808507F4(Player* this, PlayState* play) { } else if (this->av1.actionVar1 >= 0) { if (this->av2.actionVar2 == 0) { static AnimSfxEntry D_80854A80[] = { - { NA_SE_PL_SKIP, ANIMSFX_DATA(ANIMSFX_TYPE_1, 20) }, - { NA_SE_VO_LI_SWORD_N, ANIMSFX_DATA(ANIMSFX_TYPE_4, 20) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_6, 26) }, + { NA_SE_PL_SKIP, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 20) }, + { NA_SE_VO_LI_SWORD_N, ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 20) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 26) }, }; Player_ProcessAnimSfxList(this, D_80854A80); } else if (this->av2.actionVar2 == 1) { static AnimSfxEntry D_80854A8C[][2] = { { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 20) }, - { NA_SE_VO_LI_MAGIC_FROL, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 30) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 20) }, + { NA_SE_VO_LI_MAGIC_FROL, -ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 30) }, }, { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 20) }, - { NA_SE_VO_LI_MAGIC_NALE, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 44) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 20) }, + { NA_SE_VO_LI_MAGIC_NALE, -ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 44) }, }, { - { NA_SE_VO_LI_MAGIC_ATTACK, ANIMSFX_DATA(ANIMSFX_TYPE_4, 20) }, - { NA_SE_IT_SWORD_SWING_HARD, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 20) }, + { NA_SE_VO_LI_MAGIC_ATTACK, ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 20) }, + { NA_SE_IT_SWORD_SWING_HARD, -ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 20) }, }, }; @@ -14359,7 +14985,7 @@ void Player_Action_808507F4(Player* this, PlayState* play) { } } - func_8083721C(this); + Player_DecelerateToZero(this); } void Player_Action_80850AEC(Player* this, PlayState* play) { @@ -14397,7 +15023,12 @@ void Player_Action_80850AEC(Player* this, PlayState* play) { void Player_Action_80850C68(Player* this, PlayState* play) { if ((this->av2.actionVar2 != 0) && ((this->unk_858 != 0.0f) || (this->unk_85C != 0.0f))) { - static Vec3s D_80858AD8[25]; + // 144-byte buffer, declared as a u64 array for 8-byte alignment. LinkAnimation_BlendToMorph will round up + // the buffer address to the nearest 16-byte alignment before passing it to AnimTaskQueue_AddLoadPlayerFrame, + // and AnimTaskQueue_AddLoadPlayerFrame requires space for `sizeof(Vec3s) * limbCount + 2` bytes. Link's + // skeleton has 22 limbs (including the root limb) so we need 134 bytes of space, plus 8 bytes of margin for + // the 16-byte alignment operation. + static u64 D_80858AD8[18]; f32 updateScale = R_UPDATE_RATE * 0.5f; this->skelAnime.curFrame += this->skelAnime.playSpeed * updateScale; @@ -14412,7 +15043,7 @@ void Player_Action_80850C68(Player* this, PlayState* play) { LinkAnimation_BlendToMorph(play, &this->skelAnime, &gPlayerAnim_link_fishing_wait, this->skelAnime.curFrame, (this->unk_85C < 0.0f) ? &gPlayerAnim_link_fishing_reel_up : &gPlayerAnim_link_fishing_reel_down, - 5.0f, fabsf(this->unk_85C), D_80858AD8); + 5.0f, fabsf(this->unk_85C), (Vec3s*)D_80858AD8); LinkAnimation_InterpJointMorph(play, &this->skelAnime, 0.5f); } else if (LinkAnimation_Update(play, &this->skelAnime)) { this->unk_860 = 2; @@ -14420,7 +15051,7 @@ void Player_Action_80850C68(Player* this, PlayState* play) { this->av2.actionVar2 = 1; } - func_8083721C(this); + Player_DecelerateToZero(this); if (this->unk_860 == 0) { func_80853080(this, play); @@ -14443,22 +15074,22 @@ static void (*D_80854AA4[])(PlayState*, Player*, void*) = { }; static AnimSfxEntry D_80854AF0[] = { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_5, 34) }, - { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_1, 45) }, - { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_1, 51) }, - { NA_SE_PL_CALM_HIT, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 64) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_LANDING, 34) }, + { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 45) }, + { NA_SE_PL_CALM_HIT, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 51) }, + { NA_SE_PL_CALM_HIT, -ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 64) }, }; static AnimSfxEntry D_80854B00[] = { - { NA_SE_VO_LI_SURPRISE, ANIMSFX_DATA(ANIMSFX_TYPE_4, 3) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 15) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 24) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 30) }, - { NA_SE_VO_LI_FALL_L, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 31) }, + { NA_SE_VO_LI_SURPRISE, ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 3) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 15) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 24) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 30) }, + { NA_SE_VO_LI_FALL_L, -ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 31) }, }; static AnimSfxEntry D_80854B14[] = { - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_6, 10) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 10) }, }; static struct_80854B18 D_80854B18[PLAYER_CSACTION_MAX] = { @@ -14626,51 +15257,55 @@ static struct_80854B18 D_80854E50[PLAYER_CSACTION_MAX] = { { 11, NULL }, // PLAYER_CSACTION_55 { 11, NULL }, // PLAYER_CSACTION_56 { 12, &gPlayerAnim_clink_demo_mimawasi_wait }, // PLAYER_CSACTION_57 - { -1, func_80852358 }, // PLAYER_CSACTION_58 - { 11, NULL }, // PLAYER_CSACTION_59 - { 18, D_80854B14 }, // PLAYER_CSACTION_60 - { 11, NULL }, // PLAYER_CSACTION_61 - { 11, NULL }, // PLAYER_CSACTION_62 - { 11, NULL }, // PLAYER_CSACTION_63 - { 11, NULL }, // PLAYER_CSACTION_64 - { -1, func_80852388 }, // PLAYER_CSACTION_65 - { 17, &gPlayerAnim_demo_link_nwait }, // PLAYER_CSACTION_66 - { 12, &gPlayerAnim_d_link_orowait }, // PLAYER_CSACTION_67 - { 12, &gPlayerAnim_demo_link_nwait }, // PLAYER_CSACTION_68 - { 11, NULL }, // PLAYER_CSACTION_69 - { -1, func_808526EC }, // PLAYER_CSACTION_70 - { 17, &gPlayerAnim_sude_nwait }, // PLAYER_CSACTION_71 - { -1, func_808526EC }, // PLAYER_CSACTION_72 - { 17, &gPlayerAnim_sude_nwait }, // PLAYER_CSACTION_73 - { 12, &gPlayerAnim_link_demo_gurad_wait }, // PLAYER_CSACTION_74 - { 12, &gPlayerAnim_link_demo_look_hand_wait }, // PLAYER_CSACTION_75 - { 11, NULL }, // PLAYER_CSACTION_76 - { 12, &gPlayerAnim_link_demo_ue_wait }, // PLAYER_CSACTION_77 - { 12, &gPlayerAnim_Link_m_wait }, // PLAYER_CSACTION_78 - { 13, &gPlayerAnim_Link_ue_wait }, // PLAYER_CSACTION_79 - { 12, &gPlayerAnim_Link_otituku_w }, // PLAYER_CSACTION_80 - { 12, &gPlayerAnim_L_kw }, // PLAYER_CSACTION_81 - { 11, NULL }, // PLAYER_CSACTION_82 - { 11, NULL }, // PLAYER_CSACTION_83 - { 11, NULL }, // PLAYER_CSACTION_84 - { 11, NULL }, // PLAYER_CSACTION_85 - { -1, func_80852648 }, // PLAYER_CSACTION_86 - { 11, NULL }, // PLAYER_CSACTION_87 - { 12, &gPlayerAnim_L_kennasi_w }, // PLAYER_CSACTION_88 - { -1, func_808524D0 }, // PLAYER_CSACTION_89 - { -1, func_80852514 }, // PLAYER_CSACTION_90 - { -1, func_80852554 }, // PLAYER_CSACTION_91 - { -1, func_808525C0 }, // PLAYER_CSACTION_92 - { 11, NULL }, // PLAYER_CSACTION_93 - { 11, NULL }, // PLAYER_CSACTION_94 - { 11, NULL }, // PLAYER_CSACTION_95 - { -1, func_8085283C }, // PLAYER_CSACTION_96 - { -1, func_808528C8 }, // PLAYER_CSACTION_97 - { -1, func_808528C8 }, // PLAYER_CSACTION_98 - { 12, &gPlayerAnim_link_demo_zeldamiru_wait }, // PLAYER_CSACTION_99 - { 12, &gPlayerAnim_link_demo_kenmiru1_wait }, // PLAYER_CSACTION_100 - { 12, &gPlayerAnim_link_demo_kenmiru2_wait }, // PLAYER_CSACTION_101 - { 12, &gPlayerAnim_demo_link_nwait }, // PLAYER_CSACTION_102 +#if OOT_VERSION < PAL_1_0 + { 12, &gPlayerAnim_link_demo_nozokikomi_wait }, // PLAYER_CSACTION_58 +#else + { -1, func_80852358 }, // PLAYER_CSACTION_58 +#endif + { 11, NULL }, // PLAYER_CSACTION_59 + { 18, D_80854B14 }, // PLAYER_CSACTION_60 + { 11, NULL }, // PLAYER_CSACTION_61 + { 11, NULL }, // PLAYER_CSACTION_62 + { 11, NULL }, // PLAYER_CSACTION_63 + { 11, NULL }, // PLAYER_CSACTION_64 + { -1, func_80852388 }, // PLAYER_CSACTION_65 + { 17, &gPlayerAnim_demo_link_nwait }, // PLAYER_CSACTION_66 + { 12, &gPlayerAnim_d_link_orowait }, // PLAYER_CSACTION_67 + { 12, &gPlayerAnim_demo_link_nwait }, // PLAYER_CSACTION_68 + { 11, NULL }, // PLAYER_CSACTION_69 + { -1, func_808526EC }, // PLAYER_CSACTION_70 + { 17, &gPlayerAnim_sude_nwait }, // PLAYER_CSACTION_71 + { -1, func_808526EC }, // PLAYER_CSACTION_72 + { 17, &gPlayerAnim_sude_nwait }, // PLAYER_CSACTION_73 + { 12, &gPlayerAnim_link_demo_gurad_wait }, // PLAYER_CSACTION_74 + { 12, &gPlayerAnim_link_demo_look_hand_wait }, // PLAYER_CSACTION_75 + { 11, NULL }, // PLAYER_CSACTION_76 + { 12, &gPlayerAnim_link_demo_ue_wait }, // PLAYER_CSACTION_77 + { 12, &gPlayerAnim_Link_m_wait }, // PLAYER_CSACTION_78 + { 13, &gPlayerAnim_Link_ue_wait }, // PLAYER_CSACTION_79 + { 12, &gPlayerAnim_Link_otituku_w }, // PLAYER_CSACTION_80 + { 12, &gPlayerAnim_L_kw }, // PLAYER_CSACTION_81 + { 11, NULL }, // PLAYER_CSACTION_82 + { 11, NULL }, // PLAYER_CSACTION_83 + { 11, NULL }, // PLAYER_CSACTION_84 + { 11, NULL }, // PLAYER_CSACTION_85 + { -1, func_80852648 }, // PLAYER_CSACTION_86 + { 11, NULL }, // PLAYER_CSACTION_87 + { 12, &gPlayerAnim_L_kennasi_w }, // PLAYER_CSACTION_88 + { -1, func_808524D0 }, // PLAYER_CSACTION_89 + { -1, func_80852514 }, // PLAYER_CSACTION_90 + { -1, func_80852554 }, // PLAYER_CSACTION_91 + { -1, func_808525C0 }, // PLAYER_CSACTION_92 + { 11, NULL }, // PLAYER_CSACTION_93 + { 11, NULL }, // PLAYER_CSACTION_94 + { 11, NULL }, // PLAYER_CSACTION_95 + { -1, func_8085283C }, // PLAYER_CSACTION_96 + { -1, func_808528C8 }, // PLAYER_CSACTION_97 + { -1, func_808528C8 }, // PLAYER_CSACTION_98 + { 12, &gPlayerAnim_link_demo_zeldamiru_wait }, // PLAYER_CSACTION_99 + { 12, &gPlayerAnim_link_demo_kenmiru1_wait }, // PLAYER_CSACTION_100 + { 12, &gPlayerAnim_link_demo_kenmiru2_wait }, // PLAYER_CSACTION_101 + { 12, &gPlayerAnim_demo_link_nwait }, // PLAYER_CSACTION_102 }; void Player_AnimChangeOnceMorphZeroRootYawSpeed(PlayState* play, Player* this, LinkAnimationHeader* anim) { @@ -14720,8 +15355,8 @@ void func_808510D4(PlayState* play, Player* this, void* anim) { void func_808510F4(PlayState* play, Player* this, void* anim) { Player_AnimReplacePlayOnce(play, this, anim, - ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_NO_MOVE | - ANIM_FLAG_OVERRIDE_MOVEMENT); + ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_ADJUST_STARTING_POS | ANIM_FLAG_OVERRIDE_MOVEMENT); } void func_80851114(PlayState* play, Player* this, void* anim) { @@ -14730,8 +15365,8 @@ void func_80851114(PlayState* play, Player* this, void* anim) { void func_80851134(PlayState* play, Player* this, void* anim) { Player_AnimReplacePlayLoop(play, this, anim, - ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_NO_MOVE | - ANIM_FLAG_OVERRIDE_MOVEMENT); + ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_ADJUST_STARTING_POS | ANIM_FLAG_OVERRIDE_MOVEMENT); } void func_80851154(PlayState* play, Player* this, void* anim) { @@ -14763,7 +15398,7 @@ void func_808511FC(PlayState* play, Player* this, void* anim) { void func_80851248(PlayState* play, Player* this, void* anim) { if (LinkAnimation_Update(play, &this->skelAnime)) { - func_80832DBC(this); + Player_FinishAnimMovement(this); Player_AnimPlayLoopAdjusted(play, this, anim); } } @@ -14785,10 +15420,10 @@ void func_80851314(Player* this) { this->csActor = NULL; } - this->unk_664 = this->csActor; + this->focusActor = this->csActor; - if (this->unk_664 != NULL) { - this->actor.shape.rot.y = func_8083DB98(this, 0); + if (this->focusActor != NULL) { + this->actor.shape.rot.y = func_8083DB98(this, false); } } @@ -14836,13 +15471,13 @@ void func_808514C0(PlayState* play, Player* this, CsCmdActorCue* cue) { LinkAnimation_Update(play, &this->skelAnime); - if (func_8008F128(this) || (this->stateFlags1 & PLAYER_STATE1_11)) { + if (func_8008F128(this) || (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR)) { Player_UpdateUpperBody(this, play); return; } if ((this->interactRangeActor != NULL) && (this->interactRangeActor->textId == 0xFFFF)) { - Player_ActionChange_2(this, play); + Player_ActionHandler_2(this, play); } } @@ -14885,15 +15520,15 @@ void func_80851688(PlayState* play, Player* this, CsCmdActorCue* cue) { LinkAnimation_Update(play, &this->skelAnime); - if (func_8008F128(this) || (this->stateFlags1 & PLAYER_STATE1_11)) { + if (func_8008F128(this) || (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR)) { Player_UpdateUpperBody(this, play); } } } static AnimSfxEntry D_80855188[] = { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 42) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_6, 48) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 42) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 48) }, }; void func_80851750(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -14902,7 +15537,7 @@ void func_80851750(PlayState* play, Player* this, CsCmdActorCue* cue) { } void func_80851788(PlayState* play, Player* this, CsCmdActorCue* cue) { - this->stateFlags1 &= ~PLAYER_STATE1_25; + this->stateFlags1 &= ~PLAYER_STATE1_BOOMERANG_THROWN; this->yaw = this->actor.shape.rot.y = this->actor.world.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_450); @@ -14976,9 +15611,10 @@ void func_808519EC(PlayState* play, Player* this, CsCmdActorCue* cue) { Math_Vec3f_Copy(&this->actor.world.pos, &D_80855198); this->actor.shape.rot.y = -0x8000; Player_AnimPlayOnceAdjusted(play, this, this->ageProperties->unk_9C); - Player_AnimReplaceApplyFlags(play, this, - ANIM_REPLACE_APPLY_FLAG_9 | ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | - ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_StartAnimMovement(play, this, + PLAYER_ANIM_MOVEMENT_RESET_BY_AGE | ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_UPDATE_Y | + ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_OVERRIDE_MOVEMENT); } static struct_808551A4 D_808551A4[] = { @@ -14986,10 +15622,12 @@ static struct_808551A4 D_808551A4[] = { { NA_SE_IT_SWORD_STICK_STN, NA_SE_VO_LI_SWORD_N }, }; +#if OOT_VERSION >= PAL_1_0 static AnimSfxEntry D_808551AC[] = { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 29) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_8, 39) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 29) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 39) }, }; +#endif void func_80851A50(PlayState* play, Player* this, CsCmdActorCue* cue) { struct_808551A4* sp2C; @@ -15011,14 +15649,16 @@ void func_80851A50(PlayState* play, Player* this, CsCmdActorCue* cue) { Player_PlaySfx(this, sp2C->unk_00); if (!LINK_IS_ADULT) { - func_80832698(this, sp2C->unk_02); + Player_PlayVoiceSfx(this, sp2C->unk_02); } } else if (LINK_IS_ADULT) { if (LinkAnimation_OnFrame(&this->skelAnime, 66.0f)) { - func_80832698(this, NA_SE_VO_LI_SWORD_L); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_SWORD_L); } } else { +#if OOT_VERSION >= PAL_1_0 Player_ProcessAnimSfxList(this, D_808551AC); +#endif } } @@ -15028,7 +15668,7 @@ void func_80851B90(PlayState* play, Player* this, CsCmdActorCue* cue) { } static AnimSfxEntry D_808551B4[] = { - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_5, 30) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_LANDING, 30) }, }; void func_80851BE8(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -15053,7 +15693,7 @@ void func_80851CA4(PlayState* play, Player* this, CsCmdActorCue* cue) { } if (this->av2.actionVar2 != 0) { - func_8083721C(this); + Player_DecelerateToZero(this); } } @@ -15064,7 +15704,7 @@ void func_80851D2C(PlayState* play, Player* this, CsCmdActorCue* cue) { } static AnimSfxEntry D_808551B8[] = { - { NA_SE_IT_SWORD_PICKOUT, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 12) }, + { NA_SE_IT_SWORD_PICKOUT, -ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 12) }, }; void func_80851D80(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -15089,21 +15729,22 @@ void func_80851E28(PlayState* play, Player* this, CsCmdActorCue* cue) { void func_80851E64(PlayState* play, Player* this, CsCmdActorCue* cue) { Player_AnimReplacePlayOnceAdjusted(play, this, &gPlayerAnim_link_swimer_swim_get, - ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_NO_MOVE | ANIM_FLAG_OVERRIDE_MOVEMENT); + ANIM_FLAG_ENABLE_MOVEMENT | ANIM_FLAG_ADJUST_STARTING_POS | + ANIM_FLAG_OVERRIDE_MOVEMENT); } void func_80851E90(PlayState* play, Player* this, CsCmdActorCue* cue) { Player_AnimReplacePlayOnce(play, this, &gPlayerAnim_clink_op3_negaeri, - ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_NO_MOVE | - ANIM_FLAG_OVERRIDE_MOVEMENT); - func_80832698(this, NA_SE_VO_LI_GROAN); + ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_ADJUST_STARTING_POS | ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_GROAN); } void func_80851ECC(PlayState* play, Player* this, CsCmdActorCue* cue) { if (LinkAnimation_Update(play, &this->skelAnime)) { Player_AnimReplacePlayLoop(play, this, &gPlayerAnim_clink_op3_wait2, - ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_NO_MOVE | - ANIM_FLAG_OVERRIDE_MOVEMENT); + ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_ADJUST_STARTING_POS | ANIM_FLAG_OVERRIDE_MOVEMENT); } } @@ -15122,16 +15763,16 @@ void func_80851F84(PlayState* play, Player* this, CsCmdActorCue* cue) { } static AnimSfxEntry D_808551BC[] = { - { NA_SE_VO_LI_RELAX, ANIMSFX_DATA(ANIMSFX_TYPE_4, 35) }, - { NA_SE_PL_SLIPDOWN, ANIMSFX_DATA(ANIMSFX_TYPE_1, 236) }, - { NA_SE_PL_SLIPDOWN, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 256) }, + { NA_SE_VO_LI_RELAX, ANIMSFX_DATA(ANIMSFX_TYPE_VOICE, 35) }, + { NA_SE_PL_SLIPDOWN, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 236) }, + { NA_SE_PL_SLIPDOWN, -ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 256) }, }; void func_80851FB0(PlayState* play, Player* this, CsCmdActorCue* cue) { if (LinkAnimation_Update(play, &this->skelAnime)) { Player_AnimReplacePlayLoop(play, this, &gPlayerAnim_clink_op3_wait3, - ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_NO_MOVE | - ANIM_FLAG_OVERRIDE_MOVEMENT); + ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | ANIM_FLAG_ENABLE_MOVEMENT | + ANIM_FLAG_ADJUST_STARTING_POS | ANIM_FLAG_OVERRIDE_MOVEMENT); this->av2.actionVar2 = 1; } else if (this->av2.actionVar2 == 0) { Player_ProcessAnimSfxList(this, D_808551BC); @@ -15142,10 +15783,17 @@ void func_80851FB0(PlayState* play, Player* this, CsCmdActorCue* cue) { } static AnimSfxEntry D_808551C8[] = { - { NA_SE_PL_LAND + SURFACE_SFX_OFFSET_WOOD, ANIMSFX_DATA(ANIMSFX_TYPE_1, 67) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_9, 84) }, - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_9, 90) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_9, 96) }, +#if OOT_VERSION < PAL_1_0 + { NA_SE_PL_LAND, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 67) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 84) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 90) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 96) }, +#else + { NA_SE_PL_LAND + SURFACE_SFX_OFFSET_WOOD, ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 67) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_UNKNOWN, 84) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_UNKNOWN, 90) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_UNKNOWN, 96) }, +#endif }; void func_80852048(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -15155,9 +15803,10 @@ void func_80852048(PlayState* play, Player* this, CsCmdActorCue* cue) { void func_80852080(PlayState* play, Player* this, CsCmdActorCue* cue) { Player_AnimReplacePlayOnceAdjusted(play, this, &gPlayerAnim_clink_demo_futtobi, - ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_PLAYER_2 | ANIM_FLAG_PLAYER_SETMOVE | - ANIM_FLAG_NO_MOVE | ANIM_FLAG_OVERRIDE_MOVEMENT); - func_80832698(this, NA_SE_VO_LI_FALL_L); + ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT | + ANIM_FLAG_ENABLE_MOVEMENT | ANIM_FLAG_ADJUST_STARTING_POS | + ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_FALL_L); } void func_808520BC(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -15177,8 +15826,8 @@ void func_808520BC(PlayState* play, Player* this, CsCmdActorCue* cue) { } static AnimSfxEntry D_808551D8[] = { - { NA_SE_PL_BOUND, ANIMSFX_DATA(ANIMSFX_TYPE_2, 20) }, - { NA_SE_PL_BOUND, -ANIMSFX_DATA(ANIMSFX_TYPE_2, 30) }, + { NA_SE_PL_BOUND, ANIMSFX_DATA(ANIMSFX_TYPE_FLOOR, 20) }, + { NA_SE_PL_BOUND, -ANIMSFX_DATA(ANIMSFX_TYPE_FLOOR, 30) }, }; void func_80852174(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -15204,8 +15853,8 @@ void func_80852234(PlayState* play, Player* this, CsCmdActorCue* cue) { } void func_8085225C(PlayState* play, Player* this, CsCmdActorCue* cue) { - Player_AnimReplaceApplyFlags(play, this, - ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_NO_MOVE | ANIM_FLAG_OVERRIDE_MOVEMENT); + Player_StartAnimMovement(play, this, + ANIM_FLAG_ENABLE_MOVEMENT | ANIM_FLAG_ADJUST_STARTING_POS | ANIM_FLAG_OVERRIDE_MOVEMENT); } void func_80852280(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -15224,22 +15873,24 @@ void func_80852298(PlayState* play, Player* this, CsCmdActorCue* cue) { } static AnimSfxEntry D_808551E0[] = { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 10) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_6, 24) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 10) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 24) }, }; void func_80852328(PlayState* play, Player* this, CsCmdActorCue* cue) { func_80851F14(play, this, &gPlayerAnim_link_demo_furimuki2_wait, D_808551E0); } +#if OOT_VERSION >= PAL_1_0 static AnimSfxEntry D_808551E8[] = { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 15) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_8, 35) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 15) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_WALKING, 35) }, }; void func_80852358(PlayState* play, Player* this, CsCmdActorCue* cue) { func_80851F14(play, this, &gPlayerAnim_link_demo_nozokikomi_wait, D_808551E8); } +#endif void func_80852388(PlayState* play, Player* this, CsCmdActorCue* cue) { if (LinkAnimation_Update(play, &this->skelAnime)) { @@ -15262,8 +15913,8 @@ void func_80852414(PlayState* play, Player* this, LinkAnimationHeader* anim, Ani } static AnimSfxEntry D_808551F0[] = { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_6, 15) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_6, 33) }, + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 15) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_RUNNING, 33) }, }; void func_80852450(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -15271,7 +15922,7 @@ void func_80852450(PlayState* play, Player* this, CsCmdActorCue* cue) { } static AnimSfxEntry D_808551F8[] = { - { NA_SE_PL_KNOCK, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 78) }, + { NA_SE_PL_KNOCK, -ANIMSFX_DATA(ANIMSFX_TYPE_GENERAL, 78) }, }; void func_80852480(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -15304,7 +15955,7 @@ void func_80852564(PlayState* play, Player* this, CsCmdActorCue* cue) { this->actor.velocity.y = -1.0f; Player_AnimPlayOnce(play, this, &gPlayerAnim_link_normal_back_downA); - func_80832698(this, NA_SE_VO_LI_FALL_L); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_FALL_L); } static void (*D_808551FC[])(Player* this, PlayState* play) = { @@ -15400,8 +16051,8 @@ void func_80852944(PlayState* play, Player* this, CsCmdActorCue* cue) { func_80832340(play, this); } else { func_8083C148(this, play); - if (!Player_ActionChange_4(this, play)) { - Player_ActionChange_2(this, play); + if (!Player_ActionHandler_Talk(this, play)) { + Player_ActionHandler_2(this, play); } } @@ -15432,7 +16083,7 @@ void func_80852A54(PlayState* play, Player* this, CsCmdActorCue* cue) { func_808529D0(play, this, cue); } - this->skelAnime.moveFlags = 0; + this->skelAnime.movementFlags = 0; Player_ZeroRootLimbYaw(this); } @@ -15443,7 +16094,8 @@ void func_80852B4C(PlayState* play, Player* this, CsCmdActorCue* cue, struct_808 arg3->func(play, this, cue); } - if ((D_80858AA0 & ANIM_FLAG_PLAYER_2) && !(this->skelAnime.moveFlags & ANIM_FLAG_PLAYER_2)) { + if ((D_80858AA0 & ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT) && + !(this->skelAnime.movementFlags & ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT)) { this->skelAnime.morphTable[0].y /= this->ageProperties->unk_08; D_80858AA0 = 0; } @@ -15483,9 +16135,9 @@ void func_80852C50(PlayState* play, Player* this, CsCmdActorCue* cueUnused) { } } - D_80858AA0 = this->skelAnime.moveFlags; + D_80858AA0 = this->skelAnime.movementFlags; - func_80832DBC(this); + Player_FinishAnimMovement(this); PRINTF("TOOL MODE=%d\n", csAction); func_80852C0C(play, this, ABS(csAction)); func_80852B4C(play, this, cue, &D_80854B18[ABS(csAction)]); @@ -15502,9 +16154,9 @@ void func_80852C50(PlayState* play, Player* this, CsCmdActorCue* cueUnused) { void Player_Action_CsAction(Player* this, PlayState* play) { if (this->csAction != this->prevCsAction) { - D_80858AA0 = this->skelAnime.moveFlags; + D_80858AA0 = this->skelAnime.movementFlags; - func_80832DBC(this); + Player_FinishAnimMovement(this); this->prevCsAction = this->csAction; PRINTF("DEMO MODE=%d\n", this->csAction); func_80852C0C(play, this, this->csAction); @@ -15530,13 +16182,13 @@ s32 Player_StartFishing(PlayState* play) { s32 func_80852F38(PlayState* play, Player* this) { if (!Player_InBlockingCsMode(play, this) && (this->invincibilityTimer >= 0) && !func_8008F128(this) && - !(this->stateFlags3 & PLAYER_STATE3_7)) { + !(this->stateFlags3 & PLAYER_STATE3_FLYING_WITH_HOOKSHOT)) { func_80832564(play, this); Player_SetupAction(play, this, Player_Action_8084F308, 0); Player_AnimPlayOnce(play, this, &gPlayerAnim_link_normal_re_dead_attack); this->stateFlags2 |= PLAYER_STATE2_7; func_80832224(this); - func_80832698(this, NA_SE_VO_LI_HELD); + Player_PlayVoiceSfx(this, NA_SE_VO_LI_HELD); return true; } @@ -15567,8 +16219,8 @@ s32 Player_TryCsAction(PlayState* play, Actor* actor, s32 csAction) { } void func_80853080(Player* this, PlayState* play) { - Player_SetupAction(play, this, Player_Action_80840BC8, 1); - Player_AnimChangeOnceMorph(play, this, func_80833338(this)); + Player_SetupAction(play, this, Player_Action_Idle, 1); + Player_AnimChangeOnceMorph(play, this, Player_GetIdleAnim(this)); this->yaw = this->actor.shape.rot.y; } @@ -15583,13 +16235,18 @@ s32 Player_InflictDamage(PlayState* play, s32 damage) { return 0; } -// Start talking with the given actor -void func_80853148(PlayState* play, Actor* actor) { +/** + * Start talking to the specified actor. + * + * This function does not concern trading exchange items. + * For item exchanges see relevant code in `Player_ActionChange_13` and `Player_Action_ExchangeItem`. + */ +void Player_StartTalking(PlayState* play, Actor* actor) { Player* this = GET_PLAYER(play); s32 pad; if ((this->talkActor != NULL) || (actor == this->naviActor) || - CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_0 | ACTOR_FLAG_18)) { + CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP)) { actor->flags |= ACTOR_FLAG_TALK; } @@ -15597,6 +16254,8 @@ void func_80853148(PlayState* play, Actor* actor) { this->exchangeItemId = EXCH_ITEM_NONE; if (actor->textId == 0xFFFF) { + // Player will stand and look at the actor with no text appearing. + // This can be used to delay text from appearing, for example. Player_SetCsActionWithHaltedActors(play, actor, PLAYER_CSACTION_1); actor->flags |= ACTOR_FLAG_TALK; Player_PutAwayHeldItem(play, this); @@ -15612,39 +16271,39 @@ void func_80853148(PlayState* play, Actor* actor) { s32 sp24 = this->av2.actionVar2; Player_PutAwayHeldItem(play, this); - func_8083A2F8(play, this); + Player_SetupTalk(play, this); this->av2.actionVar2 = sp24; } else { if (func_808332B8(this)) { - Player_SetupWaitForPutAway(play, this, func_8083A2F8); + Player_SetupWaitForPutAway(play, this, Player_SetupTalk); Player_AnimChangeLoopSlowMorph(play, this, &gPlayerAnim_link_swimer_swim_wait); } else if ((actor->category != ACTORCAT_NPC) || (this->heldItemAction == PLAYER_IA_FISHING_POLE)) { - func_8083A2F8(play, this); + Player_SetupTalk(play, this); - if (!func_8008E9C4(this)) { + if (!Player_CheckHostileLockOn(this)) { if ((actor != this->naviActor) && (actor->xzDistToPlayer < 40.0f)) { Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_normal_backspace); } else { - Player_AnimPlayLoop(play, this, func_80833338(this)); + Player_AnimPlayLoop(play, this, Player_GetIdleAnim(this)); } } } else { - Player_SetupWaitForPutAway(play, this, func_8083A2F8); + Player_SetupWaitForPutAway(play, this, Player_SetupTalk); Player_AnimPlayOnceAdjusted(play, this, (actor->xzDistToPlayer < 40.0f) ? &gPlayerAnim_link_normal_backspace : &gPlayerAnim_link_normal_talk_free); } if (this->skelAnime.animation == &gPlayerAnim_link_normal_backspace) { - Player_AnimReplaceApplyFlags(play, this, - ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_PLAYER_SETMOVE | ANIM_FLAG_NO_MOVE); + Player_StartAnimMovement( + play, this, ANIM_FLAG_UPDATE_XZ | ANIM_FLAG_ENABLE_MOVEMENT | ANIM_FLAG_ADJUST_STARTING_POS); } func_80832224(this); } - this->stateFlags1 |= PLAYER_STATE1_6 | PLAYER_STATE1_29; + this->stateFlags1 |= PLAYER_STATE1_TALKING | PLAYER_STATE1_29; } if ((this->naviActor == this->talkActor) && ((this->talkActor->textId & 0xFF00) != 0x200)) { diff --git a/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c b/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c index dc5eae3c5d..f107473306 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c +++ b/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c @@ -24,7 +24,7 @@ u32 EffectSsBlast_Init(PlayState* play, u32 index, EffectSs* this, void* initPar void EffectSsBlast_Update(PlayState* play, u32 index, EffectSs* this); void EffectSsBlast_Draw(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Blast_InitVars = { +EffectSsProfile Effect_Ss_Blast_Profile = { EFFECT_SS_BLAST, EffectSsBlast_Init, }; @@ -72,8 +72,7 @@ void EffectSsBlast_Draw(PlayState* play, u32 index, EffectSs* this) { this->rInnerColorA); Matrix_Put(&mf); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_blast.c", 199), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_ss_blast.c", 199); gSPDisplayList(POLY_XLU_DISP++, this->gfx); CLOSE_DISPS(gfxCtx, "../z_eff_ss_blast.c", 204); diff --git a/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h b/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h index 465997e758..b38f343e8e 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h +++ b/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsBlastParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c index 007e20c561..dcd74cbf12 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c +++ b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c @@ -16,7 +16,7 @@ u32 EffectSsBomb_Init(PlayState* play, u32 index, EffectSs* this, void* initPara void EffectSsBomb_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsBomb_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Bomb_InitVars = { +EffectSsProfile Effect_Ss_Bomb_Profile = { EFFECT_SS_BOMB, EffectSsBomb_Init, }; diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h index 1f7abc2f95..5d42b118c8 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h +++ b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsBombInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.c b/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.c index 217e2cf8dc..b493edee71 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.c +++ b/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.c @@ -24,7 +24,7 @@ void EffectSsBomb2_DrawFade(PlayState* play, u32 index, EffectSs* this); void EffectSsBomb2_DrawLayered(PlayState* play, u32 index, EffectSs* this); void EffectSsBomb2_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Bomb2_InitVars = { +EffectSsProfile Effect_Ss_Bomb2_Profile = { EFFECT_SS_BOMB2, EffectSsBomb2_Init, }; @@ -96,8 +96,6 @@ void EffectSsBomb2_DrawFade(PlayState* play, u32 index, EffectSs* this) { } if (1) {} - if (1) {} - CLOSE_DISPS(gfxCtx, "../z_eff_ss_bomb2.c", 345); } @@ -153,8 +151,7 @@ void EffectSsBomb2_DrawLayered(PlayState* play, u32 index, EffectSs* this) { Matrix_Translate(0.0f, 0.0f, depth, MTXMODE_APPLY); Matrix_RotateZ((this->life * 0.02f) + 180.0f, MTXMODE_APPLY); Matrix_Scale(layer2Scale, layer2Scale, layer2Scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_eff_ss_bomb2.c", 448), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_eff_ss_bomb2.c", 448); gSPDisplayList(POLY_XLU_DISP++, gEffBombExplosion3DL); layer2Scale -= 0.15f; } @@ -162,8 +159,6 @@ void EffectSsBomb2_DrawLayered(PlayState* play, u32 index, EffectSs* this) { } if (1) {} - if (1) {} - CLOSE_DISPS(gfxCtx, "../z_eff_ss_bomb2.c", 456); } diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h b/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h index 454303b50b..249a2a6507 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h +++ b/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsBomb2InitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c index 1602ee67be..ccd0e1ecac 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c +++ b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c @@ -13,7 +13,7 @@ u32 EffectSsBubble_Init(PlayState* play, u32 index, EffectSs* this, void* initPa void EffectSsBubble_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsBubble_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Bubble_InitVars = { +EffectSsProfile Effect_Ss_Bubble_Profile = { EFFECT_SS_BUBBLE, EffectSsBubble_Init, }; @@ -46,8 +46,7 @@ void EffectSsBubble_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_bubble.c", 167), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_eff_ss_bubble.c", 167); Gfx_SetupDL_25Opa(gfxCtx); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(POLY_OPA_DISP++, 150, 150, 150, 0); diff --git a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h index c8a77cfb3e..3c3c8f80df 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h +++ b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsBubbleInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ f32 yPosOffset; /* 0x10 */ f32 yPosRandScale; diff --git a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c index b1b7c713ae..b1e1190ef6 100644 --- a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c @@ -22,7 +22,7 @@ u32 EffectSsDFire_Init(PlayState* play, u32 index, EffectSs* this, void* initPar void EffectSsDFire_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsDFire_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_D_Fire_InitVars = { +EffectSsProfile Effect_Ss_D_Fire_Profile = { EFFECT_SS_D_FIRE, EffectSsDFire_Init, }; diff --git a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h index 44f891a2e8..c59c9add92 100644 --- a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h +++ b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsDFireInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c index 132871aae5..ef93269a93 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c @@ -24,7 +24,7 @@ u32 EffectSsDeadDb_Init(PlayState* play, u32 index, EffectSs* this, void* initPa void EffectSsDeadDb_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsDeadDb_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Dead_Db_InitVars = { +EffectSsProfile Effect_Ss_Dead_Db_Profile = { EFFECT_SS_DEAD_DB, EffectSsDeadDb_Init, }; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h index 62105f6201..0ea6bd0fda 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsDeadDbInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.c index dff7cea06f..ac0df1b437 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.c @@ -23,7 +23,7 @@ u32 EffectSsDeadDd_Init(PlayState* play, u32 index, EffectSs* this, void* initPa void EffectSsDeadDd_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsDeadDd_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Dead_Dd_InitVars = { +EffectSsProfile Effect_Ss_Dead_Dd_Profile = { EFFECT_SS_DEAD_DD, EffectSsDeadDd_Init, }; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h b/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h index 3b3281cde4..80d46899e7 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsDeadDdInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.c index 002cda2539..9d9c695d88 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.c @@ -21,7 +21,7 @@ u32 EffectSsDeadDs_Init(PlayState* play, u32 index, EffectSs* this, void* initPa void EffectSsDeadDs_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsDeadDs_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Dead_Ds_InitVars = { +EffectSsProfile Effect_Ss_Dead_Ds_Profile = { EFFECT_SS_DEAD_DS, EffectSsDeadDs_Init, }; @@ -99,8 +99,7 @@ void EffectSsDeadDs_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_RotateZYX(this->rRoll, this->rPitch, this->rYaw, MTXMODE_APPLY); Matrix_RotateX(1.57f, MTXMODE_APPLY); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_eff_ss_dead_ds.c", 246), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_eff_ss_dead_ds.c", 246); gDPSetCombineLERP(POLY_XLU_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); gSPDisplayList(POLY_XLU_DISP++, gLensFlareCircleDL); diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h b/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h index d6a9b9afb8..3714bf41ba 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsDeadDsInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c index dae17d0ff2..b1c92ec972 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c @@ -12,7 +12,7 @@ u32 EffectSsDeadSound_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx); void EffectSsDeadSound_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Dead_Sound_InitVars = { +EffectSsProfile Effect_Ss_Dead_Sound_Profile = { EFFECT_SS_DEAD_SOUND, EffectSsDeadSound_Init, }; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h b/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h index 624159f3d2..cdb20f640b 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsDeadSoundInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.c b/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.c index 49f3e66a0c..98e5c29155 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.c @@ -26,7 +26,7 @@ void EffectSsDtBubble_Update(PlayState* play, u32 index, EffectSs* this); static Color_RGBA8 sPrimColors[] = { { 255, 255, 100, 255 }, { 150, 255, 255, 255 }, { 100, 255, 255, 255 } }; static Color_RGBA8 sEnvColors[] = { { 170, 0, 0, 255 }, { 0, 100, 0, 255 }, { 0, 0, 255, 255 } }; -EffectSsInit Effect_Ss_Dt_Bubble_InitVars = { +EffectSsProfile Effect_Ss_Dt_Bubble_Profile = { EFFECT_SS_DT_BUBBLE, EffectSsDtBubble_Init, }; @@ -82,8 +82,7 @@ void EffectSsDtBubble_Draw(PlayState* play, u32 index, EffectSs* this) { scale = this->rScale * 0.004f; Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_dt_bubble.c", 213), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_ss_dt_bubble.c", 213); Gfx_SetupDL_25Xlu2(gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, (this->rPrimColorA * this->life) / this->rLifespan); diff --git a/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h b/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h index d7629b3b44..cac4c1a08c 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h +++ b/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsDtBubbleInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c index 155b3e802a..56d2d27d4a 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c @@ -26,7 +26,7 @@ void EffectSsDust_Update(PlayState* play, u32 index, EffectSs* this); void EffectSsDust_UpdateFire(PlayState* play, u32 index, EffectSs* this); void EffectSsDust_Draw(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Dust_InitVars = { +EffectSsProfile Effect_Ss_Dust_Profile = { EFFECT_SS_DUST, EffectSsDust_Init, }; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h index a56bc38f52..5cb686ae94 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h +++ b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsDustInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c index 302941ca49..73795ab2d4 100644 --- a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c @@ -22,7 +22,7 @@ u32 EffectSsEnFire_Init(PlayState* play, u32 index, EffectSs* this, void* initPa void EffectSsEnFire_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsEnFire_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_En_Fire_InitVars = { +EffectSsProfile Effect_Ss_En_Fire_Profile = { EFFECT_SS_EN_FIRE, EffectSsEnFire_Init, }; @@ -68,6 +68,7 @@ void EffectSsEnFire_Draw(PlayState* play, u32 index, EffectSs* this) { f32 scale; s16 camYaw; s32 pad[3]; + s16 intensity; s16 redGreen; OPEN_DISPS(gfxCtx, "../z_eff_en_fire.c", 169); @@ -78,15 +79,15 @@ void EffectSsEnFire_Draw(PlayState* play, u32 index, EffectSs* this) { scale = Math_SinS(this->life * 0x333) * (this->rScale * 0.00005f); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_eff_en_fire.c", 180), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_eff_en_fire.c", 180); - redGreen = this->life - 5; + intensity = this->life - 5; - if (redGreen < 0) { - redGreen = 0; + if (intensity < 0) { + intensity = 0; } + redGreen = intensity; Gfx_SetupDL_25Xlu(play->state.gfxCtx); gDPSetEnvColor(POLY_XLU_DISP++, redGreen * 12.7f, 0, 0, 0); gDPSetPrimColor(POLY_XLU_DISP++, 0x0, 0x80, redGreen * 12.7f, redGreen * 12.7f, 0, 255); @@ -103,12 +104,12 @@ void EffectSsEnFire_Draw(PlayState* play, u32 index, EffectSs* this) { CLOSE_DISPS(gfxCtx, "../z_eff_en_fire.c", 213); } -typedef struct { +typedef struct FireActorF { /* 0x000 */ Actor actor; /* 0x14C */ Vec3f firePos[10]; } FireActorF; -typedef struct { +typedef struct FireActorS { /* 0x000 */ Actor actor; /* 0x14C */ Vec3s firePos[10]; } FireActorS; diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h index bf8839be95..c511827ecf 100644 --- a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h +++ b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsEnFireInitParams { /* 0x00 */ Actor* actor; /* 0x04 */ Vec3f pos; /* 0x10 */ s16 scale; diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c index 16ea95d8de..5351e864ab 100644 --- a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c +++ b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c @@ -26,7 +26,7 @@ void EffectSsEnIce_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsEnIce_Update(PlayState* play, u32 index, EffectSs* this); void EffectSsEnIce_UpdateFlying(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_En_Ice_InitVars = { +EffectSsProfile Effect_Ss_En_Ice_Profile = { EFFECT_SS_EN_ICE, EffectSsEnIce_Init, }; @@ -113,8 +113,7 @@ void EffectSsEnIce_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); Matrix_RotateY(BINANG_TO_RAD(this->rYaw), MTXMODE_APPLY); Matrix_RotateX(BINANG_TO_RAD(this->rPitch), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_en_ice.c", 261), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_en_ice.c", 261); hiliteLightDir.x = 89.8f; hiliteLightDir.y = 0.0f; diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h index 985e37b84d..22929d39dd 100644 --- a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h +++ b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsEnIceInitParams { /* 0x00 */ Actor* actor; /* 0x04 */ Vec3f pos; /* 0x10 */ f32 scale; diff --git a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c index afce7ba019..99f8f19a2a 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c +++ b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c @@ -18,7 +18,7 @@ void EffectSsExtra_Update(PlayState* play, u32 index, EffectSs* this); static s16 sScores[] = { 30, 60, 100 }; -EffectSsInit Effect_Ss_Extra_InitVars = { +EffectSsProfile Effect_Ss_Extra_Profile = { EFFECT_SS_EXTRA, EffectSsExtra_Init, }; @@ -70,8 +70,7 @@ void EffectSsExtra_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); Gfx_SetupDL_25Xlu(play->state.gfxCtx); Matrix_ReplaceRotation(&play->billboardMtxF); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_eff_ss_extra.c", 186), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_eff_ss_extra.c", 186); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[this->rScoreIdx])); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, this->rScoreIdx); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_yabusame_point_DL_000DC0)); diff --git a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h index cc05775c21..c8047d21fa 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h +++ b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsExtraInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; @@ -12,7 +12,7 @@ typedef struct { /* 0x26 */ s16 scoreIdx; } EffectSsExtraInitParams; // size = 0x28 -typedef enum { +typedef enum ExtraScoreIdx { /* 0 */ EXTRA_SCORE_30, /* 1 */ EXTRA_SCORE_60, /* 2 */ EXTRA_SCORE_100 diff --git a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c index c3e7088f1b..6b07df0582 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c @@ -17,7 +17,7 @@ u32 EffectSsFcircle_Init(PlayState* play, u32 index, EffectSs* this, void* initP void EffectSsFcircle_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsFcircle_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Fcircle_InitVars = { +EffectSsProfile Effect_Ss_Fcircle_Profile = { EFFECT_SS_FCIRCLE, EffectSsFcircle_Init, }; @@ -58,8 +58,7 @@ void EffectSsFcircle_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); Matrix_Scale(xzScale, yScale, xzScale, MTXMODE_APPLY); Matrix_RotateY(BINANG_TO_RAD(this->rYaw), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_fcircle.c", 163), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_fcircle.c", 163); Gfx_SetupDL_25Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play->gameplayFrames % 128, 0, 32, 64, 1, 0, diff --git a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h index 01709c6aac..2e3eb74184 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h +++ b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsFcircleInitParams { /* 0x00 */ Actor* actor; /* 0x04 */ Vec3f pos; /* 0x10 */ s16 radius; diff --git a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c index c427ddca6b..c4ab534692 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c @@ -20,7 +20,7 @@ void EffectSsFhgFlash_UpdateLightBall(PlayState* play, u32 index, EffectSs* this void EffectSsFhgFlash_DrawShock(PlayState* play, u32 index, EffectSs* this); void EffectSsFhgFlash_UpdateShock(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Fhg_Flash_InitVars = { +EffectSsProfile Effect_Ss_Fhg_Flash_Profile = { EFFECT_SS_FHG_FLASH, EffectSsFhgFlash_Init, }; @@ -107,8 +107,7 @@ void EffectSsFhgFlash_DrawLightBall(PlayState* play, u32 index, EffectSs* this) gDPPipeSync(POLY_XLU_DISP++); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_RotateZ((this->rXZRot / (f32)0x8000) * 3.1416f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_fhg_flash.c", 326), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_fhg_flash.c", 326); gSPDisplayList(POLY_XLU_DISP++, this->gfx); CLOSE_DISPS(gfxCtx, "../z_eff_fhg_flash.c", 330); @@ -140,8 +139,7 @@ void EffectSsFhgFlash_DrawShock(PlayState* play, u32 index, EffectSs* this) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, this->rAlpha); gDPSetEnvColor(POLY_XLU_DISP++, 0, 255, 155, 0); Matrix_RotateZ((this->rXZRot / (f32)0x8000) * 3.1416f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_fhg_flash.c", 395), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_fhg_flash.c", 395); gSPDisplayList(POLY_XLU_DISP++, this->gfx); CLOSE_DISPS(gfxCtx, "../z_eff_fhg_flash.c", 399); diff --git a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h index 0d2d9616ef..f3c1ea6168 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h +++ b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h @@ -2,24 +2,26 @@ #define Z_EFF_SS_FHGFLASH_H #include "ultra64.h" -#include "global.h" +#include "z64math.h" -typedef struct { +struct Actor; + +typedef struct EffectSsFhgFlashInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; /* 0x24 */ s16 scale; /* 0x26 */ u8 param; - /* 0x28 */ Actor* actor; + /* 0x28 */ struct Actor* actor; /* 0x2C */ u8 type; } EffectSsFhgFlashInitParams; // size = 0x30 -typedef enum { +typedef enum FhgFlashType { /* 0x00 */ FHGFLASH_LIGHTBALL, /* 0x01 */ FHGFLASH_SHOCK } FhgFlashType; -typedef enum { +typedef enum FhgFlashLightBallParam { /* 0x00 */ FHGFLASH_LIGHTBALL_GREEN, /* 0x01 */ FHGFLASH_LIGHTBALL_LIGHTBLUE, /* 0x02 */ FHGFLASH_LIGHTBALL_RED, @@ -31,7 +33,7 @@ typedef enum { /* 0x08 */ FHGFLASH_LIGHTBALL_WHITE2 } FhgFlashLightBallParam; -typedef enum { +typedef enum FhgFlashLightningParam { /* 0x00 */ FHGFLASH_SHOCK_NO_ACTOR, // Don't attach to any actor. Stays at a fixed position. /* 0x01 */ FHGFLASH_SHOCK_PLAYER, // Move to a random Player body part every frame. /* 0x02 */ FHGFLASH_SHOCK_PG // Move to a random Phantom Ganon body part every frame. diff --git a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c index a08d8af131..089c7f73eb 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c @@ -25,7 +25,7 @@ u32 EffectSsFireTail_Init(PlayState* play, u32 index, EffectSs* this, void* init void EffectSsFireTail_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsFireTail_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Fire_Tail_InitVars = { +EffectSsProfile Effect_Ss_Fire_Tail_Profile = { EFFECT_SS_FIRE_TAIL, EffectSsFireTail_Init, }; @@ -119,8 +119,7 @@ void EffectSsFireTail_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_Scale(1.0f, temp1, 1.0f / temp1, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_eff_fire_tail.c", 238), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_eff_fire_tail.c", 238); Gfx_SetupDL_25Xlu(play->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, 255); gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, 0); diff --git a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h index 48b2079448..70f5df7e19 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h +++ b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsFireTailInitParams { /* 0x00 */ Actor* actor; /* 0x04 */ Vec3f pos; /* 0x10 */ f32 scale; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.c b/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.c index d82c9cb417..351fadab7c 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.c @@ -11,7 +11,7 @@ u32 EffectSsGFire_Init(PlayState* play, u32 index, EffectSs* this, void* initPar void EffectSsGFire_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsGFire_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_G_Fire_InitVars = { +EffectSsProfile Effect_Ss_G_Fire_Profile = { EFFECT_SS_G_FIRE, EffectSsGFire_Init, }; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h b/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h index 1fb6af2f2e..cfb5dcfafb 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h +++ b/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsGFireInitParams { /* 0x00 */ Vec3f pos; } EffectSsGFireInitParams; // size = 0xC diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.c b/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.c index 4e9dc378af..f93bb0e7d6 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.c @@ -11,7 +11,7 @@ u32 EffectSsGMagma_Init(PlayState* play, u32 index, EffectSs* this, void* initPa void EffectSsGMagma_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsGMagma_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_G_Magma_InitVars = { +EffectSsProfile Effect_Ss_G_Magma_Profile = { EFFECT_SS_G_MAGMA, EffectSsGMagma_Init, }; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h b/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h index a63e567e5e..ab1b97a1de 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h +++ b/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsGMagmaInitParams { /* 0x00 */ Vec3f pos; } EffectSsGMagmaInitParams; // size = 0xC diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c index 220c76d9d0..233385aee3 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c @@ -32,7 +32,7 @@ static void* sTextures[] = { object_kingdodongo_Tex_0308E0, }; -EffectSsInit Effect_Ss_G_Magma2_InitVars = { +EffectSsProfile Effect_Ss_G_Magma2_Profile = { EFFECT_SS_G_MAGMA2, EffectSsGMagma2_Init, }; @@ -87,8 +87,7 @@ void EffectSsGMagma2_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr); gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_g_magma2.c", 282), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_ss_g_magma2.c", 282); if (this->rDrawMode == 0) { POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_61); diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h index d1993832c9..715e01e7db 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h +++ b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsGMagma2InitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Color_RGBA8 primColor; /* 0x10 */ Color_RGBA8 envColor; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.c b/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.c index c629cecbad..48a2eec4f0 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.c @@ -24,7 +24,7 @@ u32 EffectSsGRipple_Init(PlayState* play, u32 index, EffectSs* this, void* initP void EffectSsGRipple_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsGRipple_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_G_Ripple_InitVars = { +EffectSsProfile Effect_Ss_G_Ripple_Profile = { EFFECT_SS_G_RIPPLE, EffectSsGRipple_Init, }; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h b/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h index afe8e89e10..63487ee0ca 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h +++ b/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsGRippleInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ s16 radius; /* 0x0E */ s16 radiusMax; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c index ca7fda5275..7f357013e4 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c @@ -24,7 +24,7 @@ void EffectSsGSpk_Update(PlayState* play, u32 index, EffectSs* this); void EffectSsGSpk_UpdateNoAccel(PlayState* play, u32 index, EffectSs* this); void EffectSsGSpk_Draw(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_G_Spk_InitVars = { +EffectSsProfile Effect_Ss_G_Spk_Profile = { EFFECT_SS_G_SPK, EffectSsGSpk_Init, }; @@ -103,8 +103,6 @@ void EffectSsGSpk_Draw(PlayState* play, u32 index, EffectSs* this) { } if (1) {} - if (1) {} - CLOSE_DISPS(gfxCtx, "../z_eff_ss_g_spk.c", 255); } diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h index a4a22cef1f..8627bc0528 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h +++ b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsGSpkInitParams { /* 0x00 */ Actor* actor; /* 0x04 */ Vec3f pos; /* 0x10 */ Vec3f velocity; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c index fe65984f59..4e7c26308c 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c @@ -15,7 +15,7 @@ u32 EffectSsGSplash_Init(PlayState* play, u32 index, EffectSs* this, void* initP void EffectSsGSplash_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsGSplash_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_G_Splash_InitVars = { +EffectSsProfile Effect_Ss_G_Splash_Profile = { EFFECT_SS_G_SPLASH, EffectSsGSplash_Init, }; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h index b761ce332e..c13e19cd1c 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h +++ b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsGSplashInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ u8 type; /* 0x0D */ u8 customColor; diff --git a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c index 2085eff571..9b27081773 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c +++ b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c @@ -20,7 +20,7 @@ void EffectSsHahen_DrawGray(PlayState* play, u32 index, EffectSs* this); void EffectSsHahen_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsHahen_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Hahen_InitVars = { +EffectSsProfile Effect_Ss_Hahen_Profile = { EFFECT_SS_HAHEN, EffectSsHahen_Init, }; @@ -81,8 +81,7 @@ void EffectSsHahen_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_RotateY(this->rYaw * 0.01f, MTXMODE_APPLY); Matrix_RotateX(this->rPitch * 0.01f, MTXMODE_APPLY); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_hahen.c", 228), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_eff_hahen.c", 228); Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, this->gfx); @@ -105,8 +104,7 @@ void EffectSsHahen_DrawGray(PlayState* play, u32 index, EffectSs* this) { Matrix_RotateY(this->rYaw * 0.01f, MTXMODE_APPLY); Matrix_RotateX(this->rPitch * 0.01f, MTXMODE_APPLY); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_hahen.c", 271), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_eff_hahen.c", 271); Gfx_SetupDL_25Opa(play->state.gfxCtx); gDPSetCombineLERP(POLY_OPA_DISP++, SHADE, 0, PRIMITIVE, 0, SHADE, 0, PRIMITIVE, 0, SHADE, 0, PRIMITIVE, 0, SHADE, 0, PRIMITIVE, 0); diff --git a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h index 9906994317..1385bee8c8 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h +++ b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsHahenInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c index 34d85deee4..62dd6d9f89 100644 --- a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c +++ b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c @@ -5,6 +5,7 @@ */ #include "z_eff_ss_hitmark.h" +#include "global.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #define rTexIndex regs[0] @@ -36,7 +37,7 @@ static void* sTextures[] = { gEffHitMark7Tex, gEffHitMark8Tex, }; -EffectSsInit Effect_Ss_HitMark_InitVars = { +EffectSsProfile Effect_Ss_HitMark_Profile = { EFFECT_SS_HITMARK, EffectSsHitMark_Init, }; diff --git a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h index 74f8e7f80b..591ba5a7d0 100644 --- a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h +++ b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h @@ -2,15 +2,15 @@ #define Z_EFF_SS_HITMARK_H #include "ultra64.h" -#include "global.h" +#include "z64math.h" -typedef struct { +typedef struct EffectSsHitMarkInitParams { /* 0x00 */ s32 type; /* 0x04 */ s16 scale; /* 0x08 */ Vec3f pos; } EffectSsHitMarkInitParams; // size = 0x14 -typedef enum { +typedef enum EffectSsHitmarkType { EFFECT_HITMARK_WHITE, EFFECT_HITMARK_DUST, EFFECT_HITMARK_RED, diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c index 3a1387276b..7f0fc02fa1 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c +++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c @@ -17,7 +17,7 @@ u32 EffectSsIcePiece_Init(PlayState* play, u32 index, EffectSs* this, void* init void EffectSsIcePiece_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsIcePiece_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Ice_Piece_InitVars = { +EffectSsProfile Effect_Ss_Ice_Piece_Profile = { EFFECT_SS_ICE_PIECE, EffectSsIcePiece_Init, }; @@ -65,8 +65,7 @@ void EffectSsIcePiece_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); Matrix_RotateY(BINANG_TO_RAD(this->rYaw), MTXMODE_APPLY); Matrix_RotateX(BINANG_TO_RAD(this->rPitch), MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ice_piece.c", 185), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_ice_piece.c", 185); Gfx_SetupDL_25Xlu(play->state.gfxCtx); gDPSetEnvColor(POLY_XLU_DISP++, 0, 50, 100, (s32)alpha & 0xFF); func_8003435C(&this->pos, play); diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h index 2a697d74e3..f7b376a7ad 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h +++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsIcePieceInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ f32 scale; /* 0x10 */ Vec3f velocity; diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c index 3e8c54d8ae..9997240be7 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c +++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c @@ -15,7 +15,7 @@ u32 EffectSsIceSmoke_Init(PlayState* play, u32 index, EffectSs* this, void* init void EffectSsIceSmoke_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsIceSmoke_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Ice_Smoke_InitVars = { +EffectSsProfile Effect_Ss_Ice_Smoke_Profile = { EFFECT_SS_ICE_SMOKE, EffectSsIceSmoke_Init, }; @@ -51,23 +51,19 @@ u32 EffectSsIceSmoke_Init(PlayState* play, u32 index, EffectSs* this, void* init } void EffectSsIceSmoke_Draw(PlayState* play, u32 index, EffectSs* this) { - s32 pad; + PlayState* play2 = (PlayState*)play; void* objectPtr; Mtx* mtx; f32 scale; s32 objectSlot; - objectPtr = play->objectCtx.slots[this->rObjectSlot].segment; + objectPtr = play2->objectCtx.slots[this->rObjectSlot].segment; OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_ice_smoke.c", 155); -#if !IS_DEBUG - if (1) {} -#endif - - objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_FZ); + objectSlot = Object_GetSlot(&play2->objectCtx, OBJECT_FZ); - if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) { + if ((objectSlot >= 0) && Object_IsLoaded(&play2->objectCtx, objectSlot)) { gDPPipeSync(POLY_XLU_DISP++); Gfx_SetupDL_25Xlu(play->state.gfxCtx); gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr); @@ -79,13 +75,14 @@ void EffectSsIceSmoke_Draw(PlayState* play, u32 index, EffectSs* this) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, this->life * 3, this->life * 15, 32, 64, 1, 0, 0, 32, 32)); Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); - Matrix_ReplaceRotation(&play->billboardMtxF); + Matrix_ReplaceRotation(&play2->billboardMtxF); scale = this->rScale * 0.0001f; Matrix_Scale(scale, scale, 1.0f, MTXMODE_APPLY); - mtx = MATRIX_NEW(play->state.gfxCtx, "../z_eff_ss_ice_smoke.c", 196); + mtx = MATRIX_FINALIZE(play->state.gfxCtx, "../z_eff_ss_ice_smoke.c", 196); if (mtx != NULL) { + if (1) {} gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gFreezardSteamDL)); } diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h index 08fc6f7451..64833be518 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h +++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsIceSmokeInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c b/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c index 5a613a2f84..10a3b668ab 100644 --- a/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c @@ -18,7 +18,7 @@ u32 EffectSsKFire_Init(PlayState* play, u32 index, EffectSs* this, void* initPar void EffectSsKFire_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsKFire_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_K_Fire_InitVars = { +EffectSsProfile Effect_Ss_K_Fire_Profile = { EFFECT_SS_K_FIRE, EffectSsKFire_Init, }; @@ -75,8 +75,7 @@ void EffectSsKFire_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_RotateY(M_PI, MTXMODE_APPLY); } - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_eff_k_fire.c", 215), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_eff_k_fire.c", 215); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); CLOSE_DISPS(gfxCtx, "../z_eff_k_fire.c", 220); diff --git a/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h b/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h index e8b2c617ca..1896b47a73 100644 --- a/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h +++ b/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsKFireInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c index 7a2684f485..f3ccd4572a 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c @@ -26,7 +26,7 @@ void EffectSsKakera_Update(PlayState* play, u32 index, EffectSs* this); void func_809A9BA8(EffectSs* this, PlayState* play); -EffectSsInit Effect_Ss_Kakera_InitVars = { +EffectSsProfile Effect_Ss_Kakera_Profile = { EFFECT_SS_KAKERA, EffectSsKakera_Init, }; @@ -114,8 +114,7 @@ void EffectSsKakera_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); if ((((this->rReg4 >> 7) & 1) << 7) == 0x80) { - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_kakera.c", 268), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_kakera.c", 268); Gfx_SetupDL_25Xlu(play->state.gfxCtx); if (colorIdx >= 0) { @@ -124,8 +123,7 @@ void EffectSsKakera_Draw(PlayState* play, u32 index, EffectSs* this) { gSPDisplayList(POLY_XLU_DISP++, this->gfx); } else { - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_kakera.c", 286), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_eff_kakera.c", 286); Gfx_SetupDL_25Opa(play->state.gfxCtx); if (colorIdx >= 0) { diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h index 17a4c8da1a..bd55d5c3c5 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsKakeraInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f unk_18; @@ -24,7 +24,7 @@ typedef struct { #define KAKERA_OBJECT_DEFAULT -1 -typedef enum { +typedef enum KakeraColorIndex { /* -1 */ KAKERA_COLOR_NONE = -1, /* 0 */ KAKERA_COLOR_WHITE, /* 1 */ KAKERA_COLOR_BROWN diff --git a/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.c b/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.c index 09f9e79179..5973ca9e1e 100644 --- a/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.c +++ b/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.c @@ -27,7 +27,7 @@ void func_809AABF0(PlayState* play, u32 index, EffectSs* this); void func_809AACAC(PlayState* play, u32 index, EffectSs* this); void func_809AAD6C(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_KiraKira_InitVars = { +EffectSsProfile Effect_Ss_KiraKira_Profile = { EFFECT_SS_KIRAKIRA, EffectSsKiraKira_Init, }; diff --git a/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h b/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h index 290fec68d2..7f8c18da3e 100644 --- a/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h +++ b/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsKiraKiraInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.c b/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.c index 3fdef111d6..a204eb72fa 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.c +++ b/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.c @@ -24,7 +24,7 @@ u32 EffectSsLightning_Init(PlayState* play, u32 index, EffectSs* this, void* ini void EffectSsLightning_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsLightning_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Lightning_InitVars = { +EffectSsProfile Effect_Ss_Lightning_Profile = { EFFECT_SS_LIGHTNING, EffectSsLightning_Init, }; diff --git a/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h b/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h index 758f2cce65..ad352e9013 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h +++ b/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsLightningInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Color_RGBA8 primColor; /* 0x10 */ Color_RGBA8 envColor; diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c index 5ee3a70cb8..f707251cba 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c +++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c @@ -23,7 +23,7 @@ u32 EffectSsSibuki_Init(PlayState* play, u32 index, EffectSs* this, void* initPa void EffectSsSibuki_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsSibuki_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Sibuki_InitVars = { +EffectSsProfile Effect_Ss_Sibuki_Profile = { EFFECT_SS_SIBUKI, EffectSsSibuki_Init, }; @@ -67,8 +67,7 @@ void EffectSsSibuki_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_sibuki.c", 176), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_eff_ss_sibuki.c", 176); Gfx_SetupDL_25Opa(gfxCtx); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, this->rPrimColorA); gDPSetEnvColor(POLY_OPA_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, this->rEnvColorA); diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h index 321fd334e6..18aaf0d200 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h +++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsSibukiInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.c b/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.c index f5b5135da0..100c2bd6cf 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.c +++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.c @@ -22,7 +22,7 @@ u32 EffectSsSibuki2_Init(PlayState* play, u32 index, EffectSs* this, void* initP void EffectSsSibuki2_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsSibuki2_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Sibuki2_InitVars = { +EffectSsProfile Effect_Ss_Sibuki2_Profile = { EFFECT_SS_SIBUKI2, EffectSsSibuki2_Init, }; @@ -64,8 +64,7 @@ void EffectSsSibuki2_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_sibuki2.c", 171), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_ss_sibuki2.c", 171); Gfx_SetupDL_25Opa(gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, this->rPrimColorA); gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, this->rEnvColorA); diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h b/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h index c0201fba0c..7fb20d8b33 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h +++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsSibuki2InitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c index 1667ac8983..ed1d5edccf 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c +++ b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c @@ -11,7 +11,7 @@ u32 EffectSsSolderSrchBall_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx); void EffectSsSolderSrchBall_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Solder_Srch_Ball_InitVars = { +EffectSsProfile Effect_Ss_Solder_Srch_Ball_Profile = { EFFECT_SS_SOLDER_SRCH_BALL, EffectSsSolderSrchBall_Init, }; diff --git a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h index e29ca6e3f6..70aa558b65 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h +++ b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsSolderSrchBallInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f velocity; /* 0x18 */ Vec3f accel; diff --git a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c index 5a5362bb45..ba327e465a 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c +++ b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c @@ -15,12 +15,12 @@ u32 EffectSsStick_Init(PlayState* play, u32 index, EffectSs* this, void* initPar void EffectSsStick_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsStick_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Stick_InitVars = { +EffectSsProfile Effect_Ss_Stick_Profile = { EFFECT_SS_STICK, EffectSsStick_Init, }; -typedef struct { +typedef struct StickDrawInfo { /* 0x00 */ s16 objectId; /* 0x04 */ Gfx* displayList; } StickDrawInfo; @@ -64,8 +64,7 @@ void EffectSsStick_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_RotateZYX(0, this->rYaw, play->state.frames * 10000, MTXMODE_APPLY); } - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_stick.c", 176), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_eff_ss_stick.c", 176); Gfx_SetupDL_25Opa(gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->rObjectSlot].segment); gSPSegment(POLY_OPA_DISP++, 0x0C, gCullBackDList); diff --git a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h index a3df5491c6..8e01aeb003 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h +++ b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsStickInitParams { /* 0x00 */ Vec3f pos; /* 0x0C */ s16 yaw; } EffectSsStickInitParams; // size = 0x10 diff --git a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c index b80f25a430..2de7568478 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c +++ b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c @@ -13,12 +13,12 @@ u32 EffectSsStone1_Init(PlayState* play, u32 index, EffectSs* this, void* initPa void EffectSsStone1_Draw(PlayState* play, u32 index, EffectSs* this); void EffectSsStone1_Update(PlayState* play, u32 index, EffectSs* this); -EffectSsInit Effect_Ss_Stone1_InitVars = { +EffectSsProfile Effect_Ss_Stone1_Profile = { EFFECT_SS_STONE1, EffectSsStone1_Init, }; -typedef struct { +typedef struct EffStoneDrawInfo { /* 0x00 */ void* texture; /* 0x04 */ Color_RGBA8 primColor; /* 0x08 */ Color_RGBA8 envColor; @@ -63,9 +63,7 @@ void EffectSsStone1_Draw(PlayState* play, u32 index, EffectSs* this) { scale = (mfW < 1500.0f) ? 3.0f : (mfW / 1500.0f) * 3.0f; Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - if (1) {} - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_stone1.c", 168), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_ss_stone1.c", 168); Gfx_SetupDL_61Xlu(gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(drawParams->texture)); IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, this->life); diff --git a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h index 680345014f..d329161277 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h +++ b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -typedef struct { +typedef struct EffectSsStone1InitParams { /* 0x00 */ Vec3f pos; /* 0x00 */ s32 unk_C; } EffectSsStone1InitParams; // size = 0x diff --git a/src/overlays/gamestates/ovl_file_choose/file_select.h b/src/overlays/gamestates/ovl_file_choose/file_select.h index b4d0db5b24..465d017ed0 100644 --- a/src/overlays/gamestates/ovl_file_choose/file_select.h +++ b/src/overlays/gamestates/ovl_file_choose/file_select.h @@ -4,6 +4,7 @@ #include "libc/stddef.h" #include "ultra64.h" #include "global.h" +#include "versions.h" #define GET_NEWF(sramCtx, slotNum, index) (sramCtx->readBuff[gSramSlotOffsets[slotNum] + offsetof(SaveContext, save.info.playerData.newf[index])]) @@ -16,16 +17,16 @@ (GET_NEWF(sramCtx, slotNum, 4) == 'A') || \ (GET_NEWF(sramCtx, slotNum, 5) == 'Z')) -// Init mode: Initial setup as the file select is starting up, fades and slides in various menu elements +// Init mode: Loads saves from SRAM, handles initial language selection in PAL N64 versions // Config mode: Handles the bulk of the file select, various configuration tasks like picking a file, copy/erase, and the options menu // Select mode: Displays the selected file with various details about it, and allows the player to confirm and open it -typedef enum { +typedef enum MenuMode { /* 0 */ FS_MENU_MODE_INIT, /* 1 */ FS_MENU_MODE_CONFIG, /* 2 */ FS_MENU_MODE_SELECT } MenuMode; -typedef enum { +typedef enum ConfigMode { /* 00 */ CM_FADE_IN_START, /* 01 */ CM_FADE_IN_END, /* 02 */ CM_MAIN_MENU, @@ -69,7 +70,7 @@ typedef enum { /* 40 */ CM_UNUSED_DELAY } ConfigMode; -typedef enum { +typedef enum SelectMode { /* 0 */ SM_FADE_MAIN_TO_SELECT, /* 1 */ SM_MOVE_FILE_TO_TOP, /* 2 */ SM_FADE_IN_FILE_INFO, @@ -80,7 +81,7 @@ typedef enum { /* 7 */ SM_LOAD_GAME } SelectMode; -typedef enum { +typedef enum TitleLabel { /* 0 */ FS_TITLE_SELECT_FILE, // "Please select a file." /* 1 */ FS_TITLE_OPEN_FILE, // "Open this file?" /* 2 */ FS_TITLE_COPY_FROM, // "Copy which file?" @@ -92,7 +93,7 @@ typedef enum { /* 8 */ FS_TITLE_ERASE_COMPLETE // "File erased." } TitleLabel; -typedef enum { +typedef enum WarningLabel { /* -1 */ FS_WARNING_NONE = -1, /* 0 */ FS_WARNING_NO_FILE_COPY, // "No file to copy." /* 1 */ FS_WARNING_NO_FILE_ERASE, // "No file to erase." @@ -101,7 +102,7 @@ typedef enum { /* 4 */ FS_WARNING_FILE_IN_USE // "This file is in use." } WarningLabel; -typedef enum { +typedef enum MainMenuButtonIndex { /* 0 */ FS_BTN_MAIN_FILE_1, /* 1 */ FS_BTN_MAIN_FILE_2, /* 2 */ FS_BTN_MAIN_FILE_3, @@ -110,21 +111,21 @@ typedef enum { /* 5 */ FS_BTN_MAIN_OPTIONS } MainMenuButtonIndex; -typedef enum { +typedef enum CopyMenuButtonIndex { /* 0 */ FS_BTN_COPY_FILE_1, /* 1 */ FS_BTN_COPY_FILE_2, /* 2 */ FS_BTN_COPY_FILE_3, /* 3 */ FS_BTN_COPY_QUIT } CopyMenuButtonIndex; -typedef enum { +typedef enum EraseMenuButtonIndex { /* 0 */ FS_BTN_ERASE_FILE_1, /* 1 */ FS_BTN_ERASE_FILE_2, /* 2 */ FS_BTN_ERASE_FILE_3, /* 3 */ FS_BTN_ERASE_QUIT } EraseMenuButtonIndex; -typedef enum { +typedef enum SelectMenuButtonIndex { /* 0 */ FS_BTN_SELECT_FILE_1, /* 1 */ FS_BTN_SELECT_FILE_2, /* 2 */ FS_BTN_SELECT_FILE_3, @@ -132,35 +133,45 @@ typedef enum { /* 4 */ FS_BTN_SELECT_QUIT } SelectMenuButtonIndex; -typedef enum { +typedef enum ConfirmButtonIndex { /* 0 */ FS_BTN_CONFIRM_YES, /* 1 */ FS_BTN_CONFIRM_QUIT } ConfirmButtonIndex; -typedef enum { +typedef enum ActionButtonIndex { /* 0 */ FS_BTN_ACTION_COPY, /* 1 */ FS_BTN_ACTION_ERASE } ActionButtonIndex; -typedef enum { +typedef enum SettingIndex { /* 0 */ FS_SETTING_AUDIO, - /* 1 */ FS_SETTING_TARGET + /* 1 */ FS_SETTING_TARGET, +#if OOT_PAL_N64 + /* 2 */ FS_SETTING_LANGUAGE, +#endif + /* */ FS_SETTING_MAX } SettingIndex; -typedef enum { +typedef enum AudioOption { /* 0 */ FS_AUDIO_STEREO, /* 1 */ FS_AUDIO_MONO, /* 2 */ FS_AUDIO_HEADSET, /* 3 */ FS_AUDIO_SURROUND } AudioOption; -typedef enum { +typedef enum CharPage { /* 0 */ FS_CHAR_PAGE_HIRA, /* 1 */ FS_CHAR_PAGE_KATA, - /* 2 */ FS_CHAR_PAGE_ENG + /* 2 */ FS_CHAR_PAGE_ENG, + /* 3 */ FS_CHAR_PAGE_HIRA_TO_KATA, + /* 4 */ FS_CHAR_PAGE_KATA_TO_HIRA, + /* 5 */ FS_CHAR_PAGE_HIRA_TO_ENG, + /* 6 */ FS_CHAR_PAGE_ENG_TO_HIRA, + /* 7 */ FS_CHAR_PAGE_KATA_TO_ENG, + /* 8 */ FS_CHAR_PAGE_ENG_TO_KATA } CharPage; -typedef enum { +typedef enum KeyboardButton { /* 00 */ FS_KBD_BTN_HIRA, /* 01 */ FS_KBD_BTN_KATA, /* 02 */ FS_KBD_BTN_ENG, @@ -214,6 +225,8 @@ void FileSelect_DrawOptions(GameState* thisx); void FileSelect_DrawNameEntry(GameState* thisx); void FileSelect_DrawCharacter(GraphicsContext* gfxCtx, void* texture, s16 vtx); -extern s16 D_808123F0[]; +#if OOT_VERSION == PAL_1_1 +extern s16 D_808124C0[]; +#endif #endif diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index d0a3aef923..7e4f1cde9b 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -1,7 +1,53 @@ #include "file_select.h" #include "terminal.h" +#include "versions.h" +#if OOT_PAL_N64 +#include "assets/objects/object_mag/object_mag.h" +#endif #include "assets/textures/title_static/title_static.h" #include "assets/textures/parameter_static/parameter_static.h" +#if PLATFORM_N64 +#include "n64dd.h" +#endif + +#if OOT_PAL_N64 +static s32 sInitialLanguageAlphaAsInt = 100; +static f32 sInitialLanguageAlphaStep = 8.0f; +static f32 sInitialLanguageAlpha = 100.0f; + +static s16 sInitialLanguageStickAdjX; +static s16 sInitialLanguageStickXDir; +static s16 sInitialLanguageInputTimerX; + +typedef struct InitialLanguageTextureInfo { + /* 0x00 */ void* texture; + /* 0x04 */ u16 width; + /* 0x06 */ u16 height; + /* 0x08 */ u32 x1; + /* 0x0C */ u32 y1; + /* 0x10 */ u32 x2; + /* 0x14 */ u32 y2; +} InitialLanguageTextureInfo; // size = 0x18 + +static InitialLanguageTextureInfo sInitialLanguageTextures[] = { + { gFileSelInitialLanguageChoiceENGTex, 80, 32, 40, 70, 120, 102 }, + { gFileSelInitialLanguageChoiceGERTex, 80, 32, 120, 70, 200, 102 }, + { gFileSelInitialLanguageChoiceFRATex, 80, 32, 200, 70, 280, 102 }, +}; + +typedef struct InitialLanguageCursorInfo { + /* 0x00 */ u32 x1; + /* 0x04 */ u32 y1; + /* 0x08 */ u32 x2; + /* 0x0C */ u32 y2; +} InitialLanguageCursorInfo; // size = 0x10 + +static InitialLanguageCursorInfo sInitialLanguageCursors[] = { + { 48, 52, 120, 124 }, + { 128, 52, 200, 124 }, + { 208, 52, 280, 124 }, +}; +#endif static s16 sUnused = 106; @@ -25,6 +71,233 @@ static s16 sWindowContentColors[2][3] = { { 100, 100, 100 }, // gray }; +#if OOT_PAL_N64 +void FileSelect_UpdateInitialLanguageMenu(FileSelectState* this) { + SramContext* sramCtx = &this->sramCtx; + Input* input = &this->state.input[0]; + + if (gSaveContext.language >= LANGUAGE_MAX) { + gSaveContext.language = 0; + } + + sInitialLanguageAlpha += sInitialLanguageAlphaStep; + if (sInitialLanguageAlphaStep < 0.0f) { + if (sInitialLanguageAlpha < 100.0f) { + sInitialLanguageAlpha = 100.0f; + sInitialLanguageAlphaStep *= -1.0f; + } + } else if (sInitialLanguageAlphaStep > 0.0f) { + if (sInitialLanguageAlpha > 255.0f) { + sInitialLanguageAlpha = 255.0f; + sInitialLanguageAlphaStep *= -1.0f; + } + } + + sInitialLanguageAlphaAsInt = (s32)sInitialLanguageAlpha; + sInitialLanguageStickAdjX = (s16)input->rel.stick_x; + if (sInitialLanguageStickAdjX < -30) { + if (sInitialLanguageStickXDir == -1) { + sInitialLanguageInputTimerX -= 1; + if (sInitialLanguageInputTimerX < 0) { + sInitialLanguageInputTimerX = 2; + } else { + sInitialLanguageStickAdjX = 0; + } + } else { + sInitialLanguageInputTimerX = 10; + sInitialLanguageStickXDir = -1; + } + } else if (sInitialLanguageStickAdjX > 30) { + if (sInitialLanguageStickXDir == 1) { + sInitialLanguageInputTimerX -= 1; + if (sInitialLanguageInputTimerX < 0) { + sInitialLanguageInputTimerX = 2; + } else { + sInitialLanguageStickAdjX = 0; + } + } else { + sInitialLanguageInputTimerX = 10; + sInitialLanguageStickXDir = 1; + } + } else { + sInitialLanguageStickXDir = 0; + } + + if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_B) || + CHECK_BTN_ALL(input->press.button, BTN_START)) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + sramCtx->readBuff[2] = gSaveContext.language; + Sram_WriteSramHeader(sramCtx); + this->configMode++; + return; + } + + if (sInitialLanguageStickAdjX < -30) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + gSaveContext.language--; + if (gSaveContext.language >= LANGUAGE_MAX) { + gSaveContext.language = LANGUAGE_MAX - 1; + } + } else if (sInitialLanguageStickAdjX > 30) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + gSaveContext.language++; + if (gSaveContext.language >= LANGUAGE_MAX) { + gSaveContext.language = 0; + } + } +} + +void FileSelect_DrawImageRGBA32(GraphicsContext* gfxCtx, s16 centerX, s16 centerY, u8* source, u32 width, u32 height) { + u8* curTexture; + s32 textureCount; + s32 rectLeft; + s32 rectTop; + u32 textureHeight; + s32 remainingSize; + s32 textureSize; + s32 pad; + s32 i; + + OPEN_DISPS(gfxCtx, "../z_file_choose.c", 0); + + Gfx_SetupDL_56Opa(gfxCtx); + + curTexture = source; + rectLeft = centerX - (width / 2); + rectTop = centerY - (height / 2); + remainingSize = (width * height) << 2; + textureHeight = 4096 / (width << 2); + textureSize = (width * textureHeight) << 2; + textureCount = remainingSize / textureSize; + if ((remainingSize % textureSize) != 0) { + textureCount++; + } + + gDPSetTileCustom(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 0, 0, width - 1, textureHeight - 1, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + + remainingSize -= textureSize; + + for (i = 0; i < textureCount; i++) { + gDPSetTextureImage(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_32b, width, curTexture); + + gDPLoadSync(POLY_OPA_DISP++); + gDPLoadTile(POLY_OPA_DISP++, G_TX_LOADTILE, 0, 0, (width - 1) << 2, (textureHeight - 1) << 2); + + gSPTextureRectangle(POLY_OPA_DISP++, rectLeft << 2, rectTop << 2, (rectLeft + (s32)width) << 2, + (rectTop + textureHeight) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + + curTexture += textureSize; + rectTop += textureHeight; + + if ((remainingSize - textureSize) < 0) { + if (remainingSize > 0) { + textureHeight = remainingSize / (s32)(width << 2); + remainingSize -= textureSize; + + gDPSetTileCustom(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 0, 0, width - 1, textureHeight - 1, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); + } + } else { + remainingSize -= textureSize; + } + } + + CLOSE_DISPS(gfxCtx, "../z_file_choose.c", 0); +} + +void FileSelect_DrawInitialLanguageMenu(FileSelectState* this) { + u8* source; + s32 i; + s32 y1; + s32 y2; + + OPEN_DISPS(this->state.gfxCtx, "../z_file_choose.c", 0); + + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 70 + WREG(0)); + FileSelect_DrawImageRGBA32(this->state.gfxCtx, 160, 85 + WREG(1), (u8*)gTitleZeldaShieldLogoTex, 160, 160); + + Gfx_SetupDL_39Opa(this->state.gfxCtx); + + gDPSetAlphaCompare(POLY_OPA_DISP++, G_AC_NONE); + gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); + + gDPLoadTextureBlock(POLY_OPA_DISP++, gTitleCopyright1998Tex, G_IM_FMT_IA, G_IM_SIZ_8b, 128, 16, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + + gSPTextureRectangle(POLY_OPA_DISP++, 94 << 2, 198 << 2, 222 << 2, 214 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, + 1 << 10); + + Gfx_SetupDL_39Opa(this->state.gfxCtx); + + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 100, 100, 255, sInitialLanguageAlphaAsInt); + + gDPLoadTextureBlock_4b(POLY_OPA_DISP++, gFileSelInitialLanguageCursorTex, G_IM_FMT_I, 48, 48, 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); + + gSPTextureRectangle(POLY_OPA_DISP++, (sInitialLanguageCursors[gSaveContext.language].x1 + GREG(1)) << 2, + (sInitialLanguageCursors[gSaveContext.language].y1 + GREG(2)) << 2, + (sInitialLanguageCursors[gSaveContext.language].x2 + GREG(1)) << 2, + (sInitialLanguageCursors[gSaveContext.language].y2 + GREG(2)) << 2, G_TX_RENDERTILE, 0, 0, + 3 << 8, 3 << 8); + + gDPPipeSync(POLY_OPA_DISP++); + gDPSetRenderMode(POLY_OPA_DISP++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + gDPSetCombineMode(POLY_OPA_DISP++, G_CC_BLENDPEDECALA, G_CC_BLENDPEDECALA); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 50, 255); + + for (i = 0; i < LANGUAGE_MAX; i++) { + gDPPipeSync(POLY_OPA_DISP++); + + if (i == gSaveContext.language) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 50, 50, 100, 255); + } + + gDPLoadTextureBlock(POLY_OPA_DISP++, sInitialLanguageTextures[i].texture, G_IM_FMT_IA, G_IM_SIZ_8b, + sInitialLanguageTextures[i].width, sInitialLanguageTextures[i].height, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + + gSPTextureRectangle(POLY_OPA_DISP++, (sInitialLanguageTextures[i].x1 + GREG(1)) << 2, + (sInitialLanguageTextures[i].y1 + GREG(2)) << 2, + (sInitialLanguageTextures[i].x2 + GREG(1)) << 2, + (sInitialLanguageTextures[i].y2 + GREG(2)) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + } + + gDPPipeSync(POLY_OPA_DISP++); + + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 220, 180, 30, 255); + gDPSetEnvColor(POLY_OPA_DISP++, 60, 20, 0, 255); + + source = (u8*)gFileSelSelectYourLanguageTex; + y1 = 120 + GREG(3); + for (i = 0; i < 8; i++, source += 0x500) { + y2 = y1 + 8; + gDPLoadTextureBlock(POLY_OPA_DISP++, source, G_IM_FMT_IA, G_IM_SIZ_8b, 160, 8, 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); + + gSPTextureRectangle(POLY_OPA_DISP++, (80 + GREG(4)) << 2, y1 << 2, (240 + GREG(4)) << 2, y2 << 2, + G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + + y1 = y2; + } + + CLOSE_DISPS(this->state.gfxCtx, "../z_file_choose.c", 0); +} +#endif + void FileSelect_SetView(FileSelectState* this, f32 eyeX, f32 eyeY, f32 eyeZ) { Vec3f eye; Vec3f lookAt; @@ -54,15 +327,48 @@ Gfx* FileSelect_QuadTextureIA8(Gfx* gfx, void* texture, s16 width, s16 height, s void FileSelect_InitModeUpdate(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; + SramContext* sramCtx = &this->sramCtx; +#if !OOT_PAL_N64 if (this->menuMode == FS_MENU_MODE_INIT) { this->menuMode = FS_MENU_MODE_CONFIG; this->configMode = CM_FADE_IN_START; this->nextTitleLabel = FS_TITLE_OPEN_FILE; PRINTF("Sram Start─Load 》》》》》 "); - Sram_VerifyAndLoadAllSaves(this, &this->sramCtx); + Sram_VerifyAndLoadAllSaves(this, sramCtx); PRINTF("終了!!!\n"); } +#else + if (this->configMode == CM_FADE_IN_START) { + Sram_VerifyAndLoadAllSaves(this, sramCtx); + + if (!SLOT_OCCUPIED(sramCtx, 0) && !SLOT_OCCUPIED(sramCtx, 1) && !SLOT_OCCUPIED(sramCtx, 2)) { + this->configMode++; // = CM_FADE_IN_END + } else { + this->menuMode = FS_MENU_MODE_CONFIG; + this->configMode = CM_FADE_IN_START; + this->nextTitleLabel = FS_TITLE_OPEN_FILE; + } + } + + if (this->configMode == CM_FADE_IN_END) { + sScreenFillAlpha -= 40; + if (sScreenFillAlpha <= 0) { + sScreenFillAlpha = 0; + this->configMode++; // = CM_MAIN_MENU + } + } else if (this->configMode == CM_MAIN_MENU) { + FileSelect_UpdateInitialLanguageMenu(this); + } else { + sScreenFillAlpha += 40; + if (sScreenFillAlpha >= 255) { + sScreenFillAlpha = 255; + this->menuMode = FS_MENU_MODE_CONFIG; + this->configMode = CM_FADE_IN_START; + this->nextTitleLabel = FS_TITLE_OPEN_FILE; + } + } +#endif } void FileSelect_InitModeDraw(GameState* thisx) { @@ -70,6 +376,11 @@ void FileSelect_InitModeDraw(GameState* thisx) { Gfx_SetupFrame(this->state.gfxCtx, true, 0, 0, 0); Gfx_ClearZBuffer(this->state.gfxCtx); + +#if OOT_PAL_N64 + Gfx_SetupDL_39Opa(this->state.gfxCtx); + FileSelect_DrawInitialLanguageMenu(this); +#endif } /** @@ -193,7 +504,16 @@ void FileSelect_UpdateMainMenu(GameState* thisx) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->configMode = CM_ROTATE_TO_NAME_ENTRY; this->kbdButton = FS_KBD_BTN_NONE; + +#if OOT_NTSC + this->charPage = FS_CHAR_PAGE_HIRA; + if (gSaveContext.language != LANGUAGE_JPN) { + this->charPage = FS_CHAR_PAGE_ENG; + } +#else this->charPage = FS_CHAR_PAGE_ENG; +#endif + this->kbdX = 0; this->kbdY = 0; this->charIndex = 0; @@ -213,6 +533,14 @@ void FileSelect_UpdateMainMenu(GameState* thisx) { } else if (!this->n64ddFlags[this->buttonIndex]) { Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } else { +#if PLATFORM_N64 + if (D_80121212 != 0) { + func_801C7268(); + // Setting ioData to 1 and writing it to ioPort 7 will skip the harp intro + Audio_PlaySequenceWithSeqPlayerIO(SEQ_PLAYER_BGM_MAIN, NA_BGM_FILE_SELECT, 0, 7, 1); + } +#endif } } else { if (this->warningLabel == FS_WARNING_NONE) { @@ -228,7 +556,7 @@ void FileSelect_UpdateMainMenu(GameState* thisx) { this->nextTitleLabel = FS_TITLE_ERASE_FILE; } else { this->configMode = CM_MAIN_TO_OPTIONS; - this->kbdButton = 0; + this->kbdButton = FS_KBD_BTN_HIRA; this->kbdX = 0; this->kbdY = 0; this->charBgAlpha = 0; @@ -513,13 +841,16 @@ static s16 D_80812848[] = { 0x0274, 0x0278 }; void FileSelect_SetWindowContentVtx(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; + SramContext* sramCtx = &this->sramCtx; s16 phi_t2; s16 phi_t0; s16 phi_t5; s16 phi_a1; s16 phi_ra; s16 temp_t1; - SramContext* sramCtx = &this->sramCtx; +#if OOT_PAL_N64 + u8 fileNameChar; +#endif this->windowContentVtx = GRAPH_ALLOC(this->state.gfxCtx, 0x288 * sizeof(Vtx)); @@ -672,8 +1003,14 @@ void FileSelect_SetWindowContentVtx(GameState* thisx) { temp_t1 += 2; for (phi_a1 = 0; phi_a1 < 8; phi_a1++, phi_t2 += 4, phi_t0 += WREG(40)) { +#if OOT_VERSION == PAL_1_1 + fileNameChar = this->fileNames[phi_t5][phi_a1]; this->windowContentVtx[phi_t2].v.ob[0] = this->windowContentVtx[phi_t2 + 2].v.ob[0] = - WREG(41) + phi_t0 + 0x40; + phi_t0 + 0x40 + WREG(41) + D_808124C0[fileNameChar]; +#else + this->windowContentVtx[phi_t2].v.ob[0] = this->windowContentVtx[phi_t2 + 2].v.ob[0] = + phi_t0 + 0x40 + WREG(41); +#endif this->windowContentVtx[phi_t2 + 1].v.ob[0] = this->windowContentVtx[phi_t2 + 3].v.ob[0] = this->windowContentVtx[phi_t2].v.ob[0] + WREG(42); this->windowContentVtx[phi_t2].v.ob[1] = this->windowContentVtx[phi_t2 + 1].v.ob[1] = temp_t1 - 3; @@ -801,23 +1138,45 @@ static void* sQuestItemTextures[] = { static s16 sQuestItemRed[] = { 255, 255, 255, 0, 255, 0, 255, 200, 200 }; static s16 sQuestItemGreen[] = { 255, 255, 255, 255, 60, 100, 130, 50, 200 }; static s16 sQuestItemBlue[] = { 255, 255, 255, 0, 0, 255, 0, 255, 0 }; -static s16 sQuestItemFlags[] = { 0x0012, 0x0013, 0x0014, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005 }; +static s16 sQuestItemFlags[] = { + QUEST_KOKIRI_EMERALD, QUEST_GORON_RUBY, QUEST_ZORA_SAPPHIRE, QUEST_MEDALLION_FOREST, QUEST_MEDALLION_FIRE, + QUEST_MEDALLION_WATER, QUEST_MEDALLION_SPIRIT, QUEST_MEDALLION_SHADOW, QUEST_MEDALLION_LIGHT, +}; + +#if OOT_NTSC && OOT_VERSION < GC_JP_CE +static void* sSaveXTextures[] = { gFileSelSaveXJPNTex, gFileSelSaveXENGTex }; +#endif + static s16 sNamePrimColors[2][3] = { { 255, 255, 255 }, { 100, 100, 100 } }; + +#if !OOT_PAL_N64 static void* sHeartTextures[] = { gHeartFullTex, gDefenseHeartFullTex }; +#else +static void* sHeartTextures[][5] = { + { gHeartEmptyTex, gHeartQuarterTex, gHeartHalfTex, gHeartThreeQuarterTex, gHeartFullTex }, + { gDefenseHeartEmptyTex, gDefenseHeartQuarterTex, gDefenseHeartHalfTex, gDefenseHeartThreeQuarterTex, + gDefenseHeartFullTex }, +}; +static u8 sHeartTextureIndices[16] = { 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3 }; +#endif + static s16 sHeartPrimColors[2][3] = { { 255, 70, 50 }, { 200, 0, 0 } }; static s16 sHeartEnvColors[2][3] = { { 50, 40, 60 }, { 255, 255, 255 } }; void FileSelect_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) { FileSelectState* this = (FileSelectState*)thisx; Font* sp54 = &this->font; - s32 heartType; s16 i; - s16 vtxOffset; s16 j; + s16 k; +#if OOT_PAL_N64 + s16 health; + s16 heartTextureIndex; +#endif + s16 heartType; + s16 vtxOffset; s16 deathCountSplit[3]; - if (1) {} - OPEN_DISPS(this->state.gfxCtx, "../z_file_choose.c", 1709); gDPPipeSync(POLY_OPA_DISP++); @@ -846,8 +1205,8 @@ void FileSelect_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) { FileSelect_SplitNumber(this->deaths[fileIndex], &deathCountSplit[0], &deathCountSplit[1], &deathCountSplit[2]); // draw death count - for (i = 0, vtxOffset = 0; i < 3; i++, vtxOffset += 4) { - FileSelect_DrawCharacter(this->state.gfxCtx, sp54->fontBuf + deathCountSplit[i] * FONT_CHAR_TEX_SIZE, + for (k = 0, vtxOffset = 0; k < 3; k++, vtxOffset += 4) { + FileSelect_DrawCharacter(this->state.gfxCtx, sp54->fontBuf + deathCountSplit[k] * FONT_CHAR_TEX_SIZE, vtxOffset); } @@ -863,14 +1222,39 @@ void FileSelect_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) { gDPSetEnvColor(POLY_OPA_DISP++, sHeartEnvColors[heartType][0], sHeartEnvColors[heartType][1], sHeartEnvColors[heartType][2], 255); - i = this->healthCapacities[fileIndex] / 0x10; + k = this->healthCapacities[fileIndex] / 0x10; +#if !OOT_PAL_N64 // draw hearts - for (vtxOffset = 0, j = 0; j < i; j++, vtxOffset += 4) { + for (vtxOffset = 0, j = 0; j < k; j++, vtxOffset += 4) { gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[D_8081284C[fileIndex] + vtxOffset] + 0x30, 4, 0); - POLY_OPA_DISP = FileSelect_QuadTextureIA8(POLY_OPA_DISP, sHeartTextures[heartType], 0x10, 0x10, 0); } +#else + health = this->health[fileIndex]; + if (health <= 48) { // 3 hearts + health = 48; + } + heartTextureIndex = 4; + + // draw hearts + for (vtxOffset = 0, j = 0; j < k; j++, vtxOffset += 4) { + if (health < 16) { + if (health != 0) { + heartTextureIndex = sHeartTextureIndices[health]; + health = 0; + } else { + heartTextureIndex = 0; + } + } else { + health -= 16; + } + + gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[D_8081284C[fileIndex] + vtxOffset] + 0x30, 4, 0); + POLY_OPA_DISP = + FileSelect_QuadTextureIA8(POLY_OPA_DISP, sHeartTextures[heartType][heartTextureIndex], 0x10, 0x10, 0); + } +#endif gDPPipeSync(POLY_OPA_DISP++); @@ -916,8 +1300,8 @@ static void* sTitleLabels[][9] = { { gFileSelPleaseSelectAFileENGTex, gFileSelOpenThisFileENGTex, gFileSelCopyWhichFileENGTex, gFileSelCopyToWhichFileENGTex, gFileSelAreYouSureENGTex, gFileSelFileCopiedENGTex, gFileSelEraseWhichFileENGTex, gFileSelAreYouSure2ENGTex, gFileSelFileErasedENGTex }, - { gFileSelPleaseSelectAFileGERTex, gFileSelOpenThisFileGERTex, gFileSelWhichFile1GERTex, - gFileSelCopyToWhichFileGERTex, gFileSelAreYouSureGERTex, gFileSelFileCopiedGERTex, gFileSelWhichFile2GERTex, + { gFileSelPleaseSelectAFileGERTex, gFileSelOpenThisFileGERTex, gFileSelCopyWhichFileGERTex, + gFileSelCopyToWhichFileGERTex, gFileSelAreYouSureGERTex, gFileSelFileCopiedGERTex, gFileSelEraseWhichFileGERTex, gFileSelAreYouSure2GERTex, gFileSelFileErasedGERTex }, { gFileSelPleaseSelectAFileFRATex, gFileSelOpenThisFileFRATex, gFileSelCopyWhichFileFRATex, gFileSelCopyToWhichFileFRATex, gFileSelAreYouSureFRATex, gFileSelFileCopiedFRATex, gFileSelEraseWhichFileFRATex, @@ -973,9 +1357,9 @@ static void* sOptionsButtonTextures[] = LANGUAGE_ARRAY(gFileSelOptionsButtonJPNT void FileSelect_DrawWindowContents(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; s16 fileIndex; - s16 temp; s16 i; s16 quadVtxIndex; + s16 temp; s16 isActive; s16 pad; @@ -1187,8 +1571,7 @@ void FileSelect_ConfigModeDraw(GameState* thisx) { Matrix_RotateX(this->windowRot / 100.0f, MTXMODE_APPLY); } - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_file_choose.c", 2282), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, this->state.gfxCtx, "../z_file_choose.c", 2282); gSPVertex(POLY_OPA_DISP++, &this->windowVtx[0], 32, 0); gSPDisplayList(POLY_OPA_DISP++, gFileSelWindow1DL); @@ -1215,8 +1598,7 @@ void FileSelect_ConfigModeDraw(GameState* thisx) { Matrix_Translate(0.0f, 0.0f, -93.6f, MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); Matrix_RotateX((this->windowRot - 314.0f) / 100.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_file_choose.c", 2316), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, this->state.gfxCtx, "../z_file_choose.c", 2316); gSPVertex(POLY_OPA_DISP++, &this->windowVtx[0], 32, 0); gSPDisplayList(POLY_OPA_DISP++, gFileSelWindow1DL); @@ -1244,8 +1626,7 @@ void FileSelect_ConfigModeDraw(GameState* thisx) { Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); Matrix_RotateX((this->windowRot - 314.0f) / 100.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_file_choose.c", 2337), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, this->state.gfxCtx, "../z_file_choose.c", 2337); gSPVertex(POLY_OPA_DISP++, &this->windowVtx[0], 32, 0); gSPDisplayList(POLY_OPA_DISP++, gFileSelWindow1DL); @@ -1548,6 +1929,14 @@ void FileSelect_LoadGame(GameState* thisx) { gSaveContext.save.info.equips.equipment &= gEquipNegMasks[EQUIP_TYPE_SWORD]; gSaveContext.save.info.inventory.equipment ^= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, swordEquipValue - 1); } + +#if PLATFORM_N64 + if (D_80121212 != 0) { + s32 fileNum = gSaveContext.fileNum; + + n64dd_SetDiskVersion(this->n64ddFlags[fileNum]); + } +#endif } static void (*sSelectModeUpdateFuncs[])(GameState*) = { @@ -1597,8 +1986,7 @@ void FileSelect_SelectModeDraw(GameState* thisx) { Matrix_Translate(0.0f, 0.0f, -93.6f, MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); Matrix_RotateX(this->windowRot / 100.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_file_choose.c", 2810), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, this->state.gfxCtx, "../z_file_choose.c", 2810); gSPVertex(POLY_OPA_DISP++, &this->windowVtx[0], 32, 0); gSPDisplayList(POLY_OPA_DISP++, gFileSelWindow1DL); @@ -1636,11 +2024,22 @@ void FileSelect_Main(GameState* thisx) { OPEN_DISPS(this->state.gfxCtx, "../z_file_choose.c", 2898); +#if PLATFORM_N64 + if ((D_80121212 != 0) && (func_801C70FC() != 0)) { + this->n64ddFlag = 1; + } else { + this->n64ddFlag = 0; + } +#else this->n64ddFlag = 0; +#endif gSPSegment(POLY_OPA_DISP++, 0x00, NULL); gSPSegment(POLY_OPA_DISP++, 0x01, this->staticSegment); gSPSegment(POLY_OPA_DISP++, 0x02, this->parameterSegment); +#if OOT_PAL_N64 + gSPSegment(POLY_OPA_DISP++, 0x06, this->objectMagSegment); +#endif this->stickAdjX = input->rel.stick_x; this->stickAdjY = input->rel.stick_y; @@ -1733,9 +2132,11 @@ void FileSelect_Main(GameState* thisx) { void FileSelect_InitContext(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; EnvironmentContext* envCtx = &this->envCtx; +#if PLATFORM_GC && OOT_PAL SramContext* sramCtx = &this->sramCtx; +#endif - Sram_Alloc(&this->state, sramCtx); + Sram_Alloc(&this->state, &this->sramCtx); ZREG(7) = 32; ZREG(8) = 22; @@ -1892,6 +2293,7 @@ void FileSelect_InitContext(GameState* thisx) { this->n64ddFlags[0] = this->n64ddFlags[1] = this->n64ddFlags[2] = this->defense[0] = this->defense[1] = this->defense[2] = 0; +#if PLATFORM_GC && OOT_PAL SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), sramCtx->readBuff, SRAM_SIZE, OS_READ); gSaveContext.language = sramCtx->readBuff[SRAM_HEADER_LANGUAGE]; @@ -1899,6 +2301,7 @@ void FileSelect_InitContext(GameState* thisx) { if (gSaveContext.language >= LANGUAGE_MAX) { sramCtx->readBuff[SRAM_HEADER_LANGUAGE] = gSaveContext.language = LANGUAGE_ENG; } +#endif } void FileSelect_Destroy(GameState* thisx) { @@ -1906,10 +2309,20 @@ void FileSelect_Destroy(GameState* thisx) { void FileSelect_Init(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; - u32 size = (uintptr_t)_title_staticSegmentRomEnd - (uintptr_t)_title_staticSegmentRomStart; s32 pad; + u32 size = (uintptr_t)_title_staticSegmentRomEnd - (uintptr_t)_title_staticSegmentRomStart; + +#if PLATFORM_N64 + if (D_80121212 != 0) { + func_801C7268(); + } +#endif +#if !OOT_PAL_N64 SREG(30) = 1; +#else + SREG(30) = 2; +#endif PRINTF("SIZE=%x\n", size); this->staticSegment = GAME_STATE_ALLOC(&this->state, size, "../z_file_choose.c", 3392); @@ -1922,6 +2335,12 @@ void FileSelect_Init(GameState* thisx) { DMA_REQUEST_SYNC(this->parameterSegment, (uintptr_t)_parameter_staticSegmentRomStart, size, "../z_file_choose.c", 3400); +#if OOT_PAL_N64 + size = gObjectTable[OBJECT_MAG].vromEnd - gObjectTable[OBJECT_MAG].vromStart; + this->objectMagSegment = GAME_STATE_ALLOC(&this->state, size, "../z_file_choose.c", 0); + DMA_REQUEST_SYNC(this->objectMagSegment, gObjectTable[OBJECT_MAG].vromStart, size, "../z_file_choose.c", 0); +#endif + Matrix_Init(&this->state); View_Init(&this->view, this->state.gfxCtx); this->state.main = FileSelect_Main; diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c index b6f452546b..c800fda301 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c @@ -1,24 +1,9 @@ #include "file_select.h" #include "terminal.h" +#include "versions.h" #include "assets/textures/title_static/title_static.h" #include "assets/overlays/ovl_file_choose/ovl_file_choose.h" -static s16 D_808124C0[] = { - 0x0002, 0x0003, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0001, 0x0002, 0x0000, 0x0001, - 0x0001, 0x0002, 0x0001, 0x0001, 0x0004, 0x0002, 0x0002, 0x0002, 0x0001, 0x0001, 0x0000, 0x0002, 0x0000, 0x0001, - 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x0001, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0003, - 0x0002, 0x0002, 0x0004, 0x0003, 0x0002, 0x0004, 0x0001, 0x0002, 0x0002, 0x0001, 0x0001, 0x0002, 0x0002, 0x0003, - 0x0002, 0x0002, 0x0000, 0x0002, 0x0002, 0x0002, 0x0000, 0x0003, 0x0001, 0x0000, -}; - -static s16 D_80812544[] = { - 0x0001, 0x0002, 0x0000, 0x0001, 0x0001, 0x0002, 0x0001, 0x0001, 0x0004, 0x0002, 0x0002, 0x0002, 0x0001, - 0x0001, 0x0000, 0x0002, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x0001, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0003, 0x0002, 0x0002, 0x0004, 0x0003, 0x0002, 0x0004, 0x0001, - 0x0002, 0x0002, 0x0001, 0x0001, 0x0002, 0x0002, 0x0003, 0x0002, 0x0002, 0x0000, 0x0002, 0x0002, 0x0002, - 0x0003, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0001, 0x0003, -}; - void FileSelect_DrawCharacter(GraphicsContext* gfxCtx, void* texture, s16 vtx) { OPEN_DISPS(gfxCtx, "../z_file_nameset_PAL.c", 110); @@ -29,9 +14,44 @@ void FileSelect_DrawCharacter(GraphicsContext* gfxCtx, void* texture, s16 vtx) { CLOSE_DISPS(gfxCtx, "../z_file_nameset_PAL.c", 119); } +#if OOT_NTSC +void FileSelect_DrawCharacterTransition(GraphicsContext* gfxCtx, void* texture1, void* texture2, s16 vtx) { + OPEN_DISPS(gfxCtx, "", 0); + + gDPLoadTextureBlock_4b(POLY_OPA_DISP++, texture1, G_IM_FMT_I, 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); + gDPLoadMultiBlock_4b(POLY_OPA_DISP++, texture2, 0x0080, 1, G_IM_FMT_I, 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); + gSP1Quadrangle(POLY_OPA_DISP++, vtx, vtx + 2, vtx + 3, vtx + 1, 0); + + CLOSE_DISPS(gfxCtx, "", 0); +} +#endif + +#if OOT_PAL + +#if OOT_VERSION >= PAL_1_1 +s16 D_808124C0[] = { + 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 0, 1, 1, 2, 1, 1, 4, 2, 2, 2, 1, 1, 0, 2, 0, 1, 1, 1, 1, 1, 0, + 1, 1, 1, 2, 2, 2, 2, 2, 3, 2, 2, 4, 3, 2, 4, 1, 2, 2, 1, 1, 2, 2, 3, 2, 2, 0, 2, 2, 2, 0, 3, 1, 0, +}; +#endif + +s16 D_80812544[] = { +#if OOT_VERSION < PAL_1_1 + 1, 2, 0, 1, 1, 2, 1, 2, 4, 2, 2, 2, 1, 1, 0, 2, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, + 2, 2, 4, 3, 2, 4, 1, 2, 2, 1, 1, 2, 2, 3, 2, 2, 0, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, +#else + // Differs only at index 7 + 1, 2, 0, 1, 1, 2, 1, 1, 4, 2, 2, 2, 1, 1, 0, 2, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, + 2, 2, 4, 3, 2, 4, 1, 2, 2, 1, 1, 2, 2, 3, 2, 2, 0, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, +#endif +}; + +#endif + void FileSelect_SetKeyboardVtx(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; - s16 val; s16 phi_t2; s16 phi_t0; s16 phi_t3; @@ -43,14 +63,49 @@ void FileSelect_SetKeyboardVtx(GameState* thisx) { phi_s1 = 0x26; +#if OOT_NTSC for (phi_t2 = 0, phi_s2 = 0, phi_t3 = 0; phi_s2 < 5; phi_s2++) { - phi_t0 = -0x60; + for (phi_t0 = -0x60, phi_t1 = 0; phi_t1 < 13; phi_t1++, phi_t3 += 4) { + this->keyboardVtx[phi_t3].v.ob[0] = this->keyboardVtx[phi_t3 + 2].v.ob[0] = phi_t0; + this->keyboardVtx[phi_t3 + 1].v.ob[0] = this->keyboardVtx[phi_t3 + 3].v.ob[0] = phi_t0 + 12; - for (phi_t1 = 0; phi_t1 < 13; phi_t1++, phi_t3 += 4, phi_t2++) { - //! @bug D_80812544 is accessed out of bounds when drawing the empty space character (value of 64). Under - //! normal circumstances it reads a halfword from sNameLabelTextures. - this->keyboardVtx[phi_t3].v.ob[0] = this->keyboardVtx[phi_t3 + 2].v.ob[0] = D_80812544[phi_t2] + phi_t0; + this->keyboardVtx[phi_t3].v.ob[1] = this->keyboardVtx[phi_t3 + 1].v.ob[1] = phi_s1; + this->keyboardVtx[phi_t3 + 2].v.ob[1] = this->keyboardVtx[phi_t3 + 3].v.ob[1] = phi_s1 - 12; + + this->keyboardVtx[phi_t3].v.ob[2] = this->keyboardVtx[phi_t3 + 1].v.ob[2] = + this->keyboardVtx[phi_t3 + 2].v.ob[2] = this->keyboardVtx[phi_t3 + 3].v.ob[2] = 0; + + this->keyboardVtx[phi_t3].v.flag = this->keyboardVtx[phi_t3 + 1].v.flag = + this->keyboardVtx[phi_t3 + 2].v.flag = this->keyboardVtx[phi_t3 + 3].v.flag = 0; + + this->keyboardVtx[phi_t3].v.tc[0] = this->keyboardVtx[phi_t3].v.tc[1] = + this->keyboardVtx[phi_t3 + 1].v.tc[1] = this->keyboardVtx[phi_t3 + 2].v.tc[0] = 0; + + this->keyboardVtx[phi_t3 + 1].v.tc[0] = this->keyboardVtx[phi_t3 + 2].v.tc[1] = + this->keyboardVtx[phi_t3 + 3].v.tc[0] = this->keyboardVtx[phi_t3 + 3].v.tc[1] = 0x200; + + this->keyboardVtx[phi_t3].v.cn[0] = this->keyboardVtx[phi_t3 + 1].v.cn[0] = + this->keyboardVtx[phi_t3 + 2].v.cn[0] = this->keyboardVtx[phi_t3 + 3].v.cn[0] = + this->keyboardVtx[phi_t3].v.cn[1] = this->keyboardVtx[phi_t3 + 1].v.cn[1] = + this->keyboardVtx[phi_t3 + 2].v.cn[1] = this->keyboardVtx[phi_t3 + 3].v.cn[1] = + this->keyboardVtx[phi_t3].v.cn[2] = this->keyboardVtx[phi_t3 + 1].v.cn[2] = + this->keyboardVtx[phi_t3 + 2].v.cn[2] = this->keyboardVtx[phi_t3 + 3].v.cn[2] = + this->keyboardVtx[phi_t3].v.cn[3] = this->keyboardVtx[phi_t3 + 1].v.cn[3] = + this->keyboardVtx[phi_t3 + 2].v.cn[3] = this->keyboardVtx[phi_t3 + 3].v.cn[3] = + 255; + + phi_t0 += 0x10; + } + + phi_s1 -= 0x10; + } +#else + for (phi_t2 = 0, phi_s2 = 0, phi_t3 = 0; phi_s2 < 5; phi_s2++) { + for (phi_t0 = -0x60, phi_t1 = 0; phi_t1 < 13; phi_t1++, phi_t3 += 4, phi_t2++) { + //! @bug D_80812544 is accessed out of bounds when drawing the empty space character (value + //! of 64). Under normal circumstances it reads a halfword from sNameLabelTextures. + this->keyboardVtx[phi_t3].v.ob[0] = this->keyboardVtx[phi_t3 + 2].v.ob[0] = D_80812544[phi_t2] + phi_t0; this->keyboardVtx[phi_t3 + 1].v.ob[0] = this->keyboardVtx[phi_t3 + 3].v.ob[0] = D_80812544[phi_t2] + phi_t0 + 12; @@ -85,6 +140,7 @@ void FileSelect_SetKeyboardVtx(GameState* thisx) { phi_s1 -= 0x10; } +#endif } static void* sNameLabelTextures[] = @@ -124,11 +180,11 @@ void FileSelect_SetNameEntryVtx(GameState* thisx) { Font* font = &this->font; s16 phi_s0; s16 phi_t1; +#if OOT_PAL u8 temp; +#endif s16 phi_v0; - if (1) {} - OPEN_DISPS(this->state.gfxCtx, "../z_file_nameset_PAL.c", 205); gDPPipeSync(POLY_OPA_DISP++); @@ -136,38 +192,72 @@ void FileSelect_SetNameEntryVtx(GameState* thisx) { ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->titleAlpha[0]); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); - gSPVertex(POLY_OPA_DISP++, D_80811BB0, 24, 0); + gSPVertex(POLY_OPA_DISP++, gNameEntryVtx, 24, 0); gDPLoadTextureBlock(POLY_OPA_DISP++, sNameLabelTextures[gSaveContext.language], G_IM_FMT_IA, G_IM_SIZ_8b, 56, 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); gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); gDPPipeSync(POLY_OPA_DISP++); +#if OOT_NTSC + for (phi_t1 = 0, phi_s0 = 4; phi_t1 < 5; phi_t1++, phi_s0 += 4) { + if (gSaveContext.language == LANGUAGE_JPN) { + gDPPipeSync(POLY_OPA_DISP++); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->windowColor[0], this->windowColor[1], this->windowColor[2], + 255); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); + + gDPLoadTextureBlock(POLY_OPA_DISP++, sButtonTextures[phi_t1], G_IM_FMT_IA, G_IM_SIZ_16b, + sButtonWidths[phi_t1], 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); + + gSP1Quadrangle(POLY_OPA_DISP++, phi_s0, phi_s0 + 2, phi_s0 + 3, phi_s0 + 1, 0); + } else if (phi_t1 >= 3) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->windowColor[0], this->windowColor[1], this->windowColor[2], + 255); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); + + gDPLoadTextureBlock(POLY_OPA_DISP++, sButtonTextures[phi_t1], G_IM_FMT_IA, G_IM_SIZ_16b, + sButtonWidths[phi_t1], 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); + + gSP1Quadrangle(POLY_OPA_DISP++, phi_s0, phi_s0 + 2, phi_s0 + 3, phi_s0 + 1, 0); + } + } +#else phi_s0 = 0x10; for (phi_t1 = 0; phi_t1 < 2; phi_t1++, phi_s0 += 4) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->windowColor[0], this->windowColor[1], this->windowColor[2], 255); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); -#if OOT_NTSC - // TODO: implement NTSC version - gDPLoadTextureBlock(POLY_OPA_DISP++, sButtonTextures[phi_t1], G_IM_FMT_IA, G_IM_SIZ_16b, sButtonWidths[phi_t1], - 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); -#else + gDPLoadTextureBlock(POLY_OPA_DISP++, sButtonTextures[gSaveContext.language][phi_t1], G_IM_FMT_IA, G_IM_SIZ_16b, sButtonWidths[phi_t1], 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); -#endif + gSP1Quadrangle(POLY_OPA_DISP++, phi_s0, phi_s0 + 2, phi_s0 + 3, phi_s0 + 1, 0); } +#endif this->nameEntryVtx = GRAPH_ALLOC(this->state.gfxCtx, 44 * sizeof(Vtx)); for (phi_s0 = 0, phi_t1 = 0; phi_t1 < 44; phi_t1 += 4, phi_s0++) { +#if OOT_NTSC + this->nameEntryVtx[phi_t1].v.ob[0] = this->nameEntryVtx[phi_t1 + 2].v.ob[0] = + D_808125EC[phi_s0] + this->nameEntryBoxPosX; + + this->nameEntryVtx[phi_t1 + 1].v.ob[0] = this->nameEntryVtx[phi_t1 + 3].v.ob[0] = + this->nameEntryVtx[phi_t1].v.ob[0] + 0xA; +#else if ((phi_s0 > 0) && (phi_s0 < 9)) { +#if OOT_VERSION >= PAL_1_1 temp = this->fileNames[this->buttonIndex][phi_s0 - 1]; this->nameEntryVtx[phi_t1].v.ob[0] = this->nameEntryVtx[phi_t1 + 2].v.ob[0] = D_808125EC[phi_s0] + this->nameEntryBoxPosX + D_808124C0[temp]; +#else + this->nameEntryVtx[phi_t1].v.ob[0] = this->nameEntryVtx[phi_t1 + 2].v.ob[0] = + D_808125EC[phi_s0] + this->nameEntryBoxPosX; +#endif this->nameEntryVtx[phi_t1 + 1].v.ob[0] = this->nameEntryVtx[phi_t1 + 3].v.ob[0] = this->nameEntryVtx[phi_t1].v.ob[0] + 0xA; @@ -178,6 +268,7 @@ void FileSelect_SetNameEntryVtx(GameState* thisx) { this->nameEntryVtx[phi_t1 + 1].v.ob[0] = this->nameEntryVtx[phi_t1 + 3].v.ob[0] = this->nameEntryVtx[phi_t1].v.ob[0] + 0xA; } +#endif this->nameEntryVtx[phi_t1].v.ob[1] = this->nameEntryVtx[phi_t1 + 1].v.ob[1] = D_80812604[phi_s0]; @@ -227,7 +318,7 @@ void FileSelect_SetNameEntryVtx(GameState* thisx) { gSPVertex(POLY_OPA_DISP++, this->nameEntryVtx + 4, 32, 0); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->nameEntryBoxAlpha); - for (phi_v0 = 0, phi_s0 = 0; phi_s0 < 0x20; phi_s0 += 4, phi_v0++) { + for (phi_s0 = 0, phi_v0 = 0; phi_s0 < 0x20; phi_s0 += 4, phi_v0++) { FileSelect_DrawCharacter(this->state.gfxCtx, font->fontBuf + this->fileNames[this->buttonIndex][phi_v0] * FONT_CHAR_TEX_SIZE, phi_s0); @@ -237,9 +328,9 @@ void FileSelect_SetNameEntryVtx(GameState* thisx) { this->nameEntryVtx[0x27].v.tc[1] = this->nameEntryVtx[0x29].v.tc[0] = this->nameEntryVtx[0x2A].v.tc[1] = this->nameEntryVtx[0x2B].v.tc[0] = this->nameEntryVtx[0x2B].v.tc[1] = 0x300; - if ((this->kbdButton == 0) || (this->kbdButton == 1) || (this->kbdButton == 4)) { + if (this->kbdButton == FS_KBD_BTN_HIRA || this->kbdButton == FS_KBD_BTN_KATA || this->kbdButton == FS_KBD_BTN_END) { this->nameEntryVtx[0x29].v.tc[0] = this->nameEntryVtx[0x2B].v.tc[0] = 0x700; - } else if ((this->kbdButton == 2) || (this->kbdButton == 3)) { + } else if (this->kbdButton == FS_KBD_BTN_ENG || this->kbdButton == FS_KBD_BTN_BACKSPACE) { this->nameEntryVtx[0x29].v.tc[0] = this->nameEntryVtx[0x2B].v.tc[0] = 0x500; } @@ -264,22 +355,189 @@ void FileSelect_DrawKeyboard(GameState* thisx) { 0, 0, COMBINED); gDPSetPrimColor(POLY_OPA_DISP++, 0, this->charBgAlpha, 255, 255, 255, 255); - while (vtx < 0x100) { +#if OOT_NTSC + if (this->charPage == FS_CHAR_PAGE_HIRA || this->charPage == FS_CHAR_PAGE_HIRA_TO_KATA || + this->charPage == FS_CHAR_PAGE_HIRA_TO_ENG) { + if (this->charPage != FS_CHAR_PAGE_HIRA_TO_ENG) { + for (; vtx < 0x100; vtx += 32) { + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[vtx], 32, 0); + + for (tmp = 0; tmp < 32; i++, tmp += 4) { + FileSelect_DrawCharacterTransition(this->state.gfxCtx, + font->fontBuf + gCharPageHira[i] * FONT_CHAR_TEX_SIZE, + font->fontBuf + gCharPageKata[i] * FONT_CHAR_TEX_SIZE, tmp); + } + } + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[0x100], 4, 0); + FileSelect_DrawCharacterTransition(this->state.gfxCtx, + font->fontBuf + gCharPageHira[i] * FONT_CHAR_TEX_SIZE, + font->fontBuf + gCharPageKata[i] * FONT_CHAR_TEX_SIZE, 0); + } else { + for (; vtx < 0x100; vtx += 32) { + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[vtx], 32, 0); + + for (tmp = 0; tmp < 32; i++, tmp += 4) { + FileSelect_DrawCharacterTransition(this->state.gfxCtx, + font->fontBuf + gCharPageHira[i] * FONT_CHAR_TEX_SIZE, + font->fontBuf + gCharPageEng[i] * FONT_CHAR_TEX_SIZE, tmp); + } + } + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[0x100], 4, 0); + FileSelect_DrawCharacterTransition(this->state.gfxCtx, + font->fontBuf + gCharPageHira[i] * FONT_CHAR_TEX_SIZE, + font->fontBuf + gCharPageEng[i] * FONT_CHAR_TEX_SIZE, 0); + } + } else if (this->charPage == FS_CHAR_PAGE_KATA || this->charPage == FS_CHAR_PAGE_KATA_TO_HIRA || + this->charPage == FS_CHAR_PAGE_KATA_TO_ENG) { + if (this->charPage != FS_CHAR_PAGE_KATA_TO_ENG) { + for (; vtx < 0x100; vtx += 32) { + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[vtx], 32, 0); + + for (tmp = 0; tmp < 32; i++, tmp += 4) { + FileSelect_DrawCharacterTransition(this->state.gfxCtx, + font->fontBuf + gCharPageKata[i] * FONT_CHAR_TEX_SIZE, + font->fontBuf + gCharPageHira[i] * FONT_CHAR_TEX_SIZE, tmp); + } + } + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[0x100], 4, 0); + FileSelect_DrawCharacterTransition(this->state.gfxCtx, + font->fontBuf + gCharPageKata[i] * FONT_CHAR_TEX_SIZE, + font->fontBuf + gCharPageHira[i] * FONT_CHAR_TEX_SIZE, 0); + } else { + for (; vtx < 0x100; vtx += 32) { + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[vtx], 32, 0); + + for (tmp = 0; tmp < 32; i++, tmp += 4) { + FileSelect_DrawCharacterTransition(this->state.gfxCtx, + font->fontBuf + gCharPageKata[i] * FONT_CHAR_TEX_SIZE, + font->fontBuf + gCharPageEng[i] * FONT_CHAR_TEX_SIZE, tmp); + } + } + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[0x100], 4, 0); + FileSelect_DrawCharacterTransition(this->state.gfxCtx, + font->fontBuf + gCharPageKata[i] * FONT_CHAR_TEX_SIZE, + font->fontBuf + gCharPageEng[i] * FONT_CHAR_TEX_SIZE, 0); + } + } else { + if (this->charPage != FS_CHAR_PAGE_ENG_TO_KATA) { + for (; vtx < 0x100; vtx += 32) { + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[vtx], 32, 0); + + for (tmp = 0; tmp < 32; i++, tmp += 4) { + FileSelect_DrawCharacterTransition(this->state.gfxCtx, + font->fontBuf + gCharPageEng[i] * FONT_CHAR_TEX_SIZE, + font->fontBuf + gCharPageHira[i] * FONT_CHAR_TEX_SIZE, tmp); + } + } + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[0x100], 4, 0); + FileSelect_DrawCharacterTransition(this->state.gfxCtx, font->fontBuf + gCharPageEng[i] * FONT_CHAR_TEX_SIZE, + font->fontBuf + gCharPageHira[i] * FONT_CHAR_TEX_SIZE, 0); + } else { + for (; vtx < 0x100; vtx += 32) { + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[vtx], 32, 0); + + for (tmp = 0; tmp < 32; i++, tmp += 4) { + FileSelect_DrawCharacterTransition(this->state.gfxCtx, + font->fontBuf + gCharPageEng[i] * FONT_CHAR_TEX_SIZE, + font->fontBuf + gCharPageKata[i] * FONT_CHAR_TEX_SIZE, tmp); + } + } + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[0x100], 4, 0); + FileSelect_DrawCharacterTransition(this->state.gfxCtx, font->fontBuf + gCharPageEng[i] * FONT_CHAR_TEX_SIZE, + font->fontBuf + gCharPageKata[i] * FONT_CHAR_TEX_SIZE, 0); + } + } +#else + for (; vtx < 0x100; vtx += 32) { gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[vtx], 32, 0); for (tmp = 0; tmp < 32; i++, tmp += 4) { - FileSelect_DrawCharacter(this->state.gfxCtx, font->fontBuf + D_808123F0[i] * FONT_CHAR_TEX_SIZE, tmp); + FileSelect_DrawCharacter(this->state.gfxCtx, font->fontBuf + gCharPageEng[i] * FONT_CHAR_TEX_SIZE, tmp); } - - vtx += 32; } gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[0x100], 4, 0); - FileSelect_DrawCharacter(this->state.gfxCtx, font->fontBuf + D_808123F0[i] * FONT_CHAR_TEX_SIZE, 0); + FileSelect_DrawCharacter(this->state.gfxCtx, font->fontBuf + gCharPageEng[i] * FONT_CHAR_TEX_SIZE, 0); +#endif CLOSE_DISPS(this->state.gfxCtx, "../z_file_nameset_PAL.c", 347); } +#if OOT_NTSC +// Tables for applying or removing Japanese diacritics (dakuten and handakuten) to filename characters. +// For the range of characters between RangeMin[i] and RangeMax[i], the modified character can be found +// by adding RangeOffset[i]. +static s16 sRemoveDiacriticRangeMin[12] = { 0x0F, 0x23, 0x41, 0x50, 0x55, 0x5F, 0x73, 0x91, 0xA0, 0xA5, 0x5C, 0xAA }; +static s16 sRemoveDiacriticRangeMax[12] = { 0x1D, 0x27, 0x4F, 0x54, 0x59, 0x6D, 0x77, 0x9F, 0xA4, 0xA9, 0x5C, 0xAA }; +static s16 sRemoveDiacriticRangeOffset[12] = { 0x32, 0x2D, -0x32, 0x05, -0x32, 0x32, + 0x2D, -0x32, 0x05, -0x32, 0x4E, -0x4E }; +static s16 sDakutenDiacriticRangeMin[8] = { 0x0F, 0x23, 0x55, 0x5F, 0x73, 0xA5, 0x5C, 0xAA }; +static s16 sDakutenDiacriticRangeMax[8] = { 0x1D, 0x27, 0x59, 0x6D, 0x77, 0xA9, 0x5C, 0xAA }; +static s16 sDakutenDiacriticRangeOffset[8] = { 0x32, 0x2D, -0x05, 0x32, 0x2D, -0x05, 0x4E, -0x4E }; +static s16 sHandakutenDiacriticRangeMin[4] = { 0x23, 0x50, 0x73, 0xA0 }; +static s16 sHandakutenDiacriticRangeMax[4] = { 0x27, 0x54, 0x77, 0xA4 }; +static s16 sHandakutenDiacriticRangeOffset[4] = { 0x32, 0x05, 0x32, 0x05 }; + +/** + * Apply a Japanese diacritic to a character in the filename. The diacritic can be + * FILENAME_DAKUTEN, FILENAME_HANDAKUTEN, or FILENAME_SPACE (which removes any + * diacritic). Returns true if the diacritic was successfully applied (or removed). + */ +s32 FileSelect_ApplyDiacriticToCharacter(GameState* thisx, s16 diacritic, s16 charIndex) { + FileSelectState* this = (FileSelectState*)thisx; + s16 i; + + if (diacritic == FILENAME_SPACE) { + for (i = 0; i < ARRAY_COUNTU(sRemoveDiacriticRangeOffset); i++) { + if (sRemoveDiacriticRangeMin[i] <= this->fileNames[this->buttonIndex][charIndex] && + this->fileNames[this->buttonIndex][charIndex] <= sRemoveDiacriticRangeMax[i]) { + this->fileNames[this->buttonIndex][charIndex] += sRemoveDiacriticRangeOffset[i]; + return true; + } + } + } else if (diacritic == FILENAME_DAKUTEN) { + for (i = 0; i < ARRAY_COUNTU(sDakutenDiacriticRangeOffset); i++) { + if (sDakutenDiacriticRangeMin[i] <= this->fileNames[this->buttonIndex][charIndex] && + this->fileNames[this->buttonIndex][charIndex] <= sDakutenDiacriticRangeMax[i]) { + this->fileNames[this->buttonIndex][charIndex] += sDakutenDiacriticRangeOffset[i]; + return true; + } + } + } else if (diacritic == FILENAME_HANDAKUTEN) { + for (i = 0; i < ARRAY_COUNTU(sHandakutenDiacriticRangeOffset); i++) { + if (sHandakutenDiacriticRangeMin[i] <= this->fileNames[this->buttonIndex][charIndex] && + this->fileNames[this->buttonIndex][charIndex] <= sHandakutenDiacriticRangeMax[i]) { + this->fileNames[this->buttonIndex][charIndex] += sHandakutenDiacriticRangeOffset[i]; + return true; + } + } + } + return false; +} + +/** + * Apply a Japanese diacritic to the filename, either replacing the current + * character or the previous character in the filename. The diacritic can be + * FILENAME_DAKUTEN, FILENAME_HANDAKUTEN, or FILENAME_SPACE (which removes any + * diacritic). Returns true if the diacritic was successfully applied (or removed). + */ +s32 FileSelect_ApplyDiacriticToFilename(GameState* thisx, s16 diacritic) { + FileSelectState* this = (FileSelectState*)thisx; + s32 pad; + + if (!FileSelect_ApplyDiacriticToCharacter(&this->state, diacritic, this->newFileNameCharCount)) { + if (this->newFileNameCharCount != 0) { + if (!FileSelect_ApplyDiacriticToCharacter(&this->state, diacritic, this->newFileNameCharCount - 1)) { + return false; + } + } else { + return false; + } + } + return true; +} +#endif + void FileSelect_DrawNameEntry(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; Font* font = &this->font; @@ -306,25 +564,34 @@ void FileSelect_DrawNameEntry(GameState* thisx) { if (this->kbdX != this->kbdButton) { PRINTF("014 xpos=%d contents=%d\n", this->kbdX, this->kbdButton); } - this->nameEntryVtx[40].v.ob[0] = this->nameEntryVtx[42].v.ob[0] = D_80811BB0[(this->kbdX + 1) * 4].v.ob[0] - 4; + this->nameEntryVtx[40].v.ob[0] = this->nameEntryVtx[42].v.ob[0] = + gNameEntryVtx[(this->kbdX + 1) * 4].v.ob[0] - 4; this->nameEntryVtx[41].v.ob[0] = this->nameEntryVtx[43].v.ob[0] = this->nameEntryVtx[40].v.ob[0] + 52; - this->nameEntryVtx[40].v.ob[1] = this->nameEntryVtx[41].v.ob[1] = D_80811BB0[(this->kbdX + 1) * 4].v.ob[1] + 4; + this->nameEntryVtx[40].v.ob[1] = this->nameEntryVtx[41].v.ob[1] = + gNameEntryVtx[(this->kbdX + 1) * 4].v.ob[1] + 4; } else if ((this->kbdButton == FS_KBD_BTN_ENG) || (this->kbdButton == FS_KBD_BTN_BACKSPACE)) { if (this->kbdX != this->kbdButton) { PRINTF("23 xpos=%d contents=%d\n", this->kbdX, this->kbdButton); } - this->nameEntryVtx[40].v.ob[0] = this->nameEntryVtx[42].v.ob[0] = D_80811BB0[(this->kbdX + 1) * 4].v.ob[0] - 4; + this->nameEntryVtx[40].v.ob[0] = this->nameEntryVtx[42].v.ob[0] = + gNameEntryVtx[(this->kbdX + 1) * 4].v.ob[0] - 4; this->nameEntryVtx[41].v.ob[0] = this->nameEntryVtx[43].v.ob[0] = this->nameEntryVtx[40].v.ob[0] + 40; - this->nameEntryVtx[40].v.ob[1] = this->nameEntryVtx[41].v.ob[1] = D_80811BB0[(this->kbdX + 1) * 4].v.ob[1] + 4; + this->nameEntryVtx[40].v.ob[1] = this->nameEntryVtx[41].v.ob[1] = + gNameEntryVtx[(this->kbdX + 1) * 4].v.ob[1] + 4; } else { if (this->charIndex >= 65) { PRINTF("mjp=%d xpos=%d ypos=%d name_contents=%d\n", this->charIndex, this->kbdX, this->kbdY, this->kbdButton); } +#if OOT_NTSC + this->nameEntryVtx[40].v.ob[0] = this->nameEntryVtx[42].v.ob[0] = + this->keyboardVtx[this->charIndex * 4].v.ob[0] - 6; +#else this->nameEntryVtx[40].v.ob[0] = this->nameEntryVtx[42].v.ob[0] = this->keyboardVtx[this->charIndex * 4].v.ob[0] - D_80812544[this->charIndex] - 6; +#endif this->nameEntryVtx[41].v.ob[0] = this->nameEntryVtx[43].v.ob[0] = this->nameEntryVtx[40].v.ob[0] + 24; this->nameEntryVtx[40].v.ob[1] = this->nameEntryVtx[41].v.ob[1] = this->keyboardVtx[this->charIndex * 4].v.ob[1] + 6; @@ -399,18 +666,208 @@ void FileSelect_DrawNameEntry(GameState* thisx) { } } else { if (this->charPage <= FS_CHAR_PAGE_ENG) { +#if OOT_NTSC if (this->kbdY != 5) { // draw the character the cursor is hovering over in yellow gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 0, 255); + + if (this->charPage == FS_CHAR_PAGE_HIRA) { + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[(this->charIndex * 4)], 4, 0); + FileSelect_DrawCharacter( + this->state.gfxCtx, font->fontBuf + gCharPageHira[this->charIndex] * FONT_CHAR_TEX_SIZE, 0); + if (CHECK_BTN_ALL(input->press.button, BTN_A)) { + if ((gCharPageHira[this->charIndex] == FILENAME_DAKUTEN) || + (gCharPageHira[this->charIndex] == FILENAME_HANDAKUTEN)) { + if (!FileSelect_ApplyDiacriticToFilename(&this->state, + gCharPageHira[this->charIndex])) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + } else { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + } + } else { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + this->fileNames[this->buttonIndex][this->newFileNameCharCount] = + gCharPageHira[this->charIndex]; + this->newFileNameCharCount++; + if (this->newFileNameCharCount >= 8) { + this->newFileNameCharCount = 7; + } + } + } + } else if (this->charPage == FS_CHAR_PAGE_KATA) { + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[(this->charIndex * 4)], 4, 0); + FileSelect_DrawCharacter( + this->state.gfxCtx, font->fontBuf + gCharPageKata[this->charIndex] * FONT_CHAR_TEX_SIZE, 0); + if (CHECK_BTN_ALL(input->press.button, BTN_A)) { + if ((gCharPageHira[this->charIndex] == FILENAME_DAKUTEN) || + (gCharPageHira[this->charIndex] == FILENAME_HANDAKUTEN)) { + if (!FileSelect_ApplyDiacriticToFilename(&this->state, + gCharPageHira[this->charIndex])) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + } else { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + } + } else { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + this->fileNames[this->buttonIndex][this->newFileNameCharCount] = + gCharPageKata[this->charIndex]; + this->newFileNameCharCount++; + if (this->newFileNameCharCount >= 8) { + this->newFileNameCharCount = 7; + } + } + } + } else { + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[this->charIndex * 4], 4, 0); + + FileSelect_DrawCharacter(this->state.gfxCtx, + font->fontBuf + gCharPageEng[this->charIndex] * FONT_CHAR_TEX_SIZE, 0); + + if (CHECK_BTN_ALL(input->press.button, BTN_A)) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + this->fileNames[this->buttonIndex][this->newFileNameCharCount] = + gCharPageEng[this->charIndex]; + this->newFileNameCharCount++; + + if (this->newFileNameCharCount > 7) { + this->newFileNameCharCount = 7; + } + } + } + } else if (CHECK_BTN_ALL(input->press.button, BTN_A) && (this->charPage != this->kbdButton)) { + if (this->kbdButton == FS_KBD_BTN_HIRA) { + if (this->charPage == FS_CHAR_PAGE_KATA) { + this->charPage = FS_CHAR_PAGE_KATA_TO_HIRA; + } else { + this->charPage = FS_CHAR_PAGE_ENG_TO_HIRA; + } + Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } else if (this->kbdButton == FS_KBD_BTN_KATA) { + if (this->charPage == FS_CHAR_PAGE_HIRA) { + this->charPage = FS_CHAR_PAGE_HIRA_TO_KATA; + } else { + this->charPage = FS_CHAR_PAGE_ENG_TO_KATA; + } + Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } else if (this->kbdButton == FS_KBD_BTN_ENG) { + if (this->charPage == FS_CHAR_PAGE_HIRA) { + this->charPage = FS_CHAR_PAGE_HIRA_TO_ENG; + } else { + this->charPage = FS_CHAR_PAGE_KATA_TO_ENG; + } + Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } else { + if (this->kbdButton == FS_KBD_BTN_BACKSPACE) { + if ((this->newFileNameCharCount == 7) && + (this->fileNames[this->buttonIndex][7] != FILENAME_SPACE)) { + for (i = this->newFileNameCharCount; i < 7; i++) { + this->fileNames[this->buttonIndex][i] = this->fileNames[this->buttonIndex][i + 1]; + } + + this->fileNames[this->buttonIndex][i] = FILENAME_SPACE; + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + } else { + this->newFileNameCharCount--; + + if (this->newFileNameCharCount < 0) { + this->newFileNameCharCount = 0; + } + + for (i = this->newFileNameCharCount; i < 7; i++) { + this->fileNames[this->buttonIndex][i] = this->fileNames[this->buttonIndex][i + 1]; + } + + this->fileNames[this->buttonIndex][i] = FILENAME_SPACE; + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + } + } else if (this->kbdButton == FS_KBD_BTN_END) { + validName = false; + + for (i = 0; i < 8; i++) { + if (this->fileNames[this->buttonIndex][i] != FILENAME_SPACE) { + validName = true; + break; + } + } + + if (validName) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + gSaveContext.fileNum = this->buttonIndex; + dayTime = ((void)0, gSaveContext.save.dayTime); + Sram_InitSave(this, &this->sramCtx); + gSaveContext.save.dayTime = dayTime; + this->configMode = CM_NAME_ENTRY_TO_MAIN; + this->nameBoxAlpha[this->buttonIndex] = this->nameAlpha[this->buttonIndex] = 200; + this->connectorAlpha[this->buttonIndex] = 255; + Rumble_Request(300.0f, 180, 20, 100); + } else { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + } + } + } + } + + if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + this->newFileNameCharCount++; + + if (this->newFileNameCharCount > 7) { + this->newFileNameCharCount = 7; + } + } else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + this->newFileNameCharCount--; + + if (this->newFileNameCharCount < 0) { + this->newFileNameCharCount = 0; + } + } else if (CHECK_BTN_ALL(input->press.button, BTN_Z)) { + if (FileSelect_ApplyDiacriticToFilename(&this->state, FILENAME_SPACE)) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } + } +#else + if (this->kbdY != 5) { + // draw the character the cursor is hovering over in yellow + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 0, 255); + gSPVertex(POLY_OPA_DISP++, &this->keyboardVtx[this->charIndex * 4], 4, 0); FileSelect_DrawCharacter(this->state.gfxCtx, - font->fontBuf + D_808123F0[this->charIndex] * FONT_CHAR_TEX_SIZE, 0); + font->fontBuf + gCharPageEng[this->charIndex] * FONT_CHAR_TEX_SIZE, 0); if (CHECK_BTN_ALL(input->press.button, BTN_A)) { Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - this->fileNames[this->buttonIndex][this->newFileNameCharCount] = D_808123F0[this->charIndex]; + this->fileNames[this->buttonIndex][this->newFileNameCharCount] = gCharPageEng[this->charIndex]; this->newFileNameCharCount++; if (this->newFileNameCharCount > 7) { @@ -491,6 +948,7 @@ void FileSelect_DrawNameEntry(GameState* thisx) { this->newFileNameCharCount = 0; } } +#endif } } } @@ -522,7 +980,7 @@ void FileSelect_StartNameEntry(GameState* thisx) { this->nameEntryBoxAlpha = 255; this->kbdX = 0; this->kbdY = 0; - this->kbdButton = 99; + this->kbdButton = FS_KBD_BTN_NONE; this->configMode = CM_NAME_ENTRY; } } @@ -536,8 +994,201 @@ void FileSelect_StartNameEntry(GameState* thisx) { void FileSelect_UpdateKeyboardCursor(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; s16 prevKbdX; +#if !(PLATFORM_GC && OOT_PAL) + Input* input = &this->state.input[0]; + s32 pad; +#endif - this->kbdButton = 99; +#if OOT_NTSC + if (this->charPage <= FS_CHAR_PAGE_ENG) { + if (CHECK_BTN_ALL(input->press.button, BTN_R)) { + if (gSaveContext.language == LANGUAGE_JPN) { + if (this->charPage == FS_CHAR_PAGE_HIRA) { + this->charPage = FS_CHAR_PAGE_HIRA_TO_KATA; + Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } else if (this->charPage == FS_CHAR_PAGE_KATA) { + this->charPage = FS_CHAR_PAGE_KATA_TO_ENG; + Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } else if (this->charPage == FS_CHAR_PAGE_ENG) { + this->charPage = FS_CHAR_PAGE_ENG_TO_HIRA; + Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } + } + } else { + this->kbdButton = FS_KBD_BTN_NONE; + + if (this->kbdY != 5) { + if (this->stickAdjX < -30) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + this->charIndex--; + this->kbdX--; + if (this->kbdX < 0) { + this->kbdX = 12; + this->charIndex = this->kbdY * 13 + this->kbdX; + } + } else if (this->stickAdjX > 30) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + this->charIndex++; + this->kbdX++; + if (this->kbdX >= 13) { + this->kbdX = 0; + this->charIndex = this->kbdY * 13 + this->kbdX; + } + } + } else if (gSaveContext.language == LANGUAGE_JPN) { + if (this->stickAdjX < -30) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + this->kbdX--; + if (this->kbdX < 0) { + this->kbdX = 4; + } + } else if (this->stickAdjX > 30) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + this->kbdX++; + if (this->kbdX >= 5) { + this->kbdX = 0; + } + } + } else { + if (this->stickAdjX < -30) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + this->kbdX--; + if (this->kbdX < 3) { + this->kbdX = 4; + } + } else if (this->stickAdjX > 30) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + this->kbdX++; + if (this->kbdX >= 5) { + this->kbdX = 3; + } + } + } + + if (this->stickAdjY > 30) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + this->kbdY--; + if (this->kbdY < 0) { + if (gSaveContext.language == LANGUAGE_JPN) { + this->kbdY = 5; + this->charIndex += 52; + prevKbdX = this->kbdX; + if (this->kbdX < 3) { + this->kbdX = 0; + } else if (this->kbdX < 6) { + this->kbdX = 1; + } else if (this->kbdX < 8) { + this->kbdX = 2; + } else if (this->kbdX < 10) { + this->kbdX = 3; + } else if (this->kbdX < 13) { + this->kbdX = 4; + } + + this->unk_1CAD6[this->kbdX] = prevKbdX; + } else { + // don't go to bottom row + if (this->kbdX < 8) { + this->kbdY = 4; + this->charIndex = this->kbdX + 52; + } else { + this->kbdY = 5; + this->charIndex += 52; + prevKbdX = this->kbdX; + if (this->kbdX < 10) { + this->kbdX = 3; + } else if (this->kbdX < 13) { + this->kbdX = 4; + } + + this->unk_1CAD6[this->kbdX] = prevKbdX; + } + } + } else { + this->charIndex -= 13; + if (this->kbdY == 4) { + this->charIndex = 52; + this->kbdX = this->unk_1CAD6[this->kbdX]; + this->charIndex += this->kbdX; + } + } + } else if (this->stickAdjY < -30) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + this->kbdY++; + + if (this->kbdY >= 6) { + this->kbdY = 0; + this->kbdX = this->unk_1CAD6[this->kbdX]; + this->charIndex = this->kbdX; + } else { + this->charIndex += 13; + + if (this->kbdY == 5) { + if (gSaveContext.language != LANGUAGE_JPN) { + if (this->kbdX < 8) { + this->kbdY = 0; + this->charIndex = this->kbdX; + } else { + prevKbdX = this->kbdX; + + if (this->kbdX < 3) { + this->kbdX = 0; + } else if (this->kbdX < 6) { + this->kbdX = 1; + } else if (this->kbdX < 8) { + this->kbdX = 2; + } else if (this->kbdX < 10) { + this->kbdX = 3; + } else if (this->kbdX < 13) { + this->kbdX = 4; + } + + this->unk_1CAD6[this->kbdX] = prevKbdX; + } + } else { + prevKbdX = this->kbdX; + + if (this->kbdX < 3) { + this->kbdX = 0; + } else if (this->kbdX < 6) { + this->kbdX = 1; + } else if (this->kbdX < 8) { + this->kbdX = 2; + } else if (this->kbdX < 10) { + this->kbdX = 3; + } else if (this->kbdX < 13) { + this->kbdX = 4; + } + + this->unk_1CAD6[this->kbdX] = prevKbdX; + } + } + } + } + if (this->kbdY == 5) { + this->kbdButton = this->kbdX; + } + } + } else { + this->charBgAlpha += ZREG(9); + if (this->charBgAlpha >= 255) { + this->charBgAlpha = 0; + this->charPage = gNextCharPage[this->charPage]; + } + } +#else + this->kbdButton = FS_KBD_BTN_NONE; if (this->kbdY != 5) { if (this->stickAdjX < -30) { @@ -547,16 +1198,16 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { this->kbdX--; if (this->kbdX < 0) { this->kbdX = 12; - this->charIndex = (this->kbdY * 13) + this->kbdX; + this->charIndex = this->kbdY * 13 + this->kbdX; } } else if (this->stickAdjX > 30) { Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->charIndex++; this->kbdX++; - if (this->kbdX > 12) { + if (this->kbdX >= 13) { this->kbdX = 0; - this->charIndex = (this->kbdY * 13) + this->kbdX; + this->charIndex = this->kbdY * 13 + this->kbdX; } } } else { @@ -571,7 +1222,7 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->kbdX++; - if (this->kbdX > 4) { + if (this->kbdX >= 5) { this->kbdX = 3; } } @@ -581,17 +1232,15 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->kbdY--; - if (this->kbdY < 0) { // don't go to bottom row if (this->kbdX < 8) { this->kbdY = 4; - this->charIndex = (s32)(this->kbdX + 52); + this->charIndex = this->kbdX + 52; } else { this->kbdY = 5; this->charIndex += 52; prevKbdX = this->kbdX; - if (this->kbdX < 10) { this->kbdX = 3; } else if (this->kbdX < 13) { @@ -602,7 +1251,6 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { } } else { this->charIndex -= 13; - if (this->kbdY == 4) { this->charIndex = 52; this->kbdX = this->unk_1CAD6[this->kbdX]; @@ -614,7 +1262,7 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->kbdY++; - if (this->kbdY > 5) { + if (this->kbdY >= 6) { this->kbdY = 0; this->kbdX = this->unk_1CAD6[this->kbdX]; this->charIndex = this->kbdX; @@ -645,10 +1293,10 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { } } } - if (this->kbdY == 5) { this->kbdButton = this->kbdX; } +#endif } /** @@ -694,6 +1342,9 @@ void FileSelect_UpdateOptionsMenu(GameState* thisx) { this->configMode = CM_OPTIONS_TO_MAIN; sramCtx->readBuff[0] = gSaveContext.audioSetting; sramCtx->readBuff[1] = gSaveContext.zTargetSetting; +#if OOT_PAL_N64 + sramCtx->readBuff[2] = gSaveContext.language; +#endif PRINTF("SAVE"); Sram_WriteSramHeader(sramCtx); PRINTF(VT_FGCOL(YELLOW)); @@ -720,7 +1371,18 @@ void FileSelect_UpdateOptionsMenu(GameState* thisx) { gSaveContext.audioSetting = FS_AUDIO_SURROUND; } } else { +#if !OOT_PAL_N64 gSaveContext.zTargetSetting ^= 1; +#else + if (sSelectedSetting == FS_SETTING_TARGET) { + gSaveContext.zTargetSetting ^= 1; + } else { + gSaveContext.language--; + if (gSaveContext.language >= LANGUAGE_MAX) { + gSaveContext.language = LANGUAGE_MAX - 1; + } + } +#endif } } else if (this->stickAdjX > 30) { Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, @@ -733,10 +1395,22 @@ void FileSelect_UpdateOptionsMenu(GameState* thisx) { gSaveContext.audioSetting = FS_AUDIO_STEREO; } } else { +#if !OOT_PAL_N64 gSaveContext.zTargetSetting ^= 1; +#else + if (sSelectedSetting == FS_SETTING_TARGET) { + gSaveContext.zTargetSetting ^= 1; + } else { + gSaveContext.language++; + if (gSaveContext.language >= LANGUAGE_MAX) { + gSaveContext.language = 0; + } + } +#endif } } +#if !OOT_PAL_N64 if ((this->stickAdjY < -30) || (this->stickAdjY > 30)) { Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -746,72 +1420,139 @@ void FileSelect_UpdateOptionsMenu(GameState* thisx) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); sSelectedSetting ^= 1; } +#else + if (this->stickAdjY < -30) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + sSelectedSetting++; + if (sSelectedSetting >= FS_SETTING_MAX) { + sSelectedSetting = 0; + } + } else if (this->stickAdjY > 30) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + sSelectedSetting--; + if (sSelectedSetting >= FS_SETTING_MAX) { + sSelectedSetting = FS_SETTING_MAX - 1; + } + } else if (CHECK_BTN_ALL(input->press.button, BTN_A)) { + Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + sSelectedSetting++; + if (sSelectedSetting >= FS_SETTING_MAX) { + sSelectedSetting = 0; + } + } +#endif } -typedef struct { +#if OOT_NTSC + +typedef struct OptionsMenuTextureInfo { + /* 0x00 */ void* texture[2]; + /* 0x08 */ u16 width; + /* 0x0A */ u16 height; +} OptionsMenuTextureInfo; // size = 0x0C + +#define OPTIONS_MENU_TEXTURE_WIDTH(info) info.width +#define OPTIONS_MENU_TEXTURE_HEIGHT(info) info.height + +static OptionsMenuTextureInfo sOptionsMenuHeaders[] = { + { { gFileSelOptionsJPNTex, gFileSelOptionsENGTex }, 128, 16 }, + { { gFileSelSOUNDENGTex, gFileSelSOUNDENGTex }, 64, 16 }, + { { gFileSelZTargetingJPNTex, gFileSelZTargetingENGTex }, 64, 16 }, + { { gFileSelCheckBrightnessJPNTex, gFileSelCheckBrightnessENGTex }, 96, 16 }, +}; + +static OptionsMenuTextureInfo sOptionsMenuSettings[] = { + { { gFileSelStereoJPNTex, gFileSelStereoENGTex }, 48, 16 }, + { { gFileSelMonoJPNTex, gFileSelMonoENGTex }, 48, 16 }, + { { gFileSelHeadsetJPNTex, gFileSelHeadsetENGTex }, 48, 16 }, + { { gFileSelSurroundJPNTex, gFileSelSurroundENGTex }, 48, 16 }, + { { gFileSelSwitchJPNTex, gFileSelSwitchENGTex }, 48, 16 }, + { { gFileSelHoldJPNTex, gFileSelHoldENGTex }, 48, 16 }, +}; + +#elif OOT_PAL_N64 + +static u16 sZTargetSettingWidths[2][3] = { + { 48, 80, 48 }, + { 48, 80, 48 }, +}; + +typedef struct LanguageChoiceTextureInfo { + /* 0x00 */ void* texture; + /* 0x04 */ u16 width; + /* 0x06 */ u16 height; +} LanguageChoiceTextureInfo; // size = 0x10 + +static LanguageChoiceTextureInfo sLanguageChoices[] = { + { gFileSelLanguageChoiceENGTex, 48, 16 }, + { gFileSelLanguageChoiceGERTex, 48, 16 }, + { gFileSelLanguageChoiceFRATex, 48, 16 }, +}; + +typedef struct OptionsMenuTextureInfo { + /* 0x00 */ void* texture[3]; + /* 0x0C */ u16 width; + /* 0x0E */ u16 height; +} OptionsMenuTextureInfo; // size = 0x10 + +#define OPTIONS_MENU_TEXTURE_WIDTH(info) info.width +#define OPTIONS_MENU_TEXTURE_HEIGHT(info) info.height + +static OptionsMenuTextureInfo sOptionsMenuHeaders[] = { + { { gFileSelOptionsENGTex, gFileSelOptionsGERTex, gFileSelOptionsENGTex }, 128, 16 }, + { { gFileSelSOUNDENGTex, gFileSelSOUNDENGTex, gFileSelSOUNDFRATex }, 64, 16 }, + { { gFileSelZTargetingENGTex, gFileSelZTargetingGERTex, gFileSelZTargetingFRATex }, 64, 16 }, + { { gFileSelCheckBrightnessENGTex, gFileSelCheckBrightnessGERTex, gFileSelCheckBrightnessFRATex }, 128, 16 }, + { { gFileSelLanguageENGTex, gFileSelLanguageGERTex, gFileSelLanguageFRATex }, 64, 16 }, +}; + +static OptionsMenuTextureInfo sOptionsMenuSettings[] = { + { { gFileSelStereoENGTex, gFileSelStereoENGTex, gFileSelStereoFRATex }, 48, 16 }, + { { gFileSelMonoENGTex, gFileSelMonoENGTex, gFileSelMonoENGTex }, 48, 16 }, + { { gFileSelHeadsetENGTex, gFileSelHeadsetGERTex, gFileSelHeadsetFRATex }, 48, 16 }, + { { gFileSelSurroundENGTex, gFileSelSurroundENGTex, gFileSelSurroundENGTex }, 48, 16 }, + { { gFileSelSwitchENGTex, gFileSelSwitchGERTex, gFileSelSwitchFRATex }, 48, 16 }, + { { gFileSelHoldENGTex, gFileSelHoldGERTex, gFileSelHoldFRATex }, 48, 16 }, + { { gFileSelSwitchENGTex, gFileSelSwitchGERTex, gFileSelSwitchFRATex }, 48, 16 }, + { { gFileSelHoldENGTex, gFileSelHoldGERTex, gFileSelHoldFRATex }, 48, 16 }, +}; + +#else + +typedef struct OptionsMenuTextureInfo { /* 0x00 */ void* texture[3]; /* 0x0C */ u16 width[3]; /* 0x12 */ u16 height; } OptionsMenuTextureInfo; // size = 0x14 +#define OPTIONS_MENU_TEXTURE_WIDTHS(jpn, eng, ger, fra) \ + { eng, ger, fra } +#define OPTIONS_MENU_TEXTURE_WIDTH(info) info.width[gSaveContext.language] +#define OPTIONS_MENU_TEXTURE_HEIGHT(info) info.height + static OptionsMenuTextureInfo sOptionsMenuHeaders[] = { - { - LANGUAGE_ARRAY(gFileSelOptionsJPNTex, gFileSelOptionsENGTex, gFileSelOptionsGERTex, gFileSelOptionsENGTex), - { 128, 128, 128 }, - 16, - }, - { - LANGUAGE_ARRAY(gFileSelSOUNDENGTex, gFileSelSOUNDENGTex, gFileSelSOUNDENGTex, gFileSelSOUNDFRATex), - { 64, 64, 64 }, - 16, - }, - { - LANGUAGE_ARRAY(gFileSelLTargetingJPNTex, gFileSelLTargetingENGTex, gFileSelLTargetingGERTex, - gFileSelLTargetingFRATex), - { 64, 144, 64 }, - 16, - }, - { - LANGUAGE_ARRAY(gFileSelCheckBrightnessJPNTex, gFileSelCheckBrightnessENGTex, gFileSelCheckBrightnessGERTex, - gFileSelCheckBrightnessFRATex), - { 128, 128, 128 }, - 16, - }, + { { gFileSelOptionsENGTex, gFileSelOptionsGERTex, gFileSelOptionsENGTex }, { 128, 128, 128 }, 16 }, + { { gFileSelSOUNDENGTex, gFileSelSOUNDENGTex, gFileSelSOUNDFRATex }, { 64, 64, 64 }, 16 }, + { { gFileSelZTargetingENGTex, gFileSelZTargetingGERTex, gFileSelZTargetingFRATex }, { 64, 144, 64 }, 16 }, + { { gFileSelCheckBrightnessENGTex, gFileSelCheckBrightnessGERTex, gFileSelCheckBrightnessFRATex }, + { 128, 128, 128 }, + 16 }, }; static OptionsMenuTextureInfo sOptionsMenuSettings[] = { - { - LANGUAGE_ARRAY(gFileSelStereoJPNTex, gFileSelStereoENGTex, gFileSelStereoENGTex, gFileSelStereoFRATex), - { 48, 48, 48 }, - 16, - }, - { - LANGUAGE_ARRAY(gFileSelMonoJPNTex, gFileSelMonoENGTex, gFileSelMonoENGTex, gFileSelMonoENGTex), - { 48, 48, 48 }, - 16, - }, - { - LANGUAGE_ARRAY(gFileSelHeadsetJPNTex, gFileSelHeadsetENGTex, gFileSelHeadsetGERTex, gFileSelHeadsetFRATex), - { 48, 48, 48 }, - 16, - }, - { - LANGUAGE_ARRAY(gFileSelSurroundJPNTex, gFileSelSurroundENGTex, gFileSelSurroundENGTex, gFileSelSurroundENGTex), - { 48, 48, 48 }, - 16, - }, - { - LANGUAGE_ARRAY(gFileSelSwitchJPNTex, gFileSelSwitchENGTex, gFileSelSwitchGERTex, gFileSelSwitchFRATex), - { 48, 80, 48 }, - 16, - }, - { - LANGUAGE_ARRAY(gFileSelHoldJPNTex, gFileSelHoldENGTex, gFileSelHoldGERTex, gFileSelHoldFRATex), - { 48, 80, 48 }, - 16, - }, + { { gFileSelStereoENGTex, gFileSelStereoENGTex, gFileSelStereoFRATex }, { 48, 48, 48 }, 16 }, + { { gFileSelMonoENGTex, gFileSelMonoENGTex, gFileSelMonoENGTex }, { 48, 48, 48 }, 16 }, + { { gFileSelHeadsetENGTex, gFileSelHeadsetGERTex, gFileSelHeadsetFRATex }, { 48, 48, 48 }, 16 }, + { { gFileSelSurroundENGTex, gFileSelSurroundENGTex, gFileSelSurroundENGTex }, { 48, 48, 48 }, 16 }, + { { gFileSelSwitchENGTex, gFileSelSwitchGERTex, gFileSelSwitchFRATex }, { 48, 80, 48 }, 16 }, + { { gFileSelHoldENGTex, gFileSelHoldGERTex, gFileSelHoldFRATex }, { 48, 80, 48 }, 16 }, }; +#endif + void FileSelect_DrawOptionsImpl(GameState* thisx) { static s16 cursorPrimRed = 255; static s16 cursorPrimGreen = 255; @@ -833,9 +1574,17 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) { s16 cursorRed; s16 cursorGreen; s16 cursorBlue; +#if !OOT_PAL_N64 s16 i; s16 j; s16 vtx; +#else + s16 startIndex; + s32 endIndex; + s32 i; + s32 vtx; + s32 pad; +#endif OPEN_DISPS(this->state.gfxCtx, "../z_file_nameset_PAL.c", 848); @@ -900,12 +1649,14 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) { } #if OOT_NTSC - gSPVertex(POLY_OPA_DISP++, D_80811D30, 32, 0); + gSPVertex(POLY_OPA_DISP++, gOptionsMenuHeadersVtx, 32, 0); +#elif OOT_PAL_N64 + gSPVertex(POLY_OPA_DISP++, gOptionsMenuHeadersVtx, 24, 0); #else if (gSaveContext.language == LANGUAGE_GER) { - gSPVertex(POLY_OPA_DISP++, D_80811E30, 32, 0); + gSPVertex(POLY_OPA_DISP++, gOptionsMenuHeadersGERVtx, 32, 0); } else { - gSPVertex(POLY_OPA_DISP++, D_80811D30, 32, 0); + gSPVertex(POLY_OPA_DISP++, gOptionsMenuHeadersVtx, 32, 0); } #endif @@ -915,21 +1666,41 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->titleAlpha[0]); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); +#if !OOT_PAL_N64 for (i = 0, vtx = 0; i < 4; i++, vtx += 4) { gDPLoadTextureBlock(POLY_OPA_DISP++, sOptionsMenuHeaders[i].texture[gSaveContext.language], G_IM_FMT_IA, - G_IM_SIZ_8b, sOptionsMenuHeaders[i].width[gSaveContext.language], - sOptionsMenuHeaders[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + G_IM_SIZ_8b, OPTIONS_MENU_TEXTURE_WIDTH(sOptionsMenuHeaders[i]), + OPTIONS_MENU_TEXTURE_HEIGHT(sOptionsMenuHeaders[i]), 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, vtx, vtx + 2, vtx + 3, vtx + 1, 0); } +#else + for (i = 0, vtx = 0; i < 5; i++, vtx += 4) { + if (i == 2 && gSaveContext.language == LANGUAGE_GER) { + gDPLoadTextureBlock(POLY_OPA_DISP++, sOptionsMenuHeaders[i].texture[gSaveContext.language], G_IM_FMT_IA, + G_IM_SIZ_8b, 144, OPTIONS_MENU_TEXTURE_HEIGHT(sOptionsMenuHeaders[i]), 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_OPA_DISP++, vtx + 12, vtx + 14, vtx + 15, vtx + 13, 0); + } else { + gDPLoadTextureBlock(POLY_OPA_DISP++, sOptionsMenuHeaders[i].texture[gSaveContext.language], G_IM_FMT_IA, + G_IM_SIZ_8b, OPTIONS_MENU_TEXTURE_WIDTH(sOptionsMenuHeaders[i]), + OPTIONS_MENU_TEXTURE_HEIGHT(sOptionsMenuHeaders[i]), 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_OPA_DISP++, vtx, vtx + 2, vtx + 3, vtx + 1, 0); + } + } +#endif #if OOT_NTSC - gSPVertex(POLY_OPA_DISP++, D_80811F30, 32, 0); + gSPVertex(POLY_OPA_DISP++, gOptionsMenuSettingsVtx, 32, 0); +#elif OOT_PAL_N64 + gSPVertex(POLY_OPA_DISP++, gOptionsMenuSettingsVtx, 32, 0); #else if (gSaveContext.language == LANGUAGE_GER) { - gSPVertex(POLY_OPA_DISP++, D_80812130, 32, 0); + gSPVertex(POLY_OPA_DISP++, gOptionsMenuSettingsGERVtx, 32, 0); } else { - gSPVertex(POLY_OPA_DISP++, D_80811F30, 32, 0); + gSPVertex(POLY_OPA_DISP++, gOptionsMenuSettingsVtx, 32, 0); } #endif @@ -952,12 +1723,13 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) { //! @bug Mistakenly using sOptionsMenuHeaders instead of sOptionsMenuSettings for the height. //! This works out anyway because all heights are 16. gDPLoadTextureBlock(POLY_OPA_DISP++, sOptionsMenuSettings[i].texture[gSaveContext.language], G_IM_FMT_IA, - G_IM_SIZ_8b, sOptionsMenuSettings[i].width[gSaveContext.language], - sOptionsMenuHeaders[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + G_IM_SIZ_8b, OPTIONS_MENU_TEXTURE_WIDTH(sOptionsMenuSettings[i]), + OPTIONS_MENU_TEXTURE_HEIGHT(sOptionsMenuHeaders[i]), 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, vtx, vtx + 2, vtx + 3, vtx + 1, 0); } +#if !OOT_PAL_N64 for (; i < 6; i++, vtx += 4) { gDPPipeSync(POLY_OPA_DISP++); @@ -979,12 +1751,52 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) { //! This is also an OOB read that happens to access the height of the first two elements in //! sOptionsMenuSettings, and since all heights are 16, it works out anyway. gDPLoadTextureBlock(POLY_OPA_DISP++, sOptionsMenuSettings[i].texture[gSaveContext.language], G_IM_FMT_IA, - G_IM_SIZ_8b, sOptionsMenuSettings[i].width[gSaveContext.language], - sOptionsMenuHeaders[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + G_IM_SIZ_8b, OPTIONS_MENU_TEXTURE_WIDTH(sOptionsMenuSettings[i]), + OPTIONS_MENU_TEXTURE_HEIGHT(sOptionsMenuHeaders[i]), 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_OPA_DISP++, vtx, vtx + 2, vtx + 3, vtx + 1, 0); + } +#else + if (gSaveContext.language == LANGUAGE_GER) { + endIndex = 8; + startIndex = 6; + i += 2; + vtx += 8; + } else { + endIndex = 6; + startIndex = 4; + } + + for (; i < endIndex; i++, vtx += 4) { + s32 j = i - startIndex; + + gDPPipeSync(POLY_OPA_DISP++); + + if (j == gSaveContext.zTargetSetting) { + if (sSelectedSetting == FS_SETTING_TARGET) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, cursorPrimRed, cursorPrimGreen, cursorPrimBlue, + this->titleAlpha[0]); + gDPSetEnvColor(POLY_OPA_DISP++, cursorEnvRed, cursorEnvGreen, cursorEnvBlue, 0xFF); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->titleAlpha[0]); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); + } + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 120, 120, 120, this->titleAlpha[0]); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); + } + + gDPLoadTextureBlock(POLY_OPA_DISP++, sOptionsMenuSettings[i].texture[gSaveContext.language], G_IM_FMT_IA, + G_IM_SIZ_8b, sZTargetSettingWidths[j][gSaveContext.language], + OPTIONS_MENU_TEXTURE_HEIGHT(sOptionsMenuHeaders[i]), 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, vtx, vtx + 2, vtx + 3, vtx + 1, 0); } + gSPVertex(POLY_OPA_DISP++, gOptionsMenuBrightnessVtx, 8, 0); + vtx = 0; +#endif + gDPPipeSync(POLY_OPA_DISP++); // check brightness bars @@ -1004,6 +1816,33 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) { vtx += 4; +#if OOT_PAL_N64 + gSPVertex(POLY_OPA_DISP++, gOptionsMenuLanguageVtx, 12, 0); + + for (i = 0, vtx = 0; i != LANGUAGE_MAX; i++, vtx += 4) { + gDPPipeSync(POLY_OPA_DISP++); + + if (i == gSaveContext.language) { + if (sSelectedSetting == FS_SETTING_LANGUAGE) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, cursorPrimRed, cursorPrimGreen, cursorPrimBlue, + this->titleAlpha[0]); + gDPSetEnvColor(POLY_OPA_DISP++, cursorEnvRed, cursorEnvGreen, cursorEnvBlue, 0xFF); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->titleAlpha[0]); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); + } + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 120, 120, 120, this->titleAlpha[0]); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); + } + + gDPLoadTextureBlock(POLY_OPA_DISP++, sLanguageChoices[i].texture, G_IM_FMT_IA, G_IM_SIZ_8b, + sLanguageChoices[i].width, sLanguageChoices[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_OPA_DISP++, vtx, vtx + 2, vtx + 3, vtx + 1, 0); + } +#endif + // blue divider lines gDPPipeSync(POLY_OPA_DISP++); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 255, 255, this->titleAlpha[0]); @@ -1015,28 +1854,34 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) { Matrix_Push(); Matrix_Translate(0.0f, 0.1f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_file_nameset_PAL.c", 1009), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPVertex(POLY_OPA_DISP++, gOptionsDividerTopVtx, 4, 0); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, this->state.gfxCtx, "../z_file_nameset_PAL.c", 1009); + gSPVertex(POLY_OPA_DISP++, gOptionsDividerSoundVtx, 4, 0); gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); Matrix_Pop(); Matrix_Push(); Matrix_Translate(0.0f, 0.2f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_file_nameset_PAL.c", 1021), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, this->state.gfxCtx, "../z_file_nameset_PAL.c", 1021); - gSPVertex(POLY_OPA_DISP++, gOptionsDividerMiddleVtx, 4, 0); + gSPVertex(POLY_OPA_DISP++, gOptionsDividerZTargetVtx, 4, 0); gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); Matrix_Pop(); Matrix_Push(); Matrix_Translate(0.0f, 0.4f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_file_nameset_PAL.c", 1033), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPVertex(POLY_OPA_DISP++, gOptionsDividerBottomVtx, 4, 0); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, this->state.gfxCtx, "../z_file_nameset_PAL.c", 1033); + gSPVertex(POLY_OPA_DISP++, gOptionsDividerBrightnessVtx, 4, 0); + gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); + Matrix_Pop(); + +#if OOT_PAL_N64 + Matrix_Push(); + Matrix_Translate(0.0f, 0.8f, 0.0f, MTXMODE_APPLY); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, this->state.gfxCtx, "../z_file_nameset_PAL.c", 0); + gSPVertex(POLY_OPA_DISP++, gOptionsDividerLanguageVtx, 4, 0); gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); Matrix_Pop(); +#endif CLOSE_DISPS(this->state.gfxCtx, "../z_file_nameset_PAL.c", 1040); } diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_nameset_data.c b/src/overlays/gamestates/ovl_file_choose/z_file_nameset_data.c index d6bc09c282..2fc9670b89 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_nameset_data.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_nameset_data.c @@ -1,11 +1 @@ -#include "file_select.h" - #include "assets/overlays/ovl_file_choose/ovl_file_choose.c" - -s16 D_808123F0[] = { - 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, - 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, - 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, - 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, - 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0040, 0x003F, 0x003E, -}; diff --git a/src/overlays/gamestates/ovl_title/z_title.c b/src/overlays/gamestates/ovl_title/z_title.c index 748b3b1daf..dfeb16a3d3 100644 --- a/src/overlays/gamestates/ovl_title/z_title.c +++ b/src/overlays/gamestates/ovl_title/z_title.c @@ -6,41 +6,46 @@ #include "global.h" #include "alloca.h" +#include "versions.h" + +#if PLATFORM_N64 +#include "cic6105.h" +#include "n64dd.h" +#endif + #include "assets/textures/nintendo_rogo_static/nintendo_rogo_static.h" +#if IS_DEBUG void ConsoleLogo_PrintBuildInfo(Gfx** gfxP) { - if (IS_DEBUG) { - Gfx* gfx; - GfxPrint* printer; + Gfx* gfx; + GfxPrint* printer; - gfx = *gfxP; - gfx = Gfx_SetupDL_28(gfx); - printer = alloca(sizeof(GfxPrint)); - GfxPrint_Init(printer); - GfxPrint_Open(printer, gfx); + gfx = *gfxP; + gfx = Gfx_SetupDL_28(gfx); + printer = alloca(sizeof(GfxPrint)); + GfxPrint_Init(printer); + GfxPrint_Open(printer, gfx); - GfxPrint_SetColor(printer, 255, 255, 255, 255); + GfxPrint_SetColor(printer, 255, 255, 255, 255); - GfxPrint_SetPos(printer, WIDE_MULT(7, WIDE_GET_16_9), 22); - GfxPrint_Printf(printer, "[Version:%s]", gBuildGitVersion); + GfxPrint_SetPos(printer, WIDE_MULT(7, WIDE_GET_16_9), 22); + GfxPrint_Printf(printer, "[Version:%s]", gBuildGitVersion); - GfxPrint_SetPos(printer, WIDE_MULT(7, WIDE_GET_16_9), 23); - GfxPrint_Printf(printer, "[Build Option:%s]", gBuildMakeOption); + GfxPrint_SetPos(printer, WIDE_MULT(7, WIDE_GET_16_9), 23); + GfxPrint_Printf(printer, "[Build Option:%s]", gBuildMakeOption); - if (ENABLE_F3DEX3) { - GfxPrint_SetColor(printer, gRainbow.color.r, gRainbow.color.g, gRainbow.color.b, 255); - GfxPrint_SetPos(printer, WIDE_MULT(7, WIDE_GET_16_9), 25); - GfxPrint_Printf(printer, "Powered by F3DEX3!"); - } - - gfx = GfxPrint_Close(printer); - GfxPrint_Destroy(printer); - *gfxP = gfx; + if (ENABLE_F3DEX3) { + GfxPrint_SetColor(printer, gRainbow.color.r, gRainbow.color.g, gRainbow.color.b, 255); + GfxPrint_SetPos(printer, WIDE_MULT(7, WIDE_GET_16_9), 25); + GfxPrint_Printf(printer, "Powered by F3DEX3!"); } + + gfx = GfxPrint_Close(printer); + GfxPrint_Destroy(printer); + *gfxP = gfx; } +#endif -// Note: In other rom versions this function also updates unk_1D4, coverAlpha, addAlpha, visibleDuration to calculate -// the fade-in/fade-out + the duration of the n64 logo animation void ConsoleLogo_Calc(ConsoleLogoState* this) { if (SKIP_N64_BOOT_LOGO) { this->exit = true; @@ -116,7 +121,7 @@ void ConsoleLogo_Draw(ConsoleLogoState* this) { Matrix_Scale(1.0, 1.0, 1.0, MTXMODE_APPLY); Matrix_RotateZYX(0, sTitleRotY, 0, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(this->state.gfxCtx, "../z_title.c", 424), G_MTX_LOAD); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, this->state.gfxCtx, "../z_title.c", 424); gSPDisplayList(POLY_OPA_DISP++, gNintendo64LogoDL); Gfx_SetupDL_39Opa(this->state.gfxCtx); gDPPipeSync(POLY_OPA_DISP++); @@ -159,9 +164,9 @@ void ConsoleLogo_Main(GameState* thisx) { ConsoleLogo_Calc(this); ConsoleLogo_Draw(this); - if (IS_DEBUG) { - ConsoleLogo_PrintBuildInfo(&POLY_OPA_DISP); - } +#if IS_DEBUG + ConsoleLogo_PrintBuildInfo(&POLY_OPA_DISP); +#endif if (this->exit) { gSaveContext.seqId = (u8)NA_BGM_DISABLED; @@ -177,13 +182,37 @@ void ConsoleLogo_Main(GameState* thisx) { void ConsoleLogo_Destroy(GameState* thisx) { ConsoleLogoState* this = (ConsoleLogoState*)thisx; +#if PLATFORM_N64 + if (this->unk_1E0) { + if (func_801C7818() != 0) { + func_800D31A0(); + } + func_801C7268(); + } +#endif + Sram_InitSram(&this->state, &this->sramCtx); + +#if PLATFORM_N64 + func_800014E8(); +#endif } void ConsoleLogo_Init(GameState* thisx) { u32 size = (uintptr_t)_nintendo_rogo_staticSegmentRomEnd - (uintptr_t)_nintendo_rogo_staticSegmentRomStart; ConsoleLogoState* this = (ConsoleLogoState*)thisx; +#if PLATFORM_N64 + if ((D_80121210 != 0) && (D_80121211 != 0) && (D_80121212 == 0)) { + if (func_801C7658() != 0) { + func_800D31A0(); + } + this->unk_1E0 = true; + } else { + this->unk_1E0 = false; + } +#endif + this->staticSegment = GAME_STATE_ALLOC(&this->state, size, "../z_title.c", 611); PRINTF("z_title.c\n"); ASSERT(this->staticSegment != NULL, "this->staticSegment != NULL", "../z_title.c", 614); @@ -194,7 +223,17 @@ void ConsoleLogo_Init(GameState* thisx) { this->state.main = ConsoleLogo_Main; this->state.destroy = ConsoleLogo_Destroy; this->exit = false; + +#if OOT_VERSION < GC_US + if (!(gPadMgr.validCtrlrsMask & 1)) { + gSaveContext.fileNum = 0xFEDC; + } else { + gSaveContext.fileNum = 0xFF; + } +#else gSaveContext.fileNum = 0xFF; +#endif + Sram_Alloc(&this->state, &this->sramCtx); this->ult = 0; this->timer = 20; diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index ae13be22ee..c32cf65994 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -2,34 +2,62 @@ #include "assets/textures/parameter_static/parameter_static.h" #include "assets/textures/icon_item_static/icon_item_static.h" +#define SONG_MAX_LENGTH 8 + +#if N64_BTN_COLORS +#define QUEST_OCARINA_BTN_A_COLOR_R 80 +#define QUEST_OCARINA_BTN_A_COLOR_G 150 +#define QUEST_OCARINA_BTN_A_COLOR_B 255 +#else +#define QUEST_OCARINA_BTN_A_COLOR_R 80 +#define QUEST_OCARINA_BTN_A_COLOR_G 255 +#define QUEST_OCARINA_BTN_A_COLOR_B 150 +#endif + void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { - static s16 D_8082A070[][4] = { + static s16 sHpPrimColors[][4] = { { 255, 0, 0, 255 }, { 255, 70, 0, 150 }, { 255, 70, 0, 150 }, { 255, 0, 0, 255 }, }; - static s16 D_8082A090[][3] = { - { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, - { 0, 60, 0 }, { 90, 0, 0 }, { 0, 40, 110 }, { 80, 40, 0 }, { 70, 0, 90 }, { 90, 90, 0 }, - }; - static s16 D_8082A0D8[] = { 255, 255, 255, 255, 255, 255 }; - static s16 D_8082A0E4[] = { 255, 255, 255, 255, 255, 255 }; - static s16 D_8082A0F0[] = { 150, 150, 150, 150, 150, 150 }; - static s16 D_8082A0FC = 20; - static s16 D_8082A100 = 0; - static s16 D_8082A104 = 0; - static s16 D_8082A108 = 0; - static s16 D_8082A10C = 0; - static s16 D_8082A110 = 0; - static s16 D_8082A114 = 20; - static s16 D_8082A118 = 0; - static s16 D_8082A11C = 0; - static s16 D_8082A120 = 0; - static u8 D_8082A124[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + // Shining medallions + static s16 sMedallionsEnvColors[6 + 6][3] = { + // Target env color when sMedallionsEnvShineState == 0 + { 0, 0, 0 }, // QUEST_MEDALLION_FOREST + { 0, 0, 0 }, // QUEST_MEDALLION_FIRE + { 0, 0, 0 }, // QUEST_MEDALLION_WATER + { 0, 0, 0 }, // QUEST_MEDALLION_SPIRIT + { 0, 0, 0 }, // QUEST_MEDALLION_SHADOW + { 0, 0, 0 }, // QUEST_MEDALLION_LIGHT + + // Target env color when sMedallionsEnvShineState == 2 + { 0, 60, 0 }, // QUEST_MEDALLION_FOREST + { 90, 0, 0 }, // QUEST_MEDALLION_FIRE + { 0, 40, 110 }, // QUEST_MEDALLION_WATER + { 80, 40, 0 }, // QUEST_MEDALLION_SPIRIT + { 70, 0, 90 }, // QUEST_MEDALLION_SHADOW + { 90, 90, 0 }, // QUEST_MEDALLION_LIGHT }; - static void* D_8082A130[] = { + // Current (animated) env color for each medallion + static s16 sMedallionsEnvRed[6] = { 255, 255, 255, 255, 255, 255 }; + static s16 sMedallionsEnvGreen[6] = { 255, 255, 255, 255, 255, 255 }; + static s16 sMedallionsEnvBlue[6] = { 150, 150, 150, 150, 150, 150 }; + static s16 sMedallionsEnvTimer = 20; + static s16 sMedallionsEnvShineState = 0; + + static s16 sHpPrimRed = 0; + static s16 sHpPrimGreen = 0; + static s16 sHpPrimBlue = 0; + static s16 sHpPrimAlpha = 0; + static s16 sHpPrimTimer = 20; + static s16 sHpPrimState = 0; + + static s16 sPlayedSongBtnsNum = 0; + static s16 sPlaybackSongStartDelayTimer = 0; + static u8 sPlayedSongBtns[SONG_MAX_LENGTH + 1] = { 0 }; + static void* sOcarinaBtnTextures[] = { gOcarinaBtnIconATex, // OCARINA_BTN_A gOcarinaBtnIconCDownTex, // OCARINA_BTN_C_DOWN gOcarinaBtnIconCRightTex, // OCARINA_BTN_C_RIGHT @@ -39,123 +67,200 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { static u16 D_8082A144[] = { 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, }; - static s16 D_8082A150[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + static s16 sPlayedSongBtnsAlpha[SONG_MAX_LENGTH] = { 0 }; + static s32 sUnused1 = 0; + + static s16 sSongsPrimRed[] = { + 150, // QUEST_SONG_MINUET + 255, // QUEST_SONG_BOLERO + 100, // QUEST_SONG_SERENADE + 255, // QUEST_SONG_REQUIEM + 255, // QUEST_SONG_NOCTURNE + 255, // QUEST_SONG_PRELUDE + 255, // QUEST_SONG_LULLABY + 255, // QUEST_SONG_EPONA + 255, // QUEST_SONG_SARIA + 255, // QUEST_SONG_SUN + 255, // QUEST_SONG_TIME + 255, // QUEST_SONG_STORMS }; - static s16 D_8082A164[] = { - 150, 255, 100, 255, 255, 255, 255, 255, 255, 255, 255, 255, + static s16 sSongsPrimGreen[] = { + 255, // QUEST_SONG_MINUET + 80, // QUEST_SONG_BOLERO + 150, // QUEST_SONG_SERENADE + 160, // QUEST_SONG_REQUIEM + 100, // QUEST_SONG_NOCTURNE + 240, // QUEST_SONG_PRELUDE + 255, // QUEST_SONG_LULLABY + 255, // QUEST_SONG_EPONA + 255, // QUEST_SONG_SARIA + 255, // QUEST_SONG_SUN + 255, // QUEST_SONG_TIME + 255, // QUEST_SONG_STORMS }; - static s16 D_8082A17C[] = { - 255, 80, 150, 160, 100, 240, 255, 255, 255, 255, 255, 255, + static s16 sSongsPrimBlue[] = { + 100, // QUEST_SONG_MINUET + 40, // QUEST_SONG_BOLERO + 255, // QUEST_SONG_SERENADE + 0, // QUEST_SONG_REQUIEM + 255, // QUEST_SONG_NOCTURNE + 100, // QUEST_SONG_PRELUDE + 255, // QUEST_SONG_LULLABY + 255, // QUEST_SONG_EPONA + 255, // QUEST_SONG_SARIA + 255, // QUEST_SONG_SUN + 255, // QUEST_SONG_TIME + 255, // QUEST_SONG_STORMS }; - static s16 D_8082A194[] = { - 100, 40, 255, 0, 255, 100, 255, 255, 255, 255, 255, 255, + + enum { + /* -3 */ CURSOR_TO_LEFT = -3, // Cursor on the "scroll to left page" position + /* -2 */ CURSOR_TO_RIGHT, // Cursor on the "scroll to right page" position + /* -1 */ CURSOR_NONE // No position in that direction, cursor stays where it is }; - static s8 D_8082A1AC[][4] = { - { 0x05, 0x01, 0x05, 0xFE }, { 0x00, 0x02, 0x02, 0xFE }, { 0xFF, 0x13, 0x03, 0x01 }, { 0x04, 0x02, 0x11, 0x02 }, - { 0x05, 0x03, 0x18, 0x05 }, { 0xFF, 0xFF, 0x04, 0x00 }, { 0x0C, 0xFF, 0xFD, 0x07 }, { 0x0D, 0xFF, 0x06, 0x08 }, - { 0x0E, 0xFF, 0x07, 0x09 }, { 0x0F, 0xFF, 0x08, 0x0A }, { 0x10, 0xFF, 0x09, 0x0B }, { 0x11, 0xFF, 0x0A, 0x12 }, - { 0x17, 0x06, 0xFD, 0x0D }, { 0x17, 0x07, 0x0C, 0x0E }, { 0x17, 0x08, 0x0D, 0x0F }, { 0x18, 0x09, 0x0E, 0x10 }, - { 0x18, 0x0A, 0x0F, 0x11 }, { 0x18, 0x0B, 0x10, 0x03 }, { 0x02, 0xFF, 0x0B, 0x13 }, { 0x02, 0xFF, 0x12, 0x14 }, - { 0x02, 0xFF, 0x13, 0xFE }, { 0xFF, 0x17, 0xFD, 0x16 }, { 0xFF, 0x17, 0x15, 0x18 }, { 0x15, 0x0C, 0xFD, 0x18 }, - { 0xFF, 0x10, 0x16, 0x04 }, { 0x00, 0x00, 0x00, 0x00 }, + // Each {up, down, left, right} entry defines where the cursor can move next + static s8 sCursorPointLinks[][4] = { + /* QUEST_MEDALLION_FOREST */ + { QUEST_MEDALLION_LIGHT, QUEST_MEDALLION_FIRE, QUEST_MEDALLION_LIGHT, CURSOR_TO_RIGHT }, + /* QUEST_MEDALLION_FIRE */ + { QUEST_MEDALLION_FOREST, QUEST_MEDALLION_WATER, QUEST_MEDALLION_WATER, CURSOR_TO_RIGHT }, + /* QUEST_MEDALLION_WATER */ { CURSOR_NONE, QUEST_GORON_RUBY, QUEST_MEDALLION_SPIRIT, QUEST_MEDALLION_FIRE }, + /* QUEST_MEDALLION_SPIRIT */ + { QUEST_MEDALLION_SHADOW, QUEST_MEDALLION_WATER, QUEST_SONG_STORMS, QUEST_MEDALLION_WATER }, + /* QUEST_MEDALLION_SHADOW */ + { QUEST_MEDALLION_LIGHT, QUEST_MEDALLION_SPIRIT, QUEST_HEART_PIECE, QUEST_MEDALLION_LIGHT }, + /* QUEST_MEDALLION_LIGHT */ { CURSOR_NONE, CURSOR_NONE, QUEST_MEDALLION_SHADOW, QUEST_MEDALLION_FOREST }, + /* QUEST_SONG_MINUET */ { QUEST_SONG_LULLABY, CURSOR_NONE, CURSOR_TO_LEFT, QUEST_SONG_BOLERO }, + /* QUEST_SONG_BOLERO */ { QUEST_SONG_EPONA, CURSOR_NONE, QUEST_SONG_MINUET, QUEST_SONG_SERENADE }, + /* QUEST_SONG_SERENADE */ { QUEST_SONG_SARIA, CURSOR_NONE, QUEST_SONG_BOLERO, QUEST_SONG_REQUIEM }, + /* QUEST_SONG_REQUIEM */ { QUEST_SONG_SUN, CURSOR_NONE, QUEST_SONG_SERENADE, QUEST_SONG_NOCTURNE }, + /* QUEST_SONG_NOCTURNE */ { QUEST_SONG_TIME, CURSOR_NONE, QUEST_SONG_REQUIEM, QUEST_SONG_PRELUDE }, + /* QUEST_SONG_PRELUDE */ { QUEST_SONG_STORMS, CURSOR_NONE, QUEST_SONG_NOCTURNE, QUEST_KOKIRI_EMERALD }, + /* QUEST_SONG_LULLABY */ { QUEST_SKULL_TOKEN, QUEST_SONG_MINUET, CURSOR_TO_LEFT, QUEST_SONG_EPONA }, + /* QUEST_SONG_EPONA */ { QUEST_SKULL_TOKEN, QUEST_SONG_BOLERO, QUEST_SONG_LULLABY, QUEST_SONG_SARIA }, + /* QUEST_SONG_SARIA */ { QUEST_SKULL_TOKEN, QUEST_SONG_SERENADE, QUEST_SONG_EPONA, QUEST_SONG_SUN }, + /* QUEST_SONG_SUN */ { QUEST_HEART_PIECE, QUEST_SONG_REQUIEM, QUEST_SONG_SARIA, QUEST_SONG_TIME }, + /* QUEST_SONG_TIME */ { QUEST_HEART_PIECE, QUEST_SONG_NOCTURNE, QUEST_SONG_SUN, QUEST_SONG_STORMS }, + /* QUEST_SONG_STORMS */ { QUEST_HEART_PIECE, QUEST_SONG_PRELUDE, QUEST_SONG_TIME, QUEST_MEDALLION_SPIRIT }, + /* QUEST_KOKIRI_EMERALD */ { QUEST_MEDALLION_WATER, CURSOR_NONE, QUEST_SONG_PRELUDE, QUEST_GORON_RUBY }, + /* QUEST_GORON_RUBY */ { QUEST_MEDALLION_WATER, CURSOR_NONE, QUEST_KOKIRI_EMERALD, QUEST_ZORA_SAPPHIRE }, + /* QUEST_ZORA_SAPPHIRE */ { QUEST_MEDALLION_WATER, CURSOR_NONE, QUEST_GORON_RUBY, CURSOR_TO_RIGHT }, + /* QUEST_STONE_OF_AGONY */ { CURSOR_NONE, QUEST_SKULL_TOKEN, CURSOR_TO_LEFT, QUEST_GERUDOS_CARD }, + /* QUEST_GERUDOS_CARD */ { CURSOR_NONE, QUEST_SKULL_TOKEN, QUEST_STONE_OF_AGONY, QUEST_HEART_PIECE }, + /* QUEST_SKULL_TOKEN */ { QUEST_STONE_OF_AGONY, QUEST_SONG_LULLABY, CURSOR_TO_LEFT, QUEST_HEART_PIECE }, + /* QUEST_HEART_PIECE */ { CURSOR_NONE, QUEST_SONG_TIME, QUEST_GERUDOS_CARD, QUEST_MEDALLION_SHADOW }, }; + static s32 sUnused2 = 0; + PauseContext* pauseCtx = &play->pauseCtx; Input* input = &play->state.input[0]; - s16 sp226; - s16 sp224; - s16 sp222; - s16 sp220; - s16 phi_s0; - s16 phi_s3; - s16 sp21A; - s16 sp218; - s16 sp216; - s16 pad1; - s16 phi_v1; + s16 stepRed; + s16 stepGreen; + s16 stepBlue; + s16 stepAlpha; + s16 nextCursorPoint; + s16 prevCursorPoint; + s16 bufI; + s16 j; + s16 cursor; + s16 i; + s16 targetColorIndex; s16 pad2; s16 cursorItem; - s16 sp208[3]; + s16 gsTokenDigits[3]; OPEN_DISPS(gfxCtx, "../z_kaleido_collect.c", 248); - if ((((u32)pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || (pauseCtx->mainState == PAUSE_MAIN_STATE_5) || - (pauseCtx->mainState == PAUSE_MAIN_STATE_8)) && + if ((((u32)pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) && (pauseCtx->pageIndex == PAUSE_QUEST)) { + pauseCtx->cursorColorSet = 0; if (pauseCtx->cursorSpecialPos == 0) { pauseCtx->nameColorSet = 0; if ((pauseCtx->state != PAUSE_STATE_MAIN) || ((pauseCtx->stickAdjX == 0) && (pauseCtx->stickAdjY == 0))) { - sp216 = pauseCtx->cursorSlot[PAUSE_QUEST]; + // No cursor movement + cursor = pauseCtx->cursorSlot[PAUSE_QUEST]; } else { - phi_s3 = pauseCtx->cursorPoint[PAUSE_QUEST]; + // Move cursor based on stick input + + prevCursorPoint = pauseCtx->cursorPoint[PAUSE_QUEST]; if (pauseCtx->stickAdjX < -30) { - phi_s0 = D_8082A1AC[phi_s3][2]; - if (phi_s0 == -3) { + // Move cursor left + nextCursorPoint = sCursorPointLinks[prevCursorPoint][2]; + if (nextCursorPoint == CURSOR_TO_LEFT) { KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT); pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; } else { - while (phi_s0 >= 0) { - if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { + while (nextCursorPoint >= 0) { + if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, nextCursorPoint)) { break; } - phi_s0 = D_8082A1AC[phi_s0][2]; + nextCursorPoint = sCursorPointLinks[nextCursorPoint][2]; } } } else if (pauseCtx->stickAdjX > 30) { - phi_s0 = D_8082A1AC[phi_s3][3]; - if (phi_s0 == -2) { + // Move cursor right + nextCursorPoint = sCursorPointLinks[prevCursorPoint][3]; + if (nextCursorPoint == CURSOR_TO_RIGHT) { KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT); pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; } else { - while (phi_s0 >= 0) { - if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { + while (nextCursorPoint >= 0) { + if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, nextCursorPoint)) { break; } - phi_s0 = D_8082A1AC[phi_s0][3]; + nextCursorPoint = sCursorPointLinks[nextCursorPoint][3]; } } } if (pauseCtx->stickAdjY < -30) { - phi_s0 = D_8082A1AC[phi_s3][1]; - while (phi_s0 >= 0) { - if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { + // Move cursor down + nextCursorPoint = sCursorPointLinks[prevCursorPoint][1]; + while (nextCursorPoint >= 0) { + if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, nextCursorPoint)) { break; } - phi_s0 = D_8082A1AC[phi_s0][1]; + nextCursorPoint = sCursorPointLinks[nextCursorPoint][1]; } } else if (pauseCtx->stickAdjY > 30) { - phi_s0 = D_8082A1AC[phi_s3][0]; - while (phi_s0 >= 0) { - if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { + // Move cursor up + nextCursorPoint = sCursorPointLinks[prevCursorPoint][0]; + while (nextCursorPoint >= 0) { + if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, nextCursorPoint)) { break; } - phi_s0 = D_8082A1AC[phi_s0][0]; + nextCursorPoint = sCursorPointLinks[nextCursorPoint][0]; } } - if (phi_s3 != pauseCtx->cursorPoint[PAUSE_QUEST]) { + // if the cursor point changed + if (pauseCtx->cursorPoint[PAUSE_QUEST] != prevCursorPoint) { pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - if (pauseCtx->cursorPoint[PAUSE_QUEST] != 0x18) { + // Update cursor item and slot + + if (pauseCtx->cursorPoint[PAUSE_QUEST] != QUEST_HEART_PIECE) { if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { - if (pauseCtx->cursorPoint[PAUSE_QUEST] < 6) { - cursorItem = ITEM_MEDALLION_FOREST + pauseCtx->cursorPoint[PAUSE_QUEST]; + if (pauseCtx->cursorPoint[PAUSE_QUEST] < QUEST_SONG_MINUET) { + cursorItem = + ITEM_MEDALLION_FOREST - QUEST_MEDALLION_FOREST + pauseCtx->cursorPoint[PAUSE_QUEST]; PRINTF("000 ccc=%d\n", cursorItem); - } else if (pauseCtx->cursorPoint[PAUSE_QUEST] < 0x12) { - cursorItem = ITEM_SCALE_GOLDEN + pauseCtx->cursorPoint[PAUSE_QUEST]; + } else if (pauseCtx->cursorPoint[PAUSE_QUEST] < QUEST_KOKIRI_EMERALD) { + cursorItem = ITEM_SONG_MINUET - QUEST_SONG_MINUET + pauseCtx->cursorPoint[PAUSE_QUEST]; PRINTF("111 ccc=%d\n", cursorItem); } else { - cursorItem = ITEM_SONG_MINUET + pauseCtx->cursorPoint[PAUSE_QUEST]; - PRINTF("222 ccc=%d (%d, %d, %d)\n", cursorItem, pauseCtx->cursorPoint[PAUSE_QUEST], 0x12, - 0x6C); + cursorItem = + ITEM_KOKIRI_EMERALD - QUEST_KOKIRI_EMERALD + pauseCtx->cursorPoint[PAUSE_QUEST]; + PRINTF("222 ccc=%d (%d, %d, %d)\n", cursorItem, pauseCtx->cursorPoint[PAUSE_QUEST], + QUEST_KOKIRI_EMERALD, ITEM_KOKIRI_EMERALD); } } else { cursorItem = PAUSE_ITEM_NONE; @@ -171,185 +276,215 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { ITEM_HEART_CONTAINER, gSaveContext.save.info.inventory.questItems & 0xF0000000); } - sp216 = pauseCtx->cursorPoint[PAUSE_QUEST]; + cursor = pauseCtx->cursorPoint[PAUSE_QUEST]; pauseCtx->cursorItem[pauseCtx->pageIndex] = cursorItem; - pauseCtx->cursorSlot[pauseCtx->pageIndex] = sp216; + pauseCtx->cursorSlot[pauseCtx->pageIndex] = cursor; } - KaleidoScope_SetCursorVtx(pauseCtx, sp216 * 4, pauseCtx->questVtx); + KaleidoScope_SetCursorPos(pauseCtx, cursor * 4, pauseCtx->questVtx); if ((pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && (pauseCtx->cursorSpecialPos == 0)) { - if ((sp216 >= QUEST_SONG_MINUET) && (sp216 < QUEST_KOKIRI_EMERALD)) { + if ((cursor >= QUEST_SONG_MINUET) && (cursor < QUEST_KOKIRI_EMERALD)) { if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { - sp216 = pauseCtx->cursorSlot[PAUSE_QUEST]; - pauseCtx->ocarinaSongIdx = gOcarinaSongItemMap[sp216 - QUEST_SONG_MINUET]; - D_8082A120 = 10; + cursor = pauseCtx->cursorSlot[PAUSE_QUEST]; + pauseCtx->ocarinaSongIdx = gOcarinaSongItemMap[cursor - QUEST_SONG_MINUET]; + sPlaybackSongStartDelayTimer = 10; - for (phi_s3 = 0; phi_s3 < 8; phi_s3++) { - D_8082A124[phi_s3] = 0xFF; - D_8082A150[phi_s3] = 0; + for (i = 0; i < SONG_MAX_LENGTH; i++) { + sPlayedSongBtns[i] = OCARINA_BTN_INVALID; + sPlayedSongBtnsAlpha[i] = 0; } + sPlayedSongBtnsNum = 0; - D_8082A11C = 0; AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); AudioOcarina_Start((1 << pauseCtx->ocarinaSongIdx) + 0x8000); pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); pauseCtx->ocarinaStaff->pos = 0; pauseCtx->ocarinaStaff->state = 0xFF; - VREG(21) = -62; - VREG(22) = -56; - VREG(23) = -49; - VREG(24) = -46; - VREG(25) = -41; - pauseCtx->mainState = PAUSE_MAIN_STATE_8; + + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_A) = -62; + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_C_DOWN) = -56; + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_C_RIGHT) = -49; + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_C_LEFT) = -46; + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_C_UP) = -41; + + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG; + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); } } - } else if (pauseCtx->mainState == PAUSE_MAIN_STATE_5) { + } else if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT) { + // Abort having the player play the song if the stick is moved if ((pauseCtx->stickAdjX != 0) || (pauseCtx->stickAdjY != 0)) { pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); } - } else if (pauseCtx->mainState == PAUSE_MAIN_STATE_8) { - if (CHECK_BTN_ALL(input->press.button, BTN_A) && (sp216 >= QUEST_SONG_MINUET) && - (sp216 < QUEST_KOKIRI_EMERALD)) { - pauseCtx->mainState = PAUSE_MAIN_STATE_9; - D_8082A120 = 10; + } else if (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG) { + if (CHECK_BTN_ALL(input->press.button, BTN_A) && (cursor >= QUEST_SONG_MINUET) && + (cursor < QUEST_KOKIRI_EMERALD)) { + + pauseCtx->mainState = PAUSE_MAIN_STATE_SONG_PLAYBACK_START; + + sPlaybackSongStartDelayTimer = 10; } } } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { if (pauseCtx->stickAdjX > 30) { - pauseCtx->cursorPoint[PAUSE_QUEST] = 0x15; + // Move cursor right from the "scroll to left page" position + + pauseCtx->cursorPoint[PAUSE_QUEST] = QUEST_STONE_OF_AGONY; pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; - sp216 = pauseCtx->cursorPoint[PAUSE_QUEST]; - KaleidoScope_SetCursorVtx(pauseCtx, sp216 * 4, pauseCtx->questVtx); + + cursor = pauseCtx->cursorPoint[PAUSE_QUEST]; + KaleidoScope_SetCursorPos(pauseCtx, cursor * 4, pauseCtx->questVtx); Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { - cursorItem = ITEM_SONG_MINUET + pauseCtx->cursorPoint[PAUSE_QUEST]; + cursorItem = ITEM_STONE_OF_AGONY - QUEST_STONE_OF_AGONY + pauseCtx->cursorPoint[PAUSE_QUEST]; } else { cursorItem = PAUSE_ITEM_NONE; } - sp216 = pauseCtx->cursorPoint[PAUSE_QUEST]; + cursor = pauseCtx->cursorPoint[PAUSE_QUEST]; pauseCtx->cursorItem[pauseCtx->pageIndex] = cursorItem; - pauseCtx->cursorSlot[pauseCtx->pageIndex] = sp216; + pauseCtx->cursorSlot[pauseCtx->pageIndex] = cursor; } - } else { + } else { // cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT if (pauseCtx->stickAdjX < -30) { - pauseCtx->cursorPoint[PAUSE_QUEST] = 0; + // Move cursor left from the "scroll to right page" position + + pauseCtx->cursorPoint[PAUSE_QUEST] = QUEST_MEDALLION_FOREST; pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; - sp216 = pauseCtx->cursorPoint[PAUSE_QUEST]; - KaleidoScope_SetCursorVtx(pauseCtx, sp216 * 4, pauseCtx->questVtx); + + cursor = pauseCtx->cursorPoint[PAUSE_QUEST]; + KaleidoScope_SetCursorPos(pauseCtx, cursor * 4, pauseCtx->questVtx); Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { - if (pauseCtx->cursorPoint[PAUSE_QUEST] < 6) { - cursorItem = ITEM_MEDALLION_FOREST + pauseCtx->cursorPoint[PAUSE_QUEST]; - } else if (pauseCtx->cursorPoint[PAUSE_QUEST] < 0xC) { - cursorItem = ITEM_BOMB_BAG_30 + pauseCtx->cursorPoint[PAUSE_QUEST]; + // Only the first if may be reached, as QUEST_MEDALLION_FOREST is set above + if (pauseCtx->cursorPoint[PAUSE_QUEST] < QUEST_SONG_MINUET) { + cursorItem = + ITEM_MEDALLION_FOREST - QUEST_MEDALLION_FOREST + pauseCtx->cursorPoint[PAUSE_QUEST]; + } else if (pauseCtx->cursorPoint[PAUSE_QUEST] < QUEST_SONG_LULLABY) { + // this would result in the wrong item + cursorItem = ITEM_SCALE_GOLDEN - QUEST_SONG_MINUET + pauseCtx->cursorPoint[PAUSE_QUEST]; } else { - cursorItem = ITEM_MEDALLION_SPIRIT + pauseCtx->cursorPoint[PAUSE_QUEST]; + // this would result in the wrong item + cursorItem = ITEM_DUNGEON_COMPASS - QUEST_SONG_LULLABY + pauseCtx->cursorPoint[PAUSE_QUEST]; } } else { cursorItem = PAUSE_ITEM_NONE; } - sp216 = pauseCtx->cursorPoint[PAUSE_QUEST]; + cursor = pauseCtx->cursorPoint[PAUSE_QUEST]; pauseCtx->cursorItem[pauseCtx->pageIndex] = cursorItem; - pauseCtx->cursorSlot[pauseCtx->pageIndex] = sp216; + pauseCtx->cursorSlot[pauseCtx->pageIndex] = cursor; } } - } else { - if (pauseCtx->mainState == PAUSE_MAIN_STATE_9) { - pauseCtx->cursorColorSet = 8; + } else if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PLAYBACK_START) { + // After a short delay, start playing the selected song back to the player - if (--D_8082A120 == 0) { - for (phi_s3 = 0; phi_s3 < 8; phi_s3++) { - D_8082A124[phi_s3] = 0xFF; - D_8082A150[phi_s3] = 0; - } + pauseCtx->cursorColorSet = 8; - D_8082A11C = 0; - VREG(21) = -62; - VREG(22) = -56; - VREG(23) = -49; - VREG(24) = -46; - VREG(25) = -41; - sp216 = pauseCtx->cursorSlot[PAUSE_QUEST]; - AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); - AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); - pauseCtx->ocarinaSongIdx = gOcarinaSongItemMap[sp216 - QUEST_SONG_MINUET]; - AudioOcarina_SetPlaybackSong(pauseCtx->ocarinaSongIdx + 1, 1); - pauseCtx->mainState = PAUSE_MAIN_STATE_2; - pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); - pauseCtx->ocarinaStaff->pos = 0; - sp216 = pauseCtx->cursorSlot[PAUSE_QUEST]; - KaleidoScope_SetCursorVtx(pauseCtx, sp216 * 4, pauseCtx->questVtx); + if (--sPlaybackSongStartDelayTimer == 0) { + for (i = 0; i < SONG_MAX_LENGTH; i++) { + sPlayedSongBtns[i] = OCARINA_BTN_INVALID; + sPlayedSongBtnsAlpha[i] = 0; } - } else { - sp216 = pauseCtx->cursorSlot[PAUSE_QUEST]; - KaleidoScope_SetCursorVtx(pauseCtx, sp216 * 4, pauseCtx->questVtx); + sPlayedSongBtnsNum = 0; + + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_A) = -62; + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_C_DOWN) = -56; + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_C_RIGHT) = -49; + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_C_LEFT) = -46; + R_PAUSE_SONG_OCA_BTN_Y(OCARINA_BTN_C_UP) = -41; + + cursor = pauseCtx->cursorSlot[PAUSE_QUEST]; + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); + pauseCtx->ocarinaSongIdx = gOcarinaSongItemMap[cursor - QUEST_SONG_MINUET]; + AudioOcarina_SetPlaybackSong(pauseCtx->ocarinaSongIdx + 1, 1); + + pauseCtx->mainState = PAUSE_MAIN_STATE_SONG_PLAYBACK; + + pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); + pauseCtx->ocarinaStaff->pos = 0; + + cursor = pauseCtx->cursorSlot[PAUSE_QUEST]; + KaleidoScope_SetCursorPos(pauseCtx, cursor * 4, pauseCtx->questVtx); } + } else { + cursor = pauseCtx->cursorSlot[PAUSE_QUEST]; + KaleidoScope_SetCursorPos(pauseCtx, cursor * 4, pauseCtx->questVtx); } + // Draw medallions + // QUEST_MEDALLION_FOREST to QUEST_MEDALLION_LIGHT + gDPPipeSync(POLY_OPA_DISP++); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); gDPSetCombineLERP(POLY_OPA_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - D_8082A0FC--; + sMedallionsEnvTimer--; - for (sp218 = 0, sp21A = 0; sp218 < 6; sp218++, sp21A += 4) { - if ((D_8082A100 != 1) && (D_8082A100 != 3)) { - phi_v1 = (D_8082A100 != 0) ? sp218 + 6 : sp218; + for (j = 0, bufI = 0; j < QUEST_SONG_MINUET - QUEST_MEDALLION_FOREST; j++, bufI += 4) { + if ((sMedallionsEnvShineState != 1) && (sMedallionsEnvShineState != 3)) { + targetColorIndex = (sMedallionsEnvShineState != 0) ? j + 6 : j; - if (D_8082A0FC != 0) { - sp226 = ABS(D_8082A0D8[sp218] - D_8082A090[phi_v1][0]) / D_8082A0FC; - sp224 = ABS(D_8082A0E4[sp218] - D_8082A090[phi_v1][1]) / D_8082A0FC; - sp222 = ABS(D_8082A0F0[sp218] - D_8082A090[phi_v1][2]) / D_8082A0FC; - if (D_8082A0D8[sp218] >= D_8082A090[phi_v1][0]) { - D_8082A0D8[sp218] -= sp226; + if (sMedallionsEnvTimer != 0) { + stepRed = ABS(sMedallionsEnvRed[j] - sMedallionsEnvColors[targetColorIndex][0]) / sMedallionsEnvTimer; + stepGreen = + ABS(sMedallionsEnvGreen[j] - sMedallionsEnvColors[targetColorIndex][1]) / sMedallionsEnvTimer; + stepBlue = ABS(sMedallionsEnvBlue[j] - sMedallionsEnvColors[targetColorIndex][2]) / sMedallionsEnvTimer; + if (sMedallionsEnvRed[j] >= sMedallionsEnvColors[targetColorIndex][0]) { + sMedallionsEnvRed[j] -= stepRed; } else { - D_8082A0D8[sp218] += sp226; + sMedallionsEnvRed[j] += stepRed; } - if (D_8082A0E4[sp218] >= D_8082A090[phi_v1][1]) { - D_8082A0E4[sp218] -= sp224; + if (sMedallionsEnvGreen[j] >= sMedallionsEnvColors[targetColorIndex][1]) { + sMedallionsEnvGreen[j] -= stepGreen; } else { - D_8082A0E4[sp218] += sp224; + sMedallionsEnvGreen[j] += stepGreen; } - if (D_8082A0F0[sp218] >= D_8082A090[phi_v1][2]) { - D_8082A0F0[sp218] -= sp222; + if (sMedallionsEnvBlue[j] >= sMedallionsEnvColors[targetColorIndex][2]) { + sMedallionsEnvBlue[j] -= stepBlue; } else { - D_8082A0F0[sp218] += sp222; + sMedallionsEnvBlue[j] += stepBlue; } } else { - D_8082A0D8[sp218] = D_8082A090[phi_v1][0]; - D_8082A0E4[sp218] = D_8082A090[phi_v1][1]; - D_8082A0F0[sp218] = D_8082A090[phi_v1][2]; + sMedallionsEnvRed[j] = sMedallionsEnvColors[targetColorIndex][0]; + sMedallionsEnvGreen[j] = sMedallionsEnvColors[targetColorIndex][1]; + sMedallionsEnvBlue[j] = sMedallionsEnvColors[targetColorIndex][2]; } } - if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST + sp218)) { + if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST + j)) { gDPPipeSync(POLY_OPA_DISP++); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); - gDPSetEnvColor(POLY_OPA_DISP++, D_8082A0D8[sp218], D_8082A0E4[sp218], D_8082A0F0[sp218], 0); - gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0); + gDPSetEnvColor(POLY_OPA_DISP++, sMedallionsEnvRed[j], sMedallionsEnvGreen[j], sMedallionsEnvBlue[j], 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[bufI], 4, 0); - KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_MEDALLION_FOREST + sp218], QUEST_ICON_WIDTH, + KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_MEDALLION_FOREST + j], QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 0); } } - if (D_8082A0FC == 0) { - D_8082A0FC = ZREG(61 + D_8082A100); - if (++D_8082A100 >= 4) { - D_8082A100 = 0; + if (sMedallionsEnvTimer == 0) { + sMedallionsEnvTimer = R_PAUSE_QUEST_MEDALLION_SHINE_TIME(sMedallionsEnvShineState); + if (++sMedallionsEnvShineState >= 4) { + sMedallionsEnvShineState = 0; } } + // Draw songs + // QUEST_SONG_MINUET to QUEST_SONG_STORMS + gDPPipeSync(POLY_OPA_DISP++); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); @@ -357,86 +492,94 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { gDPLoadTextureBlock(POLY_OPA_DISP++, gSongNoteTex, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 24, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - for (sp218 = 0; sp218 < QUEST_KOKIRI_EMERALD - QUEST_SONG_MINUET; sp218++, sp21A += 4) { - if (CHECK_QUEST_ITEM(QUEST_SONG_MINUET + sp218)) { - if ((QUEST_SONG_MINUET + sp218) == sp216) { - pauseCtx->questVtx[sp21A + 0].v.ob[0] = pauseCtx->questVtx[sp21A + 2].v.ob[0] = - pauseCtx->questVtx[sp21A + 0].v.ob[0] - 2; + for (j = 0; j < QUEST_KOKIRI_EMERALD - QUEST_SONG_MINUET; j++, bufI += 4) { + if (CHECK_QUEST_ITEM(QUEST_SONG_MINUET + j)) { + if ((QUEST_SONG_MINUET + j) == cursor) { + pauseCtx->questVtx[bufI + 0].v.ob[0] = pauseCtx->questVtx[bufI + 2].v.ob[0] = + pauseCtx->questVtx[bufI + 0].v.ob[0] - 2; - pauseCtx->questVtx[sp21A + 1].v.ob[0] = pauseCtx->questVtx[sp21A + 3].v.ob[0] = - pauseCtx->questVtx[sp21A + 1].v.ob[0] + 4; + pauseCtx->questVtx[bufI + 1].v.ob[0] = pauseCtx->questVtx[bufI + 3].v.ob[0] = + pauseCtx->questVtx[bufI + 1].v.ob[0] + 4; - pauseCtx->questVtx[sp21A + 0].v.ob[1] = pauseCtx->questVtx[sp21A + 1].v.ob[1] = - pauseCtx->questVtx[sp21A + 0].v.ob[1] + 2; + pauseCtx->questVtx[bufI + 0].v.ob[1] = pauseCtx->questVtx[bufI + 1].v.ob[1] = + pauseCtx->questVtx[bufI + 0].v.ob[1] + 2; - pauseCtx->questVtx[sp21A + 2].v.ob[1] = pauseCtx->questVtx[sp21A + 3].v.ob[1] = - pauseCtx->questVtx[sp21A + 2].v.ob[1] - 4; + pauseCtx->questVtx[bufI + 2].v.ob[1] = pauseCtx->questVtx[bufI + 3].v.ob[1] = + pauseCtx->questVtx[bufI + 2].v.ob[1] - 4; } - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, D_8082A164[sp218], D_8082A17C[sp218], D_8082A194[sp218], + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sSongsPrimRed[j], sSongsPrimGreen[j], sSongsPrimBlue[j], pauseCtx->alpha); - gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[bufI], 4, 0); gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); } } + // Draw spiritual stones + // QUEST_KOKIRI_EMERALD, QUEST_GORON_RUBY, QUEST_ZORA_SAPPHIRE + gDPPipeSync(POLY_OPA_DISP++); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); - for (sp218 = 0; sp218 < 3; sp218++, sp21A += 4) { - if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD + sp218)) { - gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0); - KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_KOKIRI_EMERALD + sp218], QUEST_ICON_WIDTH, + for (j = 0; j < QUEST_STONE_OF_AGONY - QUEST_KOKIRI_EMERALD; j++, bufI += 4) { + if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD + j)) { + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[bufI], 4, 0); + KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_KOKIRI_EMERALD + j], QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 0); } } + // Draw QUEST_STONE_OF_AGONY, QUEST_GERUDOS_CARD, QUEST_SKULL_TOKEN + gDPPipeSync(POLY_OPA_DISP++); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); - for (sp218 = 0; sp218 < 3; sp218++, sp21A += 4) { - if (CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY + sp218)) { - gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0); + for (j = 0; j < QUEST_HEART_PIECE - QUEST_STONE_OF_AGONY; j++, bufI += 4) { + if (CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY + j)) { + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[bufI], 4, 0); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); - KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_STONE_OF_AGONY + sp218], QUEST_ICON_WIDTH, + KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_STONE_OF_AGONY + j], QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 0); } } - sp226 = ABS(D_8082A104 - D_8082A070[D_8082A118][0]) / D_8082A114; - sp224 = ABS(D_8082A108 - D_8082A070[D_8082A118][1]) / D_8082A114; - sp222 = ABS(D_8082A10C - D_8082A070[D_8082A118][2]) / D_8082A114; - sp220 = ABS(D_8082A110 - D_8082A070[D_8082A118][3]) / D_8082A114; - if (D_8082A104 >= D_8082A070[D_8082A118][0]) { - D_8082A104 -= sp226; + // Draw heart pieces + // QUEST_HEART_PIECE + + stepRed = ABS(sHpPrimRed - sHpPrimColors[sHpPrimState][0]) / sHpPrimTimer; + stepGreen = ABS(sHpPrimGreen - sHpPrimColors[sHpPrimState][1]) / sHpPrimTimer; + stepBlue = ABS(sHpPrimBlue - sHpPrimColors[sHpPrimState][2]) / sHpPrimTimer; + stepAlpha = ABS(sHpPrimAlpha - sHpPrimColors[sHpPrimState][3]) / sHpPrimTimer; + if (sHpPrimRed >= sHpPrimColors[sHpPrimState][0]) { + sHpPrimRed -= stepRed; } else { - D_8082A104 += sp226; + sHpPrimRed += stepRed; } - if (D_8082A108 >= D_8082A070[D_8082A118][1]) { - D_8082A108 -= sp224; + if (sHpPrimGreen >= sHpPrimColors[sHpPrimState][1]) { + sHpPrimGreen -= stepGreen; } else { - D_8082A108 += sp224; + sHpPrimGreen += stepGreen; } - if (D_8082A10C >= D_8082A070[D_8082A118][2]) { - D_8082A10C -= sp222; + if (sHpPrimBlue >= sHpPrimColors[sHpPrimState][2]) { + sHpPrimBlue -= stepBlue; } else { - D_8082A10C += sp222; + sHpPrimBlue += stepBlue; } - if (D_8082A110 >= D_8082A070[D_8082A118][3]) { - D_8082A110 -= sp220; + if (sHpPrimAlpha >= sHpPrimColors[sHpPrimState][3]) { + sHpPrimAlpha -= stepAlpha; } else { - D_8082A110 += sp220; + sHpPrimAlpha += stepAlpha; } - if (--D_8082A114 == 0) { - D_8082A104 = D_8082A070[D_8082A118][0]; - D_8082A108 = D_8082A070[D_8082A118][1]; - D_8082A10C = D_8082A070[D_8082A118][2]; - D_8082A110 = D_8082A070[D_8082A118][3]; - D_8082A114 = ZREG(24 + D_8082A118); - if (++D_8082A118 >= 4) { - D_8082A118 = 0; + if (--sHpPrimTimer == 0) { + sHpPrimRed = sHpPrimColors[sHpPrimState][0]; + sHpPrimGreen = sHpPrimColors[sHpPrimState][1]; + sHpPrimBlue = sHpPrimColors[sHpPrimState][2]; + sHpPrimAlpha = sHpPrimColors[sHpPrimState][3]; + sHpPrimTimer = ZREG(24 + sHpPrimState); + if (++sHpPrimState >= ARRAY_COUNT(sHpPrimColors)) { + sHpPrimState = 0; } } @@ -446,14 +589,14 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); if ((pauseCtx->state == PAUSE_STATE_OPENING_1) || (pauseCtx->state == PAUSE_STATE_CLOSING)) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, D_8082A070[0][0], D_8082A070[0][1], D_8082A070[0][2], + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sHpPrimColors[0][0], sHpPrimColors[0][1], sHpPrimColors[0][2], pauseCtx->alpha); } else { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, D_8082A104, D_8082A108, D_8082A10C, D_8082A110); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sHpPrimRed, sHpPrimGreen, sHpPrimBlue, sHpPrimAlpha); } gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); - gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[bufI], 4, 0); POLY_OPA_DISP = KaleidoScope_QuadTextureIA8( POLY_OPA_DISP, @@ -463,229 +606,247 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { 48, 48, 0); } + // + if (pauseCtx->state == PAUSE_STATE_MAIN) { - sp21A += 4; + bufI += (QUEST_QUAD_SONG_NOTE_A1 - QUEST_HEART_PIECE) * 4; gDPPipeSync(POLY_OPA_DISP++); gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - if ((pauseCtx->cursorSpecialPos == 0) && (sp216 >= 6) && (sp216 < 0x12)) { - if ((pauseCtx->mainState < PAUSE_MAIN_STATE_3) || (pauseCtx->mainState == PAUSE_MAIN_STATE_5) || - (pauseCtx->mainState == PAUSE_MAIN_STATE_8)) { + // Update cursor color + if ((pauseCtx->cursorSpecialPos == 0) && (cursor >= QUEST_SONG_MINUET) && (cursor < QUEST_KOKIRI_EMERALD)) { + if ((pauseCtx->mainState < PAUSE_MAIN_STATE_3) || (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) { if (pauseCtx->cursorItem[pauseCtx->pageIndex] != PAUSE_ITEM_NONE) { pauseCtx->cursorColorSet = 8; - if ((pauseCtx->mainState >= PAUSE_MAIN_STATE_2) && (pauseCtx->mainState < PAUSE_MAIN_STATE_7)) { + if ((pauseCtx->mainState >= PAUSE_MAIN_STATE_SONG_PLAYBACK) && + (pauseCtx->mainState <= PAUSE_MAIN_STATE_SONG_PROMPT_DONE)) { pauseCtx->cursorColorSet = 0; } } } } - if (pauseCtx->mainState == PAUSE_MAIN_STATE_2) { + if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PLAYBACK) { + // Draw ocarina buttons as the song playback progresses + // QUEST_QUAD_SONG_NOTE_A1 to QUEST_QUAD_SONG_NOTE_A8 + pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); if (pauseCtx->ocarinaStaff->pos != 0) { - if (D_8082A11C == (pauseCtx->ocarinaStaff->pos - 1)) { - D_8082A11C++; - D_8082A124[pauseCtx->ocarinaStaff->pos - 1] = pauseCtx->ocarinaStaff->buttonIndex; + if (sPlayedSongBtnsNum == (pauseCtx->ocarinaStaff->pos - 1)) { + sPlayedSongBtnsNum++; + sPlayedSongBtns[pauseCtx->ocarinaStaff->pos - 1] = pauseCtx->ocarinaStaff->buttonIndex; } - for (sp218 = 0, phi_s3 = 0; sp218 < 8; sp218++, phi_s3 += 4, sp21A += 4) { - if (D_8082A124[sp218] == 0xFF) { + for (j = 0, i = 0; j < SONG_MAX_LENGTH; j++, i += 4, bufI += 4) { + if (sPlayedSongBtns[j] == OCARINA_BTN_INVALID) { break; } - if (D_8082A150[sp218] != 255) { - D_8082A150[sp218] += VREG(50); - if (D_8082A150[sp218] >= 255) { - D_8082A150[sp218] = 255; + if (sPlayedSongBtnsAlpha[j] != 255) { + sPlayedSongBtnsAlpha[j] += R_OCARINA_BUTTONS_APPEAR_ALPHA_STEP; + if (sPlayedSongBtnsAlpha[j] >= 255) { + sPlayedSongBtnsAlpha[j] = 255; } } - pauseCtx->questVtx[sp21A + 0].v.ob[1] = pauseCtx->questVtx[sp21A + 1].v.ob[1] = - VREG(21 + D_8082A124[sp218]); + pauseCtx->questVtx[bufI + 0].v.ob[1] = pauseCtx->questVtx[bufI + 1].v.ob[1] = + R_PAUSE_SONG_OCA_BTN_Y(sPlayedSongBtns[j]); - pauseCtx->questVtx[sp21A + 2].v.ob[1] = pauseCtx->questVtx[sp21A + 3].v.ob[1] = - pauseCtx->questVtx[sp21A + 0].v.ob[1] - 12; + pauseCtx->questVtx[bufI + 2].v.ob[1] = pauseCtx->questVtx[bufI + 3].v.ob[1] = + pauseCtx->questVtx[bufI + 0].v.ob[1] - 12; gDPPipeSync(POLY_OPA_DISP++); - if (D_8082A124[sp218] == 0) { - Color_RGB8 color = { 80, 255, 150 }; - if (N64_BTN_COLORS) { - color.g = 150; - color.b = 255; - } - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, color.r, color.g, color.b, D_8082A150[sp218]); + if (sPlayedSongBtns[j] == OCARINA_BTN_A) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, QUEST_OCARINA_BTN_A_COLOR_R, QUEST_OCARINA_BTN_A_COLOR_G, + QUEST_OCARINA_BTN_A_COLOR_B, sPlayedSongBtnsAlpha[j]); } else { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 50, D_8082A150[sp218]); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 50, sPlayedSongBtnsAlpha[j]); } gDPSetEnvColor(POLY_OPA_DISP++, 10, 10, 10, 0); - gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[bufI], 4, 0); - gDPLoadTextureBlock(POLY_OPA_DISP++, D_8082A130[D_8082A124[sp218]], G_IM_FMT_IA, 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); + gDPLoadTextureBlock(POLY_OPA_DISP++, sOcarinaBtnTextures[sPlayedSongBtns[j]], G_IM_FMT_IA, + 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); gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); } } - } else if (((pauseCtx->mainState >= PAUSE_MAIN_STATE_4) && (pauseCtx->mainState <= PAUSE_MAIN_STATE_6)) || - (pauseCtx->mainState == PAUSE_MAIN_STATE_8)) { - sp224 = pauseCtx->ocarinaSongIdx; - sp226 = gOcarinaSongButtons[sp224].numButtons; + } else if (((pauseCtx->mainState >= PAUSE_MAIN_STATE_SONG_PROMPT_INIT) && + (pauseCtx->mainState <= PAUSE_MAIN_STATE_SONG_PROMPT_DONE)) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) { + // Draw the buttons for playing a song + // QUEST_QUAD_SONG_NOTE_A1 to QUEST_QUAD_SONG_NOTE_A8 + + // temps reused, fake? + stepGreen = pauseCtx->ocarinaSongIdx; + stepRed = gOcarinaSongButtons[stepGreen].numButtons; - for (sp218 = sp21A, phi_s3 = 0; phi_s3 < sp226; phi_s3++, sp21A += 4) { - pauseCtx->questVtx[sp21A + 0].v.ob[1] = pauseCtx->questVtx[sp21A + 1].v.ob[1] = - VREG(21 + gOcarinaSongButtons[sp224].buttonsIndex[phi_s3]); + j = bufI; - pauseCtx->questVtx[sp21A + 2].v.ob[1] = pauseCtx->questVtx[sp21A + 3].v.ob[1] = - pauseCtx->questVtx[sp21A + 0].v.ob[1] - 12; + for (i = 0; i < stepRed; i++, bufI += 4) { + pauseCtx->questVtx[bufI + 0].v.ob[1] = pauseCtx->questVtx[bufI + 1].v.ob[1] = + R_PAUSE_SONG_OCA_BTN_Y(gOcarinaSongButtons[stepGreen].buttonsIndex[i]); + + pauseCtx->questVtx[bufI + 2].v.ob[1] = pauseCtx->questVtx[bufI + 3].v.ob[1] = + pauseCtx->questVtx[bufI + 0].v.ob[1] - 12; gDPPipeSync(POLY_OPA_DISP++); - if (pauseCtx->mainState == PAUSE_MAIN_STATE_8) { - if (gOcarinaSongButtons[sp224].buttonsIndex[phi_s3] == OCARINA_BTN_A) { - Color_RGB8 color = { 80, 255, 150 }; - if (N64_BTN_COLORS) { - color.g = 150; - color.b = 255; - } - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, color.r, color.g, color.b, 200); + if (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG) { + if (gOcarinaSongButtons[stepGreen].buttonsIndex[i] == OCARINA_BTN_A) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, QUEST_OCARINA_BTN_A_COLOR_R, QUEST_OCARINA_BTN_A_COLOR_G, + QUEST_OCARINA_BTN_A_COLOR_B, 200); } else { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 50, 200); } } else { + // Gray out buttons during the player playing the song gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 150, 150, 150, 150); } gDPSetEnvColor(POLY_OPA_DISP++, 10, 10, 10, 0); - gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[bufI], 4, 0); - gDPLoadTextureBlock(POLY_OPA_DISP++, D_8082A130[gOcarinaSongButtons[sp224].buttonsIndex[phi_s3]], - G_IM_FMT_IA, 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); + gDPLoadTextureBlock(POLY_OPA_DISP++, + sOcarinaBtnTextures[gOcarinaSongButtons[stepGreen].buttonsIndex[i]], G_IM_FMT_IA, + 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); gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); } - if (pauseCtx->mainState != PAUSE_MAIN_STATE_8) { + if (pauseCtx->mainState != PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG) { + // Draw the buttons colored as the player plays the song + // QUEST_QUAD_SONG_NOTE_B1 to QUEST_QUAD_SONG_NOTE_B8 + pauseCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); if (pauseCtx->ocarinaStaff->pos != 0) { - if (D_8082A11C == (pauseCtx->ocarinaStaff->pos - 1)) { + if (sPlayedSongBtnsNum == (pauseCtx->ocarinaStaff->pos - 1)) { if ((pauseCtx->ocarinaStaff->buttonIndex >= OCARINA_BTN_A) && (pauseCtx->ocarinaStaff->buttonIndex <= OCARINA_BTN_C_UP)) { - D_8082A124[pauseCtx->ocarinaStaff->pos - 1] = pauseCtx->ocarinaStaff->buttonIndex; - D_8082A124[pauseCtx->ocarinaStaff->pos] = 0xFF; - D_8082A11C++; + sPlayedSongBtns[pauseCtx->ocarinaStaff->pos - 1] = pauseCtx->ocarinaStaff->buttonIndex; + sPlayedSongBtns[pauseCtx->ocarinaStaff->pos] = OCARINA_BTN_INVALID; + sPlayedSongBtnsNum++; } } } - sp21A = sp218 + 32; - phi_s3 = 0; - for (; phi_s3 < 8; phi_s3++, sp21A += 4) { - if (D_8082A124[phi_s3] == 0xFF) { + bufI = j + ((QUEST_QUAD_SONG_NOTE_B1 - QUEST_QUAD_SONG_NOTE_A1) * 4); + + for (i = 0; i < SONG_MAX_LENGTH; i++, bufI += 4) { + if (sPlayedSongBtns[i] == OCARINA_BTN_INVALID) { continue; } - if (D_8082A150[phi_s3] != 255) { - D_8082A150[phi_s3] += VREG(50); - if (D_8082A150[phi_s3] >= 255) { - D_8082A150[phi_s3] = 255; + if (sPlayedSongBtnsAlpha[i] != 255) { + sPlayedSongBtnsAlpha[i] += R_OCARINA_BUTTONS_APPEAR_ALPHA_STEP; + if (sPlayedSongBtnsAlpha[i] >= 255) { + sPlayedSongBtnsAlpha[i] = 255; } } - pauseCtx->questVtx[sp21A + 0].v.ob[1] = pauseCtx->questVtx[sp21A + 1].v.ob[1] = - VREG(21 + D_8082A124[phi_s3]); - pauseCtx->questVtx[sp21A + 2].v.ob[1] = pauseCtx->questVtx[sp21A + 3].v.ob[1] = - pauseCtx->questVtx[sp21A + 0].v.ob[1] - 12; + pauseCtx->questVtx[bufI + 0].v.ob[1] = pauseCtx->questVtx[bufI + 1].v.ob[1] = + R_PAUSE_SONG_OCA_BTN_Y(sPlayedSongBtns[i]); + + pauseCtx->questVtx[bufI + 2].v.ob[1] = pauseCtx->questVtx[bufI + 3].v.ob[1] = + pauseCtx->questVtx[bufI + 0].v.ob[1] - 12; gDPPipeSync(POLY_OPA_DISP++); - if (D_8082A124[phi_s3] == 0) { - Color_RGB8 color = { 80, 255, 150 }; - if (N64_BTN_COLORS) { - color.g = 150; - color.b = 255; - } - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, color.r, color.g, color.b, D_8082A150[phi_s3]); + if (sPlayedSongBtns[i] == OCARINA_BTN_A) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, QUEST_OCARINA_BTN_A_COLOR_R, QUEST_OCARINA_BTN_A_COLOR_G, + QUEST_OCARINA_BTN_A_COLOR_B, sPlayedSongBtnsAlpha[i]); } else { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 50, D_8082A150[phi_s3]); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 50, sPlayedSongBtnsAlpha[i]); } gDPSetEnvColor(POLY_OPA_DISP++, 10, 10, 10, 0); - gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[bufI], 4, 0); - gDPLoadTextureBlock(POLY_OPA_DISP++, D_8082A130[D_8082A124[phi_s3]], G_IM_FMT_IA, 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); + gDPLoadTextureBlock(POLY_OPA_DISP++, sOcarinaBtnTextures[sPlayedSongBtns[i]], G_IM_FMT_IA, + 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); gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); } - if (pauseCtx->mainState == PAUSE_MAIN_STATE_4) { - for (phi_s3 = 0; phi_s3 < 8; phi_s3++) { - D_8082A124[phi_s3] = 0xFF; - D_8082A150[phi_s3] = 0; + if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT_INIT) { + for (i = 0; i < SONG_MAX_LENGTH; i++) { + sPlayedSongBtns[i] = OCARINA_BTN_INVALID; + sPlayedSongBtnsAlpha[i] = 0; } + sPlayedSongBtnsNum = 0; - D_8082A11C = 0; AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); AudioOcarina_Start((1 << pauseCtx->ocarinaSongIdx) + 0x8000); pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); pauseCtx->ocarinaStaff->pos = 0; pauseCtx->ocarinaStaff->state = 0xFE; - pauseCtx->mainState = PAUSE_MAIN_STATE_5; + + pauseCtx->mainState = PAUSE_MAIN_STATE_SONG_PROMPT; } } } } + // Draw amount of gold skulltula tokens + // QUEST_QUAD_SKULL_TOKENS_DIGIT1_SHADOW to QUEST_QUAD_SKULL_TOKENS_DIGIT3 + if (CHECK_QUEST_ITEM(QUEST_SKULL_TOKEN)) { gDPPipeSync(POLY_OPA_DISP++); gDPSetCombineLERP(POLY_OPA_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); - sp208[0] = sp208[1] = 0; - sp208[2] = gSaveContext.save.info.inventory.gsTokens; + gsTokenDigits[0] = gsTokenDigits[1] = 0; + gsTokenDigits[2] = gSaveContext.save.info.inventory.gsTokens; - while (sp208[2] >= 100) { - sp208[0]++; - sp208[2] -= 100; + while (gsTokenDigits[2] >= 100) { + gsTokenDigits[0]++; + gsTokenDigits[2] -= 100; } - while (sp208[2] >= 10) { - sp208[1]++; - sp208[2] -= 10; + while (gsTokenDigits[2] >= 10) { + gsTokenDigits[1]++; + gsTokenDigits[2] -= 10; } - gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[164], 24, 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[QUEST_QUAD_SKULL_TOKENS_DIGIT1_SHADOW * 4], 6 * 4, 0); - for (phi_s3 = 0, sp218 = 0, sp21A = 0; phi_s3 < 2; phi_s3++) { - if (phi_s3 == 0) { + for (i = 0, j = 0; i < 2; i++) { + if (i == 0) { + // Text shadow gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, pauseCtx->alpha); - } else if (gSaveContext.save.info.inventory.gsTokens == 100) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 200, 50, 50, pauseCtx->alpha); } else { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); + // Text color + if (gSaveContext.save.info.inventory.gsTokens == 100) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 200, 50, 50, pauseCtx->alpha); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); + } } - cursorItem = 0; - for (sp21A = 0; sp21A < 3; sp21A++, sp218 += 4) { - if ((sp21A >= 2) || (sp208[sp21A] != 0) || (cursorItem != 0)) { - gDPLoadTextureBlock(POLY_OPA_DISP++, ((u8*)gCounterDigit0Tex + (8 * 16 * sp208[sp21A])), G_IM_FMT_I, - G_IM_SIZ_8b, 8, 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); + // Variable reused as a flag indicating all digits onwards should be displayed + cursorItem = false; + + for (bufI = 0; bufI < 3; bufI++, j += 4) { + if ((bufI >= 2) || (gsTokenDigits[bufI] != 0) || cursorItem) { + gDPLoadTextureBlock(POLY_OPA_DISP++, ((u8*)gCounterDigit0Tex + (8 * 16 * gsTokenDigits[bufI])), + G_IM_FMT_I, G_IM_SIZ_8b, 8, 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); - gSP1Quadrangle(POLY_OPA_DISP++, sp218, sp218 + 2, sp218 + 3, sp218 + 1, 0); + gSP1Quadrangle(POLY_OPA_DISP++, j, j + 2, j + 3, j + 1, 0); - cursorItem = 1; + cursorItem = true; } } } @@ -697,5 +858,5 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { s32 KaleidoScope_UpdateQuestStatusPoint(PauseContext* pauseCtx, s32 point) { pauseCtx->cursorPoint[PAUSE_QUEST] = point; - return 1; + return true; } diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c index a6ffcb52e4..555d518e36 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c @@ -605,6 +605,11 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { } else if (curSection == 0x5B) { if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { gSaveContext.save.info.inventory.gsTokens++; +#if PLATFORM_N64 + if (gSaveContext.save.info.inventory.gsTokens >= 100) { + gSaveContext.save.info.inventory.gsTokens = 100; + } +#endif } else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) || CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) { gSaveContext.save.info.inventory.gsTokens--; diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 529bb61424..33c98159c9 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -45,8 +45,9 @@ void KaleidoScope_DrawEquipmentImage(PlayState* play, void* source, u32 width, u vtxIndex = 80; - gDPSetTileCustom(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, textureHeight, 0, G_TX_NOMIRROR | G_TX_CLAMP, - G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gDPSetTileCustom(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, width - 1, textureHeight - 1, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); remainingSize -= textureSize; @@ -67,7 +68,7 @@ void KaleidoScope_DrawEquipmentImage(PlayState* play, void* source, u32 width, u textureHeight = remainingSize / (s32)(width * 2); remainingSize -= textureSize; - gDPSetTileCustom(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, textureHeight, 0, + gDPSetTileCustom(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, width - 1, textureHeight - 1, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); } @@ -119,22 +120,22 @@ void KaleidoScope_ProcessPlayerPreRender(PlayState* play); void KaleidoScope_DrawEquipment(PlayState* play) { static s16 sEquipTimer = 0; PauseContext* pauseCtx = &play->pauseCtx; + InterfaceContext* interfaceCtx = &play->interfaceCtx; Input* input = &play->state.input[0]; u16 i; u16 j; u16 k; u16 bit; + u16 rowStart; u16 temp; u16 point; - u16 rowStart; - u16 pad; s16 cursorMoveResult; - u16 cursorItem; u16 cursorSlot; - s16 cursorPoint; + u16 cursorItem; s16 cursorX; s16 cursorY; - volatile s16 oldCursorPoint; + s16 oldCursorPoint; + s16 cursorPoint; OPEN_DISPS(play->state.gfxCtx, "../z_kaleido_equipment.c", 219); @@ -169,7 +170,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { cursorY = pauseCtx->cursorY[PAUSE_EQUIP]; cursorMoveResult = 0; - while (cursorMoveResult == 0) { + do { if (pauseCtx->stickAdjX < -30) { if (pauseCtx->cursorX[PAUSE_EQUIP] != 0) { pauseCtx->cursorX[PAUSE_EQUIP]--; @@ -253,15 +254,13 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } else { cursorMoveResult = 4; } - } + } while (cursorMoveResult == 0); cursorPoint = pauseCtx->cursorPoint[PAUSE_EQUIP]; cursorY = pauseCtx->cursorY[PAUSE_EQUIP]; - if (cursorMoveResult) {} - cursorMoveResult = 0; - while (cursorMoveResult == 0) { + do { if (pauseCtx->stickAdjY > 30) { if (pauseCtx->cursorY[PAUSE_EQUIP] != 0) { pauseCtx->cursorY[PAUSE_EQUIP]--; @@ -305,7 +304,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } else { cursorMoveResult = 4; } - } + } while (cursorMoveResult == 0); } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { if (pauseCtx->stickAdjX > 30) { pauseCtx->nameDisplayTimer = 0; @@ -339,19 +338,15 @@ void KaleidoScope_DrawEquipment(PlayState* play) { cursorY = cursorY + 1; cursorPoint = cursorPoint + 4; - if (cursorY < 4) { - continue; - } - - cursorY = 0; - cursorPoint = cursorX + 1; - cursorX = cursorPoint; - if (cursorX < 4) { - continue; + if (cursorY >= 4) { + cursorY = 0; + cursorPoint = cursorX + 1; + cursorX = cursorPoint; + if (cursorX >= 4) { + KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT); + break; + } } - - KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT); - break; } } } else { @@ -380,19 +375,15 @@ void KaleidoScope_DrawEquipment(PlayState* play) { cursorY = cursorY + 1; cursorPoint = cursorPoint + 4; - if (cursorY < 4) { - continue; - } - - cursorY = 0; - cursorPoint = cursorX - 1; - cursorX = cursorPoint; - if (cursorX >= 0) { - continue; + if (cursorY >= 4) { + cursorY = 0; + cursorPoint = cursorX - 1; + cursorX = cursorPoint; + if (cursorX < 0) { + KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT); + break; + } } - - KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT); - break; } } } @@ -465,7 +456,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } - KaleidoScope_SetCursorVtx(pauseCtx, cursorSlot * 4, pauseCtx->equipVtx); + KaleidoScope_SetCursorPos(pauseCtx, cursorSlot * 4, pauseCtx->equipVtx); if ((pauseCtx->cursorSpecialPos == 0) && (cursorItem != PAUSE_ITEM_NONE) && (pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && @@ -511,7 +502,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else if ((pauseCtx->mainState == PAUSE_MAIN_STATE_7) && (pauseCtx->pageIndex == PAUSE_EQUIP)) { - KaleidoScope_SetCursorVtx(pauseCtx, pauseCtx->cursorSlot[PAUSE_EQUIP] * 4, pauseCtx->equipVtx); + KaleidoScope_SetCursorPos(pauseCtx, pauseCtx->cursorSlot[PAUSE_EQUIP] * 4, pauseCtx->equipVtx); pauseCtx->cursorColorSet = 8; sEquipTimer--; @@ -598,7 +589,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x08, pauseCtx->iconItemSegment); gSPSegment(POLY_OPA_DISP++, 0x09, pauseCtx->iconItem24Segment); gSPSegment(POLY_OPA_DISP++, 0x0A, pauseCtx->nameSegment); - gSPSegment(POLY_OPA_DISP++, 0x0B, play->interfaceCtx.mapSegment); + gSPSegment(POLY_OPA_DISP++, 0x0B, interfaceCtx->mapSegment); gSPSegment(POLY_OPA_DISP++, 0x0C, pauseCtx->iconItemAltSegment); Gfx_SetupDL_42Opa(play->state.gfxCtx); diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 8f0bcd9791..a49feffb75 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -2,8 +2,22 @@ #include "assets/textures/parameter_static/parameter_static.h" u8 gAmmoItems[] = { - ITEM_DEKU_STICK, ITEM_DEKU_NUT, ITEM_BOMB, ITEM_BOW, ITEM_NONE, ITEM_NONE, ITEM_SLINGSHOT, ITEM_NONE, - ITEM_BOMBCHU, ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_MAGIC_BEAN, ITEM_NONE, + ITEM_DEKU_STICK, // SLOT_DEKU_STICK + ITEM_DEKU_NUT, // SLOT_DEKU_NUT + ITEM_BOMB, // SLOT_BOMB + ITEM_BOW, // SLOT_BOW + ITEM_NONE, // SLOT_ARROW_FIRE + ITEM_NONE, // SLOT_DINS_FIRE + ITEM_SLINGSHOT, // SLOT_SLINGSHOT + ITEM_NONE, // SLOT_OCARINA + ITEM_BOMBCHU, // SLOT_BOMBCHU + ITEM_NONE, // SLOT_HOOKSHOT + ITEM_NONE, // SLOT_ARROW_ICE + ITEM_NONE, // SLOT_FARORES_WIND + ITEM_NONE, // SLOT_BOOMERANG + ITEM_NONE, // SLOT_LENS_OF_TRUTH + ITEM_MAGIC_BEAN, // SLOT_MAGIC_BEAN + ITEM_NONE, }; static s16 sEquipState = 0; @@ -11,12 +25,28 @@ static s16 sEquipAnimTimer = 0; static s16 sEquipMoveTimer = 10; static s16 sAmmoVtxOffset[] = { - 0, 2, 4, 6, 99, 99, 8, 99, 99, 10, 99, 99, 99, 99, 99, 99, 12, + ITEM_QUAD_AMMO_STICK_TENS - ITEM_QUAD_AMMO_FIRST, // ITEM_DEKU_STICK + ITEM_QUAD_AMMO_NUT_TENS - ITEM_QUAD_AMMO_FIRST, // ITEM_DEKU_NUT + ITEM_QUAD_AMMO_BOMB_TENS - ITEM_QUAD_AMMO_FIRST, // ITEM_BOMB + ITEM_QUAD_AMMO_BOW_TENS - ITEM_QUAD_AMMO_FIRST, // ITEM_BOW + 99, // (ITEM_ARROW_FIRE) + 99, // (ITEM_DINS_FIRE) + ITEM_QUAD_AMMO_SLINGSHOT_TENS - ITEM_QUAD_AMMO_FIRST, // ITEM_SLINGSHOT + 99, // (ITEM_OCARINA_FAIRY) + 99, // (ITEM_OCARINA_OF_TIME) + ITEM_QUAD_AMMO_BOMBCHU_TENS - ITEM_QUAD_AMMO_FIRST, // ITEM_BOMBCHU + 99, // (ITEM_HOOKSHOT) + 99, // (ITEM_LONGSHOT) + 99, // (ITEM_ARROW_ICE) + 99, // (ITEM_FARORES_WIND) + 99, // (ITEM_BOOMERANG) + 99, // (ITEM_LENS) + ITEM_QUAD_AMMO_BEAN_TENS - ITEM_QUAD_AMMO_FIRST, // ITEM_MAGIC_BEAN }; void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx, s16 item) { s16 ammo; - s16 i; + s16 ammoTens; OPEN_DISPS(gfxCtx, "../z_kaleido_item.c", 69); @@ -41,23 +71,23 @@ void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx, } } - for (i = 0; ammo >= 10; i++) { + for (ammoTens = 0; ammo >= 10; ammoTens++) { ammo -= 10; } gDPPipeSync(POLY_OPA_DISP++); - if (i != 0) { - gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[(sAmmoVtxOffset[item] + 27) * 4], 4, 0); + if (ammoTens != 0) { + gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[(ITEM_QUAD_AMMO_FIRST + sAmmoVtxOffset[item] + 0) * 4], 4, 0); - gDPLoadTextureBlock(POLY_OPA_DISP++, ((u8*)gAmmoDigit0Tex + (8 * 8 * i)), G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOLOD); + gDPLoadTextureBlock(POLY_OPA_DISP++, ((u8*)gAmmoDigit0Tex + (8 * 8 * ammoTens)), G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, + 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); } - gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[(sAmmoVtxOffset[item] + 28) * 4], 4, 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[(ITEM_QUAD_AMMO_FIRST + sAmmoVtxOffset[item] + 1) * 4], 4, 0); gDPLoadTextureBlock(POLY_OPA_DISP++, ((u8*)gAmmoDigit0Tex + (8 * 8 * ammo)), G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, @@ -68,13 +98,13 @@ void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx, CLOSE_DISPS(gfxCtx, "../z_kaleido_item.c", 116); } -void KaleidoScope_SetCursorVtx(PauseContext* pauseCtx, u16 index, Vtx* vtx) { +void KaleidoScope_SetCursorPos(PauseContext* pauseCtx, u16 index, Vtx* vtx) { pauseCtx->cursorVtx[0].v.ob[0] = vtx[index].v.ob[0]; pauseCtx->cursorVtx[0].v.ob[1] = vtx[index].v.ob[1]; } -void KaleidoScope_SetItemCursorVtx(PauseContext* pauseCtx) { - KaleidoScope_SetCursorVtx(pauseCtx, pauseCtx->cursorSlot[PAUSE_ITEM] * 4, pauseCtx->itemVtx); +void KaleidoScope_SetItemCursorPos(PauseContext* pauseCtx) { + KaleidoScope_SetCursorPos(pauseCtx, pauseCtx->cursorSlot[PAUSE_ITEM] * 4, pauseCtx->itemVtx); } void KaleidoScope_DrawItemSelect(PlayState* play) { @@ -92,7 +122,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { s16 cursorX; s16 cursorY; s16 oldCursorPoint; - s16 moveCursorResult; + s16 cursorMoveResult; OPEN_DISPS(play->state.gfxCtx, "../z_kaleido_item.c", 234); @@ -105,7 +135,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { if ((pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && (pauseCtx->pageIndex == PAUSE_ITEM)) { - moveCursorResult = 0; + cursorMoveResult = 0; oldCursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM]; cursorItem = pauseCtx->cursorItem[PAUSE_ITEM]; @@ -118,10 +148,6 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { pauseCtx->stickAdjX = 40; } -#if !IS_DEBUG - if (&gSaveContext) {} -#endif - if (ABS(pauseCtx->stickAdjX) > 30) { cursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM]; cursorX = pauseCtx->cursorX[PAUSE_ITEM]; @@ -129,67 +155,68 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { PRINTF("now=%d ccc=%d\n", cursorPoint, cursorItem); -#if IS_DEBUG - // Seems necessary to match - if (pauseCtx->cursorX[PAUSE_ITEM]) {} - if (gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]]) {} -#endif - - while (moveCursorResult == 0) { - if (pauseCtx->stickAdjX < -30) { + do { + if (pauseCtx->stickAdjX < -30) { // left + // if not on the left-most column if (pauseCtx->cursorX[PAUSE_ITEM] != 0) { + // move left pauseCtx->cursorX[PAUSE_ITEM]--; pauseCtx->cursorPoint[PAUSE_ITEM] -= 1; + // if there's an item there, stop there if (gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) { - moveCursorResult = 1; + cursorMoveResult = 1; } } else { + // move the cursor to its initial horizontal position and try find an item on the next line + pauseCtx->cursorX[PAUSE_ITEM] = cursorX; - pauseCtx->cursorY[PAUSE_ITEM]++; - if (pauseCtx->cursorY[PAUSE_ITEM] >= 4) { + pauseCtx->cursorY[PAUSE_ITEM]++; + if (pauseCtx->cursorY[PAUSE_ITEM] >= ITEM_GRID_ROWS) { pauseCtx->cursorY[PAUSE_ITEM] = 0; } pauseCtx->cursorPoint[PAUSE_ITEM] = - pauseCtx->cursorX[PAUSE_ITEM] + (pauseCtx->cursorY[PAUSE_ITEM] * 6); + pauseCtx->cursorX[PAUSE_ITEM] + (pauseCtx->cursorY[PAUSE_ITEM] * ITEM_GRID_COLS); - if (pauseCtx->cursorPoint[PAUSE_ITEM] >= 24) { + if (pauseCtx->cursorPoint[PAUSE_ITEM] >= (ITEM_GRID_ROWS * ITEM_GRID_COLS)) { pauseCtx->cursorPoint[PAUSE_ITEM] = pauseCtx->cursorX[PAUSE_ITEM]; } if (cursorY == pauseCtx->cursorY[PAUSE_ITEM]) { + // there is no item to the left of the initial position, on any line + pauseCtx->cursorX[PAUSE_ITEM] = cursorX; pauseCtx->cursorPoint[PAUSE_ITEM] = cursorPoint; KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT); - moveCursorResult = 2; + cursorMoveResult = 2; } } } else if (pauseCtx->stickAdjX > 30) { - if (pauseCtx->cursorX[PAUSE_ITEM] < 5) { + if (pauseCtx->cursorX[PAUSE_ITEM] < (ITEM_GRID_COLS - 1)) { pauseCtx->cursorX[PAUSE_ITEM]++; pauseCtx->cursorPoint[PAUSE_ITEM] += 1; if (gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) { - moveCursorResult = 1; + cursorMoveResult = 1; } } else { pauseCtx->cursorX[PAUSE_ITEM] = cursorX; pauseCtx->cursorY[PAUSE_ITEM]++; - if (pauseCtx->cursorY[PAUSE_ITEM] >= 4) { + if (pauseCtx->cursorY[PAUSE_ITEM] >= ITEM_GRID_ROWS) { pauseCtx->cursorY[PAUSE_ITEM] = 0; } pauseCtx->cursorPoint[PAUSE_ITEM] = - pauseCtx->cursorX[PAUSE_ITEM] + (pauseCtx->cursorY[PAUSE_ITEM] * 6); + pauseCtx->cursorX[PAUSE_ITEM] + (pauseCtx->cursorY[PAUSE_ITEM] * ITEM_GRID_COLS); - if (pauseCtx->cursorPoint[PAUSE_ITEM] >= 24) { + if (pauseCtx->cursorPoint[PAUSE_ITEM] >= (ITEM_GRID_ROWS * ITEM_GRID_COLS)) { pauseCtx->cursorPoint[PAUSE_ITEM] = pauseCtx->cursorX[PAUSE_ITEM]; } @@ -199,18 +226,18 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT); - moveCursorResult = 2; + cursorMoveResult = 2; } } } - } + } while (cursorMoveResult == 0); - if (moveCursorResult == 1) { + if (cursorMoveResult == 1) { cursorItem = gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]]; } PRINTF("【X cursor=%d(%) (cur_xpt=%d)(ok_fg=%d)(ccc=%d)(key_angle=%d)】 ", - pauseCtx->cursorPoint[PAUSE_ITEM], pauseCtx->cursorX[PAUSE_ITEM], moveCursorResult, cursorItem, + pauseCtx->cursorPoint[PAUSE_ITEM], pauseCtx->cursorX[PAUSE_ITEM], cursorMoveResult, cursorItem, pauseCtx->cursorSpecialPos); } } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { @@ -227,28 +254,24 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { pauseCtx->cursorPoint[PAUSE_ITEM] = cursorPoint; pauseCtx->cursorX[PAUSE_ITEM] = cursorX; pauseCtx->cursorY[PAUSE_ITEM] = cursorY; - moveCursorResult = 1; + cursorMoveResult = 1; break; } - cursorY = cursorY + 1; - cursorPoint = cursorPoint + 6; - if (cursorY < 4) { - continue; - } - - cursorY = 0; - cursorPoint = cursorX + 1; - cursorX = cursorPoint; - if (cursorX < 6) { - continue; + cursorY += 1; + cursorPoint += ITEM_GRID_COLS; + if (cursorY >= ITEM_GRID_ROWS) { + cursorY = 0; + cursorPoint = cursorX + 1; + cursorX = cursorPoint; + if (cursorX >= ITEM_GRID_COLS) { + KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT); + break; + } } - - KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT); - break; } } - } else { + } else { // cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT if (pauseCtx->stickAdjX < -30) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; @@ -256,32 +279,28 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - cursorPoint = cursorX = 5; + cursorPoint = cursorX = ITEM_GRID_COLS - 1; cursorY = 0; while (true) { if (gSaveContext.save.info.inventory.items[cursorPoint] != ITEM_NONE) { pauseCtx->cursorPoint[PAUSE_ITEM] = cursorPoint; pauseCtx->cursorX[PAUSE_ITEM] = cursorX; pauseCtx->cursorY[PAUSE_ITEM] = cursorY; - moveCursorResult = 1; + cursorMoveResult = 1; break; } - cursorY = cursorY + 1; - cursorPoint = cursorPoint + 6; - if (cursorY < 4) { - continue; - } - - cursorY = 0; - cursorPoint = cursorX - 1; - cursorX = cursorPoint; - if (cursorX >= 0) { - continue; + cursorY += 1; + cursorPoint += ITEM_GRID_COLS; + if (cursorY >= ITEM_GRID_ROWS) { + cursorY = 0; + cursorPoint = cursorX - 1; + cursorX = cursorPoint; + if (cursorX < 0) { + KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT); + break; + } } - - KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT); - break; } } } @@ -289,47 +308,47 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { if (pauseCtx->cursorSpecialPos == 0) { if (cursorItem != PAUSE_ITEM_NONE) { if (ABS(pauseCtx->stickAdjY) > 30) { - moveCursorResult = 0; + cursorMoveResult = 0; cursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM]; cursorY = pauseCtx->cursorY[PAUSE_ITEM]; - while (moveCursorResult == 0) { + do { if (pauseCtx->stickAdjY > 30) { if (pauseCtx->cursorY[PAUSE_ITEM] != 0) { pauseCtx->cursorY[PAUSE_ITEM]--; - pauseCtx->cursorPoint[PAUSE_ITEM] -= 6; + pauseCtx->cursorPoint[PAUSE_ITEM] -= ITEM_GRID_COLS; if (gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) { - moveCursorResult = 1; + cursorMoveResult = 1; } } else { pauseCtx->cursorY[PAUSE_ITEM] = cursorY; pauseCtx->cursorPoint[PAUSE_ITEM] = cursorPoint; - moveCursorResult = 2; + cursorMoveResult = 2; } } else if (pauseCtx->stickAdjY < -30) { - if (pauseCtx->cursorY[PAUSE_ITEM] < 3) { + if (pauseCtx->cursorY[PAUSE_ITEM] < (ITEM_GRID_ROWS - 1)) { pauseCtx->cursorY[PAUSE_ITEM]++; - pauseCtx->cursorPoint[PAUSE_ITEM] += 6; + pauseCtx->cursorPoint[PAUSE_ITEM] += ITEM_GRID_COLS; if (gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) { - moveCursorResult = 1; + cursorMoveResult = 1; } } else { pauseCtx->cursorY[PAUSE_ITEM] = cursorY; pauseCtx->cursorPoint[PAUSE_ITEM] = cursorPoint; - moveCursorResult = 2; + cursorMoveResult = 2; } } - } + } while (cursorMoveResult == 0); cursorPoint = PAUSE_ITEM; PRINTF("【Y cursor=%d(%) (cur_ypt=%d)(ok_fg=%d)(ccc=%d)】 ", pauseCtx->cursorPoint[cursorPoint], - pauseCtx->cursorY[PAUSE_ITEM], moveCursorResult, cursorItem); + pauseCtx->cursorY[PAUSE_ITEM], cursorMoveResult, cursorItem); } } @@ -337,9 +356,9 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { pauseCtx->cursorColorSet = 4; - if (moveCursorResult == 1) { + if (cursorMoveResult == 1) { cursorItem = gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]]; - } else if (moveCursorResult != 2) { + } else if (cursorMoveResult != 2) { cursorItem = gSaveContext.save.info.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]]; } @@ -352,7 +371,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { if (cursorItem != PAUSE_ITEM_NONE) { index = cursorSlot * 4; // required to match? - KaleidoScope_SetCursorVtx(pauseCtx, index, pauseCtx->itemVtx); + KaleidoScope_SetCursorPos(pauseCtx, index, pauseCtx->itemVtx); if ((pauseCtx->debugState == 0) && (pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE)) { @@ -418,7 +437,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else if ((pauseCtx->mainState == PAUSE_MAIN_STATE_3) && (pauseCtx->pageIndex == PAUSE_ITEM)) { - KaleidoScope_SetCursorVtx(pauseCtx, cursorSlot * 4, pauseCtx->itemVtx); + //! @bug cursorSlot is uninitialized + KaleidoScope_SetCursorPos(pauseCtx, cursorSlot * 4, pauseCtx->itemVtx); pauseCtx->cursorColorSet = 4; } @@ -427,7 +447,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); - for (i = 0, j = 24 * 4; i < 3; i++, j += 4) { + for (i = 0, j = ITEM_QUAD_GRID_SELECTED_C_LEFT * 4; i < 3; i++, j += 4) { if (gSaveContext.save.info.equips.buttonItems[i + 1] != ITEM_NONE) { gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[j], 4, 0); POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, gEquippedItemOutlineTex, 32, 32, 0); @@ -437,7 +457,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { gDPPipeSync(POLY_OPA_DISP++); gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - for (i = j = 0; i < 24; i++, j += 4) { + for (i = j = 0; i < (ITEM_GRID_ROWS * ITEM_GRID_COLS); i++, j += 4) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); if (gSaveContext.save.info.inventory.items[i] != ITEM_NONE) { @@ -450,28 +470,34 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { magicArrowEffectsB[pauseCtx->equipTargetItem - 0xBF], pauseCtx->alpha); pauseCtx->itemVtx[j + 0].v.ob[0] = pauseCtx->itemVtx[j + 2].v.ob[0] = - pauseCtx->itemVtx[j + 0].v.ob[0] - 2; + pauseCtx->itemVtx[j + 0].v.ob[0] - ITEM_GRID_QUAD_ENLARGE_OFFSET; pauseCtx->itemVtx[j + 1].v.ob[0] = pauseCtx->itemVtx[j + 3].v.ob[0] = - pauseCtx->itemVtx[j + 0].v.ob[0] + 32; + pauseCtx->itemVtx[j + 0].v.ob[0] + + (ITEM_GRID_QUAD_WIDTH + (ITEM_GRID_QUAD_ENLARGE_OFFSET * 2)); pauseCtx->itemVtx[j + 0].v.ob[1] = pauseCtx->itemVtx[j + 1].v.ob[1] = - pauseCtx->itemVtx[j + 0].v.ob[1] + 2; + pauseCtx->itemVtx[j + 0].v.ob[1] + ITEM_GRID_QUAD_ENLARGE_OFFSET; pauseCtx->itemVtx[j + 2].v.ob[1] = pauseCtx->itemVtx[j + 3].v.ob[1] = - pauseCtx->itemVtx[j + 0].v.ob[1] - 32; + pauseCtx->itemVtx[j + 0].v.ob[1] - + (ITEM_GRID_QUAD_HEIGHT + (ITEM_GRID_QUAD_ENLARGE_OFFSET * 2)); } else if (i == cursorSlot) { + // enlarge item under the cursor + pauseCtx->itemVtx[j + 0].v.ob[0] = pauseCtx->itemVtx[j + 2].v.ob[0] = - pauseCtx->itemVtx[j + 0].v.ob[0] - 2; + pauseCtx->itemVtx[j + 0].v.ob[0] - ITEM_GRID_QUAD_ENLARGE_OFFSET; pauseCtx->itemVtx[j + 1].v.ob[0] = pauseCtx->itemVtx[j + 3].v.ob[0] = - pauseCtx->itemVtx[j + 0].v.ob[0] + 32; + pauseCtx->itemVtx[j + 0].v.ob[0] + + (ITEM_GRID_QUAD_WIDTH + (ITEM_GRID_QUAD_ENLARGE_OFFSET * 2)); pauseCtx->itemVtx[j + 0].v.ob[1] = pauseCtx->itemVtx[j + 1].v.ob[1] = - pauseCtx->itemVtx[j + 0].v.ob[1] + 2; + pauseCtx->itemVtx[j + 0].v.ob[1] + ITEM_GRID_QUAD_ENLARGE_OFFSET; pauseCtx->itemVtx[j + 2].v.ob[1] = pauseCtx->itemVtx[j + 3].v.ob[1] = - pauseCtx->itemVtx[j + 0].v.ob[1] - 32; + pauseCtx->itemVtx[j + 0].v.ob[1] - + (ITEM_GRID_QUAD_HEIGHT + (ITEM_GRID_QUAD_ENLARGE_OFFSET * 2)); } } } diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c index af1277e363..e49ad12687 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c @@ -1,4 +1,5 @@ #include "z_kaleido_scope.h" +#include "versions.h" #include "assets/textures/icon_item_24_static/icon_item_24_static.h" #if OOT_NTSC #include "assets/textures/icon_item_jpn_static/icon_item_jpn_static.h" @@ -150,7 +151,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->dungeonMapSlot; pauseCtx->cursorX[PAUSE_MAP] = 0; j = 72 + (pauseCtx->cursorSlot[PAUSE_MAP] * 4); - KaleidoScope_SetCursorVtx(pauseCtx, j, pauseCtx->mapPageVtx); + KaleidoScope_SetCursorPos(pauseCtx, j, pauseCtx->mapPageVtx); Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } @@ -181,7 +182,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) { PRINTF("kscope->cursor_point====%d\n", pauseCtx->cursorPoint[PAUSE_MAP]); j = 72 + (pauseCtx->cursorSlot[PAUSE_MAP] * 4); - KaleidoScope_SetCursorVtx(pauseCtx, j, pauseCtx->mapPageVtx); + KaleidoScope_SetCursorPos(pauseCtx, j, pauseCtx->mapPageVtx); Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } @@ -203,7 +204,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_MAP]; j = 72 + (pauseCtx->cursorSlot[PAUSE_MAP] * 4); - KaleidoScope_SetCursorVtx(pauseCtx, j, pauseCtx->mapPageVtx); + KaleidoScope_SetCursorPos(pauseCtx, j, pauseCtx->mapPageVtx); if (pauseCtx->cursorX[PAUSE_MAP] == 0) { pauseCtx->mapPageVtx[j + 0].v.ob[0] = pauseCtx->mapPageVtx[j + 2].v.ob[0] = @@ -283,7 +284,8 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) { gDPPipeSync(POLY_OPA_DISP++); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); - pauseCtx->mapPageVtx[116].v.ob[1] = pauseCtx->mapPageVtx[117].v.ob[1] = pauseCtx->offsetY - (VREG(30) * 14) + 49; + pauseCtx->mapPageVtx[116].v.ob[1] = pauseCtx->mapPageVtx[117].v.ob[1] = + pauseCtx->pagesYOrigin1 - (VREG(30) * 14) + 49; pauseCtx->mapPageVtx[118].v.ob[1] = pauseCtx->mapPageVtx[119].v.ob[1] = pauseCtx->mapPageVtx[116].v.ob[1] - 16; gDPLoadTextureBlock(POLY_OPA_DISP++, gDungeonMapLinkHeadTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 16, 0, @@ -295,7 +297,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) { if (CHECK_DUNGEON_ITEM(DUNGEON_COMPASS, gSaveContext.mapIndex) && (gMapData->skullFloorIconY[gSaveContext.mapIndex] != -99)) { pauseCtx->mapPageVtx[120].v.ob[1] = pauseCtx->mapPageVtx[121].v.ob[1] = - gMapData->skullFloorIconY[gSaveContext.mapIndex] + pauseCtx->offsetY; + gMapData->skullFloorIconY[gSaveContext.mapIndex] + pauseCtx->pagesYOrigin1; pauseCtx->mapPageVtx[122].v.ob[1] = pauseCtx->mapPageVtx[123].v.ob[1] = pauseCtx->mapPageVtx[120].v.ob[1] - 16; gDPLoadTextureBlock(POLY_OPA_DISP++, gDungeonMapSkullTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 16, 0, @@ -358,13 +360,40 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) { void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { static void* cloudTexs[] = { - gWorldMapCloud16Tex, gWorldMapCloud15Tex, gWorldMapCloud14Tex, gWorldMapCloud13Tex, - gWorldMapCloud12Tex, gWorldMapCloud11Tex, gWorldMapCloud10Tex, gWorldMapCloud9Tex, - gWorldMapCloud8Tex, gWorldMapCloud7Tex, gWorldMapCloud6Tex, gWorldMapCloud5Tex, - gWorldMapCloud4Tex, gWorldMapCloud3Tex, gWorldMapCloud2Tex, gWorldMapCloud1Tex, + gWorldMapCloudSacredForestMeadowTex, // WORLD_MAP_QUAD_CLOUDS_SACRED_FOREST_MEADOW + gWorldMapCloudHyruleFieldTex, // WORLD_MAP_QUAD_CLOUDS_HYRULE_FIELD + gWorldMapCloudLonLonRanchTex, // WORLD_MAP_QUAD_CLOUDS_LON_LON_RANCH + gWorldMapCloudMarketTex, // WORLD_MAP_QUAD_CLOUDS_MARKET + gWorldMapCloudHyruleCastleTex, // WORLD_MAP_QUAD_CLOUDS_HYRULE_CASTLE + gWorldMapCloudKakarikoVillageTex, // WORLD_MAP_QUAD_CLOUDS_KAKARIKO_VILLAGE + gWorldMapCloudGraveyardTex, // WORLD_MAP_QUAD_CLOUDS_GRAVEYARD + gWorldMapCloudDeathMountainTrailTex, // WORLD_MAP_QUAD_CLOUDS_DEATH_MOUNTAIN_TRAIL + gWorldMapCloudGoronCityTex, // WORLD_MAP_QUAD_CLOUDS_GORON_CITY + gWorldMapCloudZorasRiverTex, // WORLD_MAP_QUAD_CLOUDS_ZORAS_RIVER + gWorldMapCloudZorasDomainTex, // WORLD_MAP_QUAD_CLOUDS_ZORAS_DOMAIN + gWorldMapCloudZorasFountainTex, // WORLD_MAP_QUAD_CLOUDS_ZORAS_FOUNTAIN + gWorldMapCloudGerudoValleyTex, // WORLD_MAP_QUAD_CLOUDS_GERUDO_VALLEY + gWorldMapCloudGerudosFortressTex, // WORLD_MAP_QUAD_CLOUDS_GERUDOS_FORTRESS + gWorldMapCloudDesertColossusTex, // WORLD_MAP_QUAD_CLOUDS_DESERT_COLOSSUS + gWorldMapCloudLakeHyliaTex, // WORLD_MAP_QUAD_CLOUDS_LAKE_HYLIA }; static u16 cloudFlagNums[] = { - 0x05, 0x00, 0x13, 0x0E, 0x0F, 0x01, 0x02, 0x10, 0x12, 0x03, 0x07, 0x08, 0x09, 0x0C, 0x0B, 0x06, + WORLD_MAP_AREA_SACRED_FOREST_MEADOW, // WORLD_MAP_QUAD_CLOUDS_SACRED_FOREST_MEADOW + WORLD_MAP_AREA_HYRULE_FIELD, // WORLD_MAP_QUAD_CLOUDS_HYRULE_FIELD + WORLD_MAP_AREA_LON_LON_RANCH, // WORLD_MAP_QUAD_CLOUDS_LON_LON_RANCH + WORLD_MAP_AREA_MARKET, // WORLD_MAP_QUAD_CLOUDS_MARKET + WORLD_MAP_AREA_HYRULE_CASTLE, // WORLD_MAP_QUAD_CLOUDS_HYRULE_CASTLE + WORLD_MAP_AREA_KAKARIKO_VILLAGE, // WORLD_MAP_QUAD_CLOUDS_KAKARIKO_VILLAGE + WORLD_MAP_AREA_GRAVEYARD, // WORLD_MAP_QUAD_CLOUDS_GRAVEYARD + WORLD_MAP_AREA_DEATH_MOUNTAIN_TRAIL, // WORLD_MAP_QUAD_CLOUDS_DEATH_MOUNTAIN_TRAIL + WORLD_MAP_AREA_GORON_CITY, // WORLD_MAP_QUAD_CLOUDS_GORON_CITY + WORLD_MAP_AREA_ZORAS_RIVER, // WORLD_MAP_QUAD_CLOUDS_ZORAS_RIVER + WORLD_MAP_AREA_ZORAS_DOMAIN, // WORLD_MAP_QUAD_CLOUDS_ZORAS_DOMAIN + WORLD_MAP_AREA_ZORAS_FOUNTAIN, // WORLD_MAP_QUAD_CLOUDS_ZORAS_FOUNTAIN + WORLD_MAP_AREA_GERUDO_VALLEY, // WORLD_MAP_QUAD_CLOUDS_GERUDO_VALLEY + WORLD_MAP_AREA_GERUDOS_FORTRESS, // WORLD_MAP_QUAD_CLOUDS_GERUDOS_FORTRESS + WORLD_MAP_AREA_DESERT_COLOSSUS, // WORLD_MAP_QUAD_CLOUDS_DESERT_COLOSSUS + WORLD_MAP_AREA_LAKE_HYLIA, // WORLD_MAP_QUAD_CLOUDS_LAKE_HYLIA }; static s16 pointPulsePrimColor[] = { 0, 0, 255 }; static s16 pointPrimColors[][3] = { @@ -380,23 +409,124 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { static s16 pointPulseTimer = 20; static s16 D_8082A5B8[] = { 64, 64, 64, 28 }; static s16 areaBoxPosX[] = { - -41, 19, 44, 40, 49, 51, -49, 83, 80, -67, 50, -109, -76, -86, -10, -6, 19, 24, 11, -17, 37, -6, + -41, // WORLD_MAP_AREA_HYRULE_FIELD + 19, // WORLD_MAP_AREA_KAKARIKO_VILLAGE + 44, // WORLD_MAP_AREA_GRAVEYARD + 40, // WORLD_MAP_AREA_ZORAS_RIVER + 49, // WORLD_MAP_AREA_KOKIRI_FOREST + 51, // WORLD_MAP_AREA_SACRED_FOREST_MEADOW + -49, // WORLD_MAP_AREA_LAKE_HYLIA + 83, // WORLD_MAP_AREA_ZORAS_DOMAIN + 80, // WORLD_MAP_AREA_ZORAS_FOUNTAIN + -67, // WORLD_MAP_AREA_GERUDO_VALLEY + 50, // WORLD_MAP_AREA_LOST_WOODS + -109, // WORLD_MAP_AREA_DESERT_COLOSSUS + -76, // WORLD_MAP_AREA_GERUDOS_FORTRESS + -86, // WORLD_MAP_AREA_HAUNTED_WASTELAND + -10, // WORLD_MAP_AREA_MARKET + -6, // WORLD_MAP_AREA_HYRULE_CASTLE + 19, // WORLD_MAP_AREA_DEATH_MOUNTAIN_TRAIL + 24, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER + 11, // WORLD_MAP_AREA_GORON_CITY + -17, // WORLD_MAP_AREA_LON_LON_RANCH + 37, // WORLD_MAP_AREA_QUESTION_MARK + -6, // WORLD_MAP_AREA_GANONS_CASTLE }; static s16 areaBoxWidths[] = { - 96, 32, 32, 48, 48, 32, 48, 32, 32, 32, 16, 32, 32, 16, 32, 32, 32, 32, 32, 32, 16, 32, + 96, // WORLD_MAP_AREA_HYRULE_FIELD + 32, // WORLD_MAP_AREA_KAKARIKO_VILLAGE + 32, // WORLD_MAP_AREA_GRAVEYARD + 48, // WORLD_MAP_AREA_ZORAS_RIVER + 48, // WORLD_MAP_AREA_KOKIRI_FOREST + 32, // WORLD_MAP_AREA_SACRED_FOREST_MEADOW + 48, // WORLD_MAP_AREA_LAKE_HYLIA + 32, // WORLD_MAP_AREA_ZORAS_DOMAIN + 32, // WORLD_MAP_AREA_ZORAS_FOUNTAIN + 32, // WORLD_MAP_AREA_GERUDO_VALLEY + 16, // WORLD_MAP_AREA_LOST_WOODS + 32, // WORLD_MAP_AREA_DESERT_COLOSSUS + 32, // WORLD_MAP_AREA_GERUDOS_FORTRESS + 16, // WORLD_MAP_AREA_HAUNTED_WASTELAND + 32, // WORLD_MAP_AREA_MARKET + 32, // WORLD_MAP_AREA_HYRULE_CASTLE + 32, // WORLD_MAP_AREA_DEATH_MOUNTAIN_TRAIL + 32, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER + 32, // WORLD_MAP_AREA_GORON_CITY + 32, // WORLD_MAP_AREA_LON_LON_RANCH + 16, // WORLD_MAP_AREA_QUESTION_MARK + 32, // WORLD_MAP_AREA_GANONS_CASTLE }; static s16 areaBoxPosY[] = { - 30, 36, 35, 26, 7, 11, -31, 30, 38, 23, 2, 42, 40, 32, 38, 50, 57, 58, 56, 12, 36, 50, + 30, // WORLD_MAP_AREA_HYRULE_FIELD + 36, // WORLD_MAP_AREA_KAKARIKO_VILLAGE + 35, // WORLD_MAP_AREA_GRAVEYARD + 26, // WORLD_MAP_AREA_ZORAS_RIVER + 7, // WORLD_MAP_AREA_KOKIRI_FOREST + 11, // WORLD_MAP_AREA_SACRED_FOREST_MEADOW + -31, // WORLD_MAP_AREA_LAKE_HYLIA + 30, // WORLD_MAP_AREA_ZORAS_DOMAIN + 38, // WORLD_MAP_AREA_ZORAS_FOUNTAIN + 23, // WORLD_MAP_AREA_GERUDO_VALLEY + 2, // WORLD_MAP_AREA_LOST_WOODS + 42, // WORLD_MAP_AREA_DESERT_COLOSSUS + 40, // WORLD_MAP_AREA_GERUDOS_FORTRESS + 32, // WORLD_MAP_AREA_HAUNTED_WASTELAND + 38, // WORLD_MAP_AREA_MARKET + 50, // WORLD_MAP_AREA_HYRULE_CASTLE + 57, // WORLD_MAP_AREA_DEATH_MOUNTAIN_TRAIL + 58, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER + 56, // WORLD_MAP_AREA_GORON_CITY + 12, // WORLD_MAP_AREA_LON_LON_RANCH + 36, // WORLD_MAP_AREA_QUESTION_MARK + 50, // WORLD_MAP_AREA_GANONS_CASTLE }; static s16 areaBoxHeights[] = { - 59, 19, 13, 19, 38, 17, 38, 17, 13, 26, 16, 26, 26, 16, 19, 17, 26, 13, 17, 17, 16, 17, + 59, // WORLD_MAP_AREA_HYRULE_FIELD + 19, // WORLD_MAP_AREA_KAKARIKO_VILLAGE + 13, // WORLD_MAP_AREA_GRAVEYARD + 19, // WORLD_MAP_AREA_ZORAS_RIVER + 38, // WORLD_MAP_AREA_KOKIRI_FOREST + 17, // WORLD_MAP_AREA_SACRED_FOREST_MEADOW + 38, // WORLD_MAP_AREA_LAKE_HYLIA + 17, // WORLD_MAP_AREA_ZORAS_DOMAIN + 13, // WORLD_MAP_AREA_ZORAS_FOUNTAIN + 26, // WORLD_MAP_AREA_GERUDO_VALLEY + 16, // WORLD_MAP_AREA_LOST_WOODS + 26, // WORLD_MAP_AREA_DESERT_COLOSSUS + 26, // WORLD_MAP_AREA_GERUDOS_FORTRESS + 16, // WORLD_MAP_AREA_HAUNTED_WASTELAND + 19, // WORLD_MAP_AREA_MARKET + 17, // WORLD_MAP_AREA_HYRULE_CASTLE + 26, // WORLD_MAP_AREA_DEATH_MOUNTAIN_TRAIL + 13, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER + 17, // WORLD_MAP_AREA_GORON_CITY + 17, // WORLD_MAP_AREA_LON_LON_RANCH + 16, // WORLD_MAP_AREA_QUESTION_MARK + 17, // WORLD_MAP_AREA_GANONS_CASTLE }; static void* areaBoxTexs[] = { - gWorldMapAreaBox7Tex, gWorldMapAreaBox1Tex, gWorldMapAreaBox4Tex, gWorldMapAreaBox6Tex, gWorldMapAreaBox2Tex, - gWorldMapAreaBox3Tex, gWorldMapAreaBox2Tex, gWorldMapAreaBox3Tex, gWorldMapAreaBox4Tex, gWorldMapAreaBox5Tex, - gWorldMapAreaBox8Tex, gWorldMapAreaBox5Tex, gWorldMapAreaBox5Tex, gWorldMapAreaBox8Tex, gWorldMapAreaBox1Tex, - gWorldMapAreaBox3Tex, gWorldMapAreaBox5Tex, gWorldMapAreaBox4Tex, gWorldMapAreaBox3Tex, gWorldMapAreaBox3Tex, - gWorldMapAreaBox8Tex, gWorldMapAreaBox3Tex, + gWorldMapAreaBox7Tex, // WORLD_MAP_AREA_HYRULE_FIELD + gWorldMapAreaBox1Tex, // WORLD_MAP_AREA_KAKARIKO_VILLAGE + gWorldMapAreaBox4Tex, // WORLD_MAP_AREA_GRAVEYARD + gWorldMapAreaBox6Tex, // WORLD_MAP_AREA_ZORAS_RIVER + gWorldMapAreaBox2Tex, // WORLD_MAP_AREA_KOKIRI_FOREST + gWorldMapAreaBox3Tex, // WORLD_MAP_AREA_SACRED_FOREST_MEADOW + gWorldMapAreaBox2Tex, // WORLD_MAP_AREA_LAKE_HYLIA + gWorldMapAreaBox3Tex, // WORLD_MAP_AREA_ZORAS_DOMAIN + gWorldMapAreaBox4Tex, // WORLD_MAP_AREA_ZORAS_FOUNTAIN + gWorldMapAreaBox5Tex, // WORLD_MAP_AREA_GERUDO_VALLEY + gWorldMapAreaBox8Tex, // WORLD_MAP_AREA_LOST_WOODS + gWorldMapAreaBox5Tex, // WORLD_MAP_AREA_DESERT_COLOSSUS + gWorldMapAreaBox5Tex, // WORLD_MAP_AREA_GERUDOS_FORTRESS + gWorldMapAreaBox8Tex, // WORLD_MAP_AREA_HAUNTED_WASTELAND + gWorldMapAreaBox1Tex, // WORLD_MAP_AREA_MARKET + gWorldMapAreaBox3Tex, // WORLD_MAP_AREA_HYRULE_CASTLE + gWorldMapAreaBox5Tex, // WORLD_MAP_AREA_DEATH_MOUNTAIN_TRAIL + gWorldMapAreaBox4Tex, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER + gWorldMapAreaBox3Tex, // WORLD_MAP_AREA_GORON_CITY + gWorldMapAreaBox3Tex, // WORLD_MAP_AREA_LON_LON_RANCH + gWorldMapAreaBox8Tex, // WORLD_MAP_AREA_QUESTION_MARK + gWorldMapAreaBox3Tex, // WORLD_MAP_AREA_GANONS_CASTLE }; static void* currentPosTitleTexs[] = LANGUAGE_ARRAY(gPauseCurrentPositionJPNTex, gPauseCurrentPositionENGTex, gPauseCurrentPositionGERTex, gPauseCurrentPositionFRATex); @@ -424,12 +554,13 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { do { pauseCtx->cursorPoint[PAUSE_WORLD_MAP]++; - if (pauseCtx->cursorPoint[PAUSE_WORLD_MAP] > 11) { - pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 11; + if (pauseCtx->cursorPoint[PAUSE_WORLD_MAP] >= WORLD_MAP_POINT_MAX) { + pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = WORLD_MAP_POINT_MAX - 1; KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT); break; } - } while (pauseCtx->worldMapPoints[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] == 0); + } while (pauseCtx->worldMapPoints[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] == + WORLD_MAP_POINT_STATE_HIDE); } else if (pauseCtx->stickAdjX < -30) { D_8082A6D4 = 0; @@ -440,14 +571,16 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT); break; } - } while (pauseCtx->worldMapPoints[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] == 0); + } while (pauseCtx->worldMapPoints[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] == + WORLD_MAP_POINT_STATE_HIDE); } else { D_8082A6D4++; } pauseCtx->cursorItem[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; - pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_WORLD_MAP] + 0x1F; - KaleidoScope_SetCursorVtx(pauseCtx, pauseCtx->cursorSlot[PAUSE_MAP] * 4, pauseCtx->mapPageVtx); + pauseCtx->cursorSlot[PAUSE_MAP] = + PAGE_BG_QUADS + WORLD_MAP_QUAD_POINT_FIRST + pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; + KaleidoScope_SetCursorPos(pauseCtx, pauseCtx->cursorSlot[PAUSE_MAP] * 4, pauseCtx->mapPageVtx); } else { pauseCtx->cursorItem[PAUSE_MAP] = gSaveContext.worldMapArea + 0x18; if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { @@ -455,29 +588,33 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 0; pauseCtx->cursorSpecialPos = 0; - while (pauseCtx->worldMapPoints[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] == 0) { + while (pauseCtx->worldMapPoints[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] == + WORLD_MAP_POINT_STATE_HIDE) { pauseCtx->cursorPoint[PAUSE_WORLD_MAP]++; } pauseCtx->cursorItem[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; - pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_WORLD_MAP] + 0x1F; - KaleidoScope_SetCursorVtx(pauseCtx, pauseCtx->cursorSlot[PAUSE_MAP] * 4, pauseCtx->mapPageVtx); + pauseCtx->cursorSlot[PAUSE_MAP] = + PAGE_BG_QUADS + WORLD_MAP_QUAD_POINT_FIRST + pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; + KaleidoScope_SetCursorPos(pauseCtx, pauseCtx->cursorSlot[PAUSE_MAP] * 4, pauseCtx->mapPageVtx); Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); D_8082A6D4 = 0; } } else { if (pauseCtx->stickAdjX < -30) { - pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 11; + pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = WORLD_MAP_POINT_MAX - 1; pauseCtx->cursorSpecialPos = 0; - while (pauseCtx->worldMapPoints[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] == 0) { + while (pauseCtx->worldMapPoints[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] == + WORLD_MAP_POINT_STATE_HIDE) { pauseCtx->cursorPoint[PAUSE_WORLD_MAP]--; } pauseCtx->cursorItem[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; - pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_WORLD_MAP] + 0x1F; - KaleidoScope_SetCursorVtx(pauseCtx, pauseCtx->cursorSlot[PAUSE_MAP] * 4, pauseCtx->mapPageVtx); + pauseCtx->cursorSlot[PAUSE_MAP] = + PAGE_BG_QUADS + WORLD_MAP_QUAD_POINT_FIRST + pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; + KaleidoScope_SetCursorPos(pauseCtx, pauseCtx->cursorSlot[PAUSE_MAP] * 4, pauseCtx->mapPageVtx); Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); D_8082A6D4 = 0; @@ -485,7 +622,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { } } - if (pauseCtx->worldMapPoints[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] == 0) { + if (pauseCtx->worldMapPoints[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] == WORLD_MAP_POINT_STATE_HIDE) { pauseCtx->cursorItem[PAUSE_MAP] = PAUSE_ITEM_NONE; } @@ -497,36 +634,46 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { gDPPipeSync(POLY_OPA_DISP++); - if (!IS_DEBUG || (HREG(15) == 0)) { +#if PLATFORM_N64 && OOT_VERSION != NTSC_1_2 + if (0) { + s32 pad[3]; + } +#endif + +#if IS_DEBUG + if (HREG(15) == 0) { gDPSetTextureFilter(POLY_OPA_DISP++, G_TF_POINT); gDPLoadTLUT_pal256(POLY_OPA_DISP++, gWorldMapImageTLUT); gDPSetTextureLUT(POLY_OPA_DISP++, G_TT_RGBA16); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); - gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[188], 32, 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_IMAGE_FIRST) * 4], 32, 0); for (j = t = i = 0; i < 8; i++, t++, j += 4) { - gDPLoadTextureBlock(POLY_OPA_DISP++, (u8*)gWorldMapImageTex + t * 216 * 9, G_IM_FMT_CI, G_IM_SIZ_8b, 216, 9, - 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock( + POLY_OPA_DISP++, (u8*)gWorldMapImageTex + t * WORLD_MAP_IMAGE_WIDTH * WORLD_MAP_IMAGE_FRAG_HEIGHT, + G_IM_FMT_CI, G_IM_SIZ_8b, WORLD_MAP_IMAGE_WIDTH, WORLD_MAP_IMAGE_FRAG_HEIGHT, 0, + G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, j, j + 2, j + 3, j + 1, 0); } - gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[220], 28, 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_IMAGE_FIRST + 8) * 4], 28, 0); for (j = i = 0; i < 6; i++, t++, j += 4) { - gDPLoadTextureBlock(POLY_OPA_DISP++, (u8*)gWorldMapImageTex + t * 216 * 9, G_IM_FMT_CI, G_IM_SIZ_8b, 216, 9, - 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock( + POLY_OPA_DISP++, (u8*)gWorldMapImageTex + t * WORLD_MAP_IMAGE_WIDTH * WORLD_MAP_IMAGE_FRAG_HEIGHT, + G_IM_FMT_CI, G_IM_SIZ_8b, WORLD_MAP_IMAGE_WIDTH, WORLD_MAP_IMAGE_FRAG_HEIGHT, 0, + G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, j, j + 2, j + 3, j + 1, 0); } - gDPLoadTextureBlock(POLY_OPA_DISP++, (u8*)gWorldMapImageTex + t * 216 * 9, G_IM_FMT_CI, G_IM_SIZ_8b, 216, 2, 0, - G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOLOD); + gDPLoadTextureBlock( + POLY_OPA_DISP++, (u8*)gWorldMapImageTex + t * WORLD_MAP_IMAGE_WIDTH * WORLD_MAP_IMAGE_FRAG_HEIGHT, + G_IM_FMT_CI, G_IM_SIZ_8b, WORLD_MAP_IMAGE_WIDTH, WORLD_MAP_IMAGE_HEIGHT % WORLD_MAP_IMAGE_FRAG_HEIGHT, 0, + G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, j, j + 2, j + 3, j + 1, 0); } else if (HREG(15) == 1) { @@ -534,20 +681,56 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { gSPLoadUcodeL(gfx++, gspS2DEX2d_fifo); - Room_DrawBackground2D(&gfx, gWorldMapImageTex, gWorldMapImageTLUT, 216, 128, G_IM_FMT_CI, G_IM_SIZ_8b, - G_TT_RGBA16, 256, HREG(13) / 100.0f, HREG(14) / 100.0f); + Room_DrawBackground2D(&gfx, gWorldMapImageTex, gWorldMapImageTLUT, WORLD_MAP_IMAGE_WIDTH, + WORLD_MAP_IMAGE_HEIGHT, G_IM_FMT_CI, G_IM_SIZ_8b, G_TT_RGBA16, 256, HREG(13) / 100.0f, + HREG(14) / 100.0f); gSPLoadUcode(gfx++, SysUcode_GetUCode(), SysUcode_GetUCodeData()); POLY_OPA_DISP = gfx; } -#if IS_DEBUG if (HREG(15) == 2) { HREG(15) = 1; HREG(14) = 6100; HREG(13) = 5300; } +#else + // Same as `HREG(15) == 0` case above + gDPSetTextureFilter(POLY_OPA_DISP++, G_TF_POINT); + + gDPLoadTLUT_pal256(POLY_OPA_DISP++, gWorldMapImageTLUT); + gDPSetTextureLUT(POLY_OPA_DISP++, G_TT_RGBA16); + + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[188], 32, 0); + + for (j = t = i = 0; i < 8; i++, t++, j += 4) { + gDPLoadTextureBlock( + POLY_OPA_DISP++, (u8*)gWorldMapImageTex + t * WORLD_MAP_IMAGE_WIDTH * WORLD_MAP_IMAGE_FRAG_HEIGHT, + G_IM_FMT_CI, G_IM_SIZ_8b, WORLD_MAP_IMAGE_WIDTH, WORLD_MAP_IMAGE_FRAG_HEIGHT, 0, G_TX_WRAP | G_TX_NOMIRROR, + G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + gSP1Quadrangle(POLY_OPA_DISP++, j, j + 2, j + 3, j + 1, 0); + } + + gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[220], 28, 0); + + for (j = i = 0; i < 6; i++, t++, j += 4) { + gDPLoadTextureBlock( + POLY_OPA_DISP++, (u8*)gWorldMapImageTex + t * WORLD_MAP_IMAGE_WIDTH * WORLD_MAP_IMAGE_FRAG_HEIGHT, + G_IM_FMT_CI, G_IM_SIZ_8b, WORLD_MAP_IMAGE_WIDTH, WORLD_MAP_IMAGE_FRAG_HEIGHT, 0, G_TX_WRAP | G_TX_NOMIRROR, + G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + gSP1Quadrangle(POLY_OPA_DISP++, j, j + 2, j + 3, j + 1, 0); + } + + gDPLoadTextureBlock( + POLY_OPA_DISP++, (u8*)gWorldMapImageTex + t * WORLD_MAP_IMAGE_WIDTH * WORLD_MAP_IMAGE_FRAG_HEIGHT, G_IM_FMT_CI, + G_IM_SIZ_8b, WORLD_MAP_IMAGE_WIDTH, WORLD_MAP_IMAGE_HEIGHT % WORLD_MAP_IMAGE_FRAG_HEIGHT, 0, + G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + gSP1Quadrangle(POLY_OPA_DISP++, j, j + 2, j + 3, j + 1, 0); #endif if (ZREG(38) == 0) { @@ -561,13 +744,14 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 235, 235, 235, pauseCtx->alpha); for (k = 0; k < 15; k += 8) { - gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[60 + k * 4], 32, 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[(PAGE_BG_QUADS + k) * 4], 32, 0); for (j = i = 0; i < 8; i++, j += 4) { if (!(gSaveContext.save.info.worldMapAreaData & gBitFlags[cloudFlagNums[k + i]])) { - gDPLoadTextureBlock_4b(POLY_OPA_DISP++, cloudTexs[k + i], G_IM_FMT_I, D_8082AAEC[k + i], - D_8082AB2C[k + i], 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, - G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock_4b(POLY_OPA_DISP++, cloudTexs[k + i], G_IM_FMT_I, + gVtxPageMapWorldQuadsWidth[k + i], gVtxPageMapWorldQuadsHeight[k + i], 0, + G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, j, j + 2, j + 3, j + 1, 0); } @@ -575,29 +759,39 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { } } - if (gSaveContext.worldMapArea < 22) { + if (gSaveContext.worldMapArea < WORLD_MAP_AREA_MAX) { gDPPipeSync(POLY_OPA_DISP++); gDPSetTextureFilter(POLY_OPA_DISP++, G_TF_POINT); - pauseCtx->mapPageVtx[172].v.ob[0] = pauseCtx->mapPageVtx[174].v.ob[0] = - areaBoxPosX[((void)0, gSaveContext.worldMapArea)]; + // Quad PAGE_BG_QUADS + WORLD_MAP_QUAD_28 + + pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4 + 0].v.ob[0] = + pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4 + 2].v.ob[0] = + areaBoxPosX[((void)0, gSaveContext.worldMapArea)]; - pauseCtx->mapPageVtx[173].v.ob[0] = pauseCtx->mapPageVtx[175].v.ob[0] = - pauseCtx->mapPageVtx[172].v.ob[0] + areaBoxWidths[((void)0, gSaveContext.worldMapArea)]; + pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4 + 1].v.ob[0] = + pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4 + 3].v.ob[0] = + pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4 + 0].v.ob[0] + + areaBoxWidths[((void)0, gSaveContext.worldMapArea)]; - pauseCtx->mapPageVtx[172].v.ob[1] = pauseCtx->mapPageVtx[173].v.ob[1] = - areaBoxPosY[((void)0, gSaveContext.worldMapArea)] + pauseCtx->offsetY; + pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4 + 0].v.ob[1] = + pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4 + 1].v.ob[1] = + areaBoxPosY[((void)0, gSaveContext.worldMapArea)] + pauseCtx->pagesYOrigin1; - pauseCtx->mapPageVtx[174].v.ob[1] = pauseCtx->mapPageVtx[175].v.ob[1] = - pauseCtx->mapPageVtx[172].v.ob[1] - areaBoxHeights[((void)0, gSaveContext.worldMapArea)]; + pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4 + 2].v.ob[1] = + pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4 + 3].v.ob[1] = + pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4 + 0].v.ob[1] - + areaBoxHeights[((void)0, gSaveContext.worldMapArea)]; - pauseCtx->mapPageVtx[173].v.tc[0] = pauseCtx->mapPageVtx[175].v.tc[0] = - areaBoxWidths[((void)0, gSaveContext.worldMapArea)] << 5; + pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4 + 1].v.tc[0] = + pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4 + 3].v.tc[0] = + areaBoxWidths[((void)0, gSaveContext.worldMapArea)] << 5; - pauseCtx->mapPageVtx[174].v.tc[1] = pauseCtx->mapPageVtx[175].v.tc[1] = - areaBoxHeights[((void)0, gSaveContext.worldMapArea)] << 5; + pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4 + 2].v.tc[1] = + pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4 + 3].v.tc[1] = + areaBoxHeights[((void)0, gSaveContext.worldMapArea)] << 5; - gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[172], 4, 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_28) * 4], 4, 0); gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 100, 255, 255, pauseCtx->alpha); @@ -659,8 +853,8 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { pointPulseEnvColor[0] = pointEnvColors[pointPulseStage][0]; pointPulseEnvColor[1] = pointEnvColors[pointPulseStage][1]; pointPulseEnvColor[2] = pointEnvColors[pointPulseStage][2]; - pointPulseStage ^= 1; pointPulseTimer = 20; + pointPulseStage ^= 1; } Gfx_SetupDL_42Opa(gfxCtx); @@ -671,21 +865,22 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { gDPLoadTextureBlock(POLY_OPA_DISP++, gWorldMapDotTex, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - for (j = i = 0; i < 12; i++, t++, j += 4) { - if (pauseCtx->worldMapPoints[i] != 0) { + for (j = i = 0; i < WORLD_MAP_POINT_MAX; i++, t++, j += 4) { + if (pauseCtx->worldMapPoints[i] != WORLD_MAP_POINT_STATE_HIDE) { gDPPipeSync(POLY_OPA_DISP++); - if (pauseCtx->worldMapPoints[i] == 1) { + if (pauseCtx->worldMapPoints[i] == WORLD_MAP_POINT_STATE_SHOW) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, pointPrimColors[0][0], pointPrimColors[0][1], pointPrimColors[0][2], pauseCtx->alpha); gDPSetEnvColor(POLY_OPA_DISP++, pointEnvColors[0][0], pointEnvColors[0][1], pointEnvColors[0][2], 0); - } else { + } else { // WORLD_MAP_POINT_STATE_HIGHLIGHT gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, pointPulsePrimColor[0], pointPulsePrimColor[1], pointPulsePrimColor[2], pauseCtx->alpha); gDPSetEnvColor(POLY_OPA_DISP++, pointPulseEnvColor[0], pointPulseEnvColor[1], pointPulseEnvColor[2], 0); } - gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[124 + i * 4], 4, 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_POINT_FIRST + i) * 4], 4, + 0); gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); } @@ -695,9 +890,9 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { KaleidoScope_DrawCursor(play, PAUSE_MAP); } - gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[176], 16, 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->mapPageVtx[(PAGE_BG_QUADS + WORLD_MAP_QUAD_TRADE_QUEST_MARKER) * 4], 16, 0); - if (pauseCtx->tradeQuestLocation != 0xFF) { + if (pauseCtx->tradeQuestMarker != TRADE_QUEST_MARKER_NONE) { gDPPipeSync(POLY_OPA_DISP++); gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, pointPulsePrimColor[0], 0, pauseCtx->alpha); @@ -709,7 +904,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); } - if (gSaveContext.worldMapArea < 22) { + if (gSaveContext.worldMapArea < WORLD_MAP_AREA_MAX) { gDPPipeSync(POLY_OPA_DISP++); gDPSetCombineLERP(POLY_OPA_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c index ca2017e335..2ef5079a44 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c @@ -1,6 +1,6 @@ #include "z_kaleido_scope.h" -static s16 D_8082A6E0[] = { 100, 255 }; +static s16 sKaleidoPromptCursorAlphaVals[] = { 100, 255 }; void KaleidoScope_UpdatePrompt(PlayState* play) { PauseContext* pauseCtx = &play->pauseCtx; @@ -8,8 +8,10 @@ void KaleidoScope_UpdatePrompt(PlayState* play) { s8 stickAdjX = input->rel.stick_x; s16 step; - if (((pauseCtx->state == PAUSE_STATE_SAVE_PROMPT) && (pauseCtx->unk_1EC == 1)) || + if (((pauseCtx->state == PAUSE_STATE_SAVE_PROMPT) && + (pauseCtx->savePromptState == PAUSE_SAVE_PROMPT_STATE_WAIT_CHOICE)) || (pauseCtx->state == PAUSE_STATE_14) || (pauseCtx->state == PAUSE_STATE_16)) { + if ((pauseCtx->promptChoice == 0) && (stickAdjX >= 30)) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -20,18 +22,20 @@ void KaleidoScope_UpdatePrompt(PlayState* play) { pauseCtx->promptChoice = 0; } - step = ABS(VREG(61) - D_8082A6E0[VREG(62)]) / VREG(63); - if (VREG(61) >= D_8082A6E0[VREG(62)]) { - VREG(61) -= step; + step = ABS(R_KALEIDO_PROMPT_CURSOR_ALPHA - sKaleidoPromptCursorAlphaVals[R_KALEIDO_PROMPT_CURSOR_ALPHA_STATE]) / + R_KALEIDO_PROMPT_CURSOR_ALPHA_TIMER; + if (R_KALEIDO_PROMPT_CURSOR_ALPHA >= sKaleidoPromptCursorAlphaVals[R_KALEIDO_PROMPT_CURSOR_ALPHA_STATE]) { + R_KALEIDO_PROMPT_CURSOR_ALPHA -= step; } else { - VREG(61) += step; + R_KALEIDO_PROMPT_CURSOR_ALPHA += step; } - VREG(63)--; - if (VREG(63) == 0) { - VREG(61) = D_8082A6E0[VREG(62)]; - VREG(63) = VREG(60) + VREG(62); - VREG(62) ^= 1; + R_KALEIDO_PROMPT_CURSOR_ALPHA_TIMER--; + if (R_KALEIDO_PROMPT_CURSOR_ALPHA_TIMER == 0) { + R_KALEIDO_PROMPT_CURSOR_ALPHA = sKaleidoPromptCursorAlphaVals[R_KALEIDO_PROMPT_CURSOR_ALPHA_STATE]; + R_KALEIDO_PROMPT_CURSOR_ALPHA_TIMER = + R_KALEIDO_PROMPT_CURSOR_ALPHA_TIMER_BASE + R_KALEIDO_PROMPT_CURSOR_ALPHA_STATE; + R_KALEIDO_PROMPT_CURSOR_ALPHA_STATE ^= 1; } } } diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c index e8d704d3cb..e4b0654c2e 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c @@ -1,3 +1,6 @@ +#if PLATFORM_N64 +#include "n64dd.h" +#endif #include "z_kaleido_scope.h" #include "assets/textures/icon_item_static/icon_item_static.h" #include "assets/textures/icon_item_24_static/icon_item_24_static.h" @@ -11,146 +14,613 @@ #endif #include "assets/textures/icon_item_gameover_static/icon_item_gameover_static.h" #include "terminal.h" +#include "versions.h" + +#pragma increment_block_number "ntsc-1.2:128 pal-1.0:128 pal-1.1:128" + +#if N64_BTN_COLORS +#define KALEIDO_PROMPT_CURSOR_R 100 +#define KALEIDO_PROMPT_CURSOR_G 100 +#define KALEIDO_PROMPT_CURSOR_B 255 +#else +#define KALEIDO_PROMPT_CURSOR_R 100 +#define KALEIDO_PROMPT_CURSOR_G 255 +#define KALEIDO_PROMPT_CURSOR_B 100 +#endif + +#if N64_BTN_COLORS +#define KALEIDO_COLOR_CURSOR_UNK_R 0 +#define KALEIDO_COLOR_CURSOR_UNK_G 50 +#define KALEIDO_COLOR_CURSOR_UNK_B 255 +#else +#define KALEIDO_COLOR_CURSOR_UNK_R 0 +#define KALEIDO_COLOR_CURSOR_UNK_G 255 +#define KALEIDO_COLOR_CURSOR_UNK_B 50 +#endif + +typedef enum { + /* 0 */ VTX_PAGE_ITEM, + /* 1 */ VTX_PAGE_EQUIP, + /* 2 */ VTX_PAGE_MAP_DUNGEON, + /* 3 */ VTX_PAGE_QUEST, + /* 4 */ VTX_PAGE_MAP_WORLD, + /* 5 */ VTX_PAGE_PROMPT +} VtxPageInit; + +#define VTX_PAGE_ITEM_QUADS 0 // VTX_PAGE_ITEM +#define VTX_PAGE_EQUIP_QUADS 0 // VTX_PAGE_EQUIP +#define VTX_PAGE_MAP_DUNGEON_QUADS 17 // VTX_PAGE_MAP_DUNGEON +#define VTX_PAGE_QUEST_QUADS 0 // VTX_PAGE_QUEST +#define VTX_PAGE_MAP_WORLD_QUADS 32 // VTX_PAGE_MAP_WORLD +#define VTX_PAGE_PROMPT_QUADS PROMPT_QUAD_MAX // VTX_PAGE_PROMPT #if OOT_NTSC -static void* sEquipmentJPNTexs[] = { - gPauseEquipment00Tex, gPauseEquipment01Tex, gPauseEquipment02Tex, gPauseEquipment03Tex, gPauseEquipment04Tex, - gPauseEquipment10JPNTex, gPauseEquipment11Tex, gPauseEquipment12Tex, gPauseEquipment13Tex, gPauseEquipment14Tex, - gPauseEquipment20Tex, gPauseEquipment21Tex, gPauseEquipment22Tex, gPauseEquipment23Tex, gPauseEquipment24Tex, -}; -static void* sSelectItemJPNTexs[] = { - gPauseSelectItem00JPNTex, gPauseSelectItem01Tex, gPauseSelectItem02Tex, gPauseSelectItem03Tex, - gPauseSelectItem04Tex, gPauseSelectItem10JPNTex, gPauseSelectItem11Tex, gPauseSelectItem12Tex, - gPauseSelectItem13Tex, gPauseSelectItem14Tex, gPauseSelectItem20JPNTex, gPauseSelectItem21Tex, - gPauseSelectItem22Tex, gPauseSelectItem23Tex, gPauseSelectItem24Tex, -}; -static void* sMapJPNTexs[] = { - gPauseMap00Tex, gPauseMap01Tex, gPauseMap02Tex, gPauseMap03Tex, gPauseMap04Tex, - gPauseMap10JPNTex, gPauseMap11Tex, gPauseMap12Tex, gPauseMap13Tex, gPauseMap14Tex, - gPauseMap20Tex, gPauseMap21Tex, gPauseMap22Tex, gPauseMap23Tex, gPauseMap24Tex, -}; -static void* sQuestStatusJPNTexs[] = { - gPauseQuestStatus00JPNTex, gPauseQuestStatus01Tex, gPauseQuestStatus02Tex, gPauseQuestStatus03Tex, - gPauseQuestStatus04Tex, gPauseQuestStatus10JPNTex, gPauseQuestStatus11Tex, gPauseQuestStatus12Tex, - gPauseQuestStatus13Tex, gPauseQuestStatus14Tex, gPauseQuestStatus20JPNTex, gPauseQuestStatus21Tex, - gPauseQuestStatus22Tex, gPauseQuestStatus23Tex, gPauseQuestStatus24Tex, -}; -static void* sSaveJPNTexs[] = { - gPauseSave00Tex, gPauseSave01Tex, gPauseSave02Tex, gPauseSave03Tex, gPauseSave04Tex, - gPauseSave10JPNTex, gPauseSave11Tex, gPauseSave12Tex, gPauseSave13Tex, gPauseSave14Tex, - gPauseSave20Tex, gPauseSave21Tex, gPauseSave22Tex, gPauseSave23Tex, gPauseSave24Tex, + +// Japanese + +static void* sEquipPageBgQuadsJPNTexs[] = { + // column 1 + gPauseEquipment00Tex, + gPauseEquipment01Tex, + gPauseEquipment02Tex, + gPauseEquipment03Tex, + gPauseEquipment04Tex, + // column 2 + gPauseEquipment10JPNTex, + gPauseEquipment11Tex, + gPauseEquipment12Tex, + gPauseEquipment13Tex, + gPauseEquipment14Tex, + // column 3 + gPauseEquipment20Tex, + gPauseEquipment21Tex, + gPauseEquipment22Tex, + gPauseEquipment23Tex, + gPauseEquipment24Tex, }; + +static void* sItemPageBgQuadsJPNTexs[] = { + // column 1 + gPauseSelectItem00JPNTex, + gPauseSelectItem01Tex, + gPauseSelectItem02Tex, + gPauseSelectItem03Tex, + gPauseSelectItem04Tex, + // column 2 + gPauseSelectItem10JPNTex, + gPauseSelectItem11Tex, + gPauseSelectItem12Tex, + gPauseSelectItem13Tex, + gPauseSelectItem14Tex, + // column 3 + gPauseSelectItem20JPNTex, + gPauseSelectItem21Tex, + gPauseSelectItem22Tex, + gPauseSelectItem23Tex, + gPauseSelectItem24Tex, +}; + +static void* sMapPageBgQuadsJPNTexs[] = { + // column 1 + gPauseMap00Tex, + gPauseMap01Tex, + gPauseMap02Tex, + gPauseMap03Tex, + gPauseMap04Tex, + // column 2 + gPauseMap10JPNTex, + gPauseMap11Tex, + gPauseMap12Tex, + gPauseMap13Tex, + gPauseMap14Tex, + // column 3 + gPauseMap20Tex, + gPauseMap21Tex, + gPauseMap22Tex, + gPauseMap23Tex, + gPauseMap24Tex, +}; + +static void* sQuestPageBgQuadsJPNTexs[] = { + // column 1 + gPauseQuestStatus00JPNTex, + gPauseQuestStatus01Tex, + gPauseQuestStatus02Tex, + gPauseQuestStatus03Tex, + gPauseQuestStatus04Tex, + // column 2 + gPauseQuestStatus10JPNTex, + gPauseQuestStatus11Tex, + gPauseQuestStatus12Tex, + gPauseQuestStatus13Tex, + gPauseQuestStatus14Tex, + // column 3 + gPauseQuestStatus20JPNTex, + gPauseQuestStatus21Tex, + gPauseQuestStatus22Tex, + gPauseQuestStatus23Tex, + gPauseQuestStatus24Tex, +}; + +static void* sSavePromptBgQuadsJPNTexs[] = { + // column 1 + gPauseSave00Tex, + gPauseSave01Tex, + gPauseSave02Tex, + gPauseSave03Tex, + gPauseSave04Tex, + // column 2 + gPauseSave10JPNTex, + gPauseSave11Tex, + gPauseSave12Tex, + gPauseSave13Tex, + gPauseSave14Tex, + // column 3 + gPauseSave20Tex, + gPauseSave21Tex, + gPauseSave22Tex, + gPauseSave23Tex, + gPauseSave24Tex, +}; + #else -static void* sEquipmentFRATexs[] = { - gPauseEquipment00FRATex, gPauseEquipment01Tex, gPauseEquipment02Tex, gPauseEquipment03Tex, gPauseEquipment04Tex, - gPauseEquipment10FRATex, gPauseEquipment11Tex, gPauseEquipment12Tex, gPauseEquipment13Tex, gPauseEquipment14Tex, - gPauseEquipment20FRATex, gPauseEquipment21Tex, gPauseEquipment22Tex, gPauseEquipment23Tex, gPauseEquipment24Tex, -}; -static void* sSelectItemFRATexs[] = { - gPauseSelectItem00FRATex, gPauseSelectItem01Tex, gPauseSelectItem02Tex, gPauseSelectItem03Tex, - gPauseSelectItem04Tex, gPauseSelectItem10FRATex, gPauseSelectItem11Tex, gPauseSelectItem12Tex, - gPauseSelectItem13Tex, gPauseSelectItem14Tex, gPauseSelectItem20FRATex, gPauseSelectItem21Tex, - gPauseSelectItem22Tex, gPauseSelectItem23Tex, gPauseSelectItem24Tex, -}; -static void* sMapFRATexs[] = { - gPauseMap00Tex, gPauseMap01Tex, gPauseMap02Tex, gPauseMap03Tex, gPauseMap04Tex, - gPauseMap10FRATex, gPauseMap11Tex, gPauseMap12Tex, gPauseMap13Tex, gPauseMap14Tex, - gPauseMap20Tex, gPauseMap21Tex, gPauseMap22Tex, gPauseMap23Tex, gPauseMap24Tex, -}; -static void* sQuestStatusFRATexs[] = { - gPauseQuestStatus00Tex, gPauseQuestStatus01Tex, gPauseQuestStatus02Tex, gPauseQuestStatus03Tex, - gPauseQuestStatus04Tex, gPauseQuestStatus10FRATex, gPauseQuestStatus11Tex, gPauseQuestStatus12Tex, - gPauseQuestStatus13Tex, gPauseQuestStatus14Tex, gPauseQuestStatus20Tex, gPauseQuestStatus21Tex, - gPauseQuestStatus22Tex, gPauseQuestStatus23Tex, gPauseQuestStatus24Tex, -}; -static void* sSaveFRATexs[] = { - gPauseSave00FRATex, gPauseSave01Tex, gPauseSave02Tex, gPauseSave03Tex, gPauseSave04Tex, - gPauseSave10FRATex, gPauseSave11Tex, gPauseSave12Tex, gPauseSave13Tex, gPauseSave14Tex, - gPauseSave20FRATex, gPauseSave21Tex, gPauseSave22Tex, gPauseSave23Tex, gPauseSave24Tex, -}; - -static void* sEquipmentGERTexs[] = { - gPauseEquipment00GERTex, gPauseEquipment01Tex, gPauseEquipment02Tex, gPauseEquipment03Tex, gPauseEquipment04Tex, - gPauseEquipment10GERTex, gPauseEquipment11Tex, gPauseEquipment12Tex, gPauseEquipment13Tex, gPauseEquipment14Tex, - gPauseEquipment20GERTex, gPauseEquipment21Tex, gPauseEquipment22Tex, gPauseEquipment23Tex, gPauseEquipment24Tex, -}; -static void* sSelectItemGERTexs[] = { - gPauseSelectItem00GERTex, gPauseSelectItem01Tex, gPauseSelectItem02Tex, gPauseSelectItem03Tex, - gPauseSelectItem04Tex, gPauseSelectItem10GERTex, gPauseSelectItem11Tex, gPauseSelectItem12Tex, - gPauseSelectItem13Tex, gPauseSelectItem14Tex, gPauseSelectItem20GERTex, gPauseSelectItem21Tex, - gPauseSelectItem22Tex, gPauseSelectItem23Tex, gPauseSelectItem24Tex, -}; -static void* sMapGERTexs[] = { - gPauseMap00Tex, gPauseMap01Tex, gPauseMap02Tex, gPauseMap03Tex, gPauseMap04Tex, - gPauseMap10GERTex, gPauseMap11Tex, gPauseMap12Tex, gPauseMap13Tex, gPauseMap14Tex, - gPauseMap20Tex, gPauseMap21Tex, gPauseMap22Tex, gPauseMap23Tex, gPauseMap24Tex, -}; -static void* sQuestStatusGERTexs[] = { - gPauseQuestStatus00Tex, gPauseQuestStatus01Tex, gPauseQuestStatus02Tex, gPauseQuestStatus03Tex, - gPauseQuestStatus04Tex, gPauseQuestStatus10GERTex, gPauseQuestStatus11Tex, gPauseQuestStatus12Tex, - gPauseQuestStatus13Tex, gPauseQuestStatus14Tex, gPauseQuestStatus20Tex, gPauseQuestStatus21Tex, - gPauseQuestStatus22Tex, gPauseQuestStatus23Tex, gPauseQuestStatus24Tex, -}; -static void* sSaveGERTexs[] = { - gPauseSave00Tex, gPauseSave01Tex, gPauseSave02Tex, gPauseSave03Tex, gPauseSave04Tex, - gPauseSave10GERTex, gPauseSave11Tex, gPauseSave12Tex, gPauseSave13Tex, gPauseSave14Tex, - gPauseSave20GERTex, gPauseSave21Tex, gPauseSave22Tex, gPauseSave23Tex, gPauseSave24Tex, + +// French + +static void* sEquipPageBgQuadsFRATexs[] = { + // column 1 + gPauseEquipment00FRATex, + gPauseEquipment01Tex, + gPauseEquipment02Tex, + gPauseEquipment03Tex, + gPauseEquipment04Tex, + // column 2 + gPauseEquipment10FRATex, + gPauseEquipment11Tex, + gPauseEquipment12Tex, + gPauseEquipment13Tex, + gPauseEquipment14Tex, + // column 3 + gPauseEquipment20FRATex, + gPauseEquipment21Tex, + gPauseEquipment22Tex, + gPauseEquipment23Tex, + gPauseEquipment24Tex, +}; + +static void* sItemPageBgQuadsFRATexs[] = { + // column 1 + gPauseSelectItem00FRATex, + gPauseSelectItem01Tex, + gPauseSelectItem02Tex, + gPauseSelectItem03Tex, + gPauseSelectItem04Tex, + // column 2 + gPauseSelectItem10FRATex, + gPauseSelectItem11Tex, + gPauseSelectItem12Tex, + gPauseSelectItem13Tex, + gPauseSelectItem14Tex, + // column 3 + gPauseSelectItem20FRATex, + gPauseSelectItem21Tex, + gPauseSelectItem22Tex, + gPauseSelectItem23Tex, + gPauseSelectItem24Tex, +}; + +static void* sMapPageBgQuadsFRATexs[] = { + // column 1 + gPauseMap00Tex, + gPauseMap01Tex, + gPauseMap02Tex, + gPauseMap03Tex, + gPauseMap04Tex, + // column 2 + gPauseMap10FRATex, + gPauseMap11Tex, + gPauseMap12Tex, + gPauseMap13Tex, + gPauseMap14Tex, + // column 3 + gPauseMap20Tex, + gPauseMap21Tex, + gPauseMap22Tex, + gPauseMap23Tex, + gPauseMap24Tex, +}; + +static void* sQuestPageBgQuadsFRATexs[] = { + // column 1 + gPauseQuestStatus00Tex, + gPauseQuestStatus01Tex, + gPauseQuestStatus02Tex, + gPauseQuestStatus03Tex, + gPauseQuestStatus04Tex, + // column 2 + gPauseQuestStatus10FRATex, + gPauseQuestStatus11Tex, + gPauseQuestStatus12Tex, + gPauseQuestStatus13Tex, + gPauseQuestStatus14Tex, + // column 3 + gPauseQuestStatus20Tex, + gPauseQuestStatus21Tex, + gPauseQuestStatus22Tex, + gPauseQuestStatus23Tex, + gPauseQuestStatus24Tex, +}; + +static void* sSavePromptBgQuadsFRATexs[] = { + // column 1 + gPauseSave00FRATex, + gPauseSave01Tex, + gPauseSave02Tex, + gPauseSave03Tex, + gPauseSave04Tex, + // column 2 + gPauseSave10FRATex, + gPauseSave11Tex, + gPauseSave12Tex, + gPauseSave13Tex, + gPauseSave14Tex, + // column 3 + gPauseSave20FRATex, + gPauseSave21Tex, + gPauseSave22Tex, + gPauseSave23Tex, + gPauseSave24Tex, +}; + +// German + +static void* sEquipPageBgQuadsGERTexs[] = { + // column 1 + gPauseEquipment00GERTex, + gPauseEquipment01Tex, + gPauseEquipment02Tex, + gPauseEquipment03Tex, + gPauseEquipment04Tex, + // column 2 + gPauseEquipment10GERTex, + gPauseEquipment11Tex, + gPauseEquipment12Tex, + gPauseEquipment13Tex, + gPauseEquipment14Tex, + // column 3 + gPauseEquipment20GERTex, + gPauseEquipment21Tex, + gPauseEquipment22Tex, + gPauseEquipment23Tex, + gPauseEquipment24Tex, }; + +static void* sItemPageBgQuadsGERTexs[] = { + // column 1 + gPauseSelectItem00GERTex, + gPauseSelectItem01Tex, + gPauseSelectItem02Tex, + gPauseSelectItem03Tex, + gPauseSelectItem04Tex, + // column 2 + gPauseSelectItem10GERTex, + gPauseSelectItem11Tex, + gPauseSelectItem12Tex, + gPauseSelectItem13Tex, + gPauseSelectItem14Tex, + // column 3 + gPauseSelectItem20GERTex, + gPauseSelectItem21Tex, + gPauseSelectItem22Tex, + gPauseSelectItem23Tex, + gPauseSelectItem24Tex, +}; + +static void* sMapPageBgQuadsGERTexs[] = { + // column 1 + gPauseMap00Tex, + gPauseMap01Tex, + gPauseMap02Tex, + gPauseMap03Tex, + gPauseMap04Tex, + // column 2 + gPauseMap10GERTex, + gPauseMap11Tex, + gPauseMap12Tex, + gPauseMap13Tex, + gPauseMap14Tex, + // column 3 + gPauseMap20Tex, + gPauseMap21Tex, + gPauseMap22Tex, + gPauseMap23Tex, + gPauseMap24Tex, +}; + +static void* sQuestPageBgQuadsGERTexs[] = { + // column 1 + gPauseQuestStatus00Tex, + gPauseQuestStatus01Tex, + gPauseQuestStatus02Tex, + gPauseQuestStatus03Tex, + gPauseQuestStatus04Tex, + // column 2 + gPauseQuestStatus10GERTex, + gPauseQuestStatus11Tex, + gPauseQuestStatus12Tex, + gPauseQuestStatus13Tex, + gPauseQuestStatus14Tex, + // column 3 + gPauseQuestStatus20Tex, + gPauseQuestStatus21Tex, + gPauseQuestStatus22Tex, + gPauseQuestStatus23Tex, + gPauseQuestStatus24Tex, +}; + +static void* sSavePromptBgQuadsGERTexs[] = { + // column 1 + gPauseSave00Tex, + gPauseSave01Tex, + gPauseSave02Tex, + gPauseSave03Tex, + gPauseSave04Tex, + // column 2 + gPauseSave10GERTex, + gPauseSave11Tex, + gPauseSave12Tex, + gPauseSave13Tex, + gPauseSave14Tex, + // column 3 + gPauseSave20GERTex, + gPauseSave21Tex, + gPauseSave22Tex, + gPauseSave23Tex, + gPauseSave24Tex, +}; + #endif -static void* sEquipmentENGTexs[] = { - gPauseEquipment00Tex, gPauseEquipment01Tex, gPauseEquipment02Tex, gPauseEquipment03Tex, gPauseEquipment04Tex, - gPauseEquipment10ENGTex, gPauseEquipment11Tex, gPauseEquipment12Tex, gPauseEquipment13Tex, gPauseEquipment14Tex, - gPauseEquipment20Tex, gPauseEquipment21Tex, gPauseEquipment22Tex, gPauseEquipment23Tex, gPauseEquipment24Tex, +// English + +static void* sEquipPageBgQuadsENGTexs[] = { + // column 1 + gPauseEquipment00Tex, + gPauseEquipment01Tex, + gPauseEquipment02Tex, + gPauseEquipment03Tex, + gPauseEquipment04Tex, + // column 2 + gPauseEquipment10ENGTex, + gPauseEquipment11Tex, + gPauseEquipment12Tex, + gPauseEquipment13Tex, + gPauseEquipment14Tex, + // column 3 + gPauseEquipment20Tex, + gPauseEquipment21Tex, + gPauseEquipment22Tex, + gPauseEquipment23Tex, + gPauseEquipment24Tex, }; -static void* sSelectItemENGTexs[] = { - gPauseSelectItem00ENGTex, gPauseSelectItem01Tex, gPauseSelectItem02Tex, gPauseSelectItem03Tex, - gPauseSelectItem04Tex, gPauseSelectItem10ENGTex, gPauseSelectItem11Tex, gPauseSelectItem12Tex, - gPauseSelectItem13Tex, gPauseSelectItem14Tex, gPauseSelectItem20ENGTex, gPauseSelectItem21Tex, - gPauseSelectItem22Tex, gPauseSelectItem23Tex, gPauseSelectItem24Tex, + +static void* sItemPageBgQuadsENGTexs[] = { + // column 1 + gPauseSelectItem00ENGTex, + gPauseSelectItem01Tex, + gPauseSelectItem02Tex, + gPauseSelectItem03Tex, + gPauseSelectItem04Tex, + // column 2 + gPauseSelectItem10ENGTex, + gPauseSelectItem11Tex, + gPauseSelectItem12Tex, + gPauseSelectItem13Tex, + gPauseSelectItem14Tex, + // column 3 + gPauseSelectItem20ENGTex, + gPauseSelectItem21Tex, + gPauseSelectItem22Tex, + gPauseSelectItem23Tex, + gPauseSelectItem24Tex, }; -static void* sMapENGTexs[] = { - gPauseMap00Tex, gPauseMap01Tex, gPauseMap02Tex, gPauseMap03Tex, gPauseMap04Tex, - gPauseMap10ENGTex, gPauseMap11Tex, gPauseMap12Tex, gPauseMap13Tex, gPauseMap14Tex, - gPauseMap20Tex, gPauseMap21Tex, gPauseMap22Tex, gPauseMap23Tex, gPauseMap24Tex, + +static void* sMapPageBgQuadsENGTexs[] = { + // column 1 + gPauseMap00Tex, + gPauseMap01Tex, + gPauseMap02Tex, + gPauseMap03Tex, + gPauseMap04Tex, + // column 2 + gPauseMap10ENGTex, + gPauseMap11Tex, + gPauseMap12Tex, + gPauseMap13Tex, + gPauseMap14Tex, + // column 3 + gPauseMap20Tex, + gPauseMap21Tex, + gPauseMap22Tex, + gPauseMap23Tex, + gPauseMap24Tex, }; -static void* sQuestStatusENGTexs[] = { - gPauseQuestStatus00ENGTex, gPauseQuestStatus01Tex, gPauseQuestStatus02Tex, gPauseQuestStatus03Tex, - gPauseQuestStatus04Tex, gPauseQuestStatus10ENGTex, gPauseQuestStatus11Tex, gPauseQuestStatus12Tex, - gPauseQuestStatus13Tex, gPauseQuestStatus14Tex, gPauseQuestStatus20ENGTex, gPauseQuestStatus21Tex, - gPauseQuestStatus22Tex, gPauseQuestStatus23Tex, gPauseQuestStatus24Tex, + +static void* sQuestPageBgQuadsENGTexs[] = { + // column 1 + gPauseQuestStatus00ENGTex, + gPauseQuestStatus01Tex, + gPauseQuestStatus02Tex, + gPauseQuestStatus03Tex, + gPauseQuestStatus04Tex, + // column 2 + gPauseQuestStatus10ENGTex, + gPauseQuestStatus11Tex, + gPauseQuestStatus12Tex, + gPauseQuestStatus13Tex, + gPauseQuestStatus14Tex, + // column 3 + gPauseQuestStatus20ENGTex, + gPauseQuestStatus21Tex, + gPauseQuestStatus22Tex, + gPauseQuestStatus23Tex, + gPauseQuestStatus24Tex, }; -static void* sSaveENGTexs[] = { - gPauseSave00Tex, gPauseSave01Tex, gPauseSave02Tex, gPauseSave03Tex, gPauseSave04Tex, - gPauseSave10ENGTex, gPauseSave11Tex, gPauseSave12Tex, gPauseSave13Tex, gPauseSave14Tex, - gPauseSave20Tex, gPauseSave21Tex, gPauseSave22Tex, gPauseSave23Tex, gPauseSave24Tex, + +static void* sSavePromptBgQuadsENGTexs[] = { + // column 1 + gPauseSave00Tex, + gPauseSave01Tex, + gPauseSave02Tex, + gPauseSave03Tex, + gPauseSave04Tex, + // column 2 + gPauseSave10ENGTex, + gPauseSave11Tex, + gPauseSave12Tex, + gPauseSave13Tex, + gPauseSave14Tex, + // column 3 + gPauseSave20Tex, + gPauseSave21Tex, + gPauseSave22Tex, + gPauseSave23Tex, + gPauseSave24Tex, }; static void* sGameOverTexs[] = { - gPauseSave00Tex, gPauseSave01Tex, gPauseSave02Tex, gPauseSave03Tex, gPauseSave04Tex, - gPauseGameOver10Tex, gPauseSave11Tex, gPauseSave12Tex, gPauseSave13Tex, gPauseSave14Tex, - gPauseSave20Tex, gPauseSave21Tex, gPauseSave22Tex, gPauseSave23Tex, gPauseSave24Tex, + // column 1 + gPauseSave00Tex, + gPauseSave01Tex, + gPauseSave02Tex, + gPauseSave03Tex, + gPauseSave04Tex, + // column 2 + gPauseGameOver10Tex, + gPauseSave11Tex, + gPauseSave12Tex, + gPauseSave13Tex, + gPauseSave14Tex, + // column 3 + gPauseSave20Tex, + gPauseSave21Tex, + gPauseSave22Tex, + gPauseSave23Tex, + gPauseSave24Tex, +}; + +#if OOT_NTSC +#define EQUIPMENT_TEXS(language) ((language) != LANGUAGE_JPN ? sEquipPageBgQuadsENGTexs : sEquipPageBgQuadsJPNTexs) +#define SELECT_ITEM_TEXS(language) ((language) != LANGUAGE_JPN ? sItemPageBgQuadsENGTexs : sItemPageBgQuadsJPNTexs) +#define MAP_TEXS(language) ((language) != LANGUAGE_JPN ? sMapPageBgQuadsENGTexs : sMapPageBgQuadsJPNTexs) +#define QUEST_STATUS_TEXS(language) ((language) != LANGUAGE_JPN ? sQuestPageBgQuadsENGTexs : sQuestPageBgQuadsJPNTexs) +#define SAVE_TEXS(language) ((language) != LANGUAGE_JPN ? sSavePromptBgQuadsENGTexs : sSavePromptBgQuadsJPNTexs) +#else +static void* sEquipPageBgQuadsTexs[] = { + sEquipPageBgQuadsENGTexs, + sEquipPageBgQuadsGERTexs, + sEquipPageBgQuadsFRATexs, }; -static void* sEquipmentTexs[] = - LANGUAGE_ARRAY(sEquipmentJPNTexs, sEquipmentENGTexs, sEquipmentGERTexs, sEquipmentFRATexs); +static void* sItemPageBgQuadsTexs[] = { + sItemPageBgQuadsENGTexs, + sItemPageBgQuadsGERTexs, + sItemPageBgQuadsFRATexs, +}; -static void* sSelectItemTexs[] = - LANGUAGE_ARRAY(sSelectItemJPNTexs, sSelectItemENGTexs, sSelectItemGERTexs, sSelectItemFRATexs); +static void* sMapPageBgQuadsTexs[] = { + sMapPageBgQuadsENGTexs, + sMapPageBgQuadsGERTexs, + sMapPageBgQuadsFRATexs, +}; -static void* sMapTexs[] = LANGUAGE_ARRAY(sMapJPNTexs, sMapENGTexs, sMapGERTexs, sMapFRATexs); +static void* sQuestPageBgQuadsTexs[] = { + sQuestPageBgQuadsENGTexs, + sQuestPageBgQuadsGERTexs, + sQuestPageBgQuadsFRATexs, +}; -static void* sQuestStatusTexs[] = - LANGUAGE_ARRAY(sQuestStatusJPNTexs, sQuestStatusENGTexs, sQuestStatusGERTexs, sQuestStatusFRATexs); +static void* sSavePromptBgQuadsTexs[] = { + sSavePromptBgQuadsENGTexs, + sSavePromptBgQuadsGERTexs, + sSavePromptBgQuadsFRATexs, +}; -static void* sSaveTexs[] = LANGUAGE_ARRAY(sSaveJPNTexs, sSaveENGTexs, sSaveGERTexs, sSaveFRATexs); +#define EQUIPMENT_TEXS(language) (sEquipPageBgQuadsTexs[(language)]) +#define SELECT_ITEM_TEXS(language) (sItemPageBgQuadsTexs[(language)]) +#define MAP_TEXS(language) (sMapPageBgQuadsTexs[(language)]) +#define QUEST_STATUS_TEXS(language) (sQuestPageBgQuadsTexs[(language)]) +#define SAVE_TEXS(language) (sSavePromptBgQuadsTexs[(language)]) +#endif -s16 D_8082AAEC[] = { - 32, 112, 32, 48, 32, 32, 32, 48, 32, 64, 32, 48, 48, 48, 48, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 80, 64, +s16 gVtxPageMapWorldQuadsWidth[VTX_PAGE_MAP_WORLD_QUADS] = { + 32, // WORLD_MAP_QUAD_CLOUDS_SACRED_FOREST_MEADOW + 112, // WORLD_MAP_QUAD_CLOUDS_HYRULE_FIELD + 32, // WORLD_MAP_QUAD_CLOUDS_LON_LON_RANCH + 48, // WORLD_MAP_QUAD_CLOUDS_MARKET + 32, // WORLD_MAP_QUAD_CLOUDS_HYRULE_CASTLE + 32, // WORLD_MAP_QUAD_CLOUDS_KAKARIKO_VILLAGE + 32, // WORLD_MAP_QUAD_CLOUDS_GRAVEYARD + 48, // WORLD_MAP_QUAD_CLOUDS_DEATH_MOUNTAIN_TRAIL + 32, // WORLD_MAP_QUAD_CLOUDS_GORON_CITY + 64, // WORLD_MAP_QUAD_CLOUDS_ZORAS_RIVER + 32, // WORLD_MAP_QUAD_CLOUDS_ZORAS_DOMAIN + 48, // WORLD_MAP_QUAD_CLOUDS_ZORAS_FOUNTAIN + 48, // WORLD_MAP_QUAD_CLOUDS_GERUDO_VALLEY + 48, // WORLD_MAP_QUAD_CLOUDS_GERUDOS_FORTRESS + 48, // WORLD_MAP_QUAD_CLOUDS_DESERT_COLOSSUS + 64, // WORLD_MAP_QUAD_CLOUDS_LAKE_HYLIA + 8, // WORLD_MAP_POINT_HAUNTED_WASTELAND + 8, // WORLD_MAP_POINT_GERUDOS_FORTRESS + 8, // WORLD_MAP_POINT_GERUDO_VALLEY + 8, // WORLD_MAP_POINT_LAKE_HYLIA + 8, // WORLD_MAP_POINT_LON_LON_RANCH + 8, // WORLD_MAP_POINT_MARKET + 8, // WORLD_MAP_POINT_HYRULE_FIELD + 8, // WORLD_MAP_POINT_DEATH_MOUNTAIN + 8, // WORLD_MAP_POINT_KAKARIKO_VILLAGE + 8, // WORLD_MAP_POINT_LOST_WOODS + 8, // WORLD_MAP_POINT_KOKIRI_FOREST + 8, // WORLD_MAP_POINT_ZORAS_DOMAIN + 8, // WORLD_MAP_QUAD_28 + 8, // WORLD_MAP_QUAD_TRADE_QUEST_MARKER + 80, // WORLD_MAP_QUAD_30 + 64, // WORLD_MAP_QUAD_31 }; -s16 D_8082AB2C[] = { - 24, 72, 13, 22, 19, 20, 19, 27, 14, 26, 22, 21, 49, 32, 45, 60, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 16, 32, 8, +s16 gVtxPageMapWorldQuadsHeight[VTX_PAGE_MAP_WORLD_QUADS] = { + 24, // WORLD_MAP_QUAD_CLOUDS_SACRED_FOREST_MEADOW + 72, // WORLD_MAP_QUAD_CLOUDS_HYRULE_FIELD + 13, // WORLD_MAP_QUAD_CLOUDS_LON_LON_RANCH + 22, // WORLD_MAP_QUAD_CLOUDS_MARKET + 19, // WORLD_MAP_QUAD_CLOUDS_HYRULE_CASTLE + 20, // WORLD_MAP_QUAD_CLOUDS_KAKARIKO_VILLAGE + 19, // WORLD_MAP_QUAD_CLOUDS_GRAVEYARD + 27, // WORLD_MAP_QUAD_CLOUDS_DEATH_MOUNTAIN_TRAIL + 14, // WORLD_MAP_QUAD_CLOUDS_GORON_CITY + 26, // WORLD_MAP_QUAD_CLOUDS_ZORAS_RIVER + 22, // WORLD_MAP_QUAD_CLOUDS_ZORAS_DOMAIN + 21, // WORLD_MAP_QUAD_CLOUDS_ZORAS_FOUNTAIN + 49, // WORLD_MAP_QUAD_CLOUDS_GERUDO_VALLEY + 32, // WORLD_MAP_QUAD_CLOUDS_GERUDOS_FORTRESS + 45, // WORLD_MAP_QUAD_CLOUDS_DESERT_COLOSSUS + 60, // WORLD_MAP_QUAD_CLOUDS_LAKE_HYLIA + 8, // WORLD_MAP_POINT_HAUNTED_WASTELAND + 8, // WORLD_MAP_POINT_GERUDOS_FORTRESS + 8, // WORLD_MAP_POINT_GERUDO_VALLEY + 8, // WORLD_MAP_POINT_LAKE_HYLIA + 8, // WORLD_MAP_POINT_LON_LON_RANCH + 8, // WORLD_MAP_POINT_MARKET + 8, // WORLD_MAP_POINT_HYRULE_FIELD + 8, // WORLD_MAP_POINT_DEATH_MOUNTAIN + 8, // WORLD_MAP_POINT_KAKARIKO_VILLAGE + 8, // WORLD_MAP_POINT_LOST_WOODS + 8, // WORLD_MAP_POINT_KOKIRI_FOREST + 8, // WORLD_MAP_POINT_ZORAS_DOMAIN + 8, // WORLD_MAP_QUAD_28 + 16, // WORLD_MAP_QUAD_TRADE_QUEST_MARKER + 32, // WORLD_MAP_QUAD_30 + 8, // WORLD_MAP_QUAD_31 }; /** @@ -400,23 +870,19 @@ u8 gAreaGsFlags[] = { }; static void* sCursorTexs[] = { - gPauseMenuCursorTopLeftTex, - gPauseMenuCursorTopRightTex, - gPauseMenuCursorBottomLeftTex, - gPauseMenuCursorBottomRightTex, + gPauseMenuCursorTopLeftTex, // PAUSE_CURSOR_QUAD_TL + gPauseMenuCursorTopRightTex, // PAUSE_CURSOR_QUAD_TR + gPauseMenuCursorBottomLeftTex, // PAUSE_CURSOR_QUAD_BL + gPauseMenuCursorBottomRightTex, // PAUSE_CURSOR_QUAD_BR }; static s16 sCursorColors[][3] = { { 255, 255, 255 }, { 255, 255, 0 }, -#if N64_BTN_COLORS - { 0, 50, 255 }, -#else - { 0, 255, 50 }, -#endif + { KALEIDO_COLOR_CURSOR_UNK_R, KALEIDO_COLOR_CURSOR_UNK_G, KALEIDO_COLOR_CURSOR_UNK_B }, }; -static void* sSavePromptTexs[] = +static void* sSavePromptMessageTexs[] = LANGUAGE_ARRAY(gPauseSavePromptJPNTex, gPauseSavePromptENGTex, gPauseSavePromptGERTex, gPauseSavePromptFRATex); static void* sSaveConfirmationTexs[] = LANGUAGE_ARRAY(gPauseSaveConfirmationJPNTex, gPauseSaveConfirmationENGTex, @@ -594,6 +1060,9 @@ void KaleidoScope_SetupPageSwitch(PauseContext* pauseCtx, u8 pt) { pauseCtx->cursorSpecialPos = PAUSE_CURSOR_PAGE_LEFT; } +#if PLATFORM_N64 || OOT_NTSC + gSaveContext.buttonStatus[0] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + pt][0]; +#endif gSaveContext.buttonStatus[1] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + pt][1]; gSaveContext.buttonStatus[2] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + pt][2]; gSaveContext.buttonStatus[3] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + pt][3]; @@ -648,16 +1117,19 @@ void KaleidoScope_DrawCursor(PlayState* play, u16 pageIndex) { OPEN_DISPS(play->state.gfxCtx, "../z_kaleido_scope_PAL.c", 955); - if (((((u32)pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || (pauseCtx->mainState == PAUSE_MAIN_STATE_8)) && + if (((((u32)pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) && (pauseCtx->state == PAUSE_STATE_MAIN)) || ((pauseCtx->pageIndex == PAUSE_QUEST) && - ((pauseCtx->mainState < PAUSE_MAIN_STATE_3) || (pauseCtx->mainState == PAUSE_MAIN_STATE_5) || - (pauseCtx->mainState == PAUSE_MAIN_STATE_8)))) { + ((pauseCtx->mainState < PAUSE_MAIN_STATE_3) || (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)))) { s16 i; s16 j; if (pauseCtx->pageIndex == pageIndex) { + // Draw PAUSE_CURSOR_QUAD_TL, PAUSE_CURSOR_QUAD_TR, PAUSE_CURSOR_QUAD_BL, PAUSE_CURSOR_QUAD_BR + gDPPipeSync(POLY_OPA_DISP++); gDPSetCombineLERP(POLY_OPA_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); @@ -682,6 +1154,7 @@ void KaleidoScope_DrawCursor(PlayState* play, u16 pageIndex) { CLOSE_DISPS(play->state.gfxCtx, "../z_kaleido_scope_PAL.c", 985); } +// Draw 15 (PAGE_BG_QUADS) quads with IA8 80x32 textures Gfx* KaleidoScope_DrawPageSections(Gfx* gfx, Vtx* vertices, void** textures) { s32 i; s32 j; @@ -689,11 +1162,13 @@ Gfx* KaleidoScope_DrawPageSections(Gfx* gfx, Vtx* vertices, void** textures) { gSPVertex(gfx++, vertices, 32, 0); i = 0; + j = 0; while (j < 32) { gDPPipeSync(gfx++); - gDPLoadTextureBlock(gfx++, textures[i], G_IM_FMT_IA, G_IM_SIZ_8b, 80, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(gfx++, textures[i], G_IM_FMT_IA, G_IM_SIZ_8b, PAGE_BG_QUAD_TEX_WIDTH, + PAGE_BG_QUAD_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(gfx++, j, j + 2, j + 3, j + 1, 0); j += 4; @@ -705,8 +1180,9 @@ Gfx* KaleidoScope_DrawPageSections(Gfx* gfx, Vtx* vertices, void** textures) { j = 0; while (j < 28) { gDPPipeSync(gfx++); - gDPLoadTextureBlock(gfx++, textures[i], G_IM_FMT_IA, G_IM_SIZ_8b, 80, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(gfx++, textures[i], G_IM_FMT_IA, G_IM_SIZ_8b, PAGE_BG_QUAD_TEX_WIDTH, + PAGE_BG_QUAD_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(gfx++, j, j + 2, j + 3, j + 1, 0); j += 4; @@ -724,8 +1200,18 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { }; #else static s16 D_8082ACF4[][3] = { - { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 255, 255, 0 }, { 0, 0, 0 }, - { 0, 0, 0 }, { 255, 255, 0 }, { 0, 255, 50 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 255, 50 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 255, 255, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 255, 255, 0 }, + { KALEIDO_COLOR_CURSOR_UNK_R, KALEIDO_COLOR_CURSOR_UNK_G, KALEIDO_COLOR_CURSOR_UNK_B }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { KALEIDO_COLOR_CURSOR_UNK_R, KALEIDO_COLOR_CURSOR_UNK_G, KALEIDO_COLOR_CURSOR_UNK_B }, }; #endif static s16 D_8082AD3C = 20; @@ -739,12 +1225,6 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { s16 stepG; s16 stepB; - Color_RGB8 color = { 100, 255, 100 }; - if (N64_BTN_COLORS) { - color.g = 100; - color.b = 255; - } - OPEN_DISPS(gfxCtx, "../z_kaleido_scope_PAL.c", 1100); if (!IS_PAUSE_STATE_GAMEOVER(pauseCtx)) { @@ -837,19 +1317,21 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { } } + // Draw non-active pages (not the one being looked at) + if (pauseCtx->pageIndex) { // pageIndex != PAUSE_ITEM gDPPipeSync(POLY_OPA_DISP++); gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA); - Matrix_Translate(0.0f, (f32)WREG(2) / 100.0f, -(f32)WREG(3) / 100.0f, MTXMODE_NEW); + Matrix_Translate(0.0f, (f32)R_PAUSE_PAGES_Y_ORIGIN_2 / 100.0f, -(f32)R_PAUSE_DEPTH_OFFSET / 100.0f, + MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); - Matrix_RotateX(-pauseCtx->unk_1F4 / 100.0f, MTXMODE_APPLY); + Matrix_RotateX(-pauseCtx->itemPagePitch / 100.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_kaleido_scope_PAL.c", 1173), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_kaleido_scope_PAL.c", 1173); POLY_OPA_DISP = KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->itemPageVtx, - sSelectItemTexs[gSaveContext.language]); + SELECT_ITEM_TEXS(gSaveContext.language)); KaleidoScope_DrawItemSelect(play); } @@ -858,16 +1340,16 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { gDPPipeSync(POLY_OPA_DISP++); gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA); - Matrix_Translate(-(f32)WREG(3) / 100.0f, (f32)WREG(2) / 100.0f, 0.0f, MTXMODE_NEW); + Matrix_Translate(-(f32)R_PAUSE_DEPTH_OFFSET / 100.0f, (f32)R_PAUSE_PAGES_Y_ORIGIN_2 / 100.0f, 0.0f, + MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); - Matrix_RotateZ(pauseCtx->unk_1F8 / 100.0f, MTXMODE_APPLY); + Matrix_RotateZ(pauseCtx->equipPagePitch / 100.0f, MTXMODE_APPLY); Matrix_RotateY(1.57f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_kaleido_scope_PAL.c", 1196), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_kaleido_scope_PAL.c", 1196); POLY_OPA_DISP = KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->equipPageVtx, - sEquipmentTexs[gSaveContext.language]); + EQUIPMENT_TEXS(gSaveContext.language)); KaleidoScope_DrawEquipment(play); } @@ -877,16 +1359,16 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { gDPSetTextureFilter(POLY_OPA_DISP++, G_TF_BILERP); gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA); - Matrix_Translate(0.0f, (f32)WREG(2) / 100.0f, (f32)WREG(3) / 100.0f, MTXMODE_NEW); + Matrix_Translate(0.0f, (f32)R_PAUSE_PAGES_Y_ORIGIN_2 / 100.0f, (f32)R_PAUSE_DEPTH_OFFSET / 100.0f, + MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); - Matrix_RotateX(pauseCtx->unk_200 / 100.0f, MTXMODE_APPLY); + Matrix_RotateX(pauseCtx->questPagePitch / 100.0f, MTXMODE_APPLY); Matrix_RotateY(3.14f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_kaleido_scope_PAL.c", 1220), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_kaleido_scope_PAL.c", 1220); POLY_OPA_DISP = KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->questPageVtx, - sQuestStatusTexs[gSaveContext.language]); + QUEST_STATUS_TEXS(gSaveContext.language)); KaleidoScope_DrawQuestStatus(play, gfxCtx); } @@ -896,16 +1378,16 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA); - Matrix_Translate((f32)WREG(3) / 100.0f, (f32)WREG(2) / 100.0f, 0.0f, MTXMODE_NEW); + Matrix_Translate((f32)R_PAUSE_DEPTH_OFFSET / 100.0f, (f32)R_PAUSE_PAGES_Y_ORIGIN_2 / 100.0f, 0.0f, + MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); - Matrix_RotateZ(-pauseCtx->unk_1FC / 100.0f, MTXMODE_APPLY); + Matrix_RotateZ(-pauseCtx->mapPagePitch / 100.0f, MTXMODE_APPLY); Matrix_RotateY(-1.57f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_kaleido_scope_PAL.c", 1243), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_kaleido_scope_PAL.c", 1243); POLY_OPA_DISP = - KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->mapPageVtx, sMapTexs[gSaveContext.language]); + KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->mapPageVtx, MAP_TEXS(gSaveContext.language)); if (sInDungeonScene) { KaleidoScope_DrawDungeonMap(play, gfxCtx); @@ -921,35 +1403,37 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { } } + // Update and draw the active page being looked at + gDPPipeSync(POLY_OPA_DISP++); gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA); switch (pauseCtx->pageIndex) { case PAUSE_ITEM: - Matrix_Translate(0.0f, (f32)WREG(2) / 100.0f, -(f32)WREG(3) / 100.0f, MTXMODE_NEW); + Matrix_Translate(0.0f, (f32)R_PAUSE_PAGES_Y_ORIGIN_2 / 100.0f, -(f32)R_PAUSE_DEPTH_OFFSET / 100.0f, + MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); - Matrix_RotateX(-pauseCtx->unk_1F4 / 100.0f, MTXMODE_APPLY); + Matrix_RotateX(-pauseCtx->itemPagePitch / 100.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_kaleido_scope_PAL.c", 1281), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_kaleido_scope_PAL.c", 1281); POLY_OPA_DISP = KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->itemPageVtx, - sSelectItemTexs[gSaveContext.language]); + SELECT_ITEM_TEXS(gSaveContext.language)); KaleidoScope_DrawItemSelect(play); break; case PAUSE_MAP: - Matrix_Translate((f32)WREG(3) / 100.0f, (f32)WREG(2) / 100.0f, 0.0f, MTXMODE_NEW); + Matrix_Translate((f32)R_PAUSE_DEPTH_OFFSET / 100.0f, (f32)R_PAUSE_PAGES_Y_ORIGIN_2 / 100.0f, 0.0f, + MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); - Matrix_RotateZ(-pauseCtx->unk_1FC / 100.0f, MTXMODE_APPLY); + Matrix_RotateZ(-pauseCtx->mapPagePitch / 100.0f, MTXMODE_APPLY); Matrix_RotateY(-1.57f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_kaleido_scope_PAL.c", 1303), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_kaleido_scope_PAL.c", 1303); POLY_OPA_DISP = - KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->mapPageVtx, sMapTexs[gSaveContext.language]); + KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->mapPageVtx, MAP_TEXS(gSaveContext.language)); if (sInDungeonScene) { KaleidoScope_DrawDungeonMap(play, gfxCtx); @@ -972,16 +1456,16 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { case PAUSE_QUEST: gDPSetTextureFilter(POLY_OPA_DISP++, G_TF_BILERP); - Matrix_Translate(0.0f, (f32)WREG(2) / 100.0f, (f32)WREG(3) / 100.0f, MTXMODE_NEW); + Matrix_Translate(0.0f, (f32)R_PAUSE_PAGES_Y_ORIGIN_2 / 100.0f, (f32)R_PAUSE_DEPTH_OFFSET / 100.0f, + MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); - Matrix_RotateX(pauseCtx->unk_200 / 100.0f, MTXMODE_APPLY); + Matrix_RotateX(pauseCtx->questPagePitch / 100.0f, MTXMODE_APPLY); Matrix_RotateY(3.14f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_kaleido_scope_PAL.c", 1343), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_kaleido_scope_PAL.c", 1343); POLY_OPA_DISP = KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->questPageVtx, - sQuestStatusTexs[gSaveContext.language]); + QUEST_STATUS_TEXS(gSaveContext.language)); KaleidoScope_DrawQuestStatus(play, gfxCtx); @@ -991,16 +1475,16 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { break; case PAUSE_EQUIP: - Matrix_Translate(-(f32)WREG(3) / 100.0f, (f32)WREG(2) / 100.0f, 0.0f, MTXMODE_NEW); + Matrix_Translate(-(f32)R_PAUSE_DEPTH_OFFSET / 100.0f, (f32)R_PAUSE_PAGES_Y_ORIGIN_2 / 100.0f, 0.0f, + MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); - Matrix_RotateZ(pauseCtx->unk_1F8 / 100.0f, MTXMODE_APPLY); + Matrix_RotateZ(pauseCtx->equipPagePitch / 100.0f, MTXMODE_APPLY); Matrix_RotateY(1.57f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_kaleido_scope_PAL.c", 1367), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_kaleido_scope_PAL.c", 1367); POLY_OPA_DISP = KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->equipPageVtx, - sEquipmentTexs[gSaveContext.language]); + EQUIPMENT_TEXS(gSaveContext.language)); KaleidoScope_DrawEquipment(play); @@ -1011,6 +1495,8 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { } } + // Update and draw prompt (save or gameover) + Gfx_SetupDL_42Opa(gfxCtx); if ((pauseCtx->state == PAUSE_STATE_SAVE_PROMPT) || IS_PAUSE_STATE_GAMEOVER(pauseCtx)) { @@ -1019,58 +1505,66 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA); if ((u32)pauseCtx->pageIndex == PAUSE_ITEM) { - pauseCtx->unk_1F4 = pauseCtx->unk_204 + 314.0f; + pauseCtx->itemPagePitch = pauseCtx->promptPitch + 314.0f; - Matrix_Translate(0.0f, (f32)WREG(2) / 100.0f, -pauseCtx->unk_1F0 / 10.0f, MTXMODE_NEW); + Matrix_Translate(0.0f, (f32)R_PAUSE_PAGES_Y_ORIGIN_2 / 100.0f, -pauseCtx->promptDepthOffset / 10.0f, + MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); - Matrix_RotateX(-pauseCtx->unk_204 / 100.0f, MTXMODE_APPLY); + Matrix_RotateX(-pauseCtx->promptPitch / 100.0f, MTXMODE_APPLY); } else if (pauseCtx->pageIndex == PAUSE_MAP) { - pauseCtx->unk_1FC = pauseCtx->unk_204 + 314.0f; + pauseCtx->mapPagePitch = pauseCtx->promptPitch + 314.0f; - Matrix_Translate(pauseCtx->unk_1F0 / 10.0f, (f32)WREG(2) / 100.0f, 0.0f, MTXMODE_NEW); + Matrix_Translate(pauseCtx->promptDepthOffset / 10.0f, (f32)R_PAUSE_PAGES_Y_ORIGIN_2 / 100.0f, 0.0f, + MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); - Matrix_RotateZ(-pauseCtx->unk_204 / 100.0f, MTXMODE_APPLY); + Matrix_RotateZ(-pauseCtx->promptPitch / 100.0f, MTXMODE_APPLY); Matrix_RotateY(-1.57f, MTXMODE_APPLY); } else if (pauseCtx->pageIndex == PAUSE_QUEST) { - pauseCtx->unk_200 = pauseCtx->unk_204 + 314.0f; + pauseCtx->questPagePitch = pauseCtx->promptPitch + 314.0f; - Matrix_Translate(0.0f, (f32)WREG(2) / 100.0f, pauseCtx->unk_1F0 / 10.0f, MTXMODE_NEW); + Matrix_Translate(0.0f, (f32)R_PAUSE_PAGES_Y_ORIGIN_2 / 100.0f, pauseCtx->promptDepthOffset / 10.0f, + MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); - Matrix_RotateX(pauseCtx->unk_204 / 100.0f, MTXMODE_APPLY); + Matrix_RotateX(pauseCtx->promptPitch / 100.0f, MTXMODE_APPLY); Matrix_RotateY(3.14f, MTXMODE_APPLY); } else { - pauseCtx->unk_1F8 = pauseCtx->unk_204 + 314.0f; + pauseCtx->equipPagePitch = pauseCtx->promptPitch + 314.0f; - Matrix_Translate(-pauseCtx->unk_1F0 / 10.0f, (f32)WREG(2) / 100.0f, 0.0f, MTXMODE_NEW); + Matrix_Translate(-pauseCtx->promptDepthOffset / 10.0f, (f32)R_PAUSE_PAGES_Y_ORIGIN_2 / 100.0f, 0.0f, + MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); - Matrix_RotateZ(pauseCtx->unk_204 / 100.0f, MTXMODE_APPLY); + Matrix_RotateZ(pauseCtx->promptPitch / 100.0f, MTXMODE_APPLY); Matrix_RotateY(1.57f, MTXMODE_APPLY); } - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(gfxCtx, "../z_kaleido_scope_PAL.c", 1424), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gfxCtx, "../z_kaleido_scope_PAL.c", 1424); if (IS_PAUSE_STATE_GAMEOVER(pauseCtx)) { - POLY_OPA_DISP = KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->saveVtx, sGameOverTexs); + POLY_OPA_DISP = KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->promptPageVtx, sGameOverTexs); } else { // PAUSE_STATE_SAVE_PROMPT POLY_OPA_DISP = - KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->saveVtx, sSaveTexs[gSaveContext.language]); + KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->promptPageVtx, SAVE_TEXS(gSaveContext.language)); } - gSPVertex(POLY_OPA_DISP++, &pauseCtx->saveVtx[60], 32, 0); + //! @bug Loads 32 vertices, but there are only 20 to load + gSPVertex(POLY_OPA_DISP++, &pauseCtx->promptPageVtx[PAGE_BG_QUADS * 4], 32, 0); - if (((pauseCtx->state == PAUSE_STATE_SAVE_PROMPT) && (pauseCtx->unk_1EC < 4)) || + if (((pauseCtx->state == PAUSE_STATE_SAVE_PROMPT) && + (pauseCtx->savePromptState < PAUSE_SAVE_PROMPT_STATE_SAVED)) || (pauseCtx->state == PAUSE_STATE_14)) { - POLY_OPA_DISP = - KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sSavePromptTexs[gSaveContext.language], 152, 16, 0); + POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sSavePromptMessageTexs[gSaveContext.language], + 152, 16, PROMPT_QUAD_MESSAGE * 4); gDPSetCombineLERP(POLY_OPA_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0); - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, color.r, color.g, color.b, VREG(61)); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, KALEIDO_PROMPT_CURSOR_R, KALEIDO_PROMPT_CURSOR_G, + KALEIDO_PROMPT_CURSOR_B, R_KALEIDO_PROMPT_CURSOR_ALPHA); if (pauseCtx->promptChoice == 0) { + // PROMPT_QUAD_CURSOR_LEFT gSPDisplayList(POLY_OPA_DISP++, gPromptCursorLeftDL); } else { + // PROMPT_QUAD_CURSOR_RIGHT gSPDisplayList(POLY_OPA_DISP++, gPromptCursorRightDL); } @@ -1078,37 +1572,44 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); - POLY_OPA_DISP = - KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sPromptChoiceTexs[gSaveContext.language][0], 48, 16, 12); - - POLY_OPA_DISP = - KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sPromptChoiceTexs[gSaveContext.language][1], 48, 16, 16); - } else if ((pauseCtx->state != PAUSE_STATE_SAVE_PROMPT) || (pauseCtx->unk_1EC < 4)) { - if ((pauseCtx->state != PAUSE_STATE_15) && - ((pauseCtx->state == PAUSE_STATE_16) || (pauseCtx->state == PAUSE_STATE_17))) { - POLY_OPA_DISP = - KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sContinuePromptTexs[gSaveContext.language], 152, 16, 0); + POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sPromptChoiceTexs[gSaveContext.language][0], 48, + 16, PROMPT_QUAD_CHOICE_YES * 4); + + POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sPromptChoiceTexs[gSaveContext.language][1], 48, + 16, PROMPT_QUAD_CHOICE_NO * 4); + } else if (((pauseCtx->state == PAUSE_STATE_SAVE_PROMPT) && + (pauseCtx->savePromptState >= PAUSE_SAVE_PROMPT_STATE_SAVED)) || + pauseCtx->state == PAUSE_STATE_15) { +#if PLATFORM_N64 + POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sSaveConfirmationTexs[gSaveContext.language], + 152, 16, PROMPT_QUAD_MESSAGE * 4); +#endif + } else if (((pauseCtx->state == PAUSE_STATE_16) || (pauseCtx->state == PAUSE_STATE_17))) { + POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sContinuePromptTexs[gSaveContext.language], 152, + 16, PROMPT_QUAD_MESSAGE * 4); - gDPSetCombineLERP(POLY_OPA_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0, - TEXEL0, 0, PRIMITIVE, 0); - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, color.r, color.g, color.b, VREG(61)); + gDPSetCombineLERP(POLY_OPA_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0, TEXEL0, + 0, PRIMITIVE, 0); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, KALEIDO_PROMPT_CURSOR_R, KALEIDO_PROMPT_CURSOR_G, + KALEIDO_PROMPT_CURSOR_B, R_KALEIDO_PROMPT_CURSOR_ALPHA); - if (pauseCtx->promptChoice == 0) { - gSPDisplayList(POLY_OPA_DISP++, gPromptCursorLeftDL); - } else { - gSPDisplayList(POLY_OPA_DISP++, gPromptCursorRightDL); - } + if (pauseCtx->promptChoice == 0) { + // PROMPT_QUAD_CURSOR_LEFT + gSPDisplayList(POLY_OPA_DISP++, gPromptCursorLeftDL); + } else { + // PROMPT_QUAD_CURSOR_RIGHT + gSPDisplayList(POLY_OPA_DISP++, gPromptCursorRightDL); + } - gDPPipeSync(POLY_OPA_DISP++); - gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA); - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); + gDPPipeSync(POLY_OPA_DISP++); + gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); - POLY_OPA_DISP = - KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sPromptChoiceTexs[gSaveContext.language][0], 48, 16, 12); + POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sPromptChoiceTexs[gSaveContext.language][0], 48, + 16, PROMPT_QUAD_CHOICE_YES * 4); - POLY_OPA_DISP = - KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sPromptChoiceTexs[gSaveContext.language][1], 48, 16, 16); - } + POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sPromptChoiceTexs[gSaveContext.language][1], 48, + 16, PROMPT_QUAD_CHOICE_NO * 4); } gDPPipeSync(POLY_OPA_DISP++); @@ -1149,9 +1650,9 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { LANGUAGE_ARRAY(gPauseToSelectItemJPNTex, gPauseToSelectItemENGTex, gPauseToSelectItemGERTex, gPauseToSelectItemFRATex), }; - static u16 D_8082ADD8[3] = { 56, 88, 80 }; - static u16 D_8082ADE0[3] = { 64, 88, 72 }; - static u16 D_8082ADE8[3] = { 80, 104, 112 }; + static u16 D_8082ADD8[] = LANGUAGE_ARRAY(56, 56, 88, 80); + static u16 D_8082ADE0[] = LANGUAGE_ARRAY(48, 64, 88, 72); + static u16 D_8082ADE8[] = LANGUAGE_ARRAY(96, 80, 104, 112); static s16 D_8082ADF0[][4] = { { 180, 210, 255, 220 }, { 100, 100, 150, 220 }, @@ -1305,8 +1806,7 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { Matrix_Translate(0.0f, 0.0f, -144.0f, MTXMODE_NEW); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_kaleido_scope_PAL.c", 1755), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_kaleido_scope_PAL.c", 1755); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 90, 100, 130, 255); gSPVertex(POLY_OPA_DISP++, &pauseCtx->infoPanelVtx[0], 16, 0); @@ -1348,13 +1848,16 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { if ((pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->namedItem != PAUSE_ITEM_NONE) && (pauseCtx->nameDisplayTimer < WREG(89)) && - (((u32)pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || (pauseCtx->mainState == PAUSE_MAIN_STATE_2) || - ((pauseCtx->mainState >= PAUSE_MAIN_STATE_4) && (pauseCtx->mainState <= PAUSE_MAIN_STATE_7)) || - (pauseCtx->mainState == PAUSE_MAIN_STATE_8)) && + (((u32)pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PLAYBACK) || + ((pauseCtx->mainState >= PAUSE_MAIN_STATE_SONG_PROMPT_INIT) && (pauseCtx->mainState <= PAUSE_MAIN_STATE_7)) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) && (pauseCtx->cursorSpecialPos == 0)) { - if (((u32)pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || (pauseCtx->mainState == PAUSE_MAIN_STATE_2) || - ((pauseCtx->mainState >= PAUSE_MAIN_STATE_4) && (pauseCtx->mainState <= PAUSE_MAIN_STATE_7)) || - (pauseCtx->mainState == PAUSE_MAIN_STATE_8)) { + if (((u32)pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PLAYBACK) || + ((pauseCtx->mainState >= PAUSE_MAIN_STATE_SONG_PROMPT_INIT) && + (pauseCtx->mainState <= PAUSE_MAIN_STATE_7)) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) { pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] = -63; pauseCtx->infoPanelVtx[17].v.ob[0] = pauseCtx->infoPanelVtx[19].v.ob[0] = @@ -1421,7 +1924,7 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { } } } else if ((pauseCtx->mainState < PAUSE_MAIN_STATE_3) || (pauseCtx->mainState == PAUSE_MAIN_STATE_7) || - (pauseCtx->mainState == PAUSE_MAIN_STATE_8)) { + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) { pauseCtx->infoPanelVtx[20].v.ob[1] = pauseCtx->infoPanelVtx[21].v.ob[1] = temp; pauseCtx->infoPanelVtx[22].v.ob[1] = pauseCtx->infoPanelVtx[23].v.ob[1] = @@ -1432,13 +1935,14 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { gSPVertex(POLY_OPA_DISP++, &pauseCtx->infoPanelVtx[16], 8, 0); if (pauseCtx->state == PAUSE_STATE_SAVE_PROMPT) { - pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] = WREG(61 + gSaveContext.language); + pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] = + R_KALEIDO_UNK5(gSaveContext.language); pauseCtx->infoPanelVtx[17].v.ob[0] = pauseCtx->infoPanelVtx[19].v.ob[0] = pauseCtx->infoPanelVtx[16].v.ob[0] + 24; pauseCtx->infoPanelVtx[20].v.ob[0] = pauseCtx->infoPanelVtx[22].v.ob[0] = - pauseCtx->infoPanelVtx[16].v.ob[0] + WREG(52 + gSaveContext.language); + pauseCtx->infoPanelVtx[16].v.ob[0] + R_KALEIDO_UNK2(gSaveContext.language); pauseCtx->infoPanelVtx[21].v.ob[0] = pauseCtx->infoPanelVtx[23].v.ob[0] = pauseCtx->infoPanelVtx[20].v.ob[0] + D_8082ADE0[gSaveContext.language]; @@ -1478,13 +1982,13 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { } else { if ((u32)pauseCtx->pageIndex == PAUSE_ITEM) { pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] = - WREG(49 + gSaveContext.language); + R_KALEIDO_UNK1(gSaveContext.language); pauseCtx->infoPanelVtx[17].v.ob[0] = pauseCtx->infoPanelVtx[19].v.ob[0] = pauseCtx->infoPanelVtx[16].v.ob[0] + 48; pauseCtx->infoPanelVtx[20].v.ob[0] = pauseCtx->infoPanelVtx[22].v.ob[0] = - pauseCtx->infoPanelVtx[16].v.ob[0] + WREG(58 + gSaveContext.language); + pauseCtx->infoPanelVtx[16].v.ob[0] + R_KALEIDO_UNK4(gSaveContext.language); pauseCtx->infoPanelVtx[21].v.ob[0] = pauseCtx->infoPanelVtx[23].v.ob[0] = pauseCtx->infoPanelVtx[20].v.ob[0] + D_8082ADD8[gSaveContext.language]; @@ -1507,13 +2011,13 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { (pauseCtx->cursorSlot[PAUSE_QUEST] <= 0x11)) { if (pauseCtx->namedItem != PAUSE_ITEM_NONE) { pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] = - WREG(55 + gSaveContext.language); + R_KALEIDO_UNK3(gSaveContext.language); pauseCtx->infoPanelVtx[17].v.ob[0] = pauseCtx->infoPanelVtx[19].v.ob[0] = pauseCtx->infoPanelVtx[16].v.ob[0] + 24; pauseCtx->infoPanelVtx[20].v.ob[0] = pauseCtx->infoPanelVtx[22].v.ob[0] = - pauseCtx->infoPanelVtx[16].v.ob[0] + WREG(52 + gSaveContext.language); + pauseCtx->infoPanelVtx[16].v.ob[0] + R_KALEIDO_UNK2(gSaveContext.language); #if OOT_PAL if (gSaveContext.language == LANGUAGE_GER) { @@ -1540,13 +2044,13 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { } } else if (pauseCtx->pageIndex == PAUSE_EQUIP) { pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] = - WREG(64 + gSaveContext.language); + R_KALEIDO_UNK6(gSaveContext.language); pauseCtx->infoPanelVtx[17].v.ob[0] = pauseCtx->infoPanelVtx[19].v.ob[0] = pauseCtx->infoPanelVtx[16].v.ob[0] + 24; pauseCtx->infoPanelVtx[20].v.ob[0] = pauseCtx->infoPanelVtx[22].v.ob[0] = - pauseCtx->infoPanelVtx[16].v.ob[0] + WREG(52 + gSaveContext.language); + pauseCtx->infoPanelVtx[16].v.ob[0] + R_KALEIDO_UNK2(gSaveContext.language); pauseCtx->infoPanelVtx[21].v.ob[0] = pauseCtx->infoPanelVtx[23].v.ob[0] = pauseCtx->infoPanelVtx[20].v.ob[0] + D_8082ADD8[gSaveContext.language]; @@ -1572,48 +2076,50 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { void KaleidoScope_UpdateNamePanel(PlayState* play) { PauseContext* pauseCtx = &play->pauseCtx; - u16 sp2A; + u16 texIndex; if ((pauseCtx->namedItem != pauseCtx->cursorItem[pauseCtx->pageIndex]) || ((pauseCtx->pageIndex == PAUSE_MAP) && (pauseCtx->cursorSpecialPos != 0))) { pauseCtx->namedItem = pauseCtx->cursorItem[pauseCtx->pageIndex]; - sp2A = pauseCtx->namedItem; + texIndex = pauseCtx->namedItem; osCreateMesgQueue(&pauseCtx->loadQueue, &pauseCtx->loadMsg, 1); if (pauseCtx->namedItem != PAUSE_ITEM_NONE) { if ((pauseCtx->pageIndex == PAUSE_MAP) && !sInDungeonScene) { + // `texIndex` is a `WorldMapPoint` enum value + if (gSaveContext.language) { // != LANGUAGE_JPN for NTSC versions, LANGUAGE_ENG for PAL versions - sp2A += 12; + texIndex += WORLD_MAP_POINT_MAX; } #if OOT_PAL if (gSaveContext.language == LANGUAGE_FRA) { - sp2A += 12; + texIndex += WORLD_MAP_POINT_MAX; } #endif DMA_REQUEST_SYNC(pauseCtx->nameSegment, - (uintptr_t)_map_name_staticSegmentRomStart + (sp2A * MAP_NAME_TEX1_SIZE), + (uintptr_t)_map_name_staticSegmentRomStart + (texIndex * MAP_NAME_TEX1_SIZE), MAP_NAME_TEX1_SIZE, "../z_kaleido_scope_PAL.c", 2093); } else { PRINTF("zoom_name=%d\n", pauseCtx->namedItem); if (gSaveContext.language) { // != LANGUAGE_JPN for NTSC versions, LANGUAGE_ENG for PAL versions - sp2A += 123; + texIndex += 123; } #if OOT_PAL if (gSaveContext.language == LANGUAGE_FRA) { - sp2A += 123; + texIndex += 123; } #endif - PRINTF("J_N=%d point=%d\n", gSaveContext.language, sp2A); + PRINTF("J_N=%d point=%d\n", gSaveContext.language, texIndex); DMA_REQUEST_SYNC(pauseCtx->nameSegment, - (uintptr_t)_item_name_staticSegmentRomStart + (sp2A * ITEM_NAME_TEX_SIZE), + (uintptr_t)_item_name_staticSegmentRomStart + (texIndex * ITEM_NAME_TEX_SIZE), ITEM_NAME_TEX_SIZE, "../z_kaleido_scope_PAL.c", 2120); } @@ -1621,7 +2127,8 @@ void KaleidoScope_UpdateNamePanel(PlayState* play) { } } else if (pauseCtx->nameColorSet == 0) { if (((pauseCtx->pageIndex == PAUSE_QUEST) && (pauseCtx->cursorSlot[PAUSE_QUEST] >= 6) && - (pauseCtx->cursorSlot[PAUSE_QUEST] <= 0x11) && (pauseCtx->mainState == PAUSE_MAIN_STATE_8)) || + (pauseCtx->cursorSlot[PAUSE_QUEST] <= 0x11) && + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) || (pauseCtx->pageIndex == PAUSE_ITEM) || ((pauseCtx->pageIndex == PAUSE_EQUIP) && (pauseCtx->cursorX[PAUSE_EQUIP] != 0))) { if (pauseCtx->namedItem != ITEM_SOLD_OUT) { @@ -1687,777 +2194,1091 @@ void KaleidoScope_SetView(PauseContext* pauseCtx, f32 x, f32 y, f32 z) { VIEW_ALL | VIEW_FORCE_VIEWING | VIEW_FORCE_VIEWPORT | VIEW_FORCE_PROJECTION_PERSPECTIVE); } -static u8 D_8082AE48[][4] = { - { 10, 70, 70, 10 }, { 10, 90, 90, 10 }, { 80, 140, 140, 80 }, - { 80, 120, 120, 80 }, { 80, 140, 140, 80 }, { 50, 110, 110, 50 }, +static u8 sPageBgColorRed[][4] = { + { 10, 70, 70, 10 }, // VTX_PAGE_ITEM + { 10, 90, 90, 10 }, // VTX_PAGE_EQUIP + { 80, 140, 140, 80 }, // VTX_PAGE_MAP_DUNGEON + { 80, 120, 120, 80 }, // VTX_PAGE_QUEST + { 80, 140, 140, 80 }, // VTX_PAGE_MAP_WORLD + { 50, 110, 110, 50 }, // VTX_PAGE_PROMPT }; -static u8 D_8082AE60[][4] = { - { 50, 100, 100, 50 }, { 50, 100, 100, 50 }, { 40, 60, 60, 40 }, - { 80, 120, 120, 80 }, { 40, 60, 60, 40 }, { 50, 110, 110, 50 }, +static u8 sPageBgColorGreen[][4] = { + { 50, 100, 100, 50 }, // VTX_PAGE_ITEM + { 50, 100, 100, 50 }, // VTX_PAGE_EQUIP + { 40, 60, 60, 40 }, // VTX_PAGE_MAP_DUNGEON + { 80, 120, 120, 80 }, // VTX_PAGE_QUEST + { 40, 60, 60, 40 }, // VTX_PAGE_MAP_WORLD + { 50, 110, 110, 50 }, // VTX_PAGE_PROMPT }; -static u8 D_8082AE78[][4] = { - { 80, 130, 130, 80 }, { 40, 60, 60, 40 }, { 30, 60, 60, 30 }, - { 50, 70, 70, 50 }, { 30, 60, 60, 30 }, { 50, 110, 110, 50 }, +static u8 sPageBgColorBlue[][4] = { + { 80, 130, 130, 80 }, // VTX_PAGE_ITEM + { 40, 60, 60, 40 }, // VTX_PAGE_EQUIP + { 30, 60, 60, 30 }, // VTX_PAGE_MAP_DUNGEON + { 50, 70, 70, 50 }, // VTX_PAGE_QUEST + { 30, 60, 60, 30 }, // VTX_PAGE_MAP_WORLD + { 50, 110, 110, 50 }, // VTX_PAGE_PROMPT }; -static s16 D_8082AE90[] = { - 0x0000, - 0x0000, -}; -static s16 D_8082AE94[] = { - 0x0000, - 0x0000, -}; -static s16 D_8082AE98[] = { +// CLAMP_MIN(*, 1) because C arrays can't have 0 length +static s16 sVtxPageItemQuadsX[CLAMP_MIN(VTX_PAGE_ITEM_QUADS, 1)] = { 0 }; +static s16 sVtxPageEquipQuadsX[CLAMP_MIN(VTX_PAGE_EQUIP_QUADS, 1)] = { 0 }; +static s16 sVtxPageMapDungeonQuadsX[VTX_PAGE_MAP_DUNGEON_QUADS] = { 0xFFDC, 0x000C, 0xFFEE, 0x0046, 0x0046, 0x0046, 0xFFA8, 0xFFA8, 0xFFA8, - 0xFFA8, 0xFFA8, 0xFFA8, 0xFFA8, 0xFFA8, 0xFF96, 0xFFC2, 0xFFD8, 0x0000, -}; -static s16 D_8082AEBC[] = { - 0x0000, - 0x0000, -}; -static s16 D_8082AEC0[] = { - 0x002F, 0xFFCF, 0xFFEF, 0xFFF1, 0xFFF7, 0x0018, 0x002B, 0x000E, 0x0009, 0x0026, 0x0052, - 0x0047, 0xFFB4, 0xFFA9, 0xFF94, 0xFFCA, 0xFFA3, 0xFFBD, 0xFFC8, 0xFFDF, 0xFFF6, 0x0001, - 0x000E, 0x0018, 0x0023, 0x003A, 0x004A, 0x0059, 0x0000, 0xFFC6, 0x0013, 0x001C, + 0xFFA8, 0xFFA8, 0xFFA8, 0xFFA8, 0xFFA8, 0xFF96, 0xFFC2, 0xFFD8, }; -static s16 D_8082AF00[] = { - 0xFFB4, 0xFFC6, 0x000A, 0xFFC6, 0x000A, 0x0000, +static s16 sVtxPageQuestQuadsX[CLAMP_MIN(VTX_PAGE_QUEST_QUADS, 1)] = { 0 }; +static s16 sVtxPageMapWorldQuadsX[VTX_PAGE_MAP_WORLD_QUADS] = { + 47, // WORLD_MAP_QUAD_CLOUDS_SACRED_FOREST_MEADOW + -49, // WORLD_MAP_QUAD_CLOUDS_HYRULE_FIELD + -17, // WORLD_MAP_QUAD_CLOUDS_LON_LON_RANCH + -15, // WORLD_MAP_QUAD_CLOUDS_MARKET + -9, // WORLD_MAP_QUAD_CLOUDS_HYRULE_CASTLE + 24, // WORLD_MAP_QUAD_CLOUDS_KAKARIKO_VILLAGE + 43, // WORLD_MAP_QUAD_CLOUDS_GRAVEYARD + 14, // WORLD_MAP_QUAD_CLOUDS_DEATH_MOUNTAIN_TRAIL + 9, // WORLD_MAP_QUAD_CLOUDS_GORON_CITY + 38, // WORLD_MAP_QUAD_CLOUDS_ZORAS_RIVER + 82, // WORLD_MAP_QUAD_CLOUDS_ZORAS_DOMAIN + 71, // WORLD_MAP_QUAD_CLOUDS_ZORAS_FOUNTAIN + -76, // WORLD_MAP_QUAD_CLOUDS_GERUDO_VALLEY + -87, // WORLD_MAP_QUAD_CLOUDS_GERUDOS_FORTRESS + -108, // WORLD_MAP_QUAD_CLOUDS_DESERT_COLOSSUS + -54, // WORLD_MAP_QUAD_CLOUDS_LAKE_HYLIA + -93, // WORLD_MAP_POINT_HAUNTED_WASTELAND + -67, // WORLD_MAP_POINT_GERUDOS_FORTRESS + -56, // WORLD_MAP_POINT_GERUDO_VALLEY + -33, // WORLD_MAP_POINT_LAKE_HYLIA + -10, // WORLD_MAP_POINT_LON_LON_RANCH + 1, // WORLD_MAP_POINT_MARKET + 14, // WORLD_MAP_POINT_HYRULE_FIELD + 24, // WORLD_MAP_POINT_DEATH_MOUNTAIN + 35, // WORLD_MAP_POINT_KAKARIKO_VILLAGE + 58, // WORLD_MAP_POINT_LOST_WOODS + 74, // WORLD_MAP_POINT_KOKIRI_FOREST + 89, // WORLD_MAP_POINT_ZORAS_DOMAIN + 0, // WORLD_MAP_QUAD_28 + -58, // WORLD_MAP_QUAD_TRADE_QUEST_MARKER + 19, // WORLD_MAP_QUAD_30 + 28, // WORLD_MAP_QUAD_31 }; -static s16 D_8082AF0C[] = { - 0x0000, - 0x0000, +static s16 sVtxPagePromptQuadsX[VTX_PAGE_PROMPT_QUADS] = { + -76, // PROMPT_QUAD_MESSAGE + -58, // PROMPT_QUAD_CURSOR_LEFT + 10, // PROMPT_QUAD_CURSOR_RIGHT + -58, // PROMPT_QUAD_CHOICE_YES + 10, // PROMPT_QUAD_CHOICE_NO }; -static s16 D_8082AF10[] = { - 0x0000, - 0x0000, -}; -static s16 D_8082AF14[] = { +static s16 sVtxPageItemQuadsWidth[CLAMP_MIN(VTX_PAGE_ITEM_QUADS, 1)] = { 0 }; +static s16 sVtxPageEquipQuadsWidth[CLAMP_MIN(VTX_PAGE_EQUIP_QUADS, 1)] = { 0 }; +static s16 sVtxPageMapDungeonQuadsWidth[VTX_PAGE_MAP_DUNGEON_QUADS] = { 0x0030, 0x0030, 0x0060, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, - 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0010, 0x0010, 0x0018, 0x0000, -}; -static s16 D_8082AF38[] = { - 0x0000, - 0x0000, -}; -static s16 D_8082AF3C[] = { - 0x0098, 0x0030, 0x0030, 0x0030, 0x0030, 0x0000, + 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0010, 0x0010, 0x0018, }; -static s16 D_8082AF48[] = { - 0x0000, - 0x0000, +static s16 sVtxPageQuestQuadsWidth[CLAMP_MIN(VTX_PAGE_QUEST_QUADS, 1)] = { 0 }; +static s16 sVtxPagePromptQuadsWidth[VTX_PAGE_PROMPT_QUADS] = { + 152, // PROMPT_QUAD_MESSAGE + 48, // PROMPT_QUAD_CURSOR_LEFT + 48, // PROMPT_QUAD_CURSOR_RIGHT + 48, // PROMPT_QUAD_CHOICE_YES + 48, // PROMPT_QUAD_CHOICE_NO }; -static s16 D_8082AF4C[] = { - 0x0000, - 0x0000, -}; -static s16 D_8082AF50[] = { +static s16 sVtxPageItemQuadsY[CLAMP_MIN(VTX_PAGE_ITEM_QUADS, 1)] = { 0 }; +static s16 sVtxPageEquipQuadsY[CLAMP_MIN(VTX_PAGE_EQUIP_QUADS, 1)] = { 0 }; +static s16 sVtxPageMapDungeonQuadsY[VTX_PAGE_MAP_DUNGEON_QUADS] = { 0x001C, 0x001C, 0x002E, 0x001C, 0xFFFE, 0xFFE0, 0x0032, 0x0024, 0x0016, - 0x0008, 0xFFFA, 0xFFEC, 0xFFDE, 0xFFD0, 0x0012, 0x0012, 0x0032, 0x0000, -}; -static s16 D_8082AF74[] = { - 0x0000, - 0x0000, -}; -static s16 D_8082AF78[] = { - 0x000F, 0x0028, 0x000B, 0x002D, 0x0034, 0x0025, 0x0024, 0x0039, 0x0036, 0x0021, 0x001F, - 0x002D, 0x0020, 0x002A, 0x0031, 0xFFF6, 0x001F, 0x001B, 0x000F, 0xFFCF, 0x0008, 0x0026, - 0x0007, 0x002F, 0x001E, 0x0001, 0xFFF7, 0x0019, 0x0000, 0x0001, 0xFFE0, 0xFFE6, + 0x0008, 0xFFFA, 0xFFEC, 0xFFDE, 0xFFD0, 0x0012, 0x0012, 0x0032, }; -static s16 D_8082AFB8[] = { - 0x0024, 0x000A, 0x000A, 0xFFFA, 0xFFFA, 0x0000, +static s16 sVtxPageQuestQuadsY[CLAMP_MIN(VTX_PAGE_QUEST_QUADS, 1)] = { 0 }; +static s16 sVtxPageMapWorldQuadsY[VTX_PAGE_MAP_WORLD_QUADS] = { + 15, // WORLD_MAP_QUAD_CLOUDS_SACRED_FOREST_MEADOW + 40, // WORLD_MAP_QUAD_CLOUDS_HYRULE_FIELD + 11, // WORLD_MAP_QUAD_CLOUDS_LON_LON_RANCH + 45, // WORLD_MAP_QUAD_CLOUDS_MARKET + 52, // WORLD_MAP_QUAD_CLOUDS_HYRULE_CASTLE + 37, // WORLD_MAP_QUAD_CLOUDS_KAKARIKO_VILLAGE + 36, // WORLD_MAP_QUAD_CLOUDS_GRAVEYARD + 57, // WORLD_MAP_QUAD_CLOUDS_DEATH_MOUNTAIN_TRAIL + 54, // WORLD_MAP_QUAD_CLOUDS_GORON_CITY + 33, // WORLD_MAP_QUAD_CLOUDS_ZORAS_RIVER + 31, // WORLD_MAP_QUAD_CLOUDS_ZORAS_DOMAIN + 45, // WORLD_MAP_QUAD_CLOUDS_ZORAS_FOUNTAIN + 32, // WORLD_MAP_QUAD_CLOUDS_GERUDO_VALLEY + 42, // WORLD_MAP_QUAD_CLOUDS_GERUDOS_FORTRESS + 49, // WORLD_MAP_QUAD_CLOUDS_DESERT_COLOSSUS + -10, // WORLD_MAP_QUAD_CLOUDS_LAKE_HYLIA + 31, // WORLD_MAP_POINT_HAUNTED_WASTELAND + 27, // WORLD_MAP_POINT_GERUDOS_FORTRESS + 15, // WORLD_MAP_POINT_GERUDO_VALLEY + -49, // WORLD_MAP_POINT_LAKE_HYLIA + 8, // WORLD_MAP_POINT_LON_LON_RANCH + 38, // WORLD_MAP_POINT_MARKET + 7, // WORLD_MAP_POINT_HYRULE_FIELD + 47, // WORLD_MAP_POINT_DEATH_MOUNTAIN + 30, // WORLD_MAP_POINT_KAKARIKO_VILLAGE + 1, // WORLD_MAP_POINT_LOST_WOODS + -9, // WORLD_MAP_POINT_KOKIRI_FOREST + 25, // WORLD_MAP_POINT_ZORAS_DOMAIN + 0, // WORLD_MAP_QUAD_28 + 1, // WORLD_MAP_QUAD_TRADE_QUEST_MARKER + -32, // WORLD_MAP_QUAD_30 + -26, // WORLD_MAP_QUAD_31 }; -static s16 D_8082AFC4[] = { - 0x0000, - 0x0000, +static s16 sVtxPagePromptQuadsY[VTX_PAGE_PROMPT_QUADS] = { + 36, // PROMPT_QUAD_MESSAGE + 10, // PROMPT_QUAD_CURSOR_LEFT + 10, // PROMPT_QUAD_CURSOR_RIGHT + -6, // PROMPT_QUAD_CHOICE_YES + -6, // PROMPT_QUAD_CHOICE_NO }; -static s16 D_8082AFC8[] = { - 0x0000, - 0x0000, -}; -static s16 D_8082AFCC[] = { +static s16 sVtxPageItemQuadsHeight[CLAMP_MIN(VTX_PAGE_ITEM_QUADS, 1)] = { 0 }; +static s16 sVtxPageEquipQuadsHeight[CLAMP_MIN(VTX_PAGE_EQUIP_QUADS, 1)] = { 0 }; +static s16 sVtxPageMapDungeonQuadsHeight[VTX_PAGE_MAP_DUNGEON_QUADS] = { 0x0055, 0x0055, 0x0010, 0x0018, 0x0018, 0x0018, 0x0010, 0x0010, 0x0010, - 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0018, 0x0000, -}; -static s16 D_8082AFF0[] = { - 0x0000, - 0x0000, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0018, }; -static s16 D_8082AFF4[] = { - 0x0010, 0x0030, 0x0030, 0x0010, 0x0010, 0x0000, +static s16 sVtxPageQuestQuadsHeight[CLAMP_MIN(VTX_PAGE_QUEST_QUADS, 1)] = { 0 }; +static s16 sVtxPagePromptQuadsHeight[VTX_PAGE_PROMPT_QUADS] = { + 16, // PROMPT_QUAD_MESSAGE + 48, // PROMPT_QUAD_CURSOR_LEFT + 48, // PROMPT_QUAD_CURSOR_RIGHT + 16, // PROMPT_QUAD_CHOICE_YES + 16, // PROMPT_QUAD_CHOICE_NO }; -static s16* D_8082B000[] = { - D_8082AE90, D_8082AE94, D_8082AE98, D_8082AEBC, D_8082AEC0, D_8082AF00, +static s16* sVtxPageQuadsX[] = { + sVtxPageItemQuadsX, // VTX_PAGE_ITEM + sVtxPageEquipQuadsX, // VTX_PAGE_EQUIP + sVtxPageMapDungeonQuadsX, // VTX_PAGE_MAP_DUNGEON + sVtxPageQuestQuadsX, // VTX_PAGE_QUEST + sVtxPageMapWorldQuadsX, // VTX_PAGE_MAP_WORLD + sVtxPagePromptQuadsX, // VTX_PAGE_PROMPT }; -static s16* D_8082B018[] = { - D_8082AF0C, D_8082AF10, D_8082AF14, D_8082AF38, D_8082AAEC, D_8082AF3C, +static s16* sVtxPageQuadsWidth[] = { + sVtxPageItemQuadsWidth, // VTX_PAGE_ITEM + sVtxPageEquipQuadsWidth, // VTX_PAGE_EQUIP + sVtxPageMapDungeonQuadsWidth, // VTX_PAGE_MAP_DUNGEON + sVtxPageQuestQuadsWidth, // VTX_PAGE_QUEST + gVtxPageMapWorldQuadsWidth, // VTX_PAGE_MAP_WORLD + sVtxPagePromptQuadsWidth, // VTX_PAGE_PROMPT }; -static s16* D_8082B030[] = { - D_8082AF48, D_8082AF4C, D_8082AF50, D_8082AF74, D_8082AF78, D_8082AFB8, +static s16* sVtxPageQuadsY[] = { + sVtxPageItemQuadsY, // VTX_PAGE_ITEM + sVtxPageEquipQuadsY, // VTX_PAGE_EQUIP + sVtxPageMapDungeonQuadsY, // VTX_PAGE_MAP_DUNGEON + sVtxPageQuestQuadsY, // VTX_PAGE_QUEST + sVtxPageMapWorldQuadsY, // VTX_PAGE_MAP_WORLD + sVtxPagePromptQuadsY, // VTX_PAGE_PROMPT }; -static s16* D_8082B048[] = { - D_8082AFC4, D_8082AFC8, D_8082AFCC, D_8082AFF0, D_8082AB2C, D_8082AFF4, +static s16* sVtxPageQuadsHeight[] = { + sVtxPageItemQuadsHeight, // VTX_PAGE_ITEM + sVtxPageEquipQuadsHeight, // VTX_PAGE_EQUIP + sVtxPageMapDungeonQuadsHeight, // VTX_PAGE_MAP_DUNGEON + sVtxPageQuestQuadsHeight, // VTX_PAGE_QUEST + gVtxPageMapWorldQuadsHeight, // VTX_PAGE_MAP_WORLD + sVtxPagePromptQuadsHeight, // VTX_PAGE_PROMPT }; -static s16 D_8082B060[] = { - 0xFFC6, 0x000B, 0x001E, 0x001E, 0x000F, 0x0026, 0xFFC2, 0x003C, 0x003D, 0xFFB2, 0xFED4, - 0xFFAA, 0xFFBF, 0xFED4, 0xFED4, 0xFFEB, 0x000E, 0x000D, 0x0014, 0xFFDE, 0xFED4, 0x0000, +static s16 sVtxMapWorldAreaX[] = { + -58, // WORLD_MAP_AREA_HYRULE_FIELD + 11, // WORLD_MAP_AREA_KAKARIKO_VILLAGE + 30, // WORLD_MAP_AREA_GRAVEYARD + 30, // WORLD_MAP_AREA_ZORAS_RIVER + 15, // WORLD_MAP_AREA_KOKIRI_FOREST + 38, // WORLD_MAP_AREA_SACRED_FOREST_MEADOW + -62, // WORLD_MAP_AREA_LAKE_HYLIA + 60, // WORLD_MAP_AREA_ZORAS_DOMAIN + 61, // WORLD_MAP_AREA_ZORAS_FOUNTAIN + -78, // WORLD_MAP_AREA_GERUDO_VALLEY + -300, // WORLD_MAP_AREA_LOST_WOODS + -86, // WORLD_MAP_AREA_DESERT_COLOSSUS + -65, // WORLD_MAP_AREA_GERUDOS_FORTRESS + -300, // WORLD_MAP_AREA_HAUNTED_WASTELAND + -300, // WORLD_MAP_AREA_MARKET + -21, // WORLD_MAP_AREA_HYRULE_CASTLE + 14, // WORLD_MAP_AREA_DEATH_MOUNTAIN_TRAIL + 13, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER + 20, // WORLD_MAP_AREA_GORON_CITY + -34, // WORLD_MAP_AREA_LON_LON_RANCH + -300, // WORLD_MAP_AREA_QUESTION_MARK + 0, // WORLD_MAP_AREA_GANONS_CASTLE }; -static s16 D_8082B08C[] = { - 0x0059, 0x0014, 0x000E, 0x0023, 0x0020, 0x0011, 0x0032, 0x0010, 0x0015, 0x0014, 0xFFFF, - 0x0020, 0x0010, 0xFFFF, 0xFFFF, 0x0013, 0x0013, 0x0015, 0x0010, 0x0014, 0xFFFF, 0x0000, +static s16 sVtxMapWorldAreaWidth[] = { + 89, // WORLD_MAP_AREA_HYRULE_FIELD + 20, // WORLD_MAP_AREA_KAKARIKO_VILLAGE + 14, // WORLD_MAP_AREA_GRAVEYARD + 35, // WORLD_MAP_AREA_ZORAS_RIVER + 32, // WORLD_MAP_AREA_KOKIRI_FOREST + 17, // WORLD_MAP_AREA_SACRED_FOREST_MEADOW + 50, // WORLD_MAP_AREA_LAKE_HYLIA + 16, // WORLD_MAP_AREA_ZORAS_DOMAIN + 21, // WORLD_MAP_AREA_ZORAS_FOUNTAIN + 20, // WORLD_MAP_AREA_GERUDO_VALLEY + -1, // WORLD_MAP_AREA_LOST_WOODS + 32, // WORLD_MAP_AREA_DESERT_COLOSSUS + 16, // WORLD_MAP_AREA_GERUDOS_FORTRESS + -1, // WORLD_MAP_AREA_HAUNTED_WASTELAND + -1, // WORLD_MAP_AREA_MARKET + 19, // WORLD_MAP_AREA_HYRULE_CASTLE + 19, // WORLD_MAP_AREA_DEATH_MOUNTAIN_TRAIL + 21, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER + 16, // WORLD_MAP_AREA_GORON_CITY + 20, // WORLD_MAP_AREA_LON_LON_RANCH + -1, // WORLD_MAP_AREA_QUESTION_MARK + 0, // WORLD_MAP_AREA_GANONS_CASTLE }; -static s16 D_8082B0B8[] = { - 0x0001, 0x000F, 0x0014, 0x0009, 0xFFE2, 0xFFEF, 0xFFDE, 0x000F, 0x001E, 0x0001, 0xFED4, - 0x002A, 0x0007, 0xFED4, 0xFED4, 0x0018, 0x0024, 0x0035, 0x0025, 0xFFF3, 0xFED4, 0x0000, +static s16 sVtxMapWorldAreaY[] = { + 1, // WORLD_MAP_AREA_HYRULE_FIELD + 15, // WORLD_MAP_AREA_KAKARIKO_VILLAGE + 20, // WORLD_MAP_AREA_GRAVEYARD + 9, // WORLD_MAP_AREA_ZORAS_RIVER + -30, // WORLD_MAP_AREA_KOKIRI_FOREST + -17, // WORLD_MAP_AREA_SACRED_FOREST_MEADOW + -34, // WORLD_MAP_AREA_LAKE_HYLIA + 15, // WORLD_MAP_AREA_ZORAS_DOMAIN + 30, // WORLD_MAP_AREA_ZORAS_FOUNTAIN + 1, // WORLD_MAP_AREA_GERUDO_VALLEY + -300, // WORLD_MAP_AREA_LOST_WOODS + 42, // WORLD_MAP_AREA_DESERT_COLOSSUS + 7, // WORLD_MAP_AREA_GERUDOS_FORTRESS + -300, // WORLD_MAP_AREA_HAUNTED_WASTELAND + -300, // WORLD_MAP_AREA_MARKET + 24, // WORLD_MAP_AREA_HYRULE_CASTLE + 36, // WORLD_MAP_AREA_DEATH_MOUNTAIN_TRAIL + 53, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER + 37, // WORLD_MAP_AREA_GORON_CITY + -13, // WORLD_MAP_AREA_LON_LON_RANCH + -300, // WORLD_MAP_AREA_QUESTION_MARK + 0, // WORLD_MAP_AREA_GANONS_CASTLE }; -static s16 D_8082B0E4[] = { - 0x0024, 0x000F, 0x0010, 0x0017, 0x0017, 0x0010, 0x0018, 0x000D, 0x0011, 0x0012, 0x0001, - 0x0019, 0x000D, 0x0001, 0x0001, 0x000D, 0x0015, 0x000F, 0x000D, 0x000C, 0x0001, 0x0000, +static s16 sVtxMapWorldAreaHeight[] = { + 36, // WORLD_MAP_AREA_HYRULE_FIELD + 15, // WORLD_MAP_AREA_KAKARIKO_VILLAGE + 16, // WORLD_MAP_AREA_GRAVEYARD + 23, // WORLD_MAP_AREA_ZORAS_RIVER + 23, // WORLD_MAP_AREA_KOKIRI_FOREST + 16, // WORLD_MAP_AREA_SACRED_FOREST_MEADOW + 24, // WORLD_MAP_AREA_LAKE_HYLIA + 13, // WORLD_MAP_AREA_ZORAS_DOMAIN + 17, // WORLD_MAP_AREA_ZORAS_FOUNTAIN + 18, // WORLD_MAP_AREA_GERUDO_VALLEY + 1, // WORLD_MAP_AREA_LOST_WOODS + 25, // WORLD_MAP_AREA_DESERT_COLOSSUS + 13, // WORLD_MAP_AREA_GERUDOS_FORTRESS + 1, // WORLD_MAP_AREA_HAUNTED_WASTELAND + 1, // WORLD_MAP_AREA_MARKET + 13, // WORLD_MAP_AREA_HYRULE_CASTLE + 21, // WORLD_MAP_AREA_DEATH_MOUNTAIN_TRAIL + 15, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER + 13, // WORLD_MAP_AREA_GORON_CITY + 12, // WORLD_MAP_AREA_LON_LON_RANCH + 1, // WORLD_MAP_AREA_QUESTION_MARK + 0, // WORLD_MAP_AREA_GANONS_CASTLE }; -s16 func_80823A0C(PlayState* play, Vtx* vtx, s16 arg2, s16 arg3) { - static s16 D_8082B110 = 0; - static s16 D_8082B114 = 1; - static s16 D_8082B118 = 0; +s16 KaleidoScope_SetPageVertices(PlayState* play, Vtx* vtx, s16 vtxPage, s16 numQuads) { + static s16 sTradeQuestMarkerBobY = 0; + static s16 sTradeQuestMarkerBobTimer = 1; + static s16 sTradeQuestMarkerBobState = 0; PauseContext* pauseCtx = &play->pauseCtx; - s16* ptr1; - s16* ptr2; - s16* ptr3; - s16* ptr4; - s16 phi_s2; - s16 phi_t0; - s16 phi_a1; - s16 phi_a2; - s16 phi_t3; - s16 phi_t1; + s16* quadsX; + s16* quadsWidth; + s16* quadsY; + s16* quadsHeight; + s16 bufIAfterPageSections; + s16 pageBgQuadX; + s16 pageBgQuadY; + s16 i; + s16 j; + s16 bufI; + + // Vertices for KaleidoScope_DrawPageSections - phi_t0 = -200; + pageBgQuadX = 0 - (PAGE_BG_COLS * PAGE_BG_QUAD_WIDTH) / 2 - PAGE_BG_QUAD_WIDTH; - for (phi_t1 = 0, phi_t3 = 0; phi_t3 < 3; phi_t3++) { - phi_t0 += 80; + // For each column + for (bufI = 0, j = 0; j < PAGE_BG_COLS; j++) { + pageBgQuadX += PAGE_BG_QUAD_WIDTH; - for (phi_a1 = 80, phi_a2 = 0; phi_a2 < 5; phi_a2++, phi_t1 += 4, phi_a1 -= 32) { - vtx[phi_t1 + 0].v.ob[0] = vtx[phi_t1 + 2].v.ob[0] = phi_t0; + // For each row + for (pageBgQuadY = (PAGE_BG_ROWS * PAGE_BG_QUAD_HEIGHT) / 2, i = 0; i < PAGE_BG_ROWS; + i++, bufI += 4, pageBgQuadY -= PAGE_BG_QUAD_HEIGHT) { + vtx[bufI + 0].v.ob[0] = vtx[bufI + 2].v.ob[0] = pageBgQuadX; - vtx[phi_t1 + 1].v.ob[0] = vtx[phi_t1 + 3].v.ob[0] = vtx[phi_t1 + 0].v.ob[0] + 80; + vtx[bufI + 1].v.ob[0] = vtx[bufI + 3].v.ob[0] = vtx[bufI + 0].v.ob[0] + PAGE_BG_QUAD_WIDTH; - vtx[phi_t1 + 0].v.ob[1] = vtx[phi_t1 + 1].v.ob[1] = phi_a1 + pauseCtx->offsetY; + vtx[bufI + 0].v.ob[1] = vtx[bufI + 1].v.ob[1] = pageBgQuadY + pauseCtx->pagesYOrigin1; - vtx[phi_t1 + 2].v.ob[1] = vtx[phi_t1 + 3].v.ob[1] = vtx[phi_t1 + 0].v.ob[1] - 32; + vtx[bufI + 2].v.ob[1] = vtx[bufI + 3].v.ob[1] = vtx[bufI + 0].v.ob[1] - PAGE_BG_QUAD_HEIGHT; - vtx[phi_t1 + 0].v.ob[2] = vtx[phi_t1 + 1].v.ob[2] = vtx[phi_t1 + 2].v.ob[2] = vtx[phi_t1 + 3].v.ob[2] = 0; + vtx[bufI + 0].v.ob[2] = vtx[bufI + 1].v.ob[2] = vtx[bufI + 2].v.ob[2] = vtx[bufI + 3].v.ob[2] = 0; - vtx[phi_t1 + 0].v.flag = 0; - vtx[phi_t1 + 1].v.flag = 0; - vtx[phi_t1 + 2].v.flag = 0; - vtx[phi_t1 + 3].v.flag = 0; + vtx[bufI + 0].v.flag = 0; + vtx[bufI + 1].v.flag = 0; + vtx[bufI + 2].v.flag = 0; + vtx[bufI + 3].v.flag = 0; - vtx[phi_t1 + 0].v.tc[0] = vtx[phi_t1 + 0].v.tc[1] = vtx[phi_t1 + 1].v.tc[1] = vtx[phi_t1 + 2].v.tc[0] = 0; + vtx[bufI + 0].v.tc[0] = vtx[bufI + 0].v.tc[1] = vtx[bufI + 1].v.tc[1] = vtx[bufI + 2].v.tc[0] = 0; - vtx[phi_t1 + 1].v.tc[0] = vtx[phi_t1 + 3].v.tc[0] = 0xA00; + vtx[bufI + 1].v.tc[0] = vtx[bufI + 3].v.tc[0] = PAGE_BG_QUAD_TEX_WIDTH * (1 << 5); - vtx[phi_t1 + 2].v.tc[1] = vtx[phi_t1 + 3].v.tc[1] = 0x400; + vtx[bufI + 2].v.tc[1] = vtx[bufI + 3].v.tc[1] = PAGE_BG_QUAD_TEX_HEIGHT * (1 << 5); - vtx[phi_t1 + 0].v.cn[0] = vtx[phi_t1 + 2].v.cn[0] = D_8082AE48[arg2][phi_t3 + 0]; + vtx[bufI + 0].v.cn[0] = vtx[bufI + 2].v.cn[0] = sPageBgColorRed[vtxPage][j + 0]; - vtx[phi_t1 + 0].v.cn[1] = vtx[phi_t1 + 2].v.cn[1] = D_8082AE60[arg2][phi_t3 + 0]; + vtx[bufI + 0].v.cn[1] = vtx[bufI + 2].v.cn[1] = sPageBgColorGreen[vtxPage][j + 0]; - vtx[phi_t1 + 0].v.cn[2] = vtx[phi_t1 + 2].v.cn[2] = D_8082AE78[arg2][phi_t3 + 0]; + vtx[bufI + 0].v.cn[2] = vtx[bufI + 2].v.cn[2] = sPageBgColorBlue[vtxPage][j + 0]; - vtx[phi_t1 + 1].v.cn[0] = vtx[phi_t1 + 3].v.cn[0] = D_8082AE48[arg2][phi_t3 + 1]; + vtx[bufI + 1].v.cn[0] = vtx[bufI + 3].v.cn[0] = sPageBgColorRed[vtxPage][j + 1]; - vtx[phi_t1 + 1].v.cn[1] = vtx[phi_t1 + 3].v.cn[1] = D_8082AE60[arg2][phi_t3 + 1]; + vtx[bufI + 1].v.cn[1] = vtx[bufI + 3].v.cn[1] = sPageBgColorGreen[vtxPage][j + 1]; - vtx[phi_t1 + 1].v.cn[2] = vtx[phi_t1 + 3].v.cn[2] = D_8082AE78[arg2][phi_t3 + 1]; + vtx[bufI + 1].v.cn[2] = vtx[bufI + 3].v.cn[2] = sPageBgColorBlue[vtxPage][j + 1]; - vtx[phi_t1 + 0].v.cn[3] = vtx[phi_t1 + 2].v.cn[3] = vtx[phi_t1 + 1].v.cn[3] = vtx[phi_t1 + 3].v.cn[3] = + vtx[bufI + 0].v.cn[3] = vtx[bufI + 2].v.cn[3] = vtx[bufI + 1].v.cn[3] = vtx[bufI + 3].v.cn[3] = pauseCtx->alpha; } } - phi_s2 = phi_t1; + bufIAfterPageSections = bufI; + + // - if (arg3 != 0) { - ptr1 = D_8082B000[arg2]; - ptr2 = D_8082B018[arg2]; - ptr3 = D_8082B030[arg2]; - ptr4 = D_8082B048[arg2]; + if (numQuads != 0) { + quadsX = sVtxPageQuadsX[vtxPage]; + quadsWidth = sVtxPageQuadsWidth[vtxPage]; + quadsY = sVtxPageQuadsY[vtxPage]; + quadsHeight = sVtxPageQuadsHeight[vtxPage]; - for (phi_t3 = 0; phi_t3 < arg3; phi_t3++, phi_t1 += 4) { - vtx[phi_t1 + 2].v.ob[0] = vtx[phi_t1 + 0].v.ob[0] = ptr1[phi_t3]; + for (j = 0; j < numQuads; j++, bufI += 4) { + vtx[bufI + 2].v.ob[0] = vtx[bufI + 0].v.ob[0] = quadsX[j]; - vtx[phi_t1 + 1].v.ob[0] = vtx[phi_t1 + 3].v.ob[0] = vtx[phi_t1 + 0].v.ob[0] + ptr2[phi_t3]; + vtx[bufI + 1].v.ob[0] = vtx[bufI + 3].v.ob[0] = vtx[bufI + 0].v.ob[0] + quadsWidth[j]; if (!IS_PAUSE_STATE_GAMEOVER(pauseCtx)) { - vtx[phi_t1 + 0].v.ob[1] = vtx[phi_t1 + 1].v.ob[1] = ptr3[phi_t3] + pauseCtx->offsetY; + vtx[bufI + 0].v.ob[1] = vtx[bufI + 1].v.ob[1] = quadsY[j] + pauseCtx->pagesYOrigin1; } else { - vtx[phi_t1 + 0].v.ob[1] = vtx[phi_t1 + 1].v.ob[1] = YREG(60 + phi_t3) + pauseCtx->offsetY; + vtx[bufI + 0].v.ob[1] = vtx[bufI + 1].v.ob[1] = YREG(60 + j) + pauseCtx->pagesYOrigin1; } - vtx[phi_t1 + 2].v.ob[1] = vtx[phi_t1 + 3].v.ob[1] = vtx[phi_t1 + 0].v.ob[1] - ptr4[phi_t3]; + vtx[bufI + 2].v.ob[1] = vtx[bufI + 3].v.ob[1] = vtx[bufI + 0].v.ob[1] - quadsHeight[j]; - vtx[phi_t1 + 0].v.ob[2] = vtx[phi_t1 + 1].v.ob[2] = vtx[phi_t1 + 2].v.ob[2] = vtx[phi_t1 + 3].v.ob[2] = 0; + vtx[bufI + 0].v.ob[2] = vtx[bufI + 1].v.ob[2] = vtx[bufI + 2].v.ob[2] = vtx[bufI + 3].v.ob[2] = 0; - vtx[phi_t1 + 0].v.flag = vtx[phi_t1 + 1].v.flag = vtx[phi_t1 + 2].v.flag = vtx[phi_t1 + 3].v.flag = 0; + vtx[bufI + 0].v.flag = vtx[bufI + 1].v.flag = vtx[bufI + 2].v.flag = vtx[bufI + 3].v.flag = 0; - vtx[phi_t1 + 0].v.tc[0] = vtx[phi_t1 + 0].v.tc[1] = vtx[phi_t1 + 1].v.tc[1] = vtx[phi_t1 + 2].v.tc[0] = 0; + vtx[bufI + 0].v.tc[0] = vtx[bufI + 0].v.tc[1] = vtx[bufI + 1].v.tc[1] = vtx[bufI + 2].v.tc[0] = 0; - vtx[phi_t1 + 1].v.tc[0] = vtx[phi_t1 + 3].v.tc[0] = ptr2[phi_t3] << 5; + vtx[bufI + 1].v.tc[0] = vtx[bufI + 3].v.tc[0] = quadsWidth[j] << 5; - vtx[phi_t1 + 2].v.tc[1] = vtx[phi_t1 + 3].v.tc[1] = ptr4[phi_t3] << 5; + vtx[bufI + 2].v.tc[1] = vtx[bufI + 3].v.tc[1] = quadsHeight[j] << 5; - vtx[phi_t1 + 0].v.cn[0] = vtx[phi_t1 + 2].v.cn[0] = vtx[phi_t1 + 0].v.cn[1] = vtx[phi_t1 + 2].v.cn[1] = - vtx[phi_t1 + 0].v.cn[2] = vtx[phi_t1 + 2].v.cn[2] = vtx[phi_t1 + 1].v.cn[0] = vtx[phi_t1 + 3].v.cn[0] = - vtx[phi_t1 + 1].v.cn[1] = vtx[phi_t1 + 3].v.cn[1] = vtx[phi_t1 + 1].v.cn[2] = - vtx[phi_t1 + 3].v.cn[2] = 255; + vtx[bufI + 0].v.cn[0] = vtx[bufI + 2].v.cn[0] = vtx[bufI + 0].v.cn[1] = vtx[bufI + 2].v.cn[1] = + vtx[bufI + 0].v.cn[2] = vtx[bufI + 2].v.cn[2] = vtx[bufI + 1].v.cn[0] = vtx[bufI + 3].v.cn[0] = + vtx[bufI + 1].v.cn[1] = vtx[bufI + 3].v.cn[1] = vtx[bufI + 1].v.cn[2] = vtx[bufI + 3].v.cn[2] = 255; - vtx[phi_t1 + 0].v.cn[3] = vtx[phi_t1 + 2].v.cn[3] = vtx[phi_t1 + 1].v.cn[3] = vtx[phi_t1 + 3].v.cn[3] = + vtx[bufI + 0].v.cn[3] = vtx[bufI + 2].v.cn[3] = vtx[bufI + 1].v.cn[3] = vtx[bufI + 3].v.cn[3] = pauseCtx->alpha; } - if (arg2 == 4) { - phi_t1 -= 12; + if (vtxPage == VTX_PAGE_MAP_WORLD) { + // WORLD_MAP_QUAD_TRADE_QUEST_MARKER + + bufI -= ((VTX_PAGE_MAP_WORLD_QUADS - WORLD_MAP_QUAD_TRADE_QUEST_MARKER) * 4); - phi_t3 = gSaveContext.worldMapArea; + j = gSaveContext.worldMapArea; - vtx[phi_t1 + 0].v.ob[0] = vtx[phi_t1 + 2].v.ob[0] = D_8082B060[phi_t3]; + vtx[bufI + 0].v.ob[0] = vtx[bufI + 2].v.ob[0] = sVtxMapWorldAreaX[j]; - if (phi_t3) {} + if (j) {} - vtx[phi_t1 + 1].v.ob[0] = vtx[phi_t1 + 3].v.ob[0] = vtx[phi_t1 + 0].v.ob[0] + D_8082B08C[phi_t3]; + vtx[bufI + 1].v.ob[0] = vtx[bufI + 3].v.ob[0] = vtx[bufI + 0].v.ob[0] + sVtxMapWorldAreaWidth[j]; - vtx[phi_t1 + 0].v.ob[1] = vtx[phi_t1 + 1].v.ob[1] = D_8082B0B8[phi_t3] + pauseCtx->offsetY; + vtx[bufI + 0].v.ob[1] = vtx[bufI + 1].v.ob[1] = sVtxMapWorldAreaY[j] + pauseCtx->pagesYOrigin1; - vtx[phi_t1 + 2].v.ob[1] = vtx[phi_t1 + 3].v.ob[1] = vtx[phi_t1 + 0].v.ob[1] - D_8082B0E4[phi_t3]; + vtx[bufI + 2].v.ob[1] = vtx[bufI + 3].v.ob[1] = vtx[bufI + 0].v.ob[1] - sVtxMapWorldAreaHeight[j]; - phi_t1 += 12; + bufI += ((VTX_PAGE_MAP_WORLD_QUADS - WORLD_MAP_QUAD_TRADE_QUEST_MARKER) * 4); - if (pauseCtx->tradeQuestLocation != 0xFF) { - if (D_8082B114 == 0) { - D_8082B118++; - switch (D_8082B118) { + if (pauseCtx->tradeQuestMarker != TRADE_QUEST_MARKER_NONE) { + if (sTradeQuestMarkerBobTimer == 0) { + sTradeQuestMarkerBobState++; + switch (sTradeQuestMarkerBobState) { case 1: - D_8082B110 = 3; - D_8082B114 = 8; + sTradeQuestMarkerBobY = 3; + sTradeQuestMarkerBobTimer = 8; break; case 2: - D_8082B110 = 0; - D_8082B114 = 6; - D_8082B118 = 0; + sTradeQuestMarkerBobY = 0; + sTradeQuestMarkerBobTimer = 6; + sTradeQuestMarkerBobState = 0; break; } } else { - D_8082B114--; + sTradeQuestMarkerBobTimer--; } - phi_t3 = phi_s2 + (pauseCtx->tradeQuestLocation * 4) + 64; - phi_a2 = phi_s2 + 116; + j = bufIAfterPageSections + ((WORLD_MAP_QUAD_POINT_FIRST + pauseCtx->tradeQuestMarker) * 4); + i = bufIAfterPageSections + (WORLD_MAP_QUAD_TRADE_QUEST_MARKER * 4); - vtx[phi_a2 + 0].v.ob[0] = vtx[phi_a2 + 2].v.ob[0] = vtx[phi_t3 + 0].v.ob[0]; + vtx[i + 0].v.ob[0] = vtx[i + 2].v.ob[0] = vtx[j + 0].v.ob[0]; - vtx[phi_a2 + 1].v.ob[0] = vtx[phi_a2 + 3].v.ob[0] = vtx[phi_a2 + 0].v.ob[0] + 8; + vtx[i + 1].v.ob[0] = vtx[i + 3].v.ob[0] = vtx[i + 0].v.ob[0] + 8; - vtx[phi_a2 + 0].v.ob[1] = vtx[phi_a2 + 1].v.ob[1] = vtx[phi_t3 + 0].v.ob[1] - D_8082B110 + 10; + vtx[i + 0].v.ob[1] = vtx[i + 1].v.ob[1] = vtx[j + 0].v.ob[1] - sTradeQuestMarkerBobY + 10; - vtx[phi_a2 + 0].v.ob[2] = vtx[phi_a2 + 1].v.ob[2] = vtx[phi_a2 + 2].v.ob[2] = vtx[phi_a2 + 3].v.ob[2] = - 0; + vtx[i + 0].v.ob[2] = vtx[i + 1].v.ob[2] = vtx[i + 2].v.ob[2] = vtx[i + 3].v.ob[2] = 0; - vtx[phi_a2 + 2].v.ob[1] = vtx[phi_a2 + 3].v.ob[1] = vtx[phi_a2 + 0].v.ob[1] - 8; + vtx[i + 2].v.ob[1] = vtx[i + 3].v.ob[1] = vtx[i + 0].v.ob[1] - 8; - vtx[phi_a2 + 0].v.flag = vtx[phi_a2 + 1].v.flag = vtx[phi_a2 + 2].v.flag = vtx[phi_a2 + 3].v.flag = 0; + vtx[i + 0].v.flag = vtx[i + 1].v.flag = vtx[i + 2].v.flag = vtx[i + 3].v.flag = 0; - vtx[phi_t1].v.tc[0] = vtx[phi_t1].v.tc[1] = vtx[phi_a2 + 1].v.tc[1] = vtx[phi_a2 + 2].v.tc[0] = 0; + vtx[bufI].v.tc[0] = vtx[bufI].v.tc[1] = vtx[i + 1].v.tc[1] = vtx[i + 2].v.tc[0] = 0; - vtx[phi_a2 + 1].v.tc[0] = vtx[phi_a2 + 3].v.tc[0] = 0x100; + vtx[i + 1].v.tc[0] = vtx[i + 3].v.tc[0] = 8 * (1 << 5); - vtx[phi_a2 + 2].v.tc[1] = vtx[phi_a2 + 3].v.tc[1] = 0x100; + vtx[i + 2].v.tc[1] = vtx[i + 3].v.tc[1] = 8 * (1 << 5); - vtx[phi_a2 + 0].v.cn[0] = vtx[phi_a2 + 2].v.cn[0] = vtx[phi_a2 + 0].v.cn[1] = vtx[phi_a2 + 2].v.cn[1] = - vtx[phi_a2 + 0].v.cn[2] = vtx[phi_a2 + 2].v.cn[2] = vtx[phi_a2 + 1].v.cn[0] = - vtx[phi_a2 + 3].v.cn[0] = vtx[phi_a2 + 1].v.cn[1] = vtx[phi_a2 + 3].v.cn[1] = - vtx[phi_a2 + 1].v.cn[2] = vtx[phi_a2 + 3].v.cn[2] = 255; + vtx[i + 0].v.cn[0] = vtx[i + 2].v.cn[0] = vtx[i + 0].v.cn[1] = vtx[i + 2].v.cn[1] = vtx[i + 0].v.cn[2] = + vtx[i + 2].v.cn[2] = vtx[i + 1].v.cn[0] = vtx[i + 3].v.cn[0] = vtx[i + 1].v.cn[1] = + vtx[i + 3].v.cn[1] = vtx[i + 1].v.cn[2] = vtx[i + 3].v.cn[2] = 255; - vtx[phi_a2 + 0].v.cn[3] = vtx[phi_a2 + 2].v.cn[3] = vtx[phi_a2 + 1].v.cn[3] = vtx[phi_a2 + 3].v.cn[3] = - pauseCtx->alpha; + vtx[i + 0].v.cn[3] = vtx[i + 2].v.cn[3] = vtx[i + 1].v.cn[3] = vtx[i + 3].v.cn[3] = pauseCtx->alpha; } } } - return phi_t1; + return bufI; } -static s16 D_8082B11C[] = { 0, 4, 8, 12, 24, 32, 56 }; +static s16 sItemVtxQuadsWithAmmo[] = { + SLOT_DEKU_STICK * 4, // ITEM_QUAD_AMMO_STICK_ + SLOT_DEKU_NUT * 4, // ITEM_QUAD_AMMO_NUT_ + SLOT_BOMB * 4, // ITEM_QUAD_AMMO_BOMB_ + SLOT_BOW * 4, // ITEM_QUAD_AMMO_BOW_ + SLOT_SLINGSHOT * 4, // ITEM_QUAD_AMMO_SLINGSHOT_ + SLOT_BOMBCHU * 4, // ITEM_QUAD_AMMO_BOMBCHU_ + SLOT_MAGIC_BEAN * 4, // ITEM_QUAD_AMMO_BEAN_ +}; static s16 D_8082B12C[] = { -114, 12, 44, 76 }; static u8 D_8082B134[] = { 1, 5, 9, 13 }; -static s16 D_8082B138[] = { - 74, 74, 46, 18, 18, 46, -108, -90, -72, -54, -36, -18, -108, -90, -72, -54, - -36, -18, 20, 46, 72, -110, -86, -110, -54, -98, -86, -74, -62, -50, -38, -26, - -14, -98, -86, -74, -62, -50, -38, -26, -14, -88, -81, -72, -90, -83, -74, +static s16 sQuestQuadsX[] = { + 74, // QUEST_MEDALLION_FOREST + 74, // QUEST_MEDALLION_FIRE + 46, // QUEST_MEDALLION_WATER + 18, // QUEST_MEDALLION_SPIRIT + 18, // QUEST_MEDALLION_SHADOW + 46, // QUEST_MEDALLION_LIGHT + -108, // QUEST_SONG_MINUET + -90, // QUEST_SONG_BOLERO + -72, // QUEST_SONG_SERENADE + -54, // QUEST_SONG_REQUIEM + -36, // QUEST_SONG_NOCTURNE + -18, // QUEST_SONG_PRELUDE + -108, // QUEST_SONG_LULLABY + -90, // QUEST_SONG_EPONA + -72, // QUEST_SONG_SARIA + -54, // QUEST_SONG_SUN + -36, // QUEST_SONG_TIME + -18, // QUEST_SONG_STORMS + 20, // QUEST_KOKIRI_EMERALD + 46, // QUEST_GORON_RUBY + 72, // QUEST_ZORA_SAPPHIRE + -110, // QUEST_STONE_OF_AGONY + -86, // QUEST_GERUDOS_CARD + -110, // QUEST_SKULL_TOKEN + -54, // QUEST_HEART_PIECE + -98, // QUEST_QUAD_SONG_NOTE_A1 + -86, // QUEST_QUAD_SONG_NOTE_A2 + -74, // QUEST_QUAD_SONG_NOTE_A3 + -62, // QUEST_QUAD_SONG_NOTE_A4 + -50, // QUEST_QUAD_SONG_NOTE_A5 + -38, // QUEST_QUAD_SONG_NOTE_A6 + -26, // QUEST_QUAD_SONG_NOTE_A7 + -14, // QUEST_QUAD_SONG_NOTE_A8 + -98, // QUEST_QUAD_SONG_NOTE_B1 + -86, // QUEST_QUAD_SONG_NOTE_B2 + -74, // QUEST_QUAD_SONG_NOTE_B3 + -62, // QUEST_QUAD_SONG_NOTE_B4 + -50, // QUEST_QUAD_SONG_NOTE_B5 + -38, // QUEST_QUAD_SONG_NOTE_B6 + -26, // QUEST_QUAD_SONG_NOTE_B7 + -14, // QUEST_QUAD_SONG_NOTE_B8 + -88, // QUEST_QUAD_SKULL_TOKENS_DIGIT1_SHADOW + -81, // QUEST_QUAD_SKULL_TOKENS_DIGIT2_SHADOW + -72, // QUEST_QUAD_SKULL_TOKENS_DIGIT3_SHADOW + -90, // QUEST_QUAD_SKULL_TOKENS_DIGIT1 + -83, // QUEST_QUAD_SKULL_TOKENS_DIGIT2 + -74, // QUEST_QUAD_SKULL_TOKENS_DIGIT3 }; -static s16 D_8082B198[] = { - 38, 6, -12, 6, 38, 56, -20, -20, -20, -20, -20, -20, 2, 2, 2, 2, 2, 2, -46, -46, -46, 58, 58, 34, - 58, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, 34, 34, 34, 36, 36, 36, +static s16 sQuestQuadsY[] = { + 38, // QUEST_MEDALLION_FOREST + 6, // QUEST_MEDALLION_FIRE + -12, // QUEST_MEDALLION_WATER + 6, // QUEST_MEDALLION_SPIRIT + 38, // QUEST_MEDALLION_SHADOW + 56, // QUEST_MEDALLION_LIGHT + -20, // QUEST_SONG_MINUET + -20, // QUEST_SONG_BOLERO + -20, // QUEST_SONG_SERENADE + -20, // QUEST_SONG_REQUIEM + -20, // QUEST_SONG_NOCTURNE + -20, // QUEST_SONG_PRELUDE + 2, // QUEST_SONG_LULLABY + 2, // QUEST_SONG_EPONA + 2, // QUEST_SONG_SARIA + 2, // QUEST_SONG_SUN + 2, // QUEST_SONG_TIME + 2, // QUEST_SONG_STORMS + -46, // QUEST_KOKIRI_EMERALD + -46, // QUEST_GORON_RUBY + -46, // QUEST_ZORA_SAPPHIRE + 58, // QUEST_STONE_OF_AGONY + 58, // QUEST_GERUDOS_CARD + 34, // QUEST_SKULL_TOKEN + 58, // QUEST_HEART_PIECE + -52, // QUEST_QUAD_SONG_NOTE_A1 + -52, // QUEST_QUAD_SONG_NOTE_A2 + -52, // QUEST_QUAD_SONG_NOTE_A3 + -52, // QUEST_QUAD_SONG_NOTE_A4 + -52, // QUEST_QUAD_SONG_NOTE_A5 + -52, // QUEST_QUAD_SONG_NOTE_A6 + -52, // QUEST_QUAD_SONG_NOTE_A7 + -52, // QUEST_QUAD_SONG_NOTE_A8 + -52, // QUEST_QUAD_SONG_NOTE_B1 + -52, // QUEST_QUAD_SONG_NOTE_B2 + -52, // QUEST_QUAD_SONG_NOTE_B3 + -52, // QUEST_QUAD_SONG_NOTE_B4 + -52, // QUEST_QUAD_SONG_NOTE_B5 + -52, // QUEST_QUAD_SONG_NOTE_B6 + -52, // QUEST_QUAD_SONG_NOTE_B7 + -52, // QUEST_QUAD_SONG_NOTE_B8 + 34, // QUEST_QUAD_SKULL_TOKENS_DIGIT1_SHADOW + 34, // QUEST_QUAD_SKULL_TOKENS_DIGIT2_SHADOW + 34, // QUEST_QUAD_SKULL_TOKENS_DIGIT3_SHADOW + 36, // QUEST_QUAD_SKULL_TOKENS_DIGIT1 + 36, // QUEST_QUAD_SKULL_TOKENS_DIGIT2 + 36, // QUEST_QUAD_SKULL_TOKENS_DIGIT3 }; -static s16 D_8082B1F8[] = { - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 48, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, +static s16 sQuestQuadsSize[] = { + 24, // QUEST_MEDALLION_FOREST + 24, // QUEST_MEDALLION_FIRE + 24, // QUEST_MEDALLION_WATER + 24, // QUEST_MEDALLION_SPIRIT + 24, // QUEST_MEDALLION_SHADOW + 24, // QUEST_MEDALLION_LIGHT + 24, // QUEST_SONG_MINUET + 24, // QUEST_SONG_BOLERO + 24, // QUEST_SONG_SERENADE + 24, // QUEST_SONG_REQUIEM + 24, // QUEST_SONG_NOCTURNE + 24, // QUEST_SONG_PRELUDE + 24, // QUEST_SONG_LULLABY + 24, // QUEST_SONG_EPONA + 24, // QUEST_SONG_SARIA + 24, // QUEST_SONG_SUN + 24, // QUEST_SONG_TIME + 24, // QUEST_SONG_STORMS + 24, // QUEST_KOKIRI_EMERALD + 24, // QUEST_GORON_RUBY + 24, // QUEST_ZORA_SAPPHIRE + 24, // QUEST_STONE_OF_AGONY + 24, // QUEST_GERUDOS_CARD + 24, // QUEST_SKULL_TOKEN + 48, // QUEST_HEART_PIECE + 16, // QUEST_QUAD_SONG_NOTE_A1 + 16, // QUEST_QUAD_SONG_NOTE_A2 + 16, // QUEST_QUAD_SONG_NOTE_A3 + 16, // QUEST_QUAD_SONG_NOTE_A4 + 16, // QUEST_QUAD_SONG_NOTE_A5 + 16, // QUEST_QUAD_SONG_NOTE_A6 + 16, // QUEST_QUAD_SONG_NOTE_A7 + 16, // QUEST_QUAD_SONG_NOTE_A8 + 16, // QUEST_QUAD_SONG_NOTE_B1 + 16, // QUEST_QUAD_SONG_NOTE_B2 + 16, // QUEST_QUAD_SONG_NOTE_B3 + 16, // QUEST_QUAD_SONG_NOTE_B4 + 16, // QUEST_QUAD_SONG_NOTE_B5 + 16, // QUEST_QUAD_SONG_NOTE_B6 + 16, // QUEST_QUAD_SONG_NOTE_B7 + 16, // QUEST_QUAD_SONG_NOTE_B8 + 16, // QUEST_QUAD_SKULL_TOKENS_DIGIT1_SHADOW + 16, // QUEST_QUAD_SKULL_TOKENS_DIGIT2_SHADOW + 16, // QUEST_QUAD_SKULL_TOKENS_DIGIT3_SHADOW + 16, // QUEST_QUAD_SKULL_TOKENS_DIGIT1 + 16, // QUEST_QUAD_SKULL_TOKENS_DIGIT2 + 16, // QUEST_QUAD_SKULL_TOKENS_DIGIT3 }; -void KaleidoScope_InitVertices(PlayState* play, GraphicsContext* gfxCtx) { +void KaleidoScope_SetVertices(PlayState* play, GraphicsContext* gfxCtx) { PauseContext* pauseCtx = &play->pauseCtx; - s16 phi_t1; - s16 phi_t2; - s16 phi_t3; - s16 phi_t4; - s16 phi_t5; + s16 x; + s16 y; + s16 i; + s16 j; + s16 k; - pauseCtx->offsetY = 0; + pauseCtx->pagesYOrigin1 = 0; if ((pauseCtx->state == PAUSE_STATE_OPENING_1) || (pauseCtx->state >= PAUSE_STATE_CLOSING) || - ((pauseCtx->state == PAUSE_STATE_SAVE_PROMPT) && ((pauseCtx->unk_1EC == 2) || (pauseCtx->unk_1EC == 5))) || + ((pauseCtx->state == PAUSE_STATE_SAVE_PROMPT) && + ((pauseCtx->savePromptState == PAUSE_SAVE_PROMPT_STATE_CLOSING) || + (pauseCtx->savePromptState == PAUSE_SAVE_PROMPT_STATE_CLOSING_AFTER_SAVED))) || ((pauseCtx->state >= PAUSE_STATE_8) && (pauseCtx->state <= PAUSE_STATE_13))) { - pauseCtx->offsetY = 80; + // When opening/closing, translate the page vertices so that the pages rotate around their lower edge + // instead of the middle. + pauseCtx->pagesYOrigin1 = PAUSE_PAGES_Y_ORIGIN_1_LOWER; } - pauseCtx->itemPageVtx = GRAPH_ALLOC(gfxCtx, 60 * sizeof(Vtx)); - func_80823A0C(play, pauseCtx->itemPageVtx, 0, 0); + pauseCtx->itemPageVtx = GRAPH_ALLOC(gfxCtx, ((PAGE_BG_QUADS + VTX_PAGE_ITEM_QUADS) * 4) * sizeof(Vtx)); + KaleidoScope_SetPageVertices(play, pauseCtx->itemPageVtx, VTX_PAGE_ITEM, VTX_PAGE_ITEM_QUADS); - pauseCtx->equipPageVtx = GRAPH_ALLOC(gfxCtx, 60 * sizeof(Vtx)); - func_80823A0C(play, pauseCtx->equipPageVtx, 1, 0); + pauseCtx->equipPageVtx = GRAPH_ALLOC(gfxCtx, ((PAGE_BG_QUADS + VTX_PAGE_EQUIP_QUADS) * 4) * sizeof(Vtx)); + KaleidoScope_SetPageVertices(play, pauseCtx->equipPageVtx, VTX_PAGE_EQUIP, VTX_PAGE_EQUIP_QUADS); if (!sInDungeonScene) { - pauseCtx->mapPageVtx = GRAPH_ALLOC(gfxCtx, 248 * sizeof(Vtx)); - phi_t3 = func_80823A0C(play, pauseCtx->mapPageVtx, 4, 32); + pauseCtx->mapPageVtx = GRAPH_ALLOC( + gfxCtx, ((PAGE_BG_QUADS + VTX_PAGE_MAP_WORLD_QUADS + WORLD_MAP_IMAGE_FRAG_NUM) * 4) * sizeof(Vtx)); + j = KaleidoScope_SetPageVertices(play, pauseCtx->mapPageVtx, VTX_PAGE_MAP_WORLD, VTX_PAGE_MAP_WORLD_QUADS); - for (phi_t2 = 0, phi_t5 = 58; phi_t2 < 15; phi_t2++, phi_t3 += 4, phi_t5 -= 9) { - pauseCtx->mapPageVtx[phi_t3 + 2].v.ob[0] = -108; - pauseCtx->mapPageVtx[phi_t3 + 0].v.ob[0] = pauseCtx->mapPageVtx[phi_t3 + 2].v.ob[0]; + for (i = 0, y = 58; i < WORLD_MAP_IMAGE_FRAG_NUM; i++, j += 4, y -= WORLD_MAP_IMAGE_FRAG_HEIGHT) { + pauseCtx->mapPageVtx[j + 0].v.ob[0] = pauseCtx->mapPageVtx[j + 2].v.ob[0] = 0 - (WORLD_MAP_IMAGE_WIDTH / 2); - pauseCtx->mapPageVtx[phi_t3 + 1].v.ob[0] = pauseCtx->mapPageVtx[phi_t3 + 3].v.ob[0] = - pauseCtx->mapPageVtx[phi_t3 + 0].v.ob[0] + 216; + pauseCtx->mapPageVtx[j + 1].v.ob[0] = pauseCtx->mapPageVtx[j + 3].v.ob[0] = + pauseCtx->mapPageVtx[j + 0].v.ob[0] + WORLD_MAP_IMAGE_WIDTH; - pauseCtx->mapPageVtx[phi_t3 + 0].v.ob[1] = pauseCtx->mapPageVtx[phi_t3 + 1].v.ob[1] = - phi_t5 + pauseCtx->offsetY; + pauseCtx->mapPageVtx[j + 0].v.ob[1] = pauseCtx->mapPageVtx[j + 1].v.ob[1] = y + pauseCtx->pagesYOrigin1; - pauseCtx->mapPageVtx[phi_t3 + 2].v.ob[1] = pauseCtx->mapPageVtx[phi_t3 + 3].v.ob[1] = - pauseCtx->mapPageVtx[phi_t3 + 0].v.ob[1] - 9; + pauseCtx->mapPageVtx[j + 2].v.ob[1] = pauseCtx->mapPageVtx[j + 3].v.ob[1] = + pauseCtx->mapPageVtx[j + 0].v.ob[1] - WORLD_MAP_IMAGE_FRAG_HEIGHT; - pauseCtx->mapPageVtx[phi_t3 + 0].v.ob[2] = pauseCtx->mapPageVtx[phi_t3 + 1].v.ob[2] = - pauseCtx->mapPageVtx[phi_t3 + 2].v.ob[2] = pauseCtx->mapPageVtx[phi_t3 + 3].v.ob[2] = 0; + pauseCtx->mapPageVtx[j + 0].v.ob[2] = pauseCtx->mapPageVtx[j + 1].v.ob[2] = + pauseCtx->mapPageVtx[j + 2].v.ob[2] = pauseCtx->mapPageVtx[j + 3].v.ob[2] = 0; - pauseCtx->mapPageVtx[phi_t3 + 0].v.flag = pauseCtx->mapPageVtx[phi_t3 + 1].v.flag = - pauseCtx->mapPageVtx[phi_t3 + 2].v.flag = pauseCtx->mapPageVtx[phi_t3 + 3].v.flag = 0; + pauseCtx->mapPageVtx[j + 0].v.flag = pauseCtx->mapPageVtx[j + 1].v.flag = + pauseCtx->mapPageVtx[j + 2].v.flag = pauseCtx->mapPageVtx[j + 3].v.flag = 0; - pauseCtx->mapPageVtx[phi_t3 + 0].v.tc[0] = pauseCtx->mapPageVtx[phi_t3 + 0].v.tc[1] = - pauseCtx->mapPageVtx[phi_t3 + 1].v.tc[1] = pauseCtx->mapPageVtx[phi_t3 + 2].v.tc[0] = 0; + pauseCtx->mapPageVtx[j + 0].v.tc[0] = pauseCtx->mapPageVtx[j + 0].v.tc[1] = + pauseCtx->mapPageVtx[j + 1].v.tc[1] = pauseCtx->mapPageVtx[j + 2].v.tc[0] = 0; - pauseCtx->mapPageVtx[phi_t3 + 1].v.tc[0] = pauseCtx->mapPageVtx[phi_t3 + 3].v.tc[0] = 0x1B00; + pauseCtx->mapPageVtx[j + 1].v.tc[0] = pauseCtx->mapPageVtx[j + 3].v.tc[0] = + WORLD_MAP_IMAGE_WIDTH * (1 << 5); - pauseCtx->mapPageVtx[phi_t3 + 2].v.tc[1] = pauseCtx->mapPageVtx[phi_t3 + 3].v.tc[1] = 0x120; + pauseCtx->mapPageVtx[j + 2].v.tc[1] = pauseCtx->mapPageVtx[j + 3].v.tc[1] = + WORLD_MAP_IMAGE_FRAG_HEIGHT * (1 << 5); - pauseCtx->mapPageVtx[phi_t3 + 0].v.cn[0] = pauseCtx->mapPageVtx[phi_t3 + 2].v.cn[0] = - pauseCtx->mapPageVtx[phi_t3 + 0].v.cn[1] = pauseCtx->mapPageVtx[phi_t3 + 2].v.cn[1] = - pauseCtx->mapPageVtx[phi_t3 + 0].v.cn[2] = pauseCtx->mapPageVtx[phi_t3 + 2].v.cn[2] = - pauseCtx->mapPageVtx[phi_t3 + 1].v.cn[0] = pauseCtx->mapPageVtx[phi_t3 + 3].v.cn[0] = - pauseCtx->mapPageVtx[phi_t3 + 1].v.cn[1] = pauseCtx->mapPageVtx[phi_t3 + 3].v.cn[1] = - pauseCtx->mapPageVtx[phi_t3 + 1].v.cn[2] = pauseCtx->mapPageVtx[phi_t3 + 3].v.cn[2] = - pauseCtx->mapPageVtx[phi_t3 + 0].v.cn[3] = - pauseCtx->mapPageVtx[phi_t3 + 2].v.cn[3] = - pauseCtx->mapPageVtx[phi_t3 + 1].v.cn[3] = - pauseCtx->mapPageVtx[phi_t3 + 3].v.cn[3] = pauseCtx->alpha; + pauseCtx->mapPageVtx[j + 0].v.cn[0] = pauseCtx->mapPageVtx[j + 2].v.cn[0] = + pauseCtx->mapPageVtx[j + 0].v.cn[1] = pauseCtx->mapPageVtx[j + 2].v.cn[1] = + pauseCtx->mapPageVtx[j + 0].v.cn[2] = pauseCtx->mapPageVtx[j + 2].v.cn[2] = + pauseCtx->mapPageVtx[j + 1].v.cn[0] = pauseCtx->mapPageVtx[j + 3].v.cn[0] = + pauseCtx->mapPageVtx[j + 1].v.cn[1] = pauseCtx->mapPageVtx[j + 3].v.cn[1] = + pauseCtx->mapPageVtx[j + 1].v.cn[2] = pauseCtx->mapPageVtx[j + 3].v.cn[2] = + pauseCtx->mapPageVtx[j + 0].v.cn[3] = pauseCtx->mapPageVtx[j + 2].v.cn[3] = + pauseCtx->mapPageVtx[j + 1].v.cn[3] = pauseCtx->mapPageVtx[j + 3].v.cn[3] = + pauseCtx->alpha; } - pauseCtx->mapPageVtx[phi_t3 - 2].v.ob[1] = pauseCtx->mapPageVtx[phi_t3 - 1].v.ob[1] = - pauseCtx->mapPageVtx[phi_t3 - 4].v.ob[1] - 2; + pauseCtx->mapPageVtx[j - 2].v.ob[1] = pauseCtx->mapPageVtx[j - 1].v.ob[1] = + pauseCtx->mapPageVtx[j - 4].v.ob[1] - (WORLD_MAP_IMAGE_HEIGHT % WORLD_MAP_IMAGE_FRAG_HEIGHT); - pauseCtx->mapPageVtx[phi_t3 - 2].v.tc[1] = pauseCtx->mapPageVtx[phi_t3 - 1].v.tc[1] = 0x40; + pauseCtx->mapPageVtx[j - 2].v.tc[1] = pauseCtx->mapPageVtx[j - 1].v.tc[1] = + (WORLD_MAP_IMAGE_HEIGHT % WORLD_MAP_IMAGE_FRAG_HEIGHT) * (1 << 5); } else { - pauseCtx->mapPageVtx = GRAPH_ALLOC(gfxCtx, 128 * sizeof(Vtx)); - func_80823A0C(play, pauseCtx->mapPageVtx, 2, 17); + pauseCtx->mapPageVtx = GRAPH_ALLOC(gfxCtx, ((PAGE_BG_QUADS + VTX_PAGE_MAP_DUNGEON_QUADS) * 4) * sizeof(Vtx)); + KaleidoScope_SetPageVertices(play, pauseCtx->mapPageVtx, VTX_PAGE_MAP_DUNGEON, VTX_PAGE_MAP_DUNGEON_QUADS); } - pauseCtx->questPageVtx = GRAPH_ALLOC(gfxCtx, 60 * sizeof(Vtx)); - func_80823A0C(play, pauseCtx->questPageVtx, 3, 0); + pauseCtx->questPageVtx = GRAPH_ALLOC(gfxCtx, ((PAGE_BG_QUADS + VTX_PAGE_QUEST_QUADS) * 4) * sizeof(Vtx)); + KaleidoScope_SetPageVertices(play, pauseCtx->questPageVtx, VTX_PAGE_QUEST, VTX_PAGE_QUEST_QUADS); - pauseCtx->cursorVtx = GRAPH_ALLOC(gfxCtx, 20 * sizeof(Vtx)); + pauseCtx->cursorVtx = GRAPH_ALLOC(gfxCtx, (PAUSE_CURSOR_QUAD_MAX * 4) * sizeof(Vtx)); - for (phi_t2 = 0; phi_t2 < 20; phi_t2++) { - pauseCtx->cursorVtx[phi_t2].v.ob[0] = pauseCtx->cursorVtx[phi_t2].v.ob[1] = - pauseCtx->cursorVtx[phi_t2].v.ob[2] = 0; + for (i = 0; i < (PAUSE_CURSOR_QUAD_MAX * 4); i++) { + pauseCtx->cursorVtx[i].v.ob[0] = pauseCtx->cursorVtx[i].v.ob[1] = pauseCtx->cursorVtx[i].v.ob[2] = 0; - pauseCtx->cursorVtx[phi_t2].v.flag = 0; + pauseCtx->cursorVtx[i].v.flag = 0; - pauseCtx->cursorVtx[phi_t2].v.tc[0] = pauseCtx->cursorVtx[phi_t2].v.tc[1] = 0; + pauseCtx->cursorVtx[i].v.tc[0] = pauseCtx->cursorVtx[i].v.tc[1] = 0; - pauseCtx->cursorVtx[phi_t2].v.cn[0] = pauseCtx->cursorVtx[phi_t2].v.cn[1] = - pauseCtx->cursorVtx[phi_t2].v.cn[2] = pauseCtx->cursorVtx[phi_t2].v.cn[3] = 255; + pauseCtx->cursorVtx[i].v.cn[0] = pauseCtx->cursorVtx[i].v.cn[1] = pauseCtx->cursorVtx[i].v.cn[2] = + pauseCtx->cursorVtx[i].v.cn[3] = 255; } + // PAUSE_CURSOR_QUAD_TL pauseCtx->cursorVtx[1].v.tc[0] = pauseCtx->cursorVtx[2].v.tc[1] = pauseCtx->cursorVtx[3].v.tc[0] = - pauseCtx->cursorVtx[3].v.tc[1] = pauseCtx->cursorVtx[5].v.tc[0] = pauseCtx->cursorVtx[6].v.tc[1] = - pauseCtx->cursorVtx[7].v.tc[0] = pauseCtx->cursorVtx[7].v.tc[1] = pauseCtx->cursorVtx[9].v.tc[0] = - pauseCtx->cursorVtx[10].v.tc[1] = pauseCtx->cursorVtx[11].v.tc[0] = pauseCtx->cursorVtx[11].v.tc[1] = - pauseCtx->cursorVtx[13].v.tc[0] = pauseCtx->cursorVtx[14].v.tc[1] = - pauseCtx->cursorVtx[15].v.tc[0] = pauseCtx->cursorVtx[15].v.tc[1] = 0x200; - + pauseCtx->cursorVtx[3].v.tc[1] + // PAUSE_CURSOR_QUAD_TR + = pauseCtx->cursorVtx[5].v.tc[0] = pauseCtx->cursorVtx[6].v.tc[1] = pauseCtx->cursorVtx[7].v.tc[0] = + pauseCtx->cursorVtx[7].v.tc[1] + // PAUSE_CURSOR_QUAD_BL + = pauseCtx->cursorVtx[9].v.tc[0] = pauseCtx->cursorVtx[10].v.tc[1] = pauseCtx->cursorVtx[11].v.tc[0] = + pauseCtx->cursorVtx[11].v.tc[1] + // PAUSE_CURSOR_QUAD_BR + = pauseCtx->cursorVtx[13].v.tc[0] = pauseCtx->cursorVtx[14].v.tc[1] = pauseCtx->cursorVtx[15].v.tc[0] = + pauseCtx->cursorVtx[15].v.tc[1] = 16 * (1 << 5); + // PAUSE_CURSOR_QUAD_4 pauseCtx->cursorVtx[17].v.tc[0] = pauseCtx->cursorVtx[18].v.tc[1] = pauseCtx->cursorVtx[19].v.tc[0] = - pauseCtx->cursorVtx[19].v.tc[1] = 0x400; + pauseCtx->cursorVtx[19].v.tc[1] = 32 * (1 << 5); - pauseCtx->itemVtx = GRAPH_ALLOC(gfxCtx, 164 * sizeof(Vtx)); + pauseCtx->itemVtx = GRAPH_ALLOC(gfxCtx, (ITEM_QUAD_MAX * 4) * sizeof(Vtx)); - for (phi_t4 = 0, phi_t2 = 0, phi_t5 = 58; phi_t4 < 4; phi_t4++, phi_t5 -= 32) { - for (phi_t1 = -96, phi_t3 = 0; phi_t3 < 6; phi_t3++, phi_t2 += 4, phi_t1 += 32) { - pauseCtx->itemVtx[phi_t2 + 0].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 2].v.ob[0] = phi_t1 + 2; + // ITEM_QUAD_GRID_FIRST to ITEM_QUAD_GRID_LAST - pauseCtx->itemVtx[phi_t2 + 1].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 3].v.ob[0] = - pauseCtx->itemVtx[phi_t2 + 0].v.ob[0] + 0x1C; + for (k = 0, i = 0, y = (ITEM_GRID_ROWS * ITEM_GRID_CELL_HEIGHT) / 2 - 6; k < ITEM_GRID_ROWS; + k++, y -= ITEM_GRID_CELL_HEIGHT) { + for (x = 0 - (ITEM_GRID_COLS * ITEM_GRID_CELL_WIDTH) / 2, j = 0; j < ITEM_GRID_COLS; + j++, i += 4, x += ITEM_GRID_CELL_WIDTH) { + pauseCtx->itemVtx[i + 0].v.ob[0] = pauseCtx->itemVtx[i + 2].v.ob[0] = x + ITEM_GRID_QUAD_MARGIN; - pauseCtx->itemVtx[phi_t2 + 0].v.ob[1] = pauseCtx->itemVtx[phi_t2 + 1].v.ob[1] = - phi_t5 + pauseCtx->offsetY - 2; + pauseCtx->itemVtx[i + 1].v.ob[0] = pauseCtx->itemVtx[i + 3].v.ob[0] = + pauseCtx->itemVtx[i + 0].v.ob[0] + ITEM_GRID_QUAD_WIDTH; - pauseCtx->itemVtx[phi_t2 + 2].v.ob[1] = pauseCtx->itemVtx[phi_t2 + 3].v.ob[1] = - pauseCtx->itemVtx[phi_t2 + 0].v.ob[1] - 0x1C; + pauseCtx->itemVtx[i + 0].v.ob[1] = pauseCtx->itemVtx[i + 1].v.ob[1] = + y + pauseCtx->pagesYOrigin1 - ITEM_GRID_QUAD_MARGIN; - pauseCtx->itemVtx[phi_t2 + 0].v.ob[2] = pauseCtx->itemVtx[phi_t2 + 1].v.ob[2] = - pauseCtx->itemVtx[phi_t2 + 2].v.ob[2] = pauseCtx->itemVtx[phi_t2 + 3].v.ob[2] = 0; + pauseCtx->itemVtx[i + 2].v.ob[1] = pauseCtx->itemVtx[i + 3].v.ob[1] = + pauseCtx->itemVtx[i + 0].v.ob[1] - ITEM_GRID_QUAD_HEIGHT; - pauseCtx->itemVtx[phi_t2 + 0].v.flag = pauseCtx->itemVtx[phi_t2 + 1].v.flag = - pauseCtx->itemVtx[phi_t2 + 2].v.flag = pauseCtx->itemVtx[phi_t2 + 3].v.flag = 0; + pauseCtx->itemVtx[i + 0].v.ob[2] = pauseCtx->itemVtx[i + 1].v.ob[2] = pauseCtx->itemVtx[i + 2].v.ob[2] = + pauseCtx->itemVtx[i + 3].v.ob[2] = 0; - pauseCtx->itemVtx[phi_t2 + 0].v.tc[0] = pauseCtx->itemVtx[phi_t2 + 0].v.tc[1] = - pauseCtx->itemVtx[phi_t2 + 1].v.tc[1] = pauseCtx->itemVtx[phi_t2 + 2].v.tc[0] = 0; + pauseCtx->itemVtx[i + 0].v.flag = pauseCtx->itemVtx[i + 1].v.flag = pauseCtx->itemVtx[i + 2].v.flag = + pauseCtx->itemVtx[i + 3].v.flag = 0; - pauseCtx->itemVtx[phi_t2 + 1].v.tc[0] = pauseCtx->itemVtx[phi_t2 + 2].v.tc[1] = - pauseCtx->itemVtx[phi_t2 + 3].v.tc[0] = pauseCtx->itemVtx[phi_t2 + 3].v.tc[1] = 0x400; + pauseCtx->itemVtx[i + 0].v.tc[0] = pauseCtx->itemVtx[i + 0].v.tc[1] = pauseCtx->itemVtx[i + 1].v.tc[1] = + pauseCtx->itemVtx[i + 2].v.tc[0] = 0; - pauseCtx->itemVtx[phi_t2 + 0].v.cn[0] = pauseCtx->itemVtx[phi_t2 + 1].v.cn[0] = - pauseCtx->itemVtx[phi_t2 + 2].v.cn[0] = pauseCtx->itemVtx[phi_t2 + 3].v.cn[0] = - pauseCtx->itemVtx[phi_t2 + 0].v.cn[1] = pauseCtx->itemVtx[phi_t2 + 1].v.cn[1] = - pauseCtx->itemVtx[phi_t2 + 2].v.cn[1] = pauseCtx->itemVtx[phi_t2 + 3].v.cn[1] = - pauseCtx->itemVtx[phi_t2 + 0].v.cn[2] = pauseCtx->itemVtx[phi_t2 + 1].v.cn[2] = - pauseCtx->itemVtx[phi_t2 + 2].v.cn[2] = pauseCtx->itemVtx[phi_t2 + 3].v.cn[2] = 255; + pauseCtx->itemVtx[i + 1].v.tc[0] = pauseCtx->itemVtx[i + 2].v.tc[1] = pauseCtx->itemVtx[i + 3].v.tc[0] = + pauseCtx->itemVtx[i + 3].v.tc[1] = ITEM_GRID_QUAD_TEX_SIZE * (1 << 5); - pauseCtx->itemVtx[phi_t2 + 0].v.cn[3] = pauseCtx->itemVtx[phi_t2 + 1].v.cn[3] = - pauseCtx->itemVtx[phi_t2 + 2].v.cn[3] = pauseCtx->itemVtx[phi_t2 + 3].v.cn[3] = 255; + pauseCtx->itemVtx[i + 0].v.cn[0] = pauseCtx->itemVtx[i + 1].v.cn[0] = pauseCtx->itemVtx[i + 2].v.cn[0] = + pauseCtx->itemVtx[i + 3].v.cn[0] = pauseCtx->itemVtx[i + 0].v.cn[1] = pauseCtx->itemVtx[i + 1].v.cn[1] = + pauseCtx->itemVtx[i + 2].v.cn[1] = pauseCtx->itemVtx[i + 3].v.cn[1] = + pauseCtx->itemVtx[i + 0].v.cn[2] = pauseCtx->itemVtx[i + 1].v.cn[2] = + pauseCtx->itemVtx[i + 2].v.cn[2] = pauseCtx->itemVtx[i + 3].v.cn[2] = 255; + + pauseCtx->itemVtx[i + 0].v.cn[3] = pauseCtx->itemVtx[i + 1].v.cn[3] = pauseCtx->itemVtx[i + 2].v.cn[3] = + pauseCtx->itemVtx[i + 3].v.cn[3] = 255; } } - for (phi_t3 = 1; phi_t3 < 4; phi_t3++, phi_t2 += 4) { - if (gSaveContext.save.info.equips.cButtonSlots[phi_t3 - 1] != ITEM_NONE) { - phi_t4 = gSaveContext.save.info.equips.cButtonSlots[phi_t3 - 1] * 4; + // ITEM_QUAD_GRID_SELECTED_C_LEFT, ITEM_QUAD_GRID_SELECTED_C_DOWN, ITEM_QUAD_GRID_SELECTED_C_RIGHT + + for (j = 1; j < 4; j++, i += 4) { + if (gSaveContext.save.info.equips.cButtonSlots[j - 1] != ITEM_NONE) { + k = gSaveContext.save.info.equips.cButtonSlots[j - 1] * 4; - pauseCtx->itemVtx[phi_t2 + 0].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 2].v.ob[0] = - pauseCtx->itemVtx[phi_t4].v.ob[0] - 2; + pauseCtx->itemVtx[i + 0].v.ob[0] = pauseCtx->itemVtx[i + 2].v.ob[0] = + pauseCtx->itemVtx[k].v.ob[0] + ITEM_GRID_SELECTED_QUAD_MARGIN; - pauseCtx->itemVtx[phi_t2 + 1].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 3].v.ob[0] = - pauseCtx->itemVtx[phi_t2 + 0].v.ob[0] + 32; + pauseCtx->itemVtx[i + 1].v.ob[0] = pauseCtx->itemVtx[i + 3].v.ob[0] = + pauseCtx->itemVtx[i + 0].v.ob[0] + ITEM_GRID_SELECTED_QUAD_WIDTH; - pauseCtx->itemVtx[phi_t2 + 0].v.ob[1] = pauseCtx->itemVtx[phi_t2 + 1].v.ob[1] = - pauseCtx->itemVtx[phi_t4].v.ob[1] + 2; + pauseCtx->itemVtx[i + 0].v.ob[1] = pauseCtx->itemVtx[i + 1].v.ob[1] = + pauseCtx->itemVtx[k].v.ob[1] - ITEM_GRID_SELECTED_QUAD_MARGIN; - pauseCtx->itemVtx[phi_t2 + 2].v.ob[1] = pauseCtx->itemVtx[phi_t2 + 3].v.ob[1] = - pauseCtx->itemVtx[phi_t2 + 0].v.ob[1] - 32; + pauseCtx->itemVtx[i + 2].v.ob[1] = pauseCtx->itemVtx[i + 3].v.ob[1] = + pauseCtx->itemVtx[i + 0].v.ob[1] - ITEM_GRID_SELECTED_QUAD_HEIGHT; - pauseCtx->itemVtx[phi_t2 + 0].v.ob[2] = pauseCtx->itemVtx[phi_t2 + 1].v.ob[2] = - pauseCtx->itemVtx[phi_t2 + 2].v.ob[2] = pauseCtx->itemVtx[phi_t2 + 3].v.ob[2] = 0; + pauseCtx->itemVtx[i + 0].v.ob[2] = pauseCtx->itemVtx[i + 1].v.ob[2] = pauseCtx->itemVtx[i + 2].v.ob[2] = + pauseCtx->itemVtx[i + 3].v.ob[2] = 0; - pauseCtx->itemVtx[phi_t2 + 0].v.flag = pauseCtx->itemVtx[phi_t2 + 1].v.flag = - pauseCtx->itemVtx[phi_t2 + 2].v.flag = pauseCtx->itemVtx[phi_t2 + 3].v.flag = 0; + pauseCtx->itemVtx[i + 0].v.flag = pauseCtx->itemVtx[i + 1].v.flag = pauseCtx->itemVtx[i + 2].v.flag = + pauseCtx->itemVtx[i + 3].v.flag = 0; - pauseCtx->itemVtx[phi_t2 + 0].v.tc[0] = pauseCtx->itemVtx[phi_t2 + 0].v.tc[1] = - pauseCtx->itemVtx[phi_t2 + 1].v.tc[1] = pauseCtx->itemVtx[phi_t2 + 2].v.tc[0] = 0; + pauseCtx->itemVtx[i + 0].v.tc[0] = pauseCtx->itemVtx[i + 0].v.tc[1] = pauseCtx->itemVtx[i + 1].v.tc[1] = + pauseCtx->itemVtx[i + 2].v.tc[0] = 0; - pauseCtx->itemVtx[phi_t2 + 1].v.tc[0] = pauseCtx->itemVtx[phi_t2 + 2].v.tc[1] = - pauseCtx->itemVtx[phi_t2 + 3].v.tc[0] = pauseCtx->itemVtx[phi_t2 + 3].v.tc[1] = 0x400; + pauseCtx->itemVtx[i + 1].v.tc[0] = pauseCtx->itemVtx[i + 2].v.tc[1] = pauseCtx->itemVtx[i + 3].v.tc[0] = + pauseCtx->itemVtx[i + 3].v.tc[1] = ITEM_GRID_SELECTED_QUAD_TEX_SIZE * (1 << 5); - pauseCtx->itemVtx[phi_t2 + 0].v.cn[0] = pauseCtx->itemVtx[phi_t2 + 1].v.cn[0] = - pauseCtx->itemVtx[phi_t2 + 2].v.cn[0] = pauseCtx->itemVtx[phi_t2 + 3].v.cn[0] = - pauseCtx->itemVtx[phi_t2 + 0].v.cn[1] = pauseCtx->itemVtx[phi_t2 + 1].v.cn[1] = - pauseCtx->itemVtx[phi_t2 + 2].v.cn[1] = pauseCtx->itemVtx[phi_t2 + 3].v.cn[1] = - pauseCtx->itemVtx[phi_t2 + 0].v.cn[2] = pauseCtx->itemVtx[phi_t2 + 1].v.cn[2] = - pauseCtx->itemVtx[phi_t2 + 2].v.cn[2] = pauseCtx->itemVtx[phi_t2 + 3].v.cn[2] = 255; + pauseCtx->itemVtx[i + 0].v.cn[0] = pauseCtx->itemVtx[i + 1].v.cn[0] = pauseCtx->itemVtx[i + 2].v.cn[0] = + pauseCtx->itemVtx[i + 3].v.cn[0] = pauseCtx->itemVtx[i + 0].v.cn[1] = pauseCtx->itemVtx[i + 1].v.cn[1] = + pauseCtx->itemVtx[i + 2].v.cn[1] = pauseCtx->itemVtx[i + 3].v.cn[1] = + pauseCtx->itemVtx[i + 0].v.cn[2] = pauseCtx->itemVtx[i + 1].v.cn[2] = + pauseCtx->itemVtx[i + 2].v.cn[2] = pauseCtx->itemVtx[i + 3].v.cn[2] = 255; - pauseCtx->itemVtx[phi_t2 + 0].v.cn[3] = pauseCtx->itemVtx[phi_t2 + 1].v.cn[3] = - pauseCtx->itemVtx[phi_t2 + 2].v.cn[3] = pauseCtx->itemVtx[phi_t2 + 3].v.cn[3] = pauseCtx->alpha; + pauseCtx->itemVtx[i + 0].v.cn[3] = pauseCtx->itemVtx[i + 1].v.cn[3] = pauseCtx->itemVtx[i + 2].v.cn[3] = + pauseCtx->itemVtx[i + 3].v.cn[3] = pauseCtx->alpha; } else { - pauseCtx->itemVtx[phi_t2 + 0].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 2].v.ob[0] = -300; + // No item equipped on the C button, put the quad out of view - pauseCtx->itemVtx[phi_t2 + 1].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 3].v.ob[0] = - pauseCtx->itemVtx[phi_t2 + 0].v.ob[0] + 32; + pauseCtx->itemVtx[i + 0].v.ob[0] = pauseCtx->itemVtx[i + 2].v.ob[0] = -300; - pauseCtx->itemVtx[phi_t2 + 0].v.ob[1] = pauseCtx->itemVtx[phi_t2 + 1].v.ob[1] = 300; + pauseCtx->itemVtx[i + 1].v.ob[0] = pauseCtx->itemVtx[i + 3].v.ob[0] = + pauseCtx->itemVtx[i + 0].v.ob[0] + ITEM_GRID_SELECTED_QUAD_WIDTH; - pauseCtx->itemVtx[phi_t2 + 2].v.ob[1] = pauseCtx->itemVtx[phi_t2 + 3].v.ob[1] = - pauseCtx->itemVtx[phi_t2 + 0].v.ob[1] - 32; + pauseCtx->itemVtx[i + 0].v.ob[1] = pauseCtx->itemVtx[i + 1].v.ob[1] = 300; + + pauseCtx->itemVtx[i + 2].v.ob[1] = pauseCtx->itemVtx[i + 3].v.ob[1] = + pauseCtx->itemVtx[i + 0].v.ob[1] - ITEM_GRID_SELECTED_QUAD_HEIGHT; } } - for (phi_t2 = 108, phi_t3 = 0; phi_t3 < 7; phi_t3++) { - phi_t4 = D_8082B11C[phi_t3]; + // ITEM_QUAD_AMMO_* + + for (i = ITEM_QUAD_AMMO_FIRST * 4, j = 0; j < 7; j++) { + k = sItemVtxQuadsWithAmmo[j]; + + // tens - pauseCtx->itemVtx[phi_t2 + 0].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 2].v.ob[0] = - pauseCtx->itemVtx[phi_t4].v.ob[0]; + pauseCtx->itemVtx[i + 0].v.ob[0] = pauseCtx->itemVtx[i + 2].v.ob[0] = + pauseCtx->itemVtx[k].v.ob[0] + ITEM_AMMO_TENS_QUAD_OFFSET_X; - pauseCtx->itemVtx[phi_t2 + 1].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 3].v.ob[0] = - pauseCtx->itemVtx[phi_t2 + 0].v.ob[0] + 8; + pauseCtx->itemVtx[i + 1].v.ob[0] = pauseCtx->itemVtx[i + 3].v.ob[0] = + pauseCtx->itemVtx[i + 0].v.ob[0] + ITEM_AMMO_DIGIT_QUAD_WIDTH; - pauseCtx->itemVtx[phi_t2 + 0].v.ob[1] = pauseCtx->itemVtx[phi_t2 + 1].v.ob[1] = - pauseCtx->itemVtx[phi_t4].v.ob[1] - 22; + pauseCtx->itemVtx[i + 0].v.ob[1] = pauseCtx->itemVtx[i + 1].v.ob[1] = + pauseCtx->itemVtx[k].v.ob[1] - ITEM_AMMO_TENS_QUAD_OFFSET_Y; - pauseCtx->itemVtx[phi_t2 + 2].v.ob[1] = pauseCtx->itemVtx[phi_t2 + 3].v.ob[1] = - pauseCtx->itemVtx[phi_t2 + 0].v.ob[1] - 8; + pauseCtx->itemVtx[i + 2].v.ob[1] = pauseCtx->itemVtx[i + 3].v.ob[1] = + pauseCtx->itemVtx[i + 0].v.ob[1] - ITEM_AMMO_DIGIT_QUAD_HEIGHT; - pauseCtx->itemVtx[phi_t2 + 4].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 6].v.ob[0] = - pauseCtx->itemVtx[phi_t2 + 0].v.ob[0] + 6; + // ones - pauseCtx->itemVtx[phi_t2 + 5].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 7].v.ob[0] = - pauseCtx->itemVtx[phi_t2 + 4].v.ob[0] + 8; + pauseCtx->itemVtx[i + 4].v.ob[0] = pauseCtx->itemVtx[i + 6].v.ob[0] = + pauseCtx->itemVtx[i + 0].v.ob[0] + ITEM_AMMO_ONES_QUAD_OFFSET_X; - pauseCtx->itemVtx[phi_t2 + 4].v.ob[1] = pauseCtx->itemVtx[phi_t2 + 5].v.ob[1] = - pauseCtx->itemVtx[phi_t2 + 0].v.ob[1]; + pauseCtx->itemVtx[i + 5].v.ob[0] = pauseCtx->itemVtx[i + 7].v.ob[0] = + pauseCtx->itemVtx[i + 4].v.ob[0] + ITEM_AMMO_DIGIT_QUAD_WIDTH; - pauseCtx->itemVtx[phi_t2 + 6].v.ob[1] = pauseCtx->itemVtx[phi_t2 + 7].v.ob[1] = - pauseCtx->itemVtx[phi_t2 + 4].v.ob[1] - 8; + pauseCtx->itemVtx[i + 4].v.ob[1] = pauseCtx->itemVtx[i + 5].v.ob[1] = + pauseCtx->itemVtx[i + 0].v.ob[1] - ITEM_AMMO_ONES_QUAD_OFFSET_Y; - for (phi_t4 = 0; phi_t4 < 2; phi_t4++, phi_t2 += 4) { - pauseCtx->itemVtx[phi_t2 + 0].v.ob[2] = pauseCtx->itemVtx[phi_t2 + 1].v.ob[2] = - pauseCtx->itemVtx[phi_t2 + 2].v.ob[2] = pauseCtx->itemVtx[phi_t2 + 3].v.ob[2] = 0; + pauseCtx->itemVtx[i + 6].v.ob[1] = pauseCtx->itemVtx[i + 7].v.ob[1] = + pauseCtx->itemVtx[i + 4].v.ob[1] - ITEM_AMMO_DIGIT_QUAD_HEIGHT; - pauseCtx->itemVtx[phi_t2 + 0].v.flag = pauseCtx->itemVtx[phi_t2 + 1].v.flag = - pauseCtx->itemVtx[phi_t2 + 2].v.flag = pauseCtx->itemVtx[phi_t2 + 3].v.flag = 0; + // tens, ones - pauseCtx->itemVtx[phi_t2 + 0].v.tc[0] = pauseCtx->itemVtx[phi_t2 + 0].v.tc[1] = - pauseCtx->itemVtx[phi_t2 + 1].v.tc[1] = pauseCtx->itemVtx[phi_t2 + 2].v.tc[0] = 0; + for (k = 0; k < 2; k++, i += 4) { + pauseCtx->itemVtx[i + 0].v.ob[2] = pauseCtx->itemVtx[i + 1].v.ob[2] = pauseCtx->itemVtx[i + 2].v.ob[2] = + pauseCtx->itemVtx[i + 3].v.ob[2] = 0; - pauseCtx->itemVtx[phi_t2 + 1].v.tc[0] = pauseCtx->itemVtx[phi_t2 + 2].v.tc[1] = - pauseCtx->itemVtx[phi_t2 + 3].v.tc[0] = pauseCtx->itemVtx[phi_t2 + 3].v.tc[1] = 0x100; + pauseCtx->itemVtx[i + 0].v.flag = pauseCtx->itemVtx[i + 1].v.flag = pauseCtx->itemVtx[i + 2].v.flag = + pauseCtx->itemVtx[i + 3].v.flag = 0; - pauseCtx->itemVtx[phi_t2 + 0].v.cn[0] = pauseCtx->itemVtx[phi_t2 + 1].v.cn[0] = - pauseCtx->itemVtx[phi_t2 + 2].v.cn[0] = pauseCtx->itemVtx[phi_t2 + 3].v.cn[0] = - pauseCtx->itemVtx[phi_t2 + 0].v.cn[1] = pauseCtx->itemVtx[phi_t2 + 1].v.cn[1] = - pauseCtx->itemVtx[phi_t2 + 2].v.cn[1] = pauseCtx->itemVtx[phi_t2 + 3].v.cn[1] = - pauseCtx->itemVtx[phi_t2 + 0].v.cn[2] = pauseCtx->itemVtx[phi_t2 + 1].v.cn[2] = - pauseCtx->itemVtx[phi_t2 + 2].v.cn[2] = pauseCtx->itemVtx[phi_t2 + 3].v.cn[2] = 255; + pauseCtx->itemVtx[i + 0].v.tc[0] = pauseCtx->itemVtx[i + 0].v.tc[1] = pauseCtx->itemVtx[i + 1].v.tc[1] = + pauseCtx->itemVtx[i + 2].v.tc[0] = 0; - pauseCtx->itemVtx[phi_t2 + 0].v.cn[3] = pauseCtx->itemVtx[phi_t2 + 1].v.cn[3] = - pauseCtx->itemVtx[phi_t2 + 2].v.cn[3] = pauseCtx->itemVtx[phi_t2 + 3].v.cn[3] = pauseCtx->alpha; + pauseCtx->itemVtx[i + 1].v.tc[0] = pauseCtx->itemVtx[i + 2].v.tc[1] = pauseCtx->itemVtx[i + 3].v.tc[0] = + pauseCtx->itemVtx[i + 3].v.tc[1] = ITEM_AMMO_DIGIT_QUAD_TEX_SIZE * (1 << 5); + + pauseCtx->itemVtx[i + 0].v.cn[0] = pauseCtx->itemVtx[i + 1].v.cn[0] = pauseCtx->itemVtx[i + 2].v.cn[0] = + pauseCtx->itemVtx[i + 3].v.cn[0] = pauseCtx->itemVtx[i + 0].v.cn[1] = pauseCtx->itemVtx[i + 1].v.cn[1] = + pauseCtx->itemVtx[i + 2].v.cn[1] = pauseCtx->itemVtx[i + 3].v.cn[1] = + pauseCtx->itemVtx[i + 0].v.cn[2] = pauseCtx->itemVtx[i + 1].v.cn[2] = + pauseCtx->itemVtx[i + 2].v.cn[2] = pauseCtx->itemVtx[i + 3].v.cn[2] = 255; + + pauseCtx->itemVtx[i + 0].v.cn[3] = pauseCtx->itemVtx[i + 1].v.cn[3] = pauseCtx->itemVtx[i + 2].v.cn[3] = + pauseCtx->itemVtx[i + 3].v.cn[3] = pauseCtx->alpha; } } pauseCtx->equipVtx = GRAPH_ALLOC(gfxCtx, 112 * sizeof(Vtx)); - for (phi_t4 = 0, phi_t2 = 0, phi_t5 = 58; phi_t2 < 4; phi_t2++, phi_t5 -= 32) { - for (phi_t3 = 0; phi_t3 < 4; phi_t3++, phi_t4 += 4) { - pauseCtx->equipVtx[phi_t4 + 0].v.ob[0] = pauseCtx->equipVtx[phi_t4 + 2].v.ob[0] = D_8082B12C[phi_t3] + 2; + for (k = 0, i = 0, y = 58; i < 4; i++, y -= 32) { + for (j = 0; j < 4; j++, k += 4) { + pauseCtx->equipVtx[k + 0].v.ob[0] = pauseCtx->equipVtx[k + 2].v.ob[0] = D_8082B12C[j] + 2; - pauseCtx->equipVtx[phi_t4 + 1].v.ob[0] = pauseCtx->equipVtx[phi_t4 + 3].v.ob[0] = - pauseCtx->equipVtx[phi_t4 + 0].v.ob[0] + 28; + pauseCtx->equipVtx[k + 1].v.ob[0] = pauseCtx->equipVtx[k + 3].v.ob[0] = + pauseCtx->equipVtx[k + 0].v.ob[0] + 28; - pauseCtx->equipVtx[phi_t4 + 0].v.ob[1] = pauseCtx->equipVtx[phi_t4 + 1].v.ob[1] = - phi_t5 + pauseCtx->offsetY - 2; + pauseCtx->equipVtx[k + 0].v.ob[1] = pauseCtx->equipVtx[k + 1].v.ob[1] = y + pauseCtx->pagesYOrigin1 - 2; - pauseCtx->equipVtx[phi_t4 + 2].v.ob[1] = pauseCtx->equipVtx[phi_t4 + 3].v.ob[1] = - pauseCtx->equipVtx[phi_t4 + 0].v.ob[1] - 28; + pauseCtx->equipVtx[k + 2].v.ob[1] = pauseCtx->equipVtx[k + 3].v.ob[1] = + pauseCtx->equipVtx[k + 0].v.ob[1] - 28; - pauseCtx->equipVtx[phi_t4 + 0].v.ob[2] = pauseCtx->equipVtx[phi_t4 + 1].v.ob[2] = - pauseCtx->equipVtx[phi_t4 + 2].v.ob[2] = pauseCtx->equipVtx[phi_t4 + 3].v.ob[2] = 0; + pauseCtx->equipVtx[k + 0].v.ob[2] = pauseCtx->equipVtx[k + 1].v.ob[2] = pauseCtx->equipVtx[k + 2].v.ob[2] = + pauseCtx->equipVtx[k + 3].v.ob[2] = 0; - pauseCtx->equipVtx[phi_t4 + 0].v.flag = pauseCtx->equipVtx[phi_t4 + 1].v.flag = - pauseCtx->equipVtx[phi_t4 + 2].v.flag = pauseCtx->equipVtx[phi_t4 + 3].v.flag = 0; + pauseCtx->equipVtx[k + 0].v.flag = pauseCtx->equipVtx[k + 1].v.flag = pauseCtx->equipVtx[k + 2].v.flag = + pauseCtx->equipVtx[k + 3].v.flag = 0; - pauseCtx->equipVtx[phi_t4 + 0].v.tc[0] = pauseCtx->equipVtx[phi_t4 + 0].v.tc[1] = - pauseCtx->equipVtx[phi_t4 + 1].v.tc[1] = pauseCtx->equipVtx[phi_t4 + 2].v.tc[0] = 0; + pauseCtx->equipVtx[k + 0].v.tc[0] = pauseCtx->equipVtx[k + 0].v.tc[1] = pauseCtx->equipVtx[k + 1].v.tc[1] = + pauseCtx->equipVtx[k + 2].v.tc[0] = 0; - pauseCtx->equipVtx[phi_t4 + 1].v.tc[0] = pauseCtx->equipVtx[phi_t4 + 2].v.tc[1] = - pauseCtx->equipVtx[phi_t4 + 3].v.tc[0] = pauseCtx->equipVtx[phi_t4 + 3].v.tc[1] = 0x400; + pauseCtx->equipVtx[k + 1].v.tc[0] = pauseCtx->equipVtx[k + 2].v.tc[1] = pauseCtx->equipVtx[k + 3].v.tc[0] = + pauseCtx->equipVtx[k + 3].v.tc[1] = 0x400; - pauseCtx->equipVtx[phi_t4 + 0].v.cn[0] = pauseCtx->equipVtx[phi_t4 + 1].v.cn[0] = - pauseCtx->equipVtx[phi_t4 + 2].v.cn[0] = pauseCtx->equipVtx[phi_t4 + 3].v.cn[0] = - pauseCtx->equipVtx[phi_t4 + 0].v.cn[1] = pauseCtx->equipVtx[phi_t4 + 1].v.cn[1] = - pauseCtx->equipVtx[phi_t4 + 2].v.cn[1] = pauseCtx->equipVtx[phi_t4 + 3].v.cn[1] = - pauseCtx->equipVtx[phi_t4 + 0].v.cn[2] = pauseCtx->equipVtx[phi_t4 + 1].v.cn[2] = - pauseCtx->equipVtx[phi_t4 + 2].v.cn[2] = pauseCtx->equipVtx[phi_t4 + 3].v.cn[2] = 255; + pauseCtx->equipVtx[k + 0].v.cn[0] = pauseCtx->equipVtx[k + 1].v.cn[0] = pauseCtx->equipVtx[k + 2].v.cn[0] = + pauseCtx->equipVtx[k + 3].v.cn[0] = pauseCtx->equipVtx[k + 0].v.cn[1] = + pauseCtx->equipVtx[k + 1].v.cn[1] = pauseCtx->equipVtx[k + 2].v.cn[1] = + pauseCtx->equipVtx[k + 3].v.cn[1] = pauseCtx->equipVtx[k + 0].v.cn[2] = + pauseCtx->equipVtx[k + 1].v.cn[2] = pauseCtx->equipVtx[k + 2].v.cn[2] = + pauseCtx->equipVtx[k + 3].v.cn[2] = 255; - pauseCtx->equipVtx[phi_t4 + 0].v.cn[3] = pauseCtx->equipVtx[phi_t4 + 1].v.cn[3] = - pauseCtx->equipVtx[phi_t4 + 2].v.cn[3] = pauseCtx->equipVtx[phi_t4 + 3].v.cn[3] = pauseCtx->alpha; + pauseCtx->equipVtx[k + 0].v.cn[3] = pauseCtx->equipVtx[k + 1].v.cn[3] = pauseCtx->equipVtx[k + 2].v.cn[3] = + pauseCtx->equipVtx[k + 3].v.cn[3] = pauseCtx->alpha; } } - for (phi_t3 = 0; phi_t3 < 4; phi_t3++, phi_t4 += 4) { - if (CUR_EQUIP_VALUE(phi_t3) != 0) { - phi_t2 = (CUR_EQUIP_VALUE(phi_t3) + D_8082B134[phi_t3] - 1) * 4; + for (j = 0; j < 4; j++, k += 4) { + if (CUR_EQUIP_VALUE(j) != 0) { + i = (CUR_EQUIP_VALUE(j) + D_8082B134[j] - 1) * 4; - pauseCtx->equipVtx[phi_t4 + 0].v.ob[0] = pauseCtx->equipVtx[phi_t4 + 2].v.ob[0] = - pauseCtx->equipVtx[phi_t2].v.ob[0] - 2; + pauseCtx->equipVtx[k + 0].v.ob[0] = pauseCtx->equipVtx[k + 2].v.ob[0] = pauseCtx->equipVtx[i].v.ob[0] - 2; - pauseCtx->equipVtx[phi_t4 + 1].v.ob[0] = pauseCtx->equipVtx[phi_t4 + 3].v.ob[0] = - pauseCtx->equipVtx[phi_t4 + 0].v.ob[0] + 32; + pauseCtx->equipVtx[k + 1].v.ob[0] = pauseCtx->equipVtx[k + 3].v.ob[0] = + pauseCtx->equipVtx[k + 0].v.ob[0] + 32; - pauseCtx->equipVtx[phi_t4 + 0].v.ob[1] = pauseCtx->equipVtx[phi_t4 + 1].v.ob[1] = - pauseCtx->equipVtx[phi_t2].v.ob[1] + 2; + pauseCtx->equipVtx[k + 0].v.ob[1] = pauseCtx->equipVtx[k + 1].v.ob[1] = pauseCtx->equipVtx[i].v.ob[1] + 2; - pauseCtx->equipVtx[phi_t4 + 2].v.ob[1] = pauseCtx->equipVtx[phi_t4 + 3].v.ob[1] = - pauseCtx->equipVtx[phi_t4 + 0].v.ob[1] - 32; + pauseCtx->equipVtx[k + 2].v.ob[1] = pauseCtx->equipVtx[k + 3].v.ob[1] = + pauseCtx->equipVtx[k + 0].v.ob[1] - 32; - pauseCtx->equipVtx[phi_t4 + 0].v.ob[2] = pauseCtx->equipVtx[phi_t4 + 1].v.ob[2] = - pauseCtx->equipVtx[phi_t4 + 2].v.ob[2] = pauseCtx->equipVtx[phi_t4 + 3].v.ob[2] = 0; + pauseCtx->equipVtx[k + 0].v.ob[2] = pauseCtx->equipVtx[k + 1].v.ob[2] = pauseCtx->equipVtx[k + 2].v.ob[2] = + pauseCtx->equipVtx[k + 3].v.ob[2] = 0; - pauseCtx->equipVtx[phi_t4 + 0].v.flag = pauseCtx->equipVtx[phi_t4 + 1].v.flag = - pauseCtx->equipVtx[phi_t4 + 2].v.flag = pauseCtx->equipVtx[phi_t4 + 3].v.flag = 0; + pauseCtx->equipVtx[k + 0].v.flag = pauseCtx->equipVtx[k + 1].v.flag = pauseCtx->equipVtx[k + 2].v.flag = + pauseCtx->equipVtx[k + 3].v.flag = 0; - pauseCtx->equipVtx[phi_t4 + 0].v.tc[0] = pauseCtx->equipVtx[phi_t4 + 0].v.tc[1] = - pauseCtx->equipVtx[phi_t4 + 1].v.tc[1] = pauseCtx->equipVtx[phi_t4 + 2].v.tc[0] = 0; + pauseCtx->equipVtx[k + 0].v.tc[0] = pauseCtx->equipVtx[k + 0].v.tc[1] = pauseCtx->equipVtx[k + 1].v.tc[1] = + pauseCtx->equipVtx[k + 2].v.tc[0] = 0; - pauseCtx->equipVtx[phi_t4 + 1].v.tc[0] = pauseCtx->equipVtx[phi_t4 + 2].v.tc[1] = - pauseCtx->equipVtx[phi_t4 + 3].v.tc[0] = pauseCtx->equipVtx[phi_t4 + 3].v.tc[1] = 0x400; + pauseCtx->equipVtx[k + 1].v.tc[0] = pauseCtx->equipVtx[k + 2].v.tc[1] = pauseCtx->equipVtx[k + 3].v.tc[0] = + pauseCtx->equipVtx[k + 3].v.tc[1] = 0x400; - pauseCtx->equipVtx[phi_t4 + 0].v.cn[0] = pauseCtx->equipVtx[phi_t4 + 1].v.cn[0] = - pauseCtx->equipVtx[phi_t4 + 2].v.cn[0] = pauseCtx->equipVtx[phi_t4 + 3].v.cn[0] = - pauseCtx->equipVtx[phi_t4 + 0].v.cn[1] = pauseCtx->equipVtx[phi_t4 + 1].v.cn[1] = - pauseCtx->equipVtx[phi_t4 + 2].v.cn[1] = pauseCtx->equipVtx[phi_t4 + 3].v.cn[1] = - pauseCtx->equipVtx[phi_t4 + 0].v.cn[2] = pauseCtx->equipVtx[phi_t4 + 1].v.cn[2] = - pauseCtx->equipVtx[phi_t4 + 2].v.cn[2] = pauseCtx->equipVtx[phi_t4 + 3].v.cn[2] = 255; + pauseCtx->equipVtx[k + 0].v.cn[0] = pauseCtx->equipVtx[k + 1].v.cn[0] = pauseCtx->equipVtx[k + 2].v.cn[0] = + pauseCtx->equipVtx[k + 3].v.cn[0] = pauseCtx->equipVtx[k + 0].v.cn[1] = + pauseCtx->equipVtx[k + 1].v.cn[1] = pauseCtx->equipVtx[k + 2].v.cn[1] = + pauseCtx->equipVtx[k + 3].v.cn[1] = pauseCtx->equipVtx[k + 0].v.cn[2] = + pauseCtx->equipVtx[k + 1].v.cn[2] = pauseCtx->equipVtx[k + 2].v.cn[2] = + pauseCtx->equipVtx[k + 3].v.cn[2] = 255; - pauseCtx->equipVtx[phi_t4 + 0].v.cn[3] = pauseCtx->equipVtx[phi_t4 + 1].v.cn[3] = - pauseCtx->equipVtx[phi_t4 + 2].v.cn[3] = pauseCtx->equipVtx[phi_t4 + 3].v.cn[3] = pauseCtx->alpha; + pauseCtx->equipVtx[k + 0].v.cn[3] = pauseCtx->equipVtx[k + 1].v.cn[3] = pauseCtx->equipVtx[k + 2].v.cn[3] = + pauseCtx->equipVtx[k + 3].v.cn[3] = pauseCtx->alpha; } } - phi_t1 = 112; - phi_t5 = 50; + x = 112; + y = 50; while (true) { - pauseCtx->equipVtx[phi_t4 + 0].v.ob[0] = pauseCtx->equipVtx[phi_t4 + 2].v.ob[0] = -64; + pauseCtx->equipVtx[k + 0].v.ob[0] = pauseCtx->equipVtx[k + 2].v.ob[0] = -64; - pauseCtx->equipVtx[phi_t4 + 1].v.ob[0] = pauseCtx->equipVtx[phi_t4 + 3].v.ob[0] = - pauseCtx->equipVtx[phi_t4 + 0].v.ob[0] + 64; + pauseCtx->equipVtx[k + 1].v.ob[0] = pauseCtx->equipVtx[k + 3].v.ob[0] = pauseCtx->equipVtx[k + 0].v.ob[0] + 64; - pauseCtx->equipVtx[phi_t4 + 0].v.ob[1] = pauseCtx->equipVtx[phi_t4 + 1].v.ob[1] = phi_t5 + pauseCtx->offsetY; + pauseCtx->equipVtx[k + 0].v.ob[1] = pauseCtx->equipVtx[k + 1].v.ob[1] = y + pauseCtx->pagesYOrigin1; - pauseCtx->equipVtx[phi_t4 + 2].v.ob[1] = pauseCtx->equipVtx[phi_t4 + 3].v.ob[1] = - pauseCtx->equipVtx[phi_t4 + 0].v.ob[1] - 32; + pauseCtx->equipVtx[k + 2].v.ob[1] = pauseCtx->equipVtx[k + 3].v.ob[1] = pauseCtx->equipVtx[k + 0].v.ob[1] - 32; - pauseCtx->equipVtx[phi_t4 + 0].v.ob[2] = pauseCtx->equipVtx[phi_t4 + 1].v.ob[2] = - pauseCtx->equipVtx[phi_t4 + 2].v.ob[2] = pauseCtx->equipVtx[phi_t4 + 3].v.ob[2] = 0; + pauseCtx->equipVtx[k + 0].v.ob[2] = pauseCtx->equipVtx[k + 1].v.ob[2] = pauseCtx->equipVtx[k + 2].v.ob[2] = + pauseCtx->equipVtx[k + 3].v.ob[2] = 0; - pauseCtx->equipVtx[phi_t4 + 0].v.flag = pauseCtx->equipVtx[phi_t4 + 1].v.flag = - pauseCtx->equipVtx[phi_t4 + 2].v.flag = pauseCtx->equipVtx[phi_t4 + 3].v.flag = 0; + pauseCtx->equipVtx[k + 0].v.flag = pauseCtx->equipVtx[k + 1].v.flag = pauseCtx->equipVtx[k + 2].v.flag = + pauseCtx->equipVtx[k + 3].v.flag = 0; - pauseCtx->equipVtx[phi_t4 + 0].v.tc[0] = pauseCtx->equipVtx[phi_t4 + 0].v.tc[1] = - pauseCtx->equipVtx[phi_t4 + 1].v.tc[1] = pauseCtx->equipVtx[phi_t4 + 2].v.tc[0] = 0; + pauseCtx->equipVtx[k + 0].v.tc[0] = pauseCtx->equipVtx[k + 0].v.tc[1] = pauseCtx->equipVtx[k + 1].v.tc[1] = + pauseCtx->equipVtx[k + 2].v.tc[0] = 0; - pauseCtx->equipVtx[phi_t4 + 1].v.tc[0] = pauseCtx->equipVtx[phi_t4 + 3].v.tc[0] = 0x800; + pauseCtx->equipVtx[k + 1].v.tc[0] = pauseCtx->equipVtx[k + 3].v.tc[0] = 0x800; - pauseCtx->equipVtx[phi_t4 + 2].v.tc[1] = pauseCtx->equipVtx[phi_t4 + 3].v.tc[1] = 0x400; + pauseCtx->equipVtx[k + 2].v.tc[1] = pauseCtx->equipVtx[k + 3].v.tc[1] = 0x400; - pauseCtx->equipVtx[phi_t4 + 0].v.cn[0] = pauseCtx->equipVtx[phi_t4 + 1].v.cn[0] = - pauseCtx->equipVtx[phi_t4 + 2].v.cn[0] = pauseCtx->equipVtx[phi_t4 + 3].v.cn[0] = - pauseCtx->equipVtx[phi_t4 + 0].v.cn[1] = pauseCtx->equipVtx[phi_t4 + 1].v.cn[1] = - pauseCtx->equipVtx[phi_t4 + 2].v.cn[1] = pauseCtx->equipVtx[phi_t4 + 3].v.cn[1] = - pauseCtx->equipVtx[phi_t4 + 0].v.cn[2] = pauseCtx->equipVtx[phi_t4 + 1].v.cn[2] = - pauseCtx->equipVtx[phi_t4 + 2].v.cn[2] = pauseCtx->equipVtx[phi_t4 + 3].v.cn[2] = 255; + pauseCtx->equipVtx[k + 0].v.cn[0] = pauseCtx->equipVtx[k + 1].v.cn[0] = pauseCtx->equipVtx[k + 2].v.cn[0] = + pauseCtx->equipVtx[k + 3].v.cn[0] = pauseCtx->equipVtx[k + 0].v.cn[1] = pauseCtx->equipVtx[k + 1].v.cn[1] = + pauseCtx->equipVtx[k + 2].v.cn[1] = pauseCtx->equipVtx[k + 3].v.cn[1] = + pauseCtx->equipVtx[k + 0].v.cn[2] = pauseCtx->equipVtx[k + 1].v.cn[2] = + pauseCtx->equipVtx[k + 2].v.cn[2] = pauseCtx->equipVtx[k + 3].v.cn[2] = 255; - pauseCtx->equipVtx[phi_t4 + 0].v.cn[3] = pauseCtx->equipVtx[phi_t4 + 1].v.cn[3] = - pauseCtx->equipVtx[phi_t4 + 2].v.cn[3] = pauseCtx->equipVtx[phi_t4 + 3].v.cn[3] = pauseCtx->alpha; + pauseCtx->equipVtx[k + 0].v.cn[3] = pauseCtx->equipVtx[k + 1].v.cn[3] = pauseCtx->equipVtx[k + 2].v.cn[3] = + pauseCtx->equipVtx[k + 3].v.cn[3] = pauseCtx->alpha; - phi_t1 -= 32; - phi_t5 -= 32; - if (phi_t1 < 0) { - pauseCtx->equipVtx[phi_t4 + 2].v.ob[1] = pauseCtx->equipVtx[phi_t4 + 3].v.ob[1] = - pauseCtx->equipVtx[phi_t4 + 0].v.ob[1] - 0x10; + x -= 32; + y -= 32; + if (x < 0) { + pauseCtx->equipVtx[k + 2].v.ob[1] = pauseCtx->equipVtx[k + 3].v.ob[1] = + pauseCtx->equipVtx[k + 0].v.ob[1] - 0x10; - pauseCtx->equipVtx[phi_t4 + 2].v.tc[1] = pauseCtx->equipVtx[phi_t4 + 3].v.tc[1] = 0x200; + pauseCtx->equipVtx[k + 2].v.tc[1] = pauseCtx->equipVtx[k + 3].v.tc[1] = 0x200; break; } - phi_t4 += 4; + k += 4; } - pauseCtx->questVtx = GRAPH_ALLOC(gfxCtx, 188 * sizeof(Vtx)); + pauseCtx->questVtx = GRAPH_ALLOC(gfxCtx, QUEST_QUAD_MAX * 4 * sizeof(Vtx)); - for (phi_t4 = 0, phi_t3 = 0; phi_t3 < 47; phi_t3++, phi_t4 += 4) { - s16 phi_t2_2 = D_8082B1F8[phi_t3]; + for (k = 0, j = 0; j < QUEST_QUAD_MAX; j++, k += 4) { + s16 quadWidth = sQuestQuadsSize[j]; - if ((phi_t3 < 6) || (phi_t3 >= 41)) { - pauseCtx->questVtx[phi_t4 + 0].v.ob[0] = pauseCtx->questVtx[phi_t4 + 2].v.ob[0] = D_8082B138[phi_t3]; + if ((j < QUEST_SONG_MINUET) || (j >= QUEST_QUAD_SKULL_TOKENS_DIGIT1_SHADOW)) { + pauseCtx->questVtx[k + 0].v.ob[0] = pauseCtx->questVtx[k + 2].v.ob[0] = sQuestQuadsX[j]; - pauseCtx->questVtx[phi_t4 + 1].v.ob[0] = pauseCtx->questVtx[phi_t4 + 3].v.ob[0] = - pauseCtx->questVtx[phi_t4 + 0].v.ob[0] + D_8082B1F8[phi_t3]; + pauseCtx->questVtx[k + 1].v.ob[0] = pauseCtx->questVtx[k + 3].v.ob[0] = + pauseCtx->questVtx[k + 0].v.ob[0] + sQuestQuadsSize[j]; - pauseCtx->questVtx[phi_t4 + 0].v.ob[1] = pauseCtx->questVtx[phi_t4 + 1].v.ob[1] = - D_8082B198[phi_t3] + pauseCtx->offsetY; + pauseCtx->questVtx[k + 0].v.ob[1] = pauseCtx->questVtx[k + 1].v.ob[1] = + sQuestQuadsY[j] + pauseCtx->pagesYOrigin1; - pauseCtx->questVtx[phi_t4 + 2].v.ob[1] = pauseCtx->questVtx[phi_t4 + 3].v.ob[1] = - pauseCtx->questVtx[phi_t4 + 0].v.ob[1] - D_8082B1F8[phi_t3]; + pauseCtx->questVtx[k + 2].v.ob[1] = pauseCtx->questVtx[k + 3].v.ob[1] = + pauseCtx->questVtx[k + 0].v.ob[1] - sQuestQuadsSize[j]; - if (phi_t3 >= 41) { - pauseCtx->questVtx[phi_t4 + 1].v.ob[0] = pauseCtx->questVtx[phi_t4 + 3].v.ob[0] = - pauseCtx->questVtx[phi_t4 + 0].v.ob[0] + 8; + if (j >= QUEST_QUAD_SKULL_TOKENS_DIGIT1_SHADOW) { + pauseCtx->questVtx[k + 1].v.ob[0] = pauseCtx->questVtx[k + 3].v.ob[0] = + pauseCtx->questVtx[k + 0].v.ob[0] + 8; - pauseCtx->questVtx[phi_t4 + 0].v.ob[1] = pauseCtx->questVtx[phi_t4 + 1].v.ob[1] = - D_8082B198[phi_t3] + pauseCtx->offsetY - 6; + pauseCtx->questVtx[k + 0].v.ob[1] = pauseCtx->questVtx[k + 1].v.ob[1] = + sQuestQuadsY[j] + pauseCtx->pagesYOrigin1 - 6; - pauseCtx->questVtx[phi_t4 + 2].v.ob[1] = pauseCtx->questVtx[phi_t4 + 3].v.ob[1] = - pauseCtx->questVtx[phi_t4 + 0].v.ob[1] - 16; + pauseCtx->questVtx[k + 2].v.ob[1] = pauseCtx->questVtx[k + 3].v.ob[1] = + pauseCtx->questVtx[k + 0].v.ob[1] - 16; - phi_t2_2 = 8; + quadWidth = 8; } } else { - if ((phi_t3 >= 6) && (phi_t3 <= 17)) { - phi_t2_2 = 16; + if ((j >= QUEST_SONG_MINUET) && (j < QUEST_KOKIRI_EMERALD)) { + quadWidth = 16; } - pauseCtx->questVtx[phi_t4 + 0].v.ob[0] = pauseCtx->questVtx[phi_t4 + 2].v.ob[0] = D_8082B138[phi_t3] + 2; + pauseCtx->questVtx[k + 0].v.ob[0] = pauseCtx->questVtx[k + 2].v.ob[0] = sQuestQuadsX[j] + 2; - pauseCtx->questVtx[phi_t4 + 1].v.ob[0] = pauseCtx->questVtx[phi_t4 + 3].v.ob[0] = - pauseCtx->questVtx[phi_t4 + 0].v.ob[0] + phi_t2_2 - 4; + pauseCtx->questVtx[k + 1].v.ob[0] = pauseCtx->questVtx[k + 3].v.ob[0] = + pauseCtx->questVtx[k + 0].v.ob[0] + quadWidth - 4; - pauseCtx->questVtx[phi_t4 + 0].v.ob[1] = pauseCtx->questVtx[phi_t4 + 1].v.ob[1] = - D_8082B198[phi_t3] + pauseCtx->offsetY - 2; + pauseCtx->questVtx[k + 0].v.ob[1] = pauseCtx->questVtx[k + 1].v.ob[1] = + sQuestQuadsY[j] + pauseCtx->pagesYOrigin1 - 2; - pauseCtx->questVtx[phi_t4 + 2].v.ob[1] = pauseCtx->questVtx[phi_t4 + 3].v.ob[1] = - pauseCtx->questVtx[phi_t4 + 0].v.ob[1] - D_8082B1F8[phi_t3] + 4; + pauseCtx->questVtx[k + 2].v.ob[1] = pauseCtx->questVtx[k + 3].v.ob[1] = + pauseCtx->questVtx[k + 0].v.ob[1] - sQuestQuadsSize[j] + 4; } - pauseCtx->questVtx[phi_t4 + 0].v.ob[2] = pauseCtx->questVtx[phi_t4 + 1].v.ob[2] = - pauseCtx->questVtx[phi_t4 + 2].v.ob[2] = pauseCtx->questVtx[phi_t4 + 3].v.ob[2] = 0; + pauseCtx->questVtx[k + 0].v.ob[2] = pauseCtx->questVtx[k + 1].v.ob[2] = pauseCtx->questVtx[k + 2].v.ob[2] = + pauseCtx->questVtx[k + 3].v.ob[2] = 0; - pauseCtx->questVtx[phi_t4 + 0].v.flag = pauseCtx->questVtx[phi_t4 + 1].v.flag = - pauseCtx->questVtx[phi_t4 + 2].v.flag = pauseCtx->questVtx[phi_t4 + 3].v.flag = 0; + pauseCtx->questVtx[k + 0].v.flag = pauseCtx->questVtx[k + 1].v.flag = pauseCtx->questVtx[k + 2].v.flag = + pauseCtx->questVtx[k + 3].v.flag = 0; - pauseCtx->questVtx[phi_t4 + 0].v.tc[0] = pauseCtx->questVtx[phi_t4 + 0].v.tc[1] = - pauseCtx->questVtx[phi_t4 + 1].v.tc[1] = pauseCtx->questVtx[phi_t4 + 2].v.tc[0] = 0; + pauseCtx->questVtx[k + 0].v.tc[0] = pauseCtx->questVtx[k + 0].v.tc[1] = pauseCtx->questVtx[k + 1].v.tc[1] = + pauseCtx->questVtx[k + 2].v.tc[0] = 0; - pauseCtx->questVtx[phi_t4 + 1].v.tc[0] = pauseCtx->questVtx[phi_t4 + 3].v.tc[0] = phi_t2_2 << 5; - pauseCtx->questVtx[phi_t4 + 2].v.tc[1] = pauseCtx->questVtx[phi_t4 + 3].v.tc[1] = D_8082B1F8[phi_t3] << 5; + pauseCtx->questVtx[k + 1].v.tc[0] = pauseCtx->questVtx[k + 3].v.tc[0] = quadWidth << 5; + pauseCtx->questVtx[k + 2].v.tc[1] = pauseCtx->questVtx[k + 3].v.tc[1] = sQuestQuadsSize[j] << 5; - pauseCtx->questVtx[phi_t4 + 0].v.cn[0] = pauseCtx->questVtx[phi_t4 + 1].v.cn[0] = - pauseCtx->questVtx[phi_t4 + 2].v.cn[0] = pauseCtx->questVtx[phi_t4 + 3].v.cn[0] = - pauseCtx->questVtx[phi_t4 + 0].v.cn[1] = pauseCtx->questVtx[phi_t4 + 1].v.cn[1] = - pauseCtx->questVtx[phi_t4 + 2].v.cn[1] = pauseCtx->questVtx[phi_t4 + 3].v.cn[1] = - pauseCtx->questVtx[phi_t4 + 0].v.cn[2] = pauseCtx->questVtx[phi_t4 + 1].v.cn[2] = - pauseCtx->questVtx[phi_t4 + 2].v.cn[2] = pauseCtx->questVtx[phi_t4 + 3].v.cn[2] = 255; + pauseCtx->questVtx[k + 0].v.cn[0] = pauseCtx->questVtx[k + 1].v.cn[0] = pauseCtx->questVtx[k + 2].v.cn[0] = + pauseCtx->questVtx[k + 3].v.cn[0] = pauseCtx->questVtx[k + 0].v.cn[1] = pauseCtx->questVtx[k + 1].v.cn[1] = + pauseCtx->questVtx[k + 2].v.cn[1] = pauseCtx->questVtx[k + 3].v.cn[1] = + pauseCtx->questVtx[k + 0].v.cn[2] = pauseCtx->questVtx[k + 1].v.cn[2] = + pauseCtx->questVtx[k + 2].v.cn[2] = pauseCtx->questVtx[k + 3].v.cn[2] = 255; - pauseCtx->questVtx[phi_t4 + 0].v.cn[3] = pauseCtx->questVtx[phi_t4 + 1].v.cn[3] = - pauseCtx->questVtx[phi_t4 + 2].v.cn[3] = pauseCtx->questVtx[phi_t4 + 3].v.cn[3] = pauseCtx->alpha; + pauseCtx->questVtx[k + 0].v.cn[3] = pauseCtx->questVtx[k + 1].v.cn[3] = pauseCtx->questVtx[k + 2].v.cn[3] = + pauseCtx->questVtx[k + 3].v.cn[3] = pauseCtx->alpha; } pauseCtx->infoPanelVtx = GRAPH_ALLOC(gfxCtx, 28 * sizeof(Vtx)); - pauseCtx->saveVtx = GRAPH_ALLOC(gfxCtx, 80 * sizeof(Vtx)); - func_80823A0C(play, pauseCtx->saveVtx, 5, 5); + pauseCtx->promptPageVtx = GRAPH_ALLOC(gfxCtx, ((PAGE_BG_QUADS + VTX_PAGE_PROMPT_QUADS) * 4) * sizeof(Vtx)); + KaleidoScope_SetPageVertices(play, pauseCtx->promptPageVtx, VTX_PAGE_PROMPT, VTX_PAGE_PROMPT_QUADS); } void KaleidoScope_DrawGameOver(PlayState* play) { @@ -2533,7 +3354,7 @@ void KaleidoScope_Draw(PlayState* play) { KaleidoScope_SetView(pauseCtx, pauseCtx->eye.x, pauseCtx->eye.y, pauseCtx->eye.z); Gfx_SetupDL_42Opa(play->state.gfxCtx); - KaleidoScope_InitVertices(play, play->state.gfxCtx); + KaleidoScope_SetVertices(play, play->state.gfxCtx); KaleidoScope_DrawPages(play, play->state.gfxCtx); Gfx_SetupDL_42Opa(play->state.gfxCtx); @@ -2592,11 +3413,11 @@ void KaleidoScope_UpdateOpening(PlayState* play) { func_80084BF4(play, 1); - gSaveContext.buttonStatus[0] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][0]; - gSaveContext.buttonStatus[1] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][1]; - gSaveContext.buttonStatus[2] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][2]; - gSaveContext.buttonStatus[3] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][3]; - gSaveContext.buttonStatus[4] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][4]; + gSaveContext.buttonStatus[0] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + PAGE_SWITCH_PT_LEFT][0]; + gSaveContext.buttonStatus[1] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + PAGE_SWITCH_PT_LEFT][1]; + gSaveContext.buttonStatus[2] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + PAGE_SWITCH_PT_LEFT][2]; + gSaveContext.buttonStatus[3] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + PAGE_SWITCH_PT_LEFT][3]; + gSaveContext.buttonStatus[4] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + PAGE_SWITCH_PT_LEFT][4]; pauseCtx->pageIndex = sPageSwitchNextPageIndex[pauseCtx->nextPageMode]; @@ -2612,94 +3433,104 @@ void KaleidoScope_UpdateOpening(PlayState* play) { } } -void KaleidoScope_UpdateCursorSize(PlayState* play) { +void KaleidoScope_UpdateCursorVtx(PlayState* play) { PauseContext* pauseCtx = &play->pauseCtx; - s32 temp1; - s32 temp2; - s32 temp3; - s32 temp4; + s32 tlOffsetX; + s32 tlOffsetY; + s32 rightOffsetX; + s32 bottomOffsetY; if (pauseCtx->cursorSpecialPos == 0) { - temp1 = -1; - temp2 = 1; - temp3 = 14; - temp4 = 14; + tlOffsetX = -1; + tlOffsetY = 1; + rightOffsetX = 14; + bottomOffsetY = 14; if (pauseCtx->pageIndex == PAUSE_MAP) { if (!sInDungeonScene) { - temp1 = -6; - temp2 = 6; - temp3 = 4; - temp4 = 4; + tlOffsetX = -6; + tlOffsetY = 6; + rightOffsetX = 4; + bottomOffsetY = 4; } else if (pauseCtx->cursorSlot[pauseCtx->pageIndex] >= 3) { - temp1 = -6; - temp2 = 5; - temp4 = 7; - temp3 = 19; + tlOffsetX = -6; + tlOffsetY = 5; + bottomOffsetY = 7; + rightOffsetX = 19; } else { - temp1 = -3; - temp2 = 3; - temp3 = 13; - temp4 = 13; + tlOffsetX = -3; + tlOffsetY = 3; + rightOffsetX = 13; + bottomOffsetY = 13; } } else if (pauseCtx->pageIndex == PAUSE_QUEST) { - temp1 = -4; - temp2 = 4; - temp3 = 12; - temp4 = 12; - if (pauseCtx->cursorSlot[pauseCtx->pageIndex] == 0x18) { - temp1 = -2; - temp2 = 2; - temp3 = 32; - temp4 = 32; - } else if (pauseCtx->cursorSlot[pauseCtx->pageIndex] == 0x17) { - temp1 = -4; - temp2 = 4; - temp4 = 13; - temp3 = 34; - } else if (pauseCtx->cursorSlot[pauseCtx->pageIndex] < 6) { - temp1 = -1; - temp2 = 1; - temp3 = 10; - temp4 = 10; - } else if ((pauseCtx->cursorSlot[pauseCtx->pageIndex] >= 6) && - (pauseCtx->cursorSlot[pauseCtx->pageIndex] < 0x12)) { - temp1 = -5; - temp2 = 3; - temp3 = 8; - temp4 = 8; + tlOffsetX = -4; + tlOffsetY = 4; + rightOffsetX = 12; + bottomOffsetY = 12; + if (pauseCtx->cursorSlot[pauseCtx->pageIndex] == QUEST_HEART_PIECE) { + tlOffsetX = -2; + tlOffsetY = 2; + rightOffsetX = 32; + bottomOffsetY = 32; + } else if (pauseCtx->cursorSlot[pauseCtx->pageIndex] == QUEST_SKULL_TOKEN) { + tlOffsetX = -4; + tlOffsetY = 4; + bottomOffsetY = 13; + rightOffsetX = 34; + } else if (pauseCtx->cursorSlot[pauseCtx->pageIndex] < QUEST_SONG_MINUET) { + tlOffsetX = -1; + tlOffsetY = 1; + rightOffsetX = 10; + bottomOffsetY = 10; + } else if ((pauseCtx->cursorSlot[pauseCtx->pageIndex] >= QUEST_SONG_MINUET) && + (pauseCtx->cursorSlot[pauseCtx->pageIndex] < QUEST_KOKIRI_EMERALD)) { + tlOffsetX = -5; + tlOffsetY = 3; + rightOffsetX = 8; + bottomOffsetY = 8; } } } else { - temp1 = -4; - temp2 = 4; - temp3 = 16; - temp4 = 16; + tlOffsetX = -4; + tlOffsetY = 4; + rightOffsetX = 16; + bottomOffsetY = 16; } - pauseCtx->cursorVtx[0].v.ob[0] = pauseCtx->cursorVtx[2].v.ob[0] = pauseCtx->cursorVtx[0].v.ob[0] + temp1; + // Move the quads according to the offsets set above, + // and the position of the cursor in `pauseCtx->cursorVtx[0].v.ob` + // (see `KaleidoScope_SetCursorPos` and other `PAUSE_CURSOR_QUAD_TL` uses) + + // PAUSE_CURSOR_QUAD_TL + pauseCtx->cursorVtx[0].v.ob[0] = pauseCtx->cursorVtx[2].v.ob[0] = pauseCtx->cursorVtx[0].v.ob[0] + tlOffsetX; pauseCtx->cursorVtx[1].v.ob[0] = pauseCtx->cursorVtx[3].v.ob[0] = pauseCtx->cursorVtx[0].v.ob[0] + 16; - pauseCtx->cursorVtx[0].v.ob[1] = pauseCtx->cursorVtx[1].v.ob[1] = pauseCtx->cursorVtx[0].v.ob[1] + temp2; + pauseCtx->cursorVtx[0].v.ob[1] = pauseCtx->cursorVtx[1].v.ob[1] = pauseCtx->cursorVtx[0].v.ob[1] + tlOffsetY; pauseCtx->cursorVtx[2].v.ob[1] = pauseCtx->cursorVtx[3].v.ob[1] = pauseCtx->cursorVtx[0].v.ob[1] - 16; - pauseCtx->cursorVtx[4].v.ob[0] = pauseCtx->cursorVtx[6].v.ob[0] = pauseCtx->cursorVtx[0].v.ob[0] + temp3; + // PAUSE_CURSOR_QUAD_TR + pauseCtx->cursorVtx[4].v.ob[0] = pauseCtx->cursorVtx[6].v.ob[0] = pauseCtx->cursorVtx[0].v.ob[0] + rightOffsetX; pauseCtx->cursorVtx[5].v.ob[0] = pauseCtx->cursorVtx[7].v.ob[0] = pauseCtx->cursorVtx[4].v.ob[0] + 16; pauseCtx->cursorVtx[4].v.ob[1] = pauseCtx->cursorVtx[5].v.ob[1] = pauseCtx->cursorVtx[0].v.ob[1]; pauseCtx->cursorVtx[6].v.ob[1] = pauseCtx->cursorVtx[7].v.ob[1] = pauseCtx->cursorVtx[4].v.ob[1] - 16; + // PAUSE_CURSOR_QUAD_BL pauseCtx->cursorVtx[8].v.ob[0] = pauseCtx->cursorVtx[10].v.ob[0] = pauseCtx->cursorVtx[0].v.ob[0]; pauseCtx->cursorVtx[9].v.ob[0] = pauseCtx->cursorVtx[11].v.ob[0] = pauseCtx->cursorVtx[8].v.ob[0] + 16; - pauseCtx->cursorVtx[8].v.ob[1] = pauseCtx->cursorVtx[9].v.ob[1] = pauseCtx->cursorVtx[0].v.ob[1] - temp4; + pauseCtx->cursorVtx[8].v.ob[1] = pauseCtx->cursorVtx[9].v.ob[1] = pauseCtx->cursorVtx[0].v.ob[1] - bottomOffsetY; pauseCtx->cursorVtx[10].v.ob[1] = pauseCtx->cursorVtx[11].v.ob[1] = pauseCtx->cursorVtx[8].v.ob[1] - 16; - pauseCtx->cursorVtx[12].v.ob[0] = pauseCtx->cursorVtx[14].v.ob[0] = pauseCtx->cursorVtx[0].v.ob[0] + temp3; + // PAUSE_CURSOR_QUAD_BR + pauseCtx->cursorVtx[12].v.ob[0] = pauseCtx->cursorVtx[14].v.ob[0] = pauseCtx->cursorVtx[0].v.ob[0] + rightOffsetX; pauseCtx->cursorVtx[13].v.ob[0] = pauseCtx->cursorVtx[15].v.ob[0] = pauseCtx->cursorVtx[12].v.ob[0] + 16; - pauseCtx->cursorVtx[12].v.ob[1] = pauseCtx->cursorVtx[13].v.ob[1] = pauseCtx->cursorVtx[0].v.ob[1] - temp4; + pauseCtx->cursorVtx[12].v.ob[1] = pauseCtx->cursorVtx[13].v.ob[1] = pauseCtx->cursorVtx[0].v.ob[1] - bottomOffsetY; pauseCtx->cursorVtx[14].v.ob[1] = pauseCtx->cursorVtx[15].v.ob[1] = pauseCtx->cursorVtx[12].v.ob[1] - 16; } void KaleidoScope_LoadDungeonMap(PlayState* play) { InterfaceContext* interfaceCtx = &play->interfaceCtx; +#if PLATFORM_N64 || OOT_PAL s32 pad; +#endif DMA_REQUEST_SYNC(interfaceCtx->mapSegment, (uintptr_t)_map_48x85_staticSegmentRomStart + ((R_MAP_TEX_INDEX + 0) * MAP_48x85_TEX_SIZE), @@ -2716,7 +3547,16 @@ void KaleidoScope_UpdateDungeonMap(PlayState* play) { PRINTF("MAP DMA = %d\n", play->interfaceCtx.mapPaletteIndex); +#if PLATFORM_N64 + if (B_80121220 != NULL && B_80121220->unk_44 != NULL && B_80121220->unk_44(play)) { + + } else { + KaleidoScope_LoadDungeonMap(play); + } +#else KaleidoScope_LoadDungeonMap(play); +#endif + Map_SetFloorPalettesData(play, pauseCtx->dungeonMapSlot - 3); if ((play->sceneId >= SCENE_DEKU_TREE) && (play->sceneId <= SCENE_TREASURE_BOX_SHOP)) { @@ -2735,8 +3575,8 @@ void KaleidoScope_UpdateDungeonMap(PlayState* play) { } void KaleidoScope_Update(PlayState* play) { - static s16 D_8082B258 = PAUSE_MAIN_STATE_IDLE; - static s16 D_8082B25C = 10; + static s16 sMainStateAfterSongPlayerPlayingDone = PAUSE_MAIN_STATE_IDLE; + static s16 sDelayTimer = 10; static s16 D_8082B260 = 0; PauseContext* pauseCtx = &play->pauseCtx; InterfaceContext* interfaceCtx = &play->interfaceCtx; @@ -2757,15 +3597,18 @@ void KaleidoScope_Update(PlayState* play) { (((pauseCtx->state >= PAUSE_STATE_OPENING_1) && (pauseCtx->state <= PAUSE_STATE_SAVE_PROMPT)) || ((pauseCtx->state >= PAUSE_STATE_10) && (pauseCtx->state <= PAUSE_STATE_CLOSING)))) { - if ((((u32)pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || (pauseCtx->mainState == PAUSE_MAIN_STATE_8)) && + if ((((u32)pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) && (pauseCtx->state == PAUSE_STATE_MAIN)) { + pauseCtx->stickAdjX = input->rel.stick_x; pauseCtx->stickAdjY = input->rel.stick_y; - KaleidoScope_UpdateCursorSize(play); + + KaleidoScope_UpdateCursorVtx(play); KaleidoScope_HandlePageToggles(pauseCtx, input); - } else if ((pauseCtx->pageIndex == PAUSE_QUEST) && - ((pauseCtx->mainState < PAUSE_MAIN_STATE_3) || (pauseCtx->mainState == PAUSE_MAIN_STATE_5))) { - KaleidoScope_UpdateCursorSize(play); + } else if ((pauseCtx->pageIndex == PAUSE_QUEST) && ((pauseCtx->mainState < PAUSE_MAIN_STATE_3) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT))) { + KaleidoScope_UpdateCursorVtx(play); } if (pauseCtx->state == PAUSE_STATE_MAIN) { @@ -2788,7 +3631,7 @@ void KaleidoScope_Update(PlayState* play) { WREG(16) = -175; WREG(17) = 155; - pauseCtx->unk_204 = -314.0f; + pauseCtx->promptPitch = -314.0f; //! @bug messed up alignment, should match `ALIGN64` pauseCtx->playerSegment = (void*)(((uintptr_t)play->objectCtx.spaceStart + 0x30) & ~0x3F); @@ -2900,7 +3743,7 @@ void KaleidoScope_Update(PlayState* play) { Interface_SetDoAction(play, DO_ACTION_DECIDE); PRINTF("サイズ=%x\n", size2 + size1 + size0 + size + 0x800); - if (((void)0, gSaveContext.worldMapArea) < 22) { + if (((void)0, gSaveContext.worldMapArea) < WORLD_MAP_AREA_MAX) { #if OOT_NTSC if (gSaveContext.language == LANGUAGE_JPN) { DmaMgr_RequestSync(pauseCtx->nameSegment + MAX(MAP_NAME_TEX1_SIZE, ITEM_NAME_TEX_SIZE), @@ -2948,239 +3791,210 @@ void KaleidoScope_Update(PlayState* play) { KaleidoScope_DrawPlayerWork(play); KaleidoScope_SetupPlayerPreRender(play); + // World map points + for (i = 0; i < ARRAY_COUNT(pauseCtx->worldMapPoints); i++) { - pauseCtx->worldMapPoints[i] = 0; + pauseCtx->worldMapPoints[i] = WORLD_MAP_POINT_STATE_HIDE; } if (CHECK_QUEST_ITEM(QUEST_GERUDOS_CARD)) { - pauseCtx->worldMapPoints[0] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_HAUNTED_WASTELAND] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) { - pauseCtx->worldMapPoints[0] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_HAUNTED_WASTELAND] = WORLD_MAP_POINT_STATE_SHOW; } if (INV_CONTENT(ITEM_LONGSHOT) == ITEM_LONGSHOT) { - pauseCtx->worldMapPoints[1] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_GERUDOS_FORTRESS] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (CHECK_QUEST_ITEM(QUEST_GERUDOS_CARD)) { - pauseCtx->worldMapPoints[1] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_GERUDOS_FORTRESS] = WORLD_MAP_POINT_STATE_SHOW; } if (GET_EVENTCHKINF(EVENTCHKINF_B2)) { - pauseCtx->worldMapPoints[2] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_GERUDO_VALLEY] = WORLD_MAP_POINT_STATE_SHOW; } - if (INV_CONTENT(ITEM_LONGSHOT) == ITEM_LONGSHOT) { - pauseCtx->worldMapPoints[2] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_GERUDO_VALLEY] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (CHECK_QUEST_ITEM(QUEST_GERUDOS_CARD)) { - pauseCtx->worldMapPoints[2] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_GERUDO_VALLEY] = WORLD_MAP_POINT_STATE_SHOW; } if (CUR_UPG_VALUE(UPG_SCALE)) { - pauseCtx->worldMapPoints[3] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_LAKE_HYLIA] = WORLD_MAP_POINT_STATE_SHOW; } - if (CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON)) { - pauseCtx->worldMapPoints[3] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_LAKE_HYLIA] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER)) { - pauseCtx->worldMapPoints[3] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_LAKE_HYLIA] = WORLD_MAP_POINT_STATE_SHOW; } if (GET_EVENTCHKINF(EVENTCHKINF_09)) { - pauseCtx->worldMapPoints[4] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_LON_LON_RANCH] = WORLD_MAP_POINT_STATE_SHOW; } - if (INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_NONE) { - pauseCtx->worldMapPoints[4] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_LON_LON_RANCH] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) { - pauseCtx->worldMapPoints[4] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_LON_LON_RANCH] = WORLD_MAP_POINT_STATE_SHOW; } - if (GET_EVENTCHKINF(EVENTCHKINF_TALON_WOKEN_IN_KAKARIKO)) { - pauseCtx->worldMapPoints[4] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_LON_LON_RANCH] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) { - pauseCtx->worldMapPoints[4] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_LON_LON_RANCH] = WORLD_MAP_POINT_STATE_SHOW; } if (GET_EVENTCHKINF(EVENTCHKINF_09)) { - pauseCtx->worldMapPoints[5] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_MARKET] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (GET_EVENTCHKINF(EVENTCHKINF_40)) { - pauseCtx->worldMapPoints[5] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_MARKET] = WORLD_MAP_POINT_STATE_SHOW; } - if (INV_CONTENT(ITEM_OCARINA_OF_TIME) == ITEM_OCARINA_OF_TIME) { - pauseCtx->worldMapPoints[5] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_MARKET] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (GET_EVENTCHKINF(EVENTCHKINF_45)) { - pauseCtx->worldMapPoints[5] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_MARKET] = WORLD_MAP_POINT_STATE_SHOW; } - if (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) { - pauseCtx->worldMapPoints[5] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_MARKET] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } if (GET_EVENTCHKINF(EVENTCHKINF_09)) { - pauseCtx->worldMapPoints[6] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_HYRULE_FIELD] = WORLD_MAP_POINT_STATE_SHOW; } if (GET_EVENTCHKINF(EVENTCHKINF_40)) { - pauseCtx->worldMapPoints[7] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_DEATH_MOUNTAIN] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (GET_EVENTCHKINF(EVENTCHKINF_25)) { - pauseCtx->worldMapPoints[7] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_DEATH_MOUNTAIN] = WORLD_MAP_POINT_STATE_SHOW; } - if (INV_CONTENT(ITEM_HOOKSHOT) == ITEM_HOOKSHOT) { - pauseCtx->worldMapPoints[7] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_DEATH_MOUNTAIN] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (GET_EVENTCHKINF(EVENTCHKINF_49)) { - pauseCtx->worldMapPoints[7] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_DEATH_MOUNTAIN] = WORLD_MAP_POINT_STATE_SHOW; } - if (gBitFlags[1] & gSaveContext.save.info.worldMapAreaData) { - pauseCtx->worldMapPoints[8] = 1; + if (gBitFlags[WORLD_MAP_AREA_KAKARIKO_VILLAGE] & gSaveContext.save.info.worldMapAreaData) { + pauseCtx->worldMapPoints[WORLD_MAP_POINT_KAKARIKO_VILLAGE] = WORLD_MAP_POINT_STATE_SHOW; } - if (CHECK_QUEST_ITEM(QUEST_SONG_LULLABY)) { - pauseCtx->worldMapPoints[8] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_KAKARIKO_VILLAGE] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (CHECK_QUEST_ITEM(QUEST_SONG_SUN)) { - pauseCtx->worldMapPoints[8] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_KAKARIKO_VILLAGE] = WORLD_MAP_POINT_STATE_SHOW; } - if (GET_EVENTCHKINF(EVENTCHKINF_45)) { - pauseCtx->worldMapPoints[8] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_KAKARIKO_VILLAGE] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (INV_CONTENT(ITEM_HOOKSHOT) == ITEM_HOOKSHOT) { - pauseCtx->worldMapPoints[8] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_KAKARIKO_VILLAGE] = WORLD_MAP_POINT_STATE_SHOW; } - if (CHECK_QUEST_ITEM(QUEST_SONG_STORMS)) { - pauseCtx->worldMapPoints[8] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_KAKARIKO_VILLAGE] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (GET_EVENTCHKINF(EVENTCHKINF_67)) { - pauseCtx->worldMapPoints[8] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_KAKARIKO_VILLAGE] = WORLD_MAP_POINT_STATE_SHOW; } - if (GET_EVENTCHKINF(EVENTCHKINF_AA)) { - pauseCtx->worldMapPoints[8] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_KAKARIKO_VILLAGE] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) { - pauseCtx->worldMapPoints[8] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_KAKARIKO_VILLAGE] = WORLD_MAP_POINT_STATE_SHOW; } - if (gBitFlags[10] & gSaveContext.save.info.worldMapAreaData) { - pauseCtx->worldMapPoints[9] = 1; + if (gBitFlags[WORLD_MAP_AREA_LOST_WOODS] & gSaveContext.save.info.worldMapAreaData) { + pauseCtx->worldMapPoints[WORLD_MAP_POINT_LOST_WOODS] = WORLD_MAP_POINT_STATE_SHOW; } - if (GET_EVENTCHKINF(EVENTCHKINF_0F)) { - pauseCtx->worldMapPoints[9] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_LOST_WOODS] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (CHECK_QUEST_ITEM(QUEST_SONG_SARIA)) { - pauseCtx->worldMapPoints[9] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_LOST_WOODS] = WORLD_MAP_POINT_STATE_SHOW; } - if (INV_CONTENT(ITEM_HOOKSHOT) == ITEM_HOOKSHOT) { - pauseCtx->worldMapPoints[9] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_LOST_WOODS] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (GET_EVENTCHKINF(EVENTCHKINF_48)) { - pauseCtx->worldMapPoints[9] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_LOST_WOODS] = WORLD_MAP_POINT_STATE_SHOW; } - pauseCtx->worldMapPoints[10] = 2; - + pauseCtx->worldMapPoints[WORLD_MAP_POINT_KOKIRI_FOREST] = WORLD_MAP_POINT_STATE_HIGHLIGHT; if (GET_EVENTCHKINF(EVENTCHKINF_09)) { - pauseCtx->worldMapPoints[10] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_KOKIRI_FOREST] = WORLD_MAP_POINT_STATE_SHOW; } - if (GET_EVENTCHKINF(EVENTCHKINF_6E)) { - pauseCtx->worldMapPoints[10] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_KOKIRI_FOREST] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (GET_EVENTCHKINF(EVENTCHKINF_0F)) { - pauseCtx->worldMapPoints[10] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_KOKIRI_FOREST] = WORLD_MAP_POINT_STATE_SHOW; } if (CHECK_QUEST_ITEM(QUEST_SONG_LULLABY)) { - pauseCtx->worldMapPoints[11] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_ZORAS_DOMAIN] = WORLD_MAP_POINT_STATE_SHOW; } - if (GET_EVENTCHKINF(EVENTCHKINF_25)) { - pauseCtx->worldMapPoints[11] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_ZORAS_DOMAIN] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (GET_EVENTCHKINF(EVENTCHKINF_37)) { - pauseCtx->worldMapPoints[11] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_ZORAS_DOMAIN] = WORLD_MAP_POINT_STATE_SHOW; } - if (INV_CONTENT(ITEM_HOOKSHOT) == ITEM_HOOKSHOT) { - pauseCtx->worldMapPoints[11] = 2; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_ZORAS_DOMAIN] = WORLD_MAP_POINT_STATE_HIGHLIGHT; } - if (CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON)) { - pauseCtx->worldMapPoints[11] = 1; + pauseCtx->worldMapPoints[WORLD_MAP_POINT_ZORAS_DOMAIN] = WORLD_MAP_POINT_STATE_SHOW; } - pauseCtx->tradeQuestLocation = 0xFF; + // Trade quest marker + + pauseCtx->tradeQuestMarker = TRADE_QUEST_MARKER_NONE; i = INV_CONTENT(ITEM_TRADE_ADULT); if (LINK_AGE_IN_YEARS == YEARS_ADULT) { if ((i <= ITEM_POCKET_CUCCO) || (i == ITEM_ODD_MUSHROOM)) { - pauseCtx->tradeQuestLocation = 8; + pauseCtx->tradeQuestMarker = WORLD_MAP_POINT_KAKARIKO_VILLAGE; } if ((i == ITEM_COJIRO) || (i == ITEM_ODD_POTION)) { - pauseCtx->tradeQuestLocation = 9; + pauseCtx->tradeQuestMarker = WORLD_MAP_POINT_LOST_WOODS; } if (i == ITEM_POACHERS_SAW) { - pauseCtx->tradeQuestLocation = 2; + pauseCtx->tradeQuestMarker = WORLD_MAP_POINT_GERUDO_VALLEY; } if ((i == ITEM_BROKEN_GORONS_SWORD) || (i == ITEM_EYE_DROPS)) { - pauseCtx->tradeQuestLocation = 7; + pauseCtx->tradeQuestMarker = WORLD_MAP_POINT_DEATH_MOUNTAIN; } if (i == ITEM_PRESCRIPTION) { - pauseCtx->tradeQuestLocation = 11; + pauseCtx->tradeQuestMarker = WORLD_MAP_POINT_ZORAS_DOMAIN; } if (i == ITEM_EYEBALL_FROG) { - pauseCtx->tradeQuestLocation = 3; + pauseCtx->tradeQuestMarker = WORLD_MAP_POINT_LAKE_HYLIA; } - if ((i == ITEM_CLAIM_CHECK) && (gSaveContext.save.info.playerData.bgsFlag == 0)) { - pauseCtx->tradeQuestLocation = 7; + if ((i == ITEM_CLAIM_CHECK) && !gSaveContext.save.info.playerData.bgsFlag) { + pauseCtx->tradeQuestMarker = WORLD_MAP_POINT_DEATH_MOUNTAIN; } } + // Next state + pauseCtx->state = PAUSE_STATE_OPENING_1; break; case PAUSE_STATE_OPENING_1: - if (pauseCtx->unk_1F4 == 160.0f) { + if (pauseCtx->itemPagePitch == 160.0f) { // First frame in this state KaleidoScope_SetDefaultCursor(play); KaleidoScope_ProcessPlayerPreRender(); } - pauseCtx->unk_1F4 = pauseCtx->unk_1F8 = pauseCtx->unk_1FC = pauseCtx->unk_200 -= 160.0f / WREG(6); + pauseCtx->itemPagePitch = pauseCtx->equipPagePitch = pauseCtx->mapPagePitch = pauseCtx->questPagePitch -= + 160.0f / WREG(6); pauseCtx->infoPanelOffsetY += 40 / WREG(6); interfaceCtx->startAlpha += 255 / WREG(6); WREG(16) += WREG(25) / WREG(6); @@ -3188,9 +4002,9 @@ void KaleidoScope_Update(PlayState* play) { XREG(5) += 150 / WREG(6); pauseCtx->alpha += (u16)(255 / (WREG(6) + WREG(4))); - if (pauseCtx->unk_1F4 == 0) { + if (pauseCtx->itemPagePitch == 0) { interfaceCtx->startAlpha = 255; - WREG(2) = 0; + R_PAUSE_PAGES_Y_ORIGIN_2 = 0; pauseCtx->state = PAUSE_STATE_OPENING_2; } @@ -3212,8 +4026,11 @@ void KaleidoScope_Update(PlayState* play) { if (CHECK_BTN_ALL(input->press.button, BTN_START)) { Interface_SetDoAction(play, DO_ACTION_NONE); pauseCtx->state = PAUSE_STATE_CLOSING; - WREG(2) = -6240; + R_PAUSE_PAGES_Y_ORIGIN_2 = PAUSE_PAGES_Y_ORIGIN_2_LOWER; func_800F64E0(0); +#if !PLATFORM_N64 && OOT_NTSC + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); +#endif } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { pauseCtx->nextPageMode = 0; pauseCtx->promptChoice = 0; @@ -3224,19 +4041,20 @@ void KaleidoScope_Update(PlayState* play) { gSaveContext.buttonStatus[4] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); - pauseCtx->unk_1EC = 0; + pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_APPEARING; pauseCtx->state = PAUSE_STATE_SAVE_PROMPT; } break; case PAUSE_MAIN_STATE_SWITCHING_PAGE: - KaleidoScope_UpdatePageSwitch(play, play->state.input); + KaleidoScope_UpdatePageSwitch(play, &play->state.input[0]); break; - case PAUSE_MAIN_STATE_2: + case PAUSE_MAIN_STATE_SONG_PLAYBACK: pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); if (pauseCtx->ocarinaStaff->state == 0) { - pauseCtx->mainState = PAUSE_MAIN_STATE_4; + // Song playback is finished + pauseCtx->mainState = PAUSE_MAIN_STATE_SONG_PROMPT_INIT; AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); } break; @@ -3245,17 +4063,17 @@ void KaleidoScope_Update(PlayState* play) { KaleidoScope_UpdateItemEquip(play); break; - case PAUSE_MAIN_STATE_4: + case PAUSE_MAIN_STATE_SONG_PROMPT_INIT: break; - case PAUSE_MAIN_STATE_5: + case PAUSE_MAIN_STATE_SONG_PROMPT: pauseCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); if (CHECK_BTN_ALL(input->press.button, BTN_START)) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); Interface_SetDoAction(play, DO_ACTION_NONE); pauseCtx->state = PAUSE_STATE_CLOSING; - WREG(2) = -6240; + R_PAUSE_PAGES_Y_ORIGIN_2 = PAUSE_PAGES_Y_ORIGIN_2_LOWER; func_800F64E0(0); pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; break; @@ -3271,27 +4089,31 @@ void KaleidoScope_Update(PlayState* play) { gSaveContext.buttonStatus[4] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); - pauseCtx->unk_1EC = 0; + pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_APPEARING; pauseCtx->state = PAUSE_STATE_SAVE_PROMPT; } else if (pauseCtx->ocarinaStaff->state == pauseCtx->ocarinaSongIdx) { + // The player successfully played the song Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - D_8082B258 = PAUSE_MAIN_STATE_IDLE; - D_8082B25C = 30; - pauseCtx->mainState = PAUSE_MAIN_STATE_6; + + sMainStateAfterSongPlayerPlayingDone = PAUSE_MAIN_STATE_IDLE; + sDelayTimer = 30; + pauseCtx->mainState = PAUSE_MAIN_STATE_SONG_PROMPT_DONE; } else if (pauseCtx->ocarinaStaff->state == 0xFF) { + // The player failed to play the song Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - D_8082B258 = PAUSE_MAIN_STATE_4; - D_8082B25C = 20; - pauseCtx->mainState = PAUSE_MAIN_STATE_6; + + sMainStateAfterSongPlayerPlayingDone = PAUSE_MAIN_STATE_SONG_PROMPT_INIT; + sDelayTimer = 20; + pauseCtx->mainState = PAUSE_MAIN_STATE_SONG_PROMPT_DONE; } break; - case PAUSE_MAIN_STATE_6: - D_8082B25C--; - if (D_8082B25C == 0) { - pauseCtx->mainState = D_8082B258; + case PAUSE_MAIN_STATE_SONG_PROMPT_DONE: + sDelayTimer--; + if (sDelayTimer == 0) { + pauseCtx->mainState = sMainStateAfterSongPlayerPlayingDone; if (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); } @@ -3301,12 +4123,12 @@ void KaleidoScope_Update(PlayState* play) { case PAUSE_MAIN_STATE_7: break; - case PAUSE_MAIN_STATE_8: + case PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG: if (CHECK_BTN_ALL(input->press.button, BTN_START)) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); Interface_SetDoAction(play, DO_ACTION_NONE); pauseCtx->state = PAUSE_STATE_CLOSING; - WREG(2) = -6240; + R_PAUSE_PAGES_Y_ORIGIN_2 = PAUSE_PAGES_Y_ORIGIN_2_LOWER; func_800F64E0(0); pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { @@ -3321,12 +4143,12 @@ void KaleidoScope_Update(PlayState* play) { gSaveContext.buttonStatus[4] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); - pauseCtx->unk_1EC = 0; + pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_APPEARING; pauseCtx->state = PAUSE_STATE_SAVE_PROMPT; } break; - case PAUSE_MAIN_STATE_9: + case PAUSE_MAIN_STATE_SONG_PLAYBACK_START: break; default: @@ -3336,18 +4158,18 @@ void KaleidoScope_Update(PlayState* play) { break; case PAUSE_STATE_SAVE_PROMPT: - switch (pauseCtx->unk_1EC) { - case 0: - pauseCtx->unk_204 -= 314.0f / WREG(6); + switch (pauseCtx->savePromptState) { + case PAUSE_SAVE_PROMPT_STATE_APPEARING: + pauseCtx->promptPitch -= 314.0f / WREG(6); WREG(16) -= WREG(25) / WREG(6); WREG(17) -= WREG(26) / WREG(6); - if (pauseCtx->unk_204 <= -628.0f) { - pauseCtx->unk_204 = -628.0f; - pauseCtx->unk_1EC = 1; + if (pauseCtx->promptPitch <= -628.0f) { + pauseCtx->promptPitch = -628.0f; + pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_WAIT_CHOICE; } break; - case 1: + case PAUSE_SAVE_PROMPT_STATE_WAIT_CHOICE: if (CHECK_BTN_ALL(input->press.button, BTN_A)) { if (pauseCtx->promptChoice != 0) { Interface_SetDoAction(play, DO_ACTION_NONE); @@ -3355,10 +4177,13 @@ void KaleidoScope_Update(PlayState* play) { gSaveContext.buttonStatus[3] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); - pauseCtx->unk_1EC = 2; - WREG(2) = -6240; - YREG(8) = pauseCtx->unk_204; + pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_CLOSING; + R_PAUSE_PAGES_Y_ORIGIN_2 = PAUSE_PAGES_Y_ORIGIN_2_LOWER; + YREG(8) = pauseCtx->promptPitch; func_800F64E0(0); +#if !PLATFORM_N64 && OOT_NTSC + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); +#endif } else { Audio_PlaySfxGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, @@ -3366,63 +4191,71 @@ void KaleidoScope_Update(PlayState* play) { Play_SaveSceneFlags(play); gSaveContext.save.info.playerData.savedSceneId = play->sceneId; Sram_WriteSave(&play->sramCtx); - pauseCtx->unk_1EC = 4; - D_8082B25C = 3; + pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_SAVED; +#if PLATFORM_N64 + sDelayTimer = 90; +#else + sDelayTimer = 3; +#endif } } else if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B)) { Interface_SetDoAction(play, DO_ACTION_NONE); - pauseCtx->unk_1EC = 2; - WREG(2) = -6240; - YREG(8) = pauseCtx->unk_204; + pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_CLOSING; + R_PAUSE_PAGES_Y_ORIGIN_2 = PAUSE_PAGES_Y_ORIGIN_2_LOWER; + YREG(8) = pauseCtx->promptPitch; func_800F64E0(0); gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); +#if !PLATFORM_N64 && OOT_NTSC + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); +#endif } break; - case 4: + case PAUSE_SAVE_PROMPT_STATE_SAVED: if (CHECK_BTN_ALL(input->press.button, BTN_B) || CHECK_BTN_ALL(input->press.button, BTN_A) || - CHECK_BTN_ALL(input->press.button, BTN_START) || (--D_8082B25C == 0)) { + CHECK_BTN_ALL(input->press.button, BTN_START) || (--sDelayTimer == 0)) { Interface_SetDoAction(play, DO_ACTION_NONE); gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); - pauseCtx->unk_1EC = 5; - WREG(2) = -6240; - YREG(8) = pauseCtx->unk_204; + pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_CLOSING_AFTER_SAVED; + R_PAUSE_PAGES_Y_ORIGIN_2 = PAUSE_PAGES_Y_ORIGIN_2_LOWER; + YREG(8) = pauseCtx->promptPitch; func_800F64E0(0); } break; - case 3: - case 6: - pauseCtx->unk_204 += 314.0f / WREG(6); + case PAUSE_SAVE_PROMPT_STATE_RETURN_TO_MENU: + case PAUSE_SAVE_PROMPT_STATE_RETURN_TO_MENU_2: + pauseCtx->promptPitch += 314.0f / WREG(6); WREG(16) += WREG(25) / WREG(6); WREG(17) += WREG(26) / WREG(6); - if (pauseCtx->unk_204 >= -314.0f) { + if (pauseCtx->promptPitch >= -314.0f) { pauseCtx->state = PAUSE_STATE_MAIN; - pauseCtx->unk_1EC = 0; - pauseCtx->unk_1F4 = pauseCtx->unk_1F8 = pauseCtx->unk_1FC = pauseCtx->unk_200 = 0.0f; - pauseCtx->unk_204 = -314.0f; + pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_APPEARING; + pauseCtx->itemPagePitch = pauseCtx->equipPagePitch = pauseCtx->mapPagePitch = + pauseCtx->questPagePitch = 0.0f; + pauseCtx->promptPitch = -314.0f; } break; - case 2: - case 5: - if (pauseCtx->unk_204 != (YREG(8) + 160.0f)) { - pauseCtx->unk_1F4 = pauseCtx->unk_1F8 = pauseCtx->unk_1FC = pauseCtx->unk_200 += - 160.0f / WREG(6); - pauseCtx->unk_204 += 160.0f / WREG(6); + case PAUSE_SAVE_PROMPT_STATE_CLOSING: + case PAUSE_SAVE_PROMPT_STATE_CLOSING_AFTER_SAVED: + if (pauseCtx->promptPitch != (YREG(8) + 160.0f)) { + pauseCtx->itemPagePitch = pauseCtx->equipPagePitch = pauseCtx->mapPagePitch = + pauseCtx->questPagePitch += 160.0f / WREG(6); + pauseCtx->promptPitch += 160.0f / WREG(6); pauseCtx->infoPanelOffsetY -= 40 / WREG(6); WREG(16) -= WREG(25) / WREG(6); WREG(17) -= WREG(26) / WREG(6); XREG(5) -= 150 / WREG(6); pauseCtx->alpha -= (u16)(255 / WREG(6)); - if (pauseCtx->unk_204 == (YREG(8) + 160.0f)) { + if (pauseCtx->promptPitch == (YREG(8) + 160.0f)) { pauseCtx->alpha = 0; } } else { @@ -3430,10 +4263,11 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->debugState = 0; } pauseCtx->state = PAUSE_STATE_RESUME_GAMEPLAY; - pauseCtx->unk_1F4 = pauseCtx->unk_1F8 = pauseCtx->unk_1FC = pauseCtx->unk_200 = 160.0f; + pauseCtx->itemPagePitch = pauseCtx->equipPagePitch = pauseCtx->mapPagePitch = + pauseCtx->questPagePitch = 160.0f; pauseCtx->namedItem = PAUSE_ITEM_NONE; pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; - pauseCtx->unk_204 = -434.0f; + pauseCtx->promptPitch = -434.0f; } break; @@ -3447,7 +4281,7 @@ void KaleidoScope_Update(PlayState* play) { VREG(30) + 3; WREG(16) = -175; WREG(17) = 155; - pauseCtx->unk_204 = -434.0f; + pauseCtx->promptPitch = -434.0f; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING); //! @bug messed up alignment, should match `ALIGN64` @@ -3583,8 +4417,8 @@ void KaleidoScope_Update(PlayState* play) { break; case PAUSE_STATE_13: - pauseCtx->unk_1F4 = pauseCtx->unk_1F8 = pauseCtx->unk_1FC = pauseCtx->unk_200 = pauseCtx->unk_204 -= - 160.0f / WREG(6); + pauseCtx->itemPagePitch = pauseCtx->equipPagePitch = pauseCtx->mapPagePitch = pauseCtx->questPagePitch = + pauseCtx->promptPitch -= 160.0f / WREG(6); pauseCtx->infoPanelOffsetY += 40 / WREG(6); interfaceCtx->startAlpha += 255 / WREG(6); VREG(88) -= 3; @@ -3592,11 +4426,11 @@ void KaleidoScope_Update(PlayState* play) { WREG(17) += WREG(26) / WREG(6); XREG(5) += 150 / WREG(6); pauseCtx->alpha += (u16)(255 / (WREG(6) + WREG(4))); - if (pauseCtx->unk_204 < -628.0f) { - pauseCtx->unk_204 = -628.0f; + if (pauseCtx->promptPitch < -628.0f) { + pauseCtx->promptPitch = -628.0f; interfaceCtx->startAlpha = 255; VREG(88) = 66; - WREG(2) = 0; + R_PAUSE_PAGES_Y_ORIGIN_2 = 0; pauseCtx->alpha = 255; pauseCtx->state = PAUSE_STATE_14; gSaveContext.save.info.playerData.deaths++; @@ -3604,7 +4438,7 @@ void KaleidoScope_Update(PlayState* play) { gSaveContext.save.info.playerData.deaths = 999; } } - PRINTF("kscope->angle_s = %f\n", pauseCtx->unk_204); + PRINTF("kscope->angle_s = %f\n", pauseCtx->promptPitch); break; case PAUSE_STATE_14: @@ -3623,17 +4457,21 @@ void KaleidoScope_Update(PlayState* play) { gSaveContext.save.info.playerData.savedSceneId = play->sceneId; Sram_WriteSave(&play->sramCtx); pauseCtx->state = PAUSE_STATE_15; - D_8082B25C = 3; +#if PLATFORM_N64 + sDelayTimer = 90; +#else + sDelayTimer = 3; +#endif } } break; case PAUSE_STATE_15: - D_8082B25C--; - if (D_8082B25C == 0) { + sDelayTimer--; + if (sDelayTimer == 0) { pauseCtx->state = PAUSE_STATE_16; gameOverCtx->state++; - } else if ((D_8082B25C <= 80) && + } else if ((sDelayTimer <= 80) && (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_START))) { pauseCtx->state = PAUSE_STATE_16; gameOverCtx->state++; @@ -3751,15 +4589,16 @@ void KaleidoScope_Update(PlayState* play) { break; case PAUSE_STATE_CLOSING: - if (pauseCtx->unk_1F4 != 160.0f) { - pauseCtx->unk_1F4 = pauseCtx->unk_1F8 = pauseCtx->unk_1FC = pauseCtx->unk_200 += 160.0f / WREG(6); + if (pauseCtx->itemPagePitch != 160.0f) { + pauseCtx->itemPagePitch = pauseCtx->equipPagePitch = pauseCtx->mapPagePitch = + pauseCtx->questPagePitch += 160.0f / WREG(6); pauseCtx->infoPanelOffsetY -= 40 / WREG(6); interfaceCtx->startAlpha -= 255 / WREG(6); WREG(16) -= WREG(25) / WREG(6); WREG(17) -= WREG(26) / WREG(6); XREG(5) -= 150 / WREG(6); pauseCtx->alpha -= (u16)(255 / WREG(6)); - if (pauseCtx->unk_1F4 == 160.0f) { + if (pauseCtx->itemPagePitch == 160.0f) { pauseCtx->alpha = 0; } } else { @@ -3767,10 +4606,10 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->debugState = 0; } pauseCtx->state = PAUSE_STATE_RESUME_GAMEPLAY; - pauseCtx->unk_200 = 160.0f; - pauseCtx->unk_1FC = 160.0f; - pauseCtx->unk_1F8 = 160.0f; - pauseCtx->unk_1F4 = 160.0f; + pauseCtx->questPagePitch = 160.0f; + pauseCtx->mapPagePitch = 160.0f; + pauseCtx->equipPagePitch = 160.0f; + pauseCtx->itemPagePitch = 160.0f; pauseCtx->namedItem = PAUSE_ITEM_NONE; play->interfaceCtx.startAlpha = 0; } diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h index b3aed0daa2..ca7ef41c4f 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h @@ -5,8 +5,8 @@ #include "global.h" extern u8 gAmmoItems[]; -extern s16 D_8082AAEC[]; -extern s16 D_8082AB2C[]; +extern s16 gVtxPageMapWorldQuadsWidth[]; +extern s16 gVtxPageMapWorldQuadsHeight[]; extern u8 gSlotAgeReqs[]; extern u8 gEquipAgeReqs[EQUIP_TYPE_MAX][4]; extern u8 gItemAgeReqs[]; @@ -25,12 +25,152 @@ extern u8 gAreaGsFlags[]; #define CHECK_AGE_REQ_ITEM(item) \ ((gItemAgeReqs[item] == AGE_REQ_NONE) || (gItemAgeReqs[item] == ((void)0, gSaveContext.save.linkAge))) +// Each page's background is made of a 3x5 grid of quads +#define PAGE_BG_COLS 3 +#define PAGE_BG_ROWS 5 +#define PAGE_BG_QUADS (PAGE_BG_COLS * PAGE_BG_ROWS) +#define PAGE_BG_QUAD_WIDTH 80 +#define PAGE_BG_QUAD_HEIGHT 32 +#define PAGE_BG_QUAD_TEX_WIDTH 80 +#define PAGE_BG_QUAD_TEX_HEIGHT 32 + +typedef enum QuestQuad { + // 0 to 24 matches the `QuestItem` enum + // Notes showing the correct song + /* 25 */ QUEST_QUAD_SONG_NOTE_A1 = QUEST_HEART_PIECE + 1, + /* 26 */ QUEST_QUAD_SONG_NOTE_A2, + /* 27 */ QUEST_QUAD_SONG_NOTE_A3, + /* 28 */ QUEST_QUAD_SONG_NOTE_A4, + /* 29 */ QUEST_QUAD_SONG_NOTE_A5, + /* 30 */ QUEST_QUAD_SONG_NOTE_A6, + /* 31 */ QUEST_QUAD_SONG_NOTE_A7, + /* 32 */ QUEST_QUAD_SONG_NOTE_A8, + // Notes appearing when playing + /* 33 */ QUEST_QUAD_SONG_NOTE_B1, + /* 34 */ QUEST_QUAD_SONG_NOTE_B2, + /* 35 */ QUEST_QUAD_SONG_NOTE_B3, + /* 36 */ QUEST_QUAD_SONG_NOTE_B4, + /* 37 */ QUEST_QUAD_SONG_NOTE_B5, + /* 38 */ QUEST_QUAD_SONG_NOTE_B6, + /* 39 */ QUEST_QUAD_SONG_NOTE_B7, + /* 40 */ QUEST_QUAD_SONG_NOTE_B8, + // Shadow for the amount of skulltula tokens + /* 41 */ QUEST_QUAD_SKULL_TOKENS_DIGIT1_SHADOW, + /* 42 */ QUEST_QUAD_SKULL_TOKENS_DIGIT2_SHADOW, + /* 43 */ QUEST_QUAD_SKULL_TOKENS_DIGIT3_SHADOW, + // Amount of skulltula tokens + /* 44 */ QUEST_QUAD_SKULL_TOKENS_DIGIT1, + /* 45 */ QUEST_QUAD_SKULL_TOKENS_DIGIT2, + /* 46 */ QUEST_QUAD_SKULL_TOKENS_DIGIT3, + /* 47 */ QUEST_QUAD_MAX +} QuestQuad; + +// The world map image is split into a number of quad fragments for drawing +#define WORLD_MAP_IMAGE_WIDTH 216 +#define WORLD_MAP_IMAGE_HEIGHT 128 +#define WORLD_MAP_IMAGE_FRAG_HEIGHT ((TMEM_SIZE / 2) / (WORLD_MAP_IMAGE_WIDTH * G_IM_SIZ_8b_BYTES)) +#define WORLD_MAP_IMAGE_FRAG_NUM (((WORLD_MAP_IMAGE_HEIGHT - 1) / WORLD_MAP_IMAGE_FRAG_HEIGHT) + 1) + +// Clouds quads cover undiscovered areas. +// Point quads are location markers. They can also be highlighted as a hint of where to go. +typedef enum WorldMapQuad { + /* 0 */ WORLD_MAP_QUAD_CLOUDS_SACRED_FOREST_MEADOW, + /* 1 */ WORLD_MAP_QUAD_CLOUDS_HYRULE_FIELD, + /* 2 */ WORLD_MAP_QUAD_CLOUDS_LON_LON_RANCH, + /* 3 */ WORLD_MAP_QUAD_CLOUDS_MARKET, + /* 4 */ WORLD_MAP_QUAD_CLOUDS_HYRULE_CASTLE, + /* 5 */ WORLD_MAP_QUAD_CLOUDS_KAKARIKO_VILLAGE, + /* 6 */ WORLD_MAP_QUAD_CLOUDS_GRAVEYARD, + /* 7 */ WORLD_MAP_QUAD_CLOUDS_DEATH_MOUNTAIN_TRAIL, + /* 8 */ WORLD_MAP_QUAD_CLOUDS_GORON_CITY, + /* 9 */ WORLD_MAP_QUAD_CLOUDS_ZORAS_RIVER, + /* 10 */ WORLD_MAP_QUAD_CLOUDS_ZORAS_DOMAIN, + /* 11 */ WORLD_MAP_QUAD_CLOUDS_ZORAS_FOUNTAIN, + /* 12 */ WORLD_MAP_QUAD_CLOUDS_GERUDO_VALLEY, + /* 13 */ WORLD_MAP_QUAD_CLOUDS_GERUDOS_FORTRESS, + /* 14 */ WORLD_MAP_QUAD_CLOUDS_DESERT_COLOSSUS, + /* 15 */ WORLD_MAP_QUAD_CLOUDS_LAKE_HYLIA, + /* 16 */ WORLD_MAP_QUAD_POINT_FIRST, + // 16 to 27 follows the `WorldMapPoint` enum + /* 27 */ WORLD_MAP_QUAD_POINT_LAST = WORLD_MAP_QUAD_POINT_FIRST + WORLD_MAP_POINT_MAX - 1, + /* 28 */ WORLD_MAP_QUAD_28, + /* 29 */ WORLD_MAP_QUAD_TRADE_QUEST_MARKER, + /* 30 */ WORLD_MAP_QUAD_30, + /* 31 */ WORLD_MAP_QUAD_31, + /* 32 */ WORLD_MAP_QUAD_IMAGE_FIRST, + /* 46 */ WORLD_MAP_QUAD_IMAGE_LAST = WORLD_MAP_QUAD_IMAGE_FIRST + WORLD_MAP_IMAGE_FRAG_NUM - 1 +} WorldMapQuad; + +typedef enum PromptQuad { + /* 0 */ PROMPT_QUAD_MESSAGE, + /* 1 */ PROMPT_QUAD_CURSOR_LEFT, + /* 2 */ PROMPT_QUAD_CURSOR_RIGHT, + /* 3 */ PROMPT_QUAD_CHOICE_YES, + /* 4 */ PROMPT_QUAD_CHOICE_NO, + /* 5 */ PROMPT_QUAD_MAX +} PromptQuad; + +#define ITEM_GRID_ROWS 4 +#define ITEM_GRID_COLS 6 +#define ITEM_GRID_CELL_WIDTH 32 +#define ITEM_GRID_CELL_HEIGHT 32 +#define ITEM_GRID_QUAD_MARGIN 2 +#define ITEM_GRID_QUAD_WIDTH (ITEM_GRID_CELL_WIDTH - (2 * ITEM_GRID_QUAD_MARGIN)) +#define ITEM_GRID_QUAD_HEIGHT (ITEM_GRID_CELL_HEIGHT - (2 * ITEM_GRID_QUAD_MARGIN)) +#define ITEM_GRID_QUAD_TEX_SIZE 32 // both width and height +#define ITEM_GRID_QUAD_ENLARGE_OFFSET 2 + +#define ITEM_GRID_SELECTED_QUAD_MARGIN (-2) +#define ITEM_GRID_SELECTED_QUAD_WIDTH (ITEM_GRID_QUAD_WIDTH - (2 * ITEM_GRID_SELECTED_QUAD_MARGIN)) +#define ITEM_GRID_SELECTED_QUAD_HEIGHT (ITEM_GRID_QUAD_HEIGHT - (2 * ITEM_GRID_SELECTED_QUAD_MARGIN)) +#define ITEM_GRID_SELECTED_QUAD_TEX_SIZE 32 // both width and height + +#define ITEM_AMMO_DIGIT_QUAD_WIDTH 8 +#define ITEM_AMMO_DIGIT_QUAD_HEIGHT 8 +#define ITEM_AMMO_DIGIT_QUAD_TEX_SIZE 8 + +// Relative to the corresponding ITEM_QUAD_GRID_ quad +#define ITEM_AMMO_TENS_QUAD_OFFSET_X 0 +#define ITEM_AMMO_TENS_QUAD_OFFSET_Y 22 + +// Relative to the ammo tens digit +#define ITEM_AMMO_ONES_QUAD_OFFSET_X 6 +#define ITEM_AMMO_ONES_QUAD_OFFSET_Y 0 + +typedef enum ItemQuad { + // 0 to 23 are the ITEM_GRID_ROWS*ITEM_GRID_COLS item grid + // The values follow the `InventorySlot` enum + /* 0 */ ITEM_QUAD_GRID_FIRST, + /* 23 */ ITEM_QUAD_GRID_LAST = ITEM_GRID_ROWS * ITEM_GRID_COLS - 1, + // Markers indicating the currently equipped items + /* 24 */ ITEM_QUAD_GRID_SELECTED_C_LEFT, + /* 25 */ ITEM_QUAD_GRID_SELECTED_C_DOWN, + /* 26 */ ITEM_QUAD_GRID_SELECTED_C_RIGHT, + // Digits for showing ammo count + /* 27 */ ITEM_QUAD_AMMO_FIRST, + /* 27 */ ITEM_QUAD_AMMO_STICK_TENS = ITEM_QUAD_AMMO_FIRST, + /* 28 */ ITEM_QUAD_AMMO_STICK_ONES, + /* 29 */ ITEM_QUAD_AMMO_NUT_TENS, + /* 30 */ ITEM_QUAD_AMMO_NUT_ONES, + /* 31 */ ITEM_QUAD_AMMO_BOMB_TENS, + /* 32 */ ITEM_QUAD_AMMO_BOMB_ONES, + /* 33 */ ITEM_QUAD_AMMO_BOW_TENS, + /* 34 */ ITEM_QUAD_AMMO_BOW_ONES, + /* 35 */ ITEM_QUAD_AMMO_SLINGSHOT_TENS, + /* 36 */ ITEM_QUAD_AMMO_SLINGSHOT_ONES, + /* 37 */ ITEM_QUAD_AMMO_BOMBCHU_TENS, + /* 38 */ ITEM_QUAD_AMMO_BOMBCHU_ONES, + /* 39 */ ITEM_QUAD_AMMO_BEAN_TENS, + /* 40 */ ITEM_QUAD_AMMO_BEAN_ONES, + /* 41 */ ITEM_QUAD_MAX +} ItemQuad; + void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx); s32 KaleidoScope_UpdateQuestStatusPoint(PauseContext* pauseCtx, s32 point); void KaleidoScope_DrawDebugEditor(PlayState* play); // ENABLE_INV_EDITOR void KaleidoScope_DrawPlayerWork(PlayState* play); void KaleidoScope_DrawEquipment(PlayState* play); -void KaleidoScope_SetCursorVtx(PauseContext* pauseCtx, u16 index, Vtx* vtx); +void KaleidoScope_SetCursorPos(PauseContext* pauseCtx, u16 index, Vtx* vtx); void KaleidoScope_DrawItemSelect(PlayState* play); void KaleidoScope_UpdateItemEquip(PlayState* play); void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx); diff --git a/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c b/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c index 72068dfec0..aff7a598ea 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c @@ -1,7 +1,10 @@ +#if PLATFORM_N64 +#include "n64dd.h" +#endif #include "z_kaleido_scope.h" #include "assets/textures/parameter_static/parameter_static.h" -typedef struct { +typedef struct PauseMapMarkInfo { /* 0x00 */ void* texture; /* 0x04 */ u32 imageFormat; /* 0x08 */ u32 imageSize; @@ -27,9 +30,19 @@ void PauseMapMark_Init(PlayState* play) { gBossMarkState = 0; gBossMarkScale = 1.0f; gLoadedPauseMarkDataTable = gPauseMapMarkDataTable; +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_34 != NULL)) { + B_80121220->unk_34(&gLoadedPauseMarkDataTable); + } +#endif } void PauseMapMark_Clear(PlayState* play) { +#if PLATFORM_N64 + if ((B_80121220 != NULL) && (B_80121220->unk_38 != NULL)) { + B_80121220->unk_38(&gLoadedPauseMarkDataTable); + } +#endif gLoadedPauseMarkDataTable = NULL; } @@ -125,8 +138,7 @@ void PauseMapMark_DrawForDungeon(PlayState* play) { #endif Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_lmap_mark.c", 272), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_lmap_mark.c", 272); Matrix_Pop(); gSPVertex(POLY_OPA_DISP++, mapMarkData->vtx, mapMarkData->vtxCount, 0); diff --git a/sym_info.py b/sym_info.py index 6e8f0ffc14..b24ac23375 100755 --- a/sym_info.py +++ b/sym_info.py @@ -9,7 +9,7 @@ def symInfoMain(): parser = argparse.ArgumentParser(description="Display various information about a symbol or address.") parser.add_argument("symname", help="symbol name or VROM/VRAM address to lookup") - parser.add_argument("-v", "--oot-version", help="Which version should be processed", default="hackeroot-mq") + parser.add_argument("-v", "--version", dest="oot_version", help="Which version should be processed", default="hackeroot-mq") parser.add_argument("-e", "--expected", dest="use_expected", action="store_true", help="use the map file in expected/build/ instead of build/") args = parser.parse_args() diff --git a/tools/.gitignore b/tools/.gitignore index d8f6783490..c5ae45dacd 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -4,6 +4,7 @@ elf2rom makeromfs mkdmadata mkldscript +preprocess_pragmas reloc_prereq vtxdis yaz0 diff --git a/tools/Makefile b/tools/Makefile index 50185d7853..30d9114aaf 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,5 +1,5 @@ CFLAGS := -Wall -Wextra -pedantic -std=c99 -g -O2 -PROGRAMS := elf2rom makeromfs mkdmadata mkldscript reloc_prereq +PROGRAMS := elf2rom makeromfs mkdmadata mkldscript preprocess_pragmas reloc_prereq ifeq ($(shell command -v clang >/dev/null 2>&1; echo $$?),0) CC := clang @@ -26,6 +26,7 @@ endif $(MAKE) -C gzinject $(MAKE) -C z64compress $(MAKE) -C Flips TARGET=cli + $(MAKE) -C audio clean: $(RM) $(PROGRAMS) $(addsuffix .exe,$(PROGRAMS)) @@ -37,16 +38,20 @@ endif $(MAKE) -C z64compress clean $(MAKE) -C Flips clean rm Flips/flips + $(MAKE) -C audio clean distclean: clean + $(MAKE) -C audio distclean .PHONY: all clean distclean -elf2rom_SOURCES := elf2rom.c elf32.c n64chksum.c util.c -makeromfs_SOURCES := makeromfs.c n64chksum.c util.c -mkdmadata_SOURCES := mkdmadata.c spec.c util.c -mkldscript_SOURCES := mkldscript.c spec.c util.c -reloc_prereq_SOURCES := reloc_prereq.c spec.c util.c +elf2rom_SOURCES := elf2rom.c elf32.c n64chksum.c util.c +makeromfs_SOURCES := makeromfs.c n64chksum.c util.c +mkdmadata_SOURCES := mkdmadata.c spec.c util.c +mkldscript_SOURCES := mkldscript.c spec.c util.c +preprocess_pragmas_SOURCES := preprocess_pragmas.c +reloc_prereq_SOURCES := reloc_prereq.c spec.c util.c + define COMPILE = $(1): $($1_SOURCES) diff --git a/tools/ZAPDConfigs/gc-jp-ce/Config.xml b/tools/ZAPDConfigs/gc-jp-ce/Config.xml new file mode 100644 index 0000000000..b2f4e3e4d3 --- /dev/null +++ b/tools/ZAPDConfigs/gc-jp-ce/Config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tools/ZAPDConfigs/gc-jp-ce/SymbolMap.txt b/tools/ZAPDConfigs/gc-jp-ce/SymbolMap.txt new file mode 100644 index 0000000000..12d96f7aa2 --- /dev/null +++ b/tools/ZAPDConfigs/gc-jp-ce/SymbolMap.txt @@ -0,0 +1,2 @@ +800FE2A0 gMtxClear +80A74120 sShadowTex diff --git a/tools/ZAPDConfigs/gc-jp-mq/Config.xml b/tools/ZAPDConfigs/gc-jp-mq/Config.xml new file mode 100644 index 0000000000..b2f4e3e4d3 --- /dev/null +++ b/tools/ZAPDConfigs/gc-jp-mq/Config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tools/ZAPDConfigs/gc-jp-mq/SymbolMap.txt b/tools/ZAPDConfigs/gc-jp-mq/SymbolMap.txt new file mode 100644 index 0000000000..8dcd14d673 --- /dev/null +++ b/tools/ZAPDConfigs/gc-jp-mq/SymbolMap.txt @@ -0,0 +1,2 @@ +800FE2A0 gMtxClear +80A740D0 sShadowTex diff --git a/tools/ZAPDConfigs/gc-jp/Config.xml b/tools/ZAPDConfigs/gc-jp/Config.xml new file mode 100644 index 0000000000..b2f4e3e4d3 --- /dev/null +++ b/tools/ZAPDConfigs/gc-jp/Config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tools/ZAPDConfigs/gc-jp/SymbolMap.txt b/tools/ZAPDConfigs/gc-jp/SymbolMap.txt new file mode 100644 index 0000000000..2062d21792 --- /dev/null +++ b/tools/ZAPDConfigs/gc-jp/SymbolMap.txt @@ -0,0 +1,2 @@ +800FE2C0 gMtxClear +80A74150 sShadowTex diff --git a/tools/ZAPDConfigs/gc-us-mq/Config.xml b/tools/ZAPDConfigs/gc-us-mq/Config.xml new file mode 100644 index 0000000000..b2f4e3e4d3 --- /dev/null +++ b/tools/ZAPDConfigs/gc-us-mq/Config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tools/ZAPDConfigs/gc-us-mq/SymbolMap.txt b/tools/ZAPDConfigs/gc-us-mq/SymbolMap.txt new file mode 100644 index 0000000000..3ea1df6ccf --- /dev/null +++ b/tools/ZAPDConfigs/gc-us-mq/SymbolMap.txt @@ -0,0 +1,2 @@ +800FE280 gMtxClear +80A740B0 sShadowTex diff --git a/tools/ZAPDConfigs/ntsc-1.0/Config.xml b/tools/ZAPDConfigs/ntsc-1.0/Config.xml new file mode 100644 index 0000000000..b2f4e3e4d3 --- /dev/null +++ b/tools/ZAPDConfigs/ntsc-1.0/Config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tools/ZAPDConfigs/ntsc-1.0/SymbolMap.txt b/tools/ZAPDConfigs/ntsc-1.0/SymbolMap.txt new file mode 100644 index 0000000000..f19720a6c6 --- /dev/null +++ b/tools/ZAPDConfigs/ntsc-1.0/SymbolMap.txt @@ -0,0 +1,2 @@ +800FEDB0 gMtxClear +80AE0AE0 sShadowTex diff --git a/tools/ZAPDConfigs/ntsc-1.1/Config.xml b/tools/ZAPDConfigs/ntsc-1.1/Config.xml new file mode 100644 index 0000000000..b2f4e3e4d3 --- /dev/null +++ b/tools/ZAPDConfigs/ntsc-1.1/Config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tools/ZAPDConfigs/ntsc-1.1/SymbolMap.txt b/tools/ZAPDConfigs/ntsc-1.1/SymbolMap.txt new file mode 100644 index 0000000000..8bf78d7c3c --- /dev/null +++ b/tools/ZAPDConfigs/ntsc-1.1/SymbolMap.txt @@ -0,0 +1,2 @@ +800FEF70 gMtxClear +80AE0C80 sShadowTex diff --git a/tools/ZAPDConfigs/ntsc-1.2/Config.xml b/tools/ZAPDConfigs/ntsc-1.2/Config.xml new file mode 100644 index 0000000000..b2f4e3e4d3 --- /dev/null +++ b/tools/ZAPDConfigs/ntsc-1.2/Config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tools/ZAPDConfigs/ntsc-1.2/SymbolMap.txt b/tools/ZAPDConfigs/ntsc-1.2/SymbolMap.txt new file mode 100644 index 0000000000..2b9bac5cb0 --- /dev/null +++ b/tools/ZAPDConfigs/ntsc-1.2/SymbolMap.txt @@ -0,0 +1,2 @@ +800FF3F0 gMtxClear +80AE0FE0 sShadowTex diff --git a/tools/ZAPDConfigs/pal-1.0/Config.xml b/tools/ZAPDConfigs/pal-1.0/Config.xml new file mode 100644 index 0000000000..0b6ea61ff5 --- /dev/null +++ b/tools/ZAPDConfigs/pal-1.0/Config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tools/ZAPDConfigs/pal-1.0/SymbolMap.txt b/tools/ZAPDConfigs/pal-1.0/SymbolMap.txt new file mode 100644 index 0000000000..1f09fd7edd --- /dev/null +++ b/tools/ZAPDConfigs/pal-1.0/SymbolMap.txt @@ -0,0 +1,2 @@ +800FCD00 gMtxClear +80AE19F0 sShadowTex diff --git a/tools/ZAPDConfigs/pal-1.1/Config.xml b/tools/ZAPDConfigs/pal-1.1/Config.xml new file mode 100644 index 0000000000..0b6ea61ff5 --- /dev/null +++ b/tools/ZAPDConfigs/pal-1.1/Config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tools/ZAPDConfigs/pal-1.1/SymbolMap.txt b/tools/ZAPDConfigs/pal-1.1/SymbolMap.txt new file mode 100644 index 0000000000..a326070e29 --- /dev/null +++ b/tools/ZAPDConfigs/pal-1.1/SymbolMap.txt @@ -0,0 +1,2 @@ +800FCD40 gMtxClear +80AE1B80 sShadowTex diff --git a/tools/audio/.clang-format b/tools/audio/.clang-format new file mode 100644 index 0000000000..20dda610d7 --- /dev/null +++ b/tools/audio/.clang-format @@ -0,0 +1,29 @@ +IndentWidth: 4 +Language: Cpp +UseTab: Never +ColumnLimit: 120 +PointerAlignment: Right +BreakBeforeBraces: Linux +AlwaysBreakAfterReturnType: TopLevel +AlignArrayOfStructures: Left +SpaceAfterCStyleCast: false +SpaceBeforeParens: ControlStatementsExceptControlMacros +Cpp11BracedListStyle: false +IndentCaseLabels: true +BinPackArguments: true +BinPackParameters: true +AlignAfterOpenBracket: Align +AlignOperands: true +BreakBeforeTernaryOperators: true +BreakBeforeBinaryOperators: None +AllowShortBlocksOnASingleLine: true +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AlignEscapedNewlines: Left +AlignTrailingComments: true +SortIncludes: false +AlignConsecutiveMacros: Consecutive +ForEachMacros: ['LL_FOREACH'] diff --git a/tools/audio/.gitignore b/tools/audio/.gitignore new file mode 100644 index 0000000000..f0d3c612fd --- /dev/null +++ b/tools/audio/.gitignore @@ -0,0 +1,6 @@ +__pycache__/ + +atblgen +sfpatch +sbc +sfc diff --git a/tools/audio/Makefile b/tools/audio/Makefile new file mode 100644 index 0000000000..e93bb158c1 --- /dev/null +++ b/tools/audio/Makefile @@ -0,0 +1,51 @@ +PROGRAMS := atblgen sfpatch sbc sfc + +ifeq ($(shell which xml2-config),) + $(error xml2-config not found. Did you install libxml2-dev?) +endif + +CLANG_FORMAT := clang-format-14 +FORMAT_ARGS := -i -style=file + +CC := gcc +CFLAGS := -Wall -Wextra -pedantic +OPTFLAGS := -Og -g3 + +XML_CFLAGS := $(shell xml2-config --cflags) +XML_LDFLAGS := $(shell xml2-config --libs) + +.PHONY: all clean distclean format + +all: $(PROGRAMS) + $(MAKE) -C sampleconv + +clean: + $(RM) $(PROGRAMS) + $(MAKE) -C sampleconv clean + +distclean: clean + $(MAKE) -C sampleconv distclean + +format: + $(CLANG_FORMAT) $(FORMAT_ARGS) $(shell find . -maxdepth 1 -type f -name "*.[ch]") + $(MAKE) -C sampleconv format + +atblgen_SOURCES := audio_tablegen.c samplebank.c soundfont.c xml.c util.c +sfpatch_SOURCES := sfpatch.c util.c +sbc_SOURCES := samplebank_compiler.c samplebank.c aifc.c xml.c util.c +sfc_SOURCES := soundfont_compiler.c samplebank.c soundfont.c aifc.c xml.c util.c + +atblgen_CFLAGS := $(XML_CFLAGS) +sbc_CFLAGS := $(XML_CFLAGS) +sfc_CFLAGS := $(XML_CFLAGS) + +atblgen_LDFLAGS := $(XML_LDFLAGS) +sbc_LDFLAGS := $(XML_LDFLAGS) +sfc_LDFLAGS := $(XML_LDFLAGS) + +define COMPILE = +$(1): $($1_SOURCES) + $(CC) $(CFLAGS) $($1_CFLAGS) $$^ $($1_LDFLAGS) -o $$@ +endef + +$(foreach p,$(PROGRAMS),$(eval $(call COMPILE,$(p)))) diff --git a/tools/audio/aifc.c b/tools/audio/aifc.c new file mode 100644 index 0000000000..fcf83f8702 --- /dev/null +++ b/tools/audio/aifc.c @@ -0,0 +1,547 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include +#include +#include +#include +#include +#include + +#include "aifc.h" +#include "util.h" + +#define FREAD(file, data, size) \ + do { \ + if (fread((data), (size), 1, (file)) != 1) { \ + error("[%s:%d] Could not read %lu bytes from file", __FILE__, __LINE__, (size_t)(size)); \ + } \ + } while (0) + +#define VADPCM_VER ((int16_t)1) + +#if 0 +#define DEBUGF(fmt, ...) printf(fmt, ##__VA_ARGS__) +#else +#define DEBUGF(fmt, ...) (void)0 +#endif + +typedef struct { + int16_t numChannels; + uint16_t numFramesH; + uint16_t numFramesL; + int16_t sampleSize; + uint8_t sampleRate[10]; // 80-bit float + // followed by compression type + compression name pstring +} aiff_COMM; + +typedef struct { + uint16_t nMarkers; +} aiff_MARK; + +typedef struct { + uint16_t MarkerID; + uint16_t positionH; + uint16_t positionL; +} Marker; + +typedef enum { + LOOP_PLAYMODE_NONE = 0, + LOOP_PLAYMODE_FWD = 1, + LOOP_PLAYMODE_FWD_BWD = 2 +} aiff_loop_playmode; + +typedef struct { + int16_t playMode; // aiff_loop_playmode + // Marker IDs + int16_t beginLoop; + int16_t endLoop; +} Loop; + +typedef struct { + int8_t baseNote; + int8_t detune; + int8_t lowNote; + int8_t highNote; + int8_t lowVelocity; + int8_t highVelocity; + int16_t gain; + Loop sustainLoop; + Loop releaseLoop; +} aiff_INST; + +typedef struct { + int32_t offset; + int32_t blockSize; +} aiff_SSND; + +static_assert(sizeof(double) == sizeof(uint64_t), "Double is assumed to be 64-bit"); + +#define F64_GET_SGN(bits) (((bits) >> 63) & 1) // 1-bit +#define F64_GET_EXP(bits) ((((bits) >> 52) & 0x7FF) - 0x3FF) // 15-bit +#define F64_GET_MANT_H(bits) (((bits) >> 32) & 0xFFFFF) // 20-bit +#define F64_GET_MANT_L(bits) ((bits)&0xFFFFFFFF) // 32-bit + +static UNUSED void +f64_to_f80(double f64, uint8_t *f80) +{ + union { + uint32_t w[3]; + uint8_t b[12]; + } f80tmp; + + // get f64 bits + + uint64_t f64_bits = *(uint64_t *)&f64; + + int f64_sgn = F64_GET_SGN(f64_bits); + int f64_exponent = F64_GET_EXP(f64_bits); + uint32_t f64_mantissa_hi = F64_GET_MANT_H(f64_bits); + uint32_t f64_mantissa_lo = F64_GET_MANT_L(f64_bits); + + // build f80 words + + f80tmp.w[0] = (f64_sgn << 15) | (f64_exponent + 0x3FFF); + f80tmp.w[1] = (1 << 31) | (f64_mantissa_hi << 11) | (f64_mantissa_lo >> 21); + f80tmp.w[2] = f64_mantissa_lo << 11; + + // byteswap to BE + + f80tmp.w[0] = htobe32(f80tmp.w[0]); + f80tmp.w[1] = htobe32(f80tmp.w[1]); + f80tmp.w[2] = htobe32(f80tmp.w[2]); + + // write bytes + + for (size_t i = 0; i < 10; i++) + f80[i] = f80tmp.b[i + 2]; +} + +static void +f80_to_f64(double *f64, uint8_t *f80) +{ + union { + uint32_t w[3]; + uint8_t b[12]; + } f80tmp; + + // read bytes + + f80tmp.b[0] = f80tmp.b[1] = 0; + for (size_t i = 0; i < 10; i++) + f80tmp.b[i + 2] = f80[i]; + + // byteswap from BE + + f80tmp.w[0] = be32toh(f80tmp.w[0]); + f80tmp.w[1] = be32toh(f80tmp.w[1]); + f80tmp.w[2] = be32toh(f80tmp.w[2]); + + // get f64 parts + + int f64_sgn = (f80tmp.w[0] >> 15) & 1; + int f64_exponent = (f80tmp.w[0] & 0x7FFF) - 0x3FFF; + uint32_t f64_mantissa_hi = (f80tmp.w[1] >> 11) & 0xFFFFF; + uint32_t f64_mantissa_lo = ((f80tmp.w[1] & 0x7FF) << 21) | (f80tmp.w[2] >> 11); + + // build bitwise f64 + + uint64_t f64_bits = ((uint64_t)f64_sgn << 63) | ((((uint64_t)f64_exponent + 0x3FF) & 0x7FF) << 52) | + ((uint64_t)f64_mantissa_hi << 32) | ((uint64_t)f64_mantissa_lo); + + // write double + + *f64 = *(double *)&f64_bits; +} + +static void +read_pstring(FILE *f, char *out) +{ + unsigned char len; + + // read string length + FREAD(f, &len, sizeof(len)); + + // read string and null-terminate it + FREAD(f, out, len); + out[len] = '\0'; + + // pad to 2-byte boundary + if (!(len & 1)) + FREAD(f, &len, 1); +} + +static char * +read_pstring_alloc(FILE *f) +{ + unsigned char len; + + // read string length + FREAD(f, &len, sizeof(len)); + + // alloc + char *out = malloc(len + 1); + + // read string and null-terminate it + FREAD(f, out, len); + out[len] = '\0'; + + // pad to 2-byte boundary + if (!(len & 1)) + FREAD(f, &len, 1); + + return out; +} + +void +aifc_read(aifc_data *af, const char *path, uint8_t *match_buf, size_t *match_buf_pos) +{ + FILE *in; + bool has_comm = false; + bool has_ssnd = false; + + memset(af, 0, sizeof(aifc_data)); + + DEBUGF("[aifc] path [%s]\n", path); + + if (path == NULL) + return; + + in = fopen(path, "rb"); + if (in == NULL) + error("Failed to open \"%s\" for reading", path); + + char form[4]; + uint32_t size; + char aifc[4]; + + FREAD(in, form, 4); + FREAD(in, &size, 4); + size = be32toh(size); + FREAD(in, aifc, 4); + + DEBUGF("total size = 0x%X\n", size); + + if (!CC4_CHECK(form, "FORM") || !CC4_CHECK(aifc, "AIFC")) + error("Not an aifc file?"); + + af->path = path; + + while (true) { + char cc4[4]; + uint32_t chunk_size; + + long start = ftell(in); + if (start > 8 + size) { + error("Overran file"); + } + if (start == 8 + size) { + break; + } + + FREAD(in, cc4, 4); + FREAD(in, &chunk_size, 4); + chunk_size = be32toh(chunk_size); + + chunk_size++; + chunk_size &= ~1; + + DEBUGF("%c%c%c%c\n", cc4[0], cc4[1], cc4[2], cc4[3]); + + switch (CC4(cc4[0], cc4[1], cc4[2], cc4[3])) { + case CC4('C', 'O', 'M', 'M'): { + aiff_COMM comm; + FREAD(in, &comm, sizeof(comm)); + comm.numChannels = be16toh(comm.numChannels); + comm.numFramesH = be16toh(comm.numFramesH); + comm.numFramesL = be16toh(comm.numFramesL); + comm.sampleSize = be16toh(comm.sampleSize); + + assert(comm.numChannels == 1); // mono + assert(comm.sampleSize == 16); // 16-bit samples + + af->num_channels = comm.numChannels; + af->sample_size = comm.sampleSize; + af->num_frames = (comm.numFramesH << 16) | comm.numFramesL; + f80_to_f64(&af->sample_rate, comm.sampleRate); + + uint32_t comp_type = CC4('N', 'O', 'N', 'E'); + if (chunk_size > sizeof(aiff_COMM)) { + uint32_t compressionType; + FREAD(in, &compressionType, sizeof(compressionType)); + comp_type = be32toh(compressionType); + } + af->compression_type = comp_type; + + af->compression_name = NULL; + if (chunk_size > sizeof(aiff_COMM) + 4) { + af->compression_name = read_pstring_alloc(in); + } + + DEBUGF(" numChannels %d\n" + " numFrames %u\n" + " sampleSize %d\n" + " sampleRate %f\n" + " compressionType %c%c%c%c (%s)\n", + af->num_channels, af->num_frames, af->sample_size, af->sample_rate, af->compression_type >> 24, + af->compression_type >> 16, af->compression_type >> 8, af->compression_type, + af->compression_name); + + has_comm = true; + } break; + + case CC4('I', 'N', 'S', 'T'): { + aiff_INST inst; + FREAD(in, &inst, sizeof(inst)); + inst.gain = be16toh(inst.gain); + inst.sustainLoop.playMode = be16toh(inst.sustainLoop.playMode); + inst.sustainLoop.beginLoop = be16toh(inst.sustainLoop.beginLoop); + inst.sustainLoop.endLoop = be16toh(inst.sustainLoop.endLoop); + inst.releaseLoop.playMode = be16toh(inst.releaseLoop.playMode); + inst.releaseLoop.beginLoop = be16toh(inst.releaseLoop.beginLoop); + inst.releaseLoop.endLoop = be16toh(inst.releaseLoop.endLoop); + + // basenote + + DEBUGF(" baseNote = %d (%d)\n" + " detune = %d\n" + " lowNote = %d\n" + " highNote = %d\n" + " lowVelocity = %d\n" + " highVelocity= %d\n" + " gain = %d\n" + " sustainLoop = %d [%d:%d]\n" + " releaseLoop = %d [%d:%d]\n", + inst.baseNote, NOTE_MIDI_TO_Z64(inst.baseNote), inst.detune, inst.lowNote, inst.highNote, + inst.lowVelocity, inst.highVelocity, inst.gain, inst.sustainLoop.playMode, + inst.sustainLoop.beginLoop, inst.sustainLoop.endLoop, inst.releaseLoop.playMode, + inst.releaseLoop.beginLoop, inst.releaseLoop.endLoop); + + af->basenote = inst.baseNote; + af->detune = inst.detune; + af->has_inst = true; + } break; + + case CC4('M', 'A', 'R', 'K'): { + aiff_MARK mark; + FREAD(in, &mark, sizeof(mark)); + mark.nMarkers = be16toh(mark.nMarkers); + + af->num_markers = mark.nMarkers; + af->markers = malloc(mark.nMarkers * sizeof(aifc_marker)); + + for (size_t i = 0; i < mark.nMarkers; i++) { + Marker marker; + FREAD(in, &marker, sizeof(marker)); + marker.MarkerID = be16toh(marker.MarkerID); + marker.positionH = be16toh(marker.positionH); + marker.positionL = be16toh(marker.positionL); + + (*af->markers)[i].id = marker.MarkerID; + (*af->markers)[i].pos = (marker.positionH << 16) | marker.positionL; + (*af->markers)[i].label = read_pstring_alloc(in); + + DEBUGF(" MARKER: %d @ %u [%s]\n", (*af->markers)[i].id, (*af->markers)[i].pos, + (*af->markers)[i].label); + } + } break; + + case CC4('A', 'P', 'P', 'L'): { + char subcc4[4]; + + FREAD(in, subcc4, 4); + + DEBUGF(" %c%c%c%c\n", subcc4[0], subcc4[1], subcc4[2], subcc4[3]); + + switch (CC4(subcc4[0], subcc4[1], subcc4[2], subcc4[3])) { + case CC4('s', 't', 'o', 'c'): { + char chunk_name[257]; + read_pstring(in, chunk_name); + + DEBUGF(" %s\n", chunk_name); + + if (strequ(chunk_name, "VADPCMCODES")) { + int16_t version; + uint16_t order; + uint16_t npredictors; + + FREAD(in, &version, sizeof(version)); + version = be16toh(version); + FREAD(in, &order, sizeof(order)); + order = be16toh(order); + FREAD(in, &npredictors, sizeof(npredictors)); + npredictors = be16toh(npredictors); + + if (version != VADPCM_VER) + error("Non-identical codebook chunk versions"); + + size_t book_size = 8 * order * npredictors; + + af->book.order = order; + af->book.npredictors = npredictors; + af->book_state = malloc(book_size * sizeof(int16_t)); + FREAD(in, af->book_state, book_size * sizeof(int16_t)); + + for (size_t i = 0; i < book_size; i++) + (*af->book_state)[i] = be16toh((*af->book_state)[i]); + + af->has_book = true; + + // DEBUG + + DEBUGF(" order = %d\n" + " npredictors = %d\n", + af->book.order, af->book.npredictors); + + for (size_t i = 0; i < book_size; i++) { + if (i % 8 == 0) + DEBUGF("\n "); + DEBUGF("%04X ", (uint16_t)(*af->book_state)[i]); + } + DEBUGF("\n"); + } else if (strequ(chunk_name, "VADPCMLOOPS")) { + int16_t version; + int16_t nloops; + + FREAD(in, &version, sizeof(version)); + version = be16toh(version); + FREAD(in, &nloops, sizeof(nloops)); + nloops = be16toh(nloops); + + if (version != VADPCM_VER) + error("Non-identical loop chunk versions"); + + if (nloops != 1) + error("Only one loop is supported, got %d", nloops); + + FREAD(in, &af->loop, sizeof(ALADPCMloop)); + af->loop.start = be32toh(af->loop.start); + af->loop.end = be32toh(af->loop.end); + af->loop.count = be32toh(af->loop.count); + for (size_t i = 0; i < ARRAY_COUNT(af->loop.state); i++) + af->loop.state[i] = be16toh(af->loop.state[i]); + + af->has_loop = true; + + // DEBUG + + DEBUGF(" start = %d\n" + " end = %d\n" + " count = %d\n", + af->loop.start, af->loop.end, af->loop.count); + + for (size_t i = 0; i < ARRAY_COUNT(af->loop.state); i++) { + if (i % 8 == 0) + DEBUGF("\n "); + DEBUGF("%04X ", (uint16_t)af->loop.state[i]); + } + DEBUGF("\n"); + } else { + warning("Skipping unknown APPL::stoc subchunk: \"%s\"", chunk_name); + } + } break; + + default: + warning("Skipping unknown APPL subchunk: \"%c%c%c%c\"", subcc4[0], subcc4[1], subcc4[2], + subcc4[3]); + break; + } + } break; + + case CC4('S', 'S', 'N', 'D'): { + aiff_SSND ssnd; + FREAD(in, &ssnd, sizeof(ssnd)); + ssnd.offset = be32toh(ssnd.offset); + ssnd.blockSize = be32toh(ssnd.blockSize); + + assert(ssnd.offset == 0); + assert(ssnd.blockSize == 0); + + af->ssnd_offset = ftell(in); + // TODO use numFrames instead? + af->ssnd_size = chunk_size - sizeof(ssnd); + + // Skip reading the rest of the chunk + fseek(in, af->ssnd_size, SEEK_CUR); + + DEBUGF(" offset = 0x%lX size = 0x%lX\n", af->ssnd_offset, af->ssnd_size); + + has_ssnd = true; + } break; + + default: // skip it + break; + } + + long read_size = ftell(in) - start - 8; + + if (read_size > chunk_size) + error("overran chunk: %lu vs %u", read_size, chunk_size); + else if (read_size < chunk_size) + warning("did not read entire %.*s chunk: %lu vs %u", 4, cc4, read_size, chunk_size); + + fseek(in, start + 8 + chunk_size, SEEK_SET); + } + + if (!has_comm) + error("aiff/aifc has no COMM chunk"); + if (!has_ssnd) + error("aiff/aifc has no SSND chunk"); + + // replicate buffer bug in original tool + if (match_buf != NULL && match_buf_pos != NULL) { + size_t buf_pos = ALIGN16(*match_buf_pos) % BUG_BUF_SIZE; + size_t rem = af->ssnd_size; + long seek_offset = 0; + + if (rem > BUG_BUF_SIZE) { + // The sample is so large that it will cover the buffer more than once, let's only read as much as we + // need to. + + // Advance to the buffer position to read only the final data into + buf_pos = (buf_pos + rem - BUG_BUF_SIZE) % BUG_BUF_SIZE; + // We need to seek to the actual data in the file that would be read at this point + seek_offset = rem - BUG_BUF_SIZE; + // The remaining data to read is just 1 buffer's worth of data + rem = BUG_BUF_SIZE; + } + + fseek(in, af->ssnd_offset + seek_offset, SEEK_SET); + + if (rem > BUG_BUF_SIZE - buf_pos) { + // rem will circle around in the buffer + + // Fill up to the end of the buffer + FREAD(in, &match_buf[buf_pos], BUG_BUF_SIZE - buf_pos); + rem -= BUG_BUF_SIZE - buf_pos; + // Return to the start of the buffer + buf_pos = 0; + } + // rem fits in the buffer without circling back, fill buffer + FREAD(in, &match_buf[buf_pos], rem); + + *match_buf_pos = (buf_pos + rem) % BUG_BUF_SIZE; + } + + fclose(in); +} + +void +aifc_dispose(aifc_data *af) +{ + free(af->book_state); + af->has_book = false; + + af->has_loop = false; + + free(af->compression_name); + + for (size_t i = 0; i < af->num_markers; i++) + free((*af->markers)[i].label); + free(af->markers); +} diff --git a/tools/audio/aifc.h b/tools/audio/aifc.h new file mode 100644 index 0000000000..1d32293c16 --- /dev/null +++ b/tools/audio/aifc.h @@ -0,0 +1,80 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef AIFC_H_ +#define AIFC_H_ + +#include +#include +#include + +typedef struct { + int32_t order; + int32_t npredictors; +} ALADPCMbookhead; + +typedef int16_t ALADPCMbookstate[]; + +typedef struct { + uint32_t start; + uint32_t end; + uint32_t count; + int16_t state[16]; +} ALADPCMloop; + +typedef struct { + int16_t id; + uint32_t pos; + char *label; +} aifc_marker; + +typedef struct { + const char *path; // for debugging + // COMM + uint32_t num_frames; + int16_t num_channels; + int16_t sample_size; + double sample_rate; + uint32_t compression_type; + char *compression_name; + // SSND + long ssnd_offset; + size_t ssnd_size; + // INST + bool has_inst; + int8_t basenote; + int8_t detune; + // MARK + size_t num_markers; + aifc_marker (*markers)[]; + // APPL::stoc::VADPCMCODES + bool has_book; + ALADPCMbookhead book; + ALADPCMbookstate *book_state; + // APPL::stoc::VADPCMLOOPS + bool has_loop; + ALADPCMloop loop; +} aifc_data; + +#define BUG_BUF_SIZE 0x10000 + +void +aifc_read(aifc_data *af, const char *path, uint8_t *match_buf, size_t *match_buf_pos); + +void +aifc_dispose(aifc_data *af); + +// Subtract 21, if negative wrap into [0, 128) +#define NOTE_MIDI_TO_Z64(b) (((b)-21 < 0) ? ((b)-21 + 128) : ((b)-21)) + +#define CC4_CHECK(buf, str) \ + ((buf)[0] == (str)[0] && (buf)[1] == (str)[1] && (buf)[2] == (str)[2] && (buf)[3] == (str)[3]) + +#define CC4(c1, c2, c3, c4) (((c1) << 24) | ((c2) << 16) | ((c3) << 8) | (c4)) + +#endif diff --git a/tools/audio/audio_tablegen.c b/tools/audio/audio_tablegen.c new file mode 100644 index 0000000000..f64ce2512d --- /dev/null +++ b/tools/audio/audio_tablegen.c @@ -0,0 +1,634 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "samplebank.h" +#include "soundfont.h" +#include "xml.h" +#include "elf32.h" +#include "util.h" + +/* Samplebanks */ + +static int +tablegen_samplebanks(const char *sb_hdr_out, const char **samplebanks_paths, int num_samplebank_files) +{ + // Read in all samplebank xml files + + samplebank *samplebanks = malloc(num_samplebank_files * sizeof(samplebank)); + + for (int i = 0; i < num_samplebank_files; i++) { + const char *path = samplebanks_paths[i]; + size_t pathlen = strlen(path); + + if (!str_endswith(path, pathlen, ".xml")) + error("Not an xml file? (\"%s\")", path); + + xmlDocPtr document = xmlReadFile(path, NULL, XML_PARSE_NONET); + if (document == NULL) + error("Could not read xml file \"%s\"", path); + + read_samplebank_xml(&samplebanks[i], document); + } + + // Find largest index, including pointer indices + + size_t index_max = 0; + + for (int i = 0; i < num_samplebank_files; i++) { + samplebank *sb = &samplebanks[i]; + unsigned index = sb->index; + if (index > index_max) + index_max = index; + + for (size_t j = 0; j < sb->num_pointers; j++) { + index = sb->pointer_indices[j]; + if (index > index_max) + index_max = index; + } + } + + size_t indices_len = index_max + 1; + + // Classify indices and check that no two indices are the same + +#define INDEX_NONE 0 +#define INDEX_NOPOINTER 1 +#define INDEX_POINTER 2 + + struct sb_index_info { + const char *name; + unsigned index_type; + unsigned ptr_index; + const char *medium; + const char *cache_policy; + }; + struct sb_index_info *index_info = calloc(indices_len, sizeof(struct sb_index_info)); + + for (int i = 0; i < num_samplebank_files; i++) { + samplebank *sb = &samplebanks[i]; + unsigned index = sb->index; + + if (index_info[index].index_type != INDEX_NONE) + error("Overlapping samplebank indices, saw index %u more than once", index); + index_info[index].index_type = INDEX_NOPOINTER; + + index_info[index].name = sb->name; + index_info[index].medium = sb->medium; + index_info[index].cache_policy = sb->cache_policy; + + unsigned real_index = index; + + // Add pointers defined for this bank + for (size_t j = 0; j < sb->num_pointers; j++) { + index = sb->pointer_indices[j]; + + if (index_info[index].index_type != INDEX_NONE) + error("Overlapping samplebank indices, saw index %u more than once", index); + index_info[index].index_type = INDEX_POINTER; + + index_info[index].ptr_index = real_index; + index_info[index].medium = sb->medium; + index_info[index].cache_policy = sb->cache_policy; + } + } + + // Check that we have no gaps in the indices + + for (size_t i = 0; i < indices_len; i++) { + if (index_info[i].index_type == INDEX_NONE) + error("No samplebank for index %lu", i); + } + + // Emit the table + + FILE *out = fopen(sb_hdr_out, "w"); + if (out == NULL) + error("Failed to open samplebank header output"); + + fprintf(out, + // clang-format off + "/**" "\n" + " * DEFINE_SAMPLE_BANK(name, medium, cachePolicy)" "\n" + " * DEFINE_SAMPLE_BANK_PTR(index, medium, cachePolicy)" "\n" + " */" "\n" + // clang-format on + ); + + for (size_t i = 0; i < indices_len; i++) { + unsigned index_type = index_info[i].index_type; + + // By this point we shouldn't have any INDEX_NONEs, since it would have been caught before this + // when we checked for gaps + assert(index_type == INDEX_NOPOINTER || index_type == INDEX_POINTER); + + if (index_type == INDEX_NOPOINTER) { + fprintf(out, "DEFINE_SAMPLE_BANK (%s, %s, %s)\n", index_info[i].name, index_info[i].medium, + index_info[i].cache_policy); + } else { + fprintf(out, "DEFINE_SAMPLE_BANK_PTR(%u, %s, %s)\n", index_info[i].ptr_index, index_info[i].medium, + index_info[i].cache_policy); + } + } + + fclose(out); + + free(index_info); + free(samplebanks); + + return EXIT_SUCCESS; +} + +/* Soundfonts */ + +static int +validate_samplebank_index(soundfont *sf, samplebank *sb, int ptr_idx) +{ + if (ptr_idx != -1) { + // Validate pointer index + bool found = false; + + for (size_t i = 0; i < sb->num_pointers; i++) { + if (ptr_idx == sb->pointer_indices[i]) { + found = true; + break; + } + } + if (!found) + warning("In Soundfont %s: Invalid pointer indirect %d for samplebank %s", sf->info.name, ptr_idx, sb->name); + + return ptr_idx; + } else { + return sb->index; + } +} + +static int +tablegen_soundfonts(const char *sf_hdr_out, char **soundfonts_paths, int num_soundfont_files) +{ + soundfont *soundfonts = malloc(num_soundfont_files * sizeof(soundfont)); + int max_index = 0; + + for (int i = 0; i < num_soundfont_files; i++) { + char *path = soundfonts_paths[i]; + size_t pathlen = strlen(path); + + if (!str_endswith(path, pathlen, ".xml")) + error("Not an xml file? (\"%s\")", path); + + xmlDocPtr document = xmlReadFile(path, NULL, XML_PARSE_NONET); + if (document == NULL) + error("Could not read xml file \"%s\"", path); + + xmlNodePtr root = xmlDocGetRootElement(document); + if (!strequ(XMLSTR_TO_STR(root->name), "Soundfont")) + error("Root node must be "); + + soundfont *sf = &soundfonts[i]; + + // Transform the xml path into a header include path + // Assumption: replacing .xml -> .h forms a valid header include path + path[pathlen - 3] = 'h'; + path[pathlen - 2] = '\0'; + + read_soundfont_info(sf, root); + + if (max_index < sf->info.index) + max_index = sf->info.index; + } + + struct soundfont_file_info { + soundfont *soundfont; + int normal_bank_index; + int dd_bank_index; + char *name; + }; + struct soundfont_file_info *finfo = calloc(max_index + 1, sizeof(struct soundfont_file_info)); + + for (int i = 0; i < num_soundfont_files; i++) { + soundfont *sf = &soundfonts[i]; + + // Resolve samplebank indices + + int normal_idx = validate_samplebank_index(sf, &sf->sb, sf->info.pointer_index); + + int dd_idx = 255; + if (sf->info.bank_path_dd != NULL) + dd_idx = validate_samplebank_index(sf, &sf->sbdd, sf->info.pointer_index_dd); + + // Add info + + if (finfo[sf->info.index].soundfont != NULL) + error("Overlapping soundfont indices, saw index %u more than once", sf->info.index); + + finfo[sf->info.index].soundfont = &soundfonts[i]; + finfo[sf->info.index].normal_bank_index = normal_idx; + finfo[sf->info.index].dd_bank_index = dd_idx; + finfo[sf->info.index].name = soundfonts_paths[i]; + } + + // Make sure there are no gaps + for (int i = 0; i < max_index + 1; i++) { + if (finfo[i].soundfont == NULL) + error("No soundfont for index %d", i); + } + + FILE *out = fopen(sf_hdr_out, "w"); + + fprintf(out, + // clang-format off + "/**" "\n" + " * DEFINE_SOUNDFONT(name, medium, cachePolicy, sampleBankNormal, " + "sampleBankDD, nInstruments, nDrums, nSfx)" "\n" + " */" "\n" + // clang-format on + ); + + for (int i = 0; i < max_index + 1; i++) { + soundfont *sf = finfo[i].soundfont; + + fprintf(out, + // clang-format off + "#include \"%s\"" "\n" + "DEFINE_SOUNDFONT(%s, %s, %s, %d, %d, SF%d_NUM_INSTRUMENTS, SF%d_NUM_DRUMS, SF%d_NUM_SFX)" "\n", + // clang-format on + finfo[i].name, sf->info.name, sf->info.medium, sf->info.cache_policy, finfo[i].normal_bank_index, + finfo[i].dd_bank_index, sf->info.index, sf->info.index, sf->info.index); + } + + fclose(out); + + free(soundfonts); + free(finfo); + + return EXIT_SUCCESS; +} + +/* Sequences */ + +struct seq_order_entry { + const char *name; + const char *enum_name; + bool isptr; +}; + +struct seq_order { + size_t num_sequences; + struct seq_order_entry *entries; + void *filedata; +}; + +static void +read_seq_order(struct seq_order *order, const char *path) +{ + // Read from file, we assume the file has been preprocessed with cpp so that whitespace is collapsed and each line + // has the form: + // (name,enum_name) or *(name,enum_name) + UNUSED size_t data_size; + char *filedata = util_read_whole_file(path, &data_size); + + // We expect one entry per line, gather the total length + size_t total_size = 0; + for (char *p = filedata; *p != '\0'; p++) { + if (*p == '\n') { + total_size++; + } else if (isspace(*p)) { + // There should be no whitespace in the input file besides newlines + goto malformed; + } + } + + // Alloc entries + struct seq_order_entry *entries = malloc(total_size * sizeof(struct seq_order_entry)); + + enum matchno { + MATCH_ALL, + MATCH_PTR, + MATCH_NAME, + MATCH_ENUM, + MATCH_NUM + }; + regmatch_t match[MATCH_NUM]; + regex_t re; + // Matches either + // (,) for non-pointer entries + // or + // *(,) for pointer entries + const char *line_regexp = "^(\\*?)\\(([_a-zA-Z][_a-zA-Z0-9]*),([_a-zA-Z][_a-zA-Z0-9]*)\\)$"; + + int status = regcomp(&re, line_regexp, REG_EXTENDED); + assert(status == 0 && "Failed to compile sequence order regular expression?"); + + char *lstart = filedata; + for (size_t i = 0; i < total_size; i++) { + // find end of line + char *p = lstart; + while (*p != '\n') { + assert(*p != '\0'); + p++; + } + char *lend = p; + // null-terminate the line (replaces the newline) + *lend = '\0'; + + // try to match the regular expression + status = regexec(&re, lstart, MATCH_NUM, match, 0); + if (status != 0) { + // failed to match, malformed input file + char ebuf[128]; + regerror(status, &re, ebuf, sizeof(ebuf)); + fprintf(stderr, "Failed to match line %lu: \"%s\"\nregexec error: \"%s\"\n", i, lstart, ebuf); + goto malformed; + } + + // if the group is empty we're not a pointer, else we are + entries[i].isptr = match[MATCH_PTR].rm_so != match[MATCH_PTR].rm_eo; + + // get the name + entries[i].name = &lstart[match[MATCH_NAME].rm_so]; + lstart[match[MATCH_NAME].rm_eo] = '\0'; // replaces , + + // get the enum name + entries[i].enum_name = &lstart[match[MATCH_ENUM].rm_so]; + lstart[match[MATCH_ENUM].rm_eo] = '\0'; // replaces ) + + // next line + lstart = lend + 1; + } + assert(*lstart == '\0'); + + // Write results + order->num_sequences = total_size; + order->entries = entries; + order->filedata = filedata; + return; +malformed: + error("Malformed %s?", path); +} + +struct seqdata { + const char *elf_path; + const char *name; + uint32_t font_section_offset; + size_t font_section_size; +}; + +static int +tablegen_sequences(const char *seq_font_tbl_out, const char *seq_order_path, const char **sequences_paths, + int num_sequence_files) +{ + struct seq_order order; + read_seq_order(&order, seq_order_path); + +#ifdef SEQ_DEBUG + // Print the sequence order + printf("Sequence order:\n"); + for (size_t i = 0; i < order.num_sequences; i++) { + printf(" name=\"%s\" enum=\"%s\" ptr=%d\n", order.entries[i].name, order.entries[i].enum_name, + order.entries[i].isptr); + } +#endif + + struct seqdata *file_data = malloc(num_sequence_files * sizeof(struct seqdata)); + + // Read and validate the sequence object files + + for (int i = 0; i < num_sequence_files; i++) { + const char *path = sequences_paths[i]; + + if (!str_endswith(path, strlen(path), ".o")) + error("Not a .o file? (\"%s\")", path); + + // Open ELF file + + size_t data_size; + void *data = elf32_read(path, &data_size); + + Elf32_Shdr *symtab = elf32_get_symtab(data, data_size); + if (symtab == NULL) + error("ELF file \"%s\" has no symbol table?", path); + Elf32_Shdr *shstrtab = elf32_get_shstrtab(data, data_size); + if (shstrtab == NULL) + error("ELF file \"%s\" has no section header string table?", path); + + // The .fonts and .name sections are written when assembling the sequence: + // The .fonts section contains a list of bytes for each soundfont the sequences uses + // The .name section contains the null-terminated name of the sequence as set by .startseq + + Elf32_Shdr *font_section = elf32_section_forname(".fonts", shstrtab, data, data_size); + if (font_section == NULL) + error("Sequence file \"%s\" has no fonts section?", path); + + uint32_t font_section_offset = elf32_read32(font_section->sh_offset); + uint32_t font_section_size = elf32_read32(font_section->sh_size); + validate_read(font_section_offset, font_section_size, data_size); + + Elf32_Shdr *name_section = elf32_section_forname(".name", shstrtab, data, data_size); + if (name_section == NULL) + error("Sequence file \"%s\" has no name section?", path); + + uint32_t name_section_offset = elf32_read32(name_section->sh_offset); + uint32_t name_section_size = elf32_read32(name_section->sh_size); + validate_read(name_section_offset, name_section_size, data_size); + + const char *seq_name = GET_PTR(data, name_section_offset); + if (strnlen(seq_name, name_section_size + 1) >= name_section_size) + error("Sequence file \"%s\" name is not properly terminated?", path); + + // Populate new data + struct seqdata *seqdata = &file_data[i]; + seqdata->elf_path = strdup(path); + seqdata->name = strdup(seq_name); + seqdata->font_section_offset = font_section_offset; + seqdata->font_section_size = font_section_size; + + free(data); + } + +#ifdef SEQ_DEBUG + // Debugging: Print the findings for each sequence object + printf("\nNum files: %d\n\n", num_sequence_files); + + for (int i = 0; i < num_sequence_files; i++) { + struct seqdata *seqdata = &file_data[i]; + + printf( + // clang-format off + " elf path : \"%s\"" "\n" + " name : \"%s\"" "\n" + " font offset : 0x%X" "\n" + " num fonts : %lu" "\n\n", + // clang-format on + seqdata->elf_path, seqdata->name, seqdata->font_section_offset, seqdata->font_section_size); + } +#endif + + // Link against the sequence order coming from the sequence table header + + struct seqdata **final_seqdata = calloc(order.num_sequences, sizeof(struct seqdata *)); + + for (size_t i = 0; i < order.num_sequences; i++) { + // Skip pointers for now + if (order.entries[i].isptr) + continue; + + // If it's not a pointer, "name" is the name as it appears in a sequence file, find it in the list of sequences + const char *name = order.entries[i].name; + + // Find the object file with this name + for (int j = 0; j < num_sequence_files; j++) { + struct seqdata *seqdata = &file_data[j]; + + if (strequ(name, seqdata->name)) { + // Found name, done + final_seqdata[i] = seqdata; + break; + } + } + } + + for (size_t i = 0; i < order.num_sequences; i++) { + // Now we only care about pointers + if (!order.entries[i].isptr) + continue; + + // If it's a pointer, "name" is the ENUM name of the sequence it points to + const char *name = order.entries[i].name; + + for (size_t j = 0; j < order.num_sequences; j++) { + // Skip pointers, the system doesn't allow multiple indirection so this must point to a non-pointer entry. + if (order.entries[j].isptr) + continue; + + if (strequ(name, order.entries[j].enum_name)) { + // For pointers, we just duplicate the fonts for the original into the pointer entry. + // TODO ideally we would allow fonts to be different when a sequence is accessed by pointer, but how + // to supply this info? + final_seqdata[i] = final_seqdata[j]; + break; + } + } + } + + // Make sure we found an object file for all declared sequences + for (size_t i = 0; i < order.num_sequences; i++) { + if (final_seqdata[i] == NULL) + error("Could not find object file for sequence %lu : %s", i, order.entries[i].name); + } + + // Write the sequence font table out + + FILE *out = fopen(seq_font_tbl_out, "w"); + if (out == NULL) + error("Failed to open output file \"%s\" for writing", seq_font_tbl_out); + + fprintf(out, + // clang-format off + "\n" + ".section .rodata" "\n" + "\n" + ".global gSequenceFontTable" "\n" + "gSequenceFontTable:" "\n" + // clang-format on + ); + + // Write the 16-bit offsets for each sequence + for (size_t i = 0; i < order.num_sequences; i++) { + fprintf(out, " .half Fonts_%lu - gSequenceFontTable\n", i); + } + fprintf(out, "\n"); + + // Write the fonts for each sequence: number of fonts followed by an incbin for the rest. + for (size_t i = 0; i < order.num_sequences; i++) { + fprintf(out, + // clang-format off + "Fonts_%lu:" "\n" + " .byte %ld" "\n" + " .incbin \"%s\", 0x%X, %lu" "\n" + "\n", + // clang-format on + i, final_seqdata[i]->font_section_size, final_seqdata[i]->elf_path, + final_seqdata[i]->font_section_offset, final_seqdata[i]->font_section_size); + } + fprintf(out, ".balign 16\n"); + + fclose(out); + return EXIT_SUCCESS; +} + +/* Common */ + +static int +usage(const char *progname) +{ + fprintf(stderr, + // clang-format off + "%s: Generate code tables for audio data" "\n" + "Usage:" "\n" + " %s --banks " "\n" + " %s --fonts " "\n" + " %s --sequences " "\n", + // clang-format on + progname, progname, progname, progname); + return EXIT_FAILURE; +} + +int +main(int argc, char **argv) +{ + int ret = EXIT_SUCCESS; + + const char *progname = argv[0]; + + if (argc < 2) + return usage(progname); + + const char *mode = argv[1]; + + if (strequ(mode, "--banks")) { + if (argc < 4) + return usage(progname); + + const char *sb_hdr_out = argv[2]; + const char **samplebanks_paths = (const char **)&argv[3]; + int num_samplebank_files = argc - 3; + + ret = tablegen_samplebanks(sb_hdr_out, samplebanks_paths, num_samplebank_files); + } else if (strequ(mode, "--fonts")) { + if (argc < 4) + return usage(progname); + + const char *sf_hdr_out = argv[2]; + char **soundfonts_paths = &argv[3]; + int num_soundfont_files = argc - 3; + + ret = tablegen_soundfonts(sf_hdr_out, soundfonts_paths, num_soundfont_files); + } else if (strequ(mode, "--sequences")) { + if (argc < 5) + return usage(progname); + + const char *seq_font_tbl_out = argv[2]; + const char *seq_order_path = argv[3]; + const char **sequences_paths = (const char **)&argv[4]; + int num_sequence_files = argc - 4; + + ret = tablegen_sequences(seq_font_tbl_out, seq_order_path, sequences_paths, num_sequence_files); + } else { + return usage(progname); + } + + return ret; +} diff --git a/tools/audio/elf32.h b/tools/audio/elf32.h new file mode 100644 index 0000000000..109be5a2ed --- /dev/null +++ b/tools/audio/elf32.h @@ -0,0 +1,235 @@ +/* SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET */ +/* SPDX-License-Identifier: CC0-1.0 */ +#ifndef ELF32_H_ +#define ELF32_H_ + +#include + +#include "util.h" + +#define elf32_read16(x) be16toh(x) +#define elf32_write16(x) htobe16(x) +#define elf32_read32(x) be32toh(x) +#define elf32_write32(x) htobe32(x) + +#ifndef ELF32_QUALIFIERS +#define ELF32_QUALIFIERS static UNUSED ALWAYS_INLINE +#endif + +#define GET_PTR(data, offset) ((void *)&((uint8_t *)(data))[(offset)]) + +#define EI_NIDENT 16 +#define EI_MAG0 0x00 +#define EI_MAG1 0x01 +#define EI_MAG2 0x02 +#define EI_MAG3 0x03 +#define EI_CLASS 0x04 +#define EI_DATA 0x05 +#define EI_VERSION 0x06 +#define EI_OSABI 0x07 +#define EI_ABIVERSION 0x08 +#define EI_PAD 0x09 + +typedef struct { + uint8_t e_ident[EI_NIDENT]; + uint16_t e_type; + uint16_t e_machine; + uint32_t e_version; + uint32_t e_entry; + uint32_t e_phoff; + uint32_t e_shoff; + uint32_t e_flags; + uint16_t e_ehsize; + uint16_t e_phentsize; + uint16_t e_phnum; + uint16_t e_shentsize; + uint16_t e_shnum; + uint16_t e_shstrndx; +} Elf32_Ehdr; + +#define ELF32_HAS_MAGIC(ehdr) \ + ((ehdr)->e_ident[EI_MAG0] == '\x7F' && (ehdr)->e_ident[EI_MAG1] == 'E' && (ehdr)->e_ident[EI_MAG2] == 'L' && \ + (ehdr)->e_ident[EI_MAG3] == 'F') + +#define ELF32_IS_32(ehdr) ((ehdr)->e_ident[EI_CLASS] == 1 /*EI_CLASS_32*/) + +#define ELF32_IS_BE(ehdr) ((ehdr)->e_ident[EI_DATA] == 2 /*EI_DATA_BE*/) + +typedef struct { + uint32_t sh_name; + uint32_t sh_type; + uint32_t sh_flags; + uint32_t sh_addr; + uint32_t sh_offset; + uint32_t sh_size; + uint32_t sh_link; + uint32_t sh_info; + uint32_t sh_addralign; + uint32_t sh_entsize; +} Elf32_Shdr; + +typedef struct { + uint32_t st_name; + uint32_t st_value; + uint32_t st_size; + uint8_t st_info; + uint8_t st_other; + uint16_t st_shndx; +} Elf32_Sym; + +// sh_type + +#define SHT_NULL 0x00000000 +#define SHT_PROGBITS 0x00000001 +#define SHT_SYMTAB 0x00000002 +#define SHT_STRTAB 0x00000003 +#define SHT_RELA 0x00000004 +#define SHT_HASH 0x00000005 +#define SHT_DYNAMIC 0x00000006 +#define SHT_NOTE 0x00000007 +#define SHT_NOBITS 0x00000008 +#define SHT_REL 0x00000009 +#define SHT_SHLIB 0x0000000A +#define SHT_DYNSYM 0x0000000B +#define SHT_INIT_ARRAY 0x0000000E +#define SHT_FINI_ARRAY 0x0000000F +#define SHT_PREINIT_ARRAY 0x00000010 +#define SHT_GROUP 0x00000011 +#define SHT_SYMTAB_SHNDX 0x00000012 +#define SHT_NUM 0x00000013 +#define SHT_LOOS 0x60000000 +// MIPS specific +#define SHT_MIPS_DEBUG 0x70000005 +#define SHT_MIPS_REGINFO 0x70000006 +#define SHT_MIPS_OPTIONS 0x7000000D + +// st_shndx + +#define SHN_UND 0x0000 +#define SHN_ABS 0xFFF1 +#define SHN_COMMON 0xFFF2 +#define SHN_LORESERVE 0xFF00 +#define SHN_XINDEX 0xFFFF + +// st_info [3:0] + +#define ST_NOTYPE 0 +#define ST_OBJECT 1 +#define ST_FUNC 2 +#define ST_SECTION 3 +#define ST_FILE 4 + +// st_info [7:4] + +#define SB_LOCAL 0 +#define SB_GLOBAL 1 +#define SB_WEAK 2 + +#define ELF32_ERR_PREFIX "[ELF32] " + +ELF32_QUALIFIERS void +validate_read(size_t offset, size_t size, size_t data_size) +{ + if (offset + size > data_size) + error(ELF32_ERR_PREFIX "Could not read %ld bytes at %08lX", size, offset); +} + +ELF32_QUALIFIERS void * +elf32_read(const char *path, size_t *data_size_out) +{ + size_t data_size; + void *data = util_read_whole_file(path, &data_size); + if (data == NULL) + error(ELF32_ERR_PREFIX "File is empty?"); + + validate_read(0, sizeof(Elf32_Ehdr), data_size); + + Elf32_Ehdr *ehdr = GET_PTR(data, 0); + + if (!ELF32_HAS_MAGIC(ehdr)) + error(ELF32_ERR_PREFIX "Not an ELF file?"); + if (!ELF32_IS_32(ehdr)) + error(ELF32_ERR_PREFIX "Not ELF32?"); + if (!ELF32_IS_BE(ehdr)) + error(ELF32_ERR_PREFIX "Not big-endian?"); + + *data_size_out = data_size; + return data; +} + +ELF32_QUALIFIERS Elf32_Shdr * +elf32_get_symtab(void *data, size_t data_size) +{ + Elf32_Ehdr *ehdr = GET_PTR(data, 0); + uint32_t e_shoff = elf32_read32(ehdr->e_shoff); + uint16_t e_shnum = elf32_read16(ehdr->e_shnum); + + Elf32_Shdr *shdr = GET_PTR(data, e_shoff); + for (size_t i = 0; i < e_shnum; i++, shdr++) { + validate_read(e_shoff + i * sizeof(Elf32_Shdr), sizeof(Elf32_Shdr), data_size); + + if (elf32_read32(shdr->sh_type) == SHT_SYMTAB) { + // there should be only one section of this type + return shdr; + } + } + return NULL; +} + +ELF32_QUALIFIERS Elf32_Shdr * +ef32_section_foridx(size_t idx, void *data, size_t data_size) +{ + Elf32_Ehdr *ehdr = GET_PTR(data, 0); + uint32_t e_shoff = elf32_read32(ehdr->e_shoff); + uint16_t e_shnum = elf32_read16(ehdr->e_shnum); + Elf32_Shdr *shdr = GET_PTR(data, e_shoff); + + if (idx >= e_shnum) + return NULL; + + validate_read(e_shoff + idx * sizeof(Elf32_Shdr), sizeof(Elf32_Shdr), data_size); + return &shdr[idx]; +} + +ELF32_QUALIFIERS Elf32_Shdr * +elf32_get_shstrtab(void *data, size_t data_size) +{ + Elf32_Ehdr *ehdr = GET_PTR(data, 0); + return ef32_section_foridx(elf32_read16(ehdr->e_shstrndx), data, data_size); +} + +ELF32_QUALIFIERS const char * +elf32_get_string(size_t offset, Elf32_Shdr *strtab, void *data, size_t data_size) +{ + uint32_t sh_offset = elf32_read32(strtab->sh_offset); + + validate_read(sh_offset + offset, 1, data_size); + return (const char *)GET_PTR(data, sh_offset + offset); +} + +ELF32_QUALIFIERS Elf32_Shdr * +elf32_section_forname(const char *name, Elf32_Shdr *shstrtab, void *data, size_t data_size) +{ + Elf32_Ehdr *ehdr = GET_PTR(data, 0); + uint32_t e_shoff = elf32_read32(ehdr->e_shoff); + uint16_t e_shnum = elf32_read16(ehdr->e_shnum); + + Elf32_Shdr *shdr = GET_PTR(data, e_shoff); + for (size_t i = 0; i < e_shnum; i++, shdr++) { + validate_read(e_shoff + i * sizeof(Elf32_Shdr), sizeof(Elf32_Shdr), data_size); + + const char *s_name = elf32_get_string(elf32_read32(shdr->sh_name), shstrtab, data, data_size); + if (strequ(s_name, name)) { + return shdr; + } + } + return NULL; +} + +ELF32_QUALIFIERS Elf32_Shdr * +elf32_get_strtab(void *data, size_t data_size) +{ + return elf32_section_forname(".strtab", elf32_get_shstrtab(data, data_size), data, data_size); +} + +#endif diff --git a/tools/audio/extraction/audio_extract.py b/tools/audio/extraction/audio_extract.py new file mode 100644 index 0000000000..9107288068 --- /dev/null +++ b/tools/audio/extraction/audio_extract.py @@ -0,0 +1,462 @@ +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 +# +# Extract audio files +# + +import os, shutil, time +from dataclasses import dataclass +from multiprocessing.pool import ThreadPool +from typing import Dict, List, Tuple, Union +from xml.etree import ElementTree +from xml.etree.ElementTree import Element + +from .audio_tables import AudioCodeTable, AudioCodeTableEntry, AudioStorageMedium +from .audiotable import AudioTableData, AudioTableFile, AudioTableSample +from .audiobank_file import AudiobankFile +from .disassemble_sequence import CMD_SPEC, SequenceDisassembler, SequenceTableSpec, MMLVersion +from .util import align, debugm, error, incbin, program_get, XMLWriter + +@dataclass +class GameVersionInfo: + # Music Macro Language Version + mml_version : MMLVersion + # Soundfont table code offset + soundfont_table : int + # Sequence font table code offset + seq_font_table : int + # Sequence table code offset + seq_table : int + # Sample bank table code offset + sample_bank_table : int + # Sequence enum names + seq_enum_names : Tuple[str] + # List of indices corresponding to handwritten sequences + handwritten_sequences : Tuple[int] + # Some soundfonts report the wrong samplebank, map them to the correct samplebank for proper sample discovery + fake_banks : Dict[int, int] + # Contains audiotable indices that suffer from a buffer clearing bug + audiotable_buffer_bugs : Tuple[int] + # Sequence disassembly table specs + seq_disas_tables : Dict[int, Tuple[SequenceTableSpec]] + +SAMPLECONV_PATH = f"{os.path.dirname(os.path.realpath(__file__))}/../sampleconv/sampleconv" + +BASEROM_DEBUG = False + +# ====================================================================================================================== +# Run +# ====================================================================================================================== + +def collect_sample_banks(audiotable_seg : memoryview, extracted_dir : str, version_info : GameVersionInfo, + table : AudioCodeTable, samplebank_xmls : Dict[int, Tuple[str, Element]]): + sample_banks : List[Union[AudioTableFile, int]] = [] + + for i,entry in enumerate(table): + entry : AudioCodeTableEntry + + assert entry.short_data1 == 0 and entry.short_data2 == 0 and entry.short_data3 == 0, \ + "Bad data for Sample Bank entry, all short data should be 0" + assert entry.medium == AudioStorageMedium.MEDIUM_CART , \ + "Bad data for Sample Bank entry, medium should be CART" + + if entry.size == 0: + # Pointer to other entry, in this case the rom address is a table index + + entry_dst = table.entries[entry.rom_addr] + sample_banks[entry.rom_addr].register_ptr(i) + sample_banks.append(entry_dst.rom_addr) + else: + # Check whether this samplebank suffers from the buffer bug + # TODO it should be possible to detect this automatically by checking padding following sample discovery + bug = i in version_info.audiotable_buffer_bugs + + bank = AudioTableFile(i, audiotable_seg, entry, table.rom_addr, buffer_bug=bug, + extraction_xml=samplebank_xmls.get(i, None)) + + if BASEROM_DEBUG: + bank.dump_bin(f"{extracted_dir}/baserom_audiotest/audiotable_files/{bank.file_name}.bin") + + sample_banks.append(bank) + + return sample_banks + +def bank_data_lookup(sample_banks : List[Union[AudioTableFile, int]], e : Union[AudioTableFile, int]) -> AudioTableFile: + if isinstance(e, int): + if e == 255: + return None + return bank_data_lookup(sample_banks, sample_banks[e]) + else: + return e + +def collect_soundfonts(audiobank_seg : memoryview, extracted_dir : str, version_info : GameVersionInfo, + sound_font_table : AudioCodeTable, soundfont_xmls : Dict[int, Tuple[str, Element]], + sample_banks : List[Union[AudioTableFile, int]]): + soundfonts = [] + + for i,entry in enumerate(sound_font_table): + entry : AudioCodeTableEntry + + # Lookup the samplebanks used by this soundfont + bank1 = bank_data_lookup(sample_banks, version_info.fake_banks.get(i, entry.sample_bank_id_1)) + bank2 = bank_data_lookup(sample_banks, entry.sample_bank_id_2) + + # Read the data + soundfont = AudiobankFile(audiobank_seg, i, entry, sound_font_table.rom_addr, bank1, bank2, + entry.sample_bank_id_1, entry.sample_bank_id_2, + extraction_xml=soundfont_xmls.get(i, None)) + soundfonts.append(soundfont) + + if BASEROM_DEBUG: + # Write the individual file for debugging and comparison + soundfont.dump_bin(f"{extracted_dir}/baserom_audiotest/audiobank_files/{soundfont.file_name}.bin") + + return soundfonts + +def aifc_extract_one_sample(base_path : str, sample : AudioTableSample): + aifc_path = f"{base_path}/aifc/{sample.filename}" + ext_compressed = sample.codec_file_extension_compressed() + ext_decompressed = sample.codec_file_extension_decompressed() + wav_path = f"{base_path}/{sample.filename.replace(ext_compressed, ext_decompressed)}" + # export to AIFC + sample.to_file(aifc_path) + # decode to AIFF/WAV + program_get(f"{SAMPLECONV_PATH} --matching pcm16 {aifc_path} {wav_path}") + +def aifc_extract_one_bin(base_path : str, sample : AudioTableData): + # export to BIN + if BASEROM_DEBUG: + sample.to_file(f"{base_path}/aifc/{sample.filename}") + # copy to correct location + shutil.copyfile(f"{base_path}/aifc/{sample.filename}", f"{base_path}/{sample.filename}") + else: + sample.to_file(f"{base_path}/{sample.filename}") + +def extract_samplebank(pool : ThreadPool, extracted_dir : str, sample_banks : List[Union[AudioTableFile, int]], + bank : AudioTableFile, write_xml : bool): + # deal with remaining gaps, have to blob them unless we can find an exact match in another bank + bank.finalize_coverage(sample_banks) + # assign names + bank.assign_names() + + base_path = f"{extracted_dir}/assets/audio/samples/{bank.name}" + + # write xml + with open(f"{extracted_dir}/assets/audio/samplebanks/{bank.file_name}.xml", "w") as outfile: + outfile.write(bank.to_xml(f"assets/audio/samples/{bank.name}")) + + # write the extraction xml if specified + if write_xml: + bank.write_extraction_xml(f"assets/xml/audio/samplebanks/{bank.file_name}.xml") + + # write sample sand blobs + + os.makedirs(f"{base_path}/aifc", exist_ok=True) + + aifc_samples = [sample for sample in bank.samples_final if isinstance(sample, AudioTableSample)] + bin_samples = [sample for sample in bank.samples_final if not isinstance(sample, AudioTableSample)] + + t_start = time.time() + + # we assume the number of bin samples are very small and don't multiprocess it + for sample in bin_samples: + aifc_extract_one_bin(base_path, sample) + + # multiprocess aifc extraction + decompression + async_results = [pool.apply_async(aifc_extract_one_sample, args=(base_path, sample)) for sample in aifc_samples] + # block until done + [res.get() for res in async_results] + + dt = time.time() - t_start + print(f"Samplebank {bank.name} extraction took {dt:.3f}s") + + # drop aifc dir if not in debug mode + if not BASEROM_DEBUG: + shutil.rmtree(f"{base_path}/aifc") + +def disassemble_one_sequence(extracted_dir : str, version_info : GameVersionInfo, soundfonts : List[AudiobankFile], + enum_names : List[str], id : int, data : bytes, name : str, filename : str, + fonts : memoryview): + out_filename = f"{extracted_dir}/assets/audio/sequences/{filename}.seq" + disas = SequenceDisassembler(id, data, version_info.seq_disas_tables.get(id, None), CMD_SPEC, + version_info.mml_version, out_filename, name, + [soundfonts[i] for i in fonts], enum_names) + disas.analyze() + disas.emit() + +def extract_sequences(audioseq_seg : memoryview, extracted_dir : str, version_info : GameVersionInfo, write_xml : bool, + sequence_table : AudioCodeTable, sequence_font_table : memoryview, + sequence_xmls : Dict[int, Element], soundfonts : List[AudiobankFile]): + + sequence_font_table_cvg = [0] * len(sequence_font_table) + + seq_enum_names = version_info.seq_enum_names + handwritten_sequences = version_info.handwritten_sequences + + # We should have as many enum names as sequences that require extraction + assert len(seq_enum_names) == len(sequence_table) + + if BASEROM_DEBUG: + os.makedirs(f"{extracted_dir}/baserom_audiotest/audioseq_files", exist_ok=True) + + os.makedirs(f"{extracted_dir}/assets/audio/sequences", exist_ok=True) + if write_xml: + os.makedirs(f"assets/xml/audio/sequences", exist_ok=True) + + all_fonts = [] + disas_jobs = [] + + t = time.time() + + for i,entry in enumerate(sequence_table): + entry : AudioCodeTableEntry + + # extract font indices + font_data_offset = (sequence_font_table[2 * i + 0] << 8) | (sequence_font_table[2 * i + 1]) + num_fonts = sequence_font_table[font_data_offset] + font_data_offset += 1 + fonts = sequence_font_table[font_data_offset:font_data_offset+num_fonts] + + all_fonts.append(fonts) + + # mark coverage for sequence font table + sequence_font_table_cvg[2 * i + 0] = 1 + sequence_font_table_cvg[2 * i + 1] = 1 + for j in range(font_data_offset-1,font_data_offset+num_fonts): + sequence_font_table_cvg[j] = 1 + + if entry.size != 0: + # Real sequence, queue extraction + + seq_data = bytearray(entry.data(audioseq_seg, sequence_table.rom_addr)) + + ext = ".prg" if i in handwritten_sequences else "" + + if BASEROM_DEBUG: + # Extract original sequence binary for comparison + with open(f"{extracted_dir}/baserom_audiotest/audioseq_files/seq_{i}{ext}.aseq", "wb") as outfile: + outfile.write(seq_data) + + extraction_xml = sequence_xmls.get(i, None) + if extraction_xml is None: + sequence_filename = f"seq_{i}" + sequence_name = f"Sequence_{i}" + else: + sequence_filename = extraction_xml[0] + sequence_name = extraction_xml[1].attrib["Name"] + + # Write extraction xml entry + if write_xml: + xml = XMLWriter() + + xml.write_comment("This file is only for extraction of vanilla data.") + + xml.write_element("Sequence", { + "Name" : sequence_name, + "Index" : i, + }) + + with open(f"assets/xml/audio/sequences/{sequence_filename}.xml", "w") as outfile: + outfile.write(str(xml)) + + if i in handwritten_sequences: + # skip "handwritten" sequences + continue + + disas_jobs.append((i, seq_data, sequence_name, sequence_filename, fonts)) + else: + # Pointer to another sequence, checked later + pass + + # Check full coverage + try: + if align(sequence_font_table_cvg.index(0), 16) != len(sequence_font_table_cvg): + # does not pad to full size, fail + assert False, "Sequence font table missing data" + # pads to full size, good + except ValueError: + pass # fully covered, good + + # Check consistency of font data for the same sequence accessed via pointers + + for i,entry in enumerate(sequence_table): + entry : AudioCodeTableEntry + + # Fonts for this entry + fonts = all_fonts[i] + + if entry.size != 0: + # real, ignore + pass + else: + # pointer, check that the fonts for this entry are the same as the fonts for the other + j = entry.rom_addr + + fonts2 = all_fonts[j] + + assert fonts == fonts2, \ + f"Font mismatch: Pointer {i} against Real {j}. This is a limitation of the build process." + + # Disassemble to text + + for job in disas_jobs: + disassemble_one_sequence(extracted_dir, version_info, soundfonts, seq_enum_names, *job) + + dt = time.time() - t + print(f"Sequences extraction took {dt:.3f}s") + +def extract_audio_for_version(version_info : GameVersionInfo, extracted_dir : str, read_xml : bool, write_xml : bool): + print("Setting up...") + + # Open baserom segments + + code_seg = None + audiotable_seg = None + audiobank_seg = None + audioseq_seg = None + + with open(f"{extracted_dir}/baserom/code", "rb") as infile: + code_seg = memoryview(infile.read()) + + with open(f"{extracted_dir}/baserom/Audiotable", "rb") as infile: + audiotable_seg = memoryview(infile.read()) + + with open(f"{extracted_dir}/baserom/Audiobank", "rb") as infile: + audiobank_seg = memoryview(infile.read()) + + with open(f"{extracted_dir}/baserom/Audioseq", "rb") as infile: + audioseq_seg = memoryview(infile.read()) + + # ================================================================================================================== + # Collect audio tables + # ================================================================================================================== + + seq_font_tbl_len = version_info.seq_table - version_info.seq_font_table + + sound_font_table = AudioCodeTable(code_seg, version_info.soundfont_table) + sample_bank_table = AudioCodeTable(code_seg, version_info.sample_bank_table) + sequence_table = AudioCodeTable(code_seg, version_info.seq_table) + sequence_font_table = incbin(code_seg, version_info.seq_font_table, seq_font_tbl_len) + + if BASEROM_DEBUG: + # Extract Table Binaries + + os.makedirs(f"{extracted_dir}/baserom_audiotest/audio_code_tables/", exist_ok=True) + + with open(f"{extracted_dir}/baserom_audiotest/audio_code_tables/samplebank_table.bin", "wb") as outfile: + outfile.write(sample_bank_table.data) + + with open(f"{extracted_dir}/baserom_audiotest/audio_code_tables/soundfont_table.bin", "wb") as outfile: + outfile.write(sound_font_table.data) + + with open(f"{extracted_dir}/baserom_audiotest/audio_code_tables/sequence_table.bin", "wb") as outfile: + outfile.write(sequence_table.data) + + with open(f"{extracted_dir}/baserom_audiotest/audio_code_tables/sequence_font_table.bin", "wb") as outfile: + outfile.write(sequence_font_table) + + # ================================================================================================================== + # Collect extraction xmls + # ================================================================================================================== + + samplebank_xmls : Dict[int, Tuple[str, Element]] = {} + soundfont_xmls : Dict[int, Tuple[str, Element]] = {} + sequence_xmls : Dict[int, Tuple[str, Element]] = {} + + if read_xml: + # Read all present xmls + + def walk_xmls(out_dict : Dict[int, Tuple[str, Element]], path : str, typename : str): + for root,_,files in os.walk(path): + for f in files: + fullpath = os.path.join(root, f) + xml = ElementTree.parse(fullpath) + xml_root = xml.getroot() + + if xml_root.tag != typename or "Name" not in xml_root.attrib or "Index" not in xml_root.attrib: + error(f"Malformed {typename} extraction xml: \"{fullpath}\"") + out_dict[int(xml_root.attrib["Index"])] = (f.replace(".xml", ""), xml_root) + + walk_xmls(samplebank_xmls, f"assets/xml/audio/samplebanks", "SampleBank") + walk_xmls(soundfont_xmls, f"assets/xml/audio/soundfonts", "SoundFont") + walk_xmls(sequence_xmls, f"assets/xml/audio/sequences", "Sequence") + + # TODO warn about any missing xmls or xmls with a bad index + + # ================================================================================================================== + # Collect samplebanks + # ================================================================================================================== + + if BASEROM_DEBUG: + os.makedirs(f"{extracted_dir}/baserom_audiotest/audiotable_files", exist_ok=True) + sample_banks = collect_sample_banks(audiotable_seg, extracted_dir, version_info, sample_bank_table, samplebank_xmls) + + # ================================================================================================================== + # Collect soundfonts + # ================================================================================================================== + + if BASEROM_DEBUG: + os.makedirs(f"{extracted_dir}/baserom_audiotest/audiobank_files", exist_ok=True) + soundfonts = collect_soundfonts(audiobank_seg, extracted_dir, version_info, sound_font_table, soundfont_xmls, + sample_banks) + + # ================================================================================================================== + # Finalize samplebanks + # ================================================================================================================== + + for i,bank in enumerate(sample_banks): + if isinstance(bank, AudioTableFile): + bank.finalize_samples() + + # ================================================================================================================== + # Extract samplebank contents + # ================================================================================================================== + + print("Extracting samplebanks...") + + # Check that the sampleconv binary is available + assert os.path.isfile(SAMPLECONV_PATH) , "Compile sampleconv" + + os.makedirs(f"{extracted_dir}/assets/audio/samplebanks", exist_ok=True) + if write_xml: + os.makedirs(f"assets/xml/audio/samplebanks", exist_ok=True) + + with ThreadPool(processes=os.cpu_count()) as pool: + for bank in sample_banks: + if isinstance(bank, AudioTableFile): + extract_samplebank(pool, extracted_dir, sample_banks, bank, write_xml) + + # ================================================================================================================== + # Extract soundfonts + # ================================================================================================================== + + print("Extracting soundfonts...") + + os.makedirs(f"{extracted_dir}/assets/audio/soundfonts", exist_ok=True) + if write_xml: + os.makedirs(f"assets/xml/audio/soundfonts", exist_ok=True) + + for i,sf in enumerate(soundfonts): + sf : AudiobankFile + + # Finalize instruments/drums/etc. + # This step includes assigning the final samplerate and basenote for the instruments, which may be different + # from the samplerate and basenote assigned to their sample prior. + sf.finalize() + + # write the soundfont xml itself + with open(f"{extracted_dir}/assets/audio/soundfonts/{sf.file_name}.xml", "w") as outfile: + outfile.write(sf.to_xml(f"Soundfont_{i}", "assets/audio/samplebanks")) + + # write the extraction xml if specified + if write_xml: + sf.write_extraction_xml(f"assets/xml/audio/soundfonts/{sf.file_name}.xml") + + # ================================================================================================================== + # Extract sequences + # ================================================================================================================== + + print("Extracting sequences...") + + extract_sequences(audioseq_seg, extracted_dir, version_info, write_xml, sequence_table, sequence_font_table, + sequence_xmls, soundfonts) diff --git a/tools/audio/extraction/audio_tables.py b/tools/audio/extraction/audio_tables.py new file mode 100644 index 0000000000..d288b92629 --- /dev/null +++ b/tools/audio/extraction/audio_tables.py @@ -0,0 +1,107 @@ +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 +# +# Implements code tables structure and related enums +# + +import struct +from enum import IntEnum + +from .util import incbin + +class AudioStorageMedium(IntEnum): + MEDIUM_RAM = 0 + MEDIUM_UNK = 1 + MEDIUM_CART = 2 + MEDIUM_DISK_DRIVE = 3 + +class AudioCachePolicy(IntEnum): + CACHE_LOAD_PERMANENT = 0 + CACHE_LOAD_PERSISTENT = 1 + CACHE_LOAD_TEMPORARY = 2 + CACHE_LOAD_EITHER = 3 + CACHE_LOAD_EITHER_NOSYNC = 4 + +class AudioCodeTableEntry: + """ + typedef struct { + /* 0x00 */ u32 romAddr; + /* 0x04 */ u32 size; + /* 0x08 */ s8 medium; + /* 0x09 */ s8 cachePolicy; + /* 0x0A */ s16 shortData1; + /* 0x0C */ s16 shortData2; + /* 0x0E */ s16 shortData3; + } AudioTableEntry; // size = 0x10 + """ + def __init__(self, data): + self.rom_addr, self.size, self.medium, self.cache_policy, self.short_data1, self.short_data2, \ + self.short_data3 = struct.unpack(">IIbbhhh", data[:0x10]) + + self.medium = AudioStorageMedium(self.medium) + self.cache_policy = AudioCachePolicy(self.cache_policy) + + self.sample_bank_id_1 = (self.short_data1 >> 8) & 0xFF + self.sample_bank_id_2 = (self.short_data1 >> 0) & 0xFF + + self.num_instruments = (self.short_data2 >> 8) & 0xFF + self.num_drums = (self.short_data2 >> 0) & 0xFF + + self.num_sfx = self.short_data3 + + def __str__(self): + out = "{\n" + out += f" .romAddr = 0x{self.rom_addr:X}\n" + out += f" .size = 0x{self.size:X}\n" + out += f" .medium = {self.medium.name}\n" + out += f" .cachePolicy = {self.cache_policy.name}\n" + out += f" .shortData1 = ({self.sample_bank_id_1} << 8) | {self.sample_bank_id_2}\n" + out += f" .shortData2 = ({self.num_instruments} << 8) | {self.num_drums}\n" + out += f" .shortData3 = {self.num_sfx}\n" + out += "}\n" + return out + + def data(self, segment_data : memoryview, segment_offset : int) -> memoryview: + return incbin(segment_data, self.rom_addr + segment_offset, self.size) + +class AudioCodeTable: + """ + typedef struct { + /* 0x00 */ s16 numEntries; + /* 0x02 */ s16 unkMediumParam; + /* 0x04 */ u32 romAddr; + /* 0x08 */ char pad[0x8]; + /* 0x10 */ AudioTableEntry entries[1/* numEntries */]; + } AudioTable; // size = 0x10 + 0x10 * numEntries + """ + + def __init__(self, rom_image : memoryview, rom_start : int): + header = incbin(rom_image, rom_start, 0x10) + + self.num_entries, self.unk_medium_param, self.rom_addr = struct.unpack(">hhI", header[:8]) + assert all([b == 0 for b in header[8:]]) + + self.data = incbin(rom_image, rom_start, 0x10 + 0x10 * self.num_entries) + + self.entries = [] + for i in range(self.num_entries): + self.entries.append(AudioCodeTableEntry(self.data[0x10 + 0x10 * i:][:0x10])) + + def __iter__(self) -> AudioCodeTableEntry: + for e in self.entries: + yield e + + def __len__(self): + return len(self.entries) + + def __str__(self): + out = "{\n" + out += f" .numEntries = {self.num_entries}\n" + out += f" .unkMediumParam = {self.unk_medium_param}\n" + out += f" .romAddr = 0x{self.rom_addr:X}\n" + out += " .entries = {\n" + for entry in self.entries: + out += str(entry) + "\n" + out += " }\n" + out += "}\n" + return out diff --git a/tools/audio/extraction/audiobank_file.py b/tools/audio/extraction/audiobank_file.py new file mode 100644 index 0000000000..83efbc71c7 --- /dev/null +++ b/tools/audio/extraction/audiobank_file.py @@ -0,0 +1,956 @@ +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 +# +# Implements audiobank file +# + +import struct +from typing import Optional, Tuple +from xml.etree.ElementTree import Element + +from .audio_tables import AudioCodeTableEntry +from .audiobank_structs import AdpcmBook, AdpcmLoop, Drum, Instrument, SoundFontSample, SoundFontSound +from .envelope import Envelope +from .audiotable import AudioTableFile, AudioTableSample +from .tuning import pitch_names +from .util import XMLWriter, align, debugm, merge_like_ranges, merge_ranges + +# Debug settings +PLOT_DRUM_TUNING = False +LOG_COVERAGE = False + +def coverage_log(str): + if LOG_COVERAGE: debugm(str) + +if PLOT_DRUM_TUNING: + import matplotlib.pyplot as plt + + + +# dummy types for coverage labeling + +class Padding: + pass + +class SfxListPtr: + SIZE = 4 + +class DrumsListPtr: + SIZE = 4 + +class InstrumentPtr: + SIZE = 4 + +class DrumPtr: + SIZE = 4 + + + + + +class DrumGroup: + + def __init__(self): + self.drums = [] + self.start = None + self.end = None + self.sample_header_offset = None + self.sample = None + + # Filled in at finalize + self.envelope_offset = None + self.envelope = None + self.release_rate = None + self.pan = None + self.sample_header_offset = None + self.sample_rate = None + self.base_note = None + self.needs_rate_override = None + self.needs_note_override = None + + def __len__(self): + return len(self.drums) + + def __iter__(self): + for drum in self.drums: + yield drum + + def append(self, drum): + self.drums.append(drum) + + def set_range(self, start, end): + self.start, self.end = start, end + + def finalize(self, envelopes, sample_lookup_fn): + # A drum group should use the same envelope for all entries + env_offsets = set(drum.envelope for drum in self.drums) + assert len(env_offsets) == 1 + self.envelope_offset = env_offsets.pop() + self.envelope : Envelope = envelopes[self.envelope_offset] + + # A drum group should use the same release rate + release_rates = set(drum.release_rate for drum in self.drums) + assert len(release_rates) == 1 + self.release_rate = release_rates.pop() + + # The release rate used should belong to the envelope used + assert self.release_rate in self.envelope.release_rates + + # A drum group should always contain a single pan value + pans = set(drum.pan for drum in self.drums) + assert len(pans) == 1 + self.pan = pans.pop() + + # A drum group should be the same sample repeated + sample_header_offsets = set(drum.sample for drum in self.drums) + assert len(sample_header_offsets) == 1 + sample_header_offset = sample_header_offsets.pop() + + # Fetch sample header + self.sample_header_offset = sample_header_offset + sample = sample_lookup_fn(sample_header_offset) + sample : AudioTableSample + + # Collect final samplerate and basenotes for each drum in the group + final_rate = None + notes = [] + for drum in self: + drum : Drum + + tuning = drum.tuning + assert tuning in sample.tuning_map + # Get from sample + rate, note = sample.tuning_map[tuning] + + if final_rate is None: + final_rate = rate + # This should never occur as drum groups are split when the samplerate changes + assert final_rate == rate + + notes.append(note) + + # Note values should increase monotonically in a drum group + note_indices = [pitch_names.index(note) + 21 for note in notes] + assert all(v == note_indices[0] + i for i,v in enumerate(note_indices)) + + # Assign final rate and note. + # Use first note in the group as the basenote for the whole group, the rest will be filled in during build. + self.sample_rate = final_rate + self.base_note = notes[0] + + assert sample.sample_rate is not None + assert sample.base_note is not None + + # Needs override if they do not agree with the final values in the sample + self.needs_rate_override = sample.sample_rate != self.sample_rate + self.needs_note_override = sample.base_note != self.base_note + + def to_xml(self, xml : XMLWriter, name : str, sample_name_func, envelope_name_func): + attributes = { + "Name" : name, + "Envelope" : envelope_name_func(self.envelope_offset), + } + + if self.release_rate != self.envelope.release_rate(): + attributes["Release"] = self.release_rate + + attributes["Pan"] = self.pan + + if self.start == self.end: + attributes["Note"] = pitch_names[self.start] + else: + attributes["NoteStart"] = pitch_names[self.start] + attributes["NoteEnd"] = pitch_names[self.end] + + attributes["Sample"] = sample_name_func(self.sample_header_offset) + + if self.needs_rate_override: + attributes["SampleRate"] = self.sample_rate + if self.needs_note_override: + attributes["BaseNote"] = self.base_note + + xml.write_element("Drum", attributes) + + + + + + + +class AudiobankFile: + """ + """ + + def __init__(self, audiobank_seg : memoryview, index : int, table_entry : AudioCodeTableEntry, + seg_offset : int, bank1 : AudioTableFile, bank2 : AudioTableFile, bank1_num : int, bank2_num : int, + extraction_xml : Tuple[str, Element] = None): + self.bank_num = index + self.table_entry : AudioCodeTableEntry = table_entry + self.num_instruments = self.table_entry.num_instruments + self.data = self.table_entry.data(audiobank_seg, seg_offset) + self.bank1 : AudioTableFile = bank1 + self.bank2 : AudioTableFile = bank2 + self.bank1_num = bank1_num + self.bank2_num = bank2_num + + if extraction_xml is None: + self.file_name = f"Soundfont_{self.bank_num}" + self.name = f"Soundfont_{self.bank_num}" + + self.extraction_envelopes_info = None + self.extraction_instruments_info = None + self.extraction_drums_info = None + self.extraction_effects_info = None + else: + self.file_name = extraction_xml[0] + self.name = extraction_xml[1].attrib["Name"] + + self.extraction_envelopes_info = [] + self.extraction_instruments_info = {} + self.extraction_drums_info = [] + self.extraction_effects_info = [] + + for item in extraction_xml[1]: + if item.tag == "Envelopes": + for env in item: + assert env.tag == "Envelope" + self.extraction_envelopes_info.append(env.attrib["Name"]) + elif item.tag == "Instruments": + for instr in item: + assert instr.tag == "Instrument" + self.extraction_instruments_info[int(instr.attrib["ProgramNumber"])] = instr.attrib["Name"] + elif item.tag == "Drums": + for drum in item: + self.extraction_drums_info.append(drum.attrib["Name"]) + elif item.tag == "Effects": + for effect in item: + self.extraction_effects_info.append(effect.attrib["Name"]) + else: + assert False, item.tag + + # Coverage consists of a list of itervals of the form [[start,type],[end,type]] + self.coverage = [] + self.envelopes = {} + self.sample_headers = {} + self.books = {} + self.loops = {} + self.loops_have_frames = False + + # Read Drums + + self.collect_drums() + self.group_drums() + + # Read Sfx + + self.collect_sfx() + + # Read Instruments + + self.collect_instruments() + + + # Check Coverage + + self.cvg_log() + self.coverage = merge_ranges(self.coverage) + + self.resolve_cvg_gaps() + self.coverage = merge_ranges(self.coverage) + + coverage_log("Final Coverage:") + coverage_log([[[interval[0][0], interval[0][1].__name__], [interval[1][0], interval[1][1].__name__]] for interval in self.coverage]) + coverage_log(f"[[{0}, {len(self.data)}]]") + assert len(self.coverage) == 1 + coverage_log("OK") + + # Check End of File + + self.check_end() + + def collect_drums(self): + # Read structures + + self.drums_ptr_list_ptr = self.read_pointer(0, DrumsListPtr) + assert self.drums_ptr_list_ptr % 16 == 0 + self.drums_ptr_list = self.read_pointer_list(self.drums_ptr_list_ptr, self.table_entry.num_drums, DrumPtr) + self.drums = self.read_list_from_offset_list(self.drums_ptr_list, Drum) + + # Process structures + + for drum in self.drums: + if drum is None: + # NULL pointer in drums pointer list + continue + + # Read envelope + self.read_envelope(drum.envelope, drum.release_rate) + + # Read sample if it exists + if drum.tuning != 0 and drum.sample != 0: + self.read_sample_header(drum.sample, drum.tuning, drum) + + def group_drums(self): + self.drum_groups = [] + + first = True + last_drum = None + for drum in self.drums: + if drum is None: + if last_drum is None and not first: + self.drum_groups[-1].append(None) + else: + self.drum_groups.append([None]) + last_drum = None + else: + drum : Drum + + if not drum.group_continuation(last_drum): + # group changed + self.drum_groups.append(DrumGroup()) + + self.drum_groups[-1].append(drum) + last_drum = drum + + first = False + + note_start = 0 + for drum_grp in self.drum_groups: + note_end = note_start + len(drum_grp) - 1 + + if any(d is not None for d in drum_grp): + drum_grp : DrumGroup + drum_grp.set_range(note_start, note_end) + + note_start = note_end + 1 + + def collect_sfx(self): + # Read structures + + self.sfx_list_ptr = self.read_pointer(4, SfxListPtr) + assert self.sfx_list_ptr % 16 == 0 + self.sfx = self.read_list(self.sfx_list_ptr, self.table_entry.num_sfx, SoundFontSound) + + # Process structures + + for sfx in self.sfx: + # Read sample if it exists + if sfx.tuning != 0 and sfx.sample != 0: + self.read_sample_header(sfx.sample, sfx.tuning, sfx) + + def collect_instruments(self): + # Read structures + self.instrument_offset_list = self.read_pointer_list(8, self.table_entry.num_instruments, InstrumentPtr) + self.instruments = self.read_list_from_offset_list(self.instrument_offset_list, Instrument) + + # Record order information + for i,instr in enumerate(self.instruments): + if instr is None: + # NULL entry in pointer list + continue + instr.program_number = i + instr.offset = self.instrument_offset_list[i] + + # Get rid of NULL entries, these correspond to program numbers with no assigned instrument. + self.instruments = [instr for instr in self.instruments if instr is not None] + + # Build index map for sequence checking + self.instrument_index_map = { instr.program_number : instr for instr in self.instruments } + + # The struct index records the order of the instrument structures themselves. This is often different than the + # order they appear in the pointer table, since the pointer table is indexed by program number. We want to emit + # xml entries in struct order with a property stating their program number as this seems most user-friendly. + for i,instr in enumerate(sorted(self.instruments, key=lambda instr : instr.offset)): + instr : Instrument + instr.struct_index = i + + # Read data that this structure references + + for i,instr in enumerate(self.instruments): + # Read the envelope + self.read_envelope(instr.envelope, instr.release_rate) + + # Read the samples, if they exist + if instr.low_notes_tuning != 0 and instr.low_notes_sample != 0: + self.read_sample_header(instr.low_notes_sample, instr.low_notes_tuning, instr) + + if instr.normal_notes_tuning != 0 and instr.normal_notes_sample != 0: + self.read_sample_header(instr.normal_notes_sample, instr.normal_notes_tuning, instr) + + if instr.high_notes_tuning != 0 and instr.high_notes_sample != 0: + self.read_sample_header(instr.high_notes_sample, instr.high_notes_tuning, instr) + + def cvg_log(self): + if not LOG_COVERAGE: + return + + types_ranges = merge_like_ranges(self.coverage) + + for type_range in types_ranges: + interval_start, interval_start_type = type_range[0] + interval_end, _ = type_range[1] + + if interval_start == interval_end: + continue + + interval_length = interval_end - interval_start + + if interval_start_type == int: + sizeof_type = 4 + elif interval_start_type == Padding: + sizeof_type = interval_end - interval_start + elif interval_start_type == AdpcmBook: + sizeof_type = self.read_book_size(interval_start) + elif interval_start_type == AdpcmLoop: + sizeof_type = self.read_loop_size(interval_start) + elif interval_start_type == Envelope.EnvelopePoint: + sizeof_type = 4 + else: + sizeof_type = interval_start_type.SIZE + + array_size = interval_length // sizeof_type + + output_str = f"0x{interval_start:04X} - 0x{interval_end:04X} : {interval_start_type.__name__}" + if array_size != 1 or interval_start_type == Envelope.EnvelopePoint: + output_str += f"[{array_size}]" + + coverage_log(output_str) + + def resolve_cvg_gaps(self): + if len(self.coverage) < 2: + # There are already no gaps, nothing to do + return + + # Resolve gaps in coverage with heuristics + + for i in range(len(self.coverage) - 1): + prev_interval = self.coverage[i] + next_interval = self.coverage[i + 1] + + unref_start_offset, unref_start_type = prev_interval[1] + unref_end_offset, unref_end_type = next_interval[0] + + unaccounted_data = self.data[unref_start_offset:unref_end_offset] + + if unref_end_type in [AdpcmBook, AdpcmLoop] and all(b == 0 for b in unaccounted_data) and \ + unref_end_offset - unref_start_offset < 16 and (unref_end_offset % 16) == 0: + # Book and Loop structures are aligned to 16 byte boundaries, silently mark padding + self.coverage.append([[unref_start_offset, Padding], [unref_end_offset, Padding]]) + continue + + coverage_log(f"Unaccounted: 0x{unref_start_offset:04X}({unref_start_type.__name__}) " + \ + f"to 0x{unref_end_offset:04X}({unref_end_type.__name__})") + coverage_log([f"0x{b:02X}" for b in unaccounted_data]) + + try: + if unref_start_type == Envelope.EnvelopePoint: + # Assume it is an envelope if it follows an envelope + assert unref_start_offset not in self.envelopes + coverage_log("Unaccounted follows an envelope, assume it is an envelope") + st = self.read_envelope(unref_start_offset, None, is_zero=all(b == 0 for b in unaccounted_data)) + + elif unref_start_type in [SoundFontSample, AdpcmLoop]: + # Orphaned loops are unlikely, it's more likely a SoundFontSample + coverage_log("Unaccounted follows a SoundFontSample or AdpcmLoop, assuming SoundFontSample") + st = self.read_sample_header(unref_start_offset, None, None) + + elif unref_start_type == Instrument: + coverage_log("Unaccounted follows an Instrument, assume it is an Instrument") + st : Instrument = self.read_structure(unref_start_offset, unref_start_type) + # Check that we already saw the sample header this instrument wants + assert st.normal_notes_sample in self.sample_headers + assert st.normal_range_hi == 127 or st.high_notes_sample in self.sample_headers + assert st.normal_range_lo == 0 or st.low_notes_sample in self.sample_headers + # Insert into instrument list in the appropriate location, mark it as unused so that sfc knows not + # to add it to the instrument pointer list when recompiling + st.offset = unref_start_offset + st.unused = True + + # Assign struct index for this unreferenced instrument + new_index = -1 + for instr in sorted(self.instruments, key= lambda instr : instr.struct_index): + instr : Instrument + + if instr.offset > unref_start_offset: + if new_index == -1: + # Record struct index for the unused instrument + new_index = instr.struct_index + # Increment struct indices for every structure that occurs after this one + instr.struct_index += 1 + else: + # Give it a new index at the end + if new_index == -1: + new_index = len(self.instruments) + + st.struct_index = new_index + self.instruments.append(st) + else: + st = self.read_structure(unref_start_offset, unref_start_type) + coverage_log(st) + assert False, "Unhandled coverage case" # handle more structures if they appear + + coverage_log(st) + except Exception as e: + coverage_log("FAILED") + if all(b == 0 for b in unaccounted_data): + coverage_log("Probably padding or an empty file?") + raise e + + def check_end(self): + self.pad_to_size = None + + end = self.coverage[-1][1][0] + end_aligned = align(end, 16) + if end_aligned != len(self.data): + print(f"[Soundfont {self.bank_num:2}] Did not reach end of the file?", + f"0x{end_aligned:X} vs 0x{len(self.data):X}") + assert all(b == 0 for b in self.data[end_aligned:]) + self.pad_to_size = len(self.data) + + self.file_padding = None + + if not all(b == 0 for b in self.data[end:]): + print(f"[Soundfont {self.bank_num:2}] Non-zero unaccounted data at the end of the file?", + f"From 0x{end:X} to 0x{len(self.data):X}") + self.file_padding = self.data[end:] + + def dump_bin(self, path): + with open(path, "wb") as outfile: + outfile.write(self.data) + + def read_loop_size(self, offset): + loop_count, = struct.unpack(">I", self.data[offset+8:offset+0xC]) + return 0x30 if loop_count != 0 else 0x10 + + def read_loop_struct(self, offset): + return AdpcmLoop(self.logged_read(offset, self.read_loop_size(offset), AdpcmLoop)) + + def read_book_size(self, offset): + order, npredictors = struct.unpack(">ii", self.data[offset:offset+8]) + return 8 + 2 * 8 * order * npredictors + + def read_sample_header(self, offset, tuning, ob): + assert offset % 16 == 0 + + if offset in self.sample_headers: + # Don't re-read a sample header structure if it was already read + sample_header = self.sample_headers[offset] + sample_header : SoundFontSample + else: + # Read the new sample header and cache it + sample_header = self.read_structure(offset, SoundFontSample) + self.sample_headers[offset] = sample_header + + # Samples must always have an associated book + assert sample_header.book != 0 + + if sample_header.book in self.books: + # Lookup the book, samples may share books if they are identical + book = self.books[sample_header.book] + else: + # Read the new book + book_size = self.read_book_size(sample_header.book) + book = AdpcmBook(self.logged_read(sample_header.book, book_size, AdpcmBook)) + + # Books are `8 + 16 * n` bytes large and should start on an 0x10 byte boundary. + # Check that we get 8 bytes of padding following the book. + book_end = sample_header.book + book_size + assert sample_header.book % 16 == 0 + assert book_end % 16 == 8 + assert all(b == 0 for b in self.logged_read(book_end, 8, Padding)) + + # Cache it + self.books[sample_header.book] = book + + # Read the loop, if there is one + if sample_header.loop == 0: + # No loop + loop = None + elif sample_header.loop in self.loops: + # Already seen, look it up + loop = self.loops[sample_header.loop] + else: + # Read new loop structure + loop = self.read_loop_struct(sample_header.loop) + + # If loops were determined to store the sample's total frame count, require that all loops with nonzero + # count all have the same behavior within the same soundfont + if self.loops_have_frames and loop.count != 0: + assert loop.num_frames != 0, loop + + # If the numFrames field is nonzero anywhere, record this + # TODO this may miss some checks, fix? + if loop.num_frames != 0: + self.loops_have_frames = True + + # Add the sample to the appropriate samplebank + bank = self.bank1 if sample_header.medium == 0 else self.bank2 + if tuning is not None: + bank.add_sample(sample_header, book, loop, tuning, ob) + else: + # If we found unreferenced sample data that was not discovered elsewhere there is no tuning value to recover + # the samplerate from. These need to be handled manually, but this is currently unsupported as this does not + # occur in zelda64 audio banks. + assert sample_header.sample_addr in bank.samples , \ + "Unreferenced sample header refers to sample that was not otherwise discovered, cannot " + \ + "automatically recover sample rate" + + return sample_header + + def read_envelope_points(self, offset, is_zero=False): + size = 0 + + if not is_zero: + points = [] + + while True: + point = Envelope.EnvelopePoint(*struct.unpack(">hh", self.data[offset + size:][:4])) + assert point.delay >= -3 # TODO this could be used to determine whether data is really an envelope + points.append(point) + size += 4 + if point.delay < 0: + break + + # pad to 0x10 byte boundary + while (size % 16) != 0: + point = Envelope.EnvelopePoint(*struct.unpack(">hh", self.data[offset + size:][:4])) + assert point.delay == 0 and point.arg == 0 + points.append(point) + size += 4 + else: + size = 16 + points = [Envelope.EnvelopePoint(0, 0), Envelope.EnvelopePoint(0, 0), + Envelope.EnvelopePoint(0, 0), Envelope.EnvelopePoint(0, 0)] + + return points, size + + def read_envelope(self, offset, release_rate, is_zero=False): + assert offset % 16 == 0 + + if offset in self.envelopes: + # Look it up if it was already seen + env = self.envelopes[offset] + else: + # Read new + points, size = self.read_envelope_points(offset, is_zero) + env = Envelope(points, is_zero=is_zero) + + # Cache it + self.envelopes[offset] = env + # Mark coverage + self.coverage.append([[offset, Envelope.EnvelopePoint], [offset + size, Envelope.EnvelopePoint]]) + + # Add release rate if there was one + if release_rate is not None: + env.release_rates.append(release_rate) + + return env + + def logged_read(self, start, length, dtype): + """ + Read data while also recording coverage information + """ + end = start + length + self.coverage.append([[start, dtype], [end, dtype]]) + return self.data[start:end] + + def read_structure(self, offset, dtype): + return dtype(self.logged_read(offset, dtype.SIZE, dtype)) + + def read_list(self, offset, num, dtype): + return [dtype(i, self.logged_read(offset + i * dtype.SIZE, dtype.SIZE, dtype)) for i in range(num)] + + def read_pointer(self, offset, ptr_type): + return struct.unpack('>I', self.logged_read(offset, 4, ptr_type))[0] + + def read_list_from_offset_list(self, offset_list, dtype): + assert all([b % 0x10 == 0 for b in offset_list]) + return [dtype(self.logged_read(offset, dtype.SIZE, dtype)) if offset != 0 else None for offset in offset_list] + + def read_pointer_list(self, offset, count, ptr_type): + # May be NULL, but only if the count is 0 + assert (count == 0 and offset == 0) or offset != 0 + + if count == 0: + # No data + return [] + + # Read pointer list contents + ptr_list = [i[0] for i in struct.iter_unpack('>I', self.logged_read(offset, 4 * count, ptr_type))] + assert len(ptr_list) == count + + # Pointer lists seem to always pad to the next 0x10 byte boundary + pointers_end = offset + 4 * count + possible_pad = self.logged_read(pointers_end, align(pointers_end, 16) - pointers_end, Padding) + assert all(b == 0 for b in possible_pad) + + return ptr_list + + def sorted_envelopes(self): + # sort by offset + for i,(offset,env) in enumerate(sorted(self.envelopes.items(), key=lambda x : x[0])): + yield i,(offset,env) + + def envelope_name_func(self, offset): + return self.envelopes[offset].name + + def sorted_sample_headers(self): + for i,offset in enumerate(sorted(self.sample_headers)): + yield i,(offset,self.sample_headers[offset]) + + def lookup_sample(self, header_offset : int) -> Optional[AudioTableSample]: + if header_offset == 0: + return None + header : SoundFontSample = self.sample_headers[header_offset] + bank = self.bank1 if header.medium == 0 else self.bank2 + return bank.lookup_sample(header.sample_addr) + + def lookup_sample_name(self, sample_header : SoundFontSample): + bank = self.bank1 if sample_header.medium == 0 else self.bank2 + name = bank.lookup_sample(sample_header.sample_addr).name + assert name is not None + return name + + def sample_name_func(self, offset): + return self.lookup_sample_name(self.sample_headers[offset]) + + def finalize(self): + # Assign envelope names + for i,(offset,env) in self.sorted_envelopes(): + env : Envelope + env.name = self.envelope_name(i) + + # Link Instruments + for instr in self.instruments: + instr.finalize(self.lookup_sample) + + # Final Drum Groups + + if PLOT_DRUM_TUNING: + plt.clf() + plt.cla() + plt.title(f"Drums in soundfont {self.bank_num}") + plt.xlabel("Drum index") + plt.ylabel("Tuning value") + + for drum_grp in self.drum_groups: + if all(d is None for d in drum_grp): + continue + + if PLOT_DRUM_TUNING: + plt.plot( range(drum_grp.start,drum_grp.end), [drum.tuning for drum in drum_grp]) + plt.scatter(range(drum_grp.start,drum_grp.end), [drum.tuning for drum in drum_grp]) + + drum_grp : DrumGroup + drum_grp.finalize(self.envelopes, self.lookup_sample) + + if PLOT_DRUM_TUNING: + if len(self.drum_groups) != 0: + plt.savefig(f"figures/drums_{self.bank_num}.png") + + # Link SFX + for sfx in self.sfx: + sfx.finalize(self.lookup_sample) + + # TODO resolve decay/release index overrides? + + def envelope_name(self, index): + if self.extraction_envelopes_info is not None: + return self.extraction_envelopes_info[index] + else: + return f"Env{index}" + + def instrument_name(self, program_number): + if self.extraction_instruments_info is not None: + return self.extraction_instruments_info[program_number] + else: + return f"INST_{program_number}" + + def drum_grp_name(self, index): + if self.extraction_drums_info is not None: + return self.extraction_drums_info[index] + else: + return f"DRUM_{index}" + + def effect_name(self, index): + if self.extraction_effects_info is not None: + return self.extraction_effects_info[index] + else: + return f"EFFECT_{index}" + + def envelopes_to_xml(self, xml : XMLWriter): + if len(self.envelopes) == 0: + return + + xml.write_start_tag("Envelopes") + + for i,(offset,env) in self.sorted_envelopes(): + env : Envelope + env.to_xml(xml, self.envelope_name(i)) + + xml.write_end_tag() + + def samples_to_xml(self, xml : XMLWriter): + if len(self.sample_headers) == 0: + return + + xml.write_start_tag("Samples") + + # Emit these in the order the sample headers appear in the soundfont + for i,(offset,sample_header) in self.sorted_sample_headers(): + sample_header : SoundFontSample + sample_header.to_xml(xml, self.lookup_sample_name(sample_header)) + + xml.write_end_tag() + + def sfx_to_xml(self, xml : XMLWriter): + if len(self.sfx) == 0: + return + + xml.write_start_tag("Effects") + + for i,sfx in enumerate(self.sfx): + sfx.to_xml(xml, self.effect_name(i), self.sample_name_func) + + xml.write_end_tag() + + def drums_to_xml(self, xml : XMLWriter): + if len(self.drums) == 0: + return + + xml.write_start_tag("Drums") + + for i,drum_grp in enumerate(self.drum_groups): + if isinstance(drum_grp, list): + for _ in range(len(drum_grp)): + xml.write_element("Drum") + else: + drum_grp : DrumGroup + drum_grp.to_xml(xml, self.drum_grp_name(i), self.sample_name_func, self.envelope_name_func) + + xml.write_end_tag() + + def instruments_to_xml(self, xml : XMLWriter): + if len(self.instruments) == 0: + return + + xml.write_start_tag("Instruments") + + # Write in struct order + for instr in sorted(self.instruments, key=lambda instr : instr.struct_index): + instr : Instrument + name = self.instrument_name(instr.program_number) if not instr.unused else None + instr.to_xml(xml, name, self.sample_name_func, self.envelope_name_func) + + xml.write_end_tag() + + def to_xml(self, name, samplebanks_base): + xml = XMLWriter() + + start = { + "Name" : name, + "Index" : self.bank_num, + "Medium" : self.table_entry.medium.name, + "CachePolicy" : self.table_entry.cache_policy.name, + "SampleBank" : f"$(BUILD_DIR)/{samplebanks_base}/{self.bank1.file_name}.xml", + } + + # If the samplebank1 index is not the true index (that is it's a pointer), write an Indirect + if self.bank1_num != self.bank1.bank_num: + start["Indirect"] = self.bank1_num + + if self.bank2_num != 255: # bank2 is not None if bank2_num != 255 + start["SampleBankDD"] = f"$(BUILD_DIR)/{samplebanks_base}/{self.bank2.file_name}.xml", + # TODO we should really write an indirect for DD banks too if bank2_num != bank2.bank_num + + if self.loops_have_frames: + # Some MM banks have sample frame counts embedded in loop headers, but not all soundfonts do this + start["LoopsHaveFrames"] = "true" + + if max(instr.program_number or 0 for instr in self.instruments) + 1 != self.table_entry.num_instruments: + # Some banks have trailing NULLs in their instrument pointer tables, record the max length for matching + start["NumInstruments"] = self.table_entry.num_instruments + + if self.pad_to_size is not None: + # The final soundfont typically has extra zeros at the end + start["PadToSize"] = f"0x{self.pad_to_size:X}" + + xml.write_start_tag("Soundfont", start) + + self.envelopes_to_xml(xml) + self.samples_to_xml(xml) + + self.sfx_to_xml(xml) + self.drums_to_xml(xml) + self.instruments_to_xml(xml) + + if self.file_padding is not None: + # Some soundfonts may have garbage data in the final 16-byte file padding + xml.write_start_tag("MatchPadding") + xml.write_raw(", ".join(f"0x{b:02X}" for b in self.file_padding)) + xml.write_end_tag() + + xml.write_end_tag() + return str(xml) + + def write_extraction_xml(self, path): + xml = XMLWriter() + + xml.write_comment("This file is only for extraction of vanilla data. For other purposes see assets/audio/soundfonts/") + + xml.write_start_tag("SoundFont", { + "Name" : self.name, + "Index" : self.bank_num, + }) + + # add contents for names + + if len(self.envelopes) != 0: + xml.write_start_tag("Envelopes") + + for i in range(len(self.envelopes)): + xml.write_element("Envelope", { + "Name" : self.envelope_name(i) + }) + + xml.write_end_tag() + + if len(self.instruments) != 0: + xml.write_start_tag("Instruments") + + # Write in struct order + for instr in sorted(self.instruments, key=lambda instr : instr.struct_index): + instr : Instrument + if not instr.unused: + xml.write_element("Instrument", { + "ProgramNumber" : instr.program_number, + "Name" : self.instrument_name(instr.program_number), + }) + + xml.write_end_tag() + + if any(isinstance(dg, DrumGroup) for dg in self.drum_groups): + xml.write_start_tag("Drums") + + for i,drum_grp in enumerate(self.drum_groups): + if isinstance(drum_grp, DrumGroup): + xml.write_element("Drum", { + "Name" : self.drum_grp_name(i) + }) + + xml.write_end_tag() + + if len(self.sfx) != 0: + xml.write_start_tag("Effects") + + for i,sfx in enumerate(self.sfx): + xml.write_element("Effect", { + "Name" : self.effect_name(i) + }) + + xml.write_end_tag() + + xml.write_end_tag() + + with open(path, "w") as outfile: + outfile.write(str(xml)) diff --git a/tools/audio/extraction/audiobank_structs.py b/tools/audio/extraction/audiobank_structs.py new file mode 100644 index 0000000000..fa6afa37d0 --- /dev/null +++ b/tools/audio/extraction/audiobank_structs.py @@ -0,0 +1,406 @@ +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 +# +# This file implements reading various structures resident to the Audiobank files. +# Additionally handles: +# - Linking with finalized samples +# - Writing xml elements representing these structures in soundfont xmls +# + +import struct +from enum import IntEnum + +from .audio_tables import AudioStorageMedium +from .tuning import rate_from_tuning, pitch_names +from .util import XMLWriter + +VADPCM_VERSTAMP = 1 + +class AudioSampleCodec(IntEnum): + CODEC_ADPCM = 0 + CODEC_S8 = 1 + CODEC_S16_INMEMORY = 2 + CODEC_SMALL_ADPCM = 3 + CODEC_REVERB = 4 + CODEC_S16 = 5 + + + +class SoundFontSample: # SampleHeader ? + """ + typedef struct { + /* 0x00 */ u32 codec : 4; + /* 0x00 */ u32 medium : 2; // storage medium determines which of the two sample bank ids to use when relocating sampleAddr + /* 0x00 */ u32 cached : 1; + /* 0x00 */ u32 isRelocated : 1; + /* 0x01 */ u32 size : 24; + /* 0x04 */ u8* sampleAddr; // offset into the sample bank associated with this soundfont + /* 0x08 */ AdpcmLoop* loop; + /* 0x0C */ AdpcmBook* book; + } SoundFontSample; // size = 0x10 + """ + SIZE = 0x10 + + def __init__(self, data): + bits, self.sample_addr, self.loop, self.book = struct.unpack(">IIII", data[:0x10]) + + self.codec = AudioSampleCodec((bits >> 28) & 0b1111) + self.medium = AudioStorageMedium((bits >> 26) & 0b11) + self.cached = bool((bits >> 25) & 1) + self.is_relocated = bool((bits >> 24) & 1) + self.size = (bits >> 0) & 0b111111111111111111111111 + + assert self.book != 0 + assert self.loop != 0 + assert self.codec in [AudioSampleCodec.CODEC_ADPCM, AudioSampleCodec.CODEC_SMALL_ADPCM] + assert self.medium == 0 + assert not self.is_relocated # Not relocated in ROM + + def to_xml(self, xml : XMLWriter, name : str, rate_override = None, note_override = None): + # Example xml output: + # + + attrs = { "Name" : name } + if rate_override is not None: + attrs["SampleRate"] = rate_override + if note_override is not None: + attrs["BaseNote"] = note_override + if self.medium != 0: + attrs["IsDD"] = "true" + if self.cached: + attrs["Cached"] = str(self.cached).lower() + + xml.write_element("Sample", attrs) + + def __str__(self): + out = "(SoundFontSample){\n" + out += f" .codec = {self.codec.name}\n" + out += f" .medium = {self.medium.name}\n" + out += f" .cached = {self.cached}\n" + out += f" .is_relocated = {self.is_relocated}\n" + out += f" .size = 0x{self.size:X}\n" + out += f" .sampleAddr = 0x{self.sample_addr:X}\n" + out += f" .loop = 0x{self.loop:X}\n" + out += f" .book = 0x{self.book:X}\n" + out += "}\n" + return out + + + +class AdpcmLoop: + """ + typedef struct { + /* 0x00 */ u32 start; + /* 0x04 */ u32 end; + /* 0x08 */ u32 count; + /* 0x0C */ u32 numFrames; + /* 0x10 */ s16 state[16]; // only exists if count != 0. 8-byte aligned + } AdpcmLoop; // size = 0x30 (or 0x10) + """ + + def __init__(self, data): + self.start, self.end, self.count, self.num_frames = struct.unpack(">IIII", data[:0x10]) + + # We expect loops to be either "no loop" or "infinite", as these are all that vadpcm_enc could handle. + assert self.count in (0,0xFFFFFFFF) + + if self.count != 0: + self.state = tuple(s[0] for s in struct.iter_unpack(">h", data[0x10:0x30])) + else: + # A count of 0 indicates "no loop", but a loop structure is mandatory for all samples so something had to + # be emitted. Ensure the start is at 0, later we will ensure that the end is at the last frame of the sample + # once we have the sample data. + assert self.start == 0 + self.state = tuple([0] * 16) + assert len(self.state) == 16 + + def serialize(self): + """ + Creates VADPCMLOOPS section data for aifc files + """ + NUM_LOOPS = 1 + + return struct.pack(">HHIII16h", + VADPCM_VERSTAMP, NUM_LOOPS, + self.start, self.end, self.count, + *self.state) + + def __eq__(self, other): + if not isinstance(other, AdpcmLoop): + return False + other : AdpcmLoop + + start_matches = self.start == other.start + end_matches = self.end == other.end + count_matches = self.count == other.count + # We don't check num_frames in loop equality since loops in different soundfonts referring to the same + # sample data may not have this field filled out + return start_matches and end_matches and count_matches and self.state == other.state + + def __str__(self): + out = "(AdpcmLoop){\n" + out += f" .start = {self.start},\n" + out += f" .end = {self.end},\n" + out += f" .count = {self.count},\n" + out += f" .numFrames = {self.num_frames},\n" + out += f" .state = {self.state},\n" + out += "}\n" + return out + +class AdpcmBook: + """ + typedef struct { + /* 0x00 */ s32 order; + /* 0x04 */ s32 npredictors; + /* 0x08 */ s16 book[1]; // size 8 * order * npredictors. 8-byte aligned + } AdpcmBook; // size >= 0x8 + """ + + def __init__(self, data): + self.order, self.n_predictors = struct.unpack(">ii", data[:8]) + self.book = tuple(s[0] for s in struct.iter_unpack(">h", data[8:][:2 * 8 * self.order * self.n_predictors])) + assert len(self.book) == 8 * self.order * self.n_predictors , (len(self.book), 8 * self.order * self.n_predictors) + + def serialize(self): + header = struct.pack(">hhh", VADPCM_VERSTAMP, self.order, self.n_predictors) + data = b"".join(struct.pack(">h", x) for x in self.book) + return header + data + + def __eq__(self, other): + if not isinstance(other, AdpcmBook): + return False + other : AdpcmBook + + order_matches = self.order == other.order + npredictors_matches = self.n_predictors == other.n_predictors + return order_matches and npredictors_matches and self.book == other.book + + def __str__(self): + out = "(AdpcmBook){\n" + out += f" .order = {self.order},\n" + out += f" .npredictors = {self.n_predictors},\n" + out += f" .book = {self.book},\n" + out += "}\n" + return out + + + +class SoundFontSound: + """ + typedef struct { + /* 0x00 */ SoundFontSample* sample; + /* 0x04 */ f32 tuning; // frequency scale factor + } SoundFontSound; // size = 0x8 + """ + SIZE = 8 + + def __init__(self, index, data): + self.index = index + self.sample, self.tuning = struct.unpack(">If", data[:8]) + + def finalize(self, sample_lookup_fn): + from .audiotable import AudioTableSample + + sample = sample_lookup_fn(self.sample) + if sample is None: + return + + assert isinstance(sample, AudioTableSample) + sample : AudioTableSample + + assert self.tuning in sample.tuning_map + rate,note = sample.tuning_map[self.tuning] + + self.sample_rate = rate + self.needs_rate_override = self.sample_rate != sample.sample_rate + + self.base_note = note + self.needs_note_override = self.base_note != sample.base_note + + def __str__(self) -> str: + out = "(SoundFontSound}{\n" + out += f" .sample = 0x{self.sample:X}\n" + out += f" .tuning = {self.tuning:.7f}f\n" + out += "}\n" + return out + + def to_xml(self, xml : XMLWriter, name : str, sample_name_func): + if self.sample == 0 and self.tuning == 0: + xml.write_element("Effect") + else: + attrs = { + "Name" : name, + "Sample" : sample_name_func(self.sample), + } + if self.needs_rate_override: + attrs["SampleRate"] = self.sample_rate + if self.needs_note_override: + attrs["BaseNote"] = self.base_note + + xml.write_element("Effect", attrs) + + + +class Drum: + """ + typedef struct { + /* 0x00 */ u8 releaseRate; + /* 0x01 */ u8 pan; + /* 0x02 */ u8 isRelocated; + /* 0x04 */ SoundFontSound sound; + /* 0x0C */ AdsrEnvelope* envelope; + } Drum; // size = 0x10 + """ + SIZE = 0x10 + + def __init__(self, data): + self.release_rate, self.pan, self.is_relocated, self.sample, self.tuning, self.envelope = \ + struct.unpack(">BBBxIfI", data[:0x10]) + + assert self.is_relocated == 0 + + def group_continuation(self, other): + """ + Determine if self is a continuation of the drum group containing other, the last drum added. + """ + # If there is no previous drum or the previous drum was an empty entry, always begin a new group + if other is None: + return False + + assert isinstance(other, Drum) + + # Check general agreement, if these attributes do not match it is certainly not part of the same group + if self.sample == other.sample and self.pan == other.pan and self.envelope == other.envelope and \ + self.release_rate == other.release_rate: + # If there is any intersection in the samplerates, assume these are in the same drum group + samplerates1 = set(rate for _,rate in rate_from_tuning(self.tuning)) + samplerates2 = set(rate for _,rate in rate_from_tuning(other.tuning)) + return len(samplerates1.intersection(samplerates2)) != 0 + + return False + + def __str__(self): + out = "(Drum){\n" + out += f" .releaseRate = {self.release_rate},\n" + out += f" .pan = {self.pan},\n" + out += f" .isRelocated = {self.is_relocated},\n" + out += f" .sound.sample = 0x{self.sample:X},\n" + out += f" .sound.tuning = {self.tuning:.7f}f,\n" + out += f" .envelope = 0x{self.envelope:X},\n" + out += "}\n" + return out + + + +class Instrument: + """ + typedef struct { + /* 0x00 */ u8 isRelocated; + /* 0x01 */ u8 normalRangeLo; + /* 0x02 */ u8 normalRangeHi; + /* 0x03 */ u8 releaseRate; + /* 0x04 */ AdsrEnvelope* envelope; + /* 0x08 */ SoundFontSound lowNotesSound; + /* 0x10 */ SoundFontSound normalNotesSound; + /* 0x18 */ SoundFontSound highNotesSound; + } Instrument; // size = 0x20 + """ + SIZE = 0x20 + + def __init__(self, data): + self.is_relocated, self.normal_range_lo, self.normal_range_hi, self.release_rate, self.envelope, \ + self.low_notes_sample, self.low_notes_tuning, \ + self.normal_notes_sample, self.normal_notes_tuning, \ + self.high_notes_sample, self.high_notes_tuning = struct.unpack(">BBBBIIfIfIf", data[:0x20]) + + self.program_number = None + self.offset = None + self.struct_index = None + self.unused = False + + assert self.is_relocated == 0 + + # Sample is either present or the split point is at the start/end + assert not (self.low_notes_sample == 0 and self.low_notes_tuning == 0.0) or self.normal_range_lo == 0 + assert not (self.high_notes_sample == 0 and self.high_notes_tuning == 0.0) or self.normal_range_hi == 127 + + def __str__(self): + out = "(Instrument){\n" + out += f" .isRelocated = {self.is_relocated},\n" + out += f" .normalRangeLo = {self.normal_range_lo},\n" + out += f" .normalRangeHi = {self.normal_range_hi},\n" + out += f" .releaseRate = {self.release_rate},\n" + out += f" .envelope = 0x{self.envelope:X},\n" + out += f" .lowNotesSound.sample = {self.low_notes_sample},\n" + out += f" .lowNotesSound.tuning = {self.low_notes_tuning},\n" + out += f" .normalNotesSound.sample = {self.normal_notes_sample},\n" + out += f" .normalNotesSound.tuning = {self.normal_notes_tuning},\n" + out += f" .highNotesSound.sample = {self.high_notes_sample},\n" + out += f" .highNotesSound.tuning = {self.high_notes_tuning},\n" + out += "}\n" + return out + + def finalize(self, sample_lookup_fn): + from .audiotable import AudioTableSample + + self.sample_rate = [None] * 3 + self.base_note = [None] * 3 + self.needs_rate_override = [False] * 3 + self.needs_note_override = [False] * 3 + + sample_offsets = (self.low_notes_sample, self.normal_notes_sample, self.high_notes_sample) + tunings = (self.low_notes_tuning, self.normal_notes_tuning, self.high_notes_tuning) + for i,(sample_offset,tuning) in enumerate(zip(sample_offsets, tunings)): + sample = sample_lookup_fn(sample_offset) + if sample is None: + continue + assert isinstance(sample, AudioTableSample) + sample : AudioTableSample + + assert tuning in sample.tuning_map + rate,note = sample.tuning_map[tuning] + + self.sample_rate[i] = rate + self.needs_rate_override[i] = self.sample_rate[i] != sample.sample_rate + + self.base_note[i] = note + self.needs_note_override[i] = self.base_note[i] != sample.base_note + + def to_xml(self, xml : XMLWriter, name : str, sample_names_func, envelope_name_func): + attributes = {} + + if not self.unused: + attributes["ProgramNumber"] = self.program_number + attributes["Name"] = name + + # TODO release rate overrides? + attributes.update({ + "Envelope" : envelope_name_func(self.envelope), + #"Release" : self.release_rate, + "Sample" : sample_names_func(self.normal_notes_sample), + }) + + if self.needs_rate_override[1]: + attributes["SampleRate"] = self.sample_rate[1] + if self.needs_note_override[1]: + attributes["BaseNote"] = self.base_note[1] + + if self.normal_range_lo != 0: + attributes["RangeLo"] = pitch_names[self.normal_range_lo] + attributes["SampleLo"] = sample_names_func(self.low_notes_sample) + + if self.needs_rate_override[0]: + attributes["SampleRateLo"] = self.sample_rate[0] + if self.needs_note_override[0]: + attributes["BaseNoteLo"] = self.base_note[0] + + if self.normal_range_hi != 127: + attributes["RangeHi"] = pitch_names[self.normal_range_hi] + attributes["SampleHi"] = sample_names_func(self.high_notes_sample) + + if self.needs_rate_override[2]: + attributes["SampleRateHi"] = self.sample_rate[2] + if self.needs_note_override[2]: + attributes["BaseNoteHi"] = self.base_note[2] + + xml.write_element("Instrument" if not self.unused else "InstrumentUnused", attributes) diff --git a/tools/audio/extraction/audiotable.py b/tools/audio/extraction/audiotable.py new file mode 100644 index 0000000000..9511acecda --- /dev/null +++ b/tools/audio/extraction/audiotable.py @@ -0,0 +1,692 @@ +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 +# +# +# + +import math, struct +from typing import Dict, Tuple +from xml.etree.ElementTree import Element + +from .audio_tables import AudioCodeTableEntry +from .audiobank_structs import AudioSampleCodec, SoundFontSample, AdpcmBook, AdpcmLoop +from .tuning import pitch_names, note_z64_to_midi, recalc_tuning, rate_from_tuning, rank_rates_notes, BAD_FLOATS +from .util import align, error, XMLWriter, f32_to_u32 + +class AIFCFile: + + def __init__(self): + self.sections = [] + self.total_size = 0 + + @staticmethod + def pstring(data): + return bytes([len(data)]) + data + (b"" if len(data) % 2 else b"\0") + + @staticmethod + def serialize_f80(num): + """ + Convert num to 80-bit float. Does not accept denormal/infinity/nan but these should never appear anyway. + """ + num = float(num) + if num == 0.0: + return b"\0" * 10 + elif num == -0.0: + return b"\x80" + b"\0" * 9 + + f64_bits, = struct.unpack(">Q", struct.pack(">d", num)) + + f64_sign_bit = f64_bits & (2 ** 63) + + f64_exponent = (f64_bits ^ f64_sign_bit) >> 52 + assert f64_exponent != 0, "can't handle denormals" + assert f64_exponent != 0x7FF, "can't handle infinity/nan" + f64_exponent -= 1023 + + f64_mantissa = f64_bits & (2 ** 52 - 1) + + f80_sign_bit = f64_sign_bit << (80 - 64) + f80_exponent = (f64_exponent + 0x3FFF) << 64 + f80_mantissa = (2 ** 63) | (f64_mantissa << (63 - 52)) + + f80 = f80_sign_bit | f80_exponent | f80_mantissa + + return struct.pack(">HQ", f80 >> 64, f80 & (2 ** 64 - 1)) + + def add_section(self, tp, data): + assert isinstance(tp, bytes) + assert isinstance(data, bytes) + + self.sections.append((tp, data)) + self.total_size += align(len(data),2) + 8 + + def add_custom_section(self, tp, data): + self.add_section(b"APPL", b"stoc" + self.pstring(tp) + data) + + def remove_section(self, tp): + assert isinstance(tp, bytes) + + for s_tp, s_data in self.sections: + if s_tp == tp: + self.sections.remove((s_tp, s_data)) + self.total_size -= align(len(s_data),2) + 8 + return + + def commit(self, outpath): + self.total_size += 4 + + with open(outpath, "wb") as outfile: + outfile.write(b"FORM" + struct.pack(">I", self.total_size) + b"AIFC") + + for tp, data in self.sections: + outfile.write(tp + struct.pack(">I", len(data))) + outfile.write(data) + + if len(data) % 2: + outfile.write(b"\0") + +class AudioTableData: + """ + Unaccounted data in the Audiotable + """ + + def __init__(self, start, end, data): + self.start : int = start + self.end : int = end + self.data = data + assert len(self.data) % 2 == 0 + + self.name : str = None + self.filename : str = None + + def __len__(self): + return len(self.data) + + def to_asm(self, name): + out = f"# {name} [0x{self.start:X}:0x{self.end:X}](0x{self.end-self.start:X})\n\n" + out += " .byte " + for i,b in enumerate(self.data): + if i != 0 and i % 32 == 0: + out = out[:-2] + "\n .byte " + out += f"0x{b:02X}, " + out = out[:-2] + "\n\n" + return out + + def to_file(self, outpath : str): + # Output as binary blob + + with open(outpath, "wb") as outfile: + outfile.write(self.data) + + + +PCM16_SAMPLE_SIZE = 16 + +class AudioTableSample(AudioTableData): + """ + Sample in the Audiotable + """ + + def __init__(self, start : int, end : int, header : SoundFontSample, data, book : AdpcmBook, loop : AdpcmLoop, padding=None): + super().__init__(start, end, data) + + self.header : SoundFontSample = header + self.book : AdpcmBook = book + self.loop : AdpcmLoop = loop + self.padding = padding + + self.notes_rates = set() + self.sample_rate = None + self.base_note = None + self.tuning_map = None + + if self.loop.count == 0: + # If a count is 0 the loop end must be the (bugged, vadpcm_enc computed it wrong originally) frame count + num_frames_bugged = (len(self.data) * PCM16_SAMPLE_SIZE) // self.frame_size() + assert self.loop.end == num_frames_bugged, f"{self.loop.end}, {num_frames_bugged}" + + def clone(self, start, end, padding): + new_sample = AudioTableSample(start, end, self.header, self.data, self.book, self.loop, padding) + new_sample.notes_rates = self.notes_rates + return new_sample + + def frame_size(self): + return { + AudioSampleCodec.CODEC_ADPCM : 9, + AudioSampleCodec.CODEC_S8 : 16, + AudioSampleCodec.CODEC_S16_INMEMORY : 32, + AudioSampleCodec.CODEC_SMALL_ADPCM : 5, + AudioSampleCodec.CODEC_REVERB : 0, + AudioSampleCodec.CODEC_S16 : 32 + }[self.header.codec] + + def codec_id(self): + return { + AudioSampleCodec.CODEC_ADPCM : b'ADP9', + AudioSampleCodec.CODEC_S8 : b'HPCM', + AudioSampleCodec.CODEC_S16_INMEMORY : b'NONE', + AudioSampleCodec.CODEC_SMALL_ADPCM : b'ADP5', + AudioSampleCodec.CODEC_REVERB : b'RVRB', + AudioSampleCodec.CODEC_S16 : b'NONE', + }[self.header.codec] + + def codec_name(self): + return { + AudioSampleCodec.CODEC_ADPCM : b"Nintendo/SGI VADPCM 9-bytes/frame", + AudioSampleCodec.CODEC_S8 : b"Half-frame PCM", + AudioSampleCodec.CODEC_S16_INMEMORY : b"Uncompressed", + AudioSampleCodec.CODEC_SMALL_ADPCM : b"Nintendo/SGI VADPCM 5-bytes/frame", + AudioSampleCodec.CODEC_REVERB : b"Nintendo Reverb format", + AudioSampleCodec.CODEC_S16 : b"Uncompressed" + }[self.header.codec] + + def codec_file_extension_compressed(self): + ext = { + AudioSampleCodec.CODEC_ADPCM : ".aifc", + AudioSampleCodec.CODEC_S8 : None, + AudioSampleCodec.CODEC_S16_INMEMORY : None, + AudioSampleCodec.CODEC_SMALL_ADPCM : ".half.aifc", + AudioSampleCodec.CODEC_REVERB : None, + AudioSampleCodec.CODEC_S16 : ".aiff", + }[self.header.codec] + assert ext is not None + return ext + + def codec_file_extension_decompressed(self): + ext = { + AudioSampleCodec.CODEC_ADPCM : ".wav", + AudioSampleCodec.CODEC_S8 : None, + AudioSampleCodec.CODEC_S16_INMEMORY : None, + AudioSampleCodec.CODEC_SMALL_ADPCM : ".half.wav", + AudioSampleCodec.CODEC_REVERB : None, + AudioSampleCodec.CODEC_S16 : ".wav", + }[self.header.codec] + assert ext is not None + return ext + + def base_note_number(self): + return note_z64_to_midi(pitch_names.index(self.base_note)) + + def resolve_basenote_rate(self, extraction_sample_info : Dict[int, Dict[str,str]]): + assert len(self.notes_rates) != 0 + + # rate_3ds = None + # if SAMPLERATES_3DS is not None: + # rate_3ds = SAMPLERATES_3DS[self.bank_num].get(i, None) + + tuning_map = {} + def update_tuning_map(tuning, rate, note): + tuning_map.update({ tuning : (rate, note) }) + + # check + tuning_bits = f32_to_u32(tuning) + ntuning = recalc_tuning(rate, note) + assert ntuning == tuning or tuning_bits in BAD_FLOATS, \ + f"Got: {ntuning}(0x{f32_to_u32(ntuning):X}), Expected: {tuning}(0x{f32_to_u32(tuning):X})" + + if len(self.notes_rates) == 1: + # only need to match one tuning value + + notes_rates,tuning = self.notes_rates.pop() + + # if rate_3ds is not None and rate_3ds not in [rate for _,rate in notes_rates]: + # print(f"NONMATCHING: 3DS={rate_3ds} N64={[rate for _,rate in notes_rates]}") + + if len(notes_rates) == 1: + # only one possible combination of samplerate and basenote + final_note,final_rate = notes_rates[0] + else: + # Several possible combinations of samplerate and basenote that result in the same tuning value, + # choose just one by arbitrary ranking + final_rate,(final_note,) = rank_rates_notes(tuple((rate, (note,)) for note,rate in notes_rates)) + + update_tuning_map(tuning, final_rate, final_note) + else: + # need to match for multiple tuning values + + # produce a list of samplerates that are common to all entries, the correct samplerate is most likely in + # this intersection + rate_cands = set.intersection(*(set(rate for note,rate in nrs) for nrs,t in self.notes_rates)) + + # if rate_3ds is not None and rate_3ds not in rate_cands: + # print(f"NONMATCHING: 3DS={rate_3ds} N64={rate_cands}") + + if len(rate_cands) == 0: + # no common samplerates, arbitrarily rank each separately to get best candidate for each tuning, then + # rank those again to find the one we should associate with the sample itself + + finalists = [] + for all_layout,tuning in self.notes_rates: + best_rate,(best_note,) = rank_rates_notes([(rate, (note,)) for note, rate in all_layout]) + + update_tuning_map(tuning, best_rate, best_note) + + finalists.append((best_rate,(best_note,))) + + final_rate,(final_note,) = rank_rates_notes(finalists) + else: + tunings = [t for nrs,t in self.notes_rates] + # Found one or more common samplerate, select just one by arbitrary ranking + + # build a map from samplerate -> note value for each entry + dicts = tuple(dict((rate,note) for note,rate in nrs) for nrs,t in self.notes_rates) + + # list of tuples (rate, (notes for each entry)) for each candidate samplerate + final_rate,final_notes = rank_rates_notes([(rate, tuple(D[rate] for D in dicts)) for rate in rate_cands]) + + finalists = [] + + # map the result of this stage to the tunings + for tuning,note in zip(tunings,final_notes): + update_tuning_map(tuning, final_rate, note) + finalists.append((final_rate,(note,))) + + # select best note to go in the sample + final_rate,(final_note,) = rank_rates_notes(finalists) + + if extraction_sample_info is not None: + if self.start in extraction_sample_info: + entry = extraction_sample_info[self.start] + if "SampleRate" in entry and "BaseNote" in entry: + final_rate = int(entry["SampleRate"]) + final_note = entry["BaseNote"] + else: + print(f"WARNING: Missing extraction xml entry for sample at offset=0x{self.start:X}") + + # print(" ",len(FINAL_NOTES_RATES), FINAL_NOTES_RATES) + # if rate_3ds is not None and len(FINAL_NOTES_RATES) == 1: + # print(f"3DS : {rate_3ds} N64 : {FINAL_NOTES_RATES[0][0]}") + # if rate_3ds != FINAL_NOTES_RATES[0][0]: + # print("NONMATCHING AFTER RANKING") + # else: + # print("No 3DS comparison") + + self.notes_rates = None + self.sample_rate = final_rate + self.base_note = final_note + self.tuning_map = tuning_map + + def to_file(self, outpath : str): + assert self.sample_rate is not None and self.base_note is not None,\ + f"The sample must have been assigned a samplerate and basenote to be extracted to AIFC: [0x{self.start:X}:0x{self.end:X}]\n{self.header}" + + NUM_CHANNELS = 1 + + # Note this computes the correct number of frames, The original sdk tool vadpcm_enc contained a bug where aifc + # files would sometimes be 1-off in the reported number of frames. We do not reproduce this. + num_frames = (len(self.data) // self.frame_size()) * PCM16_SAMPLE_SIZE + + aifc = AIFCFile() + + aifc.add_section(b"COMM", + struct.pack(">hIh", NUM_CHANNELS, num_frames, PCM16_SAMPLE_SIZE) + + AIFCFile.serialize_f80(self.sample_rate) + + self.codec_id() + + AIFCFile.pstring(self.codec_name()) + ) + + aifc.add_section(b"INST", + struct.pack(">bbbbbbhhhhhhh", + self.base_note_number(), + 0, # detune + # TODO fill in the rest? with what? + 0, # lownote + 0, # highnote + 0, # lowvel + 0, # highvel + 0, # gain + 0,0,0, # sustain(mode,start,end) + 0,0,0, # release(mode,start,end) + ) + ) + + aifc.add_custom_section(b"VADPCMCODES", self.book.serialize()) + if self.loop.count != 0: + # We don't need to write a VADPCMLOOPS chunk if the count is 0 as we can represent these by the absence of + # a VADPCMLOOPS chunk; a count of 0 indicates the sample has no loop, the start and end of a loop with + # count=0 are always 0 and the end of the sample respectively. + aifc.add_custom_section(b"VADPCMLOOPS", self.loop.serialize()) + + aifc.add_section(b"SSND", struct.pack(">II", 0, 0) + bytes(self.data)) + + aifc.commit(outpath) + + def to_asm(self, name): + out = f"# {name} [0x{self.start:X}:0x{self.end:X}](0x{self.end-self.start:X})\n" + out += "\n" + out += f".global {name}\n" + out += f"{name}:\n" + out += f".global {name}_OFF\n" + out += f".set {name}_OFF, . - $start\n" + out += "\n" + out += " .byte " + for i,b in enumerate(self.data): + if i != 0 and i % 32 == 0: + out = out[:-2] + "\n .byte " + out += f"0x{b:02X}, " + out = out[:-2] + "\n" + if len(self.padding) == 0 or all(b == 0 for b in self.padding): + out += " .balign 16\n" + else: + out += f"# PADDING\n" + out += " .byte " + ", ".join(f"0x{b:02X}" for b in self.padding) + "\n" + out += "\n" + return out + + + + + + + +class AudioTableFile: + """ + Single sample bank in the Audiotable + """ + + def __init__(self, bank_num : int, audiotable_seg : memoryview, table_entry : AudioCodeTableEntry, + seg_offset : int, buffer_bug : bool = False, extraction_xml : Tuple[str, Element] = None): + self.bank_num = bank_num + self.table_entry : AudioCodeTableEntry = table_entry + self.data = self.table_entry.data(audiotable_seg, seg_offset) + self.buffer_bug = buffer_bug + + self.samples_final = None + + if extraction_xml is None: + self.file_name = f"SampleBank_{self.bank_num}" + self.name = f"SampleBank_{self.bank_num}" + self.extraction_sample_info = None + self.extraction_blob_info = None + else: + self.file_name = extraction_xml[0] + self.name = extraction_xml[1].attrib["Name"] + + self.extraction_sample_info = {} + self.extraction_blob_info = {} + for item in extraction_xml[1]: + if item.tag == "Sample": + self.extraction_sample_info[int(item.attrib["Offset"], 16)] = item.attrib + elif item.tag == "Blob": + self.extraction_blob_info[int(item.attrib["Offset"], 16)] = item.attrib + else: + assert False + + self.pointer_indices = [] + + self.samples = {} + self.coverage = set() + + def register_ptr(self, index): + self.pointer_indices.append(index) + + def dump_bin(self, path): + with open(path, "wb") as outfile: + outfile.write(self.data) + + def __len__(self): + return len(self.data) + + def add_sample(self, sample_header : SoundFontSample, book : AdpcmBook, loop : AdpcmLoop, tuning : float, ob): + # collect sample data + sample_start = sample_header.sample_addr + sample_end = sample_header.sample_addr + sample_header.size + sample_end_aligned = align(sample_end, 16) + sample_data = self.data[sample_start:sample_end] + sample_padding = self.data[sample_end:sample_end_aligned] + notes_rates = rate_from_tuning(tuning) + + # update coverage + self.coverage.add((sample_start, sample_end_aligned, sample_end)) + + if sample_start in self.samples: + # if this sample start was already recorded, compare with previous + prev_sample : AudioTableSample = self.samples[sample_start] + + # check data integrity, these should not change if the same is the same + assert prev_sample.end == sample_end + assert prev_sample.header.codec == sample_header.codec + assert prev_sample.book == book + assert prev_sample.loop == loop + + # add notes/rates candidates + prev_sample.notes_rates.add((notes_rates, tuning)) + else: + # if this sample start was not recorded, add it + new_sample = AudioTableSample(sample_start, sample_end, sample_header, sample_data, book, loop, sample_padding) + new_sample.notes_rates.add((notes_rates, tuning)) + self.samples[sample_start] = new_sample + + def lookup_sample(self, offset : int) -> AudioTableSample: + return self.samples[offset] + + def sample_name(self, sample : AudioTableSample, index : int): + if self.extraction_sample_info is not None: + if sample.start in self.extraction_sample_info: + return self.extraction_sample_info[sample.start]["Name"] + print(f"WARNING: Missing extraction xml entry for sample at offset=0x{sample.start:X}") + return f"SAMPLE_{self.bank_num}_{index}" + + def sample_filename(self, sample : AudioTableSample, index : int): + ext = sample.codec_file_extension_compressed() + + if self.extraction_sample_info is not None: + if sample.start in self.extraction_sample_info: + return self.extraction_sample_info[sample.start]["FileName"] + ext + print(f"WARNING: Missing extraction xml entry for sample at offset=0x{sample.start:X}") + + npad = int(math.floor(1 + math.log10(len(self.samples)))) if len(self.samples) != 0 else 0 + return f"Sample{index:0{npad}}{ext}" + + def blob_filename(self, start, end): + if self.extraction_blob_info is not None: + if start in self.extraction_blob_info: + return self.extraction_blob_info[start]["Name"] + print(f"WARNING: Missing extraction xml entry for blob at offset=0x{start:X}") + return f"UNACCOUNTED_{start:X}_{end:X}" + + def finalize_samples(self): + self.samples_final = list(sorted(self.samples.values(), key = lambda sample : sample.start)) + + for i,sample in enumerate(self.samples_final): + sample : AudioTableSample + sample.resolve_basenote_rate(self.extraction_sample_info) + + def finalize_coverage(self, all_sample_banks): + if len(self.coverage) != 0: + # merge ranges if there are any + self.coverage = list(sorted(self.coverage)) + + merged = [list(self.coverage.pop(0))] + + while len(self.coverage) != 0: + next = self.coverage.pop(0) + if merged[-1][1] == next[0]: + merged[-1][1] = next[1] + merged[-1][2] = next[2] + else: + merged.append(list(next)) + + self.coverage = merged + + # check fully covered + if len(self.coverage) == 1 and self.coverage[0][0] == 0 and self.coverage[0][1] == len(self.data): + return # all accounted + + # not fully covered, determine ranges of unaccounted data + if len(self.coverage) == 0: + # absolutely nothing is accounted for + unaccounted_ranges = [(0, len(self))] + else: + unaccounted_ranges = [] + # deal with gap at the start + if self.coverage[0][0] != 0: + unaccounted_ranges.append((0, self.coverage[0][0])) + # deal with gaps in the middle + for j,cvg in enumerate(self.coverage[:-1]): + start = cvg[1] + end = self.coverage[j + 1][0] + if start != end: + unaccounted_ranges.append((start, end)) + # deal with gap at the end + if self.coverage[-1][1] != len(self): + unaccounted_ranges.append((self.coverage[-1][1], len(self))) + + # TODO if an unaccounted range is in the extraction xml, trust it before searching other banks + + unaccounted_str = "[" + ", ".join(f"(0x{start:06X}, 0x{end:06X})" for start,end in unaccounted_ranges) + "]" + print(f"Sample Bank {self.bank_num} has incomplete coverage. Unaccounted: {unaccounted_str}") + + # search other banks for matches + for start,end in unaccounted_ranges: + while start != end: + found = False + + for j,bank in enumerate(all_sample_banks): + if not isinstance(bank, AudioTableFile): + # Ignore pointer entries + continue + + for sample in bank.samples_final: + sample : AudioTableSample + + sample_end = start + len(sample) + sample_end_aligned = align(sample_end, 16) + + if self.data[start:sample_end] == sample.data: + print(f" Located match for range [0x{start:X}:0x{sample_end:X}] in bank {j} at 0x{sample.start:X}") + new_sample = sample.clone(start, sample_end, self.data[sample_end:sample_end_aligned]) + new_sample.start = start + new_sample.end = sample_end + new_sample.sample_rate = sample.sample_rate + new_sample.base_note = sample.base_note + self.samples_final.append(new_sample) + found = True + start = sample_end_aligned + break + if found: + break + else: + # found no matches, blob it + print(f" No match found in other banks for range [0x{start:X}:0x{end:X}], leaving as binary blob") + self.samples_final.append(AudioTableData(start, end, self.data[start:end])) + break + + # Final sort + self.samples_final.sort(key = lambda sample : sample.start) + + def assign_names(self): + i = 0 + for sample in self.samples_final: + if isinstance(sample, AudioTableSample): + sample : AudioTableSample + + sample.name = self.sample_name(sample, i) + sample.filename = self.sample_filename(sample, i) + i += 1 + else: + sample : AudioTableData + + name = self.blob_filename(sample.start, sample.end) + sample.name = name + sample.filename = f"{name}.bin" + + def to_xml(self, base_path): + xml = XMLWriter() + + start = { + "Name" : self.name, + "Index" : self.bank_num, + "Medium" : self.table_entry.medium.name, + "CachePolicy" : self.table_entry.cache_policy.name, + } + if self.buffer_bug: + start["BufferBug"] = "true" + + xml.write_start_tag("SampleBank", start) + + # write pointers + for index in self.pointer_indices: + xml.write_element("Pointer", { "Index" : index }) + + # write samples/blobs + for sample in self.samples_final: + if isinstance(sample, AudioTableSample): + sample : AudioTableSample + + xml.write_element("Sample", { + "Name" : sample.name, + "Path" : f"$(BUILD_DIR)/{base_path}/{sample.filename}", + }) + else: + sample : AudioTableData + + xml.write_element("Blob", { + "Name" : sample.name, + "Path" : f"$(BUILD_DIR)/{base_path}/{sample.filename}", + }) + + xml.write_end_tag() + + return str(xml) + + def write_extraction_xml(self, path): + xml = XMLWriter() + + xml.write_comment("This file is only for extraction of vanilla data. For other purposes see assets/audio/samplebanks/") + + start = { + "Name" : self.name, + "Index" : self.bank_num, + } + xml.write_start_tag("SampleBank", start) + + i = 0 + for sample in self.samples_final: + if isinstance(sample, AudioTableSample): + sample : AudioTableSample + + xml.write_element("Sample", { + "Name" : sample.name, + "FileName" : sample.filename.replace(sample.codec_file_extension_compressed(), ""), + "Offset" : f"0x{sample.start:06X}", + "SampleRate" : sample.sample_rate, + "BaseNote" : sample.base_note, + }) + i += 1 + else: + sample : AudioTableData + + xml.write_element("Blob", { + "Name" : sample.name, + "Offset" : f"0x{sample.start:06X}", + "Size" : f"0x{sample.end - sample.start:X}", + }) + + xml.write_end_tag() + + with open(path, "w") as outfile: + outfile.write(str(xml)) + + def write_s_file(self, name, path): + with open(path, "w") as outfile: + out = ".rdata\n" + out += "\n" + out += ".balign 16\n" + out += "\n" + out += f".global {name}\n" + out += f"{name}_Start:\n" + out += "$start:\n" + out += "\n" + + outfile.write(out) + + i = 0 + for sample in self.samples: + if isinstance(sample, AudioTableSample): + sample : AudioTableSample + outfile.write(sample.to_asm(self.sample_name(i))) + i += 1 + else: + sample : AudioTableData + outfile.write(sample.to_asm("__UNACCOUNTED__")) diff --git a/tools/audio/extraction/disassemble_sequence.py b/tools/audio/extraction/disassemble_sequence.py new file mode 100644 index 0000000000..a77a8fac52 --- /dev/null +++ b/tools/audio/extraction/disassemble_sequence.py @@ -0,0 +1,1296 @@ +#!/usr/bin/env python3 +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 +# +# Audio Sequence Disassembler +# + +""" +The approach for sequence disassembly is roughly as follows: + +``` + Set COVERAGE=[0 for _ in range(len(data))] + Set REF_QUEUE=[] + + Set OFFSET=0 + Set SECTION=SEQ +1: + Begin sequential disassembly at OFFSET using section type SECTION + Collect reference labels and section types into REF_QUEUE + Update entries in COVERAGE to 1 as bytes are read + End disassembly at `end` instruction + + If REF_QUEUE is not empty: + Pop a reference from REF_QUEUE + Set OFFSET=loc(reference) + Set SECTION=section(reference) + goto 1 + + If Any 0s in COVERAGE: + Set OFFSET=(index of first 0 in COVERAGE) + Set SECTION=guess_section(OFFSET) (make a heuristic guess for section based on neighbors) + goto 1 +``` + +There are some additional subtleties for handling padding and uncommon sections like `array`. + +For tables used in `dyncall`s, we have to rely on external information to provide the location and size of tables as +there is no reliable heuristic for identifying table sizes. + + +TODO + +sequence beginning with testchan 0 is a buffer (?) +OR any ldseq is an array and an array of 0 is a buffer (?) + +detect section overlaps and mark them as bugged in the output +""" + +from dataclasses import dataclass +from enum import Enum, auto +from typing import Callable, Dict, List, Optional, Tuple + +from .audiobank_file import AudiobankFile + +pitch_names = ( + "A0", "BF0", "B0", "C1", "DF1", "D1", "EF1", "E1", "F1", "GF1", "G1", "AF1", "A1", "BF1", "B1", "C2", + "DF2", "D2", "EF2", "E2", "F2", "GF2", "G2", "AF2", "A2", "BF2", "B2", "C3", "DF3", "D3", "EF3", "E3", + "F3", "GF3", "G3", "AF3", "A3", "BF3", "B3", "C4", "DF4", "D4", "EF4", "E4", "F4", "GF4", "G4", "AF4", + "A4", "BF4", "B4", "C5", "DF5", "D5", "EF5", "E5", "F5", "GF5", "G5", "AF5", "A5", "BF5", "B5", "C6", + "DF6", "D6", "EF6", "E6", "F6", "GF6", "G6", "AF6", "A6", "BF6", "B6", "C7", "DF7", "D7", "EF7", "E7", + "F7", "GF7", "G7", "AF7", "A7", "BF7", "B7", "C8", "DF8", "D8", "EF8", "E8", "F8", "GF8", "G8", "AF8", + "A8", "BF8", "B8", "C9", "DF9", "D9", "EF9", "E9", "F9", "GF9", "G9", "AF9", "A9", "BF9", "B9", "C10", + "DF10", "D10", "EF10", "E10", "F10", "BFNEG1", "BNEG1", "C0", "DF0", "D0", "EF0", "E0", "F0", "GF0", "G0", "AF0", +) + +# +# VERSIONS +# + +class MMLVersion(Enum): + OOT = auto() + MM = auto() + +VERSION_ALL = (MMLVersion.OOT, MMLVersion.MM) + +# +# SECTIONS +# + +class SqSection(Enum): + SEQ = ("SEQ", ".sequence") + CHAN = ("CHAN", ".channel") + LAYER = ("LAYER", ".layer") + ARRAY = ("ARRAY", ".array") + TABLE = ("TABLE", ".table") + ENVELOPE = ("ENVELOPE", ".envelope") + FILTER = ("FILTER", ".filter") + UNKNOWN = ("UNK", "") + + def __init__(self, prefix, lbl_prefix): + self.prefix = prefix + self.lbl_prefix = lbl_prefix + +SECTION_ALL = (SqSection.SEQ, SqSection.CHAN, SqSection.LAYER) + +# +# ARGS +# + +def maybe_hex(n): + if n < 10: + return f"{n}" + else: + return f"0x{n:X}" + +def sign_extend(x, n): + sgn = 1 << (n - 1) + return (x & (sgn - 1)) - (x & sgn) + +class MMLArg: + def __init__(self, disas): + self.value = self.read(disas) + + def read(self, disas): + raise NotImplementedError() + + def analyze(self, disas): + pass + + def emit(self, disas): + return str(self.value) + +class MMLArgBits(MMLArg): + def read(self, disas): + return disas.bits_val + +class ArgU8(MMLArg): + def read(self, disas): + return disas.read_u8() + +class ArgU4x2(MMLArg): + def read(self, disas): + return disas.read_u8() + + def emit(self, disas): + return f"{(self.value >> 4) & 0xF}, {self.value & 0xF}" + +class ArgSeqId(ArgU8): + def emit(self, disas): + return disas.all_seq_names[self.value] + +class ArgFontId(ArgU8): # TODO + def read(self, disas): + return disas.read_u8() + +class ArgPitchU8(ArgU8): + def emit(self, disas): + return f"PITCH_{pitch_names[self.value]}" + +class ArgS8(MMLArg): + def read(self, disas): + return sign_extend(disas.read_u8(), 8) + +class ArgU16(MMLArg): + def read(self, disas): + return disas.read_u16() + +class ArgS16(MMLArg): + def read(self, disas): + return sign_extend(disas.read_u16(), 16) + +class ArgHex8(ArgU8): + def emit(self, disas): + return f"0x{self.value:02X}" + +class ArgHex16(ArgU16): + def emit(self, disas): + return f"0x{self.value:04X}" + +class ArgBitField16(ArgU16): + def emit(self, disas): + return bin(self.value) + +class ArgInstr(ArgU8): + def emit(self, disas): + builtins = { + 126 : "FONTANY_INSTR_SFX", + 127 : "FONTANY_INSTR_DRUM", + 128 : "FONTANY_INSTR_SAWTOOTH", + 129 : "FONTANY_INSTR_TRIANGLE", + 130 : "FONTANY_INSTR_SINE", + 131 : "FONTANY_INSTR_SQUARE", + 132 : "FONTANY_INSTR_NOISE", + 133 : "FONTANY_INSTR_BELL", + 134 : "FONTANY_INSTR_8PULSE", + 135 : "FONTANY_INSTR_4PULSE", + 136 : "FONTANY_INSTR_ASM_NOISE", + } + if self.value in builtins: + return builtins[self.value] + + # Check against first font only, this is fine for 99% of cases since most sequences use just one font + font0 : AudiobankFile = disas.used_fonts[0] + + if self.value in font0.instrument_index_map: + name = f"SF{font0.bank_num}_{font0.instrument_name(self.value)}" + else: + print(f"Invalid instrument sourced from {font0.name}: {self.value}") + name = f"{self.value} /* invalid instrument */" + return name + +class ArgVar(MMLArg): + def read(self, disas): + ret = disas.read_u8() + if ret & 0x80: + ret = ((ret << 8) & 0x7F00) | disas.read_u8() + if ret < 128 and disas.insn_begin not in disas.force_long: + print(f"Unnecessary use of long immediate encoding @ 0x{disas.insn_begin:X}: {ret}") + disas.force_long.add(disas.insn_begin) + + return ret + +class ArgPortamentoMode(ArgHex8): + def read(self, disas): + ret = disas.read_u8() + disas.portamento_is_special = (ret & 0x80) != 0 + return ret + +class ArgStereoConfig(ArgU8): + def emit(self, disas): + assert (self.value & 0b11000000) == 0 + type = (self.value >> 4) & 0b11 + strong_right = (self.value >> 3) & 1 + strong_left = (self.value >> 2) & 1 + strong_rvrb_right = (self.value >> 1) & 1 + strong_rvrb_left = (self.value >> 0) & 1 + return f"{type}, {strong_right}, {strong_left}, {strong_rvrb_right}, {strong_rvrb_left}" + +class ArgEffectsConfig(ArgU8): + def emit(self, disas): + assert (self.value & 0b01000000) == 0 + headset = str(bool((self.value >> 7) & 1)).upper() + type = (self.value >> 4) & 0b11 + strong_right = (self.value >> 3) & 1 + strong_left = (self.value >> 2) & 1 + strong_rvrb_right = (self.value >> 1) & 1 + strong_rvrb_left = (self.value >> 0) & 1 + return f"{headset}, {type}, {strong_right}, {strong_left}, {strong_rvrb_right}, {strong_rvrb_left}" + +class ArgPortamentoTime(ArgVar): + def read(self, disas): + if disas.portamento_is_special: + return disas.read_u8() + else: + return super().read(disas) + +class ArgBits3(MMLArgBits): + NBITS = 3 + +class ArgBits4(MMLArgBits): + NBITS = 4 + +class IOPort3(ArgBits3): + def emit(self, disas): + assert self.value in range(0,8) + return f"IO_PORT_{self.value}" + +class IOPort8(ArgU8): + def emit(self, disas): + if self.value in range(0,8): + return f"IO_PORT_{self.value}" + else: + return f"{self.value} # BAD IO PORT NUMBER" + +class ArgPitch(MMLArgBits): + NBITS = 6 + + def emit(self, disas): + return f"PITCH_{pitch_names[self.value]}" + +class ArgAddr(ArgHex16): + def analyze(self, disas): + disas.add_ref(self.value) + + def emit(self, disas): + value = self.value + + target_section = SqSection.UNKNOWN + for frag in disas.fragments: + if value in range(frag.start,frag.end): + target_section = frag.section + break + + addend = disas.addends.get(disas.pos, 0) + if disas.cur_section in (SqSection.SEQ, SqSection.CHAN, SqSection.LAYER, SqSection.ENVELOPE) and addend == 0: + # turn a label that's partway inside an instruction into a label beginning at the instruction + an addend + for start,end in disas.insn_ranges: + if value in range(start,end): + addend = value - start + value = start + break + + prefix = target_section.prefix + if addend != 0: + return f"{prefix}_{value:04X} + {maybe_hex(addend)}" + else: + return f"{prefix}_{value:04X}" + +class ArgRelAddr8(ArgAddr): + def read(self, disas): + rel_offset = sign_extend(disas.read_u8(), 8) + return disas.pos + rel_offset + +class ArgRelAddr16(ArgAddr): + def read(self, disas): + rel_offset = sign_extend(disas.read_u16(), 16) + return disas.pos + rel_offset + +class ArgSectionPtr(ArgAddr): + def analyze(self, disas): + disas.add_ref(self.value, disas.cur_section) + +class ArgBigSectionPtr(ArgAddr): + def analyze(self, disas): + disas.add_ref(self.value, disas.cur_section, big=True) + +class ArgRelSectionPtr(ArgRelAddr8): + def analyze(self, disas): + disas.add_ref(self.value, disas.cur_section) + +class ArgSeqPtr(ArgAddr): + def analyze(self, disas): + disas.add_ref(self.value, SqSection.SEQ, big=True) + +class ArgChanPtr(ArgAddr): + def analyze(self, disas): + disas.add_ref(self.value, SqSection.CHAN, big=True) + + def emit(self, disas): + return f"CHAN_{self.value:04X}" + +class ArgRelChanPtr(ArgRelAddr16): + def analyze(self, disas): + disas.add_ref(self.value, SqSection.CHAN, big=True) + + def emit(self, disas): + return f"CHAN_{self.value:04X}" + +class ArgLayerPtr(ArgAddr): + def analyze(self, disas): + disas.add_ref(self.value, SqSection.LAYER, big=True) + + def emit(self, disas): + return f"LAYER_{self.value:04X}" + +class ArgRelLayerPtr(ArgRelAddr16): + def analyze(self, disas): + disas.add_ref(self.value, SqSection.LAYER, big=True) + + def emit(self, disas): + return f"LAYER_{self.value:04X}" + +class ArgArrayPtr(ArgAddr): + def analyze(self, disas): + disas.add_ref(self.value, SqSection.ARRAY, big=True) + +class ArgEnvPtr(ArgAddr): + def analyze(self, disas): + disas.add_ref(self.value, SqSection.ENVELOPE, big=True) + + def emit(self, disas): + return f"ENVELOPE_{self.value:04X}" + +class ArgFilterPtr(ArgAddr): + def analyze(self, disas): + disas.add_ref(self.value, SqSection.FILTER, big=True) + + def emit(self, disas): + return f"FILTER_{self.value:04X}" + +class ArgTblPtr(ArgAddr): + def analyze(self, disas): + disas.add_ref(self.value, SqSection.TABLE, big=True) + + def emit(self, disas): + return f"TABLE_{self.value:04X}" + +class ArgUnkPtr(ArgAddr): + def analyze(self, disas): + disas.add_ref(self.value, SqSection.UNKNOWN) + +class ArgLdSampleInst(MMLArg): + def read(self, disas): + return None + + def emit(self, disas): + return "LDSAMPLE_INST" + +class ArgLdSampleSfx(MMLArg): + def read(self, disas): + return None + + def emit(self, disas): + return "LDSAMPLE_SFX" + +# +# COMMANDS +# + +@dataclass +class MMLCmd: + cmd_id : int + mnemonic : str + args : Tuple[MMLArg] = () + is_branch : bool = False + is_branch_unconditional : bool = False + is_terminal : bool = False + handler : Callable = None + sections : Tuple[SqSection] = SECTION_ALL + version : Tuple[MMLVersion] = VERSION_ALL + +def nesting_decr(cmd, disas): + disas.nesting -= 1 + if disas.nesting < 0: + disas.nesting = 0 + +def nesting_incr(cmd, disas): + disas.nesting += 1 + +def set_short(cmd, disas): + disas.large_notes = False + +def set_large(cmd, disas): + disas.large_notes = True + +# +# NOTE: Changes here must be reflected in aseq.h for re-assembly +# +CMD_SPEC = ( + # + # Control Flow Commands + # + MMLCmd(0xFF, 'end', is_terminal=True, handler=nesting_decr), + MMLCmd(0xFE, 'delay1'), + MMLCmd(0xFD, 'delay', args=(ArgVar,), sections=(SqSection.SEQ, SqSection.CHAN,)), + MMLCmd(0xFC, 'call', args=(ArgBigSectionPtr,)), + MMLCmd(0xFB, 'jump', args=(ArgSectionPtr,), is_branch=True, is_branch_unconditional=True), + MMLCmd(0xFA, 'beqz', args=(ArgSectionPtr,), is_branch=True), + MMLCmd(0xF9, 'bltz', args=(ArgSectionPtr,), is_branch=True), + MMLCmd(0xF8, 'loop', args=(ArgU8,), handler=nesting_incr), + MMLCmd(0xF7, 'loopend', handler=nesting_decr), + MMLCmd(0xF6, 'break', handler=nesting_decr), + MMLCmd(0xF5, 'bgez', args=(ArgSectionPtr,), is_branch=True), + MMLCmd(0xF4, 'rjump', args=(ArgRelSectionPtr,), is_branch=True, is_branch_unconditional=True), + MMLCmd(0xF3, 'rbeqz', args=(ArgRelSectionPtr,), is_branch=True), + MMLCmd(0xF2, 'rbltz', args=(ArgRelSectionPtr,), is_branch=True), + + # + # SEQ commands + # + # non-argbits commands + MMLCmd(0xF1, 'allocnotelist', sections=(SqSection.SEQ,), args=(ArgU8,)), + MMLCmd(0xF0, 'freenotelist', sections=(SqSection.SEQ,)), + MMLCmd(0xEF, 'unk_EF', sections=(SqSection.SEQ,), args=(ArgS16, ArgU8,)), + MMLCmd(0xDF, 'transpose', sections=(SqSection.SEQ,), args=(ArgS8,)), + MMLCmd(0xDE, 'rtranspose', sections=(SqSection.SEQ,), args=(ArgS8,)), + MMLCmd(0xDD, 'tempo', sections=(SqSection.SEQ,), args=(ArgU8,)), + MMLCmd(0xDC, 'tempochg', sections=(SqSection.SEQ,), args=(ArgS8,)), + MMLCmd(0xDB, 'vol', sections=(SqSection.SEQ,), args=(ArgU8,)), + MMLCmd(0xDA, 'volmode', sections=(SqSection.SEQ,), args=(ArgU8, ArgS16)), + MMLCmd(0xD9, "volscale", sections=(SqSection.SEQ,), args=(ArgU8,)), + MMLCmd(0xD7, 'initchan', sections=(SqSection.SEQ,), args=(ArgBitField16,)), + MMLCmd(0xD6, 'freechan', sections=(SqSection.SEQ,), args=(ArgBitField16,)), + MMLCmd(0xD5, 'mutescale', sections=(SqSection.SEQ,), args=(ArgS8,)), + MMLCmd(0xD4, 'mute', sections=(SqSection.SEQ,)), + MMLCmd(0xD3, 'mutebhv', sections=(SqSection.SEQ,), args=(ArgHex8,)), + MMLCmd(0xD2, 'ldshortvelarr', sections=(SqSection.SEQ,), args=(ArgArrayPtr,)), # length 16 + MMLCmd(0xD1, 'ldshortgatearr', sections=(SqSection.SEQ,), args=(ArgArrayPtr,)), # length 16 + MMLCmd(0xD0, 'notealloc', sections=(SqSection.SEQ,), args=(ArgU8,)), + MMLCmd(0xCE, 'rand', sections=(SqSection.SEQ,), args=(ArgU8,)), + MMLCmd(0xCD, 'dyncall', sections=(SqSection.SEQ,), args=(ArgTblPtr,)), + MMLCmd(0xCC, 'ldi', sections=(SqSection.SEQ,), args=(ArgU8,)), + MMLCmd(0xC9, 'and', sections=(SqSection.SEQ,), args=(ArgU8,)), + MMLCmd(0xC8, 'sub', sections=(SqSection.SEQ,), args=(ArgU8,)), + MMLCmd(0xC7, 'stseq', sections=(SqSection.SEQ,), args=(ArgU8, ArgAddr,)), + MMLCmd(0xC6, 'stop', sections=(SqSection.SEQ,)), + MMLCmd(0xC5, 'scriptctr', sections=(SqSection.SEQ,), args=(ArgU16,)), + MMLCmd(0xC4, 'runseq', sections=(SqSection.SEQ,), args=(ArgU8, ArgSeqId,)), + MMLCmd(0xC3, 'mutechan', sections=(SqSection.SEQ,), args=(ArgS16,), version=(MMLVersion.MM,)), + # argbits commands + MMLCmd(0x00, 'testchan', sections=(SqSection.SEQ,), args=(ArgBits4,)), + MMLCmd(0x40, 'stopchan', sections=(SqSection.SEQ,), args=(ArgBits4,)), + MMLCmd(0x50, 'subio', sections=(SqSection.SEQ,), args=(IOPort3,)), + MMLCmd(0x60, 'ldres', sections=(SqSection.SEQ,), args=(ArgBits4, ArgU8, ArgU8,)), + MMLCmd(0x70, 'stio', sections=(SqSection.SEQ,), args=(IOPort3,)), + MMLCmd(0x80, 'ldio', sections=(SqSection.SEQ,), args=(IOPort3,)), + MMLCmd(0x90, 'ldchan', sections=(SqSection.SEQ,), args=(ArgBits4, ArgChanPtr,)), + MMLCmd(0xA0, 'rldchan', sections=(SqSection.SEQ,), args=(ArgBits4, ArgRelChanPtr,)), + MMLCmd(0xB0, 'ldseq', sections=(SqSection.SEQ,), args=(ArgBits4, ArgSeqId, ArgUnkPtr,)), + + # + # CHAN commands + # + # non-argbits commands + MMLCmd(0xF1, 'allocnotelist', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xF0, 'freenotelist', sections=(SqSection.CHAN,)), + MMLCmd(0xEE, 'bendfine', sections=(SqSection.CHAN,), args=(ArgS8,)), + MMLCmd(0xED, 'gain', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xEC, 'vibreset', sections=(SqSection.CHAN,)), + MMLCmd(0xEB, 'fontinstr', sections=(SqSection.CHAN,), args=(ArgFontId, ArgInstr)), + MMLCmd(0xEA, 'stop', sections=(SqSection.CHAN,)), + MMLCmd(0xE9, 'notepri', sections=(SqSection.CHAN,), args=(ArgU4x2,)), + MMLCmd(0xE8, 'params', sections=(SqSection.CHAN,), args=(ArgU8, ArgU8, ArgU8, ArgS8, ArgS8, ArgU8, ArgU8, ArgU8,)), + MMLCmd(0xE7, 'ldparams', sections=(SqSection.CHAN,), args=(ArgAddr,)), + MMLCmd(0xE6, 'samplebook', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xE5, 'reverbidx', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xE4, 'dyncall', sections=(SqSection.CHAN,)), + MMLCmd(0xE3, 'vibdelay', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xE2, 'vibdepthgrad', sections=(SqSection.CHAN,), args=(ArgU8, ArgU8, ArgU8,)), + MMLCmd(0xE1, 'vibfreqgrad', sections=(SqSection.CHAN,), args=(ArgU8, ArgU8, ArgU8,)), + MMLCmd(0xE0, 'volexp', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xDF, 'vol', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xDE, 'freqscale', sections=(SqSection.CHAN,), args=(ArgU16,)), + MMLCmd(0xDD, 'pan', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xDC, 'panweight', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xDB, 'transpose', sections=(SqSection.CHAN,), args=(ArgS8,)), + MMLCmd(0xDA, 'env', sections=(SqSection.CHAN,), args=(ArgEnvPtr,)), + MMLCmd(0xD9, 'releaserate', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xD8, 'vibdepth', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xD7, 'vibfreq', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xD4, 'reverb', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xD3, 'bend', sections=(SqSection.CHAN,), args=(ArgS8,)), + MMLCmd(0xD2, 'sustain', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xD1, 'notealloc', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xD0, 'effects', sections=(SqSection.CHAN,), args=(ArgEffectsConfig,)), + MMLCmd(0xCF, 'stptrtoseq', sections=(SqSection.CHAN,), args=(ArgAddr,)), + MMLCmd(0xCE, 'ldptr', sections=(SqSection.CHAN,), args=(ArgAddr,)), + MMLCmd(0xCD, 'stopchan', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xCC, 'ldi', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xCB, 'ldseq', sections=(SqSection.CHAN,), args=(ArgUnkPtr,)), + MMLCmd(0xCA, 'mutebhv', sections=(SqSection.CHAN,), args=(ArgHex8,)), + MMLCmd(0xC9, 'and', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xC8, 'sub', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xC7, 'stseq', sections=(SqSection.CHAN,), args=(ArgU8, ArgAddr,)), + MMLCmd(0xC6, 'font', sections=(SqSection.CHAN,), args=(ArgFontId,)), + MMLCmd(0xC5, 'dyntbllookup', sections=(SqSection.CHAN,)), + MMLCmd(0xC4, 'noshort', sections=(SqSection.CHAN,), handler=set_large), + MMLCmd(0xC3, 'short', sections=(SqSection.CHAN,), handler=set_short), + MMLCmd(0xC2, 'dyntbl', sections=(SqSection.CHAN,), args=(ArgTblPtr,)), + MMLCmd(0xC1, 'instr', sections=(SqSection.CHAN,), args=(ArgInstr,)), + MMLCmd(0xBE, 'unk_BE', sections=(SqSection.CHAN,), args=(ArgU8,), version=(MMLVersion.MM,)), + MMLCmd(0xBD, 'randptr', sections=(SqSection.CHAN,), args=(ArgU16, ArgU16,), version=(MMLVersion.OOT,)), + MMLCmd(0xBD, 'samplestart', sections=(SqSection.CHAN,), args=(ArgU8,), version=(MMLVersion.MM,)), + MMLCmd(0xBC, 'ptradd', sections=(SqSection.CHAN,), args=(ArgHex16,)), + MMLCmd(0xBB, 'combfilter', sections=(SqSection.CHAN,), args=(ArgU8, ArgU16)), + MMLCmd(0xBA, 'randgate', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xB9, 'randvel', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xB8, 'rand', sections=(SqSection.CHAN,), args=(ArgU8,)), + MMLCmd(0xB7, 'randtoptr', sections=(SqSection.CHAN,), args=(ArgU16,)), + MMLCmd(0xB6, 'dyntblv', sections=(SqSection.CHAN,)), + MMLCmd(0xB5, 'dyntbltoptr', sections=(SqSection.CHAN,)), + MMLCmd(0xB4, 'ptrtodyntbl', sections=(SqSection.CHAN,)), + MMLCmd(0xB3, 'filter', sections=(SqSection.CHAN,), args=(ArgU4x2,)), + MMLCmd(0xB2, 'ldseqtoptr', sections=(SqSection.CHAN,), args=(ArgTblPtr,)), + MMLCmd(0xB1, 'freefilter', sections=(SqSection.CHAN,)), + MMLCmd(0xB0, 'ldfilter', sections=(SqSection.CHAN,), args=(ArgFilterPtr,)), + MMLCmd(0xA8, 'randptr', sections=(SqSection.CHAN,), args=(ArgU16, ArgU16,), version=(MMLVersion.MM,)), + MMLCmd(0xA7, 'unk_A7', sections=(SqSection.CHAN,), args=(ArgHex8,), version=(MMLVersion.MM,)), + MMLCmd(0xA6, 'unk_A6', sections=(SqSection.CHAN,), args=(ArgU8, ArgS16,), version=(MMLVersion.MM,)), + MMLCmd(0xA5, 'unk_A5', sections=(SqSection.CHAN,), args=(), version=(MMLVersion.MM,)), + MMLCmd(0xA4, 'unk_A4', sections=(SqSection.CHAN,), args=(ArgU8,), version=(MMLVersion.MM,)), + MMLCmd(0xA3, 'unk_A3', sections=(SqSection.CHAN,), args=(), version=(MMLVersion.MM,)), + MMLCmd(0xA2, 'unk_A2', sections=(SqSection.CHAN,), args=(ArgS16,), version=(MMLVersion.MM,)), + MMLCmd(0xA1, 'unk_A1', sections=(SqSection.CHAN,), args=(), version=(MMLVersion.MM,)), + MMLCmd(0xA0, 'unk_A0', sections=(SqSection.CHAN,), args=(ArgS16,), version=(MMLVersion.MM,)), + # argbits commands + MMLCmd(0x00, 'cdelay', sections=(SqSection.CHAN,), args=(ArgBits4,)), + MMLCmd(0x10, 'ldsample', sections=(SqSection.CHAN,), args=(ArgLdSampleInst, IOPort3,)), + MMLCmd(0x18, 'ldsample', sections=(SqSection.CHAN,), args=(ArgLdSampleSfx, IOPort3,)), + MMLCmd(0x20, 'ldchan', sections=(SqSection.CHAN,), args=(ArgBits4, ArgChanPtr,)), + MMLCmd(0x30, 'stcio', sections=(SqSection.CHAN,), args=(ArgBits4, IOPort8,)), + MMLCmd(0x40, 'ldcio', sections=(SqSection.CHAN,), args=(ArgBits4, IOPort8,)), + MMLCmd(0x50, 'subio', sections=(SqSection.CHAN,), args=(IOPort3,)), + MMLCmd(0x60, 'ldio', sections=(SqSection.CHAN,), args=(IOPort3,)), + MMLCmd(0x70, 'stio', sections=(SqSection.CHAN,), args=(IOPort3,)), + MMLCmd(0x78, 'rldlayer', sections=(SqSection.CHAN,), args=(ArgBits3, ArgRelLayerPtr,)), + MMLCmd(0x80, 'testlayer', sections=(SqSection.CHAN,), args=(ArgBits3,)), + MMLCmd(0x88, 'ldlayer', sections=(SqSection.CHAN,), args=(ArgBits3, ArgLayerPtr,)), + MMLCmd(0x90, 'dellayer', sections=(SqSection.CHAN,), args=(ArgBits3,)), + MMLCmd(0x98, 'dynldlayer', sections=(SqSection.CHAN,), args=(ArgBits3,)), + + # + # LAYER commands + # + # non-argbits commands + MMLCmd(0xC0, 'ldelay', sections=(SqSection.LAYER,), args=(ArgVar,)), + MMLCmd(0xC1, 'shortvel', sections=(SqSection.LAYER,), args=(ArgU8,)), + MMLCmd(0xC2, 'transpose', sections=(SqSection.LAYER,), args=(ArgS8,)), + MMLCmd(0xC3, 'shortdelay', sections=(SqSection.LAYER,), args=(ArgVar,)), + MMLCmd(0xC4, 'legato', sections=(SqSection.LAYER,)), + MMLCmd(0xC5, 'nolegato', sections=(SqSection.LAYER,)), + MMLCmd(0xC6, 'instr', sections=(SqSection.LAYER,), args=(ArgInstr,)), + MMLCmd(0xC7, 'portamento', sections=(SqSection.LAYER,), args=(ArgPortamentoMode, ArgPitchU8, ArgPortamentoTime,)), + MMLCmd(0xC8, 'noportamento', sections=(SqSection.LAYER,)), + MMLCmd(0xC9, 'shortgate', sections=(SqSection.LAYER,), args=(ArgU8,)), + MMLCmd(0xCA, 'notepan', sections=(SqSection.LAYER,), args=(ArgU8,)), + MMLCmd(0xCB, 'env', sections=(SqSection.LAYER,), args=(ArgEnvPtr, ArgU8,)), + MMLCmd(0xCC, 'nodrumpan', sections=(SqSection.LAYER,)), + MMLCmd(0xCD, 'stereo', sections=(SqSection.LAYER,), args=(ArgStereoConfig,)), + MMLCmd(0xCE, 'bendfine', sections=(SqSection.LAYER,), args=(ArgS8,)), + MMLCmd(0xCF, 'releaserate', sections=(SqSection.LAYER,), args=(ArgU8,)), + MMLCmd(0xD0, 'ldshortvel', sections=(SqSection.LAYER,), args=(ArgBits4,)), + MMLCmd(0xE0, 'ldshortgate', sections=(SqSection.LAYER,), args=(ArgBits4,)), + MMLCmd(0xF0, 'unk_F0', sections=(SqSection.LAYER,), args=(ArgS16,), version=(MMLVersion.MM,)), + MMLCmd(0xF1, 'surroundeffect', sections=(SqSection.LAYER,), args=(ArgU8,), version=(MMLVersion.MM,)), + # argbits commands + # large layer + MMLCmd(0x00, 'notedvg', sections=(SqSection.LAYER,), args=(ArgPitch, ArgVar, ArgU8, ArgU8,)), + MMLCmd(0x40, 'notedv', sections=(SqSection.LAYER,), args=(ArgPitch, ArgVar, ArgU8,)), + MMLCmd(0x80, 'notevg', sections=(SqSection.LAYER,), args=(ArgPitch, ArgU8, ArgU8,)), + # small layer + MMLCmd(0x00, 'shortdvg', sections=(SqSection.LAYER,), args=(ArgPitch, ArgVar,)), + MMLCmd(0x40, 'shortdv', sections=(SqSection.LAYER,), args=(ArgPitch,)), + MMLCmd(0x80, 'shortvg', sections=(SqSection.LAYER,), args=(ArgPitch,)), +) + +# +# DISASSEMBLER +# + +class SequenceFragment: + def __init__(self, disas, section, data, start, end): + assert len(data) == end - start , f"Bad: got {len(data)} bytes for range [{start}:{end}] {data}" + + self.section = section + self.data = data + self.start = start + self.end = end + self.disas = disas + + def __str__(self): + return f"Fragment ({self.section}) [{self.start}, {self.end}]" + + def __lt__(self, other): + return self.start < other.start + + @staticmethod + def merge(frag1, frag2): + if frag1 == frag2: + return frag1 + + if frag1.section != frag2.section: + return None + + # don't merge envelopes or tables ever + if frag1.section in (SqSection.ENVELOPE, SqSection.TABLE): + return None + + min_start = min(frag1.start, frag2.start) + max_start = max(frag1.start, frag2.start) + min_end = min(frag1.end, frag2.end) + max_end = max(frag1.end, frag2.end) + + if max_start > min_end: + return None + + data1, data2 = frag1.data, frag2.data + if frag2.start < frag1.start: + data1, data2 = data2, data1 + + if min_end == max_end: + # data1 contains data2 + return SequenceFragment(frag1.disas, frag1.section, data1, min_start, max_end) + + assert data1[max_start:] == data2[:len(data1)-max_start] , \ + f"Data does not agree on overlap between\n{frag1}\n{frag2}\n{data2[:len(data1)-max_start]}" + + return SequenceFragment(frag1.disas, frag1.section, data1[:max_start] + data2, min_start, max_end) + +@dataclass +class SequenceTableSpec: + start_offset : int + num_entries : int + addend : int + sectype : SqSection + + def contains_loc(self, pos): + return pos in range(self.start_offset, self.start_offset + 2 * self.num_entries) + +class SequenceDisassembler: + + def __init__(self, seq_num : int, data : bytes, tables : Optional[Tuple[SequenceTableSpec]], cmds : Tuple[MMLCmd], + version : MMLVersion, outpath : str, seq_name : str, used_fonts : List[AudiobankFile], all_seq_names): + self.seq_num = seq_num + self.seq_name = seq_name + self.used_fonts = used_fonts + + self.all_seq_names = all_seq_names + + self.pos = 0 + self.insn_begin = 0 + self.data = data + self.hit_eof = False + self.cur_section = SqSection.SEQ + self.nesting = 0 + self.portamento_is_special = False + self.large_notes = True + + self.outpath = outpath + + self.cmds : Dict[SqSection, Dict[int, MMLCmd]] = { + SqSection.SEQ : {}, + SqSection.CHAN : {}, + SqSection.LAYER : {}, + } + + # preprocess command list into dictionary, possibly duplicating into + # several id keys if any lsbits are used as an arg + for cmd in cmds: + # ignore commands not in this version + if version not in cmd.version: + continue + + # find number of lsbits that don't contribute to the command id + nbits = 0 + for arg in cmd.args: + if issubclass(arg, MMLArgBits): + assert nbits == 0, f"Multiple argbits-type arguments: {cmd}" + nbits = arg.NBITS + + id = cmd.cmd_id + + for section in cmd.sections: + cmds_s = self.cmds[section] + + for i in range(1 << nbits): + new = cmd + new.mask = (1 << nbits) - 1 + old = cmds_s.get(id + i, None) + if old is not None: + assert old.mnemonic in ("notedvg", "notedv", "notevg"), (old.mnemonic, cmd.mnemonic) + new = (old, cmd) + + cmds_s[id + i] = new + + self.force_long = set() + + self.insn_ranges = [] + + self.coverage = [0] * len(self.data) + + self.fragments = [] + + self.branch_targets = {} + self.big_labels = set() + + self.all_ranges = [] + + self.decode_list = [] + self.all_seen = [] + + self.tables : Optional[Tuple[SequenceTableSpec]] = tables + self.table_cache = set() + + self.addends = {} + + self.unused = [] + + # general helpers + + def read_u8(self): + if self.hit_eof: + raise Exception() + + if self.pos == len(self.data): + self.hit_eof = True + ret = None + else: + ret = self.data[self.pos] + self.pos += 1 + return ret + + def read_u16(self): + return (self.read_u8() << 8) | self.read_u8() + + def read_s16(self): + return sign_extend(self.read_u16(), 16) + + def lookup_cmd(self, id : int) -> MMLCmd: + # lookup command info + cmd : MMLCmd = self.cmds[self.cur_section].get(id, None) + assert cmd is not None , (self.cur_section, id, self.cmds) + + if isinstance(cmd, tuple): + # select based on whether we're dealing with large or short notes + cmd = cmd[int(not self.large_notes)] + + # part of the command byte may be an arg, save the value + self.bits_val = id & cmd.mask + + return cmd + + # + # analysis helpers + # + + def register_addend(self, pos, value): + self.addends[pos] = value + + def add_branch_target(self, value, section, big=False): + self.branch_targets[value] = section + if big: + self.big_labels.add(value) + + def add_ref(self, value, section=None, big=False): + if section is None: + self.add_branch_target(value, SqSection.UNKNOWN) + return + + self.add_branch_target(value, section, big=big) + + self.add_job(value, section, self.cur_section) + + def add_job(self, value, section, from_section=None): + if value not in self.all_seen: + self.all_seen.append(value) + self.decode_list.append((value, section, from_section or section)) + + def merge_frags(self): + self.fragments = list(sorted(self.fragments)) + + if len(self.fragments) < 2: + return + + i = 0 + while i != len(self.fragments) - 1: + frag1 = self.fragments[i] + frag2 = self.fragments[i + 1] + merged = SequenceFragment.merge(frag1, frag2) + if merged is not None: + self.fragments[i] = merged + del self.fragments[i + 1] + else: + i += 1 + + # + # analysis handlers + # + + def analyze_code(self): # sequence, channel, layer + start_pos = self.pos + + # print(f" << [0x{start_pos:X}/0x{len(self.data):X}] :: {self.cur_section} >>") + + self.insn_begin = start_pos + cmd_byte = self.read_u8() + cmd = self.lookup_cmd(cmd_byte) + + assert cmd is not None , f"Bad command ID 0x{cmd_byte:02X} for section {self.cur_section.name} at 0x{start_pos:X}" + # print(hex(cmd_byte)) + + args = [argtype(self) for argtype in cmd.args] + + raw_data = self.data[start_pos:self.pos] + + self.insn_ranges.append((start_pos, self.pos)) + + for i in range(start_pos,self.pos): + self.coverage[i] = self.cur_section + + # print(f"/* 0x{start_pos:04X} [{' '.join([f'0x{b:02X}' for b in raw_data]):24}] */ {cmd.mnemonic:11} {', '.join([arg.emit(self) for arg in args])}".strip()) + + for arg in args: + arg.analyze(self) + + if cmd.handler is not None: + cmd.handler(cmd, self) + + self.fragments.append(SequenceFragment(self, self.cur_section, raw_data, start_pos, self.pos)) + + if not (cmd.is_branch_unconditional or cmd.is_terminal): + self.decode_list.append((self.pos, self.cur_section, self.cur_section)) + + def analyze_table(self): + assert self.tables is not None, "Found a table but no table spec provided." + + for table_spec in self.tables: + if table_spec.contains_loc(self.pos): + break + else: + assert False , f"Found table at {self.pos:04X} but no entry number provided" + + start_pos = self.pos = table_spec.offset + if start_pos in self.table_cache: + return + + for _ in range(table_spec.num_entries): + curpos = self.pos + cur = self.read_u16() - table_spec.addend + if cur >= len(self.data) - 1: + assert False , "Bad table pointer" + + self.add_branch_target(cur, table_spec.sectype, big=True) + self.add_job(cur, table_spec.sectype, table_spec.sectype) + self.register_addend(curpos, table_spec.addend) + + self.fragments.append(SequenceFragment(self, self.cur_section, self.data[start_pos:self.pos], start_pos, self.pos)) + self.table_cache.add(start_pos) + + def analyze_array(self): + start_pos = self.pos + + # TODO better heuristic than just hardcoding 16... + # it would be better to wait until later to resize arrays though, up to the next identified fragment + # ARRAY + UNK + OTHER -> ARRAY + OTHER + for _ in range(16): + assert self.read_u8() == 0 + + self.fragments.append(SequenceFragment(self, self.cur_section, self.data[start_pos:self.pos], start_pos, self.pos)) + + def analyze_filter(self): + start_pos = self.pos + + for _ in range(8): + assert self.read_u16() == 0 + + self.fragments.append(SequenceFragment(self, self.cur_section, self.data[start_pos:self.pos], start_pos, self.pos)) + + def analyze_envelope(self): + start_pos = self.pos + + while True: # dangerous + delay = self.read_s16() + arg = self.read_s16() + if delay < 0: + break + + self.fragments.append(SequenceFragment(self, self.cur_section, self.data[start_pos:self.pos], start_pos, self.pos)) + + def analyze_unknown(self): + self.fragments.append(SequenceFragment(self, self.cur_section, self.data[self.pos:self.pos+2], self.pos, self.pos+2)) + + def analyze(self): + # mark offset 0 as a SEQ section + self.add_branch_target(0, SqSection.SEQ, big=True) + self.decode_list.append((0, SqSection.SEQ, SqSection.SEQ)) + + # analyze all sections, following branches to locate new sections + while len(self.decode_list) != 0: + self.pos, self.cur_section, self.refd_from = self.decode_list.pop() + + if self.pos >= len(self.data): + # ignore sections that begin past the end of the file + # TODO should be an error or warning? + continue + + # execute handler based on section + { + SqSection.SEQ : self.analyze_code, + SqSection.CHAN : self.analyze_code, + SqSection.LAYER : self.analyze_code, + SqSection.TABLE : self.analyze_table, + SqSection.ARRAY : self.analyze_array, + SqSection.FILTER : self.analyze_filter, + SqSection.ENVELOPE : self.analyze_envelope, + SqSection.UNKNOWN : self.analyze_unknown, + }[self.cur_section]() + + # merge fragments + self.merge_frags() + + # update coverage + self.final_cvg = [0] * len(self.data) + for frag in self.fragments: + for i in range(frag.start,frag.end): + self.final_cvg[i] = frag.section + + # resolve gaps in coverage + while True: + # keeps going until there's no zeros except for padding + try: + first_zero_idx = self.final_cvg.index(0) + except ValueError: + break # no more gaps + + # there was a gap, handle it + + if ((first_zero_idx + 0xF) & ~0xF) == len(self.data) and \ + all(b == 0 for b in self.final_cvg[first_zero_idx:]) and \ + all(b == 0 for b in self.data[first_zero_idx:]): + # there's only padding left, we're done + break + else: + # resolve non-padding gaps with heuristics + + # TODO any unknown data after a `jump` in a sequence frag should extend the sequence frag + # TODO any unknown data before a filter should be a balign 16 + + last_zero_idx = first_zero_idx + while self.final_cvg[last_zero_idx] == 0 and last_zero_idx < len(self.final_cvg)-1: + self.final_cvg[last_zero_idx] = SqSection.UNKNOWN + last_zero_idx += 1 + + num_unk = last_zero_idx - first_zero_idx + + emit_unk = True + + prev_frag = None + prev_frag_idx = None + next_frag = None + next_frag_idx = None + + for i,frag in enumerate(self.fragments): + if frag.end == first_zero_idx: + prev_frag = frag + prev_frag_idx = i + elif frag.start == last_zero_idx: + next_frag = frag + next_frag_idx = i + + # SEQ + UNK -> SEQ + if prev_frag is not None: + if prev_frag.section == SqSection.SEQ: + self.fragments[prev_frag_idx] = SequenceFragment(self, SqSection.SEQ, + self.data[prev_frag.start:last_zero_idx], + prev_frag.start, last_zero_idx) + emit_unk = False + + if next_frag is not None: + # UNK + FILTER -> FILTER + if next_frag.section == SqSection.FILTER and num_unk < 16: + emit_unk = False + + # UNK + TABLE -> TABLE + if next_frag.section == SqSection.TABLE and num_unk < 2: + emit_unk = False + + if prev_frag is not None and next_frag is not None: + # LAYER + UNK + LAYER -> LAYER LAYER LAYER + if prev_frag.section == SqSection.LAYER and next_frag.section == SqSection.LAYER: + self.fragments.append(SequenceFragment(self, SqSection.LAYER, self.data[first_zero_idx:last_zero_idx], first_zero_idx, last_zero_idx)) + emit_unk = False + + # LAYER + UNK + CHANNEL -> LAYER LAYER CHANNEL + if prev_frag.section == SqSection.LAYER and next_frag.section == SqSection.CHAN: + self.fragments.append(SequenceFragment(self, SqSection.LAYER, self.data[first_zero_idx:last_zero_idx], first_zero_idx, last_zero_idx)) + emit_unk = False + + # TABLE + UNK + ENVELOPE -> TABLE + ENVELOPE.. + ENVELOPE + if prev_frag.section == SqSection.TABLE and next_frag.section == SqSection.ENVELOPE: + self.fragments.append(SequenceFragment(self, SqSection.ENVELOPE, self.data[first_zero_idx:last_zero_idx], first_zero_idx, last_zero_idx)) + emit_unk = False + + # ENVELOPE + UNK + ENVELOPE -> ENVELOPE + ENVELOPE.. + ENVELOPE + if prev_frag.section == SqSection.ENVELOPE and next_frag.section == SqSection.ENVELOPE: + self.fragments.append(SequenceFragment(self, SqSection.ENVELOPE, self.data[first_zero_idx:last_zero_idx], first_zero_idx, last_zero_idx)) + emit_unk = False + + if prev_frag is not None and next_frag is None: + # ENVELOPE + UNK + END -> ENVELOPE + ENVELOPE.. + FILTER.. + END + if prev_frag.section == SqSection.ENVELOPE: + if all(b == 0 for b in self.data[first_zero_idx:]): + for k in range(first_zero_idx, len(self.data), 16): + if k + 16 > len(self.data): + # padding + break + self.fragments.append(SequenceFragment(self, SqSection.FILTER, self.data[k:k+16], k, k + 16)) + else: + self.fragments.append(SequenceFragment(self, SqSection.ENVELOPE, self.data[first_zero_idx:last_zero_idx], first_zero_idx, last_zero_idx)) + emit_unk = False + + if emit_unk: + # leave it unknown for now, TODO make reasonable guesses + self.add_branch_target(first_zero_idx, SqSection.UNKNOWN) + self.fragments.append(SequenceFragment(self, SqSection.UNKNOWN, self.data[first_zero_idx:last_zero_idx], first_zero_idx, last_zero_idx)) + + # + # disas helpers + # + + def label_name(self, value, section, force_big=False): + if value in self.big_labels or force_big: + lbl_prefix = section.lbl_prefix + " " + suffix = "" + else: + lbl_prefix = "" + suffix = ":" + + return f"{lbl_prefix}{section.prefix}_{value:04X}{suffix}" + + def emit_branch_target_real(self, outfile, value, section, force_big=False): + if section is SqSection.UNKNOWN: + for frag in self.fragments: + if value in range(frag.start, frag.end): + section = frag.section + break + + outfile.write(f"{self.label_name(value, section, force_big)}\n") + + def emit_branch_target(self, outfile, start, end, force_big=False): + did_emit = False + for b_tgt in self.branch_targets: + if b_tgt in range(start,end): + self.emit_branch_target_real(outfile, start, self.branch_targets[b_tgt], force_big) + did_emit = True + return did_emit + + # + # disas handlers + # + + def disas_section(self, frag : SequenceFragment, outfile): + force_big_lbl = False + + if self.pos == frag.start: + # If the previous frag is not the same type as this frag, force the first label to be a big label + for frag2 in self.fragments: + frag2 : SequenceFragment + + if frag2.end == frag.start: + if frag2.section != frag.section: + force_big_lbl = True + break + + while self.pos < frag.end: + start_pos = self.pos + self.insn_begin = start_pos + + cmd_byte = self.read_u8() + cmd = self.lookup_cmd(cmd_byte) + mnemonic = cmd.mnemonic + + # Hacky fixups for commands using long var encodings when it was not necessary for them to do so, the usual + # macros for re-assembly only select the long encoding when necessary so switch to special macros that + # always use the long encoding unconditionally. + if self.insn_begin in self.force_long: + if mnemonic == "notedv": + mnemonic = "noteldv" + elif mnemonic in ("delay", "ldelay"): + mnemonic = "lldelay" + else: + assert False , mnemonic + + args = [argtype(self) for argtype in cmd.args] + raw_data = self.data[start_pos:self.pos] + + self.emit_branch_target(outfile, start_pos, self.pos, force_big_lbl) + force_big_lbl = False + + args_str = ', '.join([arg.emit(self) for arg in args]) + data_str = ' '.join([f'0x{b:02X}' for b in raw_data]) + + outfile.write(f"/* 0x{start_pos:04X} [{data_str:24}] */ {mnemonic:11} {args_str}".strip() + "\n") + + if cmd.is_terminal or cmd.is_branch_unconditional: + outfile.write("\n") + + def disas_table(self, frag : SequenceFragment, outfile): + base_pos = self.pos + + while self.pos < frag.end: + start_pos = self.pos + + addend = self.addends.get(start_pos, 0) + + ent = self.read_u16() - addend + + self.emit_branch_target(outfile, start_pos, self.pos) + + section = self.branch_targets.get(ent, None) + + # TODO + if section is None: + section = SqSection.UNKNOWN + + if addend != 0: + addend_str = f" + {addend}" + else: + addend_str = "" + + # TODO proper label name + outfile.write(f" entry {section.prefix}_{ent:04X}{addend_str}\n") + + outfile.write("\n") + + def disas_filter(self, frag : SequenceFragment, outfile): + start_pos = self.pos + + num_filters, align = divmod(len(frag.data), 2 * 8) + + assert all(b == 0 for b in frag.data) + assert align == 0 + + for n in range(num_filters): + self.emit_branch_target_real(outfile, start_pos + n * 2 * 8, SqSection.FILTER, force_big=True) + outfile.write(" filter 0, 0, 0, 0, 0, 0, 0, 0\n\n") + + def disas_envelope(self, frag : SequenceFragment, outfile): + start_pos = self.pos + + self.emit_branch_target(outfile, start_pos, frag.end) + + while self.pos < frag.end: + delay = self.read_s16() + arg = self.read_s16() + + if delay == 0 and arg == 0: + outfile.write(" disable\n") + elif delay == -1 and arg == 0: + outfile.write(" hang\n") + elif delay == -2: + outfile.write(f" goto {arg}\n") + elif delay == -3 and arg == 0: + outfile.write(" restart\n") + else: + assert delay > 0 + outfile.write(f" point {delay}, {arg}\n") + + if delay < 0 and self.pos not in self.branch_targets: + outfile.write("\n") + self.emit_branch_target_real(outfile, self.pos, frag.section) + + outfile.write("\n") + + def disas_array(self, frag : SequenceFragment, outfile): + self.emit_branch_target(outfile, frag.start, frag.end) + + array_data = self.data[frag.start:frag.end] + if all(b == 0 for b in array_data): + outfile.write(f".fill 0x{len(array_data):X}\n\n") + else: + for b in array_data: + outfile.write(f".byte 0x{b:2X}\n") + outfile.write("\n") + + def disas_unknown(self, frag : SequenceFragment, outfile): + start_pos = self.pos + + prev = start_pos + for b_tgt in sorted(self.branch_targets): + if b_tgt in range(start_pos+1,frag.end): + # emit data between this branch target and the previous + outfile.write(" .byte " + ", ".join(f"0x{b:02X}" for b in self.data[prev:b_tgt]) + "\n\n") + if b_tgt in range(start_pos,frag.end): + # emit the branch target + self.emit_branch_target_real(outfile, b_tgt, SqSection.UNKNOWN) + prev = b_tgt + + # write any remaining data if the final branch target was not the end of the frag + if prev != frag.end: + outfile.write(" .byte " + ", ".join(f"0x{b:02X}" for b in self.data[prev:frag.end]) + "\n\n") + + # + # emit disassembled text + # + + def emit(self): + with open(self.outpath, "w") as outfile: + # emit header + outfile.write("#include \"aseq.h\"\n") + + # emit fonts + for font in self.used_fonts: + outfile.write(f"#include \"{font.file_name}.h\"\n") + outfile.write("\n") + + outfile.write(f".startseq {self.seq_name}\n\n") + + # emit fragments + for frag in sorted(self.fragments): + frag : SequenceFragment + + self.cur_section = frag.section + self.pos = frag.start + + { + SqSection.SEQ : self.disas_section, + SqSection.CHAN : self.disas_section, + SqSection.LAYER : self.disas_section, + SqSection.TABLE : self.disas_table, + SqSection.ARRAY : self.disas_array, + SqSection.FILTER : self.disas_filter, + SqSection.ENVELOPE : self.disas_envelope, + SqSection.UNKNOWN : self.disas_unknown, + }[frag.section](frag, outfile) + + outfile.write(f".endseq {self.seq_name}\n") + +if __name__ == '__main__': + import sys + + in_path = sys.argv[1] + out_path = sys.argv[2] + + with open(in_path, "rb") as infile: + data = bytearray(infile.read()) + + class FontDummy: + def __init__(self, file_name) -> None: + self.name = file_name + self.file_name = file_name + self.instrument_index_map = {} + + disas = SequenceDisassembler(0, data, None, CMD_SPEC, MMLVersion.MM, out_path, "", [FontDummy("wow")], []) + disas.analyze() + disas.emit() diff --git a/tools/audio/extraction/envelope.py b/tools/audio/extraction/envelope.py new file mode 100644 index 0000000000..0dab8c8d99 --- /dev/null +++ b/tools/audio/extraction/envelope.py @@ -0,0 +1,119 @@ +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 +# +# Implements envelopes and envelope point structures +# + +import collections + +from .util import XMLWriter + +class EnvDelay(int): + def __str__(self): + return { + 0 : "ADSR_DISABLE", + -1 : "ADSR_HANG", + -2 : "ADSR_GOTO", + -3 : "ADSR_RESTART", + }.get(self, super().__str__()) + +class Envelope: + """ + Array of envelope points + """ + + class EnvelopePoint: + """ + typedef struct { + /* 0x0 */ s16 delay; + /* 0x2 */ s16 arg; + } EnvelopePoint; // size = 0x4 + """ + + def __init__(self, delay, arg): + self.delay = EnvDelay(delay) + self.arg = arg + + def __repr__(self): + return str(self) + + def __str__(self): + return f"{{ {self.delay}, {self.arg} }}" + + def is_disable(self): + return self.delay == 0 and self.arg == 0 + + def is_hang(self): + return self.delay == -1 and self.arg == 0 + + def to_xml(self, xml : XMLWriter): + if self.delay == 0: # Disable + assert self.arg == 0 + xml.write_element("Disable") + elif self.delay == -1: # Hang + assert self.arg == 0 + xml.write_element("Hang") + elif self.delay == -2: # Goto + xml.write_element("Goto", + { "Arg" : self.arg } + ) + elif self.delay == -3: # Restart + assert self.arg == 0 + xml.write_element("Restart") + else: + assert self.delay >= 0 + xml.write_element("Point", + { + "Delay" : self.delay, + "Arg" : self.arg, + } + ) + + def __init__(self, points, is_zero=False): + self.name = None # Assigned when bank is finalized + + self.is_zero = is_zero + self.release_rates = [] + self._release_rate = None # cached + + assert len(points) != 0 + assert type(points[0]) == Envelope.EnvelopePoint + self.points = points + + if not self.is_zero: + while self.points[-1].is_disable(): + self.points.pop() + + assert self.points[-1].is_hang() + + def __str__(self): + out = "{\n" + out += " " + ", ".join([str(point) for point in self.points]) + "\n" + out += "}\n" + return out + + def release_rate(self): + if self._release_rate is not None: + return self._release_rate + + rates = collections.Counter(self.release_rates).most_common() + assert len(rates) in [0, 1], rates # TODO handle ties? + + self._release_rate = 0 if len(rates) == 0 else rates[0][0] + return self._release_rate + + def to_xml(self, xml : XMLWriter, name : str): + if self.is_zero: + return xml.write_element("Envelope") + + xml.write_start_tag("Envelope", + { + "Name" : name, + "Release" : self.release_rate(), + } + ) + + for point in self.points[:-1]: # exclude final hang command, will be added by the soundfont compiler on build + point.to_xml(xml) + + xml.write_end_tag() diff --git a/tools/audio/extraction/tuning.py b/tools/audio/extraction/tuning.py new file mode 100644 index 0000000000..b538c68e8d --- /dev/null +++ b/tools/audio/extraction/tuning.py @@ -0,0 +1,211 @@ +#!/usr/bin/env python3 +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 +# +# Estimate (samplerate, basenote) from tuning +# +# tuning = samplerate * 2 ** basenote +# + +from typing import List, Tuple + +from .util import f32, u32_to_f32, f32_to_u32 + +# Mirrors gPitchFrequencies in audio driver source. +# Indexed by z64 note numbers, g_pitch_frequencies[C4] = 1.0 (0x3F800000) +# Converted to their IEEE-754 binary representation to avoid any string -> float parser trouble as we need exact values. +g_pitch_frequencies = ( + 0x3DD744F6, 0x3DE411C3, 0x3DF1A198, 0x3E000000, 0x3E079C84, 0x3E0FACE6, 0x3E1837F8, 0x3E21450F, + 0x3E2ADC0A, 0x3E350508, 0x3E3FC86D, 0x3E4B2FEC, 0x3E5744F6, 0x3E641206, 0x3E71A1DC, 0x3E800000, + 0x3E879C84, 0x3E8FACE6, 0x3E9837F8, 0x3EA1450F, 0x3EAADC0A, 0x3EB504E6, 0x3EBFC88E, 0x3ECB2FEC, + 0x3ED744F6, 0x3EE411E4, 0x3EF1A1BA, 0x3F000000, 0x3F079C84, 0x3F0FACD6, 0x3F1837F8, 0x3F214520, + 0x3F2ADC0A, 0x3F3504F7, 0x3F3FC88E, 0x3F4B2FFD, 0x3F574507, 0x3F6411F5, 0x3F71A1CB, 0x3F800000, + 0x3F879C7C, 0x3F8FACD6, 0x3F9837EF, 0x3FA14517, 0x3FAADC0A, 0x3FB504F7, 0x3FBFC886, 0x3FCB2FF5, + 0x3FD744FE, 0x3FE411F5, 0x3FF1A1C2, 0x40000000, 0x40079C7C, 0x400FACD6, 0x401837EF, 0x40214517, + 0x402ADC0A, 0x403504F7, 0x403FC88A, 0x404B2FF9, 0x405744FE, 0x406411F5, 0x4071A1C2, 0x40800000, + 0x40879C7E, 0x408FACD8, 0x409837F1, 0x40A14519, 0x40AADC0A, 0x40B504F5, 0x40BFC888, 0x40CB2FF9, + 0x40D74500, 0x40E411F5, 0x40F1A1C2, 0x41000000, 0x41079C7D, 0x410FACD7, 0x411837F1, 0x41214519, + 0x412ADC0A, 0x413504F5, 0x413FC889, 0x414B2FF8, 0x41574500, 0x416411F4, 0x4171A1C3, 0x41800000, + 0x41879C7D, 0x418FACD7, 0x419837F1, 0x41A14519, 0x41AADC0A, 0x41B504F5, 0x41BFC889, 0x41CB2FF8, + 0x41D74500, 0x41E411F4, 0x41F1A1C3, 0x42000000, 0x42079C7D, 0x420FACD7, 0x421837F1, 0x42214519, + 0x422ADC0A, 0x423504F5, 0x423FC889, 0x424B2FF8, 0x42574500, 0x426411F4, 0x4271A1C3, 0x42800000, + 0x42879C7D, 0x428FACD7, 0x429837F1, 0x42A14519, 0x42AADC0A, 0x3D6411C3, 0x3D71A198, 0x3D800000, + 0x3D879C41, 0x3D8FACE6, 0x3D9837B5, 0x3DA1450F, 0x3DAADBC6, 0x3DB504C5, 0x3DBFC86D, 0x3DCB302F, +) + +# Names for pitch values indexed by z64 note numbers, pitch_names[39] = C4 +pitch_names = ( + "A0", "BF0", "B0", + "C1", "DF1", "D1", "EF1", "E1", "F1", "GF1", "G1", "AF1", "A1", "BF1", "B1", + "C2", "DF2", "D2", "EF2", "E2", "F2", "GF2", "G2", "AF2", "A2", "BF2", "B2", + "C3", "DF3", "D3", "EF3", "E3", "F3", "GF3", "G3", "AF3", "A3", "BF3", "B3", + "C4", "DF4", "D4", "EF4", "E4", "F4", "GF4", "G4", "AF4", "A4", "BF4", "B4", + "C5", "DF5", "D5", "EF5", "E5", "F5", "GF5", "G5", "AF5", "A5", "BF5", "B5", + "C6", "DF6", "D6", "EF6", "E6", "F6", "GF6", "G6", "AF6", "A6", "BF6", "B6", + "C7", "DF7", "D7", "EF7", "E7", "F7", "GF7", "G7", "AF7", "A7", "BF7", "B7", + "C8", "DF8", "D8", "EF8", "E8", "F8", "GF8", "G8", "AF8", "A8", "BF8", "B8", + "C9", "DF9", "D9", "EF9", "E9", "F9", "GF9", "G9", "AF9", "A9", "BF9", "B9", + "C10", "DF10", "D10", "EF10", "E10", "F10", + "BFNEG1", "BNEG1", + "C0", "DF0", "D0", "EF0", "E0", "F0", "GF0", "G0", "AF0", +) + +# Floats that are encountered in extraction but cannot be resolved to a match. +BAD_FLOATS = [0x3E7319E3] + +def note_z64_to_midi(note : int) -> int: + """ + Convert a z64 note number to MIDI note number. + + Middle C is 39 in z64, while it is 60 in MIDI. + We want MIDI note numbers to store in the extracted sample files (aiff or wav) + """ + return (21 + note) % 128 + +def recalc_tuning(rate : int, note : str) -> float: + return f32(f32(rate / 32000.0) * u32_to_f32(g_pitch_frequencies[pitch_names.index(note)])) + +def rate_from_tuning(tuning : float) -> Tuple[Tuple[str,int]]: + """ + Decompose a tuning value into a pair (samplerate, basenote) that round-trips when ran through `recalc_tuning` + """ + matches : List[Tuple[str,int]] = [] + diffs : List[Tuple[int, Tuple[str,int]]] = [] + + tuning_bits : int = f32_to_u32(tuning) + + def test_value(note_val : int, nominal_rate : int, freq : float): + if nominal_rate > 48000: + # reject samplerate if too high + return + + # recalc tuning and compare to original + + tuning2 : float = f32(f32(nominal_rate / 32000.0) * freq) + + diff : int = abs(f32_to_u32(tuning2) - tuning_bits) + + if diff == 0: + matches.append((pitch_names[note_val], nominal_rate)) + else: + diffs.append((diff, (pitch_names[note_val], nominal_rate))) + + # search gPitchFrequencies LUT one by one. We don't exit as soon as a match is found as in general this procedure + # only recovers the correct (rate,note) pair up to multiples of 2, to get the final value we want to select the + # "best" of these pairs by an essentially arbitrary ranking (cf `rank_rates_notes`) + for note_val,freq_bits in enumerate(g_pitch_frequencies): + freq : float = u32_to_f32(freq_bits) + + # compute the "nominal" samplerate for a given basenote by R = 32000 * (t / f) + nominal_rate : int = int(f32(tuning / freq) * 32000.0) + + # test nominal value and +/-1 + test_value(note_val, nominal_rate, freq) + test_value(note_val, nominal_rate + 1, freq) + test_value(note_val, nominal_rate - 1, freq) + + if len(matches) != 0: + return tuple(matches) + + # no matches found... check if we expected this, otherwise flag it for special handling + assert tuning_bits in BAD_FLOATS , f"0x{tuning_bits:08X}" + + # just take the closest match and hack it in the soundfont compiler + hack_rate = sorted(diffs, key=lambda e : e[0])[0] + return (hack_rate[1],) + +def rank_rates_notes(layouts): + + def rank_rate_note(rate, notes): + """ + Arbitrarily rank the input samplerate + note numbers, based on what is most likely. + """ + rank = 0 + + if 'C4' in notes and rate > 10000: + rank += 10000 + elif 'C2' in notes and rate > 10000: + rank += 9500 + elif 'D3' in notes and rate > 10000: + rank += 8500 + elif 'D4' in notes and rate > 10000: + rank += 8000 + elif 'G3' in notes: + rank += 2000 + elif 'F3' in notes: + rank += 25 + elif 'C0' in notes: + rank += 50 + elif 'BF2' in notes: + rank += 30 + elif 'B3' in notes: + rank += 25 + elif 'BF1' in notes: + rank += 25 + elif 'E2' in notes: + rank += 20 + elif 'F6' in notes: + rank += 15 + elif 'GF2' in notes: + rank += 10 + + rank += { + 32000 : 200, + 16000 : 100, + 24000 : 50, + 22050 : 30, + 20000 : 28, + 44100 : 25, + 12000 : 15, + 8000 : 10, + 15950 : 5, + 20050 : 5, + 31800 : 5, + }.get(rate, 0) + + return rank + + # Input should not be empty + assert len(layouts) != 0 + + if len(layouts) == 1: + # No ranking needed, there is only one possible option + return layouts[0] + + # Ranking is needed, rank each layout + ranked = list(sorted(layouts, key=lambda L : rank_rate_note(*L), reverse=True)) + + # Ensure the ranking produced a unique best option + assert rank_rate_note(*ranked[0]) != rank_rate_note(*ranked[1]) , ranked + + # Output best + return ranked[0] + +if __name__ == '__main__': + import argparse + + parser = argparse.ArgumentParser(description="Given either a (rate,note) or a tuning, compute all matching rates/notes.") + parser.add_argument("-t", dest="tuning", required=False, default=None, type=float, help="Tuning value (float)") + parser.add_argument("-r", dest="rate", required=False, default=None, type=int, help="Sample rate (integer)") + parser.add_argument("-n", dest="note", required=False, default=None, type=str, help="Base note (note name)") + parser.add_argument("--show-result", required=False, default=False, action="store_true", help="Show recalculated tuning value") + args = parser.parse_args() + + if args.tuning is not None: + # Take input tuning + tuning = args.tuning + elif args.rate is not None and args.note is not None: + # Calculate target tuning from input rate and note + tuning : float = recalc_tuning(args.rate, args.note) + else: + # Insufficient arguments + parser.print_help() + raise SystemExit("Must specify either -t or both -r and -n.") + + notes_rates : Tuple[Tuple[str,int]] = rate_from_tuning(tuning) + + for note,rate in notes_rates: + if args.show_result: + print(rate, note, "->", recalc_tuning(rate, note)) + else: + print(rate, note) diff --git a/tools/audio/extraction/util.py b/tools/audio/extraction/util.py new file mode 100644 index 0000000000..20891810cc --- /dev/null +++ b/tools/audio/extraction/util.py @@ -0,0 +1,126 @@ +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 +# +# Misc utilities +# + +import struct, subprocess, sys + +def debugm(msg): + """ + Debug message on stderr + """ + print(msg, file=sys.stderr) + +def error(msg): + """ + Debug message + exit + """ + debugm(msg) + sys.exit(1) + +def incbin(rom, offset, size): + return rom[offset:offset+size] + +def f32(f): + """ + Reduces precision of f to a 32-bit float for correct intermediate calculations + """ + return struct.unpack("f", struct.pack("f", f))[0] + +def u32_to_f32(u): + """ + Convert IEEE-754 binary rep to float + """ + return struct.unpack(">f", struct.pack(">I", u))[0] + +def f32_to_u32(f): + """ + Convert float to IEEE-754 binary rep + """ + return struct.unpack(">I", struct.pack(">f", f))[0] + +def align(x, n): + """ + Align to next n (power of 2) + """ + return (x + (n - 1)) & ~(n - 1) + +def merge_ranges(intervals): + if len(intervals) == 0: + return [] + + intervals = sorted(intervals, key=lambda x: x[0][0]) + + stack = [intervals[0]] + for i in range(1, len(intervals)): + last_element = stack[len(stack) - 1] + if last_element[1][0] >= intervals[i][0][0]: + last_element[1] = max(intervals[i][1], last_element[1], key=lambda x: x[0]) + stack.pop(len(stack) - 1) + stack.append(last_element) + else: + stack.append(intervals[i]) + return stack + +def merge_like_ranges(intervals): + if len(intervals) == 0: + return [] + + intervals = sorted(intervals, key=lambda x: x[0][0]) + + stack = [intervals[0]] + for i in range(1, len(intervals)): + last_element = stack[len(stack) - 1] + if last_element[1][0] >= intervals[i][0][0] and last_element[1][1] == intervals[i][1][1]: + last_element[1] = max(intervals[i][1], last_element[1], key=lambda x: x[0]) + stack.pop(len(stack) - 1) + stack.append(last_element) + else: + stack.append(intervals[i]) + return stack + +def list_is_in_order(l): + return all(l[i] <= l[i + 1] for i in range(len(l) - 1)) + +def program_call(cmd): + subprocess.check_call(cmd, shell=True) + +def program_get(cmd): + return subprocess.check_output(cmd, shell=True).decode("ascii") + +class XMLWriter: + """ + Simple XML builder for writing with desired formatting characteristics (no tabs, 4 space indent) + """ + + def __init__(self): + self.contents = "" + self.tag_stack = [] + + def __str__(self): + return self.contents + + def write_line(self, name, open, close, attributes): + indent = " " * len(self.tag_stack) + if attributes is None: + self.contents += f"{indent}{open}{name}{close}\n" + else: + attributes_str = " ".join(f"{k}=\"{v}\"" for k,v in attributes.items()) + self.contents += f"{indent}{open}{name} {attributes_str}{close}\n" + + def write_comment(self, comment): + self.write_line(comment, "", None) + + def write_start_tag(self, name, attributes=None): + self.write_line(name, "<", ">", attributes) + self.tag_stack.append(name) + + def write_end_tag(self): + self.write_line(self.tag_stack.pop(), "", None) + + def write_element(self, name, attributes=None): + self.write_line(name, "<", "/>", attributes) + + def write_raw(self, contents): + self.write_line(contents, "", "", None) diff --git a/tools/audio/samplebank.c b/tools/audio/samplebank.c new file mode 100644 index 0000000000..30593e1d1e --- /dev/null +++ b/tools/audio/samplebank.c @@ -0,0 +1,125 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include +#include + +#include "xml.h" +#include "samplebank.h" +#include "util.h" + +const char * +samplebank_path_forname(samplebank *sb, const char *name) +{ + assert(name != NULL); + + for (size_t i = 0; i < sb->num_samples; i++) { + if (strequ(sb->sample_names[i], name)) + return sb->sample_paths[i]; + } + return NULL; +} + +typedef struct { + const char *name; + const char *path; +} samplebank_xml_entry; + +void +read_samplebank_xml(samplebank *sb, xmlDocPtr doc) +{ + // XML Example: + // + // + // + // + + static const xml_attr_spec header_spec = { + {"Name", false, xml_parse_c_identifier, offsetof(samplebank, name) }, + { "Index", false, xml_parse_int, offsetof(samplebank, index) }, + { "Medium", false, xml_parse_c_identifier, offsetof(samplebank, medium) }, + { "CachePolicy", false, xml_parse_c_identifier, offsetof(samplebank, cache_policy)}, + { "BufferBug", true, xml_parse_bool, offsetof(samplebank, buffer_bug) }, + }; + static const xml_attr_spec entry_spec = { + {"Name", false, xml_parse_c_identifier, offsetof(samplebank_xml_entry, name)}, + { "Path", false, xml_parse_string, offsetof(samplebank_xml_entry, path)}, + }; + + xmlNodePtr root = xmlDocGetRootElement(doc); + + if (!strequ(XMLSTR_TO_STR(root->name), "SampleBank")) + error("Root node must be "); + + sb->buffer_bug = false; + xml_parse_node_by_spec(sb, root, header_spec, ARRAY_COUNT(header_spec)); + + if (root->children == NULL) + error("Missing samples list"); + + size_t entries_cap = 8; + size_t entries_len = 0; + sb->sample_names = malloc(entries_cap * sizeof(const char *)); + sb->sample_paths = malloc(entries_cap * sizeof(const char *)); + sb->is_sample = malloc(entries_cap * sizeof(bool)); + + size_t pointers_cap = 4; + size_t pointers_len = 0; + sb->pointer_indices = malloc(pointers_cap * sizeof(int)); + + LL_FOREACH(xmlNodePtr, node, root->children) { + if (node->type != XML_ELEMENT_NODE) + continue; + + if (node->children != NULL) { + xmlNodePtr first_child = node->children; + const char *child_name = XMLSTR_TO_STR(first_child->name); + error("Unexpected child node(s) (first is %s) in samples list (line %d)", child_name, first_child->line); + } + + const char *node_name = XMLSTR_TO_STR(node->name); + bool is_sample; + + if (strequ(node_name, "Sample")) { + is_sample = true; + } else if (strequ(node_name, "Blob")) { + is_sample = false; + } else if (strequ(node_name, "Pointer")) { + // pointer entry + int ptr_index; + xml_get_single_property(&ptr_index, node, "Index", xml_parse_int); + + if (pointers_len == pointers_cap) { + pointers_cap *= 2; + sb->pointer_indices = realloc(sb->pointer_indices, pointers_cap * sizeof(int)); + } + sb->pointer_indices[pointers_len++] = ptr_index; + continue; + } else { + error("Unexpected element node %s in samples list (line %d)", node_name, node->line); + } + + samplebank_xml_entry ent; + xml_parse_node_by_spec(&ent, node, entry_spec, ARRAY_COUNT(entry_spec)); + + if (entries_len == entries_cap) { + entries_cap *= 2; + sb->sample_names = realloc(sb->sample_names, entries_cap * sizeof(const char *)); + sb->sample_paths = realloc(sb->sample_paths, entries_cap * sizeof(const char *)); + sb->is_sample = realloc(sb->is_sample, entries_cap * sizeof(bool)); + } + + sb->sample_names[entries_len] = ent.name; + sb->sample_paths[entries_len] = ent.path; + sb->is_sample[entries_len] = is_sample; + entries_len++; + } + + sb->num_samples = entries_len; + sb->num_pointers = pointers_len; +} diff --git a/tools/audio/samplebank.h b/tools/audio/samplebank.h new file mode 100644 index 0000000000..c436253fc6 --- /dev/null +++ b/tools/audio/samplebank.h @@ -0,0 +1,36 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef SAMPLEBANK_H_ +#define SAMPLEBANK_H_ + +#include "xml.h" + +typedef struct { + const char *name; + int index; + const char *medium; + const char *cache_policy; + bool buffer_bug; + + size_t num_samples; + const char **sample_paths; + const char **sample_names; + bool *is_sample; + + size_t num_pointers; + int *pointer_indices; +} samplebank; + +const char * +samplebank_path_forname(samplebank *sb, const char *name); + +void +read_samplebank_xml(samplebank *sb, xmlDocPtr doc); + +#endif diff --git a/tools/audio/samplebank_compiler.c b/tools/audio/samplebank_compiler.c new file mode 100644 index 0000000000..f188654f62 --- /dev/null +++ b/tools/audio/samplebank_compiler.c @@ -0,0 +1,204 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include +#include +#include +#include + +#include "xml.h" +#include "aifc.h" +#include "samplebank.h" +#include "util.h" + +NORETURN static void +usage(const char *progname) +{ + fprintf(stderr, "Usage: %s [--matching] [--makedepend ] \n", progname); + exit(EXIT_FAILURE); +} + +int +main(int argc, char **argv) +{ + static uint8_t match_buf[BUG_BUF_SIZE]; + const char *filename = NULL; + xmlDocPtr document; + const char *outfilename = NULL; + const char *mdfilename = NULL; + FILE *mdfile; + FILE *outf; + samplebank sb; + uint8_t *match_buf_ptr; + size_t match_buf_pos; + bool matching = false; + + // parse args + +#define arg_error(fmt, ...) \ + do { \ + fprintf(stderr, fmt "\n", ##__VA_ARGS__); \ + usage(argv[0]); \ + } while (0) + + int argn = 0; + for (int i = 1; i < argc; i++) { + if (argv[i][0] == '-') { + // Optional args + + if (strequ(argv[i], "--matching")) { + if (matching) + arg_error("Received --matching option twice"); + + matching = true; + continue; + } + if (strequ(argv[i], "--makedepend")) { + if (mdfilename != NULL) + arg_error("Received --makedepend option twice"); + if (i + 1 == argc) + arg_error("--makedepend missing required argument"); + + mdfilename = argv[++i]; + continue; + } + arg_error("Unknown option \"%s\"", argv[i]); + } else { + // Required args + + switch (argn) { + case 0: + filename = argv[i]; + break; + case 1: + outfilename = argv[i]; + break; + default: + arg_error("Unknown positional argument \"%s\"", argv[i]); + break; + } + argn++; + } + } + if (argn != 2) + arg_error("Not enough positional arguments"); + +#undef arg_error + + // open xml + document = xmlReadFile(filename, NULL, XML_PARSE_NONET); + if (document == NULL) + return EXIT_FAILURE; + + // parse xml + read_samplebank_xml(&sb, document); + + // open output asm file + outf = fopen(outfilename, "w"); + if (outf == NULL) + error("Unable to open output file [%s] for writing", outfilename); + + // open output dep file if applicable + if (mdfilename != NULL) { + mdfile = fopen(mdfilename, "w"); + if (mdfile == NULL) + error("Unable to open dependency file [%s] for writing", mdfilename); + + fprintf(mdfile, "%s: \\\n %s", outfilename, filename); + } + + // write output + + fprintf(outf, + // clang-format off + ".rdata" "\n" + ".balign 16" "\n" + "\n" + ".global %s_Start" "\n" + "%s_Start:" "\n" + "$start:" "\n", + // clang-format on + sb.name, sb.name); + + // original tool appears to have a buffer clearing bug involving a buffer sized BUG_BUF_SIZE + match_buf_ptr = (matching) ? match_buf : NULL; + match_buf_pos = 0; + + for (size_t i = 0; i < sb.num_samples; i++) { + const char *name = sb.sample_names[i]; + const char *path = sb.sample_paths[i]; + bool is_sample = sb.is_sample[i]; + + if (mdfilename != NULL) + fprintf(mdfile, " \\\n %s", path); + + if (!is_sample) { + // blob + fprintf(outf, + // clang-format off + "\n" + "# BLOB %s" "\n" + "\n" + ".incbin \"%s\"" "\n" + "\n" + ".balign 16" "\n" + "\n", + // clang-format on + name, path); + continue; + } + + // aifc sample + fprintf(outf, + // clang-format off + "\n" + "# SAMPLE %lu" "\n" + "\n" + ".global %s_%s_Abs" "\n" + "%s_%s_Abs:" "\n" + ".global %s_%s_Off" "\n" + ".set %s_%s_Off, . - $start" "\n" + "\n", + // clang-format on + i, sb.name, name, sb.name, name, sb.name, name, sb.name, name); + + aifc_data aifc; + aifc_read(&aifc, path, match_buf_ptr, &match_buf_pos); + + fprintf(outf, ".incbin \"%s\", 0x%lX, 0x%lX\n", path, aifc.ssnd_offset, aifc.ssnd_size); + + if (matching && sb.buffer_bug && i == sb.num_samples - 1) { + // emplace garbage + size_t end = ALIGN16(match_buf_pos); + + fprintf(outf, "\n# Garbage data from buffer bug\n"); + for (; match_buf_pos < end; match_buf_pos++) + fprintf(outf, ".byte 0x%02X\n", match_buf[match_buf_pos]); + } else { + fputs("\n.balign 16\n", outf); + } + + aifc_dispose(&aifc); + } + + if (mdfilename != NULL) { + fputs("\n", mdfile); + fclose(mdfile); + } + + fprintf(outf, + // clang-format off + ".global %s_Size" "\n" + ".set %s_Size, . - $start" "\n", + // clang-format on + sb.name, sb.name); + + fclose(outf); + xmlFreeDoc(document); + return EXIT_SUCCESS; +} diff --git a/tools/audio/sampleconv/.clang-format b/tools/audio/sampleconv/.clang-format new file mode 100644 index 0000000000..20dda610d7 --- /dev/null +++ b/tools/audio/sampleconv/.clang-format @@ -0,0 +1,29 @@ +IndentWidth: 4 +Language: Cpp +UseTab: Never +ColumnLimit: 120 +PointerAlignment: Right +BreakBeforeBraces: Linux +AlwaysBreakAfterReturnType: TopLevel +AlignArrayOfStructures: Left +SpaceAfterCStyleCast: false +SpaceBeforeParens: ControlStatementsExceptControlMacros +Cpp11BracedListStyle: false +IndentCaseLabels: true +BinPackArguments: true +BinPackParameters: true +AlignAfterOpenBracket: Align +AlignOperands: true +BreakBeforeTernaryOperators: true +BreakBeforeBinaryOperators: None +AllowShortBlocksOnASingleLine: true +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AlignEscapedNewlines: Left +AlignTrailingComments: true +SortIncludes: false +AlignConsecutiveMacros: Consecutive +ForEachMacros: ['LL_FOREACH'] diff --git a/tools/audio/sampleconv/.gitignore b/tools/audio/sampleconv/.gitignore new file mode 100644 index 0000000000..468e4e0371 --- /dev/null +++ b/tools/audio/sampleconv/.gitignore @@ -0,0 +1,2 @@ +build/ +sampleconv diff --git a/tools/audio/sampleconv/Makefile b/tools/audio/sampleconv/Makefile new file mode 100644 index 0000000000..a023b237e1 --- /dev/null +++ b/tools/audio/sampleconv/Makefile @@ -0,0 +1,36 @@ + +CC := gcc +CFLAGS := -Wall -Wextra -MMD +OPTFLAGS := -Og -g3 +LDFLAGS := + +CLANG_FORMAT := clang-format-14 +FORMAT_ARGS := -i -style=file + +SRC_DIRS := $(shell find src -type d) +C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c)) +O_FILES := $(foreach f,$(C_FILES:.c=.o),build/$f) + +DEP_FILES := $(foreach f,$(C_FILES:.c=.d),build/$f) + +$(shell mkdir -p build $(foreach dir,$(SRC_DIRS),build/$(dir))) + +.PHONY: all clean distclean format + +all: sampleconv + +clean: + $(RM) -rf build sampleconv + +distclean: clean + +format: + $(CLANG_FORMAT) $(FORMAT_ARGS) $(C_FILES) $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.h)) + +sampleconv: $(O_FILES) + $(CC) $(LDFLAGS) $(O_FILES) -lm -o $@ + +build/src/%.o: src/%.c + $(CC) -c $(CFLAGS) $(OPTFLAGS) $< -o $@ + +-include $(DEP_FILES) diff --git a/tools/audio/sampleconv/src/codec/codec.h b/tools/audio/sampleconv/src/codec/codec.h new file mode 100644 index 0000000000..5ebaae855a --- /dev/null +++ b/tools/audio/sampleconv/src/codec/codec.h @@ -0,0 +1,38 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef CODEC_H_ +#define CODEC_H_ + +#include + +#include "../container/container.h" + +#include "vadpcm.h" +#include "uncompressed.h" + +typedef struct enc_dec_opts { + // Matching + bool matching; + + // VADPCM options + bool truncate; + uint32_t min_loop_length; + table_design_spec design; +} enc_dec_opts; + +typedef struct codec_spec { + const char *name; + sample_data_type type; + int frame_size; + bool compressed; + int (*decode)(container_data *ctnr, const struct codec_spec *codec, const struct enc_dec_opts *opts); + int (*encode)(container_data *ctnr, const struct codec_spec *codec, const struct enc_dec_opts *opts); +} codec_spec; + +#endif diff --git a/tools/audio/sampleconv/src/codec/uncompressed.c b/tools/audio/sampleconv/src/codec/uncompressed.c new file mode 100644 index 0000000000..ccd37f3813 --- /dev/null +++ b/tools/audio/sampleconv/src/codec/uncompressed.c @@ -0,0 +1,56 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include +#include +#include +#include + +#include "../util.h" + +#include "codec.h" +#include "../container/container.h" + +int +pcm16_enc_dec(UNUSED container_data *ctnr, UNUSED const codec_spec *codec, UNUSED const enc_dec_opts *opts) +{ + // Since we decode to and encode from pcm16, there's nothing to do. + return 0; +} + +// TODO +int +pcm8_dec(UNUSED container_data *ctnr, UNUSED const codec_spec *codec, UNUSED const enc_dec_opts *opts) +{ +#if 0 + for (size_t i = 0; i < num_samples; i++) { + uint8_t insamp = ((uint8_t *)in)[i]; + + int16_t outsamp = insamp << 8; // - 0x80 before shift ? + + ((int16_t *)out)[i] = outsamp; + } +#endif + return 0; +} + +// TODO +int +pcm8_enc(UNUSED container_data *ctnr, UNUSED const codec_spec *codec, UNUSED const enc_dec_opts *opts) +{ +#if 0 + for (size_t i = 0; i < num_samples; i++) { + uint16_t insamp = ((uint16_t *)in)[i]; + + uint8_t outsamp = insamp >> 8; + + ((uint8_t *)out)[i] = outsamp; + } +#endif + return 0; +} diff --git a/tools/audio/sampleconv/src/codec/uncompressed.h b/tools/audio/sampleconv/src/codec/uncompressed.h new file mode 100644 index 0000000000..41ef2f11d5 --- /dev/null +++ b/tools/audio/sampleconv/src/codec/uncompressed.h @@ -0,0 +1,21 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef CODEC_UNCOMPRESSED_H +#define CODEC_UNCOMPRESSED_H + +int +pcm16_dec(struct container_data *ctnr, const struct codec_spec *codec, const struct enc_dec_opts *opts); + +int +pcm16_enc(struct container_data *ctnr, const struct codec_spec *codec, const struct enc_dec_opts *opts); + +int +pcm16_enc_dec(struct container_data *ctnr, const struct codec_spec *codec, const struct enc_dec_opts *opts); + +#endif diff --git a/tools/audio/sampleconv/src/codec/vadpcm.c b/tools/audio/sampleconv/src/codec/vadpcm.c new file mode 100644 index 0000000000..8765fa02cf --- /dev/null +++ b/tools/audio/sampleconv/src/codec/vadpcm.c @@ -0,0 +1,1319 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: CC0-1.0 + */ +#include +#include +#include +#include +#include +#include +#include + +#include "../util.h" + +#include "codec.h" + +int +expand_codebook(int16_t *book_data, int32_t ****table_out, int32_t order, int32_t npredictors) +{ + int32_t ***table = MALLOC_CHECKED_INFO(npredictors * sizeof(int32_t **), "npredictors=%d", npredictors); + + for (int32_t i = 0; i < npredictors; i++) { + table[i] = MALLOC_CHECKED(8 * sizeof(int32_t *)); + for (int32_t j = 0; j < 8; j++) + table[i][j] = MALLOC_CHECKED_INFO((order + 8) * sizeof(int32_t), "order=%d", order); + } + + for (int32_t i = 0; i < npredictors; i++) { + int32_t **table_entry = table[i]; + + for (int32_t j = 0; j < order; j++) { + for (int32_t k = 0; k < 8; k++) + table_entry[k][j] = *(book_data++); + } + + for (int32_t k = 1; k < 8; k++) + table_entry[k][order] = table_entry[k - 1][order - 1]; + + table_entry[0][order] = 1 << 11; + + for (int32_t k = 1; k < 8; k++) { + int32_t j = 0; + + for (; j < k; j++) + table_entry[j][k + order] = 0; + for (; j < 8; j++) + table_entry[j][k + order] = table_entry[j - k][order]; + } + } + + *table_out = table; + return 0; +} + +int +compressed_expanded_codebook(int16_t **book_data_out, int32_t ***table, int order, int npredictors) +{ + int16_t *book_data = + MALLOC_CHECKED_INFO(sizeof(int16_t) * 8 * order * npredictors, "order=%d, npredictors=%d", order, npredictors); + + int n = 0; + for (int32_t i = 0; i < npredictors; i++) { + for (int32_t j = 0; j < order; j++) { + for (int32_t k = 0; k < 8; k++) + book_data[n++] = table[i][k][j]; + } + } + *book_data_out = book_data; + return 0; +} + +int +destroy_expanded_codebook(int32_t ***table, int npredictors) +{ + for (int i = 0; i < npredictors; i++) { + for (int j = 0; j < 8; j++) + free(table[i][j]); + free(table[i]); + } + free(table); + return 0; +} + +static uint32_t +myrand(void) +{ + static uint64_t state = 1619236481962341ull; + state *= 3123692312237ull; + state++; + return state >> 33; +} + +static int16_t +qsample(float x, int32_t scale) +{ + if (x > 0.0f) + return (int16_t)((x / scale) + 0.4999999); + else + return (int16_t)((x / scale) - 0.4999999); +} + +/** + * Round all ('fs' many) values in 'e' to the nearest 'bits'-bit integer, + * outputting to 'ie'. + */ +static void +clamp(int32_t fs, float *e, int32_t *ie, int32_t bits) +{ + int32_t i; + float ulevel; + float llevel; + + llevel = -(float)(1 << (bits - 1)); + ulevel = -llevel - 1.0f; + for (i = 0; i < fs; i++) { + if (e[i] > ulevel) + e[i] = ulevel; + if (e[i] < llevel) + e[i] = llevel; + + if (e[i] > 0.0f) + ie[i] = (int32_t)(e[i] + 0.5); + else + ie[i] = (int32_t)(e[i] - 0.5); + } +} + +static void +clamp_to_s16(float *in, int32_t *out) +{ + for (int i = 0; i < 16; i++) { + if (in[i] > 0x7fff) + in[i] = 0x7fff; + if (in[i] < -0x8000) + in[i] = -0x8000; + + if (in[i] > 0.0f) + out[i] = (int32_t)(in[i] + 0.5); + else + out[i] = (int32_t)(in[i] - 0.5); + } +} + +static int16_t +clamp_bits(int32_t x, int32_t bits) +{ + int32_t lim = 1 << (bits - 1); + + if (x < -lim) + return -lim; + if (x > lim - 1) + return lim - 1; + return x; +} + +static int32_t +inner_product(int32_t length, int32_t *v1, int32_t *v2) +{ + int32_t out = 0; + for (int32_t i = 0; i < length; i++) + out += v1[i] * v2[i]; + + // Compute "out / 2^11", rounded down. + int32_t dout = out / (1 << 11); + int32_t fiout = dout * (1 << 11); + return dout - (out - fiout < 0); +} + +static void +vdecodeframe(uint8_t *frame, int32_t *prescaled, int32_t *state, int32_t order, int32_t ***coef_tbl, int frame_size) +{ + uint8_t header = frame[0]; + int32_t scale = 1 << ((header >> 4) & 0xF); + int32_t optimalp = (header >> 0) & 0xF; + + int32_t ix[16]; + + // Unpack + if (frame_size == 5) { + for (int32_t i = 0; i < 16; i += 4) { + uint8_t c = frame[1 + i / 4]; + ix[i + 0] = (c >> 6) & 0b11; + ix[i + 1] = (c >> 4) & 0b11; + ix[i + 2] = (c >> 2) & 0b11; + ix[i + 3] = (c >> 0) & 0b11; + } + } else { + for (int32_t i = 0; i < 16; i += 2) { + uint8_t c = frame[1 + i / 2]; + ix[i + 0] = (c >> 4) & 0xF; + ix[i + 1] = (c >> 0) & 0xF; + } + } + + // Sign-extend and scale + for (int32_t i = 0; i < 16; i++) { + if (frame_size == 5) { + if (ix[i] >= 2) // 2-bit sign extension + ix[i] -= 4; + } else { + if (ix[i] >= 8) // 4-bit sign extension + ix[i] -= 16; + } + prescaled[i] = ix[i]; // save decompressed frame data before scaling + ix[i] *= scale; + } + + int32_t **coef_page = coef_tbl[optimalp]; + + // Inner product with predictor coefficients + for (int32_t j = 0; j < 2; j++) { + int32_t in_vec[16]; + + for (int32_t i = 0; i < order; i++) + in_vec[i] = state[(2 - j) * 8 - order + i]; + + for (int32_t i = 0; i < 8; i++) { + int32_t ind = j * 8 + i; + + in_vec[order + i] = ix[ind]; + state[ind] = inner_product(order + i, coef_page[i], in_vec) + ix[ind]; + } + } +} + +/** + * Similar to vencodeframe but sources data differently and doubles up certain operations. This is used during + * brute-force decoding of compressed data to decompressed data that matches on round-trip. + */ +static void +my_encodeframe(uint8_t *out, int16_t *in_buf, int32_t *orig_state, int32_t ***coef_tbl, int32_t order, + int32_t npredictors, int frame_size) +{ + int16_t ix[16]; + int32_t prediction[16]; + int32_t in_vec[16]; + int32_t optimalp = 0; + int32_t scale; + int32_t encBits = (frame_size == 5) ? 2 : 4; + int32_t llevel = -(1 << (encBits - 1)); + int32_t ulevel = -llevel - 1; + int32_t ie[16]; + float e[16]; + + // Determine the best-fitting predictor. + float min = 1e30; + int32_t scale_factor = 16 - encBits; + + for (int32_t k = 0; k < npredictors; k++) { + for (int32_t j = 0; j < 2; j++) { + // Copy over the last 'order' samples from the previous output. + for (int32_t i = 0; i < order; i++) + in_vec[i] = (j == 0) ? orig_state[16 - order + i] : in_buf[8 - order + i]; + + // For 8 samples... + for (int32_t i = 0; i < 8; i++) { + // Compute a prediction based on 'order' values from the old state, + // plus previous errors in this chunk, as an inner product with the + // coefficient table. + prediction[j * 8 + i] = inner_product(order + i, coef_tbl[k][i], in_vec); + // Record the error in in_vec (thus, its first 'order' samples + // will contain actual values, the rest will be error terms), and + // in floating point form in e (for no particularly good reason). + in_vec[i + order] = in_buf[j * 8 + i] - prediction[j * 8 + i]; + e[j * 8 + i] = (float)in_vec[i + order]; + } + } + + // Compute the L2 norm of the errors; the lowest norm decides which + // predictor to use. + float se = 0.0f; + for (int32_t j = 0; j < 16; j++) + se += e[j] * e[j]; + + if (se < min) { + min = se; + optimalp = k; + } + } + + // Do exactly the same thing again, for real. + for (int32_t j = 0; j < 2; j++) { + for (int32_t i = 0; i < order; i++) + in_vec[i] = (j == 0) ? orig_state[16 - order + i] : in_buf[8 - order + i]; + + for (int32_t i = 0; i < 8; i++) { + prediction[j * 8 + i] = inner_product(order + i, coef_tbl[optimalp][i], in_vec); + e[j * 8 + i] = in_vec[i + order] = in_buf[j * 8 + i] - prediction[j * 8 + i]; + } + } + + // Clamp the errors to 16-bit signed ints, and put them in ie. + clamp_to_s16(e, ie); + + // Find a value with highest absolute value. + // @bug If this first finds -2^n and later 2^n, it should set 'max' to the + // latter, which needs a higher value for 'scale'. + int32_t max = 0; + for (int32_t i = 0; i < 16; i++) { + if (abs(ie[i]) > abs(max)) + max = ie[i]; + } + + // Compute which power of two we need to scale down by in order to make + // all values representable as 4-bit signed integers (i.e. be in [-8, 7]). + // The worst-case 'max' is -2^15, so this will be at most 12. + for (scale = 0; scale <= scale_factor; scale++) { + if (max <= ulevel && max >= llevel) + break; + max /= 2; + } + + int32_t state[16]; + for (int32_t i = 0; i < 16; i++) + state[i] = orig_state[i]; + + // Try with the computed scale, but if it turns out we don't fit in 4 bits + // (if some |cV| >= 2), use scale + 1 instead (i.e. downscaling by another + // factor of 2). + bool again = true; + for (int32_t nIter = 0; nIter < 2 && again; nIter++) { + again = false; + + if (nIter == 1) + scale++; + + if (scale > scale_factor) + scale = scale_factor; + + for (int32_t j = 0; j < 2; j++) { + int32_t base = j * 8; + + // Copy over the last 'order' samples from the previous output. + for (int32_t i = 0; i < order; i++) + in_vec[i] = (j == 0) ? orig_state[16 - order + i] : state[8 - order + i]; + + // For 8 samples... + for (int32_t i = 0; i < 8; i++) { + // Compute a prediction based on 'order' values from the old state, + // plus previous *quantized* errors in this chunk (because that's + // all the decoder will have available). + prediction[base + i] = inner_product(order + i, coef_tbl[optimalp][i], in_vec); + + // Compute the error, and divide it by 2^scale, rounding to the + // nearest integer. This should ideally result in a 4-bit integer. + float se = (float)in_buf[base + i] - (float)prediction[base + i]; + ix[base + i] = qsample(se, 1 << scale); + + // Clamp the error to a 4-bit signed integer, and record what delta + // was needed for that. + int32_t cV = clamp_bits(ix[base + i], encBits) - ix[base + i]; + if (cV > 1 || cV < -1) + again = true; + ix[base + i] += cV; + + // Record the quantized error in in_vec for later predictions, + // and the quantized (decoded) output in state (for use in the next + // batch of 8 samples). + in_vec[i + order] = ix[base + i] * (1 << scale); + state[base + i] = prediction[base + i] + in_vec[i + order]; + } + } + } + + // Write 1-byte header + out[0] = ((scale & 0xF) << 4) | ((optimalp & 0xF) << 0); + + // Write 4/8-byte frame + if (frame_size == 5) { + for (int32_t i = 0; i < 16; i += 4) { + uint8_t c = ((ix[i + 0] & 0b11) << 6) | ((ix[i + 1] & 0b11) << 4) | ((ix[i + 2] & 0b11) << 2) | + ((ix[i + 3] & 0b11) << 0); + out[1 + i / 4] = c; + } + } else { + for (int32_t i = 0; i < 16; i += 2) { + uint8_t c = ((ix[i + 0] & 0xF) << 4) | ((ix[i + 1] & 0xF) << 0); + out[1 + i / 2] = c; + } + } +} + +static void +permute(int32_t *out, int32_t *in, int32_t *prescaled, int32_t scale, int frame_size) +{ + bool normal = myrand() % 3 == 0; + + for (int32_t i = 0; i < 16; i++) { + int32_t lo = in[i] - scale / 2; + int32_t hi = in[i] + scale / 2; + + if (frame_size == 9) { + if (prescaled[i] == -8 && myrand() % 10 == 0) + lo -= scale * 3 / 2; + else if (prescaled[i] == 7 && myrand() % 10 == 0) + hi += scale * 3 / 2; + } else if (prescaled[i] == -2 && myrand() % 7 == 0) { + lo -= scale * 3 / 2; + } else if (prescaled[i] == 1 && myrand() % 10 == 0) { + hi += scale * 3 / 2; + } else if (normal) { + // + } else if (prescaled[i] == 0) { + if (myrand() % 3) { + lo = in[i] - scale / 5; + hi = in[i] + scale / 5; + } else if (myrand() % 2) { + lo = in[i] - scale / 3; + hi = in[i] + scale / 3; + } + } else if (myrand() % 3) { + if (prescaled[i] < 0) + lo = in[i] + scale / 4; + if (prescaled[i] > 0) + hi = in[i] - scale / 4; + } else if (myrand() % 2) { + if (prescaled[i] < 0) + lo = in[i] - scale / 4; + if (prescaled[i] > 0) + hi = in[i] + scale / 4; + } + + out[i] = clamp_bits(lo + myrand() % (hi - lo + 1), 16); + } +} + +/** + * Like vencodeframe/my_encodeframe but assigns a score to the output for informing brute-force decoding + */ +static int64_t +scored_encode(int32_t *in_buf, int32_t *orig_state, int32_t ***coef_tbl, int32_t order, int32_t npredictors, + int32_t wanted_predictor, int32_t wanted_scale, int32_t wanted_ix[16], int frame_size) +{ + int32_t prediction[16]; + int32_t in_vec[16]; + int32_t optimalp = 0; + int32_t scale; + int32_t enc_bits = (frame_size == 5) ? 2 : 4; + int32_t llevel = -(1 << (enc_bits - 1)); + int32_t ulevel = -llevel - 1; + int32_t ie[16]; + float e[16]; + float errs[4]; + + // Determine the best-fitting predictor. + float min = 1e30; + int32_t scale_factor = 16 - enc_bits; + + int64_t scoreA = 0, scoreB = 0, scoreC = 0; + + for (int32_t k = 0; k < npredictors; k++) { + for (int32_t j = 0; j < 2; j++) { + // Copy over the last 'order' samples from the previous output. + for (int32_t i = 0; i < order; i++) + in_vec[i] = (j == 0) ? orig_state[16 - order + i] : in_buf[8 - order + i]; + + // For 8 samples... + for (int32_t i = 0; i < 8; i++) { + // Compute a prediction based on 'order' values from the old state, + // plus previous errors in this chunk, as an inner product with the + // coefficient table. + prediction[j * 8 + i] = inner_product(order + i, coef_tbl[k][i], in_vec); + // Record the error in in_vec (thus, its first 'order' samples + // will contain actual values, the rest will be error terms), and + // in floating point form in e (for no particularly good reason). + in_vec[i + order] = in_buf[j * 8 + i] - prediction[j * 8 + i]; + e[j * 8 + i] = (float)in_vec[i + order]; + } + } + + // Compute the L2 norm of the errors; the lowest norm decides which + // predictor to use. + float se = 0.0f; + for (int32_t j = 0; j < 16; j++) + se += e[j] * e[j]; + + errs[k] = se; + + if (se < min) { + min = se; + optimalp = k; + } + } + + for (int32_t k = 0; k < npredictors; k++) { + if (errs[k] < errs[wanted_predictor]) + scoreA += (int64_t)(errs[wanted_predictor] - errs[k]); + } + + if (optimalp != wanted_predictor) { + // probably penalized above, but add extra penalty in case the error + // values were the exact same + scoreA++; + } + optimalp = wanted_predictor; + + int32_t **coefPage = coef_tbl[optimalp]; + + // Do exactly the same thing again, for real. + for (int32_t j = 0; j < 2; j++) { + for (int32_t i = 0; i < order; i++) + in_vec[i] = (j == 0 ? orig_state[16 - order + i] : in_buf[8 - order + i]); + + for (int32_t i = 0; i < 8; i++) { + prediction[j * 8 + i] = inner_product(order + i, coefPage[i], in_vec); + e[j * 8 + i] = in_vec[i + order] = in_buf[j * 8 + i] - prediction[j * 8 + i]; + } + } + + // Clamp the errors to 16-bit signed ints, and put them in ie. + clamp_to_s16(e, ie); + + // Find a value with highest absolute value. + // @bug If this first finds -2^n and later 2^n, it should set 'max' to the + // latter, which needs a higher value for 'scale'. + int32_t max = 0; + for (int32_t i = 0; i < 16; i++) { + if (abs(ie[i]) > abs(max)) + max = ie[i]; + } + + // Compute which power of two we need to scale down by in order to make + // all values representable as 4-bit signed integers (i.e. be in [-8, 7]). + // The worst-case 'max' is -2^15, so this will be at most 12. + for (scale = 0; scale <= scale_factor; scale++) { + if (max <= ulevel && max >= llevel) + break; + max /= 2; + } + + // Preliminary ix computation, computes whether scale needs to be incremented + int32_t state[16]; + + // Try with the computed scale, but if it turns out we don't fit in 4 bits + // (if some |cV| >= 2), use scale + 1 instead (i.e. downscaling by another + // factor of 2). + bool again = false; + for (int32_t j = 0; j < 2; j++) { + int32_t base = j * 8; + + // Copy over the last 'order' samples from the previous output. + for (int32_t i = 0; i < order; i++) + in_vec[i] = (j == 0) ? orig_state[16 - order + i] : state[8 - order + i]; + + // For 8 samples... + for (int32_t i = 0; i < 8; i++) { + // Compute a prediction based on 'order' values from the old state, + // plus previous *quantized* errors in this chunk (because that's + // all the decoder will have available). + prediction[base + i] = inner_product(order + i, coefPage[i], in_vec); + + // Compute the error, and divide it by 2^scale, rounding to the + // nearest integer. This should ideally result in a 4-bit integer. + float se = (float)in_buf[base + i] - (float)prediction[base + i]; + int32_t ix = qsample(se, 1 << scale); + int32_t clampedIx = clamp_bits(ix, enc_bits); + + // Clamp the error to a 4-bit signed integer, and record what delta + // was needed for that. + int32_t cV = clampedIx - ix; + if (cV > 1 || cV < -1) + again = true; + + // Record the quantized error in in_vec for later predictions, + // and the quantized (decoded) output in state (for use in the next + // batch of 8 samples). + in_vec[i + order] = clampedIx * (1 << scale); + state[base + i] = prediction[base + i] + in_vec[i + order]; + } + } + + if (again && scale < scale_factor) + scale++; + + if (scale != wanted_scale) { + // We could do math to penalize scale mismatches accurately, but it's + // simpler to leave it as a constraint by setting an infinite penalty. + scoreB += 100000000; + scale = wanted_scale; + } + + // Then again for real, but now also with penalty computation + for (int32_t j = 0; j < 2; j++) { + int32_t base = j * 8; + + // Copy over the last 'order' decoded samples from the above chunk. + for (int32_t i = 0; i < order; i++) + in_vec[i] = (j == 0) ? orig_state[16 - order + i] : state[8 - order + i]; + + // ... and do the same thing as before. + for (int32_t i = 0; i < 8; i++) { + prediction[base + i] = inner_product(order + i, coefPage[i], in_vec); + + int64_t ise = (int64_t)in_buf[base + i] - (int64_t)prediction[base + i]; + float se = (float)in_buf[base + i] - (float)prediction[base + i]; + int32_t ix = qsample(se, 1 << scale); + int32_t clampedIx = clamp_bits(ix, enc_bits); + int32_t val = wanted_ix[base + i] * (1 << scale); + + if (clampedIx != wanted_ix[base + i]) { + assert(ix != wanted_ix[base + i]); + + int32_t lo = val - (1 << scale) / 2; + int32_t hi = val + (1 << scale) / 2; + + int64_t diff = 0; + if (ise < lo) + diff = lo - ise; + else if (ise > hi) + diff = ise - hi; + + scoreC += diff * diff + 1; + } + in_vec[i + order] = val; + state[base + i] = prediction[base + i] + val; + } + } + + // Penalties for going outside int16_t + for (int32_t i = 0; i < 16; i++) { + int64_t diff = 0; + + if (in_buf[i] < -0x8000) + diff = -0x8000 - in_buf[i]; + if (in_buf[i] > 0x7fff) + diff = in_buf[i] - 0x7fff; + + scoreC += diff * diff; + } + + return scoreA + scoreB + 10 * scoreC; +} + +static bool +descent(int32_t guess[16], int32_t min_vals[16], int32_t max_vals[16], int32_t prev_state[16], int32_t ***coef_tbl, + int32_t order, int32_t npredictors, int32_t wanted_predictor, int32_t wanted_scale, int32_t wanted_ix[16], + int frame_size) +{ + const double inf = 1e100; + + int64_t curScore = scored_encode(guess, prev_state, coef_tbl, order, npredictors, wanted_predictor, wanted_scale, + wanted_ix, frame_size); + + while (true) { + double delta[16]; + + if (curScore == 0) + return true; + + // Compute gradient, and how far to move along it at most. + double maxMove = inf; + for (int32_t i = 0; i < 16; i++) { + guess[i]++; + int64_t scoreUp = scored_encode(guess, prev_state, coef_tbl, order, npredictors, wanted_predictor, + wanted_scale, wanted_ix, frame_size); + guess[i] -= 2; + int64_t scoreDown = scored_encode(guess, prev_state, coef_tbl, order, npredictors, wanted_predictor, + wanted_scale, wanted_ix, frame_size); + guess[i]++; + + if (scoreUp >= curScore && scoreDown >= curScore) { + // Don't touch this coordinate + delta[i] = 0; + continue; + } + + int32_t val = (scoreDown < scoreUp) ? min_vals[i] : max_vals[i]; + double ds = (scoreDown < scoreUp) ? (scoreDown - curScore) : (curScore - scoreUp); + + if (guess[i] == val) { + delta[i] = 0; + } else { + delta[i] = ds; + maxMove = fmin(maxMove, (val - guess[i]) / delta[i]); + } + } + if (maxMove == inf || maxMove <= 0) { + return false; + } + + // Try exponentially spaced candidates along the gradient. + int32_t nguess[16]; + int32_t bestGuess[16]; + int64_t bestScore = curScore; + while (true) { + bool changed = false; + + for (int32_t i = 0; i < 16; i++) { + nguess[i] = (int32_t)round(guess[i] + delta[i] * maxMove); + + if (nguess[i] != guess[i]) + changed = true; + } + + if (!changed) + break; + + int64_t score = scored_encode(nguess, prev_state, coef_tbl, order, npredictors, wanted_predictor, + wanted_scale, wanted_ix, frame_size); + if (score < bestScore) { + bestScore = score; + memcpy(bestGuess, nguess, sizeof(nguess)); + } + maxMove *= 0.7; + } + + if (bestScore == curScore) + return false; // No improvements along that line, give up. + + curScore = bestScore; + memcpy(guess, bestGuess, sizeof(bestGuess)); + } +} + +static void +get_bounds(int32_t *in, int32_t *prescaled, int32_t scale, int32_t *min_vals, int32_t *max_vals, int frame_size) +{ + int32_t minv, maxv; + + if (frame_size == 9) { + minv = -8; + maxv = 8 - 1; + } else { + minv = -2; + maxv = 2 - 1; + } + + for (int32_t i = 0; i < 16; i++) { + int32_t lo = in[i] - scale / 2 - scale; + int32_t hi = in[i] + scale / 2 + scale; + + if (prescaled[i] == minv) + lo -= scale; + else if (prescaled[i] == maxv) + hi += scale; + + min_vals[i] = lo; + max_vals[i] = hi; + } +} + +#define VADPCM_BRUTEFORCE_LIMIT 100000 + +static int32_t +bruteforce(int32_t guess[16], uint8_t input[9], int32_t decoded[16], int32_t prescaled[16], int32_t prev_state[16], + int32_t ***coef_tbl, int32_t order, int32_t npredictors, int frame_size) +{ + int32_t scale = (input[0] >> 4) & 0xF; + int32_t predictor = (input[0] >> 0) & 0xF; + + int32_t min_vals[16]; + int32_t max_vals[16]; + get_bounds(decoded, prescaled, 1 << scale, min_vals, max_vals, frame_size); + + int i = 0; + while (true) { + int64_t bestScore = -1; + int32_t bestGuess[16]; + + for (int tries = 0; tries < 100; tries++) { + permute(guess, decoded, prescaled, 1 << scale, frame_size); + + int64_t score = + scored_encode(guess, prev_state, coef_tbl, order, npredictors, predictor, scale, prescaled, frame_size); + if (score == 0) + return true; + + if (bestScore == -1 || score < bestScore) { + bestScore = score; + memcpy(bestGuess, guess, sizeof(bestGuess)); + } + } + + memcpy(guess, bestGuess, sizeof(bestGuess)); + + if (descent(guess, min_vals, max_vals, prev_state, coef_tbl, order, npredictors, predictor, scale, prescaled, + frame_size)) + return true; + + i++; + if (i == VADPCM_BRUTEFORCE_LIMIT) + error("Bruteforce decoding failed"); + } +} + +/** + * vadpcm encoder used when encoding data + */ +static void +vencodeframe(uint8_t *out_buf, int16_t *in_buf, int32_t *state, int32_t ***coef_tbl, int32_t order, int32_t npredictors, + int frame_size) +{ + int32_t in_vec[16]; + int32_t prediction[16]; + int32_t optimalp; + float e[16]; + float se; + float min = 1e30; + int32_t i; + int32_t j; + int32_t k; + + // Determine the best-fitting predictor. + + optimalp = 0; + for (k = 0; k < npredictors; k++) { + // Copy over the last 'order' samples from the previous output. + for (i = 0; i < order; i++) + in_vec[i] = state[16 - order + i]; + + // For 8 samples... + for (i = 0; i < 8; i++) { + // Compute a prediction based on 'order' values from the old state, + // plus previous *quantized* errors in this chunk (because that's + // all the decoder will have available). + prediction[i] = inner_product(order + i, coef_tbl[k][i], in_vec); + + // Record the error in in_vec (thus, its first 'order' samples + // will contain actual values, the rest will be error terms), and + // in floating point form in e (for no particularly good reason). + in_vec[i + order] = in_buf[i] - prediction[i]; + e[i] = (float)in_vec[i + order]; + } + + // For the next 8 samples, start with 'order' values from the end of + // the previous 8-sample chunk of in_buf. (The code is equivalent to + // in_vec[i] = in_buf[8 - order + i].) + for (i = 0; i < order; i++) + in_vec[i] = prediction[8 - order + i] + in_vec[8 + i]; + + // ... and do the same thing as before to get predictions. + for (i = 0; i < 8; i++) { + prediction[8 + i] = inner_product(order + i, coef_tbl[k][i], in_vec); + in_vec[i + order] = in_buf[8 + i] - prediction[8 + i]; + e[8 + i] = (float)in_vec[i + order]; + } + + // Compute the L2 norm of the errors; the lowest norm decides which predictor to use. + se = 0.0f; + for (j = 0; j < 16; j++) + se += e[j] * e[j]; + + if (se < min) { + min = se; + optimalp = k; + } + } + + // Do exactly the same thing again, for real. + + for (i = 0; i < order; i++) + in_vec[i] = state[16 - order + i]; + + for (i = 0; i < 8; i++) { + prediction[i] = inner_product(order + i, coef_tbl[optimalp][i], in_vec); + in_vec[i + order] = in_buf[i] - prediction[i]; + e[i] = (float)in_vec[i + order]; + } + + for (i = 0; i < order; i++) + in_vec[i] = prediction[8 - order + i] + in_vec[8 + i]; + + for (i = 0; i < 8; i++) { + prediction[8 + i] = inner_product(order + i, coef_tbl[optimalp][i], in_vec); + in_vec[i + order] = in_buf[8 + i] - prediction[8 + i]; + e[8 + i] = (float)in_vec[i + order]; + } + + int32_t ie[16]; + int32_t max = 0; + + // Clamp the errors to 16-bit signed ints, and put them in ie. + clamp(16, e, ie, 16); + + // Find a value with highest absolute value. + // Reproduce original tool bug: + // If this first finds -2^n and later 2^n, it should set 'max' to the + // latter, which needs a higher value for 'scale'. + for (i = 0; i < 16; i++) { + if (abs(ie[i]) > abs(max)) + max = ie[i]; + } + + // Compute which power of two we need to scale down by in order to make + // all values representable as 4-bit (resp. 2-bit) signed integers + // (i.e. be in [-8, 7] (resp. [-2, 1])). + // The worst-case 'max' is -2^15, so this will be at most 12 (resp. 14). + // Depends on whether we are encoding for long or short VADPCM. + + int32_t enc_bits = (frame_size == 5) ? 2 : 4; + int32_t scale_factor = 16 - enc_bits; + int32_t llevel = -(1 << (enc_bits - 1)); + int32_t ulevel = -llevel - 1; + int32_t scale; + + for (scale = 0; scale <= scale_factor; scale++) { + if (max <= ulevel && max >= llevel) + break; + max /= 2; + } + + int32_t saveState[16]; + memcpy(saveState, state, sizeof(saveState)); + + int16_t ix[16]; + int32_t nIter; + int32_t cV; + int32_t maxClip; + + // Try with the computed scale, but if it turns out we don't fit in 4 bits + // (if some |cV| >= 2), use scale + 1 instead (i.e. downscaling by another + // factor of 2). + scale--; + nIter = 0; + do { + nIter++; + maxClip = 0; + scale++; + + if (scale > scale_factor) + scale = scale_factor; + + // Copy over the last 'order' samples from the previous output. + for (i = 0; i < order; i++) + in_vec[i] = saveState[16 - order + i]; + + // For 8 samples... + for (i = 0; i < 8; i++) { + // Compute a prediction based on 'order' values from the old state, + // plus previous *quantized* errors in this chunk (because that's + // all the decoder will have available). + prediction[i] = inner_product(order + i, coef_tbl[optimalp][i], in_vec); + + // Compute the error, and divide it by 2^scale, rounding to the + // nearest integer. This should ideally result in a 4-bit integer. + se = (float)in_buf[i] - (float)prediction[i]; + ix[i] = qsample(se, 1 << scale); + + // Clamp the error to a 4-bit signed integer, and record what delta + // was needed for that. + cV = clamp_bits(ix[i], enc_bits) - ix[i]; + if (maxClip < abs(cV)) + maxClip = abs(cV); + ix[i] += cV; + + // Record the quantized error in in_vec for later predictions, + // and the quantized (decoded) output in state (for use in the next + // batch of 8 samples). + in_vec[i + order] = ix[i] * (1 << scale); + state[i] = prediction[i] + in_vec[i + order]; + } + + // Copy over the last 'order' decoded samples from the above chunk. + for (i = 0; i < order; i++) + in_vec[i] = state[8 - order + i]; + + // ... and do the same thing as before. + for (i = 0; i < 8; i++) { + prediction[8 + i] = inner_product(order + i, coef_tbl[optimalp][i], in_vec); + + se = (float)in_buf[8 + i] - (float)prediction[8 + i]; + ix[8 + i] = qsample(se, 1 << scale); + + cV = clamp_bits(ix[8 + i], enc_bits) - ix[8 + i]; + if (maxClip < abs(cV)) + maxClip = abs(cV); + + ix[8 + i] += cV; + in_vec[i + order] = ix[8 + i] * (1 << scale); + state[8 + i] = prediction[8 + i] + in_vec[i + order]; + } + } while (maxClip >= 2 && nIter < 2); + + // The scale, the predictor index, and the 16 computed outputs are now all + // 4-bit numbers. Write them out as either 1 + 8 bytes or 1 + 4 bytes depending + // on whether we are encoding for long or short VADPCM. + + *(out_buf++) = ((scale & 0b1111) << 4) | ((optimalp & 0b1111) << 0); + + switch (frame_size) { + case 5: + for (i = 0; i < 16; i += 4) + *(out_buf++) = ((ix[i + 0] & 0b11) << 6) | ((ix[i + 1] & 0b11) << 4) | ((ix[i + 2] & 0b11) << 2) | + ((ix[i + 3] & 0b11) << 0); + break; + case 9: + for (i = 0; i < 16; i += 2) + *(out_buf++) = ((ix[i + 0] & 0b1111) << 4) | ((ix[i + 1] & 0b1111) << 0); + break; + } +} + +int +vadpcm_enc(container_data *ctnr, const codec_spec *codec, const enc_dec_opts *opts) +{ + if (ctnr->num_channels != 1) + error("Only mono input can be converted to vadpcm, was %u-channel", ctnr->num_channels); + if (ctnr->bit_depth != 16) + error("Only 16-bit samples can be converted to vadpcm, was %u-bit", ctnr->bit_depth); + + int frame_size = codec->frame_size; + + int32_t state[16]; + memset(state, 0, sizeof(state)); + + unsigned int nloops = ctnr->num_loops; + if (nloops > 1) + error("Only 1 loop supported"); + + unsigned i; + unsigned j; + + // synthesize ADPCM loop structures, state will be filled later + ALADPCMloop *aloops = NULL; + if (nloops != 0) { + container_loop *loops = ctnr->loops; + aloops = MALLOC_CHECKED_INFO(nloops * sizeof(ALADPCMloop), "nloops=%u", nloops); + + for (i = 0; i < nloops; i++) { + aloops[i].start = loops[i].start; + aloops[i].end = loops[i].end; + aloops[i].count = loops[i].num; + } + ctnr->vadpcm.loop_version = 1; + ctnr->vadpcm.loops = aloops; + ctnr->vadpcm.num_loops = nloops; + } + + ctnr->vadpcm.book_version = 1; + if (!ctnr->vadpcm.has_book) { + // If there is no prediction codebook embedded in the input file, design one for the data + tabledesign_run(&ctnr->vadpcm.book_header.order, &ctnr->vadpcm.book_header.npredictors, &ctnr->vadpcm.book_data, + ctnr->data, ctnr->num_samples, &opts->design); + ctnr->vadpcm.has_book = true; + } + + uint32_t currentPos = 0; + int nRepeats; + uint32_t nBytes = 0; + + int order = ctnr->vadpcm.book_header.order; + int npredictors = ctnr->vadpcm.book_header.npredictors; + + int32_t ***coef_tbl; + expand_codebook(ctnr->vadpcm.book_data, &coef_tbl, ctnr->vadpcm.book_header.order, + ctnr->vadpcm.book_header.npredictors); + + int16_t in_buf[16]; + + uint16_t *indata = ctnr->data; + uint8_t *outdata = MALLOC_CHECKED_INFO(ctnr->data_size, "data_size=%lu", ctnr->data_size); + + unsigned nFrames = ctnr->num_samples; + /* printf("Num samples: %u\n", nFrames); */ + + for (i = 0; i < nloops; i++) { + // printf("Process loop: start=%u end=%u count=%u\n", aloops[i].start, aloops[i].end, aloops[i].count); + + // Duplicate the loop until it's longer than the minimum loop length + nRepeats = 0; + uint32_t newEnd = aloops[i].end; + while (newEnd - aloops[i].start < opts->min_loop_length) { + newEnd += aloops[i].end - aloops[i].start; + nRepeats++; + } + + // Encode [current, loop_start) + while (currentPos <= aloops[i].start) { + // printf(" pre-loop %u / %u\n", currentPos, aloops[i].start); + + memcpy(in_buf, &indata[currentPos], sizeof(in_buf)); + currentPos += 16; + + vencodeframe(&outdata[nBytes], in_buf, state, coef_tbl, order, npredictors, frame_size); + nBytes += frame_size; + } + + // Emplace loop state + // printf(" wr loop state\n"); + for (j = 0; j < 16; j++) { + if (state[j] > 0x7FFF) + state[j] = 0x7FFF; + if (state[j] < -0x7FFF) + state[j] = -0x7FFF; + aloops[i].state[j] = state[j]; + } + + aloops[i].count = -1; + + // Encode the loop for n repeats + while (nRepeats > 0) { + // printf(" repeat #%u\n", nRepeats); + // Encode [loop_start, loop_end] + while (currentPos + 16 < aloops[i].end) { + // printf(" loop-repeat %u / %u\n", currentPos, aloops[i].end); + + memcpy(in_buf, &indata[currentPos], sizeof(in_buf)); + currentPos += 16; + + vencodeframe(&outdata[nBytes], in_buf, state, coef_tbl, order, npredictors, frame_size); + nBytes += frame_size; + } + + // Handling for when loop_end is halfway through a frame + + uint32_t left = aloops[i].end - currentPos; + // printf(" rem=%u\n", left); + + memcpy(in_buf, &indata[currentPos], left * sizeof(int16_t)); + + currentPos = aloops[i].start * 2; + + memcpy(in_buf + left, &indata[currentPos], (16 - left) * sizeof(int16_t)); + + vencodeframe(&outdata[nBytes], in_buf, state, coef_tbl, order, npredictors, frame_size); + nBytes += frame_size; + + // Return to loop start + + currentPos = aloops[i].start - left + 16; + nRepeats--; + } + aloops[i].end = newEnd; + } + + // Get frame count, truncate to loop end if desired + if (nloops > 0 && opts->truncate) + nFrames = MIN(aloops[nloops - 1].end + 16, nFrames); + + // Encode remaining data + + while (currentPos < nFrames) { + uint32_t nsam = MIN(nFrames - currentPos, 16); + // printf(" post-loop: %u / %u (%u)\n", currentPos, nFrames, nsam); + + memcpy(in_buf, &indata[currentPos], sizeof(int16_t) * nsam); + currentPos += nsam; + + memset(in_buf, 0, (16 - nsam) * sizeof(int16_t)); + + vencodeframe(&outdata[nBytes], in_buf, state, coef_tbl, order, npredictors, frame_size); + nBytes += frame_size; + } + + // Pad to even number + if (nBytes % 2 != 0) + outdata[nBytes++] = 0; + + assert(nBytes <= ctnr->data_size); + + // Write out + + ctnr->num_loops = 0; + if (ctnr->loops != NULL) + free(ctnr->loops); + ctnr->loops = NULL; + + free(ctnr->data); + + ctnr->data = outdata; + ctnr->data_size = nBytes; + ctnr->data_type = (frame_size == 5) ? SAMPLE_TYPE_VADPCM_HALF : SAMPLE_TYPE_VADPCM; + + destroy_expanded_codebook(coef_tbl, npredictors); + + return 0; +} + +int +vadpcm_dec(container_data *ctnr, UNUSED const codec_spec *codec, const enc_dec_opts *opts) +{ + if (ctnr->num_channels != 1) + error("vadpcm can only be mono, was %u-channel", ctnr->num_channels); + if (ctnr->bit_depth != 16) + error("vadpcm can only be converted to 16-bit samples, was %u-bit", ctnr->bit_depth); + + if (!ctnr->vadpcm.has_book) + error("Codebook missing from bitstream"); + + int16_t order = ctnr->vadpcm.book_header.order; + int16_t npredictors = ctnr->vadpcm.book_header.npredictors; + int16_t nloops = ctnr->vadpcm.num_loops; + + if (nloops > 1) + error("AIFC should only have at most 1 loop"); + + ALADPCMloop *aloops = ctnr->vadpcm.loops; + + int32_t ***coef_tbl = NULL; + expand_codebook(ctnr->vadpcm.book_data, &coef_tbl, order, npredictors); + + int32_t state[16]; + int32_t prescaled[16]; + int32_t in_pos = 0; + int32_t cur_pos = 0; + uint32_t nSamples = (ctnr->num_samples + 15) & ~15; + + int frame_size = (ctnr->data_type == SAMPLE_TYPE_VADPCM_HALF) ? 5 : 9; + + uint8_t *input_buf = ctnr->data; + + for (int32_t i = 0; i < order; i++) + state[15 - i] = 0; + + // Align to (decoded) frame size, the original undecompressed sample may have had only a fraction of a frame at the + // end but we always decompress to entire frames. + size_t output_size = nSamples * sizeof(int16_t); + uint8_t *output_buf = MALLOC_CHECKED_INFO(output_size, "output_size=%lu", output_size); + + int fails = 0; + + for (size_t frame_number = 0; frame_number * 16 < nSamples; frame_number++) { + uint8_t input[9]; + uint8_t encoded[9]; + int32_t prev_state[16]; + int32_t decoded[16]; + int16_t guess[16]; + int16_t origGuess[16]; + + memcpy(prev_state, state, sizeof(state)); + + memcpy(input, &input_buf[in_pos], frame_size); + in_pos += frame_size; + + // Initial decode using the standard decoder + vdecodeframe(input, prescaled, state, order, coef_tbl, frame_size); + + // Create a guess from that, by clamping to 16 bits + for (int32_t i = 0; i < 16; i++) + guess[i] = clamp_bits(state[i], 16); + + // If we aren't going for matching, the initial decode is sufficient and we skip re-encoding and bruteforcing + if (opts->matching) { + memcpy(decoded, state, sizeof(state)); + memcpy(origGuess, guess, sizeof(guess)); + + // Encode the guess + my_encodeframe(encoded, guess, prev_state, coef_tbl, order, npredictors, frame_size); + + if (memcmp(input, encoded, frame_size) != 0) { + // If it doesn't match, bruteforce the matching. + + int32_t guess32[16]; + if (bruteforce(guess32, input, decoded, prescaled, prev_state, coef_tbl, order, npredictors, + frame_size)) { + for (int i = 0; i < 16; i++) { + assert(-0x8000 <= guess32[i] && guess32[i] <= 0x7fff); + guess[i] = guess32[i]; + } + + my_encodeframe(encoded, guess, prev_state, coef_tbl, order, npredictors, frame_size); + assert(memcmp(input, encoded, frame_size) == 0); + } else { + fails++; + error("FAIL [%d/%d]", cur_pos, nSamples); + } + + // Bring the match closer to the original decode (not strictly + // necessary, but it will move us closer to the target on average). + for (int32_t failures = 0; failures < 50; failures++) { + int32_t ind = myrand() % 16; + int32_t old = guess[ind]; + + if (old == origGuess[ind]) + continue; + + guess[ind] = origGuess[ind]; + + if (myrand() % 2) + guess[ind] += (old - origGuess[ind]) / 2; + + my_encodeframe(encoded, guess, prev_state, coef_tbl, order, npredictors, frame_size); + + if (memcmp(input, encoded, frame_size) == 0) + failures = -1; + else + guess[ind] = old; + } + } + } + + memcpy(output_buf + cur_pos * 2, guess, sizeof(guess)); + cur_pos += 16; + } + + if (fails != 0) + error("Decoding failures: %d", fails); + + // Convert VADPCM loop to regular loop, if it exists + + if (nloops != 0) { + container_loop *loop = MALLOC_CHECKED(sizeof(container_loop)); + *loop = (container_loop){ + .id = 0, + .type = LOOP_FORWARD, + .start = aloops[0].start, + .end = aloops[0].end, + .fraction = 0, + .num = aloops[0].count, + }; + ctnr->num_loops = 1; + ctnr->loops = loop; + + ctnr->vadpcm.num_loops = 0; + free(ctnr->vadpcm.loops); + ctnr->vadpcm.loops = NULL; + } + + // Assign new data + + free(ctnr->data); + ctnr->data = output_buf; + ctnr->data_size = output_size; + ctnr->data_type = SAMPLE_TYPE_PCM16; + ctnr->num_samples = nSamples; + + destroy_expanded_codebook(coef_tbl, npredictors); + return 0; +} diff --git a/tools/audio/sampleconv/src/codec/vadpcm.h b/tools/audio/sampleconv/src/codec/vadpcm.h new file mode 100644 index 0000000000..f6a080bf84 --- /dev/null +++ b/tools/audio/sampleconv/src/codec/vadpcm.h @@ -0,0 +1,50 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: CC0-1.0 + */ +#ifndef CODEC_VADPCM_H +#define CODEC_VADPCM_H + +#include +#include + +#define VADPCM_BOOK_SIZE(order, npredictors) (8 * (order) * (npredictors)) +#define VADPCM_BOOK_SIZE_BYTES(order, npredictors) (sizeof(int16_t) * VADPCM_BOOK_SIZE(order, npredictors)) + +typedef struct { + int16_t order; + int16_t npredictors; +} ALADPCMbookhead; + +typedef int16_t ALADPCMbookstate[]; + +typedef struct { + uint32_t start; + uint32_t end; + uint32_t count; + int16_t state[16]; +} ALADPCMloop; + +typedef struct { + unsigned int order; + unsigned int bits; + unsigned int refine_iters; + double thresh; + unsigned int frame_size; +} table_design_spec; + +int +tabledesign_run(int16_t *order_out, int16_t *npredictors_out, int16_t **book_data_out, void *sample_data, + size_t num_samples, const table_design_spec *design); + +struct container_data; +struct codec_spec; +struct enc_dec_opts; + +int +vadpcm_enc(struct container_data *ctnr, const struct codec_spec *codec, const struct enc_dec_opts *opts); + +int +vadpcm_dec(struct container_data *ctnr, const struct codec_spec *codec, const struct enc_dec_opts *opts); + +#endif diff --git a/tools/audio/sampleconv/src/codec/vadpcm_tabledesign.c b/tools/audio/sampleconv/src/codec/vadpcm_tabledesign.c new file mode 100644 index 0000000000..90bad83499 --- /dev/null +++ b/tools/audio/sampleconv/src/codec/vadpcm_tabledesign.c @@ -0,0 +1,655 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: CC0-1.0 + */ +#include +#include +#include +#include + +#include "../util.h" +#include "vadpcm.h" + +// Levinson-Durbin algorithm for iteratively solving for prediction coefficients +// https://en.wikipedia.org/wiki/Levinson_recursion +static int +durbin(double *acvec, int order, double *reflection_coeffs, double *prediction_coeffs, double *error) +{ + int i, j; + double sum, E; + int ret; + + prediction_coeffs[0] = 1.0; + E = acvec[0]; // E[0] = r{xx}[0] + ret = 0; + + for (i = 1; i <= order; i++) { + // SUM(j, a[i-1][j] * r{xx}[i - j] ) + sum = 0.0; + for (j = 1; j <= i - 1; j++) { + sum += prediction_coeffs[j] * acvec[i - j]; + } + + // a[i][i] = -Delta[i-1] / E[i-1] + prediction_coeffs[i] = (E > 0.0) ? (-(acvec[i] + sum) / E) : 0.0; + // k[i] = a[i][i] + reflection_coeffs[i] = prediction_coeffs[i]; + + if (fabs(reflection_coeffs[i]) > 1.0) { + // incr when a predictor coefficient is > 1 (indicates numerical instability) + ret++; + } + + for (j = 1; j < i; j++) { + // a[i][j] = a[i-1][j] + a[i-1][i - j] * a[i][i] + prediction_coeffs[j] += prediction_coeffs[i - j] * prediction_coeffs[i]; + } + + // E[i] = E[i-1] * (1.0 - k[i] ** 2) + // = E[i-1] * (1.0 - a[i][i] ** 2) + E *= 1.0 - prediction_coeffs[i] * prediction_coeffs[i]; + } + *error = E; + return ret; +} + +// Reflection coefficients (k) -> Predictor coefficients (a) +// A subset of Levinson-Durbin that only computes predictors from known reflection coefficients and previous predictors +static void +afromk(double *k, double *ai, int order) +{ + int i, j; + + ai[0] = 1.0; + + for (i = 1; i <= order; i++) { + // a[i][i] = k[i] + ai[i] = k[i]; + + for (j = 1; j <= i - 1; j++) { + // a[i][j] = a[i-1][j] + a[i-1][i - j] * k[i] = a[i-1][j] + a[i-1][i - j] * a[i][i] + ai[j] += ai[i - j] * ai[i]; + } + } +} + +// Prediction coefficients (a) -> Reflection coefficients (k) +// Performs afromk in reverse? +// Returns 0 if numerically stable, otherwise returns non-zero +static int +kfroma(double *in, double *out, int order) +{ + int i, j; + double div; + double temp; + double next[(order + 1)]; + int ret = 0; + + out[order] = in[order]; + + for (i = order - 1; i >= 1; i--) { + for (j = 0; j <= i; j++) { + temp = out[i + 1]; + div = 1.0 - temp * temp; + + if (div == 0.0) { + return 1; + } + + next[j] = (in[j] - in[i - j + 1] * temp) / div; + } + + for (j = 0; j <= i; j++) { + in[j] = next[j]; + } + + out[i] = next[i]; + if (fabs(out[i]) > 1.0) { + // Not numerically stable + ret++; + } + } + + return ret; +} + +// autocorrelation (r{xx}) from predictors (a) ? +static void +rfroma(double *in, int n, double *out) +{ + int i, j; + double mat[n + 1][n + 1]; + double div; + + mat[n][0] = 1.0; + for (i = 1; i <= n; i++) { + mat[n][i] = -in[i]; + } + + for (i = n; i >= 1; i--) { + div = 1.0 - mat[i][i] * mat[i][i]; + + for (j = 1; j <= i - 1; j++) { + mat[i - 1][j] = (mat[i][i - j] * mat[i][i] + mat[i][j]) / div; + } + } + + out[0] = 1.0; + for (i = 1; i <= n; i++) { + out[i] = 0.0; + for (j = 1; j <= i; j++) { + out[i] += mat[i][j] * out[i - j]; + } + } +} + +static double +model_dist(double *predictors, double *data, int order) +{ + double autocorrelation_data[order + 1]; + double autocorrelation_predictors[order + 1]; + double ret; + int i, j; + + // autocorrelation from data + rfroma(data, order, autocorrelation_data); + + // autocorrelation from predictors + for (i = 0; i <= order; i++) { + autocorrelation_predictors[i] = 0.0; + for (j = 0; j <= order - i; j++) { + autocorrelation_predictors[i] += predictors[j] * predictors[i + j]; + } + } + + // compute "model distance" (scaled L2 norm: 2 * inner(ac1, ac2) ) + ret = autocorrelation_data[0] * autocorrelation_predictors[0]; + for (i = 1; i <= order; i++) { + ret += 2 * autocorrelation_data[i] * autocorrelation_predictors[i]; + } + + return ret; +} + +// Calculate the autocorrelation matrix of two vectors at x and x - xlen +// https://en.wikipedia.org/wiki/Autocorrelation +static void +acmat(int16_t *x, int order, int xlen, double **ac) +{ + int i, j, k; + + for (i = 1; i <= order; i++) { + for (j = 1; j <= order; j++) { + // R{xx}[i,j] = E[X[i] * X[j]] + + ac[i][j] = 0.0; + for (k = 0; k < xlen; k++) { + ac[i][j] += x[k - i] * x[k - j]; + } + } + } +} + +// Computes the autocorrelation vector of two vectors at x and x - xlen +static void +acvect(int16_t *x, int order, int xlen, double *ac) +{ + int i, j; + + for (i = 0; i <= order; i++) { + ac[i] = 0.0; + // r{xx} = E(x(m)x) = SUM(j, x[j - i] * x[j]) + for (j = 0; j < xlen; j++) { + ac[i] -= x[j - i] * x[j]; + } + } +} + +/** + * Lower-Upper (with Permutation vector) (LUP) Decomposition + * + * Replaces a real n-by-n matrix "a" with the LU decomposition of a row-wise + * permutation of itself. + * + * Input parameters: + * a: The matrix which is operated on. 1-indexed; it should be of size + * (n+1) x (n+1), and row/column index 0 is not used. + * n: The size of the matrix. + * + * Output parameters: + * indx: The row permutation performed. 1-indexed; it should be of size n+1, + * and index 0 is not used. + * d: the determinant of the permutation matrix. + * + * Returns 1 to indicate failure if the matrix is singular or has zeroes on the + * diagonal, 0 on success. + * + * Derived from ludcmp in "Numerical Recipes in C: The Art of Scientific Computing", + * with modified error handling. + */ +static int +lud(double **a, int n, int *perm, int *d) +{ + int i, imax = 0, j, k; + double big, dum, sum, temp; + double min, max; + double vv[n + 1]; + + *d = 1; + for (i = 1; i <= n; i++) { + big = 0.0; + for (j = 1; j <= n; j++) + if ((temp = fabs(a[i][j])) > big) + big = temp; + + if (big == 0.0) + return 1; + + vv[i] = 1.0 / big; + } + + for (j = 1; j <= n; j++) { + for (i = 1; i < j; i++) { + sum = a[i][j]; + for (k = 1; k < i; k++) + sum -= a[i][k] * a[k][j]; + + a[i][j] = sum; + } + + big = 0.0; + + for (i = j; i <= n; i++) { + sum = a[i][j]; + for (k = 1; k < j; k++) + sum -= a[i][k] * a[k][j]; + + a[i][j] = sum; + + if ((dum = vv[i] * fabs(sum)) >= big) { + big = dum; + imax = i; + } + } + + if (j != imax) { + for (k = 1; k <= n; k++) { + dum = a[imax][k]; + a[imax][k] = a[j][k]; + a[j][k] = dum; + } + + *d = -(*d); + vv[imax] = vv[j]; + } + + perm[j] = imax; + + if (a[j][j] == 0.0) + return 1; + + if (j != n) { + dum = 1.0 / (a[j][j]); + for (i = j + 1; i <= n; i++) + a[i][j] *= dum; + } + } + + min = 1e10; + max = 0.0; + for (i = 1; i <= n; i++) { + temp = fabs(a[i][i]); + if (temp < min) + min = temp; + if (temp > max) + max = temp; + } + return (min / max < 1e-10) ? 1 : 0; +} + +/** + * Solves the set of n linear equations Ax = b, using LU decomposition back-substitution. + * + * Input parameters: + * a: The LU decomposition of a matrix, created by "lud". + * n: The size of the matrix. + * indx: Row permutation vector, created by "lud". + * b: The vector b in the equation. 1-indexed; is should be of size n+1, and index 0 is not used. + * + * Output parameters: + * b: The output vector x. 1-indexed. + * + * From "Numerical Recipes in C: The Art of Scientific Computing". + */ +static void +lubksb(double **a, int n, int *perm, double *b) +{ + int i, ii = 0, ip, j; + double sum; + + for (i = 1; i <= n; i++) { + ip = perm[i]; + sum = b[ip]; + b[ip] = b[i]; + + if (ii) { + for (j = ii; j <= i - 1; j++) + sum -= a[i][j] * b[j]; + } else if (sum) { + ii = i; + } + + b[i] = sum; + } + + for (i = n; i >= 1; i--) { + sum = b[i]; + for (j = i + 1; j <= n; j++) + sum -= a[i][j] * b[j]; + b[i] = sum / a[i][i]; + } +} + +static void +split(double **predictors, double *delta, int order, int npredictors, double scale) +{ + int i, j; + + for (i = 0; i < npredictors; i++) { + for (j = 0; j <= order; j++) { + predictors[i + npredictors][j] = predictors[i][j] + delta[j] * scale; + } + } +} + +static void +refine(double **predictors, int order, int npredictors, double *data, int data_size, int refine_iters) +{ + int iter; + double dist; + double dummy; + double best_value; + int best_index; + int i, j; + + double rsums[npredictors][order + 1]; + int counts[npredictors]; + double vec[order + 1]; + + for (iter = 0; iter < refine_iters; iter++) { + // For some number of refinement iterations + + // Initialize averages + memset(counts, 0, npredictors * sizeof(int)); + memset(rsums, 0, npredictors * (order + 1) * sizeof(double)); + + // Sum autocorrelations + for (i = 0; i < data_size; i++) { + best_value = 1e30; + best_index = 0; + + // Find index that minimizes the "model distance" + for (j = 0; j < npredictors; j++) { + dist = model_dist(predictors[j], &data[(order + 1) * i], order); + + if (dist < best_value) { + best_value = dist; + best_index = j; + } + } + + counts[best_index]++; + rfroma(&data[(order + 1) * i], order, vec); // compute autocorrelation from predictors + + for (j = 0; j <= order; j++) + rsums[best_index][j] += vec[j]; // add to average autocorrelation + } + + // finalize average autocorrelations + for (i = 0; i < npredictors; i++) { + if (counts[i] > 0) { + for (j = 0; j <= order; j++) { + rsums[i][j] /= counts[i]; + } + } + } + + for (i = 0; i < npredictors; i++) { + // compute predictors from average autocorrelation + durbin(rsums[i], order, vec, predictors[i], &dummy); + // vec is reflection coeffs + + // clamp reflection coeffs + for (j = 1; j <= order; j++) { + if (vec[j] >= 1.0) + vec[j] = 0.9999999999; + if (vec[j] <= -1.0) + vec[j] = -0.9999999999; + } + + // clamped reflection coeffs -> predictors + afromk(vec, predictors[i], order); + } + } +} + +static int +read_row(int16_t *p, double *row, int order) +{ + double fval; + int ival; + int i, j, k; + int overflows; + double table[8][order]; + + for (i = 0; i < order; i++) { + for (j = 0; j < i; j++) + table[i][j] = 0.0; + + for (j = i; j < order; j++) + table[i][j] = -row[order - j + i]; + } + + for (i = order; i < 8; i++) + for (j = 0; j < order; j++) + table[i][j] = 0.0; + + for (i = 1; i < 8; i++) + for (j = 1; j <= order; j++) + if (i - j >= 0) + for (k = 0; k < order; k++) + table[i][k] -= row[j] * table[i - j][k]; + + overflows = 0; + + for (i = 0; i < order; i++) { + for (j = 0; j < 8; j++) { + fval = table[j][i] * (double)(1 << 11); + if (fval < 0.0) { + ival = (int)(fval - 0.5); + if (ival < -0x8000) + overflows++; + } else { + ival = (int)(fval + 0.5); + if (ival >= 0x8000) + overflows++; + } + + *(p++) = ival; + } + } + + return overflows; +} + +int +tabledesign_run(int16_t *order_out, int16_t *npredictors_out, int16_t **book_data_out, void *sample_data, + size_t num_samples, const table_design_spec *design) +{ + static const table_design_spec default_design = { + .order = 2, + .bits = 2, + .refine_iters = 2, + .thresh = 10.0, + .frame_size = 16, + }; + + if (design == NULL) + design = &default_design; + + int16_t order = design->order; + int16_t npredictors = 1 << design->bits; + unsigned int frame_size = design->frame_size; + + int num_order = order + 1; + + double vec[num_order]; + int perm[num_order]; + double reflection_coeffs[num_order]; + + int16_t *buffer = MALLOC_CHECKED_INFO(2 * frame_size * sizeof(int16_t), "frame_size=%u", frame_size); + + double **predictors = MALLOC_CHECKED_INFO(npredictors * sizeof(double *), "npredictors=%d", npredictors); + for (int i = 0; i < npredictors; i++) + predictors[i] = MALLOC_CHECKED_INFO(num_order * sizeof(double), "npredictors=%d", npredictors); + + double **autocorrelation_matrix = MALLOC_CHECKED_INFO(num_order * sizeof(double *), "num_order=%d", num_order); + for (int i = 0; i < num_order; i++) + autocorrelation_matrix[i] = MALLOC_CHECKED_INFO(num_order * sizeof(double), "num_order=%d", num_order); + + size_t nframes = num_samples - (num_samples % frame_size); + + double *data = + MALLOC_CHECKED_INFO(nframes * num_order * sizeof(double), "nframes=%lu, num_order=%d", nframes, num_order); + uint32_t data_size = 0; + + int16_t *sample = sample_data; + // (back-)align to a multiple of the frame size + int16_t *sample_end = sample + nframes; + + memset(buffer, 0, frame_size * sizeof(int16_t)); + + for (; sample < sample_end; sample += frame_size) { + // Copy sample data into second half of buffer, during the first iteration the first half is 0 while in + // later iterations the second half of the previous iteration is shifted into the first half. + memcpy(&buffer[frame_size], sample, frame_size * sizeof(int16_t)); + + // Compute autocorrelation vector of the two vectors in the buffer + acvect(&buffer[frame_size], order, frame_size, vec); + + // First element is the largest(?) + if (fabs(vec[0]) > design->thresh) { + // Over threshold + + // Computes the autocorrelation matrix of the two vectors in the buffer + acmat(&buffer[frame_size], order, frame_size, autocorrelation_matrix); + + // Compute the LUP decomposition of the autocorrelation matrix + int perm_det; + if (lud(autocorrelation_matrix, order, perm, &perm_det) == 0) { // Continue only if numerically stable + // Back-substitution to solve the linear equation Ra = r + // where + // R = autocorrelation matrix + // r = autocorrelation vector + // a = linear prediction coefficients + // After this vec contains the prediction coefficients + lubksb(autocorrelation_matrix, order, perm, vec); + vec[0] = 1.0; + + // Compute reflection coefficients from prediction coefficients + if (kfroma(vec, reflection_coeffs, order) == 0) { // Continue only if numerically stable + data[data_size * num_order + 0] = 1.0; + + // clamp the reflection coefficients + for (int i = 1; i < num_order; i++) { + if (reflection_coeffs[i] >= 1.0) + reflection_coeffs[i] = 0.9999999999; + if (reflection_coeffs[i] <= -1.0) + reflection_coeffs[i] = -0.9999999999; + } + + // Compute prediction coefficients from reflection coefficients + afromk(reflection_coeffs, &data[data_size * num_order], order); + data_size++; + } + } + } + + // Move second vector to first vector + memcpy(&buffer[0], &buffer[frame_size], frame_size * sizeof(int16_t)); + } + + // Create a vector [1.0, 0.0, ..., 0.0] + vec[0] = 1.0; + for (int i = 1; i < num_order; i++) + vec[i] = 0.0; + + for (uint32_t i = 0; i < data_size; i++) { + // Compute autocorrelation from predictors + rfroma(&data[i * num_order], order, predictors[0]); + + for (int k = 1; k < num_order; k++) + vec[k] += predictors[0][k]; + } + + for (int i = 1; i < num_order; i++) + vec[i] /= data_size; + + // vec is the average autocorrelation + + // Compute predictors for average autocorrelation using Levinson-Durbin algorithm + double dummy; + durbin(vec, order, reflection_coeffs, predictors[0], &dummy); + + // clamp results + for (int i = 1; i < num_order; i++) { + if (reflection_coeffs[i] >= 1.0) + reflection_coeffs[i] = 0.9999999999; + if (reflection_coeffs[i] <= -1.0) + reflection_coeffs[i] = -0.9999999999; + } + + // Convert clamped reflection coefficients to predictors + afromk(reflection_coeffs, predictors[0], order); + + // Split and refine predictors + for (unsigned cur_bits = 0; cur_bits < design->bits; cur_bits++) { + double split_delta[num_order]; + + for (int i = 0; i < num_order; i++) + split_delta[i] = 0.0; + split_delta[order - 1] = -1.0; + + split(predictors, split_delta, order, 1 << cur_bits, 0.01); + refine(predictors, order, 1 << (1 + cur_bits), data, data_size, design->refine_iters); + } + + int16_t *book_data = MALLOC_CHECKED_INFO((8 * order * npredictors + 2) * sizeof(int16_t), + "order=%d, npredictors=%d", order, npredictors); + + *order_out = order; + *npredictors_out = npredictors; + + int num_oflow = 0; + for (int i = 0; i < npredictors; i++) + num_oflow += read_row(&book_data[8 * order * i], predictors[i], order); + + if (num_oflow) { + error("overflow detected in tabledesign"); + } + + *book_data_out = book_data; + + free(buffer); + free(data); + + for (int i = 0; i < num_order; i++) + free(autocorrelation_matrix[i]); + free(autocorrelation_matrix); + + for (int i = 0; i < npredictors; i++) + free(predictors[i]); + free(predictors); + + return 0; +} diff --git a/tools/audio/sampleconv/src/container/aiff.c b/tools/audio/sampleconv/src/container/aiff.c new file mode 100644 index 0000000000..7f824e016a --- /dev/null +++ b/tools/audio/sampleconv/src/container/aiff.c @@ -0,0 +1,837 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include +#include +#include +#include +#include +#include + +#include "../util.h" +#include "../codec/vadpcm.h" +#include "aiff.h" + +typedef struct { + int16_t numChannels; + uint16_t numFramesH; + uint16_t numFramesL; + int16_t sampleSize; + uint8_t sampleRate[10]; // 80-bit float + // Followed by compression type + compression name pstring +} aiff_COMM; + +typedef struct { + uint16_t nMarkers; +} aiff_MARK; + +typedef struct { + uint16_t MarkerID; + uint16_t positionH; + uint16_t positionL; +} Marker; + +typedef enum { + LOOP_PLAYMODE_NONE = 0, + LOOP_PLAYMODE_FWD = 1, + LOOP_PLAYMODE_FWD_BWD = 2 +} aiff_loop_playmode; + +typedef struct { + int16_t playMode; // aiff_loop_playmode + // Marker IDs + int16_t beginLoop; + int16_t endLoop; +} Loop; + +typedef struct { + int8_t baseNote; + int8_t detune; + int8_t lowNote; + int8_t highNote; + int8_t lowVelocity; + int8_t highVelocity; + int16_t gain; + Loop sustainLoop; + Loop releaseLoop; +} aiff_INST; + +typedef struct { + int32_t offset; + int32_t blockSize; +} aiff_SSND; + +static void +read_pstring(FILE *f, char *out) +{ + unsigned char len; + + // read string length + FREAD(f, &len, sizeof(len)); + + // read string and null-terminate it + FREAD(f, out, len); + out[len] = '\0'; + + // pad to 2-byte boundary + if (!(len & 1)) + FREAD(f, &len, 1); +} + +static char * +read_pstring_alloc(FILE *f) +{ + unsigned char len; + + // read string length + FREAD(f, &len, sizeof(len)); + + // alloc + char *out = MALLOC_CHECKED_INFO(len + 1, "len=%u", len); + + // read string and null-terminate it + FREAD(f, out, len); + out[len] = '\0'; + + // pad to 2-byte boundary + if (!(len & 1)) + FREAD(f, &len, 1); + + return out; +} + +static void +write_pstring(FILE *f, const char *in) +{ + unsigned char zr = 0; + size_t inlen = strlen(in); + + if (inlen > 255) + error("Invalid pstring length."); + + unsigned char len = inlen; + + CHUNK_WRITE(f, &len); + CHUNK_WRITE_RAW(f, in, len); + if (!(len & 1)) + CHUNK_WRITE(f, &zr); +} + +static_assert(sizeof(double) == sizeof(uint64_t), "Double is assumed to be 64-bit"); + +#define F64_GET_SGN(bits) (((bits) >> 63) & 1) // 1-bit +#define F64_GET_EXP(bits) ((((bits) >> 52) & 0x7FF) - 0x3FF) // 15-bit +#define F64_GET_MANT_H(bits) (((bits) >> 32) & 0xFFFFF) // 20-bit +#define F64_GET_MANT_L(bits) ((bits)&0xFFFFFFFF) // 32-bit + +static void +f64_to_f80(double f64, uint8_t *f80) +{ + union { + uint32_t w[3]; + uint8_t b[12]; + } f80tmp; + + // get f64 bits + + uint64_t f64_bits = *(uint64_t *)&f64; + + int f64_sgn = F64_GET_SGN(f64_bits); + int f64_exponent = F64_GET_EXP(f64_bits); + uint32_t f64_mantissa_hi = F64_GET_MANT_H(f64_bits); + uint32_t f64_mantissa_lo = F64_GET_MANT_L(f64_bits); + + // build f80 words + + f80tmp.w[0] = (f64_sgn << 15) | (f64_exponent + 0x3FFF); + f80tmp.w[1] = (1 << 31) | (f64_mantissa_hi << 11) | (f64_mantissa_lo >> 21); + f80tmp.w[2] = f64_mantissa_lo << 11; + + // byteswap to BE + + f80tmp.w[0] = htobe32(f80tmp.w[0]); + f80tmp.w[1] = htobe32(f80tmp.w[1]); + f80tmp.w[2] = htobe32(f80tmp.w[2]); + + // write bytes + + for (size_t i = 0; i < 10; i++) + f80[i] = f80tmp.b[i + 2]; +} + +static void +f80_to_f64(double *f64, uint8_t *f80) +{ + union { + uint32_t w[3]; + uint8_t b[12]; + } f80tmp; + + // read bytes + + f80tmp.b[0] = f80tmp.b[1] = 0; + for (size_t i = 0; i < 10; i++) + f80tmp.b[i + 2] = f80[i]; + + // byteswap from BE + + f80tmp.w[0] = be32toh(f80tmp.w[0]); + f80tmp.w[1] = be32toh(f80tmp.w[1]); + f80tmp.w[2] = be32toh(f80tmp.w[2]); + + // get f64 parts + + int f64_sgn = (f80tmp.w[0] >> 15) & 1; + int f64_exponent = (f80tmp.w[0] & 0x7FFF) - 0x3FFF; + uint32_t f64_mantissa_hi = (f80tmp.w[1] >> 11) & 0xFFFFF; + uint32_t f64_mantissa_lo = ((f80tmp.w[1] & 0x7FF) << 21) | (f80tmp.w[2] >> 11); + + // build bitwise f64 + + uint64_t f64_bits = ((uint64_t)f64_sgn << 63) | ((((uint64_t)f64_exponent + 0x3FF) & 0x7FF) << 52) | + ((uint64_t)f64_mantissa_hi << 32) | ((uint64_t)f64_mantissa_lo); + + // write double + + *f64 = *(double *)&f64_bits; +} + +int +aiff_aifc_common_read(container_data *out, FILE *in, UNUSED bool matching, uint32_t size) +{ + bool has_comm = false; + bool has_inst = false; + bool has_ssnd = false; + + size_t num_markers = 0; + container_marker *markers = NULL; + + memset(out, 0, sizeof(*out)); + + while (true) { + long start = ftell(in); + if (start > 8 + size) { + error("Overran file"); + } + if (start == 8 + size) { + break; + } + + char cc4[4]; + uint32_t chunk_size; + + FREAD(in, cc4, 4); + FREAD(in, &chunk_size, 4); + chunk_size = be32toh(chunk_size); + + chunk_size++; + chunk_size &= ~1; + + switch (CC4(cc4[0], cc4[1], cc4[2], cc4[3])) { + case CC4('C', 'O', 'M', 'M'): { + aiff_COMM comm; + FREAD(in, &comm, sizeof(comm)); + comm.numChannels = be16toh(comm.numChannels); + comm.numFramesH = be16toh(comm.numFramesH); + comm.numFramesL = be16toh(comm.numFramesL); + comm.sampleSize = be16toh(comm.sampleSize); + + uint32_t num_samples = (comm.numFramesH << 16) | comm.numFramesL; + double sample_rate; + f80_to_f64(&sample_rate, comm.sampleRate); + + uint32_t comp_type = CC4('N', 'O', 'N', 'E'); + if (chunk_size > sizeof(aiff_COMM)) { + uint32_t compressionType; + FREAD(in, &compressionType, sizeof(compressionType)); + comp_type = be32toh(compressionType); + } + + out->num_channels = comm.numChannels; + out->sample_rate = sample_rate; + out->bit_depth = comm.sampleSize; + out->num_samples = num_samples; + + switch (comp_type) { + case CC4('N', 'O', 'N', 'E'): + out->data_type = SAMPLE_TYPE_PCM16; + break; + + case CC4('H', 'P', 'C', 'M'): + out->data_type = SAMPLE_TYPE_PCM8; + break; + + case CC4('A', 'D', 'P', '9'): + out->data_type = SAMPLE_TYPE_VADPCM; + break; + + case CC4('A', 'D', 'P', '5'): + out->data_type = SAMPLE_TYPE_VADPCM_HALF; + break; + + default: + error("Unrecognized aiff/aifc compression type"); + break; + } + + if (chunk_size > sizeof(aiff_COMM) + 4) { + char compression_name[257]; + read_pstring(in, compression_name); + } + has_comm = true; + } break; + + case CC4('I', 'N', 'S', 'T'): { + aiff_INST inst; + FREAD(in, &inst, sizeof(inst)); + inst.gain = be16toh(inst.gain); + inst.sustainLoop.playMode = be16toh(inst.sustainLoop.playMode); + inst.sustainLoop.beginLoop = be16toh(inst.sustainLoop.beginLoop); + inst.sustainLoop.endLoop = be16toh(inst.sustainLoop.endLoop); + inst.releaseLoop.playMode = be16toh(inst.releaseLoop.playMode); + inst.releaseLoop.beginLoop = be16toh(inst.releaseLoop.beginLoop); + inst.releaseLoop.endLoop = be16toh(inst.releaseLoop.endLoop); + + out->base_note = inst.baseNote; + out->fine_tune = inst.detune; + out->key_low = inst.lowNote; + out->key_hi = inst.highNote; + out->vel_low = inst.lowVelocity; + out->vel_hi = inst.highVelocity; + out->gain = inst.gain; + + size_t nloops = 0; + nloops += inst.sustainLoop.playMode != LOOP_PLAYMODE_NONE; + nloops += inst.releaseLoop.playMode != LOOP_PLAYMODE_NONE; + + if (nloops != 0) { + out->loops = MALLOC_CHECKED_INFO(nloops * sizeof(container_loop), "nloops=%lu", nloops); + + size_t i = 0; + + if (inst.sustainLoop.playMode != LOOP_PLAYMODE_NONE) { + out->loops[i].id = 0; + + switch (inst.sustainLoop.playMode) { + case LOOP_PLAYMODE_FWD: + out->loops[i].type = LOOP_FORWARD; + break; + + case LOOP_PLAYMODE_FWD_BWD: + out->loops[i].type = LOOP_FORWARD_BACKWARD; + break; + + default: + error("Unrecognized PlayMode in sustainLoop"); + break; + } + out->loops[i].start = inst.sustainLoop.beginLoop; + out->loops[i].end = inst.sustainLoop.endLoop; + out->loops[i].num = 0xFFFFFFFF; + out->loops[i].fraction = 0; + + i++; + } + + if (inst.releaseLoop.playMode != LOOP_PLAYMODE_NONE) { + out->loops[i].id = 1; + + switch (inst.sustainLoop.playMode) { + case LOOP_PLAYMODE_FWD: + out->loops[i].type = LOOP_FORWARD; + break; + + case LOOP_PLAYMODE_FWD_BWD: + out->loops[i].type = LOOP_FORWARD_BACKWARD; + break; + + default: + error("Unrecognized PlayMode in releaseLoop"); + break; + } + out->loops[i].start = inst.releaseLoop.beginLoop; + out->loops[i].end = inst.releaseLoop.endLoop; + out->loops[i].num = 0xFFFFFFFF; + out->loops[i].fraction = 0; + + i++; + } + } + + has_inst = true; + } break; + + case CC4('M', 'A', 'R', 'K'): { + aiff_MARK mark; + FREAD(in, &mark, sizeof(mark)); + mark.nMarkers = be16toh(mark.nMarkers); + + num_markers = mark.nMarkers; + markers = MALLOC_CHECKED_INFO(num_markers * sizeof(container_marker), "num_markers=%lu", num_markers); + + for (size_t i = 0; i < num_markers; i++) { + Marker marker; + char *name; + FREAD(in, &marker, sizeof(marker)); + name = read_pstring_alloc(in); + + markers[i].id = be16toh(marker.MarkerID); + markers[i].frame_number = (be16toh(marker.positionH) << 16) | be16toh(marker.positionL); + markers[i].name = name; + } + } break; + + case CC4('A', 'P', 'P', 'L'): { + char subcc4[4]; + + FREAD(in, subcc4, 4); + + switch (CC4(subcc4[0], subcc4[1], subcc4[2], subcc4[3])) { + case CC4('s', 't', 'o', 'c'): { + char chunk_name[257]; + read_pstring(in, chunk_name); + + if (strequ(chunk_name, "VADPCMCODES")) { + int16_t version; + uint16_t order; + uint16_t npredictors; + + FREAD(in, &version, sizeof(version)); + version = be16toh(version); + FREAD(in, &order, sizeof(order)); + order = be16toh(order); + FREAD(in, &npredictors, sizeof(npredictors)); + npredictors = be16toh(npredictors); + + size_t book_size_bytes = VADPCM_BOOK_SIZE_BYTES(order, npredictors); + int16_t *book_state = + MALLOC_CHECKED_INFO(book_size_bytes, "order=%u, npredictors=%u", order, npredictors); + FREAD(in, book_state, book_size_bytes); + + out->vadpcm.book_version = version; + out->vadpcm.book_header.order = order; + out->vadpcm.book_header.npredictors = npredictors; + out->vadpcm.book_data = book_state; + + for (size_t i = 0; i < VADPCM_BOOK_SIZE(order, npredictors); i++) + out->vadpcm.book_data[i] = be16toh(out->vadpcm.book_data[i]); + + out->vadpcm.has_book = true; + } else if (strequ(chunk_name, "VADPCMLOOPS")) { + int16_t version; + int16_t nloops; + + FREAD(in, &version, sizeof(version)); + version = be16toh(version); + FREAD(in, &nloops, sizeof(nloops)); + nloops = be16toh(nloops); + + out->vadpcm.loop_version = version; + out->vadpcm.num_loops = nloops; + + if (out->vadpcm.num_loops) + out->vadpcm.loops = MALLOC_CHECKED_INFO(out->vadpcm.num_loops * sizeof(ALADPCMloop), + "num_loops=%u", out->vadpcm.num_loops); + + for (size_t i = 0; i < out->vadpcm.num_loops; i++) { + FREAD(in, &out->vadpcm.loops[i], sizeof(ALADPCMloop)); + out->vadpcm.loops[i].start = be32toh(out->vadpcm.loops[i].start); + out->vadpcm.loops[i].end = be32toh(out->vadpcm.loops[i].end); + out->vadpcm.loops[i].count = be32toh(out->vadpcm.loops[i].count); + for (size_t j = 0; j < ARRAY_COUNT(out->vadpcm.loops[i].state); j++) + out->vadpcm.loops[i].state[j] = be16toh(out->vadpcm.loops[i].state[j]); + } + } else { + warning("Skipping unknown APPL::stoc subchunk: \"%s\"", chunk_name); + } + } break; + + default: + warning("Skipping unknown APPL subchunk: \"%c%c%c%c\"", subcc4[0], subcc4[1], subcc4[2], + subcc4[3]); + break; + } + } break; + + case CC4('S', 'S', 'N', 'D'): { + aiff_SSND ssnd; + FREAD(in, &ssnd, sizeof(ssnd)); + ssnd.offset = be32toh(ssnd.offset); + ssnd.blockSize = be32toh(ssnd.blockSize); + + size_t data_size = chunk_size - sizeof(ssnd); + + void *data = MALLOC_CHECKED_INFO(data_size, "SSND chunk size = %lu", data_size); + FREAD(in, data, data_size); + + if (ssnd.offset != 0 || ssnd.blockSize != 0) + error("Bad SSND chunk in aiff/aifc, offset/blockSize != 0"); + + out->data = data; + out->data_size = data_size; + + has_ssnd = true; + } break; + + default: + warning("Skipping unknown aiff chunk: \"%c%c%c%c\"", cc4[0], cc4[1], cc4[2], cc4[3]); + break; + } + + long read_size = ftell(in) - start - 8; + + if (read_size > chunk_size) + error("overran chunk: %lu vs %u", read_size, chunk_size); + else if (read_size < chunk_size) + warning("did not read entire %.*s chunk: %lu vs %u", 4, cc4, read_size, chunk_size); + + fseek(in, start + 8 + chunk_size, SEEK_SET); + } + + if (!has_comm) + error("aiff/aifc has no COMM chunk"); + if (!has_inst) + error("aiff/aifc has no INST chunk"); + if (!has_ssnd) + error("aiff/aifc has no SSND chunk"); + + if (out->data_type == SAMPLE_TYPE_PCM16) { + assert(out->data_size % 2 == 0); + assert(out->bit_depth == 16); + + for (size_t i = 0; i < out->data_size / 2; i++) + ((uint16_t *)(out->data))[i] = be16toh(((uint16_t *)(out->data))[i]); + } + + for (size_t i = 0; i < out->num_loops; i++) { + container_marker *marker; + + marker = NULL; + for (size_t j = 0; j < num_markers; j++) { + if (markers[j].id == out->loops[i].start) { + marker = &markers[j]; + break; + } + } + if (marker == NULL) + error("AIFF/C loop references non-existent marker"); + + out->loops[i].start = marker->frame_number; + + marker = NULL; + for (size_t j = 0; j < num_markers; j++) { + if (markers[j].id == out->loops[i].end) { + marker = &markers[j]; + break; + } + } + if (marker == NULL) + error("AIFF/C loop references non-existent marker"); + + out->loops[i].end = marker->frame_number; + } + + fclose(in); + return 0; +} + +int +aifc_read(container_data *out, const char *path, bool matching) +{ + FILE *in = fopen(path, "rb"); + if (in == NULL) + error("Failed to open \"%s\" for reading", path); + + char form[4]; + uint32_t size; + char aifc[4]; + + FREAD(in, form, 4); + FREAD(in, &size, 4); + size = be32toh(size); + FREAD(in, aifc, 4); + + if (!CC4_CHECK(form, "FORM") || !CC4_CHECK(aifc, "AIFC")) + error("Not an aifc file?"); + + return aiff_aifc_common_read(out, in, matching, size); +} + +int +aiff_read(container_data *out, const char *path, bool matching) +{ + FILE *in = fopen(path, "rb"); + if (in == NULL) + error("Failed to open \"%s\" for reading", path); + + char form[4]; + uint32_t size; + char aiff[4]; + + FREAD(in, form, 4); + FREAD(in, &size, 4); + size = be32toh(size); + FREAD(in, aiff, 4); + + if (!CC4_CHECK(form, "FORM") || !CC4_CHECK(aiff, "AIFF")) + error("Not an aiff file?"); + + return aiff_aifc_common_read(out, in, matching, size); +} + +static int +aiff_aifc_common_write(container_data *in, const char *path, bool aifc, bool matching) +{ + FILE *out = fopen(path, "wb"); + if (out == NULL) + error("Failed to open %s for writing", path); + + const char *aifc_head = "FORM\0\0\0\0AIFC"; + const char *aiff_head = "FORM\0\0\0\0AIFF"; + FWRITE(out, (aifc) ? aifc_head : aiff_head, 12); + + long chunk_start; + + uint32_t compression_type; + const char *compression_name; + + switch (in->data_type) { + case SAMPLE_TYPE_PCM16: + compression_type = CC4('N', 'O', 'N', 'E'); + compression_name = NULL; + break; + + case SAMPLE_TYPE_PCM8: + compression_type = CC4('H', 'P', 'C', 'M'); + compression_name = "Half-frame PCM"; + break; + + case SAMPLE_TYPE_VADPCM: + compression_type = CC4('A', 'D', 'P', '9'); + compression_name = "Nintendo/SGI VADPCM 9-bytes/frame"; + break; + + case SAMPLE_TYPE_VADPCM_HALF: + compression_type = CC4('A', 'D', 'P', '5'); + compression_name = "Nintendo/SGI VADPCM 5-bytes/frame"; + break; + + default: + error("Unhandled data type for aiff/aifc container"); + break; + } + + if (compression_type != CC4('N', 'O', 'N', 'E') && !aifc) { + error("Compressed data types must use aifc output"); + } + + aiff_COMM comm = { + .numChannels = htobe16(in->num_channels), + .numFramesH = htobe16(in->num_samples >> 16), + .numFramesL = htobe16(in->num_samples), + .sampleSize = htobe16(in->bit_depth), + .sampleRate = { 0 }, + }; + f64_to_f80(in->sample_rate, comm.sampleRate); + CHUNK_BEGIN(out, "COMM", &chunk_start); + CHUNK_WRITE(out, &comm); + if (compression_name != NULL) { + uint32_t compressionType = htobe32(compression_type); + CHUNK_WRITE(out, &compressionType); + write_pstring(out, compression_name); + } + CHUNK_END(out, chunk_start, htobe32); + + if (in->num_loops > 2) + error("Only up to two loops are supported for AIFF/C"); + + size_t num_markers = 0; + container_marker markers[4]; + static char *marker_names[4] = { + "start", + "end", + "start", + "end", + }; + Loop sustainLoop = { 0 }; + Loop releaseLoop = { 0 }; + + for (size_t i = 0; i < in->num_loops; i++) { + Loop *target; + + switch (in->loops[i].id) { + case 0: + target = &sustainLoop; + break; + + case 1: + target = &releaseLoop; + break; + + default: + continue; + } + + unsigned type; + switch (in->loops[i].type) { + case LOOP_FORWARD: + type = LOOP_PLAYMODE_FWD; + break; + + case LOOP_FORWARD_BACKWARD: + type = LOOP_PLAYMODE_FWD_BWD; + break; + + default: + error("Unsupported loop type in aiff/aifc"); + break; + } + + target->playMode = htobe16(type); + + markers[num_markers].id = num_markers + 1; + markers[num_markers].name = marker_names[num_markers]; + markers[num_markers].frame_number = in->loops[i].start; + target->beginLoop = htobe16(1 + num_markers++); + + markers[num_markers].id = num_markers + 1; + markers[num_markers].name = marker_names[num_markers]; + markers[num_markers].frame_number = in->loops[i].end; + target->endLoop = htobe16(1 + num_markers++); + } + + if (num_markers != 0) { + CHUNK_BEGIN(out, "MARK", &chunk_start); + + aiff_MARK mark = { + .nMarkers = htobe16(num_markers), + }; + CHUNK_WRITE(out, &mark); + + for (size_t i = 0; i < num_markers; i++) { + Marker marker = { + .MarkerID = htobe16(markers[i].id), + .positionH = htobe16(markers[i].frame_number >> 16), + .positionL = htobe16(markers[i].frame_number), + }; + CHUNK_WRITE(out, &marker); + write_pstring(out, markers[i].name); + } + + CHUNK_END(out, chunk_start, htobe32); + } + + aiff_INST inst = { + .baseNote = in->base_note, + .detune = in->fine_tune, + .lowNote = in->key_low, + .highNote = in->key_hi, + .lowVelocity = in->vel_low, + .highVelocity = in->vel_hi, + .gain = htobe16(in->gain), + .sustainLoop = sustainLoop, + .releaseLoop = releaseLoop, + }; + CHUNK_BEGIN(out, "INST", &chunk_start); + CHUNK_WRITE(out, &inst); + CHUNK_END(out, chunk_start, htobe32); + + if (aifc || matching) { + // If we're writing an aifc, or we want to match on round-trip, emit an application-specific chunk for the + // vadpcm codebook. + if (in->vadpcm.has_book) { + // APPL::stoc::VADPCMCODES + CHUNK_BEGIN(out, "APPL", &chunk_start); + CHUNK_WRITE_RAW(out, "stoc", 4); + write_pstring(out, "VADPCMCODES"); + + int16_t version = htobe16(in->vadpcm.book_version); + int16_t order = htobe16(in->vadpcm.book_header.order); + int16_t npredictors = htobe16(in->vadpcm.book_header.npredictors); + + CHUNK_WRITE(out, &version); + CHUNK_WRITE(out, &order); + CHUNK_WRITE(out, &npredictors); + + size_t book_size = VADPCM_BOOK_SIZE(in->vadpcm.book_header.order, in->vadpcm.book_header.npredictors); + + int16_t book_data_out[book_size]; + for (size_t i = 0; i < book_size; i++) + book_data_out[i] = htobe16(in->vadpcm.book_data[i]); + + CHUNK_WRITE_RAW(out, book_data_out, sizeof(int16_t) * book_size); + + CHUNK_END(out, chunk_start, htobe32); + } + + // Only write a vadpcm loop structure for compressed output. Loop states match on round-trip so we need not + // save them in uncompressed output. + if (aifc && in->vadpcm.num_loops != 0) { + // APPL::stoc::VADPCMLOOPS + CHUNK_BEGIN(out, "APPL", &chunk_start); + CHUNK_WRITE_RAW(out, "stoc", 4); + write_pstring(out, "VADPCMLOOPS"); + + int16_t version = htobe16(in->vadpcm.loop_version); + int16_t nloops = htobe16(in->vadpcm.num_loops); + + CHUNK_WRITE(out, &version); + CHUNK_WRITE(out, &nloops); + + for (size_t i = 0; i < in->vadpcm.num_loops; i++) { + ALADPCMloop outloop = in->vadpcm.loops[i]; + outloop.start = htobe32(outloop.start); + outloop.end = htobe32(outloop.end); + outloop.count = htobe32(outloop.count); + for (size_t i = 0; i < ARRAY_COUNT(outloop.state); i++) + outloop.state[i] = htobe16(outloop.state[i]); + + CHUNK_WRITE(out, &outloop); + } + + CHUNK_END(out, chunk_start, htobe32); + } + } + + if (in->data_type == SAMPLE_TYPE_PCM16) { + assert(in->data_size % 2 == 0); + assert(in->bit_depth == 16); + + for (size_t i = 0; i < in->data_size / 2; i++) { + ((uint16_t *)in->data)[i] = htobe16(((uint16_t *)in->data)[i]); + } + } + + aiff_SSND ssnd = { + .offset = 0, + .blockSize = 0, + }; + CHUNK_BEGIN(out, "SSND", &chunk_start); + CHUNK_WRITE(out, &ssnd); + CHUNK_WRITE_RAW(out, in->data, in->data_size); + CHUNK_END(out, chunk_start, htobe32); + + uint32_t size = htobe32(ftell(out) - 8); + fseek(out, 4, SEEK_SET); + fwrite(&size, 4, 1, out); + fclose(out); + + return 0; +} + +int +aifc_write(container_data *data, const char *path, bool matching) +{ + return aiff_aifc_common_write(data, path, true, matching); +} + +int +aiff_write(container_data *data, const char *path, bool matching) +{ + return aiff_aifc_common_write(data, path, false, matching); +} diff --git a/tools/audio/sampleconv/src/container/aiff.h b/tools/audio/sampleconv/src/container/aiff.h new file mode 100644 index 0000000000..757a57e749 --- /dev/null +++ b/tools/audio/sampleconv/src/container/aiff.h @@ -0,0 +1,28 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef AIFF_H +#define AIFF_H + +#include +#include + +#include "../codec/vadpcm.h" +#include "container.h" + +int +aifc_read(container_data *out, const char *path, bool matching); +int +aiff_read(container_data *out, const char *path, bool matching); + +int +aifc_write(container_data *in, const char *path, bool matching); +int +aiff_write(container_data *in, const char *path, bool matching); + +#endif diff --git a/tools/audio/sampleconv/src/container/container.c b/tools/audio/sampleconv/src/container/container.c new file mode 100644 index 0000000000..f2df3448e6 --- /dev/null +++ b/tools/audio/sampleconv/src/container/container.c @@ -0,0 +1,25 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include + +#include "container.h" + +int +container_destroy(container_data *data) +{ + if (data->data != NULL) + free(data->data); + if (data->loops != NULL) + free(data->loops); + if (data->vadpcm.book_data != NULL) + free(data->vadpcm.book_data); + if (data->vadpcm.loops != NULL) + free(data->vadpcm.loops); + return 0; +} diff --git a/tools/audio/sampleconv/src/container/container.h b/tools/audio/sampleconv/src/container/container.h new file mode 100644 index 0000000000..680b64012d --- /dev/null +++ b/tools/audio/sampleconv/src/container/container.h @@ -0,0 +1,99 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef CONTAINER_H +#define CONTAINER_H + +#include +#include + +#include "../codec/vadpcm.h" + +typedef enum { + // Uncompressed + SAMPLE_TYPE_PCM16, + SAMPLE_TYPE_PCM8, + + // Compressed + SAMPLE_TYPE_VADPCM, + SAMPLE_TYPE_VADPCM_HALF +} sample_data_type; + +typedef struct { + const char *fext; + int (*read)(struct container_data *out, const char *path, bool matching); + int (*write)(struct container_data *out, const char *path, bool matching); +} container_spec; + +typedef enum { + LOOP_NONE = 0, + LOOP_FORWARD = 1, + LOOP_FORWARD_BACKWARD = 2, + LOOP_BACKWARD = 3 +} loop_type; + +typedef struct { + uint16_t id; + loop_type type; + uint32_t start; + uint32_t end; + uint32_t fraction; + uint32_t num; +} container_loop; + +typedef struct { + uint16_t id; + uint32_t frame_number; + char *name; +} container_marker; + +typedef struct container_data { + // Sample details + double sample_rate; + unsigned int num_channels; + uint32_t byte_rate; + uint16_t block_align; + uint16_t bit_depth; // also called sample_size + uint32_t num_samples; // also apparently called num_frames? but that's wrong + + // Instrument details + int8_t base_note; + int8_t fine_tune; + int8_t gain; + int8_t key_low; + int8_t key_hi; + int8_t vel_low; + int8_t vel_hi; + + // Sample data, possibly compressed + sample_data_type data_type; + void *data; + size_t data_size; + + unsigned num_loops; + container_loop *loops; + + // VADPCM-specific data + struct { + // VADPCM codebook + int16_t book_version; + ALADPCMbookhead book_header; + int16_t *book_data; + bool has_book; + + // VADPCM loop data + int16_t loop_version; + unsigned num_loops; + ALADPCMloop *loops; + } vadpcm; +} container_data; + +int +container_destroy(container_data *data); + +#endif diff --git a/tools/audio/sampleconv/src/container/wav.c b/tools/audio/sampleconv/src/container/wav.c new file mode 100644 index 0000000000..885acb35eb --- /dev/null +++ b/tools/audio/sampleconv/src/container/wav.c @@ -0,0 +1,552 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include +#include +#include +#include +#include +#include + +#include "../util.h" +#include "../codec/vadpcm.h" +#include "wav.h" + +typedef enum { + WAVE_TYPE_PCM = 1, + WAVE_TYPE_FLOAT = 3, + WAVE_TYPE_ALAW = 6, + WAVE_TYPE_MULAW = 7, + WAVE_TYPE_EXTENSIBLE = 0xFFFE, +} wav_type; + +typedef struct { + uint16_t type; + uint16_t num_channels; + uint32_t sample_rate; + uint32_t byte_rate; + uint16_t block_align; + uint16_t bit_depth; +} wav_fmt; + +typedef struct { + uint32_t num_samples; +} wav_fact; + +typedef struct { + int8_t base_note; + int8_t fine_tune; + int8_t gain; + int8_t key_low; + int8_t key_hi; + int8_t vel_low; + int8_t vel_hi; + char _pad[1]; +} wav_inst; + +typedef struct { + uint32_t manufacturer; + uint32_t product; + uint32_t sample_period; + uint32_t unity_note; + char _pad[3]; + uint8_t fine_tune; + uint32_t format; + uint32_t offset; + uint32_t num_sample_loops; + uint32_t sampler_data; +} wav_smpl; + +typedef struct { + uint32_t cue_point_index; + uint32_t type; + uint32_t start; + uint32_t end; + uint32_t fraction; + uint32_t num; +} wav_loop; + +static const char * +wav_type_name(int type) +{ + switch (type) { + case WAVE_TYPE_PCM: + return "PCM"; + case WAVE_TYPE_FLOAT: + return "Float"; + case WAVE_TYPE_ALAW: + return "ALAW"; + case WAVE_TYPE_MULAW: + return "MULAW"; + case WAVE_TYPE_EXTENSIBLE: + return "Extensible"; + default: + return "Unknown (should never be here)"; + } +} + +int +wav_read(container_data *out, const char *path, UNUSED bool matching) +{ + bool has_fmt = false; + bool has_fact = false; + bool has_data = false; + bool has_inst = false; + bool has_smpl = false; + memset(out, 0, sizeof(*out)); + + FILE *in = fopen(path, "rb"); + if (in == NULL) + error("Failed to open \"%s\" for reading", path); + + char riff[4]; + uint32_t size; + char wave[4]; + + FREAD(in, riff, 4); + FREAD(in, &size, 4); + size = le32toh(size); + FREAD(in, wave, 4); + + if (!CC4_CHECK(riff, "RIFF") || !CC4_CHECK(wave, "WAVE")) + error("Not a wav file?"); + + while (true) { + bool skipped = false; + + long start = ftell(in); + if (start > 8 + size) { + error("Overran file"); + } + if (start == 8 + size) { + break; + } + + char cc4[4]; + uint32_t chunk_size; + + FREAD(in, cc4, 4); + FREAD(in, &chunk_size, 4); + chunk_size = le32toh(chunk_size); + + switch (CC4(cc4[0], cc4[1], cc4[2], cc4[3])) { + case CC4('f', 'm', 't', ' '): { + wav_fmt fmt; + FREAD(in, &fmt, sizeof(fmt)); + fmt.type = le16toh(fmt.type); + fmt.num_channels = le16toh(fmt.num_channels); + fmt.sample_rate = le32toh(fmt.sample_rate); + fmt.byte_rate = le32toh(fmt.byte_rate); + fmt.block_align = le16toh(fmt.block_align); + fmt.bit_depth = le16toh(fmt.bit_depth); + + if (fmt.bit_depth != 16) + error("Wav input format should be 16-bit PCM, was %u-bit", fmt.bit_depth); + + switch (fmt.type) { + case WAVE_TYPE_PCM: + out->data_type = SAMPLE_TYPE_PCM16; + break; + + case WAVE_TYPE_FLOAT: + case WAVE_TYPE_MULAW: + case WAVE_TYPE_ALAW: + case WAVE_TYPE_EXTENSIBLE: + error("Unhandled sample type: %s, should be PCM", wav_type_name(fmt.type)); + break; + + default: + error("Unrecognized sample type: %d, should be PCM", fmt.type); + break; + } + + out->num_channels = fmt.num_channels; + out->sample_rate = fmt.sample_rate; + out->byte_rate = fmt.byte_rate; + out->block_align = fmt.block_align; + out->bit_depth = fmt.bit_depth; + + has_fmt = true; + } break; + + case CC4('f', 'a', 'c', 't'): { + wav_fact fact; + FREAD(in, &fact, sizeof(fact)); + fact.num_samples = le32toh(fact.num_samples); + + out->num_samples = fact.num_samples; + + has_fact = true; + } break; + + case CC4('d', 'a', 't', 'a'): { + void *data = MALLOC_CHECKED_INFO(chunk_size, "data size = %u", chunk_size); + FREAD(in, data, chunk_size); + + out->data = data; + out->data_size = chunk_size; + + has_data = true; + } break; + + case CC4('i', 'n', 's', 't'): { + wav_inst inst; + FREAD(in, &inst, sizeof(inst)); + + out->base_note = inst.base_note; + out->fine_tune = inst.fine_tune; + out->gain = inst.gain; + out->key_low = inst.key_low; + out->key_hi = inst.key_hi; + out->vel_low = inst.vel_low; + out->vel_hi = inst.vel_hi; + + has_inst = true; + } break; + + case CC4('s', 'm', 'p', 'l'): { + wav_smpl smpl; + FREAD(in, &smpl, sizeof(smpl)); + smpl.manufacturer = le32toh(smpl.manufacturer); + smpl.product = le32toh(smpl.product); + smpl.sample_period = le32toh(smpl.sample_period); + smpl.unity_note = le32toh(smpl.unity_note); + smpl.format = le32toh(smpl.format); + smpl.offset = le32toh(smpl.offset); + smpl.num_sample_loops = le32toh(smpl.num_sample_loops); + smpl.sampler_data = le32toh(smpl.sampler_data); + + out->num_loops = smpl.num_sample_loops; + if (out->num_loops != 0) { + out->loops = + MALLOC_CHECKED_INFO(out->num_loops * sizeof(container_loop), "num_loops=%u", out->num_loops); + + for (size_t i = 0; i < out->num_loops; i++) { + wav_loop loop; + FREAD(in, &loop, sizeof(loop)); + loop.cue_point_index = le32toh(loop.cue_point_index); + loop.type = le32toh(loop.type); + loop.start = le32toh(loop.start); + loop.end = le32toh(loop.end); + loop.fraction = le32toh(loop.fraction); + loop.num = le32toh(loop.num); + + loop_type type; + switch (loop.type) { + case 0: + type = LOOP_FORWARD; + break; + + case 1: + type = LOOP_FORWARD_BACKWARD; + break; + + case 2: + type = LOOP_BACKWARD; + break; + + default: + error("Unrecognized loop type in wav"); + } + + out->loops[i].id = i; + out->loops[i].type = type; + out->loops[i].start = loop.start; + out->loops[i].end = loop.end; + out->loops[i].fraction = loop.fraction; + out->loops[i].num = loop.num; + } + } + has_smpl = true; + } break; + + case CC4('z', 'z', 'b', 'k'): { + char vadpcmcodes[12]; + uint16_t version; + uint16_t order; + uint16_t npredictors; + + FREAD(in, vadpcmcodes, sizeof(vadpcmcodes)); + FREAD(in, &version, sizeof(version)); + version = le16toh(version); + FREAD(in, &order, sizeof(order)); + order = le16toh(order); + FREAD(in, &npredictors, sizeof(npredictors)); + npredictors = le16toh(npredictors); + + size_t book_size = VADPCM_BOOK_SIZE(order, npredictors); + size_t book_data_size = sizeof(int16_t) * book_size; + int16_t *book_data = + MALLOC_CHECKED_INFO(book_data_size, "order=%u, npredictors=%u", order, npredictors); + FREAD(in, book_data, book_data_size); + + out->vadpcm.book_header.order = order; + out->vadpcm.book_header.npredictors = npredictors; + out->vadpcm.book_data = book_data; + + for (size_t i = 0; i < book_size; i++) { + out->vadpcm.book_data[i] = le16toh(out->vadpcm.book_data[i]); + } + + out->vadpcm.has_book = true; + } break; + + case CC4('z', 'z', 'l', 'p'): { + uint16_t version; + uint16_t nloops; + + FREAD(in, &version, sizeof(version)); + version = le16toh(version); + FREAD(in, &nloops, sizeof(nloops)); + nloops = le16toh(nloops); + + if (nloops != 0) + out->vadpcm.loops = MALLOC_CHECKED_INFO(nloops * sizeof(ALADPCMloop), "nloops=%u", nloops); + + for (size_t i = 0; i < nloops; i++) { + uint32_t loop_start; + uint32_t loop_end; + uint32_t loop_num; + + FREAD(in, &loop_start, sizeof(loop_start)); + loop_start = le32toh(loop_start); + FREAD(in, &loop_end, sizeof(loop_end)); + loop_end = le32toh(loop_end); + FREAD(in, &loop_num, sizeof(loop_num)); + loop_num = le32toh(loop_num); + + out->vadpcm.loops[i].start = loop_start; + out->vadpcm.loops[i].end = loop_end; + out->vadpcm.loops[i].count = loop_num; + + if (out->vadpcm.loops[i].count != 0) { + FREAD(in, out->vadpcm.loops[i].state, sizeof(out->vadpcm.loops[i].state)); + + for (size_t j = 0; j < ARRAY_COUNT(out->vadpcm.loops[i].state); j++) { + out->vadpcm.loops[i].state[j] = le16toh(out->vadpcm.loops[i].state[j]); + } + } + } + } break; + + default: + warning("Skipping unknown wav chunk: \"%c%c%c%c\"", cc4[0], cc4[1], cc4[2], cc4[3]); + skipped = true; + break; + } + + long read_size = ftell(in) - start - 8; + + if (read_size > chunk_size) + error("overran chunk"); + else if (!skipped && read_size < chunk_size) + warning("did not read entire %*s chunk: %lu vs %u", 4, cc4, read_size, chunk_size); + + fseek(in, start + 8 + chunk_size, SEEK_SET); + } + + if (!has_fmt) + error("wav has no fmt chunk"); + if (!has_data) + error("wav has no data chunk"); + + if (!has_fact) { + out->num_samples = out->data_size / (out->bit_depth / 8); + } + + if (!has_inst) { + out->base_note = 60; // C4 + out->fine_tune = 0; + out->gain = 0; + out->key_low = 0; + out->key_hi = 0; + out->vel_low = 0; + out->vel_hi = 0; + } + + if (!has_smpl) { + out->num_loops = 0; + out->loops = NULL; + } + + if (out->data_type == SAMPLE_TYPE_PCM16) { + if (out->data_size % 2 != 0) + error("wav data size is not a multiple of 2 despite being pcm16-formatted?"); + + for (size_t i = 0; i < out->data_size / 2; i++) + ((uint16_t *)(out->data))[i] = le16toh(((uint16_t *)(out->data))[i]); + } + + fclose(in); + return 0; +} + +int +wav_write(container_data *in, const char *path, bool matching) +{ + long chunk_start; + + FILE *out = fopen(path, "wb"); + FWRITE(out, "RIFF\0\0\0\0WAVE", 12); + + uint16_t fmt_type; + switch (in->data_type) { + case SAMPLE_TYPE_PCM16: + fmt_type = WAVE_TYPE_PCM; + break; + + default: + error("Unrecognized sample type for wav output"); + break; + } + + wav_fmt fmt = { + .type = htole16(fmt_type), + .num_channels = htole16(in->num_channels), + .sample_rate = htole32(in->sample_rate), + .byte_rate = htole32(in->sample_rate * (in->bit_depth / 8)), + .block_align = htole16(in->num_channels * (in->bit_depth / 8)), + .bit_depth = htole16(in->bit_depth), + }; + CHUNK_BEGIN(out, "fmt ", &chunk_start); + CHUNK_WRITE(out, &fmt); + CHUNK_END(out, chunk_start, htole32); + + wav_fact fact = { + .num_samples = htole32(in->num_samples), + }; + CHUNK_BEGIN(out, "fact", &chunk_start); + CHUNK_WRITE(out, &fact); + CHUNK_END(out, chunk_start, htole32); + + if (in->data_type == SAMPLE_TYPE_PCM16) { + assert(in->bit_depth == 16); + assert(in->data_size % 2 == 0); + + for (size_t i = 0; i < in->data_size / 2; i++) { + ((uint16_t *)in->data)[i] = htole16(((uint16_t *)in->data)[i]); + } + } + + CHUNK_BEGIN(out, "data", &chunk_start); + CHUNK_WRITE_RAW(out, in->data, in->data_size); + CHUNK_END(out, chunk_start, htole32); + + wav_inst inst = { + .base_note = in->base_note, + .fine_tune = in->fine_tune, + .gain = in->gain, + .key_low = in->key_low, + .key_hi = in->key_hi, + .vel_low = in->vel_low, + .vel_hi = in->vel_hi, + ._pad = { 0 }, + }; + CHUNK_BEGIN(out, "inst", &chunk_start); + CHUNK_WRITE(out, &inst); + CHUNK_END(out, chunk_start, htole32); + + wav_smpl smpl = { + .manufacturer = 0, + .product = 0, + .sample_period = 0, + .unity_note = 0, + ._pad = {0, 0, 0}, + .fine_tune = 0, + .format = 0, + .offset = 0, + .num_sample_loops = htole32(in->num_loops), + .sampler_data = 0, + }; + CHUNK_BEGIN(out, "smpl", &chunk_start); + CHUNK_WRITE(out, &smpl); + for (size_t i = 0; i < in->num_loops; i++) { + uint32_t wav_loop_type; + switch (in->loops[i].type) { + case LOOP_FORWARD: + wav_loop_type = 0; + break; + + case LOOP_FORWARD_BACKWARD: + wav_loop_type = 1; + break; + + case LOOP_BACKWARD: + wav_loop_type = 2; + break; + + default: + error("Unrecognized loop type for wav output"); + } + + wav_loop loop = { + .cue_point_index = 0, + .type = htole32(wav_loop_type), + .start = htole32(in->loops[i].start), + .end = htole32(in->loops[i].end), + .fraction = htole32(in->loops[i].fraction), + .num = htole32(in->loops[i].num), + }; + CHUNK_WRITE(out, &loop); + } + CHUNK_END(out, chunk_start, htole32); + + // Books generally don't match on round-trip, if matching we should write a vadpcm book chunk to the uncompressed + // output so it may be read back when re-encoding. + if (in->vadpcm.has_book && matching) { + uint32_t book_size = VADPCM_BOOK_SIZE(in->vadpcm.book_header.order, in->vadpcm.book_header.npredictors); + + uint16_t version = htole16(in->vadpcm.book_version); + uint16_t order = htole16(in->vadpcm.book_header.order); + uint16_t npredictors = htole16(in->vadpcm.book_header.npredictors); + + int16_t book_state[book_size]; + for (size_t i = 0; i < book_size; i++) { + book_state[i] = htole16(in->vadpcm.book_data[i]); + } + + CHUNK_BEGIN(out, "zzbk", &chunk_start); + CHUNK_WRITE_RAW(out, "VADPCMCODES", sizeof("VADPCMCODES")); + CHUNK_WRITE(out, &version); + CHUNK_WRITE(out, &order); + CHUNK_WRITE(out, &npredictors); + CHUNK_WRITE_RAW(out, book_state, sizeof(int16_t) * book_size); + CHUNK_END(out, chunk_start, htole32); + } + + // Loop states match on round-trip while books don't, so don't write a vadpcm loop chunk if the output format + // is uncompressed. + if (in->vadpcm.num_loops != 0 && in->data_type != SAMPLE_TYPE_PCM16) { + CHUNK_BEGIN(out, "zzlp", &chunk_start); + + for (size_t i = 0; i < in->vadpcm.num_loops; i++) { + uint32_t loop_start = htole32(in->vadpcm.loops[i].start); + uint32_t loop_end = htole32(in->vadpcm.loops[i].end); + uint32_t loop_count = htole32(in->vadpcm.loops[i].count); + + int16_t loop_state[16]; + for (size_t j = 0; j < ARRAY_COUNT(in->vadpcm.loops[i].state); j++) { + loop_state[j] = htole16(in->vadpcm.loops[i].state[j]); + } + + CHUNK_WRITE(out, &loop_start); + CHUNK_WRITE(out, &loop_end); + CHUNK_WRITE(out, &loop_count); + CHUNK_WRITE_RAW(out, loop_state, sizeof(loop_state)); + } + + CHUNK_END(out, chunk_start, htole32); + } + + uint32_t size = htole32(ftell(out) - 8); + fseek(out, 4, SEEK_SET); + fwrite(&size, 4, 1, out); + fclose(out); + + return 0; +} diff --git a/tools/audio/sampleconv/src/container/wav.h b/tools/audio/sampleconv/src/container/wav.h new file mode 100644 index 0000000000..71e6416909 --- /dev/null +++ b/tools/audio/sampleconv/src/container/wav.h @@ -0,0 +1,20 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef WAV_H +#define WAV_H + +#include "../codec/vadpcm.h" +#include "container.h" + +int +wav_write(container_data *in, const char *path, bool matching); +int +wav_read(container_data *out, const char *path, bool matching); + +#endif diff --git a/tools/audio/sampleconv/src/main.c b/tools/audio/sampleconv/src/main.c new file mode 100644 index 0000000000..6c839bd828 --- /dev/null +++ b/tools/audio/sampleconv/src/main.c @@ -0,0 +1,209 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include +#include +#include +#include +#include +#include +#include + +#include "util.h" + +#include "codec/codec.h" +#include "codec/uncompressed.h" +#include "codec/vadpcm.h" + +#include "container/container.h" +#include "container/wav.h" +#include "container/aiff.h" + +static const codec_spec codecs[] = { + {"pcm16", SAMPLE_TYPE_PCM16, 16, false, pcm16_enc_dec, pcm16_enc_dec}, + { "vadpcm", SAMPLE_TYPE_VADPCM, 9, true, vadpcm_dec, vadpcm_enc }, + { "vadpcm-half", SAMPLE_TYPE_VADPCM_HALF, 5, true, vadpcm_dec, vadpcm_enc }, + // { "pcm8", SAMPLE_TYPE_PCM8, TODO, TODO, pcm8_dec, pcm8_enc }, +}; + +static const container_spec containers[] = { + {".wav", wav_read, wav_write }, + { ".aiff", aiff_read, aiff_write}, + { ".aifc", aifc_read, aifc_write}, +}; + +static bool +str_endswith(const char *str1, const char *str2) +{ + size_t len1 = strlen(str1); + size_t len2 = strlen(str2); + + if (len2 > len1) + return false; + return strequ(str1 + len1 - len2, str2); +} + +NORETURN static void +help(const char *progname) +{ + fprintf(stderr, "%s [--matching] out_codec_name in_path out_path\n", progname); + fprintf(stderr, "Supported codecs:\n"); + fprintf(stderr, " pcm16\n"); + fprintf(stderr, " vadpcm\n"); + fprintf(stderr, " vadpcm-half\n"); + fprintf(stderr, "Possible input/output formats with supported codecs, automatically selected by file extension:\n"); + fprintf(stderr, " wav [pcm16]\n"); + fprintf(stderr, " aiff [pcm16]\n"); + fprintf(stderr, " aifc [vadpcm, vadpcm-half]\n"); + exit(EXIT_FAILURE); +} + +NORETURN static void +usage(const char *progname) +{ + fprintf(stderr, "%s [--matching] out_codec_name in_path out_path\n", progname); + exit(EXIT_FAILURE); +} + +static const codec_spec * +codec_from_name(const char *name) +{ + for (size_t i = 0; i < ARRAY_COUNT(codecs); i++) { + if (strequ(name, codecs[i].name)) + return &codecs[i]; + } + return NULL; +} + +static const codec_spec * +codec_from_type(sample_data_type type) +{ + for (size_t i = 0; i < ARRAY_COUNT(codecs); i++) { + if (type == codecs[i].type) + return &codecs[i]; + } + return NULL; +} + +static const container_spec * +container_from_name(const char *name) +{ + for (size_t i = 0; i < ARRAY_COUNT(containers); i++) { + if (str_endswith(name, containers[i].fext)) + return &containers[i]; + } + return NULL; +} + +int +main(int argc, char **argv) +{ + const char *progname = argv[0]; + // Required arguments + const char *in_path = NULL; + const char *out_path = NULL; + const char *out_codec_name = NULL; + // Optional arguments + enc_dec_opts opts = { + .matching = false, + // VADPCM + .truncate = false, + .min_loop_length = 800, + .design.order = 2, + .design.bits = 2, + .design.refine_iters = 2, + .design.thresh = 10.0, + .design.frame_size = 16, + }; + + // parse args + +#define arg_error(fmt, ...) \ + do { \ + fprintf(stderr, fmt "\n", ##__VA_ARGS__); \ + usage(progname); \ + } while (0) + + int argn = 0; + for (int i = 1; i < argc; i++) { + if (argv[i][0] == '-') { + // Optional args + + if (strequ(argv[i], "--help")) { + help(progname); + } else if (strequ(argv[i], "--matching")) { + if (opts.matching) + arg_error("Received --matching option twice"); + + opts.matching = true; + continue; + } + arg_error("Unknown option \"%s\"", argv[i]); + } else { + // Required args + + switch (argn) { + case 0: + out_codec_name = argv[i]; + break; + case 1: + in_path = argv[i]; + break; + case 2: + out_path = argv[i]; + break; + default: + arg_error("Unknown positional argument \"%s\"", argv[i]); + break; + } + argn++; + } + } + if (argn != 3) + arg_error("Not enough positional arguments"); + +#undef arg_error + + const container_spec *in_container = container_from_name(in_path); + if (in_container == NULL) + error("Unsupported input format"); + + const container_spec *out_container = container_from_name(out_path); + if (out_container == NULL) + error("Unsupported output format"); + + const codec_spec *out_codec = codec_from_name(out_codec_name); + if (out_codec == NULL) + error("Unrecognized output codec: \"%s\"", out_codec_name); + + container_data ctnr; + + // Read input from container + if (in_container->read(&ctnr, in_path, opts.matching)) + error("Error reading input file"); + + // Determine input codec from input container automatically + const codec_spec *in_codec = codec_from_type(ctnr.data_type); + if (in_codec == NULL) + error("Unrecognized input codec: type=%d", ctnr.data_type); + + // Decode to PCM16 (this does nothing if in_codec is PCM16) + if (in_codec->decode(&ctnr, in_codec, &opts)) + error("Error in decoding"); + + // Encode to output (this does nothing if out_codec is PCM16) + if (out_codec->encode(&ctnr, out_codec, &opts)) + error("Error in encoding"); + + // Write output to container + if (out_container->write(&ctnr, out_path, opts.matching)) + error("Error reading output file"); + + container_destroy(&ctnr); + return EXIT_SUCCESS; +} diff --git a/tools/audio/sampleconv/src/util.c b/tools/audio/sampleconv/src/util.c new file mode 100644 index 0000000000..43219db74c --- /dev/null +++ b/tools/audio/sampleconv/src/util.c @@ -0,0 +1,43 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include +#include +#include + +#include "util.h" + +NORETURN void +error(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + fprintf(stderr, "\x1b[91m" + "Error: " + "\x1b[97m"); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\x1b[0m" + "\n"); + va_end(ap); + + exit(EXIT_FAILURE); +} + +void +warning(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + fprintf(stderr, "\x1b[95m" + "Warning: " + "\x1b[97m"); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\x1b[0m" + "\n"); + va_end(ap); +} diff --git a/tools/audio/sampleconv/src/util.h b/tools/audio/sampleconv/src/util.h new file mode 100644 index 0000000000..0c1c0e1792 --- /dev/null +++ b/tools/audio/sampleconv/src/util.h @@ -0,0 +1,116 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef UTIL_H +#define UTIL_H + +#include + +// Endian + +#if defined(__linux__) || defined(__CYGWIN__) +#include +#elif defined(__APPLE__) +#include + +#define htobe16(x) OSSwapHostToBigInt16(x) +#define htole16(x) OSSwapHostToLittleInt16(x) +#define be16toh(x) OSSwapBigToHostInt16(x) +#define le16toh(x) OSSwapLittleToHostInt16(x) + +#define htobe32(x) OSSwapHostToBigInt32(x) +#define htole32(x) OSSwapHostToLittleInt32(x) +#define be32toh(x) OSSwapBigToHostInt32(x) +#define le32toh(x) OSSwapLittleToHostInt32(x) + +#define htobe64(x) OSSwapHostToBigInt64(x) +#define htole64(x) OSSwapHostToLittleInt64(x) +#define be64toh(x) OSSwapBigToHostInt64(x) +#define le64toh(x) OSSwapLittleToHostInt64(x) +#else +#error "Endian conversion unsupported, add it" +#endif + +#define ARRAY_COUNT(arr) (sizeof(arr) / sizeof((arr)[0])) + +#define NORETURN __attribute__((noreturn)) +#define UNUSED __attribute__((unused)) + +#define strequ(s1, s2) ((__builtin_constant_p(s2) ? strncmp(s1, s2, sizeof(s2) - 1) : strcmp(s1, s2)) == 0) + +#define MALLOC_CHECKED(length) \ + ({ \ + size_t malloc_len_ = (size_t)(length); \ + void *result_ = malloc(malloc_len_); \ + if (result_ == NULL) \ + error("[malloc] Failed to allocate %lu bytes @ [%s:%u]", malloc_len_, __FILE__, __LINE__); \ + result_; \ + }) + +#define MALLOC_CHECKED_INFO(length, fmt, ...) \ + ({ \ + size_t malloc_len_ = (size_t)(length); \ + void *result_ = malloc(malloc_len_); \ + if (result_ == NULL) \ + error("[malloc] Failed to allocate %lu bytes @ [%s:%u] (" fmt ")", malloc_len_, __FILE__, __LINE__, \ + ##__VA_ARGS__); \ + result_; \ + }) + +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) + +#define ABS(x) (((x) < 0) ? (-(x)) : (x)) + +#define FWRITE(file, data, size) \ + do { \ + if (fwrite((data), (size), 1, (file)) != 1) { \ + error("[%s:%d] Could not write %lu bytes to file", __FILE__, __LINE__, (size_t)(size)); \ + } \ + } while (0) + +#define FREAD(file, data, size) \ + do { \ + if (fread((data), (size), 1, (file)) != 1) { \ + error("[%s:%d] Could not read %lu bytes from file", __FILE__, __LINE__, (size_t)(size)); \ + } \ + } while (0) + +#define CC4_CHECK(buf, str) \ + ((buf)[0] == (str)[0] && (buf)[1] == (str)[1] && (buf)[2] == (str)[2] && (buf)[3] == (str)[3]) + +#define CC4(c1, c2, c3, c4) (((c1) << 24) | ((c2) << 16) | ((c3) << 8) | (c4)) + +#define CHUNK_BEGIN(file, name, start) \ + do { \ + *(start) = ftell(out); \ + FWRITE(file, name "\0\0\0\0", 8); \ + } while (0) + +#define CHUNK_WRITE(file, structure) \ + do { \ + FWRITE(file, structure, sizeof(*(structure))); \ + } while (0) + +#define CHUNK_WRITE_RAW(file, data, length) FWRITE(file, data, length) + +#define CHUNK_END(file, start, endian_func) \ + do { \ + long end = ftell(out); \ + uint32_t size = endian_func(end - (start)-8); \ + fseek(out, (start) + 4, SEEK_SET); \ + FWRITE(out, &size, 4); \ + fseek(out, end, SEEK_SET); \ + } while (0) + +__attribute__((format(printf, 1, 2))) NORETURN void +error(const char *fmt, ...); + +__attribute__((format(printf, 1, 2))) void +warning(const char *fmt, ...); + +#endif diff --git a/tools/audio/sfpatch.c b/tools/audio/sfpatch.c new file mode 100644 index 0000000000..05029e0db0 --- /dev/null +++ b/tools/audio/sfpatch.c @@ -0,0 +1,57 @@ +/* SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET */ +/* SPDX-License-Identifier: CC0-1.0 */ +#include +#include +#include +#include +#include +#include + +#include "elf32.h" +#include "util.h" + +/** + * Converts symbols defined in an ELF file to ABS symbols so their values remain + * unchanged after linking against them. This is used for soundfonts as references + * to symbols defined in the soundfont should remain file-relative even after the + * final link. + */ +int +main(int argc, char **argv) +{ + if (argc < 3) { + fprintf(stderr, "Usage: %s in.elf out.elf\n", argv[0]); + return EXIT_FAILURE; + } + + // read input elf file + + size_t data_size; + void *data = elf32_read(argv[1], &data_size); + + // locate symtab + + Elf32_Shdr *symtab = elf32_get_symtab(data, data_size); + if (symtab == NULL) + error("Symtab not found"); + + uint32_t sh_offset = elf32_read32(symtab->sh_offset); + uint32_t sh_size = elf32_read32(symtab->sh_size); + + // patch defined symbols to be ABS + + Elf32_Sym *sym = GET_PTR(data, sh_offset); + Elf32_Sym *sym_end = GET_PTR(data, sh_offset + sh_size); + + for (size_t i = 0; sym < sym_end; sym++, i++) { + validate_read(sh_offset + i * sizeof(Elf32_Sym), sizeof(Elf32_Sym), data_size); + + if (elf32_read16(sym->st_shndx) != SHN_UND) + sym->st_shndx = elf32_write16(SHN_ABS); + } + + // write output elf file + + util_write_whole_file(argv[2], data, data_size); + return EXIT_SUCCESS; +} diff --git a/tools/audio/soundfont.c b/tools/audio/soundfont.c new file mode 100644 index 0000000000..d664fdd238 --- /dev/null +++ b/tools/audio/soundfont.c @@ -0,0 +1,70 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include "soundfont.h" +#include "xml.h" +#include "util.h" + +envelope_data * +sf_get_envelope(soundfont *sf, const char *name) +{ + LL_FOREACH(envelope_data *, env, sf->envelopes) { + if (env->points != NULL && strequ(name, env->name)) + return env; + } + return NULL; +} + +sample_data * +sample_data_forname(soundfont *sf, const char *name) +{ + LL_FOREACH(sample_data *, sample, sf->samples) { + if (strequ(sample->name, name)) + return sample; + } + return NULL; +} + +void +read_soundfont_info(soundfont *sf, xmlNodePtr node) +{ + static const xml_attr_spec spec = { + {"Name", false, xml_parse_c_identifier, offsetof(soundfont, info.name) }, + { "Index", false, xml_parse_int, offsetof(soundfont, info.index) }, + { "Medium", false, xml_parse_c_identifier, offsetof(soundfont, info.medium) }, + { "CachePolicy", false, xml_parse_c_identifier, offsetof(soundfont, info.cache_policy) }, + { "SampleBank", false, xml_parse_string, offsetof(soundfont, info.bank_path) }, + { "Indirect", true, xml_parse_int, offsetof(soundfont, info.pointer_index) }, + { "SampleBankDD", true, xml_parse_string, offsetof(soundfont, info.bank_path_dd) }, + { "IndirectDD", true, xml_parse_int, offsetof(soundfont, info.pointer_index_dd) }, + { "LoopsHaveFrames", true, xml_parse_bool, offsetof(soundfont, info.loops_have_frames)}, + { "NumInstruments", true, xml_parse_uint, offsetof(soundfont, info.num_instruments) }, + { "PadToSize", true, xml_parse_uint, offsetof(soundfont, info.pad_to_size) }, + }; + sf->info.num_instruments = 0; + sf->info.num_drums = 0; + sf->info.num_effects = 0; + sf->info.bank_path_dd = NULL; + sf->info.pointer_index = -1; + sf->info.pointer_index_dd = -1; + sf->info.loops_have_frames = false; + sf->info.pad_to_size = 0; + xml_parse_node_by_spec(sf, node, spec, ARRAY_COUNT(spec)); + + xmlDocPtr sb_doc = xmlReadFile(sf->info.bank_path, NULL, XML_PARSE_NONET); + if (sb_doc == NULL) + error("Failed to read sample bank xml file \"%s\"", sf->info.bank_path); + read_samplebank_xml(&sf->sb, sb_doc); + + if (sf->info.bank_path_dd != NULL) { + xmlDocPtr sbdd_doc = xmlReadFile(sf->info.bank_path_dd, NULL, XML_PARSE_NONET); + if (sbdd_doc == NULL) + error("Failed to read sample bank xml file \"%s\"", sf->info.bank_path); + read_samplebank_xml(&sf->sbdd, sbdd_doc); + } +} diff --git a/tools/audio/soundfont.h b/tools/audio/soundfont.h new file mode 100644 index 0000000000..eeed712de2 --- /dev/null +++ b/tools/audio/soundfont.h @@ -0,0 +1,170 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef SOUNDFONT_H_ +#define SOUNDFONT_H_ + +#include + +#include "aifc.h" +#include "samplebank.h" + +// special delay values +#define ADSR_DISABLE 0 +#define ADSR_HANG -1 +#define ADSR_GOTO -2 +#define ADSR_RESTART -3 + +#define INSTR_LO_NONE 0 +#define INSTR_HI_NONE 127 + +typedef struct sample_data { + struct sample_data *next; + + const char *name; + double sample_rate; + int8_t base_note; + bool is_dd; + bool cached; + aifc_data aifc; +} sample_data; + +typedef struct { + int16_t delay; + int16_t arg; +} envelope_point; + +typedef struct envelope_data { + struct envelope_data *next; + + const char *name; + uint8_t release; + envelope_point *points; + size_t n_points; + bool used; +} envelope_data; + +typedef struct instr_data { + struct instr_data *next; + + unsigned int program_number; + const char *name; + const char *envelope_name; + + // for matching only + bool unused; + + // these are provided as-is for unused (name == NULL) otherwise they are read from the aifc file + double sample_rate_mid; + double sample_rate_lo; + double sample_rate_hi; + int8_t base_note_mid; + int8_t base_note_lo; + int8_t base_note_hi; + + envelope_data *envelope; + uint16_t release; + const char *sample_name_low; + const char *sample_name_mid; + const char *sample_name_high; + int8_t sample_low_end; + int8_t sample_high_start; + sample_data *sample_low; + sample_data *sample_mid; + sample_data *sample_high; + float sample_low_tuning; + float sample_mid_tuning; + float sample_high_tuning; +} instr_data; + +typedef struct drum_data { + struct drum_data *next; + + const char *name; + const char *sample_name; + const char *envelope_name; + envelope_data *envelope; + uint16_t release; + int8_t note; + int8_t note_start; + int8_t note_end; + int pan; + sample_data *sample; + double sample_rate; + int8_t base_note; +} drum_data; + +typedef struct sfx_data { + struct sfx_data *next; + + const char *name; + const char *sample_name; + sample_data *sample; + double sample_rate; + int8_t base_note; + float tuning; +} sfx_data; + +typedef struct { + bool matching; + + struct { + const char *name; + const char *symbol; + int index; + const char *medium; + const char *cache_policy; + const char *bank_path; + int pointer_index; + const char *bank_path_dd; + int pointer_index_dd; + unsigned int pad_to_size; + unsigned int num_instruments; // or the maximum program number (+1), since this also includes empty slots + // between instruments + unsigned int num_drums; + unsigned int num_effects; + bool loops_have_frames; + } info; + + uint32_t program_number_bitset[4]; + + envelope_data *envelopes; + envelope_data *envelope_last; + + samplebank sb; + samplebank sbdd; + + sample_data *samples; + sample_data *sample_last; + + instr_data *instruments; + instr_data *instrument_last; + + drum_data *drums; + drum_data *drums_last; + + sfx_data *sfx; + sfx_data *sfx_last; + + uint8_t *match_padding; + size_t match_padding_num; +} soundfont; + +#define NOTE_UNSET (INT8_MIN) +#define RELEASE_UNSET (UINT16_MAX) + +envelope_data * +sf_get_envelope(soundfont *sf, const char *name); + +sample_data * +sample_data_forname(soundfont *sf, const char *name); + +void +read_soundfont_info(soundfont *sf, xmlNodePtr node); + +#endif diff --git a/tools/audio/soundfont_compiler.c b/tools/audio/soundfont_compiler.c new file mode 100644 index 0000000000..c8ba9633c6 --- /dev/null +++ b/tools/audio/soundfont_compiler.c @@ -0,0 +1,1815 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "xml.h" +#include "aifc.h" +#include "samplebank.h" +#include "soundfont.h" +#include "util.h" + +static_assert(sizeof(float) == sizeof(uint32_t), "Float is assumed to be 32-bit"); + +static float +i2f(uint32_t i) +{ + union { + float f; + uint32_t i; + } fi; + + fi.i = i; + return fi.f; +} + +static uint32_t +f2i(float f) +{ + union { + float f; + uint32_t i; + } fi; + + fi.f = f; + return fi.i; +} + +static int +midinote_to_z64note(int note) +{ + // Converts from MIDI note number (middle C = 60) to Z64 note number (middle C = 39) + int z64note = note - 21; + if (z64note < 0) // % 128 + z64note += 128; + return z64note; +} + +/** + * Calculate the tuning value from a given samplerate and basenote. + * + * Uses a lookup table (gPitchFrequencies from the audio driver source) to compute the result of `2^(basenote / 12)` + * (with appropriate shifting such that the index for C4 results in 1.0) + */ +static float +calc_tuning(float sample_rate, int basenote) +{ + static const float playback_sample_rate = 32000.0f; // Target samplerate in-game is 32KHz + static const float pitch_frequencies[] = { + // gPitchFrequencies in audio driver source + /* 0x00 */ 0.105112f, // PITCH_A0 + /* 0x01 */ 0.111362f, // PITCH_BF0 + /* 0x02 */ 0.117984f, // PITCH_B0 + /* 0x03 */ 0.125f, // PITCH_C1 + /* 0x04 */ 0.132433f, // PITCH_DF1 + /* 0x05 */ 0.140308f, // PITCH_D1 + /* 0x06 */ 0.148651f, // PITCH_EF1 + /* 0x07 */ 0.15749f, // PITCH_E1 + /* 0x08 */ 0.166855f, // PITCH_F1 + /* 0x09 */ 0.176777f, // PITCH_GF1 + /* 0x0A */ 0.187288f, // PITCH_G1 + /* 0x0B */ 0.198425f, // PITCH_AF1 + /* 0x0C */ 0.210224f, // PITCH_A1 + /* 0x0D */ 0.222725f, // PITCH_BF1 + /* 0x0E */ 0.235969f, // PITCH_B1 + /* 0x0F */ 0.25f, // PITCH_C2 + /* 0x10 */ 0.264866f, // PITCH_DF2 + /* 0x11 */ 0.280616f, // PITCH_D2 + /* 0x12 */ 0.297302f, // PITCH_EF2 + /* 0x13 */ 0.31498f, // PITCH_E2 + /* 0x14 */ 0.33371f, // PITCH_F2 + /* 0x15 */ 0.353553f, // PITCH_GF2 + /* 0x16 */ 0.374577f, // PITCH_G2 + /* 0x17 */ 0.39685f, // PITCH_AF2 + /* 0x18 */ 0.420448f, // PITCH_A2 + /* 0x19 */ 0.445449f, // PITCH_BF2 + /* 0x1A */ 0.471937f, // PITCH_B2 + /* 0x1B */ 0.5f, // PITCH_C3 + /* 0x1C */ 0.529732f, // PITCH_DF3 + /* 0x1D */ 0.561231f, // PITCH_D3 + /* 0x1E */ 0.594604f, // PITCH_EF3 + /* 0x1F */ 0.629961f, // PITCH_E3 + /* 0x20 */ 0.66742f, // PITCH_F3 + /* 0x21 */ 0.707107f, // PITCH_GF3 + /* 0x22 */ 0.749154f, // PITCH_G3 + /* 0x23 */ 0.793701f, // PITCH_AF3 + /* 0x24 */ 0.840897f, // PITCH_A3 + /* 0x25 */ 0.890899f, // PITCH_BF3 + /* 0x26 */ 0.943875f, // PITCH_B3 + /* 0x27 */ 1.0f, // PITCH_C4 (Middle C) + /* 0x28 */ 1.059463f, // PITCH_DF4 + /* 0x29 */ 1.122462f, // PITCH_D4 + /* 0x2A */ 1.189207f, // PITCH_EF4 + /* 0x2B */ 1.259921f, // PITCH_E4 + /* 0x2C */ 1.33484f, // PITCH_F4 + /* 0x2D */ 1.414214f, // PITCH_GF4 + /* 0x2E */ 1.498307f, // PITCH_G4 + /* 0x2F */ 1.587401f, // PITCH_AF4 + /* 0x30 */ 1.681793f, // PITCH_A4 + /* 0x31 */ 1.781798f, // PITCH_BF4 + /* 0x32 */ 1.887749f, // PITCH_B4 + /* 0x33 */ 2.0f, // PITCH_C5 + /* 0x34 */ 2.118926f, // PITCH_DF5 + /* 0x35 */ 2.244924f, // PITCH_D5 + /* 0x36 */ 2.378414f, // PITCH_EF5 + /* 0x37 */ 2.519842f, // PITCH_E5 + /* 0x38 */ 2.66968f, // PITCH_F5 + /* 0x39 */ 2.828428f, // PITCH_GF5 + /* 0x3A */ 2.996615f, // PITCH_G5 + /* 0x3B */ 3.174803f, // PITCH_AF5 + /* 0x3C */ 3.363586f, // PITCH_A5 + /* 0x3D */ 3.563596f, // PITCH_BF5 + /* 0x3E */ 3.775498f, // PITCH_B5 + /* 0x3F */ 4.0f, // PITCH_C6 + /* 0x40 */ 4.237853f, // PITCH_DF6 + /* 0x41 */ 4.489849f, // PITCH_D6 + /* 0x42 */ 4.756829f, // PITCH_EF6 + /* 0x43 */ 5.039685f, // PITCH_E6 + /* 0x44 */ 5.33936f, // PITCH_F6 + /* 0x45 */ 5.656855f, // PITCH_GF6 + /* 0x46 */ 5.993229f, // PITCH_G6 + /* 0x47 */ 6.349606f, // PITCH_AF6 + /* 0x48 */ 6.727173f, // PITCH_A6 + /* 0x49 */ 7.127192f, // PITCH_BF6 + /* 0x4A */ 7.550996f, // PITCH_B6 + /* 0x4B */ 8.0f, // PITCH_C7 + /* 0x4C */ 8.475705f, // PITCH_DF7 + /* 0x4D */ 8.979697f, // PITCH_D7 + /* 0x4E */ 9.513658f, // PITCH_EF7 + /* 0x4F */ 10.07937f, // PITCH_E7 + /* 0x50 */ 10.6787205f, // PITCH_F7 + /* 0x51 */ 11.31371f, // PITCH_GF7 + /* 0x52 */ 11.986459f, // PITCH_G7 + /* 0x53 */ 12.699211f, // PITCH_AF7 + /* 0x54 */ 13.454346f, // PITCH_A7 + /* 0x55 */ 14.254383f, // PITCH_BF7 + /* 0x56 */ 15.101993f, // PITCH_B7 + /* 0x57 */ 16.0f, // PITCH_C8 + /* 0x58 */ 16.95141f, // PITCH_DF8 + /* 0x59 */ 17.959395f, // PITCH_D8 + /* 0x5A */ 19.027315f, // PITCH_EF8 + /* 0x5B */ 20.15874f, // PITCH_E8 + /* 0x5C */ 21.35744f, // PITCH_F8 + /* 0x5D */ 22.62742f, // PITCH_GF8 + /* 0x5E */ 23.972918f, // PITCH_G8 + /* 0x5F */ 25.398422f, // PITCH_AF8 + /* 0x60 */ 26.908691f, // PITCH_A8 + /* 0x61 */ 28.508766f, // PITCH_BF8 + /* 0x62 */ 30.203985f, // PITCH_B8 + /* 0x63 */ 32.0f, // PITCH_C9 + /* 0x64 */ 33.90282f, // PITCH_DF9 + /* 0x65 */ 35.91879f, // PITCH_D9 + /* 0x66 */ 38.05463f, // PITCH_EF9 + /* 0x67 */ 40.31748f, // PITCH_E9 + /* 0x68 */ 42.71488f, // PITCH_F9 + /* 0x69 */ 45.25484f, // PITCH_GF9 + /* 0x6A */ 47.945835f, // PITCH_G9 + /* 0x6B */ 50.796845f, // PITCH_AF9 + /* 0x6C */ 53.817383f, // PITCH_A9 + /* 0x6D */ 57.017532f, // PITCH_BF9 + /* 0x6E */ 60.40797f, // PITCH_B9 + /* 0x6F */ 64.0f, // PITCH_C10 + /* 0x70 */ 67.80564f, // PITCH_DF10 + /* 0x71 */ 71.83758f, // PITCH_D10 + /* 0x72 */ 76.10926f, // PITCH_EF10 + /* 0x73 */ 80.63496f, // PITCH_E10 + /* 0x74 */ 85.42976f, // PITCH_F10 + /* 0x75 */ 0.055681f, // PITCH_BFNEG1 + /* 0x76 */ 0.058992f, // PITCH_BNEG1 + /* 0x77 */ 0.0625f, // PITCH_C0 + /* 0x78 */ 0.066216f, // PITCH_DF0 + /* 0x79 */ 0.070154f, // PITCH_D0 + /* 0x7A */ 0.074325f, // PITCH_EF0 + /* 0x7B */ 0.078745f, // PITCH_E0 + /* 0x7C */ 0.083427f, // PITCH_F0 + /* 0x7D */ 0.088388f, // PITCH_GF0 + /* 0x7E */ 0.093644f, // PITCH_G0 + /* 0x7F */ 0.099213f, // PITCH_AF0 + }; + + return (sample_rate / playback_sample_rate) * pitch_frequencies[basenote]; +} + +void +read_envelopes_info(soundfont *sf, xmlNodePtr envelopes) +{ + static const xml_attr_spec spec_env = { + {"Name", false, xml_parse_c_identifier, offsetof(envelope_data, name) }, + { "Release", false, xml_parse_u8, offsetof(envelope_data, release)}, + }; + static const xml_attr_spec spec_env_pt = { + {"Delay", false, xml_parse_s16, offsetof(envelope_point, delay)}, + { "Arg", false, xml_parse_s16, offsetof(envelope_point, arg) }, + }; + static const xml_attr_spec spec_env_goto = { + {"Index", false, xml_parse_s16, offsetof(envelope_point, arg)}, + }; + + LL_FOREACH(xmlNodePtr, env, envelopes->children) { + if (env->type != XML_ELEMENT_NODE) + continue; + + const char *name = XMLSTR_TO_STR(env->name); + if (!strequ(name, "Envelope")) + error("Unexpected element node %s in envelopes list (line %d)", name, env->line); + + envelope_data *envdata; + + if (env->children == NULL) { + // Empty envelopes for mm + envdata = (envelope_data *)malloc(sizeof(envelope_data)); + envdata->name = NULL; + envdata->points = NULL; + envdata->release = 0; + envdata->n_points = 0; + } else { + size_t points_cap = 4; + size_t points_num = 0; + + void *envelopes_data = malloc(sizeof(envelope_data) + points_cap * sizeof(envelope_point)); + envdata = (envelope_data *)envelopes_data; + + xml_parse_node_by_spec(envdata, env, spec_env, ARRAY_COUNT(spec_env)); + + // Ensure name is unique + LL_FOREACH(envelope_data *, envdata2, sf->envelopes) { + if (envdata2->name != NULL && strequ(envdata->name, envdata2->name)) + error("Duplicate envelope name %s (second occurrence on line %d)", envdata->name, env->line); + } + + envelope_point *pts = (envelope_point *)(envdata + 1); + + LL_FOREACH(xmlNodePtr, env_pt, env->children) { + if (points_num >= points_cap) { + points_cap *= 2; + envelopes_data = + realloc(envelopes_data, sizeof(envelope_data) + points_cap * sizeof(envelope_point)); + envdata = (envelope_data *)envelopes_data; + pts = (envelope_point *)(envdata + 1); + } + + envelope_point *pt = &pts[points_num]; + + if (env_pt->type != XML_ELEMENT_NODE) + continue; + + const char *pt_name = XMLSTR_TO_STR(env_pt->name); + + if (strequ(pt_name, "Point")) { + xml_parse_node_by_spec(pt, env_pt, spec_env_pt, ARRAY_COUNT(spec_env_pt)); + } else if (strequ(pt_name, "Disable")) { + pt->delay = ADSR_DISABLE; + pt->arg = 0; + } else if (strequ(pt_name, "Goto")) { + pt->delay = ADSR_GOTO; + xml_parse_node_by_spec(pt, env_pt, spec_env_goto, ARRAY_COUNT(spec_env_goto)); + } else if (strequ(pt_name, "Restart")) { + pt->delay = ADSR_RESTART; + pt->arg = 0; + } else if (strequ(pt_name, "Hang")) { + pt->delay = ADSR_HANG; + pt->arg = 0; + // TODO force end here and don't emit an extra hang + } else { + error("Unexpected element node %s in envelope definition (line %d)", name, env->line); + } + + points_num++; + } + envdata->points = pts; + envdata->n_points = points_num; + } + + envdata->used = false; + + // link + if (sf->envelopes == NULL) { + sf->envelopes = envdata; + sf->envelope_last = envdata; + } else { + sf->envelope_last->next = envdata; + sf->envelope_last = envdata; + } + envdata->next = NULL; + } +} + +void +read_instrs_info(soundfont *sf, xmlNodePtr instrs) +{ + static const xml_attr_spec instr_spec = { + {"ProgramNumber", true, xml_parse_uint, offsetof(instr_data, program_number) }, + { "Name", true, xml_parse_c_identifier, offsetof(instr_data, name) }, + { "Envelope", false, xml_parse_c_identifier, offsetof(instr_data, envelope_name) }, + { "Release", true, xml_parse_u8, offsetof(instr_data, release) }, + + { "Sample", true, xml_parse_c_identifier, offsetof(instr_data, sample_name_mid) }, + { "BaseNote", true, xml_parse_note_number, offsetof(instr_data, base_note_mid) }, + { "SampleRate", true, xml_parse_double, offsetof(instr_data, sample_rate_mid) }, + + { "RangeLo", true, xml_parse_note_number, offsetof(instr_data, sample_low_end) }, + { "SampleLo", true, xml_parse_c_identifier, offsetof(instr_data, sample_name_low) }, + { "BaseNoteLo", true, xml_parse_note_number, offsetof(instr_data, base_note_lo) }, + { "SampleRateLo", true, xml_parse_double, offsetof(instr_data, sample_rate_lo) }, + + { "RangeHi", true, xml_parse_note_number, offsetof(instr_data, sample_high_start)}, + { "SampleHi", true, xml_parse_c_identifier, offsetof(instr_data, sample_name_high) }, + { "BaseNoteHi", true, xml_parse_note_number, offsetof(instr_data, base_note_hi) }, + { "SampleRateHi", true, xml_parse_double, offsetof(instr_data, sample_rate_hi) }, + }; + + LL_FOREACH(xmlNodePtr, instr_node, instrs->children) { + if (instr_node->type != XML_ELEMENT_NODE) + continue; + + const char *name = XMLSTR_TO_STR(instr_node->name); + + bool is_instr = strequ(name, "Instrument"); + bool is_instr_unused = strequ(name, "InstrumentUnused"); + + if (!is_instr && !is_instr_unused) + error("Unexpected element node %s in instrument list (line %d)", name, instr_node->line); + + instr_data *instr = malloc(sizeof(instr_data)); + + instr->program_number = (unsigned)-1; + instr->name = NULL; + instr->sample_name_low = NULL; + instr->sample_name_mid = NULL; + instr->sample_name_high = NULL; + instr->sample_low_end = INSTR_LO_NONE; + instr->sample_low = NULL; + instr->sample_high_start = INSTR_HI_NONE; + instr->sample_high = NULL; + instr->base_note_mid = NOTE_UNSET; + instr->base_note_lo = NOTE_UNSET; + instr->base_note_hi = NOTE_UNSET; + instr->sample_rate_mid = -1.0; + instr->sample_rate_lo = -1.0; + instr->sample_rate_hi = -1.0; + instr->release = RELEASE_UNSET; + instr->unused = is_instr_unused; + + xml_parse_node_by_spec(instr, instr_node, instr_spec, ARRAY_COUNT(instr_spec)); + + if (!is_instr_unused) { + // Check program number, midi program number range is 0-127 but the audio driver reserves 126 and 127 for + // sfx and percussion so the range we allow is 0-125 + if (instr->program_number >= 126) + error("Program numbers must be in the range 0-125 (got %u on line %d)", instr->program_number, + instr_node->line); + + // Ensure program number is unique + unsigned upper = instr->program_number >> 5 & 3; + unsigned lower = instr->program_number & 0x1F; + if (sf->program_number_bitset[upper] & (1 << lower)) + error("Duplicate program number %u (second occurrence on line %d)", instr->program_number, + instr_node->line); + sf->program_number_bitset[upper] |= (1 << lower); + + if (instr->program_number >= sf->info.num_instruments) + sf->info.num_instruments = instr->program_number + 1; + + // Check name + if (instr->name == NULL) + error("Instrument must be named (line %d)", instr_node->line); + } + + // Check envelope + instr->envelope = sf_get_envelope(sf, instr->envelope_name); + if (instr->envelope == NULL) + error("Bad envelope name %s (line %d)", instr->envelope_name, instr_node->line); + + // Validate optionals + if (instr->release == RELEASE_UNSET) + instr->release = instr->envelope->release; + + if (instr->sample_name_mid == NULL) { + // For a used instrument to have no sample path, it must have sample children and have specified at least + // one of RangeLo or RangeHi + + if (instr->sample_low_end == INSTR_LO_NONE && instr->sample_high_start == INSTR_HI_NONE) + error("Instrument has no mid sample but also does not define a low or high sample (line %d)", + instr_node->line); + + if (instr_node->children == NULL) + error("Instrument sample list is empty, must specify at least one sample (line %d)", instr_node->line); + + bool seen_low = false; + bool seen_mid = false; + bool seen_high = false; + + LL_FOREACH(xmlNodePtr, instr_sample_node, instr_node->children) { + if (instr_sample_node->type != XML_ELEMENT_NODE) + continue; + + const char *name = XMLSTR_TO_STR(instr_sample_node->name); + if (!strequ(name, "Sample")) + error("Unexpected element node %s in instrument sample list (line %d)", name, + instr_sample_node->line); + + if (instr_sample_node->properties == NULL) + error("Expected a Low/Mid/High sample path (line %d)", instr_sample_node->line); + + xmlAttrPtr attr = instr_sample_node->properties; + if (attr->next != NULL) + error("Instrument sample should have exactly one attribute (line %d)", instr_sample_node->line); + + const char *attr_name = XMLSTR_TO_STR(attr->name); + + bool *seen; + const char **name_ptr; + + if (strequ(attr_name, "Low")) { + seen = &seen_low; + name_ptr = &instr->sample_name_low; + + if (instr->sample_low_end == INSTR_LO_NONE) + error("Useless Low sample specified (RangeLo is 0) (line %d)", instr_sample_node->line); + } else if (strequ(attr_name, "Mid")) { + seen = &seen_mid; + name_ptr = &instr->sample_name_mid; + } else if (strequ(attr_name, "High")) { + seen = &seen_high; + name_ptr = &instr->sample_name_high; + + if (instr->sample_high_start == INSTR_HI_NONE) + error("Useless High sample specified (RangeHi is 127) (line %d)", instr_sample_node->line); + } else { + error("Unexpected attribute name for instrument sample (line %d)", instr_sample_node->line); + } + + if (*seen) + error("Duplicate \"%s\" sample specifier in instrument sample (line %d)", attr_name, + instr_sample_node->line); + *seen = true; + + xmlChar *xvalue = xmlNodeListGetString(instr_sample_node->doc, attr->children, 1); + const char *value = XMLSTR_TO_STR(xvalue); + xml_parse_c_identifier(value, name_ptr); + } + + if (!seen_mid && instr->sample_low_end != instr->sample_high_start) + error("Unset-but-used Mid sample (line %d)", instr_node->line); + if (!seen_low && instr->sample_low_end != 0) + error("Unset-but-used Low sample (line %d)", instr_node->line); + if (!seen_high && instr->sample_high_start != 0) + error("Unset-but-used High sample (line %d)", instr_node->line); + } + + if (instr->sample_name_low != NULL) { + instr->sample_low = sample_data_forname(sf, instr->sample_name_low); + if (instr->sample_low == NULL) + error("Bad sample name \"%s\" for LOW sample (line %d). Is it defined in ?", + instr->sample_name_low, instr_node->line); + + if (instr->base_note_lo == NOTE_UNSET) + instr->base_note_lo = instr->sample_low->base_note; + + if (instr->sample_rate_lo < 0.0) + instr->sample_rate_lo = instr->sample_low->sample_rate; + + instr->sample_low_tuning = calc_tuning(instr->sample_rate_lo, instr->base_note_lo); + } + + instr->sample_mid = sample_data_forname(sf, instr->sample_name_mid); + if (instr->sample_mid == NULL) + error("Bad sample name \"%s\" for MID sample (line %d). Is it defined in ?", + instr->sample_name_mid, instr_node->line); + + if (instr->base_note_mid == NOTE_UNSET) + instr->base_note_mid = instr->sample_mid->base_note; + + if (instr->sample_rate_mid < 0.0) + instr->sample_rate_mid = instr->sample_mid->sample_rate; + + instr->sample_mid_tuning = calc_tuning(instr->sample_rate_mid, instr->base_note_mid); + + // Some tuning values don't decompose properly into a samplerate and basenote, they must be accounted for here + // for matching. So far this has only been seen for an Instrument mid sample. + // NOTE: Keep in sync with the BAD_FLOATS list in extraction/tuning.py + if (f2i(instr->sample_mid_tuning) == 0x3E7319DF /* 0.237403377 */) // diff = 2^-24 + instr->sample_mid_tuning = i2f(0x3E7319E3 /* 0.237403437 */); + + if (instr->sample_name_high != NULL) { + instr->sample_high = sample_data_forname(sf, instr->sample_name_high); + if (instr->sample_high == NULL) + error("Bad sample name \"%s\" for HIGH sample (line %d). Is it defined in ?", + instr->sample_name_high, instr_node->line); + + if (instr->base_note_hi == NOTE_UNSET) + instr->base_note_hi = instr->sample_high->base_note; + + if (instr->sample_rate_hi < 0.0) + instr->sample_rate_hi = instr->sample_high->sample_rate; + + instr->sample_high_tuning = calc_tuning(instr->sample_rate_hi, instr->base_note_hi); + } + + // link + if (sf->instruments == NULL) { + sf->instruments = instr; + sf->instrument_last = instr; + } else { + sf->instrument_last->next = instr; + sf->instrument_last = instr; + } + instr->next = NULL; + } +} + +void +read_drums_info(soundfont *sf, xmlNodePtr drums) +{ + static const xml_attr_spec drum_spec = { + {"Name", false, xml_parse_c_identifier, offsetof(drum_data, name) }, + { "Note", true, xml_parse_note_number, offsetof(drum_data, note) }, + { "NoteStart", true, xml_parse_note_number, offsetof(drum_data, note_start) }, + { "NoteEnd", true, xml_parse_note_number, offsetof(drum_data, note_end) }, + { "Pan", false, xml_parse_int, offsetof(drum_data, pan) }, + { "Envelope", false, xml_parse_c_identifier, offsetof(drum_data, envelope_name)}, + { "Release", true, xml_parse_u8, offsetof(drum_data, release) }, + { "Sample", false, xml_parse_c_identifier, offsetof(drum_data, sample_name) }, + { "SampleRate", true, xml_parse_double, offsetof(drum_data, sample_rate) }, + { "BaseNote", true, xml_parse_note_number, offsetof(drum_data, base_note) }, + }; + + LL_FOREACH(xmlNodePtr, drum_node, drums->children) { + if (drum_node->type != XML_ELEMENT_NODE) + continue; + + const char *name = XMLSTR_TO_STR(drum_node->name); + if (!strequ(name, "Drum")) + error("Unexpected element node %s in drums list (line %d)", name, drum_node->line); + + drum_data *drum = malloc(sizeof(drum_data)); + drum->note = NOTE_UNSET; + drum->note_start = NOTE_UNSET; + drum->note_end = NOTE_UNSET; + drum->sample_rate = -1; + drum->base_note = NOTE_UNSET; + drum->release = RELEASE_UNSET; + + if (drum_node->properties == NULL) { + // + drum->name = NULL; + drum->envelope = NULL; + drum->sample_name = NULL; + drum->sample = NULL; + goto link_drum; + } + + xml_parse_node_by_spec(drum, drum_node, drum_spec, ARRAY_COUNT(drum_spec)); + + drum->envelope = sf_get_envelope(sf, drum->envelope_name); + if (drum->envelope == NULL) + error("Bad envelope name %s (line %d)", drum->envelope_name, drum_node->line); + + // validate optionals + if (drum->release == RELEASE_UNSET) + drum->release = drum->envelope->release; + + if (drum->note == NOTE_UNSET) { + if (drum->note_start == NOTE_UNSET || drum->note_end == NOTE_UNSET) + error("Incomplete note range specification (line %d)", drum_node->line); + } else { + if (drum->note_start != NOTE_UNSET || drum->note_end != NOTE_UNSET) + error("Overspecified note range (line %d)", drum_node->line); + + drum->note_start = drum->note_end = drum->note; + } + + if (drum->note_end < drum->note_start) + error("Invalid drum note range: [%d - %d] (line %d)", drum->note_start, drum->note_end, drum_node->line); + + drum->sample = sample_data_forname(sf, drum->sample_name); + if (drum->sample == NULL) + error("Bad sample name \"%s\" (line %d). Is it defined in ?", drum->sample_name, drum_node->line); + + // set final samplerate if not overridden + if (drum->sample_rate == -1) { + drum->sample_rate = drum->sample->sample_rate; + } + + // set basenote if not overridden + if (drum->base_note == NOTE_UNSET) { + if (drum->sample->aifc.has_inst) { + drum->base_note = drum->sample->base_note; + } else { + error("No basenote for drum (line %d)", drum_node->line); + } + } + + // link + link_drum: + if (sf->drums == NULL) { + sf->drums = drum; + sf->drums_last = drum; + } else { + sf->drums_last->next = drum; + sf->drums_last = drum; + } + drum->next = NULL; + } +} + +void +read_sfx_info(soundfont *sf, xmlNodePtr effects) +{ + static const xml_attr_spec sfx_spec = { + {"Name", false, xml_parse_c_identifier, offsetof(sfx_data, name) }, + { "Sample", false, xml_parse_c_identifier, offsetof(sfx_data, sample_name)}, + { "SampleRate", true, xml_parse_double, offsetof(sfx_data, sample_rate)}, + { "BaseNote", true, xml_parse_note_number, offsetof(sfx_data, base_note) }, + }; + + LL_FOREACH(xmlNodePtr, sfx_node, effects->children) { + if (sfx_node->type != XML_ELEMENT_NODE) + continue; + + const char *name = XMLSTR_TO_STR(sfx_node->name); + if (!strequ(name, "Effect")) + error("Unexpected element node %s in effects list (line %d)", name, sfx_node->line); + + sf->info.num_effects++; + + sfx_data *sfx = malloc(sizeof(sfx_data)); + + if (sfx_node->properties == NULL) { + sfx->sample = NULL; + } else { + sfx->sample_rate = -1; + sfx->base_note = NOTE_UNSET; + xml_parse_node_by_spec(sfx, sfx_node, sfx_spec, ARRAY_COUNT(sfx_spec)); + + sfx->sample = sample_data_forname(sf, sfx->sample_name); + if (sfx->sample == NULL) + error("Bad sample name \"%s\" (line %d). Is it defined in ?", sfx->sample_name, + sfx_node->line); + + if (sfx->base_note == NOTE_UNSET) + sfx->base_note = sfx->sample->base_note; + + if (sfx->sample_rate == -1) + sfx->sample_rate = sfx->sample->sample_rate; + + sfx->tuning = calc_tuning(sfx->sample_rate, sfx->base_note); + } + + // link + if (sf->sfx == NULL) { + sf->sfx = sfx; + sf->sfx_last = sfx; + } else { + sf->sfx_last->next = sfx; + sf->sfx_last = sfx; + } + sfx->next = NULL; + } +} + +typedef struct { + bool is_dd; + bool cached; +} sample_data_defaults; + +void +read_samples_info(soundfont *sf, xmlNodePtr samples) +{ + static const xml_attr_spec samples_spec = { + {"IsDD", true, xml_parse_bool, offsetof(sample_data_defaults, is_dd) }, + { "Cached", true, xml_parse_bool, offsetof(sample_data_defaults, cached)}, + }; + static const xml_attr_spec sample_spec = { + {"Name", false, xml_parse_c_identifier, offsetof(sample_data, name) }, + { "SampleRate", true, xml_parse_double, offsetof(sample_data, sample_rate)}, + { "BaseNote", true, xml_parse_note_number, offsetof(sample_data, base_note) }, + { "IsDD", true, xml_parse_bool, offsetof(sample_data, is_dd) }, + { "Cached", true, xml_parse_bool, offsetof(sample_data, cached) }, + }; + + sample_data_defaults defaults; + defaults.is_dd = false; + defaults.cached = false; + xml_parse_node_by_spec(&defaults, samples, samples_spec, ARRAY_COUNT(samples_spec)); + + LL_FOREACH(xmlNodePtr, sample_node, samples->children) { + if (sample_node->type != XML_ELEMENT_NODE) + continue; + + const char *name = XMLSTR_TO_STR(sample_node->name); + if (!strequ(name, "Sample")) + error("Unexpected element node %s in samples list (line %d)", name, sample_node->line); + + sample_data *sample = malloc(sizeof(sample_data)); + + sample->sample_rate = -1.0; + sample->base_note = NOTE_UNSET; + sample->is_dd = defaults.is_dd; + sample->cached = defaults.cached; + + xml_parse_node_by_spec(sample, sample_node, sample_spec, ARRAY_COUNT(sample_spec)); + + samplebank *sb = (sample->is_dd) ? &sf->sbdd : &sf->sb; + + const char *sample_path = samplebank_path_forname(sb, sample->name); + if (sample_path == NULL) + error("Bad sample name %s, does it exist in the samplebank? (line %d)", sample->name, sample_node->line); + + aifc_read(&sample->aifc, sample_path, NULL, NULL); + + if (sample->sample_rate == -1.0) + sample->sample_rate = sample->aifc.sample_rate; + + if (sample->base_note == NOTE_UNSET) { + if (sample->aifc.has_inst) + sample->base_note = midinote_to_z64note(sample->aifc.basenote); + else + error("No basenote for sample %s (line %d)", sample->name, sample_node->line); + } + + if (!sample->aifc.has_book) + error("No vadpcm codebook for sample %s (line %d)", sample->name, sample_node->line); + + // link + if (sf->samples == NULL) { + sf->samples = sample; + sf->sample_last = sample; + } else { + sf->sample_last->next = sample; + sf->sample_last = sample; + } + sample->next = NULL; + } +} + +static bool +is_hex(char c) +{ + return ('0' <= c && c <= '9') || ('A' <= c && c <= 'F'); +} + +static int +from_hex(char c) +{ + if ('0' <= c && c <= '9') + return c - '0'; + if ('A' <= c && c <= 'F') + return c - 'A' + 10; + assert(false); + return -0xABABABAB; +} + +void +read_match_padding(soundfont *sf, xmlNodePtr padding_decl) +{ + if (padding_decl->properties != NULL) + error("Unexpected properties for MatchPadding declaration (line %d)", padding_decl->line); + + if (padding_decl->children == NULL || padding_decl->children->content == NULL) + error("No data declared for MatchPadding (line %d)", padding_decl->line); + + if (padding_decl->children->next != NULL) + error("Unexpected layout for MatchPadding declaration (line %d)", padding_decl->line); + + const char *data_str = XMLSTR_TO_STR(padding_decl->children->content); + size_t data_len = strlen(data_str); + + // We expect padding to be bytes like 0xAB separated by comma or whitespace, so string length / 5 is the upper bound + uint8_t *padding = malloc(data_len / 5); + + size_t k = 0; + bool must_be_delimiter = false; + + for (size_t i = 0; i < data_len - 4; i++) { + if (isspace(data_str[i]) || data_str[i] == ',') { + must_be_delimiter = false; + continue; + } + + if (must_be_delimiter) + error("Malformed padding data, expected a space or comma at position %ld", i); + + if (data_str[i + 0] != '0' || data_str[i + 1] != 'x') + error("Malformed padding data, expected an 0x prefix at position %ld", i); + + char c1 = toupper(data_str[i + 2]); + char c2 = toupper(data_str[i + 3]); + + if (!is_hex(c1) || !is_hex(c2)) + error("Malformed padding data, expected hexadecimal digits at position %ld", i + 2); + + padding[k++] = (from_hex(c1) << 4) | from_hex(c2); + must_be_delimiter = true; + i += 3; + } + + sf->match_padding = padding; + sf->match_padding_num = k; +} + +/** + * Emit a padding statement that pads to the next 0x10 byte boundary. Assumes that `pos` measures from an 0x10-byte + * aligned location. + */ +static void +emit_padding_stmt(FILE *out, unsigned pos) +{ + switch (ALIGN16(pos) - pos) { + case 0: + // Already aligned, pass silently + break; + case 4: + fprintf(out, "SF_PAD4();\n"); + break; + case 8: + fprintf(out, "SF_PAD8();\n"); + break; + case 0xC: + fprintf(out, "SF_PADC();\n"); + break; + default: + // We don't expect to need to support alignment from anything less than word-aligned. + error("[Internal] Bad alignment generated"); + break; + } +} + +size_t +emit_c_header(FILE *out, soundfont *sf) +{ + size_t size = 0; + + fprintf(out, "// HEADER\n\n"); + + // Generate externs for use in the header. + + if (sf->drums != NULL) + fprintf(out, "extern Drum* SF%d_DRUMS_PTR_LIST[];\n\n", sf->info.index); + + if (sf->sfx != NULL) + fprintf(out, "extern SoundEffect SF%d_SFX_LIST[];\n\n", sf->info.index); + + if (sf->instruments != NULL) { + // Externs are emitted in struct order + LL_FOREACH(instr_data *, instr, sf->instruments) { + if (instr->unused) + continue; + fprintf(out, "extern Instrument SF%d_%s;\n", sf->info.index, instr->name); + } + fprintf(out, "\n"); + } + + // Generate the header itself: drums -> sfx -> instruments. + + // We always need to write pointers for drums and sfx even if they are NULL. + + uint32_t pos = 0; + + if (sf->drums != NULL) + fprintf(out, "NO_REORDER SECTION_DATA Drum** SF%d_DRUMS_PTR_LIST_PTR = SF%d_DRUMS_PTR_LIST;\n", sf->info.index, + sf->info.index); + else + fprintf(out, "NO_REORDER SECTION_DATA Drum** SF%d_DRUMS_PTR_LIST_PTR = NULL;\n", sf->info.index); + + pos += 4; + size += 4; + + if (sf->sfx != NULL) + fprintf(out, "NO_REORDER SECTION_DATA SoundEffect* SF%d_SFX_LIST_PTR = SF%d_SFX_LIST;\n", sf->info.index, + sf->info.index); + else + fprintf(out, "NO_REORDER SECTION_DATA SoundEffect* SF%d_SFX_LIST_PTR = NULL;\n", sf->info.index); + + pos += 4; + size += 4; + + if (sf->instruments != NULL) { + const char **instr_names = calloc(sf->info.num_instruments, sizeof(const char *)); + + // The instrument pointer table is indexed by program number. Since sf->instruments is sorted by struct index + // we must first sort by program number. + LL_FOREACH(instr_data *, instr, sf->instruments) { + if (instr->unused) + continue; // Unused instruments are not included in the table and have no meaningful program number + instr_names[instr->program_number] = instr->name; + } + + fprintf(out, "NO_REORDER SECTION_DATA Instrument* SF%d_INSTRUMENT_PTR_LIST[] = {\n", sf->info.index); + + for (unsigned i = 0; i < sf->info.num_instruments; i++) { + if (instr_names[i] == NULL) + fprintf(out, " NULL,\n"); + else + fprintf(out, " &SF%d_%s,\n", sf->info.index, instr_names[i]); + pos += 4; + size += 4; + } + fprintf(out, "};\n"); + + free(instr_names); + } + + // Pad the header to the next 0x10-byte boundary. + emit_padding_stmt(out, pos); + fprintf(out, "\n"); + + return ALIGN16(size); +} + +/** + * Convert the compression type as indicated in the AIFC to the corresponding SampleCodec enum value. + * These must be kept in sync with the SampleCodec definition! + */ +static const char * +codec_enum(uint32_t compression_type, const char *origin_file) +{ + switch (compression_type) { + case CC4('A', 'D', 'P', '9'): + return "CODEC_ADPCM"; + + case CC4('H', 'P', 'C', 'M'): + return "CODEC_S8"; + + case CC4('A', 'D', 'P', '5'): + return "CODEC_SMALL_ADPCM"; + + case CC4('R', 'V', 'R', 'B'): + return "CODEC_REVERB"; + + case CC4('N', 'O', 'N', 'E'): + return "CODEC_S16"; + } + error("Bad compression type in aifc file %s", origin_file); + __builtin_unreachable(); +} + +static unsigned int +codec_frame_size(uint32_t compression_type) +{ + switch (compression_type) { + case CC4('A', 'D', 'P', '9'): + return 9; + + case CC4('A', 'D', 'P', '5'): + return 5; + + default: // TODO should any others not use 16? + return 16; + } +} + +/** + * Compare the codebooks of two samples. Returns true if they are identical. + */ +static bool +samples_books_equal(sample_data *s1, sample_data *s2) +{ + int32_t s1_order = s1->aifc.book.order; + int32_t s1_npredictors = s1->aifc.book.npredictors; + int32_t s2_order = s1->aifc.book.order; + int32_t s2_npredictors = s1->aifc.book.npredictors; + + if (s1_order != s2_order || s1_npredictors != s2_npredictors) + return false; + return !memcmp(*s1->aifc.book_state, *s2->aifc.book_state, 8 * (unsigned)s1_order * (unsigned)s1_npredictors); +} + +/** + * Writes all samples, their codebooks and their loops to C structures. + */ +size_t +emit_c_samples(FILE *out, soundfont *sf) +{ + size_t size = 0; + + if (sf->samples == NULL) + return size; + + int i = 0; + LL_FOREACH(sample_data *, sample, sf->samples) { + // Determine if we need to write a new book structure. If we've already emitted a book structure with the + // same contents we use that instead. + + bool new_book = true; + const char *bookname = sample->name; + + LL_FOREACH(sample_data *, sample2, sf->samples) { + if (sample2 == sample) + // Caught up to our current position, we need to write a new book. + break; + + if (samples_books_equal(sample, sample2)) { + // A book that we've already seen is the same as this one. Since the book we are comparing to here is + // the first such book, this is guaranteed to have already been written and we move the reference to + // this one. + new_book = false; + bookname = sample2->name; + break; + } + } + + fprintf(out, "// SAMPLE %d\n\n", i); + + // Write the sample header + + samplebank *sb = (sample->is_dd) ? &sf->sbdd : &sf->sb; + + // Note: We could skip writing the book extern if new_book is false, but it's probably not worth the extra code + fprintf(out, + // clang-format off + "extern u8 %s_%s_Off[];" "\n" + "extern AdpcmBook SF%d_%s_BOOK;" "\n" + "extern AdpcmLoop SF%d_%s_LOOP;" "\n" + "\n", + // clang-format on + sb->name, sample->name, sf->info.index, bookname, sf->info.index, sample->name); + + const char *codec_name = codec_enum(sample->aifc.compression_type, sample->aifc.path); + + fprintf(out, + // clang-format off + "NO_REORDER SECTION_DATA ALIGNED(16) Sample SF%d_%s_HEADER = {" "\n" + " " +#ifdef SFC_MM + // MM has an extra unused field in the sample structure compared to OoT + "%d, " +#endif + "%s, %d, %s, %s," "\n" + " 0x%06lX," "\n" + " %s_%s_Off," "\n" + " &SF%d_%s_LOOP," "\n" + " &SF%d_%s_BOOK," "\n" + "};" "\n" + "\n", + // clang-format on + sf->info.index, sample->name, +#ifdef SFC_MM + 0, +#endif + codec_name, sample->is_dd, BOOL_STR(sample->cached), BOOL_STR(false), sample->aifc.ssnd_size, sb->name, + sample->name, sf->info.index, sample->name, sf->info.index, bookname); + size += 0x10; + + // Write the book if it hasn't been deduplicated. + + if (new_book) { + // Since books are variable-size structures and we want to support a C89 compiler, we first write the + // header as one structure and the book state as an array. We then declare a weak symbol for the book + // header to alias it to the correct type without casts, avoiding potential type conflicts with externs. + size_t book_size = 0; + + fprintf(out, + // clang-format off + "NO_REORDER SECTION_DATA ALIGNED(16) AdpcmBookHeader SF%d_%s_BOOK_HEADER = {" "\n" + " %d, %d," "\n" + "};" "\n" + "NO_REORDER SECTION_DATA AdpcmBookData SF%d_%s_BOOK_DATA = {" "\n", + // clang-format on + sf->info.index, bookname, sample->aifc.book.order, sample->aifc.book.npredictors, sf->info.index, + bookname); + book_size += 8; + + for (size_t j = 0; j < (unsigned)sample->aifc.book.order * (unsigned)sample->aifc.book.npredictors; j++) { + fprintf( + out, + // clang-format off + " (s16)0x%04X, (s16)0x%04X, (s16)0x%04X, (s16)0x%04X, " + "(s16)0x%04X, (s16)0x%04X, (s16)0x%04X, (s16)0x%04X,\n", + // clang-format on + (uint16_t)(*sample->aifc.book_state)[j * 8 + 0], (uint16_t)(*sample->aifc.book_state)[j * 8 + 1], + (uint16_t)(*sample->aifc.book_state)[j * 8 + 2], (uint16_t)(*sample->aifc.book_state)[j * 8 + 3], + (uint16_t)(*sample->aifc.book_state)[j * 8 + 4], (uint16_t)(*sample->aifc.book_state)[j * 8 + 5], + (uint16_t)(*sample->aifc.book_state)[j * 8 + 6], (uint16_t)(*sample->aifc.book_state)[j * 8 + 7]); + } + + fprintf(out, + // clang-format off + "};" "\n" + "#pragma weak SF%d_%s_BOOK = SF%d_%s_BOOK_HEADER" "\n", + // clang-format on + sf->info.index, bookname, sf->info.index, bookname); + + // We assume here that book structures begin on 0x10-byte boundaries. Book structures are always + // `4 + 4 + 8 * order * npredictors` large, emit a padding statement to the next 0x10-byte boundary. + book_size += 2 * 8 * (unsigned)sample->aifc.book.order * (unsigned)sample->aifc.book.npredictors; + emit_padding_stmt(out, book_size); + fprintf(out, "\n"); + + size += ALIGN16(book_size); + } + + // Write the loop + + // Can't use sample->aifc.num_frames directly, the original vadpcm_enc tool occasionally got the number + // of frames wrong (off-by-1) which we must reproduce here for matching (rather than reproducing it in the + // aifc and wav/aiff files themselves) + uint32_t frame_count = (sample->aifc.ssnd_size * 16) / codec_frame_size(sample->aifc.compression_type); + + // We cannot deduplicate or skip writing loops in general as the audio driver assumes that at least a loop + // header exists for every sample. We could deduplicate on the special case that two samples have the same + // frame count? TODO + + if (!sample->aifc.has_loop || sample->aifc.loop.count == 0) { + // No loop present, or a loop with a count of 0 was explicitly written into the aifc. + // Write a header only, using the same weak symbol trick as with books. + + uint32_t start; + uint32_t end; + uint32_t count; + + if (!sample->aifc.has_loop) { + // No loop, write a loop header that spans the entire sample with a count of 0. + // The audio driver expects that a loop structure always exists for a sample. + start = 0; + end = frame_count; + count = 0; + } else { + // There is a count=0 loop in the aifc file, trust it. + start = sample->aifc.loop.start; + end = sample->aifc.loop.end; + count = sample->aifc.loop.count; + } + + fprintf(out, + // clang-format off + "NO_REORDER SECTION_DATA ALIGNED(16) AdpcmLoopHeader SF%d_%s_LOOP_HEADER = {" "\n" + " %u, %u, %u, 0," "\n" + "};" "\n" + "#pragma weak SF%d_%s_LOOP = SF%d_%s_LOOP_HEADER" "\n" + "\n", + // clang-format on + sf->info.index, sample->name, start, end, count, sf->info.index, sample->name, sf->info.index, + sample->name); + size += 0x10; + } else { + // With state, since loop states are a fixed size there is no need for a weak alias. + + // Some soundfonts include the total frame count of the sample, but not all of them. + // Set the frame count to 0 here to inhibit writing it into the loop structure if this is + // a soundfont that does not include it. + if (!sf->info.loops_have_frames) + frame_count = 0; + + char count_str[12]; + + if (sample->aifc.loop.count == 0xFFFFFFFF) + snprintf(count_str, sizeof(count_str), "0x%08X", sample->aifc.loop.count); + else + snprintf(count_str, sizeof(count_str), "%u", sample->aifc.loop.count); + + fprintf(out, + // clang-format off + "NO_REORDER SECTION_DATA ALIGNED(16) AdpcmLoop SF%d_%s_LOOP = {" "\n" + " { %u, %u, %s, %u }," "\n" + " {" "\n" + " (s16)0x%04X, (s16)0x%04X, (s16)0x%04X, (s16)0x%04X," "\n" + " (s16)0x%04X, (s16)0x%04X, (s16)0x%04X, (s16)0x%04X," "\n" + " (s16)0x%04X, (s16)0x%04X, (s16)0x%04X, (s16)0x%04X," "\n" + " (s16)0x%04X, (s16)0x%04X, (s16)0x%04X, (s16)0x%04X," "\n" + " }," "\n" + "};" "\n" + "\n", + // clang-format on + sf->info.index, sample->name, sample->aifc.loop.start, sample->aifc.loop.end, count_str, + frame_count, (uint16_t)sample->aifc.loop.state[0], (uint16_t)sample->aifc.loop.state[1], + (uint16_t)sample->aifc.loop.state[2], (uint16_t)sample->aifc.loop.state[3], + (uint16_t)sample->aifc.loop.state[4], (uint16_t)sample->aifc.loop.state[5], + (uint16_t)sample->aifc.loop.state[6], (uint16_t)sample->aifc.loop.state[7], + (uint16_t)sample->aifc.loop.state[8], (uint16_t)sample->aifc.loop.state[9], + (uint16_t)sample->aifc.loop.state[10], (uint16_t)sample->aifc.loop.state[11], + (uint16_t)sample->aifc.loop.state[12], (uint16_t)sample->aifc.loop.state[13], + (uint16_t)sample->aifc.loop.state[14], (uint16_t)sample->aifc.loop.state[15]); + size += 0x30; + } + i++; + } + return size; +} + +/** + * Write envelope structures. + */ +size_t +emit_c_envelopes(FILE *out, soundfont *sf) +{ + size_t size = 0; + + if (sf->envelopes == NULL) + return size; + + fprintf(out, "// ENVELOPES\n\n"); + + size_t empty_num = 0; + + LL_FOREACH(envelope_data *, envdata, sf->envelopes) { + if (sf->matching && envdata->name == NULL) { + // For MM: write 16 bytes of 0 when matching + + fprintf(out, + // clang-format off + "NO_REORDER SECTION_DATA ALIGNED(16) EnvelopePoint SF%d_ENV_EMPTY_%lu[] = {" "\n" + " { 0, 0, }," "\n" + " { 0, 0, }," "\n" + " { 0, 0, }," "\n" + " { 0, 0, }," "\n" + "};" "\n" + "\n", + // clang-format on + sf->info.index, empty_num); + + empty_num++; + size += 0x10; + } else { + fprintf(out, "NO_REORDER SECTION_DATA ALIGNED(16) EnvelopePoint SF%d_%s[] = {\n", sf->info.index, + envdata->name); + + // Write all points + for (size_t j = 0; j < envdata->n_points; j++) { + envelope_point *pt = &envdata->points[j]; + + switch (pt->delay) { + case ADSR_DISABLE: + fprintf(out, " ENVELOPE_DISABLE(),\n"); + break; + case ADSR_GOTO: + fprintf(out, " ENVELOPE_GOTO(%d),\n", pt->arg); + break; + case ADSR_HANG: + fprintf(out, " ENVELOPE_HANG(),\n"); + break; + case ADSR_RESTART: + fprintf(out, " ENVELOPE_RESTART(),\n"); + break; + default: + fprintf(out, " ENVELOPE_POINT(%5d, %5d),\n", pt->delay, pt->arg); + break; + } + } + + // Automatically add a HANG command at the end + fprintf(out, " ENVELOPE_HANG(),\n" + "};\n"); + + // Pad to 0x10-byte boundary + size_t env_size = 4 * (envdata->n_points + 1); + emit_padding_stmt(out, env_size); + fprintf(out, "\n"); + + size += ALIGN16(env_size); + } + } + return size; +} + +#define F32_FMT "%.22f" + +size_t +emit_c_instruments(FILE *out, soundfont *sf) +{ + size_t size = 0; + + fprintf(out, "// INSTRUMENTS\n\n"); + + size_t unused_instr_num = 0; + + LL_FOREACH(instr_data *, instr, sf->instruments) { + if (instr->unused) { + fprintf(out, "NO_REORDER SECTION_DATA Instrument SF%d_INSTR_UNUSED_%lu = {\n", sf->info.index, + unused_instr_num); + unused_instr_num++; + } else { + fprintf(out, "NO_REORDER SECTION_DATA Instrument SF%d_%s = {\n", sf->info.index, instr->name); + } + + char nlo[5]; + snprintf(nlo, sizeof(nlo), "%3d", instr->sample_low_end); + char nhi[5]; + snprintf(nhi, sizeof(nhi), "%3d", instr->sample_high_start); + + fprintf(out, + // clang-format off + " false," "\n" + " %s," "\n" + " %s," "\n" + " %d," "\n" + " SF%d_%s," "\n", + // clang-format on + (instr->sample_low_end == INSTR_LO_NONE) ? "INSTR_SAMPLE_LO_NONE" : nlo, + (instr->sample_high_start == INSTR_HI_NONE) ? "INSTR_SAMPLE_HI_NONE" : nhi, instr->release, + sf->info.index, instr->envelope_name); + + if (instr->sample_low != NULL) + fprintf(out, " { &SF%d_%s_HEADER, " F32_FMT "f },\n", sf->info.index, instr->sample_name_low, + instr->sample_low_tuning); + else + fprintf(out, " INSTR_SAMPLE_NONE,\n"); + + fprintf(out, " { &SF%d_%s_HEADER, " F32_FMT "f },\n", sf->info.index, instr->sample_name_mid, + instr->sample_mid_tuning); + + if (instr->sample_high != NULL) + fprintf(out, " { &SF%d_%s_HEADER, " F32_FMT "f },\n", sf->info.index, instr->sample_name_high, + instr->sample_high_tuning); + else + fprintf(out, " INSTR_SAMPLE_NONE,\n"); + + fprintf(out, "};\n\n"); + + size += 0x20; + } + return size; +} + +size_t +emit_c_drums(FILE *out, soundfont *sf) +{ + size_t size = 0; + + if (sf->drums == NULL) + return size; + + fprintf(out, "// DRUMS\n\n"); + + // Prepare pointer table data to be filled in while writing the drum structures. Init to 0 so if any low notes are + // not covered by any drum group the name will be NULL. + struct { + const char *name; + int n; + } ptr_table[64]; + memset(ptr_table, 0, sizeof(ptr_table)); + + // While writing the drum structures we record the maximum note covered by this soundfont. Some "oddball" soundfonts + // like soundfont 0 do not have an array entry for all 64 notes. We use this to know when to stop writing entries in + // the pointer table. + int max_note = -1; + + LL_FOREACH(drum_data *, drum, sf->drums) { + if (drum->name == NULL) { + max_note++; + continue; + } + + if (drum->note_end > max_note) + max_note = drum->note_end; + + size_t length = drum->note_end - drum->note_start + 1; + + // Drum structures are duplicated for each note in the range they cover, the basenote for each is incremented + // by one but the data is otherwise identical. We write a preprocessor definition to make the resulting source + // more compact for easier inspection. + + fprintf(out, + // clang-format off + "#define SF%d_%s_ENTRY(tuning) \\" "\n" + " { \\" "\n" + " %d, \\" "\n" + " %d, \\" "\n" + " false, \\" "\n" + " { &SF%d_%s_HEADER, (tuning) }, \\" "\n" + " SF%d_%s, \\" "\n" + " }" "\n" + "NO_REORDER SECTION_DATA Drum SF%d_%s[%lu] = {" "\n", + // clang-format on + sf->info.index, drum->name, drum->release, drum->pan, sf->info.index, drum->sample->name, + sf->info.index, drum->envelope->name, sf->info.index, drum->name, length); + + // Write each structure while building the drum pointer table + + if (drum->note_end + 1 > 64) + error("Bad drum range for drum spanning %d to %d, should be within 0 to 63", drum->note_start, + drum->note_end); + + for (size_t note_offset = 0; note_offset < length; note_offset++) { + size_t ptr_offset = drum->note_start + note_offset; + + ptr_table[ptr_offset].name = drum->name; + ptr_table[ptr_offset].n = note_offset; + + // wrap note on overflow + int note = drum->base_note + note_offset; + if (note > 127) + note -= 128; + + float tuning = calc_tuning(drum->sample_rate, note); + + fprintf(out, " SF%d_%s_ENTRY(" F32_FMT "f),\n", sf->info.index, drum->name, tuning); + } + + fprintf(out, "};\n\n"); + size += 0x10 * length; + } + + // Write the drum pointer table. Always start at 0 and end at the maximum used note. If any low notes are not used, + // NULL is written into the array. + + size_t table_len = max_note + 1; + if (table_len > 64) + error("Bad drum pointer table length %lu, should be at most 64", table_len); + + fprintf(out, "NO_REORDER SECTION_DATA ALIGNED(16) Drum* SF%d_DRUMS_PTR_LIST[%lu] = {\n", sf->info.index, table_len); + + for (size_t i = 0; i < table_len; i++) { + if (ptr_table[i].name == NULL) { + fprintf(out, " NULL,\n"); + continue; + } + + if (i != 0 && ptr_table[i].n == 0) // Add some space between different drum groups + fprintf(out, "\n"); + fprintf(out, " &SF%d_%s[%d],\n", sf->info.index, ptr_table[i].name, ptr_table[i].n); + } + + sf->info.num_drums = table_len; + + fprintf(out, "};\n"); + emit_padding_stmt(out, table_len * 4); + fprintf(out, "\n"); + + size += ALIGN16(table_len * 4); + return size; +} + +size_t +emit_c_effects(FILE *out, soundfont *sf) +{ + size_t size = 0; + + if (sf->sfx == NULL) + return size; + + fprintf(out, "// EFFECTS\n\n"); + + // Effects are all contained in the same array. We write empty entries as NULL entries in this array. + + fprintf(out, "NO_REORDER SECTION_DATA ALIGNED(16) SoundEffect SF%d_SFX_LIST[] = {\n", sf->info.index); + + LL_FOREACH(sfx_data *, sfx, sf->sfx) { + if (sfx->sample != NULL) + fprintf(out, " { { &SF%d_%s_HEADER, " F32_FMT "f } },\n", sf->info.index, sfx->sample->name, + sfx->tuning); + else + fprintf(out, " { { NULL, 0.0f } },\n"); + + size += 8; + } + + fprintf(out, "};\n\n"); + + return size; +} + +void +emit_c_match_padding(FILE *out, soundfont *sf, size_t size) +{ + if (sf->match_padding != NULL && sf->match_padding_num != 0) { + // Sometimes a soundfont will have non-zero padding at the end, add these values manually + size_t expected = sf->match_padding_num; + + // Don't pad any further than the next 0x10 byte boundary + size_t remaining = ALIGN16(size) - size; + size_t amount = (expected > remaining) ? remaining : expected; + + fprintf(out, "// MATCH PADDING\n\n"); + + fprintf(out, "NO_REORDER SECTION_DATA u8 SF%d_MATCH_PADDING[] = {\n", sf->info.index); + for (size_t i = 0; i < amount; i++) + fprintf(out, " 0x%02X,\n", sf->match_padding[i]); + fprintf(out, "};\n\n"); + + size += amount; + } + + if (sf->info.pad_to_size != 0) { + if (sf->info.pad_to_size <= size) { + warning("PadToSize directive ignored."); + } else { + fprintf(out, "// MATCH SIZE PADDING\n\n"); + + // pad to given size + size_t amount = sf->info.pad_to_size - size; + fprintf(out, "NO_REORDER SECTION_DATA u8 SF%d_MATCH_PADDING_TO_SIZE[%lu] = { 0 };\n", sf->info.index, + amount); + } + } +} + +void +emit_h_instruments(FILE *out, soundfont *sf) +{ + if (sf->instruments == NULL) + return; + + // Example output: + // #define FONT{Index}_INSTR_{EnumName} {EnumValue} + + LL_FOREACH(instr_data *, instr, sf->instruments) { + if (!instr->unused) { + fprintf(out, "#define SF%d_%s %d\n", sf->info.index, instr->name, instr->program_number); + } + } + fprintf(out, "\n"); +} + +static const char * +z64_note_name(int note_num) +{ + static const char *const note_names[] = { + "A0", "BF0", "B0", "C1", "DF1", "D1", "EF1", "E1", "F1", "GF1", "G1", "AF1", "A1", "BF1", "B1", + "C2", "DF2", "D2", "EF2", "E2", "F2", "GF2", "G2", "AF2", "A2", "BF2", "B2", "C3", "DF3", "D3", + "EF3", "E3", "F3", "GF3", "G3", "AF3", "A3", "BF3", "B3", "C4", "DF4", "D4", "EF4", "E4", "F4", + "GF4", "G4", "AF4", "A4", "BF4", "B4", "C5", "DF5", "D5", "EF5", "E5", "F5", "GF5", "G5", "AF5", + "A5", "BF5", "B5", "C6", "DF6", "D6", "EF6", "E6", "F6", "GF6", "G6", "AF6", "A6", "BF6", "B6", + "C7", "DF7", "D7", "EF7", "E7", "F7", "GF7", "G7", "AF7", "A7", "BF7", "B7", "C8", "DF8", "D8", + "EF8", "E8", "F8", "GF8", "G8", "AF8", "A8", "BF8", "B8", "C9", "DF9", "D9", "EF9", "E9", "F9", + "GF9", "G9", "AF9", "A9", "BF9", "B9", "C10", "DF10", "D10", "EF10", "E10", "F10", "BFNEG1", "BNEG1", "C0", + "DF0", "D0", "EF0", "E0", "F0", "GF0", "G0", "AF0", + }; + return note_names[note_num]; +} + +void +emit_h_drums(FILE *out, soundfont *sf) +{ + if (sf->drums == NULL) + return; + + // Emit drum defines in groups, named like [DrumName]_[NoteName] + // e.g. a drum called "MY_DRUM" with a sample basenote of C4 covering a note range of 0..3 looks like + // #define MY_DRUM_C4 0 + // #define MY_DRUM_DF4 1 + // #define MY_DRUM_D4 2 + // #define MY_DRUM_EF4 3 + + LL_FOREACH(drum_data *, drum, sf->drums) { + if (drum->name == NULL) + continue; + + int length = drum->note_end - drum->note_start + 1; + + for (int note_offset = 0; note_offset < length; note_offset++) { + // wrap note on overflow + int note = drum->base_note + note_offset; + if (note > 127) + note -= 128; + + fprintf(out, "#define SF%d_%s_%s %d\n", sf->info.index, drum->name, z64_note_name(note), + drum->note_start + note_offset); + } + + fprintf(out, "\n"); + } +} + +void +emit_h_effects(FILE *out, soundfont *sf) +{ + if (sf->sfx == NULL) + return; + + int i = 0; + LL_FOREACH(sfx_data *, sfx, sf->sfx) { + if (sfx->sample != NULL) + fprintf(out, "#define SF%d_%s %d\n", sf->info.index, sfx->name, i); + i++; + } + fprintf(out, "\n"); +} + +NORETURN static void +usage(const char *progname) +{ + fprintf(stderr, "Usage: %s [--matching] \n", progname); + exit(EXIT_FAILURE); +} + +int +main(int argc, char **argv) +{ + char *filename_in = NULL; + char *filename_out_c = NULL; + char *filename_out_h = NULL; + char *filename_out_name = NULL; + const char *mdfilename = NULL; + FILE *mdfile; + xmlDocPtr document; + soundfont sf; + + sf.matching = false; + + // parse args + +#define arg_error(fmt, ...) \ + do { \ + fprintf(stderr, fmt "\n", ##__VA_ARGS__); \ + usage(argv[0]); \ + } while (0) + + int argn = 0; + for (int i = 1; i < argc; i++) { + if (argv[i][0] == '-') { + // Optional args + + if (strequ(argv[i], "--matching")) { + if (sf.matching) + arg_error("Received --matching option twice"); + + sf.matching = true; + continue; + } + if (strequ(argv[i], "--makedepend")) { + if (mdfilename != NULL) + arg_error("Received --makedepend option twice"); + if (i + 1 == argc) + arg_error("--makedepend missing required argument"); + + mdfilename = argv[++i]; + continue; + } + arg_error("Unknown option \"%s\"", argv[i]); + } else { + // Required args + + switch (argn) { + case 0: + filename_in = argv[i]; + break; + case 1: + filename_out_c = argv[i]; + break; + case 2: + filename_out_h = argv[i]; + break; + case 3: + filename_out_name = argv[i]; + break; + default: + arg_error("Unknown positional argument \"%s\"", argv[i]); + break; + } + argn++; + } + } + if (argn != 4) + arg_error("Not enough positional arguments"); + +#undef arg_error + + document = xmlReadFile(filename_in, NULL, XML_PARSE_NONET); + if (document == NULL) + return EXIT_FAILURE; + + xmlNodePtr root = xmlDocGetRootElement(document); + if (!strequ(XMLSTR_TO_STR(root->name), "Soundfont")) + error("Root node must be "); + read_soundfont_info(&sf, root); + + sf.envelopes = sf.envelope_last = NULL; + + // read all envelopes first irrespective of their positioning in the xml + LL_FOREACH(xmlNodePtr, node, root->children) { + const char *name = XMLSTR_TO_STR(node->name); + + if (strequ(name, "Envelopes")) + read_envelopes_info(&sf, node); + } + + // read all samples + sf.samples = NULL; + LL_FOREACH(xmlNodePtr, node, root->children) { + const char *name = XMLSTR_TO_STR(node->name); + + if (strequ(name, "Samples")) + read_samples_info(&sf, node); + } + + // read all instruments + memset(sf.program_number_bitset, 0, sizeof(sf.program_number_bitset)); + sf.instruments = NULL; + sf.drums = NULL; + sf.sfx = NULL; + LL_FOREACH(xmlNodePtr, node, root->children) { + const char *name = XMLSTR_TO_STR(node->name); + + if (strequ(name, "Instruments")) + read_instrs_info(&sf, node); + if (strequ(name, "Drums")) + read_drums_info(&sf, node); + if (strequ(name, "Effects")) + read_sfx_info(&sf, node); + } + + // read match padding if it exists + sf.match_padding = NULL; + LL_FOREACH(xmlNodePtr, node, root->children) { + const char *name = XMLSTR_TO_STR(node->name); + + if (strequ(name, "MatchPadding")) + read_match_padding(&sf, node); + } + + // emit C source + + FILE *out_c = fopen(filename_out_c, "w"); + fprintf(out_c, "#include \"soundfont_file.h\"\n\n"); + + size_t size = 0; + size += emit_c_header(out_c, &sf); + size += emit_c_samples(out_c, &sf); + size += emit_c_envelopes(out_c, &sf); + size += emit_c_instruments(out_c, &sf); + size += emit_c_drums(out_c, &sf); + size += emit_c_effects(out_c, &sf); + emit_c_match_padding(out_c, &sf, size); + + fclose(out_c); + + // emit C header + + FILE *out_h = fopen(filename_out_h, "w"); + fprintf(out_h, + // clang-format off + "#ifndef SOUNDFONT_%d_H_" "\n" + "#define SOUNDFONT_%d_H_" "\n" + "\n", + // clang-format on + sf.info.index, sf.info.index); + + fprintf(out_h, + // clang-format off + "#ifdef _LANGUAGE_ASEQ" "\n" + ".pushsection .fonts, \"\", @note" "\n" + " .byte %d /*sf id*/" "\n" + ".popsection" "\n" + "#endif" "\n" + "\n", + // clang-format on + sf.info.index); + + fprintf(out_h, + // clang-format off + "#define %s_ID %d" "\n" + "\n" + "#define SF%d_NUM_INSTRUMENTS %d" "\n" + "#define SF%d_NUM_DRUMS %d" "\n" + "#define SF%d_NUM_SFX %d" "\n" + "\n", + // clang-format on + sf.info.name, sf.info.index, sf.info.index, sf.info.num_instruments, sf.info.index, sf.info.num_drums, + sf.info.index, sf.info.num_effects); + + emit_h_instruments(out_h, &sf); + emit_h_drums(out_h, &sf); + emit_h_effects(out_h, &sf); + + fprintf(out_h, "#endif\n"); + fclose(out_h); + + // emit name marker + + FILE *out_name = fopen(filename_out_name, "w"); + fprintf(out_name, "%s", sf.info.name); + fclose(out_name); + + // emit dependency file if wanted + + if (mdfilename != NULL) { + mdfile = fopen(mdfilename, "w"); + if (mdfile == NULL) + error("Unable to open dependency file [%s] for writing", mdfilename); + + // Begin rule + depend on the soundfont xml input + fprintf(mdfile, "%s %s %s: \\\n %s", filename_out_c, filename_out_h, filename_out_name, filename_in); + + // Depend on the referenced samplebank xmls + if (sf.info.bank_path != NULL) + fprintf(mdfile, " \\\n %s", sf.info.bank_path); + if (sf.info.bank_path_dd != NULL) + fprintf(mdfile, " \\\n %s", sf.info.bank_path_dd); + + // Depend on the aifc files used by this soundfont + LL_FOREACH(sample_data *, sample, sf.samples) { + fprintf(mdfile, " \\\n %s", sample->aifc.path); + } + + fputs("\n", mdfile); + fclose(mdfile); + } + + // done + + xmlFreeDoc(document); + return EXIT_SUCCESS; +} diff --git a/tools/audio/util.c b/tools/audio/util.c new file mode 100644 index 0000000000..8043f95775 --- /dev/null +++ b/tools/audio/util.c @@ -0,0 +1,144 @@ +/* SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET */ +/* SPDX-License-Identifier: CC0-1.0 */ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +#include "util.h" + +// TODO ideally we should be collecting all errors and displaying them all before exiting + +NORETURN void +error(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + fprintf(stderr, "\x1b[91m" + "Error: " + "\x1b[97m"); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\x1b[0m" + "\n"); + va_end(ap); + + exit(EXIT_FAILURE); +} + +void +warning(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + fprintf(stderr, "\x1b[95m" + "Warning: " + "\x1b[97m"); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\x1b[0m" + "\n"); + va_end(ap); +} + +void * +util_read_whole_file(const char *filename, size_t *size_out) +{ + FILE *file = fopen(filename, "rb"); + void *buffer = NULL; + size_t size; + + if (file == NULL) + error("failed to open file '%s' for reading: %s", filename, strerror(errno)); + + // get size + fseek(file, 0, SEEK_END); + size = ftell(file); + + // if the file is empty, return NULL buffer and 0 size + if (size != 0) { + // allocate buffer + buffer = malloc(size + 1); + if (buffer == NULL) + error("could not allocate buffer for file '%s'", filename); + + // read file + fseek(file, 0, SEEK_SET); + if (fread(buffer, size, 1, file) != 1) + error("error reading from file '%s': %s", filename, strerror(errno)); + + // null-terminate the buffer (in case of text files) + ((char *)buffer)[size] = '\0'; + } + + fclose(file); + + if (size_out != NULL) + *size_out = size; + return buffer; +} + +void +util_write_whole_file(const char *filename, const void *data, size_t size) +{ + FILE *file = fopen(filename, "wb"); + + if (file == NULL) + error("failed to open file '%s' for writing: %s", filename, strerror(errno)); + + if (fwrite(data, size, 1, file) != 1) + error("error writing to file '%s': %s", filename, strerror(errno)); + + fclose(file); +} + +bool +str_is_c_identifier(const char *str) +{ + // A C language identifier must: + // - ONLY contain [_, abc..xyz, ABC..XYZ, 0..9] (we do not support unicode or extensions like $) + // - NOT be a keyword + // - NOT start with a digit [0..9] + + static const char *const c_kwds[] = { + "auto", "break", "case", "char", "const", "continue", "default", "do", + "double", "else", "enum", "extern", "float", "for", "goto", "if", + "inline", "int", "long", "register", "restrict", "return", "short", "signed", + "sizeof", "static", "struct", "switch", "typedef", "union", "unsigned", "void", + "volatile", "while", + + "_Alignas", "_Alignof", "_Atomic", "_Bool", "_Complex", "_Generic", "_Imaginary", "_Noreturn", + "_Static_assert", "_Thread_local", + }; + + if (str == NULL) { + return false; + } + if (isdigit(str[0])) { + // Starts with a digit, fail + return false; + } + + size_t len = strlen(str); + for (size_t i = 0; i < len; i++) { + char c = str[i]; + + bool alpha = isalpha(c); + bool digit = isdigit(c); + bool uscore = c == '_'; + + if (!(alpha || digit || uscore)) { + // Contains bad character, fail + return false; + } + } + + for (size_t i = 0; i < ARRAY_COUNT(c_kwds); i++) { + if (strequ(str, c_kwds[i])) { + // Matched a C keyword, fail + return false; + } + } + return true; +} diff --git a/tools/audio/util.h b/tools/audio/util.h new file mode 100644 index 0000000000..69a877f602 --- /dev/null +++ b/tools/audio/util.h @@ -0,0 +1,72 @@ +/* SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET */ +/* SPDX-License-Identifier: CC0-1.0 */ +#ifndef UTIL_H_ +#define UTIL_H_ + +#include +#include +#include + +// Endian + +#if defined(__linux__) || defined(__CYGWIN__) +#include +#elif defined(__APPLE__) +#include + +#define htobe16(x) OSSwapHostToBigInt16(x) +#define htole16(x) OSSwapHostToLittleInt16(x) +#define be16toh(x) OSSwapBigToHostInt16(x) +#define le16toh(x) OSSwapLittleToHostInt16(x) + +#define htobe32(x) OSSwapHostToBigInt32(x) +#define htole32(x) OSSwapHostToLittleInt32(x) +#define be32toh(x) OSSwapBigToHostInt32(x) +#define le32toh(x) OSSwapLittleToHostInt32(x) + +#define htobe64(x) OSSwapHostToBigInt64(x) +#define htole64(x) OSSwapHostToLittleInt64(x) +#define be64toh(x) OSSwapBigToHostInt64(x) +#define le64toh(x) OSSwapLittleToHostInt64(x) +#else +#error "Endian conversion unsupported, add it" +#endif + +// Attribute macros + +#define ALWAYS_INLINE inline __attribute__((always_inline)) + +#define NORETURN __attribute__((noreturn)) +#define UNUSED __attribute__((unused)) + +// Helper macros + +#define strequ(s1, s2) ((__builtin_constant_p(s2) ? strncmp(s1, s2, sizeof(s2) - 1) : strcmp(s1, s2)) == 0) + +#define str_endswith(str, len, endswith) \ + ((len) > (sizeof(endswith) - 1) && strequ(&(str)[(len) - sizeof(endswith) + 1], (endswith))) + +#define LL_FOREACH(type, x, base) for (type(x) = (base); (x) != NULL; (x) = (x)->next) + +#define ARRAY_COUNT(arr) (sizeof(arr) / sizeof((arr)[0])) + +#define ALIGN16(x) (((x) + 0xF) & ~0xF) + +#define BOOL_STR(b) ((b) ? "true" : "false") + +// util.c functions + +__attribute__((format(printf, 1, 2))) NORETURN void +error(const char *fmt, ...); +__attribute__((format(printf, 1, 2))) void +warning(const char *fmt, ...); + +void * +util_read_whole_file(const char *filename, size_t *size_out); +void +util_write_whole_file(const char *filename, const void *data, size_t size); + +bool +str_is_c_identifier(const char *str); + +#endif diff --git a/tools/audio/xml.c b/tools/audio/xml.c new file mode 100644 index 0000000000..41f07a6454 --- /dev/null +++ b/tools/audio/xml.c @@ -0,0 +1,394 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include +#include +#include +#include +#include +#include + +#include "xml.h" +#include "util.h" + +#define copy_out(out, v) memcpy((out), &(v), sizeof(v)); + +/** + * Parse a string as an integer. + * + * The expected value matches case-insensitive regex `^\s*[-+]?(0x[0-9A-F]+|[0-9]+)\s*$`. + * The value may be base 10, or base 16 with a (case-insensitive) 0x prefix. + * Leading and trailing whitespace is ignored. + */ +static int +xml_str_to_int(const char *value) +{ + if (value == NULL || value[0] == '\0') + goto err; + + bool neg = false; + int res; + + size_t value_len = strlen(value); + size_t start; + + // consume initial whitespace + for (start = 0; start < value_len; start++) { + if (!isspace(value[start])) + break; + } + // if we consumed the whole string, it was bad + if (start == value_len) + goto err; + + // handle sign character if present + if (value[start] == '+' || value[start] == '-') { + neg = value[start] == '-'; + start++; + } + + int base; + + // get absolute value in either base 10 or 16 + if (start + 2 < value_len && value[start + 0] == '0' && tolower(value[start + 1]) == 'x') { + start += 2; + base = 16; + } else { + base = 10; + } + + char *str_end; + res = strtol(&value[start], &str_end, base); + size_t end = str_end - value; + if (start == end) + goto err; + + // consume trailing whitespace + while (value[end] != '\0') { + if (!isspace(value[end])) + goto err; + end++; + } + + assert(end == value_len); + + // apply sign + return neg ? -res : res; +err: + error("bad int value %s", value); +} + +void +xml_parse_int(const char *value, void *out) +{ + int v = xml_str_to_int(value); + + copy_out(out, v); +} + +void +xml_parse_uint(const char *value, void *out) +{ + int v = xml_str_to_int(value); + if (v < 0) + error("Value should be unsigned"); + + copy_out(out, v); +} + +void +xml_parse_s16(const char *value, void *out) +{ + int v = xml_str_to_int(value); + if (v < INT16_MIN || v > INT16_MAX) + error("Value %d out of range for s16", v); + int16_t vs16 = v; + + copy_out(out, vs16); +} + +void +xml_parse_u8(const char *value, void *out) +{ + int v = xml_str_to_int(value); + if (v < 0 || v > UINT8_MAX) + error("Value %d out of range for u8", v); + uint8_t vu8 = v; + + copy_out(out, vu8); +} + +void +xml_parse_s8(const char *value, void *out) +{ + int v = xml_str_to_int(value); + if (v < INT8_MIN || v > INT8_MAX) + error("Value %d out of range for s8", v); + int8_t vs8 = v; + + copy_out(out, vs8); +} + +/** + * Parse a note number name to its s8 [0;127] value. + * For example "PITCH_EF4" -> 42. + */ +void +xml_parse_note_number(const char *value, void *out) +{ + size_t value_len = strlen(value); + int8_t vs8; + char c; + + if (value_len == 0) + goto err; + + // consume initial whitespace + size_t start; + for (start = 0; start < value_len; start++) { + if (!isspace(value[start])) + break; + } + // if we consumed the whole string, it was bad + if (start == value_len) + goto err; + + c = toupper(value[start]); + + if (c >= 'A' && c <= 'G') { + start++; + + // got a note number + static const int8_t notes_lut[] = { + /* A */ 12, + /* B */ 14, + /* C */ 3, + /* D */ 5, + /* E */ 7, + /* F */ 8, + /* G */ 10, + }; + char cm = toupper(value[start]); + int mod = 0; + int v; + + if (value_len > start && (cm == 'F' || cm == 'S')) { + // handle flat/sharp modifier + mod = (cm == 'S') ? 1 : -1; + start++; + } + + if (start == value_len) + goto err; + + bool neg = false; + int res; + + // if value starts with NEG (ignoring case) + if (start + 3 <= value_len && toupper(value[start + 0]) == 'N' && toupper(value[start + 1]) == 'E' && + toupper(value[start + 2]) == 'G') { + neg = true; + start += 3; + } + + int base = 10; + + char *str_end; + res = strtol(&value[start], &str_end, base); + size_t end = str_end - value; + if (start == end) + goto err; + + // consume trailing whitespace + while (value[end] != '\0') { + if (!isspace(value[end])) + goto err; + end++; + } + + assert(end == value_len); + + // apply sign + v = neg ? -res : res; + + if (v < -1 || v > 10) + error("Value %d out of range for note number", v); + + vs8 = (v - 1) * 12 + notes_lut[c - 'A'] + mod; + if (vs8 < 0) + vs8 += 128; + } else { // got a raw value + vs8 = xml_str_to_int(&value[start]); + } + + if (vs8 < 0) + goto err; + + copy_out(out, vs8); + return; +err: + error("Invalid note %s", value); +} + +void +xml_parse_string(const char *value, void *out) +{ + // copies only the pointer to the string + copy_out(out, value); +} + +void +xml_parse_c_identifier(const char *value, void *out) +{ + if (!str_is_c_identifier(value)) + error("Input %s is not a valid C Language identifier", value); + + // copies only the pointer to the string + copy_out(out, value); +} + +void +xml_parse_bool(const char *value, void *out) +{ + bool v; + + // TODO make case-insensitive + if (strequ(value, "true")) + v = true; + else if (strequ(value, "false")) + v = false; + else + error("Invalid value %s for bool", value); + + copy_out(out, v); +} + +void +xml_parse_float(const char *value, void *out) +{ + char *end; + float v = strtof(value, &end); + + if (value == end) + error("Invalid value %s for float", value); + if (v < 0.0f) + error("Only positive floats are allowed"); + + copy_out(out, v); +} + +void +xml_parse_double(const char *value, void *out) +{ + char *end; + double v = strtod(value, &end); + + if (value == end) + error("Invalid value %s for double", value); + if (v < 0.0) + error("Only positive doubles are allowed"); + + copy_out(out, v); +} + +void +xml_get_single_property(void *out, const xmlNodePtr node, const char *name, xml_parser_func parser) +{ + xmlAttrPtr attr = node->properties; + + if (attr == NULL || attr->next != NULL) + error("Expected only property %s on line %d", name, node->line); + + const char *prop_name = XMLSTR_TO_STR(attr->name); + + if (!strequ(prop_name, name)) + error("Unexpected attribute on line %d: got: \"%s\", expected: \"%s\"", node->line, prop_name, name); + + xmlChar *xvalue = xmlNodeListGetString(node->doc, attr->children, 1); + const char *value = XMLSTR_TO_STR(xvalue); + + parser(value, (uint8_t *)out); + + if (parser != xml_parse_string && parser != xml_parse_c_identifier) + free(xvalue); +} + +void +xml_parse_node_by_spec(void *out, const xmlNodePtr node, const xml_attr_spec spec, size_t spec_length) +{ + bool *got = alloca(spec_length * sizeof(bool)); + memset(got, false, spec_length * sizeof(bool)); + + LL_FOREACH(xmlAttrPtr, attr, node->properties) { + const char *name = XMLSTR_TO_STR(attr->name); + bool found = false; + + for (size_t i = 0; i < spec_length; i++) { + if (strequ(name, spec[i].name)) { + // strictly speaking this pointer needs to be freed but we may want to save the string itself + // so we just don't free it and let it clean up when the program terminates + xmlChar *xvalue = xmlNodeListGetString(node->doc, attr->children, 1); + const char *value = XMLSTR_TO_STR(xvalue); + + spec[i].parser_func(value, (uint8_t *)out + spec[i].offset); + + if (spec[i].parser_func != xml_parse_string && spec[i].parser_func != xml_parse_c_identifier) + free(xvalue); // free when we don't need the string in the future, TODO strdup when we do need it? + + got[i] = true; + found = true; + break; + } + } + + if (!found) + error("Unrecognized attribute %s on line %d", name, node->line); + } + + for (size_t i = 0; i < spec_length; i++) { + if (!spec[i].optional && !got[i]) + error("Expected a %s attribute on line %d", spec[i].name, node->line); + } +} + +static void +xml_print_rec(xmlNodePtr base, int *pIndent) +{ + LL_FOREACH(xmlNodePtr, node, base) { + if (node->type != XML_ELEMENT_NODE) + continue; + + fprintf(stdout, "%*cChild is <%s> (%i)\n", *pIndent, ' ', node->name, node->type); + *pIndent += 4; + + LL_FOREACH(xmlAttrPtr, attr, node->properties) { + xmlChar *value = xmlNodeListGetString(node->doc, attr->children, 1); + fprintf(stdout, "%*c- Property <%s> \"%s\"\n", *pIndent, ' ', attr->name, XMLSTR_TO_STR(value)); + free(value); + } + + xml_print_rec(node->children, pIndent); + *pIndent -= 4; + } +} + +void +xml_print_tree(xmlDocPtr document) +{ + xmlNodePtr root = xmlDocGetRootElement(document); + int indent = 4; + fprintf(stdout, "Root is <%s> (%i)\n", root->name, root->type); + + LL_FOREACH(xmlAttrPtr, attr, root->properties) { + xmlChar *value = xmlNodeListGetString(root->doc, attr->children, 1); + fprintf(stdout, "%*c- Property <%s> \"%s\"\n", indent, ' ', attr->name, XMLSTR_TO_STR(value)); + free(value); + } + + xml_print_rec(root->children, &indent); +} diff --git a/tools/audio/xml.h b/tools/audio/xml.h new file mode 100644 index 0000000000..dabfbcfefe --- /dev/null +++ b/tools/audio/xml.h @@ -0,0 +1,61 @@ +/** + * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef XML_H +#define XML_H + +#include +#include +#include + +#include + +#define XMLSTR_TO_STR(s) ((const char *)(s)) + +typedef void (*xml_parser_func)(const char *, void *); + +typedef struct { + const char *name; + bool optional; + xml_parser_func parser_func; + size_t offset; +} xml_attr_spec[]; + +void +xml_parse_int(const char *value, void *out); +void +xml_parse_uint(const char *value, void *out); +void +xml_parse_s16(const char *value, void *out); +void +xml_parse_u8(const char *value, void *out); +void +xml_parse_s8(const char *value, void *out); +void +xml_parse_note_number(const char *value, void *out); +void +xml_parse_string(const char *value, void *out); +void +xml_parse_c_identifier(const char *value, void *out); +void +xml_parse_bool(const char *value, void *out); +void +xml_parse_float(const char *value, void *out); +void +xml_parse_double(const char *value, void *out); + +void +xml_get_single_property(void *out, const xmlNodePtr node, const char *name, xml_parser_func parser); + +void +xml_parse_node_by_spec(void *out, const xmlNodePtr node, const xml_attr_spec spec, size_t spec_length); + +void +xml_print_tree(xmlDocPtr document); + +#endif diff --git a/tools/audio_extraction.py b/tools/audio_extraction.py new file mode 100644 index 0000000000..9c3a202648 --- /dev/null +++ b/tools/audio_extraction.py @@ -0,0 +1,198 @@ +#!/usr/bin/env python3 +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 +# +# Configures and runs baserom audio extraction +# + +import argparse + +import version_config + +from audio.extraction.audio_extract import extract_audio_for_version, GameVersionInfo +from audio.extraction.disassemble_sequence import MMLVersion, SequenceTableSpec, SqSection + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description="baserom audio asset extractor") + parser.add_argument("-o", "--extracted-dir", required=True, help="path to extracted directory") + parser.add_argument("-v", "--version", required=True, help="version name") + parser.add_argument("--read-xml", required=False, action="store_true", help="Read extraction xml files") + parser.add_argument("--write-xml", required=False, action="store_true", help="Write extraction xml files") + args = parser.parse_args() + + version = args.version + + config = version_config.load_version_config(version) + + code_vram = config.dmadata_segments["code"].vram + soundfont_table_code_offset = config.variables["gSoundFontTable"] - code_vram + seq_font_table_code_offset = config.variables["gSequenceFontTable"] - code_vram + seq_table_code_offset = config.variables["gSequenceTable"] - code_vram + sample_bank_table_code_offset = config.variables["gSampleBankTable"] - code_vram + + # List any sequences that are "handwritten", we don't extract these by + # default as we want these checked in for documentation. + handwritten_sequences = (0, 1, 2, 109) + + # Sequence enum names for extraction purposes. + seq_enum_names = ( + "NA_BGM_GENERAL_SFX", + "NA_BGM_NATURE_AMBIENCE", + "NA_BGM_FIELD_LOGIC", + "NA_BGM_FIELD_INIT", + "NA_BGM_FIELD_DEFAULT_1", + "NA_BGM_FIELD_DEFAULT_2", + "NA_BGM_FIELD_DEFAULT_3", + "NA_BGM_FIELD_DEFAULT_4", + "NA_BGM_FIELD_DEFAULT_5", + "NA_BGM_FIELD_DEFAULT_6", + "NA_BGM_FIELD_DEFAULT_7", + "NA_BGM_FIELD_DEFAULT_8", + "NA_BGM_FIELD_DEFAULT_9", + "NA_BGM_FIELD_DEFAULT_A", + "NA_BGM_FIELD_DEFAULT_B", + "NA_BGM_FIELD_ENEMY_INIT", + "NA_BGM_FIELD_ENEMY_1", + "NA_BGM_FIELD_ENEMY_2", + "NA_BGM_FIELD_ENEMY_3", + "NA_BGM_FIELD_ENEMY_4", + "NA_BGM_FIELD_STILL_1", + "NA_BGM_FIELD_STILL_2", + "NA_BGM_FIELD_STILL_3", + "NA_BGM_FIELD_STILL_4", + "NA_BGM_DUNGEON", + "NA_BGM_KAKARIKO_ADULT", + "NA_BGM_ENEMY", + "NA_BGM_BOSS", + "NA_BGM_INSIDE_DEKU_TREE", + "NA_BGM_MARKET", + "NA_BGM_TITLE", + "NA_BGM_LINK_HOUSE", + "NA_BGM_GAME_OVER", + "NA_BGM_BOSS_CLEAR", + "NA_BGM_ITEM_GET", + "NA_BGM_OPENING_GANON", + "NA_BGM_HEART_GET", + "NA_BGM_OCA_LIGHT", + "NA_BGM_JABU_JABU", + "NA_BGM_KAKARIKO_KID", + "NA_BGM_GREAT_FAIRY", + "NA_BGM_ZELDA_THEME", + "NA_BGM_FIRE_TEMPLE", + "NA_BGM_OPEN_TRE_BOX", + "NA_BGM_FOREST_TEMPLE", + "NA_BGM_COURTYARD", + "NA_BGM_GANON_TOWER", + "NA_BGM_LONLON", + "NA_BGM_GORON_CITY", + "NA_BGM_FIELD_MORNING", + "NA_BGM_SPIRITUAL_STONE", + "NA_BGM_OCA_BOLERO", + "NA_BGM_OCA_MINUET", + "NA_BGM_OCA_SERENADE", + "NA_BGM_OCA_REQUIEM", + "NA_BGM_OCA_NOCTURNE", + "NA_BGM_MINI_BOSS", + "NA_BGM_SMALL_ITEM_GET", + "NA_BGM_TEMPLE_OF_TIME", + "NA_BGM_EVENT_CLEAR", + "NA_BGM_KOKIRI", + "NA_BGM_OCA_FAIRY_GET", + "NA_BGM_SARIA_THEME", + "NA_BGM_SPIRIT_TEMPLE", + "NA_BGM_HORSE", + "NA_BGM_HORSE_GOAL", + "NA_BGM_INGO", + "NA_BGM_MEDALLION_GET", + "NA_BGM_OCA_SARIA", + "NA_BGM_OCA_EPONA", + "NA_BGM_OCA_ZELDA", + "NA_BGM_OCA_SUNS", + "NA_BGM_OCA_TIME", + "NA_BGM_OCA_STORM", + "NA_BGM_NAVI_OPENING", + "NA_BGM_DEKU_TREE_CS", + "NA_BGM_WINDMILL", + "NA_BGM_HYRULE_CS", + "NA_BGM_MINI_GAME", + "NA_BGM_SHEIK", + "NA_BGM_ZORA_DOMAIN", + "NA_BGM_APPEAR", + "NA_BGM_ADULT_LINK", + "NA_BGM_MASTER_SWORD", + "NA_BGM_INTRO_GANON", + "NA_BGM_SHOP", + "NA_BGM_CHAMBER_OF_SAGES", + "NA_BGM_FILE_SELECT", + "NA_BGM_ICE_CAVERN", + "NA_BGM_DOOR_OF_TIME", + "NA_BGM_OWL", + "NA_BGM_SHADOW_TEMPLE", + "NA_BGM_WATER_TEMPLE", + "NA_BGM_BRIDGE_TO_GANONS", + "NA_BGM_OCARINA_OF_TIME", + "NA_BGM_GERUDO_VALLEY", + "NA_BGM_POTION_SHOP", + "NA_BGM_KOTAKE_KOUME", + "NA_BGM_ESCAPE", + "NA_BGM_UNDERGROUND", + "NA_BGM_GANONDORF_BOSS", + "NA_BGM_GANON_BOSS", + "NA_BGM_END_DEMO", + "NA_BGM_STAFF_1", + "NA_BGM_STAFF_2", + "NA_BGM_STAFF_3", + "NA_BGM_STAFF_4", + "NA_BGM_FIRE_BOSS", + "NA_BGM_TIMED_MINI_GAME", + "NA_BGM_CUTSCENE_EFFECTS", + ) + + # Some bugged soundfonts report the wrong samplebank. Map them to the correct samplebank for proper sample discovery. + fake_banks = { 37 : 2 } + + # Some audiotable banks have a buffer clearing bug. Indicate which banks suffer from this. + audiotable_buffer_bugs = (0,) + + # Tables have no clear start and end in a sequence. Mark the locations of all tables that appear in sequences. + seq_disas_tables = { + # sequence number : (spec, ...) + 0 : ( + SequenceTableSpec(0x00E1, 128, 0, SqSection.CHAN), + SequenceTableSpec(0x0EE3, 80, 0, SqSection.CHAN), + SequenceTableSpec(0x16D5, 248, 0, SqSection.CHAN), + SequenceTableSpec(0x315E, 499, 0, SqSection.CHAN), + SequenceTableSpec(0x5729, 72, 0, SqSection.CHAN), + SequenceTableSpec(0x5EE5, 8, 0, SqSection.CHAN), + SequenceTableSpec(0x5FF2, 128, 0, SqSection.CHAN), + ), + 1 : ( + SequenceTableSpec(0x0192, 20, 0, SqSection.LAYER), + SequenceTableSpec(0x01BA, 20, 0, SqSection.LAYER), + SequenceTableSpec(0x01E2, 20, 0, SqSection.LAYER), + SequenceTableSpec(0x020A, 20, 0, SqSection.LAYER), + SequenceTableSpec(0x0232, 20, 1, SqSection.LAYER), + SequenceTableSpec(0x025A, 20, 1, SqSection.LAYER), + SequenceTableSpec(0x0282, 20, 1, SqSection.LAYER), + ), + 2 : ( + SequenceTableSpec(0x00BC, 2, 0, SqSection.SEQ), + SequenceTableSpec(0x00C0, 2, 0, SqSection.ARRAY), + ), + 109 : ( + SequenceTableSpec(0x0646, 16, 0, SqSection.CHAN), + ), + } + + version_info = GameVersionInfo(MMLVersion.OOT, + soundfont_table_code_offset, + seq_font_table_code_offset, + seq_table_code_offset, + sample_bank_table_code_offset, + seq_enum_names, + handwritten_sequences, + fake_banks, + audiotable_buffer_bugs, + seq_disas_tables) + + extract_audio_for_version(version_info, args.extracted_dir, args.read_xml, args.write_xml) diff --git a/tools/check_disasm_metadata_unksyms.py b/tools/check_disasm_metadata_unksyms.py new file mode 100755 index 0000000000..a1ddfb6d37 --- /dev/null +++ b/tools/check_disasm_metadata_unksyms.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python3 +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import argparse +from colorama import Fore +from pathlib import Path + +import mapfile_parser + + +# symbols listed here will not be reported as unknown +IGNORE_NTSC_1_2_SYMS_MISSING = """ +func_800ADC5C_unknown func_800ADE30_unknown func_80AEEA48_unknown func_80800AD0_unknown func_80800B08_unknown func_800AF4DC_unknown func_800CDDF8_unknown func_800014E8_unknown func_800AE558_unknown func_800AE064_unknown func_800AE1E0_unknown func_800014FC_unknown func_800ADFE4_unknown func_800CDDC4_unknown func_800AF0E0_unknown func_800AE2B8_unknown func_800AF304_unknown func_800AE020_unknown func_800AE05C_unknown func_800AE408_unknown func_8000161C_unknown func_800AF558_unknown func_800AED1C_unknown func_80001640_unknown func_800ADF4C_unknown func_800015E8_unknown func_800ADF90_unknown func_800ADD14_unknown func_800AE998_unknown func_800AE4C0_unknown func_800AF3DC_unknown func_800AF1C4_unknown func_8009D434_unknown func_800AE35C_unknown func_800AF720_unknown func_800AF370_unknown func_800AE258_unknown func_800AF7F0_unknown func_80001714_unknown func_800AEC94_unknown func_800ADDF0_unknown func_800AE1F8_unknown +__osReallocDebug __osMallocRDebug __osFreeDebug __osMallocDebug +guTranslateF guScaleF guMtxL2F +osEPiWriteIo createSpeedParam +AudioDebug_ProcessInput +func_800FF334 +n64dd_SetDiskVersion +sJpegTask _n64ddSegmentRomStart _n64ddSegmentRomEnd _n64ddSegmentStart _string_n64dd_c +_Putfld _Ldunscale _Genld +""".split() + + +def get_ldscript_syms(ldscript_p: Path): + symbols = set() + for l in ldscript_p.read_text().splitlines(): + if "=" not in l: + continue + sym = l.split("=")[0].strip() + symbols.add(sym) + return symbols + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("-v", "--version", dest="oot_version", required=True) + args = parser.parse_args() + + version = args.oot_version + + ignore_syms_missing = set( + { + "ntsc-1.2": IGNORE_NTSC_1_2_SYMS_MISSING, + }.get(version, ()) + ) + + mapfile = mapfile_parser.mapfile.MapFile() + mapfile_path = Path(f"build/{version}/oot-{version}.map") + mapfile.readMapFile(mapfile_path) + + map_symbols = set() + for segment in mapfile: + for file in segment: + for sym in file: + map_symbols.add(sym.name) + + has_unknown_metadata_syms = False + + undefined_syms_p = Path(f"build/{version}/undefined_syms.txt") + undefined_syms = get_ldscript_syms(undefined_syms_p) + + known_syms = map_symbols | undefined_syms + + for metadata_p in ( + Path(f"tools/disasm/{version}/functions.txt"), + Path(f"tools/disasm/{version}/variables.txt"), + ): + metadata_symbols = get_ldscript_syms(metadata_p) + unknown_metadata_syms = metadata_symbols - known_syms + unknown_metadata_syms -= ignore_syms_missing + if unknown_metadata_syms: + print( + f"{Fore.RED}Found", + len(unknown_metadata_syms), + f"symbols in{Fore.RESET}", + metadata_p, + f"{Fore.RED}that are neither in the map", + f"nor in undefined_syms.txt{Fore.RESET}", + ) + print("Were they renamed and the disasm metadata not updated? (or is the map out of date?)") + print(" ".join(unknown_metadata_syms)) + has_unknown_metadata_syms = True + + if has_unknown_metadata_syms: + exit(1) + else: + print(f"{Fore.GREEN}OK{Fore.RESET}") + + +if __name__ == "__main__": + main() diff --git a/tools/check_format.py b/tools/check_format.py index f6b23a2280..18692cb6d1 100644 --- a/tools/check_format.py +++ b/tools/check_format.py @@ -27,7 +27,7 @@ def get_modified_files_to_format(compare_to): all_src_files, all_extra_files = format.list_files_to_format() # Split modified_files between source files and extra files (see format.py) - # This also filters out deleted files that no logner exist + # This also filters out deleted files that no longer exist modified_src_files_existing = list(modified_files.intersection(all_src_files)) modified_extra_files_existing = list(modified_files.intersection(all_extra_files)) diff --git a/tools/check_ordering.py b/tools/check_ordering.py deleted file mode 100755 index 83eecfacb4..0000000000 --- a/tools/check_ordering.py +++ /dev/null @@ -1,216 +0,0 @@ -#!/usr/bin/env python3 - -# SPDX-FileCopyrightText: 2024 zeldaret -# SPDX-License-Identifier: CC0-1.0 - - -from __future__ import annotations - -import argparse -import dataclasses -import enum -from pathlib import Path -import sys -from typing import BinaryIO - -import elftools.elf.elffile -import mapfile_parser.mapfile - - -@dataclasses.dataclass -class Reloc: - name: str - offset_32: int | None - offset_hi16: int | None - offset_lo16: int | None - addend: int - - -@dataclasses.dataclass -class Pointer: - name: str - addend: int - base_value: int - build_value: int - - -def read_relocs(object_path: Path, section_name: str) -> list[Reloc]: - with open(object_path, "rb") as f: - elffile = elftools.elf.elffile.ELFFile(f) - symtab = elffile.get_section_by_name(".symtab") - data = elffile.get_section_by_name(section_name).data() - - reloc_section = elffile.get_section_by_name(f".rel{section_name}") - if reloc_section is None: - return [] - - relocs = [] - offset_hi16 = 0 - for reloc in reloc_section.iter_relocations(): - reloc_offset = reloc.entry["r_offset"] - reloc_type = reloc.entry["r_info_type"] - reloc_name = symtab.get_symbol(reloc.entry["r_info_sym"]).name - - if reloc_type == 2: # R_MIPS_32 - offset_32 = reloc_offset - addend = int.from_bytes( - data[reloc_offset : reloc_offset + 4], "big", signed=True - ) - relocs.append(Reloc(reloc_name, offset_32, None, None, addend)) - elif reloc_type == 4: # R_MIPS_26 - pass - elif reloc_type == 5: # R_MIPS_HI16 - offset_hi16 = reloc_offset - elif reloc_type == 6: # R_MIPS_LO16 - offset_lo16 = reloc_offset - addend_hi16 = int.from_bytes( - data[offset_hi16 + 2 : offset_hi16 + 4], "big", signed=False - ) - addend_lo16 = int.from_bytes( - data[offset_lo16 + 2 : offset_lo16 + 4], "big", signed=True - ) - addend = (addend_hi16 << 16) + addend_lo16 - relocs.append(Reloc(reloc_name, None, offset_hi16, offset_lo16, addend)) - else: - raise NotImplementedError(f"Unsupported relocation type: {reloc_type}") - - return relocs - - -def read_u32(f: BinaryIO, offset: int) -> int: - f.seek(offset) - return int.from_bytes(f.read(4), "big") - - -def read_u16(f: BinaryIO, offset: int) -> int: - f.seek(offset) - return int.from_bytes(f.read(2), "big") - - -def read_s16(f: BinaryIO, offset: int) -> int: - f.seek(offset) - return int.from_bytes(f.read(2), "big", signed=True) - - -def main(): - parser = argparse.ArgumentParser( - description="Report data/bss reorderings between the baserom and the current build " - "by parsing relocations from the built object files and comparing their final values " - "between the baserom and the current build. " - "Assumes that the only differences are due to ordering and that the text sections of the " - "ROMS are not shifted." - ) - parser.add_argument( - "--oot-version", - "-v", - type=str, - default="gc-eu-mq-dbg", - help="OOT version (default: gc-eu-mq-dbg)", - ) - parser.add_argument( - "--segment", - type=str, - help="ROM segment to check, e.g. 'boot', 'code', or 'ovl_player_actor' (default: all)", - ) - - args = parser.parse_args() - version = args.oot_version - - mapfile = mapfile_parser.mapfile.MapFile() - mapfile.readMapFile(f"build/{version}/oot-{version}.map") - - # Segments built from source code (filtering out assets) - source_code_segments = [] - for mapfile_segment in mapfile: - if ( - args.segment - and mapfile_segment.name != f"..{args.segment}" - and mapfile_segment.name != f"..{args.segment}.bss" - ): - continue - if not ( - mapfile_segment.name.startswith("..boot") - or mapfile_segment.name.startswith("..code") - or mapfile_segment.name.startswith("..buffers") - or mapfile_segment.name.startswith("..ovl_") - ): - continue - source_code_segments.append(mapfile_segment) - - base = open(f"baseroms/{version}/baserom-decompressed.z64", "rb") - build = open(f"build/{version}/oot-{version}.z64", "rb") - - # Find all pointers with different values - pointers = [] - for mapfile_segment in source_code_segments: - for file in mapfile_segment: - if not str(file.filepath).endswith(".o"): - continue - if file.sectionType == ".bss": - continue - for reloc in read_relocs(file.filepath, file.sectionType): - if reloc.offset_32 is not None: - base_value = read_u32(base, file.vrom + reloc.offset_32) - build_value = read_u32(build, file.vrom + reloc.offset_32) - elif reloc.offset_hi16 is not None and reloc.offset_lo16 is not None: - if ( - read_u16(base, file.vrom + reloc.offset_hi16) - != read_u16(build, file.vrom + reloc.offset_hi16) - ) or ( - read_u16(base, file.vrom + reloc.offset_lo16) - != read_u16(build, file.vrom + reloc.offset_lo16) - ): - print( - f"Error: Reference to {reloc.name} in {file.filepath} is in a shifted (or non-matching even ignoring relocs) portion of the ROM.\n" - "Please ensure that the only differences between the baserom and the current build are due to data ordering.", - file=sys.stderr, - ) - sys.exit(1) - - base_value = ( - read_u16(base, file.vrom + reloc.offset_hi16 + 2) << 16 - ) + read_s16(base, file.vrom + reloc.offset_lo16 + 2) - build_value = ( - read_u16(build, file.vrom + reloc.offset_hi16 + 2) << 16 - ) + read_s16(build, file.vrom + reloc.offset_lo16 + 2) - else: - assert False, "Invalid relocation" - - if base_value != build_value: - pointers.append( - Pointer(reloc.name, reloc.addend, base_value, build_value) - ) - - # Remove duplicates and sort by baserom address - pointers = list({p.base_value: p for p in pointers}.values()) - pointers.sort(key=lambda p: p.base_value) - - # Go through sections and report differences - for mapfile_segment in source_code_segments: - for file in mapfile_segment: - pointers_in_section = [ - p - for p in pointers - if file.vram <= p.build_value < file.vram + file.size - ] - if not pointers_in_section: - continue - - print(f"{file.filepath} {file.sectionType} is reordered:") - for i, p in enumerate(pointers_in_section): - if p.addend > 0: - addend_str = f"+0x{p.addend:X}" - elif p.addend < 0: - addend_str = f"-0x{-p.addend:X}" - else: - addend_str = "" - - if i > 0 and p.build_value < pointers_in_section[i - 1].build_value: - print(" --------------------") # BSS wraps around - print( - f" {p.base_value:08X} -> {p.build_value:08X} {p.name}{addend_str}" - ) - - -if __name__ == "__main__": - main() diff --git a/tools/decompress_baserom.py b/tools/decompress_baserom.py index ea0d1fbc92..aa4ac3e1f5 100755 --- a/tools/decompress_baserom.py +++ b/tools/decompress_baserom.py @@ -10,6 +10,7 @@ import io from pathlib import Path import struct +from typing import Iterable import crunch64 import ipl3checksum @@ -101,10 +102,10 @@ def get_str_hash(byte_array): return str(hashlib.md5(byte_array).hexdigest()) -def check_existing_rom(rom_path: Path, correct_str_hash: str): +def check_existing_rom(rom_path: Path, correct_str_hashes: Iterable[str]): # If the baserom exists and is correct, we don't need to change anything if rom_path.exists(): - if get_str_hash(rom_path.read_bytes()) == correct_str_hash: + if get_str_hash(rom_path.read_bytes()) in correct_str_hashes: return True return False @@ -176,15 +177,17 @@ def main(): config = version_config.load_version_config(version) dmadata_start = config.dmadata_start - decompressed_str_hash = (baserom_dir / "checksum.md5").read_text().split()[0] - if version != "hackeroot-mq": - compressed_str_hash = ( - (baserom_dir / "checksum-compressed.md5").read_text().split()[0] + compressed_str_hashes = [] + decompressed_str_hashes = [] + for checksum_stem in config.checksums: + compressed_str_hashes.append( + (baserom_dir / f"{checksum_stem}-compressed.md5").read_text().split()[0] + ) + decompressed_str_hashes.append( + (baserom_dir / f"{checksum_stem}.md5").read_text().split()[0] ) - else: - compressed_str_hash = decompressed_str_hash # HackerOoT change: "just so the variable is defined" - if check_existing_rom(uncompressed_path, decompressed_str_hash): + if check_existing_rom(uncompressed_path, decompressed_str_hashes): print("Found valid baserom - exiting early") return @@ -223,12 +226,12 @@ def main(): # Check to see if the ROM is a "vanilla" ROM str_hash = get_str_hash(file_content) if version in {"gc-eu-mq-dbg", "hackeroot-mq"}: - correct_str_hash = decompressed_str_hash + correct_str_hashes = decompressed_str_hashes else: - correct_str_hash = compressed_str_hash - if str_hash != correct_str_hash: + correct_str_hashes = compressed_str_hashes + if str_hash not in correct_str_hashes: print( - f"Error: Expected a hash of {decompressed_str_hash} after decompression but got {str_hash}!" + f"Error: Expected a hash of {' or '.join(correct_str_hashes)} but got {str_hash}. The baserom has probably been tampered, find a new one" ) exit(1) @@ -243,9 +246,9 @@ def main(): # Double check the hash str_hash = get_str_hash(file_content) - if str_hash != decompressed_str_hash: + if str_hash not in decompressed_str_hashes: print( - f"Error: Expected a hash of {decompressed_str_hash} after decompression but got {str_hash}!" + f"Error: Expected a hash of {' or '.join(decompressed_str_hashes)} after decompression but got {str_hash}!" ) exit(1) diff --git a/tools/disasm/gc-us/file_addresses.csv b/tools/disasm/gc-us/file_addresses.csv deleted file mode 100644 index d0d5f562ee..0000000000 --- a/tools/disasm/gc-us/file_addresses.csv +++ /dev/null @@ -1,7 +0,0 @@ -name,vrom_start,vrom_end,rom_start,rom_end,vram_start,overlay_dir -code,A86000,B8AA60,A62500,AFDAA0,80010EE0, -ovl_file_choose,B8E090,B9DFF0,AFFCF0,B08BF0,80803630,gamestates -ovl_kaleido_scope,B9DFF0,BBA770,B08BF0,B17940,808135B0,misc -ovl_player_actor,BBA770,BE0E80,B17940,B30C90,8082FDA0,actors -ovl_En_Mag,DFA080,DFC9B0,C8E1E0,C8FEA0,80A884E0,actors -ovl_Fishing,EB6810,ECA2E0,D061D0,D13750,80B44FE0,actors diff --git a/tools/disasm/gc-us/files_code.csv b/tools/disasm/gc-us/files_code.csv deleted file mode 100644 index 8e0d572b16..0000000000 --- a/tools/disasm/gc-us/files_code.csv +++ /dev/null @@ -1,467 +0,0 @@ -offset,vram,.text -0,80010EE0,src/code/z_en_a_keep -AA0,80011980,src/code/z_en_item00 -2EA0,80013D80,src/code/z_eff_blure -62D0,800171B0,src/code/z_eff_shield_particle -7930,80018810,src/code/z_eff_spark -8FE0,80019EC0,src/code/z_eff_ss_dead -9790,8001A670,src/code/z_effect -9F10,8001ADF0,src/code/z_effect_soft_sprite -A9B0,8001B890,src/code/z_effect_soft_sprite_old_init -D4D0,8001E3B0,src/code/flg_set -D8F0,8001E7D0,src/code/z_DLF -DB40,8001EA20,src/code/z_actor -1A0E0,8002AFC0,src/code/z_actor_dlftbls -1A230,8002B110,src/code/z_bgcheck -23E10,80034CF0,src/code/code_800430A0 -24130,80035010,src/code/code_80043480 -244C0,800353A0,src/code/z_camera -38AF0,800499D0,src/code/z_collision_btltbls -38B50,80049A30,src/code/z_collision_check -407D0,800516B0,src/code/z_common_data -40860,80051740,src/code/z_debug -40B70,80051A50,src/code/z_debug_display -41030,80051F10,src/code/z_demo -45D10,80056BF0,src/code/code_80069420 -45DA0,80056C80,src/code/z_draw -47CA0,80058B80,src/code/z_sfx_source -47E60,80058D40,src/code/z_elf_message -48540,80059420,src/code/z_face_reaction -48590,80059470,src/code/code_8006C3A0 -48710,800595F0,src/code/z_fcurve_data -48950,80059830,src/code/z_fcurve_data_skelanime -49160,8005A040,src/code/z_horse -49E40,8005AD20,src/code/z_jpeg -4A600,8005B4E0,src/code/z_kaleido_setup -4A9D0,8005B8B0,src/code/z_kanfont -4ABE0,8005BAC0,src/code/z_kankyo -523F0,800632D0,src/code/z_lib -53590,80064470,src/code/z_lifemeter -54930,80065810,src/code/z_lights -559D0,800668B0,src/code/z_malloc -55BB0,80066A90,src/code/z_map_mark -561B0,80067090,src/code/z_prenmi_buff -56270,80067150,src/code/z_nulltask -562F0,800671D0,src/code/z_olib -569E0,800678C0,src/code/z_onepointdemo -5A980,8006B860,src/code/z_map_exp -5C520,8006D400,src/code/z_parameter -67BF0,80078AD0,src/code/z_path -67DC0,80078CA0,src/code/z_frame_advance -67E70,80078D50,src/code/z_player_lib -6B8E0,8007C7C0,src/code/z_prenmi -6BA80,8007C960,src/code/z_quake -6C8F0,8007D7D0,src/code/z_rcp -6E1B0,8007F090,src/code/z_room -6F9A0,80080880,src/code/z_sample -6FDA0,80080C80,src/code/code_80097A00 -6FF60,80080E40,src/code/z_scene -71410,800822F0,src/code/z_scene_table -77C10,80088AF0,src/code/z_skelanime -7C600,8008D4E0,src/code/z_skin -7D1A0,8008E080,src/code/z_skin_awb -7DAB0,8008E990,src/code/z_skin_matrix -7EE50,8008FD30,src/code/z_sram -80190,80091070,src/code/z_ss_sram -80360,80091240,src/code/z_rumble -805E0,800914C0,src/code/z_view -81CE0,80092BC0,src/code/z_vimode -82850,80093730,src/code/z_viscvg -829F0,800938D0,src/code/z_vismono -83210,800940F0,src/code/z_viszbuf -834A0,80094380,src/code/z_vr_box -85D70,80096C50,src/code/z_vr_box_draw -86450,80097330,src/code/z_player_call -865C0,800974A0,src/code/z_fbdemo -86FE0,80097EC0,src/code/z_fbdemo_triforce -875A0,80098480,src/code/z_fbdemo_wipe1 -87A10,800988F0,src/code/z_fbdemo_circle -880D0,80098FB0,src/code/z_fbdemo_fade -88430,80099310,src/code/shrink_window -885A0,80099480,src/code/code_800BB0A0 -88A70,80099950,src/code/z_kaleido_manager -88CA0,80099B80,src/code/z_kaleido_scope_call -88F80,80099E60,src/code/z_play -8C9E0,8009D8C0,src/code/PreRender -8EAD0,8009F9B0,src/code/TwoHeadGfxArena -8ECE0,8009FBC0,src/code/TwoHeadArena -8EEA0,8009FD80,src/code/audio_stop_all_sfx -8EEF0,8009FDD0,src/code/audio_thread_manager -8F300,800A01E0,src/code/title_setup -8F370,800A0250,src/code/game -8FAF0,800A09D0,src/code/gamealloc -8FC30,800A0B10,src/code/graph -905D0,800A14B0,src/code/gfxalloc -90630,800A1510,src/code/listalloc -90780,800A1660,src/code/main -90AE0,800A19C0,src/code/padmgr -915E0,800A24C0,src/code/sched -92260,800A3140,src/code/speed_meter -92CA0,800A3B80,src/code/sys_cfb -92DC0,800A3CA0,src/code/sys_math -93060,800A3F40,src/code/sys_math3d -98E30,800A9D10,src/code/sys_math_atan -99060,800A9F40,src/code/sys_matrix -9B460,800AC340,src/code/sys_ucode -9B4B0,800AC390,src/code/sys_rumble -9B810,800AC6F0,src/code/code_800D31A0 -9B840,800AC720,src/code/irqmgr -9BE60,800ACD40,src/code/fault -9E6B0,800AF590,src/code/fault_drawer -9F130,800B0010,src/code/kanread -9FC20,800B0B00,src/audio/lib/synthesis -A2D80,800B3C60,src/audio/lib/heap -A6150,800B7030,src/audio/lib/load -A9F40,800BAE20,src/audio/lib/thread -AB7A0,800BC680,src/audio/lib/dcache -AB820,800BC700,src/audio/lib/aisetnextbuf -AB8A0,800BC780,src/audio/lib/playback -AD820,800BE700,src/audio/lib/effects -AE2A0,800BF180,src/audio/lib/seqplayer -B18C0,800C27A0,src/audio/general -B7A50,800C8930,src/audio/sfx -B98B0,800CA790,src/audio/sequence -BB4D0,800CC3B0,src/code/gfxprint -BC240,800CD120,src/code/rcp_utils -BC2A0,800CD180,src/code/loadfragment2 -BC300,800CD1E0,src/code/relocation -BC540,800CD420,src/code/load -BC610,800CD4F0,src/code/code_800FC620 -BC950,800CD830,src/code/padutils -BCB40,800CDA20,src/code/padsetup -BCC80,800CDB60,src/code/fp_math -BD190,800CE070,src/code/fp -BD2F0,800CE1D0,src/code/system_malloc -BD4C0,800CE3A0,src/code/rand -BD680,800CE560,src/code/__osMalloc -BE430,800CF310,src/libultra/libc/sprintf -BE500,800CF3E0,src/code/printutils -BE560,800CF440,src/code/sleep -BE700,800CF5E0,src/code/jpegutils -BEC10,800CFAF0,src/code/jpegdecoder -BF200,800D00E0,src/libultra/mgu/scale -BF2B0,800D0190,src/libultra/gu/sinf -BF470,800D0350,src/libultra/gu/sins -BF4E0,800D03C0,src/libultra/io/sptask -BF7A0,800D0680,src/libultra/io/motor -BFB70,800D0A50,src/libultra/io/siacs -BFC30,800D0B10,src/libultra/io/controller -BFF10,800D0DF0,src/libultra/io/contreaddata -C00F0,800D0FD0,src/libultra/gu/perspective -C0380,800D1260,src/libultra/io/sprawdma -C0410,800D12F0,src/libultra/io/sirawdma -C04C0,800D13A0,src/libultra/io/sptaskyield -C04E0,800D13C0,src/libultra/mgu/mtxidentf -C0530,800D1410,src/libultra/gu/lookat -C0850,800D1730,src/libultra/os/stoptimer -C0940,800D1820,src/libultra/gu/sqrtf -C0950,800D1830,src/libultra/os/afterprenmi -C0970,800D1850,src/libultra/io/contquery -C0A10,800D18F0,src/libultra/gu/lookathil -C1290,800D2170,src/libultra/libc/xprintf -C1F70,800D2E50,src/libultra/libc/string -C2010,800D2EF0,src/libultra/io/sp -C2040,800D2F20,src/libultra/mgu/mtxident -C2090,800D2F70,src/libultra/gu/position -C22A0,800D3180,src/libultra/io/sptaskyielded -C2300,800D31E0,src/libultra/gu/rotate -C24D0,800D33B0,src/libultra/io/aisetfreq -C2620,800D3500,src/libultra/os/getactivequeue -C2640,800D3520,src/libultra/mgu/normalize -C26A0,800D3580,src/libultra/io/dpgetstat -C26B0,800D3590,src/libultra/io/dpsetstat -C26C0,800D35A0,src/libultra/gu/ortho -C2880,800D3760,src/libultra/gu/cosf -C29F0,800D38D0,src/libultra/gu/coss -C2A20,800D3900,src/libultra/io/visetevent -C2A80,800D3960,src/libultra/gu/us2dex -C2C00,800D3AE0,src/libultra/io/pfsselectbank -C2C80,800D3B60,src/libultra/io/contsetch -C2CE0,800D3BC0,src/libultra/io/aigetlen -C2D00,800D3BE0,src/libultra/mgu/translate -C2DD0,800D3CB0,src/libultra/io/contramwrite -C3020,800D3F00,src/libultra/io/pfsgetstatus -C3250,800D4130,src/libultra/io/contpfs -C3DD0,800D4CB0,src/libultra/io/contramread -C4000,800D4EE0,src/libultra/io/crc -C4170,800D5050,src/libultra/io/pfsisplug -C4460,800D5340,src/libultra/os/settimer -C45F0,800D54D0,src/libultra/libc/xldtob -C5100,800D5FE0,src/libultra/libc/ldiv -C5290,800D6170,src/libultra/libc/xlitob -C5530,800D6410,src/libultra/io/spgetstat -C5540,800D6420,src/libultra/io/spsetstat -C5550,800D6430,src/libultra/os/writebackdcacheall -C5580,800D6460,src/libultra/os/getcurrfaultedthread -C55A0,800D6480,src/libultra/mgu/mtxf2l -C5610,800D64F0,src/libultra/libc/llcvt -C5820,800D6700,src/libultra/io/vigetcurrframebuf -C5860,800D6740,src/libultra/io/spsetpc -C5890,800D6770,src/libultra/libc/sqrt -C58A0,800D6780,src/libultra/libc/absf -C58B0,800D6790,src/code/fmodf -C5900,800D67E0,src/code/__osMemset -C5930,800D6810,src/code/__osMemmove -C59C0,800D68A0,src/code/z_message -D1060,800E1F40,src/code/z_game_over -D15A0,800E2480,src/code/z_construct -D2960,800E3840,data/rsp.text - -offset,vram,.data -D5CC0,800E6BA0,src/code/z_en_a_keep -D5D60,800E6C40,src/code/z_en_item00 -D6000,800E6EE0,src/code/z_eff_blure -D60B0,800E6F90,src/code/z_eff_shield_particle -D6100,800E6FE0,src/code/z_effect -D6150,800E7030,src/code/z_effect_soft_sprite -D6160,800E7040,src/code/z_effect_soft_sprite_old_init -D6250,800E7130,src/code/z_effect_soft_sprite_dlftbls -D6660,800E7540,src/code/flg_set -D6820,800E7700,src/code/z_actor -D6B40,800E7A20,src/code/z_actor_dlftbls -DA630,800EB510,src/code/z_bgcheck -DA780,800EB660,src/code/z_camera -DDCD0,800EEBB0,src/code/z_collision_btltbls -DDFB0,800EEE90,src/code/z_collision_check -DE260,800EF140,src/code/z_debug -DE290,800EF170,src/code/z_debug_display -DE2E0,800EF1C0,src/code/z_demo -DE440,800EF320,src/code/z_draw -DF4C0,800F03A0,src/code/z_elf_message -DF510,800F03F0,src/code/z_face_reaction -DF950,800F0830,src/code/z_game_dlftbls -DFA70,800F0950,src/code/z_horse -DFB80,800F0A60,src/code/z_jpeg -DFBC0,800F0AA0,src/code/z_kaleido_setup -DFC10,800F0AF0,src/code/z_kankyo -E0000,800F0EE0,src/code/z_lib -E0030,800F0F10,src/code/z_lifemeter -E0150,800F1030,src/code/z_lights -E0160,800F1040,src/code/z_map_mark -E0220,800F1100,src/code/z_onepointdemo -E3B40,800F4A20,src/code/z_map_exp -E3B60,800F4A40,src/code/z_map_data -E5960,800F6840,src/code/z_parameter -E5C60,800F6B40,src/code/z_player_lib -E6340,800F7220,src/code/z_quake -E6370,800F7250,src/code/z_rcp -E7190,800F8070,src/code/z_room -E7210,800F80F0,src/code/code_80097A00 -E7590,800F8470,src/code/z_scene -E7610,800F84F0,src/code/object_table -E82B0,800F9190,src/code/z_scene_table -EA4C0,800FB3A0,src/code/z_skelanime -EA4E0,800FB3C0,src/code/z_skin_matrix -EA520,800FB400,src/code/z_sram -EA6D0,800FB5B0,src/code/z_ss_sram -EA780,800FB660,data/unk_8012ABC0.data -EA7B0,800FB690,src/code/z_view -EA7C0,800FB6A0,src/code/z_viscvg -EA850,800FB730,src/code/z_vr_box -EAB50,800FBA30,src/code/z_player_call -EAB70,800FBA50,src/code/z_fbdemo -EABF0,800FBAD0,src/code/z_fbdemo_triforce -EACC0,800FBBA0,src/code/z_fbdemo_wipe1 -EB760,800FC640,src/code/z_fbdemo_circle -ECA60,800FD940,src/code/z_fbdemo_fade -ECA90,800FD970,src/code/shrink_window -ECAA0,800FD980,src/code/z_kaleido_manager -ECAF0,800FD9D0,src/code/z_play -ECB00,800FD9E0,src/code/audio_stop_all_sfx -ECB10,800FD9F0,src/code/graph -ECB20,800FDA00,src/code/main -ECB30,800FDA10,src/code/padmgr -ECB40,800FDA20,src/code/speed_meter -ECB70,800FDA50,src/code/sys_math -ECBB0,800FDA90,src/code/sys_math_atan -ED3C0,800FE2A0,src/code/sys_matrix -ED440,800FE320,src/code/sys_ucode -ED450,800FE330,src/code/sys_rumble -ED460,800FE340,src/code/irqmgr -ED480,800FE360,src/code/fault -ED4E0,800FE3C0,src/code/fault_drawer -ED520,800FE400,src/audio/lib/data -EF930,80100810,src/audio/lib/synthesis -EF960,80100840,src/audio/lib/load -EF970,80100850,src/audio/lib/thread -EF990,80100870,src/audio/lib/aisetnextbuf -EF9A0,80100880,src/audio/lib/effects -EF9B0,80100890,src/audio/lib/seqplayer -EFA00,801008E0,src/audio/general -F1120,80102000,src/audio/sfx_params -F24F0,801033D0,src/audio/data -F2560,80103440,src/audio/session_config -F2D00,80103BE0,src/code/logseverity -F2D10,80103BF0,src/code/gfxprint -F35C0,801044A0,src/code/code_800FC620 -F35E0,801044C0,src/code/fp -F35F0,801044D0,src/code/rand -F3600,801044E0,src/code/__osMalloc -F3610,801044F0,src/libultra/gu/sins -F3E10,80104CF0,src/libultra/io/siacs -F3E20,80104D00,src/libultra/io/controller -F3E30,80104D10,src/libultra/libc/xprintf -F3E80,80104D60,src/libultra/gu/position -F3E90,80104D70,src/libultra/gu/rotate -F3EA0,80104D80,src/libultra/io/vimodefpallan1 -F3EF0,80104DD0,src/libultra/io/contpfs -F3F00,80104DE0,src/libultra/io/contramread -F3F10,80104DF0,src/libultra/libc/xlitob - -offset,vram,.rodata -F3F40,80104E20,src/code/z_en_a_keep -F3F90,80104E70,src/code/z_en_item00 -F4200,801050E0,src/code/z_eff_blure -F4230,80105110,src/code/z_eff_shield_particle -F4240,80105120,src/code/z_eff_spark -F4250,80105130,src/code/z_eff_ss_dead -F4260,80105140,src/code/z_effect_soft_sprite_old_init -F4280,80105160,src/code/flg_set -F4610,801054F0,src/code/z_actor -F4BC0,80105AA0,src/code/z_actor_dlftbls -F4C10,80105AF0,src/code/z_bgcheck -F4CB0,80105B90,src/code/code_80043480 -F4CC0,80105BA0,src/code/z_camera -F5440,80106320,src/code/z_collision_check -F5490,80106370,src/code/z_debug -F54A0,80106380,src/code/z_demo -F5980,80106860,src/code/z_draw -F5990,80106870,src/code/z_elf_message -F5AB0,80106990,src/code/z_fcurve_data -F5AC0,801069A0,src/code/z_fcurve_data_skelanime -F5AD0,801069B0,src/code/z_horse -F5AE0,801069C0,src/code/z_jpeg -F5B70,80106A50,src/code/z_kankyo -F5C20,80106B00,src/code/z_lib -F5C30,80106B10,src/code/z_lifemeter -F5C50,80106B30,src/code/z_lights -F5C60,80106B40,src/code/z_map_mark -F5CC0,80106BA0,src/code/z_olib -F5CE0,80106BC0,src/code/z_onepointdemo -F65A0,80107480,src/code/z_map_exp -F68C0,801077A0,src/code/z_parameter -F6AD0,801079B0,src/code/z_path -F6AE0,801079C0,src/code/z_player_lib -F6B40,80107A20,src/code/z_quake -F6BD0,80107AB0,src/code/z_room -F6C10,80107AF0,src/code/z_sample -F6C20,80107B00,src/code/z_scene_table -F6C60,80107B40,src/code/z_skelanime -F6C80,80107B60,src/code/z_skin -F6C90,80107B70,src/code/z_skin_matrix -F6CA0,80107B80,src/code/z_sram -F6D10,80107BF0,src/code/z_rumble -F6D20,80107C00,src/code/z_view -F6D30,80107C10,src/code/z_vr_box -F6E20,80107D00,src/code/z_fbdemo_triforce -F6E30,80107D10,src/code/z_fbdemo_wipe1 -F6E40,80107D20,src/code/z_fbdemo_circle -F6E50,80107D30,src/code/code_800BB0A0 -F6E60,80107D40,src/code/z_kaleido_manager -F6E80,80107D60,src/code/z_play -F6F40,80107E20,src/code/game -F6F60,80107E40,src/code/graph -F6FB0,80107E90,src/code/main -F6FE0,80107EC0,src/code/padmgr -F6FF0,80107ED0,src/code/sys_cfb -F7000,80107EE0,src/code/sys_math -F7010,80107EF0,src/code/sys_math3d -F70A0,80107F80,src/code/sys_math_atan -F70B0,80107F90,src/code/sys_matrix -F70E0,80107FC0,src/code/irqmgr -F7100,80107FE0,src/code/fault -F7B10,801089F0,src/code/fault_drawer -F7F40,80108E20,src/audio/lib/synthesis -F7F60,80108E40,src/audio/lib/heap -F7F90,80108E70,src/audio/lib/load -F8000,80108EE0,src/audio/lib/thread -F8130,80109010,src/audio/lib/playback -F8160,80109040,src/audio/lib/effects -F8190,80109070,src/audio/lib/seqplayer -F87D0,801096B0,src/audio/general -F8960,80109840,src/audio/sfx -F8980,80109860,src/audio/sequence -F8A00,801098E0,src/audio/session_config -F8A10,801098F0,src/code/gfxprint -F8A30,80109910,src/code/fp_math -F8A80,80109960,src/code/__osMalloc -F8D40,80109C20,src/libultra/gu/sinf -F8D90,80109C70,src/libultra/gu/perspective -F8DA0,80109C80,src/libultra/gu/lookathil -F8DB0,80109C90,src/libultra/libc/xprintf -F8EB0,80109D90,src/libultra/gu/cosf -F8F00,80109DE0,src/libultra/gu/libm_vals -F8F10,80109DF0,src/libultra/libc/xldtob -F8F70,80109E50,src/libultra/libc/llcvt - -offset,vram,.data -F8F80,80109E60,src/code/z_message -101910,801127F0,src/code/z_game_over - -offset,vram,.rodata -101920,80112800,src/code/z_message -101D40,80112C20,src/code/z_game_over -101DA0,80112C80,data/audio_tables.rodata -102940,80113820,data/rsp.rodata - -offset,vram,.bss -104A60,80115940,src/code/z_en_item00 -104A70,80115950,src/code/z_effect -108860,80119740,src/code/flg_set -108870,80119750,src/code/z_actor -1088F0,801197D0,src/code/z_actor_dlftbls -108900,801197E0,src/code/z_bgcheck -108A20,80119900,src/code/z_camera -108B00,801199E0,src/code/z_collision_check -10A260,8011B140,src/code/z_common_data -10B690,8011C570,src/code/z_debug -10B8B0,8011C790,src/code/z_debug_display -10B8C0,8011C7A0,src/code/z_demo -10B8F0,8011C7D0,src/code/z_kankyo -10B9C0,8011C8A0,src/code/z_lifemeter -10B9F0,8011C8D0,src/code/z_lights -10BB80,8011CA60,src/code/z_malloc -10BBB0,8011CA90,src/code/z_map_mark -10BBC0,8011CAA0,src/code/z_map_exp -10BBD0,8011CAB0,src/code/z_parameter -10BBF0,8011CAD0,src/code/z_player_lib -10BC10,8011CAF0,src/code/z_quake -10BCA0,8011CB80,src/code/z_skelanime -10BCB0,8011CB90,src/code/z_skin -10CBC0,8011DAA0,src/code/z_rumble -10CCD0,8011DBB0,src/code/z_vr_box_draw -10CCE0,8011DBC0,src/code/z_player_call -10CCF0,8011DBD0,src/code/db_camera -10CCF0,8011DBD0,src/code/mempak -10CCF0,8011DBD0,src/code/z_kaleido_scope_call -10CD10,8011DBF0,src/code/z_play -10CE20,8011DD00,src/code/game -10CF00,8011DDE0,src/code/graph -10CF70,8011DE50,src/code/main -110E00,80121CE0,src/code/padmgr -110E10,80121CF0,src/code/sched -110E30,80121D10,src/code/speed_meter -110EA0,80121D80,src/code/sys_cfb -110EB0,80121D90,src/code/sys_math3d -1110D0,80121FB0,src/code/sys_matrix -1110E0,80121FC0,src/code/fault -111F60,80122E40,src/code/fault_drawer -111FC0,80122EA0,src/audio/lib/load -112080,80122F60,src/audio/general -112280,80123160,src/audio/sfx -114A90,80125970,src/audio/sequence -115850,80126730,src/audio/session_config -11BD60,8012CC40,src/code/gfxprint -11BD70,8012CC50,src/code/fp_math -11BD80,8012CC60,src/code/system_malloc -11BDB0,8012CC90,src/code/rand -11BDC0,8012CCA0,src/code/__osMalloc -11BDD0,8012CCB0,src/code/jpegdecoder -11BDE0,8012CCC0,src/libultra/io/sptask -11BE20,8012CD00,src/libultra/io/motor -11BF20,8012CE00,src/libultra/io/siacs -11BF40,8012CE20,src/libultra/io/controller -11BFD0,8012CEB0,src/libultra/io/contpfs -11C0D0,8012CFB0,src/libultra/io/pfsisplug -11C110,8012CFF0,src/code/z_message -11C130,8012D010,.end diff --git a/tools/disasm/gc-us/files_ovl_file_choose.csv b/tools/disasm/gc-us/files_ovl_file_choose.csv deleted file mode 100644 index aded105dd8..0000000000 --- a/tools/disasm/gc-us/files_ovl_file_choose.csv +++ /dev/null @@ -1,22 +0,0 @@ -offset,vram,.text -0,80803630,src/overlays/gamestates/ovl_file_choose/z_file_copy_erase -3040,80806670,src/overlays/gamestates/ovl_file_choose/z_file_nameset -8490,8080BAC0,src/overlays/gamestates/ovl_file_choose/z_file_choose - -offset,vram,.data -EC40,80812270,src/overlays/gamestates/ovl_file_choose/z_file_nameset_data -F320,80812950,src/overlays/gamestates/ovl_file_choose/z_file_copy_erase -F360,80812990,src/overlays/gamestates/ovl_file_choose/z_file_nameset -F500,80812B30,src/overlays/gamestates/ovl_file_choose/z_file_choose - -offset,vram,.rodata -F7F0,80812E20,src/overlays/gamestates/ovl_file_choose/z_file_nameset -F800,80812E30,src/overlays/gamestates/ovl_file_choose/z_file_choose - -offset,vram,.ovl -F820,80812E50,src/overlays/gamestates/ovl_file_choose/ovl_file_choose_reloc - -offset,vram,.bss -FF60,80813590,src/overlays/gamestates/ovl_file_choose/z_file_copy_erase -FF70,808135A0,src/overlays/gamestates/ovl_file_choose/z_file_nameset -FF80,808135B0,.end diff --git a/tools/disasm/gc-us/files_ovl_kaleido_scope.csv b/tools/disasm/gc-us/files_ovl_kaleido_scope.csv deleted file mode 100644 index 27333f248e..0000000000 --- a/tools/disasm/gc-us/files_ovl_kaleido_scope.csv +++ /dev/null @@ -1,34 +0,0 @@ -offset,vram,.text -0,808135B0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect -2400,808159B0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug -43B0,80817960,src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment -5E30,808193E0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_item -7E20,8081B3D0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_map -B100,8081E6B0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt -B300,8081E8B0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope -152C0,80828870,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark - -offset,vram,.data -15980,80828F30,src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect -15B30,808290E0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug -15D00,808292B0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment -15D30,808292E0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_item -15DA0,80829350,src/overlays/misc/ovl_kaleido_scope/z_kaleido_map -15FF0,808295A0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt -16000,808295B0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope -169C0,80829F70,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark -16A10,80829FC0,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark_data - -offset,vram,.rodata -1AB70,8082E120,src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug -1AC50,8082E200,src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment -1AC60,8082E210,src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope -1AF40,8082E4F0,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark -1AFF0,8082E5A0,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark_data - -offset,vram,.ovl -1B070,8082E620,src/overlays/misc/ovl_kaleido_scope/ovl_kaleido_scope_reloc - -offset,vram,.bss -1C780,8082FD30,src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope -1C7F0,8082FDA0,.end diff --git a/tools/disasm/gc-us/functions.txt b/tools/disasm/gc-us/functions.txt deleted file mode 100644 index 6a84ee67b8..0000000000 --- a/tools/disasm/gc-us/functions.txt +++ /dev/null @@ -1,13135 +0,0 @@ -entrypoint = 0x80000400; // type:func -cleararena = 0x80000460; // type:func -bootproc = 0x80000498; // type:func -Main_ThreadEntry = 0x800005A0; // type:func -Idle_ThreadEntry = 0x8000063C; // type:func -ViConfig_UpdateVi = 0x80000830; // type:func -ViConfig_UpdateBlack = 0x80000930; // type:func -DmaMgr_DmaRomToRam = 0x80000980; // type:func -DmaMgr_AudioDmaHandler = 0x80000B04; // type:func -DmaMgr_DmaFromDriveRom = 0x80000B24; // type:func -DmaMgr_FindFileName = 0x80000BC8; // type:func -DmaMgr_GetFileName = 0x80000BD8; // type:func -DmaMgr_ProcessRequest = 0x80000BEC; // type:func -DmaMgr_ThreadEntry = 0x80000D78; // type:func -DmaMgr_RequestAsync = 0x80000DF8; // type:func -DmaMgr_RequestSync = 0x80000E5C; // type:func -DmaMgr_Init = 0x80000ED8; // type:func -Yaz0_FirstDMA = 0x80000FC0; // type:func -Yaz0_NextDMA = 0x80001060; // type:func -Yaz0_DecompressImpl = 0x8000114C; // type:func -Yaz0_Decompress = 0x800012B4; // type:func -Locale_Init = 0x80001300; // type:func -Locale_ResetRegion = 0x800013AC; // type:func -osSyncPrintf = 0x800013DC; // type:func -osDriveRomInit = 0x80001420; // type:func -Mio0_Decompress = 0x80001600; // type:func -StackCheck_Init = 0x800016B0; // type:func -StackCheck_Cleanup = 0x80001788; // type:func -StackCheck_GetState = 0x800017F8; // type:func -StackCheck_CheckAll = 0x80001870; // type:func -StackCheck_Check = 0x800018C8; // type:func -LogUtils_HungupThread = 0x80001900; // type:func -LogUtils_ResetHungup = 0x80001934; // type:func -__osPiCreateAccessQueue = 0x80001960; // type:func -__osPiGetAccess = 0x800019B0; // type:func -__osPiRelAccess = 0x800019F4; // type:func -osSendMesg = 0x80001A20; // type:func -osStopThread = 0x80001B70; // type:func -osViExtendVStart = 0x80001C30; // type:func -osRecvMesg = 0x80001C40; // type:func -__createSpeedParam = 0x80001D80; // type:func -__osInitialize_common = 0x80001E1C; // type:func -__osInitialize_autodetect = 0x800020C8; // type:func -__ull_rshift = 0x800020D0; // type:func -__ull_rem = 0x800020FC; // type:func -__ull_div = 0x80002138; // type:func -__ll_lshift = 0x80002174; // type:func -__ll_rem = 0x800021A0; // type:func -__ll_div = 0x800021DC; // type:func -__ll_mul = 0x80002238; // type:func -__ull_divremi = 0x80002268; // type:func -__ll_mod = 0x800022C8; // type:func -__ll_rshift = 0x80002364; // type:func -__osExceptionPreamble = 0x80002390; // type:func -osDestroyThread = 0x80002D00; // type:func -bzero = 0x80002E10; // type:func -osCreateThread = 0x80002F10; // type:func -__osSetSR = 0x80003060; // type:func -__osGetSR = 0x80003070; // type:func -osWritebackDCache = 0x80003080; // type:func -osViGetNextFramebuffer = 0x80003100; // type:func -osCreatePiManager = 0x80003140; // type:func -__osDevMgrMain = 0x800032C0; // type:func -__osPiRawStartDma = 0x800036D0; // type:func -osVirtualToPhysical = 0x800037A0; // type:func -osViBlack = 0x80003820; // type:func -__osSiRawReadIo = 0x80003890; // type:func -osGetThreadId = 0x800038E0; // type:func -osSetIntMask = 0x80003900; // type:func -osViSetMode = 0x800039A0; // type:func -__osProbeTLB = 0x80003A00; // type:func -osGetMemSize = 0x80003AC0; // type:func -osSetEventMesg = 0x80003BE0; // type:func -osUnmapTLBAll = 0x80003CA0; // type:func -osEPiStartDma = 0x80003CF0; // type:func -osInvalICache = 0x80003D90; // type:func -osCreateMesgQueue = 0x80003E10; // type:func -osInvalDCache = 0x80003E40; // type:func -__osSiDeviceBusy = 0x80003EF0; // type:func -osJamMesg = 0x80003F20; // type:func -osSetThreadPri = 0x80004070; // type:func -osGetThreadPri = 0x80004150; // type:func -__osEPiRawReadIo = 0x80004170; // type:func -osViSwapBuffer = 0x800042D0; // type:func -__osEPiRawStartDma = 0x80004320; // type:func -bcmp = 0x80004500; // type:func -osGetTime = 0x80004620; // type:func -__osTimerServicesInit = 0x800046B0; // type:func -__osTimerInterrupt = 0x8000473C; // type:func -__osSetTimerIntr = 0x800048B4; // type:func -__osInsertTimer = 0x80004954; // type:func -osGetCount = 0x80004AE0; // type:func -__osSetGlobalIntMask = 0x80004AF0; // type:func -__osSetCompare = 0x80004B40; // type:func -bcopy = 0x80004B50; // type:func -__osResetGlobalIntMask = 0x80004E60; // type:func -__osDisableInt = 0x80004EC0; // type:func -__osRestoreInt = 0x80004F30; // type:func -__osViInit = 0x80004F50; // type:func -__osViSwapContext = 0x80005070; // type:func -osPiGetCmdQueue = 0x80005370; // type:func -osEPiReadIo = 0x800053A0; // type:func -osViSetSpecialFeatures = 0x800053F0; // type:func -osCartRomInit = 0x80005550; // type:func -__osSetFpcCsr = 0x800056B0; // type:func -__osGetFpcCsr = 0x800056C0; // type:func -osMapTLBRdb = 0x800056D0; // type:func -osYieldThread = 0x80005730; // type:func -__osGetCause = 0x80005780; // type:func -__osEPiRawWriteIo = 0x80005790; // type:func -__osSiRawWriteIo = 0x800058F0; // type:func -osCreateViManager = 0x80005940; // type:func -viMgrMain = 0x80005AC0; // type:func -__osViGetCurrentContext = 0x80005C50; // type:func -osStartThread = 0x80005C60; // type:func -osViSetYScale = 0x80005DB0; // type:func -osViSetXScale = 0x80005E00; // type:func -__osSetHWIntrRoutine = 0x80005F10; // type:func -__osGetHWIntrRoutine = 0x80005F80; // type:func -__osSetWatchLo = 0x80005FB0; // type:func -EnAObj_SetupAction = 0x80010EE0; // type:func -EnAObj_Init = 0x80010EEC; // type:func -EnAObj_Destroy = 0x8001122C; // type:func -EnAObj_WaitFinishedTalking = 0x80011288; // type:func -EnAObj_SetupWaitTalk = 0x800112B8; // type:func -EnAObj_WaitTalk = 0x800112E0; // type:func -EnAObj_SetupBlockRot = 0x80011394; // type:func -EnAObj_BlockRot = 0x800113E4; // type:func -EnAObj_SetupBoulderFragment = 0x80011504; // type:func -EnAObj_BoulderFragment = 0x8001152C; // type:func -EnAObj_SetupBlock = 0x8001164C; // type:func -EnAObj_Block = 0x8001168C; // type:func -EnAObj_Update = 0x80011774; // type:func -EnAObj_Draw = 0x80011890; // type:func -EnItem00_SetupAction = 0x80011980; // type:func -EnItem00_Init = 0x8001198C; // type:func -EnItem00_Destroy = 0x80011FF4; // type:func -func_8001DFC8 = 0x80012020; // type:func -func_8001E1C8 = 0x80012220; // type:func -func_8001E304 = 0x8001235C; // type:func -EnItem00_Collected = 0x80012620; // type:func -EnItem00_Update = 0x80012778; // type:func -EnItem00_Draw = 0x80012DF8; // type:func -EnItem00_DrawRupee = 0x80012F90; // type:func -EnItem00_DrawCollectible = 0x800130A8; // type:func -EnItem00_DrawHeartContainer = 0x800131E8; // type:func -EnItem00_DrawHeartPiece = 0x800132E0; // type:func -func_8001F404 = 0x80013378; // type:func -Item_DropCollectible = 0x800134C0; // type:func -Item_DropCollectible2 = 0x800136F8; // type:func -Item_DropCollectibleRandom = 0x800138CC; // type:func -EffectBlure_AddVertex = 0x80013D80; // type:func -EffectBlure_AddSpace = 0x800140A4; // type:func -EffectBlure_InitElements = 0x800140E8; // type:func -EffectBlure_Init1 = 0x800141A0; // type:func -EffectBlure_Init2 = 0x800142B0; // type:func -EffectBlure_Destroy = 0x800143E4; // type:func -EffectBlure_Update = 0x800143F0; // type:func -EffectBlure_UpdateFlags = 0x80014854; // type:func -EffectBlure_GetComputedValues = 0x800149C4; // type:func -EffectBlure_SetupSmooth = 0x80014ED8; // type:func -EffectBlure_DrawElemNoInterpolation = 0x80014F0C; // type:func -EffectBlure_DrawElemHermiteInterpolation = 0x800153E0; // type:func -EffectBlure_DrawSmooth = 0x80015D6C; // type:func -EffectBlure_SetupSimple = 0x8001603C; // type:func -EffectBlure_SetupSimpleAlt = 0x80016074; // type:func -EffectBlure_DrawSimpleVertices = 0x800162DC; // type:func -EffectBlure_DrawSimple = 0x800167BC; // type:func -EffectBlure_Draw = 0x80016CC8; // type:func -EffectShieldParticle_Init = 0x800171B0; // type:func -EffectShieldParticle_Destroy = 0x800173E8; // type:func -EffectShieldParticle_Update = 0x80017474; // type:func -EffectShieldParticle_GetColors = 0x800175D8; // type:func -EffectShieldParticle_Draw = 0x800182F8; // type:func -EffectSpark_Init = 0x80018810; // type:func -EffectSpark_Destroy = 0x80018BEC; // type:func -EffectSpark_Update = 0x80018BF8; // type:func -EffectSpark_Draw = 0x80018CBC; // type:func -func_80026230 = 0x80019EC0; // type:func -func_80026400 = 0x8001A068; // type:func -func_80026608 = 0x8001A24C; // type:func -func_80026690 = 0x8001A290; // type:func -func_80026860 = 0x8001A438; // type:func -func_80026A6C = 0x8001A624; // type:func -Effect_GetPlayState = 0x8001A670; // type:func -Effect_GetByIndex = 0x8001A680; // type:func -Effect_InitStatus = 0x8001A790; // type:func -Effect_InitContext = 0x8001A7A4; // type:func -Effect_Add = 0x8001A84C; // type:func -Effect_DrawAll = 0x8001A9CC; // type:func -Effect_UpdateAll = 0x8001AAC8; // type:func -Effect_Delete = 0x8001ABF4; // type:func -Effect_DeleteAll = 0x8001AD00; // type:func -EffectSs_InitInfo = 0x8001ADF0; // type:func -EffectSs_ClearAll = 0x8001AED4; // type:func -EffectSs_Delete = 0x8001AF94; // type:func -EffectSs_Reset = 0x8001AFF4; // type:func -EffectSs_FindSlot = 0x8001B088; // type:func -EffectSs_Insert = 0x8001B1C0; // type:func -EffectSs_Spawn = 0x8001B258; // type:func -EffectSs_Update = 0x8001B400; // type:func -EffectSs_UpdateAll = 0x8001B4A0; // type:func -EffectSs_Draw = 0x8001B55C; // type:func -EffectSs_DrawAll = 0x8001B5A0; // type:func -EffectSs_LerpInv = 0x8001B6EC; // type:func -EffectSs_LerpS16 = 0x8001B750; // type:func -EffectSs_LerpU8 = 0x8001B7A4; // type:func -EffectSs_DrawGEffect = 0x8001B890; // type:func -EffectSsDust_Spawn = 0x8001BACC; // type:func -func_8002829C = 0x8001BB80; // type:func -func_80028304 = 0x8001BBE8; // type:func -func_8002836C = 0x8001BC50; // type:func -func_800283D4 = 0x8001BCB8; // type:func -func_8002843C = 0x8001BD20; // type:func -func_800284A4 = 0x8001BD88; // type:func -func_80028510 = 0x8001BDF4; // type:func -func_8002857C = 0x8001BE60; // type:func -func_800285EC = 0x8001BED0; // type:func -func_8002865C = 0x8001BF40; // type:func -func_800286CC = 0x8001BFB0; // type:func -func_8002873C = 0x8001C020; // type:func -func_800287AC = 0x8001C090; // type:func -func_8002881C = 0x8001C100; // type:func -func_80028858 = 0x8001C13C; // type:func -func_80028894 = 0x8001C178; // type:func -func_80028990 = 0x8001C274; // type:func -func_80028A54 = 0x8001C338; // type:func -EffectSsKiraKira_SpawnSmallYellow = 0x8001C3FC; // type:func -EffectSsKiraKira_SpawnSmall = 0x8001C458; // type:func -EffectSsKiraKira_SpawnDispersed = 0x8001C494; // type:func -EffectSsKiraKira_SpawnFocused = 0x8001C5D0; // type:func -EffectSsBomb_Spawn = 0x8001C6A8; // type:func -EffectSsBomb2_SpawnFade = 0x8001C700; // type:func -EffectSsBomb2_SpawnLayered = 0x8001C768; // type:func -EffectSsBlast_Spawn = 0x8001C7D8; // type:func -EffectSsBlast_SpawnWhiteShockwaveSetScale = 0x8001C868; // type:func -EffectSsBlast_SpawnShockwaveSetColor = 0x8001C8BC; // type:func -EffectSsBlast_SpawnWhiteShockwave = 0x8001C908; // type:func -EffectSsGSpk_SpawnAccel = 0x8001C944; // type:func -EffectSsGSpk_SpawnNoAccel = 0x8001C9D4; // type:func -EffectSsGSpk_SpawnFuse = 0x8001CA68; // type:func -EffectSsGSpk_SpawnRandColor = 0x8001CABC; // type:func -EffectSsGSpk_SpawnSmall = 0x8001CBC0; // type:func -EffectSsDFire_Spawn = 0x8001CC04; // type:func -EffectSsDFire_SpawnFixedScale = 0x8001CC84; // type:func -EffectSsBubble_Spawn = 0x8001CCC8; // type:func -EffectSsGRipple_Spawn = 0x8001CD28; // type:func -EffectSsGSplash_Spawn = 0x8001CD80; // type:func -EffectSsGMagma_Spawn = 0x8001CE14; // type:func -EffectSsGFire_Spawn = 0x8001CE4C; // type:func -EffectSsLightning_Spawn = 0x8001CE84; // type:func -EffectSsDtBubble_SpawnColorProfile = 0x8001CEFC; // type:func -EffectSsDtBubble_SpawnCustomColor = 0x8001CF78; // type:func -EffectSsHahen_Spawn = 0x8001D008; // type:func -EffectSsHahen_SpawnBurst = 0x8001D088; // type:func -EffectSsStick_Spawn = 0x8001D1D0; // type:func -EffectSsSibuki_Spawn = 0x8001D224; // type:func -EffectSsSibuki_SpawnBurst = 0x8001D294; // type:func -EffectSsSibuki2_Spawn = 0x8001D418; // type:func -EffectSsGMagma2_Spawn = 0x8001D478; // type:func -EffectSsStone1_Spawn = 0x8001D4E8; // type:func -EffectSsHitMark_Spawn = 0x8001D53C; // type:func -EffectSsHitMark_SpawnFixedScale = 0x8001D594; // type:func -EffectSsHitMark_SpawnCustomScale = 0x8001D5B8; // type:func -EffectSsFhgFlash_SpawnLightBall = 0x8001D5E4; // type:func -EffectSsFhgFlash_SpawnShock = 0x8001D650; // type:func -EffectSsKFire_Spawn = 0x8001D6B4; // type:func -EffectSsSolderSrchBall_Spawn = 0x8001D71C; // type:func -EffectSsKakera_Spawn = 0x8001D784; // type:func -EffectSsIcePiece_Spawn = 0x8001D83C; // type:func -EffectSsIcePiece_SpawnBurst = 0x8001D8A4; // type:func -EffectSsEnIce_SpawnFlyingVec3f = 0x8001DA38; // type:func -EffectSsEnIce_SpawnFlyingVec3s = 0x8001DAD8; // type:func -EffectSsEnIce_Spawn = 0x8001DBA4; // type:func -EffectSsFireTail_Spawn = 0x8001DC2C; // type:func -EffectSsFireTail_SpawnFlame = 0x8001DCC4; // type:func -EffectSsFireTail_SpawnFlameOnPlayer = 0x8001DD88; // type:func -EffectSsEnFire_SpawnVec3f = 0x8001DDD8; // type:func -EffectSsEnFire_SpawnVec3s = 0x8001DE50; // type:func -EffectSsExtra_Spawn = 0x8001DEFC; // type:func -EffectSsFCircle_Spawn = 0x8001DF64; // type:func -EffectSsDeadDb_Spawn = 0x8001DFC0; // type:func -EffectSsDeadDd_Spawn = 0x8001E078; // type:func -EffectSsDeadDd_SpawnRandYellow = 0x8001E12C; // type:func -EffectSsDeadDs_Spawn = 0x8001E19C; // type:func -EffectSsDeadDs_SpawnStationary = 0x8001E214; // type:func -EffectSsDeadSound_Spawn = 0x8001E264; // type:func -EffectSsDeadSound_SpawnStationary = 0x8001E2FC; // type:func -EffectSsIceSmoke_Spawn = 0x8001E34C; // type:func -FlagSet_Update = 0x8001E3B0; // type:func -Overlay_LoadGameState = 0x8001E7D0; // type:func -Overlay_FreeGameState = 0x8001E8F8; // type:func -ActorShape_Init = 0x8001EA20; // type:func -ActorShadow_Draw = 0x8001EA44; // type:func -ActorShadow_DrawCircle = 0x8001EE24; // type:func -ActorShadow_DrawWhiteCircle = 0x8001EE4C; // type:func -ActorShadow_DrawHorse = 0x8001EE7C; // type:func -ActorShadow_DrawFoot = 0x8001EEA4; // type:func -ActorShadow_DrawFeet = 0x8001F0B0; // type:func -Actor_SetFeetPos = 0x8001F57C; // type:func -Actor_ProjectPos = 0x8001F5D0; // type:func -func_8002BE64 = 0x8001F634; // type:func -func_8002BE98 = 0x8001F66C; // type:func -Actor_SetNaviToActor = 0x8001F734; // type:func -func_8002C0C0 = 0x8001F898; // type:func -func_8002C124 = 0x8001F8FC; // type:func -func_8002C7BC = 0x8001FF34; // type:func -Flags_GetSwitch = 0x800202C8; // type:func -Flags_SetSwitch = 0x800202FC; // type:func -Flags_UnsetSwitch = 0x8002033C; // type:func -Flags_GetUnknown = 0x80020380; // type:func -Flags_SetUnknown = 0x800203B4; // type:func -Flags_UnsetUnknown = 0x800203F4; // type:func -Flags_GetTreasure = 0x80020438; // type:func -Flags_SetTreasure = 0x80020450; // type:func -Flags_GetClear = 0x8002046C; // type:func -Flags_SetClear = 0x80020484; // type:func -Flags_UnsetClear = 0x800204A0; // type:func -Flags_GetTempClear = 0x800204C0; // type:func -Flags_SetTempClear = 0x800204D8; // type:func -Flags_UnsetTempClear = 0x800204F4; // type:func -Flags_GetCollectible = 0x80020514; // type:func -Flags_SetCollectible = 0x80020548; // type:func -TitleCard_Init = 0x8002058C; // type:func -TitleCard_InitBossName = 0x800205AC; // type:func -TitleCard_InitPlaceName = 0x800205F0; // type:func -TitleCard_Update = 0x8002068C; // type:func -TitleCard_Draw = 0x80020748; // type:func -TitleCard_Clear = 0x80020C9C; // type:func -Actor_Kill = 0x80020CD0; // type:func -Actor_SetWorldToHome = 0x80020CF0; // type:func -Actor_SetFocus = 0x80020D20; // type:func -Actor_SetWorldRotToShape = 0x80020D64; // type:func -Actor_SetShapeRotToWorld = 0x80020D84; // type:func -Actor_SetScale = 0x80020DA4; // type:func -Actor_SetObjectDependency = 0x80020DC0; // type:func -Actor_Init = 0x80020DF8; // type:func -Actor_Destroy = 0x80020F0C; // type:func -Actor_UpdatePos = 0x80020F40; // type:func -Actor_UpdateVelocityXZGravity = 0x80020FC0; // type:func -Actor_MoveXZGravity = 0x80021038; // type:func -Actor_UpdateVelocityXYZ = 0x80021064; // type:func -Actor_MoveXYZ = 0x800210D4; // type:func -Actor_SetProjectileSpeed = 0x80021100; // type:func -Actor_UpdatePosByAnimation = 0x80021154; // type:func -Actor_WorldYawTowardActor = 0x800211D0; // type:func -Actor_FocusYawTowardActor = 0x800211FC; // type:func -Actor_WorldYawTowardPoint = 0x80021228; // type:func -Actor_WorldPitchTowardActor = 0x8002124C; // type:func -Actor_FocusPitchTowardActor = 0x80021278; // type:func -Actor_WorldPitchTowardPoint = 0x800212A4; // type:func -Actor_WorldDistXYZToActor = 0x800212C8; // type:func -Actor_WorldDistXYZToPoint = 0x800212F4; // type:func -Actor_WorldDistXZToActor = 0x80021318; // type:func -Actor_WorldDistXZToPoint = 0x80021344; // type:func -func_8002DBD0 = 0x80021368; // type:func -Actor_HeightDiff = 0x80021408; // type:func -Player_GetHeight = 0x8002141C; // type:func -func_8002DCE4 = 0x8002147C; // type:func -func_8002DD6C = 0x80021504; // type:func -func_8002DD78 = 0x80021514; // type:func -func_8002DDA8 = 0x80021548; // type:func -func_8002DDE4 = 0x80021584; // type:func -func_8002DDF4 = 0x80021598; // type:func -func_8002DE04 = 0x800215AC; // type:func -func_8002DE74 = 0x8002161C; // type:func -Actor_MountHorse = 0x80021674; // type:func -func_8002DEEC = 0x80021698; // type:func -func_8002DF18 = 0x800216C4; // type:func -Player_SetCsAction = 0x800216E4; // type:func -Player_SetCsActionWithHaltedActors = 0x80021708; // type:func -func_8002DF90 = 0x80021744; // type:func -func_8002DFA4 = 0x8002175C; // type:func -Player_IsFacingActor = 0x80021784; // type:func -Actor_ActorBIsFacingActorA = 0x800217DC; // type:func -Actor_IsFacingPlayer = 0x80021844; // type:func -Actor_ActorAIsFacingActorB = 0x80021890; // type:func -Actor_IsFacingAndNearPlayer = 0x800218F0; // type:func -Actor_ActorAIsFacingAndNearActorB = 0x80021970; // type:func -func_8002E234 = 0x80021A04; // type:func -func_8002E2AC = 0x80021A7C; // type:func -Actor_UpdateBgCheckInfo = 0x80021C88; // type:func -func_8002E830 = 0x80022008; // type:func -func_8002EABC = 0x800221E4; // type:func -func_8002EB44 = 0x8002221C; // type:func -func_8002EBCC = 0x80022254; // type:func -func_8002ED80 = 0x80022374; // type:func -Actor_GetFocus = 0x80022494; // type:func -Actor_GetWorld = 0x800224C8; // type:func -Actor_GetWorldPosShapeRot = 0x800224FC; // type:func -func_8002EFC0 = 0x80022578; // type:func -func_8002F090 = 0x80022648; // type:func -func_8002F0C8 = 0x80022684; // type:func -Actor_TalkOfferAccepted = 0x80022754; // type:func -Actor_OfferTalkExchange = 0x80022784; // type:func -Actor_OfferTalkExchangeEquiCylinder = 0x80022858; // type:func -Actor_OfferTalk = 0x8002288C; // type:func -Actor_OfferTalkNearColChkInfoCylinder = 0x800228B4; // type:func -Actor_TextboxIsClosing = 0x800228F4; // type:func -func_8002F368 = 0x80022928; // type:func -Actor_GetScreenPos = 0x80022938; // type:func -Actor_HasParent = 0x800229D4; // type:func -Actor_OfferGetItem = 0x800229F8; // type:func -Actor_OfferGetItemNearby = 0x80022B18; // type:func -Actor_OfferCarry = 0x80022B44; // type:func -Actor_HasNoParent = 0x80022B64; // type:func -func_8002F5C4 = 0x80022B88; // type:func -Actor_SetClosestSecretDistance = 0x80022BB8; // type:func -Actor_IsMounted = 0x80022BE0; // type:func -Actor_SetRideActor = 0x80022C04; // type:func -Actor_NotMounted = 0x80022C3C; // type:func -func_8002F698 = 0x80022C60; // type:func -func_8002F6D4 = 0x80022CA0; // type:func -func_8002F71C = 0x80022CE8; // type:func -func_8002F758 = 0x80022D24; // type:func -func_8002F7A0 = 0x80022D6C; // type:func -Player_PlaySfx = 0x80022DA8; // type:func -Actor_PlaySfx = 0x80022DF4; // type:func -func_8002F850 = 0x80022E20; // type:func -func_8002F8F0 = 0x80022EC4; // type:func -func_8002F91C = 0x80022EF8; // type:func -func_8002F948 = 0x80022F2C; // type:func -func_8002F974 = 0x80022F60; // type:func -func_8002F994 = 0x80022F88; // type:func -func_8002F9EC = 0x80022FE0; // type:func -func_8002FA60 = 0x80023058; // type:func -Actor_DrawFaroresWindPointer = 0x800231A8; // type:func -func_80030488 = 0x80023A20; // type:func -Actor_DisableLens = 0x80023A48; // type:func -Actor_InitContext = 0x80023A74; // type:func -Actor_UpdateAll = 0x80023BC8; // type:func -Actor_FaultPrint = 0x80024064; // type:func -Actor_Draw = 0x800240D8; // type:func -func_80030ED8 = 0x80024398; // type:func -Actor_DrawLensOverlay = 0x80024468; // type:func -Actor_DrawLensActors = 0x800245D8; // type:func -func_800314B0 = 0x8002480C; // type:func -func_800314D4 = 0x80024830; // type:func -func_800315AC = 0x80024908; // type:func -Actor_KillAllWithMissingObject = 0x80024B20; // type:func -Actor_FreezeAllEnemies = 0x80024BBC; // type:func -func_80031B14 = 0x80024C0C; // type:func -func_80031C3C = 0x80024D34; // type:func -Actor_AddToCategory = 0x80024DEC; // type:func -Actor_RemoveFromCategory = 0x80024E34; // type:func -Actor_FreeOverlay = 0x80024F00; // type:func -Actor_Spawn = 0x80024F64; // type:func -Actor_SpawnAsChild = 0x80025244; // type:func -Actor_SpawnTransitionActors = 0x800252DC; // type:func -Actor_SpawnEntry = 0x80025418; // type:func -Actor_Delete = 0x8002549C; // type:func -func_80032880 = 0x800255A0; // type:func -func_800328D4 = 0x800255F4; // type:func -func_80032AF0 = 0x80025810; // type:func -Actor_Find = 0x80025960; // type:func -Enemy_StartFinishingBlow = 0x800259A0; // type:func -FaceChange_UpdateBlinking = 0x800259D8; // type:func -FaceChange_UpdateRandomSet = 0x80025A8C; // type:func -BodyBreak_Alloc = 0x80025B58; // type:func -BodyBreak_SetInfo = 0x80025C50; // type:func -BodyBreak_SpawnParts = 0x80025D58; // type:func -Actor_SpawnFloorDustRing = 0x80025F3C; // type:func -func_80033480 = 0x8002615C; // type:func -Actor_GetCollidedExplosive = 0x8002631C; // type:func -func_80033684 = 0x80026360; // type:func -Actor_ChangeCategory = 0x80026428; // type:func -Actor_GetProjectileActor = 0x80026468; // type:func -Actor_SetTextWithPrefix = 0x80026628; // type:func -Actor_TestFloorInDirection = 0x800266A4; // type:func -Actor_IsTargeted = 0x80026770; // type:func -Actor_OtherIsTargeted = 0x800267A4; // type:func -func_80033AEC = 0x800267D8; // type:func -func_80033C30 = 0x80026924; // type:func -Actor_RequestQuake = 0x80026A74; // type:func -Actor_RequestQuakeWithSpeed = 0x80026ADC; // type:func -Actor_RequestQuakeAndRumble = 0x80026B4C; // type:func -Rand_ZeroFloat = 0x80026BBC; // type:func -Rand_CenteredFloat = 0x80026BE8; // type:func -Actor_DrawDoorLock = 0x80026C20; // type:func -func_8003424C = 0x80026EC4; // type:func -Actor_SetColorFilter = 0x80026EE4; // type:func -func_800342EC = 0x80026F68; // type:func -func_8003435C = 0x80026FDC; // type:func -Npc_UpdateTalking = 0x80027050; // type:func -Npc_TrackPointWithLimits = 0x80027140; // type:func -Npc_GetTrackingPresetMaxPlayerYaw = 0x80027474; // type:func -Npc_UpdateAutoTurn = 0x800274A0; // type:func -Npc_TrackPoint = 0x800276A8; // type:func -func_80034B28 = 0x800277C0; // type:func -func_80034B54 = 0x800277E4; // type:func -func_80034BA0 = 0x80027824; // type:func -func_80034CC4 = 0x8002791C; // type:func -func_80034DD4 = 0x80027A00; // type:func -Animation_ChangeByInfo = 0x80027AF0; // type:func -func_80034F54 = 0x80027B88; // type:func -Actor_Noop = 0x80027D4C; // type:func -func_80035124 = 0x80027D5C; // type:func -Gfx_DrawDListOpa = 0x80027EA0; // type:func -Gfx_DrawDListXlu = 0x80027F24; // type:func -func_800353E8 = 0x80027FA8; // type:func -Actor_FindNearby = 0x80027FB8; // type:func -func_800354B4 = 0x8002807C; // type:func -func_8003555C = 0x80028124; // type:func -func_800355B8 = 0x80028180; // type:func -func_800355E4 = 0x800281AC; // type:func -Actor_ApplyDamage = 0x800281F0; // type:func -Actor_SetDropFlag = 0x8002821C; // type:func -Actor_SetDropFlagJntSph = 0x80028308; // type:func -func_80035844 = 0x80028410; // type:func -func_800358DC = 0x800284A4; // type:func -func_800359B8 = 0x80028580; // type:func -func_80035B18 = 0x800286E4; // type:func -Flags_GetEventChkInf = 0x80028714; // type:func -Flags_SetEventChkInf = 0x80028740; // type:func -Flags_GetInfTable = 0x80028774; // type:func -Flags_SetInfTable = 0x800287A0; // type:func -func_80035BFC = 0x800287D4; // type:func -func_80036E50 = 0x80029A28; // type:func -func_800374E0 = 0x8002A0B8; // type:func -func_80037C30 = 0x8002A80C; // type:func -func_80037C5C = 0x8002A83C; // type:func -func_80037C94 = 0x8002A878; // type:func -func_80037CB8 = 0x8002A89C; // type:func -func_80037D98 = 0x8002A980; // type:func -Actor_TrackNone = 0x8002AB18; // type:func -Actor_TrackPoint = 0x8002ABB4; // type:func -Actor_TrackPlayerSetFocusHeight = 0x8002AD48; // type:func -Actor_TrackPlayer = 0x8002AE84; // type:func -ActorOverlayTable_LogPrint = 0x8002AFC0; // type:func -ActorOverlayTable_FaultPrint = 0x8002AFC8; // type:func -ActorOverlayTable_Init = 0x8002B0A0; // type:func -ActorOverlayTable_Cleanup = 0x8002B0E0; // type:func -SSNode_SetValue = 0x8002B110; // type:func -SSList_SetNull = 0x8002B12C; // type:func -SSNodeList_SetSSListHead = 0x8002B13C; // type:func -DynaSSNodeList_SetSSListHead = 0x8002B194; // type:func -DynaSSNodeList_Initialize = 0x8002B1EC; // type:func -DynaSSNodeList_Alloc = 0x8002B200; // type:func -DynaSSNodeList_ResetCount = 0x8002B250; // type:func -DynaSSNodeList_GetNextNodeIdx = 0x8002B25C; // type:func -BgCheck_Vec3sToVec3f = 0x8002B28C; // type:func -BgCheck_Vec3fToVec3s = 0x8002B2D0; // type:func -CollisionPoly_GetMinY = 0x8002B314; // type:func -CollisionPoly_GetNormalF = 0x8002B3C0; // type:func -func_80038A28 = 0x8002B418; // type:func -CollisionPoly_GetPointDistanceFromPlane = 0x8002B56C; // type:func -CollisionPoly_GetVertices = 0x8002B5D4; // type:func -CollisionPoly_GetVerticesByBgId = 0x8002B674; // type:func -CollisionPoly_CheckYIntersectApprox1 = 0x8002B6F4; // type:func -CollisionPoly_CheckYIntersect = 0x8002B828; // type:func -CollisionPoly_CheckYIntersectApprox2 = 0x8002B8D4; // type:func -CollisionPoly_CheckXIntersectApprox = 0x8002B914; // type:func -CollisionPoly_CheckZIntersectApprox = 0x8002B9B8; // type:func -CollisionPoly_LineVsPoly = 0x8002BA5C; // type:func -CollisionPoly_SphVsPoly = 0x8002BD3C; // type:func -StaticLookup_AddPolyToSSList = 0x8002BE0C; // type:func -StaticLookup_AddPoly = 0x8002C02C; // type:func -BgCheck_RaycastDownStaticList = 0x8002C0C0; // type:func -BgCheck_RaycastDownStatic = 0x8002C2FC; // type:func -BgCheck_ComputeWallDisplacement = 0x8002C414; // type:func -BgCheck_SphVsStaticWall = 0x8002C4C4; // type:func -BgCheck_CheckStaticCeiling = 0x8002CD58; // type:func -BgCheck_CheckLineAgainstSSList = 0x8002CF30; // type:func -BgCheck_CheckLineInSubdivision = 0x8002D154; // type:func -BgCheck_SphVsFirstStaticPolyList = 0x8002D2E0; // type:func -BgCheck_SphVsFirstStaticPoly = 0x8002D4B0; // type:func -BgCheck_GetNearestStaticLookup = 0x8002D5E8; // type:func -BgCheck_GetStaticLookup = 0x8002D69C; // type:func -BgCheck_GetStaticLookupIndicesFromPos = 0x8002D768; // type:func -BgCheck_GetSubdivisionMinBounds = 0x8002D848; // type:func -BgCheck_GetSubdivisionMaxBounds = 0x8002D9EC; // type:func -BgCheck_GetPolySubdivisionBounds = 0x8002DBB8; // type:func -BgCheck_PolyIntersectsSubdivision = 0x8002DD68; // type:func -BgCheck_InitializeStaticLookup = 0x8002E4BC; // type:func -BgCheck_IsSpotScene = 0x8002E8BC; // type:func -BgCheck_TryGetCustomMemsize = 0x8002E900; // type:func -BgCheck_SetSubdivisionDimension = 0x8002E998; // type:func -BgCheck_Allocate = 0x8002EA20; // type:func -BgCheck_GetCollisionHeader = 0x8002EE04; // type:func -BgCheck_PosInStaticBoundingBox = 0x8002EE6C; // type:func -BgCheck_RaycastDownImpl = 0x8002EF28; // type:func -BgCheck_CameraRaycastDown1 = 0x8002F0F8; // type:func -BgCheck_EntityRaycastDown1 = 0x8002F154; // type:func -BgCheck_EntityRaycastDown2 = 0x8002F1B0; // type:func -BgCheck_EntityRaycastDown3 = 0x8002F204; // type:func -BgCheck_EntityRaycastDown4 = 0x8002F268; // type:func -BgCheck_EntityRaycastDown5 = 0x8002F2D0; // type:func -BgCheck_EntityRaycastDown6 = 0x8002F328; // type:func -BgCheck_EntityRaycastDown7 = 0x8002F38C; // type:func -BgCheck_AnyRaycastDown1 = 0x8002F3F4; // type:func -BgCheck_AnyRaycastDown2 = 0x8002F4A8; // type:func -BgCheck_CameraRaycastDown2 = 0x8002F560; // type:func -BgCheck_EntityRaycastDownWalls = 0x8002F5C4; // type:func -BgCheck_EntityRaycastDown9 = 0x8002F62C; // type:func -BgCheck_CheckWallImpl = 0x8002F690; // type:func -BgCheck_EntitySphVsWall1 = 0x8002FCCC; // type:func -BgCheck_EntitySphVsWall2 = 0x8002FD30; // type:func -BgCheck_EntitySphVsWall3 = 0x8002FD94; // type:func -BgCheck_EntitySphVsWall4 = 0x8002FDFC; // type:func -BgCheck_CheckCeilingImpl = 0x8002FE68; // type:func -BgCheck_AnyCheckCeiling = 0x8002FF88; // type:func -BgCheck_EntityCheckCeiling = 0x8002FFD4; // type:func -BgCheck_CheckLineImpl = 0x80030024; // type:func -BgCheck_GetBccFlags = 0x80030504; // type:func -BgCheck_CameraLineTest1 = 0x8003054C; // type:func -BgCheck_CameraLineTest2 = 0x800305D8; // type:func -BgCheck_EntityLineTest1 = 0x80030664; // type:func -BgCheck_EntityLineTest2 = 0x800306F0; // type:func -BgCheck_EntityLineTest3 = 0x80030780; // type:func -BgCheck_ProjectileLineTest = 0x8003080C; // type:func -BgCheck_AnyLineTest1 = 0x80030898; // type:func -BgCheck_AnyLineTest2 = 0x800308DC; // type:func -BgCheck_AnyLineTest3 = 0x80030968; // type:func -BgCheck_SphVsFirstPolyImpl = 0x800309F4; // type:func -BgCheck_SphVsFirstPoly = 0x80030AB8; // type:func -BgCheck_SphVsFirstWall = 0x80030AFC; // type:func -SSNodeList_Initialize = 0x80030B44; // type:func -SSNodeList_Alloc = 0x80030B5C; // type:func -SSNodeList_GetNextNode = 0x80030BCC; // type:func -SSNodeList_GetNextNodeIdx = 0x80030C08; // type:func -ScaleRotPos_Initialize = 0x80030C1C; // type:func -ScaleRotPos_SetValue = 0x80030C5C; // type:func -ScaleRotPos_Equals = 0x80030CAC; // type:func -DynaLookup_ResetLists = 0x80030D80; // type:func -DynaLookup_Reset = 0x80030DC0; // type:func -DynaLookup_ResetVtxStartIndex = 0x80030DE0; // type:func -BgActor_Initialize = 0x80030DEC; // type:func -BgActor_SetActor = 0x80030E4C; // type:func -BgActor_IsTransformUnchanged = 0x80030F04; // type:func -DynaPoly_NullPolyList = 0x80030F2C; // type:func -DynaPoly_AllocPolyList = 0x80030F38; // type:func -DynaPoly_NullVtxList = 0x80030F74; // type:func -DynaPoly_AllocVtxList = 0x80030F80; // type:func -DynaPoly_SetBgActorPrevTransform = 0x80030FC8; // type:func -DynaPoly_IsBgIdBgActor = 0x80031014; // type:func -DynaPoly_Init = 0x80031034; // type:func -DynaPoly_Alloc = 0x80031080; // type:func -DynaPoly_SetBgActor = 0x80031154; // type:func -DynaPoly_GetActor = 0x80031214; // type:func -DynaPoly_DisableCollision = 0x80031288; // type:func -DynaPoly_EnableCollision = 0x800312E0; // type:func -DynaPoly_DisableCeilingCollision = 0x80031338; // type:func -DynaPoly_EnableCeilingCollision = 0x80031390; // type:func -DynaPoly_DeleteBgActor = 0x800313E8; // type:func -DynaPoly_InvalidateLookup = 0x80031470; // type:func -DynaPoly_AddBgActorToLookup = 0x80031488; // type:func -DynaPoly_UnsetAllInteractFlags = 0x80031DD4; // type:func -DynaPoly_UpdateContext = 0x80031E6C; // type:func -DynaPoly_UpdateBgActorTransforms = 0x80031FD8; // type:func -BgCheck_RaycastDownDynaList = 0x80032068; // type:func -BgCheck_RaycastDownDyna = 0x80032250; // type:func -BgCheck_SphVsDynaWallInBgActor = 0x800326F8; // type:func -BgCheck_SphVsDynaWall = 0x80032DBC; // type:func -BgCheck_CheckDynaCeilingList = 0x80032FF8; // type:func -BgCheck_CheckDynaCeiling = 0x80033254; // type:func -BgCheck_CheckLineAgainstBgActorSSList = 0x800333B8; // type:func -BgCheck_CheckLineAgainstBgActor = 0x8003353C; // type:func -BgCheck_CheckLineAgainstDyna = 0x80033658; // type:func -BgCheck_SphVsFirstDynaPolyList = 0x80033810; // type:func -BgCheck_SphVsFirstDynaPolyInBgActor = 0x80033928; // type:func -BgCheck_SphVsFirstDynaPoly = 0x80033A68; // type:func -CollisionHeader_SegmentedToVirtual = 0x80033BC0; // type:func -CollisionHeader_GetVirtual = 0x80033CA4; // type:func -func_800418D0 = 0x80033CF8; // type:func -BgCheck_ResetPolyCheckTbl = 0x80033DA0; // type:func -SurfaceType_GetData = 0x80033DD8; // type:func -SurfaceType_GetBgCamIndex = 0x80033E50; // type:func -BgCheck_GetBgCamSettingImpl = 0x80033E74; // type:func -BgCheck_GetBgCamSetting = 0x80033EBC; // type:func -BgCheck_GetBgCamCountImpl = 0x80033F50; // type:func -BgCheck_GetBgCamCount = 0x80033FAC; // type:func -BgCheck_GetBgCamFuncDataImpl = 0x80034040; // type:func -BgCheck_GetBgCamFuncData = 0x800340C8; // type:func -SurfaceType_GetExitIndex = 0x8003415C; // type:func -SurfaceType_GetFloorType = 0x80034184; // type:func -func_80041D70 = 0x800341AC; // type:func -SurfaceType_GetWallType = 0x800341D4; // type:func -SurfaceType_GetWallFlags = 0x800341FC; // type:func -SurfaceType_CheckWallFlag0 = 0x8003422C; // type:func -SurfaceType_CheckWallFlag1 = 0x80034260; // type:func -SurfaceType_CheckWallFlag2 = 0x80034294; // type:func -SurfaceType_GetFloorProperty2 = 0x800342C8; // type:func -SurfaceType_GetFloorProperty = 0x800342F0; // type:func -SurfaceType_IsSoft = 0x80034318; // type:func -SurfaceType_IsHorseBlocked = 0x80034340; // type:func -SurfaceType_GetMaterial = 0x80034368; // type:func -SurfaceType_GetSfxOffset = 0x8003438C; // type:func -SurfaceType_GetFloorEffect = 0x800343D4; // type:func -SurfaceType_GetLightSetting = 0x800343FC; // type:func -SurfaceType_GetEcho = 0x80034424; // type:func -SurfaceType_CanHookshot = 0x8003444C; // type:func -SurfaceType_IsIgnoredByEntities = 0x80034474; // type:func -SurfaceType_IsIgnoredByProjectiles = 0x800344B0; // type:func -SurfaceType_IsFloorConveyor = 0x800344EC; // type:func -SurfaceType_GetConveyorSpeed = 0x80034528; // type:func -SurfaceType_GetConveyorDirection = 0x80034550; // type:func -func_80042108 = 0x80034578; // type:func -WaterBox_GetSurface1 = 0x800345AC; // type:func -WaterBox_GetSurfaceImpl = 0x800346B8; // type:func -WaterBox_GetSurface2 = 0x80034810; // type:func -WaterBox_GetBgCamIndex = 0x800349AC; // type:func -WaterBox_GetBgCamSetting = 0x800349C0; // type:func -WaterBox_GetLightIndex = 0x80034A18; // type:func -func_800425B0 = 0x80034A30; // type:func -func_80042708 = 0x80034B88; // type:func -func_800427B4 = 0x80034C38; // type:func -DynaPolyActor_UpdateCarriedActorPos = 0x80034CF0; // type:func -DynaPolyActor_UpdateCarriedActorRotY = 0x80034E2C; // type:func -func_80043334 = 0x80034EC0; // type:func -DynaPolyActor_TransformCarriedActor = 0x80034F30; // type:func -DynaPolyActor_Init = 0x80035010; // type:func -DynaPolyActor_UnsetAllInteractFlags = 0x80035034; // type:func -DynaPolyActor_SetActorOnTop = 0x80035040; // type:func -DynaPolyActor_SetPlayerOnTop = 0x80035054; // type:func -DynaPoly_SetPlayerOnTop = 0x80035068; // type:func -DynaPolyActor_SetPlayerAbove = 0x80035098; // type:func -DynaPoly_SetPlayerAbove = 0x800350AC; // type:func -func_80043538 = 0x800350DC; // type:func -DynaPolyActor_IsActorOnTop = 0x800350F0; // type:func -DynaPolyActor_IsPlayerOnTop = 0x80035114; // type:func -DynaPolyActor_IsPlayerAbove = 0x80035138; // type:func -func_800435B4 = 0x8003515C; // type:func -func_800435D8 = 0x80035180; // type:func -Camera_InterpolateCurve = 0x800353A0; // type:func -Camera_LERPCeilF = 0x8003544C; // type:func -Camera_LERPFloorF = 0x80035490; // type:func -Camera_LERPCeilS = 0x800354D4; // type:func -Camera_LERPFloorS = 0x80035568; // type:func -Camera_LERPCeilVec3f = 0x800355FC; // type:func -func_80043ABC = 0x80035680; // type:func -func_80043B60 = 0x800356C0; // type:func -Camera_Vec3sToVec3f = 0x800356F0; // type:func -Camera_AddVecGeoToVec3f = 0x80035758; // type:func -Camera_Vec3fTranslateByUnitVector = 0x800357D8; // type:func -Camera_BGCheckInfo = 0x80035844; // type:func -Camera_BGCheck = 0x80035A6C; // type:func -func_80043F94 = 0x80035AC8; // type:func -func_80044340 = 0x80035E80; // type:func -Camera_CheckOOB = 0x80035EDC; // type:func -Camera_GetFloorYNorm = 0x80035F78; // type:func -Camera_GetFloorY = 0x8003605C; // type:func -Camera_GetFloorYLayer = 0x800360B8; // type:func -Camera_GetBgCamSetting = 0x8003627C; // type:func -Camera_GetBgCamFuncData = 0x800362B0; // type:func -Camera_GetBgCamIndex = 0x800362E0; // type:func -Camera_GetBgCamFuncDataUnderPlayer = 0x80036360; // type:func -Camera_GetWaterBoxBgCamIndex = 0x80036410; // type:func -Camera_GetWaterSurface = 0x800364F0; // type:func -Camera_XZAngle = 0x800365B8; // type:func -Camera_GetPitchAdjFromFloorHeightDiffs = 0x80036620; // type:func -Camera_CalcUpFromPitchYawRoll = 0x8003694C; // type:func -Camera_ClampLERPScale = 0x80036B88; // type:func -Camera_CopyDataToRegs = 0x80036BE0; // type:func -Camera_UpdateInterface = 0x80036BF0; // type:func -Camera_BGCheckCorner = 0x80036CFC; // type:func -func_80045508 = 0x80036D64; // type:func -Camera_CalcSlopeYAdj = 0x80036F74; // type:func -Camera_CalcAtDefault = 0x80037008; // type:func -func_800458D4 = 0x80037120; // type:func -func_80045B08 = 0x800372D8; // type:func -Camera_CalcAtForParallel = 0x80037438; // type:func -Camera_CalcAtForLockOn = 0x8003779C; // type:func -Camera_CalcAtForHorse = 0x80037C54; // type:func -Camera_LERPClampDist = 0x80037E10; // type:func -Camera_ClampDist = 0x80037EC8; // type:func -Camera_CalcDefaultPitch = 0x80037FDC; // type:func -Camera_CalcDefaultYaw = 0x8003813C; // type:func -func_80046E20 = 0x80038290; // type:func -Camera_Noop = 0x800387B4; // type:func -Camera_Normal1 = 0x800387C4; // type:func -Camera_Normal2 = 0x8003921C; // type:func -Camera_Normal3 = 0x800399AC; // type:func -Camera_Normal4 = 0x8003A054; // type:func -Camera_Normal0 = 0x8003A074; // type:func -Camera_Parallel1 = 0x8003A094; // type:func -Camera_Parallel2 = 0x8003A920; // type:func -Camera_Parallel3 = 0x8003A940; // type:func -Camera_Parallel4 = 0x8003A9A4; // type:func -Camera_Parallel0 = 0x8003A9C4; // type:func -Camera_Jump1 = 0x8003A9E4; // type:func -Camera_Jump2 = 0x8003B024; // type:func -Camera_Jump3 = 0x8003B910; // type:func -Camera_Jump4 = 0x8003C07C; // type:func -Camera_Jump0 = 0x8003C09C; // type:func -Camera_Battle1 = 0x8003C0BC; // type:func -Camera_Battle2 = 0x8003CDF8; // type:func -Camera_Battle3 = 0x8003CE18; // type:func -Camera_Battle4 = 0x8003CE38; // type:func -Camera_Battle0 = 0x8003D190; // type:func -Camera_KeepOn1 = 0x8003D1B0; // type:func -Camera_KeepOn2 = 0x8003DF00; // type:func -Camera_KeepOn3 = 0x8003DF20; // type:func -Camera_KeepOn4 = 0x8003E918; // type:func -Camera_KeepOn0 = 0x8003F730; // type:func -Camera_Fixed1 = 0x8003F9D0; // type:func -Camera_Fixed2 = 0x8003FCBC; // type:func -Camera_Fixed3 = 0x80040070; // type:func -Camera_Fixed4 = 0x80040270; // type:func -Camera_Fixed0 = 0x800405FC; // type:func -Camera_Subj1 = 0x8004061C; // type:func -Camera_Subj2 = 0x8004063C; // type:func -Camera_Subj3 = 0x8004065C; // type:func -Camera_Subj4 = 0x80040C60; // type:func -Camera_Subj0 = 0x80041294; // type:func -Camera_Data0 = 0x800412B4; // type:func -Camera_Data1 = 0x800412D4; // type:func -Camera_Data2 = 0x800412F4; // type:func -Camera_Data3 = 0x80041314; // type:func -Camera_Data4 = 0x80041334; // type:func -Camera_Unique1 = 0x80041620; // type:func -Camera_Unique2 = 0x80041AA4; // type:func -Camera_Unique3 = 0x80041E5C; // type:func -Camera_Unique0 = 0x8004230C; // type:func -Camera_Unique4 = 0x80042828; // type:func -Camera_Unique5 = 0x80042848; // type:func -Camera_Unique6 = 0x80042868; // type:func -Camera_Unique7 = 0x80042998; // type:func -Camera_Unique8 = 0x80042B9C; // type:func -Camera_Unique9 = 0x80042BBC; // type:func -Camera_Vec3fCopy = 0x80044018; // type:func -Camera_RotateAroundPoint = 0x80044038; // type:func -Camera_Demo1 = 0x80044094; // type:func -Camera_Demo2 = 0x8004426C; // type:func -Camera_Demo3 = 0x8004428C; // type:func -Camera_Demo4 = 0x80044D28; // type:func -Camera_Demo5 = 0x80044D48; // type:func -Camera_Demo6 = 0x80045720; // type:func -Camera_Demo7 = 0x800459C4; // type:func -Camera_Demo8 = 0x800459F8; // type:func -Camera_Demo9 = 0x80045A18; // type:func -Camera_Demo0 = 0x80045E38; // type:func -Camera_Special0 = 0x80045E58; // type:func -Camera_Special1 = 0x80045FA0; // type:func -Camera_Special2 = 0x80045FC0; // type:func -Camera_Special3 = 0x80045FE0; // type:func -Camera_Special4 = 0x80046000; // type:func -Camera_Special5 = 0x800461A4; // type:func -Camera_Special7 = 0x80046548; // type:func -Camera_Special6 = 0x80046894; // type:func -Camera_Special8 = 0x80046D04; // type:func -Camera_Special9 = 0x80046D24; // type:func -Camera_Create = 0x8004740C; // type:func -Camera_Destroy = 0x8004745C; // type:func -Camera_Init = 0x80047484; // type:func -func_80057FC4 = 0x800476A4; // type:func -Camera_Stub80058140 = 0x800477F8; // type:func -Camera_InitDataUsingPlayer = 0x80047804; // type:func -Camera_ChangeStatus = 0x80047A00; // type:func -Camera_UpdateWater = 0x80047A1C; // type:func -Camera_UpdateHotRoom = 0x80047E38; // type:func -Camera_UpdateDistortion = 0x80047E78; // type:func -Camera_Update = 0x800481D8; // type:func -Camera_Finish = 0x80048A08; // type:func -Camera_SetNewModeStateFlags = 0x80048B74; // type:func -Camera_RequestModeImpl = 0x80048B98; // type:func -Camera_RequestMode = 0x80048EFC; // type:func -Camera_CheckValidMode = 0x80048F28; // type:func -Camera_RequestSettingImpl = 0x80048F94; // type:func -Camera_RequestSetting = 0x80049188; // type:func -Camera_RequestBgCam = 0x800491B4; // type:func -Camera_GetInputDir = 0x80049288; // type:func -Camera_GetInputDirPitch = 0x800492AC; // type:func -Camera_GetInputDirYaw = 0x800492D4; // type:func -Camera_GetCamDir = 0x800492FC; // type:func -Camera_GetCamDirPitch = 0x80049320; // type:func -Camera_GetCamDirYaw = 0x80049348; // type:func -Camera_RequestQuake = 0x80049370; // type:func -Camera_SetViewParam = 0x800493E4; // type:func -Camera_UnsetViewFlag = 0x80049578; // type:func -Camera_OverwriteStateFlags = 0x800495A0; // type:func -Camera_ResetAnim = 0x800495BC; // type:func -Camera_SetCSParams = 0x800495CC; // type:func -Camera_SetStateFlag = 0x80049660; // type:func -Camera_UnsetStateFlag = 0x80049684; // type:func -Camera_ChangeDoorCam = 0x800496AC; // type:func -Camera_Copy = 0x800497AC; // type:func -Camera_IsDebugCamEnabled = 0x800498F4; // type:func -Camera_GetQuakeOffset = 0x80049900; // type:func -Camera_SetCameraData = 0x80049924; // type:func -func_8005B198 = 0x80049970; // type:func -Camera_SetFinishedFlag = 0x80049980; // type:func -DamageTable_Get = 0x800499D0; // type:func -DamageTable_Clear = 0x800499FC; // type:func -Collider_InitBase = 0x80049A30; // type:func -Collider_DestroyBase = 0x80049A78; // type:func -Collider_SetBaseToActor = 0x80049A8C; // type:func -Collider_SetBaseType1 = 0x80049ACC; // type:func -Collider_SetBase = 0x80049B10; // type:func -Collider_ResetATBase = 0x80049B54; // type:func -Collider_ResetACBase = 0x80049B70; // type:func -Collider_ResetOCBase = 0x80049B8C; // type:func -Collider_InitElementDamageInfoAT = 0x80049BB4; // type:func -Collider_DestroyElementDamageInfoAT = 0x80049BDC; // type:func -Collider_SetElementDamageInfoAT = 0x80049BF0; // type:func -Collider_ResetATElement_Unk = 0x80049C18; // type:func -Collider_InitElementDamageInfoAC = 0x80049C28; // type:func -Collider_DestroyElementDamageInfoAC = 0x80049C58; // type:func -Collider_SetElementDamageInfoAC = 0x80049C6C; // type:func -Collider_InitElement = 0x80049C94; // type:func -Collider_DestroyElement = 0x80049D14; // type:func -Collider_SetElement = 0x80049D54; // type:func -Collider_ResetATElement = 0x80049DCC; // type:func -Collider_ResetACElement = 0x80049E04; // type:func -Collider_ResetOCElement = 0x80049E3C; // type:func -Collider_InitJntSphElementDim = 0x80049E54; // type:func -Collider_DestroyJntSphElementDim = 0x80049E9C; // type:func -Collider_SetJntSphElementDim = 0x80049EB0; // type:func -Collider_InitJntSphElement = 0x80049F08; // type:func -Collider_DestroyJntSphElement = 0x80049F48; // type:func -Collider_SetJntSphElement = 0x80049F88; // type:func -Collider_ResetJntSphElementAT = 0x80049FD8; // type:func -Collider_ResetJntSphElementAC = 0x80049FFC; // type:func -Collider_ResetJntSphElementOC = 0x8004A020; // type:func -Collider_InitJntSph = 0x8004A044; // type:func -Collider_FreeJntSph = 0x8004A070; // type:func -Collider_DestroyJntSph = 0x8004A110; // type:func -Collider_SetJntSphToActor = 0x8004A1A0; // type:func -Collider_SetJntSphAllocType1 = 0x8004A27C; // type:func -Collider_SetJntSphAlloc = 0x8004A358; // type:func -Collider_SetJntSph = 0x8004A434; // type:func -Collider_ResetJntSphAT = 0x8004A4E8; // type:func -Collider_ResetJntSphAC = 0x8004A574; // type:func -Collider_ResetJntSphOC = 0x8004A600; // type:func -Collider_InitCylinderDim = 0x8004A68C; // type:func -Collider_DestroyCylinderDim = 0x8004A6E8; // type:func -Collider_SetCylinderDim = 0x8004A6FC; // type:func -Collider_InitCylinder = 0x8004A73C; // type:func -Collider_DestroyCylinder = 0x8004A78C; // type:func -Collider_SetCylinderToActor = 0x8004A7DC; // type:func -Collider_SetCylinderType1 = 0x8004A844; // type:func -Collider_SetCylinder = 0x8004A8AC; // type:func -Collider_ResetCylinderAT = 0x8004A914; // type:func -Collider_ResetCylinderAC = 0x8004A954; // type:func -Collider_ResetCylinderOC = 0x8004A994; // type:func -Collider_InitTrisElementDim = 0x8004A9D4; // type:func -Collider_DestroyTrisElementDim = 0x8004AA20; // type:func -Collider_SetTrisElementDim = 0x8004AA34; // type:func -Collider_InitTrisElement = 0x8004AAE8; // type:func -Collider_DestroyTrisElement = 0x8004AB28; // type:func -Collider_SetTrisElement = 0x8004AB68; // type:func -Collider_ResetTrisElementAT = 0x8004ABB8; // type:func -Collider_ResetTrisElementAC = 0x8004ABDC; // type:func -Collider_ResetTrisElementOC = 0x8004AC00; // type:func -Collider_InitTris = 0x8004AC24; // type:func -Collider_FreeTris = 0x8004AC50; // type:func -Collider_DestroyTris = 0x8004AD08; // type:func -Collider_SetTrisAllocType1 = 0x8004ADAC; // type:func -Collider_SetTrisAlloc = 0x8004AEAC; // type:func -Collider_SetTris = 0x8004AFAC; // type:func -Collider_ResetTrisAT = 0x8004B078; // type:func -Collider_ResetTrisAC = 0x8004B118; // type:func -Collider_ResetTrisOC = 0x8004B1B8; // type:func -Collider_InitQuadDim = 0x8004B258; // type:func -Collider_DestroyQuadDim = 0x8004B2A4; // type:func -Collider_ResetQuadACDist = 0x8004B2B8; // type:func -Collider_SetQuadMidpoints = 0x8004B2D4; // type:func -Collider_SetQuadDim = 0x8004B390; // type:func -Collider_InitQuad = 0x8004B418; // type:func -Collider_DestroyQuad = 0x8004B468; // type:func -Collider_SetQuadType1 = 0x8004B4B8; // type:func -Collider_SetQuad = 0x8004B520; // type:func -Collider_ResetQuadAT = 0x8004B588; // type:func -Collider_ResetQuadAC = 0x8004B5D8; // type:func -Collider_ResetQuadOC = 0x8004B618; // type:func -Collider_QuadSetNearestAC = 0x8004B658; // type:func -Collider_InitLine = 0x8004B708; // type:func -Collider_DestroyLine = 0x8004B768; // type:func -Collider_SetLinePoints = 0x8004B77C; // type:func -Collider_SetLine = 0x8004B7C0; // type:func -Collider_ResetLineOC = 0x8004B7EC; // type:func -CollisionCheck_InitContext = 0x8004B808; // type:func -CollisionCheck_DestroyContext = 0x8004B828; // type:func -CollisionCheck_ClearContext = 0x8004B838; // type:func -CollisionCheck_EnableSAC = 0x8004B8E0; // type:func -CollisionCheck_DisableSAC = 0x8004B8F8; // type:func -CollisionCheck_SetAT = 0x8004B910; // type:func -CollisionCheck_SetAT_SAC = 0x8004B9F0; // type:func -CollisionCheck_SetAC = 0x8004BB00; // type:func -CollisionCheck_SetAC_SAC = 0x8004BBE0; // type:func -CollisionCheck_SetOC = 0x8004BCF0; // type:func -CollisionCheck_SetOC_SAC = 0x8004BDD0; // type:func -CollisionCheck_SetOCLine = 0x8004BEE0; // type:func -CollisionCheck_IsElementNotAT = 0x8004BF6C; // type:func -CollisionCheck_IsElementNotAC = 0x8004BF90; // type:func -CollisionCheck_NoSharedFlags = 0x8004BFB4; // type:func -CollisionCheck_NoBlood = 0x8004BFDC; // type:func -CollisionCheck_BlueBlood = 0x8004BFF0; // type:func -CollisionCheck_GreenBlood = 0x8004C15C; // type:func -CollisionCheck_WaterBurst = 0x8004C2C8; // type:func -CollisionCheck_RedBlood = 0x8004C304; // type:func -CollisionCheck_RedBloodUnused = 0x8004C328; // type:func -CollisionCheck_HitSolid = 0x8004C34C; // type:func -CollisionCheck_SwordHitAudio = 0x8004C55C; // type:func -CollisionCheck_HitEffects = 0x8004C668; // type:func -CollisionCheck_SetBounce = 0x8004C868; // type:func -CollisionCheck_SetATvsAC = 0x8004C888; // type:func -CollisionCheck_ATJntSphVsACJntSph = 0x8004CA30; // type:func -CollisionCheck_ATJntSphVsACCyl = 0x8004CCDC; // type:func -CollisionCheck_ATCylVsACJntSph = 0x8004CF50; // type:func -CollisionCheck_ATJntSphVsACTris = 0x8004D1F0; // type:func -CollisionCheck_ATTrisVsACJntSph = 0x8004D410; // type:func -CollisionCheck_ATJntSphVsACQuad = 0x8004D624; // type:func -CollisionCheck_ATQuadVsACJntSph = 0x8004D844; // type:func -CollisionCheck_ATCylVsACCyl = 0x8004DAA8; // type:func -CollisionCheck_ATCylVsACTris = 0x8004DC7C; // type:func -CollisionCheck_ATTrisVsACCyl = 0x8004DE40; // type:func -CollisionCheck_ATCylVsACQuad = 0x8004E000; // type:func -CollisionCheck_ATQuadVsACCyl = 0x8004E274; // type:func -CollisionCheck_ATTrisVsACTris = 0x8004E520; // type:func -CollisionCheck_ATTrisVsACQuad = 0x8004E774; // type:func -CollisionCheck_ATQuadVsACTris = 0x8004EA04; // type:func -CollisionCheck_ATQuadVsACQuad = 0x8004EC9C; // type:func -CollisionCheck_SetJntSphHitFX = 0x8004EF2C; // type:func -CollisionCheck_SetCylHitFX = 0x8004F00C; // type:func -CollisionCheck_SetTrisHitFX = 0x8004F0A4; // type:func -CollisionCheck_SetQuadHitFX = 0x8004F18C; // type:func -CollisionCheck_SetHitEffects = 0x8004F224; // type:func -CollisionCheck_AC = 0x8004F2F8; // type:func -CollisionCheck_AT = 0x8004F420; // type:func -CollisionCheck_GetMassType = 0x8004F4F0; // type:func -CollisionCheck_SetOCvsOC = 0x8004F52C; // type:func -CollisionCheck_OC_JntSphVsJntSph = 0x8004F85C; // type:func -CollisionCheck_OC_JntSphVsCyl = 0x8004FA2C; // type:func -CollisionCheck_OC_CylVsJntSph = 0x8004FB8C; // type:func -CollisionCheck_OC_CylVsCyl = 0x8004FBB8; // type:func -CollisionCheck_SkipOC = 0x8004FC88; // type:func -CollisionCheck_Incompatible = 0x8004FCAC; // type:func -CollisionCheck_OC = 0x8004FD2C; // type:func -CollisionCheck_InitInfo = 0x8004FEBC; // type:func -CollisionCheck_ResetDamage = 0x8004FF04; // type:func -CollisionCheck_SetInfoNoDamageTable = 0x8004FF30; // type:func -CollisionCheck_SetInfo = 0x8004FF58; // type:func -CollisionCheck_SetInfo2 = 0x8004FF84; // type:func -CollisionCheck_SetInfoGetDamageTable = 0x8004FFB8; // type:func -CollisionCheck_ApplyDamage = 0x8004FFF0; // type:func -CollisionCheck_ApplyDamageJntSph = 0x800501B0; // type:func -CollisionCheck_ApplyDamageCyl = 0x80050258; // type:func -CollisionCheck_ApplyDamageTris = 0x80050278; // type:func -CollisionCheck_ApplyDamageQuad = 0x8005030C; // type:func -CollisionCheck_Damage = 0x8005032C; // type:func -CollisionCheck_LineOC_JntSph = 0x800503EC; // type:func -CollisionCheck_LineOC_Cyl = 0x80050504; // type:func -CollisionCheck_LineOC = 0x8005057C; // type:func -CollisionCheck_LineOCCheckAll = 0x800506C4; // type:func -CollisionCheck_LineOCCheck = 0x800506E8; // type:func -Collider_UpdateCylinder = 0x80050714; // type:func -Collider_SetCylinderPosition = 0x80050758; // type:func -Collider_SetQuadVertices = 0x80050778; // type:func -Collider_SetTrisVertices = 0x800507E8; // type:func -Collider_SetTrisDim = 0x800508A8; // type:func -Collider_UpdateSpheres = 0x800508F8; // type:func -CollisionCheck_SpawnRedBlood = 0x80050A7C; // type:func -CollisionCheck_SpawnWaterDroplets = 0x80050BDC; // type:func -CollisionCheck_SpawnShieldParticles = 0x80050D38; // type:func -CollisionCheck_SpawnShieldParticlesMetal = 0x80050DCC; // type:func -CollisionCheck_SpawnShieldParticlesMetalSfx = 0x80050E18; // type:func -CollisionCheck_SpawnShieldParticlesMetal2 = 0x80050E64; // type:func -CollisionCheck_SpawnShieldParticlesWood = 0x80050E84; // type:func -CollisionCheck_CylSideVsLineSeg = 0x80050F44; // type:func -CollisionCheck_GetSwordDamage = 0x80051648; // type:func -SaveContext_Init = 0x800516B0; // type:func -Regs_Init = 0x80051740; // type:func -DebugCamera_ScreenText = 0x800517D0; // type:func -DebugCamera_ScreenTextColored = 0x800517E4; // type:func -DebugCamera_DrawScreenText = 0x800518A0; // type:func -Debug_DrawText = 0x80051984; // type:func -DebugDisplay_Init = 0x80051A50; // type:func -DebugDisplay_AddObject = 0x80051A60; // type:func -DebugDisplay_DrawObjects = 0x80051B3C; // type:func -DebugDisplay_DrawSpriteI8 = 0x80051BCC; // type:func -DebugDisplay_DrawPolygon = 0x80051DB0; // type:func -Cutscene_InitContext = 0x80051F10; // type:func -Cutscene_StartManual = 0x80051F28; // type:func -Cutscene_StopManual = 0x80051F40; // type:func -Cutscene_UpdateManual = 0x80051F64; // type:func -Cutscene_UpdateScripted = 0x80051FB0; // type:func -CutsceneHandler_DoNothing = 0x80052064; // type:func -Cutscene_StepTimer = 0x80052074; // type:func -CutsceneHandler_StartManual = 0x800520AC; // type:func -CutsceneHandler_StartScript = 0x8005210C; // type:func -CutsceneCmd_Misc = 0x80052178; // type:func -CutsceneCmd_SetLightSetting = 0x80052914; // type:func -CutsceneCmd_StartSequence = 0x80052954; // type:func -CutsceneCmd_StopSequence = 0x80052990; // type:func -CutsceneCmd_FadeOutSequence = 0x800529CC; // type:func -CutsceneCmd_RumbleController = 0x80052A4C; // type:func -CutsceneCmd_SetTime = 0x80052A90; // type:func -CutsceneCmd_Destination = 0x80052B34; // type:func -CutsceneCmd_Transition = 0x80054854; // type:func -CutsceneCmd_UpdateCamEyeSpline = 0x80055234; // type:func -CutsceneCmd_UpdateCamAtSpline = 0x80055388; // type:func -CutsceneCmd_SetCamEye = 0x800554E4; // type:func -CutsceneCmd_SetCamAt = 0x800556C0; // type:func -CutsceneCmd_Text = 0x80055868; // type:func -Cutscene_ProcessScript = 0x80055B3C; // type:func -CutsceneHandler_RunScript = 0x8005650C; // type:func -CutsceneHandler_StopManual = 0x80056550; // type:func -CutsceneHandler_StopScript = 0x80056590; // type:func -Cutscene_SetupScripted = 0x80056698; // type:func -func_80069048 = 0x80056818; // type:func -func_8006907C = 0x80056850; // type:func -Cutscene_HandleEntranceTriggers = 0x80056874; // type:func -Cutscene_HandleConditionalTriggers = 0x80056994; // type:func -Cutscene_SetScript = 0x80056B9C; // type:func -MemCpy = 0x80056BF0; // type:func -MemSet = 0x80056C20; // type:func -GetItem_Draw = 0x80056C80; // type:func -GetItem_DrawMaskOrBombchu = 0x80056CC4; // type:func -GetItem_DrawSoldOut = 0x80056D60; // type:func -GetItem_DrawBlueFire = 0x80056E08; // type:func -GetItem_DrawPoes = 0x80056FAC; // type:func -GetItem_DrawFairy = 0x800571A8; // type:func -GetItem_DrawMirrorShield = 0x80057384; // type:func -GetItem_DrawSkullToken = 0x800574FC; // type:func -GetItem_DrawEggOrMedallion = 0x80057664; // type:func -GetItem_DrawCompass = 0x8005771C; // type:func -GetItem_DrawPotion = 0x80057824; // type:func -GetItem_DrawGoronSword = 0x800579F8; // type:func -GetItem_DrawDekuNuts = 0x80057B00; // type:func -GetItem_DrawRecoveryHeart = 0x80057C14; // type:func -GetItem_DrawFish = 0x80057D2C; // type:func -GetItem_DrawOpa0 = 0x80057E34; // type:func -GetItem_DrawOpa0Xlu1 = 0x80057ED0; // type:func -GetItem_DrawXlu01 = 0x80057FD4; // type:func -GetItem_DrawOpa10Xlu2 = 0x8005808C; // type:func -GetItem_DrawMagicArrow = 0x800581A8; // type:func -GetItem_DrawMagicSpell = 0x800582C4; // type:func -GetItem_DrawOpa1023 = 0x80058414; // type:func -GetItem_DrawOpa10Xlu32 = 0x800584FC; // type:func -GetItem_DrawSmallRupee = 0x80058630; // type:func -GetItem_DrawScale = 0x80058780; // type:func -GetItem_DrawBulletBag = 0x800588E0; // type:func -GetItem_DrawWallet = 0x80058A2C; // type:func -SfxSource_InitAll = 0x80058B80; // type:func -SfxSource_UpdateAll = 0x80058BB0; // type:func -SfxSource_PlaySfxAtFixedWorldPos = 0x80058C58; // type:func -QuestHint_CheckCondition = 0x80058D40; // type:func -QuestHint_CheckConditionChain = 0x80058FBC; // type:func -QuestHint_CheckRandomCondition = 0x80059050; // type:func -QuestHint_GetTextIdFromScript = 0x80059230; // type:func -QuestHint_GetSariaTextId = 0x80059374; // type:func -QuestHint_GetNaviTextId = 0x800593DC; // type:func -MaskReaction_GetTextId = 0x80059420; // type:func -CutsceneFlags_UnsetAll = 0x80059470; // type:func -CutsceneFlags_Set = 0x800594A0; // type:func -CutsceneFlags_Unset = 0x8005950C; // type:func -CutsceneFlags_Get = 0x8005957C; // type:func -Curve_CubicHermiteSpline = 0x800595F0; // type:func -Curve_Interpolate = 0x80059688; // type:func -SkelCurve_Clear = 0x80059830; // type:func -SkelCurve_Init = 0x80059860; // type:func -SkelCurve_Destroy = 0x80059910; // type:func -SkelCurve_SetAnim = 0x80059940; // type:func -SkelCurve_Update = 0x80059978; // type:func -SkelCurve_DrawLimb = 0x80059C68; // type:func -SkelCurve_Draw = 0x80059FF4; // type:func -func_8006CFC0 = 0x8005A040; // type:func -func_8006D074 = 0x8005A0F4; // type:func -func_8006D0AC = 0x8005A130; // type:func -func_8006D0EC = 0x8005A170; // type:func -func_8006D684 = 0x8005A608; // type:func -func_8006DC68 = 0x8005AB7C; // type:func -func_8006DD9C = 0x8005AC8C; // type:func -Jpeg_ScheduleDecoderTask = 0x8005AD20; // type:func -Jpeg_CopyToZbuffer = 0x8005AE5C; // type:func -Jpeg_GetUnalignedU16 = 0x8005AF94; // type:func -Jpeg_ParseMarkers = 0x8005AFE0; // type:func -Jpeg_Decode = 0x8005B1AC; // type:func -KaleidoSetup_Update = 0x8005B4E0; // type:func -KaleidoSetup_Init = 0x8005B74C; // type:func -KaleidoSetup_Destroy = 0x8005B8A0; // type:func -func_8006EE50 = 0x8005B8B0; // type:func -Font_LoadChar = 0x8005B904; // type:func -Font_LoadMessageBoxIcon = 0x8005B954; // type:func -Font_LoadOrderedFont = 0x8005B998; // type:func -Environment_ZBufValToFixedPoint = 0x8005BAC0; // type:func -Environment_GetPixelDepth = 0x8005BAF8; // type:func -Environment_GraphCallback = 0x8005BB24; // type:func -Environment_Init = 0x8005BB68; // type:func -Environment_SmoothStepToU8 = 0x8005C038; // type:func -Environment_SmoothStepToS8 = 0x8005C170; // type:func -Environment_LerpWeight = 0x8005C2B0; // type:func -Environment_LerpWeightAccelDecel = 0x8005C334; // type:func -Environment_UpdateStorm = 0x8005C4F4; // type:func -Environment_UpdateSkybox = 0x8005C5E8; // type:func -Environment_EnableUnderwaterLights = 0x8005CED4; // type:func -Environment_DisableUnderwaterLights = 0x8005CF4C; // type:func -Environment_Update = 0x8005CFC4; // type:func -Environment_DrawSunAndMoon = 0x8005EE20; // type:func -Environment_DrawSunLensFlare = 0x8005F67C; // type:func -Environment_DrawLensFlare = 0x8005F750; // type:func -Environment_RandCentered = 0x800603A8; // type:func -Environment_DrawRain = 0x800603D0; // type:func -Environment_ChangeLightSetting = 0x80060978; // type:func -Environment_DrawSkyboxFilters = 0x800609FC; // type:func -Environment_DrawLightningFlash = 0x80060C1C; // type:func -Environment_UpdateLightningStrike = 0x80060CB4; // type:func -Environment_AddLightningBolts = 0x80060FBC; // type:func -Environment_DrawLightning = 0x80061024; // type:func -Environment_PlaySceneSequence = 0x80061468; // type:func -Environment_PlayTimeBasedSequence = 0x80061658; // type:func -Environment_DrawCustomLensFlare = 0x80061970; // type:func -Environment_InitGameOverLights = 0x80061A1C; // type:func -Environment_FadeInGameOverLights = 0x80061C04; // type:func -Environment_FadeOutGameOverLights = 0x80061EB8; // type:func -Environment_UpdateRain = 0x800621D4; // type:func -Environment_FillScreen = 0x8006223C; // type:func -Environment_DrawSandstorm = 0x80062434; // type:func -Environment_AdjustLights = 0x80062E80; // type:func -Environment_GetBgsDayCount = 0x800630AC; // type:func -Environment_ClearBgsDayCount = 0x800630BC; // type:func -Environment_GetTotalDays = 0x800630CC; // type:func -Environment_ForcePlaySequence = 0x800630DC; // type:func -Environment_IsForcedSequenceDisabled = 0x800630F4; // type:func -Environment_PlayStormNatureAmbience = 0x8006311C; // type:func -Environment_StopStormNatureAmbience = 0x8006317C; // type:func -Environment_WarpSongLeave = 0x800631DC; // type:func -Lib_MemSet = 0x800632D0; // type:func -Math_CosS = 0x80063324; // type:func -Math_SinS = 0x80063364; // type:func -Math_ScaledStepToS = 0x800633A4; // type:func -Math_StepToS = 0x80063474; // type:func -Math_StepToF = 0x800634FC; // type:func -Math_StepUntilAngleS = 0x80063590; // type:func -Math_StepUntilS = 0x800635F8; // type:func -Math_StepToAngleS = 0x80063658; // type:func -Math_StepUntilF = 0x8006371C; // type:func -Math_AsymStepToF = 0x8006376C; // type:func -Lib_GetControlStickData = 0x80063814; // type:func -Rand_S16Offset = 0x80063890; // type:func -Rand_S16OffsetStride = 0x800638E4; // type:func -Math_Vec3f_Copy = 0x8006394C; // type:func -Math_Vec3s_ToVec3f = 0x8006396C; // type:func -Math_Vec3f_Sum = 0x800639B0; // type:func -Math_Vec3f_Diff = 0x800639E8; // type:func -Math_Vec3s_DiffToVec3f = 0x80063A20; // type:func -Math_Vec3f_Scale = 0x80063A7C; // type:func -Math_Vec3f_DistXYZ = 0x80063AB8; // type:func -Math_Vec3f_DistXYZAndStoreDiff = 0x80063AFC; // type:func -Math_Vec3f_DistXZ = 0x80063B58; // type:func -Math_Vec3f_DiffY = 0x80063B8C; // type:func -Math_Vec3f_Yaw = 0x80063BA0; // type:func -Math_Vec3f_Pitch = 0x80063BD4; // type:func -Actor_ProcessInitChain = 0x80063C1C; // type:func -IChain_Apply_u8 = 0x80063C94; // type:func -IChain_Apply_s8 = 0x80063CB0; // type:func -IChain_Apply_u16 = 0x80063CCC; // type:func -IChain_Apply_s16 = 0x80063CE8; // type:func -IChain_Apply_u32 = 0x80063D04; // type:func -IChain_Apply_s32 = 0x80063D20; // type:func -IChain_Apply_f32 = 0x80063D3C; // type:func -IChain_Apply_f32div1000 = 0x80063D60; // type:func -IChain_Apply_Vec3f = 0x80063D90; // type:func -IChain_Apply_Vec3fdiv1000 = 0x80063DBC; // type:func -IChain_Apply_Vec3s = 0x80063DF4; // type:func -Math_SmoothStepToF = 0x80063E18; // type:func -Math_ApproachF = 0x80063F20; // type:func -Math_ApproachZeroF = 0x80063F90; // type:func -Math_SmoothStepToDegF = 0x80063FE4; // type:func -Math_SmoothStepToS = 0x800641A8; // type:func -Math_ApproachS = 0x800642C4; // type:func -Color_RGBA8_Copy = 0x80064368; // type:func -Sfx_PlaySfxCentered = 0x80064390; // type:func -Sfx_PlaySfxCentered2 = 0x800643D8; // type:func -Sfx_PlaySfxAtPos = 0x80064420; // type:func -Health_InitMeter = 0x80064470; // type:func -Health_UpdateMeter = 0x8006454C; // type:func -func_80078E18 = 0x80064930; // type:func -func_80078E34 = 0x80064950; // type:func -func_80078E84 = 0x800649A0; // type:func -Health_DrawMeter = 0x80064A38; // type:func -Health_UpdateBeatingHeart = 0x800656B0; // type:func -Health_IsCritical = 0x8006579C; // type:func -Lights_PointSetInfo = 0x80065810; // type:func -Lights_PointNoGlowSetInfo = 0x8006586C; // type:func -Lights_PointGlowSetInfo = 0x800658D0; // type:func -Lights_PointSetColorAndRadius = 0x80065938; // type:func -Lights_DirectionalSetInfo = 0x8006596C; // type:func -Lights_Reset = 0x800659C4; // type:func -Lights_Draw = 0x80065A00; // type:func -Lights_FindSlot = 0x80065B44; // type:func -Lights_BindPoint = 0x80065B74; // type:func -Lights_BindDirectional = 0x80065ED0; // type:func -Lights_BindAll = 0x80065F38; // type:func -Lights_FindBufSlot = 0x80065FD4; // type:func -Lights_FreeNode = 0x80066060; // type:func -LightContext_Init = 0x800660D8; // type:func -LightContext_SetAmbientColor = 0x80066144; // type:func -LightContext_SetFog = 0x80066170; // type:func -LightContext_NewLights = 0x800661AC; // type:func -LightContext_InitList = 0x800661E4; // type:func -LightContext_DestroyList = 0x800661F4; // type:func -LightContext_InsertLight = 0x80066250; // type:func -LightContext_RemoveLight = 0x800662B0; // type:func -Lights_NewAndDraw = 0x80066314; // type:func -Lights_New = 0x8006645C; // type:func -Lights_GlowCheck = 0x800664A4; // type:func -Lights_DrawGlow = 0x800666A8; // type:func -ZeldaArena_Malloc = 0x800668B0; // type:func -ZeldaArena_MallocR = 0x800668D8; // type:func -ZeldaArena_Realloc = 0x80066900; // type:func -ZeldaArena_Free = 0x80066930; // type:func -ZeldaArena_Calloc = 0x80066958; // type:func -ZeldaArena_GetSizes = 0x800669B0; // type:func -ZeldaArena_Check = 0x800669E8; // type:func -ZeldaArena_Init = 0x80066A0C; // type:func -ZeldaArena_Cleanup = 0x80066A3C; // type:func -ZeldaArena_IsInitialized = 0x80066A60; // type:func -MapMark_Init = 0x80066A90; // type:func -MapMark_ClearPointers = 0x80066B3C; // type:func -MapMark_DrawForDungeon = 0x80066B58; // type:func -MapMark_Draw = 0x80067048; // type:func -PreNmiBuff_Init = 0x80067090; // type:func -PreNmiBuff_SetReset = 0x80067108; // type:func -PreNmiBuff_IsResetting = 0x8006713C; // type:func -Sched_FlushTaskQueue = 0x80067150; // type:func -OLib_Vec3fDist = 0x800671D0; // type:func -OLib_Vec3fDistOutDiff = 0x80067214; // type:func -OLib_Vec3fDistXZ = 0x80067270; // type:func -OLib_ClampMinDist = 0x800672A4; // type:func -OLib_ClampMaxDist = 0x800672F4; // type:func -OLib_Vec3fDistNormalize = 0x80067344; // type:func -OLib_VecSphToVec3f = 0x800673F4; // type:func -OLib_VecGeoToVec3f = 0x800674A0; // type:func -OLib_Vec3fToVecSph = 0x800674E4; // type:func -OLib_Vec3fToVecGeo = 0x80067638; // type:func -OLib_Vec3fDiffToVecSph = 0x80067680; // type:func -OLib_Vec3fDiffToVecGeo = 0x800676D4; // type:func -OLib_Vec3fDiffRad = 0x80067728; // type:func -OLib_Vec3fDiffDegF = 0x800677B8; // type:func -OLib_Vec3fDiffBinAng = 0x80067820; // type:func -OnePointCutscene_AddVecGeoToVec3f = 0x800678C0; // type:func -OnePointCutscene_Vec3fYaw = 0x80067940; // type:func -OnePointCutscene_Vec3sToVec3f = 0x800679A8; // type:func -OnePointCutscene_BgCheckLineTest = 0x800679EC; // type:func -OnePointCutscene_RaycastDown = 0x80067A3C; // type:func -OnePointCutscene_SetCsCamPoints = 0x80067A64; // type:func -OnePointCutscene_SetInfo = 0x80067A98; // type:func -OnePointCutscene_SetAsChild = 0x8006B1D4; // type:func -OnePointCutscene_RemoveCamera = 0x8006B21C; // type:func -OnePointCutscene_Init = 0x8006B2F0; // type:func -OnePointCutscene_EndCutscene = 0x8006B5A8; // type:func -OnePointCutscene_Attention = 0x8006B604; // type:func -OnePointCutscene_AttentionSetSfx = 0x8006B770; // type:func -OnePointCutscene_EnableAttention = 0x8006B7C4; // type:func -OnePointCutscene_DisableAttention = 0x8006B7D4; // type:func -OnePointCutscene_CheckForCategory = 0x8006B7E8; // type:func -OnePointCutscene_Noop = 0x8006B848; // type:func -Map_SavePlayerInitialInfo = 0x8006B860; // type:func -Map_SetPaletteData = 0x8006B8C0; // type:func -Map_SetFloorPalettesData = 0x8006B93C; // type:func -Map_InitData = 0x8006BAF4; // type:func -Map_InitRoomData = 0x8006BDB0; // type:func -Map_Destroy = 0x8006BE8C; // type:func -Map_Init = 0x8006BEB4; // type:func -Minimap_DrawCompassIcons = 0x8006C13C; // type:func -Minimap_Draw = 0x8006C590; // type:func -Map_GetFloorTextIndexOffset = 0x8006D0AC; // type:func -Map_Update = 0x8006D0D4; // type:func -Interface_ChangeHudVisibilityMode = 0x8006D400; // type:func -Interface_RaiseButtonAlphas = 0x8006D434; // type:func -Interface_DimButtonAlphas = 0x8006D56C; // type:func -Interface_UpdateHudAlphas = 0x8006D640; // type:func -func_80083108 = 0x8006DE60; // type:func -Interface_SetSceneRestrictions = 0x8006ED7C; // type:func -Gfx_TextureIA8 = 0x8006EEC4; // type:func -Gfx_TextureI8 = 0x8006F0E8; // type:func -Inventory_SwapAgeEquipment = 0x8006F30C; // type:func -Interface_InitHorsebackArchery = 0x8006F590; // type:func -func_800849EC = 0x8006F5D8; // type:func -Interface_LoadItemIcon1 = 0x8006F658; // type:func -Interface_LoadItemIcon2 = 0x8006F708; // type:func -func_80084BF4 = 0x8006F7B8; // type:func -Item_Give = 0x8006F8D4; // type:func -Item_CheckObtainability = 0x80070F50; // type:func -Inventory_DeleteItem = 0x80071490; // type:func -Inventory_ReplaceItem = 0x80071510; // type:func -Inventory_HasEmptyBottle = 0x800715C4; // type:func -Inventory_HasSpecificBottle = 0x80071634; // type:func -Inventory_UpdateBottleItem = 0x800716AC; // type:func -Inventory_ConsumeFairy = 0x80071744; // type:func -func_80086D5C = 0x8007181C; // type:func -Interface_LoadActionLabel = 0x80071854; // type:func -Interface_SetDoAction = 0x800719B8; // type:func -Interface_SetNaviCall = 0x80071A40; // type:func -Interface_LoadActionLabelB = 0x80071B44; // type:func -Health_ChangeBy = 0x80071C1C; // type:func -Health_GiveHearts = 0x80071D00; // type:func -Rupees_ChangeBy = 0x80071D2C; // type:func -Inventory_ChangeAmmo = 0x80071D54; // type:func -Magic_Fill = 0x80072060; // type:func -Magic_Reset = 0x800720A8; // type:func -Magic_RequestChange = 0x800720E8; // type:func -Magic_Update = 0x800723A0; // type:func -Magic_DrawMeter = 0x80072C4C; // type:func -Interface_SetSubTimer = 0x80073438; // type:func -Interface_SetSubTimerToFinalSecond = 0x80073488; // type:func -Interface_SetTimer = 0x800734CC; // type:func -Interface_DrawActionLabel = 0x8007351C; // type:func -Interface_DrawItemButtons = 0x80073604; // type:func -Interface_DrawItemIconTexture = 0x800743F8; // type:func -Interface_DrawAmmoCount = 0x800745A0; // type:func -Interface_DrawActionButton = 0x80074A40; // type:func -Interface_InitVertices = 0x80074C2C; // type:func -func_8008A8B8 = 0x800750EC; // type:func -func_8008A994 = 0x800751CC; // type:func -Interface_Draw = 0x80075214; // type:func -Interface_Update = 0x80077DCC; // type:func -Path_GetByIndex = 0x80078AD0; // type:func -Path_OrientAndGetDistSq = 0x80078B14; // type:func -Path_CopyLastPoint = 0x80078C00; // type:func -FrameAdvance_Init = 0x80078CA0; // type:func -FrameAdvance_Update = 0x80078CB0; // type:func -Player_SetBootData = 0x80078D50; // type:func -Player_InBlockingCsMode = 0x80078EDC; // type:func -Player_InCsMode = 0x80078F8C; // type:func -func_8008E9C4 = 0x80078FC8; // type:func -Player_IsChildWithHylianShield = 0x80078FD8; // type:func -Player_ActionToModelGroup = 0x80079000; // type:func -Player_SetModelsForHoldingShield = 0x8007904C; // type:func -Player_SetModels = 0x80079138; // type:func -Player_SetModelGroup = 0x80079210; // type:func -func_8008EC70 = 0x8007927C; // type:func -Player_SetEquipmentData = 0x800792B4; // type:func -Player_UpdateBottleHeld = 0x800793A4; // type:func -func_8008EDF0 = 0x800793F8; // type:func -func_8008EE08 = 0x80079414; // type:func -func_8008EEAC = 0x800794B8; // type:func -func_8008EF30 = 0x8007953C; // type:func -func_8008EF44 = 0x80079554; // type:func -Player_IsBurningStickInRange = 0x80079570; // type:func -Player_GetStrength = 0x80079648; // type:func -Player_GetMask = 0x80079694; // type:func -Player_UnsetMask = 0x800796A4; // type:func -Player_HasMirrorShieldEquipped = 0x800796B4; // type:func -Player_HasMirrorShieldSetToDraw = 0x800796CC; // type:func -Player_ActionToMagicSpell = 0x800796F8; // type:func -Player_HoldsHookshot = 0x80079724; // type:func -func_8008F128 = 0x80079748; // type:func -Player_ActionToMeleeWeapon = 0x8007977C; // type:func -Player_GetMeleeWeaponHeld = 0x800797A4; // type:func -Player_HoldsTwoHandedWeapon = 0x800797C8; // type:func -Player_HoldsBrokenKnife = 0x800797F4; // type:func -Player_ActionToBottle = 0x8007984C; // type:func -Player_GetBottleHeld = 0x80079878; // type:func -Player_ActionToExplosive = 0x80079898; // type:func -Player_GetExplosiveHeld = 0x800798C4; // type:func -func_8008F2BC = 0x800798E4; // type:func -Player_GetEnvironmentalHazard = 0x80079920; // type:func -Player_DrawImpl = 0x80079A98; // type:func -func_8008F87C = 0x80079E5C; // type:func -Player_OverrideLimbDrawGameplayCommon = 0x8007A2A8; // type:func -Player_OverrideLimbDrawGameplayDefault = 0x8007A5FC; // type:func -Player_OverrideLimbDrawGameplayFirstPerson = 0x8007A8E8; // type:func -Player_OverrideLimbDrawGameplayCrawling = 0x8007AA38; // type:func -func_80090480 = 0x8007AA7C; // type:func -Player_UpdateShieldCollider = 0x8007AC04; // type:func -func_800906D4 = 0x8007ACD8; // type:func -Player_DrawGetItemImpl = 0x8007ADE8; // type:func -Player_DrawGetItem = 0x8007AF7C; // type:func -func_80090A28 = 0x8007AFF4; // type:func -Player_DrawHookshotReticle = 0x8007B0C8; // type:func -Player_PostLimbDrawGameplay = 0x8007B2AC; // type:func -Player_InitPauseDrawData = 0x8007BC14; // type:func -Player_OverrideLimbDrawPause = 0x8007BD40; // type:func -Player_DrawPauseImpl = 0x8007BEE4; // type:func -Player_DrawPause = 0x8007C5E8; // type:func -func_80092320 = 0x8007C7C0; // type:func -PreNMI_Update = 0x8007C7D4; // type:func -PreNMI_Draw = 0x8007C81C; // type:func -PreNMI_Main = 0x8007C8D8; // type:func -PreNMI_Destroy = 0x8007C90C; // type:func -PreNMI_Init = 0x8007C918; // type:func -Quake_AddVecGeoToVec3f = 0x8007C960; // type:func -Quake_UpdateShakeInfo = 0x8007C9E0; // type:func -Quake_CallbackType1 = 0x8007CC08; // type:func -Quake_CallbackType5 = 0x8007CC90; // type:func -Quake_CallbackType6 = 0x8007CD04; // type:func -Quake_CallbackType3 = 0x8007CD88; // type:func -Quake_CallbackType2 = 0x8007CE20; // type:func -Quake_CallbackType4 = 0x8007CE90; // type:func -Quake_GetFreeIndex = 0x8007CF28; // type:func -Quake_RequestImpl = 0x8007CF8C; // type:func -Quake_Remove = 0x8007D044; // type:func -Quake_GetRequest = 0x8007D06C; // type:func -Quake_SetValue = 0x8007D0C8; // type:func -Quake_SetSpeed = 0x8007D1F8; // type:func -Quake_SetDuration = 0x8007D240; // type:func -Quake_GetTimeLeft = 0x8007D290; // type:func -Quake_SetPerturbations = 0x8007D2C8; // type:func -Quake_SetOrientation = 0x8007D330; // type:func -Quake_Init = 0x8007D398; // type:func -Quake_Request = 0x8007D3EC; // type:func -Quake_RemoveRequest = 0x8007D410; // type:func -Quake_Update = 0x8007D458; // type:func -Gfx_SetFog = 0x8007D7D0; // type:func -Gfx_SetFogWithSync = 0x8007D94C; // type:func -Gfx_SetFog2 = 0x8007DADC; // type:func -Gfx_SetupDLImpl = 0x8007DB10; // type:func -Gfx_SetupDL = 0x8007DB4C; // type:func -Gfx_SetupDLAtPtr = 0x8007DB6C; // type:func -Gfx_SetupDL_57 = 0x8007DB98; // type:func -Gfx_SetupDL_57b = 0x8007DBC0; // type:func -Gfx_SetupDL_52NoCD = 0x8007DBE8; // type:func -Gfx_SetupDL_58Opa = 0x8007DC2C; // type:func -Gfx_SetupDL_57Opa = 0x8007DC54; // type:func -Gfx_SetupDL_50Opa = 0x8007DC7C; // type:func -Gfx_SetupDL_51Opa = 0x8007DCA4; // type:func -Gfx_SetupDL_52Xlu = 0x8007DCCC; // type:func -Gfx_SetupDL_53Opa = 0x8007DCF4; // type:func -Gfx_SetupDL_54Opa = 0x8007DD1C; // type:func -Gfx_SetupDL_55Xlu = 0x8007DD44; // type:func -Gfx_SetupDL_26Opa = 0x8007DD6C; // type:func -Gfx_SetupDL_25Xlu2 = 0x8007DD94; // type:func -func_80093C80 = 0x8007DDBC; // type:func -Gfx_SetupDL_25Opa = 0x8007DE28; // type:func -Gfx_SetupDL_25Xlu = 0x8007DE50; // type:func -Gfx_SetupDL_31Opa = 0x8007DE78; // type:func -Gfx_SetupDL_32Opa = 0x8007DEA0; // type:func -Gfx_SetupDL_33Opa = 0x8007DEC8; // type:func -Gfx_SetupDL_64 = 0x8007DEF0; // type:func -Gfx_SetupDL_34 = 0x8007DF18; // type:func -Gfx_SetupDL_34Opa = 0x8007DF40; // type:func -Gfx_SetupDL_35Opa = 0x8007DF6C; // type:func -Gfx_SetupDL_44Xlu = 0x8007DF94; // type:func -Gfx_SetupDL_36Opa = 0x8007DFBC; // type:func -Gfx_SetupDL_28 = 0x8007DFE4; // type:func -Gfx_SetupDL_28Opa = 0x8007E00C; // type:func -Gfx_SetupDL_43Opa = 0x8007E034; // type:func -Gfx_SetupDL_45Opa = 0x8007E05C; // type:func -Gfx_SetupDL_46Overlay = 0x8007E084; // type:func -Gfx_SetupDL_38Xlu = 0x8007E0AC; // type:func -Gfx_SetupDL_4Xlu = 0x8007E0D4; // type:func -Gfx_SetupDL_37Opa = 0x8007E0FC; // type:func -Gfx_SetupDL_2Opa = 0x8007E124; // type:func -Gfx_SetupDL_39 = 0x8007E14C; // type:func -Gfx_SetupDL_39Opa = 0x8007E174; // type:func -Gfx_SetupDL_39Overlay = 0x8007E1A0; // type:func -Gfx_SetupDL_39Ptr = 0x8007E1CC; // type:func -Gfx_SetupDL_40Opa = 0x8007E1F8; // type:func -Gfx_SetupDL_41Opa = 0x8007E220; // type:func -Gfx_SetupDL_47Xlu = 0x8007E248; // type:func -Gfx_SetupDL_66 = 0x8007E270; // type:func -Gfx_SetupDL_67 = 0x8007E298; // type:func -Gfx_SetupDL_68NoCD = 0x8007E2C0; // type:func -Gfx_SetupDL_69NoCD = 0x8007E304; // type:func -func_800947AC = 0x8007E348; // type:func -Gfx_SetupDL_70 = 0x8007E38C; // type:func -Gfx_SetupDL_20NoCD = 0x8007E3B4; // type:func -Gfx_SetupDL_42Opa = 0x8007E3F8; // type:func -Gfx_SetupDL_42Overlay = 0x8007E420; // type:func -Gfx_SetupDL_48Opa = 0x8007E448; // type:func -Gfx_SetupDL_49Xlu = 0x8007E470; // type:func -Gfx_SetupDL_27Xlu = 0x8007E498; // type:func -Gfx_SetupDL_60NoCDXlu = 0x8007E4C0; // type:func -Gfx_SetupDL_61Xlu = 0x8007E508; // type:func -Gfx_SetupDL_56Opa = 0x8007E530; // type:func -Gfx_SetupDL_56Ptr = 0x8007E558; // type:func -Gfx_SetupDL_59Opa = 0x8007E584; // type:func -Gfx_BranchTexScroll = 0x8007E5AC; // type:func -func_80094E54 = 0x8007E650; // type:func -func_80094E78 = 0x8007E674; // type:func -Gfx_TexScroll = 0x8007E698; // type:func -Gfx_TwoTexScroll = 0x8007E71C; // type:func -Gfx_TwoTexScrollEnvColor = 0x8007E83C; // type:func -Gfx_EnvColor = 0x8007E99C; // type:func -Gfx_SetupFrame = 0x8007E9F4; // type:func -func_80095974 = 0x8007EFAC; // type:func -func_80095AA0 = 0x8007F090; // type:func -Room_DrawNormal = 0x8007F0A8; // type:func -Room_DrawCullable = 0x8007F2C4; // type:func -Room_DecodeJpeg = 0x8007F78C; // type:func -Room_DrawBackground2D = 0x8007F814; // type:func -Room_DrawImageSingle = 0x8007FB10; // type:func -Room_GetImageMultiBgEntry = 0x8007FEE0; // type:func -Room_DrawImageMulti = 0x8007FFCC; // type:func -Room_DrawImage = 0x8008039C; // type:func -func_80096FD4 = 0x80080404; // type:func -func_80096FE8 = 0x8008041C; // type:func -func_8009728C = 0x800805B8; // type:func -func_800973FC = 0x800806F0; // type:func -Room_Draw = 0x80080794; // type:func -func_80097534 = 0x800807E4; // type:func -Sample_HandleStateChange = 0x80080880; // type:func -Sample_Draw = 0x800808B4; // type:func -Sample_Main = 0x80080AA0; // type:func -Sample_Destroy = 0x80080ACC; // type:func -Sample_SetupView = 0x80080AD8; // type:func -Sample_LoadTitleStatic = 0x80080B90; // type:func -Sample_Init = 0x80080BF0; // type:func -Inventory_ChangeEquipment = 0x80080C80; // type:func -Inventory_DeleteEquipment = 0x80080CD8; // type:func -Inventory_ChangeUpgrade = 0x80080DE4; // type:func -Object_SpawnPersistent = 0x80080E40; // type:func -Object_InitContext = 0x80080F24; // type:func -Object_UpdateEntries = 0x80081080; // type:func -Object_GetSlot = 0x80081178; // type:func -Object_IsLoaded = 0x800811D8; // type:func -func_800981B8 = 0x80081208; // type:func -func_800982FC = 0x80081290; // type:func -Scene_ExecuteCommands = 0x800812F0; // type:func -Scene_CommandPlayerEntryList = 0x80081374; // type:func -Scene_CommandActorEntryList = 0x80081450; // type:func -Scene_CommandUnused2 = 0x800814A8; // type:func -Scene_CommandCollisionHeader = 0x800814F0; // type:func -Scene_CommandRoomList = 0x80081620; // type:func -Scene_CommandSpawnList = 0x80081678; // type:func -Scene_CommandSpecialFiles = 0x800816C0; // type:func -Scene_CommandRoomBehavior = 0x80081788; // type:func -Scene_CommandRoomShape = 0x800817E0; // type:func -Scene_CommandObjectList = 0x80081828; // type:func -Scene_CommandLightList = 0x800819DC; // type:func -Scene_CommandPathList = 0x80081A8C; // type:func -Scene_CommandTransitionActorEntryList = 0x80081AD4; // type:func -TransitionActor_InitContext = 0x80081B2C; // type:func -Scene_CommandLightSettingsList = 0x80081B3C; // type:func -Scene_CommandSkyboxSettings = 0x80081B94; // type:func -Scene_CommandSkyboxDisables = 0x80081BD8; // type:func -Scene_CommandTimeSettings = 0x80081C00; // type:func -Scene_CommandWindSettings = 0x80081F14; // type:func -Scene_CommandExitList = 0x80081F78; // type:func -Scene_CommandUndefined9 = 0x80081FC0; // type:func -Scene_CommandSoundSettings = 0x80081FD0; // type:func -Scene_CommandEchoSettings = 0x8008201C; // type:func -Scene_CommandAlternateHeaderList = 0x80082034; // type:func -Scene_CommandCutsceneData = 0x80082130; // type:func -Scene_CommandMiscSettings = 0x80082170; // type:func -Scene_SetTransitionForNextEntrance = 0x80082234; // type:func -Scene_DrawConfigDefault = 0x800822F0; // type:func -Scene_DrawConfigDekuTree = 0x80082330; // type:func -Scene_DrawConfigDekuTreeBoss = 0x80082478; // type:func -Scene_DrawConfigDodongosCavern = 0x8008255C; // type:func -Scene_DrawConfigTempleOfTime = 0x80082884; // type:func -Scene_DrawConfigGrottos = 0x8008309C; // type:func -Scene_DrawConfigChamberOfTheSages = 0x800833AC; // type:func -Scene_DrawConfigGreatFairyFountain = 0x800835D0; // type:func -Scene_DrawConfigGraveExitLightShining = 0x80083768; // type:func -Scene_DrawConfigFairysFountain = 0x80083840; // type:func -Scene_DrawConfigShadowTempleAndWell = 0x800839A4; // type:func -Scene_DrawConfigThievesHideout = 0x80083B30; // type:func -Scene_DrawConfigWaterTemple = 0x80083C18; // type:func -Scene_DrawConfigWaterTempleBoss = 0x80084388; // type:func -Scene_DrawConfigShootingGallery = 0x800844A8; // type:func -Scene_DrawConfigCastleCourtyardGuards = 0x8008455C; // type:func -Scene_DrawConfigOutsideGanonsCastle = 0x800846D4; // type:func -func_8009BEEC = 0x80084970; // type:func -Scene_DrawConfigGanonsTowerCollapseExterior = 0x80084B30; // type:func -Scene_DrawConfigIceCavern = 0x80084E3C; // type:func -Scene_DrawConfigRoyalFamilysTomb = 0x8008502C; // type:func -Scene_DrawConfigLakesideLaboratory = 0x800852B0; // type:func -Scene_DrawConfigCalmWater = 0x80085490; // type:func -Scene_DrawConfigGerudoTrainingGround = 0x80085598; // type:func -Gfx_TwoTexScrollPrimColor = 0x80085788; // type:func -Scene_DrawConfigFishingPond = 0x800858E8; // type:func -Scene_DrawConfigBombchuBowlingAlley = 0x80085A14; // type:func -Scene_DrawConfigLonLonBuildings = 0x80085C18; // type:func -Scene_DrawConfigMarketGuardHouse = 0x80085CE8; // type:func -Scene_DrawConfigPotionShopGranny = 0x80085E18; // type:func -Scene_DrawConfigForestTemple = 0x80085F90; // type:func -Scene_DrawConfigSpiritTemple = 0x80086180; // type:func -Scene_DrawConfigHyruleField = 0x800861F0; // type:func -Scene_DrawConfigKakarikoVillage = 0x800864EC; // type:func -Scene_DrawConfigZorasRiver = 0x800865BC; // type:func -Scene_DrawConfigKokiriForest = 0x800867D4; // type:func -Scene_DrawConfigLakeHylia = 0x80086C38; // type:func -Scene_DrawConfigZorasDomain = 0x80086DF8; // type:func -Scene_DrawConfigZorasFountain = 0x80086F54; // type:func -Scene_DrawConfigGerudoValley = 0x80087144; // type:func -Scene_DrawConfigLostWoods = 0x80087480; // type:func -Scene_DrawConfigDesertColossus = 0x8008767C; // type:func -Scene_DrawConfigGerudosFortress = 0x80087788; // type:func -Scene_DrawConfigHauntedWasteland = 0x800877F8; // type:func -Scene_DrawConfigHyruleCastle = 0x80087970; // type:func -Scene_DrawConfigDeathMountainTrail = 0x80087B14; // type:func -Scene_DrawConfigDeathMountainCrater = 0x80087CD8; // type:func -Scene_DrawConfigGoronCity = 0x80087EA4; // type:func -Scene_DrawConfigLonLonRanch = 0x80088014; // type:func -Scene_DrawConfigFireTemple = 0x800880E4; // type:func -Scene_DrawConfigJabuJabu = 0x80088288; // type:func -Scene_DrawConfigInsideGanonsCastle = 0x80088734; // type:func -Scene_DrawConfigInsideGanonsCastleCollapse = 0x80088938; // type:func -Scene_DrawConfigGanonsTowerCollapseInterior = 0x80088958; // type:func -Scene_DrawConfigBesitu = 0x80088978; // type:func -Scene_Draw = 0x80088AB0; // type:func -SkelAnime_DrawLimbLod = 0x80088AF0; // type:func -SkelAnime_DrawLod = 0x80088D58; // type:func -SkelAnime_DrawFlexLimbLod = 0x80088F48; // type:func -SkelAnime_DrawFlexLod = 0x800891D8; // type:func -SkelAnime_DrawLimbOpa = 0x80089450; // type:func -SkelAnime_DrawOpa = 0x8008969C; // type:func -SkelAnime_DrawFlexLimbOpa = 0x8008987C; // type:func -SkelAnime_DrawFlexOpa = 0x80089AF4; // type:func -SkelAnime_GetFrameData = 0x80089D58; // type:func -Animation_GetLength = 0x80089EC0; // type:func -Animation_GetLastFrame = 0x80089EFC; // type:func -SkelAnime_DrawLimb = 0x80089F44; // type:func -SkelAnime_Draw = 0x8008A184; // type:func -SkelAnime_DrawFlexLimb = 0x8008A374; // type:func -SkelAnime_DrawFlex = 0x8008A604; // type:func -SkelAnime_GetFrameDataLegacy = 0x8008A86C; // type:func -Animation_GetLimbCountLegacy = 0x8008AC70; // type:func -Animation_GetLengthLegacy = 0x8008ACAC; // type:func -Animation_GetLastFrameLegacy = 0x8008ACE8; // type:func -SkelAnime_InterpFrameTable = 0x8008AD30; // type:func -AnimTaskQueue_Reset = 0x8008B1B0; // type:func -AnimTaskQueue_SetNextGroup = 0x8008B1BC; // type:func -AnimTaskQueue_DisableTransformTasksForGroup = 0x8008B1DC; // type:func -AnimTaskQueue_NewTask = 0x8008B204; // type:func -AnimTaskQueue_AddLoadPlayerFrame = 0x8008B23C; // type:func -AnimTaskQueue_AddCopy = 0x8008B338; // type:func -AnimTaskQueue_AddInterp = 0x8008B3A0; // type:func -AnimTaskQueue_AddCopyUsingMap = 0x8008B410; // type:func -AnimTaskQueue_AddCopyUsingMapInverted = 0x8008B480; // type:func -AnimTaskQueue_AddActorMove = 0x8008B4F0; // type:func -AnimTask_LoadPlayerFrame = 0x8008B54C; // type:func -AnimTask_Copy = 0x8008B57C; // type:func -AnimTask_Interp = 0x8008B5EC; // type:func -AnimTask_CopyUsingMap = 0x8008B648; // type:func -AnimTask_CopyUsingMapInverted = 0x8008B6C8; // type:func -AnimTask_ActorMove = 0x8008B74C; // type:func -AnimTaskQueue_Update = 0x8008B7E0; // type:func -SkelAnime_InitLink = 0x8008B880; // type:func -LinkAnimation_SetUpdateFunction = 0x8008B9E4; // type:func -LinkAnimation_Update = 0x8008BA1C; // type:func -LinkAnimation_Morph = 0x8008BA40; // type:func -LinkAnimation_AnimateFrame = 0x8008BAFC; // type:func -LinkAnimation_Loop = 0x8008BBD8; // type:func -LinkAnimation_Once = 0x8008BC78; // type:func -Animation_SetMorph = 0x8008BD54; // type:func -LinkAnimation_Change = 0x8008BD78; // type:func -LinkAnimation_PlayOnce = 0x8008BEF0; // type:func -LinkAnimation_PlayOnceSetSpeed = 0x8008BF50; // type:func -LinkAnimation_PlayLoop = 0x8008BFB4; // type:func -LinkAnimation_PlayLoopSetSpeed = 0x8008C010; // type:func -LinkAnimation_CopyJointToMorph = 0x8008C070; // type:func -LinkAnimation_CopyMorphToJoint = 0x8008C0A0; // type:func -LinkAnimation_LoadToMorph = 0x8008C0D0; // type:func -LinkAnimation_LoadToJoint = 0x8008C114; // type:func -LinkAnimation_InterpJointMorph = 0x8008C158; // type:func -LinkAnimation_BlendToJoint = 0x8008C190; // type:func -LinkAnimation_BlendToMorph = 0x8008C230; // type:func -LinkAnimation_EndLoop = 0x8008C2D0; // type:func -Animation_OnFrameImpl = 0x8008C2F4; // type:func -LinkAnimation_OnFrame = 0x8008C3AC; // type:func -SkelAnime_Init = 0x8008C3FC; // type:func -SkelAnime_InitFlex = 0x8008C500; // type:func -SkelAnime_InitSkin = 0x8008C60C; // type:func -SkelAnime_SetUpdate = 0x8008C6EC; // type:func -SkelAnime_Update = 0x8008C738; // type:func -SkelAnime_Morph = 0x8008C75C; // type:func -SkelAnime_MorphTaper = 0x8008C81C; // type:func -SkelAnime_AnimateFrame = 0x8008C9A4; // type:func -SkelAnime_LoopFull = 0x8008CAEC; // type:func -SkelAnime_LoopPartial = 0x8008CB8C; // type:func -SkelAnime_Once = 0x8008CC34; // type:func -Animation_ChangeImpl = 0x8008CD38; // type:func -Animation_Change = 0x8008CEF4; // type:func -Animation_PlayOnce = 0x8008CF3C; // type:func -Animation_MorphToPlayOnce = 0x8008CF94; // type:func -Animation_PlayOnceSetSpeed = 0x8008CFF0; // type:func -Animation_PlayLoop = 0x8008D04C; // type:func -Animation_MorphToLoop = 0x8008D0A0; // type:func -Animation_PlayLoopSetSpeed = 0x8008D0D8; // type:func -Animation_EndLoop = 0x8008D130; // type:func -Animation_Reverse = 0x8008D15C; // type:func -SkelAnime_CopyFrameTableTrue = 0x8008D180; // type:func -SkelAnime_CopyFrameTableFalse = 0x8008D1E8; // type:func -SkelAnime_UpdateTranslation = 0x8008D254; // type:func -Animation_OnFrame = 0x8008D420; // type:func -SkelAnime_Free = 0x8008D448; // type:func -SkelAnime_CopyFrameTable = 0x8008D494; // type:func -Skin_UpdateVertices = 0x8008D4E0; // type:func -Skin_ApplyLimbModifications = 0x8008D6AC; // type:func -Skin_DrawAnimatedLimb = 0x8008DB18; // type:func -Skin_DrawLimb = 0x8008DBF4; // type:func -Skin_DrawImpl = 0x8008DD1C; // type:func -func_800A6330 = 0x8008DF48; // type:func -func_800A6360 = 0x8008DF78; // type:func -func_800A6394 = 0x8008DFAC; // type:func -func_800A63CC = 0x8008DFE4; // type:func -Skin_GetLimbPos = 0x8008E020; // type:func -Skin_InitAnimatedLimb = 0x8008E080; // type:func -Skin_Init = 0x8008E25C; // type:func -Skin_Free = 0x8008E42C; // type:func -func_800A698C = 0x8008E500; // type:func -Skin_ApplyAnimTransformations = 0x8008E63C; // type:func -SkinMatrix_Vec3fMtxFMultXYZW = 0x8008E990; // type:func -SkinMatrix_Vec3fMtxFMultXYZ = 0x8008EA78; // type:func -SkinMatrix_MtxFMtxFMult = 0x8008EB28; // type:func -SkinMatrix_GetClear = 0x8008EE84; // type:func -SkinMatrix_Clear = 0x8008EE98; // type:func -SkinMatrix_MtxFCopy = 0x8008EEF0; // type:func -SkinMatrix_Invert = 0x8008EF78; // type:func -SkinMatrix_SetScale = 0x8008F218; // type:func -SkinMatrix_SetRotateZYX = 0x8008F27C; // type:func -SkinMatrix_SetRotateYXZ = 0x8008F40C; // type:func -SkinMatrix_SetTranslate = 0x8008F59C; // type:func -SkinMatrix_SetTranslateRotateZYXScale = 0x8008F600; // type:func -SkinMatrix_SetTranslateRotateYXZScale = 0x8008F684; // type:func -SkinMatrix_SetTranslateRotateZYX = 0x8008F708; // type:func -SkinMatrix_Vec3fToVec3s = 0x8008F768; // type:func -SkinMatrix_Vec3sToVec3f = 0x8008F7AC; // type:func -SkinMatrix_MtxFToMtx = 0x8008F7F0; // type:func -SkinMatrix_MtxFToNewMtx = 0x8008FA08; // type:func -SkinMatrix_SetRotateAxis = 0x8008FA50; // type:func -func_800A8030 = 0x8008FBC0; // type:func -Sram_InitNewSave = 0x8008FD30; // type:func -Sram_InitDebugSave = 0x8008FE5C; // type:func -Sram_OpenSave = 0x8009001C; // type:func -Sram_WriteSave = 0x80090360; // type:func -Sram_VerifyAndLoadAllSaves = 0x800904AC; // type:func -Sram_InitSave = 0x80090978; // type:func -Sram_EraseSave = 0x80090C18; // type:func -Sram_CopySave = 0x80090D30; // type:func -Sram_WriteSramHeader = 0x80090F20; // type:func -Sram_InitSram = 0x80090F54; // type:func -Sram_Alloc = 0x80091024; // type:func -Sram_Init = 0x80091054; // type:func -SsSram_Init = 0x80091070; // type:func -SsSram_Dma = 0x80091148; // type:func -SsSram_ReadWrite = 0x800911D4; // type:func -Rumble_Update = 0x80091240; // type:func -Rumble_Override = 0x8009127C; // type:func -Rumble_Request = 0x80091318; // type:func -Rumble_Init = 0x800913D4; // type:func -Rumble_Destroy = 0x80091410; // type:func -Rumble_Controller1HasRumblePak = 0x80091468; // type:func -Rumble_Reset = 0x80091480; // type:func -Rumble_ClearRequests = 0x80091494; // type:func -Rumble_SetUpdateEnabled = 0x800914A4; // type:func -View_ViewportToVp = 0x800914C0; // type:func -View_New = 0x8009152C; // type:func -View_Free = 0x80091578; // type:func -View_Init = 0x80091598; // type:func -View_LookAt = 0x80091658; // type:func -View_LookAtUnsafe = 0x800916F4; // type:func -View_SetScale = 0x80091744; // type:func -View_GetScale = 0x80091764; // type:func -View_SetPerspective = 0x80091774; // type:func -View_GetPerspective = 0x800917A4; // type:func -View_SetOrtho = 0x800917C4; // type:func -View_GetOrtho = 0x80091800; // type:func -View_SetViewport = 0x80091820; // type:func -View_GetViewport = 0x80091854; // type:func -View_ApplyLetterbox = 0x8009187C; // type:func -View_SetDistortionOrientation = 0x800919BC; // type:func -View_SetDistortionScale = 0x800919E0; // type:func -View_SetDistortionSpeed = 0x80091A04; // type:func -View_InitDistortion = 0x80091A18; // type:func -View_ClearDistortion = 0x80091A7C; // type:func -View_SetDistortion = 0x80091AB0; // type:func -View_StepDistortion = 0x80091B04; // type:func -View_Apply = 0x80091CBC; // type:func -View_ApplyPerspective = 0x80091D08; // type:func -View_ApplyOrtho = 0x80091FFC; // type:func -View_ApplyOrthoToOverlay = 0x800921A8; // type:func -View_ApplyPerspectiveToOverlay = 0x800923DC; // type:func -View_UpdateViewingMatrix = 0x8009272C; // type:func -View_ApplyTo = 0x80092798; // type:func -ViMode_LogPrint = 0x80092BC0; // type:func -ViMode_Configure = 0x80092BCC; // type:func -ViMode_Save = 0x80093174; // type:func -ViMode_Load = 0x80093254; // type:func -ViMode_Init = 0x800932DC; // type:func -ViMode_Destroy = 0x80093344; // type:func -ViMode_ConfigureFeatures = 0x80093350; // type:func -ViMode_Update = 0x800933B4; // type:func -VisCvg_Init = 0x80093730; // type:func -VisCvg_Destroy = 0x80093754; // type:func -VisCvg_Draw = 0x80093760; // type:func -VisMono_Init = 0x800938D0; // type:func -VisMono_Destroy = 0x80093920; // type:func -VisMono_DesaturateTLUT = 0x80093944; // type:func -VisMono_DesaturateDList = 0x80093C58; // type:func -VisMono_Draw = 0x80093E88; // type:func -VisMono_DrawOld = 0x8009407C; // type:func -VisZBuf_Init = 0x800940F0; // type:func -VisZBuf_Destroy = 0x80094124; // type:func -VisZBuf_Draw = 0x80094130; // type:func -Skybox_CalculateFace256 = 0x80094380; // type:func -Skybox_CalculateFace128 = 0x80094A90; // type:func -Skybox_Calculate256 = 0x80095798; // type:func -Skybox_Calculate128 = 0x80095948; // type:func -Skybox_Setup = 0x800959E8; // type:func -Skybox_Init = 0x80096B3C; // type:func -Skybox_UpdateMatrix = 0x80096C50; // type:func -Skybox_Draw = 0x80096CD8; // type:func -Skybox_Update = 0x80097320; // type:func -PlayerCall_InitFuncPtrs = 0x80097330; // type:func -PlayerCall_Init = 0x80097398; // type:func -PlayerCall_Destroy = 0x800973E0; // type:func -PlayerCall_Update = 0x80097420; // type:func -PlayerCall_Draw = 0x80097460; // type:func -TransitionTile_InitGraphics = 0x800974A0; // type:func -TransitionTile_InitVtxData = 0x8009786C; // type:func -TransitionTile_Destroy = 0x8009792C; // type:func -TransitionTile_Init = 0x800979B8; // type:func -TransitionTile_SetVtx = 0x80097B30; // type:func -TransitionTile_Draw = 0x80097C44; // type:func -TransitionTile_Suck = 0x80097D70; // type:func -TransitionTile_Update = 0x80097EA4; // type:func -func_800B23F0 = 0x80097EB0; // type:func -TransitionTriforce_Start = 0x80097EC0; // type:func -TransitionTriforce_Init = 0x80097EF8; // type:func -TransitionTriforce_Destroy = 0x80097F98; // type:func -TransitionTriforce_Update = 0x80097FA4; // type:func -TransitionTriforce_SetColor = 0x800980B8; // type:func -TransitionTriforce_SetType = 0x800980C4; // type:func -TransitionTriforce_SetState = 0x800980D0; // type:func -TransitionTriforce_Draw = 0x800980DC; // type:func -TransitionTriforce_IsDone = 0x800983EC; // type:func -TransitionWipe_Start = 0x80098480; // type:func -TransitionWipe_Init = 0x80098538; // type:func -TransitionWipe_Destroy = 0x80098564; // type:func -TransitionWipe_Update = 0x80098570; // type:func -TransitionWipe_Draw = 0x80098650; // type:func -TransitionWipe_IsDone = 0x8009888C; // type:func -TransitionWipe_SetType = 0x80098898; // type:func -TransitionWipe_SetColor = 0x800988D8; // type:func -TransitionWipe_SetUnkColor = 0x800988E4; // type:func -TransitionCircle_Start = 0x800988F0; // type:func -TransitionCircle_Init = 0x80098ADC; // type:func -TransitionCircle_Destroy = 0x80098B08; // type:func -TransitionCircle_Update = 0x80098B14; // type:func -TransitionCircle_Draw = 0x80098C98; // type:func -TransitionCircle_IsDone = 0x80098F34; // type:func -TransitionCircle_SetType = 0x80098F40; // type:func -TransitionCircle_SetColor = 0x80098F98; // type:func -TransitionCircle_SetUnkColor = 0x80098FA4; // type:func -TransitionFade_Start = 0x80098FB0; // type:func -TransitionFade_Init = 0x8009900C; // type:func -TransitionFade_Destroy = 0x80099038; // type:func -TransitionFade_Update = 0x80099044; // type:func -TransitionFade_Draw = 0x800991D4; // type:func -TransitionFade_IsDone = 0x800992A0; // type:func -TransitionFade_SetColor = 0x800992AC; // type:func -TransitionFade_SetType = 0x800992B8; // type:func -Letterbox_SetSizeTarget = 0x80099310; // type:func -Letterbox_GetSizeTarget = 0x80099320; // type:func -Letterbox_SetSize = 0x80099330; // type:func -Letterbox_GetSize = 0x80099340; // type:func -Letterbox_Init = 0x80099350; // type:func -Letterbox_Destroy = 0x80099370; // type:func -Letterbox_Update = 0x80099380; // type:func -func_800BB0A0 = 0x80099480; // type:func -func_800BB2B4 = 0x80099694; // type:func -KaleidoManager_LoadOvl = 0x80099950; // type:func -KaleidoManager_ClearOvl = 0x800999AC; // type:func -KaleidoManager_Init = 0x800999FC; // type:func -KaleidoManager_Destroy = 0x80099A6C; // type:func -KaleidoManager_GetRamAddr = 0x80099AAC; // type:func -KaleidoScopeCall_LoadPlayer = 0x80099B80; // type:func -KaleidoScopeCall_Init = 0x80099BCC; // type:func -KaleidoScopeCall_Destroy = 0x80099C18; // type:func -KaleidoScopeCall_Update = 0x80099C38; // type:func -KaleidoScopeCall_Draw = 0x80099DD8; // type:func -Play_RequestViewpointBgCam = 0x80099E60; // type:func -Play_SetViewpoint = 0x80099EA0; // type:func -Play_CheckViewpoint = 0x80099F4C; // type:func -Play_SetShopBrowsingViewpoint = 0x80099F74; // type:func -Play_SetupTransition = 0x80099FA0; // type:func -func_800BC88C = 0x8009A24C; // type:func -Play_SetFog = 0x8009A264; // type:func -Play_Destroy = 0x8009A2B0; // type:func -Play_Init = 0x8009A41C; // type:func -Play_Update = 0x8009ABD4; // type:func -Play_DrawOverlayElements = 0x8009BCC8; // type:func -Play_Draw = 0x8009BD60; // type:func -Play_Main = 0x8009C7A4; // type:func -Play_InCsMode = 0x8009C7E4; // type:func -func_800BFCB8 = 0x8009C818; // type:func -Play_LoadFile = 0x8009C9C4; // type:func -Play_InitEnvironment = 0x8009CA20; // type:func -Play_InitScene = 0x8009CA68; // type:func -Play_SpawnScene = 0x8009CB6C; // type:func -Play_GetScreenPos = 0x8009CC14; // type:func -Play_CreateSubCamera = 0x8009CCD8; // type:func -Play_GetActiveCamId = 0x8009CD88; // type:func -Play_ChangeCameraStatus = 0x8009CD94; // type:func -Play_ClearCamera = 0x8009CE04; // type:func -Play_ClearAllSubCameras = 0x8009CE6C; // type:func -Play_GetCamera = 0x8009CED8; // type:func -Play_SetCameraAtEye = 0x8009CF10; // type:func -Play_SetCameraAtEyeUp = 0x8009D020; // type:func -Play_SetCameraFov = 0x8009D144; // type:func -Play_SetCameraRoll = 0x8009D18C; // type:func -Play_CopyCamera = 0x8009D1D8; // type:func -Play_InitCameraDataUsingPlayer = 0x8009D254; // type:func -Play_RequestCameraSetting = 0x8009D2C4; // type:func -Play_ReturnToMainCam = 0x8009D300; // type:func -Play_GetCameraUID = 0x8009D3DC; // type:func -func_800C09D8 = 0x8009D410; // type:func -Play_SaveSceneFlags = 0x8009D47C; // type:func -Play_SetRespawnData = 0x8009D4C4; // type:func -Play_SetupRespawnPoint = 0x8009D534; // type:func -Play_TriggerVoidOut = 0x8009D5A0; // type:func -Play_LoadToLastEntrance = 0x8009D5F8; // type:func -Play_TriggerRespawn = 0x8009D6CC; // type:func -Play_CamIsNotFixed = 0x8009D700; // type:func -FrameAdvance_IsEnabled = 0x8009D770; // type:func -func_800C0D34 = 0x8009D780; // type:func -func_800C0DB4 = 0x8009D800; // type:func -PreRender_SetValuesSave = 0x8009D8C0; // type:func -PreRender_Init = 0x8009D8FC; // type:func -PreRender_SetValues = 0x8009D930; // type:func -PreRender_Destroy = 0x8009D964; // type:func -PreRender_CopyImage = 0x8009D988; // type:func -PreRender_CopyImageRegionImpl = 0x8009DC50; // type:func -func_800C170C = 0x8009E098; // type:func -func_800C1AE8 = 0x8009E414; // type:func -PreRender_CoverageRgba16ToI8 = 0x8009E450; // type:func -PreRender_SaveZBuffer = 0x8009E768; // type:func -PreRender_SaveFramebuffer = 0x8009E7A0; // type:func -PreRender_FetchFbufCoverage = 0x8009E7D8; // type:func -PreRender_DrawCoverage = 0x8009E8F0; // type:func -PreRender_RestoreZBuffer = 0x8009E934; // type:func -func_800C213C = 0x8009E958; // type:func -PreRender_RestoreFramebuffer = 0x8009EC88; // type:func -PreRender_CopyImageRegion = 0x8009ECAC; // type:func -PreRender_AntiAliasFilter = 0x8009ECCC; // type:func -PreRender_DivotFilter = 0x8009F78C; // type:func -PreRender_ApplyFilters = 0x8009F8E0; // type:func -THGA_Init = 0x8009F9B0; // type:func -THGA_Destroy = 0x8009F9D0; // type:func -THGA_IsCrash = 0x8009F9F0; // type:func -THGA_Reset = 0x8009FA10; // type:func -THGA_GetRemaining = 0x8009FA30; // type:func -THGA_GetHead = 0x8009FA50; // type:func -THGA_SetHead = 0x8009FA70; // type:func -THGA_GetTail = 0x8009FA90; // type:func -THGA_AllocDisplayList = 0x8009FAB0; // type:func -THGA_AllocGfx = 0x8009FAD4; // type:func -THGA_AllocGfx2 = 0x8009FAF4; // type:func -THGA_AllocTail = 0x8009FB14; // type:func -THGA_AllocMtxArray = 0x8009FB34; // type:func -THGA_AllocMtx = 0x8009FB58; // type:func -THGA_AllocVtxArray = 0x8009FB78; // type:func -THGA_AllocVtx = 0x8009FB9C; // type:func -THA_GetHead = 0x8009FBC0; // type:func -THA_SetHead = 0x8009FBCC; // type:func -THA_GetTail = 0x8009FBD8; // type:func -THA_AllocHead = 0x8009FBE4; // type:func -THA_AllocHeadByte = 0x8009FBF8; // type:func -THA_AllocTail = 0x8009FC18; // type:func -THA_AllocTailAlign16 = 0x8009FCA8; // type:func -THA_AllocTailAlign = 0x8009FCC8; // type:func -THA_GetRemaining = 0x8009FCE4; // type:func -THA_IsCrash = 0x8009FCF8; // type:func -THA_Reset = 0x8009FD1C; // type:func -THA_Init = 0x8009FD38; // type:func -THA_Destroy = 0x8009FD5C; // type:func -AudioMgr_StopAllSfx = 0x8009FD80; // type:func -AudioMgr_NotifyTaskDone = 0x8009FDD0; // type:func -AudioMgr_HandleRetrace = 0x8009FE08; // type:func -AudioMgr_HandlePreNMI = 0x8009FF90; // type:func -AudioMgr_ThreadEntry = 0x8009FFB4; // type:func -AudioMgr_WaitForInit = 0x800A00E4; // type:func -AudioMgr_Init = 0x800A0110; // type:func -Setup_InitImpl = 0x800A01E0; // type:func -Setup_Destroy = 0x800A021C; // type:func -Setup_Init = 0x800A0228; // type:func -GameState_SetFBFilter = 0x800A0250; // type:func -func_800C4344 = 0x800A03A4; // type:func -GameState_Draw = 0x800A03B0; // type:func -GameState_SetFrameBuffer = 0x800A04A8; // type:func -func_800C49F4 = 0x800A058C; // type:func -GameState_ReqPadData = 0x800A0604; // type:func -GameState_Update = 0x800A0634; // type:func -GameState_InitArena = 0x800A06B0; // type:func -GameState_Realloc = 0x800A0720; // type:func -GameState_Init = 0x800A07E0; // type:func -GameState_Destroy = 0x800A08D8; // type:func -GameState_GetInit = 0x800A0988; // type:func -GameState_GetSize = 0x800A0994; // type:func -GameState_IsRunning = 0x800A09A0; // type:func -GameState_GetArenaSize = 0x800A09AC; // type:func -GameAlloc_Log = 0x800A09D0; // type:func -GameAlloc_Malloc = 0x800A09F0; // type:func -GameAlloc_Free = 0x800A0A5C; // type:func -GameAlloc_Cleanup = 0x800A0AA8; // type:func -GameAlloc_Init = 0x800A0AF8; // type:func -Graph_InitTHGA = 0x800A0B10; // type:func -Graph_GetNextGameState = 0x800A0C28; // type:func -Graph_Init = 0x800A0CD8; // type:func -Graph_Destroy = 0x800A0D48; // type:func -Graph_TaskSet00 = 0x800A0D54; // type:func -Graph_Update = 0x800A1098; // type:func -Graph_ThreadEntry = 0x800A134C; // type:func -Graph_Alloc = 0x800A1444; // type:func -Graph_Alloc2 = 0x800A1478; // type:func -Gfx_Open = 0x800A14B0; // type:func -Gfx_Close = 0x800A14BC; // type:func -Gfx_Alloc = 0x800A14D4; // type:func -ListAlloc_Init = 0x800A1510; // type:func -ListAlloc_Alloc = 0x800A1524; // type:func -ListAlloc_Free = 0x800A1590; // type:func -ListAlloc_FreeAll = 0x800A1610; // type:func -Main = 0x800A1660; // type:func -PadMgr_AcquireSerialEventQueue = 0x800A19C0; // type:func -PadMgr_ReleaseSerialEventQueue = 0x800A19F0; // type:func -PadMgr_LockPadData = 0x800A1A18; // type:func -PadMgr_UnlockPadData = 0x800A1A44; // type:func -PadMgr_UpdateRumble = 0x800A1A70; // type:func -PadMgr_RumbleStop = 0x800A1CC0; // type:func -PadMgr_RumbleReset = 0x800A1D58; // type:func -PadMgr_RumbleSetSingle = 0x800A1D68; // type:func -PadMgr_RumbleSet = 0x800A1D80; // type:func -PadMgr_UpdateInputs = 0x800A1DB0; // type:func -PadMgr_HandleRetrace = 0x800A1F90; // type:func -PadMgr_HandlePreNMI = 0x800A2128; // type:func -PadMgr_RequestPadData = 0x800A214C; // type:func -PadMgr_ThreadEntry = 0x800A22C8; // type:func -PadMgr_Init = 0x800A23C4; // type:func -Sched_SwapFrameBufferImpl = 0x800A24C0; // type:func -Sched_SwapFrameBuffer = 0x800A2530; // type:func -Sched_HandlePreNMI = 0x800A2580; // type:func -Sched_HandleNMI = 0x800A258C; // type:func -Sched_QueueTask = 0x800A25B0; // type:func -Sched_Yield = 0x800A261C; // type:func -Sched_GfxTaskFramebufferValid = 0x800A2650; // type:func -Sched_Schedule = 0x800A2714; // type:func -Sched_SetNextFramebufferFromTask = 0x800A2848; // type:func -Sched_TaskComplete = 0x800A2894; // type:func -Sched_RunTask = 0x800A290C; // type:func -Sched_HandleNotification = 0x800A2A70; // type:func -Sched_HandleRetrace = 0x800A2B60; // type:func -Sched_HandleRSPDone = 0x800A2C38; // type:func -Sched_HandleRDPDone = 0x800A2E4C; // type:func -Sched_Notify = 0x800A2F14; // type:func -Sched_ThreadEntry = 0x800A2F38; // type:func -Sched_Init = 0x800A306C; // type:func -SpeedMeter_InitImpl = 0x800A3140; // type:func -SpeedMeter_Init = 0x800A3150; // type:func -SpeedMeter_Destroy = 0x800A3174; // type:func -SpeedMeter_DrawTimeEntries = 0x800A3180; // type:func -SpeedMeter_InitAllocEntry = 0x800A3644; // type:func -SpeedMeter_DrawAllocEntry = 0x800A3688; // type:func -SpeedMeter_DrawAllocEntries = 0x800A38DC; // type:func -SysCfb_Init = 0x800A3B80; // type:func -SysCfb_Reset = 0x800A3C48; // type:func -SysCfb_GetFbPtr = 0x800A3C68; // type:func -SysCfb_GetFbEnd = 0x800A3C90; // type:func -Math_FactorialF = 0x800A3CA0; // type:func -Math_Factorial = 0x800A3DA0; // type:func -Math_PowF = 0x800A3E64; // type:func -Math_SinF = 0x800A3E8C; // type:func -Math_CosF = 0x800A3EE0; // type:func -Math3D_PlaneVsLineSegClosestPoint = 0x800A3F40; // type:func -Math3D_LineVsLineClosestTwoPoints = 0x800A4060; // type:func -Math3D_LineClosestToPoint = 0x800A430C; // type:func -Math3D_FindPointOnPlaneIntersect = 0x800A43F8; // type:func -Math3D_PlaneVsPlaneNewLine = 0x800A4458; // type:func -Math3D_PlaneVsPlaneVsLineClosestPoint = 0x800A4638; // type:func -Math3D_PointOnInfiniteLine = 0x800A46B4; // type:func -Math3D_LineSplitRatio = 0x800A4700; // type:func -Math3D_Cos = 0x800A474C; // type:func -Math3D_CosOut = 0x800A4770; // type:func -Math3D_Vec3fReflect = 0x800A4828; // type:func -Math3D_PointInSquare2D = 0x800A48FC; // type:func -Math3D_CirSquareVsTriSquare = 0x800A4960; // type:func -Math3D_SphCubeVsTriCube = 0x800A4AA0; // type:func -Math3D_Dist1DSq = 0x800A4CC4; // type:func -Math3D_Dist1D = 0x800A4CDC; // type:func -Math3D_Dist2DSq = 0x800A4D00; // type:func -Math3D_Dist2D = 0x800A4D44; // type:func -Math3D_Vec3fMagnitudeSq = 0x800A4D74; // type:func -Math3D_Vec3fMagnitude = 0x800A4DA0; // type:func -Math3D_Vec3fDistSq = 0x800A4DC8; // type:func -Math3D_Vec3f_DistXYZ = 0x800A4DF0; // type:func -Math3D_DistXYZ16toF = 0x800A4E10; // type:func -Math3D_Vec3fDiff_CrossZ = 0x800A4E88; // type:func -Math3D_Vec3fDiff_CrossX = 0x800A4EC8; // type:func -Math3D_Vec3fDiff_CrossY = 0x800A4F08; // type:func -Math3D_Vec3f_Cross = 0x800A4F48; // type:func -Math3D_SurfaceNorm = 0x800A4FBC; // type:func -Math3D_PointRelativeToCubeFaces = 0x800A5024; // type:func -Math3D_PointRelativeToCubeEdges = 0x800A50D0; // type:func -Math3D_PointRelativeToCubeVertices = 0x800A5280; // type:func -Math3D_LineVsCube = 0x800A53FC; // type:func -Math3D_LineVsCubeShort = 0x800A5E74; // type:func -Math3D_RotateXZPlane = 0x800A5FE0; // type:func -Math3D_DefPlane = 0x800A606C; // type:func -Math3D_Planef = 0x800A6180; // type:func -Math3D_Plane = 0x800A61C0; // type:func -Math3D_UDistPlaneToPos = 0x800A61FC; // type:func -Math3D_DistPlaneToPos = 0x800A6234; // type:func -Math3D_TriChkPointParaYImpl = 0x800A62B8; // type:func -Math3D_TriChkPointParaYDeterminate = 0x800A65D4; // type:func -Math3D_TriChkPointParaYSlopedY = 0x800A661C; // type:func -Math3D_TriChkPointParaYIntersectDist = 0x800A666C; // type:func -Math3D_TriChkPointParaYIntersectInsideTri = 0x800A671C; // type:func -Math3D_TriChkPointParaY = 0x800A67C8; // type:func -Math3D_TriChkLineSegParaYIntersect = 0x800A6844; // type:func -Math3D_TriChkPointParaYDist = 0x800A69B8; // type:func -Math3D_TriChkPointParaXImpl = 0x800A6A2C; // type:func -Math3D_TriChkPointParaXDeterminate = 0x800A6D48; // type:func -Math3D_TriChkPointParaXIntersect = 0x800A6D90; // type:func -Math3D_TriChkPointParaX = 0x800A6E44; // type:func -Math3D_TriChkLineSegParaXIntersect = 0x800A6EC0; // type:func -Math3D_TriChkPointParaXDist = 0x800A7048; // type:func -Math3D_TriChkPointParaZImpl = 0x800A70BC; // type:func -Math3D_TriChkPointParaZDeterminate = 0x800A7404; // type:func -Math3D_TriChkPointParaZIntersect = 0x800A744C; // type:func -Math3D_TriChkPointParaZ = 0x800A7500; // type:func -Math3D_TriChkLineSegParaZIntersect = 0x800A757C; // type:func -Math3D_TriChkLineSegParaZDist = 0x800A7708; // type:func -Math3D_LineSegFindPlaneIntersect = 0x800A777C; // type:func -Math3D_LineSegVsPlane = 0x800A7858; // type:func -Math3D_TriLineIntersect = 0x800A7960; // type:func -Math3D_TriNorm = 0x800A7AC4; // type:func -Math3D_PointInSph = 0x800A7B74; // type:func -Math3D_PointDistSqToLine2D = 0x800A7BC4; // type:func -Math3D_LineVsSph = 0x800A7D0C; // type:func -Math3D_GetSphVsTriIntersectPoint = 0x800A7F14; // type:func -Math3D_TriVsSphIntersect = 0x800A8054; // type:func -Math3D_PointInCyl = 0x800A8474; // type:func -Math3D_CylVsLineSeg = 0x800A8530; // type:func -Math3D_CylTriVsIntersect = 0x800A8EF8; // type:func -Math3D_CylVsTri = 0x800A9378; // type:func -Math3D_SphVsSph = 0x800A9398; // type:func -Math3D_SphVsSphOverlap = 0x800A93B8; // type:func -Math3D_SphVsSphOverlapCenterDist = 0x800A93D8; // type:func -Math3D_SphVsCylOverlap = 0x800A94B0; // type:func -Math3D_SphVsCylOverlapCenterDist = 0x800A94D0; // type:func -Math3D_CylVsCylOverlap = 0x800A9640; // type:func -Math3D_CylVsCylOverlapCenterDist = 0x800A9660; // type:func -Math3D_TriVsTriIntersect = 0x800A9830; // type:func -Math3D_XZInSphere = 0x800A9BB0; // type:func -Math3D_XYInSphere = 0x800A9C24; // type:func -Math3D_YZInSphere = 0x800A9C98; // type:func -Math_GetAtan2Tbl = 0x800A9D10; // type:func -Math_Atan2S = 0x800A9D88; // type:func -Math_Atan2F = 0x800A9F00; // type:func -Matrix_Init = 0x800A9F40; // type:func -Matrix_Push = 0x800A9F7C; // type:func -Matrix_Pop = 0x800A9FB4; // type:func -Matrix_Get = 0x800A9FD0; // type:func -Matrix_Put = 0x800A9FF4; // type:func -Matrix_GetCurrent = 0x800AA01C; // type:func -Matrix_Mult = 0x800AA02C; // type:func -Matrix_Translate = 0x800AA084; // type:func -Matrix_Scale = 0x800AA18C; // type:func -Matrix_RotateX = 0x800AA270; // type:func -Matrix_RotateY = 0x800AA424; // type:func -Matrix_RotateZ = 0x800AA5DC; // type:func -Matrix_RotateZYX = 0x800AA790; // type:func -Matrix_TranslateRotateZYX = 0x800AAA4C; // type:func -Matrix_SetTranslateRotateYXZ = 0x800AADA0; // type:func -Matrix_MtxFToMtx = 0x800AAF4C; // type:func -Matrix_ToMtx = 0x800AB168; // type:func -Matrix_NewMtx = 0x800AB190; // type:func -Matrix_MtxFToNewMtx = 0x800AB1BC; // type:func -Matrix_MultVec3f = 0x800AB1E8; // type:func -Matrix_MtxFCopy = 0x800AB2A0; // type:func -Matrix_MtxToMtxF = 0x800AB3A8; // type:func -Matrix_MultVec3fExt = 0x800AB5FC; // type:func -Matrix_Transpose = 0x800AB6AC; // type:func -Matrix_ReplaceRotation = 0x800AB6E4; // type:func -Matrix_MtxFToYXZRotS = 0x800AB7E0; // type:func -Matrix_MtxFToZYXRotS = 0x800AB978; // type:func -Matrix_RotateAxis = 0x800ABB10; // type:func -Matrix_SetTranslateUniformScaleMtxF = 0x800ABF78; // type:func -Matrix_SetTranslateUniformScaleMtx = 0x800ABFE0; // type:func -Matrix_SetTranslateUniformScaleMtx2 = 0x800AC030; // type:func -Matrix_SetTranslateScaleMtx1 = 0x800AC120; // type:func -Matrix_SetTranslateScaleMtx2 = 0x800AC240; // type:func -SysUcode_GetUCodeBoot = 0x800AC340; // type:func -SysUcode_GetUCodeBootSize = 0x800AC350; // type:func -SysUcode_GetUCode = 0x800AC36C; // type:func -SysUcode_GetUCodeData = 0x800AC37C; // type:func -RumbleMgr_Update = 0x800AC390; // type:func -RumbleMgr_Init = 0x800AC6A0; // type:func -RumbleMgr_Destroy = 0x800AC6D8; // type:func -func_800D31A0 = 0x800AC6F0; // type:func -IrqMgr_AddClient = 0x800AC720; // type:func -IrqMgr_RemoveClient = 0x800AC7AC; // type:func -IrqMgr_SendMesgToClients = 0x800AC838; // type:func -IrqMgr_JamMesgToClients = 0x800AC89C; // type:func -IrqMgr_HandlePreNMI = 0x800AC900; // type:func -IrqMgr_CheckStacks = 0x800AC998; // type:func -IrqMgr_HandlePreNMI450 = 0x800AC9B8; // type:func -IrqMgr_HandlePreNMI480 = 0x800ACA34; // type:func -IrqMgr_HandlePreNMI500 = 0x800ACAC8; // type:func -IrqMgr_HandleRetrace = 0x800ACAEC; // type:func -IrqMgr_ThreadEntry = 0x800ACBA4; // type:func -IrqMgr_Init = 0x800ACC78; // type:func -Fault_SleepImpl = 0x800ACD40; // type:func -Fault_ClientProcessThread = 0x800ACDB0; // type:func -Fault_ClientRunTask = 0x800ACE24; // type:func -Fault_ProcessClient = 0x800ACFA8; // type:func -Fault_AddClient = 0x800ACFFC; // type:func -Fault_RemoveClient = 0x800AD0E0; // type:func -Fault_AddAddrConvClient = 0x800AD1D8; // type:func -Fault_RemoveAddrConvClient = 0x800AD2B0; // type:func -Fault_ConvertAddress = 0x800AD3A8; // type:func -Fault_Sleep = 0x800AD45C; // type:func -Fault_PadCallback = 0x800AD498; // type:func -Fault_UpdatePadImpl = 0x800AD4D4; // type:func -Fault_WaitForInputImpl = 0x800AD520; // type:func -Fault_WaitForInput = 0x800AD66C; // type:func -Fault_DrawRec = 0x800AD6B8; // type:func -Fault_FillScreenBlack = 0x800AD718; // type:func -Fault_FillScreenRed = 0x800AD76C; // type:func -Fault_DrawCornerRec = 0x800AD7C0; // type:func -Fault_PrintFReg = 0x800AD814; // type:func -Fault_LogFReg = 0x800AD8C0; // type:func -Fault_PrintFPCSR = 0x800AD970; // type:func -Fault_LogFPCSR = 0x800ADA14; // type:func -Fault_PrintThreadContext = 0x800ADAAC; // type:func -Fault_LogThreadContext = 0x800ADDC8; // type:func -Fault_FindFaultedThread = 0x800AE0C4; // type:func -Fault_Wait5Seconds = 0x800AE14C; // type:func -Fault_WaitForButtonCombo = 0x800AE1DC; // type:func -Fault_DrawMemDumpContents = 0x800AE4A8; // type:func -Fault_DrawMemDump = 0x800AE614; // type:func -Fault_WalkStack = 0x800AE818; // type:func -Fault_DrawStackTrace = 0x800AE9A8; // type:func -Fault_LogStackTrace = 0x800AEB28; // type:func -Fault_ResumeThread = 0x800AEC98; // type:func -Fault_DisplayFrameBuffer = 0x800AED14; // type:func -Fault_ProcessClients = 0x800AEDD4; // type:func -Fault_UpdatePad = 0x800AEEB4; // type:func -Fault_ThreadEntry = 0x800AEEF0; // type:func -Fault_SetFrameBuffer = 0x800AF250; // type:func -Fault_Init = 0x800AF2A4; // type:func -Fault_HungupFaultClient = 0x800AF3D8; // type:func -Fault_AddHungupAndCrashImpl = 0x800AF4D4; // type:func -Fault_AddHungupAndCrash = 0x800AF52C; // type:func -FaultDrawer_SetOsSyncPrintfEnabled = 0x800AF590; // type:func -FaultDrawer_DrawRecImpl = 0x800AF5A0; // type:func -FaultDrawer_DrawChar = 0x800AF6BC; // type:func -FaultDrawer_ColorToPrintColor = 0x800AF82C; // type:func -FaultDrawer_UpdatePrintColor = 0x800AF8DC; // type:func -FaultDrawer_SetForeColor = 0x800AF97C; // type:func -FaultDrawer_SetBackColor = 0x800AF9C4; // type:func -FaultDrawer_SetFontColor = 0x800AFA0C; // type:func -FaultDrawer_SetCharPad = 0x800AFA54; // type:func -FaultDrawer_SetCursor = 0x800AFA84; // type:func -FaultDrawer_FillScreen = 0x800AFB7C; // type:func -FaultDrawer_PrintCallback = 0x800AFC0C; // type:func -FaultDrawer_VPrintf = 0x800AFE18; // type:func -FaultDrawer_Printf = 0x800AFE68; // type:func -FaultDrawer_DrawText = 0x800AFEB8; // type:func -FaultDrawer_SetDrawerFB = 0x800AFF08; // type:func -FaultDrawer_SetInputCallback = 0x800AFF34; // type:func -FaultDrawer_WritebackFBDCache = 0x800AFF44; // type:func -FaultDrawer_Init = 0x800AFFA0; // type:func -Kanji_OffsetFromShiftJIS = 0x800B0010; // type:func -AudioSynth_InitNextRingBuf = 0x800B0B00; // type:func -func_800DB03C = 0x800B0E7C; // type:func -AudioSynth_Update = 0x800B0F04; // type:func -func_800DB2C0 = 0x800B1100; // type:func -AudioSynth_LoadRingBuffer1AtTemp = 0x800B1170; // type:func -AudioSynth_SaveRingBuffer1AtTemp = 0x800B1218; // type:func -AudioSynth_LeakReverb = 0x800B12C0; // type:func -func_800DB4E4 = 0x800B1324; // type:func -func_800DB680 = 0x800B14C0; // type:func -func_800DB828 = 0x800B1668; // type:func -AudioSynth_FilterReverb = 0x800B1880; // type:func -AudioSynth_MaybeMixRingBuffer1 = 0x800B1928; // type:func -func_800DBB94 = 0x800B19D4; // type:func -AudioSynth_ClearBuffer = 0x800B19DC; // type:func -func_800DBBBC = 0x800B19FC; // type:func -func_800DBBC4 = 0x800B1A04; // type:func -func_800DBBCC = 0x800B1A0C; // type:func -AudioSynth_Mix = 0x800B1A14; // type:func -func_800DBC08 = 0x800B1A48; // type:func -func_800DBC10 = 0x800B1A50; // type:func -func_800DBC18 = 0x800B1A58; // type:func -AudioSynth_SetBuffer = 0x800B1A60; // type:func -func_800DBC54 = 0x800B1A94; // type:func -func_800DBC5C = 0x800B1A9C; // type:func -AudioSynth_DMemMove = 0x800B1AA4; // type:func -func_800DBC90 = 0x800B1AD0; // type:func -func_800DBC98 = 0x800B1AD8; // type:func -func_800DBCA0 = 0x800B1AE0; // type:func -func_800DBCA8 = 0x800B1AE8; // type:func -AudioSynth_InterL = 0x800B1AF0; // type:func -AudioSynth_EnvSetup1 = 0x800B1B14; // type:func -func_800DBD08 = 0x800B1B48; // type:func -AudioSynth_LoadBuffer = 0x800B1B50; // type:func -AudioSynth_SaveBuffer = 0x800B1B78; // type:func -AudioSynth_EnvSetup2 = 0x800B1BA0; // type:func -func_800DBD7C = 0x800B1BBC; // type:func -func_800DBD84 = 0x800B1BC4; // type:func -func_800DBD8C = 0x800B1BCC; // type:func -AudioSynth_S8Dec = 0x800B1BD4; // type:func -AudioSynth_HiLoGain = 0x800B1BF0; // type:func -AudioSynth_UnkCmd19 = 0x800B1C24; // type:func -func_800DBE18 = 0x800B1C58; // type:func -func_800DBE20 = 0x800B1C60; // type:func -func_800DBE28 = 0x800B1C68; // type:func -func_800DBE30 = 0x800B1C70; // type:func -AudioSynth_UnkCmd3 = 0x800B1C78; // type:func -func_800DBE5C = 0x800B1C9C; // type:func -func_800DBE64 = 0x800B1CA4; // type:func -func_800DBE6C = 0x800B1CAC; // type:func -AudioSynth_LoadFilterBuffer = 0x800B1CB4; // type:func -AudioSynth_LoadFilterSize = 0x800B1CD8; // type:func -AudioSynth_LoadRingBuffer1 = 0x800B1CF0; // type:func -AudioSynth_LoadRingBuffer2 = 0x800B1D9C; // type:func -AudioSynth_LoadRingBufferPart = 0x800B1E48; // type:func -AudioSynth_SaveRingBufferPart = 0x800B1EB4; // type:func -AudioSynth_SaveBufferOffset = 0x800B1F20; // type:func -AudioSynth_MaybeLoadRingBuffer2 = 0x800B1F64; // type:func -AudioSynth_LoadReverbSamples = 0x800B1FA4; // type:func -AudioSynth_SaveReverbSamples = 0x800B2018; // type:func -AudioSynth_SaveRingBuffer2 = 0x800B211C; // type:func -AudioSynth_DoOneAudioUpdate = 0x800B21C4; // type:func -AudioSynth_ProcessNote = 0x800B2750; // type:func -AudioSynth_FinalResample = 0x800B346C; // type:func -AudioSynth_ProcessEnvelope = 0x800B350C; // type:func -AudioSynth_LoadWaveSamples = 0x800B3834; // type:func -AudioSynth_ApplyHaasEffect = 0x800B39A4; // type:func -AudioHeap_CalculateAdsrDecay = 0x800B3C60; // type:func -AudioHeap_InitAdsrDecayTable = 0x800B3C7C; // type:func -AudioHeap_ResetLoadStatus = 0x800B3DC0; // type:func -AudioHeap_DiscardFont = 0x800B3E88; // type:func -AudioHeap_ReleaseNotesForFont = 0x800B3F6C; // type:func -AudioHeap_DiscardSequence = 0x800B3FF4; // type:func -AudioHeap_WritebackDCache = 0x800B4078; // type:func -AudioHeap_AllocZeroedAttemptExternal = 0x800B4098; // type:func -AudioHeap_AllocAttemptExternal = 0x800B40F0; // type:func -AudioHeap_AllocDmaMemory = 0x800B4148; // type:func -AudioHeap_AllocDmaMemoryZeroed = 0x800B4184; // type:func -AudioHeap_AllocZeroed = 0x800B41C0; // type:func -AudioHeap_Alloc = 0x800B421C; // type:func -AudioHeap_InitPool = 0x800B4274; // type:func -AudioHeap_InitPersistentCache = 0x800B429C; // type:func -AudioHeap_InitTemporaryCache = 0x800B42B0; // type:func -AudioHeap_ResetPool = 0x800B42E0; // type:func -AudioHeap_PopPersistentCache = 0x800B42F0; // type:func -AudioHeap_InitMainPools = 0x800B4430; // type:func -AudioHeap_InitSessionPools = 0x800B4490; // type:func -AudioHeap_InitCachePools = 0x800B4514; // type:func -AudioHeap_InitPersistentPoolsAndCaches = 0x800B4598; // type:func -AudioHeap_InitTemporaryPoolsAndCaches = 0x800B465C; // type:func -AudioHeap_AllocCached = 0x800B4720; // type:func -AudioHeap_SearchCaches = 0x800B4EB4; // type:func -AudioHeap_SearchRegularCaches = 0x800B4F0C; // type:func -func_800DF1D8 = 0x800B5018; // type:func -AudioHeap_ClearFilter = 0x800B53EC; // type:func -AudioHeap_LoadLowPassFilter = 0x800B541C; // type:func -AudioHeap_LoadHighPassFilter = 0x800B5470; // type:func -AudioHeap_LoadFilter = 0x800B54C8; // type:func -AudioHeap_UpdateReverb = 0x800B55FC; // type:func -AudioHeap_UpdateReverbs = 0x800B5604; // type:func -AudioHeap_ClearCurrentAiBuffer = 0x800B56C8; // type:func -AudioHeap_ResetStep = 0x800B5734; // type:func -AudioHeap_Init = 0x800B5A38; // type:func -AudioHeap_SearchPermanentCache = 0x800B6328; // type:func -AudioHeap_AllocPermanent = 0x800B6380; // type:func -AudioHeap_AllocSampleCache = 0x800B6404; // type:func -AudioHeap_InitSampleCaches = 0x800B6474; // type:func -AudioHeap_AllocTemporarySampleCacheEntry = 0x800B650C; // type:func -AudioHeap_UnapplySampleCacheForFont = 0x800B67A4; // type:func -AudioHeap_DiscardSampleCacheEntry = 0x800B6918; // type:func -AudioHeap_UnapplySampleCache = 0x800B69F4; // type:func -AudioHeap_AllocPersistentSampleCacheEntry = 0x800B6A38; // type:func -AudioHeap_DiscardSampleCacheForFont = 0x800B6AC0; // type:func -AudioHeap_DiscardSampleCaches = 0x800B6AFC; // type:func -AudioHeap_ChangeStorage = 0x800B6C4C; // type:func -AudioHeap_DiscardSampleBank = 0x800B6CAC; // type:func -AudioHeap_ApplySampleBankCache = 0x800B6CD0; // type:func -AudioHeap_ApplySampleBankCacheInternal = 0x800B6CF4; // type:func -AudioHeap_DiscardSampleBanks = 0x800B6F88; // type:func -AudioLoad_DecreaseSampleDmaTtls = 0x800B7030; // type:func -AudioLoad_DmaSampleData = 0x800B711C; // type:func -AudioLoad_InitSampleDmaBuffers = 0x800B7458; // type:func -AudioLoad_IsFontLoadComplete = 0x800B76F0; // type:func -AudioLoad_IsSeqLoadComplete = 0x800B7768; // type:func -AudioLoad_IsSampleLoadComplete = 0x800B77E0; // type:func -AudioLoad_SetFontLoadStatus = 0x800B7858; // type:func -AudioLoad_SetSeqLoadStatus = 0x800B7888; // type:func -AudioLoad_SetSampleFontLoadStatusAndApplyCaches = 0x800B78B8; // type:func -AudioLoad_SetSampleFontLoadStatus = 0x800B7918; // type:func -AudioLoad_InitTable = 0x800B7948; // type:func -AudioLoad_SyncLoadSeqFonts = 0x800B79A8; // type:func -AudioLoad_SyncLoadSeqParts = 0x800B7A58; // type:func -AudioLoad_SyncLoadSample = 0x800B7AB8; // type:func -AudioLoad_SyncLoadInstrument = 0x800B7BA4; // type:func -AudioLoad_AsyncLoad = 0x800B7C74; // type:func -AudioLoad_AsyncLoadSeq = 0x800B7CAC; // type:func -AudioLoad_AsyncLoadSampleBank = 0x800B7CF0; // type:func -AudioLoad_AsyncLoadFont = 0x800B7D34; // type:func -AudioLoad_GetFontsForSequence = 0x800B7D78; // type:func -AudioLoad_DiscardSeqFonts = 0x800B7DBC; // type:func -AudioLoad_DiscardFont = 0x800B7E6C; // type:func -AudioLoad_SyncInitSeqPlayer = 0x800B7F14; // type:func -AudioLoad_SyncInitSeqPlayerSkipTicks = 0x800B7F64; // type:func -AudioLoad_SyncInitSeqPlayerInternal = 0x800B7FBC; // type:func -AudioLoad_SyncLoadSeq = 0x800B8104; // type:func -AudioLoad_GetSampleBank = 0x800B8158; // type:func -AudioLoad_TrySyncLoadSampleBank = 0x800B8178; // type:func -AudioLoad_SyncLoadFont = 0x800B8294; // type:func -AudioLoad_SyncLoad = 0x800B8398; // type:func -AudioLoad_GetRealTableIndex = 0x800B85A8; // type:func -AudioLoad_SearchCaches = 0x800B85E4; // type:func -AudioLoad_GetLoadTable = 0x800B8638; // type:func -AudioLoad_RelocateFont = 0x800B867C; // type:func -AudioLoad_SyncDma = 0x800B88E8; // type:func -AudioLoad_SyncDmaUnkMedium = 0x800B8A0C; // type:func -AudioLoad_Dma = 0x800B8A20; // type:func -AudioLoad_Unused1 = 0x800B8AF8; // type:func -AudioLoad_SyncLoadSimple = 0x800B8B00; // type:func -AudioLoad_AsyncLoadInner = 0x800B8B20; // type:func -AudioLoad_ProcessLoads = 0x800B8E2C; // type:func -AudioLoad_SetDmaHandler = 0x800B8E5C; // type:func -AudioLoad_SetUnusedHandler = 0x800B8E68; // type:func -AudioLoad_InitSoundFont = 0x800B8E74; // type:func -AudioLoad_Init = 0x800B8ED4; // type:func -AudioLoad_InitSlowLoads = 0x800B9240; // type:func -AudioLoad_SlowLoadSample = 0x800B9254; // type:func -AudioLoad_GetFontSample = 0x800B9420; // type:func -AudioLoad_Unused2 = 0x800B94B0; // type:func -AudioLoad_FinishSlowLoad = 0x800B94B8; // type:func -AudioLoad_ProcessSlowLoads = 0x800B952C; // type:func -AudioLoad_DmaSlowCopy = 0x800B96B4; // type:func -AudioLoad_DmaSlowCopyUnkMedium = 0x800B9738; // type:func -AudioLoad_SlowLoadSeq = 0x800B974C; // type:func -AudioLoad_InitAsyncLoads = 0x800B9854; // type:func -AudioLoad_StartAsyncLoadUnkMedium = 0x800B9884; // type:func -AudioLoad_StartAsyncLoad = 0x800B9908; // type:func -AudioLoad_ProcessAsyncLoads = 0x800B9A2C; // type:func -AudioLoad_ProcessAsyncLoadUnkMedium = 0x800B9B50; // type:func -AudioLoad_FinishAsyncLoad = 0x800B9B5C; // type:func -AudioLoad_ProcessAsyncLoad = 0x800B9C98; // type:func -AudioLoad_AsyncDma = 0x800B9DF4; // type:func -AudioLoad_AsyncDmaUnkMedium = 0x800B9E84; // type:func -AudioLoad_RelocateSample = 0x800B9E98; // type:func -AudioLoad_RelocateFontAndPreloadSamples = 0x800B9FD8; // type:func -AudioLoad_ProcessSamplePreloads = 0x800BA3D0; // type:func -AudioLoad_AddToSampleSet = 0x800BA584; // type:func -AudioLoad_GetSamplesForFont = 0x800BA5CC; // type:func -AudioLoad_AddUsedSample = 0x800BA700; // type:func -AudioLoad_PreloadSamplesForFont = 0x800BA758; // type:func -AudioLoad_LoadPermanentSamples = 0x800BABD4; // type:func -AudioLoad_Unused3 = 0x800BAD14; // type:func -AudioLoad_Unused4 = 0x800BAD1C; // type:func -AudioLoad_Unused5 = 0x800BAD24; // type:func -AudioLoad_ScriptLoad = 0x800BAD2C; // type:func -AudioLoad_ProcessScriptLoads = 0x800BAD98; // type:func -AudioLoad_InitScriptLoads = 0x800BADF0; // type:func -AudioThread_Update = 0x800BAE20; // type:func -AudioThread_UpdateImpl = 0x800BAE40; // type:func -AudioThread_ProcessGlobalCmd = 0x800BB3C4; // type:func -AudioThread_SetFadeOutTimer = 0x800BB798; // type:func -AudioThread_SetFadeInTimer = 0x800BB7EC; // type:func -AudioThread_InitMesgQueuesImpl = 0x800BB834; // type:func -AudioThread_QueueCmd = 0x800BB8CC; // type:func -AudioThread_QueueCmdF32 = 0x800BB918; // type:func -AudioThread_QueueCmdS32 = 0x800BB93C; // type:func -AudioThread_QueueCmdS8 = 0x800BB960; // type:func -AudioThread_QueueCmdU16 = 0x800BB990; // type:func -AudioThread_ScheduleProcessCmds = 0x800BB9C0; // type:func -AudioThread_ResetCmdQueue = 0x800BBA50; // type:func -AudioThread_ProcessCmd = 0x800BBA68; // type:func -AudioThread_ProcessCmds = 0x800BBBAC; // type:func -func_800E5E20 = 0x800BBC60; // type:func -AudioThread_GetFontsForSequence = 0x800BBCC4; // type:func -Audio_GetSampleBankIdsOfFont = 0x800BBCE4; // type:func -func_800E5EDC = 0x800BBD1C; // type:func -func_800E5F34 = 0x800BBD74; // type:func -AudioThread_ResetAudioHeap = 0x800BBDC8; // type:func -AudioThread_PreNMIInternal = 0x800BBE64; // type:func -AudioThread_GetChannelIO = 0x800BBEB0; // type:func -AudioThread_GetSeqPlayerIO = 0x800BBF04; // type:func -AudioThread_InitExternalPool = 0x800BBF2C; // type:func -AudioThread_ResetExternalPool = 0x800BBF5C; // type:func -AudioThread_ProcessSeqPlayerCmd = 0x800BBF68; // type:func -AudioThread_ProcessChannelCmd = 0x800BC140; // type:func -AudioThread_Noop1Cmd = 0x800BC2F0; // type:func -AudioThread_Noop1CmdZeroed = 0x800BC338; // type:func -AudioThread_Noop2Cmd = 0x800BC35C; // type:func -AudioThread_WaitForAudioTask = 0x800BC390; // type:func -func_800E6590 = 0x800BC3D0; // type:func -func_800E6680 = 0x800BC4C0; // type:func -func_800E66A0 = 0x800BC4E0; // type:func -func_800E66C0 = 0x800BC500; // type:func -AudioThread_NextRandom = 0x800BC600; // type:func -AudioThread_InitMesgQueues = 0x800BC658; // type:func -Audio_InvalDCache = 0x800BC680; // type:func -Audio_WritebackDCache = 0x800BC6C0; // type:func -osAiSetNextBuffer = 0x800BC700; // type:func -Audio_InitNoteSub = 0x800BC780; // type:func -Audio_NoteSetResamplingRate = 0x800BCBF8; // type:func -Audio_NoteInit = 0x800BCCA8; // type:func -Audio_NoteDisable = 0x800BCD68; // type:func -Audio_ProcessNotes = 0x800BCDCC; // type:func -Audio_GetInstrumentTunedSample = 0x800BD29C; // type:func -Audio_GetInstrumentInner = 0x800BD2D8; // type:func -Audio_GetDrum = 0x800BD3AC; // type:func -Audio_GetSoundEffect = 0x800BD490; // type:func -Audio_SetFontInstrument = 0x800BD584; // type:func -Audio_SeqLayerDecayRelease = 0x800BD6C8; // type:func -Audio_SeqLayerNoteDecay = 0x800BD9A0; // type:func -Audio_SeqLayerNoteRelease = 0x800BD9C0; // type:func -Audio_BuildSyntheticWave = 0x800BD9E0; // type:func -Audio_InitSyntheticWave = 0x800BDAE4; // type:func -Audio_InitNoteList = 0x800BDB3C; // type:func -Audio_InitNoteLists = 0x800BDB4C; // type:func -Audio_InitNoteFreeList = 0x800BDB9C; // type:func -Audio_NotePoolClear = 0x800BDC40; // type:func -Audio_NotePoolFill = 0x800BDDA0; // type:func -Audio_AudioListPushFront = 0x800BDEDC; // type:func -Audio_AudioListRemove = 0x800BDF1C; // type:func -Audio_FindNodeWithPrioLessThan = 0x800BDF48; // type:func -Audio_NoteInitForLayer = 0x800BDFC8; // type:func -func_800E82C0 = 0x800BE100; // type:func -Audio_NoteReleaseAndTakeOwnership = 0x800BE134; // type:func -Audio_AllocNoteFromDisabled = 0x800BE160; // type:func -Audio_AllocNoteFromDecaying = 0x800BE1AC; // type:func -Audio_AllocNoteFromActive = 0x800BE1FC; // type:func -Audio_AllocNote = 0x800BE2F4; // type:func -Audio_NoteInitAll = 0x800BE5C8; // type:func -Audio_SequenceChannelProcessSound = 0x800BE700; // type:func -Audio_SequencePlayerProcessSound = 0x800BE8C8; // type:func -Audio_GetPortamentoFreqScale = 0x800BEA14; // type:func -Audio_GetVibratoPitchChange = 0x800BEA70; // type:func -Audio_GetVibratoFreqScale = 0x800BEAA8; // type:func -Audio_NoteVibratoUpdate = 0x800BECE4; // type:func -Audio_NoteVibratoInit = 0x800BED40; // type:func -Audio_NotePortamentoInit = 0x800BEDF8; // type:func -Audio_AdsrInit = 0x800BEE24; // type:func -Audio_AdsrUpdate = 0x800BEE44; // type:func -AudioSeq_GetScriptControlFlowArgument = 0x800BF180; // type:func -AudioSeq_HandleScriptFlowControl = 0x800BF1E8; // type:func -AudioSeq_InitSequenceChannel = 0x800BF3C4; // type:func -AudioSeq_SeqChannelSetLayer = 0x800BF518; // type:func -AudioSeq_SeqLayerDisable = 0x800BF63C; // type:func -AudioSeq_SeqLayerFree = 0x800BF6B8; // type:func -AudioSeq_SequenceChannelDisable = 0x800BF708; // type:func -AudioSeq_SequencePlayerSetupChannels = 0x800BF774; // type:func -AudioSeq_SequencePlayerDisableChannels = 0x800BF86C; // type:func -AudioSeq_SequenceChannelEnable = 0x800BF8EC; // type:func -AudioSeq_SequencePlayerDisableAsFinished = 0x800BF984; // type:func -AudioSeq_SequencePlayerDisable = 0x800BF9AC; // type:func -AudioSeq_AudioListPushBack = 0x800BFA68; // type:func -AudioSeq_AudioListPopBack = 0x800BFAA8; // type:func -AudioSeq_InitLayerFreelist = 0x800BFAE8; // type:func -AudioSeq_ScriptReadU8 = 0x800BFB88; // type:func -AudioSeq_ScriptReadS16 = 0x800BFB9C; // type:func -AudioSeq_ScriptReadCompressedU16 = 0x800BFBD4; // type:func -AudioSeq_SeqLayerProcessScript = 0x800BFC14; // type:func -AudioSeq_SeqLayerProcessScriptStep1 = 0x800BFD18; // type:func -AudioSeq_SeqLayerProcessScriptStep5 = 0x800BFDA4; // type:func -AudioSeq_SeqLayerProcessScriptStep2 = 0x800BFF00; // type:func -AudioSeq_SeqLayerProcessScriptStep4 = 0x800C0280; // type:func -AudioSeq_SeqLayerProcessScriptStep3 = 0x800C0920; // type:func -AudioSeq_SetChannelPriorities = 0x800C0D34; // type:func -AudioSeq_GetInstrument = 0x800C0D64; // type:func -AudioSeq_SetInstrument = 0x800C0DD8; // type:func -AudioSeq_SequenceChannelSetVolume = 0x800C0E84; // type:func -AudioSeq_SequenceChannelProcessScript = 0x800C0EA8; // type:func -AudioSeq_SequencePlayerProcessSequence = 0x800C1B98; // type:func -AudioSeq_ProcessSequences = 0x800C23A4; // type:func -AudioSeq_SkipForwardSequence = 0x800C2458; // type:func -AudioSeq_ResetSequencePlayer = 0x800C24A8; // type:func -AudioSeq_InitSequencePlayerChannels = 0x800C2574; // type:func -AudioSeq_InitSequencePlayer = 0x800C264C; // type:func -AudioSeq_InitSequencePlayers = 0x800C271C; // type:func -AudioOcarina_SetCustomButtonMapping = 0x800C27A0; // type:func -AudioOcarina_ReadControllerInput = 0x800C2840; // type:func -AudioOcarina_BendPitchTwoSemitones = 0x800C28A0; // type:func -AudioOcarina_GetPlayingState = 0x800C2930; // type:func -AudioOcarina_MapNoteToButton = 0x800C2974; // type:func -AudioOcarina_MapNotesToScarecrowButtons = 0x800C29BC; // type:func -AudioOcarina_Start = 0x800C2A44; // type:func -AudioOcarina_CheckIfStartedSong = 0x800C2BFC; // type:func -AudioOcarina_CheckSongsWithMusicStaff = 0x800C2C38; // type:func -AudioOcarina_CheckSongsWithoutMusicStaff = 0x800C3040; // type:func -AudioOcarina_PlayControllerInput = 0x800C3298; // type:func -AudioOcarina_EnableInput = 0x800C3688; // type:func -AudioOcarina_SetInstrument = 0x800C3698; // type:func -AudioOcarina_SetPlaybackSong = 0x800C377C; // type:func -AudioOcarina_PlaybackSong = 0x800C387C; // type:func -AudioOcarina_SetRecordingSong = 0x800C3BA8; // type:func -AudioOcarina_SetRecordingState = 0x800C3FB0; // type:func -AudioOcarina_UpdateRecordingStaff = 0x800C40DC; // type:func -AudioOcarina_UpdatePlayingStaff = 0x800C4114; // type:func -AudioOcarina_UpdatePlaybackStaff = 0x800C4158; // type:func -AudioOcarina_GetRecordingStaff = 0x800C4208; // type:func -AudioOcarina_GetPlayingStaff = 0x800C4214; // type:func -AudioOcarina_GetPlaybackStaff = 0x800C4238; // type:func -AudioOcarina_RecordSong = 0x800C4244; // type:func -AudioOcarina_MemoryGameInit = 0x800C43BC; // type:func -AudioOcarina_MemoryGameNextNote = 0x800C442C; // type:func -AudioOcarina_Update = 0x800C4534; // type:func -AudioOcarina_PlayLongScarecrowSong = 0x800C4664; // type:func -AudioOcarina_ResetStaffs = 0x800C4770; // type:func -AudioDebug_Draw = 0x800C47BC; // type:func -AudioDebug_ScrPrt = 0x800C47C4; // type:func -Audio_Update = 0x800C47D0; // type:func -func_800F3138 = 0x800C4874; // type:func -func_800F3140 = 0x800C487C; // type:func -func_800F314C = 0x800C4888; // type:func -Audio_ComputeSfxVolume = 0x800C48C4; // type:func -Audio_ComputeSfxReverb = 0x800C4A2C; // type:func -Audio_ComputeSfxPanSigned = 0x800C4BA4; // type:func -Audio_ComputeSfxFreqScale = 0x800C4D28; // type:func -func_800F37B8 = 0x800C4EF4; // type:func -func_800F3990 = 0x800C50CC; // type:func -Audio_SetSfxProperties = 0x800C5144; // type:func -Audio_ResetSfxChannelState = 0x800C561C; // type:func -Audio_PlayCutsceneEffectsSequence = 0x800C5684; // type:func -func_800F3F84 = 0x800C56CC; // type:func -func_800F4010 = 0x800C5758; // type:func -func_800F4138 = 0x800C5878; // type:func -func_800F4190 = 0x800C58D0; // type:func -Audio_PlaySfxRandom = 0x800C5920; // type:func -func_800F4254 = 0x800C5994; // type:func -func_800F436C = 0x800C5AAC; // type:func -func_800F4414 = 0x800C5B54; // type:func -func_800F44EC = 0x800C5C2C; // type:func -func_800F4524 = 0x800C5C64; // type:func -func_800F4578 = 0x800C5CB8; // type:func -func_800F45D0 = 0x800C5D10; // type:func -Audio_PlaySfxRiver = 0x800C5D74; // type:func -Audio_PlaySfxWaterfall = 0x800C5E20; // type:func -Audio_StepFreqLerp = 0x800C5EC4; // type:func -Audio_SetBgmVolumeOffDuringFanfare = 0x800C5EFC; // type:func -Audio_SetBgmVolumeOnDuringFanfare = 0x800C5F3C; // type:func -Audio_SetMainBgmVolume = 0x800C5F7C; // type:func -Audio_SetGanonsTowerBgmVolumeLevel = 0x800C5FB0; // type:func -Audio_SetGanonsTowerBgmVolume = 0x800C605C; // type:func -Audio_LowerMainBgmVolume = 0x800C6194; // type:func -Audio_UpdateRiverSoundVolumes = 0x800C61B0; // type:func -Audio_PlaySfxIncreasinglyTransposed = 0x800C6298; // type:func -Audio_ResetIncreasingTranspose = 0x800C6328; // type:func -Audio_PlaySfxTransposed = 0x800C6334; // type:func -func_800F4C58 = 0x800C6398; // type:func -func_800F4E30 = 0x800C6570; // type:func -Audio_ClearSariaBgm = 0x800C680C; // type:func -Audio_ClearSariaBgmAtPos = 0x800C682C; // type:func -Audio_SplitBgmChannels = 0x800C684C; // type:func -Audio_PlaySariaBgm = 0x800C69E0; // type:func -Audio_ClearSariaBgm2 = 0x800C6C44; // type:func -Audio_PlayMorningSceneSequence = 0x800C6C50; // type:func -Audio_PlaySceneSequence = 0x800C6C90; // type:func -Audio_UpdateSceneSequenceResumePoint = 0x800C6DE8; // type:func -Audio_PlayWindmillBgm = 0x800C6E58; // type:func -Audio_SetMainBgmTempoFreqAfterFanfare = 0x800C6E8C; // type:func -Audio_SetFastTempoForTimedMinigame = 0x800C7058; // type:func -Audio_PlaySequenceInCutscene = 0x800C709C; // type:func -Audio_StopSequenceInCutscene = 0x800C7128; // type:func -Audio_IsSequencePlaying = 0x800C7198; // type:func -func_800F5ACC = 0x800C720C; // type:func -func_800F5B58 = 0x800C7280; // type:func -func_800F5BF0 = 0x800C7318; // type:func -func_800F5C2C = 0x800C7354; // type:func -Audio_PlayFanfare = 0x800C738C; // type:func -Audio_UpdateFanfare = 0x800C7420; // type:func -Audio_PlaySequenceWithSeqPlayerIO = 0x800C7540; // type:func -Audio_SetSequenceMode = 0x800C75B8; // type:func -Audio_SetBgmEnemyVolume = 0x800C7834; // type:func -Audio_UpdateMalonSinging = 0x800C7988; // type:func -func_800F64E0 = 0x800C7BEC; // type:func -Audio_ToggleMalonSinging = 0x800C7C90; // type:func -Audio_SetEnvReverb = 0x800C7DCC; // type:func -Audio_SetCodeReverb = 0x800C7DE8; // type:func -func_800F6700 = 0x800C7E0C; // type:func -Audio_SetBaseFilter = 0x800C7EAC; // type:func -Audio_SetExtraFilter = 0x800C7F34; // type:func -Audio_SetCutsceneFlag = 0x800C7FC8; // type:func -Audio_PlaySfxGeneralIfNotInCutscene = 0x800C7FE0; // type:func -Audio_PlaySfxIfNotInCutscene = 0x800C8028; // type:func -func_800F6964 = 0x800C8070; // type:func -Audio_StopBgmAndFanfare = 0x800C81BC; // type:func -func_800F6B3C = 0x800C8248; // type:func -Audio_DisableAllSeq = 0x800C8274; // type:func -func_800F6BB8 = 0x800C82C4; // type:func -func_800F6BDC = 0x800C82E8; // type:func -Audio_PreNMI = 0x800C8320; // type:func -func_800F6C34 = 0x800C8340; // type:func -Audio_SetNatureAmbienceChannelIO = 0x800C8464; // type:func -Audio_StartNatureAmbienceSequence = 0x800C8578; // type:func -Audio_PlayNatureAmbienceSequence = 0x800C867C; // type:func -Audio_Init = 0x800C87C0; // type:func -Audio_InitSound = 0x800C87E4; // type:func -func_800F7170 = 0x800C8838; // type:func -func_800F71BC = 0x800C8884; // type:func -func_800F7208 = 0x800C88D0; // type:func -Audio_SetSfxBanksMute = 0x800C8930; // type:func -Audio_QueueSeqCmdMute = 0x800C8988; // type:func -Audio_ClearBGMMute = 0x800C89EC; // type:func -Audio_PlaySfxGeneral = 0x800C8A5C; // type:func -Audio_RemoveMatchingSfxRequests = 0x800C8ADC; // type:func -Audio_ProcessSfxRequest = 0x800C8C7C; // type:func -Audio_RemoveSfxBankEntry = 0x800C9118; // type:func -Audio_ChooseActiveSfx = 0x800C92B0; // type:func -Audio_PlayActiveSfx = 0x800C99F0; // type:func -Audio_StopSfxByBank = 0x800C9D10; // type:func -func_800F8884 = 0x800C9DF4; // type:func -Audio_StopSfxByPosAndBank = 0x800C9F10; // type:func -Audio_StopSfxByPos = 0x800C9F58; // type:func -Audio_StopSfxByPosAndId = 0x800C9FB4; // type:func -Audio_StopSfxByTokenAndId = 0x800CA110; // type:func -Audio_StopSfxById = 0x800CA274; // type:func -Audio_ProcessSfxRequests = 0x800CA3AC; // type:func -Audio_SetUnusedBankLerp = 0x800CA410; // type:func -Audio_StepUnusedBankLerp = 0x800CA4A4; // type:func -func_800F8F88 = 0x800CA4F8; // type:func -Audio_IsSfxPlaying = 0x800CA564; // type:func -Audio_ResetSfx = 0x800CA5CC; // type:func -Audio_StartSequence = 0x800CA790; // type:func -Audio_StopSequence = 0x800CA914; // type:func -Audio_ProcessSeqCmd = 0x800CA99C; // type:func -Audio_QueueSeqCmd = 0x800CB460; // type:func -Audio_ProcessSeqCmds = 0x800CB488; // type:func -Audio_GetActiveSeqId = 0x800CB508; // type:func -Audio_IsSeqCmdNotQueued = 0x800CB570; // type:func -Audio_ResetSequenceRequests = 0x800CB5C8; // type:func -Audio_ReplaceSeqCmdSetupOpVolRestore = 0x800CB5E0; // type:func -Audio_SetVolumeScale = 0x800CB694; // type:func -Audio_UpdateActiveSequences = 0x800CB830; // type:func -func_800FAD34 = 0x800CC188; // type:func -Audio_ResetActiveSequences = 0x800CC24C; // type:func -Audio_ResetActiveSequencesAndVolume = 0x800CC308; // type:func -GfxPrint_Setup = 0x800CC3B0; // type:func -GfxPrint_SetColor = 0x800CC7FC; // type:func -GfxPrint_SetPosPx = 0x800CC848; // type:func -GfxPrint_SetPos = 0x800CC86C; // type:func -GfxPrint_SetBasePosPx = 0x800CC894; // type:func -GfxPrint_PrintCharImpl = 0x800CC8A8; // type:func -GfxPrint_PrintChar = 0x800CCD3C; // type:func -GfxPrint_PrintStringWithSize = 0x800CCEFC; // type:func -GfxPrint_PrintString = 0x800CCF58; // type:func -GfxPrint_Callback = 0x800CCFB0; // type:func -GfxPrint_Init = 0x800CCFDC; // type:func -GfxPrint_Destroy = 0x800CD064; // type:func -GfxPrint_Open = 0x800CD06C; // type:func -GfxPrint_Close = 0x800CD0A0; // type:func -GfxPrint_VPrintf = 0x800CD0D0; // type:func -GfxPrint_Printf = 0x800CD0F0; // type:func -RcpUtils_PrintRegisterStatus = 0x800CD120; // type:func -RcpUtils_Reset = 0x800CD148; // type:func -Overlay_AllocateAndLoad = 0x800CD180; // type:func -Overlay_Relocate = 0x800CD1E0; // type:func -Overlay_Load = 0x800CD420; // type:func -func_800FC800 = 0x800CD4F0; // type:func -func_800FC83C = 0x800CD520; // type:func -func_800FC868 = 0x800CD54C; // type:func -func_800FC8D8 = 0x800CD5BC; // type:func -func_800FC948 = 0x800CD62C; // type:func -func_800FCA18 = 0x800CD6FC; // type:func -func_800FCB34 = 0x800CD798; // type:func -SystemHeap_Init = 0x800CD808; // type:func -PadUtils_Init = 0x800CD830; // type:func -func_800FCB70 = 0x800CD850; // type:func -PadUtils_ResetPressRel = 0x800CD858; // type:func -PadUtils_CheckCurExact = 0x800CD864; // type:func -PadUtils_CheckCur = 0x800CD87C; // type:func -PadUtils_CheckPressed = 0x800CD898; // type:func -PadUtils_CheckReleased = 0x800CD8B4; // type:func -PadUtils_GetCurButton = 0x800CD8D0; // type:func -PadUtils_GetPressButton = 0x800CD8D8; // type:func -PadUtils_GetCurX = 0x800CD8E0; // type:func -PadUtils_GetCurY = 0x800CD8E8; // type:func -PadUtils_SetRelXY = 0x800CD8F0; // type:func -PadUtils_GetRelXImpl = 0x800CD8FC; // type:func -PadUtils_GetRelYImpl = 0x800CD904; // type:func -PadUtils_GetRelX = 0x800CD90C; // type:func -PadUtils_GetRelY = 0x800CD92C; // type:func -PadUtils_UpdateRelXY = 0x800CD94C; // type:func -PadSetup_Init = 0x800CDA20; // type:func -Math_FTanF = 0x800CDB60; // type:func -Math_FFloorF = 0x800CDB94; // type:func -Math_FCeilF = 0x800CDBB4; // type:func -Math_FRoundF = 0x800CDBD4; // type:func -Math_FTruncF = 0x800CDBF4; // type:func -Math_FNearbyIntF = 0x800CDC14; // type:func -Math_FAtanTaylorQF = 0x800CDC34; // type:func -Math_FAtanTaylorF = 0x800CDC80; // type:func -Math_FAtanContFracF = 0x800CDDA4; // type:func -Math_FAtanF = 0x800CDEF0; // type:func -Math_FAtan2F = 0x800CDF30; // type:func -Math_FAsinF = 0x800CE018; // type:func -Math_FAcosF = 0x800CE048; // type:func -floorf = 0x800CE070; // type:func -floor = 0x800CE07C; // type:func -lfloorf = 0x800CE088; // type:func -lfloor = 0x800CE098; // type:func -ceilf = 0x800CE0A8; // type:func -ceil = 0x800CE0B4; // type:func -lceilf = 0x800CE0C0; // type:func -lceil = 0x800CE0D0; // type:func -truncf = 0x800CE0E0; // type:func -trunc = 0x800CE0EC; // type:func -ltruncf = 0x800CE0F8; // type:func -ltrunc = 0x800CE108; // type:func -nearbyintf = 0x800CE118; // type:func -nearbyint = 0x800CE124; // type:func -lnearbyintf = 0x800CE130; // type:func -lnearbyint = 0x800CE140; // type:func -roundf = 0x800CE150; // type:func -round = 0x800CE16C; // type:func -lroundf = 0x800CE18C; // type:func -lround = 0x800CE1AC; // type:func -SystemArena_Malloc = 0x800CE1D0; // type:func -SystemArena_MallocR = 0x800CE1F8; // type:func -SystemArena_Realloc = 0x800CE220; // type:func -SystemArena_Free = 0x800CE250; // type:func -SystemArena_Calloc = 0x800CE278; // type:func -SystemArena_GetSizes = 0x800CE2CC; // type:func -SystemArena_Check = 0x800CE304; // type:func -SystemArena_Init = 0x800CE328; // type:func -SystemArena_Cleanup = 0x800CE358; // type:func -SystemArena_IsInitialized = 0x800CE37C; // type:func -Rand_Next = 0x800CE3A0; // type:func -Rand_Seed = 0x800CE3D0; // type:func -Rand_ZeroOne = 0x800CE3DC; // type:func -Rand_Centered = 0x800CE430; // type:func -Rand_Seed_Variable = 0x800CE488; // type:func -Rand_Next_Variable = 0x800CE490; // type:func -Rand_ZeroOne_Variable = 0x800CE4B8; // type:func -Rand_Centered_Variable = 0x800CE504; // type:func -ArenaImpl_LockInit = 0x800CE560; // type:func -ArenaImpl_Lock = 0x800CE58C; // type:func -ArenaImpl_Unlock = 0x800CE5B4; // type:func -ArenaImpl_GetLastBlock = 0x800CE5DC; // type:func -__osMallocInit = 0x800CE640; // type:func -__osMallocAddBlock = 0x800CE690; // type:func -__osMallocCleanup = 0x800CE730; // type:func -__osMallocIsInitialized = 0x800CE750; // type:func -__osMalloc_NoLock = 0x800CE758; // type:func -__osMalloc = 0x800CE884; // type:func -__osMallocR = 0x800CE8C4; // type:func -__osFree_NoLock = 0x800CEA38; // type:func -__osFree = 0x800CEB78; // type:func -__osRealloc = 0x800CEBB0; // type:func -ArenaImpl_GetSizes = 0x800CEFA8; // type:func -ArenaImpl_FaultClient = 0x800CF07C; // type:func -__osCheckArena = 0x800CF250; // type:func -proutSprintf = 0x800CF310; // type:func -vsprintf = 0x800CF334; // type:func -sprintf = 0x800CF384; // type:func -PrintUtils_VPrintf = 0x800CF3E0; // type:func -PrintUtils_Printf = 0x800CF414; // type:func -Sleep_Cycles = 0x800CF440; // type:func -Sleep_Nsec = 0x800CF4AC; // type:func -Sleep_Usec = 0x800CF4FC; // type:func -Sleep_Msec = 0x800CF54C; // type:func -Sleep_Sec = 0x800CF5A0; // type:func -JpegUtils_ProcessQuantizationTable = 0x800CF5E0; // type:func -JpegUtils_ParseHuffmanCodesLengths = 0x800CF648; // type:func -JpegUtils_GetHuffmanCodes = 0x800CF6CC; // type:func -JpegUtils_SetHuffmanTable = 0x800CF738; // type:func -JpegUtils_ProcessHuffmanTableImpl = 0x800CF7E0; // type:func -JpegUtils_ProcessHuffmanTable = 0x800CF89C; // type:func -JpegUtils_SetHuffmanTableOld = 0x800CF974; // type:func -JpegUtils_ProcessHuffmanTableImplOld = 0x800CFA1C; // type:func -JpegDecoder_Decode = 0x800CFAF0; // type:func -JpegDecoder_ProcessMcu = 0x800CFD18; // type:func -JpegDecoder_ParseNextSymbol = 0x800CFEB4; // type:func -JpegDecoder_ReadBits = 0x800CFFF0; // type:func -guScale = 0x800D00E0; // type:func -sinf = 0x800D0190; // type:func -sins = 0x800D0350; // type:func -_VirtualToPhysicalTask = 0x800D03C0; // type:func -osSpTaskLoad = 0x800D04CC; // type:func -osSpTaskStartGo = 0x800D0634; // type:func -__osMotorAccess = 0x800D0680; // type:func -_MakeMotorData = 0x800D07E8; // type:func -osMotorInit = 0x800D08F4; // type:func -__osSiCreateAccessQueue = 0x800D0A50; // type:func -__osSiGetAccess = 0x800D0AA0; // type:func -__osSiRelAccess = 0x800D0AE4; // type:func -osContInit = 0x800D0B10; // type:func -__osContGetInitData = 0x800D0C6C; // type:func -__osPackRequestData = 0x800D0D18; // type:func -osContStartReadData = 0x800D0DF0; // type:func -osContGetReadData = 0x800D0E74; // type:func -__osPackReadData = 0x800D0F00; // type:func -guPerspectiveF = 0x800D0FD0; // type:func -guPerspective = 0x800D1200; // type:func -__osSpRawStartDma = 0x800D1260; // type:func -__osSiRawStartDma = 0x800D12F0; // type:func -osSpTaskYield = 0x800D13A0; // type:func -guMtxIdentF = 0x800D13C0; // type:func -guLookAtF = 0x800D1410; // type:func -guLookAt = 0x800D16B4; // type:func -osStopTimer = 0x800D1730; // type:func -sqrtf = 0x800D1820; // type:func -osAfterPreNMI = 0x800D1830; // type:func -osContStartQuery = 0x800D1850; // type:func -osContGetQuery = 0x800D18CC; // type:func -guLookAtHiliteF = 0x800D18F0; // type:func -guLookAtHilite = 0x800D20B0; // type:func -_Printf = 0x800D2170; // type:func -_Putfld = 0x800D27B8; // type:func -strchr = 0x800D2E50; // type:func -strlen = 0x800D2E90; // type:func -memcpy = 0x800D2EB8; // type:func -__osSpDeviceBusy = 0x800D2EF0; // type:func -guMtxIdent = 0x800D2F20; // type:func -guPositionF = 0x800D2F70; // type:func -guPosition = 0x800D3118; // type:func -osSpTaskYielded = 0x800D3180; // type:func -guRotateF = 0x800D31E0; // type:func -guRotate = 0x800D3364; // type:func -osAiSetFrequency = 0x800D33B0; // type:func -__osGetActiveQueue = 0x800D3500; // type:func -guNormalize = 0x800D3520; // type:func -osDpGetStatus = 0x800D3580; // type:func -osDpSetStatus = 0x800D3590; // type:func -guOrthoF = 0x800D35A0; // type:func -guOrtho = 0x800D36F4; // type:func -cosf = 0x800D3760; // type:func -coss = 0x800D38D0; // type:func -osViSetEvent = 0x800D3900; // type:func -guS2DInitBg = 0x800D3960; // type:func -__osPfsSelectBank = 0x800D3AE0; // type:func -osContSetCh = 0x800D3B60; // type:func -osAiGetLength = 0x800D3BC0; // type:func -guTranslate = 0x800D3BE0; // type:func -__osContRamWrite = 0x800D3CB0; // type:func -__osPfsGetStatus = 0x800D3F00; // type:func -__osPfsRequestOneChannel = 0x800D3FD0; // type:func -__osPfsGetOneChannelData = 0x800D4094; // type:func -__osSumcalc = 0x800D4130; // type:func -__osIdCheckSum = 0x800D41A4; // type:func -__osRepairPackId = 0x800D42A0; // type:func -__osCheckPackId = 0x800D45F0; // type:func -__osGetId = 0x800D4754; // type:func -__osCheckId = 0x800D4900; // type:func -__osPfsRWInode = 0x800D49D4; // type:func -__osContRamRead = 0x800D4CB0; // type:func -__osContAddressCrc = 0x800D4EE0; // type:func -__osContDataCrc = 0x800D4FB0; // type:func -osPfsIsPlug = 0x800D5050; // type:func -__osPfsRequestData = 0x800D51DC; // type:func -__osPfsGetInitData = 0x800D5290; // type:func -osSetTimer = 0x800D5340; // type:func -_Ldtob = 0x800D54D0; // type:func -_Ldunscale = 0x800D5960; // type:func -_Genld = 0x800D5A18; // type:func -ldiv = 0x800D5FE0; // type:func -lldiv = 0x800D6064; // type:func -_Litob = 0x800D6170; // type:func -__osSpGetStatus = 0x800D6410; // type:func -__osSpSetStatus = 0x800D6420; // type:func -osWritebackDCacheAll = 0x800D6430; // type:func -__osGetCurrFaultedThread = 0x800D6460; // type:func -guMtxF2L = 0x800D6480; // type:func -__d_to_ll = 0x800D64F0; // type:func -__f_to_ll = 0x800D650C; // type:func -__d_to_ull = 0x800D6528; // type:func -__f_to_ull = 0x800D65C8; // type:func -__ll_to_d = 0x800D6664; // type:func -__ll_to_f = 0x800D667C; // type:func -__ull_to_d = 0x800D6694; // type:func -__ull_to_f = 0x800D66C8; // type:func -osViGetCurrentFramebuffer = 0x800D6700; // type:func -__osSpSetPc = 0x800D6740; // type:func -sqrt = 0x800D6770; // type:func -absf = 0x800D6780; // type:func -fmodf = 0x800D6790; // type:func -__osMemset = 0x800D67E0; // type:func -__osMemmove = 0x800D6810; // type:func -Message_ResetOcarinaNoteState = 0x800D68A0; // type:func -Message_UpdateOcarinaMemoryGame = 0x800D699C; // type:func -Message_ShouldAdvance = 0x800D6AC0; // type:func -Message_ShouldAdvanceSilent = 0x800D6B84; // type:func -Message_CloseTextbox = 0x800D6BCC; // type:func -Message_HandleChoiceSelection = 0x800D6C44; // type:func -Message_DrawTextChar = 0x800D6E24; // type:func -Message_GrowTextbox = 0x800D7154; // type:func -Message_FindMessageJPN = 0x800D7358; // type:func -Message_FindMessageNES = 0x800D73FC; // type:func -Message_FindCreditsMessage = 0x800D74A0; // type:func -Message_SetTextColor = 0x800D7514; // type:func -Message_DrawTextboxIcon = 0x800D77C8; // type:func -Message_DrawItemIcon = 0x800D7F0C; // type:func -Message_HandleOcarina = 0x800D8258; // type:func -Message_DrawTextJPN = 0x800D8468; // type:func -Message_DrawTextNES = 0x800D985C; // type:func -Message_LoadItemIcon = 0x800DAAD4; // type:func -Message_Decode = 0x800DAC74; // type:func -Message_OpenText = 0x800DD19C; // type:func -Message_StartTextbox = 0x800DD6C4; // type:func -Message_ContinueTextbox = 0x800DD730; // type:func -Message_StartOcarinaImpl = 0x800DD800; // type:func -Message_StartOcarina = 0x800DDCB0; // type:func -Message_StartOcarinaSunsSongDisabled = 0x800DDCE0; // type:func -Message_GetState = 0x800DDD14; // type:func -Message_DrawTextBox = 0x800DDE34; // type:func -Message_SetView = 0x800DE2C0; // type:func -Message_DrawMain = 0x800DE308; // type:func -Message_Draw = 0x800E12E0; // type:func -Message_Update = 0x800E137C; // type:func -Message_SetTables = 0x800E1F04; // type:func -GameOver_Init = 0x800E1F40; // type:func -GameOver_FadeInLights = 0x800E1F54; // type:func -GameOver_Update = 0x800E1FBC; // type:func -Interface_Destroy = 0x800E2480; // type:func -Interface_Init = 0x800E24A0; // type:func -Message_Init = 0x800E28A4; // type:func -Regs_InitDataImpl = 0x800E2948; // type:func -Regs_InitData = 0x800E3814; // type:func -ConsoleLogo_Calc = 0x80800000; // type:func -ConsoleLogo_SetupView = 0x80800010; // type:func -ConsoleLogo_Draw = 0x808000A8; // type:func -ConsoleLogo_Main = 0x808005E0; // type:func -ConsoleLogo_Destroy = 0x808006A0; // type:func -ConsoleLogo_Init = 0x808006C0; // type:func -MapSelect_LoadTitle = 0x80800850; // type:func -MapSelect_LoadGame = 0x80800870; // type:func -MapSelect_UpdateMenu = 0x80800960; // type:func -MapSelect_PrintMenu = 0x808012C0; // type:func -MapSelect_PrintLoadingMessage = 0x8080149C; // type:func -MapSelect_PrintAgeSetting = 0x80801528; // type:func -MapSelect_PrintCutsceneSetting = 0x8080159C; // type:func -MapSelect_DrawMenu = 0x80801758; // type:func -MapSelect_DrawLoadingScreen = 0x8080186C; // type:func -MapSelect_Draw = 0x80801954; // type:func -MapSelect_Main = 0x80801A08; // type:func -MapSelect_Destroy = 0x80801A34; // type:func -MapSelect_Init = 0x80801A40; // type:func -TitleSetup_SetupTitleScreen = 0x808034D0; // type:func -func_80803C5C = 0x8080353C; // type:func -TitleSetup_Main = 0x80803548; // type:func -TitleSetup_Destroy = 0x8080358C; // type:func -TitleSetup_Init = 0x80803598; // type:func -FileSelect_SetupCopySource = 0x80803630; // type:func -FileSelect_SelectCopySource = 0x808037C8; // type:func -FileSelect_SetupCopyDest1 = 0x80803B38; // type:func -FileSelect_SetupCopyDest2 = 0x80803CC8; // type:func -FileSelect_SelectCopyDest = 0x80803D90; // type:func -FileSelect_ExitToCopySource1 = 0x80804148; // type:func -FileSelect_ExitToCopySource2 = 0x80804214; // type:func -FileSelect_SetupCopyConfirm1 = 0x80804340; // type:func -FileSelect_SetupCopyConfirm2 = 0x80804564; // type:func -FileSelect_CopyConfirm = 0x808045C0; // type:func -FileSelect_ReturnToCopyDest = 0x808047C8; // type:func -FileSelect_CopyAnim1 = 0x808049FC; // type:func -FileSelect_CopyAnim2 = 0x80804A78; // type:func -FileSelect_CopyAnim3 = 0x80804BC8; // type:func -FileSelect_CopyAnim4 = 0x80804CE4; // type:func -FileSelect_CopyAnim5 = 0x80804DD4; // type:func -FileSelect_ExitCopyToMain = 0x808050D4; // type:func -FileSelect_SetupEraseSelect = 0x80805210; // type:func -FileSelect_EraseSelect = 0x808053E0; // type:func -FileSelect_SetupEraseConfirm1 = 0x8080576C; // type:func -FileSelect_SetupEraseConfirm2 = 0x80805A34; // type:func -FileSelect_EraseConfirm = 0x80805B10; // type:func -FileSelect_ExitToEraseSelect1 = 0x80805CF8; // type:func -FileSelect_ExitToEraseSelect2 = 0x80805DA8; // type:func -FileSelect_EraseAnim1 = 0x80805FC4; // type:func -FileSelect_EraseAnim2 = 0x808061A4; // type:func -FileSelect_EraseAnim3 = 0x80806268; // type:func -FileSelect_ExitEraseToMain = 0x808064D4; // type:func -FileSelect_DrawCharacter = 0x80806670; // type:func -FileSelect_SetKeyboardVtx = 0x80806988; // type:func -FileSelect_SetNameEntryVtx = 0x80806C4C; // type:func -FileSelect_DrawKeyboard = 0x80807930; // type:func -FileSelect_DrawNameEntry = 0x8080847C; // type:func -FileSelect_StartNameEntry = 0x808098E0; // type:func -FileSelect_UpdateKeyboardCursor = 0x80809994; // type:func -FileSelect_StartOptions = 0x8080A374; // type:func -FileSelect_UpdateOptionsMenu = 0x8080A404; // type:func -FileSelect_DrawOptionsImpl = 0x8080A680; // type:func -FileSelect_DrawOptions = 0x8080BA98; // type:func -FileSelect_SetView = 0x8080BAC0; // type:func -FileSelect_QuadTextureIA8 = 0x8080BB44; // type:func -FileSelect_InitModeUpdate = 0x8080BD24; // type:func -FileSelect_InitModeDraw = 0x8080BD7C; // type:func -FileSelect_FadeInMenuElements = 0x8080BD88; // type:func -FileSelect_SplitNumber = 0x8080BEF0; // type:func -FileSelect_StartFadeIn = 0x8080BF64; // type:func -FileSelect_FinishFadeIn = 0x8080BFEC; // type:func -FileSelect_UpdateMainMenu = 0x8080C084; // type:func -FileSelect_UnusedCM31 = 0x8080C928; // type:func -FileSelect_UnusedCMDelay = 0x8080C934; // type:func -FileSelect_RotateToNameEntry = 0x8080C988; // type:func -FileSelect_RotateToOptions = 0x8080C9FC; // type:func -FileSelect_RotateToMain = 0x8080CA70; // type:func -FileSelect_PulsateCursor = 0x8080CAE8; // type:func -FileSelect_ConfigModeUpdate = 0x8080CBE4; // type:func -FileSelect_SetWindowVtx = 0x8080CC20; // type:func -FileSelect_SetWindowContentVtx = 0x8080CEF4; // type:func -FileSelect_DrawFileInfo = 0x8080E1B8; // type:func -FileSelect_DrawWindowContents = 0x8080E934; // type:func -FileSelect_ConfigModeDraw = 0x8080FDE8; // type:func -FileSelect_FadeMainToSelect = 0x808106C8; // type:func -FileSelect_MoveSelectedFileToTop = 0x80810834; // type:func -FileSelect_FadeInFileInfo = 0x80810938; // type:func -FileSelect_ConfirmFile = 0x80810A1C; // type:func -FileSelect_FadeOutFileInfo = 0x80810BF4; // type:func -FileSelect_MoveSelectedFileToSlot = 0x80810CE4; // type:func -FileSelect_FadeOut = 0x80810F3C; // type:func -FileSelect_LoadGame = 0x80810F98; // type:func -FileSelect_SelectModeUpdate = 0x80811160; // type:func -FileSelect_SelectModeDraw = 0x8081119C; // type:func -FileSelect_Main = 0x80811554; // type:func -FileSelect_InitContext = 0x80811B1C; // type:func -FileSelect_Destroy = 0x80812148; // type:func -FileSelect_Init = 0x80812154; // type:func -KaleidoScope_DrawQuestStatus = 0x808135B0; // type:func -KaleidoScope_UpdateQuestStatusPoint = 0x8081599C; // type:func -KaleidoScope_DrawDebugEditorText = 0x808159B0; // type:func -KaleidoScope_DrawDigit = 0x80815CA4; // type:func -KaleidoScope_DrawDebugEditor = 0x80815E18; // type:func -KaleidoScope_DrawEquipmentImage = 0x80817960; // type:func -KaleidoScope_DrawPlayerWork = 0x80817D60; // type:func -KaleidoScope_DrawEquipment = 0x80817F04; // type:func -KaleidoScope_DrawAmmoCount = 0x808193E0; // type:func -KaleidoScope_SetCursorVtx = 0x8081991C; // type:func -KaleidoScope_SetItemCursorVtx = 0x8081994C; // type:func -KaleidoScope_DrawItemSelect = 0x80819978; // type:func -KaleidoScope_UpdateItemEquip = 0x8081A7D4; // type:func -KaleidoScope_DrawDungeonMap = 0x8081B3D0; // type:func -KaleidoScope_DrawWorldMap = 0x8081CBE0; // type:func -KaleidoScope_UpdatePrompt = 0x8081E6B0; // type:func -KaleidoScope_SetupPlayerPreRender = 0x8081E8B0; // type:func -KaleidoScope_ProcessPlayerPreRender = 0x8081E988; // type:func -KaleidoScope_QuadTextureIA4 = 0x8081E9C0; // type:func -KaleidoScope_QuadTextureIA8 = 0x8081EBA0; // type:func -KaleidoScope_OverridePalIndexCI4 = 0x8081ED80; // type:func -KaleidoScope_MoveCursorToSpecialPos = 0x8081EEB8; // type:func -KaleidoScope_DrawQuadTextureRGBA32 = 0x8081EF1C; // type:func -KaleidoScope_SetDefaultCursor = 0x8081F10C; // type:func -KaleidoScope_SetupPageSwitch = 0x8081F1CC; // type:func -KaleidoScope_HandlePageToggles = 0x8081F344; // type:func -KaleidoScope_DrawCursor = 0x8081F474; // type:func -KaleidoScope_DrawPageSections = 0x8081F7C0; // type:func -KaleidoScope_DrawPages = 0x8081FA6C; // type:func -KaleidoScope_DrawInfoPanel = 0x80821248; // type:func -KaleidoScope_UpdateNamePanel = 0x808229D8; // type:func -KaleidoScope_UpdatePageSwitch = 0x80822BD0; // type:func -KaleidoScope_SetView = 0x80822DB0; // type:func -func_80823A0C = 0x80822E2C; // type:func -KaleidoScope_InitVertices = 0x808234BC; // type:func -KaleidoScope_DrawGameOver = 0x80824FFC; // type:func -KaleidoScope_Draw = 0x80825674; // type:func -KaleidoScope_GrayOutTextureRGBA32 = 0x8082589C; // type:func -KaleidoScope_UpdateOpening = 0x80825950; // type:func -KaleidoScope_UpdateCursorSize = 0x80825B40; // type:func -KaleidoScope_LoadDungeonMap = 0x80825E84; // type:func -KaleidoScope_UpdateDungeonMap = 0x80825F20; // type:func -KaleidoScope_Update = 0x80826014; // type:func -PauseMapMark_Init = 0x80828870; // type:func -PauseMapMark_Clear = 0x808288A4; // type:func -PauseMapMark_DrawForDungeon = 0x808288B8; // type:func -PauseMapMark_Draw = 0x80828ECC; // type:func -Player_ZeroSpeedXZ = 0x8082FDA0; // type:func -func_80832224 = 0x8082FDB8; // type:func -func_8083224C = 0x8082FDE0; // type:func -Player_AnimPlayOnce = 0x8082FDFC; // type:func -Player_AnimPlayLoop = 0x8082FE20; // type:func -Player_AnimPlayLoopAdjusted = 0x8082FE44; // type:func -Player_AnimPlayOnceAdjusted = 0x8082FE74; // type:func -func_808322FC = 0x8082FEA4; // type:func -func_80832318 = 0x8082FEC4; // type:func -func_80832340 = 0x8082FEF0; // type:func -Player_DetachHeldActor = 0x8082FF60; // type:func -func_80832440 = 0x8082FFEC; // type:func -Player_PutAwayHeldItem = 0x808300D4; // type:func -func_80832564 = 0x80830110; // type:func -func_80832594 = 0x80830148; // type:func -func_80832630 = 0x808301E8; // type:func -Player_RequestRumble = 0x80830204; // type:func -func_80832698 = 0x80830250; // type:func -func_808326F0 = 0x808302B0; // type:func -func_8083275C = 0x8083031C; // type:func -func_80832770 = 0x80830338; // type:func -func_808327A4 = 0x80830370; // type:func -func_808327C4 = 0x80830398; // type:func -func_808327F8 = 0x808303D0; // type:func -func_80832854 = 0x8083042C; // type:func -func_808328A0 = 0x80830478; // type:func -func_808328EC = 0x808304C4; // type:func -Player_ProcessAnimSfxList = 0x808304F8; // type:func -Player_AnimChangeOnceMorph = 0x808306E0; // type:func -Player_AnimChangeOnceMorphAdjusted = 0x8083074C; // type:func -Player_AnimChangeLoopMorph = 0x808307BC; // type:func -Player_AnimChangeFreeze = 0x80830804; // type:func -Player_AnimChangeLoopSlowMorph = 0x80830848; // type:func -func_80832CB0 = 0x80830890; // type:func -Player_SkelAnimeResetPrevTranslRot = 0x808308E4; // type:func -Player_SkelAnimeResetPrevTranslRotAgeScale = 0x8083090C; // type:func -Player_ZeroRootLimbYaw = 0x80830998; // type:func -func_80832DBC = 0x808309A8; // type:func -func_80832E48 = 0x80830A34; // type:func -Player_AnimReplaceApplyFlags = 0x80830B44; // type:func -Player_AnimReplacePlayOnceSetSpeed = 0x80830BEC; // type:func -Player_AnimReplacePlayOnce = 0x80830C34; // type:func -Player_AnimReplacePlayOnceAdjusted = 0x80830C5C; // type:func -Player_AnimReplaceNormalPlayOnceAdjusted = 0x80830C84; // type:func -Player_AnimReplacePlayLoopSetSpeed = 0x80830CA4; // type:func -Player_AnimReplacePlayLoop = 0x80830CEC; // type:func -Player_AnimReplacePlayLoopAdjusted = 0x80830D14; // type:func -Player_AnimReplaceNormalPlayLoopAdjusted = 0x80830D3C; // type:func -Player_ProcessControlStick = 0x80830D5C; // type:func -func_8083328C = 0x80830E88; // type:func -func_808332B8 = 0x80830EB8; // type:func -func_808332E4 = 0x80830EE4; // type:func -func_808332F4 = 0x80830EF8; // type:func -func_80833338 = 0x80830F3C; // type:func -func_80833350 = 0x80830F58; // type:func -func_808333FC = 0x8083100C; // type:func -func_80833438 = 0x80831048; // type:func -func_808334B4 = 0x808310C4; // type:func -func_808334E4 = 0x808310F8; // type:func -func_80833528 = 0x80831140; // type:func -func_8083356C = 0x80831188; // type:func -func_808335B0 = 0x808311D0; // type:func -func_808335F4 = 0x80831218; // type:func -Player_SetUpperActionFunc = 0x80831260; // type:func -Player_InitItemActionWithAnim = 0x8083128C; // type:func -Player_ItemToItemAction = 0x8083134C; // type:func -Player_InitDefaultIA = 0x80831398; // type:func -Player_InitDekuStickIA = 0x808313A8; // type:func -Player_InitHammerIA = 0x808313C4; // type:func -Player_InitBowOrSlingshotIA = 0x808313D4; // type:func -Player_InitExplosiveIA = 0x8083140C; // type:func -Player_InitHookshotIA = 0x8083154C; // type:func -Player_InitBoomerangIA = 0x808315BC; // type:func -Player_InitItemAction = 0x808315D8; // type:func -func_80833A20 = 0x80831664; // type:func -func_80833B2C = 0x8083176C; // type:func -func_80833B54 = 0x80831794; // type:func -func_80833BCC = 0x8083180C; // type:func -func_80833C04 = 0x80831848; // type:func -func_80833C3C = 0x80831884; // type:func -Player_ItemIsInUse = 0x8083189C; // type:func -Player_ItemIsItemAction = 0x808318E8; // type:func -Player_GetItemOnButton = 0x80831930; // type:func -Player_ProcessItemButtons = 0x80831A4C; // type:func -Player_StartChangingHeldItem = 0x80831D34; // type:func -Player_UpdateItems = 0x80831EEC; // type:func -func_80834380 = 0x80831FD4; // type:func -func_8083442C = 0x80832080; // type:func -Player_FinishItemChange = 0x808321E8; // type:func -func_80834644 = 0x80832298; // type:func -func_808346C4 = 0x80832318; // type:func -func_80834758 = 0x808323AC; // type:func -func_8083485C = 0x808324B4; // type:func -func_80834894 = 0x808324EC; // type:func -Player_WaitToFinishItemChange = 0x80832548; // type:func -func_8083499C = 0x808325F8; // type:func -Player_UpperAction_Sword = 0x80832638; // type:func -Player_UpperAction_ChangeHeldItem = 0x80832688; // type:func -func_80834B5C = 0x808327B8; // type:func -func_80834BD4 = 0x80832834; // type:func -func_80834C74 = 0x808328D8; // type:func -func_80834D2C = 0x80832990; // type:func -func_80834E44 = 0x80832AA8; // type:func -func_80834E7C = 0x80832AE0; // type:func -func_80834EB8 = 0x80832B1C; // type:func -func_80834F2C = 0x80832B90; // type:func -func_80834FBC = 0x80832C20; // type:func -func_8083501C = 0x80832C80; // type:func -func_808350A4 = 0x80832D08; // type:func -func_808351D4 = 0x80832E3C; // type:func -func_808353D8 = 0x80833048; // type:func -func_80835588 = 0x808331F8; // type:func -func_808355DC = 0x80833254; // type:func -func_80835644 = 0x808332C0; // type:func -func_80835688 = 0x80833308; // type:func -Player_UpperAction_CarryActor = 0x80833368; // type:func -func_808357E8 = 0x80833468; // type:func -func_80835800 = 0x80833484; // type:func -func_80835884 = 0x80833508; // type:func -func_808358F0 = 0x80833574; // type:func -func_808359FC = 0x80833688; // type:func -func_80835B60 = 0x808337F0; // type:func -func_80835C08 = 0x80833898; // type:func -Player_SetupAction = 0x808338F0; // type:func -func_80835DAC = 0x80833A4C; // type:func -func_80835DE4 = 0x80833A80; // type:func -func_80835E44 = 0x80833AE4; // type:func -func_80835EA4 = 0x80833B48; // type:func -Player_DestroyHookshot = 0x80833BA4; // type:func -Player_UseItem = 0x80833BF4; // type:func -func_80836448 = 0x808340FC; // type:func -Player_CanUpdateItems = 0x8083427C; // type:func -Player_UpdateUpperBody = 0x80834328; // type:func -Player_SetupWaitForPutAway = 0x80834550; // type:func -Player_UpdateShapeYaw = 0x808345A8; // type:func -func_808369C8 = 0x80834684; // type:func -func_80836AB8 = 0x80834770; // type:func -func_80836BEC = 0x808348A4; // type:func -Player_CalcSpeedAndYawFromControlStick = 0x80834C68; // type:func -func_8083721C = 0x80834ED8; // type:func -Player_GetMovementSpeedAndYaw = 0x80834F2C; // type:func -Player_TryActionChangeList = 0x8083500C; // type:func -Player_TryActionInterrupt = 0x80835168; // type:func -func_80837530 = 0x80835200; // type:func -Player_CanSpinAttack = 0x808352B0; // type:func -func_80837704 = 0x808353E0; // type:func -func_808377DC = 0x808354B8; // type:func -func_80837818 = 0x808354FC; // type:func -func_80837918 = 0x808355FC; // type:func -func_80837948 = 0x8083562C; // type:func -func_80837AE0 = 0x808357CC; // type:func -func_80837AFC = 0x808357E8; // type:func -func_80837B18 = 0x80835808; // type:func -func_80837B60 = 0x80835850; // type:func -func_80837B9C = 0x8083588C; // type:func -func_80837C0C = 0x808358FC; // type:func -func_80838144 = 0x80835E34; // type:func -func_8083816C = 0x80835E5C; // type:func -func_8083819C = 0x80835E8C; // type:func -func_8083821C = 0x80835F10; // type:func -func_80838280 = 0x80835F74; // type:func -func_808382BC = 0x80835FB0; // type:func -func_808382DC = 0x80835FD0; // type:func -func_80838940 = 0x80836634; // type:func -func_808389E8 = 0x808366D8; // type:func -Player_ActionChange_12 = 0x80836704; // type:func -func_80838E70 = 0x80836B60; // type:func -func_80838F18 = 0x80836C10; // type:func -func_80838F5C = 0x80836C5C; // type:func -func_80838FB8 = 0x80836CC0; // type:func -Player_HandleExitsAndVoids = 0x80836D3C; // type:func -Player_GetRelativePosition = 0x808372E0; // type:func -Player_SpawnFairy = 0x80837384; // type:func -func_808396F4 = 0x808373F8; // type:func -func_8083973C = 0x80837444; // type:func -Player_PosVsWallLineTest = 0x80837470; // type:func -Player_ActionChange_1 = 0x8083750C; // type:func -func_80839E88 = 0x80837BA4; // type:func -func_80839F30 = 0x80837C48; // type:func -func_80839F90 = 0x80837CA4; // type:func -func_80839FFC = 0x80837D10; // type:func -func_8083A060 = 0x80837D78; // type:func -func_8083A098 = 0x80837DB4; // type:func -func_8083A0D4 = 0x80837DF4; // type:func -func_8083A0F4 = 0x80837E14; // type:func -func_8083A2F8 = 0x80838018; // type:func -func_8083A360 = 0x80838088; // type:func -func_8083A388 = 0x808380B0; // type:func -func_8083A3B0 = 0x808380D8; // type:func -func_8083A40C = 0x80838130; // type:func -func_8083A434 = 0x80838158; // type:func -func_8083A4A8 = 0x808381CC; // type:func -func_8083A5C4 = 0x808382E8; // type:func -func_8083A6AC = 0x808383DC; // type:func -func_8083A9B8 = 0x808386E4; // type:func -func_8083AA10 = 0x8083873C; // type:func -func_8083AD4C = 0x80838A78; // type:func -Player_StartCsAction = 0x80838B00; // type:func -func_8083AE40 = 0x80838B6C; // type:func -func_8083AF44 = 0x80838BF4; // type:func -func_8083B010 = 0x80838CC8; // type:func -Player_ActionChange_13 = 0x80838CFC; // type:func -Player_ActionChange_4 = 0x80839300; // type:func -func_8083B8F4 = 0x808395B0; // type:func -Player_ActionChange_0 = 0x80839658; // type:func -func_8083BA90 = 0x80839750; // type:func -func_8083BB20 = 0x808397E8; // type:func -func_8083BBA0 = 0x80839868; // type:func -func_8083BC04 = 0x808398D0; // type:func -func_8083BC7C = 0x80839948; // type:func -func_8083BCD0 = 0x8083999C; // type:func -Player_ActionChange_10 = 0x80839A88; // type:func -func_8083BF50 = 0x80839C20; // type:func -func_8083C0B8 = 0x80839D84; // type:func -func_8083C0E8 = 0x80839DBC; // type:func -func_8083C148 = 0x80839E18; // type:func -Player_ActionChange_6 = 0x80839EB4; // type:func -Player_ActionChange_11 = 0x80839F90; // type:func -func_8083C484 = 0x8083A168; // type:func -func_8083C50C = 0x8083A1F0; // type:func -Player_ActionChange_8 = 0x8083A228; // type:func -func_8083C61C = 0x8083A304; // type:func -func_8083C6B8 = 0x8083A3A0; // type:func -func_8083C858 = 0x8083A544; // type:func -func_8083C8DC = 0x8083A5C8; // type:func -func_8083C910 = 0x8083A5FC; // type:func -func_8083CA20 = 0x8083A710; // type:func -func_8083CA54 = 0x8083A748; // type:func -func_8083CA9C = 0x8083A790; // type:func -func_8083CB2C = 0x8083A824; // type:func -func_8083CB94 = 0x8083A888; // type:func -func_8083CBF0 = 0x8083A8E4; // type:func -func_8083CC9C = 0x8083A98C; // type:func -func_8083CD00 = 0x8083A9EC; // type:func -func_8083CD54 = 0x8083AA40; // type:func -func_8083CE0C = 0x8083AAFC; // type:func -func_8083CEAC = 0x8083AB98; // type:func -func_8083CF10 = 0x8083ABF8; // type:func -func_8083CF5C = 0x8083AC40; // type:func -func_8083CFA8 = 0x8083AC88; // type:func -func_8083D0A8 = 0x8083AD90; // type:func -func_8083D12C = 0x8083AE18; // type:func -func_8083D330 = 0x8083B020; // type:func -func_8083D36C = 0x8083B05C; // type:func -func_8083D53C = 0x8083B230; // type:func -func_8083D6EC = 0x8083B3E0; // type:func -func_8083DB98 = 0x8083B890; // type:func -func_8083DC54 = 0x8083B94C; // type:func -func_8083DDC8 = 0x8083BAC0; // type:func -func_8083DF68 = 0x8083BC68; // type:func -func_8083DFE0 = 0x8083BCE4; // type:func -Player_ActionChange_3 = 0x8083BE04; // type:func -Player_GetSlopeDirection = 0x8083BFA4; // type:func -Player_HandleSlopes = 0x8083C020; // type:func -func_8083E4C4 = 0x8083C1D4; // type:func -Player_ActionChange_2 = 0x8083C2BC; // type:func -func_8083EA94 = 0x8083C754; // type:func -func_8083EAF0 = 0x8083C7B0; // type:func -Player_ActionChange_9 = 0x8083C804; // type:func -func_8083EC18 = 0x8083C8D8; // type:func -func_8083F070 = 0x8083CD34; // type:func -Player_TryEnteringCrawlspace = 0x8083CD8C; // type:func -func_8083F360 = 0x8083D028; // type:func -func_8083F524 = 0x8083D1EC; // type:func -Player_TryLeavingCrawlspace = 0x8083D238; // type:func -func_8083F72C = 0x8083D3F4; // type:func -Player_ActionChange_5 = 0x8083D480; // type:func -func_8083F9D0 = 0x8083D698; // type:func -func_8083FAB8 = 0x8083D780; // type:func -func_8083FB14 = 0x8083D7DC; // type:func -func_8083FB7C = 0x8083D844; // type:func -func_8083FBC0 = 0x8083D884; // type:func -func_8083FC68 = 0x8083D934; // type:func -func_8083FD78 = 0x8083DA44; // type:func -func_8083FFB8 = 0x8083DC88; // type:func -func_80840058 = 0x8083DD28; // type:func -func_80840138 = 0x8083DE10; // type:func -func_808401B0 = 0x8083DE88; // type:func -func_8084021C = 0x8083DEF4; // type:func -func_8084029C = 0x8083DF74; // type:func -Player_Action_80840450 = 0x8083E12C; // type:func -Player_Action_808407CC = 0x8083E4A8; // type:func -func_808409CC = 0x8083E6A8; // type:func -Player_Action_80840BC8 = 0x8083E8A4; // type:func -Player_Action_80840DE4 = 0x8083EAC4; // type:func -func_80841138 = 0x8083EE18; // type:func -func_8084140C = 0x8083F0F4; // type:func -func_80841458 = 0x8083F140; // type:func -Player_Action_808414F8 = 0x8083F1E0; // type:func -func_808416C0 = 0x8083F3B4; // type:func -Player_Action_8084170C = 0x8083F400; // type:func -Player_Action_808417FC = 0x8083F4F0; // type:func -func_80841860 = 0x8083F554; // type:func -Player_Action_8084193C = 0x8083F630; // type:func -Player_Action_80841BA8 = 0x8083F894; // type:func -func_80841CC4 = 0x8083F9B0; // type:func -func_80841EE4 = 0x8083FBD4; // type:func -Player_Action_80842180 = 0x8083FE78; // type:func -Player_Action_8084227C = 0x8083FF7C; // type:func -Player_Action_808423EC = 0x808400F0; // type:func -Player_Action_8084251C = 0x80840220; // type:func -func_8084260C = 0x80840310; // type:func -func_8084269C = 0x808403A0; // type:func -Player_Action_8084279C = 0x808404A0; // type:func -func_8084285C = 0x80840560; // type:func -func_808428D8 = 0x808405DC; // type:func -func_80842964 = 0x8084066C; // type:func -Player_RequestQuake = 0x808406C4; // type:func -func_80842A28 = 0x80840738; // type:func -func_80842A88 = 0x8084079C; // type:func -func_80842AC4 = 0x808407D8; // type:func -func_80842B7C = 0x80840894; // type:func -func_80842CF0 = 0x80840A0C; // type:func -func_80842D20 = 0x80840A44; // type:func -func_80842DF4 = 0x80840B1C; // type:func -Player_Action_80843188 = 0x80840EB0; // type:func -Player_Action_808435C4 = 0x808412EC; // type:func -Player_Action_8084370C = 0x80841438; // type:func -Player_Action_8084377C = 0x808414AC; // type:func -Player_Action_80843954 = 0x80841688; // type:func -Player_Action_80843A38 = 0x80841770; // type:func -func_80843AE8 = 0x80841824; // type:func -Player_Action_80843CEC = 0x80841A28; // type:func -func_80843E14 = 0x80841B54; // type:func -func_80843E64 = 0x80841BA8; // type:func -func_8084409C = 0x80841DE0; // type:func -Player_Action_8084411C = 0x80841E68; // type:func -Player_Action_80844708 = 0x8084245C; // type:func -Player_Action_80844A44 = 0x80842798; // type:func -Player_Action_80844AF4 = 0x80842848; // type:func -func_80844BE4 = 0x80842938; // type:func -func_80844CF8 = 0x80842A50; // type:func -func_80844D30 = 0x80842A88; // type:func -func_80844D68 = 0x80842AC0; // type:func -func_80844DC8 = 0x80842B24; // type:func -func_80844E3C = 0x80842B98; // type:func -Player_Action_80844E68 = 0x80842BC8; // type:func -Player_Action_80845000 = 0x80842D60; // type:func -Player_Action_80845308 = 0x80843068; // type:func -Player_Action_80845668 = 0x808433C8; // type:func -Player_Action_WaitForPutAway = 0x80843634; // type:func -func_80845964 = 0x808436C8; // type:func -func_80845BA0 = 0x8084390C; // type:func -func_80845C68 = 0x808439D8; // type:func -Player_Action_80845CA4 = 0x80843A18; // type:func -Player_Action_80845EF8 = 0x80843C78; // type:func -Player_Action_80846050 = 0x80843DD0; // type:func -Player_Action_80846120 = 0x80843EA8; // type:func -Player_Action_80846260 = 0x80843FE8; // type:func -Player_Action_80846358 = 0x808440E8; // type:func -Player_Action_80846408 = 0x80844198; // type:func -Player_Action_808464B0 = 0x80844240; // type:func -Player_Action_80846578 = 0x8084430C; // type:func -func_8084663C = 0x808443D4; // type:func -func_80846648 = 0x808443E4; // type:func -func_80846660 = 0x80844400; // type:func -func_80846720 = 0x808444C0; // type:func -func_808467D4 = 0x80844574; // type:func -func_808468A8 = 0x80844650; // type:func -func_808468E8 = 0x80844698; // type:func -func_80846978 = 0x80844728; // type:func -func_808469BC = 0x8084476C; // type:func -Player_SpawnMagicSpell = 0x808447AC; // type:func -func_80846A68 = 0x80844818; // type:func -Player_InitCommon = 0x80844858; // type:func -Player_Init = 0x80844A88; // type:func -func_808471F4 = 0x80844F98; // type:func -func_80847298 = 0x8084503C; // type:func -Player_UpdateInterface = 0x80845178; // type:func -Player_UpdateHoverBoots = 0x80845828; // type:func -Player_ProcessSceneCollision = 0x80845950; // type:func -Player_UpdateCamAndSeqModes = 0x80846458; // type:func -Player_UpdateBurningDekuStick = 0x808467B8; // type:func -Player_UpdateBodyShock = 0x80846900; // type:func -Player_UpdateBodyBurn = 0x80846A30; // type:func -Player_DetectRumbleSecrets = 0x80846CB4; // type:func -Player_UpdateCommon = 0x80846D5C; // type:func -Player_Update = 0x80847C68; // type:func -Player_DrawGameplay = 0x80847EA0; // type:func -Player_Draw = 0x80848344; // type:func -Player_Destroy = 0x808488A4; // type:func -func_8084ABD8 = 0x80848928; // type:func -func_8084AEEC = 0x80848C3C; // type:func -func_8084B000 = 0x80848D58; // type:func -func_8084B158 = 0x80848EB8; // type:func -Player_Action_8084B1D8 = 0x80848F38; // type:func -func_8084B3CC = 0x80849128; // type:func -func_8084B498 = 0x808491FC; // type:func -func_8084B4D4 = 0x80849238; // type:func -Player_Action_8084B530 = 0x80849298; // type:func -Player_Action_8084B78C = 0x80849500; // type:func -func_8084B840 = 0x808495B4; // type:func -Player_Action_8084B898 = 0x80849610; // type:func -Player_Action_8084B9E4 = 0x8084975C; // type:func -Player_Action_8084BBE4 = 0x80849960; // type:func -Player_Action_8084BDFC = 0x80849B78; // type:func -func_8084BEE4 = 0x80849C60; // type:func -Player_Action_8084BF1C = 0x80849C98; // type:func -Player_Action_8084C5F8 = 0x8084A378; // type:func -Player_Action_8084C760 = 0x8084A4E0; // type:func -Player_Action_8084C81C = 0x8084A59C; // type:func -func_8084C89C = 0x8084A61C; // type:func -func_8084C9BC = 0x8084A748; // type:func -func_8084CBF4 = 0x8084A984; // type:func -Player_Action_8084CC98 = 0x8084AA2C; // type:func -Player_Action_8084D3E4 = 0x8084B17C; // type:func -func_8084D530 = 0x8084B2D0; // type:func -func_8084D574 = 0x8084B318; // type:func -func_8084D5CC = 0x8084B374; // type:func -Player_Action_8084D610 = 0x8084B3C0; // type:func -Player_Action_8084D7C4 = 0x8084B570; // type:func -Player_Action_8084D84C = 0x8084B600; // type:func -func_8084D980 = 0x8084B734; // type:func -Player_Action_8084DAB4 = 0x8084B86C; // type:func -func_8084DBC4 = 0x8084B97C; // type:func -Player_Action_8084DC48 = 0x8084BA00; // type:func -func_8084DF6C = 0x8084BD2C; // type:func -func_8084DFAC = 0x8084BD70; // type:func -func_8084DFF4 = 0x8084BDBC; // type:func -Player_Action_8084E1EC = 0x8084BFB4; // type:func -Player_Action_8084E30C = 0x8084C0D4; // type:func -Player_Action_8084E368 = 0x8084C134; // type:func -Player_Action_8084E3C4 = 0x8084C194; // type:func -Player_Action_8084E604 = 0x8084C3D4; // type:func -Player_Action_8084E6D4 = 0x8084C4A4; // type:func -func_8084E988 = 0x8084C758; // type:func -Player_Action_8084E9AC = 0x8084C77C; // type:func -Player_Action_8084EAC0 = 0x8084C890; // type:func -Player_Action_8084ECA4 = 0x8084CA7C; // type:func -Player_Action_8084EED8 = 0x8084CCB4; // type:func -Player_Action_8084EFC0 = 0x8084CD9C; // type:func -Player_Action_8084F104 = 0x8084CEE4; // type:func -Player_Action_8084F308 = 0x8084D0EC; // type:func -Player_Action_8084F390 = 0x8084D174; // type:func -Player_Action_8084F608 = 0x8084D3EC; // type:func -Player_Action_8084F698 = 0x8084D47C; // type:func -Player_Action_8084F710 = 0x8084D4F4; // type:func -Player_Action_8084F88C = 0x8084D670; // type:func -Player_Action_8084F9A0 = 0x8084D784; // type:func -Player_Action_8084F9C0 = 0x8084D7A4; // type:func -Player_Action_8084FA54 = 0x8084D838; // type:func -Player_Action_8084FB10 = 0x8084D8F4; // type:func -Player_Action_8084FBF4 = 0x8084D9D8; // type:func -func_8084FF7C = 0x8084DA90; // type:func -Player_UpdateBunnyEars = 0x8084DB44; // type:func -Player_ActionChange_7 = 0x8084DD3C; // type:func -Player_Action_808502D0 = 0x8084DDE8; // type:func -Player_Action_808505DC = 0x8084E0F8; // type:func -Player_Action_8085063C = 0x8084E158; // type:func -Player_Action_8085076C = 0x8084E288; // type:func -Player_Action_808507F4 = 0x8084E310; // type:func -Player_Action_80850AEC = 0x8084E60C; // type:func -Player_Action_80850C68 = 0x8084E78C; // type:func -Player_Action_80850E84 = 0x8084E9A8; // type:func -Player_AnimChangeOnceMorphZeroRootYawSpeed = 0x8084E9FC; // type:func -Player_AnimChangeOnceMorphAdjustedZeroRootYawSpeed = 0x8084EA40; // type:func -Player_AnimChangeLoopMorphAdjustedZeroRootYawSpeed = 0x8084EAC0; // type:func -func_80851008 = 0x8084EB2C; // type:func -func_80851030 = 0x8084EB54; // type:func -func_80851050 = 0x8084EB74; // type:func -func_80851094 = 0x8084EBB8; // type:func -func_808510B4 = 0x8084EBD8; // type:func -func_808510D4 = 0x8084EBF8; // type:func -func_808510F4 = 0x8084EC18; // type:func -func_80851114 = 0x8084EC38; // type:func -func_80851134 = 0x8084EC58; // type:func -func_80851154 = 0x8084EC78; // type:func -func_80851174 = 0x8084EC98; // type:func -func_80851194 = 0x8084ECB8; // type:func -func_808511B4 = 0x8084ECD8; // type:func -func_808511D4 = 0x8084ECF8; // type:func -func_808511FC = 0x8084ED24; // type:func -func_80851248 = 0x8084ED78; // type:func -func_80851294 = 0x8084EDCC; // type:func -func_808512E0 = 0x8084EE20; // type:func -func_80851314 = 0x8084EE58; // type:func -func_80851368 = 0x8084EEAC; // type:func -func_808513BC = 0x8084EF00; // type:func -func_808514C0 = 0x8084F008; // type:func -func_8085157C = 0x8084F0C4; // type:func -func_808515A4 = 0x8084F0F0; // type:func -func_80851688 = 0x8084F1D4; // type:func -func_80851750 = 0x8084F2A4; // type:func -func_80851788 = 0x8084F2E0; // type:func -func_80851828 = 0x8084F380; // type:func -func_808518DC = 0x8084F438; // type:func -func_8085190C = 0x8084F46C; // type:func -func_80851998 = 0x8084F4F8; // type:func -func_808519C0 = 0x8084F520; // type:func -func_808519EC = 0x8084F54C; // type:func -func_80851A50 = 0x8084F5B0; // type:func -func_80851B90 = 0x8084F6F0; // type:func -func_80851BE8 = 0x8084F74C; // type:func -func_80851CA4 = 0x8084F80C; // type:func -func_80851D2C = 0x8084F898; // type:func -func_80851D80 = 0x8084F8F0; // type:func -func_80851DEC = 0x8084F964; // type:func -func_80851E28 = 0x8084F9A4; // type:func -func_80851E64 = 0x8084F9E4; // type:func -func_80851E90 = 0x8084FA10; // type:func -func_80851ECC = 0x8084FA50; // type:func -func_80851F14 = 0x8084FAA0; // type:func -func_80851F84 = 0x8084FB14; // type:func -func_80851FB0 = 0x8084FB40; // type:func -func_80852048 = 0x8084FBDC; // type:func -func_80852080 = 0x8084FC18; // type:func -func_808520BC = 0x8084FC58; // type:func -func_80852174 = 0x8084FD10; // type:func -func_808521B8 = 0x8084FD5C; // type:func -func_808521F4 = 0x8084FD9C; // type:func -func_80852234 = 0x8084FDDC; // type:func -func_8085225C = 0x8084FE08; // type:func -func_80852280 = 0x8084FE2C; // type:func -func_80852298 = 0x8084FE48; // type:func -func_80852328 = 0x8084FEDC; // type:func -func_80852358 = 0x8084FF0C; // type:func -func_80852388 = 0x8084FF3C; // type:func -func_80852414 = 0x8084FFCC; // type:func -func_80852450 = 0x8085000C; // type:func -func_80852480 = 0x8085003C; // type:func -func_808524B0 = 0x8085006C; // type:func -func_808524D0 = 0x80850090; // type:func -func_80852514 = 0x808500D8; // type:func -func_80852544 = 0x8085010C; // type:func -func_80852554 = 0x80850120; // type:func -func_80852564 = 0x80850134; // type:func -func_808525C0 = 0x80850198; // type:func -func_80852608 = 0x808501E4; // type:func -func_80852648 = 0x8085022C; // type:func -func_808526EC = 0x808502D4; // type:func -func_8085283C = 0x8085042C; // type:func -func_808528C8 = 0x808504BC; // type:func -func_80852944 = 0x8085053C; // type:func -func_808529D0 = 0x808505C8; // type:func -func_80852A54 = 0x80850650; // type:func -func_80852B4C = 0x80850748; // type:func -func_80852C0C = 0x80850808; // type:func -func_80852C50 = 0x8085084C; // type:func -Player_Action_CsAction = 0x80850A08; // type:func -Player_IsDroppingFish = 0x80850AB0; // type:func -Player_StartFishing = 0x80850AE4; // type:func -func_80852F38 = 0x80850B20; // type:func -Player_TryCsAction = 0x80850BEC; // type:func -func_80853080 = 0x80850C70; // type:func -Player_InflictDamage = 0x80850CCC; // type:func -func_80853148 = 0x80850D34; // type:func -EnTest_SetupAction = 0x8085D0E0; // type:func -EnTest_Init = 0x8085D0EC; // type:func -EnTest_Destroy = 0x8085D338; // type:func -EnTest_ChooseRandomAction = 0x8085D3D0; // type:func -EnTest_ChooseAction = 0x8085D54C; // type:func -EnTest_SetupWaitGround = 0x8085D86C; // type:func -EnTest_WaitGround = 0x8085D8E4; // type:func -EnTest_SetupWaitAbove = 0x8085D9C4; // type:func -EnTest_WaitAbove = 0x8085DA38; // type:func -EnTest_SetupIdle = 0x8085DB04; // type:func -EnTest_Idle = 0x8085DB88; // type:func -EnTest_Fall = 0x8085DDB8; // type:func -EnTest_Land = 0x8085DE6C; // type:func -EnTest_SetupWalkAndBlock = 0x8085DEDC; // type:func -EnTest_WalkAndBlock = 0x8085DFA0; // type:func -func_80860BDC = 0x8085E684; // type:func -func_80860C24 = 0x8085E6CC; // type:func -func_80860EC0 = 0x8085E968; // type:func -func_80860F84 = 0x8085EA2C; // type:func -EnTest_SetupSlashDown = 0x8085EEC0; // type:func -EnTest_SlashDown = 0x8085EF44; // type:func -EnTest_SetupSlashDownEnd = 0x8085F050; // type:func -EnTest_SlashDownEnd = 0x8085F0A0; // type:func -EnTest_SetupSlashUp = 0x8085F2CC; // type:func -EnTest_SlashUp = 0x8085F348; // type:func -EnTest_SetupJumpBack = 0x8085F400; // type:func -EnTest_JumpBack = 0x8085F4A0; // type:func -EnTest_SetupJumpslash = 0x8085F648; // type:func -EnTest_Jumpslash = 0x8085F6F4; // type:func -EnTest_SetupJumpUp = 0x8085F804; // type:func -EnTest_JumpUp = 0x8085F87C; // type:func -EnTest_SetupStopAndBlock = 0x8085F974; // type:func -EnTest_StopAndBlock = 0x8085FA34; // type:func -EnTest_SetupIdleFromBlock = 0x8085FB04; // type:func -EnTest_IdleFromBlock = 0x8085FB50; // type:func -func_80862154 = 0x8085FC08; // type:func -func_808621D4 = 0x8085FC88; // type:func -func_80862398 = 0x8085FE50; // type:func -func_80862418 = 0x8085FED0; // type:func -EnTest_SetupStunned = 0x80860034; // type:func -EnTest_Stunned = 0x80860110; // type:func -func_808627C4 = 0x80860288; // type:func -func_808628C8 = 0x8086038C; // type:func -func_80862DBC = 0x80860884; // type:func -func_80862E6C = 0x80860938; // type:func -func_80862FA8 = 0x80860A74; // type:func -func_80863044 = 0x80860B10; // type:func -func_808630F0 = 0x80860BBC; // type:func -func_8086318C = 0x80860C58; // type:func -EnTest_SetupRecoil = 0x80860D0C; // type:func -EnTest_Recoil = 0x80860D60; // type:func -EnTest_Rise = 0x80860E2C; // type:func -func_808633E8 = 0x80860EB4; // type:func -EnTest_UpdateHeadRot = 0x80860F30; // type:func -EnTest_UpdateDamage = 0x80860FC8; // type:func -EnTest_Update = 0x80861168; // type:func -EnTest_OverrideLimbDraw = 0x80861594; // type:func -EnTest_PostLimbDraw = 0x80861768; // type:func -EnTest_Draw = 0x80861AF0; // type:func -func_80864158 = 0x80861C04; // type:func -EnTest_ReactToProjectile = 0x80861C94; // type:func -ArmsHook_SetupAction = 0x80862990; // type:func -ArmsHook_Init = 0x8086299C; // type:func -ArmsHook_Destroy = 0x80862A10; // type:func -ArmsHook_Wait = 0x80862A58; // type:func -func_80865044 = 0x80862AD8; // type:func -ArmsHook_AttachToPlayer = 0x80862AEC; // type:func -ArmsHook_DetachHookFromActor = 0x80862B1C; // type:func -ArmsHook_CheckForCancel = 0x80862B44; // type:func -ArmsHook_AttachHookToActor = 0x80862BE0; // type:func -ArmsHook_Shoot = 0x80862C28; // type:func -ArmsHook_Update = 0x80863294; // type:func -ArmsHook_Draw = 0x808632D4; // type:func -ArrowFire_SetupAction = 0x80863700; // type:func -ArrowFire_Init = 0x8086370C; // type:func -ArrowFire_Destroy = 0x80863788; // type:func -ArrowFire_Charge = 0x808637AC; // type:func -func_80865ECC = 0x808638A0; // type:func -ArrowFire_Hit = 0x808638F8; // type:func -ArrowFire_Fly = 0x80863AC4; // type:func -ArrowFire_Update = 0x80863C18; // type:func -ArrowFire_Draw = 0x80863C6C; // type:func -ArrowIce_SetupAction = 0x808655E0; // type:func -ArrowIce_Init = 0x808655EC; // type:func -ArrowIce_Destroy = 0x80865668; // type:func -ArrowIce_Charge = 0x8086568C; // type:func -func_80867E8C = 0x80865780; // type:func -ArrowIce_Hit = 0x808657D8; // type:func -ArrowIce_Fly = 0x808659A4; // type:func -ArrowIce_Update = 0x80865AF8; // type:func -ArrowIce_Draw = 0x80865B4C; // type:func -ArrowLight_SetupAction = 0x808674E0; // type:func -ArrowLight_Init = 0x808674EC; // type:func -ArrowLight_Destroy = 0x80867568; // type:func -ArrowLight_Charge = 0x8086758C; // type:func -func_80869E6C = 0x80867680; // type:func -ArrowLight_Hit = 0x808676D8; // type:func -ArrowLight_Fly = 0x808678A4; // type:func -ArrowLight_Update = 0x808679F8; // type:func -ArrowLight_Draw = 0x80867A4C; // type:func -BgBdanObjects_GetProperty = 0x808693F0; // type:func -BgBdanObjects_SetProperty = 0x80869444; // type:func -BgBdanObjects_Init = 0x80869498; // type:func -BgBdanObjects_Destroy = 0x8086971C; // type:func -BgBdanObjects_OctoPlatform_WaitForRutoToStartCutscene = 0x8086976C; // type:func -BgBdanObjects_OctoPlatform_RaiseToUpperPosition = 0x808698C0; // type:func -BgBdanObjects_OctoPlatform_WaitForRutoToAdvanceCutscene = 0x808699BC; // type:func -BgBdanObjects_OctoPlatform_DescendWithBigOcto = 0x80869AF8; // type:func -BgBdanObjects_OctoPlatform_PauseBeforeDescending = 0x80869C7C; // type:func -BgBdanObjects_OctoPlatform_WaitForBigOctoToStartBattle = 0x80869CE0; // type:func -BgBdanObjects_OctoPlatform_BattleInProgress = 0x80869D3C; // type:func -BgBdanObjects_SinkToFloorHeight = 0x80869E14; // type:func -BgBdanObjects_WaitForPlayerInRange = 0x80869E94; // type:func -BgBdanObjects_RaiseToUpperPosition = 0x80869F00; // type:func -BgBdanObjects_DoNothing = 0x80869F98; // type:func -BgBdanObjects_ElevatorOscillate = 0x80869FA8; // type:func -BgBdanObjects_WaitForSwitch = 0x8086A0DC; // type:func -BgBdanObjects_ChangeWaterBoxLevel = 0x8086A128; // type:func -BgBdanObjects_WaitForTimerExpired = 0x8086A1F0; // type:func -BgBdanObjects_WaitForPlayerOnTop = 0x8086A244; // type:func -BgBdanObjects_FallToLowerPos = 0x8086A2C8; // type:func -BgBdanObjects_Update = 0x8086A384; // type:func -BgBdanObjects_Draw = 0x8086A3C0; // type:func -BgBdanSwitch_InitDynaPoly = 0x8086A6C0; // type:func -BgBdanSwitch_InitCollision = 0x8086A718; // type:func -func_8086D0EC = 0x8086A76C; // type:func -BgBdanSwitch_Init = 0x8086A8D8; // type:func -BgBdanSwitch_Destroy = 0x8086AA94; // type:func -func_8086D4B4 = 0x8086AB00; // type:func -func_8086D548 = 0x8086AB94; // type:func -func_8086D5C4 = 0x8086AC10; // type:func -func_8086D5E0 = 0x8086AC30; // type:func -func_8086D67C = 0x8086ACCC; // type:func -func_8086D694 = 0x8086ACE8; // type:func -func_8086D730 = 0x8086AD88; // type:func -func_8086D754 = 0x8086ADB0; // type:func -func_8086D7FC = 0x8086AE58; // type:func -func_8086D80C = 0x8086AE6C; // type:func -func_8086D86C = 0x8086AECC; // type:func -func_8086D888 = 0x8086AEEC; // type:func -func_8086D8BC = 0x8086AF24; // type:func -func_8086D8CC = 0x8086AF38; // type:func -func_8086D944 = 0x8086AFB0; // type:func -func_8086D95C = 0x8086AFCC; // type:func -func_8086D9F8 = 0x8086B06C; // type:func -func_8086DA1C = 0x8086B094; // type:func -func_8086DAB4 = 0x8086B130; // type:func -func_8086DAC4 = 0x8086B144; // type:func -func_8086DB24 = 0x8086B1A4; // type:func -func_8086DB40 = 0x8086B1C4; // type:func -func_8086DB4C = 0x8086B1D4; // type:func -func_8086DB68 = 0x8086B1F4; // type:func -func_8086DC30 = 0x8086B2BC; // type:func -func_8086DC48 = 0x8086B2D8; // type:func -func_8086DCCC = 0x8086B35C; // type:func -func_8086DCE8 = 0x8086B37C; // type:func -func_8086DDA8 = 0x8086B43C; // type:func -func_8086DDC0 = 0x8086B458; // type:func -BgBdanSwitch_Update = 0x8086B4EC; // type:func -func_8086DF58 = 0x8086B5F0; // type:func -BgBdanSwitch_Draw = 0x8086B660; // type:func -BgBomGuard_SetupAction = 0x8086BAF0; // type:func -BgBomGuard_Init = 0x8086BAFC; // type:func -BgBomGuard_Destroy = 0x8086BB98; // type:func -func_8086E638 = 0x8086BBCC; // type:func -BgBomGuard_Update = 0x8086BC98; // type:func -BgBombwall_InitDynapoly = 0x8086BD10; // type:func -BgBombwall_RotateVec = 0x8086BD68; // type:func -BgBombwall_Init = 0x8086BDBC; // type:func -BgBombwall_DestroyCollision = 0x8086BFCC; // type:func -BgBombwall_Destroy = 0x8086C048; // type:func -func_8086EB5C = 0x8086C068; // type:func -func_8086ED50 = 0x8086C25C; // type:func -func_8086ED70 = 0x8086C280; // type:func -func_8086EDFC = 0x8086C310; // type:func -func_8086EE40 = 0x8086C354; // type:func -func_8086EE94 = 0x8086C3A8; // type:func -BgBombwall_Update = 0x8086C3D8; // type:func -BgBombwall_Draw = 0x8086C404; // type:func -BgBowlWall_Init = 0x8086C5D0; // type:func -BgBowlWall_Destroy = 0x8086C688; // type:func -BgBowlWall_SpawnBullseyes = 0x8086C6BC; // type:func -BgBowlWall_WaitForHit = 0x8086C88C; // type:func -BgBowlWall_FallDoEffects = 0x8086C8B0; // type:func -BgBowlWall_FinishFall = 0x8086CB64; // type:func -BgBowlWall_Reset = 0x8086CC44; // type:func -BgBowlWall_Update = 0x8086CCDC; // type:func -BgBowlWall_Draw = 0x8086CD10; // type:func -BgBreakwall_SetupAction = 0x8086CF50; // type:func -BgBreakwall_Init = 0x8086CF5C; // type:func -BgBreakwall_Destroy = 0x8086D108; // type:func -BgBreakwall_SpawnFragments = 0x8086D13C; // type:func -BgBreakwall_WaitForObject = 0x8086D60C; // type:func -BgBreakwall_Wait = 0x8086D714; // type:func -BgBreakwall_LavaCoverMove = 0x8086D8E4; // type:func -BgBreakwall_Update = 0x8086D938; // type:func -BgBreakwall_Draw = 0x8086D95C; // type:func -BgDdanJd_Init = 0x8086DDC0; // type:func -BgDdanJd_Destroy = 0x8086DE6C; // type:func -BgDdanJd_Idle = 0x8086DEA0; // type:func -BgDdanJd_MoveEffects = 0x8086E044; // type:func -BgDdanJd_Move = 0x8086E21C; // type:func -BgDdanJd_Update = 0x8086E320; // type:func -BgDdanJd_Draw = 0x8086E344; // type:func -BgDdanKd_SetupAction = 0x8086E410; // type:func -BgDdanKd_Init = 0x8086E41C; // type:func -BgDdanKd_Destroy = 0x8086E514; // type:func -BgDdanKd_CheckForExplosions = 0x8086E55C; // type:func -BgDdanKd_LowerStairs = 0x8086E674; // type:func -BgDdanKd_DoNothing = 0x8086EB48; // type:func -BgDdanKd_Update = 0x8086EB58; // type:func -BgDdanKd_Draw = 0x8086EB7C; // type:func -BgDodoago_SetupAction = 0x8086ED00; // type:func -BgDodoago_SpawnSparkles = 0x8086ED0C; // type:func -BgDodoago_Init = 0x8086EE2C; // type:func -BgDodoago_Destroy = 0x8086EF90; // type:func -BgDodoago_WaitExplosives = 0x8086EFFC; // type:func -BgDodoago_OpenJaw = 0x8086F2C0; // type:func -BgDodoago_DoNothing = 0x8086F584; // type:func -BgDodoago_LightOneEye = 0x8086F594; // type:func -BgDodoago_Update = 0x8086F5F8; // type:func -BgDodoago_Draw = 0x8086F750; // type:func -BgDyYoseizo_Init = 0x8086FAB0; // type:func -BgDyYoseizo_Destroy = 0x8086FBB4; // type:func -BgDyYoseizo_SpawnEffects = 0x8086FBC4; // type:func -BgDyYoseizo_Bob = 0x8086FEC0; // type:func -BgDyYoseizo_CheckMagicAcquired = 0x8086FF88; // type:func -BgDyYoseizo_ChooseType = 0x8087004C; // type:func -BgDyYoseizo_SetupSpinGrow_NoReward = 0x80870448; // type:func -BgDyYoseizo_SpinGrow_NoReward = 0x80870544; // type:func -BgDyYoseizo_CompleteSpinGrow_NoReward = 0x808706A0; // type:func -BgDyYoseizo_SetupGreetPlayer_NoReward = 0x80870750; // type:func -BgDyYoseizo_GreetPlayer_NoReward = 0x80870868; // type:func -BgDyYoseizo_SetupHealPlayer_NoReward = 0x80870944; // type:func -BgDyYoseizo_HealPlayer_NoReward = 0x80870A30; // type:func -BgDyYoseizo_SayFarewell_NoReward = 0x80870D08; // type:func -BgDyYoseizo_SetupSpinShrink = 0x80870DE4; // type:func -BgDyYoseizo_SpinShrink = 0x80870EE8; // type:func -BgDyYoseizo_Vanish = 0x80870FD8; // type:func -BgDyYoseizo_SetupSpinGrow_Reward = 0x8087107C; // type:func -BgDyYoseizo_SpinGrowSetupGive_Reward = 0x808711B0; // type:func -BgDyYoseizo_Give_Reward = 0x808714DC; // type:func -BgDyYoseizo_Update = 0x80871B2C; // type:func -BgDyYoseizo_OverrideLimbDraw = 0x80871D58; // type:func -BgDyYoseizo_Draw = 0x80871DC0; // type:func -BgDyYoseizo_SpawnEffect = 0x80871F48; // type:func -BgDyYoseizo_UpdateEffects = 0x80872058; // type:func -BgDyYoseizo_DrawEffects = 0x8087234C; // type:func -BgGanonOtyuka_Init = 0x808728A0; // type:func -BgGanonOtyuka_Destroy = 0x8087293C; // type:func -BgGanonOtyuka_WaitToFall = 0x80872970; // type:func -BgGanonOtyuka_Fall = 0x80872BC0; // type:func -BgGanonOtyuka_DoNothing = 0x80873000; // type:func -BgGanonOtyuka_Update = 0x80873010; // type:func -BgGanonOtyuka_Draw = 0x80873058; // type:func -BgGateShutter_Init = 0x80874EE0; // type:func -BgGateShutter_Destroy = 0x80874FC8; // type:func -func_8087828C = 0x80874FFC; // type:func -func_80878300 = 0x80875070; // type:func -func_808783AC = 0x80875120; // type:func -func_808783D4 = 0x80875148; // type:func -BgGateShutter_Update = 0x80875204; // type:func -BgGateShutter_Draw = 0x80875238; // type:func -BgGjyoBridge_Init = 0x80875370; // type:func -BgGjyoBridge_Destroy = 0x80875428; // type:func -func_808787A4 = 0x8087545C; // type:func -BgGjyoBridge_TriggerCutscene = 0x8087546C; // type:func -BgGjyoBridge_SpawnBridge = 0x808755C4; // type:func -BgGjyoBridge_Update = 0x80875640; // type:func -BgGjyoBridge_Draw = 0x80875664; // type:func -BgGndDarkmeiro_ToggleBlock = 0x80875860; // type:func -BgGndDarkmeiro_Init = 0x808758EC; // type:func -BgGndDarkmeiro_Destroy = 0x80875B18; // type:func -BgGndDarkmeiro_Noop = 0x80875B60; // type:func -BgGndDarkmeiro_UpdateBlockTimer = 0x80875B70; // type:func -BgGndDarkmeiro_UpdateStaticBlock = 0x80875D64; // type:func -BgGndDarkmeiro_UpdateSwitchBlock = 0x80875D74; // type:func -BgGndDarkmeiro_Update = 0x80875DD8; // type:func -BgGndDarkmeiro_DrawInvisiblePath = 0x80875DFC; // type:func -BgGndDarkmeiro_DrawSwitchBlock = 0x80875E2C; // type:func -BgGndDarkmeiro_DrawStaticBlock = 0x80875F44; // type:func -BgGndFiremeiro_Init = 0x80876020; // type:func -BgGndFiremeiro_Destroy = 0x808760D4; // type:func -BgGndFiremeiro_Sink = 0x80876114; // type:func -BgGndFiremeiro_Shake = 0x808761D0; // type:func -BgGndFiremeiro_Rise = 0x80876374; // type:func -BgGndFiremeiro_Update = 0x80876434; // type:func -BgGndFiremeiro_Draw = 0x80876458; // type:func -BgGndIceblock_Init = 0x80876570; // type:func -BgGndIceblock_Destroy = 0x8087665C; // type:func -BgGndIceblock_SetPosition = 0x80876690; // type:func -BgGndIceblock_CheckForBlock = 0x8087679C; // type:func -BgGndIceblock_NextAction = 0x808767D8; // type:func -BgGndIceblock_SetNextPosition = 0x80876824; // type:func -BgGndIceblock_Idle = 0x80876B54; // type:func -BgGndIceblock_Reset = 0x80876C10; // type:func -BgGndIceblock_Fall = 0x80876CD4; // type:func -BgGndIceblock_Hole = 0x80876D8C; // type:func -BgGndIceblock_Slide = 0x80876E28; // type:func -BgGndIceblock_Update = 0x80877158; // type:func -BgGndIceblock_Draw = 0x8087717C; // type:func -BgGndNisekabe_Init = 0x80877670; // type:func -BgGndNisekabe_Destroy = 0x808776AC; // type:func -BgGndNisekabe_Update = 0x808776BC; // type:func -BgGndNisekabe_Draw = 0x808776F0; // type:func -BgGndSoulmeiro_Init = 0x808777E0; // type:func -BgGndSoulmeiro_Destroy = 0x80877924; // type:func -func_8087AF38 = 0x80877960; // type:func -func_8087B284 = 0x80877CAC; // type:func -func_8087B350 = 0x80877D78; // type:func -BgGndSoulmeiro_Update = 0x80877DCC; // type:func -BgGndSoulmeiro_Draw = 0x80877DF8; // type:func -BgHaka_Init = 0x80878040; // type:func -BgHaka_Destroy = 0x808780BC; // type:func -func_8087B758 = 0x808780F0; // type:func -func_8087B7E8 = 0x80878180; // type:func -func_8087B938 = 0x808782D4; // type:func -func_8087BAAC = 0x8087844C; // type:func -func_8087BAE4 = 0x80878488; // type:func -BgHaka_Update = 0x80878500; // type:func -BgHaka_Draw = 0x80878524; // type:func -BgHakaGate_Init = 0x80878700; // type:func -BgHakaGate_Destroy = 0x808789D0; // type:func -BgHakaGate_DoNothing = 0x80878A2C; // type:func -BgHakaGate_StatueInactive = 0x80878A3C; // type:func -BgHakaGate_StatueIdle = 0x80878A78; // type:func -BgHakaGate_StatueTurn = 0x80878B90; // type:func -BgHakaGate_FloorClosed = 0x80878D74; // type:func -BgHakaGate_FloorOpen = 0x80878EFC; // type:func -BgHakaGate_GateWait = 0x80878F88; // type:func -BgHakaGate_GateOpen = 0x80878FD8; // type:func -BgHakaGate_SkullOfTruth = 0x80879068; // type:func -BgHakaGate_FalseSkull = 0x808790C4; // type:func -BgHakaGate_Update = 0x80879144; // type:func -BgHakaGate_DrawFlame = 0x8087918C; // type:func -BgHakaGate_Draw = 0x80879364; // type:func -BgHakaHuta_Init = 0x808797A0; // type:func -BgHakaHuta_Destroy = 0x80879860; // type:func -BgHakaHuta_SpawnDust = 0x80879894; // type:func -BgHakaHuta_PlaySfx = 0x80879A50; // type:func -BgHakaHuta_SpawnEnemies = 0x80879ADC; // type:func -BgHakaHuta_Open = 0x80879DA4; // type:func -BgHakaHuta_SlideOpen = 0x80879E58; // type:func -func_8087D720 = 0x80879F0C; // type:func -BgHakaHuta_DoNothing = 0x8087A0B0; // type:func -BgHakaHuta_Update = 0x8087A0C0; // type:func -BgHakaHuta_Draw = 0x8087A0E4; // type:func -BgHakaMegane_Init = 0x8087A240; // type:func -BgHakaMegane_Destroy = 0x8087A2F8; // type:func -func_8087DB24 = 0x8087A32C; // type:func -func_8087DBF0 = 0x8087A3FC; // type:func -BgHakaMegane_DoNothing = 0x8087A470; // type:func -BgHakaMegane_Update = 0x8087A480; // type:func -BgHakaMegane_Draw = 0x8087A4A4; // type:func -BgHakaMeganeBG_Init = 0x8087A640; // type:func -BgHakaMeganeBG_Destroy = 0x8087A7DC; // type:func -func_8087DFF8 = 0x8087A810; // type:func -func_8087E040 = 0x8087A858; // type:func -func_8087E10C = 0x8087A924; // type:func -func_8087E1E0 = 0x8087A9F8; // type:func -func_8087E258 = 0x8087AA70; // type:func -func_8087E288 = 0x8087AAA0; // type:func -func_8087E2D8 = 0x8087AAF0; // type:func -func_8087E34C = 0x8087AB64; // type:func -BgHakaMeganeBG_Update = 0x8087AB74; // type:func -BgHakaMeganeBG_Draw = 0x8087AB98; // type:func -BgHakaSgami_Init = 0x8087AD00; // type:func -BgHakaSgami_Destroy = 0x8087AFA8; // type:func -BgHakaSgami_SetupSpin = 0x8087B008; // type:func -BgHakaSgami_Spin = 0x8087B080; // type:func -BgHakaSgami_Update = 0x8087B594; // type:func -BgHakaSgami_Draw = 0x8087B5E8; // type:func -BgHakaShip_Init = 0x8087B920; // type:func -BgHakaShip_Destroy = 0x8087BA64; // type:func -BgHakaShip_ChildUpdatePosition = 0x8087BAA4; // type:func -BgHakaShip_WaitForSong = 0x8087BB00; // type:func -BgHakaShip_CutsceneStationary = 0x8087BB78; // type:func -BgHakaShip_Move = 0x8087BC14; // type:func -BgHakaShip_SetupCrash = 0x8087BDD8; // type:func -BgHakaShip_CrashShake = 0x8087BE34; // type:func -BgHakaShip_CrashFall = 0x8087BEC4; // type:func -BgHakaShip_Update = 0x8087BF84; // type:func -BgHakaShip_Draw = 0x8087BFC4; // type:func -BgHakaTrap_Init = 0x8087C370; // type:func -BgHakaTrap_Destroy = 0x8087C610; // type:func -func_8087FFC0 = 0x8087C694; // type:func -func_808801B8 = 0x8087C894; // type:func -func_808802D8 = 0x8087C9B8; // type:func -func_80880484 = 0x8087CB64; // type:func -func_808805C0 = 0x8087CCA0; // type:func -func_808806BC = 0x8087CD9C; // type:func -func_808808F4 = 0x8087CFD4; // type:func -func_808809B0 = 0x8087D094; // type:func -func_808809E4 = 0x8087D0C8; // type:func -func_80880AE8 = 0x8087D1D4; // type:func -func_80880C0C = 0x8087D2F8; // type:func -BgHakaTrap_Update = 0x8087D36C; // type:func -func_80880D68 = 0x8087D45C; // type:func -BgHakaTrap_Draw = 0x8087D4F8; // type:func -BgHakaTubo_Init = 0x8087D940; // type:func -BgHakaTubo_Destroy = 0x8087DA3C; // type:func -BgHakaTubo_Idle = 0x8087DA94; // type:func -BgHakaTubo_DropCollectible = 0x8087DD00; // type:func -BgHakaTubo_Update = 0x8087DFC4; // type:func -BgHakaTubo_DrawFlameCircle = 0x8087DFF8; // type:func -BgHakaTubo_Draw = 0x8087E1A4; // type:func -BgHakaWater_Init = 0x8087E360; // type:func -BgHakaWater_Destroy = 0x8087E3EC; // type:func -BgHakaWater_LowerWater = 0x8087E3FC; // type:func -BgHakaWater_Wait = 0x8087E544; // type:func -BgHakaWater_ChangeWaterLevel = 0x8087E600; // type:func -BgHakaWater_Update = 0x8087E708; // type:func -BgHakaWater_Draw = 0x8087E72C; // type:func -BgHakaZou_Init = 0x8087EB60; // type:func -BgHakaZou_Destroy = 0x8087EE48; // type:func -func_808828F4 = 0x8087EE98; // type:func -BgHakaZou_Wait = 0x8087F014; // type:func -func_80882BDC = 0x8087F184; // type:func -func_80882CC4 = 0x8087F26C; // type:func -func_80882E54 = 0x8087F3FC; // type:func -func_80883000 = 0x8087F5AC; // type:func -func_80883104 = 0x8087F6B0; // type:func -func_80883144 = 0x8087F6F0; // type:func -func_80883254 = 0x8087F800; // type:func -func_80883328 = 0x8087F8D8; // type:func -func_808834D8 = 0x8087FA88; // type:func -BgHakaZou_DoNothing = 0x8087FB18; // type:func -BgHakaZou_Update = 0x8087FB28; // type:func -BgHakaZou_Draw = 0x8087FB6C; // type:func -BgHeavyBlock_SetPieceRandRot = 0x8087FD50; // type:func -BgHeavyBlock_InitPiece = 0x8087FDE0; // type:func -BgHeavyBlock_SetupDynapoly = 0x8087FF5C; // type:func -BgHeavyBlock_Init = 0x8087FFD0; // type:func -BgHeavyBlock_Destroy = 0x80880214; // type:func -BgHeavyBlock_MovePiece = 0x8088025C; // type:func -BgHeavyBlock_SpawnDust = 0x80880420; // type:func -BgHeavyBlock_SpawnPieces = 0x80880784; // type:func -BgHeavyBlock_Wait = 0x8088097C; // type:func -BgHeavyBlock_LiftedUp = 0x80880AA4; // type:func -BgHeavyBlock_Fly = 0x80880C0C; // type:func -BgHeavyBlock_DoNothing = 0x80880F24; // type:func -BgHeavyBlock_Land = 0x80880F34; // type:func -BgHeavyBlock_Update = 0x808811A4; // type:func -BgHeavyBlock_Draw = 0x808811C8; // type:func -BgHeavyBlock_DrawPiece = 0x80881330; // type:func -BgHidanCurtain_Init = 0x80881640; // type:func -BgHidanCurtain_Destroy = 0x80881854; // type:func -BgHidanCurtain_WaitForSwitchOn = 0x80881880; // type:func -BgHidanCurtain_WaitForCutscene = 0x80881934; // type:func -BgHidanCurtain_WaitForClear = 0x80881960; // type:func -BgHidanCurtain_WaitForSwitchOff = 0x808819A4; // type:func -BgHidanCurtain_TurnOn = 0x808819E8; // type:func -BgHidanCurtain_TurnOff = 0x80881A5C; // type:func -BgHidanCurtain_WaitForTimer = 0x80881B4C; // type:func -BgHidanCurtain_Update = 0x80881BB0; // type:func -BgHidanCurtain_Draw = 0x80881E44; // type:func -BgHidanDalm_Init = 0x808820E0; // type:func -BgHidanDalm_Destroy = 0x808821C8; // type:func -BgHidanDalm_Wait = 0x80882210; // type:func -BgHidanDalm_Shrink = 0x80882394; // type:func -BgHidanDalm_Update = 0x80882544; // type:func -BgHidanDalm_UpdateCollider = 0x808825A4; // type:func -BgHidanDalm_Draw = 0x808826D0; // type:func -BgHidanFirewall_Init = 0x80882930; // type:func -BgHidanFirewall_Destroy = 0x808829D0; // type:func -BgHidanFirewall_CheckProximity = 0x808829FC; // type:func -BgHidanFirewall_Wait = 0x80882A6C; // type:func -BgHidanFirewall_Countdown = 0x80882AB4; // type:func -BgHidanFirewall_Erupt = 0x80882AE8; // type:func -BgHidanFirewall_Collide = 0x80882B78; // type:func -BgHidanFirewall_ColliderFollowPlayer = 0x80882BE0; // type:func -BgHidanFirewall_Update = 0x80882D44; // type:func -BgHidanFirewall_Draw = 0x80882E1C; // type:func -BgHidanFslift_Init = 0x80883090; // type:func -BgHidanFslift_SetHookshotTargetPos = 0x80883178; // type:func -BgHidanFslift_Destroy = 0x808831D8; // type:func -BgHidanFslift_SetupIdle = 0x8088320C; // type:func -BgHidanFslift_Idle = 0x80883228; // type:func -BgHidanFslift_Descend = 0x808832C8; // type:func -BgHidanFslift_Ascend = 0x80883334; // type:func -BgHidanFslift_Update = 0x808833D0; // type:func -BgHidanFslift_Draw = 0x80883478; // type:func -BgHidanFwbig_Init = 0x80883560; // type:func -BgHidanFwbig_Destroy = 0x80883700; // type:func -BgHidanFwbig_UpdatePosition = 0x8088372C; // type:func -BgHidanFwbig_WaitForSwitch = 0x808837AC; // type:func -BgHidanFwbig_WaitForCs = 0x80883810; // type:func -BgHidanFwbig_Rise = 0x8088383C; // type:func -BgHidanFwbig_Lower = 0x808838B0; // type:func -BgHidanFwbig_WaitForTimer = 0x80883990; // type:func -BgHidanFwbig_WaitForPlayer = 0x808839E0; // type:func -BgHidanFwbig_Move = 0x80883A44; // type:func -BgHidanFwbig_MoveCollider = 0x80883AE4; // type:func -BgHidanFwbig_Update = 0x80883CE4; // type:func -BgHidanFwbig_Draw = 0x80883E5C; // type:func -BgHidanHamstep_SetupAction = 0x80884240; // type:func -BgHidanHamstep_SpawnChildren = 0x80884260; // type:func -BgHidanHamstep_Init = 0x808843DC; // type:func -BgHidanHamstep_Destroy = 0x8088464C; // type:func -func_808884C8 = 0x808846A0; // type:func -func_80888638 = 0x80884810; // type:func -func_80888694 = 0x8088486C; // type:func -func_80888734 = 0x8088490C; // type:func -func_808887C4 = 0x808849A0; // type:func -func_80888860 = 0x80884A3C; // type:func -func_808889B8 = 0x80884B88; // type:func -func_80888A58 = 0x80884C28; // type:func -BgHidanHamstep_DoNothing = 0x80884DC0; // type:func -BgHidanHamstep_Update = 0x80884DD0; // type:func -BgHidanHamstep_Draw = 0x80884DF4; // type:func -BgHidanHrock_Init = 0x808850F0; // type:func -BgHidanHrock_Destroy = 0x80885420; // type:func -func_808894A4 = 0x80885468; // type:func -func_808894B0 = 0x80885478; // type:func -func_8088960C = 0x808855D4; // type:func -func_808896B8 = 0x80885680; // type:func -BgHidanHrock_Update = 0x80885760; // type:func -BgHidanHrock_Draw = 0x80885784; // type:func -BgHidanKousi_SetupAction = 0x80885920; // type:func -BgHidanKousi_Init = 0x8088592C; // type:func -BgHidanKousi_Destroy = 0x80885A24; // type:func -func_80889ACC = 0x80885A58; // type:func -func_80889B5C = 0x80885AE4; // type:func -func_80889BC0 = 0x80885B48; // type:func -func_80889C18 = 0x80885BA0; // type:func -func_80889C90 = 0x80885C18; // type:func -func_80889D28 = 0x80885CB4; // type:func -BgHidanKousi_Update = 0x80885CC4; // type:func -BgHidanKousi_Draw = 0x80885CE8; // type:func -BgHidanKowarerukabe_InitDynaPoly = 0x80885EB0; // type:func -BgHidanKowarerukabe_InitColliderSphere = 0x80885F4C; // type:func -BgHidanKowarerukabe_OffsetActorYPos = 0x80885FE0; // type:func -BgHidanKowarerukabe_Init = 0x8088600C; // type:func -BgHidanKowarerukabe_Destroy = 0x808860BC; // type:func -BgHidanKowarerukabe_SpawnDust = 0x80886104; // type:func -BgHidanKowarerukabe_FloorBreak = 0x80886228; // type:func -func_8088A67C = 0x808864F4; // type:func -BgHidanKowarerukabe_LargeWallBreak = 0x8088678C; // type:func -BgHidanKowarerukabe_Break = 0x80886A18; // type:func -BgHidanKowarerukabe_Update = 0x80886AA8; // type:func -BgHidanKowarerukabe_Draw = 0x80886B78; // type:func -BgHidanRock_Init = 0x80886D90; // type:func -BgHidanRock_Destroy = 0x80886F0C; // type:func -func_8088B24C = 0x80886F60; // type:func -func_8088B268 = 0x80886F80; // type:func -func_8088B5F4 = 0x80887310; // type:func -func_8088B634 = 0x80887350; // type:func -func_8088B69C = 0x808873BC; // type:func -func_8088B79C = 0x808874BC; // type:func -func_8088B90C = 0x8088762C; // type:func -func_8088B954 = 0x80887674; // type:func -func_8088B990 = 0x808876B0; // type:func -BgHidanRock_Update = 0x8088789C; // type:func -func_8088BC40 = 0x8088796C; // type:func -BgHidanRock_Draw = 0x80887B7C; // type:func -BgHidanRsekizou_Init = 0x80887E90; // type:func -BgHidanRsekizou_Destroy = 0x80887F94; // type:func -BgHidanRsekizou_Update = 0x80887FDC; // type:func -BgHidanRsekizou_DrawFireball = 0x808883A0; // type:func -BgHidanRsekizou_Draw = 0x808886B8; // type:func -func_8088CEC0 = 0x80888A70; // type:func -BgHidanSekizou_Init = 0x80888E2C; // type:func -BgHidanSekizou_Destroy = 0x80888FA0; // type:func -func_8088D434 = 0x80888FE8; // type:func -func_8088D720 = 0x808892D4; // type:func -func_8088D750 = 0x80889304; // type:func -BgHidanSekizou_Update = 0x80889470; // type:func -func_8088D9F4 = 0x808895AC; // type:func -func_8088DC50 = 0x808897F4; // type:func -func_8088DE08 = 0x808899AC; // type:func -BgHidanSekizou_Draw = 0x80889A8C; // type:func -BgHidanSima_Init = 0x80889EC0; // type:func -BgHidanSima_Destroy = 0x80889FC4; // type:func -func_8088E518 = 0x8088A00C; // type:func -func_8088E5D0 = 0x8088A0C8; // type:func -func_8088E6D0 = 0x8088A1CC; // type:func -func_8088E760 = 0x8088A264; // type:func -func_8088E7A8 = 0x8088A2AC; // type:func -func_8088E90C = 0x8088A410; // type:func -BgHidanSima_Update = 0x8088A570; // type:func -func_8088EB54 = 0x8088A660; // type:func -BgHidanSima_Draw = 0x8088AAD8; // type:func -BgHidanSyoku_Init = 0x8088ADC0; // type:func -BgHidanSyoku_Destroy = 0x8088AE4C; // type:func -func_8088F47C = 0x8088AE80; // type:func -func_8088F4B8 = 0x8088AEBC; // type:func -func_8088F514 = 0x8088AF1C; // type:func -func_8088F5A0 = 0x8088AFA8; // type:func -func_8088F62C = 0x8088B034; // type:func -BgHidanSyoku_Update = 0x8088B090; // type:func -BgHidanSyoku_Draw = 0x8088B138; // type:func -BgIceObjects_Init = 0x8088B220; // type:func -BgIceObjects_Destroy = 0x8088B2AC; // type:func -BgIceObjects_SetNextTarget = 0x8088B2E0; // type:func -BgIceObjects_CheckPits = 0x8088B760; // type:func -BgIceObjects_Idle = 0x8088B8E8; // type:func -BgIceObjects_Slide = 0x8088B9EC; // type:func -BgIceObjects_Reset = 0x8088BD7C; // type:func -BgIceObjects_Stuck = 0x8088BE18; // type:func -BgIceObjects_Update = 0x8088BE54; // type:func -BgIceObjects_Draw = 0x8088BE78; // type:func -BgIceShelter_InitColliders = 0x8088C160; // type:func -BgIceShelter_InitDynaPoly = 0x8088C294; // type:func -BgIceShelter_RotateY = 0x8088C2EC; // type:func -BgIceShelter_Init = 0x8088C36C; // type:func -BgIceShelter_Destroy = 0x8088C4E8; // type:func -BgIceShelter_SpawnSteamAround = 0x8088C574; // type:func -BgIceShelter_SpawnSteamAlong = 0x8088C7E8; // type:func -BgIceShelter_SetupIdle = 0x8088CA4C; // type:func -BgIceShelter_Idle = 0x8088CA68; // type:func -BgIceShelter_SetupMelt = 0x8088CBA8; // type:func -BgIceShelter_Melt = 0x8088CBC4; // type:func -BgIceShelter_Update = 0x8088CD88; // type:func -BgIceShelter_Draw = 0x8088CDAC; // type:func -func_80891AC0 = 0x8088D3A0; // type:func -BgIceShutter_Init = 0x8088D428; // type:func -BgIceShutter_Destroy = 0x8088D5A8; // type:func -func_80891CF4 = 0x8088D5DC; // type:func -func_80891D6C = 0x8088D654; // type:func -func_80891DD4 = 0x8088D6BC; // type:func -BgIceShutter_Update = 0x8088D724; // type:func -BgIceShutter_Draw = 0x8088D748; // type:func -BgIceTurara_Init = 0x8088D810; // type:func -BgIceTurara_Destroy = 0x8088D8EC; // type:func -BgIceTurara_Break = 0x8088D934; // type:func -BgIceTurara_Stalagmite = 0x8088DB14; // type:func -BgIceTurara_Wait = 0x8088DB7C; // type:func -BgIceTurara_Shiver = 0x8088DBB4; // type:func -BgIceTurara_Fall = 0x8088DD20; // type:func -BgIceTurara_Regrow = 0x8088DE78; // type:func -BgIceTurara_Update = 0x8088DEC8; // type:func -BgIceTurara_Draw = 0x8088DEEC; // type:func -BgInGate_SetupAction = 0x8088E040; // type:func -BgInGate_Init = 0x8088E04C; // type:func -BgInGate_Destroy = 0x8088E168; // type:func -func_80892890 = 0x8088E19C; // type:func -BgInGate_DoNothing = 0x8088E29C; // type:func -BgInGate_Update = 0x8088E2AC; // type:func -BgInGate_Draw = 0x8088E2D0; // type:func -BgJya1flift_InitDynapoly = 0x8088E3D0; // type:func -BgJya1flift_InitCollision = 0x8088E428; // type:func -BgJya1flift_Init = 0x8088E47C; // type:func -BgJya1flift_Destroy = 0x8088E574; // type:func -BgJya1flift_SetupWaitForSwitch = 0x8088E5CC; // type:func -BgJya1flift_WaitForSwitch = 0x8088E5EC; // type:func -BgJya1flift_SetupDoNothing = 0x8088E630; // type:func -BgJya1flift_DoNothing = 0x8088E650; // type:func -BgJya1flift_ChangeDirection = 0x8088E660; // type:func -BgJya1flift_Move = 0x8088E688; // type:func -BgJya1flift_ResetMoveDelay = 0x8088E76C; // type:func -BgJya1flift_DelayMove = 0x8088E784; // type:func -BgJya1flift_Update = 0x8088E7C4; // type:func -BgJya1flift_Draw = 0x8088E8E0; // type:func -BgJyaAmishutter_InitDynaPoly = 0x8088EA60; // type:func -BgJyaAmishutter_Init = 0x8088EAB8; // type:func -BgJyaAmishutter_Destroy = 0x8088EB00; // type:func -BgJyaAmishutter_SetupWaitForPlayer = 0x8088EB34; // type:func -BgJyaAmishutter_WaitForPlayer = 0x8088EB48; // type:func -func_80893428 = 0x8088EBA4; // type:func -func_80893438 = 0x8088EBB8; // type:func -func_808934B0 = 0x8088EC30; // type:func -func_808934C0 = 0x8088EC44; // type:func -func_808934FC = 0x8088EC80; // type:func -func_8089350C = 0x8088EC94; // type:func -BgJyaAmishutter_Update = 0x8088ECF8; // type:func -BgJyaAmishutter_Draw = 0x8088ED20; // type:func -BgJyaBigmirror_SetRoomFlag = 0x8088EDF0; // type:func -BgJyaBigmirror_HandleCobra = 0x8088EE60; // type:func -BgJyaBigmirror_SetBombiwaFlag = 0x8088EFF8; // type:func -BgJyaBigmirror_HandleMirRay = 0x8088F04C; // type:func -BgJyaBigmirror_Init = 0x8088F1F4; // type:func -BgJyaBigmirror_Destroy = 0x8088F278; // type:func -BgJyaBigmirror_Update = 0x8088F298; // type:func -BgJyaBigmirror_DrawLightBeam = 0x8088F2E8; // type:func -BgJyaBigmirror_Draw = 0x8088F474; // type:func -BgJyaBlock_Init = 0x8088F640; // type:func -BgJyaBlock_Destroy = 0x8088F6F8; // type:func -BgJyaBlock_Update = 0x8088F72C; // type:func -BgJyaBlock_Draw = 0x8088F750; // type:func -BgJyaBombchuiwa_SetupCollider = 0x8088F8B0; // type:func -BgJyaBombchuiwa_SetDrawFlags = 0x8088F904; // type:func -BgJyaBombchuiwa_Init = 0x8088F928; // type:func -BgJyaBombchuiwa_Destroy = 0x8088F9A8; // type:func -BgJyaBombchuiwa_Break = 0x8088F9D4; // type:func -BgJyaBombchuiwa_SetupWaitForExplosion = 0x8088FC60; // type:func -BgJyaBombchuiwa_WaitForExplosion = 0x8088FC98; // type:func -BgJyaBombchuiwa_CleanUpAfterExplosion = 0x8088FD7C; // type:func -func_808949B8 = 0x8088FDD4; // type:func -BgJyaBombchuiwa_SpawnLightRay = 0x8088FE60; // type:func -BgJyaBombchuiwa_Update = 0x8088FED8; // type:func -BgJyaBombchuiwa_DrawRock = 0x8088FF04; // type:func -BgJyaBombchuiwa_DrawLight = 0x8088FF8C; // type:func -BgJyaBombchuiwa_Draw = 0x808901E8; // type:func -BgJyaBombiwa_SetupDynaPoly = 0x808903F0; // type:func -BgJyaBombiwa_InitCollider = 0x80890448; // type:func -BgJyaBombiwa_Init = 0x8089049C; // type:func -BgJyaBombiwa_Destroy = 0x8089051C; // type:func -BgJyaBombiwa_Break = 0x80890564; // type:func -BgJyaBombiwa_Update = 0x808907F8; // type:func -BgJyaBombiwa_Draw = 0x80890888; // type:func -func_808958F0 = 0x808909B0; // type:func -BgJyaCobra_InitDynapoly = 0x80890A04; // type:func -BgJyaCobra_SpawnRay = 0x80890A5C; // type:func -func_80895A70 = 0x80890AC4; // type:func -func_80895BEC = 0x80890C44; // type:func -func_80895C74 = 0x80890CC8; // type:func -BgJyaCobra_UpdateShadowFromSide = 0x80890F48; // type:func -BgJyaCobra_UpdateShadowFromTop = 0x80891570; // type:func -BgJyaCobra_Init = 0x8089182C; // type:func -BgJyaCobra_Destroy = 0x80891918; // type:func -func_80896918 = 0x8089194C; // type:func -func_80896950 = 0x80891988; // type:func -func_808969F8 = 0x80891A30; // type:func -func_80896ABC = 0x80891AF8; // type:func -BgJyaCobra_Update = 0x80891C8C; // type:func -func_80896CB4 = 0x80891D00; // type:func -func_80896D78 = 0x80891D88; // type:func -BgJyaCobra_DrawShadow = 0x80891EB4; // type:func -BgJyaCobra_Draw = 0x80892138; // type:func -BgJyaGoroiwa_UpdateCollider = 0x808926F0; // type:func -BgJyaGoroiwa_InitCollider = 0x80892748; // type:func -BgJyaGoroiwa_UpdateRotation = 0x808927B0; // type:func -BgJyaGoroiwa_Init = 0x808927F0; // type:func -BgJyaGoroiwa_Destroy = 0x80892884; // type:func -BgJyaGoroiwa_SetupMove = 0x808928B0; // type:func -BgJyaGoroiwa_Move = 0x808928E0; // type:func -BgJyaGoroiwa_SetupWait = 0x80892B74; // type:func -BgJyaGoroiwa_Wait = 0x80892B8C; // type:func -BgJyaGoroiwa_Update = 0x80892BDC; // type:func -BgJyaGoroiwa_Draw = 0x80892CC8; // type:func -BgJyaHaheniron_ColliderInit = 0x80892E70; // type:func -BgJyaHaheniron_SpawnFragments = 0x80892EC4; // type:func -BgJyaHaheniron_Init = 0x808930F0; // type:func -BgJyaHaheniron_Destroy = 0x808931BC; // type:func -BgJyaHaheniron_SetupChairCrumble = 0x808931F4; // type:func -BgJyaHaheniron_ChairCrumble = 0x80893208; // type:func -BgJyaHaheniron_SetupPillarCrumble = 0x80893344; // type:func -BgJyaHaheniron_PillarCrumble = 0x80893358; // type:func -BgJyaHaheniron_SetupRubbleCollide = 0x808933D8; // type:func -BgJyaHaheniron_RubbleCollide = 0x808933EC; // type:func -BgJyaHaheniron_Update = 0x80893450; // type:func -BgJyaHaheniron_Draw = 0x8089347C; // type:func -BgJyaIronobj_InitCylinder = 0x80893660; // type:func -BgJyaIronobj_SpawnPillarParticles = 0x808936E0; // type:func -BgJyaIronobj_SpawnThroneParticles = 0x80893B5C; // type:func -BgJyaIronobj_Init = 0x80893F88; // type:func -BgJyaIronobj_Destroy = 0x8089401C; // type:func -func_808992D8 = 0x80894064; // type:func -func_808992E8 = 0x80894078; // type:func -BgJyaIronobj_Update = 0x808941B8; // type:func -BgJyaIronobj_Draw = 0x808941DC; // type:func -BgJyaKanaami_InitDynaPoly = 0x80894410; // type:func -BgJyaKanaami_Init = 0x80894468; // type:func -BgJyaKanaami_Destroy = 0x808944E8; // type:func -func_80899880 = 0x8089451C; // type:func -func_80899894 = 0x80894534; // type:func -func_8089993C = 0x808945DC; // type:func -func_80899950 = 0x808945F4; // type:func -func_80899A08 = 0x808946AC; // type:func -BgJyaKanaami_Update = 0x808946C0; // type:func -BgJyaKanaami_Draw = 0x808946F4; // type:func -BgJyaLift_InitDynapoly = 0x808947C0; // type:func -BgJyaLift_Init = 0x80894818; // type:func -BgJyaLift_Destroy = 0x808948D4; // type:func -BgJyaLift_SetInitPosY = 0x80894918; // type:func -BgJyaLift_DelayMove = 0x8089493C; // type:func -BgJyaLift_SetupMove = 0x808949C0; // type:func -BgJyaLift_Move = 0x808949D4; // type:func -BgJyaLift_SetFinalPosY = 0x80894AF8; // type:func -BgJyaLift_Update = 0x80894B10; // type:func -BgJyaLift_Draw = 0x80894C00; // type:func -BgJyaMegami_InitDynaPoly = 0x80894D10; // type:func -BgJyaMegami_InitCollider = 0x80894D68; // type:func -BgJyaMegami_SpawnEffect = 0x80894DBC; // type:func -BgJyaMegami_SetupSpawnEffect = 0x80895000; // type:func -BgJyaMegami_Init = 0x808950FC; // type:func -BgJyaMegami_Destroy = 0x80895190; // type:func -BgJyaMegami_SetupDetectLight = 0x808951D8; // type:func -BgJyaMegami_DetectLight = 0x808951F4; // type:func -BgJyaMegami_SetupExplode = 0x80895380; // type:func -BgJyaMegami_Explode = 0x80895418; // type:func -BgJyaMegami_Update = 0x808957A0; // type:func -BgJyaMegami_DrawFace = 0x808957C4; // type:func -BgJyaMegami_DrawExplode = 0x80895908; // type:func -BgJyaMegami_Draw = 0x80895AD4; // type:func -BgJyaZurerukabe_InitDynaPoly = 0x80895F00; // type:func -func_8089B4C8 = 0x80895F58; // type:func -BgJyaZurerukabe_Init = 0x808960F4; // type:func -BgJyaZurerukabe_Destroy = 0x808961B4; // type:func -func_8089B7B4 = 0x80896200; // type:func -func_8089B7C4 = 0x80896214; // type:func -func_8089B80C = 0x80896260; // type:func -func_8089B870 = 0x808962C8; // type:func -BgJyaZurerukabe_Update = 0x80896390; // type:func -BgJyaZurerukabe_Draw = 0x808963E8; // type:func -BgMenkuriEye_Init = 0x808965B0; // type:func -BgMenkuriEye_Destroy = 0x8089668C; // type:func -BgMenkuriEye_Update = 0x808966B8; // type:func -BgMenkuriEye_Draw = 0x80896828; // type:func -BgMenkuriKaiten_Init = 0x80896A50; // type:func -BgMenkuriKaiten_Destroy = 0x80896AB8; // type:func -BgMenkuriKaiten_Update = 0x80896AEC; // type:func -BgMenkuriKaiten_Draw = 0x80896B4C; // type:func -BgMenkuriNisekabe_Init = 0x80896BE0; // type:func -BgMenkuriNisekabe_Destroy = 0x80896C08; // type:func -BgMenkuriNisekabe_Update = 0x80896C18; // type:func -BgMenkuriNisekabe_Draw = 0x80896C4C; // type:func -BgMizuBwall_RotateVec3f = 0x80896D30; // type:func -BgMizuBwall_Init = 0x80896D84; // type:func -BgMizuBwall_Destroy = 0x80897600; // type:func -BgMizuBwall_SetAlpha = 0x80897648; // type:func -BgMizuBwall_SpawnDebris = 0x808977CC; // type:func -BgMizuBwall_Idle = 0x80897AA0; // type:func -BgMizuBwall_Break = 0x80897BA0; // type:func -BgMizuBwall_DoNothing = 0x80897BCC; // type:func -BgMizuBwall_Update = 0x80897BDC; // type:func -BgMizuBwall_Draw = 0x80897C00; // type:func -BgMizuMovebg_GetDragonStatueBossRoomOffsetIndex = 0x80898200; // type:func -BgMizuMovebg_Init = 0x8089826C; // type:func -BgMizuMovebg_Destroy = 0x80898634; // type:func -BgMizuMovebg_SetPosFromPath = 0x808986E8; // type:func -BgMizuMovebg_SetScrollAlphas = 0x8089877C; // type:func -BgMizuMovebg_UpdateMain = 0x80898900; // type:func -BgMizuMovebg_UpdateHookshotPlatform = 0x80898C3C; // type:func -BgMizuMovebg_Update = 0x80898DF8; // type:func -BgMizuMovebg_Draw = 0x80898E1C; // type:func -BgMizuShutter_Init = 0x80899390; // type:func -BgMizuShutter_Destroy = 0x808995F0; // type:func -BgMizuShutter_WaitForSwitch = 0x80899624; // type:func -BgMizuShutter_WaitForCutscene = 0x808996B8; // type:func -BgMizuShutter_Move = 0x80899704; // type:func -BgMizuShutter_WaitForTimer = 0x808998F0; // type:func -BgMizuShutter_Update = 0x80899970; // type:func -BgMizuShutter_Draw = 0x80899994; // type:func -BgMizuUzu_Init = 0x80899B90; // type:func -BgMizuUzu_Destroy = 0x80899C0C; // type:func -func_8089F788 = 0x80899C40; // type:func -BgMizuUzu_Update = 0x80899CB8; // type:func -BgMizuUzu_Draw = 0x80899CDC; // type:func -BgMizuWater_GetWaterLevelActionIndex = 0x80899D60; // type:func -BgMizuWater_SetWaterBoxesHeight = 0x80899E00; // type:func -BgMizuWater_Init = 0x80899E6C; // type:func -BgMizuWater_Destroy = 0x8089A0C8; // type:func -BgMizuWater_WaitForAction = 0x8089A0D8; // type:func -BgMizuWater_ChangeWaterLevel = 0x8089A2A4; // type:func -BgMizuWater_Update = 0x8089A5B4; // type:func -BgMizuWater_Draw = 0x8089A70C; // type:func -BgMjin_SetupAction = 0x8089AA30; // type:func -BgMjin_Init = 0x8089AA3C; // type:func -BgMjin_Destroy = 0x8089AADC; // type:func -func_808A0850 = 0x8089AB10; // type:func -BgMjin_DoNothing = 0x8089ABE4; // type:func -BgMjin_Update = 0x8089ABF4; // type:func -BgMjin_Draw = 0x8089AC18; // type:func -BgMoriBigst_SetupAction = 0x8089AE20; // type:func -BgMoriBigst_InitDynapoly = 0x8089AE2C; // type:func -BgMoriBigst_Init = 0x8089AE84; // type:func -BgMoriBigst_Destroy = 0x8089AF5C; // type:func -BgMoriBigst_SetupWaitForMoriTex = 0x8089AF90; // type:func -BgMoriBigst_WaitForMoriTex = 0x8089AFB8; // type:func -BgMoriBigst_SetupNoop = 0x8089B084; // type:func -BgMoriBigst_SetupStalfosFight = 0x8089B0A8; // type:func -BgMoriBigst_StalfosFight = 0x8089B15C; // type:func -BgMoriBigst_SetupFall = 0x8089B1D4; // type:func -BgMoriBigst_Fall = 0x8089B1FC; // type:func -BgMoriBigst_SetupLanding = 0x8089B288; // type:func -BgMoriBigst_Landing = 0x8089B31C; // type:func -BgMoriBigst_SetupStalfosPairFight = 0x8089B348; // type:func -BgMoriBigst_StalfosPairFight = 0x8089B460; // type:func -BgMoriBigst_SetupDone = 0x8089B4C0; // type:func -BgMoriBigst_Update = 0x8089B4E4; // type:func -BgMoriBigst_Draw = 0x8089B558; // type:func -func_808A1800 = 0x8089B750; // type:func -func_808A18FC = 0x8089B848; // type:func -BgMoriElevator_Init = 0x8089B8D0; // type:func -BgMoriElevator_Destroy = 0x8089B9B4; // type:func -BgMoriElevator_IsPlayerRiding = 0x8089B9F4; // type:func -BgMoriElevator_SetupWaitAfterInit = 0x8089BA54; // type:func -BgMoriElevator_WaitAfterInit = 0x8089BA68; // type:func -func_808A1C30 = 0x8089BB0C; // type:func -BgMoriElevator_MoveIntoGround = 0x8089BB20; // type:func -func_808A1CF4 = 0x8089BBD4; // type:func -BgMoriElevator_MoveAboveGround = 0x8089BC30; // type:func -BgMoriElevator_SetupSetPosition = 0x8089BCE4; // type:func -BgMoriElevator_SetPosition = 0x8089BCF8; // type:func -BgMoriElevator_StopMovement = 0x8089BEC0; // type:func -func_808A2008 = 0x8089BEDC; // type:func -BgMoriElevator_Update = 0x8089BF90; // type:func -BgMoriElevator_Draw = 0x8089BFE8; // type:func -BgMoriHashigo_InitDynapoly = 0x8089C240; // type:func -BgMoriHashigo_InitCollider = 0x8089C298; // type:func -BgMoriHashigo_SpawnLadder = 0x8089C344; // type:func -BgMoriHashigo_InitClasp = 0x8089C3FC; // type:func -BgMoriHashigo_InitLadder = 0x8089C488; // type:func -BgMoriHashigo_Init = 0x8089C4CC; // type:func -BgMoriHashigo_Destroy = 0x8089C590; // type:func -BgMoriHashigo_SetupWaitForMoriTex = 0x8089C5E8; // type:func -BgMoriHashigo_WaitForMoriTex = 0x8089C5FC; // type:func -BgMoriHashigo_SetupClasp = 0x8089C67C; // type:func -BgMoriHashigo_Clasp = 0x8089C690; // type:func -BgMoriHashigo_SetupLadderWait = 0x8089C6F4; // type:func -BgMoriHashigo_LadderWait = 0x8089C708; // type:func -BgMoriHashigo_SetupLadderFall = 0x8089C73C; // type:func -BgMoriHashigo_LadderFall = 0x8089C778; // type:func -BgMoriHashigo_SetupLadderRest = 0x8089C858; // type:func -BgMoriHashigo_Update = 0x8089C87C; // type:func -BgMoriHashigo_Draw = 0x8089C8B8; // type:func -BgMoriHashira4_SetupAction = 0x8089CB00; // type:func -BgMoriHashira4_InitDynaPoly = 0x8089CB0C; // type:func -BgMoriHashira4_Init = 0x8089CB64; // type:func -BgMoriHashira4_Destroy = 0x8089CC78; // type:func -BgMoriHashira4_SetupWaitForMoriTex = 0x8089CCAC; // type:func -BgMoriHashira4_WaitForMoriTex = 0x8089CCD0; // type:func -BgMoriHashira4_SetupPillarsRotate = 0x8089CD4C; // type:func -BgMoriHashira4_PillarsRotate = 0x8089CD70; // type:func -BgMoriHashira4_GateWait = 0x8089CDA8; // type:func -BgMoriHashira4_GateOpen = 0x8089CE54; // type:func -BgMoriHashira4_Update = 0x8089CEAC; // type:func -BgMoriHashira4_Draw = 0x8089CED8; // type:func -BgMoriHineri_Init = 0x8089D090; // type:func -BgMoriHineri_Destroy = 0x8089D290; // type:func -func_808A39FC = 0x8089D2C4; // type:func -BgMoriHineri_DoNothing = 0x8089D4BC; // type:func -BgMoriHineri_SpawnBossKeyChest = 0x8089D4CC; // type:func -func_808A3C8C = 0x8089D55C; // type:func -func_808A3D58 = 0x8089D628; // type:func -func_808A3E54 = 0x8089D724; // type:func -BgMoriHineri_Update = 0x8089D804; // type:func -BgMoriHineri_DrawHallAndRoom = 0x8089D828; // type:func -BgMoriIdomizu_SetupAction = 0x8089DDE0; // type:func -BgMoriIdomizu_SetWaterLevel = 0x8089DDEC; // type:func -BgMoriIdomizu_Init = 0x8089DE14; // type:func -BgMoriIdomizu_Destroy = 0x8089DF38; // type:func -BgMoriIdomizu_SetupWaitForMoriTex = 0x8089DF58; // type:func -BgMoriIdomizu_WaitForMoriTex = 0x8089DF7C; // type:func -BgMoriIdomizu_SetupMain = 0x8089DFD4; // type:func -BgMoriIdomizu_Main = 0x8089DFF8; // type:func -BgMoriIdomizu_Update = 0x8089E1BC; // type:func -BgMoriIdomizu_Draw = 0x8089E1E8; // type:func -BgMoriKaitenkabe_CrossProduct = 0x8089E420; // type:func -BgMoriKaitenkabe_Init = 0x8089E494; // type:func -BgMoriKaitenkabe_Destroy = 0x8089E548; // type:func -BgMoriKaitenkabe_WaitForMoriTex = 0x8089E57C; // type:func -BgMoriKaitenkabe_SetupWait = 0x8089E5D4; // type:func -BgMoriKaitenkabe_Wait = 0x8089E5EC; // type:func -BgMoriKaitenkabe_SetupRotate = 0x8089E74C; // type:func -BgMoriKaitenkabe_Rotate = 0x8089E76C; // type:func -BgMoriKaitenkabe_Update = 0x8089E8D8; // type:func -BgMoriKaitenkabe_Draw = 0x8089E8FC; // type:func -BgMoriRakkatenjo_Init = 0x8089EA90; // type:func -BgMoriRakkatenjo_Destroy = 0x8089EB48; // type:func -BgMoriRakkatenjo_IsLinkUnder = 0x8089EB7C; // type:func -BgMoriRakkatenjo_IsLinkClose = 0x8089EC2C; // type:func -BgMoriRakkatenjo_SetupWaitForMoriTex = 0x8089ECDC; // type:func -BgMoriRakkatenjo_WaitForMoriTex = 0x8089ECF0; // type:func -BgMoriRakkatenjo_SetupWait = 0x8089ED48; // type:func -BgMoriRakkatenjo_Wait = 0x8089ED84; // type:func -BgMoriRakkatenjo_SetupFall = 0x8089EE54; // type:func -BgMoriRakkatenjo_Fall = 0x8089EE74; // type:func -BgMoriRakkatenjo_SetupRest = 0x8089EFEC; // type:func -BgMoriRakkatenjo_Rest = 0x8089F014; // type:func -BgMoriRakkatenjo_SetupRise = 0x8089F044; // type:func -BgMoriRakkatenjo_Rise = 0x8089F064; // type:func -BgMoriRakkatenjo_Update = 0x8089F0E4; // type:func -BgMoriRakkatenjo_Draw = 0x8089F1BC; // type:func -BgPoEvent_InitPaintings = 0x8089F410; // type:func -BgPoEvent_InitBlocks = 0x8089F78C; // type:func -BgPoEvent_Init = 0x8089F93C; // type:func -BgPoEvent_Destroy = 0x8089FA4C; // type:func -BgPoEvent_BlockWait = 0x8089FAD0; // type:func -BgPoEvent_BlockShake = 0x8089FBDC; // type:func -BgPoEvent_CheckBlock = 0x8089FC94; // type:func -BgPoEvent_BlockFall = 0x8089FDCC; // type:func -BgPoEvent_BlockIdle = 0x8089FED0; // type:func -BgPoEvent_BlockPush = 0x808A0184; // type:func -BgPoEvent_BlockReset = 0x808A0344; // type:func -BgPoEvent_BlockSolved = 0x808A0444; // type:func -BgPoEvent_AmyWait = 0x808A04BC; // type:func -BgPoEvent_AmyPuzzle = 0x808A0538; // type:func -BgPoEvent_NextPainting = 0x808A0654; // type:func -BgPoEvent_PaintingEmpty = 0x808A0710; // type:func -BgPoEvent_PaintingAppear = 0x808A0740; // type:func -BgPoEvent_PaintingVanish = 0x808A0778; // type:func -BgPoEvent_PaintingPresent = 0x808A07C8; // type:func -BgPoEvent_PaintingBurn = 0x808A0A24; // type:func -BgPoEvent_Update = 0x808A0BD0; // type:func -BgPoEvent_Draw = 0x808A0C40; // type:func -BgPoSyokudai_Init = 0x808A1250; // type:func -BgPoSyokudai_Destroy = 0x808A14F0; // type:func -BgPoSyokudai_Update = 0x808A1560; // type:func -BgPoSyokudai_Draw = 0x808A15E0; // type:func -BgPushbox_SetupAction = 0x808A1BC0; // type:func -BgPushbox_Init = 0x808A1BCC; // type:func -BgPushbox_Destroy = 0x808A1C64; // type:func -BgPushbox_UpdateImpl = 0x808A1C98; // type:func -BgPushbox_Update = 0x808A1D74; // type:func -BgPushbox_Draw = 0x808A1DA4; // type:func -BgRelayObjects_Init = 0x808A1EC0; // type:func -BgRelayObjects_Destroy = 0x808A2100; // type:func -func_808A90F4 = 0x808A216C; // type:func -func_808A91AC = 0x808A2228; // type:func -func_808A9234 = 0x808A22B0; // type:func -BgRelayObjects_DoNothing = 0x808A239C; // type:func -func_808A932C = 0x808A23AC; // type:func -func_808A939C = 0x808A241C; // type:func -BgRelayObjects_Update = 0x808A24F0; // type:func -BgRelayObjects_Draw = 0x808A2514; // type:func -BgSpot00Break_Init = 0x808A2670; // type:func -BgSpot00Break_Destroy = 0x808A271C; // type:func -BgSpot00Break_Update = 0x808A2750; // type:func -BgSpot00Break_Draw = 0x808A2760; // type:func -BgSpot00Hanebasi_Init = 0x808A2810; // type:func -BgSpot00Hanebasi_Destroy = 0x808A2C20; // type:func -BgSpot00Hanebasi_DrawbridgeWait = 0x808A2C7C; // type:func -BgSpot00Hanebasi_DoNothing = 0x808A2DAC; // type:func -BgSpot00Hanebasi_DrawbridgeRiseAndFall = 0x808A2DBC; // type:func -BgSpot00Hanebasi_SetTorchLightInfo = 0x808A2EF0; // type:func -BgSpot00Hanebasi_Update = 0x808A3048; // type:func -BgSpot00Hanebasi_DrawTorches = 0x808A3358; // type:func -BgSpot00Hanebasi_Draw = 0x808A35F8; // type:func -BgSpot01Fusya_SetupAction = 0x808A3920; // type:func -BgSpot01Fusya_Init = 0x808A392C; // type:func -BgSpot01Fusya_Destroy = 0x808A39A8; // type:func -func_808AAA50 = 0x808A39B8; // type:func -BgSpot01Fusya_Update = 0x808A3A78; // type:func -BgSpot01Fusya_Draw = 0x808A3A9C; // type:func -BgSpot01Idohashira_PlayBreakSfx1 = 0x808A3BC0; // type:func -BgSpot01Idohashira_PlayBreakSfx2 = 0x808A3BE8; // type:func -func_808AAD3C = 0x808A3C20; // type:func -func_808AAE6C = 0x808A3D58; // type:func -func_808AAF34 = 0x808A3E24; // type:func -BgSpot01Idohashira_Destroy = 0x808A3FE8; // type:func -BgSpot01Idohashira_NotInCsMode = 0x808A401C; // type:func -BgSpot01Idohashira_GetCue = 0x808A403C; // type:func -func_808AB18C = 0x808A4088; // type:func -func_808AB1DC = 0x808A40DC; // type:func -func_808AB29C = 0x808A4180; // type:func -func_808AB3E8 = 0x808A42CC; // type:func -func_808AB3F8 = 0x808A42E0; // type:func -func_808AB414 = 0x808A4300; // type:func -func_808AB444 = 0x808A432C; // type:func -func_808AB504 = 0x808A43D8; // type:func -func_808AB510 = 0x808A43E8; // type:func -func_808AB530 = 0x808A4408; // type:func -func_808AB570 = 0x808A444C; // type:func -BgSpot01Idohashira_Update = 0x808A446C; // type:func -BgSpot01Idohashira_Init = 0x808A44B4; // type:func -func_808AB700 = 0x808A45CC; // type:func -BgSpot01Idohashira_Draw = 0x808A465C; // type:func -BgSpot01Idomizu_Init = 0x808A47C0; // type:func -BgSpot01Idomizu_Destroy = 0x808A4858; // type:func -func_808ABB84 = 0x808A4868; // type:func -BgSpot01Idomizu_Update = 0x808A491C; // type:func -BgSpot01Idomizu_Draw = 0x808A4940; // type:func -BgSpot01Idosoko_SetupAction = 0x808A4AE0; // type:func -BgSpot01Idosoko_Init = 0x808A4AEC; // type:func -BgSpot01Idosoko_Destroy = 0x808A4B8C; // type:func -func_808ABF54 = 0x808A4BC0; // type:func -BgSpot01Idosoko_Update = 0x808A4BD0; // type:func -BgSpot01Idosoko_Draw = 0x808A4BF4; // type:func -BgSpot01Objects2_Init = 0x808A4CF0; // type:func -BgSpot01Objects2_Destroy = 0x808A4DCC; // type:func -func_808AC22C = 0x808A4DDC; // type:func -func_808AC2BC = 0x808A4E70; // type:func -func_808AC474 = 0x808A5020; // type:func -BgSpot01Objects2_Update = 0x808A5030; // type:func -func_808AC4A4 = 0x808A5054; // type:func -BgSpot02Objects_Init = 0x808A51B0; // type:func -BgSpot02Objects_Destroy = 0x808A5420; // type:func -func_808AC8FC = 0x808A5454; // type:func -func_808AC908 = 0x808A5464; // type:func -func_808ACA08 = 0x808A5564; // type:func -func_808ACAFC = 0x808A565C; // type:func -func_808ACB58 = 0x808A56B8; // type:func -BgSpot02Objects_Update = 0x808A5738; // type:func -BgSpot02Objects_Draw = 0x808A575C; // type:func -func_808ACC34 = 0x808A5798; // type:func -func_808ACCB8 = 0x808A581C; // type:func -func_808AD3D4 = 0x808A5F08; // type:func -func_808AD450 = 0x808A5F84; // type:func -BgSpot03Taki_ApplyOpeningAlpha = 0x808A6510; // type:func -BgSpot03Taki_Init = 0x808A684C; // type:func -BgSpot03Taki_Destroy = 0x808A68FC; // type:func -func_808ADEF0 = 0x808A6930; // type:func -BgSpot03Taki_Update = 0x808A6B04; // type:func -BgSpot03Taki_Draw = 0x808A6B28; // type:func -BgSpot05Soko_Init = 0x808A6E30; // type:func -BgSpot05Soko_Destroy = 0x808A6F3C; // type:func -func_808AE5A8 = 0x808A6F70; // type:func -func_808AE5B4 = 0x808A6F80; // type:func -func_808AE630 = 0x808A6FFC; // type:func -BgSpot05Soko_Update = 0x808A7064; // type:func -BgSpot05Soko_Draw = 0x808A7088; // type:func -BgSpot06Objects_Init = 0x808A7150; // type:func -BgSpot06Objects_Destroy = 0x808A751C; // type:func -BgSpot06Objects_GateSpawnBubbles = 0x808A7584; // type:func -BgSpot06Objects_GateWaitForSwitch = 0x808A767C; // type:func -BgSpot06Objects_GateWaitToOpen = 0x808A7710; // type:func -BgSpot06Objects_GateOpen = 0x808A7744; // type:func -BgSpot06Objects_DoNothing = 0x808A77D0; // type:func -BgSpot06Objects_LockSpawnWaterRipples = 0x808A77E0; // type:func -BgSpot06Objects_LockSpawnBubbles = 0x808A7844; // type:func -BgSpot06Objects_LockWait = 0x808A78D8; // type:func -BgSpot06Objects_LockPullOutward = 0x808A7AFC; // type:func -BgSpot06Objects_LockSwimToSurface = 0x808A7BB4; // type:func -BgSpot06Objects_LockFloat = 0x808A7E2C; // type:func -BgSpot06Objects_Update = 0x808A7EAC; // type:func -BgSpot06Objects_DrawLakeHyliaWater = 0x808A7F0C; // type:func -BgSpot06Objects_Draw = 0x808A80F4; // type:func -BgSpot06Objects_WaterPlaneCutsceneWait = 0x808A81B8; // type:func -BgSpot06Objects_WaterPlaneCutsceneRise = 0x808A81E4; // type:func -BgSpot07Taki_Init = 0x808A8550; // type:func -BgSpot07Taki_Destroy = 0x808A85FC; // type:func -BgSpot07Taki_DoNothing = 0x808A8630; // type:func -BgSpot07Taki_Update = 0x808A8640; // type:func -BgSpot07Taki_Draw = 0x808A8664; // type:func -func_808B02D0 = 0x808A8B40; // type:func -func_808B0324 = 0x808A8B94; // type:func -BgSpot08Bakudankabe_Init = 0x808A8E8C; // type:func -BgSpot08Bakudankabe_Destroy = 0x808A8F2C; // type:func -BgSpot08Bakudankabe_Update = 0x808A8F74; // type:func -BgSpot08Bakudankabe_Draw = 0x808A9028; // type:func -BgSpot08Iceblock_SetupAction = 0x808A91E0; // type:func -BgSpot08Iceblock_InitDynaPoly = 0x808A91EC; // type:func -BgSpot08Iceblock_CheckParams = 0x808A9244; // type:func -BgSpot08Iceblock_Bobbing = 0x808A92A4; // type:func -BgSpot08Iceblock_SinkUnderPlayer = 0x808A9300; // type:func -BgSpot08Iceblock_SetWaterline = 0x808A93B0; // type:func -BgSpot08Iceblock_MultVectorScalar = 0x808A93D0; // type:func -BgSpot08Iceblock_CrossProduct = 0x808A9404; // type:func -BgSpot08Iceblock_NormalizeVector = 0x808A9478; // type:func -BgSpot08Iceblock_Roll = 0x808A9514; // type:func -BgSpot08Iceblock_SpawnTwinFloe = 0x808A9888; // type:func -BgSpot08Iceblock_Init = 0x808A9988; // type:func -BgSpot08Iceblock_Destroy = 0x808A9B7C; // type:func -BgSpot08Iceblock_SetupFloatNonrotating = 0x808A9BB0; // type:func -BgSpot08Iceblock_FloatNonrotating = 0x808A9BD4; // type:func -BgSpot08Iceblock_SetupFloatRotating = 0x808A9C28; // type:func -BgSpot08Iceblock_FloatRotating = 0x808A9C4C; // type:func -BgSpot08Iceblock_SetupFloatOrbitingTwins = 0x808A9CAC; // type:func -BgSpot08Iceblock_FloatOrbitingTwins = 0x808A9CD0; // type:func -BgSpot08Iceblock_SetupNoAction = 0x808A9DA8; // type:func -BgSpot08Iceblock_Update = 0x808A9DC8; // type:func -BgSpot08Iceblock_Draw = 0x808A9E64; // type:func -func_808B1AE0 = 0x808AA220; // type:func -func_808B1BA0 = 0x808AA2E0; // type:func -func_808B1BEC = 0x808AA32C; // type:func -func_808B1C70 = 0x808AA3B8; // type:func -func_808B1CEC = 0x808AA434; // type:func -func_808B1D18 = 0x808AA460; // type:func -func_808B1D44 = 0x808AA48C; // type:func -BgSpot09Obj_Init = 0x808AA4CC; // type:func -BgSpot09Obj_Destroy = 0x808AA534; // type:func -BgSpot09Obj_Update = 0x808AA574; // type:func -BgSpot09Obj_Draw = 0x808AA584; // type:func -func_808B2180 = 0x808AA740; // type:func -func_808B2218 = 0x808AA7D4; // type:func -BgSpot11Bakudankabe_Init = 0x808AAAEC; // type:func -BgSpot11Bakudankabe_Destroy = 0x808AAB88; // type:func -BgSpot11Bakudankabe_Update = 0x808AABD0; // type:func -BgSpot11Bakudankabe_Draw = 0x808AAC6C; // type:func -func_808B27F0 = 0x808AAD80; // type:func -func_808B280C = 0x808AADA0; // type:func -BgSpot11Oasis_Init = 0x808AAEB4; // type:func -func_808B2970 = 0x808AAF08; // type:func -func_808B2980 = 0x808AAF1C; // type:func -func_808B29E0 = 0x808AAF7C; // type:func -func_808B29F0 = 0x808AAF90; // type:func -func_808B2AA8 = 0x808AB048; // type:func -func_808B2AB8 = 0x808AB05C; // type:func -BgSpot11Oasis_Update = 0x808AB06C; // type:func -BgSpot11Oasis_Draw = 0x808AB260; // type:func -BgSpot12Gate_InitDynaPoly = 0x808AB4B0; // type:func -BgSpot12Gate_Init = 0x808AB508; // type:func -BgSpot12Gate_Destroy = 0x808AB588; // type:func -func_808B30C0 = 0x808AB5BC; // type:func -func_808B30D8 = 0x808AB5D8; // type:func -func_808B3134 = 0x808AB634; // type:func -func_808B314C = 0x808AB650; // type:func -func_808B317C = 0x808AB680; // type:func -func_808B318C = 0x808AB694; // type:func -func_808B3274 = 0x808AB77C; // type:func -func_808B3298 = 0x808AB7A4; // type:func -BgSpot12Gate_Update = 0x808AB7B4; // type:func -BgSpot12Gate_Draw = 0x808AB7E8; // type:func -func_808B3420 = 0x808AB8C0; // type:func -BgSpot12Saku_Init = 0x808AB918; // type:func -BgSpot12Saku_Destroy = 0x808AB998; // type:func -func_808B3550 = 0x808AB9CC; // type:func -func_808B357C = 0x808AB9FC; // type:func -func_808B35E4 = 0x808ABA64; // type:func -func_808B3604 = 0x808ABA84; // type:func -func_808B3714 = 0x808ABB94; // type:func -func_808B37AC = 0x808ABC28; // type:func -BgSpot12Saku_Update = 0x808ABC38; // type:func -BgSpot12Saku_Draw = 0x808ABC6C; // type:func -func_808B3960 = 0x808ABD80; // type:func -BgSpot15Rrbox_RotatePoint = 0x808ABDD8; // type:func -func_808B3A34 = 0x808ABE2C; // type:func -func_808B3A40 = 0x808ABE3C; // type:func -func_808B3AAC = 0x808ABEAC; // type:func -BgSpot15Rrbox_Init = 0x808ABF94; // type:func -BgSpot15Rrbox_Destroy = 0x808AC064; // type:func -BgSpot15Rrbox_TrySnapToCheckedPoint = 0x808AC0A0; // type:func -BgSpot15Rrbox_GetFloorHeight = 0x808AC1E0; // type:func -BgSpot15Rrbox_TrySnapToFloor = 0x808AC360; // type:func -func_808B4010 = 0x808AC420; // type:func -func_808B4084 = 0x808AC494; // type:func -func_808B40AC = 0x808AC4C0; // type:func -func_808B4178 = 0x808AC58C; // type:func -func_808B4194 = 0x808AC5AC; // type:func -func_808B4380 = 0x808AC798; // type:func -func_808B43D0 = 0x808AC7E8; // type:func -func_808B44B8 = 0x808AC8B4; // type:func -func_808B44CC = 0x808AC8CC; // type:func -BgSpot15Rrbox_Update = 0x808AC8F0; // type:func -BgSpot15Rrbox_Draw = 0x808AC95C; // type:func -BgSpot15Saku_Init = 0x808ACB60; // type:func -BgSpot15Saku_Destroy = 0x808ACC14; // type:func -func_808B4930 = 0x808ACC48; // type:func -func_808B4978 = 0x808ACC90; // type:func -func_808B4A04 = 0x808ACD1C; // type:func -BgSpot15Saku_Update = 0x808ACD4C; // type:func -BgSpot15Saku_Draw = 0x808ACD80; // type:func -func_808B4C30 = 0x808ACEA0; // type:func -func_808B4C4C = 0x808ACEC0; // type:func -func_808B4D04 = 0x808ACF74; // type:func -func_808B4D9C = 0x808AD008; // type:func -func_808B4E58 = 0x808AD0B8; // type:func -BgSpot16Bombstone_Init = 0x808AD2B4; // type:func -BgSpot16Bombstone_Destroy = 0x808AD368; // type:func -BgSpot16Bombstone_SpawnDust = 0x808AD3B4; // type:func -func_808B5240 = 0x808AD450; // type:func -BgSpot16Bombstone_SpawnFragments = 0x808AD5B8; // type:func -func_808B561C = 0x808AD830; // type:func -func_808B56BC = 0x808AD8D0; // type:func -func_808B57E0 = 0x808AD9CC; // type:func -func_808B5934 = 0x808ADB24; // type:func -func_808B5950 = 0x808ADB44; // type:func -func_808B5A78 = 0x808ADC30; // type:func -func_808B5A94 = 0x808ADC50; // type:func -func_808B5AF0 = 0x808ADCB4; // type:func -func_808B5B04 = 0x808ADCCC; // type:func -func_808B5B58 = 0x808ADD24; // type:func -func_808B5B6C = 0x808ADD3C; // type:func -BgSpot16Bombstone_Update = 0x808ADE38; // type:func -BgSpot16Bombstone_Draw = 0x808ADE6C; // type:func -BgSpot16Doughnut_Init = 0x808AE3F0; // type:func -BgSpot16Doughnut_Destroy = 0x808AE564; // type:func -BgSpot16Doughnut_Update = 0x808AE574; // type:func -BgSpot16Doughnut_UpdateExpanding = 0x808AE608; // type:func -BgSpot16Doughnut_Draw = 0x808AE670; // type:func -BgSpot16Doughnut_DrawExpanding = 0x808AE828; // type:func -func_808B6BC0 = 0x808AE9B0; // type:func -BgSpot17Bakudankabe_Init = 0x808AECE0; // type:func -BgSpot17Bakudankabe_Destroy = 0x808AED74; // type:func -BgSpot17Bakudankabe_Update = 0x808AEDA8; // type:func -BgSpot17Bakudankabe_Draw = 0x808AEE3C; // type:func -BgSpot17Funen_Init = 0x808AF0A0; // type:func -BgSpot17Funen_Destroy = 0x808AF0C8; // type:func -BgSpot17Funen_Update = 0x808AF0D8; // type:func -func_808B746C = 0x808AF0FC; // type:func -func_808B7478 = 0x808AF10C; // type:func -func_808B7710 = 0x808AF2F0; // type:func -func_808B7770 = 0x808AF34C; // type:func -BgSpot18Basket_Init = 0x808AF508; // type:func -BgSpot18Basket_Destroy = 0x808AF654; // type:func -func_808B7AEC = 0x808AF69C; // type:func -func_808B7AFC = 0x808AF6B0; // type:func -func_808B7B58 = 0x808AF70C; // type:func -func_808B7B6C = 0x808AF724; // type:func -func_808B7BB0 = 0x808AF768; // type:func -func_808B7BCC = 0x808AF788; // type:func -func_808B7D38 = 0x808AF8F4; // type:func -func_808B7D50 = 0x808AF910; // type:func -func_808B7F74 = 0x808AFB34; // type:func -func_808B7FC0 = 0x808AFB84; // type:func -func_808B818C = 0x808AFD50; // type:func -func_808B81A0 = 0x808AFD68; // type:func -BgSpot18Basket_Update = 0x808B0000; // type:func -BgSpot18Basket_Draw = 0x808B00C4; // type:func -BgSpot18Futa_Init = 0x808B02E0; // type:func -BgSpot18Futa_Destroy = 0x808B034C; // type:func -BgSpot18Futa_Update = 0x808B0380; // type:func -BgSpot18Futa_Draw = 0x808B03E4; // type:func -func_808B8910 = 0x808B0480; // type:func -func_808B8A5C = 0x808B0538; // type:func -func_808B8A98 = 0x808B0574; // type:func -func_808B8B08 = 0x808B05E4; // type:func -func_808B8B38 = 0x808B0618; // type:func -func_808B8BB4 = 0x808B0694; // type:func -func_808B8C90 = 0x808B0778; // type:func -func_808B8CC8 = 0x808B07B4; // type:func -BgSpot18Obj_Init = 0x808B0808; // type:func -BgSpot18Obj_Destroy = 0x808B0864; // type:func -func_808B8DC0 = 0x808B0898; // type:func -func_808B8DD0 = 0x808B08AC; // type:func -func_808B8DDC = 0x808B08BC; // type:func -func_808B8E20 = 0x808B0900; // type:func -func_808B8E64 = 0x808B0944; // type:func -func_808B8E7C = 0x808B0960; // type:func -func_808B8EE0 = 0x808B09C4; // type:func -func_808B8F08 = 0x808B09F0; // type:func -func_808B9030 = 0x808B0B1C; // type:func -func_808B9040 = 0x808B0B30; // type:func -BgSpot18Obj_Update = 0x808B0B50; // type:func -BgSpot18Obj_Draw = 0x808B0B84; // type:func -BgSpot18Shutter_Init = 0x808B0D50; // type:func -BgSpot18Shutter_Destroy = 0x808B0F00; // type:func -func_808B95AC = 0x808B0F34; // type:func -func_808B95B8 = 0x808B0F44; // type:func -func_808B9618 = 0x808B0FA4; // type:func -func_808B9698 = 0x808B102C; // type:func -func_808B971C = 0x808B10B0; // type:func -BgSpot18Shutter_Update = 0x808B118C; // type:func -BgSpot18Shutter_Draw = 0x808B11B0; // type:func -BgSstFloor_Init = 0x808B12A0; // type:func -BgSstFloor_Destroy = 0x808B1308; // type:func -BgSstFloor_Update = 0x808B133C; // type:func -BgSstFloor_Draw = 0x808B16B0; // type:func -BgTokiHikari_Init = 0x808B1800; // type:func -BgTokiHikari_Destroy = 0x808B188C; // type:func -BgTokiHikari_DoNothing = 0x808B189C; // type:func -BgTokiHikari_Update = 0x808B18AC; // type:func -BgTokiHikari_Draw = 0x808B18D0; // type:func -func_808BA018 = 0x808B1920; // type:func -func_808BA204 = 0x808B1AC8; // type:func -func_808BA22C = 0x808B1AF0; // type:func -func_808BA274 = 0x808B1B38; // type:func -func_808BA2CC = 0x808B1B90; // type:func -BgTokiSwd_SetupAction = 0x808B25A0; // type:func -BgTokiSwd_Init = 0x808B25AC; // type:func -BgTokiSwd_Destroy = 0x808B2680; // type:func -func_808BAF40 = 0x808B26AC; // type:func -func_808BB0AC = 0x808B2820; // type:func -func_808BB128 = 0x808B28A0; // type:func -BgTokiSwd_Update = 0x808B28F4; // type:func -BgTokiSwd_Draw = 0x808B2948; // type:func -BgTreemouth_SetupAction = 0x808B3BF0; // type:func -BgTreemouth_Init = 0x808B3BFC; // type:func -BgTreemouth_Destroy = 0x808B3D24; // type:func -func_808BC65C = 0x808B3D58; // type:func -func_808BC6F8 = 0x808B3DF4; // type:func -func_808BC80C = 0x808B3F08; // type:func -func_808BC864 = 0x808B3F60; // type:func -func_808BC8B8 = 0x808B3FB4; // type:func -func_808BC9EC = 0x808B40E8; // type:func -func_808BCAF0 = 0x808B41F0; // type:func -BgTreemouth_DoNothing = 0x808B428C; // type:func -BgTreemouth_Update = 0x808B429C; // type:func -BgTreemouth_Draw = 0x808B431C; // type:func -BgUmaJump_Init = 0x808B5250; // type:func -BgUmaJump_Destroy = 0x808B530C; // type:func -BgUmaJump_Update = 0x808B5340; // type:func -BgUmaJump_Draw = 0x808B5350; // type:func -BgVbSima_Init = 0x808B53E0; // type:func -BgVbSima_Destroy = 0x808B5448; // type:func -BgVbSima_SpawnEmber = 0x808B547C; // type:func -BgVbSima_Update = 0x808B5548; // type:func -BgVbSima_Draw = 0x808B59A8; // type:func -BgYdanHasi_Init = 0x808B5B00; // type:func -BgYdanHasi_Destroy = 0x808B5C64; // type:func -BgYdanHasi_UpdateFloatingBlock = 0x808B5C98; // type:func -BgYdanHasi_InitWater = 0x808B5DD0; // type:func -BgYdanHasi_MoveWater = 0x808B5E1C; // type:func -BgYdanHasi_DecWaterTimer = 0x808B5EEC; // type:func -BgYdanHasi_SetupThreeBlocks = 0x808B5F40; // type:func -BgYdanHasi_UpdateThreeBlocks = 0x808B5FAC; // type:func -BgYdanHasi_Update = 0x808B607C; // type:func -BgYdanHasi_Draw = 0x808B60A0; // type:func -BgYdanMaruta_Init = 0x808B62B0; // type:func -BgYdanMaruta_Destroy = 0x808B6514; // type:func -func_808BEFF4 = 0x808B6568; // type:func -func_808BF078 = 0x808B65EC; // type:func -func_808BF108 = 0x808B667C; // type:func -func_808BF1EC = 0x808B6760; // type:func -BgYdanMaruta_DoNothing = 0x808B67D0; // type:func -BgYdanMaruta_Update = 0x808B67E0; // type:func -BgYdanMaruta_Draw = 0x808B6804; // type:func -BgYdanSp_Init = 0x808B6990; // type:func -BgYdanSp_Destroy = 0x808B6D78; // type:func -BgYdanSp_UpdateFloorWebCollision = 0x808B6DC0; // type:func -BgYdanSp_BurnWeb = 0x808B6E94; // type:func -BgYdanSp_BurnFloorWeb = 0x808B6F04; // type:func -BgYdanSp_FloorWebBroken = 0x808B71D8; // type:func -BgYdanSp_FloorWebBreaking = 0x808B7218; // type:func -BgYdanSp_FloorWebIdle = 0x808B73D8; // type:func -BgYdanSp_BurnWallWeb = 0x808B76B4; // type:func -BgYdanSp_WallWebIdle = 0x808B79EC; // type:func -BgYdanSp_Update = 0x808B7B2C; // type:func -BgYdanSp_Draw = 0x808B7B50; // type:func -BgZg_Destroy = 0x808B80B0; // type:func -func_808C0C50 = 0x808B80E4; // type:func -func_808C0C98 = 0x808B812C; // type:func -func_808C0CC8 = 0x808B8160; // type:func -func_808C0CD4 = 0x808B8170; // type:func -func_808C0D08 = 0x808B81A4; // type:func -BgZg_Update = 0x808B8248; // type:func -BgZg_Init = 0x808B8290; // type:func -func_808C0EEC = 0x808B837C; // type:func -BgZg_Draw = 0x808B83F8; // type:func -func_808C1190 = 0x808B8500; // type:func -func_808C11D0 = 0x808B8540; // type:func -func_808C1200 = 0x808B8570; // type:func -func_808C1230 = 0x808B85A0; // type:func -func_808C1278 = 0x808B85E8; // type:func -func_808C12C4 = 0x808B8634; // type:func -func_808C1554 = 0x808B88C4; // type:func -func_808C17C8 = 0x808B8B44; // type:func -BossDodongo_AteExplosive = 0x808B8C2C; // type:func -BossDodongo_Init = 0x808B8CEC; // type:func -BossDodongo_Destroy = 0x808B8FC8; // type:func -BossDodongo_SetupIntroCutscene = 0x808B9008; // type:func -BossDodongo_IntroCutscene = 0x808B9088; // type:func -BossDodongo_SetupDamaged = 0x808B9C04; // type:func -BossDodongo_SetupExplode = 0x808B9C98; // type:func -BossDodongo_SetupWalk = 0x808B9D3C; // type:func -BossDodongo_SetupRoll = 0x808B9DCC; // type:func -BossDodongo_SetupBlowFire = 0x808B9E40; // type:func -BossDodongo_SetupInhale = 0x808B9EC8; // type:func -BossDodongo_Damaged = 0x808B9F58; // type:func -BossDodongo_Explode = 0x808BA00C; // type:func -BossDodongo_LayDown = 0x808BA260; // type:func -BossDodongo_Vulnerable = 0x808BA340; // type:func -BossDodongo_GetUp = 0x808BA42C; // type:func -BossDodongo_BlowFire = 0x808BA490; // type:func -BossDodongo_Inhale = 0x808BA5C0; // type:func -BossDodongo_Walk = 0x808BA694; // type:func -BossDodongo_Roll = 0x808BAAA4; // type:func -BossDodongo_Update = 0x808BAEA0; // type:func -BossDodongo_OverrideLimbDraw = 0x808BBCE0; // type:func -BossDodongo_PostLimbDraw = 0x808BBF04; // type:func -BossDodongo_Draw = 0x808BBFE8; // type:func -func_808C4F6C = 0x808BC2B0; // type:func -func_808C50A8 = 0x808BC3EC; // type:func -BossDodongo_PlayerYawCheck = 0x808BC538; // type:func -BossDodongo_PlayerPosCheck = 0x808BC594; // type:func -BossDodongo_SpawnFire = 0x808BC628; // type:func -BossDodongo_UpdateDamage = 0x808BC69C; // type:func -BossDodongo_SetupDeathCutscene = 0x808BC808; // type:func -BossDodongo_DeathCutscene = 0x808BC8C0; // type:func -BossDodongo_UpdateEffects = 0x808BE000; // type:func -BossDodongo_DrawEffects = 0x808BE134; // type:func -BossFd_SpawnEmber = 0x808C2000; // type:func -BossFd_SpawnDebris = 0x808C20CC; // type:func -BossFd_SpawnDust = 0x808C219C; // type:func -BossFd_SpawnFireBreath = 0x808C2234; // type:func -BossFd_SetCameraSpeed = 0x808C2340; // type:func -BossFd_UpdateCamera = 0x808C23E0; // type:func -BossFd_Init = 0x808C254C; // type:func -BossFd_Destroy = 0x808C286C; // type:func -BossFd_IsFacingLink = 0x808C28CC; // type:func -BossFd_SetupFly = 0x808C28FC; // type:func -BossFd_Fly = 0x808C296C; // type:func -BossFd_Wait = 0x808C4FF4; // type:func -BossFd_Effects = 0x808C51E4; // type:func -BossFd_CollisionCheck = 0x808C5E04; // type:func -BossFd_Update = 0x808C5EB8; // type:func -BossFd_UpdateEffects = 0x808C65F8; // type:func -BossFd_DrawEffects = 0x808C6A50; // type:func -BossFd_Draw = 0x808C70F0; // type:func -BossFd_OverrideRightArmDraw = 0x808C71A8; // type:func -BossFd_OverrideLeftArmDraw = 0x808C72C8; // type:func -BossFd_DrawMane = 0x808C73E8; // type:func -BossFd_OverrideHeadDraw = 0x808C786C; // type:func -BossFd_PostHeadDraw = 0x808C7964; // type:func -BossFd_DrawBody = 0x808C79B8; // type:func -BossFd2_SpawnDebris = 0x808C9360; // type:func -BossFd2_SpawnFireBreath = 0x808C9438; // type:func -BossFd2_SpawnEmber = 0x808C954C; // type:func -BossFd2_SpawnSkullPiece = 0x808C9620; // type:func -BossFd2_SpawnDust = 0x808C96F8; // type:func -BossFd2_Init = 0x808C9790; // type:func -BossFd2_Destroy = 0x808C988C; // type:func -BossFd2_SetupEmerge = 0x808C98CC; // type:func -BossFd2_Emerge = 0x808C99C4; // type:func -BossFd2_SetupIdle = 0x808C9D04; // type:func -BossFd2_Idle = 0x808C9DAC; // type:func -BossFd2_SetupBurrow = 0x808C9F00; // type:func -BossFd2_Burrow = 0x808C9F78; // type:func -BossFd2_SetupBreatheFire = 0x808CA048; // type:func -BossFd2_BreatheFire = 0x808CA0AC; // type:func -BossFd2_SetupClawSwipe = 0x808CA5F0; // type:func -BossFd2_ClawSwipe = 0x808CA650; // type:func -BossFd2_SetupVulnerable = 0x808CA6C8; // type:func -BossFd2_Vulnerable = 0x808CA724; // type:func -BossFd2_SetupDamaged = 0x808CA97C; // type:func -BossFd2_Damaged = 0x808CA9D8; // type:func -BossFd2_SetupDeath = 0x808CAB08; // type:func -BossFd2_UpdateCamera = 0x808CAB98; // type:func -BossFd2_Death = 0x808CAD08; // type:func -BossFd2_Wait = 0x808CB38C; // type:func -BossFd2_CollisionCheck = 0x808CB3D4; // type:func -BossFd2_UpdateFace = 0x808CB874; // type:func -BossFd2_Update = 0x808CB9E0; // type:func -BossFd2_OverrideLimbDraw = 0x808CBB94; // type:func -BossFd2_PostLimbDraw = 0x808CBD88; // type:func -BossFd2_UpdateMane = 0x808CBE30; // type:func -BossFd2_DrawMane = 0x808CC404; // type:func -BossFd2_Draw = 0x808CC848; // type:func -BossGanonEff_SpawnWindowShard = 0x808CD090; // type:func -BossGanonEff_SpawnSparkle = 0x808CD1D0; // type:func -BossGanonEff_SpawnLightRay = 0x808CD2CC; // type:func -BossGanonEff_SpawnShock = 0x808CD410; // type:func -BossGanonEff_SpawnLightning = 0x808CD4DC; // type:func -BossGanonEff_SpawnDustDark = 0x808CD580; // type:func -BossGanonEff_SpawnDustLight = 0x808CD674; // type:func -BossGanonEff_SpawnShockwave = 0x808CD758; // type:func -BossGanonEff_SpawnBlackDot = 0x808CD850; // type:func -BossGanon_SetColliderPos = 0x808CD90C; // type:func -BossGanon_SetAnimationObject = 0x808CD950; // type:func -BossGanon_Init = 0x808CD9C0; // type:func -BossGanon_Destroy = 0x808CDF64; // type:func -BossGanon_SetupIntroCutscene = 0x808CDFC8; // type:func -BossGanon_SetIntroCsCamera = 0x808CE0AC; // type:func -BossGanon_IntroCutscene = 0x808CE14C; // type:func -BossGanon_SetupDeathCutscene = 0x808CF84C; // type:func -BossGanon_SetupTowerCutscene = 0x808CF930; // type:func -BossGanon_ShatterWindows = 0x808CFA34; // type:func -BossGanon_DeathAndTowerCutscene = 0x808CFB78; // type:func -BossGanon_SetupPoundFloor = 0x808D1520; // type:func -BossGanon_PoundFloor = 0x808D155C; // type:func -BossGanon_SetupChargeBigMagic = 0x808D1AB0; // type:func -BossGanon_ChargeBigMagic = 0x808D1B20; // type:func -BossGanon_SetupWait = 0x808D2328; // type:func -BossGanon_Wait = 0x808D23B0; // type:func -BossGanon_SetupChargeLightBall = 0x808D26FC; // type:func -BossGanon_ChargeLightBall = 0x808D276C; // type:func -BossGanon_SetupPlayTennis = 0x808D2920; // type:func -BossGanon_PlayTennis = 0x808D2988; // type:func -BossGanon_SetupBlock = 0x808D2C58; // type:func -BossGanon_Block = 0x808D2D10; // type:func -BossGanon_SetupHitByLightBall = 0x808D2EA0; // type:func -BossGanon_HitByLightBall = 0x808D2F94; // type:func -BossGanon_SetupVulnerable = 0x808D31EC; // type:func -BossGanon_Vulnerable = 0x808D33BC; // type:func -BossGanon_SetupDamaged = 0x808D3928; // type:func -BossGanon_Damaged = 0x808D3990; // type:func -BossGanon_UpdateDamage = 0x808D3A50; // type:func -BossGanon_Update = 0x808D3E18; // type:func -BossGanon_OverrideLimbDraw = 0x808D4F80; // type:func -BossGanon_PostLimbDraw = 0x808D51C0; // type:func -BossGanon_InitRand = 0x808D551C; // type:func -BossGanon_RandZeroOne = 0x808D553C; // type:func -BossGanon_DrawShock = 0x808D5664; // type:func -BossGanon_DrawHandLightBall = 0x808D5A10; // type:func -BossGanon_DrawBigMagicCharge = 0x808D5C64; // type:func -BossGanon_DrawTriforce = 0x808D62F4; // type:func -BossGanon_DrawDarkVortex = 0x808D66B8; // type:func -func_808E0254 = 0x808D6910; // type:func -BossGanon_GenShadowTexture = 0x808D6DB8; // type:func -BossGanon_DrawShadowTexture = 0x808D70F8; // type:func -BossGanon_Draw = 0x808D7374; // type:func -BossGanon_CheckFallingPlatforms = 0x808D75BC; // type:func -BossGanon_LightBall_Update = 0x808D76A4; // type:func -BossGanon_LightBall_Draw = 0x808D81C4; // type:func -func_808E1EB4 = 0x808D84D8; // type:func -func_808E229C = 0x808D88C8; // type:func -func_808E2544 = 0x808D8B38; // type:func -func_808E324C = 0x808D984C; // type:func -BossGanon_UpdateEffects = 0x808D9B20; // type:func -BossGanon_DrawEffects = 0x808DA348; // type:func -BossGanon2_InitRand = 0x808F2EC0; // type:func -BossGanon2_RandZeroOne = 0x808F2EE0; // type:func -func_808FD080 = 0x808F3008; // type:func -BossGanon2_SetObjectSegment = 0x808F3098; // type:func -func_808FD210 = 0x808F314C; // type:func -func_808FD27C = 0x808F31BC; // type:func -BossGanon2_Init = 0x808F329C; // type:func -BossGanon2_Destroy = 0x808F33CC; // type:func -func_808FD4D4 = 0x808F341C; // type:func -func_808FD5C4 = 0x808F350C; // type:func -func_808FD5F4 = 0x808F3540; // type:func -func_808FF898 = 0x808F57F0; // type:func -func_808FFA24 = 0x808F597C; // type:func -func_808FFAC8 = 0x808F5A20; // type:func -func_808FFBBC = 0x808F5B18; // type:func -func_808FFC84 = 0x808F5BE4; // type:func -func_808FFCFC = 0x808F5C5C; // type:func -func_808FFDB0 = 0x808F5D10; // type:func -func_808FFEBC = 0x808F5E20; // type:func -func_808FFF90 = 0x808F5EF4; // type:func -func_808FFFE0 = 0x808F5F44; // type:func -func_809000A0 = 0x808F6004; // type:func -func_80900104 = 0x808F6064; // type:func -func_80900210 = 0x808F6170; // type:func -func_8090026C = 0x808F61CC; // type:func -func_809002CC = 0x808F6230; // type:func -func_80900344 = 0x808F62A4; // type:func -func_80900580 = 0x808F64E0; // type:func -func_80900650 = 0x808F65B0; // type:func -func_80900818 = 0x808F6778; // type:func -func_80900890 = 0x808F67F0; // type:func -func_80901020 = 0x808F6F84; // type:func -func_8090109C = 0x808F7000; // type:func -func_8090120C = 0x808F7170; // type:func -func_80902348 = 0x808F82B4; // type:func -BossGanon2_CollisionCheck = 0x808F8494; // type:func -BossGanon2_Update = 0x808F8788; // type:func -func_809034E4 = 0x808F9454; // type:func -func_80903F38 = 0x808F9EA8; // type:func -func_80904108 = 0x808FA034; // type:func -func_80904340 = 0x808FA238; // type:func -func_8090464C = 0x808FA528; // type:func -BossGanon2_OverrideLimbDraw = 0x808FA6BC; // type:func -BossGanon2_PostLimbDraw = 0x808FA7F4; // type:func -func_80904D88 = 0x808FABB8; // type:func -func_80904FC8 = 0x808FADBC; // type:func -func_8090523C = 0x808FAFE0; // type:func -BossGanon2_PostLimbDraw2 = 0x808FB270; // type:func -func_80905674 = 0x808FB39C; // type:func -BossGanon2_Draw = 0x808FB5E4; // type:func -BossGanon2_UpdateEffects = 0x808FBA64; // type:func -BossGanon2_DrawEffects = 0x808FBDA8; // type:func -func_80906538 = 0x808FC1A0; // type:func -BossGanon2_GenShadowTexture = 0x808FC660; // type:func -BossGanon2_DrawShadowTexture = 0x808FC718; // type:func -BossGanondrof_ClearPixels8x8 = 0x80905D30; // type:func -BossGanondrof_ClearPixels16x8 = 0x80905D70; // type:func -BossGanondrof_ClearPixels16x16 = 0x80905DB0; // type:func -BossGanondrof_ClearPixels32x16 = 0x80905DE0; // type:func -BossGanondrof_ClearPixels16x32 = 0x80905E28; // type:func -BossGanondrof_ClearPixels = 0x80905E74; // type:func -BossGanondrof_SetColliderPos = 0x80906124; // type:func -BossGanondrof_Init = 0x80906168; // type:func -BossGanondrof_Destroy = 0x809063F8; // type:func -BossGanondrof_SetupIntro = 0x80906464; // type:func -BossGanondrof_Intro = 0x809064B0; // type:func -BossGanondrof_SetupPaintings = 0x80906968; // type:func -BossGanondrof_Paintings = 0x809069AC; // type:func -BossGanondrof_SetupNeutral = 0x80906B80; // type:func -BossGanondrof_Neutral = 0x80906C00; // type:func -BossGanondrof_SetupThrow = 0x80907348; // type:func -BossGanondrof_Throw = 0x80907470; // type:func -BossGanondrof_SetupReturn = 0x8090767C; // type:func -BossGanondrof_Return = 0x8090771C; // type:func -BossGanondrof_SetupStunned = 0x80907828; // type:func -BossGanondrof_Stunned = 0x809078EC; // type:func -BossGanondrof_SetupBlock = 0x80907A00; // type:func -BossGanondrof_Block = 0x80907A74; // type:func -BossGanondrof_SetupCharge = 0x80907B50; // type:func -BossGanondrof_Charge = 0x80907BC0; // type:func -BossGanondrof_SetupDeath = 0x809082A4; // type:func -BossGanondrof_Death = 0x8090833C; // type:func -BossGanondrof_CollisionCheck = 0x8090922C; // type:func -BossGanondrof_Update = 0x80909458; // type:func -BossGanondrof_OverrideLimbDraw = 0x80909860; // type:func -BossGanondrof_PostLimbDraw = 0x80909C3C; // type:func -BossGanondrof_GetClearPixelDList = 0x80909D00; // type:func -BossGanondrof_EmptyDList = 0x80909D6C; // type:func -BossGanondrof_Draw = 0x80909D90; // type:func -BossGoma_ClearPixels16x16Rgba16 = 0x8090AAC0; // type:func -BossGoma_ClearPixels32x32Rgba16 = 0x8090AAF0; // type:func -BossGoma_ClearPixels = 0x8090AB44; // type:func -BossGoma_Init = 0x8090ACF4; // type:func -BossGoma_PlayEffectsAndSfx = 0x8090AEAC; // type:func -BossGoma_Destroy = 0x8090AFB4; // type:func -BossGoma_SetupDefeated = 0x8090AFF4; // type:func -BossGoma_SetupEncounter = 0x8090B0BC; // type:func -BossGoma_SetupFloorIdle = 0x8090B160; // type:func -BossGoma_SetupCeilingIdle = 0x8090B1E8; // type:func -BossGoma_SetupFallJump = 0x8090B26C; // type:func -BossGoma_SetupFallStruckDown = 0x8090B2E8; // type:func -BossGoma_SetupCeilingSpawnGohmas = 0x8090B364; // type:func -BossGoma_SetupCeilingPrepareSpawnGohmas = 0x8090B3D8; // type:func -BossGoma_SetupWallClimb = 0x8090B450; // type:func -BossGoma_SetupCeilingMoveToCenter = 0x8090B4D4; // type:func -BossGoma_SetupFloorMain = 0x8090B568; // type:func -BossGoma_SetupFloorLand = 0x8090B5E8; // type:func -BossGoma_SetupFloorLandStruckDown = 0x8090B674; // type:func -BossGoma_SetupFloorStunned = 0x8090B718; // type:func -BossGoma_SetupFloorAttackPosture = 0x8090B788; // type:func -BossGoma_SetupFloorPrepareAttack = 0x8090B7FC; // type:func -BossGoma_SetupFloorAttack = 0x8090B870; // type:func -BossGoma_SetupFloorDamaged = 0x8090B8EC; // type:func -BossGoma_UpdateCeilingMovement = 0x8090B960; // type:func -BossGoma_SetupEncounterState4 = 0x8090BB9C; // type:func -BossGoma_Encounter = 0x8090BD4C; // type:func -BossGoma_Defeated = 0x8090CE44; // type:func -BossGoma_FloorAttackPosture = 0x8090DCB4; // type:func -BossGoma_FloorPrepareAttack = 0x8090DDBC; // type:func -BossGoma_FloorAttack = 0x8090DE18; // type:func -BossGoma_FloorDamaged = 0x8090E068; // type:func -BossGoma_FloorLandStruckDown = 0x8090E100; // type:func -BossGoma_FloorLand = 0x8090E1A4; // type:func -BossGoma_FloorStunned = 0x8090E200; // type:func -BossGoma_FallJump = 0x8090E32C; // type:func -BossGoma_FallStruckDown = 0x8090E3E0; // type:func -BossGoma_CeilingSpawnGohmas = 0x8090E4A0; // type:func -BossGoma_CeilingPrepareSpawnGohmas = 0x8090E5FC; // type:func -BossGoma_FloorIdle = 0x8090E658; // type:func -BossGoma_CeilingIdle = 0x8090E6C0; // type:func -BossGoma_FloorMain = 0x8090E7B8; // type:func -BossGoma_WallClimb = 0x8090EA28; // type:func -BossGoma_CeilingMoveToCenter = 0x8090EAF4; // type:func -BossGoma_UpdateEye = 0x8090ECF0; // type:func -BossGoma_UpdateTailLimbsScale = 0x8090EF38; // type:func -BossGoma_UpdateHit = 0x8090F044; // type:func -BossGoma_UpdateMainEnvColor = 0x8090F224; // type:func -BossGoma_UpdateEyeEnvColor = 0x8090F3A0; // type:func -BossGoma_Update = 0x8090F448; // type:func -BossGoma_OverrideLimbDraw = 0x8090F618; // type:func -BossGoma_PostLimbDraw = 0x8090FA64; // type:func -BossGoma_EmptyDlist = 0x8090FC68; // type:func -BossGoma_NoBackfaceCullingDlist = 0x8090FC8C; // type:func -BossGoma_Draw = 0x8090FCF8; // type:func -BossGoma_SpawnChildGohma = 0x8090FDE8; // type:func -BossMo_InitRand = 0x80910A60; // type:func -BossMo_RandZeroOne = 0x80910A80; // type:func -BossMo_NearLand = 0x80910BA8; // type:func -BossMo_SpawnRipple = 0x80910CA0; // type:func -BossMo_SpawnDroplet = 0x80910DC0; // type:func -BossMo_SpawnStillDroplet = 0x80910E9C; // type:func -BossMo_SpawnBubble = 0x80910F60; // type:func -BossMo_Init = 0x80911014; // type:func -BossMo_Destroy = 0x809113FC; // type:func -BossMo_SetupTentacle = 0x8091144C; // type:func -BossMo_Tentacle = 0x809114A0; // type:func -BossMo_TentCollisionCheck = 0x80914260; // type:func -BossMo_IntroCs = 0x8091450C; // type:func -BossMo_DeathCs = 0x80915624; // type:func -BossMo_CoreCollisionCheck = 0x809161E0; // type:func -BossMo_Core = 0x809165E8; // type:func -BossMo_UpdateCore = 0x80917C4C; // type:func -BossMo_UpdateTent = 0x80917E7C; // type:func -BossMo_UpdateTentColliders = 0x809186B4; // type:func -BossMo_DrawTentacle = 0x80918760; // type:func -BossMo_DrawWater = 0x80918E90; // type:func -BossMo_DrawCore = 0x809190A0; // type:func -BossMo_DrawTent = 0x80919928; // type:func -BossMo_UpdateEffects = 0x80919B5C; // type:func -BossMo_DrawEffects = 0x8091A26C; // type:func -BossMo_Unknown = 0x8091A998; // type:func -BossSst_Init = 0x80921040; // type:func -BossSst_Destroy = 0x809214C8; // type:func -BossSst_HeadSetupLurk = 0x80921514; // type:func -BossSst_HeadLurk = 0x80921548; // type:func -BossSst_HeadSetupIntro = 0x80921584; // type:func -BossSst_HeadIntro = 0x809216D0; // type:func -BossSst_HeadSetupWait = 0x809224E8; // type:func -BossSst_HeadWait = 0x80922538; // type:func -BossSst_HeadSetupNeutral = 0x809225B4; // type:func -BossSst_HeadNeutral = 0x809225D4; // type:func -BossSst_HeadSetupDamagedHand = 0x80922778; // type:func -BossSst_HeadDamagedHand = 0x809227E0; // type:func -BossSst_HeadSetupReadyCharge = 0x809228D8; // type:func -BossSst_HeadReadyCharge = 0x80922930; // type:func -BossSst_HeadSetupCharge = 0x809229D4; // type:func -BossSst_HeadCharge = 0x80922A90; // type:func -BossSst_HeadSetupEndCharge = 0x80922CF0; // type:func -BossSst_HeadEndCharge = 0x80922D74; // type:func -BossSst_HeadSetupFrozenHand = 0x80922DE4; // type:func -BossSst_HeadFrozenHand = 0x80922E38; // type:func -BossSst_HeadSetupUnfreezeHand = 0x80922E80; // type:func -BossSst_HeadUnfreezeHand = 0x80922ECC; // type:func -BossSst_HeadSetupStunned = 0x80922F08; // type:func -BossSst_HeadStunned = 0x80922FA8; // type:func -BossSst_HeadSetupVulnerable = 0x8092322C; // type:func -BossSst_HeadVulnerable = 0x809232CC; // type:func -BossSst_HeadSetupDamage = 0x809233CC; // type:func -BossSst_HeadDamage = 0x8092349C; // type:func -BossSst_HeadSetupRecover = 0x809234EC; // type:func -BossSst_HeadRecover = 0x80923578; // type:func -BossSst_SetCameraTargets = 0x8092370C; // type:func -BossSst_UpdateDeathCamera = 0x80923838; // type:func -BossSst_HeadSetupDeath = 0x809239C4; // type:func -BossSst_HeadDeath = 0x80923B58; // type:func -BossSst_HeadSetupThrash = 0x80923DA8; // type:func -BossSst_HeadThrash = 0x80923E10; // type:func -BossSst_HeadSetupDarken = 0x80923E8C; // type:func -BossSst_HeadDarken = 0x80923ED4; // type:func -BossSst_HeadSetupFall = 0x809240FC; // type:func -BossSst_HeadFall = 0x80924194; // type:func -BossSst_HeadSetupMelt = 0x80924230; // type:func -BossSst_HeadMelt = 0x80924280; // type:func -BossSst_HeadSetupFinish = 0x80924338; // type:func -BossSst_HeadFinish = 0x80924394; // type:func -BossSst_HandSetupWait = 0x8092468C; // type:func -BossSst_HandWait = 0x80924708; // type:func -BossSst_HandSetupDownbeat = 0x80924878; // type:func -BossSst_HandDownbeat = 0x809248EC; // type:func -BossSst_HandSetupDownbeatEnd = 0x80924A3C; // type:func -BossSst_HandDownbeatEnd = 0x80924A98; // type:func -BossSst_HandSetupOffbeat = 0x80924B8C; // type:func -BossSst_HandOffbeat = 0x80924C00; // type:func -BossSst_HandSetupOffbeatEnd = 0x80924CE0; // type:func -BossSst_HandOffbeatEnd = 0x80924D2C; // type:func -BossSst_HandSetupEndSlam = 0x80924E70; // type:func -BossSst_HandEndSlam = 0x80924EE4; // type:func -BossSst_HandSetupRetreat = 0x80924F20; // type:func -BossSst_HandRetreat = 0x80924FC8; // type:func -BossSst_HandSetupReadySlam = 0x809251F4; // type:func -BossSst_HandReadySlam = 0x80925260; // type:func -BossSst_HandSetupSlam = 0x80925350; // type:func -BossSst_HandSlam = 0x809253E0; // type:func -BossSst_HandSetupReadySweep = 0x809255C4; // type:func -BossSst_HandReadySweep = 0x8092566C; // type:func -BossSst_HandSetupSweep = 0x80925790; // type:func -BossSst_HandSweep = 0x8092581C; // type:func -BossSst_HandSetupReadyPunch = 0x80925A2C; // type:func -BossSst_HandReadyPunch = 0x80925A94; // type:func -BossSst_HandSetupPunch = 0x80925AF0; // type:func -BossSst_HandPunch = 0x80925B78; // type:func -BossSst_HandSetupReadyClap = 0x80925CBC; // type:func -BossSst_HandReadyClap = 0x80925DAC; // type:func -BossSst_HandSetupClap = 0x80925F9C; // type:func -BossSst_HandClap = 0x8092600C; // type:func -BossSst_HandSetupEndClap = 0x80926238; // type:func -BossSst_HandEndClap = 0x809262A4; // type:func -BossSst_HandSetupReadyGrab = 0x80926348; // type:func -BossSst_HandReadyGrab = 0x809263CC; // type:func -BossSst_HandSetupGrab = 0x80926474; // type:func -BossSst_HandGrab = 0x80926500; // type:func -BossSst_HandSetupCrush = 0x809267AC; // type:func -BossSst_HandCrush = 0x80926804; // type:func -BossSst_HandSetupEndCrush = 0x8092691C; // type:func -BossSst_HandEndCrush = 0x8092696C; // type:func -BossSst_HandSetupSwing = 0x809269A8; // type:func -BossSst_HandSwing = 0x80926A30; // type:func -BossSst_HandSetupReel = 0x80926D64; // type:func -BossSst_HandReel = 0x80926DFC; // type:func -BossSst_HandSetupReadyShake = 0x80926F54; // type:func -BossSst_HandReadyShake = 0x80926FA4; // type:func -BossSst_HandSetupShake = 0x8092710C; // type:func -BossSst_HandShake = 0x80927128; // type:func -BossSst_HandSetupReadyCharge = 0x809272BC; // type:func -BossSst_HandReadyCharge = 0x80927310; // type:func -BossSst_HandSetupStunned = 0x80927488; // type:func -BossSst_HandStunned = 0x80927534; // type:func -BossSst_HandSetupDamage = 0x80927690; // type:func -BossSst_HandDamage = 0x809276EC; // type:func -BossSst_HandSetupThrash = 0x809277C4; // type:func -BossSst_HandThrash = 0x80927860; // type:func -BossSst_HandSetupDarken = 0x80927A54; // type:func -BossSst_HandDarken = 0x80927AA4; // type:func -BossSst_HandSetupFall = 0x80927B18; // type:func -BossSst_HandFall = 0x80927B68; // type:func -BossSst_HandSetupMelt = 0x80927BEC; // type:func -BossSst_HandMelt = 0x80927C28; // type:func -BossSst_HandSetupFinish = 0x80927CA0; // type:func -BossSst_HandFinish = 0x80927CCC; // type:func -BossSst_HandSetupRecover = 0x80927CF8; // type:func -BossSst_HandRecover = 0x80927D4C; // type:func -BossSst_HandSetupFrozen = 0x80927DE4; // type:func -BossSst_HandFrozen = 0x80927EB0; // type:func -BossSst_HandSetupReadyBreakIce = 0x80928010; // type:func -BossSst_HandReadyBreakIce = 0x809280C4; // type:func -BossSst_HandSetupBreakIce = 0x809281E0; // type:func -BossSst_HandBreakIce = 0x80928208; // type:func -BossSst_HandGrabPlayer = 0x8092839C; // type:func -BossSst_HandReleasePlayer = 0x8092843C; // type:func -BossSst_MoveAround = 0x809284C0; // type:func -BossSst_HandSelectAttack = 0x8092864C; // type:func -BossSst_HandSetDamage = 0x80928748; // type:func -BossSst_HandSetInvulnerable = 0x809287B4; // type:func -BossSst_HeadSfx = 0x809287F4; // type:func -BossSst_HandCollisionCheck = 0x80928820; // type:func -BossSst_HeadCollisionCheck = 0x809289AC; // type:func -BossSst_UpdateHand = 0x80928AF8; // type:func -BossSst_UpdateHead = 0x80928E08; // type:func -BossSst_OverrideHandDraw = 0x80929078; // type:func -BossSst_PostHandDraw = 0x809290C8; // type:func -BossSst_OverrideHandTrailDraw = 0x80929104; // type:func -BossSst_DrawHand = 0x80929148; // type:func -BossSst_OverrideHeadDraw = 0x809294F4; // type:func -BossSst_PostHeadDraw = 0x80929CF8; // type:func -BossSst_DrawHead = 0x80929DA0; // type:func -BossSst_SpawnHeadShadow = 0x8092A1F0; // type:func -BossSst_SpawnHandShadow = 0x8092A31C; // type:func -BossSst_SpawnShockwave = 0x8092A3D0; // type:func -BossSst_SpawnIceCrystal = 0x8092A4AC; // type:func -BossSst_SpawnIceShard = 0x8092A768; // type:func -BossSst_IceShatter = 0x8092A9BC; // type:func -BossSst_UpdateEffects = 0x8092AB88; // type:func -BossSst_DrawEffects = 0x8092AE2C; // type:func -BossTw_AddDotEffect = 0x8092D610; // type:func -BossTw_AddDmgCloud = 0x8092D704; // type:func -BossTw_AddRingEffect = 0x8092D800; // type:func -BossTw_AddPlayerFreezeEffect = 0x8092D904; // type:func -BossTw_AddFlameEffect = 0x8092D9B0; // type:func -BossTw_AddMergeFlameEffect = 0x8092DA88; // type:func -BossTw_AddShieldBlastEffect = 0x8092DB90; // type:func -BossTw_AddShieldDeflectEffect = 0x8092DC78; // type:func -BossTw_AddShieldHitEffect = 0x8092DE40; // type:func -BossTw_Init = 0x8092E008; // type:func -BossTw_Destroy = 0x8092E824; // type:func -BossTw_SetupTurnToPlayer = 0x8092E88C; // type:func -BossTw_TurnToPlayer = 0x8092E8DC; // type:func -BossTw_SetupFlyTo = 0x8092E9FC; // type:func -BossTw_FlyTo = 0x8092EC00; // type:func -BossTw_SetupShootBeam = 0x8092EE34; // type:func -BossTw_SpawnGroundBlast = 0x8092EF1C; // type:func -BossTw_BeamHitPlayerCheck = 0x8092F298; // type:func -BossTw_CheckBeamReflection = 0x8092F490; // type:func -BossTw_BeamReflHitCheck = 0x8092F718; // type:func -BossTw_GetFloorY = 0x8092F840; // type:func -BossTw_ShootBeam = 0x8092FB14; // type:func -BossTw_SetupFinishBeamShoot = 0x80930ACC; // type:func -BossTw_FinishBeamShoot = 0x80930B28; // type:func -BossTw_SetupHitByBeam = 0x80930BC0; // type:func -BossTw_HitByBeam = 0x80930C28; // type:func -BossTw_SetupLaugh = 0x80930EF0; // type:func -BossTw_Laugh = 0x80930F54; // type:func -BossTw_SetupSpin = 0x80930FE4; // type:func -BossTw_Spin = 0x80931060; // type:func -BossTw_SetupMergeCS = 0x80931100; // type:func -BossTw_MergeCS = 0x8093114C; // type:func -BossTw_SetupWait = 0x80931190; // type:func -BossTw_Wait = 0x809311C8; // type:func -BossTw_TwinrovaSetupMergeCS = 0x8093126C; // type:func -BossTw_TwinrovaMergeCS = 0x8093128C; // type:func -BossTw_SetupDeathCS = 0x80931D58; // type:func -BossTw_DeathCS = 0x80931DC0; // type:func -BossTw_SetupCSWait = 0x80931EC8; // type:func -BossTw_CSWait = 0x80931F00; // type:func -BossTw_TwinrovaSetupIntroCS = 0x80931F10; // type:func -BossTw_TwinrovaIntroCS = 0x80931F48; // type:func -BossTw_DeathBall = 0x8093379C; // type:func -BossTw_TwinrovaSetupDeathCS = 0x80933A98; // type:func -BossTw_DeathCSMsgSfx = 0x80933B54; // type:func -BossTw_TwinrovaDeathCS = 0x80934374; // type:func -BossTw_Update = 0x80935068; // type:func -BossTw_TwinrovaUpdate = 0x809356DC; // type:func -BossTw_OverrideLimbDraw = 0x80936058; // type:func -BossTw_PostLimbDraw = 0x8093610C; // type:func -func_80941BC0 = 0x80936524; // type:func -func_80942180 = 0x80936A9C; // type:func -func_809426F0 = 0x80936FB8; // type:func -func_80942C70 = 0x80937500; // type:func -func_80943028 = 0x80937870; // type:func -BossTw_Draw = 0x80937A74; // type:func -BossTw_TwinrovaOverrideLimbDraw = 0x80938130; // type:func -BossTw_TwinrovaPostLimbDraw = 0x8093855C; // type:func -BossTw_ShieldChargeDraw = 0x80938698; // type:func -BossTw_SpawnPortalDraw = 0x80938F00; // type:func -func_80944C50 = 0x80939338; // type:func -BossTw_TwinrovaDraw = 0x8093971C; // type:func -BossTw_BlastFire = 0x80939A54; // type:func -BossTw_BlastIce = 0x8093A38C; // type:func -BossTw_BlastShieldCheck = 0x8093AF00; // type:func -BossTw_BlastUpdate = 0x8093B190; // type:func -BossTw_BlastDraw = 0x8093B30C; // type:func -BossTw_DrawDeathBall = 0x8093B890; // type:func -BossTw_UpdateEffects = 0x8093BDF0; // type:func -BossTw_InitRand = 0x8093CB48; // type:func -BossTw_RandZeroOne = 0x8093CB68; // type:func -BossTw_DrawEffects = 0x8093CC90; // type:func -BossTw_TwinrovaSetupArriveAtTarget = 0x8093DAC4; // type:func -BossTw_TwinrovaArriveAtTarget = 0x8093DB38; // type:func -BossTw_TwinrovaSetupChargeBlast = 0x8093DC64; // type:func -BossTw_TwinrovaChargeBlast = 0x8093DCC4; // type:func -BossTw_TwinrovaSetupShootBlast = 0x8093DEB0; // type:func -BossTw_TwinrovaShootBlast = 0x8093DF38; // type:func -BossTw_TwinrovaSetupDoneBlastShoot = 0x8093E188; // type:func -BossTw_TwinrovaDoneBlastShoot = 0x8093E1D4; // type:func -BossTw_TwinrovaDamage = 0x8093E26C; // type:func -BossTw_TwinrovaStun = 0x8093E398; // type:func -BossTw_TwinrovaSetupGetUp = 0x8093E64C; // type:func -BossTw_TwinrovaGetUp = 0x8093E6B0; // type:func -BossTw_TwinrovaSetupFly = 0x8093E744; // type:func -BossTw_TwinrovaFly = 0x8093E91C; // type:func -BossTw_TwinrovaSetupSpin = 0x8093EB90; // type:func -BossTw_TwinrovaSpin = 0x8093EBE8; // type:func -BossTw_TwinrovaSetupLaugh = 0x8093EC60; // type:func -BossTw_TwinrovaLaugh = 0x8093ECC4; // type:func -BossVa_SetupAction = 0x809431E0; // type:func -BossVa_AttachToBody = 0x809431EC; // type:func -BossVa_BloodDroplets = 0x80943430; // type:func -BossVa_BloodSplatter = 0x80943530; // type:func -BossVa_Gore = 0x8094365C; // type:func -BossVa_Spark = 0x8094378C; // type:func -BossVa_Tumor = 0x80943910; // type:func -BossVa_SetSparkEnv = 0x80943A94; // type:func -BossVa_SetDeathEnv = 0x80943AE0; // type:func -BossVa_FindBoomerang = 0x80943B60; // type:func -BossVa_KillBari = 0x80943BA0; // type:func -BossVa_Init = 0x80943D8C; // type:func -BossVa_Destroy = 0x809445DC; // type:func -BossVa_SetupIntro = 0x8094462C; // type:func -BossVa_BodyIntro = 0x809446BC; // type:func -BossVa_SetupBodyPhase1 = 0x809456DC; // type:func -BossVa_BodyPhase1 = 0x80945780; // type:func -BossVa_SetupBodyPhase2 = 0x80945A18; // type:func -BossVa_BodyPhase2 = 0x80945B44; // type:func -BossVa_SetupBodyPhase3 = 0x80946048; // type:func -BossVa_BodyPhase3 = 0x80946084; // type:func -BossVa_SetupBodyPhase4 = 0x809466EC; // type:func -BossVa_BodyPhase4 = 0x809467A0; // type:func -BossVa_SetupBodyDeath = 0x809472A8; // type:func -BossVa_BodyDeath = 0x80947340; // type:func -BossVa_SetupSupportIntro = 0x80947E98; // type:func -BossVa_SupportIntro = 0x80947F10; // type:func -BossVa_SetupSupportAttached = 0x80948034; // type:func -BossVa_SupportAttached = 0x809480B8; // type:func -BossVa_SetupSupportCut = 0x809482E0; // type:func -BossVa_SupportCut = 0x809483A8; // type:func -BossVa_SetupStump = 0x8094887C; // type:func -BossVa_Stump = 0x80948900; // type:func -BossVa_SetupZapperIntro = 0x80948998; // type:func -BossVa_ZapperIntro = 0x80948A2C; // type:func -BossVa_SetupZapperAttack = 0x80948AEC; // type:func -BossVa_ZapperAttack = 0x80948B80; // type:func -BossVa_SetupZapperDamaged = 0x809495B4; // type:func -BossVa_ZapperDamaged = 0x809496BC; // type:func -BossVa_SetupZapperDeath = 0x809497D0; // type:func -BossVa_ZapperDeath = 0x809498A4; // type:func -BossVa_SetupZapperEnraged = 0x80949DCC; // type:func -BossVa_ZapperEnraged = 0x80949E54; // type:func -BossVa_SetupZapperHold = 0x8094A5AC; // type:func -BossVa_ZapperHold = 0x8094A62C; // type:func -BossVa_SetupBariIntro = 0x8094A738; // type:func -BossVa_BariIntro = 0x8094A848; // type:func -BossVa_SetupBariPhase3Attack = 0x8094ADA0; // type:func -BossVa_BariPhase3Attack = 0x8094AE48; // type:func -BossVa_SetupBariPhase2Attack = 0x8094B248; // type:func -BossVa_BariPhase2Attack = 0x8094B2F0; // type:func -BossVa_SetupBariPhase3Stunned = 0x8094B908; // type:func -BossVa_BariPhase3Stunned = 0x8094B964; // type:func -BossVa_SetupBariDeath = 0x8094BB80; // type:func -BossVa_BariDeath = 0x8094BBD8; // type:func -BossVa_SetupDoor = 0x8094BC0C; // type:func -BossVa_Door = 0x8094BC5C; // type:func -BossVa_Update = 0x8094BCD0; // type:func -BossVa_BodyOverrideLimbDraw = 0x8094BEDC; // type:func -BossVa_BodyPostLimbDraw = 0x8094C080; // type:func -BossVa_SupportOverrideLimbDraw = 0x8094C584; // type:func -BossVa_SupportPostLimbDraw = 0x8094C5C8; // type:func -BossVa_ZapperOverrideLimbDraw = 0x8094C818; // type:func -BossVa_ZapperPostLimbDraw = 0x8094C9F4; // type:func -BossVa_BariOverrideLimbDraw = 0x8094CE54; // type:func -BossVa_BariPostLimbDraw = 0x8094CEE4; // type:func -BossVa_Draw = 0x8094D070; // type:func -BossVa_UpdateEffects = 0x8094D668; // type:func -BossVa_DrawEffects = 0x8094E008; // type:func -BossVa_SpawnSpark = 0x8094EE10; // type:func -BossVa_SpawnSparkBall = 0x8094F100; // type:func -BossVa_SpawnBloodDroplets = 0x8094F28C; // type:func -BossVa_SpawnBloodSplatter = 0x8094F458; // type:func -BossVa_SpawnTumor = 0x8094F5F4; // type:func -BossVa_SpawnGore = 0x8094F798; // type:func -BossVa_SpawnZapperCharge = 0x8094F9B8; // type:func -BossVa_DrawDoor = 0x8094FB0C; // type:func -Demo6K_SetupAction = 0x8095A470; // type:func -Demo6K_Init = 0x8095A47C; // type:func -Demo6K_Destroy = 0x8095A864; // type:func -Demo6K_WaitForObject = 0x8095A898; // type:func -func_80966E04 = 0x8095A8F0; // type:func -func_80966E98 = 0x8095A988; // type:func -func_80966F84 = 0x8095AA7C; // type:func -func_809670AC = 0x8095ABA4; // type:func -func_8096712C = 0x8095AC24; // type:func -func_80967244 = 0x8095AD3C; // type:func -func_80967410 = 0x8095AF08; // type:func -func_809674E0 = 0x8095AFD8; // type:func -func_809676A4 = 0x8095B19C; // type:func -func_8096784C = 0x8095B344; // type:func -func_80967A04 = 0x8095B500; // type:func -func_80967AD0 = 0x8095B5CC; // type:func -func_80967BF8 = 0x8095B6F8; // type:func -func_80967DBC = 0x8095B8BC; // type:func -func_80967F10 = 0x8095BA08; // type:func -Demo6K_Update = 0x8095BAD4; // type:func -func_80967FFC = 0x8095BAF8; // type:func -func_80968298 = 0x8095BD54; // type:func -func_8096865C = 0x8095C0D8; // type:func -func_809688C4 = 0x8095C2F8; // type:func -func_80968B70 = 0x8095C574; // type:func -func_80968FB0 = 0x8095C974; // type:func -func_809691BC = 0x8095CB38; // type:func -DemoDu_Destroy = 0x8095D1D0; // type:func -DemoDu_UpdateEyes = 0x8095D1F4; // type:func -DemoDu_SetEyeTexIndex = 0x8095D27C; // type:func -DemoDu_SetMouthTexIndex = 0x8095D294; // type:func -DemoDu_UpdateSkelAnime = 0x8095D2AC; // type:func -DemoDu_UpdateBgCheckInfo = 0x8095D2D0; // type:func -DemoDu_GetCue = 0x8095D318; // type:func -DemoDu_CheckForCue = 0x8095D340; // type:func -DemoDu_CheckForNoCue = 0x8095D38C; // type:func -DemoDu_SetStartPosRotFromCue = 0x8095D3D8; // type:func -func_80969DDC = 0x8095D458; // type:func -DemoDu_InitCs_FireMedallion = 0x8095D4E8; // type:func -DemoDu_CsFireMedallion_SpawnDoorWarp = 0x8095D558; // type:func -func_80969F38 = 0x8095D5B4; // type:func -func_80969FB4 = 0x8095D630; // type:func -DemoDu_CsFireMedallion_AdvanceTo01 = 0x8095D650; // type:func -DemoDu_CsFireMedallion_AdvanceTo02 = 0x8095D6E8; // type:func -DemoDu_CsFireMedallion_AdvanceTo03 = 0x8095D738; // type:func -DemoDu_CsFireMedallion_AdvanceTo04 = 0x8095D764; // type:func -DemoDu_CsFireMedallion_AdvanceTo05 = 0x8095D7F8; // type:func -DemoDu_CsFireMedallion_AdvanceTo06 = 0x8095D864; // type:func -DemoDu_UpdateCs_FM_00 = 0x8095D8B0; // type:func -DemoDu_UpdateCs_FM_01 = 0x8095D8D0; // type:func -DemoDu_UpdateCs_FM_02 = 0x8095D8F0; // type:func -DemoDu_UpdateCs_FM_03 = 0x8095D924; // type:func -DemoDu_UpdateCs_FM_04 = 0x8095D964; // type:func -DemoDu_UpdateCs_FM_05 = 0x8095D99C; // type:func -DemoDu_UpdateCs_FM_06 = 0x8095D9DC; // type:func -DemoDu_InitCs_GoronsRuby = 0x8095DA08; // type:func -DemoDu_CsPlaySfx_GoronLanding = 0x8095DA58; // type:func -DemoDu_CsPlaySfx_DaruniaFalling = 0x8095DA80; // type:func -DemoDu_CsPlaySfx_DaruniaHitsLink = 0x8095DAB0; // type:func -DemoDu_CsPlaySfx_HitBreast = 0x8095DB08; // type:func -DemoDu_CsPlaySfx_LinkEscapeFromGorons = 0x8095DB30; // type:func -DemoDu_CsPlaySfx_LinkSurprised = 0x8095DB88; // type:func -DemoDu_CsGoronsRuby_UpdateFaceTextures = 0x8095DBE0; // type:func -func_8096A630 = 0x8095DCE8; // type:func -DemoDu_CsGoronsRuby_SpawnDustWhenHittingLink = 0x8095DD9C; // type:func -DemoDu_CsGoronsRuby_DaruniaFalling = 0x8095E030; // type:func -DemoDu_CsGoronsRuby_AdvanceTo01 = 0x8095E10C; // type:func -DemoDu_CsGoronsRuby_AdvanceTo02 = 0x8095E120; // type:func -DemoDu_CsGoronsRuby_AdvanceTo03 = 0x8095E1C4; // type:func -DemoDu_CsGoronsRuby_AdvanceTo04 = 0x8095E218; // type:func -DemoDu_CsGoronsRuby_AdvanceTo05 = 0x8095E250; // type:func -DemoDu_CsGoronsRuby_AdvanceTo06 = 0x8095E2BC; // type:func -DemoDu_CsGoronsRuby_AdvanceTo07 = 0x8095E354; // type:func -DemoDu_CsGoronsRuby_AdvanceTo08 = 0x8095E3C0; // type:func -DemoDu_CsGoronsRuby_AdvanceTo09 = 0x8095E454; // type:func -DemoDu_CsGoronsRuby_AdvanceTo10 = 0x8095E4C4; // type:func -DemoDu_CsGoronsRuby_AdvanceTo11 = 0x8095E530; // type:func -DemoDu_CsGoronsRuby_AdvanceTo12 = 0x8095E5C4; // type:func -DemoDu_CsGoronsRuby_AdvanceTo13 = 0x8095E630; // type:func -DemoDu_UpdateCs_GR_00 = 0x8095E6C0; // type:func -DemoDu_UpdateCs_GR_01 = 0x8095E6F4; // type:func -DemoDu_UpdateCs_GR_02 = 0x8095E730; // type:func -DemoDu_UpdateCs_GR_03 = 0x8095E78C; // type:func -DemoDu_UpdateCs_GR_04 = 0x8095E7CC; // type:func -DemoDu_UpdateCs_GR_05 = 0x8095E81C; // type:func -DemoDu_UpdateCs_GR_06 = 0x8095E868; // type:func -DemoDu_UpdateCs_GR_07 = 0x8095E8C8; // type:func -DemoDu_UpdateCs_GR_08 = 0x8095E914; // type:func -DemoDu_UpdateCs_GR_09 = 0x8095E978; // type:func -DemoDu_UpdateCs_GR_10 = 0x8095E9D8; // type:func -DemoDu_UpdateCs_GR_11 = 0x8095EA24; // type:func -DemoDu_UpdateCs_GR_12 = 0x8095EA74; // type:func -DemoDu_UpdateCs_GR_13 = 0x8095EAC0; // type:func -DemoDu_InitCs_AfterGanon = 0x8095EB08; // type:func -DemoDu_CsPlaySfx_WhiteOut = 0x8095EBA8; // type:func -DemoDu_CsAfterGanon_SpawnDemo6K = 0x8095EBC8; // type:func -DemoDu_CsAfterGanon_AdvanceTo01 = 0x8095EC48; // type:func -DemoDu_CsAfterGanon_AdvanceTo02 = 0x8095EC9C; // type:func -DemoDu_CsAfterGanon_BackTo01 = 0x8095EDF0; // type:func -DemoDu_UpdateCs_AG_00 = 0x8095EE8C; // type:func -DemoDu_UpdateCs_AG_01 = 0x8095EEAC; // type:func -DemoDu_UpdateCs_AG_02 = 0x8095EEF4; // type:func -DemoDu_Draw_02 = 0x8095EF3C; // type:func -DemoDu_InitCs_Credits = 0x8095F0F8; // type:func -DemoDu_CsCredits_UpdateShadowAlpha = 0x8095F164; // type:func -DemoDu_CsCredits_AdvanceTo01 = 0x8095F1F0; // type:func -DemoDu_CsCredits_AdvanceTo02 = 0x8095F228; // type:func -DemoDu_CsCredits_AdvanceTo03 = 0x8095F274; // type:func -DemoDu_CsCredits_AdvanceTo04 = 0x8095F2B4; // type:func -DemoDu_CsCredits_BackTo02 = 0x8095F2F4; // type:func -DemoDu_CsCredits_HandleCues = 0x8095F33C; // type:func -DemoDu_UpdateCs_CR_00 = 0x8095F3E8; // type:func -DemoDu_UpdateCs_CR_01 = 0x8095F408; // type:func -DemoDu_UpdateCs_CR_02 = 0x8095F454; // type:func -DemoDu_UpdateCs_CR_03 = 0x8095F49C; // type:func -DemoDu_UpdateCs_CR_04 = 0x8095F4E4; // type:func -DemoDu_Update = 0x8095F528; // type:func -DemoDu_Init = 0x8095F570; // type:func -DemoDu_Draw_NoDraw = 0x8095F614; // type:func -DemoDu_Draw_01 = 0x8095F624; // type:func -DemoDu_Draw = 0x8095F7CC; // type:func -DemoEc_Destroy = 0x809609B0; // type:func -DemoEc_Init = 0x809609D4; // type:func -DemoEc_UpdateSkelAnime = 0x80960A1C; // type:func -DemoEc_UpdateBgFlags = 0x80960A40; // type:func -func_8096D594 = 0x80960A88; // type:func -func_8096D5D4 = 0x80960AC8; // type:func -func_8096D64C = 0x80960B40; // type:func -DemoEc_UpdateEyes = 0x80960B80; // type:func -DemoEc_SetEyeTexIndex = 0x80960C08; // type:func -DemoEc_InitSkelAnime = 0x80960C20; // type:func -DemoEc_ChangeAnimation = 0x80960C98; // type:func -DemoEc_AllocColorDList = 0x80960D54; // type:func -DemoEc_DrawSkeleton = 0x80960DAC; // type:func -DemoEc_DrawSkeletonCustomColor = 0x80960F3C; // type:func -DemoEc_UseDrawObject = 0x8096119C; // type:func -DemoEc_UseAnimationObject = 0x809611F8; // type:func -DemoEc_GetCue = 0x80961230; // type:func -DemoEc_SetStartPosRotFromCue = 0x80961258; // type:func -DemoEc_InitIngo = 0x809612D8; // type:func -DemoEc_UpdateIngo = 0x80961378; // type:func -DemoEc_DrawIngo = 0x809613B8; // type:func -DemoEc_InitTalon = 0x809613EC; // type:func -DemoEc_UpdateTalon = 0x8096148C; // type:func -DemoEc_DrawTalon = 0x809614CC; // type:func -DemoEc_InitWindmillMan = 0x80961500; // type:func -DemoEc_UpdateWindmillMan = 0x809615A0; // type:func -DemoEc_DrawWindmillMan = 0x809615E0; // type:func -DemoEc_InitKokiriBoy = 0x80961614; // type:func -DemoEc_InitDancingKokiriBoy = 0x809616B4; // type:func -DemoEc_UpdateKokiriBoy = 0x80961758; // type:func -DemoEc_UpdateDancingKokiriBoy = 0x80961798; // type:func -DemoEc_DrawKokiriBoy = 0x809617B8; // type:func -DemoEc_InitKokiriGirl = 0x809617FC; // type:func -DemoEc_InitDancingKokiriGirl = 0x8096189C; // type:func -DemoEc_UpdateKokiriGirl = 0x80961940; // type:func -DemoEc_UpdateDancingKokiriGirl = 0x80961988; // type:func -DemoEc_DrawKokiriGirl = 0x809619A8; // type:func -DemoEc_InitOldMan = 0x809619FC; // type:func -DemoEc_UpdateOldMan = 0x80961A9C; // type:func -DemoEc_DrawOldMan = 0x80961AE4; // type:func -DemoEc_InitBeardedMan = 0x80961B38; // type:func -DemoEc_UpdateBeardedMan = 0x80961BD8; // type:func -DemoEc_DrawBeardedMan = 0x80961C20; // type:func -DemoEc_InitWoman = 0x80961C74; // type:func -DemoEc_UpdateWoman = 0x80961D14; // type:func -DemoEc_DrawWoman = 0x80961D5C; // type:func -DemoEc_InitOldWoman = 0x80961D98; // type:func -DemoEc_UpdateOldWoman = 0x80961E38; // type:func -DemoEc_DrawOldWoman = 0x80961E78; // type:func -DemoEc_InitBossCarpenter = 0x80961EA8; // type:func -DemoEc_UpdateBossCarpenter = 0x80961F48; // type:func -DemoEc_DrawBossCarpenter = 0x80961F88; // type:func -DemoEc_InitCarpenter = 0x80961FB4; // type:func -DemoEc_UpdateCarpenter = 0x80962054; // type:func -DemoEc_CarpenterOverrideLimbDraw = 0x80962094; // type:func -DemoEc_GetCarpenterPostLimbDList = 0x80962198; // type:func -DemoEc_CarpenterPostLimbDraw = 0x80962200; // type:func -DemoEc_DrawCarpenter = 0x80962284; // type:func -DemoEc_InitGerudo = 0x809622C0; // type:func -DemoEc_UpdateGerudo = 0x80962364; // type:func -DemoEc_GetGerudoPostLimbDList = 0x809623AC; // type:func -DemoEc_GerudoPostLimbDraw = 0x80962400; // type:func -DemoEc_DrawGerudo = 0x80962484; // type:func -DemoEc_InitDancingZora = 0x809624C8; // type:func -DemoEc_UpdateDancingZora = 0x8096256C; // type:func -DemoEc_DrawDancingZora = 0x809625B4; // type:func -DemoEc_InitKingZora = 0x809625F0; // type:func -func_8096F1D4 = 0x809626A0; // type:func -func_8096F224 = 0x809626F0; // type:func -func_8096F26C = 0x80962738; // type:func -func_8096F2B0 = 0x80962780; // type:func -DemoEc_UpdateKingZora = 0x809627E4; // type:func -func_8096F378 = 0x8096284C; // type:func -func_8096F3D4 = 0x809628AC; // type:func -DemoEc_DrawKingZora = 0x809628F4; // type:func -DemoEc_InitMido = 0x80962930; // type:func -func_8096F4FC = 0x809629E0; // type:func -func_8096F544 = 0x80962A28; // type:func -func_8096F578 = 0x80962A5C; // type:func -DemoEc_UpdateMido = 0x80962AC0; // type:func -func_8096F640 = 0x80962B28; // type:func -DemoEc_DrawMido = 0x80962B88; // type:func -DemoEc_InitCucco = 0x80962BC4; // type:func -DemoEc_UpdateCucco = 0x80962C94; // type:func -DemoEc_DrawCucco = 0x80962CD4; // type:func -DemoEc_InitCuccoLady = 0x80962D00; // type:func -DemoEc_UpdateCuccoLady = 0x80962DA4; // type:func -DemoEc_DrawCuccoLady = 0x80962DEC; // type:func -DemoEc_InitPotionShopOwner = 0x80962E28; // type:func -DemoEc_UpdatePotionShopOwner = 0x80962ECC; // type:func -DemoEc_DrawPotionShopOwner = 0x80962F14; // type:func -DemoEc_InitMaskShopOwner = 0x80962F50; // type:func -DemoEc_UpdateMaskShopOwner = 0x80962FF4; // type:func -DemoEc_DrawMaskShopOwner = 0x80963034; // type:func -DemoEc_InitFishingOwner = 0x80963064; // type:func -DemoEc_UpdateFishingOwner = 0x80963108; // type:func -DemoEc_FishingOwnerPostLimbDraw = 0x80963150; // type:func -DemoEc_DrawFishingOwner = 0x809631D0; // type:func -DemoEc_InitBombchuShopOwner = 0x80963214; // type:func -DempEc_UpdateBombchuShopOwner = 0x809632B8; // type:func -DemoEc_DrawBombchuShopOwner = 0x80963300; // type:func -DemoEc_InitGorons = 0x8096333C; // type:func -DemoEc_UpdateGorons = 0x80963474; // type:func -DemoEc_DrawGorons = 0x809634BC; // type:func -DemoEc_InitMalon = 0x809634FC; // type:func -DemoEc_UpdateMalon = 0x809635A0; // type:func -DemoEc_DrawMalon = 0x809635E8; // type:func -DemoEc_InitNpc = 0x80963628; // type:func -DemoEc_InitCommon = 0x80963674; // type:func -DemoEc_Update = 0x80963748; // type:func -DemoEc_DrawCommon = 0x809637C0; // type:func -DemoEc_Draw = 0x809637D0; // type:func -DemoEffect_SetupUpdate = 0x80964210; // type:func -DemoEffect_InterpolateCsFrames = 0x8096421C; // type:func -DemoEffect_InitJewel = 0x8096427C; // type:func -DemoEffect_InitGetItem = 0x8096433C; // type:func -DemoEffect_Init = 0x80964388; // type:func -DemoEffect_Destroy = 0x80964B88; // type:func -DemoEffect_WaitForObject = 0x80964BD8; // type:func -DemoEffect_UpdatePositionToParent = 0x80964C30; // type:func -DemoEffect_UpdateCrystalLight = 0x80964C60; // type:func -DemoEffect_MedalSparkle = 0x80964C94; // type:func -DemoEffect_UpdateGetItem = 0x80964E2C; // type:func -DemoEffect_InitTimeWarp = 0x8096506C; // type:func -DemoEffect_UpdateTimeWarpPullMasterSword = 0x80965228; // type:func -DemoEffect_TimewarpShrink = 0x809652CC; // type:func -DemoEffect_UpdateTimeWarpReturnFromChamberOfSages = 0x809653F0; // type:func -DemoEffect_UpdateTimeWarpTimeblock = 0x809654A8; // type:func -DemoEffect_InitTimeWarpTimeblock = 0x80965564; // type:func -DemoEffect_UpdateTriforceSpot = 0x809655E8; // type:func -DemoEffect_UpdateLightRingShrinking = 0x809658D0; // type:func -DemoEffect_UpdateLightRingExpanding = 0x80965960; // type:func -DemoEffect_UpdateLightRingTriforce = 0x809659D4; // type:func -DemoEffect_UpdateCreationFireball = 0x80965A90; // type:func -DemoEffect_InitCreationFireball = 0x80965BE4; // type:func -DemoEffect_UpdateBlueOrbShrink = 0x80965C34; // type:func -DemoEffect_UpdateBlueOrbGrow = 0x80965C9C; // type:func -DemoEffect_UpdateLightEffect = 0x80965D7C; // type:func -DemoEffect_UpdateLgtShower = 0x80966074; // type:func -DemoEffect_UpdateGodLgtDin = 0x809660E0; // type:func -DemoEffect_UpdateGodLgtNayru = 0x8096627C; // type:func -DemoEffect_UpdateGodLgtFarore = 0x80966474; // type:func -DemoEffect_MoveTowardTarget = 0x80966618; // type:func -DemoEffect_InitJewelColor = 0x80966678; // type:func -DemoEffect_SetJewelColor = 0x80966778; // type:func -DemoEffect_MoveJewelSplit = 0x80966EEC; // type:func -DemoEffect_MoveJewelSpherical = 0x80966F48; // type:func -DemoEffect_MoveJewelActivateDoorOfTime = 0x8096712C; // type:func -DemoEffect_JewelSparkle = 0x80967398; // type:func -DemoEffect_PlayJewelSfx = 0x809674FC; // type:func -DemoEffect_UpdateJewelAdult = 0x80967560; // type:func -DemoEffect_UpdateJewelChild = 0x809675A4; // type:func -DemoEffect_UpdateDust = 0x809677B8; // type:func -DemoEffect_Update = 0x809678DC; // type:func -DemoEffect_CheckForCue = 0x80967900; // type:func -DemoEffect_DrawJewel = 0x80967944; // type:func -DemoEffect_DrawCrystalLight = 0x80967D84; // type:func -DemoEffect_DrawFireBall = 0x8096805C; // type:func -DemoEffect_DrawGodLgt = 0x809681E8; // type:func -DemoEffect_DrawLightEffect = 0x809685B8; // type:func -DemoEffect_DrawBlueOrb = 0x809687F0; // type:func -DemoEffect_DrawLgtShower = 0x80968918; // type:func -DemoEffect_DrawLightRing = 0x80968A9C; // type:func -DemoEffect_DrawTriforceSpot = 0x80968C04; // type:func -DemoEffect_DrawGetItem = 0x80969188; // type:func -DemoEffect_OverrideLimbDrawTimeWarp = 0x80969220; // type:func -DemoEffect_DrawTimeWarp = 0x809693A0; // type:func -DemoEffect_FaceTowardPoint = 0x80969478; // type:func -DemoEffect_SetPosRotFromCue = 0x80969528; // type:func -DemoEffect_MoveTowardCuePos = 0x80969688; // type:func -DemoEffect_SetStartPosFromCue = 0x80969734; // type:func -DemoExt_Destroy = 0x80969DB0; // type:func -DemoExt_Init = 0x80969DC0; // type:func -DemoExt_PlayVortexSFX = 0x80969E78; // type:func -DemoExt_GetCue = 0x80969F00; // type:func -DemoExt_SetupWait = 0x80969F28; // type:func -DemoExt_SetupMaintainVortex = 0x80969F38; // type:func -DemoExt_SetupDispellVortex = 0x80969FC4; // type:func -DemoExt_FinishClosing = 0x80969FDC; // type:func -DemoExt_HandleCues = 0x8096A048; // type:func -DemoExt_SetScrollAndRotation = 0x8096A0F4; // type:func -DemoExt_SetColorsAndScales = 0x8096A144; // type:func -DemoExt_Wait = 0x8096A280; // type:func -DemoExt_MaintainVortex = 0x8096A2A0; // type:func -DemoExt_DispellVortex = 0x8096A2DC; // type:func -DemoExt_Update = 0x8096A31C; // type:func -DemoExt_DrawNothing = 0x8096A364; // type:func -DemoExt_DrawVortex = 0x8096A374; // type:func -DemoExt_Draw = 0x8096A5F4; // type:func -DemoGeff_Destroy = 0x8096A700; // type:func -DemoGeff_Init = 0x8096A710; // type:func -func_80977EA8 = 0x8096A758; // type:func -func_80977F80 = 0x8096A7F4; // type:func -func_80978030 = 0x8096A850; // type:func -func_809781FC = 0x8096AA1C; // type:func -func_809782A0 = 0x8096AAC0; // type:func -func_80978308 = 0x8096AB28; // type:func -func_80978344 = 0x8096AB60; // type:func -func_80978370 = 0x8096AB90; // type:func -func_809783D4 = 0x8096ABDC; // type:func -DemoGeff_Update = 0x8096AC78; // type:func -func_809784D4 = 0x8096ACC0; // type:func -DemoGeff_Draw = 0x8096ACD0; // type:func -DemoGj_GetCollectibleType = 0x8096AF20; // type:func -DemoGj_GetCollectibleAmount = 0x8096AF34; // type:func -DemoGj_GetType = 0x8096AF48; // type:func -DemoGj_InitCylinder = 0x8096AF58; // type:func -DemoGj_HitByExplosion = 0x8096AFA0; // type:func -DemoGj_DestroyCylinder = 0x8096AFD8; // type:func -DemoGj_Destroy = 0x8096B090; // type:func -DemoGj_PlayExplosionSfx = 0x8096B0D4; // type:func -DemoGj_SpawnSmoke = 0x8096B10C; // type:func -DemoGj_DropCollectible = 0x8096B1A0; // type:func -DemoGj_Explode = 0x8096B234; // type:func -DemoGj_IsCutsceneLayer = 0x8096B4D0; // type:func -DemoGj_FindGanon = 0x8096B4F8; // type:func -DemoGj_InitCommon = 0x8096B544; // type:func -DemoGj_InitSetIndices = 0x8096B5BC; // type:func -DemoGj_DrawCommon = 0x8096B620; // type:func -DemoGj_DrawRotated = 0x8096B6BC; // type:func -DemoGj_SetupRotation = 0x8096B798; // type:func -func_809797E4 = 0x8096BD30; // type:func -DemoGj_IsGanondorfRisingFromRubble = 0x8096BD64; // type:func -DemoGj_IsGanondorfFloatingInAir = 0x8096BD88; // type:func -DemoGj_SetupMovement = 0x8096BDAC; // type:func -DemoGj_CheckIfTransformedIntoGanon = 0x8096C4D0; // type:func -DemoGj_InitRubblePile1 = 0x8096C508; // type:func -func_8097A000 = 0x8096C538; // type:func -DemoGj_SpawnSmokePreBattle1 = 0x8096C5B4; // type:func -func_8097A0E4 = 0x8096C620; // type:func -func_8097A130 = 0x8096C674; // type:func -DemoGj_Update01 = 0x8096C6A8; // type:func -DemoGj_Update08 = 0x8096C6E0; // type:func -DemoGj_DrawRubble2 = 0x8096C718; // type:func -DemoGj_DrawRotatedRubble2 = 0x8096C73C; // type:func -DemoGj_InitRubblePile2 = 0x8096C760; // type:func -func_8097A238 = 0x8096C790; // type:func -DemoGj_SpawnSmokePreBattle2 = 0x8096C80C; // type:func -func_8097A320 = 0x8096C87C; // type:func -func_8097A36C = 0x8096C8D0; // type:func -DemoGj_Update02 = 0x8096C904; // type:func -DemoGj_Update09 = 0x8096C93C; // type:func -DemoGj_DrawRubble3 = 0x8096C974; // type:func -DemoGj_DrawRotatedRubble3 = 0x8096C998; // type:func -DemoGj_InitRubblePile3 = 0x8096C9BC; // type:func -func_8097A474 = 0x8096C9EC; // type:func -func_8097A4F0 = 0x8096CA68; // type:func -func_8097A53C = 0x8096CABC; // type:func -DemoGj_Update03 = 0x8096CAF0; // type:func -DemoGj_Update10 = 0x8096CB28; // type:func -DemoGj_DrawRubble4 = 0x8096CB60; // type:func -DemoGj_DrawRotatedRubble4 = 0x8096CB84; // type:func -DemoGj_InitRubblePile4 = 0x8096CBA8; // type:func -func_8097A644 = 0x8096CBD8; // type:func -func_8097A6C0 = 0x8096CC54; // type:func -func_8097A70C = 0x8096CCA8; // type:func -DemoGj_Update04 = 0x8096CCDC; // type:func -DemoGj_Update11 = 0x8096CD14; // type:func -DemoGj_DrawRubble5 = 0x8096CD4C; // type:func -DemoGj_DrawRotatedRubble5 = 0x8096CD70; // type:func -DemoGj_InitRubblePile5 = 0x8096CD94; // type:func -func_8097A814 = 0x8096CDC4; // type:func -func_8097A890 = 0x8096CE40; // type:func -func_8097A8DC = 0x8096CE94; // type:func -DemoGj_Update05 = 0x8096CEC8; // type:func -DemoGj_Update12 = 0x8096CF00; // type:func -DemoGj_DrawRubble6 = 0x8096CF38; // type:func -DemoGj_DrawRotatedRubble6 = 0x8096CF5C; // type:func -DemoGj_InitRubblePile6 = 0x8096CF80; // type:func -func_8097A9E4 = 0x8096CFB0; // type:func -func_8097AA60 = 0x8096D02C; // type:func -func_8097AAAC = 0x8096D080; // type:func -DemoGj_Update06 = 0x8096D0B4; // type:func -DemoGj_Update13 = 0x8096D0EC; // type:func -DemoGj_DrawRubble7 = 0x8096D124; // type:func -DemoGj_DrawRotatedRubble7 = 0x8096D148; // type:func -DemoGj_InitRubblePile7 = 0x8096D16C; // type:func -func_8097ABB4 = 0x8096D19C; // type:func -DemoGj_SpawnSmokePreBattle3 = 0x8096D218; // type:func -func_8097AC9C = 0x8096D288; // type:func -func_8097ACE8 = 0x8096D2DC; // type:func -DemoGj_Update07 = 0x8096D310; // type:func -DemoGj_Update14 = 0x8096D348; // type:func -DemoGj_DrawRubbleTall = 0x8096D380; // type:func -DemoGj_DrawRotatedRubbleTall = 0x8096D3A4; // type:func -DemoGj_InitRubbleAroundArena = 0x8096D3C8; // type:func -DemoGj_UpdateRubbleAroundArena = 0x8096D3F8; // type:func -DemoGj_DrawRubbleAroundArena = 0x8096D448; // type:func -DemoGj_InitDestructableRubble1 = 0x8096D46C; // type:func -func_8097AEE8 = 0x8096D4F4; // type:func -DemoGj_SetCylindersAsAC = 0x8096D688; // type:func -DemoGj_DirectedExplosion = 0x8096D6F4; // type:func -func_8097B128 = 0x8096D730; // type:func -DemoGj_HasCylinderAnyExploded = 0x8096D7C0; // type:func -func_8097B22C = 0x8096D83C; // type:func -DemoGj_Update15 = 0x8096D954; // type:func -DemoGj_Update18 = 0x8096D98C; // type:func -DemoGj_DrawDestructableRubble1 = 0x8096D9AC; // type:func -DemoGj_InitDestructableRubble2 = 0x8096D9D0; // type:func -func_8097B450 = 0x8096DA58; // type:func -DemoGj_SetCylindersAsAC2 = 0x8096DBA8; // type:func -DemoGj_HasCylinderAnyExploded2 = 0x8096DC14; // type:func -DemoGj_DirectedExplosion2 = 0x8096DC90; // type:func -func_8097B6C4 = 0x8096DCCC; // type:func -func_8097B750 = 0x8096DD5C; // type:func -DemoGj_Update16 = 0x8096DE74; // type:func -DemoGj_Update19 = 0x8096DEAC; // type:func -DemoGj_DemoGj_InitDestructableRubble2 = 0x8096DECC; // type:func -DemoGj_InitDestructableRubbleTall = 0x8096DEF0; // type:func -DemoGj_DirectedDoubleExplosion = 0x8096DF3C; // type:func -func_8097B9BC = 0x8096DFC0; // type:func -func_8097BA48 = 0x8096E050; // type:func -DemoGj_Update17 = 0x8096E184; // type:func -DemoGj_Update20 = 0x8096E1BC; // type:func -DemoGj_DemoGj_InitDestructableRubbleTall = 0x8096E1DC; // type:func -DemoGj_Update = 0x8096E200; // type:func -DemoGj_Init = 0x8096E248; // type:func -DemoGj_DrawNothing = 0x8096E350; // type:func -DemoGj_Draw = 0x8096E360; // type:func -DemoGo_GetCueChannel = 0x8096EBD0; // type:func -func_8097C8A8 = 0x8096EC0C; // type:func -DemoGo_Destroy = 0x8096EC78; // type:func -func_8097C930 = 0x8096EC9C; // type:func -func_8097C9B8 = 0x8096ED24; // type:func -func_8097C9DC = 0x8096ED4C; // type:func -func_8097CA30 = 0x8096EDA4; // type:func -func_8097CA78 = 0x8096EDEC; // type:func -func_8097CB0C = 0x8096EE84; // type:func -func_8097CC08 = 0x8096EF84; // type:func -func_8097CCC0 = 0x8096F03C; // type:func -func_8097CCE0 = 0x8096F05C; // type:func -DemoGo_UpdateSkelAnime = 0x8096F114; // type:func -func_8097CDB0 = 0x8096F138; // type:func -func_8097CE10 = 0x8096F1A4; // type:func -func_8097CE20 = 0x8096F1B8; // type:func -func_8097CE78 = 0x8096F214; // type:func -func_8097CEEC = 0x8096F28C; // type:func -func_8097CF20 = 0x8096F2C4; // type:func -func_8097CF9C = 0x8096F340; // type:func -func_8097CFDC = 0x8096F380; // type:func -func_8097CFFC = 0x8096F3A0; // type:func -func_8097D01C = 0x8096F3C0; // type:func -func_8097D058 = 0x8096F404; // type:func -func_8097D088 = 0x8096F43C; // type:func -func_8097D0D0 = 0x8096F48C; // type:func -func_8097D130 = 0x8096F4F4; // type:func -DemoGo_Update = 0x8096F554; // type:func -DemoGo_Init = 0x8096F59C; // type:func -func_8097D290 = 0x8096F648; // type:func -func_8097D29C = 0x8096F658; // type:func -DemoGo_Draw = 0x8096F768; // type:func -DemoGt_Destroy = 0x8096F920; // type:func -DemoGt_PlayEarthquakeSfx = 0x8096F968; // type:func -DemoGt_PlayExplosion1Sfx = 0x8096F988; // type:func -DemoGt_PlayExplosion2Sfx = 0x8096F9AC; // type:func -DemoGt_Rumble = 0x8096F9D0; // type:func -DemoGt_SpawnDust = 0x8096FA00; // type:func -func_8097D7D8 = 0x8096FA90; // type:func -DemoGt_SpawnCloudRing = 0x8096FC18; // type:func -DemoGt_SpawnExplosionWithSound = 0x8096FC78; // type:func -DemoGt_SpawnExplosionNoSound = 0x8096FD2C; // type:func -func_8097DAC8 = 0x8096FD80; // type:func -func_8097DD28 = 0x8096FFE0; // type:func -func_8097DF70 = 0x80970228; // type:func -func_8097E1D4 = 0x8097048C; // type:func -func_8097E454 = 0x8097070C; // type:func -DemoGt_IsCutsceneIdle = 0x8097095C; // type:func -DemoGt_GetCue = 0x8097097C; // type:func -func_8097E704 = 0x809709C8; // type:func -func_8097E744 = 0x80970A08; // type:func -func_8097E824 = 0x80970AE8; // type:func -func_8097ED64 = 0x80971024; // type:func -DemoGt_IsCutsceneLayer = 0x8097105C; // type:func -func_8097EDD8 = 0x80971084; // type:func -func_8097EE44 = 0x809710FC; // type:func -func_8097EEA8_Init0 = 0x80971160; // type:func -func_8097EF00 = 0x809711B8; // type:func -func_8097EF34 = 0x809711EC; // type:func -func_8097EF40 = 0x809711FC; // type:func -func_8097F0AC = 0x80971354; // type:func -func_8097F19C = 0x80971438; // type:func -func_8097F1D8 = 0x8097147C; // type:func -func_8097F280 = 0x80971524; // type:func -func_8097F3EC = 0x80971698; // type:func -DemoGt_Update0 = 0x809716D8; // type:func -DemoGt_Update8 = 0x80971750; // type:func -DemoGt_Draw1 = 0x809717C8; // type:func -func_8097F904_Init1 = 0x80971B8C; // type:func -func_8097F960 = 0x80971BE8; // type:func -func_8097F96C = 0x80971BF8; // type:func -func_8097FA1C = 0x80971C8C; // type:func -func_8097FAFC = 0x80971D54; // type:func -func_8097FC1C = 0x80971E5C; // type:func -func_8097FCE4 = 0x80971F10; // type:func -func_8097FD70 = 0x80971F8C; // type:func -func_8097FDDC = 0x80972000; // type:func -func_8097FED8 = 0x80972100; // type:func -DemoGt_Update1 = 0x80972140; // type:func -DemoGt_Update9 = 0x80972190; // type:func -DemoGt_Draw2 = 0x809721D8; // type:func -func_80980110_Init2 = 0x8097230C; // type:func -func_8098016C = 0x80972368; // type:func -func_80980178 = 0x80972378; // type:func -func_80980184 = 0x80972388; // type:func -func_80980218 = 0x8097241C; // type:func -func_809802AC = 0x809724B0; // type:func -func_8098036C = 0x80972574; // type:func -func_80980430 = 0x8097263C; // type:func -func_80980504 = 0x809726FC; // type:func -func_809805D8 = 0x809727BC; // type:func -func_809806B8 = 0x80972884; // type:func -func_8098078C = 0x80972944; // type:func -func_8098085C = 0x80972A00; // type:func -func_809809C0 = 0x80972B4C; // type:func -func_80980AD4 = 0x80972C50; // type:func -func_80980B68 = 0x80972CD0; // type:func -func_80980BFC = 0x80972D50; // type:func -func_80980C90 = 0x80972DD0; // type:func -func_80980D74 = 0x80972EBC; // type:func -DemoGt_Update2 = 0x80972EFC; // type:func -DemoGt_Update10 = 0x80972F40; // type:func -DemoGt_Draw3 = 0x80972F7C; // type:func -func_80980F00_Init5 = 0x80973018; // type:func -func_80980F58 = 0x80973070; // type:func -func_80980F8C = 0x809730A8; // type:func -func_8098103C = 0x8097315C; // type:func -DemoGt_Update3 = 0x809731C0; // type:func -DemoGt_Update11 = 0x80973204; // type:func -DemoGt_Update16 = 0x80973240; // type:func -DemoGt_Draw4 = 0x809732D8; // type:func -func_809813CC_Init6 = 0x809734C0; // type:func -func_80981424 = 0x80973518; // type:func -func_80981458 = 0x80973550; // type:func -func_80981524 = 0x80973608; // type:func -DemoGt_Update4 = 0x8097366C; // type:func -DemoGt_Update12 = 0x809736B0; // type:func -DemoGt_Update17 = 0x809736EC; // type:func -DemoGt_Draw5 = 0x80973784; // type:func -func_809818A4_Init7 = 0x80973960; // type:func -func_809818FC = 0x809739B8; // type:func -func_80981930 = 0x809739F0; // type:func -DemoGt_Update5 = 0x80973A54; // type:func -DemoGt_Update13 = 0x80973A98; // type:func -DemoGt_Update18 = 0x80973AD4; // type:func -DemoGt_Draw6 = 0x80973B6C; // type:func -func_80981C94_Init23 = 0x80973D24; // type:func -func_80981CEC = 0x80973D7C; // type:func -func_80981D20 = 0x80973DB4; // type:func -func_80981DC8 = 0x80973E5C; // type:func -DemoGt_Update6 = 0x80973E9C; // type:func -DemoGt_Update14 = 0x80973EE0; // type:func -DemoGt_Draw7 = 0x80973F24; // type:func -func_80982054_Init24 = 0x809740BC; // type:func -func_809820AC = 0x80974114; // type:func -func_809820E0 = 0x8097414C; // type:func -func_80982188 = 0x809741F4; // type:func -DemoGt_Update7 = 0x80974234; // type:func -DemoGt_Update15 = 0x80974278; // type:func -DemoGt_Draw8 = 0x809742BC; // type:func -DemoGt_Update = 0x80974458; // type:func -DemoGt_Init = 0x809744A0; // type:func -DemoGt_Draw0 = 0x80974564; // type:func -DemoGt_Draw = 0x80974574; // type:func -DemoIk_Destroy = 0x80974F30; // type:func -DemoIk_BgCheck = 0x80974F40; // type:func -DemoIk_UpdateSkelAnime = 0x80974F88; // type:func -DemoIk_GetCue = 0x80974FAC; // type:func -DemoIk_CheckForCue = 0x80974FD4; // type:func -DemoIk_SetMove = 0x80975014; // type:func -DemoIk_EndMove = 0x80975054; // type:func -DemoIk_GetCurFrame = 0x80975068; // type:func -DemoIk_SetColors = 0x80975074; // type:func -DemoIk_GetCueChannel = 0x80975118; // type:func -DemoIk_Type1PlaySfx = 0x80975144; // type:func -DemoIk_SpawnDeadDb = 0x80975244; // type:func -DemoIk_MoveToStartPos = 0x809753E8; // type:func -DemoIk_Type1Init = 0x80975468; // type:func -func_8098393C = 0x80975584; // type:func -func_8098394C = 0x80975598; // type:func -func_809839AC = 0x809755FC; // type:func -func_809839D0 = 0x80975624; // type:func -DemoIk_Type1Action0 = 0x809756E4; // type:func -DemoIk_Type1Action1 = 0x80975704; // type:func -DemoIk_Type1Action2 = 0x8097573C; // type:func -DemoIk_Type1PostLimbDraw = 0x809757A4; // type:func -DemoIk_Type1Draw = 0x809758A0; // type:func -DemoIk_Type2Init = 0x809759F8; // type:func -DemoIk_Type2PlaySfxOnFrame = 0x80975B00; // type:func -DemoIk_Type2PlaySfx = 0x80975B60; // type:func -func_80983FDC = 0x80975BB0; // type:func -func_80983FEC = 0x80975BC4; // type:func -func_8098402C = 0x80975C04; // type:func -func_80984048 = 0x80975C24; // type:func -DemoIk_Type2Action0 = 0x80975CEC; // type:func -DemoIk_Type2Action1 = 0x80975D0C; // type:func -DemoIk_Type2Action2 = 0x80975D2C; // type:func -DemoIk_Type2OverrideLimbDraw = 0x80975D68; // type:func -DemoIk_Type2PostLimbDraw = 0x80975DC4; // type:func -DemoIk_Type2Draw = 0x80975F94; // type:func -DemoIk_Update = 0x809760F8; // type:func -DemoIk_DrawNothing = 0x80976140; // type:func -DemoIk_Draw = 0x80976150; // type:func -DemoIk_Init = 0x80976198; // type:func -func_80984BE0 = 0x80976440; // type:func -DemoIm_InitCollider = 0x809764C8; // type:func -DemoIm_DestroyCollider = 0x80976514; // type:func -DemoIm_UpdateCollider = 0x80976540; // type:func -func_80984DB8 = 0x80976584; // type:func -func_80984E58 = 0x80976628; // type:func -func_80984F10 = 0x809766E0; // type:func -func_80984F94 = 0x80976768; // type:func -DemoIm_UpdateBgCheckInfo = 0x809767F0; // type:func -DemoIm_UpdateSkelAnime = 0x80976838; // type:func -DemoIm_IsCutsceneIdle = 0x8097685C; // type:func -DemoIm_GetCue = 0x8097687C; // type:func -func_809850E8 = 0x809768C8; // type:func -func_80985134 = 0x80976914; // type:func -func_80985180 = 0x80976960; // type:func -func_80985200 = 0x809769E0; // type:func -DemoIm_ChangeAnim = 0x80976A60; // type:func -func_80985310 = 0x80976AF0; // type:func -func_80985358 = 0x80976B38; // type:func -func_809853B4 = 0x80976B94; // type:func -func_80985430 = 0x80976C10; // type:func -func_8098544C = 0x80976C30; // type:func -func_809854DC = 0x80976CCC; // type:func -func_8098557C = 0x80976D6C; // type:func -func_809855A8 = 0x80976D98; // type:func -func_80985640 = 0x80976E30; // type:func -func_809856AC = 0x80976E9C; // type:func -func_809856F8 = 0x80976EE8; // type:func -func_80985718 = 0x80976F08; // type:func -func_80985738 = 0x80976F28; // type:func -func_80985770 = 0x80976F64; // type:func -func_809857B0 = 0x80976FAC; // type:func -func_809857F0 = 0x80976FF0; // type:func -func_80985830 = 0x80977038; // type:func -func_80985860 = 0x8097706C; // type:func -func_809858A8 = 0x809770B0; // type:func -DemoIm_SpawnLightBall = 0x809770D0; // type:func -func_80985948 = 0x80977150; // type:func -func_809859E0 = 0x809771EC; // type:func -func_80985B34 = 0x80977340; // type:func -func_80985C10 = 0x80977424; // type:func -func_80985C40 = 0x80977444; // type:func -func_80985C94 = 0x8097748C; // type:func -DemoIm_DrawTranslucent = 0x809774D4; // type:func -func_80985E60 = 0x8097761C; // type:func -func_80985EAC = 0x80977668; // type:func -func_80985EF4 = 0x809776B0; // type:func -func_80985F54 = 0x80977710; // type:func -func_80985F64 = 0x80977724; // type:func -func_80985FE8 = 0x809777A8; // type:func -func_8098604C = 0x8097780C; // type:func -func_809860C8 = 0x80977888; // type:func -func_809860DC = 0x809778A0; // type:func -func_80986148 = 0x8097790C; // type:func -func_809861C4 = 0x80977988; // type:func -func_8098629C = 0x80977A4C; // type:func -func_809862E0 = 0x80977A90; // type:func -func_809863BC = 0x80977B58; // type:func -func_809863DC = 0x80977B78; // type:func -func_80986430 = 0x80977BD4; // type:func -func_80986494 = 0x80977C40; // type:func -func_809864D4 = 0x80977C88; // type:func -func_8098652C = 0x80977CE8; // type:func -func_80986570 = 0x80977D2C; // type:func -func_809865F8 = 0x80977DB4; // type:func -func_80986700 = 0x80977EC4; // type:func -func_80986710 = 0x80977ED8; // type:func -func_80986794 = 0x80977F5C; // type:func -func_8098680C = 0x80977FD4; // type:func -func_809868E8 = 0x8097809C; // type:func -func_80986908 = 0x809780BC; // type:func -func_80986948 = 0x80978104; // type:func -func_809869B0 = 0x80978174; // type:func -func_809869F8 = 0x809781B8; // type:func -func_80986A5C = 0x8097821C; // type:func -func_80986AD0 = 0x80978290; // type:func -func_80986B2C = 0x809782EC; // type:func -func_80986BA0 = 0x80978360; // type:func -func_80986BE4 = 0x809783A4; // type:func -func_80986BF8 = 0x809783B8; // type:func -func_80986C30 = 0x809783F0; // type:func -func_80986CC8 = 0x80978494; // type:func -func_80986CFC = 0x809784C8; // type:func -func_80986D40 = 0x80978510; // type:func -func_80986DC8 = 0x80978578; // type:func -func_80986E20 = 0x809785D4; // type:func -func_80986E40 = 0x809785F4; // type:func -func_80986EAC = 0x80978668; // type:func -func_80986F08 = 0x809786CC; // type:func -func_80986F28 = 0x809786EC; // type:func -func_80986F88 = 0x80978754; // type:func -func_80986FA8 = 0x80978778; // type:func -func_80987018 = 0x809787F0; // type:func -func_80987064 = 0x80978838; // type:func -func_809870F0 = 0x809788C4; // type:func -func_80987128 = 0x809788FC; // type:func -func_80987174 = 0x80978948; // type:func -func_809871B4 = 0x80978988; // type:func -func_809871E8 = 0x809789BC; // type:func -func_80987288 = 0x80978A48; // type:func -func_809872A8 = 0x80978A68; // type:func -func_809872F0 = 0x80978AB4; // type:func -func_80987330 = 0x80978AFC; // type:func -DemoIm_Update = 0x80978B40; // type:func -DemoIm_Init = 0x80978B88; // type:func -DemoIm_Destroy = 0x80978CB0; // type:func -DemoIm_OverrideLimbDraw = 0x80978CD0; // type:func -DemoIm_PostLimbDraw = 0x80978D80; // type:func -DemoIm_DrawNothing = 0x80978E0C; // type:func -DemoIm_DrawSolid = 0x80978E1C; // type:func -DemoIm_Draw = 0x80978F60; // type:func -DemoKankyo_SetupAction = 0x8097A3B0; // type:func -DemoKankyo_Init = 0x8097A3BC; // type:func -DemoKankyo_Destroy = 0x8097A7A0; // type:func -DemoKankyo_SetupType = 0x8097A7AC; // type:func -DemoKankyo_DoNothing = 0x8097ABE4; // type:func -DemoKankyo_DoNothing2 = 0x8097ABF4; // type:func -DemoKankyo_SetPosFromCue = 0x8097AC1C; // type:func -DemoKankyo_UpdateRock = 0x8097AD0C; // type:func -DemoKankyo_UpdateClouds = 0x8097AD84; // type:func -DemoKankyo_UpdateDoorOfTime = 0x8097ADD0; // type:func -DemoKankyo_KillDoorOfTimeCollision = 0x8097AE6C; // type:func -DemoKankyo_Update = 0x8097AE98; // type:func -DemoKankyo_Draw = 0x8097AEBC; // type:func -func_80989B54 = 0x8097B064; // type:func -DemoKankyo_DrawRain = 0x8097B234; // type:func -DemoKankyo_DrawRock = 0x8097B840; // type:func -DemoKankyo_DrawClouds = 0x8097B984; // type:func -DemoKankyo_DrawDoorOfTime = 0x8097BCB0; // type:func -DemoKankyo_DrawLightPlane = 0x8097BDC0; // type:func -DemoKankyo_Vec3fCopy = 0x8097BEA8; // type:func -DemoKankyo_AddVecGeoToVec3f = 0x8097BEC8; // type:func -DemoKankyo_Vec3fAddPosRot = 0x8097BF48; // type:func -DemoKankyo_DrawWarpSparkles = 0x8097BFA4; // type:func -DemoKankyo_DrawSparkles = 0x8097C700; // type:func -DemoKekkai_CheckEventFlag = 0x8097E0A0; // type:func -DemoKekkai_Init = 0x8097E0E4; // type:func -DemoKekkai_Destroy = 0x8097E314; // type:func -DemoKekkai_SpawnParticles = 0x8097E354; // type:func -DemoKekkai_TowerBarrier = 0x8097E5A8; // type:func -DemoKekkai_Update = 0x8097E6C4; // type:func -DemoKekkai_TrialBarrierDispel = 0x8097E7F0; // type:func -DemoKekkai_TrialBarrierIdle = 0x8097E950; // type:func -DemoKekkai_DrawTrialBarrier = 0x8097EA74; // type:func -DemoKekkai_DrawTowerBarrier = 0x8097EF88; // type:func -DemoSa_Destroy = 0x8097F390; // type:func -func_8098E480 = 0x8097F3B4; // type:func -DemoSa_SetEyeIndex = 0x8097F43C; // type:func -DemoSa_SetMouthIndex = 0x8097F454; // type:func -func_8098E5C8 = 0x8097F46C; // type:func -DemoSa_UpdateSkelAnime = 0x8097F4B4; // type:func -DemoSa_GetCue = 0x8097F4D8; // type:func -func_8098E654 = 0x8097F500; // type:func -func_8098E6A0 = 0x8097F54C; // type:func -func_8098E6EC = 0x8097F598; // type:func -func_8098E76C = 0x8097F618; // type:func -func_8098E7FC = 0x8097F6A8; // type:func -func_8098E86C = 0x8097F718; // type:func -func_8098E8C8 = 0x8097F774; // type:func -func_8098E944 = 0x8097F7F0; // type:func -func_8098E960 = 0x8097F810; // type:func -func_8098E9EC = 0x8097F8A8; // type:func -func_8098EA3C = 0x8097F8F8; // type:func -func_8098EA68 = 0x8097F924; // type:func -func_8098EB00 = 0x8097F9BC; // type:func -func_8098EB6C = 0x8097FA28; // type:func -func_8098EBB8 = 0x8097FA74; // type:func -func_8098EBD8 = 0x8097FA94; // type:func -func_8098EBF8 = 0x8097FAB4; // type:func -func_8098EC28 = 0x8097FAE8; // type:func -func_8098EC60 = 0x8097FB28; // type:func -func_8098EC94 = 0x8097FB60; // type:func -func_8098ECCC = 0x8097FBA0; // type:func -func_8098ECF4 = 0x8097FBCC; // type:func -func_8098EDB0 = 0x8097FC88; // type:func -func_8098EE08 = 0x8097FCE0; // type:func -func_8098EE28 = 0x8097FD00; // type:func -func_8098EEA8 = 0x8097FD80; // type:func -func_8098EEFC = 0x8097FDD4; // type:func -func_8098F050 = 0x8097FF28; // type:func -func_8098F0E8 = 0x8097FFC4; // type:func -func_8098F118 = 0x8097FFE4; // type:func -func_8098F16C = 0x8098002C; // type:func -DemoSa_DrawXlu = 0x80980074; // type:func -func_8098F390 = 0x80980214; // type:func -func_8098F3F0 = 0x80980274; // type:func -func_8098F420 = 0x809802A8; // type:func -func_8098F480 = 0x80980304; // type:func -func_8098F50C = 0x80980390; // type:func -func_8098F544 = 0x809803C8; // type:func -func_8098F590 = 0x80980414; // type:func -func_8098F5D0 = 0x80980454; // type:func -func_8098F610 = 0x80980494; // type:func -func_8098F654 = 0x809804DC; // type:func -func_8098F714 = 0x80980588; // type:func -func_8098F734 = 0x809805A8; // type:func -func_8098F77C = 0x809805F4; // type:func -func_8098F7BC = 0x8098063C; // type:func -func_8098F7FC = 0x80980684; // type:func -func_8098F83C = 0x809806C8; // type:func -func_8098F8F8 = 0x80980784; // type:func -func_8098F984 = 0x80980810; // type:func -func_8098F998 = 0x80980828; // type:func -func_8098FA2C = 0x809808BC; // type:func -func_8098FA84 = 0x80980914; // type:func -func_8098FAE0 = 0x80980970; // type:func -func_8098FB34 = 0x809809C4; // type:func -func_8098FB68 = 0x809809F8; // type:func -func_8098FC44 = 0x80980AC0; // type:func -func_8098FC64 = 0x80980AE0; // type:func -func_8098FC9C = 0x80980B1C; // type:func -func_8098FCD4 = 0x80980B5C; // type:func -func_8098FD0C = 0x80980B9C; // type:func -DemoSa_Update = 0x80980BE8; // type:func -DemoSa_Init = 0x80980C30; // type:func -DemoSa_OverrideLimbDraw = 0x80980CF8; // type:func -DemoSa_DrawNothing = 0x80980D30; // type:func -DemoSa_DrawOpa = 0x80980D40; // type:func -DemoSa_Draw = 0x80980ED4; // type:func -DemoShd_SetupAction = 0x80981EB0; // type:func -DemoShd_Init = 0x80981EBC; // type:func -DemoShd_Destroy = 0x80981F0C; // type:func -func_80991298 = 0x80981F1C; // type:func -DemoShd_Update = 0x80982074; // type:func -DemoShd_Draw = 0x80982098; // type:func -DemoTreLgt_Init = 0x809842C0; // type:func -DemoTreLgt_Destroy = 0x8098431C; // type:func -func_80993754 = 0x80984348; // type:func -func_8099375C = 0x80984354; // type:func -func_809937B4 = 0x809843AC; // type:func -func_80993848 = 0x80984444; // type:func -DemoTreLgt_Update = 0x809846F8; // type:func -DemoTreLgt_OverrideLimbDraw = 0x8098472C; // type:func -DemoTreLgt_Draw = 0x80984880; // type:func -DoorAna_SetupAction = 0x809849D0; // type:func -DoorAna_Init = 0x809849DC; // type:func -DoorAna_Destroy = 0x80984A98; // type:func -DoorAna_WaitClosed = 0x80984AD4; // type:func -DoorAna_WaitOpen = 0x80984C0C; // type:func -DoorAna_GrabPlayer = 0x80984DC0; // type:func -DoorAna_Update = 0x80984E6C; // type:func -DoorAna_Draw = 0x80984EC0; // type:func -DoorGerudo_Init = 0x80985040; // type:func -DoorGerudo_Destroy = 0x809850F0; // type:func -func_809946BC = 0x80985124; // type:func -func_80994750 = 0x809851BC; // type:func -func_8099485C = 0x809852C8; // type:func -func_8099496C = 0x809853D8; // type:func -func_809949C8 = 0x80985434; // type:func -DoorGerudo_Update = 0x80985490; // type:func -DoorGerudo_Draw = 0x809854B4; // type:func -DoorKiller_Init = 0x80985630; // type:func -DoorKiller_Destroy = 0x80985988; // type:func -DoorKiller_SpawnRubble = 0x809859D8; // type:func -DoorKiller_FallAsRubble = 0x80985B80; // type:func -DoorKiller_IsHit = 0x80985C40; // type:func -DoorKiller_SetAC = 0x80985C74; // type:func -DoorKiller_Die = 0x80985CD4; // type:func -DoorKiller_RiseBackUp = 0x80985D24; // type:func -DoorKiller_FallOver = 0x80985ED4; // type:func -DoorKiller_Wobble = 0x809862A0; // type:func -DoorKiller_WaitBeforeWobble = 0x80986410; // type:func -DoorKiller_Wait = 0x80986444; // type:func -DoorKiller_UpdateTexture = 0x809866A4; // type:func -DoorKiller_WaitForObject = 0x80986738; // type:func -DoorKiller_Update = 0x809867EC; // type:func -DoorKiller_SetTexture = 0x80986810; // type:func -DoorKiller_DrawDoor = 0x8098683C; // type:func -DoorKiller_DrawRubble = 0x80986898; // type:func -DoorShutter_SetupAction = 0x80986BA0; // type:func -DoorShutter_SetupDoor = 0x80986BB0; // type:func -DoorShutter_Init = 0x80986D98; // type:func -DoorShutter_Destroy = 0x80986FB0; // type:func -DoorShutter_WaitForObject = 0x80987020; // type:func -DoorShutter_GetPlayerDistance = 0x8098715C; // type:func -DoorShutter_GetPlayerSide = 0x809871F4; // type:func -DoorShutter_WaitClear = 0x80987374; // type:func -DoorShutter_Unopenable = 0x80987420; // type:func -DoorShutter_Idle = 0x80987430; // type:func -DoorShutter_InitOpeningDoorCam = 0x80987584; // type:func -DoorShutter_UpdateOpening = 0x8098763C; // type:func -DoorShutter_UpdateBarsClosed = 0x80987734; // type:func -DoorShutter_BarAndWaitSwitchFlag = 0x80987818; // type:func -DoorShutter_UnbarredCheckSwitchFlag = 0x809878D0; // type:func -DoorShutter_Open = 0x8098793C; // type:func -DoorShutter_Unbar = 0x80987A8C; // type:func -DoorShutter_SetupClosed = 0x80987B5C; // type:func -DoorShutter_Close = 0x80987D28; // type:func -DoorShutter_JabuDoorClose = 0x80987E6C; // type:func -DoorShutter_WaitPlayerSurprised = 0x80987EB0; // type:func -DoorShutter_GohmaBlockFall = 0x80987F08; // type:func -DoorShutter_GohmaBlockBounce = 0x80988004; // type:func -DoorShutter_PhantomGanonBarsRaise = 0x80988090; // type:func -DoorShutter_Update = 0x80988120; // type:func -DoorShutter_DrawJabuJabuDoor = 0x80988174; // type:func -DoorShutter_ShouldDraw = 0x80988364; // type:func -DoorShutter_Draw = 0x80988410; // type:func -DoorShutter_RequestQuakeAndRumble = 0x80988964; // type:func -DoorToki_Init = 0x80988E60; // type:func -DoorToki_Destroy = 0x80988EC8; // type:func -DoorToki_Update = 0x80988EFC; // type:func -DoorWarp1_SetupAction = 0x80988FC0; // type:func -DoorWarp1_Init = 0x80988FCC; // type:func -DoorWarp1_Destroy = 0x8098913C; // type:func -DoorWarp1_SetupWarp = 0x809891C4; // type:func -DoorWarp1_SetupAdultDungeonWarp = 0x809894CC; // type:func -DoorWarp1_SetupBlueCrystal = 0x80989698; // type:func -DoorWarp1_SetupPurpleCrystal = 0x80989830; // type:func -DoorWarp1_SetPlayerPos = 0x809899D0; // type:func -DoorWarp1_BlueCrystal = 0x80989A08; // type:func -func_80999214 = 0x80989A54; // type:func -func_80999348 = 0x80989B88; // type:func -DoorWarp1_FloatPlayer = 0x80989C50; // type:func -DoorWarp1_PurpleCrystal = 0x80989C6C; // type:func -DoorWarp1_ChooseInitialAction = 0x80989D4C; // type:func -DoorWarp1_AwaitClearFlag = 0x80989DC4; // type:func -func_809995D4 = 0x80989E1C; // type:func -DoorWarp1_WarpAppear = 0x80989F6C; // type:func -func_809998A4 = 0x8098A0F0; // type:func -DoorWarp1_PlayerInRange = 0x8098A188; // type:func -DoorWarp1_ChildWarpIdle = 0x8098A1F4; // type:func -DoorWarp1_ChildWarpOut = 0x8098A2C0; // type:func -DoorWarp1_RutoWarpIdle = 0x8098A6B4; // type:func -func_80999EE0 = 0x8098A734; // type:func -func_80999FE4 = 0x8098A83C; // type:func -DoorWarp1_RutoWarpOut = 0x8098A8F4; // type:func -func_8099A3A4 = 0x8098AC00; // type:func -DoorWarp1_AdultWarpIdle = 0x8098ACCC; // type:func -func_8099A508 = 0x8098AD6C; // type:func -DoorWarp1_AdultWarpOut = 0x8098AE50; // type:func -DoorWarp1_Destination = 0x8098B734; // type:func -DoorWarp1_DoNothing = 0x8098B864; // type:func -func_8099B020 = 0x8098B874; // type:func -DoorWarp1_Update = 0x8098B930; // type:func -DoorWarp1_DrawBlueCrystal = 0x8098B994; // type:func -DoorWarp1_DrawPurpleCrystal = 0x8098BB64; // type:func -DoorWarp1_DrawWarp = 0x8098BDE8; // type:func -DoorWarp1_Draw = 0x8098CC94; // type:func -EfcErupc_SetupAction = 0x8098D2D0; // type:func -EfcErupc_Init = 0x8098D2DC; // type:func -EfcErupc_Destroy = 0x8098D348; // type:func -EfcErupc_UpdateAction = 0x8098D358; // type:func -EfcErupc_Update = 0x8098D5A4; // type:func -EfcErupc_Draw = 0x8098D5E0; // type:func -EfcErupc_DrawEffects = 0x8098D920; // type:func -EfcErupc_UpdateEffects = 0x8098DADC; // type:func -EfcErupc_SpawnEffect = 0x8098DC00; // type:func -EfcErupc_InitEffects = 0x8098DCCC; // type:func -EffDust_SetupAction = 0x8098DDC0; // type:func -EffDust_SetupDraw = 0x8098DDCC; // type:func -EffDust_InitPosAndDistance = 0x8098DDD8; // type:func -EffDust_Init = 0x8098DE50; // type:func -EffDust_Destroy = 0x8098E010; // type:func -EffDust_UpdateFunc_8099DB28 = 0x8098E020; // type:func -EffDust_UpdateFunc_8099DD74 = 0x8098E26C; // type:func -EffDust_UpdateFunc_8099DFC0 = 0x8098E4B8; // type:func -EffDust_Update = 0x8098E9CC; // type:func -EffDust_DrawFunc_8099E4F4 = 0x8098E9F0; // type:func -EffDust_DrawFunc_8099E784 = 0x8098EC44; // type:func -EffDust_Draw = 0x8098EFA8; // type:func -EffectSsBlast_Init = 0x8098F190; // type:func -EffectSsBlast_Draw = 0x8098F2EC; // type:func -EffectSsBlast_Update = 0x8098F458; // type:func -EffectSsBomb_Init = 0x8098F520; // type:func -EffectSsBomb_Draw = 0x8098F5E8; // type:func -EffectSsBomb_Update = 0x8098F820; // type:func -EffectSsBomb2_Init = 0x8098F950; // type:func -EffectSsBomb2_DrawFade = 0x8098FA48; // type:func -EffectSsBomb2_DrawLayered = 0x8098FC38; // type:func -EffectSsBomb2_Update = 0x8098FF6C; // type:func -EffectSsBubble_Init = 0x80990250; // type:func -EffectSsBubble_Draw = 0x809903E0; // type:func -EffectSsBubble_Update = 0x80990534; // type:func -EffectSsDFire_Init = 0x809906D0; // type:func -EffectSsDFire_Draw = 0x8099081C; // type:func -EffectSsDFire_Update = 0x80990A64; // type:func -EffectSsDeadDb_Init = 0x80990BC0; // type:func -EffectSsDeadDb_Draw = 0x80990CDC; // type:func -EffectSsDeadDb_Update = 0x80990EB0; // type:func -EffectSsDeadDd_Init = 0x809910A0; // type:func -EffectSsDeadDd_Draw = 0x80991368; // type:func -EffectSsDeadDd_Update = 0x80991538; // type:func -EffectSsDeadDs_Init = 0x80991630; // type:func -EffectSsDeadDs_Draw = 0x80991718; // type:func -EffectSsDeadDs_Update = 0x809919EC; // type:func -EffectSsDeadSound_Init = 0x80991AB0; // type:func -EffectSsDeadSound_Update = 0x80991B3C; // type:func -EffectSsDtBubble_Init = 0x80991BF0; // type:func -EffectSsDtBubble_Draw = 0x80991E44; // type:func -EffectSsDtBubble_Update = 0x80992084; // type:func -EffectSsDust_Init = 0x80992180; // type:func -EffectSsDust_Draw = 0x80992334; // type:func -EffectSsDust_Update = 0x8099267C; // type:func -EffectSsDust_UpdateFire = 0x80992774; // type:func -EffectSsEnFire_Init = 0x809929C0; // type:func -EffectSsEnFire_Draw = 0x80992B88; // type:func -EffectSsEnFire_Update = 0x80992E90; // type:func -EffectSsEnIce_Init = 0x80993110; // type:func -EffectSsEnIce_Draw = 0x809933B8; // type:func -EffectSsEnIce_UpdateFlying = 0x80993728; // type:func -EffectSsEnIce_Update = 0x80993900; // type:func -EffectSsExtra_Init = 0x809939D0; // type:func -EffectSsExtra_Draw = 0x80993B14; // type:func -EffectSsExtra_Update = 0x80993CC8; // type:func -EffectSsFcircle_Init = 0x80993D90; // type:func -EffectSsFcircle_Draw = 0x80993E50; // type:func -EffectSsFcircle_Update = 0x8099411C; // type:func -EffectSsFhgFlash_Init = 0x80994240; // type:func -EffectSsFhgFlash_DrawLightBall = 0x8099458C; // type:func -EffectSsFhgFlash_DrawShock = 0x80994780; // type:func -EffectSsFhgFlash_UpdateLightBall = 0x8099498C; // type:func -EffectSsFhgFlash_UpdateShock = 0x80994A24; // type:func -EffectSsFireTail_Init = 0x809951C0; // type:func -EffectSsFireTail_Draw = 0x809952DC; // type:func -EffectSsFireTail_Update = 0x809957E4; // type:func -EffectSsGFire_Init = 0x809958C0; // type:func -EffectSsGFire_Draw = 0x80995A00; // type:func -EffectSsGFire_Update = 0x80995AA8; // type:func -EffectSsGMagma_Init = 0x80995B50; // type:func -EffectSsGMagma_Draw = 0x80995CA8; // type:func -EffectSsGMagma_Update = 0x80995D04; // type:func -EffectSsGMagma2_Init = 0x80995DB0; // type:func -EffectSsGMagma2_Draw = 0x80995F7C; // type:func -EffectSsGMagma2_Update = 0x80996194; // type:func -EffectSsGRipple_Init = 0x809962C0; // type:func -EffectSsGRipple_DrawRipple = 0x8099643C; // type:func -EffectSsGRipple_Draw = 0x80996638; // type:func -EffectSsGRipple_Update = 0x80996670; // type:func -EffectSsGSpk_Init = 0x80996820; // type:func -EffectSsGSpk_Draw = 0x80996990; // type:func -EffectSsGSpk_Update = 0x80996B84; // type:func -EffectSsGSpk_UpdateNoAccel = 0x80996C8C; // type:func -EffectSsGSplash_Init = 0x80996DD0; // type:func -EffectSsGSplash_Draw = 0x80996FF0; // type:func -EffectSsGSplash_Update = 0x809970F8; // type:func -EffectSsHahen_CheckForObject = 0x80997280; // type:func -EffectSsHahen_Init = 0x809972F4; // type:func -EffectSsHahen_Draw = 0x80997490; // type:func -EffectSsHahen_DrawGray = 0x809975F0; // type:func -EffectSsHahen_Update = 0x80997798; // type:func -EffectSsHitMark_Init = 0x809978C0; // type:func -EffectSsHitMark_Draw = 0x809979C0; // type:func -EffectSsHitMark_Update = 0x80997BCC; // type:func -EffectSsIcePiece_Init = 0x80997E10; // type:func -EffectSsIcePiece_Draw = 0x80997F5C; // type:func -EffectSsIcePiece_Update = 0x80998190; // type:func -EffectSsIceSmoke_Init = 0x80998250; // type:func -EffectSsIceSmoke_Draw = 0x80998370; // type:func -EffectSsIceSmoke_Update = 0x80998650; // type:func -EffectSsKFire_Init = 0x80998730; // type:func -EffectSsKFire_Draw = 0x80998800; // type:func -EffectSsKFire_Update = 0x80998A68; // type:func -EffectSsKakera_Init = 0x80998B70; // type:func -func_809A9818 = 0x80998CFC; // type:func -EffectSsKakera_Draw = 0x80998D38; // type:func -func_809A9BA8 = 0x80999024; // type:func -func_809A9C10 = 0x80999090; // type:func -func_809A9DC0 = 0x80999240; // type:func -func_809A9DD8 = 0x8099925C; // type:func -func_809A9DEC = 0x80999278; // type:func -func_809A9E28 = 0x809992B4; // type:func -func_809A9E68 = 0x809992F4; // type:func -func_809A9E88 = 0x80999314; // type:func -func_809A9F10 = 0x809993A4; // type:func -func_809A9F4C = 0x809993E4; // type:func -func_809A9FD8 = 0x80999478; // type:func -func_809AA0B8 = 0x80999554; // type:func -func_809AA0EC = 0x8099958C; // type:func -func_809AA230 = 0x809996D4; // type:func -EffectSsKakera_Update = 0x809998D4; // type:func -EffectSsKiraKira_Init = 0x80999C00; // type:func -EffectSsKiraKira_Draw = 0x80999DA0; // type:func -func_809AABF0 = 0x80999FBC; // type:func -func_809AACAC = 0x8099A074; // type:func -func_809AAD6C = 0x8099A130; // type:func -EffectSsLightning_Init = 0x8099A270; // type:func -EffectSsLightning_NewLightning = 0x8099A358; // type:func -EffectSsLightning_Draw = 0x8099A3FC; // type:func -EffectSsLightning_Update = 0x8099A694; // type:func -EffectSsSibuki_Init = 0x8099A940; // type:func -EffectSsSibuki_Draw = 0x8099AAF8; // type:func -EffectSsSibuki_Update = 0x8099ACA8; // type:func -EffectSsSibuki2_Init = 0x8099B010; // type:func -EffectSsSibuki2_Draw = 0x8099B0C0; // type:func -EffectSsSibuki2_Update = 0x8099B2A4; // type:func -EffectSsSolderSrchBall_Init = 0x8099B340; // type:func -EffectSsSolderSrchBall_Update = 0x8099B3C0; // type:func -EffectSsStick_Init = 0x8099B4F0; // type:func -EffectSsStick_Draw = 0x8099B650; // type:func -EffectSsStick_Update = 0x8099B7F0; // type:func -EffectSsStone1_Init = 0x8099B890; // type:func -EffectSsStone1_Draw = 0x8099B91C; // type:func -EffectSsStone1_Update = 0x8099BB18; // type:func -ElfMsg_SetupAction = 0x8099BC10; // type:func -ElfMsg_KillCheck = 0x8099BC1C; // type:func -ElfMsg_Init = 0x8099BD54; // type:func -ElfMsg_Destroy = 0x8099BE48; // type:func -ElfMsg_GetMessageId = 0x8099BE58; // type:func -ElfMsg_CallNaviCuboid = 0x8099BE84; // type:func -ElfMsg_WithinXZDistance = 0x8099BF54; // type:func -ElfMsg_CallNaviCylinder = 0x8099BFA8; // type:func -ElfMsg_Update = 0x8099C070; // type:func -ElfMsg2_SetupAction = 0x8099C200; // type:func -ElfMsg2_KillCheck = 0x8099C20C; // type:func -ElfMsg2_Init = 0x8099C344; // type:func -ElfMsg2_Destroy = 0x8099C404; // type:func -ElfMsg2_GetMessageId = 0x8099C414; // type:func -ElfMsg2_WaitForTextClose = 0x8099C428; // type:func -ElfMsg2_WaitForTextRead = 0x8099C4A8; // type:func -ElfMsg2_WaitUntilActivated = 0x8099C4E0; // type:func -ElfMsg2_Update = 0x8099C55C; // type:func -EnAm_SetupAction = 0x8099C670; // type:func -EnAm_CanMove = 0x8099C67C; // type:func -EnAm_Init = 0x8099C7A8; // type:func -EnAm_Destroy = 0x8099C974; // type:func -EnAm_SpawnEffects = 0x8099C9CC; // type:func -EnAm_SetupSleep = 0x8099CB68; // type:func -EnAm_SetupStatue = 0x8099CC04; // type:func -EnAm_SetupLunge = 0x8099CC94; // type:func -EnAm_SetupCooldown = 0x8099CCF8; // type:func -EnAm_SetupMoveToHome = 0x8099CD64; // type:func -EnAm_SetupRotateToInit = 0x8099CDC0; // type:func -EnAm_SetupRotateToHome = 0x8099CE1C; // type:func -EnAm_SetupRecoilFromDamage = 0x8099CE78; // type:func -EnAm_SetupRicochet = 0x8099CF50; // type:func -EnAm_Sleep = 0x8099D004; // type:func -EnAm_RotateToHome = 0x8099D270; // type:func -EnAm_RotateToInit = 0x8099D374; // type:func -EnAm_MoveToHome = 0x8099D4E0; // type:func -EnAm_RecoilFromDamage = 0x8099D650; // type:func -EnAm_Cooldown = 0x8099D6F4; // type:func -EnAm_Lunge = 0x8099D82C; // type:func -EnAm_Statue = 0x8099DA60; // type:func -EnAm_SetupStunned = 0x8099DCB0; // type:func -EnAm_Stunned = 0x8099DD9C; // type:func -EnAm_Ricochet = 0x8099DE70; // type:func -EnAm_TransformSwordHitbox = 0x8099DF24; // type:func -EnAm_UpdateDamage = 0x8099DFBC; // type:func -EnAm_Update = 0x8099E154; // type:func -EnAm_PostLimbDraw = 0x8099E4F8; // type:func -EnAm_Draw = 0x8099E540; // type:func -EnAni_SetupAction = 0x8099EA70; // type:func -EnAni_Init = 0x8099EA7C; // type:func -EnAni_Destroy = 0x8099EB94; // type:func -EnAni_SetText = 0x8099EBC0; // type:func -func_809B04F0 = 0x8099EBFC; // type:func -func_809B0524 = 0x8099EC34; // type:func -func_809B0558 = 0x8099EC6C; // type:func -func_809B05F0 = 0x8099ED08; // type:func -func_809B064C = 0x8099ED6C; // type:func -func_809B07F8 = 0x8099EF18; // type:func -func_809B0988 = 0x8099F0A8; // type:func -func_809B0994 = 0x8099F0B8; // type:func -func_809B0A28 = 0x8099F14C; // type:func -func_809B0A6C = 0x8099F190; // type:func -EnAni_Update = 0x8099F23C; // type:func -EnAni_OverrideLimbDraw = 0x8099F4B8; // type:func -EnAni_PostLimbDraw = 0x8099F500; // type:func -EnAni_Draw = 0x8099F540; // type:func -EnAnubice_Hover = 0x8099F7E0; // type:func -EnAnubice_AimFireball = 0x8099F884; // type:func -EnAnubice_Init = 0x8099F964; // type:func -EnAnubice_Destroy = 0x8099FA7C; // type:func -EnAnubice_FindFlameCircles = 0x8099FAD8; // type:func -EnAnubice_SetupIdle = 0x8099FB60; // type:func -EnAnubice_Idle = 0x8099FC08; // type:func -EnAnubice_GoToHome = 0x8099FCE8; // type:func -EnAnubice_SetupShootFireball = 0x8099FE38; // type:func -EnAnubice_ShootFireball = 0x8099FEC0; // type:func -EnAnubice_SetupDie = 0x8099FFC0; // type:func -EnAnubice_Die = 0x809A0090; // type:func -EnAnubice_Update = 0x809A0344; // type:func -EnAnubice_OverrideLimbDraw = 0x809A0748; // type:func -EnAnubice_PostLimbDraw = 0x809A0794; // type:func -EnAnubice_Draw = 0x809A0850; // type:func -EnAnubiceFire_Init = 0x809A0A90; // type:func -EnAnubiceFire_Destroy = 0x809A0BB0; // type:func -func_809B26EC = 0x809A0BDC; // type:func -func_809B27D8 = 0x809A0CC8; // type:func -func_809B2B48 = 0x809A1038; // type:func -EnAnubiceFire_Update = 0x809A11E4; // type:func -EnAnubiceFire_Draw = 0x809A13E0; // type:func -EnAnubiceTag_Init = 0x809A1850; // type:func -EnAnubiceTag_Destroy = 0x809A18A0; // type:func -EnAnubiceTag_SpawnAnubis = 0x809A18B0; // type:func -EnAnubiceTag_ManageAnubis = 0x809A1928; // type:func -EnAnubiceTag_Update = 0x809A1A8C; // type:func -EnAnubiceTag_Draw = 0x809A1AB0; // type:func -EnArowTrap_Init = 0x809A1B20; // type:func -EnArowTrap_Destroy = 0x809A1B70; // type:func -EnArowTrap_Update = 0x809A1B80; // type:func -EnArrow_SetupAction = 0x809A1C70; // type:func -EnArrow_Init = 0x809A1C7C; // type:func -EnArrow_Destroy = 0x809A1E84; // type:func -EnArrow_Shoot = 0x809A1F0C; // type:func -func_809B3CEC = 0x809A2024; // type:func -EnArrow_CarryActor = 0x809A210C; // type:func -EnArrow_Fly = 0x809A2310; // type:func -func_809B45E0 = 0x809A2918; // type:func -func_809B4640 = 0x809A2978; // type:func -EnArrow_Update = 0x809A29E0; // type:func -func_809B4800 = 0x809A2B3C; // type:func -EnArrow_Draw = 0x809A2CA4; // type:func -EnAttackNiw_Init = 0x809A3370; // type:func -EnAttackNiw_Destroy = 0x809A34A4; // type:func -func_809B5268 = 0x809A34D8; // type:func -func_809B55EC = 0x809A3860; // type:func -func_809B5670 = 0x809A38E4; // type:func -func_809B59B0 = 0x809A3C24; // type:func -func_809B5C18 = 0x809A3E94; // type:func -EnAttackNiw_Update = 0x809A3F58; // type:func -func_809B5F98 = 0x809A421C; // type:func -EnAttackNiw_Draw = 0x809A4374; // type:func -EnBa_SetupAction = 0x809A45D0; // type:func -EnBa_Init = 0x809A45DC; // type:func -EnBa_Destroy = 0x809A47C8; // type:func -EnBa_SetupIdle = 0x809A47F4; // type:func -EnBa_Idle = 0x809A4834; // type:func -EnBa_SetupFallAsBlob = 0x809A4C60; // type:func -EnBa_FallAsBlob = 0x809A4CD0; // type:func -EnBa_SetupSwingAtPlayer = 0x809A4D90; // type:func -EnBa_SwingAtPlayer = 0x809A4DE4; // type:func -func_809B7174 = 0x809A5404; // type:func -EnBa_RecoilFromDamage = 0x809A5480; // type:func -func_809B75A0 = 0x809A5834; // type:func -EnBa_Die = 0x809A5AB0; // type:func -EnBa_Update = 0x809A5DE0; // type:func -EnBa_Draw = 0x809A5EC0; // type:func -EnBb_SetupAction = 0x809A64A0; // type:func -EnBb_FindExplosive = 0x809A64AC; // type:func -EnBb_SpawnFlameTrail = 0x809A6540; // type:func -EnBb_KillFlameTrail = 0x809A66DC; // type:func -EnBb_Init = 0x809A6728; // type:func -EnBb_Destroy = 0x809A6AD0; // type:func -EnBb_SetupFlameTrail = 0x809A6AFC; // type:func -EnBb_FlameTrail = 0x809A6B50; // type:func -EnBb_SetupDeath = 0x809A6CCC; // type:func -EnBb_Death = 0x809A6D60; // type:func -EnBb_SetupDamage = 0x809A6EDC; // type:func -EnBb_Damage = 0x809A6F9C; // type:func -EnBb_SetupBlue = 0x809A7008; // type:func -EnBb_Blue = 0x809A70C8; // type:func -EnBb_SetupDown = 0x809A78BC; // type:func -EnBb_Down = 0x809A794C; // type:func -EnBb_SetupRed = 0x809A7C20; // type:func -EnBb_Red = 0x809A7D30; // type:func -EnBb_FaceWaypoint = 0x809A80F8; // type:func -EnBb_SetWaypoint = 0x809A812C; // type:func -EnBb_SetupWhite = 0x809A81F8; // type:func -EnBb_White = 0x809A82A8; // type:func -EnBb_InitGreen = 0x809A862C; // type:func -EnBb_SetupGreen = 0x809A8764; // type:func -EnBb_Green = 0x809A87FC; // type:func -EnBb_SetupStunned = 0x809A8E6C; // type:func -EnBb_Stunned = 0x809A8F80; // type:func -EnBb_CollisionCheck = 0x809A9124; // type:func -EnBb_Update = 0x809A9458; // type:func -EnBb_PostLimbDraw = 0x809A96D8; // type:func -EnBb_Draw = 0x809A9728; // type:func -EnBdfire_SetupAction = 0x809AA180; // type:func -EnbdFire_SetupDraw = 0x809AA18C; // type:func -EnBdfire_Init = 0x809AA198; // type:func -EnBdfire_Destroy = 0x809AA3C8; // type:func -func_809BC2A4 = 0x809AA400; // type:func -func_809BC598 = 0x809AA6F4; // type:func -EnBdfire_Update = 0x809AA9E4; // type:func -EnBdfire_DrawFire = 0x809AAA20; // type:func -EnBdfire_Draw = 0x809AABE0; // type:func -EnBigokuta_Init = 0x809AAD20; // type:func -EnBigokuta_Destroy = 0x809AAE8C; // type:func -func_809BCE3C = 0x809AAF00; // type:func -func_809BCEBC = 0x809AAF7C; // type:func -func_809BCF68 = 0x809AB02C; // type:func -func_809BD1C8 = 0x809AB294; // type:func -func_809BD2E4 = 0x809AB3B0; // type:func -func_809BD318 = 0x809AB3E4; // type:func -func_809BD370 = 0x809AB43C; // type:func -func_809BD3AC = 0x809AB478; // type:func -func_809BD3E0 = 0x809AB4B0; // type:func -func_809BD3F8 = 0x809AB4CC; // type:func -func_809BD47C = 0x809AB550; // type:func -func_809BD4A4 = 0x809AB57C; // type:func -func_809BD524 = 0x809AB5FC; // type:func -func_809BD5E0 = 0x809AB6B8; // type:func -func_809BD658 = 0x809AB730; // type:func -func_809BD6B8 = 0x809AB790; // type:func -func_809BD768 = 0x809AB840; // type:func -func_809BD7F0 = 0x809AB8C8; // type:func -func_809BD84C = 0x809AB928; // type:func -func_809BD8DC = 0x809AB9B8; // type:func -func_809BDAE8 = 0x809ABBC4; // type:func -func_809BDB90 = 0x809ABC6C; // type:func -func_809BDC08 = 0x809ABCE4; // type:func -func_809BDF34 = 0x809AC014; // type:func -func_809BDFC8 = 0x809AC0A8; // type:func -func_809BE058 = 0x809AC138; // type:func -func_809BE180 = 0x809AC260; // type:func -func_809BE26C = 0x809AC34C; // type:func -func_809BE3E4 = 0x809AC4C4; // type:func -func_809BE4A4 = 0x809AC584; // type:func -func_809BE518 = 0x809AC5F8; // type:func -func_809BE568 = 0x809AC648; // type:func -func_809BE798 = 0x809AC878; // type:func -EnBigokuta_UpdateDamage = 0x809AC9BC; // type:func -EnBigokuta_Update = 0x809ACAAC; // type:func -EnBigokuta_OverrideLimbDraw = 0x809ACCA4; // type:func -EnBigokuta_Draw = 0x809AD11C; // type:func -EnBili_Init = 0x809AD820; // type:func -EnBili_Destroy = 0x809AD918; // type:func -EnBili_SetupFloatIdle = 0x809AD944; // type:func -EnBili_SetupSpawnedFlyApart = 0x809AD9A0; // type:func -EnBili_SetupDischargeLightning = 0x809ADA18; // type:func -EnBili_SetupClimb = 0x809ADA74; // type:func -EnBili_SetupApproachPlayer = 0x809ADACC; // type:func -EnBili_SetupSetNewHomeHeight = 0x809ADAEC; // type:func -EnBili_SetupRecoil = 0x809ADB54; // type:func -EnBili_SetupBurnt = 0x809ADBDC; // type:func -EnBili_SetupDie = 0x809ADC7C; // type:func -EnBili_SetupStunned = 0x809ADCB0; // type:func -EnBili_SetupFrozen = 0x809ADD28; // type:func -EnBili_UpdateTentaclesIndex = 0x809ADF00; // type:func -EnBili_UpdateFloating = 0x809AE020; // type:func -EnBili_FloatIdle = 0x809AE108; // type:func -EnBili_SpawnedFlyApart = 0x809AE1F4; // type:func -EnBili_DischargeLightning = 0x809AE24C; // type:func -EnBili_Climb = 0x809AE448; // type:func -EnBili_ApproachPlayer = 0x809AE504; // type:func -EnBili_SetNewHomeHeight = 0x809AE594; // type:func -EnBili_Recoil = 0x809AE610; // type:func -EnBili_Burnt = 0x809AE674; // type:func -EnBili_Die = 0x809AE6E8; // type:func -EnBili_Stunned = 0x809AE910; // type:func -EnBili_Frozen = 0x809AE970; // type:func -EnBili_UpdateDamage = 0x809AEA00; // type:func -EnBili_Update = 0x809AEBCC; // type:func -EnBili_PulseLimb3 = 0x809AEDA0; // type:func -EnBili_PulseLimb2 = 0x809AEFB8; // type:func -EnBili_PulseLimb4 = 0x809AF1D8; // type:func -EnBili_OverrideLimbDraw = 0x809AF340; // type:func -EnBili_Draw = 0x809AF430; // type:func -EnBird_SetupAction = 0x809AFAF0; // type:func -EnBird_Init = 0x809AFAFC; // type:func -EnBird_Destroy = 0x809AFBE8; // type:func -EnBird_SetupIdle = 0x809AFBF8; // type:func -EnBird_Idle = 0x809AFCAC; // type:func -EnBird_SetupMove = 0x809AFD4C; // type:func -EnBird_Move = 0x809AFD8C; // type:func -EnBird_Update = 0x809AFEA8; // type:func -EnBird_Draw = 0x809AFED8; // type:func -EnBlkobj_SetupAction = 0x809AFFB0; // type:func -EnBlkobj_Init = 0x809AFFC0; // type:func -EnBlkobj_Destroy = 0x809B0070; // type:func -EnBlkobj_Wait = 0x809B00A4; // type:func -EnBlkobj_SpawnDarkLink = 0x809B00F8; // type:func -EnBlkobj_DarkLinkFight = 0x809B0170; // type:func -EnBlkobj_DoNothing = 0x809B024C; // type:func -EnBlkobj_Update = 0x809B025C; // type:func -EnBlkobj_DrawAlpha = 0x809B0280; // type:func -EnBlkobj_Draw = 0x809B02FC; // type:func -EnBom_SetupAction = 0x809B0510; // type:func -EnBom_Init = 0x809B051C; // type:func -EnBom_Destroy = 0x809B0634; // type:func -EnBom_Move = 0x809B0674; // type:func -EnBom_WaitForRelease = 0x809B0844; // type:func -EnBom_Explode = 0x809B0890; // type:func -EnBom_Update = 0x809B09E0; // type:func -EnBom_Draw = 0x809B1070; // type:func -EnBomBowlMan_Init = 0x809B13E0; // type:func -EnBomBowlMan_Destroy = 0x809B15A0; // type:func -EnBomBowlMan_SetupWaitAsleep = 0x809B15B0; // type:func -EnBomBowlMan_WaitAsleep = 0x809B1638; // type:func -EnBomBowlMan_TalkAsleep = 0x809B16EC; // type:func -EnBomBowlMan_WakeUp = 0x809B1764; // type:func -EnBomBowlMan_BlinkAwake = 0x809B17E8; // type:func -EnBomBowlMan_CheckBeatenDC = 0x809B18E4; // type:func -EnBomBowlMan_WaitNotBeatenDC = 0x809B1A10; // type:func -EnBomBowlMan_TalkNotBeatenDC = 0x809B1A6C; // type:func -EnBomBowlMan_SetupRunGame = 0x809B1ADC; // type:func -EnBomBowlMan_RunGame = 0x809B1B60; // type:func -EnBomBowlMan_HandlePlayChoice = 0x809B1D70; // type:func -func_809C41FC = 0x809B1F2C; // type:func -EnBomBowlMan_SetupChooseShowPrize = 0x809B2048; // type:func -EnBomBowlMan_ChooseShowPrize = 0x809B214C; // type:func -EnBomBowlMan_BeginPlayGame = 0x809B2394; // type:func -EnBomBowlMan_Update = 0x809B2450; // type:func -EnBomBowlMan_OverrideLimbDraw = 0x809B25C8; // type:func -EnBomBowlMan_Draw = 0x809B2610; // type:func -EnBomBowlPit_Init = 0x809B2920; // type:func -EnBomBowlPit_Destroy = 0x809B2938; // type:func -EnBomBowlPit_SetupDetectHit = 0x809B2948; // type:func -EnBomBowlPit_DetectHit = 0x809B2974; // type:func -EnBomBowlPit_CameraDollyIn = 0x809B2C6C; // type:func -EnBomBowlPit_SpawnPrize = 0x809B2E48; // type:func -EnBomBowlPit_SetupGivePrize = 0x809B2ED8; // type:func -EnBomBowlPit_GivePrize = 0x809B2F90; // type:func -EnBomBowlPit_WaitTillPrizeGiven = 0x809B3094; // type:func -EnBomBowlPit_Reset = 0x809B30F0; // type:func -EnBomBowlPit_Update = 0x809B3170; // type:func -EnBomChu_Init = 0x809B3290; // type:func -EnBomChu_Destroy = 0x809B3430; // type:func -EnBomChu_Explode = 0x809B3480; // type:func -EnBomChu_CrossProduct = 0x809B35A0; // type:func -EnBomChu_UpdateFloorPoly = 0x809B3614; // type:func -EnBomChu_WaitForRelease = 0x809B3848; // type:func -EnBomChu_Move = 0x809B39B8; // type:func -EnBomChu_WaitForKill = 0x809B3ED0; // type:func -EnBomChu_ModelToWorld = 0x809B3F10; // type:func -EnBomChu_SpawnRipples = 0x809B3FC0; // type:func -EnBomChu_Update = 0x809B404C; // type:func -EnBomChu_Draw = 0x809B4410; // type:func -EnBombf_SetupAction = 0x809B4930; // type:func -EnBombf_Init = 0x809B493C; // type:func -EnBombf_Destroy = 0x809B4B18; // type:func -EnBombf_SetupGrowBomb = 0x809B4B58; // type:func -EnBombf_GrowBomb = 0x809B4B80; // type:func -EnBombf_Move = 0x809B4E90; // type:func -EnBombf_WaitForRelease = 0x809B4FB4; // type:func -EnBombf_Explode = 0x809B5018; // type:func -EnBombf_Update = 0x809B516C; // type:func -EnBombf_NewMtxDList = 0x809B5918; // type:func -EnBombf_Draw = 0x809B59A4; // type:func -EnBoom_SetupAction = 0x809B5DC0; // type:func -EnBoom_Init = 0x809B5DCC; // type:func -EnBoom_Destroy = 0x809B5EE8; // type:func -EnBoom_Fly = 0x809B5F28; // type:func -EnBoom_Update = 0x809B6368; // type:func -EnBoom_Draw = 0x809B63C0; // type:func -EnBox_SetupAction = 0x809B6690; // type:func -EnBox_ClipToGround = 0x809B669C; // type:func -EnBox_Init = 0x809B6728; // type:func -EnBox_Destroy = 0x809B6B98; // type:func -EnBox_RandomDustKinematic = 0x809B6BCC; // type:func -EnBox_SpawnDust = 0x809B6CD0; // type:func -EnBox_Fall = 0x809B6D84; // type:func -EnBox_FallOnSwitchFlag = 0x809B6F08; // type:func -func_809C9700 = 0x809B6FD8; // type:func -EnBox_AppearOnSwitchFlag = 0x809B7168; // type:func -EnBox_AppearOnRoomClear = 0x809B71E8; // type:func -EnBox_AppearInit = 0x809B72A0; // type:func -EnBox_AppearAnimation = 0x809B735C; // type:func -EnBox_WaitOpen = 0x809B7408; // type:func -EnBox_Open = 0x809B763C; // type:func -EnBox_SpawnIceSmoke = 0x809B77C4; // type:func -EnBox_Update = 0x809B7A70; // type:func -EnBox_PostLimbDraw = 0x809B7BAC; // type:func -EnBox_EmptyDList = 0x809B7D14; // type:func -func_809CA4A0 = 0x809B7D38; // type:func -func_809CA518 = 0x809B7D78; // type:func -EnBox_Draw = 0x809B7DB8; // type:func -EnBrob_Init = 0x809B81F0; // type:func -EnBrob_Destroy = 0x809B8464; // type:func -EnBrob_SetupIdle = 0x809B84BC; // type:func -EnBrob_SetupMoveUp = 0x809B8524; // type:func -EnBrob_SetupWobble = 0x809B8584; // type:func -EnBrob_SetupStunned = 0x809B85D8; // type:func -EnBrob_SetupMoveDown = 0x809B866C; // type:func -EnBrob_SetupShock = 0x809B86EC; // type:func -EnBrob_Idle = 0x809B8738; // type:func -EnBrob_MoveUp = 0x809B87F8; // type:func -EnBrob_Wobble = 0x809B88FC; // type:func -EnBrob_Stunned = 0x809B899C; // type:func -EnBrob_MoveDown = 0x809B8A38; // type:func -EnBrob_Shock = 0x809B8B3C; // type:func -EnBrob_Update = 0x809B8D54; // type:func -EnBrob_PostLimbDraw = 0x809B8FF0; // type:func -EnBrob_Draw = 0x809B90C4; // type:func -EnBubble_SetDimensions = 0x809B92E0; // type:func -func_809CBCBC = 0x809B939C; // type:func -func_809CBCEC = 0x809B93D0; // type:func -EnBubble_DamagePlayer = 0x809B93F4; // type:func -EnBubble_Explosion = 0x809B9460; // type:func -func_809CBFD4 = 0x809B96BC; // type:func -func_809CC020 = 0x809B9708; // type:func -EnBubble_Vec3fNormalizedReflect = 0x809B975C; // type:func -EnBubble_Vec3fNormalize = 0x809B97E4; // type:func -EnBubble_Fly = 0x809B985C; // type:func -func_809CC648 = 0x809B9D38; // type:func -EnBubble_DetectPop = 0x809B9DD4; // type:func -func_809CC774 = 0x809B9E64; // type:func -EnBubble_Init = 0x809B9F78; // type:func -EnBubble_Destroy = 0x809BA078; // type:func -EnBubble_Wait = 0x809BA0A4; // type:func -EnBubble_Pop = 0x809BA158; // type:func -EnBubble_Disappear = 0x809BA1A8; // type:func -EnBubble_Regrow = 0x809BA1F0; // type:func -EnBubble_Update = 0x809BA260; // type:func -EnBubble_Draw = 0x809BA2DC; // type:func -EnButte_SelectFlightParams = 0x809BA700; // type:func -EnButte_ResetTransformationEffect = 0x809BA784; // type:func -EnButte_UpdateTransformationEffect = 0x809BA7A0; // type:func -EnButte_DrawTransformationEffect = 0x809BA7D8; // type:func -EnButte_Init = 0x809BAA14; // type:func -EnButte_Destroy = 0x809BAB88; // type:func -func_809CD56C = 0x809BABB4; // type:func -func_809CD634 = 0x809BAC7C; // type:func -EnButte_Turn = 0x809BAD44; // type:func -EnButte_SetupFlyAround = 0x809BADE0; // type:func -EnButte_FlyAround = 0x809BAE2C; // type:func -EnButte_SetupFollowLink = 0x809BB210; // type:func -EnButte_FollowLink = 0x809BB25C; // type:func -EnButte_SetupTransformIntoFairy = 0x809BB610; // type:func -EnButte_TransformIntoFairy = 0x809BB660; // type:func -EnButte_SetupWaitToDie = 0x809BB71C; // type:func -EnButte_WaitToDie = 0x809BB73C; // type:func -EnButte_Update = 0x809BB76C; // type:func -EnButte_Draw = 0x809BB8AC; // type:func -EnBw_SetupAction = 0x809BBCD0; // type:func -EnBw_Init = 0x809BBCDC; // type:func -EnBw_Destroy = 0x809BBE3C; // type:func -func_809CE884 = 0x809BBE7C; // type:func -func_809CE9A8 = 0x809BBFA0; // type:func -func_809CEA24 = 0x809BC01C; // type:func -func_809CF72C = 0x809BCD24; // type:func -func_809CF7AC = 0x809BCDA4; // type:func -func_809CF8F0 = 0x809BCEE8; // type:func -func_809CF984 = 0x809BCF7C; // type:func -func_809CFBA8 = 0x809BD1A4; // type:func -func_809CFC4C = 0x809BD248; // type:func -func_809CFF10 = 0x809BD50C; // type:func -func_809CFF98 = 0x809BD594; // type:func -func_809D00F4 = 0x809BD6F0; // type:func -func_809D014C = 0x809BD748; // type:func -func_809D01CC = 0x809BD7C8; // type:func -func_809D0268 = 0x809BD864; // type:func -func_809D03CC = 0x809BD9C8; // type:func -func_809D0424 = 0x809BDA20; // type:func -func_809D0584 = 0x809BDB80; // type:func -EnBw_Update = 0x809BDE8C; // type:func -EnBw_OverrideLimbDraw = 0x809BE31C; // type:func -EnBw_Draw = 0x809BE534; // type:func -EnBx_Init = 0x809BF060; // type:func -EnBx_Destroy = 0x809BF268; // type:func -func_809D1D0C = 0x809BF294; // type:func -EnBx_Update = 0x809BF364; // type:func -EnBx_Draw = 0x809BF688; // type:func -EnChanger_Destroy = 0x809BFB60; // type:func -EnChanger_Init = 0x809BFB70; // type:func -EnChanger_Wait = 0x809C008C; // type:func -EnChanger_OpenChests = 0x809C0130; // type:func -EnChanger_SetHeartPieceFlag = 0x809C02E0; // type:func -EnChanger_Update = 0x809C0330; // type:func -EnClearTag_CreateDebrisEffect = 0x809C0540; // type:func -EnClearTag_CreateFireEffect = 0x809C0638; // type:func -EnClearTag_CreateSmokeEffect = 0x809C0728; // type:func -EnClearTag_CreateFlashEffect = 0x809C084C; // type:func -EnClearTag_Destroy = 0x809C0924; // type:func -EnClearTag_Init = 0x809C0950; // type:func -EnClearTag_CalculateFloorTangent = 0x809C0B14; // type:func -EnClearTag_Update = 0x809C0BD0; // type:func -EnClearTag_Draw = 0x809C1984; // type:func -EnClearTag_UpdateEffects = 0x809C1F18; // type:func -EnClearTag_DrawEffects = 0x809C22E0; // type:func -EnCow_RotateY = 0x809CBAE0; // type:func -EnCow_SetColliderPos = 0x809CBB78; // type:func -EnCow_SetTailPos = 0x809CBC6C; // type:func -EnCow_Init = 0x809CBCE8; // type:func -EnCow_Destroy = 0x809CC120; // type:func -EnCow_UpdateAnimation = 0x809CC16C; // type:func -EnCow_TalkEnd = 0x809CC394; // type:func -EnCow_GiveMilkEnd = 0x809CC40C; // type:func -EnCow_GiveMilkWait = 0x809CC454; // type:func -EnCow_GiveMilk = 0x809CC4B8; // type:func -EnCow_CheckForEmptyBottle = 0x809CC554; // type:func -EnCow_Talk = 0x809CC5E4; // type:func -EnCow_Idle = 0x809CC658; // type:func -EnCow_IdleTail = 0x809CC774; // type:func -EnCow_Update = 0x809CC90C; // type:func -EnCow_UpdateTail = 0x809CCB88; // type:func -EnCow_OverrideLimbDraw = 0x809CCC74; // type:func -EnCow_PostLimbDraw = 0x809CCCC4; // type:func -EnCow_Draw = 0x809CCD04; // type:func -EnCow_DrawTail = 0x809CCD64; // type:func -EnCrow_Init = 0x809CCF40; // type:func -EnCrow_Destroy = 0x809CD030; // type:func -EnCrow_SetupFlyIdle = 0x809CD05C; // type:func -EnCrow_SetupDiveAttack = 0x809CD090; // type:func -EnCrow_SetupDamaged = 0x809CD0C4; // type:func -EnCrow_SetupDie = 0x809CD3E4; // type:func -EnCrow_SetupTurnAway = 0x809CD3FC; // type:func -EnCrow_SetupRespawn = 0x809CD484; // type:func -EnCrow_FlyIdle = 0x809CD578; // type:func -EnCrow_DiveAttack = 0x809CD9A4; // type:func -EnCrow_Damaged = 0x809CDB48; // type:func -EnCrow_Die = 0x809CDC70; // type:func -EnCrow_TurnAway = 0x809CDD20; // type:func -EnCrow_Respawn = 0x809CDDC4; // type:func -EnCrow_UpdateDamage = 0x809CDE90; // type:func -EnCrow_Update = 0x809CDF40; // type:func -EnCrow_OverrideLimbDraw = 0x809CE15C; // type:func -EnCrow_PostLimbDraw = 0x809CE248; // type:func -EnCrow_Draw = 0x809CE308; // type:func -EnCs_ChangeAnim = 0x809CE5E0; // type:func -EnCs_Init = 0x809CE704; // type:func -EnCs_Destroy = 0x809CE898; // type:func -EnCs_GetTalkState = 0x809CE8C4; // type:func -EnCs_GetTextId = 0x809CE9F8; // type:func -EnCs_HandleTalking = 0x809CEA7C; // type:func -EnCs_GetwaypointCount = 0x809CEBC8; // type:func -EnCs_GetPathPoint = 0x809CEBDC; // type:func -EnCs_HandleWalking = 0x809CEC70; // type:func -EnCs_Walk = 0x809CEE88; // type:func -EnCs_Wait = 0x809CF028; // type:func -EnCs_Talk = 0x809CF0B4; // type:func -EnCs_Update = 0x809CF178; // type:func -EnCs_Draw = 0x809CF2E8; // type:func -EnCs_OverrideLimbDraw = 0x809CF49C; // type:func -EnCs_PostLimbDraw = 0x809CF52C; // type:func -EnDaiku_ChangeAnim = 0x809CF810; // type:func -EnDaiku_Init = 0x809CF8C4; // type:func -EnDaiku_Destroy = 0x809CFC0C; // type:func -EnDaiku_UpdateTalking = 0x809CFC38; // type:func -EnDaiku_UpdateText = 0x809CFD54; // type:func -EnDaiku_TentIdle = 0x809D0024; // type:func -EnDaiku_Jailed = 0x809D005C; // type:func -EnDaiku_WaitFreedom = 0x809D012C; // type:func -EnDaiku_InitEscape = 0x809D0190; // type:func -EnDaiku_EscapeRotate = 0x809D0398; // type:func -EnDaiku_InitSubCamera = 0x809D0404; // type:func -EnDaiku_UpdateSubCamera = 0x809D0590; // type:func -EnDaiku_EscapeSuccess = 0x809D0648; // type:func -EnDaiku_EscapeRun = 0x809D0784; // type:func -EnDaiku_Update = 0x809D0990; // type:func -EnDaiku_Draw = 0x809D0AA8; // type:func -EnDaiku_OverrideLimbDraw = 0x809D0BD0; // type:func -EnDaiku_PostLimbDraw = 0x809D0C54; // type:func -EnDaikuKakariko_ChangeAnim = 0x809D0F50; // type:func -EnDaikuKakariko_Init = 0x809D1004; // type:func -EnDaikuKakariko_Destroy = 0x809D135C; // type:func -EnDaikuKakariko_GetTalkState = 0x809D1388; // type:func -EnDaikuKakariko_HandleTalking = 0x809D142C; // type:func -EnDaikuKakariko_Talk = 0x809D15E8; // type:func -EnDaikuKakariko_Wait = 0x809D16BC; // type:func -EnDaikuKakariko_StopRunning = 0x809D1758; // type:func -EnDaikuKakariko_Run = 0x809D1808; // type:func -EnDaikuKakariko_Update = 0x809D1B88; // type:func -EnDaikuKakariko_OverrideLimbDraw = 0x809D1D00; // type:func -EnDaikuKakariko_PostLimbDraw = 0x809D1EC0; // type:func -EnDaikuKakariko_Draw = 0x809D1F3C; // type:func -EnDekubaba_Init = 0x809D2310; // type:func -EnDekubaba_Destroy = 0x809D2554; // type:func -EnDekubaba_DisableACColliderElems = 0x809D2580; // type:func -EnDekubaba_SetupWait = 0x809D2608; // type:func -EnDekubaba_SetupGrow = 0x809D2870; // type:func -EnDekubaba_SetupRetract = 0x809D29A0; // type:func -EnDekubaba_SetupDecideLunge = 0x809D2A88; // type:func -EnDekubaba_SetupPrepareLunge = 0x809D2AE0; // type:func -EnDekubaba_SetupLunge = 0x809D2B04; // type:func -EnDekubaba_SetupPullBack = 0x809D2B48; // type:func -EnDekubaba_SetupRecover = 0x809D2BC0; // type:func -EnDekubaba_SetupHit = 0x809D2BF4; // type:func -EnDekubaba_SetupPrunedSomersault = 0x809D2CBC; // type:func -EnDekubaba_SetupShrinkDie = 0x809D2D30; // type:func -EnDekubaba_SetupStunnedVertical = 0x809D2DB0; // type:func -EnDekubaba_SetupSway = 0x809D2F34; // type:func -EnDekubaba_SetupDeadStickDrop = 0x809D2FA0; // type:func -EnDekubaba_Wait = 0x809D3040; // type:func -EnDekubaba_Grow = 0x809D30EC; // type:func -EnDekubaba_Retract = 0x809D3554; // type:func -EnDekubaba_UpdateHeadPosition = 0x809D391C; // type:func -EnDekubaba_DecideLunge = 0x809D3A20; // type:func -EnDekubaba_Lunge = 0x809D3C50; // type:func -EnDekubaba_PrepareLunge = 0x809D3ED8; // type:func -EnDekubaba_PullBack = 0x809D3FA4; // type:func -EnDekubaba_Recover = 0x809D4330; // type:func -EnDekubaba_Hit = 0x809D4428; // type:func -EnDekubaba_StunnedVertical = 0x809D4538; // type:func -EnDekubaba_Sway = 0x809D45D4; // type:func -EnDekubaba_PrunedSomersault = 0x809D46FC; // type:func -EnDekubaba_ShrinkDie = 0x809D4A60; // type:func -EnDekubaba_DeadStickDrop = 0x809D4C24; // type:func -EnDekubaba_UpdateDamage = 0x809D4C8C; // type:func -EnDekubaba_Update = 0x809D4F40; // type:func -EnDekubaba_DrawStemRetracted = 0x809D50E0; // type:func -EnDekubaba_DrawStemExtended = 0x809D51D0; // type:func -EnDekubaba_DrawStemBasePruned = 0x809D54C0; // type:func -EnDekubaba_DrawBaseShadow = 0x809D5580; // type:func -EnDekubaba_PostLimbDraw = 0x809D5674; // type:func -EnDekubaba_Draw = 0x809D56B0; // type:func -EnDekunuts_Init = 0x809D5DC0; // type:func -EnDekunuts_Destroy = 0x809D5F2C; // type:func -EnDekunuts_SetupWait = 0x809D5F68; // type:func -EnDekunuts_SetupLookAround = 0x809D5FDC; // type:func -EnDekunuts_SetupThrowNut = 0x809D6024; // type:func -EnDekunuts_SetupStand = 0x809D6068; // type:func -EnDekunuts_SetupBurrow = 0x809D60D0; // type:func -EnDekunuts_SetupBeginRun = 0x809D6120; // type:func -EnDekunuts_SetupRun = 0x809D6188; // type:func -EnDekunuts_SetupGasp = 0x809D61E0; // type:func -EnDekunuts_SetupBeDamaged = 0x809D6240; // type:func -EnDekunuts_SetupBeStunned = 0x809D631C; // type:func -EnDekunuts_SetupDie = 0x809D63B0; // type:func -EnDekunuts_Wait = 0x809D6400; // type:func -EnDekunuts_LookAround = 0x809D6664; // type:func -EnDekunuts_Stand = 0x809D66E8; // type:func -EnDekunuts_ThrowNut = 0x809D67D4; // type:func -EnDekunuts_Burrow = 0x809D692C; // type:func -EnDekunuts_BeginRun = 0x809D6A40; // type:func -EnDekunuts_Run = 0x809D6AA8; // type:func -EnDekunuts_Gasp = 0x809D6CE8; // type:func -EnDekunuts_BeDamaged = 0x809D6D50; // type:func -EnDekunuts_BeStunned = 0x809D6DA0; // type:func -EnDekunuts_Die = 0x809D6E1C; // type:func -EnDekunuts_ColliderCheck = 0x809D6F78; // type:func -EnDekunuts_Update = 0x809D709C; // type:func -EnDekunuts_OverrideLimbDraw = 0x809D7204; // type:func -EnDekunuts_Draw = 0x809D7338; // type:func -EnDh_SetupAction = 0x809D75C0; // type:func -EnDh_Init = 0x809D75CC; // type:func -EnDh_Destroy = 0x809D7708; // type:func -EnDh_SpawnDebris = 0x809D7750; // type:func -EnDh_SetupWait = 0x809D78E8; // type:func -EnDh_Wait = 0x809D799C; // type:func -EnDh_SetupWalk = 0x809D7BC0; // type:func -EnDh_Walk = 0x809D7C5C; // type:func -EnDh_SetupRetreat = 0x809D7D64; // type:func -EnDh_Retreat = 0x809D7DC8; // type:func -EnDh_SetupAttack = 0x809D7E54; // type:func -EnDh_Attack = 0x809D7EB4; // type:func -EnDh_SetupBurrow = 0x809D81C4; // type:func -EnDh_Burrow = 0x809D8248; // type:func -EnDh_SetupDamage = 0x809D83D8; // type:func -EnDh_Damage = 0x809D8458; // type:func -EnDh_SetupDeath = 0x809D8580; // type:func -EnDh_Death = 0x809D8608; // type:func -EnDh_CollisionCheck = 0x809D8738; // type:func -EnDh_Update = 0x809D8888; // type:func -EnDh_PostLimbDraw = 0x809D8A38; // type:func -EnDh_Draw = 0x809D8AC8; // type:func -EnDha_SetupAction = 0x809D90A0; // type:func -EnDha_Init = 0x809D90AC; // type:func -EnDha_Destroy = 0x809D91C8; // type:func -EnDha_SetupWait = 0x809D91F4; // type:func -EnDha_Wait = 0x809D927C; // type:func -EnDha_SetupTakeDamage = 0x809D978C; // type:func -EnDha_TakeDamage = 0x809D97B8; // type:func -EnDha_SetupDeath = 0x809D9880; // type:func -EnDha_Die = 0x809D98F0; // type:func -EnDha_UpdateHealth = 0x809D9AAC; // type:func -EnDha_Update = 0x809D9BA0; // type:func -EnDha_OverrideLimbDraw = 0x809D9C48; // type:func -EnDha_PostLimbDraw = 0x809D9CE8; // type:func -EnDha_Draw = 0x809D9E00; // type:func -EnDivingGame_Init = 0x809DA0A0; // type:func -EnDivingGame_Destroy = 0x809DA1BC; // type:func -EnDivingGame_SpawnRuppy = 0x809DA1FC; // type:func -EnDivingGame_HasMinigameFinished = 0x809DA328; // type:func -func_809EDCB0 = 0x809DA4D4; // type:func -EnDivingGame_Talk = 0x809DA570; // type:func -EnDivingGame_HandlePlayChoice = 0x809DA700; // type:func -func_809EE048 = 0x809DA86C; // type:func -func_809EE0FC = 0x809DA920; // type:func -func_809EE194 = 0x809DA9B8; // type:func -EnDivingGame_SetupRupeeThrow = 0x809DAA18; // type:func -EnDivingGame_RupeeThrow = 0x809DAC2C; // type:func -EnDivingGame_SetupUnderwaterViewCs = 0x809DAEEC; // type:func -func_809EE780 = 0x809DAFA4; // type:func -func_809EE800 = 0x809DB024; // type:func -func_809EE8F0 = 0x809DB114; // type:func -func_809EE96C = 0x809DB194; // type:func -func_809EEA00 = 0x809DB228; // type:func -func_809EEA90 = 0x809DB2B8; // type:func -func_809EEAF8 = 0x809DB324; // type:func -EnDivingGame_Update = 0x809DB3B4; // type:func -EnDivingGame_EmptyDList = 0x809DB5E0; // type:func -EnDivingGame_OverrideLimbDraw = 0x809DB604; // type:func -EnDivingGame_Draw = 0x809DB764; // type:func -EnDns_Init = 0x809DBA50; // type:func -EnDns_Destroy = 0x809DBBC4; // type:func -EnDns_ChangeAnim = 0x809DBBF0; // type:func -EnDns_CanBuyDekuNuts = 0x809DBC78; // type:func -EnDns_CanBuyDekuSticks = 0x809DBD30; // type:func -EnDns_CanBuyPrice = 0x809DBDE8; // type:func -EnDns_CanBuyDekuSeeds = 0x809DBE18; // type:func -EnDns_CanBuyDekuShield = 0x809DBEE0; // type:func -EnDns_CanBuyBombs = 0x809DBF34; // type:func -EnDns_CanBuyArrows = 0x809DBFD4; // type:func -EnDns_CanBuyBottle = 0x809DC084; // type:func -EnDns_PayPrice = 0x809DC0DC; // type:func -EnDns_PayForDekuNuts = 0x809DC110; // type:func -EnDns_PayForHeartPiece = 0x809DC144; // type:func -EnDns_PayForBombs = 0x809DC18C; // type:func -EnDns_PayForArrows = 0x809DC1C0; // type:func -EnDns_PayForDekuStickUpgrade = 0x809DC1F4; // type:func -EnDns_PayForDekuNutUpgrade = 0x809DC23C; // type:func -EnDns_SetupIdle = 0x809DC284; // type:func -EnDns_Idle = 0x809DC2C8; // type:func -EnDns_Talk = 0x809DC39C; // type:func -EnDns_OfferSaleItem = 0x809DC4D4; // type:func -EnDns_SetupSale = 0x809DC5EC; // type:func -EnDns_Sale = 0x809DC658; // type:func -EnDns_SetupBurrow = 0x809DC6A4; // type:func -EnDns_SetupNoSaleBurrow = 0x809DC798; // type:func -EnDns_Burrow = 0x809DC810; // type:func -EnDns_PostBurrow = 0x809DC88C; // type:func -EnDns_Update = 0x809DC990; // type:func -EnDns_Draw = 0x809DCA80; // type:func -EnDntDemo_Destroy = 0x809DCDE0; // type:func -EnDntDemo_Init = 0x809DCDF0; // type:func -EnDntDemo_Judge = 0x809DCF60; // type:func -EnDntDemo_Results = 0x809DD580; // type:func -EnDntDemo_Prize = 0x809DD7F4; // type:func -EnDntDemo_Update = 0x809DD8D0; // type:func -EnDntJiji_Init = 0x809DDB00; // type:func -EnDntJiji_Destroy = 0x809DDBE0; // type:func -EnDntJiji_SetFlower = 0x809DDC0C; // type:func -EnDntJiji_SetupWait = 0x809DDC4C; // type:func -EnDntJiji_Wait = 0x809DDCFC; // type:func -EnDntJiji_SetupUp = 0x809DDDB4; // type:func -EnDntJiji_Up = 0x809DDE98; // type:func -EnDntJiji_SetupUnburrow = 0x809DDF08; // type:func -EnDntJiji_Unburrow = 0x809DDFEC; // type:func -EnDntJiji_SetupWalk = 0x809DE074; // type:func -EnDntJiji_Walk = 0x809DE124; // type:func -EnDntJiji_SetupBurrow = 0x809DE260; // type:func -EnDntJiji_Burrow = 0x809DE350; // type:func -EnDntJiji_SetupCower = 0x809DE37C; // type:func -EnDntJiji_Cower = 0x809DE4BC; // type:func -EnDntJiji_SetupTalk = 0x809DE560; // type:func -EnDntJiji_Talk = 0x809DE5F4; // type:func -EnDntJiji_SetupGivePrize = 0x809DE6C0; // type:func -EnDntJiji_GivePrize = 0x809DE730; // type:func -EnDntJiji_SetupHide = 0x809DE840; // type:func -EnDntJiji_Hide = 0x809DE8D8; // type:func -EnDntJiji_SetupReturn = 0x809DE944; // type:func -EnDntJiji_Return = 0x809DE9F4; // type:func -EnDntJiji_Update = 0x809DEB6C; // type:func -EnDntJiji_Draw = 0x809DED44; // type:func -EnDntNomal_Init = 0x809DF020; // type:func -EnDntNomal_Destroy = 0x809DF148; // type:func -EnDntNomal_WaitForObject = 0x809DF194; // type:func -EnDntNomal_SetFlower = 0x809DF2E4; // type:func -EnDntNomal_SetupTargetWait = 0x809DF33C; // type:func -EnDntNomal_TargetWait = 0x809DF3E4; // type:func -EnDntNomal_SetupTargetUnburrow = 0x809DF6C0; // type:func -EnDntNomal_TargetUnburrow = 0x809DF7DC; // type:func -EnDntNomal_SetupTargetWalk = 0x809DF848; // type:func -EnDntNomal_TargetWalk = 0x809DF8EC; // type:func -EnDntNomal_TargetFacePlayer = 0x809DF9D8; // type:func -EnDntNomal_SetupTargetTalk = 0x809DFA8C; // type:func -EnDntNomal_TargetTalk = 0x809DFB38; // type:func -EnDntNomal_SetupTargetGivePrize = 0x809DFBE0; // type:func -EnDntNomal_TargetGivePrize = 0x809DFC78; // type:func -EnDntNomal_TargetReturn = 0x809DFDE0; // type:func -EnDntNomal_TargetBurrow = 0x809DFFB0; // type:func -EnDntNomal_SetupStageWait = 0x809E001C; // type:func -EnDntNomal_StageWait = 0x809E00D4; // type:func -EnDntNomal_SetupStageUp = 0x809E0100; // type:func -EnDntNomal_StageUp = 0x809E020C; // type:func -EnDntNomal_SetupStageUnburrow = 0x809E0440; // type:func -EnDntNomal_StageUnburrow = 0x809E0534; // type:func -EnDntNomal_SetupStageCelebrate = 0x809E060C; // type:func -EnDntNomal_StageCelebrate = 0x809E06B4; // type:func -EnDntNomal_SetupStageDance = 0x809E08BC; // type:func -EnDntNomal_StageDance = 0x809E09CC; // type:func -EnDntNomal_SetupStageHide = 0x809E0B30; // type:func -EnDntNomal_StageHide = 0x809E0C0C; // type:func -EnDntNomal_StageAttackHide = 0x809E0DD0; // type:func -EnDntNomal_SetupStageAttack = 0x809E0E04; // type:func -EnDntNomal_StageAttack = 0x809E0ED0; // type:func -EnDntNomal_StageSetupReturn = 0x809E1194; // type:func -EnDntNomal_StageReturn = 0x809E1238; // type:func -EnDntNomal_Update = 0x809E133C; // type:func -EnDntNomal_OverrideLimbDraw = 0x809E1600; // type:func -EnDntNomal_PostLimbDraw = 0x809E16B0; // type:func -EnDntNomal_DrawStageScrub = 0x809E1738; // type:func -EnDntNomal_DrawTargetScrub = 0x809E1928; // type:func -EnDodojr_Init = 0x809E1E20; // type:func -EnDodojr_Destroy = 0x809E1F08; // type:func -EnDodojr_DoSwallowedBombEffects = 0x809E1F34; // type:func -EnDodojr_SpawnLargeDust = 0x809E1F78; // type:func -EnDodojr_SpawnSmallDust = 0x809E2198; // type:func -EnDodojr_UpdateBounces = 0x809E2318; // type:func -EnDodojr_SetupCrawlTowardsTarget = 0x809E23FC; // type:func -EnDodojr_SetupFlipBounce = 0x809E2484; // type:func -EnDodojr_SetupSwallowedBombDeathSequence = 0x809E2528; // type:func -EnDodojr_SetupJumpAttackBounce = 0x809E2598; // type:func -EnDodojr_SetupDespawn = 0x809E261C; // type:func -EnDodojr_SetupEatBomb = 0x809E2688; // type:func -EnDodojr_CheckNearbyBombs = 0x809E2704; // type:func -EnDodojr_TryEatBomb = 0x809E2830; // type:func -EnDodojr_UpdateCrawl = 0x809E28B4; // type:func -EnDodojr_IsPlayerWithinAttackRange = 0x809E2AC8; // type:func -EnDodojr_SetupStandardDeathBounce = 0x809E2AF8; // type:func -EnDodojr_CheckDamaged = 0x809E2B44; // type:func -EnDodojr_UpdateCollider = 0x809E2D00; // type:func -EnDodojr_WaitUnderground = 0x809E2E10; // type:func -EnDodojr_EmergeFromGround = 0x809E2F28; // type:func -EnDodojr_CrawlTowardsTarget = 0x809E2FF0; // type:func -EnDodojr_EatBomb = 0x809E30F4; // type:func -EnDodojr_SwallowBomb = 0x809E31A4; // type:func -EnDodojr_SwallowedBombDeathBounce = 0x809E3214; // type:func -EnDodojr_SwallowedBombDeathSequence = 0x809E32B4; // type:func -EnDodojr_StunnedBounce = 0x809E32D4; // type:func -EnDodojr_Stunned = 0x809E3354; // type:func -EnDodojr_JumpAttackBounce = 0x809E3404; // type:func -EnDodojr_Despawn = 0x809E346C; // type:func -EnDodojr_StandardDeathBounce = 0x809E3524; // type:func -EnDodojr_DeathSequence = 0x809E35AC; // type:func -EnDodojr_DropItem = 0x809E3658; // type:func -EnDodojr_WaitFreezeFrames = 0x809E36BC; // type:func -EnDodojr_Update = 0x809E3704; // type:func -EnDodojr_OverrideLimbDraw = 0x809E37C4; // type:func -EnDodojr_PostLimbDraw = 0x809E3870; // type:func -EnDodojr_Draw = 0x809E3888; // type:func -EnDodongo_SetupAction = 0x809E3CC0; // type:func -EnDodongo_SpawnBombSmoke = 0x809E3CCC; // type:func -EnDodongo_Init = 0x809E41BC; // type:func -EnDodongo_Destroy = 0x809E43E4; // type:func -EnDodongo_SetupIdle = 0x809E4444; // type:func -EnDodongo_SetupWalk = 0x809E44AC; // type:func -EnDodongo_SetupBreatheFire = 0x809E4550; // type:func -EnDodongo_SetupEndBreatheFire = 0x809E45A4; // type:func -EnDodongo_SetupSwallowBomb = 0x809E45F4; // type:func -EnDodongo_SetupStunned = 0x809E4674; // type:func -EnDodongo_Idle = 0x809E470C; // type:func -EnDodongo_EndBreatheFire = 0x809E4784; // type:func -EnDodongo_BreatheFire = 0x809E47D4; // type:func -EnDodongo_SwallowBomb = 0x809E49AC; // type:func -EnDodongo_Walk = 0x809E4EA4; // type:func -EnDodongo_SetupSweepTail = 0x809E51E4; // type:func -EnDodongo_SweepTail = 0x809E5244; // type:func -EnDodongo_SetupDeath = 0x809E5508; // type:func -EnDodongo_Death = 0x809E5580; // type:func -EnDodongo_Stunned = 0x809E56CC; // type:func -EnDodongo_CollisionCheck = 0x809E5730; // type:func -EnDodongo_UpdateQuad = 0x809E5858; // type:func -EnDodongo_Update = 0x809E59C4; // type:func -EnDodongo_OverrideLimbDraw = 0x809E5B90; // type:func -EnDodongo_PostLimbDraw = 0x809E5BE4; // type:func -EnDodongo_Draw = 0x809E6020; // type:func -EnDodongo_ShiftVecRadial = 0x809E6110; // type:func -EnDodongo_AteBomb = 0x809E6170; // type:func -EnDog_PlayWalkSFX = 0x809E6A60; // type:func -EnDog_PlayRunSFX = 0x809E6AC8; // type:func -EnDog_PlayBarkSFX = 0x809E6B30; // type:func -EnDog_PlayAnimAndSFX = 0x809E6B98; // type:func -EnDog_CanFollow = 0x809E6D30; // type:func -EnDog_UpdateWaypoint = 0x809E6DB4; // type:func -EnDog_Orient = 0x809E6E40; // type:func -EnDog_Init = 0x809E6EE4; // type:func -EnDog_Destroy = 0x809E7134; // type:func -EnDog_FollowPath = 0x809E7160; // type:func -EnDog_ChooseMovement = 0x809E72F8; // type:func -EnDog_FollowPlayer = 0x809E73E8; // type:func -EnDog_RunAway = 0x809E7568; // type:func -EnDog_FaceLink = 0x809E760C; // type:func -EnDog_Wait = 0x809E7714; // type:func -EnDog_Update = 0x809E776C; // type:func -EnDog_OverrideLimbDraw = 0x809E7838; // type:func -EnDog_PostLimbDraw = 0x809E7854; // type:func -EnDog_Draw = 0x809E786C; // type:func -EnDoor_Init = 0x809E7C10; // type:func -EnDoor_Destroy = 0x809E7E2C; // type:func -EnDoor_SetupType = 0x809E7E60; // type:func -EnDoor_Idle = 0x809E8018; // type:func -EnDoor_WaitForCheck = 0x809E82D0; // type:func -EnDoor_Check = 0x809E831C; // type:func -EnDoor_AjarWait = 0x809E8354; // type:func -EnDoor_AjarOpen = 0x809E8388; // type:func -EnDoor_AjarClose = 0x809E83F8; // type:func -EnDoor_Open = 0x809E8440; // type:func -EnDoor_Update = 0x809E8694; // type:func -EnDoor_OverrideLimbDraw = 0x809E86B8; // type:func -EnDoor_Draw = 0x809E87EC; // type:func -EnDs_Init = 0x809E8A50; // type:func -EnDs_Destroy = 0x809E8B20; // type:func -EnDs_Talk = 0x809E8B30; // type:func -EnDs_TalkNoEmptyBottle = 0x809E8B80; // type:func -EnDs_TalkAfterGiveOddPotion = 0x809E8BEC; // type:func -EnDs_DisplayOddPotionText = 0x809E8C48; // type:func -EnDs_GiveOddPotion = 0x809E8CA8; // type:func -EnDs_TalkAfterBrewOddPotion = 0x809E8D14; // type:func -EnDs_BrewOddPotion3 = 0x809E8D94; // type:func -EnDs_BrewOddPotion2 = 0x809E8E38; // type:func -EnDs_BrewOddPotion1 = 0x809E8E8C; // type:func -EnDs_OfferOddPotion = 0x809E8F2C; // type:func -EnDs_CheckRupeesAndBottle = 0x809E8FF8; // type:func -EnDs_GiveBluePotion = 0x809E9048; // type:func -EnDs_OfferBluePotion = 0x809E90AC; // type:func -EnDs_Wait = 0x809E91E4; // type:func -EnDs_Update = 0x809E9368; // type:func -EnDs_OverrideLimbDraw = 0x809E9470; // type:func -EnDs_PostLimbDraw = 0x809E94B8; // type:func -EnDs_Draw = 0x809E94F8; // type:func -EnDu_SetupAction = 0x809E9670; // type:func -EnDu_GetTextId = 0x809E967C; // type:func -EnDu_UpdateTalkState = 0x809E9720; // type:func -func_809FDDB4 = 0x809E97FC; // type:func -func_809FDE24 = 0x809E986C; // type:func -func_809FDE9C = 0x809E98E4; // type:func -func_809FDFC0 = 0x809E9A08; // type:func -func_809FE000 = 0x809E9A4C; // type:func -func_809FE040 = 0x809E9A90; // type:func -func_809FE104 = 0x809E9B54; // type:func -EnDu_Init = 0x809E9BFC; // type:func -EnDu_Destroy = 0x809E9DCC; // type:func -func_809FE3B4 = 0x809E9E0C; // type:func -func_809FE3C0 = 0x809E9E1C; // type:func -func_809FE4A4 = 0x809E9F04; // type:func -func_809FE638 = 0x809EA09C; // type:func -func_809FE6CC = 0x809EA134; // type:func -func_809FE740 = 0x809EA1A8; // type:func -func_809FE798 = 0x809EA200; // type:func -func_809FE890 = 0x809EA2F8; // type:func -func_809FEB08 = 0x809EA574; // type:func -func_809FEC14 = 0x809EA680; // type:func -func_809FEC70 = 0x809EA6DC; // type:func -func_809FECE4 = 0x809EA754; // type:func -EnDu_Update = 0x809EA78C; // type:func -EnDu_OverrideLimbDraw = 0x809EA918; // type:func -EnDu_PostLimbDraw = 0x809EAA94; // type:func -EnDu_Draw = 0x809EAAF0; // type:func -EnDyExtra_Destroy = 0x809EB100; // type:func -EnDyExtra_Init = 0x809EB110; // type:func -EnDyExtra_WaitForTrigger = 0x809EB184; // type:func -EnDyExtra_FallAndKill = 0x809EB218; // type:func -EnDyExtra_Update = 0x809EB2D0; // type:func -EnDyExtra_Draw = 0x809EB33C; // type:func -EnEg_PlayVoidOutSFX = 0x809EB6A0; // type:func -EnEg_Destroy = 0x809EB6C0; // type:func -EnEg_Init = 0x809EB6D0; // type:func -func_809FFDC8 = 0x809EB6E0; // type:func -EnEg_Update = 0x809EB778; // type:func -EnEg_Draw = 0x809EB7C0; // type:func -EnEiyer_Init = 0x809EB850; // type:func -EnEiyer_Destroy = 0x809EBA30; // type:func -EnEiyer_RotateAroundHome = 0x809EBA5C; // type:func -EnEiyer_SetupAppearFromGround = 0x809EBACC; // type:func -EnEiyer_SetupUnderground = 0x809EBC0C; // type:func -EnEiyer_SetupInactive = 0x809EBC6C; // type:func -EnEiyer_SetupAmbush = 0x809EBC98; // type:func -EnEiyer_SetupGlide = 0x809EBD78; // type:func -EnEiyer_SetupStartAttack = 0x809EBDF4; // type:func -EnEiyer_SetupDiveAttack = 0x809EBE08; // type:func -EnEiyer_SetupLand = 0x809EBE50; // type:func -EnEiyer_SetupHurt = 0x809EBEC8; // type:func -EnEiyer_SetupDie = 0x809EBF78; // type:func -EnEiyer_SetupDead = 0x809EC038; // type:func -EnEiyer_SetupStunned = 0x809EC064; // type:func -EnEiyer_AppearFromGround = 0x809EC128; // type:func -EnEiyer_CheckPlayerCollision = 0x809EC178; // type:func -EnEiyer_CircleUnderground = 0x809EC1A8; // type:func -EnEiyer_WanderUnderground = 0x809EC224; // type:func -EnEiyer_Inactive = 0x809EC358; // type:func -EnEiyer_Ambush = 0x809EC3EC; // type:func -EnEiyer_Glide = 0x809EC544; // type:func -EnEiyer_StartAttack = 0x809EC760; // type:func -EnEiyer_DiveAttack = 0x809EC85C; // type:func -EnEiyer_Land = 0x809EC8E8; // type:func -EnEiyer_Hurt = 0x809EC9DC; // type:func -EnEiyer_Die = 0x809ECB14; // type:func -EnEiyer_Dead = 0x809ECBC8; // type:func -EnEiyer_Stunned = 0x809ECC48; // type:func -EnEiyer_UpdateDamage = 0x809ECD00; // type:func -EnEiyer_Update = 0x809ECE48; // type:func -EnEiyer_OverrideLimbDraw = 0x809ED06C; // type:func -EnEiyer_Draw = 0x809ED0C0; // type:func -EnElf_SetupAction = 0x809ED4B0; // type:func -func_80A01C38 = 0x809ED4BC; // type:func -func_80A01F90 = 0x809ED814; // type:func -func_80A01FE0 = 0x809ED868; // type:func -func_80A020A4 = 0x809ED930; // type:func -func_80A0214C = 0x809ED9DC; // type:func -func_80A0232C = 0x809EDBBC; // type:func -EnElf_GetColorValue = 0x809EDC34; // type:func -EnElf_Init = 0x809EDCA4; // type:func -func_80A0299C = 0x809EE210; // type:func -func_80A029A8 = 0x809EE220; // type:func -EnElf_Destroy = 0x809EE248; // type:func -func_80A02A20 = 0x809EE298; // type:func -func_80A02AA4 = 0x809EE31C; // type:func -func_80A02B38 = 0x809EE3B0; // type:func -func_80A02BD8 = 0x809EE44C; // type:func -func_80A02C98 = 0x809EE50C; // type:func -func_80A02E30 = 0x809EE6A4; // type:func -func_80A02EC0 = 0x809EE730; // type:func -func_80A02F2C = 0x809EE79C; // type:func -func_80A03018 = 0x809EE888; // type:func -func_80A03148 = 0x809EE9BC; // type:func -func_80A0329C = 0x809EEB14; // type:func -func_80A0353C = 0x809EEDB8; // type:func -func_80A03604 = 0x809EEE80; // type:func -func_80A03610 = 0x809EEE90; // type:func -func_80A03814 = 0x809EF098; // type:func -func_80A03990 = 0x809EF218; // type:func -func_80A03AB0 = 0x809EF33C; // type:func -EnElf_UpdateLights = 0x809EF3A0; // type:func -func_80A03CF8 = 0x809EF574; // type:func -EnElf_ChangeColor = 0x809EFC0C; // type:func -func_80A04414 = 0x809EFC98; // type:func -func_80A0461C = 0x809EFEA4; // type:func -EnElf_SpawnSparkles = 0x809F0240; // type:func -func_80A04D90 = 0x809F0620; // type:func -func_80A04DE4 = 0x809F0674; // type:func -func_80A04F94 = 0x809F0828; // type:func -func_80A05040 = 0x809F08D8; // type:func -func_80A05114 = 0x809F09B4; // type:func -func_80A05188 = 0x809F0A30; // type:func -func_80A05208 = 0x809F0AB8; // type:func -func_80A052F4 = 0x809F0BAC; // type:func -func_80A053F0 = 0x809F0CB0; // type:func -EnElf_Update = 0x809F0F2C; // type:func -EnElf_OverrideLimbDraw = 0x809F0F88; // type:func -EnElf_Draw = 0x809F10AC; // type:func -EnElf_GetCuePos = 0x809F1724; // type:func -EnEncount1_Init = 0x809F1E70; // type:func -EnEncount1_SpawnLeevers = 0x809F1FA4; // type:func -EnEncount1_SpawnTektites = 0x809F2300; // type:func -EnEncount1_SpawnStalchildOrWolfos = 0x809F2498; // type:func -EnEncount1_Update = 0x809F28EC; // type:func -EnEncount2_Init = 0x809F29D0; // type:func -EnEncount2_Wait = 0x809F2A44; // type:func -EnEncount2_SpawnRocks = 0x809F2C9C; // type:func -EnEncount2_Update = 0x809F3264; // type:func -EnEncount2_Draw = 0x809F3630; // type:func -EnEncount2_SpawnEffect = 0x809F3650; // type:func -EnEncount2_UpdateEffects = 0x809F3704; // type:func -EnEncount2_DrawEffects = 0x809F38D8; // type:func -EnExItem_Destroy = 0x809F3C00; // type:func -EnExItem_Init = 0x809F3C10; // type:func -EnExItem_WaitForObject = 0x809F3D6C; // type:func -EnExItem_BowlPrize = 0x809F40E8; // type:func -EnExItem_SetupBowlCounter = 0x809F42D4; // type:func -EnExItem_BowlCounter = 0x809F42FC; // type:func -EnExItem_ExitChest = 0x809F4334; // type:func -EnExItem_FairyMagic = 0x809F439C; // type:func -EnExItem_TargetPrizeApproach = 0x809F43B4; // type:func -EnExItem_TargetPrizeGive = 0x809F4608; // type:func -EnExItem_TargetPrizeFinish = 0x809F4694; // type:func -EnExItem_Update = 0x809F46F4; // type:func -EnExItem_Draw = 0x809F4748; // type:func -EnExItem_DrawItems = 0x809F47F8; // type:func -EnExItem_DrawHeartPiece = 0x809F485C; // type:func -EnExItem_DrawMagic = 0x809F4890; // type:func -EnExItem_DrawKey = 0x809F48D8; // type:func -EnExItem_DrawRupee = 0x809F49C8; // type:func -EnExRuppy_Init = 0x809F4D80; // type:func -EnExRuppy_Destroy = 0x809F5158; // type:func -EnExRuppy_SpawnSparkles = 0x809F5168; // type:func -EnExRuppy_DropIntoWater = 0x809F5384; // type:func -EnExRuppy_EnterWater = 0x809F5464; // type:func -EnExRuppy_Sink = 0x809F55D0; // type:func -EnExRuppy_WaitInGame = 0x809F56D0; // type:func -EnExRuppy_Kill = 0x809F5828; // type:func -EnExRuppy_WaitToBlowUp = 0x809F586C; // type:func -EnExRuppy_WaitAsCollectible = 0x809F5998; // type:func -EnExRuppy_GalleryTarget = 0x809F5A1C; // type:func -EnExRuppy_Update = 0x809F5A7C; // type:func -EnExRuppy_Draw = 0x809F5B08; // type:func -EnFd_SpawnCore = 0x809F5E40; // type:func -EnFd_SpawnChildFire = 0x809F5F38; // type:func -EnFd_SpawnDot = 0x809F6058; // type:func -EnFd_CheckHammer = 0x809F61C4; // type:func -EnFd_ColliderCheck = 0x809F6260; // type:func -EnFd_CanSeeActor = 0x809F63F8; // type:func -EnFd_FindBomb = 0x809F6508; // type:func -EnFd_FindPotentialTheat = 0x809F65C8; // type:func -EnFd_GetPosAdjAroundCircle = 0x809F663C; // type:func -EnFd_ShouldStopRunning = 0x809F6704; // type:func -EnFd_Fade = 0x809F6838; // type:func -EnFd_Init = 0x809F6948; // type:func -EnFd_Destroy = 0x809F6A84; // type:func -EnFd_Reappear = 0x809F6AB0; // type:func -EnFd_SpinAndGrow = 0x809F6B40; // type:func -EnFd_JumpToGround = 0x809F6C14; // type:func -EnFd_Land = 0x809F6C90; // type:func -EnFd_SpinAndSpawnFire = 0x809F6D70; // type:func -EnFd_Run = 0x809F6F90; // type:func -EnFd_WaitForCore = 0x809F71F0; // type:func -EnFd_Update = 0x809F7268; // type:func -EnFd_OverrideLimbDraw = 0x809F7464; // type:func -EnFd_PostLimbDraw = 0x809F74A0; // type:func -EnFd_Draw = 0x809F77CC; // type:func -EnFd_SpawnEffect = 0x809F7B78; // type:func -EnFd_UpdateEffectsFlames = 0x809F7C68; // type:func -EnFd_UpdateEffectsDots = 0x809F7D80; // type:func -EnFd_DrawEffectsFlames = 0x809F7E9C; // type:func -EnFd_DrawEffectsDots = 0x809F8270; // type:func -EnFdFire_UpdatePos = 0x809F8AE0; // type:func -EnFdFire_CheckCollider = 0x809F8BA8; // type:func -EnFdFire_Init = 0x809F8C0C; // type:func -EnFdFire_Destroy = 0x809F8D14; // type:func -func_80A0E70C = 0x809F8D40; // type:func -EnFdFire_WaitToDie = 0x809F8E7C; // type:func -EnFdFire_DanceTowardsPlayer = 0x809F8EB8; // type:func -EnFdFire_Disappear = 0x809F9068; // type:func -EnFdFire_Update = 0x809F911C; // type:func -EnFdFire_Draw = 0x809F9218; // type:func -EnFhgFire_SetUpdate = 0x809F97F0; // type:func -EnFhgFire_Init = 0x809F97FC; // type:func -EnFhgFire_Destroy = 0x809F9C0C; // type:func -EnFhgFire_LightningStrike = 0x809F9C7C; // type:func -EnFhgFire_LightningTrail = 0x809FA014; // type:func -EnFhgFire_LightningShock = 0x809FA1B4; // type:func -EnFhgFire_LightningBurst = 0x809FA2F8; // type:func -EnFhgFire_SpearLight = 0x809FA574; // type:func -EnFhgFire_EnergyBall = 0x809FA768; // type:func -EnFhgFire_PhantomWarp = 0x809FB414; // type:func -EnFhgFire_Update = 0x809FB5D0; // type:func -EnFhgFire_Draw = 0x809FB620; // type:func -EnFireRock_Init = 0x809FBE90; // type:func -EnFireRock_Destroy = 0x809FC280; // type:func -EnFireRock_Fall = 0x809FC2E4; // type:func -EnFireRock_SpawnMoreBrokenPieces = 0x809FC638; // type:func -FireRock_WaitSpawnRocksFromCeiling = 0x809FC7B8; // type:func -FireRock_WaitOnFloor = 0x809FC8A8; // type:func -EnFireRock_Update = 0x809FC98C; // type:func -EnFireRock_Draw = 0x809FCC38; // type:func -EnFirefly_Extinguish = 0x809FCFA0; // type:func -EnFirefly_Ignite = 0x809FCFCC; // type:func -EnFirefly_Init = 0x809FD00C; // type:func -EnFirefly_Destroy = 0x809FD204; // type:func -EnFirefly_SetupFlyIdle = 0x809FD230; // type:func -EnFirefly_SetupFall = 0x809FD2DC; // type:func -EnFirefly_SetupDie = 0x809FD380; // type:func -EnFirefly_SetupRebound = 0x809FD3A4; // type:func -EnFirefly_SetupDiveAttack = 0x809FD3E0; // type:func -EnFirefly_SetupFlyAway = 0x809FD450; // type:func -EnFirefly_SetupStunned = 0x809FD480; // type:func -EnFirefly_SetupFrozenFall = 0x809FD4F0; // type:func -EnFirefly_SetupPerch = 0x809FD690; // type:func -EnFirefly_SetupDisturbDiveAttack = 0x809FD6B4; // type:func -EnFirefly_ReturnToPerch = 0x809FD6F0; // type:func -EnFirefly_SeekTorch = 0x809FD80C; // type:func -EnFirefly_FlyIdle = 0x809FD95C; // type:func -EnFirefly_Fall = 0x809FDBEC; // type:func -EnFirefly_Die = 0x809FDCBC; // type:func -EnFirefly_DiveAttack = 0x809FDD38; // type:func -EnFirefly_Rebound = 0x809FDF4C; // type:func -EnFirefly_FlyAway = 0x809FDFE0; // type:func -EnFirefly_Stunned = 0x809FE148; // type:func -EnFirefly_FrozenFall = 0x809FE1EC; // type:func -EnFirefly_Perch = 0x809FE24C; // type:func -EnFirefly_DisturbDiveAttack = 0x809FE30C; // type:func -EnFirefly_Combust = 0x809FE3E4; // type:func -EnFirefly_UpdateDamage = 0x809FE464; // type:func -EnFirefly_Update = 0x809FE614; // type:func -EnFirefly_OverrideLimbDraw = 0x809FE8BC; // type:func -EnFirefly_PostLimbDraw = 0x809FE910; // type:func -EnFirefly_Draw = 0x809FECA0; // type:func -EnFirefly_DrawInvisible = 0x809FED54; // type:func -EnFish_XZDistanceSquared = 0x809FF110; // type:func -EnFish_SetInWaterAnimation = 0x809FF140; // type:func -EnFish_SetOutOfWaterAnimation = 0x809FF1A4; // type:func -EnFish_BeginRespawn = 0x809FF208; // type:func -EnFish_SetCutsceneData = 0x809FF23C; // type:func -EnFish_ClearCutsceneData = 0x809FF2D4; // type:func -EnFish_Init = 0x809FF2FC; // type:func -EnFish_Destroy = 0x809FF440; // type:func -EnFish_SetYOffset = 0x809FF46C; // type:func -EnFish_InBottleRange = 0x809FF524; // type:func -EnFish_CheckXZDistanceToPlayer = 0x809FF614; // type:func -EnFish_Respawning_SetupSlowDown = 0x809FF644; // type:func -EnFish_Respawning_SlowDown = 0x809FF69C; // type:func -EnFish_Respawning_SetupFollowChild = 0x809FF790; // type:func -EnFish_Respawning_FollowChild = 0x809FF7E8; // type:func -EnFish_Respawning_SetupFleePlayer = 0x809FF97C; // type:func -EnFish_Respawning_FleePlayer = 0x809FF9D4; // type:func -EnFish_Respawning_SetupApproachPlayer = 0x809FFBC4; // type:func -EnFish_Respawning_ApproachPlayer = 0x809FFC1C; // type:func -EnFish_Dropped_SetupFall = 0x809FFDE0; // type:func -EnFish_Dropped_Fall = 0x809FFE40; // type:func -EnFish_Dropped_SetupFlopOnGround = 0x809FFF48; // type:func -EnFish_Dropped_FlopOnGround = 0x80A0008C; // type:func -EnFish_Dropped_SetupSwimAway = 0x80A00268; // type:func -EnFish_Dropped_SwimAway = 0x80A002DC; // type:func -EnFish_Unique_SetupSwimIdle = 0x80A004A4; // type:func -EnFish_Unique_SwimIdle = 0x80A004FC; // type:func -EnFish_Cutscene_FlopOnGround = 0x80A00724; // type:func -EnFish_Cutscene_WiggleFlyingThroughAir = 0x80A00854; // type:func -EnFish_UpdateCutscene = 0x80A008F0; // type:func -EnFish_OrdinaryUpdate = 0x80A00AB0; // type:func -EnFish_RespawningUpdate = 0x80A00C34; // type:func -EnFish_Update = 0x80A00D48; // type:func -EnFish_Draw = 0x80A00DF4; // type:func -EnFloormas_Init = 0x80A01220; // type:func -EnFloormas_Destroy = 0x80A01434; // type:func -EnFloormas_MakeInvulnerable = 0x80A01460; // type:func -EnFloormas_MakeVulnerable = 0x80A01484; // type:func -EnFloormas_SetupBigDecideAction = 0x80A014A0; // type:func -EnFloormas_SetupStand = 0x80A014E8; // type:func -EnFloormas_SetupBigWalk = 0x80A0152C; // type:func -EnFloormas_SetupBigStopWalk = 0x80A015B8; // type:func -EnFloormas_SetupRun = 0x80A01600; // type:func -EnFloormas_SetupTurn = 0x80A01630; // type:func -EnFloormas_SetupHover = 0x80A01760; // type:func -EnFloormas_SetupCharge = 0x80A01838; // type:func -EnFloormas_SetupLand = 0x80A0186C; // type:func -EnFloormas_SetupSplit = 0x80A01918; // type:func -EnFloormas_SetupSmallWalk = 0x80A01A78; // type:func -EnFloormas_SetupSmallDecideAction = 0x80A01AC8; // type:func -EnFloormas_SetupSmallShrink = 0x80A01B28; // type:func -EnFloormas_SetupSmallFollowerJumpAtLeader = 0x80A01C00; // type:func -EnFloormas_SetupJumpAtLink = 0x80A01C6C; // type:func -EnFloormas_SetupGrabLink = 0x80A01CD8; // type:func -EnFloormas_SetupMerge = 0x80A01EAC; // type:func -EnFloormas_SetupSmallWait = 0x80A01F04; // type:func -EnFloormas_SetupTakeDamage = 0x80A01F88; // type:func -EnFloormas_SetupRecover = 0x80A02044; // type:func -EnFloormas_SetupFreeze = 0x80A02098; // type:func -EnFloormas_Die = 0x80A02198; // type:func -EnFloormas_BigDecideAction = 0x80A02234; // type:func -EnFloormas_Stand = 0x80A022F8; // type:func -EnFloormas_BigWalk = 0x80A02384; // type:func -EnFloormas_BigStopWalk = 0x80A024E0; // type:func -EnFloormas_Run = 0x80A0251C; // type:func -EnFloormas_Turn = 0x80A02628; // type:func -EnFloormas_Hover = 0x80A027EC; // type:func -EnFloormas_Slide = 0x80A02870; // type:func -EnFloormas_Charge = 0x80A029B0; // type:func -EnFloormas_Land = 0x80A02AA0; // type:func -EnFloormas_Split = 0x80A02C88; // type:func -EnFloormas_SmallWalk = 0x80A02D10; // type:func -EnFloormas_SmallDecideAction = 0x80A02E00; // type:func -EnFloormas_SmallShrink = 0x80A02F68; // type:func -EnFloormas_JumpAtLink = 0x80A02FC0; // type:func -EnFloormas_GrabLink = 0x80A030FC; // type:func -EnFloormas_SmallFollowerJumpAtLeader = 0x80A03418; // type:func -EnFloormas_Merge = 0x80A03628; // type:func -EnFloormas_SmallWait = 0x80A038D8; // type:func -EnFloormas_TakeDamage = 0x80A038E8; // type:func -EnFloormas_Recover = 0x80A039AC; // type:func -EnFloormas_Freeze = 0x80A039E8; // type:func -EnFloormas_ColliderCheck = 0x80A03A5C; // type:func -EnFloormas_Update = 0x80A03C0C; // type:func -EnFloormas_OverrideLimbDraw = 0x80A03E74; // type:func -EnFloormas_PostLimbDraw = 0x80A03EB0; // type:func -EnFloormas_Draw = 0x80A03FA0; // type:func -EnFloormas_DrawHighlighted = 0x80A0406C; // type:func -EnFr_OrientUnderwater = 0x80A04600; // type:func -EnFr_Init = 0x80A04714; // type:func -EnFr_DrawIdle = 0x80A047CC; // type:func -EnFr_DrawActive = 0x80A047F4; // type:func -EnFr_Update = 0x80A04808; // type:func -EnFr_Destroy = 0x80A04B00; // type:func -EnFr_IsDivingIntoWater = 0x80A04B34; // type:func -EnFr_DivingIntoWater = 0x80A04BB8; // type:func -EnFr_IsBelowLogSpot = 0x80A04C64; // type:func -EnFr_IsAboveAndWithin30DistXZ = 0x80A04CC0; // type:func -EnFr_DecrementBlinkTimer = 0x80A04D3C; // type:func -EnFr_DecrementBlinkTimerUpdate = 0x80A04D64; // type:func -EnFr_SetupJumpingOutOfWater = 0x80A04DF4; // type:func -EnFr_JumpingOutOfWater = 0x80A04E94; // type:func -EnFr_OrientOnLogSpot = 0x80A05034; // type:func -EnFr_ChooseJumpFromLogSpot = 0x80A050F4; // type:func -EnFr_JumpingUp = 0x80A05208; // type:func -EnFr_JumpingBackIntoWater = 0x80A05348; // type:func -EnFr_SetScaleActive = 0x80A054A0; // type:func -EnFr_ButterflyPath = 0x80A055A8; // type:func -EnFr_UpdateActive = 0x80A05704; // type:func -EnFr_SetupJumpingUp = 0x80A057E8; // type:func -EnFr_Idle = 0x80A05888; // type:func -EnFr_Activate = 0x80A05968; // type:func -EnFr_ActivateCheckFrogSong = 0x80A059D0; // type:func -func_80A1BE98 = 0x80A05A74; // type:func -EnFr_ListeningToOcarinaNotes = 0x80A05AEC; // type:func -EnFr_ChildSong = 0x80A05C38; // type:func -EnFr_ChildSongFirstTime = 0x80A05D70; // type:func -EnFr_TalkBeforeFrogSong = 0x80A05DC8; // type:func -EnFr_CheckOcarinaInputFrogSong = 0x80A05E30; // type:func -EnFr_DeactivateButterfly = 0x80A05F2C; // type:func -EnFr_GetNextNoteFrogSong = 0x80A05F74; // type:func -EnFr_SetupFrogSong = 0x80A05FF0; // type:func -EnFr_IsFrogSongComplete = 0x80A06064; // type:func -EnFr_OcarinaMistake = 0x80A06114; // type:func -EnFr_ContinueFrogSong = 0x80A06170; // type:func -EnFr_SetupReward = 0x80A06314; // type:func -EnFr_PrintTextBox = 0x80A06390; // type:func -EnFr_TalkBeforeReward = 0x80A063D0; // type:func -EnFr_SetReward = 0x80A06438; // type:func -EnFr_Deactivate = 0x80A0654C; // type:func -EnFr_GiveReward = 0x80A0664C; // type:func -EnFr_SetIdle = 0x80A066AC; // type:func -EnFr_UpdateIdle = 0x80A06700; // type:func -EnFr_OverrideLimbDraw = 0x80A0672C; // type:func -EnFr_PostLimbDraw = 0x80A06758; // type:func -EnFr_Draw = 0x80A06810; // type:func -EnFu_Init = 0x80A07090; // type:func -EnFu_Destroy = 0x80A071A4; // type:func -func_80A1D94C = 0x80A071D0; // type:func -func_80A1DA04 = 0x80A0728C; // type:func -EnFu_WaitChild = 0x80A07328; // type:func -func_80A1DB60 = 0x80A073EC; // type:func -func_80A1DBA0 = 0x80A0742C; // type:func -func_80A1DBD4 = 0x80A07464; // type:func -EnFu_WaitForPlayback = 0x80A075D4; // type:func -EnFu_TeachSong = 0x80A0763C; // type:func -EnFu_WaitAdult = 0x80A076B8; // type:func -EnFu_Update = 0x80A07808; // type:func -EnFu_OverrideLimbDraw = 0x80A079B0; // type:func -EnFu_PostLimbDraw = 0x80A07B0C; // type:func -EnFu_Draw = 0x80A07B4C; // type:func -EnFw_DoBounce = 0x80A07DE0; // type:func -EnFw_PlayerInRange = 0x80A07EA8; // type:func -EnFw_GetPosAdjAroundCircle = 0x80A07FA4; // type:func -EnFw_CheckCollider = 0x80A08078; // type:func -EnFw_SpawnDust = 0x80A08138; // type:func -EnFw_Init = 0x80A08380; // type:func -EnFw_Destroy = 0x80A08488; // type:func -EnFw_Bounce = 0x80A084B4; // type:func -EnFw_Run = 0x80A08520; // type:func -EnFw_TurnToParentInitPos = 0x80A08AF4; // type:func -EnFw_JumpToParentInitPos = 0x80A08BE8; // type:func -EnFw_Update = 0x80A08C9C; // type:func -EnFw_OverrideLimbDraw = 0x80A08D7C; // type:func -EnFw_PostLimbDraw = 0x80A08D98; // type:func -EnFw_Draw = 0x80A08E34; // type:func -EnFw_SpawnEffectDust = 0x80A08EBC; // type:func -EnFw_UpdateEffects = 0x80A08F60; // type:func -EnFw_DrawEffects = 0x80A0906C; // type:func -EnFz_Init = 0x80A095A0; // type:func -EnFz_Destroy = 0x80A09720; // type:func -EnFz_UpdateTargetPos = 0x80A09770; // type:func -EnFz_ReachedTarget = 0x80A09890; // type:func -EnFz_Damaged = 0x80A098E0; // type:func -EnFz_SpawnIceSmokeHiddenState = 0x80A09AD4; // type:func -EnFz_SpawnIceSmokeGrowingState = 0x80A09AE0; // type:func -EnFz_SpawnIceSmokeActiveState = 0x80A09BC0; // type:func -EnFz_ApplyDamage = 0x80A09C84; // type:func -EnFz_SetYawTowardsPlayer = 0x80A09EEC; // type:func -EnFz_SetupDisappear = 0x80A09F2C; // type:func -EnFz_Disappear = 0x80A09F5C; // type:func -EnFz_SetupWait = 0x80A09FDC; // type:func -EnFz_Wait = 0x80A0A01C; // type:func -EnFz_SetupAppear = 0x80A0A06C; // type:func -EnFz_Appear = 0x80A0A098; // type:func -EnFz_SetupAimForMove = 0x80A0A128; // type:func -EnFz_AimForMove = 0x80A0A16C; // type:func -EnFz_SetupMoveTowardsPlayer = 0x80A0A1A8; // type:func -EnFz_MoveTowardsPlayer = 0x80A0A1DC; // type:func -EnFz_SetupAimForFreeze = 0x80A0A218; // type:func -EnFz_AimForFreeze = 0x80A0A248; // type:func -EnFz_SetupBlowSmoke = 0x80A0A284; // type:func -EnFz_BlowSmoke = 0x80A0A2BC; // type:func -EnFz_SetupDespawn = 0x80A0A4A8; // type:func -EnFz_Despawn = 0x80A0A548; // type:func -EnFz_SetupMelt = 0x80A0A578; // type:func -EnFz_Melt = 0x80A0A5BC; // type:func -EnFz_SetupBlowSmokeStationary = 0x80A0A684; // type:func -EnFz_BlowSmokeStationary = 0x80A0A6C8; // type:func -EnFz_Update = 0x80A0A8C0; // type:func -EnFz_Draw = 0x80A0AA50; // type:func -EnFz_SpawnIceSmokeNoFreeze = 0x80A0AC0C; // type:func -EnFz_SpawnIceSmokeFreeze = 0x80A0ACB0; // type:func -EnFz_UpdateIceSmoke = 0x80A0AD6C; // type:func -EnFz_DrawEffects = 0x80A0B058; // type:func -EnGSwitch_Init = 0x80A0B5B0; // type:func -EnGSwitch_Destroy = 0x80A0B848; // type:func -EnGSwitch_Break = 0x80A0B874; // type:func -EnGSwitch_WaitForObject = 0x80A0BA1C; // type:func -EnGSwitch_SilverRupeeTracker = 0x80A0BAB4; // type:func -EnGSwitch_SilverRupeeIdle = 0x80A0BB98; // type:func -EnGSwitch_SilverRupeeCollected = 0x80A0BC80; // type:func -EnGSwitch_GalleryRupee = 0x80A0BD64; // type:func -EnGSwitch_ArcheryPot = 0x80A0C104; // type:func -EnGSwitch_Kill = 0x80A0C3EC; // type:func -EnGSwitch_Update = 0x80A0C41C; // type:func -EnGSwitch_DrawPot = 0x80A0C550; // type:func -EnGSwitch_DrawRupee = 0x80A0C5E4; // type:func -EnGSwitch_SpawnEffects = 0x80A0C714; // type:func -EnGSwitch_UpdateEffects = 0x80A0C828; // type:func -EnGSwitch_DrawEffects = 0x80A0C9E8; // type:func -EnGanonMant_Init = 0x80A0CDD0; // type:func -EnGanonMant_Destroy = 0x80A0CDEC; // type:func -EnGanonMant_Tear = 0x80A0CDFC; // type:func -EnGanonMant_UpdateStrand = 0x80A0D058; // type:func -EnGanonMant_UpdateVertices = 0x80A0D61C; // type:func -EnGanonMant_Update = 0x80A0D840; // type:func -EnGanonMant_DrawCloak = 0x80A0D8FC; // type:func -EnGanonMant_Draw = 0x80A0DA18; // type:func -EnGanonOrgan_Init = 0x80A11000; // type:func -EnGanonOrgan_Destroy = 0x80A1101C; // type:func -EnGanonOrgan_Update = 0x80A1102C; // type:func -EnGanonOrgan_EmptyDList = 0x80A11070; // type:func -func_80A280BC = 0x80A11094; // type:func -func_80A28148 = 0x80A1110C; // type:func -EnGanonOrgan_Draw = 0x80A1117C; // type:func -func_80A2F180 = 0x80A18040; // type:func -EnGb_Init = 0x80A18070; // type:func -EnGb_Destroy = 0x80A18470; // type:func -func_80A2F608 = 0x80A184CC; // type:func -func_80A2F760 = 0x80A18624; // type:func -func_80A2F7C0 = 0x80A18684; // type:func -func_80A2F83C = 0x80A18700; // type:func -func_80A2F94C = 0x80A1881C; // type:func -func_80A2F9C0 = 0x80A18894; // type:func -func_80A2FA50 = 0x80A18928; // type:func -func_80A2FB40 = 0x80A18A18; // type:func -func_80A2FBB0 = 0x80A18A8C; // type:func -func_80A2FC0C = 0x80A18AEC; // type:func -func_80A2FC70 = 0x80A18B54; // type:func -EnGb_Update = 0x80A18C58; // type:func -EnGb_Draw = 0x80A18D90; // type:func -EnGb_UpdateCagedSouls = 0x80A18EB0; // type:func -EnGb_DrawCagedSouls = 0x80A19208; // type:func -EnGe1_Init = 0x80A19770; // type:func -EnGe1_Destroy = 0x80A19A34; // type:func -EnGe1_SetTalkAction = 0x80A19A60; // type:func -EnGe1_SetAnimationIdle = 0x80A19B40; // type:func -EnGe1_CheckCarpentersFreed = 0x80A19BC4; // type:func -EnGe1_KickPlayer = 0x80A19C00; // type:func -EnGe1_SpotPlayer = 0x80A19CE0; // type:func -EnGe1_WatchForPlayerFrontOnly = 0x80A19D40; // type:func -EnGe1_ChooseActionFromTextId = 0x80A19DF8; // type:func -EnGe1_SetNormalText = 0x80A19E8C; // type:func -EnGe1_WatchForAndSensePlayer = 0x80A19EBC; // type:func -EnGe1_GetReaction_ValleyFloor = 0x80A19F88; // type:func -EnGe1_WaitTillOpened_GTGGuard = 0x80A19FDC; // type:func -EnGe1_Open_GTGGuard = 0x80A1A02C; // type:func -EnGe1_SetupOpen_GTGGuard = 0x80A1A0DC; // type:func -EnGe1_RefuseEntryTooPoor_GTGGuard = 0x80A1A19C; // type:func -EnGe1_OfferOpen_GTGGuard = 0x80A1A1DC; // type:func -EnGe1_RefuseOpenNoCard_GTGGuard = 0x80A1A2CC; // type:func -EnGe1_CheckForCard_GTGGuard = 0x80A1A310; // type:func -EnGe1_WaitGateOpen_GateOp = 0x80A1A378; // type:func -EnGe1_WaitUntilGateOpened_GateOp = 0x80A1A3EC; // type:func -EnGe1_OpenGate_GateOp = 0x80A1A43C; // type:func -EnGe1_SetupOpenGate_GateOp = 0x80A1A4EC; // type:func -EnGe1_CheckGate_GateOp = 0x80A1A5B8; // type:func -EnGe1_Talk_GateGuard = 0x80A1A634; // type:func -EnGe1_GetReaction_GateGuard = 0x80A1A678; // type:func -EnGe1_SetupWait_Archery = 0x80A1A72C; // type:func -EnGe1_WaitTillItemGiven_Archery = 0x80A1A764; // type:func -EnGe1_BeginGiveItem_Archery = 0x80A1A858; // type:func -EnGe1_TalkWinPrize_Archery = 0x80A1A920; // type:func -EnGe1_TalkTooPoor_Archery = 0x80A1A980; // type:func -EnGe1_WaitDoNothing = 0x80A1A9E4; // type:func -EnGe1_BeginGame_Archery = 0x80A1A9F4; // type:func -EnGe1_TalkOfferPlay_Archery = 0x80A1AB94; // type:func -EnGe1_TalkNoPrize_Archery = 0x80A1ABF4; // type:func -EnGe1_TalkAfterGame_Archery = 0x80A1AC40; // type:func -EnGe1_TalkNoHorse_Archery = 0x80A1AD44; // type:func -EnGe1_Wait_Archery = 0x80A1AD88; // type:func -EnGe1_TurnToFacePlayer = 0x80A1AE20; // type:func -EnGe1_LookAtPlayer = 0x80A1AF38; // type:func -EnGe1_Update = 0x80A1B014; // type:func -EnGe1_CueUpAnimation = 0x80A1B15C; // type:func -EnGe1_StopFidget = 0x80A1B19C; // type:func -EnGe1_OverrideLimbDraw = 0x80A1B1F4; // type:func -EnGe1_PostLimbDraw = 0x80A1B348; // type:func -EnGe1_Draw = 0x80A1B3B4; // type:func -EnGe2_ChangeAction = 0x80A1B7A0; // type:func -EnGe2_Init = 0x80A1B848; // type:func -EnGe2_Destroy = 0x80A1BA60; // type:func -Ge2_DetectPlayerInAction = 0x80A1BA8C; // type:func -Ge2_DetectPlayerInUpdate = 0x80A1BB38; // type:func -EnGe2_CheckCarpentersFreed = 0x80A1BC68; // type:func -EnGe2_CaptureClose = 0x80A1BC94; // type:func -EnGe2_CaptureCharge = 0x80A1BD68; // type:func -EnGe2_CaptureTurn = 0x80A1BE9C; // type:func -EnGe2_KnockedOut = 0x80A1BF14; // type:func -EnGe2_TurnPlayerSpotted = 0x80A1C00C; // type:func -EnGe2_AboutTurn = 0x80A1C114; // type:func -EnGe2_Walk = 0x80A1C1CC; // type:func -EnGe2_Stand = 0x80A1C294; // type:func -EnGe2_TurnToFacePlayer = 0x80A1C2D4; // type:func -EnGe2_LookAtPlayer = 0x80A1C3EC; // type:func -EnGe2_SetActionAfterTalk = 0x80A1C500; // type:func -EnGe2_WaitLookAtPlayer = 0x80A1C5C4; // type:func -EnGe2_WaitTillCardGiven = 0x80A1C5E4; // type:func -EnGe2_GiveCard = 0x80A1C648; // type:func -EnGe2_ForceTalk = 0x80A1C6DC; // type:func -EnGe2_SetupCapturePlayer = 0x80A1C760; // type:func -EnGe2_MaintainColliderAndSetAnimState = 0x80A1C7D0; // type:func -EnGe2_MoveAndBlink = 0x80A1C878; // type:func -EnGe2_UpdateFriendly = 0x80A1C904; // type:func -EnGe2_UpdateAfterTalk = 0x80A1C9DC; // type:func -EnGe2_Update = 0x80A1CA30; // type:func -EnGe2_UpdateStunned = 0x80A1CC18; // type:func -EnGe2_OverrideLimbDraw = 0x80A1CD4C; // type:func -EnGe2_PostLimbDraw = 0x80A1CD94; // type:func -EnGe2_Draw = 0x80A1CDD4; // type:func -EnGe3_ChangeAction = 0x80A1D140; // type:func -EnGe3_Init = 0x80A1D1E8; // type:func -EnGe3_Destroy = 0x80A1D2F0; // type:func -EnGe3_TurnToFacePlayer = 0x80A1D31C; // type:func -EnGe3_LookAtPlayer = 0x80A1D434; // type:func -EnGe3_Wait = 0x80A1D548; // type:func -EnGe3_WaitLookAtPlayer = 0x80A1D5AC; // type:func -EnGe3_WaitTillCardGiven = 0x80A1D5CC; // type:func -EnGe3_GiveCard = 0x80A1D630; // type:func -EnGe3_ForceTalk = 0x80A1D6C4; // type:func -EnGe3_UpdateCollision = 0x80A1D77C; // type:func -EnGe3_MoveAndBlink = 0x80A1D824; // type:func -EnGe3_UpdateWhenNotTalking = 0x80A1D8B0; // type:func -EnGe3_Update = 0x80A1D964; // type:func -EnGe3_OverrideLimbDraw = 0x80A1D9B0; // type:func -EnGe3_PostLimbDraw = 0x80A1DB04; // type:func -EnGe3_Draw = 0x80A1DB60; // type:func -EnGeldB_SetupAction = 0x80A1DD80; // type:func -EnGeldB_Init = 0x80A1DD8C; // type:func -EnGeldB_Destroy = 0x80A1DFB0; // type:func -EnGeldB_ReactToPlayer = 0x80A1E018; // type:func -EnGeldB_SetupWait = 0x80A1E3F0; // type:func -EnGeldB_Wait = 0x80A1E484; // type:func -EnGeldB_SetupFlee = 0x80A1E608; // type:func -EnGeldB_Flee = 0x80A1E6A0; // type:func -EnGeldB_SetupReady = 0x80A1E7C8; // type:func -EnGeldB_Ready = 0x80A1E850; // type:func -EnGeldB_SetupAdvance = 0x80A1EB34; // type:func -EnGeldB_Advance = 0x80A1EBB4; // type:func -EnGeldB_SetupRollForward = 0x80A1F060; // type:func -EnGeldB_RollForward = 0x80A1F114; // type:func -EnGeldB_SetupPivot = 0x80A1F26C; // type:func -EnGeldB_Pivot = 0x80A1F2B8; // type:func -EnGeldB_SetupCircle = 0x80A1F498; // type:func -EnGeldB_Circle = 0x80A1F56C; // type:func -EnGeldB_SetupSpinDodge = 0x80A1FB48; // type:func -EnGeldB_SpinDodge = 0x80A1FCB0; // type:func -EnGeldB_SetupSlash = 0x80A20100; // type:func -EnGeldB_Slash = 0x80A20170; // type:func -EnGeldB_SetupSpinAttack = 0x80A203C0; // type:func -EnGeldB_SpinAttack = 0x80A20454; // type:func -EnGeldB_SetupRollBack = 0x80A20808; // type:func -EnGeldB_RollBack = 0x80A20884; // type:func -EnGeldB_SetupStunned = 0x80A20988; // type:func -EnGeldB_Stunned = 0x80A20A34; // type:func -EnGeldB_SetupDamaged = 0x80A20AF0; // type:func -EnGeldB_Damaged = 0x80A20B88; // type:func -EnGeldB_SetupJump = 0x80A20D30; // type:func -EnGeldB_Jump = 0x80A20DE8; // type:func -EnGeldB_SetupBlock = 0x80A20ED0; // type:func -EnGeldB_Block = 0x80A20F88; // type:func -EnGeldB_SetupSidestep = 0x80A21274; // type:func -EnGeldB_Sidestep = 0x80A21404; // type:func -EnGeldB_SetupDefeated = 0x80A21B24; // type:func -EnGeldB_Defeated = 0x80A21BC8; // type:func -EnGeldB_TurnHead = 0x80A21C84; // type:func -EnGeldB_CollisionCheck = 0x80A21D84; // type:func -EnGeldB_Update = 0x80A21F50; // type:func -EnGeldB_OverrideLimbDraw = 0x80A2213C; // type:func -EnGeldB_PostLimbDraw = 0x80A22284; // type:func -EnGeldB_Draw = 0x80A224FC; // type:func -EnGeldB_DodgeRanged = 0x80A2286C; // type:func -EnGirlA_SetupAction = 0x80A23130; // type:func -EnGirlA_TryChangeShopItem = 0x80A2313C; // type:func -EnGirlA_InitItem = 0x80A232B4; // type:func -EnGirlA_Init = 0x80A23358; // type:func -EnGirlA_Destroy = 0x80A2338C; // type:func -EnGirlA_CanBuy_Arrows = 0x80A233BC; // type:func -EnGirlA_CanBuy_Bombs = 0x80A2346C; // type:func -EnGirlA_CanBuy_DekuNuts = 0x80A2350C; // type:func -EnGirlA_CanBuy_DekuSticks = 0x80A235C4; // type:func -EnGirlA_CanBuy_Fish = 0x80A2367C; // type:func -EnGirlA_CanBuy_RedPotion = 0x80A236F4; // type:func -EnGirlA_CanBuy_GreenPotion = 0x80A2376C; // type:func -EnGirlA_CanBuy_BluePotion = 0x80A237E4; // type:func -EnGirlA_CanBuy_Longsword = 0x80A2385C; // type:func -EnGirlA_CanBuy_HylianShield = 0x80A238F0; // type:func -EnGirlA_CanBuy_DekuShield = 0x80A23970; // type:func -EnGirlA_CanBuy_GoronTunic = 0x80A239F0; // type:func -EnGirlA_CanBuy_ZoraTunic = 0x80A23A98; // type:func -EnGirlA_CanBuy_RecoveryHeart = 0x80A23B40; // type:func -EnGirlA_CanBuy_MilkBottle = 0x80A23B8C; // type:func -EnGirlA_CanBuy_WeirdEgg = 0x80A23BE8; // type:func -EnGirlA_CanBuy_Unk19 = 0x80A23C44; // type:func -EnGirlA_CanBuy_Unk20 = 0x80A23C58; // type:func -EnGirlA_CanBuy_Bombchus = 0x80A23C6C; // type:func -EnGirlA_CanBuy_DekuSeeds = 0x80A23CF0; // type:func -EnGirlA_CanBuy_SoldOut = 0x80A23DA0; // type:func -EnGirlA_CanBuy_BlueFire = 0x80A23DB4; // type:func -EnGirlA_CanBuy_Bugs = 0x80A23E2C; // type:func -EnGirlA_CanBuy_Poe = 0x80A23EA4; // type:func -EnGirlA_CanBuy_Fairy = 0x80A23F1C; // type:func -EnGirlA_ItemGive_Arrows = 0x80A23F94; // type:func -EnGirlA_ItemGive_Bombs = 0x80A23FDC; // type:func -EnGirlA_ItemGive_DekuNuts = 0x80A2407C; // type:func -EnGirlA_ItemGive_DekuSticks = 0x80A240EC; // type:func -EnGirlA_ItemGive_Longsword = 0x80A24128; // type:func -EnGirlA_ItemGive_HylianShield = 0x80A24170; // type:func -EnGirlA_ItemGive_DekuShield = 0x80A241AC; // type:func -EnGirlA_ItemGive_GoronTunic = 0x80A241E8; // type:func -EnGirlA_ItemGive_ZoraTunic = 0x80A24224; // type:func -EnGirlA_ItemGive_Health = 0x80A24260; // type:func -EnGirlA_ItemGive_MilkBottle = 0x80A242A0; // type:func -EnGirlA_ItemGive_WeirdEgg = 0x80A242DC; // type:func -EnGirlA_ItemGive_Unk19 = 0x80A24318; // type:func -EnGirlA_ItemGive_Unk20 = 0x80A24348; // type:func -EnGirlA_ItemGive_DekuSeeds = 0x80A24378; // type:func -EnGirlA_ItemGive_BottledItem = 0x80A243B4; // type:func -EnGirlA_BuyEvent_ShieldDiscount = 0x80A244E4; // type:func -EnGirlA_BuyEvent_GoronTunic = 0x80A24584; // type:func -EnGirlA_BuyEvent_ZoraTunic = 0x80A245B4; // type:func -EnGirlA_BuyEvent_ObtainBombchuPack = 0x80A245E4; // type:func -EnGirlA_Noop = 0x80A246F8; // type:func -EnGirlA_SetItemDescription = 0x80A24708; // type:func -EnGirlA_SetItemOutOfStock = 0x80A24830; // type:func -EnGirlA_UpdateStockedItem = 0x80A24864; // type:func -EnGirlA_TrySetMaskItemDescription = 0x80A248DC; // type:func -EnGirlA_WaitForObject = 0x80A2496C; // type:func -EnGirlA_Update2 = 0x80A24D1C; // type:func -EnGirlA_Update = 0x80A24DD8; // type:func -func_80A3C498 = 0x80A24DFC; // type:func -EnGirlA_Draw = 0x80A24E40; // type:func -EnGm_Init = 0x80A25A50; // type:func -EnGm_Destroy = 0x80A25AB0; // type:func -func_80A3D7C8 = 0x80A25ADC; // type:func -func_80A3D838 = 0x80A25B4C; // type:func -EnGm_UpdateEye = 0x80A25CEC; // type:func -EnGm_SetTextID = 0x80A25D64; // type:func -func_80A3DB04 = 0x80A25E18; // type:func -func_80A3DBF4 = 0x80A25F08; // type:func -func_80A3DC44 = 0x80A25F5C; // type:func -func_80A3DD7C = 0x80A26098; // type:func -EnGm_ProcessChoiceIndex = 0x80A26130; // type:func -func_80A3DF00 = 0x80A26220; // type:func -func_80A3DF60 = 0x80A26284; // type:func -func_80A3DFBC = 0x80A262E4; // type:func -EnGm_Update = 0x80A26398; // type:func -func_80A3E090 = 0x80A263BC; // type:func -EnGm_Draw = 0x80A2651C; // type:func -EnGo_SetupAction = 0x80A26780; // type:func -EnGo_GetTextID = 0x80A2678C; // type:func -EnGo_UpdateTalkState = 0x80A26B1C; // type:func -EnGo_UpdateTalking = 0x80A26F3C; // type:func -EnGo_ChangeAnim = 0x80A26FFC; // type:func -EnGo_IsActorSpawned = 0x80A270AC; // type:func -EnGo_GetPlayerTrackingYOffset = 0x80A2720C; // type:func -func_80A3F060 = 0x80A27284; // type:func -func_80A3F0E4 = 0x80A27308; // type:func -EnGo_IsCameraModified = 0x80A27380; // type:func -EnGo_ReverseAnimation = 0x80A27484; // type:func -EnGo_UpdateShadow = 0x80A2749C; // type:func -EnGo_FollowPath = 0x80A27528; // type:func -EnGo_SetMovedPos = 0x80A276E4; // type:func -EnGo_SpawnDust = 0x80A277BC; // type:func -EnGo_IsRollingOnGround = 0x80A279E8; // type:func -func_80A3F908 = 0x80A27B34; // type:func -EnGo_Init = 0x80A27D64; // type:func -EnGo_Destroy = 0x80A280B4; // type:func -func_80A3FEB4 = 0x80A280F4; // type:func -EnGo_StopRolling = 0x80A28138; // type:func -func_80A4008C = 0x80A282CC; // type:func -EnGo_GoronLinkRolling = 0x80A2835C; // type:func -EnGo_FireGenericActionFunc = 0x80A28454; // type:func -EnGo_CurledUp = 0x80A28464; // type:func -EnGo_WakeUp = 0x80A28564; // type:func -func_80A40494 = 0x80A286E0; // type:func -func_80A405CC = 0x80A28818; // type:func -EnGo_BiggoronActionFunc = 0x80A2892C; // type:func -func_80A408D8 = 0x80A28B24; // type:func -func_80A40A54 = 0x80A28CA0; // type:func -func_80A40B1C = 0x80A28D68; // type:func -EnGo_GetItem = 0x80A28DC0; // type:func -func_80A40C78 = 0x80A28EC8; // type:func -EnGo_Eyedrops = 0x80A28FB0; // type:func -func_80A40DCC = 0x80A29020; // type:func -EnGo_Update = 0x80A290A4; // type:func -EnGo_DrawCurledUp = 0x80A291B4; // type:func -EnGo_DrawRolling = 0x80A29280; // type:func -EnGo_OverrideLimbDraw = 0x80A293AC; // type:func -EnGo_PostLimbDraw = 0x80A295C8; // type:func -EnGo_Draw = 0x80A29624; // type:func -EnGo_SpawnEffectDust = 0x80A297C4; // type:func -EnGo_UpdateEffects = 0x80A29868; // type:func -EnGo_DrawEffects = 0x80A29974; // type:func -EnGo2_SpawnEffectDust = 0x80A2ADC0; // type:func -EnGo2_UpdateEffects = 0x80A2AE64; // type:func -EnGo2_DrawEffects = 0x80A2AF70; // type:func -EnGo2_SpawnDust = 0x80A2B268; // type:func -EnGo2_GetItem = 0x80A2B480; // type:func -EnGo2_GetDialogState = 0x80A2B4C4; // type:func -EnGo2_GoronFireGenericGetTextId = 0x80A2B544; // type:func -EnGo2_GetTextIdGoronCityRollingBig = 0x80A2B5C0; // type:func -EnGo2_UpdateTalkStateGoronCityRollingBig = 0x80A2B648; // type:func -EnGo2_GetTextIdGoronDmtBombFlower = 0x80A2B740; // type:func -EnGo2_UpdateTalkStateGoronDmtBombFlower = 0x80A2B77C; // type:func -EnGo2_GetTextIdGoronDmtRollingSmall = 0x80A2B894; // type:func -EnGo2_UpdateTalkStateGoronDmtRollingSmall = 0x80A2B8EC; // type:func -EnGo2_GetTextIdGoronDmtDcEntrance = 0x80A2B928; // type:func -EnGo2_UpdateTalkStateGoronDmtDcEntrance = 0x80A2B9C4; // type:func -EnGo2_GetTextIdGoronCityEntrance = 0x80A2BA24; // type:func -EnGo2_UpdateTalkStateGoronCityEntrance = 0x80A2BAA4; // type:func -EnGo2_GetTextIdGoronCityIsland = 0x80A2BB04; // type:func -EnGo2_UpdateTalkStateGoronCityIsland = 0x80A2BB84; // type:func -EnGo2_GetTextIdGoronCityLowestFloor = 0x80A2BBE4; // type:func -EnGo2_UpdateTalkStateGoronCityLowestFloor = 0x80A2BCC0; // type:func -EnGo2_GetTextIdGoronCityLink = 0x80A2BD20; // type:func -EnGo2_UpdateTalkStateGoronCityLink = 0x80A2BDFC; // type:func -EnGo2_GetTextIdGoronDmtBiggoron = 0x80A2C014; // type:func -EnGo2_UpdateTalkStateGoronDmtBiggoron = 0x80A2C094; // type:func -EnGo2_GetTextIdGoronFireGeneric = 0x80A2C2A8; // type:func -EnGo2_UpdateTalkStateGoronFireGeneric = 0x80A2C2E0; // type:func -EnGo2_GetTextIdGoronCityStairwell = 0x80A2C37C; // type:func -EnGo2_UpdateTalkStateGoronCityStairwell = 0x80A2C3CC; // type:func -EnGo2_GetTextIdGoronMarketBazaar = 0x80A2C42C; // type:func -EnGo2_UpdateTalkStateGoronMarketBazaar = 0x80A2C440; // type:func -EnGo2_GetTextIdGoronCityLostWoods = 0x80A2C47C; // type:func -EnGo2_UpdateTalkStateGoronCityLostWoods = 0x80A2C4EC; // type:func -EnGo2_GetTextIdGoronDmtFairyHint = 0x80A2C54C; // type:func -EnGo2_UpdateTalkStateGoronDmtFairyHint = 0x80A2C5A4; // type:func -EnGo2_GetTextId = 0x80A2C5E0; // type:func -EnGo2_UpdateTalkState = 0x80A2C724; // type:func -func_80A44790 = 0x80A2C83C; // type:func -EnGo2_SetColliderDim = 0x80A2C938; // type:func -EnGo2_SetShape = 0x80A2C974; // type:func -EnGo2_CheckCollision = 0x80A2C9EC; // type:func -EnGo2_SwapInitialFrameAnimFrameCount = 0x80A2CB48; // type:func -func_80A44AB0 = 0x80A2CB60; // type:func -EnGo2_UpdateWaypoint = 0x80A2CD1C; // type:func -EnGo2_Orient = 0x80A2CD98; // type:func -func_80A44D84 = 0x80A2CE3C; // type:func -EnGo2_IsWakingUp = 0x80A2CE74; // type:func -EnGo2_IsRollingOnGround = 0x80A2CFA4; // type:func -EnGo2_BiggoronSetTextId = 0x80A2D140; // type:func -func_80A45288 = 0x80A2D340; // type:func -func_80A45360 = 0x80A2D41C; // type:func -EnGo2_RollForward = 0x80A2D528; // type:func -func_80A454CC = 0x80A2D588; // type:func -EnGo2_GetTargetXZSpeed = 0x80A2D634; // type:func -EnGo2_IsCameraModified = 0x80A2D6D8; // type:func -EnGo2_DefaultWakingUp = 0x80A2D7F4; // type:func -EnGo2_WakingUp = 0x80A2D84C; // type:func -EnGo2_BiggoronWakingUp = 0x80A2D8BC; // type:func -EnGo2_SelectGoronWakingUp = 0x80A2D90C; // type:func -EnGo2_EyeMouthTexState = 0x80A2D9F0; // type:func -EnGo2_SitDownAnimation = 0x80A2DAC4; // type:func -EnGo2_GetDustData = 0x80A2DBDC; // type:func -EnGo2_RollingAnimation = 0x80A2DC64; // type:func -EnGo2_WakeUp = 0x80A2DD18; // type:func -EnGo2_GetItemAnimation = 0x80A2DE0C; // type:func -EnGo2_SetupRolling = 0x80A2DE70; // type:func -EnGo2_StopRolling = 0x80A2DF18; // type:func -EnGo2_IsFreeingGoronInFire = 0x80A2DFD8; // type:func -EnGo2_IsGoronDmtBombFlower = 0x80A2E070; // type:func -EnGo2_IsGoronRollingBig = 0x80A2E0F0; // type:func -EnGo2_IsGoronFireGeneric = 0x80A2E150; // type:func -EnGo2_IsGoronLinkReversing = 0x80A2E18C; // type:func -EnGo2_IsRolling = 0x80A2E1E8; // type:func -EnGo2_GoronLinkAnimation = 0x80A2E27C; // type:func -EnGo2_GoronFireCamera = 0x80A2E3B0; // type:func -EnGo2_GoronFireClearCamera = 0x80A2E4B0; // type:func -EnGo2_BiggoronAnimation = 0x80A2E4F0; // type:func -EnGo2_Init = 0x80A2E5A4; // type:func -EnGo2_Destroy = 0x80A2EA38; // type:func -EnGo2_CurledUp = 0x80A2EA48; // type:func -func_80A46B40 = 0x80A2EC1C; // type:func -EnGo2_GoronDmtBombFlowerAnimation = 0x80A2EDB4; // type:func -EnGo2_GoronRollingBigContinueRolling = 0x80A2EE38; // type:func -EnGo2_ContinueRolling = 0x80A2EE98; // type:func -EnGo2_SlowRolling = 0x80A2EF30; // type:func -EnGo2_GroundRolling = 0x80A2F068; // type:func -EnGo2_ReverseRolling = 0x80A2F104; // type:func -EnGo2_SetupGetItem = 0x80A2F1CC; // type:func -EnGo2_SetGetItem = 0x80A2F240; // type:func -EnGo2_BiggoronEyedrops = 0x80A2F348; // type:func -EnGo2_GoronLinkStopRolling = 0x80A2F57C; // type:func -EnGo2_GoronFireGenericAction = 0x80A2F66C; // type:func -EnGo2_Update = 0x80A2F998; // type:func -EnGo2_DrawCurledUp = 0x80A2FAAC; // type:func -EnGo2_DrawRolling = 0x80A2FB70; // type:func -EnGo2_OverrideLimbDraw = 0x80A2FCAC; // type:func -EnGo2_PostLimbDraw = 0x80A2FEC8; // type:func -EnGo2_Draw = 0x80A2FF24; // type:func -EnGoma_Init = 0x80A30E00; // type:func -EnGoma_Destroy = 0x80A3118C; // type:func -EnGoma_SetupFlee = 0x80A311DC; // type:func -EnGoma_Flee = 0x80A31280; // type:func -EnGoma_EggFallToGround = 0x80A31320; // type:func -EnGoma_Egg = 0x80A315AC; // type:func -EnGoma_SetupHatch = 0x80A317EC; // type:func -EnGoma_Hatch = 0x80A318B4; // type:func -EnGoma_SetupHurt = 0x80A318FC; // type:func -EnGoma_Hurt = 0x80A319E8; // type:func -EnGoma_SetupDie = 0x80A31A70; // type:func -EnGoma_Die = 0x80A31B30; // type:func -EnGoma_SetupDead = 0x80A31BD4; // type:func -EnGoma_Dead = 0x80A31C4C; // type:func -EnGoma_SetupStand = 0x80A31DBC; // type:func -EnGoma_SetupChasePlayer = 0x80A31E48; // type:func -EnGoma_SetupPrepareJump = 0x80A31EC8; // type:func -EnGoma_PrepareJump = 0x80A31F44; // type:func -EnGoma_SetupLand = 0x80A31FDC; // type:func -EnGoma_Land = 0x80A32054; // type:func -EnGoma_SetupJump = 0x80A320C0; // type:func -EnGoma_Jump = 0x80A32168; // type:func -EnGoma_Stand = 0x80A32220; // type:func -EnGoma_ChasePlayer = 0x80A3229C; // type:func -EnGoma_SetupStunned = 0x80A323A4; // type:func -EnGoma_Stunned = 0x80A32440; // type:func -EnGoma_LookAtPlayer = 0x80A32540; // type:func -EnGoma_UpdateHit = 0x80A325EC; // type:func -EnGoma_UpdateEyeEnvColor = 0x80A3281C; // type:func -EnGoma_SetFloorRot = 0x80A328AC; // type:func -EnGoma_Update = 0x80A329C0; // type:func -EnGoma_OverrideLimbDraw = 0x80A32C0C; // type:func -EnGoma_NoBackfaceCullingDlist = 0x80A32D68; // type:func -EnGoma_Draw = 0x80A32DD4; // type:func -EnGoma_Debris = 0x80A33260; // type:func -EnGoma_SpawnHatchDebris = 0x80A332A4; // type:func -EnGoma_BossLimb = 0x80A33408; // type:func -EnGoroiwa_UpdateCollider = 0x80A33AB0; // type:func -EnGoroiwa_InitCollider = 0x80A33B1C; // type:func -EnGoroiwa_UpdateFlags = 0x80A33B84; // type:func -EnGoroiwa_Vec3fNormalize = 0x80A33BA8; // type:func -EnGoroiwa_SetSpeed = 0x80A33C2C; // type:func -EnGoroiwa_FaceNextWaypoint = 0x80A33C54; // type:func -EnGoroiwa_GetPrevWaypointDiff = 0x80A33D2C; // type:func -EnGoroiw_CheckEndOfPath = 0x80A33E88; // type:func -EnGoroiwa_SetNextWaypoint = 0x80A33F3C; // type:func -EnGoroiwa_ReverseDirection = 0x80A33F6C; // type:func -EnGoroiwa_InitPath = 0x80A33F94; // type:func -EnGoroiwa_TeleportToWaypoint = 0x80A33FD4; // type:func -EnGoroiwa_InitRotation = 0x80A34078; // type:func -EnGoroiwa_GetAscendDirection = 0x80A34094; // type:func -EnGoroiwa_SpawnDust = 0x80A34158; // type:func -EnGoroiwa_SpawnWaterEffects = 0x80A34348; // type:func -EnGoroiwa_MoveAndFall = 0x80A3447C; // type:func -EnGoroiwa_Move = 0x80A345B0; // type:func -EnGoroiwa_MoveUpToNextWaypoint = 0x80A347DC; // type:func -EnGoroiwa_MoveDownToNextWaypoint = 0x80A348FC; // type:func -EnGoroiwa_UpdateRotation = 0x80A34C5C; // type:func -EnGoroiwa_NextWaypoint = 0x80A34DFC; // type:func -EnGoroiwa_SpawnFragments = 0x80A34E84; // type:func -EnGoroiwa_Init = 0x80A351A0; // type:func -EnGoroiwa_Destroy = 0x80A352D0; // type:func -EnGoroiwa_SetupRoll = 0x80A352FC; // type:func -EnGoroiwa_Roll = 0x80A3533C; // type:func -EnGoroiwa_SetupMoveAndFallToGround = 0x80A355C0; // type:func -EnGoroiwa_MoveAndFallToGround = 0x80A35634; // type:func -EnGoroiwa_SetupWait = 0x80A356D4; // type:func -EnGoroiwa_Wait = 0x80A35730; // type:func -EnGoroiwa_SetupMoveUp = 0x80A35770; // type:func -EnGoroiwa_MoveUp = 0x80A357C0; // type:func -EnGoroiwa_SetupMoveDown = 0x80A35880; // type:func -EnGoroiwa_MoveDown = 0x80A358EC; // type:func -EnGoroiwa_Update = 0x80A359B4; // type:func -EnGoroiwa_Draw = 0x80A35B14; // type:func -EnGs_Init = 0x80A35E70; // type:func -EnGs_Destroy = 0x80A35F34; // type:func -func_80A4E3EC = 0x80A35F44; // type:func -func_80A4E470 = 0x80A35FCC; // type:func -func_80A4E648 = 0x80A3618C; // type:func -func_80A4E754 = 0x80A3629C; // type:func -func_80A4E910 = 0x80A3645C; // type:func -func_80A4EA08 = 0x80A36558; // type:func -func_80A4EB3C = 0x80A3668C; // type:func -func_80A4ED34 = 0x80A36884; // type:func -func_80A4F13C = 0x80A36C90; // type:func -func_80A4F700 = 0x80A37254; // type:func -func_80A4F734 = 0x80A37288; // type:func -func_80A4F77C = 0x80A372D0; // type:func -EnGs_Update = 0x80A3734C; // type:func -EnGs_Draw = 0x80A374E4; // type:func -EnGuest_Init = 0x80A37CE0; // type:func -EnGuest_Destroy = 0x80A37D40; // type:func -EnGuest_Update = 0x80A37D6C; // type:func -func_80A5046C = 0x80A37EDC; // type:func -func_80A50518 = 0x80A37F88; // type:func -func_80A5057C = 0x80A37FF0; // type:func -func_80A505CC = 0x80A38044; // type:func -func_80A50708 = 0x80A38184; // type:func -EnGuest_OverrideLimbDraw = 0x80A381F0; // type:func -EnGuest_Draw = 0x80A38418; // type:func -EnHata_Init = 0x80A38680; // type:func -EnHata_Destroy = 0x80A387B8; // type:func -EnHata_Update = 0x80A38800; // type:func -EnHata_OverrideLimbDraw = 0x80A38A1C; // type:func -EnHata_PostLimbDraw = 0x80A38AA0; // type:func -EnHata_Draw = 0x80A38AB8; // type:func -EnHeishi1_Init = 0x80A38C10; // type:func -EnHeishi1_Destroy = 0x80A38E28; // type:func -EnHeishi1_SetupWalk = 0x80A38E38; // type:func -EnHeishi1_Walk = 0x80A38EEC; // type:func -EnHeishi1_SetupMoveToLink = 0x80A3920C; // type:func -EnHeishi1_MoveToLink = 0x80A392C8; // type:func -EnHeishi1_SetupWait = 0x80A393C0; // type:func -EnHeishi1_Wait = 0x80A39488; // type:func -EnHeishi1_SetupTurnTowardLink = 0x80A39644; // type:func -EnHeishi1_TurnTowardLink = 0x80A396E0; // type:func -EnHeishi1_SetupKick = 0x80A3978C; // type:func -EnHeishi1_Kick = 0x80A39820; // type:func -EnHeishi1_SetupWaitNight = 0x80A398F4; // type:func -EnHeishi1_WaitNight = 0x80A39988; // type:func -EnHeishi1_Update = 0x80A39A08; // type:func -EnHeishi1_OverrideLimbDraw = 0x80A39D1C; // type:func -EnHeishi1_Draw = 0x80A39D60; // type:func -EnHeishi2_Init = 0x80A3A120; // type:func -EnHeishi2_Destroy = 0x80A3A3A0; // type:func -EnHeishi2_DoNothing1 = 0x80A3A3E4; // type:func -EnHeishi_DoNothing2 = 0x80A3A3F4; // type:func -func_80A531E4 = 0x80A3A404; // type:func -func_80A53278 = 0x80A3A498; // type:func -func_80A5344C = 0x80A3A618; // type:func -func_80A53538 = 0x80A3A704; // type:func -func_80A535BC = 0x80A3A78C; // type:func -func_80A53638 = 0x80A3A808; // type:func -func_80A5372C = 0x80A3A8F4; // type:func -func_80A53850 = 0x80A3AA18; // type:func -func_80A53908 = 0x80A3AAD0; // type:func -func_80A5399C = 0x80A3AB64; // type:func -func_80A53AD4 = 0x80A3AC88; // type:func -func_80A53C0C = 0x80A3ADC4; // type:func -func_80A53C90 = 0x80A3AE4C; // type:func -func_80A53D0C = 0x80A3AEC8; // type:func -func_80A53DF8 = 0x80A3AFAC; // type:func -func_80A53F30 = 0x80A3B0E4; // type:func -func_80A54038 = 0x80A3B1EC; // type:func -func_80A540C0 = 0x80A3B278; // type:func -func_80A541FC = 0x80A3B3B4; // type:func -func_80A5427C = 0x80A3B438; // type:func -func_80A54320 = 0x80A3B4DC; // type:func -func_80A543A0 = 0x80A3B55C; // type:func -func_80A544AC = 0x80A3B668; // type:func -func_80A5455C = 0x80A3B718; // type:func -func_80A546DC = 0x80A3B88C; // type:func -func_80A5475C = 0x80A3B90C; // type:func -func_80A54954 = 0x80A3BB04; // type:func -func_80A549E8 = 0x80A3BB98; // type:func -EnHeishi2_Update = 0x80A3BC28; // type:func -EnHeishi2_OverrideLimbDraw = 0x80A3BD74; // type:func -EnHeishi2_PostLimbDraw = 0x80A3BDEC; // type:func -EnHeishi2_DrawKingGuard = 0x80A3BE24; // type:func -EnHeishi2_Draw = 0x80A3BE98; // type:func -EnHeishi3_Init = 0x80A3C320; // type:func -EnHeishi3_Destroy = 0x80A3C44C; // type:func -EnHeishi3_SetupGuardType = 0x80A3C478; // type:func -EnHeishi3_StandSentinelInGrounds = 0x80A3C528; // type:func -EnHeishi3_StandSentinelInCastle = 0x80A3C684; // type:func -EnHeishi3_CatchStart = 0x80A3C7F4; // type:func -func_80A55BD4 = 0x80A3C89C; // type:func -EnHeishi3_ResetAnimationToIdle = 0x80A3C934; // type:func -func_80A55D00 = 0x80A3C9C8; // type:func -EnHeishi3_Update = 0x80A3CA78; // type:func -EnHeishi3_OverrideLimbDraw = 0x80A3CB58; // type:func -EnHeishi3_Draw = 0x80A3CBC0; // type:func -EnHeishi4_Init = 0x80A3CCF0; // type:func -EnHeishi4_Destroy = 0x80A3CED0; // type:func -func_80A56328 = 0x80A3CEFC; // type:func -func_80A563BC = 0x80A3CF90; // type:func -func_80A56544 = 0x80A3D118; // type:func -func_80A56614 = 0x80A3D1DC; // type:func -func_80A5673C = 0x80A3D304; // type:func -func_80A56874 = 0x80A3D418; // type:func -func_80A56900 = 0x80A3D4A4; // type:func -func_80A56994 = 0x80A3D538; // type:func -func_80A56A50 = 0x80A3D5F4; // type:func -func_80A56ACC = 0x80A3D670; // type:func -func_80A56B40 = 0x80A3D6E4; // type:func -EnHeishi4_Update = 0x80A3D858; // type:func -EnHeishi_OverrideLimbDraw = 0x80A3D9BC; // type:func -EnHeishi4_Draw = 0x80A3DA24; // type:func -EnHintnuts_Init = 0x80A3DBF0; // type:func -EnHintnuts_Destroy = 0x80A3DD90; // type:func -EnHintnuts_HitByScrubProjectile1 = 0x80A3DDCC; // type:func -EnHintnuts_SetupWait = 0x80A3DE50; // type:func -EnHintnuts_SetupLookAround = 0x80A3DED0; // type:func -EnHintnuts_SetupThrowScrubProjectile = 0x80A3DF18; // type:func -EnHintnuts_SetupStand = 0x80A3DF58; // type:func -EnHintnuts_SetupBurrow = 0x80A3DFC0; // type:func -EnHintnuts_HitByScrubProjectile2 = 0x80A3E010; // type:func -EnHintnuts_SetupRun = 0x80A3E100; // type:func -EnHintnuts_SetupTalk = 0x80A3E148; // type:func -EnHintnuts_SetupLeave = 0x80A3E194; // type:func -EnHintnuts_SetupFreeze = 0x80A3E254; // type:func -EnHintnuts_Wait = 0x80A3E300; // type:func -EnHintnuts_LookAround = 0x80A3E564; // type:func -EnHintnuts_Stand = 0x80A3E5E8; // type:func -EnHintnuts_ThrowNut = 0x80A3E6AC; // type:func -EnHintnuts_Burrow = 0x80A3E7E8; // type:func -EnHintnuts_BeginRun = 0x80A3E8FC; // type:func -EnHintnuts_BeginFreeze = 0x80A3E960; // type:func -EnHintnuts_CheckProximity = 0x80A3E99C; // type:func -EnHintnuts_Run = 0x80A3EA30; // type:func -EnHintnuts_Talk = 0x80A3ECC0; // type:func -EnHintnuts_Leave = 0x80A3ED2C; // type:func -EnHintnuts_Freeze = 0x80A3EEE8; // type:func -EnHintnuts_ColliderCheck = 0x80A3F014; // type:func -EnHintnuts_Update = 0x80A3F0C8; // type:func -EnHintnuts_OverrideLimbDraw = 0x80A3F250; // type:func -EnHintnuts_Draw = 0x80A3F384; // type:func -EnHoll_SetupAction = 0x80A3F620; // type:func -EnHoll_IsKokiriLayer8 = 0x80A3F62C; // type:func -EnHoll_ChooseAction = 0x80A3F65C; // type:func -EnHoll_Init = 0x80A3F6C4; // type:func -EnHoll_Destroy = 0x80A3F700; // type:func -EnHoll_SwapRooms = 0x80A3F730; // type:func -EnHoll_HorizontalVisibleNarrow = 0x80A3F7EC; // type:func -EnHoll_HorizontalInvisible = 0x80A3FA2C; // type:func -EnHoll_VerticalDownBgCoverLarge = 0x80A3FBDC; // type:func -EnHoll_VerticalBgCover = 0x80A3FDC8; // type:func -EnHoll_VerticalInvisible = 0x80A3FF48; // type:func -EnHoll_HorizontalBgCoverSwitchFlag = 0x80A40040; // type:func -EnHoll_WaitRoomLoaded = 0x80A40250; // type:func -EnHoll_Update = 0x80A402C8; // type:func -EnHoll_Draw = 0x80A402EC; // type:func -EnHonotrap_FlameCollisionCheck = 0x80A405F0; // type:func -EnHonotrap_GetNormal = 0x80A40684; // type:func -EnHonotrap_InitEye = 0x80A40718; // type:func -EnHonotrap_InitFlame = 0x80A408B4; // type:func -EnHonotrap_Init = 0x80A409F4; // type:func -EnHonotrap_Destroy = 0x80A40A4C; // type:func -EnHonotrap_SetupEyeIdle = 0x80A40A98; // type:func -EnHonotrap_EyeIdle = 0x80A40AB4; // type:func -EnHonotrap_SetupEyeOpen = 0x80A40B6C; // type:func -EnHonotrap_EyeOpen = 0x80A40BC0; // type:func -EnHonotrap_SetupEyeAttack = 0x80A40C90; // type:func -EnHonotrap_EyeAttack = 0x80A40CA8; // type:func -EnHonotrap_SetupEyeClose = 0x80A40CD8; // type:func -EnHonotrap_EyeClose = 0x80A40CEC; // type:func -EnHonotrap_SetupFlameGrow = 0x80A40D38; // type:func -EnHonotrap_FlameGrow = 0x80A40D4C; // type:func -EnHonotrap_SetupFlameDrop = 0x80A40DE0; // type:func -EnHonotrap_FlameDrop = 0x80A40E48; // type:func -EnHonotrap_SetupFlameMove = 0x80A40F8C; // type:func -EnHonotrap_FlameMove = 0x80A41018; // type:func -EnHonotrap_SetupFlameChase = 0x80A411E4; // type:func -EnHonotrap_FlameChase = 0x80A41224; // type:func -EnHonotrap_SetupFlameVanish = 0x80A413D8; // type:func -EnHonotrap_FlameVanish = 0x80A413EC; // type:func -EnHonotrap_Update = 0x80A4147C; // type:func -EnHonotrap_DrawEye = 0x80A415C4; // type:func -EnHonotrap_DrawFlame = 0x80A416B4; // type:func -EnHonotrap_Draw = 0x80A4184C; // type:func -EnHorse_BgCheckBridgeJumpPoint = 0x80A41B50; // type:func -EnHorse_CheckBridgeJumps = 0x80A41CB0; // type:func -EnHorse_RaceWaypointPos = 0x80A41DF0; // type:func -EnHorse_RotateToPoint = 0x80A41E44; // type:func -EnHorse_UpdateIngoRaceInfo = 0x80A41E80; // type:func -EnHorse_PlayWalkingSfx = 0x80A42234; // type:func -EnHorse_PlayTrottingSfx = 0x80A422F0; // type:func -EnHorse_PlayGallopingSfx = 0x80A42338; // type:func -EnHorse_SlopeSpeedMultiplier = 0x80A42380; // type:func -func_80A5BB90 = 0x80A42400; // type:func -func_80A5BBBC = 0x80A42430; // type:func -EnHorse_IdleAnimSounds = 0x80A424E0; // type:func -EnHorse_Spawn = 0x80A4260C; // type:func -EnHorse_ResetCutscene = 0x80A42850; // type:func -EnHorse_ResetRace = 0x80A42868; // type:func -EnHorse_PlayerCanMove = 0x80A42878; // type:func -EnHorse_ResetHorsebackArchery = 0x80A42934; // type:func -EnHorse_ClearDustFlags = 0x80A4294C; // type:func -EnHorse_Init = 0x80A42958; // type:func -EnHorse_Destroy = 0x80A43088; // type:func -EnHorse_RotateToPlayer = 0x80A430F8; // type:func -EnHorse_Freeze = 0x80A43168; // type:func -EnHorse_Frozen = 0x80A431E8; // type:func -EnHorse_UpdateSpeed = 0x80A43358; // type:func -EnHorse_StartMountedIdleResetAnim = 0x80A4379C; // type:func -EnHorse_StartMountedIdle = 0x80A437D8; // type:func -EnHorse_MountedIdle = 0x80A43914; // type:func -EnHorse_MountedIdleAnim = 0x80A43A14; // type:func -EnHorse_MountedIdleWhinney = 0x80A43A38; // type:func -EnHorse_MountedIdleWhinneying = 0x80A43B34; // type:func -EnHorse_StartTurning = 0x80A43C34; // type:func -EnHorse_MountedTurn = 0x80A43CDC; // type:func -EnHorse_StartWalkingFromIdle = 0x80A43EA0; // type:func -EnHorse_StartWalkingInterruptable = 0x80A43EF0; // type:func -EnHorse_StartWalking = 0x80A43F14; // type:func -EnHorse_MountedWalkingReset = 0x80A43FC0; // type:func -EnHorse_MountedWalk = 0x80A44014; // type:func -EnHorse_StartTrotting = 0x80A442E4; // type:func -EnHorse_MountedTrotReset = 0x80A44388; // type:func -EnHorse_MountedTrot = 0x80A443D4; // type:func -EnHorse_StartGallopingInterruptable = 0x80A4450C; // type:func -EnHorse_StartGalloping = 0x80A44530; // type:func -EnHorse_MountedGallopReset = 0x80A445D8; // type:func -EnHorse_JumpLanding = 0x80A44630; // type:func -EnHorse_MountedGallop = 0x80A446B4; // type:func -EnHorse_StartRearing = 0x80A44888; // type:func -EnHorse_MountedRearing = 0x80A449AC; // type:func -EnHorse_StartBraking = 0x80A44B28; // type:func -EnHorse_Stopping = 0x80A44C18; // type:func -EnHorse_StartReversingInterruptable = 0x80A44E04; // type:func -EnHorse_StartReversing = 0x80A44E28; // type:func -EnHorse_Reverse = 0x80A44ECC; // type:func -EnHorse_LowJumpInit = 0x80A4527C; // type:func -EnHorse_StartLowJump = 0x80A452A0; // type:func -EnHorse_Stub1 = 0x80A453D0; // type:func -EnHorse_LowJump = 0x80A453DC; // type:func -EnHorse_HighJumpInit = 0x80A455A0; // type:func -EnHorse_StartHighJump = 0x80A455C4; // type:func -EnHorse_Stub2 = 0x80A45700; // type:func -EnHorse_HighJump = 0x80A4570C; // type:func -EnHorse_InitInactive = 0x80A458D0; // type:func -EnHorse_Inactive = 0x80A45920; // type:func -EnHorse_PlayIdleAnimation = 0x80A45A4C; // type:func -EnHorse_ChangeIdleAnimation = 0x80A45C1C; // type:func -EnHorse_ResetIdleAnimation = 0x80A45C44; // type:func -EnHorse_StartIdleRidable = 0x80A45C78; // type:func -EnHorse_Idle = 0x80A45CAC; // type:func -EnHorse_StartMovingAnimation = 0x80A45E94; // type:func -EnHorse_SetFollowAnimation = 0x80A45FFC; // type:func -EnHorse_FollowPlayer = 0x80A46130; // type:func -EnHorse_InitIngoHorse = 0x80A46554; // type:func -EnHorse_SetIngoAnimation = 0x80A465D8; // type:func -EnHorse_UpdateIngoHorseAnim = 0x80A4667C; // type:func -EnHorse_UpdateIngoRace = 0x80A46990; // type:func -EnHorse_CsMoveInit = 0x80A46B40; // type:func -EnHorse_CsMoveToPoint = 0x80A46BAC; // type:func -EnHorse_CsSetAnimHighJump = 0x80A46CFC; // type:func -EnHorse_CsPlayHighJumpAnim = 0x80A46D20; // type:func -EnHorse_CsJumpInit = 0x80A46E54; // type:func -EnHorse_CsJump = 0x80A46E8C; // type:func -EnHorse_CsRearingInit = 0x80A470E4; // type:func -EnHorse_CsRearing = 0x80A47204; // type:func -EnHorse_WarpMoveInit = 0x80A473AC; // type:func -EnHorse_CsWarpMoveToPoint = 0x80A47494; // type:func -EnHorse_CsWarpRearingInit = 0x80A475E4; // type:func -EnHorse_CsWarpRearing = 0x80A4776C; // type:func -EnHorse_InitCutscene = 0x80A47914; // type:func -EnHorse_GetCutsceneFunctionIndex = 0x80A47938; // type:func -EnHorse_CutsceneUpdate = 0x80A47988; // type:func -EnHorse_UpdateHbaRaceInfo = 0x80A47AE0; // type:func -EnHorse_InitHorsebackArchery = 0x80A47CD0; // type:func -EnHorse_UpdateHbaAnim = 0x80A47D04; // type:func -EnHorse_UpdateHorsebackArchery = 0x80A4803C; // type:func -EnHorse_InitFleePlayer = 0x80A482C8; // type:func -EnHorse_FleePlayer = 0x80A482F0; // type:func -EnHorse_BridgeJumpInit = 0x80A48B44; // type:func -EnHorse_StartBridgeJump = 0x80A48D7C; // type:func -EnHorse_BridgeJumpMove = 0x80A48E2C; // type:func -EnHorse_CheckBridgeJumpLanding = 0x80A48F88; // type:func -EnHorse_BridgeJump = 0x80A49074; // type:func -EnHorse_Vec3fOffset = 0x80A490B8; // type:func -EnHorse_CalcFloorHeight = 0x80A49134; // type:func -EnHorse_ObstructMovement = 0x80A49274; // type:func -EnHorse_CheckFloors = 0x80A4939C; // type:func -EnHorse_MountDismount = 0x80A4991C; // type:func -EnHorse_StickDirection = 0x80A49A20; // type:func -EnHorse_UpdateStick = 0x80A49AAC; // type:func -EnHorse_ResolveCollision = 0x80A49AEC; // type:func -EnHorse_BgCheckSlowMoving = 0x80A49C44; // type:func -EnHorse_UpdateBgCheckInfo = 0x80A49D84; // type:func -EnHorse_CheckBoost = 0x80A4A890; // type:func -EnHorse_RegenBoost = 0x80A4AA3C; // type:func -EnHorse_UpdatePlayerDir = 0x80A4AC68; // type:func -EnHorse_TiltBody = 0x80A4AD74; // type:func -EnHorse_UpdateConveyors = 0x80A4AE70; // type:func -EnHorse_RandInt = 0x80A4AF78; // type:func -EnHorse_Update = 0x80A4AFAC; // type:func -EnHorse_PlayerDirToMountSide = 0x80A4B7D8; // type:func -EnHorse_MountSideCheck = 0x80A4B818; // type:func -EnHorse_GetMountSide = 0x80A4B91C; // type:func -EnHorse_RandomOffset = 0x80A4B974; // type:func -EnHorse_PostDraw = 0x80A4BA10; // type:func -EnHorse_OverrideLimbDraw = 0x80A4C508; // type:func -EnHorse_Draw = 0x80A4C608; // type:func -EnHorseGameCheck_InitIngoRace = 0x80A4DDB0; // type:func -EnHorseGameCheck_DestroyIngoRace = 0x80A4DE6C; // type:func -EnHorseGameCheck_FinishIngoRace = 0x80A4DE80; // type:func -EnHorseGameCheck_UpdateIngoRace = 0x80A4DFCC; // type:func -EnHorseGameCheck_InitGerudoArchery = 0x80A4E444; // type:func -EnHorseGameCheck_DestroyGerudoArchery = 0x80A4E464; // type:func -EnHorseGameCheck_UpdateGerudoArchery = 0x80A4E478; // type:func -EnHorseGameCheck_InitType3 = 0x80A4E4C0; // type:func -EnHorseGameCheck_DestroyType3 = 0x80A4E4DC; // type:func -EnHorseGameCheck_UpdateType3 = 0x80A4E4F0; // type:func -EnHorseGameCheck_InitMalonRace = 0x80A4E504; // type:func -EnHorseGameCheck_DestroyMalonRace = 0x80A4E554; // type:func -EnHorseGameCheck_FinishMalonRace = 0x80A4E568; // type:func -EnHorseGameCheck_UpdateMalonRace = 0x80A4E65C; // type:func -EnHorseGameCheck_Init = 0x80A4EB74; // type:func -EnHorseGameCheck_Destroy = 0x80A4EBF8; // type:func -EnHorseGameCheck_Update = 0x80A4EC34; // type:func -EnHorseGameCheck_Draw = 0x80A4EC70; // type:func -func_80A68660 = 0x80A4EE80; // type:func -func_80A686A8 = 0x80A4EECC; // type:func -func_80A68870 = 0x80A4F094; // type:func -EnHorseGanon_Init = 0x80A4F150; // type:func -EnHorseGanon_Destroy = 0x80A4F29C; // type:func -func_80A68AC4 = 0x80A4F2EC; // type:func -func_80A68AF0 = 0x80A4F31C; // type:func -func_80A68B20 = 0x80A4F350; // type:func -func_80A68DB0 = 0x80A4F5E0; // type:func -func_80A68E14 = 0x80A4F644; // type:func -EnHorseGanon_Update = 0x80A4F708; // type:func -EnHorseGanon_PostDraw = 0x80A4F7DC; // type:func -EnHorseGanon_Draw = 0x80A4F968; // type:func -func_80A693D0 = 0x80A4FC00; // type:func -func_80A6948C = 0x80A4FCBC; // type:func -func_80A695A4 = 0x80A4FDD4; // type:func -EnHorseLinkChild_Init = 0x80A4FE9C; // type:func -EnHorseLinkChild_Destroy = 0x80A50074; // type:func -func_80A6988C = 0x80A500C4; // type:func -func_80A698F4 = 0x80A50128; // type:func -func_80A6993C = 0x80A50170; // type:func -func_80A699FC = 0x80A50230; // type:func -func_80A69B7C = 0x80A503B8; // type:func -func_80A69C18 = 0x80A50458; // type:func -func_80A69EC0 = 0x80A50700; // type:func -func_80A69F5C = 0x80A507A0; // type:func -func_80A6A068 = 0x80A508AC; // type:func -func_80A6A4DC = 0x80A50D28; // type:func -func_80A6A5A4 = 0x80A50DF0; // type:func -func_80A6A724 = 0x80A50F70; // type:func -func_80A6A7D0 = 0x80A51020; // type:func -EnHorseLinkChild_Update = 0x80A512FC; // type:func -EnHorseLinkChild_PostDraw = 0x80A51454; // type:func -EnHorseLinkChild_OverrideLimbDraw = 0x80A515E0; // type:func -EnHorseLinkChild_Draw = 0x80A51668; // type:func -func_80A6B250 = 0x80A51A00; // type:func -func_80A6B30C = 0x80A51ABC; // type:func -EnHorseNormal_Init = 0x80A51B84; // type:func -EnHorseNormal_Destroy = 0x80A52074; // type:func -func_80A6B91C = 0x80A520D4; // type:func -EnHorseNormal_FollowPath = 0x80A5218C; // type:func -EnHorseNormal_NextAnimation = 0x80A52368; // type:func -EnHorseNormal_CycleAnimations = 0x80A523BC; // type:func -func_80A6BC48 = 0x80A52404; // type:func -func_80A6BCEC = 0x80A524AC; // type:func -func_80A6BD7C = 0x80A5253C; // type:func -EnHorseNormal_Wander = 0x80A52630; // type:func -func_80A6C4CC = 0x80A52C94; // type:func -EnHorseNormal_Wait = 0x80A52D3C; // type:func -func_80A6C6B0 = 0x80A52E7C; // type:func -EnHorseNormal_WaitClone = 0x80A52F30; // type:func -func_80A6C8E0 = 0x80A530B4; // type:func -EnHorseNormal_Update = 0x80A53178; // type:func -EnHorseNormal_PostDraw = 0x80A532D4; // type:func -func_80A6CC88 = 0x80A53460; // type:func -EnHorseNormal_Draw = 0x80A53648; // type:func -EnHorseZelda_GetFieldPosition = 0x80A54020; // type:func -EnHorseZelda_Move = 0x80A5406C; // type:func -EnHorseZelda_Init = 0x80A54234; // type:func -EnHorseZelda_Destroy = 0x80A54384; // type:func -EnHorseZelda_SetupStop = 0x80A543D4; // type:func -EnHorseZelda_Stop = 0x80A54424; // type:func -EnHorseZelda_Spur = 0x80A5446C; // type:func -EnHorseZelda_Gallop = 0x80A54554; // type:func -EnHorseZelda_SetRotate = 0x80A54594; // type:func -EnHorseZelda_Update = 0x80A54658; // type:func -EnHorseZelda_PostDraw = 0x80A54734; // type:func -EnHorseZelda_Draw = 0x80A548C0; // type:func -func_80A6E3A0 = 0x80A54B10; // type:func -EnHs_Init = 0x80A54B1C; // type:func -EnHs_Destroy = 0x80A54C60; // type:func -func_80A6E53C = 0x80A54C8C; // type:func -func_80A6E5EC = 0x80A54D40; // type:func -func_80A6E630 = 0x80A54D84; // type:func -func_80A6E6B0 = 0x80A54E04; // type:func -func_80A6E6D8 = 0x80A54E2C; // type:func -func_80A6E70C = 0x80A54E64; // type:func -func_80A6E740 = 0x80A54E9C; // type:func -func_80A6E7BC = 0x80A54F1C; // type:func -func_80A6E8CC = 0x80A5502C; // type:func -func_80A6E9AC = 0x80A55108; // type:func -EnHs_Update = 0x80A55250; // type:func -EnHs_OverrideLimbDraw = 0x80A553BC; // type:func -EnHs_PostLimbDraw = 0x80A55478; // type:func -EnHs_Draw = 0x80A554B8; // type:func -EnHs2_Init = 0x80A556B0; // type:func -EnHs2_Destroy = 0x80A55790; // type:func -func_80A6F0B4 = 0x80A557BC; // type:func -func_80A6F164 = 0x80A55870; // type:func -func_80A6F1A4 = 0x80A558AC; // type:func -EnHs2_Update = 0x80A558F8; // type:func -EnHs2_OverrideLimbDraw = 0x80A55A64; // type:func -EnHs2_PostLimbDraw = 0x80A55AEC; // type:func -EnHs2_Draw = 0x80A55B2C; // type:func -EnHy_FindSkelAndHeadObjects = 0x80A55C90; // type:func -EnHy_AreSkelAndHeadObjectsLoaded = 0x80A55DA4; // type:func -EnHy_FindOsAnimeObject = 0x80A55E2C; // type:func -EnHy_IsOsAnimeObjectLoaded = 0x80A55E7C; // type:func -func_80A6F7CC = 0x80A55EBC; // type:func -EnHy_GetTextId = 0x80A55F00; // type:func -EnHy_UpdateTalkState = 0x80A56748; // type:func -EnHy_UpdateEyes = 0x80A56C94; // type:func -EnHy_InitCollider = 0x80A56D50; // type:func -EnHy_InitSetProperties = 0x80A56D8C; // type:func -EnHy_UpdateCollider = 0x80A56E24; // type:func -func_80A70834 = 0x80A56F28; // type:func -func_80A70978 = 0x80A57070; // type:func -EnHy_ShouldSpawn = 0x80A571E0; // type:func -EnHy_Init = 0x80A5747C; // type:func -EnHy_Destroy = 0x80A5750C; // type:func -EnHy_InitImpl = 0x80A57538; // type:func -func_80A710F8 = 0x80A57804; // type:func -func_80A711B4 = 0x80A578C0; // type:func -func_80A7127C = 0x80A5798C; // type:func -EnHy_DoNothing = 0x80A579C4; // type:func -func_80A712C0 = 0x80A579D4; // type:func -func_80A7134C = 0x80A57A60; // type:func -func_80A714C4 = 0x80A57BDC; // type:func -func_80A71530 = 0x80A57C4C; // type:func -EnHy_Update = 0x80A57CFC; // type:func -EnHy_OverrideLimbDraw = 0x80A57DDC; // type:func -EnHy_PostLimbDraw = 0x80A58148; // type:func -EnHy_SetEnvColor = 0x80A58254; // type:func -EnHy_Draw = 0x80A582C0; // type:func -EnIceHono_XZDistanceSquared = 0x80A595D0; // type:func -EnIceHono_InitCapturableFlame = 0x80A59600; // type:func -EnIceHono_InitDroppedFlame = 0x80A596A4; // type:func -EnIceHono_InitSmallFlame = 0x80A597AC; // type:func -EnIceHono_Init = 0x80A59814; // type:func -EnIceHono_Destroy = 0x80A59974; // type:func -EnIceHono_InBottleRange = 0x80A599CC; // type:func -EnIceHono_SetupActionCapturableFlame = 0x80A59ABC; // type:func -EnIceHono_CapturableFlame = 0x80A59AE4; // type:func -EnIceHono_SetupActionDroppedFlame = 0x80A59B94; // type:func -EnIceHono_DropFlame = 0x80A59BB8; // type:func -EnIceHono_SetupActionSpreadFlames = 0x80A59D78; // type:func -EnIceHono_SpreadFlames = 0x80A59D9C; // type:func -EnIceHono_SetupActionSmallFlame = 0x80A59FF8; // type:func -EnIceHono_SmallFlameMove = 0x80A5A0CC; // type:func -EnIceHono_Update = 0x80A5A224; // type:func -EnIceHono_Draw = 0x80A5A3B8; // type:func -EnIk_Destroy = 0x80A5A7C0; // type:func -EnIk_SetupAction = 0x80A5A840; // type:func -EnIk_InitImpl = 0x80A5A84C; // type:func -EnIk_HandleBlocking = 0x80A5AA98; // type:func -EnIk_FindBreakableProp = 0x80A5AB28; // type:func -EnIk_SetupStandUp = 0x80A5ABC8; // type:func -EnIk_StandUp = 0x80A5AC74; // type:func -EnIk_SetupIdle = 0x80A5AD54; // type:func -EnIk_Idle = 0x80A5ADE4; // type:func -EnIk_SetupWalkOrRun = 0x80A5AF64; // type:func -EnIk_WalkOrRun = 0x80A5B05C; // type:func -EnIk_SetupVerticalAttack = 0x80A5B2E4; // type:func -EnIk_VerticalAttack = 0x80A5B374; // type:func -EnIk_SetupPullOutAxe = 0x80A5B528; // type:func -EnIk_PullOutAxe = 0x80A5B5C8; // type:func -EnIk_SetupDoubleHorizontalAttack = 0x80A5B684; // type:func -EnIk_DoubleHorizontalAttack = 0x80A5B71C; // type:func -EnIk_SetupRecoverFromHorizontalAttack = 0x80A5B88C; // type:func -EnIk_RecoverFromHorizontalAttack = 0x80A5B918; // type:func -EnIk_SetupSingleHorizontalAttack = 0x80A5B960; // type:func -EnIk_SingleHorizontalAttack = 0x80A5B9F0; // type:func -EnIk_SetupStopAndBlock = 0x80A5BAB0; // type:func -EnIk_StopAndBlock = 0x80A5BB3C; // type:func -EnIk_SetupReactToAttack = 0x80A5BC50; // type:func -EnIk_ReactToAttack = 0x80A5BD70; // type:func -EnIk_SetupDie = 0x80A5BE4C; // type:func -EnIk_Die = 0x80A5BEF8; // type:func -EnIk_UpdateDamage = 0x80A5C0F4; // type:func -EnIk_UpdateEnemy = 0x80A5C460; // type:func -EnIk_SetPrimEnvColors = 0x80A5C678; // type:func -EnIk_OverrideLimbDrawEnemy = 0x80A5C730; // type:func -EnIk_PostLimbDrawEnemy = 0x80A5C7F0; // type:func -EnIk_DrawEnemy = 0x80A5CC04; // type:func -EnIk_StartMinibossBgm = 0x80A5D03C; // type:func -EnIk_UpdateAction2Sfx = 0x80A5D05C; // type:func -EnIk_PlayAxeSpawnSfx = 0x80A5D228; // type:func -EnIk_SpawnAxeSmoke = 0x80A5D278; // type:func -EnIk_UpdateBgCheckInfo = 0x80A5D484; // type:func -EnIk_UpdateSkelAnime = 0x80A5D4CC; // type:func -EnIk_GetCue = 0x80A5D4F0; // type:func -EnIk_SetStartPosRotFromCue = 0x80A5D518; // type:func -EnIk_GetAnimCurFrame = 0x80A5D598; // type:func -EnIk_SetupCsAction0 = 0x80A5D5A4; // type:func -EnIk_SetupCsAction1 = 0x80A5D5B8; // type:func -EnIk_SetupCsAction2 = 0x80A5D644; // type:func -EnIk_HandleEnemyChange = 0x80A5D6C4; // type:func -EnIk_PlayArmorFallSfx = 0x80A5D704; // type:func -EnIk_PlayDeathSfx = 0x80A5D74C; // type:func -EnIk_SetupCsAction3 = 0x80A5D7C0; // type:func -EnIk_SetupCsAction4 = 0x80A5D898; // type:func -EnIk_SetupCsAction5 = 0x80A5D8D4; // type:func -EnIk_CsAction3 = 0x80A5D8F0; // type:func -EnIk_CsAction4 = 0x80A5D928; // type:func -EnIk_CsAction5 = 0x80A5D968; // type:func -EnIk_OverrideLimbDrawDefeat = 0x80A5D9A4; // type:func -EnIk_PostLimbDrawDefeat = 0x80A5DA10; // type:func -EnIk_CsDrawDefeat = 0x80A5DC5C; // type:func -EnIk_HandleCsCues = 0x80A5DDC0; // type:func -EnIk_CsAction0 = 0x80A5DEBC; // type:func -EnIk_CsAction1 = 0x80A5DEDC; // type:func -EnIk_CsAction2 = 0x80A5DF14; // type:func -EnIk_UpdateCutscene = 0x80A5DF78; // type:func -EnIk_OverrideLimbDrawIntro = 0x80A5DFC0; // type:func -EnIk_PostLimbDrawIntro = 0x80A5E044; // type:func -EnIk_CsDrawNothing = 0x80A5E230; // type:func -EnIk_CsDrawIntro = 0x80A5E240; // type:func -EnIk_DrawCutscene = 0x80A5E3A4; // type:func -EnIk_CsInit = 0x80A5E3EC; // type:func -EnIk_ChangeToEnemy = 0x80A5E45C; // type:func -EnIk_StartDefeatCutscene = 0x80A5E4C8; // type:func -EnIk_Init = 0x80A5E55C; // type:func -EnIn_GetTextIdChild = 0x80A5EE20; // type:func -EnIn_GetTextIdAdult = 0x80A5EE80; // type:func -EnIn_GetTextId = 0x80A5EFD8; // type:func -EnIn_UpdateTalkStateOnClosing = 0x80A5F03C; // type:func -EnIn_UpdateTalkStateOnChoice = 0x80A5F0B0; // type:func -EnIn_UpdateTalkStateOnEvent = 0x80A5F300; // type:func -EnIn_UpdateTalkState = 0x80A5F36C; // type:func -func_80A795C8 = 0x80A5F434; // type:func -func_80A79690 = 0x80A5F4FC; // type:func -EnIn_ChangeAnim = 0x80A5F558; // type:func -func_80A7975C = 0x80A5F5C8; // type:func -func_80A79830 = 0x80A5F69C; // type:func -EnIn_UpdateEyes = 0x80A5F898; // type:func -func_80A79AB4 = 0x80A5F920; // type:func -func_80A79BAC = 0x80A5FA18; // type:func -func_80A79C78 = 0x80A5FAE4; // type:func -EnIn_Init = 0x80A5FCD8; // type:func -EnIn_Destroy = 0x80A5FDE4; // type:func -EnIn_WaitForObject = 0x80A5FE28; // type:func -func_80A7A304 = 0x80A60180; // type:func -func_80A7A4BC = 0x80A60338; // type:func -func_80A7A4C8 = 0x80A60348; // type:func -func_80A7A568 = 0x80A603EC; // type:func -func_80A7A770 = 0x80A605F4; // type:func -func_80A7A848 = 0x80A606CC; // type:func -func_80A7A940 = 0x80A607C4; // type:func -func_80A7AA40 = 0x80A608C4; // type:func -func_80A7ABD4 = 0x80A60A58; // type:func -func_80A7AE84 = 0x80A60D0C; // type:func -func_80A7AEF0 = 0x80A60D78; // type:func -func_80A7B018 = 0x80A60EA4; // type:func -func_80A7B024 = 0x80A60EB4; // type:func -EnIn_Update = 0x80A60FA0; // type:func -EnIn_OverrideLimbDraw = 0x80A611B4; // type:func -EnIn_PostLimbDraw = 0x80A61408; // type:func -EnIn_Draw = 0x80A61518; // type:func -EnInsect_InitFlags = 0x80A61BC0; // type:func -EnInsect_XZDistanceSquared = 0x80A61BE4; // type:func -EnInsect_InBottleRange = 0x80A61C14; // type:func -EnInsect_SetCrawlAnim = 0x80A61D04; // type:func -EnInsect_TryFindNearbySoil = 0x80A61D50; // type:func -EnInsect_UpdateCrawlSfx = 0x80A61E08; // type:func -EnInsect_Init = 0x80A61E9C; // type:func -EnInsect_Destroy = 0x80A620E8; // type:func -EnInsect_SetupSlowDown = 0x80A62158; // type:func -EnInsect_SlowDown = 0x80A621A8; // type:func -EnInsect_SetupCrawl = 0x80A6234C; // type:func -EnInsect_Crawl = 0x80A6239C; // type:func -EnInsect_SetupRunFromPlayer = 0x80A625C8; // type:func -EnInsect_RunFromPlayer = 0x80A62618; // type:func -EnInsect_SetupCaught = 0x80A62810; // type:func -EnInsect_Caught = 0x80A6287C; // type:func -EnInsect_SetupDig = 0x80A62974; // type:func -EnInsect_Dig = 0x80A629EC; // type:func -EnInsect_SetupWalkOnWater = 0x80A62C10; // type:func -EnInsect_WalkOnWater = 0x80A62C70; // type:func -EnInsect_SetupDrown = 0x80A62FA4; // type:func -EnInsect_Drown = 0x80A6301C; // type:func -EnInsect_SetupDropped = 0x80A6314C; // type:func -EnInsect_Dropped = 0x80A63214; // type:func -EnInsect_Update = 0x80A63944; // type:func -EnInsect_Draw = 0x80A63B8C; // type:func -EnIshi_InitCollider = 0x80A640E0; // type:func -EnIshi_SnapToFloor = 0x80A64158; // type:func -EnIshi_SpawnFragmentsSmall = 0x80A641FC; // type:func -EnIshi_SpawnFragmentsLarge = 0x80A64478; // type:func -EnIshi_SpawnDustSmall = 0x80A64764; // type:func -EnIshi_SpawnDustLarge = 0x80A64858; // type:func -EnIshi_DropCollectible = 0x80A6494C; // type:func -EnIshi_Fall = 0x80A649BC; // type:func -func_80A7ED94 = 0x80A649F0; // type:func -EnIshi_SpawnBugs = 0x80A64A74; // type:func -EnIshi_Init = 0x80A64B30; // type:func -EnIshi_Destroy = 0x80A64CCC; // type:func -EnIshi_SetupWait = 0x80A64CF8; // type:func -EnIshi_Wait = 0x80A64D0C; // type:func -EnIshi_SetupLiftedUp = 0x80A64F64; // type:func -EnIshi_LiftedUp = 0x80A64F8C; // type:func -EnIshi_SetupFly = 0x80A65060; // type:func -EnIshi_Fly = 0x80A6518C; // type:func -EnIshi_Update = 0x80A654F8; // type:func -EnIshi_DrawSmall = 0x80A6551C; // type:func -EnIshi_DrawLarge = 0x80A6554C; // type:func -EnIshi_Draw = 0x80A655F4; // type:func -EnIt_Init = 0x80A6D230; // type:func -EnIt_Destroy = 0x80A6D29C; // type:func -EnIt_Update = 0x80A6D2C8; // type:func -EnJj_SetupAction = 0x80A6D3C0; // type:func -EnJj_Init = 0x80A6D3CC; // type:func -EnJj_Destroy = 0x80A6D65C; // type:func -EnJj_Blink = 0x80A6D6EC; // type:func -EnJj_OpenMouth = 0x80A6D76C; // type:func -EnJj_WaitToOpenMouth = 0x80A6D7C0; // type:func -EnJj_WaitForFish = 0x80A6D804; // type:func -EnJj_BeginCutscene = 0x80A6D8C0; // type:func -EnJj_CutsceneUpdate = 0x80A6D968; // type:func -EnJj_RemoveDust = 0x80A6DAC4; // type:func -EnJj_UpdateStaticCollision = 0x80A6DB1C; // type:func -EnJj_Update = 0x80A6DB2C; // type:func -EnJj_Draw = 0x80A6DBD8; // type:func -En_Js_SetupAction = 0x80A6E990; // type:func -EnJs_Init = 0x80A6E99C; // type:func -EnJs_Destroy = 0x80A6EAC0; // type:func -func_80A88F64 = 0x80A6EAEC; // type:func -func_80A89008 = 0x80A6EB94; // type:func -func_80A89078 = 0x80A6EC08; // type:func -func_80A890C0 = 0x80A6EC54; // type:func -func_80A8910C = 0x80A6ECA4; // type:func -func_80A89160 = 0x80A6ECF8; // type:func -func_80A891C4 = 0x80A6ED60; // type:func -func_80A89294 = 0x80A6EE34; // type:func -func_80A89304 = 0x80A6EEA8; // type:func -EnJs_Update = 0x80A6EEE0; // type:func -EnJs_OverrideLimbDraw = 0x80A6F16C; // type:func -EnJs_PostLimbDraw = 0x80A6F1A4; // type:func -EnJs_Draw = 0x80A6F1E4; // type:func -EnJsjutan_Init = 0x80A6F360; // type:func -EnJsjutan_Destroy = 0x80A6F3F4; // type:func -func_80A89860 = 0x80A6F428; // type:func -func_80A89A6C = 0x80A6F634; // type:func -EnJsjutan_Update = 0x80A70114; // type:func -EnJsjutan_Draw = 0x80A701EC; // type:func -EnKakasi_Destroy = 0x80A74C90; // type:func -EnKakasi_Init = 0x80A74CBC; // type:func -func_80A8F28C = 0x80A74D84; // type:func -func_80A8F320 = 0x80A74E18; // type:func -func_80A8F660 = 0x80A75158; // type:func -func_80A8F75C = 0x80A75254; // type:func -func_80A8F8D0 = 0x80A753D0; // type:func -func_80A8F9C8 = 0x80A754BC; // type:func -func_80A8FAA4 = 0x80A7559C; // type:func -func_80A8FBB8 = 0x80A756A0; // type:func -EnKakasi_Update = 0x80A75738; // type:func -EnKakasi_Draw = 0x80A7583C; // type:func -EnKakasi2_Init = 0x80A759D0; // type:func -EnKakasi2_Destroy = 0x80A75B2C; // type:func -func_80A90264 = 0x80A75B58; // type:func -func_80A904D8 = 0x80A75CB0; // type:func -func_80A90578 = 0x80A75D50; // type:func -func_80A9062C = 0x80A75E04; // type:func -func_80A906C4 = 0x80A75E9C; // type:func -EnKakasi2_Update = 0x80A75F0C; // type:func -func_80A90948 = 0x80A75FCC; // type:func -EnKakasi3_Destroy = 0x80A760F0; // type:func -EnKakasi3_Init = 0x80A7611C; // type:func -func_80A90E28 = 0x80A761E4; // type:func -func_80A90EBC = 0x80A76278; // type:func -func_80A911F0 = 0x80A765AC; // type:func -func_80A91284 = 0x80A76640; // type:func -func_80A91348 = 0x80A76704; // type:func -func_80A915B8 = 0x80A7697C; // type:func -func_80A91620 = 0x80A769E8; // type:func -func_80A91760 = 0x80A76B28; // type:func -func_80A917FC = 0x80A76BC8; // type:func -func_80A9187C = 0x80A76C50; // type:func -func_80A918E4 = 0x80A76CBC; // type:func -func_80A91A90 = 0x80A76E00; // type:func -EnKakasi3_Update = 0x80A76F00; // type:func -EnKakasi3_Draw = 0x80A76FF8; // type:func -EnKanban_SetFloorRot = 0x80A771D0; // type:func -EnKanban_Init = 0x80A7728C; // type:func -EnKanban_Destroy = 0x80A773B4; // type:func -EnKanban_Message = 0x80A773EC; // type:func -EnKanban_Update = 0x80A774A4; // type:func -EnKanban_Draw = 0x80A78D20; // type:func -EnKarebaba_Init = 0x80A7A320; // type:func -EnKarebaba_Destroy = 0x80A7A454; // type:func -EnKarebaba_ResetCollider = 0x80A7A494; // type:func -EnKarebaba_SetupGrow = 0x80A7A4D0; // type:func -EnKarebaba_SetupIdle = 0x80A7A520; // type:func -EnKarebaba_SetupAwaken = 0x80A7A574; // type:func -EnKarebaba_SetupUpright = 0x80A7A5F0; // type:func -EnKarebaba_SetupSpin = 0x80A7A690; // type:func -EnKarebaba_SetupDying = 0x80A7A6AC; // type:func -EnKarebaba_SetupDeadItemDrop = 0x80A7A720; // type:func -EnKarebaba_SetupRetract = 0x80A7A7C0; // type:func -EnKarebaba_SetupDead = 0x80A7A840; // type:func -EnKarebaba_SetupRegrow = 0x80A7A8CC; // type:func -EnKarebaba_Grow = 0x80A7A920; // type:func -EnKarebaba_Idle = 0x80A7A9B8; // type:func -EnKarebaba_Awaken = 0x80A7AA18; // type:func -EnKarebaba_Upright = 0x80A7AAEC; // type:func -EnKarebaba_Spin = 0x80A7ABE0; // type:func -EnKarebaba_Dying = 0x80A7AD74; // type:func -EnKarebaba_DeadItemDrop = 0x80A7B02C; // type:func -EnKarebaba_Retract = 0x80A7B094; // type:func -EnKarebaba_Dead = 0x80A7B168; // type:func -EnKarebaba_Regrow = 0x80A7B1C0; // type:func -EnKarebaba_Update = 0x80A7B28C; // type:func -EnKarebaba_DrawBaseShadow = 0x80A7B440; // type:func -EnKarebaba_Draw = 0x80A7B52C; // type:func -EnKo_AreObjectsAvailable = 0x80A7BC10; // type:func -EnKo_AreObjectsLoaded = 0x80A7BD28; // type:func -EnKo_IsOsAnimeAvailable = 0x80A7BDB0; // type:func -EnKo_IsOsAnimeLoaded = 0x80A7BE00; // type:func -EnKo_GetTextIdChild = 0x80A7BE40; // type:func -EnKo_GetTextIdAdult = 0x80A7C1A8; // type:func -EnKo_GetTextId = 0x80A7C480; // type:func -EnKo_UpdateTalkState = 0x80A7C5AC; // type:func -EnKo_GetForestQuestState = 0x80A7C9AC; // type:func -func_80A97BC0 = 0x80A7CA34; // type:func -func_80A97C7C = 0x80A7CAF0; // type:func -EnKo_IsWithinTalkAngle = 0x80A7CB74; // type:func -func_80A97D68 = 0x80A7CBE0; // type:func -func_80A97E18 = 0x80A7CC90; // type:func -func_80A97EB0 = 0x80A7CD2C; // type:func -func_80A97F20 = 0x80A7CDA0; // type:func -func_80A97F70 = 0x80A7CDF0; // type:func -func_80A98034 = 0x80A7CEB4; // type:func -func_80A98124 = 0x80A7CFA8; // type:func -func_80A98174 = 0x80A7CFF8; // type:func -EnKo_ChildStart = 0x80A7D0DC; // type:func -EnKo_ChildStone = 0x80A7D1E4; // type:func -EnKo_ChildSaria = 0x80A7D2EC; // type:func -EnKo_AdultEnemy = 0x80A7D3F4; // type:func -EnKo_AdultSaved = 0x80A7D4FC; // type:func -func_80A9877C = 0x80A7D604; // type:func -EnKo_CanSpawn = 0x80A7D7C0; // type:func -EnKo_Blink = 0x80A7DAA4; // type:func -func_80A98CD8 = 0x80A7DB64; // type:func -EnKo_GetForestQuestState2 = 0x80A7DBBC; // type:func -func_80A98DB4 = 0x80A7DC48; // type:func -func_80A98ECC = 0x80A7DD60; // type:func -EnKo_Init = 0x80A7DE28; // type:func -EnKo_Destroy = 0x80A7DEB8; // type:func -func_80A99048 = 0x80A7DEE4; // type:func -func_80A99384 = 0x80A7E214; // type:func -func_80A99438 = 0x80A7E2C8; // type:func -func_80A99504 = 0x80A7E394; // type:func -func_80A99560 = 0x80A7E3F4; // type:func -func_80A995CC = 0x80A7E464; // type:func -EnKo_Update = 0x80A7E5A0; // type:func -EnKo_OverrideLimbDraw = 0x80A7E704; // type:func -EnKo_PostLimbDraw = 0x80A7EA64; // type:func -EnKo_SetEnvColor = 0x80A7EB34; // type:func -EnKo_Draw = 0x80A7EBA0; // type:func -EnKusa_SetupAction = 0x80A7FD50; // type:func -EnKusa_SnapToFloor = 0x80A7FD60; // type:func -EnKusa_DropCollectible = 0x80A7FE04; // type:func -EnKusa_UpdateVelY = 0x80A7FED0; // type:func -EnKusa_RandScaleVecToZero = 0x80A7FF04; // type:func -EnKusa_SetScaleSmall = 0x80A7FF88; // type:func -EnKusa_SpawnFragments = 0x80A7FFAC; // type:func -EnKusa_SpawnBugs = 0x80A80304; // type:func -EnKusa_InitCollider = 0x80A803C0; // type:func -EnKusa_Init = 0x80A80418; // type:func -EnKusa_Destroy = 0x80A80540; // type:func -EnKusa_SetupWaitForObject = 0x80A8056C; // type:func -EnKusa_WaitForObject = 0x80A80590; // type:func -EnKusa_SetupMain = 0x80A80620; // type:func -EnKusa_Main = 0x80A80658; // type:func -EnKusa_SetupLiftedUp = 0x80A80820; // type:func -EnKusa_LiftedUp = 0x80A8085C; // type:func -EnKusa_SetupFall = 0x80A8093C; // type:func -EnKusa_Fall = 0x80A809A8; // type:func -EnKusa_SetupCut = 0x80A80C38; // type:func -EnKusa_CutWaitRegrow = 0x80A80C88; // type:func -EnKusa_DoNothing = 0x80A80CBC; // type:func -EnKusa_SetupUprootedWaitRegrow = 0x80A80CCC; // type:func -EnKusa_UprootedWaitRegrow = 0x80A80D38; // type:func -EnKusa_SetupRegrow = 0x80A80D9C; // type:func -EnKusa_Regrow = 0x80A80DF4; // type:func -EnKusa_Update = 0x80A80E8C; // type:func -EnKusa_Draw = 0x80A80EF0; // type:func -EnKz_GetTextIdChild = 0x80A81230; // type:func -EnKz_GetTextIdAdult = 0x80A8128C; // type:func -EnKz_GetTextId = 0x80A8133C; // type:func -EnKz_UpdateTalkState = 0x80A813A4; // type:func -EnKz_UpdateEyes = 0x80A815C8; // type:func -EnKz_UpdateTalking = 0x80A81640; // type:func -func_80A9CB18 = 0x80A817FC; // type:func -EnKz_FollowPath = 0x80A819BC; // type:func -EnKz_SetMovedPos = 0x80A81B28; // type:func -EnKz_Init = 0x80A81BF0; // type:func -EnKz_Destroy = 0x80A81D7C; // type:func -EnKz_PreMweepWait = 0x80A81DA8; // type:func -EnKz_SetupMweep = 0x80A81E18; // type:func -EnKz_Mweep = 0x80A81F44; // type:func -EnKz_StopMweep = 0x80A820B0; // type:func -EnKz_Wait = 0x80A82114; // type:func -EnKz_SetupGetItem = 0x80A8217C; // type:func -EnKz_StartTimer = 0x80A82210; // type:func -EnKz_Update = 0x80A822A8; // type:func -EnKz_OverrideLimbDraw = 0x80A82364; // type:func -EnKz_PostLimbDraw = 0x80A82434; // type:func -EnKz_Draw = 0x80A82490; // type:func -EnLight_Init = 0x80A827D0; // type:func -EnLight_Destroy = 0x80A829B0; // type:func -EnLight_UpdatePosRot = 0x80A829E4; // type:func -EnLight_Update = 0x80A82A60; // type:func -EnLight_UpdateSwitch = 0x80A82D04; // type:func -EnLight_Draw = 0x80A8313C; // type:func -EnLightbox_Init = 0x80A835D0; // type:func -EnLightbox_Destroy = 0x80A836FC; // type:func -EnLightbox_Update = 0x80A83730; // type:func -EnLightbox_Draw = 0x80A839B8; // type:func -EnMFire1_Init = 0x80A83A50; // type:func -EnMFire1_Destroy = 0x80A83ABC; // type:func -EnMFire1_Update = 0x80A83AE8; // type:func -func_80A9EFE0 = 0x80A83BF0; // type:func -EnMThunder_Init = 0x80A83BFC; // type:func -EnMThunder_Destroy = 0x80A83EBC; // type:func -func_80A9F314 = 0x80A83F2C; // type:func -func_80A9F350 = 0x80A83F68; // type:func -func_80A9F408 = 0x80A84020; // type:func -func_80A9F938 = 0x80A84554; // type:func -func_80A9F9B4 = 0x80A845D0; // type:func -EnMThunder_Update = 0x80A8473C; // type:func -EnMThunder_Draw = 0x80A84910; // type:func -EnMa1_GetTextId = 0x80A851F0; // type:func -EnMa1_UpdateTalkState = 0x80A852D8; // type:func -EnMa1_ShouldSpawn = 0x80A85424; // type:func -EnMa1_UpdateEyes = 0x80A85570; // type:func -EnMa1_ChangeAnim = 0x80A855E8; // type:func -EnMa1_UpdateTracking = 0x80A85658; // type:func -EnMa1_UpdateSinging = 0x80A856D8; // type:func -EnMa1_Init = 0x80A85750; // type:func -EnMa1_Destroy = 0x80A858B8; // type:func -EnMa1_Idle = 0x80A858F8; // type:func -EnMa1_GiveWeirdEgg = 0x80A85A10; // type:func -EnMa1_FinishGivingWeirdEgg = 0x80A85A70; // type:func -EnMa1_IdleTeachSong = 0x80A85AB8; // type:func -EnMa1_StartTeachSong = 0x80A85BE4; // type:func -EnMa1_TeachSong = 0x80A85C68; // type:func -EnMa1_WaitForPlayback = 0x80A85CD0; // type:func -EnMa1_DoNothing = 0x80A85D48; // type:func -EnMa1_Update = 0x80A85D58; // type:func -EnMa1_OverrideLimbDraw = 0x80A85E44; // type:func -EnMa1_PostLimbDraw = 0x80A85FD4; // type:func -EnMa1_Draw = 0x80A86030; // type:func -EnMa2_GetTextId = 0x80A864D0; // type:func -EnMa2_UpdateTalkState = 0x80A86568; // type:func -func_80AA1AE4 = 0x80A86618; // type:func -func_80AA1B58 = 0x80A8668C; // type:func -func_80AA1C68 = 0x80A8679C; // type:func -EnMa2_UpdateEyes = 0x80A867F4; // type:func -EnMa2_ChangeAnim = 0x80A86880; // type:func -func_80AA1DB4 = 0x80A868F0; // type:func -EnMa2_Init = 0x80A8697C; // type:func -EnMa2_Destroy = 0x80A86B20; // type:func -func_80AA2018 = 0x80A86B60; // type:func -func_80AA204C = 0x80A86B94; // type:func -func_80AA20E4 = 0x80A86C30; // type:func -func_80AA21C8 = 0x80A86D1C; // type:func -EnMa2_Update = 0x80A86DBC; // type:func -EnMa2_OverrideLimbDraw = 0x80A86EAC; // type:func -EnMa2_PostLimbDraw = 0x80A870EC; // type:func -EnMa2_Draw = 0x80A871A0; // type:func -EnMa3_GetTextId = 0x80A87530; // type:func -EnMa3_UpdateTalkState = 0x80A87668; // type:func -func_80AA2E54 = 0x80A878E8; // type:func -func_80AA2EC8 = 0x80A8795C; // type:func -func_80AA2F28 = 0x80A879C0; // type:func -EnMa3_UpdateEyes = 0x80A87A18; // type:func -EnMa3_ChangeAnim = 0x80A87AA4; // type:func -EnMa3_Init = 0x80A87B14; // type:func -EnMa3_Destroy = 0x80A87C68; // type:func -func_80AA3200 = 0x80A87CA8; // type:func -EnMa3_Update = 0x80A87CDC; // type:func -EnMa3_OverrideLimbDraw = 0x80A87DF0; // type:func -EnMa3_PostLimbDraw = 0x80A88030; // type:func -EnMa3_Draw = 0x80A880E4; // type:func -EnMag_Init = 0x80A884E0; // type:func -EnMag_Destroy = 0x80A88768; // type:func -EnMag_Update = 0x80A88778; // type:func -EnMag_DrawTextureI8 = 0x80A88E50; // type:func -EnMag_DrawEffectTextures = 0x80A89078; // type:func -EnMag_DrawImageRGBA32 = 0x80A894B0; // type:func -EnMag_DrawCharTexture = 0x80A89890; // type:func -EnMag_DrawInner = 0x80A89A5C; // type:func -EnMag_Draw = 0x80A8ABE4; // type:func -EnMb_SetupAction = 0x80A8AE10; // type:func -EnMb_Init = 0x80A8AE1C; // type:func -EnMb_Destroy = 0x80A8B180; // type:func -EnMb_FaceWaypoint = 0x80A8B1D0; // type:func -EnMb_NextWaypoint = 0x80A8B208; // type:func -EnMb_IsPlayerInCorridor = 0x80A8B2F4; // type:func -EnMb_FindWaypointTowardsPlayer = 0x80A8B468; // type:func -EnMb_SetupSpearGuardLookAround = 0x80A8B5F8; // type:func -EnMb_SetupClubWaitPlayerNear = 0x80A8B660; // type:func -EnMb_SetupSpearPatrolTurnTowardsWaypoint = 0x80A8B6C4; // type:func -EnMb_SetupSpearGuardWalk = 0x80A8B73C; // type:func -EnMb_SetupSpearPatrolWalkTowardsWaypoint = 0x80A8B7E0; // type:func -EnMb_SetupSpearPrepareAndCharge = 0x80A8B890; // type:func -EnMb_SetupSpearPatrolImmediateCharge = 0x80A8B948; // type:func -EnMb_SetupClubAttack = 0x80A8B9B8; // type:func -EnMb_SetupSpearEndChargeQuick = 0x80A8BA88; // type:func -EnMb_SetupSpearPatrolEndCharge = 0x80A8BAE8; // type:func -EnMb_SetupClubWaitAfterAttack = 0x80A8BB6C; // type:func -EnMb_SetupClubDamaged = 0x80A8BBE4; // type:func -EnMb_SetupClubDamagedWhileKneeling = 0x80A8BC44; // type:func -EnMb_SetupClubDead = 0x80A8BCCC; // type:func -EnMb_SetupStunned = 0x80A8BD54; // type:func -EnMb_Stunned = 0x80A8BDF8; // type:func -EnMb_SpearGuardLookAround = 0x80A8BF04; // type:func -EnMb_SpearPatrolTurnTowardsWaypoint = 0x80A8BF7C; // type:func -EnMb_SpearEndChargeQuick = 0x80A8C0E0; // type:func -EnMb_ClubWaitAfterAttack = 0x80A8C248; // type:func -EnMb_SpearPatrolEndCharge = 0x80A8C28C; // type:func -EnMb_SpearGuardPrepareAndCharge = 0x80A8C5A4; // type:func -EnMb_ClubAttack = 0x80A8C70C; // type:func -EnMb_SpearPatrolPrepareAndCharge = 0x80A8CA84; // type:func -EnMb_SpearPatrolImmediateCharge = 0x80A8CDE8; // type:func -EnMb_ClubDamaged = 0x80A8D158; // type:func -EnMb_ClubDamagedWhileKneeling = 0x80A8D1EC; // type:func -EnMb_ClubDead = 0x80A8D2F8; // type:func -EnMb_SpearGuardWalk = 0x80A8D5BC; // type:func -EnMb_SpearPatrolWalkTowardsWaypoint = 0x80A8D8CC; // type:func -EnMb_ClubWaitPlayerNear = 0x80A8DBB8; // type:func -EnMb_SetupSpearDamaged = 0x80A8DC68; // type:func -EnMb_SpearDamaged = 0x80A8DD30; // type:func -EnMb_SetupSpearDead = 0x80A8DDA8; // type:func -EnMb_SpearDead = 0x80A8DE80; // type:func -EnMb_SpearUpdateAttackCollider = 0x80A8E098; // type:func -EnMb_ClubUpdateAttackCollider = 0x80A8E224; // type:func -EnMb_CheckColliding = 0x80A8E2BC; // type:func -EnMb_Update = 0x80A8E488; // type:func -EnMb_PostLimbDraw = 0x80A8E65C; // type:func -EnMb_Draw = 0x80A8E7F8; // type:func -func_80AAA250 = 0x80A8F040; // type:func -func_80AAA274 = 0x80A8F068; // type:func -func_80AAA308 = 0x80A8F0FC; // type:func -func_80AAA39C = 0x80A8F190; // type:func -func_80AAA474 = 0x80A8F268; // type:func -func_80AAA508 = 0x80A8F2FC; // type:func -func_80AAA5A4 = 0x80A8F398; // type:func -func_80AAA638 = 0x80A8F42C; // type:func -func_80AAA6D4 = 0x80A8F4C8; // type:func -func_80AAA768 = 0x80A8F55C; // type:func -func_80AAA7FC = 0x80A8F5F0; // type:func -func_80AAA890 = 0x80A8F684; // type:func -func_80AAA92C = 0x80A8F720; // type:func -func_80AAA93C = 0x80A8F738; // type:func -func_80AAAA24 = 0x80A8F820; // type:func -func_80AAAC78 = 0x80A8FA74; // type:func -EnMd_GetTextIdKokiriForest = 0x80A8FAF4; // type:func -EnMd_GetTextIdMidosHouse = 0x80A8FBDC; // type:func -EnMd_GetTextIdLostWoods = 0x80A8FC10; // type:func -EnMd_GetTextId = 0x80A8FC90; // type:func -EnMd_UpdateTalkState = 0x80A8FD00; // type:func -EnMd_ShouldSpawn = 0x80A8FE38; // type:func -EnMd_UpdateEyes = 0x80A8FEDC; // type:func -func_80AAB158 = 0x80A8FF54; // type:func -EnMd_FollowPath = 0x80A90170; // type:func -EnMd_SetMovedPos = 0x80A902DC; // type:func -func_80AAB5A4 = 0x80A903A4; // type:func -EnMd_Init = 0x80A90450; // type:func -EnMd_Destroy = 0x80A9064C; // type:func -func_80AAB874 = 0x80A90678; // type:func -func_80AAB8F8 = 0x80A906FC; // type:func -func_80AAB948 = 0x80A9074C; // type:func -func_80AABC10 = 0x80A90A1C; // type:func -func_80AABD0C = 0x80A90B18; // type:func -EnMd_Update = 0x80A90C40; // type:func -EnMd_OverrideLimbDraw = 0x80A90D00; // type:func -EnMd_PostLimbDraw = 0x80A90F1C; // type:func -EnMd_Draw = 0x80A90F78; // type:func -EnMk_Init = 0x80A916B0; // type:func -EnMk_Destroy = 0x80A917C8; // type:func -func_80AACA40 = 0x80A917F4; // type:func -func_80AACA94 = 0x80A91844; // type:func -func_80AACB14 = 0x80A918CC; // type:func -func_80AACB6C = 0x80A91928; // type:func -func_80AACBAC = 0x80A91964; // type:func -func_80AACC04 = 0x80A919BC; // type:func -func_80AACCA0 = 0x80A91A58; // type:func -func_80AACD48 = 0x80A91B00; // type:func -func_80AACE2C = 0x80A91BE4; // type:func -func_80AACEE8 = 0x80A91CA0; // type:func -func_80AACFA0 = 0x80A91D58; // type:func -func_80AAD014 = 0x80A91DD0; // type:func -EnMk_Wait = 0x80A91E3C; // type:func -EnMk_Update = 0x80A92090; // type:func -EnMk_OverrideLimbDraw = 0x80A922DC; // type:func -EnMk_PostLimbDraw = 0x80A92324; // type:func -EnMk_Draw = 0x80A92364; // type:func -EnMm_ChangeAnim = 0x80A92540; // type:func -EnMm_Init = 0x80A92664; // type:func -EnMm_Destroy = 0x80A92820; // type:func -func_80AADA70 = 0x80A9284C; // type:func -func_80AADAA0 = 0x80A92880; // type:func -EnMm_GetTextId = 0x80A92A14; // type:func -func_80AADCD0 = 0x80A92AB4; // type:func -EnMm_GetPointCount = 0x80A92C34; // type:func -func_80AADE60 = 0x80A92C48; // type:func -func_80AADEF0 = 0x80A92CDC; // type:func -func_80AAE224 = 0x80A93014; // type:func -func_80AAE294 = 0x80A93084; // type:func -func_80AAE50C = 0x80A932FC; // type:func -func_80AAE598 = 0x80A93388; // type:func -EnMm_Update = 0x80A93430; // type:func -EnMm_Draw = 0x80A934A4; // type:func -EnMm_OverrideLimbDraw = 0x80A93738; // type:func -EnMm_PostLimbDraw = 0x80A937CC; // type:func -EnMm2_ChangeAnim = 0x80A93BA0; // type:func -func_80AAEF70 = 0x80A93CC4; // type:func -EnMm2_Init = 0x80A93D94; // type:func -EnMm2_Destroy = 0x80A93F4C; // type:func -func_80AAF224 = 0x80A93F78; // type:func -func_80AAF2BC = 0x80A94014; // type:func -func_80AAF330 = 0x80A94088; // type:func -func_80AAF3C0 = 0x80A94118; // type:func -func_80AAF57C = 0x80A942D4; // type:func -func_80AAF5EC = 0x80A94348; // type:func -func_80AAF668 = 0x80A943C4; // type:func -EnMm2_Update = 0x80A944B8; // type:func -EnMm2_Draw = 0x80A94600; // type:func -EnMm2_OverrideLimbDraw = 0x80A946CC; // type:func -EnMm2_PostLimbDraw = 0x80A94754; // type:func -EnMs_SetOfferText = 0x80A94960; // type:func -EnMs_Init = 0x80A949DC; // type:func -EnMs_Destroy = 0x80A94B00; // type:func -EnMs_Wait = 0x80A94B2C; // type:func -EnMs_Talk = 0x80A94BD8; // type:func -EnMs_Sell = 0x80A94CF4; // type:func -EnMs_TalkAfterPurchase = 0x80A94D90; // type:func -EnMs_Update = 0x80A94DF0; // type:func -EnMs_Draw = 0x80A94EE8; // type:func -EnMu_SetupAction = 0x80A95050; // type:func -EnMu_Interact = 0x80A9505C; // type:func -EnMu_GetTextId = 0x80A951BC; // type:func -EnMu_UpdateTalkState = 0x80A95200; // type:func -EnMu_Init = 0x80A9526C; // type:func -EnMu_Destroy = 0x80A95344; // type:func -EnMu_Pose = 0x80A95368; // type:func -EnMu_Update = 0x80A953A0; // type:func -EnMu_OverrideLimbDraw = 0x80A954E8; // type:func -EnMu_PostLimbDraw = 0x80A955D4; // type:func -EnMu_DisplayListSetColor = 0x80A955EC; // type:func -EnMu_Draw = 0x80A95658; // type:func -EnNb_GetPath = 0x80A95970; // type:func -EnNb_GetType = 0x80A95984; // type:func -EnNb_UpdatePath = 0x80A95994; // type:func -EnNb_SetupCollider = 0x80A95AC0; // type:func -EnNb_UpdateCollider = 0x80A95B0C; // type:func -EnNb_Destroy = 0x80A95B50; // type:func -func_80AB0FBC = 0x80A95B7C; // type:func -func_80AB1040 = 0x80A95C04; // type:func -func_80AB10C4 = 0x80A95C8C; // type:func -EnNb_UpdateEyes = 0x80A95D30; // type:func -func_80AB1284 = 0x80A95DB8; // type:func -EnNb_UpdateSkelAnime = 0x80A95E00; // type:func -EnNb_GetCue = 0x80A95E24; // type:func -EnNb_SetStartPosRotFromCue1 = 0x80A95E4C; // type:func -func_80AB1390 = 0x80A95ECC; // type:func -func_80AB13D8 = 0x80A95F18; // type:func -EnNb_SetStartPosRotFromCue2 = 0x80A95F64; // type:func -EnNb_SetCurrentAnim = 0x80A95FE4; // type:func -EnNb_SetChamberAnim = 0x80A96074; // type:func -EnNb_SpawnBlueWarp = 0x80A960BC; // type:func -EnNb_GiveMedallion = 0x80A96118; // type:func -EnNb_ComeUpImpl = 0x80A96194; // type:func -EnNb_SetupChamberCsImpl = 0x80A961B4; // type:func -EnNb_SetupChamberWarpImpl = 0x80A96250; // type:func -EnNb_SetupDefaultChamberIdle = 0x80A962A0; // type:func -EnNb_SetupArmRaise = 0x80A962CC; // type:func -EnNb_SetupRaisedArmTransition = 0x80A96360; // type:func -EnNb_SetupMedallion = 0x80A963CC; // type:func -EnNb_SetupChamberCs = 0x80A96418; // type:func -EnNb_SetupChamberWarp = 0x80A96438; // type:func -EnNb_ComeUp = 0x80A96458; // type:func -func_80AB193C = 0x80A96494; // type:func -EnNb_RaiseArm = 0x80A964DC; // type:func -func_80AB19BC = 0x80A96520; // type:func -func_80AB19FC = 0x80A96568; // type:func -EnNb_SetupLightArrowOrSealingCs = 0x80A9659C; // type:func -EnNb_PlaySealingSfx = 0x80A965E0; // type:func -EnNb_InitializeDemo6K = 0x80A96600; // type:func -EnNb_SetupHide = 0x80A96680; // type:func -EnNb_CheckToFade = 0x80A966D4; // type:func -EnNb_SetupLightOrb = 0x80A96828; // type:func -EnNb_Hide = 0x80A968C4; // type:func -EnNb_Fade = 0x80A968E4; // type:func -EnNb_CreateLightOrb = 0x80A9692C; // type:func -EnNb_DrawTransparency = 0x80A96974; // type:func -EnNb_InitKidnap = 0x80A96ABC; // type:func -EnNb_PlayCrySFX = 0x80A96B14; // type:func -EnNb_PlayAgonySFX = 0x80A96B4C; // type:func -EnNb_SetPosInPortal = 0x80A96B84; // type:func -EnNb_SetupCaptureCutsceneState = 0x80A96C68; // type:func -EnNb_SetRaisedArmCaptureAnim = 0x80A96C9C; // type:func -EnNb_SetupLookAroundInKidnap = 0x80A96CFC; // type:func -EnNb_SetupKidnap = 0x80A96D70; // type:func -EnNb_CheckKidnapCsMode = 0x80A96DE8; // type:func -func_80AB23A8 = 0x80A96EB0; // type:func -EnNb_MovingInPortal = 0x80A96EE8; // type:func -EnNb_SuckedInByPortal = 0x80A96F44; // type:func -EnNb_SetupConfrontation = 0x80A96FA0; // type:func -EnNb_PlayKnuckleDefeatSFX = 0x80A96FE4; // type:func -EnNb_PlayKneelingOnGroundSFX = 0x80A97028; // type:func -EnNb_PlayLookRightSFX = 0x80A9708C; // type:func -EnNb_PlayLookLeftSFX = 0x80A970D8; // type:func -EnNb_InitDemo6KInConfrontation = 0x80A97130; // type:func -func_80AB2688 = 0x80A971A8; // type:func -func_80AB26C8 = 0x80A971E8; // type:func -func_80AB26DC = 0x80A97200; // type:func -EnNb_SetupKneel = 0x80A97298; // type:func -EnNb_CheckIfKneeling = 0x80A97314; // type:func -EnNb_SetupLookRight = 0x80A97380; // type:func -EnNb_CheckIfLookingRight = 0x80A97400; // type:func -EnNb_SetupLookLeft = 0x80A9746C; // type:func -EnNb_CheckIfLookLeft = 0x80A974EC; // type:func -EnNb_SetupDemo6KInConfrontation = 0x80A9754C; // type:func -EnNb_SetupRun = 0x80A9758C; // type:func -EnNb_SetupConfrontationDestroy = 0x80A9760C; // type:func -EnNb_CheckConfrontationCsMode = 0x80A97624; // type:func -EnNb_CheckConfrontationCsModeWrapper = 0x80A9770C; // type:func -func_80AB2C18 = 0x80A9772C; // type:func -EnNb_Kneel = 0x80A97778; // type:func -EnNb_LookRight = 0x80A977E8; // type:func -EnNb_LookLeft = 0x80A97858; // type:func -EnNb_Run = 0x80A978C0; // type:func -EnNb_ConfrontationDestroy = 0x80A97948; // type:func -func_80AB2E70 = 0x80A9799C; // type:func -func_80AB2FC0 = 0x80A97AB8; // type:func -func_80AB2FE4 = 0x80A97AE0; // type:func -EnNb_SetupCreditsSpawn = 0x80A97C1C; // type:func -EnNb_SetAlphaInCredits = 0x80A97C64; // type:func -EnNb_SetupCreditsFadeIn = 0x80A97CF0; // type:func -EnNb_SetupCreditsSit = 0x80A97D28; // type:func -EnNb_SetupCreditsHeadTurn = 0x80A97D74; // type:func -EnNb_CheckIfLookingUp = 0x80A97DB4; // type:func -EnNb_CheckCreditsCsModeImpl = 0x80A97DE8; // type:func -EnNb_CheckCreditsCsMode = 0x80A97E74; // type:func -EnNb_CreditsFade = 0x80A97E94; // type:func -func_80AB3428 = 0x80A97EE0; // type:func -EnNb_LookUp = 0x80A97F28; // type:func -EnNb_CrawlspaceSpawnCheck = 0x80A97F6C; // type:func -func_80AB359C = 0x80A98068; // type:func -EnNb_SetNoticeSFX = 0x80A9812C; // type:func -EnNb_GetNoticedStatus = 0x80A98154; // type:func -func_80AB36DC = 0x80A981AC; // type:func -EnNb_CheckNoticed = 0x80A9825C; // type:func -EnNb_SetupIdleCrawlspace = 0x80A982B4; // type:func -func_80AB3838 = 0x80A9830C; // type:func -EnNb_SetupPathMovement = 0x80A98388; // type:func -EnNb_SetTextIdAsChild = 0x80A983F0; // type:func -func_80AB3A7C = 0x80A9855C; // type:func -func_80AB3B04 = 0x80A985E8; // type:func -func_80AB3B7C = 0x80A98670; // type:func -EnNb_WaitForNotice = 0x80A986BC; // type:func -EnNb_StandUpAfterNotice = 0x80A98718; // type:func -EnNb_BlockCrawlspace = 0x80A98778; // type:func -EnNb_InitCrawlspaceDialogue = 0x80A987E0; // type:func -EnNb_FollowPath = 0x80A98848; // type:func -func_80AB3DB0 = 0x80A988C8; // type:func -func_80AB3E10 = 0x80A98930; // type:func -EnNb_Update = 0x80A98998; // type:func -EnNb_Init = 0x80A989E0; // type:func -EnNb_OverrideLimbDraw = 0x80A98AFC; // type:func -EnNb_PostLimbDraw = 0x80A98B8C; // type:func -EnNb_DrawNothing = 0x80A98C18; // type:func -EnNb_DrawDefault = 0x80A98C28; // type:func -EnNb_Draw = 0x80A98D6C; // type:func -EnNiw_Init = 0x80A99F40; // type:func -EnNiw_Destroy = 0x80A9A444; // type:func -func_80AB5BF8 = 0x80A9A470; // type:func -EnNiw_SpawnAttackCucco = 0x80A9A818; // type:func -func_80AB6100 = 0x80A9A960; // type:func -EnNiw_ResetAction = 0x80A9AADC; // type:func -func_80AB6324 = 0x80A9AB84; // type:func -func_80AB63A8 = 0x80A9AC08; // type:func -func_80AB6450 = 0x80A9ACB0; // type:func -func_80AB6570 = 0x80A9ADD0; // type:func -func_80AB6A38 = 0x80A9B29C; // type:func -func_80AB6BF8 = 0x80A9B45C; // type:func -func_80AB6D08 = 0x80A9B56C; // type:func -func_80AB6EB4 = 0x80A9B718; // type:func -func_80AB6F04 = 0x80A9B768; // type:func -func_80AB70A0 = 0x80A9B908; // type:func -func_80AB70F8 = 0x80A9B960; // type:func -func_80AB714C = 0x80A9B9B4; // type:func -func_80AB7204 = 0x80A9BA6C; // type:func -func_80AB7290 = 0x80A9BAFC; // type:func -func_80AB7328 = 0x80A9BB94; // type:func -func_80AB7420 = 0x80A9BC90; // type:func -func_80AB747C = 0x80A9BCEC; // type:func -EnNiw_Update = 0x80A9BDA4; // type:func -EnNiw_OverrideLimbDraw = 0x80A9C650; // type:func -EnNiw_Draw = 0x80A9C7A8; // type:func -EnNiw_SpawnFeather = 0x80A9C858; // type:func -EnNiw_UpdateEffects = 0x80A9C948; // type:func -EnNiw_DrawEffects = 0x80A9CAFC; // type:func -EnNiwGirl_Init = 0x80A9D270; // type:func -EnNiwGirl_Destroy = 0x80A9D410; // type:func -EnNiwGirl_Jump = 0x80A9D420; // type:func -func_80AB9210 = 0x80A9D4A4; // type:func -EnNiwGirl_Talk = 0x80A9D658; // type:func -func_80AB94D0 = 0x80A9D768; // type:func -EnNiwGirl_Update = 0x80A9D85C; // type:func -EnNiwGirlOverrideLimbDraw = 0x80A9DA84; // type:func -EnNiwGirl_Draw = 0x80A9DAEC; // type:func -EnNiwLady_Init = 0x80A9DD40; // type:func -EnNiwLady_Destroy = 0x80A9DE28; // type:func -EnNiwLady_ChoseAnimation = 0x80A9DE54; // type:func -func_80AB9F24 = 0x80A9E01C; // type:func -func_80ABA21C = 0x80A9E318; // type:func -func_80ABA244 = 0x80A9E344; // type:func -func_80ABA654 = 0x80A9E6C4; // type:func -func_80ABA778 = 0x80A9E7BC; // type:func -func_80ABA878 = 0x80A9E890; // type:func -func_80ABA9B8 = 0x80A9E9D4; // type:func -func_80ABAA9C = 0x80A9EAB8; // type:func -func_80ABAB08 = 0x80A9EB28; // type:func -func_80ABAC00 = 0x80A9EC20; // type:func -func_80ABAC84 = 0x80A9ECA8; // type:func -func_80ABAD38 = 0x80A9ED50; // type:func -func_80ABAD7C = 0x80A9ED70; // type:func -EnNiwLady_Update = 0x80A9EE34; // type:func -EnNiwLady_EmptyDList = 0x80A9F09C; // type:func -EnNiwLady_OverrideLimbDraw = 0x80A9F0C0; // type:func -EnNiwLady_Draw = 0x80A9F21C; // type:func -EnNutsball_Init = 0x80A9F640; // type:func -EnNutsball_Destroy = 0x80A9F6FC; // type:func -func_80ABBB34 = 0x80A9F728; // type:func -func_80ABBBA8 = 0x80A9F7A0; // type:func -EnNutsball_Update = 0x80A9F970; // type:func -EnNutsball_Draw = 0x80A9FA8C; // type:func -EnNwc_SetUpdate = 0x80A9FC60; // type:func -EnNwc_ChickNoop = 0x80A9FC6C; // type:func -EnNwc_ChickBgCheck = 0x80A9FC80; // type:func -EnNwc_ChickFall = 0x80A9FD7C; // type:func -EnNwc_UpdateChicks = 0x80A9FDE8; // type:func -EnNwc_DrawChicks = 0x80A9FFE8; // type:func -EnNwc_Init = 0x80AA0344; // type:func -EnNwc_Destroy = 0x80AA04D0; // type:func -EnNwc_Idle = 0x80AA04FC; // type:func -EnNwc_Update = 0x80AA051C; // type:func -EnNwc_Draw = 0x80AA0570; // type:func -EnNy_Init = 0x80AA0680; // type:func -EnNy_Destroy = 0x80AA07BC; // type:func -func_80ABCD40 = 0x80AA07E8; // type:func -func_80ABCD84 = 0x80AA0830; // type:func -func_80ABCD94 = 0x80AA0844; // type:func -func_80ABCDAC = 0x80AA0860; // type:func -func_80ABCDBC = 0x80AA0874; // type:func -EnNy_SetupTurnToStone = 0x80AA08B8; // type:func -func_80ABCE38 = 0x80AA08F4; // type:func -func_80ABCE50 = 0x80AA0910; // type:func -func_80ABCE90 = 0x80AA0950; // type:func -func_80ABCEEC = 0x80AA09AC; // type:func -EnNy_Move = 0x80AA0A0C; // type:func -EnNy_TurnToStone = 0x80AA0B20; // type:func -func_80ABD11C = 0x80AA0BE0; // type:func -EnNy_CollisionCheck = 0x80AA0C54; // type:func -func_80ABD3B8 = 0x80AA0E7C; // type:func -EnNy_Update = 0x80AA0F64; // type:func -EnNy_SetupDie = 0x80AA11F0; // type:func -EnNy_Die = 0x80AA1474; // type:func -EnNy_UpdateDeath = 0x80AA1680; // type:func -EnNy_UpdateUnused = 0x80AA16C0; // type:func -EnNy_Draw = 0x80AA17F0; // type:func -EnNy_DrawDeathEffect = 0x80AA1AC4; // type:func -EnOE2_SetupAction = 0x80AA1FC0; // type:func -EnOE2_Init = 0x80AA1FCC; // type:func -EnOE2_Destroy = 0x80AA1FF4; // type:func -EnOE2_DoNothing = 0x80AA2004; // type:func -EnOE2_Update = 0x80AA2014; // type:func -EnOE2_Draw = 0x80AA2024; // type:func -EnOkarinaEffect_SetupAction = 0x80AA20A0; // type:func -EnOkarinaEffect_Destroy = 0x80AA20AC; // type:func -EnOkarinaEffect_Init = 0x80AA212C; // type:func -EnOkarinaEffect_TriggerStorm = 0x80AA2174; // type:func -EnOkarinaEffect_ManageStorm = 0x80AA2200; // type:func -EnOkarinaEffect_Update = 0x80AA23D0; // type:func -EnOkarinaTag_Destroy = 0x80AA2460; // type:func -EnOkarinaTag_Init = 0x80AA2470; // type:func -func_80ABEF2C = 0x80AA25D8; // type:func -func_80ABF0CC = 0x80AA273C; // type:func -func_80ABF28C = 0x80AA28FC; // type:func -func_80ABF4C8 = 0x80AA2B44; // type:func -func_80ABF708 = 0x80AA2D84; // type:func -func_80ABF7CC = 0x80AA2E4C; // type:func -EnOkarinaTag_Update = 0x80AA2F10; // type:func -EnOkuta_Init = 0x80AA3960; // type:func -EnOkuta_Destroy = 0x80AA3B6C; // type:func -EnOkuta_SpawnBubbles = 0x80AA3B98; // type:func -EnOkuta_SpawnDust = 0x80AA3C44; // type:func -EnOkuta_SpawnSplash = 0x80AA3CAC; // type:func -EnOkuta_SpawnRipple = 0x80AA3CF0; // type:func -EnOkuta_SetupWaitToAppear = 0x80AA3D94; // type:func -EnOkuta_SetupAppear = 0x80AA3DC4; // type:func -EnOkuta_SetupHide = 0x80AA3E34; // type:func -EnOkuta_SetupWaitToShoot = 0x80AA3E74; // type:func -EnOkuta_SetupShoot = 0x80AA3ED4; // type:func -EnOkuta_SetupWaitToDie = 0x80AA3FC0; // type:func -EnOkuta_SetupDie = 0x80AA4048; // type:func -EnOkuta_SetupFreeze = 0x80AA4090; // type:func -EnOkuta_SpawnProjectile = 0x80AA40DC; // type:func -EnOkuta_WaitToAppear = 0x80AA421C; // type:func -EnOkuta_Appear = 0x80AA4278; // type:func -EnOkuta_Hide = 0x80AA43BC; // type:func -EnOkuta_WaitToShoot = 0x80AA44BC; // type:func -EnOkuta_Shoot = 0x80AA45EC; // type:func -EnOkuta_WaitToDie = 0x80AA476C; // type:func -EnOkuta_Die = 0x80AA47C0; // type:func -EnOkuta_Freeze = 0x80AA4AD4; // type:func -EnOkuta_ProjectileFly = 0x80AA4C50; // type:func -EnOkuta_UpdateHeadScale = 0x80AA4E9C; // type:func -EnOkuta_ColliderCheck = 0x80AA5244; // type:func -EnOkuta_Update = 0x80AA52F4; // type:func -EnOkuta_GetSnoutScale = 0x80AA5674; // type:func -EnOkuta_OverrideLimbDraw = 0x80AA58FC; // type:func -EnOkuta_Draw = 0x80AA59F8; // type:func -EnOssan_SetupAction = 0x80AA5F40; // type:func -ShopItemDisp_Default = 0x80AA5F4C; // type:func -ShopItemDisp_SpookyMask = 0x80AA5F64; // type:func -ShopItemDisp_SkullMask = 0x80AA5F98; // type:func -ShopItemDisp_BunnyHood = 0x80AA5FCC; // type:func -ShopItemDisp_ZoraMask = 0x80AA6000; // type:func -ShopItemDisp_GoronMask = 0x80AA6034; // type:func -ShopItemDisp_GerudoMask = 0x80AA6068; // type:func -EnOssan_SpawnItemsOnShelves = 0x80AA609C; // type:func -EnOssan_UpdateShopOfferings = 0x80AA61F0; // type:func -EnOssan_TalkDefaultShopkeeper = 0x80AA635C; // type:func -EnOssan_TalkKakarikoPotionShopkeeper = 0x80AA637C; // type:func -EnOssan_TalkMarketPotionShopkeeper = 0x80AA63C0; // type:func -EnOssan_TalkKokiriShopkeeper = 0x80AA63E0; // type:func -EnOssan_TalkBazaarShopkeeper = 0x80AA6400; // type:func -EnOssan_TalkBombchuShopkeeper = 0x80AA6444; // type:func -EnOssan_TalkZoraShopkeeper = 0x80AA6464; // type:func -EnOssan_TalkGoronShopkeeper = 0x80AA64BC; // type:func -EnOssan_TalkHappyMaskShopkeeper = 0x80AA6590; // type:func -EnOssan_UpdateCameraDirection = 0x80AA661C; // type:func -EnOssan_TryGetObjBankIndices = 0x80AA6680; // type:func -EnOssan_Init = 0x80AA6744; // type:func -EnOssan_Destroy = 0x80AA6910; // type:func -EnOssan_UpdateCursorPos = 0x80AA6950; // type:func -EnOssan_EndInteraction = 0x80AA69B4; // type:func -EnOssan_TestEndInteraction = 0x80AA6A78; // type:func -EnOssan_TestCancelOption = 0x80AA6AC0; // type:func -EnOssan_SetStateStartShopping = 0x80AA6B24; // type:func -EnOssan_StartShopping = 0x80AA6BA8; // type:func -EnOssan_ChooseTalkToOwner = 0x80AA6C80; // type:func -EnOssan_SetLookToShopkeeperFromShelf = 0x80AA6CE0; // type:func -EnOssan_State_Idle = 0x80AA6D14; // type:func -EnOssan_UpdateJoystickInputState = 0x80AA6DC4; // type:func -EnOssan_SetCursorIndexFromNeutral = 0x80AA6F10; // type:func -EnOssan_CursorRight = 0x80AA7048; // type:func -EnOssan_CursorLeft = 0x80AA70D4; // type:func -EnOssan_TryPaybackMask = 0x80AA713C; // type:func -EnOssan_State_StartConversation = 0x80AA7278; // type:func -EnOssan_FacingShopkeeperDialogResult = 0x80AA7420; // type:func -EnOssan_State_FacingShopkeeper = 0x80AA748C; // type:func -EnOssan_State_TalkingToShopkeeper = 0x80AA75A4; // type:func -EnOssan_State_LookToLeftShelf = 0x80AA75F8; // type:func -EnOssan_State_LookToRightShelf = 0x80AA76E4; // type:func -EnOssan_CursorUpDown = 0x80AA77D0; // type:func -EnOssan_HasPlayerSelectedItem = 0x80AA79E4; // type:func -EnOssan_State_BrowseLeftShelf = 0x80AA7B80; // type:func -EnOssan_State_BrowseRightShelf = 0x80AA7D40; // type:func -EnOssan_State_LookFromShelfToShopkeeper = 0x80AA7F00; // type:func -EnOssan_State_DisplayOnlyBombDialog = 0x80AA7FBC; // type:func -EnOssan_GiveItemWithFanfare = 0x80AA808C; // type:func -EnOssan_SetStateCantGetItem = 0x80AA8158; // type:func -EnOssan_SetStateQuickBuyDialog = 0x80AA818C; // type:func -EnOssan_HandleCanBuyItem = 0x80AA81C0; // type:func -EnOssan_HandleCanBuyLonLonMilk = 0x80AA8368; // type:func -EnOssan_HandleCanBuyWeirdEgg = 0x80AA8474; // type:func -EnOssan_HandleCanBuyBombs = 0x80AA85AC; // type:func -EnOssan_BuyGoronCityBombs = 0x80AA86B0; // type:func -EnOssan_State_ItemSelected = 0x80AA8754; // type:func -EnOssan_State_SelectMilkBottle = 0x80AA8828; // type:func -EnOssan_State_SelectWeirdEgg = 0x80AA88FC; // type:func -EnOssan_State_SelectUnimplementedItem = 0x80AA89D0; // type:func -EnOssan_State_SelectBombs = 0x80AA8A60; // type:func -EnOssan_State_SelectMaskItem = 0x80AA8B58; // type:func -EnOssan_State_CantGetItem = 0x80AA8D34; // type:func -EnOssan_State_QuickBuyDialog = 0x80AA8DB0; // type:func -EnOssan_State_GiveItemWithFanfare = 0x80AA8E58; // type:func -EnOssan_State_ItemPurchased = 0x80AA8EC8; // type:func -EnOssan_State_ContinueShoppingPrompt = 0x80AA900C; // type:func -EnOssan_State_WaitForDisplayOnlyBombDialog = 0x80AA91EC; // type:func -EnOssan_State_21 = 0x80AA9254; // type:func -EnOssan_State_22 = 0x80AA92C8; // type:func -EnOssan_State_GiveLonLonMilk = 0x80AA931C; // type:func -EnOssan_State_LendMaskOfTruth = 0x80AA9370; // type:func -EnOssan_SetStateGiveDiscountDialog = 0x80AA93E0; // type:func -EnOssan_State_GiveDiscountDialog = 0x80AA940C; // type:func -EnOssan_PositionSelectedItem = 0x80AA94A0; // type:func -EnOssan_ResetItemPosition = 0x80AA9588; // type:func -EnOssan_TakeItemOffShelf = 0x80AA95AC; // type:func -EnOssan_ReturnItemToShelf = 0x80AA9648; // type:func -EnOssan_UpdateItemSelectedProperty = 0x80AA96D4; // type:func -EnOssan_UpdateCursorAnim = 0x80AA9810; // type:func -EnOssan_UpdateStickDirectionPromptAnim = 0x80AA98E4; // type:func -EnOssan_WaitForBlink = 0x80AA9A94; // type:func -EnOssan_Blink = 0x80AA9AC8; // type:func -EnOssan_AreShopkeeperObjectsLoaded = 0x80AA9B68; // type:func -EnOssan_InitBazaarShopkeeper = 0x80AA9C04; // type:func -EnOssan_InitKokiriShopkeeper = 0x80AA9C64; // type:func -EnOssan_InitGoronShopkeeper = 0x80AA9D7C; // type:func -EnOssan_InitZoraShopkeeper = 0x80AA9E58; // type:func -EnOssan_InitPotionShopkeeper = 0x80AA9F34; // type:func -EnOssan_InitHappyMaskShopkeeper = 0x80AA9F94; // type:func -EnOssan_InitBombchuShopkeeper = 0x80AA9FF4; // type:func -EnOssan_SetupHelloDialog = 0x80AAA054; // type:func -EnOssan_InitActionFunc = 0x80AAA1BC; // type:func -EnOssan_Obj3ToSeg6 = 0x80AAA474; // type:func -EnOssan_MainActionFunc = 0x80AAA4AC; // type:func -EnOssan_Update = 0x80AAA5C8; // type:func -EnOssan_OverrideLimbDrawDefaultShopkeeper = 0x80AAA5F4; // type:func -EnOssan_DrawCursor = 0x80AAA62C; // type:func -EnOssan_DrawTextRec = 0x80AAA88C; // type:func -EnOssan_DrawStickDirectionPrompts = 0x80AAAA28; // type:func -EnOssan_DrawBazaarShopkeeper = 0x80AAADD0; // type:func -EnOssan_OverrideLimbDrawKokiriShopkeeper = 0x80AAAEC4; // type:func -EnOssan_EmptyDList = 0x80AAAFBC; // type:func -EnOssan_SetEnvColor = 0x80AAAFE0; // type:func -EnOssan_DrawKokiriShopkeeper = 0x80AAB04C; // type:func -EnOssan_DrawGoronShopkeeper = 0x80AAB1AC; // type:func -EnOssan_OverrideLimbDrawZoraShopkeeper = 0x80AAB2E0; // type:func -EnOssan_DrawZoraShopkeeper = 0x80AAB318; // type:func -EnOssan_DrawPotionShopkeeper = 0x80AAB45C; // type:func -EnOssan_DrawHappyMaskShopkeeper = 0x80AAB548; // type:func -EnOssan_DrawBombchuShopkeeper = 0x80AAB634; // type:func -EnOwl_Init = 0x80AAC520; // type:func -EnOwl_Destroy = 0x80AAC904; // type:func -EnOwl_LookAtLink = 0x80AAC930; // type:func -EnOwl_CheckInitTalk = 0x80AAC96C; // type:func -func_80ACA558 = 0x80AACAD8; // type:func -func_80ACA5C8 = 0x80AACB4C; // type:func -func_80ACA62C = 0x80AACBAC; // type:func -func_80ACA690 = 0x80AACBF8; // type:func -func_80ACA6C0 = 0x80AACC28; // type:func -func_80ACA71C = 0x80AACC84; // type:func -func_80ACA76C = 0x80AACCD0; // type:func -func_80ACA7E0 = 0x80AACD44; // type:func -EnOwl_ConfirmKokiriMessage = 0x80AACDF0; // type:func -EnOwl_WaitOutsideKokiri = 0x80AACE90; // type:func -func_80ACA998 = 0x80AACF08; // type:func -func_80ACAA54 = 0x80AACFC8; // type:func -func_80ACAAC0 = 0x80AAD038; // type:func -EnOwl_WaitHyruleCastle = 0x80AAD0A8; // type:func -func_80ACAB88 = 0x80AAD10C; // type:func -func_80ACAC6C = 0x80AAD1F4; // type:func -EnOwl_WaitKakariko = 0x80AAD264; // type:func -func_80ACAD34 = 0x80AAD2C8; // type:func -func_80ACADF0 = 0x80AAD388; // type:func -EnOwl_WaitGerudo = 0x80AAD3F8; // type:func -func_80ACAEB8 = 0x80AAD45C; // type:func -func_80ACAF74 = 0x80AAD51C; // type:func -EnOwl_WaitLakeHylia = 0x80AAD58C; // type:func -func_80ACB03C = 0x80AAD5F0; // type:func -EnOwl_WaitZoraRiver = 0x80AAD664; // type:func -func_80ACB148 = 0x80AAD704; // type:func -EnOwl_WaitHyliaShortcut = 0x80AAD764; // type:func -func_80ACB22C = 0x80AAD7F0; // type:func -func_80ACB274 = 0x80AAD83C; // type:func -EnOwl_WaitDeathMountainShortcut = 0x80AAD880; // type:func -func_80ACB344 = 0x80AAD914; // type:func -func_80ACB3E0 = 0x80AAD9B4; // type:func -func_80ACB440 = 0x80AADA1C; // type:func -func_80ACB4FC = 0x80AADADC; // type:func -EnOwl_WaitLWPreSaria = 0x80AADB4C; // type:func -func_80ACB5C4 = 0x80AADBB0; // type:func -func_80ACB680 = 0x80AADC70; // type:func -EnOwl_WaitLWPostSaria = 0x80AADCE0; // type:func -func_80ACB748 = 0x80AADD44; // type:func -func_80ACB904 = 0x80AADF00; // type:func -func_80ACB994 = 0x80AADF98; // type:func -EnOwl_WaitDefault = 0x80AAE030; // type:func -func_80ACBAB8 = 0x80AAE0C4; // type:func -func_80ACBC0C = 0x80AAE218; // type:func -func_80ACBD4C = 0x80AAE354; // type:func -func_80ACBEA0 = 0x80AAE4A8; // type:func -func_80ACBF50 = 0x80AAE558; // type:func -func_80ACC00C = 0x80AAE614; // type:func -func_80ACC23C = 0x80AAE7D8; // type:func -func_80ACC30C = 0x80AAE8A4; // type:func -func_80ACC390 = 0x80AAE928; // type:func -func_80ACC460 = 0x80AAE9F8; // type:func -func_80ACC540 = 0x80AAEAD8; // type:func -func_80ACC5CC = 0x80AAEB64; // type:func -func_80ACC624 = 0x80AAEBBC; // type:func -EnOwl_Update = 0x80AAEC38; // type:func -EnOwl_OverrideLimbDraw = 0x80AAF388; // type:func -EnOwl_PostLimbUpdate = 0x80AAF4B4; // type:func -EnOwl_Draw = 0x80AAF538; // type:func -EnOwl_ChangeMode = 0x80AAF604; // type:func -func_80ACD130 = 0x80AAF67C; // type:func -func_80ACD1C4 = 0x80AAF710; // type:func -func_80ACD220 = 0x80AAF770; // type:func -func_80ACD2CC = 0x80AAF81C; // type:func -func_80ACD4D4 = 0x80AAFA24; // type:func -EnPart_Init = 0x80AB00C0; // type:func -EnPart_Destroy = 0x80AB00D0; // type:func -func_80ACDDE8 = 0x80AB00E0; // type:func -func_80ACE13C = 0x80AB0434; // type:func -func_80ACE5B8 = 0x80AB08B0; // type:func -func_80ACE5C8 = 0x80AB08C4; // type:func -func_80ACE7E8 = 0x80AB0AE8; // type:func -EnPart_Update = 0x80AB0CE4; // type:func -func_80ACEAC0 = 0x80AB0DC4; // type:func -EnPart_Draw = 0x80AB0E7C; // type:func -EnPeehat_SetupAction = 0x80AB1720; // type:func -EnPeehat_Init = 0x80AB172C; // type:func -EnPeehat_Destroy = 0x80AB199C; // type:func -EnPeehat_SpawnDust = 0x80AB1A10; // type:func -EnPeehat_HitWhenGrounded = 0x80AB1BA8; // type:func -EnPeehat_Ground_SetStateGround = 0x80AB1DC4; // type:func -EnPeehat_Ground_StateGround = 0x80AB1E5C; // type:func -EnPeehat_Flying_SetStateGround = 0x80AB1FB0; // type:func -EnPeehat_Flying_StateGrounded = 0x80AB203C; // type:func -EnPeehat_Flying_SetStateFly = 0x80AB2140; // type:func -EnPeehat_Flying_StateFly = 0x80AB2188; // type:func -EnPeehat_Ground_SetStateRise = 0x80AB2300; // type:func -EnPeehat_Ground_StateRise = 0x80AB23A8; // type:func -EnPeehat_Flying_SetStateRise = 0x80AB2570; // type:func -EnPeehat_Flying_StateRise = 0x80AB2618; // type:func -EnPeehat_Ground_SetStateSeekPlayer = 0x80AB27E0; // type:func -EnPeehat_Ground_StateSeekPlayer = 0x80AB2830; // type:func -EnPeehat_Larva_SetStateSeekPlayer = 0x80AB29AC; // type:func -EnPeehat_Larva_StateSeekPlayer = 0x80AB29F8; // type:func -EnPeehat_Ground_SetStateLanding = 0x80AB2DD0; // type:func -EnPeehat_Ground_StateLanding = 0x80AB2E18; // type:func -EnPeehat_Flying_SetStateLanding = 0x80AB2FCC; // type:func -EnPeehat_Flying_StateLanding = 0x80AB3014; // type:func -EnPeehat_Ground_SetStateHover = 0x80AB31C4; // type:func -EnPeehat_Ground_StateHover = 0x80AB3254; // type:func -EnPeehat_Ground_SetStateReturnHome = 0x80AB34B0; // type:func -EnPeehat_Ground_StateReturnHome = 0x80AB34E8; // type:func -EnPeehat_SetStateAttackRecoil = 0x80AB36D4; // type:func -EnPeehat_StateAttackRecoil = 0x80AB3734; // type:func -EnPeehat_SetStateBoomerangStunned = 0x80AB3910; // type:func -EnPeehat_StateBoomerangStunned = 0x80AB3994; // type:func -EnPeehat_Adult_SetStateDie = 0x80AB3A10; // type:func -EnPeehat_Adult_StateDie = 0x80AB3A7C; // type:func -EnPeehat_SetStateExplode = 0x80AB3D3C; // type:func -EnPeehat_StateExplode = 0x80AB3D94; // type:func -EnPeehat_Adult_CollisionCheck = 0x80AB3E6C; // type:func -EnPeehat_Update = 0x80AB4058; // type:func -EnPeehat_OverrideLimbDraw = 0x80AB44BC; // type:func -EnPeehat_PostLimbDraw = 0x80AB4694; // type:func -EnPeehat_Draw = 0x80AB4848; // type:func -EnPoDesert_Init = 0x80AB4E20; // type:func -EnPoDesert_Destroy = 0x80AB4F90; // type:func -EnPoDesert_SetNextPathPoint = 0x80AB4FD8; // type:func -EnPoDesert_SetupMoveToNextPoint = 0x80AB5134; // type:func -EnPoDesert_SetupDisappear = 0x80AB5178; // type:func -EnPoDesert_UpdateSpeedModifier = 0x80AB51D8; // type:func -EnPoDesert_WaitForPlayer = 0x80AB5248; // type:func -EnPoDesert_MoveToNextPoint = 0x80AB5314; // type:func -EnPoDesert_Disappear = 0x80AB54A8; // type:func -EnPoDesert_Update = 0x80AB5590; // type:func -EnPoDesert_OverrideLimbDraw = 0x80AB5684; // type:func -EnPoDesert_PostLimbDraw = 0x80AB5710; // type:func -EnPoDesert_Draw = 0x80AB5964; // type:func -EnPoField_Init = 0x80AB5BE0; // type:func -EnPoField_Destroy = 0x80AB5DE8; // type:func -EnPoField_SetupWaitForSpawn = 0x80AB5E48; // type:func -EnPoField_SetupAppear = 0x80AB5F0C; // type:func -EnPoField_SetupCirclePlayer = 0x80AB602C; // type:func -EnPoField_SetupFlee = 0x80AB60D4; // type:func -EnPoField_SetupDamage = 0x80AB6168; // type:func -EnPoField_SetupDeath = 0x80AB6224; // type:func -EnPoField_SetupDisappear = 0x80AB6278; // type:func -EnPoField_SetupSoulIdle = 0x80AB62F0; // type:func -func_80AD42B0 = 0x80AB63A0; // type:func -func_80AD4384 = 0x80AB6474; // type:func -EnPoField_SetupSoulDisappear = 0x80AB652C; // type:func -EnPoField_SetupInteractWithSoul = 0x80AB6540; // type:func -EnPoField_CorrectYPos = 0x80AB6568; // type:func -EnPoField_SetFleeSpeed = 0x80AB664C; // type:func -EnPoField_WaitForSpawn = 0x80AB675C; // type:func -EnPoField_Appear = 0x80AB69C4; // type:func -EnPoField_CirclePlayer = 0x80AB6B60; // type:func -EnPoField_Flee = 0x80AB6DA0; // type:func -EnPoField_Damage = 0x80AB6F44; // type:func -EnPoField_Death = 0x80AB6FD4; // type:func -EnPoField_Disappear = 0x80AB73EC; // type:func -EnPoField_SoulIdle = 0x80AB74EC; // type:func -EnPoField_SoulUpdateProperties = 0x80AB75D0; // type:func -func_80AD587C = 0x80AB7978; // type:func -func_80AD58D4 = 0x80AB79D0; // type:func -EnPoField_SoulDisappear = 0x80AB7BD4; // type:func -EnPoField_SoulInteract = 0x80AB7C14; // type:func -EnPoField_TestForDamage = 0x80AB7D74; // type:func -EnPoField_SpawnFlame = 0x80AB7E0C; // type:func -EnPoField_UpdateFlame = 0x80AB7E60; // type:func -EnPoField_DrawFlame = 0x80AB7F8C; // type:func -func_80AD619C = 0x80AB8264; // type:func -func_80AD6330 = 0x80AB83F8; // type:func -EnPoField_Update = 0x80AB856C; // type:func -EnPoField_OverrideLimbDraw2 = 0x80AB8698; // type:func -EnPoField_PostLimDraw2 = 0x80AB87A0; // type:func -EnPoField_Draw = 0x80AB89B0; // type:func -EnPoField_UpdateDead = 0x80AB8C94; // type:func -EnPoField_DrawSoul = 0x80AB8CF0; // type:func -EnPoRelay_Init = 0x80AB9670; // type:func -EnPoRelay_Destroy = 0x80AB97F8; // type:func -EnPoRelay_SetupIdle = 0x80AB9840; // type:func -EnPoRelay_Vec3sToVec3f = 0x80AB987C; // type:func -EnPoRelay_SetupRace = 0x80AB98C0; // type:func -EnPoRelay_SetupEndRace = 0x80AB9988; // type:func -EnPoRelay_CorrectY = 0x80AB99C8; // type:func -EnPoRelay_Idle = 0x80AB9A70; // type:func -EnPoRelay_Talk = 0x80AB9B2C; // type:func -EnPoRelay_Race = 0x80AB9BA0; // type:func -EnPoRelay_EndRace = 0x80ABA0B4; // type:func -EnPoRelay_Talk2 = 0x80ABA174; // type:func -EnPoRelay_DisappearAndReward = 0x80ABA24C; // type:func -EnPoRelay_Update = 0x80ABA718; // type:func -EnPoRelay_PostLimbDraw = 0x80ABA80C; // type:func -EnPoRelay_Draw = 0x80ABAA00; // type:func -EnPoSisters_Init = 0x80ABAD80; // type:func -EnPoSisters_Destroy = 0x80ABAFCC; // type:func -func_80AD9240 = 0x80ABB034; // type:func -func_80AD9368 = 0x80ABB160; // type:func -func_80AD93C4 = 0x80ABB1BC; // type:func -func_80AD943C = 0x80ABB234; // type:func -func_80AD944C = 0x80ABB248; // type:func -func_80AD94E0 = 0x80ABB2DC; // type:func -func_80AD9568 = 0x80ABB364; // type:func -func_80AD95D8 = 0x80ABB3D4; // type:func -func_80AD96A4 = 0x80ABB4A0; // type:func -func_80AD9718 = 0x80ABB514; // type:func -func_80AD97C8 = 0x80ABB5C4; // type:func -func_80AD98F4 = 0x80ABB6F0; // type:func -func_80AD99D4 = 0x80ABB7D0; // type:func -func_80AD9A54 = 0x80ABB850; // type:func -func_80AD9AA8 = 0x80ABB8A4; // type:func -func_80AD9C24 = 0x80ABBA20; // type:func -func_80AD9D44 = 0x80ABBB40; // type:func -func_80AD9DF0 = 0x80ABBBEC; // type:func -func_80AD9E60 = 0x80ABBC5C; // type:func -func_80AD9F1C = 0x80ABBD18; // type:func -func_80AD9F90 = 0x80ABBD8C; // type:func -func_80ADA028 = 0x80ABBE24; // type:func -func_80ADA094 = 0x80ABBE90; // type:func -func_80ADA10C = 0x80ABBF08; // type:func -func_80ADA1B8 = 0x80ABBFB8; // type:func -func_80ADA25C = 0x80ABC05C; // type:func -func_80ADA2BC = 0x80ABC0BC; // type:func -func_80ADA35C = 0x80ABC15C; // type:func -func_80ADA4A8 = 0x80ABC2A8; // type:func -func_80ADA530 = 0x80ABC330; // type:func -func_80ADA6A0 = 0x80ABC4A0; // type:func -func_80ADA7F0 = 0x80ABC5F0; // type:func -func_80ADA8C0 = 0x80ABC6C0; // type:func -func_80ADA9E8 = 0x80ABC7E8; // type:func -func_80ADAAA4 = 0x80ABC8A4; // type:func -func_80ADAC70 = 0x80ABCA70; // type:func -func_80ADAD54 = 0x80ABCB54; // type:func -func_80ADAE6C = 0x80ABCC6C; // type:func -func_80ADAFC0 = 0x80ABCDC0; // type:func -func_80ADB17C = 0x80ABCF7C; // type:func -func_80ADB2B8 = 0x80ABD0B8; // type:func -func_80ADB338 = 0x80ABD134; // type:func -func_80ADB4B0 = 0x80ABD2B0; // type:func -func_80ADB51C = 0x80ABD31C; // type:func -func_80ADB770 = 0x80ABD570; // type:func -func_80ADB9F0 = 0x80ABD7F0; // type:func -func_80ADBB6C = 0x80ABD96C; // type:func -func_80ADBBF4 = 0x80ABD9F4; // type:func -func_80ADBC88 = 0x80ABDA88; // type:func -func_80ADBD38 = 0x80ABDB3C; // type:func -func_80ADBD8C = 0x80ABDB90; // type:func -func_80ADBEE8 = 0x80ABDCF0; // type:func -func_80ADBF58 = 0x80ABDD60; // type:func -func_80ADC034 = 0x80ABDE3C; // type:func -func_80ADC10C = 0x80ABDF14; // type:func -EnPoSisters_Update = 0x80ABE0D8; // type:func -func_80ADC55C = 0x80ABE36C; // type:func -EnPoSisters_OverrideLimbDraw = 0x80ABE58C; // type:func -EnPoSisters_PostLimbDraw = 0x80ABE77C; // type:func -EnPoSisters_Draw = 0x80ABEE4C; // type:func -EnPoh_Init = 0x80ABFA70; // type:func -EnPoh_Destroy = 0x80ABFDB8; // type:func -func_80ADE114 = 0x80ABFE38; // type:func -EnPoh_SetupIdle = 0x80ABFE90; // type:func -func_80ADE1BC = 0x80ABFEE0; // type:func -EnPoh_SetupAttack = 0x80ABFF30; // type:func -func_80ADE28C = 0x80ABFFB0; // type:func -func_80ADE368 = 0x80AC008C; // type:func -EnPoh_SetupInitialAction = 0x80AC0100; // type:func -func_80ADE48C = 0x80AC01B0; // type:func -func_80ADE4C8 = 0x80AC01F0; // type:func -func_80ADE514 = 0x80AC023C; // type:func -EnPoh_SetupDisappear = 0x80AC0294; // type:func -EnPoh_SetupAppear = 0x80AC02EC; // type:func -EnPoh_SetupDeath = 0x80AC0338; // type:func -func_80ADE6D4 = 0x80AC0404; // type:func -EnPoh_Talk = 0x80AC04F0; // type:func -func_80ADE950 = 0x80AC0688; // type:func -func_80ADE998 = 0x80AC06D4; // type:func -func_80ADE9BC = 0x80AC06FC; // type:func -EnPoh_MoveTowardsPlayerHeight = 0x80AC0710; // type:func -func_80ADEA5C = 0x80AC07A4; // type:func -func_80ADEAC4 = 0x80AC0814; // type:func -EnPoh_Idle = 0x80AC08D0; // type:func -func_80ADEC9C = 0x80AC09EC; // type:func -EnPoh_Attack = 0x80AC0B50; // type:func -func_80ADEECC = 0x80AC0C20; // type:func -func_80ADEF38 = 0x80AC0C8C; // type:func -EnPoh_ComposerAppear = 0x80AC0E0C; // type:func -func_80ADF15C = 0x80AC0EB0; // type:func -func_80ADF574 = 0x80AC12C8; // type:func -func_80ADF5E0 = 0x80AC1334; // type:func -EnPoh_Disappear = 0x80AC13B4; // type:func -EnPoh_Appear = 0x80AC14D0; // type:func -func_80ADF894 = 0x80AC15F0; // type:func -EnPoh_Death = 0x80AC16F0; // type:func -func_80ADFA90 = 0x80AC17F0; // type:func -func_80ADFE28 = 0x80AC1B88; // type:func -func_80ADFE80 = 0x80AC1BE0; // type:func -func_80AE009C = 0x80AC1DFC; // type:func -EnPoh_TalkRegular = 0x80AC1E3C; // type:func -EnPoh_TalkComposer = 0x80AC1F68; // type:func -func_80AE032C = 0x80AC2094; // type:func -EnPoh_UpdateVisibility = 0x80AC212C; // type:func -EnPoh_Update = 0x80AC229C; // type:func -func_80AE067C = 0x80AC23E8; // type:func -func_80AE089C = 0x80AC2608; // type:func -EnPoh_UpdateLiving = 0x80AC2788; // type:func -EnPoh_OverrideLimbDraw = 0x80AC2968; // type:func -EnPoh_PostLimbDraw = 0x80AC2A5C; // type:func -EnPoh_DrawRegular = 0x80AC2C4C; // type:func -EnPoh_DrawComposer = 0x80AC2E74; // type:func -EnPoh_UpdateDead = 0x80AC32F0; // type:func -EnPoh_DrawSoul = 0x80AC3344; // type:func -EnPubox_Init = 0x80AC3C60; // type:func -EnPubox_Destroy = 0x80AC3D98; // type:func -EnPubox_Update = 0x80AC3DCC; // type:func -EnPubox_Draw = 0x80AC3F1C; // type:func -EnRd_SetupAction = 0x80AC3FA0; // type:func -EnRd_Init = 0x80AC3FAC; // type:func -EnRd_Destroy = 0x80AC4198; // type:func -EnRd_UpdateMourningTarget = 0x80AC41DC; // type:func -EnRd_SetupIdle = 0x80AC4248; // type:func -EnRd_Idle = 0x80AC42F0; // type:func -EnRd_SetupRiseFromCoffin = 0x80AC451C; // type:func -EnRd_RiseFromCoffin = 0x80AC45BC; // type:func -EnRd_SetupWalkToPlayer = 0x80AC473C; // type:func -EnRd_WalkToPlayer = 0x80AC47C8; // type:func -EnRd_SetupWalkToHome = 0x80AC4AFC; // type:func -EnRd_WalkToHome = 0x80AC4B7C; // type:func -EnRd_SetupWalkToParent = 0x80AC4D90; // type:func -EnRd_WalkToParent = 0x80AC4E14; // type:func -EnRd_SetupGrab = 0x80AC4FA8; // type:func -EnRd_Grab = 0x80AC500C; // type:func -EnRd_SetupAttemptPlayerFreeze = 0x80AC5378; // type:func -EnRd_AttemptPlayerFreeze = 0x80AC53F0; // type:func -EnRd_SetupStandUp = 0x80AC54E8; // type:func -EnRd_StandUp = 0x80AC5534; // type:func -EnRd_SetupCrouch = 0x80AC5590; // type:func -EnRd_Crouch = 0x80AC5610; // type:func -EnRd_SetupDamaged = 0x80AC564C; // type:func -EnRd_Damaged = 0x80AC56D8; // type:func -EnRd_SetupDead = 0x80AC57E8; // type:func -EnRd_Dead = 0x80AC5860; // type:func -EnRd_SetupStunned = 0x80AC59AC; // type:func -EnRd_Stunned = 0x80AC5A98; // type:func -EnRd_TurnTowardsPlayer = 0x80AC5B6C; // type:func -EnRd_UpdateDamage = 0x80AC5CE4; // type:func -EnRd_Update = 0x80AC5EB0; // type:func -EnRd_OverrideLimbDraw = 0x80AC609C; // type:func -EnRd_PostLimbDraw = 0x80AC60F8; // type:func -EnRd_Draw = 0x80AC6240; // type:func -EnReeba_Init = 0x80AC6860; // type:func -EnReeba_Destroy = 0x80AC6A3C; // type:func -EnReeba_SetupSurface = 0x80AC6AB4; // type:func -EnReeba_Surface = 0x80AC6BC8; // type:func -EnReeba_Move = 0x80AC6DE8; // type:func -EnReeba_SetupMoveBig = 0x80AC6F04; // type:func -EnReeba_MoveBig = 0x80AC6F28; // type:func -EnReeba_Recoiled = 0x80AC7198; // type:func -EnReeba_SetupSink = 0x80AC7204; // type:func -EnReeba_Sink = 0x80AC725C; // type:func -EnReeba_SetupDamaged = 0x80AC736C; // type:func -EnReeba_Damaged = 0x80AC73D0; // type:func -EnReeba_SetupStunned = 0x80AC7468; // type:func -EnReeba_Stunned = 0x80AC74B8; // type:func -EnReeba_StunDie = 0x80AC761C; // type:func -EnReeba_SetupDie = 0x80AC7744; // type:func -EnReeba_Die = 0x80AC77B8; // type:func -EnReeba_StunRecover = 0x80AC7998; // type:func -EnReeba_CheckDamage = 0x80AC7A2C; // type:func -EnReeba_Update = 0x80AC7C68; // type:func -EnReeba_Draw = 0x80AC7F18; // type:func -EnRiverSound_Init = 0x80AC82D0; // type:func -EnRiverSound_Destroy = 0x80AC83A0; // type:func -EnRiverSound_FindClosestPointOnLineSegment = 0x80AC83F8; // type:func -EnRiverSound_GetSfxPos = 0x80AC8564; // type:func -EnRiverSound_Update = 0x80AC8860; // type:func -EnRiverSound_Draw = 0x80AC8A30; // type:func -EnRl_Destroy = 0x80AC8C60; // type:func -func_80AE72D0 = 0x80AC8C84; // type:func -func_80AE744C = 0x80AC8D0C; // type:func -func_80AE7494 = 0x80AC8D54; // type:func -func_80AE74B4 = 0x80AC8D78; // type:func -func_80AE74FC = 0x80AC8DC4; // type:func -func_80AE7544 = 0x80AC8E10; // type:func -func_80AE7590 = 0x80AC8E5C; // type:func -func_80AE7668 = 0x80AC8F3C; // type:func -func_80AE7698 = 0x80AC8F70; // type:func -func_80AE772C = 0x80AC9004; // type:func -func_80AE7798 = 0x80AC9070; // type:func -func_80AE77B8 = 0x80AC9090; // type:func -func_80AE77F8 = 0x80AC90D8; // type:func -func_80AE7838 = 0x80AC911C; // type:func -func_80AE7878 = 0x80AC9164; // type:func -func_80AE78D4 = 0x80AC91BC; // type:func -func_80AE7954 = 0x80AC923C; // type:func -func_80AE79A4 = 0x80AC928C; // type:func -func_80AE7AF8 = 0x80AC93E0; // type:func -func_80AE7BF8 = 0x80AC94EC; // type:func -func_80AE7C64 = 0x80AC9558; // type:func -func_80AE7C94 = 0x80AC9578; // type:func -func_80AE7CE8 = 0x80AC95C0; // type:func -func_80AE7D40 = 0x80AC9604; // type:func -func_80AE7D94 = 0x80AC964C; // type:func -EnRl_Update = 0x80AC9794; // type:func -EnRl_Init = 0x80AC97DC; // type:func -func_80AE7FD0 = 0x80AC9848; // type:func -func_80AE7FDC = 0x80AC9858; // type:func -EnRl_Draw = 0x80AC998C; // type:func -EnRr_Init = 0x80AC9B40; // type:func -EnRr_Destroy = 0x80AC9CE0; // type:func -EnRr_Move = 0x80AC9D20; // type:func -EnRr_SetupReach = 0x80AC9D48; // type:func -EnRr_SetupNeutral = 0x80AC9E48; // type:func -EnRr_SetupGrabPlayer = 0x80AC9F14; // type:func -EnRr_GetMessage = 0x80ACA01C; // type:func -EnRr_SetupReleasePlayer = 0x80ACA070; // type:func -EnRr_SetupDamage = 0x80ACA26C; // type:func -EnRr_SetupApproach = 0x80ACA338; // type:func -EnRr_SetupDeath = 0x80ACA3F0; // type:func -EnRr_SetupStunned = 0x80ACA490; // type:func -EnRr_CollisionCheck = 0x80ACA59C; // type:func -EnRr_InitBodySegments = 0x80ACA92C; // type:func -EnRr_UpdateBodySegments = 0x80ACAAEC; // type:func -EnRr_Approach = 0x80ACAC70; // type:func -EnRr_Reach = 0x80ACAD30; // type:func -EnRr_GrabPlayer = 0x80ACAE4C; // type:func -EnRr_Damage = 0x80ACAF44; // type:func -EnRr_Death = 0x80ACAFBC; // type:func -EnRr_Retreat = 0x80ACB330; // type:func -EnRr_Stunned = 0x80ACB3C4; // type:func -EnRr_Update = 0x80ACB42C; // type:func -EnRr_Draw = 0x80ACB858; // type:func -func_80AEAC10 = 0x80ACC070; // type:func -func_80AEAC54 = 0x80ACC0B4; // type:func -func_80AEACDC = 0x80ACC13C; // type:func -func_80AEAD20 = 0x80ACC180; // type:func -EnRu1_DestroyColliders = 0x80ACC1F8; // type:func -func_80AEADD8 = 0x80ACC238; // type:func -func_80AEADE0 = 0x80ACC244; // type:func -func_80AEADF0 = 0x80ACC258; // type:func -EnRu1_Destroy = 0x80ACC268; // type:func -EnRu1_UpdateEyes = 0x80ACC288; // type:func -EnRu1_SetEyeIndex = 0x80ACC310; // type:func -EnRu1_SetMouthIndex = 0x80ACC328; // type:func -func_80AEAECC = 0x80ACC340; // type:func -EnRu1_IsCsStateIdle = 0x80ACC3A8; // type:func -EnRu1_GetCue = 0x80ACC3C8; // type:func -func_80AEAFA0 = 0x80ACC414; // type:func -func_80AEAFE0 = 0x80ACC454; // type:func -func_80AEB020 = 0x80ACC494; // type:func -EnRu1_FindSwitch = 0x80ACC4FC; // type:func -func_80AEB0EC = 0x80ACC544; // type:func -func_80AEB104 = 0x80ACC55C; // type:func -func_80AEB124 = 0x80ACC57C; // type:func -func_80AEB174 = 0x80ACC5CC; // type:func -func_80AEB1B4 = 0x80ACC610; // type:func -func_80AEB264 = 0x80ACC63C; // type:func -EnRu1_UpdateSkelAnime = 0x80ACC6F8; // type:func -func_80AEB364 = 0x80ACC73C; // type:func -func_80AEB3A4 = 0x80ACC77C; // type:func -func_80AEB3CC = 0x80ACC7A4; // type:func -func_80AEB3DC = 0x80ACC7B8; // type:func -EnRu1_GetCueChannel3 = 0x80ACC814; // type:func -func_80AEB458 = 0x80ACC834; // type:func -func_80AEB480 = 0x80ACC85C; // type:func -EnRu1_SpawnRipple = 0x80ACC884; // type:func -func_80AEB50C = 0x80ACC8EC; // type:func -func_80AEB59C = 0x80ACC97C; // type:func -EnRu1_SpawnSplash = 0x80ACCA68; // type:func -func_80AEB6E0 = 0x80ACCACC; // type:func -func_80AEB738 = 0x80ACCB28; // type:func -func_80AEB7D0 = 0x80ACCBC0; // type:func -func_80AEB7E0 = 0x80ACCBD4; // type:func -func_80AEB87C = 0x80ACCC70; // type:func -func_80AEB89C = 0x80ACCC94; // type:func -func_80AEB914 = 0x80ACCD0C; // type:func -func_80AEB934 = 0x80ACCD2C; // type:func -func_80AEB954 = 0x80ACCD4C; // type:func -func_80AEB974 = 0x80ACCD6C; // type:func -func_80AEBA0C = 0x80ACCE04; // type:func -func_80AEBA2C = 0x80ACCE24; // type:func -func_80AEBAFC = 0x80ACCEF4; // type:func -func_80AEBB3C = 0x80ACCF38; // type:func -func_80AEBB78 = 0x80ACCF78; // type:func -func_80AEBBF4 = 0x80ACCFF8; // type:func -func_80AEBC30 = 0x80ACD038; // type:func -func_80AEBC84 = 0x80ACD090; // type:func -func_80AEBCB8 = 0x80ACD0C8; // type:func -func_80AEBD1C = 0x80ACD12C; // type:func -func_80AEBD94 = 0x80ACD1A4; // type:func -func_80AEBE3C = 0x80ACD24C; // type:func -func_80AEBEC8 = 0x80ACD2DC; // type:func -func_80AEBF60 = 0x80ACD374; // type:func -func_80AEBFD8 = 0x80ACD3F0; // type:func -func_80AEC070 = 0x80ACD488; // type:func -func_80AEC0B4 = 0x80ACD4D0; // type:func -func_80AEC100 = 0x80ACD524; // type:func -func_80AEC130 = 0x80ACD558; // type:func -func_80AEC17C = 0x80ACD5A8; // type:func -func_80AEC1D4 = 0x80ACD608; // type:func -func_80AEC244 = 0x80ACD67C; // type:func -func_80AEC2C0 = 0x80ACD6FC; // type:func -func_80AEC320 = 0x80ACD760; // type:func -func_80AEC40C = 0x80ACD854; // type:func -func_80AEC4CC = 0x80ACD914; // type:func -func_80AEC4F4 = 0x80ACD93C; // type:func -func_80AEC5FC = 0x80ACDA44; // type:func -func_80AEC650 = 0x80ACDA98; // type:func -func_80AEC6B0 = 0x80ACDAFC; // type:func -func_80AEC6E4 = 0x80ACDB34; // type:func -func_80AEC780 = 0x80ACDBD4; // type:func -func_80AEC81C = 0x80ACDC74; // type:func -func_80AEC8B8 = 0x80ACDD10; // type:func -func_80AEC93C = 0x80ACDD98; // type:func -func_80AEC9C4 = 0x80ACDE20; // type:func -func_80AECA18 = 0x80ACDE74; // type:func -func_80AECA44 = 0x80ACDEA4; // type:func -func_80AECA94 = 0x80ACDEF8; // type:func -func_80AECAB4 = 0x80ACDF18; // type:func -func_80AECAD4 = 0x80ACDF38; // type:func -func_80AECB18 = 0x80ACDF80; // type:func -func_80AECB60 = 0x80ACDFCC; // type:func -func_80AECBB8 = 0x80ACE028; // type:func -func_80AECC1C = 0x80ACE090; // type:func -func_80AECC84 = 0x80ACE0FC; // type:func -func_80AECCB0 = 0x80ACE128; // type:func -func_80AECDA0 = 0x80ACE218; // type:func -func_80AECE04 = 0x80ACE27C; // type:func -func_80AECE20 = 0x80ACE29C; // type:func -func_80AECEB4 = 0x80ACE32C; // type:func -func_80AECF6C = 0x80ACE3E4; // type:func -func_80AED084 = 0x80ACE4FC; // type:func -func_80AED0B0 = 0x80ACE528; // type:func -func_80AED0C8 = 0x80ACE540; // type:func -func_80AED0D8 = 0x80ACE554; // type:func -func_80AED110 = 0x80ACE58C; // type:func -func_80AED154 = 0x80ACE5D0; // type:func -func_80AED19C = 0x80ACE618; // type:func -func_80AED218 = 0x80ACE694; // type:func -func_80AED304 = 0x80ACE784; // type:func -func_80AED324 = 0x80ACE7A4; // type:func -func_80AED344 = 0x80ACE7C4; // type:func -func_80AED374 = 0x80ACE7F8; // type:func -func_80AED3A4 = 0x80ACE82C; // type:func -func_80AED3E0 = 0x80ACE86C; // type:func -func_80AED414 = 0x80ACE8A4; // type:func -func_80AED44C = 0x80ACE8E4; // type:func -func_80AED4FC = 0x80ACE998; // type:func -func_80AED520 = 0x80ACE9C0; // type:func -func_80AED57C = 0x80ACEA20; // type:func -func_80AED5B8 = 0x80ACEA60; // type:func -func_80AED5DC = 0x80ACEA88; // type:func -func_80AED600 = 0x80ACEAB0; // type:func -func_80AED624 = 0x80ACEAD8; // type:func -func_80AED6DC = 0x80ACEB90; // type:func -func_80AED6F8 = 0x80ACEBB0; // type:func -func_80AED738 = 0x80ACEBF0; // type:func -func_80AED83C = 0x80ACECF8; // type:func -func_80AED8DC = 0x80ACED9C; // type:func -func_80AEDAE0 = 0x80ACEFA0; // type:func -func_80AEDB30 = 0x80ACEFF4; // type:func -func_80AEDEF4 = 0x80ACF3B4; // type:func -func_80AEDFF4 = 0x80ACF4B8; // type:func -func_80AEE02C = 0x80ACF4F8; // type:func -func_80AEE050 = 0x80ACF520; // type:func -func_80AEE264 = 0x80ACF73C; // type:func -func_80AEE2F8 = 0x80ACF7D0; // type:func -func_80AEE394 = 0x80ACF86C; // type:func -func_80AEE488 = 0x80ACF960; // type:func -func_80AEE568 = 0x80ACFA40; // type:func -func_80AEE628 = 0x80ACFB04; // type:func -func_80AEE6D0 = 0x80ACFBA8; // type:func -func_80AEE7C4 = 0x80ACFC9C; // type:func -func_80AEEAC8 = 0x80ACFFBC; // type:func -func_80AEEB24 = 0x80AD0018; // type:func -func_80AEEBB4 = 0x80AD00A8; // type:func -func_80AEEBD4 = 0x80AD00C8; // type:func -func_80AEEC5C = 0x80AD0154; // type:func -func_80AEECF0 = 0x80AD01EC; // type:func -func_80AEED58 = 0x80AD0258; // type:func -func_80AEEDCC = 0x80AD02D0; // type:func -func_80AEEE34 = 0x80AD033C; // type:func -func_80AEEE9C = 0x80AD03A8; // type:func -func_80AEEF08 = 0x80AD0418; // type:func -func_80AEEF5C = 0x80AD0470; // type:func -func_80AEEF68 = 0x80AD0480; // type:func -func_80AEEFEC = 0x80AD0508; // type:func -func_80AEF080 = 0x80AD059C; // type:func -func_80AEF0BC = 0x80AD05DC; // type:func -func_80AEF170 = 0x80AD0694; // type:func -func_80AEF188 = 0x80AD06AC; // type:func -func_80AEF1F0 = 0x80AD0714; // type:func -func_80AEF29C = 0x80AD07C0; // type:func -func_80AEF2AC = 0x80AD07D4; // type:func -func_80AEF2D0 = 0x80AD07FC; // type:func -func_80AEF354 = 0x80AD0888; // type:func -func_80AEF3A8 = 0x80AD08E4; // type:func -func_80AEF40C = 0x80AD094C; // type:func -func_80AEF4A8 = 0x80AD09EC; // type:func -func_80AEF4E0 = 0x80AD0A24; // type:func -func_80AEF51C = 0x80AD0A64; // type:func -func_80AEF540 = 0x80AD0A8C; // type:func -func_80AEF5B8 = 0x80AD0B08; // type:func -func_80AEF624 = 0x80AD0B78; // type:func -func_80AEF728 = 0x80AD0C7C; // type:func -func_80AEF79C = 0x80AD0CF0; // type:func -func_80AEF820 = 0x80AD0D78; // type:func -func_80AEF890 = 0x80AD0DE8; // type:func -func_80AEF930 = 0x80AD0E74; // type:func -func_80AEF99C = 0x80AD0EE4; // type:func -func_80AEF9D8 = 0x80AD0F20; // type:func -func_80AEFA2C = 0x80AD0F64; // type:func -func_80AEFAAC = 0x80AD0FDC; // type:func -func_80AEFB04 = 0x80AD1024; // type:func -func_80AEFB68 = 0x80AD1080; // type:func -func_80AEFBC8 = 0x80AD10D8; // type:func -func_80AEFC24 = 0x80AD1138; // type:func -func_80AEFC54 = 0x80AD116C; // type:func -func_80AEFCE8 = 0x80AD1208; // type:func -func_80AEFD38 = 0x80AD1258; // type:func -func_80AEFDC0 = 0x80AD12E4; // type:func -func_80AEFE38 = 0x80AD1368; // type:func -func_80AEFE84 = 0x80AD13B4; // type:func -func_80AEFE9C = 0x80AD13CC; // type:func -func_80AEFECC = 0x80AD1400; // type:func -func_80AEFF40 = 0x80AD147C; // type:func -func_80AEFF94 = 0x80AD14D8; // type:func -EnRu1_Update = 0x80AD1574; // type:func -EnRu1_Init = 0x80AD15BC; // type:func -func_80AF0278 = 0x80AD16F8; // type:func -EnRu1_OverrideLimbDraw = 0x80AD1768; // type:func -EnRu1_PostLimbDraw = 0x80AD17D4; // type:func -EnRu1_DrawNothing = 0x80AD1860; // type:func -EnRu1_DrawOpa = 0x80AD1870; // type:func -EnRu1_DrawXlu = 0x80AD1A14; // type:func -EnRu1_Draw = 0x80AD1BB4; // type:func -func_80AF2550 = 0x80AD3710; // type:func -func_80AF259C = 0x80AD375C; // type:func -EnRu2_Destroy = 0x80AD37A0; // type:func -func_80AF2608 = 0x80AD37CC; // type:func -func_80AF2690 = 0x80AD3854; // type:func -func_80AF26A0 = 0x80AD3868; // type:func -func_80AF2744 = 0x80AD3878; // type:func -EnRu2_UpdateSkelAnime = 0x80AD38C0; // type:func -EnRu2_GetCue = 0x80AD38E4; // type:func -func_80AF27D0 = 0x80AD390C; // type:func -func_80AF281C = 0x80AD3958; // type:func -func_80AF2868 = 0x80AD39A4; // type:func -func_80AF28E8 = 0x80AD3A24; // type:func -func_80AF2978 = 0x80AD3AB4; // type:func -func_80AF2994 = 0x80AD3AD4; // type:func -func_80AF29DC = 0x80AD3B1C; // type:func -func_80AF2A38 = 0x80AD3B78; // type:func -func_80AF2AB4 = 0x80AD3BF4; // type:func -func_80AF2B44 = 0x80AD3C90; // type:func -func_80AF2B94 = 0x80AD3CE0; // type:func -func_80AF2BC0 = 0x80AD3D0C; // type:func -func_80AF2C54 = 0x80AD3DA0; // type:func -func_80AF2C68 = 0x80AD3DB4; // type:func -func_80AF2CB4 = 0x80AD3E00; // type:func -func_80AF2CD4 = 0x80AD3E20; // type:func -func_80AF2CF4 = 0x80AD3E40; // type:func -func_80AF2D2C = 0x80AD3E7C; // type:func -func_80AF2D6C = 0x80AD3EC4; // type:func -func_80AF2DAC = 0x80AD3F08; // type:func -func_80AF2DEC = 0x80AD3F50; // type:func -func_80AF2E1C = 0x80AD3F84; // type:func -func_80AF2E64 = 0x80AD3FC8; // type:func -func_80AF2E84 = 0x80AD3FE8; // type:func -func_80AF2F04 = 0x80AD4068; // type:func -func_80AF2F58 = 0x80AD40BC; // type:func -func_80AF30AC = 0x80AD4210; // type:func -func_80AF3144 = 0x80AD42AC; // type:func -func_80AF3174 = 0x80AD42CC; // type:func -func_80AF31C8 = 0x80AD4314; // type:func -func_80AF321C = 0x80AD435C; // type:func -func_80AF3394 = 0x80AD44A4; // type:func -func_80AF33E0 = 0x80AD44EC; // type:func -func_80AF346C = 0x80AD4578; // type:func -func_80AF34A4 = 0x80AD45B0; // type:func -func_80AF34F0 = 0x80AD45FC; // type:func -func_80AF3530 = 0x80AD463C; // type:func -func_80AF3564 = 0x80AD4670; // type:func -func_80AF3604 = 0x80AD46FC; // type:func -func_80AF3624 = 0x80AD471C; // type:func -func_80AF366C = 0x80AD4768; // type:func -func_80AF36AC = 0x80AD47B0; // type:func -func_80AF36EC = 0x80AD47F4; // type:func -func_80AF3718 = 0x80AD4824; // type:func -func_80AF3744 = 0x80AD4854; // type:func -func_80AF37AC = 0x80AD48BC; // type:func -func_80AF37CC = 0x80AD48DC; // type:func -func_80AF383C = 0x80AD4948; // type:func -func_80AF3878 = 0x80AD4984; // type:func -func_80AF38D0 = 0x80AD49E4; // type:func -func_80AF390C = 0x80AD4A20; // type:func -func_80AF39DC = 0x80AD4AF0; // type:func -func_80AF3ADC = 0x80AD4BDC; // type:func -func_80AF3B74 = 0x80AD4C74; // type:func -func_80AF3BC8 = 0x80AD4CC8; // type:func -func_80AF3C04 = 0x80AD4D0C; // type:func -func_80AF3C64 = 0x80AD4D74; // type:func -func_80AF3CB8 = 0x80AD4DD0; // type:func -func_80AF3D0C = 0x80AD4E2C; // type:func -func_80AF3D60 = 0x80AD4E88; // type:func -EnRu2_Update = 0x80AD4EEC; // type:func -EnRu2_Init = 0x80AD4F34; // type:func -func_80AF3F14 = 0x80AD502C; // type:func -func_80AF3F20 = 0x80AD503C; // type:func -EnRu2_Draw = 0x80AD5170; // type:func -func_80AF5560 = 0x80AD6490; // type:func -EnSa_GetTextId = 0x80AD6510; // type:func -EnSa_UpdateTalkState = 0x80AD6624; // type:func -func_80AF57D8 = 0x80AD6708; // type:func -func_80AF5894 = 0x80AD67C8; // type:func -func_80AF58B8 = 0x80AD67F0; // type:func -func_80AF594C = 0x80AD6884; // type:func -func_80AF59E0 = 0x80AD6918; // type:func -func_80AF5A74 = 0x80AD69AC; // type:func -func_80AF5B10 = 0x80AD6A48; // type:func -func_80AF5BA4 = 0x80AD6ADC; // type:func -func_80AF5C40 = 0x80AD6B78; // type:func -func_80AF5CD4 = 0x80AD6C0C; // type:func -func_80AF5CE4 = 0x80AD6C24; // type:func -EnSa_ChangeAnim = 0x80AD6CCC; // type:func -func_80AF5DFC = 0x80AD6D3C; // type:func -func_80AF5F34 = 0x80AD6E74; // type:func -func_80AF603C = 0x80AD6F7C; // type:func -func_80AF609C = 0x80AD6FDC; // type:func -func_80AF6130 = 0x80AD7078; // type:func -func_80AF6170 = 0x80AD70BC; // type:func -EnSa_Init = 0x80AD7100; // type:func -EnSa_Destroy = 0x80AD7370; // type:func -func_80AF6448 = 0x80AD739C; // type:func -func_80AF67D0 = 0x80AD7728; // type:func -func_80AF683C = 0x80AD779C; // type:func -func_80AF68E4 = 0x80AD7844; // type:func -func_80AF6B20 = 0x80AD7A84; // type:func -EnSa_Update = 0x80AD7B44; // type:func -EnSa_OverrideLimbDraw = 0x80AD7CD4; // type:func -EnSa_PostLimbDraw = 0x80AD7E7C; // type:func -EnSa_Draw = 0x80AD7ED8; // type:func -EnSb_Init = 0x80AD8700; // type:func -EnSb_Destroy = 0x80AD87E8; // type:func -EnSb_SpawnBubbles = 0x80AD8828; // type:func -EnSb_SetupWaitClosed = 0x80AD88D8; // type:func -EnSb_SetupOpen = 0x80AD8950; // type:func -EnSb_SetupWaitOpen = 0x80AD89CC; // type:func -EnSb_SetupLunge = 0x80AD8A40; // type:func -EnSb_SetupBounce = 0x80AD8AE8; // type:func -EnSb_SetupCooldown = 0x80AD8B60; // type:func -EnSb_WaitClosed = 0x80AD8C64; // type:func -EnSb_Open = 0x80AD8CE4; // type:func -EnSb_WaitOpen = 0x80AD8DAC; // type:func -EnSb_TurnAround = 0x80AD8E60; // type:func -EnSb_Lunge = 0x80AD8F4C; // type:func -EnSb_Bounce = 0x80AD8FF4; // type:func -EnSb_Cooldown = 0x80AD9128; // type:func -EnSb_IsVulnerable = 0x80AD9190; // type:func -EnSb_UpdateDamage = 0x80AD92D8; // type:func -EnSb_Update = 0x80AD95B4; // type:func -EnSb_PostLimbDraw = 0x80AD9734; // type:func -EnSb_Draw = 0x80AD9784; // type:func -EnSceneChange_SetupAction = 0x80AD9B40; // type:func -EnSceneChange_Init = 0x80AD9B4C; // type:func -EnSceneChange_Destroy = 0x80AD9B74; // type:func -EnSceneChange_DoNothing = 0x80AD9B84; // type:func -EnSceneChange_Update = 0x80AD9B94; // type:func -EnSceneChange_Draw = 0x80AD9BB8; // type:func -EnSda_Init = 0x80AD9C70; // type:func -EnSda_Destroy = 0x80AD9C80; // type:func -EnSda_Update = 0x80AD9C90; // type:func -EnSda_Draw = 0x80AD9CCC; // type:func -func_80AF8F60 = 0x80AD9D60; // type:func -func_80AF95C4 = 0x80ADA3C4; // type:func -func_80AF9C70 = 0x80ADAA40; // type:func -EnShopnuts_Init = 0x80ADB360; // type:func -EnShopnuts_Destroy = 0x80ADB49C; // type:func -EnShopnuts_SetupIdle = 0x80ADB4C8; // type:func -EnShopnuts_SetupLookAround = 0x80ADB530; // type:func -EnShopnuts_SetupThrowNut = 0x80ADB578; // type:func -EnShopnuts_SetupPeek = 0x80ADB5B8; // type:func -EnShopnuts_SetupBurrow = 0x80ADB620; // type:func -EnShopnuts_SetupSpawnSalesman = 0x80ADB670; // type:func -EnShopnuts_Idle = 0x80ADB6C8; // type:func -EnShopnuts_LookAround = 0x80ADB92C; // type:func -EnShopnuts_Peek = 0x80ADB9B0; // type:func -EnShopnuts_ThrowNut = 0x80ADBA74; // type:func -EnShopnuts_Burrow = 0x80ADBBB0; // type:func -EnShopnuts_SpawnSalesman = 0x80ADBC74; // type:func -EnShopnuts_ColliderCheck = 0x80ADBD10; // type:func -EnShopnuts_Update = 0x80ADBD70; // type:func -EnShopnuts_OverrideLimbDraw = 0x80ADBEB0; // type:func -EnShopnuts_PostLimbDraw = 0x80ADBEE8; // type:func -EnShopnuts_Draw = 0x80ADC088; // type:func -EnSi_Init = 0x80ADC270; // type:func -EnSi_Destroy = 0x80ADC300; // type:func -func_80AFB748 = 0x80ADC32C; // type:func -func_80AFB768 = 0x80ADC350; // type:func -func_80AFB89C = 0x80ADC484; // type:func -func_80AFB950 = 0x80ADC53C; // type:func -EnSi_Update = 0x80ADC5D0; // type:func -EnSi_Draw = 0x80ADC644; // type:func -EnSiofuki_Init = 0x80ADC770; // type:func -EnSiofuki_Destroy = 0x80ADC98C; // type:func -func_80AFBDC8 = 0x80ADC9C0; // type:func -func_80AFBE8C = 0x80ADCA80; // type:func -func_80AFC1D0 = 0x80ADCDCC; // type:func -func_80AFC218 = 0x80ADCE14; // type:func -func_80AFC34C = 0x80ADCF50; // type:func -func_80AFC3C8 = 0x80ADCFD4; // type:func -func_80AFC478 = 0x80ADD08C; // type:func -func_80AFC544 = 0x80ADD160; // type:func -EnSiofuki_Update = 0x80ADD198; // type:func -EnSiofuki_Draw = 0x80ADD1BC; // type:func -EnSkb_SetupAction = 0x80ADD520; // type:func -EnSkb_SpawnDebris = 0x80ADD52C; // type:func -EnSkb_Init = 0x80ADD6DC; // type:func -EnSkb_Destroy = 0x80ADD894; // type:func -EnSkb_DecideNextAction = 0x80ADD8EC; // type:func -EnSkb_SetupRiseFromGround = 0x80ADD988; // type:func -EnSkb_RiseFromGround = 0x80ADD9EC; // type:func -EnSkb_SetupDespawn = 0x80ADDAD8; // type:func -EnSkb_Despawn = 0x80ADDB80; // type:func -EnSkb_SetupWalkForward = 0x80ADDC34; // type:func -EnSkb_WalkForward = 0x80ADDCCC; // type:func -EnSkb_SetupAttack = 0x80ADDECC; // type:func -EnSkb_Attack = 0x80ADDF64; // type:func -EnSkb_SetupRecoil = 0x80ADE010; // type:func -EnSkb_Recoil = 0x80ADE09C; // type:func -EnSkb_SetupStunned = 0x80ADE0D8; // type:func -EnSkb_Stunned = 0x80ADE134; // type:func -EnSkb_SetupTakeDamage = 0x80ADE1DC; // type:func -EnSkb_TakeDamage = 0x80ADE264; // type:func -EnSkb_SetupDeath = 0x80ADE350; // type:func -EnSkb_Death = 0x80ADE41C; // type:func -EnSkb_CheckDamage = 0x80ADE508; // type:func -EnSkb_Update = 0x80ADE7B8; // type:func -EnSkb_OverrideLimbDraw = 0x80ADE8E0; // type:func -EnSkb_PostLimbDraw = 0x80ADEAB0; // type:func -EnSkb_Draw = 0x80ADEB58; // type:func -EnSkj_ChangeAnim = 0x80ADEE10; // type:func -EnSkj_SetupAction = 0x80ADEE98; // type:func -EnSkj_CalculateCenter = 0x80ADEEF0; // type:func -EnSkj_SetNaviId = 0x80ADEF88; // type:func -EnSkj_Init = 0x80ADF00C; // type:func -EnSkj_Destroy = 0x80ADF358; // type:func -EnSkj_RangeCheck = 0x80ADF384; // type:func -EnSkj_GetItemXzRange = 0x80ADF400; // type:func -EnSkj_GetItemYRange = 0x80ADF448; // type:func -EnSkj_ShootNeedle = 0x80ADF474; // type:func -EnSkj_SpawnBlood = 0x80ADF58C; // type:func -EnSkj_CollisionCheck = 0x80ADF6E4; // type:func -func_80AFEDF8 = 0x80ADF8A0; // type:func -EnSkj_Backflip = 0x80ADF92C; // type:func -EnSkj_Fade = 0x80ADF974; // type:func -EnSkj_SetupWaitToShootNeedle = 0x80ADFA04; // type:func -EnSkj_WaitToShootNeedle = 0x80ADFA40; // type:func -EnSkj_SetupResetFight = 0x80ADFAE0; // type:func -EnSkj_SariasSongKidIdle = 0x80ADFB24; // type:func -EnSkj_SetupDie = 0x80ADFC1C; // type:func -EnSkj_WaitForDeathAnim = 0x80ADFC50; // type:func -func_80AFF1F0 = 0x80ADFCA4; // type:func -EnSkj_PickNextFightAction = 0x80ADFCD8; // type:func -func_80AFF2A0 = 0x80ADFD58; // type:func -EnSkj_WaitForLandAnim = 0x80ADFD9C; // type:func -func_80AFF334 = 0x80ADFDF0; // type:func -EnSkj_ResetFight = 0x80ADFE3C; // type:func -EnSkj_SetupStand = 0x80ADFE8C; // type:func -EnSkj_Fight = 0x80ADFEE0; // type:func -EnSkj_SetupNeedleRecover = 0x80AE00AC; // type:func -EnSkj_NeedleRecover = 0x80AE00E0; // type:func -EnSkj_SetupSpawnDeathEffect = 0x80AE011C; // type:func -EnSkj_SpawnDeathEffect = 0x80AE0144; // type:func -EnSkj_SetupWaitInRange = 0x80AE025C; // type:func -EnSkj_WaitInRange = 0x80AE0294; // type:func -EnSkj_SetupWaitForSong = 0x80AE04A8; // type:func -EnSkj_WaitForSong = 0x80AE04CC; // type:func -EnSkj_SetupAfterSong = 0x80AE07A0; // type:func -EnSkj_AfterSong = 0x80AE07D4; // type:func -EnSkj_SetupTalk = 0x80AE0828; // type:func -EnSkj_SariaSongTalk = 0x80AE0848; // type:func -func_80AFFE24 = 0x80AE08EC; // type:func -func_80AFFE44 = 0x80AE090C; // type:func -EnSkj_SetupPostSariasSong = 0x80AE0984; // type:func -EnSkj_ChangeModeAfterSong = 0x80AE09A4; // type:func -EnSkj_SetupMaskTrade = 0x80AE0A0C; // type:func -EnSkj_StartMaskTrade = 0x80AE0A2C; // type:func -EnSkj_JumpFromStump = 0x80AE0A94; // type:func -EnSkj_WaitForLanding = 0x80AE0AF8; // type:func -EnSkj_SetupWaitForLandAnimFinish = 0x80AE0B48; // type:func -EnSkj_WaitForLandAnimFinish = 0x80AE0B7C; // type:func -EnSkj_SetupWalkToPlayer = 0x80AE0BD0; // type:func -EnSkj_WalkToPlayer = 0x80AE0C14; // type:func -EnSkj_SetupAskForMask = 0x80AE0CB0; // type:func -EnSkj_AskForMask = 0x80AE0CF8; // type:func -EnSkj_SetupTakeMask = 0x80AE0D90; // type:func -EnSkj_TakeMask = 0x80AE0DC8; // type:func -EnSkj_SetupWaitForMaskTextClear = 0x80AE0E60; // type:func -EnSkj_WaitForMaskTextClear = 0x80AE0E80; // type:func -EnSkj_SetupWrongSong = 0x80AE0EE8; // type:func -EnSkj_WrongSong = 0x80AE0F20; // type:func -EnSkj_SetupWaitForTextClear = 0x80AE0F74; // type:func -EnSkj_SariasSongWaitForTextClear = 0x80AE0F94; // type:func -EnSkj_OcarinaGameSetupWaitForPlayer = 0x80AE100C; // type:func -EnSkj_OcarinaGameWaitForPlayer = 0x80AE104C; // type:func -EnSkj_IsLeavingGame = 0x80AE1088; // type:func -EnSkj_SetupIdle = 0x80AE10D8; // type:func -EnSkj_Appear = 0x80AE110C; // type:func -EnSkj_OcarinaGameIdle = 0x80AE1134; // type:func -EnSkj_SetupPlayOcarinaGame = 0x80AE1180; // type:func -EnSkj_PlayOcarinaGame = 0x80AE11B4; // type:func -EnSkj_SetupLeaveOcarinaGame = 0x80AE1200; // type:func -EnSkj_LeaveOcarinaGame = 0x80AE1248; // type:func -EnSkj_Update = 0x80AE1290; // type:func -EnSkj_SariasSongShortStumpUpdate = 0x80AE1474; // type:func -EnSkj_TurnPlayer = 0x80AE149C; // type:func -EnSkj_SetupWaitForOcarina = 0x80AE14E8; // type:func -EnSkj_WaitForOcarina = 0x80AE15A4; // type:func -EnSkj_StartOcarinaMinigame = 0x80AE164C; // type:func -EnSkj_WaitForPlayback = 0x80AE16D8; // type:func -EnSkj_FailedMiniGame = 0x80AE1948; // type:func -EnSkj_WaitForNextRound = 0x80AE1988; // type:func -EnSkj_OfferNextRound = 0x80AE19D8; // type:func -EnSkj_WaitForOfferResponse = 0x80AE1A14; // type:func -EnSkj_WonOcarinaMiniGame = 0x80AE1ABC; // type:func -EnSkj_WaitToGiveReward = 0x80AE1AFC; // type:func -EnSkj_GiveOcarinaGameReward = 0x80AE1B84; // type:func -EnSkj_FinishOcarinaGameRound = 0x80AE1BF8; // type:func -EnSkj_CleanupOcarinaGame = 0x80AE1C94; // type:func -EnSkj_OcarinaMinigameShortStumpUpdate = 0x80AE1D10; // type:func -EnSkj_OverrideLimbDraw = 0x80AE1D94; // type:func -EnSkj_PostLimbDraw = 0x80AE1DB0; // type:func -EnSkj_TranslucentDL = 0x80AE1E80; // type:func -EnSkj_OpaqueDL = 0x80AE1ED8; // type:func -EnSkj_Draw = 0x80AE1F10; // type:func -EnSkjneedle_Init = 0x80AE2760; // type:func -EnSkjneedle_Destroy = 0x80AE27F8; // type:func -EnSkjNeedle_CollisionCheck = 0x80AE2824; // type:func -EnSkjneedle_Update = 0x80AE2854; // type:func -EnSkjneedle_Draw = 0x80AE2944; // type:func -EnSsh_SetupAction = 0x80AE2A70; // type:func -EnSsh_SpawnShockwave = 0x80AE2A7C; // type:func -EnSsh_CreateBlureEffect = 0x80AE2B04; // type:func -EnSsh_CheckCeilingPos = 0x80AE2C00; // type:func -EnSsh_AddBlureVertex = 0x80AE2C98; // type:func -EnSsh_AddBlureSpace = 0x80AE2DA0; // type:func -EnSsh_InitColliders = 0x80AE2DCC; // type:func -EnSsh_SetAnimation = 0x80AE2F0C; // type:func -EnSsh_SetWaitAnimation = 0x80AE3040; // type:func -EnSsh_SetReturnAnimation = 0x80AE3060; // type:func -EnSsh_SetLandAnimation = 0x80AE3094; // type:func -EnSsh_SetDropAnimation = 0x80AE30D8; // type:func -EnSsh_SetStunned = 0x80AE3128; // type:func -EnSsh_SetColliderScale = 0x80AE3154; // type:func -EnSsh_Damaged = 0x80AE32C8; // type:func -EnSsh_Turn = 0x80AE33A4; // type:func -EnSsh_Stunned = 0x80AE3478; // type:func -EnSsh_UpdateYaw = 0x80AE3518; // type:func -EnSsh_Bob = 0x80AE3554; // type:func -EnSsh_IsCloseToLink = 0x80AE35C0; // type:func -EnSsh_IsCloseToHome = 0x80AE36A8; // type:func -EnSsh_IsCloseToGround = 0x80AE36E0; // type:func -EnSsh_Sway = 0x80AE3720; // type:func -EnSsh_CheckBodyStickHit = 0x80AE3864; // type:func -EnSsh_CheckHitPlayer = 0x80AE38D8; // type:func -EnSsh_CheckHitFront = 0x80AE39E0; // type:func -EnSsh_CheckHitBack = 0x80AE3A3C; // type:func -EnSsh_CollisionCheck = 0x80AE3B14; // type:func -EnSsh_SetBodyCylinderAC = 0x80AE3BC8; // type:func -EnSsh_SetLegsCylinderAC = 0x80AE3C0C; // type:func -EnSsh_SetCylinderOC = 0x80AE3CC4; // type:func -EnSsh_SetColliders = 0x80AE3E9C; // type:func -EnSsh_Init = 0x80AE3F64; // type:func -EnSsh_Destroy = 0x80AE40F8; // type:func -EnSsh_Wait = 0x80AE4178; // type:func -EnSsh_Talk = 0x80AE41D4; // type:func -EnSsh_Idle = 0x80AE4220; // type:func -EnSsh_Land = 0x80AE44B8; // type:func -EnSsh_Drop = 0x80AE45A0; // type:func -EnSsh_Return = 0x80AE46A0; // type:func -EnSsh_UpdateColliderScale = 0x80AE4774; // type:func -EnSsh_Start = 0x80AE481C; // type:func -EnSsh_Update = 0x80AE48A4; // type:func -EnSsh_OverrideLimbDraw = 0x80AE49C4; // type:func -EnSsh_PostLimbDraw = 0x80AE4AB4; // type:func -EnSsh_Draw = 0x80AE4AF0; // type:func -EnSt_SetupAction = 0x80AE5060; // type:func -EnSt_SpawnDust = 0x80AE506C; // type:func -EnSt_SpawnBlastEffect = 0x80AE528C; // type:func -EnSt_SpawnDeadEffect = 0x80AE5314; // type:func -EnSt_CreateBlureEffect = 0x80AE5450; // type:func -EnSt_CheckCeilingPos = 0x80AE554C; // type:func -EnSt_AddBlurVertex = 0x80AE561C; // type:func -EnSt_AddBlurSpace = 0x80AE5724; // type:func -EnSt_SetWaitingAnimation = 0x80AE5750; // type:func -EnSt_SetReturnToCeilingAnimation = 0x80AE5780; // type:func -EnSt_SetLandAnimation = 0x80AE57C0; // type:func -EnSt_SetDropAnimAndVel = 0x80AE581C; // type:func -EnSt_InitColliders = 0x80AE587C; // type:func -EnSt_CheckBodyStickHit = 0x80AE59BC; // type:func -EnSt_SetBodyCylinderAC = 0x80AE5A30; // type:func -EnSt_SetLegsCylinderAC = 0x80AE5A74; // type:func -EnSt_SetCylinderOC = 0x80AE5B2C; // type:func -EnSt_UpdateCylinders = 0x80AE5D04; // type:func -EnSt_CheckHitPlayer = 0x80AE5DC8; // type:func -EnSt_CheckHitFrontside = 0x80AE5EB4; // type:func -EnSt_CheckHitBackside = 0x80AE5EF4; // type:func -EnSt_CheckColliders = 0x80AE60E4; // type:func -EnSt_SetColliderScale = 0x80AE616C; // type:func -EnSt_SetTeethColor = 0x80AE62D8; // type:func -EnSt_DecrStunTimer = 0x80AE6408; // type:func -EnSt_UpdateYaw = 0x80AE6428; // type:func -EnSt_IsDoneBouncing = 0x80AE66C8; // type:func -EnSt_Bob = 0x80AE6790; // type:func -EnSt_IsCloseToPlayer = 0x80AE67FC; // type:func -EnSt_IsCloseToInitalPos = 0x80AE68A4; // type:func -EnSt_IsCloseToGround = 0x80AE68DC; // type:func -EnSt_Sway = 0x80AE691C; // type:func -EnSt_Init = 0x80AE6AEC; // type:func -EnSt_Destroy = 0x80AE6C10; // type:func -EnSt_WaitOnCeiling = 0x80AE6C90; // type:func -EnSt_WaitOnGround = 0x80AE6CEC; // type:func -EnSt_LandOnGround = 0x80AE6DE4; // type:func -EnSt_MoveToGround = 0x80AE6EE8; // type:func -EnSt_ReturnToCeiling = 0x80AE6FE0; // type:func -EnSt_BounceAround = 0x80AE70B4; // type:func -EnSt_FinishBouncing = 0x80AE7188; // type:func -EnSt_Die = 0x80AE72FC; // type:func -EnSt_StartOnCeilingOrGround = 0x80AE7374; // type:func -EnSt_Update = 0x80AE73F8; // type:func -EnSt_OverrideLimbDraw = 0x80AE7578; // type:func -EnSt_PostLimbDraw = 0x80AE7658; // type:func -EnSt_Draw = 0x80AE7694; // type:func -EnSth_SetupAction = 0x80AE7CD0; // type:func -EnSth_Init = 0x80AE7CDC; // type:func -EnSth_SetupShapeColliderUpdate2AndDraw = 0x80AE7DD8; // type:func -EnSth_SetupAfterObjectLoaded = 0x80AE7E5C; // type:func -EnSth_Destroy = 0x80AE7F80; // type:func -EnSth_WaitForObject = 0x80AE7FAC; // type:func -EnSth_FacePlayer = 0x80AE8000; // type:func -EnSth_LookAtPlayer = 0x80AE8118; // type:func -EnSth_RewardObtainedTalk = 0x80AE822C; // type:func -EnSth_ParentRewardObtainedWait = 0x80AE82A8; // type:func -EnSth_GivePlayerItem = 0x80AE8334; // type:func -EnSth_GiveReward = 0x80AE83D0; // type:func -EnSth_RewardUnobtainedTalk = 0x80AE8450; // type:func -EnSth_RewardUnobtainedWait = 0x80AE84CC; // type:func -EnSth_ChildRewardObtainedWait = 0x80AE8570; // type:func -EnSth_Update = 0x80AE861C; // type:func -EnSth_Update2 = 0x80AE8640; // type:func -EnSth_OverrideLimbDraw = 0x80AE8744; // type:func -EnSth_PostLimbDraw = 0x80AE88A0; // type:func -EnSth_AllocColorDList = 0x80AE8918; // type:func -EnSth_Draw = 0x80AE8984; // type:func -EnStream_SetupAction = 0x80AEBD90; // type:func -EnStream_Init = 0x80AEBD9C; // type:func -EnStream_Destroy = 0x80AEBE04; // type:func -func_80B0B81C = 0x80AEBE14; // type:func -EnStream_SuckPlayer = 0x80AEBF34; // type:func -EnStream_WaitForPlayer = 0x80AEC0CC; // type:func -EnStream_Update = 0x80AEC120; // type:func -EnStream_Draw = 0x80AEC154; // type:func -EnSw_CrossProduct = 0x80AEC320; // type:func -func_80B0BE20 = 0x80AEC394; // type:func -func_80B0C020 = 0x80AEC594; // type:func -func_80B0C0CC = 0x80AEC644; // type:func -EnSw_Init = 0x80AECA78; // type:func -EnSw_Destroy = 0x80AECF40; // type:func -func_80B0C9F0 = 0x80AECF6C; // type:func -func_80B0CBE8 = 0x80AED168; // type:func -func_80B0CCF4 = 0x80AED274; // type:func -func_80B0CEA8 = 0x80AED428; // type:func -func_80B0CF44 = 0x80AED4C8; // type:func -func_80B0D14C = 0x80AED6D0; // type:func -func_80B0D364 = 0x80AED8E8; // type:func -func_80B0D3AC = 0x80AED930; // type:func -func_80B0D590 = 0x80AEDB18; // type:func -func_80B0D878 = 0x80AEDE00; // type:func -func_80B0DB00 = 0x80AEE088; // type:func -func_80B0DC7C = 0x80AEE208; // type:func -func_80B0DE34 = 0x80AEE3C4; // type:func -func_80B0DEA8 = 0x80AEE440; // type:func -func_80B0DFFC = 0x80AEE594; // type:func -func_80B0E314 = 0x80AEE8AC; // type:func -func_80B0E430 = 0x80AEE9C4; // type:func -func_80B0E5E0 = 0x80AEEB74; // type:func -func_80B0E728 = 0x80AEECC0; // type:func -func_80B0E90C = 0x80AEEEA4; // type:func -func_80B0E9BC = 0x80AEEF54; // type:func -EnSw_Update = 0x80AEF004; // type:func -EnSw_OverrideLimbDraw = 0x80AEF060; // type:func -EnSw_PostLimbDraw = 0x80AEF304; // type:func -func_80B0EDB8 = 0x80AEF31C; // type:func -func_80B0EEA4 = 0x80AEF3D4; // type:func -EnSw_Draw = 0x80AEF400; // type:func -EnSyatekiItm_Init = 0x80AEFB10; // type:func -EnSyatekiItm_Destroy = 0x80AEFC74; // type:func -EnSyatekiItm_Idle = 0x80AEFC84; // type:func -EnSyatekiItm_StartRound = 0x80AEFD94; // type:func -EnSyatekiItm_SpawnTargets = 0x80AEFF10; // type:func -EnSyatekiItm_CheckTargets = 0x80AF0390; // type:func -EnSyatekiItm_CleanupGame = 0x80AF0434; // type:func -EnSyatekiItm_EndGame = 0x80AF04BC; // type:func -EnSyatekiItm_Update = 0x80AF0508; // type:func -EnSyatekiMan_Init = 0x80AF08B0; // type:func -EnSyatekiMan_Destroy = 0x80AF0964; // type:func -EnSyatekiMan_Start = 0x80AF0974; // type:func -EnSyatekiMan_SetupIdle = 0x80AF0A08; // type:func -EnSyatekiMan_Idle = 0x80AF0A60; // type:func -EnSyatekiMan_Talk = 0x80AF0ABC; // type:func -EnSyatekiMan_StopTalk = 0x80AF0C64; // type:func -EnSyatekiMan_StartGame = 0x80AF0D0C; // type:func -EnSyatekiMan_WaitForGame = 0x80AF0DCC; // type:func -EnSyatekiMan_EndGame = 0x80AF0EE8; // type:func -EnSyatekiMan_GivePrize = 0x80AF1138; // type:func -EnSyatekiMan_FinishPrize = 0x80AF11A8; // type:func -EnSyatekiMan_RestartGame = 0x80AF126C; // type:func -EnSyatekiMan_BlinkWait = 0x80AF12D4; // type:func -EnSyatekiMan_Blink = 0x80AF1308; // type:func -EnSyatekiMan_Update = 0x80AF13A8; // type:func -EnSyatekiMan_OverrideLimbDraw = 0x80AF1448; // type:func -EnSyatekiMan_Draw = 0x80AF14D8; // type:func -EnSyatekiNiw_Init = 0x80AF1670; // type:func -EnSyatekiNiw_Destroy = 0x80AF17B8; // type:func -EnSyatekiNiw_UpdateRotations = 0x80AF17E4; // type:func -EnSyatekiNiw_SetupDefault = 0x80AF1B40; // type:func -EnSyatekiNiw_Default = 0x80AF1BCC; // type:func -EnSyatekiNiw_SetupArchery = 0x80AF20FC; // type:func -EnSyatekiNiw_Archery = 0x80AF21B4; // type:func -EnSyatekiNiw_ExitArchery = 0x80AF2630; // type:func -EnSyatekiNiw_SetupRemove = 0x80AF2650; // type:func -EnSyatekiNiw_Remove = 0x80AF2748; // type:func -EnSyatekiNiw_CheckHit = 0x80AF2904; // type:func -EnSyatekiNiw_Update = 0x80AF29D4; // type:func -SyatekiNiw_OverrideLimbDraw = 0x80AF2D44; // type:func -EnSyatekiNiw_Draw = 0x80AF2E74; // type:func -EnSyatekiNiw_SpawnFeather = 0x80AF2F20; // type:func -EnSyatekiNiw_UpdateEffects = 0x80AF3010; // type:func -EnSyatekiNiw_DrawEffects = 0x80AF31CC; // type:func -EnTa_SetupAction = 0x80AF3700; // type:func -EnTa_SetTextForTalkInLonLonHouse = 0x80AF3710; // type:func -EnTa_Init = 0x80AF37F0; // type:func -EnTa_DecreaseShadowSize = 0x80AF3E74; // type:func -EnTa_Destroy = 0x80AF3EA8; // type:func -EnTa_RequestTalk = 0x80AF3F20; // type:func -EnTa_SleepTalkInKakariko = 0x80AF3FC8; // type:func -EnTa_SleepTalkInLonLonHouse = 0x80AF4008; // type:func -EnTa_SetupAwake = 0x80AF4048; // type:func -EnTa_TalkWakingUp2 = 0x80AF40C4; // type:func -EnTa_TalkWakingUp1 = 0x80AF4110; // type:func -EnTa_WakeUp = 0x80AF41AC; // type:func -EnTa_SleepTalkInCastle = 0x80AF4238; // type:func -EnTa_IdleAsleepInCastle = 0x80AF4278; // type:func -EnTa_IdleAsleepInLonLonHouse = 0x80AF4340; // type:func -EnTa_IdleAsleepInKakariko = 0x80AF43A4; // type:func -EnTa_RunWithAccelerationAndSfx = 0x80AF446C; // type:func -EnTa_RunAwayRunOutOfGate = 0x80AF44EC; // type:func -EnTa_RunAwayTurnTowardsGate = 0x80AF4560; // type:func -EnTa_RunAwayRunWest = 0x80AF45C0; // type:func -EnTa_RunAwayTurnWest = 0x80AF4648; // type:func -EnTa_RunAwayRunSouth = 0x80AF46A8; // type:func -EnTa_RunAwayStart = 0x80AF4748; // type:func -EnTa_TalkAwakeInCastle = 0x80AF47C0; // type:func -EnTa_IdleAwakeInCastle = 0x80AF486C; // type:func -EnTa_TalkAwakeInKakariko = 0x80AF48B8; // type:func -EnTa_IdleAwakeInKakariko = 0x80AF4904; // type:func -EnTa_TalkAtRanch = 0x80AF49AC; // type:func -EnTa_IdleAtRanch = 0x80AF49F8; // type:func -EnTa_CheckCanBuyMilk = 0x80AF4A3C; // type:func -EnTa_CreateFloorCamera = 0x80AF4A8C; // type:func -EnTa_RemoveFloorCamera = 0x80AF4B40; // type:func -EnTa_SetupActionWithSleepAnimation = 0x80AF4B84; // type:func -EnTa_SetupActionWithWakeUpAnimation = 0x80AF4C14; // type:func -EnTa_TalkNotEnoughRupees = 0x80AF4CA0; // type:func -EnTa_IsPlayerHoldingSuperCucco = 0x80AF4D18; // type:func -EnTa_TalkFoundSuperCucco = 0x80AF4D6C; // type:func -EnTa_IdleFoundSuperCucco = 0x80AF4ECC; // type:func -EnTa_GetSuperCuccosCount = 0x80AF4F3C; // type:func -EnTa_AnimateHandsUpDown = 0x80AF4F78; // type:func -EnTa_TransitionToPostCuccoGame = 0x80AF5044; // type:func -EnTa_TalkCuccoGameEnd = 0x80AF5094; // type:func -EnTa_RunCuccoGame = 0x80AF5170; // type:func -EnTa_ThrowSuperCuccos = 0x80AF54D0; // type:func -EnTa_StartingCuccoGame3 = 0x80AF5748; // type:func -EnTa_StartingCuccoGame2 = 0x80AF586C; // type:func -EnTa_StartingCuccoGame1 = 0x80AF593C; // type:func -EnTa_StartCuccoGame = 0x80AF5A04; // type:func -EnTa_TalkGeneralInLonLonHouse = 0x80AF5A9C; // type:func -EnTa_GiveItemInLonLonHouse = 0x80AF5AF8; // type:func -EnTa_TalkAfterCuccoGameFirstWon = 0x80AF5BCC; // type:func -EnTa_WaitBuyMilkOrPlayCuccoGameResponse = 0x80AF5C64; // type:func -EnTa_WaitForPlayCuccoGameResponse = 0x80AF5E40; // type:func -EnTa_WaitForMarryMalonResponse = 0x80AF5F68; // type:func -EnTa_ContinueTalkInLonLonHouse = 0x80AF5FE8; // type:func -EnTa_TalkAfterCuccoGameWon = 0x80AF60B4; // type:func -EnTa_IdleSittingInLonLonHouse = 0x80AF618C; // type:func -EnTa_IdleAfterCuccoGameFinished = 0x80AF628C; // type:func -EnTa_BlinkWaitUntilNext = 0x80AF6350; // type:func -EnTa_BlinkAdvanceState = 0x80AF6384; // type:func -EnTa_AnimRepeatCurrent = 0x80AF6444; // type:func -EnTa_AnimSleeping = 0x80AF6484; // type:func -EnTa_AnimSitSleeping = 0x80AF64D8; // type:func -EnTa_AnimRunToEnd = 0x80AF65B8; // type:func -EnTa_Update = 0x80AF6610; // type:func -EnTa_OverrideLimbDraw = 0x80AF67A0; // type:func -EnTa_PostLimbDraw = 0x80AF6924; // type:func -EnTa_Draw = 0x80AF6964; // type:func -EnTakaraMan_Destroy = 0x80AF70C0; // type:func -EnTakaraMan_Init = 0x80AF70D0; // type:func -func_80B176E0 = 0x80AF721C; // type:func -func_80B1778C = 0x80AF72C8; // type:func -func_80B17934 = 0x80AF7470; // type:func -func_80B17A6C = 0x80AF75A8; // type:func -func_80B17AC4 = 0x80AF7604; // type:func -func_80B17B14 = 0x80AF7658; // type:func -EnTakaraMan_Update = 0x80AF76BC; // type:func -EnTakaraMan_OverrideLimbDraw = 0x80AF7794; // type:func -EnTakaraMan_Draw = 0x80AF77FC; // type:func -EnTana_Init = 0x80AF7980; // type:func -EnTana_Destroy = 0x80AF79D0; // type:func -EnTana_Update = 0x80AF79E0; // type:func -EnTana_DrawWoodenShelves = 0x80AF79F0; // type:func -EnTana_DrawStoneShelves = 0x80AF7A88; // type:func -EnTg_GetTextId = 0x80AF7C30; // type:func -EnTg_UpdateTalkState = 0x80AF7CCC; // type:func -EnTg_Init = 0x80AF7D88; // type:func -EnTg_Destroy = 0x80AF7E5C; // type:func -EnTg_SpinIfNotTalking = 0x80AF7E9C; // type:func -EnTg_Update = 0x80AF7EC0; // type:func -EnTg_OverrideLimbDraw = 0x80AF7FE0; // type:func -EnTg_PostLimbDraw = 0x80AF7FFC; // type:func -EnTg_SetColor = 0x80AF8058; // type:func -EnTg_Draw = 0x80AF80C4; // type:func -EnTite_SetupAction = 0x80AF8310; // type:func -EnTite_Init = 0x80AF831C; // type:func -EnTite_Destroy = 0x80AF8474; // type:func -EnTite_SetupIdle = 0x80AF84BC; // type:func -EnTite_Idle = 0x80AF8524; // type:func -EnTite_SetupAttack = 0x80AF8668; // type:func -EnTite_Attack = 0x80AF86DC; // type:func -EnTite_SetupTurnTowardPlayer = 0x80AF8D84; // type:func -EnTite_TurnTowardPlayer = 0x80AF8E20; // type:func -EnTite_SetupMoveTowardPlayer = 0x80AF90BC; // type:func -EnTite_MoveTowardPlayer = 0x80AF9178; // type:func -EnTite_SetupRecoil = 0x80AF9688; // type:func -EnTite_Recoil = 0x80AF96F4; // type:func -EnTite_SetupStunned = 0x80AF9A4C; // type:func -EnTite_Stunned = 0x80AF9B00; // type:func -EnTite_SetupDeathCry = 0x80AF9E9C; // type:func -EnTite_DeathCry = 0x80AF9ED0; // type:func -EnTite_FallApart = 0x80AF9F44; // type:func -EnTite_SetupFlipOnBack = 0x80AF9FD0; // type:func -EnTite_FlipOnBack = 0x80AFA0EC; // type:func -EnTite_SetupFlipUpright = 0x80AFA2A8; // type:func -EnTite_FlipUpright = 0x80AFA2F8; // type:func -EnTite_CheckDamage = 0x80AFA420; // type:func -EnTite_Update = 0x80AFA5F8; // type:func -EnTite_PostLimbDraw = 0x80AFA9E4; // type:func -EnTite_Draw = 0x80AFAAD4; // type:func -EnTkEff_Create = 0x80AFB0B0; // type:func -EnTkEff_Update = 0x80AFB154; // type:func -EnTkEff_Draw = 0x80AFB260; // type:func -EnTkEff_CreateDflt = 0x80AFB558; // type:func -EnTk_RestAnim = 0x80AFB610; // type:func -EnTk_WalkAnim = 0x80AFB68C; // type:func -EnTk_DigAnim = 0x80AFB700; // type:func -EnTk_UpdateEyes = 0x80AFB780; // type:func -EnTk_CheckFacingPlayer = 0x80AFB844; // type:func -EnTk_CheckNextSpot = 0x80AFB8C8; // type:func -EnTk_CheckCurrentSpot = 0x80AFB9B0; // type:func -EnTk_Step = 0x80AFBA28; // type:func -EnTk_Orient = 0x80AFBB50; // type:func -EnTk_GetTextId = 0x80AFBCC0; // type:func -EnTk_UpdateTalkState = 0x80AFBD14; // type:func -EnTk_ChooseReward = 0x80AFBEB0; // type:func -EnTk_DigEff = 0x80AFC06C; // type:func -EnTk_Init = 0x80AFC1DC; // type:func -EnTk_Destroy = 0x80AFC358; // type:func -EnTk_Rest = 0x80AFC384; // type:func -EnTk_Walk = 0x80AFC5AC; // type:func -EnTk_Dig = 0x80AFC67C; // type:func -EnTk_Update = 0x80AFC8E0; // type:func -func_80B1D200 = 0x80AFC98C; // type:func -EnTk_OverrideLimbDraw = 0x80AFC9B8; // type:func -EnTk_PostLimbDraw = 0x80AFCA24; // type:func -EnTk_Draw = 0x80AFCAD8; // type:func -EnTorch_Init = 0x80AFCEE0; // type:func -EnTorch2_Init = 0x80AFCFD0; // type:func -EnTorch2_Destroy = 0x80AFD178; // type:func -EnTorch2_GetAttackItem = 0x80AFD1E8; // type:func -EnTorch2_SwingSword = 0x80AFD230; // type:func -EnTorch2_Backflip = 0x80AFD3C8; // type:func -EnTorch2_Update = 0x80AFD420; // type:func -EnTorch2_OverrideLimbDraw = 0x80AFEE08; // type:func -EnTorch2_PostLimbDraw = 0x80AFEE34; // type:func -EnTorch2_Draw = 0x80AFEE58; // type:func -EnToryo_Init = 0x80AFF770; // type:func -EnToryo_Destroy = 0x80AFF9B4; // type:func -EnToryo_TalkRespond = 0x80AFF9E0; // type:func -EnToryo_DoneTalking = 0x80AFFBD4; // type:func -EnToryo_ReactToExchangeItem = 0x80AFFC40; // type:func -EnToryo_GetTextId = 0x80AFFCAC; // type:func -EnToryo_HandleTalking = 0x80AFFD78; // type:func -EnToryo_Idle = 0x80AFFF28; // type:func -EnToryo_Update = 0x80AFFF8C; // type:func -EnToryo_Draw = 0x80B000C4; // type:func -EnToryo_OverrideLimbDraw = 0x80B00124; // type:func -EnToryo_PostLimbDraw = 0x80B001B4; // type:func -EnTp_SetupAction = 0x80B00400; // type:func -EnTp_Init = 0x80B0040C; // type:func -EnTp_Destroy = 0x80B00684; // type:func -EnTp_Tail_SetupFollowHead = 0x80B006B0; // type:func -EnTp_Tail_FollowHead = 0x80B006DC; // type:func -EnTp_Head_SetupApproachPlayer = 0x80B008B8; // type:func -EnTp_Head_ApproachPlayer = 0x80B008EC; // type:func -EnTp_SetupDie = 0x80B00A88; // type:func -EnTp_Die = 0x80B00B00; // type:func -EnTp_Fragment_SetupFade = 0x80B00E30; // type:func -EnTp_Fragment_Fade = 0x80B00F34; // type:func -EnTp_Head_SetupTakeOff = 0x80B00F80; // type:func -EnTp_Head_TakeOff = 0x80B00FDC; // type:func -EnTp_Head_SetupWait = 0x80B011C4; // type:func -EnTp_Head_Wait = 0x80B01210; // type:func -EnTp_Head_SetupBurrowReturnHome = 0x80B0151C; // type:func -EnTp_Head_BurrowReturnHome = 0x80B0154C; // type:func -EnTp_UpdateDamage = 0x80B0181C; // type:func -EnTp_Update = 0x80B01A74; // type:func -EnTp_Draw = 0x80B01DE0; // type:func -EnTr_SetupAction = 0x80B02270; // type:func -EnTr_Init = 0x80B0227C; // type:func -EnTr_Destroy = 0x80B023CC; // type:func -EnTr_CrySpellcast = 0x80B023DC; // type:func -EnTr_DoNothing = 0x80B0248C; // type:func -EnTr_ChooseAction2 = 0x80B0249C; // type:func -EnTr_FlyKidnapCutscene = 0x80B0264C; // type:func -func_80B23254 = 0x80B027C8; // type:func -EnTr_ShrinkVanish = 0x80B02A48; // type:func -EnTr_Reappear = 0x80B02C04; // type:func -EnTr_WaitToReappear = 0x80B02D9C; // type:func -EnTr_TakeOff = 0x80B02E5C; // type:func -EnTr_TurnLookOverShoulder = 0x80B02F24; // type:func -EnTr_ChooseAction1 = 0x80B03004; // type:func -EnTr_Update = 0x80B03138; // type:func -EnTr_OverrideLimbDraw = 0x80B032F0; // type:func -EnTr_Draw = 0x80B03420; // type:func -func_80B23FDC = 0x80B0352C; // type:func -func_80B24038 = 0x80B0358C; // type:func -EnTr_SetRotFromCue = 0x80B03788; // type:func -EnTr_SetStartPosRotFromCue = 0x80B03810; // type:func -EnTrap_Init = 0x80B03B70; // type:func -EnTrap_Destroy = 0x80B03F2C; // type:func -EnTrap_Update = 0x80B03F58; // type:func -EnTrap_Draw = 0x80B04CEC; // type:func -EnTuboTrap_Init = 0x80B04E10; // type:func -EnTuboTrap_Destroy = 0x80B04E94; // type:func -EnTuboTrap_DropCollectible = 0x80B04EC0; // type:func -EnTuboTrap_SpawnEffectsOnLand = 0x80B04F20; // type:func -EnTuboTrap_SpawnEffectsInWater = 0x80B05194; // type:func -EnTuboTrap_HandleImpact = 0x80B05414; // type:func -EnTuboTrap_WaitForProximity = 0x80B0563C; // type:func -EnTuboTrap_Levitate = 0x80B05748; // type:func -EnTuboTrap_Fly = 0x80B057D4; // type:func -EnTuboTrap_Update = 0x80B058A4; // type:func -EnTuboTrap_Draw = 0x80B05964; // type:func -EnVali_Init = 0x80B05AB0; // type:func -EnVali_Destroy = 0x80B05C2C; // type:func -EnVali_SetupLurk = 0x80B05C7C; // type:func -EnVali_SetupDropAppear = 0x80B05CCC; // type:func -EnVali_SetupFloatIdle = 0x80B05D04; // type:func -EnVali_SetupAttacked = 0x80B05F1C; // type:func -EnVali_SetupRetaliate = 0x80B05F54; // type:func -EnVali_SetupMoveArmsDown = 0x80B05FC4; // type:func -EnVali_SetupBurnt = 0x80B06004; // type:func -EnVali_SetupDivideAndDie = 0x80B0605C; // type:func -EnVali_SetupStunned = 0x80B06160; // type:func -EnVali_SetupFrozen = 0x80B061EC; // type:func -EnVali_SetupReturnToLurk = 0x80B0624C; // type:func -EnVali_DischargeLightning = 0x80B062A8; // type:func -EnVali_Lurk = 0x80B064A4; // type:func -EnVali_DropAppear = 0x80B064E4; // type:func -EnVali_FloatIdle = 0x80B06578; // type:func -EnVali_Attacked = 0x80B06724; // type:func -EnVali_Retaliate = 0x80B067DC; // type:func -EnVali_MoveArmsDown = 0x80B06838; // type:func -EnVali_Burnt = 0x80B06874; // type:func -EnVali_DivideAndDie = 0x80B068B0; // type:func -EnVali_Stunned = 0x80B06A64; // type:func -EnVali_Frozen = 0x80B06B20; // type:func -EnVali_ReturnToLurk = 0x80B06CB0; // type:func -EnVali_UpdateDamage = 0x80B06D20; // type:func -EnVali_Update = 0x80B06ED8; // type:func -EnVali_PulseOutside = 0x80B07034; // type:func -EnVali_PulseInsides = 0x80B07250; // type:func -EnVali_SetArmLength = 0x80B0746C; // type:func -EnVali_OverrideLimbDraw = 0x80B0760C; // type:func -EnVali_PostLimbDraw = 0x80B0769C; // type:func -EnVali_DrawBody = 0x80B07760; // type:func -EnVali_Draw = 0x80B07AC8; // type:func -EnVase_Init = 0x80B08170; // type:func -EnVase_Destroy = 0x80B081D4; // type:func -EnVase_Draw = 0x80B081E4; // type:func -EnVbBall_Init = 0x80B08270; // type:func -EnVbBall_Destroy = 0x80B083F0; // type:func -EnVbBall_SpawnDebris = 0x80B0842C; // type:func -EnVbBall_SpawnDust = 0x80B08504; // type:func -EnVbBall_UpdateBones = 0x80B085A4; // type:func -EnVbBall_Update = 0x80B08888; // type:func -EnVbBall_Draw = 0x80B09054; // type:func -EnViewer_SetupAction = 0x80B09420; // type:func -EnViewer_Init = 0x80B0942C; // type:func -EnViewer_Destroy = 0x80B09500; // type:func -EnViewer_InitAnimGanondorfOrZelda = 0x80B0952C; // type:func -EnViewer_InitAnimImpa = 0x80B09678; // type:func -EnViewer_InitAnimHorse = 0x80B09708; // type:func -EnViewer_InitImpl = 0x80B097A0; // type:func -EnViewer_UpdateImpl = 0x80B0995C; // type:func -EnViewer_Update = 0x80B0A4B4; // type:func -EnViewer_Ganondorf3OverrideLimbDraw = 0x80B0A508; // type:func -EnViewer_Ganondorf9PostLimbDraw = 0x80B0A578; // type:func -EnViewer_GanondorfPostLimbDrawUpdateCapeVec = 0x80B0A640; // type:func -EnViewer_DrawGanondorf = 0x80B0A680; // type:func -EnViewer_DrawHorse = 0x80B0AAAC; // type:func -EnViewer_ZeldaOverrideLimbDraw = 0x80B0AAD8; // type:func -EnViewer_ZeldaPostLimbDraw = 0x80B0AB58; // type:func -EnViewer_DrawZelda = 0x80B0ABA0; // type:func -EnViewer_ImpaOverrideLimbDraw = 0x80B0B244; // type:func -EnViewer_DrawImpa = 0x80B0B26C; // type:func -EnViewer_Draw = 0x80B0B380; // type:func -EnViewer_UpdatePosition = 0x80B0B470; // type:func -EnViewer_InitFireEffect = 0x80B0B840; // type:func -EnViewer_DrawFireEffects = 0x80B0B988; // type:func -EnViewer_UpdateGanondorfCape = 0x80B0BCCC; // type:func -EnVm_SetupAction = 0x80B0C2E0; // type:func -EnVm_Init = 0x80B0C2EC; // type:func -EnVm_Destroy = 0x80B0C45C; // type:func -EnVm_SetupWait = 0x80B0C488; // type:func -EnVm_Wait = 0x80B0C514; // type:func -EnVm_SetupAttack = 0x80B0C868; // type:func -EnVm_Attack = 0x80B0C90C; // type:func -EnVm_SetupStun = 0x80B0CB5C; // type:func -EnVm_Stun = 0x80B0CC04; // type:func -EnVm_SetupDie = 0x80B0CD10; // type:func -EnVm_Die = 0x80B0CE18; // type:func -EnVm_CheckHealth = 0x80B0CECC; // type:func -EnVm_Update = 0x80B0CFC8; // type:func -EnVm_OverrideLimbDraw = 0x80B0D15C; // type:func -EnVm_PostLimbDraw = 0x80B0D1C4; // type:func -EnVm_Draw = 0x80B0D49C; // type:func -EnWallTubo_Init = 0x80B0DBA0; // type:func -EnWallTubo_Destroy = 0x80B0DBD0; // type:func -EnWallTubo_FindGirl = 0x80B0DBE0; // type:func -EnWallTubo_DetectChu = 0x80B0DC24; // type:func -EnWallTubo_SetWallFall = 0x80B0DE40; // type:func -EnWallTubo_Update = 0x80B0DFAC; // type:func -EnWallmas_Init = 0x80B0E090; // type:func -EnWallmas_Destroy = 0x80B0E1D0; // type:func -EnWallmas_TimerInit = 0x80B0E1FC; // type:func -EnWallmas_SetupDrop = 0x80B0E258; // type:func -EnWallmas_SetupLand = 0x80B0E31C; // type:func -EnWallmas_SetupStand = 0x80B0E3E0; // type:func -EnWallmas_SetupWalk = 0x80B0E420; // type:func -EnWallmas_SetupJumpToCeiling = 0x80B0E470; // type:func -EnWallmas_SetupReturnToCeiling = 0x80B0E4B8; // type:func -EnWallmas_SetupTakeDamage = 0x80B0E53C; // type:func -EnWallmas_SetupCooldown = 0x80B0E5F8; // type:func -EnWallmas_SetupDie = 0x80B0E64C; // type:func -EnWallmas_SetupTakePlayer = 0x80B0E714; // type:func -EnWallmas_ProximityOrSwitchInit = 0x80B0E79C; // type:func -EnWallmas_SetupStun = 0x80B0E7E4; // type:func -EnWallmas_WaitToDrop = 0x80B0E8B4; // type:func -EnWallmas_Drop = 0x80B0E9C0; // type:func -EnWallmas_Land = 0x80B0EA8C; // type:func -EnWallmas_Stand = 0x80B0EAC8; // type:func -EnWallmas_Walk = 0x80B0EB28; // type:func -EnWallmas_JumpToCeiling = 0x80B0EBDC; // type:func -EnWallmas_ReturnToCeiling = 0x80B0EC18; // type:func -EnWallmas_TakeDamage = 0x80B0ED34; // type:func -EnWallmas_Cooldown = 0x80B0EDC8; // type:func -EnWallmas_Die = 0x80B0EE04; // type:func -EnWallmas_TakePlayer = 0x80B0EE78; // type:func -EnWallmas_WaitForProximity = 0x80B0F09C; // type:func -EnWallmas_WaitForSwitchFlag = 0x80B0F0F8; // type:func -EnWallmas_Stun = 0x80B0F144; // type:func -EnWallmas_ColUpdate = 0x80B0F1B8; // type:func -EnWallmas_Update = 0x80B0F2D4; // type:func -EnWallmas_DrawXlu = 0x80B0F49C; // type:func -EnWallMas_OverrideLimbDraw = 0x80B0F63C; // type:func -EnWallMas_PostLimbDraw = 0x80B0F6B0; // type:func -EnWallmas_Draw = 0x80B0F7A0; // type:func -EnWeatherTag_SetupAction = 0x80B0FAA0; // type:func -EnWeatherTag_Destroy = 0x80B0FAAC; // type:func -EnWeatherTag_Init = 0x80B0FABC; // type:func -WeatherTag_CheckEnableWeatherEffect = 0x80B0FC90; // type:func -WeatherTag_CheckRestoreWeather = 0x80B0FE68; // type:func -EnWeatherTag_DisabledCloudyHyruleMarket = 0x80B10028; // type:func -EnWeatherTag_EnabledCloudyHyruleMarket = 0x80B10084; // type:func -EnWeatherTag_DisabledCloudyLonLonRanch = 0x80B100D8; // type:func -EnWeatherTag_EnabledCloudyLonLonRanch = 0x80B10134; // type:func -EnWeatherTag_DisabledCloudyDeathMountain = 0x80B10188; // type:func -EnWeatherTag_EnabledCloudyDeathMountain = 0x80B101E4; // type:func -EnWeatherTag_DisabledCloudySnow = 0x80B10238; // type:func -EnWeatherTag_EnabledCloudySnow = 0x80B102B0; // type:func -EnWeatherTag_DisabledRainLakeHylia = 0x80B1031C; // type:func -EnWeatherTag_EnabledRainLakeHylia = 0x80B103A0; // type:func -EnWeatherTag_DisabledCloudyRainThunderKakariko = 0x80B10418; // type:func -EnWeatherTag_EnabledCloudyRainThunderKakariko = 0x80B104B0; // type:func -EnWeatherTag_SetSandstormIntensity = 0x80B1053C; // type:func -EnWeatherTag_DisabledRainThunder = 0x80B10638; // type:func -EnWeatherTag_EnabledRainThunder = 0x80B106DC; // type:func -EnWeatherTag_Update = 0x80B10790; // type:func -EnWeiyer_Init = 0x80B10990; // type:func -EnWeiyer_Destroy = 0x80B10A60; // type:func -func_80B32384 = 0x80B10A8C; // type:func -func_80B32434 = 0x80B10B40; // type:func -func_80B32494 = 0x80B10BA0; // type:func -func_80B32508 = 0x80B10C14; // type:func -func_80B32538 = 0x80B10C48; // type:func -func_80B325A0 = 0x80B10CB4; // type:func -func_80B32660 = 0x80B10D74; // type:func -func_80B32724 = 0x80B10E38; // type:func -func_80B327B0 = 0x80B10EC4; // type:func -func_80B327D8 = 0x80B10EF0; // type:func -func_80B32804 = 0x80B10F20; // type:func -func_80B328E8 = 0x80B11004; // type:func -func_80B32C2C = 0x80B11348; // type:func -func_80B32D30 = 0x80B1144C; // type:func -func_80B32DEC = 0x80B11508; // type:func -func_80B32E34 = 0x80B11554; // type:func -func_80B33018 = 0x80B1173C; // type:func -func_80B331CC = 0x80B118F0; // type:func -func_80B332B4 = 0x80B119D8; // type:func -func_80B33338 = 0x80B11A5C; // type:func -func_80B333B8 = 0x80B11ADC; // type:func -func_80B3349C = 0x80B11BC0; // type:func -func_80B3368C = 0x80B11DB4; // type:func -EnWeiyer_Update = 0x80B11E94; // type:func -EnWeiyer_OverrideLimbDraw = 0x80B12008; // type:func -EnWeiyer_Draw = 0x80B12038; // type:func -EnWf_SetupAction = 0x80B12390; // type:func -EnWf_Init = 0x80B1239C; // type:func -EnWf_Destroy = 0x80B125D0; // type:func -EnWf_ChangeAction = 0x80B1266C; // type:func -EnWf_SetupWaitToAppear = 0x80B12A3C; // type:func -EnWf_WaitToAppear = 0x80B12AE4; // type:func -EnWf_SetupWait = 0x80B12C18; // type:func -EnWf_Wait = 0x80B12CA0; // type:func -EnWf_SetupRunAtPlayer = 0x80B12EBC; // type:func -EnWf_RunAtPlayer = 0x80B12F3C; // type:func -EnWf_SetupSearchForPlayer = 0x80B133BC; // type:func -EnWf_SearchForPlayer = 0x80B13408; // type:func -EnWf_SetupRunAroundPlayer = 0x80B135E8; // type:func -EnWf_RunAroundPlayer = 0x80B136E4; // type:func -EnWf_SetupSlash = 0x80B13C04; // type:func -EnWf_Slash = 0x80B13C80; // type:func -EnWf_SetupRecoilFromBlockedSlash = 0x80B13FD4; // type:func -EnWf_RecoilFromBlockedSlash = 0x80B14070; // type:func -EnWf_SetupBackflipAway = 0x80B14268; // type:func -EnWf_BackflipAway = 0x80B142E4; // type:func -EnWf_SetupStunned = 0x80B143EC; // type:func -EnWf_Stunned = 0x80B14464; // type:func -EnWf_SetupDamaged = 0x80B14520; // type:func -EnWf_Damaged = 0x80B145B8; // type:func -EnWf_SetupSomersaultAndAttack = 0x80B147C0; // type:func -EnWf_SomersaultAndAttack = 0x80B14878; // type:func -EnWf_SetupBlocking = 0x80B14960; // type:func -EnWf_Blocking = 0x80B14A00; // type:func -EnWf_SetupSidestep = 0x80B14C84; // type:func -EnWf_Sidestep = 0x80B14E1C; // type:func -EnWf_SetupDie = 0x80B1536C; // type:func -EnWf_Die = 0x80B1541C; // type:func -func_80B36F40 = 0x80B15624; // type:func -EnWf_UpdateDamage = 0x80B1571C; // type:func -EnWf_Update = 0x80B158EC; // type:func -EnWf_OverrideLimbDraw = 0x80B15B40; // type:func -EnWf_PostLimbDraw = 0x80B15B84; // type:func -EnWf_Draw = 0x80B15D2C; // type:func -EnWf_DodgeRanged = 0x80B15EE8; // type:func -EnWonderItem_Destroy = 0x80B166A0; // type:func -EnWonderItem_DropCollectible = 0x80B166E4; // type:func -EnWonderItem_Init = 0x80B16840; // type:func -EnWonderItem_MultitagFree = 0x80B16B8C; // type:func -EnWonderItem_ProximityDrop = 0x80B16CD4; // type:func -EnWonderItem_InteractSwitch = 0x80B16D3C; // type:func -EnWonderItem_ProximitySwitch = 0x80B16D70; // type:func -EnWonderItem_MultitagOrdered = 0x80B16DFC; // type:func -EnWonderItem_BombSoldier = 0x80B16F58; // type:func -EnWonderItem_RollDrop = 0x80B16FE8; // type:func -EnWonderItem_Update = 0x80B1705C; // type:func -EnWonderTalk_Destroy = 0x80B173D0; // type:func -EnWonderTalk_Init = 0x80B173E0; // type:func -func_80B391CC = 0x80B17488; // type:func -func_80B3943C = 0x80B17618; // type:func -func_80B395F0 = 0x80B1776C; // type:func -EnWonderTalk_Update = 0x80B1795C; // type:func -EnWonderTalk2_Destroy = 0x80B17A60; // type:func -EnWonderTalk2_Init = 0x80B17A70; // type:func -func_80B3A10C = 0x80B17C00; // type:func -func_80B3A15C = 0x80B17C50; // type:func -func_80B3A3D4 = 0x80B17DD0; // type:func -func_80B3A4F8 = 0x80B17EB8; // type:func -EnWonderTalk2_DoNothing = 0x80B18008; // type:func -EnWonderTalk2_Update = 0x80B18018; // type:func -EnWood02_SpawnZoneCheck = 0x80B18100; // type:func -EnWood02_SpawnOffspring = 0x80B18228; // type:func -EnWood02_Init = 0x80B18440; // type:func -EnWood02_Destroy = 0x80B1887C; // type:func -EnWood02_Update = 0x80B188B8; // type:func -EnWood02_Draw = 0x80B18DB0; // type:func -EnXc_InitCollider = 0x80B192E0; // type:func -EnXc_UpdateCollider = 0x80B1932C; // type:func -EnXc_Destroy = 0x80B19370; // type:func -EnXc_CalculateHeadTurn = 0x80B1939C; // type:func -EnXc_SetEyePattern = 0x80B19424; // type:func -EnXc_SpawnNut = 0x80B194AC; // type:func -EnXc_BgCheck = 0x80B19574; // type:func -EnXc_AnimIsFinished = 0x80B195BC; // type:func -EnXc_GetCue = 0x80B195E0; // type:func -EnXc_CheckForCue = 0x80B19604; // type:func -EnXc_CheckForNoCue = 0x80B19650; // type:func -func_80B3C588 = 0x80B1969C; // type:func -func_80B3C620 = 0x80B19734; // type:func -EnXc_ChangeAnimation = 0x80B19814; // type:func -EnXc_CheckAndSetAction = 0x80B198D0; // type:func -func_80B3C7D4 = 0x80B198E8; // type:func -func_80B3C8CC = 0x80B19914; // type:func -func_80B3C924 = 0x80B19970; // type:func -func_80B3C964 = 0x80B199B0; // type:func -func_80B3C9DC = 0x80B19A28; // type:func -func_80B3C9EC = 0x80B19A3C; // type:func -func_80B3CA38 = 0x80B19A88; // type:func -EnXc_MinuetCS = 0x80B19ADC; // type:func -func_80B3CB58 = 0x80B19BB4; // type:func -EnXc_BoleroCS = 0x80B19C08; // type:func -EnXc_SetupSerenadeAction = 0x80B19D68; // type:func -EnXc_SerenadeCS = 0x80B19DC0; // type:func -EnXc_DoNothing = 0x80B19E88; // type:func -EnXc_SetWalkingSFX = 0x80B19E98; // type:func -EnXc_SetNutThrowSFX = 0x80B19F18; // type:func -EnXc_SetLandingSFX = 0x80B19FA4; // type:func -EnXc_SetColossusAppearSFX = 0x80B1A024; // type:func -func_80B3D118 = 0x80B1A130; // type:func -EnXc_SetColossusWindSFX = 0x80B1A174; // type:func -EnXc_SpawnFlame = 0x80B1A27C; // type:func -EnXc_SetupFlamePos = 0x80B1A320; // type:func -EnXc_DestroyFlame = 0x80B1A39C; // type:func -EnXc_InitFlame = 0x80B1A3DC; // type:func -func_80B3D48C = 0x80B1A478; // type:func -EnXc_GetCurrentHarpAnim = 0x80B1A4C8; // type:func -EnXc_CalcXZAccel = 0x80B1A55C; // type:func -func_80B3D644 = 0x80B1A634; // type:func -EnXc_CalcXZSpeed = 0x80B1A654; // type:func -func_80B3D6F0 = 0x80B1A6E0; // type:func -func_80B3D710 = 0x80B1A700; // type:func -func_80B3D730 = 0x80B1A720; // type:func -func_80B3D750 = 0x80B1A740; // type:func -EnXc_SetupFallFromSkyAction = 0x80B1A78C; // type:func -func_80B3D8A4 = 0x80B1A89C; // type:func -EnXc_SetupWalkAction = 0x80B1A98C; // type:func -EnXc_SetupHaltAction = 0x80B1A9FC; // type:func -EnXc_SetupStoppedAction = 0x80B1AAA8; // type:func -func_80B3DAF0 = 0x80B1AAF0; // type:func -EnXc_SetupInitialHarpAction = 0x80B1ABB0; // type:func -EnXc_SetupPlayingHarpAction = 0x80B1AC28; // type:func -func_80B3DCA8 = 0x80B1ACB0; // type:func -EnXc_SetupHarpPutawayAction = 0x80B1AD44; // type:func -func_80B3DE00 = 0x80B1AE14; // type:func -func_80B3DE78 = 0x80B1AE8C; // type:func -EnXc_SetupReverseAccel = 0x80B1AF08; // type:func -EnXc_SetupReverseWalkAction = 0x80B1AFB8; // type:func -EnXc_SetupReverseHaltAction = 0x80B1B028; // type:func -EnXc_SetupNutThrow = 0x80B1B0D4; // type:func -func_80B3E164 = 0x80B1B17C; // type:func -EnXc_SetupDisappear = 0x80B1B1D0; // type:func -EnXc_ActionFunc0 = 0x80B1B240; // type:func -EnXc_ActionFunc1 = 0x80B1B280; // type:func -EnXc_GracefulFall = 0x80B1B2C0; // type:func -EnXc_Accelerate = 0x80B1B33C; // type:func -EnXc_Walk = 0x80B1B39C; // type:func -EnXc_Stopped = 0x80B1B3FC; // type:func -EnXc_ActionFunc6 = 0x80B1B45C; // type:func -EnXc_ActionFunc7 = 0x80B1B4A4; // type:func -EnXc_ActionFunc8 = 0x80B1B4F0; // type:func -EnXc_ActionFunc9 = 0x80B1B540; // type:func -EnXc_ActionFunc10 = 0x80B1B588; // type:func -EnXc_ActionFunc11 = 0x80B1B5D0; // type:func -EnXc_ActionFunc12 = 0x80B1B61C; // type:func -EnXc_ActionFunc13 = 0x80B1B668; // type:func -EnXc_ReverseAccelerate = 0x80B1B6C4; // type:func -EnXc_ActionFunc15 = 0x80B1B730; // type:func -EnXc_HaltAndWaitToThrowNut = 0x80B1B79C; // type:func -EnXc_ThrowNut = 0x80B1B808; // type:func -EnXc_Delete = 0x80B1B870; // type:func -EnXc_Fade = 0x80B1B8CC; // type:func -func_80B3E87C = 0x80B1B8EC; // type:func -EnXc_PullingOutHarpOverrideLimbDraw = 0x80B1B91C; // type:func -EnXc_HarpOverrideLimbDraw = 0x80B1B958; // type:func -EnXc_DrawPullingOutHarp = 0x80B1B980; // type:func -EnXc_DrawHarp = 0x80B1BABC; // type:func -func_80B3EBF0 = 0x80B1BBF8; // type:func -func_80B3EC00 = 0x80B1BC0C; // type:func -func_80B3EC0C = 0x80B1BC1C; // type:func -func_80B3EC90 = 0x80B1BCA0; // type:func -func_80B3ECD8 = 0x80B1BCE8; // type:func -EnXc_ActionFunc20 = 0x80B1BD58; // type:func -EnXc_ActionFunc21 = 0x80B1BD7C; // type:func -EnXc_ActionFunc22 = 0x80B1BD9C; // type:func -EnXc_ActionFunc23 = 0x80B1BDE4; // type:func -EnXc_ActionFunc24 = 0x80B1BE44; // type:func -EnXc_ActionFunc25 = 0x80B1BE54; // type:func -EnXc_ActionFunc26 = 0x80B1BE64; // type:func -EnXc_ActionFunc27 = 0x80B1BE74; // type:func -EnXc_ActionFunc28 = 0x80B1BE84; // type:func -func_80B3EE64 = 0x80B1BE94; // type:func -func_80B3EE74 = 0x80B1BEA8; // type:func -func_80B3EEA4 = 0x80B1BEDC; // type:func -func_80B3EEC8 = 0x80B1BF00; // type:func -func_80B3EEEC = 0x80B1BF24; // type:func -func_80B3EF10 = 0x80B1BF48; // type:func -func_80B3EF34 = 0x80B1BF6C; // type:func -func_80B3EF58 = 0x80B1BF90; // type:func -func_80B3EF80 = 0x80B1BFB8; // type:func -func_80B3EFA4 = 0x80B1BFDC; // type:func -func_80B3EFC8 = 0x80B1C000; // type:func -func_80B3EFEC = 0x80B1C024; // type:func -func_80B3F010 = 0x80B1C048; // type:func -func_80B3F0B8 = 0x80B1C0F4; // type:func -func_80B3F0DC = 0x80B1C118; // type:func -func_80B3F100 = 0x80B1C13C; // type:func -EnXc_Serenade = 0x80B1C160; // type:func -EnXc_ActionFunc30 = 0x80B1C180; // type:func -EnXc_ActionFunc31 = 0x80B1C1AC; // type:func -EnXc_ActionFunc32 = 0x80B1C1F0; // type:func -EnXc_ActionFunc33 = 0x80B1C21C; // type:func -EnXc_ActionFunc34 = 0x80B1C248; // type:func -EnXc_ActionFunc35 = 0x80B1C274; // type:func -EnXc_ActionFunc36 = 0x80B1C2A0; // type:func -EnXc_ActionFunc37 = 0x80B1C2CC; // type:func -EnXc_ActionFunc38 = 0x80B1C2F8; // type:func -EnXc_ActionFunc39 = 0x80B1C324; // type:func -EnXc_ActionFunc40 = 0x80B1C350; // type:func -EnXc_ActionFunc41 = 0x80B1C3B0; // type:func -EnXc_ActionFunc42 = 0x80B1C3DC; // type:func -EnXc_ActionFunc43 = 0x80B1C408; // type:func -EnXc_ActionFunc44 = 0x80B1C434; // type:func -func_80B3F3C8 = 0x80B1C444; // type:func -func_80B3F3D8 = 0x80B1C458; // type:func -EnXc_PlayDiveSFX = 0x80B1C478; // type:func -EnXc_LakeHyliaDive = 0x80B1C4CC; // type:func -func_80B3F534 = 0x80B1C5B8; // type:func -func_80B3F59C = 0x80B1C620; // type:func -func_80B3F620 = 0x80B1C6A4; // type:func -func_80B3F644 = 0x80B1C6C8; // type:func -func_80B3F668 = 0x80B1C6EC; // type:func -func_80B3F6DC = 0x80B1C760; // type:func -EnXc_SetupKneelAction = 0x80B1C784; // type:func -func_80B3F754 = 0x80B1C7DC; // type:func -func_80B3F7BC = 0x80B1C84C; // type:func -EnXc_ActionFunc45 = 0x80B1C888; // type:func -EnXc_ActionFunc46 = 0x80B1C8B4; // type:func -EnXc_ActionFunc47 = 0x80B1C8E0; // type:func -EnXc_ActionFunc48 = 0x80B1C938; // type:func -EnXc_ActionFunc49 = 0x80B1C964; // type:func -EnXc_Kneel = 0x80B1C9C8; // type:func -EnXc_ActionFunc51 = 0x80B1CA2C; // type:func -EnXc_ActionFunc52 = 0x80B1CA90; // type:func -func_80B3FA08 = 0x80B1CAB0; // type:func -func_80B3FA2C = 0x80B1CAD8; // type:func -EnXc_PlayTriforceSFX = 0x80B1CAF8; // type:func -func_80B3FAE0 = 0x80B1CB90; // type:func -EnXc_CalcTriforce = 0x80B1CBD8; // type:func -func_80B3FF0C = 0x80B1CFD0; // type:func -EnXc_SetupShowTriforceAction = 0x80B1D078; // type:func -EnXc_SetupShowTriforceIdleAction = 0x80B1D108; // type:func -func_80B400AC = 0x80B1D174; // type:func -EnXc_ActionFunc53 = 0x80B1D1B0; // type:func -EnXc_ActionFunc54 = 0x80B1D1D0; // type:func -EnXc_ShowTriforce = 0x80B1D218; // type:func -EnXc_ShowTriforceIdle = 0x80B1D280; // type:func -EnXc_TriforceOverrideLimbDraw = 0x80B1D2DC; // type:func -EnXc_TriforcePostLimbDraw = 0x80B1D304; // type:func -EnXc_DrawTriforce = 0x80B1D380; // type:func -func_80B40590 = 0x80B1D614; // type:func -EnXc_SetThrownAroundSFX = 0x80B1D630; // type:func -EnXc_PlayLinkScreamSFX = 0x80B1D6F4; // type:func -EnXc_SetCrySFX = 0x80B1D728; // type:func -func_80B406F8 = 0x80B1D784; // type:func -EnXc_SetupIdleInNocturne = 0x80B1D79C; // type:func -EnXc_SetupDefenseStance = 0x80B1D838; // type:func -EnXc_SetupContortions = 0x80B1D8B0; // type:func -EnXc_SetupFallInNocturne = 0x80B1D94C; // type:func -EnXc_SetupHittingGroundInNocturne = 0x80B1DA28; // type:func -func_80B40A78 = 0x80B1DAC8; // type:func -EnXc_SetupKneelInNocturne = 0x80B1DB68; // type:func -func_80B40BB4 = 0x80B1DC04; // type:func -func_80B40C50 = 0x80B1DCA0; // type:func -func_80B40C74 = 0x80B1DCC4; // type:func -func_80B40C98 = 0x80B1DCE8; // type:func -func_80B40CBC = 0x80B1DD0C; // type:func -func_80B40CE0 = 0x80B1DD30; // type:func -func_80B40D08 = 0x80B1DD58; // type:func -func_80B40D2C = 0x80B1DD7C; // type:func -func_80B40D50 = 0x80B1DDA0; // type:func -func_80B40D74 = 0x80B1DDC4; // type:func -EnXc_SetupReverseHaltInNocturneCS = 0x80B1DDE8; // type:func -func_80B40E40 = 0x80B1DE94; // type:func -func_80B40E64 = 0x80B1DEB8; // type:func -func_80B40E88 = 0x80B1DEDC; // type:func -EnXc_SetupNocturneState = 0x80B1DF00; // type:func -EnXc_InitialNocturneAction = 0x80B1E040; // type:func -EnXc_IdleInNocturne = 0x80B1E060; // type:func -EnXc_DefenseStance = 0x80B1E0B0; // type:func -EnXc_Contort = 0x80B1E0F8; // type:func -EnXc_FallInNocturne = 0x80B1E164; // type:func -EnXc_HitGroundInNocturne = 0x80B1E1CC; // type:func -EnXc_ActionFunc63 = 0x80B1E20C; // type:func -EnXc_KneelInNocturneCS = 0x80B1E268; // type:func -EnXc_ActionFunc65 = 0x80B1E2B0; // type:func -EnXc_ActionFunc66 = 0x80B1E2F4; // type:func -EnXc_ActionFunc67 = 0x80B1E320; // type:func -EnXc_ActionFunc68 = 0x80B1E34C; // type:func -EnXc_ActionFunc69 = 0x80B1E378; // type:func -EnXc_ActionFunc70 = 0x80B1E3A4; // type:func -EnXc_ActionFunc71 = 0x80B1E3D0; // type:func -EnXc_ActionFunc72 = 0x80B1E3FC; // type:func -EnXc_ReverseAccelInNocturneCS = 0x80B1E428; // type:func -EnXc_ReverseWalkInNocturneCS = 0x80B1E454; // type:func -EnXc_ReverseHaltInNocturneCS = 0x80B1E4A8; // type:func -EnXc_ThrowNutInNocturneCS = 0x80B1E4D4; // type:func -EnXc_DeleteInNocturneCS = 0x80B1E500; // type:func -EnXc_KillInNocturneCS = 0x80B1E52C; // type:func -EnXc_DrawSquintingEyes = 0x80B1E550; // type:func -EnXc_InitTempleOfTime = 0x80B1E62C; // type:func -EnXc_SetupDialogueAction = 0x80B1E798; // type:func -func_80B41798 = 0x80B1E820; // type:func -EnXc_BlockingPedestalAction = 0x80B1E86C; // type:func -EnXc_ActionFunc80 = 0x80B1E8D4; // type:func -EnXc_Update = 0x80B1E93C; // type:func -EnXc_Init = 0x80B1E984; // type:func -EnXc_OverrideLimbDraw = 0x80B1EAF0; // type:func -EnXc_PostLimbDraw = 0x80B1EB78; // type:func -EnXc_DrawNothing = 0x80B1EC04; // type:func -EnXc_DrawDefault = 0x80B1EC14; // type:func -EnXc_Draw = 0x80B1ED1C; // type:func -EnYabusameMark_Destroy = 0x80B1FA70; // type:func -EnYabusameMark_Init = 0x80B1FA9C; // type:func -func_80B42F74 = 0x80B1FBDC; // type:func -EnYabusameMark_Update = 0x80B1FE20; // type:func -EnYukabyun_Init = 0x80B20140; // type:func -EnYukabyun_Destroy = 0x80B201F0; // type:func -func_80B43A94 = 0x80B2021C; // type:func -func_80B43AD4 = 0x80B2025C; // type:func -func_80B43B6C = 0x80B202F4; // type:func -EnYukabyun_Break = 0x80B20354; // type:func -EnYukabyun_Update = 0x80B203C8; // type:func -EnYukabyun_Draw = 0x80B20568; // type:func -EnZf_SetupAction = 0x80B20750; // type:func -EnZf_PrimaryFloorCheck = 0x80B2075C; // type:func -EnZf_SecondaryFloorCheck = 0x80B208CC; // type:func -EnZf_Init = 0x80B209FC; // type:func -EnZf_Destroy = 0x80B20D34; // type:func -EnZf_FindPlatform = 0x80B20DB8; // type:func -EnZf_FindNextPlatformAwayFromPlayer = 0x80B20F80; // type:func -EnZf_FindNextPlatformTowardsPlayer = 0x80B21224; // type:func -EnZf_CanAttack = 0x80B21400; // type:func -func_80B44DC4 = 0x80B214D4; // type:func -EnZf_ChooseAction = 0x80B215A0; // type:func -EnZf_SetupDropIn = 0x80B217C0; // type:func -EnZf_DropIn = 0x80B21888; // type:func -func_80B45384 = 0x80B21A98; // type:func -func_80B4543C = 0x80B21B50; // type:func -EnZf_SetupApproachPlayer = 0x80B21DCC; // type:func -EnZf_ApproachPlayer = 0x80B21E60; // type:func -EnZf_SetupJumpForward = 0x80B2254C; // type:func -EnZf_JumpForward = 0x80B2260C; // type:func -func_80B4604C = 0x80B22768; // type:func -func_80B46098 = 0x80B227B4; // type:func -func_80B462E4 = 0x80B22A00; // type:func -func_80B463E4 = 0x80B22B08; // type:func -EnZf_SetupSlash = 0x80B2314C; // type:func -EnZf_Slash = 0x80B23208; // type:func -EnZf_SetupRecoilFromBlockedSlash = 0x80B23494; // type:func -EnZf_RecoilFromBlockedSlash = 0x80B23508; // type:func -EnZf_SetupJumpBack = 0x80B235C0; // type:func -EnZf_JumpBack = 0x80B23660; // type:func -EnZf_SetupStunned = 0x80B23784; // type:func -EnZf_Stunned = 0x80B23854; // type:func -EnZf_SetupSheatheSword = 0x80B23A94; // type:func -EnZf_SheatheSword = 0x80B23B70; // type:func -EnZf_SetupHopAndTaunt = 0x80B23C1C; // type:func -EnZf_HopAndTaunt = 0x80B23C7C; // type:func -EnZf_SetupHopAway = 0x80B23ED4; // type:func -EnZf_HopAway = 0x80B23F54; // type:func -EnZf_SetupDrawSword = 0x80B243A0; // type:func -EnZf_DrawSword = 0x80B24434; // type:func -EnZf_SetupDamaged = 0x80B244E4; // type:func -EnZf_Damaged = 0x80B245F0; // type:func -EnZf_SetupJumpUp = 0x80B24950; // type:func -EnZf_JumpUp = 0x80B249F8; // type:func -func_80B483E4 = 0x80B24B24; // type:func -EnZf_CircleAroundPlayer = 0x80B24CC0; // type:func -EnZf_SetupDie = 0x80B25440; // type:func -EnZf_Die = 0x80B255A4; // type:func -EnZf_UpdateHeadRotation = 0x80B256E4; // type:func -EnZf_UpdateDamage = 0x80B25808; // type:func -EnZf_Update = 0x80B259A0; // type:func -EnZf_OverrideLimbDraw = 0x80B25D58; // type:func -EnZf_PostLimbDraw = 0x80B25DE4; // type:func -EnZf_Draw = 0x80B26038; // type:func -EnZf_SetupCircleAroundPlayer = 0x80B26284; // type:func -EnZf_DodgeRangedEngaging = 0x80B26350; // type:func -EnZf_DodgeRangedWaiting = 0x80B2657C; // type:func -func_80B4AB40 = 0x80B27240; // type:func -func_80B4AB48 = 0x80B27248; // type:func -EnZl1_Init = 0x80B27250; // type:func -EnZl1_Destroy = 0x80B274E0; // type:func -func_80B4AE18 = 0x80B27520; // type:func -func_80B4AF18 = 0x80B27620; // type:func -func_80B4B010 = 0x80B27718; // type:func -func_80B4B240 = 0x80B27950; // type:func -func_80B4B7F4 = 0x80B27F04; // type:func -func_80B4B834 = 0x80B27F48; // type:func -func_80B4B874 = 0x80B27F8C; // type:func -func_80B4B8B4 = 0x80B27FCC; // type:func -func_80B4BBC4 = 0x80B282DC; // type:func -func_80B4BC78 = 0x80B28390; // type:func -func_80B4BF2C = 0x80B28644; // type:func -EnZl1_Update = 0x80B28938; // type:func -EnZl1_OverrideLimbDraw = 0x80B28A5C; // type:func -EnZl1_PostLimbDraw = 0x80B28B1C; // type:func -EnZl1_Draw = 0x80B28B78; // type:func -EnZl2_Destroy = 0x80B2B050; // type:func -EnZl2_UpdateEyes = 0x80B2B074; // type:func -func_80B4EA40 = 0x80B2B104; // type:func -func_80B4EAF4 = 0x80B2B1B8; // type:func -func_80B4EBB8 = 0x80B2B27C; // type:func -func_80B4EC48 = 0x80B2B30C; // type:func -EnZl2_setEyesIndex = 0x80B2B3AC; // type:func -EnZl2_setEyeIndex2 = 0x80B2B3CC; // type:func -EnZl2_setMouthIndex = 0x80B2B3E4; // type:func -func_80B4ED2C = 0x80B2B3FC; // type:func -EnZl2_UpdateSkelAnime = 0x80B2B444; // type:func -EnZl2_GetCue = 0x80B2B468; // type:func -func_80B4EDB8 = 0x80B2B490; // type:func -func_80B4EE38 = 0x80B2B510; // type:func -func_80B4EF64 = 0x80B2B640; // type:func -func_80B4F230 = 0x80B2B910; // type:func -func_80B4F45C = 0x80B2BB40; // type:func -EnZl2_PostLimbDraw = 0x80B2C20C; // type:func -func_80B4FCCC = 0x80B2C358; // type:func -func_80B4FD00 = 0x80B2C390; // type:func -func_80B4FD90 = 0x80B2C420; // type:func -func_80B4FDD4 = 0x80B2C464; // type:func -func_80B4FE10 = 0x80B2C4A4; // type:func -func_80B4FE48 = 0x80B2C4DC; // type:func -func_80B4FE6C = 0x80B2C504; // type:func -func_80B4FE90 = 0x80B2C52C; // type:func -func_80B4FEB4 = 0x80B2C554; // type:func -func_80B4FED8 = 0x80B2C57C; // type:func -EnZl2_GiveLightArrows = 0x80B2C5A4; // type:func -func_80B4FF84 = 0x80B2C634; // type:func -func_80B4FFF0 = 0x80B2C6A0; // type:func -func_80B5008C = 0x80B2C740; // type:func -func_80B500E0 = 0x80B2C794; // type:func -func_80B501C4 = 0x80B2C878; // type:func -func_80B501E8 = 0x80B2C89C; // type:func -func_80B50260 = 0x80B2C914; // type:func -func_80B50278 = 0x80B2C930; // type:func -func_80B50304 = 0x80B2C9BC; // type:func -func_80B503DC = 0x80B2CA94; // type:func -func_80B5042C = 0x80B2CAE4; // type:func -func_80B50488 = 0x80B2CB40; // type:func -func_80B504D4 = 0x80B2CB8C; // type:func -func_80B5053C = 0x80B2CBF0; // type:func -func_80B50580 = 0x80B2CC38; // type:func -func_80B505D4 = 0x80B2CC8C; // type:func -func_80B50618 = 0x80B2CCD4; // type:func -func_80B50644 = 0x80B2CD00; // type:func -func_80B50670 = 0x80B2CD2C; // type:func -func_80B506C4 = 0x80B2CD80; // type:func -func_80B5073C = 0x80B2CDFC; // type:func -func_80B50780 = 0x80B2CE44; // type:func -func_80B507E8 = 0x80B2CEAC; // type:func -func_80B5082C = 0x80B2CEF4; // type:func -func_80B50880 = 0x80B2CF48; // type:func -func_80B508C8 = 0x80B2CF90; // type:func -func_80B50928 = 0x80B2CFEC; // type:func -func_80B50970 = 0x80B2D034; // type:func -func_80B50980 = 0x80B2D048; // type:func -func_80B509A0 = 0x80B2D06C; // type:func -func_80B50A04 = 0x80B2D0D0; // type:func -func_80B50BBC = 0x80B2D274; // type:func -func_80B50BEC = 0x80B2D2AC; // type:func -func_80B50C40 = 0x80B2D308; // type:func -func_80B50CA8 = 0x80B2D378; // type:func -func_80B50CFC = 0x80B2D3D4; // type:func -func_80B50D50 = 0x80B2D430; // type:func -func_80B50D94 = 0x80B2D47C; // type:func -func_80B50DE8 = 0x80B2D4D8; // type:func -func_80B50E3C = 0x80B2D534; // type:func -func_80B50E90 = 0x80B2D590; // type:func -func_80B50EE4 = 0x80B2D5EC; // type:func -func_80B50F38 = 0x80B2D648; // type:func -func_80B50F8C = 0x80B2D6A4; // type:func -func_80B50FE8 = 0x80B2D708; // type:func -func_80B51034 = 0x80B2D75C; // type:func -func_80B51080 = 0x80B2D7B0; // type:func -func_80B510CC = 0x80B2D804; // type:func -func_80B51118 = 0x80B2D858; // type:func -func_80B51164 = 0x80B2D8AC; // type:func -func_80B511B0 = 0x80B2D900; // type:func -func_80B511FC = 0x80B2D954; // type:func -func_80B51250 = 0x80B2D9B0; // type:func -func_80B512B8 = 0x80B2DA20; // type:func -func_80B51310 = 0x80B2DA80; // type:func -func_80B5135C = 0x80B2DAD0; // type:func -func_80B513A8 = 0x80B2DB1C; // type:func -func_80B51418 = 0x80B2DB90; // type:func -func_80B5146C = 0x80B2DBE4; // type:func -func_80B5149C = 0x80B2DC18; // type:func -func_80B514F8 = 0x80B2DC78; // type:func -func_80B5154C = 0x80B2DCCC; // type:func -func_80B515C4 = 0x80B2DD44; // type:func -func_80B515D8 = 0x80B2DD5C; // type:func -func_80B51644 = 0x80B2DDC8; // type:func -func_80B51678 = 0x80B2DDFC; // type:func -func_80B516D0 = 0x80B2DE54; // type:func -func_80B51704 = 0x80B2DE88; // type:func -func_80B5175C = 0x80B2DEE0; // type:func -func_80B51790 = 0x80B2DF14; // type:func -func_80B517E0 = 0x80B2DF64; // type:func -func_80B51824 = 0x80B2DFAC; // type:func -func_80B5187C = 0x80B2E004; // type:func -func_80B518C0 = 0x80B2E04C; // type:func -func_80B51948 = 0x80B2E0D4; // type:func -func_80B51A5C = 0x80B2E1D4; // type:func -func_80B51A8C = 0x80B2E20C; // type:func -func_80B51AE4 = 0x80B2E26C; // type:func -func_80B51B44 = 0x80B2E2D4; // type:func -func_80B51BA8 = 0x80B2E340; // type:func -func_80B51C0C = 0x80B2E3AC; // type:func -func_80B51C64 = 0x80B2E40C; // type:func -func_80B51CA8 = 0x80B2E458; // type:func -func_80B51D0C = 0x80B2E4C4; // type:func -func_80B51D24 = 0x80B2E4E0; // type:func -func_80B51DA4 = 0x80B2E560; // type:func -func_80B51EA8 = 0x80B2E664; // type:func -func_80B51EBC = 0x80B2E67C; // type:func -func_80B51F38 = 0x80B2E6FC; // type:func -func_80B51FA8 = 0x80B2E76C; // type:func -func_80B52068 = 0x80B2E818; // type:func -func_80B52098 = 0x80B2E850; // type:func -func_80B52108 = 0x80B2E8C8; // type:func -func_80B52114 = 0x80B2E8D8; // type:func -func_80B521A0 = 0x80B2E938; // type:func -EnZl2_Update = 0x80B2E9C4; // type:func -EnZl2_Init = 0x80B2EA0C; // type:func -EnZl2_OverrideLimbDraw = 0x80B2EAB8; // type:func -func_80B523BC = 0x80B2EB20; // type:func -func_80B523C8 = 0x80B2EB30; // type:func -func_80B525D4 = 0x80B2ED0C; // type:func -EnZl2_Draw = 0x80B2EEB4; // type:func -func_80B533B0 = 0x80B2F750; // type:func -func_80B533FC = 0x80B2F79C; // type:func -EnZl3_Destroy = 0x80B2F7E0; // type:func -func_80B53468 = 0x80B2F80C; // type:func -func_80B53488 = 0x80B2F82C; // type:func -EnZl3_UpdateEyes = 0x80B2F878; // type:func -EnZl3_setEyeIndex = 0x80B2F900; // type:func -EnZl3_setMouthIndex = 0x80B2F918; // type:func -func_80B5357C = 0x80B2F930; // type:func -func_80B53614 = 0x80B2F9CC; // type:func -func_80B5366C = 0x80B2FA24; // type:func -func_80B536B4 = 0x80B2FA6C; // type:func -func_80B536C4 = 0x80B2FA80; // type:func -func_80B53764 = 0x80B2FB24; // type:func -func_80B537E8 = 0x80B2FBAC; // type:func -func_80B538B0 = 0x80B2FC74; // type:func -EnZl3_UpdateSkelAnime = 0x80B2FD10; // type:func -func_80B5396C = 0x80B2FD34; // type:func -func_80B53974 = 0x80B2FD40; // type:func -func_80B53980 = 0x80B2FD54; // type:func -func_80B53B64 = 0x80B2FF3C; // type:func -func_80B54360 = 0x80B3074C; // type:func -func_80B5458C = 0x80B3097C; // type:func -EnZl3_PostLimbDraw = 0x80B31078; // type:func -func_80B54DB4 = 0x80B31144; // type:func -func_80B54DC4 = 0x80B31158; // type:func -func_80B54DD4 = 0x80B3116C; // type:func -func_80B54DE0 = 0x80B3117C; // type:func -func_80B54E14 = 0x80B311B4; // type:func -func_80B54EA4 = 0x80B31244; // type:func -func_80B54EF4 = 0x80B31298; // type:func -func_80B54F18 = 0x80B312C0; // type:func -func_80B54FB4 = 0x80B31360; // type:func -func_80B55054 = 0x80B313E4; // type:func -func_80B550F0 = 0x80B31484; // type:func -func_80B55144 = 0x80B314D8; // type:func -func_80B551E0 = 0x80B31578; // type:func -func_80B55220 = 0x80B315B8; // type:func -func_80B55268 = 0x80B31600; // type:func -func_80B552A8 = 0x80B31640; // type:func -func_80B552DC = 0x80B31674; // type:func -func_80B55334 = 0x80B316D0; // type:func -func_80B55368 = 0x80B31704; // type:func -func_80B553B4 = 0x80B31750; // type:func -func_80B553E8 = 0x80B31784; // type:func -func_80B55408 = 0x80B317A4; // type:func -func_80B55444 = 0x80B317E0; // type:func -func_80B55550 = 0x80B318E4; // type:func -func_80B555A4 = 0x80B31940; // type:func -func_80B55604 = 0x80B319A8; // type:func -func_80B5566C = 0x80B31A18; // type:func -func_80B556CC = 0x80B31A80; // type:func -func_80B5572C = 0x80B31AE8; // type:func -func_80B55780 = 0x80B31B44; // type:func -func_80B55808 = 0x80B31BA8; // type:func -func_80B5582C = 0x80B31BD0; // type:func -func_80B5585C = 0x80B31C00; // type:func -func_80B558A8 = 0x80B31C4C; // type:func -func_80B559C4 = 0x80B31D6C; // type:func -func_80B55A58 = 0x80B31DFC; // type:func -func_80B55A84 = 0x80B31E28; // type:func -func_80B55AC4 = 0x80B31E68; // type:func -func_80B55B04 = 0x80B31EA8; // type:func -func_80B55B38 = 0x80B31EDC; // type:func -func_80B55B78 = 0x80B31F1C; // type:func -func_80B55BAC = 0x80B31F50; // type:func -func_80B55C0C = 0x80B31FB4; // type:func -func_80B55C4C = 0x80B31FF4; // type:func -func_80B55C70 = 0x80B3201C; // type:func -func_80B55CCC = 0x80B32074; // type:func -func_80B55D00 = 0x80B320A8; // type:func -func_80B55DB0 = 0x80B3215C; // type:func -func_80B55E08 = 0x80B321B4; // type:func -func_80B55E48 = 0x80B321F4; // type:func -func_80B55E7C = 0x80B32228; // type:func -func_80B55EBC = 0x80B32268; // type:func -func_80B55EF0 = 0x80B3229C; // type:func -func_80B55F38 = 0x80B322E4; // type:func -func_80B55F6C = 0x80B32318; // type:func -func_80B5604C = 0x80B323FC; // type:func -func_80B56090 = 0x80B32440; // type:func -func_80B56108 = 0x80B324BC; // type:func -func_80B56160 = 0x80B32514; // type:func -func_80B561A0 = 0x80B32554; // type:func -func_80B561E0 = 0x80B32594; // type:func -func_80B56214 = 0x80B325C8; // type:func -func_80B562F4 = 0x80B326AC; // type:func -func_80B5634C = 0x80B32704; // type:func -func_80B5638C = 0x80B32744; // type:func -func_80B563C0 = 0x80B32778; // type:func -func_80B56400 = 0x80B327B8; // type:func -func_80B56434 = 0x80B327EC; // type:func -func_80B56474 = 0x80B3282C; // type:func -func_80B564A8 = 0x80B32860; // type:func -func_80B56658 = 0x80B32A00; // type:func -func_80B566AC = 0x80B32A5C; // type:func -func_80B5670C = 0x80B32AC4; // type:func -func_80B5676C = 0x80B32B2C; // type:func -func_80B567CC = 0x80B32B94; // type:func -func_80B5682C = 0x80B32BFC; // type:func -func_80B568B4 = 0x80B32C8C; // type:func -func_80B5691C = 0x80B32CFC; // type:func -func_80B5697C = 0x80B32D64; // type:func -func_80B569E4 = 0x80B32DD4; // type:func -func_80B56A68 = 0x80B32E60; // type:func -func_80B56AE0 = 0x80B32EE0; // type:func -func_80B56B54 = 0x80B32F5C; // type:func -func_80B56BA8 = 0x80B32FB8; // type:func -func_80B56C24 = 0x80B3303C; // type:func -func_80B56C84 = 0x80B330A4; // type:func -func_80B56CE4 = 0x80B3310C; // type:func -func_80B56D44 = 0x80B33174; // type:func -func_80B56DA4 = 0x80B331DC; // type:func -func_80B56DC8 = 0x80B33200; // type:func -func_80B56DEC = 0x80B33228; // type:func -func_80B56E38 = 0x80B33274; // type:func -func_80B56EB8 = 0x80B332F4; // type:func -func_80B56EE4 = 0x80B33324; // type:func -func_80B56F10 = 0x80B33354; // type:func -func_80B56F8C = 0x80B333A8; // type:func -func_80B56FAC = 0x80B333C8; // type:func -func_80B57034 = 0x80B33454; // type:func -func_80B57104 = 0x80B33528; // type:func -func_80B571A8 = 0x80B335D0; // type:func -func_80B571FC = 0x80B33624; // type:func -func_80B57240 = 0x80B33668; // type:func -func_80B57298 = 0x80B336C0; // type:func -func_80B572F0 = 0x80B33718; // type:func -func_80B57324 = 0x80B33750; // type:func -func_80B57350 = 0x80B3377C; // type:func -func_80B573C8 = 0x80B337F4; // type:func -func_80B573FC = 0x80B33828; // type:func -func_80B57458 = 0x80B33884; // type:func -func_80B57564 = 0x80B33994; // type:func -func_80B575B0 = 0x80B339E8; // type:func -func_80B575D0 = 0x80B33A08; // type:func -func_80B575F0 = 0x80B33A28; // type:func -func_80B5764C = 0x80B33A84; // type:func -func_80B576C8 = 0x80B33B04; // type:func -func_80B57704 = 0x80B33B48; // type:func -func_80B5772C = 0x80B33B74; // type:func -func_80B57754 = 0x80B33BA0; // type:func -func_80B577BC = 0x80B33C0C; // type:func -func_80B57858 = 0x80B33CAC; // type:func -func_80B57890 = 0x80B33CE8; // type:func -func_80B57A74 = 0x80B33ED0; // type:func -func_80B57AAC = 0x80B33F08; // type:func -func_80B57AE0 = 0x80B33F3C; // type:func -func_80B57C54 = 0x80B340B4; // type:func -func_80B57C7C = 0x80B340DC; // type:func -func_80B57C8C = 0x80B340F0; // type:func -func_80B57CB4 = 0x80B34118; // type:func -func_80B57D60 = 0x80B341C0; // type:func -func_80B57D80 = 0x80B341E4; // type:func -func_80B57EAC = 0x80B3431C; // type:func -func_80B57EEC = 0x80B34364; // type:func -func_80B57F1C = 0x80B34398; // type:func -func_80B57F84 = 0x80B34404; // type:func -func_80B58014 = 0x80B3449C; // type:func -func_80B58214 = 0x80B346A8; // type:func -func_80B58268 = 0x80B34700; // type:func -func_80B582C8 = 0x80B34760; // type:func -func_80B584B4 = 0x80B3494C; // type:func -func_80B58624 = 0x80B34ABC; // type:func -func_80B5884C = 0x80B34CEC; // type:func -func_80B58898 = 0x80B34D38; // type:func -func_80B588E8 = 0x80B34D88; // type:func -func_80B58938 = 0x80B34DD8; // type:func -func_80B5899C = 0x80B34E40; // type:func -func_80B58A1C = 0x80B34EC0; // type:func -func_80B58A50 = 0x80B34EFC; // type:func -func_80B58AAC = 0x80B34F5C; // type:func -func_80B58C08 = 0x80B350B8; // type:func -func_80B58D50 = 0x80B35200; // type:func -func_80B58DB0 = 0x80B35268; // type:func -func_80B58E10 = 0x80B352D0; // type:func -func_80B58E7C = 0x80B35344; // type:func -func_80B58EF4 = 0x80B353C4; // type:func -func_80B58F6C = 0x80B35444; // type:func -func_80B58FDC = 0x80B354BC; // type:func -func_80B5904C = 0x80B35534; // type:func -func_80B590BC = 0x80B355AC; // type:func -func_80B5912C = 0x80B35624; // type:func -func_80B591BC = 0x80B356BC; // type:func -func_80B5922C = 0x80B35734; // type:func -func_80B592A8 = 0x80B357B8; // type:func -func_80B59340 = 0x80B35858; // type:func -func_80B593D0 = 0x80B358F0; // type:func -func_80B5944C = 0x80B35974; // type:func -func_80B59698 = 0x80B35B70; // type:func -func_80B59768 = 0x80B35C40; // type:func -func_80B59828 = 0x80B35D00; // type:func -func_80B59A80 = 0x80B35F60; // type:func -func_80B59AD0 = 0x80B35FB0; // type:func -func_80B59B6C = 0x80B3604C; // type:func -func_80B59DB8 = 0x80B36294; // type:func -EnZl3_Update = 0x80B36304; // type:func -EnZl3_Init = 0x80B3634C; // type:func -EnZl3_OverrideLimbDraw = 0x80B3640C; // type:func -func_80B59FE8 = 0x80B36474; // type:func -func_80B59FF4 = 0x80B36484; // type:func -func_80B5A1D0 = 0x80B36630; // type:func -EnZl3_Draw = 0x80B367D8; // type:func -EnZl4_SetActiveCamDir = 0x80B375A0; // type:func -EnZl4_SetActiveCamMove = 0x80B37678; // type:func -EnZl4_GetTextId = 0x80B376FC; // type:func -EnZl4_UpdateTalkState = 0x80B377A0; // type:func -EnZl4_UpdateFace = 0x80B377DC; // type:func -EnZl4_SetMove = 0x80B3792C; // type:func -func_80B5BB78 = 0x80B3796C; // type:func -EnZl4_GetCueStartPos = 0x80B379B8; // type:func -EnZl4_SetupFromLegendCs = 0x80B379FC; // type:func -EnZl4_InMovingAnim = 0x80B37AD4; // type:func -EnZl4_Init = 0x80B37BA4; // type:func -EnZl4_Destroy = 0x80B37D60; // type:func -EnZl4_SetNextAnim = 0x80B37D8C; // type:func -EnZl4_ReverseAnimation = 0x80B37DE0; // type:func -EnZl4_CsWaitForPlayer = 0x80B37E08; // type:func -EnZl4_CsMeetPlayer = 0x80B37F68; // type:func -EnZl4_CsAskStone = 0x80B38260; // type:func -EnZl4_CsAskName = 0x80B3878C; // type:func -EnZl4_CsTellLegend = 0x80B38D78; // type:func -EnZl4_CsLookWindow = 0x80B391D4; // type:func -EnZl4_CsWarnAboutGanon = 0x80B39418; // type:func -EnZl4_CsMakePlan = 0x80B398E0; // type:func -EnZl4_Cutscene = 0x80B39C24; // type:func -EnZl4_Idle = 0x80B39E9C; // type:func -EnZl4_TheEnd = 0x80B39F14; // type:func -EnZl4_Update = 0x80B3A0C4; // type:func -EnZl4_OverrideLimbDraw = 0x80B3A174; // type:func -EnZl4_PostLimbDraw = 0x80B3A304; // type:func -EnZl4_Draw = 0x80B3A360; // type:func -EnZo_SpawnRipple = 0x80B3BFD0; // type:func -EnZo_SpawnBubble = 0x80B3C064; // type:func -EnZo_SpawnSplash = 0x80B3C194; // type:func -EnZo_UpdateEffectsRipples = 0x80B3C300; // type:func -EnZo_UpdateEffectsBubbles = 0x80B3C3BC; // type:func -EnZo_UpdateEffectsSplashes = 0x80B3C4EC; // type:func -EnZo_DrawEffectsRipples = 0x80B3C624; // type:func -EnZo_DrawEffectsBubbles = 0x80B3C7D4; // type:func -EnZo_DrawEffectsSplashes = 0x80B3C980; // type:func -EnZo_TreadWaterRipples = 0x80B3CB38; // type:func -EnZo_SpawnSplashes = 0x80B3CBB4; // type:func -EnZo_GetTextId = 0x80B3CD28; // type:func -EnZo_UpdateTalkState = 0x80B3CF9C; // type:func -EnZo_Blink = 0x80B3D100; // type:func -EnZo_Dialog = 0x80B3D178; // type:func -EnZo_PlayerInProximity = 0x80B3D258; // type:func -EnZo_SetAnimation = 0x80B3D2F8; // type:func -EnZo_Init = 0x80B3D3F0; // type:func -EnZo_Destroy = 0x80B3D5F8; // type:func -EnZo_Standing = 0x80B3D608; // type:func -EnZo_Submerged = 0x80B3D6EC; // type:func -EnZo_Surface = 0x80B3D72C; // type:func -EnZo_TreadWater = 0x80B3D810; // type:func -EnZo_Dive = 0x80B3D9C0; // type:func -EnZo_Update = 0x80B3DB08; // type:func -EnZo_OverrideLimbDraw = 0x80B3DCE8; // type:func -EnZo_PostLimbDraw = 0x80B3DF08; // type:func -EnZo_Draw = 0x80B3DF64; // type:func -EnfHG_Init = 0x80B3E590; // type:func -EnfHG_Destroy = 0x80B3E690; // type:func -EnfHG_SetupIntro = 0x80B3E6BC; // type:func -EnfHG_Intro = 0x80B3E720; // type:func -EnfHG_SetupApproach = 0x80B3F92C; // type:func -EnfHG_Approach = 0x80B3FB78; // type:func -EnfHG_Attack = 0x80B3FD1C; // type:func -EnfHG_Damage = 0x80B401A0; // type:func -EnfHG_Retreat = 0x80B404D0; // type:func -EnfHG_Done = 0x80B40704; // type:func -EnfHG_Update = 0x80B40714; // type:func -EnfHG_PostDraw = 0x80B408A8; // type:func -EnfHG_Draw = 0x80B408BC; // type:func -EndTitle_Init = 0x80B40EC0; // type:func -EndTitle_Destroy = 0x80B40EF0; // type:func -EndTitle_Update = 0x80B40F00; // type:func -EndTitle_DrawFull = 0x80B40F10; // type:func -EndTitle_DrawNintendoLogo = 0x80B414DC; // type:func -Fishing_SetColliderElement = 0x80B44FE0; // type:func -Fishing_SeedRand = 0x80B45090; // type:func -Fishing_RandZeroOne = 0x80B450B0; // type:func -Fishing_SmoothStepToS = 0x80B451D8; // type:func -Fishing_SpawnRipple = 0x80B45284; // type:func -Fishing_SpawnDustSplash = 0x80B453DC; // type:func -Fishing_SpawnWaterDust = 0x80B45524; // type:func -Fishing_SpawnBubble = 0x80B4565C; // type:func -Fishing_SpawnRainDrop = 0x80B4578C; // type:func -Fishing_InitPondProps = 0x80B45884; // type:func -Fishing_Init = 0x80B45B98; // type:func -Fishing_Destroy = 0x80B46460; // type:func -Fishing_UpdateEffects = 0x80B464D8; // type:func -Fishing_DrawEffects = 0x80B46C1C; // type:func -Fishing_DrawStreamSplash = 0x80B47648; // type:func -Fishing_IsAboveCounter = 0x80B477CC; // type:func -Fishing_UpdateLine = 0x80B478C0; // type:func -Fishing_UpdateLinePos = 0x80B47E4C; // type:func -Fishing_DrawLureHook = 0x80B47FE4; // type:func -Fishing_UpdateSinkingLure = 0x80B484E4; // type:func -Fishing_DrawSinkingLure = 0x80B487E8; // type:func -Fishing_DrawLureAndLine = 0x80B48AD4; // type:func -Fishing_DrawRod = 0x80B49324; // type:func -Fishing_UpdateLure = 0x80B49DAC; // type:func -Fishing_SplashBySize = 0x80B4BD78; // type:func -Fishing_SplashBySize2 = 0x80B4C040; // type:func -func_80B70ED4 = 0x80B4C224; // type:func -Fishing_FishLeapSfx = 0x80B4C5C8; // type:func -Fishing_HandleAquariumDialog = 0x80B4C788; // type:func -Fishing_UpdateFish = 0x80B4C948; // type:func -Fishing_FishOverrideLimbDraw = 0x80B50D90; // type:func -Fishing_FishPostLimbDraw = 0x80B50EB0; // type:func -Fishing_LoachOverrideLimbDraw = 0x80B50EF0; // type:func -Fishing_LoachPostLimbDraw = 0x80B50F70; // type:func -Fishing_DrawFish = 0x80B50FB0; // type:func -Fishing_HandleReedContact = 0x80B511F8; // type:func -Fishing_HandleLilyPadContact = 0x80B512A4; // type:func -Fishing_UpdatePondProps = 0x80B5138C; // type:func -Fishing_DrawPondProps = 0x80B51648; // type:func -Fishing_UpdateGroupFishes = 0x80B51A6C; // type:func -Fishing_DrawGroupFishes = 0x80B5233C; // type:func -Fishing_HandleOwnerDialog = 0x80B52530; // type:func -Fishing_UpdateOwner = 0x80B533B4; // type:func -Fishing_OwnerOverrideLimbDraw = 0x80B550BC; // type:func -Fishing_OwnerPostLimbDraw = 0x80B550F4; // type:func -Fishing_DrawOwner = 0x80B55204; // type:func -ItemBHeart_Init = 0x80B5FB80; // type:func -ItemBHeart_Destroy = 0x80B5FBEC; // type:func -ItemBHeart_Update = 0x80B5FBFC; // type:func -func_80B85264 = 0x80B5FCA4; // type:func -ItemBHeart_Draw = 0x80B5FD90; // type:func -ItemEtcetera_SetupAction = 0x80B5FF90; // type:func -ItemEtcetera_Init = 0x80B5FF9C; // type:func -ItemEtcetera_Destroy = 0x80B6011C; // type:func -ItemEtcetera_WaitForObject = 0x80B6012C; // type:func -func_80B85824 = 0x80B60184; // type:func -func_80B858B4 = 0x80B6021C; // type:func -ItemEtcetera_SpawnSparkles = 0x80B602FC; // type:func -ItemEtcetera_MoveFireArrowDown = 0x80B6040C; // type:func -func_80B85B28 = 0x80B6049C; // type:func -ItemEtcetera_UpdateFireArrow = 0x80B604E4; // type:func -ItemEtcetera_Update = 0x80B60564; // type:func -ItemEtcetera_DrawThroughLens = 0x80B60588; // type:func -ItemEtcetera_Draw = 0x80B605E0; // type:func -ItemInbox_Init = 0x80B60860; // type:func -ItemInbox_Destroy = 0x80B60894; // type:func -ItemInbox_Wait = 0x80B608A4; // type:func -ItemInbox_Update = 0x80B608EC; // type:func -ItemInbox_Draw = 0x80B60910; // type:func -ItemOcarina_SetupAction = 0x80B609C0; // type:func -ItemOcarina_Init = 0x80B609CC; // type:func -ItemOcarina_Destroy = 0x80B60B54; // type:func -ItemOcarina_Fly = 0x80B60B64; // type:func -ItemOcarina_GetThrown = 0x80B60D10; // type:func -func_80B864EC = 0x80B60D68; // type:func -func_80B865E0 = 0x80B60E5C; // type:func -ItemOcarina_DoNothing = 0x80B60EBC; // type:func -ItemOcarina_StartSoTCutscene = 0x80B60ECC; // type:func -ItemOcarina_WaitInWater = 0x80B60F40; // type:func -ItemOcarina_Update = 0x80B61014; // type:func -ItemOcarina_Draw = 0x80B61038; // type:func -ItemShield_SetupAction = 0x80B61190; // type:func -ItemShield_Init = 0x80B6119C; // type:func -ItemShield_Destroy = 0x80B61304; // type:func -func_80B86AC8 = 0x80B61330; // type:func -func_80B86BC8 = 0x80B61434; // type:func -func_80B86CA8 = 0x80B6151C; // type:func -func_80B86F68 = 0x80B617E0; // type:func -ItemShield_Update = 0x80B618EC; // type:func -ItemShield_Draw = 0x80B61910; // type:func -MagicDark_Init = 0x80B61BA0; // type:func -MagicDark_Destroy = 0x80B61C84; // type:func -MagicDark_DiamondUpdate = 0x80B61CBC; // type:func -MagicDark_DimLighting = 0x80B61F04; // type:func -MagicDark_OrbUpdate = 0x80B62050; // type:func -MagicDark_DiamondDraw = 0x80B621F8; // type:func -MagicDark_OrbDraw = 0x80B62460; // type:func -MagicFire_Init = 0x80B633F0; // type:func -MagicFire_Destroy = 0x80B6349C; // type:func -MagicFire_UpdateBeforeCast = 0x80B634C0; // type:func -MagicFire_Update = 0x80B63564; // type:func -MagicFire_Draw = 0x80B638F8; // type:func -MagicWind_SetupAction = 0x80B656F0; // type:func -MagicWind_Init = 0x80B656FC; // type:func -MagicWind_Destroy = 0x80B65808; // type:func -MagicWind_UpdateAlpha = 0x80B6583C; // type:func -MagicWind_WaitForTimer = 0x80B6595C; // type:func -MagicWind_Grow = 0x80B659D8; // type:func -MagicWind_WaitAtFullSize = 0x80B65A28; // type:func -MagicWind_FadeOut = 0x80B65A74; // type:func -MagicWind_Shrink = 0x80B65AD8; // type:func -MagicWind_Update = 0x80B65B18; // type:func -MagicWind_OverrideLimbDraw = 0x80B65B6C; // type:func -MagicWind_Draw = 0x80B65CF0; // type:func -MirRay_SetupCollider = 0x80B673F0; // type:func -MirRay_MakeShieldLight = 0x80B674B8; // type:func -MirRay_Init = 0x80B6765C; // type:func -MirRay_Destroy = 0x80B678F4; // type:func -MirRay_Update = 0x80B6796C; // type:func -MirRay_SetIntensity = 0x80B67A58; // type:func -MirRay_SetupReflectionPolys = 0x80B67C0C; // type:func -MirRay_RemoveSimilarReflections = 0x80B67DE8; // type:func -MirRay_ReflectedBeam = 0x80B67EEC; // type:func -MirRay_Draw = 0x80B6845C; // type:func -MirRay_CheckInFrustum = 0x80B68738; // type:func -ObjBean_InitCollider = 0x80B68CA0; // type:func -ObjBean_InitDynaPoly = 0x80B68CF8; // type:func -ObjBean_FindFloor = 0x80B68D50; // type:func -func_80B8EBC8 = 0x80B68DB8; // type:func -ObjBean_UpdatePosition = 0x80B68DD8; // type:func -func_80B8EDF4 = 0x80B68FE8; // type:func -func_80B8EE24 = 0x80B69018; // type:func -ObjBean_Move = 0x80B690F0; // type:func -ObjBean_SetDrawMode = 0x80B69120; // type:func -ObjBean_SetupPathCount = 0x80B69144; // type:func -ObjBean_SetupPath = 0x80B69184; // type:func -ObjBean_FollowPath = 0x80B69200; // type:func -ObjBean_CheckForHorseTrample = 0x80B694A8; // type:func -ObjBean_Break = 0x80B69538; // type:func -ObjBean_UpdateLeaves = 0x80B697B0; // type:func -ObjBean_SetupLeavesStill = 0x80B6986C; // type:func -ObjBean_LeavesStill = 0x80B698DC; // type:func -ObjBean_SetupShakeLeaves = 0x80B69920; // type:func -ObjBean_ShakeLeaves = 0x80B69998; // type:func -ObjBean_SetupShakeLeavesFast = 0x80B69A1C; // type:func -ObjBean_ShakeLeavesFast = 0x80B69A60; // type:func -ObjBean_SetupGrow = 0x80B69AE8; // type:func -ObjBean_Grow = 0x80B69AFC; // type:func -ObjBean_SetupFlattenLeaves = 0x80B69B60; // type:func -ObjBean_FlattenLeaves = 0x80B69B7C; // type:func -ObjBean_SetupGrown = 0x80B69BF8; // type:func -ObjBean_Grown = 0x80B69C3C; // type:func -ObjBean_Init = 0x80B69C98; // type:func -ObjBean_Destroy = 0x80B69E54; // type:func -ObjBean_SetupWaitForBean = 0x80B69ED0; // type:func -ObjBean_WaitForBean = 0x80B69F08; // type:func -func_80B8FE00 = 0x80B69F84; // type:func -func_80B8FE3C = 0x80B69FBC; // type:func -func_80B8FE6C = 0x80B69FEC; // type:func -func_80B8FEAC = 0x80B6A02C; // type:func -func_80B8FF50 = 0x80B6A0D0; // type:func -func_80B8FF8C = 0x80B6A108; // type:func -func_80B90010 = 0x80B6A18C; // type:func -func_80B90050 = 0x80B6A1C8; // type:func -ObjBean_SetupWaitForWater = 0x80B6A288; // type:func -ObjBean_WaitForWater = 0x80B6A2D0; // type:func -ObjBean_SetupGrowWaterPhase1 = 0x80B6A3C8; // type:func -ObjBean_GrowWaterPhase1 = 0x80B6A408; // type:func -ObjBean_SetupGrowWaterPhase2 = 0x80B6A44C; // type:func -ObjBean_GrowWaterPhase2 = 0x80B6A488; // type:func -ObjBean_SetupGrowWaterPhase3 = 0x80B6A538; // type:func -ObjBean_GrowWaterPhase3 = 0x80B6A570; // type:func -ObjBean_SetupGrowWaterPhase4 = 0x80B6A684; // type:func -ObjBean_GrowWaterPhase4 = 0x80B6A6BC; // type:func -ObjBean_SetupGrowWaterPhase5 = 0x80B6A758; // type:func -ObjBean_GrowWaterPhase5 = 0x80B6A790; // type:func -ObjBean_SetupWaitForPlayer = 0x80B6A7E8; // type:func -ObjBean_WaitForPlayer = 0x80B6A814; // type:func -ObjBean_SetupFly = 0x80B6A888; // type:func -ObjBean_Fly = 0x80B6A8CC; // type:func -ObjBean_SetupWaitForStepOff = 0x80B6A9FC; // type:func -ObjBean_WaitForStepOff = 0x80B6AA28; // type:func -func_80B908EC = 0x80B6AA68; // type:func -func_80B90918 = 0x80B6AA94; // type:func -func_80B90970 = 0x80B6AAF0; // type:func -func_80B909B0 = 0x80B6AB30; // type:func -func_80B909F8 = 0x80B6AB78; // type:func -func_80B90A34 = 0x80B6ABB0; // type:func -ObjBean_Update = 0x80B6AC50; // type:func -ObjBean_DrawSoftSoilSpot = 0x80B6ADE0; // type:func -ObjBean_DrawBeanstalk = 0x80B6AE68; // type:func -ObjBean_Draw = 0x80B6AEF4; // type:func -ObjBlockstop_Init = 0x80B6B430; // type:func -ObjBlockstop_Destroy = 0x80B6B48C; // type:func -ObjBlockstop_Update = 0x80B6B49C; // type:func -ObjBombiwa_InitCollision = 0x80B6B5D0; // type:func -ObjBombiwa_Init = 0x80B6B628; // type:func -ObjBombiwa_Destroy = 0x80B6B6F4; // type:func -ObjBombiwa_Break = 0x80B6B720; // type:func -ObjBombiwa_Update = 0x80B6B920; // type:func -ObjBombiwa_Draw = 0x80B6BA30; // type:func -ObjComb_Break = 0x80B6BB40; // type:func -ObjComb_ChooseItemDrop = 0x80B6BE30; // type:func -ObjComb_Init = 0x80B6BF00; // type:func -ObjComb_Destroy = 0x80B6BF70; // type:func -ObjComb_SetupWait = 0x80B6BF9C; // type:func -ObjComb_Wait = 0x80B6BFB0; // type:func -ObjComb_Update = 0x80B6C09C; // type:func -ObjComb_Draw = 0x80B6C114; // type:func -ObjDekujr_Init = 0x80B6C3A0; // type:func -ObjDekujr_Destroy = 0x80B6C4AC; // type:func -ObjDekujr_GetCueStartPos = 0x80B6C4BC; // type:func -ObjDekujr_GetCueEndPos = 0x80B6C500; // type:func -ObjDekujr_ComeUp = 0x80B6C544; // type:func -ObjDekujr_Update = 0x80B6C6F4; // type:func -ObjDekujr_Draw = 0x80B6C7E4; // type:func -ObjElevator_SetupAction = 0x80B6C9E0; // type:func -func_80B92B08 = 0x80B6C9EC; // type:func -ObjElevator_Init = 0x80B6CA44; // type:func -ObjElevator_Destroy = 0x80B6CAD4; // type:func -func_80B92C5C = 0x80B6CB08; // type:func -func_80B92C80 = 0x80B6CB2C; // type:func -func_80B92D20 = 0x80B6CBCC; // type:func -func_80B92D44 = 0x80B6CBF0; // type:func -ObjElevator_Update = 0x80B6CC74; // type:func -ObjElevator_Draw = 0x80B6CCA8; // type:func -ObjHamishi_InitCollision = 0x80B6CDA0; // type:func -ObjHamishi_Shake = 0x80B6CDF8; // type:func -ObjHamishi_Break = 0x80B6CF74; // type:func -ObjHamishi_Init = 0x80B6D220; // type:func -ObjHamishi_Destroy = 0x80B6D308; // type:func -ObjHamishi_Update = 0x80B6D334; // type:func -ObjHamishi_Draw = 0x80B6D464; // type:func -ObjHana_Init = 0x80B6D5F0; // type:func -ObjHana_Destroy = 0x80B6D6EC; // type:func -ObjHana_Update = 0x80B6D738; // type:func -ObjHana_Draw = 0x80B6D7A8; // type:func -ObjHsblock_SetupAction = 0x80B6D900; // type:func -func_80B93B68 = 0x80B6D90C; // type:func -func_80B93BF0 = 0x80B6D964; // type:func -ObjHsblock_Init = 0x80B6D9E8; // type:func -ObjHsblock_Destroy = 0x80B6DAB8; // type:func -func_80B93D90 = 0x80B6DAEC; // type:func -func_80B93DB0 = 0x80B6DB0C; // type:func -func_80B93DF4 = 0x80B6DB50; // type:func -func_80B93E38 = 0x80B6DB98; // type:func -func_80B93E5C = 0x80B6DBBC; // type:func -ObjHsblock_Update = 0x80B6DC64; // type:func -ObjHsblock_Draw = 0x80B6DCB0; // type:func -ObjIcePoly_Init = 0x80B6DED0; // type:func -ObjIcePoly_Destroy = 0x80B6E090; // type:func -ObjIcePoly_Idle = 0x80B6E0E0; // type:func -ObjIcePoly_Melt = 0x80B6E310; // type:func -ObjIcePoly_Update = 0x80B6E5C8; // type:func -ObjIcePoly_Draw = 0x80B6E5EC; // type:func -ObjKibako_SpawnCollectible = 0x80B6E880; // type:func -ObjKibako_ApplyGravity = 0x80B6E8E0; // type:func -ObjKibako_InitCollider = 0x80B6E914; // type:func -ObjKibako_Init = 0x80B6E96C; // type:func -ObjKibako_Destroy = 0x80B6E9E4; // type:func -ObjKibako_AirBreak = 0x80B6EA10; // type:func -ObjKibako_WaterBreak = 0x80B6EC90; // type:func -ObjKibako_SetupIdle = 0x80B6EF10; // type:func -ObjKibako_Idle = 0x80B6EF2C; // type:func -ObjKibako_SetupHeld = 0x80B6F128; // type:func -ObjKibako_Held = 0x80B6F15C; // type:func -ObjKibako_SetupThrown = 0x80B6F228; // type:func -ObjKibako_Thrown = 0x80B6F288; // type:func -ObjKibako_Update = 0x80B6F3C4; // type:func -ObjKibako_Draw = 0x80B6F3E8; // type:func -ObjKibako2_InitCollider = 0x80B6F580; // type:func -ObjKibako2_Break = 0x80B6F5D8; // type:func -ObjKibako2_SpawnCollectible = 0x80B6F854; // type:func -ObjKibako2_Init = 0x80B6F8A4; // type:func -ObjKibako2_Destroy = 0x80B6F950; // type:func -ObjKibako2_Idle = 0x80B6F998; // type:func -ObjKibako2_Kill = 0x80B6FA70; // type:func -ObjKibako2_Update = 0x80B6FAF4; // type:func -ObjKibako2_Draw = 0x80B6FB18; // type:func -ObjLift_SetupAction = 0x80B6FC40; // type:func -ObjLift_InitDynaPoly = 0x80B6FC4C; // type:func -ObjLift_SpawnFragments = 0x80B6FCA4; // type:func -ObjLift_Init = 0x80B6FF28; // type:func -ObjLift_Destroy = 0x80B70028; // type:func -ObjLift_SetupWait = 0x80B7005C; // type:func -ObjLift_Wait = 0x80B700A0; // type:func -ObjLift_SetupShake = 0x80B70190; // type:func -ObjLift_Shake = 0x80B701BC; // type:func -ObjLift_SetupFall = 0x80B70304; // type:func -ObjLift_Fall = 0x80B70388; // type:func -ObjLift_Update = 0x80B7048C; // type:func -ObjLift_Draw = 0x80B704C0; // type:func -ObjLightswitch_InitCollider = 0x80B70660; // type:func -ObjLightswitch_SetSwitchFlag = 0x80B706FC; // type:func -ObjLightswitch_ClearSwitchFlag = 0x80B707C0; // type:func -ObjLightswitch_SpawnDisappearEffects = 0x80B70840; // type:func -ObjLightswitch_Init = 0x80B70A68; // type:func -ObjLightswitch_Destroy = 0x80B70BFC; // type:func -ObjLightswitch_SetupOff = 0x80B70C28; // type:func -ObjLightswitch_Off = 0x80B70C5C; // type:func -ObjLightswitch_SetupTurnOn = 0x80B70D3C; // type:func -ObjLightswitch_TurnOn = 0x80B70D60; // type:func -ObjLightswitch_SetupOn = 0x80B70E54; // type:func -ObjLightswitch_On = 0x80B70E90; // type:func -ObjLightswitch_SetupTurnOff = 0x80B70FA4; // type:func -ObjLightswitch_TurnOff = 0x80B70FD0; // type:func -ObjLightswitch_SetupDisappearDelay = 0x80B710C0; // type:func -ObjLightswitch_DisappearDelay = 0x80B710DC; // type:func -ObjLightswitch_SetupDisappear = 0x80B71124; // type:func -ObjLightswitch_Disappear = 0x80B71140; // type:func -ObjLightswitch_Update = 0x80B71184; // type:func -ObjLightswitch_DrawOpa = 0x80B71268; // type:func -ObjLightswitch_DrawXlu = 0x80B71590; // type:func -ObjLightswitch_Draw = 0x80B71840; // type:func -ObjMakekinsuta_Init = 0x80B71A90; // type:func -func_80B98320 = 0x80B71AA8; // type:func -ObjMakekinsuta_DoNothing = 0x80B71B5C; // type:func -ObjMakekinsuta_Update = 0x80B71B6C; // type:func -ObjMakeoshihiki_Init = 0x80B71BE0; // type:func -ObjMakeoshihiki_Draw = 0x80B71D54; // type:func -ObjMure_SetCullingImpl = 0x80B72070; // type:func -ObjMure_SetCulling = 0x80B720C8; // type:func -ObjMure_Init = 0x80B720F4; // type:func -ObjMure_Destroy = 0x80B721A4; // type:func -ObjMure_GetMaxChildSpawns = 0x80B721B4; // type:func -ObjMure_GetSpawnPos = 0x80B721E0; // type:func -ObjMure_SpawnActors0 = 0x80B72208; // type:func -ObjMure_SpawnActors1 = 0x80B723D0; // type:func -ObjMure_SpawnActors = 0x80B7251C; // type:func -ObjMure_KillActorsImpl = 0x80B7256C; // type:func -ObjMure_KillActors = 0x80B72664; // type:func -ObjMure_CheckChildren = 0x80B72684; // type:func -ObjMure_InitialAction = 0x80B72748; // type:func -ObjMure_CulledState = 0x80B72760; // type:func -ObjMure_SetFollowTargets = 0x80B727C0; // type:func -ObjMure_SetChildToFollowPlayer = 0x80B72898; // type:func -ObjMure_GroupBehavior0 = 0x80B72A18; // type:func -ObjMure_GroupBehavior1 = 0x80B72C40; // type:func -ObjMure_ActiveState = 0x80B72DC4; // type:func -ObjMure_Update = 0x80B72E6C; // type:func -ObjMure2_SetPosShrubCircle = 0x80B73080; // type:func -ObjMure2_SetPosShrubScattered = 0x80B7319C; // type:func -ObjMure2_SetPosRockCircle = 0x80B7329C; // type:func -ObjMure2_SetActorSpawnParams = 0x80B733A8; // type:func -ObjMure2_SpawnActors = 0x80B733FC; // type:func -ObjMure2_CleanupAndDie = 0x80B73558; // type:func -func_80B9A534 = 0x80B73658; // type:func -ObjMure2_Init = 0x80B736EC; // type:func -ObjMure2_SetupWait = 0x80B7374C; // type:func -ObjMure2_Wait = 0x80B73760; // type:func -func_80B9A658 = 0x80B73784; // type:func -func_80B9A668 = 0x80B73798; // type:func -func_80B9A6E8 = 0x80B73818; // type:func -func_80B9A6F8 = 0x80B7382C; // type:func -ObjMure2_Update = 0x80B738BC; // type:func -func_80B9A9D0 = 0x80B73AA0; // type:func -func_80B9AA90 = 0x80B73B60; // type:func -func_80B9ABA0 = 0x80B73C70; // type:func -func_80B9ACE4 = 0x80B73DB4; // type:func -func_80B9ADCC = 0x80B73EA0; // type:func -ObjMure3_Init = 0x80B73F94; // type:func -ObjMure3_Destroy = 0x80B73FF4; // type:func -func_80B9AF24 = 0x80B74004; // type:func -func_80B9AF34 = 0x80B74018; // type:func -func_80B9AF54 = 0x80B7403C; // type:func -func_80B9AF64 = 0x80B74050; // type:func -func_80B9AFEC = 0x80B740D8; // type:func -func_80B9AFFC = 0x80B740EC; // type:func -ObjMure3_Update = 0x80B74168; // type:func -ObjOshihiki_InitDynapoly = 0x80B74270; // type:func -ObjOshihiki_RotateXZ = 0x80B742C8; // type:func -ObjOshihiki_StrongEnough = 0x80B7431C; // type:func -ObjOshihiki_ResetFloors = 0x80B743A0; // type:func -ObjOshihiki_GetBlockUnder = 0x80B743CC; // type:func -ObjOshihiki_UpdateInitPos = 0x80B7445C; // type:func -ObjOshihiki_NoSwitchPress = 0x80B7458C; // type:func -ObjOshihiki_CheckType = 0x80B74658; // type:func -ObjOshihiki_SetScale = 0x80B746A8; // type:func -ObjOshihiki_SetTexture = 0x80B746E0; // type:func -ObjOshihiki_SetColor = 0x80B74740; // type:func -ObjOshihiki_Init = 0x80B747E8; // type:func -ObjOshihiki_Destroy = 0x80B74910; // type:func -ObjOshihiki_SetFloors = 0x80B74944; // type:func -ObjOshihiki_GetHighestFloor = 0x80B74AA4; // type:func -ObjOshihiki_SetGround = 0x80B74BF0; // type:func -ObjOshihiki_CheckFloor = 0x80B74C48; // type:func -ObjOshihiki_CheckGround = 0x80B74CA0; // type:func -ObjOshihiki_CheckWall = 0x80B74D18; // type:func -ObjOshihiki_MoveWithBlockUnder = 0x80B74F6C; // type:func -ObjOshihiki_SetupOnScene = 0x80B75068; // type:func -ObjOshihiki_OnScene = 0x80B750A0; // type:func -ObjOshihiki_SetupOnActor = 0x80B7518C; // type:func -ObjOshihiki_OnActor = 0x80B751CC; // type:func -ObjOshihiki_SetupPush = 0x80B753C4; // type:func -ObjOshihiki_Push = 0x80B753F0; // type:func -ObjOshihiki_SetupFall = 0x80B7560C; // type:func -ObjOshihiki_Fall = 0x80B75664; // type:func -ObjOshihiki_Update = 0x80B75768; // type:func -ObjOshihiki_Draw = 0x80B757F0; // type:func -ObjRoomtimer_Init = 0x80B75D20; // type:func -ObjRoomtimer_Destroy = 0x80B75D74; // type:func -func_80B9D054 = 0x80B75DA8; // type:func -func_80B9D0B0 = 0x80B75E08; // type:func -ObjRoomtimer_Update = 0x80B75EE4; // type:func -ObjSwitch_RotateY = 0x80B75F70; // type:func -ObjSwitch_InitDynaPoly = 0x80B75FF0; // type:func -ObjSwitch_InitJntSphCollider = 0x80B76048; // type:func -ObjSwitch_InitTrisCollider = 0x80B760E4; // type:func -ObjSwitch_SpawnIce = 0x80B76204; // type:func -ObjSwitch_SetOn = 0x80B76278; // type:func -ObjSwitch_SetOff = 0x80B76324; // type:func -ObjSwitch_UpdateTwoTexScrollXY = 0x80B763AC; // type:func -ObjSwitch_Init = 0x80B763F4; // type:func -ObjSwitch_Destroy = 0x80B7668C; // type:func -ObjSwitch_FloorUpInit = 0x80B76730; // type:func -ObjSwitch_FloorUp = 0x80B76750; // type:func -ObjSwitch_FloorPressInit = 0x80B768C0; // type:func -ObjSwitch_FloorPress = 0x80B768DC; // type:func -ObjSwitch_FloorDownInit = 0x80B7699C; // type:func -ObjSwitch_FloorDown = 0x80B769C4; // type:func -ObjSwitch_FloorReleaseInit = 0x80B76B10; // type:func -ObjSwitch_FloorRelease = 0x80B76B2C; // type:func -ObjSwitch_EyeIsHit = 0x80B76C10; // type:func -ObjSwitch_EyeFrozenInit = 0x80B76C80; // type:func -ObjSwitch_EyeInit = 0x80B76C94; // type:func -ObjSwitch_EyeOpenInit = 0x80B76CEC; // type:func -ObjSwitch_EyeOpen = 0x80B76D04; // type:func -ObjSwitch_EyeClosingInit = 0x80B76D70; // type:func -ObjSwitch_EyeClosing = 0x80B76D8C; // type:func -ObjSwitch_EyeClosedInit = 0x80B76E08; // type:func -ObjSwitch_EyeClosed = 0x80B76E24; // type:func -ObjSwitch_EyeOpeningInit = 0x80B76EE4; // type:func -ObjSwitch_EyeOpening = 0x80B76F00; // type:func -ObjSwitch_CrystalOffInit = 0x80B76F90; // type:func -ObjSwitch_CrystalOff = 0x80B76FBC; // type:func -ObjSwitch_CrystalTurnOnInit = 0x80B770F4; // type:func -ObjSwitch_CrystalTurnOn = 0x80B77110; // type:func -ObjSwitch_CrystalOnInit = 0x80B77198; // type:func -ObjSwitch_CrystalOn = 0x80B771C8; // type:func -ObjSwitch_CrystalTurnOffInit = 0x80B77290; // type:func -ObjSwitch_CrystalTurnOff = 0x80B772AC; // type:func -ObjSwitch_Update = 0x80B77334; // type:func -ObjSwitch_DrawFloor = 0x80B77470; // type:func -ObjSwitch_DrawFloorRusty = 0x80B774B4; // type:func -ObjSwitch_DrawEye = 0x80B774E4; // type:func -ObjSwitch_DrawCrystal = 0x80B775F8; // type:func -ObjSwitch_Draw = 0x80B77854; // type:func -ObjSyokudai_Init = 0x80B77D50; // type:func -ObjSyokudai_Destroy = 0x80B77F14; // type:func -ObjSyokudai_Update = 0x80B77F68; // type:func -ObjSyokudai_Draw = 0x80B78584; // type:func -ObjTimeblock_CalculateIsVisible = 0x80B789A0; // type:func -ObjTimeblock_SpawnDemoEffect = 0x80B78A60; // type:func -ObjTimeblock_ToggleSwitchFlag = 0x80B78AD4; // type:func -ObjTimeblock_Init = 0x80B78B1C; // type:func -ObjTimeblock_Destroy = 0x80B78CD0; // type:func -ObjTimeblock_PlayerIsInRange = 0x80B78D04; // type:func -ObjTimeblock_WaitForOcarina = 0x80B78DE4; // type:func -ObjTimeblock_WaitForSong = 0x80B78E64; // type:func -ObjTimeblock_SetupDoNothing = 0x80B78EDC; // type:func -ObjTimeblock_DoNothing = 0x80B78EF0; // type:func -ObjTimeblock_SetupNormal = 0x80B78F00; // type:func -ObjTimeblock_Normal = 0x80B78F14; // type:func -func_80BA06AC = 0x80B79090; // type:func -ObjTimeblock_SetupAltBehaviorVisible = 0x80B79140; // type:func -ObjTimeblock_AltBehaviorVisible = 0x80B79154; // type:func -ObjTimeblock_SetupAltBehaviourNotVisible = 0x80B79220; // type:func -ObjTimeblock_AltBehaviourNotVisible = 0x80B79234; // type:func -ObjTimeblock_Update = 0x80B79304; // type:func -ObjTimeblock_Draw = 0x80B7938C; // type:func -ObjTsubo_SpawnCollectible = 0x80B795F0; // type:func -ObjTsubo_ApplyGravity = 0x80B79650; // type:func -ObjTsubo_SnapToFloor = 0x80B79684; // type:func -ObjTsubo_InitCollider = 0x80B79720; // type:func -ObjTsubo_Init = 0x80B79778; // type:func -ObjTsubo_Destroy = 0x80B79848; // type:func -ObjTsubo_AirBreak = 0x80B79874; // type:func -ObjTsubo_WaterBreak = 0x80B79AFC; // type:func -ObjTsubo_SetupWaitForObject = 0x80B79D94; // type:func -ObjTsubo_WaitForObject = 0x80B79DA8; // type:func -ObjTsubo_SetupIdle = 0x80B79E1C; // type:func -ObjTsubo_Idle = 0x80B79E30; // type:func -ObjTsubo_SetupLiftedUp = 0x80B7A040; // type:func -ObjTsubo_LiftedUp = 0x80B7A084; // type:func -ObjTsubo_SetupThrown = 0x80B7A10C; // type:func -ObjTsubo_Thrown = 0x80B7A1D4; // type:func -ObjTsubo_Update = 0x80B7A368; // type:func -ObjTsubo_Draw = 0x80B7A38C; // type:func -ObjWarp2block_Spawn = 0x80B7A5E0; // type:func -func_80BA1ECC = 0x80B7A6BC; // type:func -ObjWarp2block_SwapWithChild = 0x80B7A83C; // type:func -func_80BA2218 = 0x80B7AA0C; // type:func -func_80BA228C = 0x80B7AA8C; // type:func -func_80BA2304 = 0x80B7AB04; // type:func -ObjWarp2block_Init = 0x80B7AB48; // type:func -ObjWarp2block_Destroy = 0x80B7AC68; // type:func -ObjWarp2block_SetInactive = 0x80B7ACA8; // type:func -ObjWarp2block_DoNothing = 0x80B7ACC0; // type:func -func_80BA24E8 = 0x80B7ACD0; // type:func -func_80BA24F8 = 0x80B7ACE4; // type:func -func_80BA2600 = 0x80B7ADC8; // type:func -func_80BA2610 = 0x80B7ADDC; // type:func -ObjWarp2block_Update = 0x80B7AE8C; // type:func -ObjWarp2block_Draw = 0x80B7AEC8; // type:func -ObjectKankyo_SetupAction = 0x80B7B110; // type:func -ObjectKankyo_Init = 0x80B7B11C; // type:func -ObjectKankyo_Destroy = 0x80B7B41C; // type:func -ObjectKankyo_Snow = 0x80B7B440; // type:func -ObjectKankyo_Fairies = 0x80B7B450; // type:func -ObjectKankyo_Update = 0x80B7C268; // type:func -ObjectKankyo_Draw = 0x80B7C28C; // type:func -ObjectKankyo_DrawFairies = 0x80B7C310; // type:func -ObjectKankyo_DrawSnow = 0x80B7C798; // type:func -ObjectKankyo_Lightning = 0x80B7CF60; // type:func -ObjectKankyo_DrawLightning = 0x80B7D008; // type:func -ObjectKankyo_SunGraveSparkInit = 0x80B7D204; // type:func -ObjectKankyo_WaitForSunGraveSparkObject = 0x80B7D250; // type:func -ObjectKankyo_SunGraveSpark = 0x80B7D2C0; // type:func -ObjectKankyo_DrawSunGraveSpark = 0x80B7D36C; // type:func -ObjectKankyo_InitBeams = 0x80B7D8B4; // type:func -ObjectKankyo_WaitForBeamObject = 0x80B7D900; // type:func -ObjectKankyo_Beams = 0x80B7D960; // type:func -ObjectKankyo_DrawBeams = 0x80B7DA40; // type:func -OceffSpot_SetupAction = 0x80B7E390; // type:func -OceffSpot_Init = 0x80B7E39C; // type:func -OceffSpot_Destroy = 0x80B7E4F8; // type:func -OceffSpot_End = 0x80B7E588; // type:func -OceffSpot_Wait = 0x80B7E650; // type:func -OceffSpot_GrowCylinder = 0x80B7E68C; // type:func -OceffSpot_Update = 0x80B7E6F0; // type:func -OceffSpot_Draw = 0x80B7E9C8; // type:func -OceffStorm_SetupAction = 0x80B7F2C0; // type:func -OceffStorm_Init = 0x80B7F2CC; // type:func -OceffStorm_Destroy = 0x80B7F39C; // type:func -OceffStorm_DefaultAction = 0x80B7F3E8; // type:func -OceffStorm_UnkAction = 0x80B7F5AC; // type:func -OceffStorm_Update = 0x80B7F5CC; // type:func -OceffStorm_Draw2 = 0x80B7F638; // type:func -OceffStorm_Draw = 0x80B7F7E8; // type:func -OceffWipe_Init = 0x80B80E70; // type:func -OceffWipe_Destroy = 0x80B80ECC; // type:func -OceffWipe_Update = 0x80B80F18; // type:func -OceffWipe_Draw = 0x80B80F78; // type:func -OceffWipe2_Init = 0x80B81BF0; // type:func -OceffWipe2_Destroy = 0x80B81C4C; // type:func -OceffWipe2_Update = 0x80B81C98; // type:func -OceffWipe2_Draw = 0x80B81CF8; // type:func -OceffWipe3_Init = 0x80B83360; // type:func -OceffWipe3_Destroy = 0x80B833BC; // type:func -OceffWipe3_Update = 0x80B83408; // type:func -OceffWipe3_Draw = 0x80B83468; // type:func -OceffWipe4_Init = 0x80B84AB0; // type:func -OceffWipe4_Destroy = 0x80B84B0C; // type:func -OceffWipe4_Update = 0x80B84B30; // type:func -OceffWipe4_Draw = 0x80B84B90; // type:func -ShotSun_Init = 0x80B85A90; // type:func -ShotSun_Destroy = 0x80B85B4C; // type:func -ShotSun_SpawnFairy = 0x80B85B90; // type:func -ShotSun_TriggerFairy = 0x80B85C38; // type:func -ShotSun_UpdateFairySpawner = 0x80B85CD4; // type:func -ShotSun_UpdateHyliaSun = 0x80B85E24; // type:func -ShotSun_Update = 0x80B8605C; // type:func diff --git a/tools/disasm/gc-us/variables.txt b/tools/disasm/gc-us/variables.txt deleted file mode 100644 index 7be1569abc..0000000000 --- a/tools/disasm/gc-us/variables.txt +++ /dev/null @@ -1 +0,0 @@ -gSaveContext = 0x8011B148; // size:0x1428 type:SaveContext diff --git a/tools/disasm/sym_info.py b/tools/disasm/sym_info.py new file mode 100755 index 0000000000..b6345ecd84 --- /dev/null +++ b/tools/disasm/sym_info.py @@ -0,0 +1,230 @@ +#!/usr/bin/env python3 +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import argparse +import csv +import dataclasses +from pathlib import Path +from typing import Optional + + +@dataclasses.dataclass +class Sym: + name: str + value: int + type: Optional[str] + size: Optional[int] + vrom: int + + +@dataclasses.dataclass +class FileSection: + file: str + section: str + syms: list[Sym] + vma_start: int + + +LABELS_TYPES = {"@branchlabel", "@jumptablelabel"} + + +def main(): + parser = argparse.ArgumentParser( + description="Print information on a symbol/address" + " (and possibly surrounding symbols)" + " from the spimdisasm disassembly context saved in" + " expected/build/VERSION/context.csv" + ) + parser.add_argument("sym_or_vma") + default_version = "ntsc-1.2" + parser.add_argument( + "-v", + "--version", + dest="oot_version", + default=default_version, + help=f"oot version (default: {default_version})", + ) + parser.add_argument( + "--around", + "-n", + type=int, + default=0, + help="how many symbols to show around the target (at least)", + ) + parser.add_argument( + "--range", + "-r", + type=lambda v: int(v, 0), + default=0, + help="show symbols within this range around the target (at least)", + ) + parser.add_argument( + "--file", + "-f", + action="store_true", + help="show symbols within the same file and section as the target (at least)", + ) + parser.add_argument( + "--labels", + "-l", + action="store_true", + help="also show branch and jump table labels symbols", + ) + args = parser.parse_args() + + sym_or_vma = args.sym_or_vma + if "_" in sym_or_vma: + # special case to avoid parsing e.g. `D_80123456` as hexadecimal 0xD80123456 + sym_or_vma_is_sym = True + else: + try: + target_sym_name = None + target_vma = int(sym_or_vma, 16) + sym_or_vma_is_sym = False + except ValueError: + sym_or_vma_is_sym = True + if sym_or_vma_is_sym: + target_sym_name = sym_or_vma + target_vma = None + + syms_by_section_by_file = dict[str, dict[str, list[Sym]]]() + + context_csv_p = Path(f"expected/build/{args.oot_version}/context.csv") + if not context_csv_p.exists(): + print(f"Context file does not exist: {context_csv_p}") + print(f"Hint: run `make VERSION={args.oot_version} disasm`") + exit(1) + + with context_csv_p.open() as f: + for e in csv.DictReader(f): + if e["category"] != "symbol": + continue + sym_name = e["getName"] + sym_value = e["address"] + sym_type = e["getType"] + sym_size = e["getSize"] + sym_vrom = e["getVrom"] + sym_section = e["sectionType"] + sym_file = e["parentFileName"] + + if sym_file == "None": + sym_file = None + + if not sym_section or not sym_file: + continue + + sym_value_int = int(sym_value, 0) + sym_size_int = int(sym_size, 0) if sym_size else None + sym_vrom_int = int(sym_vrom, 0) + + syms_by_section_by_file.setdefault(sym_file, dict()).setdefault( + sym_section, list() + ).append( + Sym( + sym_name, + sym_value_int, + sym_type if sym_type else None, + sym_size_int, + sym_vrom_int, + ) + ) + + if sym_name == target_sym_name: + target_vma = sym_value_int + + if target_vma is None: + parser.error(f"No symbol '{target_sym_name}'") + else: + if target_sym_name is not None: + print(f"{target_sym_name} = 0x{target_vma:08X}") + + del target_sym_name + + filesections = list[FileSection]() + + for file, syms_by_section in syms_by_section_by_file.items(): + for section, syms in syms_by_section.items(): + syms.sort(key=lambda sym: sym.value) + vma_start = syms[0].value + filesections.append(FileSection(file, section, syms, vma_start)) + + filesections.sort(key=lambda fs: fs.vma_start) + + def get_first_print_sym(): + prev_syms = list[Sym]() + for fs in filesections: + for sym in fs.syms: + if not args.labels and sym.type in LABELS_TYPES: + continue + if target_vma < sym.value: + return prev_syms[0] + prev_syms.append(sym) + while ( + len(prev_syms) - 1 > args.around + and prev_syms[0].value < target_vma - args.range + ): + prev_syms.pop(0) + + first_print_sym = get_first_print_sym() + + def get_last_print_sym(): + min_skip_count = args.around + for fs in filesections: + for sym in fs.syms: + if not args.labels and sym.type in LABELS_TYPES: + continue + if target_vma <= sym.value: + min_skip_count -= 1 + if min_skip_count < 0 and sym.value >= args.range + target_vma: + return sym + + last_print_sym = get_last_print_sym() + + is_near_target = False + + indent = " " * 4 + + for i_fs, fs in enumerate(filesections): + fs_printed = False + is_first_fs_sym = True + fs_printed_end_ellipsis = False + for sym in fs.syms: + if not args.labels and sym.type in LABELS_TYPES: + continue + + if sym == first_print_sym: + is_near_target = True + + print_sym = is_near_target or ( + args.file + and fs.vma_start <= target_vma + and ( + target_vma < filesections[i_fs + 1].vma_start + if i_fs + 1 < len(filesections) + else True + ) + ) + if not print_sym and fs_printed: + if not fs_printed_end_ellipsis: + print(f"{indent}...") + fs_printed_end_ellipsis = True + if print_sym: + if not fs_printed: + print(fs.file, fs.section) + fs_printed = True + if not is_first_fs_sym: + print(f"{indent}...") + print( + f"{indent}{sym.name} 0x{sym.value:X} ROM:0x{sym.vrom:X}" + + (f" ({sym.type})" if sym.type else "") + + (f" (sz=0x{sym.size:X})" if sym.size else "") + ) + is_first_fs_sym = False + + if sym == last_print_sym: + is_near_target = False + + +if __name__ == "__main__": + main() diff --git a/tools/extract_baserom.py b/tools/extract_baserom.py index a1c72d1a86..eca86a6423 100755 --- a/tools/extract_baserom.py +++ b/tools/extract_baserom.py @@ -21,17 +21,16 @@ def main(): "rom", metavar="ROM", type=Path, help="Path to uncompressed ROM" ) parser.add_argument( - "-v", - "--oot-version", - required=True, - help="OOT version", + "output_dir", + type=Path, + help="Output directory for segments", ) parser.add_argument( - "-o", - "--output-dir", - type=Path, + "-v", + "--version", + dest="oot_version", required=True, - help="Output directory for segments", + help="OOT version", ) parser.add_argument( "--dmadata-start", diff --git a/tools/extract_incbins.py b/tools/extract_incbins.py new file mode 100755 index 0000000000..ea920cc88c --- /dev/null +++ b/tools/extract_incbins.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +from __future__ import annotations + +import argparse +from pathlib import Path +import sys + +import dmadata +import version_config + + +def main(): + parser = argparse.ArgumentParser( + description="Extract incbin pieces from an uncompressed ROM." + ) + parser.add_argument( + "baserom_segments_dir", + type=Path, + help="Directory of uncompressed ROM segments", + ) + parser.add_argument( + "output_dir", + type=Path, + help="Output directory for incbin pieces", + ) + parser.add_argument( + "-v", + "--version", + dest="oot_version", + required=True, + help="OOT version", + ) + + args = parser.parse_args() + + config = version_config.load_version_config(args.oot_version) + + args.output_dir.mkdir(parents=True, exist_ok=True) + for incbin in config.incbins: + incbin_path = args.output_dir / incbin.name + with open(args.baserom_segments_dir / incbin.segment, "rb") as f: + offset = incbin.vram - config.dmadata_segments[incbin.segment].vram + f.seek(offset) + incbin_data = f.read(incbin.size) + incbin_path.write_bytes(incbin_data) + + print(f"Extracted {len(config.incbins)} incbin pieces to {args.output_dir}") + + +if __name__ == "__main__": + main() diff --git a/tools/fado/Makefile b/tools/fado/Makefile index 8f61a209eb..d637d45fd5 100644 --- a/tools/fado/Makefile +++ b/tools/fado/Makefile @@ -23,14 +23,6 @@ ifneq ($(ASAN),0) CFLAGS += -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined endif -ifneq ($(LLD),0) - LDFLAGS += -fuse-ld=lld -else -ifneq ($(LD),ld) - LDFLAGS += -fuse-ld=lld -endif -endif - ifneq ($(EXPERIMENTAL),0) CFLAGS += -DEXPERIMENTAL endif diff --git a/tools/fix_bss.py b/tools/fix_bss.py new file mode 100755 index 0000000000..488efb4679 --- /dev/null +++ b/tools/fix_bss.py @@ -0,0 +1,868 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: 2024 zeldaret +# SPDX-License-Identifier: CC0-1.0 + + +from __future__ import annotations + +import argparse +from collections import Counter +import colorama +from dataclasses import dataclass +import io +import multiprocessing +import multiprocessing.pool +from pathlib import Path +import re +import shlex +import sys +import time +import traceback +from typing import BinaryIO, Iterator, Optional, Tuple + +from ido_block_numbers import ( + generate_make_log, + find_compiler_command_line, + run_cfe, + SymbolTableEntry, + UcodeOp, +) + +import elftools.elf.elffile +import mapfile_parser.mapfile + + +# Set on program start since we replace sys.stdout in worker processes +stdout_isatty = sys.stdout.isatty() + + +def output(message: str = "", color: Optional[str] = None, end: str = "\n"): + if color and stdout_isatty: + print(f"{color}{message}{colorama.Fore.RESET}", end=end) + else: + print(message, end=end) + + +def read_u32(f: BinaryIO, offset: int) -> int: + f.seek(offset) + return int.from_bytes(f.read(4), "big") + + +def read_u16(f: BinaryIO, offset: int) -> int: + f.seek(offset) + return int.from_bytes(f.read(2), "big") + + +def read_s16(f: BinaryIO, offset: int) -> int: + f.seek(offset) + return int.from_bytes(f.read(2), "big", signed=True) + + +class FixBssException(Exception): + pass + + +@dataclass +class Reloc: + name: str + offset_32: int | None + offset_hi16: int | None + offset_lo16: int | None + addend: int + + +@dataclass +class Pointer: + name: str + addend: int + base_value: int + build_value: int + + +@dataclass +class BssSection: + start_address: int + pointers: list[Pointer] + + +# Read relocations from an ELF file section +def read_relocs(object_path: Path, section_name: str) -> list[Reloc]: + with open(object_path, "rb") as f: + elffile = elftools.elf.elffile.ELFFile(f) + symtab = elffile.get_section_by_name(".symtab") + data = elffile.get_section_by_name(section_name).data() + + reloc_section = elffile.get_section_by_name(f".rel{section_name}") + if reloc_section is None: + return [] + + relocs = [] + offset_hi16 = 0 + for reloc in reloc_section.iter_relocations(): + reloc_offset = reloc.entry["r_offset"] + reloc_type = reloc.entry["r_info_type"] + reloc_name = symtab.get_symbol(reloc.entry["r_info_sym"]).name + + if reloc_type == 2: # R_MIPS_32 + offset_32 = reloc_offset + addend = int.from_bytes( + data[reloc_offset : reloc_offset + 4], "big", signed=True + ) + relocs.append(Reloc(reloc_name, offset_32, None, None, addend)) + elif reloc_type == 4: # R_MIPS_26 + pass + elif reloc_type == 5: # R_MIPS_HI16 + offset_hi16 = reloc_offset + elif reloc_type == 6: # R_MIPS_LO16 + offset_lo16 = reloc_offset + addend_hi16 = int.from_bytes( + data[offset_hi16 + 2 : offset_hi16 + 4], "big", signed=False + ) + addend_lo16 = int.from_bytes( + data[offset_lo16 + 2 : offset_lo16 + 4], "big", signed=True + ) + addend = (addend_hi16 << 16) + addend_lo16 + relocs.append(Reloc(reloc_name, None, offset_hi16, offset_lo16, addend)) + else: + raise NotImplementedError(f"Unsupported relocation type: {reloc_type}") + + return relocs + + +def get_file_pointers( + file: mapfile_parser.mapfile.File, + base: BinaryIO, + build: BinaryIO, +) -> list[Pointer]: + pointers = [] + # TODO: open each ELF file only once instead of once per section? + for reloc in read_relocs(file.filepath, file.sectionType): + if reloc.offset_32 is not None: + base_value = read_u32(base, file.vrom + reloc.offset_32) + build_value = read_u32(build, file.vrom + reloc.offset_32) + elif reloc.offset_hi16 is not None and reloc.offset_lo16 is not None: + if ( + read_u16(base, file.vrom + reloc.offset_hi16) + != read_u16(build, file.vrom + reloc.offset_hi16) + ) or ( + read_u16(base, file.vrom + reloc.offset_lo16) + != read_u16(build, file.vrom + reloc.offset_lo16) + ): + raise FixBssException( + f"Reference to {reloc.name} in {file.filepath} is in a shifted or non-matching portion of the ROM.\n" + "Please ensure that the only differences between the baserom and the current build are due to BSS ordering." + ) + + base_value = ( + read_u16(base, file.vrom + reloc.offset_hi16 + 2) << 16 + ) + read_s16(base, file.vrom + reloc.offset_lo16 + 2) + build_value = ( + read_u16(build, file.vrom + reloc.offset_hi16 + 2) << 16 + ) + read_s16(build, file.vrom + reloc.offset_lo16 + 2) + else: + assert False, "Invalid relocation" + + # For relocations against a global symbol, subtract the addend so that the pointer + # is for the start of the symbol. This can help deal with things like STACK_TOP + # (where the pointer is past the end of the symbol) or negative addends. If the + # relocation is against a section however, it's not useful to subtract the addend, + # so we keep it as-is and hope for the best. + if reloc.name.startswith("."): # section + addend = reloc.addend + else: # symbol + addend = 0 + base_value -= reloc.addend + build_value -= reloc.addend + + pointers.append(Pointer(reloc.name, addend, base_value, build_value)) + return pointers + + +base = None +build = None + + +def get_file_pointers_worker_init(version: str): + global base + global build + base = open(f"baseroms/{version}/baserom-decompressed.z64", "rb") + build = open(f"build/{version}/oot-{version}.z64", "rb") + + +def get_file_pointers_worker(file: mapfile_parser.mapfile.File) -> list[Pointer]: + assert base is not None + assert build is not None + return get_file_pointers(file, base, build) + + +# Compare pointers between the baserom and the current build, returning a dictionary from +# C files to a list of pointers into their BSS sections +def compare_pointers(version: str) -> dict[Path, BssSection]: + mapfile_path = Path(f"build/{version}/oot-{version}.map") + if not mapfile_path.exists(): + raise FixBssException(f"Could not open {mapfile_path}") + + mapfile = mapfile_parser.mapfile.MapFile() + mapfile.readMapFile(mapfile_path) + + # Segments built from source code (filtering out assets) + source_code_segments = [] + for mapfile_segment in mapfile: + if not ( + mapfile_segment.name.startswith("..boot") + or mapfile_segment.name.startswith("..code") + or mapfile_segment.name.startswith("..n64dd") + or mapfile_segment.name.startswith("..ovl_") + ): + continue + source_code_segments.append(mapfile_segment) + + # Find all pointers with different values + if not stdout_isatty: + output(f"Comparing pointers between baserom and build ...") + pointers = [] + file_results = [] + with multiprocessing.Pool( + initializer=get_file_pointers_worker_init, + initargs=(version,), + ) as p: + for mapfile_segment in source_code_segments: + for file in mapfile_segment: + if not str(file.filepath).endswith(".o"): + continue + if file.sectionType == ".bss": + continue + file_result = p.apply_async(get_file_pointers_worker, (file,)) + file_results.append(file_result) + + # Report progress and wait until all files are done + num_files = len(file_results) + while True: + time.sleep(0.010) + num_files_done = sum(file_result.ready() for file_result in file_results) + if stdout_isatty: + output( + f"Comparing pointers between baserom and build ... {num_files_done:>{len(f'{num_files}')}}/{num_files}", + end="\r", + ) + if num_files_done == num_files: + break + if stdout_isatty: + output("") + + # Collect results and check for errors + for file_result in file_results: + try: + pointers.extend(file_result.get()) + except FixBssException as e: + output(f"Error: {str(e)}", color=colorama.Fore.RED) + sys.exit(1) + + # Remove duplicates and sort by baserom address + pointers = list({p.base_value: p for p in pointers}.values()) + pointers.sort(key=lambda p: p.base_value) + + # Go through sections and collect differences + bss_sections = {} + for mapfile_segment in source_code_segments: + for file in mapfile_segment: + if not file.sectionType == ".bss": + continue + + pointers_in_section = [ + p + for p in pointers + if file.vram <= p.build_value < file.vram + file.size + ] + + object_file = file.filepath.relative_to(f"build/{version}") + # Hack to handle the combined z_message_z_game_over.o file. + # Fortunately z_game_over has no BSS so we can just analyze z_message instead. + if str(object_file) == "src/code/z_message_z_game_over.o": + object_file = Path("src/code/z_message.o") + + c_file = object_file.with_suffix(".c") + bss_sections[c_file] = BssSection(file.vram, pointers_in_section) + + return bss_sections + + +@dataclass +class Pragma: + line_number: int + block_number: int + amount: int + + +# A BSS variable in the source code +@dataclass +class BssVariable: + block_number: int + name: str + size: int + align: int + referenced_in_data: bool + + +# A BSS variable with its offset in the compiled .bss section +@dataclass +class BssSymbol: + name: str + offset: int + size: int + align: int + referenced_in_data: bool + + +INCREMENT_BLOCK_NUMBER_RE = re.compile(r"increment_block_number_(\d+)_(\d+)") + + +# Find increment_block_number pragmas by parsing the symbol names generated by preprocess.py. +# This is pretty ugly but it seems more reliable than trying to determine the line numbers of +# BSS variables in the C file. +def find_pragmas(symbol_table: list[SymbolTableEntry]) -> list[Pragma]: + # Keep track of first block number and count for each line number + first_block_number = {} + amounts: Counter[int] = Counter() + for block_number, entry in enumerate(symbol_table): + if match := INCREMENT_BLOCK_NUMBER_RE.match(entry.name): + line_number = int(match.group(1)) + if line_number not in first_block_number: + first_block_number[line_number] = block_number + amounts[line_number] += 1 + + pragmas = [] + for line_number, block_number in sorted(first_block_number.items()): + pragmas.append(Pragma(line_number, block_number, amounts[line_number])) + return pragmas + + +# Find all BSS variables from IDO's symbol table and U-Code output. +def find_bss_variables( + symbol_table: list[SymbolTableEntry], ucode: list[UcodeOp] +) -> list[BssVariable]: + bss_variables = [] + init_block_numbers = set(op.i1 for op in ucode if op.opcode_name == "init") + last_function_name = None + # Block numbers referenced in .data or .rodata (in order of appearance) + referenced_in_data_block_numbers = [] + + for op in ucode: + # gsym: file-level global symbol + # lsym: file-level static symbol + # fsym: function-level static symbol + if op.opcode_name in ("gsym", "lsym", "fsym"): + block_number = op.i1 + if block_number in init_block_numbers: + continue # not BSS + + name = symbol_table[block_number].name + if op.opcode_name == "fsym": + name = f"{last_function_name}::{name}" + + size = op.args[0] + align = 1 << op.lexlev + # TODO: IDO seems to automatically align anything with size 8 or more to + # an 8-byte boundary in BSS. Is this correct? + if size >= 8: + align = 8 + + referenced_in_data = block_number in referenced_in_data_block_numbers + bss_variables.append( + BssVariable(block_number, name, size, align, referenced_in_data) + ) + elif op.opcode_name == "init": + if op.dtype == 10: # Ndt, "non-local label" + assert op.const is not None + referenced_in_data_block_numbers.append(op.const) + elif op.opcode_name == "ent": + last_function_name = symbol_table[op.i1].name + + # Sort any variables referenced in .data or .rodata first. For the others, sort by block number + # so it looks like the original ordering in the source code (it doesn't matter since + # predict_bss_ordering will sort them again anyway. + def sort_key(var: BssVariable) -> Tuple[int, int]: + if var.referenced_in_data: + index = referenced_in_data_block_numbers.index(var.block_number) + else: + index = len(referenced_in_data_block_numbers) + return (index, var.block_number) + + bss_variables.sort(key=sort_key) + return bss_variables + + +# Predict offsets of BSS variables in the build. +def predict_bss_ordering(variables: list[BssVariable]) -> list[BssSymbol]: + bss_symbols = [] + offset = 0 + + # For variables referenced in .data or .rodata, keep the original order. + referenced_in_data = [var for var in variables if var.referenced_in_data] + + # For the others, sort by block number mod 256. For ties, sort by block number. + not_referenced_in_data = [var for var in variables if not var.referenced_in_data] + not_referenced_in_data.sort( + key=lambda var: (var.block_number % 256, var.block_number) + ) + + sorted_variables = referenced_in_data + not_referenced_in_data + for var in sorted_variables: + size = var.size + align = var.align + offset = (offset + align - 1) & ~(align - 1) + bss_symbols.append( + BssSymbol(var.name, offset, size, align, var.referenced_in_data) + ) + offset += size + return bss_symbols + + +# Match up BSS variables between the baserom and the build using the pointers from relocations. +# Note that we may not be able to match all variables if a variable is not referenced by any pointer. +def determine_base_bss_ordering( + build_bss_symbols: list[BssSymbol], + bss_section: BssSection, +) -> list[BssSymbol]: + base_start_address = min(p.base_value for p in bss_section.pointers) + + found_symbols: dict[str, BssSymbol] = {} + for p in bss_section.pointers: + base_offset = p.base_value - base_start_address + build_offset = p.build_value - bss_section.start_address + + new_symbol = None + new_offset = 0 + for symbol in build_bss_symbols: + if ( + symbol.offset <= build_offset + and build_offset < symbol.offset + symbol.size + ): + new_symbol = symbol + new_offset = base_offset - (build_offset - symbol.offset) + break + + if new_symbol is None: + if p.addend > 0: + addend_str = f"+0x{p.addend:X}" + elif p.addend < 0: + addend_str = f"-0x{-p.addend:X}" + else: + addend_str = "" + raise FixBssException( + f"Could not find BSS symbol for pointer {p.name}{addend_str} " + f"(base address 0x{p.base_value:08X}, build address 0x{p.build_value:08X}). Is the build up-to-date?" + ) + + if new_offset < 0: + raise FixBssException( + f"BSS symbol {new_symbol.name} found at negative offset in the baserom " + f"(-0x{-new_offset:04X}). Is the build up-to-date?" + ) + + if new_symbol.name in found_symbols: + # Sanity check that offsets agree + existing_offset = found_symbols[new_symbol.name].offset + if new_offset != existing_offset: + raise FixBssException( + f"BSS symbol {new_symbol.name} found at conflicting offsets in the baserom " + f"(0x{existing_offset:04X} and 0x{new_offset:04X}). Is the build up-to-date?" + ) + else: + found_symbols[new_symbol.name] = BssSymbol( + new_symbol.name, + new_offset, + new_symbol.size, + new_symbol.align, + new_symbol.referenced_in_data, + ) + + return list(sorted(found_symbols.values(), key=lambda symbol: symbol.offset)) + + +# Generate a sequence of integers in the range [0, 256) with a 2-adic valuation of exactly `nu`. +# The 2-adic valuation of an integer n is the largest k such that 2^k divides n +# (see https://en.wikipedia.org/wiki/P-adic_valuation), and for convenience we define +# the 2-adic valuation of 0 to be 8. Here's what the sequences look like for nu = 0..8: +# 8: 0 +# 7: 128 +# 6: 64, 192 +# 5: 32, 96, 160, 224 +# 4: 16, 48, 80, 112, ... +# 3: 8, 24, 40, 56, ... +# 2: 4, 12, 20, 28, ... +# 1: 2, 6, 10, 14, ... +# 0: 1, 3, 5, 7, ... +def gen_seq(nu: int) -> Iterator[int]: + if nu == 8: + yield 0 + else: + for i in range(1 << (7 - nu)): + yield (2 * i + 1) * (1 << nu) + + +# Yields all n-tuples of integers in the range [0, 256) with minimum 2-adic valuation +# of exactly `min_nu`. +def gen_candidates_impl(n: int, min_nu: int) -> Iterator[tuple[int, ...]]: + if n == 1: + for n in gen_seq(min_nu): + yield (n,) + else: + # (a, *b) has min 2-adic valuation = min_nu if and only if either: + # a has 2-adic valuation > min_nu and b has min 2-adic valuation == min_nu + # a has 2-adic valuation == min_nu and b has min 2-adic valuation >= min_nu + for min_nu_a in reversed(range(min_nu + 1, 9)): + for a in gen_seq(min_nu_a): + for b in gen_candidates_impl(n - 1, min_nu): + yield (a, *b) + for a in gen_seq(min_nu): + for min_nu_b in reversed(range(min_nu, 9)): + for b in gen_candidates_impl(n - 1, min_nu_b): + yield (a, *b) + + +# Yields all n-tuples of integers in the range [0, 256), ordered by descending minimum +# 2-adic valuation of the elements in the tuple. For example, for n = 2 the sequence is: +# (0, 0), (0, 128), (128, 0), (128, 128), (0, 64), (0, 192), (128, 64), (128, 192), ... +def gen_candidates(n: int) -> Iterator[tuple[int, ...]]: + for nu in reversed(range(9)): + yield from gen_candidates_impl(n, nu) + + +# Determine a new set of increment_block_number pragmas that will fix the BSS ordering. +def solve_bss_ordering( + pragmas: list[Pragma], + bss_variables: list[BssVariable], + base_bss_symbols: list[BssSymbol], +) -> list[Pragma]: + base_symbols_by_name = {symbol.name: symbol for symbol in base_bss_symbols} + + # Our "algorithm" just tries all possible combinations of increment_block_number amounts, + # which can get very slow with more than a few pragmas. But, we order the candidates in a + # binary-search-esque way to try to find a solution faster. + for new_amounts in gen_candidates(len(pragmas)): + # Generate new block numbers + new_bss_variables = [] + for var in bss_variables: + new_block_number = var.block_number + for pragma, new_amount in zip(pragmas, new_amounts): + if var.block_number >= pragma.block_number: + new_block_number += new_amount - pragma.amount + new_bss_variables.append( + BssVariable( + new_block_number, + var.name, + var.size, + var.align, + var.referenced_in_data, + ) + ) + + # Predict new BSS and check if new ordering matches + new_bss_symbols = predict_bss_ordering(new_bss_variables) + + bss_ordering_matches = True + for symbol in new_bss_symbols: + base_symbol = base_symbols_by_name.get(symbol.name) + if base_symbol is None: + continue + if symbol.offset != base_symbol.offset: + bss_ordering_matches = False + break + + if bss_ordering_matches: + new_pragmas = [] + for pragma, new_amount in zip(pragmas, new_amounts): + new_pragmas.append( + Pragma(pragma.line_number, pragma.block_number, new_amount) + ) + return new_pragmas + + raise FixBssException("Could not find any solutions") + + +# Parses #pragma increment_block_number (with line continuations already removed) +def parse_pragma(pragma_string: str) -> dict[str, int]: + amounts = {} + for part in pragma_string.replace('"', "").split()[2:]: + kv = part.split(":") + if len(kv) != 2: + raise FixBssException( + "#pragma increment_block_number" + f' arguments must be version:amount pairs, not "{part}"' + ) + try: + amount = int(kv[1]) + except ValueError: + raise FixBssException( + "#pragma increment_block_number" + f' amount must be an integer, not "{kv[1]}" (in "{part}")' + ) + amounts[kv[0]] = amount + return amounts + + +# Formats #pragma increment_block_number as a list of lines +def format_pragma(amounts: dict[str, int], max_line_length: int) -> list[str]: + lines = [] + pragma_start = "#pragma increment_block_number " + current_line = pragma_start + '"' + first = True + for version, amount in sorted(amounts.items()): + part = f"{version}:{amount}" + if len(current_line) + len(" ") + len(part) + len('" \\') > max_line_length: + lines.append(current_line + '" ') + current_line = " " * len(pragma_start) + '"' + first = True + if not first: + current_line += " " + current_line += part + first = False + lines.append(current_line + '"\n') + + if len(lines) >= 2: + # add and align vertically all continuation \ characters + n_align = max(map(len, lines[:-1])) + for i in range(len(lines) - 1): + lines[i] = f"{lines[i]:{n_align}}\\\n" + + return lines + + +def update_source_file(version_to_update: str, file: Path, new_pragmas: list[Pragma]): + with open(file, "r", encoding="utf-8") as f: + lines = f.readlines() + + replace_lines: list[tuple[int, int, list[str]]] = [] + + for pragma in new_pragmas: + i = pragma.line_number - 1 + if not lines[i].startswith("#pragma increment_block_number"): + raise FixBssException( + f"Expected #pragma increment_block_number on line {pragma.line_number}" + ) + + # list the pragma line and any continuation line + pragma_lines = [lines[i]] + while pragma_lines[-1].endswith("\\\n"): + i += 1 + pragma_lines.append(lines[i]) + + # concatenate all lines into one + pragma_string = "".join(s.replace("\\\n", "") for s in pragma_lines) + + amounts = parse_pragma(pragma_string) + + amounts[version_to_update] = pragma.amount + + column_limit = 120 # matches .clang-format's ColumnLimit + new_pragma_lines = format_pragma(amounts, column_limit) + + replace_lines.append( + ( + pragma.line_number - 1, + pragma.line_number - 1 + len(pragma_lines), + new_pragma_lines, + ) + ) + + # Replace the pragma lines starting from the end of the file, so the line numbers + # for pragmas earlier in the file stay accurate. + replace_lines.sort(key=lambda it: it[0], reverse=True) + for start, end, new_pragma_lines in replace_lines: + del lines[start:end] + lines[start:start] = new_pragma_lines + + with open(file, "w", encoding="utf-8") as f: + f.writelines(lines) + + +def process_file( + file: Path, + bss_section: BssSection, + make_log: list[str], + dry_run: bool, + version: str, +): + output(f"Processing {file} ...", color=colorama.Fore.CYAN) + + command_line = find_compiler_command_line(make_log, file) + if command_line is None: + raise FixBssException(f"Could not determine compiler command line for {file}") + + output(f"Compiler command: {shlex.join(command_line)}") + symbol_table, ucode = run_cfe(command_line, keep_files=False) + + bss_variables = find_bss_variables(symbol_table, ucode) + output("BSS variables:") + for var in bss_variables: + i = var.block_number + output( + f" {i:>6} [{i%256:>3}]: size=0x{var.size:04X} align=0x{var.align:X} referenced_in_data={str(var.referenced_in_data):<5} {var.name}" + ) + + build_bss_symbols = predict_bss_ordering(bss_variables) + output("Current build BSS ordering:") + for symbol in build_bss_symbols: + output( + f" offset=0x{symbol.offset:04X} size=0x{symbol.size:04X} align=0x{symbol.align:X} referenced_in_data={str(symbol.referenced_in_data):<5} {symbol.name}" + ) + + if not bss_section.pointers: + raise FixBssException(f"No pointers to BSS found in ROM for {file}") + + base_bss_symbols = determine_base_bss_ordering(build_bss_symbols, bss_section) + output("Baserom BSS ordering:") + for symbol in base_bss_symbols: + output( + f" offset=0x{symbol.offset:04X} size=0x{symbol.size:04X} align=0x{symbol.align:X} referenced_in_data={str(symbol.referenced_in_data):<5} {symbol.name}" + ) + + pragmas = find_pragmas(symbol_table) + max_pragmas = 3 + if not pragmas: + raise FixBssException(f"No increment_block_number pragmas found in {file}") + elif len(pragmas) > max_pragmas: + raise FixBssException( + f"Too many increment_block_number pragmas found in {file} (found {len(pragmas)}, max {max_pragmas})" + ) + + output("Solving BSS ordering ...") + new_pragmas = solve_bss_ordering(pragmas, bss_variables, base_bss_symbols) + output("New increment_block_number amounts:") + for pragma in new_pragmas: + output(f" line {pragma.line_number}: {pragma.amount}") + + if not dry_run: + update_source_file(version, file, new_pragmas) + output(f"Updated {file}", color=colorama.Fore.GREEN) + + +def process_file_worker(*x): + # Collect output in a buffer to avoid interleaving output when processing multiple files + old_stdout = sys.stdout + fake_stdout = io.StringIO() + try: + sys.stdout = fake_stdout + process_file(*x) + except FixBssException as e: + # exception with a message for the user + output(f"Error: {str(e)}", color=colorama.Fore.RED) + raise + except Exception as e: + # "unexpected" exception, also print a trace for devs + output(f"Error: {str(e)}", color=colorama.Fore.RED) + traceback.print_exc(file=sys.stdout) + raise + finally: + sys.stdout = old_stdout + output() + output(fake_stdout.getvalue(), end="") + + +def main(): + parser = argparse.ArgumentParser( + description="Automatically fix BSS ordering by editing increment_block_number pragmas. " + "Assumes that the build is up-to-date and that only differences between the baserom and " + "the current build are due to BSS ordering." + ) + parser.add_argument( + "-v", + "--version", + dest="oot_version", + type=str, + required=True, + help="OOT version", + ) + parser.add_argument( + "--dry-run", + action="store_true", + help="Print changes instead of editing source files", + ) + parser.add_argument( + "files", + metavar="FILE", + nargs="*", + type=Path, + help="Fix BSS ordering for a particular C file (default: all files with BSS differences)", + ) + + args = parser.parse_args() + version = args.oot_version + + bss_sections = compare_pointers(version) + + files_with_reordering = [] + for file, bss_section in bss_sections.items(): + if not bss_section.pointers: + continue + # The following heuristic doesn't work for z_locale, since the first pointer into BSS is not + # at the start of the section. Fortunately z_locale either has one BSS variable (in GC versions) + # or none (in N64 versions), so we can just skip it. + if str(file) == "src/boot/z_locale.c": + continue + # For the baserom, assume that the lowest address is the start of the BSS section. This might + # not be true if the first BSS variable is not referenced, but in practice this doesn't happen + # (except for z_locale above). + base_min_address = min(p.base_value for p in bss_section.pointers) + build_min_address = bss_section.start_address + if not all( + p.build_value - build_min_address == p.base_value - base_min_address + for p in bss_section.pointers + ): + files_with_reordering.append(file) + + if files_with_reordering: + output("Files with BSS reordering:") + for file in files_with_reordering: + output(f" {file}") + else: + output("No BSS reordering found.") + + if args.files: + # Ignore files that don't have a BSS section in the ROM + files_to_fix = [file for file in args.files if file in bss_sections] + else: + files_to_fix = files_with_reordering + if not files_to_fix: + return + + output(f"Running make to find compiler command line ...") + make_log = generate_make_log(version) + + with multiprocessing.Pool() as p: + file_results = [] + for file in files_to_fix: + file_result = p.apply_async( + process_file_worker, + ( + file, + bss_sections[file], + make_log, + args.dry_run, + version, + ), + ) + file_results.append(file_result) + + # Wait until all files are done + while not all(file_result.ready() for file_result in file_results): + time.sleep(0.010) + + # Collect results and check for errors + num_successes = sum(file_result.successful() for file_result in file_results) + if num_successes == len(file_results): + output() + output(f"Processed {num_successes}/{len(file_results)} files.") + else: + output() + output( + f"Processed {num_successes}/{len(file_results)} files.", + color=colorama.Fore.RED, + ) + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/tools/generate_patch_from_jenkins.sh b/tools/generate_patch_from_jenkins.sh new file mode 100755 index 0000000000..4eb98cd3af --- /dev/null +++ b/tools/generate_patch_from_jenkins.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -euo pipefail + +PATCH=$(git diff | base64 -w 0) +if [ -n "$PATCH" ]; then + echo "Jenkins made some fixes to your PR. To apply these changes to your working directory," + echo "copy and run the following command (triple-click to select the entire line):" + echo + echo "echo -n $PATCH | base64 -d | git apply -" + echo +fi diff --git a/tools/ido_block_numbers.py b/tools/ido_block_numbers.py index 2deb64c79c..292a14d387 100755 --- a/tools/ido_block_numbers.py +++ b/tools/ido_block_numbers.py @@ -14,14 +14,20 @@ # https://github.com/decompals/ultralib/blob/main/tools/mdebug.py # https://www.cs.unibo.it/~solmi/teaching/arch_2002-2003/AssemblyLanguageProgDoc.pdf # https://github.com/decompals/IDO/blob/main/IDO_7.1/dist/compiler_eoe/usr/include/sym.h +# https://github.com/Synray/ido-ucode-utils + +from __future__ import annotations import argparse +from dataclasses import dataclass import itertools from pathlib import Path import platform import struct import subprocess +import shlex import sys +from typing import Optional, Tuple class Header: @@ -157,10 +163,15 @@ def read_string(data, start): return data[start : start + size].decode("ascii") -def print_symbol_table(data): - header = Header(data[0 : Header.SIZE]) +@dataclass +class SymbolTableEntry: + symbol: Optional[Symbol] + name: str + extern: bool - print(f"block [mod 256]: linkage type class name") + +def parse_symbol_table(data: bytes) -> list[SymbolTableEntry]: + header = Header(data[0 : Header.SIZE]) # File descriptors fds = [] @@ -170,15 +181,14 @@ def print_symbol_table(data): ) # Symbol identifiers ("dense numbers") + entries = [] for i in range(header.idnMax): ifd, isym = struct.unpack(">II", read_entry(data, header.cbDnOffset, i, 8)) if isym == 0xFFFFF: - # TODO: is this always a string? - extern = False + sym = None sym_name = "" - st = "string" - sc = "" + extern = False else: extern = ifd == 0x7FFFFFFF if extern: @@ -195,15 +205,267 @@ def print_symbol_table(data): ) ) sym_name = read_string(data, header.cbSsOffset + fd.issBase + sym.iss) - st = sym.symbol_type() - sc = sym.symbol_storage_class() + entries.append(SymbolTableEntry(sym, sym_name, extern)) + + return entries + + +def print_symbol_table(symbol_table: list[SymbolTableEntry]): + print(f"block [mod 256]: linkage type class name") + for i, entry in enumerate(symbol_table): + if not entry.symbol: + # TODO: is this always a string? + st = "string" + sc = "" + else: + st = entry.symbol.symbol_type() + sc = entry.symbol.symbol_storage_class() + print( + f'{i:>9} [{i%256:>3}]: {"extern" if entry.extern else "":<7} {st:<10} {sc:<9} {entry.name:<40}' + ) + + +@dataclass +class UcodeOp: + opcode: int + opcode_name: str + mtype: int + dtype: int + lexlev: int + i1: int + args: list[int] + const: Optional[int] + string: Optional[bytes] + + +@dataclass +class UcodeOpInfo: + opcode: int + name: str + length: int + has_const: bool + + +UCODE_OP_INFO = [ + UcodeOpInfo(0x00, "abs", 2, False), + UcodeOpInfo(0x01, "add", 2, False), + UcodeOpInfo(0x02, "adj", 4, False), + UcodeOpInfo(0x03, "aent", 4, False), + UcodeOpInfo(0x04, "and", 2, False), + UcodeOpInfo(0x05, "aos", 2, False), + UcodeOpInfo(0x06, "asym", 4, False), + UcodeOpInfo(0x07, "bgn", 4, False), + UcodeOpInfo(0x08, "bgnb", 2, False), + UcodeOpInfo(0x09, "bsub", 2, False), + UcodeOpInfo(0x0A, "cg1", 2, False), + UcodeOpInfo(0x0B, "cg2", 2, False), + UcodeOpInfo(0x0C, "chkh", 2, False), + UcodeOpInfo(0x0D, "chkl", 2, False), + UcodeOpInfo(0x0E, "chkn", 2, False), + UcodeOpInfo(0x0F, "chkt", 2, False), + UcodeOpInfo(0x10, "cia", 4, True), + UcodeOpInfo(0x11, "clab", 4, False), + UcodeOpInfo(0x12, "clbd", 2, False), + UcodeOpInfo(0x13, "comm", 4, True), + UcodeOpInfo(0x14, "csym", 4, False), + UcodeOpInfo(0x15, "ctrl", 4, False), + UcodeOpInfo(0x16, "cubd", 2, False), + UcodeOpInfo(0x17, "cup", 4, False), + UcodeOpInfo(0x18, "cvt", 4, False), + UcodeOpInfo(0x19, "cvtl", 2, False), + UcodeOpInfo(0x1A, "dec", 2, False), + UcodeOpInfo(0x1B, "def", 4, False), + UcodeOpInfo(0x1C, "dif", 4, False), + UcodeOpInfo(0x1D, "div", 2, False), + UcodeOpInfo(0x1E, "dup", 2, False), + UcodeOpInfo(0x1F, "end", 2, False), + UcodeOpInfo(0x20, "endb", 2, False), + UcodeOpInfo(0x21, "ent", 4, False), + UcodeOpInfo(0x22, "ueof", 2, False), + UcodeOpInfo(0x23, "equ", 2, False), + UcodeOpInfo(0x24, "esym", 4, False), + UcodeOpInfo(0x25, "fill", 4, False), + UcodeOpInfo(0x26, "fjp", 2, False), + UcodeOpInfo(0x27, "fsym", 4, False), + UcodeOpInfo(0x28, "geq", 2, False), + UcodeOpInfo(0x29, "grt", 2, False), + UcodeOpInfo(0x2A, "gsym", 4, False), + UcodeOpInfo(0x2B, "hsym", 4, False), + UcodeOpInfo(0x2C, "icuf", 4, False), + UcodeOpInfo(0x2D, "idx", 2, False), + UcodeOpInfo(0x2E, "iequ", 4, False), + UcodeOpInfo(0x2F, "igeq", 4, False), + UcodeOpInfo(0x30, "igrt", 4, False), + UcodeOpInfo(0x31, "ijp", 2, False), + UcodeOpInfo(0x32, "ilda", 6, False), + UcodeOpInfo(0x33, "ildv", 4, False), + UcodeOpInfo(0x34, "ileq", 4, False), + UcodeOpInfo(0x35, "iles", 4, False), + UcodeOpInfo(0x36, "ilod", 4, False), + UcodeOpInfo(0x37, "inc", 2, False), + UcodeOpInfo(0x38, "ineq", 4, False), + UcodeOpInfo(0x39, "init", 6, True), + UcodeOpInfo(0x3A, "inn", 4, False), + UcodeOpInfo(0x3B, "int", 4, False), + UcodeOpInfo(0x3C, "ior", 2, False), + UcodeOpInfo(0x3D, "isld", 4, False), + UcodeOpInfo(0x3E, "isst", 4, False), + UcodeOpInfo(0x3F, "istr", 4, False), + UcodeOpInfo(0x40, "istv", 4, False), + UcodeOpInfo(0x41, "ixa", 2, False), + UcodeOpInfo(0x42, "lab", 4, False), + UcodeOpInfo(0x43, "lbd", 2, False), + UcodeOpInfo(0x44, "lbdy", 2, False), + UcodeOpInfo(0x45, "lbgn", 2, False), + UcodeOpInfo(0x46, "lca", 4, True), + UcodeOpInfo(0x47, "lda", 6, False), + UcodeOpInfo(0x48, "ldap", 2, False), + UcodeOpInfo(0x49, "ldc", 4, True), + UcodeOpInfo(0x4A, "ldef", 4, False), + UcodeOpInfo(0x4B, "ldsp", 2, False), + UcodeOpInfo(0x4C, "lend", 2, False), + UcodeOpInfo(0x4D, "leq", 2, False), + UcodeOpInfo(0x4E, "les", 2, False), + UcodeOpInfo(0x4F, "lex", 2, False), + UcodeOpInfo(0x50, "lnot", 2, False), + UcodeOpInfo(0x51, "loc", 2, False), + UcodeOpInfo(0x52, "lod", 4, False), + UcodeOpInfo(0x53, "lsym", 4, False), + UcodeOpInfo(0x54, "ltrm", 2, False), + UcodeOpInfo(0x55, "max", 2, False), + UcodeOpInfo(0x56, "min", 2, False), + UcodeOpInfo(0x57, "mod", 2, False), + UcodeOpInfo(0x58, "mov", 4, False), + UcodeOpInfo(0x59, "movv", 2, False), + UcodeOpInfo(0x5A, "mpmv", 4, False), + UcodeOpInfo(0x5B, "mpy", 2, False), + UcodeOpInfo(0x5C, "mst", 2, False), + UcodeOpInfo(0x5D, "mus", 4, False), + UcodeOpInfo(0x5E, "neg", 2, False), + UcodeOpInfo(0x5F, "neq", 2, False), + UcodeOpInfo(0x60, "nop", 2, False), + UcodeOpInfo(0x61, "not", 2, False), + UcodeOpInfo(0x62, "odd", 2, False), + UcodeOpInfo(0x63, "optn", 4, False), + UcodeOpInfo(0x64, "par", 4, False), + UcodeOpInfo(0x65, "pdef", 4, False), + UcodeOpInfo(0x66, "pmov", 4, False), + UcodeOpInfo(0x67, "pop", 2, False), + UcodeOpInfo(0x68, "regs", 4, False), + UcodeOpInfo(0x69, "rem", 2, False), + UcodeOpInfo(0x6A, "ret", 2, False), + UcodeOpInfo(0x6B, "rlda", 4, False), + UcodeOpInfo(0x6C, "rldc", 4, True), + UcodeOpInfo(0x6D, "rlod", 4, False), + UcodeOpInfo(0x6E, "rnd", 4, False), + UcodeOpInfo(0x6F, "rpar", 4, False), + UcodeOpInfo(0x70, "rstr", 4, False), + UcodeOpInfo(0x71, "sdef", 4, False), + UcodeOpInfo(0x72, "sgs", 4, False), + UcodeOpInfo(0x73, "shl", 2, False), + UcodeOpInfo(0x74, "shr", 2, False), + UcodeOpInfo(0x75, "sign", 2, False), + UcodeOpInfo(0x76, "sqr", 2, False), + UcodeOpInfo(0x77, "sqrt", 2, False), + UcodeOpInfo(0x78, "ssym", 4, True), + UcodeOpInfo(0x79, "step", 2, False), + UcodeOpInfo(0x7A, "stp", 2, False), + UcodeOpInfo(0x7B, "str", 4, False), + UcodeOpInfo(0x7C, "stsp", 2, False), + UcodeOpInfo(0x7D, "sub", 2, False), + UcodeOpInfo(0x7E, "swp", 4, False), + UcodeOpInfo(0x7F, "tjp", 2, False), + UcodeOpInfo(0x80, "tpeq", 2, False), + UcodeOpInfo(0x81, "tpge", 2, False), + UcodeOpInfo(0x82, "tpgt", 2, False), + UcodeOpInfo(0x83, "tple", 2, False), + UcodeOpInfo(0x84, "tplt", 2, False), + UcodeOpInfo(0x85, "tpne", 2, False), + UcodeOpInfo(0x86, "typ", 4, False), + UcodeOpInfo(0x87, "ubd", 2, False), + UcodeOpInfo(0x88, "ujp", 2, False), + UcodeOpInfo(0x89, "unal", 2, False), + UcodeOpInfo(0x8A, "uni", 4, False), + UcodeOpInfo(0x8B, "vreg", 4, False), + UcodeOpInfo(0x8C, "xjp", 8, False), + UcodeOpInfo(0x8D, "xor", 2, False), + UcodeOpInfo(0x8E, "xpar", 2, False), + UcodeOpInfo(0x8F, "mtag", 2, False), + UcodeOpInfo(0x90, "alia", 2, False), + UcodeOpInfo(0x91, "ildi", 4, False), + UcodeOpInfo(0x92, "isti", 4, False), + UcodeOpInfo(0x93, "irld", 4, False), + UcodeOpInfo(0x94, "irst", 4, False), + UcodeOpInfo(0x95, "ldrc", 4, False), + UcodeOpInfo(0x96, "msym", 4, False), + UcodeOpInfo(0x97, "rcuf", 4, False), + UcodeOpInfo(0x98, "ksym", 4, False), + UcodeOpInfo(0x99, "osym", 4, False), + UcodeOpInfo(0x9A, "irlv", 2, False), + UcodeOpInfo(0x9B, "irsv", 2, False), +] + + +def parse_ucode(ucode: bytes) -> list[UcodeOp]: + ops = [] + pos = 0 + while pos < len(ucode): + opcode = ucode[pos] + mtype = ucode[pos + 1] >> 5 + dtype = ucode[pos + 1] & 0x1F + lexlev = int.from_bytes(ucode[pos + 2 : pos + 4], "big") + i1 = int.from_bytes(ucode[pos + 4 : pos + 8], "big") + pos += 8 + + info = UCODE_OP_INFO[opcode] + size = 4 * info.length + + args = [] + for _ in range(info.length - 2): + args.append(int.from_bytes(ucode[pos : pos + 4], "big")) + pos += 4 + + const = None + string = None + if info.has_const: + const = int.from_bytes(ucode[pos : pos + 4], "big") + pos += 8 + if dtype in (9, 12, 13, 14, 16) or info.name == "comm": + string = ucode[pos : pos + const] + pos += (const + 7) & ~7 + + ops.append( + UcodeOp( + opcode, + info.name, + mtype, + dtype, + lexlev, + i1, + args, + const, + string, + ) + ) + return ops + + +def print_ucode(ucode: list[UcodeOp]): + for op in ucode: + args = " ".join(f"0x{arg:X}" for arg in op.args) print( - f'{i:>9} [{i%256:>3}]: {"extern" if extern else "":<7} {st:<10} {sc:<9} {sym_name:<40}' + f"{op.opcode_name:<4} mtype={op.mtype:X} dtype={op.dtype:X} lexlev={op.lexlev} i1={op.i1} args={args}", + end="", ) + if op.const is not None: + print(f" const=0x{op.const:X}", end="") + if op.string is not None: + print(f" string={op.string!r}", end="") + print() -def find_compiler_command_line(filename, oot_version): +def generate_make_log(oot_version: str) -> list[str]: is_macos = platform.system() == "Darwin" make = "gmake" if is_macos else "make" make_command_line = [ @@ -212,30 +474,28 @@ def find_compiler_command_line(filename, oot_version): "--dry-run", f"VERSION={oot_version}", ] + return subprocess.check_output(make_command_line).decode("utf-8").splitlines() - print(f"Running {make} to find compiler command line ...", file=sys.stderr) - make_output = ( - subprocess.check_output(make_command_line).decode("utf-8").splitlines() - ) +def find_compiler_command_line( + make_log: list[str], filename: Path +) -> Optional[list[str]]: found = 0 - for line in make_output: + for line in make_log: parts = line.split() if "-o" in parts and str(filename) in parts: compiler_command_line = parts found += 1 if found != 1: - print( - f"Could not determine compiler command line for {filename}", file=sys.stderr - ) - sys.exit(1) + return None - print(f'Command line: {" ".join(compiler_command_line)}', file=sys.stderr) return compiler_command_line -def generate_symbol_table(command_line): +def run_cfe( + command_line: list[str], keep_files: bool +) -> Tuple[list[SymbolTableEntry], list[UcodeOp]]: # Assume command line is of the form: # python3 tools/preprocess.py [COMPILER] [COMPILER_ARGS] [INPUT_FILE] input_file = Path(command_line[-1]) @@ -251,11 +511,14 @@ def generate_symbol_table(command_line): subprocess.run(rest + ["-Hf", input_file], check=True) # Read symbol table - return symbol_table_file.read_bytes() + symbol_table = parse_symbol_table(symbol_table_file.read_bytes()) + ucode = parse_ucode(ucode_file.read_bytes()) + return (symbol_table, ucode) finally: # Cleanup - symbol_table_file.unlink(missing_ok=True) - ucode_file.unlink(missing_ok=True) + if not keep_files: + symbol_table_file.unlink(missing_ok=True) + ucode_file.unlink(missing_ok=True) def main(): @@ -265,17 +528,39 @@ def main(): parser.add_argument("filename", metavar="FILE", type=Path, help="C source file") parser.add_argument( "-v", - "--oot-version", + "--version", + dest="oot_version", type=str, default="gc-eu-mq-dbg", help="OOT version (default: gc-eu-mq-dbg)", ) + parser.add_argument( + "--print-ucode", action="store_true", help="Print cfe ucode output" + ) + parser.add_argument( + "--keep-files", + action="store_true", + help="Keep temporary files (symbol table and ucode)", + ) args = parser.parse_args() - command_line = find_compiler_command_line(args.filename, args.oot_version) - data = generate_symbol_table(command_line) - print_symbol_table(data) + print(f"Running make to find compiler command line ...", file=sys.stderr) + make_log = generate_make_log(args.oot_version) + + command_line = find_compiler_command_line(make_log, args.filename) + if command_line is None: + print( + f"Error: could not determine compiler command line for {filename}", + file=sys.stderr, + ) + sys.exit(1) + print(f"Compiler command: {shlex.join(command_line)}", file=sys.stderr) + + symbol_table, ucode = run_cfe(command_line, args.keep_files) + print_symbol_table(symbol_table) + if args.print_ucode: + print_ucode(ucode) if __name__ == "__main__": diff --git a/tools/mkldscript.c b/tools/mkldscript.c index 199c77eb74..586a684b92 100644 --- a/tools/mkldscript.c +++ b/tools/mkldscript.c @@ -64,13 +64,10 @@ static void write_ld_script(FILE *fout) for (j = 0; j < seg->includesCount; j++) { - if (!seg->includes[j].dataOnlyWithinRodata) - { - fprintf(fout, " %s (.text)\n", seg->includes[j].fpath); - if (seg->includes[j].linkerPadding != 0) - fprintf(fout, " . += 0x%X;\n", seg->includes[j].linkerPadding); - fprintf(fout, " . = ALIGN(0x10);\n"); - } + fprintf(fout, " %s (.text)\n", seg->includes[j].fpath); + if (seg->includes[j].linkerPadding != 0) + fprintf(fout, " . += 0x%X;\n", seg->includes[j].linkerPadding); + fprintf(fout, " . = ALIGN(0x10);\n"); } fprintf(fout, " _%sSegmentTextEnd = .;\n", seg->name); @@ -81,9 +78,8 @@ static void write_ld_script(FILE *fout) for (j = 0; j < seg->includesCount; j++) { - if (!seg->includes[j].dataOnlyWithinRodata && !seg->includes[j].noData) - fprintf(fout, " %s (.data)\n" - " . = ALIGN(0x10);\n", seg->includes[j].fpath); + fprintf(fout, " %s (.data)\n" + " . = ALIGN(0x10);\n", seg->includes[j].fpath); } fprintf(fout, " _%sSegmentDataEnd = .;\n", seg->name); @@ -94,10 +90,6 @@ static void write_ld_script(FILE *fout) for (j = 0; j < seg->includesCount; j++) { - if (seg->includes[j].dataOnlyWithinRodata) - fprintf(fout, " %s (.data)\n" - " . = ALIGN(0x10);\n", seg->includes[j].fpath); - // Compilers other than IDO, such as GCC, produce different sections such as // the ones named directly below. These sections do not contain values that // need relocating, but we need to ensure that the base .rodata section @@ -106,12 +98,11 @@ static void write_ld_script(FILE *fout) // the beginning of the entire rodata area in order to remain consistent. // Inconsistencies will lead to various .rodata reloc crashes as a result of // either missing relocs or wrong relocs. - if (!seg->includes[j].dataOnlyWithinRodata) - fprintf(fout, " %s (.rodata)\n" - " %s (.rodata.str*)\n" - " %s (.rodata.cst*)\n" - " . = ALIGN(0x10);\n", - seg->includes[j].fpath, seg->includes[j].fpath, seg->includes[j].fpath); + fprintf(fout, " %s (.rodata)\n" + " %s (.rodata.str*)\n" + " %s (.rodata.cst*)\n" + " . = ALIGN(0x10);\n", + seg->includes[j].fpath, seg->includes[j].fpath, seg->includes[j].fpath); } fprintf(fout, " _%sSegmentRoDataEnd = .;\n", seg->name); @@ -121,17 +112,15 @@ static void write_ld_script(FILE *fout) fprintf(fout, " _%sSegmentSDataStart = .;\n", seg->name); for (j = 0; j < seg->includesCount; j++) - if (!seg->includes[j].dataOnlyWithinRodata) - fprintf(fout, " %s (.sdata)\n" - " . = ALIGN(0x10);\n", seg->includes[j].fpath); + fprintf(fout, " %s (.sdata)\n" + " . = ALIGN(0x10);\n", seg->includes[j].fpath); fprintf(fout, " _%sSegmentSDataEnd = .;\n", seg->name); fprintf(fout, " _%sSegmentOvlStart = .;\n", seg->name); for (j = 0; j < seg->includesCount; j++) - if (!seg->includes[j].dataOnlyWithinRodata) - fprintf(fout, " %s (.ovl)\n", seg->includes[j].fpath); + fprintf(fout, " %s (.ovl)\n", seg->includes[j].fpath); fprintf(fout, " _%sSegmentOvlEnd = .;\n", seg->name); @@ -159,24 +148,20 @@ static void write_ld_script(FILE *fout) seg->name, seg->name, seg->name, seg->name); for (j = 0; j < seg->includesCount; j++) - if (!seg->includes[j].dataOnlyWithinRodata) - fprintf(fout, " %s (.sbss)\n" - " . = ALIGN(0x10);\n", seg->includes[j].fpath); + fprintf(fout, " %s (.sbss)\n" + " . = ALIGN(0x10);\n", seg->includes[j].fpath); for (j = 0; j < seg->includesCount; j++) - if (!seg->includes[j].dataOnlyWithinRodata) - fprintf(fout, " %s (.scommon)\n" - " . = ALIGN(0x10);\n", seg->includes[j].fpath); + fprintf(fout, " %s (.scommon)\n" + " . = ALIGN(0x10);\n", seg->includes[j].fpath); for (j = 0; j < seg->includesCount; j++) - if (!seg->includes[j].dataOnlyWithinRodata) - fprintf(fout, " %s (.bss)\n" - " . = ALIGN(0x10);\n", seg->includes[j].fpath); + fprintf(fout, " %s (.bss)\n" + " . = ALIGN(0x10);\n", seg->includes[j].fpath); for (j = 0; j < seg->includesCount; j++) - if (!seg->includes[j].dataOnlyWithinRodata) - fprintf(fout, " %s (COMMON)\n" - " . = ALIGN(0x10);\n", seg->includes[j].fpath); + fprintf(fout, " %s (COMMON)\n" + " . = ALIGN(0x10);\n", seg->includes[j].fpath); fprintf(fout, " . = ALIGN(0x10);\n" " _%sSegmentBssEnd = .;\n" diff --git a/tools/msgdis.py b/tools/msgdis.py index 35006b10ef..3422988a6c 100755 --- a/tools/msgdis.py +++ b/tools/msgdis.py @@ -4,6 +4,7 @@ # import argparse, re, struct +from pathlib import Path from typing import Callable, Dict, List, Optional, Tuple, TypeVar import version_config @@ -172,63 +173,1271 @@ 0xFF : "ITEM_NONE", } -# From https://stackoverflow.com/questions/241327/remove-c-and-c-comments-using-python -def remove_comments(text : str) -> str: - def replacer(match : re.Match) -> str: - string : str = match.group(0) - if string.startswith("/"): - return " " # note: a space and not an empty string - else: - return string - - pattern = re.compile( - r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"', re.DOTALL | re.MULTILINE - ) - return re.sub(pattern, replacer, text) +sfx_ids = { + 0x0000 : "NA_SE_PL_WALK_GROUND", + 0x0001 : "NA_SE_PL_WALK_SAND", + 0x0002 : "NA_SE_PL_WALK_CONCRETE", + 0x0003 : "NA_SE_PL_WALK_DIRT", + 0x0004 : "NA_SE_PL_WALK_WATER0", + 0x0005 : "NA_SE_PL_WALK_WATER1", + 0x0006 : "NA_SE_PL_WALK_WATER2", + 0x0007 : "NA_SE_PL_WALK_MAGMA", + 0x0008 : "NA_SE_PL_WALK_GRASS", + 0x0009 : "NA_SE_PL_WALK_IRON", + 0x000A : "NA_SE_PL_WALK_LADDER", + 0x000B : "NA_SE_PL_WALK_GLASS", + 0x000C : "NA_SE_PL_WALK_WALL", + 0x000D : "NA_SE_PL_WALK_HEAVYBOOTS", + 0x000E : "NA_SE_PL_DUMMY_14", + 0x000F : "NA_SE_PL_WALK_ICE", + 0x0010 : "NA_SE_PL_JUMP", + 0x0011 : "NA_SE_PL_JUMP_SAND", + 0x0012 : "NA_SE_PL_JUMP_CONCRETE", + 0x0013 : "NA_SE_PL_JUMP_DIRT", + 0x0014 : "NA_SE_PL_JUMP_WATER0", + 0x0015 : "NA_SE_PL_JUMP_WATER1", + 0x0016 : "NA_SE_PL_JUMP_WATER2", + 0x0017 : "NA_SE_PL_JUMP_MAGMA", + 0x0018 : "NA_SE_PL_JUMP_GRASS", + 0x0019 : "NA_SE_PL_JUMP_IRON", + 0x001A : "NA_SE_PL_JUMP_LADDER", + 0x001B : "NA_SE_PL_JUMP_GLASS", + 0x001C : "NA_SE_PL_DUMMY28", + 0x001D : "NA_SE_PL_JUMP_HEAVYBOOTS", + 0x001E : "NA_SE_PL_DUMMY30", + 0x001F : "NA_SE_PL_JUMP_ICE", + 0x0020 : "NA_SE_PL_LAND", + 0x0021 : "NA_SE_PL_LAND_SAND", + 0x0022 : "NA_SE_PL_LAND_CONCRETE", + 0x0023 : "NA_SE_PL_LAND_DIRT", + 0x0024 : "NA_SE_PL_LAND_WATER0", + 0x0025 : "NA_SE_PL_LAND_WATER1", + 0x0026 : "NA_SE_PL_LAND_WATER2", + 0x0027 : "NA_SE_PL_LAND_MAGMA", + 0x0028 : "NA_SE_PL_LAND_GRASS", + 0x0029 : "NA_SE_PL_LAND_IRON", + 0x002A : "NA_SE_PL_LAND_LADDER", + 0x002B : "NA_SE_PL_LAND_GLASS", + 0x002C : "NA_SE_PL_DUMMY_44", + 0x002D : "NA_SE_PL_LAND_HEAVYBOOTS", + 0x002E : "NA_SE_PL_DUMMY_46", + 0x002F : "NA_SE_PL_LAND_ICE", + 0x0030 : "NA_SE_PL_SLIPDOWN", + 0x0031 : "NA_SE_PL_CLIMB_CLIFF", + 0x0032 : "NA_SE_PL_SIT_ON_HORSE", + 0x0033 : "NA_SE_PL_GET_OFF_HORSE", + 0x0034 : "NA_SE_PL_TAKE_OUT_SHIELD", + 0x0035 : "NA_SE_PL_CHANGE_ARMS", + 0x0036 : "NA_SE_PL_CATCH_BOOMERANG", + 0x0037 : "NA_SE_PL_DUMMY_55", + 0x0038 : "NA_SE_PL_DUMMY_56", + 0x0039 : "NA_SE_PL_SWIM", + 0x003A : "NA_SE_PL_THROW", + 0x003B : "NA_SE_PL_BODY_BOUND", + 0x003C : "NA_SE_PL_ROLL", + 0x003D : "NA_SE_PL_SKIP", + 0x003E : "NA_SE_PL_BODY_HIT", + 0x003F : "NA_SE_PL_DAMAGE", + 0x0040 : "NA_SE_PL_SLIP", + 0x0041 : "NA_SE_PL_SLIP_SAND", + 0x0042 : "NA_SE_PL_SLIP_CONCRETE", + 0x0043 : "NA_SE_PL_SLIP_DIRT", + 0x0044 : "NA_SE_PL_SLIP_WATER0", + 0x0045 : "NA_SE_PL_SLIP_WATER1", + 0x0046 : "NA_SE_PL_SLIP_WATER2", + 0x0047 : "NA_SE_PL_SLIP_MAGMA", + 0x0048 : "NA_SE_PL_SLIP_GRASS", + 0x0049 : "NA_SE_PL_SLIP_IRON", + 0x004A : "NA_SE_PL_SLIP_LADDER", + 0x004B : "NA_SE_PL_SLIP_GLASS", + 0x004C : "NA_SE_PL_DUMMY76", + 0x004D : "NA_SE_PL_SLIP_HEAVYBOOTS", + 0x004E : "NA_SE_PL_DUMMY78", + 0x004F : "NA_SE_PL_SLIP_ICE", + 0x0050 : "NA_SE_PL_BOUND", + 0x0051 : "NA_SE_PL_BOUND_SAND", + 0x0052 : "NA_SE_PL_BOUND_CONCRETE", + 0x0053 : "NA_SE_PL_BOUND_DIRT", + 0x0054 : "NA_SE_PL_BOUND_WATER0", + 0x0055 : "NA_SE_PL_BOUND_WATER1", + 0x0056 : "NA_SE_PL_BOUND_WATER2", + 0x0057 : "NA_SE_PL_BOUND_MAGMA", + 0x0058 : "NA_SE_PL_BOUND_GRASS", + 0x0059 : "NA_SE_PL_BOUND_IRON", + 0x005A : "NA_SE_PL_BOUND_LADDER", + 0x005B : "NA_SE_PL_BOUND_WOOD", + 0x005C : "NA_SE_PL_DUMMY_92", + 0x005D : "NA_SE_PL_BOUND_HEAVYBOOTS", + 0x005E : "NA_SE_PL_DUMMY_94", + 0x005F : "NA_SE_PL_BOUND_ICE", + 0x0060 : "NA_SE_PL_DUMMY_96", + 0x0061 : "NA_SE_PL_DUMMY_97", + 0x0062 : "NA_SE_PL_DUMMY_98", + 0x0063 : "NA_SE_PL_FACE_UP", + 0x0064 : "NA_SE_PL_DIVE_BUBBLE", + 0x0065 : "NA_SE_PL_MOVE_BUBBLE", + 0x0066 : "NA_SE_PL_METALEFFECT_KID", + 0x0067 : "NA_SE_PL_METALEFFECT_ADULT", + 0x0068 : "NA_SE_PL_SPARK", + 0x0069 : "NA_SE_PL_PULL_UP_PLANT", + 0x006A : "NA_SE_PL_PULL_UP_ROCK", + 0x006B : "NA_SE_PL_IN_BUBBLE", + 0x006C : "NA_SE_PL_PULL_UP_BIGROCK", + 0x006D : "NA_SE_PL_SWORD_CHARGE", + 0x006E : "NA_SE_PL_FREEZE", + 0x006F : "NA_SE_PL_PULL_UP_POT", + 0x0070 : "NA_SE_PL_KNOCK", + 0x0071 : "NA_SE_PL_CALM_HIT", + 0x0072 : "NA_SE_PL_CALM_PAT", + 0x0073 : "NA_SE_PL_SUBMERGE", + 0x0074 : "NA_SE_PL_FREEZE_S", + 0x0075 : "NA_SE_PL_ICE_BROKEN", + 0x0076 : "NA_SE_PL_SLIP_ICE_LELEL", + 0x0077 : "NA_SE_PL_PUT_OUT_ITEM", + 0x0078 : "NA_SE_PL_PULL_UP_WOODBOX", + 0x0079 : "NA_SE_PL_MAGIC_FIRE", + 0x007A : "NA_SE_PL_MAGIC_WIND_NORMAL", + 0x007B : "NA_SE_PL_MAGIC_WIND_WARP", + 0x007C : "NA_SE_PL_MAGIC_SOUL_NORMAL", + 0x007D : "NA_SE_PL_ARROW_CHARGE_FIRE", + 0x007E : "NA_SE_PL_ARROW_CHARGE_ICE", + 0x007F : "NA_SE_PL_ARROW_CHARGE_LIGHT", + 0x0080 : "NA_SE_PL_DUMMY_128", + 0x0081 : "NA_SE_PL_DUMMY_129", + 0x0082 : "NA_SE_PL_DUMMY_130", + 0x0083 : "NA_SE_PL_PULL_UP_RUTO", + 0x0084 : "NA_SE_PL_DUMMY_132", + 0x0085 : "NA_SE_PL_DUMMY_133", + 0x0086 : "NA_SE_PL_DUMMY_134", + 0x0087 : "NA_SE_PL_DUMMY_135", + 0x0088 : "NA_SE_PL_DUMMY_136", + 0x0089 : "NA_SE_PL_DUMMY_137", + 0x008A : "NA_SE_PL_DUMMY_138", + 0x008B : "NA_SE_PL_DUMMY_139", + 0x008C : "NA_SE_PL_DUMMY_140", + 0x008D : "NA_SE_PL_DUMMY_141", + 0x008E : "NA_SE_PL_DUMMY_142", + 0x008F : "NA_SE_PL_DUMMY_143", + 0x0090 : "NA_SE_PL_DUMMY_144", + 0x0091 : "NA_SE_PL_DUMMY_145", + 0x0092 : "NA_SE_PL_DUMMY_146", + 0x0093 : "NA_SE_PL_DUMMY_147", + 0x0094 : "NA_SE_PL_DUMMY_148", + 0x0095 : "NA_SE_PL_DUMMY_149", + 0x0096 : "NA_SE_PL_DUMMY_150", + 0x0097 : "NA_SE_PL_DUMMY_151", + 0x0098 : "NA_SE_PL_DUMMY_152", + 0x0099 : "NA_SE_PL_DUMMY_153", + 0x009A : "NA_SE_PL_DUMMY_154", + 0x009B : "NA_SE_PL_DUMMY_155", + 0x009C : "NA_SE_PL_DUMMY_156", + 0x009D : "NA_SE_PL_DUMMY_157", + 0x009E : "NA_SE_PL_DUMMY_158", + 0x009F : "NA_SE_PL_DUMMY_159", + 0x00A0 : "NA_SE_PL_DUMMY_160", + 0x00A1 : "NA_SE_PL_DUMMY_161", + 0x00A2 : "NA_SE_PL_DUMMY_162", + 0x00A3 : "NA_SE_PL_DUMMY_163", + 0x00A4 : "NA_SE_PL_DUMMY_164", + 0x00A5 : "NA_SE_PL_DUMMY_165", + 0x00A6 : "NA_SE_PL_DUMMY_166", + 0x00A7 : "NA_SE_PL_DUMMY_167", + 0x00A8 : "NA_SE_PL_DUMMY_168", + 0x00A9 : "NA_SE_PL_DUMMY_169", + 0x00AA : "NA_SE_PL_DUMMY_170", + 0x00AB : "NA_SE_PL_DUMMY_171", + 0x00AC : "NA_SE_PL_DUMMY_172", + 0x00AD : "NA_SE_PL_DUMMY_173", + 0x00AE : "NA_SE_PL_DUMMY_174", + 0x00AF : "NA_SE_PL_DUMMY_175", + 0x00B0 : "NA_SE_PL_CRAWL", + 0x00B1 : "NA_SE_PL_CRAWL_SAND", + 0x00B2 : "NA_SE_PL_CRAWL_CONCRETE", + 0x00B3 : "NA_SE_PL_CRAWL_DIRT", + 0x00B4 : "NA_SE_PL_CRAWL_WATER0", + 0x00B5 : "NA_SE_PL_DUMMY_181", + 0x00B6 : "NA_SE_PL_DUMMY_182", + 0x00B7 : "NA_SE_PL_DUMMY_183", + 0x00B8 : "NA_SE_PL_DUMMY_184", + 0x00B9 : "NA_SE_PL_DUMMY_185", + 0x00BA : "NA_SE_PL_DUMMY_186", + 0x00BB : "NA_SE_PL_CRAWL_WOOD", + 0x00BC : "NA_SE_PL_CRAWL_ICE", + 0x00BD : "NA_SE_PL_DUMMY_189", + 0x00BE : "NA_SE_PL_DUMMY_190", + 0x00BF : "NA_SE_PL_DUMMY_191", + 0x00C0 : "NA_SE_PL_MAGIC_SOUL_FLASH", + 0x00C1 : "NA_SE_PL_ROLL_DUST", + 0x00C2 : "NA_SE_PL_DUMMY_192", + 0x00C3 : "NA_SE_PL_MAGIC_SOUL_BALL", + 0x00C4 : "NA_SE_PL_SPIRAL_HEAL_BEAM", + 0x00C5 : "NA_SE_PL_BOUND_NOWEAPON", + 0x00C6 : "NA_SE_PL_PLANT_GROW_UP", + 0x00C7 : "NA_SE_PL_PLANT_TALLER", + 0x00C8 : "NA_SE_PL_MAGIC_WIND_VANISH", + 0x00C9 : "NA_SE_PL_HOBBERBOOTS_LV", + 0x00CA : "NA_SE_PL_PLANT_MOVE", + 0x00CB : "NA_SE_EV_WALL_MOVE_SP", + 0x00CC : "NA_SE_PL_DUMMY_204", + 0x00CD : "NA_SE_PL_DUMMY_205", + 0x00CE : "NA_SE_PL_DUMMY_206", + 0x00CF : "NA_SE_PL_DUMMY_207", + 0x00D0 : "NA_SE_PL_SLIP_LEVEL", + 0x00D1 : "NA_SE_PL_SLIP_SAND_LEVEL", + 0x00D2 : "NA_SE_PL_SLIP_CONCRETE_LEVEL", + 0x00D3 : "NA_SE_PL_SLIP_DIRT_LEVEL", + 0x00D4 : "NA_SE_PL_SLIP_WATER0_LEVEL", + 0x00D5 : "NA_SE_PL_SLIP_WATER1_LEVEL", + 0x00D6 : "NA_SE_PL_SLIP_WATER2_LEVEL", + 0x00D7 : "NA_SE_PL_SLIP_MAGMA_LEVEL", + 0x00D8 : "NA_SE_PL_SLIP_GRASS_LEVEL", + 0x00D9 : "NA_SE_PL_SLIP_IRON_LEVEL", + 0x00DA : "NA_SE_PL_SLIP_GLASS_LEVEL", + 0x00DB : "NA_SE_PL_SLIP_WOOD_LEVEL", + 0x00DC : "NA_SE_PL_DUMMY_220", + 0x00DD : "NA_SE_PL_DUMMY_221", + 0x00DE : "NA_SE_PL_SLIP_HEAVYBOOTS_LEVEL", + 0x00DF : "NA_SE_PL_SLIP_ICE_LEVEL", + 0x1000 : "NA_SE_IT_SWORD_IMPACT", + 0x1001 : "NA_SE_IT_SWORD_SWING", + 0x1002 : "NA_SE_IT_SWORD_PUTAWAY", + 0x1003 : "NA_SE_IT_SWORD_PICKOUT", + 0x1004 : "NA_SE_IT_ARROW_SHOT", + 0x1005 : "NA_SE_IT_BOOMERANG_THROW", + 0x1006 : "NA_SE_IT_SHIELD_BOUND", + 0x1007 : "NA_SE_IT_BOW_DRAW", + 0x1008 : "NA_SE_IT_SHIELD_REFLECT_SW", + 0x1009 : "NA_SE_IT_ARROW_STICK_HRAD", + 0x100A : "NA_SE_IT_HAMMER_HIT", + 0x100B : "NA_SE_IT_HOOKSHOT_CHAIN", + 0x100C : "NA_SE_IT_SHIELD_REFLECT_MG", + 0x100D : "NA_SE_IT_BOMB_IGNIT", + 0x100E : "NA_SE_IT_BOMB_EXPLOSION", + 0x100F : "NA_SE_IT_BOMB_UNEXPLOSION", + 0x1010 : "NA_SE_IT_BOOMERANG_FLY", + 0x1011 : "NA_SE_IT_SWORD_STRIKE", + 0x1012 : "NA_SE_IT_HAMMER_SWING", + 0x1013 : "NA_SE_IT_HOOKSHOT_REFLECT", + 0x1014 : "NA_SE_IT_ARROW_STICK_CRE", + 0x1015 : "NA_SE_IT_ARROW_STICK_OBJ", + 0x1016 : "NA_SE_IT_DUMMY", + 0x1017 : "NA_SE_IT_DUMMY2", + 0x1018 : "NA_SE_IT_SWORD_SWING_HARD", + 0x1019 : "NA_SE_IT_DUMMY3", + 0x101A : "NA_SE_IT_WALL_HIT_HARD", + 0x101B : "NA_SE_IT_WALL_HIT_SOFT", + 0x101C : "NA_SE_IT_STONE_HIT", + 0x101D : "NA_SE_IT_WOODSTICK_BROKEN", + 0x101E : "NA_SE_IT_LASH", + 0x101F : "NA_SE_IT_SHIELD_POSTURE", + 0x1020 : "NA_SE_IT_SLING_SHOT", + 0x1021 : "NA_SE_IT_SLING_DRAW", + 0x1022 : "NA_SE_IT_SWORD_CHARGE", + 0x1023 : "NA_SE_IT_ROLLING_CUT", + 0x1024 : "NA_SE_IT_SWORD_STRIKE_HARD", + 0x1025 : "NA_SE_IT_SLING_REFLECT", + 0x1026 : "NA_SE_IT_SHIELD_REMOVE", + 0x1027 : "NA_SE_IT_HOOKSHOT_READY", + 0x1028 : "NA_SE_IT_HOOKSHOT_RECEIVE", + 0x1029 : "NA_SE_IT_HOOKSHOT_STICK_OBJ", + 0x102A : "NA_SE_IT_SWORD_REFLECT_MG", + 0x102B : "NA_SE_IT_DEKU", + 0x102C : "NA_SE_IT_WALL_HIT_BUYO", + 0x102D : "NA_SE_IT_SWORD_PUTAWAY_STN", + 0x102E : "NA_SE_IT_ROLLING_CUT_LV1", + 0x102F : "NA_SE_IT_ROLLING_CUT_LV2", + 0x1030 : "NA_SE_IT_BOW_FLICK", + 0x1031 : "NA_SE_IT_BOMBCHU_MOVE", + 0x1032 : "NA_SE_IT_SHIELD_CHARGE_LV1", + 0x1033 : "NA_SE_IT_SHIELD_CHARGE_LV2", + 0x1034 : "NA_SE_IT_SHIELD_CHARGE_LV3", + 0x1035 : "NA_SE_IT_SLING_FLICK", + 0x1036 : "NA_SE_IT_SWORD_STICK_STN", + 0x1037 : "NA_SE_IT_REFLECTION_WOOD", + 0x1038 : "NA_SE_IT_SHIELD_REFLECT_MG2", + 0x1039 : "NA_SE_IT_MAGIC_ARROW_SHOT", + 0x103A : "NA_SE_IT_EXPLOSION_FRAME", + 0x103B : "NA_SE_IT_EXPLOSION_ICE", + 0x103C : "NA_SE_IT_EXPLOSION_LIGHT", + 0x103D : "NA_SE_IT_FISHING_REEL_SLOW", + 0x103E : "NA_SE_IT_FISHING_REEL_HIGH", + 0x103F : "NA_SE_IT_PULL_FISHING_ROD", + 0x1040 : "NA_SE_IT_DM_FLYING_GOD_PASS", + 0x1041 : "NA_SE_IT_DM_FLYING_GOD_DASH", + 0x1042 : "NA_SE_IT_DM_RING_EXPLOSION", + 0x1043 : "NA_SE_IT_DM_RING_GATHER", + 0x1044 : "NA_SE_IT_INGO_HORSE_NEIGH", + 0x1045 : "NA_SE_IT_EARTHQUAKE", + 0x1046 : "NA_SE_IT_DUMMY4", + 0x1047 : "NA_SE_IT_KAKASHI_JUMP", + 0x1048 : "NA_SE_IT_FLAME", + 0x1049 : "NA_SE_IT_SHIELD_BEAM", + 0x104A : "NA_SE_IT_FISHING_HIT", + 0x104B : "NA_SE_IT_GOODS_APPEAR", + 0x104C : "NA_SE_IT_MAJIN_SWORD_BROKEN", + 0x104D : "NA_SE_IT_HAND_CLAP", + 0x104E : "NA_SE_IT_MASTER_SWORD_SWING", + 0x104F : "NA_SE_IT_DUMMY5", + 0x2000 : "NA_SE_EV_DOOR_OPEN", + 0x2001 : "NA_SE_EV_DOOR_CLOSE", + 0x2002 : "NA_SE_EV_EXPLOSION", + 0x2003 : "NA_SE_EV_HORSE_WALK", + 0x2004 : "NA_SE_EV_HORSE_RUN", + 0x2005 : "NA_SE_EV_HORSE_NEIGH", + 0x2006 : "NA_SE_EV_RIVER_STREAM", + 0x2007 : "NA_SE_EV_WATER_WALL_BIG", + 0x2008 : "NA_SE_EV_OUT_OF_WATER", + 0x2009 : "NA_SE_EV_DIVE_WATER", + 0x200A : "NA_SE_EV_ROCK_SLIDE", + 0x200B : "NA_SE_EV_MAGMA_LEVEL", + 0x200C : "NA_SE_EV_BRIDGE_OPEN", + 0x200D : "NA_SE_EV_BRIDGE_CLOSE", + 0x200E : "NA_SE_EV_BRIDGE_OPEN_STOP", + 0x200F : "NA_SE_EV_BRIDGE_CLOSE_STOP", + 0x2010 : "NA_SE_EV_WALL_BROKEN", + 0x2011 : "NA_SE_EV_CHICKEN_CRY_N", + 0x2012 : "NA_SE_EV_CHICKEN_CRY_A", + 0x2013 : "NA_SE_EV_CHICKEN_CRY_M", + 0x2014 : "NA_SE_EV_SLIDE_DOOR_OPEN", + 0x2015 : "NA_SE_EV_FOOT_SWITCH", + 0x2016 : "NA_SE_EV_HORSE_GROAN", + 0x2017 : "NA_SE_EV_BOMB_DROP_WATER", + 0x2018 : "NA_SE_EV_HORSE_JUMP", + 0x2019 : "NA_SE_EV_HORSE_LAND", + 0x201A : "NA_SE_EV_HORSE_SLIP", + 0x201B : "NA_SE_EV_FAIRY_DASH", + 0x201C : "NA_SE_EV_SLIDE_DOOR_CLOSE", + 0x201D : "NA_SE_EV_STONE_BOUND", + 0x201E : "NA_SE_EV_STONE_STATUE_OPEN", + 0x201F : "NA_SE_EV_TBOX_UNLOCK", + 0x2020 : "NA_SE_EV_TBOX_OPEN", + 0x2021 : "NA_SE_SY_TIMER", + 0x2022 : "NA_SE_EV_FLAME_IGNITION", + 0x2023 : "NA_SE_EV_SPEAR_HIT", + 0x2024 : "NA_SE_EV_ELEVATOR_MOVE", + 0x2025 : "NA_SE_EV_WARP_HOLE", + 0x2026 : "NA_SE_EV_LINK_WARP", + 0x2027 : "NA_SE_EV_PILLAR_SINK", + 0x2028 : "NA_SE_EV_WATER_WALL", + 0x2029 : "NA_SE_EV_RIVER_STREAM_S", + 0x202A : "NA_SE_EV_RIVER_STREAM_F", + 0x202B : "NA_SE_EV_HORSE_LAND2", + 0x202C : "NA_SE_EV_HORSE_SANDDUST", + 0x202D : "NA_SE_EV_DUMMY45", + 0x202E : "NA_SE_EV_LIGHTNING", + 0x202F : "NA_SE_EV_BOMB_BOUND", + 0x2030 : "NA_SE_EV_WATERDROP", + 0x2031 : "NA_SE_EV_TORCH", + 0x2032 : "NA_SE_EV_MAGMA_LEVEL_M", + 0x2033 : "NA_SE_EV_FIRE_PILLAR", + 0x2034 : "NA_SE_EV_FIRE_PLATE", + 0x2035 : "NA_SE_EV_BLOCK_BOUND", + 0x2036 : "NA_SE_EV_METALDOOR_SLIDE", + 0x2037 : "NA_SE_EV_METALDOOR_STOP", + 0x2038 : "NA_SE_EV_BLOCK_SHAKE", + 0x2039 : "NA_SE_EV_BOX_BREAK", + 0x203A : "NA_SE_EV_HAMMER_SWITCH", + 0x203B : "NA_SE_EV_MAGMA_LEVEL_L", + 0x203C : "NA_SE_EV_SPEAR_FENCE", + 0x203D : "NA_SE_EV_GANON_HORSE_NEIGH", + 0x203E : "NA_SE_EV_GANON_HORSE_GROAN", + 0x203F : "NA_SE_EV_FANTOM_WARP_S", + 0x2040 : "NA_SE_EV_FANTOM_WARP_L", + 0x2041 : "NA_SE_EV_FOUNTAIN", + 0x2042 : "NA_SE_EV_KID_HORSE_WALK", + 0x2043 : "NA_SE_EV_KID_HORSE_RUN", + 0x2044 : "NA_SE_EV_KID_HORSE_NEIGH", + 0x2045 : "NA_SE_EV_KID_HORSE_GROAN", + 0x2046 : "NA_SE_EV_WHITE_OUT", + 0x2047 : "NA_SE_EV_LIGHT_GATHER", + 0x2048 : "NA_SE_EV_TREE_CUT", + 0x2049 : "NA_SE_EV_VOLCANO", + 0x204A : "NA_SE_EV_GUILLOTINE_UP", + 0x204B : "NA_SE_EV_GUILLOTINE_BOUND", + 0x204C : "NA_SE_EV_ROLLCUTTER_MOTOR", + 0x204D : "NA_SE_EV_CHINETRAP_DOWN", + 0x204E : "NA_SE_EV_PLANT_BROKEN", + 0x204F : "NA_SE_EV_SHIP_BELL", + 0x2050 : "NA_SE_EV_FLUTTER_FLAG", + 0x2051 : "NA_SE_EV_TRAP_BOUND", + 0x2052 : "NA_SE_EV_ROCK_BROKEN", + 0x2053 : "NA_SE_EV_FANTOM_WARP_S2", + 0x2054 : "NA_SE_EV_FANTOM_WARP_L2", + 0x2055 : "NA_SE_EV_COFFIN_CAP_OPEN", + 0x2056 : "NA_SE_EV_COFFIN_CAP_BOUND", + 0x2057 : "NA_SE_EV_WIND_TRAP", + 0x2058 : "NA_SE_EV_TRAP_OBJ_SLIDE", + 0x2059 : "NA_SE_EV_METALDOOR_OPEN", + 0x205A : "NA_SE_EV_METALDOOR_CLOSE", + 0x205B : "NA_SE_EV_BURN_OUT", + 0x205C : "NA_SE_EV_BLOCKSINK", + 0x205D : "NA_SE_EV_CROWD", + 0x205E : "NA_SE_EV_WATER_LEVEL_DOWN", + 0x205F : "NA_SE_EV_NAVY_VANISH", + 0x2060 : "NA_SE_EV_LADDER_DOUND", + 0x2061 : "NA_SE_EV_WEB_VIBRATION", + 0x2062 : "NA_SE_EV_WEB_BROKEN", + 0x2063 : "NA_SE_EV_ROLL_STAND", + 0x2064 : "NA_SE_EV_BUYODOOR_OPEN", + 0x2065 : "NA_SE_EV_BUYODOOR_CLOSE", + 0x2066 : "NA_SE_EV_WOODDOOR_OPEN", + 0x2067 : "NA_SE_EV_METALGATE_OPEN", + 0x2068 : "NA_SE_IT_SCOOP_UP_WATER", + 0x2069 : "NA_SE_EV_FISH_LEAP", + 0x206A : "NA_SE_EV_KAKASHI_SWING", + 0x206B : "NA_SE_EV_KAKASHI_ROLL", + 0x206C : "NA_SE_EV_BOTTLE_CAP_OPEN", + 0x206D : "NA_SE_EV_JABJAB_BREATHE", + 0x206E : "NA_SE_EV_SPIRIT_STONE", + 0x206F : "NA_SE_EV_TRIFORCE_FLASH", + 0x2070 : "NA_SE_EV_FALL_DOWN_DIRT", + 0x2071 : "NA_SE_EV_NAVY_FLY", + 0x2072 : "NA_SE_EV_NAVY_CRASH", + 0x2073 : "NA_SE_EV_WOOD_HIT", + 0x2074 : "NA_SE_EV_SCOOPUP_WATER", + 0x2075 : "NA_SE_EV_DROP_FALL", + 0x2076 : "NA_SE_EV_WOOD_GEAR", + 0x2077 : "NA_SE_EV_TREE_SWING", + 0x2078 : "NA_SE_EV_HORSE_RUN_LEVEL", + 0x2079 : "NA_SE_EV_ELEVATOR_MOVE2", + 0x207A : "NA_SE_EV_ELEVATOR_STOP", + 0x207B : "NA_SE_EV_TRE_BOX_APPEAR", + 0x207C : "NA_SE_EV_CHAIN_KEY_UNLOCK", + 0x207D : "NA_SE_EV_SPINE_TRAP_MOVE", + 0x207E : "NA_SE_EV_HEALING", + 0x207F : "NA_SE_EV_GREAT_FAIRY_APPEAR", + 0x2080 : "NA_SE_EV_GREAT_FAIRY_VANISH", + 0x2081 : "NA_SE_EV_RED_EYE", + 0x2082 : "NA_SE_EV_ROLL_STAND_2", + 0x2083 : "NA_SE_EV_WALL_SLIDE", + 0x2084 : "NA_SE_EV_TRE_BOX_FLASH", + 0x2085 : "NA_SE_EV_WINDMILL_LEVEL", + 0x2086 : "NA_SE_EV_GOTO_HEAVEN", + 0x2087 : "NA_SE_EV_POT_BROKEN", + 0x2088 : "NA_SE_PL_PUT_DOWN_POT", + 0x2089 : "NA_SE_EV_DIVE_INTO_WATER", + 0x208A : "NA_SE_EV_JUMP_OUT_WATER", + 0x208B : "NA_SE_EV_GOD_FLYING", + 0x208C : "NA_SE_EV_TRIFORCE", + 0x208D : "NA_SE_EV_AURORA", + 0x208E : "NA_SE_EV_DEKU_DEATH", + 0x208F : "NA_SE_EV_BUYOSTAND_RISING", + 0x2090 : "NA_SE_EV_BUYOSTAND_FALL", + 0x2091 : "NA_SE_EV_BUYOSHUTTER_OPEN", + 0x2092 : "NA_SE_EV_BUYOSHUTTER_CLOSE", + 0x2093 : "NA_SE_EV_STONEDOOR_STOP", + 0x2094 : "NA_SE_EV_S_STONE_REVIVAL", + 0x2095 : "NA_SE_EV_MEDAL_APPEAR_S", + 0x2096 : "NA_SE_EV_HUMAN_BOUND", + 0x2097 : "NA_SE_EV_MEDAL_APPEAR_L", + 0x2098 : "NA_SE_EV_EARTHQUAKE", + 0x2099 : "NA_SE_EV_SHUT_BY_CRYSTAL", + 0x209A : "NA_SE_EV_GOD_LIGHTBALL_2", + 0x209B : "NA_SE_EV_RUN_AROUND", + 0x209C : "NA_SE_EV_CONSENTRATION", + 0x209D : "NA_SE_EV_TIMETRIP_LIGHT", + 0x209E : "NA_SE_EV_BUYOSTAND_STOP_A", + 0x209F : "NA_SE_EV_BUYOSTAND_STOP_U", + 0x20A0 : "NA_SE_EV_OBJECT_FALL", + 0x20A1 : "NA_SE_EV_JUMP_CONC", + 0x20A2 : "NA_SE_EV_ICE_MELT", + 0x20A3 : "NA_SE_EV_FIRE_PILLAR_S", + 0x20A4 : "NA_SE_EV_BLOCK_RISING", + 0x20A5 : "NA_SE_EV_NABALL_VANISH", + 0x20A6 : "NA_SE_EV_SARIA_MELODY", + 0x20A7 : "NA_SE_EV_LINK_WARP_OUT", + 0x20A8 : "NA_SE_EV_FIATY_HEAL", + 0x20A9 : "NA_SE_EV_CHAIN_KEY_UNLOCK_B", + 0x20AA : "NA_SE_EV_WOODBOX_BREAK", + 0x20AB : "NA_SE_EV_PUT_DOWN_WOODBOX", + 0x20AC : "NA_SE_EV_LAND_DIRT", + 0x20AD : "NA_SE_EV_FLOOR_ROLLING", + 0x20AE : "NA_SE_EV_DOG_CRY_EVENING", + 0x20AF : "NA_SE_EV_JABJAB_HICCUP", + 0x20B0 : "NA_SE_EV_NALE_MAGIC", + 0x20B1 : "NA_SE_EV_FROG_JUMP", + 0x20B2 : "NA_SE_EV_ICE_FREEZE", + 0x20B3 : "NA_SE_EV_BURNING", + 0x20B4 : "NA_SE_EV_WOODPLATE_BOUND", + 0x20B5 : "NA_SE_EV_GORON_WATER_DROP", + 0x20B6 : "NA_SE_EV_JABJAB_GROAN", + 0x20B7 : "NA_SE_EV_DARUMA_VANISH", + 0x20B8 : "NA_SE_EV_BIGBALL_ROLL", + 0x20B9 : "NA_SE_EV_ELEVATOR_MOVE3", + 0x20BA : "NA_SE_EV_DIAMOND_SWITCH", + 0x20BB : "NA_SE_EV_FLAME_OF_FIRE", + 0x20BC : "NA_SE_EV_RAINBOW_SHOWER", + 0x20BD : "NA_SE_EV_FLYING_AIR", + 0x20BE : "NA_SE_EV_PASS_AIR", + 0x20BF : "NA_SE_EV_COME_UP_DEKU_JR", + 0x20C0 : "NA_SE_EV_SAND_STORM", + 0x20C1 : "NA_SE_EV_TRIFORCE_MARK", + 0x20C2 : "NA_SE_EV_GRAVE_EXPLOSION", + 0x20C3 : "NA_SE_EV_LURE_MOVE_W", + 0x20C4 : "NA_SE_EV_POT_MOVE_START", + 0x20C5 : "NA_SE_EV_DIVE_INTO_WATER_L", + 0x20C6 : "NA_SE_EV_OUT_OF_WATER_L", + 0x20C7 : "NA_SE_EV_GANON_MANTLE", + 0x20C8 : "NA_SE_EV_DIG_UP", + 0x20C9 : "NA_SE_EV_WOOD_BOUND", + 0x20CA : "NA_SE_EV_WATER_BUBBLE", + 0x20CB : "NA_SE_EV_ICE_BROKEN", + 0x20CC : "NA_SE_EV_FROG_GROW_UP", + 0x20CD : "NA_SE_EV_WATER_CONVECTION", + 0x20CE : "NA_SE_EV_GROUND_GATE_OPEN", + 0x20CF : "NA_SE_EV_FACE_BREAKDOWN", + 0x20D0 : "NA_SE_EV_FACE_EXPLOSION", + 0x20D1 : "NA_SE_EV_FACE_CRUMBLE_SLOW", + 0x20D2 : "NA_SE_EV_ROUND_TRAP_MOVE", + 0x20D3 : "NA_SE_EV_HIT_SOUND", + 0x20D4 : "NA_SE_EV_ICE_SWING", + 0x20D5 : "NA_SE_EV_DOWN_TO_GROUND", + 0x20D6 : "NA_SE_EV_KENJA_ENVIROMENT_0", + 0x20D7 : "NA_SE_EV_KENJA_ENVIROMENT_1", + 0x20D8 : "NA_SE_EV_SMALL_DOG_BARK", + 0x20D9 : "NA_SE_EV_ZELDA_POWER", + 0x20DA : "NA_SE_EV_RAIN", + 0x20DB : "NA_SE_EV_IRON_DOOR_OPEN", + 0x20DC : "NA_SE_EV_IRON_DOOR_CLOSE", + 0x20DD : "NA_SE_EV_WHIRLPOOL", + 0x20DE : "NA_SE_EV_TOWER_PARTS_BROKEN", + 0x20DF : "NA_SE_EV_COW_CRY", + 0x20E0 : "NA_SE_EV_METAL_BOX_BOUND", + 0x20E1 : "NA_SE_EV_ELECTRIC_EXPLOSION", + 0x20E2 : "NA_SE_EV_HEAVY_THROW", + 0x20E3 : "NA_SE_EV_FROG_CRY_0", + 0x20E4 : "NA_SE_EV_FROG_CRY_1", + 0x20E5 : "NA_SE_EV_COW_CRY_LV", + 0x20E6 : "NA_SE_EV_RONRON_DOOR_CLOSE", + 0x20E7 : "NA_SE_EV_BUTTERFRY_TO_FAIRY", + 0x20E8 : "NA_SE_EV_FIVE_COUNT_LUPY", + 0x20E9 : "NA_SE_EV_STONE_GROW_UP", + 0x20EA : "NA_SE_EV_STONE_LAUNCH", + 0x20EB : "NA_SE_EV_STONE_ROLLING", + 0x20EC : "NA_SE_EV_TOGE_STICK_ROLLING", + 0x20ED : "NA_SE_EV_TOWER_ENERGY", + 0x20EE : "NA_SE_EV_TOWER_BARRIER", + 0x20EF : "NA_SE_EV_CHIBI_WALK", + 0x20F0 : "NA_SE_EV_KNIGHT_WALK", + 0x20F1 : "NA_SE_EV_PILLAR_MOVE_STOP", + 0x20F2 : "NA_SE_EV_ERUPTION_CLOUD", + 0x20F3 : "NA_SE_EV_LINK_WARP_OUT_LV", + 0x20F4 : "NA_SE_EV_LINK_WARP_IN", + 0x20F5 : "NA_SE_EV_OCARINA_BMELO_0", + 0x20F6 : "NA_SE_EV_OCARINA_BMELO_1", + 0x20F7 : "NA_SE_EV_EXPLOSION_FOR_RENZOKU", + 0x3000 : "NA_SE_EN_DODO_J_WALK", + 0x3001 : "NA_SE_EN_DODO_J_CRY", + 0x3002 : "NA_SE_EN_DODO_J_FIRE", + 0x3003 : "NA_SE_EN_DODO_J_DAMAGE", + 0x3004 : "NA_SE_EN_DODO_J_DEAD", + 0x3005 : "NA_SE_EN_DODO_K_CRY", + 0x3006 : "NA_SE_EN_DODO_K_DAMAGE", + 0x3007 : "NA_SE_EN_DODO_K_DEAD", + 0x3008 : "NA_SE_EN_DODO_K_WALK", + 0x3009 : "NA_SE_EN_DODO_K_FIRE", + 0x300A : "NA_SE_EN_GOMA_WALK", + 0x300B : "NA_SE_EN_GOMA_HIGH", + 0x300C : "NA_SE_EN_GOMA_CLIM", + 0x300D : "NA_SE_EN_GOMA_DOWN", + 0x300E : "NA_SE_EN_GOMA_CRY1", + 0x300F : "NA_SE_EN_GOMA_CRY2", + 0x3010 : "NA_SE_EN_GOMA_DAM1", + 0x3011 : "NA_SE_EN_GOMA_DAM2", + 0x3012 : "NA_SE_EN_GOMA_DEAD", + 0x3013 : "NA_SE_EN_GOMA_UNARI", + 0x3014 : "NA_SE_EN_GOMA_BJR_EGG1", + 0x3015 : "NA_SE_EN_GOMA_BJR_EGG2", + 0x3016 : "NA_SE_EN_GOMA_BJR_WALK", + 0x3017 : "NA_SE_EN_GOMA_BJR_CRY", + 0x3018 : "NA_SE_EN_GOMA_BJR_DAM1", + 0x3019 : "NA_SE_EN_GOMA_BJR_DAM2", + 0x301A : "NA_SE_EN_GOMA_BJR_DEAD", + 0x301B : "NA_SE_EN_GOMA_DEMO_EYE", + 0x301C : "NA_SE_EN_GOMA_LAST", + 0x301D : "NA_SE_EN_GOMA_UNARI2", + 0x301E : "NA_SE_EN_GOMA_FAINT", + 0x301F : "NA_SE_EN_GOMA_BJR_FREEZE", + 0x3020 : "NA_SE_EN_DODO_M_CRY", + 0x3021 : "NA_SE_EN_DODO_M_DEAD", + 0x3022 : "NA_SE_EN_DODO_M_MOVE", + 0x3023 : "NA_SE_EN_DODO_M_DOWN", + 0x3024 : "NA_SE_EN_DODO_M_UP", + 0x3025 : "NA_SE_EN_GANON_THROW_MASIC", + 0x3026 : "NA_SE_EN_DODO_M_EAT", + 0x3027 : "NA_SE_EN_GANON_DD_THUNDER", + 0x3028 : "NA_SE_EN_RIZA_ONGND", + 0x3029 : "NA_SE_EN_RIZA_CRY", + 0x302A : "NA_SE_EN_RIZA_ATTACK", + 0x302B : "NA_SE_EN_RIZA_DAMAGE", + 0x302C : "NA_SE_EN_RIZA_WARAU", + 0x302D : "NA_SE_EN_RIZA_DEAD", + 0x302E : "NA_SE_EN_RIZA_WALK", + 0x302F : "NA_SE_EN_RIZA_JUMP", + 0x3030 : "NA_SE_EN_STALKID_WALK", + 0x3031 : "NA_SE_EN_STALKID_ATTACK", + 0x3032 : "NA_SE_EN_STALKID_DAMAGE", + 0x3033 : "NA_SE_EN_STALKID_DEAD", + 0x3034 : "NA_SE_EN_FLOORMASTER_SLIDING", + 0x3035 : "NA_SE_EN_TEKU_WALK_WATER", + 0x3036 : "NA_SE_EN_LIGHT_ARROW_HIT", + 0x3037 : "NA_SE_EN_TUBOOCK_FLY", + 0x3038 : "NA_SE_EN_STAL_WARAU", + 0x3039 : "NA_SE_EN_STAL_SAKEBI", + 0x303A : "NA_SE_EN_STAL_DAMAGE", + 0x303B : "NA_SE_EN_STAL_DEAD", + 0x303C : "NA_SE_EN_WOLFOS_APPEAR", + 0x303D : "NA_SE_EN_STAL_WALK", + 0x303E : "NA_SE_EN_WOLFOS_CRY", + 0x303F : "NA_SE_EN_WOLFOS_ATTACK", + 0x3040 : "NA_SE_EN_FFLY_ATTACK", + 0x3041 : "NA_SE_EN_FFLY_FLY", + 0x3042 : "NA_SE_EN_FFLY_DEAD", + 0x3043 : "NA_SE_EN_WOLFOS_DAMAGE", + 0x3044 : "NA_SE_EN_AMOS_WALK", + 0x3045 : "NA_SE_EN_AMOS_WAVE", + 0x3046 : "NA_SE_EN_AMOS_DEAD", + 0x3047 : "NA_SE_EN_AMOS_DAMAGE", + 0x3048 : "NA_SE_EN_AMOS_VOICE", + 0x3049 : "NA_SE_EN_SHELL_MOUTH", + 0x304A : "NA_SE_EN_SHELL_DEAD", + 0x304B : "NA_SE_EN_WOLFOS_DEAD", + 0x304C : "NA_SE_EN_DODO_K_COLI", + 0x304D : "NA_SE_EN_DODO_K_COLI2", + 0x304E : "NA_SE_EN_DODO_K_ROLL", + 0x304F : "NA_SE_EN_DODO_K_BREATH", + 0x3050 : "NA_SE_EN_DODO_K_DRINK", + 0x3051 : "NA_SE_EN_DODO_K_DOWN", + 0x3052 : "NA_SE_EN_DODO_K_OTAKEBI", + 0x3053 : "NA_SE_EN_DODO_K_END", + 0x3054 : "NA_SE_EN_DODO_K_LAST", + 0x3055 : "NA_SE_EN_DODO_K_LAVA", + 0x3056 : "NA_SE_EN_GANON_FLOAT", + 0x3057 : "NA_SE_EN_GANON_DARKWAVE_M", + 0x3058 : "NA_SE_EN_DODO_J_BREATH", + 0x3059 : "NA_SE_EN_DODO_J_TAIL", + 0x305A : "NA_SE_EN_WOLFOS_WALK", + 0x305B : "NA_SE_EN_DODO_J_EAT", + 0x305C : "NA_SE_EN_DEKU_MOUTH", + 0x305D : "NA_SE_EN_DEKU_ATTACK", + 0x305E : "NA_SE_EN_DEKU_DAMAGE", + 0x305F : "NA_SE_EN_DEKU_DEAD", + 0x3060 : "NA_SE_EN_DEKU_JR_MOUTH", + 0x3061 : "NA_SE_EN_DEKU_JR_ATTACK", + 0x3062 : "NA_SE_EN_DEKU_JR_DEAD", + 0x3063 : "NA_SE_EN_DEKU_SCRAPE", + 0x3064 : "NA_SE_EN_TAIL_FLY", + 0x3065 : "NA_SE_EN_TAIL_CRY", + 0x3066 : "NA_SE_EN_TAIL_DEAD", + 0x3067 : "NA_SE_EN_GANON_SPARK", + 0x3068 : "NA_SE_EN_STALTU_DOWN", + 0x3069 : "NA_SE_EN_STALTU_UP", + 0x306A : "NA_SE_EN_STALTU_LAUGH", + 0x306B : "NA_SE_EN_STALTU_DAMAGE", + 0x306C : "NA_SE_EN_STAL_JUMP", + 0x306D : "NA_SE_EN_TEKU_DAMAGE", + 0x306E : "NA_SE_EN_TEKU_DEAD", + 0x306F : "NA_SE_EN_TEKU_WALK", + 0x3070 : "NA_SE_EN_PO_KANTERA", + 0x3071 : "NA_SE_EN_PO_FLY", + 0x3072 : "NA_SE_EN_PO_AWAY", + 0x3073 : "NA_SE_EN_PO_APPEAR", + 0x3074 : "NA_SE_EN_PO_DISAPPEAR", + 0x3075 : "NA_SE_EN_PO_DAMAGE", + 0x3076 : "NA_SE_EN_PO_DEAD", + 0x3077 : "NA_SE_EN_PO_DEAD2", + 0x3078 : "NA_SE_EN_EXTINCT", + 0x3079 : "NA_SE_EN_GOLON_LAND_BIG", + 0x307A : "NA_SE_EN_RIZA_DOWN", + 0x307B : "NA_SE_EN_DODO_M_GND", + 0x307C : "NA_SE_EN_NUTS_UP", + 0x307D : "NA_SE_EN_NUTS_DOWN", + 0x307E : "NA_SE_EN_NUTS_THROW", + 0x307F : "NA_SE_EN_NUTS_WALK", + 0x3080 : "NA_SE_EN_NUTS_DAMAGE", + 0x3081 : "NA_SE_EN_NUTS_DEAD", + 0x3082 : "NA_SE_EN_NUTS_FAINT", + 0x3083 : "NA_SE_EN_PO_BIG_GET", + 0x3084 : "NA_SE_EN_STALTU_ROLL", + 0x3085 : "NA_SE_EN_STALWALL_DEAD", + 0x3086 : "NA_SE_EN_PO_SISTER_DEAD", + 0x3087 : "NA_SE_EN_BARI_SPLIT", + 0x3088 : "NA_SE_EN_TEKU_REVERSE", + 0x3089 : "NA_SE_EN_VALVAISA_LAND2", + 0x308A : "NA_SE_EN_TEKU_LAND_WATER", + 0x308B : "NA_SE_EN_LAST_DAMAGE", + 0x308C : "NA_SE_EN_STALWALL_ROLL", + 0x308D : "NA_SE_EN_STALWALL_DASH", + 0x308E : "NA_SE_EN_TEKU_JUMP_WATER", + 0x308F : "NA_SE_EN_TEKU_LAND_WATER2", + 0x3090 : "NA_SE_EN_FALL_AIM", + 0x3091 : "NA_SE_EN_FALL_UP", + 0x3092 : "NA_SE_EN_FALL_CATCH", + 0x3093 : "NA_SE_EN_FALL_LAND", + 0x3094 : "NA_SE_EN_FALL_WALK", + 0x3095 : "NA_SE_EN_FALL_DAMAGE", + 0x3096 : "NA_SE_EN_FALL_DEAD", + 0x3097 : "NA_SE_EN_KAICHO_FLUTTER", + 0x3098 : "NA_SE_EN_BIRI_FLY", + 0x3099 : "NA_SE_EN_BIRI_JUMP", + 0x309A : "NA_SE_EN_BIRI_SPARK", + 0x309B : "NA_SE_EN_BIRI_DEAD", + 0x309C : "NA_SE_EN_BIRI_BUBLE", + 0x309D : "NA_SE_EN_BARI_ROLL", + 0x309E : "NA_SE_EN_GOMA_JR_FREEZE", + 0x309F : "NA_SE_EN_BARI_DEAD", + 0x30A0 : "NA_SE_EN_GANON_FIRE", + 0x30A1 : "NA_SE_EN_FANTOM_TRANSFORM", + 0x30A2 : "NA_SE_EN_FANTOM_THUNDER", + 0x30A3 : "NA_SE_EN_FANTOM_SPARK", + 0x30A4 : "NA_SE_EN_FANTOM_FLOAT", + 0x30A5 : "NA_SE_EN_FANTOM_MASIC1", + 0x30A6 : "NA_SE_EN_FANTOM_MASIC2", + 0x30A7 : "NA_SE_EN_FANTOM_FIRE", + 0x30A8 : "NA_SE_EN_FANTOM_HIT_THUNDER", + 0x30A9 : "NA_SE_EN_FANTOM_ATTACK", + 0x30AA : "NA_SE_EN_FANTOM_STICK", + 0x30AB : "NA_SE_EN_FANTOM_EYE", + 0x30AC : "NA_SE_EN_FANTOM_LAST", + 0x30AD : "NA_SE_EN_FANTOM_THUNDER_GND", + 0x30AE : "NA_SE_EN_FANTOM_DAMAGE", + 0x30AF : "NA_SE_EN_FANTOM_DEAD", + 0x30B0 : "NA_SE_EN_FANTOM_LAUGH", + 0x30B1 : "NA_SE_EN_FANTOM_DAMAGE2", + 0x30B2 : "NA_SE_EN_FANTOM_VOICE", + 0x30B3 : "NA_SE_EN_KAICHO_DAMAGE", + 0x30B4 : "NA_SE_EN_GANON_ATTACK_DEMO", + 0x30B5 : "NA_SE_EN_GANON_FIRE_DEMO", + 0x30B6 : "NA_SE_EN_KAICHO_CRY", + 0x30B7 : "NA_SE_EN_KAICHO_ATTACK", + 0x30B8 : "NA_SE_EN_MORIBLIN_WALK", + 0x30B9 : "NA_SE_EN_MORIBLIN_SLIDE", + 0x30BA : "NA_SE_EN_MORIBLIN_ATTACK", + 0x30BB : "NA_SE_EN_MORIBLIN_VOICE", + 0x30BC : "NA_SE_EN_MORIBLIN_SPEAR_AT", + 0x30BD : "NA_SE_EN_MORIBLIN_SPEAR_NORM", + 0x30BE : "NA_SE_EN_MORIBLIN_DEAD", + 0x30BF : "NA_SE_EN_MORIBLIN_DASH", + 0x30C0 : "NA_SE_EN_OCTAROCK_ROCK", + 0x30C1 : "NA_SE_EN_OCTAROCK_FLOAT", + 0x30C2 : "NA_SE_EN_OCTAROCK_JUMP", + 0x30C3 : "NA_SE_EN_OCTAROCK_LAND", + 0x30C4 : "NA_SE_EN_OCTAROCK_SINK", + 0x30C5 : "NA_SE_EN_OCTAROCK_BUBLE", + 0x30C6 : "NA_SE_EN_OCTAROCK_DEAD1", + 0x30C7 : "NA_SE_EN_OCTAROCK_DEAD2", + 0x30C8 : "NA_SE_EN_BUBLE_WING", + 0x30C9 : "NA_SE_EN_BUBLE_MOUTH", + 0x30CA : "NA_SE_EN_BUBLE_LAUGH", + 0x30CB : "NA_SE_EN_BUBLE_BITE", + 0x30CC : "NA_SE_EN_BUBLE_UP", + 0x30CD : "NA_SE_EN_BUBLE_DOWN", + 0x30CE : "NA_SE_EN_BUBLE_DEAD", + 0x30CF : "NA_SE_EN_BUBLEFALL_FIRE", + 0x30D0 : "NA_SE_EN_VALVAISA_APPEAR", + 0x30D1 : "NA_SE_EN_VALVAISA_ROAR", + 0x30D2 : "NA_SE_EN_VALVAISA_MAHI1", + 0x30D3 : "NA_SE_EN_VALVAISA_MAHI2", + 0x30D4 : "NA_SE_EN_VALVAISA_KNOCKOUT", + 0x30D5 : "NA_SE_EN_VALVAISA_DAMAGE1", + 0x30D6 : "NA_SE_EN_VALVAISA_DAMAGE2", + 0x30D7 : "NA_SE_EN_VALVAISA_ROCK", + 0x30D8 : "NA_SE_EN_VALVAISA_SW_NAIL", + 0x30D9 : "NA_SE_EN_VALVAISA_DEAD", + 0x30DA : "NA_SE_EN_VALVAISA_BURN", + 0x30DB : "NA_SE_EN_VALVAISA_FIRE", + 0x30DC : "NA_SE_EN_BARI_DAMAGE", + 0x30DD : "NA_SE_EN_MOFER_CORE_LAND", + 0x30DE : "NA_SE_EN_MOFER_CORE_MOVE_WT", + 0x30DF : "NA_SE_EN_MOFER_CORE_SMJUMP", + 0x30E0 : "NA_SE_EN_MONBLIN_GNDWAVE", + 0x30E1 : "NA_SE_EN_MONBLIN_HAM_DOWN", + 0x30E2 : "NA_SE_EN_MONBLIN_HAM_UP", + 0x30E3 : "NA_SE_EN_BUBLE_DAMAGE", + 0x30E4 : "NA_SE_EN_REDEAD_CRY", + 0x30E5 : "NA_SE_EN_REDEAD_AIM", + 0x30E6 : "NA_SE_EN_REDEAD_DAMAGE", + 0x30E7 : "NA_SE_EN_REDEAD_DEAD", + 0x30E8 : "NA_SE_EN_REDEAD_ATTACK", + 0x30E9 : "NA_SE_EN_NYU_MOVE", + 0x30EA : "NA_SE_EN_NYU_HIT_STOP", + 0x30EB : "NA_SE_EN_KAICHO_DEAD", + 0x30EC : "NA_SE_EN_PO_LAUGH", + 0x30ED : "NA_SE_EN_PO_CRY", + 0x30EE : "NA_SE_EN_PO_ROLL", + 0x30EF : "NA_SE_EN_PO_LAUGH2", + 0x30F0 : "NA_SE_EN_MOFER_APPEAR", + 0x30F1 : "NA_SE_EN_MOFER_ATTACK", + 0x30F2 : "NA_SE_EN_MOFER_WAVE", + 0x30F3 : "NA_SE_EN_MOFER_CATCH", + 0x30F4 : "NA_SE_EN_MOFER_CUT", + 0x30F5 : "NA_SE_EN_MOFER_MOVE_DEMO", + 0x30F6 : "NA_SE_EN_MOFER_BUBLE_DEMO", + 0x30F7 : "NA_SE_EN_MOFER_CORE_JUMP", + 0x30F8 : "NA_SE_EN_MOFER_DEAD", + 0x30F9 : "NA_SE_EN_MOFER_LASTVOICE", + 0x30FA : "NA_SE_EN_MOFER_CORE_ROLL", + 0x30FB : "NA_SE_EN_MOFER_CORE_FLY", + 0x30FC : "NA_SE_EN_GOLON_WAKE_UP", + 0x30FD : "NA_SE_EN_GOLON_SIT_DOWN", + 0x30FE : "NA_SE_EN_CHICKEN_FLUTTER", + 0x30FF : "NA_SE_EN_DEKU_WAKEUP", + 0x3100 : "NA_SE_EN_DEADHAND_BITE", + 0x3101 : "NA_SE_EN_DEADHAND_WALK", + 0x3102 : "NA_SE_EN_DEADHAND_GRIP", + 0x3103 : "NA_SE_EN_DEADHAND_HAND_AT", + 0x3104 : "NA_SE_EN_DAIOCTA_MAHI", + 0x3105 : "NA_SE_EN_DAIOCTA_SPLASH", + 0x3106 : "NA_SE_EN_DAIOCTA_VOICE", + 0x3107 : "NA_SE_EN_DAIOCTA_DAMAGE", + 0x3108 : "NA_SE_EN_DAIOCTA_SINK", + 0x3109 : "NA_SE_EN_DAIOCTA_DEAD", + 0x310A : "NA_SE_EN_DAIOCTA_DEAD2", + 0x310B : "NA_SE_EN_GANON_HIT_THUNDER", + 0x310C : "NA_SE_EN_TWINROBA_APPEAR_MS", + 0x310D : "NA_SE_EN_TWINROBA_TRANSFORM", + 0x310E : "NA_SE_EN_TWINROBA_MS_FIRE", + 0x310F : "NA_SE_EN_TWINROBA_FIRE_EXP", + 0x3110 : "NA_SE_EN_TWINROBA_POWERUP", + 0x3111 : "NA_SE_EN_TWINROBA_SHOOT_FREEZE", + 0x3112 : "NA_SE_EN_TWINROBA_MS_FREEZE", + 0x3113 : "NA_SE_EN_TWINROBA_MASIC_SET", + 0x3114 : "NA_SE_EN_TWINROBA_CUTBODY", + 0x3115 : "NA_SE_EN_GANON_HIT_GND_IMP", + 0x3116 : "NA_SE_EN_TWINROBA_DAMAGE_VOICE", + 0x3117 : "NA_SE_EN_TWINROBA_REFL_FIRE", + 0x3118 : "NA_SE_EN_TWINROBA_REFL_FREEZE", + 0x3119 : "NA_SE_EN_GANON_CUTBODY", + 0x311A : "NA_SE_EN_TWINROBA_YOUNG_DAMAGE", + 0x311B : "NA_SE_EN_TWINROBA_YOUNG_DEAD", + 0x311C : "NA_SE_EN_GOLON_EYE_BIG", + 0x311D : "NA_SE_EN_GOLON_GOOD_BIG", + 0x311E : "NA_SE_EN_TWINROBA_FB_FLY", + 0x311F : "NA_SE_EN_TWINROBA_FLY", + 0x3120 : "NA_SE_EN_TWINROBA_UNARI", + 0x3121 : "NA_SE_EN_TWINROBA_ROLL", + 0x3122 : "NA_SE_EN_TWINROBA_SHOOT_FIRE", + 0x3123 : "NA_SE_EN_TWINROBA_THROW_MASIC", + 0x3124 : "NA_SE_EN_DARUNIA_HIT_BREAST", + 0x3125 : "NA_SE_EN_DARUNIA_HIT_LINK", + 0x3126 : "NA_SE_EN_OWL_FLUTTER", + 0x3127 : "NA_SE_EN_VALVAISA_LAND", + 0x3128 : "NA_SE_EN_IRONNACK_WALK", + 0x3129 : "NA_SE_EN_IRONNACK_SWING_AXE", + 0x312A : "NA_SE_EN_IRONNACK_ARMOR_DEMO", + 0x312B : "NA_SE_EN_IRONNACK_STAGGER_DEMO", + 0x312C : "NA_SE_EN_IRONNACK_ARMOR_OFF_DEMO", + 0x312D : "NA_SE_EN_IRONNACK_ARMOR_LAND1_DEMO", + 0x312E : "NA_SE_EN_IRONNACK_ARMOR_LAND2_DEMO", + 0x312F : "NA_SE_EN_IRONNACK_ARMOR_LAND3_DEMO", + 0x3130 : "NA_SE_EN_FLOORMASTER_ATTACK", + 0x3131 : "NA_SE_EN_FLOORMASTER_SM_WALK", + 0x3132 : "NA_SE_EN_FLOORMASTER_SM_DEAD", + 0x3133 : "NA_SE_EN_FLOORMASTER_RESTORE", + 0x3134 : "NA_SE_EN_FLOORMASTER_EXPAND", + 0x3135 : "NA_SE_EN_FLOORMASTER_SPLIT", + 0x3136 : "NA_SE_EN_FLOORMASTER_SM_STICK", + 0x3137 : "NA_SE_EN_FLOORMASTER_SM_LAND", + 0x3138 : "NA_SE_EN_IRONNACK_WAVE_DEMO", + 0x3139 : "NA_SE_EN_IRONNACK_FINGER_DEMO", + 0x313A : "NA_SE_EN_IRONNACK_ARMOR_HIT", + 0x313B : "NA_SE_EN_NUTS_CUTBODY", + 0x313C : "NA_SE_EN_BALINADE_LEVEL", + 0x313D : "NA_SE_EN_BALINADE_DAMAGE", + 0x313E : "NA_SE_EN_BALINADE_FAINT", + 0x313F : "NA_SE_EN_BALINADE_BREAK", + 0x3140 : "NA_SE_EN_BALINADE_DEAD", + 0x3141 : "NA_SE_EN_BALINADE_STICK", + 0x3142 : "NA_SE_EN_BALINADE_THUNDER", + 0x3143 : "NA_SE_EN_BALINADE_BL_SPARK", + 0x3144 : "NA_SE_EN_BALINADE_BL_DEAD", + 0x3145 : "NA_SE_EN_BALINADE_BREAK2", + 0x3146 : "NA_SE_EN_BALINADE_HIT_RINK", + 0x3147 : "NA_SE_EN_GANON_WAVE_GND", + 0x3148 : "NA_SE_EN_AWA_BOUND", + 0x3149 : "NA_SE_EN_AWA_BREAK", + 0x314A : "NA_SE_EN_BROB_WAVE", + 0x314B : "NA_SE_EN_NYU_DEAD", + 0x314C : "NA_SE_EN_EIER_DAMAGE", + 0x314D : "NA_SE_EN_EIER_DEAD", + 0x314E : "NA_SE_EN_EIER_FLUTTER", + 0x314F : "NA_SE_EN_EIER_FLY", + 0x3150 : "NA_SE_EN_SHADEST_TAIKO_LOW", + 0x3151 : "NA_SE_EN_SHADEST_TAIKO_HIGH", + 0x3152 : "NA_SE_EN_SHADEST_CLAP", + 0x3153 : "NA_SE_EN_SHADEST_FLY_ATTACK", + 0x3154 : "NA_SE_EN_PIHAT_UP", + 0x3155 : "NA_SE_EN_PIHAT_FLY", + 0x3156 : "NA_SE_EN_PIHAT_DAMAGE", + 0x3157 : "NA_SE_EN_PIHAT_LAND", + 0x3158 : "NA_SE_EN_BALINADE_HAND_DOWN", + 0x3159 : "NA_SE_EN_BALINADE_HAND_UP", + 0x315A : "NA_SE_EN_BALINADE_HAND_DAMAGE", + 0x315B : "NA_SE_EN_BALINADE_HAND_DEAD", + 0x315C : "NA_SE_EN_GOMA_JR_WALK", + 0x315D : "NA_SE_EN_GOMA_JR_CRY", + 0x315E : "NA_SE_EN_GOMA_JR_DAM1", + 0x315F : "NA_SE_EN_GOMA_JR_DAM2", + 0x3160 : "NA_SE_EN_GOMA_JR_DEAD", + 0x3161 : "NA_SE_EN_GOMA_EGG1", + 0x3162 : "NA_SE_EN_GOMA_EGG2", + 0x3163 : "NA_SE_EN_GANON_BODY_SPARK", + 0x3164 : "NA_SE_EN_SHADEST_HAND_WAVE", + 0x3165 : "NA_SE_EN_SHADEST_CATCH", + 0x3166 : "NA_SE_EN_SHADEST_LAND", + 0x3167 : "NA_SE_EN_SHADEST_HAND_FLY", + 0x3168 : "NA_SE_EN_SHADEST_SHAKEHAND", + 0x3169 : "NA_SE_EN_SHADEST_DAMAGE", + 0x316A : "NA_SE_EN_SHADEST_DAMAGE_HAND", + 0x316B : "NA_SE_EN_SHADEST_DISAPPEAR", + 0x316C : "NA_SE_EN_GANON_CHARGE_MASIC", + 0x316D : "NA_SE_EN_GANON_THROW_BIG", + 0x316E : "NA_SE_EN_SHADEST_FREEZE", + 0x316F : "NA_SE_EN_SHADEST_DEAD", + 0x3170 : "NA_SE_EN_BIMOS_ROLL_HEAD", + 0x3171 : "NA_SE_EN_BIMOS_LAZER", + 0x3172 : "NA_SE_EN_BIMOS_LAZER_GND", + 0x3173 : "NA_SE_EN_BIMOS_AIM", + 0x3174 : "NA_SE_EN_BUBLEWALK_WALK", + 0x3175 : "NA_SE_EN_BUBLEWALK_AIM", + 0x3176 : "NA_SE_EN_BUBLEWALK_REVERSE", + 0x3177 : "NA_SE_EN_BUBLEWALK_DAMAGE", + 0x3178 : "NA_SE_EN_BUBLEWALK_DEAD", + 0x3179 : "NA_SE_EN_YUKABYUN_FLY", + 0x317A : "NA_SE_EN_FLAME_DAMAGE", + 0x317B : "NA_SE_EN_TWINROBA_FLY_DEMO", + 0x317C : "NA_SE_EN_FLAME_KICK", + 0x317D : "NA_SE_EN_FLAME_RUN", + 0x317E : "NA_SE_EN_FLAME_ROLL", + 0x317F : "NA_SE_EN_FLAME_MAN_RUN", + 0x3180 : "NA_SE_EN_FLAME_MAN_DAMAGE", + 0x3181 : "NA_SE_EN_FLAME_LAUGH", + 0x3182 : "NA_SE_EN_FLAME_MAN_SLIDE", + 0x3183 : "NA_SE_EN_FLAME_FIRE_ATTACK", + 0x3184 : "NA_SE_EN_PIHAT_SM_FLY", + 0x3185 : "NA_SE_EN_PIHAT_SM_DEAD", + 0x3186 : "NA_SE_EN_RIVA_APPEAR", + 0x3187 : "NA_SE_EN_AKINDONUTS_HIDE", + 0x3188 : "NA_SE_EN_RIVA_DAMAGE", + 0x3189 : "NA_SE_EN_RIVA_DEAD", + 0x318A : "NA_SE_EN_RIVA_MOVE", + 0x318B : "NA_SE_EN_FLAME_MAN_SURP", + 0x318C : "NA_SE_EN_SHADEST_LAST", + 0x318D : "NA_SE_EN_SHADEST_MOVE", + 0x318E : "NA_SE_EN_SHADEST_PRAY", + 0x318F : "NA_SE_EN_MGANON_ROAR", + 0x3190 : "NA_SE_EN_LIKE_WALK", + 0x3191 : "NA_SE_EN_LIKE_UNARI", + 0x3192 : "NA_SE_EN_LIKE_DRINK", + 0x3193 : "NA_SE_EN_LIKE_EAT", + 0x3194 : "NA_SE_EN_LIKE_THROW", + 0x3195 : "NA_SE_EN_LIKE_DAMAGE", + 0x3196 : "NA_SE_EN_LIKE_DEAD", + 0x3197 : "NA_SE_EN_MGANON_SWORD", + 0x3198 : "NA_SE_EN_GERUDOFT_ATTACK", + 0x3199 : "NA_SE_EN_GERUDOFT_DAMAGE", + 0x319A : "NA_SE_EN_GERUDOFT_DEAD", + 0x319B : "NA_SE_EN_MGANON_DAMAGE", + 0x319C : "NA_SE_EN_ANUBIS_FIRE", + 0x319D : "NA_SE_EN_ANUBIS_FIREBOMB", + 0x319E : "NA_SE_EN_MGANON_DEAD1", + 0x319F : "NA_SE_EN_ANUBIS_DEAD", + 0x31A0 : "NA_SE_EN_MUSI_LAND", + 0x31A1 : "NA_SE_EN_MGANON_DEAD2", + 0x31A2 : "NA_SE_EN_EIER_ATTACK", + 0x31A3 : "NA_SE_EN_EIER_CRY", + 0x31A4 : "NA_SE_EN_FREEZAD_BREATH", + 0x31A5 : "NA_SE_EN_FREEZAD_DAMAGE", + 0x31A6 : "NA_SE_EN_FREEZAD_DEAD", + 0x31A7 : "NA_SE_EN_DEADHAND_LAUGH", + 0x31A8 : "NA_SE_EN_DEADHAND_HIDE", + 0x31A9 : "NA_SE_EN_DEADHAND_DAMAGE", + 0x31AA : "NA_SE_EN_DEADHAND_HAND_DEAD", + 0x31AB : "NA_SE_EN_DEADHAND_DEAD", + 0x31AC : "NA_SE_EN_IRONNACK_BREAK_PILLAR2", + 0x31AD : "NA_SE_EN_IRONNACK_BREAK_PILLAR", + 0x31AE : "NA_SE_EN_IRONNACK_HIT_GND", + 0x31AF : "NA_SE_EN_MGANON_BREATH", + 0x31B0 : "NA_SE_EN_TWINROBA_LAUGH", + 0x31B1 : "NA_SE_EN_TWINROBA_LAUGH2", + 0x31B2 : "NA_SE_EN_DUMMY434", + 0x31B3 : "NA_SE_EN_TWINROBA_SHOOT_VOICE", + 0x31B4 : "NA_SE_EN_TWINROBA_SENSE", + 0x31B5 : "NA_SE_EN_TWINROBA_DIE", + 0x31B6 : "NA_SE_EN_DUMMY438", + 0x31B7 : "NA_SE_EN_TWINROBA_YOUNG_DAMAGE2", + 0x31B8 : "NA_SE_EN_TWINROBA_YOUNG_SHOOTVC", + 0x31B9 : "NA_SE_EN_TWINROBA_YOUNG_LAUGH", + 0x31BA : "NA_SE_EN_DUMMY442", + 0x31BB : "NA_SE_EN_TWINROBA_YOUNG_WINK", + 0x31BC : "NA_SE_EN_DUMMY444", + 0x31BD : "NA_SE_EN_DUMMY445", + 0x31BE : "NA_SE_EN_IRONNACK_DAMAGE", + 0x31BF : "NA_SE_EN_IRONNACK_DASH", + 0x31C0 : "NA_SE_EN_IRONNACK_DEAD", + 0x31C1 : "NA_SE_EN_IRONNACK_PULLOUT", + 0x31C2 : "NA_SE_EN_IRONNACK_WAKEUP", + 0x31C3 : "NA_SE_EN_DUMMY451", + 0x31C4 : "NA_SE_EN_DUMMY452", + 0x31C5 : "NA_SE_EN_DUMMY453", + 0x31C6 : "NA_SE_EN_GERUDOFT_BREATH", + 0x31C7 : "NA_SE_EN_GANON_LAUGH", + 0x31C8 : "NA_SE_EN_GANON_VOICE_DEMO", + 0x31C9 : "NA_SE_EN_GANON_THROW", + 0x31CA : "NA_SE_EN_GANON_AT_RETURN", + 0x31CB : "NA_SE_EN_GANON_HIT_GND", + 0x31CC : "NA_SE_EN_GANON_DAMAGE1", + 0x31CD : "NA_SE_EN_GANON_DAMAGE2", + 0x31CE : "NA_SE_EN_GANON_DOWN", + 0x31CF : "NA_SE_EN_GANON_RESTORE", + 0x31D0 : "NA_SE_EN_GANON_DEAD", + 0x31D1 : "NA_SE_EN_GANON_BREATH", + 0x31D2 : "NA_SE_EN_GANON_TOKETU", + 0x31D3 : "NA_SE_EN_GANON_CASBREAK", + 0x31D4 : "NA_SE_EN_GANON_BIGMASIC", + 0x31D5 : "NA_SE_EN_GANON_DARKWAVE", + 0x31D6 : "NA_SE_EN_FANTOM_ST_LAUGH", + 0x31D7 : "NA_SE_EN_MGANON_WALK", + 0x31D8 : "NA_SE_EN_MGANON_STAND", + 0x31D9 : "NA_SE_EN_MGANON_UNARI", + 0x31DA : "NA_SE_EN_STALGOLD_ROLL", + 0x31DB : "NA_SE_EN_KDOOR_WAVE", + 0x31DC : "NA_SE_EN_KDOOR_HIT", + 0x31DD : "NA_SE_EN_KDOOR_BREAK", + 0x31DE : "NA_SE_EN_KDOOR_HIT_GND", + 0x31DF : "NA_SE_EN_MGANON_SWDIMP", + 0x31E0 : "NA_SE_EN_STALTU_WAVE", + 0x31E1 : "NA_SE_EN_STALTU_DOWN_SET", + 0x31E2 : "NA_SE_EN_DUMMY482", + 0x31E3 : "NA_SE_EN_GOMA_BJR_LAND", + 0x31E4 : "NA_SE_EN_GOMA_BJR_LAND2", + 0x31E5 : "NA_SE_EN_GOMA_JR_LAND", + 0x31E6 : "NA_SE_EN_GOMA_JR_LAND2", + 0x31E7 : "NA_SE_EN_TWINROBA_FIGHT", + 0x31E8 : "NA_SE_EN_PO_BIG_CRY", + 0x31E9 : "NA_SE_EN_MUSI_SINK", + 0x31EA : "NA_SE_EN_STALGOLD_UP_CRY", + 0x31EB : "NA_SE_EN_GOLON_CRY", + 0x31EC : "NA_SE_EN_MOFER_CORE_DAMAGE", + 0x31ED : "NA_SE_EN_DAIOCTA_LAND_WATER", + 0x31EE : "NA_SE_EN_RIVA_BIG_APPEAR", + 0x31EF : "NA_SE_EN_MONBLIN_HAM_LAND", + 0x31F0 : "NA_SE_EN_MUSI_WALK", + 0x31F1 : "NA_SE_EN_MIMICK_BREATH", + 0x31F2 : "NA_SE_EN_STALWALL_LAUGH", + 0x4000 : "NA_SE_SY_WIN_OPEN", + 0x4001 : "NA_SE_SY_WIN_CLOSE", + 0x4002 : "NA_SE_SY_CORRECT_CHIME", + 0x4003 : "NA_SE_SY_GET_RUPY", + 0x4004 : "NA_SE_SY_MESSAGE_WOMAN", + 0x4005 : "NA_SE_SY_MESSAGE_MAN", + 0x4006 : "NA_SE_SY_ERROR", + 0x4007 : "NA_SE_SY_TRE_BOX_APPEAR", + 0x4008 : "NA_SE_SY_DECIDE", + 0x4009 : "NA_SE_SY_CURSOR", + 0x400A : "NA_SE_SY_CANCEL", + 0x400B : "NA_SE_SY_HP_RECOVER", + 0x400C : "NA_SE_SY_ATTENTION_ON", + 0x400D : "NA_SE_SY_DUMMY_13", + 0x400E : "NA_SE_SY_DUMMY_14", + 0x400F : "NA_SE_SY_LOCK_OFF", + 0x4010 : "NA_SE_SY_LOCK_ON_HUMAN", + 0x4011 : "NA_SE_SY_DUMMY_17", + 0x4012 : "NA_SE_SY_DUMMY_18", + 0x4013 : "NA_SE_SY_CAMERA_ZOOM_UP", + 0x4014 : "NA_SE_SY_CAMERA_ZOOM_DOWN", + 0x4015 : "NA_SE_SY_DUMMY_21", + 0x4016 : "NA_SE_SY_DUMMY_22", + 0x4017 : "NA_SE_SY_ATTENTION_ON_OLD", + 0x4018 : "NA_SE_SY_MESSAGE_PASS", + 0x4019 : "NA_SE_SY_WARNING_COUNT_N", + 0x401A : "NA_SE_SY_WARNING_COUNT_E", + 0x401B : "NA_SE_SY_HITPOINT_ALARM", + 0x401C : "NA_SE_SY_DUMMY_28", + 0x401D : "NA_SE_SY_DEMO_CUT", + 0x401E : "NA_SE_SY_NAVY_CALL", + 0x401F : "NA_SE_SY_GAUGE_UP", + 0x4020 : "NA_SE_SY_DUMMY_32", + 0x4021 : "NA_SE_SY_DUMMY_33", + 0x4022 : "NA_SE_SY_DUMMY_34", + 0x4023 : "NA_SE_SY_PIECE_OF_HEART", + 0x4024 : "NA_SE_SY_GET_ITEM", + 0x4025 : "NA_SE_SY_WIN_SCROLL_LEFT", + 0x4026 : "NA_SE_SY_WIN_SCROLL_RIGHT", + 0x4027 : "NA_SE_SY_OCARINA_ERROR", + 0x4028 : "NA_SE_SY_CAMERA_ZOOM_UP_2", + 0x4029 : "NA_SE_SY_CAMERA_ZOOM_DOWN_2", + 0x402A : "NA_SE_SY_GLASSMODE_ON", + 0x402B : "NA_SE_SY_GLASSMODE_OFF", + 0x402C : "NA_SE_SY_FOUND", + 0x402D : "NA_SE_SY_HIT_SOUND", + 0x402E : "NA_SE_SY_MESSAGE_END", + 0x402F : "NA_SE_SY_RUPY_COUNT", + 0x4030 : "NA_SE_SY_LOCK_ON", + 0x4031 : "NA_SE_SY_GET_BOXITEM", + 0x4032 : "NA_SE_SY_WHITE_OUT_L", + 0x4033 : "NA_SE_SY_WHITE_OUT_S", + 0x4034 : "NA_SE_SY_WHITE_OUT_T", + 0x4035 : "NA_SE_SY_START_SHOT", + 0x4036 : "NA_SE_SY_METRONOME", + 0x4037 : "NA_SE_SY_ATTENTION_URGENCY", + 0x4038 : "NA_SE_SY_METRONOME_LV", + 0x4039 : "NA_SE_SY_FSEL_CURSOR", + 0x403A : "NA_SE_SY_FSEL_DECIDE_S", + 0x403B : "NA_SE_SY_FSEL_DECIDE_L", + 0x403C : "NA_SE_SY_FSEL_CLOSE", + 0x403D : "NA_SE_SY_FSEL_ERROR", + 0x403E : "NA_SE_SY_SET_FIRE_ARROW", + 0x403F : "NA_SE_SY_SET_ICE_ARROW", + 0x4040 : "NA_SE_SY_SET_LIGHT_ARROW", + 0x4041 : "NA_SE_SY_SYNTH_MAGIC_ARROW", + 0x4042 : "NA_SE_SY_METRONOME_2", + 0x4043 : "NA_SE_SY_KINSTA_MARK_APPEAR", + 0x4044 : "NA_SE_SY_FIVE_COUNT_LUPY", + 0x4045 : "NA_SE_SY_CARROT_RECOVER", + 0x4046 : "NA_SE_EV_FAIVE_LUPY_COUNT", + 0x4047 : "NA_SE_SY_DUMMY_71", + 0x5000 : "NA_SE_OC_OCARINA", + 0x5001 : "NA_SE_OC_ABYSS", + 0x5002 : "NA_SE_OC_DOOR_OPEN", + 0x5003 : "NA_SE_OC_SECRET_WARP_IN", + 0x5004 : "NA_SE_OC_SECRET_WARP_OUT", + 0x5005 : "NA_SE_OC_SECRET_HOLE_OUT", + 0x5006 : "NA_SE_OC_REVENGE", + 0x5007 : "NA_SE_OC_HINT_MOVIE", + 0x6000 : "NA_SE_VO_LI_SWORD_N", + 0x6001 : "NA_SE_VO_LI_SWORD_L", + 0x6002 : "NA_SE_VO_LI_LASH", + 0x6003 : "NA_SE_VO_LI_HANG", + 0x6004 : "NA_SE_VO_LI_CLIMB_END", + 0x6005 : "NA_SE_VO_LI_DAMAGE_S", + 0x6006 : "NA_SE_VO_LI_FREEZE", + 0x6007 : "NA_SE_VO_LI_FALL_S", + 0x6008 : "NA_SE_VO_LI_FALL_L", + 0x6009 : "NA_SE_VO_LI_BREATH_REST", + 0x600A : "NA_SE_VO_LI_BREATH_DRINK", + 0x600B : "NA_SE_VO_LI_DOWN", + 0x600C : "NA_SE_VO_LI_TAKEN_AWAY", + 0x600D : "NA_SE_VO_LI_HELD", + 0x600E : "NA_SE_VO_LI_SNEEZE", + 0x600F : "NA_SE_VO_LI_SWEAT", + 0x6010 : "NA_SE_VO_LI_DRINK", + 0x6011 : "NA_SE_VO_LI_RELAX", + 0x6012 : "NA_SE_VO_LI_SWORD_PUTAWAY", + 0x6013 : "NA_SE_VO_LI_GROAN", + 0x6014 : "NA_SE_VO_LI_AUTO_JUMP", + 0x6015 : "NA_SE_VO_LI_MAGIC_NALE", + 0x6016 : "NA_SE_VO_LI_SURPRISE", + 0x6017 : "NA_SE_VO_LI_MAGIC_FROL", + 0x6018 : "NA_SE_VO_LI_PUSH", + 0x6019 : "NA_SE_VO_LI_HOOKSHOT_HANG", + 0x601A : "NA_SE_VO_LI_LAND_DAMAGE_S", + 0x601B : "NA_SE_VO_LI_NULL_0x1b", + 0x601C : "NA_SE_VO_LI_MAGIC_ATTACK", + 0x601D : "NA_SE_VO_BL_DOWN", + 0x601E : "NA_SE_VO_LI_DEMO_DAMAGE", + 0x601F : "NA_SE_VO_LI_ELECTRIC_SHOCK_LV", + 0x6020 : "NA_SE_VO_LI_SWORD_N_KID", + 0x6021 : "NA_SE_VO_LI_ROLLING_CUT_KID", + 0x6022 : "NA_SE_VO_LI_LASH_KID", + 0x6023 : "NA_SE_VO_LI_HANG_KID", + 0x6024 : "NA_SE_VO_LI_CLIMB_END_KID", + 0x6025 : "NA_SE_VO_LI_DAMAGE_S_KID", + 0x6026 : "NA_SE_VO_LI_FREEZE_KID", + 0x6027 : "NA_SE_VO_LI_FALL_S_KID", + 0x6028 : "NA_SE_VO_LI_FALL_L_KID", + 0x6029 : "NA_SE_VO_LI_BREATH_REST_KID", + 0x602A : "NA_SE_VO_LI_BREATH_DRINK_KID", + 0x602B : "NA_SE_VO_LI_DOWN_KID", + 0x602C : "NA_SE_VO_LI_TAKEN_AWAY_KID", + 0x602D : "NA_SE_VO_LI_HELD_KID", + 0x602E : "NA_SE_VO_LI_SNEEZE_KID", + 0x602F : "NA_SE_VO_LI_SWEAT_KID", + 0x6030 : "NA_SE_VO_LI_DRINK_KID", + 0x6031 : "NA_SE_VO_LI_RELAX_KID", + 0x6032 : "NA_SE_VO_LI_SWORD_PUTAWAY_KID", + 0x6033 : "NA_SE_VO_LI_GROAN_KID", + 0x6034 : "NA_SE_VO_LI_AUTO_JUMP_KID", + 0x6035 : "NA_SE_VO_LI_MAGIC_NALE_KID", + 0x6036 : "NA_SE_VO_LI_SURPRISE_KID", + 0x6037 : "NA_SE_VO_LI_MAGIC_FROL_KID", + 0x6038 : "NA_SE_VO_LI_PUSH_KID", + 0x6039 : "NA_SE_VO_LI_HOOKSHOT_HANG_KID", + 0x603A : "NA_SE_VO_LI_LAND_DAMAGE_S_KID", + 0x603B : "NA_SE_VO_LI_NULL_0x1b_KID", + 0x603C : "NA_SE_VO_LI_MAGIC_ATTACK_KID", + 0x603D : "NA_SE_VO_BL_DOWN_KID", + 0x603E : "NA_SE_VO_LI_DEMO_DAMAGE_KID", + 0x603F : "NA_SE_VO_LI_ELECTRIC_SHOCK_LV_KID", + 0x6040 : "NA_SE_VO_NAVY_ENEMY", + 0x6041 : "NA_SE_VO_NAVY_HELLO", + 0x6042 : "NA_SE_VO_NAVY_HEAR", + 0x6043 : "NA_SE_VO_NAVY_CALL", + 0x6044 : "NA_SE_VO_NA_HELLO_3", + 0x6045 : "NA_SE_VO_DUMMY_0x45", + 0x6046 : "NA_SE_VO_DUMMY_0x46", + 0x6047 : "NA_SE_VO_DUMMY_0x47", + 0x6048 : "NA_SE_VO_DUMMY_0x48", + 0x6049 : "NA_SE_VO_DUMMY_0x49", + 0x604A : "NA_SE_VO_DUMMY_0x4a", + 0x604B : "NA_SE_VO_DUMMY_0x4b", + 0x604C : "NA_SE_VO_DUMMY_0x4c", + 0x604D : "NA_SE_VO_DUMMY_0x4d", + 0x604E : "NA_SE_VO_DUMMY_0x4e", + 0x604F : "NA_SE_VO_DUMMY_0x4f", + 0x6050 : "NA_SE_VO_TA_SLEEP", + 0x6051 : "NA_SE_VO_TA_SURPRISE", + 0x6052 : "NA_SE_VO_TA_CRY_0", + 0x6053 : "NA_SE_VO_TA_CRY_1", + 0x6054 : "NA_SE_VO_IN_CRY_0", + 0x6055 : "NA_SE_VO_IN_LOST", + 0x6056 : "NA_SE_VO_IN_LASH_0", + 0x6057 : "NA_SE_VO_IN_LASH_1", + 0x6058 : "NA_SE_VO_FR_LAUGH_0", + 0x6059 : "NA_SE_VO_FR_SMILE_0", + 0x605A : "NA_SE_VO_NB_AGONY", + 0x605B : "NA_SE_VO_NB_CRY_0", + 0x605C : "NA_SE_VO_NB_NOTICE", + 0x605D : "NA_SE_VO_NA_HELLO_0", + 0x605E : "NA_SE_VO_NA_HELLO_1", + 0x605F : "NA_SE_VO_NA_HELLO_2", + 0x6060 : "NA_SE_VO_RT_CRASH", + 0x6061 : "NA_SE_VO_RT_DISCOVER", + 0x6062 : "NA_SE_VO_RT_FALL", + 0x6063 : "NA_SE_VO_RT_LAUGH_0", + 0x6064 : "NA_SE_VO_RT_LIFT", + 0x6065 : "NA_SE_VO_RT_THROW", + 0x6066 : "NA_SE_VO_RT_UNBALLANCE", + 0x6067 : "NA_SE_VO_ST_DAMAGE", + 0x6068 : "NA_SE_VO_ST_ATTACK", + 0x6069 : "NA_SE_VO_Z0_HURRY", + 0x606A : "NA_SE_VO_Z0_MEET", + 0x606B : "NA_SE_VO_Z0_QUESTION", + 0x606C : "NA_SE_VO_Z0_SIGH_0", + 0x606D : "NA_SE_VO_Z0_SMILE_0", + 0x606E : "NA_SE_VO_Z0_SURPRISE", + 0x606F : "NA_SE_VO_Z0_THROW", + 0x6070 : "NA_SE_VO_SK_CRY_0", + 0x6071 : "NA_SE_VO_SK_CRY_1", + 0x6072 : "NA_SE_VO_SK_CRASH", + 0x6073 : "NA_SE_VO_SK_LAUGH", + 0x6074 : "NA_SE_VO_SK_SHOUT", + 0x6075 : "NA_SE_VO_Z1_CRY_0", + 0x6076 : "NA_SE_VO_Z1_CRY_1", + 0x6077 : "NA_SE_VO_Z1_OPENDOOR", + 0x6078 : "NA_SE_VO_Z1_SURPRISE", + 0x6079 : "NA_SE_VO_Z1_PAIN", + 0x607A : "NA_SE_VO_KZ_MOVE", + 0x607B : "NA_SE_VO_NB_LAUGH", + 0x607C : "NA_SE_VO_IN_LAUGH", + 0x607D : "NA_SE_VO_DUMMY_0x7d", + 0x607E : "NA_SE_VO_DUMMY_0x7e", + 0x607F : "NA_SE_VO_DUMMY_0x7f", +} def read4(data : bytes, p : int) -> int: return struct.unpack(">I", data[p:p+4])[0] -def read_baserom_segment(version : str, name : str) -> bytes: - data = None - with open(f"extracted/{version}/baserom/{name}", "rb") as infile: - data = infile.read() - return data - -def write_output_file(version : str, name : str, contents : str): - with open(f"extracted/{version}/text/{name}", "w") as outfile: - outfile.write(contents) - -def read_sfx_ids(): - sfx_tables = ( - (0x0000, "playerbank_table.h"), - (0x1000, "itembank_table.h"), - (0x2000, "environmentbank_table.h"), - (0x3000, "enemybank_table.h"), - (0x4000, "systembank_table.h"), - (0x5000, "ocarinabank_table.h"), - (0x6000, "voicebank_table.h"), - ) - - sfx_ids = {} - - for base,header_name in sfx_tables: - contents = None - with open("include/tables/sfx/" + header_name, "r") as infile: - contents = infile.read() - contents = remove_comments(contents).replace("\\\n", "").strip() - value = base - for line in contents.split("\n"): - line = line.strip() - assert line.startswith("DEFINE_SFX(") and line.endswith(")") - line = line[len("DEFINE_SFX("):-len(")")] - args = [a.strip() for a in line.split(",")] - assert len(args) == 5 - sfx_ids[value] = args[0] - value += 1 - - return sfx_ids - def unique_or_none(lst : List[T]) -> Optional[T]: if not lst: return None @@ -239,8 +1448,7 @@ def unique_or_none(lst : List[T]) -> Optional[T]: return elem class MessageDecoder: - def __init__(self, sfx_ids : Dict[int,str], control_end : int, control_codes : Dict[int, Tuple[str, str, Optional[Tuple[Callable[[int], str]]]]], extraction_charmap : Dict[int, str]) -> None: - self.sfx_ids : Dict[int,str] = sfx_ids + def __init__(self, control_end : int, control_codes : Dict[int, Tuple[str, str, Optional[Tuple[Callable[[int], str]]]]], extraction_charmap : Dict[int, str]) -> None: self.control_end : int = control_end self.control_codes : Dict[int, Tuple[str, str, Optional[Tuple[Callable[[int], str]]]]] = control_codes self.extraction_charmap : Dict[int, str] = extraction_charmap @@ -278,9 +1486,9 @@ def pop_2byte_end(self) -> int: def format_sfx_id(self, c : int) -> str: if c & 0x800: - return self.sfx_ids[c & ~0x800] + return sfx_ids[c & ~0x800] else: - return f"{self.sfx_ids[c]} - SFX_FLAG" + return f"{sfx_ids[c]} - SFX_FLAG" def format_item_id(self, c : int) -> str: return item_ids[c] @@ -496,7 +1704,7 @@ def format_highscore(self, c : int) -> str: }[c] class MessageDecoderJPN(MessageDecoder): - def __init__(self, sfx_ids : Dict[int, str]) -> None: + def __init__(self) -> None: control_end = 0x8170 control_codes = { 0x000A : ("NEWLINE", "", None), @@ -547,7 +1755,7 @@ def __init__(self, sfx_ids : Dict[int, str]) -> None: # Possibly from a SHIFT-JIS extension, python doesn't have builtin support 0x86D3 : "┯", } - super().__init__(sfx_ids, control_end, control_codes, extraction_charmap) + super().__init__(control_end, control_codes, extraction_charmap) self.pop_char = self.pop_2byte self.pop_char_end = self.pop_2byte_end @@ -571,7 +1779,7 @@ def format_color(self, c): }[c1] class MessageDecoderNES(MessageDecoder): - def __init__(self, sfx_ids : Dict[int, str]) -> None: + def __init__(self) -> None: control_end = 0x02 control_codes = { 0x01 : ("NEWLINE", "", None), @@ -652,7 +1860,7 @@ def __init__(self, sfx_ids : Dict[int, str]) -> None: 0xAA : '[Control-Pad]', 0xAB : '[D-Pad]', } - super().__init__(sfx_ids, control_end, control_codes, extraction_charmap) + super().__init__(control_end, control_codes, extraction_charmap) self.pop_char = self.pop_byte self.pop_char_end = self.pop_byte_end @@ -760,7 +1968,7 @@ def decode(self) -> str: return out -def collect_messages(message_tables : List[Optional[MessageTableDesc]], version : str, +def collect_messages(message_tables : List[Optional[MessageTableDesc]], baserom_segments_dir : Path, config : version_config.VersionConfig, code_vram : int, code_bin : bytes): messages : Dict[int,MessageEntry] = {} @@ -771,7 +1979,7 @@ def collect_messages(message_tables : List[Optional[MessageTableDesc]], version if desc is None: continue - baserom_seg = read_baserom_segment(version, desc.seg_name) + baserom_seg = (baserom_segments_dir / desc.seg_name).read_bytes() code_offset = config.variables[desc.table_name] - code_vram if desc.parent is None: @@ -829,21 +2037,40 @@ def collect_messages(message_tables : List[Optional[MessageTableDesc]], version def main(): parser = argparse.ArgumentParser(description="Extract text from the baserom into .h files") - parser.add_argument("version", help="OoT version") + parser.add_argument( + "baserom_segments_dir", + type=Path, + help="Directory of uncompressed ROM segments", + ) + parser.add_argument( + "output_dir", + type=Path, + help="Output directory to place files in", + ) + parser.add_argument( + "-v", + "--version", + dest="oot_version", + required=True, + help="OOT version", + ) args = parser.parse_args() - version : str = args.version + baserom_segments_dir : Path = args.baserom_segments_dir + version : str = args.oot_version + output_dir : Path = args.output_dir + + args.output_dir.mkdir(parents=True, exist_ok=True) config = version_config.load_version_config(version) code_vram = config.dmadata_segments["code"].vram # print(hex(code_vram)) - code_bin = read_baserom_segment(version, "code") + code_bin = (baserom_segments_dir / "code").read_bytes() - sfx_ids = read_sfx_ids() - jpn_decoder = MessageDecoderJPN(sfx_ids) - nes_decoder = MessageDecoderNES(sfx_ids) + jpn_decoder = MessageDecoderJPN() + nes_decoder = MessageDecoderNES() message_tables : List[Optional[MessageTableDesc]] = [None for _ in range(4)] # JP, EN, FR, DE message_table_staff : MessageTableDesc = None @@ -861,8 +2088,8 @@ def main(): message_tables[3] = None message_table_staff = MessageTableDesc("sStaffMessageEntryTable", "staff_message_data_static", nes_decoder, None) - messages = collect_messages(message_tables, version, config, code_vram, code_bin) - staff_messages = collect_messages([message_table_staff], version, config, code_vram, code_bin) + messages = collect_messages(message_tables, baserom_segments_dir, config, code_vram, code_bin) + staff_messages = collect_messages([message_table_staff], baserom_segments_dir, config, code_vram, code_bin) message_data = [] @@ -875,8 +2102,8 @@ def main(): message_data = "\n".join(message_data) message_data_staff = "\n".join(staff_messages[text_id].decode() for text_id in sorted(staff_messages.keys())) - write_output_file(version, "message_data.h", message_data) - write_output_file(version, "message_data_staff.h", message_data_staff) + (output_dir / "message_data.h").write_text(message_data) + (output_dir / "message_data_staff.h").write_text(message_data_staff) if __name__ == "__main__": main() diff --git a/tools/preprocess.py b/tools/preprocess.py deleted file mode 100755 index d84c3eef21..0000000000 --- a/tools/preprocess.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python3 - -# SPDX-FileCopyrightText: © 2024 ZeldaRET -# SPDX-License-Identifier: CC0-1.0 - -# Usage: preprocess.py [compile command minus input file...] [single input file] -# Preprocess a C file to: -# * Re-encode from UTF-8 to EUC-JP (the repo uses UTF-8 for text encoding, but -# the strings in the ROM are encoded in EUC-JP) -# * Replace `#pragma increment_block_number N` with `N` fake structs for -# controlling BSS ordering - -from pathlib import Path -import os -import tempfile -import subprocess -import sys - - -def fail(message): - print(message, file=sys.stderr) - sys.exit(1) - - -def process_file(filename, input, output): - output.write(f'#line 1 "{filename}"\n') - for i, line in enumerate(input, start=1): - if line.startswith("#pragma increment_block_number"): - parts = line.split() - if len(parts) != 3: - fail( - f"{filename}:{i}: increment_block_number must be followed by an integer" - ) - try: - amount = int(parts[2]) - except ValueError: - fail( - f"{filename}:{i}: increment_block_number must be followed by an integer" - ) - # Write fake structs for BSS ordering - for j in range(amount): - output.write(f"struct DummyStruct_{i:05}_{j:03};\n") - output.write(f'#line {i + 1} "{filename}"\n') - else: - output.write(line) - - -def main(): - filename = Path(sys.argv[-1]) - with tempfile.TemporaryDirectory(prefix="oot_") as tmpdir: - tmpfile = Path(tmpdir) / filename.name - - with open(filename, mode="r", encoding="utf-8") as input: - with open(tmpfile, mode="w", encoding="euc-jp") as output: - process_file(filename, input, output) - - compile_command = sys.argv[1:-1] + ["-I", filename.parent, tmpfile] - process = subprocess.run(compile_command) - return process.returncode - - -if __name__ == "__main__": - try: - sys.exit(main()) - except KeyboardInterrupt: - sys.exit(1) diff --git a/tools/preprocess.sh b/tools/preprocess.sh new file mode 100755 index 0000000000..34a5c4d0eb --- /dev/null +++ b/tools/preprocess.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +# Usage: preprocess [flags] -- [compile command minus input file...] [single input file] +# Flags: -v OOT_VERSION (required) +# Preprocess a C file to: +# * Re-encode from UTF-8 to EUC-JP +# (the repo uses UTF-8 for text encoding, but the strings in the ROM are encoded in EUC-JP) +# * Replace `#pragma increment_block_number` (see preprocess_pragma) + +set -e +set -o pipefail + +if [ "${VERBOSE-}" ] +then + set -x +fi + +for i in `seq ${#@}` +do + if [[ "${!i}" = '--' ]] + then + # flags before -- + flags=("${@:1:$(($i - 1))}") + # compile command, between -- and the input source file + compilecmd="${@:$(($i + 1)):$((${#@} - $i - 1))}" + # The last argument, the input source file to be compiled + srcfile="${@: -1}" + break + fi +done + +if [ "${VERBOSE-}" ] +then + echo flags="${flags[@]}" + echo compilecmd="$compilecmd" + echo srcfile="$srcfile" +fi + +while getopts "v:" opt "${flags[@]}" +do + case $opt in + v) + OOT_VERSION=$OPTARG + ;; + ?) + echo "Error: Bad flags" + exit 1 + ;; + esac +done + +if [[ "${!OPTIND}" != '--' ]] +then + echo "Error: Positional arguments in flags not allowed" + exit 1 +fi + +if [ -z "${OOT_VERSION-}" ] +then + echo Missing -v + exit +fi + +# Create a temporary directory, and remove it on script exit +# We use a temp dir instead of a temp file because ido_block_numbers.py and fix_bss.py +# need the symbol table .T file from IDO, which is always named like the input file. +# So we use a file named like the original input file, inside a temp dir. +tempdir=`mktemp -d` +tempfile=$tempdir/`basename $srcfile` +trap "rm -rf $tempdir" EXIT + +# Preprocess pragmas and re-encode from UTF-8 to EUC-JP +{ + printf '#line 1 "%s"\n' "$srcfile" # linemarker + ./tools/preprocess_pragmas $OOT_VERSION "$srcfile" < "$srcfile" +} | iconv -f UTF-8 -t EUC-JP > "$tempfile" + +# Also include the source file's directory to have the include path as if we compiled the original source. +# Pass the processed temporary file for compilation. +$compilecmd -I `dirname $srcfile` $tempfile diff --git a/tools/preprocess_pragmas.c b/tools/preprocess_pragmas.c new file mode 100644 index 0000000000..5e750aab02 --- /dev/null +++ b/tools/preprocess_pragmas.c @@ -0,0 +1,154 @@ + +// SPDX-FileCopyrightText: © 2024 ZeldaRET +// SPDX-License-Identifier: CC0-1.0 + +// Usage: preprocess_pragmas OOT_VERSION filename < source.c +// The filename argument is only used for linemarkers. +// Preprocess C source on stdin, writes to stdout +// Replace `#pragma increment_block_number` with fake structs for controlling BSS ordering. +// The names of these fake structs are expected to be increment_block_number_%d_%d with the first number indicating +// the line number of the #pragma in the original source file. (this is for use by fix_bss.py) + +#include +#include +#include +#include +#include +#include + +const char str_pragma_increment_block_number[] = "#pragma increment_block_number"; + +int main(int argc, char** argv) { + if (argc != 3) { + fprintf(stderr, "Usage: preprocess_pragmas OOT_VERSION filename < source.c\n"); + return EXIT_FAILURE; + } + char* const version = argv[1]; + char* const filename = argv[2]; + + const size_t len_version = strlen(version); + char version_needle[len_version + 2]; + memcpy(version_needle, version, len_version); + version_needle[len_version] = ':'; + version_needle[len_version + 1] = '\0'; + + char buf[32 * 1024]; + char* const bufend = buf + sizeof(buf); + char* bufp = buf; + bool cont = true; + int line_num = 1; + // whether the current line follows a #pragma increment_block_number, + // including continuation lines (lines after a \-ending line) + bool is_in_pragma = false; + // the line where the #pragma increment_block_number is + int pragma_line_number; + // how many fake structs to write to replace the current pragma + int n_fake_structs; + + while (cont) { + size_t nread = fread(bufp, 1, bufend - bufp, stdin); + bufp += nread; + if (nread == 0) { + if (!feof(stdin)) { + perror("fread"); + fprintf(stderr, "Failed to read from stdin\n"); + return EXIT_FAILURE; + } + cont = false; + if (bufp == buf) { + // All lines processed + break; + } else { + // The buffer contains the last line and that line isn't terminated with a newline. + // Add a final newline and do one last iteration. + assert(bufp < bufend); + *bufp = '\n'; + bufp++; + } + } + + char* last_newline = NULL; + for (char* p = bufp - 1; p >= buf; p--) { + if (*p == '\n') { + last_newline = p; + break; + } + } + if (last_newline == NULL) { + // No newline, read more data. + // Assert there is space for it (there should be no line long enough to not fit in buf). + assert(bufp < bufend); + continue; + } + + char* line = buf; + while (true) { + char* line_end = line; + while (*line_end != '\n') { + line_end++; + assert(line_end <= last_newline); + } + if (!strncmp(line, str_pragma_increment_block_number, strlen(str_pragma_increment_block_number))) { + is_in_pragma = true; + pragma_line_number = line_num; + n_fake_structs = 0; + } + if (is_in_pragma) { + *line_end = '\0'; + char* version_amount_item = strstr(line, version_needle); + if (version_amount_item != NULL) { + char* version_amount_str_start = &version_amount_item[len_version + 1]; + char* version_amount_str_end; + long amount = strtol(version_amount_str_start, &version_amount_str_end, 10); + if (version_amount_str_start == version_amount_str_end) { + fprintf(stderr, "Found version %s in pragma line but no amount integer\n", version); + fprintf(stderr, "%s\n", line); + return EXIT_FAILURE; + } + n_fake_structs = (int)amount; + } + } else { + char* p = line; + size_t sz = line_end + 1 - line; + while (sz != 0) { + size_t nwritten = fwrite(p, 1, sz, stdout); + if (nwritten == 0) { + fprintf(stderr, "Failed to write to stdout\n"); + return EXIT_FAILURE; + } + p += nwritten; + sz -= nwritten; + } + } + if (is_in_pragma && line_end[-1] != '\\') { + is_in_pragma = false; + + // Always generate at least one struct, + // so that fix_bss.py can know where the increment_block_number pragmas are + if (n_fake_structs == 0) { + n_fake_structs = 256; + } + + // Write fake structs for BSS ordering + // pragma_line_number is used for symbol uniqueness, + // and also by fix_bss.py to locate the pragma these symbols originate from. + for (int i = 0; i < n_fake_structs; i++) + fprintf(stdout, "struct increment_block_number_%05d_%03d;\n", pragma_line_number, i); + fprintf(stdout, "#line %d \"%s\"\n", line_num + 1, filename); + } + line_num++; + if (line_end == last_newline) + break; + line = line_end + 1; + } + assert(bufp <= bufend); + assert(bufp > last_newline); + char* next_incomplete_line_start = last_newline + 1; + ptrdiff_t next_incomplete_line_sz = bufp - next_incomplete_line_start; + assert(next_incomplete_line_sz >= 0); + memmove(buf, next_incomplete_line_start, next_incomplete_line_sz); + bufp = buf + next_incomplete_line_sz; + } + + return EXIT_SUCCESS; +} diff --git a/tools/spec.c b/tools/spec.c index b13455867c..962cf4bb25 100644 --- a/tools/spec.c +++ b/tools/spec.c @@ -136,8 +136,6 @@ static const char *const stmtNames[] = [STMT_entry] = "entry", [STMT_flags] = "flags", [STMT_include] = "include", - [STMT_include_data_only_within_rodata] = "include_data_only_within_rodata", - [STMT_include_no_data] = "include_no_data", [STMT_name] = "name", [STMT_number] = "number", [STMT_romalign] = "romalign", @@ -159,8 +157,7 @@ STMTId get_stmt_id_by_stmt_name(const char *stmtName, int lineNum) { bool parse_segment_statement(struct Segment *currSeg, STMTId stmt, char* args, int lineNum) { // ensure no duplicates (except for 'include' or 'pad_text') - if (stmt != STMT_include && stmt != STMT_include_data_only_within_rodata && - stmt != STMT_include_no_data && stmt != STMT_pad_text && + if (stmt != STMT_include && stmt != STMT_pad_text && (currSeg->fields & (1 << stmt))) util_fatal_error("line %i: duplicate '%s' statement", lineNum, stmtNames[stmt]); @@ -213,8 +210,6 @@ bool parse_segment_statement(struct Segment *currSeg, STMTId stmt, char* args, i util_fatal_error("line %i: alignment is not a power of two", lineNum); break; case STMT_include: - case STMT_include_data_only_within_rodata: - case STMT_include_no_data: currSeg->includesCount++; currSeg->includes = realloc(currSeg->includes, currSeg->includesCount * sizeof(*currSeg->includes)); @@ -222,8 +217,6 @@ bool parse_segment_statement(struct Segment *currSeg, STMTId stmt, char* args, i util_fatal_error("line %i: invalid filename", lineNum); currSeg->includes[currSeg->includesCount - 1].linkerPadding = 0; - currSeg->includes[currSeg->includesCount - 1].dataOnlyWithinRodata = (stmt == STMT_include_data_only_within_rodata); - currSeg->includes[currSeg->includesCount - 1].noData = (stmt == STMT_include_no_data); break; case STMT_increment: if (!parse_number(args, &currSeg->increment)) diff --git a/tools/spec.h b/tools/spec.h index 6b01b34755..734b1ba8c3 100644 --- a/tools/spec.h +++ b/tools/spec.h @@ -14,8 +14,6 @@ typedef enum { STMT_entry, STMT_flags, STMT_include, - STMT_include_data_only_within_rodata, - STMT_include_no_data, STMT_name, STMT_number, STMT_romalign, @@ -35,8 +33,6 @@ enum { struct Include { char* fpath; int linkerPadding; - bool dataOnlyWithinRodata; - bool noData; }; typedef struct Segment { diff --git a/tools/tests/README b/tools/tests/README new file mode 100644 index 0000000000..843622e417 --- /dev/null +++ b/tools/tests/README @@ -0,0 +1 @@ +This folder contains tests for the tools living in this repo. diff --git a/tools/tests/test_preprocess_pragmas.py b/tools/tests/test_preprocess_pragmas.py new file mode 100644 index 0000000000..16caf3fd62 --- /dev/null +++ b/tools/tests/test_preprocess_pragmas.py @@ -0,0 +1,107 @@ +import difflib +from pathlib import Path +import subprocess + + +# change to True to print output source on failed tests +PRINT_FAILED_OUTPUT = False + +PREPROCESS_PRAGMAS_P = Path("tools/preprocess_pragmas") + + +def fake_struct(pragma_line, i): + return f"struct increment_block_number_{pragma_line:05}_{i:03};" + + +def fake_structs(pragma_line, amount): + return "\n".join(fake_struct(pragma_line, i) for i in range(amount)) + + +data = { + "test_noarg": ( + "gc-us", + "source.c", + """\ +abc +#pragma increment_block_number +def +""", + f"""\ +abc +{fake_structs(2, 256)} +#line 3 "source.c" +def +""", + ), + "test_one_arg_match": ( + "gc-us", + "source.c", + """\ +abc +#pragma increment_block_number "gc-us:17" +def +""", + f"""\ +abc +{fake_structs(2, 17)} +#line 3 "source.c" +def +""", + ), + "test_one_arg_no_match": ( + "gc-us", + "source.c", + """\ +abc +#pragma increment_block_number "gc-us-mq:17" +def +""", + f"""\ +abc +{fake_structs(2, 256)} +#line 3 "source.c" +def +""", + ), + "test_several_args": ( + "gc-us", + "source.c", + """\ +abc +#pragma increment_block_number "gc-us-mq:200 gc-us:250" +def +""", + f"""\ +abc +{fake_structs(2, 250)} +#line 3 "source.c" +def +""", + ), +} + +for test_name, (version, filename, source_in, expected_source_out) in data.items(): + p = subprocess.Popen( + [str(PREPROCESS_PRAGMAS_P), version, filename], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + encoding="UTF-8", + ) + source_out, _ = p.communicate(input=source_in) + if p.returncode != 0: + print(f"{PREPROCESS_PRAGMAS_P} ended with {p.returncode} on {test_name}") + exit(1) + if source_out != expected_source_out: + print(f"failed test {test_name}") + if PRINT_FAILED_OUTPUT: + print(source_out) + for l in difflib.unified_diff( + expected_source_out.splitlines(), + source_out.splitlines(), + "expected output", + "actual output", + ): + print(l) + exit(1) + +print("all tests ok") diff --git a/tools/version_config.py b/tools/version_config.py index 6ca203fd59..9377637763 100644 --- a/tools/version_config.py +++ b/tools/version_config.py @@ -20,12 +20,15 @@ class VersionConfig: # Version name version: str + checksums: list[str] # ROM offset to start of DMA table dmadata_start: int # Whether the languages are PAL (EN/DE/FR) or not (JP/EN) text_lang_pal: bool # DMA segment information, in ROM order dmadata_segments: OrderedDict[str, SegmentInfo] + # ROM pieces that are copied directly into the build with .incbin + incbins: list[IncbinConfig] # Addresses of important variables needed for asset extraction variables: dict[str, int] # Assets to extract @@ -38,6 +41,14 @@ class SegmentInfo: vram: Optional[int] +@dataclasses.dataclass +class IncbinConfig: + name: str + segment: str + vram: int + size: int + + @dataclasses.dataclass class AssetConfig: name: str @@ -61,6 +72,14 @@ def load_version_config(version: str) -> VersionConfig: with open(PROJECT_ROOT / f"baseroms/{version}/config.yml", "r") as f: config = yaml.load(f, Loader=yaml.Loader) + incbins = [] + for incbin in config["incbins"]: + incbins.append( + IncbinConfig( + incbin["name"], incbin["segment"], incbin["vram"], incbin["size"] + ) + ) + assets = [] for asset in config["assets"]: name = asset["name"] @@ -71,9 +90,11 @@ def load_version_config(version: str) -> VersionConfig: return VersionConfig( version=version, + checksums=config.get("checksums", ["checksum"]), dmadata_start=config["dmadata_start"], text_lang_pal=config["text_lang_pal"], dmadata_segments=load_dmadata_segments(version), + incbins=incbins, variables=config["variables"], assets=assets, )